@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/dist/index.js +114 -104
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +59 -49
- package/dist/index.mjs.map +1 -1
- package/package.json +22 -22
- package/src/store/store.ts +7 -0
- package/src/sync/publish-draft-components-in-page-before-save.ts +2 -2
- package/src/utils/component-document-data.ts +6 -1
- package/src/utils/switch-to-component.ts +4 -1
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-
|
|
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-
|
|
44
|
-
"@elementor/editor-canvas": "4.0.0-
|
|
45
|
-
"@elementor/editor-controls": "4.0.0-
|
|
46
|
-
"@elementor/editor-documents": "4.0.0-
|
|
47
|
-
"@elementor/editor-editing-panel": "4.0.0-
|
|
48
|
-
"@elementor/editor-elements": "4.0.0-
|
|
49
|
-
"@elementor/editor-elements-panel": "4.0.0-
|
|
50
|
-
"@elementor/editor-mcp": "4.0.0-
|
|
51
|
-
"@elementor/editor-panels": "4.0.0-
|
|
52
|
-
"@elementor/editor-props": "4.0.0-
|
|
53
|
-
"@elementor/editor-styles-repository": "4.0.0-
|
|
54
|
-
"@elementor/editor-ui": "4.0.0-
|
|
55
|
-
"@elementor/editor-v1-adapters": "4.0.0-
|
|
56
|
-
"@elementor/http-client": "4.0.0-
|
|
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-
|
|
59
|
-
"@elementor/query": "4.0.0-
|
|
60
|
-
"@elementor/schema": "4.0.0-
|
|
61
|
-
"@elementor/store": "4.0.0-
|
|
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-
|
|
63
|
+
"@elementor/utils": "4.0.0-505",
|
|
64
64
|
"@wordpress/i18n": "^5.13.0",
|
|
65
|
-
"@elementor/editor-notifications": "4.0.0-
|
|
66
|
-
"@elementor/editor-current-user": "4.0.0-
|
|
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",
|
package/src/store/store.ts
CHANGED
|
@@ -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 {
|
|
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 ) =>
|
|
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
|
|
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
|
|
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,
|