@elementor/editor-editing-panel 4.0.0-591 → 4.0.0-598

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementor/editor-editing-panel",
3
- "version": "4.0.0-591",
3
+ "version": "4.0.0-598",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,28 +39,28 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor": "4.0.0-591",
43
- "@elementor/editor-canvas": "4.0.0-591",
44
- "@elementor/editor-controls": "4.0.0-591",
45
- "@elementor/editor-documents": "4.0.0-591",
46
- "@elementor/editor-elements": "4.0.0-591",
47
- "@elementor/editor-interactions": "4.0.0-591",
48
- "@elementor/editor-panels": "4.0.0-591",
49
- "@elementor/editor-props": "4.0.0-591",
50
- "@elementor/editor-responsive": "4.0.0-591",
51
- "@elementor/editor-styles": "4.0.0-591",
52
- "@elementor/editor-styles-repository": "4.0.0-591",
53
- "@elementor/editor-ui": "4.0.0-591",
54
- "@elementor/editor-v1-adapters": "4.0.0-591",
42
+ "@elementor/editor": "4.0.0-598",
43
+ "@elementor/editor-canvas": "4.0.0-598",
44
+ "@elementor/editor-controls": "4.0.0-598",
45
+ "@elementor/editor-documents": "4.0.0-598",
46
+ "@elementor/editor-elements": "4.0.0-598",
47
+ "@elementor/editor-interactions": "4.0.0-598",
48
+ "@elementor/editor-panels": "4.0.0-598",
49
+ "@elementor/editor-props": "4.0.0-598",
50
+ "@elementor/editor-responsive": "4.0.0-598",
51
+ "@elementor/editor-styles": "4.0.0-598",
52
+ "@elementor/editor-styles-repository": "4.0.0-598",
53
+ "@elementor/editor-ui": "4.0.0-598",
54
+ "@elementor/editor-v1-adapters": "4.0.0-598",
55
55
  "@elementor/icons": "^1.63.0",
56
- "@elementor/editor-variables": "4.0.0-591",
57
- "@elementor/locations": "4.0.0-591",
58
- "@elementor/menus": "4.0.0-591",
59
- "@elementor/schema": "4.0.0-591",
60
- "@elementor/session": "4.0.0-591",
56
+ "@elementor/editor-variables": "4.0.0-598",
57
+ "@elementor/locations": "4.0.0-598",
58
+ "@elementor/menus": "4.0.0-598",
59
+ "@elementor/schema": "4.0.0-598",
60
+ "@elementor/session": "4.0.0-598",
61
61
  "@elementor/ui": "1.36.17",
62
- "@elementor/utils": "4.0.0-591",
63
- "@elementor/wp-media": "4.0.0-591",
62
+ "@elementor/utils": "4.0.0-598",
63
+ "@elementor/wp-media": "4.0.0-598",
64
64
  "@wordpress/i18n": "^5.13.0"
65
65
  },
66
66
  "peerDependencies": {
@@ -25,13 +25,26 @@ type State = {
25
25
  label: string;
26
26
  };
27
27
 
28
- const STATES: State[] = [
28
+ const DEFAULT_PSEUDO_STATES: State[] = [
29
29
  { key: 'normal', value: null, label: __( 'normal', 'elementor' ) },
30
30
  { key: 'hover', value: 'hover', label: __( 'hover', 'elementor' ) },
31
31
  { key: 'focus', value: 'focus', label: __( 'focus', 'elementor' ) },
32
32
  { key: 'active', value: 'active', label: __( 'active', 'elementor' ) },
33
33
  ];
34
34
 
35
+ function usePseudoStates(): State[] {
36
+ const { elementType } = useElement();
37
+ const { pseudoStates = [] } = elementType;
38
+
39
+ const additionalStates: State[] = pseudoStates.map( ( { name, value } ) => ( {
40
+ key: value as StyleDefinitionStateWithNormal,
41
+ value: value as StyleDefinitionState,
42
+ label: name,
43
+ } ) );
44
+
45
+ return [ ...DEFAULT_PSEUDO_STATES, ...additionalStates ];
46
+ }
47
+
35
48
  type CssClassMenuProps = {
36
49
  popupState: PopupState;
37
50
  anchorEl: HTMLElement | null;
@@ -41,6 +54,7 @@ type CssClassMenuProps = {
41
54
  export function CssClassMenu( { popupState, anchorEl, fixed }: CssClassMenuProps ) {
42
55
  const { provider } = useCssClass();
43
56
  const isLocalStyle = provider ? isElementsStylesProvider( provider ) : true;
57
+ const pseudoStates = usePseudoStates();
44
58
 
45
59
  const handleKeyDown = ( e: React.KeyboardEvent< HTMLElement > ) => {
46
60
  e.stopPropagation();
@@ -69,7 +83,7 @@ export function CssClassMenu( { popupState, anchorEl, fixed }: CssClassMenuProps
69
83
  <MenuSubheader sx={ { typography: 'caption', color: 'text.secondary', pb: 0.5, pt: 1 } }>
70
84
  { __( 'States', 'elementor' ) }
71
85
  </MenuSubheader>
72
- { STATES.map( ( state ) => {
86
+ { pseudoStates.map( ( state ) => {
73
87
  return (
74
88
  <StateMenuItem
75
89
  key={ state.key }
@@ -42,6 +42,7 @@ export const init = () => {
42
42
 
43
43
  registerPopoverAction( {
44
44
  id: 'dynamic-tags',
45
+ priority: 20,
45
46
  useProps: usePropDynamicAction,
46
47
  } );
47
48
 
@@ -13,6 +13,7 @@ const { registerAction } = controlActionsMenu;
13
13
  export function initResetStyleProps() {
14
14
  registerAction( {
15
15
  id: 'reset-style-value',
16
+ priority: 10,
16
17
  useProps: useResetStyleValueProps,
17
18
  } );
18
19
  }