@elementor/editor-controls 0.16.0 → 0.17.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 +33 -0
- package/dist/index.d.mts +19 -6
- package/dist/index.d.ts +19 -6
- package/dist/index.js +340 -167
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +344 -160
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -5
- package/src/components/control-toggle-button-group.tsx +5 -0
- package/src/components/enable-unfiltered-modal.tsx +130 -0
- package/src/components/repeater.tsx +39 -10
- package/src/components/sortable.tsx +2 -7
- package/src/controls/background-control/background-gradient-color-control.tsx +1 -1
- package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +38 -10
- package/src/controls/box-shadow-repeater-control.tsx +15 -4
- package/src/controls/equal-unequal-sizes-control.tsx +1 -1
- package/src/controls/font-family-control/font-family-control.tsx +7 -2
- package/src/controls/link-control.tsx +11 -2
- package/src/controls/svg-media-control.tsx +20 -5
- package/src/controls/toggle-control.tsx +36 -10
- package/src/hooks/use-filtered-font-families.ts +15 -16
- package/src/index.ts +2 -0
- package/src/utils/link-restriction.ts +47 -0
- package/src/utils/types.ts +5 -0
package/dist/index.js
CHANGED
|
@@ -295,6 +295,17 @@ var useUnfilteredFilesUpload = () => (0, import_query.useQuery)({
|
|
|
295
295
|
}),
|
|
296
296
|
staleTime: Infinity
|
|
297
297
|
});
|
|
298
|
+
function useUpdateUnfilteredFilesUpload() {
|
|
299
|
+
const queryClient = (0, import_query.useQueryClient)();
|
|
300
|
+
const mutate = (0, import_query.useMutation)({
|
|
301
|
+
mutationFn: ({ allowUnfilteredFilesUpload }) => apiClient.updateElementorSetting(
|
|
302
|
+
UNFILTERED_FILES_UPLOAD_KEY,
|
|
303
|
+
allowUnfilteredFilesUpload ? "1" : "0"
|
|
304
|
+
),
|
|
305
|
+
onSuccess: () => queryClient.invalidateQueries(unfilteredFilesQueryKey)
|
|
306
|
+
});
|
|
307
|
+
return mutate;
|
|
308
|
+
}
|
|
298
309
|
var formatResponse = (response) => {
|
|
299
310
|
return Boolean(response === "1");
|
|
300
311
|
};
|
|
@@ -703,15 +714,7 @@ var React20 = __toESM(require("react"));
|
|
|
703
714
|
var import_icons2 = require("@elementor/icons");
|
|
704
715
|
var import_ui16 = require("@elementor/ui");
|
|
705
716
|
var SortableProvider = (props) => {
|
|
706
|
-
return /* @__PURE__ */ React20.createElement(import_ui16.List, { sx: { p: 0,
|
|
707
|
-
import_ui16.UnstableSortableProvider,
|
|
708
|
-
{
|
|
709
|
-
restrictAxis: true,
|
|
710
|
-
disableDragOverlay: false,
|
|
711
|
-
variant: "static",
|
|
712
|
-
...props
|
|
713
|
-
}
|
|
714
|
-
));
|
|
717
|
+
return /* @__PURE__ */ React20.createElement(import_ui16.List, { sx: { p: 0, my: -0.5, mx: 0 } }, /* @__PURE__ */ React20.createElement(import_ui16.UnstableSortableProvider, { restrictAxis: true, disableDragOverlay: false, variant: "static", ...props }));
|
|
715
718
|
};
|
|
716
719
|
var SortableItem = ({ id, children }) => {
|
|
717
720
|
return /* @__PURE__ */ React20.createElement(
|
|
@@ -789,10 +792,12 @@ var SIZE = "tiny";
|
|
|
789
792
|
var Repeater = ({
|
|
790
793
|
label,
|
|
791
794
|
itemSettings,
|
|
795
|
+
openOnAdd = false,
|
|
792
796
|
addToBottom = false,
|
|
793
797
|
values: repeaterValues = [],
|
|
794
798
|
setValues: setRepeaterValues
|
|
795
799
|
}) => {
|
|
800
|
+
const [openItem, setOpenItem] = (0, import_react7.useState)(-1);
|
|
796
801
|
const [items, setItems] = useSyncExternalState({
|
|
797
802
|
external: repeaterValues,
|
|
798
803
|
// @ts-expect-error - as long as persistWhen => true, value will never be null
|
|
@@ -813,6 +818,9 @@ var Repeater = ({
|
|
|
813
818
|
setItems([newItem, ...items]);
|
|
814
819
|
setUniqueKeys([newKey, ...uniqueKeys]);
|
|
815
820
|
}
|
|
821
|
+
if (openOnAdd) {
|
|
822
|
+
setOpenItem(newKey);
|
|
823
|
+
}
|
|
816
824
|
};
|
|
817
825
|
const duplicateRepeaterItem = (index) => {
|
|
818
826
|
const newItem = structuredClone(items[index]);
|
|
@@ -867,7 +875,8 @@ var Repeater = ({
|
|
|
867
875
|
startIcon: /* @__PURE__ */ React21.createElement(itemSettings.Icon, { value }),
|
|
868
876
|
removeItem: () => removeRepeaterItem(index),
|
|
869
877
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
870
|
-
toggleDisableItem: () => toggleDisableRepeaterItem(index)
|
|
878
|
+
toggleDisableItem: () => toggleDisableRepeaterItem(index),
|
|
879
|
+
openOnMount: openOnAdd && openItem === key
|
|
871
880
|
},
|
|
872
881
|
(props) => /* @__PURE__ */ React21.createElement(itemSettings.Content, { ...props, value, bind: String(index) })
|
|
873
882
|
));
|
|
@@ -875,19 +884,16 @@ var Repeater = ({
|
|
|
875
884
|
};
|
|
876
885
|
var RepeaterItem = ({
|
|
877
886
|
label,
|
|
878
|
-
bind,
|
|
879
887
|
disabled,
|
|
880
888
|
startIcon,
|
|
881
889
|
children,
|
|
882
890
|
removeItem,
|
|
883
891
|
duplicateItem,
|
|
884
|
-
toggleDisableItem
|
|
892
|
+
toggleDisableItem,
|
|
893
|
+
openOnMount
|
|
885
894
|
}) => {
|
|
886
|
-
const popupId = `repeater-popup-${bind}`;
|
|
887
|
-
const controlRef = (0, import_react7.useRef)(null);
|
|
888
895
|
const [anchorEl, setAnchorEl] = (0, import_react7.useState)(null);
|
|
889
|
-
const popoverState
|
|
890
|
-
const popoverProps = (0, import_ui17.bindPopover)(popoverState);
|
|
896
|
+
const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount);
|
|
891
897
|
const duplicateLabel = (0, import_i18n4.__)("Duplicate", "elementor");
|
|
892
898
|
const toggleLabel = disabled ? (0, import_i18n4.__)("Show", "elementor") : (0, import_i18n4.__)("Hide", "elementor");
|
|
893
899
|
const removeLabel = (0, import_i18n4.__)("Remove", "elementor");
|
|
@@ -897,7 +903,7 @@ var RepeaterItem = ({
|
|
|
897
903
|
label,
|
|
898
904
|
showActionsOnHover: true,
|
|
899
905
|
fullWidth: true,
|
|
900
|
-
ref:
|
|
906
|
+
ref: setRef,
|
|
901
907
|
variant: "outlined",
|
|
902
908
|
"aria-label": (0, import_i18n4.__)("Open item", "elementor"),
|
|
903
909
|
...(0, import_ui17.bindTrigger)(popoverState),
|
|
@@ -912,15 +918,32 @@ var RepeaterItem = ({
|
|
|
912
918
|
slotProps: {
|
|
913
919
|
paper: {
|
|
914
920
|
ref: setAnchorEl,
|
|
915
|
-
sx: { mt: 0.5, width:
|
|
921
|
+
sx: { mt: 0.5, width: ref?.getBoundingClientRect().width }
|
|
916
922
|
}
|
|
917
923
|
},
|
|
918
924
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
919
|
-
...popoverProps
|
|
925
|
+
...popoverProps,
|
|
926
|
+
anchorEl: ref
|
|
920
927
|
},
|
|
921
928
|
/* @__PURE__ */ React21.createElement(import_ui17.Box, null, children({ anchorEl }))
|
|
922
929
|
));
|
|
923
930
|
};
|
|
931
|
+
var usePopover = (openOnMount) => {
|
|
932
|
+
const [ref, setRef] = (0, import_react7.useState)(null);
|
|
933
|
+
const popoverState = (0, import_ui17.usePopupState)({ variant: "popover" });
|
|
934
|
+
const popoverProps = (0, import_ui17.bindPopover)(popoverState);
|
|
935
|
+
(0, import_react7.useEffect)(() => {
|
|
936
|
+
if (openOnMount && ref) {
|
|
937
|
+
popoverState.open(ref);
|
|
938
|
+
}
|
|
939
|
+
}, [ref]);
|
|
940
|
+
return {
|
|
941
|
+
popoverState,
|
|
942
|
+
ref,
|
|
943
|
+
setRef,
|
|
944
|
+
popoverProps
|
|
945
|
+
};
|
|
946
|
+
};
|
|
924
947
|
|
|
925
948
|
// src/controls/box-shadow-repeater-control.tsx
|
|
926
949
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
@@ -928,6 +951,7 @@ var BoxShadowRepeaterControl = createControl(() => {
|
|
|
928
951
|
return /* @__PURE__ */ React22.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React22.createElement(
|
|
929
952
|
Repeater,
|
|
930
953
|
{
|
|
954
|
+
openOnAdd: true,
|
|
931
955
|
values: value ?? [],
|
|
932
956
|
setValues: setValue,
|
|
933
957
|
label: (0, import_i18n5.__)("Box shadow", "elementor"),
|
|
@@ -963,7 +987,7 @@ var Content = ({ anchorEl }) => {
|
|
|
963
987
|
}
|
|
964
988
|
}
|
|
965
989
|
}
|
|
966
|
-
)), /* @__PURE__ */ React22.createElement(Control2, { bind: "position", label: (0, import_i18n5.__)("Position", "elementor") }, /* @__PURE__ */ React22.createElement(
|
|
990
|
+
)), /* @__PURE__ */ React22.createElement(Control2, { bind: "position", label: (0, import_i18n5.__)("Position", "elementor"), sx: { overflow: "hidden" } }, /* @__PURE__ */ React22.createElement(
|
|
967
991
|
SelectControl,
|
|
968
992
|
{
|
|
969
993
|
options: [
|
|
@@ -973,7 +997,12 @@ var Content = ({ anchorEl }) => {
|
|
|
973
997
|
}
|
|
974
998
|
))), /* @__PURE__ */ React22.createElement(PopoverGridContainer, null, /* @__PURE__ */ React22.createElement(Control2, { bind: "hOffset", label: (0, import_i18n5.__)("Horizontal", "elementor") }, /* @__PURE__ */ React22.createElement(SizeControl, null)), /* @__PURE__ */ React22.createElement(Control2, { bind: "vOffset", label: (0, import_i18n5.__)("Vertical", "elementor") }, /* @__PURE__ */ React22.createElement(SizeControl, null))), /* @__PURE__ */ React22.createElement(PopoverGridContainer, null, /* @__PURE__ */ React22.createElement(Control2, { bind: "blur", label: (0, import_i18n5.__)("Blur", "elementor") }, /* @__PURE__ */ React22.createElement(SizeControl, null)), /* @__PURE__ */ React22.createElement(Control2, { bind: "spread", label: (0, import_i18n5.__)("Spread", "elementor") }, /* @__PURE__ */ React22.createElement(SizeControl, null)))));
|
|
975
999
|
};
|
|
976
|
-
var Control2 = ({
|
|
1000
|
+
var Control2 = ({
|
|
1001
|
+
label,
|
|
1002
|
+
bind,
|
|
1003
|
+
children,
|
|
1004
|
+
sx
|
|
1005
|
+
}) => /* @__PURE__ */ React22.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React22.createElement(import_ui18.Grid, { item: true, xs: 6, sx }, /* @__PURE__ */ React22.createElement(import_ui18.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React22.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React22.createElement(import_ui18.Typography, { component: "label", variant: "caption", color: "text.secondary" }, label)), /* @__PURE__ */ React22.createElement(import_ui18.Grid, { item: true, xs: 12 }, children))));
|
|
977
1006
|
var ItemLabel = ({ value }) => {
|
|
978
1007
|
const { position, hOffset, vOffset, blur, spread } = value.value;
|
|
979
1008
|
const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
|
|
@@ -1026,6 +1055,7 @@ var import_ui19 = require("@elementor/ui");
|
|
|
1026
1055
|
var StyledToggleButtonGroup = (0, import_ui19.styled)(import_ui19.ToggleButtonGroup)`
|
|
1027
1056
|
${({ justify }) => `justify-content: ${justify};`}
|
|
1028
1057
|
`;
|
|
1058
|
+
var MAX_VISIBLE_ITEMS = 4;
|
|
1029
1059
|
var ControlToggleButtonGroup = ({
|
|
1030
1060
|
justify = "end",
|
|
1031
1061
|
size = "tiny",
|
|
@@ -1047,7 +1077,10 @@ var ControlToggleButtonGroup = ({
|
|
|
1047
1077
|
onChange: handleChange,
|
|
1048
1078
|
exclusive,
|
|
1049
1079
|
sx: {
|
|
1050
|
-
direction: isRtl ? "rtl /* @noflip */" : "ltr /* @noflip */"
|
|
1080
|
+
direction: isRtl ? "rtl /* @noflip */" : "ltr /* @noflip */",
|
|
1081
|
+
display: "grid",
|
|
1082
|
+
gridTemplateColumns: `repeat(${items.length}, 1fr)`,
|
|
1083
|
+
width: `${items.length / MAX_VISIBLE_ITEMS * 100}%`
|
|
1051
1084
|
}
|
|
1052
1085
|
},
|
|
1053
1086
|
items.map(
|
|
@@ -1068,20 +1101,40 @@ var ControlToggleButtonGroup = ({
|
|
|
1068
1101
|
|
|
1069
1102
|
// src/controls/toggle-control.tsx
|
|
1070
1103
|
var ToggleControl = createControl(
|
|
1071
|
-
({
|
|
1104
|
+
({
|
|
1105
|
+
options,
|
|
1106
|
+
fullWidth = false,
|
|
1107
|
+
size = "tiny",
|
|
1108
|
+
exclusive = true
|
|
1109
|
+
}) => {
|
|
1072
1110
|
const { value, setValue } = useBoundProp(import_editor_props10.stringPropTypeUtil);
|
|
1073
|
-
const
|
|
1074
|
-
|
|
1111
|
+
const exclusiveValues = options.filter((option) => option.exclusive).map((option) => option.value);
|
|
1112
|
+
const handleNonExclusiveToggle = (selectedValues) => {
|
|
1113
|
+
const newSelectedValue = selectedValues[selectedValues.length - 1];
|
|
1114
|
+
const isNewSelectedValueExclusive = exclusiveValues.includes(newSelectedValue);
|
|
1115
|
+
const updatedValues = isNewSelectedValueExclusive ? [newSelectedValue] : selectedValues?.filter((val) => !exclusiveValues.includes(val));
|
|
1116
|
+
setValue(updatedValues?.join(" ") || null);
|
|
1117
|
+
};
|
|
1118
|
+
const toggleButtonGroupProps = {
|
|
1119
|
+
items: options,
|
|
1120
|
+
fullWidth,
|
|
1121
|
+
size
|
|
1075
1122
|
};
|
|
1076
|
-
return /* @__PURE__ */ React24.createElement(
|
|
1123
|
+
return exclusive ? /* @__PURE__ */ React24.createElement(
|
|
1077
1124
|
ControlToggleButtonGroup,
|
|
1078
1125
|
{
|
|
1079
|
-
|
|
1126
|
+
...toggleButtonGroupProps,
|
|
1080
1127
|
value: value ?? null,
|
|
1081
|
-
onChange:
|
|
1082
|
-
exclusive: true
|
|
1083
|
-
|
|
1084
|
-
|
|
1128
|
+
onChange: setValue,
|
|
1129
|
+
exclusive: true
|
|
1130
|
+
}
|
|
1131
|
+
) : /* @__PURE__ */ React24.createElement(
|
|
1132
|
+
ControlToggleButtonGroup,
|
|
1133
|
+
{
|
|
1134
|
+
...toggleButtonGroupProps,
|
|
1135
|
+
value: value?.split(" ") ?? [],
|
|
1136
|
+
onChange: handleNonExclusiveToggle,
|
|
1137
|
+
exclusive: false
|
|
1085
1138
|
}
|
|
1086
1139
|
);
|
|
1087
1140
|
}
|
|
@@ -1213,7 +1266,7 @@ function EqualUnequalSizesControl({
|
|
|
1213
1266
|
paper: { sx: { mt: 0.5, width: controlRef.current?.getBoundingClientRect().width } }
|
|
1214
1267
|
}
|
|
1215
1268
|
},
|
|
1216
|
-
/* @__PURE__ */ React26.createElement(PropProvider, { propType: multiSizePropType, value: getMultiSizeValues(), setValue: setNestedProp }, /* @__PURE__ */ React26.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React26.createElement(PopoverGridContainer, null, /* @__PURE__ */ React26.createElement(MultiSizeValueControl, { item: items[0] }), /* @__PURE__ */ React26.createElement(MultiSizeValueControl, { item: items[1] })), /* @__PURE__ */ React26.createElement(PopoverGridContainer, null, /* @__PURE__ */ React26.createElement(MultiSizeValueControl, { item: items[
|
|
1269
|
+
/* @__PURE__ */ React26.createElement(PropProvider, { propType: multiSizePropType, value: getMultiSizeValues(), setValue: setNestedProp }, /* @__PURE__ */ React26.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React26.createElement(PopoverGridContainer, null, /* @__PURE__ */ React26.createElement(MultiSizeValueControl, { item: items[0] }), /* @__PURE__ */ React26.createElement(MultiSizeValueControl, { item: items[1] })), /* @__PURE__ */ React26.createElement(PopoverGridContainer, null, /* @__PURE__ */ React26.createElement(MultiSizeValueControl, { item: items[2] }), /* @__PURE__ */ React26.createElement(MultiSizeValueControl, { item: items[3] }))))
|
|
1217
1270
|
));
|
|
1218
1271
|
}
|
|
1219
1272
|
var MultiSizeValueControl = ({ item }) => /* @__PURE__ */ React26.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(import_ui21.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React26.createElement(ControlLabel, null, item.label)), /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React26.createElement(SizeControl, { startIcon: item.icon })))));
|
|
@@ -1324,20 +1377,18 @@ var import_i18n8 = require("@wordpress/i18n");
|
|
|
1324
1377
|
|
|
1325
1378
|
// src/hooks/use-filtered-font-families.ts
|
|
1326
1379
|
var useFilteredFontFamilies = (fontFamilies, searchValue) => {
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
});
|
|
1335
|
-
}
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
);
|
|
1340
|
-
return [...filteredFontFamilies];
|
|
1380
|
+
return fontFamilies.reduce((acc, category) => {
|
|
1381
|
+
const filteredFonts = category.fonts.filter(
|
|
1382
|
+
(font) => font.toLowerCase().includes(searchValue.toLowerCase())
|
|
1383
|
+
);
|
|
1384
|
+
if (filteredFonts.length) {
|
|
1385
|
+
acc.push({ type: "category", value: category.label });
|
|
1386
|
+
filteredFonts.forEach((font) => {
|
|
1387
|
+
acc.push({ type: "font", value: font });
|
|
1388
|
+
});
|
|
1389
|
+
}
|
|
1390
|
+
return acc;
|
|
1391
|
+
}, []);
|
|
1341
1392
|
};
|
|
1342
1393
|
|
|
1343
1394
|
// src/controls/font-family-control/enqueue-font.tsx
|
|
@@ -1541,7 +1592,7 @@ var StyledMenuList = (0, import_ui23.styled)(import_ui23.MenuList)(({ theme }) =
|
|
|
1541
1592
|
'& > [role="option"]': {
|
|
1542
1593
|
...theme.typography.caption,
|
|
1543
1594
|
lineHeight: "inherit",
|
|
1544
|
-
padding: theme.spacing(0.75, 2),
|
|
1595
|
+
padding: theme.spacing(0.75, 2, 0.75, 4),
|
|
1545
1596
|
"&:hover, &:focus": {
|
|
1546
1597
|
backgroundColor: theme.palette.action.hover
|
|
1547
1598
|
},
|
|
@@ -1696,6 +1747,36 @@ function _factoryFilter(newValue, options, minInputLength) {
|
|
|
1696
1747
|
);
|
|
1697
1748
|
}
|
|
1698
1749
|
|
|
1750
|
+
// src/utils/link-restriction.ts
|
|
1751
|
+
var import_editor_elements = require("@elementor/editor-elements");
|
|
1752
|
+
function getLinkRestriction(elementId) {
|
|
1753
|
+
if (getAncestorAnchor(elementId)) {
|
|
1754
|
+
return {
|
|
1755
|
+
shouldRestrict: true,
|
|
1756
|
+
restrictReason: "ancestor"
|
|
1757
|
+
};
|
|
1758
|
+
}
|
|
1759
|
+
if (getDescendantAnchor(elementId)) {
|
|
1760
|
+
return {
|
|
1761
|
+
shouldRestrict: true,
|
|
1762
|
+
restrictReason: "descendant"
|
|
1763
|
+
};
|
|
1764
|
+
}
|
|
1765
|
+
return { shouldRestrict: false };
|
|
1766
|
+
}
|
|
1767
|
+
function getAncestorAnchor(elementId) {
|
|
1768
|
+
const element = getElementView(elementId);
|
|
1769
|
+
return element?.closest("a") || null;
|
|
1770
|
+
}
|
|
1771
|
+
function getDescendantAnchor(elementId) {
|
|
1772
|
+
const element = getElementView(elementId);
|
|
1773
|
+
return element?.querySelector("a") || null;
|
|
1774
|
+
}
|
|
1775
|
+
function getElementView(id) {
|
|
1776
|
+
const elementContainer = (0, import_editor_elements.getContainer)(id);
|
|
1777
|
+
return elementContainer?.view?.el || null;
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1699
1780
|
// src/controls/link-control.tsx
|
|
1700
1781
|
var SIZE3 = "tiny";
|
|
1701
1782
|
var LinkControl = createControl((props) => {
|
|
@@ -1706,12 +1787,17 @@ var LinkControl = createControl((props) => {
|
|
|
1706
1787
|
allowCustomValues,
|
|
1707
1788
|
queryOptions: { endpoint = "", requestParams = {} },
|
|
1708
1789
|
placeholder,
|
|
1709
|
-
minInputLength = 2
|
|
1790
|
+
minInputLength = 2,
|
|
1791
|
+
context: { elementId }
|
|
1710
1792
|
} = props || {};
|
|
1711
1793
|
const [options, setOptions] = (0, import_react11.useState)(
|
|
1712
1794
|
generateFirstLoadedOption(value)
|
|
1713
1795
|
);
|
|
1714
1796
|
const onEnabledChange = () => {
|
|
1797
|
+
const { shouldRestrict } = getLinkRestriction(elementId);
|
|
1798
|
+
if (shouldRestrict && !isEnabled) {
|
|
1799
|
+
return;
|
|
1800
|
+
}
|
|
1715
1801
|
setIsEnabled((prevState) => !prevState);
|
|
1716
1802
|
setValue(isEnabled ? null : linkSessionValue?.value ?? null);
|
|
1717
1803
|
setLinkSessionValue({ value, meta: { isEnabled: !isEnabled } });
|
|
@@ -1874,17 +1960,79 @@ var Control4 = ({ bind, isLinked }) => {
|
|
|
1874
1960
|
};
|
|
1875
1961
|
|
|
1876
1962
|
// src/controls/svg-media-control.tsx
|
|
1877
|
-
var
|
|
1963
|
+
var React34 = __toESM(require("react"));
|
|
1964
|
+
var import_react13 = require("react");
|
|
1878
1965
|
var import_editor_props18 = require("@elementor/editor-props");
|
|
1879
1966
|
var import_icons9 = require("@elementor/icons");
|
|
1880
|
-
var
|
|
1967
|
+
var import_ui29 = require("@elementor/ui");
|
|
1881
1968
|
var import_wp_media2 = require("@elementor/wp-media");
|
|
1969
|
+
var import_i18n12 = require("@wordpress/i18n");
|
|
1970
|
+
|
|
1971
|
+
// src/components/enable-unfiltered-modal.tsx
|
|
1972
|
+
var React33 = __toESM(require("react"));
|
|
1973
|
+
var import_react12 = require("react");
|
|
1974
|
+
var import_editor_current_user = require("@elementor/editor-current-user");
|
|
1975
|
+
var import_ui28 = require("@elementor/ui");
|
|
1882
1976
|
var import_i18n11 = require("@wordpress/i18n");
|
|
1977
|
+
var ADMIN_TITLE_TEXT = (0, import_i18n11.__)("Enable Unfiltered Uploads", "elementor");
|
|
1978
|
+
var ADMIN_CONTENT_TEXT = (0, import_i18n11.__)(
|
|
1979
|
+
"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.",
|
|
1980
|
+
"elementor"
|
|
1981
|
+
);
|
|
1982
|
+
var NON_ADMIN_TITLE_TEXT = (0, import_i18n11.__)("Sorry, you can't upload that file yet", "elementor");
|
|
1983
|
+
var NON_ADMIN_CONTENT_TEXT = (0, import_i18n11.__)(
|
|
1984
|
+
"This is because this file type may pose a security risk. To upload them anyway, ask the site administrator to enable unfiltered file uploads.",
|
|
1985
|
+
"elementor"
|
|
1986
|
+
);
|
|
1987
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT1 = (0, import_i18n11.__)("Failed to enable unfiltered files upload.", "elementor");
|
|
1988
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT2 = (0, import_i18n11.__)(
|
|
1989
|
+
"You can try again, if the problem persists, please contact support.",
|
|
1990
|
+
"elementor"
|
|
1991
|
+
);
|
|
1992
|
+
var WAIT_FOR_CLOSE_TIMEOUT_MS = 300;
|
|
1993
|
+
var EnableUnfilteredModal = (props) => {
|
|
1994
|
+
const { mutateAsync, isPending } = useUpdateUnfilteredFilesUpload();
|
|
1995
|
+
const { canUser } = (0, import_editor_current_user.useCurrentUserCapabilities)();
|
|
1996
|
+
const [isError, setIsError] = (0, import_react12.useState)(false);
|
|
1997
|
+
const canManageOptions = canUser("manage_options");
|
|
1998
|
+
const onClose = (enabled) => {
|
|
1999
|
+
props.onClose(enabled);
|
|
2000
|
+
setTimeout(() => setIsError(false), WAIT_FOR_CLOSE_TIMEOUT_MS);
|
|
2001
|
+
};
|
|
2002
|
+
const handleEnable = async () => {
|
|
2003
|
+
try {
|
|
2004
|
+
const response = await mutateAsync({ allowUnfilteredFilesUpload: true });
|
|
2005
|
+
if (response?.data?.success === false) {
|
|
2006
|
+
setIsError(true);
|
|
2007
|
+
} else {
|
|
2008
|
+
props.onClose(true);
|
|
2009
|
+
}
|
|
2010
|
+
} catch {
|
|
2011
|
+
setIsError(true);
|
|
2012
|
+
}
|
|
2013
|
+
};
|
|
2014
|
+
const dialogProps = { ...props, isPending, handleEnable, isError, onClose };
|
|
2015
|
+
return canManageOptions ? /* @__PURE__ */ React33.createElement(AdminDialog, { ...dialogProps }) : /* @__PURE__ */ React33.createElement(NonAdminDialog, { ...dialogProps });
|
|
2016
|
+
};
|
|
2017
|
+
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */ React33.createElement(import_ui28.Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React33.createElement(import_ui28.DialogHeader, { logo: false }, /* @__PURE__ */ React33.createElement(import_ui28.DialogTitle, null, ADMIN_TITLE_TEXT)), /* @__PURE__ */ React33.createElement(import_ui28.Divider, null), /* @__PURE__ */ React33.createElement(import_ui28.DialogContent, null, /* @__PURE__ */ React33.createElement(import_ui28.DialogContentText, null, isError ? /* @__PURE__ */ React33.createElement(React33.Fragment, null, ADMIN_FAILED_CONTENT_TEXT_PT1, " ", /* @__PURE__ */ React33.createElement("br", null), " ", ADMIN_FAILED_CONTENT_TEXT_PT2) : ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React33.createElement(import_ui28.DialogActions, null, /* @__PURE__ */ React33.createElement(import_ui28.Button, { size: "medium", color: "secondary", onClick: () => onClose(false) }, (0, import_i18n11.__)("Cancel", "elementor")), /* @__PURE__ */ React33.createElement(
|
|
2018
|
+
import_ui28.Button,
|
|
2019
|
+
{
|
|
2020
|
+
size: "medium",
|
|
2021
|
+
onClick: () => handleEnable(),
|
|
2022
|
+
variant: "contained",
|
|
2023
|
+
color: "primary",
|
|
2024
|
+
disabled: isPending
|
|
2025
|
+
},
|
|
2026
|
+
isPending ? /* @__PURE__ */ React33.createElement(import_ui28.CircularProgress, { size: 24 }) : (0, import_i18n11.__)("Enable", "elementor")
|
|
2027
|
+
)));
|
|
2028
|
+
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */ React33.createElement(import_ui28.Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React33.createElement(import_ui28.DialogHeader, { logo: false }, /* @__PURE__ */ React33.createElement(import_ui28.DialogTitle, null, NON_ADMIN_TITLE_TEXT)), /* @__PURE__ */ React33.createElement(import_ui28.Divider, null), /* @__PURE__ */ React33.createElement(import_ui28.DialogContent, null, /* @__PURE__ */ React33.createElement(import_ui28.DialogContentText, null, NON_ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React33.createElement(import_ui28.DialogActions, null, /* @__PURE__ */ React33.createElement(import_ui28.Button, { size: "medium", onClick: () => onClose(false), variant: "contained", color: "primary" }, (0, import_i18n11.__)("Got it", "elementor"))));
|
|
2029
|
+
|
|
2030
|
+
// src/controls/svg-media-control.tsx
|
|
1883
2031
|
var TILE_SIZE = 8;
|
|
1884
2032
|
var TILE_WHITE = "transparent";
|
|
1885
2033
|
var TILE_BLACK = "#c1c1c1";
|
|
1886
2034
|
var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
|
|
1887
|
-
var StyledCard = (0,
|
|
2035
|
+
var StyledCard = (0, import_ui29.styled)(import_ui29.Card)`
|
|
1888
2036
|
background-color: white;
|
|
1889
2037
|
background-image: ${TILES_GRADIENT_FORMULA}, ${TILES_GRADIENT_FORMULA};
|
|
1890
2038
|
background-size: ${TILE_SIZE}px ${TILE_SIZE}px;
|
|
@@ -1893,7 +2041,7 @@ var StyledCard = (0, import_ui28.styled)(import_ui28.Card)`
|
|
|
1893
2041
|
${TILE_SIZE / 2}px ${TILE_SIZE / 2}px;
|
|
1894
2042
|
border: none;
|
|
1895
2043
|
`;
|
|
1896
|
-
var StyledCardMediaContainer = (0,
|
|
2044
|
+
var StyledCardMediaContainer = (0, import_ui29.styled)(import_ui29.Stack)`
|
|
1897
2045
|
position: relative;
|
|
1898
2046
|
height: 140px;
|
|
1899
2047
|
object-fit: contain;
|
|
@@ -1902,12 +2050,15 @@ var StyledCardMediaContainer = (0, import_ui28.styled)(import_ui28.Stack)`
|
|
|
1902
2050
|
align-items: center;
|
|
1903
2051
|
background-color: rgba( 255, 255, 255, 0.37 );
|
|
1904
2052
|
`;
|
|
2053
|
+
var MODE_BROWSE = { mode: "browse" };
|
|
2054
|
+
var MODE_UPLOAD = { mode: "upload" };
|
|
1905
2055
|
var SvgMediaControl = createControl(() => {
|
|
1906
2056
|
const { value, setValue } = useBoundProp(import_editor_props18.imageSrcPropTypeUtil);
|
|
1907
2057
|
const { id, url } = value ?? {};
|
|
1908
2058
|
const { data: attachment, isFetching } = (0, import_wp_media2.useWpMediaAttachment)(id?.value || null);
|
|
1909
2059
|
const src = attachment?.url ?? url?.value ?? null;
|
|
1910
2060
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
2061
|
+
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0, import_react13.useState)(false);
|
|
1911
2062
|
const { open } = (0, import_wp_media2.useWpMediaFrame)({
|
|
1912
2063
|
mediaTypes: ["svg"],
|
|
1913
2064
|
multiple: false,
|
|
@@ -1922,22 +2073,29 @@ var SvgMediaControl = createControl(() => {
|
|
|
1922
2073
|
});
|
|
1923
2074
|
}
|
|
1924
2075
|
});
|
|
2076
|
+
const onCloseUnfilteredModal = (enabled) => {
|
|
2077
|
+
setUnfilteredModalOpenState(false);
|
|
2078
|
+
if (enabled) {
|
|
2079
|
+
open(MODE_UPLOAD);
|
|
2080
|
+
}
|
|
2081
|
+
};
|
|
1925
2082
|
const handleClick = (openOptions) => {
|
|
1926
|
-
if (allowSvgUpload) {
|
|
1927
|
-
|
|
2083
|
+
if (!allowSvgUpload && openOptions === MODE_UPLOAD) {
|
|
2084
|
+
setUnfilteredModalOpenState(true);
|
|
1928
2085
|
} else {
|
|
2086
|
+
open(openOptions);
|
|
1929
2087
|
}
|
|
1930
2088
|
};
|
|
1931
|
-
return /* @__PURE__ */
|
|
1932
|
-
|
|
2089
|
+
return /* @__PURE__ */ React34.createElement(import_ui29.Stack, { gap: 1 }, /* @__PURE__ */ React34.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: onCloseUnfilteredModal }), /* @__PURE__ */ React34.createElement(ControlLabel, null, " ", (0, import_i18n12.__)("SVG", "elementor"), " "), /* @__PURE__ */ React34.createElement(ControlActions, null, /* @__PURE__ */ React34.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React34.createElement(StyledCardMediaContainer, null, isFetching ? /* @__PURE__ */ React34.createElement(import_ui29.CircularProgress, { role: "progressbar" }) : /* @__PURE__ */ React34.createElement(
|
|
2090
|
+
import_ui29.CardMedia,
|
|
1933
2091
|
{
|
|
1934
2092
|
component: "img",
|
|
1935
2093
|
image: src,
|
|
1936
|
-
alt: (0,
|
|
2094
|
+
alt: (0, import_i18n12.__)("Preview SVG", "elementor"),
|
|
1937
2095
|
sx: { maxHeight: "140px", width: "50px" }
|
|
1938
2096
|
}
|
|
1939
|
-
)), /* @__PURE__ */
|
|
1940
|
-
|
|
2097
|
+
)), /* @__PURE__ */ React34.createElement(
|
|
2098
|
+
import_ui29.CardOverlay,
|
|
1941
2099
|
{
|
|
1942
2100
|
sx: {
|
|
1943
2101
|
"&:hover": {
|
|
@@ -1945,50 +2103,50 @@ var SvgMediaControl = createControl(() => {
|
|
|
1945
2103
|
}
|
|
1946
2104
|
}
|
|
1947
2105
|
},
|
|
1948
|
-
/* @__PURE__ */
|
|
1949
|
-
|
|
2106
|
+
/* @__PURE__ */ React34.createElement(import_ui29.Stack, { gap: 1 }, /* @__PURE__ */ React34.createElement(
|
|
2107
|
+
import_ui29.Button,
|
|
1950
2108
|
{
|
|
1951
2109
|
size: "tiny",
|
|
1952
2110
|
color: "inherit",
|
|
1953
2111
|
variant: "outlined",
|
|
1954
|
-
onClick: () => handleClick(
|
|
2112
|
+
onClick: () => handleClick(MODE_BROWSE)
|
|
1955
2113
|
},
|
|
1956
|
-
(0,
|
|
1957
|
-
), /* @__PURE__ */
|
|
1958
|
-
|
|
2114
|
+
(0, import_i18n12.__)("Select SVG", "elementor")
|
|
2115
|
+
), /* @__PURE__ */ React34.createElement(
|
|
2116
|
+
import_ui29.Button,
|
|
1959
2117
|
{
|
|
1960
2118
|
size: "tiny",
|
|
1961
2119
|
variant: "text",
|
|
1962
2120
|
color: "inherit",
|
|
1963
|
-
startIcon: /* @__PURE__ */
|
|
1964
|
-
onClick: () => handleClick(
|
|
2121
|
+
startIcon: /* @__PURE__ */ React34.createElement(import_icons9.UploadIcon, null),
|
|
2122
|
+
onClick: () => handleClick(MODE_UPLOAD)
|
|
1965
2123
|
},
|
|
1966
|
-
(0,
|
|
2124
|
+
(0, import_i18n12.__)("Upload", "elementor")
|
|
1967
2125
|
))
|
|
1968
2126
|
))));
|
|
1969
2127
|
});
|
|
1970
2128
|
|
|
1971
2129
|
// src/controls/background-control/background-control.tsx
|
|
1972
|
-
var
|
|
2130
|
+
var React41 = __toESM(require("react"));
|
|
1973
2131
|
var import_editor_props24 = require("@elementor/editor-props");
|
|
1974
|
-
var
|
|
1975
|
-
var
|
|
2132
|
+
var import_ui37 = require("@elementor/ui");
|
|
2133
|
+
var import_i18n18 = require("@wordpress/i18n");
|
|
1976
2134
|
|
|
1977
2135
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
1978
|
-
var
|
|
2136
|
+
var React40 = __toESM(require("react"));
|
|
1979
2137
|
var import_editor_props23 = require("@elementor/editor-props");
|
|
1980
|
-
var
|
|
2138
|
+
var import_ui36 = require("@elementor/ui");
|
|
1981
2139
|
var import_wp_media3 = require("@elementor/wp-media");
|
|
1982
|
-
var
|
|
2140
|
+
var import_i18n17 = require("@wordpress/i18n");
|
|
1983
2141
|
|
|
1984
2142
|
// src/env.ts
|
|
1985
2143
|
var import_env = require("@elementor/env");
|
|
1986
2144
|
var { env } = (0, import_env.parseEnv)("@elementor/editor-controls");
|
|
1987
2145
|
|
|
1988
2146
|
// src/controls/background-control/background-gradient-color-control.tsx
|
|
1989
|
-
var
|
|
2147
|
+
var React35 = __toESM(require("react"));
|
|
1990
2148
|
var import_editor_props19 = require("@elementor/editor-props");
|
|
1991
|
-
var
|
|
2149
|
+
var import_ui30 = require("@elementor/ui");
|
|
1992
2150
|
var BackgroundGradientColorControl = createControl(() => {
|
|
1993
2151
|
const { value, setValue } = useBoundProp(import_editor_props19.backgroundGradientOverlayPropTypeUtil);
|
|
1994
2152
|
const handleChange = (newValue) => {
|
|
@@ -2026,8 +2184,8 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
2026
2184
|
positions: positions?.value.split(" ")
|
|
2027
2185
|
};
|
|
2028
2186
|
};
|
|
2029
|
-
return /* @__PURE__ */
|
|
2030
|
-
|
|
2187
|
+
return /* @__PURE__ */ React35.createElement(ControlActions, null, /* @__PURE__ */ React35.createElement(
|
|
2188
|
+
import_ui30.UnstableGradientBox,
|
|
2031
2189
|
{
|
|
2032
2190
|
sx: { width: "auto", padding: 1.5 },
|
|
2033
2191
|
value: normalizeValue(),
|
|
@@ -2040,7 +2198,7 @@ var initialBackgroundGradientOverlay = import_editor_props19.backgroundGradientO
|
|
|
2040
2198
|
angle: import_editor_props19.numberPropTypeUtil.create(180),
|
|
2041
2199
|
stops: import_editor_props19.gradientColorStopPropTypeUtil.create([
|
|
2042
2200
|
import_editor_props19.colorStopPropTypeUtil.create({
|
|
2043
|
-
color: import_editor_props19.
|
|
2201
|
+
color: import_editor_props19.colorPropTypeUtil.create("rgb(0,0,0)"),
|
|
2044
2202
|
offset: import_editor_props19.numberPropTypeUtil.create(0)
|
|
2045
2203
|
}),
|
|
2046
2204
|
import_editor_props19.colorStopPropTypeUtil.create({
|
|
@@ -2051,45 +2209,45 @@ var initialBackgroundGradientOverlay = import_editor_props19.backgroundGradientO
|
|
|
2051
2209
|
});
|
|
2052
2210
|
|
|
2053
2211
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
2054
|
-
var
|
|
2212
|
+
var React36 = __toESM(require("react"));
|
|
2055
2213
|
var import_icons10 = require("@elementor/icons");
|
|
2056
|
-
var
|
|
2057
|
-
var
|
|
2214
|
+
var import_ui31 = require("@elementor/ui");
|
|
2215
|
+
var import_i18n13 = require("@wordpress/i18n");
|
|
2058
2216
|
var attachmentControlOptions = [
|
|
2059
2217
|
{
|
|
2060
2218
|
value: "fixed",
|
|
2061
|
-
label: (0,
|
|
2062
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2219
|
+
label: (0, import_i18n13.__)("Fixed", "elementor"),
|
|
2220
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(import_icons10.PinIcon, { fontSize: size }),
|
|
2063
2221
|
showTooltip: true
|
|
2064
2222
|
},
|
|
2065
2223
|
{
|
|
2066
2224
|
value: "scroll",
|
|
2067
|
-
label: (0,
|
|
2068
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2225
|
+
label: (0, import_i18n13.__)("Scroll", "elementor"),
|
|
2226
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(import_icons10.PinnedOffIcon, { fontSize: size }),
|
|
2069
2227
|
showTooltip: true
|
|
2070
2228
|
}
|
|
2071
2229
|
];
|
|
2072
2230
|
var BackgroundImageOverlayAttachment = () => {
|
|
2073
|
-
return /* @__PURE__ */
|
|
2231
|
+
return /* @__PURE__ */ React36.createElement(PopoverGridContainer, null, /* @__PURE__ */ React36.createElement(import_ui31.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(ControlLabel, null, (0, import_i18n13.__)("Attachment", "elementor"))), /* @__PURE__ */ React36.createElement(import_ui31.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React36.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
2074
2232
|
};
|
|
2075
2233
|
|
|
2076
2234
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
2077
|
-
var
|
|
2235
|
+
var React37 = __toESM(require("react"));
|
|
2078
2236
|
var import_editor_props20 = require("@elementor/editor-props");
|
|
2079
2237
|
var import_icons11 = require("@elementor/icons");
|
|
2080
|
-
var
|
|
2081
|
-
var
|
|
2238
|
+
var import_ui32 = require("@elementor/ui");
|
|
2239
|
+
var import_i18n14 = require("@wordpress/i18n");
|
|
2082
2240
|
var backgroundPositionOptions = [
|
|
2083
|
-
{ label: (0,
|
|
2084
|
-
{ label: (0,
|
|
2085
|
-
{ label: (0,
|
|
2086
|
-
{ label: (0,
|
|
2087
|
-
{ label: (0,
|
|
2088
|
-
{ label: (0,
|
|
2089
|
-
{ label: (0,
|
|
2090
|
-
{ label: (0,
|
|
2091
|
-
{ label: (0,
|
|
2092
|
-
{ label: (0,
|
|
2241
|
+
{ label: (0, import_i18n14.__)("Center center", "elementor"), value: "center center" },
|
|
2242
|
+
{ label: (0, import_i18n14.__)("Center left", "elementor"), value: "center left" },
|
|
2243
|
+
{ label: (0, import_i18n14.__)("Center right", "elementor"), value: "center right" },
|
|
2244
|
+
{ label: (0, import_i18n14.__)("Top center", "elementor"), value: "top center" },
|
|
2245
|
+
{ label: (0, import_i18n14.__)("Top left", "elementor"), value: "top left" },
|
|
2246
|
+
{ label: (0, import_i18n14.__)("Top right", "elementor"), value: "top right" },
|
|
2247
|
+
{ label: (0, import_i18n14.__)("Bottom center", "elementor"), value: "bottom center" },
|
|
2248
|
+
{ label: (0, import_i18n14.__)("Bottom left", "elementor"), value: "bottom left" },
|
|
2249
|
+
{ label: (0, import_i18n14.__)("Bottom right", "elementor"), value: "bottom right" },
|
|
2250
|
+
{ label: (0, import_i18n14.__)("Custom", "elementor"), value: "custom" }
|
|
2093
2251
|
];
|
|
2094
2252
|
var BackgroundImageOverlayPosition = () => {
|
|
2095
2253
|
const backgroundImageOffsetContext = useBoundProp(import_editor_props20.backgroundImagePositionOffsetPropTypeUtil);
|
|
@@ -2103,82 +2261,82 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
2103
2261
|
stringPropContext.setValue(value);
|
|
2104
2262
|
}
|
|
2105
2263
|
};
|
|
2106
|
-
return /* @__PURE__ */
|
|
2107
|
-
|
|
2264
|
+
return /* @__PURE__ */ React37.createElement(import_ui32.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(PopoverGridContainer, null, /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(ControlLabel, null, (0, import_i18n14.__)("Position", "elementor"))), /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React37.createElement(
|
|
2265
|
+
import_ui32.Select,
|
|
2108
2266
|
{
|
|
2109
2267
|
size: "tiny",
|
|
2110
2268
|
value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? "",
|
|
2111
2269
|
onChange: handlePositionChange,
|
|
2112
2270
|
fullWidth: true
|
|
2113
2271
|
},
|
|
2114
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
2115
|
-
)))), isCustom ? /* @__PURE__ */
|
|
2272
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React37.createElement(import_ui32.MenuItem, { key: value, value: value ?? "" }, label))
|
|
2273
|
+
)))), isCustom ? /* @__PURE__ */ React37.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(import_ui32.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React37.createElement(SizeControl, { startIcon: /* @__PURE__ */ React37.createElement(import_icons11.LetterXIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React37.createElement(SizeControl, { startIcon: /* @__PURE__ */ React37.createElement(import_icons11.LetterYIcon, { fontSize: "tiny" }) })))))) : null);
|
|
2116
2274
|
};
|
|
2117
2275
|
|
|
2118
2276
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
2119
|
-
var
|
|
2277
|
+
var React38 = __toESM(require("react"));
|
|
2120
2278
|
var import_icons12 = require("@elementor/icons");
|
|
2121
|
-
var
|
|
2122
|
-
var
|
|
2279
|
+
var import_ui33 = require("@elementor/ui");
|
|
2280
|
+
var import_i18n15 = require("@wordpress/i18n");
|
|
2123
2281
|
var repeatControlOptions = [
|
|
2124
2282
|
{
|
|
2125
2283
|
value: "repeat",
|
|
2126
|
-
label: (0,
|
|
2127
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2284
|
+
label: (0, import_i18n15.__)("Repeat", "elementor"),
|
|
2285
|
+
renderContent: ({ size }) => /* @__PURE__ */ React38.createElement(import_icons12.GridDotsIcon, { fontSize: size }),
|
|
2128
2286
|
showTooltip: true
|
|
2129
2287
|
},
|
|
2130
2288
|
{
|
|
2131
2289
|
value: "repeat-x",
|
|
2132
|
-
label: (0,
|
|
2133
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2290
|
+
label: (0, import_i18n15.__)("Repeat-x", "elementor"),
|
|
2291
|
+
renderContent: ({ size }) => /* @__PURE__ */ React38.createElement(import_icons12.DotsHorizontalIcon, { fontSize: size }),
|
|
2134
2292
|
showTooltip: true
|
|
2135
2293
|
},
|
|
2136
2294
|
{
|
|
2137
2295
|
value: "repeat-y",
|
|
2138
|
-
label: (0,
|
|
2139
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2296
|
+
label: (0, import_i18n15.__)("Repeat-y", "elementor"),
|
|
2297
|
+
renderContent: ({ size }) => /* @__PURE__ */ React38.createElement(import_icons12.DotsVerticalIcon, { fontSize: size }),
|
|
2140
2298
|
showTooltip: true
|
|
2141
2299
|
},
|
|
2142
2300
|
{
|
|
2143
2301
|
value: "no-repeat",
|
|
2144
|
-
label: (0,
|
|
2145
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2302
|
+
label: (0, import_i18n15.__)("No-repeat", "elementor"),
|
|
2303
|
+
renderContent: ({ size }) => /* @__PURE__ */ React38.createElement(import_icons12.XIcon, { fontSize: size }),
|
|
2146
2304
|
showTooltip: true
|
|
2147
2305
|
}
|
|
2148
2306
|
];
|
|
2149
2307
|
var BackgroundImageOverlayRepeat = () => {
|
|
2150
|
-
return /* @__PURE__ */
|
|
2308
|
+
return /* @__PURE__ */ React38.createElement(PopoverGridContainer, null, /* @__PURE__ */ React38.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(ControlLabel, null, (0, import_i18n15.__)("Repeat", "elementor"))), /* @__PURE__ */ React38.createElement(import_ui33.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React38.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
2151
2309
|
};
|
|
2152
2310
|
|
|
2153
2311
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
2154
|
-
var
|
|
2312
|
+
var React39 = __toESM(require("react"));
|
|
2155
2313
|
var import_editor_props21 = require("@elementor/editor-props");
|
|
2156
2314
|
var import_icons13 = require("@elementor/icons");
|
|
2157
|
-
var
|
|
2158
|
-
var
|
|
2315
|
+
var import_ui34 = require("@elementor/ui");
|
|
2316
|
+
var import_i18n16 = require("@wordpress/i18n");
|
|
2159
2317
|
var sizeControlOptions = [
|
|
2160
2318
|
{
|
|
2161
2319
|
value: "auto",
|
|
2162
|
-
label: (0,
|
|
2163
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2320
|
+
label: (0, import_i18n16.__)("Auto", "elementor"),
|
|
2321
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(import_icons13.LetterAIcon, { fontSize: size }),
|
|
2164
2322
|
showTooltip: true
|
|
2165
2323
|
},
|
|
2166
2324
|
{
|
|
2167
2325
|
value: "cover",
|
|
2168
|
-
label: (0,
|
|
2169
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2326
|
+
label: (0, import_i18n16.__)("Cover", "elementor"),
|
|
2327
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(import_icons13.ArrowsMaximizeIcon, { fontSize: size }),
|
|
2170
2328
|
showTooltip: true
|
|
2171
2329
|
},
|
|
2172
2330
|
{
|
|
2173
2331
|
value: "contain",
|
|
2174
|
-
label: (0,
|
|
2175
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2332
|
+
label: (0, import_i18n16.__)("Contain", "elementor"),
|
|
2333
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(import_icons13.ArrowBarBothIcon, { fontSize: size }),
|
|
2176
2334
|
showTooltip: true
|
|
2177
2335
|
},
|
|
2178
2336
|
{
|
|
2179
2337
|
value: "custom",
|
|
2180
|
-
label: (0,
|
|
2181
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2338
|
+
label: (0, import_i18n16.__)("Custom", "elementor"),
|
|
2339
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(import_icons13.PencilIcon, { fontSize: size }),
|
|
2182
2340
|
showTooltip: true
|
|
2183
2341
|
}
|
|
2184
2342
|
];
|
|
@@ -2193,7 +2351,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
2193
2351
|
stringPropContext.setValue(size);
|
|
2194
2352
|
}
|
|
2195
2353
|
};
|
|
2196
|
-
return /* @__PURE__ */
|
|
2354
|
+
return /* @__PURE__ */ React39.createElement(import_ui34.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React39.createElement(import_ui34.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(PopoverGridContainer, null, /* @__PURE__ */ React39.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlLabel, null, (0, import_i18n16.__)("Size", "elementor"))), /* @__PURE__ */ React39.createElement(import_ui34.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React39.createElement(
|
|
2197
2355
|
ControlToggleButtonGroup,
|
|
2198
2356
|
{
|
|
2199
2357
|
exclusive: true,
|
|
@@ -2201,25 +2359,25 @@ var BackgroundImageOverlaySize = () => {
|
|
|
2201
2359
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value,
|
|
2202
2360
|
onChange: handleSizeChange
|
|
2203
2361
|
}
|
|
2204
|
-
)))), isCustom ? /* @__PURE__ */
|
|
2362
|
+
)))), isCustom ? /* @__PURE__ */ React39.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React39.createElement(import_ui34.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(PopoverGridContainer, null, /* @__PURE__ */ React39.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React39.createElement(
|
|
2205
2363
|
SizeControl,
|
|
2206
2364
|
{
|
|
2207
|
-
startIcon: /* @__PURE__ */
|
|
2365
|
+
startIcon: /* @__PURE__ */ React39.createElement(import_icons13.ArrowsMoveHorizontalIcon, { fontSize: "tiny" }),
|
|
2208
2366
|
extendedValues: ["auto"]
|
|
2209
2367
|
}
|
|
2210
|
-
))), /* @__PURE__ */
|
|
2368
|
+
))), /* @__PURE__ */ React39.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React39.createElement(
|
|
2211
2369
|
SizeControl,
|
|
2212
2370
|
{
|
|
2213
|
-
startIcon: /* @__PURE__ */
|
|
2371
|
+
startIcon: /* @__PURE__ */ React39.createElement(import_icons13.ArrowsMoveVerticalIcon, { fontSize: "tiny" }),
|
|
2214
2372
|
extendedValues: ["auto"]
|
|
2215
2373
|
}
|
|
2216
2374
|
)))))) : null);
|
|
2217
2375
|
};
|
|
2218
2376
|
|
|
2219
2377
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
2220
|
-
var
|
|
2378
|
+
var import_react14 = require("react");
|
|
2221
2379
|
var import_editor_props22 = require("@elementor/editor-props");
|
|
2222
|
-
var
|
|
2380
|
+
var import_ui35 = require("@elementor/ui");
|
|
2223
2381
|
var useBackgroundTabsHistory = ({
|
|
2224
2382
|
color: initialBackgroundColorOverlay2,
|
|
2225
2383
|
image: initialBackgroundImageOverlay,
|
|
@@ -2237,8 +2395,8 @@ var useBackgroundTabsHistory = ({
|
|
|
2237
2395
|
}
|
|
2238
2396
|
return "image";
|
|
2239
2397
|
};
|
|
2240
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
2241
|
-
const valuesHistory = (0,
|
|
2398
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui35.useTabs)(getCurrentOverlayType());
|
|
2399
|
+
const valuesHistory = (0, import_react14.useRef)({
|
|
2242
2400
|
image: initialBackgroundImageOverlay,
|
|
2243
2401
|
color: initialBackgroundColorOverlay2,
|
|
2244
2402
|
gradient: initialBackgroundGradientOverlay2
|
|
@@ -2275,10 +2433,12 @@ var useBackgroundTabsHistory = ({
|
|
|
2275
2433
|
};
|
|
2276
2434
|
|
|
2277
2435
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
2278
|
-
var
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2436
|
+
var DEFAULT_BACKGROUND_COLOR_OVERLAY_COLOR = "#00000033";
|
|
2437
|
+
var initialBackgroundColorOverlay = import_editor_props23.backgroundColorOverlayPropTypeUtil.create(
|
|
2438
|
+
{
|
|
2439
|
+
color: import_editor_props23.colorPropTypeUtil.create(DEFAULT_BACKGROUND_COLOR_OVERLAY_COLOR)
|
|
2440
|
+
}
|
|
2441
|
+
);
|
|
2282
2442
|
var getInitialBackgroundOverlay = () => ({
|
|
2283
2443
|
$$type: "background-image-overlay",
|
|
2284
2444
|
value: {
|
|
@@ -2304,19 +2464,20 @@ var getInitialBackgroundOverlay = () => ({
|
|
|
2304
2464
|
}
|
|
2305
2465
|
});
|
|
2306
2466
|
var backgroundResolutionOptions = [
|
|
2307
|
-
{ label: (0,
|
|
2308
|
-
{ label: (0,
|
|
2309
|
-
{ label: (0,
|
|
2310
|
-
{ label: (0,
|
|
2467
|
+
{ label: (0, import_i18n17.__)("Thumbnail - 150 x 150", "elementor"), value: "thumbnail" },
|
|
2468
|
+
{ label: (0, import_i18n17.__)("Medium - 300 x 300", "elementor"), value: "medium" },
|
|
2469
|
+
{ label: (0, import_i18n17.__)("Large 1024 x 1024", "elementor"), value: "large" },
|
|
2470
|
+
{ label: (0, import_i18n17.__)("Full", "elementor"), value: "full" }
|
|
2311
2471
|
];
|
|
2312
2472
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
2313
2473
|
const { propType, value: overlayValues, setValue } = useBoundProp(import_editor_props23.backgroundOverlayPropTypeUtil);
|
|
2314
|
-
return /* @__PURE__ */
|
|
2474
|
+
return /* @__PURE__ */ React40.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React40.createElement(
|
|
2315
2475
|
Repeater,
|
|
2316
2476
|
{
|
|
2477
|
+
openOnAdd: true,
|
|
2317
2478
|
values: overlayValues ?? [],
|
|
2318
2479
|
setValues: setValue,
|
|
2319
|
-
label: (0,
|
|
2480
|
+
label: (0, import_i18n17.__)("Overlay", "elementor"),
|
|
2320
2481
|
itemSettings: {
|
|
2321
2482
|
Icon: ItemIcon2,
|
|
2322
2483
|
Label: ItemLabel2,
|
|
@@ -2327,7 +2488,7 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
2327
2488
|
));
|
|
2328
2489
|
});
|
|
2329
2490
|
var ItemContent2 = ({ bind }) => {
|
|
2330
|
-
return /* @__PURE__ */
|
|
2491
|
+
return /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React40.createElement(Content2, null));
|
|
2331
2492
|
};
|
|
2332
2493
|
var Content2 = () => {
|
|
2333
2494
|
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
@@ -2335,65 +2496,77 @@ var Content2 = () => {
|
|
|
2335
2496
|
color: initialBackgroundColorOverlay.value,
|
|
2336
2497
|
gradient: initialBackgroundGradientOverlay.value
|
|
2337
2498
|
});
|
|
2338
|
-
return /* @__PURE__ */
|
|
2499
|
+
return /* @__PURE__ */ React40.createElement(import_ui36.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React40.createElement(import_ui36.Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React40.createElement(import_ui36.Tabs, { ...getTabsProps(), "aria-label": (0, import_i18n17.__)("Background Overlay", "elementor") }, /* @__PURE__ */ React40.createElement(import_ui36.Tab, { label: (0, import_i18n17.__)("Image", "elementor"), ...getTabProps("image") }), /* @__PURE__ */ React40.createElement(import_ui36.Tab, { label: (0, import_i18n17.__)("Gradient", "elementor"), ...getTabProps("gradient") }), /* @__PURE__ */ React40.createElement(import_ui36.Tab, { label: (0, import_i18n17.__)("Color", "elementor"), ...getTabProps("color") }))), /* @__PURE__ */ React40.createElement(import_ui36.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React40.createElement(PopoverContent, null, /* @__PURE__ */ React40.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React40.createElement(import_ui36.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("gradient") }, /* @__PURE__ */ React40.createElement(BackgroundGradientColorControl, null)), /* @__PURE__ */ React40.createElement(import_ui36.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("color") }, /* @__PURE__ */ React40.createElement(PopoverContent, null, /* @__PURE__ */ React40.createElement(ColorOverlayContent, null))));
|
|
2339
2500
|
};
|
|
2340
2501
|
var ItemIcon2 = ({ value }) => {
|
|
2341
2502
|
switch (value.$$type) {
|
|
2342
2503
|
case "background-image-overlay":
|
|
2343
|
-
return /* @__PURE__ */
|
|
2504
|
+
return /* @__PURE__ */ React40.createElement(ItemIconImage, { value });
|
|
2344
2505
|
case "background-color-overlay":
|
|
2345
|
-
return /* @__PURE__ */
|
|
2506
|
+
return /* @__PURE__ */ React40.createElement(ItemIconColor, { value });
|
|
2346
2507
|
case "background-gradient-overlay":
|
|
2347
|
-
return /* @__PURE__ */
|
|
2508
|
+
return /* @__PURE__ */ React40.createElement(ItemIconGradient, { value });
|
|
2348
2509
|
default:
|
|
2349
2510
|
return null;
|
|
2350
2511
|
}
|
|
2351
2512
|
};
|
|
2352
|
-
var
|
|
2353
|
-
|
|
2513
|
+
var extractColorFrom = (prop) => {
|
|
2514
|
+
if (prop?.value?.color?.value) {
|
|
2515
|
+
return prop.value.color.value;
|
|
2516
|
+
}
|
|
2517
|
+
return "";
|
|
2518
|
+
};
|
|
2519
|
+
var ItemIconColor = ({ value: prop }) => {
|
|
2520
|
+
const color = extractColorFrom(prop);
|
|
2521
|
+
return /* @__PURE__ */ React40.createElement(import_ui36.UnstableColorIndicator, { size: "inherit", component: "span", value: color });
|
|
2354
2522
|
};
|
|
2355
2523
|
var ItemIconImage = ({ value }) => {
|
|
2356
2524
|
const { imageUrl } = useImage(value);
|
|
2357
|
-
return /* @__PURE__ */
|
|
2525
|
+
return /* @__PURE__ */ React40.createElement(import_ui36.CardMedia, { image: imageUrl, sx: { height: 13, width: 13, borderRadius: "4px" } });
|
|
2358
2526
|
};
|
|
2359
2527
|
var ItemIconGradient = ({ value }) => {
|
|
2360
2528
|
const gradient = getGradientValue(value);
|
|
2361
|
-
return /* @__PURE__ */
|
|
2529
|
+
return /* @__PURE__ */ React40.createElement(import_ui36.UnstableColorIndicator, { size: "inherit", component: "span", value: gradient });
|
|
2362
2530
|
};
|
|
2363
2531
|
var ItemLabel2 = ({ value }) => {
|
|
2364
2532
|
switch (value.$$type) {
|
|
2365
2533
|
case "background-image-overlay":
|
|
2366
|
-
return /* @__PURE__ */
|
|
2534
|
+
return /* @__PURE__ */ React40.createElement(ItemLabelImage, { value });
|
|
2367
2535
|
case "background-color-overlay":
|
|
2368
|
-
return /* @__PURE__ */
|
|
2536
|
+
return /* @__PURE__ */ React40.createElement(ItemLabelColor, { value });
|
|
2369
2537
|
case "background-gradient-overlay":
|
|
2370
|
-
return /* @__PURE__ */
|
|
2538
|
+
return /* @__PURE__ */ React40.createElement(ItemLabelGradient, { value });
|
|
2371
2539
|
default:
|
|
2372
2540
|
return null;
|
|
2373
2541
|
}
|
|
2374
2542
|
};
|
|
2375
|
-
var ItemLabelColor = ({ value }) => {
|
|
2376
|
-
|
|
2543
|
+
var ItemLabelColor = ({ value: prop }) => {
|
|
2544
|
+
const color = extractColorFrom(prop);
|
|
2545
|
+
return /* @__PURE__ */ React40.createElement("span", null, color);
|
|
2377
2546
|
};
|
|
2378
2547
|
var ItemLabelImage = ({ value }) => {
|
|
2379
2548
|
const { imageTitle } = useImage(value);
|
|
2380
|
-
return /* @__PURE__ */
|
|
2549
|
+
return /* @__PURE__ */ React40.createElement("span", null, imageTitle);
|
|
2381
2550
|
};
|
|
2382
2551
|
var ItemLabelGradient = ({ value }) => {
|
|
2383
2552
|
if (value.value.type.value === "linear") {
|
|
2384
|
-
return /* @__PURE__ */
|
|
2553
|
+
return /* @__PURE__ */ React40.createElement("span", null, (0, import_i18n17.__)("Linear Gradient", "elementor"));
|
|
2385
2554
|
}
|
|
2386
|
-
return /* @__PURE__ */
|
|
2555
|
+
return /* @__PURE__ */ React40.createElement("span", null, (0, import_i18n17.__)("Radial Gradient", "elementor"));
|
|
2556
|
+
};
|
|
2557
|
+
var ColorOverlayContent = () => {
|
|
2558
|
+
const propContext = useBoundProp(import_editor_props23.backgroundColorOverlayPropTypeUtil);
|
|
2559
|
+
return /* @__PURE__ */ React40.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React40.createElement(ColorControl, null)));
|
|
2387
2560
|
};
|
|
2388
2561
|
var ImageOverlayContent = () => {
|
|
2389
2562
|
const propContext = useBoundProp(import_editor_props23.backgroundImageOverlayPropTypeUtil);
|
|
2390
|
-
return /* @__PURE__ */
|
|
2563
|
+
return /* @__PURE__ */ React40.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React40.createElement(import_ui36.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React40.createElement(import_ui36.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React40.createElement(
|
|
2391
2564
|
ImageControl,
|
|
2392
2565
|
{
|
|
2393
|
-
resolutionLabel: (0,
|
|
2566
|
+
resolutionLabel: (0, import_i18n17.__)("Resolution", "elementor"),
|
|
2394
2567
|
sizes: backgroundResolutionOptions
|
|
2395
2568
|
}
|
|
2396
|
-
)))), /* @__PURE__ */
|
|
2569
|
+
)))), /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React40.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React40.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React40.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React40.createElement(BackgroundImageOverlayAttachment, null)));
|
|
2397
2570
|
};
|
|
2398
2571
|
var useImage = (image) => {
|
|
2399
2572
|
let imageTitle, imageUrl = null;
|
|
@@ -2421,7 +2594,7 @@ var getGradientValue = (value) => {
|
|
|
2421
2594
|
// src/controls/background-control/background-control.tsx
|
|
2422
2595
|
var BackgroundControl = createControl(() => {
|
|
2423
2596
|
const propContext = useBoundProp(import_editor_props24.backgroundPropTypeUtil);
|
|
2424
|
-
return /* @__PURE__ */
|
|
2597
|
+
return /* @__PURE__ */ React41.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React41.createElement(SectionContent, null, /* @__PURE__ */ React41.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React41.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React41.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React41.createElement(import_ui37.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ControlLabel, null, (0, import_i18n18.__)("Color", "elementor"))), /* @__PURE__ */ React41.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ColorControl, null))))));
|
|
2425
2598
|
});
|
|
2426
2599
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2427
2600
|
0 && (module.exports = {
|