mirror of
https://gh.wpcy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-04-21 08:52:46 +08:00
* Initial refactor commit
* ✅ Added build and tests CI/CD
* update: add src for admin settings
* update: incorrect constant names
* update: namespace
* add: accessibility settings
* update: webpack to output files inside a folder
* update: build output folders
* update: removed commented code
* update: npm scripts
* add: webpack config
* add: hooks
* update: move admin setting to the module folder
* update: assets loading logic
* update: add rule to move jsx props to multiline imporving readability
* add: connect modal
* update: hooks import for better readability
* update: replace functions with hooks
* add: connect module
* add: settings and get settings route
* add: hooks and contexts to get settings
* add: hooks
* add: notification component
* add: data api
* add: settings provider and connect settings
* add: husky
* add: icon size control
* fix: icon size control labels
* add: icon select component
* add: color picker component
* add: accessibility icons
* add: icon export
* update: add icons to the component
* fix: styling for the icon select control
* update: color picker with react-colorful component
* update: icon size component with live icon design
* fix: styling of radio boxes
* add: icon design settings layout
* add: position settings layout
* add: layout exports
* add: alignment matrix and position control components
* add: position settings & position settings for mobile layout
* fix: formatting and text-domain
* update: filter names
* fix: hook import
* add: set function for settings
* add: prop-types package
* update: refactor notification component and context
* update: remove filter for authorize url
* update: imports and exports of hooks
* update: plugin settings context filename and relevant imports
* update: icons and icon imports
* add: sidebar(wip)
* update: fix width of connect screen on mobile
* update: sidebar layout
* Update modules/settings/assets/js/components/color-picker/style.css
Co-authored-by: Raz Ohad <admin@bainternet.info>
* update: color picker class name
* add: credit card and user arrow icons
* update: hidden wpfooter and fixed sidebar height
* update: sidebar layout
* add: basic page layouts
* update: sidebar layout
* add: sidebar menu, sidebar app bar and my account menu components
* update: add sidebar and menu settings
* update: add page layouts
* update: admin top bar
* add: bottom bar
* add: bottom bar and top bar
* add: bottom bar and top bar
* update: page content styling
* fix: styling
* fix: styling
* update: text domain
* add: props to wrapper
* add: icon design and position setting layouts
* add: in page scroll behaviour to the settings
* add: widget icons and getter function
* update: icon design settings getter and setter functions
* update: imports
* add: mobile layout for position settings
* add: icon position settings
* add: icon position settings hooks and handlers
* fix: alignment of controls in AlignmentMatrixControl
* update: useSettings and usePositionSetting hooks and relevant functions
* fix: colors of AlignmentMatrixControl
* fix: styling of components and layouts
* add: aliases
* add: container wrapper to page
* update: accessibility options rendering logic
* fix: order of the icons
* add: aliases for components and hooks imports
* fix: styling of settings panel
* fix: container height for settings page
* update: toggle control states
* add: widget icon settings
* add: load saved widget icon settings
* update: move layout to page for different designs per page
* update: add changes tracking and disable button logic
* add: async/await to save settings
* update: convert options to array of objects
* Update modules/settings/assets/js/components/bottom-bar/index.js
Co-authored-by: VasylD <vasyld@elementor.red>
* Update modules/settings/assets/js/app.js
Co-authored-by: VasylD <vasyld@elementor.red>
* fix: remove duplicate entries
---------
Co-authored-by: Ohad <ohad@elementor.com>
Co-authored-by: Raz Ohad <admin@bainternet.info>
Co-authored-by: VasylD <vasyld@elementor.red>
40 lines
876 B
JavaScript
40 lines
876 B
JavaScript
import { useSettings } from '@ea11y/hooks';
|
|
import { useCallback } from '@wordpress/element';
|
|
|
|
export const useIconPosition = () => {
|
|
const { iconPosition, setIconPosition, setHasChanges } = useSettings();
|
|
|
|
const updateIconPosition = useCallback(
|
|
(device, key, value) => {
|
|
setIconPosition((prevState) => ({
|
|
...prevState,
|
|
[device]: {
|
|
...prevState[device],
|
|
[key]: value,
|
|
},
|
|
}));
|
|
setHasChanges(true);
|
|
},
|
|
[setIconPosition],
|
|
);
|
|
|
|
const updateExactPosition = (device, axis, direction, value, unit) => {
|
|
setIconPosition((prevState) => ({
|
|
...prevState,
|
|
[device]: {
|
|
...prevState[device],
|
|
exactPosition: {
|
|
...prevState[device].exactPosition,
|
|
[axis]: {
|
|
direction,
|
|
value,
|
|
unit,
|
|
},
|
|
},
|
|
},
|
|
}));
|
|
setHasChanges(true);
|
|
};
|
|
|
|
return { iconPosition, updateIconPosition, updateExactPosition };
|
|
};
|