@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.mjs
CHANGED
|
@@ -232,6 +232,17 @@ var useUnfilteredFilesUpload = () => useQuery({
|
|
|
232
232
|
}),
|
|
233
233
|
staleTime: Infinity
|
|
234
234
|
});
|
|
235
|
+
function useUpdateUnfilteredFilesUpload() {
|
|
236
|
+
const queryClient = useQueryClient();
|
|
237
|
+
const mutate = useMutation({
|
|
238
|
+
mutationFn: ({ allowUnfilteredFilesUpload }) => apiClient.updateElementorSetting(
|
|
239
|
+
UNFILTERED_FILES_UPLOAD_KEY,
|
|
240
|
+
allowUnfilteredFilesUpload ? "1" : "0"
|
|
241
|
+
),
|
|
242
|
+
onSuccess: () => queryClient.invalidateQueries(unfilteredFilesQueryKey)
|
|
243
|
+
});
|
|
244
|
+
return mutate;
|
|
245
|
+
}
|
|
235
246
|
var formatResponse = (response) => {
|
|
236
247
|
return Boolean(response === "1");
|
|
237
248
|
};
|
|
@@ -630,7 +641,7 @@ var PopoverGridContainer = ({
|
|
|
630
641
|
|
|
631
642
|
// src/components/repeater.tsx
|
|
632
643
|
import * as React21 from "react";
|
|
633
|
-
import {
|
|
644
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
634
645
|
import { CopyIcon, EyeIcon, EyeOffIcon, PlusIcon, XIcon } from "@elementor/icons";
|
|
635
646
|
import {
|
|
636
647
|
bindPopover,
|
|
@@ -658,15 +669,7 @@ import {
|
|
|
658
669
|
UnstableSortableProvider
|
|
659
670
|
} from "@elementor/ui";
|
|
660
671
|
var SortableProvider = (props) => {
|
|
661
|
-
return /* @__PURE__ */ React20.createElement(List, { sx: { p: 0,
|
|
662
|
-
UnstableSortableProvider,
|
|
663
|
-
{
|
|
664
|
-
restrictAxis: true,
|
|
665
|
-
disableDragOverlay: false,
|
|
666
|
-
variant: "static",
|
|
667
|
-
...props
|
|
668
|
-
}
|
|
669
|
-
));
|
|
672
|
+
return /* @__PURE__ */ React20.createElement(List, { sx: { p: 0, my: -0.5, mx: 0 } }, /* @__PURE__ */ React20.createElement(UnstableSortableProvider, { restrictAxis: true, disableDragOverlay: false, variant: "static", ...props }));
|
|
670
673
|
};
|
|
671
674
|
var SortableItem = ({ id, children }) => {
|
|
672
675
|
return /* @__PURE__ */ React20.createElement(
|
|
@@ -744,10 +747,12 @@ var SIZE = "tiny";
|
|
|
744
747
|
var Repeater = ({
|
|
745
748
|
label,
|
|
746
749
|
itemSettings,
|
|
750
|
+
openOnAdd = false,
|
|
747
751
|
addToBottom = false,
|
|
748
752
|
values: repeaterValues = [],
|
|
749
753
|
setValues: setRepeaterValues
|
|
750
754
|
}) => {
|
|
755
|
+
const [openItem, setOpenItem] = useState2(-1);
|
|
751
756
|
const [items, setItems] = useSyncExternalState({
|
|
752
757
|
external: repeaterValues,
|
|
753
758
|
// @ts-expect-error - as long as persistWhen => true, value will never be null
|
|
@@ -768,6 +773,9 @@ var Repeater = ({
|
|
|
768
773
|
setItems([newItem, ...items]);
|
|
769
774
|
setUniqueKeys([newKey, ...uniqueKeys]);
|
|
770
775
|
}
|
|
776
|
+
if (openOnAdd) {
|
|
777
|
+
setOpenItem(newKey);
|
|
778
|
+
}
|
|
771
779
|
};
|
|
772
780
|
const duplicateRepeaterItem = (index) => {
|
|
773
781
|
const newItem = structuredClone(items[index]);
|
|
@@ -822,7 +830,8 @@ var Repeater = ({
|
|
|
822
830
|
startIcon: /* @__PURE__ */ React21.createElement(itemSettings.Icon, { value }),
|
|
823
831
|
removeItem: () => removeRepeaterItem(index),
|
|
824
832
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
825
|
-
toggleDisableItem: () => toggleDisableRepeaterItem(index)
|
|
833
|
+
toggleDisableItem: () => toggleDisableRepeaterItem(index),
|
|
834
|
+
openOnMount: openOnAdd && openItem === key
|
|
826
835
|
},
|
|
827
836
|
(props) => /* @__PURE__ */ React21.createElement(itemSettings.Content, { ...props, value, bind: String(index) })
|
|
828
837
|
));
|
|
@@ -830,19 +839,16 @@ var Repeater = ({
|
|
|
830
839
|
};
|
|
831
840
|
var RepeaterItem = ({
|
|
832
841
|
label,
|
|
833
|
-
bind,
|
|
834
842
|
disabled,
|
|
835
843
|
startIcon,
|
|
836
844
|
children,
|
|
837
845
|
removeItem,
|
|
838
846
|
duplicateItem,
|
|
839
|
-
toggleDisableItem
|
|
847
|
+
toggleDisableItem,
|
|
848
|
+
openOnMount
|
|
840
849
|
}) => {
|
|
841
|
-
const popupId = `repeater-popup-${bind}`;
|
|
842
|
-
const controlRef = useRef(null);
|
|
843
850
|
const [anchorEl, setAnchorEl] = useState2(null);
|
|
844
|
-
const popoverState
|
|
845
|
-
const popoverProps = bindPopover(popoverState);
|
|
851
|
+
const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount);
|
|
846
852
|
const duplicateLabel = __4("Duplicate", "elementor");
|
|
847
853
|
const toggleLabel = disabled ? __4("Show", "elementor") : __4("Hide", "elementor");
|
|
848
854
|
const removeLabel = __4("Remove", "elementor");
|
|
@@ -852,7 +858,7 @@ var RepeaterItem = ({
|
|
|
852
858
|
label,
|
|
853
859
|
showActionsOnHover: true,
|
|
854
860
|
fullWidth: true,
|
|
855
|
-
ref:
|
|
861
|
+
ref: setRef,
|
|
856
862
|
variant: "outlined",
|
|
857
863
|
"aria-label": __4("Open item", "elementor"),
|
|
858
864
|
...bindTrigger2(popoverState),
|
|
@@ -867,15 +873,32 @@ var RepeaterItem = ({
|
|
|
867
873
|
slotProps: {
|
|
868
874
|
paper: {
|
|
869
875
|
ref: setAnchorEl,
|
|
870
|
-
sx: { mt: 0.5, width:
|
|
876
|
+
sx: { mt: 0.5, width: ref?.getBoundingClientRect().width }
|
|
871
877
|
}
|
|
872
878
|
},
|
|
873
879
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
874
|
-
...popoverProps
|
|
880
|
+
...popoverProps,
|
|
881
|
+
anchorEl: ref
|
|
875
882
|
},
|
|
876
883
|
/* @__PURE__ */ React21.createElement(Box, null, children({ anchorEl }))
|
|
877
884
|
));
|
|
878
885
|
};
|
|
886
|
+
var usePopover = (openOnMount) => {
|
|
887
|
+
const [ref, setRef] = useState2(null);
|
|
888
|
+
const popoverState = usePopupState2({ variant: "popover" });
|
|
889
|
+
const popoverProps = bindPopover(popoverState);
|
|
890
|
+
useEffect2(() => {
|
|
891
|
+
if (openOnMount && ref) {
|
|
892
|
+
popoverState.open(ref);
|
|
893
|
+
}
|
|
894
|
+
}, [ref]);
|
|
895
|
+
return {
|
|
896
|
+
popoverState,
|
|
897
|
+
ref,
|
|
898
|
+
setRef,
|
|
899
|
+
popoverProps
|
|
900
|
+
};
|
|
901
|
+
};
|
|
879
902
|
|
|
880
903
|
// src/controls/box-shadow-repeater-control.tsx
|
|
881
904
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
@@ -883,6 +906,7 @@ var BoxShadowRepeaterControl = createControl(() => {
|
|
|
883
906
|
return /* @__PURE__ */ React22.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React22.createElement(
|
|
884
907
|
Repeater,
|
|
885
908
|
{
|
|
909
|
+
openOnAdd: true,
|
|
886
910
|
values: value ?? [],
|
|
887
911
|
setValues: setValue,
|
|
888
912
|
label: __5("Box shadow", "elementor"),
|
|
@@ -918,7 +942,7 @@ var Content = ({ anchorEl }) => {
|
|
|
918
942
|
}
|
|
919
943
|
}
|
|
920
944
|
}
|
|
921
|
-
)), /* @__PURE__ */ React22.createElement(Control2, { bind: "position", label: __5("Position", "elementor") }, /* @__PURE__ */ React22.createElement(
|
|
945
|
+
)), /* @__PURE__ */ React22.createElement(Control2, { bind: "position", label: __5("Position", "elementor"), sx: { overflow: "hidden" } }, /* @__PURE__ */ React22.createElement(
|
|
922
946
|
SelectControl,
|
|
923
947
|
{
|
|
924
948
|
options: [
|
|
@@ -928,7 +952,12 @@ var Content = ({ anchorEl }) => {
|
|
|
928
952
|
}
|
|
929
953
|
))), /* @__PURE__ */ React22.createElement(PopoverGridContainer, null, /* @__PURE__ */ React22.createElement(Control2, { bind: "hOffset", label: __5("Horizontal", "elementor") }, /* @__PURE__ */ React22.createElement(SizeControl, null)), /* @__PURE__ */ React22.createElement(Control2, { bind: "vOffset", label: __5("Vertical", "elementor") }, /* @__PURE__ */ React22.createElement(SizeControl, null))), /* @__PURE__ */ React22.createElement(PopoverGridContainer, null, /* @__PURE__ */ React22.createElement(Control2, { bind: "blur", label: __5("Blur", "elementor") }, /* @__PURE__ */ React22.createElement(SizeControl, null)), /* @__PURE__ */ React22.createElement(Control2, { bind: "spread", label: __5("Spread", "elementor") }, /* @__PURE__ */ React22.createElement(SizeControl, null)))));
|
|
930
954
|
};
|
|
931
|
-
var Control2 = ({
|
|
955
|
+
var Control2 = ({
|
|
956
|
+
label,
|
|
957
|
+
bind,
|
|
958
|
+
children,
|
|
959
|
+
sx
|
|
960
|
+
}) => /* @__PURE__ */ React22.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React22.createElement(Grid4, { item: true, xs: 6, sx }, /* @__PURE__ */ React22.createElement(Grid4, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React22.createElement(Grid4, { item: true, xs: 12 }, /* @__PURE__ */ React22.createElement(Typography3, { component: "label", variant: "caption", color: "text.secondary" }, label)), /* @__PURE__ */ React22.createElement(Grid4, { item: true, xs: 12 }, children))));
|
|
932
961
|
var ItemLabel = ({ value }) => {
|
|
933
962
|
const { position, hOffset, vOffset, blur, spread } = value.value;
|
|
934
963
|
const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
|
|
@@ -987,6 +1016,7 @@ import {
|
|
|
987
1016
|
var StyledToggleButtonGroup = styled3(ToggleButtonGroup)`
|
|
988
1017
|
${({ justify }) => `justify-content: ${justify};`}
|
|
989
1018
|
`;
|
|
1019
|
+
var MAX_VISIBLE_ITEMS = 4;
|
|
990
1020
|
var ControlToggleButtonGroup = ({
|
|
991
1021
|
justify = "end",
|
|
992
1022
|
size = "tiny",
|
|
@@ -1008,7 +1038,10 @@ var ControlToggleButtonGroup = ({
|
|
|
1008
1038
|
onChange: handleChange,
|
|
1009
1039
|
exclusive,
|
|
1010
1040
|
sx: {
|
|
1011
|
-
direction: isRtl ? "rtl /* @noflip */" : "ltr /* @noflip */"
|
|
1041
|
+
direction: isRtl ? "rtl /* @noflip */" : "ltr /* @noflip */",
|
|
1042
|
+
display: "grid",
|
|
1043
|
+
gridTemplateColumns: `repeat(${items.length}, 1fr)`,
|
|
1044
|
+
width: `${items.length / MAX_VISIBLE_ITEMS * 100}%`
|
|
1012
1045
|
}
|
|
1013
1046
|
},
|
|
1014
1047
|
items.map(
|
|
@@ -1029,20 +1062,40 @@ var ControlToggleButtonGroup = ({
|
|
|
1029
1062
|
|
|
1030
1063
|
// src/controls/toggle-control.tsx
|
|
1031
1064
|
var ToggleControl = createControl(
|
|
1032
|
-
({
|
|
1065
|
+
({
|
|
1066
|
+
options,
|
|
1067
|
+
fullWidth = false,
|
|
1068
|
+
size = "tiny",
|
|
1069
|
+
exclusive = true
|
|
1070
|
+
}) => {
|
|
1033
1071
|
const { value, setValue } = useBoundProp(stringPropTypeUtil5);
|
|
1034
|
-
const
|
|
1035
|
-
|
|
1072
|
+
const exclusiveValues = options.filter((option) => option.exclusive).map((option) => option.value);
|
|
1073
|
+
const handleNonExclusiveToggle = (selectedValues) => {
|
|
1074
|
+
const newSelectedValue = selectedValues[selectedValues.length - 1];
|
|
1075
|
+
const isNewSelectedValueExclusive = exclusiveValues.includes(newSelectedValue);
|
|
1076
|
+
const updatedValues = isNewSelectedValueExclusive ? [newSelectedValue] : selectedValues?.filter((val) => !exclusiveValues.includes(val));
|
|
1077
|
+
setValue(updatedValues?.join(" ") || null);
|
|
1036
1078
|
};
|
|
1037
|
-
|
|
1079
|
+
const toggleButtonGroupProps = {
|
|
1080
|
+
items: options,
|
|
1081
|
+
fullWidth,
|
|
1082
|
+
size
|
|
1083
|
+
};
|
|
1084
|
+
return exclusive ? /* @__PURE__ */ React24.createElement(
|
|
1038
1085
|
ControlToggleButtonGroup,
|
|
1039
1086
|
{
|
|
1040
|
-
|
|
1087
|
+
...toggleButtonGroupProps,
|
|
1041
1088
|
value: value ?? null,
|
|
1042
|
-
onChange:
|
|
1043
|
-
exclusive: true
|
|
1044
|
-
|
|
1045
|
-
|
|
1089
|
+
onChange: setValue,
|
|
1090
|
+
exclusive: true
|
|
1091
|
+
}
|
|
1092
|
+
) : /* @__PURE__ */ React24.createElement(
|
|
1093
|
+
ControlToggleButtonGroup,
|
|
1094
|
+
{
|
|
1095
|
+
...toggleButtonGroupProps,
|
|
1096
|
+
value: value?.split(" ") ?? [],
|
|
1097
|
+
onChange: handleNonExclusiveToggle,
|
|
1098
|
+
exclusive: false
|
|
1046
1099
|
}
|
|
1047
1100
|
);
|
|
1048
1101
|
}
|
|
@@ -1088,7 +1141,7 @@ var NumberControl = createControl(
|
|
|
1088
1141
|
|
|
1089
1142
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
1090
1143
|
import * as React26 from "react";
|
|
1091
|
-
import { useId as useId2, useRef
|
|
1144
|
+
import { useId as useId2, useRef } from "react";
|
|
1092
1145
|
import { sizePropTypeUtil as sizePropTypeUtil2 } from "@elementor/editor-props";
|
|
1093
1146
|
import { bindPopover as bindPopover2, bindToggle, Grid as Grid5, Popover as Popover2, Stack as Stack6, ToggleButton as ToggleButton2, Tooltip as Tooltip3, usePopupState as usePopupState3 } from "@elementor/ui";
|
|
1094
1147
|
import { __ as __6 } from "@wordpress/i18n";
|
|
@@ -1110,7 +1163,7 @@ function EqualUnequalSizesControl({
|
|
|
1110
1163
|
multiSizePropTypeUtil
|
|
1111
1164
|
}) {
|
|
1112
1165
|
const popupId = useId2();
|
|
1113
|
-
const controlRef =
|
|
1166
|
+
const controlRef = useRef(null);
|
|
1114
1167
|
const popupState = usePopupState3({ variant: "popover", popupId });
|
|
1115
1168
|
const {
|
|
1116
1169
|
propType: multiSizePropType,
|
|
@@ -1174,7 +1227,7 @@ function EqualUnequalSizesControl({
|
|
|
1174
1227
|
paper: { sx: { mt: 0.5, width: controlRef.current?.getBoundingClientRect().width } }
|
|
1175
1228
|
}
|
|
1176
1229
|
},
|
|
1177
|
-
/* @__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[
|
|
1230
|
+
/* @__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] }))))
|
|
1178
1231
|
));
|
|
1179
1232
|
}
|
|
1180
1233
|
var MultiSizeValueControl = ({ item }) => /* @__PURE__ */ React26.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React26.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(Grid5, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React26.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React26.createElement(ControlLabel, null, item.label)), /* @__PURE__ */ React26.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React26.createElement(SizeControl, { startIcon: item.icon })))));
|
|
@@ -1275,7 +1328,7 @@ var Control3 = ({
|
|
|
1275
1328
|
|
|
1276
1329
|
// src/controls/font-family-control/font-family-control.tsx
|
|
1277
1330
|
import * as React28 from "react";
|
|
1278
|
-
import { useEffect as
|
|
1331
|
+
import { useEffect as useEffect3, useRef as useRef2, useState as useState3 } from "react";
|
|
1279
1332
|
import { stringPropTypeUtil as stringPropTypeUtil6 } from "@elementor/editor-props";
|
|
1280
1333
|
import { ChevronDownIcon, SearchIcon, TextIcon, XIcon as XIcon2 } from "@elementor/icons";
|
|
1281
1334
|
import {
|
|
@@ -1302,20 +1355,18 @@ import { __ as __8 } from "@wordpress/i18n";
|
|
|
1302
1355
|
|
|
1303
1356
|
// src/hooks/use-filtered-font-families.ts
|
|
1304
1357
|
var useFilteredFontFamilies = (fontFamilies, searchValue) => {
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
});
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
);
|
|
1318
|
-
return [...filteredFontFamilies];
|
|
1358
|
+
return fontFamilies.reduce((acc, category) => {
|
|
1359
|
+
const filteredFonts = category.fonts.filter(
|
|
1360
|
+
(font) => font.toLowerCase().includes(searchValue.toLowerCase())
|
|
1361
|
+
);
|
|
1362
|
+
if (filteredFonts.length) {
|
|
1363
|
+
acc.push({ type: "category", value: category.label });
|
|
1364
|
+
filteredFonts.forEach((font) => {
|
|
1365
|
+
acc.push({ type: "font", value: font });
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
return acc;
|
|
1369
|
+
}, []);
|
|
1319
1370
|
};
|
|
1320
1371
|
|
|
1321
1372
|
// src/controls/font-family-control/enqueue-font.tsx
|
|
@@ -1411,7 +1462,7 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1411
1462
|
var LIST_ITEM_HEIGHT = 36;
|
|
1412
1463
|
var LIST_ITEMS_BUFFER = 6;
|
|
1413
1464
|
var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
1414
|
-
const containerRef =
|
|
1465
|
+
const containerRef = useRef2(null);
|
|
1415
1466
|
const selectedItem = fontListItems.find((item) => item.value === fontFamily);
|
|
1416
1467
|
const debouncedVirtualizeChange = useDebounce(({ getVirtualIndexes }) => {
|
|
1417
1468
|
getVirtualIndexes().forEach((index) => {
|
|
@@ -1428,7 +1479,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1428
1479
|
overscan: LIST_ITEMS_BUFFER,
|
|
1429
1480
|
onChange: debouncedVirtualizeChange
|
|
1430
1481
|
});
|
|
1431
|
-
|
|
1482
|
+
useEffect3(
|
|
1432
1483
|
() => {
|
|
1433
1484
|
virtualizer.scrollToIndex(fontListItems.findIndex((item) => item.value === fontFamily));
|
|
1434
1485
|
},
|
|
@@ -1519,7 +1570,7 @@ var StyledMenuList = styled4(MenuList)(({ theme }) => ({
|
|
|
1519
1570
|
'& > [role="option"]': {
|
|
1520
1571
|
...theme.typography.caption,
|
|
1521
1572
|
lineHeight: "inherit",
|
|
1522
|
-
padding: theme.spacing(0.75, 2),
|
|
1573
|
+
padding: theme.spacing(0.75, 2, 0.75, 4),
|
|
1523
1574
|
"&:hover, &:focus": {
|
|
1524
1575
|
backgroundColor: theme.palette.action.hover
|
|
1525
1576
|
},
|
|
@@ -1534,7 +1585,7 @@ var StyledMenuList = styled4(MenuList)(({ theme }) => ({
|
|
|
1534
1585
|
}));
|
|
1535
1586
|
var useDebounce = (fn, delay) => {
|
|
1536
1587
|
const [debouncedFn] = useState3(() => debounce(fn, delay));
|
|
1537
|
-
|
|
1588
|
+
useEffect3(() => () => debouncedFn.cancel(), [debouncedFn]);
|
|
1538
1589
|
return debouncedFn;
|
|
1539
1590
|
};
|
|
1540
1591
|
|
|
@@ -1686,6 +1737,36 @@ function _factoryFilter(newValue, options, minInputLength) {
|
|
|
1686
1737
|
);
|
|
1687
1738
|
}
|
|
1688
1739
|
|
|
1740
|
+
// src/utils/link-restriction.ts
|
|
1741
|
+
import { getContainer } from "@elementor/editor-elements";
|
|
1742
|
+
function getLinkRestriction(elementId) {
|
|
1743
|
+
if (getAncestorAnchor(elementId)) {
|
|
1744
|
+
return {
|
|
1745
|
+
shouldRestrict: true,
|
|
1746
|
+
restrictReason: "ancestor"
|
|
1747
|
+
};
|
|
1748
|
+
}
|
|
1749
|
+
if (getDescendantAnchor(elementId)) {
|
|
1750
|
+
return {
|
|
1751
|
+
shouldRestrict: true,
|
|
1752
|
+
restrictReason: "descendant"
|
|
1753
|
+
};
|
|
1754
|
+
}
|
|
1755
|
+
return { shouldRestrict: false };
|
|
1756
|
+
}
|
|
1757
|
+
function getAncestorAnchor(elementId) {
|
|
1758
|
+
const element = getElementView(elementId);
|
|
1759
|
+
return element?.closest("a") || null;
|
|
1760
|
+
}
|
|
1761
|
+
function getDescendantAnchor(elementId) {
|
|
1762
|
+
const element = getElementView(elementId);
|
|
1763
|
+
return element?.querySelector("a") || null;
|
|
1764
|
+
}
|
|
1765
|
+
function getElementView(id) {
|
|
1766
|
+
const elementContainer = getContainer(id);
|
|
1767
|
+
return elementContainer?.view?.el || null;
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1689
1770
|
// src/controls/link-control.tsx
|
|
1690
1771
|
var SIZE3 = "tiny";
|
|
1691
1772
|
var LinkControl = createControl((props) => {
|
|
@@ -1696,12 +1777,17 @@ var LinkControl = createControl((props) => {
|
|
|
1696
1777
|
allowCustomValues,
|
|
1697
1778
|
queryOptions: { endpoint = "", requestParams = {} },
|
|
1698
1779
|
placeholder,
|
|
1699
|
-
minInputLength = 2
|
|
1780
|
+
minInputLength = 2,
|
|
1781
|
+
context: { elementId }
|
|
1700
1782
|
} = props || {};
|
|
1701
1783
|
const [options, setOptions] = useState4(
|
|
1702
1784
|
generateFirstLoadedOption(value)
|
|
1703
1785
|
);
|
|
1704
1786
|
const onEnabledChange = () => {
|
|
1787
|
+
const { shouldRestrict } = getLinkRestriction(elementId);
|
|
1788
|
+
if (shouldRestrict && !isEnabled) {
|
|
1789
|
+
return;
|
|
1790
|
+
}
|
|
1705
1791
|
setIsEnabled((prevState) => !prevState);
|
|
1706
1792
|
setValue(isEnabled ? null : linkSessionValue?.value ?? null);
|
|
1707
1793
|
setLinkSessionValue({ value, meta: { isEnabled: !isEnabled } });
|
|
@@ -1864,12 +1950,84 @@ var Control4 = ({ bind, isLinked }) => {
|
|
|
1864
1950
|
};
|
|
1865
1951
|
|
|
1866
1952
|
// src/controls/svg-media-control.tsx
|
|
1867
|
-
import * as
|
|
1953
|
+
import * as React34 from "react";
|
|
1954
|
+
import { useState as useState6 } from "react";
|
|
1868
1955
|
import { imageSrcPropTypeUtil as imageSrcPropTypeUtil2 } from "@elementor/editor-props";
|
|
1869
1956
|
import { UploadIcon as UploadIcon2 } from "@elementor/icons";
|
|
1870
|
-
import { Button as
|
|
1957
|
+
import { Button as Button4, Card as Card2, CardMedia as CardMedia2, CardOverlay as CardOverlay2, CircularProgress as CircularProgress3, Stack as Stack11, styled as styled5 } from "@elementor/ui";
|
|
1871
1958
|
import { useWpMediaAttachment as useWpMediaAttachment2, useWpMediaFrame as useWpMediaFrame2 } from "@elementor/wp-media";
|
|
1959
|
+
import { __ as __12 } from "@wordpress/i18n";
|
|
1960
|
+
|
|
1961
|
+
// src/components/enable-unfiltered-modal.tsx
|
|
1962
|
+
import * as React33 from "react";
|
|
1963
|
+
import { useState as useState5 } from "react";
|
|
1964
|
+
import { useCurrentUserCapabilities } from "@elementor/editor-current-user";
|
|
1965
|
+
import {
|
|
1966
|
+
Button as Button3,
|
|
1967
|
+
CircularProgress as CircularProgress2,
|
|
1968
|
+
Dialog,
|
|
1969
|
+
DialogActions,
|
|
1970
|
+
DialogContent,
|
|
1971
|
+
DialogContentText,
|
|
1972
|
+
DialogHeader,
|
|
1973
|
+
DialogTitle,
|
|
1974
|
+
Divider as Divider4
|
|
1975
|
+
} from "@elementor/ui";
|
|
1872
1976
|
import { __ as __11 } from "@wordpress/i18n";
|
|
1977
|
+
var ADMIN_TITLE_TEXT = __11("Enable Unfiltered Uploads", "elementor");
|
|
1978
|
+
var ADMIN_CONTENT_TEXT = __11(
|
|
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 = __11("Sorry, you can't upload that file yet", "elementor");
|
|
1983
|
+
var NON_ADMIN_CONTENT_TEXT = __11(
|
|
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 = __11("Failed to enable unfiltered files upload.", "elementor");
|
|
1988
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT2 = __11(
|
|
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 } = useCurrentUserCapabilities();
|
|
1996
|
+
const [isError, setIsError] = useState5(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(Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React33.createElement(DialogHeader, { logo: false }, /* @__PURE__ */ React33.createElement(DialogTitle, null, ADMIN_TITLE_TEXT)), /* @__PURE__ */ React33.createElement(Divider4, null), /* @__PURE__ */ React33.createElement(DialogContent, null, /* @__PURE__ */ React33.createElement(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(DialogActions, null, /* @__PURE__ */ React33.createElement(Button3, { size: "medium", color: "secondary", onClick: () => onClose(false) }, __11("Cancel", "elementor")), /* @__PURE__ */ React33.createElement(
|
|
2018
|
+
Button3,
|
|
2019
|
+
{
|
|
2020
|
+
size: "medium",
|
|
2021
|
+
onClick: () => handleEnable(),
|
|
2022
|
+
variant: "contained",
|
|
2023
|
+
color: "primary",
|
|
2024
|
+
disabled: isPending
|
|
2025
|
+
},
|
|
2026
|
+
isPending ? /* @__PURE__ */ React33.createElement(CircularProgress2, { size: 24 }) : __11("Enable", "elementor")
|
|
2027
|
+
)));
|
|
2028
|
+
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */ React33.createElement(Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React33.createElement(DialogHeader, { logo: false }, /* @__PURE__ */ React33.createElement(DialogTitle, null, NON_ADMIN_TITLE_TEXT)), /* @__PURE__ */ React33.createElement(Divider4, null), /* @__PURE__ */ React33.createElement(DialogContent, null, /* @__PURE__ */ React33.createElement(DialogContentText, null, NON_ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React33.createElement(DialogActions, null, /* @__PURE__ */ React33.createElement(Button3, { size: "medium", onClick: () => onClose(false), variant: "contained", color: "primary" }, __11("Got it", "elementor"))));
|
|
2029
|
+
|
|
2030
|
+
// src/controls/svg-media-control.tsx
|
|
1873
2031
|
var TILE_SIZE = 8;
|
|
1874
2032
|
var TILE_WHITE = "transparent";
|
|
1875
2033
|
var TILE_BLACK = "#c1c1c1";
|
|
@@ -1892,12 +2050,15 @@ var StyledCardMediaContainer = styled5(Stack11)`
|
|
|
1892
2050
|
align-items: center;
|
|
1893
2051
|
background-color: rgba( 255, 255, 255, 0.37 );
|
|
1894
2052
|
`;
|
|
2053
|
+
var MODE_BROWSE = { mode: "browse" };
|
|
2054
|
+
var MODE_UPLOAD = { mode: "upload" };
|
|
1895
2055
|
var SvgMediaControl = createControl(() => {
|
|
1896
2056
|
const { value, setValue } = useBoundProp(imageSrcPropTypeUtil2);
|
|
1897
2057
|
const { id, url } = value ?? {};
|
|
1898
2058
|
const { data: attachment, isFetching } = useWpMediaAttachment2(id?.value || null);
|
|
1899
2059
|
const src = attachment?.url ?? url?.value ?? null;
|
|
1900
2060
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
2061
|
+
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = useState6(false);
|
|
1901
2062
|
const { open } = useWpMediaFrame2({
|
|
1902
2063
|
mediaTypes: ["svg"],
|
|
1903
2064
|
multiple: false,
|
|
@@ -1912,21 +2073,28 @@ var SvgMediaControl = createControl(() => {
|
|
|
1912
2073
|
});
|
|
1913
2074
|
}
|
|
1914
2075
|
});
|
|
2076
|
+
const onCloseUnfilteredModal = (enabled) => {
|
|
2077
|
+
setUnfilteredModalOpenState(false);
|
|
2078
|
+
if (enabled) {
|
|
2079
|
+
open(MODE_UPLOAD);
|
|
2080
|
+
}
|
|
2081
|
+
};
|
|
1915
2082
|
const handleClick = (openOptions) => {
|
|
1916
|
-
if (allowSvgUpload) {
|
|
1917
|
-
|
|
2083
|
+
if (!allowSvgUpload && openOptions === MODE_UPLOAD) {
|
|
2084
|
+
setUnfilteredModalOpenState(true);
|
|
1918
2085
|
} else {
|
|
2086
|
+
open(openOptions);
|
|
1919
2087
|
}
|
|
1920
2088
|
};
|
|
1921
|
-
return /* @__PURE__ */
|
|
2089
|
+
return /* @__PURE__ */ React34.createElement(Stack11, { gap: 1 }, /* @__PURE__ */ React34.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: onCloseUnfilteredModal }), /* @__PURE__ */ React34.createElement(ControlLabel, null, " ", __12("SVG", "elementor"), " "), /* @__PURE__ */ React34.createElement(ControlActions, null, /* @__PURE__ */ React34.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React34.createElement(StyledCardMediaContainer, null, isFetching ? /* @__PURE__ */ React34.createElement(CircularProgress3, { role: "progressbar" }) : /* @__PURE__ */ React34.createElement(
|
|
1922
2090
|
CardMedia2,
|
|
1923
2091
|
{
|
|
1924
2092
|
component: "img",
|
|
1925
2093
|
image: src,
|
|
1926
|
-
alt:
|
|
2094
|
+
alt: __12("Preview SVG", "elementor"),
|
|
1927
2095
|
sx: { maxHeight: "140px", width: "50px" }
|
|
1928
2096
|
}
|
|
1929
|
-
)), /* @__PURE__ */
|
|
2097
|
+
)), /* @__PURE__ */ React34.createElement(
|
|
1930
2098
|
CardOverlay2,
|
|
1931
2099
|
{
|
|
1932
2100
|
sx: {
|
|
@@ -1935,52 +2103,53 @@ var SvgMediaControl = createControl(() => {
|
|
|
1935
2103
|
}
|
|
1936
2104
|
}
|
|
1937
2105
|
},
|
|
1938
|
-
/* @__PURE__ */
|
|
1939
|
-
|
|
2106
|
+
/* @__PURE__ */ React34.createElement(Stack11, { gap: 1 }, /* @__PURE__ */ React34.createElement(
|
|
2107
|
+
Button4,
|
|
1940
2108
|
{
|
|
1941
2109
|
size: "tiny",
|
|
1942
2110
|
color: "inherit",
|
|
1943
2111
|
variant: "outlined",
|
|
1944
|
-
onClick: () => handleClick(
|
|
2112
|
+
onClick: () => handleClick(MODE_BROWSE)
|
|
1945
2113
|
},
|
|
1946
|
-
|
|
1947
|
-
), /* @__PURE__ */
|
|
1948
|
-
|
|
2114
|
+
__12("Select SVG", "elementor")
|
|
2115
|
+
), /* @__PURE__ */ React34.createElement(
|
|
2116
|
+
Button4,
|
|
1949
2117
|
{
|
|
1950
2118
|
size: "tiny",
|
|
1951
2119
|
variant: "text",
|
|
1952
2120
|
color: "inherit",
|
|
1953
|
-
startIcon: /* @__PURE__ */
|
|
1954
|
-
onClick: () => handleClick(
|
|
2121
|
+
startIcon: /* @__PURE__ */ React34.createElement(UploadIcon2, null),
|
|
2122
|
+
onClick: () => handleClick(MODE_UPLOAD)
|
|
1955
2123
|
},
|
|
1956
|
-
|
|
2124
|
+
__12("Upload", "elementor")
|
|
1957
2125
|
))
|
|
1958
2126
|
))));
|
|
1959
2127
|
});
|
|
1960
2128
|
|
|
1961
2129
|
// src/controls/background-control/background-control.tsx
|
|
1962
|
-
import * as
|
|
2130
|
+
import * as React41 from "react";
|
|
1963
2131
|
import { backgroundPropTypeUtil } from "@elementor/editor-props";
|
|
1964
2132
|
import { Grid as Grid14 } from "@elementor/ui";
|
|
1965
|
-
import { __ as
|
|
2133
|
+
import { __ as __18 } from "@wordpress/i18n";
|
|
1966
2134
|
|
|
1967
2135
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
1968
|
-
import * as
|
|
2136
|
+
import * as React40 from "react";
|
|
1969
2137
|
import {
|
|
1970
2138
|
backgroundColorOverlayPropTypeUtil as backgroundColorOverlayPropTypeUtil2,
|
|
1971
2139
|
backgroundImageOverlayPropTypeUtil as backgroundImageOverlayPropTypeUtil2,
|
|
1972
|
-
backgroundOverlayPropTypeUtil
|
|
2140
|
+
backgroundOverlayPropTypeUtil,
|
|
2141
|
+
colorPropTypeUtil as colorPropTypeUtil3
|
|
1973
2142
|
} from "@elementor/editor-props";
|
|
1974
2143
|
import { Box as Box4, CardMedia as CardMedia3, Grid as Grid13, Tab, TabPanel, Tabs, UnstableColorIndicator as UnstableColorIndicator2 } from "@elementor/ui";
|
|
1975
2144
|
import { useWpMediaAttachment as useWpMediaAttachment3 } from "@elementor/wp-media";
|
|
1976
|
-
import { __ as
|
|
2145
|
+
import { __ as __17 } from "@wordpress/i18n";
|
|
1977
2146
|
|
|
1978
2147
|
// src/env.ts
|
|
1979
2148
|
import { parseEnv } from "@elementor/env";
|
|
1980
2149
|
var { env } = parseEnv("@elementor/editor-controls");
|
|
1981
2150
|
|
|
1982
2151
|
// src/controls/background-control/background-gradient-color-control.tsx
|
|
1983
|
-
import * as
|
|
2152
|
+
import * as React35 from "react";
|
|
1984
2153
|
import {
|
|
1985
2154
|
backgroundGradientOverlayPropTypeUtil,
|
|
1986
2155
|
colorPropTypeUtil as colorPropTypeUtil2,
|
|
@@ -2027,7 +2196,7 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
2027
2196
|
positions: positions?.value.split(" ")
|
|
2028
2197
|
};
|
|
2029
2198
|
};
|
|
2030
|
-
return /* @__PURE__ */
|
|
2199
|
+
return /* @__PURE__ */ React35.createElement(ControlActions, null, /* @__PURE__ */ React35.createElement(
|
|
2031
2200
|
UnstableGradientBox,
|
|
2032
2201
|
{
|
|
2033
2202
|
sx: { width: "auto", padding: 1.5 },
|
|
@@ -2041,7 +2210,7 @@ var initialBackgroundGradientOverlay = backgroundGradientOverlayPropTypeUtil.cre
|
|
|
2041
2210
|
angle: numberPropTypeUtil3.create(180),
|
|
2042
2211
|
stops: gradientColorStopPropTypeUtil.create([
|
|
2043
2212
|
colorStopPropTypeUtil.create({
|
|
2044
|
-
color:
|
|
2213
|
+
color: colorPropTypeUtil2.create("rgb(0,0,0)"),
|
|
2045
2214
|
offset: numberPropTypeUtil3.create(0)
|
|
2046
2215
|
}),
|
|
2047
2216
|
colorStopPropTypeUtil.create({
|
|
@@ -2052,45 +2221,45 @@ var initialBackgroundGradientOverlay = backgroundGradientOverlayPropTypeUtil.cre
|
|
|
2052
2221
|
});
|
|
2053
2222
|
|
|
2054
2223
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
2055
|
-
import * as
|
|
2224
|
+
import * as React36 from "react";
|
|
2056
2225
|
import { PinIcon, PinnedOffIcon } from "@elementor/icons";
|
|
2057
2226
|
import { Grid as Grid9 } from "@elementor/ui";
|
|
2058
|
-
import { __ as
|
|
2227
|
+
import { __ as __13 } from "@wordpress/i18n";
|
|
2059
2228
|
var attachmentControlOptions = [
|
|
2060
2229
|
{
|
|
2061
2230
|
value: "fixed",
|
|
2062
|
-
label:
|
|
2063
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2231
|
+
label: __13("Fixed", "elementor"),
|
|
2232
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(PinIcon, { fontSize: size }),
|
|
2064
2233
|
showTooltip: true
|
|
2065
2234
|
},
|
|
2066
2235
|
{
|
|
2067
2236
|
value: "scroll",
|
|
2068
|
-
label:
|
|
2069
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2237
|
+
label: __13("Scroll", "elementor"),
|
|
2238
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(PinnedOffIcon, { fontSize: size }),
|
|
2070
2239
|
showTooltip: true
|
|
2071
2240
|
}
|
|
2072
2241
|
];
|
|
2073
2242
|
var BackgroundImageOverlayAttachment = () => {
|
|
2074
|
-
return /* @__PURE__ */
|
|
2243
|
+
return /* @__PURE__ */ React36.createElement(PopoverGridContainer, null, /* @__PURE__ */ React36.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(ControlLabel, null, __13("Attachment", "elementor"))), /* @__PURE__ */ React36.createElement(Grid9, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React36.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
2075
2244
|
};
|
|
2076
2245
|
|
|
2077
2246
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
2078
|
-
import * as
|
|
2247
|
+
import * as React37 from "react";
|
|
2079
2248
|
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil9 } from "@elementor/editor-props";
|
|
2080
2249
|
import { LetterXIcon, LetterYIcon } from "@elementor/icons";
|
|
2081
2250
|
import { Grid as Grid10, MenuItem as MenuItem3, Select as Select2 } from "@elementor/ui";
|
|
2082
|
-
import { __ as
|
|
2251
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
2083
2252
|
var backgroundPositionOptions = [
|
|
2084
|
-
{ label:
|
|
2085
|
-
{ label:
|
|
2086
|
-
{ label:
|
|
2087
|
-
{ label:
|
|
2088
|
-
{ label:
|
|
2089
|
-
{ label:
|
|
2090
|
-
{ label:
|
|
2091
|
-
{ label:
|
|
2092
|
-
{ label:
|
|
2093
|
-
{ label:
|
|
2253
|
+
{ label: __14("Center center", "elementor"), value: "center center" },
|
|
2254
|
+
{ label: __14("Center left", "elementor"), value: "center left" },
|
|
2255
|
+
{ label: __14("Center right", "elementor"), value: "center right" },
|
|
2256
|
+
{ label: __14("Top center", "elementor"), value: "top center" },
|
|
2257
|
+
{ label: __14("Top left", "elementor"), value: "top left" },
|
|
2258
|
+
{ label: __14("Top right", "elementor"), value: "top right" },
|
|
2259
|
+
{ label: __14("Bottom center", "elementor"), value: "bottom center" },
|
|
2260
|
+
{ label: __14("Bottom left", "elementor"), value: "bottom left" },
|
|
2261
|
+
{ label: __14("Bottom right", "elementor"), value: "bottom right" },
|
|
2262
|
+
{ label: __14("Custom", "elementor"), value: "custom" }
|
|
2094
2263
|
];
|
|
2095
2264
|
var BackgroundImageOverlayPosition = () => {
|
|
2096
2265
|
const backgroundImageOffsetContext = useBoundProp(backgroundImagePositionOffsetPropTypeUtil);
|
|
@@ -2104,7 +2273,7 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
2104
2273
|
stringPropContext.setValue(value);
|
|
2105
2274
|
}
|
|
2106
2275
|
};
|
|
2107
|
-
return /* @__PURE__ */
|
|
2276
|
+
return /* @__PURE__ */ React37.createElement(Grid10, { container: true, spacing: 1.5 }, /* @__PURE__ */ React37.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(PopoverGridContainer, null, /* @__PURE__ */ React37.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(ControlLabel, null, __14("Position", "elementor"))), /* @__PURE__ */ React37.createElement(Grid10, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React37.createElement(
|
|
2108
2277
|
Select2,
|
|
2109
2278
|
{
|
|
2110
2279
|
size: "tiny",
|
|
@@ -2112,47 +2281,47 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
2112
2281
|
onChange: handlePositionChange,
|
|
2113
2282
|
fullWidth: true
|
|
2114
2283
|
},
|
|
2115
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
2116
|
-
)))), isCustom ? /* @__PURE__ */
|
|
2284
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React37.createElement(MenuItem3, { key: value, value: value ?? "" }, label))
|
|
2285
|
+
)))), isCustom ? /* @__PURE__ */ React37.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React37.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(Grid10, { container: true, spacing: 1.5 }, /* @__PURE__ */ React37.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React37.createElement(SizeControl, { startIcon: /* @__PURE__ */ React37.createElement(LetterXIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React37.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React37.createElement(SizeControl, { startIcon: /* @__PURE__ */ React37.createElement(LetterYIcon, { fontSize: "tiny" }) })))))) : null);
|
|
2117
2286
|
};
|
|
2118
2287
|
|
|
2119
2288
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
2120
|
-
import * as
|
|
2289
|
+
import * as React38 from "react";
|
|
2121
2290
|
import { DotsHorizontalIcon, DotsVerticalIcon, GridDotsIcon, XIcon as XIcon4 } from "@elementor/icons";
|
|
2122
2291
|
import { Grid as Grid11 } from "@elementor/ui";
|
|
2123
|
-
import { __ as
|
|
2292
|
+
import { __ as __15 } from "@wordpress/i18n";
|
|
2124
2293
|
var repeatControlOptions = [
|
|
2125
2294
|
{
|
|
2126
2295
|
value: "repeat",
|
|
2127
|
-
label:
|
|
2128
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2296
|
+
label: __15("Repeat", "elementor"),
|
|
2297
|
+
renderContent: ({ size }) => /* @__PURE__ */ React38.createElement(GridDotsIcon, { fontSize: size }),
|
|
2129
2298
|
showTooltip: true
|
|
2130
2299
|
},
|
|
2131
2300
|
{
|
|
2132
2301
|
value: "repeat-x",
|
|
2133
|
-
label:
|
|
2134
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2302
|
+
label: __15("Repeat-x", "elementor"),
|
|
2303
|
+
renderContent: ({ size }) => /* @__PURE__ */ React38.createElement(DotsHorizontalIcon, { fontSize: size }),
|
|
2135
2304
|
showTooltip: true
|
|
2136
2305
|
},
|
|
2137
2306
|
{
|
|
2138
2307
|
value: "repeat-y",
|
|
2139
|
-
label:
|
|
2140
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2308
|
+
label: __15("Repeat-y", "elementor"),
|
|
2309
|
+
renderContent: ({ size }) => /* @__PURE__ */ React38.createElement(DotsVerticalIcon, { fontSize: size }),
|
|
2141
2310
|
showTooltip: true
|
|
2142
2311
|
},
|
|
2143
2312
|
{
|
|
2144
2313
|
value: "no-repeat",
|
|
2145
|
-
label:
|
|
2146
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2314
|
+
label: __15("No-repeat", "elementor"),
|
|
2315
|
+
renderContent: ({ size }) => /* @__PURE__ */ React38.createElement(XIcon4, { fontSize: size }),
|
|
2147
2316
|
showTooltip: true
|
|
2148
2317
|
}
|
|
2149
2318
|
];
|
|
2150
2319
|
var BackgroundImageOverlayRepeat = () => {
|
|
2151
|
-
return /* @__PURE__ */
|
|
2320
|
+
return /* @__PURE__ */ React38.createElement(PopoverGridContainer, null, /* @__PURE__ */ React38.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(ControlLabel, null, __15("Repeat", "elementor"))), /* @__PURE__ */ React38.createElement(Grid11, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React38.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
2152
2321
|
};
|
|
2153
2322
|
|
|
2154
2323
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
2155
|
-
import * as
|
|
2324
|
+
import * as React39 from "react";
|
|
2156
2325
|
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil10 } from "@elementor/editor-props";
|
|
2157
2326
|
import {
|
|
2158
2327
|
ArrowBarBothIcon,
|
|
@@ -2163,30 +2332,30 @@ import {
|
|
|
2163
2332
|
PencilIcon
|
|
2164
2333
|
} from "@elementor/icons";
|
|
2165
2334
|
import { Grid as Grid12 } from "@elementor/ui";
|
|
2166
|
-
import { __ as
|
|
2335
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
2167
2336
|
var sizeControlOptions = [
|
|
2168
2337
|
{
|
|
2169
2338
|
value: "auto",
|
|
2170
|
-
label:
|
|
2171
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2339
|
+
label: __16("Auto", "elementor"),
|
|
2340
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(LetterAIcon, { fontSize: size }),
|
|
2172
2341
|
showTooltip: true
|
|
2173
2342
|
},
|
|
2174
2343
|
{
|
|
2175
2344
|
value: "cover",
|
|
2176
|
-
label:
|
|
2177
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2345
|
+
label: __16("Cover", "elementor"),
|
|
2346
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(ArrowsMaximizeIcon, { fontSize: size }),
|
|
2178
2347
|
showTooltip: true
|
|
2179
2348
|
},
|
|
2180
2349
|
{
|
|
2181
2350
|
value: "contain",
|
|
2182
|
-
label:
|
|
2183
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2351
|
+
label: __16("Contain", "elementor"),
|
|
2352
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(ArrowBarBothIcon, { fontSize: size }),
|
|
2184
2353
|
showTooltip: true
|
|
2185
2354
|
},
|
|
2186
2355
|
{
|
|
2187
2356
|
value: "custom",
|
|
2188
|
-
label:
|
|
2189
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2357
|
+
label: __16("Custom", "elementor"),
|
|
2358
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(PencilIcon, { fontSize: size }),
|
|
2190
2359
|
showTooltip: true
|
|
2191
2360
|
}
|
|
2192
2361
|
];
|
|
@@ -2201,7 +2370,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
2201
2370
|
stringPropContext.setValue(size);
|
|
2202
2371
|
}
|
|
2203
2372
|
};
|
|
2204
|
-
return /* @__PURE__ */
|
|
2373
|
+
return /* @__PURE__ */ React39.createElement(Grid12, { container: true, spacing: 1.5 }, /* @__PURE__ */ React39.createElement(Grid12, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(PopoverGridContainer, null, /* @__PURE__ */ React39.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlLabel, null, __16("Size", "elementor"))), /* @__PURE__ */ React39.createElement(Grid12, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React39.createElement(
|
|
2205
2374
|
ControlToggleButtonGroup,
|
|
2206
2375
|
{
|
|
2207
2376
|
exclusive: true,
|
|
@@ -2209,23 +2378,23 @@ var BackgroundImageOverlaySize = () => {
|
|
|
2209
2378
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value,
|
|
2210
2379
|
onChange: handleSizeChange
|
|
2211
2380
|
}
|
|
2212
|
-
)))), isCustom ? /* @__PURE__ */
|
|
2381
|
+
)))), isCustom ? /* @__PURE__ */ React39.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React39.createElement(Grid12, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(PopoverGridContainer, null, /* @__PURE__ */ React39.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React39.createElement(
|
|
2213
2382
|
SizeControl,
|
|
2214
2383
|
{
|
|
2215
|
-
startIcon: /* @__PURE__ */
|
|
2384
|
+
startIcon: /* @__PURE__ */ React39.createElement(ArrowsMoveHorizontalIcon, { fontSize: "tiny" }),
|
|
2216
2385
|
extendedValues: ["auto"]
|
|
2217
2386
|
}
|
|
2218
|
-
))), /* @__PURE__ */
|
|
2387
|
+
))), /* @__PURE__ */ React39.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React39.createElement(
|
|
2219
2388
|
SizeControl,
|
|
2220
2389
|
{
|
|
2221
|
-
startIcon: /* @__PURE__ */
|
|
2390
|
+
startIcon: /* @__PURE__ */ React39.createElement(ArrowsMoveVerticalIcon, { fontSize: "tiny" }),
|
|
2222
2391
|
extendedValues: ["auto"]
|
|
2223
2392
|
}
|
|
2224
2393
|
)))))) : null);
|
|
2225
2394
|
};
|
|
2226
2395
|
|
|
2227
2396
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
2228
|
-
import { useRef as
|
|
2397
|
+
import { useRef as useRef3 } from "react";
|
|
2229
2398
|
import {
|
|
2230
2399
|
backgroundColorOverlayPropTypeUtil,
|
|
2231
2400
|
backgroundGradientOverlayPropTypeUtil as backgroundGradientOverlayPropTypeUtil2,
|
|
@@ -2250,7 +2419,7 @@ var useBackgroundTabsHistory = ({
|
|
|
2250
2419
|
return "image";
|
|
2251
2420
|
};
|
|
2252
2421
|
const { getTabsProps, getTabProps, getTabPanelProps } = useTabs(getCurrentOverlayType());
|
|
2253
|
-
const valuesHistory =
|
|
2422
|
+
const valuesHistory = useRef3({
|
|
2254
2423
|
image: initialBackgroundImageOverlay,
|
|
2255
2424
|
color: initialBackgroundColorOverlay2,
|
|
2256
2425
|
gradient: initialBackgroundGradientOverlay2
|
|
@@ -2287,10 +2456,12 @@ var useBackgroundTabsHistory = ({
|
|
|
2287
2456
|
};
|
|
2288
2457
|
|
|
2289
2458
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
2290
|
-
var
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2459
|
+
var DEFAULT_BACKGROUND_COLOR_OVERLAY_COLOR = "#00000033";
|
|
2460
|
+
var initialBackgroundColorOverlay = backgroundColorOverlayPropTypeUtil2.create(
|
|
2461
|
+
{
|
|
2462
|
+
color: colorPropTypeUtil3.create(DEFAULT_BACKGROUND_COLOR_OVERLAY_COLOR)
|
|
2463
|
+
}
|
|
2464
|
+
);
|
|
2294
2465
|
var getInitialBackgroundOverlay = () => ({
|
|
2295
2466
|
$$type: "background-image-overlay",
|
|
2296
2467
|
value: {
|
|
@@ -2316,19 +2487,20 @@ var getInitialBackgroundOverlay = () => ({
|
|
|
2316
2487
|
}
|
|
2317
2488
|
});
|
|
2318
2489
|
var backgroundResolutionOptions = [
|
|
2319
|
-
{ label:
|
|
2320
|
-
{ label:
|
|
2321
|
-
{ label:
|
|
2322
|
-
{ label:
|
|
2490
|
+
{ label: __17("Thumbnail - 150 x 150", "elementor"), value: "thumbnail" },
|
|
2491
|
+
{ label: __17("Medium - 300 x 300", "elementor"), value: "medium" },
|
|
2492
|
+
{ label: __17("Large 1024 x 1024", "elementor"), value: "large" },
|
|
2493
|
+
{ label: __17("Full", "elementor"), value: "full" }
|
|
2323
2494
|
];
|
|
2324
2495
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
2325
2496
|
const { propType, value: overlayValues, setValue } = useBoundProp(backgroundOverlayPropTypeUtil);
|
|
2326
|
-
return /* @__PURE__ */
|
|
2497
|
+
return /* @__PURE__ */ React40.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React40.createElement(
|
|
2327
2498
|
Repeater,
|
|
2328
2499
|
{
|
|
2500
|
+
openOnAdd: true,
|
|
2329
2501
|
values: overlayValues ?? [],
|
|
2330
2502
|
setValues: setValue,
|
|
2331
|
-
label:
|
|
2503
|
+
label: __17("Overlay", "elementor"),
|
|
2332
2504
|
itemSettings: {
|
|
2333
2505
|
Icon: ItemIcon2,
|
|
2334
2506
|
Label: ItemLabel2,
|
|
@@ -2339,7 +2511,7 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
2339
2511
|
));
|
|
2340
2512
|
});
|
|
2341
2513
|
var ItemContent2 = ({ bind }) => {
|
|
2342
|
-
return /* @__PURE__ */
|
|
2514
|
+
return /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React40.createElement(Content2, null));
|
|
2343
2515
|
};
|
|
2344
2516
|
var Content2 = () => {
|
|
2345
2517
|
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
@@ -2347,65 +2519,77 @@ var Content2 = () => {
|
|
|
2347
2519
|
color: initialBackgroundColorOverlay.value,
|
|
2348
2520
|
gradient: initialBackgroundGradientOverlay.value
|
|
2349
2521
|
});
|
|
2350
|
-
return /* @__PURE__ */
|
|
2522
|
+
return /* @__PURE__ */ React40.createElement(Box4, { sx: { width: "100%" } }, /* @__PURE__ */ React40.createElement(Box4, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React40.createElement(Tabs, { ...getTabsProps(), "aria-label": __17("Background Overlay", "elementor") }, /* @__PURE__ */ React40.createElement(Tab, { label: __17("Image", "elementor"), ...getTabProps("image") }), /* @__PURE__ */ React40.createElement(Tab, { label: __17("Gradient", "elementor"), ...getTabProps("gradient") }), /* @__PURE__ */ React40.createElement(Tab, { label: __17("Color", "elementor"), ...getTabProps("color") }))), /* @__PURE__ */ React40.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React40.createElement(PopoverContent, null, /* @__PURE__ */ React40.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React40.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("gradient") }, /* @__PURE__ */ React40.createElement(BackgroundGradientColorControl, null)), /* @__PURE__ */ React40.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("color") }, /* @__PURE__ */ React40.createElement(PopoverContent, null, /* @__PURE__ */ React40.createElement(ColorOverlayContent, null))));
|
|
2351
2523
|
};
|
|
2352
2524
|
var ItemIcon2 = ({ value }) => {
|
|
2353
2525
|
switch (value.$$type) {
|
|
2354
2526
|
case "background-image-overlay":
|
|
2355
|
-
return /* @__PURE__ */
|
|
2527
|
+
return /* @__PURE__ */ React40.createElement(ItemIconImage, { value });
|
|
2356
2528
|
case "background-color-overlay":
|
|
2357
|
-
return /* @__PURE__ */
|
|
2529
|
+
return /* @__PURE__ */ React40.createElement(ItemIconColor, { value });
|
|
2358
2530
|
case "background-gradient-overlay":
|
|
2359
|
-
return /* @__PURE__ */
|
|
2531
|
+
return /* @__PURE__ */ React40.createElement(ItemIconGradient, { value });
|
|
2360
2532
|
default:
|
|
2361
2533
|
return null;
|
|
2362
2534
|
}
|
|
2363
2535
|
};
|
|
2364
|
-
var
|
|
2365
|
-
|
|
2536
|
+
var extractColorFrom = (prop) => {
|
|
2537
|
+
if (prop?.value?.color?.value) {
|
|
2538
|
+
return prop.value.color.value;
|
|
2539
|
+
}
|
|
2540
|
+
return "";
|
|
2541
|
+
};
|
|
2542
|
+
var ItemIconColor = ({ value: prop }) => {
|
|
2543
|
+
const color = extractColorFrom(prop);
|
|
2544
|
+
return /* @__PURE__ */ React40.createElement(UnstableColorIndicator2, { size: "inherit", component: "span", value: color });
|
|
2366
2545
|
};
|
|
2367
2546
|
var ItemIconImage = ({ value }) => {
|
|
2368
2547
|
const { imageUrl } = useImage(value);
|
|
2369
|
-
return /* @__PURE__ */
|
|
2548
|
+
return /* @__PURE__ */ React40.createElement(CardMedia3, { image: imageUrl, sx: { height: 13, width: 13, borderRadius: "4px" } });
|
|
2370
2549
|
};
|
|
2371
2550
|
var ItemIconGradient = ({ value }) => {
|
|
2372
2551
|
const gradient = getGradientValue(value);
|
|
2373
|
-
return /* @__PURE__ */
|
|
2552
|
+
return /* @__PURE__ */ React40.createElement(UnstableColorIndicator2, { size: "inherit", component: "span", value: gradient });
|
|
2374
2553
|
};
|
|
2375
2554
|
var ItemLabel2 = ({ value }) => {
|
|
2376
2555
|
switch (value.$$type) {
|
|
2377
2556
|
case "background-image-overlay":
|
|
2378
|
-
return /* @__PURE__ */
|
|
2557
|
+
return /* @__PURE__ */ React40.createElement(ItemLabelImage, { value });
|
|
2379
2558
|
case "background-color-overlay":
|
|
2380
|
-
return /* @__PURE__ */
|
|
2559
|
+
return /* @__PURE__ */ React40.createElement(ItemLabelColor, { value });
|
|
2381
2560
|
case "background-gradient-overlay":
|
|
2382
|
-
return /* @__PURE__ */
|
|
2561
|
+
return /* @__PURE__ */ React40.createElement(ItemLabelGradient, { value });
|
|
2383
2562
|
default:
|
|
2384
2563
|
return null;
|
|
2385
2564
|
}
|
|
2386
2565
|
};
|
|
2387
|
-
var ItemLabelColor = ({ value }) => {
|
|
2388
|
-
|
|
2566
|
+
var ItemLabelColor = ({ value: prop }) => {
|
|
2567
|
+
const color = extractColorFrom(prop);
|
|
2568
|
+
return /* @__PURE__ */ React40.createElement("span", null, color);
|
|
2389
2569
|
};
|
|
2390
2570
|
var ItemLabelImage = ({ value }) => {
|
|
2391
2571
|
const { imageTitle } = useImage(value);
|
|
2392
|
-
return /* @__PURE__ */
|
|
2572
|
+
return /* @__PURE__ */ React40.createElement("span", null, imageTitle);
|
|
2393
2573
|
};
|
|
2394
2574
|
var ItemLabelGradient = ({ value }) => {
|
|
2395
2575
|
if (value.value.type.value === "linear") {
|
|
2396
|
-
return /* @__PURE__ */
|
|
2576
|
+
return /* @__PURE__ */ React40.createElement("span", null, __17("Linear Gradient", "elementor"));
|
|
2397
2577
|
}
|
|
2398
|
-
return /* @__PURE__ */
|
|
2578
|
+
return /* @__PURE__ */ React40.createElement("span", null, __17("Radial Gradient", "elementor"));
|
|
2579
|
+
};
|
|
2580
|
+
var ColorOverlayContent = () => {
|
|
2581
|
+
const propContext = useBoundProp(backgroundColorOverlayPropTypeUtil2);
|
|
2582
|
+
return /* @__PURE__ */ React40.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React40.createElement(ColorControl, null)));
|
|
2399
2583
|
};
|
|
2400
2584
|
var ImageOverlayContent = () => {
|
|
2401
2585
|
const propContext = useBoundProp(backgroundImageOverlayPropTypeUtil2);
|
|
2402
|
-
return /* @__PURE__ */
|
|
2586
|
+
return /* @__PURE__ */ React40.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React40.createElement(Grid13, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React40.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React40.createElement(
|
|
2403
2587
|
ImageControl,
|
|
2404
2588
|
{
|
|
2405
|
-
resolutionLabel:
|
|
2589
|
+
resolutionLabel: __17("Resolution", "elementor"),
|
|
2406
2590
|
sizes: backgroundResolutionOptions
|
|
2407
2591
|
}
|
|
2408
|
-
)))), /* @__PURE__ */
|
|
2592
|
+
)))), /* @__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)));
|
|
2409
2593
|
};
|
|
2410
2594
|
var useImage = (image) => {
|
|
2411
2595
|
let imageTitle, imageUrl = null;
|
|
@@ -2433,13 +2617,35 @@ var getGradientValue = (value) => {
|
|
|
2433
2617
|
// src/controls/background-control/background-control.tsx
|
|
2434
2618
|
var BackgroundControl = createControl(() => {
|
|
2435
2619
|
const propContext = useBoundProp(backgroundPropTypeUtil);
|
|
2436
|
-
return /* @__PURE__ */
|
|
2620
|
+
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(Grid14, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ControlLabel, null, __18("Color", "elementor"))), /* @__PURE__ */ React41.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ColorControl, null))))));
|
|
2437
2621
|
});
|
|
2622
|
+
|
|
2623
|
+
// src/control-adornments/control-adornments-context.tsx
|
|
2624
|
+
import * as React42 from "react";
|
|
2625
|
+
import { createContext as createContext5, useContext as useContext5 } from "react";
|
|
2626
|
+
var Context2 = createContext5(null);
|
|
2627
|
+
var ControlAdornmentsProvider = ({ children, items }) => /* @__PURE__ */ React42.createElement(Context2.Provider, { value: { items } }, children);
|
|
2628
|
+
var useControlAdornments = () => {
|
|
2629
|
+
const context = useContext5(Context2);
|
|
2630
|
+
return context?.items ?? [];
|
|
2631
|
+
};
|
|
2632
|
+
|
|
2633
|
+
// src/control-adornments/control-adornments.tsx
|
|
2634
|
+
import * as React43 from "react";
|
|
2635
|
+
function ControlAdornments() {
|
|
2636
|
+
const items = useControlAdornments();
|
|
2637
|
+
if (items?.length === 0) {
|
|
2638
|
+
return null;
|
|
2639
|
+
}
|
|
2640
|
+
return /* @__PURE__ */ React43.createElement(React43.Fragment, null, items.map(({ Adornment, id }) => /* @__PURE__ */ React43.createElement(Adornment, { key: id })));
|
|
2641
|
+
}
|
|
2438
2642
|
export {
|
|
2439
2643
|
BackgroundControl,
|
|
2440
2644
|
BoxShadowRepeaterControl,
|
|
2441
2645
|
ColorControl,
|
|
2442
2646
|
ControlActionsProvider,
|
|
2647
|
+
ControlAdornments,
|
|
2648
|
+
ControlAdornmentsProvider,
|
|
2443
2649
|
ControlLabel,
|
|
2444
2650
|
ControlReplacementProvider,
|
|
2445
2651
|
ControlToggleButtonGroup,
|