@elementor/editor-editing-panel 4.5.0-1190 → 4.5.0-1192
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 +104 -86
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +25 -25
- package/src/components/css-classes/css-class-menu.tsx +4 -1
- package/src/components/style-tab.tsx +3 -0
- package/src/hooks/use-broadcast-style-state.ts +20 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-editing-panel",
|
|
3
|
-
"version": "4.5.0-
|
|
3
|
+
"version": "4.5.0-1192",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -39,32 +39,32 @@
|
|
|
39
39
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@elementor/editor": "4.5.0-
|
|
43
|
-
"@elementor/editor-canvas": "4.5.0-
|
|
44
|
-
"@elementor/editor-controls": "4.5.0-
|
|
45
|
-
"@elementor/editor-current-user": "4.5.0-
|
|
46
|
-
"@elementor/editor-documents": "4.5.0-
|
|
47
|
-
"@elementor/editor-elements": "4.5.0-
|
|
48
|
-
"@elementor/editor-interactions": "4.5.0-
|
|
49
|
-
"@elementor/editor-notifications": "4.5.0-
|
|
50
|
-
"@elementor/editor-panels": "4.5.0-
|
|
51
|
-
"@elementor/editor-props": "4.5.0-
|
|
52
|
-
"@elementor/editor-responsive": "4.5.0-
|
|
53
|
-
"@elementor/editor-styles": "4.5.0-
|
|
54
|
-
"@elementor/editor-styles-repository": "4.5.0-
|
|
55
|
-
"@elementor/editor-ui": "4.5.0-
|
|
56
|
-
"@elementor/editor-v1-adapters": "4.5.0-
|
|
57
|
-
"@elementor/http-client": "4.5.0-
|
|
42
|
+
"@elementor/editor": "4.5.0-1192",
|
|
43
|
+
"@elementor/editor-canvas": "4.5.0-1192",
|
|
44
|
+
"@elementor/editor-controls": "4.5.0-1192",
|
|
45
|
+
"@elementor/editor-current-user": "4.5.0-1192",
|
|
46
|
+
"@elementor/editor-documents": "4.5.0-1192",
|
|
47
|
+
"@elementor/editor-elements": "4.5.0-1192",
|
|
48
|
+
"@elementor/editor-interactions": "4.5.0-1192",
|
|
49
|
+
"@elementor/editor-notifications": "4.5.0-1192",
|
|
50
|
+
"@elementor/editor-panels": "4.5.0-1192",
|
|
51
|
+
"@elementor/editor-props": "4.5.0-1192",
|
|
52
|
+
"@elementor/editor-responsive": "4.5.0-1192",
|
|
53
|
+
"@elementor/editor-styles": "4.5.0-1192",
|
|
54
|
+
"@elementor/editor-styles-repository": "4.5.0-1192",
|
|
55
|
+
"@elementor/editor-ui": "4.5.0-1192",
|
|
56
|
+
"@elementor/editor-v1-adapters": "4.5.0-1192",
|
|
57
|
+
"@elementor/http-client": "4.5.0-1192",
|
|
58
58
|
"@elementor/icons": "~1.78.1",
|
|
59
|
-
"@elementor/editor-variables": "4.5.0-
|
|
60
|
-
"@elementor/locations": "4.5.0-
|
|
61
|
-
"@elementor/menus": "4.5.0-
|
|
62
|
-
"@elementor/query": "4.5.0-
|
|
63
|
-
"@elementor/schema": "4.5.0-
|
|
64
|
-
"@elementor/session": "4.5.0-
|
|
59
|
+
"@elementor/editor-variables": "4.5.0-1192",
|
|
60
|
+
"@elementor/locations": "4.5.0-1192",
|
|
61
|
+
"@elementor/menus": "4.5.0-1192",
|
|
62
|
+
"@elementor/query": "4.5.0-1192",
|
|
63
|
+
"@elementor/schema": "4.5.0-1192",
|
|
64
|
+
"@elementor/session": "4.5.0-1192",
|
|
65
65
|
"@elementor/ui": "1.41.4",
|
|
66
|
-
"@elementor/utils": "4.5.0-
|
|
67
|
-
"@elementor/wp-media": "4.5.0-
|
|
66
|
+
"@elementor/utils": "4.5.0-1192",
|
|
67
|
+
"@elementor/wp-media": "4.5.0-1192",
|
|
68
68
|
"@wordpress/i18n": "^5.13.0"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
@@ -130,6 +130,9 @@ const CLASS_STATES_MAP: Record< string, { label: string } > = {
|
|
|
130
130
|
disabled: {
|
|
131
131
|
label: __( 'disabled', 'elementor' ),
|
|
132
132
|
},
|
|
133
|
+
current: {
|
|
134
|
+
label: __( 'current', 'elementor' ),
|
|
135
|
+
},
|
|
133
136
|
};
|
|
134
137
|
|
|
135
138
|
export function useElementStates() {
|
|
@@ -140,7 +143,7 @@ export function useElementStates() {
|
|
|
140
143
|
const elementStates = styleStates.map( ( { value, name } ) => ( {
|
|
141
144
|
key: value,
|
|
142
145
|
value,
|
|
143
|
-
label: CLASS_STATES_MAP[
|
|
146
|
+
label: CLASS_STATES_MAP[ name ]?.label ?? name,
|
|
144
147
|
} ) );
|
|
145
148
|
|
|
146
149
|
return {
|
|
@@ -13,6 +13,7 @@ import { useScrollDirection } from '../contexts/scroll-context';
|
|
|
13
13
|
import { StyleProvider } from '../contexts/style-context';
|
|
14
14
|
import { StyleInheritanceProvider } from '../contexts/styles-inheritance-context';
|
|
15
15
|
import { useActiveStyleDefId } from '../hooks/use-active-style-def-id';
|
|
16
|
+
import { useBroadcastStyleState } from '../hooks/use-broadcast-style-state';
|
|
16
17
|
import { CssClassSelector } from './css-classes/css-class-selector';
|
|
17
18
|
import { SectionsList } from './sections-list';
|
|
18
19
|
import { StyleSections } from './style-sections';
|
|
@@ -35,6 +36,8 @@ export const StyleTab = () => {
|
|
|
35
36
|
const [ activeStyleState, setActiveStyleState ] = useState< StyleDefinitionState | null >( null );
|
|
36
37
|
const breakpoint = useActiveBreakpoint();
|
|
37
38
|
|
|
39
|
+
useBroadcastStyleState( activeStyleState );
|
|
40
|
+
|
|
38
41
|
if ( ! currentClassesProp ) {
|
|
39
42
|
return null;
|
|
40
43
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { type StyleDefinitionState } from '@elementor/editor-styles';
|
|
3
|
+
|
|
4
|
+
import { useElement } from '../contexts/element-context';
|
|
5
|
+
|
|
6
|
+
export const STYLE_STATE_EVENT = 'elementor/editor/style-state/change';
|
|
7
|
+
|
|
8
|
+
function broadcast( id: string, state: StyleDefinitionState | null ) {
|
|
9
|
+
window.dispatchEvent( new CustomEvent( STYLE_STATE_EVENT, { detail: { id, state } } ) );
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function useBroadcastStyleState( state: StyleDefinitionState | null ) {
|
|
13
|
+
const { element } = useElement();
|
|
14
|
+
|
|
15
|
+
useEffect( () => {
|
|
16
|
+
broadcast( element.id, state );
|
|
17
|
+
|
|
18
|
+
return () => broadcast( element.id, null );
|
|
19
|
+
}, [ element.id, state ] );
|
|
20
|
+
}
|