@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.mjs
CHANGED
|
@@ -31,7 +31,7 @@ var PropProvider = ({
|
|
|
31
31
|
setValue,
|
|
32
32
|
propType,
|
|
33
33
|
placeholder,
|
|
34
|
-
|
|
34
|
+
isDisabled
|
|
35
35
|
}) => {
|
|
36
36
|
return /* @__PURE__ */ React.createElement(
|
|
37
37
|
PropContext.Provider,
|
|
@@ -41,7 +41,7 @@ var PropProvider = ({
|
|
|
41
41
|
propType,
|
|
42
42
|
setValue,
|
|
43
43
|
placeholder,
|
|
44
|
-
|
|
44
|
+
isDisabled
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
children
|
|
@@ -131,8 +131,9 @@ import { useState } from "react";
|
|
|
131
131
|
function useBoundProp(propTypeUtil) {
|
|
132
132
|
const propKeyContext = usePropKeyContext();
|
|
133
133
|
const { isValid, validate, restoreValue } = useValidation(propKeyContext.propType);
|
|
134
|
+
const disabled = propKeyContext.isDisabled?.(propKeyContext.propType);
|
|
134
135
|
if (!propTypeUtil) {
|
|
135
|
-
return propKeyContext;
|
|
136
|
+
return { ...propKeyContext, disabled };
|
|
136
137
|
}
|
|
137
138
|
function setValue(value2, options, meta) {
|
|
138
139
|
if (!validate(value2)) {
|
|
@@ -152,7 +153,8 @@ function useBoundProp(propTypeUtil) {
|
|
|
152
153
|
setValue,
|
|
153
154
|
value: isValid ? value : null,
|
|
154
155
|
restoreValue,
|
|
155
|
-
placeholder
|
|
156
|
+
placeholder,
|
|
157
|
+
disabled
|
|
156
158
|
};
|
|
157
159
|
}
|
|
158
160
|
var useValidation = (propType) => {
|
|
@@ -364,9 +366,9 @@ var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
|
|
|
364
366
|
import * as React9 from "react";
|
|
365
367
|
import { stringPropTypeUtil } from "@elementor/editor-props";
|
|
366
368
|
import { MenuListItem } from "@elementor/editor-ui";
|
|
367
|
-
import { Select } from "@elementor/ui";
|
|
369
|
+
import { Select, Typography } from "@elementor/ui";
|
|
368
370
|
var SelectControl = createControl(({ options, onChange }) => {
|
|
369
|
-
const { value, setValue, disabled } = useBoundProp(stringPropTypeUtil);
|
|
371
|
+
const { value, setValue, disabled, placeholder } = useBoundProp(stringPropTypeUtil);
|
|
370
372
|
const handleChange = (event) => {
|
|
371
373
|
const newValue = event.target.value || null;
|
|
372
374
|
onChange?.(newValue, value);
|
|
@@ -378,6 +380,19 @@ var SelectControl = createControl(({ options, onChange }) => {
|
|
|
378
380
|
sx: { overflow: "hidden" },
|
|
379
381
|
displayEmpty: true,
|
|
380
382
|
size: "tiny",
|
|
383
|
+
renderValue: (selectedValue) => {
|
|
384
|
+
const findOptionByValue = (searchValue) => options.find((opt) => opt.value === searchValue);
|
|
385
|
+
if (!selectedValue || selectedValue === "") {
|
|
386
|
+
if (placeholder) {
|
|
387
|
+
const placeholderOption = findOptionByValue(placeholder);
|
|
388
|
+
const displayText = placeholderOption?.label || placeholder;
|
|
389
|
+
return /* @__PURE__ */ React9.createElement(Typography, { component: "span", variant: "caption", color: "text.tertiary" }, displayText);
|
|
390
|
+
}
|
|
391
|
+
return "";
|
|
392
|
+
}
|
|
393
|
+
const option = findOptionByValue(selectedValue);
|
|
394
|
+
return option?.label || selectedValue;
|
|
395
|
+
},
|
|
381
396
|
value: value ?? "",
|
|
382
397
|
onChange: handleChange,
|
|
383
398
|
disabled,
|
|
@@ -388,14 +403,30 @@ var SelectControl = createControl(({ options, onChange }) => {
|
|
|
388
403
|
});
|
|
389
404
|
|
|
390
405
|
// src/controls/image-control.tsx
|
|
391
|
-
var ImageControl = createControl(
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
406
|
+
var ImageControl = createControl(({ sizes, showMode = "all" }) => {
|
|
407
|
+
const propContext = useBoundProp(imagePropTypeUtil);
|
|
408
|
+
let componentToRender;
|
|
409
|
+
switch (showMode) {
|
|
410
|
+
case "media":
|
|
411
|
+
componentToRender = /* @__PURE__ */ React10.createElement(ImageSrcControl, null);
|
|
412
|
+
break;
|
|
413
|
+
case "sizes":
|
|
414
|
+
componentToRender = /* @__PURE__ */ React10.createElement(ImageSizeControl, { sizes });
|
|
415
|
+
break;
|
|
416
|
+
case "all":
|
|
417
|
+
default:
|
|
418
|
+
componentToRender = /* @__PURE__ */ React10.createElement(Stack2, { gap: 1.5 }, /* @__PURE__ */ React10.createElement(ControlFormLabel, null, __2("Image", "elementor")), /* @__PURE__ */ React10.createElement(ImageSrcControl, null), /* @__PURE__ */ React10.createElement(Grid, { container: true, gap: 1.5, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React10.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React10.createElement(ControlFormLabel, null, __2("Resolution", "elementor"))), /* @__PURE__ */ React10.createElement(Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React10.createElement(ImageSizeControl, { sizes }))));
|
|
397
419
|
}
|
|
398
|
-
);
|
|
420
|
+
return /* @__PURE__ */ React10.createElement(PropProvider, { ...propContext }, componentToRender);
|
|
421
|
+
});
|
|
422
|
+
var ImageSrcControl = () => {
|
|
423
|
+
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
424
|
+
const mediaTypes = allowSvgUpload ? ["image", "svg"] : ["image"];
|
|
425
|
+
return /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React10.createElement(ImageMediaControl, { mediaTypes }));
|
|
426
|
+
};
|
|
427
|
+
var ImageSizeControl = ({ sizes }) => {
|
|
428
|
+
return /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React10.createElement(SelectControl, { options: sizes }));
|
|
429
|
+
};
|
|
399
430
|
|
|
400
431
|
// src/controls/text-control.tsx
|
|
401
432
|
import * as React11 from "react";
|
|
@@ -626,13 +657,22 @@ var SizeInput = ({
|
|
|
626
657
|
|
|
627
658
|
// src/components/text-field-popover.tsx
|
|
628
659
|
import * as React15 from "react";
|
|
629
|
-
import { bindPopover,
|
|
660
|
+
import { bindPopover, Popover, TextField as TextField4 } from "@elementor/ui";
|
|
630
661
|
var TextFieldPopover = (props) => {
|
|
631
662
|
const { popupState, restoreValue, anchorRef, value, onChange } = props;
|
|
632
663
|
return /* @__PURE__ */ React15.createElement(
|
|
633
664
|
Popover,
|
|
634
665
|
{
|
|
635
666
|
disablePortal: true,
|
|
667
|
+
slotProps: {
|
|
668
|
+
paper: {
|
|
669
|
+
sx: {
|
|
670
|
+
borderRadius: 2,
|
|
671
|
+
width: anchorRef.current?.offsetWidth + "px",
|
|
672
|
+
p: 1.5
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
},
|
|
636
676
|
...bindPopover(popupState),
|
|
637
677
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
638
678
|
transformOrigin: { vertical: "top", horizontal: "center" },
|
|
@@ -642,27 +682,17 @@ var TextFieldPopover = (props) => {
|
|
|
642
682
|
}
|
|
643
683
|
},
|
|
644
684
|
/* @__PURE__ */ React15.createElement(
|
|
645
|
-
|
|
685
|
+
TextField4,
|
|
646
686
|
{
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
TextField4,
|
|
655
|
-
{
|
|
656
|
-
value,
|
|
657
|
-
onChange,
|
|
658
|
-
size: "tiny",
|
|
659
|
-
type: "text",
|
|
660
|
-
fullWidth: true,
|
|
661
|
-
inputProps: {
|
|
662
|
-
autoFocus: true
|
|
663
|
-
}
|
|
687
|
+
value,
|
|
688
|
+
onChange,
|
|
689
|
+
size: "tiny",
|
|
690
|
+
type: "text",
|
|
691
|
+
fullWidth: true,
|
|
692
|
+
inputProps: {
|
|
693
|
+
autoFocus: true
|
|
664
694
|
}
|
|
665
|
-
|
|
695
|
+
}
|
|
666
696
|
)
|
|
667
697
|
);
|
|
668
698
|
};
|
|
@@ -917,7 +947,7 @@ var ColorControl = createControl(
|
|
|
917
947
|
var units = ["px", "em", "rem"];
|
|
918
948
|
var StrokeControl = createControl(() => {
|
|
919
949
|
const propContext = useBoundProp(strokePropTypeUtil);
|
|
920
|
-
const rowRef = useRef2();
|
|
950
|
+
const rowRef = useRef2(null);
|
|
921
951
|
return /* @__PURE__ */ React19.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React19.createElement(SectionContent, null, /* @__PURE__ */ React19.createElement(Control, { bind: "width", label: __3("Stroke width", "elementor"), ref: rowRef }, /* @__PURE__ */ React19.createElement(SizeControl, { units, anchorRef: rowRef })), /* @__PURE__ */ React19.createElement(Control, { bind: "color", label: __3("Stroke color", "elementor") }, /* @__PURE__ */ React19.createElement(ColorControl, null))));
|
|
922
952
|
});
|
|
923
953
|
var Control = forwardRef2(({ bind, label, children }, ref) => /* @__PURE__ */ React19.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React19.createElement(Grid2, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref }, /* @__PURE__ */ React19.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React19.createElement(Grid2, { item: true, xs: 6 }, children))));
|
|
@@ -932,7 +962,7 @@ import { __ as __5 } from "@wordpress/i18n";
|
|
|
932
962
|
// src/components/popover-content.tsx
|
|
933
963
|
import * as React20 from "react";
|
|
934
964
|
import { Stack as Stack4 } from "@elementor/ui";
|
|
935
|
-
var PopoverContent = ({
|
|
965
|
+
var PopoverContent = ({ gap = 1.5, children, ...props }) => /* @__PURE__ */ React20.createElement(Stack4, { ...props, gap }, children);
|
|
936
966
|
|
|
937
967
|
// src/components/popover-grid-container.tsx
|
|
938
968
|
import { forwardRef as forwardRef3 } from "react";
|
|
@@ -954,7 +984,7 @@ import {
|
|
|
954
984
|
Popover as Popover2,
|
|
955
985
|
Stack as Stack5,
|
|
956
986
|
Tooltip,
|
|
957
|
-
Typography,
|
|
987
|
+
Typography as Typography2,
|
|
958
988
|
UnstableTag,
|
|
959
989
|
usePopupState as usePopupState3
|
|
960
990
|
} from "@elementor/ui";
|
|
@@ -1079,7 +1109,8 @@ var Repeater = ({
|
|
|
1079
1109
|
values: repeaterValues = [],
|
|
1080
1110
|
setValues: setRepeaterValues,
|
|
1081
1111
|
showDuplicate = true,
|
|
1082
|
-
showToggle = true
|
|
1112
|
+
showToggle = true,
|
|
1113
|
+
isSortable = true
|
|
1083
1114
|
}) => {
|
|
1084
1115
|
const [openItem, setOpenItem] = useState4(EMPTY_OPEN_ITEM);
|
|
1085
1116
|
const [items, setItems] = useSyncExternalState({
|
|
@@ -1154,7 +1185,7 @@ var Repeater = ({
|
|
|
1154
1185
|
gap: 1,
|
|
1155
1186
|
sx: { marginInlineEnd: -0.75 }
|
|
1156
1187
|
},
|
|
1157
|
-
/* @__PURE__ */ React25.createElement(
|
|
1188
|
+
/* @__PURE__ */ React25.createElement(Typography2, { component: "label", variant: "caption", color: "text.secondary" }, label),
|
|
1158
1189
|
/* @__PURE__ */ React25.createElement(ControlAdornments, null),
|
|
1159
1190
|
/* @__PURE__ */ React25.createElement(
|
|
1160
1191
|
IconButton,
|
|
@@ -1172,7 +1203,7 @@ var Repeater = ({
|
|
|
1172
1203
|
if (!value) {
|
|
1173
1204
|
return null;
|
|
1174
1205
|
}
|
|
1175
|
-
return /* @__PURE__ */ React25.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled }, /* @__PURE__ */ React25.createElement(
|
|
1206
|
+
return /* @__PURE__ */ React25.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React25.createElement(
|
|
1176
1207
|
RepeaterItem,
|
|
1177
1208
|
{
|
|
1178
1209
|
disabled,
|
|
@@ -1262,7 +1293,7 @@ var usePopover = (openOnMount, onOpen) => {
|
|
|
1262
1293
|
// src/controls/box-shadow-repeater-control.tsx
|
|
1263
1294
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
1264
1295
|
const { propType, value, setValue, disabled } = useBoundProp(boxShadowPropTypeUtil);
|
|
1265
|
-
return /* @__PURE__ */ React26.createElement(PropProvider, { propType, value, setValue, disabled }, /* @__PURE__ */ React26.createElement(
|
|
1296
|
+
return /* @__PURE__ */ React26.createElement(PropProvider, { propType, value, setValue, isDisabled: () => disabled }, /* @__PURE__ */ React26.createElement(
|
|
1266
1297
|
Repeater,
|
|
1267
1298
|
{
|
|
1268
1299
|
openOnAdd: true,
|
|
@@ -1285,7 +1316,7 @@ var ItemContent = ({ anchorEl, bind }) => {
|
|
|
1285
1316
|
};
|
|
1286
1317
|
var Content = ({ anchorEl }) => {
|
|
1287
1318
|
const context = useBoundProp(shadowPropTypeUtil);
|
|
1288
|
-
const rowRef = [useRef3(), useRef3()];
|
|
1319
|
+
const rowRef = [useRef3(null), useRef3(null)];
|
|
1289
1320
|
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: __5("Color", "elementor") }, /* @__PURE__ */ React26.createElement(ColorControl, { anchorEl })), /* @__PURE__ */ React26.createElement(Control2, { bind: "position", label: __5("Position", "elementor"), sx: { overflow: "hidden" } }, /* @__PURE__ */ React26.createElement(
|
|
1290
1321
|
SelectControl,
|
|
1291
1322
|
{
|
|
@@ -1344,13 +1375,126 @@ var initialShadow = {
|
|
|
1344
1375
|
}
|
|
1345
1376
|
};
|
|
1346
1377
|
|
|
1378
|
+
// src/controls/filter-repeater-control.tsx
|
|
1379
|
+
import * as React28 from "react";
|
|
1380
|
+
import { useRef as useRef4 } from "react";
|
|
1381
|
+
import {
|
|
1382
|
+
blurFilterPropTypeUtil,
|
|
1383
|
+
brightnessFilterPropTypeUtil,
|
|
1384
|
+
filterPropTypeUtil
|
|
1385
|
+
} from "@elementor/editor-props";
|
|
1386
|
+
import { MenuListItem as MenuListItem3 } from "@elementor/editor-ui";
|
|
1387
|
+
import { Box as Box3, Grid as Grid5, Select as Select2 } from "@elementor/ui";
|
|
1388
|
+
import { __ as __6 } from "@wordpress/i18n";
|
|
1389
|
+
|
|
1390
|
+
// src/components/control-label.tsx
|
|
1391
|
+
import * as React27 from "react";
|
|
1392
|
+
import { Stack as Stack6 } from "@elementor/ui";
|
|
1393
|
+
var ControlLabel = ({ children }) => {
|
|
1394
|
+
return /* @__PURE__ */ React27.createElement(Stack6, { direction: "row", alignItems: "center", justifyItems: "start", gap: 0.25 }, /* @__PURE__ */ React27.createElement(ControlFormLabel, null, children), /* @__PURE__ */ React27.createElement(ControlAdornments, null));
|
|
1395
|
+
};
|
|
1396
|
+
|
|
1397
|
+
// src/controls/filter-repeater-control.tsx
|
|
1398
|
+
var DEFAULT_FILTER_KEY = "blur";
|
|
1399
|
+
var filterConfig = {
|
|
1400
|
+
blur: {
|
|
1401
|
+
defaultValue: { $$type: "radius", radius: { $$type: "size", value: { size: 0, unit: "px" } } },
|
|
1402
|
+
name: __6("Blur", "elementor"),
|
|
1403
|
+
valueName: __6("Radius", "elementor"),
|
|
1404
|
+
propType: blurFilterPropTypeUtil,
|
|
1405
|
+
units: defaultUnits.filter((unit) => unit !== "%")
|
|
1406
|
+
},
|
|
1407
|
+
brightness: {
|
|
1408
|
+
defaultValue: { $$type: "amount", amount: { $$type: "size", value: { size: 100, unit: "%" } } },
|
|
1409
|
+
name: __6("Brightness", "elementor"),
|
|
1410
|
+
valueName: __6("Amount", "elementor"),
|
|
1411
|
+
propType: brightnessFilterPropTypeUtil,
|
|
1412
|
+
units: ["%"]
|
|
1413
|
+
}
|
|
1414
|
+
};
|
|
1415
|
+
var filterKeys = Object.keys(filterConfig);
|
|
1416
|
+
var singleSizeFilterNames = filterKeys.filter((name) => {
|
|
1417
|
+
const filter = filterConfig[name].defaultValue;
|
|
1418
|
+
return filter[filter.$$type].$$type === "size";
|
|
1419
|
+
});
|
|
1420
|
+
var FilterRepeaterControl = createControl(() => {
|
|
1421
|
+
const { propType, value: filterValues, setValue, disabled } = useBoundProp(filterPropTypeUtil);
|
|
1422
|
+
return /* @__PURE__ */ React28.createElement(PropProvider, { propType, value: filterValues, setValue }, /* @__PURE__ */ React28.createElement(
|
|
1423
|
+
Repeater,
|
|
1424
|
+
{
|
|
1425
|
+
openOnAdd: true,
|
|
1426
|
+
disabled,
|
|
1427
|
+
values: filterValues ?? [],
|
|
1428
|
+
setValues: setValue,
|
|
1429
|
+
label: __6("Filter", "elementor"),
|
|
1430
|
+
itemSettings: {
|
|
1431
|
+
Icon: ItemIcon2,
|
|
1432
|
+
Label: ItemLabel2,
|
|
1433
|
+
Content: ItemContent2,
|
|
1434
|
+
initialValues: {
|
|
1435
|
+
$$type: DEFAULT_FILTER_KEY,
|
|
1436
|
+
value: filterConfig[DEFAULT_FILTER_KEY].defaultValue
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
));
|
|
1441
|
+
});
|
|
1442
|
+
var ItemIcon2 = () => /* @__PURE__ */ React28.createElement(React28.Fragment, null);
|
|
1443
|
+
var ItemLabel2 = (props) => {
|
|
1444
|
+
const { $$type } = props.value;
|
|
1445
|
+
return singleSizeFilterNames.includes($$type) && /* @__PURE__ */ React28.createElement(SingleSizeItemLabel, { value: props.value });
|
|
1446
|
+
};
|
|
1447
|
+
var SingleSizeItemLabel = ({ value }) => {
|
|
1448
|
+
const { $$type, value: sizeValue } = value;
|
|
1449
|
+
const { $$type: key } = filterConfig[$$type].defaultValue;
|
|
1450
|
+
const defaultUnit = filterConfig[$$type].defaultValue[key].value.unit;
|
|
1451
|
+
const { unit, size } = sizeValue[key]?.value ?? { unit: defaultUnit, size: 0 };
|
|
1452
|
+
const label = /* @__PURE__ */ React28.createElement(Box3, { component: "span", style: { textTransform: "capitalize" } }, value.$$type, ":");
|
|
1453
|
+
return /* @__PURE__ */ React28.createElement(Box3, { component: "span" }, label, unit !== "custom" ? ` ${size ?? 0}${unit ?? defaultUnit}` : size);
|
|
1454
|
+
};
|
|
1455
|
+
var ItemContent2 = ({ bind }) => {
|
|
1456
|
+
const { value: filterValues, setValue } = useBoundProp(filterPropTypeUtil);
|
|
1457
|
+
const itemIndex = parseInt(bind, 10);
|
|
1458
|
+
const item = filterValues?.[itemIndex];
|
|
1459
|
+
const handleChange = (e) => {
|
|
1460
|
+
const newFilterValues = [...filterValues];
|
|
1461
|
+
const filterType = e.target.value;
|
|
1462
|
+
newFilterValues[itemIndex] = {
|
|
1463
|
+
$$type: filterType,
|
|
1464
|
+
value: filterConfig[filterType].defaultValue
|
|
1465
|
+
};
|
|
1466
|
+
setValue(newFilterValues);
|
|
1467
|
+
};
|
|
1468
|
+
return /* @__PURE__ */ React28.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React28.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React28.createElement(PopoverGridContainer, null, /* @__PURE__ */ React28.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(ControlLabel, null, __6("Filter", "elementor"))), /* @__PURE__ */ React28.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(
|
|
1469
|
+
Select2,
|
|
1470
|
+
{
|
|
1471
|
+
sx: { overflow: "hidden" },
|
|
1472
|
+
size: "tiny",
|
|
1473
|
+
value: item?.$$type ?? DEFAULT_FILTER_KEY,
|
|
1474
|
+
onChange: handleChange,
|
|
1475
|
+
fullWidth: true
|
|
1476
|
+
},
|
|
1477
|
+
filterKeys.map((filterKey) => /* @__PURE__ */ React28.createElement(MenuListItem3, { key: filterKey, value: filterKey }, filterConfig[filterKey].name))
|
|
1478
|
+
))), /* @__PURE__ */ React28.createElement(Content2, { filterType: item?.$$type })));
|
|
1479
|
+
};
|
|
1480
|
+
var Content2 = ({ filterType }) => {
|
|
1481
|
+
return singleSizeFilterNames.includes(filterType) && /* @__PURE__ */ React28.createElement(SingleSizeItemContent, { filterType });
|
|
1482
|
+
};
|
|
1483
|
+
var SingleSizeItemContent = ({ filterType }) => {
|
|
1484
|
+
const { propType, valueName, defaultValue, units: units2 } = filterConfig[filterType];
|
|
1485
|
+
const { $$type } = defaultValue;
|
|
1486
|
+
const context = useBoundProp(propType);
|
|
1487
|
+
const rowRef = useRef4(null);
|
|
1488
|
+
return /* @__PURE__ */ React28.createElement(PropProvider, { ...context }, /* @__PURE__ */ React28.createElement(PropKeyProvider, { bind: $$type }, /* @__PURE__ */ React28.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React28.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(ControlLabel, null, valueName)), /* @__PURE__ */ React28.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(SizeControl, { anchorRef: rowRef, units: units2 })))));
|
|
1489
|
+
};
|
|
1490
|
+
|
|
1347
1491
|
// src/controls/toggle-control.tsx
|
|
1348
|
-
import * as
|
|
1492
|
+
import * as React31 from "react";
|
|
1349
1493
|
import { stringPropTypeUtil as stringPropTypeUtil4 } from "@elementor/editor-props";
|
|
1350
1494
|
|
|
1351
1495
|
// src/components/control-toggle-button-group.tsx
|
|
1352
|
-
import * as
|
|
1353
|
-
import { useEffect as useEffect4, useMemo as useMemo2, useRef as
|
|
1496
|
+
import * as React30 from "react";
|
|
1497
|
+
import { useEffect as useEffect4, useMemo as useMemo2, useRef as useRef5, useState as useState5 } from "react";
|
|
1354
1498
|
import { ChevronDownIcon } from "@elementor/icons";
|
|
1355
1499
|
import {
|
|
1356
1500
|
ListItemText,
|
|
@@ -1359,19 +1503,19 @@ import {
|
|
|
1359
1503
|
styled as styled3,
|
|
1360
1504
|
ToggleButton,
|
|
1361
1505
|
ToggleButtonGroup,
|
|
1362
|
-
Typography as
|
|
1506
|
+
Typography as Typography3,
|
|
1363
1507
|
useTheme
|
|
1364
1508
|
} from "@elementor/ui";
|
|
1365
1509
|
|
|
1366
1510
|
// src/components/conditional-tooltip.tsx
|
|
1367
|
-
import * as
|
|
1511
|
+
import * as React29 from "react";
|
|
1368
1512
|
import { Tooltip as Tooltip2 } from "@elementor/ui";
|
|
1369
1513
|
var ConditionalTooltip = ({
|
|
1370
1514
|
showTooltip,
|
|
1371
1515
|
children,
|
|
1372
1516
|
label
|
|
1373
1517
|
}) => {
|
|
1374
|
-
return showTooltip && label ? /* @__PURE__ */
|
|
1518
|
+
return showTooltip && label ? /* @__PURE__ */ React29.createElement(Tooltip2, { title: label, disableFocusListener: true, placement: "top" }, children) : children;
|
|
1375
1519
|
};
|
|
1376
1520
|
|
|
1377
1521
|
// src/components/control-toggle-button-group.tsx
|
|
@@ -1414,7 +1558,7 @@ var ControlToggleButtonGroup = ({
|
|
|
1414
1558
|
const templateColumnsSuffix = isOffLimits ? "auto" : "";
|
|
1415
1559
|
return `repeat(${itemsCount}, minmax(0, 25%)) ${templateColumnsSuffix}`;
|
|
1416
1560
|
}, [menuItems?.length, fixedItems.length]);
|
|
1417
|
-
return /* @__PURE__ */
|
|
1561
|
+
return /* @__PURE__ */ React30.createElement(ControlActions, null, /* @__PURE__ */ React30.createElement(
|
|
1418
1562
|
StyledToggleButtonGroup,
|
|
1419
1563
|
{
|
|
1420
1564
|
justify,
|
|
@@ -1429,16 +1573,16 @@ var ControlToggleButtonGroup = ({
|
|
|
1429
1573
|
width: `100%`
|
|
1430
1574
|
}
|
|
1431
1575
|
},
|
|
1432
|
-
fixedItems.map(({ label, value: buttonValue, renderContent:
|
|
1576
|
+
fixedItems.map(({ label, value: buttonValue, renderContent: Content5, showTooltip }) => /* @__PURE__ */ React30.createElement(
|
|
1433
1577
|
ConditionalTooltip,
|
|
1434
1578
|
{
|
|
1435
1579
|
key: buttonValue,
|
|
1436
1580
|
label,
|
|
1437
1581
|
showTooltip: showTooltip || false
|
|
1438
1582
|
},
|
|
1439
|
-
/* @__PURE__ */
|
|
1583
|
+
/* @__PURE__ */ React30.createElement(ToggleButton, { value: buttonValue, "aria-label": label, size, fullWidth }, /* @__PURE__ */ React30.createElement(Content5, { size }))
|
|
1440
1584
|
)),
|
|
1441
|
-
menuItems.length && exclusive && /* @__PURE__ */
|
|
1585
|
+
menuItems.length && exclusive && /* @__PURE__ */ React30.createElement(
|
|
1442
1586
|
SplitButtonGroup,
|
|
1443
1587
|
{
|
|
1444
1588
|
size,
|
|
@@ -1459,7 +1603,7 @@ var SplitButtonGroup = ({
|
|
|
1459
1603
|
}) => {
|
|
1460
1604
|
const previewButton = usePreviewButton(items, value);
|
|
1461
1605
|
const [isMenuOpen, setIsMenuOpen] = useState5(false);
|
|
1462
|
-
const menuButtonRef =
|
|
1606
|
+
const menuButtonRef = useRef5(null);
|
|
1463
1607
|
const onMenuToggle = (ev) => {
|
|
1464
1608
|
setIsMenuOpen((prev) => !prev);
|
|
1465
1609
|
ev.preventDefault();
|
|
@@ -1472,7 +1616,7 @@ var SplitButtonGroup = ({
|
|
|
1472
1616
|
const shouldRemove = newValue === value;
|
|
1473
1617
|
onChange(shouldRemove ? null : newValue);
|
|
1474
1618
|
};
|
|
1475
|
-
return /* @__PURE__ */
|
|
1619
|
+
return /* @__PURE__ */ React30.createElement(React30.Fragment, null, /* @__PURE__ */ React30.createElement(
|
|
1476
1620
|
ToggleButton,
|
|
1477
1621
|
{
|
|
1478
1622
|
value: previewButton.value,
|
|
@@ -1486,7 +1630,7 @@ var SplitButtonGroup = ({
|
|
|
1486
1630
|
ref: menuButtonRef
|
|
1487
1631
|
},
|
|
1488
1632
|
previewButton.renderContent({ size })
|
|
1489
|
-
), /* @__PURE__ */
|
|
1633
|
+
), /* @__PURE__ */ React30.createElement(
|
|
1490
1634
|
ToggleButton,
|
|
1491
1635
|
{
|
|
1492
1636
|
size,
|
|
@@ -1497,8 +1641,8 @@ var SplitButtonGroup = ({
|
|
|
1497
1641
|
ref: menuButtonRef,
|
|
1498
1642
|
value: "__chevron-icon-button__"
|
|
1499
1643
|
},
|
|
1500
|
-
/* @__PURE__ */
|
|
1501
|
-
), /* @__PURE__ */
|
|
1644
|
+
/* @__PURE__ */ React30.createElement(ChevronDownIcon, { fontSize: size })
|
|
1645
|
+
), /* @__PURE__ */ React30.createElement(
|
|
1502
1646
|
Menu2,
|
|
1503
1647
|
{
|
|
1504
1648
|
open: isMenuOpen,
|
|
@@ -1516,14 +1660,14 @@ var SplitButtonGroup = ({
|
|
|
1516
1660
|
mt: 0.5
|
|
1517
1661
|
}
|
|
1518
1662
|
},
|
|
1519
|
-
items.map(({ label, value: buttonValue }) => /* @__PURE__ */
|
|
1663
|
+
items.map(({ label, value: buttonValue }) => /* @__PURE__ */ React30.createElement(
|
|
1520
1664
|
MenuItem,
|
|
1521
1665
|
{
|
|
1522
1666
|
key: buttonValue,
|
|
1523
1667
|
selected: buttonValue === value,
|
|
1524
1668
|
onClick: () => onMenuItemClick(buttonValue)
|
|
1525
1669
|
},
|
|
1526
|
-
/* @__PURE__ */
|
|
1670
|
+
/* @__PURE__ */ React30.createElement(ListItemText, null, /* @__PURE__ */ React30.createElement(Typography3, { sx: { fontSize: "14px" } }, label))
|
|
1527
1671
|
))
|
|
1528
1672
|
));
|
|
1529
1673
|
};
|
|
@@ -1563,7 +1707,7 @@ var ToggleControl = createControl(
|
|
|
1563
1707
|
fullWidth,
|
|
1564
1708
|
size
|
|
1565
1709
|
};
|
|
1566
|
-
return exclusive ? /* @__PURE__ */
|
|
1710
|
+
return exclusive ? /* @__PURE__ */ React31.createElement(
|
|
1567
1711
|
ControlToggleButtonGroup,
|
|
1568
1712
|
{
|
|
1569
1713
|
...toggleButtonGroupProps,
|
|
@@ -1572,7 +1716,7 @@ var ToggleControl = createControl(
|
|
|
1572
1716
|
disabled,
|
|
1573
1717
|
exclusive: true
|
|
1574
1718
|
}
|
|
1575
|
-
) : /* @__PURE__ */
|
|
1719
|
+
) : /* @__PURE__ */ React31.createElement(
|
|
1576
1720
|
ControlToggleButtonGroup,
|
|
1577
1721
|
{
|
|
1578
1722
|
...toggleButtonGroupProps,
|
|
@@ -1586,20 +1730,20 @@ var ToggleControl = createControl(
|
|
|
1586
1730
|
);
|
|
1587
1731
|
|
|
1588
1732
|
// src/controls/number-control.tsx
|
|
1589
|
-
import * as
|
|
1733
|
+
import * as React32 from "react";
|
|
1590
1734
|
import { numberPropTypeUtil } from "@elementor/editor-props";
|
|
1591
1735
|
import { TextField as TextField5 } from "@elementor/ui";
|
|
1592
1736
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
1593
1737
|
var RESTRICTED_INPUT_KEYS2 = ["e", "E", "+", "-"];
|
|
1594
1738
|
var NumberControl = createControl(
|
|
1595
1739
|
({
|
|
1596
|
-
placeholder,
|
|
1740
|
+
placeholder: labelPlaceholder,
|
|
1597
1741
|
max = Number.MAX_VALUE,
|
|
1598
1742
|
min = -Number.MAX_VALUE,
|
|
1599
1743
|
step = 1,
|
|
1600
1744
|
shouldForceInt = false
|
|
1601
1745
|
}) => {
|
|
1602
|
-
const { value, setValue, disabled } = useBoundProp(numberPropTypeUtil);
|
|
1746
|
+
const { value, setValue, placeholder, disabled } = useBoundProp(numberPropTypeUtil);
|
|
1603
1747
|
const handleChange = (event) => {
|
|
1604
1748
|
const eventValue = event.target.value;
|
|
1605
1749
|
if (isEmptyOrNaN(eventValue)) {
|
|
@@ -1609,7 +1753,7 @@ var NumberControl = createControl(
|
|
|
1609
1753
|
const formattedValue = shouldForceInt ? +parseInt(eventValue) : Number(eventValue);
|
|
1610
1754
|
setValue(Math.min(Math.max(formattedValue, min), max));
|
|
1611
1755
|
};
|
|
1612
|
-
return /* @__PURE__ */
|
|
1756
|
+
return /* @__PURE__ */ React32.createElement(ControlActions, null, /* @__PURE__ */ React32.createElement(
|
|
1613
1757
|
TextField5,
|
|
1614
1758
|
{
|
|
1615
1759
|
size: "tiny",
|
|
@@ -1618,7 +1762,7 @@ var NumberControl = createControl(
|
|
|
1618
1762
|
disabled,
|
|
1619
1763
|
value: isEmptyOrNaN(value) ? "" : value,
|
|
1620
1764
|
onChange: handleChange,
|
|
1621
|
-
placeholder,
|
|
1765
|
+
placeholder: labelPlaceholder ?? (placeholder ? String(placeholder) : ""),
|
|
1622
1766
|
inputProps: { step },
|
|
1623
1767
|
onKeyDown: (event) => {
|
|
1624
1768
|
if (RESTRICTED_INPUT_KEYS2.includes(event.key)) {
|
|
@@ -1631,21 +1775,12 @@ var NumberControl = createControl(
|
|
|
1631
1775
|
);
|
|
1632
1776
|
|
|
1633
1777
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
1634
|
-
import * as
|
|
1635
|
-
import { useId as useId2, useRef as
|
|
1778
|
+
import * as React33 from "react";
|
|
1779
|
+
import { useId as useId2, useRef as useRef6 } from "react";
|
|
1636
1780
|
import { sizePropTypeUtil as sizePropTypeUtil2 } from "@elementor/editor-props";
|
|
1637
1781
|
import { isExperimentActive as isExperimentActive2 } from "@elementor/editor-v1-adapters";
|
|
1638
|
-
import { bindPopover as bindPopover3, bindToggle, Grid as
|
|
1639
|
-
import { __ as
|
|
1640
|
-
|
|
1641
|
-
// src/components/control-label.tsx
|
|
1642
|
-
import * as React31 from "react";
|
|
1643
|
-
import { Stack as Stack6 } from "@elementor/ui";
|
|
1644
|
-
var ControlLabel = ({ children }) => {
|
|
1645
|
-
return /* @__PURE__ */ React31.createElement(Stack6, { direction: "row", alignItems: "center", justifyItems: "start", gap: 0.25 }, /* @__PURE__ */ React31.createElement(ControlFormLabel, null, children), /* @__PURE__ */ React31.createElement(ControlAdornments, null));
|
|
1646
|
-
};
|
|
1647
|
-
|
|
1648
|
-
// src/controls/equal-unequal-sizes-control.tsx
|
|
1782
|
+
import { bindPopover as bindPopover3, bindToggle, Grid as Grid6, Popover as Popover3, Stack as Stack7, ToggleButton as ToggleButton2, Tooltip as Tooltip3, usePopupState as usePopupState4 } from "@elementor/ui";
|
|
1783
|
+
import { __ as __7 } from "@wordpress/i18n";
|
|
1649
1784
|
var isEqualSizes = (propValue, items) => {
|
|
1650
1785
|
const values = Object.values(propValue);
|
|
1651
1786
|
if (values.length !== items.length) {
|
|
@@ -1672,7 +1807,7 @@ function EqualUnequalSizesControl({
|
|
|
1672
1807
|
disabled: multiSizeDisabled
|
|
1673
1808
|
} = useBoundProp(multiSizePropTypeUtil);
|
|
1674
1809
|
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(sizePropTypeUtil2);
|
|
1675
|
-
const rowRefs = [
|
|
1810
|
+
const rowRefs = [useRef6(null), useRef6(null)];
|
|
1676
1811
|
const splitEqualValue = () => {
|
|
1677
1812
|
if (!sizeValue) {
|
|
1678
1813
|
return null;
|
|
@@ -1701,13 +1836,13 @@ function EqualUnequalSizesControl({
|
|
|
1701
1836
|
};
|
|
1702
1837
|
const isShowingGeneralIndicator = !isExperimentActive2("e_v_3_30") || !popupState.isOpen;
|
|
1703
1838
|
const isMixed = !!multiSizeValue;
|
|
1704
|
-
return /* @__PURE__ */
|
|
1839
|
+
return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(Grid6, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: rowRefs[0] }, /* @__PURE__ */ React33.createElement(Grid6, { item: true, xs: 6 }, !isShowingGeneralIndicator ? /* @__PURE__ */ React33.createElement(ControlFormLabel, null, label) : /* @__PURE__ */ React33.createElement(ControlLabel, null, label)), /* @__PURE__ */ React33.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(Stack7, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React33.createElement(
|
|
1705
1840
|
SizeControl,
|
|
1706
1841
|
{
|
|
1707
|
-
placeholder: isMixed ?
|
|
1842
|
+
placeholder: isMixed ? __7("Mixed", "elementor") : void 0,
|
|
1708
1843
|
anchorRef: rowRefs[0]
|
|
1709
1844
|
}
|
|
1710
|
-
), /* @__PURE__ */
|
|
1845
|
+
), /* @__PURE__ */ React33.createElement(Tooltip3, { title: tooltipLabel, placement: "top" }, /* @__PURE__ */ React33.createElement(
|
|
1711
1846
|
ToggleButton2,
|
|
1712
1847
|
{
|
|
1713
1848
|
size: "tiny",
|
|
@@ -1718,7 +1853,7 @@ function EqualUnequalSizesControl({
|
|
|
1718
1853
|
"aria-label": tooltipLabel
|
|
1719
1854
|
},
|
|
1720
1855
|
icon
|
|
1721
|
-
))))), /* @__PURE__ */
|
|
1856
|
+
))))), /* @__PURE__ */ React33.createElement(
|
|
1722
1857
|
Popover3,
|
|
1723
1858
|
{
|
|
1724
1859
|
disablePortal: true,
|
|
@@ -1736,34 +1871,31 @@ function EqualUnequalSizesControl({
|
|
|
1736
1871
|
paper: { sx: { mt: 0.5, width: rowRefs[0].current?.getBoundingClientRect().width } }
|
|
1737
1872
|
}
|
|
1738
1873
|
},
|
|
1739
|
-
/* @__PURE__ */
|
|
1874
|
+
/* @__PURE__ */ React33.createElement(
|
|
1740
1875
|
PropProvider,
|
|
1741
1876
|
{
|
|
1742
1877
|
propType: multiSizePropType,
|
|
1743
1878
|
value: getMultiSizeValues(),
|
|
1744
1879
|
setValue: setNestedProp,
|
|
1745
|
-
|
|
1880
|
+
isDisabled: () => multiSizeDisabled
|
|
1746
1881
|
},
|
|
1747
|
-
/* @__PURE__ */
|
|
1882
|
+
/* @__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] })))
|
|
1748
1883
|
)
|
|
1749
1884
|
));
|
|
1750
1885
|
}
|
|
1751
|
-
var MultiSizeValueControl = ({
|
|
1752
|
-
item,
|
|
1753
|
-
rowRef
|
|
1754
|
-
}) => {
|
|
1886
|
+
var MultiSizeValueControl = ({ item, rowRef }) => {
|
|
1755
1887
|
const isUsingNestedProps = isExperimentActive2("e_v_3_30");
|
|
1756
|
-
return /* @__PURE__ */
|
|
1888
|
+
return /* @__PURE__ */ React33.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React33.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(Grid6, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React33.createElement(Grid6, { item: true, xs: 12 }, isUsingNestedProps ? /* @__PURE__ */ React33.createElement(ControlLabel, null, item.label) : /* @__PURE__ */ React33.createElement(ControlFormLabel, null, item.label)), /* @__PURE__ */ React33.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React33.createElement(SizeControl, { startIcon: item.icon, anchorRef: rowRef })))));
|
|
1757
1889
|
};
|
|
1758
1890
|
|
|
1759
1891
|
// src/controls/linked-dimensions-control.tsx
|
|
1760
|
-
import * as
|
|
1761
|
-
import { useRef as
|
|
1892
|
+
import * as React34 from "react";
|
|
1893
|
+
import { useRef as useRef7 } from "react";
|
|
1762
1894
|
import { dimensionsPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil3 } from "@elementor/editor-props";
|
|
1763
1895
|
import { isExperimentActive as isExperimentActive3 } from "@elementor/editor-v1-adapters";
|
|
1764
1896
|
import { DetachIcon, LinkIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
1765
|
-
import { Grid as
|
|
1766
|
-
import { __ as
|
|
1897
|
+
import { Grid as Grid7, Stack as Stack8, ToggleButton as ToggleButton3, Tooltip as Tooltip4 } from "@elementor/ui";
|
|
1898
|
+
import { __ as __8 } from "@wordpress/i18n";
|
|
1767
1899
|
var LinkedDimensionsControl = createControl(
|
|
1768
1900
|
({
|
|
1769
1901
|
label,
|
|
@@ -1771,7 +1903,7 @@ var LinkedDimensionsControl = createControl(
|
|
|
1771
1903
|
extendedOptions
|
|
1772
1904
|
}) => {
|
|
1773
1905
|
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(sizePropTypeUtil3);
|
|
1774
|
-
const gridRowRefs = [
|
|
1906
|
+
const gridRowRefs = [useRef7(null), useRef7(null)];
|
|
1775
1907
|
const {
|
|
1776
1908
|
value: dimensionsValue,
|
|
1777
1909
|
setValue: setDimensionsValue,
|
|
@@ -1795,18 +1927,18 @@ var LinkedDimensionsControl = createControl(
|
|
|
1795
1927
|
};
|
|
1796
1928
|
const tooltipLabel = label.toLowerCase();
|
|
1797
1929
|
const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
|
|
1798
|
-
const linkedLabel =
|
|
1799
|
-
const unlinkedLabel =
|
|
1930
|
+
const linkedLabel = __8("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
1931
|
+
const unlinkedLabel = __8("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
1800
1932
|
const disabled = sizeDisabled || dimensionsDisabled;
|
|
1801
|
-
return /* @__PURE__ */
|
|
1933
|
+
return /* @__PURE__ */ React34.createElement(
|
|
1802
1934
|
PropProvider,
|
|
1803
1935
|
{
|
|
1804
1936
|
propType,
|
|
1805
1937
|
value: dimensionsValue,
|
|
1806
1938
|
setValue: setDimensionsValue,
|
|
1807
|
-
disabled
|
|
1939
|
+
isDisabled: () => disabled
|
|
1808
1940
|
},
|
|
1809
|
-
/* @__PURE__ */
|
|
1941
|
+
/* @__PURE__ */ React34.createElement(Stack8, { direction: "row", gap: 2, flexWrap: "nowrap" }, isUsingNestedProps ? /* @__PURE__ */ React34.createElement(ControlFormLabel, null, label) : /* @__PURE__ */ React34.createElement(ControlLabel, null, label), /* @__PURE__ */ React34.createElement(Tooltip4, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React34.createElement(
|
|
1810
1942
|
ToggleButton3,
|
|
1811
1943
|
{
|
|
1812
1944
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
@@ -1817,9 +1949,9 @@ var LinkedDimensionsControl = createControl(
|
|
|
1817
1949
|
onChange: onLinkToggle,
|
|
1818
1950
|
disabled
|
|
1819
1951
|
},
|
|
1820
|
-
/* @__PURE__ */
|
|
1952
|
+
/* @__PURE__ */ React34.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1821
1953
|
))),
|
|
1822
|
-
getCssMarginProps(isSiteRtl).map((row, index) => /* @__PURE__ */
|
|
1954
|
+
getCssMarginProps(isSiteRtl).map((row, index) => /* @__PURE__ */ React34.createElement(Stack8, { direction: "row", gap: 2, flexWrap: "nowrap", key: index, ref: gridRowRefs[index] }, row.map(({ icon, ...props }) => /* @__PURE__ */ React34.createElement(Grid7, { container: true, gap: 0.75, alignItems: "center", key: props.bind }, /* @__PURE__ */ React34.createElement(Grid7, { item: true, xs: 12 }, /* @__PURE__ */ React34.createElement(Label, { ...props })), /* @__PURE__ */ React34.createElement(Grid7, { item: true, xs: 12 }, /* @__PURE__ */ React34.createElement(
|
|
1823
1955
|
Control3,
|
|
1824
1956
|
{
|
|
1825
1957
|
bind: props.bind,
|
|
@@ -1840,60 +1972,60 @@ var Control3 = ({
|
|
|
1840
1972
|
anchorRef
|
|
1841
1973
|
}) => {
|
|
1842
1974
|
if (isLinked) {
|
|
1843
|
-
return /* @__PURE__ */
|
|
1975
|
+
return /* @__PURE__ */ React34.createElement(SizeControl, { startIcon, extendedOptions, anchorRef });
|
|
1844
1976
|
}
|
|
1845
|
-
return /* @__PURE__ */
|
|
1977
|
+
return /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React34.createElement(SizeControl, { startIcon, extendedOptions, anchorRef }));
|
|
1846
1978
|
};
|
|
1847
1979
|
var Label = ({ label, bind }) => {
|
|
1848
1980
|
const isUsingNestedProps = isExperimentActive3("e_v_3_30");
|
|
1849
1981
|
if (!isUsingNestedProps) {
|
|
1850
|
-
return /* @__PURE__ */
|
|
1982
|
+
return /* @__PURE__ */ React34.createElement(ControlFormLabel, null, label);
|
|
1851
1983
|
}
|
|
1852
|
-
return /* @__PURE__ */
|
|
1984
|
+
return /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React34.createElement(ControlLabel, null, label));
|
|
1853
1985
|
};
|
|
1854
1986
|
function getCssMarginProps(isSiteRtl) {
|
|
1855
1987
|
return [
|
|
1856
1988
|
[
|
|
1857
1989
|
{
|
|
1858
1990
|
bind: "block-start",
|
|
1859
|
-
label:
|
|
1860
|
-
icon: /* @__PURE__ */
|
|
1991
|
+
label: __8("Top", "elementor"),
|
|
1992
|
+
icon: /* @__PURE__ */ React34.createElement(SideTopIcon, { fontSize: "tiny" })
|
|
1861
1993
|
},
|
|
1862
1994
|
{
|
|
1863
1995
|
bind: "inline-end",
|
|
1864
|
-
label: isSiteRtl ?
|
|
1865
|
-
icon: isSiteRtl ? /* @__PURE__ */
|
|
1996
|
+
label: isSiteRtl ? __8("Left", "elementor") : __8("Right", "elementor"),
|
|
1997
|
+
icon: isSiteRtl ? /* @__PURE__ */ React34.createElement(SideLeftIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React34.createElement(SideRightIcon, { fontSize: "tiny" })
|
|
1866
1998
|
}
|
|
1867
1999
|
],
|
|
1868
2000
|
[
|
|
1869
2001
|
{
|
|
1870
2002
|
bind: "block-end",
|
|
1871
|
-
label:
|
|
1872
|
-
icon: /* @__PURE__ */
|
|
2003
|
+
label: __8("Bottom", "elementor"),
|
|
2004
|
+
icon: /* @__PURE__ */ React34.createElement(SideBottomIcon, { fontSize: "tiny" })
|
|
1873
2005
|
},
|
|
1874
2006
|
{
|
|
1875
2007
|
bind: "inline-start",
|
|
1876
|
-
label: isSiteRtl ?
|
|
1877
|
-
icon: isSiteRtl ? /* @__PURE__ */
|
|
2008
|
+
label: isSiteRtl ? __8("Right", "elementor") : __8("Left", "elementor"),
|
|
2009
|
+
icon: isSiteRtl ? /* @__PURE__ */ React34.createElement(SideRightIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React34.createElement(SideLeftIcon, { fontSize: "tiny" })
|
|
1878
2010
|
}
|
|
1879
2011
|
]
|
|
1880
2012
|
];
|
|
1881
2013
|
}
|
|
1882
2014
|
|
|
1883
2015
|
// src/controls/font-family-control/font-family-control.tsx
|
|
1884
|
-
import * as
|
|
2016
|
+
import * as React36 from "react";
|
|
1885
2017
|
import { stringPropTypeUtil as stringPropTypeUtil5 } from "@elementor/editor-props";
|
|
1886
2018
|
import { ChevronDownIcon as ChevronDownIcon2 } from "@elementor/icons";
|
|
1887
2019
|
import { bindPopover as bindPopover4, bindTrigger as bindTrigger3, Popover as Popover4, UnstableTag as UnstableTag2, usePopupState as usePopupState5 } from "@elementor/ui";
|
|
1888
2020
|
|
|
1889
2021
|
// src/components/font-family-selector.tsx
|
|
1890
|
-
import * as
|
|
2022
|
+
import * as React35 from "react";
|
|
1891
2023
|
import { useEffect as useEffect5, useState as useState6 } from "react";
|
|
1892
2024
|
import { PopoverHeader, PopoverMenuList, PopoverScrollableContent, PopoverSearch } from "@elementor/editor-ui";
|
|
1893
2025
|
import { TextIcon } from "@elementor/icons";
|
|
1894
|
-
import { Box as
|
|
2026
|
+
import { Box as Box4, Divider as Divider2, Link, Stack as Stack9, Typography as Typography4 } from "@elementor/ui";
|
|
1895
2027
|
import { debounce } from "@elementor/utils";
|
|
1896
|
-
import { __ as
|
|
2028
|
+
import { __ as __9 } from "@wordpress/i18n";
|
|
1897
2029
|
|
|
1898
2030
|
// src/controls/font-family-control/enqueue-font.tsx
|
|
1899
2031
|
var enqueueFont = (fontFamily, context = "editor") => {
|
|
@@ -1923,7 +2055,8 @@ var FontFamilySelector = ({
|
|
|
1923
2055
|
fontFamilies,
|
|
1924
2056
|
fontFamily,
|
|
1925
2057
|
onFontFamilyChange,
|
|
1926
|
-
onClose
|
|
2058
|
+
onClose,
|
|
2059
|
+
sectionWidth
|
|
1927
2060
|
}) => {
|
|
1928
2061
|
const [searchValue, setSearchValue] = useState6("");
|
|
1929
2062
|
const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
|
|
@@ -1934,21 +2067,21 @@ var FontFamilySelector = ({
|
|
|
1934
2067
|
setSearchValue("");
|
|
1935
2068
|
onClose();
|
|
1936
2069
|
};
|
|
1937
|
-
return /* @__PURE__ */
|
|
2070
|
+
return /* @__PURE__ */ React35.createElement(Stack9, null, /* @__PURE__ */ React35.createElement(
|
|
1938
2071
|
PopoverHeader,
|
|
1939
2072
|
{
|
|
1940
|
-
title:
|
|
2073
|
+
title: __9("Font Family", "elementor"),
|
|
1941
2074
|
onClose: handleClose,
|
|
1942
|
-
icon: /* @__PURE__ */
|
|
2075
|
+
icon: /* @__PURE__ */ React35.createElement(TextIcon, { fontSize: SIZE2 })
|
|
1943
2076
|
}
|
|
1944
|
-
), /* @__PURE__ */
|
|
2077
|
+
), /* @__PURE__ */ React35.createElement(
|
|
1945
2078
|
PopoverSearch,
|
|
1946
2079
|
{
|
|
1947
2080
|
value: searchValue,
|
|
1948
2081
|
onSearch: handleSearch,
|
|
1949
|
-
placeholder:
|
|
2082
|
+
placeholder: __9("Search", "elementor")
|
|
1950
2083
|
}
|
|
1951
|
-
), /* @__PURE__ */
|
|
2084
|
+
), /* @__PURE__ */ React35.createElement(Divider2, null), /* @__PURE__ */ React35.createElement(PopoverScrollableContent, { width: sectionWidth }, filteredFontFamilies.length > 0 ? /* @__PURE__ */ React35.createElement(
|
|
1952
2085
|
FontList,
|
|
1953
2086
|
{
|
|
1954
2087
|
fontListItems: filteredFontFamilies,
|
|
@@ -1956,30 +2089,53 @@ var FontFamilySelector = ({
|
|
|
1956
2089
|
handleClose,
|
|
1957
2090
|
fontFamily
|
|
1958
2091
|
}
|
|
1959
|
-
) : /* @__PURE__ */
|
|
1960
|
-
|
|
2092
|
+
) : /* @__PURE__ */ React35.createElement(
|
|
2093
|
+
Stack9,
|
|
1961
2094
|
{
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
}
|
|
1969
|
-
},
|
|
1970
|
-
/* @__PURE__ */ React34.createElement("span", null, "\u201C"),
|
|
1971
|
-
/* @__PURE__ */ React34.createElement("span", { style: { maxWidth: "80%", overflow: "hidden", textOverflow: "ellipsis" } }, searchValue),
|
|
1972
|
-
/* @__PURE__ */ React34.createElement("span", null, "\u201D.")
|
|
1973
|
-
)), /* @__PURE__ */ React34.createElement(Typography3, { align: "center", variant: "caption", color: "text.secondary" }, __8("Try something else.", "elementor"), /* @__PURE__ */ React34.createElement(
|
|
1974
|
-
Link,
|
|
1975
|
-
{
|
|
1976
|
-
color: "secondary",
|
|
1977
|
-
variant: "caption",
|
|
1978
|
-
component: "button",
|
|
1979
|
-
onClick: () => setSearchValue("")
|
|
2095
|
+
alignItems: "center",
|
|
2096
|
+
justifyContent: "center",
|
|
2097
|
+
height: "100%",
|
|
2098
|
+
p: 2.5,
|
|
2099
|
+
gap: 1.5,
|
|
2100
|
+
overflow: "hidden"
|
|
1980
2101
|
},
|
|
1981
|
-
|
|
1982
|
-
|
|
2102
|
+
/* @__PURE__ */ React35.createElement(TextIcon, { fontSize: "large" }),
|
|
2103
|
+
/* @__PURE__ */ React35.createElement(Box4, { sx: { maxWidth: 160, overflow: "hidden" } }, /* @__PURE__ */ React35.createElement(Typography4, { align: "center", variant: "subtitle2", color: "text.secondary" }, __9("Sorry, nothing matched", "elementor")), /* @__PURE__ */ React35.createElement(
|
|
2104
|
+
Typography4,
|
|
2105
|
+
{
|
|
2106
|
+
variant: "subtitle2",
|
|
2107
|
+
color: "text.secondary",
|
|
2108
|
+
sx: {
|
|
2109
|
+
display: "flex",
|
|
2110
|
+
width: "100%",
|
|
2111
|
+
justifyContent: "center"
|
|
2112
|
+
}
|
|
2113
|
+
},
|
|
2114
|
+
/* @__PURE__ */ React35.createElement("span", null, "\u201C"),
|
|
2115
|
+
/* @__PURE__ */ React35.createElement("span", { style: { maxWidth: "80%", overflow: "hidden", textOverflow: "ellipsis" } }, searchValue),
|
|
2116
|
+
/* @__PURE__ */ React35.createElement("span", null, "\u201D.")
|
|
2117
|
+
)),
|
|
2118
|
+
/* @__PURE__ */ React35.createElement(
|
|
2119
|
+
Typography4,
|
|
2120
|
+
{
|
|
2121
|
+
align: "center",
|
|
2122
|
+
variant: "caption",
|
|
2123
|
+
color: "text.secondary",
|
|
2124
|
+
sx: { display: "flex", flexDirection: "column" }
|
|
2125
|
+
},
|
|
2126
|
+
__9("Try something else.", "elementor"),
|
|
2127
|
+
/* @__PURE__ */ React35.createElement(
|
|
2128
|
+
Link,
|
|
2129
|
+
{
|
|
2130
|
+
color: "secondary",
|
|
2131
|
+
variant: "caption",
|
|
2132
|
+
component: "button",
|
|
2133
|
+
onClick: () => setSearchValue("")
|
|
2134
|
+
},
|
|
2135
|
+
__9("Clear & try again", "elementor")
|
|
2136
|
+
)
|
|
2137
|
+
)
|
|
2138
|
+
)));
|
|
1983
2139
|
};
|
|
1984
2140
|
var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
1985
2141
|
const selectedItem = fontListItems.find((item) => item.value === fontFamily);
|
|
@@ -1991,7 +2147,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1991
2147
|
}
|
|
1992
2148
|
});
|
|
1993
2149
|
}, 100);
|
|
1994
|
-
return /* @__PURE__ */
|
|
2150
|
+
return /* @__PURE__ */ React35.createElement(
|
|
1995
2151
|
PopoverMenuList,
|
|
1996
2152
|
{
|
|
1997
2153
|
items: fontListItems,
|
|
@@ -2012,47 +2168,57 @@ var useDebounce = (fn, delay) => {
|
|
|
2012
2168
|
|
|
2013
2169
|
// src/controls/font-family-control/font-family-control.tsx
|
|
2014
2170
|
var SIZE3 = "tiny";
|
|
2015
|
-
var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
2016
|
-
const { value: fontFamily, setValue: setFontFamily, disabled } = useBoundProp(stringPropTypeUtil5);
|
|
2171
|
+
var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
2172
|
+
const { value: fontFamily, setValue: setFontFamily, disabled, placeholder } = useBoundProp(stringPropTypeUtil5);
|
|
2017
2173
|
const popoverState = usePopupState5({ variant: "popover" });
|
|
2018
|
-
|
|
2174
|
+
const isShowingPlaceholder = !fontFamily && placeholder;
|
|
2175
|
+
return /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(ControlActions, null, /* @__PURE__ */ React36.createElement(
|
|
2019
2176
|
UnstableTag2,
|
|
2020
2177
|
{
|
|
2021
2178
|
variant: "outlined",
|
|
2022
|
-
label: fontFamily,
|
|
2023
|
-
endIcon: /* @__PURE__ */
|
|
2179
|
+
label: fontFamily || placeholder,
|
|
2180
|
+
endIcon: /* @__PURE__ */ React36.createElement(ChevronDownIcon2, { fontSize: SIZE3 }),
|
|
2024
2181
|
...bindTrigger3(popoverState),
|
|
2025
2182
|
fullWidth: true,
|
|
2026
|
-
disabled
|
|
2183
|
+
disabled,
|
|
2184
|
+
sx: isShowingPlaceholder ? {
|
|
2185
|
+
"& .MuiTag-label": {
|
|
2186
|
+
color: (theme) => theme.palette.text.tertiary
|
|
2187
|
+
},
|
|
2188
|
+
textTransform: "capitalize"
|
|
2189
|
+
} : void 0
|
|
2027
2190
|
}
|
|
2028
|
-
)), /* @__PURE__ */
|
|
2191
|
+
)), /* @__PURE__ */ React36.createElement(
|
|
2029
2192
|
Popover4,
|
|
2030
2193
|
{
|
|
2031
2194
|
disablePortal: true,
|
|
2032
2195
|
disableScrollLock: true,
|
|
2033
|
-
anchorOrigin: { vertical: "bottom", horizontal: "
|
|
2196
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
2197
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
2198
|
+
sx: { my: 1.5 },
|
|
2034
2199
|
...bindPopover4(popoverState)
|
|
2035
2200
|
},
|
|
2036
|
-
/* @__PURE__ */
|
|
2201
|
+
/* @__PURE__ */ React36.createElement(
|
|
2037
2202
|
FontFamilySelector,
|
|
2038
2203
|
{
|
|
2039
2204
|
fontFamilies,
|
|
2040
2205
|
fontFamily,
|
|
2041
2206
|
onFontFamilyChange: setFontFamily,
|
|
2042
|
-
onClose: popoverState.close
|
|
2207
|
+
onClose: popoverState.close,
|
|
2208
|
+
sectionWidth
|
|
2043
2209
|
}
|
|
2044
2210
|
)
|
|
2045
2211
|
));
|
|
2046
2212
|
});
|
|
2047
2213
|
|
|
2048
2214
|
// src/controls/url-control.tsx
|
|
2049
|
-
import * as
|
|
2215
|
+
import * as React37 from "react";
|
|
2050
2216
|
import { urlPropTypeUtil } from "@elementor/editor-props";
|
|
2051
2217
|
import { TextField as TextField6 } from "@elementor/ui";
|
|
2052
2218
|
var UrlControl = createControl(({ placeholder }) => {
|
|
2053
2219
|
const { value, setValue, disabled } = useBoundProp(urlPropTypeUtil);
|
|
2054
2220
|
const handleChange = (event) => setValue(event.target.value);
|
|
2055
|
-
return /* @__PURE__ */
|
|
2221
|
+
return /* @__PURE__ */ React37.createElement(ControlActions, null, /* @__PURE__ */ React37.createElement(
|
|
2056
2222
|
TextField6,
|
|
2057
2223
|
{
|
|
2058
2224
|
size: "tiny",
|
|
@@ -2066,31 +2232,32 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
2066
2232
|
});
|
|
2067
2233
|
|
|
2068
2234
|
// src/controls/link-control.tsx
|
|
2069
|
-
import * as
|
|
2235
|
+
import * as React40 from "react";
|
|
2070
2236
|
import { useMemo as useMemo3, useState as useState7 } from "react";
|
|
2071
2237
|
import { getLinkInLinkRestriction, selectElement } from "@elementor/editor-elements";
|
|
2072
2238
|
import {
|
|
2073
|
-
booleanPropTypeUtil,
|
|
2239
|
+
booleanPropTypeUtil as booleanPropTypeUtil2,
|
|
2074
2240
|
linkPropTypeUtil,
|
|
2075
2241
|
numberPropTypeUtil as numberPropTypeUtil2,
|
|
2076
2242
|
stringPropTypeUtil as stringPropTypeUtil6,
|
|
2077
2243
|
urlPropTypeUtil as urlPropTypeUtil2
|
|
2078
2244
|
} from "@elementor/editor-props";
|
|
2079
2245
|
import { InfoTipCard } from "@elementor/editor-ui";
|
|
2246
|
+
import { isExperimentActive as isExperimentActive4 } from "@elementor/editor-v1-adapters";
|
|
2080
2247
|
import { httpService as httpService2 } from "@elementor/http-client";
|
|
2081
2248
|
import { AlertTriangleIcon, MinusIcon, PlusIcon as PlusIcon2 } from "@elementor/icons";
|
|
2082
2249
|
import { useSessionStorage } from "@elementor/session";
|
|
2083
|
-
import { Box as
|
|
2250
|
+
import { Box as Box6, Collapse, Grid as Grid8, IconButton as IconButton3, Infotip, Stack as Stack10, Switch as Switch2 } from "@elementor/ui";
|
|
2084
2251
|
import { debounce as debounce2 } from "@elementor/utils";
|
|
2085
|
-
import { __ as
|
|
2252
|
+
import { __ as __10 } from "@wordpress/i18n";
|
|
2086
2253
|
|
|
2087
2254
|
// src/components/autocomplete.tsx
|
|
2088
|
-
import * as
|
|
2255
|
+
import * as React38 from "react";
|
|
2089
2256
|
import { forwardRef as forwardRef4 } from "react";
|
|
2090
2257
|
import { XIcon as XIcon2 } from "@elementor/icons";
|
|
2091
2258
|
import {
|
|
2092
2259
|
Autocomplete as AutocompleteBase,
|
|
2093
|
-
Box as
|
|
2260
|
+
Box as Box5,
|
|
2094
2261
|
IconButton as IconButton2,
|
|
2095
2262
|
InputAdornment as InputAdornment3,
|
|
2096
2263
|
TextField as TextField7
|
|
@@ -2111,7 +2278,7 @@ var Autocomplete = forwardRef4((props, ref) => {
|
|
|
2111
2278
|
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
2112
2279
|
const isOptionEqualToValue = muiWarningPreventer ? void 0 : () => true;
|
|
2113
2280
|
const isValueFromOptions = typeof value === "number" && !!findMatchingOption(options, value);
|
|
2114
|
-
return /* @__PURE__ */
|
|
2281
|
+
return /* @__PURE__ */ React38.createElement(
|
|
2115
2282
|
AutocompleteBase,
|
|
2116
2283
|
{
|
|
2117
2284
|
...restProps,
|
|
@@ -2129,8 +2296,8 @@ var Autocomplete = forwardRef4((props, ref) => {
|
|
|
2129
2296
|
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
2130
2297
|
isOptionEqualToValue,
|
|
2131
2298
|
filterOptions: () => optionKeys,
|
|
2132
|
-
renderOption: (optionProps, optionId) => /* @__PURE__ */
|
|
2133
|
-
renderInput: (params) => /* @__PURE__ */
|
|
2299
|
+
renderOption: (optionProps, optionId) => /* @__PURE__ */ React38.createElement(Box5, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
2300
|
+
renderInput: (params) => /* @__PURE__ */ React38.createElement(
|
|
2134
2301
|
TextInput,
|
|
2135
2302
|
{
|
|
2136
2303
|
params,
|
|
@@ -2153,7 +2320,7 @@ var TextInput = ({
|
|
|
2153
2320
|
const onChange = (event) => {
|
|
2154
2321
|
handleChange(event.target.value);
|
|
2155
2322
|
};
|
|
2156
|
-
return /* @__PURE__ */
|
|
2323
|
+
return /* @__PURE__ */ React38.createElement(
|
|
2157
2324
|
TextField7,
|
|
2158
2325
|
{
|
|
2159
2326
|
...params,
|
|
@@ -2166,7 +2333,7 @@ var TextInput = ({
|
|
|
2166
2333
|
},
|
|
2167
2334
|
InputProps: {
|
|
2168
2335
|
...params.InputProps,
|
|
2169
|
-
endAdornment: /* @__PURE__ */
|
|
2336
|
+
endAdornment: /* @__PURE__ */ React38.createElement(ClearButton, { params, allowClear, handleChange })
|
|
2170
2337
|
}
|
|
2171
2338
|
}
|
|
2172
2339
|
);
|
|
@@ -2175,7 +2342,7 @@ var ClearButton = ({
|
|
|
2175
2342
|
allowClear,
|
|
2176
2343
|
handleChange,
|
|
2177
2344
|
params
|
|
2178
|
-
}) => /* @__PURE__ */
|
|
2345
|
+
}) => /* @__PURE__ */ React38.createElement(InputAdornment3, { position: "end" }, allowClear && /* @__PURE__ */ React38.createElement(IconButton2, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React38.createElement(XIcon2, { fontSize: params.size })));
|
|
2179
2346
|
function findMatchingOption(options, optionId = null) {
|
|
2180
2347
|
const formattedOption = (optionId || "").toString();
|
|
2181
2348
|
return options.find(({ id }) => formattedOption === id.toString());
|
|
@@ -2196,10 +2363,33 @@ function _factoryFilter(newValue, options, minInputLength) {
|
|
|
2196
2363
|
);
|
|
2197
2364
|
}
|
|
2198
2365
|
|
|
2366
|
+
// src/controls/switch-control.tsx
|
|
2367
|
+
import * as React39 from "react";
|
|
2368
|
+
import { booleanPropTypeUtil } from "@elementor/editor-props";
|
|
2369
|
+
import { Switch } from "@elementor/ui";
|
|
2370
|
+
var SwitchControl = createControl(() => {
|
|
2371
|
+
const { value, setValue, disabled } = useBoundProp(booleanPropTypeUtil);
|
|
2372
|
+
const handleChange = (event) => {
|
|
2373
|
+
setValue(event.target.checked);
|
|
2374
|
+
};
|
|
2375
|
+
return /* @__PURE__ */ React39.createElement("div", { style: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React39.createElement(
|
|
2376
|
+
Switch,
|
|
2377
|
+
{
|
|
2378
|
+
checked: !!value,
|
|
2379
|
+
onChange: handleChange,
|
|
2380
|
+
size: "small",
|
|
2381
|
+
disabled,
|
|
2382
|
+
inputProps: {
|
|
2383
|
+
...disabled ? { style: { opacity: 0 } } : {}
|
|
2384
|
+
}
|
|
2385
|
+
}
|
|
2386
|
+
));
|
|
2387
|
+
});
|
|
2388
|
+
|
|
2199
2389
|
// src/controls/link-control.tsx
|
|
2200
2390
|
var SIZE4 = "tiny";
|
|
2201
2391
|
var learnMoreButton = {
|
|
2202
|
-
label:
|
|
2392
|
+
label: __10("Learn More", "elementor"),
|
|
2203
2393
|
href: "https://go.elementor.com/element-link-inside-link-infotip"
|
|
2204
2394
|
};
|
|
2205
2395
|
var LinkControl = createControl((props) => {
|
|
@@ -2211,7 +2401,8 @@ var LinkControl = createControl((props) => {
|
|
|
2211
2401
|
queryOptions: { endpoint = "", requestParams = {} },
|
|
2212
2402
|
placeholder,
|
|
2213
2403
|
minInputLength = 2,
|
|
2214
|
-
context: { elementId }
|
|
2404
|
+
context: { elementId },
|
|
2405
|
+
label = __10("Link", "elementor")
|
|
2215
2406
|
} = props || {};
|
|
2216
2407
|
const [linkInLinkRestriction, setLinkInLinkRestriction] = useState7(getLinkInLinkRestriction(elementId));
|
|
2217
2408
|
const [options, setOptions] = useState7(
|
|
@@ -2274,7 +2465,7 @@ var LinkControl = createControl((props) => {
|
|
|
2274
2465
|
),
|
|
2275
2466
|
[endpoint]
|
|
2276
2467
|
);
|
|
2277
|
-
return /* @__PURE__ */
|
|
2468
|
+
return /* @__PURE__ */ React40.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React40.createElement(Stack10, { gap: 1.5 }, /* @__PURE__ */ React40.createElement(
|
|
2278
2469
|
Stack10,
|
|
2279
2470
|
{
|
|
2280
2471
|
direction: "row",
|
|
@@ -2284,17 +2475,17 @@ var LinkControl = createControl((props) => {
|
|
|
2284
2475
|
marginInlineEnd: -0.75
|
|
2285
2476
|
}
|
|
2286
2477
|
},
|
|
2287
|
-
/* @__PURE__ */
|
|
2288
|
-
/* @__PURE__ */
|
|
2478
|
+
/* @__PURE__ */ React40.createElement(ControlFormLabel, null, label),
|
|
2479
|
+
/* @__PURE__ */ React40.createElement(ConditionalInfoTip, { isVisible: !isActive, linkInLinkRestriction }, /* @__PURE__ */ React40.createElement(
|
|
2289
2480
|
ToggleIconControl,
|
|
2290
2481
|
{
|
|
2291
2482
|
disabled: shouldDisableAddingLink,
|
|
2292
2483
|
active: isActive,
|
|
2293
2484
|
onIconClick: onEnabledChange,
|
|
2294
|
-
label:
|
|
2485
|
+
label: __10("Toggle link", "elementor")
|
|
2295
2486
|
}
|
|
2296
2487
|
))
|
|
2297
|
-
), /* @__PURE__ */
|
|
2488
|
+
), /* @__PURE__ */ React40.createElement(Collapse, { in: isActive, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React40.createElement(Stack10, { gap: 1.5 }, /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ React40.createElement(ControlActions, null, /* @__PURE__ */ React40.createElement(
|
|
2298
2489
|
Autocomplete,
|
|
2299
2490
|
{
|
|
2300
2491
|
options,
|
|
@@ -2305,22 +2496,31 @@ var LinkControl = createControl((props) => {
|
|
|
2305
2496
|
onTextChange,
|
|
2306
2497
|
minInputLength
|
|
2307
2498
|
}
|
|
2308
|
-
))), /* @__PURE__ */
|
|
2499
|
+
))), /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React40.createElement(Grid8, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React40.createElement(Grid8, { item: true }, /* @__PURE__ */ React40.createElement(ControlFormLabel, null, __10("Open in a new tab", "elementor"))), /* @__PURE__ */ React40.createElement(Grid8, { item: true, sx: { marginInlineEnd: -1 } }, /* @__PURE__ */ React40.createElement(SwitchControlComponent, { disabled: propContext.disabled || !value }))))))));
|
|
2309
2500
|
});
|
|
2310
2501
|
var ToggleIconControl = ({ disabled, active, onIconClick, label }) => {
|
|
2311
|
-
return /* @__PURE__ */
|
|
2502
|
+
return /* @__PURE__ */ React40.createElement(IconButton3, { size: SIZE4, onClick: onIconClick, "aria-label": label, disabled }, active ? /* @__PURE__ */ React40.createElement(MinusIcon, { fontSize: SIZE4 }) : /* @__PURE__ */ React40.createElement(PlusIcon2, { fontSize: SIZE4 }));
|
|
2312
2503
|
};
|
|
2313
|
-
var
|
|
2314
|
-
const { value
|
|
2504
|
+
var SwitchControlComponent = ({ disabled }) => {
|
|
2505
|
+
const { value, setValue } = useBoundProp(booleanPropTypeUtil2);
|
|
2506
|
+
const isVersion331Active = isExperimentActive4("e_v_3_31");
|
|
2507
|
+
if (isVersion331Active) {
|
|
2508
|
+
return /* @__PURE__ */ React40.createElement(SwitchControl, null);
|
|
2509
|
+
}
|
|
2315
2510
|
const onClick = () => {
|
|
2316
2511
|
setValue(!value);
|
|
2317
2512
|
};
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2513
|
+
return /* @__PURE__ */ React40.createElement(
|
|
2514
|
+
Switch2,
|
|
2515
|
+
{
|
|
2516
|
+
checked: value ?? false,
|
|
2517
|
+
onClick,
|
|
2518
|
+
disabled,
|
|
2519
|
+
inputProps: {
|
|
2520
|
+
...disabled ? { style: { opacity: 0 } } : {}
|
|
2521
|
+
}
|
|
2321
2522
|
}
|
|
2322
|
-
|
|
2323
|
-
return /* @__PURE__ */ React38.createElement(Grid7, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React38.createElement(Grid7, { item: true }, /* @__PURE__ */ React38.createElement(ControlFormLabel, null, __9("Open in a new tab", "elementor"))), /* @__PURE__ */ React38.createElement(Grid7, { item: true, sx: { marginInlineEnd: -1 } }, /* @__PURE__ */ React38.createElement(Switch, { checked: value, onClick, disabled, inputProps })));
|
|
2523
|
+
);
|
|
2324
2524
|
};
|
|
2325
2525
|
async function fetchOptions(ajaxUrl, params) {
|
|
2326
2526
|
if (!params || !ajaxUrl) {
|
|
@@ -2357,38 +2557,38 @@ var ConditionalInfoTip = ({ linkInLinkRestriction, isVisible, children }) => {
|
|
|
2357
2557
|
selectElement(elementId);
|
|
2358
2558
|
}
|
|
2359
2559
|
};
|
|
2360
|
-
return shouldRestrict && isVisible ? /* @__PURE__ */
|
|
2560
|
+
return shouldRestrict && isVisible ? /* @__PURE__ */ React40.createElement(
|
|
2361
2561
|
Infotip,
|
|
2362
2562
|
{
|
|
2363
2563
|
placement: "right",
|
|
2364
|
-
content: /* @__PURE__ */
|
|
2564
|
+
content: /* @__PURE__ */ React40.createElement(
|
|
2365
2565
|
InfoTipCard,
|
|
2366
2566
|
{
|
|
2367
2567
|
content: INFOTIP_CONTENT[reason],
|
|
2368
|
-
svgIcon: /* @__PURE__ */
|
|
2568
|
+
svgIcon: /* @__PURE__ */ React40.createElement(AlertTriangleIcon, null),
|
|
2369
2569
|
learnMoreButton,
|
|
2370
2570
|
ctaButton: {
|
|
2371
|
-
label:
|
|
2571
|
+
label: __10("Take me there", "elementor"),
|
|
2372
2572
|
onClick: handleTakeMeClick
|
|
2373
2573
|
}
|
|
2374
2574
|
}
|
|
2375
2575
|
)
|
|
2376
2576
|
},
|
|
2377
|
-
/* @__PURE__ */
|
|
2378
|
-
) : /* @__PURE__ */
|
|
2577
|
+
/* @__PURE__ */ React40.createElement(Box6, null, children)
|
|
2578
|
+
) : /* @__PURE__ */ React40.createElement(React40.Fragment, null, children);
|
|
2379
2579
|
};
|
|
2380
2580
|
var INFOTIP_CONTENT = {
|
|
2381
|
-
descendant: /* @__PURE__ */
|
|
2382
|
-
ancestor: /* @__PURE__ */
|
|
2581
|
+
descendant: /* @__PURE__ */ React40.createElement(React40.Fragment, null, __10("To add a link to this container,", "elementor"), /* @__PURE__ */ React40.createElement("br", null), __10("first remove the link from the elements inside of it.", "elementor")),
|
|
2582
|
+
ancestor: /* @__PURE__ */ React40.createElement(React40.Fragment, null, __10("To add a link to this element,", "elementor"), /* @__PURE__ */ React40.createElement("br", null), __10("first remove the link from its parent container.", "elementor"))
|
|
2383
2583
|
};
|
|
2384
2584
|
|
|
2385
2585
|
// src/controls/gap-control.tsx
|
|
2386
|
-
import * as
|
|
2387
|
-
import { useRef as
|
|
2586
|
+
import * as React41 from "react";
|
|
2587
|
+
import { useRef as useRef8 } from "react";
|
|
2388
2588
|
import { layoutDirectionPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil4 } from "@elementor/editor-props";
|
|
2389
2589
|
import { DetachIcon as DetachIcon2, LinkIcon as LinkIcon2 } from "@elementor/icons";
|
|
2390
|
-
import { Grid as
|
|
2391
|
-
import { __ as
|
|
2590
|
+
import { Grid as Grid9, Stack as Stack11, ToggleButton as ToggleButton4, Tooltip as Tooltip5 } from "@elementor/ui";
|
|
2591
|
+
import { __ as __11 } from "@wordpress/i18n";
|
|
2392
2592
|
var GapControl = createControl(({ label }) => {
|
|
2393
2593
|
const {
|
|
2394
2594
|
value: directionValue,
|
|
@@ -2396,7 +2596,7 @@ var GapControl = createControl(({ label }) => {
|
|
|
2396
2596
|
propType,
|
|
2397
2597
|
disabled: directionDisabled
|
|
2398
2598
|
} = useBoundProp(layoutDirectionPropTypeUtil);
|
|
2399
|
-
const stackRef =
|
|
2599
|
+
const stackRef = useRef8(null);
|
|
2400
2600
|
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(sizePropTypeUtil4);
|
|
2401
2601
|
const isLinked = !directionValue && !sizeValue ? true : !!sizeValue;
|
|
2402
2602
|
const onLinkToggle = () => {
|
|
@@ -2412,10 +2612,10 @@ var GapControl = createControl(({ label }) => {
|
|
|
2412
2612
|
};
|
|
2413
2613
|
const tooltipLabel = label.toLowerCase();
|
|
2414
2614
|
const LinkedIcon = isLinked ? LinkIcon2 : DetachIcon2;
|
|
2415
|
-
const linkedLabel =
|
|
2416
|
-
const unlinkedLabel =
|
|
2615
|
+
const linkedLabel = __11("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
2616
|
+
const unlinkedLabel = __11("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
2417
2617
|
const disabled = sizeDisabled || directionDisabled;
|
|
2418
|
-
return /* @__PURE__ */
|
|
2618
|
+
return /* @__PURE__ */ React41.createElement(PropProvider, { propType, value: directionValue, setValue: setDirectionValue }, /* @__PURE__ */ React41.createElement(Stack11, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(ControlLabel, null, label), /* @__PURE__ */ React41.createElement(Tooltip5, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React41.createElement(
|
|
2419
2619
|
ToggleButton4,
|
|
2420
2620
|
{
|
|
2421
2621
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
@@ -2426,8 +2626,8 @@ var GapControl = createControl(({ label }) => {
|
|
|
2426
2626
|
onChange: onLinkToggle,
|
|
2427
2627
|
disabled
|
|
2428
2628
|
},
|
|
2429
|
-
/* @__PURE__ */
|
|
2430
|
-
))), /* @__PURE__ */
|
|
2629
|
+
/* @__PURE__ */ React41.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
2630
|
+
))), /* @__PURE__ */ React41.createElement(Stack11, { direction: "row", gap: 2, flexWrap: "nowrap", ref: stackRef }, /* @__PURE__ */ React41.createElement(Grid9, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React41.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React41.createElement(ControlFormLabel, null, __11("Column", "elementor"))), /* @__PURE__ */ React41.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React41.createElement(Control4, { bind: "column", isLinked, anchorRef: stackRef }))), /* @__PURE__ */ React41.createElement(Grid9, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React41.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React41.createElement(ControlFormLabel, null, __11("Row", "elementor"))), /* @__PURE__ */ React41.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React41.createElement(Control4, { bind: "row", isLinked, anchorRef: stackRef })))));
|
|
2431
2631
|
});
|
|
2432
2632
|
var Control4 = ({
|
|
2433
2633
|
bind,
|
|
@@ -2435,21 +2635,21 @@ var Control4 = ({
|
|
|
2435
2635
|
anchorRef
|
|
2436
2636
|
}) => {
|
|
2437
2637
|
if (isLinked) {
|
|
2438
|
-
return /* @__PURE__ */
|
|
2638
|
+
return /* @__PURE__ */ React41.createElement(SizeControl, { anchorRef });
|
|
2439
2639
|
}
|
|
2440
|
-
return /* @__PURE__ */
|
|
2640
|
+
return /* @__PURE__ */ React41.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React41.createElement(SizeControl, { anchorRef }));
|
|
2441
2641
|
};
|
|
2442
2642
|
|
|
2443
2643
|
// src/controls/aspect-ratio-control.tsx
|
|
2444
|
-
import * as
|
|
2445
|
-
import { useState as useState8 } from "react";
|
|
2644
|
+
import * as React42 from "react";
|
|
2645
|
+
import { useEffect as useEffect6, useState as useState8 } from "react";
|
|
2446
2646
|
import { stringPropTypeUtil as stringPropTypeUtil7 } from "@elementor/editor-props";
|
|
2447
|
-
import { MenuListItem as
|
|
2647
|
+
import { MenuListItem as MenuListItem4 } from "@elementor/editor-ui";
|
|
2448
2648
|
import { ArrowsMoveHorizontalIcon, ArrowsMoveVerticalIcon } from "@elementor/icons";
|
|
2449
|
-
import { Grid as
|
|
2450
|
-
import { __ as
|
|
2649
|
+
import { Grid as Grid10, Select as Select3, Stack as Stack12, TextField as TextField8 } from "@elementor/ui";
|
|
2650
|
+
import { __ as __12 } from "@wordpress/i18n";
|
|
2451
2651
|
var RATIO_OPTIONS = [
|
|
2452
|
-
{ label:
|
|
2652
|
+
{ label: __12("Auto", "elementor"), value: "auto" },
|
|
2453
2653
|
{ label: "1/1", value: "1/1" },
|
|
2454
2654
|
{ label: "4/3", value: "4/3" },
|
|
2455
2655
|
{ label: "3/4", value: "3/4" },
|
|
@@ -2469,6 +2669,21 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2469
2669
|
const [selectedValue, setSelectedValue] = useState8(
|
|
2470
2670
|
isCustomSelected ? CUSTOM_RATIO : aspectRatioValue || ""
|
|
2471
2671
|
);
|
|
2672
|
+
useEffect6(() => {
|
|
2673
|
+
const isCustomValue = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
2674
|
+
if (isCustomValue) {
|
|
2675
|
+
const [width, height] = aspectRatioValue.split("/");
|
|
2676
|
+
setCustomWidth(width || "");
|
|
2677
|
+
setCustomHeight(height || "");
|
|
2678
|
+
setSelectedValue(CUSTOM_RATIO);
|
|
2679
|
+
setIsCustom(true);
|
|
2680
|
+
} else {
|
|
2681
|
+
setSelectedValue(aspectRatioValue || "");
|
|
2682
|
+
setIsCustom(false);
|
|
2683
|
+
setCustomWidth("");
|
|
2684
|
+
setCustomHeight("");
|
|
2685
|
+
}
|
|
2686
|
+
}, [aspectRatioValue]);
|
|
2472
2687
|
const handleSelectChange = (event) => {
|
|
2473
2688
|
const newValue = event.target.value;
|
|
2474
2689
|
const isCustomRatio = newValue === CUSTOM_RATIO;
|
|
@@ -2493,8 +2708,8 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2493
2708
|
setAspectRatioValue(`${customWidth}/${newHeight}`);
|
|
2494
2709
|
}
|
|
2495
2710
|
};
|
|
2496
|
-
return /* @__PURE__ */
|
|
2497
|
-
|
|
2711
|
+
return /* @__PURE__ */ React42.createElement(ControlActions, null, /* @__PURE__ */ React42.createElement(Stack12, { direction: "column", gap: 2 }, /* @__PURE__ */ React42.createElement(Grid10, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(ControlLabel, null, label)), /* @__PURE__ */ React42.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(
|
|
2712
|
+
Select3,
|
|
2498
2713
|
{
|
|
2499
2714
|
size: "tiny",
|
|
2500
2715
|
displayEmpty: true,
|
|
@@ -2504,10 +2719,10 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2504
2719
|
onChange: handleSelectChange,
|
|
2505
2720
|
fullWidth: true
|
|
2506
2721
|
},
|
|
2507
|
-
[...RATIO_OPTIONS, { label:
|
|
2508
|
-
({ label: optionLabel, ...props }) => /* @__PURE__ */
|
|
2722
|
+
[...RATIO_OPTIONS, { label: __12("Custom", "elementor"), value: CUSTOM_RATIO }].map(
|
|
2723
|
+
({ label: optionLabel, ...props }) => /* @__PURE__ */ React42.createElement(MenuListItem4, { key: props.value, ...props, value: props.value ?? "" }, optionLabel)
|
|
2509
2724
|
)
|
|
2510
|
-
))), isCustom && /* @__PURE__ */
|
|
2725
|
+
))), isCustom && /* @__PURE__ */ React42.createElement(Grid10, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(
|
|
2511
2726
|
TextField8,
|
|
2512
2727
|
{
|
|
2513
2728
|
size: "tiny",
|
|
@@ -2517,10 +2732,10 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2517
2732
|
value: customWidth,
|
|
2518
2733
|
onChange: handleCustomWidthChange,
|
|
2519
2734
|
InputProps: {
|
|
2520
|
-
startAdornment: /* @__PURE__ */
|
|
2735
|
+
startAdornment: /* @__PURE__ */ React42.createElement(ArrowsMoveHorizontalIcon, { fontSize: "tiny" })
|
|
2521
2736
|
}
|
|
2522
2737
|
}
|
|
2523
|
-
)), /* @__PURE__ */
|
|
2738
|
+
)), /* @__PURE__ */ React42.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(
|
|
2524
2739
|
TextField8,
|
|
2525
2740
|
{
|
|
2526
2741
|
size: "tiny",
|
|
@@ -2530,23 +2745,23 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2530
2745
|
value: customHeight,
|
|
2531
2746
|
onChange: handleCustomHeightChange,
|
|
2532
2747
|
InputProps: {
|
|
2533
|
-
startAdornment: /* @__PURE__ */
|
|
2748
|
+
startAdornment: /* @__PURE__ */ React42.createElement(ArrowsMoveVerticalIcon, { fontSize: "tiny" })
|
|
2534
2749
|
}
|
|
2535
2750
|
}
|
|
2536
2751
|
)))));
|
|
2537
2752
|
});
|
|
2538
2753
|
|
|
2539
2754
|
// src/controls/svg-media-control.tsx
|
|
2540
|
-
import * as
|
|
2755
|
+
import * as React44 from "react";
|
|
2541
2756
|
import { useState as useState10 } from "react";
|
|
2542
2757
|
import { imageSrcPropTypeUtil as imageSrcPropTypeUtil2 } from "@elementor/editor-props";
|
|
2543
2758
|
import { UploadIcon as UploadIcon2 } from "@elementor/icons";
|
|
2544
2759
|
import { Button as Button4, Card as Card2, CardMedia as CardMedia2, CardOverlay as CardOverlay2, CircularProgress as CircularProgress3, Stack as Stack13, styled as styled4 } from "@elementor/ui";
|
|
2545
2760
|
import { useWpMediaAttachment as useWpMediaAttachment2, useWpMediaFrame as useWpMediaFrame2 } from "@elementor/wp-media";
|
|
2546
|
-
import { __ as
|
|
2761
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
2547
2762
|
|
|
2548
2763
|
// src/components/enable-unfiltered-modal.tsx
|
|
2549
|
-
import * as
|
|
2764
|
+
import * as React43 from "react";
|
|
2550
2765
|
import { useState as useState9 } from "react";
|
|
2551
2766
|
import { useCurrentUserCapabilities } from "@elementor/editor-current-user";
|
|
2552
2767
|
import {
|
|
@@ -2560,19 +2775,19 @@ import {
|
|
|
2560
2775
|
DialogTitle,
|
|
2561
2776
|
Divider as Divider3
|
|
2562
2777
|
} from "@elementor/ui";
|
|
2563
|
-
import { __ as
|
|
2564
|
-
var ADMIN_TITLE_TEXT =
|
|
2565
|
-
var ADMIN_CONTENT_TEXT =
|
|
2778
|
+
import { __ as __13 } from "@wordpress/i18n";
|
|
2779
|
+
var ADMIN_TITLE_TEXT = __13("Enable Unfiltered Uploads", "elementor");
|
|
2780
|
+
var ADMIN_CONTENT_TEXT = __13(
|
|
2566
2781
|
"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.",
|
|
2567
2782
|
"elementor"
|
|
2568
2783
|
);
|
|
2569
|
-
var NON_ADMIN_TITLE_TEXT =
|
|
2570
|
-
var NON_ADMIN_CONTENT_TEXT =
|
|
2784
|
+
var NON_ADMIN_TITLE_TEXT = __13("Sorry, you can't upload that file yet", "elementor");
|
|
2785
|
+
var NON_ADMIN_CONTENT_TEXT = __13(
|
|
2571
2786
|
"This is because this file type may pose a security risk. To upload them anyway, ask the site administrator to enable unfiltered file uploads.",
|
|
2572
2787
|
"elementor"
|
|
2573
2788
|
);
|
|
2574
|
-
var ADMIN_FAILED_CONTENT_TEXT_PT1 =
|
|
2575
|
-
var ADMIN_FAILED_CONTENT_TEXT_PT2 =
|
|
2789
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT1 = __13("Failed to enable unfiltered files upload.", "elementor");
|
|
2790
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT2 = __13(
|
|
2576
2791
|
"You can try again, if the problem persists, please contact support.",
|
|
2577
2792
|
"elementor"
|
|
2578
2793
|
);
|
|
@@ -2599,9 +2814,9 @@ var EnableUnfilteredModal = (props) => {
|
|
|
2599
2814
|
}
|
|
2600
2815
|
};
|
|
2601
2816
|
const dialogProps = { ...props, isPending, handleEnable, isError, onClose };
|
|
2602
|
-
return canManageOptions ? /* @__PURE__ */
|
|
2817
|
+
return canManageOptions ? /* @__PURE__ */ React43.createElement(AdminDialog, { ...dialogProps }) : /* @__PURE__ */ React43.createElement(NonAdminDialog, { ...dialogProps });
|
|
2603
2818
|
};
|
|
2604
|
-
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */
|
|
2819
|
+
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */ React43.createElement(Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React43.createElement(DialogHeader, { logo: false }, /* @__PURE__ */ React43.createElement(DialogTitle, null, ADMIN_TITLE_TEXT)), /* @__PURE__ */ React43.createElement(Divider3, null), /* @__PURE__ */ React43.createElement(DialogContent, null, /* @__PURE__ */ React43.createElement(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(DialogActions, null, /* @__PURE__ */ React43.createElement(Button3, { size: "medium", color: "secondary", onClick: () => onClose(false) }, __13("Cancel", "elementor")), /* @__PURE__ */ React43.createElement(
|
|
2605
2820
|
Button3,
|
|
2606
2821
|
{
|
|
2607
2822
|
size: "medium",
|
|
@@ -2610,9 +2825,9 @@ var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @_
|
|
|
2610
2825
|
color: "primary",
|
|
2611
2826
|
disabled: isPending
|
|
2612
2827
|
},
|
|
2613
|
-
isPending ? /* @__PURE__ */
|
|
2828
|
+
isPending ? /* @__PURE__ */ React43.createElement(CircularProgress2, { size: 24 }) : __13("Enable", "elementor")
|
|
2614
2829
|
)));
|
|
2615
|
-
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */
|
|
2830
|
+
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */ React43.createElement(Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React43.createElement(DialogHeader, { logo: false }, /* @__PURE__ */ React43.createElement(DialogTitle, null, NON_ADMIN_TITLE_TEXT)), /* @__PURE__ */ React43.createElement(Divider3, null), /* @__PURE__ */ React43.createElement(DialogContent, null, /* @__PURE__ */ React43.createElement(DialogContentText, null, NON_ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React43.createElement(DialogActions, null, /* @__PURE__ */ React43.createElement(Button3, { size: "medium", onClick: () => onClose(false), variant: "contained", color: "primary" }, __13("Got it", "elementor"))));
|
|
2616
2831
|
|
|
2617
2832
|
// src/controls/svg-media-control.tsx
|
|
2618
2833
|
var TILE_SIZE = 8;
|
|
@@ -2673,15 +2888,15 @@ var SvgMediaControl = createControl(() => {
|
|
|
2673
2888
|
open(openOptions);
|
|
2674
2889
|
}
|
|
2675
2890
|
};
|
|
2676
|
-
return /* @__PURE__ */
|
|
2891
|
+
return /* @__PURE__ */ React44.createElement(Stack13, { 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(CircularProgress3, { role: "progressbar" }) : /* @__PURE__ */ React44.createElement(
|
|
2677
2892
|
CardMedia2,
|
|
2678
2893
|
{
|
|
2679
2894
|
component: "img",
|
|
2680
2895
|
image: src,
|
|
2681
|
-
alt:
|
|
2896
|
+
alt: __14("Preview SVG", "elementor"),
|
|
2682
2897
|
sx: { maxHeight: "140px", width: "50px" }
|
|
2683
2898
|
}
|
|
2684
|
-
)), /* @__PURE__ */
|
|
2899
|
+
)), /* @__PURE__ */ React44.createElement(
|
|
2685
2900
|
CardOverlay2,
|
|
2686
2901
|
{
|
|
2687
2902
|
sx: {
|
|
@@ -2690,7 +2905,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
2690
2905
|
}
|
|
2691
2906
|
}
|
|
2692
2907
|
},
|
|
2693
|
-
/* @__PURE__ */
|
|
2908
|
+
/* @__PURE__ */ React44.createElement(Stack13, { gap: 1 }, /* @__PURE__ */ React44.createElement(
|
|
2694
2909
|
Button4,
|
|
2695
2910
|
{
|
|
2696
2911
|
size: "tiny",
|
|
@@ -2698,46 +2913,46 @@ var SvgMediaControl = createControl(() => {
|
|
|
2698
2913
|
variant: "outlined",
|
|
2699
2914
|
onClick: () => handleClick(MODE_BROWSE)
|
|
2700
2915
|
},
|
|
2701
|
-
|
|
2702
|
-
), /* @__PURE__ */
|
|
2916
|
+
__14("Select SVG", "elementor")
|
|
2917
|
+
), /* @__PURE__ */ React44.createElement(
|
|
2703
2918
|
Button4,
|
|
2704
2919
|
{
|
|
2705
2920
|
size: "tiny",
|
|
2706
2921
|
variant: "text",
|
|
2707
2922
|
color: "inherit",
|
|
2708
|
-
startIcon: /* @__PURE__ */
|
|
2923
|
+
startIcon: /* @__PURE__ */ React44.createElement(UploadIcon2, null),
|
|
2709
2924
|
onClick: () => handleClick(MODE_UPLOAD)
|
|
2710
2925
|
},
|
|
2711
|
-
|
|
2926
|
+
__14("Upload", "elementor")
|
|
2712
2927
|
))
|
|
2713
2928
|
))));
|
|
2714
2929
|
});
|
|
2715
2930
|
|
|
2716
2931
|
// src/controls/background-control/background-control.tsx
|
|
2717
|
-
import * as
|
|
2932
|
+
import * as React51 from "react";
|
|
2718
2933
|
import { backgroundPropTypeUtil } from "@elementor/editor-props";
|
|
2719
|
-
import { isExperimentActive as
|
|
2934
|
+
import { isExperimentActive as isExperimentActive5 } from "@elementor/editor-v1-adapters";
|
|
2720
2935
|
import { Grid as Grid15 } from "@elementor/ui";
|
|
2721
|
-
import { __ as
|
|
2936
|
+
import { __ as __20 } from "@wordpress/i18n";
|
|
2722
2937
|
|
|
2723
2938
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
2724
|
-
import * as
|
|
2939
|
+
import * as React50 from "react";
|
|
2725
2940
|
import {
|
|
2726
2941
|
backgroundColorOverlayPropTypeUtil as backgroundColorOverlayPropTypeUtil2,
|
|
2727
2942
|
backgroundImageOverlayPropTypeUtil as backgroundImageOverlayPropTypeUtil2,
|
|
2728
2943
|
backgroundOverlayPropTypeUtil,
|
|
2729
2944
|
colorPropTypeUtil as colorPropTypeUtil3
|
|
2730
2945
|
} from "@elementor/editor-props";
|
|
2731
|
-
import { Box as
|
|
2946
|
+
import { Box as Box7, CardMedia as CardMedia3, styled as styled5, Tab, TabPanel, Tabs, UnstableColorIndicator as UnstableColorIndicator2 } from "@elementor/ui";
|
|
2732
2947
|
import { useWpMediaAttachment as useWpMediaAttachment3 } from "@elementor/wp-media";
|
|
2733
|
-
import { __ as
|
|
2948
|
+
import { __ as __19 } from "@wordpress/i18n";
|
|
2734
2949
|
|
|
2735
2950
|
// src/env.ts
|
|
2736
2951
|
import { parseEnv } from "@elementor/env";
|
|
2737
2952
|
var { env } = parseEnv("@elementor/editor-controls");
|
|
2738
2953
|
|
|
2739
2954
|
// src/controls/background-control/background-gradient-color-control.tsx
|
|
2740
|
-
import * as
|
|
2955
|
+
import * as React45 from "react";
|
|
2741
2956
|
import {
|
|
2742
2957
|
backgroundGradientOverlayPropTypeUtil,
|
|
2743
2958
|
colorPropTypeUtil as colorPropTypeUtil2,
|
|
@@ -2784,7 +2999,7 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
2784
2999
|
positions: positions?.value.split(" ")
|
|
2785
3000
|
};
|
|
2786
3001
|
};
|
|
2787
|
-
return /* @__PURE__ */
|
|
3002
|
+
return /* @__PURE__ */ React45.createElement(ControlActions, null, /* @__PURE__ */ React45.createElement(
|
|
2788
3003
|
UnstableGradientBox,
|
|
2789
3004
|
{
|
|
2790
3005
|
sx: { width: "auto", padding: 1.5 },
|
|
@@ -2809,53 +3024,53 @@ var initialBackgroundGradientOverlay = backgroundGradientOverlayPropTypeUtil.cre
|
|
|
2809
3024
|
});
|
|
2810
3025
|
|
|
2811
3026
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
2812
|
-
import * as
|
|
3027
|
+
import * as React46 from "react";
|
|
2813
3028
|
import { PinIcon, PinnedOffIcon } from "@elementor/icons";
|
|
2814
|
-
import { Grid as
|
|
2815
|
-
import { __ as
|
|
3029
|
+
import { Grid as Grid11 } from "@elementor/ui";
|
|
3030
|
+
import { __ as __15 } from "@wordpress/i18n";
|
|
2816
3031
|
var attachmentControlOptions = [
|
|
2817
3032
|
{
|
|
2818
3033
|
value: "fixed",
|
|
2819
|
-
label:
|
|
2820
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3034
|
+
label: __15("Fixed", "elementor"),
|
|
3035
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(PinIcon, { fontSize: size }),
|
|
2821
3036
|
showTooltip: true
|
|
2822
3037
|
},
|
|
2823
3038
|
{
|
|
2824
3039
|
value: "scroll",
|
|
2825
|
-
label:
|
|
2826
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3040
|
+
label: __15("Scroll", "elementor"),
|
|
3041
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(PinnedOffIcon, { fontSize: size }),
|
|
2827
3042
|
showTooltip: true
|
|
2828
3043
|
}
|
|
2829
3044
|
];
|
|
2830
3045
|
var BackgroundImageOverlayAttachment = () => {
|
|
2831
|
-
return /* @__PURE__ */
|
|
3046
|
+
return /* @__PURE__ */ React46.createElement(PopoverGridContainer, null, /* @__PURE__ */ React46.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(ControlFormLabel, null, __15("Attachment", "elementor"))), /* @__PURE__ */ React46.createElement(Grid11, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React46.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
2832
3047
|
};
|
|
2833
3048
|
|
|
2834
3049
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
2835
|
-
import * as
|
|
2836
|
-
import { useRef as
|
|
3050
|
+
import * as React47 from "react";
|
|
3051
|
+
import { useRef as useRef9 } from "react";
|
|
2837
3052
|
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil9 } from "@elementor/editor-props";
|
|
2838
|
-
import { MenuListItem as
|
|
3053
|
+
import { MenuListItem as MenuListItem5 } from "@elementor/editor-ui";
|
|
2839
3054
|
import { LetterXIcon, LetterYIcon } from "@elementor/icons";
|
|
2840
|
-
import { Grid as
|
|
2841
|
-
import { __ as
|
|
3055
|
+
import { Grid as Grid12, Select as Select4 } from "@elementor/ui";
|
|
3056
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
2842
3057
|
var backgroundPositionOptions = [
|
|
2843
|
-
{ label:
|
|
2844
|
-
{ label:
|
|
2845
|
-
{ label:
|
|
2846
|
-
{ label:
|
|
2847
|
-
{ label:
|
|
2848
|
-
{ label:
|
|
2849
|
-
{ label:
|
|
2850
|
-
{ label:
|
|
2851
|
-
{ label:
|
|
2852
|
-
{ label:
|
|
3058
|
+
{ label: __16("Center center", "elementor"), value: "center center" },
|
|
3059
|
+
{ label: __16("Center left", "elementor"), value: "center left" },
|
|
3060
|
+
{ label: __16("Center right", "elementor"), value: "center right" },
|
|
3061
|
+
{ label: __16("Top center", "elementor"), value: "top center" },
|
|
3062
|
+
{ label: __16("Top left", "elementor"), value: "top left" },
|
|
3063
|
+
{ label: __16("Top right", "elementor"), value: "top right" },
|
|
3064
|
+
{ label: __16("Bottom center", "elementor"), value: "bottom center" },
|
|
3065
|
+
{ label: __16("Bottom left", "elementor"), value: "bottom left" },
|
|
3066
|
+
{ label: __16("Bottom right", "elementor"), value: "bottom right" },
|
|
3067
|
+
{ label: __16("Custom", "elementor"), value: "custom" }
|
|
2853
3068
|
];
|
|
2854
3069
|
var BackgroundImageOverlayPosition = () => {
|
|
2855
3070
|
const backgroundImageOffsetContext = useBoundProp(backgroundImagePositionOffsetPropTypeUtil);
|
|
2856
3071
|
const stringPropContext = useBoundProp(stringPropTypeUtil9);
|
|
2857
3072
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
2858
|
-
const rowRef =
|
|
3073
|
+
const rowRef = useRef9(null);
|
|
2859
3074
|
const handlePositionChange = (event) => {
|
|
2860
3075
|
const value = event.target.value || null;
|
|
2861
3076
|
if (value === "custom") {
|
|
@@ -2864,8 +3079,8 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
2864
3079
|
stringPropContext.setValue(value);
|
|
2865
3080
|
}
|
|
2866
3081
|
};
|
|
2867
|
-
return /* @__PURE__ */
|
|
2868
|
-
|
|
3082
|
+
return /* @__PURE__ */ React47.createElement(Grid12, { container: true, spacing: 1.5 }, /* @__PURE__ */ React47.createElement(Grid12, { item: true, xs: 12 }, /* @__PURE__ */ React47.createElement(PopoverGridContainer, null, /* @__PURE__ */ React47.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(ControlFormLabel, null, __16("Position", "elementor"))), /* @__PURE__ */ React47.createElement(Grid12, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React47.createElement(
|
|
3083
|
+
Select4,
|
|
2869
3084
|
{
|
|
2870
3085
|
fullWidth: true,
|
|
2871
3086
|
size: "tiny",
|
|
@@ -2873,60 +3088,60 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
2873
3088
|
disabled: stringPropContext.disabled,
|
|
2874
3089
|
value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? ""
|
|
2875
3090
|
},
|
|
2876
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
2877
|
-
)))), isCustom ? /* @__PURE__ */
|
|
3091
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React47.createElement(MenuListItem5, { key: value, value: value ?? "" }, label))
|
|
3092
|
+
)))), isCustom ? /* @__PURE__ */ React47.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React47.createElement(Grid12, { item: true, xs: 12 }, /* @__PURE__ */ React47.createElement(Grid12, { container: true, spacing: 1.5, ref: rowRef }, /* @__PURE__ */ React47.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React47.createElement(
|
|
2878
3093
|
SizeControl,
|
|
2879
3094
|
{
|
|
2880
|
-
startIcon: /* @__PURE__ */
|
|
3095
|
+
startIcon: /* @__PURE__ */ React47.createElement(LetterXIcon, { fontSize: "tiny" }),
|
|
2881
3096
|
anchorRef: rowRef
|
|
2882
3097
|
}
|
|
2883
|
-
))), /* @__PURE__ */
|
|
3098
|
+
))), /* @__PURE__ */ React47.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React47.createElement(
|
|
2884
3099
|
SizeControl,
|
|
2885
3100
|
{
|
|
2886
|
-
startIcon: /* @__PURE__ */
|
|
3101
|
+
startIcon: /* @__PURE__ */ React47.createElement(LetterYIcon, { fontSize: "tiny" }),
|
|
2887
3102
|
anchorRef: rowRef
|
|
2888
3103
|
}
|
|
2889
3104
|
)))))) : null);
|
|
2890
3105
|
};
|
|
2891
3106
|
|
|
2892
3107
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
2893
|
-
import * as
|
|
3108
|
+
import * as React48 from "react";
|
|
2894
3109
|
import { DotsHorizontalIcon, DotsVerticalIcon, GridDotsIcon, XIcon as XIcon3 } from "@elementor/icons";
|
|
2895
|
-
import { Grid as
|
|
2896
|
-
import { __ as
|
|
3110
|
+
import { Grid as Grid13 } from "@elementor/ui";
|
|
3111
|
+
import { __ as __17 } from "@wordpress/i18n";
|
|
2897
3112
|
var repeatControlOptions = [
|
|
2898
3113
|
{
|
|
2899
3114
|
value: "repeat",
|
|
2900
|
-
label:
|
|
2901
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3115
|
+
label: __17("Repeat", "elementor"),
|
|
3116
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(GridDotsIcon, { fontSize: size }),
|
|
2902
3117
|
showTooltip: true
|
|
2903
3118
|
},
|
|
2904
3119
|
{
|
|
2905
3120
|
value: "repeat-x",
|
|
2906
|
-
label:
|
|
2907
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3121
|
+
label: __17("Repeat-x", "elementor"),
|
|
3122
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(DotsHorizontalIcon, { fontSize: size }),
|
|
2908
3123
|
showTooltip: true
|
|
2909
3124
|
},
|
|
2910
3125
|
{
|
|
2911
3126
|
value: "repeat-y",
|
|
2912
|
-
label:
|
|
2913
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3127
|
+
label: __17("Repeat-y", "elementor"),
|
|
3128
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(DotsVerticalIcon, { fontSize: size }),
|
|
2914
3129
|
showTooltip: true
|
|
2915
3130
|
},
|
|
2916
3131
|
{
|
|
2917
3132
|
value: "no-repeat",
|
|
2918
|
-
label:
|
|
2919
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3133
|
+
label: __17("No-repeat", "elementor"),
|
|
3134
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(XIcon3, { fontSize: size }),
|
|
2920
3135
|
showTooltip: true
|
|
2921
3136
|
}
|
|
2922
3137
|
];
|
|
2923
3138
|
var BackgroundImageOverlayRepeat = () => {
|
|
2924
|
-
return /* @__PURE__ */
|
|
3139
|
+
return /* @__PURE__ */ React48.createElement(PopoverGridContainer, null, /* @__PURE__ */ React48.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(ControlFormLabel, null, __17("Repeat", "elementor"))), /* @__PURE__ */ React48.createElement(Grid13, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React48.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
2925
3140
|
};
|
|
2926
3141
|
|
|
2927
3142
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
2928
|
-
import * as
|
|
2929
|
-
import { useRef as
|
|
3143
|
+
import * as React49 from "react";
|
|
3144
|
+
import { useRef as useRef10 } from "react";
|
|
2930
3145
|
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil10 } from "@elementor/editor-props";
|
|
2931
3146
|
import {
|
|
2932
3147
|
ArrowBarBothIcon,
|
|
@@ -2936,31 +3151,31 @@ import {
|
|
|
2936
3151
|
LetterAIcon,
|
|
2937
3152
|
PencilIcon as PencilIcon2
|
|
2938
3153
|
} from "@elementor/icons";
|
|
2939
|
-
import { Grid as
|
|
2940
|
-
import { __ as
|
|
3154
|
+
import { Grid as Grid14 } from "@elementor/ui";
|
|
3155
|
+
import { __ as __18 } from "@wordpress/i18n";
|
|
2941
3156
|
var sizeControlOptions = [
|
|
2942
3157
|
{
|
|
2943
3158
|
value: "auto",
|
|
2944
|
-
label:
|
|
2945
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3159
|
+
label: __18("Auto", "elementor"),
|
|
3160
|
+
renderContent: ({ size }) => /* @__PURE__ */ React49.createElement(LetterAIcon, { fontSize: size }),
|
|
2946
3161
|
showTooltip: true
|
|
2947
3162
|
},
|
|
2948
3163
|
{
|
|
2949
3164
|
value: "cover",
|
|
2950
|
-
label:
|
|
2951
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3165
|
+
label: __18("Cover", "elementor"),
|
|
3166
|
+
renderContent: ({ size }) => /* @__PURE__ */ React49.createElement(ArrowsMaximizeIcon, { fontSize: size }),
|
|
2952
3167
|
showTooltip: true
|
|
2953
3168
|
},
|
|
2954
3169
|
{
|
|
2955
3170
|
value: "contain",
|
|
2956
|
-
label:
|
|
2957
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3171
|
+
label: __18("Contain", "elementor"),
|
|
3172
|
+
renderContent: ({ size }) => /* @__PURE__ */ React49.createElement(ArrowBarBothIcon, { fontSize: size }),
|
|
2958
3173
|
showTooltip: true
|
|
2959
3174
|
},
|
|
2960
3175
|
{
|
|
2961
3176
|
value: "custom",
|
|
2962
|
-
label:
|
|
2963
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3177
|
+
label: __18("Custom", "elementor"),
|
|
3178
|
+
renderContent: ({ size }) => /* @__PURE__ */ React49.createElement(PencilIcon2, { fontSize: size }),
|
|
2964
3179
|
showTooltip: true
|
|
2965
3180
|
}
|
|
2966
3181
|
];
|
|
@@ -2968,7 +3183,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
2968
3183
|
const backgroundImageScaleContext = useBoundProp(backgroundImageSizeScalePropTypeUtil);
|
|
2969
3184
|
const stringPropContext = useBoundProp(stringPropTypeUtil10);
|
|
2970
3185
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
2971
|
-
const rowRef =
|
|
3186
|
+
const rowRef = useRef10(null);
|
|
2972
3187
|
const handleSizeChange = (size) => {
|
|
2973
3188
|
if (size === "custom") {
|
|
2974
3189
|
backgroundImageScaleContext.setValue({ width: null, height: null });
|
|
@@ -2976,7 +3191,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
2976
3191
|
stringPropContext.setValue(size);
|
|
2977
3192
|
}
|
|
2978
3193
|
};
|
|
2979
|
-
return /* @__PURE__ */
|
|
3194
|
+
return /* @__PURE__ */ React49.createElement(Grid14, { container: true, spacing: 1.5 }, /* @__PURE__ */ React49.createElement(Grid14, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(PopoverGridContainer, null, /* @__PURE__ */ React49.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(ControlFormLabel, null, __18("Size", "elementor"))), /* @__PURE__ */ React49.createElement(Grid14, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React49.createElement(
|
|
2980
3195
|
ControlToggleButtonGroup,
|
|
2981
3196
|
{
|
|
2982
3197
|
exclusive: true,
|
|
@@ -2985,17 +3200,17 @@ var BackgroundImageOverlaySize = () => {
|
|
|
2985
3200
|
disabled: stringPropContext.disabled,
|
|
2986
3201
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value
|
|
2987
3202
|
}
|
|
2988
|
-
)))), isCustom ? /* @__PURE__ */
|
|
3203
|
+
)))), isCustom ? /* @__PURE__ */ React49.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React49.createElement(Grid14, { item: true, xs: 12, ref: rowRef }, /* @__PURE__ */ React49.createElement(PopoverGridContainer, null, /* @__PURE__ */ React49.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React49.createElement(
|
|
2989
3204
|
SizeControl,
|
|
2990
3205
|
{
|
|
2991
|
-
startIcon: /* @__PURE__ */
|
|
3206
|
+
startIcon: /* @__PURE__ */ React49.createElement(ArrowsMoveHorizontalIcon2, { fontSize: "tiny" }),
|
|
2992
3207
|
extendedOptions: ["auto"],
|
|
2993
3208
|
anchorRef: rowRef
|
|
2994
3209
|
}
|
|
2995
|
-
))), /* @__PURE__ */
|
|
3210
|
+
))), /* @__PURE__ */ React49.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React49.createElement(
|
|
2996
3211
|
SizeControl,
|
|
2997
3212
|
{
|
|
2998
|
-
startIcon: /* @__PURE__ */
|
|
3213
|
+
startIcon: /* @__PURE__ */ React49.createElement(ArrowsMoveVerticalIcon2, { fontSize: "tiny" }),
|
|
2999
3214
|
extendedOptions: ["auto"],
|
|
3000
3215
|
anchorRef: rowRef
|
|
3001
3216
|
}
|
|
@@ -3003,7 +3218,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3003
3218
|
};
|
|
3004
3219
|
|
|
3005
3220
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
3006
|
-
import { useRef as
|
|
3221
|
+
import { useRef as useRef11 } from "react";
|
|
3007
3222
|
import {
|
|
3008
3223
|
backgroundColorOverlayPropTypeUtil,
|
|
3009
3224
|
backgroundGradientOverlayPropTypeUtil as backgroundGradientOverlayPropTypeUtil2,
|
|
@@ -3028,7 +3243,7 @@ var useBackgroundTabsHistory = ({
|
|
|
3028
3243
|
return "image";
|
|
3029
3244
|
};
|
|
3030
3245
|
const { getTabsProps, getTabProps, getTabPanelProps } = useTabs(getCurrentOverlayType());
|
|
3031
|
-
const valuesHistory =
|
|
3246
|
+
const valuesHistory = useRef11({
|
|
3032
3247
|
image: initialBackgroundImageOverlay,
|
|
3033
3248
|
color: initialBackgroundColorOverlay2,
|
|
3034
3249
|
gradient: initialBackgroundGradientOverlay2
|
|
@@ -3096,60 +3311,60 @@ var getInitialBackgroundOverlay = () => ({
|
|
|
3096
3311
|
}
|
|
3097
3312
|
});
|
|
3098
3313
|
var backgroundResolutionOptions = [
|
|
3099
|
-
{ label:
|
|
3100
|
-
{ label:
|
|
3101
|
-
{ label:
|
|
3102
|
-
{ label:
|
|
3314
|
+
{ label: __19("Thumbnail - 150 x 150", "elementor"), value: "thumbnail" },
|
|
3315
|
+
{ label: __19("Medium - 300 x 300", "elementor"), value: "medium" },
|
|
3316
|
+
{ label: __19("Large 1024 x 1024", "elementor"), value: "large" },
|
|
3317
|
+
{ label: __19("Full", "elementor"), value: "full" }
|
|
3103
3318
|
];
|
|
3104
3319
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
3105
3320
|
const { propType, value: overlayValues, setValue, disabled } = useBoundProp(backgroundOverlayPropTypeUtil);
|
|
3106
|
-
return /* @__PURE__ */
|
|
3321
|
+
return /* @__PURE__ */ React50.createElement(PropProvider, { propType, value: overlayValues, setValue, isDisabled: () => disabled }, /* @__PURE__ */ React50.createElement(
|
|
3107
3322
|
Repeater,
|
|
3108
3323
|
{
|
|
3109
3324
|
openOnAdd: true,
|
|
3110
3325
|
disabled,
|
|
3111
3326
|
values: overlayValues ?? [],
|
|
3112
3327
|
setValues: setValue,
|
|
3113
|
-
label:
|
|
3328
|
+
label: __19("Overlay", "elementor"),
|
|
3114
3329
|
itemSettings: {
|
|
3115
|
-
Icon:
|
|
3116
|
-
Label:
|
|
3117
|
-
Content:
|
|
3330
|
+
Icon: ItemIcon3,
|
|
3331
|
+
Label: ItemLabel3,
|
|
3332
|
+
Content: ItemContent3,
|
|
3118
3333
|
initialValues: getInitialBackgroundOverlay()
|
|
3119
3334
|
}
|
|
3120
3335
|
}
|
|
3121
3336
|
));
|
|
3122
3337
|
});
|
|
3123
|
-
var
|
|
3124
|
-
return /* @__PURE__ */
|
|
3338
|
+
var ItemContent3 = ({ anchorEl = null, bind }) => {
|
|
3339
|
+
return /* @__PURE__ */ React50.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React50.createElement(Content3, { anchorEl }));
|
|
3125
3340
|
};
|
|
3126
|
-
var
|
|
3341
|
+
var Content3 = ({ anchorEl }) => {
|
|
3127
3342
|
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
3128
3343
|
image: getInitialBackgroundOverlay().value,
|
|
3129
3344
|
color: initialBackgroundColorOverlay.value,
|
|
3130
3345
|
gradient: initialBackgroundGradientOverlay.value
|
|
3131
3346
|
});
|
|
3132
|
-
return /* @__PURE__ */
|
|
3347
|
+
return /* @__PURE__ */ React50.createElement(Box7, { sx: { width: "100%" } }, /* @__PURE__ */ React50.createElement(Box7, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React50.createElement(
|
|
3133
3348
|
Tabs,
|
|
3134
3349
|
{
|
|
3135
3350
|
size: "small",
|
|
3136
3351
|
variant: "fullWidth",
|
|
3137
3352
|
...getTabsProps(),
|
|
3138
|
-
"aria-label":
|
|
3353
|
+
"aria-label": __19("Background Overlay", "elementor")
|
|
3139
3354
|
},
|
|
3140
|
-
/* @__PURE__ */
|
|
3141
|
-
/* @__PURE__ */
|
|
3142
|
-
/* @__PURE__ */
|
|
3143
|
-
)), /* @__PURE__ */
|
|
3355
|
+
/* @__PURE__ */ React50.createElement(Tab, { label: __19("Image", "elementor"), ...getTabProps("image") }),
|
|
3356
|
+
/* @__PURE__ */ React50.createElement(Tab, { label: __19("Gradient", "elementor"), ...getTabProps("gradient") }),
|
|
3357
|
+
/* @__PURE__ */ React50.createElement(Tab, { label: __19("Color", "elementor"), ...getTabProps("color") })
|
|
3358
|
+
)), /* @__PURE__ */ React50.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React50.createElement(PopoverContent, null, /* @__PURE__ */ React50.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React50.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("gradient") }, /* @__PURE__ */ React50.createElement(BackgroundGradientColorControl, null)), /* @__PURE__ */ React50.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("color") }, /* @__PURE__ */ React50.createElement(PopoverContent, null, /* @__PURE__ */ React50.createElement(ColorOverlayContent, { anchorEl }))));
|
|
3144
3359
|
};
|
|
3145
|
-
var
|
|
3360
|
+
var ItemIcon3 = ({ value }) => {
|
|
3146
3361
|
switch (value.$$type) {
|
|
3147
3362
|
case "background-image-overlay":
|
|
3148
|
-
return /* @__PURE__ */
|
|
3363
|
+
return /* @__PURE__ */ React50.createElement(ItemIconImage, { value });
|
|
3149
3364
|
case "background-color-overlay":
|
|
3150
|
-
return /* @__PURE__ */
|
|
3365
|
+
return /* @__PURE__ */ React50.createElement(ItemIconColor, { value });
|
|
3151
3366
|
case "background-gradient-overlay":
|
|
3152
|
-
return /* @__PURE__ */
|
|
3367
|
+
return /* @__PURE__ */ React50.createElement(ItemIconGradient, { value });
|
|
3153
3368
|
default:
|
|
3154
3369
|
return null;
|
|
3155
3370
|
}
|
|
@@ -3162,11 +3377,11 @@ var extractColorFrom = (prop) => {
|
|
|
3162
3377
|
};
|
|
3163
3378
|
var ItemIconColor = ({ value: prop }) => {
|
|
3164
3379
|
const color = extractColorFrom(prop);
|
|
3165
|
-
return /* @__PURE__ */
|
|
3380
|
+
return /* @__PURE__ */ React50.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: color });
|
|
3166
3381
|
};
|
|
3167
3382
|
var ItemIconImage = ({ value }) => {
|
|
3168
3383
|
const { imageUrl } = useImage(value);
|
|
3169
|
-
return /* @__PURE__ */
|
|
3384
|
+
return /* @__PURE__ */ React50.createElement(
|
|
3170
3385
|
CardMedia3,
|
|
3171
3386
|
{
|
|
3172
3387
|
image: imageUrl,
|
|
@@ -3181,47 +3396,41 @@ var ItemIconImage = ({ value }) => {
|
|
|
3181
3396
|
};
|
|
3182
3397
|
var ItemIconGradient = ({ value }) => {
|
|
3183
3398
|
const gradient = getGradientValue(value);
|
|
3184
|
-
return /* @__PURE__ */
|
|
3399
|
+
return /* @__PURE__ */ React50.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: gradient });
|
|
3185
3400
|
};
|
|
3186
|
-
var
|
|
3401
|
+
var ItemLabel3 = ({ value }) => {
|
|
3187
3402
|
switch (value.$$type) {
|
|
3188
3403
|
case "background-image-overlay":
|
|
3189
|
-
return /* @__PURE__ */
|
|
3404
|
+
return /* @__PURE__ */ React50.createElement(ItemLabelImage, { value });
|
|
3190
3405
|
case "background-color-overlay":
|
|
3191
|
-
return /* @__PURE__ */
|
|
3406
|
+
return /* @__PURE__ */ React50.createElement(ItemLabelColor, { value });
|
|
3192
3407
|
case "background-gradient-overlay":
|
|
3193
|
-
return /* @__PURE__ */
|
|
3408
|
+
return /* @__PURE__ */ React50.createElement(ItemLabelGradient, { value });
|
|
3194
3409
|
default:
|
|
3195
3410
|
return null;
|
|
3196
3411
|
}
|
|
3197
3412
|
};
|
|
3198
3413
|
var ItemLabelColor = ({ value: prop }) => {
|
|
3199
3414
|
const color = extractColorFrom(prop);
|
|
3200
|
-
return /* @__PURE__ */
|
|
3415
|
+
return /* @__PURE__ */ React50.createElement("span", null, color);
|
|
3201
3416
|
};
|
|
3202
3417
|
var ItemLabelImage = ({ value }) => {
|
|
3203
3418
|
const { imageTitle } = useImage(value);
|
|
3204
|
-
return /* @__PURE__ */
|
|
3419
|
+
return /* @__PURE__ */ React50.createElement("span", null, imageTitle);
|
|
3205
3420
|
};
|
|
3206
3421
|
var ItemLabelGradient = ({ value }) => {
|
|
3207
3422
|
if (value.value.type.value === "linear") {
|
|
3208
|
-
return /* @__PURE__ */
|
|
3423
|
+
return /* @__PURE__ */ React50.createElement("span", null, __19("Linear Gradient", "elementor"));
|
|
3209
3424
|
}
|
|
3210
|
-
return /* @__PURE__ */
|
|
3425
|
+
return /* @__PURE__ */ React50.createElement("span", null, __19("Radial Gradient", "elementor"));
|
|
3211
3426
|
};
|
|
3212
3427
|
var ColorOverlayContent = ({ anchorEl }) => {
|
|
3213
3428
|
const propContext = useBoundProp(backgroundColorOverlayPropTypeUtil2);
|
|
3214
|
-
return /* @__PURE__ */
|
|
3429
|
+
return /* @__PURE__ */ React50.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React50.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React50.createElement(ColorControl, { anchorEl })));
|
|
3215
3430
|
};
|
|
3216
3431
|
var ImageOverlayContent = () => {
|
|
3217
3432
|
const propContext = useBoundProp(backgroundImageOverlayPropTypeUtil2);
|
|
3218
|
-
return /* @__PURE__ */
|
|
3219
|
-
ImageControl,
|
|
3220
|
-
{
|
|
3221
|
-
resolutionLabel: __18("Resolution", "elementor"),
|
|
3222
|
-
sizes: backgroundResolutionOptions
|
|
3223
|
-
}
|
|
3224
|
-
)))), /* @__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)));
|
|
3433
|
+
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)));
|
|
3225
3434
|
};
|
|
3226
3435
|
var StyledUnstableColorIndicator = styled5(UnstableColorIndicator2)(({ theme }) => ({
|
|
3227
3436
|
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
@@ -3259,28 +3468,16 @@ var getGradientValue = (value) => {
|
|
|
3259
3468
|
// src/controls/background-control/background-control.tsx
|
|
3260
3469
|
var BackgroundControl = createControl(() => {
|
|
3261
3470
|
const propContext = useBoundProp(backgroundPropTypeUtil);
|
|
3262
|
-
const isUsingNestedProps =
|
|
3263
|
-
const colorLabel =
|
|
3264
|
-
return /* @__PURE__ */
|
|
3265
|
-
});
|
|
3266
|
-
|
|
3267
|
-
// src/controls/switch-control.tsx
|
|
3268
|
-
import * as React50 from "react";
|
|
3269
|
-
import { booleanPropTypeUtil as booleanPropTypeUtil2 } from "@elementor/editor-props";
|
|
3270
|
-
import { Switch as Switch2 } from "@elementor/ui";
|
|
3271
|
-
var SwitchControl2 = createControl(() => {
|
|
3272
|
-
const { value, setValue, disabled } = useBoundProp(booleanPropTypeUtil2);
|
|
3273
|
-
const handleChange = (event) => {
|
|
3274
|
-
setValue(event.target.checked);
|
|
3275
|
-
};
|
|
3276
|
-
return /* @__PURE__ */ React50.createElement("div", { style: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React50.createElement(Switch2, { checked: !!value, onChange: handleChange, size: "small", disabled }));
|
|
3471
|
+
const isUsingNestedProps = isExperimentActive5("e_v_3_30");
|
|
3472
|
+
const colorLabel = __20("Color", "elementor");
|
|
3473
|
+
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(Grid15, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React51.createElement(Grid15, { item: true, xs: 6 }, isUsingNestedProps ? /* @__PURE__ */ React51.createElement(ControlLabel, null, colorLabel) : /* @__PURE__ */ React51.createElement(ControlFormLabel, null, colorLabel)), /* @__PURE__ */ React51.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(ColorControl, null)))));
|
|
3277
3474
|
});
|
|
3278
3475
|
|
|
3279
3476
|
// src/controls/repeatable-control.tsx
|
|
3280
|
-
import * as
|
|
3477
|
+
import * as React52 from "react";
|
|
3281
3478
|
import { useMemo as useMemo4 } from "react";
|
|
3282
3479
|
import { createArrayPropUtils } from "@elementor/editor-props";
|
|
3283
|
-
import {
|
|
3480
|
+
import { Box as Box8 } from "@elementor/ui";
|
|
3284
3481
|
|
|
3285
3482
|
// src/hooks/use-repeatable-control-context.ts
|
|
3286
3483
|
import { createContext as createContext6, useContext as useContext6 } from "react";
|
|
@@ -3295,7 +3492,15 @@ var useRepeatableControlContext = () => {
|
|
|
3295
3492
|
|
|
3296
3493
|
// src/controls/repeatable-control.tsx
|
|
3297
3494
|
var RepeatableControl = createControl(
|
|
3298
|
-
({
|
|
3495
|
+
({
|
|
3496
|
+
repeaterLabel,
|
|
3497
|
+
childControlConfig,
|
|
3498
|
+
showDuplicate,
|
|
3499
|
+
showToggle,
|
|
3500
|
+
initialValues,
|
|
3501
|
+
patternLabel,
|
|
3502
|
+
placeholder
|
|
3503
|
+
}) => {
|
|
3299
3504
|
const { propTypeUtil: childPropTypeUtil } = childControlConfig;
|
|
3300
3505
|
if (!childPropTypeUtil) {
|
|
3301
3506
|
return null;
|
|
@@ -3304,19 +3509,28 @@ var RepeatableControl = createControl(
|
|
|
3304
3509
|
() => createArrayPropUtils(childPropTypeUtil.key, childPropTypeUtil.schema),
|
|
3305
3510
|
[childPropTypeUtil.key, childPropTypeUtil.schema]
|
|
3306
3511
|
);
|
|
3512
|
+
const contextValue = useMemo4(
|
|
3513
|
+
() => ({
|
|
3514
|
+
...childControlConfig,
|
|
3515
|
+
placeholder: placeholder || "",
|
|
3516
|
+
patternLabel: patternLabel || ""
|
|
3517
|
+
}),
|
|
3518
|
+
[childControlConfig, placeholder, patternLabel]
|
|
3519
|
+
);
|
|
3307
3520
|
const { propType, value, setValue } = useBoundProp(childArrayPropTypeUtil);
|
|
3308
|
-
return /* @__PURE__ */
|
|
3521
|
+
return /* @__PURE__ */ React52.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React52.createElement(RepeatableControlContext.Provider, { value: contextValue }, /* @__PURE__ */ React52.createElement(
|
|
3309
3522
|
Repeater,
|
|
3310
3523
|
{
|
|
3311
3524
|
openOnAdd: true,
|
|
3312
3525
|
values: value ?? [],
|
|
3313
3526
|
setValues: setValue,
|
|
3314
|
-
label,
|
|
3527
|
+
label: repeaterLabel,
|
|
3528
|
+
isSortable: false,
|
|
3315
3529
|
itemSettings: {
|
|
3316
|
-
Icon:
|
|
3317
|
-
Label:
|
|
3318
|
-
Content:
|
|
3319
|
-
initialValues: childPropTypeUtil.create(null)
|
|
3530
|
+
Icon: ItemIcon4,
|
|
3531
|
+
Label: ItemLabel4,
|
|
3532
|
+
Content: ItemContent4,
|
|
3533
|
+
initialValues: childPropTypeUtil.create(initialValues || null)
|
|
3320
3534
|
},
|
|
3321
3535
|
showDuplicate,
|
|
3322
3536
|
showToggle
|
|
@@ -3324,21 +3538,66 @@ var RepeatableControl = createControl(
|
|
|
3324
3538
|
)));
|
|
3325
3539
|
}
|
|
3326
3540
|
);
|
|
3327
|
-
var
|
|
3328
|
-
return /* @__PURE__ */
|
|
3541
|
+
var ItemContent4 = ({ bind }) => {
|
|
3542
|
+
return /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React52.createElement(Content4, null));
|
|
3329
3543
|
};
|
|
3330
|
-
var
|
|
3331
|
-
var
|
|
3544
|
+
var ItemIcon4 = () => /* @__PURE__ */ React52.createElement(React52.Fragment, null);
|
|
3545
|
+
var Content4 = () => {
|
|
3332
3546
|
const { component: ChildControl, props = {} } = useRepeatableControlContext();
|
|
3333
|
-
return /* @__PURE__ */
|
|
3547
|
+
return /* @__PURE__ */ React52.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React52.createElement(PopoverGridContainer, null, /* @__PURE__ */ React52.createElement(ChildControl, { ...props })));
|
|
3548
|
+
};
|
|
3549
|
+
var interpolate = (template, data) => {
|
|
3550
|
+
if (!data) {
|
|
3551
|
+
return template;
|
|
3552
|
+
}
|
|
3553
|
+
return new Function(...Object.keys(data), `return \`${template}\`;`)(...Object.values(data));
|
|
3334
3554
|
};
|
|
3335
|
-
var
|
|
3336
|
-
|
|
3337
|
-
|
|
3555
|
+
var getNestedValue = (obj, path) => {
|
|
3556
|
+
return path.split(".").reduce((current, key) => current?.[key], obj);
|
|
3557
|
+
};
|
|
3558
|
+
var isEmptyValue = (val) => {
|
|
3559
|
+
if (typeof val === "string") {
|
|
3560
|
+
return val.trim() === "";
|
|
3561
|
+
}
|
|
3562
|
+
if (Number.isNaN(val)) {
|
|
3563
|
+
return true;
|
|
3564
|
+
}
|
|
3565
|
+
if (Array.isArray(val)) {
|
|
3566
|
+
return val.length === 0;
|
|
3567
|
+
}
|
|
3568
|
+
if (typeof val === "object" && val !== null && Object.keys(val).length === 0) {
|
|
3569
|
+
return true;
|
|
3570
|
+
}
|
|
3571
|
+
return false;
|
|
3572
|
+
};
|
|
3573
|
+
var shouldShowPlaceholder = (pattern, data) => {
|
|
3574
|
+
const propertyPaths = getAllProperties(pattern);
|
|
3575
|
+
const values = propertyPaths.map((path) => getNestedValue(data, path));
|
|
3576
|
+
if (values.length === 0) {
|
|
3577
|
+
return false;
|
|
3578
|
+
}
|
|
3579
|
+
if (values.some((value) => value === null || value === void 0)) {
|
|
3580
|
+
return true;
|
|
3581
|
+
}
|
|
3582
|
+
if (values.every(isEmptyValue)) {
|
|
3583
|
+
return true;
|
|
3584
|
+
}
|
|
3585
|
+
return false;
|
|
3586
|
+
};
|
|
3587
|
+
var ItemLabel4 = ({ value }) => {
|
|
3588
|
+
const { placeholder, patternLabel } = useRepeatableControlContext();
|
|
3589
|
+
const label = shouldShowPlaceholder(patternLabel, value) ? placeholder : interpolate(patternLabel, value);
|
|
3590
|
+
return /* @__PURE__ */ React52.createElement(Box8, { component: "span", color: "text.tertiary" }, label);
|
|
3591
|
+
};
|
|
3592
|
+
var getAllProperties = (pattern) => {
|
|
3593
|
+
const properties = pattern.match(/\$\{([^}]+)\}/g)?.map(
|
|
3594
|
+
(match) => match.slice(2, -1)
|
|
3595
|
+
) || [];
|
|
3596
|
+
return properties;
|
|
3338
3597
|
};
|
|
3339
3598
|
|
|
3340
3599
|
// src/controls/key-value-control.tsx
|
|
3341
|
-
import * as
|
|
3600
|
+
import * as React53 from "react";
|
|
3342
3601
|
import { useMemo as useMemo5, useState as useState11 } from "react";
|
|
3343
3602
|
import { keyValuePropTypeUtil } from "@elementor/editor-props";
|
|
3344
3603
|
import { FormHelperText, FormLabel as FormLabel3, Grid as Grid16, TextField as TextField9 } from "@elementor/ui";
|
|
@@ -3347,10 +3606,12 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
3347
3606
|
const { value, setValue } = useBoundProp(keyValuePropTypeUtil);
|
|
3348
3607
|
const [keyError, setKeyError] = useState11(null);
|
|
3349
3608
|
const [valueError, setValueError] = useState11(null);
|
|
3609
|
+
const [sessionState, setSessionState] = useState11({
|
|
3610
|
+
key: value?.key?.value || "",
|
|
3611
|
+
value: value?.value?.value || ""
|
|
3612
|
+
});
|
|
3350
3613
|
const keyLabel = props.keyName || __21("Key", "elementor");
|
|
3351
3614
|
const valueLabel = props.valueName || __21("Value", "elementor");
|
|
3352
|
-
const keyValue = value?.key?.value || "";
|
|
3353
|
-
const valueValue = value?.value?.value || "";
|
|
3354
3615
|
const [keyRegex, valueRegex, errMsg] = useMemo5(
|
|
3355
3616
|
() => [
|
|
3356
3617
|
props.regexKey ? new RegExp(props.regexKey) : void 0,
|
|
@@ -3359,60 +3620,77 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
3359
3620
|
],
|
|
3360
3621
|
[props.regexKey, props.regexValue, props.validationErrorMessage]
|
|
3361
3622
|
);
|
|
3362
|
-
const validate = (newValue,
|
|
3363
|
-
if (
|
|
3623
|
+
const validate = (newValue, fieldType) => {
|
|
3624
|
+
if (fieldType === "key" && keyRegex) {
|
|
3364
3625
|
const isValid = keyRegex.test(newValue);
|
|
3365
3626
|
setKeyError(isValid ? null : errMsg);
|
|
3366
|
-
|
|
3627
|
+
return isValid;
|
|
3628
|
+
} else if (fieldType === "value" && valueRegex) {
|
|
3367
3629
|
const isValid = valueRegex.test(newValue);
|
|
3368
3630
|
setValueError(isValid ? null : errMsg);
|
|
3631
|
+
return isValid;
|
|
3369
3632
|
}
|
|
3633
|
+
return true;
|
|
3370
3634
|
};
|
|
3371
3635
|
const handleChange = (event, fieldType) => {
|
|
3372
3636
|
const newValue = event.target.value;
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3637
|
+
setSessionState((prev) => ({
|
|
3638
|
+
...prev,
|
|
3639
|
+
[fieldType]: newValue
|
|
3640
|
+
}));
|
|
3641
|
+
if (validate(newValue, fieldType)) {
|
|
3642
|
+
setValue({
|
|
3643
|
+
...value,
|
|
3644
|
+
[fieldType]: {
|
|
3645
|
+
value: newValue,
|
|
3646
|
+
$$type: "string"
|
|
3647
|
+
}
|
|
3648
|
+
});
|
|
3649
|
+
} else {
|
|
3650
|
+
setValue({
|
|
3651
|
+
...value,
|
|
3652
|
+
[fieldType]: {
|
|
3653
|
+
value: "",
|
|
3654
|
+
$$type: "string"
|
|
3655
|
+
}
|
|
3656
|
+
});
|
|
3657
|
+
}
|
|
3381
3658
|
};
|
|
3382
3659
|
const isKeyInvalid = keyError !== null;
|
|
3383
3660
|
const isValueInvalid = valueError !== null;
|
|
3384
|
-
return /* @__PURE__ */
|
|
3661
|
+
return /* @__PURE__ */ React53.createElement(ControlActions, null, /* @__PURE__ */ React53.createElement(Grid16, { container: true, gap: 1.5 }, /* @__PURE__ */ React53.createElement(Grid16, { item: true, xs: 12 }, /* @__PURE__ */ React53.createElement(FormLabel3, { size: "tiny" }, keyLabel), /* @__PURE__ */ React53.createElement(
|
|
3385
3662
|
TextField9,
|
|
3386
3663
|
{
|
|
3664
|
+
autoFocus: true,
|
|
3387
3665
|
sx: { pt: 1 },
|
|
3388
3666
|
size: "tiny",
|
|
3389
3667
|
fullWidth: true,
|
|
3390
|
-
value:
|
|
3668
|
+
value: sessionState.key,
|
|
3391
3669
|
onChange: (e) => handleChange(e, "key"),
|
|
3392
3670
|
error: isKeyInvalid
|
|
3393
3671
|
}
|
|
3394
|
-
), isKeyInvalid && /* @__PURE__ */
|
|
3672
|
+
), isKeyInvalid && /* @__PURE__ */ React53.createElement(FormHelperText, { error: true }, keyError)), /* @__PURE__ */ React53.createElement(Grid16, { item: true, xs: 12 }, /* @__PURE__ */ React53.createElement(FormLabel3, { size: "tiny" }, valueLabel), /* @__PURE__ */ React53.createElement(
|
|
3395
3673
|
TextField9,
|
|
3396
3674
|
{
|
|
3397
3675
|
sx: { pt: 1 },
|
|
3398
3676
|
size: "tiny",
|
|
3399
3677
|
fullWidth: true,
|
|
3400
|
-
value:
|
|
3678
|
+
value: sessionState.value,
|
|
3401
3679
|
onChange: (e) => handleChange(e, "value"),
|
|
3402
3680
|
disabled: isKeyInvalid,
|
|
3403
3681
|
error: isValueInvalid
|
|
3404
3682
|
}
|
|
3405
|
-
), isValueInvalid && /* @__PURE__ */
|
|
3683
|
+
), isValueInvalid && /* @__PURE__ */ React53.createElement(FormHelperText, { error: true }, valueError))));
|
|
3406
3684
|
});
|
|
3407
3685
|
|
|
3408
3686
|
// src/controls/position-control.tsx
|
|
3409
|
-
import * as
|
|
3687
|
+
import * as React54 from "react";
|
|
3410
3688
|
import { useMemo as useMemo6 } from "react";
|
|
3411
3689
|
import { positionPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil11 } from "@elementor/editor-props";
|
|
3412
|
-
import { MenuListItem as
|
|
3413
|
-
import { isExperimentActive as
|
|
3690
|
+
import { MenuListItem as MenuListItem6 } from "@elementor/editor-ui";
|
|
3691
|
+
import { isExperimentActive as isExperimentActive6 } from "@elementor/editor-v1-adapters";
|
|
3414
3692
|
import { LetterXIcon as LetterXIcon2, LetterYIcon as LetterYIcon2 } from "@elementor/icons";
|
|
3415
|
-
import { Grid as Grid17, Select as
|
|
3693
|
+
import { Grid as Grid17, Select as Select5 } from "@elementor/ui";
|
|
3416
3694
|
import { __ as __22 } from "@wordpress/i18n";
|
|
3417
3695
|
var positionOptions = [
|
|
3418
3696
|
{ label: __22("Center center", "elementor"), value: "center center" },
|
|
@@ -3428,7 +3706,7 @@ var positionOptions = [
|
|
|
3428
3706
|
var PositionControl = () => {
|
|
3429
3707
|
const positionContext = useBoundProp(positionPropTypeUtil);
|
|
3430
3708
|
const stringPropContext = useBoundProp(stringPropTypeUtil11);
|
|
3431
|
-
const isVersion331Active =
|
|
3709
|
+
const isVersion331Active = isExperimentActive6("e_v_3_31");
|
|
3432
3710
|
const isCustom = !!positionContext.value && isVersion331Active;
|
|
3433
3711
|
const availablePositionOptions = useMemo6(() => {
|
|
3434
3712
|
const options = [...positionOptions];
|
|
@@ -3445,8 +3723,8 @@ var PositionControl = () => {
|
|
|
3445
3723
|
stringPropContext.setValue(value);
|
|
3446
3724
|
}
|
|
3447
3725
|
};
|
|
3448
|
-
return /* @__PURE__ */
|
|
3449
|
-
|
|
3726
|
+
return /* @__PURE__ */ React54.createElement(Grid17, { container: true, spacing: 1.5 }, /* @__PURE__ */ React54.createElement(Grid17, { item: true, xs: 12 }, /* @__PURE__ */ React54.createElement(Grid17, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React54.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(ControlFormLabel, null, __22("Object position", "elementor"))), /* @__PURE__ */ React54.createElement(Grid17, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React54.createElement(
|
|
3727
|
+
Select5,
|
|
3450
3728
|
{
|
|
3451
3729
|
size: "tiny",
|
|
3452
3730
|
disabled: stringPropContext.disabled,
|
|
@@ -3454,9 +3732,133 @@ var PositionControl = () => {
|
|
|
3454
3732
|
onChange: handlePositionChange,
|
|
3455
3733
|
fullWidth: true
|
|
3456
3734
|
},
|
|
3457
|
-
availablePositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
3458
|
-
)))), isCustom && /* @__PURE__ */
|
|
3735
|
+
availablePositionOptions.map(({ label, value }) => /* @__PURE__ */ React54.createElement(MenuListItem6, { key: value, value: value ?? "" }, label))
|
|
3736
|
+
)))), isCustom && /* @__PURE__ */ React54.createElement(PropProvider, { ...positionContext }, /* @__PURE__ */ React54.createElement(Grid17, { item: true, xs: 12 }, /* @__PURE__ */ React54.createElement(Grid17, { container: true, spacing: 1.5 }, /* @__PURE__ */ React54.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React54.createElement(SizeControl, { startIcon: /* @__PURE__ */ React54.createElement(LetterXIcon2, { fontSize: "tiny" }) }))), /* @__PURE__ */ React54.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React54.createElement(SizeControl, { startIcon: /* @__PURE__ */ React54.createElement(LetterYIcon2, { fontSize: "tiny" }) })))))));
|
|
3737
|
+
};
|
|
3738
|
+
|
|
3739
|
+
// src/controls/transform-control/transform-repeater-control.tsx
|
|
3740
|
+
import * as React60 from "react";
|
|
3741
|
+
import { transformPropTypeUtil } from "@elementor/editor-props";
|
|
3742
|
+
import { __ as __26 } from "@wordpress/i18n";
|
|
3743
|
+
|
|
3744
|
+
// src/controls/transform-control/transform-content.tsx
|
|
3745
|
+
import * as React57 from "react";
|
|
3746
|
+
import { Box as Box9, Tab as Tab2, TabPanel as TabPanel2, Tabs as Tabs2, useTabs as useTabs2 } from "@elementor/ui";
|
|
3747
|
+
import { __ as __24 } from "@wordpress/i18n";
|
|
3748
|
+
|
|
3749
|
+
// src/controls/transform-control/functions/move.tsx
|
|
3750
|
+
import * as React56 from "react";
|
|
3751
|
+
import { useRef as useRef12 } from "react";
|
|
3752
|
+
import { moveTransformPropTypeUtil } from "@elementor/editor-props";
|
|
3753
|
+
import { ArrowDownLeftIcon, ArrowDownSmallIcon, ArrowRightIcon } from "@elementor/icons";
|
|
3754
|
+
import { Grid as Grid19 } from "@elementor/ui";
|
|
3755
|
+
import { __ as __23 } from "@wordpress/i18n";
|
|
3756
|
+
|
|
3757
|
+
// src/controls/transform-control/functions/axis-row.tsx
|
|
3758
|
+
import * as React55 from "react";
|
|
3759
|
+
import { Grid as Grid18 } from "@elementor/ui";
|
|
3760
|
+
var AxisRow = ({ label, bindValue, startIcon, anchorRef }) => {
|
|
3761
|
+
return /* @__PURE__ */ React55.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React55.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ React55.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React55.createElement(ControlLabel, null, label)), /* @__PURE__ */ React55.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React55.createElement(PropKeyProvider, { bind: bindValue }, /* @__PURE__ */ React55.createElement(SizeControl, { anchorRef, startIcon })))));
|
|
3459
3762
|
};
|
|
3763
|
+
|
|
3764
|
+
// src/controls/transform-control/functions/move.tsx
|
|
3765
|
+
var moveAxisControls = [
|
|
3766
|
+
{
|
|
3767
|
+
label: __23("Move X", "elementor"),
|
|
3768
|
+
bindValue: "x",
|
|
3769
|
+
startIcon: /* @__PURE__ */ React56.createElement(ArrowRightIcon, { fontSize: "tiny" })
|
|
3770
|
+
},
|
|
3771
|
+
{
|
|
3772
|
+
label: __23("Move Y", "elementor"),
|
|
3773
|
+
bindValue: "y",
|
|
3774
|
+
startIcon: /* @__PURE__ */ React56.createElement(ArrowDownSmallIcon, { fontSize: "tiny" })
|
|
3775
|
+
},
|
|
3776
|
+
{
|
|
3777
|
+
label: __23("Move Z", "elementor"),
|
|
3778
|
+
bindValue: "z",
|
|
3779
|
+
startIcon: /* @__PURE__ */ React56.createElement(ArrowDownLeftIcon, { fontSize: "tiny" })
|
|
3780
|
+
}
|
|
3781
|
+
];
|
|
3782
|
+
var Move = () => {
|
|
3783
|
+
const context = useBoundProp(moveTransformPropTypeUtil);
|
|
3784
|
+
const rowRef = useRef12(null);
|
|
3785
|
+
return /* @__PURE__ */ React56.createElement(Grid19, { 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 })))));
|
|
3786
|
+
};
|
|
3787
|
+
|
|
3788
|
+
// src/controls/transform-control/transform-content.tsx
|
|
3789
|
+
var TransformContent = ({ bind }) => {
|
|
3790
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = useTabs2("transform-move");
|
|
3791
|
+
return /* @__PURE__ */ React57.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React57.createElement(PopoverContent, null, /* @__PURE__ */ React57.createElement(Box9, { sx: { width: "100%" } }, /* @__PURE__ */ React57.createElement(Box9, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React57.createElement(
|
|
3792
|
+
Tabs2,
|
|
3793
|
+
{
|
|
3794
|
+
size: "small",
|
|
3795
|
+
variant: "fullWidth",
|
|
3796
|
+
...getTabsProps(),
|
|
3797
|
+
"aria-label": __24("Transform", "elementor")
|
|
3798
|
+
},
|
|
3799
|
+
/* @__PURE__ */ React57.createElement(Tab2, { label: __24("Move", "elementor"), ...getTabProps("transform-move") })
|
|
3800
|
+
)), /* @__PURE__ */ React57.createElement(TabPanel2, { sx: { p: 1.5 }, ...getTabPanelProps("transform-move") }, /* @__PURE__ */ React57.createElement(Move, null)))));
|
|
3801
|
+
};
|
|
3802
|
+
|
|
3803
|
+
// src/controls/transform-control/transform-icon.tsx
|
|
3804
|
+
import * as React58 from "react";
|
|
3805
|
+
import { ArrowsMaximizeIcon as ArrowsMaximizeIcon2 } from "@elementor/icons";
|
|
3806
|
+
var TransformIcon = ({ value }) => {
|
|
3807
|
+
switch (value.$$type) {
|
|
3808
|
+
case "transform-move":
|
|
3809
|
+
return /* @__PURE__ */ React58.createElement(ArrowsMaximizeIcon2, { fontSize: "tiny" });
|
|
3810
|
+
default:
|
|
3811
|
+
return null;
|
|
3812
|
+
}
|
|
3813
|
+
};
|
|
3814
|
+
|
|
3815
|
+
// src/controls/transform-control/transform-label.tsx
|
|
3816
|
+
import * as React59 from "react";
|
|
3817
|
+
import { Box as Box10 } from "@elementor/ui";
|
|
3818
|
+
import { __ as __25 } from "@wordpress/i18n";
|
|
3819
|
+
var transformMoveValue = (value) => Object.values(value).map((axis) => `${axis?.value.size}${axis?.value.unit}`).join(", ");
|
|
3820
|
+
var TransformLabel = (props) => {
|
|
3821
|
+
const { $$type, value } = props.value;
|
|
3822
|
+
switch ($$type) {
|
|
3823
|
+
case "transform-move":
|
|
3824
|
+
return /* @__PURE__ */ React59.createElement(Label2, { label: __25("Move", "elementor"), value: transformMoveValue(value) });
|
|
3825
|
+
default:
|
|
3826
|
+
return "";
|
|
3827
|
+
}
|
|
3828
|
+
};
|
|
3829
|
+
var Label2 = ({ label, value }) => {
|
|
3830
|
+
return /* @__PURE__ */ React59.createElement(Box10, { component: "span" }, label, ": ", value);
|
|
3831
|
+
};
|
|
3832
|
+
|
|
3833
|
+
// src/controls/transform-control/transform-repeater-control.tsx
|
|
3834
|
+
var initialTransformValue = {
|
|
3835
|
+
$$type: "transform-move",
|
|
3836
|
+
value: {
|
|
3837
|
+
x: { $$type: "size", value: { size: 0, unit: "px" } },
|
|
3838
|
+
y: { $$type: "size", value: { size: 0, unit: "px" } },
|
|
3839
|
+
z: { $$type: "size", value: { size: 0, unit: "px" } }
|
|
3840
|
+
}
|
|
3841
|
+
};
|
|
3842
|
+
var TransformRepeaterControl = createControl(() => {
|
|
3843
|
+
const { propType, value: transformValues, setValue, disabled } = useBoundProp(transformPropTypeUtil);
|
|
3844
|
+
return /* @__PURE__ */ React60.createElement(PropProvider, { propType, value: transformValues, setValue }, /* @__PURE__ */ React60.createElement(
|
|
3845
|
+
Repeater,
|
|
3846
|
+
{
|
|
3847
|
+
openOnAdd: true,
|
|
3848
|
+
disabled,
|
|
3849
|
+
values: transformValues ?? [],
|
|
3850
|
+
setValues: setValue,
|
|
3851
|
+
label: __26("Transform", "elementor"),
|
|
3852
|
+
showDuplicate: false,
|
|
3853
|
+
itemSettings: {
|
|
3854
|
+
Icon: TransformIcon,
|
|
3855
|
+
Label: TransformLabel,
|
|
3856
|
+
Content: TransformContent,
|
|
3857
|
+
initialValues: initialTransformValue
|
|
3858
|
+
}
|
|
3859
|
+
}
|
|
3860
|
+
));
|
|
3861
|
+
});
|
|
3460
3862
|
export {
|
|
3461
3863
|
AspectRatioControl,
|
|
3462
3864
|
BackgroundControl,
|
|
@@ -3469,6 +3871,7 @@ export {
|
|
|
3469
3871
|
ControlReplacementsProvider,
|
|
3470
3872
|
ControlToggleButtonGroup,
|
|
3471
3873
|
EqualUnequalSizesControl,
|
|
3874
|
+
FilterRepeaterControl,
|
|
3472
3875
|
FontFamilyControl,
|
|
3473
3876
|
FontFamilySelector,
|
|
3474
3877
|
GapControl,
|
|
@@ -3477,6 +3880,7 @@ export {
|
|
|
3477
3880
|
LinkControl,
|
|
3478
3881
|
LinkedDimensionsControl,
|
|
3479
3882
|
NumberControl,
|
|
3883
|
+
PopoverContent,
|
|
3480
3884
|
PositionControl,
|
|
3481
3885
|
PropKeyProvider,
|
|
3482
3886
|
PropProvider,
|
|
@@ -3485,10 +3889,11 @@ export {
|
|
|
3485
3889
|
SizeControl,
|
|
3486
3890
|
StrokeControl,
|
|
3487
3891
|
SvgMediaControl,
|
|
3488
|
-
|
|
3892
|
+
SwitchControl,
|
|
3489
3893
|
TextAreaControl,
|
|
3490
3894
|
TextControl,
|
|
3491
3895
|
ToggleControl,
|
|
3896
|
+
TransformRepeaterControl,
|
|
3492
3897
|
UrlControl,
|
|
3493
3898
|
createControlReplacementsRegistry,
|
|
3494
3899
|
injectIntoRepeaterItemIcon,
|