@elementor/editor-editing-panel 4.5.0-1191 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementor/editor-editing-panel",
3
- "version": "4.5.0-1191",
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-1191",
43
- "@elementor/editor-canvas": "4.5.0-1191",
44
- "@elementor/editor-controls": "4.5.0-1191",
45
- "@elementor/editor-current-user": "4.5.0-1191",
46
- "@elementor/editor-documents": "4.5.0-1191",
47
- "@elementor/editor-elements": "4.5.0-1191",
48
- "@elementor/editor-interactions": "4.5.0-1191",
49
- "@elementor/editor-notifications": "4.5.0-1191",
50
- "@elementor/editor-panels": "4.5.0-1191",
51
- "@elementor/editor-props": "4.5.0-1191",
52
- "@elementor/editor-responsive": "4.5.0-1191",
53
- "@elementor/editor-styles": "4.5.0-1191",
54
- "@elementor/editor-styles-repository": "4.5.0-1191",
55
- "@elementor/editor-ui": "4.5.0-1191",
56
- "@elementor/editor-v1-adapters": "4.5.0-1191",
57
- "@elementor/http-client": "4.5.0-1191",
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-1191",
60
- "@elementor/locations": "4.5.0-1191",
61
- "@elementor/menus": "4.5.0-1191",
62
- "@elementor/query": "4.5.0-1191",
63
- "@elementor/schema": "4.5.0-1191",
64
- "@elementor/session": "4.5.0-1191",
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-1191",
67
- "@elementor/wp-media": "4.5.0-1191",
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[ value ]?.label ?? name,
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
+ }