@elementor/editor-controls 1.1.0 → 1.3.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 +57 -0
- package/dist/index.d.mts +26 -13
- package/dist/index.d.ts +26 -13
- package/dist/index.js +979 -575
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +823 -418
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -11
- package/src/bound-prop-context/prop-context.tsx +3 -3
- package/src/bound-prop-context/prop-key-context.tsx +1 -0
- package/src/bound-prop-context/use-bound-prop.ts +5 -1
- package/src/components/font-family-selector.tsx +30 -13
- package/src/components/popover-content.tsx +3 -11
- package/src/components/repeater.tsx +3 -1
- package/src/components/text-field-popover.tsx +21 -20
- package/src/controls/aspect-ratio-control.tsx +20 -2
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx +2 -2
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx +2 -2
- package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +3 -10
- package/src/controls/box-shadow-repeater-control.tsx +3 -3
- package/src/controls/equal-unequal-sizes-control.tsx +4 -10
- package/src/controls/filter-repeater-control.tsx +186 -0
- package/src/controls/font-family-control/font-family-control.tsx +20 -4
- package/src/controls/gap-control.tsx +3 -3
- package/src/controls/image-control.tsx +46 -30
- package/src/controls/key-value-control.tsx +39 -19
- package/src/controls/link-control.tsx +28 -21
- package/src/controls/linked-dimensions-control.tsx +4 -4
- package/src/controls/number-control.tsx +3 -3
- package/src/controls/repeatable-control.tsx +98 -8
- package/src/controls/select-control.tsx +22 -2
- package/src/controls/size-control.tsx +3 -3
- package/src/controls/stroke-control.tsx +2 -2
- package/src/controls/svg-media-control.tsx +0 -2
- package/src/controls/switch-control.tsx +9 -1
- package/src/controls/transform-control/functions/axis-row.tsx +32 -0
- package/src/controls/transform-control/functions/move.tsx +44 -0
- package/src/controls/transform-control/transform-content.tsx +36 -0
- package/src/controls/transform-control/transform-icon.tsx +12 -0
- package/src/controls/transform-control/transform-label.tsx +27 -0
- package/src/controls/transform-control/transform-repeater-control.tsx +42 -0
- package/src/hooks/use-repeatable-control-context.ts +6 -1
- package/src/index.ts +4 -1
package/dist/index.js
CHANGED
|
@@ -41,6 +41,7 @@ __export(index_exports, {
|
|
|
41
41
|
ControlReplacementsProvider: () => ControlReplacementsProvider,
|
|
42
42
|
ControlToggleButtonGroup: () => ControlToggleButtonGroup,
|
|
43
43
|
EqualUnequalSizesControl: () => EqualUnequalSizesControl,
|
|
44
|
+
FilterRepeaterControl: () => FilterRepeaterControl,
|
|
44
45
|
FontFamilyControl: () => FontFamilyControl,
|
|
45
46
|
FontFamilySelector: () => FontFamilySelector,
|
|
46
47
|
GapControl: () => GapControl,
|
|
@@ -49,6 +50,7 @@ __export(index_exports, {
|
|
|
49
50
|
LinkControl: () => LinkControl,
|
|
50
51
|
LinkedDimensionsControl: () => LinkedDimensionsControl,
|
|
51
52
|
NumberControl: () => NumberControl,
|
|
53
|
+
PopoverContent: () => PopoverContent,
|
|
52
54
|
PositionControl: () => PositionControl,
|
|
53
55
|
PropKeyProvider: () => PropKeyProvider,
|
|
54
56
|
PropProvider: () => PropProvider,
|
|
@@ -57,10 +59,11 @@ __export(index_exports, {
|
|
|
57
59
|
SizeControl: () => SizeControl,
|
|
58
60
|
StrokeControl: () => StrokeControl,
|
|
59
61
|
SvgMediaControl: () => SvgMediaControl,
|
|
60
|
-
SwitchControl: () =>
|
|
62
|
+
SwitchControl: () => SwitchControl,
|
|
61
63
|
TextAreaControl: () => TextAreaControl,
|
|
62
64
|
TextControl: () => TextControl,
|
|
63
65
|
ToggleControl: () => ToggleControl,
|
|
66
|
+
TransformRepeaterControl: () => TransformRepeaterControl,
|
|
64
67
|
UrlControl: () => UrlControl,
|
|
65
68
|
createControlReplacementsRegistry: () => createControlReplacementsRegistry,
|
|
66
69
|
injectIntoRepeaterItemIcon: () => injectIntoRepeaterItemIcon,
|
|
@@ -104,7 +107,7 @@ var PropProvider = ({
|
|
|
104
107
|
setValue,
|
|
105
108
|
propType,
|
|
106
109
|
placeholder,
|
|
107
|
-
|
|
110
|
+
isDisabled
|
|
108
111
|
}) => {
|
|
109
112
|
return /* @__PURE__ */ React.createElement(
|
|
110
113
|
PropContext.Provider,
|
|
@@ -114,7 +117,7 @@ var PropProvider = ({
|
|
|
114
117
|
propType,
|
|
115
118
|
setValue,
|
|
116
119
|
placeholder,
|
|
117
|
-
|
|
120
|
+
isDisabled
|
|
118
121
|
}
|
|
119
122
|
},
|
|
120
123
|
children
|
|
@@ -204,8 +207,9 @@ var import_react3 = require("react");
|
|
|
204
207
|
function useBoundProp(propTypeUtil) {
|
|
205
208
|
const propKeyContext = usePropKeyContext();
|
|
206
209
|
const { isValid, validate, restoreValue } = useValidation(propKeyContext.propType);
|
|
210
|
+
const disabled = propKeyContext.isDisabled?.(propKeyContext.propType);
|
|
207
211
|
if (!propTypeUtil) {
|
|
208
|
-
return propKeyContext;
|
|
212
|
+
return { ...propKeyContext, disabled };
|
|
209
213
|
}
|
|
210
214
|
function setValue(value2, options, meta) {
|
|
211
215
|
if (!validate(value2)) {
|
|
@@ -225,7 +229,8 @@ function useBoundProp(propTypeUtil) {
|
|
|
225
229
|
setValue,
|
|
226
230
|
value: isValid ? value : null,
|
|
227
231
|
restoreValue,
|
|
228
|
-
placeholder
|
|
232
|
+
placeholder,
|
|
233
|
+
disabled
|
|
229
234
|
};
|
|
230
235
|
}
|
|
231
236
|
var useValidation = (propType) => {
|
|
@@ -439,7 +444,7 @@ var import_editor_props2 = require("@elementor/editor-props");
|
|
|
439
444
|
var import_editor_ui = require("@elementor/editor-ui");
|
|
440
445
|
var import_ui5 = require("@elementor/ui");
|
|
441
446
|
var SelectControl = createControl(({ options, onChange }) => {
|
|
442
|
-
const { value, setValue, disabled } = useBoundProp(import_editor_props2.stringPropTypeUtil);
|
|
447
|
+
const { value, setValue, disabled, placeholder } = useBoundProp(import_editor_props2.stringPropTypeUtil);
|
|
443
448
|
const handleChange = (event) => {
|
|
444
449
|
const newValue = event.target.value || null;
|
|
445
450
|
onChange?.(newValue, value);
|
|
@@ -451,6 +456,19 @@ var SelectControl = createControl(({ options, onChange }) => {
|
|
|
451
456
|
sx: { overflow: "hidden" },
|
|
452
457
|
displayEmpty: true,
|
|
453
458
|
size: "tiny",
|
|
459
|
+
renderValue: (selectedValue) => {
|
|
460
|
+
const findOptionByValue = (searchValue) => options.find((opt) => opt.value === searchValue);
|
|
461
|
+
if (!selectedValue || selectedValue === "") {
|
|
462
|
+
if (placeholder) {
|
|
463
|
+
const placeholderOption = findOptionByValue(placeholder);
|
|
464
|
+
const displayText = placeholderOption?.label || placeholder;
|
|
465
|
+
return /* @__PURE__ */ React9.createElement(import_ui5.Typography, { component: "span", variant: "caption", color: "text.tertiary" }, displayText);
|
|
466
|
+
}
|
|
467
|
+
return "";
|
|
468
|
+
}
|
|
469
|
+
const option = findOptionByValue(selectedValue);
|
|
470
|
+
return option?.label || selectedValue;
|
|
471
|
+
},
|
|
454
472
|
value: value ?? "",
|
|
455
473
|
onChange: handleChange,
|
|
456
474
|
disabled,
|
|
@@ -461,14 +479,30 @@ var SelectControl = createControl(({ options, onChange }) => {
|
|
|
461
479
|
});
|
|
462
480
|
|
|
463
481
|
// src/controls/image-control.tsx
|
|
464
|
-
var ImageControl = createControl(
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
482
|
+
var ImageControl = createControl(({ sizes, showMode = "all" }) => {
|
|
483
|
+
const propContext = useBoundProp(import_editor_props3.imagePropTypeUtil);
|
|
484
|
+
let componentToRender;
|
|
485
|
+
switch (showMode) {
|
|
486
|
+
case "media":
|
|
487
|
+
componentToRender = /* @__PURE__ */ React10.createElement(ImageSrcControl, null);
|
|
488
|
+
break;
|
|
489
|
+
case "sizes":
|
|
490
|
+
componentToRender = /* @__PURE__ */ React10.createElement(ImageSizeControl, { sizes });
|
|
491
|
+
break;
|
|
492
|
+
case "all":
|
|
493
|
+
default:
|
|
494
|
+
componentToRender = /* @__PURE__ */ React10.createElement(import_ui6.Stack, { gap: 1.5 }, /* @__PURE__ */ React10.createElement(ControlFormLabel, null, (0, import_i18n2.__)("Image", "elementor")), /* @__PURE__ */ React10.createElement(ImageSrcControl, null), /* @__PURE__ */ React10.createElement(import_ui6.Grid, { container: true, gap: 1.5, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React10.createElement(import_ui6.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React10.createElement(ControlFormLabel, null, (0, import_i18n2.__)("Resolution", "elementor"))), /* @__PURE__ */ React10.createElement(import_ui6.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React10.createElement(ImageSizeControl, { sizes }))));
|
|
470
495
|
}
|
|
471
|
-
);
|
|
496
|
+
return /* @__PURE__ */ React10.createElement(PropProvider, { ...propContext }, componentToRender);
|
|
497
|
+
});
|
|
498
|
+
var ImageSrcControl = () => {
|
|
499
|
+
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
500
|
+
const mediaTypes = allowSvgUpload ? ["image", "svg"] : ["image"];
|
|
501
|
+
return /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React10.createElement(ImageMediaControl, { mediaTypes }));
|
|
502
|
+
};
|
|
503
|
+
var ImageSizeControl = ({ sizes }) => {
|
|
504
|
+
return /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React10.createElement(SelectControl, { options: sizes }));
|
|
505
|
+
};
|
|
472
506
|
|
|
473
507
|
// src/controls/text-control.tsx
|
|
474
508
|
var React11 = __toESM(require("react"));
|
|
@@ -698,6 +732,15 @@ var TextFieldPopover = (props) => {
|
|
|
698
732
|
import_ui11.Popover,
|
|
699
733
|
{
|
|
700
734
|
disablePortal: true,
|
|
735
|
+
slotProps: {
|
|
736
|
+
paper: {
|
|
737
|
+
sx: {
|
|
738
|
+
borderRadius: 2,
|
|
739
|
+
width: anchorRef.current?.offsetWidth + "px",
|
|
740
|
+
p: 1.5
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
},
|
|
701
744
|
...(0, import_ui11.bindPopover)(popupState),
|
|
702
745
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
703
746
|
transformOrigin: { vertical: "top", horizontal: "center" },
|
|
@@ -707,27 +750,17 @@ var TextFieldPopover = (props) => {
|
|
|
707
750
|
}
|
|
708
751
|
},
|
|
709
752
|
/* @__PURE__ */ React15.createElement(
|
|
710
|
-
import_ui11.
|
|
753
|
+
import_ui11.TextField,
|
|
711
754
|
{
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
import_ui11.TextField,
|
|
720
|
-
{
|
|
721
|
-
value,
|
|
722
|
-
onChange,
|
|
723
|
-
size: "tiny",
|
|
724
|
-
type: "text",
|
|
725
|
-
fullWidth: true,
|
|
726
|
-
inputProps: {
|
|
727
|
-
autoFocus: true
|
|
728
|
-
}
|
|
755
|
+
value,
|
|
756
|
+
onChange,
|
|
757
|
+
size: "tiny",
|
|
758
|
+
type: "text",
|
|
759
|
+
fullWidth: true,
|
|
760
|
+
inputProps: {
|
|
761
|
+
autoFocus: true
|
|
729
762
|
}
|
|
730
|
-
|
|
763
|
+
}
|
|
731
764
|
)
|
|
732
765
|
);
|
|
733
766
|
};
|
|
@@ -982,7 +1015,7 @@ var ColorControl = createControl(
|
|
|
982
1015
|
var units = ["px", "em", "rem"];
|
|
983
1016
|
var StrokeControl = createControl(() => {
|
|
984
1017
|
const propContext = useBoundProp(import_editor_props8.strokePropTypeUtil);
|
|
985
|
-
const rowRef = (0, import_react11.useRef)();
|
|
1018
|
+
const rowRef = (0, import_react11.useRef)(null);
|
|
986
1019
|
return /* @__PURE__ */ React19.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React19.createElement(SectionContent, null, /* @__PURE__ */ React19.createElement(Control, { bind: "width", label: (0, import_i18n3.__)("Stroke width", "elementor"), ref: rowRef }, /* @__PURE__ */ React19.createElement(SizeControl, { units, anchorRef: rowRef })), /* @__PURE__ */ React19.createElement(Control, { bind: "color", label: (0, import_i18n3.__)("Stroke color", "elementor") }, /* @__PURE__ */ React19.createElement(ColorControl, null))));
|
|
987
1020
|
});
|
|
988
1021
|
var Control = (0, import_react11.forwardRef)(({ bind, label, children }, ref) => /* @__PURE__ */ React19.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React19.createElement(import_ui15.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref }, /* @__PURE__ */ React19.createElement(import_ui15.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React19.createElement(import_ui15.Grid, { item: true, xs: 6 }, children))));
|
|
@@ -997,7 +1030,7 @@ var import_i18n5 = require("@wordpress/i18n");
|
|
|
997
1030
|
// src/components/popover-content.tsx
|
|
998
1031
|
var React20 = __toESM(require("react"));
|
|
999
1032
|
var import_ui16 = require("@elementor/ui");
|
|
1000
|
-
var PopoverContent = ({
|
|
1033
|
+
var PopoverContent = ({ gap = 1.5, children, ...props }) => /* @__PURE__ */ React20.createElement(import_ui16.Stack, { ...props, gap }, children);
|
|
1001
1034
|
|
|
1002
1035
|
// src/components/popover-grid-container.tsx
|
|
1003
1036
|
var import_react12 = require("react");
|
|
@@ -1126,7 +1159,8 @@ var Repeater = ({
|
|
|
1126
1159
|
values: repeaterValues = [],
|
|
1127
1160
|
setValues: setRepeaterValues,
|
|
1128
1161
|
showDuplicate = true,
|
|
1129
|
-
showToggle = true
|
|
1162
|
+
showToggle = true,
|
|
1163
|
+
isSortable = true
|
|
1130
1164
|
}) => {
|
|
1131
1165
|
const [openItem, setOpenItem] = (0, import_react14.useState)(EMPTY_OPEN_ITEM);
|
|
1132
1166
|
const [items, setItems] = useSyncExternalState({
|
|
@@ -1219,7 +1253,7 @@ var Repeater = ({
|
|
|
1219
1253
|
if (!value) {
|
|
1220
1254
|
return null;
|
|
1221
1255
|
}
|
|
1222
|
-
return /* @__PURE__ */ React25.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled }, /* @__PURE__ */ React25.createElement(
|
|
1256
|
+
return /* @__PURE__ */ React25.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React25.createElement(
|
|
1223
1257
|
RepeaterItem,
|
|
1224
1258
|
{
|
|
1225
1259
|
disabled,
|
|
@@ -1309,7 +1343,7 @@ var usePopover = (openOnMount, onOpen) => {
|
|
|
1309
1343
|
// src/controls/box-shadow-repeater-control.tsx
|
|
1310
1344
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
1311
1345
|
const { propType, value, setValue, disabled } = useBoundProp(import_editor_props9.boxShadowPropTypeUtil);
|
|
1312
|
-
return /* @__PURE__ */ React26.createElement(PropProvider, { propType, value, setValue, disabled }, /* @__PURE__ */ React26.createElement(
|
|
1346
|
+
return /* @__PURE__ */ React26.createElement(PropProvider, { propType, value, setValue, isDisabled: () => disabled }, /* @__PURE__ */ React26.createElement(
|
|
1313
1347
|
Repeater,
|
|
1314
1348
|
{
|
|
1315
1349
|
openOnAdd: true,
|
|
@@ -1332,7 +1366,7 @@ var ItemContent = ({ anchorEl, bind }) => {
|
|
|
1332
1366
|
};
|
|
1333
1367
|
var Content = ({ anchorEl }) => {
|
|
1334
1368
|
const context = useBoundProp(import_editor_props9.shadowPropTypeUtil);
|
|
1335
|
-
const rowRef = [(0, import_react15.useRef)(), (0, import_react15.useRef)()];
|
|
1369
|
+
const rowRef = [(0, import_react15.useRef)(null), (0, import_react15.useRef)(null)];
|
|
1336
1370
|
return /* @__PURE__ */ React26.createElement(PropProvider, { ...context }, /* @__PURE__ */ React26.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React26.createElement(PopoverGridContainer, null, /* @__PURE__ */ React26.createElement(Control2, { bind: "color", label: (0, import_i18n5.__)("Color", "elementor") }, /* @__PURE__ */ React26.createElement(ColorControl, { anchorEl })), /* @__PURE__ */ React26.createElement(Control2, { bind: "position", label: (0, import_i18n5.__)("Position", "elementor"), sx: { overflow: "hidden" } }, /* @__PURE__ */ React26.createElement(
|
|
1337
1371
|
SelectControl,
|
|
1338
1372
|
{
|
|
@@ -1391,29 +1425,138 @@ var initialShadow = {
|
|
|
1391
1425
|
}
|
|
1392
1426
|
};
|
|
1393
1427
|
|
|
1394
|
-
// src/controls/
|
|
1395
|
-
var React29 = __toESM(require("react"));
|
|
1396
|
-
var import_editor_props10 = require("@elementor/editor-props");
|
|
1397
|
-
|
|
1398
|
-
// src/components/control-toggle-button-group.tsx
|
|
1428
|
+
// src/controls/filter-repeater-control.tsx
|
|
1399
1429
|
var React28 = __toESM(require("react"));
|
|
1400
1430
|
var import_react16 = require("react");
|
|
1401
|
-
var
|
|
1431
|
+
var import_editor_props10 = require("@elementor/editor-props");
|
|
1432
|
+
var import_editor_ui3 = require("@elementor/editor-ui");
|
|
1402
1433
|
var import_ui22 = require("@elementor/ui");
|
|
1434
|
+
var import_i18n6 = require("@wordpress/i18n");
|
|
1403
1435
|
|
|
1404
|
-
// src/components/
|
|
1436
|
+
// src/components/control-label.tsx
|
|
1405
1437
|
var React27 = __toESM(require("react"));
|
|
1406
1438
|
var import_ui21 = require("@elementor/ui");
|
|
1439
|
+
var ControlLabel = ({ children }) => {
|
|
1440
|
+
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
|
+
};
|
|
1442
|
+
|
|
1443
|
+
// src/controls/filter-repeater-control.tsx
|
|
1444
|
+
var DEFAULT_FILTER_KEY = "blur";
|
|
1445
|
+
var filterConfig = {
|
|
1446
|
+
blur: {
|
|
1447
|
+
defaultValue: { $$type: "radius", radius: { $$type: "size", value: { size: 0, unit: "px" } } },
|
|
1448
|
+
name: (0, import_i18n6.__)("Blur", "elementor"),
|
|
1449
|
+
valueName: (0, import_i18n6.__)("Radius", "elementor"),
|
|
1450
|
+
propType: import_editor_props10.blurFilterPropTypeUtil,
|
|
1451
|
+
units: defaultUnits.filter((unit) => unit !== "%")
|
|
1452
|
+
},
|
|
1453
|
+
brightness: {
|
|
1454
|
+
defaultValue: { $$type: "amount", amount: { $$type: "size", value: { size: 100, unit: "%" } } },
|
|
1455
|
+
name: (0, import_i18n6.__)("Brightness", "elementor"),
|
|
1456
|
+
valueName: (0, import_i18n6.__)("Amount", "elementor"),
|
|
1457
|
+
propType: import_editor_props10.brightnessFilterPropTypeUtil,
|
|
1458
|
+
units: ["%"]
|
|
1459
|
+
}
|
|
1460
|
+
};
|
|
1461
|
+
var filterKeys = Object.keys(filterConfig);
|
|
1462
|
+
var singleSizeFilterNames = filterKeys.filter((name) => {
|
|
1463
|
+
const filter = filterConfig[name].defaultValue;
|
|
1464
|
+
return filter[filter.$$type].$$type === "size";
|
|
1465
|
+
});
|
|
1466
|
+
var FilterRepeaterControl = createControl(() => {
|
|
1467
|
+
const { propType, value: filterValues, setValue, disabled } = useBoundProp(import_editor_props10.filterPropTypeUtil);
|
|
1468
|
+
return /* @__PURE__ */ React28.createElement(PropProvider, { propType, value: filterValues, setValue }, /* @__PURE__ */ React28.createElement(
|
|
1469
|
+
Repeater,
|
|
1470
|
+
{
|
|
1471
|
+
openOnAdd: true,
|
|
1472
|
+
disabled,
|
|
1473
|
+
values: filterValues ?? [],
|
|
1474
|
+
setValues: setValue,
|
|
1475
|
+
label: (0, import_i18n6.__)("Filter", "elementor"),
|
|
1476
|
+
itemSettings: {
|
|
1477
|
+
Icon: ItemIcon2,
|
|
1478
|
+
Label: ItemLabel2,
|
|
1479
|
+
Content: ItemContent2,
|
|
1480
|
+
initialValues: {
|
|
1481
|
+
$$type: DEFAULT_FILTER_KEY,
|
|
1482
|
+
value: filterConfig[DEFAULT_FILTER_KEY].defaultValue
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
));
|
|
1487
|
+
});
|
|
1488
|
+
var ItemIcon2 = () => /* @__PURE__ */ React28.createElement(React28.Fragment, null);
|
|
1489
|
+
var ItemLabel2 = (props) => {
|
|
1490
|
+
const { $$type } = props.value;
|
|
1491
|
+
return singleSizeFilterNames.includes($$type) && /* @__PURE__ */ React28.createElement(SingleSizeItemLabel, { value: props.value });
|
|
1492
|
+
};
|
|
1493
|
+
var SingleSizeItemLabel = ({ value }) => {
|
|
1494
|
+
const { $$type, value: sizeValue } = value;
|
|
1495
|
+
const { $$type: key } = filterConfig[$$type].defaultValue;
|
|
1496
|
+
const defaultUnit = filterConfig[$$type].defaultValue[key].value.unit;
|
|
1497
|
+
const { unit, size } = sizeValue[key]?.value ?? { unit: defaultUnit, size: 0 };
|
|
1498
|
+
const label = /* @__PURE__ */ React28.createElement(import_ui22.Box, { component: "span", style: { textTransform: "capitalize" } }, value.$$type, ":");
|
|
1499
|
+
return /* @__PURE__ */ React28.createElement(import_ui22.Box, { component: "span" }, label, unit !== "custom" ? ` ${size ?? 0}${unit ?? defaultUnit}` : size);
|
|
1500
|
+
};
|
|
1501
|
+
var ItemContent2 = ({ bind }) => {
|
|
1502
|
+
const { value: filterValues, setValue } = useBoundProp(import_editor_props10.filterPropTypeUtil);
|
|
1503
|
+
const itemIndex = parseInt(bind, 10);
|
|
1504
|
+
const item = filterValues?.[itemIndex];
|
|
1505
|
+
const handleChange = (e) => {
|
|
1506
|
+
const newFilterValues = [...filterValues];
|
|
1507
|
+
const filterType = e.target.value;
|
|
1508
|
+
newFilterValues[itemIndex] = {
|
|
1509
|
+
$$type: filterType,
|
|
1510
|
+
value: filterConfig[filterType].defaultValue
|
|
1511
|
+
};
|
|
1512
|
+
setValue(newFilterValues);
|
|
1513
|
+
};
|
|
1514
|
+
return /* @__PURE__ */ React28.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React28.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React28.createElement(PopoverGridContainer, null, /* @__PURE__ */ React28.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(ControlLabel, null, (0, import_i18n6.__)("Filter", "elementor"))), /* @__PURE__ */ React28.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(
|
|
1515
|
+
import_ui22.Select,
|
|
1516
|
+
{
|
|
1517
|
+
sx: { overflow: "hidden" },
|
|
1518
|
+
size: "tiny",
|
|
1519
|
+
value: item?.$$type ?? DEFAULT_FILTER_KEY,
|
|
1520
|
+
onChange: handleChange,
|
|
1521
|
+
fullWidth: true
|
|
1522
|
+
},
|
|
1523
|
+
filterKeys.map((filterKey) => /* @__PURE__ */ React28.createElement(import_editor_ui3.MenuListItem, { key: filterKey, value: filterKey }, filterConfig[filterKey].name))
|
|
1524
|
+
))), /* @__PURE__ */ React28.createElement(Content2, { filterType: item?.$$type })));
|
|
1525
|
+
};
|
|
1526
|
+
var Content2 = ({ filterType }) => {
|
|
1527
|
+
return singleSizeFilterNames.includes(filterType) && /* @__PURE__ */ React28.createElement(SingleSizeItemContent, { filterType });
|
|
1528
|
+
};
|
|
1529
|
+
var SingleSizeItemContent = ({ filterType }) => {
|
|
1530
|
+
const { propType, valueName, defaultValue, units: units2 } = filterConfig[filterType];
|
|
1531
|
+
const { $$type } = defaultValue;
|
|
1532
|
+
const context = useBoundProp(propType);
|
|
1533
|
+
const rowRef = (0, import_react16.useRef)(null);
|
|
1534
|
+
return /* @__PURE__ */ React28.createElement(PropProvider, { ...context }, /* @__PURE__ */ React28.createElement(PropKeyProvider, { bind: $$type }, /* @__PURE__ */ React28.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React28.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(ControlLabel, null, valueName)), /* @__PURE__ */ React28.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(SizeControl, { anchorRef: rowRef, units: units2 })))));
|
|
1535
|
+
};
|
|
1536
|
+
|
|
1537
|
+
// src/controls/toggle-control.tsx
|
|
1538
|
+
var React31 = __toESM(require("react"));
|
|
1539
|
+
var import_editor_props11 = require("@elementor/editor-props");
|
|
1540
|
+
|
|
1541
|
+
// src/components/control-toggle-button-group.tsx
|
|
1542
|
+
var React30 = __toESM(require("react"));
|
|
1543
|
+
var import_react17 = require("react");
|
|
1544
|
+
var import_icons5 = require("@elementor/icons");
|
|
1545
|
+
var import_ui24 = require("@elementor/ui");
|
|
1546
|
+
|
|
1547
|
+
// src/components/conditional-tooltip.tsx
|
|
1548
|
+
var React29 = __toESM(require("react"));
|
|
1549
|
+
var import_ui23 = require("@elementor/ui");
|
|
1407
1550
|
var ConditionalTooltip = ({
|
|
1408
1551
|
showTooltip,
|
|
1409
1552
|
children,
|
|
1410
1553
|
label
|
|
1411
1554
|
}) => {
|
|
1412
|
-
return showTooltip && label ? /* @__PURE__ */
|
|
1555
|
+
return showTooltip && label ? /* @__PURE__ */ React29.createElement(import_ui23.Tooltip, { title: label, disableFocusListener: true, placement: "top" }, children) : children;
|
|
1413
1556
|
};
|
|
1414
1557
|
|
|
1415
1558
|
// src/components/control-toggle-button-group.tsx
|
|
1416
|
-
var StyledToggleButtonGroup = (0,
|
|
1559
|
+
var StyledToggleButtonGroup = (0, import_ui24.styled)(import_ui24.ToggleButtonGroup)`
|
|
1417
1560
|
${({ justify }) => `justify-content: ${justify};`}
|
|
1418
1561
|
button:not( :last-of-type ) {
|
|
1419
1562
|
border-start-end-radius: 0;
|
|
@@ -1442,17 +1585,17 @@ var ControlToggleButtonGroup = ({
|
|
|
1442
1585
|
const shouldSliceItems = exclusive && maxItems !== void 0 && items.length > maxItems;
|
|
1443
1586
|
const menuItems = shouldSliceItems ? items.slice(maxItems - 1) : [];
|
|
1444
1587
|
const fixedItems = shouldSliceItems ? items.slice(0, maxItems - 1) : items;
|
|
1445
|
-
const isRtl = "rtl" === (0,
|
|
1588
|
+
const isRtl = "rtl" === (0, import_ui24.useTheme)().direction;
|
|
1446
1589
|
const handleChange = (_, newValue) => {
|
|
1447
1590
|
onChange(newValue);
|
|
1448
1591
|
};
|
|
1449
|
-
const getGridTemplateColumns = (0,
|
|
1592
|
+
const getGridTemplateColumns = (0, import_react17.useMemo)(() => {
|
|
1450
1593
|
const isOffLimits = menuItems?.length;
|
|
1451
1594
|
const itemsCount = isOffLimits ? fixedItems.length + 1 : fixedItems.length;
|
|
1452
1595
|
const templateColumnsSuffix = isOffLimits ? "auto" : "";
|
|
1453
1596
|
return `repeat(${itemsCount}, minmax(0, 25%)) ${templateColumnsSuffix}`;
|
|
1454
1597
|
}, [menuItems?.length, fixedItems.length]);
|
|
1455
|
-
return /* @__PURE__ */
|
|
1598
|
+
return /* @__PURE__ */ React30.createElement(ControlActions, null, /* @__PURE__ */ React30.createElement(
|
|
1456
1599
|
StyledToggleButtonGroup,
|
|
1457
1600
|
{
|
|
1458
1601
|
justify,
|
|
@@ -1467,16 +1610,16 @@ var ControlToggleButtonGroup = ({
|
|
|
1467
1610
|
width: `100%`
|
|
1468
1611
|
}
|
|
1469
1612
|
},
|
|
1470
|
-
fixedItems.map(({ label, value: buttonValue, renderContent:
|
|
1613
|
+
fixedItems.map(({ label, value: buttonValue, renderContent: Content5, showTooltip }) => /* @__PURE__ */ React30.createElement(
|
|
1471
1614
|
ConditionalTooltip,
|
|
1472
1615
|
{
|
|
1473
1616
|
key: buttonValue,
|
|
1474
1617
|
label,
|
|
1475
1618
|
showTooltip: showTooltip || false
|
|
1476
1619
|
},
|
|
1477
|
-
/* @__PURE__ */
|
|
1620
|
+
/* @__PURE__ */ React30.createElement(import_ui24.ToggleButton, { value: buttonValue, "aria-label": label, size, fullWidth }, /* @__PURE__ */ React30.createElement(Content5, { size }))
|
|
1478
1621
|
)),
|
|
1479
|
-
menuItems.length && exclusive && /* @__PURE__ */
|
|
1622
|
+
menuItems.length && exclusive && /* @__PURE__ */ React30.createElement(
|
|
1480
1623
|
SplitButtonGroup,
|
|
1481
1624
|
{
|
|
1482
1625
|
size,
|
|
@@ -1496,8 +1639,8 @@ var SplitButtonGroup = ({
|
|
|
1496
1639
|
value
|
|
1497
1640
|
}) => {
|
|
1498
1641
|
const previewButton = usePreviewButton(items, value);
|
|
1499
|
-
const [isMenuOpen, setIsMenuOpen] = (0,
|
|
1500
|
-
const menuButtonRef = (0,
|
|
1642
|
+
const [isMenuOpen, setIsMenuOpen] = (0, import_react17.useState)(false);
|
|
1643
|
+
const menuButtonRef = (0, import_react17.useRef)(null);
|
|
1501
1644
|
const onMenuToggle = (ev) => {
|
|
1502
1645
|
setIsMenuOpen((prev) => !prev);
|
|
1503
1646
|
ev.preventDefault();
|
|
@@ -1510,8 +1653,8 @@ var SplitButtonGroup = ({
|
|
|
1510
1653
|
const shouldRemove = newValue === value;
|
|
1511
1654
|
onChange(shouldRemove ? null : newValue);
|
|
1512
1655
|
};
|
|
1513
|
-
return /* @__PURE__ */
|
|
1514
|
-
|
|
1656
|
+
return /* @__PURE__ */ React30.createElement(React30.Fragment, null, /* @__PURE__ */ React30.createElement(
|
|
1657
|
+
import_ui24.ToggleButton,
|
|
1515
1658
|
{
|
|
1516
1659
|
value: previewButton.value,
|
|
1517
1660
|
"aria-label": previewButton.label,
|
|
@@ -1524,8 +1667,8 @@ var SplitButtonGroup = ({
|
|
|
1524
1667
|
ref: menuButtonRef
|
|
1525
1668
|
},
|
|
1526
1669
|
previewButton.renderContent({ size })
|
|
1527
|
-
), /* @__PURE__ */
|
|
1528
|
-
|
|
1670
|
+
), /* @__PURE__ */ React30.createElement(
|
|
1671
|
+
import_ui24.ToggleButton,
|
|
1529
1672
|
{
|
|
1530
1673
|
size,
|
|
1531
1674
|
"aria-expanded": isMenuOpen ? "true" : void 0,
|
|
@@ -1535,9 +1678,9 @@ var SplitButtonGroup = ({
|
|
|
1535
1678
|
ref: menuButtonRef,
|
|
1536
1679
|
value: "__chevron-icon-button__"
|
|
1537
1680
|
},
|
|
1538
|
-
/* @__PURE__ */
|
|
1539
|
-
), /* @__PURE__ */
|
|
1540
|
-
|
|
1681
|
+
/* @__PURE__ */ React30.createElement(import_icons5.ChevronDownIcon, { fontSize: size })
|
|
1682
|
+
), /* @__PURE__ */ React30.createElement(
|
|
1683
|
+
import_ui24.Menu,
|
|
1541
1684
|
{
|
|
1542
1685
|
open: isMenuOpen,
|
|
1543
1686
|
onClose: () => setIsMenuOpen(false),
|
|
@@ -1554,22 +1697,22 @@ var SplitButtonGroup = ({
|
|
|
1554
1697
|
mt: 0.5
|
|
1555
1698
|
}
|
|
1556
1699
|
},
|
|
1557
|
-
items.map(({ label, value: buttonValue }) => /* @__PURE__ */
|
|
1558
|
-
|
|
1700
|
+
items.map(({ label, value: buttonValue }) => /* @__PURE__ */ React30.createElement(
|
|
1701
|
+
import_ui24.MenuItem,
|
|
1559
1702
|
{
|
|
1560
1703
|
key: buttonValue,
|
|
1561
1704
|
selected: buttonValue === value,
|
|
1562
1705
|
onClick: () => onMenuItemClick(buttonValue)
|
|
1563
1706
|
},
|
|
1564
|
-
/* @__PURE__ */
|
|
1707
|
+
/* @__PURE__ */ React30.createElement(import_ui24.ListItemText, null, /* @__PURE__ */ React30.createElement(import_ui24.Typography, { sx: { fontSize: "14px" } }, label))
|
|
1565
1708
|
))
|
|
1566
1709
|
));
|
|
1567
1710
|
};
|
|
1568
1711
|
var usePreviewButton = (items, value) => {
|
|
1569
|
-
const [previewButton, setPreviewButton] = (0,
|
|
1712
|
+
const [previewButton, setPreviewButton] = (0, import_react17.useState)(
|
|
1570
1713
|
items.find((item) => item.value === value) ?? items[0]
|
|
1571
1714
|
);
|
|
1572
|
-
(0,
|
|
1715
|
+
(0, import_react17.useEffect)(() => {
|
|
1573
1716
|
const selectedButton = items.find((item) => item.value === value);
|
|
1574
1717
|
if (selectedButton) {
|
|
1575
1718
|
setPreviewButton(selectedButton);
|
|
@@ -1587,7 +1730,7 @@ var ToggleControl = createControl(
|
|
|
1587
1730
|
exclusive = true,
|
|
1588
1731
|
maxItems
|
|
1589
1732
|
}) => {
|
|
1590
|
-
const { value, setValue, placeholder, disabled } = useBoundProp(
|
|
1733
|
+
const { value, setValue, placeholder, disabled } = useBoundProp(import_editor_props11.stringPropTypeUtil);
|
|
1591
1734
|
const exclusiveValues = options.filter((option) => option.exclusive).map((option) => option.value);
|
|
1592
1735
|
const handleNonExclusiveToggle = (selectedValues) => {
|
|
1593
1736
|
const newSelectedValue = selectedValues[selectedValues.length - 1];
|
|
@@ -1601,7 +1744,7 @@ var ToggleControl = createControl(
|
|
|
1601
1744
|
fullWidth,
|
|
1602
1745
|
size
|
|
1603
1746
|
};
|
|
1604
|
-
return exclusive ? /* @__PURE__ */
|
|
1747
|
+
return exclusive ? /* @__PURE__ */ React31.createElement(
|
|
1605
1748
|
ControlToggleButtonGroup,
|
|
1606
1749
|
{
|
|
1607
1750
|
...toggleButtonGroupProps,
|
|
@@ -1610,7 +1753,7 @@ var ToggleControl = createControl(
|
|
|
1610
1753
|
disabled,
|
|
1611
1754
|
exclusive: true
|
|
1612
1755
|
}
|
|
1613
|
-
) : /* @__PURE__ */
|
|
1756
|
+
) : /* @__PURE__ */ React31.createElement(
|
|
1614
1757
|
ControlToggleButtonGroup,
|
|
1615
1758
|
{
|
|
1616
1759
|
...toggleButtonGroupProps,
|
|
@@ -1624,20 +1767,20 @@ var ToggleControl = createControl(
|
|
|
1624
1767
|
);
|
|
1625
1768
|
|
|
1626
1769
|
// src/controls/number-control.tsx
|
|
1627
|
-
var
|
|
1628
|
-
var
|
|
1629
|
-
var
|
|
1770
|
+
var React32 = __toESM(require("react"));
|
|
1771
|
+
var import_editor_props12 = require("@elementor/editor-props");
|
|
1772
|
+
var import_ui25 = require("@elementor/ui");
|
|
1630
1773
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
1631
1774
|
var RESTRICTED_INPUT_KEYS2 = ["e", "E", "+", "-"];
|
|
1632
1775
|
var NumberControl = createControl(
|
|
1633
1776
|
({
|
|
1634
|
-
placeholder,
|
|
1777
|
+
placeholder: labelPlaceholder,
|
|
1635
1778
|
max = Number.MAX_VALUE,
|
|
1636
1779
|
min = -Number.MAX_VALUE,
|
|
1637
1780
|
step = 1,
|
|
1638
1781
|
shouldForceInt = false
|
|
1639
1782
|
}) => {
|
|
1640
|
-
const { value, setValue, disabled } = useBoundProp(
|
|
1783
|
+
const { value, setValue, placeholder, disabled } = useBoundProp(import_editor_props12.numberPropTypeUtil);
|
|
1641
1784
|
const handleChange = (event) => {
|
|
1642
1785
|
const eventValue = event.target.value;
|
|
1643
1786
|
if (isEmptyOrNaN(eventValue)) {
|
|
@@ -1647,8 +1790,8 @@ var NumberControl = createControl(
|
|
|
1647
1790
|
const formattedValue = shouldForceInt ? +parseInt(eventValue) : Number(eventValue);
|
|
1648
1791
|
setValue(Math.min(Math.max(formattedValue, min), max));
|
|
1649
1792
|
};
|
|
1650
|
-
return /* @__PURE__ */
|
|
1651
|
-
|
|
1793
|
+
return /* @__PURE__ */ React32.createElement(ControlActions, null, /* @__PURE__ */ React32.createElement(
|
|
1794
|
+
import_ui25.TextField,
|
|
1652
1795
|
{
|
|
1653
1796
|
size: "tiny",
|
|
1654
1797
|
type: "number",
|
|
@@ -1656,7 +1799,7 @@ var NumberControl = createControl(
|
|
|
1656
1799
|
disabled,
|
|
1657
1800
|
value: isEmptyOrNaN(value) ? "" : value,
|
|
1658
1801
|
onChange: handleChange,
|
|
1659
|
-
placeholder,
|
|
1802
|
+
placeholder: labelPlaceholder ?? (placeholder ? String(placeholder) : ""),
|
|
1660
1803
|
inputProps: { step },
|
|
1661
1804
|
onKeyDown: (event) => {
|
|
1662
1805
|
if (RESTRICTED_INPUT_KEYS2.includes(event.key)) {
|
|
@@ -1669,21 +1812,12 @@ var NumberControl = createControl(
|
|
|
1669
1812
|
);
|
|
1670
1813
|
|
|
1671
1814
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
1672
|
-
var
|
|
1673
|
-
var
|
|
1674
|
-
var
|
|
1815
|
+
var React33 = __toESM(require("react"));
|
|
1816
|
+
var import_react18 = require("react");
|
|
1817
|
+
var import_editor_props13 = require("@elementor/editor-props");
|
|
1675
1818
|
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
1676
|
-
var
|
|
1677
|
-
var
|
|
1678
|
-
|
|
1679
|
-
// src/components/control-label.tsx
|
|
1680
|
-
var React31 = __toESM(require("react"));
|
|
1681
|
-
var import_ui24 = require("@elementor/ui");
|
|
1682
|
-
var ControlLabel = ({ children }) => {
|
|
1683
|
-
return /* @__PURE__ */ React31.createElement(import_ui24.Stack, { direction: "row", alignItems: "center", justifyItems: "start", gap: 0.25 }, /* @__PURE__ */ React31.createElement(ControlFormLabel, null, children), /* @__PURE__ */ React31.createElement(ControlAdornments, null));
|
|
1684
|
-
};
|
|
1685
|
-
|
|
1686
|
-
// src/controls/equal-unequal-sizes-control.tsx
|
|
1819
|
+
var import_ui26 = require("@elementor/ui");
|
|
1820
|
+
var import_i18n7 = require("@wordpress/i18n");
|
|
1687
1821
|
var isEqualSizes = (propValue, items) => {
|
|
1688
1822
|
const values = Object.values(propValue);
|
|
1689
1823
|
if (values.length !== items.length) {
|
|
@@ -1701,22 +1835,22 @@ function EqualUnequalSizesControl({
|
|
|
1701
1835
|
items,
|
|
1702
1836
|
multiSizePropTypeUtil
|
|
1703
1837
|
}) {
|
|
1704
|
-
const popupId = (0,
|
|
1705
|
-
const popupState = (0,
|
|
1838
|
+
const popupId = (0, import_react18.useId)();
|
|
1839
|
+
const popupState = (0, import_ui26.usePopupState)({ variant: "popover", popupId });
|
|
1706
1840
|
const {
|
|
1707
1841
|
propType: multiSizePropType,
|
|
1708
1842
|
value: multiSizeValue,
|
|
1709
1843
|
setValue: setMultiSizeValue,
|
|
1710
1844
|
disabled: multiSizeDisabled
|
|
1711
1845
|
} = useBoundProp(multiSizePropTypeUtil);
|
|
1712
|
-
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(
|
|
1713
|
-
const rowRefs = [(0,
|
|
1846
|
+
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(import_editor_props13.sizePropTypeUtil);
|
|
1847
|
+
const rowRefs = [(0, import_react18.useRef)(null), (0, import_react18.useRef)(null)];
|
|
1714
1848
|
const splitEqualValue = () => {
|
|
1715
1849
|
if (!sizeValue) {
|
|
1716
1850
|
return null;
|
|
1717
1851
|
}
|
|
1718
1852
|
return items.reduce(
|
|
1719
|
-
(acc, { bind }) => ({ ...acc, [bind]:
|
|
1853
|
+
(acc, { bind }) => ({ ...acc, [bind]: import_editor_props13.sizePropTypeUtil.create(sizeValue) }),
|
|
1720
1854
|
{}
|
|
1721
1855
|
);
|
|
1722
1856
|
};
|
|
@@ -1739,25 +1873,25 @@ function EqualUnequalSizesControl({
|
|
|
1739
1873
|
};
|
|
1740
1874
|
const isShowingGeneralIndicator = !(0, import_editor_v1_adapters2.isExperimentActive)("e_v_3_30") || !popupState.isOpen;
|
|
1741
1875
|
const isMixed = !!multiSizeValue;
|
|
1742
|
-
return /* @__PURE__ */
|
|
1876
|
+
return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(import_ui26.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: rowRefs[0] }, /* @__PURE__ */ React33.createElement(import_ui26.Grid, { item: true, xs: 6 }, !isShowingGeneralIndicator ? /* @__PURE__ */ React33.createElement(ControlFormLabel, null, label) : /* @__PURE__ */ React33.createElement(ControlLabel, null, label)), /* @__PURE__ */ React33.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(import_ui26.Stack, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React33.createElement(
|
|
1743
1877
|
SizeControl,
|
|
1744
1878
|
{
|
|
1745
|
-
placeholder: isMixed ? (0,
|
|
1879
|
+
placeholder: isMixed ? (0, import_i18n7.__)("Mixed", "elementor") : void 0,
|
|
1746
1880
|
anchorRef: rowRefs[0]
|
|
1747
1881
|
}
|
|
1748
|
-
), /* @__PURE__ */
|
|
1749
|
-
|
|
1882
|
+
), /* @__PURE__ */ React33.createElement(import_ui26.Tooltip, { title: tooltipLabel, placement: "top" }, /* @__PURE__ */ React33.createElement(
|
|
1883
|
+
import_ui26.ToggleButton,
|
|
1750
1884
|
{
|
|
1751
1885
|
size: "tiny",
|
|
1752
1886
|
value: "check",
|
|
1753
1887
|
sx: { marginLeft: "auto" },
|
|
1754
|
-
...(0,
|
|
1888
|
+
...(0, import_ui26.bindToggle)(popupState),
|
|
1755
1889
|
selected: popupState.isOpen,
|
|
1756
1890
|
"aria-label": tooltipLabel
|
|
1757
1891
|
},
|
|
1758
1892
|
icon
|
|
1759
|
-
))))), /* @__PURE__ */
|
|
1760
|
-
|
|
1893
|
+
))))), /* @__PURE__ */ React33.createElement(
|
|
1894
|
+
import_ui26.Popover,
|
|
1761
1895
|
{
|
|
1762
1896
|
disablePortal: true,
|
|
1763
1897
|
disableScrollLock: true,
|
|
@@ -1769,53 +1903,50 @@ function EqualUnequalSizesControl({
|
|
|
1769
1903
|
vertical: "top",
|
|
1770
1904
|
horizontal: "right"
|
|
1771
1905
|
},
|
|
1772
|
-
...(0,
|
|
1906
|
+
...(0, import_ui26.bindPopover)(popupState),
|
|
1773
1907
|
slotProps: {
|
|
1774
1908
|
paper: { sx: { mt: 0.5, width: rowRefs[0].current?.getBoundingClientRect().width } }
|
|
1775
1909
|
}
|
|
1776
1910
|
},
|
|
1777
|
-
/* @__PURE__ */
|
|
1911
|
+
/* @__PURE__ */ React33.createElement(
|
|
1778
1912
|
PropProvider,
|
|
1779
1913
|
{
|
|
1780
1914
|
propType: multiSizePropType,
|
|
1781
1915
|
value: getMultiSizeValues(),
|
|
1782
1916
|
setValue: setNestedProp,
|
|
1783
|
-
|
|
1917
|
+
isDisabled: () => multiSizeDisabled
|
|
1784
1918
|
},
|
|
1785
|
-
/* @__PURE__ */
|
|
1919
|
+
/* @__PURE__ */ React33.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React33.createElement(PopoverGridContainer, { ref: rowRefs[1] }, /* @__PURE__ */ React33.createElement(MultiSizeValueControl, { item: items[0], rowRef: rowRefs[1] }), /* @__PURE__ */ React33.createElement(MultiSizeValueControl, { item: items[1], rowRef: rowRefs[1] })), /* @__PURE__ */ React33.createElement(PopoverGridContainer, { ref: rowRefs[2] }, /* @__PURE__ */ React33.createElement(MultiSizeValueControl, { item: items[2], rowRef: rowRefs[2] }), /* @__PURE__ */ React33.createElement(MultiSizeValueControl, { item: items[3], rowRef: rowRefs[2] })))
|
|
1786
1920
|
)
|
|
1787
1921
|
));
|
|
1788
1922
|
}
|
|
1789
|
-
var MultiSizeValueControl = ({
|
|
1790
|
-
item,
|
|
1791
|
-
rowRef
|
|
1792
|
-
}) => {
|
|
1923
|
+
var MultiSizeValueControl = ({ item, rowRef }) => {
|
|
1793
1924
|
const isUsingNestedProps = (0, import_editor_v1_adapters2.isExperimentActive)("e_v_3_30");
|
|
1794
|
-
return /* @__PURE__ */
|
|
1925
|
+
return /* @__PURE__ */ React33.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React33.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(import_ui26.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React33.createElement(import_ui26.Grid, { item: true, xs: 12 }, isUsingNestedProps ? /* @__PURE__ */ React33.createElement(ControlLabel, null, item.label) : /* @__PURE__ */ React33.createElement(ControlFormLabel, null, item.label)), /* @__PURE__ */ React33.createElement(import_ui26.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React33.createElement(SizeControl, { startIcon: item.icon, anchorRef: rowRef })))));
|
|
1795
1926
|
};
|
|
1796
1927
|
|
|
1797
1928
|
// src/controls/linked-dimensions-control.tsx
|
|
1798
|
-
var
|
|
1799
|
-
var
|
|
1800
|
-
var
|
|
1929
|
+
var React34 = __toESM(require("react"));
|
|
1930
|
+
var import_react19 = require("react");
|
|
1931
|
+
var import_editor_props14 = require("@elementor/editor-props");
|
|
1801
1932
|
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
1802
1933
|
var import_icons6 = require("@elementor/icons");
|
|
1803
|
-
var
|
|
1804
|
-
var
|
|
1934
|
+
var import_ui27 = require("@elementor/ui");
|
|
1935
|
+
var import_i18n8 = require("@wordpress/i18n");
|
|
1805
1936
|
var LinkedDimensionsControl = createControl(
|
|
1806
1937
|
({
|
|
1807
1938
|
label,
|
|
1808
1939
|
isSiteRtl = false,
|
|
1809
1940
|
extendedOptions
|
|
1810
1941
|
}) => {
|
|
1811
|
-
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(
|
|
1812
|
-
const gridRowRefs = [(0,
|
|
1942
|
+
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(import_editor_props14.sizePropTypeUtil);
|
|
1943
|
+
const gridRowRefs = [(0, import_react19.useRef)(null), (0, import_react19.useRef)(null)];
|
|
1813
1944
|
const {
|
|
1814
1945
|
value: dimensionsValue,
|
|
1815
1946
|
setValue: setDimensionsValue,
|
|
1816
1947
|
propType,
|
|
1817
1948
|
disabled: dimensionsDisabled
|
|
1818
|
-
} = useBoundProp(
|
|
1949
|
+
} = useBoundProp(import_editor_props14.dimensionsPropTypeUtil);
|
|
1819
1950
|
const isLinked = !dimensionsValue && !sizeValue ? true : !!sizeValue;
|
|
1820
1951
|
const isUsingNestedProps = (0, import_editor_v1_adapters3.isExperimentActive)("e_v_3_30");
|
|
1821
1952
|
const onLinkToggle = () => {
|
|
@@ -1823,7 +1954,7 @@ var LinkedDimensionsControl = createControl(
|
|
|
1823
1954
|
setSizeValue(dimensionsValue["block-start"]?.value ?? null);
|
|
1824
1955
|
return;
|
|
1825
1956
|
}
|
|
1826
|
-
const value = sizeValue ?
|
|
1957
|
+
const value = sizeValue ? import_editor_props14.sizePropTypeUtil.create(sizeValue) : null;
|
|
1827
1958
|
setDimensionsValue({
|
|
1828
1959
|
"block-start": value,
|
|
1829
1960
|
"block-end": value,
|
|
@@ -1833,19 +1964,19 @@ var LinkedDimensionsControl = createControl(
|
|
|
1833
1964
|
};
|
|
1834
1965
|
const tooltipLabel = label.toLowerCase();
|
|
1835
1966
|
const LinkedIcon = isLinked ? import_icons6.LinkIcon : import_icons6.DetachIcon;
|
|
1836
|
-
const linkedLabel = (0,
|
|
1837
|
-
const unlinkedLabel = (0,
|
|
1967
|
+
const linkedLabel = (0, import_i18n8.__)("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
1968
|
+
const unlinkedLabel = (0, import_i18n8.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
1838
1969
|
const disabled = sizeDisabled || dimensionsDisabled;
|
|
1839
|
-
return /* @__PURE__ */
|
|
1970
|
+
return /* @__PURE__ */ React34.createElement(
|
|
1840
1971
|
PropProvider,
|
|
1841
1972
|
{
|
|
1842
1973
|
propType,
|
|
1843
1974
|
value: dimensionsValue,
|
|
1844
1975
|
setValue: setDimensionsValue,
|
|
1845
|
-
disabled
|
|
1976
|
+
isDisabled: () => disabled
|
|
1846
1977
|
},
|
|
1847
|
-
/* @__PURE__ */
|
|
1848
|
-
|
|
1978
|
+
/* @__PURE__ */ React34.createElement(import_ui27.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, isUsingNestedProps ? /* @__PURE__ */ React34.createElement(ControlFormLabel, null, label) : /* @__PURE__ */ React34.createElement(ControlLabel, null, label), /* @__PURE__ */ React34.createElement(import_ui27.Tooltip, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React34.createElement(
|
|
1979
|
+
import_ui27.ToggleButton,
|
|
1849
1980
|
{
|
|
1850
1981
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
1851
1982
|
size: "tiny",
|
|
@@ -1855,9 +1986,9 @@ var LinkedDimensionsControl = createControl(
|
|
|
1855
1986
|
onChange: onLinkToggle,
|
|
1856
1987
|
disabled
|
|
1857
1988
|
},
|
|
1858
|
-
/* @__PURE__ */
|
|
1989
|
+
/* @__PURE__ */ React34.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1859
1990
|
))),
|
|
1860
|
-
getCssMarginProps(isSiteRtl).map((row, index) => /* @__PURE__ */
|
|
1991
|
+
getCssMarginProps(isSiteRtl).map((row, index) => /* @__PURE__ */ React34.createElement(import_ui27.Stack, { direction: "row", gap: 2, flexWrap: "nowrap", key: index, ref: gridRowRefs[index] }, row.map(({ icon, ...props }) => /* @__PURE__ */ React34.createElement(import_ui27.Grid, { container: true, gap: 0.75, alignItems: "center", key: props.bind }, /* @__PURE__ */ React34.createElement(import_ui27.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React34.createElement(Label, { ...props })), /* @__PURE__ */ React34.createElement(import_ui27.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React34.createElement(
|
|
1861
1992
|
Control3,
|
|
1862
1993
|
{
|
|
1863
1994
|
bind: props.bind,
|
|
@@ -1878,60 +2009,60 @@ var Control3 = ({
|
|
|
1878
2009
|
anchorRef
|
|
1879
2010
|
}) => {
|
|
1880
2011
|
if (isLinked) {
|
|
1881
|
-
return /* @__PURE__ */
|
|
2012
|
+
return /* @__PURE__ */ React34.createElement(SizeControl, { startIcon, extendedOptions, anchorRef });
|
|
1882
2013
|
}
|
|
1883
|
-
return /* @__PURE__ */
|
|
2014
|
+
return /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React34.createElement(SizeControl, { startIcon, extendedOptions, anchorRef }));
|
|
1884
2015
|
};
|
|
1885
2016
|
var Label = ({ label, bind }) => {
|
|
1886
2017
|
const isUsingNestedProps = (0, import_editor_v1_adapters3.isExperimentActive)("e_v_3_30");
|
|
1887
2018
|
if (!isUsingNestedProps) {
|
|
1888
|
-
return /* @__PURE__ */
|
|
2019
|
+
return /* @__PURE__ */ React34.createElement(ControlFormLabel, null, label);
|
|
1889
2020
|
}
|
|
1890
|
-
return /* @__PURE__ */
|
|
2021
|
+
return /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React34.createElement(ControlLabel, null, label));
|
|
1891
2022
|
};
|
|
1892
2023
|
function getCssMarginProps(isSiteRtl) {
|
|
1893
2024
|
return [
|
|
1894
2025
|
[
|
|
1895
2026
|
{
|
|
1896
2027
|
bind: "block-start",
|
|
1897
|
-
label: (0,
|
|
1898
|
-
icon: /* @__PURE__ */
|
|
2028
|
+
label: (0, import_i18n8.__)("Top", "elementor"),
|
|
2029
|
+
icon: /* @__PURE__ */ React34.createElement(import_icons6.SideTopIcon, { fontSize: "tiny" })
|
|
1899
2030
|
},
|
|
1900
2031
|
{
|
|
1901
2032
|
bind: "inline-end",
|
|
1902
|
-
label: isSiteRtl ? (0,
|
|
1903
|
-
icon: isSiteRtl ? /* @__PURE__ */
|
|
2033
|
+
label: isSiteRtl ? (0, import_i18n8.__)("Left", "elementor") : (0, import_i18n8.__)("Right", "elementor"),
|
|
2034
|
+
icon: isSiteRtl ? /* @__PURE__ */ React34.createElement(import_icons6.SideLeftIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React34.createElement(import_icons6.SideRightIcon, { fontSize: "tiny" })
|
|
1904
2035
|
}
|
|
1905
2036
|
],
|
|
1906
2037
|
[
|
|
1907
2038
|
{
|
|
1908
2039
|
bind: "block-end",
|
|
1909
|
-
label: (0,
|
|
1910
|
-
icon: /* @__PURE__ */
|
|
2040
|
+
label: (0, import_i18n8.__)("Bottom", "elementor"),
|
|
2041
|
+
icon: /* @__PURE__ */ React34.createElement(import_icons6.SideBottomIcon, { fontSize: "tiny" })
|
|
1911
2042
|
},
|
|
1912
2043
|
{
|
|
1913
2044
|
bind: "inline-start",
|
|
1914
|
-
label: isSiteRtl ? (0,
|
|
1915
|
-
icon: isSiteRtl ? /* @__PURE__ */
|
|
2045
|
+
label: isSiteRtl ? (0, import_i18n8.__)("Right", "elementor") : (0, import_i18n8.__)("Left", "elementor"),
|
|
2046
|
+
icon: isSiteRtl ? /* @__PURE__ */ React34.createElement(import_icons6.SideRightIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React34.createElement(import_icons6.SideLeftIcon, { fontSize: "tiny" })
|
|
1916
2047
|
}
|
|
1917
2048
|
]
|
|
1918
2049
|
];
|
|
1919
2050
|
}
|
|
1920
2051
|
|
|
1921
2052
|
// src/controls/font-family-control/font-family-control.tsx
|
|
1922
|
-
var
|
|
1923
|
-
var
|
|
2053
|
+
var React36 = __toESM(require("react"));
|
|
2054
|
+
var import_editor_props15 = require("@elementor/editor-props");
|
|
1924
2055
|
var import_icons8 = require("@elementor/icons");
|
|
1925
|
-
var
|
|
2056
|
+
var import_ui29 = require("@elementor/ui");
|
|
1926
2057
|
|
|
1927
2058
|
// src/components/font-family-selector.tsx
|
|
1928
|
-
var
|
|
1929
|
-
var
|
|
1930
|
-
var
|
|
2059
|
+
var React35 = __toESM(require("react"));
|
|
2060
|
+
var import_react20 = require("react");
|
|
2061
|
+
var import_editor_ui4 = require("@elementor/editor-ui");
|
|
1931
2062
|
var import_icons7 = require("@elementor/icons");
|
|
1932
|
-
var
|
|
2063
|
+
var import_ui28 = require("@elementor/ui");
|
|
1933
2064
|
var import_utils2 = require("@elementor/utils");
|
|
1934
|
-
var
|
|
2065
|
+
var import_i18n9 = require("@wordpress/i18n");
|
|
1935
2066
|
|
|
1936
2067
|
// src/controls/font-family-control/enqueue-font.tsx
|
|
1937
2068
|
var enqueueFont = (fontFamily, context = "editor") => {
|
|
@@ -1961,9 +2092,10 @@ var FontFamilySelector = ({
|
|
|
1961
2092
|
fontFamilies,
|
|
1962
2093
|
fontFamily,
|
|
1963
2094
|
onFontFamilyChange,
|
|
1964
|
-
onClose
|
|
2095
|
+
onClose,
|
|
2096
|
+
sectionWidth
|
|
1965
2097
|
}) => {
|
|
1966
|
-
const [searchValue, setSearchValue] = (0,
|
|
2098
|
+
const [searchValue, setSearchValue] = (0, import_react20.useState)("");
|
|
1967
2099
|
const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
|
|
1968
2100
|
const handleSearch = (value) => {
|
|
1969
2101
|
setSearchValue(value);
|
|
@@ -1972,21 +2104,21 @@ var FontFamilySelector = ({
|
|
|
1972
2104
|
setSearchValue("");
|
|
1973
2105
|
onClose();
|
|
1974
2106
|
};
|
|
1975
|
-
return /* @__PURE__ */
|
|
1976
|
-
|
|
2107
|
+
return /* @__PURE__ */ React35.createElement(import_ui28.Stack, null, /* @__PURE__ */ React35.createElement(
|
|
2108
|
+
import_editor_ui4.PopoverHeader,
|
|
1977
2109
|
{
|
|
1978
|
-
title: (0,
|
|
2110
|
+
title: (0, import_i18n9.__)("Font Family", "elementor"),
|
|
1979
2111
|
onClose: handleClose,
|
|
1980
|
-
icon: /* @__PURE__ */
|
|
2112
|
+
icon: /* @__PURE__ */ React35.createElement(import_icons7.TextIcon, { fontSize: SIZE2 })
|
|
1981
2113
|
}
|
|
1982
|
-
), /* @__PURE__ */
|
|
1983
|
-
|
|
2114
|
+
), /* @__PURE__ */ React35.createElement(
|
|
2115
|
+
import_editor_ui4.PopoverSearch,
|
|
1984
2116
|
{
|
|
1985
2117
|
value: searchValue,
|
|
1986
2118
|
onSearch: handleSearch,
|
|
1987
|
-
placeholder: (0,
|
|
2119
|
+
placeholder: (0, import_i18n9.__)("Search", "elementor")
|
|
1988
2120
|
}
|
|
1989
|
-
), /* @__PURE__ */
|
|
2121
|
+
), /* @__PURE__ */ React35.createElement(import_ui28.Divider, null), /* @__PURE__ */ React35.createElement(import_editor_ui4.PopoverScrollableContent, { width: sectionWidth }, filteredFontFamilies.length > 0 ? /* @__PURE__ */ React35.createElement(
|
|
1990
2122
|
FontList,
|
|
1991
2123
|
{
|
|
1992
2124
|
fontListItems: filteredFontFamilies,
|
|
@@ -1994,30 +2126,53 @@ var FontFamilySelector = ({
|
|
|
1994
2126
|
handleClose,
|
|
1995
2127
|
fontFamily
|
|
1996
2128
|
}
|
|
1997
|
-
) : /* @__PURE__ */
|
|
1998
|
-
|
|
2129
|
+
) : /* @__PURE__ */ React35.createElement(
|
|
2130
|
+
import_ui28.Stack,
|
|
1999
2131
|
{
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
}
|
|
2007
|
-
},
|
|
2008
|
-
/* @__PURE__ */ React34.createElement("span", null, "\u201C"),
|
|
2009
|
-
/* @__PURE__ */ React34.createElement("span", { style: { maxWidth: "80%", overflow: "hidden", textOverflow: "ellipsis" } }, searchValue),
|
|
2010
|
-
/* @__PURE__ */ React34.createElement("span", null, "\u201D.")
|
|
2011
|
-
)), /* @__PURE__ */ React34.createElement(import_ui27.Typography, { align: "center", variant: "caption", color: "text.secondary" }, (0, import_i18n8.__)("Try something else.", "elementor"), /* @__PURE__ */ React34.createElement(
|
|
2012
|
-
import_ui27.Link,
|
|
2013
|
-
{
|
|
2014
|
-
color: "secondary",
|
|
2015
|
-
variant: "caption",
|
|
2016
|
-
component: "button",
|
|
2017
|
-
onClick: () => setSearchValue("")
|
|
2132
|
+
alignItems: "center",
|
|
2133
|
+
justifyContent: "center",
|
|
2134
|
+
height: "100%",
|
|
2135
|
+
p: 2.5,
|
|
2136
|
+
gap: 1.5,
|
|
2137
|
+
overflow: "hidden"
|
|
2018
2138
|
},
|
|
2019
|
-
|
|
2020
|
-
|
|
2139
|
+
/* @__PURE__ */ React35.createElement(import_icons7.TextIcon, { fontSize: "large" }),
|
|
2140
|
+
/* @__PURE__ */ React35.createElement(import_ui28.Box, { sx: { maxWidth: 160, overflow: "hidden" } }, /* @__PURE__ */ React35.createElement(import_ui28.Typography, { align: "center", variant: "subtitle2", color: "text.secondary" }, (0, import_i18n9.__)("Sorry, nothing matched", "elementor")), /* @__PURE__ */ React35.createElement(
|
|
2141
|
+
import_ui28.Typography,
|
|
2142
|
+
{
|
|
2143
|
+
variant: "subtitle2",
|
|
2144
|
+
color: "text.secondary",
|
|
2145
|
+
sx: {
|
|
2146
|
+
display: "flex",
|
|
2147
|
+
width: "100%",
|
|
2148
|
+
justifyContent: "center"
|
|
2149
|
+
}
|
|
2150
|
+
},
|
|
2151
|
+
/* @__PURE__ */ React35.createElement("span", null, "\u201C"),
|
|
2152
|
+
/* @__PURE__ */ React35.createElement("span", { style: { maxWidth: "80%", overflow: "hidden", textOverflow: "ellipsis" } }, searchValue),
|
|
2153
|
+
/* @__PURE__ */ React35.createElement("span", null, "\u201D.")
|
|
2154
|
+
)),
|
|
2155
|
+
/* @__PURE__ */ React35.createElement(
|
|
2156
|
+
import_ui28.Typography,
|
|
2157
|
+
{
|
|
2158
|
+
align: "center",
|
|
2159
|
+
variant: "caption",
|
|
2160
|
+
color: "text.secondary",
|
|
2161
|
+
sx: { display: "flex", flexDirection: "column" }
|
|
2162
|
+
},
|
|
2163
|
+
(0, import_i18n9.__)("Try something else.", "elementor"),
|
|
2164
|
+
/* @__PURE__ */ React35.createElement(
|
|
2165
|
+
import_ui28.Link,
|
|
2166
|
+
{
|
|
2167
|
+
color: "secondary",
|
|
2168
|
+
variant: "caption",
|
|
2169
|
+
component: "button",
|
|
2170
|
+
onClick: () => setSearchValue("")
|
|
2171
|
+
},
|
|
2172
|
+
(0, import_i18n9.__)("Clear & try again", "elementor")
|
|
2173
|
+
)
|
|
2174
|
+
)
|
|
2175
|
+
)));
|
|
2021
2176
|
};
|
|
2022
2177
|
var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
2023
2178
|
const selectedItem = fontListItems.find((item) => item.value === fontFamily);
|
|
@@ -2029,8 +2184,8 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
2029
2184
|
}
|
|
2030
2185
|
});
|
|
2031
2186
|
}, 100);
|
|
2032
|
-
return /* @__PURE__ */
|
|
2033
|
-
|
|
2187
|
+
return /* @__PURE__ */ React35.createElement(
|
|
2188
|
+
import_editor_ui4.PopoverMenuList,
|
|
2034
2189
|
{
|
|
2035
2190
|
items: fontListItems,
|
|
2036
2191
|
selectedValue: selectedItem?.value,
|
|
@@ -2043,55 +2198,65 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
2043
2198
|
);
|
|
2044
2199
|
};
|
|
2045
2200
|
var useDebounce = (fn, delay) => {
|
|
2046
|
-
const [debouncedFn] = (0,
|
|
2047
|
-
(0,
|
|
2201
|
+
const [debouncedFn] = (0, import_react20.useState)(() => (0, import_utils2.debounce)(fn, delay));
|
|
2202
|
+
(0, import_react20.useEffect)(() => () => debouncedFn.cancel(), [debouncedFn]);
|
|
2048
2203
|
return debouncedFn;
|
|
2049
2204
|
};
|
|
2050
2205
|
|
|
2051
2206
|
// src/controls/font-family-control/font-family-control.tsx
|
|
2052
2207
|
var SIZE3 = "tiny";
|
|
2053
|
-
var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
2054
|
-
const { value: fontFamily, setValue: setFontFamily, disabled } = useBoundProp(
|
|
2055
|
-
const popoverState = (0,
|
|
2056
|
-
|
|
2057
|
-
|
|
2208
|
+
var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
2209
|
+
const { value: fontFamily, setValue: setFontFamily, disabled, placeholder } = useBoundProp(import_editor_props15.stringPropTypeUtil);
|
|
2210
|
+
const popoverState = (0, import_ui29.usePopupState)({ variant: "popover" });
|
|
2211
|
+
const isShowingPlaceholder = !fontFamily && placeholder;
|
|
2212
|
+
return /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(ControlActions, null, /* @__PURE__ */ React36.createElement(
|
|
2213
|
+
import_ui29.UnstableTag,
|
|
2058
2214
|
{
|
|
2059
2215
|
variant: "outlined",
|
|
2060
|
-
label: fontFamily,
|
|
2061
|
-
endIcon: /* @__PURE__ */
|
|
2062
|
-
...(0,
|
|
2216
|
+
label: fontFamily || placeholder,
|
|
2217
|
+
endIcon: /* @__PURE__ */ React36.createElement(import_icons8.ChevronDownIcon, { fontSize: SIZE3 }),
|
|
2218
|
+
...(0, import_ui29.bindTrigger)(popoverState),
|
|
2063
2219
|
fullWidth: true,
|
|
2064
|
-
disabled
|
|
2220
|
+
disabled,
|
|
2221
|
+
sx: isShowingPlaceholder ? {
|
|
2222
|
+
"& .MuiTag-label": {
|
|
2223
|
+
color: (theme) => theme.palette.text.tertiary
|
|
2224
|
+
},
|
|
2225
|
+
textTransform: "capitalize"
|
|
2226
|
+
} : void 0
|
|
2065
2227
|
}
|
|
2066
|
-
)), /* @__PURE__ */
|
|
2067
|
-
|
|
2228
|
+
)), /* @__PURE__ */ React36.createElement(
|
|
2229
|
+
import_ui29.Popover,
|
|
2068
2230
|
{
|
|
2069
2231
|
disablePortal: true,
|
|
2070
2232
|
disableScrollLock: true,
|
|
2071
|
-
anchorOrigin: { vertical: "bottom", horizontal: "
|
|
2072
|
-
|
|
2233
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
2234
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
2235
|
+
sx: { my: 1.5 },
|
|
2236
|
+
...(0, import_ui29.bindPopover)(popoverState)
|
|
2073
2237
|
},
|
|
2074
|
-
/* @__PURE__ */
|
|
2238
|
+
/* @__PURE__ */ React36.createElement(
|
|
2075
2239
|
FontFamilySelector,
|
|
2076
2240
|
{
|
|
2077
2241
|
fontFamilies,
|
|
2078
2242
|
fontFamily,
|
|
2079
2243
|
onFontFamilyChange: setFontFamily,
|
|
2080
|
-
onClose: popoverState.close
|
|
2244
|
+
onClose: popoverState.close,
|
|
2245
|
+
sectionWidth
|
|
2081
2246
|
}
|
|
2082
2247
|
)
|
|
2083
2248
|
));
|
|
2084
2249
|
});
|
|
2085
2250
|
|
|
2086
2251
|
// src/controls/url-control.tsx
|
|
2087
|
-
var
|
|
2088
|
-
var
|
|
2089
|
-
var
|
|
2252
|
+
var React37 = __toESM(require("react"));
|
|
2253
|
+
var import_editor_props16 = require("@elementor/editor-props");
|
|
2254
|
+
var import_ui30 = require("@elementor/ui");
|
|
2090
2255
|
var UrlControl = createControl(({ placeholder }) => {
|
|
2091
|
-
const { value, setValue, disabled } = useBoundProp(
|
|
2256
|
+
const { value, setValue, disabled } = useBoundProp(import_editor_props16.urlPropTypeUtil);
|
|
2092
2257
|
const handleChange = (event) => setValue(event.target.value);
|
|
2093
|
-
return /* @__PURE__ */
|
|
2094
|
-
|
|
2258
|
+
return /* @__PURE__ */ React37.createElement(ControlActions, null, /* @__PURE__ */ React37.createElement(
|
|
2259
|
+
import_ui30.TextField,
|
|
2095
2260
|
{
|
|
2096
2261
|
size: "tiny",
|
|
2097
2262
|
fullWidth: true,
|
|
@@ -2104,24 +2269,25 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
2104
2269
|
});
|
|
2105
2270
|
|
|
2106
2271
|
// src/controls/link-control.tsx
|
|
2107
|
-
var
|
|
2108
|
-
var
|
|
2272
|
+
var React40 = __toESM(require("react"));
|
|
2273
|
+
var import_react22 = require("react");
|
|
2109
2274
|
var import_editor_elements = require("@elementor/editor-elements");
|
|
2110
|
-
var
|
|
2111
|
-
var
|
|
2275
|
+
var import_editor_props18 = require("@elementor/editor-props");
|
|
2276
|
+
var import_editor_ui5 = require("@elementor/editor-ui");
|
|
2277
|
+
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
2112
2278
|
var import_http_client2 = require("@elementor/http-client");
|
|
2113
2279
|
var import_icons10 = require("@elementor/icons");
|
|
2114
2280
|
var import_session = require("@elementor/session");
|
|
2115
|
-
var
|
|
2281
|
+
var import_ui33 = require("@elementor/ui");
|
|
2116
2282
|
var import_utils3 = require("@elementor/utils");
|
|
2117
|
-
var
|
|
2283
|
+
var import_i18n10 = require("@wordpress/i18n");
|
|
2118
2284
|
|
|
2119
2285
|
// src/components/autocomplete.tsx
|
|
2120
|
-
var
|
|
2121
|
-
var
|
|
2286
|
+
var React38 = __toESM(require("react"));
|
|
2287
|
+
var import_react21 = require("react");
|
|
2122
2288
|
var import_icons9 = require("@elementor/icons");
|
|
2123
|
-
var
|
|
2124
|
-
var Autocomplete = (0,
|
|
2289
|
+
var import_ui31 = require("@elementor/ui");
|
|
2290
|
+
var Autocomplete = (0, import_react21.forwardRef)((props, ref) => {
|
|
2125
2291
|
const {
|
|
2126
2292
|
options,
|
|
2127
2293
|
onOptionChange,
|
|
@@ -2137,8 +2303,8 @@ var Autocomplete = (0, import_react20.forwardRef)((props, ref) => {
|
|
|
2137
2303
|
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
2138
2304
|
const isOptionEqualToValue = muiWarningPreventer ? void 0 : () => true;
|
|
2139
2305
|
const isValueFromOptions = typeof value === "number" && !!findMatchingOption(options, value);
|
|
2140
|
-
return /* @__PURE__ */
|
|
2141
|
-
|
|
2306
|
+
return /* @__PURE__ */ React38.createElement(
|
|
2307
|
+
import_ui31.Autocomplete,
|
|
2142
2308
|
{
|
|
2143
2309
|
...restProps,
|
|
2144
2310
|
ref,
|
|
@@ -2155,8 +2321,8 @@ var Autocomplete = (0, import_react20.forwardRef)((props, ref) => {
|
|
|
2155
2321
|
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
2156
2322
|
isOptionEqualToValue,
|
|
2157
2323
|
filterOptions: () => optionKeys,
|
|
2158
|
-
renderOption: (optionProps, optionId) => /* @__PURE__ */
|
|
2159
|
-
renderInput: (params) => /* @__PURE__ */
|
|
2324
|
+
renderOption: (optionProps, optionId) => /* @__PURE__ */ React38.createElement(import_ui31.Box, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
2325
|
+
renderInput: (params) => /* @__PURE__ */ React38.createElement(
|
|
2160
2326
|
TextInput,
|
|
2161
2327
|
{
|
|
2162
2328
|
params,
|
|
@@ -2179,8 +2345,8 @@ var TextInput = ({
|
|
|
2179
2345
|
const onChange = (event) => {
|
|
2180
2346
|
handleChange(event.target.value);
|
|
2181
2347
|
};
|
|
2182
|
-
return /* @__PURE__ */
|
|
2183
|
-
|
|
2348
|
+
return /* @__PURE__ */ React38.createElement(
|
|
2349
|
+
import_ui31.TextField,
|
|
2184
2350
|
{
|
|
2185
2351
|
...params,
|
|
2186
2352
|
placeholder,
|
|
@@ -2192,7 +2358,7 @@ var TextInput = ({
|
|
|
2192
2358
|
},
|
|
2193
2359
|
InputProps: {
|
|
2194
2360
|
...params.InputProps,
|
|
2195
|
-
endAdornment: /* @__PURE__ */
|
|
2361
|
+
endAdornment: /* @__PURE__ */ React38.createElement(ClearButton, { params, allowClear, handleChange })
|
|
2196
2362
|
}
|
|
2197
2363
|
}
|
|
2198
2364
|
);
|
|
@@ -2201,7 +2367,7 @@ var ClearButton = ({
|
|
|
2201
2367
|
allowClear,
|
|
2202
2368
|
handleChange,
|
|
2203
2369
|
params
|
|
2204
|
-
}) => /* @__PURE__ */
|
|
2370
|
+
}) => /* @__PURE__ */ React38.createElement(import_ui31.InputAdornment, { position: "end" }, allowClear && /* @__PURE__ */ React38.createElement(import_ui31.IconButton, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React38.createElement(import_icons9.XIcon, { fontSize: params.size })));
|
|
2205
2371
|
function findMatchingOption(options, optionId = null) {
|
|
2206
2372
|
const formattedOption = (optionId || "").toString();
|
|
2207
2373
|
return options.find(({ id }) => formattedOption === id.toString());
|
|
@@ -2222,25 +2388,49 @@ function _factoryFilter(newValue, options, minInputLength) {
|
|
|
2222
2388
|
);
|
|
2223
2389
|
}
|
|
2224
2390
|
|
|
2391
|
+
// src/controls/switch-control.tsx
|
|
2392
|
+
var React39 = __toESM(require("react"));
|
|
2393
|
+
var import_editor_props17 = require("@elementor/editor-props");
|
|
2394
|
+
var import_ui32 = require("@elementor/ui");
|
|
2395
|
+
var SwitchControl = createControl(() => {
|
|
2396
|
+
const { value, setValue, disabled } = useBoundProp(import_editor_props17.booleanPropTypeUtil);
|
|
2397
|
+
const handleChange = (event) => {
|
|
2398
|
+
setValue(event.target.checked);
|
|
2399
|
+
};
|
|
2400
|
+
return /* @__PURE__ */ React39.createElement("div", { style: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React39.createElement(
|
|
2401
|
+
import_ui32.Switch,
|
|
2402
|
+
{
|
|
2403
|
+
checked: !!value,
|
|
2404
|
+
onChange: handleChange,
|
|
2405
|
+
size: "small",
|
|
2406
|
+
disabled,
|
|
2407
|
+
inputProps: {
|
|
2408
|
+
...disabled ? { style: { opacity: 0 } } : {}
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
));
|
|
2412
|
+
});
|
|
2413
|
+
|
|
2225
2414
|
// src/controls/link-control.tsx
|
|
2226
2415
|
var SIZE4 = "tiny";
|
|
2227
2416
|
var learnMoreButton = {
|
|
2228
|
-
label: (0,
|
|
2417
|
+
label: (0, import_i18n10.__)("Learn More", "elementor"),
|
|
2229
2418
|
href: "https://go.elementor.com/element-link-inside-link-infotip"
|
|
2230
2419
|
};
|
|
2231
2420
|
var LinkControl = createControl((props) => {
|
|
2232
|
-
const { value, path, setValue, ...propContext } = useBoundProp(
|
|
2421
|
+
const { value, path, setValue, ...propContext } = useBoundProp(import_editor_props18.linkPropTypeUtil);
|
|
2233
2422
|
const [linkSessionValue, setLinkSessionValue] = (0, import_session.useSessionStorage)(path.join("/"));
|
|
2234
|
-
const [isActive, setIsActive] = (0,
|
|
2423
|
+
const [isActive, setIsActive] = (0, import_react22.useState)(!!value);
|
|
2235
2424
|
const {
|
|
2236
2425
|
allowCustomValues,
|
|
2237
2426
|
queryOptions: { endpoint = "", requestParams = {} },
|
|
2238
2427
|
placeholder,
|
|
2239
2428
|
minInputLength = 2,
|
|
2240
|
-
context: { elementId }
|
|
2429
|
+
context: { elementId },
|
|
2430
|
+
label = (0, import_i18n10.__)("Link", "elementor")
|
|
2241
2431
|
} = props || {};
|
|
2242
|
-
const [linkInLinkRestriction, setLinkInLinkRestriction] = (0,
|
|
2243
|
-
const [options, setOptions] = (0,
|
|
2432
|
+
const [linkInLinkRestriction, setLinkInLinkRestriction] = (0, import_react22.useState)((0, import_editor_elements.getLinkInLinkRestriction)(elementId));
|
|
2433
|
+
const [options, setOptions] = (0, import_react22.useState)(
|
|
2244
2434
|
generateFirstLoadedOption(value)
|
|
2245
2435
|
);
|
|
2246
2436
|
const shouldDisableAddingLink = !isActive && linkInLinkRestriction.shouldRestrict;
|
|
@@ -2265,8 +2455,8 @@ var LinkControl = createControl((props) => {
|
|
|
2265
2455
|
const onOptionChange = (newValue) => {
|
|
2266
2456
|
const valueToSave = newValue ? {
|
|
2267
2457
|
...value,
|
|
2268
|
-
destination:
|
|
2269
|
-
label:
|
|
2458
|
+
destination: import_editor_props18.numberPropTypeUtil.create(newValue),
|
|
2459
|
+
label: import_editor_props18.stringPropTypeUtil.create(findMatchingOption(options, newValue)?.label || null)
|
|
2270
2460
|
} : null;
|
|
2271
2461
|
onSaveNewValue(valueToSave);
|
|
2272
2462
|
};
|
|
@@ -2274,8 +2464,8 @@ var LinkControl = createControl((props) => {
|
|
|
2274
2464
|
newValue = newValue?.trim() || "";
|
|
2275
2465
|
const valueToSave = newValue ? {
|
|
2276
2466
|
...value,
|
|
2277
|
-
destination:
|
|
2278
|
-
label:
|
|
2467
|
+
destination: import_editor_props18.urlPropTypeUtil.create(newValue),
|
|
2468
|
+
label: import_editor_props18.stringPropTypeUtil.create("")
|
|
2279
2469
|
} : null;
|
|
2280
2470
|
onSaveNewValue(valueToSave);
|
|
2281
2471
|
updateOptions(newValue);
|
|
@@ -2291,7 +2481,7 @@ var LinkControl = createControl((props) => {
|
|
|
2291
2481
|
}
|
|
2292
2482
|
debounceFetch({ ...requestParams, term: newValue });
|
|
2293
2483
|
};
|
|
2294
|
-
const debounceFetch = (0,
|
|
2484
|
+
const debounceFetch = (0, import_react22.useMemo)(
|
|
2295
2485
|
() => (0, import_utils3.debounce)(
|
|
2296
2486
|
(params) => fetchOptions(endpoint, params).then((newOptions) => {
|
|
2297
2487
|
setOptions(formatOptions(newOptions));
|
|
@@ -2300,8 +2490,8 @@ var LinkControl = createControl((props) => {
|
|
|
2300
2490
|
),
|
|
2301
2491
|
[endpoint]
|
|
2302
2492
|
);
|
|
2303
|
-
return /* @__PURE__ */
|
|
2304
|
-
|
|
2493
|
+
return /* @__PURE__ */ React40.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React40.createElement(import_ui33.Stack, { gap: 1.5 }, /* @__PURE__ */ React40.createElement(
|
|
2494
|
+
import_ui33.Stack,
|
|
2305
2495
|
{
|
|
2306
2496
|
direction: "row",
|
|
2307
2497
|
sx: {
|
|
@@ -2310,17 +2500,17 @@ var LinkControl = createControl((props) => {
|
|
|
2310
2500
|
marginInlineEnd: -0.75
|
|
2311
2501
|
}
|
|
2312
2502
|
},
|
|
2313
|
-
/* @__PURE__ */
|
|
2314
|
-
/* @__PURE__ */
|
|
2503
|
+
/* @__PURE__ */ React40.createElement(ControlFormLabel, null, label),
|
|
2504
|
+
/* @__PURE__ */ React40.createElement(ConditionalInfoTip, { isVisible: !isActive, linkInLinkRestriction }, /* @__PURE__ */ React40.createElement(
|
|
2315
2505
|
ToggleIconControl,
|
|
2316
2506
|
{
|
|
2317
2507
|
disabled: shouldDisableAddingLink,
|
|
2318
2508
|
active: isActive,
|
|
2319
2509
|
onIconClick: onEnabledChange,
|
|
2320
|
-
label: (0,
|
|
2510
|
+
label: (0, import_i18n10.__)("Toggle link", "elementor")
|
|
2321
2511
|
}
|
|
2322
2512
|
))
|
|
2323
|
-
), /* @__PURE__ */
|
|
2513
|
+
), /* @__PURE__ */ React40.createElement(import_ui33.Collapse, { in: isActive, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React40.createElement(import_ui33.Stack, { gap: 1.5 }, /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ React40.createElement(ControlActions, null, /* @__PURE__ */ React40.createElement(
|
|
2324
2514
|
Autocomplete,
|
|
2325
2515
|
{
|
|
2326
2516
|
options,
|
|
@@ -2331,22 +2521,31 @@ var LinkControl = createControl((props) => {
|
|
|
2331
2521
|
onTextChange,
|
|
2332
2522
|
minInputLength
|
|
2333
2523
|
}
|
|
2334
|
-
))), /* @__PURE__ */
|
|
2524
|
+
))), /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React40.createElement(import_ui33.Grid, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true }, /* @__PURE__ */ React40.createElement(ControlFormLabel, null, (0, import_i18n10.__)("Open in a new tab", "elementor"))), /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, sx: { marginInlineEnd: -1 } }, /* @__PURE__ */ React40.createElement(SwitchControlComponent, { disabled: propContext.disabled || !value }))))))));
|
|
2335
2525
|
});
|
|
2336
2526
|
var ToggleIconControl = ({ disabled, active, onIconClick, label }) => {
|
|
2337
|
-
return /* @__PURE__ */
|
|
2527
|
+
return /* @__PURE__ */ React40.createElement(import_ui33.IconButton, { size: SIZE4, onClick: onIconClick, "aria-label": label, disabled }, active ? /* @__PURE__ */ React40.createElement(import_icons10.MinusIcon, { fontSize: SIZE4 }) : /* @__PURE__ */ React40.createElement(import_icons10.PlusIcon, { fontSize: SIZE4 }));
|
|
2338
2528
|
};
|
|
2339
|
-
var
|
|
2340
|
-
const { value
|
|
2529
|
+
var SwitchControlComponent = ({ disabled }) => {
|
|
2530
|
+
const { value, setValue } = useBoundProp(import_editor_props18.booleanPropTypeUtil);
|
|
2531
|
+
const isVersion331Active = (0, import_editor_v1_adapters4.isExperimentActive)("e_v_3_31");
|
|
2532
|
+
if (isVersion331Active) {
|
|
2533
|
+
return /* @__PURE__ */ React40.createElement(SwitchControl, null);
|
|
2534
|
+
}
|
|
2341
2535
|
const onClick = () => {
|
|
2342
2536
|
setValue(!value);
|
|
2343
2537
|
};
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2538
|
+
return /* @__PURE__ */ React40.createElement(
|
|
2539
|
+
import_ui33.Switch,
|
|
2540
|
+
{
|
|
2541
|
+
checked: value ?? false,
|
|
2542
|
+
onClick,
|
|
2543
|
+
disabled,
|
|
2544
|
+
inputProps: {
|
|
2545
|
+
...disabled ? { style: { opacity: 0 } } : {}
|
|
2546
|
+
}
|
|
2347
2547
|
}
|
|
2348
|
-
|
|
2349
|
-
return /* @__PURE__ */ React38.createElement(import_ui31.Grid, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React38.createElement(import_ui31.Grid, { item: true }, /* @__PURE__ */ React38.createElement(ControlFormLabel, null, (0, import_i18n9.__)("Open in a new tab", "elementor"))), /* @__PURE__ */ React38.createElement(import_ui31.Grid, { item: true, sx: { marginInlineEnd: -1 } }, /* @__PURE__ */ React38.createElement(import_ui31.Switch, { checked: value, onClick, disabled, inputProps })));
|
|
2548
|
+
);
|
|
2350
2549
|
};
|
|
2351
2550
|
async function fetchOptions(ajaxUrl, params) {
|
|
2352
2551
|
if (!params || !ajaxUrl) {
|
|
@@ -2383,54 +2582,54 @@ var ConditionalInfoTip = ({ linkInLinkRestriction, isVisible, children }) => {
|
|
|
2383
2582
|
(0, import_editor_elements.selectElement)(elementId);
|
|
2384
2583
|
}
|
|
2385
2584
|
};
|
|
2386
|
-
return shouldRestrict && isVisible ? /* @__PURE__ */
|
|
2387
|
-
|
|
2585
|
+
return shouldRestrict && isVisible ? /* @__PURE__ */ React40.createElement(
|
|
2586
|
+
import_ui33.Infotip,
|
|
2388
2587
|
{
|
|
2389
2588
|
placement: "right",
|
|
2390
|
-
content: /* @__PURE__ */
|
|
2391
|
-
|
|
2589
|
+
content: /* @__PURE__ */ React40.createElement(
|
|
2590
|
+
import_editor_ui5.InfoTipCard,
|
|
2392
2591
|
{
|
|
2393
2592
|
content: INFOTIP_CONTENT[reason],
|
|
2394
|
-
svgIcon: /* @__PURE__ */
|
|
2593
|
+
svgIcon: /* @__PURE__ */ React40.createElement(import_icons10.AlertTriangleIcon, null),
|
|
2395
2594
|
learnMoreButton,
|
|
2396
2595
|
ctaButton: {
|
|
2397
|
-
label: (0,
|
|
2596
|
+
label: (0, import_i18n10.__)("Take me there", "elementor"),
|
|
2398
2597
|
onClick: handleTakeMeClick
|
|
2399
2598
|
}
|
|
2400
2599
|
}
|
|
2401
2600
|
)
|
|
2402
2601
|
},
|
|
2403
|
-
/* @__PURE__ */
|
|
2404
|
-
) : /* @__PURE__ */
|
|
2602
|
+
/* @__PURE__ */ React40.createElement(import_ui33.Box, null, children)
|
|
2603
|
+
) : /* @__PURE__ */ React40.createElement(React40.Fragment, null, children);
|
|
2405
2604
|
};
|
|
2406
2605
|
var INFOTIP_CONTENT = {
|
|
2407
|
-
descendant: /* @__PURE__ */
|
|
2408
|
-
ancestor: /* @__PURE__ */
|
|
2606
|
+
descendant: /* @__PURE__ */ React40.createElement(React40.Fragment, null, (0, import_i18n10.__)("To add a link to this container,", "elementor"), /* @__PURE__ */ React40.createElement("br", null), (0, import_i18n10.__)("first remove the link from the elements inside of it.", "elementor")),
|
|
2607
|
+
ancestor: /* @__PURE__ */ React40.createElement(React40.Fragment, null, (0, import_i18n10.__)("To add a link to this element,", "elementor"), /* @__PURE__ */ React40.createElement("br", null), (0, import_i18n10.__)("first remove the link from its parent container.", "elementor"))
|
|
2409
2608
|
};
|
|
2410
2609
|
|
|
2411
2610
|
// src/controls/gap-control.tsx
|
|
2412
|
-
var
|
|
2413
|
-
var
|
|
2414
|
-
var
|
|
2611
|
+
var React41 = __toESM(require("react"));
|
|
2612
|
+
var import_react23 = require("react");
|
|
2613
|
+
var import_editor_props19 = require("@elementor/editor-props");
|
|
2415
2614
|
var import_icons11 = require("@elementor/icons");
|
|
2416
|
-
var
|
|
2417
|
-
var
|
|
2615
|
+
var import_ui34 = require("@elementor/ui");
|
|
2616
|
+
var import_i18n11 = require("@wordpress/i18n");
|
|
2418
2617
|
var GapControl = createControl(({ label }) => {
|
|
2419
2618
|
const {
|
|
2420
2619
|
value: directionValue,
|
|
2421
2620
|
setValue: setDirectionValue,
|
|
2422
2621
|
propType,
|
|
2423
2622
|
disabled: directionDisabled
|
|
2424
|
-
} = useBoundProp(
|
|
2425
|
-
const stackRef = (0,
|
|
2426
|
-
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(
|
|
2623
|
+
} = useBoundProp(import_editor_props19.layoutDirectionPropTypeUtil);
|
|
2624
|
+
const stackRef = (0, import_react23.useRef)(null);
|
|
2625
|
+
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(import_editor_props19.sizePropTypeUtil);
|
|
2427
2626
|
const isLinked = !directionValue && !sizeValue ? true : !!sizeValue;
|
|
2428
2627
|
const onLinkToggle = () => {
|
|
2429
2628
|
if (!isLinked) {
|
|
2430
2629
|
setSizeValue(directionValue?.column?.value ?? null);
|
|
2431
2630
|
return;
|
|
2432
2631
|
}
|
|
2433
|
-
const value = sizeValue ?
|
|
2632
|
+
const value = sizeValue ? import_editor_props19.sizePropTypeUtil.create(sizeValue) : null;
|
|
2434
2633
|
setDirectionValue({
|
|
2435
2634
|
row: value,
|
|
2436
2635
|
column: value
|
|
@@ -2438,11 +2637,11 @@ var GapControl = createControl(({ label }) => {
|
|
|
2438
2637
|
};
|
|
2439
2638
|
const tooltipLabel = label.toLowerCase();
|
|
2440
2639
|
const LinkedIcon = isLinked ? import_icons11.LinkIcon : import_icons11.DetachIcon;
|
|
2441
|
-
const linkedLabel = (0,
|
|
2442
|
-
const unlinkedLabel = (0,
|
|
2640
|
+
const linkedLabel = (0, import_i18n11.__)("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
2641
|
+
const unlinkedLabel = (0, import_i18n11.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
2443
2642
|
const disabled = sizeDisabled || directionDisabled;
|
|
2444
|
-
return /* @__PURE__ */
|
|
2445
|
-
|
|
2643
|
+
return /* @__PURE__ */ React41.createElement(PropProvider, { propType, value: directionValue, setValue: setDirectionValue }, /* @__PURE__ */ React41.createElement(import_ui34.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(ControlLabel, null, label), /* @__PURE__ */ React41.createElement(import_ui34.Tooltip, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React41.createElement(
|
|
2644
|
+
import_ui34.ToggleButton,
|
|
2446
2645
|
{
|
|
2447
2646
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
2448
2647
|
size: "tiny",
|
|
@@ -2452,8 +2651,8 @@ var GapControl = createControl(({ label }) => {
|
|
|
2452
2651
|
onChange: onLinkToggle,
|
|
2453
2652
|
disabled
|
|
2454
2653
|
},
|
|
2455
|
-
/* @__PURE__ */
|
|
2456
|
-
))), /* @__PURE__ */
|
|
2654
|
+
/* @__PURE__ */ React41.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
2655
|
+
))), /* @__PURE__ */ React41.createElement(import_ui34.Stack, { direction: "row", gap: 2, flexWrap: "nowrap", ref: stackRef }, /* @__PURE__ */ React41.createElement(import_ui34.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React41.createElement(import_ui34.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React41.createElement(ControlFormLabel, null, (0, import_i18n11.__)("Column", "elementor"))), /* @__PURE__ */ React41.createElement(import_ui34.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React41.createElement(Control4, { bind: "column", isLinked, anchorRef: stackRef }))), /* @__PURE__ */ React41.createElement(import_ui34.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React41.createElement(import_ui34.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React41.createElement(ControlFormLabel, null, (0, import_i18n11.__)("Row", "elementor"))), /* @__PURE__ */ React41.createElement(import_ui34.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React41.createElement(Control4, { bind: "row", isLinked, anchorRef: stackRef })))));
|
|
2457
2656
|
});
|
|
2458
2657
|
var Control4 = ({
|
|
2459
2658
|
bind,
|
|
@@ -2461,21 +2660,21 @@ var Control4 = ({
|
|
|
2461
2660
|
anchorRef
|
|
2462
2661
|
}) => {
|
|
2463
2662
|
if (isLinked) {
|
|
2464
|
-
return /* @__PURE__ */
|
|
2663
|
+
return /* @__PURE__ */ React41.createElement(SizeControl, { anchorRef });
|
|
2465
2664
|
}
|
|
2466
|
-
return /* @__PURE__ */
|
|
2665
|
+
return /* @__PURE__ */ React41.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React41.createElement(SizeControl, { anchorRef }));
|
|
2467
2666
|
};
|
|
2468
2667
|
|
|
2469
2668
|
// src/controls/aspect-ratio-control.tsx
|
|
2470
|
-
var
|
|
2471
|
-
var
|
|
2472
|
-
var
|
|
2473
|
-
var
|
|
2669
|
+
var React42 = __toESM(require("react"));
|
|
2670
|
+
var import_react24 = require("react");
|
|
2671
|
+
var import_editor_props20 = require("@elementor/editor-props");
|
|
2672
|
+
var import_editor_ui6 = require("@elementor/editor-ui");
|
|
2474
2673
|
var import_icons12 = require("@elementor/icons");
|
|
2475
|
-
var
|
|
2476
|
-
var
|
|
2674
|
+
var import_ui35 = require("@elementor/ui");
|
|
2675
|
+
var import_i18n12 = require("@wordpress/i18n");
|
|
2477
2676
|
var RATIO_OPTIONS = [
|
|
2478
|
-
{ label: (0,
|
|
2677
|
+
{ label: (0, import_i18n12.__)("Auto", "elementor"), value: "auto" },
|
|
2479
2678
|
{ label: "1/1", value: "1/1" },
|
|
2480
2679
|
{ label: "4/3", value: "4/3" },
|
|
2481
2680
|
{ label: "3/4", value: "3/4" },
|
|
@@ -2486,15 +2685,30 @@ var RATIO_OPTIONS = [
|
|
|
2486
2685
|
];
|
|
2487
2686
|
var CUSTOM_RATIO = "custom";
|
|
2488
2687
|
var AspectRatioControl = createControl(({ label }) => {
|
|
2489
|
-
const { value: aspectRatioValue, setValue: setAspectRatioValue, disabled } = useBoundProp(
|
|
2688
|
+
const { value: aspectRatioValue, setValue: setAspectRatioValue, disabled } = useBoundProp(import_editor_props20.stringPropTypeUtil);
|
|
2490
2689
|
const isCustomSelected = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
2491
2690
|
const [initialWidth, initialHeight] = isCustomSelected ? aspectRatioValue.split("/") : ["", ""];
|
|
2492
|
-
const [isCustom, setIsCustom] = (0,
|
|
2493
|
-
const [customWidth, setCustomWidth] = (0,
|
|
2494
|
-
const [customHeight, setCustomHeight] = (0,
|
|
2495
|
-
const [selectedValue, setSelectedValue] = (0,
|
|
2691
|
+
const [isCustom, setIsCustom] = (0, import_react24.useState)(isCustomSelected);
|
|
2692
|
+
const [customWidth, setCustomWidth] = (0, import_react24.useState)(initialWidth);
|
|
2693
|
+
const [customHeight, setCustomHeight] = (0, import_react24.useState)(initialHeight);
|
|
2694
|
+
const [selectedValue, setSelectedValue] = (0, import_react24.useState)(
|
|
2496
2695
|
isCustomSelected ? CUSTOM_RATIO : aspectRatioValue || ""
|
|
2497
2696
|
);
|
|
2697
|
+
(0, import_react24.useEffect)(() => {
|
|
2698
|
+
const isCustomValue = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
2699
|
+
if (isCustomValue) {
|
|
2700
|
+
const [width, height] = aspectRatioValue.split("/");
|
|
2701
|
+
setCustomWidth(width || "");
|
|
2702
|
+
setCustomHeight(height || "");
|
|
2703
|
+
setSelectedValue(CUSTOM_RATIO);
|
|
2704
|
+
setIsCustom(true);
|
|
2705
|
+
} else {
|
|
2706
|
+
setSelectedValue(aspectRatioValue || "");
|
|
2707
|
+
setIsCustom(false);
|
|
2708
|
+
setCustomWidth("");
|
|
2709
|
+
setCustomHeight("");
|
|
2710
|
+
}
|
|
2711
|
+
}, [aspectRatioValue]);
|
|
2498
2712
|
const handleSelectChange = (event) => {
|
|
2499
2713
|
const newValue = event.target.value;
|
|
2500
2714
|
const isCustomRatio = newValue === CUSTOM_RATIO;
|
|
@@ -2519,8 +2733,8 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2519
2733
|
setAspectRatioValue(`${customWidth}/${newHeight}`);
|
|
2520
2734
|
}
|
|
2521
2735
|
};
|
|
2522
|
-
return /* @__PURE__ */
|
|
2523
|
-
|
|
2736
|
+
return /* @__PURE__ */ React42.createElement(ControlActions, null, /* @__PURE__ */ React42.createElement(import_ui35.Stack, { direction: "column", gap: 2 }, /* @__PURE__ */ React42.createElement(import_ui35.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(import_ui35.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(ControlLabel, null, label)), /* @__PURE__ */ React42.createElement(import_ui35.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(
|
|
2737
|
+
import_ui35.Select,
|
|
2524
2738
|
{
|
|
2525
2739
|
size: "tiny",
|
|
2526
2740
|
displayEmpty: true,
|
|
@@ -2530,11 +2744,11 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2530
2744
|
onChange: handleSelectChange,
|
|
2531
2745
|
fullWidth: true
|
|
2532
2746
|
},
|
|
2533
|
-
[...RATIO_OPTIONS, { label: (0,
|
|
2534
|
-
({ label: optionLabel, ...props }) => /* @__PURE__ */
|
|
2747
|
+
[...RATIO_OPTIONS, { label: (0, import_i18n12.__)("Custom", "elementor"), value: CUSTOM_RATIO }].map(
|
|
2748
|
+
({ label: optionLabel, ...props }) => /* @__PURE__ */ React42.createElement(import_editor_ui6.MenuListItem, { key: props.value, ...props, value: props.value ?? "" }, optionLabel)
|
|
2535
2749
|
)
|
|
2536
|
-
))), isCustom && /* @__PURE__ */
|
|
2537
|
-
|
|
2750
|
+
))), isCustom && /* @__PURE__ */ React42.createElement(import_ui35.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(import_ui35.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(
|
|
2751
|
+
import_ui35.TextField,
|
|
2538
2752
|
{
|
|
2539
2753
|
size: "tiny",
|
|
2540
2754
|
type: "number",
|
|
@@ -2543,11 +2757,11 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2543
2757
|
value: customWidth,
|
|
2544
2758
|
onChange: handleCustomWidthChange,
|
|
2545
2759
|
InputProps: {
|
|
2546
|
-
startAdornment: /* @__PURE__ */
|
|
2760
|
+
startAdornment: /* @__PURE__ */ React42.createElement(import_icons12.ArrowsMoveHorizontalIcon, { fontSize: "tiny" })
|
|
2547
2761
|
}
|
|
2548
2762
|
}
|
|
2549
|
-
)), /* @__PURE__ */
|
|
2550
|
-
|
|
2763
|
+
)), /* @__PURE__ */ React42.createElement(import_ui35.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(
|
|
2764
|
+
import_ui35.TextField,
|
|
2551
2765
|
{
|
|
2552
2766
|
size: "tiny",
|
|
2553
2767
|
type: "number",
|
|
@@ -2556,39 +2770,39 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2556
2770
|
value: customHeight,
|
|
2557
2771
|
onChange: handleCustomHeightChange,
|
|
2558
2772
|
InputProps: {
|
|
2559
|
-
startAdornment: /* @__PURE__ */
|
|
2773
|
+
startAdornment: /* @__PURE__ */ React42.createElement(import_icons12.ArrowsMoveVerticalIcon, { fontSize: "tiny" })
|
|
2560
2774
|
}
|
|
2561
2775
|
}
|
|
2562
2776
|
)))));
|
|
2563
2777
|
});
|
|
2564
2778
|
|
|
2565
2779
|
// src/controls/svg-media-control.tsx
|
|
2566
|
-
var
|
|
2567
|
-
var
|
|
2568
|
-
var
|
|
2780
|
+
var React44 = __toESM(require("react"));
|
|
2781
|
+
var import_react26 = require("react");
|
|
2782
|
+
var import_editor_props21 = require("@elementor/editor-props");
|
|
2569
2783
|
var import_icons13 = require("@elementor/icons");
|
|
2570
|
-
var
|
|
2784
|
+
var import_ui37 = require("@elementor/ui");
|
|
2571
2785
|
var import_wp_media2 = require("@elementor/wp-media");
|
|
2572
|
-
var
|
|
2786
|
+
var import_i18n14 = require("@wordpress/i18n");
|
|
2573
2787
|
|
|
2574
2788
|
// src/components/enable-unfiltered-modal.tsx
|
|
2575
|
-
var
|
|
2576
|
-
var
|
|
2789
|
+
var React43 = __toESM(require("react"));
|
|
2790
|
+
var import_react25 = require("react");
|
|
2577
2791
|
var import_editor_current_user = require("@elementor/editor-current-user");
|
|
2578
|
-
var
|
|
2579
|
-
var
|
|
2580
|
-
var ADMIN_TITLE_TEXT = (0,
|
|
2581
|
-
var ADMIN_CONTENT_TEXT = (0,
|
|
2792
|
+
var import_ui36 = require("@elementor/ui");
|
|
2793
|
+
var import_i18n13 = require("@wordpress/i18n");
|
|
2794
|
+
var ADMIN_TITLE_TEXT = (0, import_i18n13.__)("Enable Unfiltered Uploads", "elementor");
|
|
2795
|
+
var ADMIN_CONTENT_TEXT = (0, import_i18n13.__)(
|
|
2582
2796
|
"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.",
|
|
2583
2797
|
"elementor"
|
|
2584
2798
|
);
|
|
2585
|
-
var NON_ADMIN_TITLE_TEXT = (0,
|
|
2586
|
-
var NON_ADMIN_CONTENT_TEXT = (0,
|
|
2799
|
+
var NON_ADMIN_TITLE_TEXT = (0, import_i18n13.__)("Sorry, you can't upload that file yet", "elementor");
|
|
2800
|
+
var NON_ADMIN_CONTENT_TEXT = (0, import_i18n13.__)(
|
|
2587
2801
|
"This is because this file type may pose a security risk. To upload them anyway, ask the site administrator to enable unfiltered file uploads.",
|
|
2588
2802
|
"elementor"
|
|
2589
2803
|
);
|
|
2590
|
-
var ADMIN_FAILED_CONTENT_TEXT_PT1 = (0,
|
|
2591
|
-
var ADMIN_FAILED_CONTENT_TEXT_PT2 = (0,
|
|
2804
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT1 = (0, import_i18n13.__)("Failed to enable unfiltered files upload.", "elementor");
|
|
2805
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT2 = (0, import_i18n13.__)(
|
|
2592
2806
|
"You can try again, if the problem persists, please contact support.",
|
|
2593
2807
|
"elementor"
|
|
2594
2808
|
);
|
|
@@ -2596,7 +2810,7 @@ var WAIT_FOR_CLOSE_TIMEOUT_MS = 300;
|
|
|
2596
2810
|
var EnableUnfilteredModal = (props) => {
|
|
2597
2811
|
const { mutateAsync, isPending } = useUpdateUnfilteredFilesUpload();
|
|
2598
2812
|
const { canUser } = (0, import_editor_current_user.useCurrentUserCapabilities)();
|
|
2599
|
-
const [isError, setIsError] = (0,
|
|
2813
|
+
const [isError, setIsError] = (0, import_react25.useState)(false);
|
|
2600
2814
|
const canManageOptions = canUser("manage_options");
|
|
2601
2815
|
const onClose = (enabled) => {
|
|
2602
2816
|
props.onClose(enabled);
|
|
@@ -2615,10 +2829,10 @@ var EnableUnfilteredModal = (props) => {
|
|
|
2615
2829
|
}
|
|
2616
2830
|
};
|
|
2617
2831
|
const dialogProps = { ...props, isPending, handleEnable, isError, onClose };
|
|
2618
|
-
return canManageOptions ? /* @__PURE__ */
|
|
2832
|
+
return canManageOptions ? /* @__PURE__ */ React43.createElement(AdminDialog, { ...dialogProps }) : /* @__PURE__ */ React43.createElement(NonAdminDialog, { ...dialogProps });
|
|
2619
2833
|
};
|
|
2620
|
-
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */
|
|
2621
|
-
|
|
2834
|
+
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */ React43.createElement(import_ui36.Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React43.createElement(import_ui36.DialogHeader, { logo: false }, /* @__PURE__ */ React43.createElement(import_ui36.DialogTitle, null, ADMIN_TITLE_TEXT)), /* @__PURE__ */ React43.createElement(import_ui36.Divider, null), /* @__PURE__ */ React43.createElement(import_ui36.DialogContent, null, /* @__PURE__ */ React43.createElement(import_ui36.DialogContentText, null, isError ? /* @__PURE__ */ React43.createElement(React43.Fragment, null, ADMIN_FAILED_CONTENT_TEXT_PT1, " ", /* @__PURE__ */ React43.createElement("br", null), " ", ADMIN_FAILED_CONTENT_TEXT_PT2) : ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React43.createElement(import_ui36.DialogActions, null, /* @__PURE__ */ React43.createElement(import_ui36.Button, { size: "medium", color: "secondary", onClick: () => onClose(false) }, (0, import_i18n13.__)("Cancel", "elementor")), /* @__PURE__ */ React43.createElement(
|
|
2835
|
+
import_ui36.Button,
|
|
2622
2836
|
{
|
|
2623
2837
|
size: "medium",
|
|
2624
2838
|
onClick: () => handleEnable(),
|
|
@@ -2626,16 +2840,16 @@ var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @_
|
|
|
2626
2840
|
color: "primary",
|
|
2627
2841
|
disabled: isPending
|
|
2628
2842
|
},
|
|
2629
|
-
isPending ? /* @__PURE__ */
|
|
2843
|
+
isPending ? /* @__PURE__ */ React43.createElement(import_ui36.CircularProgress, { size: 24 }) : (0, import_i18n13.__)("Enable", "elementor")
|
|
2630
2844
|
)));
|
|
2631
|
-
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */
|
|
2845
|
+
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */ React43.createElement(import_ui36.Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React43.createElement(import_ui36.DialogHeader, { logo: false }, /* @__PURE__ */ React43.createElement(import_ui36.DialogTitle, null, NON_ADMIN_TITLE_TEXT)), /* @__PURE__ */ React43.createElement(import_ui36.Divider, null), /* @__PURE__ */ React43.createElement(import_ui36.DialogContent, null, /* @__PURE__ */ React43.createElement(import_ui36.DialogContentText, null, NON_ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React43.createElement(import_ui36.DialogActions, null, /* @__PURE__ */ React43.createElement(import_ui36.Button, { size: "medium", onClick: () => onClose(false), variant: "contained", color: "primary" }, (0, import_i18n13.__)("Got it", "elementor"))));
|
|
2632
2846
|
|
|
2633
2847
|
// src/controls/svg-media-control.tsx
|
|
2634
2848
|
var TILE_SIZE = 8;
|
|
2635
2849
|
var TILE_WHITE = "transparent";
|
|
2636
2850
|
var TILE_BLACK = "#c1c1c1";
|
|
2637
2851
|
var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
|
|
2638
|
-
var StyledCard = (0,
|
|
2852
|
+
var StyledCard = (0, import_ui37.styled)(import_ui37.Card)`
|
|
2639
2853
|
background-color: white;
|
|
2640
2854
|
background-image: ${TILES_GRADIENT_FORMULA}, ${TILES_GRADIENT_FORMULA};
|
|
2641
2855
|
background-size: ${TILE_SIZE}px ${TILE_SIZE}px;
|
|
@@ -2644,7 +2858,7 @@ var StyledCard = (0, import_ui35.styled)(import_ui35.Card)`
|
|
|
2644
2858
|
${TILE_SIZE / 2}px ${TILE_SIZE / 2}px;
|
|
2645
2859
|
border: none;
|
|
2646
2860
|
`;
|
|
2647
|
-
var StyledCardMediaContainer = (0,
|
|
2861
|
+
var StyledCardMediaContainer = (0, import_ui37.styled)(import_ui37.Stack)`
|
|
2648
2862
|
position: relative;
|
|
2649
2863
|
height: 140px;
|
|
2650
2864
|
object-fit: contain;
|
|
@@ -2656,12 +2870,12 @@ var StyledCardMediaContainer = (0, import_ui35.styled)(import_ui35.Stack)`
|
|
|
2656
2870
|
var MODE_BROWSE = { mode: "browse" };
|
|
2657
2871
|
var MODE_UPLOAD = { mode: "upload" };
|
|
2658
2872
|
var SvgMediaControl = createControl(() => {
|
|
2659
|
-
const { value, setValue } = useBoundProp(
|
|
2873
|
+
const { value, setValue } = useBoundProp(import_editor_props21.imageSrcPropTypeUtil);
|
|
2660
2874
|
const { id, url } = value ?? {};
|
|
2661
2875
|
const { data: attachment, isFetching } = (0, import_wp_media2.useWpMediaAttachment)(id?.value || null);
|
|
2662
2876
|
const src = attachment?.url ?? url?.value ?? null;
|
|
2663
2877
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
2664
|
-
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0,
|
|
2878
|
+
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0, import_react26.useState)(false);
|
|
2665
2879
|
const { open } = (0, import_wp_media2.useWpMediaFrame)({
|
|
2666
2880
|
mediaTypes: ["svg"],
|
|
2667
2881
|
multiple: false,
|
|
@@ -2689,16 +2903,16 @@ var SvgMediaControl = createControl(() => {
|
|
|
2689
2903
|
open(openOptions);
|
|
2690
2904
|
}
|
|
2691
2905
|
};
|
|
2692
|
-
return /* @__PURE__ */
|
|
2693
|
-
|
|
2906
|
+
return /* @__PURE__ */ React44.createElement(import_ui37.Stack, { gap: 1 }, /* @__PURE__ */ React44.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: onCloseUnfilteredModal }), /* @__PURE__ */ React44.createElement(ControlActions, null, /* @__PURE__ */ React44.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React44.createElement(StyledCardMediaContainer, null, isFetching ? /* @__PURE__ */ React44.createElement(import_ui37.CircularProgress, { role: "progressbar" }) : /* @__PURE__ */ React44.createElement(
|
|
2907
|
+
import_ui37.CardMedia,
|
|
2694
2908
|
{
|
|
2695
2909
|
component: "img",
|
|
2696
2910
|
image: src,
|
|
2697
|
-
alt: (0,
|
|
2911
|
+
alt: (0, import_i18n14.__)("Preview SVG", "elementor"),
|
|
2698
2912
|
sx: { maxHeight: "140px", width: "50px" }
|
|
2699
2913
|
}
|
|
2700
|
-
)), /* @__PURE__ */
|
|
2701
|
-
|
|
2914
|
+
)), /* @__PURE__ */ React44.createElement(
|
|
2915
|
+
import_ui37.CardOverlay,
|
|
2702
2916
|
{
|
|
2703
2917
|
sx: {
|
|
2704
2918
|
"&:hover": {
|
|
@@ -2706,69 +2920,69 @@ var SvgMediaControl = createControl(() => {
|
|
|
2706
2920
|
}
|
|
2707
2921
|
}
|
|
2708
2922
|
},
|
|
2709
|
-
/* @__PURE__ */
|
|
2710
|
-
|
|
2923
|
+
/* @__PURE__ */ React44.createElement(import_ui37.Stack, { gap: 1 }, /* @__PURE__ */ React44.createElement(
|
|
2924
|
+
import_ui37.Button,
|
|
2711
2925
|
{
|
|
2712
2926
|
size: "tiny",
|
|
2713
2927
|
color: "inherit",
|
|
2714
2928
|
variant: "outlined",
|
|
2715
2929
|
onClick: () => handleClick(MODE_BROWSE)
|
|
2716
2930
|
},
|
|
2717
|
-
(0,
|
|
2718
|
-
), /* @__PURE__ */
|
|
2719
|
-
|
|
2931
|
+
(0, import_i18n14.__)("Select SVG", "elementor")
|
|
2932
|
+
), /* @__PURE__ */ React44.createElement(
|
|
2933
|
+
import_ui37.Button,
|
|
2720
2934
|
{
|
|
2721
2935
|
size: "tiny",
|
|
2722
2936
|
variant: "text",
|
|
2723
2937
|
color: "inherit",
|
|
2724
|
-
startIcon: /* @__PURE__ */
|
|
2938
|
+
startIcon: /* @__PURE__ */ React44.createElement(import_icons13.UploadIcon, null),
|
|
2725
2939
|
onClick: () => handleClick(MODE_UPLOAD)
|
|
2726
2940
|
},
|
|
2727
|
-
(0,
|
|
2941
|
+
(0, import_i18n14.__)("Upload", "elementor")
|
|
2728
2942
|
))
|
|
2729
2943
|
))));
|
|
2730
2944
|
});
|
|
2731
2945
|
|
|
2732
2946
|
// src/controls/background-control/background-control.tsx
|
|
2733
|
-
var
|
|
2734
|
-
var
|
|
2735
|
-
var
|
|
2736
|
-
var
|
|
2737
|
-
var
|
|
2947
|
+
var React51 = __toESM(require("react"));
|
|
2948
|
+
var import_editor_props27 = require("@elementor/editor-props");
|
|
2949
|
+
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
2950
|
+
var import_ui45 = require("@elementor/ui");
|
|
2951
|
+
var import_i18n20 = require("@wordpress/i18n");
|
|
2738
2952
|
|
|
2739
2953
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
2740
|
-
var
|
|
2741
|
-
var
|
|
2742
|
-
var
|
|
2954
|
+
var React50 = __toESM(require("react"));
|
|
2955
|
+
var import_editor_props26 = require("@elementor/editor-props");
|
|
2956
|
+
var import_ui44 = require("@elementor/ui");
|
|
2743
2957
|
var import_wp_media3 = require("@elementor/wp-media");
|
|
2744
|
-
var
|
|
2958
|
+
var import_i18n19 = require("@wordpress/i18n");
|
|
2745
2959
|
|
|
2746
2960
|
// src/env.ts
|
|
2747
2961
|
var import_env = require("@elementor/env");
|
|
2748
2962
|
var { env } = (0, import_env.parseEnv)("@elementor/editor-controls");
|
|
2749
2963
|
|
|
2750
2964
|
// src/controls/background-control/background-gradient-color-control.tsx
|
|
2751
|
-
var
|
|
2752
|
-
var
|
|
2753
|
-
var
|
|
2965
|
+
var React45 = __toESM(require("react"));
|
|
2966
|
+
var import_editor_props22 = require("@elementor/editor-props");
|
|
2967
|
+
var import_ui38 = require("@elementor/ui");
|
|
2754
2968
|
var BackgroundGradientColorControl = createControl(() => {
|
|
2755
|
-
const { value, setValue } = useBoundProp(
|
|
2969
|
+
const { value, setValue } = useBoundProp(import_editor_props22.backgroundGradientOverlayPropTypeUtil);
|
|
2756
2970
|
const handleChange = (newValue) => {
|
|
2757
2971
|
const transformedValue = createTransformableValue(newValue);
|
|
2758
2972
|
if (transformedValue.positions) {
|
|
2759
|
-
transformedValue.positions =
|
|
2973
|
+
transformedValue.positions = import_editor_props22.stringPropTypeUtil.create(newValue.positions.join(" "));
|
|
2760
2974
|
}
|
|
2761
2975
|
setValue(transformedValue);
|
|
2762
2976
|
};
|
|
2763
2977
|
const createTransformableValue = (newValue) => ({
|
|
2764
2978
|
...newValue,
|
|
2765
|
-
type:
|
|
2766
|
-
angle:
|
|
2767
|
-
stops:
|
|
2979
|
+
type: import_editor_props22.stringPropTypeUtil.create(newValue.type),
|
|
2980
|
+
angle: import_editor_props22.numberPropTypeUtil.create(newValue.angle),
|
|
2981
|
+
stops: import_editor_props22.gradientColorStopPropTypeUtil.create(
|
|
2768
2982
|
newValue.stops.map(
|
|
2769
|
-
({ color, offset }) =>
|
|
2770
|
-
color:
|
|
2771
|
-
offset:
|
|
2983
|
+
({ color, offset }) => import_editor_props22.colorStopPropTypeUtil.create({
|
|
2984
|
+
color: import_editor_props22.colorPropTypeUtil.create(color),
|
|
2985
|
+
offset: import_editor_props22.numberPropTypeUtil.create(offset)
|
|
2772
2986
|
})
|
|
2773
2987
|
)
|
|
2774
2988
|
)
|
|
@@ -2788,8 +3002,8 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
2788
3002
|
positions: positions?.value.split(" ")
|
|
2789
3003
|
};
|
|
2790
3004
|
};
|
|
2791
|
-
return /* @__PURE__ */
|
|
2792
|
-
|
|
3005
|
+
return /* @__PURE__ */ React45.createElement(ControlActions, null, /* @__PURE__ */ React45.createElement(
|
|
3006
|
+
import_ui38.UnstableGradientBox,
|
|
2793
3007
|
{
|
|
2794
3008
|
sx: { width: "auto", padding: 1.5 },
|
|
2795
3009
|
value: normalizeValue(),
|
|
@@ -2797,69 +3011,69 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
2797
3011
|
}
|
|
2798
3012
|
));
|
|
2799
3013
|
});
|
|
2800
|
-
var initialBackgroundGradientOverlay =
|
|
2801
|
-
type:
|
|
2802
|
-
angle:
|
|
2803
|
-
stops:
|
|
2804
|
-
|
|
2805
|
-
color:
|
|
2806
|
-
offset:
|
|
3014
|
+
var initialBackgroundGradientOverlay = import_editor_props22.backgroundGradientOverlayPropTypeUtil.create({
|
|
3015
|
+
type: import_editor_props22.stringPropTypeUtil.create("linear"),
|
|
3016
|
+
angle: import_editor_props22.numberPropTypeUtil.create(180),
|
|
3017
|
+
stops: import_editor_props22.gradientColorStopPropTypeUtil.create([
|
|
3018
|
+
import_editor_props22.colorStopPropTypeUtil.create({
|
|
3019
|
+
color: import_editor_props22.colorPropTypeUtil.create("rgb(0,0,0)"),
|
|
3020
|
+
offset: import_editor_props22.numberPropTypeUtil.create(0)
|
|
2807
3021
|
}),
|
|
2808
|
-
|
|
2809
|
-
color:
|
|
2810
|
-
offset:
|
|
3022
|
+
import_editor_props22.colorStopPropTypeUtil.create({
|
|
3023
|
+
color: import_editor_props22.colorPropTypeUtil.create("rgb(255,255,255)"),
|
|
3024
|
+
offset: import_editor_props22.numberPropTypeUtil.create(100)
|
|
2811
3025
|
})
|
|
2812
3026
|
])
|
|
2813
3027
|
});
|
|
2814
3028
|
|
|
2815
3029
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
2816
|
-
var
|
|
3030
|
+
var React46 = __toESM(require("react"));
|
|
2817
3031
|
var import_icons14 = require("@elementor/icons");
|
|
2818
|
-
var
|
|
2819
|
-
var
|
|
3032
|
+
var import_ui39 = require("@elementor/ui");
|
|
3033
|
+
var import_i18n15 = require("@wordpress/i18n");
|
|
2820
3034
|
var attachmentControlOptions = [
|
|
2821
3035
|
{
|
|
2822
3036
|
value: "fixed",
|
|
2823
|
-
label: (0,
|
|
2824
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3037
|
+
label: (0, import_i18n15.__)("Fixed", "elementor"),
|
|
3038
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(import_icons14.PinIcon, { fontSize: size }),
|
|
2825
3039
|
showTooltip: true
|
|
2826
3040
|
},
|
|
2827
3041
|
{
|
|
2828
3042
|
value: "scroll",
|
|
2829
|
-
label: (0,
|
|
2830
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3043
|
+
label: (0, import_i18n15.__)("Scroll", "elementor"),
|
|
3044
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(import_icons14.PinnedOffIcon, { fontSize: size }),
|
|
2831
3045
|
showTooltip: true
|
|
2832
3046
|
}
|
|
2833
3047
|
];
|
|
2834
3048
|
var BackgroundImageOverlayAttachment = () => {
|
|
2835
|
-
return /* @__PURE__ */
|
|
3049
|
+
return /* @__PURE__ */ React46.createElement(PopoverGridContainer, null, /* @__PURE__ */ React46.createElement(import_ui39.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(ControlFormLabel, null, (0, import_i18n15.__)("Attachment", "elementor"))), /* @__PURE__ */ React46.createElement(import_ui39.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React46.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
2836
3050
|
};
|
|
2837
3051
|
|
|
2838
3052
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
2839
|
-
var
|
|
2840
|
-
var
|
|
2841
|
-
var
|
|
2842
|
-
var
|
|
3053
|
+
var React47 = __toESM(require("react"));
|
|
3054
|
+
var import_react27 = require("react");
|
|
3055
|
+
var import_editor_props23 = require("@elementor/editor-props");
|
|
3056
|
+
var import_editor_ui7 = require("@elementor/editor-ui");
|
|
2843
3057
|
var import_icons15 = require("@elementor/icons");
|
|
2844
|
-
var
|
|
2845
|
-
var
|
|
3058
|
+
var import_ui40 = require("@elementor/ui");
|
|
3059
|
+
var import_i18n16 = require("@wordpress/i18n");
|
|
2846
3060
|
var backgroundPositionOptions = [
|
|
2847
|
-
{ label: (0,
|
|
2848
|
-
{ label: (0,
|
|
2849
|
-
{ label: (0,
|
|
2850
|
-
{ label: (0,
|
|
2851
|
-
{ label: (0,
|
|
2852
|
-
{ label: (0,
|
|
2853
|
-
{ label: (0,
|
|
2854
|
-
{ label: (0,
|
|
2855
|
-
{ label: (0,
|
|
2856
|
-
{ label: (0,
|
|
3061
|
+
{ label: (0, import_i18n16.__)("Center center", "elementor"), value: "center center" },
|
|
3062
|
+
{ label: (0, import_i18n16.__)("Center left", "elementor"), value: "center left" },
|
|
3063
|
+
{ label: (0, import_i18n16.__)("Center right", "elementor"), value: "center right" },
|
|
3064
|
+
{ label: (0, import_i18n16.__)("Top center", "elementor"), value: "top center" },
|
|
3065
|
+
{ label: (0, import_i18n16.__)("Top left", "elementor"), value: "top left" },
|
|
3066
|
+
{ label: (0, import_i18n16.__)("Top right", "elementor"), value: "top right" },
|
|
3067
|
+
{ label: (0, import_i18n16.__)("Bottom center", "elementor"), value: "bottom center" },
|
|
3068
|
+
{ label: (0, import_i18n16.__)("Bottom left", "elementor"), value: "bottom left" },
|
|
3069
|
+
{ label: (0, import_i18n16.__)("Bottom right", "elementor"), value: "bottom right" },
|
|
3070
|
+
{ label: (0, import_i18n16.__)("Custom", "elementor"), value: "custom" }
|
|
2857
3071
|
];
|
|
2858
3072
|
var BackgroundImageOverlayPosition = () => {
|
|
2859
|
-
const backgroundImageOffsetContext = useBoundProp(
|
|
2860
|
-
const stringPropContext = useBoundProp(
|
|
3073
|
+
const backgroundImageOffsetContext = useBoundProp(import_editor_props23.backgroundImagePositionOffsetPropTypeUtil);
|
|
3074
|
+
const stringPropContext = useBoundProp(import_editor_props23.stringPropTypeUtil);
|
|
2861
3075
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
2862
|
-
const rowRef = (0,
|
|
3076
|
+
const rowRef = (0, import_react27.useRef)(null);
|
|
2863
3077
|
const handlePositionChange = (event) => {
|
|
2864
3078
|
const value = event.target.value || null;
|
|
2865
3079
|
if (value === "custom") {
|
|
@@ -2868,8 +3082,8 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
2868
3082
|
stringPropContext.setValue(value);
|
|
2869
3083
|
}
|
|
2870
3084
|
};
|
|
2871
|
-
return /* @__PURE__ */
|
|
2872
|
-
|
|
3085
|
+
return /* @__PURE__ */ React47.createElement(import_ui40.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React47.createElement(import_ui40.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React47.createElement(PopoverGridContainer, null, /* @__PURE__ */ React47.createElement(import_ui40.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(ControlFormLabel, null, (0, import_i18n16.__)("Position", "elementor"))), /* @__PURE__ */ React47.createElement(import_ui40.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React47.createElement(
|
|
3086
|
+
import_ui40.Select,
|
|
2873
3087
|
{
|
|
2874
3088
|
fullWidth: true,
|
|
2875
3089
|
size: "tiny",
|
|
@@ -2877,95 +3091,95 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
2877
3091
|
disabled: stringPropContext.disabled,
|
|
2878
3092
|
value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? ""
|
|
2879
3093
|
},
|
|
2880
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
2881
|
-
)))), isCustom ? /* @__PURE__ */
|
|
3094
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React47.createElement(import_editor_ui7.MenuListItem, { key: value, value: value ?? "" }, label))
|
|
3095
|
+
)))), isCustom ? /* @__PURE__ */ React47.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React47.createElement(import_ui40.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React47.createElement(import_ui40.Grid, { container: true, spacing: 1.5, ref: rowRef }, /* @__PURE__ */ React47.createElement(import_ui40.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React47.createElement(
|
|
2882
3096
|
SizeControl,
|
|
2883
3097
|
{
|
|
2884
|
-
startIcon: /* @__PURE__ */
|
|
3098
|
+
startIcon: /* @__PURE__ */ React47.createElement(import_icons15.LetterXIcon, { fontSize: "tiny" }),
|
|
2885
3099
|
anchorRef: rowRef
|
|
2886
3100
|
}
|
|
2887
|
-
))), /* @__PURE__ */
|
|
3101
|
+
))), /* @__PURE__ */ React47.createElement(import_ui40.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React47.createElement(
|
|
2888
3102
|
SizeControl,
|
|
2889
3103
|
{
|
|
2890
|
-
startIcon: /* @__PURE__ */
|
|
3104
|
+
startIcon: /* @__PURE__ */ React47.createElement(import_icons15.LetterYIcon, { fontSize: "tiny" }),
|
|
2891
3105
|
anchorRef: rowRef
|
|
2892
3106
|
}
|
|
2893
3107
|
)))))) : null);
|
|
2894
3108
|
};
|
|
2895
3109
|
|
|
2896
3110
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
2897
|
-
var
|
|
3111
|
+
var React48 = __toESM(require("react"));
|
|
2898
3112
|
var import_icons16 = require("@elementor/icons");
|
|
2899
|
-
var
|
|
2900
|
-
var
|
|
3113
|
+
var import_ui41 = require("@elementor/ui");
|
|
3114
|
+
var import_i18n17 = require("@wordpress/i18n");
|
|
2901
3115
|
var repeatControlOptions = [
|
|
2902
3116
|
{
|
|
2903
3117
|
value: "repeat",
|
|
2904
|
-
label: (0,
|
|
2905
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3118
|
+
label: (0, import_i18n17.__)("Repeat", "elementor"),
|
|
3119
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(import_icons16.GridDotsIcon, { fontSize: size }),
|
|
2906
3120
|
showTooltip: true
|
|
2907
3121
|
},
|
|
2908
3122
|
{
|
|
2909
3123
|
value: "repeat-x",
|
|
2910
|
-
label: (0,
|
|
2911
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3124
|
+
label: (0, import_i18n17.__)("Repeat-x", "elementor"),
|
|
3125
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(import_icons16.DotsHorizontalIcon, { fontSize: size }),
|
|
2912
3126
|
showTooltip: true
|
|
2913
3127
|
},
|
|
2914
3128
|
{
|
|
2915
3129
|
value: "repeat-y",
|
|
2916
|
-
label: (0,
|
|
2917
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3130
|
+
label: (0, import_i18n17.__)("Repeat-y", "elementor"),
|
|
3131
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(import_icons16.DotsVerticalIcon, { fontSize: size }),
|
|
2918
3132
|
showTooltip: true
|
|
2919
3133
|
},
|
|
2920
3134
|
{
|
|
2921
3135
|
value: "no-repeat",
|
|
2922
|
-
label: (0,
|
|
2923
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3136
|
+
label: (0, import_i18n17.__)("No-repeat", "elementor"),
|
|
3137
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(import_icons16.XIcon, { fontSize: size }),
|
|
2924
3138
|
showTooltip: true
|
|
2925
3139
|
}
|
|
2926
3140
|
];
|
|
2927
3141
|
var BackgroundImageOverlayRepeat = () => {
|
|
2928
|
-
return /* @__PURE__ */
|
|
3142
|
+
return /* @__PURE__ */ React48.createElement(PopoverGridContainer, null, /* @__PURE__ */ React48.createElement(import_ui41.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(ControlFormLabel, null, (0, import_i18n17.__)("Repeat", "elementor"))), /* @__PURE__ */ React48.createElement(import_ui41.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React48.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
2929
3143
|
};
|
|
2930
3144
|
|
|
2931
3145
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
2932
|
-
var
|
|
2933
|
-
var
|
|
2934
|
-
var
|
|
3146
|
+
var React49 = __toESM(require("react"));
|
|
3147
|
+
var import_react28 = require("react");
|
|
3148
|
+
var import_editor_props24 = require("@elementor/editor-props");
|
|
2935
3149
|
var import_icons17 = require("@elementor/icons");
|
|
2936
|
-
var
|
|
2937
|
-
var
|
|
3150
|
+
var import_ui42 = require("@elementor/ui");
|
|
3151
|
+
var import_i18n18 = require("@wordpress/i18n");
|
|
2938
3152
|
var sizeControlOptions = [
|
|
2939
3153
|
{
|
|
2940
3154
|
value: "auto",
|
|
2941
|
-
label: (0,
|
|
2942
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3155
|
+
label: (0, import_i18n18.__)("Auto", "elementor"),
|
|
3156
|
+
renderContent: ({ size }) => /* @__PURE__ */ React49.createElement(import_icons17.LetterAIcon, { fontSize: size }),
|
|
2943
3157
|
showTooltip: true
|
|
2944
3158
|
},
|
|
2945
3159
|
{
|
|
2946
3160
|
value: "cover",
|
|
2947
|
-
label: (0,
|
|
2948
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3161
|
+
label: (0, import_i18n18.__)("Cover", "elementor"),
|
|
3162
|
+
renderContent: ({ size }) => /* @__PURE__ */ React49.createElement(import_icons17.ArrowsMaximizeIcon, { fontSize: size }),
|
|
2949
3163
|
showTooltip: true
|
|
2950
3164
|
},
|
|
2951
3165
|
{
|
|
2952
3166
|
value: "contain",
|
|
2953
|
-
label: (0,
|
|
2954
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3167
|
+
label: (0, import_i18n18.__)("Contain", "elementor"),
|
|
3168
|
+
renderContent: ({ size }) => /* @__PURE__ */ React49.createElement(import_icons17.ArrowBarBothIcon, { fontSize: size }),
|
|
2955
3169
|
showTooltip: true
|
|
2956
3170
|
},
|
|
2957
3171
|
{
|
|
2958
3172
|
value: "custom",
|
|
2959
|
-
label: (0,
|
|
2960
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3173
|
+
label: (0, import_i18n18.__)("Custom", "elementor"),
|
|
3174
|
+
renderContent: ({ size }) => /* @__PURE__ */ React49.createElement(import_icons17.PencilIcon, { fontSize: size }),
|
|
2961
3175
|
showTooltip: true
|
|
2962
3176
|
}
|
|
2963
3177
|
];
|
|
2964
3178
|
var BackgroundImageOverlaySize = () => {
|
|
2965
|
-
const backgroundImageScaleContext = useBoundProp(
|
|
2966
|
-
const stringPropContext = useBoundProp(
|
|
3179
|
+
const backgroundImageScaleContext = useBoundProp(import_editor_props24.backgroundImageSizeScalePropTypeUtil);
|
|
3180
|
+
const stringPropContext = useBoundProp(import_editor_props24.stringPropTypeUtil);
|
|
2967
3181
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
2968
|
-
const rowRef = (0,
|
|
3182
|
+
const rowRef = (0, import_react28.useRef)(null);
|
|
2969
3183
|
const handleSizeChange = (size) => {
|
|
2970
3184
|
if (size === "custom") {
|
|
2971
3185
|
backgroundImageScaleContext.setValue({ width: null, height: null });
|
|
@@ -2973,7 +3187,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
2973
3187
|
stringPropContext.setValue(size);
|
|
2974
3188
|
}
|
|
2975
3189
|
};
|
|
2976
|
-
return /* @__PURE__ */
|
|
3190
|
+
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_i18n18.__)("Size", "elementor"))), /* @__PURE__ */ React49.createElement(import_ui42.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React49.createElement(
|
|
2977
3191
|
ControlToggleButtonGroup,
|
|
2978
3192
|
{
|
|
2979
3193
|
exclusive: true,
|
|
@@ -2982,17 +3196,17 @@ var BackgroundImageOverlaySize = () => {
|
|
|
2982
3196
|
disabled: stringPropContext.disabled,
|
|
2983
3197
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value
|
|
2984
3198
|
}
|
|
2985
|
-
)))), isCustom ? /* @__PURE__ */
|
|
3199
|
+
)))), isCustom ? /* @__PURE__ */ React49.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React49.createElement(import_ui42.Grid, { item: true, xs: 12, ref: rowRef }, /* @__PURE__ */ React49.createElement(PopoverGridContainer, null, /* @__PURE__ */ React49.createElement(import_ui42.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React49.createElement(
|
|
2986
3200
|
SizeControl,
|
|
2987
3201
|
{
|
|
2988
|
-
startIcon: /* @__PURE__ */
|
|
3202
|
+
startIcon: /* @__PURE__ */ React49.createElement(import_icons17.ArrowsMoveHorizontalIcon, { fontSize: "tiny" }),
|
|
2989
3203
|
extendedOptions: ["auto"],
|
|
2990
3204
|
anchorRef: rowRef
|
|
2991
3205
|
}
|
|
2992
|
-
))), /* @__PURE__ */
|
|
3206
|
+
))), /* @__PURE__ */ React49.createElement(import_ui42.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React49.createElement(
|
|
2993
3207
|
SizeControl,
|
|
2994
3208
|
{
|
|
2995
|
-
startIcon: /* @__PURE__ */
|
|
3209
|
+
startIcon: /* @__PURE__ */ React49.createElement(import_icons17.ArrowsMoveVerticalIcon, { fontSize: "tiny" }),
|
|
2996
3210
|
extendedOptions: ["auto"],
|
|
2997
3211
|
anchorRef: rowRef
|
|
2998
3212
|
}
|
|
@@ -3000,17 +3214,17 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3000
3214
|
};
|
|
3001
3215
|
|
|
3002
3216
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
3003
|
-
var
|
|
3004
|
-
var
|
|
3005
|
-
var
|
|
3217
|
+
var import_react29 = require("react");
|
|
3218
|
+
var import_editor_props25 = require("@elementor/editor-props");
|
|
3219
|
+
var import_ui43 = require("@elementor/ui");
|
|
3006
3220
|
var useBackgroundTabsHistory = ({
|
|
3007
3221
|
color: initialBackgroundColorOverlay2,
|
|
3008
3222
|
image: initialBackgroundImageOverlay,
|
|
3009
3223
|
gradient: initialBackgroundGradientOverlay2
|
|
3010
3224
|
}) => {
|
|
3011
|
-
const { value: imageValue, setValue: setImageValue } = useBoundProp(
|
|
3012
|
-
const { value: colorValue, setValue: setColorValue } = useBoundProp(
|
|
3013
|
-
const { value: gradientValue, setValue: setGradientValue } = useBoundProp(
|
|
3225
|
+
const { value: imageValue, setValue: setImageValue } = useBoundProp(import_editor_props25.backgroundImageOverlayPropTypeUtil);
|
|
3226
|
+
const { value: colorValue, setValue: setColorValue } = useBoundProp(import_editor_props25.backgroundColorOverlayPropTypeUtil);
|
|
3227
|
+
const { value: gradientValue, setValue: setGradientValue } = useBoundProp(import_editor_props25.backgroundGradientOverlayPropTypeUtil);
|
|
3014
3228
|
const getCurrentOverlayType = () => {
|
|
3015
3229
|
if (colorValue) {
|
|
3016
3230
|
return "color";
|
|
@@ -3020,8 +3234,8 @@ var useBackgroundTabsHistory = ({
|
|
|
3020
3234
|
}
|
|
3021
3235
|
return "image";
|
|
3022
3236
|
};
|
|
3023
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
3024
|
-
const valuesHistory = (0,
|
|
3237
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui43.useTabs)(getCurrentOverlayType());
|
|
3238
|
+
const valuesHistory = (0, import_react29.useRef)({
|
|
3025
3239
|
image: initialBackgroundImageOverlay,
|
|
3026
3240
|
color: initialBackgroundColorOverlay2,
|
|
3027
3241
|
gradient: initialBackgroundGradientOverlay2
|
|
@@ -3059,9 +3273,9 @@ var useBackgroundTabsHistory = ({
|
|
|
3059
3273
|
|
|
3060
3274
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
3061
3275
|
var DEFAULT_BACKGROUND_COLOR_OVERLAY_COLOR = "#00000033";
|
|
3062
|
-
var initialBackgroundColorOverlay =
|
|
3276
|
+
var initialBackgroundColorOverlay = import_editor_props26.backgroundColorOverlayPropTypeUtil.create(
|
|
3063
3277
|
{
|
|
3064
|
-
color:
|
|
3278
|
+
color: import_editor_props26.colorPropTypeUtil.create(DEFAULT_BACKGROUND_COLOR_OVERLAY_COLOR)
|
|
3065
3279
|
}
|
|
3066
3280
|
);
|
|
3067
3281
|
var getInitialBackgroundOverlay = () => ({
|
|
@@ -3089,60 +3303,60 @@ var getInitialBackgroundOverlay = () => ({
|
|
|
3089
3303
|
}
|
|
3090
3304
|
});
|
|
3091
3305
|
var backgroundResolutionOptions = [
|
|
3092
|
-
{ label: (0,
|
|
3093
|
-
{ label: (0,
|
|
3094
|
-
{ label: (0,
|
|
3095
|
-
{ label: (0,
|
|
3306
|
+
{ label: (0, import_i18n19.__)("Thumbnail - 150 x 150", "elementor"), value: "thumbnail" },
|
|
3307
|
+
{ label: (0, import_i18n19.__)("Medium - 300 x 300", "elementor"), value: "medium" },
|
|
3308
|
+
{ label: (0, import_i18n19.__)("Large 1024 x 1024", "elementor"), value: "large" },
|
|
3309
|
+
{ label: (0, import_i18n19.__)("Full", "elementor"), value: "full" }
|
|
3096
3310
|
];
|
|
3097
3311
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
3098
|
-
const { propType, value: overlayValues, setValue, disabled } = useBoundProp(
|
|
3099
|
-
return /* @__PURE__ */
|
|
3312
|
+
const { propType, value: overlayValues, setValue, disabled } = useBoundProp(import_editor_props26.backgroundOverlayPropTypeUtil);
|
|
3313
|
+
return /* @__PURE__ */ React50.createElement(PropProvider, { propType, value: overlayValues, setValue, isDisabled: () => disabled }, /* @__PURE__ */ React50.createElement(
|
|
3100
3314
|
Repeater,
|
|
3101
3315
|
{
|
|
3102
3316
|
openOnAdd: true,
|
|
3103
3317
|
disabled,
|
|
3104
3318
|
values: overlayValues ?? [],
|
|
3105
3319
|
setValues: setValue,
|
|
3106
|
-
label: (0,
|
|
3320
|
+
label: (0, import_i18n19.__)("Overlay", "elementor"),
|
|
3107
3321
|
itemSettings: {
|
|
3108
|
-
Icon:
|
|
3109
|
-
Label:
|
|
3110
|
-
Content:
|
|
3322
|
+
Icon: ItemIcon3,
|
|
3323
|
+
Label: ItemLabel3,
|
|
3324
|
+
Content: ItemContent3,
|
|
3111
3325
|
initialValues: getInitialBackgroundOverlay()
|
|
3112
3326
|
}
|
|
3113
3327
|
}
|
|
3114
3328
|
));
|
|
3115
3329
|
});
|
|
3116
|
-
var
|
|
3117
|
-
return /* @__PURE__ */
|
|
3330
|
+
var ItemContent3 = ({ anchorEl = null, bind }) => {
|
|
3331
|
+
return /* @__PURE__ */ React50.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React50.createElement(Content3, { anchorEl }));
|
|
3118
3332
|
};
|
|
3119
|
-
var
|
|
3333
|
+
var Content3 = ({ anchorEl }) => {
|
|
3120
3334
|
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
3121
3335
|
image: getInitialBackgroundOverlay().value,
|
|
3122
3336
|
color: initialBackgroundColorOverlay.value,
|
|
3123
3337
|
gradient: initialBackgroundGradientOverlay.value
|
|
3124
3338
|
});
|
|
3125
|
-
return /* @__PURE__ */
|
|
3126
|
-
|
|
3339
|
+
return /* @__PURE__ */ React50.createElement(import_ui44.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React50.createElement(import_ui44.Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React50.createElement(
|
|
3340
|
+
import_ui44.Tabs,
|
|
3127
3341
|
{
|
|
3128
3342
|
size: "small",
|
|
3129
3343
|
variant: "fullWidth",
|
|
3130
3344
|
...getTabsProps(),
|
|
3131
|
-
"aria-label": (0,
|
|
3345
|
+
"aria-label": (0, import_i18n19.__)("Background Overlay", "elementor")
|
|
3132
3346
|
},
|
|
3133
|
-
/* @__PURE__ */
|
|
3134
|
-
/* @__PURE__ */
|
|
3135
|
-
/* @__PURE__ */
|
|
3136
|
-
)), /* @__PURE__ */
|
|
3347
|
+
/* @__PURE__ */ React50.createElement(import_ui44.Tab, { label: (0, import_i18n19.__)("Image", "elementor"), ...getTabProps("image") }),
|
|
3348
|
+
/* @__PURE__ */ React50.createElement(import_ui44.Tab, { label: (0, import_i18n19.__)("Gradient", "elementor"), ...getTabProps("gradient") }),
|
|
3349
|
+
/* @__PURE__ */ React50.createElement(import_ui44.Tab, { label: (0, import_i18n19.__)("Color", "elementor"), ...getTabProps("color") })
|
|
3350
|
+
)), /* @__PURE__ */ React50.createElement(import_ui44.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React50.createElement(PopoverContent, null, /* @__PURE__ */ React50.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React50.createElement(import_ui44.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("gradient") }, /* @__PURE__ */ React50.createElement(BackgroundGradientColorControl, null)), /* @__PURE__ */ React50.createElement(import_ui44.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("color") }, /* @__PURE__ */ React50.createElement(PopoverContent, null, /* @__PURE__ */ React50.createElement(ColorOverlayContent, { anchorEl }))));
|
|
3137
3351
|
};
|
|
3138
|
-
var
|
|
3352
|
+
var ItemIcon3 = ({ value }) => {
|
|
3139
3353
|
switch (value.$$type) {
|
|
3140
3354
|
case "background-image-overlay":
|
|
3141
|
-
return /* @__PURE__ */
|
|
3355
|
+
return /* @__PURE__ */ React50.createElement(ItemIconImage, { value });
|
|
3142
3356
|
case "background-color-overlay":
|
|
3143
|
-
return /* @__PURE__ */
|
|
3357
|
+
return /* @__PURE__ */ React50.createElement(ItemIconColor, { value });
|
|
3144
3358
|
case "background-gradient-overlay":
|
|
3145
|
-
return /* @__PURE__ */
|
|
3359
|
+
return /* @__PURE__ */ React50.createElement(ItemIconGradient, { value });
|
|
3146
3360
|
default:
|
|
3147
3361
|
return null;
|
|
3148
3362
|
}
|
|
@@ -3155,12 +3369,12 @@ var extractColorFrom = (prop) => {
|
|
|
3155
3369
|
};
|
|
3156
3370
|
var ItemIconColor = ({ value: prop }) => {
|
|
3157
3371
|
const color = extractColorFrom(prop);
|
|
3158
|
-
return /* @__PURE__ */
|
|
3372
|
+
return /* @__PURE__ */ React50.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: color });
|
|
3159
3373
|
};
|
|
3160
3374
|
var ItemIconImage = ({ value }) => {
|
|
3161
3375
|
const { imageUrl } = useImage(value);
|
|
3162
|
-
return /* @__PURE__ */
|
|
3163
|
-
|
|
3376
|
+
return /* @__PURE__ */ React50.createElement(
|
|
3377
|
+
import_ui44.CardMedia,
|
|
3164
3378
|
{
|
|
3165
3379
|
image: imageUrl,
|
|
3166
3380
|
sx: (theme) => ({
|
|
@@ -3174,49 +3388,43 @@ var ItemIconImage = ({ value }) => {
|
|
|
3174
3388
|
};
|
|
3175
3389
|
var ItemIconGradient = ({ value }) => {
|
|
3176
3390
|
const gradient = getGradientValue(value);
|
|
3177
|
-
return /* @__PURE__ */
|
|
3391
|
+
return /* @__PURE__ */ React50.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: gradient });
|
|
3178
3392
|
};
|
|
3179
|
-
var
|
|
3393
|
+
var ItemLabel3 = ({ value }) => {
|
|
3180
3394
|
switch (value.$$type) {
|
|
3181
3395
|
case "background-image-overlay":
|
|
3182
|
-
return /* @__PURE__ */
|
|
3396
|
+
return /* @__PURE__ */ React50.createElement(ItemLabelImage, { value });
|
|
3183
3397
|
case "background-color-overlay":
|
|
3184
|
-
return /* @__PURE__ */
|
|
3398
|
+
return /* @__PURE__ */ React50.createElement(ItemLabelColor, { value });
|
|
3185
3399
|
case "background-gradient-overlay":
|
|
3186
|
-
return /* @__PURE__ */
|
|
3400
|
+
return /* @__PURE__ */ React50.createElement(ItemLabelGradient, { value });
|
|
3187
3401
|
default:
|
|
3188
3402
|
return null;
|
|
3189
3403
|
}
|
|
3190
3404
|
};
|
|
3191
3405
|
var ItemLabelColor = ({ value: prop }) => {
|
|
3192
3406
|
const color = extractColorFrom(prop);
|
|
3193
|
-
return /* @__PURE__ */
|
|
3407
|
+
return /* @__PURE__ */ React50.createElement("span", null, color);
|
|
3194
3408
|
};
|
|
3195
3409
|
var ItemLabelImage = ({ value }) => {
|
|
3196
3410
|
const { imageTitle } = useImage(value);
|
|
3197
|
-
return /* @__PURE__ */
|
|
3411
|
+
return /* @__PURE__ */ React50.createElement("span", null, imageTitle);
|
|
3198
3412
|
};
|
|
3199
3413
|
var ItemLabelGradient = ({ value }) => {
|
|
3200
3414
|
if (value.value.type.value === "linear") {
|
|
3201
|
-
return /* @__PURE__ */
|
|
3415
|
+
return /* @__PURE__ */ React50.createElement("span", null, (0, import_i18n19.__)("Linear Gradient", "elementor"));
|
|
3202
3416
|
}
|
|
3203
|
-
return /* @__PURE__ */
|
|
3417
|
+
return /* @__PURE__ */ React50.createElement("span", null, (0, import_i18n19.__)("Radial Gradient", "elementor"));
|
|
3204
3418
|
};
|
|
3205
3419
|
var ColorOverlayContent = ({ anchorEl }) => {
|
|
3206
|
-
const propContext = useBoundProp(
|
|
3207
|
-
return /* @__PURE__ */
|
|
3420
|
+
const propContext = useBoundProp(import_editor_props26.backgroundColorOverlayPropTypeUtil);
|
|
3421
|
+
return /* @__PURE__ */ React50.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React50.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React50.createElement(ColorControl, { anchorEl })));
|
|
3208
3422
|
};
|
|
3209
3423
|
var ImageOverlayContent = () => {
|
|
3210
|
-
const propContext = useBoundProp(
|
|
3211
|
-
return /* @__PURE__ */
|
|
3212
|
-
ImageControl,
|
|
3213
|
-
{
|
|
3214
|
-
resolutionLabel: (0, import_i18n18.__)("Resolution", "elementor"),
|
|
3215
|
-
sizes: backgroundResolutionOptions
|
|
3216
|
-
}
|
|
3217
|
-
)))), /* @__PURE__ */ React48.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React48.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React48.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React48.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React48.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React48.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React48.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React48.createElement(BackgroundImageOverlayAttachment, null)));
|
|
3424
|
+
const propContext = useBoundProp(import_editor_props26.backgroundImageOverlayPropTypeUtil);
|
|
3425
|
+
return /* @__PURE__ */ React50.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React50.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React50.createElement(ImageControl, { sizes: backgroundResolutionOptions })), /* @__PURE__ */ React50.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React50.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React50.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React50.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React50.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React50.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React50.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React50.createElement(BackgroundImageOverlayAttachment, null)));
|
|
3218
3426
|
};
|
|
3219
|
-
var StyledUnstableColorIndicator = (0,
|
|
3427
|
+
var StyledUnstableColorIndicator = (0, import_ui44.styled)(import_ui44.UnstableColorIndicator)(({ theme }) => ({
|
|
3220
3428
|
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
3221
3429
|
}));
|
|
3222
3430
|
var useImage = (image) => {
|
|
@@ -3251,35 +3459,23 @@ var getGradientValue = (value) => {
|
|
|
3251
3459
|
|
|
3252
3460
|
// src/controls/background-control/background-control.tsx
|
|
3253
3461
|
var BackgroundControl = createControl(() => {
|
|
3254
|
-
const propContext = useBoundProp(
|
|
3255
|
-
const isUsingNestedProps = (0,
|
|
3256
|
-
const colorLabel = (0,
|
|
3257
|
-
return /* @__PURE__ */
|
|
3258
|
-
});
|
|
3259
|
-
|
|
3260
|
-
// src/controls/switch-control.tsx
|
|
3261
|
-
var React50 = __toESM(require("react"));
|
|
3262
|
-
var import_editor_props26 = require("@elementor/editor-props");
|
|
3263
|
-
var import_ui44 = require("@elementor/ui");
|
|
3264
|
-
var SwitchControl2 = createControl(() => {
|
|
3265
|
-
const { value, setValue, disabled } = useBoundProp(import_editor_props26.booleanPropTypeUtil);
|
|
3266
|
-
const handleChange = (event) => {
|
|
3267
|
-
setValue(event.target.checked);
|
|
3268
|
-
};
|
|
3269
|
-
return /* @__PURE__ */ React50.createElement("div", { style: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React50.createElement(import_ui44.Switch, { checked: !!value, onChange: handleChange, size: "small", disabled }));
|
|
3462
|
+
const propContext = useBoundProp(import_editor_props27.backgroundPropTypeUtil);
|
|
3463
|
+
const isUsingNestedProps = (0, import_editor_v1_adapters5.isExperimentActive)("e_v_3_30");
|
|
3464
|
+
const colorLabel = (0, import_i18n20.__)("Color", "elementor");
|
|
3465
|
+
return /* @__PURE__ */ React51.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React51.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React51.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React51.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React51.createElement(import_ui45.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React51.createElement(import_ui45.Grid, { item: true, xs: 6 }, isUsingNestedProps ? /* @__PURE__ */ React51.createElement(ControlLabel, null, colorLabel) : /* @__PURE__ */ React51.createElement(ControlFormLabel, null, colorLabel)), /* @__PURE__ */ React51.createElement(import_ui45.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(ColorControl, null)))));
|
|
3270
3466
|
});
|
|
3271
3467
|
|
|
3272
3468
|
// src/controls/repeatable-control.tsx
|
|
3273
|
-
var
|
|
3274
|
-
var
|
|
3275
|
-
var
|
|
3276
|
-
var
|
|
3469
|
+
var React52 = __toESM(require("react"));
|
|
3470
|
+
var import_react31 = require("react");
|
|
3471
|
+
var import_editor_props28 = require("@elementor/editor-props");
|
|
3472
|
+
var import_ui46 = require("@elementor/ui");
|
|
3277
3473
|
|
|
3278
3474
|
// src/hooks/use-repeatable-control-context.ts
|
|
3279
|
-
var
|
|
3280
|
-
var RepeatableControlContext = (0,
|
|
3475
|
+
var import_react30 = require("react");
|
|
3476
|
+
var RepeatableControlContext = (0, import_react30.createContext)(void 0);
|
|
3281
3477
|
var useRepeatableControlContext = () => {
|
|
3282
|
-
const context = (0,
|
|
3478
|
+
const context = (0, import_react30.useContext)(RepeatableControlContext);
|
|
3283
3479
|
if (!context) {
|
|
3284
3480
|
throw new Error("useRepeatableControlContext must be used within RepeatableControl");
|
|
3285
3481
|
}
|
|
@@ -3288,28 +3484,45 @@ var useRepeatableControlContext = () => {
|
|
|
3288
3484
|
|
|
3289
3485
|
// src/controls/repeatable-control.tsx
|
|
3290
3486
|
var RepeatableControl = createControl(
|
|
3291
|
-
({
|
|
3487
|
+
({
|
|
3488
|
+
repeaterLabel,
|
|
3489
|
+
childControlConfig,
|
|
3490
|
+
showDuplicate,
|
|
3491
|
+
showToggle,
|
|
3492
|
+
initialValues,
|
|
3493
|
+
patternLabel,
|
|
3494
|
+
placeholder
|
|
3495
|
+
}) => {
|
|
3292
3496
|
const { propTypeUtil: childPropTypeUtil } = childControlConfig;
|
|
3293
3497
|
if (!childPropTypeUtil) {
|
|
3294
3498
|
return null;
|
|
3295
3499
|
}
|
|
3296
|
-
const childArrayPropTypeUtil = (0,
|
|
3297
|
-
() => (0,
|
|
3500
|
+
const childArrayPropTypeUtil = (0, import_react31.useMemo)(
|
|
3501
|
+
() => (0, import_editor_props28.createArrayPropUtils)(childPropTypeUtil.key, childPropTypeUtil.schema),
|
|
3298
3502
|
[childPropTypeUtil.key, childPropTypeUtil.schema]
|
|
3299
3503
|
);
|
|
3504
|
+
const contextValue = (0, import_react31.useMemo)(
|
|
3505
|
+
() => ({
|
|
3506
|
+
...childControlConfig,
|
|
3507
|
+
placeholder: placeholder || "",
|
|
3508
|
+
patternLabel: patternLabel || ""
|
|
3509
|
+
}),
|
|
3510
|
+
[childControlConfig, placeholder, patternLabel]
|
|
3511
|
+
);
|
|
3300
3512
|
const { propType, value, setValue } = useBoundProp(childArrayPropTypeUtil);
|
|
3301
|
-
return /* @__PURE__ */
|
|
3513
|
+
return /* @__PURE__ */ React52.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React52.createElement(RepeatableControlContext.Provider, { value: contextValue }, /* @__PURE__ */ React52.createElement(
|
|
3302
3514
|
Repeater,
|
|
3303
3515
|
{
|
|
3304
3516
|
openOnAdd: true,
|
|
3305
3517
|
values: value ?? [],
|
|
3306
3518
|
setValues: setValue,
|
|
3307
|
-
label,
|
|
3519
|
+
label: repeaterLabel,
|
|
3520
|
+
isSortable: false,
|
|
3308
3521
|
itemSettings: {
|
|
3309
|
-
Icon:
|
|
3310
|
-
Label:
|
|
3311
|
-
Content:
|
|
3312
|
-
initialValues: childPropTypeUtil.create(null)
|
|
3522
|
+
Icon: ItemIcon4,
|
|
3523
|
+
Label: ItemLabel4,
|
|
3524
|
+
Content: ItemContent4,
|
|
3525
|
+
initialValues: childPropTypeUtil.create(initialValues || null)
|
|
3313
3526
|
},
|
|
3314
3527
|
showDuplicate,
|
|
3315
3528
|
showToggle
|
|
@@ -3317,34 +3530,81 @@ var RepeatableControl = createControl(
|
|
|
3317
3530
|
)));
|
|
3318
3531
|
}
|
|
3319
3532
|
);
|
|
3320
|
-
var
|
|
3321
|
-
return /* @__PURE__ */
|
|
3533
|
+
var ItemContent4 = ({ bind }) => {
|
|
3534
|
+
return /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React52.createElement(Content4, null));
|
|
3322
3535
|
};
|
|
3323
|
-
var
|
|
3324
|
-
var
|
|
3536
|
+
var ItemIcon4 = () => /* @__PURE__ */ React52.createElement(React52.Fragment, null);
|
|
3537
|
+
var Content4 = () => {
|
|
3325
3538
|
const { component: ChildControl, props = {} } = useRepeatableControlContext();
|
|
3326
|
-
return /* @__PURE__ */
|
|
3539
|
+
return /* @__PURE__ */ React52.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React52.createElement(PopoverGridContainer, null, /* @__PURE__ */ React52.createElement(ChildControl, { ...props })));
|
|
3540
|
+
};
|
|
3541
|
+
var interpolate = (template, data) => {
|
|
3542
|
+
if (!data) {
|
|
3543
|
+
return template;
|
|
3544
|
+
}
|
|
3545
|
+
return new Function(...Object.keys(data), `return \`${template}\`;`)(...Object.values(data));
|
|
3546
|
+
};
|
|
3547
|
+
var getNestedValue = (obj, path) => {
|
|
3548
|
+
return path.split(".").reduce((current, key) => current?.[key], obj);
|
|
3549
|
+
};
|
|
3550
|
+
var isEmptyValue = (val) => {
|
|
3551
|
+
if (typeof val === "string") {
|
|
3552
|
+
return val.trim() === "";
|
|
3553
|
+
}
|
|
3554
|
+
if (Number.isNaN(val)) {
|
|
3555
|
+
return true;
|
|
3556
|
+
}
|
|
3557
|
+
if (Array.isArray(val)) {
|
|
3558
|
+
return val.length === 0;
|
|
3559
|
+
}
|
|
3560
|
+
if (typeof val === "object" && val !== null && Object.keys(val).length === 0) {
|
|
3561
|
+
return true;
|
|
3562
|
+
}
|
|
3563
|
+
return false;
|
|
3564
|
+
};
|
|
3565
|
+
var shouldShowPlaceholder = (pattern, data) => {
|
|
3566
|
+
const propertyPaths = getAllProperties(pattern);
|
|
3567
|
+
const values = propertyPaths.map((path) => getNestedValue(data, path));
|
|
3568
|
+
if (values.length === 0) {
|
|
3569
|
+
return false;
|
|
3570
|
+
}
|
|
3571
|
+
if (values.some((value) => value === null || value === void 0)) {
|
|
3572
|
+
return true;
|
|
3573
|
+
}
|
|
3574
|
+
if (values.every(isEmptyValue)) {
|
|
3575
|
+
return true;
|
|
3576
|
+
}
|
|
3577
|
+
return false;
|
|
3327
3578
|
};
|
|
3328
|
-
var
|
|
3329
|
-
const {
|
|
3330
|
-
|
|
3579
|
+
var ItemLabel4 = ({ value }) => {
|
|
3580
|
+
const { placeholder, patternLabel } = useRepeatableControlContext();
|
|
3581
|
+
const label = shouldShowPlaceholder(patternLabel, value) ? placeholder : interpolate(patternLabel, value);
|
|
3582
|
+
return /* @__PURE__ */ React52.createElement(import_ui46.Box, { component: "span", color: "text.tertiary" }, label);
|
|
3583
|
+
};
|
|
3584
|
+
var getAllProperties = (pattern) => {
|
|
3585
|
+
const properties = pattern.match(/\$\{([^}]+)\}/g)?.map(
|
|
3586
|
+
(match) => match.slice(2, -1)
|
|
3587
|
+
) || [];
|
|
3588
|
+
return properties;
|
|
3331
3589
|
};
|
|
3332
3590
|
|
|
3333
3591
|
// src/controls/key-value-control.tsx
|
|
3334
|
-
var
|
|
3335
|
-
var
|
|
3336
|
-
var
|
|
3337
|
-
var
|
|
3592
|
+
var React53 = __toESM(require("react"));
|
|
3593
|
+
var import_react32 = require("react");
|
|
3594
|
+
var import_editor_props29 = require("@elementor/editor-props");
|
|
3595
|
+
var import_ui47 = require("@elementor/ui");
|
|
3338
3596
|
var import_i18n21 = require("@wordpress/i18n");
|
|
3339
3597
|
var KeyValueControl = createControl((props = {}) => {
|
|
3340
|
-
const { value, setValue } = useBoundProp(
|
|
3341
|
-
const [keyError, setKeyError] = (0,
|
|
3342
|
-
const [valueError, setValueError] = (0,
|
|
3598
|
+
const { value, setValue } = useBoundProp(import_editor_props29.keyValuePropTypeUtil);
|
|
3599
|
+
const [keyError, setKeyError] = (0, import_react32.useState)(null);
|
|
3600
|
+
const [valueError, setValueError] = (0, import_react32.useState)(null);
|
|
3601
|
+
const [sessionState, setSessionState] = (0, import_react32.useState)({
|
|
3602
|
+
key: value?.key?.value || "",
|
|
3603
|
+
value: value?.value?.value || ""
|
|
3604
|
+
});
|
|
3343
3605
|
const keyLabel = props.keyName || (0, import_i18n21.__)("Key", "elementor");
|
|
3344
3606
|
const valueLabel = props.valueName || (0, import_i18n21.__)("Value", "elementor");
|
|
3345
|
-
const
|
|
3346
|
-
const valueValue = value?.value?.value || "";
|
|
3347
|
-
const [keyRegex, valueRegex, errMsg] = (0, import_react31.useMemo)(
|
|
3607
|
+
const [keyRegex, valueRegex, errMsg] = (0, import_react32.useMemo)(
|
|
3348
3608
|
() => [
|
|
3349
3609
|
props.regexKey ? new RegExp(props.regexKey) : void 0,
|
|
3350
3610
|
props.regexValue ? new RegExp(props.regexValue) : void 0,
|
|
@@ -3352,60 +3612,77 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
3352
3612
|
],
|
|
3353
3613
|
[props.regexKey, props.regexValue, props.validationErrorMessage]
|
|
3354
3614
|
);
|
|
3355
|
-
const validate = (newValue,
|
|
3356
|
-
if (
|
|
3615
|
+
const validate = (newValue, fieldType) => {
|
|
3616
|
+
if (fieldType === "key" && keyRegex) {
|
|
3357
3617
|
const isValid = keyRegex.test(newValue);
|
|
3358
3618
|
setKeyError(isValid ? null : errMsg);
|
|
3359
|
-
|
|
3619
|
+
return isValid;
|
|
3620
|
+
} else if (fieldType === "value" && valueRegex) {
|
|
3360
3621
|
const isValid = valueRegex.test(newValue);
|
|
3361
3622
|
setValueError(isValid ? null : errMsg);
|
|
3623
|
+
return isValid;
|
|
3362
3624
|
}
|
|
3625
|
+
return true;
|
|
3363
3626
|
};
|
|
3364
3627
|
const handleChange = (event, fieldType) => {
|
|
3365
3628
|
const newValue = event.target.value;
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3629
|
+
setSessionState((prev) => ({
|
|
3630
|
+
...prev,
|
|
3631
|
+
[fieldType]: newValue
|
|
3632
|
+
}));
|
|
3633
|
+
if (validate(newValue, fieldType)) {
|
|
3634
|
+
setValue({
|
|
3635
|
+
...value,
|
|
3636
|
+
[fieldType]: {
|
|
3637
|
+
value: newValue,
|
|
3638
|
+
$$type: "string"
|
|
3639
|
+
}
|
|
3640
|
+
});
|
|
3641
|
+
} else {
|
|
3642
|
+
setValue({
|
|
3643
|
+
...value,
|
|
3644
|
+
[fieldType]: {
|
|
3645
|
+
value: "",
|
|
3646
|
+
$$type: "string"
|
|
3647
|
+
}
|
|
3648
|
+
});
|
|
3649
|
+
}
|
|
3374
3650
|
};
|
|
3375
3651
|
const isKeyInvalid = keyError !== null;
|
|
3376
3652
|
const isValueInvalid = valueError !== null;
|
|
3377
|
-
return /* @__PURE__ */
|
|
3378
|
-
|
|
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,
|
|
3379
3655
|
{
|
|
3656
|
+
autoFocus: true,
|
|
3380
3657
|
sx: { pt: 1 },
|
|
3381
3658
|
size: "tiny",
|
|
3382
3659
|
fullWidth: true,
|
|
3383
|
-
value:
|
|
3660
|
+
value: sessionState.key,
|
|
3384
3661
|
onChange: (e) => handleChange(e, "key"),
|
|
3385
3662
|
error: isKeyInvalid
|
|
3386
3663
|
}
|
|
3387
|
-
), isKeyInvalid && /* @__PURE__ */
|
|
3388
|
-
|
|
3664
|
+
), isKeyInvalid && /* @__PURE__ */ React53.createElement(import_ui47.FormHelperText, { error: true }, keyError)), /* @__PURE__ */ React53.createElement(import_ui47.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React53.createElement(import_ui47.FormLabel, { size: "tiny" }, valueLabel), /* @__PURE__ */ React53.createElement(
|
|
3665
|
+
import_ui47.TextField,
|
|
3389
3666
|
{
|
|
3390
3667
|
sx: { pt: 1 },
|
|
3391
3668
|
size: "tiny",
|
|
3392
3669
|
fullWidth: true,
|
|
3393
|
-
value:
|
|
3670
|
+
value: sessionState.value,
|
|
3394
3671
|
onChange: (e) => handleChange(e, "value"),
|
|
3395
3672
|
disabled: isKeyInvalid,
|
|
3396
3673
|
error: isValueInvalid
|
|
3397
3674
|
}
|
|
3398
|
-
), isValueInvalid && /* @__PURE__ */
|
|
3675
|
+
), isValueInvalid && /* @__PURE__ */ React53.createElement(import_ui47.FormHelperText, { error: true }, valueError))));
|
|
3399
3676
|
});
|
|
3400
3677
|
|
|
3401
3678
|
// src/controls/position-control.tsx
|
|
3402
|
-
var
|
|
3403
|
-
var
|
|
3404
|
-
var
|
|
3405
|
-
var
|
|
3406
|
-
var
|
|
3679
|
+
var React54 = __toESM(require("react"));
|
|
3680
|
+
var import_react33 = require("react");
|
|
3681
|
+
var import_editor_props30 = require("@elementor/editor-props");
|
|
3682
|
+
var import_editor_ui8 = require("@elementor/editor-ui");
|
|
3683
|
+
var import_editor_v1_adapters6 = require("@elementor/editor-v1-adapters");
|
|
3407
3684
|
var import_icons18 = require("@elementor/icons");
|
|
3408
|
-
var
|
|
3685
|
+
var import_ui48 = require("@elementor/ui");
|
|
3409
3686
|
var import_i18n22 = require("@wordpress/i18n");
|
|
3410
3687
|
var positionOptions = [
|
|
3411
3688
|
{ label: (0, import_i18n22.__)("Center center", "elementor"), value: "center center" },
|
|
@@ -3419,11 +3696,11 @@ var positionOptions = [
|
|
|
3419
3696
|
{ label: (0, import_i18n22.__)("Bottom right", "elementor"), value: "bottom right" }
|
|
3420
3697
|
];
|
|
3421
3698
|
var PositionControl = () => {
|
|
3422
|
-
const positionContext = useBoundProp(
|
|
3423
|
-
const stringPropContext = useBoundProp(
|
|
3424
|
-
const isVersion331Active = (0,
|
|
3699
|
+
const positionContext = useBoundProp(import_editor_props30.positionPropTypeUtil);
|
|
3700
|
+
const stringPropContext = useBoundProp(import_editor_props30.stringPropTypeUtil);
|
|
3701
|
+
const isVersion331Active = (0, import_editor_v1_adapters6.isExperimentActive)("e_v_3_31");
|
|
3425
3702
|
const isCustom = !!positionContext.value && isVersion331Active;
|
|
3426
|
-
const availablePositionOptions = (0,
|
|
3703
|
+
const availablePositionOptions = (0, import_react33.useMemo)(() => {
|
|
3427
3704
|
const options = [...positionOptions];
|
|
3428
3705
|
if (isVersion331Active) {
|
|
3429
3706
|
options.push({ label: (0, import_i18n22.__)("Custom", "elementor"), value: "custom" });
|
|
@@ -3438,8 +3715,8 @@ var PositionControl = () => {
|
|
|
3438
3715
|
stringPropContext.setValue(value);
|
|
3439
3716
|
}
|
|
3440
3717
|
};
|
|
3441
|
-
return /* @__PURE__ */
|
|
3442
|
-
|
|
3718
|
+
return /* @__PURE__ */ React54.createElement(import_ui48.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React54.createElement(import_ui48.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React54.createElement(import_ui48.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React54.createElement(import_ui48.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(ControlFormLabel, null, (0, import_i18n22.__)("Object position", "elementor"))), /* @__PURE__ */ React54.createElement(import_ui48.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React54.createElement(
|
|
3719
|
+
import_ui48.Select,
|
|
3443
3720
|
{
|
|
3444
3721
|
size: "tiny",
|
|
3445
3722
|
disabled: stringPropContext.disabled,
|
|
@@ -3447,9 +3724,133 @@ var PositionControl = () => {
|
|
|
3447
3724
|
onChange: handlePositionChange,
|
|
3448
3725
|
fullWidth: true
|
|
3449
3726
|
},
|
|
3450
|
-
availablePositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
3451
|
-
)))), isCustom && /* @__PURE__ */
|
|
3727
|
+
availablePositionOptions.map(({ label, value }) => /* @__PURE__ */ React54.createElement(import_editor_ui8.MenuListItem, { key: value, value: value ?? "" }, label))
|
|
3728
|
+
)))), isCustom && /* @__PURE__ */ React54.createElement(PropProvider, { ...positionContext }, /* @__PURE__ */ React54.createElement(import_ui48.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React54.createElement(import_ui48.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React54.createElement(import_ui48.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React54.createElement(SizeControl, { startIcon: /* @__PURE__ */ React54.createElement(import_icons18.LetterXIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React54.createElement(import_ui48.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React54.createElement(SizeControl, { startIcon: /* @__PURE__ */ React54.createElement(import_icons18.LetterYIcon, { fontSize: "tiny" }) })))))));
|
|
3729
|
+
};
|
|
3730
|
+
|
|
3731
|
+
// src/controls/transform-control/transform-repeater-control.tsx
|
|
3732
|
+
var React60 = __toESM(require("react"));
|
|
3733
|
+
var import_editor_props32 = require("@elementor/editor-props");
|
|
3734
|
+
var import_i18n26 = require("@wordpress/i18n");
|
|
3735
|
+
|
|
3736
|
+
// src/controls/transform-control/transform-content.tsx
|
|
3737
|
+
var React57 = __toESM(require("react"));
|
|
3738
|
+
var import_ui51 = require("@elementor/ui");
|
|
3739
|
+
var import_i18n24 = require("@wordpress/i18n");
|
|
3740
|
+
|
|
3741
|
+
// src/controls/transform-control/functions/move.tsx
|
|
3742
|
+
var React56 = __toESM(require("react"));
|
|
3743
|
+
var import_react34 = require("react");
|
|
3744
|
+
var import_editor_props31 = require("@elementor/editor-props");
|
|
3745
|
+
var import_icons19 = require("@elementor/icons");
|
|
3746
|
+
var import_ui50 = require("@elementor/ui");
|
|
3747
|
+
var import_i18n23 = require("@wordpress/i18n");
|
|
3748
|
+
|
|
3749
|
+
// src/controls/transform-control/functions/axis-row.tsx
|
|
3750
|
+
var React55 = __toESM(require("react"));
|
|
3751
|
+
var import_ui49 = require("@elementor/ui");
|
|
3752
|
+
var AxisRow = ({ label, bindValue, startIcon, anchorRef }) => {
|
|
3753
|
+
return /* @__PURE__ */ React55.createElement(import_ui49.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React55.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ React55.createElement(import_ui49.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React55.createElement(ControlLabel, null, label)), /* @__PURE__ */ React55.createElement(import_ui49.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React55.createElement(PropKeyProvider, { bind: bindValue }, /* @__PURE__ */ React55.createElement(SizeControl, { anchorRef, startIcon })))));
|
|
3754
|
+
};
|
|
3755
|
+
|
|
3756
|
+
// src/controls/transform-control/functions/move.tsx
|
|
3757
|
+
var moveAxisControls = [
|
|
3758
|
+
{
|
|
3759
|
+
label: (0, import_i18n23.__)("Move X", "elementor"),
|
|
3760
|
+
bindValue: "x",
|
|
3761
|
+
startIcon: /* @__PURE__ */ React56.createElement(import_icons19.ArrowRightIcon, { fontSize: "tiny" })
|
|
3762
|
+
},
|
|
3763
|
+
{
|
|
3764
|
+
label: (0, import_i18n23.__)("Move Y", "elementor"),
|
|
3765
|
+
bindValue: "y",
|
|
3766
|
+
startIcon: /* @__PURE__ */ React56.createElement(import_icons19.ArrowDownSmallIcon, { fontSize: "tiny" })
|
|
3767
|
+
},
|
|
3768
|
+
{
|
|
3769
|
+
label: (0, import_i18n23.__)("Move Z", "elementor"),
|
|
3770
|
+
bindValue: "z",
|
|
3771
|
+
startIcon: /* @__PURE__ */ React56.createElement(import_icons19.ArrowDownLeftIcon, { fontSize: "tiny" })
|
|
3772
|
+
}
|
|
3773
|
+
];
|
|
3774
|
+
var Move = () => {
|
|
3775
|
+
const context = useBoundProp(import_editor_props31.moveTransformPropTypeUtil);
|
|
3776
|
+
const rowRef = (0, import_react34.useRef)(null);
|
|
3777
|
+
return /* @__PURE__ */ React56.createElement(import_ui50.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React56.createElement(PropProvider, { ...context }, /* @__PURE__ */ React56.createElement(PropKeyProvider, { bind: "transform-move" }, moveAxisControls.map((control) => /* @__PURE__ */ React56.createElement(AxisRow, { key: control.bindValue, ...control, anchorRef: rowRef })))));
|
|
3778
|
+
};
|
|
3779
|
+
|
|
3780
|
+
// src/controls/transform-control/transform-content.tsx
|
|
3781
|
+
var TransformContent = ({ bind }) => {
|
|
3782
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui51.useTabs)("transform-move");
|
|
3783
|
+
return /* @__PURE__ */ React57.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React57.createElement(PopoverContent, null, /* @__PURE__ */ React57.createElement(import_ui51.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React57.createElement(import_ui51.Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React57.createElement(
|
|
3784
|
+
import_ui51.Tabs,
|
|
3785
|
+
{
|
|
3786
|
+
size: "small",
|
|
3787
|
+
variant: "fullWidth",
|
|
3788
|
+
...getTabsProps(),
|
|
3789
|
+
"aria-label": (0, import_i18n24.__)("Transform", "elementor")
|
|
3790
|
+
},
|
|
3791
|
+
/* @__PURE__ */ React57.createElement(import_ui51.Tab, { label: (0, import_i18n24.__)("Move", "elementor"), ...getTabProps("transform-move") })
|
|
3792
|
+
)), /* @__PURE__ */ React57.createElement(import_ui51.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("transform-move") }, /* @__PURE__ */ React57.createElement(Move, null)))));
|
|
3793
|
+
};
|
|
3794
|
+
|
|
3795
|
+
// src/controls/transform-control/transform-icon.tsx
|
|
3796
|
+
var React58 = __toESM(require("react"));
|
|
3797
|
+
var import_icons20 = require("@elementor/icons");
|
|
3798
|
+
var TransformIcon = ({ value }) => {
|
|
3799
|
+
switch (value.$$type) {
|
|
3800
|
+
case "transform-move":
|
|
3801
|
+
return /* @__PURE__ */ React58.createElement(import_icons20.ArrowsMaximizeIcon, { fontSize: "tiny" });
|
|
3802
|
+
default:
|
|
3803
|
+
return null;
|
|
3804
|
+
}
|
|
3452
3805
|
};
|
|
3806
|
+
|
|
3807
|
+
// src/controls/transform-control/transform-label.tsx
|
|
3808
|
+
var React59 = __toESM(require("react"));
|
|
3809
|
+
var import_ui52 = require("@elementor/ui");
|
|
3810
|
+
var import_i18n25 = require("@wordpress/i18n");
|
|
3811
|
+
var transformMoveValue = (value) => Object.values(value).map((axis) => `${axis?.value.size}${axis?.value.unit}`).join(", ");
|
|
3812
|
+
var TransformLabel = (props) => {
|
|
3813
|
+
const { $$type, value } = props.value;
|
|
3814
|
+
switch ($$type) {
|
|
3815
|
+
case "transform-move":
|
|
3816
|
+
return /* @__PURE__ */ React59.createElement(Label2, { label: (0, import_i18n25.__)("Move", "elementor"), value: transformMoveValue(value) });
|
|
3817
|
+
default:
|
|
3818
|
+
return "";
|
|
3819
|
+
}
|
|
3820
|
+
};
|
|
3821
|
+
var Label2 = ({ label, value }) => {
|
|
3822
|
+
return /* @__PURE__ */ React59.createElement(import_ui52.Box, { component: "span" }, label, ": ", value);
|
|
3823
|
+
};
|
|
3824
|
+
|
|
3825
|
+
// src/controls/transform-control/transform-repeater-control.tsx
|
|
3826
|
+
var initialTransformValue = {
|
|
3827
|
+
$$type: "transform-move",
|
|
3828
|
+
value: {
|
|
3829
|
+
x: { $$type: "size", value: { size: 0, unit: "px" } },
|
|
3830
|
+
y: { $$type: "size", value: { size: 0, unit: "px" } },
|
|
3831
|
+
z: { $$type: "size", value: { size: 0, unit: "px" } }
|
|
3832
|
+
}
|
|
3833
|
+
};
|
|
3834
|
+
var TransformRepeaterControl = createControl(() => {
|
|
3835
|
+
const { propType, value: transformValues, setValue, disabled } = useBoundProp(import_editor_props32.transformPropTypeUtil);
|
|
3836
|
+
return /* @__PURE__ */ React60.createElement(PropProvider, { propType, value: transformValues, setValue }, /* @__PURE__ */ React60.createElement(
|
|
3837
|
+
Repeater,
|
|
3838
|
+
{
|
|
3839
|
+
openOnAdd: true,
|
|
3840
|
+
disabled,
|
|
3841
|
+
values: transformValues ?? [],
|
|
3842
|
+
setValues: setValue,
|
|
3843
|
+
label: (0, import_i18n26.__)("Transform", "elementor"),
|
|
3844
|
+
showDuplicate: false,
|
|
3845
|
+
itemSettings: {
|
|
3846
|
+
Icon: TransformIcon,
|
|
3847
|
+
Label: TransformLabel,
|
|
3848
|
+
Content: TransformContent,
|
|
3849
|
+
initialValues: initialTransformValue
|
|
3850
|
+
}
|
|
3851
|
+
}
|
|
3852
|
+
));
|
|
3853
|
+
});
|
|
3453
3854
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3454
3855
|
0 && (module.exports = {
|
|
3455
3856
|
AspectRatioControl,
|
|
@@ -3463,6 +3864,7 @@ var PositionControl = () => {
|
|
|
3463
3864
|
ControlReplacementsProvider,
|
|
3464
3865
|
ControlToggleButtonGroup,
|
|
3465
3866
|
EqualUnequalSizesControl,
|
|
3867
|
+
FilterRepeaterControl,
|
|
3466
3868
|
FontFamilyControl,
|
|
3467
3869
|
FontFamilySelector,
|
|
3468
3870
|
GapControl,
|
|
@@ -3471,6 +3873,7 @@ var PositionControl = () => {
|
|
|
3471
3873
|
LinkControl,
|
|
3472
3874
|
LinkedDimensionsControl,
|
|
3473
3875
|
NumberControl,
|
|
3876
|
+
PopoverContent,
|
|
3474
3877
|
PositionControl,
|
|
3475
3878
|
PropKeyProvider,
|
|
3476
3879
|
PropProvider,
|
|
@@ -3483,6 +3886,7 @@ var PositionControl = () => {
|
|
|
3483
3886
|
TextAreaControl,
|
|
3484
3887
|
TextControl,
|
|
3485
3888
|
ToggleControl,
|
|
3889
|
+
TransformRepeaterControl,
|
|
3486
3890
|
UrlControl,
|
|
3487
3891
|
createControlReplacementsRegistry,
|
|
3488
3892
|
injectIntoRepeaterItemIcon,
|