@elementor/editor-components 4.0.0-503 → 4.0.0-505

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@elementor/editor-components",
3
3
  "description": "Elementor editor components",
4
- "version": "4.0.0-503",
4
+ "version": "4.0.0-505",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -40,30 +40,30 @@
40
40
  "dev": "tsup --config=../../tsup.dev.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@elementor/editor": "4.0.0-503",
44
- "@elementor/editor-canvas": "4.0.0-503",
45
- "@elementor/editor-controls": "4.0.0-503",
46
- "@elementor/editor-documents": "4.0.0-503",
47
- "@elementor/editor-editing-panel": "4.0.0-503",
48
- "@elementor/editor-elements": "4.0.0-503",
49
- "@elementor/editor-elements-panel": "4.0.0-503",
50
- "@elementor/editor-mcp": "4.0.0-503",
51
- "@elementor/editor-panels": "4.0.0-503",
52
- "@elementor/editor-props": "4.0.0-503",
53
- "@elementor/editor-styles-repository": "4.0.0-503",
54
- "@elementor/editor-ui": "4.0.0-503",
55
- "@elementor/editor-v1-adapters": "4.0.0-503",
56
- "@elementor/http-client": "4.0.0-503",
43
+ "@elementor/editor": "4.0.0-505",
44
+ "@elementor/editor-canvas": "4.0.0-505",
45
+ "@elementor/editor-controls": "4.0.0-505",
46
+ "@elementor/editor-documents": "4.0.0-505",
47
+ "@elementor/editor-editing-panel": "4.0.0-505",
48
+ "@elementor/editor-elements": "4.0.0-505",
49
+ "@elementor/editor-elements-panel": "4.0.0-505",
50
+ "@elementor/editor-mcp": "4.0.0-505",
51
+ "@elementor/editor-panels": "4.0.0-505",
52
+ "@elementor/editor-props": "4.0.0-505",
53
+ "@elementor/editor-styles-repository": "4.0.0-505",
54
+ "@elementor/editor-ui": "4.0.0-505",
55
+ "@elementor/editor-v1-adapters": "4.0.0-505",
56
+ "@elementor/http-client": "4.0.0-505",
57
57
  "@elementor/icons": "^1.63.0",
58
- "@elementor/mixpanel": "4.0.0-503",
59
- "@elementor/query": "4.0.0-503",
60
- "@elementor/schema": "4.0.0-503",
61
- "@elementor/store": "4.0.0-503",
58
+ "@elementor/mixpanel": "4.0.0-505",
59
+ "@elementor/query": "4.0.0-505",
60
+ "@elementor/schema": "4.0.0-505",
61
+ "@elementor/store": "4.0.0-505",
62
62
  "@elementor/ui": "1.36.17",
63
- "@elementor/utils": "4.0.0-503",
63
+ "@elementor/utils": "4.0.0-505",
64
64
  "@wordpress/i18n": "^5.13.0",
65
- "@elementor/editor-notifications": "4.0.0-503",
66
- "@elementor/editor-current-user": "4.0.0-503"
65
+ "@elementor/editor-notifications": "4.0.0-505",
66
+ "@elementor/editor-current-user": "4.0.0-505"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "react": "^18.3.1",
@@ -121,6 +121,13 @@ export const slice = createSlice( {
121
121
 
122
122
  component.overridableProps = payload.overridableProps;
123
123
  },
124
+ clearOverridableProps: ( state, { payload }: PayloadAction< { componentId: ComponentId } > ) => {
125
+ const component = state.data.find( ( comp ) => comp.id === payload.componentId );
126
+
127
+ if ( component ) {
128
+ component.overridableProps = undefined;
129
+ }
130
+ },
124
131
  rename: ( state, { payload }: PayloadAction< { componentUid: string; name: string } > ) => {
125
132
  const component = state.data.find( ( comp ) => comp.uid === payload.componentUid );
126
133
 
@@ -3,7 +3,7 @@ import { type V1ElementData } from '@elementor/editor-elements';
3
3
 
4
4
  import { apiClient } from '../api';
5
5
  import { type DocumentSaveStatus } from '../types';
6
- import { invalidateComponentDocumentData } from '../utils/component-document-data';
6
+ import { invalidateComponentCache } from '../utils/component-document-data';
7
7
  import { getComponentDocuments } from '../utils/get-component-documents';
8
8
 
9
9
  type Options = {
@@ -26,5 +26,5 @@ export async function publishDraftComponentsInPageBeforeSave( { status, elements
26
26
 
27
27
  await apiClient.updateStatuses( draftIds, 'publish' );
28
28
 
29
- draftIds.forEach( ( id ) => invalidateComponentDocumentData( id ) );
29
+ draftIds.forEach( ( id ) => invalidateComponentCache( id ) );
30
30
  }
@@ -1,4 +1,7 @@
1
1
  import { type Document, getV1DocumentsManager } from '@elementor/editor-documents';
2
+ import { __dispatch as dispatch } from '@elementor/store';
3
+
4
+ import { slice } from '../store/store';
2
5
 
3
6
  type ComponentDocumentData = Document;
4
7
 
@@ -12,8 +15,10 @@ export const getComponentDocumentData = async ( id: number ) => {
12
15
  }
13
16
  };
14
17
 
15
- export const invalidateComponentDocumentData = ( id: number ) => {
18
+ export const invalidateComponentCache = ( id: number ) => {
16
19
  const documentManager = getV1DocumentsManager();
17
20
 
18
21
  documentManager.invalidateCache( id );
22
+ dispatch( slice.actions.removeStyles( { id } ) );
23
+ dispatch( slice.actions.clearOverridableProps( { componentId: id } ) );
19
24
  };
@@ -1,15 +1,18 @@
1
1
  import { getCurrentDocumentContainer, selectElement } from '@elementor/editor-elements';
2
2
  import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';
3
3
 
4
+ import { invalidateComponentCache } from './component-document-data';
4
5
  import { expandNavigator } from './expand-navigator';
5
6
 
6
7
  export async function switchToComponent(
7
- componentId: number | string,
8
+ componentId: number,
8
9
  componentInstanceId?: string | null,
9
10
  element?: HTMLElement | null
10
11
  ) {
11
12
  const selector = getSelector( element, componentInstanceId );
12
13
 
14
+ invalidateComponentCache( componentId );
15
+
13
16
  await runCommand( 'editor/documents/switch', {
14
17
  id: componentId,
15
18
  selector,