@elementor/editor-controls 0.14.0 → 0.15.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 +18 -0
- package/dist/index.d.mts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +297 -165
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +311 -178
- 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/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 +286 -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,9 +1273,9 @@ 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
1280
|
import { ChevronDownIcon, EditIcon, PhotoIcon, SearchIcon, XIcon as XIcon2 } from "@elementor/icons";
|
|
1263
1281
|
import {
|
|
@@ -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,27 @@ 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(EditIcon, { fontSize: SIZE2, sx: { mr: 0.5 } }), /* @__PURE__ */ React28.createElement(Typography4, { variant: "subtitle2" },
|
|
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(EditIcon, { 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,
|
|
1363
1373
|
{
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
MenuItem3,
|
|
1371
|
-
{
|
|
1372
|
-
key: item,
|
|
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 }
|
|
1381
|
-
},
|
|
1382
|
-
item
|
|
1383
|
-
);
|
|
1384
|
-
})))) : /* @__PURE__ */ React28.createElement(Stack8, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React28.createElement(PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React28.createElement(Typography4, { align: "center", variant: "caption", color: "text.secondary" }, __9("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React28.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React28.createElement(Typography4, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React28.createElement(
|
|
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 }, /* @__PURE__ */ React28.createElement(PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React28.createElement(Typography4, { align: "center", variant: "caption", color: "text.secondary" }, __8("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React28.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React28.createElement(Typography4, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React28.createElement(
|
|
1385
1380
|
Link,
|
|
1386
1381
|
{
|
|
1387
1382
|
color: "secondary",
|
|
@@ -1389,10 +1384,139 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1389
1384
|
component: "button",
|
|
1390
1385
|
onClick: () => setSearchValue("")
|
|
1391
1386
|
},
|
|
1392
|
-
|
|
1393
|
-
), "\xA0",
|
|
1387
|
+
__8("Clear the filters", "elementor")
|
|
1388
|
+
), "\xA0", __8("and try again.", "elementor")))))
|
|
1394
1389
|
));
|
|
1395
1390
|
});
|
|
1391
|
+
var LIST_ITEM_HEIGHT = 36;
|
|
1392
|
+
var LIST_ITEMS_BUFFER = 6;
|
|
1393
|
+
var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
1394
|
+
const containerRef = useRef3(null);
|
|
1395
|
+
const selectedItem = fontListItems.find((item) => item.value === fontFamily);
|
|
1396
|
+
const debouncedVirtualizeChange = useDebounce(({ getVirtualIndexes }) => {
|
|
1397
|
+
getVirtualIndexes().forEach((index) => {
|
|
1398
|
+
const item = fontListItems[index];
|
|
1399
|
+
if (item && item.type === "font") {
|
|
1400
|
+
enqueueFont(item.value);
|
|
1401
|
+
}
|
|
1402
|
+
});
|
|
1403
|
+
}, 100);
|
|
1404
|
+
const virtualizer = useVirtualizer({
|
|
1405
|
+
count: fontListItems.length,
|
|
1406
|
+
getScrollElement: () => containerRef.current,
|
|
1407
|
+
estimateSize: () => LIST_ITEM_HEIGHT,
|
|
1408
|
+
overscan: LIST_ITEMS_BUFFER,
|
|
1409
|
+
onChange: debouncedVirtualizeChange
|
|
1410
|
+
});
|
|
1411
|
+
useEffect2(
|
|
1412
|
+
() => {
|
|
1413
|
+
virtualizer.scrollToIndex(fontListItems.findIndex((item) => item.value === fontFamily));
|
|
1414
|
+
},
|
|
1415
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1416
|
+
[fontFamily]
|
|
1417
|
+
);
|
|
1418
|
+
return /* @__PURE__ */ React28.createElement(
|
|
1419
|
+
Box2,
|
|
1420
|
+
{
|
|
1421
|
+
ref: containerRef,
|
|
1422
|
+
sx: {
|
|
1423
|
+
overflowY: "auto",
|
|
1424
|
+
height: 260,
|
|
1425
|
+
width: 220
|
|
1426
|
+
}
|
|
1427
|
+
},
|
|
1428
|
+
/* @__PURE__ */ React28.createElement(
|
|
1429
|
+
StyledMenuList,
|
|
1430
|
+
{
|
|
1431
|
+
role: "listbox",
|
|
1432
|
+
style: {
|
|
1433
|
+
height: `${virtualizer.getTotalSize()}px`
|
|
1434
|
+
},
|
|
1435
|
+
"data-testid": "font-list"
|
|
1436
|
+
},
|
|
1437
|
+
virtualizer.getVirtualItems().map((virtualRow) => {
|
|
1438
|
+
const item = fontListItems[virtualRow.index];
|
|
1439
|
+
const isLast = virtualRow.index === fontListItems.length - 1;
|
|
1440
|
+
const isFirst = virtualRow.index === 1;
|
|
1441
|
+
const isSelected = selectedItem?.value === item.value;
|
|
1442
|
+
const tabIndexFallback = !selectedItem ? 0 : -1;
|
|
1443
|
+
if (item.type === "category") {
|
|
1444
|
+
return /* @__PURE__ */ React28.createElement(
|
|
1445
|
+
ListSubheader,
|
|
1446
|
+
{
|
|
1447
|
+
key: virtualRow.key,
|
|
1448
|
+
style: {
|
|
1449
|
+
transform: `translateY(${virtualRow.start}px)`
|
|
1450
|
+
}
|
|
1451
|
+
},
|
|
1452
|
+
item.value
|
|
1453
|
+
);
|
|
1454
|
+
}
|
|
1455
|
+
return /* @__PURE__ */ React28.createElement(
|
|
1456
|
+
"li",
|
|
1457
|
+
{
|
|
1458
|
+
key: virtualRow.key,
|
|
1459
|
+
role: "option",
|
|
1460
|
+
"aria-selected": isSelected,
|
|
1461
|
+
onClick: () => {
|
|
1462
|
+
setFontFamily(item.value);
|
|
1463
|
+
handleClose();
|
|
1464
|
+
},
|
|
1465
|
+
onKeyDown: (event) => {
|
|
1466
|
+
if (event.key === "Enter") {
|
|
1467
|
+
setFontFamily(item.value);
|
|
1468
|
+
handleClose();
|
|
1469
|
+
}
|
|
1470
|
+
if (event.key === "ArrowDown" && isLast) {
|
|
1471
|
+
event.preventDefault();
|
|
1472
|
+
event.stopPropagation();
|
|
1473
|
+
}
|
|
1474
|
+
if (event.key === "ArrowUp" && isFirst) {
|
|
1475
|
+
event.preventDefault();
|
|
1476
|
+
event.stopPropagation();
|
|
1477
|
+
}
|
|
1478
|
+
},
|
|
1479
|
+
tabIndex: isSelected ? 0 : tabIndexFallback,
|
|
1480
|
+
style: {
|
|
1481
|
+
transform: `translateY(${virtualRow.start}px)`,
|
|
1482
|
+
fontFamily: item.value
|
|
1483
|
+
}
|
|
1484
|
+
},
|
|
1485
|
+
item.value
|
|
1486
|
+
);
|
|
1487
|
+
})
|
|
1488
|
+
)
|
|
1489
|
+
);
|
|
1490
|
+
};
|
|
1491
|
+
var StyledMenuList = styled4(MenuList)(({ theme }) => ({
|
|
1492
|
+
"& > li": {
|
|
1493
|
+
height: LIST_ITEM_HEIGHT,
|
|
1494
|
+
position: "absolute",
|
|
1495
|
+
top: 0,
|
|
1496
|
+
left: 0,
|
|
1497
|
+
width: "100%"
|
|
1498
|
+
},
|
|
1499
|
+
'& > [role="option"]': {
|
|
1500
|
+
...theme.typography.caption,
|
|
1501
|
+
lineHeight: "inherit",
|
|
1502
|
+
padding: theme.spacing(0.75, 2),
|
|
1503
|
+
"&:hover, &:focus": {
|
|
1504
|
+
backgroundColor: theme.palette.action.hover
|
|
1505
|
+
},
|
|
1506
|
+
'&[aria-selected="true"]': {
|
|
1507
|
+
backgroundColor: theme.palette.action.selected
|
|
1508
|
+
},
|
|
1509
|
+
cursor: "pointer",
|
|
1510
|
+
textOverflow: "ellipsis"
|
|
1511
|
+
},
|
|
1512
|
+
width: "100%",
|
|
1513
|
+
position: "relative"
|
|
1514
|
+
}));
|
|
1515
|
+
var useDebounce = (fn, delay) => {
|
|
1516
|
+
const [debouncedFn] = useState3(() => debounce(fn, delay));
|
|
1517
|
+
useEffect2(() => () => debouncedFn.cancel(), [debouncedFn]);
|
|
1518
|
+
return debouncedFn;
|
|
1519
|
+
};
|
|
1396
1520
|
|
|
1397
1521
|
// src/controls/url-control.tsx
|
|
1398
1522
|
import * as React29 from "react";
|
|
@@ -1423,12 +1547,12 @@ import {
|
|
|
1423
1547
|
stringPropTypeUtil as stringPropTypeUtil7,
|
|
1424
1548
|
urlPropTypeUtil as urlPropTypeUtil2
|
|
1425
1549
|
} from "@elementor/editor-props";
|
|
1426
|
-
import { httpService } from "@elementor/http";
|
|
1550
|
+
import { httpService as httpService2 } from "@elementor/http";
|
|
1427
1551
|
import { MinusIcon, PlusIcon as PlusIcon2 } from "@elementor/icons";
|
|
1428
1552
|
import { useSessionStorage } from "@elementor/session";
|
|
1429
1553
|
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
|
|
1554
|
+
import { debounce as debounce2 } from "@elementor/utils";
|
|
1555
|
+
import { __ as __9 } from "@wordpress/i18n";
|
|
1432
1556
|
|
|
1433
1557
|
// src/components/autocomplete.tsx
|
|
1434
1558
|
import * as React30 from "react";
|
|
@@ -1592,7 +1716,7 @@ var LinkControl = createControl((props) => {
|
|
|
1592
1716
|
debounceFetch({ ...requestParams, term: newValue });
|
|
1593
1717
|
};
|
|
1594
1718
|
const debounceFetch = useMemo(
|
|
1595
|
-
() =>
|
|
1719
|
+
() => debounce2(
|
|
1596
1720
|
(params) => fetchOptions(endpoint, params).then((newOptions) => {
|
|
1597
1721
|
setOptions(formatOptions(newOptions));
|
|
1598
1722
|
}),
|
|
@@ -1609,13 +1733,13 @@ var LinkControl = createControl((props) => {
|
|
|
1609
1733
|
alignItems: "center"
|
|
1610
1734
|
}
|
|
1611
1735
|
},
|
|
1612
|
-
/* @__PURE__ */ React31.createElement(ControlLabel, null,
|
|
1736
|
+
/* @__PURE__ */ React31.createElement(ControlLabel, null, __9("Link", "elementor")),
|
|
1613
1737
|
/* @__PURE__ */ React31.createElement(
|
|
1614
1738
|
ToggleIconControl,
|
|
1615
1739
|
{
|
|
1616
1740
|
enabled: isEnabled,
|
|
1617
1741
|
onIconClick: onEnabledChange,
|
|
1618
|
-
label:
|
|
1742
|
+
label: __9("Toggle link", "elementor")
|
|
1619
1743
|
}
|
|
1620
1744
|
)
|
|
1621
1745
|
), /* @__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 +1763,14 @@ var SwitchControl = () => {
|
|
|
1639
1763
|
const onClick = () => {
|
|
1640
1764
|
setValue(!value);
|
|
1641
1765
|
};
|
|
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,
|
|
1766
|
+
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
1767
|
};
|
|
1644
1768
|
async function fetchOptions(ajaxUrl, params) {
|
|
1645
1769
|
if (!params || !ajaxUrl) {
|
|
1646
1770
|
return [];
|
|
1647
1771
|
}
|
|
1648
1772
|
try {
|
|
1649
|
-
const { data: response } = await
|
|
1773
|
+
const { data: response } = await httpService2().get(ajaxUrl, { params });
|
|
1650
1774
|
return response.data.value;
|
|
1651
1775
|
} catch {
|
|
1652
1776
|
return [];
|
|
@@ -1674,8 +1798,8 @@ function generateFirstLoadedOption(unionValue) {
|
|
|
1674
1798
|
import * as React32 from "react";
|
|
1675
1799
|
import { layoutDirectionPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil4 } from "@elementor/editor-props";
|
|
1676
1800
|
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
|
|
1801
|
+
import { Grid as Grid8, Stack as Stack10, ToggleButton as ToggleButton4, Tooltip as Tooltip5 } from "@elementor/ui";
|
|
1802
|
+
import { __ as __10 } from "@wordpress/i18n";
|
|
1679
1803
|
var GapControl = createControl(({ label }) => {
|
|
1680
1804
|
const {
|
|
1681
1805
|
value: directionValue,
|
|
@@ -1695,11 +1819,14 @@ var GapControl = createControl(({ label }) => {
|
|
|
1695
1819
|
column: value
|
|
1696
1820
|
});
|
|
1697
1821
|
};
|
|
1822
|
+
const tooltipLabel = label.toLowerCase();
|
|
1698
1823
|
const LinkedIcon = isLinked ? LinkIcon2 : DetachIcon2;
|
|
1699
|
-
|
|
1824
|
+
const linkedLabel = __10("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
1825
|
+
const unlinkedLabel = __10("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
1826
|
+
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
1827
|
ToggleButton4,
|
|
1701
1828
|
{
|
|
1702
|
-
"aria-label":
|
|
1829
|
+
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
1703
1830
|
size: "tiny",
|
|
1704
1831
|
value: "check",
|
|
1705
1832
|
selected: isLinked,
|
|
@@ -1707,7 +1834,7 @@ var GapControl = createControl(({ label }) => {
|
|
|
1707
1834
|
onChange: onLinkToggle
|
|
1708
1835
|
},
|
|
1709
1836
|
/* @__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,
|
|
1837
|
+
))), /* @__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
1838
|
});
|
|
1712
1839
|
var Control4 = ({ bind, isLinked }) => {
|
|
1713
1840
|
if (isLinked) {
|
|
@@ -1720,14 +1847,14 @@ var Control4 = ({ bind, isLinked }) => {
|
|
|
1720
1847
|
import * as React33 from "react";
|
|
1721
1848
|
import { imageSrcPropTypeUtil as imageSrcPropTypeUtil2 } from "@elementor/editor-props";
|
|
1722
1849
|
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
|
|
1850
|
+
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
1851
|
import { useWpMediaAttachment as useWpMediaAttachment2, useWpMediaFrame as useWpMediaFrame2 } from "@elementor/wp-media";
|
|
1725
|
-
import { __ as
|
|
1852
|
+
import { __ as __11 } from "@wordpress/i18n";
|
|
1726
1853
|
var TILE_SIZE = 8;
|
|
1727
1854
|
var TILE_WHITE = "transparent";
|
|
1728
1855
|
var TILE_BLACK = "#c1c1c1";
|
|
1729
1856
|
var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
|
|
1730
|
-
var StyledCard =
|
|
1857
|
+
var StyledCard = styled5(Card2)`
|
|
1731
1858
|
background-color: white;
|
|
1732
1859
|
background-image: ${TILES_GRADIENT_FORMULA}, ${TILES_GRADIENT_FORMULA};
|
|
1733
1860
|
background-size: ${TILE_SIZE}px ${TILE_SIZE}px;
|
|
@@ -1736,7 +1863,7 @@ var StyledCard = styled4(Card2)`
|
|
|
1736
1863
|
${TILE_SIZE / 2}px ${TILE_SIZE / 2}px;
|
|
1737
1864
|
border: none;
|
|
1738
1865
|
`;
|
|
1739
|
-
var StyledCardMediaContainer =
|
|
1866
|
+
var StyledCardMediaContainer = styled5(Stack11)`
|
|
1740
1867
|
position: relative;
|
|
1741
1868
|
height: 140px;
|
|
1742
1869
|
object-fit: contain;
|
|
@@ -1750,9 +1877,9 @@ var SvgMediaControl = createControl(() => {
|
|
|
1750
1877
|
const { id, url } = value ?? {};
|
|
1751
1878
|
const { data: attachment, isFetching } = useWpMediaAttachment2(id?.value || null);
|
|
1752
1879
|
const src = attachment?.url ?? url?.value ?? null;
|
|
1880
|
+
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
1753
1881
|
const { open } = useWpMediaFrame2({
|
|
1754
|
-
|
|
1755
|
-
allowedExtensions: ["svg"],
|
|
1882
|
+
mediaTypes: ["svg"],
|
|
1756
1883
|
multiple: false,
|
|
1757
1884
|
selected: id?.value || null,
|
|
1758
1885
|
onSelect: (selectedAttachment) => {
|
|
@@ -1765,12 +1892,18 @@ var SvgMediaControl = createControl(() => {
|
|
|
1765
1892
|
});
|
|
1766
1893
|
}
|
|
1767
1894
|
});
|
|
1768
|
-
|
|
1895
|
+
const handleClick = (openOptions) => {
|
|
1896
|
+
if (allowSvgUpload) {
|
|
1897
|
+
open(openOptions);
|
|
1898
|
+
} else {
|
|
1899
|
+
}
|
|
1900
|
+
};
|
|
1901
|
+
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
1902
|
CardMedia2,
|
|
1770
1903
|
{
|
|
1771
1904
|
component: "img",
|
|
1772
1905
|
image: src,
|
|
1773
|
-
alt:
|
|
1906
|
+
alt: __11("Preview SVG", "elementor"),
|
|
1774
1907
|
sx: { maxHeight: "140px", width: "50px" }
|
|
1775
1908
|
}
|
|
1776
1909
|
)), /* @__PURE__ */ React33.createElement(
|
|
@@ -1788,9 +1921,9 @@ var SvgMediaControl = createControl(() => {
|
|
|
1788
1921
|
size: "tiny",
|
|
1789
1922
|
color: "inherit",
|
|
1790
1923
|
variant: "outlined",
|
|
1791
|
-
onClick: () =>
|
|
1924
|
+
onClick: () => handleClick({ mode: "browse" })
|
|
1792
1925
|
},
|
|
1793
|
-
|
|
1926
|
+
__11("Select SVG", "elementor")
|
|
1794
1927
|
), /* @__PURE__ */ React33.createElement(
|
|
1795
1928
|
Button3,
|
|
1796
1929
|
{
|
|
@@ -1798,9 +1931,9 @@ var SvgMediaControl = createControl(() => {
|
|
|
1798
1931
|
variant: "text",
|
|
1799
1932
|
color: "inherit",
|
|
1800
1933
|
startIcon: /* @__PURE__ */ React33.createElement(UploadIcon2, null),
|
|
1801
|
-
onClick: () =>
|
|
1934
|
+
onClick: () => handleClick({ mode: "upload" })
|
|
1802
1935
|
},
|
|
1803
|
-
|
|
1936
|
+
__11("Upload", "elementor")
|
|
1804
1937
|
))
|
|
1805
1938
|
))));
|
|
1806
1939
|
});
|
|
@@ -1809,7 +1942,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
1809
1942
|
import * as React39 from "react";
|
|
1810
1943
|
import { backgroundPropTypeUtil } from "@elementor/editor-props";
|
|
1811
1944
|
import { Grid as Grid14 } from "@elementor/ui";
|
|
1812
|
-
import { __ as
|
|
1945
|
+
import { __ as __17 } from "@wordpress/i18n";
|
|
1813
1946
|
|
|
1814
1947
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
1815
1948
|
import * as React38 from "react";
|
|
@@ -1820,7 +1953,7 @@ import {
|
|
|
1820
1953
|
} from "@elementor/editor-props";
|
|
1821
1954
|
import { Box as Box4, CardMedia as CardMedia3, Grid as Grid13, Tab, TabPanel, Tabs, UnstableColorIndicator as UnstableColorIndicator2 } from "@elementor/ui";
|
|
1822
1955
|
import { useWpMediaAttachment as useWpMediaAttachment3 } from "@elementor/wp-media";
|
|
1823
|
-
import { __ as
|
|
1956
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
1824
1957
|
|
|
1825
1958
|
// src/env.ts
|
|
1826
1959
|
import { parseEnv } from "@elementor/env";
|
|
@@ -1830,42 +1963,42 @@ var { env } = parseEnv("@elementor/editor-controls");
|
|
|
1830
1963
|
import * as React34 from "react";
|
|
1831
1964
|
import { PinIcon, PinnedOffIcon } from "@elementor/icons";
|
|
1832
1965
|
import { Grid as Grid9 } from "@elementor/ui";
|
|
1833
|
-
import { __ as
|
|
1966
|
+
import { __ as __12 } from "@wordpress/i18n";
|
|
1834
1967
|
var attachmentControlOptions = [
|
|
1835
1968
|
{
|
|
1836
1969
|
value: "fixed",
|
|
1837
|
-
label:
|
|
1970
|
+
label: __12("Fixed", "elementor"),
|
|
1838
1971
|
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(PinIcon, { fontSize: size }),
|
|
1839
1972
|
showTooltip: true
|
|
1840
1973
|
},
|
|
1841
1974
|
{
|
|
1842
1975
|
value: "scroll",
|
|
1843
|
-
label:
|
|
1976
|
+
label: __12("Scroll", "elementor"),
|
|
1844
1977
|
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(PinnedOffIcon, { fontSize: size }),
|
|
1845
1978
|
showTooltip: true
|
|
1846
1979
|
}
|
|
1847
1980
|
];
|
|
1848
1981
|
var BackgroundImageOverlayAttachment = () => {
|
|
1849
|
-
return /* @__PURE__ */ React34.createElement(PopoverGridContainer, null, /* @__PURE__ */ React34.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(ControlLabel, null,
|
|
1982
|
+
return /* @__PURE__ */ React34.createElement(PopoverGridContainer, null, /* @__PURE__ */ React34.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(ControlLabel, null, __12("Attachment", "elementor"))), /* @__PURE__ */ React34.createElement(Grid9, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React34.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
1850
1983
|
};
|
|
1851
1984
|
|
|
1852
1985
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
1853
1986
|
import * as React35 from "react";
|
|
1854
1987
|
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil8 } from "@elementor/editor-props";
|
|
1855
1988
|
import { LetterXIcon, LetterYIcon } from "@elementor/icons";
|
|
1856
|
-
import { Grid as Grid10, MenuItem as
|
|
1857
|
-
import { __ as
|
|
1989
|
+
import { Grid as Grid10, MenuItem as MenuItem3, Select as Select2 } from "@elementor/ui";
|
|
1990
|
+
import { __ as __13 } from "@wordpress/i18n";
|
|
1858
1991
|
var backgroundPositionOptions = [
|
|
1859
|
-
{ label:
|
|
1860
|
-
{ label:
|
|
1861
|
-
{ label:
|
|
1862
|
-
{ label:
|
|
1863
|
-
{ label:
|
|
1864
|
-
{ label:
|
|
1865
|
-
{ label:
|
|
1866
|
-
{ label:
|
|
1867
|
-
{ label:
|
|
1868
|
-
{ label:
|
|
1992
|
+
{ label: __13("Center center", "elementor"), value: "center center" },
|
|
1993
|
+
{ label: __13("Center left", "elementor"), value: "center left" },
|
|
1994
|
+
{ label: __13("Center right", "elementor"), value: "center right" },
|
|
1995
|
+
{ label: __13("Top center", "elementor"), value: "top center" },
|
|
1996
|
+
{ label: __13("Top left", "elementor"), value: "top left" },
|
|
1997
|
+
{ label: __13("Top right", "elementor"), value: "top right" },
|
|
1998
|
+
{ label: __13("Bottom center", "elementor"), value: "bottom center" },
|
|
1999
|
+
{ label: __13("Bottom left", "elementor"), value: "bottom left" },
|
|
2000
|
+
{ label: __13("Bottom right", "elementor"), value: "bottom right" },
|
|
2001
|
+
{ label: __13("Custom", "elementor"), value: "custom" }
|
|
1869
2002
|
];
|
|
1870
2003
|
var BackgroundImageOverlayPosition = () => {
|
|
1871
2004
|
const backgroundImageOffsetContext = useBoundProp(backgroundImagePositionOffsetPropTypeUtil);
|
|
@@ -1879,7 +2012,7 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
1879
2012
|
stringPropContext.setValue(value);
|
|
1880
2013
|
}
|
|
1881
2014
|
};
|
|
1882
|
-
return /* @__PURE__ */ React35.createElement(Grid10, { container: true, spacing: 1.5 }, /* @__PURE__ */ React35.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(PopoverGridContainer, null, /* @__PURE__ */ React35.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ControlLabel, null,
|
|
2015
|
+
return /* @__PURE__ */ React35.createElement(Grid10, { container: true, spacing: 1.5 }, /* @__PURE__ */ React35.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(PopoverGridContainer, null, /* @__PURE__ */ React35.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ControlLabel, null, __13("Position", "elementor"))), /* @__PURE__ */ React35.createElement(Grid10, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React35.createElement(
|
|
1883
2016
|
Select2,
|
|
1884
2017
|
{
|
|
1885
2018
|
size: "tiny",
|
|
@@ -1887,7 +2020,7 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
1887
2020
|
onChange: handlePositionChange,
|
|
1888
2021
|
fullWidth: true
|
|
1889
2022
|
},
|
|
1890
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React35.createElement(
|
|
2023
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React35.createElement(MenuItem3, { key: value, value: value ?? "" }, label))
|
|
1891
2024
|
)))), isCustom ? /* @__PURE__ */ React35.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React35.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(Grid10, { container: true, spacing: 1.5 }, /* @__PURE__ */ React35.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React35.createElement(SizeControl, { startIcon: /* @__PURE__ */ React35.createElement(LetterXIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React35.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React35.createElement(SizeControl, { startIcon: /* @__PURE__ */ React35.createElement(LetterYIcon, { fontSize: "tiny" }) })))))) : null);
|
|
1892
2025
|
};
|
|
1893
2026
|
|
|
@@ -1895,35 +2028,35 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
1895
2028
|
import * as React36 from "react";
|
|
1896
2029
|
import { DotsHorizontalIcon, DotsVerticalIcon, GridDotsIcon, XIcon as XIcon4 } from "@elementor/icons";
|
|
1897
2030
|
import { Grid as Grid11 } from "@elementor/ui";
|
|
1898
|
-
import { __ as
|
|
2031
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
1899
2032
|
var repeatControlOptions = [
|
|
1900
2033
|
{
|
|
1901
2034
|
value: "repeat",
|
|
1902
|
-
label:
|
|
2035
|
+
label: __14("Repeat", "elementor"),
|
|
1903
2036
|
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(GridDotsIcon, { fontSize: size }),
|
|
1904
2037
|
showTooltip: true
|
|
1905
2038
|
},
|
|
1906
2039
|
{
|
|
1907
2040
|
value: "repeat-x",
|
|
1908
|
-
label:
|
|
2041
|
+
label: __14("Repeat-x", "elementor"),
|
|
1909
2042
|
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(DotsHorizontalIcon, { fontSize: size }),
|
|
1910
2043
|
showTooltip: true
|
|
1911
2044
|
},
|
|
1912
2045
|
{
|
|
1913
2046
|
value: "repeat-y",
|
|
1914
|
-
label:
|
|
2047
|
+
label: __14("Repeat-y", "elementor"),
|
|
1915
2048
|
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(DotsVerticalIcon, { fontSize: size }),
|
|
1916
2049
|
showTooltip: true
|
|
1917
2050
|
},
|
|
1918
2051
|
{
|
|
1919
2052
|
value: "no-repeat",
|
|
1920
|
-
label:
|
|
2053
|
+
label: __14("No-repeat", "elementor"),
|
|
1921
2054
|
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(XIcon4, { fontSize: size }),
|
|
1922
2055
|
showTooltip: true
|
|
1923
2056
|
}
|
|
1924
2057
|
];
|
|
1925
2058
|
var BackgroundImageOverlayRepeat = () => {
|
|
1926
|
-
return /* @__PURE__ */ React36.createElement(PopoverGridContainer, null, /* @__PURE__ */ React36.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(ControlLabel, null,
|
|
2059
|
+
return /* @__PURE__ */ React36.createElement(PopoverGridContainer, null, /* @__PURE__ */ React36.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(ControlLabel, null, __14("Repeat", "elementor"))), /* @__PURE__ */ React36.createElement(Grid11, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React36.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
1927
2060
|
};
|
|
1928
2061
|
|
|
1929
2062
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
@@ -1938,29 +2071,29 @@ import {
|
|
|
1938
2071
|
PencilIcon
|
|
1939
2072
|
} from "@elementor/icons";
|
|
1940
2073
|
import { Grid as Grid12 } from "@elementor/ui";
|
|
1941
|
-
import { __ as
|
|
2074
|
+
import { __ as __15 } from "@wordpress/i18n";
|
|
1942
2075
|
var sizeControlOptions = [
|
|
1943
2076
|
{
|
|
1944
2077
|
value: "auto",
|
|
1945
|
-
label:
|
|
2078
|
+
label: __15("Auto", "elementor"),
|
|
1946
2079
|
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(LetterAIcon, { fontSize: size }),
|
|
1947
2080
|
showTooltip: true
|
|
1948
2081
|
},
|
|
1949
2082
|
{
|
|
1950
2083
|
value: "cover",
|
|
1951
|
-
label:
|
|
2084
|
+
label: __15("Cover", "elementor"),
|
|
1952
2085
|
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(ArrowsMaximizeIcon, { fontSize: size }),
|
|
1953
2086
|
showTooltip: true
|
|
1954
2087
|
},
|
|
1955
2088
|
{
|
|
1956
2089
|
value: "contain",
|
|
1957
|
-
label:
|
|
2090
|
+
label: __15("Contain", "elementor"),
|
|
1958
2091
|
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(ArrowBarBothIcon, { fontSize: size }),
|
|
1959
2092
|
showTooltip: true
|
|
1960
2093
|
},
|
|
1961
2094
|
{
|
|
1962
2095
|
value: "custom",
|
|
1963
|
-
label:
|
|
2096
|
+
label: __15("Custom", "elementor"),
|
|
1964
2097
|
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(PencilIcon, { fontSize: size }),
|
|
1965
2098
|
showTooltip: true
|
|
1966
2099
|
}
|
|
@@ -1976,7 +2109,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
1976
2109
|
stringPropContext.setValue(size);
|
|
1977
2110
|
}
|
|
1978
2111
|
};
|
|
1979
|
-
return /* @__PURE__ */ React37.createElement(Grid12, { container: true, spacing: 1.5 }, /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(PopoverGridContainer, null, /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(ControlLabel, null,
|
|
2112
|
+
return /* @__PURE__ */ React37.createElement(Grid12, { container: true, spacing: 1.5 }, /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(PopoverGridContainer, null, /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(ControlLabel, null, __15("Size", "elementor"))), /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React37.createElement(
|
|
1980
2113
|
ControlToggleButtonGroup,
|
|
1981
2114
|
{
|
|
1982
2115
|
exclusive: true,
|
|
@@ -2000,7 +2133,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
2000
2133
|
};
|
|
2001
2134
|
|
|
2002
2135
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
2003
|
-
import { useRef as
|
|
2136
|
+
import { useRef as useRef4 } from "react";
|
|
2004
2137
|
import {
|
|
2005
2138
|
backgroundColorOverlayPropTypeUtil,
|
|
2006
2139
|
backgroundImageOverlayPropTypeUtil
|
|
@@ -2013,7 +2146,7 @@ var useBackgroundTabsHistory = ({
|
|
|
2013
2146
|
const { value: imageValue, setValue: setImageValue } = useBoundProp(backgroundImageOverlayPropTypeUtil);
|
|
2014
2147
|
const { value: colorValue, setValue: setColorValue } = useBoundProp(backgroundColorOverlayPropTypeUtil);
|
|
2015
2148
|
const { getTabsProps, getTabProps, getTabPanelProps } = useTabs(colorValue ? "color" : "image");
|
|
2016
|
-
const valuesHistory =
|
|
2149
|
+
const valuesHistory = useRef4({
|
|
2017
2150
|
image: initialBackgroundImageOverlay,
|
|
2018
2151
|
color: initialBackgroundColorOverlay2
|
|
2019
2152
|
});
|
|
@@ -2071,10 +2204,10 @@ var getInitialBackgroundOverlay = () => ({
|
|
|
2071
2204
|
}
|
|
2072
2205
|
});
|
|
2073
2206
|
var backgroundResolutionOptions = [
|
|
2074
|
-
{ label:
|
|
2075
|
-
{ label:
|
|
2076
|
-
{ label:
|
|
2077
|
-
{ label:
|
|
2207
|
+
{ label: __16("Thumbnail - 150 x 150", "elementor"), value: "thumbnail" },
|
|
2208
|
+
{ label: __16("Medium - 300 x 300", "elementor"), value: "medium" },
|
|
2209
|
+
{ label: __16("Large 1024 x 1024", "elementor"), value: "large" },
|
|
2210
|
+
{ label: __16("Full", "elementor"), value: "full" }
|
|
2078
2211
|
];
|
|
2079
2212
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
2080
2213
|
const { propType, value: overlayValues, setValue } = useBoundProp(backgroundOverlayPropTypeUtil);
|
|
@@ -2083,7 +2216,7 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
2083
2216
|
{
|
|
2084
2217
|
values: overlayValues ?? [],
|
|
2085
2218
|
setValues: setValue,
|
|
2086
|
-
label:
|
|
2219
|
+
label: __16("Overlay", "elementor"),
|
|
2087
2220
|
itemSettings: {
|
|
2088
2221
|
Icon: ItemIcon2,
|
|
2089
2222
|
Label: ItemLabel2,
|
|
@@ -2101,7 +2234,7 @@ var Content2 = () => {
|
|
|
2101
2234
|
image: getInitialBackgroundOverlay().value,
|
|
2102
2235
|
color: initialBackgroundColorOverlay.value
|
|
2103
2236
|
});
|
|
2104
|
-
return /* @__PURE__ */ React38.createElement(Box4, { sx: { width: "100%" } }, /* @__PURE__ */ React38.createElement(Box4, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React38.createElement(Tabs, { ...getTabsProps(), "aria-label":
|
|
2237
|
+
return /* @__PURE__ */ React38.createElement(Box4, { sx: { width: "100%" } }, /* @__PURE__ */ React38.createElement(Box4, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React38.createElement(Tabs, { ...getTabsProps(), "aria-label": __16("Background Overlay", "elementor") }, /* @__PURE__ */ React38.createElement(Tab, { label: __16("Image", "elementor"), ...getTabProps("image") }), /* @__PURE__ */ React38.createElement(Tab, { label: __16("Color", "elementor"), ...getTabProps("color") }))), /* @__PURE__ */ React38.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React38.createElement(PopoverContent, null, /* @__PURE__ */ React38.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React38.createElement(TabPanel, { ...getTabPanelProps("color"), sx: { p: 1.5 } }, /* @__PURE__ */ React38.createElement(Grid13, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React38.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React38.createElement(ColorControl, { propTypeUtil: backgroundColorOverlayPropTypeUtil2 })))));
|
|
2105
2238
|
};
|
|
2106
2239
|
var ItemIcon2 = ({ value }) => {
|
|
2107
2240
|
switch (value.$$type) {
|
|
@@ -2142,7 +2275,7 @@ var ImageOverlayContent = () => {
|
|
|
2142
2275
|
return /* @__PURE__ */ React38.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React38.createElement(Grid13, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React38.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React38.createElement(
|
|
2143
2276
|
ImageControl,
|
|
2144
2277
|
{
|
|
2145
|
-
resolutionLabel:
|
|
2278
|
+
resolutionLabel: __16("Resolution", "elementor"),
|
|
2146
2279
|
sizes: backgroundResolutionOptions
|
|
2147
2280
|
}
|
|
2148
2281
|
)))), /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React38.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React38.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React38.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React38.createElement(BackgroundImageOverlayAttachment, null)));
|
|
@@ -2165,7 +2298,7 @@ var useImage = (image) => {
|
|
|
2165
2298
|
// src/controls/background-control/background-control.tsx
|
|
2166
2299
|
var BackgroundControl = createControl(() => {
|
|
2167
2300
|
const propContext = useBoundProp(backgroundPropTypeUtil);
|
|
2168
|
-
return /* @__PURE__ */ React39.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React39.createElement(SectionContent, null, /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React39.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React39.createElement(Grid14, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlLabel, null,
|
|
2301
|
+
return /* @__PURE__ */ React39.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React39.createElement(SectionContent, null, /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React39.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React39.createElement(Grid14, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlLabel, null, __17("Color", "elementor"))), /* @__PURE__ */ React39.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ColorControl, null))))));
|
|
2169
2302
|
});
|
|
2170
2303
|
export {
|
|
2171
2304
|
BackgroundControl,
|