@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/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +21 -21
- package/src/components/css-classes/css-class-menu.tsx +16 -2
- package/src/dynamics/init.ts +1 -0
- package/src/reset-style-props.tsx +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-editing-panel",
|
|
3
|
-
"version": "4.0.0-
|
|
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-
|
|
43
|
-
"@elementor/editor-canvas": "4.0.0-
|
|
44
|
-
"@elementor/editor-controls": "4.0.0-
|
|
45
|
-
"@elementor/editor-documents": "4.0.0-
|
|
46
|
-
"@elementor/editor-elements": "4.0.0-
|
|
47
|
-
"@elementor/editor-interactions": "4.0.0-
|
|
48
|
-
"@elementor/editor-panels": "4.0.0-
|
|
49
|
-
"@elementor/editor-props": "4.0.0-
|
|
50
|
-
"@elementor/editor-responsive": "4.0.0-
|
|
51
|
-
"@elementor/editor-styles": "4.0.0-
|
|
52
|
-
"@elementor/editor-styles-repository": "4.0.0-
|
|
53
|
-
"@elementor/editor-ui": "4.0.0-
|
|
54
|
-
"@elementor/editor-v1-adapters": "4.0.0-
|
|
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-
|
|
57
|
-
"@elementor/locations": "4.0.0-
|
|
58
|
-
"@elementor/menus": "4.0.0-
|
|
59
|
-
"@elementor/schema": "4.0.0-
|
|
60
|
-
"@elementor/session": "4.0.0-
|
|
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-
|
|
63
|
-
"@elementor/wp-media": "4.0.0-
|
|
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
|
|
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
|
-
{
|
|
86
|
+
{ pseudoStates.map( ( state ) => {
|
|
73
87
|
return (
|
|
74
88
|
<StateMenuItem
|
|
75
89
|
key={ state.key }
|
package/src/dynamics/init.ts
CHANGED