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