@elementor/editor-components 4.2.0-beta2 → 4.3.0-1000
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.
|
|
4
|
+
"version": "4.3.0-1000",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -40,31 +40,31 @@
|
|
|
40
40
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elementor/editor": "4.
|
|
44
|
-
"@elementor/editor-canvas": "4.
|
|
45
|
-
"@elementor/editor-controls": "4.
|
|
46
|
-
"@elementor/editor-documents": "4.
|
|
47
|
-
"@elementor/editor-editing-panel": "4.
|
|
48
|
-
"@elementor/editor-elements": "4.
|
|
49
|
-
"@elementor/editor-elements-panel": "4.
|
|
50
|
-
"@elementor/editor-mcp": "4.
|
|
51
|
-
"@elementor/editor-templates": "4.
|
|
52
|
-
"@elementor/editor-panels": "4.
|
|
53
|
-
"@elementor/editor-props": "4.
|
|
54
|
-
"@elementor/editor-ui": "4.
|
|
55
|
-
"@elementor/editor-v1-adapters": "4.
|
|
56
|
-
"@elementor/http-client": "4.
|
|
43
|
+
"@elementor/editor": "4.3.0-1000",
|
|
44
|
+
"@elementor/editor-canvas": "4.3.0-1000",
|
|
45
|
+
"@elementor/editor-controls": "4.3.0-1000",
|
|
46
|
+
"@elementor/editor-documents": "4.3.0-1000",
|
|
47
|
+
"@elementor/editor-editing-panel": "4.3.0-1000",
|
|
48
|
+
"@elementor/editor-elements": "4.3.0-1000",
|
|
49
|
+
"@elementor/editor-elements-panel": "4.3.0-1000",
|
|
50
|
+
"@elementor/editor-mcp": "4.3.0-1000",
|
|
51
|
+
"@elementor/editor-templates": "4.3.0-1000",
|
|
52
|
+
"@elementor/editor-panels": "4.3.0-1000",
|
|
53
|
+
"@elementor/editor-props": "4.3.0-1000",
|
|
54
|
+
"@elementor/editor-ui": "4.3.0-1000",
|
|
55
|
+
"@elementor/editor-v1-adapters": "4.3.0-1000",
|
|
56
|
+
"@elementor/http-client": "4.3.0-1000",
|
|
57
57
|
"@elementor/icons": "~1.75.1",
|
|
58
|
-
"@elementor/events": "4.
|
|
59
|
-
"@elementor/query": "4.
|
|
60
|
-
"@elementor/schema": "4.
|
|
61
|
-
"@elementor/store": "4.
|
|
58
|
+
"@elementor/events": "4.3.0-1000",
|
|
59
|
+
"@elementor/query": "4.3.0-1000",
|
|
60
|
+
"@elementor/schema": "4.3.0-1000",
|
|
61
|
+
"@elementor/store": "4.3.0-1000",
|
|
62
62
|
"@elementor/ui": "1.37.5",
|
|
63
|
-
"@elementor/utils": "4.
|
|
63
|
+
"@elementor/utils": "4.3.0-1000",
|
|
64
64
|
"@wordpress/i18n": "^5.13.0",
|
|
65
|
-
"@elementor/editor-notifications": "4.
|
|
66
|
-
"@elementor/editor-current-user": "4.
|
|
67
|
-
"@elementor/editor-embedded-documents-manager": "4.
|
|
65
|
+
"@elementor/editor-notifications": "4.3.0-1000",
|
|
66
|
+
"@elementor/editor-current-user": "4.3.0-1000",
|
|
67
|
+
"@elementor/editor-embedded-documents-manager": "4.3.0-1000"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"react": "^18.3.1",
|
|
@@ -3,14 +3,23 @@ import { __dispatch as dispatch, __getState as getState } from '@elementor/store
|
|
|
3
3
|
import { apiClient } from '../../api';
|
|
4
4
|
import { selectIsOverridablePropsLoaded, slice } from '../store';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
type Options = {
|
|
7
|
+
// Bypasses the "already loaded" guard, forcing a re-fetch for the given ids.
|
|
8
|
+
// Used when we know the cached data may be stale (e.g. entering a component's edit mode),
|
|
9
|
+
// since other users may have changed the component's overridable props during the session.
|
|
10
|
+
force?: boolean;
|
|
11
|
+
};
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
export async function loadComponentsOverridableProps( componentIds: number[], { force = false }: Options = {} ) {
|
|
14
|
+
const idsToLoad = force
|
|
15
|
+
? componentIds
|
|
16
|
+
: componentIds.filter( ( id ) => ! selectIsOverridablePropsLoaded( getState(), id ) );
|
|
17
|
+
|
|
18
|
+
if ( ! idsToLoad.length ) {
|
|
10
19
|
return;
|
|
11
20
|
}
|
|
12
21
|
|
|
13
|
-
const { data } = await apiClient.getOverridableProps(
|
|
22
|
+
const { data } = await apiClient.getOverridableProps( idsToLoad );
|
|
14
23
|
|
|
15
24
|
dispatch( slice.actions.loadOverridableProps( data ) );
|
|
16
25
|
}
|
|
@@ -2,6 +2,8 @@ import { invalidateDocumentData, switchToDocument } from '@elementor/editor-docu
|
|
|
2
2
|
import { getCurrentDocumentContainer, selectElement } from '@elementor/editor-elements';
|
|
3
3
|
import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';
|
|
4
4
|
|
|
5
|
+
import { loadComponentsOverridableProps } from '../store/actions/load-components-overridable-props';
|
|
6
|
+
|
|
5
7
|
export async function switchToComponent(
|
|
6
8
|
componentId: number,
|
|
7
9
|
componentInstanceId?: string | null,
|
|
@@ -18,6 +20,11 @@ export async function switchToComponent(
|
|
|
18
20
|
shouldScroll: false,
|
|
19
21
|
} );
|
|
20
22
|
|
|
23
|
+
// The component's elements are always re-fetched on switch (via invalidateDocumentData above),
|
|
24
|
+
// but overridable props have their own cache guard, so they need an explicit forced refresh here -
|
|
25
|
+
// otherwise edits made by other users during the session would stay stale.
|
|
26
|
+
await loadComponentsOverridableProps( [ componentId ], { force: true } );
|
|
27
|
+
|
|
21
28
|
const currentDocumentContainer = getCurrentDocumentContainer();
|
|
22
29
|
const topLevelElement = currentDocumentContainer?.children?.[ 0 ];
|
|
23
30
|
|