@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/dist/index.mjs CHANGED
@@ -290,10 +290,6 @@ var getComponentDocumentData = async (id2) => {
290
290
  return null;
291
291
  }
292
292
  };
293
- var invalidateComponentDocumentData = (id2) => {
294
- const documentManager = getV1DocumentsManager();
295
- documentManager.invalidateCache(id2);
296
- };
297
293
 
298
294
  // src/component-instance-transformer.ts
299
295
  var componentInstanceTransformer = createTransformer(
@@ -379,8 +375,8 @@ import { getV1DocumentsManager as getV1DocumentsManager2 } from "@elementor/edit
379
375
  import { __useSelector as useSelector2 } from "@elementor/store";
380
376
 
381
377
  // src/utils/switch-to-component.ts
378
+ import { invalidateDocumentData, switchToDocument } from "@elementor/editor-documents";
382
379
  import { getCurrentDocumentContainer, selectElement } from "@elementor/editor-elements";
383
- import { __privateRunCommand as runCommand2 } from "@elementor/editor-v1-adapters";
384
380
 
385
381
  // src/utils/expand-navigator.ts
386
382
  import { __privateRunCommand as runCommand } from "@elementor/editor-v1-adapters";
@@ -391,8 +387,8 @@ async function expandNavigator() {
391
387
  // src/utils/switch-to-component.ts
392
388
  async function switchToComponent(componentId, componentInstanceId, element) {
393
389
  const selector = getSelector(element, componentInstanceId);
394
- await runCommand2("editor/documents/switch", {
395
- id: componentId,
390
+ invalidateDocumentData(componentId);
391
+ await switchToDocument(componentId, {
396
392
  selector,
397
393
  mode: "autosave",
398
394
  setAsInitial: false,
@@ -3131,7 +3127,7 @@ function findNonAtomicElementsInElement(element) {
3131
3127
 
3132
3128
  // src/store/actions/create-unpublished-component.ts
3133
3129
  import { createElements, deleteElement, getContainer as getContainer3 } from "@elementor/editor-elements";
3134
- import { __privateRunCommand as runCommand3 } from "@elementor/editor-v1-adapters";
3130
+ import { __privateRunCommand as runCommand2 } from "@elementor/editor-v1-adapters";
3135
3131
  import { __dispatch as dispatch12 } from "@elementor/store";
3136
3132
  import { generateUniqueId as generateUniqueId3 } from "@elementor/utils";
3137
3133
  import { __ as __22 } from "@wordpress/i18n";
@@ -3170,7 +3166,7 @@ async function createUnpublishedComponent({
3170
3166
  ...eventData
3171
3167
  });
3172
3168
  try {
3173
- await runCommand3("document/save/auto");
3169
+ await runCommand2("document/save/auto");
3174
3170
  } catch (error) {
3175
3171
  restoreOriginalElement(originalElement, componentInstance.id);
3176
3172
  dispatch12(slice.actions.removeUnpublished(generatedUid));
@@ -5288,7 +5284,7 @@ function updateElementComponentId(elementId, componentId) {
5288
5284
  }
5289
5285
 
5290
5286
  // src/sync/publish-draft-components-in-page-before-save.ts
5291
- import { isDocumentDirty as isDocumentDirty2 } from "@elementor/editor-documents";
5287
+ import { invalidateDocumentData as invalidateDocumentData2, isDocumentDirty as isDocumentDirty2 } from "@elementor/editor-documents";
5292
5288
  async function publishDraftComponentsInPageBeforeSave({ status, elements }) {
5293
5289
  if (status !== "publish") {
5294
5290
  return;
@@ -5299,7 +5295,7 @@ async function publishDraftComponentsInPageBeforeSave({ status, elements }) {
5299
5295
  return;
5300
5296
  }
5301
5297
  await apiClient.updateStatuses(draftIds, "publish");
5302
- draftIds.forEach((id2) => invalidateComponentDocumentData(id2));
5298
+ draftIds.forEach((id2) => invalidateDocumentData2(id2));
5303
5299
  }
5304
5300
 
5305
5301
  // src/sync/set-component-overridable-props-settings-before-save.ts