@elementor/editor-components 3.33.0-252 → 3.33.0-253
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 +78 -70
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +62 -54
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/api.ts +4 -4
- package/src/component-id-transformer.ts +15 -9
- package/src/components/components-tab/components-item.tsx +6 -2
- package/src/components/components-tab/components-list.tsx +1 -1
- package/src/components/consts.ts +1 -0
- package/src/components/create-component-form/create-component-form.tsx +18 -18
- package/src/components/create-component-form/utils/replace-element-with-component.ts +10 -7
- package/src/components/edit-component/edit-component.tsx +3 -5
- package/src/store/store.ts +24 -22
- package/src/sync/create-components-before-save.ts +17 -16
- package/src/types.ts +20 -2
package/dist/index.js
CHANGED
|
@@ -41,7 +41,7 @@ var import_editor_documents2 = require("@elementor/editor-documents");
|
|
|
41
41
|
var import_editor_elements_panel = require("@elementor/editor-elements-panel");
|
|
42
42
|
var import_editor_styles_repository2 = require("@elementor/editor-styles-repository");
|
|
43
43
|
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
44
|
-
var
|
|
44
|
+
var import_store18 = require("@elementor/store");
|
|
45
45
|
var import_i18n8 = require("@wordpress/i18n");
|
|
46
46
|
|
|
47
47
|
// src/component-id-transformer.ts
|
|
@@ -102,7 +102,8 @@ var initialState = {
|
|
|
102
102
|
data: [],
|
|
103
103
|
unpublishedData: [],
|
|
104
104
|
loadStatus: "idle",
|
|
105
|
-
styles: {}
|
|
105
|
+
styles: {},
|
|
106
|
+
createdThisSession: []
|
|
106
107
|
};
|
|
107
108
|
var SLICE_NAME = "components";
|
|
108
109
|
var slice = (0, import_store2.__createSlice)({
|
|
@@ -131,6 +132,9 @@ var slice = (0, import_store2.__createSlice)({
|
|
|
131
132
|
},
|
|
132
133
|
addStyles: (state, { payload }) => {
|
|
133
134
|
state.styles = { ...state.styles, ...payload };
|
|
135
|
+
},
|
|
136
|
+
addCreatedThisSession: (state, { payload }) => {
|
|
137
|
+
state.createdThisSession.push(payload);
|
|
134
138
|
}
|
|
135
139
|
},
|
|
136
140
|
extraReducers: (builder) => {
|
|
@@ -150,11 +154,12 @@ var selectData = (state) => state[SLICE_NAME].data;
|
|
|
150
154
|
var selectLoadStatus = (state) => state[SLICE_NAME].loadStatus;
|
|
151
155
|
var selectStylesDefinitions = (state) => state[SLICE_NAME].styles ?? {};
|
|
152
156
|
var selectUnpublishedData = (state) => state[SLICE_NAME].unpublishedData;
|
|
157
|
+
var getCreatedThisSession = (state) => state[SLICE_NAME].createdThisSession;
|
|
153
158
|
var selectComponents = (0, import_store2.__createSelector)(
|
|
154
159
|
selectData,
|
|
155
160
|
selectUnpublishedData,
|
|
156
161
|
(data, unpublishedData) => [
|
|
157
|
-
...unpublishedData.map((item) => ({
|
|
162
|
+
...unpublishedData.map((item) => ({ uid: item.uid, name: item.name })),
|
|
158
163
|
...data
|
|
159
164
|
]
|
|
160
165
|
);
|
|
@@ -162,18 +167,14 @@ var selectUnpublishedComponents = (0, import_store2.__createSelector)(
|
|
|
162
167
|
selectUnpublishedData,
|
|
163
168
|
(unpublishedData) => unpublishedData
|
|
164
169
|
);
|
|
165
|
-
var selectComponentsObject = (0, import_store2.__createSelector)(
|
|
166
|
-
selectData,
|
|
167
|
-
selectUnpublishedData,
|
|
168
|
-
(data, unpublishedData) => data.concat(unpublishedData).reduce((acc, component) => {
|
|
169
|
-
acc[component.id] = component;
|
|
170
|
-
return acc;
|
|
171
|
-
}, {})
|
|
172
|
-
);
|
|
173
170
|
var selectLoadIsPending = (0, import_store2.__createSelector)(selectLoadStatus, (status) => status === "pending");
|
|
174
171
|
var selectLoadIsError = (0, import_store2.__createSelector)(selectLoadStatus, (status) => status === "error");
|
|
175
172
|
var selectStyles = (state) => state[SLICE_NAME].styles ?? {};
|
|
176
173
|
var selectFlatStyles = (0, import_store2.__createSelector)(selectStylesDefinitions, (data) => Object.values(data).flat());
|
|
174
|
+
var selectCreatedThisSession = (0, import_store2.__createSelector)(
|
|
175
|
+
getCreatedThisSession,
|
|
176
|
+
(createdThisSession) => createdThisSession
|
|
177
|
+
);
|
|
177
178
|
|
|
178
179
|
// src/utils/component-document-data.ts
|
|
179
180
|
var getComponentDocumentData = async (id) => {
|
|
@@ -198,15 +199,20 @@ function getDocumentsManager() {
|
|
|
198
199
|
}
|
|
199
200
|
|
|
200
201
|
// src/component-id-transformer.ts
|
|
201
|
-
var componentIdTransformer = (0, import_editor_canvas.createTransformer)(
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
202
|
+
var componentIdTransformer = (0, import_editor_canvas.createTransformer)(
|
|
203
|
+
async (id) => {
|
|
204
|
+
const unpublishedComponents = selectUnpublishedComponents((0, import_store3.__getState)());
|
|
205
|
+
const unpublishedComponent = unpublishedComponents.find(({ uid }) => uid === id);
|
|
206
|
+
if (unpublishedComponent) {
|
|
207
|
+
return structuredClone(unpublishedComponent.elements);
|
|
208
|
+
}
|
|
209
|
+
if (typeof id !== "number") {
|
|
210
|
+
throw new Error(`Component ID "${id}" not found.`);
|
|
211
|
+
}
|
|
212
|
+
const data = await getComponentDocumentData(id);
|
|
213
|
+
return data?.elements ?? [];
|
|
206
214
|
}
|
|
207
|
-
|
|
208
|
-
return data?.elements ?? [];
|
|
209
|
-
});
|
|
215
|
+
);
|
|
210
216
|
|
|
211
217
|
// src/components/components-tab/components.tsx
|
|
212
218
|
var React6 = __toESM(require("react"));
|
|
@@ -386,18 +392,19 @@ var createComponentModel = (component) => {
|
|
|
386
392
|
settings: {
|
|
387
393
|
component: {
|
|
388
394
|
$$type: "component-id",
|
|
389
|
-
value: component.id
|
|
395
|
+
value: component.id ?? component.uid
|
|
390
396
|
}
|
|
391
397
|
},
|
|
392
398
|
editor_settings: {
|
|
393
|
-
title: component.name
|
|
399
|
+
title: component.name,
|
|
400
|
+
component_uid: component.uid
|
|
394
401
|
}
|
|
395
402
|
};
|
|
396
403
|
};
|
|
397
404
|
|
|
398
405
|
// src/components/components-tab/components-item.tsx
|
|
399
406
|
var ComponentItem = ({ component }) => {
|
|
400
|
-
const componentModel = createComponentModel(
|
|
407
|
+
const componentModel = createComponentModel(component);
|
|
401
408
|
const handleClick = () => {
|
|
402
409
|
addComponentToPage(componentModel);
|
|
403
410
|
};
|
|
@@ -488,7 +495,7 @@ function ComponentsList() {
|
|
|
488
495
|
}
|
|
489
496
|
return /* @__PURE__ */ React5.createElement(EmptyState, null);
|
|
490
497
|
}
|
|
491
|
-
return /* @__PURE__ */ React5.createElement(import_ui4.List, { sx: { display: "flex", flexDirection: "column", gap: 1, px: 2 } }, components.map((component) => /* @__PURE__ */ React5.createElement(ComponentItem, { key: component.
|
|
498
|
+
return /* @__PURE__ */ React5.createElement(import_ui4.List, { sx: { display: "flex", flexDirection: "column", gap: 1, px: 2 } }, components.map((component) => /* @__PURE__ */ React5.createElement(ComponentItem, { key: component.uid, component })));
|
|
492
499
|
}
|
|
493
500
|
var EmptyState = () => {
|
|
494
501
|
return /* @__PURE__ */ React5.createElement(
|
|
@@ -599,6 +606,7 @@ var import_editor_ui2 = require("@elementor/editor-ui");
|
|
|
599
606
|
var import_icons4 = require("@elementor/icons");
|
|
600
607
|
var import_store9 = require("@elementor/store");
|
|
601
608
|
var import_ui5 = require("@elementor/ui");
|
|
609
|
+
var import_utils2 = require("@elementor/utils");
|
|
602
610
|
var import_i18n4 = require("@wordpress/i18n");
|
|
603
611
|
|
|
604
612
|
// src/components/create-component-form/hooks/use-form.ts
|
|
@@ -693,27 +701,25 @@ function CreateComponentForm() {
|
|
|
693
701
|
window.removeEventListener(OPEN_SAVE_AS_COMPONENT_FORM_EVENT, openPopup);
|
|
694
702
|
};
|
|
695
703
|
}, []);
|
|
696
|
-
const handleSave =
|
|
704
|
+
const handleSave = (values) => {
|
|
697
705
|
try {
|
|
698
706
|
if (!element) {
|
|
699
707
|
throw new Error(`Can't save element as component: element not found`);
|
|
700
708
|
}
|
|
701
|
-
const
|
|
709
|
+
const uid = (0, import_utils2.generateUniqueId)("component");
|
|
702
710
|
dispatch5(
|
|
703
711
|
slice.actions.addUnpublished({
|
|
704
|
-
|
|
712
|
+
uid,
|
|
705
713
|
name: values.componentName,
|
|
706
714
|
elements: [element.element.model.toJSON({ remove: ["default"] })]
|
|
707
715
|
})
|
|
708
716
|
);
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
name: values.componentName
|
|
712
|
-
});
|
|
717
|
+
dispatch5(slice.actions.addCreatedThisSession(uid));
|
|
718
|
+
replaceElementWithComponent(element.element, { uid, name: values.componentName });
|
|
713
719
|
setResultNotification({
|
|
714
720
|
show: true,
|
|
715
|
-
// Translators: %1$s: Component name, %2$s: Component
|
|
716
|
-
message: (0, import_i18n4.__)("Component saved successfully as: %1$s (
|
|
721
|
+
// Translators: %1$s: Component name, %2$s: Component UID
|
|
722
|
+
message: (0, import_i18n4.__)("Component saved successfully as: %1$s (UID: %2$s)", "elementor").replace("%1$s", values.componentName).replace("%2$s", uid),
|
|
717
723
|
type: "success"
|
|
718
724
|
});
|
|
719
725
|
resetAndClosePopup();
|
|
@@ -730,11 +736,14 @@ function CreateComponentForm() {
|
|
|
730
736
|
setElement(null);
|
|
731
737
|
setAnchorPosition(void 0);
|
|
732
738
|
};
|
|
739
|
+
const cancelSave = () => {
|
|
740
|
+
resetAndClosePopup();
|
|
741
|
+
};
|
|
733
742
|
return /* @__PURE__ */ React7.createElement(import_editor_ui2.ThemeProvider, null, /* @__PURE__ */ React7.createElement(
|
|
734
743
|
import_ui5.Popover,
|
|
735
744
|
{
|
|
736
745
|
open: element !== null,
|
|
737
|
-
onClose:
|
|
746
|
+
onClose: cancelSave,
|
|
738
747
|
anchorReference: "anchorPosition",
|
|
739
748
|
anchorPosition
|
|
740
749
|
},
|
|
@@ -743,7 +752,7 @@ function CreateComponentForm() {
|
|
|
743
752
|
{
|
|
744
753
|
initialValues: { componentName: element.elementLabel },
|
|
745
754
|
handleSave,
|
|
746
|
-
closePopup:
|
|
755
|
+
closePopup: cancelSave
|
|
747
756
|
}
|
|
748
757
|
)
|
|
749
758
|
), /* @__PURE__ */ React7.createElement(import_ui5.Snackbar, { open: resultNotification?.show, onClose: () => setResultNotification(null) }, /* @__PURE__ */ React7.createElement(
|
|
@@ -816,16 +825,15 @@ var Form = ({
|
|
|
816
825
|
(0, import_i18n4.__)("Create", "elementor")
|
|
817
826
|
)));
|
|
818
827
|
};
|
|
819
|
-
var generateTempId = () => {
|
|
820
|
-
return Date.now() + Math.floor(Math.random() * 1e6);
|
|
821
|
-
};
|
|
822
828
|
|
|
823
829
|
// src/components/edit-component/edit-component.tsx
|
|
824
830
|
var React9 = __toESM(require("react"));
|
|
825
831
|
var import_react6 = require("react");
|
|
826
832
|
var import_editor_documents = require("@elementor/editor-documents");
|
|
827
833
|
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
828
|
-
|
|
834
|
+
|
|
835
|
+
// src/components/consts.ts
|
|
836
|
+
var COMPONENT_DOCUMENT_TYPE = "elementor_component";
|
|
829
837
|
|
|
830
838
|
// src/components/edit-component/component-modal.tsx
|
|
831
839
|
var React8 = __toESM(require("react"));
|
|
@@ -842,10 +850,10 @@ function useCanvasDocument() {
|
|
|
842
850
|
|
|
843
851
|
// src/hooks/use-element-rect.ts
|
|
844
852
|
var import_react4 = require("react");
|
|
845
|
-
var
|
|
853
|
+
var import_utils3 = require("@elementor/utils");
|
|
846
854
|
function useElementRect(element) {
|
|
847
855
|
const [rect, setRect] = (0, import_react4.useState)(new DOMRect(0, 0, 0, 0));
|
|
848
|
-
const onChange = (0,
|
|
856
|
+
const onChange = (0, import_utils3.throttle)(
|
|
849
857
|
() => {
|
|
850
858
|
setRect(element?.getBoundingClientRect() ?? new DOMRect(0, 0, 0, 0));
|
|
851
859
|
},
|
|
@@ -1022,7 +1030,6 @@ function EditComponent() {
|
|
|
1022
1030
|
return /* @__PURE__ */ React9.createElement(ComponentModal, { element: elementDom, onClose: onBack });
|
|
1023
1031
|
}
|
|
1024
1032
|
function useHandleDocumentSwitches(path, setPath) {
|
|
1025
|
-
const components = (0, import_store11.__useSelector)(selectComponentsObject);
|
|
1026
1033
|
const documentsManager = (0, import_editor_documents.getV1DocumentsManager)();
|
|
1027
1034
|
(0, import_react6.useEffect)(
|
|
1028
1035
|
() => (0, import_editor_v1_adapters3.__privateListenTo)((0, import_editor_v1_adapters3.commandEndEvent)("editor/documents/attach-preview"), () => {
|
|
@@ -1035,14 +1042,14 @@ function useHandleDocumentSwitches(path, setPath) {
|
|
|
1035
1042
|
if (currentComponentId) {
|
|
1036
1043
|
apiClient.unlockComponent(currentComponentId);
|
|
1037
1044
|
}
|
|
1038
|
-
const isComponent =
|
|
1045
|
+
const isComponent = nextDocument.config.type === COMPONENT_DOCUMENT_TYPE;
|
|
1039
1046
|
if (!isComponent) {
|
|
1040
1047
|
setPath([]);
|
|
1041
1048
|
return;
|
|
1042
1049
|
}
|
|
1043
1050
|
setPath(getUpdatedComponentPath(path, nextDocument));
|
|
1044
1051
|
}),
|
|
1045
|
-
[path, setPath,
|
|
1052
|
+
[path, setPath, documentsManager]
|
|
1046
1053
|
);
|
|
1047
1054
|
}
|
|
1048
1055
|
function getUpdatedComponentPath(path, nextDocument) {
|
|
@@ -1210,21 +1217,21 @@ function setInactiveRecursively(model) {
|
|
|
1210
1217
|
|
|
1211
1218
|
// src/populate-store.ts
|
|
1212
1219
|
var import_react7 = require("react");
|
|
1213
|
-
var
|
|
1220
|
+
var import_store11 = require("@elementor/store");
|
|
1214
1221
|
function PopulateStore() {
|
|
1215
1222
|
(0, import_react7.useEffect)(() => {
|
|
1216
|
-
(0,
|
|
1223
|
+
(0, import_store11.__dispatch)(loadComponents());
|
|
1217
1224
|
}, []);
|
|
1218
1225
|
return null;
|
|
1219
1226
|
}
|
|
1220
1227
|
|
|
1221
1228
|
// src/store/components-styles-provider.ts
|
|
1222
1229
|
var import_editor_styles_repository = require("@elementor/editor-styles-repository");
|
|
1223
|
-
var
|
|
1230
|
+
var import_store12 = require("@elementor/store");
|
|
1224
1231
|
var componentsStylesProvider = (0, import_editor_styles_repository.createStylesProvider)({
|
|
1225
1232
|
key: "components-styles",
|
|
1226
1233
|
priority: 100,
|
|
1227
|
-
subscribe: (cb) => (0,
|
|
1234
|
+
subscribe: (cb) => (0, import_store12.__subscribeWithSelector)(
|
|
1228
1235
|
(state) => state[SLICE_NAME],
|
|
1229
1236
|
() => {
|
|
1230
1237
|
cb();
|
|
@@ -1232,45 +1239,46 @@ var componentsStylesProvider = (0, import_editor_styles_repository.createStylesP
|
|
|
1232
1239
|
),
|
|
1233
1240
|
actions: {
|
|
1234
1241
|
all: () => {
|
|
1235
|
-
return selectFlatStyles((0,
|
|
1242
|
+
return selectFlatStyles((0, import_store12.__getState)());
|
|
1236
1243
|
},
|
|
1237
1244
|
get: (id) => {
|
|
1238
|
-
return selectFlatStyles((0,
|
|
1245
|
+
return selectFlatStyles((0, import_store12.__getState)()).find((style) => style.id === id) ?? null;
|
|
1239
1246
|
}
|
|
1240
1247
|
}
|
|
1241
1248
|
});
|
|
1242
1249
|
|
|
1243
1250
|
// src/store/remove-component-styles.ts
|
|
1244
|
-
var
|
|
1251
|
+
var import_store14 = require("@elementor/store");
|
|
1245
1252
|
function removeComponentStyles(id) {
|
|
1246
1253
|
apiClient.invalidateComponentConfigCache(id);
|
|
1247
|
-
(0,
|
|
1254
|
+
(0, import_store14.__dispatch)(slice.actions.removeStyles({ id }));
|
|
1248
1255
|
}
|
|
1249
1256
|
|
|
1250
1257
|
// src/sync/create-components-before-save.ts
|
|
1251
1258
|
var import_editor_elements5 = require("@elementor/editor-elements");
|
|
1252
|
-
var
|
|
1259
|
+
var import_store16 = require("@elementor/store");
|
|
1253
1260
|
async function createComponentsBeforeSave({
|
|
1254
1261
|
container,
|
|
1255
1262
|
status
|
|
1256
1263
|
}) {
|
|
1257
|
-
const unpublishedComponents = selectUnpublishedComponents((0,
|
|
1264
|
+
const unpublishedComponents = selectUnpublishedComponents((0, import_store16.__getState)());
|
|
1258
1265
|
if (!unpublishedComponents.length) {
|
|
1259
1266
|
return;
|
|
1260
1267
|
}
|
|
1261
1268
|
try {
|
|
1262
|
-
const
|
|
1269
|
+
const uidToComponentId = await createComponents(unpublishedComponents, status);
|
|
1263
1270
|
const elements = container.model.get("elements").toJSON();
|
|
1264
|
-
updateComponentInstances(elements,
|
|
1265
|
-
(0,
|
|
1271
|
+
updateComponentInstances(elements, uidToComponentId);
|
|
1272
|
+
(0, import_store16.__dispatch)(
|
|
1266
1273
|
slice.actions.add(
|
|
1267
1274
|
unpublishedComponents.map((component) => ({
|
|
1268
|
-
id:
|
|
1269
|
-
name: component.name
|
|
1275
|
+
id: uidToComponentId.get(component.uid),
|
|
1276
|
+
name: component.name,
|
|
1277
|
+
uid: component.uid
|
|
1270
1278
|
}))
|
|
1271
1279
|
)
|
|
1272
1280
|
);
|
|
1273
|
-
(0,
|
|
1281
|
+
(0, import_store16.__dispatch)(slice.actions.resetUnpublished());
|
|
1274
1282
|
} catch (error) {
|
|
1275
1283
|
throw new Error(`Failed to publish components and update component instances: ${error}`);
|
|
1276
1284
|
}
|
|
@@ -1279,33 +1287,33 @@ async function createComponents(components, status) {
|
|
|
1279
1287
|
const response = await apiClient.create({
|
|
1280
1288
|
status,
|
|
1281
1289
|
items: components.map((component) => ({
|
|
1282
|
-
|
|
1290
|
+
uid: component.uid,
|
|
1283
1291
|
title: component.name,
|
|
1284
1292
|
elements: component.elements
|
|
1285
1293
|
}))
|
|
1286
1294
|
});
|
|
1287
1295
|
const map = /* @__PURE__ */ new Map();
|
|
1288
1296
|
Object.entries(response).forEach(([key, value]) => {
|
|
1289
|
-
map.set(
|
|
1297
|
+
map.set(key, value);
|
|
1290
1298
|
});
|
|
1291
1299
|
return map;
|
|
1292
1300
|
}
|
|
1293
|
-
function updateComponentInstances(elements,
|
|
1301
|
+
function updateComponentInstances(elements, uidToComponentId) {
|
|
1294
1302
|
elements.forEach((element) => {
|
|
1295
|
-
const { shouldUpdate, newComponentId } = shouldUpdateElement(element,
|
|
1303
|
+
const { shouldUpdate, newComponentId } = shouldUpdateElement(element, uidToComponentId);
|
|
1296
1304
|
if (shouldUpdate) {
|
|
1297
1305
|
updateElementComponentId(element.id, newComponentId);
|
|
1298
1306
|
}
|
|
1299
1307
|
if (element.elements) {
|
|
1300
|
-
updateComponentInstances(element.elements,
|
|
1308
|
+
updateComponentInstances(element.elements, uidToComponentId);
|
|
1301
1309
|
}
|
|
1302
1310
|
});
|
|
1303
1311
|
}
|
|
1304
|
-
function shouldUpdateElement(element,
|
|
1312
|
+
function shouldUpdateElement(element, uidToComponentId) {
|
|
1305
1313
|
if (element.widgetType === "e-component") {
|
|
1306
1314
|
const currentComponentId = element.settings?.component?.value;
|
|
1307
|
-
if (currentComponentId &&
|
|
1308
|
-
return { shouldUpdate: true, newComponentId:
|
|
1315
|
+
if (currentComponentId && uidToComponentId.has(currentComponentId)) {
|
|
1316
|
+
return { shouldUpdate: true, newComponentId: uidToComponentId.get(currentComponentId) };
|
|
1309
1317
|
}
|
|
1310
1318
|
}
|
|
1311
1319
|
return { shouldUpdate: false, newComponentId: null };
|
|
@@ -1353,17 +1361,17 @@ var beforeSave = ({ container, status }) => {
|
|
|
1353
1361
|
};
|
|
1354
1362
|
|
|
1355
1363
|
// src/init.ts
|
|
1356
|
-
var
|
|
1364
|
+
var COMPONENT_DOCUMENT_TYPE2 = "elementor_component";
|
|
1357
1365
|
function init() {
|
|
1358
1366
|
import_editor_styles_repository2.stylesRepository.register(componentsStylesProvider);
|
|
1359
|
-
(0,
|
|
1367
|
+
(0, import_store18.__registerSlice)(slice);
|
|
1360
1368
|
(0, import_editor_canvas5.registerElementType)(
|
|
1361
1369
|
TYPE,
|
|
1362
1370
|
(options) => createComponentType({ ...options, showLockedByModal: openEditModeDialog })
|
|
1363
1371
|
);
|
|
1364
1372
|
(0, import_editor_v1_adapters5.registerDataHook)("dependency", "editor/documents/close", (args) => {
|
|
1365
1373
|
const document = (0, import_editor_documents2.getV1CurrentDocument)();
|
|
1366
|
-
if (document.config.type ===
|
|
1374
|
+
if (document.config.type === COMPONENT_DOCUMENT_TYPE2) {
|
|
1367
1375
|
args.mode = "autosave";
|
|
1368
1376
|
}
|
|
1369
1377
|
return true;
|