@elementor/editor-controls 0.14.0 → 0.16.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 +30 -0
- package/dist/index.d.mts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +480 -221
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +485 -217
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -6
- package/src/api.ts +16 -0
- package/src/components/repeater.tsx +20 -23
- package/src/controls/background-control/background-gradient-color-control.tsx +101 -0
- package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +43 -5
- package/src/controls/background-control/background-overlay/use-background-tabs-history.ts +29 -2
- package/src/controls/equal-unequal-sizes-control.tsx +15 -10
- package/src/controls/font-family-control/enqueue-font.tsx +15 -0
- package/src/controls/font-family-control/font-family-control.tsx +302 -0
- package/src/controls/gap-control.tsx +19 -11
- package/src/controls/image-control.tsx +6 -1
- package/src/controls/image-media-control.tsx +4 -6
- package/src/controls/linked-dimensions-control.tsx +57 -25
- package/src/controls/svg-media-control.tsx +15 -5
- package/src/hooks/use-filtered-font-families.ts +13 -26
- package/src/hooks/use-unfiltered-files-upload.ts +40 -0
- package/src/index.ts +1 -1
- package/src/controls/font-family-control.tsx +0 -157
package/dist/index.mjs
CHANGED
|
@@ -208,6 +208,34 @@ function createControl(Component, { supportsReplacements = true } = {}) {
|
|
|
208
208
|
};
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
+
// src/hooks/use-unfiltered-files-upload.ts
|
|
212
|
+
import { useMutation, useQuery, useQueryClient } from "@elementor/query";
|
|
213
|
+
|
|
214
|
+
// src/api.ts
|
|
215
|
+
import { httpService } from "@elementor/http";
|
|
216
|
+
var ELEMENTOR_SETTING_URL = "elementor/v1/settings";
|
|
217
|
+
var apiClient = {
|
|
218
|
+
getElementorSetting: (key) => httpService().get(`${ELEMENTOR_SETTING_URL}/${key}`).then((res) => formatSettingResponse(res.data)),
|
|
219
|
+
updateElementorSetting: (key, value) => httpService().put(`${ELEMENTOR_SETTING_URL}/${key}`, { value })
|
|
220
|
+
};
|
|
221
|
+
var formatSettingResponse = (response) => response.data.value;
|
|
222
|
+
|
|
223
|
+
// src/hooks/use-unfiltered-files-upload.ts
|
|
224
|
+
var UNFILTERED_FILES_UPLOAD_KEY = "elementor_unfiltered_files_upload";
|
|
225
|
+
var unfilteredFilesQueryKey = {
|
|
226
|
+
queryKey: [UNFILTERED_FILES_UPLOAD_KEY]
|
|
227
|
+
};
|
|
228
|
+
var useUnfilteredFilesUpload = () => useQuery({
|
|
229
|
+
...unfilteredFilesQueryKey,
|
|
230
|
+
queryFn: () => apiClient.getElementorSetting(UNFILTERED_FILES_UPLOAD_KEY).then((res) => {
|
|
231
|
+
return formatResponse(res);
|
|
232
|
+
}),
|
|
233
|
+
staleTime: Infinity
|
|
234
|
+
});
|
|
235
|
+
var formatResponse = (response) => {
|
|
236
|
+
return Boolean(response === "1");
|
|
237
|
+
};
|
|
238
|
+
|
|
211
239
|
// src/controls/image-media-control.tsx
|
|
212
240
|
import * as React8 from "react";
|
|
213
241
|
import { imageSrcPropTypeUtil } from "@elementor/editor-props";
|
|
@@ -246,19 +274,18 @@ function ControlActions({ children }) {
|
|
|
246
274
|
if (items.length === 0) {
|
|
247
275
|
return children;
|
|
248
276
|
}
|
|
249
|
-
const menuItems = items.map(({ MenuItem:
|
|
277
|
+
const menuItems = items.map(({ MenuItem: MenuItem4, id }) => /* @__PURE__ */ React7.createElement(MenuItem4, { key: id }));
|
|
250
278
|
return /* @__PURE__ */ React7.createElement(FloatingBarContainer, null, /* @__PURE__ */ React7.createElement(UnstableFloatingActionBar, { actions: menuItems }, children));
|
|
251
279
|
}
|
|
252
280
|
|
|
253
281
|
// src/controls/image-media-control.tsx
|
|
254
|
-
var ImageMediaControl = createControl((
|
|
282
|
+
var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
|
|
255
283
|
const { value, setValue } = useBoundProp(imageSrcPropTypeUtil);
|
|
256
284
|
const { id, url } = value ?? {};
|
|
257
285
|
const { data: attachment, isFetching } = useWpMediaAttachment(id?.value || null);
|
|
258
286
|
const src = attachment?.url ?? url?.value ?? null;
|
|
259
287
|
const { open } = useWpMediaFrame({
|
|
260
|
-
|
|
261
|
-
allowedExtensions: props.allowedExtensions,
|
|
288
|
+
mediaTypes,
|
|
262
289
|
multiple: false,
|
|
263
290
|
selected: id?.value || null,
|
|
264
291
|
onSelect: (selectedAttachment) => {
|
|
@@ -322,7 +349,9 @@ var SelectControl = createControl(({ options, onChange }) => {
|
|
|
322
349
|
var ImageControl = createControl(
|
|
323
350
|
({ sizes, resolutionLabel = __2("Image resolution", "elementor") }) => {
|
|
324
351
|
const propContext = useBoundProp(imagePropTypeUtil);
|
|
325
|
-
|
|
352
|
+
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
353
|
+
const mediaTypes = allowSvgUpload ? ["image", "svg"] : ["image"];
|
|
354
|
+
return /* @__PURE__ */ React10.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React10.createElement(Stack2, { gap: 1.5 }, /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React10.createElement(ControlLabel, null, " ", __2("Image", "elementor"), " "), /* @__PURE__ */ React10.createElement(ImageMediaControl, { mediaTypes })), /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React10.createElement(Grid, { container: true, gap: 1.5, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React10.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React10.createElement(ControlLabel, null, " ", resolutionLabel, " ")), /* @__PURE__ */ React10.createElement(Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React10.createElement(SelectControl, { options: sizes }))))));
|
|
326
355
|
}
|
|
327
356
|
);
|
|
328
357
|
|
|
@@ -610,6 +639,7 @@ import {
|
|
|
610
639
|
IconButton,
|
|
611
640
|
Popover,
|
|
612
641
|
Stack as Stack5,
|
|
642
|
+
Tooltip,
|
|
613
643
|
Typography as Typography2,
|
|
614
644
|
UnstableTag,
|
|
615
645
|
usePopupState as usePopupState2
|
|
@@ -813,6 +843,9 @@ var RepeaterItem = ({
|
|
|
813
843
|
const [anchorEl, setAnchorEl] = useState2(null);
|
|
814
844
|
const popoverState = usePopupState2({ popupId, variant: "popover" });
|
|
815
845
|
const popoverProps = bindPopover(popoverState);
|
|
846
|
+
const duplicateLabel = __4("Duplicate", "elementor");
|
|
847
|
+
const toggleLabel = disabled ? __4("Show", "elementor") : __4("Hide", "elementor");
|
|
848
|
+
const removeLabel = __4("Remove", "elementor");
|
|
816
849
|
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
|
|
817
850
|
UnstableTag,
|
|
818
851
|
{
|
|
@@ -824,31 +857,7 @@ var RepeaterItem = ({
|
|
|
824
857
|
"aria-label": __4("Open item", "elementor"),
|
|
825
858
|
...bindTrigger2(popoverState),
|
|
826
859
|
startIcon,
|
|
827
|
-
actions: /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
|
|
828
|
-
IconButton,
|
|
829
|
-
{
|
|
830
|
-
size: SIZE,
|
|
831
|
-
onClick: duplicateItem,
|
|
832
|
-
"aria-label": __4("Duplicate item", "elementor")
|
|
833
|
-
},
|
|
834
|
-
/* @__PURE__ */ React21.createElement(CopyIcon, { fontSize: SIZE })
|
|
835
|
-
), /* @__PURE__ */ React21.createElement(
|
|
836
|
-
IconButton,
|
|
837
|
-
{
|
|
838
|
-
size: SIZE,
|
|
839
|
-
onClick: toggleDisableItem,
|
|
840
|
-
"aria-label": disabled ? __4("Enable item", "elementor") : __4("Disable item", "elementor")
|
|
841
|
-
},
|
|
842
|
-
disabled ? /* @__PURE__ */ React21.createElement(EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ React21.createElement(EyeIcon, { fontSize: SIZE })
|
|
843
|
-
), /* @__PURE__ */ React21.createElement(
|
|
844
|
-
IconButton,
|
|
845
|
-
{
|
|
846
|
-
size: SIZE,
|
|
847
|
-
onClick: removeItem,
|
|
848
|
-
"aria-label": __4("Remove item", "elementor")
|
|
849
|
-
},
|
|
850
|
-
/* @__PURE__ */ React21.createElement(XIcon, { fontSize: SIZE })
|
|
851
|
-
)),
|
|
860
|
+
actions: /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React21.createElement(IconButton, { size: SIZE, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React21.createElement(CopyIcon, { fontSize: SIZE }))), /* @__PURE__ */ React21.createElement(Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React21.createElement(IconButton, { size: SIZE, onClick: toggleDisableItem, "aria-label": toggleLabel }, disabled ? /* @__PURE__ */ React21.createElement(EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ React21.createElement(EyeIcon, { fontSize: SIZE }))), /* @__PURE__ */ React21.createElement(Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React21.createElement(IconButton, { size: SIZE, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React21.createElement(XIcon, { fontSize: SIZE })))),
|
|
852
861
|
sx: { backgroundColor: "background.paper" }
|
|
853
862
|
}
|
|
854
863
|
), /* @__PURE__ */ React21.createElement(
|
|
@@ -972,7 +981,7 @@ import {
|
|
|
972
981
|
styled as styled3,
|
|
973
982
|
ToggleButton,
|
|
974
983
|
ToggleButtonGroup,
|
|
975
|
-
Tooltip,
|
|
984
|
+
Tooltip as Tooltip2,
|
|
976
985
|
useTheme
|
|
977
986
|
} from "@elementor/ui";
|
|
978
987
|
var StyledToggleButtonGroup = styled3(ToggleButtonGroup)`
|
|
@@ -1003,7 +1012,7 @@ var ControlToggleButtonGroup = ({
|
|
|
1003
1012
|
}
|
|
1004
1013
|
},
|
|
1005
1014
|
items.map(
|
|
1006
|
-
({ label, value: buttonValue, renderContent: Content3, showTooltip }) => showTooltip ? /* @__PURE__ */ React23.createElement(
|
|
1015
|
+
({ label, value: buttonValue, renderContent: Content3, showTooltip }) => showTooltip ? /* @__PURE__ */ React23.createElement(Tooltip2, { key: buttonValue, title: label, disableFocusListener: true, placement: "top" }, /* @__PURE__ */ React23.createElement(ToggleButton, { value: buttonValue, "aria-label": label, size, fullWidth }, /* @__PURE__ */ React23.createElement(Content3, { size }))) : /* @__PURE__ */ React23.createElement(
|
|
1007
1016
|
ToggleButton,
|
|
1008
1017
|
{
|
|
1009
1018
|
key: buttonValue,
|
|
@@ -1081,7 +1090,7 @@ var NumberControl = createControl(
|
|
|
1081
1090
|
import * as React26 from "react";
|
|
1082
1091
|
import { useId as useId2, useRef as useRef2 } from "react";
|
|
1083
1092
|
import { sizePropTypeUtil as sizePropTypeUtil2 } from "@elementor/editor-props";
|
|
1084
|
-
import { bindPopover as bindPopover2, bindToggle, Grid as Grid5, Popover as Popover2, Stack as Stack6, ToggleButton as ToggleButton2, usePopupState as usePopupState3 } from "@elementor/ui";
|
|
1093
|
+
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";
|
|
1085
1094
|
import { __ as __6 } from "@wordpress/i18n";
|
|
1086
1095
|
var isEqualSizes = (propValue, items) => {
|
|
1087
1096
|
const values = Object.values(propValue);
|
|
@@ -1096,6 +1105,7 @@ var isEqualSizes = (propValue, items) => {
|
|
|
1096
1105
|
function EqualUnequalSizesControl({
|
|
1097
1106
|
label,
|
|
1098
1107
|
icon,
|
|
1108
|
+
tooltipLabel,
|
|
1099
1109
|
items,
|
|
1100
1110
|
multiSizePropTypeUtil
|
|
1101
1111
|
}) {
|
|
@@ -1135,17 +1145,18 @@ function EqualUnequalSizesControl({
|
|
|
1135
1145
|
return splitEqualValue() ?? null;
|
|
1136
1146
|
};
|
|
1137
1147
|
const isMixed = !!multiSizeValue;
|
|
1138
|
-
return /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement(Grid5, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: controlRef }, /* @__PURE__ */ React26.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(ControlLabel, null, label)), /* @__PURE__ */ React26.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(Stack6, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React26.createElement(SizeControl, { placeholder: isMixed ? __6("Mixed", "elementor") : void 0 }), /* @__PURE__ */ React26.createElement(
|
|
1148
|
+
return /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement(Grid5, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: controlRef }, /* @__PURE__ */ React26.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(ControlLabel, null, label)), /* @__PURE__ */ React26.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(Stack6, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React26.createElement(SizeControl, { placeholder: isMixed ? __6("Mixed", "elementor") : void 0 }), /* @__PURE__ */ React26.createElement(Tooltip3, { title: tooltipLabel, placement: "top" }, /* @__PURE__ */ React26.createElement(
|
|
1139
1149
|
ToggleButton2,
|
|
1140
1150
|
{
|
|
1141
1151
|
size: "tiny",
|
|
1142
1152
|
value: "check",
|
|
1143
1153
|
sx: { marginLeft: "auto" },
|
|
1144
1154
|
...bindToggle(popupState),
|
|
1145
|
-
selected: popupState.isOpen
|
|
1155
|
+
selected: popupState.isOpen,
|
|
1156
|
+
"aria-label": tooltipLabel
|
|
1146
1157
|
},
|
|
1147
1158
|
icon
|
|
1148
|
-
)))), /* @__PURE__ */ React26.createElement(
|
|
1159
|
+
))))), /* @__PURE__ */ React26.createElement(
|
|
1149
1160
|
Popover2,
|
|
1150
1161
|
{
|
|
1151
1162
|
disablePortal: true,
|
|
@@ -1172,10 +1183,14 @@ var MultiSizeValueControl = ({ item }) => /* @__PURE__ */ React26.createElement(
|
|
|
1172
1183
|
import * as React27 from "react";
|
|
1173
1184
|
import { dimensionsPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil3 } from "@elementor/editor-props";
|
|
1174
1185
|
import { DetachIcon, LinkIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
1175
|
-
import { Grid as Grid6, Stack as Stack7, ToggleButton as ToggleButton3 } from "@elementor/ui";
|
|
1186
|
+
import { Grid as Grid6, Stack as Stack7, ToggleButton as ToggleButton3, Tooltip as Tooltip4 } from "@elementor/ui";
|
|
1176
1187
|
import { __ as __7 } from "@wordpress/i18n";
|
|
1177
1188
|
var LinkedDimensionsControl = createControl(
|
|
1178
|
-
({
|
|
1189
|
+
({
|
|
1190
|
+
label,
|
|
1191
|
+
isSiteRtl = false,
|
|
1192
|
+
extendedValues
|
|
1193
|
+
}) => {
|
|
1179
1194
|
const {
|
|
1180
1195
|
value: dimensionsValue,
|
|
1181
1196
|
setValue: setDimensionsValue,
|
|
@@ -1185,22 +1200,25 @@ var LinkedDimensionsControl = createControl(
|
|
|
1185
1200
|
const isLinked = !dimensionsValue && !sizeValue ? true : !!sizeValue;
|
|
1186
1201
|
const onLinkToggle = () => {
|
|
1187
1202
|
if (!isLinked) {
|
|
1188
|
-
setSizeValue(dimensionsValue?.
|
|
1203
|
+
setSizeValue(dimensionsValue["block-start"]?.value);
|
|
1189
1204
|
return;
|
|
1190
1205
|
}
|
|
1191
1206
|
const value = sizeValue ? sizePropTypeUtil3.create(sizeValue) : null;
|
|
1192
1207
|
setDimensionsValue({
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1208
|
+
"block-start": value,
|
|
1209
|
+
"block-end": value,
|
|
1210
|
+
"inline-start": value,
|
|
1211
|
+
"inline-end": value
|
|
1197
1212
|
});
|
|
1198
1213
|
};
|
|
1214
|
+
const tooltipLabel = label.toLowerCase();
|
|
1199
1215
|
const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
|
|
1200
|
-
|
|
1216
|
+
const linkedLabel = __7("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
1217
|
+
const unlinkedLabel = __7("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
1218
|
+
return /* @__PURE__ */ React27.createElement(PropProvider, { propType, value: dimensionsValue, setValue: setDimensionsValue }, /* @__PURE__ */ React27.createElement(Stack7, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(ControlLabel, null, label), /* @__PURE__ */ React27.createElement(Tooltip4, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React27.createElement(
|
|
1201
1219
|
ToggleButton3,
|
|
1202
1220
|
{
|
|
1203
|
-
"aria-label":
|
|
1221
|
+
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
1204
1222
|
size: "tiny",
|
|
1205
1223
|
value: "check",
|
|
1206
1224
|
selected: isLinked,
|
|
@@ -1208,35 +1226,35 @@ var LinkedDimensionsControl = createControl(
|
|
|
1208
1226
|
onChange: onLinkToggle
|
|
1209
1227
|
},
|
|
1210
1228
|
/* @__PURE__ */ React27.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1211
|
-
)), /* @__PURE__ */ React27.createElement(Stack7, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(Grid6, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, __7("Top", "elementor"))), /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1229
|
+
))), /* @__PURE__ */ React27.createElement(Stack7, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(Grid6, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, __7("Top", "elementor"))), /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1212
1230
|
Control3,
|
|
1213
1231
|
{
|
|
1214
|
-
bind: "
|
|
1232
|
+
bind: "block-start",
|
|
1215
1233
|
startIcon: /* @__PURE__ */ React27.createElement(SideTopIcon, { fontSize: "tiny" }),
|
|
1216
1234
|
isLinked,
|
|
1217
1235
|
extendedValues
|
|
1218
1236
|
}
|
|
1219
|
-
))), /* @__PURE__ */ React27.createElement(Grid6, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, __7("Right", "elementor"))), /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1237
|
+
))), /* @__PURE__ */ React27.createElement(Grid6, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, isSiteRtl ? __7("Left", "elementor") : __7("Right", "elementor"))), /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1220
1238
|
Control3,
|
|
1221
1239
|
{
|
|
1222
|
-
bind: "
|
|
1223
|
-
startIcon: /* @__PURE__ */ React27.createElement(SideRightIcon, { fontSize: "tiny" }),
|
|
1240
|
+
bind: "inline-end",
|
|
1241
|
+
startIcon: isSiteRtl ? /* @__PURE__ */ React27.createElement(SideLeftIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React27.createElement(SideRightIcon, { fontSize: "tiny" }),
|
|
1224
1242
|
isLinked,
|
|
1225
1243
|
extendedValues
|
|
1226
1244
|
}
|
|
1227
1245
|
)))), /* @__PURE__ */ React27.createElement(Stack7, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(Grid6, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, __7("Bottom", "elementor"))), /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1228
1246
|
Control3,
|
|
1229
1247
|
{
|
|
1230
|
-
bind: "
|
|
1248
|
+
bind: "block-end",
|
|
1231
1249
|
startIcon: /* @__PURE__ */ React27.createElement(SideBottomIcon, { fontSize: "tiny" }),
|
|
1232
1250
|
isLinked,
|
|
1233
1251
|
extendedValues
|
|
1234
1252
|
}
|
|
1235
|
-
))), /* @__PURE__ */ React27.createElement(Grid6, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, __7("Left", "elementor"))), /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1253
|
+
))), /* @__PURE__ */ React27.createElement(Grid6, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, isSiteRtl ? __7("Right", "elementor") : __7("Left", "elementor"))), /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1236
1254
|
Control3,
|
|
1237
1255
|
{
|
|
1238
|
-
bind: "
|
|
1239
|
-
startIcon: /* @__PURE__ */ React27.createElement(SideLeftIcon, { fontSize: "tiny" }),
|
|
1256
|
+
bind: "inline-start",
|
|
1257
|
+
startIcon: isSiteRtl ? /* @__PURE__ */ React27.createElement(SideRightIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React27.createElement(SideLeftIcon, { fontSize: "tiny" }),
|
|
1240
1258
|
isLinked,
|
|
1241
1259
|
extendedValues
|
|
1242
1260
|
}
|
|
@@ -1255,11 +1273,11 @@ var Control3 = ({
|
|
|
1255
1273
|
return /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React27.createElement(SizeControl, { startIcon, extendedValues }));
|
|
1256
1274
|
};
|
|
1257
1275
|
|
|
1258
|
-
// src/controls/font-family-control.tsx
|
|
1259
|
-
import { Fragment as Fragment4, useId as useId3, useState as useState3 } from "react";
|
|
1276
|
+
// src/controls/font-family-control/font-family-control.tsx
|
|
1260
1277
|
import * as React28 from "react";
|
|
1278
|
+
import { useEffect as useEffect2, useRef as useRef3, useState as useState3 } from "react";
|
|
1261
1279
|
import { stringPropTypeUtil as stringPropTypeUtil6 } from "@elementor/editor-props";
|
|
1262
|
-
import { ChevronDownIcon,
|
|
1280
|
+
import { ChevronDownIcon, SearchIcon, TextIcon, XIcon as XIcon2 } from "@elementor/icons";
|
|
1263
1281
|
import {
|
|
1264
1282
|
bindPopover as bindPopover3,
|
|
1265
1283
|
bindTrigger as bindTrigger3,
|
|
@@ -1269,58 +1287,50 @@ import {
|
|
|
1269
1287
|
InputAdornment as InputAdornment3,
|
|
1270
1288
|
Link,
|
|
1271
1289
|
ListSubheader,
|
|
1272
|
-
MenuItem as MenuItem3,
|
|
1273
1290
|
MenuList,
|
|
1274
1291
|
Popover as Popover3,
|
|
1275
1292
|
Stack as Stack8,
|
|
1293
|
+
styled as styled4,
|
|
1276
1294
|
TextField as TextField5,
|
|
1277
1295
|
Typography as Typography4,
|
|
1278
1296
|
UnstableTag as UnstableTag2,
|
|
1279
1297
|
usePopupState as usePopupState4
|
|
1280
1298
|
} from "@elementor/ui";
|
|
1281
|
-
import {
|
|
1299
|
+
import { debounce } from "@elementor/utils";
|
|
1300
|
+
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
1301
|
+
import { __ as __8 } from "@wordpress/i18n";
|
|
1282
1302
|
|
|
1283
1303
|
// src/hooks/use-filtered-font-families.ts
|
|
1284
|
-
import { __ as __8 } from "@wordpress/i18n";
|
|
1285
|
-
var supportedCategories = {
|
|
1286
|
-
system: __8("System", "elementor"),
|
|
1287
|
-
googlefonts: __8("Google Fonts", "elementor"),
|
|
1288
|
-
customfonts: __8("Custom Fonts", "elementor")
|
|
1289
|
-
};
|
|
1290
1304
|
var useFilteredFontFamilies = (fontFamilies, searchValue) => {
|
|
1291
1305
|
const filteredFontFamilies = Object.entries(fontFamilies).reduce(
|
|
1292
|
-
(acc, [
|
|
1293
|
-
const
|
|
1294
|
-
if (
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
const existingCategory = acc.get(categoryLabel);
|
|
1300
|
-
if (existingCategory) {
|
|
1301
|
-
existingCategory.push(font);
|
|
1302
|
-
} else {
|
|
1303
|
-
acc.set(categoryLabel, [font]);
|
|
1304
|
-
}
|
|
1306
|
+
(acc, [category, fonts]) => {
|
|
1307
|
+
const filteredFonts = fonts.filter((font) => font.toLowerCase().includes(searchValue.toLowerCase()));
|
|
1308
|
+
if (filteredFonts.length) {
|
|
1309
|
+
acc.push({ type: "category", value: category });
|
|
1310
|
+
filteredFonts.forEach((font) => {
|
|
1311
|
+
acc.push({ type: "font", value: font });
|
|
1312
|
+
});
|
|
1305
1313
|
}
|
|
1306
1314
|
return acc;
|
|
1307
1315
|
},
|
|
1308
|
-
|
|
1316
|
+
[]
|
|
1309
1317
|
);
|
|
1310
1318
|
return [...filteredFontFamilies];
|
|
1311
1319
|
};
|
|
1312
1320
|
|
|
1313
|
-
// src/controls/font-family-control.tsx
|
|
1321
|
+
// src/controls/font-family-control/enqueue-font.tsx
|
|
1322
|
+
var enqueueFont = (fontFamily, context = "editor") => {
|
|
1323
|
+
const extendedWindow = window;
|
|
1324
|
+
return extendedWindow.elementor?.helpers?.enqueueFont?.(fontFamily, context) ?? null;
|
|
1325
|
+
};
|
|
1326
|
+
|
|
1327
|
+
// src/controls/font-family-control/font-family-control.tsx
|
|
1314
1328
|
var SIZE2 = "tiny";
|
|
1315
1329
|
var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
1316
1330
|
const [searchValue, setSearchValue] = useState3("");
|
|
1317
1331
|
const { value: fontFamily, setValue: setFontFamily } = useBoundProp(stringPropTypeUtil6);
|
|
1318
|
-
const
|
|
1319
|
-
const popoverState = usePopupState4({ variant: "popover", popupId });
|
|
1332
|
+
const popoverState = usePopupState4({ variant: "popover" });
|
|
1320
1333
|
const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
|
|
1321
|
-
if (!filteredFontFamilies) {
|
|
1322
|
-
return null;
|
|
1323
|
-
}
|
|
1324
1334
|
const handleSearch = (event) => {
|
|
1325
1335
|
setSearchValue(event.target.value);
|
|
1326
1336
|
};
|
|
@@ -1346,42 +1356,47 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1346
1356
|
...bindPopover3(popoverState),
|
|
1347
1357
|
onClose: handleClose
|
|
1348
1358
|
},
|
|
1349
|
-
/* @__PURE__ */ React28.createElement(Stack8, null, /* @__PURE__ */ React28.createElement(Stack8, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React28.createElement(
|
|
1359
|
+
/* @__PURE__ */ React28.createElement(Stack8, null, /* @__PURE__ */ React28.createElement(Stack8, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React28.createElement(TextIcon, { fontSize: SIZE2, sx: { mr: 0.5 } }), /* @__PURE__ */ React28.createElement(Typography4, { variant: "subtitle2" }, __8("Font Family", "elementor")), /* @__PURE__ */ React28.createElement(IconButton2, { size: SIZE2, sx: { ml: "auto" }, onClick: handleClose }, /* @__PURE__ */ React28.createElement(XIcon2, { fontSize: SIZE2 }))), /* @__PURE__ */ React28.createElement(Box2, { px: 1.5, pb: 1 }, /* @__PURE__ */ React28.createElement(
|
|
1350
1360
|
TextField5,
|
|
1351
1361
|
{
|
|
1352
1362
|
fullWidth: true,
|
|
1353
1363
|
size: SIZE2,
|
|
1354
1364
|
value: searchValue,
|
|
1355
|
-
placeholder:
|
|
1365
|
+
placeholder: __8("Search", "elementor"),
|
|
1356
1366
|
onChange: handleSearch,
|
|
1357
1367
|
InputProps: {
|
|
1358
1368
|
startAdornment: /* @__PURE__ */ React28.createElement(InputAdornment3, { position: "start" }, /* @__PURE__ */ React28.createElement(SearchIcon, { fontSize: SIZE2 }))
|
|
1359
1369
|
}
|
|
1360
1370
|
}
|
|
1361
|
-
)), /* @__PURE__ */ React28.createElement(Divider2, null),
|
|
1362
|
-
|
|
1371
|
+
)), /* @__PURE__ */ React28.createElement(Divider2, null), filteredFontFamilies.length > 0 ? /* @__PURE__ */ React28.createElement(
|
|
1372
|
+
FontList,
|
|
1373
|
+
{
|
|
1374
|
+
fontListItems: filteredFontFamilies,
|
|
1375
|
+
setFontFamily,
|
|
1376
|
+
handleClose,
|
|
1377
|
+
fontFamily
|
|
1378
|
+
}
|
|
1379
|
+
) : /* @__PURE__ */ React28.createElement(Box2, { sx: { overflowY: "auto", height: 260, width: 220 } }, /* @__PURE__ */ React28.createElement(Stack8, { alignItems: "center", p: 2.5, gap: 1.5, overflow: "hidden" }, /* @__PURE__ */ React28.createElement(TextIcon, { fontSize: "large" }), /* @__PURE__ */ React28.createElement(Box2, { sx: { maxWidth: 160, overflow: "hidden" } }, /* @__PURE__ */ React28.createElement(Typography4, { align: "center", variant: "subtitle2", color: "text.secondary" }, __8("Sorry, nothing matched", "elementor")), /* @__PURE__ */ React28.createElement(
|
|
1380
|
+
Typography4,
|
|
1363
1381
|
{
|
|
1364
|
-
|
|
1382
|
+
variant: "subtitle2",
|
|
1383
|
+
color: "text.secondary",
|
|
1384
|
+
sx: {
|
|
1385
|
+
display: "flex",
|
|
1386
|
+
width: "100%",
|
|
1387
|
+
justifyContent: "center"
|
|
1388
|
+
}
|
|
1365
1389
|
},
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
return /* @__PURE__ */ React28.createElement(
|
|
1370
|
-
MenuItem3,
|
|
1390
|
+
/* @__PURE__ */ React28.createElement("span", null, "\u201C"),
|
|
1391
|
+
/* @__PURE__ */ React28.createElement(
|
|
1392
|
+
"span",
|
|
1371
1393
|
{
|
|
1372
|
-
|
|
1373
|
-
selected: isSelected,
|
|
1374
|
-
autoFocus: isSelected,
|
|
1375
|
-
onClick: () => {
|
|
1376
|
-
setFontFamily(item);
|
|
1377
|
-
handleClose();
|
|
1378
|
-
},
|
|
1379
|
-
sx: { px: 1.5, typography: "caption" },
|
|
1380
|
-
style: { fontFamily: item }
|
|
1394
|
+
style: { maxWidth: "80%", overflow: "hidden", textOverflow: "ellipsis" }
|
|
1381
1395
|
},
|
|
1382
|
-
|
|
1383
|
-
)
|
|
1384
|
-
|
|
1396
|
+
searchValue
|
|
1397
|
+
),
|
|
1398
|
+
/* @__PURE__ */ React28.createElement("span", null, "\u201D.")
|
|
1399
|
+
)), /* @__PURE__ */ React28.createElement(Typography4, { align: "center", variant: "caption", color: "text.secondary" }, __8("Try something else.", "elementor"), /* @__PURE__ */ React28.createElement(
|
|
1385
1400
|
Link,
|
|
1386
1401
|
{
|
|
1387
1402
|
color: "secondary",
|
|
@@ -1389,10 +1404,139 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1389
1404
|
component: "button",
|
|
1390
1405
|
onClick: () => setSearchValue("")
|
|
1391
1406
|
},
|
|
1392
|
-
|
|
1393
|
-
)
|
|
1407
|
+
__8("Clear & try again", "elementor")
|
|
1408
|
+
)))))
|
|
1394
1409
|
));
|
|
1395
1410
|
});
|
|
1411
|
+
var LIST_ITEM_HEIGHT = 36;
|
|
1412
|
+
var LIST_ITEMS_BUFFER = 6;
|
|
1413
|
+
var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
1414
|
+
const containerRef = useRef3(null);
|
|
1415
|
+
const selectedItem = fontListItems.find((item) => item.value === fontFamily);
|
|
1416
|
+
const debouncedVirtualizeChange = useDebounce(({ getVirtualIndexes }) => {
|
|
1417
|
+
getVirtualIndexes().forEach((index) => {
|
|
1418
|
+
const item = fontListItems[index];
|
|
1419
|
+
if (item && item.type === "font") {
|
|
1420
|
+
enqueueFont(item.value);
|
|
1421
|
+
}
|
|
1422
|
+
});
|
|
1423
|
+
}, 100);
|
|
1424
|
+
const virtualizer = useVirtualizer({
|
|
1425
|
+
count: fontListItems.length,
|
|
1426
|
+
getScrollElement: () => containerRef.current,
|
|
1427
|
+
estimateSize: () => LIST_ITEM_HEIGHT,
|
|
1428
|
+
overscan: LIST_ITEMS_BUFFER,
|
|
1429
|
+
onChange: debouncedVirtualizeChange
|
|
1430
|
+
});
|
|
1431
|
+
useEffect2(
|
|
1432
|
+
() => {
|
|
1433
|
+
virtualizer.scrollToIndex(fontListItems.findIndex((item) => item.value === fontFamily));
|
|
1434
|
+
},
|
|
1435
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1436
|
+
[fontFamily]
|
|
1437
|
+
);
|
|
1438
|
+
return /* @__PURE__ */ React28.createElement(
|
|
1439
|
+
Box2,
|
|
1440
|
+
{
|
|
1441
|
+
ref: containerRef,
|
|
1442
|
+
sx: {
|
|
1443
|
+
overflowY: "auto",
|
|
1444
|
+
height: 260,
|
|
1445
|
+
width: 220
|
|
1446
|
+
}
|
|
1447
|
+
},
|
|
1448
|
+
/* @__PURE__ */ React28.createElement(
|
|
1449
|
+
StyledMenuList,
|
|
1450
|
+
{
|
|
1451
|
+
role: "listbox",
|
|
1452
|
+
style: {
|
|
1453
|
+
height: `${virtualizer.getTotalSize()}px`
|
|
1454
|
+
},
|
|
1455
|
+
"data-testid": "font-list"
|
|
1456
|
+
},
|
|
1457
|
+
virtualizer.getVirtualItems().map((virtualRow) => {
|
|
1458
|
+
const item = fontListItems[virtualRow.index];
|
|
1459
|
+
const isLast = virtualRow.index === fontListItems.length - 1;
|
|
1460
|
+
const isFirst = virtualRow.index === 1;
|
|
1461
|
+
const isSelected = selectedItem?.value === item.value;
|
|
1462
|
+
const tabIndexFallback = !selectedItem ? 0 : -1;
|
|
1463
|
+
if (item.type === "category") {
|
|
1464
|
+
return /* @__PURE__ */ React28.createElement(
|
|
1465
|
+
ListSubheader,
|
|
1466
|
+
{
|
|
1467
|
+
key: virtualRow.key,
|
|
1468
|
+
style: {
|
|
1469
|
+
transform: `translateY(${virtualRow.start}px)`
|
|
1470
|
+
}
|
|
1471
|
+
},
|
|
1472
|
+
item.value
|
|
1473
|
+
);
|
|
1474
|
+
}
|
|
1475
|
+
return /* @__PURE__ */ React28.createElement(
|
|
1476
|
+
"li",
|
|
1477
|
+
{
|
|
1478
|
+
key: virtualRow.key,
|
|
1479
|
+
role: "option",
|
|
1480
|
+
"aria-selected": isSelected,
|
|
1481
|
+
onClick: () => {
|
|
1482
|
+
setFontFamily(item.value);
|
|
1483
|
+
handleClose();
|
|
1484
|
+
},
|
|
1485
|
+
onKeyDown: (event) => {
|
|
1486
|
+
if (event.key === "Enter") {
|
|
1487
|
+
setFontFamily(item.value);
|
|
1488
|
+
handleClose();
|
|
1489
|
+
}
|
|
1490
|
+
if (event.key === "ArrowDown" && isLast) {
|
|
1491
|
+
event.preventDefault();
|
|
1492
|
+
event.stopPropagation();
|
|
1493
|
+
}
|
|
1494
|
+
if (event.key === "ArrowUp" && isFirst) {
|
|
1495
|
+
event.preventDefault();
|
|
1496
|
+
event.stopPropagation();
|
|
1497
|
+
}
|
|
1498
|
+
},
|
|
1499
|
+
tabIndex: isSelected ? 0 : tabIndexFallback,
|
|
1500
|
+
style: {
|
|
1501
|
+
transform: `translateY(${virtualRow.start}px)`,
|
|
1502
|
+
fontFamily: item.value
|
|
1503
|
+
}
|
|
1504
|
+
},
|
|
1505
|
+
item.value
|
|
1506
|
+
);
|
|
1507
|
+
})
|
|
1508
|
+
)
|
|
1509
|
+
);
|
|
1510
|
+
};
|
|
1511
|
+
var StyledMenuList = styled4(MenuList)(({ theme }) => ({
|
|
1512
|
+
"& > li": {
|
|
1513
|
+
height: LIST_ITEM_HEIGHT,
|
|
1514
|
+
position: "absolute",
|
|
1515
|
+
top: 0,
|
|
1516
|
+
left: 0,
|
|
1517
|
+
width: "100%"
|
|
1518
|
+
},
|
|
1519
|
+
'& > [role="option"]': {
|
|
1520
|
+
...theme.typography.caption,
|
|
1521
|
+
lineHeight: "inherit",
|
|
1522
|
+
padding: theme.spacing(0.75, 2),
|
|
1523
|
+
"&:hover, &:focus": {
|
|
1524
|
+
backgroundColor: theme.palette.action.hover
|
|
1525
|
+
},
|
|
1526
|
+
'&[aria-selected="true"]': {
|
|
1527
|
+
backgroundColor: theme.palette.action.selected
|
|
1528
|
+
},
|
|
1529
|
+
cursor: "pointer",
|
|
1530
|
+
textOverflow: "ellipsis"
|
|
1531
|
+
},
|
|
1532
|
+
width: "100%",
|
|
1533
|
+
position: "relative"
|
|
1534
|
+
}));
|
|
1535
|
+
var useDebounce = (fn, delay) => {
|
|
1536
|
+
const [debouncedFn] = useState3(() => debounce(fn, delay));
|
|
1537
|
+
useEffect2(() => () => debouncedFn.cancel(), [debouncedFn]);
|
|
1538
|
+
return debouncedFn;
|
|
1539
|
+
};
|
|
1396
1540
|
|
|
1397
1541
|
// src/controls/url-control.tsx
|
|
1398
1542
|
import * as React29 from "react";
|
|
@@ -1423,12 +1567,12 @@ import {
|
|
|
1423
1567
|
stringPropTypeUtil as stringPropTypeUtil7,
|
|
1424
1568
|
urlPropTypeUtil as urlPropTypeUtil2
|
|
1425
1569
|
} from "@elementor/editor-props";
|
|
1426
|
-
import { httpService } from "@elementor/http";
|
|
1570
|
+
import { httpService as httpService2 } from "@elementor/http";
|
|
1427
1571
|
import { MinusIcon, PlusIcon as PlusIcon2 } from "@elementor/icons";
|
|
1428
1572
|
import { useSessionStorage } from "@elementor/session";
|
|
1429
1573
|
import { Collapse, Divider as Divider3, Grid as Grid7, IconButton as IconButton4, Stack as Stack9, Switch } from "@elementor/ui";
|
|
1430
|
-
import { debounce } from "@elementor/utils";
|
|
1431
|
-
import { __ as
|
|
1574
|
+
import { debounce as debounce2 } from "@elementor/utils";
|
|
1575
|
+
import { __ as __9 } from "@wordpress/i18n";
|
|
1432
1576
|
|
|
1433
1577
|
// src/components/autocomplete.tsx
|
|
1434
1578
|
import * as React30 from "react";
|
|
@@ -1592,7 +1736,7 @@ var LinkControl = createControl((props) => {
|
|
|
1592
1736
|
debounceFetch({ ...requestParams, term: newValue });
|
|
1593
1737
|
};
|
|
1594
1738
|
const debounceFetch = useMemo(
|
|
1595
|
-
() =>
|
|
1739
|
+
() => debounce2(
|
|
1596
1740
|
(params) => fetchOptions(endpoint, params).then((newOptions) => {
|
|
1597
1741
|
setOptions(formatOptions(newOptions));
|
|
1598
1742
|
}),
|
|
@@ -1609,13 +1753,13 @@ var LinkControl = createControl((props) => {
|
|
|
1609
1753
|
alignItems: "center"
|
|
1610
1754
|
}
|
|
1611
1755
|
},
|
|
1612
|
-
/* @__PURE__ */ React31.createElement(ControlLabel, null,
|
|
1756
|
+
/* @__PURE__ */ React31.createElement(ControlLabel, null, __9("Link", "elementor")),
|
|
1613
1757
|
/* @__PURE__ */ React31.createElement(
|
|
1614
1758
|
ToggleIconControl,
|
|
1615
1759
|
{
|
|
1616
1760
|
enabled: isEnabled,
|
|
1617
1761
|
onIconClick: onEnabledChange,
|
|
1618
|
-
label:
|
|
1762
|
+
label: __9("Toggle link", "elementor")
|
|
1619
1763
|
}
|
|
1620
1764
|
)
|
|
1621
1765
|
), /* @__PURE__ */ React31.createElement(Collapse, { in: isEnabled, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React31.createElement(Stack9, { gap: 1.5 }, /* @__PURE__ */ React31.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ React31.createElement(ControlActions, null, /* @__PURE__ */ React31.createElement(
|
|
@@ -1639,14 +1783,14 @@ var SwitchControl = () => {
|
|
|
1639
1783
|
const onClick = () => {
|
|
1640
1784
|
setValue(!value);
|
|
1641
1785
|
};
|
|
1642
|
-
return /* @__PURE__ */ React31.createElement(Grid7, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React31.createElement(Grid7, { item: true }, /* @__PURE__ */ React31.createElement(ControlLabel, null,
|
|
1786
|
+
return /* @__PURE__ */ React31.createElement(Grid7, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React31.createElement(Grid7, { item: true }, /* @__PURE__ */ React31.createElement(ControlLabel, null, __9("Open in a new tab", "elementor"))), /* @__PURE__ */ React31.createElement(Grid7, { item: true }, /* @__PURE__ */ React31.createElement(Switch, { checked: value, onClick })));
|
|
1643
1787
|
};
|
|
1644
1788
|
async function fetchOptions(ajaxUrl, params) {
|
|
1645
1789
|
if (!params || !ajaxUrl) {
|
|
1646
1790
|
return [];
|
|
1647
1791
|
}
|
|
1648
1792
|
try {
|
|
1649
|
-
const { data: response } = await
|
|
1793
|
+
const { data: response } = await httpService2().get(ajaxUrl, { params });
|
|
1650
1794
|
return response.data.value;
|
|
1651
1795
|
} catch {
|
|
1652
1796
|
return [];
|
|
@@ -1674,8 +1818,8 @@ function generateFirstLoadedOption(unionValue) {
|
|
|
1674
1818
|
import * as React32 from "react";
|
|
1675
1819
|
import { layoutDirectionPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil4 } from "@elementor/editor-props";
|
|
1676
1820
|
import { DetachIcon as DetachIcon2, LinkIcon as LinkIcon2 } from "@elementor/icons";
|
|
1677
|
-
import { Grid as Grid8, Stack as Stack10, ToggleButton as ToggleButton4 } from "@elementor/ui";
|
|
1678
|
-
import { __ as
|
|
1821
|
+
import { Grid as Grid8, Stack as Stack10, ToggleButton as ToggleButton4, Tooltip as Tooltip5 } from "@elementor/ui";
|
|
1822
|
+
import { __ as __10 } from "@wordpress/i18n";
|
|
1679
1823
|
var GapControl = createControl(({ label }) => {
|
|
1680
1824
|
const {
|
|
1681
1825
|
value: directionValue,
|
|
@@ -1695,11 +1839,14 @@ var GapControl = createControl(({ label }) => {
|
|
|
1695
1839
|
column: value
|
|
1696
1840
|
});
|
|
1697
1841
|
};
|
|
1842
|
+
const tooltipLabel = label.toLowerCase();
|
|
1698
1843
|
const LinkedIcon = isLinked ? LinkIcon2 : DetachIcon2;
|
|
1699
|
-
|
|
1844
|
+
const linkedLabel = __10("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
1845
|
+
const unlinkedLabel = __10("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
1846
|
+
return /* @__PURE__ */ React32.createElement(PropProvider, { propType, value: directionValue, setValue: setDirectionValue }, /* @__PURE__ */ React32.createElement(Stack10, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(ControlLabel, null, label), /* @__PURE__ */ React32.createElement(Tooltip5, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React32.createElement(
|
|
1700
1847
|
ToggleButton4,
|
|
1701
1848
|
{
|
|
1702
|
-
"aria-label":
|
|
1849
|
+
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
1703
1850
|
size: "tiny",
|
|
1704
1851
|
value: "check",
|
|
1705
1852
|
selected: isLinked,
|
|
@@ -1707,7 +1854,7 @@ var GapControl = createControl(({ label }) => {
|
|
|
1707
1854
|
onChange: onLinkToggle
|
|
1708
1855
|
},
|
|
1709
1856
|
/* @__PURE__ */ React32.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1710
|
-
)), /* @__PURE__ */ React32.createElement(Stack10, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(Grid8, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React32.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(ControlLabel, null,
|
|
1857
|
+
))), /* @__PURE__ */ React32.createElement(Stack10, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(Grid8, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React32.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(ControlLabel, null, __10("Column", "elementor"))), /* @__PURE__ */ React32.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(Control4, { bind: "column", isLinked }))), /* @__PURE__ */ React32.createElement(Grid8, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React32.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(ControlLabel, null, __10("Row", "elementor"))), /* @__PURE__ */ React32.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(Control4, { bind: "row", isLinked })))));
|
|
1711
1858
|
});
|
|
1712
1859
|
var Control4 = ({ bind, isLinked }) => {
|
|
1713
1860
|
if (isLinked) {
|
|
@@ -1720,14 +1867,14 @@ var Control4 = ({ bind, isLinked }) => {
|
|
|
1720
1867
|
import * as React33 from "react";
|
|
1721
1868
|
import { imageSrcPropTypeUtil as imageSrcPropTypeUtil2 } from "@elementor/editor-props";
|
|
1722
1869
|
import { UploadIcon as UploadIcon2 } from "@elementor/icons";
|
|
1723
|
-
import { Button as Button3, Card as Card2, CardMedia as CardMedia2, CardOverlay as CardOverlay2, CircularProgress as CircularProgress2, Stack as Stack11, styled as
|
|
1870
|
+
import { Button as Button3, Card as Card2, CardMedia as CardMedia2, CardOverlay as CardOverlay2, CircularProgress as CircularProgress2, Stack as Stack11, styled as styled5 } from "@elementor/ui";
|
|
1724
1871
|
import { useWpMediaAttachment as useWpMediaAttachment2, useWpMediaFrame as useWpMediaFrame2 } from "@elementor/wp-media";
|
|
1725
|
-
import { __ as
|
|
1872
|
+
import { __ as __11 } from "@wordpress/i18n";
|
|
1726
1873
|
var TILE_SIZE = 8;
|
|
1727
1874
|
var TILE_WHITE = "transparent";
|
|
1728
1875
|
var TILE_BLACK = "#c1c1c1";
|
|
1729
1876
|
var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
|
|
1730
|
-
var StyledCard =
|
|
1877
|
+
var StyledCard = styled5(Card2)`
|
|
1731
1878
|
background-color: white;
|
|
1732
1879
|
background-image: ${TILES_GRADIENT_FORMULA}, ${TILES_GRADIENT_FORMULA};
|
|
1733
1880
|
background-size: ${TILE_SIZE}px ${TILE_SIZE}px;
|
|
@@ -1736,7 +1883,7 @@ var StyledCard = styled4(Card2)`
|
|
|
1736
1883
|
${TILE_SIZE / 2}px ${TILE_SIZE / 2}px;
|
|
1737
1884
|
border: none;
|
|
1738
1885
|
`;
|
|
1739
|
-
var StyledCardMediaContainer =
|
|
1886
|
+
var StyledCardMediaContainer = styled5(Stack11)`
|
|
1740
1887
|
position: relative;
|
|
1741
1888
|
height: 140px;
|
|
1742
1889
|
object-fit: contain;
|
|
@@ -1750,9 +1897,9 @@ var SvgMediaControl = createControl(() => {
|
|
|
1750
1897
|
const { id, url } = value ?? {};
|
|
1751
1898
|
const { data: attachment, isFetching } = useWpMediaAttachment2(id?.value || null);
|
|
1752
1899
|
const src = attachment?.url ?? url?.value ?? null;
|
|
1900
|
+
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
1753
1901
|
const { open } = useWpMediaFrame2({
|
|
1754
|
-
|
|
1755
|
-
allowedExtensions: ["svg"],
|
|
1902
|
+
mediaTypes: ["svg"],
|
|
1756
1903
|
multiple: false,
|
|
1757
1904
|
selected: id?.value || null,
|
|
1758
1905
|
onSelect: (selectedAttachment) => {
|
|
@@ -1765,12 +1912,18 @@ var SvgMediaControl = createControl(() => {
|
|
|
1765
1912
|
});
|
|
1766
1913
|
}
|
|
1767
1914
|
});
|
|
1768
|
-
|
|
1915
|
+
const handleClick = (openOptions) => {
|
|
1916
|
+
if (allowSvgUpload) {
|
|
1917
|
+
open(openOptions);
|
|
1918
|
+
} else {
|
|
1919
|
+
}
|
|
1920
|
+
};
|
|
1921
|
+
return /* @__PURE__ */ React33.createElement(Stack11, { gap: 1 }, /* @__PURE__ */ React33.createElement(ControlLabel, null, " ", __11("SVG", "elementor"), " "), /* @__PURE__ */ React33.createElement(ControlActions, null, /* @__PURE__ */ React33.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React33.createElement(StyledCardMediaContainer, null, isFetching ? /* @__PURE__ */ React33.createElement(CircularProgress2, { role: "progressbar" }) : /* @__PURE__ */ React33.createElement(
|
|
1769
1922
|
CardMedia2,
|
|
1770
1923
|
{
|
|
1771
1924
|
component: "img",
|
|
1772
1925
|
image: src,
|
|
1773
|
-
alt:
|
|
1926
|
+
alt: __11("Preview SVG", "elementor"),
|
|
1774
1927
|
sx: { maxHeight: "140px", width: "50px" }
|
|
1775
1928
|
}
|
|
1776
1929
|
)), /* @__PURE__ */ React33.createElement(
|
|
@@ -1788,9 +1941,9 @@ var SvgMediaControl = createControl(() => {
|
|
|
1788
1941
|
size: "tiny",
|
|
1789
1942
|
color: "inherit",
|
|
1790
1943
|
variant: "outlined",
|
|
1791
|
-
onClick: () =>
|
|
1944
|
+
onClick: () => handleClick({ mode: "browse" })
|
|
1792
1945
|
},
|
|
1793
|
-
|
|
1946
|
+
__11("Select SVG", "elementor")
|
|
1794
1947
|
), /* @__PURE__ */ React33.createElement(
|
|
1795
1948
|
Button3,
|
|
1796
1949
|
{
|
|
@@ -1798,21 +1951,21 @@ var SvgMediaControl = createControl(() => {
|
|
|
1798
1951
|
variant: "text",
|
|
1799
1952
|
color: "inherit",
|
|
1800
1953
|
startIcon: /* @__PURE__ */ React33.createElement(UploadIcon2, null),
|
|
1801
|
-
onClick: () =>
|
|
1954
|
+
onClick: () => handleClick({ mode: "upload" })
|
|
1802
1955
|
},
|
|
1803
|
-
|
|
1956
|
+
__11("Upload", "elementor")
|
|
1804
1957
|
))
|
|
1805
1958
|
))));
|
|
1806
1959
|
});
|
|
1807
1960
|
|
|
1808
1961
|
// src/controls/background-control/background-control.tsx
|
|
1809
|
-
import * as
|
|
1962
|
+
import * as React40 from "react";
|
|
1810
1963
|
import { backgroundPropTypeUtil } from "@elementor/editor-props";
|
|
1811
1964
|
import { Grid as Grid14 } from "@elementor/ui";
|
|
1812
|
-
import { __ as
|
|
1965
|
+
import { __ as __17 } from "@wordpress/i18n";
|
|
1813
1966
|
|
|
1814
1967
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
1815
|
-
import * as
|
|
1968
|
+
import * as React39 from "react";
|
|
1816
1969
|
import {
|
|
1817
1970
|
backgroundColorOverlayPropTypeUtil as backgroundColorOverlayPropTypeUtil2,
|
|
1818
1971
|
backgroundImageOverlayPropTypeUtil as backgroundImageOverlayPropTypeUtil2,
|
|
@@ -1820,56 +1973,128 @@ import {
|
|
|
1820
1973
|
} from "@elementor/editor-props";
|
|
1821
1974
|
import { Box as Box4, CardMedia as CardMedia3, Grid as Grid13, Tab, TabPanel, Tabs, UnstableColorIndicator as UnstableColorIndicator2 } from "@elementor/ui";
|
|
1822
1975
|
import { useWpMediaAttachment as useWpMediaAttachment3 } from "@elementor/wp-media";
|
|
1823
|
-
import { __ as
|
|
1976
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
1824
1977
|
|
|
1825
1978
|
// src/env.ts
|
|
1826
1979
|
import { parseEnv } from "@elementor/env";
|
|
1827
1980
|
var { env } = parseEnv("@elementor/editor-controls");
|
|
1828
1981
|
|
|
1829
|
-
// src/controls/background-control/background-
|
|
1982
|
+
// src/controls/background-control/background-gradient-color-control.tsx
|
|
1830
1983
|
import * as React34 from "react";
|
|
1984
|
+
import {
|
|
1985
|
+
backgroundGradientOverlayPropTypeUtil,
|
|
1986
|
+
colorPropTypeUtil as colorPropTypeUtil2,
|
|
1987
|
+
colorStopPropTypeUtil,
|
|
1988
|
+
gradientColorStopPropTypeUtil,
|
|
1989
|
+
numberPropTypeUtil as numberPropTypeUtil3,
|
|
1990
|
+
stringPropTypeUtil as stringPropTypeUtil8
|
|
1991
|
+
} from "@elementor/editor-props";
|
|
1992
|
+
import { UnstableGradientBox } from "@elementor/ui";
|
|
1993
|
+
var BackgroundGradientColorControl = createControl(() => {
|
|
1994
|
+
const { value, setValue } = useBoundProp(backgroundGradientOverlayPropTypeUtil);
|
|
1995
|
+
const handleChange = (newValue) => {
|
|
1996
|
+
const transformedValue = createTransformableValue(newValue);
|
|
1997
|
+
if (transformedValue.positions) {
|
|
1998
|
+
transformedValue.positions = stringPropTypeUtil8.create(newValue.positions.join(" "));
|
|
1999
|
+
}
|
|
2000
|
+
setValue(transformedValue);
|
|
2001
|
+
};
|
|
2002
|
+
const createTransformableValue = (newValue) => ({
|
|
2003
|
+
...newValue,
|
|
2004
|
+
type: stringPropTypeUtil8.create(newValue.type),
|
|
2005
|
+
angle: numberPropTypeUtil3.create(newValue.angle),
|
|
2006
|
+
stops: gradientColorStopPropTypeUtil.create(
|
|
2007
|
+
newValue.stops.map(
|
|
2008
|
+
({ color, offset }) => colorStopPropTypeUtil.create({
|
|
2009
|
+
color: colorPropTypeUtil2.create(color),
|
|
2010
|
+
offset: numberPropTypeUtil3.create(offset)
|
|
2011
|
+
})
|
|
2012
|
+
)
|
|
2013
|
+
)
|
|
2014
|
+
});
|
|
2015
|
+
const normalizeValue = () => {
|
|
2016
|
+
if (!value) {
|
|
2017
|
+
return;
|
|
2018
|
+
}
|
|
2019
|
+
const { type, angle, stops, positions } = value;
|
|
2020
|
+
return {
|
|
2021
|
+
type: type.value,
|
|
2022
|
+
angle: angle.value,
|
|
2023
|
+
stops: stops.value.map(({ value: { color, offset } }) => ({
|
|
2024
|
+
color: color.value,
|
|
2025
|
+
offset: offset.value
|
|
2026
|
+
})),
|
|
2027
|
+
positions: positions?.value.split(" ")
|
|
2028
|
+
};
|
|
2029
|
+
};
|
|
2030
|
+
return /* @__PURE__ */ React34.createElement(ControlActions, null, /* @__PURE__ */ React34.createElement(
|
|
2031
|
+
UnstableGradientBox,
|
|
2032
|
+
{
|
|
2033
|
+
sx: { width: "auto", padding: 1.5 },
|
|
2034
|
+
value: normalizeValue(),
|
|
2035
|
+
onChange: handleChange
|
|
2036
|
+
}
|
|
2037
|
+
));
|
|
2038
|
+
});
|
|
2039
|
+
var initialBackgroundGradientOverlay = backgroundGradientOverlayPropTypeUtil.create({
|
|
2040
|
+
type: stringPropTypeUtil8.create("linear"),
|
|
2041
|
+
angle: numberPropTypeUtil3.create(180),
|
|
2042
|
+
stops: gradientColorStopPropTypeUtil.create([
|
|
2043
|
+
colorStopPropTypeUtil.create({
|
|
2044
|
+
color: stringPropTypeUtil8.create("var(--primary-color)"),
|
|
2045
|
+
offset: numberPropTypeUtil3.create(0)
|
|
2046
|
+
}),
|
|
2047
|
+
colorStopPropTypeUtil.create({
|
|
2048
|
+
color: colorPropTypeUtil2.create("rgb(255,255,255)"),
|
|
2049
|
+
offset: numberPropTypeUtil3.create(100)
|
|
2050
|
+
})
|
|
2051
|
+
])
|
|
2052
|
+
});
|
|
2053
|
+
|
|
2054
|
+
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
2055
|
+
import * as React35 from "react";
|
|
1831
2056
|
import { PinIcon, PinnedOffIcon } from "@elementor/icons";
|
|
1832
2057
|
import { Grid as Grid9 } from "@elementor/ui";
|
|
1833
|
-
import { __ as
|
|
2058
|
+
import { __ as __12 } from "@wordpress/i18n";
|
|
1834
2059
|
var attachmentControlOptions = [
|
|
1835
2060
|
{
|
|
1836
2061
|
value: "fixed",
|
|
1837
|
-
label:
|
|
1838
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2062
|
+
label: __12("Fixed", "elementor"),
|
|
2063
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(PinIcon, { fontSize: size }),
|
|
1839
2064
|
showTooltip: true
|
|
1840
2065
|
},
|
|
1841
2066
|
{
|
|
1842
2067
|
value: "scroll",
|
|
1843
|
-
label:
|
|
1844
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2068
|
+
label: __12("Scroll", "elementor"),
|
|
2069
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(PinnedOffIcon, { fontSize: size }),
|
|
1845
2070
|
showTooltip: true
|
|
1846
2071
|
}
|
|
1847
2072
|
];
|
|
1848
2073
|
var BackgroundImageOverlayAttachment = () => {
|
|
1849
|
-
return /* @__PURE__ */
|
|
2074
|
+
return /* @__PURE__ */ React35.createElement(PopoverGridContainer, null, /* @__PURE__ */ React35.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ControlLabel, null, __12("Attachment", "elementor"))), /* @__PURE__ */ React35.createElement(Grid9, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React35.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
1850
2075
|
};
|
|
1851
2076
|
|
|
1852
2077
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
1853
|
-
import * as
|
|
1854
|
-
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as
|
|
2078
|
+
import * as React36 from "react";
|
|
2079
|
+
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil9 } from "@elementor/editor-props";
|
|
1855
2080
|
import { LetterXIcon, LetterYIcon } from "@elementor/icons";
|
|
1856
|
-
import { Grid as Grid10, MenuItem as
|
|
1857
|
-
import { __ as
|
|
2081
|
+
import { Grid as Grid10, MenuItem as MenuItem3, Select as Select2 } from "@elementor/ui";
|
|
2082
|
+
import { __ as __13 } from "@wordpress/i18n";
|
|
1858
2083
|
var backgroundPositionOptions = [
|
|
1859
|
-
{ label:
|
|
1860
|
-
{ label:
|
|
1861
|
-
{ label:
|
|
1862
|
-
{ label:
|
|
1863
|
-
{ label:
|
|
1864
|
-
{ label:
|
|
1865
|
-
{ label:
|
|
1866
|
-
{ label:
|
|
1867
|
-
{ label:
|
|
1868
|
-
{ label:
|
|
2084
|
+
{ label: __13("Center center", "elementor"), value: "center center" },
|
|
2085
|
+
{ label: __13("Center left", "elementor"), value: "center left" },
|
|
2086
|
+
{ label: __13("Center right", "elementor"), value: "center right" },
|
|
2087
|
+
{ label: __13("Top center", "elementor"), value: "top center" },
|
|
2088
|
+
{ label: __13("Top left", "elementor"), value: "top left" },
|
|
2089
|
+
{ label: __13("Top right", "elementor"), value: "top right" },
|
|
2090
|
+
{ label: __13("Bottom center", "elementor"), value: "bottom center" },
|
|
2091
|
+
{ label: __13("Bottom left", "elementor"), value: "bottom left" },
|
|
2092
|
+
{ label: __13("Bottom right", "elementor"), value: "bottom right" },
|
|
2093
|
+
{ label: __13("Custom", "elementor"), value: "custom" }
|
|
1869
2094
|
];
|
|
1870
2095
|
var BackgroundImageOverlayPosition = () => {
|
|
1871
2096
|
const backgroundImageOffsetContext = useBoundProp(backgroundImagePositionOffsetPropTypeUtil);
|
|
1872
|
-
const stringPropContext = useBoundProp(
|
|
2097
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil9);
|
|
1873
2098
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
1874
2099
|
const handlePositionChange = (event) => {
|
|
1875
2100
|
const value = event.target.value || null;
|
|
@@ -1879,7 +2104,7 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
1879
2104
|
stringPropContext.setValue(value);
|
|
1880
2105
|
}
|
|
1881
2106
|
};
|
|
1882
|
-
return /* @__PURE__ */
|
|
2107
|
+
return /* @__PURE__ */ React36.createElement(Grid10, { container: true, spacing: 1.5 }, /* @__PURE__ */ React36.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(PopoverGridContainer, null, /* @__PURE__ */ React36.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(ControlLabel, null, __13("Position", "elementor"))), /* @__PURE__ */ React36.createElement(Grid10, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React36.createElement(
|
|
1883
2108
|
Select2,
|
|
1884
2109
|
{
|
|
1885
2110
|
size: "tiny",
|
|
@@ -1887,48 +2112,48 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
1887
2112
|
onChange: handlePositionChange,
|
|
1888
2113
|
fullWidth: true
|
|
1889
2114
|
},
|
|
1890
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
1891
|
-
)))), isCustom ? /* @__PURE__ */
|
|
2115
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React36.createElement(MenuItem3, { key: value, value: value ?? "" }, label))
|
|
2116
|
+
)))), isCustom ? /* @__PURE__ */ React36.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React36.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(Grid10, { container: true, spacing: 1.5 }, /* @__PURE__ */ React36.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React36.createElement(SizeControl, { startIcon: /* @__PURE__ */ React36.createElement(LetterXIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React36.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React36.createElement(SizeControl, { startIcon: /* @__PURE__ */ React36.createElement(LetterYIcon, { fontSize: "tiny" }) })))))) : null);
|
|
1892
2117
|
};
|
|
1893
2118
|
|
|
1894
2119
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
1895
|
-
import * as
|
|
2120
|
+
import * as React37 from "react";
|
|
1896
2121
|
import { DotsHorizontalIcon, DotsVerticalIcon, GridDotsIcon, XIcon as XIcon4 } from "@elementor/icons";
|
|
1897
2122
|
import { Grid as Grid11 } from "@elementor/ui";
|
|
1898
|
-
import { __ as
|
|
2123
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
1899
2124
|
var repeatControlOptions = [
|
|
1900
2125
|
{
|
|
1901
2126
|
value: "repeat",
|
|
1902
|
-
label:
|
|
1903
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2127
|
+
label: __14("Repeat", "elementor"),
|
|
2128
|
+
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(GridDotsIcon, { fontSize: size }),
|
|
1904
2129
|
showTooltip: true
|
|
1905
2130
|
},
|
|
1906
2131
|
{
|
|
1907
2132
|
value: "repeat-x",
|
|
1908
|
-
label:
|
|
1909
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2133
|
+
label: __14("Repeat-x", "elementor"),
|
|
2134
|
+
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(DotsHorizontalIcon, { fontSize: size }),
|
|
1910
2135
|
showTooltip: true
|
|
1911
2136
|
},
|
|
1912
2137
|
{
|
|
1913
2138
|
value: "repeat-y",
|
|
1914
|
-
label:
|
|
1915
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2139
|
+
label: __14("Repeat-y", "elementor"),
|
|
2140
|
+
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(DotsVerticalIcon, { fontSize: size }),
|
|
1916
2141
|
showTooltip: true
|
|
1917
2142
|
},
|
|
1918
2143
|
{
|
|
1919
2144
|
value: "no-repeat",
|
|
1920
|
-
label:
|
|
1921
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2145
|
+
label: __14("No-repeat", "elementor"),
|
|
2146
|
+
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(XIcon4, { fontSize: size }),
|
|
1922
2147
|
showTooltip: true
|
|
1923
2148
|
}
|
|
1924
2149
|
];
|
|
1925
2150
|
var BackgroundImageOverlayRepeat = () => {
|
|
1926
|
-
return /* @__PURE__ */
|
|
2151
|
+
return /* @__PURE__ */ React37.createElement(PopoverGridContainer, null, /* @__PURE__ */ React37.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(ControlLabel, null, __14("Repeat", "elementor"))), /* @__PURE__ */ React37.createElement(Grid11, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React37.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
1927
2152
|
};
|
|
1928
2153
|
|
|
1929
2154
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
1930
|
-
import * as
|
|
1931
|
-
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as
|
|
2155
|
+
import * as React38 from "react";
|
|
2156
|
+
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil10 } from "@elementor/editor-props";
|
|
1932
2157
|
import {
|
|
1933
2158
|
ArrowBarBothIcon,
|
|
1934
2159
|
ArrowsMaximizeIcon,
|
|
@@ -1938,36 +2163,36 @@ import {
|
|
|
1938
2163
|
PencilIcon
|
|
1939
2164
|
} from "@elementor/icons";
|
|
1940
2165
|
import { Grid as Grid12 } from "@elementor/ui";
|
|
1941
|
-
import { __ as
|
|
2166
|
+
import { __ as __15 } from "@wordpress/i18n";
|
|
1942
2167
|
var sizeControlOptions = [
|
|
1943
2168
|
{
|
|
1944
2169
|
value: "auto",
|
|
1945
|
-
label:
|
|
1946
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2170
|
+
label: __15("Auto", "elementor"),
|
|
2171
|
+
renderContent: ({ size }) => /* @__PURE__ */ React38.createElement(LetterAIcon, { fontSize: size }),
|
|
1947
2172
|
showTooltip: true
|
|
1948
2173
|
},
|
|
1949
2174
|
{
|
|
1950
2175
|
value: "cover",
|
|
1951
|
-
label:
|
|
1952
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2176
|
+
label: __15("Cover", "elementor"),
|
|
2177
|
+
renderContent: ({ size }) => /* @__PURE__ */ React38.createElement(ArrowsMaximizeIcon, { fontSize: size }),
|
|
1953
2178
|
showTooltip: true
|
|
1954
2179
|
},
|
|
1955
2180
|
{
|
|
1956
2181
|
value: "contain",
|
|
1957
|
-
label:
|
|
1958
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2182
|
+
label: __15("Contain", "elementor"),
|
|
2183
|
+
renderContent: ({ size }) => /* @__PURE__ */ React38.createElement(ArrowBarBothIcon, { fontSize: size }),
|
|
1959
2184
|
showTooltip: true
|
|
1960
2185
|
},
|
|
1961
2186
|
{
|
|
1962
2187
|
value: "custom",
|
|
1963
|
-
label:
|
|
1964
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2188
|
+
label: __15("Custom", "elementor"),
|
|
2189
|
+
renderContent: ({ size }) => /* @__PURE__ */ React38.createElement(PencilIcon, { fontSize: size }),
|
|
1965
2190
|
showTooltip: true
|
|
1966
2191
|
}
|
|
1967
2192
|
];
|
|
1968
2193
|
var BackgroundImageOverlaySize = () => {
|
|
1969
2194
|
const backgroundImageScaleContext = useBoundProp(backgroundImageSizeScalePropTypeUtil);
|
|
1970
|
-
const stringPropContext = useBoundProp(
|
|
2195
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil10);
|
|
1971
2196
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
1972
2197
|
const handleSizeChange = (size) => {
|
|
1973
2198
|
if (size === "custom") {
|
|
@@ -1976,7 +2201,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
1976
2201
|
stringPropContext.setValue(size);
|
|
1977
2202
|
}
|
|
1978
2203
|
};
|
|
1979
|
-
return /* @__PURE__ */
|
|
2204
|
+
return /* @__PURE__ */ React38.createElement(Grid12, { container: true, spacing: 1.5 }, /* @__PURE__ */ React38.createElement(Grid12, { item: true, xs: 12 }, /* @__PURE__ */ React38.createElement(PopoverGridContainer, null, /* @__PURE__ */ React38.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(ControlLabel, null, __15("Size", "elementor"))), /* @__PURE__ */ React38.createElement(Grid12, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React38.createElement(
|
|
1980
2205
|
ControlToggleButtonGroup,
|
|
1981
2206
|
{
|
|
1982
2207
|
exclusive: true,
|
|
@@ -1984,38 +2209,51 @@ var BackgroundImageOverlaySize = () => {
|
|
|
1984
2209
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value,
|
|
1985
2210
|
onChange: handleSizeChange
|
|
1986
2211
|
}
|
|
1987
|
-
)))), isCustom ? /* @__PURE__ */
|
|
2212
|
+
)))), isCustom ? /* @__PURE__ */ React38.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React38.createElement(Grid12, { item: true, xs: 12 }, /* @__PURE__ */ React38.createElement(PopoverGridContainer, null, /* @__PURE__ */ React38.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React38.createElement(
|
|
1988
2213
|
SizeControl,
|
|
1989
2214
|
{
|
|
1990
|
-
startIcon: /* @__PURE__ */
|
|
2215
|
+
startIcon: /* @__PURE__ */ React38.createElement(ArrowsMoveHorizontalIcon, { fontSize: "tiny" }),
|
|
1991
2216
|
extendedValues: ["auto"]
|
|
1992
2217
|
}
|
|
1993
|
-
))), /* @__PURE__ */
|
|
2218
|
+
))), /* @__PURE__ */ React38.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React38.createElement(
|
|
1994
2219
|
SizeControl,
|
|
1995
2220
|
{
|
|
1996
|
-
startIcon: /* @__PURE__ */
|
|
2221
|
+
startIcon: /* @__PURE__ */ React38.createElement(ArrowsMoveVerticalIcon, { fontSize: "tiny" }),
|
|
1997
2222
|
extendedValues: ["auto"]
|
|
1998
2223
|
}
|
|
1999
2224
|
)))))) : null);
|
|
2000
2225
|
};
|
|
2001
2226
|
|
|
2002
2227
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
2003
|
-
import { useRef as
|
|
2228
|
+
import { useRef as useRef4 } from "react";
|
|
2004
2229
|
import {
|
|
2005
2230
|
backgroundColorOverlayPropTypeUtil,
|
|
2231
|
+
backgroundGradientOverlayPropTypeUtil as backgroundGradientOverlayPropTypeUtil2,
|
|
2006
2232
|
backgroundImageOverlayPropTypeUtil
|
|
2007
2233
|
} from "@elementor/editor-props";
|
|
2008
2234
|
import { useTabs } from "@elementor/ui";
|
|
2009
2235
|
var useBackgroundTabsHistory = ({
|
|
2010
2236
|
color: initialBackgroundColorOverlay2,
|
|
2011
|
-
image: initialBackgroundImageOverlay
|
|
2237
|
+
image: initialBackgroundImageOverlay,
|
|
2238
|
+
gradient: initialBackgroundGradientOverlay2
|
|
2012
2239
|
}) => {
|
|
2013
2240
|
const { value: imageValue, setValue: setImageValue } = useBoundProp(backgroundImageOverlayPropTypeUtil);
|
|
2014
2241
|
const { value: colorValue, setValue: setColorValue } = useBoundProp(backgroundColorOverlayPropTypeUtil);
|
|
2015
|
-
const {
|
|
2016
|
-
const
|
|
2242
|
+
const { value: gradientValue, setValue: setGradientValue } = useBoundProp(backgroundGradientOverlayPropTypeUtil2);
|
|
2243
|
+
const getCurrentOverlayType = () => {
|
|
2244
|
+
if (colorValue) {
|
|
2245
|
+
return "color";
|
|
2246
|
+
}
|
|
2247
|
+
if (gradientValue) {
|
|
2248
|
+
return "gradient";
|
|
2249
|
+
}
|
|
2250
|
+
return "image";
|
|
2251
|
+
};
|
|
2252
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = useTabs(getCurrentOverlayType());
|
|
2253
|
+
const valuesHistory = useRef4({
|
|
2017
2254
|
image: initialBackgroundImageOverlay,
|
|
2018
|
-
color: initialBackgroundColorOverlay2
|
|
2255
|
+
color: initialBackgroundColorOverlay2,
|
|
2256
|
+
gradient: initialBackgroundGradientOverlay2
|
|
2019
2257
|
});
|
|
2020
2258
|
const saveToHistory = (key, value) => {
|
|
2021
2259
|
if (value) {
|
|
@@ -2027,10 +2265,17 @@ var useBackgroundTabsHistory = ({
|
|
|
2027
2265
|
case "image":
|
|
2028
2266
|
setImageValue(valuesHistory.current.image);
|
|
2029
2267
|
saveToHistory("color", colorValue);
|
|
2268
|
+
saveToHistory("gradient", gradientValue);
|
|
2269
|
+
break;
|
|
2270
|
+
case "gradient":
|
|
2271
|
+
setGradientValue(valuesHistory.current.gradient);
|
|
2272
|
+
saveToHistory("color", colorValue);
|
|
2273
|
+
saveToHistory("image", imageValue);
|
|
2030
2274
|
break;
|
|
2031
2275
|
case "color":
|
|
2032
2276
|
setColorValue(valuesHistory.current.color);
|
|
2033
2277
|
saveToHistory("image", imageValue);
|
|
2278
|
+
saveToHistory("gradient", gradientValue);
|
|
2034
2279
|
}
|
|
2035
2280
|
return getTabsProps().onChange(e, tabName);
|
|
2036
2281
|
};
|
|
@@ -2071,19 +2316,19 @@ var getInitialBackgroundOverlay = () => ({
|
|
|
2071
2316
|
}
|
|
2072
2317
|
});
|
|
2073
2318
|
var backgroundResolutionOptions = [
|
|
2074
|
-
{ label:
|
|
2075
|
-
{ label:
|
|
2076
|
-
{ label:
|
|
2077
|
-
{ label:
|
|
2319
|
+
{ label: __16("Thumbnail - 150 x 150", "elementor"), value: "thumbnail" },
|
|
2320
|
+
{ label: __16("Medium - 300 x 300", "elementor"), value: "medium" },
|
|
2321
|
+
{ label: __16("Large 1024 x 1024", "elementor"), value: "large" },
|
|
2322
|
+
{ label: __16("Full", "elementor"), value: "full" }
|
|
2078
2323
|
];
|
|
2079
2324
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
2080
2325
|
const { propType, value: overlayValues, setValue } = useBoundProp(backgroundOverlayPropTypeUtil);
|
|
2081
|
-
return /* @__PURE__ */
|
|
2326
|
+
return /* @__PURE__ */ React39.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React39.createElement(
|
|
2082
2327
|
Repeater,
|
|
2083
2328
|
{
|
|
2084
2329
|
values: overlayValues ?? [],
|
|
2085
2330
|
setValues: setValue,
|
|
2086
|
-
label:
|
|
2331
|
+
label: __16("Overlay", "elementor"),
|
|
2087
2332
|
itemSettings: {
|
|
2088
2333
|
Icon: ItemIcon2,
|
|
2089
2334
|
Label: ItemLabel2,
|
|
@@ -2094,58 +2339,73 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
2094
2339
|
));
|
|
2095
2340
|
});
|
|
2096
2341
|
var ItemContent2 = ({ bind }) => {
|
|
2097
|
-
return /* @__PURE__ */
|
|
2342
|
+
return /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React39.createElement(Content2, null));
|
|
2098
2343
|
};
|
|
2099
2344
|
var Content2 = () => {
|
|
2100
2345
|
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
2101
2346
|
image: getInitialBackgroundOverlay().value,
|
|
2102
|
-
color: initialBackgroundColorOverlay.value
|
|
2347
|
+
color: initialBackgroundColorOverlay.value,
|
|
2348
|
+
gradient: initialBackgroundGradientOverlay.value
|
|
2103
2349
|
});
|
|
2104
|
-
return /* @__PURE__ */
|
|
2350
|
+
return /* @__PURE__ */ React39.createElement(Box4, { sx: { width: "100%" } }, /* @__PURE__ */ React39.createElement(Box4, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React39.createElement(Tabs, { ...getTabsProps(), "aria-label": __16("Background Overlay", "elementor") }, /* @__PURE__ */ React39.createElement(Tab, { label: __16("Image", "elementor"), ...getTabProps("image") }), /* @__PURE__ */ React39.createElement(Tab, { label: __16("Gradient", "elementor"), ...getTabProps("gradient") }), /* @__PURE__ */ React39.createElement(Tab, { label: __16("Color", "elementor"), ...getTabProps("color") }))), /* @__PURE__ */ React39.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React39.createElement(PopoverContent, null, /* @__PURE__ */ React39.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React39.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("gradient") }, /* @__PURE__ */ React39.createElement(BackgroundGradientColorControl, null)), /* @__PURE__ */ React39.createElement(TabPanel, { ...getTabPanelProps("color"), sx: { p: 1.5 } }, /* @__PURE__ */ React39.createElement(ColorControl, { propTypeUtil: backgroundColorOverlayPropTypeUtil2 })));
|
|
2105
2351
|
};
|
|
2106
2352
|
var ItemIcon2 = ({ value }) => {
|
|
2107
2353
|
switch (value.$$type) {
|
|
2108
2354
|
case "background-image-overlay":
|
|
2109
|
-
return /* @__PURE__ */
|
|
2355
|
+
return /* @__PURE__ */ React39.createElement(ItemIconImage, { value });
|
|
2110
2356
|
case "background-color-overlay":
|
|
2111
|
-
return /* @__PURE__ */
|
|
2357
|
+
return /* @__PURE__ */ React39.createElement(ItemIconColor, { value });
|
|
2358
|
+
case "background-gradient-overlay":
|
|
2359
|
+
return /* @__PURE__ */ React39.createElement(ItemIconGradient, { value });
|
|
2112
2360
|
default:
|
|
2113
2361
|
return null;
|
|
2114
2362
|
}
|
|
2115
2363
|
};
|
|
2116
2364
|
var ItemIconColor = ({ value }) => {
|
|
2117
|
-
return /* @__PURE__ */
|
|
2365
|
+
return /* @__PURE__ */ React39.createElement(UnstableColorIndicator2, { size: "inherit", component: "span", value: value.value });
|
|
2118
2366
|
};
|
|
2119
2367
|
var ItemIconImage = ({ value }) => {
|
|
2120
2368
|
const { imageUrl } = useImage(value);
|
|
2121
|
-
return /* @__PURE__ */
|
|
2369
|
+
return /* @__PURE__ */ React39.createElement(CardMedia3, { image: imageUrl, sx: { height: 13, width: 13, borderRadius: "4px" } });
|
|
2370
|
+
};
|
|
2371
|
+
var ItemIconGradient = ({ value }) => {
|
|
2372
|
+
const gradient = getGradientValue(value);
|
|
2373
|
+
return /* @__PURE__ */ React39.createElement(UnstableColorIndicator2, { size: "inherit", component: "span", value: gradient });
|
|
2122
2374
|
};
|
|
2123
2375
|
var ItemLabel2 = ({ value }) => {
|
|
2124
2376
|
switch (value.$$type) {
|
|
2125
2377
|
case "background-image-overlay":
|
|
2126
|
-
return /* @__PURE__ */
|
|
2378
|
+
return /* @__PURE__ */ React39.createElement(ItemLabelImage, { value });
|
|
2127
2379
|
case "background-color-overlay":
|
|
2128
|
-
return /* @__PURE__ */
|
|
2380
|
+
return /* @__PURE__ */ React39.createElement(ItemLabelColor, { value });
|
|
2381
|
+
case "background-gradient-overlay":
|
|
2382
|
+
return /* @__PURE__ */ React39.createElement(ItemLabelGradient, { value });
|
|
2129
2383
|
default:
|
|
2130
2384
|
return null;
|
|
2131
2385
|
}
|
|
2132
2386
|
};
|
|
2133
2387
|
var ItemLabelColor = ({ value }) => {
|
|
2134
|
-
return /* @__PURE__ */
|
|
2388
|
+
return /* @__PURE__ */ React39.createElement("span", null, value.value);
|
|
2135
2389
|
};
|
|
2136
2390
|
var ItemLabelImage = ({ value }) => {
|
|
2137
2391
|
const { imageTitle } = useImage(value);
|
|
2138
|
-
return /* @__PURE__ */
|
|
2392
|
+
return /* @__PURE__ */ React39.createElement("span", null, imageTitle);
|
|
2393
|
+
};
|
|
2394
|
+
var ItemLabelGradient = ({ value }) => {
|
|
2395
|
+
if (value.value.type.value === "linear") {
|
|
2396
|
+
return /* @__PURE__ */ React39.createElement("span", null, __16("Linear Gradient", "elementor"));
|
|
2397
|
+
}
|
|
2398
|
+
return /* @__PURE__ */ React39.createElement("span", null, __16("Radial Gradient", "elementor"));
|
|
2139
2399
|
};
|
|
2140
2400
|
var ImageOverlayContent = () => {
|
|
2141
2401
|
const propContext = useBoundProp(backgroundImageOverlayPropTypeUtil2);
|
|
2142
|
-
return /* @__PURE__ */
|
|
2402
|
+
return /* @__PURE__ */ React39.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React39.createElement(Grid13, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React39.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(
|
|
2143
2403
|
ImageControl,
|
|
2144
2404
|
{
|
|
2145
|
-
resolutionLabel:
|
|
2405
|
+
resolutionLabel: __16("Resolution", "elementor"),
|
|
2146
2406
|
sizes: backgroundResolutionOptions
|
|
2147
2407
|
}
|
|
2148
|
-
)))), /* @__PURE__ */
|
|
2408
|
+
)))), /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React39.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React39.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React39.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React39.createElement(BackgroundImageOverlayAttachment, null)));
|
|
2149
2409
|
};
|
|
2150
2410
|
var useImage = (image) => {
|
|
2151
2411
|
let imageTitle, imageUrl = null;
|
|
@@ -2161,11 +2421,19 @@ var useImage = (image) => {
|
|
|
2161
2421
|
}
|
|
2162
2422
|
return { imageTitle, imageUrl };
|
|
2163
2423
|
};
|
|
2424
|
+
var getGradientValue = (value) => {
|
|
2425
|
+
const gradient = value.value;
|
|
2426
|
+
const stops = gradient.stops.value?.map(({ value: { color, offset } }) => `${color.value} ${offset.value ?? 0}%`)?.join(",");
|
|
2427
|
+
if (gradient.type.value === "linear") {
|
|
2428
|
+
return `linear-gradient(${gradient.angle.value}deg, ${stops})`;
|
|
2429
|
+
}
|
|
2430
|
+
return `radial-gradient(circle at ${gradient.positions.value}, ${stops})`;
|
|
2431
|
+
};
|
|
2164
2432
|
|
|
2165
2433
|
// src/controls/background-control/background-control.tsx
|
|
2166
2434
|
var BackgroundControl = createControl(() => {
|
|
2167
2435
|
const propContext = useBoundProp(backgroundPropTypeUtil);
|
|
2168
|
-
return /* @__PURE__ */
|
|
2436
|
+
return /* @__PURE__ */ React40.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React40.createElement(SectionContent, null, /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React40.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React40.createElement(Grid14, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(ControlLabel, null, __17("Color", "elementor"))), /* @__PURE__ */ React40.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(ColorControl, null))))));
|
|
2169
2437
|
});
|
|
2170
2438
|
export {
|
|
2171
2439
|
BackgroundControl,
|