@elementor/editor-components 3.35.0-430 → 3.35.0-432
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 +160 -98
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +160 -98
- package/dist/index.mjs.map +1 -1
- package/package.json +22 -22
- package/src/components/component-properties-panel/properties-group.tsx +1 -0
- package/src/components/component-properties-panel/property-item.tsx +3 -0
- package/src/components/overridable-props/overridable-prop-form.tsx +35 -4
- package/src/components/overridable-props/overridable-prop-indicator.tsx +1 -0
- package/src/components/overridable-props/utils/validate-prop-label.ts +38 -0
package/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var import_editor_panels4 = require("@elementor/editor-panels");
|
|
|
44
44
|
var import_editor_styles_repository2 = require("@elementor/editor-styles-repository");
|
|
45
45
|
var import_editor_v1_adapters10 = require("@elementor/editor-v1-adapters");
|
|
46
46
|
var import_store78 = require("@elementor/store");
|
|
47
|
-
var
|
|
47
|
+
var import_i18n30 = require("@wordpress/i18n");
|
|
48
48
|
|
|
49
49
|
// src/component-instance-transformer.ts
|
|
50
50
|
var import_editor_canvas = require("@elementor/editor-canvas");
|
|
@@ -379,7 +379,7 @@ var import_editor_documents5 = require("@elementor/editor-documents");
|
|
|
379
379
|
var import_icons7 = require("@elementor/icons");
|
|
380
380
|
var import_store25 = require("@elementor/store");
|
|
381
381
|
var import_ui10 = require("@elementor/ui");
|
|
382
|
-
var
|
|
382
|
+
var import_i18n12 = require("@wordpress/i18n");
|
|
383
383
|
|
|
384
384
|
// src/hooks/use-navigate-back.ts
|
|
385
385
|
var import_react = require("react");
|
|
@@ -463,7 +463,7 @@ var import_editor_elements4 = require("@elementor/editor-elements");
|
|
|
463
463
|
var import_editor_panels2 = require("@elementor/editor-panels");
|
|
464
464
|
var import_editor_ui5 = require("@elementor/editor-ui");
|
|
465
465
|
var import_ui8 = require("@elementor/ui");
|
|
466
|
-
var
|
|
466
|
+
var import_i18n10 = require("@wordpress/i18n");
|
|
467
467
|
|
|
468
468
|
// src/components/component-properties-panel/component-properties-panel-content.tsx
|
|
469
469
|
var React7 = __toESM(require("react"));
|
|
@@ -473,7 +473,7 @@ var import_editor_panels = require("@elementor/editor-panels");
|
|
|
473
473
|
var import_icons5 = require("@elementor/icons");
|
|
474
474
|
var import_ui7 = require("@elementor/ui");
|
|
475
475
|
var import_utils2 = require("@elementor/utils");
|
|
476
|
-
var
|
|
476
|
+
var import_i18n9 = require("@wordpress/i18n");
|
|
477
477
|
|
|
478
478
|
// src/store/actions/add-overridable-group.ts
|
|
479
479
|
var import_store7 = require("@elementor/store");
|
|
@@ -926,7 +926,7 @@ var React6 = __toESM(require("react"));
|
|
|
926
926
|
var import_editor_ui3 = require("@elementor/editor-ui");
|
|
927
927
|
var import_icons4 = require("@elementor/icons");
|
|
928
928
|
var import_ui6 = require("@elementor/ui");
|
|
929
|
-
var
|
|
929
|
+
var import_i18n6 = require("@wordpress/i18n");
|
|
930
930
|
|
|
931
931
|
// src/components/component-properties-panel/property-item.tsx
|
|
932
932
|
var React5 = __toESM(require("react"));
|
|
@@ -939,18 +939,55 @@ var React3 = __toESM(require("react"));
|
|
|
939
939
|
var import_react3 = require("react");
|
|
940
940
|
var import_editor_ui2 = require("@elementor/editor-ui");
|
|
941
941
|
var import_ui3 = require("@elementor/ui");
|
|
942
|
+
var import_i18n5 = require("@wordpress/i18n");
|
|
943
|
+
|
|
944
|
+
// src/components/overridable-props/utils/validate-prop-label.ts
|
|
942
945
|
var import_i18n4 = require("@wordpress/i18n");
|
|
946
|
+
var ERROR_MESSAGES = {
|
|
947
|
+
EMPTY_NAME: (0, import_i18n4.__)("Property name is required", "elementor"),
|
|
948
|
+
DUPLICATE_NAME: (0, import_i18n4.__)("Property name already exists", "elementor")
|
|
949
|
+
};
|
|
950
|
+
function validatePropLabel(label, existingLabels, currentLabel) {
|
|
951
|
+
const trimmedLabel = label.trim();
|
|
952
|
+
if (!trimmedLabel) {
|
|
953
|
+
return { isValid: false, errorMessage: ERROR_MESSAGES.EMPTY_NAME };
|
|
954
|
+
}
|
|
955
|
+
const normalizedLabel = trimmedLabel.toLowerCase();
|
|
956
|
+
const normalizedCurrentLabel = currentLabel?.trim().toLowerCase();
|
|
957
|
+
const isDuplicate = existingLabels.some((existingLabel) => {
|
|
958
|
+
const normalizedExisting = existingLabel.trim().toLowerCase();
|
|
959
|
+
if (normalizedCurrentLabel && normalizedExisting === normalizedCurrentLabel) {
|
|
960
|
+
return false;
|
|
961
|
+
}
|
|
962
|
+
return normalizedExisting === normalizedLabel;
|
|
963
|
+
});
|
|
964
|
+
if (isDuplicate) {
|
|
965
|
+
return { isValid: false, errorMessage: ERROR_MESSAGES.DUPLICATE_NAME };
|
|
966
|
+
}
|
|
967
|
+
return { isValid: true, errorMessage: null };
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
// src/components/overridable-props/overridable-prop-form.tsx
|
|
943
971
|
var SIZE = "tiny";
|
|
944
|
-
var DEFAULT_GROUP = { value: null, label: (0,
|
|
945
|
-
function OverridablePropForm({ onSubmit, groups, currentValue, sx }) {
|
|
972
|
+
var DEFAULT_GROUP = { value: null, label: (0, import_i18n5.__)("Default", "elementor") };
|
|
973
|
+
function OverridablePropForm({ onSubmit, groups, currentValue, existingLabels = [], sx }) {
|
|
946
974
|
const [propLabel, setPropLabel] = (0, import_react3.useState)(currentValue?.label ?? null);
|
|
947
975
|
const [group, setGroup] = (0, import_react3.useState)(currentValue?.groupId ?? groups?.[0]?.value ?? null);
|
|
948
|
-
const
|
|
949
|
-
const
|
|
976
|
+
const [error, setError] = (0, import_react3.useState)(null);
|
|
977
|
+
const name = (0, import_i18n5.__)("Name", "elementor");
|
|
978
|
+
const groupName = (0, import_i18n5.__)("Group Name", "elementor");
|
|
950
979
|
const isCreate = currentValue === void 0;
|
|
951
|
-
const title = isCreate ? (0,
|
|
952
|
-
const ctaLabel = isCreate ? (0,
|
|
953
|
-
|
|
980
|
+
const title = isCreate ? (0, import_i18n5.__)("Create new property", "elementor") : (0, import_i18n5.__)("Update property", "elementor");
|
|
981
|
+
const ctaLabel = isCreate ? (0, import_i18n5.__)("Create", "elementor") : (0, import_i18n5.__)("Update", "elementor");
|
|
982
|
+
const handleSubmit = () => {
|
|
983
|
+
const validationResult = validatePropLabel(propLabel ?? "", existingLabels, currentValue?.label);
|
|
984
|
+
if (!validationResult.isValid) {
|
|
985
|
+
setError(validationResult.errorMessage);
|
|
986
|
+
return;
|
|
987
|
+
}
|
|
988
|
+
onSubmit({ label: propLabel ?? "", group });
|
|
989
|
+
};
|
|
990
|
+
return /* @__PURE__ */ React3.createElement(import_editor_ui2.Form, { onSubmit: handleSubmit }, /* @__PURE__ */ React3.createElement(import_ui3.Stack, { alignItems: "start", sx: { width: "268px", ...sx } }, /* @__PURE__ */ React3.createElement(
|
|
954
991
|
import_ui3.Stack,
|
|
955
992
|
{
|
|
956
993
|
direction: "row",
|
|
@@ -966,9 +1003,20 @@ function OverridablePropForm({ onSubmit, groups, currentValue, sx }) {
|
|
|
966
1003
|
name,
|
|
967
1004
|
size: SIZE,
|
|
968
1005
|
fullWidth: true,
|
|
969
|
-
placeholder: (0,
|
|
1006
|
+
placeholder: (0, import_i18n5.__)("Enter value", "elementor"),
|
|
970
1007
|
value: propLabel ?? "",
|
|
971
|
-
onChange: (e) =>
|
|
1008
|
+
onChange: (e) => {
|
|
1009
|
+
const newValue = e.target.value;
|
|
1010
|
+
setPropLabel(newValue);
|
|
1011
|
+
const validationResult = validatePropLabel(
|
|
1012
|
+
newValue,
|
|
1013
|
+
existingLabels,
|
|
1014
|
+
currentValue?.label
|
|
1015
|
+
);
|
|
1016
|
+
setError(validationResult.errorMessage);
|
|
1017
|
+
},
|
|
1018
|
+
error: Boolean(error),
|
|
1019
|
+
helperText: error
|
|
972
1020
|
}
|
|
973
1021
|
))), /* @__PURE__ */ React3.createElement(import_ui3.Grid, { container: true, gap: 0.75, alignItems: "start", px: 1.5, mb: 1.5 }, /* @__PURE__ */ React3.createElement(import_ui3.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React3.createElement(import_ui3.FormLabel, { size: "tiny" }, groupName)), /* @__PURE__ */ React3.createElement(import_ui3.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React3.createElement(
|
|
974
1022
|
import_ui3.Select,
|
|
@@ -988,7 +1036,17 @@ function OverridablePropForm({ onSubmit, groups, currentValue, sx }) {
|
|
|
988
1036
|
}
|
|
989
1037
|
},
|
|
990
1038
|
(groups ?? [DEFAULT_GROUP]).map(({ label: groupLabel, ...props }) => /* @__PURE__ */ React3.createElement(import_editor_ui2.MenuListItem, { key: props.value, ...props, value: props.value ?? "" }, groupLabel))
|
|
991
|
-
))), /* @__PURE__ */ React3.createElement(import_ui3.Stack, { direction: "row", justifyContent: "flex-end", alignSelf: "end", mt: 1.5, py: 1, px: 1.5 }, /* @__PURE__ */ React3.createElement(
|
|
1039
|
+
))), /* @__PURE__ */ React3.createElement(import_ui3.Stack, { direction: "row", justifyContent: "flex-end", alignSelf: "end", mt: 1.5, py: 1, px: 1.5 }, /* @__PURE__ */ React3.createElement(
|
|
1040
|
+
import_ui3.Button,
|
|
1041
|
+
{
|
|
1042
|
+
type: "submit",
|
|
1043
|
+
disabled: !propLabel || Boolean(error),
|
|
1044
|
+
variant: "contained",
|
|
1045
|
+
color: "primary",
|
|
1046
|
+
size: "small"
|
|
1047
|
+
},
|
|
1048
|
+
ctaLabel
|
|
1049
|
+
))));
|
|
992
1050
|
}
|
|
993
1051
|
|
|
994
1052
|
// src/components/component-properties-panel/sortable.tsx
|
|
@@ -1061,6 +1119,7 @@ function PropertyItem({
|
|
|
1061
1119
|
sortableTriggerProps,
|
|
1062
1120
|
isDragPlaceholder,
|
|
1063
1121
|
groups,
|
|
1122
|
+
existingLabels,
|
|
1064
1123
|
onDelete,
|
|
1065
1124
|
onUpdate
|
|
1066
1125
|
}) {
|
|
@@ -1136,6 +1195,7 @@ function PropertyItem({
|
|
|
1136
1195
|
onSubmit: handleSubmit,
|
|
1137
1196
|
currentValue: prop,
|
|
1138
1197
|
groups,
|
|
1198
|
+
existingLabels,
|
|
1139
1199
|
sx: { width: "100%" }
|
|
1140
1200
|
}
|
|
1141
1201
|
)
|
|
@@ -1246,7 +1306,7 @@ function PropertiesGroup({
|
|
|
1246
1306
|
className: "group-menu",
|
|
1247
1307
|
size: "tiny",
|
|
1248
1308
|
sx: { p: 0.25, visibility: isThisGroupEditing ? "visible" : void 0 },
|
|
1249
|
-
"aria-label": (0,
|
|
1309
|
+
"aria-label": (0, import_i18n6.__)("Group actions", "elementor"),
|
|
1250
1310
|
...(0, import_ui6.bindTrigger)(popupState)
|
|
1251
1311
|
},
|
|
1252
1312
|
/* @__PURE__ */ React6.createElement(import_icons4.DotsVerticalIcon, { fontSize: "tiny" })
|
|
@@ -1258,6 +1318,7 @@ function PropertiesGroup({
|
|
|
1258
1318
|
sortableTriggerProps: { ...triggerProps, style: triggerStyle },
|
|
1259
1319
|
isDragPlaceholder: isItemDragPlaceholder,
|
|
1260
1320
|
groups: allGroups,
|
|
1321
|
+
existingLabels: Object.values(props).map((p) => p.label),
|
|
1261
1322
|
onDelete: onPropertyDelete,
|
|
1262
1323
|
onUpdate: (data) => onPropertyUpdate(prop.overrideKey, data)
|
|
1263
1324
|
}
|
|
@@ -1269,11 +1330,11 @@ function PropertiesGroup({
|
|
|
1269
1330
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
1270
1331
|
transformOrigin: { vertical: "top", horizontal: "right" }
|
|
1271
1332
|
},
|
|
1272
|
-
/* @__PURE__ */ React6.createElement(import_editor_ui3.MenuListItem, { sx: { minWidth: "160px" }, onClick: handleRenameClick }, /* @__PURE__ */ React6.createElement(import_ui6.Typography, { variant: "caption", sx: { color: "text.primary" } }, (0,
|
|
1333
|
+
/* @__PURE__ */ React6.createElement(import_editor_ui3.MenuListItem, { sx: { minWidth: "160px" }, onClick: handleRenameClick }, /* @__PURE__ */ React6.createElement(import_ui6.Typography, { variant: "caption", sx: { color: "text.primary" } }, (0, import_i18n6.__)("Rename", "elementor"))),
|
|
1273
1334
|
/* @__PURE__ */ React6.createElement(
|
|
1274
1335
|
import_ui6.Tooltip,
|
|
1275
1336
|
{
|
|
1276
|
-
title: hasProperties ? (0,
|
|
1337
|
+
title: hasProperties ? (0, import_i18n6.__)("To delete the group, first remove all the properties", "elementor") : "",
|
|
1277
1338
|
placement: "right"
|
|
1278
1339
|
},
|
|
1279
1340
|
/* @__PURE__ */ React6.createElement("span", null, /* @__PURE__ */ React6.createElement(import_editor_ui3.MenuListItem, { onClick: handleDeleteClick, disabled: hasProperties }, /* @__PURE__ */ React6.createElement(
|
|
@@ -1282,7 +1343,7 @@ function PropertiesGroup({
|
|
|
1282
1343
|
variant: "caption",
|
|
1283
1344
|
sx: { color: hasProperties ? "text.disabled" : "error.light" }
|
|
1284
1345
|
},
|
|
1285
|
-
(0,
|
|
1346
|
+
(0, import_i18n6.__)("Delete", "elementor")
|
|
1286
1347
|
)))
|
|
1287
1348
|
)
|
|
1288
1349
|
)
|
|
@@ -1293,7 +1354,7 @@ function PropertiesGroup({
|
|
|
1293
1354
|
var import_react4 = require("react");
|
|
1294
1355
|
var import_editor_documents3 = require("@elementor/editor-documents");
|
|
1295
1356
|
var import_editor_ui4 = require("@elementor/editor-ui");
|
|
1296
|
-
var
|
|
1357
|
+
var import_i18n8 = require("@wordpress/i18n");
|
|
1297
1358
|
|
|
1298
1359
|
// src/store/actions/rename-overridable-group.ts
|
|
1299
1360
|
var import_store21 = require("@elementor/store");
|
|
@@ -1320,19 +1381,19 @@ function renameOverridableGroup({ componentId, groupId, label }) {
|
|
|
1320
1381
|
}
|
|
1321
1382
|
|
|
1322
1383
|
// src/components/component-properties-panel/utils/validate-group-label.ts
|
|
1323
|
-
var
|
|
1324
|
-
var
|
|
1325
|
-
EMPTY_NAME: (0,
|
|
1326
|
-
DUPLICATE_NAME: (0,
|
|
1384
|
+
var import_i18n7 = require("@wordpress/i18n");
|
|
1385
|
+
var ERROR_MESSAGES2 = {
|
|
1386
|
+
EMPTY_NAME: (0, import_i18n7.__)("Group name is required", "elementor"),
|
|
1387
|
+
DUPLICATE_NAME: (0, import_i18n7.__)("Group name already exists", "elementor")
|
|
1327
1388
|
};
|
|
1328
1389
|
function validateGroupLabel(label, existingGroups) {
|
|
1329
1390
|
const trimmedLabel = label.trim();
|
|
1330
1391
|
if (!trimmedLabel) {
|
|
1331
|
-
return
|
|
1392
|
+
return ERROR_MESSAGES2.EMPTY_NAME;
|
|
1332
1393
|
}
|
|
1333
1394
|
const isDuplicate = Object.values(existingGroups).some((group) => group.label === trimmedLabel);
|
|
1334
1395
|
if (isDuplicate) {
|
|
1335
|
-
return
|
|
1396
|
+
return ERROR_MESSAGES2.DUPLICATE_NAME;
|
|
1336
1397
|
}
|
|
1337
1398
|
return "";
|
|
1338
1399
|
}
|
|
@@ -1352,7 +1413,7 @@ function useCurrentEditableItem() {
|
|
|
1352
1413
|
};
|
|
1353
1414
|
const handleSubmit = (newLabel) => {
|
|
1354
1415
|
if (!editingGroupId || !currentComponentId) {
|
|
1355
|
-
throw new Error((0,
|
|
1416
|
+
throw new Error((0, import_i18n8.__)("Group ID or component ID is missing", "elementor"));
|
|
1356
1417
|
}
|
|
1357
1418
|
renameOverridableGroup({
|
|
1358
1419
|
componentId: currentComponentId,
|
|
@@ -1460,20 +1521,20 @@ function ComponentPropertiesPanelContent({ onClose }) {
|
|
|
1460
1521
|
deleteOverridableGroup({ componentId: currentComponentId, groupId });
|
|
1461
1522
|
(0, import_editor_documents4.setDocumentModifiedStatus)(true);
|
|
1462
1523
|
};
|
|
1463
|
-
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,
|
|
1524
|
+
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_i18n9.__)("Component properties", "elementor"))), !showEmptyState && /* @__PURE__ */ React7.createElement(import_ui7.Tooltip, { title: (0, import_i18n9.__)("Add new group", "elementor") }, /* @__PURE__ */ React7.createElement(
|
|
1464
1525
|
import_ui7.IconButton,
|
|
1465
1526
|
{
|
|
1466
1527
|
size: "tiny",
|
|
1467
|
-
"aria-label": (0,
|
|
1528
|
+
"aria-label": (0, import_i18n9.__)("Add new group", "elementor"),
|
|
1468
1529
|
onClick: handleAddGroupClick
|
|
1469
1530
|
},
|
|
1470
1531
|
/* @__PURE__ */ React7.createElement(import_icons5.FolderPlusIcon, { fontSize: "tiny" })
|
|
1471
|
-
)), /* @__PURE__ */ React7.createElement(import_ui7.Tooltip, { title: (0,
|
|
1532
|
+
)), /* @__PURE__ */ React7.createElement(import_ui7.Tooltip, { title: (0, import_i18n9.__)("Close panel", "elementor") }, /* @__PURE__ */ React7.createElement(
|
|
1472
1533
|
import_ui7.IconButton,
|
|
1473
1534
|
{
|
|
1474
1535
|
ref: introductionRef,
|
|
1475
1536
|
size: "tiny",
|
|
1476
|
-
"aria-label": (0,
|
|
1537
|
+
"aria-label": (0, import_i18n9.__)("Close panel", "elementor"),
|
|
1477
1538
|
onClick: onClose
|
|
1478
1539
|
},
|
|
1479
1540
|
/* @__PURE__ */ React7.createElement(import_icons5.XIcon, { fontSize: "tiny" })
|
|
@@ -1519,14 +1580,14 @@ function ComponentPropertiesPanel() {
|
|
|
1519
1580
|
}
|
|
1520
1581
|
)))));
|
|
1521
1582
|
}
|
|
1522
|
-
var ErrorBoundaryFallback = () => /* @__PURE__ */ React8.createElement(import_ui8.Box, { role: "alert", sx: { minHeight: "100%", p: 2 } }, /* @__PURE__ */ React8.createElement(import_ui8.Alert, { severity: "error", sx: { mb: 2, maxWidth: 400, textAlign: "center" } }, /* @__PURE__ */ React8.createElement("strong", null, (0,
|
|
1583
|
+
var ErrorBoundaryFallback = () => /* @__PURE__ */ React8.createElement(import_ui8.Box, { role: "alert", sx: { minHeight: "100%", p: 2 } }, /* @__PURE__ */ React8.createElement(import_ui8.Alert, { severity: "error", sx: { mb: 2, maxWidth: 400, textAlign: "center" } }, /* @__PURE__ */ React8.createElement("strong", null, (0, import_i18n10.__)("Something went wrong", "elementor"))));
|
|
1523
1584
|
|
|
1524
1585
|
// src/components/component-panel-header/component-badge.tsx
|
|
1525
1586
|
var React9 = __toESM(require("react"));
|
|
1526
1587
|
var import_react6 = require("react");
|
|
1527
1588
|
var import_icons6 = require("@elementor/icons");
|
|
1528
1589
|
var import_ui9 = require("@elementor/ui");
|
|
1529
|
-
var
|
|
1590
|
+
var import_i18n11 = require("@wordpress/i18n");
|
|
1530
1591
|
var ComponentsBadge = React9.forwardRef(
|
|
1531
1592
|
({ overridesCount, onClick }, ref) => {
|
|
1532
1593
|
const prevCount = usePrevious(overridesCount);
|
|
@@ -1548,7 +1609,7 @@ var ComponentsBadge = React9.forwardRef(
|
|
|
1548
1609
|
value: "overrides",
|
|
1549
1610
|
size: "tiny",
|
|
1550
1611
|
onClick,
|
|
1551
|
-
"aria-label": (0,
|
|
1612
|
+
"aria-label": (0, import_i18n11.__)("View overrides", "elementor")
|
|
1552
1613
|
},
|
|
1553
1614
|
/* @__PURE__ */ React9.createElement(import_icons6.ComponentPropListIcon, { fontSize: "tiny" })
|
|
1554
1615
|
)
|
|
@@ -1611,7 +1672,7 @@ var ComponentPanelHeader = () => {
|
|
|
1611
1672
|
justifyContent: "space-between",
|
|
1612
1673
|
sx: { height: 48, pl: 1.5, pr: 2, py: 1 }
|
|
1613
1674
|
},
|
|
1614
|
-
/* @__PURE__ */ React10.createElement(import_ui10.Stack, { direction: "row", alignItems: "center" }, /* @__PURE__ */ React10.createElement(import_ui10.Tooltip, { title: (0,
|
|
1675
|
+
/* @__PURE__ */ React10.createElement(import_ui10.Stack, { direction: "row", alignItems: "center" }, /* @__PURE__ */ React10.createElement(import_ui10.Tooltip, { title: (0, import_i18n12.__)("Back", "elementor") }, /* @__PURE__ */ React10.createElement(import_ui10.IconButton, { size: "tiny", onClick: onBack, "aria-label": (0, import_i18n12.__)("Back", "elementor") }, /* @__PURE__ */ React10.createElement(import_icons7.ArrowLeftIcon, { fontSize: "tiny" }))), /* @__PURE__ */ React10.createElement(import_ui10.Stack, { direction: "row", alignItems: "center", gap: 0.5 }, /* @__PURE__ */ React10.createElement(import_icons7.ComponentsFilledIcon, { fontSize: "tiny", stroke: "currentColor" }), /* @__PURE__ */ React10.createElement(import_ui10.Typography, { variant: "caption", sx: { fontWeight: 500 } }, componentName))),
|
|
1615
1676
|
/* @__PURE__ */ React10.createElement(ComponentsBadge, { overridesCount, ref: anchorRef, onClick: openPropertiesPanel })
|
|
1616
1677
|
), /* @__PURE__ */ React10.createElement(import_ui10.Divider, null), /* @__PURE__ */ React10.createElement(
|
|
1617
1678
|
ComponentIntroduction,
|
|
@@ -1650,7 +1711,7 @@ var useComponents = () => {
|
|
|
1650
1711
|
var React12 = __toESM(require("react"));
|
|
1651
1712
|
var import_icons8 = require("@elementor/icons");
|
|
1652
1713
|
var import_ui11 = require("@elementor/ui");
|
|
1653
|
-
var
|
|
1714
|
+
var import_i18n13 = require("@wordpress/i18n");
|
|
1654
1715
|
|
|
1655
1716
|
// src/components/components-tab/search-provider.tsx
|
|
1656
1717
|
var React11 = __toESM(require("react"));
|
|
@@ -1685,7 +1746,7 @@ var ComponentSearch = () => {
|
|
|
1685
1746
|
fullWidth: true,
|
|
1686
1747
|
size: "tiny",
|
|
1687
1748
|
value: inputValue,
|
|
1688
|
-
placeholder: (0,
|
|
1749
|
+
placeholder: (0, import_i18n13.__)("Search", "elementor"),
|
|
1689
1750
|
onChange: (e) => handleChange(e.target.value),
|
|
1690
1751
|
InputProps: {
|
|
1691
1752
|
startAdornment: /* @__PURE__ */ React12.createElement(import_ui11.InputAdornment, { position: "start" }, /* @__PURE__ */ React12.createElement(import_icons8.SearchIcon, { fontSize: "tiny" }))
|
|
@@ -1700,7 +1761,7 @@ var import_react9 = require("react");
|
|
|
1700
1761
|
var import_editor_mcp = require("@elementor/editor-mcp");
|
|
1701
1762
|
var import_icons10 = require("@elementor/icons");
|
|
1702
1763
|
var import_ui15 = require("@elementor/ui");
|
|
1703
|
-
var
|
|
1764
|
+
var import_i18n20 = require("@wordpress/i18n");
|
|
1704
1765
|
|
|
1705
1766
|
// src/store/actions/rename-component.ts
|
|
1706
1767
|
var import_editor_documents7 = require("@elementor/editor-documents");
|
|
@@ -1711,7 +1772,7 @@ var import_store33 = require("@elementor/store");
|
|
|
1711
1772
|
var import_editor_canvas4 = require("@elementor/editor-canvas");
|
|
1712
1773
|
var import_editor_documents6 = require("@elementor/editor-documents");
|
|
1713
1774
|
var import_store31 = require("@elementor/store");
|
|
1714
|
-
var
|
|
1775
|
+
var import_i18n14 = require("@wordpress/i18n");
|
|
1715
1776
|
|
|
1716
1777
|
// src/utils/tracking.ts
|
|
1717
1778
|
var import_mixpanel = require("@elementor/mixpanel");
|
|
@@ -1864,7 +1925,7 @@ function createComponentView(options) {
|
|
|
1864
1925
|
action: {
|
|
1865
1926
|
name: "edit component",
|
|
1866
1927
|
icon: "eicon-edit",
|
|
1867
|
-
title: () => (0,
|
|
1928
|
+
title: () => (0, import_i18n14.__)("Edit Component", "elementor"),
|
|
1868
1929
|
isEnabled: () => true,
|
|
1869
1930
|
callback: (_, eventData) => this.editComponent(eventData)
|
|
1870
1931
|
}
|
|
@@ -2014,7 +2075,7 @@ function findComponentInstancesByUid(documentContainer, componentUid) {
|
|
|
2014
2075
|
// src/components/components-tab/angie-promotion-modal.tsx
|
|
2015
2076
|
var React13 = __toESM(require("react"));
|
|
2016
2077
|
var import_ui12 = require("@elementor/ui");
|
|
2017
|
-
var
|
|
2078
|
+
var import_i18n15 = require("@wordpress/i18n");
|
|
2018
2079
|
var ANGIE_INSTALL_URL = "/wp-admin/plugin-install.php?tab=plugin-information&plugin=angie";
|
|
2019
2080
|
var PLACEHOLDER_IMAGE_URL = "https://assets.elementor.com/packages/v1/images/components-angie-promo.svg";
|
|
2020
2081
|
var AngiePromotionModal = ({ children, open, onClose }) => {
|
|
@@ -2028,7 +2089,7 @@ function AngiePromotionCard({ onClose }) {
|
|
|
2028
2089
|
return /* @__PURE__ */ React13.createElement(import_ui12.ClickAwayListener, { disableReactTree: true, mouseEvent: "onMouseDown", touchEvent: "onTouchStart", onClickAway: onClose }, /* @__PURE__ */ React13.createElement(import_ui12.Card, { elevation: 0, sx: { maxWidth: 296 } }, /* @__PURE__ */ React13.createElement(
|
|
2029
2090
|
import_ui12.CardHeader,
|
|
2030
2091
|
{
|
|
2031
|
-
title: (0,
|
|
2092
|
+
title: (0, import_i18n15.__)("Add new component with AI", "elementor"),
|
|
2032
2093
|
titleTypographyProps: { variant: "subtitle2" },
|
|
2033
2094
|
action: /* @__PURE__ */ React13.createElement(import_ui12.CloseButton, { slotProps: { icon: { fontSize: "tiny" } }, onClick: onClose })
|
|
2034
2095
|
}
|
|
@@ -2040,10 +2101,10 @@ function AngiePromotionCard({ onClose }) {
|
|
|
2040
2101
|
alt: "",
|
|
2041
2102
|
sx: { width: "100%", aspectRatio: "16 / 9" }
|
|
2042
2103
|
}
|
|
2043
|
-
), /* @__PURE__ */ React13.createElement(import_ui12.CardContent, null, /* @__PURE__ */ React13.createElement(import_ui12.Typography, { variant: "body2", color: "text.secondary" }, (0,
|
|
2104
|
+
), /* @__PURE__ */ React13.createElement(import_ui12.CardContent, null, /* @__PURE__ */ React13.createElement(import_ui12.Typography, { variant: "body2", color: "text.secondary" }, (0, import_i18n15.__)(
|
|
2044
2105
|
"Angie our AI assistant can easily create new components and save you the hassle of doing it yourself",
|
|
2045
2106
|
"elementor"
|
|
2046
|
-
))), /* @__PURE__ */ React13.createElement(import_ui12.CardActions, { sx: { justifyContent: "flex-end" } }, /* @__PURE__ */ React13.createElement(import_ui12.Button, { size: "medium", variant: "contained", color: "accent", onClick: handleCtaClick }, (0,
|
|
2107
|
+
))), /* @__PURE__ */ React13.createElement(import_ui12.CardActions, { sx: { justifyContent: "flex-end" } }, /* @__PURE__ */ React13.createElement(import_ui12.Button, { size: "medium", variant: "contained", color: "accent", onClick: handleCtaClick }, (0, import_i18n15.__)("Get Angie", "elementor")))));
|
|
2047
2108
|
}
|
|
2048
2109
|
|
|
2049
2110
|
// src/components/components-tab/components-item.tsx
|
|
@@ -2054,17 +2115,17 @@ var import_editor_elements8 = require("@elementor/editor-elements");
|
|
|
2054
2115
|
var import_editor_ui7 = require("@elementor/editor-ui");
|
|
2055
2116
|
var import_icons9 = require("@elementor/icons");
|
|
2056
2117
|
var import_ui13 = require("@elementor/ui");
|
|
2057
|
-
var
|
|
2118
|
+
var import_i18n19 = require("@wordpress/i18n");
|
|
2058
2119
|
|
|
2059
2120
|
// src/store/actions/archive-component.ts
|
|
2060
2121
|
var import_editor_documents8 = require("@elementor/editor-documents");
|
|
2061
2122
|
var import_editor_notifications = require("@elementor/editor-notifications");
|
|
2062
2123
|
var import_store35 = require("@elementor/store");
|
|
2063
|
-
var
|
|
2124
|
+
var import_i18n16 = require("@wordpress/i18n");
|
|
2064
2125
|
var successNotification = (componentId, componentName) => ({
|
|
2065
2126
|
type: "success",
|
|
2066
2127
|
/* translators: %s: component name */
|
|
2067
|
-
message: (0,
|
|
2128
|
+
message: (0, import_i18n16.__)("Successfully deleted component %s", "elementor").replace("%s", componentName),
|
|
2068
2129
|
id: `success-archived-components-notification-${componentId}`
|
|
2069
2130
|
});
|
|
2070
2131
|
var archiveComponent = (componentId, componentName) => {
|
|
@@ -2186,14 +2247,14 @@ var import_store41 = require("@elementor/store");
|
|
|
2186
2247
|
|
|
2187
2248
|
// src/components/create-component-form/utils/component-form-schema.ts
|
|
2188
2249
|
var import_schema = require("@elementor/schema");
|
|
2189
|
-
var
|
|
2250
|
+
var import_i18n17 = require("@wordpress/i18n");
|
|
2190
2251
|
var MIN_NAME_LENGTH = 2;
|
|
2191
2252
|
var MAX_NAME_LENGTH = 50;
|
|
2192
|
-
var baseComponentSchema = import_schema.z.string().trim().max(MAX_NAME_LENGTH, (0,
|
|
2253
|
+
var baseComponentSchema = import_schema.z.string().trim().max(MAX_NAME_LENGTH, (0, import_i18n17.__)("Component name is too long. Please keep it under 50 characters.", "elementor"));
|
|
2193
2254
|
var createBaseComponentSchema = (existingNames) => {
|
|
2194
2255
|
return import_schema.z.object({
|
|
2195
2256
|
componentName: baseComponentSchema.refine((value) => !existingNames.includes(value), {
|
|
2196
|
-
message: (0,
|
|
2257
|
+
message: (0, import_i18n17.__)("Component name already exists", "elementor")
|
|
2197
2258
|
})
|
|
2198
2259
|
});
|
|
2199
2260
|
};
|
|
@@ -2201,9 +2262,9 @@ var createSubmitComponentSchema = (existingNames) => {
|
|
|
2201
2262
|
const baseSchema = createBaseComponentSchema(existingNames);
|
|
2202
2263
|
return baseSchema.extend({
|
|
2203
2264
|
componentName: baseSchema.shape.componentName.refine((value) => value.length > 0, {
|
|
2204
|
-
message: (0,
|
|
2265
|
+
message: (0, import_i18n17.__)("Component name is required.", "elementor")
|
|
2205
2266
|
}).refine((value) => value.length >= MIN_NAME_LENGTH, {
|
|
2206
|
-
message: (0,
|
|
2267
|
+
message: (0, import_i18n17.__)("Component name is too short. Please enter at least 2 characters.", "elementor")
|
|
2207
2268
|
})
|
|
2208
2269
|
});
|
|
2209
2270
|
};
|
|
@@ -2297,9 +2358,9 @@ var createComponentModel2 = (component) => {
|
|
|
2297
2358
|
// src/components/components-tab/delete-confirmation-dialog.tsx
|
|
2298
2359
|
var React14 = __toESM(require("react"));
|
|
2299
2360
|
var import_editor_ui6 = require("@elementor/editor-ui");
|
|
2300
|
-
var
|
|
2361
|
+
var import_i18n18 = require("@wordpress/i18n");
|
|
2301
2362
|
function DeleteConfirmationDialog({ open, onClose, onConfirm }) {
|
|
2302
|
-
return /* @__PURE__ */ React14.createElement(import_editor_ui6.ConfirmationDialog, { open, onClose }, /* @__PURE__ */ React14.createElement(import_editor_ui6.ConfirmationDialog.Title, null, (0,
|
|
2363
|
+
return /* @__PURE__ */ React14.createElement(import_editor_ui6.ConfirmationDialog, { open, onClose }, /* @__PURE__ */ React14.createElement(import_editor_ui6.ConfirmationDialog.Title, null, (0, import_i18n18.__)("Delete this component?", "elementor")), /* @__PURE__ */ React14.createElement(import_editor_ui6.ConfirmationDialog.Content, null, /* @__PURE__ */ React14.createElement(import_editor_ui6.ConfirmationDialog.ContentText, null, (0, import_i18n18.__)(
|
|
2303
2364
|
"Existing instances on your pages will remain functional. You will no longer find this component in your list.",
|
|
2304
2365
|
"elementor"
|
|
2305
2366
|
))), /* @__PURE__ */ React14.createElement(import_editor_ui6.ConfirmationDialog.Actions, { onClose, onConfirm }));
|
|
@@ -2427,9 +2488,9 @@ var ComponentItem = ({ component, renameComponent: renameComponent2 }) => {
|
|
|
2427
2488
|
openEditMode();
|
|
2428
2489
|
}
|
|
2429
2490
|
},
|
|
2430
|
-
(0,
|
|
2491
|
+
(0, import_i18n19.__)("Rename", "elementor")
|
|
2431
2492
|
),
|
|
2432
|
-
/* @__PURE__ */ React15.createElement(import_editor_ui7.MenuListItem, { sx: { minWidth: "160px" }, onClick: handleDeleteClick }, /* @__PURE__ */ React15.createElement(import_ui13.Typography, { variant: "caption", sx: { color: "error.light" } }, (0,
|
|
2493
|
+
/* @__PURE__ */ React15.createElement(import_editor_ui7.MenuListItem, { sx: { minWidth: "160px" }, onClick: handleDeleteClick }, /* @__PURE__ */ React15.createElement(import_ui13.Typography, { variant: "caption", sx: { color: "error.light" } }, (0, import_i18n19.__)("Delete", "elementor")))
|
|
2433
2494
|
), /* @__PURE__ */ React15.createElement(
|
|
2434
2495
|
DeleteConfirmationDialog,
|
|
2435
2496
|
{
|
|
@@ -2555,7 +2616,7 @@ var EmptyState = () => {
|
|
|
2555
2616
|
const sdk = (0, import_editor_mcp.getAngieSdk)();
|
|
2556
2617
|
if (sdk.isAngieReady()) {
|
|
2557
2618
|
sdk.triggerAngie({
|
|
2558
|
-
prompt: (0,
|
|
2619
|
+
prompt: (0, import_i18n20.__)(
|
|
2559
2620
|
"Create a [hero/testimonial/product card/CTA/feature] component for my [business type]. Include [describe what you want]",
|
|
2560
2621
|
"elementor"
|
|
2561
2622
|
),
|
|
@@ -2575,7 +2636,7 @@ var EmptyState = () => {
|
|
|
2575
2636
|
gap: 2,
|
|
2576
2637
|
overflow: "hidden"
|
|
2577
2638
|
},
|
|
2578
|
-
/* @__PURE__ */ React17.createElement(import_ui15.Stack, { alignItems: "center", gap: 1 }, /* @__PURE__ */ React17.createElement(import_icons10.ComponentsIcon, { fontSize: "large", sx: { color: "text.secondary" } }), /* @__PURE__ */ React17.createElement(import_ui15.Typography, { align: "center", variant: "subtitle2", color: "text.secondary", sx: SUBTITLE_OVERRIDE_SX }, (0,
|
|
2639
|
+
/* @__PURE__ */ React17.createElement(import_ui15.Stack, { alignItems: "center", gap: 1 }, /* @__PURE__ */ React17.createElement(import_icons10.ComponentsIcon, { fontSize: "large", sx: { color: "text.secondary" } }), /* @__PURE__ */ React17.createElement(import_ui15.Typography, { align: "center", variant: "subtitle2", color: "text.secondary", sx: SUBTITLE_OVERRIDE_SX }, (0, import_i18n20.__)("No components yet", "elementor")), /* @__PURE__ */ React17.createElement(import_ui15.Typography, { align: "center", variant: "caption", color: "secondary", sx: { maxWidth: 200 } }, (0, import_i18n20.__)("Components are reusable blocks that sync across your site.", "elementor"), /* @__PURE__ */ React17.createElement("br", null), (0, import_i18n20.__)("Create once, use everywhere.", "elementor")), /* @__PURE__ */ React17.createElement(
|
|
2579
2640
|
import_ui15.Link,
|
|
2580
2641
|
{
|
|
2581
2642
|
href: LEARN_MORE_URL,
|
|
@@ -2584,13 +2645,13 @@ var EmptyState = () => {
|
|
|
2584
2645
|
variant: "caption",
|
|
2585
2646
|
color: "info.main"
|
|
2586
2647
|
},
|
|
2587
|
-
(0,
|
|
2648
|
+
(0, import_i18n20.__)("Learn more about components", "elementor")
|
|
2588
2649
|
)),
|
|
2589
2650
|
/* @__PURE__ */ React17.createElement(import_ui15.Divider, { sx: { width: "100%" } }),
|
|
2590
|
-
/* @__PURE__ */ React17.createElement(import_ui15.Stack, { alignItems: "center", gap: 1, width: "100%" }, /* @__PURE__ */ React17.createElement(import_ui15.Typography, { align: "center", variant: "subtitle2", color: "text.secondary", sx: SUBTITLE_OVERRIDE_SX }, (0,
|
|
2651
|
+
/* @__PURE__ */ React17.createElement(import_ui15.Stack, { alignItems: "center", gap: 1, width: "100%" }, /* @__PURE__ */ React17.createElement(import_ui15.Typography, { align: "center", variant: "subtitle2", color: "text.secondary", sx: SUBTITLE_OVERRIDE_SX }, (0, import_i18n20.__)("Create your first one:", "elementor")), /* @__PURE__ */ React17.createElement(import_ui15.Typography, { align: "center", variant: "caption", color: "secondary", sx: { maxWidth: 228 } }, (0, import_i18n20.__)(
|
|
2591
2652
|
'Right-click any div-block or flexbox on your canvas or structure and select "Create component"',
|
|
2592
2653
|
"elementor"
|
|
2593
|
-
)), /* @__PURE__ */ React17.createElement(import_ui15.Typography, { align: "center", variant: "caption", color: "secondary" }, (0,
|
|
2654
|
+
)), /* @__PURE__ */ React17.createElement(import_ui15.Typography, { align: "center", variant: "caption", color: "secondary" }, (0, import_i18n20.__)("Or", "elementor")), /* @__PURE__ */ React17.createElement(AngiePromotionModal, { open: isAngieModalOpen, onClose: () => setIsAngieModalOpen(false) }, /* @__PURE__ */ React17.createElement(
|
|
2594
2655
|
import_ui15.Button,
|
|
2595
2656
|
{
|
|
2596
2657
|
color: "secondary",
|
|
@@ -2599,7 +2660,7 @@ var EmptyState = () => {
|
|
|
2599
2660
|
onClick: handleCreateWithAI,
|
|
2600
2661
|
endIcon: /* @__PURE__ */ React17.createElement(import_icons10.AIIcon, null)
|
|
2601
2662
|
},
|
|
2602
|
-
(0,
|
|
2663
|
+
(0, import_i18n20.__)("Create component with AI", "elementor")
|
|
2603
2664
|
)))
|
|
2604
2665
|
);
|
|
2605
2666
|
};
|
|
@@ -2623,7 +2684,7 @@ var EmptySearchResult = () => {
|
|
|
2623
2684
|
width: "100%"
|
|
2624
2685
|
}
|
|
2625
2686
|
},
|
|
2626
|
-
/* @__PURE__ */ React17.createElement(import_ui15.Typography, { align: "center", variant: "subtitle2", color: "inherit", sx: SUBTITLE_OVERRIDE_SX }, (0,
|
|
2687
|
+
/* @__PURE__ */ React17.createElement(import_ui15.Typography, { align: "center", variant: "subtitle2", color: "inherit", sx: SUBTITLE_OVERRIDE_SX }, (0, import_i18n20.__)("Sorry, nothing matched", "elementor")),
|
|
2627
2688
|
searchValue && /* @__PURE__ */ React17.createElement(
|
|
2628
2689
|
import_ui15.Typography,
|
|
2629
2690
|
{
|
|
@@ -2651,8 +2712,8 @@ var EmptySearchResult = () => {
|
|
|
2651
2712
|
/* @__PURE__ */ React17.createElement("span", null, "\u201D.")
|
|
2652
2713
|
)
|
|
2653
2714
|
),
|
|
2654
|
-
/* @__PURE__ */ React17.createElement(import_ui15.Typography, { align: "center", variant: "caption", color: "inherit" }, (0,
|
|
2655
|
-
/* @__PURE__ */ React17.createElement(import_ui15.Typography, { align: "center", variant: "caption", color: "inherit" }, /* @__PURE__ */ React17.createElement(import_ui15.Link, { color: "secondary", variant: "caption", component: "button", onClick: clearSearch }, (0,
|
|
2715
|
+
/* @__PURE__ */ React17.createElement(import_ui15.Typography, { align: "center", variant: "caption", color: "inherit" }, (0, import_i18n20.__)("Try something else.", "elementor")),
|
|
2716
|
+
/* @__PURE__ */ React17.createElement(import_ui15.Typography, { align: "center", variant: "caption", color: "inherit" }, /* @__PURE__ */ React17.createElement(import_ui15.Link, { color: "secondary", variant: "caption", component: "button", onClick: clearSearch }, (0, import_i18n20.__)("Clear & try again", "elementor")))
|
|
2656
2717
|
);
|
|
2657
2718
|
};
|
|
2658
2719
|
var useFilteredComponents = () => {
|
|
@@ -2689,7 +2750,7 @@ var import_editor_ui9 = require("@elementor/editor-ui");
|
|
|
2689
2750
|
var import_icons11 = require("@elementor/icons");
|
|
2690
2751
|
var import_store47 = require("@elementor/store");
|
|
2691
2752
|
var import_ui16 = require("@elementor/ui");
|
|
2692
|
-
var
|
|
2753
|
+
var import_i18n22 = require("@wordpress/i18n");
|
|
2693
2754
|
|
|
2694
2755
|
// src/prevent-non-atomic-nesting.ts
|
|
2695
2756
|
var import_editor_canvas6 = require("@elementor/editor-canvas");
|
|
@@ -2697,10 +2758,10 @@ var import_editor_elements9 = require("@elementor/editor-elements");
|
|
|
2697
2758
|
var import_editor_notifications2 = require("@elementor/editor-notifications");
|
|
2698
2759
|
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
2699
2760
|
var import_store43 = require("@elementor/store");
|
|
2700
|
-
var
|
|
2761
|
+
var import_i18n21 = require("@wordpress/i18n");
|
|
2701
2762
|
var NON_ATOMIC_ELEMENT_ALERT = {
|
|
2702
2763
|
type: "default",
|
|
2703
|
-
message: (0,
|
|
2764
|
+
message: (0, import_i18n21.__)("This widget isn't compatible with components. Use atomic elements instead.", "elementor"),
|
|
2704
2765
|
id: "non-atomic-element-blocked"
|
|
2705
2766
|
};
|
|
2706
2767
|
function initNonAtomicNestingPrevention() {
|
|
@@ -2920,7 +2981,7 @@ function CreateComponentForm() {
|
|
|
2920
2981
|
if (nonAtomicElements.length > 0) {
|
|
2921
2982
|
(0, import_editor_notifications3.notify)({
|
|
2922
2983
|
type: "default",
|
|
2923
|
-
message: (0,
|
|
2984
|
+
message: (0, import_i18n22.__)(
|
|
2924
2985
|
"Components require atomic elements only. Remove widgets to create this component.",
|
|
2925
2986
|
"elementor"
|
|
2926
2987
|
),
|
|
@@ -2959,12 +3020,12 @@ function CreateComponentForm() {
|
|
|
2959
3020
|
}
|
|
2960
3021
|
(0, import_editor_notifications3.notify)({
|
|
2961
3022
|
type: "success",
|
|
2962
|
-
message: (0,
|
|
3023
|
+
message: (0, import_i18n22.__)("Component created successfully.", "elementor"),
|
|
2963
3024
|
id: `component-saved-successfully-${uid}`
|
|
2964
3025
|
});
|
|
2965
3026
|
resetAndClosePopup();
|
|
2966
3027
|
} catch {
|
|
2967
|
-
const errorMessage = (0,
|
|
3028
|
+
const errorMessage = (0, import_i18n22.__)("Failed to create component. Please try again.", "elementor");
|
|
2968
3029
|
(0, import_editor_notifications3.notify)({
|
|
2969
3030
|
type: "error",
|
|
2970
3031
|
message: errorMessage,
|
|
@@ -3027,10 +3088,10 @@ var Form2 = ({
|
|
|
3027
3088
|
}
|
|
3028
3089
|
};
|
|
3029
3090
|
const texts = {
|
|
3030
|
-
heading: (0,
|
|
3031
|
-
name: (0,
|
|
3032
|
-
cancel: (0,
|
|
3033
|
-
create: (0,
|
|
3091
|
+
heading: (0, import_i18n22.__)("Create component", "elementor"),
|
|
3092
|
+
name: (0, import_i18n22.__)("Name", "elementor"),
|
|
3093
|
+
cancel: (0, import_i18n22.__)("Cancel", "elementor"),
|
|
3094
|
+
create: (0, import_i18n22.__)("Create", "elementor")
|
|
3034
3095
|
};
|
|
3035
3096
|
const nameInputId = "component-name";
|
|
3036
3097
|
return /* @__PURE__ */ React19.createElement(import_editor_ui9.Form, { onSubmit: handleSubmit }, /* @__PURE__ */ React19.createElement(import_ui16.Stack, { alignItems: "start", width: "268px" }, /* @__PURE__ */ React19.createElement(
|
|
@@ -3086,7 +3147,7 @@ function updateCurrentComponent({
|
|
|
3086
3147
|
var React20 = __toESM(require("react"));
|
|
3087
3148
|
var import_react13 = require("react");
|
|
3088
3149
|
var import_react_dom = require("react-dom");
|
|
3089
|
-
var
|
|
3150
|
+
var import_i18n23 = require("@wordpress/i18n");
|
|
3090
3151
|
|
|
3091
3152
|
// src/hooks/use-canvas-document.ts
|
|
3092
3153
|
var import_editor_canvas7 = require("@elementor/editor-canvas");
|
|
@@ -3208,7 +3269,7 @@ function Backdrop({ canvas, element, onClose }) {
|
|
|
3208
3269
|
onKeyDown: handleKeyDown,
|
|
3209
3270
|
role: "button",
|
|
3210
3271
|
tabIndex: 0,
|
|
3211
|
-
"aria-label": (0,
|
|
3272
|
+
"aria-label": (0, import_i18n23.__)("Exit component editing mode", "elementor")
|
|
3212
3273
|
}
|
|
3213
3274
|
);
|
|
3214
3275
|
}
|
|
@@ -3339,18 +3400,18 @@ var React22 = __toESM(require("react"));
|
|
|
3339
3400
|
var import_editor_ui10 = require("@elementor/editor-ui");
|
|
3340
3401
|
var import_icons12 = require("@elementor/icons");
|
|
3341
3402
|
var import_ui17 = require("@elementor/ui");
|
|
3342
|
-
var
|
|
3403
|
+
var import_i18n24 = require("@wordpress/i18n");
|
|
3343
3404
|
var openEditModeDialog = (lockedBy) => {
|
|
3344
3405
|
(0, import_editor_ui10.openDialog)({
|
|
3345
3406
|
component: /* @__PURE__ */ React22.createElement(EditModeDialog, { lockedBy })
|
|
3346
3407
|
});
|
|
3347
3408
|
};
|
|
3348
3409
|
var EditModeDialog = ({ lockedBy }) => {
|
|
3349
|
-
const content = (0,
|
|
3350
|
-
return /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement(import_ui17.DialogHeader, { logo: false }, /* @__PURE__ */ React22.createElement(import_ui17.Box, { display: "flex", alignItems: "center", gap: 1 }, /* @__PURE__ */ React22.createElement(import_ui17.Icon, { color: "secondary" }, /* @__PURE__ */ React22.createElement(import_icons12.InfoCircleFilledIcon, { fontSize: "medium" })), /* @__PURE__ */ React22.createElement(import_ui17.Typography, { variant: "subtitle1" }, content))), /* @__PURE__ */ React22.createElement(import_ui17.DialogContent, null, /* @__PURE__ */ React22.createElement(import_ui17.Stack, { spacing: 2, direction: "column" }, /* @__PURE__ */ React22.createElement(import_ui17.Typography, { variant: "body2" }, (0,
|
|
3410
|
+
const content = (0, import_i18n24.__)("%s is currently editing this document", "elementor").replace("%s", lockedBy);
|
|
3411
|
+
return /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement(import_ui17.DialogHeader, { logo: false }, /* @__PURE__ */ React22.createElement(import_ui17.Box, { display: "flex", alignItems: "center", gap: 1 }, /* @__PURE__ */ React22.createElement(import_ui17.Icon, { color: "secondary" }, /* @__PURE__ */ React22.createElement(import_icons12.InfoCircleFilledIcon, { fontSize: "medium" })), /* @__PURE__ */ React22.createElement(import_ui17.Typography, { variant: "subtitle1" }, content))), /* @__PURE__ */ React22.createElement(import_ui17.DialogContent, null, /* @__PURE__ */ React22.createElement(import_ui17.Stack, { spacing: 2, direction: "column" }, /* @__PURE__ */ React22.createElement(import_ui17.Typography, { variant: "body2" }, (0, import_i18n24.__)(
|
|
3351
3412
|
"You can wait for them to finish or reach out to coordinate your changes together.",
|
|
3352
3413
|
"elementor"
|
|
3353
|
-
)), /* @__PURE__ */ React22.createElement(import_ui17.DialogActions, null, /* @__PURE__ */ React22.createElement(import_ui17.Button, { color: "secondary", variant: "contained", onClick: import_editor_ui10.closeDialog }, (0,
|
|
3414
|
+
)), /* @__PURE__ */ React22.createElement(import_ui17.DialogActions, null, /* @__PURE__ */ React22.createElement(import_ui17.Button, { color: "secondary", variant: "contained", onClick: import_editor_ui10.closeDialog }, (0, import_i18n24.__)("Close", "elementor"))))));
|
|
3354
3415
|
};
|
|
3355
3416
|
|
|
3356
3417
|
// src/components/instance-editing-panel/instance-editing-panel.tsx
|
|
@@ -3361,7 +3422,7 @@ var import_editor_elements14 = require("@elementor/editor-elements");
|
|
|
3361
3422
|
var import_editor_panels3 = require("@elementor/editor-panels");
|
|
3362
3423
|
var import_icons14 = require("@elementor/icons");
|
|
3363
3424
|
var import_ui22 = require("@elementor/ui");
|
|
3364
|
-
var
|
|
3425
|
+
var import_i18n26 = require("@wordpress/i18n");
|
|
3365
3426
|
|
|
3366
3427
|
// src/hooks/use-component-instance-settings.ts
|
|
3367
3428
|
var import_editor_editing_panel2 = require("@elementor/editor-editing-panel");
|
|
@@ -3430,7 +3491,7 @@ function useComponentInstanceSettings() {
|
|
|
3430
3491
|
var React23 = __toESM(require("react"));
|
|
3431
3492
|
var import_icons13 = require("@elementor/icons");
|
|
3432
3493
|
var import_ui18 = require("@elementor/ui");
|
|
3433
|
-
var
|
|
3494
|
+
var import_i18n25 = require("@wordpress/i18n");
|
|
3434
3495
|
var EmptyState2 = ({ onEditComponent }) => {
|
|
3435
3496
|
return /* @__PURE__ */ React23.createElement(
|
|
3436
3497
|
import_ui18.Stack,
|
|
@@ -3443,12 +3504,12 @@ var EmptyState2 = ({ onEditComponent }) => {
|
|
|
3443
3504
|
gap: 1.5
|
|
3444
3505
|
},
|
|
3445
3506
|
/* @__PURE__ */ React23.createElement(import_icons13.ComponentPropListIcon, { fontSize: "large" }),
|
|
3446
|
-
/* @__PURE__ */ React23.createElement(import_ui18.Typography, { align: "center", variant: "subtitle2" }, (0,
|
|
3447
|
-
/* @__PURE__ */ React23.createElement(import_ui18.Typography, { align: "center", variant: "caption", maxWidth: "170px" }, (0,
|
|
3507
|
+
/* @__PURE__ */ React23.createElement(import_ui18.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n25.__)("No properties yet", "elementor")),
|
|
3508
|
+
/* @__PURE__ */ React23.createElement(import_ui18.Typography, { align: "center", variant: "caption", maxWidth: "170px" }, (0, import_i18n25.__)(
|
|
3448
3509
|
"Edit the component to add properties, manage them or update the design across all instances.",
|
|
3449
3510
|
"elementor"
|
|
3450
3511
|
)),
|
|
3451
|
-
/* @__PURE__ */ React23.createElement(import_ui18.Button, { variant: "outlined", color: "secondary", size: "small", sx: { mt: 1 }, onClick: onEditComponent }, /* @__PURE__ */ React23.createElement(import_icons13.PencilIcon, { fontSize: "small" }), (0,
|
|
3512
|
+
/* @__PURE__ */ React23.createElement(import_ui18.Button, { variant: "outlined", color: "secondary", size: "small", sx: { mt: 1 }, onClick: onEditComponent }, /* @__PURE__ */ React23.createElement(import_icons13.PencilIcon, { fontSize: "small" }), (0, import_i18n25.__)("Edit component", "elementor"))
|
|
3452
3513
|
);
|
|
3453
3514
|
};
|
|
3454
3515
|
|
|
@@ -3722,7 +3783,7 @@ function InstanceEditingPanel() {
|
|
|
3722
3783
|
if (!componentId || !overridableProps || !component) {
|
|
3723
3784
|
return null;
|
|
3724
3785
|
}
|
|
3725
|
-
const panelTitle = (0,
|
|
3786
|
+
const panelTitle = (0, import_i18n26.__)("Edit %s", "elementor").replace("%s", component.name);
|
|
3726
3787
|
const handleEditComponent = () => switchToComponent(componentId, componentInstanceId);
|
|
3727
3788
|
const isNonEmptyGroup = (group) => group !== null && group.props.length > 0;
|
|
3728
3789
|
const groups = overridableProps.groups.order.map((groupId) => overridableProps.groups.items[groupId] ?? null).filter(isNonEmptyGroup);
|
|
@@ -3808,7 +3869,7 @@ var import_editor_controls6 = require("@elementor/editor-controls");
|
|
|
3808
3869
|
var import_editor_editing_panel7 = require("@elementor/editor-editing-panel");
|
|
3809
3870
|
var import_editor_elements15 = require("@elementor/editor-elements");
|
|
3810
3871
|
var import_ui24 = require("@elementor/ui");
|
|
3811
|
-
var
|
|
3872
|
+
var import_i18n28 = require("@wordpress/i18n");
|
|
3812
3873
|
|
|
3813
3874
|
// src/store/actions/set-overridable-prop.ts
|
|
3814
3875
|
var import_store58 = require("@elementor/store");
|
|
@@ -3879,7 +3940,7 @@ var React30 = __toESM(require("react"));
|
|
|
3879
3940
|
var import_react17 = require("react");
|
|
3880
3941
|
var import_icons15 = require("@elementor/icons");
|
|
3881
3942
|
var import_ui23 = require("@elementor/ui");
|
|
3882
|
-
var
|
|
3943
|
+
var import_i18n27 = require("@wordpress/i18n");
|
|
3883
3944
|
var SIZE2 = "tiny";
|
|
3884
3945
|
var IconContainer = (0, import_ui23.styled)(import_ui23.Box)`
|
|
3885
3946
|
pointer-events: none;
|
|
@@ -3939,7 +4000,7 @@ var Indicator2 = (0, import_react17.forwardRef)(({ isOpen, isOverridable, ...pro
|
|
|
3939
4000
|
IconContainer,
|
|
3940
4001
|
{
|
|
3941
4002
|
className: "icon",
|
|
3942
|
-
"aria-label": isOverridable ? (0,
|
|
4003
|
+
"aria-label": isOverridable ? (0, import_i18n27.__)("Overridable property", "elementor") : (0, import_i18n27.__)("Make prop overridable", "elementor")
|
|
3943
4004
|
},
|
|
3944
4005
|
isOverridable ? /* @__PURE__ */ React30.createElement(import_icons15.CheckIcon, { fontSize: SIZE2 }) : /* @__PURE__ */ React30.createElement(import_icons15.PlusIcon, { fontSize: SIZE2 })
|
|
3945
4006
|
)));
|
|
@@ -4010,7 +4071,7 @@ function Content2({ componentId, overridableProps }) {
|
|
|
4010
4071
|
popupState.close();
|
|
4011
4072
|
};
|
|
4012
4073
|
const overridableConfig = overridableValue ? getOverridableProp({ componentId, overrideKey: overridableValue.override_key }) : void 0;
|
|
4013
|
-
return /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(import_ui24.Tooltip, { placement: "top", title: (0,
|
|
4074
|
+
return /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(import_ui24.Tooltip, { placement: "top", title: (0, import_i18n28.__)("Override Property", "elementor") }, /* @__PURE__ */ React31.createElement(Indicator2, { ...triggerProps, isOpen: !!popoverProps.open, isOverridable: !!overridableValue })), /* @__PURE__ */ React31.createElement(
|
|
4014
4075
|
import_ui24.Popover,
|
|
4015
4076
|
{
|
|
4016
4077
|
disableScrollLock: true,
|
|
@@ -4035,6 +4096,7 @@ function Content2({ componentId, overridableProps }) {
|
|
|
4035
4096
|
value: groupId,
|
|
4036
4097
|
label: overridableProps.groups.items[groupId].label
|
|
4037
4098
|
})),
|
|
4099
|
+
existingLabels: Object.values(overridableProps?.props ?? {}).map((prop) => prop.label),
|
|
4038
4100
|
currentValue: overridableConfig
|
|
4039
4101
|
}
|
|
4040
4102
|
)
|
|
@@ -4158,7 +4220,7 @@ var OutputSchema = {
|
|
|
4158
4220
|
message: import_schema6.z.string().optional().describe("Additional information about the operation result"),
|
|
4159
4221
|
component_uid: import_schema6.z.string().optional().describe("The unique identifier of the newly created component (only present on success)")
|
|
4160
4222
|
};
|
|
4161
|
-
var
|
|
4223
|
+
var ERROR_MESSAGES3 = {
|
|
4162
4224
|
ELEMENT_NOT_FOUND: "Element not found. Use 'list-elements' to get valid element IDs.",
|
|
4163
4225
|
ELEMENT_NOT_ONE_OF_TYPES: (validTypes) => `Element is not one of the following types: ${validTypes.join(", ")}`,
|
|
4164
4226
|
ELEMENT_IS_LOCKED: "Cannot save a locked element as a component."
|
|
@@ -4168,15 +4230,15 @@ var handleSaveAsComponent = async (params) => {
|
|
|
4168
4230
|
const validElementTypes = getValidElementTypes();
|
|
4169
4231
|
const container = (0, import_editor_elements17.getContainer)(elementId);
|
|
4170
4232
|
if (!container) {
|
|
4171
|
-
throw new Error(
|
|
4233
|
+
throw new Error(ERROR_MESSAGES3.ELEMENT_NOT_FOUND);
|
|
4172
4234
|
}
|
|
4173
4235
|
const elType = container.model.get("elType");
|
|
4174
4236
|
if (!validElementTypes.includes(elType)) {
|
|
4175
|
-
throw new Error(
|
|
4237
|
+
throw new Error(ERROR_MESSAGES3.ELEMENT_NOT_ONE_OF_TYPES(validElementTypes));
|
|
4176
4238
|
}
|
|
4177
4239
|
const element = container.model.toJSON({ remove: ["default"] });
|
|
4178
4240
|
if (element?.isLocked) {
|
|
4179
|
-
throw new Error(
|
|
4241
|
+
throw new Error(ERROR_MESSAGES3.ELEMENT_IS_LOCKED);
|
|
4180
4242
|
}
|
|
4181
4243
|
const overridableProps = overridablePropsInput ? enrichOverridableProps(overridablePropsInput, element) : void 0;
|
|
4182
4244
|
if (overridableProps) {
|
|
@@ -4473,11 +4535,11 @@ var import_editor_elements18 = require("@elementor/editor-elements");
|
|
|
4473
4535
|
var import_editor_notifications4 = require("@elementor/editor-notifications");
|
|
4474
4536
|
var import_editor_v1_adapters9 = require("@elementor/editor-v1-adapters");
|
|
4475
4537
|
var import_store64 = require("@elementor/store");
|
|
4476
|
-
var
|
|
4538
|
+
var import_i18n29 = require("@wordpress/i18n");
|
|
4477
4539
|
var COMPONENT_TYPE = "e-component";
|
|
4478
4540
|
var COMPONENT_CIRCULAR_NESTING_ALERT = {
|
|
4479
4541
|
type: "default",
|
|
4480
|
-
message: (0,
|
|
4542
|
+
message: (0, import_i18n29.__)("Can't add this component - components that contain each other can't be nested.", "elementor"),
|
|
4481
4543
|
id: "circular-component-nesting-blocked"
|
|
4482
4544
|
};
|
|
4483
4545
|
function initCircularNestingPrevention() {
|
|
@@ -4809,7 +4871,7 @@ function init() {
|
|
|
4809
4871
|
window.elementorCommon.__beforeSave = beforeSave;
|
|
4810
4872
|
(0, import_editor_elements_panel.injectTab)({
|
|
4811
4873
|
id: "components",
|
|
4812
|
-
label: (0,
|
|
4874
|
+
label: (0, import_i18n30.__)("Components", "elementor"),
|
|
4813
4875
|
component: Components,
|
|
4814
4876
|
position: 1
|
|
4815
4877
|
});
|