@elementor/editor-components 4.0.0-518 → 4.0.0-520

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-518",
4
+ "version": "4.0.0-520",
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-518",
44
- "@elementor/editor-canvas": "4.0.0-518",
45
- "@elementor/editor-controls": "4.0.0-518",
46
- "@elementor/editor-documents": "4.0.0-518",
47
- "@elementor/editor-editing-panel": "4.0.0-518",
48
- "@elementor/editor-elements": "4.0.0-518",
49
- "@elementor/editor-elements-panel": "4.0.0-518",
50
- "@elementor/editor-mcp": "4.0.0-518",
51
- "@elementor/editor-panels": "4.0.0-518",
52
- "@elementor/editor-props": "4.0.0-518",
53
- "@elementor/editor-styles-repository": "4.0.0-518",
54
- "@elementor/editor-ui": "4.0.0-518",
55
- "@elementor/editor-v1-adapters": "4.0.0-518",
56
- "@elementor/http-client": "4.0.0-518",
43
+ "@elementor/editor": "4.0.0-520",
44
+ "@elementor/editor-canvas": "4.0.0-520",
45
+ "@elementor/editor-controls": "4.0.0-520",
46
+ "@elementor/editor-documents": "4.0.0-520",
47
+ "@elementor/editor-editing-panel": "4.0.0-520",
48
+ "@elementor/editor-elements": "4.0.0-520",
49
+ "@elementor/editor-elements-panel": "4.0.0-520",
50
+ "@elementor/editor-mcp": "4.0.0-520",
51
+ "@elementor/editor-panels": "4.0.0-520",
52
+ "@elementor/editor-props": "4.0.0-520",
53
+ "@elementor/editor-styles-repository": "4.0.0-520",
54
+ "@elementor/editor-ui": "4.0.0-520",
55
+ "@elementor/editor-v1-adapters": "4.0.0-520",
56
+ "@elementor/http-client": "4.0.0-520",
57
57
  "@elementor/icons": "^1.63.0",
58
- "@elementor/mixpanel": "4.0.0-518",
59
- "@elementor/query": "4.0.0-518",
60
- "@elementor/schema": "4.0.0-518",
61
- "@elementor/store": "4.0.0-518",
58
+ "@elementor/mixpanel": "4.0.0-520",
59
+ "@elementor/query": "4.0.0-520",
60
+ "@elementor/schema": "4.0.0-520",
61
+ "@elementor/store": "4.0.0-520",
62
62
  "@elementor/ui": "1.36.17",
63
- "@elementor/utils": "4.0.0-518",
63
+ "@elementor/utils": "4.0.0-520",
64
64
  "@wordpress/i18n": "^5.13.0",
65
- "@elementor/editor-notifications": "4.0.0-518",
66
- "@elementor/editor-current-user": "4.0.0-518"
65
+ "@elementor/editor-notifications": "4.0.0-520",
66
+ "@elementor/editor-current-user": "4.0.0-520"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "react": "^18.3.1",
@@ -1,9 +1,8 @@
1
- import { isDocumentDirty } from '@elementor/editor-documents';
1
+ import { invalidateDocumentData, isDocumentDirty } from '@elementor/editor-documents';
2
2
  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';
7
6
  import { getComponentDocuments } from '../utils/get-component-documents';
8
7
 
9
8
  type Options = {
@@ -26,5 +25,5 @@ export async function publishDraftComponentsInPageBeforeSave( { status, elements
26
25
 
27
26
  await apiClient.updateStatuses( draftIds, 'publish' );
28
27
 
29
- draftIds.forEach( ( id ) => invalidateComponentDocumentData( id ) );
28
+ draftIds.forEach( ( id ) => invalidateDocumentData( id ) );
30
29
  }
@@ -11,9 +11,3 @@ export const getComponentDocumentData = async ( id: number ) => {
11
11
  return null;
12
12
  }
13
13
  };
14
-
15
- export const invalidateComponentDocumentData = ( id: number ) => {
16
- const documentManager = getV1DocumentsManager();
17
-
18
- documentManager.invalidateCache( id );
19
- };
@@ -1,17 +1,18 @@
1
+ import { invalidateDocumentData, switchToDocument } from '@elementor/editor-documents';
1
2
  import { getCurrentDocumentContainer, selectElement } from '@elementor/editor-elements';
2
- import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';
3
3
 
4
4
  import { expandNavigator } from './expand-navigator';
5
5
 
6
6
  export async function switchToComponent(
7
- componentId: number | string,
7
+ componentId: number,
8
8
  componentInstanceId?: string | null,
9
9
  element?: HTMLElement | null
10
10
  ) {
11
11
  const selector = getSelector( element, componentInstanceId );
12
12
 
13
- await runCommand( 'editor/documents/switch', {
14
- id: componentId,
13
+ invalidateDocumentData( componentId );
14
+
15
+ await switchToDocument( componentId, {
15
16
  selector,
16
17
  mode: 'autosave',
17
18
  setAsInitial: false,