@elementor/editor-components 3.35.0-328 → 3.35.0-330
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 +12 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +21 -21
- package/src/components/component-panel-header/component-badge.tsx +2 -2
- package/src/components/component-panel-header/component-panel-header.tsx +4 -4
- package/src/components/create-component-form/utils/replace-element-with-component.ts +4 -1
- package/src/create-component-type.ts +1 -1
- package/src/sync/create-components-before-save.ts +4 -2
- package/src/types.ts +12 -4
- package/src/utils/get-component-ids.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -352,7 +352,7 @@ var ComponentsBadge = ({ overridesCount }) => {
|
|
|
352
352
|
anchorOrigin: { vertical: "top", horizontal: "right" },
|
|
353
353
|
badgeContent: /* @__PURE__ */ React.createElement(import_ui.Box, { sx: { animation: !isFirstOverride ? `${slideUp} 300ms ease-out` : "none" } }, overridesCount)
|
|
354
354
|
},
|
|
355
|
-
/* @__PURE__ */ React.createElement(import_ui.ToggleButton, { value: "overrides", size: "tiny", "aria-label": (0, import_i18n.__)("View overrides", "elementor") }, /* @__PURE__ */ React.createElement(import_icons.
|
|
355
|
+
/* @__PURE__ */ React.createElement(import_ui.ToggleButton, { value: "overrides", size: "tiny", "aria-label": (0, import_i18n.__)("View overrides", "elementor") }, /* @__PURE__ */ React.createElement(import_icons.ComponentPropListIcon, { fontSize: "tiny" }))
|
|
356
356
|
);
|
|
357
357
|
};
|
|
358
358
|
var StyledBadge = (0, import_ui.styled)(import_ui.Badge, { shouldForwardProp: (prop) => prop !== "animate" })(
|
|
@@ -413,7 +413,7 @@ var ComponentPanelHeader = () => {
|
|
|
413
413
|
justifyContent: "space-between",
|
|
414
414
|
sx: { height: 48, pl: 1.5, pr: 2, py: 1 }
|
|
415
415
|
},
|
|
416
|
-
/* @__PURE__ */ React2.createElement(import_ui2.Stack, { direction: "row", alignItems: "center"
|
|
416
|
+
/* @__PURE__ */ React2.createElement(import_ui2.Stack, { direction: "row", alignItems: "center" }, /* @__PURE__ */ React2.createElement(import_ui2.Tooltip, { title: (0, import_i18n2.__)("Back", "elementor") }, /* @__PURE__ */ React2.createElement(import_ui2.IconButton, { size: "tiny", onClick: onBack, "aria-label": (0, import_i18n2.__)("Back", "elementor") }, /* @__PURE__ */ React2.createElement(import_icons2.ArrowLeftIcon, { fontSize: "tiny" }))), /* @__PURE__ */ React2.createElement(import_ui2.Stack, { direction: "row", alignItems: "center", gap: 0.5 }, /* @__PURE__ */ React2.createElement(import_icons2.ComponentsFilledIcon, { fontSize: "tiny", stroke: "currentColor" }), /* @__PURE__ */ React2.createElement(import_ui2.Typography, { variant: "caption", sx: { fontWeight: 500 } }, componentName))),
|
|
417
417
|
/* @__PURE__ */ React2.createElement(ComponentsBadge, { overridesCount })
|
|
418
418
|
), /* @__PURE__ */ React2.createElement(import_ui2.Divider, null));
|
|
419
419
|
};
|
|
@@ -598,7 +598,7 @@ function createComponentView(options) {
|
|
|
598
598
|
}
|
|
599
599
|
getComponentId() {
|
|
600
600
|
const componentInstance = this.options?.model?.get("settings")?.get("component_instance")?.value;
|
|
601
|
-
return componentInstance.component_id;
|
|
601
|
+
return componentInstance.component_id.value;
|
|
602
602
|
}
|
|
603
603
|
getContextMenuGroups() {
|
|
604
604
|
const filteredGroups = super.getContextMenuGroups().filter((group) => group.name !== "save");
|
|
@@ -694,7 +694,7 @@ var getComponentIds = async (elements) => {
|
|
|
694
694
|
const ids = [];
|
|
695
695
|
const isComponent = [widgetType, elType].includes(TYPE);
|
|
696
696
|
if (isComponent) {
|
|
697
|
-
const componentId = settings?.component_instance?.value?.component_id;
|
|
697
|
+
const componentId = settings?.component_instance?.value?.component_id.value;
|
|
698
698
|
const document = await getComponentDocumentData(componentId);
|
|
699
699
|
childElements = document?.elements;
|
|
700
700
|
if (Boolean(componentId)) {
|
|
@@ -837,7 +837,10 @@ var createComponentModel = (component) => {
|
|
|
837
837
|
component_instance: {
|
|
838
838
|
$$type: "component-instance",
|
|
839
839
|
value: {
|
|
840
|
-
component_id:
|
|
840
|
+
component_id: {
|
|
841
|
+
$$type: "number",
|
|
842
|
+
value: component.id ?? component.uid
|
|
843
|
+
}
|
|
841
844
|
}
|
|
842
845
|
}
|
|
843
846
|
},
|
|
@@ -2275,7 +2278,7 @@ function updateComponentInstances(elements, uidToComponentId) {
|
|
|
2275
2278
|
}
|
|
2276
2279
|
function shouldUpdateElement(element, uidToComponentId) {
|
|
2277
2280
|
if (element.widgetType === "e-component") {
|
|
2278
|
-
const currentComponentId = element.settings?.component_instance?.value?.component_id;
|
|
2281
|
+
const currentComponentId = element.settings?.component_instance?.value?.component_id.value;
|
|
2279
2282
|
if (currentComponentId && uidToComponentId.has(currentComponentId)) {
|
|
2280
2283
|
return { shouldUpdate: true, newComponentId: uidToComponentId.get(currentComponentId) };
|
|
2281
2284
|
}
|
|
@@ -2288,7 +2291,9 @@ function updateElementComponentId(elementId, componentId) {
|
|
|
2288
2291
|
props: {
|
|
2289
2292
|
component_instance: {
|
|
2290
2293
|
$$type: "component-instance",
|
|
2291
|
-
value: {
|
|
2294
|
+
value: {
|
|
2295
|
+
component_id: { $$type: "number", value: componentId }
|
|
2296
|
+
}
|
|
2292
2297
|
}
|
|
2293
2298
|
},
|
|
2294
2299
|
withHistory: false
|