@elementor/editor-components 3.35.0-479 → 3.35.0-481
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 +93 -77
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +100 -84
- package/dist/index.mjs.map +1 -1
- package/package.json +22 -22
- package/src/api.ts +4 -2
- package/src/components/component-panel-header/component-panel-header.tsx +17 -21
- package/src/components/component-properties-panel/properties-group.tsx +10 -6
- package/src/sync/before-save.ts +24 -5
- package/src/sync/{update-components-before-save.ts → publish-draft-components-in-page-before-save.ts} +1 -1
- package/src/sync/update-archived-component-before-save.ts +3 -2
- package/src/sync/update-component-title-before-save.ts +3 -2
package/dist/index.js
CHANGED
|
@@ -40,7 +40,7 @@ var import_editor_canvas8 = require("@elementor/editor-canvas");
|
|
|
40
40
|
var import_editor_documents13 = require("@elementor/editor-documents");
|
|
41
41
|
var import_editor_editing_panel8 = require("@elementor/editor-editing-panel");
|
|
42
42
|
var import_editor_elements_panel = require("@elementor/editor-elements-panel");
|
|
43
|
-
var
|
|
43
|
+
var import_editor_panels5 = require("@elementor/editor-panels");
|
|
44
44
|
var import_editor_styles_repository2 = require("@elementor/editor-styles-repository");
|
|
45
45
|
var import_editor_v1_adapters13 = require("@elementor/editor-v1-adapters");
|
|
46
46
|
var import_store80 = require("@elementor/store");
|
|
@@ -93,16 +93,18 @@ var apiClient = {
|
|
|
93
93
|
componentId: componentId.toString()
|
|
94
94
|
}
|
|
95
95
|
}).then((res) => res.data.data),
|
|
96
|
-
updateArchivedComponents: async (componentIds) => await (0, import_http_client.httpService)().post(
|
|
96
|
+
updateArchivedComponents: async (componentIds, status) => await (0, import_http_client.httpService)().post(
|
|
97
97
|
`${BASE_URL}/archive`,
|
|
98
98
|
{
|
|
99
|
-
componentIds
|
|
99
|
+
componentIds,
|
|
100
|
+
status
|
|
100
101
|
}
|
|
101
102
|
).then((res) => res.data.data),
|
|
102
|
-
updateComponentTitle: (updatedComponentNames) => (0, import_http_client.httpService)().post(
|
|
103
|
+
updateComponentTitle: (updatedComponentNames, status) => (0, import_http_client.httpService)().post(
|
|
103
104
|
`${BASE_URL}/update-titles`,
|
|
104
105
|
{
|
|
105
|
-
components: updatedComponentNames
|
|
106
|
+
components: updatedComponentNames,
|
|
107
|
+
status
|
|
106
108
|
}
|
|
107
109
|
).then((res) => res.data.data),
|
|
108
110
|
validate: async (payload) => await (0, import_http_client.httpService)().post(`${BASE_URL}/create-validate`, payload).then((res) => res.data)
|
|
@@ -378,6 +380,8 @@ var componentOverrideTransformer = (0, import_editor_canvas3.createTransformer)(
|
|
|
378
380
|
var React10 = __toESM(require("react"));
|
|
379
381
|
var import_editor_current_user = require("@elementor/editor-current-user");
|
|
380
382
|
var import_editor_documents6 = require("@elementor/editor-documents");
|
|
383
|
+
var import_editor_panels3 = require("@elementor/editor-panels");
|
|
384
|
+
var import_editor_ui6 = require("@elementor/editor-ui");
|
|
381
385
|
var import_icons7 = require("@elementor/icons");
|
|
382
386
|
var import_store29 = require("@elementor/store");
|
|
383
387
|
var import_ui10 = require("@elementor/ui");
|
|
@@ -1669,14 +1673,18 @@ function PropertiesGroup({
|
|
|
1669
1673
|
import_ui6.Box,
|
|
1670
1674
|
{
|
|
1671
1675
|
sx: {
|
|
1672
|
-
flex: 1,
|
|
1673
1676
|
height: 28,
|
|
1674
1677
|
display: "flex",
|
|
1675
1678
|
alignItems: "center",
|
|
1676
1679
|
border: 2,
|
|
1677
1680
|
borderColor: "text.secondary",
|
|
1678
1681
|
borderRadius: 1,
|
|
1679
|
-
pl: 0.5
|
|
1682
|
+
pl: 0.5,
|
|
1683
|
+
flexGrow: 1,
|
|
1684
|
+
overflow: "hidden",
|
|
1685
|
+
textOverflow: "ellipsis",
|
|
1686
|
+
whiteSpace: "nowrap",
|
|
1687
|
+
width: "100%"
|
|
1680
1688
|
}
|
|
1681
1689
|
},
|
|
1682
1690
|
/* @__PURE__ */ React6.createElement(
|
|
@@ -1691,12 +1699,13 @@ function PropertiesGroup({
|
|
|
1691
1699
|
}
|
|
1692
1700
|
)
|
|
1693
1701
|
) : /* @__PURE__ */ React6.createElement(
|
|
1694
|
-
|
|
1702
|
+
import_editor_ui3.EllipsisWithTooltip,
|
|
1695
1703
|
{
|
|
1704
|
+
title: group.label,
|
|
1705
|
+
as: import_ui6.Typography,
|
|
1696
1706
|
variant: "caption",
|
|
1697
1707
|
sx: { color: "text.primary", fontWeight: 400, lineHeight: 1.66 }
|
|
1698
|
-
}
|
|
1699
|
-
group.label
|
|
1708
|
+
}
|
|
1700
1709
|
), /* @__PURE__ */ React6.createElement(
|
|
1701
1710
|
import_ui6.IconButton,
|
|
1702
1711
|
{
|
|
@@ -2073,24 +2082,22 @@ var ComponentPanelHeader = () => {
|
|
|
2073
2082
|
properties_count: overridablePropsCount
|
|
2074
2083
|
});
|
|
2075
2084
|
};
|
|
2076
|
-
return /* @__PURE__ */ React10.createElement(import_ui10.Box, null, /* @__PURE__ */ React10.createElement(
|
|
2077
|
-
|
|
2085
|
+
return /* @__PURE__ */ React10.createElement(import_ui10.Box, null, /* @__PURE__ */ React10.createElement(import_editor_panels3.PanelHeader, { sx: { justifyContent: "start", px: 2 } }, /* @__PURE__ */ React10.createElement(import_ui10.Tooltip, { title: (0, import_i18n13.__)("Back", "elementor") }, /* @__PURE__ */ React10.createElement(import_ui10.IconButton, { size: "tiny", onClick: onBack, "aria-label": (0, import_i18n13.__)("Back", "elementor") }, /* @__PURE__ */ React10.createElement(import_icons7.ArrowLeftIcon, { fontSize: "tiny" }))), /* @__PURE__ */ React10.createElement(import_icons7.ComponentsFilledIcon, { fontSize: "tiny", stroke: "currentColor" }), /* @__PURE__ */ React10.createElement(
|
|
2086
|
+
import_editor_ui6.EllipsisWithTooltip,
|
|
2078
2087
|
{
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
sx: {
|
|
2083
|
-
}
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
)
|
|
2093
|
-
), /* @__PURE__ */ React10.createElement(import_ui10.Divider, null), /* @__PURE__ */ React10.createElement(
|
|
2088
|
+
title: componentName,
|
|
2089
|
+
as: import_ui10.Typography,
|
|
2090
|
+
variant: "caption",
|
|
2091
|
+
sx: { fontWeight: 500, flexGrow: 1 }
|
|
2092
|
+
}
|
|
2093
|
+
), /* @__PURE__ */ React10.createElement(
|
|
2094
|
+
ComponentsBadge,
|
|
2095
|
+
{
|
|
2096
|
+
overridablePropsCount,
|
|
2097
|
+
ref: anchorRef,
|
|
2098
|
+
onClick: handleOpenPropertiesPanel
|
|
2099
|
+
}
|
|
2100
|
+
)), /* @__PURE__ */ React10.createElement(import_ui10.Divider, null), /* @__PURE__ */ React10.createElement(
|
|
2094
2101
|
ComponentIntroduction,
|
|
2095
2102
|
{
|
|
2096
2103
|
anchorRef,
|
|
@@ -2113,7 +2120,7 @@ function getComponentName() {
|
|
|
2113
2120
|
|
|
2114
2121
|
// src/components/components-tab/components.tsx
|
|
2115
2122
|
var React19 = __toESM(require("react"));
|
|
2116
|
-
var
|
|
2123
|
+
var import_editor_ui10 = require("@elementor/editor-ui");
|
|
2117
2124
|
|
|
2118
2125
|
// src/hooks/use-components.ts
|
|
2119
2126
|
var import_store31 = require("@elementor/store");
|
|
@@ -2276,7 +2283,7 @@ var React15 = __toESM(require("react"));
|
|
|
2276
2283
|
var import_react8 = require("react");
|
|
2277
2284
|
var import_editor_canvas5 = require("@elementor/editor-canvas");
|
|
2278
2285
|
var import_editor_elements8 = require("@elementor/editor-elements");
|
|
2279
|
-
var
|
|
2286
|
+
var import_editor_ui8 = require("@elementor/editor-ui");
|
|
2280
2287
|
var import_icons9 = require("@elementor/icons");
|
|
2281
2288
|
var import_ui13 = require("@elementor/ui");
|
|
2282
2289
|
var import_i18n19 = require("@wordpress/i18n");
|
|
@@ -2531,13 +2538,13 @@ var createComponentModel2 = (component) => {
|
|
|
2531
2538
|
|
|
2532
2539
|
// src/components/components-tab/delete-confirmation-dialog.tsx
|
|
2533
2540
|
var React14 = __toESM(require("react"));
|
|
2534
|
-
var
|
|
2541
|
+
var import_editor_ui7 = require("@elementor/editor-ui");
|
|
2535
2542
|
var import_i18n18 = require("@wordpress/i18n");
|
|
2536
2543
|
function DeleteConfirmationDialog({ open, onClose, onConfirm }) {
|
|
2537
|
-
return /* @__PURE__ */ React14.createElement(
|
|
2544
|
+
return /* @__PURE__ */ React14.createElement(import_editor_ui7.ConfirmationDialog, { open, onClose }, /* @__PURE__ */ React14.createElement(import_editor_ui7.ConfirmationDialog.Title, null, (0, import_i18n18.__)("Delete this component?", "elementor")), /* @__PURE__ */ React14.createElement(import_editor_ui7.ConfirmationDialog.Content, null, /* @__PURE__ */ React14.createElement(import_editor_ui7.ConfirmationDialog.ContentText, null, (0, import_i18n18.__)(
|
|
2538
2545
|
"Existing instances on your pages will remain functional. You will no longer find this component in your list.",
|
|
2539
2546
|
"elementor"
|
|
2540
|
-
))), /* @__PURE__ */ React14.createElement(
|
|
2547
|
+
))), /* @__PURE__ */ React14.createElement(import_editor_ui7.ConfirmationDialog.Actions, { onClose, onConfirm }));
|
|
2541
2548
|
}
|
|
2542
2549
|
|
|
2543
2550
|
// src/components/components-tab/components-item.tsx
|
|
@@ -2552,7 +2559,7 @@ var ComponentItem = ({ component, renameComponent: renameComponent2 }) => {
|
|
|
2552
2559
|
openEditMode,
|
|
2553
2560
|
error,
|
|
2554
2561
|
getProps: getEditableProps
|
|
2555
|
-
} = (0,
|
|
2562
|
+
} = (0, import_editor_ui8.useEditable)({
|
|
2556
2563
|
value: component.name,
|
|
2557
2564
|
onSubmit: renameComponent2,
|
|
2558
2565
|
validation: validateComponentTitle
|
|
@@ -2584,7 +2591,7 @@ var ComponentItem = ({ component, renameComponent: renameComponent2 }) => {
|
|
|
2584
2591
|
setIsDeleteDialogOpen(false);
|
|
2585
2592
|
};
|
|
2586
2593
|
return /* @__PURE__ */ React15.createElement(import_ui13.Stack, null, /* @__PURE__ */ React15.createElement(
|
|
2587
|
-
|
|
2594
|
+
import_editor_ui8.WarningInfotip,
|
|
2588
2595
|
{
|
|
2589
2596
|
open: Boolean(error),
|
|
2590
2597
|
text: error ?? "",
|
|
@@ -2623,7 +2630,7 @@ var ComponentItem = ({ component, renameComponent: renameComponent2 }) => {
|
|
|
2623
2630
|
},
|
|
2624
2631
|
/* @__PURE__ */ React15.createElement(import_ui13.ListItemIcon, { size: "tiny" }, /* @__PURE__ */ React15.createElement(import_icons9.ComponentsIcon, { fontSize: "tiny" })),
|
|
2625
2632
|
/* @__PURE__ */ React15.createElement(Indicator, { isActive: isEditing, isError: !!error }, /* @__PURE__ */ React15.createElement(import_ui13.Box, { display: "flex", flex: 1, minWidth: 0, flexGrow: 1 }, isEditing ? /* @__PURE__ */ React15.createElement(
|
|
2626
|
-
|
|
2633
|
+
import_editor_ui8.EditableField,
|
|
2627
2634
|
{
|
|
2628
2635
|
ref: editableRef,
|
|
2629
2636
|
as: import_ui13.Typography,
|
|
@@ -2631,7 +2638,7 @@ var ComponentItem = ({ component, renameComponent: renameComponent2 }) => {
|
|
|
2631
2638
|
...getEditableProps()
|
|
2632
2639
|
}
|
|
2633
2640
|
) : /* @__PURE__ */ React15.createElement(
|
|
2634
|
-
|
|
2641
|
+
import_editor_ui8.EllipsisWithTooltip,
|
|
2635
2642
|
{
|
|
2636
2643
|
title: component.name,
|
|
2637
2644
|
as: import_ui13.Typography,
|
|
@@ -2656,7 +2663,7 @@ var ComponentItem = ({ component, renameComponent: renameComponent2 }) => {
|
|
|
2656
2663
|
}
|
|
2657
2664
|
},
|
|
2658
2665
|
canRename && /* @__PURE__ */ React15.createElement(
|
|
2659
|
-
|
|
2666
|
+
import_editor_ui8.MenuListItem,
|
|
2660
2667
|
{
|
|
2661
2668
|
sx: { minWidth: "160px" },
|
|
2662
2669
|
primaryTypographyProps: { variant: "caption", color: "text.primary" },
|
|
@@ -2668,7 +2675,7 @@ var ComponentItem = ({ component, renameComponent: renameComponent2 }) => {
|
|
|
2668
2675
|
(0, import_i18n19.__)("Rename", "elementor")
|
|
2669
2676
|
),
|
|
2670
2677
|
canDelete && /* @__PURE__ */ React15.createElement(
|
|
2671
|
-
|
|
2678
|
+
import_editor_ui8.MenuListItem,
|
|
2672
2679
|
{
|
|
2673
2680
|
sx: { minWidth: "160px" },
|
|
2674
2681
|
primaryTypographyProps: { variant: "caption", color: "error.light" },
|
|
@@ -2927,11 +2934,11 @@ var useFilteredComponents = () => {
|
|
|
2927
2934
|
|
|
2928
2935
|
// src/components/components-tab/components-pro-notification.tsx
|
|
2929
2936
|
var React18 = __toESM(require("react"));
|
|
2930
|
-
var
|
|
2937
|
+
var import_editor_ui9 = require("@elementor/editor-ui");
|
|
2931
2938
|
var import_ui16 = require("@elementor/ui");
|
|
2932
2939
|
var import_i18n21 = require("@wordpress/i18n");
|
|
2933
2940
|
function ComponentsProNotification() {
|
|
2934
|
-
return /* @__PURE__ */ React18.createElement(import_ui16.Box, { sx: { px: 2 } }, /* @__PURE__ */ React18.createElement(
|
|
2941
|
+
return /* @__PURE__ */ React18.createElement(import_ui16.Box, { sx: { px: 2 } }, /* @__PURE__ */ React18.createElement(import_editor_ui9.InfoAlert, null, /* @__PURE__ */ React18.createElement(import_ui16.Typography, { variant: "caption", component: "span" }, /* @__PURE__ */ React18.createElement(import_ui16.Typography, { variant: "caption", component: "span", fontWeight: "bold" }, (0, import_i18n21.__)("Try Components for free:", "elementor")), " ", (0, import_i18n21.__)(
|
|
2935
2942
|
"Soon Components will be part of the Pro subscription, but what you create now will remain on your site.",
|
|
2936
2943
|
"elementor"
|
|
2937
2944
|
))));
|
|
@@ -2944,7 +2951,7 @@ var ComponentsContent = () => {
|
|
|
2944
2951
|
return /* @__PURE__ */ React19.createElement(React19.Fragment, null, hasComponents && /* @__PURE__ */ React19.createElement(ComponentSearch, null), hasComponents && !isProUser() && /* @__PURE__ */ React19.createElement(ComponentsProNotification, null), /* @__PURE__ */ React19.createElement(ComponentsList, null));
|
|
2945
2952
|
};
|
|
2946
2953
|
var Components = () => {
|
|
2947
|
-
return /* @__PURE__ */ React19.createElement(
|
|
2954
|
+
return /* @__PURE__ */ React19.createElement(import_editor_ui10.ThemeProvider, null, /* @__PURE__ */ React19.createElement(SearchProvider, { localStorageKey: "elementor-components-search" }, /* @__PURE__ */ React19.createElement(ComponentsContent, null)));
|
|
2948
2955
|
};
|
|
2949
2956
|
|
|
2950
2957
|
// src/components/consts.ts
|
|
@@ -2956,7 +2963,7 @@ var React20 = __toESM(require("react"));
|
|
|
2956
2963
|
var import_react11 = require("react");
|
|
2957
2964
|
var import_editor_elements10 = require("@elementor/editor-elements");
|
|
2958
2965
|
var import_editor_notifications3 = require("@elementor/editor-notifications");
|
|
2959
|
-
var
|
|
2966
|
+
var import_editor_ui11 = require("@elementor/editor-ui");
|
|
2960
2967
|
var import_icons11 = require("@elementor/icons");
|
|
2961
2968
|
var import_store47 = require("@elementor/store");
|
|
2962
2969
|
var import_ui17 = require("@elementor/ui");
|
|
@@ -3270,7 +3277,7 @@ function CreateComponentForm() {
|
|
|
3270
3277
|
...eventData.current
|
|
3271
3278
|
});
|
|
3272
3279
|
};
|
|
3273
|
-
return /* @__PURE__ */ React20.createElement(
|
|
3280
|
+
return /* @__PURE__ */ React20.createElement(import_editor_ui11.ThemeProvider, null, /* @__PURE__ */ React20.createElement(
|
|
3274
3281
|
import_ui17.Popover,
|
|
3275
3282
|
{
|
|
3276
3283
|
open: element !== null,
|
|
@@ -3320,7 +3327,7 @@ var Form2 = ({
|
|
|
3320
3327
|
create: (0, import_i18n23.__)("Create", "elementor")
|
|
3321
3328
|
};
|
|
3322
3329
|
const nameInputId = "component-name";
|
|
3323
|
-
return /* @__PURE__ */ React20.createElement(
|
|
3330
|
+
return /* @__PURE__ */ React20.createElement(import_editor_ui11.Form, { onSubmit: handleSubmit }, /* @__PURE__ */ React20.createElement(import_ui17.Stack, { alignItems: "start", width: "268px" }, /* @__PURE__ */ React20.createElement(
|
|
3324
3331
|
import_ui17.Stack,
|
|
3325
3332
|
{
|
|
3326
3333
|
direction: "row",
|
|
@@ -3644,12 +3651,12 @@ function getComponentDOMElements(id2) {
|
|
|
3644
3651
|
|
|
3645
3652
|
// src/components/in-edit-mode.tsx
|
|
3646
3653
|
var React23 = __toESM(require("react"));
|
|
3647
|
-
var
|
|
3654
|
+
var import_editor_ui12 = require("@elementor/editor-ui");
|
|
3648
3655
|
var import_icons12 = require("@elementor/icons");
|
|
3649
3656
|
var import_ui18 = require("@elementor/ui");
|
|
3650
3657
|
var import_i18n25 = require("@wordpress/i18n");
|
|
3651
3658
|
var openEditModeDialog = (lockedBy) => {
|
|
3652
|
-
(0,
|
|
3659
|
+
(0, import_editor_ui12.openDialog)({
|
|
3653
3660
|
component: /* @__PURE__ */ React23.createElement(EditModeDialog, { lockedBy })
|
|
3654
3661
|
});
|
|
3655
3662
|
};
|
|
@@ -3658,7 +3665,7 @@ var EditModeDialog = ({ lockedBy }) => {
|
|
|
3658
3665
|
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(import_ui18.DialogHeader, { logo: false }, /* @__PURE__ */ React23.createElement(import_ui18.Box, { display: "flex", alignItems: "center", gap: 1 }, /* @__PURE__ */ React23.createElement(import_ui18.Icon, { color: "secondary" }, /* @__PURE__ */ React23.createElement(import_icons12.InfoCircleFilledIcon, { fontSize: "medium" })), /* @__PURE__ */ React23.createElement(import_ui18.Typography, { variant: "subtitle1" }, content))), /* @__PURE__ */ React23.createElement(import_ui18.DialogContent, null, /* @__PURE__ */ React23.createElement(import_ui18.Stack, { spacing: 2, direction: "column" }, /* @__PURE__ */ React23.createElement(import_ui18.Typography, { variant: "body2" }, (0, import_i18n25.__)(
|
|
3659
3666
|
"You can wait for them to finish or reach out to coordinate your changes together.",
|
|
3660
3667
|
"elementor"
|
|
3661
|
-
)), /* @__PURE__ */ React23.createElement(import_ui18.DialogActions, null, /* @__PURE__ */ React23.createElement(import_ui18.Button, { color: "secondary", variant: "contained", onClick:
|
|
3668
|
+
)), /* @__PURE__ */ React23.createElement(import_ui18.DialogActions, null, /* @__PURE__ */ React23.createElement(import_ui18.Button, { color: "secondary", variant: "contained", onClick: import_editor_ui12.closeDialog }, (0, import_i18n25.__)("Close", "elementor"))))));
|
|
3662
3669
|
};
|
|
3663
3670
|
|
|
3664
3671
|
// src/components/instance-editing-panel/instance-editing-panel.tsx
|
|
@@ -3666,8 +3673,8 @@ var React29 = __toESM(require("react"));
|
|
|
3666
3673
|
var import_editor_controls4 = require("@elementor/editor-controls");
|
|
3667
3674
|
var import_editor_editing_panel5 = require("@elementor/editor-editing-panel");
|
|
3668
3675
|
var import_editor_elements15 = require("@elementor/editor-elements");
|
|
3669
|
-
var
|
|
3670
|
-
var
|
|
3676
|
+
var import_editor_panels4 = require("@elementor/editor-panels");
|
|
3677
|
+
var import_editor_ui14 = require("@elementor/editor-ui");
|
|
3671
3678
|
var import_icons14 = require("@elementor/icons");
|
|
3672
3679
|
var import_ui23 = require("@elementor/ui");
|
|
3673
3680
|
var import_i18n27 = require("@wordpress/i18n");
|
|
@@ -3716,7 +3723,7 @@ var EmptyState2 = ({ onEditComponent }) => {
|
|
|
3716
3723
|
var React28 = __toESM(require("react"));
|
|
3717
3724
|
var import_react16 = require("react");
|
|
3718
3725
|
var import_editor_editing_panel4 = require("@elementor/editor-editing-panel");
|
|
3719
|
-
var
|
|
3726
|
+
var import_editor_ui13 = require("@elementor/editor-ui");
|
|
3720
3727
|
var import_ui22 = require("@elementor/ui");
|
|
3721
3728
|
|
|
3722
3729
|
// src/components/instance-editing-panel/override-prop-control.tsx
|
|
@@ -4072,7 +4079,7 @@ function OverridePropsGroup({ group, props, overrides }) {
|
|
|
4072
4079
|
sx: { flexGrow: 0, flexShrink: 1, marginInlineEnd: 1 }
|
|
4073
4080
|
}
|
|
4074
4081
|
)),
|
|
4075
|
-
/* @__PURE__ */ React28.createElement(
|
|
4082
|
+
/* @__PURE__ */ React28.createElement(import_editor_ui13.CollapseIcon, { open: isOpen, color: "secondary", fontSize: "tiny" })
|
|
4076
4083
|
), /* @__PURE__ */ React28.createElement(import_ui22.Collapse, { id: contentId, "aria-labelledby": labelId, in: isOpen, timeout: "auto" }, /* @__PURE__ */ React28.createElement(import_ui22.Stack, { direction: "column", gap: 1, p: 2 }, group.props.map((overrideKey) => /* @__PURE__ */ React28.createElement(
|
|
4077
4084
|
OverridePropControl,
|
|
4078
4085
|
{
|
|
@@ -4100,7 +4107,7 @@ function InstanceEditingPanel() {
|
|
|
4100
4107
|
const isNonEmptyGroup = (group) => group !== null && group.props.length > 0;
|
|
4101
4108
|
const groups = overridableProps.groups.order.map((groupId) => overridableProps.groups.items[groupId] ?? null).filter(isNonEmptyGroup);
|
|
4102
4109
|
const isEmpty = groups.length === 0 || Object.keys(overridableProps.props).length === 0;
|
|
4103
|
-
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, /* @__PURE__ */ React29.createElement(
|
|
4110
|
+
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, /* @__PURE__ */ React29.createElement(import_editor_panels4.PanelHeader, { sx: { justifyContent: "start", px: 2 } }, /* @__PURE__ */ React29.createElement(import_ui23.Stack, { direction: "row", alignItems: "center", flexGrow: 1, gap: 1, maxWidth: "100%" }, /* @__PURE__ */ React29.createElement(import_icons14.ComponentsIcon, { fontSize: "small", sx: { color: "text.tertiary" } }), /* @__PURE__ */ React29.createElement(import_editor_ui14.EllipsisWithTooltip, { title: component.name, as: import_editor_panels4.PanelHeaderTitle, sx: { flexGrow: 1 } }), canEdit && /* @__PURE__ */ React29.createElement(import_ui23.Tooltip, { title: panelTitle }, /* @__PURE__ */ React29.createElement(import_ui23.IconButton, { size: "tiny", onClick: handleEditComponent, "aria-label": panelTitle }, /* @__PURE__ */ React29.createElement(import_icons14.PencilIcon, { fontSize: "tiny" }))))), /* @__PURE__ */ React29.createElement(import_editor_panels4.PanelBody, null, /* @__PURE__ */ React29.createElement(import_editor_controls4.ControlAdornmentsProvider, { items: (0, import_editor_editing_panel5.getFieldIndicators)("settings") }, isEmpty ? /* @__PURE__ */ React29.createElement(EmptyState2, { onEditComponent: handleEditComponent }) : /* @__PURE__ */ React29.createElement(import_ui23.Stack, { direction: "column", alignItems: "stretch" }, groups.map((group) => /* @__PURE__ */ React29.createElement(React29.Fragment, { key: group.id }, /* @__PURE__ */ React29.createElement(
|
|
4104
4111
|
OverridePropsGroup,
|
|
4105
4112
|
{
|
|
4106
4113
|
group,
|
|
@@ -5031,6 +5038,21 @@ function updateElementComponentId(elementId, componentId) {
|
|
|
5031
5038
|
});
|
|
5032
5039
|
}
|
|
5033
5040
|
|
|
5041
|
+
// src/sync/publish-draft-components-in-page-before-save.ts
|
|
5042
|
+
var import_editor_documents12 = require("@elementor/editor-documents");
|
|
5043
|
+
async function publishDraftComponentsInPageBeforeSave({ status, elements }) {
|
|
5044
|
+
if (status !== "publish") {
|
|
5045
|
+
return;
|
|
5046
|
+
}
|
|
5047
|
+
const documents = await getComponentDocuments(elements);
|
|
5048
|
+
const draftIds = [...documents.values()].filter(import_editor_documents12.isDocumentDirty).map((document) => document.id);
|
|
5049
|
+
if (draftIds.length === 0) {
|
|
5050
|
+
return;
|
|
5051
|
+
}
|
|
5052
|
+
await apiClient.updateStatuses(draftIds, "publish");
|
|
5053
|
+
draftIds.forEach((id2) => invalidateComponentDocumentData(id2));
|
|
5054
|
+
}
|
|
5055
|
+
|
|
5034
5056
|
// src/sync/set-component-overridable-props-settings-before-save.ts
|
|
5035
5057
|
var import_store72 = require("@elementor/store");
|
|
5036
5058
|
var setComponentOverridablePropsSettingsBeforeSave = ({
|
|
@@ -5054,13 +5076,13 @@ var failedNotification = (message) => ({
|
|
|
5054
5076
|
message: `Failed to archive components: ${message}`,
|
|
5055
5077
|
id: "failed-archived-components-notification"
|
|
5056
5078
|
});
|
|
5057
|
-
var updateArchivedComponentBeforeSave = async () => {
|
|
5079
|
+
var updateArchivedComponentBeforeSave = async (status) => {
|
|
5058
5080
|
try {
|
|
5059
5081
|
const archivedComponents = selectArchivedThisSession((0, import_store74.__getState)());
|
|
5060
5082
|
if (!archivedComponents.length) {
|
|
5061
5083
|
return;
|
|
5062
5084
|
}
|
|
5063
|
-
const result = await apiClient.updateArchivedComponents(archivedComponents);
|
|
5085
|
+
const result = await apiClient.updateArchivedComponents(archivedComponents, status);
|
|
5064
5086
|
const failedIds = result.failedIds.join(", ");
|
|
5065
5087
|
if (failedIds) {
|
|
5066
5088
|
(0, import_editor_notifications5.notify)(failedNotification(failedIds));
|
|
@@ -5072,43 +5094,37 @@ var updateArchivedComponentBeforeSave = async () => {
|
|
|
5072
5094
|
|
|
5073
5095
|
// src/sync/update-component-title-before-save.ts
|
|
5074
5096
|
var import_store76 = require("@elementor/store");
|
|
5075
|
-
var updateComponentTitleBeforeSave = async () => {
|
|
5097
|
+
var updateComponentTitleBeforeSave = async (status) => {
|
|
5076
5098
|
const updatedComponentNames = selectUpdatedComponentNames((0, import_store76.__getState)());
|
|
5077
5099
|
if (!updatedComponentNames.length) {
|
|
5078
5100
|
return;
|
|
5079
5101
|
}
|
|
5080
|
-
const result = await apiClient.updateComponentTitle(updatedComponentNames);
|
|
5102
|
+
const result = await apiClient.updateComponentTitle(updatedComponentNames, status);
|
|
5081
5103
|
if (result.failedIds.length === 0) {
|
|
5082
5104
|
(0, import_store76.__dispatch)(slice.actions.cleanUpdatedComponentNames());
|
|
5083
5105
|
}
|
|
5084
5106
|
};
|
|
5085
5107
|
|
|
5086
|
-
// src/sync/update-components-before-save.ts
|
|
5087
|
-
var import_editor_documents12 = require("@elementor/editor-documents");
|
|
5088
|
-
async function updateComponentsBeforeSave({ status, elements }) {
|
|
5089
|
-
if (status !== "publish") {
|
|
5090
|
-
return;
|
|
5091
|
-
}
|
|
5092
|
-
const documents = await getComponentDocuments(elements);
|
|
5093
|
-
const draftIds = [...documents.values()].filter(import_editor_documents12.isDocumentDirty).map((document) => document.id);
|
|
5094
|
-
if (draftIds.length === 0) {
|
|
5095
|
-
return;
|
|
5096
|
-
}
|
|
5097
|
-
await apiClient.updateStatuses(draftIds, "publish");
|
|
5098
|
-
draftIds.forEach((id2) => invalidateComponentDocumentData(id2));
|
|
5099
|
-
}
|
|
5100
|
-
|
|
5101
5108
|
// src/sync/before-save.ts
|
|
5102
5109
|
var beforeSave = ({ container, status }) => {
|
|
5103
5110
|
const elements = container?.model.get("elements").toJSON?.() ?? [];
|
|
5104
5111
|
return Promise.all([
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
updateComponentsBeforeSave({ elements, status }),
|
|
5108
|
-
setComponentOverridablePropsSettingsBeforeSave({ container }),
|
|
5109
|
-
updateComponentTitleBeforeSave()
|
|
5112
|
+
syncComponents({ elements, status }),
|
|
5113
|
+
setComponentOverridablePropsSettingsBeforeSave({ container })
|
|
5110
5114
|
]);
|
|
5111
5115
|
};
|
|
5116
|
+
var syncComponents = async ({ elements, status }) => {
|
|
5117
|
+
await updateExistingComponentsBeforeSave({ elements, status });
|
|
5118
|
+
await createComponentsBeforeSave({ elements, status });
|
|
5119
|
+
};
|
|
5120
|
+
var updateExistingComponentsBeforeSave = async ({
|
|
5121
|
+
elements,
|
|
5122
|
+
status
|
|
5123
|
+
}) => {
|
|
5124
|
+
await updateComponentTitleBeforeSave(status);
|
|
5125
|
+
await updateArchivedComponentBeforeSave(status);
|
|
5126
|
+
await publishDraftComponentsInPageBeforeSave({ elements, status });
|
|
5127
|
+
};
|
|
5112
5128
|
|
|
5113
5129
|
// src/sync/cleanup-overridable-props-on-delete.ts
|
|
5114
5130
|
var import_editor_elements20 = require("@elementor/editor-elements");
|
|
@@ -5335,7 +5351,7 @@ function hasOverrides(settings) {
|
|
|
5335
5351
|
function init() {
|
|
5336
5352
|
import_editor_styles_repository2.stylesRepository.register(componentsStylesProvider);
|
|
5337
5353
|
(0, import_store80.__registerSlice)(slice);
|
|
5338
|
-
(0,
|
|
5354
|
+
(0, import_editor_panels5.__registerPanel)(panel);
|
|
5339
5355
|
(0, import_editor_canvas8.registerElementType)(
|
|
5340
5356
|
COMPONENT_WIDGET_TYPE,
|
|
5341
5357
|
(options) => createComponentType({ ...options, showLockedByModal: openEditModeDialog })
|