@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.js +70 -74
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +22 -22
- package/src/sync/publish-draft-components-in-page-before-save.ts +2 -3
- package/src/utils/component-document-data.ts +0 -6
- package/src/utils/switch-to-component.ts +5 -4
package/dist/index.js
CHANGED
|
@@ -38,12 +38,12 @@ module.exports = __toCommonJS(index_exports);
|
|
|
38
38
|
var import_editor = require("@elementor/editor");
|
|
39
39
|
var import_editor_canvas8 = require("@elementor/editor-canvas");
|
|
40
40
|
var import_editor_controls7 = require("@elementor/editor-controls");
|
|
41
|
-
var
|
|
41
|
+
var import_editor_documents14 = require("@elementor/editor-documents");
|
|
42
42
|
var import_editor_editing_panel8 = require("@elementor/editor-editing-panel");
|
|
43
43
|
var import_editor_elements_panel = require("@elementor/editor-elements-panel");
|
|
44
44
|
var import_editor_panels5 = require("@elementor/editor-panels");
|
|
45
45
|
var import_editor_styles_repository2 = require("@elementor/editor-styles-repository");
|
|
46
|
-
var
|
|
46
|
+
var import_editor_v1_adapters13 = require("@elementor/editor-v1-adapters");
|
|
47
47
|
var import_store82 = require("@elementor/store");
|
|
48
48
|
var import_i18n31 = require("@wordpress/i18n");
|
|
49
49
|
|
|
@@ -314,10 +314,6 @@ var getComponentDocumentData = async (id2) => {
|
|
|
314
314
|
return null;
|
|
315
315
|
}
|
|
316
316
|
};
|
|
317
|
-
var invalidateComponentDocumentData = (id2) => {
|
|
318
|
-
const documentManager = (0, import_editor_documents.getV1DocumentsManager)();
|
|
319
|
-
documentManager.invalidateCache(id2);
|
|
320
|
-
};
|
|
321
317
|
|
|
322
318
|
// src/component-instance-transformer.ts
|
|
323
319
|
var componentInstanceTransformer = (0, import_editor_canvas.createTransformer)(
|
|
@@ -389,7 +385,7 @@ var componentOverrideTransformer = (0, import_editor_canvas3.createTransformer)(
|
|
|
389
385
|
// src/components/component-panel-header/component-panel-header.tsx
|
|
390
386
|
var React10 = __toESM(require("react"));
|
|
391
387
|
var import_editor_current_user = require("@elementor/editor-current-user");
|
|
392
|
-
var
|
|
388
|
+
var import_editor_documents7 = require("@elementor/editor-documents");
|
|
393
389
|
var import_editor_panels3 = require("@elementor/editor-panels");
|
|
394
390
|
var import_editor_ui6 = require("@elementor/editor-ui");
|
|
395
391
|
var import_icons7 = require("@elementor/icons");
|
|
@@ -399,12 +395,12 @@ var import_i18n13 = require("@wordpress/i18n");
|
|
|
399
395
|
|
|
400
396
|
// src/hooks/use-navigate-back.ts
|
|
401
397
|
var import_react = require("react");
|
|
402
|
-
var
|
|
398
|
+
var import_editor_documents3 = require("@elementor/editor-documents");
|
|
403
399
|
var import_store5 = require("@elementor/store");
|
|
404
400
|
|
|
405
401
|
// src/utils/switch-to-component.ts
|
|
402
|
+
var import_editor_documents2 = require("@elementor/editor-documents");
|
|
406
403
|
var import_editor_elements = require("@elementor/editor-elements");
|
|
407
|
-
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
408
404
|
|
|
409
405
|
// src/utils/expand-navigator.ts
|
|
410
406
|
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
@@ -415,8 +411,8 @@ async function expandNavigator() {
|
|
|
415
411
|
// src/utils/switch-to-component.ts
|
|
416
412
|
async function switchToComponent(componentId, componentInstanceId, element) {
|
|
417
413
|
const selector = getSelector(element, componentInstanceId);
|
|
418
|
-
|
|
419
|
-
|
|
414
|
+
(0, import_editor_documents2.invalidateDocumentData)(componentId);
|
|
415
|
+
await (0, import_editor_documents2.switchToDocument)(componentId, {
|
|
420
416
|
selector,
|
|
421
417
|
mode: "autosave",
|
|
422
418
|
setAsInitial: false,
|
|
@@ -461,7 +457,7 @@ function buildUniqueSelector(element) {
|
|
|
461
457
|
// src/hooks/use-navigate-back.ts
|
|
462
458
|
function useNavigateBack() {
|
|
463
459
|
const path = (0, import_store5.__useSelector)(selectPath);
|
|
464
|
-
const documentsManager = (0,
|
|
460
|
+
const documentsManager = (0, import_editor_documents3.getV1DocumentsManager)();
|
|
465
461
|
return (0, import_react.useCallback)(() => {
|
|
466
462
|
const { componentId: prevComponentId, instanceId: prevComponentInstanceId } = path.at(-2) ?? {};
|
|
467
463
|
if (prevComponentId && prevComponentInstanceId) {
|
|
@@ -520,7 +516,7 @@ var import_i18n11 = require("@wordpress/i18n");
|
|
|
520
516
|
// src/components/component-properties-panel/component-properties-panel-content.tsx
|
|
521
517
|
var React7 = __toESM(require("react"));
|
|
522
518
|
var import_react5 = require("react");
|
|
523
|
-
var
|
|
519
|
+
var import_editor_documents6 = require("@elementor/editor-documents");
|
|
524
520
|
var import_editor_panels = require("@elementor/editor-panels");
|
|
525
521
|
var import_icons5 = require("@elementor/icons");
|
|
526
522
|
var import_ui7 = require("@elementor/ui");
|
|
@@ -748,7 +744,7 @@ var import_editor_elements2 = require("@elementor/editor-elements");
|
|
|
748
744
|
|
|
749
745
|
// src/create-component-type.ts
|
|
750
746
|
var import_editor_canvas4 = require("@elementor/editor-canvas");
|
|
751
|
-
var
|
|
747
|
+
var import_editor_documents4 = require("@elementor/editor-documents");
|
|
752
748
|
var import_store13 = require("@elementor/store");
|
|
753
749
|
var import_i18n2 = require("@wordpress/i18n");
|
|
754
750
|
var COMPONENT_WIDGET_TYPE = "e-component";
|
|
@@ -789,7 +785,7 @@ function createComponentView(options) {
|
|
|
789
785
|
eventsManagerConfig = legacyWindow.elementorCommon.eventsManager.config;
|
|
790
786
|
#componentRenderContext;
|
|
791
787
|
isComponentCurrentlyEdited() {
|
|
792
|
-
const currentDocument = (0,
|
|
788
|
+
const currentDocument = (0, import_editor_documents4.getCurrentDocument)();
|
|
793
789
|
return currentDocument?.id === this.getComponentId();
|
|
794
790
|
}
|
|
795
791
|
getRenderContext() {
|
|
@@ -1849,7 +1845,7 @@ function PropertiesGroup({
|
|
|
1849
1845
|
|
|
1850
1846
|
// src/components/component-properties-panel/use-current-editable-item.ts
|
|
1851
1847
|
var import_react4 = require("react");
|
|
1852
|
-
var
|
|
1848
|
+
var import_editor_documents5 = require("@elementor/editor-documents");
|
|
1853
1849
|
var import_editor_ui4 = require("@elementor/editor-ui");
|
|
1854
1850
|
var import_i18n9 = require("@wordpress/i18n");
|
|
1855
1851
|
|
|
@@ -1917,7 +1913,7 @@ function useCurrentEditableItem() {
|
|
|
1917
1913
|
groupId: editingGroupId,
|
|
1918
1914
|
label: newLabel
|
|
1919
1915
|
});
|
|
1920
|
-
(0,
|
|
1916
|
+
(0, import_editor_documents5.setDocumentModifiedStatus)(true);
|
|
1921
1917
|
};
|
|
1922
1918
|
const {
|
|
1923
1919
|
ref: editableRef,
|
|
@@ -1994,21 +1990,21 @@ function ComponentPropertiesPanelContent({ onClose }) {
|
|
|
1994
1990
|
label: newLabel,
|
|
1995
1991
|
source: "user"
|
|
1996
1992
|
});
|
|
1997
|
-
(0,
|
|
1993
|
+
(0, import_editor_documents6.setDocumentModifiedStatus)(true);
|
|
1998
1994
|
setIsAddingGroup(false);
|
|
1999
1995
|
groupLabelEditable.setEditingGroupId(newGroupId);
|
|
2000
1996
|
};
|
|
2001
1997
|
const handleGroupsReorder = (newOrder) => {
|
|
2002
1998
|
reorderOverridableGroups({ componentId: currentComponentId, newOrder });
|
|
2003
|
-
(0,
|
|
1999
|
+
(0, import_editor_documents6.setDocumentModifiedStatus)(true);
|
|
2004
2000
|
};
|
|
2005
2001
|
const handlePropsReorder = (groupId, newPropsOrder) => {
|
|
2006
2002
|
reorderGroupProps({ componentId: currentComponentId, groupId, newPropsOrder });
|
|
2007
|
-
(0,
|
|
2003
|
+
(0, import_editor_documents6.setDocumentModifiedStatus)(true);
|
|
2008
2004
|
};
|
|
2009
2005
|
const handlePropertyDelete = (propKey) => {
|
|
2010
2006
|
deleteOverridableProp({ componentId: currentComponentId, propKey, source: "user" });
|
|
2011
|
-
(0,
|
|
2007
|
+
(0, import_editor_documents6.setDocumentModifiedStatus)(true);
|
|
2012
2008
|
};
|
|
2013
2009
|
const handlePropertyUpdate = (overrideKey, data) => {
|
|
2014
2010
|
updateOverridablePropParams({
|
|
@@ -2017,11 +2013,11 @@ function ComponentPropertiesPanelContent({ onClose }) {
|
|
|
2017
2013
|
label: data.label,
|
|
2018
2014
|
groupId: data.group
|
|
2019
2015
|
});
|
|
2020
|
-
(0,
|
|
2016
|
+
(0, import_editor_documents6.setDocumentModifiedStatus)(true);
|
|
2021
2017
|
};
|
|
2022
2018
|
const handleGroupDelete = (groupId) => {
|
|
2023
2019
|
deleteOverridableGroup({ componentId: currentComponentId, groupId });
|
|
2024
|
-
(0,
|
|
2020
|
+
(0, import_editor_documents6.setDocumentModifiedStatus)(true);
|
|
2025
2021
|
};
|
|
2026
2022
|
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(import_editor_panels.PanelHeader, { sx: { justifyContent: "start", pl: 1.5, pr: 1, py: 1 } }, /* @__PURE__ */ React7.createElement(import_ui7.Stack, { direction: "row", alignItems: "center", gap: 0.5, flexGrow: 1 }, /* @__PURE__ */ React7.createElement(import_icons5.ComponentPropListIcon, { fontSize: "tiny" }), /* @__PURE__ */ React7.createElement(import_editor_panels.PanelHeaderTitle, { variant: "subtitle2" }, (0, import_i18n10.__)("Component properties", "elementor"))), !showEmptyState && /* @__PURE__ */ React7.createElement(import_ui7.Tooltip, { title: (0, import_i18n10.__)("Add new group", "elementor") }, /* @__PURE__ */ React7.createElement(
|
|
2027
2023
|
import_ui7.IconButton,
|
|
@@ -2204,7 +2200,7 @@ function getComponentName() {
|
|
|
2204
2200
|
if (instanceTitle) {
|
|
2205
2201
|
return instanceTitle;
|
|
2206
2202
|
}
|
|
2207
|
-
const documentsManager = (0,
|
|
2203
|
+
const documentsManager = (0, import_editor_documents7.getV1DocumentsManager)();
|
|
2208
2204
|
const currentDocument = documentsManager.getCurrent();
|
|
2209
2205
|
return currentDocument?.container?.settings?.get("post_title") ?? "";
|
|
2210
2206
|
}
|
|
@@ -2299,13 +2295,13 @@ var useComponentsPermissions = () => {
|
|
|
2299
2295
|
};
|
|
2300
2296
|
|
|
2301
2297
|
// src/store/actions/rename-component.ts
|
|
2302
|
-
var
|
|
2298
|
+
var import_editor_documents8 = require("@elementor/editor-documents");
|
|
2303
2299
|
var import_editor_elements5 = require("@elementor/editor-elements");
|
|
2304
2300
|
var import_store33 = require("@elementor/store");
|
|
2305
2301
|
var TITLE_EXTERNAL_CHANGE_COMMAND = "title_external_change";
|
|
2306
2302
|
var renameComponent = (componentUid, newName) => {
|
|
2307
2303
|
(0, import_store33.__dispatch)(slice.actions.rename({ componentUid, name: newName }));
|
|
2308
|
-
(0,
|
|
2304
|
+
(0, import_editor_documents8.setDocumentModifiedStatus)(true);
|
|
2309
2305
|
refreshComponentInstanceTitles(componentUid);
|
|
2310
2306
|
};
|
|
2311
2307
|
function refreshComponentInstanceTitles(componentUid) {
|
|
@@ -2319,7 +2315,7 @@ function refreshComponentInstanceTitles(componentUid) {
|
|
|
2319
2315
|
});
|
|
2320
2316
|
}
|
|
2321
2317
|
function getDocumentContainer() {
|
|
2322
|
-
const documentsManager = (0,
|
|
2318
|
+
const documentsManager = (0, import_editor_documents8.getV1DocumentsManager)();
|
|
2323
2319
|
return documentsManager?.getCurrent()?.container;
|
|
2324
2320
|
}
|
|
2325
2321
|
function findComponentInstancesByUid(documentContainer, componentUid) {
|
|
@@ -2343,7 +2339,7 @@ var import_ui12 = require("@elementor/ui");
|
|
|
2343
2339
|
var import_i18n18 = require("@wordpress/i18n");
|
|
2344
2340
|
|
|
2345
2341
|
// src/store/actions/archive-component.ts
|
|
2346
|
-
var
|
|
2342
|
+
var import_editor_documents9 = require("@elementor/editor-documents");
|
|
2347
2343
|
var import_editor_notifications = require("@elementor/editor-notifications");
|
|
2348
2344
|
var import_store35 = require("@elementor/store");
|
|
2349
2345
|
var import_i18n15 = require("@wordpress/i18n");
|
|
@@ -2355,12 +2351,12 @@ var successNotification = (componentId, componentName) => ({
|
|
|
2355
2351
|
});
|
|
2356
2352
|
var archiveComponent = (componentId, componentName) => {
|
|
2357
2353
|
(0, import_store35.__dispatch)(slice.actions.archive(componentId));
|
|
2358
|
-
(0,
|
|
2354
|
+
(0, import_editor_documents9.setDocumentModifiedStatus)(true);
|
|
2359
2355
|
(0, import_editor_notifications.notify)(successNotification(componentId, componentName));
|
|
2360
2356
|
};
|
|
2361
2357
|
|
|
2362
2358
|
// src/store/actions/load-components-assets.ts
|
|
2363
|
-
var
|
|
2359
|
+
var import_editor_documents10 = require("@elementor/editor-documents");
|
|
2364
2360
|
|
|
2365
2361
|
// src/utils/get-component-documents.ts
|
|
2366
2362
|
async function getComponentDocuments(elements, cache = /* @__PURE__ */ new Map()) {
|
|
@@ -2470,9 +2466,9 @@ async function loadComponentsAssets(elements) {
|
|
|
2470
2466
|
await loadComponentsOverridableProps([...documents.keys()]);
|
|
2471
2467
|
}
|
|
2472
2468
|
function updateDocumentState(documents) {
|
|
2473
|
-
const isDrafted = [...documents.values()].some(
|
|
2469
|
+
const isDrafted = [...documents.values()].some(import_editor_documents10.isDocumentDirty);
|
|
2474
2470
|
if (isDrafted) {
|
|
2475
|
-
(0,
|
|
2471
|
+
(0, import_editor_documents10.setDocumentModifiedStatus)(true);
|
|
2476
2472
|
}
|
|
2477
2473
|
}
|
|
2478
2474
|
|
|
@@ -3000,7 +2996,7 @@ var import_i18n23 = require("@wordpress/i18n");
|
|
|
3000
2996
|
var import_editor_canvas6 = require("@elementor/editor-canvas");
|
|
3001
2997
|
var import_editor_elements9 = require("@elementor/editor-elements");
|
|
3002
2998
|
var import_editor_notifications2 = require("@elementor/editor-notifications");
|
|
3003
|
-
var
|
|
2999
|
+
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
3004
3000
|
var import_i18n21 = require("@wordpress/i18n");
|
|
3005
3001
|
|
|
3006
3002
|
// src/utils/is-editing-component.ts
|
|
@@ -3020,15 +3016,15 @@ var NON_ATOMIC_ELEMENT_ALERT = {
|
|
|
3020
3016
|
id: "non-atomic-element-blocked"
|
|
3021
3017
|
};
|
|
3022
3018
|
function initNonAtomicNestingPrevention() {
|
|
3023
|
-
(0,
|
|
3019
|
+
(0, import_editor_v1_adapters3.blockCommand)({
|
|
3024
3020
|
command: "document/elements/create",
|
|
3025
3021
|
condition: blockNonAtomicCreate
|
|
3026
3022
|
});
|
|
3027
|
-
(0,
|
|
3023
|
+
(0, import_editor_v1_adapters3.blockCommand)({
|
|
3028
3024
|
command: "document/elements/move",
|
|
3029
3025
|
condition: blockNonAtomicMove
|
|
3030
3026
|
});
|
|
3031
|
-
(0,
|
|
3027
|
+
(0, import_editor_v1_adapters3.blockCommand)({
|
|
3032
3028
|
command: "document/elements/paste",
|
|
3033
3029
|
condition: blockNonAtomicPaste
|
|
3034
3030
|
});
|
|
@@ -3116,7 +3112,7 @@ function findNonAtomicElementsInElement(element) {
|
|
|
3116
3112
|
|
|
3117
3113
|
// src/store/actions/create-unpublished-component.ts
|
|
3118
3114
|
var import_editor_elements10 = require("@elementor/editor-elements");
|
|
3119
|
-
var
|
|
3115
|
+
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
3120
3116
|
var import_store45 = require("@elementor/store");
|
|
3121
3117
|
var import_utils4 = require("@elementor/utils");
|
|
3122
3118
|
var import_i18n22 = require("@wordpress/i18n");
|
|
@@ -3155,7 +3151,7 @@ async function createUnpublishedComponent({
|
|
|
3155
3151
|
...eventData
|
|
3156
3152
|
});
|
|
3157
3153
|
try {
|
|
3158
|
-
await (0,
|
|
3154
|
+
await (0, import_editor_v1_adapters4.__privateRunCommand)("document/save/auto");
|
|
3159
3155
|
} catch (error) {
|
|
3160
3156
|
restoreOriginalElement(originalElement, componentInstance.id);
|
|
3161
3157
|
(0, import_store45.__dispatch)(slice.actions.removeUnpublished(generatedUid));
|
|
@@ -3441,13 +3437,13 @@ var Form2 = ({
|
|
|
3441
3437
|
// src/components/edit-component/edit-component.tsx
|
|
3442
3438
|
var React21 = __toESM(require("react"));
|
|
3443
3439
|
var import_react13 = require("react");
|
|
3444
|
-
var
|
|
3445
|
-
var
|
|
3440
|
+
var import_editor_documents12 = require("@elementor/editor-documents");
|
|
3441
|
+
var import_editor_v1_adapters6 = require("@elementor/editor-v1-adapters");
|
|
3446
3442
|
var import_store51 = require("@elementor/store");
|
|
3447
3443
|
var import_utils6 = require("@elementor/utils");
|
|
3448
3444
|
|
|
3449
3445
|
// src/store/actions/update-current-component.ts
|
|
3450
|
-
var
|
|
3446
|
+
var import_editor_documents11 = require("@elementor/editor-documents");
|
|
3451
3447
|
var import_store49 = require("@elementor/store");
|
|
3452
3448
|
function updateCurrentComponent({
|
|
3453
3449
|
path,
|
|
@@ -3468,9 +3464,9 @@ var import_react_dom = require("react-dom");
|
|
|
3468
3464
|
var import_i18n24 = require("@wordpress/i18n");
|
|
3469
3465
|
|
|
3470
3466
|
// src/hooks/use-canvas-document.ts
|
|
3471
|
-
var
|
|
3467
|
+
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
3472
3468
|
function useCanvasDocument() {
|
|
3473
|
-
return (0,
|
|
3469
|
+
return (0, import_editor_v1_adapters5.__privateUseListenTo)((0, import_editor_v1_adapters5.commandEndEvent)("editor/documents/attach-preview"), () => (0, import_editor_v1_adapters5.getCanvasIframeDocument)());
|
|
3474
3470
|
}
|
|
3475
3471
|
|
|
3476
3472
|
// src/hooks/use-element-rect.ts
|
|
@@ -3647,11 +3643,11 @@ function EditComponent() {
|
|
|
3647
3643
|
return /* @__PURE__ */ React21.createElement(ComponentModal, { topLevelElementDom, onClose });
|
|
3648
3644
|
}
|
|
3649
3645
|
function useHandleDocumentSwitches() {
|
|
3650
|
-
const documentsManager = (0,
|
|
3646
|
+
const documentsManager = (0, import_editor_documents12.getV1DocumentsManager)();
|
|
3651
3647
|
const currentComponentId = useCurrentComponentId();
|
|
3652
3648
|
const path = (0, import_store51.__useSelector)(selectPath);
|
|
3653
3649
|
(0, import_react13.useEffect)(() => {
|
|
3654
|
-
return (0,
|
|
3650
|
+
return (0, import_editor_v1_adapters6.__privateListenTo)((0, import_editor_v1_adapters6.commandEndEvent)("editor/documents/open"), () => {
|
|
3655
3651
|
const nextDocument = documentsManager.getCurrent();
|
|
3656
3652
|
if (nextDocument.id === currentComponentId) {
|
|
3657
3653
|
return;
|
|
@@ -3691,7 +3687,7 @@ function getInstanceTitle(instanceId, path) {
|
|
|
3691
3687
|
if (!instanceId) {
|
|
3692
3688
|
return void 0;
|
|
3693
3689
|
}
|
|
3694
|
-
const documentsManager = (0,
|
|
3690
|
+
const documentsManager = (0, import_editor_documents12.getV1DocumentsManager)();
|
|
3695
3691
|
const parentDocId = path.at(-1)?.componentId ?? documentsManager.getInitialId();
|
|
3696
3692
|
const parentDoc = documentsManager.get(parentDocId);
|
|
3697
3693
|
const parentContainer = parentDoc?.container;
|
|
@@ -3726,7 +3722,7 @@ function getComponentDOMElements(id2) {
|
|
|
3726
3722
|
if (!id2) {
|
|
3727
3723
|
return { componentContainerDomElement: null, topLevelElementDom: null };
|
|
3728
3724
|
}
|
|
3729
|
-
const documentsManager = (0,
|
|
3725
|
+
const documentsManager = (0, import_editor_documents12.getV1DocumentsManager)();
|
|
3730
3726
|
const currentComponent = documentsManager.get(id2);
|
|
3731
3727
|
const componentContainer = currentComponent?.container;
|
|
3732
3728
|
const componentContainerDomElement = componentContainer?.view?.el?.children?.[0] ?? null;
|
|
@@ -5009,7 +5005,7 @@ function PopulateStore() {
|
|
|
5009
5005
|
// src/prevent-circular-nesting.ts
|
|
5010
5006
|
var import_editor_elements19 = require("@elementor/editor-elements");
|
|
5011
5007
|
var import_editor_notifications4 = require("@elementor/editor-notifications");
|
|
5012
|
-
var
|
|
5008
|
+
var import_editor_v1_adapters7 = require("@elementor/editor-v1-adapters");
|
|
5013
5009
|
var import_store66 = require("@elementor/store");
|
|
5014
5010
|
var import_i18n30 = require("@wordpress/i18n");
|
|
5015
5011
|
var COMPONENT_TYPE = "e-component";
|
|
@@ -5019,15 +5015,15 @@ var COMPONENT_CIRCULAR_NESTING_ALERT = {
|
|
|
5019
5015
|
id: "circular-component-nesting-blocked"
|
|
5020
5016
|
};
|
|
5021
5017
|
function initCircularNestingPrevention() {
|
|
5022
|
-
(0,
|
|
5018
|
+
(0, import_editor_v1_adapters7.blockCommand)({
|
|
5023
5019
|
command: "document/elements/create",
|
|
5024
5020
|
condition: blockCircularCreate
|
|
5025
5021
|
});
|
|
5026
|
-
(0,
|
|
5022
|
+
(0, import_editor_v1_adapters7.blockCommand)({
|
|
5027
5023
|
command: "document/elements/move",
|
|
5028
5024
|
condition: blockCircularMove
|
|
5029
5025
|
});
|
|
5030
|
-
(0,
|
|
5026
|
+
(0, import_editor_v1_adapters7.blockCommand)({
|
|
5031
5027
|
command: "document/elements/paste",
|
|
5032
5028
|
condition: blockCircularPaste
|
|
5033
5029
|
});
|
|
@@ -5248,18 +5244,18 @@ function updateElementComponentId(elementId, componentId) {
|
|
|
5248
5244
|
}
|
|
5249
5245
|
|
|
5250
5246
|
// src/sync/publish-draft-components-in-page-before-save.ts
|
|
5251
|
-
var
|
|
5247
|
+
var import_editor_documents13 = require("@elementor/editor-documents");
|
|
5252
5248
|
async function publishDraftComponentsInPageBeforeSave({ status, elements }) {
|
|
5253
5249
|
if (status !== "publish") {
|
|
5254
5250
|
return;
|
|
5255
5251
|
}
|
|
5256
5252
|
const documents = await getComponentDocuments(elements);
|
|
5257
|
-
const draftIds = [...documents.values()].filter(
|
|
5253
|
+
const draftIds = [...documents.values()].filter(import_editor_documents13.isDocumentDirty).map((document) => document.id);
|
|
5258
5254
|
if (draftIds.length === 0) {
|
|
5259
5255
|
return;
|
|
5260
5256
|
}
|
|
5261
5257
|
await apiClient.updateStatuses(draftIds, "publish");
|
|
5262
|
-
draftIds.forEach((id2) =>
|
|
5258
|
+
draftIds.forEach((id2) => (0, import_editor_documents13.invalidateDocumentData)(id2));
|
|
5263
5259
|
}
|
|
5264
5260
|
|
|
5265
5261
|
// src/sync/set-component-overridable-props-settings-before-save.ts
|
|
@@ -5337,10 +5333,10 @@ var updateExistingComponentsBeforeSave = async ({
|
|
|
5337
5333
|
|
|
5338
5334
|
// src/sync/cleanup-overridable-props-on-delete.ts
|
|
5339
5335
|
var import_editor_elements21 = require("@elementor/editor-elements");
|
|
5340
|
-
var
|
|
5336
|
+
var import_editor_v1_adapters8 = require("@elementor/editor-v1-adapters");
|
|
5341
5337
|
var import_store80 = require("@elementor/store");
|
|
5342
5338
|
function initCleanupOverridablePropsOnDelete() {
|
|
5343
|
-
(0,
|
|
5339
|
+
(0, import_editor_v1_adapters8.registerDataHook)("dependency", "document/elements/delete", (args) => {
|
|
5344
5340
|
const state = (0, import_store80.__getState)();
|
|
5345
5341
|
if (!state) {
|
|
5346
5342
|
return true;
|
|
@@ -5392,14 +5388,14 @@ function collectDeletedElementIds(containers) {
|
|
|
5392
5388
|
|
|
5393
5389
|
// src/sync/handle-component-edit-mode-container.ts
|
|
5394
5390
|
var import_editor_elements22 = require("@elementor/editor-elements");
|
|
5395
|
-
var
|
|
5391
|
+
var import_editor_v1_adapters9 = require("@elementor/editor-v1-adapters");
|
|
5396
5392
|
var V4_DEFAULT_CONTAINER_TYPE = "e-flexbox";
|
|
5397
5393
|
function initHandleComponentEditModeContainer() {
|
|
5398
5394
|
initRedirectDropIntoComponent();
|
|
5399
5395
|
initHandleTopLevelElementDelete();
|
|
5400
5396
|
}
|
|
5401
5397
|
function initHandleTopLevelElementDelete() {
|
|
5402
|
-
(0,
|
|
5398
|
+
(0, import_editor_v1_adapters9.registerDataHook)("after", "document/elements/delete", (args) => {
|
|
5403
5399
|
if (!isEditingComponent()) {
|
|
5404
5400
|
return;
|
|
5405
5401
|
}
|
|
@@ -5417,7 +5413,7 @@ function initHandleTopLevelElementDelete() {
|
|
|
5417
5413
|
});
|
|
5418
5414
|
}
|
|
5419
5415
|
function initRedirectDropIntoComponent() {
|
|
5420
|
-
(0,
|
|
5416
|
+
(0, import_editor_v1_adapters9.registerDataHook)("dependency", "preview/drop", (args) => {
|
|
5421
5417
|
if (!isEditingComponent()) {
|
|
5422
5418
|
return true;
|
|
5423
5419
|
}
|
|
@@ -5463,12 +5459,12 @@ function isComponent(container) {
|
|
|
5463
5459
|
}
|
|
5464
5460
|
|
|
5465
5461
|
// src/sync/load-component-data-after-instance-added.ts
|
|
5466
|
-
var
|
|
5462
|
+
var import_editor_v1_adapters10 = require("@elementor/editor-v1-adapters");
|
|
5467
5463
|
function initLoadComponentDataAfterInstanceAdded() {
|
|
5468
|
-
(0,
|
|
5464
|
+
(0, import_editor_v1_adapters10.registerDataHook)("after", "document/elements/paste", (_args, result) => {
|
|
5469
5465
|
load(result);
|
|
5470
5466
|
});
|
|
5471
|
-
(0,
|
|
5467
|
+
(0, import_editor_v1_adapters10.registerDataHook)("after", "document/elements/import", (_args, result) => {
|
|
5472
5468
|
load(result);
|
|
5473
5469
|
});
|
|
5474
5470
|
}
|
|
@@ -5479,16 +5475,16 @@ function load(result) {
|
|
|
5479
5475
|
|
|
5480
5476
|
// src/sync/regenerate-override-keys.ts
|
|
5481
5477
|
var import_editor_elements23 = require("@elementor/editor-elements");
|
|
5482
|
-
var
|
|
5478
|
+
var import_editor_v1_adapters11 = require("@elementor/editor-v1-adapters");
|
|
5483
5479
|
var import_utils10 = require("@elementor/utils");
|
|
5484
5480
|
function initRegenerateOverrideKeys() {
|
|
5485
|
-
(0,
|
|
5481
|
+
(0, import_editor_v1_adapters11.registerDataHook)("after", "document/elements/duplicate", (_args, result) => {
|
|
5486
5482
|
regenerateOverrideKeysForContainers(result);
|
|
5487
5483
|
});
|
|
5488
|
-
(0,
|
|
5484
|
+
(0, import_editor_v1_adapters11.registerDataHook)("after", "document/elements/paste", (_args, result) => {
|
|
5489
5485
|
regenerateOverrideKeysForContainers(result);
|
|
5490
5486
|
});
|
|
5491
|
-
(0,
|
|
5487
|
+
(0, import_editor_v1_adapters11.registerDataHook)("after", "document/elements/import", (_args, result) => {
|
|
5492
5488
|
regenerateOverrideKeysForContainers(result);
|
|
5493
5489
|
});
|
|
5494
5490
|
}
|
|
@@ -5557,15 +5553,15 @@ function hasOverrides(settings) {
|
|
|
5557
5553
|
}
|
|
5558
5554
|
|
|
5559
5555
|
// src/sync/revert-overridables-on-copy-or-duplicate.ts
|
|
5560
|
-
var
|
|
5556
|
+
var import_editor_v1_adapters12 = require("@elementor/editor-v1-adapters");
|
|
5561
5557
|
function initRevertOverridablesOnCopyOrDuplicate() {
|
|
5562
|
-
(0,
|
|
5558
|
+
(0, import_editor_v1_adapters12.registerDataHook)("after", "document/elements/duplicate", (_args, result) => {
|
|
5563
5559
|
if (!isEditingComponent()) {
|
|
5564
5560
|
return;
|
|
5565
5561
|
}
|
|
5566
5562
|
revertOverridablesForDuplicatedElements(result);
|
|
5567
5563
|
});
|
|
5568
|
-
(0,
|
|
5564
|
+
(0, import_editor_v1_adapters12.registerDataHook)("after", "document/elements/copy", (args) => {
|
|
5569
5565
|
if (!isEditingComponent()) {
|
|
5570
5566
|
return;
|
|
5571
5567
|
}
|
|
@@ -5603,14 +5599,14 @@ function init() {
|
|
|
5603
5599
|
COMPONENT_WIDGET_TYPE,
|
|
5604
5600
|
(options) => createComponentType({ ...options, showLockedByModal: openEditModeDialog })
|
|
5605
5601
|
);
|
|
5606
|
-
(0,
|
|
5607
|
-
const document = (0,
|
|
5602
|
+
(0, import_editor_v1_adapters13.registerDataHook)("dependency", "editor/documents/close", (args) => {
|
|
5603
|
+
const document = (0, import_editor_documents14.getV1CurrentDocument)();
|
|
5608
5604
|
if (document.config.type === COMPONENT_DOCUMENT_TYPE) {
|
|
5609
5605
|
args.mode = "autosave";
|
|
5610
5606
|
}
|
|
5611
5607
|
return true;
|
|
5612
5608
|
});
|
|
5613
|
-
(0,
|
|
5609
|
+
(0, import_editor_v1_adapters13.registerDataHook)("after", "preview/drop", onElementDrop);
|
|
5614
5610
|
window.elementorCommon.__beforeSave = beforeSave;
|
|
5615
5611
|
(0, import_editor_elements_panel.injectTab)({
|
|
5616
5612
|
id: "components",
|
|
@@ -5634,8 +5630,8 @@ function init() {
|
|
|
5634
5630
|
id: "component-panel-header",
|
|
5635
5631
|
component: ComponentPanelHeader
|
|
5636
5632
|
});
|
|
5637
|
-
(0,
|
|
5638
|
-
const { id: id2, config } = (0,
|
|
5633
|
+
(0, import_editor_v1_adapters13.registerDataHook)("after", "editor/documents/attach-preview", async () => {
|
|
5634
|
+
const { id: id2, config } = (0, import_editor_documents14.getV1CurrentDocument)();
|
|
5639
5635
|
if (id2) {
|
|
5640
5636
|
removeComponentStyles(id2);
|
|
5641
5637
|
}
|