@elementor/editor-controls 0.6.0 → 0.7.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 +42 -0
- package/dist/index.js +287 -112
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +281 -106
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/components/repeater.tsx +2 -1
- package/src/controls/autocomplete-control.tsx +19 -24
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx +38 -0
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx +31 -0
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx +50 -0
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-resolution.tsx +27 -0
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx +44 -0
- package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +88 -26
- package/src/controls/box-shadow-repeater-control.tsx +3 -2
- package/src/controls/equal-unequal-sizes-control.tsx +4 -2
- package/src/controls/gap-control.tsx +33 -31
- package/src/controls/image-media-control.tsx +23 -15
- package/src/controls/link-control.tsx +2 -2
- package/src/controls/linked-dimensions-control.tsx +48 -36
- package/src/controls/select-control.tsx +5 -3
package/dist/index.mjs
CHANGED
|
@@ -251,13 +251,14 @@ function ControlActions({ children }) {
|
|
|
251
251
|
}
|
|
252
252
|
|
|
253
253
|
// src/controls/image-media-control.tsx
|
|
254
|
-
var ImageMediaControl = createControl(() => {
|
|
254
|
+
var ImageMediaControl = createControl((props) => {
|
|
255
255
|
const { value, setValue } = useBoundProp(imageSrcPropTypeUtil);
|
|
256
256
|
const { id, url } = value ?? {};
|
|
257
257
|
const { data: attachment, isFetching } = useWpMediaAttachment(id?.value || null);
|
|
258
258
|
const src = attachment?.url ?? url?.value ?? null;
|
|
259
259
|
const { open } = useWpMediaFrame({
|
|
260
|
-
types: ["image"],
|
|
260
|
+
types: ["image", "image/svg+xml"],
|
|
261
|
+
allowedExtensions: props.allowedExtensions,
|
|
261
262
|
multiple: false,
|
|
262
263
|
selected: id?.value || null,
|
|
263
264
|
onSelect: (selectedAttachment) => {
|
|
@@ -270,7 +271,7 @@ var ImageMediaControl = createControl(() => {
|
|
|
270
271
|
});
|
|
271
272
|
}
|
|
272
273
|
});
|
|
273
|
-
return /* @__PURE__ */ React8.createElement(Card, { variant: "outlined" }, /* @__PURE__ */ React8.createElement(CardMedia, { image: src, sx: { height: 150 } }, isFetching ? /* @__PURE__ */ React8.createElement(Stack, { justifyContent: "center", alignItems: "center", width: "100%", height: "100%" }, /* @__PURE__ */ React8.createElement(CircularProgress, null)) :
|
|
274
|
+
return /* @__PURE__ */ React8.createElement(ControlActions, null, /* @__PURE__ */ React8.createElement(Card, { variant: "outlined" }, /* @__PURE__ */ React8.createElement(CardMedia, { image: src, sx: { height: 150 } }, isFetching ? /* @__PURE__ */ React8.createElement(Stack, { justifyContent: "center", alignItems: "center", width: "100%", height: "100%" }, /* @__PURE__ */ React8.createElement(CircularProgress, null)) : /* @__PURE__ */ React8.createElement(React8.Fragment, null)), /* @__PURE__ */ React8.createElement(CardOverlay, null, /* @__PURE__ */ React8.createElement(Stack, { gap: 1 }, /* @__PURE__ */ React8.createElement(
|
|
274
275
|
Button,
|
|
275
276
|
{
|
|
276
277
|
size: "tiny",
|
|
@@ -299,10 +300,11 @@ import { MenuItem, Select } from "@elementor/ui";
|
|
|
299
300
|
var SelectControl = createControl(({ options, onChange }) => {
|
|
300
301
|
const { value, setValue } = useBoundProp(stringPropTypeUtil);
|
|
301
302
|
const handleChange = (event) => {
|
|
302
|
-
|
|
303
|
-
|
|
303
|
+
const newValue = event.target.value || null;
|
|
304
|
+
onChange?.(newValue, value);
|
|
305
|
+
setValue(newValue);
|
|
304
306
|
};
|
|
305
|
-
return /* @__PURE__ */ React9.createElement(ControlActions, null, /* @__PURE__ */ React9.createElement(Select, { displayEmpty: true, size: "tiny", value: value ?? "", onChange: handleChange, fullWidth: true }, options.map(({ label, ...props }) => /* @__PURE__ */ React9.createElement(MenuItem, { key: props.value, ...props }, label))));
|
|
307
|
+
return /* @__PURE__ */ React9.createElement(ControlActions, null, /* @__PURE__ */ React9.createElement(Select, { displayEmpty: true, size: "tiny", value: value ?? "", onChange: handleChange, fullWidth: true }, options.map(({ label, ...props }) => /* @__PURE__ */ React9.createElement(MenuItem, { key: props.value, ...props, value: props.value ?? "" }, label))));
|
|
306
308
|
});
|
|
307
309
|
|
|
308
310
|
// src/controls/image-control.tsx
|
|
@@ -313,7 +315,6 @@ var ImageControl = createControl((props) => {
|
|
|
313
315
|
|
|
314
316
|
// src/controls/autocomplete-control.tsx
|
|
315
317
|
import * as React11 from "react";
|
|
316
|
-
import { useState } from "react";
|
|
317
318
|
import { stringPropTypeUtil as stringPropTypeUtil2 } from "@elementor/editor-props";
|
|
318
319
|
import { XIcon } from "@elementor/icons";
|
|
319
320
|
import {
|
|
@@ -332,21 +333,16 @@ var AutocompleteControl = createControl(
|
|
|
332
333
|
minInputLength = 2
|
|
333
334
|
}) => {
|
|
334
335
|
const { value = "", setValue } = useBoundProp(propType);
|
|
335
|
-
const [
|
|
336
|
-
|
|
337
|
-
);
|
|
338
|
-
const hasSelectedValue = !!(inputValue && (options[inputValue] || Object.values(options).find(({ label }) => label === inputValue)));
|
|
339
|
-
const allowClear = !!inputValue;
|
|
336
|
+
const hasSelectedValue = !!(value && (options[value] || Object.values(options).find(({ label }) => label === value)));
|
|
337
|
+
const allowClear = !!value;
|
|
340
338
|
const formattedOptions = Object.keys(options);
|
|
341
|
-
const
|
|
342
|
-
const formattedInputValue = newValue && options[newValue]?.label ? options[newValue]?.label : newValue;
|
|
343
|
-
setInputValue(formattedInputValue || "");
|
|
344
|
-
if (!allowCustomValues && newValue && !options[newValue]) {
|
|
345
|
-
return;
|
|
346
|
-
}
|
|
339
|
+
const onOptionSelect = (_, newValue) => {
|
|
347
340
|
setValue(newValue);
|
|
348
341
|
};
|
|
349
|
-
const
|
|
342
|
+
const handleChange = (newValue) => {
|
|
343
|
+
setValue(newValue);
|
|
344
|
+
};
|
|
345
|
+
const filterOptions = (_, { inputValue }) => {
|
|
350
346
|
const formattedValue = inputValue?.toLowerCase() || "";
|
|
351
347
|
if (formattedValue.length < minInputLength) {
|
|
352
348
|
return [];
|
|
@@ -358,18 +354,16 @@ var AutocompleteControl = createControl(
|
|
|
358
354
|
const isOptionEqualToValue = () => {
|
|
359
355
|
return muiWarningPreventer() ? void 0 : () => true;
|
|
360
356
|
};
|
|
361
|
-
const muiWarningPreventer = () => allowCustomValues || !!filterOptions().length;
|
|
357
|
+
const muiWarningPreventer = () => allowCustomValues || !!filterOptions([], { inputValue: value }).length;
|
|
362
358
|
return /* @__PURE__ */ React11.createElement(ControlActions, null, /* @__PURE__ */ React11.createElement(
|
|
363
359
|
Autocomplete,
|
|
364
360
|
{
|
|
365
361
|
forcePopupIcon: false,
|
|
366
362
|
disableClearable: true,
|
|
367
363
|
freeSolo: muiWarningPreventer(),
|
|
368
|
-
value:
|
|
364
|
+
value: value || "",
|
|
369
365
|
size: "tiny",
|
|
370
|
-
onChange:
|
|
371
|
-
onInputChange: handleChange,
|
|
372
|
-
onBlur: allowCustomValues ? void 0 : () => handleChange(null, value),
|
|
366
|
+
onChange: onOptionSelect,
|
|
373
367
|
readOnly: hasSelectedValue,
|
|
374
368
|
options: formattedOptions,
|
|
375
369
|
getOptionKey: (option) => option,
|
|
@@ -399,11 +393,15 @@ var TextInput = ({
|
|
|
399
393
|
handleChange,
|
|
400
394
|
hasSelectedValue
|
|
401
395
|
}) => {
|
|
396
|
+
const onChange = (event) => {
|
|
397
|
+
handleChange(event.target.value);
|
|
398
|
+
};
|
|
402
399
|
return /* @__PURE__ */ React11.createElement(
|
|
403
400
|
TextField,
|
|
404
401
|
{
|
|
405
402
|
...params,
|
|
406
403
|
placeholder,
|
|
404
|
+
onChange,
|
|
407
405
|
sx: {
|
|
408
406
|
"& .MuiInputBase-input": {
|
|
409
407
|
cursor: hasSelectedValue ? "default" : void 0
|
|
@@ -420,7 +418,7 @@ var ClearButton = ({
|
|
|
420
418
|
allowClear,
|
|
421
419
|
handleChange,
|
|
422
420
|
params
|
|
423
|
-
}) => /* @__PURE__ */ React11.createElement(InputAdornment, { position: "end" }, allowClear && /* @__PURE__ */ React11.createElement(IconButton, { size: params.size, onClick: handleChange, sx: { cursor: "pointer" } }, /* @__PURE__ */ React11.createElement(XIcon, { fontSize: params.size })));
|
|
421
|
+
}) => /* @__PURE__ */ React11.createElement(InputAdornment, { position: "end" }, allowClear && /* @__PURE__ */ React11.createElement(IconButton, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React11.createElement(XIcon, { fontSize: params.size })));
|
|
424
422
|
function shouldGroupOptions(options) {
|
|
425
423
|
return Object.values(options).every((option) => "groupLabel" in option);
|
|
426
424
|
}
|
|
@@ -522,7 +520,7 @@ var SelectionEndAdornment = ({
|
|
|
522
520
|
};
|
|
523
521
|
|
|
524
522
|
// src/hooks/use-sync-external-state.tsx
|
|
525
|
-
import { useEffect, useState
|
|
523
|
+
import { useEffect, useState } from "react";
|
|
526
524
|
var useSyncExternalState = ({
|
|
527
525
|
external,
|
|
528
526
|
setExternal,
|
|
@@ -541,7 +539,7 @@ var useSyncExternalState = ({
|
|
|
541
539
|
}
|
|
542
540
|
return externalValue;
|
|
543
541
|
}
|
|
544
|
-
const [internal, setInternal] =
|
|
542
|
+
const [internal, setInternal] = useState(toInternal(external, null));
|
|
545
543
|
useEffect(() => {
|
|
546
544
|
setInternal((prevInternal) => toInternal(external, prevInternal));
|
|
547
545
|
}, [external]);
|
|
@@ -633,7 +631,7 @@ import { __ as __5 } from "@wordpress/i18n";
|
|
|
633
631
|
|
|
634
632
|
// src/components/repeater.tsx
|
|
635
633
|
import * as React18 from "react";
|
|
636
|
-
import { useRef, useState as
|
|
634
|
+
import { useRef, useState as useState2 } from "react";
|
|
637
635
|
import { CopyIcon, EyeIcon, EyeOffIcon, PlusIcon, XIcon as XIcon2 } from "@elementor/icons";
|
|
638
636
|
import {
|
|
639
637
|
bindPopover,
|
|
@@ -691,7 +689,7 @@ var Repeater = ({
|
|
|
691
689
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
692
690
|
toggleDisableItem: () => toggleDisableRepeaterItem(index)
|
|
693
691
|
},
|
|
694
|
-
(props) => /* @__PURE__ */ React18.createElement(itemSettings.Content, { ...props, bind: String(index) })
|
|
692
|
+
(props) => /* @__PURE__ */ React18.createElement(itemSettings.Content, { ...props, value, bind: String(index) })
|
|
695
693
|
))));
|
|
696
694
|
};
|
|
697
695
|
var RepeaterItem = ({
|
|
@@ -706,7 +704,7 @@ var RepeaterItem = ({
|
|
|
706
704
|
}) => {
|
|
707
705
|
const popupId = `repeater-popup-${bind}`;
|
|
708
706
|
const controlRef = useRef(null);
|
|
709
|
-
const [anchorEl, setAnchorEl] =
|
|
707
|
+
const [anchorEl, setAnchorEl] = useState2(null);
|
|
710
708
|
const popoverState = usePopupState2({ popupId, variant: "popover" });
|
|
711
709
|
const popoverProps = bindPopover(popoverState);
|
|
712
710
|
return /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(
|
|
@@ -808,7 +806,7 @@ var Content = ({ anchorEl }) => {
|
|
|
808
806
|
{
|
|
809
807
|
options: [
|
|
810
808
|
{ label: __5("Inset", "elementor"), value: "inset" },
|
|
811
|
-
{ label: __5("Outset", "elementor"), value:
|
|
809
|
+
{ label: __5("Outset", "elementor"), value: null }
|
|
812
810
|
]
|
|
813
811
|
}
|
|
814
812
|
))), /* @__PURE__ */ React19.createElement(Grid3, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React19.createElement(Control2, { bind: "hOffset", label: __5("Horizontal", "elementor") }, /* @__PURE__ */ React19.createElement(SizeControl, null)), /* @__PURE__ */ React19.createElement(Control2, { bind: "vOffset", label: __5("Vertical", "elementor") }, /* @__PURE__ */ React19.createElement(SizeControl, null))), /* @__PURE__ */ React19.createElement(Grid3, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React19.createElement(Control2, { bind: "blur", label: __5("Blur", "elementor") }, /* @__PURE__ */ React19.createElement(SizeControl, null)), /* @__PURE__ */ React19.createElement(Control2, { bind: "spread", label: __5("Spread", "elementor") }, /* @__PURE__ */ React19.createElement(SizeControl, null)))));
|
|
@@ -820,13 +818,14 @@ var ItemLabel = ({ value }) => {
|
|
|
820
818
|
const { size: spreadSize = "", unit: spreadUnit = "" } = spread?.value || {};
|
|
821
819
|
const { size: hOffsetSize = "unset", unit: hOffsetUnit = "" } = hOffset?.value || {};
|
|
822
820
|
const { size: vOffsetSize = "unset", unit: vOffsetUnit = "" } = vOffset?.value || {};
|
|
821
|
+
const positionLabel = position?.value || "outset";
|
|
823
822
|
const sizes = [
|
|
824
823
|
hOffsetSize + hOffsetUnit,
|
|
825
824
|
vOffsetSize + vOffsetUnit,
|
|
826
825
|
blurSize + blurUnit,
|
|
827
826
|
spreadSize + spreadUnit
|
|
828
827
|
].join(" ");
|
|
829
|
-
return /* @__PURE__ */ React19.createElement("span", { style: { textTransform: "capitalize" } },
|
|
828
|
+
return /* @__PURE__ */ React19.createElement("span", { style: { textTransform: "capitalize" } }, positionLabel, ": ", sizes);
|
|
830
829
|
};
|
|
831
830
|
var initialShadow = {
|
|
832
831
|
$$type: "shadow",
|
|
@@ -1017,7 +1016,7 @@ function EqualUnequalSizesControl({
|
|
|
1017
1016
|
};
|
|
1018
1017
|
const isEqual = isEqualSizes(newMappedValues, items);
|
|
1019
1018
|
if (isEqual) {
|
|
1020
|
-
return setSizeValue(Object.values(newMappedValues)[0]
|
|
1019
|
+
return setSizeValue(Object.values(newMappedValues)[0]?.value);
|
|
1021
1020
|
}
|
|
1022
1021
|
setMultiSizeValue(newMappedValues);
|
|
1023
1022
|
};
|
|
@@ -1027,7 +1026,8 @@ function EqualUnequalSizesControl({
|
|
|
1027
1026
|
}
|
|
1028
1027
|
return splitEqualValue() ?? null;
|
|
1029
1028
|
};
|
|
1030
|
-
|
|
1029
|
+
const isMixed = !!multiSizeValue;
|
|
1030
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(Grid4, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: controlRef }, /* @__PURE__ */ React23.createElement(Grid4, { item: true, xs: 6 }, /* @__PURE__ */ React23.createElement(ControlLabel, null, label)), /* @__PURE__ */ React23.createElement(Grid4, { item: true, xs: 6 }, /* @__PURE__ */ React23.createElement(Stack6, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React23.createElement(SizeControl, { placeholder: isMixed ? __6("Mixed", "elementor") : void 0 }), /* @__PURE__ */ React23.createElement(
|
|
1031
1031
|
ToggleButton2,
|
|
1032
1032
|
{
|
|
1033
1033
|
size: "tiny",
|
|
@@ -1062,38 +1062,29 @@ var MultiSizeValueControl = ({ item }) => /* @__PURE__ */ React23.createElement(
|
|
|
1062
1062
|
|
|
1063
1063
|
// src/controls/linked-dimensions-control.tsx
|
|
1064
1064
|
import * as React24 from "react";
|
|
1065
|
-
import {
|
|
1065
|
+
import { dimensionsPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil3 } from "@elementor/editor-props";
|
|
1066
1066
|
import { DetachIcon, LinkIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
1067
1067
|
import { Grid as Grid5, Stack as Stack7, ToggleButton as ToggleButton3 } from "@elementor/ui";
|
|
1068
1068
|
import { __ as __7 } from "@wordpress/i18n";
|
|
1069
1069
|
var LinkedDimensionsControl = createControl(({ label }) => {
|
|
1070
|
-
const { value, setValue, propType } = useBoundProp(
|
|
1071
|
-
const {
|
|
1072
|
-
const
|
|
1070
|
+
const { value: dimensionsValue, setValue: setDimensionsValue, propType } = useBoundProp(dimensionsPropTypeUtil);
|
|
1071
|
+
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(sizePropTypeUtil3);
|
|
1072
|
+
const isLinked = !dimensionsValue && !sizeValue ? true : !!sizeValue;
|
|
1073
|
+
const onLinkToggle = () => {
|
|
1073
1074
|
if (!isLinked) {
|
|
1074
|
-
|
|
1075
|
+
setSizeValue(dimensionsValue?.top?.value);
|
|
1076
|
+
return;
|
|
1075
1077
|
}
|
|
1076
|
-
const
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
left: newDimension
|
|
1078
|
+
const value = sizeValue ? sizePropTypeUtil3.create(sizeValue) : null;
|
|
1079
|
+
setDimensionsValue({
|
|
1080
|
+
top: value,
|
|
1081
|
+
right: value,
|
|
1082
|
+
bottom: value,
|
|
1083
|
+
left: value
|
|
1083
1084
|
});
|
|
1084
1085
|
};
|
|
1085
|
-
const toggleLinked = () => {
|
|
1086
|
-
const updatedValue = {
|
|
1087
|
-
isLinked: !isLinked,
|
|
1088
|
-
top,
|
|
1089
|
-
right: !isLinked ? top : right,
|
|
1090
|
-
bottom: !isLinked ? top : bottom,
|
|
1091
|
-
left: !isLinked ? top : left
|
|
1092
|
-
};
|
|
1093
|
-
setValue(updatedValue);
|
|
1094
|
-
};
|
|
1095
1086
|
const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
|
|
1096
|
-
return /* @__PURE__ */ React24.createElement(PropProvider, { propType, value, setValue:
|
|
1087
|
+
return /* @__PURE__ */ React24.createElement(PropProvider, { propType, value: dimensionsValue, setValue: setDimensionsValue }, /* @__PURE__ */ React24.createElement(Stack7, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React24.createElement(ControlLabel, null, label), /* @__PURE__ */ React24.createElement(
|
|
1097
1088
|
ToggleButton3,
|
|
1098
1089
|
{
|
|
1099
1090
|
"aria-label": __7("Link Inputs", "elementor"),
|
|
@@ -1101,15 +1092,48 @@ var LinkedDimensionsControl = createControl(({ label }) => {
|
|
|
1101
1092
|
value: "check",
|
|
1102
1093
|
selected: isLinked,
|
|
1103
1094
|
sx: { marginLeft: "auto" },
|
|
1104
|
-
onChange:
|
|
1095
|
+
onChange: onLinkToggle
|
|
1105
1096
|
},
|
|
1106
1097
|
/* @__PURE__ */ React24.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1107
|
-
)), /* @__PURE__ */ React24.createElement(Stack7, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React24.createElement(Grid5, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React24.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React24.createElement(ControlLabel, null, __7("Top", "elementor"))), /* @__PURE__ */ React24.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React24.createElement(
|
|
1098
|
+
)), /* @__PURE__ */ React24.createElement(Stack7, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React24.createElement(Grid5, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React24.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React24.createElement(ControlLabel, null, __7("Top", "elementor"))), /* @__PURE__ */ React24.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React24.createElement(
|
|
1099
|
+
Control3,
|
|
1100
|
+
{
|
|
1101
|
+
bind: "top",
|
|
1102
|
+
startIcon: /* @__PURE__ */ React24.createElement(SideTopIcon, { fontSize: "tiny" }),
|
|
1103
|
+
isLinked
|
|
1104
|
+
}
|
|
1105
|
+
))), /* @__PURE__ */ React24.createElement(Grid5, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React24.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React24.createElement(ControlLabel, null, __7("Right", "elementor"))), /* @__PURE__ */ React24.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React24.createElement(
|
|
1106
|
+
Control3,
|
|
1107
|
+
{
|
|
1108
|
+
bind: "right",
|
|
1109
|
+
startIcon: /* @__PURE__ */ React24.createElement(SideRightIcon, { fontSize: "tiny" }),
|
|
1110
|
+
isLinked
|
|
1111
|
+
}
|
|
1112
|
+
)))), /* @__PURE__ */ React24.createElement(Stack7, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React24.createElement(Grid5, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React24.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React24.createElement(ControlLabel, null, __7("Bottom", "elementor"))), /* @__PURE__ */ React24.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React24.createElement(
|
|
1113
|
+
Control3,
|
|
1114
|
+
{
|
|
1115
|
+
bind: "bottom",
|
|
1116
|
+
startIcon: /* @__PURE__ */ React24.createElement(SideBottomIcon, { fontSize: "tiny" }),
|
|
1117
|
+
isLinked
|
|
1118
|
+
}
|
|
1119
|
+
))), /* @__PURE__ */ React24.createElement(Grid5, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React24.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React24.createElement(ControlLabel, null, __7("Left", "elementor"))), /* @__PURE__ */ React24.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React24.createElement(
|
|
1120
|
+
Control3,
|
|
1121
|
+
{
|
|
1122
|
+
bind: "left",
|
|
1123
|
+
startIcon: /* @__PURE__ */ React24.createElement(SideLeftIcon, { fontSize: "tiny" }),
|
|
1124
|
+
isLinked
|
|
1125
|
+
}
|
|
1126
|
+
)))));
|
|
1108
1127
|
});
|
|
1109
|
-
var Control3 = ({ bind, startIcon }) =>
|
|
1128
|
+
var Control3 = ({ bind, startIcon, isLinked }) => {
|
|
1129
|
+
if (isLinked) {
|
|
1130
|
+
return /* @__PURE__ */ React24.createElement(SizeControl, { startIcon });
|
|
1131
|
+
}
|
|
1132
|
+
return /* @__PURE__ */ React24.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React24.createElement(SizeControl, { startIcon }));
|
|
1133
|
+
};
|
|
1110
1134
|
|
|
1111
1135
|
// src/controls/font-family-control.tsx
|
|
1112
|
-
import { Fragment as
|
|
1136
|
+
import { Fragment as Fragment4, useId as useId3, useState as useState3 } from "react";
|
|
1113
1137
|
import * as React25 from "react";
|
|
1114
1138
|
import { stringPropTypeUtil as stringPropTypeUtil6 } from "@elementor/editor-props";
|
|
1115
1139
|
import { ChevronDownIcon, EditIcon, PhotoIcon, SearchIcon, XIcon as XIcon3 } from "@elementor/icons";
|
|
@@ -1166,7 +1190,7 @@ var useFilteredFontFamilies = (fontFamilies, searchValue) => {
|
|
|
1166
1190
|
// src/controls/font-family-control.tsx
|
|
1167
1191
|
var SIZE2 = "tiny";
|
|
1168
1192
|
var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
1169
|
-
const [searchValue, setSearchValue] =
|
|
1193
|
+
const [searchValue, setSearchValue] = useState3("");
|
|
1170
1194
|
const { value: fontFamily, setValue: setFontFamily } = useBoundProp(stringPropTypeUtil6);
|
|
1171
1195
|
const popupId = useId3();
|
|
1172
1196
|
const popoverState = usePopupState4({ variant: "popover", popupId });
|
|
@@ -1211,7 +1235,7 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1211
1235
|
startAdornment: /* @__PURE__ */ React25.createElement(InputAdornment4, { position: "start" }, /* @__PURE__ */ React25.createElement(SearchIcon, { fontSize: SIZE2 }))
|
|
1212
1236
|
}
|
|
1213
1237
|
}
|
|
1214
|
-
)), /* @__PURE__ */ React25.createElement(Divider, null), /* @__PURE__ */ React25.createElement(Box3, { sx: { overflowY: "auto", height: 260, width: 220 } }, filteredFontFamilies.length > 0 ? /* @__PURE__ */ React25.createElement(MenuList, { role: "listbox", tabIndex: 0 }, filteredFontFamilies.map(([category, items], index) => /* @__PURE__ */ React25.createElement(
|
|
1238
|
+
)), /* @__PURE__ */ React25.createElement(Divider, null), /* @__PURE__ */ React25.createElement(Box3, { sx: { overflowY: "auto", height: 260, width: 220 } }, filteredFontFamilies.length > 0 ? /* @__PURE__ */ React25.createElement(MenuList, { role: "listbox", tabIndex: 0 }, filteredFontFamilies.map(([category, items], index) => /* @__PURE__ */ React25.createElement(Fragment4, { key: index }, /* @__PURE__ */ React25.createElement(ListSubheader, { sx: { typography: "caption", color: "text.tertiary" } }, category), items.map((item) => {
|
|
1215
1239
|
const isSelected = item === fontFamily;
|
|
1216
1240
|
return /* @__PURE__ */ React25.createElement(
|
|
1217
1241
|
MenuItem3,
|
|
@@ -1262,7 +1286,7 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
1262
1286
|
|
|
1263
1287
|
// src/controls/link-control.tsx
|
|
1264
1288
|
import * as React27 from "react";
|
|
1265
|
-
import { booleanPropTypeUtil, linkPropTypeUtil,
|
|
1289
|
+
import { booleanPropTypeUtil, linkPropTypeUtil, urlPropTypeUtil as urlPropTypeUtil2 } from "@elementor/editor-props";
|
|
1266
1290
|
import { MinusIcon, PlusIcon as PlusIcon2 } from "@elementor/icons";
|
|
1267
1291
|
import { useSessionStorage } from "@elementor/session";
|
|
1268
1292
|
import { Collapse, Divider as Divider2, Grid as Grid6, IconButton as IconButton4, Stack as Stack9, Switch } from "@elementor/ui";
|
|
@@ -1305,7 +1329,7 @@ var LinkControl = createControl((props) => {
|
|
|
1305
1329
|
{
|
|
1306
1330
|
allowCustomValues: Object.keys(options).length ? allowCustomValues : true,
|
|
1307
1331
|
options,
|
|
1308
|
-
propType:
|
|
1332
|
+
propType: urlPropTypeUtil2,
|
|
1309
1333
|
placeholder
|
|
1310
1334
|
}
|
|
1311
1335
|
)), /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React27.createElement(SwitchControl, null))))));
|
|
@@ -1323,34 +1347,31 @@ var SwitchControl = () => {
|
|
|
1323
1347
|
|
|
1324
1348
|
// src/controls/gap-control.tsx
|
|
1325
1349
|
import * as React28 from "react";
|
|
1326
|
-
import {
|
|
1350
|
+
import { layoutDirectionPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil4 } from "@elementor/editor-props";
|
|
1327
1351
|
import { DetachIcon as DetachIcon2, LinkIcon as LinkIcon2 } from "@elementor/icons";
|
|
1328
1352
|
import { Grid as Grid7, Stack as Stack10, ToggleButton as ToggleButton4 } from "@elementor/ui";
|
|
1329
1353
|
import { __ as __11 } from "@wordpress/i18n";
|
|
1330
1354
|
var GapControl = createControl(({ label }) => {
|
|
1331
|
-
const {
|
|
1332
|
-
|
|
1333
|
-
|
|
1355
|
+
const {
|
|
1356
|
+
value: directionValue,
|
|
1357
|
+
setValue: setDirectionValue,
|
|
1358
|
+
propType
|
|
1359
|
+
} = useBoundProp(layoutDirectionPropTypeUtil);
|
|
1360
|
+
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(sizePropTypeUtil4);
|
|
1361
|
+
const isLinked = !directionValue && !sizeValue ? true : !!sizeValue;
|
|
1362
|
+
const onLinkToggle = () => {
|
|
1334
1363
|
if (!isLinked) {
|
|
1335
|
-
|
|
1364
|
+
setSizeValue(directionValue?.column.value);
|
|
1365
|
+
return;
|
|
1336
1366
|
}
|
|
1337
|
-
const
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
column:
|
|
1341
|
-
row: newDimension
|
|
1367
|
+
const value = sizeValue ? sizePropTypeUtil4.create(sizeValue) : null;
|
|
1368
|
+
setDirectionValue({
|
|
1369
|
+
row: value,
|
|
1370
|
+
column: value
|
|
1342
1371
|
});
|
|
1343
1372
|
};
|
|
1344
|
-
const toggleLinked = () => {
|
|
1345
|
-
const updatedValue = {
|
|
1346
|
-
isLinked: !isLinked,
|
|
1347
|
-
column,
|
|
1348
|
-
row: !isLinked ? column : row
|
|
1349
|
-
};
|
|
1350
|
-
setValue(updatedValue);
|
|
1351
|
-
};
|
|
1352
1373
|
const LinkedIcon = isLinked ? LinkIcon2 : DetachIcon2;
|
|
1353
|
-
return /* @__PURE__ */ React28.createElement(PropProvider, { propType, value, setValue:
|
|
1374
|
+
return /* @__PURE__ */ React28.createElement(PropProvider, { propType, value: directionValue, setValue: setDirectionValue }, /* @__PURE__ */ React28.createElement(Stack10, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(ControlLabel, null, label), /* @__PURE__ */ React28.createElement(
|
|
1354
1375
|
ToggleButton4,
|
|
1355
1376
|
{
|
|
1356
1377
|
"aria-label": __11("Link Inputs", "elementor"),
|
|
@@ -1358,40 +1379,180 @@ var GapControl = createControl(({ label }) => {
|
|
|
1358
1379
|
value: "check",
|
|
1359
1380
|
selected: isLinked,
|
|
1360
1381
|
sx: { marginLeft: "auto" },
|
|
1361
|
-
onChange:
|
|
1382
|
+
onChange: onLinkToggle
|
|
1362
1383
|
},
|
|
1363
1384
|
/* @__PURE__ */ React28.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1364
|
-
)), /* @__PURE__ */ React28.createElement(Stack10, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(Grid7, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React28.createElement(Grid7, { item: true, xs: 12 }, /* @__PURE__ */ React28.createElement(ControlLabel, null, __11("Column", "elementor"))), /* @__PURE__ */ React28.createElement(Grid7, { item: true, xs: 12 }, /* @__PURE__ */ React28.createElement(
|
|
1385
|
+
)), /* @__PURE__ */ React28.createElement(Stack10, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(Grid7, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React28.createElement(Grid7, { item: true, xs: 12 }, /* @__PURE__ */ React28.createElement(ControlLabel, null, __11("Column", "elementor"))), /* @__PURE__ */ React28.createElement(Grid7, { item: true, xs: 12 }, /* @__PURE__ */ React28.createElement(Control4, { bind: "column", isLinked }))), /* @__PURE__ */ React28.createElement(Grid7, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React28.createElement(Grid7, { item: true, xs: 12 }, /* @__PURE__ */ React28.createElement(ControlLabel, null, __11("Row", "elementor"))), /* @__PURE__ */ React28.createElement(Grid7, { item: true, xs: 12 }, /* @__PURE__ */ React28.createElement(Control4, { bind: "row", isLinked })))));
|
|
1365
1386
|
});
|
|
1387
|
+
var Control4 = ({ bind, isLinked }) => {
|
|
1388
|
+
if (isLinked) {
|
|
1389
|
+
return /* @__PURE__ */ React28.createElement(SizeControl, null);
|
|
1390
|
+
}
|
|
1391
|
+
return /* @__PURE__ */ React28.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React28.createElement(SizeControl, null));
|
|
1392
|
+
};
|
|
1366
1393
|
|
|
1367
1394
|
// src/controls/background-control/background-control.tsx
|
|
1368
|
-
import * as
|
|
1395
|
+
import * as React35 from "react";
|
|
1369
1396
|
import { backgroundPropTypeUtil } from "@elementor/editor-props";
|
|
1370
|
-
import { Grid as
|
|
1371
|
-
import { __ as
|
|
1397
|
+
import { Grid as Grid14, Stack as Stack12 } from "@elementor/ui";
|
|
1398
|
+
import { __ as __18 } from "@wordpress/i18n";
|
|
1372
1399
|
|
|
1373
1400
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
1374
|
-
import * as
|
|
1401
|
+
import * as React34 from "react";
|
|
1375
1402
|
import {
|
|
1376
1403
|
backgroundColorOverlayPropTypeUtil,
|
|
1377
1404
|
backgroundImageOverlayPropTypeUtil,
|
|
1378
1405
|
backgroundOverlayPropTypeUtil
|
|
1379
1406
|
} from "@elementor/editor-props";
|
|
1380
|
-
import { Grid as
|
|
1407
|
+
import { Box as Box4, Grid as Grid13, Stack as Stack11, Tab, TabPanel, Tabs, UnstableColorIndicator as UnstableColorIndicator2, useTabs } from "@elementor/ui";
|
|
1381
1408
|
import { useWpMediaAttachment as useWpMediaAttachment2 } from "@elementor/wp-media";
|
|
1409
|
+
import { __ as __17 } from "@wordpress/i18n";
|
|
1410
|
+
|
|
1411
|
+
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
1412
|
+
import * as React29 from "react";
|
|
1413
|
+
import { PinIcon, PinnedOffIcon } from "@elementor/icons";
|
|
1414
|
+
import { Grid as Grid8 } from "@elementor/ui";
|
|
1382
1415
|
import { __ as __12 } from "@wordpress/i18n";
|
|
1416
|
+
var attachmentControlOptions = [
|
|
1417
|
+
{
|
|
1418
|
+
value: "fixed",
|
|
1419
|
+
label: __12("Fixed", "elementor"),
|
|
1420
|
+
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(PinIcon, { fontSize: size }),
|
|
1421
|
+
showTooltip: true
|
|
1422
|
+
},
|
|
1423
|
+
{
|
|
1424
|
+
value: "scroll",
|
|
1425
|
+
label: __12("Scroll", "elementor"),
|
|
1426
|
+
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(PinnedOffIcon, { fontSize: size }),
|
|
1427
|
+
showTooltip: true
|
|
1428
|
+
}
|
|
1429
|
+
];
|
|
1430
|
+
var BackgroundImageOverlayAttachment = () => {
|
|
1431
|
+
return /* @__PURE__ */ React29.createElement(Grid8, { container: true, gap: 8, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React29.createElement(Grid8, { item: true, xs: 2 }, /* @__PURE__ */ React29.createElement(ControlLabel, null, __12("Attachment", "elementor"))), /* @__PURE__ */ React29.createElement(Grid8, { item: true, justifyContent: "flex-end", xs: 8, sx: { display: "flex" } }, /* @__PURE__ */ React29.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
1432
|
+
};
|
|
1433
|
+
|
|
1434
|
+
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
1435
|
+
import * as React30 from "react";
|
|
1436
|
+
import { Grid as Grid9 } from "@elementor/ui";
|
|
1437
|
+
import { __ as __13 } from "@wordpress/i18n";
|
|
1438
|
+
var backgroundPositionOptions = [
|
|
1439
|
+
{ label: __13("Center Center", "elementor"), value: "center center" },
|
|
1440
|
+
{ label: __13("Center Left", "elementor"), value: "center left" },
|
|
1441
|
+
{ label: __13("Center Right", "elementor"), value: "center right" },
|
|
1442
|
+
{ label: __13("Top Center", "elementor"), value: "top center" },
|
|
1443
|
+
{ label: __13("Top Left", "elementor"), value: "top left" },
|
|
1444
|
+
{ label: __13("Top Right", "elementor"), value: "top right" },
|
|
1445
|
+
{ label: __13("Bottom Center", "elementor"), value: "bottom center" },
|
|
1446
|
+
{ label: __13("Bottom Left", "elementor"), value: "bottom left" },
|
|
1447
|
+
{ label: __13("Bottom Right", "elementor"), value: "bottom right" }
|
|
1448
|
+
];
|
|
1449
|
+
var BackgroundImageOverlayPosition = () => {
|
|
1450
|
+
return /* @__PURE__ */ React30.createElement(Grid9, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel, null, __13("Position", "elementor"))), /* @__PURE__ */ React30.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(SelectControl, { options: backgroundPositionOptions })));
|
|
1451
|
+
};
|
|
1452
|
+
|
|
1453
|
+
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
1454
|
+
import * as React31 from "react";
|
|
1455
|
+
import { DotsHorizontalIcon, DotsVerticalIcon, GridDotsIcon, XIcon as XIcon4 } from "@elementor/icons";
|
|
1456
|
+
import { Grid as Grid10 } from "@elementor/ui";
|
|
1457
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
1458
|
+
var repeatControlOptions = [
|
|
1459
|
+
{
|
|
1460
|
+
value: "repeat",
|
|
1461
|
+
label: __14("Repeat", "elementor"),
|
|
1462
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(GridDotsIcon, { fontSize: size }),
|
|
1463
|
+
showTooltip: true
|
|
1464
|
+
},
|
|
1465
|
+
{
|
|
1466
|
+
value: "repeat-x",
|
|
1467
|
+
label: __14("Repeat-x", "elementor"),
|
|
1468
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(DotsHorizontalIcon, { fontSize: size }),
|
|
1469
|
+
showTooltip: true
|
|
1470
|
+
},
|
|
1471
|
+
{
|
|
1472
|
+
value: "repeat-y",
|
|
1473
|
+
label: __14("Repeat-y", "elementor"),
|
|
1474
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(DotsVerticalIcon, { fontSize: size }),
|
|
1475
|
+
showTooltip: true
|
|
1476
|
+
},
|
|
1477
|
+
{
|
|
1478
|
+
value: "no-repeat",
|
|
1479
|
+
label: __14("No-Repeat", "elementor"),
|
|
1480
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(XIcon4, { fontSize: size }),
|
|
1481
|
+
showTooltip: true
|
|
1482
|
+
}
|
|
1483
|
+
];
|
|
1484
|
+
var BackgroundImageOverlayRepeat = () => {
|
|
1485
|
+
return /* @__PURE__ */ React31.createElement(Grid10, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ControlLabel, null, __14("Repeat", "elementor"))), /* @__PURE__ */ React31.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
1486
|
+
};
|
|
1487
|
+
|
|
1488
|
+
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-resolution.tsx
|
|
1489
|
+
import * as React32 from "react";
|
|
1490
|
+
import { Grid as Grid11 } from "@elementor/ui";
|
|
1491
|
+
import { __ as __15 } from "@wordpress/i18n";
|
|
1492
|
+
var backgroundResolutionOptions = [
|
|
1493
|
+
{ label: __15("Thumbnail - 150 x 150", "elementor"), value: "thumbnail" },
|
|
1494
|
+
{ label: __15("Medium - 300 x 300", "elementor"), value: "medium" },
|
|
1495
|
+
{ label: __15("Medium Large - 768 x 768"), value: "medium_large" },
|
|
1496
|
+
{ label: __15("Large 1024 x 1024", "elementor"), value: "large" },
|
|
1497
|
+
{ label: __15("Full", "elementor"), value: "full" }
|
|
1498
|
+
];
|
|
1499
|
+
var BackgroundImageOverlayResolution = () => {
|
|
1500
|
+
return /* @__PURE__ */ React32.createElement(Grid11, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(ControlLabel, null, __15("Resolution", "elementor"))), /* @__PURE__ */ React32.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(SelectControl, { options: backgroundResolutionOptions })));
|
|
1501
|
+
};
|
|
1502
|
+
|
|
1503
|
+
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
1504
|
+
import * as React33 from "react";
|
|
1505
|
+
import { ArrowBarBothIcon, ArrowsMaximizeIcon } from "@elementor/icons";
|
|
1506
|
+
import { Grid as Grid12 } from "@elementor/ui";
|
|
1507
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
1508
|
+
var sizeControlOptions = [
|
|
1509
|
+
{
|
|
1510
|
+
value: "auto",
|
|
1511
|
+
label: __16("Auto", "elementor"),
|
|
1512
|
+
renderContent: () => "Auto",
|
|
1513
|
+
showTooltip: true
|
|
1514
|
+
},
|
|
1515
|
+
{
|
|
1516
|
+
value: "cover",
|
|
1517
|
+
label: __16("Cover", "elementor"),
|
|
1518
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(ArrowsMaximizeIcon, { fontSize: size }),
|
|
1519
|
+
showTooltip: true
|
|
1520
|
+
},
|
|
1521
|
+
{
|
|
1522
|
+
value: "contain",
|
|
1523
|
+
label: __16("Contain", "elementor"),
|
|
1524
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(ArrowBarBothIcon, { fontSize: size }),
|
|
1525
|
+
showTooltip: true
|
|
1526
|
+
}
|
|
1527
|
+
];
|
|
1528
|
+
var BackgroundImageOverlaySize = () => {
|
|
1529
|
+
return /* @__PURE__ */ React33.createElement(Grid12, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React33.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(ControlLabel, null, __16("Size", "elementor"))), /* @__PURE__ */ React33.createElement(Grid12, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React33.createElement(ToggleControl, { options: sizeControlOptions })));
|
|
1530
|
+
};
|
|
1531
|
+
|
|
1532
|
+
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
1533
|
+
var defaultImagePlaceholderId = 1;
|
|
1383
1534
|
var initialBackgroundOverlay = {
|
|
1384
|
-
$$type: "background-
|
|
1385
|
-
value:
|
|
1535
|
+
$$type: "background-image-overlay",
|
|
1536
|
+
value: {
|
|
1537
|
+
"image-src": {
|
|
1538
|
+
$$type: "image-src",
|
|
1539
|
+
value: {
|
|
1540
|
+
id: {
|
|
1541
|
+
$$type: "image-attachment-id",
|
|
1542
|
+
value: defaultImagePlaceholderId
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1386
1547
|
};
|
|
1387
1548
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
1388
1549
|
const { propType, value: overlayValues, setValue } = useBoundProp(backgroundOverlayPropTypeUtil);
|
|
1389
|
-
return /* @__PURE__ */
|
|
1550
|
+
return /* @__PURE__ */ React34.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React34.createElement(
|
|
1390
1551
|
Repeater,
|
|
1391
1552
|
{
|
|
1392
1553
|
values: overlayValues ?? [],
|
|
1393
1554
|
setValues: setValue,
|
|
1394
|
-
label:
|
|
1555
|
+
label: __17("Overlay", "elementor"),
|
|
1395
1556
|
itemSettings: {
|
|
1396
1557
|
Icon: ItemIcon2,
|
|
1397
1558
|
Label: ItemLabel2,
|
|
@@ -1401,36 +1562,50 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
1401
1562
|
}
|
|
1402
1563
|
));
|
|
1403
1564
|
});
|
|
1404
|
-
var ItemIcon2 = ({ value }) => /* @__PURE__ */
|
|
1405
|
-
var ItemContent2 = ({ bind }) => {
|
|
1406
|
-
return /* @__PURE__ */
|
|
1565
|
+
var ItemIcon2 = ({ value }) => /* @__PURE__ */ React34.createElement(UnstableColorIndicator2, { size: "inherit", component: "span", value: value.value });
|
|
1566
|
+
var ItemContent2 = ({ bind, value }) => {
|
|
1567
|
+
return /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React34.createElement(Content2, { value }));
|
|
1407
1568
|
};
|
|
1408
|
-
var Content2 = () => {
|
|
1409
|
-
const
|
|
1410
|
-
|
|
1569
|
+
var Content2 = ({ value }) => {
|
|
1570
|
+
const activeTab = deriveOverlayType(value.$$type);
|
|
1571
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = useTabs(activeTab);
|
|
1572
|
+
return /* @__PURE__ */ React34.createElement(Box4, { sx: { width: "100%" } }, /* @__PURE__ */ React34.createElement(Box4, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React34.createElement(Tabs, { ...getTabsProps(), "aria-label": __17("Background Overlay", "elementor") }, /* @__PURE__ */ React34.createElement(Tab, { label: __17("Image", "elementor"), ...getTabProps("image") }), /* @__PURE__ */ React34.createElement(Tab, { label: __17("Color", "elementor"), ...getTabProps("color") }))), /* @__PURE__ */ React34.createElement(TabPanel, { ...getTabPanelProps("image") }, /* @__PURE__ */ React34.createElement(Stack11, { gap: 1.5 }, /* @__PURE__ */ React34.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React34.createElement(TabPanel, { ...getTabPanelProps("color") }, /* @__PURE__ */ React34.createElement(Grid13, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React34.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React34.createElement(ColorControl, { propTypeUtil: backgroundColorOverlayPropTypeUtil })))));
|
|
1411
1573
|
};
|
|
1412
1574
|
var ItemLabel2 = ({ value }) => {
|
|
1413
1575
|
const type = value.$$type;
|
|
1414
1576
|
if (type === "background-color-overlay") {
|
|
1415
|
-
return /* @__PURE__ */
|
|
1577
|
+
return /* @__PURE__ */ React34.createElement(ItemLabelColor, { value });
|
|
1416
1578
|
}
|
|
1417
1579
|
if (type === "background-image-overlay") {
|
|
1418
|
-
return /* @__PURE__ */
|
|
1580
|
+
return /* @__PURE__ */ React34.createElement(ItemLabelImage, { value });
|
|
1419
1581
|
}
|
|
1420
1582
|
};
|
|
1421
1583
|
var ItemLabelColor = ({ value }) => {
|
|
1422
|
-
return /* @__PURE__ */
|
|
1584
|
+
return /* @__PURE__ */ React34.createElement("span", null, value.value);
|
|
1423
1585
|
};
|
|
1424
1586
|
var ItemLabelImage = ({ value }) => {
|
|
1425
1587
|
const { data: attachment } = useWpMediaAttachment2(value?.value["image-src"]?.value.id.value || null);
|
|
1426
1588
|
const imageTitle = attachment?.title || null;
|
|
1427
|
-
return /* @__PURE__ */
|
|
1589
|
+
return /* @__PURE__ */ React34.createElement("span", null, imageTitle);
|
|
1590
|
+
};
|
|
1591
|
+
var ImageOverlayContent = () => {
|
|
1592
|
+
const propContext = useBoundProp(backgroundImageOverlayPropTypeUtil);
|
|
1593
|
+
return /* @__PURE__ */ React34.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind: "image-src" }, /* @__PURE__ */ React34.createElement(Grid13, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React34.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React34.createElement(ImageMediaControl, null)))), /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind: "resolution" }, /* @__PURE__ */ React34.createElement(BackgroundImageOverlayResolution, null)), /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React34.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React34.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React34.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React34.createElement(BackgroundImageOverlayAttachment, null)));
|
|
1594
|
+
};
|
|
1595
|
+
var deriveOverlayType = (type) => {
|
|
1596
|
+
if (type === "background-color-overlay") {
|
|
1597
|
+
return "color";
|
|
1598
|
+
}
|
|
1599
|
+
if (type === "background-image-overlay") {
|
|
1600
|
+
return "image";
|
|
1601
|
+
}
|
|
1602
|
+
throw new Error(`Invalid overlay type: ${type}`);
|
|
1428
1603
|
};
|
|
1429
1604
|
|
|
1430
1605
|
// src/controls/background-control/background-control.tsx
|
|
1431
1606
|
var BackgroundControl = createControl(() => {
|
|
1432
1607
|
const propContext = useBoundProp(backgroundPropTypeUtil);
|
|
1433
|
-
return /* @__PURE__ */
|
|
1608
|
+
return /* @__PURE__ */ React35.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React35.createElement(Stack12, { gap: 1.5 }, /* @__PURE__ */ React35.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React35.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React35.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React35.createElement(Grid14, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React35.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ControlLabel, null, __18("Color", "elementor"))), /* @__PURE__ */ React35.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ColorControl, null))))));
|
|
1434
1609
|
});
|
|
1435
1610
|
export {
|
|
1436
1611
|
AutocompleteControl,
|