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