@elementor/editor-controls 1.3.0 → 1.5.0
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/CHANGELOG.md +40 -0
- package/dist/index.d.mts +13 -5
- package/dist/index.d.ts +13 -5
- package/dist/index.js +777 -629
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +617 -458
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/components/font-family-selector.tsx +54 -56
- package/src/components/repeater.tsx +22 -11
- package/src/components/size-control/size-input.tsx +4 -4
- package/src/controls/color-control.tsx +12 -1
- package/src/controls/filter-control/drop-shadow-item-content.tsx +69 -0
- package/src/controls/filter-control/drop-shadow-item-label.tsx +20 -0
- package/src/controls/filter-repeater-control.tsx +108 -21
- package/src/controls/key-value-control.tsx +57 -46
- package/src/controls/repeatable-control.tsx +48 -29
- package/src/controls/size-control.tsx +25 -12
- package/src/controls/text-control.tsx +33 -18
- package/src/utils/size-control.ts +4 -2
package/dist/index.js
CHANGED
|
@@ -365,7 +365,7 @@ var import_ui3 = require("@elementor/ui");
|
|
|
365
365
|
var React6 = __toESM(require("react"));
|
|
366
366
|
var import_react5 = require("react");
|
|
367
367
|
var Context = (0, import_react5.createContext)(null);
|
|
368
|
-
var ControlActionsProvider = ({ children, items }) => /* @__PURE__ */ React6.createElement(Context.Provider, { value: { items } }, children);
|
|
368
|
+
var ControlActionsProvider = ({ children, items: items2 }) => /* @__PURE__ */ React6.createElement(Context.Provider, { value: { items: items2 } }, children);
|
|
369
369
|
var useControlActions = () => {
|
|
370
370
|
const context = (0, import_react5.useContext)(Context);
|
|
371
371
|
if (!context) {
|
|
@@ -387,12 +387,12 @@ var FloatingBarContainer = (0, import_ui3.styled)("span")`
|
|
|
387
387
|
}
|
|
388
388
|
`;
|
|
389
389
|
function ControlActions({ children }) {
|
|
390
|
-
const { items } = useControlActions();
|
|
390
|
+
const { items: items2 } = useControlActions();
|
|
391
391
|
const { disabled } = useBoundProp();
|
|
392
|
-
if (
|
|
392
|
+
if (items2.length === 0 || disabled) {
|
|
393
393
|
return children;
|
|
394
394
|
}
|
|
395
|
-
const menuItems =
|
|
395
|
+
const menuItems = items2.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React7.createElement(MenuItem2, { key: id }));
|
|
396
396
|
return /* @__PURE__ */ React7.createElement(FloatingBarContainer, null, /* @__PURE__ */ React7.createElement(import_ui3.UnstableFloatingActionBar, { actions: menuItems }, children));
|
|
397
397
|
}
|
|
398
398
|
|
|
@@ -508,21 +508,31 @@ var ImageSizeControl = ({ sizes }) => {
|
|
|
508
508
|
var React11 = __toESM(require("react"));
|
|
509
509
|
var import_editor_props4 = require("@elementor/editor-props");
|
|
510
510
|
var import_ui7 = require("@elementor/ui");
|
|
511
|
-
var TextControl = createControl(
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
511
|
+
var TextControl = createControl(
|
|
512
|
+
({
|
|
513
|
+
placeholder,
|
|
514
|
+
error,
|
|
515
|
+
inputValue,
|
|
516
|
+
inputDisabled,
|
|
517
|
+
sx
|
|
518
|
+
}) => {
|
|
519
|
+
const { value, setValue, disabled } = useBoundProp(import_editor_props4.stringPropTypeUtil);
|
|
520
|
+
const handleChange = (event) => setValue(event.target.value);
|
|
521
|
+
return /* @__PURE__ */ React11.createElement(ControlActions, null, /* @__PURE__ */ React11.createElement(
|
|
522
|
+
import_ui7.TextField,
|
|
523
|
+
{
|
|
524
|
+
size: "tiny",
|
|
525
|
+
fullWidth: true,
|
|
526
|
+
disabled: inputDisabled ?? disabled,
|
|
527
|
+
value: inputValue ?? value ?? "",
|
|
528
|
+
onChange: handleChange,
|
|
529
|
+
placeholder,
|
|
530
|
+
error,
|
|
531
|
+
sx
|
|
532
|
+
}
|
|
533
|
+
));
|
|
534
|
+
}
|
|
535
|
+
);
|
|
526
536
|
|
|
527
537
|
// src/controls/text-area-control.tsx
|
|
528
538
|
var React12 = __toESM(require("react"));
|
|
@@ -840,12 +850,12 @@ var SizeControl = createControl((props) => {
|
|
|
840
850
|
return !!newState?.numeric || newState?.numeric === 0;
|
|
841
851
|
},
|
|
842
852
|
fallback: (newState) => ({
|
|
843
|
-
unit: newState?.unit ??
|
|
853
|
+
unit: newState?.unit ?? defaultUnit,
|
|
844
854
|
numeric: newState?.numeric ?? DEFAULT_SIZE,
|
|
845
855
|
custom: newState?.custom ?? ""
|
|
846
856
|
})
|
|
847
857
|
});
|
|
848
|
-
const { size: controlSize = DEFAULT_SIZE, unit: controlUnit =
|
|
858
|
+
const { size: controlSize = DEFAULT_SIZE, unit: controlUnit = defaultUnit } = extractValueFromState(state) || {};
|
|
849
859
|
const handleUnitChange = (newUnit) => {
|
|
850
860
|
if (newUnit === "custom") {
|
|
851
861
|
popupState.open(anchorRef?.current);
|
|
@@ -875,9 +885,13 @@ var SizeControl = createControl((props) => {
|
|
|
875
885
|
}
|
|
876
886
|
};
|
|
877
887
|
(0, import_react10.useEffect)(() => {
|
|
878
|
-
const newState = createStateFromSizeProp(sizeValue, defaultUnit);
|
|
879
|
-
const
|
|
880
|
-
const mergedStates = {
|
|
888
|
+
const newState = createStateFromSizeProp(sizeValue, state.unit === "custom" ? state.unit : defaultUnit);
|
|
889
|
+
const currentUnitType = isUnitExtendedOption(state.unit) ? "custom" : "numeric";
|
|
890
|
+
const mergedStates = {
|
|
891
|
+
...state,
|
|
892
|
+
unit: newState.unit ?? state.unit,
|
|
893
|
+
[currentUnitType]: newState[currentUnitType]
|
|
894
|
+
};
|
|
881
895
|
if (mergedStates.unit !== "auto" && areStatesEqual(state, mergedStates)) {
|
|
882
896
|
return;
|
|
883
897
|
}
|
|
@@ -979,7 +993,8 @@ var import_editor_props7 = require("@elementor/editor-props");
|
|
|
979
993
|
var import_ui14 = require("@elementor/ui");
|
|
980
994
|
var ColorControl = createControl(
|
|
981
995
|
({ propTypeUtil = import_editor_props7.colorPropTypeUtil, anchorEl, slotProps = {}, ...props }) => {
|
|
982
|
-
const { value, setValue, disabled } = useBoundProp(propTypeUtil);
|
|
996
|
+
const { value, setValue, placeholder: boundPropPlaceholder, disabled } = useBoundProp(propTypeUtil);
|
|
997
|
+
const placeholder = props.placeholder ?? boundPropPlaceholder;
|
|
983
998
|
const handleChange = (selectedColor) => {
|
|
984
999
|
setValue(selectedColor || null);
|
|
985
1000
|
};
|
|
@@ -989,6 +1004,7 @@ var ColorControl = createControl(
|
|
|
989
1004
|
size: "tiny",
|
|
990
1005
|
fullWidth: true,
|
|
991
1006
|
value: value ?? "",
|
|
1007
|
+
placeholder: placeholder ?? "",
|
|
992
1008
|
onChange: handleChange,
|
|
993
1009
|
...props,
|
|
994
1010
|
disabled,
|
|
@@ -1003,6 +1019,14 @@ var ColorControl = createControl(
|
|
|
1003
1019
|
transformOrigin: {
|
|
1004
1020
|
vertical: "top",
|
|
1005
1021
|
horizontal: -10
|
|
1022
|
+
},
|
|
1023
|
+
slotProps: {
|
|
1024
|
+
colorIndicator: {
|
|
1025
|
+
value: value ?? placeholder ?? ""
|
|
1026
|
+
},
|
|
1027
|
+
colorBox: {
|
|
1028
|
+
value: value ?? placeholder ?? ""
|
|
1029
|
+
}
|
|
1006
1030
|
}
|
|
1007
1031
|
}
|
|
1008
1032
|
}
|
|
@@ -1054,7 +1078,7 @@ var React23 = __toESM(require("react"));
|
|
|
1054
1078
|
var React22 = __toESM(require("react"));
|
|
1055
1079
|
var import_react13 = require("react");
|
|
1056
1080
|
var Context2 = (0, import_react13.createContext)(null);
|
|
1057
|
-
var ControlAdornmentsProvider = ({ children, items }) => /* @__PURE__ */ React22.createElement(Context2.Provider, { value: { items } }, children);
|
|
1081
|
+
var ControlAdornmentsProvider = ({ children, items: items2 }) => /* @__PURE__ */ React22.createElement(Context2.Provider, { value: { items: items2 } }, children);
|
|
1058
1082
|
var useControlAdornments = () => {
|
|
1059
1083
|
const context = (0, import_react13.useContext)(Context2);
|
|
1060
1084
|
return context?.items ?? [];
|
|
@@ -1062,11 +1086,11 @@ var useControlAdornments = () => {
|
|
|
1062
1086
|
|
|
1063
1087
|
// src/control-adornments/control-adornments.tsx
|
|
1064
1088
|
function ControlAdornments() {
|
|
1065
|
-
const
|
|
1066
|
-
if (
|
|
1089
|
+
const items2 = useControlAdornments();
|
|
1090
|
+
if (items2?.length === 0) {
|
|
1067
1091
|
return null;
|
|
1068
1092
|
}
|
|
1069
|
-
return /* @__PURE__ */ React23.createElement(React23.Fragment, null,
|
|
1093
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, items2.map(({ Adornment, id }) => /* @__PURE__ */ React23.createElement(Adornment, { key: id })));
|
|
1070
1094
|
}
|
|
1071
1095
|
|
|
1072
1096
|
// src/locations.ts
|
|
@@ -1160,16 +1184,17 @@ var Repeater = ({
|
|
|
1160
1184
|
setValues: setRepeaterValues,
|
|
1161
1185
|
showDuplicate = true,
|
|
1162
1186
|
showToggle = true,
|
|
1163
|
-
isSortable = true
|
|
1187
|
+
isSortable = true,
|
|
1188
|
+
collectionPropUtil
|
|
1164
1189
|
}) => {
|
|
1165
1190
|
const [openItem, setOpenItem] = (0, import_react14.useState)(EMPTY_OPEN_ITEM);
|
|
1166
|
-
const [
|
|
1191
|
+
const [items2, setItems] = useSyncExternalState({
|
|
1167
1192
|
external: repeaterValues,
|
|
1168
1193
|
// @ts-expect-error - as long as persistWhen => true, value will never be null
|
|
1169
1194
|
setExternal: setRepeaterValues,
|
|
1170
1195
|
persistWhen: () => true
|
|
1171
1196
|
});
|
|
1172
|
-
const [uniqueKeys, setUniqueKeys] = (0, import_react14.useState)(
|
|
1197
|
+
const [uniqueKeys, setUniqueKeys] = (0, import_react14.useState)(items2.map((_, index) => index));
|
|
1173
1198
|
const generateNextKey = (source) => {
|
|
1174
1199
|
return 1 + Math.max(0, ...source);
|
|
1175
1200
|
};
|
|
@@ -1177,10 +1202,10 @@ var Repeater = ({
|
|
|
1177
1202
|
const newItem = structuredClone(itemSettings.initialValues);
|
|
1178
1203
|
const newKey = generateNextKey(uniqueKeys);
|
|
1179
1204
|
if (addToBottom) {
|
|
1180
|
-
setItems([...
|
|
1205
|
+
setItems([...items2, newItem]);
|
|
1181
1206
|
setUniqueKeys([...uniqueKeys, newKey]);
|
|
1182
1207
|
} else {
|
|
1183
|
-
setItems([newItem, ...
|
|
1208
|
+
setItems([newItem, ...items2]);
|
|
1184
1209
|
setUniqueKeys([newKey, ...uniqueKeys]);
|
|
1185
1210
|
}
|
|
1186
1211
|
if (openOnAdd) {
|
|
@@ -1188,10 +1213,10 @@ var Repeater = ({
|
|
|
1188
1213
|
}
|
|
1189
1214
|
};
|
|
1190
1215
|
const duplicateRepeaterItem = (index) => {
|
|
1191
|
-
const newItem = structuredClone(
|
|
1216
|
+
const newItem = structuredClone(items2[index]);
|
|
1192
1217
|
const newKey = generateNextKey(uniqueKeys);
|
|
1193
1218
|
const atPosition = 1 + index;
|
|
1194
|
-
setItems([...
|
|
1219
|
+
setItems([...items2.slice(0, atPosition), newItem, ...items2.slice(atPosition)]);
|
|
1195
1220
|
setUniqueKeys([...uniqueKeys.slice(0, atPosition), newKey, ...uniqueKeys.slice(atPosition)]);
|
|
1196
1221
|
};
|
|
1197
1222
|
const removeRepeaterItem = (index) => {
|
|
@@ -1201,14 +1226,14 @@ var Repeater = ({
|
|
|
1201
1226
|
})
|
|
1202
1227
|
);
|
|
1203
1228
|
setItems(
|
|
1204
|
-
|
|
1229
|
+
items2.filter((_, pos) => {
|
|
1205
1230
|
return pos !== index;
|
|
1206
1231
|
})
|
|
1207
1232
|
);
|
|
1208
1233
|
};
|
|
1209
1234
|
const toggleDisableRepeaterItem = (index) => {
|
|
1210
1235
|
setItems(
|
|
1211
|
-
|
|
1236
|
+
items2.map((value, pos) => {
|
|
1212
1237
|
if (pos === index) {
|
|
1213
1238
|
const { disabled: propDisabled, ...rest } = value;
|
|
1214
1239
|
return { ...rest, ...propDisabled ? {} : { disabled: true } };
|
|
@@ -1249,7 +1274,7 @@ var Repeater = ({
|
|
|
1249
1274
|
/* @__PURE__ */ React25.createElement(import_icons4.PlusIcon, { fontSize: SIZE })
|
|
1250
1275
|
)
|
|
1251
1276
|
), 0 < uniqueKeys.length && /* @__PURE__ */ React25.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key, index) => {
|
|
1252
|
-
const value =
|
|
1277
|
+
const value = items2[index];
|
|
1253
1278
|
if (!value) {
|
|
1254
1279
|
return null;
|
|
1255
1280
|
}
|
|
@@ -1266,7 +1291,8 @@ var Repeater = ({
|
|
|
1266
1291
|
openOnMount: openOnAdd && openItem === key,
|
|
1267
1292
|
onOpen: () => setOpenItem(EMPTY_OPEN_ITEM),
|
|
1268
1293
|
showDuplicate,
|
|
1269
|
-
showToggle
|
|
1294
|
+
showToggle,
|
|
1295
|
+
collectionPropUtil
|
|
1270
1296
|
},
|
|
1271
1297
|
(props) => /* @__PURE__ */ React25.createElement(itemSettings.Content, { ...props, value, bind: String(index) })
|
|
1272
1298
|
));
|
|
@@ -1284,7 +1310,8 @@ var RepeaterItem = ({
|
|
|
1284
1310
|
onOpen,
|
|
1285
1311
|
showDuplicate,
|
|
1286
1312
|
showToggle,
|
|
1287
|
-
disabled
|
|
1313
|
+
disabled,
|
|
1314
|
+
collectionPropUtil
|
|
1288
1315
|
}) => {
|
|
1289
1316
|
const [anchorEl, setAnchorEl] = (0, import_react14.useState)(null);
|
|
1290
1317
|
const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, onOpen);
|
|
@@ -1319,7 +1346,7 @@ var RepeaterItem = ({
|
|
|
1319
1346
|
...popoverProps,
|
|
1320
1347
|
anchorEl: ref
|
|
1321
1348
|
},
|
|
1322
|
-
/* @__PURE__ */ React25.createElement(import_ui19.Box, null, children({ anchorEl }))
|
|
1349
|
+
/* @__PURE__ */ React25.createElement(import_ui19.Box, null, children({ anchorEl, collectionPropUtil }))
|
|
1323
1350
|
));
|
|
1324
1351
|
};
|
|
1325
1352
|
var usePopover = (openOnMount, onOpen) => {
|
|
@@ -1426,12 +1453,13 @@ var initialShadow = {
|
|
|
1426
1453
|
};
|
|
1427
1454
|
|
|
1428
1455
|
// src/controls/filter-repeater-control.tsx
|
|
1429
|
-
var
|
|
1430
|
-
var
|
|
1456
|
+
var React30 = __toESM(require("react"));
|
|
1457
|
+
var import_react17 = require("react");
|
|
1431
1458
|
var import_editor_props10 = require("@elementor/editor-props");
|
|
1459
|
+
var import_editor_props11 = require("@elementor/editor-props");
|
|
1432
1460
|
var import_editor_ui3 = require("@elementor/editor-ui");
|
|
1433
|
-
var
|
|
1434
|
-
var
|
|
1461
|
+
var import_ui24 = require("@elementor/ui");
|
|
1462
|
+
var import_i18n7 = require("@wordpress/i18n");
|
|
1435
1463
|
|
|
1436
1464
|
// src/components/control-label.tsx
|
|
1437
1465
|
var React27 = __toESM(require("react"));
|
|
@@ -1440,39 +1468,145 @@ var ControlLabel = ({ children }) => {
|
|
|
1440
1468
|
return /* @__PURE__ */ React27.createElement(import_ui21.Stack, { direction: "row", alignItems: "center", justifyItems: "start", gap: 0.25 }, /* @__PURE__ */ React27.createElement(ControlFormLabel, null, children), /* @__PURE__ */ React27.createElement(ControlAdornments, null));
|
|
1441
1469
|
};
|
|
1442
1470
|
|
|
1471
|
+
// src/controls/filter-control/drop-shadow-item-content.tsx
|
|
1472
|
+
var React28 = __toESM(require("react"));
|
|
1473
|
+
var import_react16 = require("react");
|
|
1474
|
+
var import_ui22 = require("@elementor/ui");
|
|
1475
|
+
var import_i18n6 = require("@wordpress/i18n");
|
|
1476
|
+
var items = [
|
|
1477
|
+
{
|
|
1478
|
+
bind: "xAxis",
|
|
1479
|
+
label: (0, import_i18n6.__)("X-axis", "elementor"),
|
|
1480
|
+
rowIndex: 0
|
|
1481
|
+
},
|
|
1482
|
+
{
|
|
1483
|
+
bind: "yAxis",
|
|
1484
|
+
label: (0, import_i18n6.__)("Y-axis", "elementor"),
|
|
1485
|
+
rowIndex: 0
|
|
1486
|
+
},
|
|
1487
|
+
{
|
|
1488
|
+
bind: "blur",
|
|
1489
|
+
label: (0, import_i18n6.__)("Blur", "elementor"),
|
|
1490
|
+
rowIndex: 1
|
|
1491
|
+
},
|
|
1492
|
+
{
|
|
1493
|
+
bind: "color",
|
|
1494
|
+
label: (0, import_i18n6.__)("Color", "elementor"),
|
|
1495
|
+
rowIndex: 1
|
|
1496
|
+
}
|
|
1497
|
+
];
|
|
1498
|
+
var DropShadowItemContent = ({
|
|
1499
|
+
propType,
|
|
1500
|
+
units: units2,
|
|
1501
|
+
anchorEl
|
|
1502
|
+
}) => {
|
|
1503
|
+
const context = useBoundProp(propType);
|
|
1504
|
+
const rowRefs = [(0, import_react16.useRef)(null), (0, import_react16.useRef)(null)];
|
|
1505
|
+
return /* @__PURE__ */ React28.createElement(PropProvider, { ...context }, items.map((item) => /* @__PURE__ */ React28.createElement(PopoverGridContainer, { key: item.bind, ref: rowRefs[item.rowIndex] ?? null }, /* @__PURE__ */ React28.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React28.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(ControlFormLabel, null, item.label)), /* @__PURE__ */ React28.createElement(import_ui22.Grid, { item: true, xs: 6 }, item.bind === "color" ? /* @__PURE__ */ React28.createElement(ColorControl, { anchorEl }) : /* @__PURE__ */ React28.createElement(SizeControl, { anchorRef: rowRefs[item.rowIndex], units: units2, defaultUnit: "px" }))))));
|
|
1506
|
+
};
|
|
1507
|
+
|
|
1508
|
+
// src/controls/filter-control/drop-shadow-item-label.tsx
|
|
1509
|
+
var React29 = __toESM(require("react"));
|
|
1510
|
+
var import_ui23 = require("@elementor/ui");
|
|
1511
|
+
var DropShadowItemLabel = ({ value }) => {
|
|
1512
|
+
const { xAxis, yAxis, blur } = value.value;
|
|
1513
|
+
const xValue = `${xAxis?.value?.size ?? 0}${xAxis?.value?.unit ?? "px"}`;
|
|
1514
|
+
const yValue = `${yAxis?.value?.size ?? 0}${yAxis?.value?.unit ?? "px"}`;
|
|
1515
|
+
const blurValue = `${blur?.value?.size ?? 10}${blur?.value?.unit ?? "px"}`;
|
|
1516
|
+
return /* @__PURE__ */ React29.createElement(import_ui23.Box, { component: "span" }, /* @__PURE__ */ React29.createElement(import_ui23.Box, { component: "span", style: { textTransform: "capitalize" } }, "Drop shadow:"), `${xValue} ${yValue} ${blurValue}`);
|
|
1517
|
+
};
|
|
1518
|
+
|
|
1443
1519
|
// src/controls/filter-repeater-control.tsx
|
|
1444
1520
|
var DEFAULT_FILTER_KEY = "blur";
|
|
1445
1521
|
var filterConfig = {
|
|
1446
1522
|
blur: {
|
|
1447
1523
|
defaultValue: { $$type: "radius", radius: { $$type: "size", value: { size: 0, unit: "px" } } },
|
|
1448
|
-
name: (0,
|
|
1449
|
-
valueName: (0,
|
|
1524
|
+
name: (0, import_i18n7.__)("Blur", "elementor"),
|
|
1525
|
+
valueName: (0, import_i18n7.__)("Radius", "elementor"),
|
|
1450
1526
|
propType: import_editor_props10.blurFilterPropTypeUtil,
|
|
1451
1527
|
units: defaultUnits.filter((unit) => unit !== "%")
|
|
1452
1528
|
},
|
|
1529
|
+
"drop-shadow": {
|
|
1530
|
+
defaultValue: {
|
|
1531
|
+
$$type: "drop-shadow",
|
|
1532
|
+
value: {
|
|
1533
|
+
xAxis: { $$type: "size", value: { size: 0, unit: "px" } },
|
|
1534
|
+
yAxis: { $$type: "size", value: { size: 0, unit: "px" } },
|
|
1535
|
+
blur: { $$type: "size", value: { size: 10, unit: "px" } },
|
|
1536
|
+
color: { $$type: "color", value: "rgba(0, 0, 0, 1)" }
|
|
1537
|
+
}
|
|
1538
|
+
},
|
|
1539
|
+
name: (0, import_i18n7.__)("Drop shadow", "elementor"),
|
|
1540
|
+
valueName: (0, import_i18n7.__)("Drop-shadow", "elementor"),
|
|
1541
|
+
propType: import_editor_props10.dropShadowFilterPropTypeUtil,
|
|
1542
|
+
units: defaultUnits.filter((unit) => unit !== "%")
|
|
1543
|
+
},
|
|
1453
1544
|
brightness: {
|
|
1454
1545
|
defaultValue: { $$type: "amount", amount: { $$type: "size", value: { size: 100, unit: "%" } } },
|
|
1455
|
-
name: (0,
|
|
1456
|
-
valueName: (0,
|
|
1546
|
+
name: (0, import_i18n7.__)("Brightness", "elementor"),
|
|
1547
|
+
valueName: (0, import_i18n7.__)("Amount", "elementor"),
|
|
1457
1548
|
propType: import_editor_props10.brightnessFilterPropTypeUtil,
|
|
1458
1549
|
units: ["%"]
|
|
1550
|
+
},
|
|
1551
|
+
contrast: {
|
|
1552
|
+
defaultValue: { $$type: "contrast", contrast: { $$type: "size", value: { size: 100, unit: "%" } } },
|
|
1553
|
+
name: (0, import_i18n7.__)("Contrast", "elementor"),
|
|
1554
|
+
valueName: (0, import_i18n7.__)("Amount", "elementor"),
|
|
1555
|
+
propType: import_editor_props10.contrastFilterPropTypeUtil,
|
|
1556
|
+
units: ["%"]
|
|
1557
|
+
},
|
|
1558
|
+
"hue-rotate": {
|
|
1559
|
+
defaultValue: { $$type: "hue-rotate", "hue-rotate": { $$type: "size", value: { size: 0, unit: "deg" } } },
|
|
1560
|
+
name: (0, import_i18n7.__)("Hue Rotate", "elementor"),
|
|
1561
|
+
valueName: (0, import_i18n7.__)("Angle", "elementor"),
|
|
1562
|
+
propType: import_editor_props10.hueRotateFilterPropTypeUtil,
|
|
1563
|
+
units: ["deg", "rad", "grad", "turn"]
|
|
1564
|
+
},
|
|
1565
|
+
saturate: {
|
|
1566
|
+
defaultValue: { $$type: "saturate", saturate: { $$type: "size", value: { size: 100, unit: "%" } } },
|
|
1567
|
+
name: (0, import_i18n7.__)("Saturate", "elementor"),
|
|
1568
|
+
valueName: (0, import_i18n7.__)("Amount", "elementor"),
|
|
1569
|
+
propType: import_editor_props10.saturateFilterPropTypeUtil,
|
|
1570
|
+
units: ["%"]
|
|
1571
|
+
},
|
|
1572
|
+
grayscale: {
|
|
1573
|
+
defaultValue: { $$type: "grayscale", grayscale: { $$type: "size", value: { size: 0, unit: "%" } } },
|
|
1574
|
+
name: (0, import_i18n7.__)("Grayscale", "elementor"),
|
|
1575
|
+
valueName: (0, import_i18n7.__)("Amount", "elementor"),
|
|
1576
|
+
propType: import_editor_props10.grayscaleFilterPropTypeUtil,
|
|
1577
|
+
units: ["%"]
|
|
1578
|
+
},
|
|
1579
|
+
invert: {
|
|
1580
|
+
defaultValue: { $$type: "invert", invert: { $$type: "size", value: { size: 0, unit: "%" } } },
|
|
1581
|
+
name: (0, import_i18n7.__)("Invert", "elementor"),
|
|
1582
|
+
valueName: (0, import_i18n7.__)("Amount", "elementor"),
|
|
1583
|
+
propType: import_editor_props10.invertFilterPropTypeUtil,
|
|
1584
|
+
units: ["%"]
|
|
1585
|
+
},
|
|
1586
|
+
sepia: {
|
|
1587
|
+
defaultValue: { $$type: "sepia", sepia: { $$type: "size", value: { size: 0, unit: "%" } } },
|
|
1588
|
+
name: (0, import_i18n7.__)("Sepia", "elementor"),
|
|
1589
|
+
valueName: (0, import_i18n7.__)("Amount", "elementor"),
|
|
1590
|
+
propType: import_editor_props10.sepiaFilterPropTypeUtil,
|
|
1591
|
+
units: ["%"]
|
|
1459
1592
|
}
|
|
1460
1593
|
};
|
|
1461
1594
|
var filterKeys = Object.keys(filterConfig);
|
|
1462
|
-
var
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
})
|
|
1466
|
-
|
|
1467
|
-
const { propType, value: filterValues, setValue, disabled } = useBoundProp(
|
|
1468
|
-
return /* @__PURE__ */
|
|
1595
|
+
var isSingleSize = (key) => {
|
|
1596
|
+
return !["drop-shadow"].includes(key);
|
|
1597
|
+
};
|
|
1598
|
+
var FilterRepeaterControl = createControl(({ filterPropName = "filter" }) => {
|
|
1599
|
+
const [propUtil, label] = filterPropName === "backdrop-filter" ? [import_editor_props11.backdropFilterPropTypeUtil, (0, import_i18n7.__)("Backdrop Filters", "elementor")] : [import_editor_props10.filterPropTypeUtil, (0, import_i18n7.__)("Filters", "elementor")];
|
|
1600
|
+
const { propType, value: filterValues, setValue, disabled } = useBoundProp(propUtil);
|
|
1601
|
+
return /* @__PURE__ */ React30.createElement(PropProvider, { propType, value: filterValues, setValue }, /* @__PURE__ */ React30.createElement(
|
|
1469
1602
|
Repeater,
|
|
1470
1603
|
{
|
|
1471
1604
|
openOnAdd: true,
|
|
1472
1605
|
disabled,
|
|
1473
1606
|
values: filterValues ?? [],
|
|
1474
1607
|
setValues: setValue,
|
|
1475
|
-
label
|
|
1608
|
+
label,
|
|
1609
|
+
collectionPropUtil: propUtil,
|
|
1476
1610
|
itemSettings: {
|
|
1477
1611
|
Icon: ItemIcon2,
|
|
1478
1612
|
Label: ItemLabel2,
|
|
@@ -1485,21 +1619,24 @@ var FilterRepeaterControl = createControl(() => {
|
|
|
1485
1619
|
}
|
|
1486
1620
|
));
|
|
1487
1621
|
});
|
|
1488
|
-
var ItemIcon2 = () => /* @__PURE__ */
|
|
1489
|
-
var ItemLabel2 = (
|
|
1490
|
-
|
|
1491
|
-
return singleSizeFilterNames.includes($$type) && /* @__PURE__ */ React28.createElement(SingleSizeItemLabel, { value: props.value });
|
|
1622
|
+
var ItemIcon2 = () => /* @__PURE__ */ React30.createElement(React30.Fragment, null);
|
|
1623
|
+
var ItemLabel2 = ({ value }) => {
|
|
1624
|
+
return isSingleSize(value.$$type) ? /* @__PURE__ */ React30.createElement(SingleSizeItemLabel, { value }) : /* @__PURE__ */ React30.createElement(DropShadowItemLabel, { value });
|
|
1492
1625
|
};
|
|
1493
1626
|
var SingleSizeItemLabel = ({ value }) => {
|
|
1494
1627
|
const { $$type, value: sizeValue } = value;
|
|
1495
1628
|
const { $$type: key } = filterConfig[$$type].defaultValue;
|
|
1496
1629
|
const defaultUnit = filterConfig[$$type].defaultValue[key].value.unit;
|
|
1497
1630
|
const { unit, size } = sizeValue[key]?.value ?? { unit: defaultUnit, size: 0 };
|
|
1498
|
-
const label = /* @__PURE__ */
|
|
1499
|
-
return /* @__PURE__ */
|
|
1631
|
+
const label = /* @__PURE__ */ React30.createElement(import_ui24.Box, { component: "span", style: { textTransform: "capitalize" } }, value.$$type, ":");
|
|
1632
|
+
return /* @__PURE__ */ React30.createElement(import_ui24.Box, { component: "span" }, label, unit !== "custom" ? ` ${size ?? 0}${unit ?? defaultUnit}` : size);
|
|
1500
1633
|
};
|
|
1501
|
-
var ItemContent2 = ({
|
|
1502
|
-
|
|
1634
|
+
var ItemContent2 = ({
|
|
1635
|
+
bind,
|
|
1636
|
+
collectionPropUtil,
|
|
1637
|
+
anchorEl
|
|
1638
|
+
}) => {
|
|
1639
|
+
const { value: filterValues, setValue } = useBoundProp(collectionPropUtil ?? import_editor_props10.filterPropTypeUtil);
|
|
1503
1640
|
const itemIndex = parseInt(bind, 10);
|
|
1504
1641
|
const item = filterValues?.[itemIndex];
|
|
1505
1642
|
const handleChange = (e) => {
|
|
@@ -1507,12 +1644,12 @@ var ItemContent2 = ({ bind }) => {
|
|
|
1507
1644
|
const filterType = e.target.value;
|
|
1508
1645
|
newFilterValues[itemIndex] = {
|
|
1509
1646
|
$$type: filterType,
|
|
1510
|
-
value: filterConfig[filterType].defaultValue
|
|
1647
|
+
value: { ...filterConfig[filterType].defaultValue }
|
|
1511
1648
|
};
|
|
1512
1649
|
setValue(newFilterValues);
|
|
1513
1650
|
};
|
|
1514
|
-
return /* @__PURE__ */
|
|
1515
|
-
|
|
1651
|
+
return /* @__PURE__ */ React30.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React30.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React30.createElement(PopoverGridContainer, null, /* @__PURE__ */ React30.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel, null, (0, import_i18n7.__)("Filter", "elementor"))), /* @__PURE__ */ React30.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(
|
|
1652
|
+
import_ui24.Select,
|
|
1516
1653
|
{
|
|
1517
1654
|
sx: { overflow: "hidden" },
|
|
1518
1655
|
size: "tiny",
|
|
@@ -1520,43 +1657,45 @@ var ItemContent2 = ({ bind }) => {
|
|
|
1520
1657
|
onChange: handleChange,
|
|
1521
1658
|
fullWidth: true
|
|
1522
1659
|
},
|
|
1523
|
-
filterKeys.map((filterKey) => /* @__PURE__ */
|
|
1524
|
-
))), /* @__PURE__ */
|
|
1660
|
+
filterKeys.map((filterKey) => /* @__PURE__ */ React30.createElement(import_editor_ui3.MenuListItem, { key: filterKey, value: filterKey }, filterConfig[filterKey].name))
|
|
1661
|
+
))), /* @__PURE__ */ React30.createElement(Content2, { filterType: item?.$$type, anchorEl })));
|
|
1525
1662
|
};
|
|
1526
|
-
var Content2 = ({ filterType }) => {
|
|
1527
|
-
|
|
1663
|
+
var Content2 = ({ filterType, anchorEl }) => {
|
|
1664
|
+
const { propType, units: units2 = [] } = filterConfig[filterType];
|
|
1665
|
+
return isSingleSize(filterType) ? /* @__PURE__ */ React30.createElement(SingleSizeItemContent, { filterType }) : /* @__PURE__ */ React30.createElement(DropShadowItemContent, { propType, units: units2, anchorEl });
|
|
1528
1666
|
};
|
|
1529
1667
|
var SingleSizeItemContent = ({ filterType }) => {
|
|
1530
1668
|
const { propType, valueName, defaultValue, units: units2 } = filterConfig[filterType];
|
|
1531
1669
|
const { $$type } = defaultValue;
|
|
1532
1670
|
const context = useBoundProp(propType);
|
|
1533
|
-
const rowRef = (0,
|
|
1534
|
-
|
|
1671
|
+
const rowRef = (0, import_react17.useRef)(null);
|
|
1672
|
+
const defaultUnit = defaultValue[$$type].value.unit;
|
|
1673
|
+
return /* @__PURE__ */ React30.createElement(PropProvider, { ...context }, /* @__PURE__ */ React30.createElement(PropKeyProvider, { bind: $$type }, /* @__PURE__ */ React30.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React30.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel, null, valueName)), /* @__PURE__ */ React30.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(SizeControl, { anchorRef: rowRef, units: units2, defaultUnit })))));
|
|
1535
1674
|
};
|
|
1536
1675
|
|
|
1537
1676
|
// src/controls/toggle-control.tsx
|
|
1538
|
-
var
|
|
1539
|
-
var
|
|
1677
|
+
var React33 = __toESM(require("react"));
|
|
1678
|
+
var import_editor_props12 = require("@elementor/editor-props");
|
|
1540
1679
|
|
|
1541
1680
|
// src/components/control-toggle-button-group.tsx
|
|
1542
|
-
var
|
|
1543
|
-
var
|
|
1681
|
+
var React32 = __toESM(require("react"));
|
|
1682
|
+
var import_react18 = require("react");
|
|
1544
1683
|
var import_icons5 = require("@elementor/icons");
|
|
1545
|
-
var
|
|
1684
|
+
var import_ui26 = require("@elementor/ui");
|
|
1546
1685
|
|
|
1547
1686
|
// src/components/conditional-tooltip.tsx
|
|
1548
|
-
var
|
|
1549
|
-
var
|
|
1687
|
+
var React31 = __toESM(require("react"));
|
|
1688
|
+
var import_ui25 = require("@elementor/ui");
|
|
1550
1689
|
var ConditionalTooltip = ({
|
|
1551
1690
|
showTooltip,
|
|
1552
1691
|
children,
|
|
1553
1692
|
label
|
|
1554
1693
|
}) => {
|
|
1555
|
-
return showTooltip && label ? /* @__PURE__ */
|
|
1694
|
+
return showTooltip && label ? /* @__PURE__ */ React31.createElement(import_ui25.Tooltip, { title: label, disableFocusListener: true, placement: "top" }, children) : children;
|
|
1556
1695
|
};
|
|
1557
1696
|
|
|
1558
1697
|
// src/components/control-toggle-button-group.tsx
|
|
1559
|
-
var StyledToggleButtonGroup = (0,
|
|
1698
|
+
var StyledToggleButtonGroup = (0, import_ui26.styled)(import_ui26.ToggleButtonGroup)`
|
|
1560
1699
|
${({ justify }) => `justify-content: ${justify};`}
|
|
1561
1700
|
button:not( :last-of-type ) {
|
|
1562
1701
|
border-start-end-radius: 0;
|
|
@@ -1576,26 +1715,26 @@ var ControlToggleButtonGroup = ({
|
|
|
1576
1715
|
size = "tiny",
|
|
1577
1716
|
value,
|
|
1578
1717
|
onChange,
|
|
1579
|
-
items,
|
|
1718
|
+
items: items2,
|
|
1580
1719
|
maxItems,
|
|
1581
1720
|
exclusive = false,
|
|
1582
1721
|
fullWidth = false,
|
|
1583
1722
|
disabled
|
|
1584
1723
|
}) => {
|
|
1585
|
-
const shouldSliceItems = exclusive && maxItems !== void 0 &&
|
|
1586
|
-
const menuItems = shouldSliceItems ?
|
|
1587
|
-
const fixedItems = shouldSliceItems ?
|
|
1588
|
-
const isRtl = "rtl" === (0,
|
|
1724
|
+
const shouldSliceItems = exclusive && maxItems !== void 0 && items2.length > maxItems;
|
|
1725
|
+
const menuItems = shouldSliceItems ? items2.slice(maxItems - 1) : [];
|
|
1726
|
+
const fixedItems = shouldSliceItems ? items2.slice(0, maxItems - 1) : items2;
|
|
1727
|
+
const isRtl = "rtl" === (0, import_ui26.useTheme)().direction;
|
|
1589
1728
|
const handleChange = (_, newValue) => {
|
|
1590
1729
|
onChange(newValue);
|
|
1591
1730
|
};
|
|
1592
|
-
const getGridTemplateColumns = (0,
|
|
1731
|
+
const getGridTemplateColumns = (0, import_react18.useMemo)(() => {
|
|
1593
1732
|
const isOffLimits = menuItems?.length;
|
|
1594
1733
|
const itemsCount = isOffLimits ? fixedItems.length + 1 : fixedItems.length;
|
|
1595
1734
|
const templateColumnsSuffix = isOffLimits ? "auto" : "";
|
|
1596
1735
|
return `repeat(${itemsCount}, minmax(0, 25%)) ${templateColumnsSuffix}`;
|
|
1597
1736
|
}, [menuItems?.length, fixedItems.length]);
|
|
1598
|
-
return /* @__PURE__ */
|
|
1737
|
+
return /* @__PURE__ */ React32.createElement(ControlActions, null, /* @__PURE__ */ React32.createElement(
|
|
1599
1738
|
StyledToggleButtonGroup,
|
|
1600
1739
|
{
|
|
1601
1740
|
justify,
|
|
@@ -1610,16 +1749,16 @@ var ControlToggleButtonGroup = ({
|
|
|
1610
1749
|
width: `100%`
|
|
1611
1750
|
}
|
|
1612
1751
|
},
|
|
1613
|
-
fixedItems.map(({ label, value: buttonValue, renderContent: Content5, showTooltip }) => /* @__PURE__ */
|
|
1752
|
+
fixedItems.map(({ label, value: buttonValue, renderContent: Content5, showTooltip }) => /* @__PURE__ */ React32.createElement(
|
|
1614
1753
|
ConditionalTooltip,
|
|
1615
1754
|
{
|
|
1616
1755
|
key: buttonValue,
|
|
1617
1756
|
label,
|
|
1618
1757
|
showTooltip: showTooltip || false
|
|
1619
1758
|
},
|
|
1620
|
-
/* @__PURE__ */
|
|
1759
|
+
/* @__PURE__ */ React32.createElement(import_ui26.ToggleButton, { value: buttonValue, "aria-label": label, size, fullWidth }, /* @__PURE__ */ React32.createElement(Content5, { size }))
|
|
1621
1760
|
)),
|
|
1622
|
-
menuItems.length && exclusive && /* @__PURE__ */
|
|
1761
|
+
menuItems.length && exclusive && /* @__PURE__ */ React32.createElement(
|
|
1623
1762
|
SplitButtonGroup,
|
|
1624
1763
|
{
|
|
1625
1764
|
size,
|
|
@@ -1634,13 +1773,13 @@ var ControlToggleButtonGroup = ({
|
|
|
1634
1773
|
var SplitButtonGroup = ({
|
|
1635
1774
|
size = "tiny",
|
|
1636
1775
|
onChange,
|
|
1637
|
-
items,
|
|
1776
|
+
items: items2,
|
|
1638
1777
|
fullWidth,
|
|
1639
1778
|
value
|
|
1640
1779
|
}) => {
|
|
1641
|
-
const previewButton = usePreviewButton(
|
|
1642
|
-
const [isMenuOpen, setIsMenuOpen] = (0,
|
|
1643
|
-
const menuButtonRef = (0,
|
|
1780
|
+
const previewButton = usePreviewButton(items2, value);
|
|
1781
|
+
const [isMenuOpen, setIsMenuOpen] = (0, import_react18.useState)(false);
|
|
1782
|
+
const menuButtonRef = (0, import_react18.useRef)(null);
|
|
1644
1783
|
const onMenuToggle = (ev) => {
|
|
1645
1784
|
setIsMenuOpen((prev) => !prev);
|
|
1646
1785
|
ev.preventDefault();
|
|
@@ -1653,8 +1792,8 @@ var SplitButtonGroup = ({
|
|
|
1653
1792
|
const shouldRemove = newValue === value;
|
|
1654
1793
|
onChange(shouldRemove ? null : newValue);
|
|
1655
1794
|
};
|
|
1656
|
-
return /* @__PURE__ */
|
|
1657
|
-
|
|
1795
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(
|
|
1796
|
+
import_ui26.ToggleButton,
|
|
1658
1797
|
{
|
|
1659
1798
|
value: previewButton.value,
|
|
1660
1799
|
"aria-label": previewButton.label,
|
|
@@ -1667,8 +1806,8 @@ var SplitButtonGroup = ({
|
|
|
1667
1806
|
ref: menuButtonRef
|
|
1668
1807
|
},
|
|
1669
1808
|
previewButton.renderContent({ size })
|
|
1670
|
-
), /* @__PURE__ */
|
|
1671
|
-
|
|
1809
|
+
), /* @__PURE__ */ React32.createElement(
|
|
1810
|
+
import_ui26.ToggleButton,
|
|
1672
1811
|
{
|
|
1673
1812
|
size,
|
|
1674
1813
|
"aria-expanded": isMenuOpen ? "true" : void 0,
|
|
@@ -1678,9 +1817,9 @@ var SplitButtonGroup = ({
|
|
|
1678
1817
|
ref: menuButtonRef,
|
|
1679
1818
|
value: "__chevron-icon-button__"
|
|
1680
1819
|
},
|
|
1681
|
-
/* @__PURE__ */
|
|
1682
|
-
), /* @__PURE__ */
|
|
1683
|
-
|
|
1820
|
+
/* @__PURE__ */ React32.createElement(import_icons5.ChevronDownIcon, { fontSize: size })
|
|
1821
|
+
), /* @__PURE__ */ React32.createElement(
|
|
1822
|
+
import_ui26.Menu,
|
|
1684
1823
|
{
|
|
1685
1824
|
open: isMenuOpen,
|
|
1686
1825
|
onClose: () => setIsMenuOpen(false),
|
|
@@ -1697,27 +1836,27 @@ var SplitButtonGroup = ({
|
|
|
1697
1836
|
mt: 0.5
|
|
1698
1837
|
}
|
|
1699
1838
|
},
|
|
1700
|
-
|
|
1701
|
-
|
|
1839
|
+
items2.map(({ label, value: buttonValue }) => /* @__PURE__ */ React32.createElement(
|
|
1840
|
+
import_ui26.MenuItem,
|
|
1702
1841
|
{
|
|
1703
1842
|
key: buttonValue,
|
|
1704
1843
|
selected: buttonValue === value,
|
|
1705
1844
|
onClick: () => onMenuItemClick(buttonValue)
|
|
1706
1845
|
},
|
|
1707
|
-
/* @__PURE__ */
|
|
1846
|
+
/* @__PURE__ */ React32.createElement(import_ui26.ListItemText, null, /* @__PURE__ */ React32.createElement(import_ui26.Typography, { sx: { fontSize: "14px" } }, label))
|
|
1708
1847
|
))
|
|
1709
1848
|
));
|
|
1710
1849
|
};
|
|
1711
|
-
var usePreviewButton = (
|
|
1712
|
-
const [previewButton, setPreviewButton] = (0,
|
|
1713
|
-
|
|
1850
|
+
var usePreviewButton = (items2, value) => {
|
|
1851
|
+
const [previewButton, setPreviewButton] = (0, import_react18.useState)(
|
|
1852
|
+
items2.find((item) => item.value === value) ?? items2[0]
|
|
1714
1853
|
);
|
|
1715
|
-
(0,
|
|
1716
|
-
const selectedButton =
|
|
1854
|
+
(0, import_react18.useEffect)(() => {
|
|
1855
|
+
const selectedButton = items2.find((item) => item.value === value);
|
|
1717
1856
|
if (selectedButton) {
|
|
1718
1857
|
setPreviewButton(selectedButton);
|
|
1719
1858
|
}
|
|
1720
|
-
}, [
|
|
1859
|
+
}, [items2, value]);
|
|
1721
1860
|
return previewButton;
|
|
1722
1861
|
};
|
|
1723
1862
|
|
|
@@ -1730,7 +1869,7 @@ var ToggleControl = createControl(
|
|
|
1730
1869
|
exclusive = true,
|
|
1731
1870
|
maxItems
|
|
1732
1871
|
}) => {
|
|
1733
|
-
const { value, setValue, placeholder, disabled } = useBoundProp(
|
|
1872
|
+
const { value, setValue, placeholder, disabled } = useBoundProp(import_editor_props12.stringPropTypeUtil);
|
|
1734
1873
|
const exclusiveValues = options.filter((option) => option.exclusive).map((option) => option.value);
|
|
1735
1874
|
const handleNonExclusiveToggle = (selectedValues) => {
|
|
1736
1875
|
const newSelectedValue = selectedValues[selectedValues.length - 1];
|
|
@@ -1744,7 +1883,7 @@ var ToggleControl = createControl(
|
|
|
1744
1883
|
fullWidth,
|
|
1745
1884
|
size
|
|
1746
1885
|
};
|
|
1747
|
-
return exclusive ? /* @__PURE__ */
|
|
1886
|
+
return exclusive ? /* @__PURE__ */ React33.createElement(
|
|
1748
1887
|
ControlToggleButtonGroup,
|
|
1749
1888
|
{
|
|
1750
1889
|
...toggleButtonGroupProps,
|
|
@@ -1753,7 +1892,7 @@ var ToggleControl = createControl(
|
|
|
1753
1892
|
disabled,
|
|
1754
1893
|
exclusive: true
|
|
1755
1894
|
}
|
|
1756
|
-
) : /* @__PURE__ */
|
|
1895
|
+
) : /* @__PURE__ */ React33.createElement(
|
|
1757
1896
|
ControlToggleButtonGroup,
|
|
1758
1897
|
{
|
|
1759
1898
|
...toggleButtonGroupProps,
|
|
@@ -1767,9 +1906,9 @@ var ToggleControl = createControl(
|
|
|
1767
1906
|
);
|
|
1768
1907
|
|
|
1769
1908
|
// src/controls/number-control.tsx
|
|
1770
|
-
var
|
|
1771
|
-
var
|
|
1772
|
-
var
|
|
1909
|
+
var React34 = __toESM(require("react"));
|
|
1910
|
+
var import_editor_props13 = require("@elementor/editor-props");
|
|
1911
|
+
var import_ui27 = require("@elementor/ui");
|
|
1773
1912
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
1774
1913
|
var RESTRICTED_INPUT_KEYS2 = ["e", "E", "+", "-"];
|
|
1775
1914
|
var NumberControl = createControl(
|
|
@@ -1780,7 +1919,7 @@ var NumberControl = createControl(
|
|
|
1780
1919
|
step = 1,
|
|
1781
1920
|
shouldForceInt = false
|
|
1782
1921
|
}) => {
|
|
1783
|
-
const { value, setValue, placeholder, disabled } = useBoundProp(
|
|
1922
|
+
const { value, setValue, placeholder, disabled } = useBoundProp(import_editor_props13.numberPropTypeUtil);
|
|
1784
1923
|
const handleChange = (event) => {
|
|
1785
1924
|
const eventValue = event.target.value;
|
|
1786
1925
|
if (isEmptyOrNaN(eventValue)) {
|
|
@@ -1790,8 +1929,8 @@ var NumberControl = createControl(
|
|
|
1790
1929
|
const formattedValue = shouldForceInt ? +parseInt(eventValue) : Number(eventValue);
|
|
1791
1930
|
setValue(Math.min(Math.max(formattedValue, min), max));
|
|
1792
1931
|
};
|
|
1793
|
-
return /* @__PURE__ */
|
|
1794
|
-
|
|
1932
|
+
return /* @__PURE__ */ React34.createElement(ControlActions, null, /* @__PURE__ */ React34.createElement(
|
|
1933
|
+
import_ui27.TextField,
|
|
1795
1934
|
{
|
|
1796
1935
|
size: "tiny",
|
|
1797
1936
|
type: "number",
|
|
@@ -1812,15 +1951,15 @@ var NumberControl = createControl(
|
|
|
1812
1951
|
);
|
|
1813
1952
|
|
|
1814
1953
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
1815
|
-
var
|
|
1816
|
-
var
|
|
1817
|
-
var
|
|
1954
|
+
var React35 = __toESM(require("react"));
|
|
1955
|
+
var import_react19 = require("react");
|
|
1956
|
+
var import_editor_props14 = require("@elementor/editor-props");
|
|
1818
1957
|
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
1819
|
-
var
|
|
1820
|
-
var
|
|
1821
|
-
var isEqualSizes = (propValue,
|
|
1958
|
+
var import_ui28 = require("@elementor/ui");
|
|
1959
|
+
var import_i18n8 = require("@wordpress/i18n");
|
|
1960
|
+
var isEqualSizes = (propValue, items2) => {
|
|
1822
1961
|
const values = Object.values(propValue);
|
|
1823
|
-
if (values.length !==
|
|
1962
|
+
if (values.length !== items2.length) {
|
|
1824
1963
|
return false;
|
|
1825
1964
|
}
|
|
1826
1965
|
const [firstValue, ...restValues] = values;
|
|
@@ -1832,25 +1971,25 @@ function EqualUnequalSizesControl({
|
|
|
1832
1971
|
label,
|
|
1833
1972
|
icon,
|
|
1834
1973
|
tooltipLabel,
|
|
1835
|
-
items,
|
|
1974
|
+
items: items2,
|
|
1836
1975
|
multiSizePropTypeUtil
|
|
1837
1976
|
}) {
|
|
1838
|
-
const popupId = (0,
|
|
1839
|
-
const popupState = (0,
|
|
1977
|
+
const popupId = (0, import_react19.useId)();
|
|
1978
|
+
const popupState = (0, import_ui28.usePopupState)({ variant: "popover", popupId });
|
|
1840
1979
|
const {
|
|
1841
1980
|
propType: multiSizePropType,
|
|
1842
1981
|
value: multiSizeValue,
|
|
1843
1982
|
setValue: setMultiSizeValue,
|
|
1844
1983
|
disabled: multiSizeDisabled
|
|
1845
1984
|
} = useBoundProp(multiSizePropTypeUtil);
|
|
1846
|
-
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(
|
|
1847
|
-
const rowRefs = [(0,
|
|
1985
|
+
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(import_editor_props14.sizePropTypeUtil);
|
|
1986
|
+
const rowRefs = [(0, import_react19.useRef)(null), (0, import_react19.useRef)(null)];
|
|
1848
1987
|
const splitEqualValue = () => {
|
|
1849
1988
|
if (!sizeValue) {
|
|
1850
1989
|
return null;
|
|
1851
1990
|
}
|
|
1852
|
-
return
|
|
1853
|
-
(acc, { bind }) => ({ ...acc, [bind]:
|
|
1991
|
+
return items2.reduce(
|
|
1992
|
+
(acc, { bind }) => ({ ...acc, [bind]: import_editor_props14.sizePropTypeUtil.create(sizeValue) }),
|
|
1854
1993
|
{}
|
|
1855
1994
|
);
|
|
1856
1995
|
};
|
|
@@ -1859,7 +1998,7 @@ function EqualUnequalSizesControl({
|
|
|
1859
1998
|
...multiSizeValue ?? splitEqualValue(),
|
|
1860
1999
|
...newValue
|
|
1861
2000
|
};
|
|
1862
|
-
const isEqual = isEqualSizes(newMappedValues,
|
|
2001
|
+
const isEqual = isEqualSizes(newMappedValues, items2);
|
|
1863
2002
|
if (isEqual) {
|
|
1864
2003
|
return setSizeValue(Object.values(newMappedValues)[0]?.value);
|
|
1865
2004
|
}
|
|
@@ -1873,25 +2012,25 @@ function EqualUnequalSizesControl({
|
|
|
1873
2012
|
};
|
|
1874
2013
|
const isShowingGeneralIndicator = !(0, import_editor_v1_adapters2.isExperimentActive)("e_v_3_30") || !popupState.isOpen;
|
|
1875
2014
|
const isMixed = !!multiSizeValue;
|
|
1876
|
-
return /* @__PURE__ */
|
|
2015
|
+
return /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(import_ui28.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: rowRefs[0] }, /* @__PURE__ */ React35.createElement(import_ui28.Grid, { item: true, xs: 6 }, !isShowingGeneralIndicator ? /* @__PURE__ */ React35.createElement(ControlFormLabel, null, label) : /* @__PURE__ */ React35.createElement(ControlLabel, null, label)), /* @__PURE__ */ React35.createElement(import_ui28.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(import_ui28.Stack, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React35.createElement(
|
|
1877
2016
|
SizeControl,
|
|
1878
2017
|
{
|
|
1879
|
-
placeholder: isMixed ? (0,
|
|
2018
|
+
placeholder: isMixed ? (0, import_i18n8.__)("Mixed", "elementor") : void 0,
|
|
1880
2019
|
anchorRef: rowRefs[0]
|
|
1881
2020
|
}
|
|
1882
|
-
), /* @__PURE__ */
|
|
1883
|
-
|
|
2021
|
+
), /* @__PURE__ */ React35.createElement(import_ui28.Tooltip, { title: tooltipLabel, placement: "top" }, /* @__PURE__ */ React35.createElement(
|
|
2022
|
+
import_ui28.ToggleButton,
|
|
1884
2023
|
{
|
|
1885
2024
|
size: "tiny",
|
|
1886
2025
|
value: "check",
|
|
1887
2026
|
sx: { marginLeft: "auto" },
|
|
1888
|
-
...(0,
|
|
2027
|
+
...(0, import_ui28.bindToggle)(popupState),
|
|
1889
2028
|
selected: popupState.isOpen,
|
|
1890
2029
|
"aria-label": tooltipLabel
|
|
1891
2030
|
},
|
|
1892
2031
|
icon
|
|
1893
|
-
))))), /* @__PURE__ */
|
|
1894
|
-
|
|
2032
|
+
))))), /* @__PURE__ */ React35.createElement(
|
|
2033
|
+
import_ui28.Popover,
|
|
1895
2034
|
{
|
|
1896
2035
|
disablePortal: true,
|
|
1897
2036
|
disableScrollLock: true,
|
|
@@ -1903,12 +2042,12 @@ function EqualUnequalSizesControl({
|
|
|
1903
2042
|
vertical: "top",
|
|
1904
2043
|
horizontal: "right"
|
|
1905
2044
|
},
|
|
1906
|
-
...(0,
|
|
2045
|
+
...(0, import_ui28.bindPopover)(popupState),
|
|
1907
2046
|
slotProps: {
|
|
1908
2047
|
paper: { sx: { mt: 0.5, width: rowRefs[0].current?.getBoundingClientRect().width } }
|
|
1909
2048
|
}
|
|
1910
2049
|
},
|
|
1911
|
-
/* @__PURE__ */
|
|
2050
|
+
/* @__PURE__ */ React35.createElement(
|
|
1912
2051
|
PropProvider,
|
|
1913
2052
|
{
|
|
1914
2053
|
propType: multiSizePropType,
|
|
@@ -1916,37 +2055,37 @@ function EqualUnequalSizesControl({
|
|
|
1916
2055
|
setValue: setNestedProp,
|
|
1917
2056
|
isDisabled: () => multiSizeDisabled
|
|
1918
2057
|
},
|
|
1919
|
-
/* @__PURE__ */
|
|
2058
|
+
/* @__PURE__ */ React35.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React35.createElement(PopoverGridContainer, { ref: rowRefs[1] }, /* @__PURE__ */ React35.createElement(MultiSizeValueControl, { item: items2[0], rowRef: rowRefs[1] }), /* @__PURE__ */ React35.createElement(MultiSizeValueControl, { item: items2[1], rowRef: rowRefs[1] })), /* @__PURE__ */ React35.createElement(PopoverGridContainer, { ref: rowRefs[2] }, /* @__PURE__ */ React35.createElement(MultiSizeValueControl, { item: items2[2], rowRef: rowRefs[2] }), /* @__PURE__ */ React35.createElement(MultiSizeValueControl, { item: items2[3], rowRef: rowRefs[2] })))
|
|
1920
2059
|
)
|
|
1921
2060
|
));
|
|
1922
2061
|
}
|
|
1923
2062
|
var MultiSizeValueControl = ({ item, rowRef }) => {
|
|
1924
2063
|
const isUsingNestedProps = (0, import_editor_v1_adapters2.isExperimentActive)("e_v_3_30");
|
|
1925
|
-
return /* @__PURE__ */
|
|
2064
|
+
return /* @__PURE__ */ React35.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React35.createElement(import_ui28.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(import_ui28.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React35.createElement(import_ui28.Grid, { item: true, xs: 12 }, isUsingNestedProps ? /* @__PURE__ */ React35.createElement(ControlLabel, null, item.label) : /* @__PURE__ */ React35.createElement(ControlFormLabel, null, item.label)), /* @__PURE__ */ React35.createElement(import_ui28.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(SizeControl, { startIcon: item.icon, anchorRef: rowRef })))));
|
|
1926
2065
|
};
|
|
1927
2066
|
|
|
1928
2067
|
// src/controls/linked-dimensions-control.tsx
|
|
1929
|
-
var
|
|
1930
|
-
var
|
|
1931
|
-
var
|
|
2068
|
+
var React36 = __toESM(require("react"));
|
|
2069
|
+
var import_react20 = require("react");
|
|
2070
|
+
var import_editor_props15 = require("@elementor/editor-props");
|
|
1932
2071
|
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
1933
2072
|
var import_icons6 = require("@elementor/icons");
|
|
1934
|
-
var
|
|
1935
|
-
var
|
|
2073
|
+
var import_ui29 = require("@elementor/ui");
|
|
2074
|
+
var import_i18n9 = require("@wordpress/i18n");
|
|
1936
2075
|
var LinkedDimensionsControl = createControl(
|
|
1937
2076
|
({
|
|
1938
2077
|
label,
|
|
1939
2078
|
isSiteRtl = false,
|
|
1940
2079
|
extendedOptions
|
|
1941
2080
|
}) => {
|
|
1942
|
-
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(
|
|
1943
|
-
const gridRowRefs = [(0,
|
|
2081
|
+
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(import_editor_props15.sizePropTypeUtil);
|
|
2082
|
+
const gridRowRefs = [(0, import_react20.useRef)(null), (0, import_react20.useRef)(null)];
|
|
1944
2083
|
const {
|
|
1945
2084
|
value: dimensionsValue,
|
|
1946
2085
|
setValue: setDimensionsValue,
|
|
1947
2086
|
propType,
|
|
1948
2087
|
disabled: dimensionsDisabled
|
|
1949
|
-
} = useBoundProp(
|
|
2088
|
+
} = useBoundProp(import_editor_props15.dimensionsPropTypeUtil);
|
|
1950
2089
|
const isLinked = !dimensionsValue && !sizeValue ? true : !!sizeValue;
|
|
1951
2090
|
const isUsingNestedProps = (0, import_editor_v1_adapters3.isExperimentActive)("e_v_3_30");
|
|
1952
2091
|
const onLinkToggle = () => {
|
|
@@ -1954,7 +2093,7 @@ var LinkedDimensionsControl = createControl(
|
|
|
1954
2093
|
setSizeValue(dimensionsValue["block-start"]?.value ?? null);
|
|
1955
2094
|
return;
|
|
1956
2095
|
}
|
|
1957
|
-
const value = sizeValue ?
|
|
2096
|
+
const value = sizeValue ? import_editor_props15.sizePropTypeUtil.create(sizeValue) : null;
|
|
1958
2097
|
setDimensionsValue({
|
|
1959
2098
|
"block-start": value,
|
|
1960
2099
|
"block-end": value,
|
|
@@ -1964,10 +2103,10 @@ var LinkedDimensionsControl = createControl(
|
|
|
1964
2103
|
};
|
|
1965
2104
|
const tooltipLabel = label.toLowerCase();
|
|
1966
2105
|
const LinkedIcon = isLinked ? import_icons6.LinkIcon : import_icons6.DetachIcon;
|
|
1967
|
-
const linkedLabel = (0,
|
|
1968
|
-
const unlinkedLabel = (0,
|
|
2106
|
+
const linkedLabel = (0, import_i18n9.__)("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
2107
|
+
const unlinkedLabel = (0, import_i18n9.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
1969
2108
|
const disabled = sizeDisabled || dimensionsDisabled;
|
|
1970
|
-
return /* @__PURE__ */
|
|
2109
|
+
return /* @__PURE__ */ React36.createElement(
|
|
1971
2110
|
PropProvider,
|
|
1972
2111
|
{
|
|
1973
2112
|
propType,
|
|
@@ -1975,8 +2114,8 @@ var LinkedDimensionsControl = createControl(
|
|
|
1975
2114
|
setValue: setDimensionsValue,
|
|
1976
2115
|
isDisabled: () => disabled
|
|
1977
2116
|
},
|
|
1978
|
-
/* @__PURE__ */
|
|
1979
|
-
|
|
2117
|
+
/* @__PURE__ */ React36.createElement(import_ui29.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, isUsingNestedProps ? /* @__PURE__ */ React36.createElement(ControlFormLabel, null, label) : /* @__PURE__ */ React36.createElement(ControlLabel, null, label), /* @__PURE__ */ React36.createElement(import_ui29.Tooltip, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React36.createElement(
|
|
2118
|
+
import_ui29.ToggleButton,
|
|
1980
2119
|
{
|
|
1981
2120
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
1982
2121
|
size: "tiny",
|
|
@@ -1986,9 +2125,9 @@ var LinkedDimensionsControl = createControl(
|
|
|
1986
2125
|
onChange: onLinkToggle,
|
|
1987
2126
|
disabled
|
|
1988
2127
|
},
|
|
1989
|
-
/* @__PURE__ */
|
|
2128
|
+
/* @__PURE__ */ React36.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1990
2129
|
))),
|
|
1991
|
-
getCssMarginProps(isSiteRtl).map((row, index) => /* @__PURE__ */
|
|
2130
|
+
getCssMarginProps(isSiteRtl).map((row, index) => /* @__PURE__ */ React36.createElement(import_ui29.Stack, { direction: "row", gap: 2, flexWrap: "nowrap", key: index, ref: gridRowRefs[index] }, row.map(({ icon, ...props }) => /* @__PURE__ */ React36.createElement(import_ui29.Grid, { container: true, gap: 0.75, alignItems: "center", key: props.bind }, /* @__PURE__ */ React36.createElement(import_ui29.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(Label, { ...props })), /* @__PURE__ */ React36.createElement(import_ui29.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(
|
|
1992
2131
|
Control3,
|
|
1993
2132
|
{
|
|
1994
2133
|
bind: props.bind,
|
|
@@ -2009,60 +2148,60 @@ var Control3 = ({
|
|
|
2009
2148
|
anchorRef
|
|
2010
2149
|
}) => {
|
|
2011
2150
|
if (isLinked) {
|
|
2012
|
-
return /* @__PURE__ */
|
|
2151
|
+
return /* @__PURE__ */ React36.createElement(SizeControl, { startIcon, extendedOptions, anchorRef });
|
|
2013
2152
|
}
|
|
2014
|
-
return /* @__PURE__ */
|
|
2153
|
+
return /* @__PURE__ */ React36.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React36.createElement(SizeControl, { startIcon, extendedOptions, anchorRef }));
|
|
2015
2154
|
};
|
|
2016
2155
|
var Label = ({ label, bind }) => {
|
|
2017
2156
|
const isUsingNestedProps = (0, import_editor_v1_adapters3.isExperimentActive)("e_v_3_30");
|
|
2018
2157
|
if (!isUsingNestedProps) {
|
|
2019
|
-
return /* @__PURE__ */
|
|
2158
|
+
return /* @__PURE__ */ React36.createElement(ControlFormLabel, null, label);
|
|
2020
2159
|
}
|
|
2021
|
-
return /* @__PURE__ */
|
|
2160
|
+
return /* @__PURE__ */ React36.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React36.createElement(ControlLabel, null, label));
|
|
2022
2161
|
};
|
|
2023
2162
|
function getCssMarginProps(isSiteRtl) {
|
|
2024
2163
|
return [
|
|
2025
2164
|
[
|
|
2026
2165
|
{
|
|
2027
2166
|
bind: "block-start",
|
|
2028
|
-
label: (0,
|
|
2029
|
-
icon: /* @__PURE__ */
|
|
2167
|
+
label: (0, import_i18n9.__)("Top", "elementor"),
|
|
2168
|
+
icon: /* @__PURE__ */ React36.createElement(import_icons6.SideTopIcon, { fontSize: "tiny" })
|
|
2030
2169
|
},
|
|
2031
2170
|
{
|
|
2032
2171
|
bind: "inline-end",
|
|
2033
|
-
label: isSiteRtl ? (0,
|
|
2034
|
-
icon: isSiteRtl ? /* @__PURE__ */
|
|
2172
|
+
label: isSiteRtl ? (0, import_i18n9.__)("Left", "elementor") : (0, import_i18n9.__)("Right", "elementor"),
|
|
2173
|
+
icon: isSiteRtl ? /* @__PURE__ */ React36.createElement(import_icons6.SideLeftIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React36.createElement(import_icons6.SideRightIcon, { fontSize: "tiny" })
|
|
2035
2174
|
}
|
|
2036
2175
|
],
|
|
2037
2176
|
[
|
|
2038
2177
|
{
|
|
2039
2178
|
bind: "block-end",
|
|
2040
|
-
label: (0,
|
|
2041
|
-
icon: /* @__PURE__ */
|
|
2179
|
+
label: (0, import_i18n9.__)("Bottom", "elementor"),
|
|
2180
|
+
icon: /* @__PURE__ */ React36.createElement(import_icons6.SideBottomIcon, { fontSize: "tiny" })
|
|
2042
2181
|
},
|
|
2043
2182
|
{
|
|
2044
2183
|
bind: "inline-start",
|
|
2045
|
-
label: isSiteRtl ? (0,
|
|
2046
|
-
icon: isSiteRtl ? /* @__PURE__ */
|
|
2184
|
+
label: isSiteRtl ? (0, import_i18n9.__)("Right", "elementor") : (0, import_i18n9.__)("Left", "elementor"),
|
|
2185
|
+
icon: isSiteRtl ? /* @__PURE__ */ React36.createElement(import_icons6.SideRightIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React36.createElement(import_icons6.SideLeftIcon, { fontSize: "tiny" })
|
|
2047
2186
|
}
|
|
2048
2187
|
]
|
|
2049
2188
|
];
|
|
2050
2189
|
}
|
|
2051
2190
|
|
|
2052
2191
|
// src/controls/font-family-control/font-family-control.tsx
|
|
2053
|
-
var
|
|
2054
|
-
var
|
|
2192
|
+
var React38 = __toESM(require("react"));
|
|
2193
|
+
var import_editor_props16 = require("@elementor/editor-props");
|
|
2055
2194
|
var import_icons8 = require("@elementor/icons");
|
|
2056
|
-
var
|
|
2195
|
+
var import_ui31 = require("@elementor/ui");
|
|
2057
2196
|
|
|
2058
2197
|
// src/components/font-family-selector.tsx
|
|
2059
|
-
var
|
|
2060
|
-
var
|
|
2198
|
+
var React37 = __toESM(require("react"));
|
|
2199
|
+
var import_react21 = require("react");
|
|
2061
2200
|
var import_editor_ui4 = require("@elementor/editor-ui");
|
|
2062
2201
|
var import_icons7 = require("@elementor/icons");
|
|
2063
|
-
var
|
|
2202
|
+
var import_ui30 = require("@elementor/ui");
|
|
2064
2203
|
var import_utils2 = require("@elementor/utils");
|
|
2065
|
-
var
|
|
2204
|
+
var import_i18n10 = require("@wordpress/i18n");
|
|
2066
2205
|
|
|
2067
2206
|
// src/controls/font-family-control/enqueue-font.tsx
|
|
2068
2207
|
var enqueueFont = (fontFamily, context = "editor") => {
|
|
@@ -2095,7 +2234,7 @@ var FontFamilySelector = ({
|
|
|
2095
2234
|
onClose,
|
|
2096
2235
|
sectionWidth
|
|
2097
2236
|
}) => {
|
|
2098
|
-
const [searchValue, setSearchValue] = (0,
|
|
2237
|
+
const [searchValue, setSearchValue] = (0, import_react21.useState)("");
|
|
2099
2238
|
const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
|
|
2100
2239
|
const handleSearch = (value) => {
|
|
2101
2240
|
setSearchValue(value);
|
|
@@ -2104,21 +2243,21 @@ var FontFamilySelector = ({
|
|
|
2104
2243
|
setSearchValue("");
|
|
2105
2244
|
onClose();
|
|
2106
2245
|
};
|
|
2107
|
-
return /* @__PURE__ */
|
|
2246
|
+
return /* @__PURE__ */ React37.createElement(import_editor_ui4.PopoverBody, { width: sectionWidth }, /* @__PURE__ */ React37.createElement(
|
|
2108
2247
|
import_editor_ui4.PopoverHeader,
|
|
2109
2248
|
{
|
|
2110
|
-
title: (0,
|
|
2249
|
+
title: (0, import_i18n10.__)("Font Family", "elementor"),
|
|
2111
2250
|
onClose: handleClose,
|
|
2112
|
-
icon: /* @__PURE__ */
|
|
2251
|
+
icon: /* @__PURE__ */ React37.createElement(import_icons7.TextIcon, { fontSize: SIZE2 })
|
|
2113
2252
|
}
|
|
2114
|
-
), /* @__PURE__ */
|
|
2253
|
+
), /* @__PURE__ */ React37.createElement(
|
|
2115
2254
|
import_editor_ui4.PopoverSearch,
|
|
2116
2255
|
{
|
|
2117
2256
|
value: searchValue,
|
|
2118
2257
|
onSearch: handleSearch,
|
|
2119
|
-
placeholder: (0,
|
|
2258
|
+
placeholder: (0, import_i18n10.__)("Search", "elementor")
|
|
2120
2259
|
}
|
|
2121
|
-
), /* @__PURE__ */
|
|
2260
|
+
), /* @__PURE__ */ React37.createElement(import_ui30.Divider, null), filteredFontFamilies.length > 0 ? /* @__PURE__ */ React37.createElement(
|
|
2122
2261
|
FontList,
|
|
2123
2262
|
{
|
|
2124
2263
|
fontListItems: filteredFontFamilies,
|
|
@@ -2126,8 +2265,8 @@ var FontFamilySelector = ({
|
|
|
2126
2265
|
handleClose,
|
|
2127
2266
|
fontFamily
|
|
2128
2267
|
}
|
|
2129
|
-
) : /* @__PURE__ */
|
|
2130
|
-
|
|
2268
|
+
) : /* @__PURE__ */ React37.createElement(
|
|
2269
|
+
import_ui30.Stack,
|
|
2131
2270
|
{
|
|
2132
2271
|
alignItems: "center",
|
|
2133
2272
|
justifyContent: "center",
|
|
@@ -2136,9 +2275,9 @@ var FontFamilySelector = ({
|
|
|
2136
2275
|
gap: 1.5,
|
|
2137
2276
|
overflow: "hidden"
|
|
2138
2277
|
},
|
|
2139
|
-
/* @__PURE__ */
|
|
2140
|
-
/* @__PURE__ */
|
|
2141
|
-
|
|
2278
|
+
/* @__PURE__ */ React37.createElement(import_icons7.TextIcon, { fontSize: "large" }),
|
|
2279
|
+
/* @__PURE__ */ React37.createElement(import_ui30.Box, { sx: { maxWidth: 160, overflow: "hidden" } }, /* @__PURE__ */ React37.createElement(import_ui30.Typography, { align: "center", variant: "subtitle2", color: "text.secondary" }, (0, import_i18n10.__)("Sorry, nothing matched", "elementor")), /* @__PURE__ */ React37.createElement(
|
|
2280
|
+
import_ui30.Typography,
|
|
2142
2281
|
{
|
|
2143
2282
|
variant: "subtitle2",
|
|
2144
2283
|
color: "text.secondary",
|
|
@@ -2148,31 +2287,31 @@ var FontFamilySelector = ({
|
|
|
2148
2287
|
justifyContent: "center"
|
|
2149
2288
|
}
|
|
2150
2289
|
},
|
|
2151
|
-
/* @__PURE__ */
|
|
2152
|
-
/* @__PURE__ */
|
|
2153
|
-
/* @__PURE__ */
|
|
2290
|
+
/* @__PURE__ */ React37.createElement("span", null, "\u201C"),
|
|
2291
|
+
/* @__PURE__ */ React37.createElement("span", { style: { maxWidth: "80%", overflow: "hidden", textOverflow: "ellipsis" } }, searchValue),
|
|
2292
|
+
/* @__PURE__ */ React37.createElement("span", null, "\u201D.")
|
|
2154
2293
|
)),
|
|
2155
|
-
/* @__PURE__ */
|
|
2156
|
-
|
|
2294
|
+
/* @__PURE__ */ React37.createElement(
|
|
2295
|
+
import_ui30.Typography,
|
|
2157
2296
|
{
|
|
2158
2297
|
align: "center",
|
|
2159
2298
|
variant: "caption",
|
|
2160
2299
|
color: "text.secondary",
|
|
2161
2300
|
sx: { display: "flex", flexDirection: "column" }
|
|
2162
2301
|
},
|
|
2163
|
-
(0,
|
|
2164
|
-
/* @__PURE__ */
|
|
2165
|
-
|
|
2302
|
+
(0, import_i18n10.__)("Try something else.", "elementor"),
|
|
2303
|
+
/* @__PURE__ */ React37.createElement(
|
|
2304
|
+
import_ui30.Link,
|
|
2166
2305
|
{
|
|
2167
2306
|
color: "secondary",
|
|
2168
2307
|
variant: "caption",
|
|
2169
2308
|
component: "button",
|
|
2170
2309
|
onClick: () => setSearchValue("")
|
|
2171
2310
|
},
|
|
2172
|
-
(0,
|
|
2311
|
+
(0, import_i18n10.__)("Clear & try again", "elementor")
|
|
2173
2312
|
)
|
|
2174
2313
|
)
|
|
2175
|
-
))
|
|
2314
|
+
));
|
|
2176
2315
|
};
|
|
2177
2316
|
var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
2178
2317
|
const selectedItem = fontListItems.find((item) => item.value === fontFamily);
|
|
@@ -2184,7 +2323,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
2184
2323
|
}
|
|
2185
2324
|
});
|
|
2186
2325
|
}, 100);
|
|
2187
|
-
return /* @__PURE__ */
|
|
2326
|
+
return /* @__PURE__ */ React37.createElement(
|
|
2188
2327
|
import_editor_ui4.PopoverMenuList,
|
|
2189
2328
|
{
|
|
2190
2329
|
items: fontListItems,
|
|
@@ -2198,24 +2337,24 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
2198
2337
|
);
|
|
2199
2338
|
};
|
|
2200
2339
|
var useDebounce = (fn, delay) => {
|
|
2201
|
-
const [debouncedFn] = (0,
|
|
2202
|
-
(0,
|
|
2340
|
+
const [debouncedFn] = (0, import_react21.useState)(() => (0, import_utils2.debounce)(fn, delay));
|
|
2341
|
+
(0, import_react21.useEffect)(() => () => debouncedFn.cancel(), [debouncedFn]);
|
|
2203
2342
|
return debouncedFn;
|
|
2204
2343
|
};
|
|
2205
2344
|
|
|
2206
2345
|
// src/controls/font-family-control/font-family-control.tsx
|
|
2207
2346
|
var SIZE3 = "tiny";
|
|
2208
2347
|
var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
2209
|
-
const { value: fontFamily, setValue: setFontFamily, disabled, placeholder } = useBoundProp(
|
|
2210
|
-
const popoverState = (0,
|
|
2348
|
+
const { value: fontFamily, setValue: setFontFamily, disabled, placeholder } = useBoundProp(import_editor_props16.stringPropTypeUtil);
|
|
2349
|
+
const popoverState = (0, import_ui31.usePopupState)({ variant: "popover" });
|
|
2211
2350
|
const isShowingPlaceholder = !fontFamily && placeholder;
|
|
2212
|
-
return /* @__PURE__ */
|
|
2213
|
-
|
|
2351
|
+
return /* @__PURE__ */ React38.createElement(React38.Fragment, null, /* @__PURE__ */ React38.createElement(ControlActions, null, /* @__PURE__ */ React38.createElement(
|
|
2352
|
+
import_ui31.UnstableTag,
|
|
2214
2353
|
{
|
|
2215
2354
|
variant: "outlined",
|
|
2216
2355
|
label: fontFamily || placeholder,
|
|
2217
|
-
endIcon: /* @__PURE__ */
|
|
2218
|
-
...(0,
|
|
2356
|
+
endIcon: /* @__PURE__ */ React38.createElement(import_icons8.ChevronDownIcon, { fontSize: SIZE3 }),
|
|
2357
|
+
...(0, import_ui31.bindTrigger)(popoverState),
|
|
2219
2358
|
fullWidth: true,
|
|
2220
2359
|
disabled,
|
|
2221
2360
|
sx: isShowingPlaceholder ? {
|
|
@@ -2225,17 +2364,17 @@ var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
|
2225
2364
|
textTransform: "capitalize"
|
|
2226
2365
|
} : void 0
|
|
2227
2366
|
}
|
|
2228
|
-
)), /* @__PURE__ */
|
|
2229
|
-
|
|
2367
|
+
)), /* @__PURE__ */ React38.createElement(
|
|
2368
|
+
import_ui31.Popover,
|
|
2230
2369
|
{
|
|
2231
2370
|
disablePortal: true,
|
|
2232
2371
|
disableScrollLock: true,
|
|
2233
2372
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
2234
2373
|
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
2235
2374
|
sx: { my: 1.5 },
|
|
2236
|
-
...(0,
|
|
2375
|
+
...(0, import_ui31.bindPopover)(popoverState)
|
|
2237
2376
|
},
|
|
2238
|
-
/* @__PURE__ */
|
|
2377
|
+
/* @__PURE__ */ React38.createElement(
|
|
2239
2378
|
FontFamilySelector,
|
|
2240
2379
|
{
|
|
2241
2380
|
fontFamilies,
|
|
@@ -2249,14 +2388,14 @@ var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
|
2249
2388
|
});
|
|
2250
2389
|
|
|
2251
2390
|
// src/controls/url-control.tsx
|
|
2252
|
-
var
|
|
2253
|
-
var
|
|
2254
|
-
var
|
|
2391
|
+
var React39 = __toESM(require("react"));
|
|
2392
|
+
var import_editor_props17 = require("@elementor/editor-props");
|
|
2393
|
+
var import_ui32 = require("@elementor/ui");
|
|
2255
2394
|
var UrlControl = createControl(({ placeholder }) => {
|
|
2256
|
-
const { value, setValue, disabled } = useBoundProp(
|
|
2395
|
+
const { value, setValue, disabled } = useBoundProp(import_editor_props17.urlPropTypeUtil);
|
|
2257
2396
|
const handleChange = (event) => setValue(event.target.value);
|
|
2258
|
-
return /* @__PURE__ */
|
|
2259
|
-
|
|
2397
|
+
return /* @__PURE__ */ React39.createElement(ControlActions, null, /* @__PURE__ */ React39.createElement(
|
|
2398
|
+
import_ui32.TextField,
|
|
2260
2399
|
{
|
|
2261
2400
|
size: "tiny",
|
|
2262
2401
|
fullWidth: true,
|
|
@@ -2269,25 +2408,25 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
2269
2408
|
});
|
|
2270
2409
|
|
|
2271
2410
|
// src/controls/link-control.tsx
|
|
2272
|
-
var
|
|
2273
|
-
var
|
|
2411
|
+
var React42 = __toESM(require("react"));
|
|
2412
|
+
var import_react23 = require("react");
|
|
2274
2413
|
var import_editor_elements = require("@elementor/editor-elements");
|
|
2275
|
-
var
|
|
2414
|
+
var import_editor_props19 = require("@elementor/editor-props");
|
|
2276
2415
|
var import_editor_ui5 = require("@elementor/editor-ui");
|
|
2277
2416
|
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
2278
2417
|
var import_http_client2 = require("@elementor/http-client");
|
|
2279
2418
|
var import_icons10 = require("@elementor/icons");
|
|
2280
2419
|
var import_session = require("@elementor/session");
|
|
2281
|
-
var
|
|
2420
|
+
var import_ui35 = require("@elementor/ui");
|
|
2282
2421
|
var import_utils3 = require("@elementor/utils");
|
|
2283
|
-
var
|
|
2422
|
+
var import_i18n11 = require("@wordpress/i18n");
|
|
2284
2423
|
|
|
2285
2424
|
// src/components/autocomplete.tsx
|
|
2286
|
-
var
|
|
2287
|
-
var
|
|
2425
|
+
var React40 = __toESM(require("react"));
|
|
2426
|
+
var import_react22 = require("react");
|
|
2288
2427
|
var import_icons9 = require("@elementor/icons");
|
|
2289
|
-
var
|
|
2290
|
-
var Autocomplete = (0,
|
|
2428
|
+
var import_ui33 = require("@elementor/ui");
|
|
2429
|
+
var Autocomplete = (0, import_react22.forwardRef)((props, ref) => {
|
|
2291
2430
|
const {
|
|
2292
2431
|
options,
|
|
2293
2432
|
onOptionChange,
|
|
@@ -2303,8 +2442,8 @@ var Autocomplete = (0, import_react21.forwardRef)((props, ref) => {
|
|
|
2303
2442
|
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
2304
2443
|
const isOptionEqualToValue = muiWarningPreventer ? void 0 : () => true;
|
|
2305
2444
|
const isValueFromOptions = typeof value === "number" && !!findMatchingOption(options, value);
|
|
2306
|
-
return /* @__PURE__ */
|
|
2307
|
-
|
|
2445
|
+
return /* @__PURE__ */ React40.createElement(
|
|
2446
|
+
import_ui33.Autocomplete,
|
|
2308
2447
|
{
|
|
2309
2448
|
...restProps,
|
|
2310
2449
|
ref,
|
|
@@ -2321,8 +2460,8 @@ var Autocomplete = (0, import_react21.forwardRef)((props, ref) => {
|
|
|
2321
2460
|
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
2322
2461
|
isOptionEqualToValue,
|
|
2323
2462
|
filterOptions: () => optionKeys,
|
|
2324
|
-
renderOption: (optionProps, optionId) => /* @__PURE__ */
|
|
2325
|
-
renderInput: (params) => /* @__PURE__ */
|
|
2463
|
+
renderOption: (optionProps, optionId) => /* @__PURE__ */ React40.createElement(import_ui33.Box, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
2464
|
+
renderInput: (params) => /* @__PURE__ */ React40.createElement(
|
|
2326
2465
|
TextInput,
|
|
2327
2466
|
{
|
|
2328
2467
|
params,
|
|
@@ -2345,8 +2484,8 @@ var TextInput = ({
|
|
|
2345
2484
|
const onChange = (event) => {
|
|
2346
2485
|
handleChange(event.target.value);
|
|
2347
2486
|
};
|
|
2348
|
-
return /* @__PURE__ */
|
|
2349
|
-
|
|
2487
|
+
return /* @__PURE__ */ React40.createElement(
|
|
2488
|
+
import_ui33.TextField,
|
|
2350
2489
|
{
|
|
2351
2490
|
...params,
|
|
2352
2491
|
placeholder,
|
|
@@ -2358,7 +2497,7 @@ var TextInput = ({
|
|
|
2358
2497
|
},
|
|
2359
2498
|
InputProps: {
|
|
2360
2499
|
...params.InputProps,
|
|
2361
|
-
endAdornment: /* @__PURE__ */
|
|
2500
|
+
endAdornment: /* @__PURE__ */ React40.createElement(ClearButton, { params, allowClear, handleChange })
|
|
2362
2501
|
}
|
|
2363
2502
|
}
|
|
2364
2503
|
);
|
|
@@ -2367,7 +2506,7 @@ var ClearButton = ({
|
|
|
2367
2506
|
allowClear,
|
|
2368
2507
|
handleChange,
|
|
2369
2508
|
params
|
|
2370
|
-
}) => /* @__PURE__ */
|
|
2509
|
+
}) => /* @__PURE__ */ React40.createElement(import_ui33.InputAdornment, { position: "end" }, allowClear && /* @__PURE__ */ React40.createElement(import_ui33.IconButton, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React40.createElement(import_icons9.XIcon, { fontSize: params.size })));
|
|
2371
2510
|
function findMatchingOption(options, optionId = null) {
|
|
2372
2511
|
const formattedOption = (optionId || "").toString();
|
|
2373
2512
|
return options.find(({ id }) => formattedOption === id.toString());
|
|
@@ -2389,16 +2528,16 @@ function _factoryFilter(newValue, options, minInputLength) {
|
|
|
2389
2528
|
}
|
|
2390
2529
|
|
|
2391
2530
|
// src/controls/switch-control.tsx
|
|
2392
|
-
var
|
|
2393
|
-
var
|
|
2394
|
-
var
|
|
2531
|
+
var React41 = __toESM(require("react"));
|
|
2532
|
+
var import_editor_props18 = require("@elementor/editor-props");
|
|
2533
|
+
var import_ui34 = require("@elementor/ui");
|
|
2395
2534
|
var SwitchControl = createControl(() => {
|
|
2396
|
-
const { value, setValue, disabled } = useBoundProp(
|
|
2535
|
+
const { value, setValue, disabled } = useBoundProp(import_editor_props18.booleanPropTypeUtil);
|
|
2397
2536
|
const handleChange = (event) => {
|
|
2398
2537
|
setValue(event.target.checked);
|
|
2399
2538
|
};
|
|
2400
|
-
return /* @__PURE__ */
|
|
2401
|
-
|
|
2539
|
+
return /* @__PURE__ */ React41.createElement("div", { style: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React41.createElement(
|
|
2540
|
+
import_ui34.Switch,
|
|
2402
2541
|
{
|
|
2403
2542
|
checked: !!value,
|
|
2404
2543
|
onChange: handleChange,
|
|
@@ -2414,23 +2553,23 @@ var SwitchControl = createControl(() => {
|
|
|
2414
2553
|
// src/controls/link-control.tsx
|
|
2415
2554
|
var SIZE4 = "tiny";
|
|
2416
2555
|
var learnMoreButton = {
|
|
2417
|
-
label: (0,
|
|
2556
|
+
label: (0, import_i18n11.__)("Learn More", "elementor"),
|
|
2418
2557
|
href: "https://go.elementor.com/element-link-inside-link-infotip"
|
|
2419
2558
|
};
|
|
2420
2559
|
var LinkControl = createControl((props) => {
|
|
2421
|
-
const { value, path, setValue, ...propContext } = useBoundProp(
|
|
2560
|
+
const { value, path, setValue, ...propContext } = useBoundProp(import_editor_props19.linkPropTypeUtil);
|
|
2422
2561
|
const [linkSessionValue, setLinkSessionValue] = (0, import_session.useSessionStorage)(path.join("/"));
|
|
2423
|
-
const [isActive, setIsActive] = (0,
|
|
2562
|
+
const [isActive, setIsActive] = (0, import_react23.useState)(!!value);
|
|
2424
2563
|
const {
|
|
2425
2564
|
allowCustomValues,
|
|
2426
2565
|
queryOptions: { endpoint = "", requestParams = {} },
|
|
2427
2566
|
placeholder,
|
|
2428
2567
|
minInputLength = 2,
|
|
2429
2568
|
context: { elementId },
|
|
2430
|
-
label = (0,
|
|
2569
|
+
label = (0, import_i18n11.__)("Link", "elementor")
|
|
2431
2570
|
} = props || {};
|
|
2432
|
-
const [linkInLinkRestriction, setLinkInLinkRestriction] = (0,
|
|
2433
|
-
const [options, setOptions] = (0,
|
|
2571
|
+
const [linkInLinkRestriction, setLinkInLinkRestriction] = (0, import_react23.useState)((0, import_editor_elements.getLinkInLinkRestriction)(elementId));
|
|
2572
|
+
const [options, setOptions] = (0, import_react23.useState)(
|
|
2434
2573
|
generateFirstLoadedOption(value)
|
|
2435
2574
|
);
|
|
2436
2575
|
const shouldDisableAddingLink = !isActive && linkInLinkRestriction.shouldRestrict;
|
|
@@ -2455,8 +2594,8 @@ var LinkControl = createControl((props) => {
|
|
|
2455
2594
|
const onOptionChange = (newValue) => {
|
|
2456
2595
|
const valueToSave = newValue ? {
|
|
2457
2596
|
...value,
|
|
2458
|
-
destination:
|
|
2459
|
-
label:
|
|
2597
|
+
destination: import_editor_props19.numberPropTypeUtil.create(newValue),
|
|
2598
|
+
label: import_editor_props19.stringPropTypeUtil.create(findMatchingOption(options, newValue)?.label || null)
|
|
2460
2599
|
} : null;
|
|
2461
2600
|
onSaveNewValue(valueToSave);
|
|
2462
2601
|
};
|
|
@@ -2464,8 +2603,8 @@ var LinkControl = createControl((props) => {
|
|
|
2464
2603
|
newValue = newValue?.trim() || "";
|
|
2465
2604
|
const valueToSave = newValue ? {
|
|
2466
2605
|
...value,
|
|
2467
|
-
destination:
|
|
2468
|
-
label:
|
|
2606
|
+
destination: import_editor_props19.urlPropTypeUtil.create(newValue),
|
|
2607
|
+
label: import_editor_props19.stringPropTypeUtil.create("")
|
|
2469
2608
|
} : null;
|
|
2470
2609
|
onSaveNewValue(valueToSave);
|
|
2471
2610
|
updateOptions(newValue);
|
|
@@ -2481,7 +2620,7 @@ var LinkControl = createControl((props) => {
|
|
|
2481
2620
|
}
|
|
2482
2621
|
debounceFetch({ ...requestParams, term: newValue });
|
|
2483
2622
|
};
|
|
2484
|
-
const debounceFetch = (0,
|
|
2623
|
+
const debounceFetch = (0, import_react23.useMemo)(
|
|
2485
2624
|
() => (0, import_utils3.debounce)(
|
|
2486
2625
|
(params) => fetchOptions(endpoint, params).then((newOptions) => {
|
|
2487
2626
|
setOptions(formatOptions(newOptions));
|
|
@@ -2490,8 +2629,8 @@ var LinkControl = createControl((props) => {
|
|
|
2490
2629
|
),
|
|
2491
2630
|
[endpoint]
|
|
2492
2631
|
);
|
|
2493
|
-
return /* @__PURE__ */
|
|
2494
|
-
|
|
2632
|
+
return /* @__PURE__ */ React42.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React42.createElement(import_ui35.Stack, { gap: 1.5 }, /* @__PURE__ */ React42.createElement(
|
|
2633
|
+
import_ui35.Stack,
|
|
2495
2634
|
{
|
|
2496
2635
|
direction: "row",
|
|
2497
2636
|
sx: {
|
|
@@ -2500,17 +2639,17 @@ var LinkControl = createControl((props) => {
|
|
|
2500
2639
|
marginInlineEnd: -0.75
|
|
2501
2640
|
}
|
|
2502
2641
|
},
|
|
2503
|
-
/* @__PURE__ */
|
|
2504
|
-
/* @__PURE__ */
|
|
2642
|
+
/* @__PURE__ */ React42.createElement(ControlFormLabel, null, label),
|
|
2643
|
+
/* @__PURE__ */ React42.createElement(ConditionalInfoTip, { isVisible: !isActive, linkInLinkRestriction }, /* @__PURE__ */ React42.createElement(
|
|
2505
2644
|
ToggleIconControl,
|
|
2506
2645
|
{
|
|
2507
2646
|
disabled: shouldDisableAddingLink,
|
|
2508
2647
|
active: isActive,
|
|
2509
2648
|
onIconClick: onEnabledChange,
|
|
2510
|
-
label: (0,
|
|
2649
|
+
label: (0, import_i18n11.__)("Toggle link", "elementor")
|
|
2511
2650
|
}
|
|
2512
2651
|
))
|
|
2513
|
-
), /* @__PURE__ */
|
|
2652
|
+
), /* @__PURE__ */ React42.createElement(import_ui35.Collapse, { in: isActive, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React42.createElement(import_ui35.Stack, { gap: 1.5 }, /* @__PURE__ */ React42.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ React42.createElement(ControlActions, null, /* @__PURE__ */ React42.createElement(
|
|
2514
2653
|
Autocomplete,
|
|
2515
2654
|
{
|
|
2516
2655
|
options,
|
|
@@ -2521,22 +2660,22 @@ var LinkControl = createControl((props) => {
|
|
|
2521
2660
|
onTextChange,
|
|
2522
2661
|
minInputLength
|
|
2523
2662
|
}
|
|
2524
|
-
))), /* @__PURE__ */
|
|
2663
|
+
))), /* @__PURE__ */ React42.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React42.createElement(import_ui35.Grid, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React42.createElement(import_ui35.Grid, { item: true }, /* @__PURE__ */ React42.createElement(ControlFormLabel, null, (0, import_i18n11.__)("Open in a new tab", "elementor"))), /* @__PURE__ */ React42.createElement(import_ui35.Grid, { item: true, sx: { marginInlineEnd: -1 } }, /* @__PURE__ */ React42.createElement(SwitchControlComponent, { disabled: propContext.disabled || !value }))))))));
|
|
2525
2664
|
});
|
|
2526
2665
|
var ToggleIconControl = ({ disabled, active, onIconClick, label }) => {
|
|
2527
|
-
return /* @__PURE__ */
|
|
2666
|
+
return /* @__PURE__ */ React42.createElement(import_ui35.IconButton, { size: SIZE4, onClick: onIconClick, "aria-label": label, disabled }, active ? /* @__PURE__ */ React42.createElement(import_icons10.MinusIcon, { fontSize: SIZE4 }) : /* @__PURE__ */ React42.createElement(import_icons10.PlusIcon, { fontSize: SIZE4 }));
|
|
2528
2667
|
};
|
|
2529
2668
|
var SwitchControlComponent = ({ disabled }) => {
|
|
2530
|
-
const { value, setValue } = useBoundProp(
|
|
2669
|
+
const { value, setValue } = useBoundProp(import_editor_props19.booleanPropTypeUtil);
|
|
2531
2670
|
const isVersion331Active = (0, import_editor_v1_adapters4.isExperimentActive)("e_v_3_31");
|
|
2532
2671
|
if (isVersion331Active) {
|
|
2533
|
-
return /* @__PURE__ */
|
|
2672
|
+
return /* @__PURE__ */ React42.createElement(SwitchControl, null);
|
|
2534
2673
|
}
|
|
2535
2674
|
const onClick = () => {
|
|
2536
2675
|
setValue(!value);
|
|
2537
2676
|
};
|
|
2538
|
-
return /* @__PURE__ */
|
|
2539
|
-
|
|
2677
|
+
return /* @__PURE__ */ React42.createElement(
|
|
2678
|
+
import_ui35.Switch,
|
|
2540
2679
|
{
|
|
2541
2680
|
checked: value ?? false,
|
|
2542
2681
|
onClick,
|
|
@@ -2582,54 +2721,54 @@ var ConditionalInfoTip = ({ linkInLinkRestriction, isVisible, children }) => {
|
|
|
2582
2721
|
(0, import_editor_elements.selectElement)(elementId);
|
|
2583
2722
|
}
|
|
2584
2723
|
};
|
|
2585
|
-
return shouldRestrict && isVisible ? /* @__PURE__ */
|
|
2586
|
-
|
|
2724
|
+
return shouldRestrict && isVisible ? /* @__PURE__ */ React42.createElement(
|
|
2725
|
+
import_ui35.Infotip,
|
|
2587
2726
|
{
|
|
2588
2727
|
placement: "right",
|
|
2589
|
-
content: /* @__PURE__ */
|
|
2728
|
+
content: /* @__PURE__ */ React42.createElement(
|
|
2590
2729
|
import_editor_ui5.InfoTipCard,
|
|
2591
2730
|
{
|
|
2592
2731
|
content: INFOTIP_CONTENT[reason],
|
|
2593
|
-
svgIcon: /* @__PURE__ */
|
|
2732
|
+
svgIcon: /* @__PURE__ */ React42.createElement(import_icons10.AlertTriangleIcon, null),
|
|
2594
2733
|
learnMoreButton,
|
|
2595
2734
|
ctaButton: {
|
|
2596
|
-
label: (0,
|
|
2735
|
+
label: (0, import_i18n11.__)("Take me there", "elementor"),
|
|
2597
2736
|
onClick: handleTakeMeClick
|
|
2598
2737
|
}
|
|
2599
2738
|
}
|
|
2600
2739
|
)
|
|
2601
2740
|
},
|
|
2602
|
-
/* @__PURE__ */
|
|
2603
|
-
) : /* @__PURE__ */
|
|
2741
|
+
/* @__PURE__ */ React42.createElement(import_ui35.Box, null, children)
|
|
2742
|
+
) : /* @__PURE__ */ React42.createElement(React42.Fragment, null, children);
|
|
2604
2743
|
};
|
|
2605
2744
|
var INFOTIP_CONTENT = {
|
|
2606
|
-
descendant: /* @__PURE__ */
|
|
2607
|
-
ancestor: /* @__PURE__ */
|
|
2745
|
+
descendant: /* @__PURE__ */ React42.createElement(React42.Fragment, null, (0, import_i18n11.__)("To add a link to this container,", "elementor"), /* @__PURE__ */ React42.createElement("br", null), (0, import_i18n11.__)("first remove the link from the elements inside of it.", "elementor")),
|
|
2746
|
+
ancestor: /* @__PURE__ */ React42.createElement(React42.Fragment, null, (0, import_i18n11.__)("To add a link to this element,", "elementor"), /* @__PURE__ */ React42.createElement("br", null), (0, import_i18n11.__)("first remove the link from its parent container.", "elementor"))
|
|
2608
2747
|
};
|
|
2609
2748
|
|
|
2610
2749
|
// src/controls/gap-control.tsx
|
|
2611
|
-
var
|
|
2612
|
-
var
|
|
2613
|
-
var
|
|
2750
|
+
var React43 = __toESM(require("react"));
|
|
2751
|
+
var import_react24 = require("react");
|
|
2752
|
+
var import_editor_props20 = require("@elementor/editor-props");
|
|
2614
2753
|
var import_icons11 = require("@elementor/icons");
|
|
2615
|
-
var
|
|
2616
|
-
var
|
|
2754
|
+
var import_ui36 = require("@elementor/ui");
|
|
2755
|
+
var import_i18n12 = require("@wordpress/i18n");
|
|
2617
2756
|
var GapControl = createControl(({ label }) => {
|
|
2618
2757
|
const {
|
|
2619
2758
|
value: directionValue,
|
|
2620
2759
|
setValue: setDirectionValue,
|
|
2621
2760
|
propType,
|
|
2622
2761
|
disabled: directionDisabled
|
|
2623
|
-
} = useBoundProp(
|
|
2624
|
-
const stackRef = (0,
|
|
2625
|
-
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(
|
|
2762
|
+
} = useBoundProp(import_editor_props20.layoutDirectionPropTypeUtil);
|
|
2763
|
+
const stackRef = (0, import_react24.useRef)(null);
|
|
2764
|
+
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(import_editor_props20.sizePropTypeUtil);
|
|
2626
2765
|
const isLinked = !directionValue && !sizeValue ? true : !!sizeValue;
|
|
2627
2766
|
const onLinkToggle = () => {
|
|
2628
2767
|
if (!isLinked) {
|
|
2629
2768
|
setSizeValue(directionValue?.column?.value ?? null);
|
|
2630
2769
|
return;
|
|
2631
2770
|
}
|
|
2632
|
-
const value = sizeValue ?
|
|
2771
|
+
const value = sizeValue ? import_editor_props20.sizePropTypeUtil.create(sizeValue) : null;
|
|
2633
2772
|
setDirectionValue({
|
|
2634
2773
|
row: value,
|
|
2635
2774
|
column: value
|
|
@@ -2637,11 +2776,11 @@ var GapControl = createControl(({ label }) => {
|
|
|
2637
2776
|
};
|
|
2638
2777
|
const tooltipLabel = label.toLowerCase();
|
|
2639
2778
|
const LinkedIcon = isLinked ? import_icons11.LinkIcon : import_icons11.DetachIcon;
|
|
2640
|
-
const linkedLabel = (0,
|
|
2641
|
-
const unlinkedLabel = (0,
|
|
2779
|
+
const linkedLabel = (0, import_i18n12.__)("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
2780
|
+
const unlinkedLabel = (0, import_i18n12.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
2642
2781
|
const disabled = sizeDisabled || directionDisabled;
|
|
2643
|
-
return /* @__PURE__ */
|
|
2644
|
-
|
|
2782
|
+
return /* @__PURE__ */ React43.createElement(PropProvider, { propType, value: directionValue, setValue: setDirectionValue }, /* @__PURE__ */ React43.createElement(import_ui36.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React43.createElement(ControlLabel, null, label), /* @__PURE__ */ React43.createElement(import_ui36.Tooltip, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React43.createElement(
|
|
2783
|
+
import_ui36.ToggleButton,
|
|
2645
2784
|
{
|
|
2646
2785
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
2647
2786
|
size: "tiny",
|
|
@@ -2651,8 +2790,8 @@ var GapControl = createControl(({ label }) => {
|
|
|
2651
2790
|
onChange: onLinkToggle,
|
|
2652
2791
|
disabled
|
|
2653
2792
|
},
|
|
2654
|
-
/* @__PURE__ */
|
|
2655
|
-
))), /* @__PURE__ */
|
|
2793
|
+
/* @__PURE__ */ React43.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
2794
|
+
))), /* @__PURE__ */ React43.createElement(import_ui36.Stack, { direction: "row", gap: 2, flexWrap: "nowrap", ref: stackRef }, /* @__PURE__ */ React43.createElement(import_ui36.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React43.createElement(import_ui36.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React43.createElement(ControlFormLabel, null, (0, import_i18n12.__)("Column", "elementor"))), /* @__PURE__ */ React43.createElement(import_ui36.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React43.createElement(Control4, { bind: "column", isLinked, anchorRef: stackRef }))), /* @__PURE__ */ React43.createElement(import_ui36.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React43.createElement(import_ui36.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React43.createElement(ControlFormLabel, null, (0, import_i18n12.__)("Row", "elementor"))), /* @__PURE__ */ React43.createElement(import_ui36.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React43.createElement(Control4, { bind: "row", isLinked, anchorRef: stackRef })))));
|
|
2656
2795
|
});
|
|
2657
2796
|
var Control4 = ({
|
|
2658
2797
|
bind,
|
|
@@ -2660,21 +2799,21 @@ var Control4 = ({
|
|
|
2660
2799
|
anchorRef
|
|
2661
2800
|
}) => {
|
|
2662
2801
|
if (isLinked) {
|
|
2663
|
-
return /* @__PURE__ */
|
|
2802
|
+
return /* @__PURE__ */ React43.createElement(SizeControl, { anchorRef });
|
|
2664
2803
|
}
|
|
2665
|
-
return /* @__PURE__ */
|
|
2804
|
+
return /* @__PURE__ */ React43.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React43.createElement(SizeControl, { anchorRef }));
|
|
2666
2805
|
};
|
|
2667
2806
|
|
|
2668
2807
|
// src/controls/aspect-ratio-control.tsx
|
|
2669
|
-
var
|
|
2670
|
-
var
|
|
2671
|
-
var
|
|
2808
|
+
var React44 = __toESM(require("react"));
|
|
2809
|
+
var import_react25 = require("react");
|
|
2810
|
+
var import_editor_props21 = require("@elementor/editor-props");
|
|
2672
2811
|
var import_editor_ui6 = require("@elementor/editor-ui");
|
|
2673
2812
|
var import_icons12 = require("@elementor/icons");
|
|
2674
|
-
var
|
|
2675
|
-
var
|
|
2813
|
+
var import_ui37 = require("@elementor/ui");
|
|
2814
|
+
var import_i18n13 = require("@wordpress/i18n");
|
|
2676
2815
|
var RATIO_OPTIONS = [
|
|
2677
|
-
{ label: (0,
|
|
2816
|
+
{ label: (0, import_i18n13.__)("Auto", "elementor"), value: "auto" },
|
|
2678
2817
|
{ label: "1/1", value: "1/1" },
|
|
2679
2818
|
{ label: "4/3", value: "4/3" },
|
|
2680
2819
|
{ label: "3/4", value: "3/4" },
|
|
@@ -2685,16 +2824,16 @@ var RATIO_OPTIONS = [
|
|
|
2685
2824
|
];
|
|
2686
2825
|
var CUSTOM_RATIO = "custom";
|
|
2687
2826
|
var AspectRatioControl = createControl(({ label }) => {
|
|
2688
|
-
const { value: aspectRatioValue, setValue: setAspectRatioValue, disabled } = useBoundProp(
|
|
2827
|
+
const { value: aspectRatioValue, setValue: setAspectRatioValue, disabled } = useBoundProp(import_editor_props21.stringPropTypeUtil);
|
|
2689
2828
|
const isCustomSelected = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
2690
2829
|
const [initialWidth, initialHeight] = isCustomSelected ? aspectRatioValue.split("/") : ["", ""];
|
|
2691
|
-
const [isCustom, setIsCustom] = (0,
|
|
2692
|
-
const [customWidth, setCustomWidth] = (0,
|
|
2693
|
-
const [customHeight, setCustomHeight] = (0,
|
|
2694
|
-
const [selectedValue, setSelectedValue] = (0,
|
|
2830
|
+
const [isCustom, setIsCustom] = (0, import_react25.useState)(isCustomSelected);
|
|
2831
|
+
const [customWidth, setCustomWidth] = (0, import_react25.useState)(initialWidth);
|
|
2832
|
+
const [customHeight, setCustomHeight] = (0, import_react25.useState)(initialHeight);
|
|
2833
|
+
const [selectedValue, setSelectedValue] = (0, import_react25.useState)(
|
|
2695
2834
|
isCustomSelected ? CUSTOM_RATIO : aspectRatioValue || ""
|
|
2696
2835
|
);
|
|
2697
|
-
(0,
|
|
2836
|
+
(0, import_react25.useEffect)(() => {
|
|
2698
2837
|
const isCustomValue = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
2699
2838
|
if (isCustomValue) {
|
|
2700
2839
|
const [width, height] = aspectRatioValue.split("/");
|
|
@@ -2733,8 +2872,8 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2733
2872
|
setAspectRatioValue(`${customWidth}/${newHeight}`);
|
|
2734
2873
|
}
|
|
2735
2874
|
};
|
|
2736
|
-
return /* @__PURE__ */
|
|
2737
|
-
|
|
2875
|
+
return /* @__PURE__ */ React44.createElement(ControlActions, null, /* @__PURE__ */ React44.createElement(import_ui37.Stack, { direction: "column", gap: 2 }, /* @__PURE__ */ React44.createElement(import_ui37.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React44.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(ControlLabel, null, label)), /* @__PURE__ */ React44.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(
|
|
2876
|
+
import_ui37.Select,
|
|
2738
2877
|
{
|
|
2739
2878
|
size: "tiny",
|
|
2740
2879
|
displayEmpty: true,
|
|
@@ -2744,11 +2883,11 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2744
2883
|
onChange: handleSelectChange,
|
|
2745
2884
|
fullWidth: true
|
|
2746
2885
|
},
|
|
2747
|
-
[...RATIO_OPTIONS, { label: (0,
|
|
2748
|
-
({ label: optionLabel, ...props }) => /* @__PURE__ */
|
|
2886
|
+
[...RATIO_OPTIONS, { label: (0, import_i18n13.__)("Custom", "elementor"), value: CUSTOM_RATIO }].map(
|
|
2887
|
+
({ label: optionLabel, ...props }) => /* @__PURE__ */ React44.createElement(import_editor_ui6.MenuListItem, { key: props.value, ...props, value: props.value ?? "" }, optionLabel)
|
|
2749
2888
|
)
|
|
2750
|
-
))), isCustom && /* @__PURE__ */
|
|
2751
|
-
|
|
2889
|
+
))), isCustom && /* @__PURE__ */ React44.createElement(import_ui37.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React44.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(
|
|
2890
|
+
import_ui37.TextField,
|
|
2752
2891
|
{
|
|
2753
2892
|
size: "tiny",
|
|
2754
2893
|
type: "number",
|
|
@@ -2757,11 +2896,11 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2757
2896
|
value: customWidth,
|
|
2758
2897
|
onChange: handleCustomWidthChange,
|
|
2759
2898
|
InputProps: {
|
|
2760
|
-
startAdornment: /* @__PURE__ */
|
|
2899
|
+
startAdornment: /* @__PURE__ */ React44.createElement(import_icons12.ArrowsMoveHorizontalIcon, { fontSize: "tiny" })
|
|
2761
2900
|
}
|
|
2762
2901
|
}
|
|
2763
|
-
)), /* @__PURE__ */
|
|
2764
|
-
|
|
2902
|
+
)), /* @__PURE__ */ React44.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(
|
|
2903
|
+
import_ui37.TextField,
|
|
2765
2904
|
{
|
|
2766
2905
|
size: "tiny",
|
|
2767
2906
|
type: "number",
|
|
@@ -2770,39 +2909,39 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2770
2909
|
value: customHeight,
|
|
2771
2910
|
onChange: handleCustomHeightChange,
|
|
2772
2911
|
InputProps: {
|
|
2773
|
-
startAdornment: /* @__PURE__ */
|
|
2912
|
+
startAdornment: /* @__PURE__ */ React44.createElement(import_icons12.ArrowsMoveVerticalIcon, { fontSize: "tiny" })
|
|
2774
2913
|
}
|
|
2775
2914
|
}
|
|
2776
2915
|
)))));
|
|
2777
2916
|
});
|
|
2778
2917
|
|
|
2779
2918
|
// src/controls/svg-media-control.tsx
|
|
2780
|
-
var
|
|
2781
|
-
var
|
|
2782
|
-
var
|
|
2919
|
+
var React46 = __toESM(require("react"));
|
|
2920
|
+
var import_react27 = require("react");
|
|
2921
|
+
var import_editor_props22 = require("@elementor/editor-props");
|
|
2783
2922
|
var import_icons13 = require("@elementor/icons");
|
|
2784
|
-
var
|
|
2923
|
+
var import_ui39 = require("@elementor/ui");
|
|
2785
2924
|
var import_wp_media2 = require("@elementor/wp-media");
|
|
2786
|
-
var
|
|
2925
|
+
var import_i18n15 = require("@wordpress/i18n");
|
|
2787
2926
|
|
|
2788
2927
|
// src/components/enable-unfiltered-modal.tsx
|
|
2789
|
-
var
|
|
2790
|
-
var
|
|
2928
|
+
var React45 = __toESM(require("react"));
|
|
2929
|
+
var import_react26 = require("react");
|
|
2791
2930
|
var import_editor_current_user = require("@elementor/editor-current-user");
|
|
2792
|
-
var
|
|
2793
|
-
var
|
|
2794
|
-
var ADMIN_TITLE_TEXT = (0,
|
|
2795
|
-
var ADMIN_CONTENT_TEXT = (0,
|
|
2931
|
+
var import_ui38 = require("@elementor/ui");
|
|
2932
|
+
var import_i18n14 = require("@wordpress/i18n");
|
|
2933
|
+
var ADMIN_TITLE_TEXT = (0, import_i18n14.__)("Enable Unfiltered Uploads", "elementor");
|
|
2934
|
+
var ADMIN_CONTENT_TEXT = (0, import_i18n14.__)(
|
|
2796
2935
|
"Before you enable unfiltered files upload, note that such files include a security risk. Elementor does run a process to remove possible malicious code, but there is still risk involved when using such files.",
|
|
2797
2936
|
"elementor"
|
|
2798
2937
|
);
|
|
2799
|
-
var NON_ADMIN_TITLE_TEXT = (0,
|
|
2800
|
-
var NON_ADMIN_CONTENT_TEXT = (0,
|
|
2938
|
+
var NON_ADMIN_TITLE_TEXT = (0, import_i18n14.__)("Sorry, you can't upload that file yet", "elementor");
|
|
2939
|
+
var NON_ADMIN_CONTENT_TEXT = (0, import_i18n14.__)(
|
|
2801
2940
|
"This is because this file type may pose a security risk. To upload them anyway, ask the site administrator to enable unfiltered file uploads.",
|
|
2802
2941
|
"elementor"
|
|
2803
2942
|
);
|
|
2804
|
-
var ADMIN_FAILED_CONTENT_TEXT_PT1 = (0,
|
|
2805
|
-
var ADMIN_FAILED_CONTENT_TEXT_PT2 = (0,
|
|
2943
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT1 = (0, import_i18n14.__)("Failed to enable unfiltered files upload.", "elementor");
|
|
2944
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT2 = (0, import_i18n14.__)(
|
|
2806
2945
|
"You can try again, if the problem persists, please contact support.",
|
|
2807
2946
|
"elementor"
|
|
2808
2947
|
);
|
|
@@ -2810,7 +2949,7 @@ var WAIT_FOR_CLOSE_TIMEOUT_MS = 300;
|
|
|
2810
2949
|
var EnableUnfilteredModal = (props) => {
|
|
2811
2950
|
const { mutateAsync, isPending } = useUpdateUnfilteredFilesUpload();
|
|
2812
2951
|
const { canUser } = (0, import_editor_current_user.useCurrentUserCapabilities)();
|
|
2813
|
-
const [isError, setIsError] = (0,
|
|
2952
|
+
const [isError, setIsError] = (0, import_react26.useState)(false);
|
|
2814
2953
|
const canManageOptions = canUser("manage_options");
|
|
2815
2954
|
const onClose = (enabled) => {
|
|
2816
2955
|
props.onClose(enabled);
|
|
@@ -2829,10 +2968,10 @@ var EnableUnfilteredModal = (props) => {
|
|
|
2829
2968
|
}
|
|
2830
2969
|
};
|
|
2831
2970
|
const dialogProps = { ...props, isPending, handleEnable, isError, onClose };
|
|
2832
|
-
return canManageOptions ? /* @__PURE__ */
|
|
2971
|
+
return canManageOptions ? /* @__PURE__ */ React45.createElement(AdminDialog, { ...dialogProps }) : /* @__PURE__ */ React45.createElement(NonAdminDialog, { ...dialogProps });
|
|
2833
2972
|
};
|
|
2834
|
-
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */
|
|
2835
|
-
|
|
2973
|
+
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */ React45.createElement(import_ui38.Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React45.createElement(import_ui38.DialogHeader, { logo: false }, /* @__PURE__ */ React45.createElement(import_ui38.DialogTitle, null, ADMIN_TITLE_TEXT)), /* @__PURE__ */ React45.createElement(import_ui38.Divider, null), /* @__PURE__ */ React45.createElement(import_ui38.DialogContent, null, /* @__PURE__ */ React45.createElement(import_ui38.DialogContentText, null, isError ? /* @__PURE__ */ React45.createElement(React45.Fragment, null, ADMIN_FAILED_CONTENT_TEXT_PT1, " ", /* @__PURE__ */ React45.createElement("br", null), " ", ADMIN_FAILED_CONTENT_TEXT_PT2) : ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React45.createElement(import_ui38.DialogActions, null, /* @__PURE__ */ React45.createElement(import_ui38.Button, { size: "medium", color: "secondary", onClick: () => onClose(false) }, (0, import_i18n14.__)("Cancel", "elementor")), /* @__PURE__ */ React45.createElement(
|
|
2974
|
+
import_ui38.Button,
|
|
2836
2975
|
{
|
|
2837
2976
|
size: "medium",
|
|
2838
2977
|
onClick: () => handleEnable(),
|
|
@@ -2840,16 +2979,16 @@ var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @_
|
|
|
2840
2979
|
color: "primary",
|
|
2841
2980
|
disabled: isPending
|
|
2842
2981
|
},
|
|
2843
|
-
isPending ? /* @__PURE__ */
|
|
2982
|
+
isPending ? /* @__PURE__ */ React45.createElement(import_ui38.CircularProgress, { size: 24 }) : (0, import_i18n14.__)("Enable", "elementor")
|
|
2844
2983
|
)));
|
|
2845
|
-
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */
|
|
2984
|
+
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */ React45.createElement(import_ui38.Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React45.createElement(import_ui38.DialogHeader, { logo: false }, /* @__PURE__ */ React45.createElement(import_ui38.DialogTitle, null, NON_ADMIN_TITLE_TEXT)), /* @__PURE__ */ React45.createElement(import_ui38.Divider, null), /* @__PURE__ */ React45.createElement(import_ui38.DialogContent, null, /* @__PURE__ */ React45.createElement(import_ui38.DialogContentText, null, NON_ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React45.createElement(import_ui38.DialogActions, null, /* @__PURE__ */ React45.createElement(import_ui38.Button, { size: "medium", onClick: () => onClose(false), variant: "contained", color: "primary" }, (0, import_i18n14.__)("Got it", "elementor"))));
|
|
2846
2985
|
|
|
2847
2986
|
// src/controls/svg-media-control.tsx
|
|
2848
2987
|
var TILE_SIZE = 8;
|
|
2849
2988
|
var TILE_WHITE = "transparent";
|
|
2850
2989
|
var TILE_BLACK = "#c1c1c1";
|
|
2851
2990
|
var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
|
|
2852
|
-
var StyledCard = (0,
|
|
2991
|
+
var StyledCard = (0, import_ui39.styled)(import_ui39.Card)`
|
|
2853
2992
|
background-color: white;
|
|
2854
2993
|
background-image: ${TILES_GRADIENT_FORMULA}, ${TILES_GRADIENT_FORMULA};
|
|
2855
2994
|
background-size: ${TILE_SIZE}px ${TILE_SIZE}px;
|
|
@@ -2858,7 +2997,7 @@ var StyledCard = (0, import_ui37.styled)(import_ui37.Card)`
|
|
|
2858
2997
|
${TILE_SIZE / 2}px ${TILE_SIZE / 2}px;
|
|
2859
2998
|
border: none;
|
|
2860
2999
|
`;
|
|
2861
|
-
var StyledCardMediaContainer = (0,
|
|
3000
|
+
var StyledCardMediaContainer = (0, import_ui39.styled)(import_ui39.Stack)`
|
|
2862
3001
|
position: relative;
|
|
2863
3002
|
height: 140px;
|
|
2864
3003
|
object-fit: contain;
|
|
@@ -2870,12 +3009,12 @@ var StyledCardMediaContainer = (0, import_ui37.styled)(import_ui37.Stack)`
|
|
|
2870
3009
|
var MODE_BROWSE = { mode: "browse" };
|
|
2871
3010
|
var MODE_UPLOAD = { mode: "upload" };
|
|
2872
3011
|
var SvgMediaControl = createControl(() => {
|
|
2873
|
-
const { value, setValue } = useBoundProp(
|
|
3012
|
+
const { value, setValue } = useBoundProp(import_editor_props22.imageSrcPropTypeUtil);
|
|
2874
3013
|
const { id, url } = value ?? {};
|
|
2875
3014
|
const { data: attachment, isFetching } = (0, import_wp_media2.useWpMediaAttachment)(id?.value || null);
|
|
2876
3015
|
const src = attachment?.url ?? url?.value ?? null;
|
|
2877
3016
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
2878
|
-
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0,
|
|
3017
|
+
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0, import_react27.useState)(false);
|
|
2879
3018
|
const { open } = (0, import_wp_media2.useWpMediaFrame)({
|
|
2880
3019
|
mediaTypes: ["svg"],
|
|
2881
3020
|
multiple: false,
|
|
@@ -2903,16 +3042,16 @@ var SvgMediaControl = createControl(() => {
|
|
|
2903
3042
|
open(openOptions);
|
|
2904
3043
|
}
|
|
2905
3044
|
};
|
|
2906
|
-
return /* @__PURE__ */
|
|
2907
|
-
|
|
3045
|
+
return /* @__PURE__ */ React46.createElement(import_ui39.Stack, { gap: 1 }, /* @__PURE__ */ React46.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: onCloseUnfilteredModal }), /* @__PURE__ */ React46.createElement(ControlActions, null, /* @__PURE__ */ React46.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React46.createElement(StyledCardMediaContainer, null, isFetching ? /* @__PURE__ */ React46.createElement(import_ui39.CircularProgress, { role: "progressbar" }) : /* @__PURE__ */ React46.createElement(
|
|
3046
|
+
import_ui39.CardMedia,
|
|
2908
3047
|
{
|
|
2909
3048
|
component: "img",
|
|
2910
3049
|
image: src,
|
|
2911
|
-
alt: (0,
|
|
3050
|
+
alt: (0, import_i18n15.__)("Preview SVG", "elementor"),
|
|
2912
3051
|
sx: { maxHeight: "140px", width: "50px" }
|
|
2913
3052
|
}
|
|
2914
|
-
)), /* @__PURE__ */
|
|
2915
|
-
|
|
3053
|
+
)), /* @__PURE__ */ React46.createElement(
|
|
3054
|
+
import_ui39.CardOverlay,
|
|
2916
3055
|
{
|
|
2917
3056
|
sx: {
|
|
2918
3057
|
"&:hover": {
|
|
@@ -2920,69 +3059,69 @@ var SvgMediaControl = createControl(() => {
|
|
|
2920
3059
|
}
|
|
2921
3060
|
}
|
|
2922
3061
|
},
|
|
2923
|
-
/* @__PURE__ */
|
|
2924
|
-
|
|
3062
|
+
/* @__PURE__ */ React46.createElement(import_ui39.Stack, { gap: 1 }, /* @__PURE__ */ React46.createElement(
|
|
3063
|
+
import_ui39.Button,
|
|
2925
3064
|
{
|
|
2926
3065
|
size: "tiny",
|
|
2927
3066
|
color: "inherit",
|
|
2928
3067
|
variant: "outlined",
|
|
2929
3068
|
onClick: () => handleClick(MODE_BROWSE)
|
|
2930
3069
|
},
|
|
2931
|
-
(0,
|
|
2932
|
-
), /* @__PURE__ */
|
|
2933
|
-
|
|
3070
|
+
(0, import_i18n15.__)("Select SVG", "elementor")
|
|
3071
|
+
), /* @__PURE__ */ React46.createElement(
|
|
3072
|
+
import_ui39.Button,
|
|
2934
3073
|
{
|
|
2935
3074
|
size: "tiny",
|
|
2936
3075
|
variant: "text",
|
|
2937
3076
|
color: "inherit",
|
|
2938
|
-
startIcon: /* @__PURE__ */
|
|
3077
|
+
startIcon: /* @__PURE__ */ React46.createElement(import_icons13.UploadIcon, null),
|
|
2939
3078
|
onClick: () => handleClick(MODE_UPLOAD)
|
|
2940
3079
|
},
|
|
2941
|
-
(0,
|
|
3080
|
+
(0, import_i18n15.__)("Upload", "elementor")
|
|
2942
3081
|
))
|
|
2943
3082
|
))));
|
|
2944
3083
|
});
|
|
2945
3084
|
|
|
2946
3085
|
// src/controls/background-control/background-control.tsx
|
|
2947
|
-
var
|
|
2948
|
-
var
|
|
3086
|
+
var React53 = __toESM(require("react"));
|
|
3087
|
+
var import_editor_props28 = require("@elementor/editor-props");
|
|
2949
3088
|
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
2950
|
-
var
|
|
2951
|
-
var
|
|
3089
|
+
var import_ui47 = require("@elementor/ui");
|
|
3090
|
+
var import_i18n21 = require("@wordpress/i18n");
|
|
2952
3091
|
|
|
2953
3092
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
2954
|
-
var
|
|
2955
|
-
var
|
|
2956
|
-
var
|
|
3093
|
+
var React52 = __toESM(require("react"));
|
|
3094
|
+
var import_editor_props27 = require("@elementor/editor-props");
|
|
3095
|
+
var import_ui46 = require("@elementor/ui");
|
|
2957
3096
|
var import_wp_media3 = require("@elementor/wp-media");
|
|
2958
|
-
var
|
|
3097
|
+
var import_i18n20 = require("@wordpress/i18n");
|
|
2959
3098
|
|
|
2960
3099
|
// src/env.ts
|
|
2961
3100
|
var import_env = require("@elementor/env");
|
|
2962
3101
|
var { env } = (0, import_env.parseEnv)("@elementor/editor-controls");
|
|
2963
3102
|
|
|
2964
3103
|
// src/controls/background-control/background-gradient-color-control.tsx
|
|
2965
|
-
var
|
|
2966
|
-
var
|
|
2967
|
-
var
|
|
3104
|
+
var React47 = __toESM(require("react"));
|
|
3105
|
+
var import_editor_props23 = require("@elementor/editor-props");
|
|
3106
|
+
var import_ui40 = require("@elementor/ui");
|
|
2968
3107
|
var BackgroundGradientColorControl = createControl(() => {
|
|
2969
|
-
const { value, setValue } = useBoundProp(
|
|
3108
|
+
const { value, setValue } = useBoundProp(import_editor_props23.backgroundGradientOverlayPropTypeUtil);
|
|
2970
3109
|
const handleChange = (newValue) => {
|
|
2971
3110
|
const transformedValue = createTransformableValue(newValue);
|
|
2972
3111
|
if (transformedValue.positions) {
|
|
2973
|
-
transformedValue.positions =
|
|
3112
|
+
transformedValue.positions = import_editor_props23.stringPropTypeUtil.create(newValue.positions.join(" "));
|
|
2974
3113
|
}
|
|
2975
3114
|
setValue(transformedValue);
|
|
2976
3115
|
};
|
|
2977
3116
|
const createTransformableValue = (newValue) => ({
|
|
2978
3117
|
...newValue,
|
|
2979
|
-
type:
|
|
2980
|
-
angle:
|
|
2981
|
-
stops:
|
|
3118
|
+
type: import_editor_props23.stringPropTypeUtil.create(newValue.type),
|
|
3119
|
+
angle: import_editor_props23.numberPropTypeUtil.create(newValue.angle),
|
|
3120
|
+
stops: import_editor_props23.gradientColorStopPropTypeUtil.create(
|
|
2982
3121
|
newValue.stops.map(
|
|
2983
|
-
({ color, offset }) =>
|
|
2984
|
-
color:
|
|
2985
|
-
offset:
|
|
3122
|
+
({ color, offset }) => import_editor_props23.colorStopPropTypeUtil.create({
|
|
3123
|
+
color: import_editor_props23.colorPropTypeUtil.create(color),
|
|
3124
|
+
offset: import_editor_props23.numberPropTypeUtil.create(offset)
|
|
2986
3125
|
})
|
|
2987
3126
|
)
|
|
2988
3127
|
)
|
|
@@ -3002,8 +3141,8 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
3002
3141
|
positions: positions?.value.split(" ")
|
|
3003
3142
|
};
|
|
3004
3143
|
};
|
|
3005
|
-
return /* @__PURE__ */
|
|
3006
|
-
|
|
3144
|
+
return /* @__PURE__ */ React47.createElement(ControlActions, null, /* @__PURE__ */ React47.createElement(
|
|
3145
|
+
import_ui40.UnstableGradientBox,
|
|
3007
3146
|
{
|
|
3008
3147
|
sx: { width: "auto", padding: 1.5 },
|
|
3009
3148
|
value: normalizeValue(),
|
|
@@ -3011,69 +3150,69 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
3011
3150
|
}
|
|
3012
3151
|
));
|
|
3013
3152
|
});
|
|
3014
|
-
var initialBackgroundGradientOverlay =
|
|
3015
|
-
type:
|
|
3016
|
-
angle:
|
|
3017
|
-
stops:
|
|
3018
|
-
|
|
3019
|
-
color:
|
|
3020
|
-
offset:
|
|
3153
|
+
var initialBackgroundGradientOverlay = import_editor_props23.backgroundGradientOverlayPropTypeUtil.create({
|
|
3154
|
+
type: import_editor_props23.stringPropTypeUtil.create("linear"),
|
|
3155
|
+
angle: import_editor_props23.numberPropTypeUtil.create(180),
|
|
3156
|
+
stops: import_editor_props23.gradientColorStopPropTypeUtil.create([
|
|
3157
|
+
import_editor_props23.colorStopPropTypeUtil.create({
|
|
3158
|
+
color: import_editor_props23.colorPropTypeUtil.create("rgb(0,0,0)"),
|
|
3159
|
+
offset: import_editor_props23.numberPropTypeUtil.create(0)
|
|
3021
3160
|
}),
|
|
3022
|
-
|
|
3023
|
-
color:
|
|
3024
|
-
offset:
|
|
3161
|
+
import_editor_props23.colorStopPropTypeUtil.create({
|
|
3162
|
+
color: import_editor_props23.colorPropTypeUtil.create("rgb(255,255,255)"),
|
|
3163
|
+
offset: import_editor_props23.numberPropTypeUtil.create(100)
|
|
3025
3164
|
})
|
|
3026
3165
|
])
|
|
3027
3166
|
});
|
|
3028
3167
|
|
|
3029
3168
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
3030
|
-
var
|
|
3169
|
+
var React48 = __toESM(require("react"));
|
|
3031
3170
|
var import_icons14 = require("@elementor/icons");
|
|
3032
|
-
var
|
|
3033
|
-
var
|
|
3171
|
+
var import_ui41 = require("@elementor/ui");
|
|
3172
|
+
var import_i18n16 = require("@wordpress/i18n");
|
|
3034
3173
|
var attachmentControlOptions = [
|
|
3035
3174
|
{
|
|
3036
3175
|
value: "fixed",
|
|
3037
|
-
label: (0,
|
|
3038
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3176
|
+
label: (0, import_i18n16.__)("Fixed", "elementor"),
|
|
3177
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(import_icons14.PinIcon, { fontSize: size }),
|
|
3039
3178
|
showTooltip: true
|
|
3040
3179
|
},
|
|
3041
3180
|
{
|
|
3042
3181
|
value: "scroll",
|
|
3043
|
-
label: (0,
|
|
3044
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3182
|
+
label: (0, import_i18n16.__)("Scroll", "elementor"),
|
|
3183
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(import_icons14.PinnedOffIcon, { fontSize: size }),
|
|
3045
3184
|
showTooltip: true
|
|
3046
3185
|
}
|
|
3047
3186
|
];
|
|
3048
3187
|
var BackgroundImageOverlayAttachment = () => {
|
|
3049
|
-
return /* @__PURE__ */
|
|
3188
|
+
return /* @__PURE__ */ React48.createElement(PopoverGridContainer, null, /* @__PURE__ */ React48.createElement(import_ui41.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(ControlFormLabel, null, (0, import_i18n16.__)("Attachment", "elementor"))), /* @__PURE__ */ React48.createElement(import_ui41.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React48.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
3050
3189
|
};
|
|
3051
3190
|
|
|
3052
3191
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
3053
|
-
var
|
|
3054
|
-
var
|
|
3055
|
-
var
|
|
3192
|
+
var React49 = __toESM(require("react"));
|
|
3193
|
+
var import_react28 = require("react");
|
|
3194
|
+
var import_editor_props24 = require("@elementor/editor-props");
|
|
3056
3195
|
var import_editor_ui7 = require("@elementor/editor-ui");
|
|
3057
3196
|
var import_icons15 = require("@elementor/icons");
|
|
3058
|
-
var
|
|
3059
|
-
var
|
|
3197
|
+
var import_ui42 = require("@elementor/ui");
|
|
3198
|
+
var import_i18n17 = require("@wordpress/i18n");
|
|
3060
3199
|
var backgroundPositionOptions = [
|
|
3061
|
-
{ label: (0,
|
|
3062
|
-
{ label: (0,
|
|
3063
|
-
{ label: (0,
|
|
3064
|
-
{ label: (0,
|
|
3065
|
-
{ label: (0,
|
|
3066
|
-
{ label: (0,
|
|
3067
|
-
{ label: (0,
|
|
3068
|
-
{ label: (0,
|
|
3069
|
-
{ label: (0,
|
|
3070
|
-
{ label: (0,
|
|
3200
|
+
{ label: (0, import_i18n17.__)("Center center", "elementor"), value: "center center" },
|
|
3201
|
+
{ label: (0, import_i18n17.__)("Center left", "elementor"), value: "center left" },
|
|
3202
|
+
{ label: (0, import_i18n17.__)("Center right", "elementor"), value: "center right" },
|
|
3203
|
+
{ label: (0, import_i18n17.__)("Top center", "elementor"), value: "top center" },
|
|
3204
|
+
{ label: (0, import_i18n17.__)("Top left", "elementor"), value: "top left" },
|
|
3205
|
+
{ label: (0, import_i18n17.__)("Top right", "elementor"), value: "top right" },
|
|
3206
|
+
{ label: (0, import_i18n17.__)("Bottom center", "elementor"), value: "bottom center" },
|
|
3207
|
+
{ label: (0, import_i18n17.__)("Bottom left", "elementor"), value: "bottom left" },
|
|
3208
|
+
{ label: (0, import_i18n17.__)("Bottom right", "elementor"), value: "bottom right" },
|
|
3209
|
+
{ label: (0, import_i18n17.__)("Custom", "elementor"), value: "custom" }
|
|
3071
3210
|
];
|
|
3072
3211
|
var BackgroundImageOverlayPosition = () => {
|
|
3073
|
-
const backgroundImageOffsetContext = useBoundProp(
|
|
3074
|
-
const stringPropContext = useBoundProp(
|
|
3212
|
+
const backgroundImageOffsetContext = useBoundProp(import_editor_props24.backgroundImagePositionOffsetPropTypeUtil);
|
|
3213
|
+
const stringPropContext = useBoundProp(import_editor_props24.stringPropTypeUtil);
|
|
3075
3214
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
3076
|
-
const rowRef = (0,
|
|
3215
|
+
const rowRef = (0, import_react28.useRef)(null);
|
|
3077
3216
|
const handlePositionChange = (event) => {
|
|
3078
3217
|
const value = event.target.value || null;
|
|
3079
3218
|
if (value === "custom") {
|
|
@@ -3082,8 +3221,8 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
3082
3221
|
stringPropContext.setValue(value);
|
|
3083
3222
|
}
|
|
3084
3223
|
};
|
|
3085
|
-
return /* @__PURE__ */
|
|
3086
|
-
|
|
3224
|
+
return /* @__PURE__ */ React49.createElement(import_ui42.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React49.createElement(import_ui42.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(PopoverGridContainer, null, /* @__PURE__ */ React49.createElement(import_ui42.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(ControlFormLabel, null, (0, import_i18n17.__)("Position", "elementor"))), /* @__PURE__ */ React49.createElement(import_ui42.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React49.createElement(
|
|
3225
|
+
import_ui42.Select,
|
|
3087
3226
|
{
|
|
3088
3227
|
fullWidth: true,
|
|
3089
3228
|
size: "tiny",
|
|
@@ -3091,95 +3230,95 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
3091
3230
|
disabled: stringPropContext.disabled,
|
|
3092
3231
|
value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? ""
|
|
3093
3232
|
},
|
|
3094
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
3095
|
-
)))), isCustom ? /* @__PURE__ */
|
|
3233
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React49.createElement(import_editor_ui7.MenuListItem, { key: value, value: value ?? "" }, label))
|
|
3234
|
+
)))), isCustom ? /* @__PURE__ */ React49.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React49.createElement(import_ui42.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(import_ui42.Grid, { container: true, spacing: 1.5, ref: rowRef }, /* @__PURE__ */ React49.createElement(import_ui42.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React49.createElement(
|
|
3096
3235
|
SizeControl,
|
|
3097
3236
|
{
|
|
3098
|
-
startIcon: /* @__PURE__ */
|
|
3237
|
+
startIcon: /* @__PURE__ */ React49.createElement(import_icons15.LetterXIcon, { fontSize: "tiny" }),
|
|
3099
3238
|
anchorRef: rowRef
|
|
3100
3239
|
}
|
|
3101
|
-
))), /* @__PURE__ */
|
|
3240
|
+
))), /* @__PURE__ */ React49.createElement(import_ui42.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React49.createElement(
|
|
3102
3241
|
SizeControl,
|
|
3103
3242
|
{
|
|
3104
|
-
startIcon: /* @__PURE__ */
|
|
3243
|
+
startIcon: /* @__PURE__ */ React49.createElement(import_icons15.LetterYIcon, { fontSize: "tiny" }),
|
|
3105
3244
|
anchorRef: rowRef
|
|
3106
3245
|
}
|
|
3107
3246
|
)))))) : null);
|
|
3108
3247
|
};
|
|
3109
3248
|
|
|
3110
3249
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
3111
|
-
var
|
|
3250
|
+
var React50 = __toESM(require("react"));
|
|
3112
3251
|
var import_icons16 = require("@elementor/icons");
|
|
3113
|
-
var
|
|
3114
|
-
var
|
|
3252
|
+
var import_ui43 = require("@elementor/ui");
|
|
3253
|
+
var import_i18n18 = require("@wordpress/i18n");
|
|
3115
3254
|
var repeatControlOptions = [
|
|
3116
3255
|
{
|
|
3117
3256
|
value: "repeat",
|
|
3118
|
-
label: (0,
|
|
3119
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3257
|
+
label: (0, import_i18n18.__)("Repeat", "elementor"),
|
|
3258
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(import_icons16.GridDotsIcon, { fontSize: size }),
|
|
3120
3259
|
showTooltip: true
|
|
3121
3260
|
},
|
|
3122
3261
|
{
|
|
3123
3262
|
value: "repeat-x",
|
|
3124
|
-
label: (0,
|
|
3125
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3263
|
+
label: (0, import_i18n18.__)("Repeat-x", "elementor"),
|
|
3264
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(import_icons16.DotsHorizontalIcon, { fontSize: size }),
|
|
3126
3265
|
showTooltip: true
|
|
3127
3266
|
},
|
|
3128
3267
|
{
|
|
3129
3268
|
value: "repeat-y",
|
|
3130
|
-
label: (0,
|
|
3131
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3269
|
+
label: (0, import_i18n18.__)("Repeat-y", "elementor"),
|
|
3270
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(import_icons16.DotsVerticalIcon, { fontSize: size }),
|
|
3132
3271
|
showTooltip: true
|
|
3133
3272
|
},
|
|
3134
3273
|
{
|
|
3135
3274
|
value: "no-repeat",
|
|
3136
|
-
label: (0,
|
|
3137
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3275
|
+
label: (0, import_i18n18.__)("No-repeat", "elementor"),
|
|
3276
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(import_icons16.XIcon, { fontSize: size }),
|
|
3138
3277
|
showTooltip: true
|
|
3139
3278
|
}
|
|
3140
3279
|
];
|
|
3141
3280
|
var BackgroundImageOverlayRepeat = () => {
|
|
3142
|
-
return /* @__PURE__ */
|
|
3281
|
+
return /* @__PURE__ */ React50.createElement(PopoverGridContainer, null, /* @__PURE__ */ React50.createElement(import_ui43.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(ControlFormLabel, null, (0, import_i18n18.__)("Repeat", "elementor"))), /* @__PURE__ */ React50.createElement(import_ui43.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React50.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
3143
3282
|
};
|
|
3144
3283
|
|
|
3145
3284
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
3146
|
-
var
|
|
3147
|
-
var
|
|
3148
|
-
var
|
|
3285
|
+
var React51 = __toESM(require("react"));
|
|
3286
|
+
var import_react29 = require("react");
|
|
3287
|
+
var import_editor_props25 = require("@elementor/editor-props");
|
|
3149
3288
|
var import_icons17 = require("@elementor/icons");
|
|
3150
|
-
var
|
|
3151
|
-
var
|
|
3289
|
+
var import_ui44 = require("@elementor/ui");
|
|
3290
|
+
var import_i18n19 = require("@wordpress/i18n");
|
|
3152
3291
|
var sizeControlOptions = [
|
|
3153
3292
|
{
|
|
3154
3293
|
value: "auto",
|
|
3155
|
-
label: (0,
|
|
3156
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3294
|
+
label: (0, import_i18n19.__)("Auto", "elementor"),
|
|
3295
|
+
renderContent: ({ size }) => /* @__PURE__ */ React51.createElement(import_icons17.LetterAIcon, { fontSize: size }),
|
|
3157
3296
|
showTooltip: true
|
|
3158
3297
|
},
|
|
3159
3298
|
{
|
|
3160
3299
|
value: "cover",
|
|
3161
|
-
label: (0,
|
|
3162
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3300
|
+
label: (0, import_i18n19.__)("Cover", "elementor"),
|
|
3301
|
+
renderContent: ({ size }) => /* @__PURE__ */ React51.createElement(import_icons17.ArrowsMaximizeIcon, { fontSize: size }),
|
|
3163
3302
|
showTooltip: true
|
|
3164
3303
|
},
|
|
3165
3304
|
{
|
|
3166
3305
|
value: "contain",
|
|
3167
|
-
label: (0,
|
|
3168
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3306
|
+
label: (0, import_i18n19.__)("Contain", "elementor"),
|
|
3307
|
+
renderContent: ({ size }) => /* @__PURE__ */ React51.createElement(import_icons17.ArrowBarBothIcon, { fontSize: size }),
|
|
3169
3308
|
showTooltip: true
|
|
3170
3309
|
},
|
|
3171
3310
|
{
|
|
3172
3311
|
value: "custom",
|
|
3173
|
-
label: (0,
|
|
3174
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3312
|
+
label: (0, import_i18n19.__)("Custom", "elementor"),
|
|
3313
|
+
renderContent: ({ size }) => /* @__PURE__ */ React51.createElement(import_icons17.PencilIcon, { fontSize: size }),
|
|
3175
3314
|
showTooltip: true
|
|
3176
3315
|
}
|
|
3177
3316
|
];
|
|
3178
3317
|
var BackgroundImageOverlaySize = () => {
|
|
3179
|
-
const backgroundImageScaleContext = useBoundProp(
|
|
3180
|
-
const stringPropContext = useBoundProp(
|
|
3318
|
+
const backgroundImageScaleContext = useBoundProp(import_editor_props25.backgroundImageSizeScalePropTypeUtil);
|
|
3319
|
+
const stringPropContext = useBoundProp(import_editor_props25.stringPropTypeUtil);
|
|
3181
3320
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
3182
|
-
const rowRef = (0,
|
|
3321
|
+
const rowRef = (0, import_react29.useRef)(null);
|
|
3183
3322
|
const handleSizeChange = (size) => {
|
|
3184
3323
|
if (size === "custom") {
|
|
3185
3324
|
backgroundImageScaleContext.setValue({ width: null, height: null });
|
|
@@ -3187,7 +3326,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3187
3326
|
stringPropContext.setValue(size);
|
|
3188
3327
|
}
|
|
3189
3328
|
};
|
|
3190
|
-
return /* @__PURE__ */
|
|
3329
|
+
return /* @__PURE__ */ React51.createElement(import_ui44.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React51.createElement(import_ui44.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React51.createElement(PopoverGridContainer, null, /* @__PURE__ */ React51.createElement(import_ui44.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(ControlFormLabel, null, (0, import_i18n19.__)("Size", "elementor"))), /* @__PURE__ */ React51.createElement(import_ui44.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React51.createElement(
|
|
3191
3330
|
ControlToggleButtonGroup,
|
|
3192
3331
|
{
|
|
3193
3332
|
exclusive: true,
|
|
@@ -3196,17 +3335,17 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3196
3335
|
disabled: stringPropContext.disabled,
|
|
3197
3336
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value
|
|
3198
3337
|
}
|
|
3199
|
-
)))), isCustom ? /* @__PURE__ */
|
|
3338
|
+
)))), isCustom ? /* @__PURE__ */ React51.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React51.createElement(import_ui44.Grid, { item: true, xs: 12, ref: rowRef }, /* @__PURE__ */ React51.createElement(PopoverGridContainer, null, /* @__PURE__ */ React51.createElement(import_ui44.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React51.createElement(
|
|
3200
3339
|
SizeControl,
|
|
3201
3340
|
{
|
|
3202
|
-
startIcon: /* @__PURE__ */
|
|
3341
|
+
startIcon: /* @__PURE__ */ React51.createElement(import_icons17.ArrowsMoveHorizontalIcon, { fontSize: "tiny" }),
|
|
3203
3342
|
extendedOptions: ["auto"],
|
|
3204
3343
|
anchorRef: rowRef
|
|
3205
3344
|
}
|
|
3206
|
-
))), /* @__PURE__ */
|
|
3345
|
+
))), /* @__PURE__ */ React51.createElement(import_ui44.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React51.createElement(
|
|
3207
3346
|
SizeControl,
|
|
3208
3347
|
{
|
|
3209
|
-
startIcon: /* @__PURE__ */
|
|
3348
|
+
startIcon: /* @__PURE__ */ React51.createElement(import_icons17.ArrowsMoveVerticalIcon, { fontSize: "tiny" }),
|
|
3210
3349
|
extendedOptions: ["auto"],
|
|
3211
3350
|
anchorRef: rowRef
|
|
3212
3351
|
}
|
|
@@ -3214,17 +3353,17 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3214
3353
|
};
|
|
3215
3354
|
|
|
3216
3355
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
3217
|
-
var
|
|
3218
|
-
var
|
|
3219
|
-
var
|
|
3356
|
+
var import_react30 = require("react");
|
|
3357
|
+
var import_editor_props26 = require("@elementor/editor-props");
|
|
3358
|
+
var import_ui45 = require("@elementor/ui");
|
|
3220
3359
|
var useBackgroundTabsHistory = ({
|
|
3221
3360
|
color: initialBackgroundColorOverlay2,
|
|
3222
3361
|
image: initialBackgroundImageOverlay,
|
|
3223
3362
|
gradient: initialBackgroundGradientOverlay2
|
|
3224
3363
|
}) => {
|
|
3225
|
-
const { value: imageValue, setValue: setImageValue } = useBoundProp(
|
|
3226
|
-
const { value: colorValue, setValue: setColorValue } = useBoundProp(
|
|
3227
|
-
const { value: gradientValue, setValue: setGradientValue } = useBoundProp(
|
|
3364
|
+
const { value: imageValue, setValue: setImageValue } = useBoundProp(import_editor_props26.backgroundImageOverlayPropTypeUtil);
|
|
3365
|
+
const { value: colorValue, setValue: setColorValue } = useBoundProp(import_editor_props26.backgroundColorOverlayPropTypeUtil);
|
|
3366
|
+
const { value: gradientValue, setValue: setGradientValue } = useBoundProp(import_editor_props26.backgroundGradientOverlayPropTypeUtil);
|
|
3228
3367
|
const getCurrentOverlayType = () => {
|
|
3229
3368
|
if (colorValue) {
|
|
3230
3369
|
return "color";
|
|
@@ -3234,8 +3373,8 @@ var useBackgroundTabsHistory = ({
|
|
|
3234
3373
|
}
|
|
3235
3374
|
return "image";
|
|
3236
3375
|
};
|
|
3237
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
3238
|
-
const valuesHistory = (0,
|
|
3376
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui45.useTabs)(getCurrentOverlayType());
|
|
3377
|
+
const valuesHistory = (0, import_react30.useRef)({
|
|
3239
3378
|
image: initialBackgroundImageOverlay,
|
|
3240
3379
|
color: initialBackgroundColorOverlay2,
|
|
3241
3380
|
gradient: initialBackgroundGradientOverlay2
|
|
@@ -3273,9 +3412,9 @@ var useBackgroundTabsHistory = ({
|
|
|
3273
3412
|
|
|
3274
3413
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
3275
3414
|
var DEFAULT_BACKGROUND_COLOR_OVERLAY_COLOR = "#00000033";
|
|
3276
|
-
var initialBackgroundColorOverlay =
|
|
3415
|
+
var initialBackgroundColorOverlay = import_editor_props27.backgroundColorOverlayPropTypeUtil.create(
|
|
3277
3416
|
{
|
|
3278
|
-
color:
|
|
3417
|
+
color: import_editor_props27.colorPropTypeUtil.create(DEFAULT_BACKGROUND_COLOR_OVERLAY_COLOR)
|
|
3279
3418
|
}
|
|
3280
3419
|
);
|
|
3281
3420
|
var getInitialBackgroundOverlay = () => ({
|
|
@@ -3303,21 +3442,21 @@ var getInitialBackgroundOverlay = () => ({
|
|
|
3303
3442
|
}
|
|
3304
3443
|
});
|
|
3305
3444
|
var backgroundResolutionOptions = [
|
|
3306
|
-
{ label: (0,
|
|
3307
|
-
{ label: (0,
|
|
3308
|
-
{ label: (0,
|
|
3309
|
-
{ label: (0,
|
|
3445
|
+
{ label: (0, import_i18n20.__)("Thumbnail - 150 x 150", "elementor"), value: "thumbnail" },
|
|
3446
|
+
{ label: (0, import_i18n20.__)("Medium - 300 x 300", "elementor"), value: "medium" },
|
|
3447
|
+
{ label: (0, import_i18n20.__)("Large 1024 x 1024", "elementor"), value: "large" },
|
|
3448
|
+
{ label: (0, import_i18n20.__)("Full", "elementor"), value: "full" }
|
|
3310
3449
|
];
|
|
3311
3450
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
3312
|
-
const { propType, value: overlayValues, setValue, disabled } = useBoundProp(
|
|
3313
|
-
return /* @__PURE__ */
|
|
3451
|
+
const { propType, value: overlayValues, setValue, disabled } = useBoundProp(import_editor_props27.backgroundOverlayPropTypeUtil);
|
|
3452
|
+
return /* @__PURE__ */ React52.createElement(PropProvider, { propType, value: overlayValues, setValue, isDisabled: () => disabled }, /* @__PURE__ */ React52.createElement(
|
|
3314
3453
|
Repeater,
|
|
3315
3454
|
{
|
|
3316
3455
|
openOnAdd: true,
|
|
3317
3456
|
disabled,
|
|
3318
3457
|
values: overlayValues ?? [],
|
|
3319
3458
|
setValues: setValue,
|
|
3320
|
-
label: (0,
|
|
3459
|
+
label: (0, import_i18n20.__)("Overlay", "elementor"),
|
|
3321
3460
|
itemSettings: {
|
|
3322
3461
|
Icon: ItemIcon3,
|
|
3323
3462
|
Label: ItemLabel3,
|
|
@@ -3328,7 +3467,7 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
3328
3467
|
));
|
|
3329
3468
|
});
|
|
3330
3469
|
var ItemContent3 = ({ anchorEl = null, bind }) => {
|
|
3331
|
-
return /* @__PURE__ */
|
|
3470
|
+
return /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React52.createElement(Content3, { anchorEl }));
|
|
3332
3471
|
};
|
|
3333
3472
|
var Content3 = ({ anchorEl }) => {
|
|
3334
3473
|
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
@@ -3336,27 +3475,27 @@ var Content3 = ({ anchorEl }) => {
|
|
|
3336
3475
|
color: initialBackgroundColorOverlay.value,
|
|
3337
3476
|
gradient: initialBackgroundGradientOverlay.value
|
|
3338
3477
|
});
|
|
3339
|
-
return /* @__PURE__ */
|
|
3340
|
-
|
|
3478
|
+
return /* @__PURE__ */ React52.createElement(import_ui46.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React52.createElement(import_ui46.Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React52.createElement(
|
|
3479
|
+
import_ui46.Tabs,
|
|
3341
3480
|
{
|
|
3342
3481
|
size: "small",
|
|
3343
3482
|
variant: "fullWidth",
|
|
3344
3483
|
...getTabsProps(),
|
|
3345
|
-
"aria-label": (0,
|
|
3484
|
+
"aria-label": (0, import_i18n20.__)("Background Overlay", "elementor")
|
|
3346
3485
|
},
|
|
3347
|
-
/* @__PURE__ */
|
|
3348
|
-
/* @__PURE__ */
|
|
3349
|
-
/* @__PURE__ */
|
|
3350
|
-
)), /* @__PURE__ */
|
|
3486
|
+
/* @__PURE__ */ React52.createElement(import_ui46.Tab, { label: (0, import_i18n20.__)("Image", "elementor"), ...getTabProps("image") }),
|
|
3487
|
+
/* @__PURE__ */ React52.createElement(import_ui46.Tab, { label: (0, import_i18n20.__)("Gradient", "elementor"), ...getTabProps("gradient") }),
|
|
3488
|
+
/* @__PURE__ */ React52.createElement(import_ui46.Tab, { label: (0, import_i18n20.__)("Color", "elementor"), ...getTabProps("color") })
|
|
3489
|
+
)), /* @__PURE__ */ React52.createElement(import_ui46.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React52.createElement(PopoverContent, null, /* @__PURE__ */ React52.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React52.createElement(import_ui46.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("gradient") }, /* @__PURE__ */ React52.createElement(BackgroundGradientColorControl, null)), /* @__PURE__ */ React52.createElement(import_ui46.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("color") }, /* @__PURE__ */ React52.createElement(PopoverContent, null, /* @__PURE__ */ React52.createElement(ColorOverlayContent, { anchorEl }))));
|
|
3351
3490
|
};
|
|
3352
3491
|
var ItemIcon3 = ({ value }) => {
|
|
3353
3492
|
switch (value.$$type) {
|
|
3354
3493
|
case "background-image-overlay":
|
|
3355
|
-
return /* @__PURE__ */
|
|
3494
|
+
return /* @__PURE__ */ React52.createElement(ItemIconImage, { value });
|
|
3356
3495
|
case "background-color-overlay":
|
|
3357
|
-
return /* @__PURE__ */
|
|
3496
|
+
return /* @__PURE__ */ React52.createElement(ItemIconColor, { value });
|
|
3358
3497
|
case "background-gradient-overlay":
|
|
3359
|
-
return /* @__PURE__ */
|
|
3498
|
+
return /* @__PURE__ */ React52.createElement(ItemIconGradient, { value });
|
|
3360
3499
|
default:
|
|
3361
3500
|
return null;
|
|
3362
3501
|
}
|
|
@@ -3369,12 +3508,12 @@ var extractColorFrom = (prop) => {
|
|
|
3369
3508
|
};
|
|
3370
3509
|
var ItemIconColor = ({ value: prop }) => {
|
|
3371
3510
|
const color = extractColorFrom(prop);
|
|
3372
|
-
return /* @__PURE__ */
|
|
3511
|
+
return /* @__PURE__ */ React52.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: color });
|
|
3373
3512
|
};
|
|
3374
3513
|
var ItemIconImage = ({ value }) => {
|
|
3375
3514
|
const { imageUrl } = useImage(value);
|
|
3376
|
-
return /* @__PURE__ */
|
|
3377
|
-
|
|
3515
|
+
return /* @__PURE__ */ React52.createElement(
|
|
3516
|
+
import_ui46.CardMedia,
|
|
3378
3517
|
{
|
|
3379
3518
|
image: imageUrl,
|
|
3380
3519
|
sx: (theme) => ({
|
|
@@ -3388,43 +3527,43 @@ var ItemIconImage = ({ value }) => {
|
|
|
3388
3527
|
};
|
|
3389
3528
|
var ItemIconGradient = ({ value }) => {
|
|
3390
3529
|
const gradient = getGradientValue(value);
|
|
3391
|
-
return /* @__PURE__ */
|
|
3530
|
+
return /* @__PURE__ */ React52.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: gradient });
|
|
3392
3531
|
};
|
|
3393
3532
|
var ItemLabel3 = ({ value }) => {
|
|
3394
3533
|
switch (value.$$type) {
|
|
3395
3534
|
case "background-image-overlay":
|
|
3396
|
-
return /* @__PURE__ */
|
|
3535
|
+
return /* @__PURE__ */ React52.createElement(ItemLabelImage, { value });
|
|
3397
3536
|
case "background-color-overlay":
|
|
3398
|
-
return /* @__PURE__ */
|
|
3537
|
+
return /* @__PURE__ */ React52.createElement(ItemLabelColor, { value });
|
|
3399
3538
|
case "background-gradient-overlay":
|
|
3400
|
-
return /* @__PURE__ */
|
|
3539
|
+
return /* @__PURE__ */ React52.createElement(ItemLabelGradient, { value });
|
|
3401
3540
|
default:
|
|
3402
3541
|
return null;
|
|
3403
3542
|
}
|
|
3404
3543
|
};
|
|
3405
3544
|
var ItemLabelColor = ({ value: prop }) => {
|
|
3406
3545
|
const color = extractColorFrom(prop);
|
|
3407
|
-
return /* @__PURE__ */
|
|
3546
|
+
return /* @__PURE__ */ React52.createElement("span", null, color);
|
|
3408
3547
|
};
|
|
3409
3548
|
var ItemLabelImage = ({ value }) => {
|
|
3410
3549
|
const { imageTitle } = useImage(value);
|
|
3411
|
-
return /* @__PURE__ */
|
|
3550
|
+
return /* @__PURE__ */ React52.createElement("span", null, imageTitle);
|
|
3412
3551
|
};
|
|
3413
3552
|
var ItemLabelGradient = ({ value }) => {
|
|
3414
3553
|
if (value.value.type.value === "linear") {
|
|
3415
|
-
return /* @__PURE__ */
|
|
3554
|
+
return /* @__PURE__ */ React52.createElement("span", null, (0, import_i18n20.__)("Linear Gradient", "elementor"));
|
|
3416
3555
|
}
|
|
3417
|
-
return /* @__PURE__ */
|
|
3556
|
+
return /* @__PURE__ */ React52.createElement("span", null, (0, import_i18n20.__)("Radial Gradient", "elementor"));
|
|
3418
3557
|
};
|
|
3419
3558
|
var ColorOverlayContent = ({ anchorEl }) => {
|
|
3420
|
-
const propContext = useBoundProp(
|
|
3421
|
-
return /* @__PURE__ */
|
|
3559
|
+
const propContext = useBoundProp(import_editor_props27.backgroundColorOverlayPropTypeUtil);
|
|
3560
|
+
return /* @__PURE__ */ React52.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React52.createElement(ColorControl, { anchorEl })));
|
|
3422
3561
|
};
|
|
3423
3562
|
var ImageOverlayContent = () => {
|
|
3424
|
-
const propContext = useBoundProp(
|
|
3425
|
-
return /* @__PURE__ */
|
|
3563
|
+
const propContext = useBoundProp(import_editor_props27.backgroundImageOverlayPropTypeUtil);
|
|
3564
|
+
return /* @__PURE__ */ React52.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React52.createElement(ImageControl, { sizes: backgroundResolutionOptions })), /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React52.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React52.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React52.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React52.createElement(BackgroundImageOverlayAttachment, null)));
|
|
3426
3565
|
};
|
|
3427
|
-
var StyledUnstableColorIndicator = (0,
|
|
3566
|
+
var StyledUnstableColorIndicator = (0, import_ui46.styled)(import_ui46.UnstableColorIndicator)(({ theme }) => ({
|
|
3428
3567
|
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
3429
3568
|
}));
|
|
3430
3569
|
var useImage = (image) => {
|
|
@@ -3459,23 +3598,23 @@ var getGradientValue = (value) => {
|
|
|
3459
3598
|
|
|
3460
3599
|
// src/controls/background-control/background-control.tsx
|
|
3461
3600
|
var BackgroundControl = createControl(() => {
|
|
3462
|
-
const propContext = useBoundProp(
|
|
3601
|
+
const propContext = useBoundProp(import_editor_props28.backgroundPropTypeUtil);
|
|
3463
3602
|
const isUsingNestedProps = (0, import_editor_v1_adapters5.isExperimentActive)("e_v_3_30");
|
|
3464
|
-
const colorLabel = (0,
|
|
3465
|
-
return /* @__PURE__ */
|
|
3603
|
+
const colorLabel = (0, import_i18n21.__)("Color", "elementor");
|
|
3604
|
+
return /* @__PURE__ */ React53.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React53.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React53.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React53.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React53.createElement(import_ui47.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React53.createElement(import_ui47.Grid, { item: true, xs: 6 }, isUsingNestedProps ? /* @__PURE__ */ React53.createElement(ControlLabel, null, colorLabel) : /* @__PURE__ */ React53.createElement(ControlFormLabel, null, colorLabel)), /* @__PURE__ */ React53.createElement(import_ui47.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React53.createElement(ColorControl, null)))));
|
|
3466
3605
|
});
|
|
3467
3606
|
|
|
3468
3607
|
// src/controls/repeatable-control.tsx
|
|
3469
|
-
var
|
|
3470
|
-
var
|
|
3471
|
-
var
|
|
3472
|
-
var
|
|
3608
|
+
var React54 = __toESM(require("react"));
|
|
3609
|
+
var import_react32 = require("react");
|
|
3610
|
+
var import_editor_props29 = require("@elementor/editor-props");
|
|
3611
|
+
var import_ui48 = require("@elementor/ui");
|
|
3473
3612
|
|
|
3474
3613
|
// src/hooks/use-repeatable-control-context.ts
|
|
3475
|
-
var
|
|
3476
|
-
var RepeatableControlContext = (0,
|
|
3614
|
+
var import_react31 = require("react");
|
|
3615
|
+
var RepeatableControlContext = (0, import_react31.createContext)(void 0);
|
|
3477
3616
|
var useRepeatableControlContext = () => {
|
|
3478
|
-
const context = (0,
|
|
3617
|
+
const context = (0, import_react31.useContext)(RepeatableControlContext);
|
|
3479
3618
|
if (!context) {
|
|
3480
3619
|
throw new Error("useRepeatableControlContext must be used within RepeatableControl");
|
|
3481
3620
|
}
|
|
@@ -3483,6 +3622,7 @@ var useRepeatableControlContext = () => {
|
|
|
3483
3622
|
};
|
|
3484
3623
|
|
|
3485
3624
|
// src/controls/repeatable-control.tsx
|
|
3625
|
+
var PLACEHOLDER_REGEX = /\$\{([^}]+)\}/g;
|
|
3486
3626
|
var RepeatableControl = createControl(
|
|
3487
3627
|
({
|
|
3488
3628
|
repeaterLabel,
|
|
@@ -3497,11 +3637,11 @@ var RepeatableControl = createControl(
|
|
|
3497
3637
|
if (!childPropTypeUtil) {
|
|
3498
3638
|
return null;
|
|
3499
3639
|
}
|
|
3500
|
-
const childArrayPropTypeUtil = (0,
|
|
3501
|
-
() => (0,
|
|
3640
|
+
const childArrayPropTypeUtil = (0, import_react32.useMemo)(
|
|
3641
|
+
() => (0, import_editor_props29.createArrayPropUtils)(childPropTypeUtil.key, childPropTypeUtil.schema),
|
|
3502
3642
|
[childPropTypeUtil.key, childPropTypeUtil.schema]
|
|
3503
3643
|
);
|
|
3504
|
-
const contextValue = (0,
|
|
3644
|
+
const contextValue = (0, import_react32.useMemo)(
|
|
3505
3645
|
() => ({
|
|
3506
3646
|
...childControlConfig,
|
|
3507
3647
|
placeholder: placeholder || "",
|
|
@@ -3510,7 +3650,7 @@ var RepeatableControl = createControl(
|
|
|
3510
3650
|
[childControlConfig, placeholder, patternLabel]
|
|
3511
3651
|
);
|
|
3512
3652
|
const { propType, value, setValue } = useBoundProp(childArrayPropTypeUtil);
|
|
3513
|
-
return /* @__PURE__ */
|
|
3653
|
+
return /* @__PURE__ */ React54.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React54.createElement(RepeatableControlContext.Provider, { value: contextValue }, /* @__PURE__ */ React54.createElement(
|
|
3514
3654
|
Repeater,
|
|
3515
3655
|
{
|
|
3516
3656
|
openOnAdd: true,
|
|
@@ -3531,21 +3671,38 @@ var RepeatableControl = createControl(
|
|
|
3531
3671
|
}
|
|
3532
3672
|
);
|
|
3533
3673
|
var ItemContent4 = ({ bind }) => {
|
|
3534
|
-
return /* @__PURE__ */
|
|
3674
|
+
return /* @__PURE__ */ React54.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React54.createElement(Content4, null));
|
|
3535
3675
|
};
|
|
3536
|
-
var ItemIcon4 = () => /* @__PURE__ */
|
|
3676
|
+
var ItemIcon4 = () => /* @__PURE__ */ React54.createElement(React54.Fragment, null);
|
|
3537
3677
|
var Content4 = () => {
|
|
3538
3678
|
const { component: ChildControl, props = {} } = useRepeatableControlContext();
|
|
3539
|
-
return /* @__PURE__ */
|
|
3679
|
+
return /* @__PURE__ */ React54.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React54.createElement(PopoverGridContainer, null, /* @__PURE__ */ React54.createElement(ChildControl, { ...props })));
|
|
3540
3680
|
};
|
|
3541
3681
|
var interpolate = (template, data) => {
|
|
3542
3682
|
if (!data) {
|
|
3543
3683
|
return template;
|
|
3544
3684
|
}
|
|
3545
|
-
return
|
|
3685
|
+
return template.replace(PLACEHOLDER_REGEX, (_, path) => {
|
|
3686
|
+
const value = getNestedValue(data, path);
|
|
3687
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
3688
|
+
if (value.name) {
|
|
3689
|
+
return value.name;
|
|
3690
|
+
}
|
|
3691
|
+
return JSON.stringify(value);
|
|
3692
|
+
}
|
|
3693
|
+
if (Array.isArray(value)) {
|
|
3694
|
+
return value.join(", ");
|
|
3695
|
+
}
|
|
3696
|
+
return String(value ?? "");
|
|
3697
|
+
});
|
|
3546
3698
|
};
|
|
3547
3699
|
var getNestedValue = (obj, path) => {
|
|
3548
|
-
return path.split(".").reduce((current, key) =>
|
|
3700
|
+
return path.split(".").reduce((current, key) => {
|
|
3701
|
+
if (current && typeof current === "object") {
|
|
3702
|
+
return current[key];
|
|
3703
|
+
}
|
|
3704
|
+
return {};
|
|
3705
|
+
}, obj);
|
|
3549
3706
|
};
|
|
3550
3707
|
var isEmptyValue = (val) => {
|
|
3551
3708
|
if (typeof val === "string") {
|
|
@@ -3557,8 +3714,8 @@ var isEmptyValue = (val) => {
|
|
|
3557
3714
|
if (Array.isArray(val)) {
|
|
3558
3715
|
return val.length === 0;
|
|
3559
3716
|
}
|
|
3560
|
-
if (typeof val === "object" && val !== null
|
|
3561
|
-
return
|
|
3717
|
+
if (typeof val === "object" && val !== null) {
|
|
3718
|
+
return Object.keys(val).length === 0;
|
|
3562
3719
|
}
|
|
3563
3720
|
return false;
|
|
3564
3721
|
};
|
|
@@ -3579,64 +3736,71 @@ var shouldShowPlaceholder = (pattern, data) => {
|
|
|
3579
3736
|
var ItemLabel4 = ({ value }) => {
|
|
3580
3737
|
const { placeholder, patternLabel } = useRepeatableControlContext();
|
|
3581
3738
|
const label = shouldShowPlaceholder(patternLabel, value) ? placeholder : interpolate(patternLabel, value);
|
|
3582
|
-
return /* @__PURE__ */
|
|
3739
|
+
return /* @__PURE__ */ React54.createElement(import_ui48.Box, { component: "span", color: "text.tertiary" }, label);
|
|
3583
3740
|
};
|
|
3584
3741
|
var getAllProperties = (pattern) => {
|
|
3585
|
-
const properties = pattern.match(
|
|
3586
|
-
(match) => match.slice(2, -1)
|
|
3587
|
-
) || [];
|
|
3742
|
+
const properties = pattern.match(PLACEHOLDER_REGEX)?.map((match) => match.slice(2, -1)) || [];
|
|
3588
3743
|
return properties;
|
|
3589
3744
|
};
|
|
3590
3745
|
|
|
3591
3746
|
// src/controls/key-value-control.tsx
|
|
3592
|
-
var
|
|
3593
|
-
var
|
|
3594
|
-
var
|
|
3595
|
-
var
|
|
3596
|
-
var
|
|
3747
|
+
var React55 = __toESM(require("react"));
|
|
3748
|
+
var import_react33 = require("react");
|
|
3749
|
+
var import_editor_props30 = require("@elementor/editor-props");
|
|
3750
|
+
var import_ui49 = require("@elementor/ui");
|
|
3751
|
+
var import_i18n22 = require("@wordpress/i18n");
|
|
3597
3752
|
var KeyValueControl = createControl((props = {}) => {
|
|
3598
|
-
const { value, setValue } = useBoundProp(
|
|
3599
|
-
const [keyError, setKeyError] = (0,
|
|
3600
|
-
const [valueError, setValueError] = (0,
|
|
3601
|
-
const [sessionState, setSessionState] = (0,
|
|
3753
|
+
const { value, setValue, ...propContext } = useBoundProp(import_editor_props30.keyValuePropTypeUtil);
|
|
3754
|
+
const [keyError, setKeyError] = (0, import_react33.useState)("");
|
|
3755
|
+
const [valueError, setValueError] = (0, import_react33.useState)("");
|
|
3756
|
+
const [sessionState, setSessionState] = (0, import_react33.useState)({
|
|
3602
3757
|
key: value?.key?.value || "",
|
|
3603
3758
|
value: value?.value?.value || ""
|
|
3604
3759
|
});
|
|
3605
|
-
const keyLabel = props.keyName || (0,
|
|
3606
|
-
const valueLabel = props.valueName || (0,
|
|
3607
|
-
const [keyRegex, valueRegex, errMsg] = (0,
|
|
3760
|
+
const keyLabel = props.keyName || (0, import_i18n22.__)("Key", "elementor");
|
|
3761
|
+
const valueLabel = props.valueName || (0, import_i18n22.__)("Value", "elementor");
|
|
3762
|
+
const [keyRegex, valueRegex, errMsg] = (0, import_react33.useMemo)(
|
|
3608
3763
|
() => [
|
|
3609
3764
|
props.regexKey ? new RegExp(props.regexKey) : void 0,
|
|
3610
3765
|
props.regexValue ? new RegExp(props.regexValue) : void 0,
|
|
3611
|
-
props.validationErrorMessage || (0,
|
|
3766
|
+
props.validationErrorMessage || (0, import_i18n22.__)("Invalid Format", "elementor")
|
|
3612
3767
|
],
|
|
3613
3768
|
[props.regexKey, props.regexValue, props.validationErrorMessage]
|
|
3614
3769
|
);
|
|
3615
3770
|
const validate = (newValue, fieldType) => {
|
|
3616
3771
|
if (fieldType === "key" && keyRegex) {
|
|
3617
3772
|
const isValid = keyRegex.test(newValue);
|
|
3618
|
-
setKeyError(isValid ?
|
|
3773
|
+
setKeyError(isValid ? "" : errMsg);
|
|
3619
3774
|
return isValid;
|
|
3620
3775
|
} else if (fieldType === "value" && valueRegex) {
|
|
3621
3776
|
const isValid = valueRegex.test(newValue);
|
|
3622
|
-
setValueError(isValid ?
|
|
3777
|
+
setValueError(isValid ? "" : errMsg);
|
|
3623
3778
|
return isValid;
|
|
3624
3779
|
}
|
|
3625
3780
|
return true;
|
|
3626
3781
|
};
|
|
3627
|
-
const handleChange = (
|
|
3628
|
-
const
|
|
3782
|
+
const handleChange = (newValue, options, meta) => {
|
|
3783
|
+
const fieldType = meta?.bind;
|
|
3784
|
+
if (!fieldType) {
|
|
3785
|
+
return;
|
|
3786
|
+
}
|
|
3787
|
+
const newChangedValue = newValue[fieldType];
|
|
3788
|
+
if ((0, import_editor_props30.isTransformable)(newChangedValue) && newChangedValue.$$type === "dynamic") {
|
|
3789
|
+
setValue({
|
|
3790
|
+
...value,
|
|
3791
|
+
[fieldType]: newChangedValue
|
|
3792
|
+
});
|
|
3793
|
+
return;
|
|
3794
|
+
}
|
|
3795
|
+
const extractedValue = import_editor_props30.stringPropTypeUtil.extract(newChangedValue);
|
|
3629
3796
|
setSessionState((prev) => ({
|
|
3630
3797
|
...prev,
|
|
3631
|
-
[fieldType]:
|
|
3798
|
+
[fieldType]: extractedValue
|
|
3632
3799
|
}));
|
|
3633
|
-
if (validate(
|
|
3800
|
+
if (extractedValue && validate(extractedValue, fieldType)) {
|
|
3634
3801
|
setValue({
|
|
3635
3802
|
...value,
|
|
3636
|
-
[fieldType]:
|
|
3637
|
-
value: newValue,
|
|
3638
|
-
$$type: "string"
|
|
3639
|
-
}
|
|
3803
|
+
[fieldType]: newChangedValue
|
|
3640
3804
|
});
|
|
3641
3805
|
} else {
|
|
3642
3806
|
setValue({
|
|
@@ -3648,62 +3812,46 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
3648
3812
|
});
|
|
3649
3813
|
}
|
|
3650
3814
|
};
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
return /* @__PURE__ */ React53.createElement(ControlActions, null, /* @__PURE__ */ React53.createElement(import_ui47.Grid, { container: true, gap: 1.5 }, /* @__PURE__ */ React53.createElement(import_ui47.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React53.createElement(import_ui47.FormLabel, { size: "tiny" }, keyLabel), /* @__PURE__ */ React53.createElement(
|
|
3654
|
-
import_ui47.TextField,
|
|
3815
|
+
return /* @__PURE__ */ React55.createElement(PropProvider, { ...propContext, value, setValue: handleChange }, /* @__PURE__ */ React55.createElement(import_ui49.Grid, { container: true, gap: 1.5 }, /* @__PURE__ */ React55.createElement(import_ui49.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React55.createElement(import_ui49.FormLabel, { size: "tiny" }, keyLabel), /* @__PURE__ */ React55.createElement(PropKeyProvider, { bind: "key" }, /* @__PURE__ */ React55.createElement(TextControl, { inputValue: sessionState.key, error: !!keyError, sx: { pt: 1 } })), !!keyError && /* @__PURE__ */ React55.createElement(import_ui49.FormHelperText, { error: true }, keyError)), /* @__PURE__ */ React55.createElement(import_ui49.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React55.createElement(import_ui49.FormLabel, { size: "tiny" }, valueLabel), /* @__PURE__ */ React55.createElement(PropKeyProvider, { bind: "value" }, /* @__PURE__ */ React55.createElement(
|
|
3816
|
+
TextControl,
|
|
3655
3817
|
{
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
value: sessionState.key,
|
|
3661
|
-
onChange: (e) => handleChange(e, "key"),
|
|
3662
|
-
error: isKeyInvalid
|
|
3818
|
+
inputValue: sessionState.value,
|
|
3819
|
+
error: !!valueError,
|
|
3820
|
+
inputDisabled: !!keyError,
|
|
3821
|
+
sx: { pt: 1 }
|
|
3663
3822
|
}
|
|
3664
|
-
),
|
|
3665
|
-
import_ui47.TextField,
|
|
3666
|
-
{
|
|
3667
|
-
sx: { pt: 1 },
|
|
3668
|
-
size: "tiny",
|
|
3669
|
-
fullWidth: true,
|
|
3670
|
-
value: sessionState.value,
|
|
3671
|
-
onChange: (e) => handleChange(e, "value"),
|
|
3672
|
-
disabled: isKeyInvalid,
|
|
3673
|
-
error: isValueInvalid
|
|
3674
|
-
}
|
|
3675
|
-
), isValueInvalid && /* @__PURE__ */ React53.createElement(import_ui47.FormHelperText, { error: true }, valueError))));
|
|
3823
|
+
)), !!valueError && /* @__PURE__ */ React55.createElement(import_ui49.FormHelperText, { error: true }, valueError))));
|
|
3676
3824
|
});
|
|
3677
3825
|
|
|
3678
3826
|
// src/controls/position-control.tsx
|
|
3679
|
-
var
|
|
3680
|
-
var
|
|
3681
|
-
var
|
|
3827
|
+
var React56 = __toESM(require("react"));
|
|
3828
|
+
var import_react34 = require("react");
|
|
3829
|
+
var import_editor_props31 = require("@elementor/editor-props");
|
|
3682
3830
|
var import_editor_ui8 = require("@elementor/editor-ui");
|
|
3683
3831
|
var import_editor_v1_adapters6 = require("@elementor/editor-v1-adapters");
|
|
3684
3832
|
var import_icons18 = require("@elementor/icons");
|
|
3685
|
-
var
|
|
3686
|
-
var
|
|
3833
|
+
var import_ui50 = require("@elementor/ui");
|
|
3834
|
+
var import_i18n23 = require("@wordpress/i18n");
|
|
3687
3835
|
var positionOptions = [
|
|
3688
|
-
{ label: (0,
|
|
3689
|
-
{ label: (0,
|
|
3690
|
-
{ label: (0,
|
|
3691
|
-
{ label: (0,
|
|
3692
|
-
{ label: (0,
|
|
3693
|
-
{ label: (0,
|
|
3694
|
-
{ label: (0,
|
|
3695
|
-
{ label: (0,
|
|
3696
|
-
{ label: (0,
|
|
3836
|
+
{ label: (0, import_i18n23.__)("Center center", "elementor"), value: "center center" },
|
|
3837
|
+
{ label: (0, import_i18n23.__)("Center left", "elementor"), value: "center left" },
|
|
3838
|
+
{ label: (0, import_i18n23.__)("Center right", "elementor"), value: "center right" },
|
|
3839
|
+
{ label: (0, import_i18n23.__)("Top center", "elementor"), value: "top center" },
|
|
3840
|
+
{ label: (0, import_i18n23.__)("Top left", "elementor"), value: "top left" },
|
|
3841
|
+
{ label: (0, import_i18n23.__)("Top right", "elementor"), value: "top right" },
|
|
3842
|
+
{ label: (0, import_i18n23.__)("Bottom center", "elementor"), value: "bottom center" },
|
|
3843
|
+
{ label: (0, import_i18n23.__)("Bottom left", "elementor"), value: "bottom left" },
|
|
3844
|
+
{ label: (0, import_i18n23.__)("Bottom right", "elementor"), value: "bottom right" }
|
|
3697
3845
|
];
|
|
3698
3846
|
var PositionControl = () => {
|
|
3699
|
-
const positionContext = useBoundProp(
|
|
3700
|
-
const stringPropContext = useBoundProp(
|
|
3847
|
+
const positionContext = useBoundProp(import_editor_props31.positionPropTypeUtil);
|
|
3848
|
+
const stringPropContext = useBoundProp(import_editor_props31.stringPropTypeUtil);
|
|
3701
3849
|
const isVersion331Active = (0, import_editor_v1_adapters6.isExperimentActive)("e_v_3_31");
|
|
3702
3850
|
const isCustom = !!positionContext.value && isVersion331Active;
|
|
3703
|
-
const availablePositionOptions = (0,
|
|
3851
|
+
const availablePositionOptions = (0, import_react34.useMemo)(() => {
|
|
3704
3852
|
const options = [...positionOptions];
|
|
3705
3853
|
if (isVersion331Active) {
|
|
3706
|
-
options.push({ label: (0,
|
|
3854
|
+
options.push({ label: (0, import_i18n23.__)("Custom", "elementor"), value: "custom" });
|
|
3707
3855
|
}
|
|
3708
3856
|
return options;
|
|
3709
3857
|
}, [isVersion331Active]);
|
|
@@ -3715,8 +3863,8 @@ var PositionControl = () => {
|
|
|
3715
3863
|
stringPropContext.setValue(value);
|
|
3716
3864
|
}
|
|
3717
3865
|
};
|
|
3718
|
-
return /* @__PURE__ */
|
|
3719
|
-
|
|
3866
|
+
return /* @__PURE__ */ React56.createElement(import_ui50.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React56.createElement(import_ui50.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React56.createElement(import_ui50.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React56.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(ControlFormLabel, null, (0, import_i18n23.__)("Object position", "elementor"))), /* @__PURE__ */ React56.createElement(import_ui50.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React56.createElement(
|
|
3867
|
+
import_ui50.Select,
|
|
3720
3868
|
{
|
|
3721
3869
|
size: "tiny",
|
|
3722
3870
|
disabled: stringPropContext.disabled,
|
|
@@ -3724,102 +3872,102 @@ var PositionControl = () => {
|
|
|
3724
3872
|
onChange: handlePositionChange,
|
|
3725
3873
|
fullWidth: true
|
|
3726
3874
|
},
|
|
3727
|
-
availablePositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
3728
|
-
)))), isCustom && /* @__PURE__ */
|
|
3875
|
+
availablePositionOptions.map(({ label, value }) => /* @__PURE__ */ React56.createElement(import_editor_ui8.MenuListItem, { key: value, value: value ?? "" }, label))
|
|
3876
|
+
)))), isCustom && /* @__PURE__ */ React56.createElement(PropProvider, { ...positionContext }, /* @__PURE__ */ React56.createElement(import_ui50.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React56.createElement(import_ui50.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React56.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React56.createElement(SizeControl, { startIcon: /* @__PURE__ */ React56.createElement(import_icons18.LetterXIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React56.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React56.createElement(SizeControl, { startIcon: /* @__PURE__ */ React56.createElement(import_icons18.LetterYIcon, { fontSize: "tiny" }) })))))));
|
|
3729
3877
|
};
|
|
3730
3878
|
|
|
3731
3879
|
// src/controls/transform-control/transform-repeater-control.tsx
|
|
3732
|
-
var
|
|
3733
|
-
var
|
|
3734
|
-
var
|
|
3880
|
+
var React62 = __toESM(require("react"));
|
|
3881
|
+
var import_editor_props33 = require("@elementor/editor-props");
|
|
3882
|
+
var import_i18n27 = require("@wordpress/i18n");
|
|
3735
3883
|
|
|
3736
3884
|
// src/controls/transform-control/transform-content.tsx
|
|
3737
|
-
var
|
|
3738
|
-
var
|
|
3739
|
-
var
|
|
3885
|
+
var React59 = __toESM(require("react"));
|
|
3886
|
+
var import_ui53 = require("@elementor/ui");
|
|
3887
|
+
var import_i18n25 = require("@wordpress/i18n");
|
|
3740
3888
|
|
|
3741
3889
|
// src/controls/transform-control/functions/move.tsx
|
|
3742
|
-
var
|
|
3743
|
-
var
|
|
3744
|
-
var
|
|
3890
|
+
var React58 = __toESM(require("react"));
|
|
3891
|
+
var import_react35 = require("react");
|
|
3892
|
+
var import_editor_props32 = require("@elementor/editor-props");
|
|
3745
3893
|
var import_icons19 = require("@elementor/icons");
|
|
3746
|
-
var
|
|
3747
|
-
var
|
|
3894
|
+
var import_ui52 = require("@elementor/ui");
|
|
3895
|
+
var import_i18n24 = require("@wordpress/i18n");
|
|
3748
3896
|
|
|
3749
3897
|
// src/controls/transform-control/functions/axis-row.tsx
|
|
3750
|
-
var
|
|
3751
|
-
var
|
|
3898
|
+
var React57 = __toESM(require("react"));
|
|
3899
|
+
var import_ui51 = require("@elementor/ui");
|
|
3752
3900
|
var AxisRow = ({ label, bindValue, startIcon, anchorRef }) => {
|
|
3753
|
-
return /* @__PURE__ */
|
|
3901
|
+
return /* @__PURE__ */ React57.createElement(import_ui51.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React57.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ React57.createElement(import_ui51.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(ControlLabel, null, label)), /* @__PURE__ */ React57.createElement(import_ui51.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(PropKeyProvider, { bind: bindValue }, /* @__PURE__ */ React57.createElement(SizeControl, { anchorRef, startIcon })))));
|
|
3754
3902
|
};
|
|
3755
3903
|
|
|
3756
3904
|
// src/controls/transform-control/functions/move.tsx
|
|
3757
3905
|
var moveAxisControls = [
|
|
3758
3906
|
{
|
|
3759
|
-
label: (0,
|
|
3907
|
+
label: (0, import_i18n24.__)("Move X", "elementor"),
|
|
3760
3908
|
bindValue: "x",
|
|
3761
|
-
startIcon: /* @__PURE__ */
|
|
3909
|
+
startIcon: /* @__PURE__ */ React58.createElement(import_icons19.ArrowRightIcon, { fontSize: "tiny" })
|
|
3762
3910
|
},
|
|
3763
3911
|
{
|
|
3764
|
-
label: (0,
|
|
3912
|
+
label: (0, import_i18n24.__)("Move Y", "elementor"),
|
|
3765
3913
|
bindValue: "y",
|
|
3766
|
-
startIcon: /* @__PURE__ */
|
|
3914
|
+
startIcon: /* @__PURE__ */ React58.createElement(import_icons19.ArrowDownSmallIcon, { fontSize: "tiny" })
|
|
3767
3915
|
},
|
|
3768
3916
|
{
|
|
3769
|
-
label: (0,
|
|
3917
|
+
label: (0, import_i18n24.__)("Move Z", "elementor"),
|
|
3770
3918
|
bindValue: "z",
|
|
3771
|
-
startIcon: /* @__PURE__ */
|
|
3919
|
+
startIcon: /* @__PURE__ */ React58.createElement(import_icons19.ArrowDownLeftIcon, { fontSize: "tiny" })
|
|
3772
3920
|
}
|
|
3773
3921
|
];
|
|
3774
3922
|
var Move = () => {
|
|
3775
|
-
const context = useBoundProp(
|
|
3776
|
-
const rowRef = (0,
|
|
3777
|
-
return /* @__PURE__ */
|
|
3923
|
+
const context = useBoundProp(import_editor_props32.moveTransformPropTypeUtil);
|
|
3924
|
+
const rowRef = (0, import_react35.useRef)(null);
|
|
3925
|
+
return /* @__PURE__ */ React58.createElement(import_ui52.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React58.createElement(PropProvider, { ...context }, /* @__PURE__ */ React58.createElement(PropKeyProvider, { bind: "transform-move" }, moveAxisControls.map((control) => /* @__PURE__ */ React58.createElement(AxisRow, { key: control.bindValue, ...control, anchorRef: rowRef })))));
|
|
3778
3926
|
};
|
|
3779
3927
|
|
|
3780
3928
|
// src/controls/transform-control/transform-content.tsx
|
|
3781
3929
|
var TransformContent = ({ bind }) => {
|
|
3782
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
3783
|
-
return /* @__PURE__ */
|
|
3784
|
-
|
|
3930
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui53.useTabs)("transform-move");
|
|
3931
|
+
return /* @__PURE__ */ React59.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React59.createElement(PopoverContent, null, /* @__PURE__ */ React59.createElement(import_ui53.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React59.createElement(import_ui53.Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React59.createElement(
|
|
3932
|
+
import_ui53.Tabs,
|
|
3785
3933
|
{
|
|
3786
3934
|
size: "small",
|
|
3787
3935
|
variant: "fullWidth",
|
|
3788
3936
|
...getTabsProps(),
|
|
3789
|
-
"aria-label": (0,
|
|
3937
|
+
"aria-label": (0, import_i18n25.__)("Transform", "elementor")
|
|
3790
3938
|
},
|
|
3791
|
-
/* @__PURE__ */
|
|
3792
|
-
)), /* @__PURE__ */
|
|
3939
|
+
/* @__PURE__ */ React59.createElement(import_ui53.Tab, { label: (0, import_i18n25.__)("Move", "elementor"), ...getTabProps("transform-move") })
|
|
3940
|
+
)), /* @__PURE__ */ React59.createElement(import_ui53.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("transform-move") }, /* @__PURE__ */ React59.createElement(Move, null)))));
|
|
3793
3941
|
};
|
|
3794
3942
|
|
|
3795
3943
|
// src/controls/transform-control/transform-icon.tsx
|
|
3796
|
-
var
|
|
3944
|
+
var React60 = __toESM(require("react"));
|
|
3797
3945
|
var import_icons20 = require("@elementor/icons");
|
|
3798
3946
|
var TransformIcon = ({ value }) => {
|
|
3799
3947
|
switch (value.$$type) {
|
|
3800
3948
|
case "transform-move":
|
|
3801
|
-
return /* @__PURE__ */
|
|
3949
|
+
return /* @__PURE__ */ React60.createElement(import_icons20.ArrowsMaximizeIcon, { fontSize: "tiny" });
|
|
3802
3950
|
default:
|
|
3803
3951
|
return null;
|
|
3804
3952
|
}
|
|
3805
3953
|
};
|
|
3806
3954
|
|
|
3807
3955
|
// src/controls/transform-control/transform-label.tsx
|
|
3808
|
-
var
|
|
3809
|
-
var
|
|
3810
|
-
var
|
|
3956
|
+
var React61 = __toESM(require("react"));
|
|
3957
|
+
var import_ui54 = require("@elementor/ui");
|
|
3958
|
+
var import_i18n26 = require("@wordpress/i18n");
|
|
3811
3959
|
var transformMoveValue = (value) => Object.values(value).map((axis) => `${axis?.value.size}${axis?.value.unit}`).join(", ");
|
|
3812
3960
|
var TransformLabel = (props) => {
|
|
3813
3961
|
const { $$type, value } = props.value;
|
|
3814
3962
|
switch ($$type) {
|
|
3815
3963
|
case "transform-move":
|
|
3816
|
-
return /* @__PURE__ */
|
|
3964
|
+
return /* @__PURE__ */ React61.createElement(Label2, { label: (0, import_i18n26.__)("Move", "elementor"), value: transformMoveValue(value) });
|
|
3817
3965
|
default:
|
|
3818
3966
|
return "";
|
|
3819
3967
|
}
|
|
3820
3968
|
};
|
|
3821
3969
|
var Label2 = ({ label, value }) => {
|
|
3822
|
-
return /* @__PURE__ */
|
|
3970
|
+
return /* @__PURE__ */ React61.createElement(import_ui54.Box, { component: "span" }, label, ": ", value);
|
|
3823
3971
|
};
|
|
3824
3972
|
|
|
3825
3973
|
// src/controls/transform-control/transform-repeater-control.tsx
|
|
@@ -3832,15 +3980,15 @@ var initialTransformValue = {
|
|
|
3832
3980
|
}
|
|
3833
3981
|
};
|
|
3834
3982
|
var TransformRepeaterControl = createControl(() => {
|
|
3835
|
-
const { propType, value: transformValues, setValue, disabled } = useBoundProp(
|
|
3836
|
-
return /* @__PURE__ */
|
|
3983
|
+
const { propType, value: transformValues, setValue, disabled } = useBoundProp(import_editor_props33.transformPropTypeUtil);
|
|
3984
|
+
return /* @__PURE__ */ React62.createElement(PropProvider, { propType, value: transformValues, setValue }, /* @__PURE__ */ React62.createElement(
|
|
3837
3985
|
Repeater,
|
|
3838
3986
|
{
|
|
3839
3987
|
openOnAdd: true,
|
|
3840
3988
|
disabled,
|
|
3841
3989
|
values: transformValues ?? [],
|
|
3842
3990
|
setValues: setValue,
|
|
3843
|
-
label: (0,
|
|
3991
|
+
label: (0, import_i18n27.__)("Transform", "elementor"),
|
|
3844
3992
|
showDuplicate: false,
|
|
3845
3993
|
itemSettings: {
|
|
3846
3994
|
Icon: TransformIcon,
|