@elementor/editor-controls 0.13.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/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: MenuItem5, id }) => /* @__PURE__ */ React7.createElement(MenuItem5, { key: id }));
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((props) => {
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
- types: ["image", "image/svg+xml"],
261
- allowedExtensions: props.allowedExtensions,
288
+ mediaTypes,
262
289
  multiple: false,
263
290
  selected: id?.value || null,
264
291
  onSelect: (selectedAttachment) => {
@@ -289,7 +316,7 @@ var ImageMediaControl = createControl((props) => {
289
316
  startIcon: /* @__PURE__ */ React8.createElement(UploadIcon, null),
290
317
  onClick: () => open({ mode: "upload" })
291
318
  },
292
- __("Upload image", "elementor")
319
+ __("Upload", "elementor")
293
320
  )))));
294
321
  });
295
322
 
@@ -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
- 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("Choose image", "elementor"), " "), /* @__PURE__ */ React10.createElement(ImageMediaControl, null)), /* @__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 }))))));
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
 
@@ -370,7 +399,7 @@ var TextAreaControl = createControl(({ placeholder }) => {
370
399
 
371
400
  // src/controls/size-control.tsx
372
401
  import * as React14 from "react";
373
- import { sizePropTypeUtil } from "@elementor/editor-props";
402
+ import { sizePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil4 } from "@elementor/editor-props";
374
403
  import { InputAdornment as InputAdornment2 } from "@elementor/ui";
375
404
 
376
405
  // src/components/text-field-inner-selection.tsx
@@ -459,27 +488,74 @@ var useSyncExternalState = ({
459
488
  var defaultUnits = ["px", "%", "em", "rem", "vw", "vh"];
460
489
  var defaultUnit = "px";
461
490
  var defaultSize = NaN;
462
- var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, startIcon }) => {
463
- const { value, setValue } = useBoundProp(sizePropTypeUtil);
464
- const [state, setState] = useSyncExternalState({
465
- external: value,
466
- setExternal: setValue,
467
- persistWhen: (controlValue) => !!controlValue?.size || controlValue?.size === 0,
468
- fallback: (controlValue) => ({ unit: controlValue?.unit || defaultUnit, size: defaultSize })
469
- });
470
- const handleUnitChange = (unit) => {
471
- setState((prev) => ({
472
- size: prev?.size ?? defaultSize,
473
- unit
474
- }));
475
- };
476
- const handleSizeChange = (event) => {
477
- const { value: size } = event.target;
478
- setState((prev) => ({
479
- ...prev,
480
- size: size || size === "0" ? parseFloat(size) : defaultSize
481
- }));
491
+ var SizeControl = createControl(
492
+ ({ units: units2 = defaultUnits, extendedValues = [], placeholder, startIcon }) => {
493
+ const { value: sizeValue, setValue: setSizeValue } = useBoundProp(sizePropTypeUtil);
494
+ const [state, setState] = useSyncExternalState({
495
+ external: sizeValue,
496
+ setExternal: setSizeValue,
497
+ persistWhen: (controlValue) => !!controlValue?.size || controlValue?.size === 0,
498
+ fallback: (controlValue) => ({ unit: controlValue?.unit || defaultUnit, size: defaultSize })
499
+ });
500
+ const handleUnitChange = (unit) => {
501
+ setState((prev) => ({
502
+ size: prev?.size ?? defaultSize,
503
+ unit
504
+ }));
505
+ };
506
+ const handleSizeChange = (event) => {
507
+ const { value: size } = event.target;
508
+ setState((prev) => ({
509
+ ...prev,
510
+ size: size || size === "0" ? parseFloat(size) : defaultSize
511
+ }));
512
+ };
513
+ const inputProps = {
514
+ size: state.size,
515
+ unit: state.unit,
516
+ placeholder,
517
+ startIcon,
518
+ units: units2,
519
+ extendedValues,
520
+ handleSizeChange,
521
+ handleUnitChange
522
+ };
523
+ if (extendedValues?.length) {
524
+ return /* @__PURE__ */ React14.createElement(ExtendedSizeInput, { ...inputProps });
525
+ }
526
+ return /* @__PURE__ */ React14.createElement(SizeInput, { ...inputProps });
527
+ }
528
+ );
529
+ var ExtendedSizeInput = (props) => {
530
+ const { value: stringValue, setValue: setStringValue } = useBoundProp(stringPropTypeUtil4);
531
+ const { extendedValues = [] } = props;
532
+ const unit = stringValue ?? props.unit;
533
+ const handleUnitChange = (newUnit) => {
534
+ if (extendedValues.includes(newUnit)) {
535
+ setStringValue(newUnit);
536
+ } else {
537
+ props.handleUnitChange(newUnit);
538
+ }
482
539
  };
540
+ return /* @__PURE__ */ React14.createElement(
541
+ SizeInput,
542
+ {
543
+ ...props,
544
+ units: [...props.units, ...extendedValues],
545
+ handleUnitChange,
546
+ unit
547
+ }
548
+ );
549
+ };
550
+ var SizeInput = ({
551
+ units: units2,
552
+ handleUnitChange,
553
+ handleSizeChange,
554
+ placeholder,
555
+ startIcon,
556
+ size,
557
+ unit
558
+ }) => {
483
559
  return /* @__PURE__ */ React14.createElement(ControlActions, null, /* @__PURE__ */ React14.createElement(
484
560
  TextFieldInnerSelection,
485
561
  {
@@ -488,17 +564,17 @@ var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, st
488
564
  {
489
565
  options: units2,
490
566
  onClick: handleUnitChange,
491
- value: state?.unit ?? defaultUnit
567
+ value: unit ?? defaultUnit
492
568
  }
493
569
  ),
494
570
  placeholder,
495
571
  startAdornment: startIcon ? /* @__PURE__ */ React14.createElement(InputAdornment2, { position: "start" }, startIcon) : void 0,
496
572
  type: "number",
497
- value: Number.isNaN(state?.size) ? "" : state?.size,
573
+ value: Number.isNaN(size) ? "" : size,
498
574
  onChange: handleSizeChange
499
575
  }
500
576
  ));
501
- });
577
+ };
502
578
 
503
579
  // src/controls/stroke-control.tsx
504
580
  import * as React17 from "react";
@@ -563,6 +639,7 @@ import {
563
639
  IconButton,
564
640
  Popover,
565
641
  Stack as Stack5,
642
+ Tooltip,
566
643
  Typography as Typography2,
567
644
  UnstableTag,
568
645
  usePopupState as usePopupState2
@@ -766,6 +843,9 @@ var RepeaterItem = ({
766
843
  const [anchorEl, setAnchorEl] = useState2(null);
767
844
  const popoverState = usePopupState2({ popupId, variant: "popover" });
768
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");
769
849
  return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
770
850
  UnstableTag,
771
851
  {
@@ -777,31 +857,8 @@ var RepeaterItem = ({
777
857
  "aria-label": __4("Open item", "elementor"),
778
858
  ...bindTrigger2(popoverState),
779
859
  startIcon,
780
- actions: /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
781
- IconButton,
782
- {
783
- size: SIZE,
784
- onClick: duplicateItem,
785
- "aria-label": __4("Duplicate item", "elementor")
786
- },
787
- /* @__PURE__ */ React21.createElement(CopyIcon, { fontSize: SIZE })
788
- ), /* @__PURE__ */ React21.createElement(
789
- IconButton,
790
- {
791
- size: SIZE,
792
- onClick: toggleDisableItem,
793
- "aria-label": disabled ? __4("Enable item", "elementor") : __4("Disable item", "elementor")
794
- },
795
- disabled ? /* @__PURE__ */ React21.createElement(EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ React21.createElement(EyeIcon, { fontSize: SIZE })
796
- ), /* @__PURE__ */ React21.createElement(
797
- IconButton,
798
- {
799
- size: SIZE,
800
- onClick: removeItem,
801
- "aria-label": __4("Remove item", "elementor")
802
- },
803
- /* @__PURE__ */ React21.createElement(XIcon, { fontSize: SIZE })
804
- ))
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 })))),
861
+ sx: { backgroundColor: "background.paper" }
805
862
  }
806
863
  ), /* @__PURE__ */ React21.createElement(
807
864
  Popover,
@@ -916,7 +973,7 @@ var initialShadow = {
916
973
 
917
974
  // src/controls/toggle-control.tsx
918
975
  import * as React24 from "react";
919
- import { stringPropTypeUtil as stringPropTypeUtil4 } from "@elementor/editor-props";
976
+ import { stringPropTypeUtil as stringPropTypeUtil5 } from "@elementor/editor-props";
920
977
 
921
978
  // src/components/control-toggle-button-group.tsx
922
979
  import * as React23 from "react";
@@ -924,7 +981,7 @@ import {
924
981
  styled as styled3,
925
982
  ToggleButton,
926
983
  ToggleButtonGroup,
927
- Tooltip,
984
+ Tooltip as Tooltip2,
928
985
  useTheme
929
986
  } from "@elementor/ui";
930
987
  var StyledToggleButtonGroup = styled3(ToggleButtonGroup)`
@@ -955,7 +1012,7 @@ var ControlToggleButtonGroup = ({
955
1012
  }
956
1013
  },
957
1014
  items.map(
958
- ({ label, value: buttonValue, renderContent: Content3, showTooltip }) => showTooltip ? /* @__PURE__ */ React23.createElement(Tooltip, { 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(
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(
959
1016
  ToggleButton,
960
1017
  {
961
1018
  key: buttonValue,
@@ -973,7 +1030,7 @@ var ControlToggleButtonGroup = ({
973
1030
  // src/controls/toggle-control.tsx
974
1031
  var ToggleControl = createControl(
975
1032
  ({ options, fullWidth = false, size = "tiny" }) => {
976
- const { value, setValue } = useBoundProp(stringPropTypeUtil4);
1033
+ const { value, setValue } = useBoundProp(stringPropTypeUtil5);
977
1034
  const handleToggle = (option) => {
978
1035
  setValue(option);
979
1036
  };
@@ -1033,7 +1090,7 @@ var NumberControl = createControl(
1033
1090
  import * as React26 from "react";
1034
1091
  import { useId as useId2, useRef as useRef2 } from "react";
1035
1092
  import { sizePropTypeUtil as sizePropTypeUtil2 } from "@elementor/editor-props";
1036
- 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";
1037
1094
  import { __ as __6 } from "@wordpress/i18n";
1038
1095
  var isEqualSizes = (propValue, items) => {
1039
1096
  const values = Object.values(propValue);
@@ -1048,6 +1105,7 @@ var isEqualSizes = (propValue, items) => {
1048
1105
  function EqualUnequalSizesControl({
1049
1106
  label,
1050
1107
  icon,
1108
+ tooltipLabel,
1051
1109
  items,
1052
1110
  multiSizePropTypeUtil
1053
1111
  }) {
@@ -1087,17 +1145,18 @@ function EqualUnequalSizesControl({
1087
1145
  return splitEqualValue() ?? null;
1088
1146
  };
1089
1147
  const isMixed = !!multiSizeValue;
1090
- 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(
1091
1149
  ToggleButton2,
1092
1150
  {
1093
1151
  size: "tiny",
1094
1152
  value: "check",
1095
1153
  sx: { marginLeft: "auto" },
1096
1154
  ...bindToggle(popupState),
1097
- selected: popupState.isOpen
1155
+ selected: popupState.isOpen,
1156
+ "aria-label": tooltipLabel
1098
1157
  },
1099
1158
  icon
1100
- )))), /* @__PURE__ */ React26.createElement(
1159
+ ))))), /* @__PURE__ */ React26.createElement(
1101
1160
  Popover2,
1102
1161
  {
1103
1162
  disablePortal: true,
@@ -1124,78 +1183,100 @@ var MultiSizeValueControl = ({ item }) => /* @__PURE__ */ React26.createElement(
1124
1183
  import * as React27 from "react";
1125
1184
  import { dimensionsPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil3 } from "@elementor/editor-props";
1126
1185
  import { DetachIcon, LinkIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
1127
- 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";
1128
1187
  import { __ as __7 } from "@wordpress/i18n";
1129
- var LinkedDimensionsControl = createControl(({ label }) => {
1130
- const { value: dimensionsValue, setValue: setDimensionsValue, propType } = useBoundProp(dimensionsPropTypeUtil);
1131
- const { value: sizeValue, setValue: setSizeValue } = useBoundProp(sizePropTypeUtil3);
1132
- const isLinked = !dimensionsValue && !sizeValue ? true : !!sizeValue;
1133
- const onLinkToggle = () => {
1134
- if (!isLinked) {
1135
- setSizeValue(dimensionsValue?.top?.value);
1136
- return;
1137
- }
1138
- const value = sizeValue ? sizePropTypeUtil3.create(sizeValue) : null;
1139
- setDimensionsValue({
1140
- top: value,
1141
- right: value,
1142
- bottom: value,
1143
- left: value
1144
- });
1145
- };
1146
- const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
1147
- 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(
1148
- ToggleButton3,
1149
- {
1150
- "aria-label": __7("Link inputs", "elementor"),
1151
- size: "tiny",
1152
- value: "check",
1153
- selected: isLinked,
1154
- sx: { marginLeft: "auto" },
1155
- onChange: onLinkToggle
1156
- },
1157
- /* @__PURE__ */ React27.createElement(LinkedIcon, { fontSize: "tiny" })
1158
- )), /* @__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(
1159
- Control3,
1160
- {
1161
- bind: "top",
1162
- startIcon: /* @__PURE__ */ React27.createElement(SideTopIcon, { fontSize: "tiny" }),
1163
- isLinked
1164
- }
1165
- ))), /* @__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(
1166
- Control3,
1167
- {
1168
- bind: "right",
1169
- startIcon: /* @__PURE__ */ React27.createElement(SideRightIcon, { fontSize: "tiny" }),
1170
- isLinked
1171
- }
1172
- )))), /* @__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(
1173
- Control3,
1174
- {
1175
- bind: "bottom",
1176
- startIcon: /* @__PURE__ */ React27.createElement(SideBottomIcon, { fontSize: "tiny" }),
1177
- isLinked
1178
- }
1179
- ))), /* @__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(
1180
- Control3,
1181
- {
1182
- bind: "left",
1183
- startIcon: /* @__PURE__ */ React27.createElement(SideLeftIcon, { fontSize: "tiny" }),
1184
- isLinked
1185
- }
1186
- )))));
1187
- });
1188
- var Control3 = ({ bind, startIcon, isLinked }) => {
1188
+ var LinkedDimensionsControl = createControl(
1189
+ ({
1190
+ label,
1191
+ isSiteRtl = false,
1192
+ extendedValues
1193
+ }) => {
1194
+ const {
1195
+ value: dimensionsValue,
1196
+ setValue: setDimensionsValue,
1197
+ propType
1198
+ } = useBoundProp(dimensionsPropTypeUtil);
1199
+ const { value: sizeValue, setValue: setSizeValue } = useBoundProp(sizePropTypeUtil3);
1200
+ const isLinked = !dimensionsValue && !sizeValue ? true : !!sizeValue;
1201
+ const onLinkToggle = () => {
1202
+ if (!isLinked) {
1203
+ setSizeValue(dimensionsValue["block-start"]?.value);
1204
+ return;
1205
+ }
1206
+ const value = sizeValue ? sizePropTypeUtil3.create(sizeValue) : null;
1207
+ setDimensionsValue({
1208
+ "block-start": value,
1209
+ "block-end": value,
1210
+ "inline-start": value,
1211
+ "inline-end": value
1212
+ });
1213
+ };
1214
+ const tooltipLabel = label.toLowerCase();
1215
+ const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
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(
1219
+ ToggleButton3,
1220
+ {
1221
+ "aria-label": isLinked ? unlinkedLabel : linkedLabel,
1222
+ size: "tiny",
1223
+ value: "check",
1224
+ selected: isLinked,
1225
+ sx: { marginLeft: "auto" },
1226
+ onChange: onLinkToggle
1227
+ },
1228
+ /* @__PURE__ */ React27.createElement(LinkedIcon, { fontSize: "tiny" })
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(
1230
+ Control3,
1231
+ {
1232
+ bind: "block-start",
1233
+ startIcon: /* @__PURE__ */ React27.createElement(SideTopIcon, { fontSize: "tiny" }),
1234
+ isLinked,
1235
+ extendedValues
1236
+ }
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(
1238
+ Control3,
1239
+ {
1240
+ bind: "inline-end",
1241
+ startIcon: isSiteRtl ? /* @__PURE__ */ React27.createElement(SideLeftIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React27.createElement(SideRightIcon, { fontSize: "tiny" }),
1242
+ isLinked,
1243
+ extendedValues
1244
+ }
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(
1246
+ Control3,
1247
+ {
1248
+ bind: "block-end",
1249
+ startIcon: /* @__PURE__ */ React27.createElement(SideBottomIcon, { fontSize: "tiny" }),
1250
+ isLinked,
1251
+ extendedValues
1252
+ }
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(
1254
+ Control3,
1255
+ {
1256
+ bind: "inline-start",
1257
+ startIcon: isSiteRtl ? /* @__PURE__ */ React27.createElement(SideRightIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React27.createElement(SideLeftIcon, { fontSize: "tiny" }),
1258
+ isLinked,
1259
+ extendedValues
1260
+ }
1261
+ )))));
1262
+ }
1263
+ );
1264
+ var Control3 = ({
1265
+ bind,
1266
+ startIcon,
1267
+ isLinked,
1268
+ extendedValues
1269
+ }) => {
1189
1270
  if (isLinked) {
1190
- return /* @__PURE__ */ React27.createElement(SizeControl, { startIcon });
1271
+ return /* @__PURE__ */ React27.createElement(SizeControl, { startIcon, extendedValues });
1191
1272
  }
1192
- return /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React27.createElement(SizeControl, { startIcon }));
1273
+ return /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React27.createElement(SizeControl, { startIcon, extendedValues }));
1193
1274
  };
1194
1275
 
1195
- // src/controls/font-family-control.tsx
1196
- import { Fragment as Fragment4, useId as useId3, useState as useState3 } from "react";
1276
+ // src/controls/font-family-control/font-family-control.tsx
1197
1277
  import * as React28 from "react";
1198
- import { stringPropTypeUtil as stringPropTypeUtil5 } from "@elementor/editor-props";
1278
+ import { useEffect as useEffect2, useRef as useRef3, useState as useState3 } from "react";
1279
+ import { stringPropTypeUtil as stringPropTypeUtil6 } from "@elementor/editor-props";
1199
1280
  import { ChevronDownIcon, EditIcon, PhotoIcon, SearchIcon, XIcon as XIcon2 } from "@elementor/icons";
1200
1281
  import {
1201
1282
  bindPopover as bindPopover3,
@@ -1206,58 +1287,50 @@ import {
1206
1287
  InputAdornment as InputAdornment3,
1207
1288
  Link,
1208
1289
  ListSubheader,
1209
- MenuItem as MenuItem3,
1210
1290
  MenuList,
1211
1291
  Popover as Popover3,
1212
1292
  Stack as Stack8,
1293
+ styled as styled4,
1213
1294
  TextField as TextField5,
1214
1295
  Typography as Typography4,
1215
1296
  UnstableTag as UnstableTag2,
1216
1297
  usePopupState as usePopupState4
1217
1298
  } from "@elementor/ui";
1218
- import { __ as __9 } from "@wordpress/i18n";
1299
+ import { debounce } from "@elementor/utils";
1300
+ import { useVirtualizer } from "@tanstack/react-virtual";
1301
+ import { __ as __8 } from "@wordpress/i18n";
1219
1302
 
1220
1303
  // src/hooks/use-filtered-font-families.ts
1221
- import { __ as __8 } from "@wordpress/i18n";
1222
- var supportedCategories = {
1223
- system: __8("System", "elementor"),
1224
- googlefonts: __8("Google Fonts", "elementor"),
1225
- customfonts: __8("Custom Fonts", "elementor")
1226
- };
1227
1304
  var useFilteredFontFamilies = (fontFamilies, searchValue) => {
1228
1305
  const filteredFontFamilies = Object.entries(fontFamilies).reduce(
1229
- (acc, [font, category]) => {
1230
- const isMatch = font.toLowerCase().includes(searchValue.trim().toLowerCase());
1231
- if (!isMatch) {
1232
- return acc;
1233
- }
1234
- const categoryLabel = supportedCategories[category];
1235
- if (categoryLabel) {
1236
- const existingCategory = acc.get(categoryLabel);
1237
- if (existingCategory) {
1238
- existingCategory.push(font);
1239
- } else {
1240
- acc.set(categoryLabel, [font]);
1241
- }
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
+ });
1242
1313
  }
1243
1314
  return acc;
1244
1315
  },
1245
- /* @__PURE__ */ new Map()
1316
+ []
1246
1317
  );
1247
1318
  return [...filteredFontFamilies];
1248
1319
  };
1249
1320
 
1250
- // 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
1251
1328
  var SIZE2 = "tiny";
1252
1329
  var FontFamilyControl = createControl(({ fontFamilies }) => {
1253
1330
  const [searchValue, setSearchValue] = useState3("");
1254
- const { value: fontFamily, setValue: setFontFamily } = useBoundProp(stringPropTypeUtil5);
1255
- const popupId = useId3();
1256
- const popoverState = usePopupState4({ variant: "popover", popupId });
1331
+ const { value: fontFamily, setValue: setFontFamily } = useBoundProp(stringPropTypeUtil6);
1332
+ const popoverState = usePopupState4({ variant: "popover" });
1257
1333
  const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
1258
- if (!filteredFontFamilies) {
1259
- return null;
1260
- }
1261
1334
  const handleSearch = (event) => {
1262
1335
  setSearchValue(event.target.value);
1263
1336
  };
@@ -1283,42 +1356,27 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
1283
1356
  ...bindPopover3(popoverState),
1284
1357
  onClose: handleClose
1285
1358
  },
1286
- /* @__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" }, __9("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(
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(
1287
1360
  TextField5,
1288
1361
  {
1289
1362
  fullWidth: true,
1290
1363
  size: SIZE2,
1291
1364
  value: searchValue,
1292
- placeholder: __9("Search", "elementor"),
1365
+ placeholder: __8("Search", "elementor"),
1293
1366
  onChange: handleSearch,
1294
1367
  InputProps: {
1295
1368
  startAdornment: /* @__PURE__ */ React28.createElement(InputAdornment3, { position: "start" }, /* @__PURE__ */ React28.createElement(SearchIcon, { fontSize: SIZE2 }))
1296
1369
  }
1297
1370
  }
1298
- )), /* @__PURE__ */ React28.createElement(Divider2, null), /* @__PURE__ */ React28.createElement(Box2, { sx: { overflowY: "auto", height: 260, width: 220 } }, filteredFontFamilies.length > 0 ? /* @__PURE__ */ React28.createElement(MenuList, { role: "listbox", tabIndex: 0 }, filteredFontFamilies.map(([category, items], index) => /* @__PURE__ */ React28.createElement(Fragment4, { key: index }, /* @__PURE__ */ React28.createElement(
1299
- ListSubheader,
1371
+ )), /* @__PURE__ */ React28.createElement(Divider2, null), filteredFontFamilies.length > 0 ? /* @__PURE__ */ React28.createElement(
1372
+ FontList,
1300
1373
  {
1301
- sx: { px: 1.5, typography: "caption", color: "text.tertiary" }
1302
- },
1303
- category
1304
- ), items.map((item) => {
1305
- const isSelected = item === fontFamily;
1306
- return /* @__PURE__ */ React28.createElement(
1307
- MenuItem3,
1308
- {
1309
- key: item,
1310
- selected: isSelected,
1311
- autoFocus: isSelected,
1312
- onClick: () => {
1313
- setFontFamily(item);
1314
- handleClose();
1315
- },
1316
- sx: { px: 1.5, typography: "caption" },
1317
- style: { fontFamily: item }
1318
- },
1319
- item
1320
- );
1321
- })))) : /* @__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(
1322
1380
  Link,
1323
1381
  {
1324
1382
  color: "secondary",
@@ -1326,10 +1384,139 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
1326
1384
  component: "button",
1327
1385
  onClick: () => setSearchValue("")
1328
1386
  },
1329
- __9("Clear the filters", "elementor")
1330
- ), "\xA0", __9("and try again.", "elementor")))))
1387
+ __8("Clear the filters", "elementor")
1388
+ ), "\xA0", __8("and try again.", "elementor")))))
1331
1389
  ));
1332
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
+ };
1333
1520
 
1334
1521
  // src/controls/url-control.tsx
1335
1522
  import * as React29 from "react";
@@ -1357,14 +1544,15 @@ import {
1357
1544
  booleanPropTypeUtil,
1358
1545
  linkPropTypeUtil,
1359
1546
  numberPropTypeUtil as numberPropTypeUtil2,
1360
- stringPropTypeUtil as stringPropTypeUtil6,
1547
+ stringPropTypeUtil as stringPropTypeUtil7,
1361
1548
  urlPropTypeUtil as urlPropTypeUtil2
1362
1549
  } from "@elementor/editor-props";
1363
- import { httpService } from "@elementor/http";
1550
+ import { httpService as httpService2 } from "@elementor/http";
1364
1551
  import { MinusIcon, PlusIcon as PlusIcon2 } from "@elementor/icons";
1365
1552
  import { useSessionStorage } from "@elementor/session";
1366
1553
  import { Collapse, Divider as Divider3, Grid as Grid7, IconButton as IconButton4, Stack as Stack9, Switch } from "@elementor/ui";
1367
- import { __ as __10 } from "@wordpress/i18n";
1554
+ import { debounce as debounce2 } from "@elementor/utils";
1555
+ import { __ as __9 } from "@wordpress/i18n";
1368
1556
 
1369
1557
  // src/components/autocomplete.tsx
1370
1558
  import * as React30 from "react";
@@ -1502,7 +1690,7 @@ var LinkControl = createControl((props) => {
1502
1690
  const valueToSave = newValue ? {
1503
1691
  ...value,
1504
1692
  destination: numberPropTypeUtil2.create(newValue),
1505
- label: stringPropTypeUtil6.create(findMatchingOption(options, newValue)?.label || null)
1693
+ label: stringPropTypeUtil7.create(findMatchingOption(options, newValue)?.label || null)
1506
1694
  } : null;
1507
1695
  onSaveNewValue(valueToSave);
1508
1696
  };
@@ -1528,7 +1716,7 @@ var LinkControl = createControl((props) => {
1528
1716
  debounceFetch({ ...requestParams, term: newValue });
1529
1717
  };
1530
1718
  const debounceFetch = useMemo(
1531
- () => debounce(
1719
+ () => debounce2(
1532
1720
  (params) => fetchOptions(endpoint, params).then((newOptions) => {
1533
1721
  setOptions(formatOptions(newOptions));
1534
1722
  }),
@@ -1545,13 +1733,13 @@ var LinkControl = createControl((props) => {
1545
1733
  alignItems: "center"
1546
1734
  }
1547
1735
  },
1548
- /* @__PURE__ */ React31.createElement(ControlLabel, null, __10("Link", "elementor")),
1736
+ /* @__PURE__ */ React31.createElement(ControlLabel, null, __9("Link", "elementor")),
1549
1737
  /* @__PURE__ */ React31.createElement(
1550
1738
  ToggleIconControl,
1551
1739
  {
1552
1740
  enabled: isEnabled,
1553
1741
  onIconClick: onEnabledChange,
1554
- label: __10("Toggle link", "elementor")
1742
+ label: __9("Toggle link", "elementor")
1555
1743
  }
1556
1744
  )
1557
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(
@@ -1575,14 +1763,14 @@ var SwitchControl = () => {
1575
1763
  const onClick = () => {
1576
1764
  setValue(!value);
1577
1765
  };
1578
- 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, __10("Open in new tab", "elementor"))), /* @__PURE__ */ React31.createElement(Grid7, { item: true }, /* @__PURE__ */ React31.createElement(Switch, { checked: value, onClick })));
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 })));
1579
1767
  };
1580
1768
  async function fetchOptions(ajaxUrl, params) {
1581
1769
  if (!params || !ajaxUrl) {
1582
1770
  return [];
1583
1771
  }
1584
1772
  try {
1585
- const { data: response } = await httpService().get(ajaxUrl, { params });
1773
+ const { data: response } = await httpService2().get(ajaxUrl, { params });
1586
1774
  return response.data.value;
1587
1775
  } catch {
1588
1776
  return [];
@@ -1605,22 +1793,13 @@ function generateFirstLoadedOption(unionValue) {
1605
1793
  }
1606
1794
  ] : [];
1607
1795
  }
1608
- function debounce(fn, timeout) {
1609
- let timer;
1610
- return (...args) => {
1611
- clearTimeout(timer);
1612
- timer = setTimeout(() => {
1613
- fn(...args);
1614
- }, timeout);
1615
- };
1616
- }
1617
1796
 
1618
1797
  // src/controls/gap-control.tsx
1619
1798
  import * as React32 from "react";
1620
1799
  import { layoutDirectionPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil4 } from "@elementor/editor-props";
1621
1800
  import { DetachIcon as DetachIcon2, LinkIcon as LinkIcon2 } from "@elementor/icons";
1622
- import { Grid as Grid8, Stack as Stack10, ToggleButton as ToggleButton4 } from "@elementor/ui";
1623
- import { __ as __11 } from "@wordpress/i18n";
1801
+ import { Grid as Grid8, Stack as Stack10, ToggleButton as ToggleButton4, Tooltip as Tooltip5 } from "@elementor/ui";
1802
+ import { __ as __10 } from "@wordpress/i18n";
1624
1803
  var GapControl = createControl(({ label }) => {
1625
1804
  const {
1626
1805
  value: directionValue,
@@ -1631,7 +1810,7 @@ var GapControl = createControl(({ label }) => {
1631
1810
  const isLinked = !directionValue && !sizeValue ? true : !!sizeValue;
1632
1811
  const onLinkToggle = () => {
1633
1812
  if (!isLinked) {
1634
- setSizeValue(directionValue?.column.value);
1813
+ setSizeValue(directionValue?.column?.value);
1635
1814
  return;
1636
1815
  }
1637
1816
  const value = sizeValue ? sizePropTypeUtil4.create(sizeValue) : null;
@@ -1640,11 +1819,14 @@ var GapControl = createControl(({ label }) => {
1640
1819
  column: value
1641
1820
  });
1642
1821
  };
1822
+ const tooltipLabel = label.toLowerCase();
1643
1823
  const LinkedIcon = isLinked ? LinkIcon2 : DetachIcon2;
1644
- 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(
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(
1645
1827
  ToggleButton4,
1646
1828
  {
1647
- "aria-label": __11("Link inputs", "elementor"),
1829
+ "aria-label": isLinked ? unlinkedLabel : linkedLabel,
1648
1830
  size: "tiny",
1649
1831
  value: "check",
1650
1832
  selected: isLinked,
@@ -1652,7 +1834,7 @@ var GapControl = createControl(({ label }) => {
1652
1834
  onChange: onLinkToggle
1653
1835
  },
1654
1836
  /* @__PURE__ */ React32.createElement(LinkedIcon, { fontSize: "tiny" })
1655
- )), /* @__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, __11("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, __11("Row", "elementor"))), /* @__PURE__ */ React32.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(Control4, { bind: "row", isLinked })))));
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 })))));
1656
1838
  });
1657
1839
  var Control4 = ({ bind, isLinked }) => {
1658
1840
  if (isLinked) {
@@ -1665,14 +1847,14 @@ var Control4 = ({ bind, isLinked }) => {
1665
1847
  import * as React33 from "react";
1666
1848
  import { imageSrcPropTypeUtil as imageSrcPropTypeUtil2 } from "@elementor/editor-props";
1667
1849
  import { UploadIcon as UploadIcon2 } from "@elementor/icons";
1668
- import { Button as Button3, Card as Card2, CardMedia as CardMedia2, CardOverlay as CardOverlay2, CircularProgress as CircularProgress2, Stack as Stack11, styled as styled4 } from "@elementor/ui";
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";
1669
1851
  import { useWpMediaAttachment as useWpMediaAttachment2, useWpMediaFrame as useWpMediaFrame2 } from "@elementor/wp-media";
1670
- import { __ as __12 } from "@wordpress/i18n";
1852
+ import { __ as __11 } from "@wordpress/i18n";
1671
1853
  var TILE_SIZE = 8;
1672
1854
  var TILE_WHITE = "transparent";
1673
1855
  var TILE_BLACK = "#c1c1c1";
1674
1856
  var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
1675
- var StyledCard = styled4(Card2)`
1857
+ var StyledCard = styled5(Card2)`
1676
1858
  background-color: white;
1677
1859
  background-image: ${TILES_GRADIENT_FORMULA}, ${TILES_GRADIENT_FORMULA};
1678
1860
  background-size: ${TILE_SIZE}px ${TILE_SIZE}px;
@@ -1681,7 +1863,7 @@ var StyledCard = styled4(Card2)`
1681
1863
  ${TILE_SIZE / 2}px ${TILE_SIZE / 2}px;
1682
1864
  border: none;
1683
1865
  `;
1684
- var StyledCardMediaContainer = styled4(Stack11)`
1866
+ var StyledCardMediaContainer = styled5(Stack11)`
1685
1867
  position: relative;
1686
1868
  height: 140px;
1687
1869
  object-fit: contain;
@@ -1695,9 +1877,9 @@ var SvgMediaControl = createControl(() => {
1695
1877
  const { id, url } = value ?? {};
1696
1878
  const { data: attachment, isFetching } = useWpMediaAttachment2(id?.value || null);
1697
1879
  const src = attachment?.url ?? url?.value ?? null;
1880
+ const { data: allowSvgUpload } = useUnfilteredFilesUpload();
1698
1881
  const { open } = useWpMediaFrame2({
1699
- types: ["image/svg+xml"],
1700
- allowedExtensions: ["svg"],
1882
+ mediaTypes: ["svg"],
1701
1883
  multiple: false,
1702
1884
  selected: id?.value || null,
1703
1885
  onSelect: (selectedAttachment) => {
@@ -1710,12 +1892,18 @@ var SvgMediaControl = createControl(() => {
1710
1892
  });
1711
1893
  }
1712
1894
  });
1713
- return /* @__PURE__ */ React33.createElement(Stack11, { gap: 1 }, /* @__PURE__ */ React33.createElement(ControlLabel, null, " ", __12("Choose 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(
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(
1714
1902
  CardMedia2,
1715
1903
  {
1716
1904
  component: "img",
1717
1905
  image: src,
1718
- alt: __12("Preview SVG", "elementor"),
1906
+ alt: __11("Preview SVG", "elementor"),
1719
1907
  sx: { maxHeight: "140px", width: "50px" }
1720
1908
  }
1721
1909
  )), /* @__PURE__ */ React33.createElement(
@@ -1733,9 +1921,9 @@ var SvgMediaControl = createControl(() => {
1733
1921
  size: "tiny",
1734
1922
  color: "inherit",
1735
1923
  variant: "outlined",
1736
- onClick: () => open({ mode: "browse" })
1924
+ onClick: () => handleClick({ mode: "browse" })
1737
1925
  },
1738
- __12("Select SVG", "elementor")
1926
+ __11("Select SVG", "elementor")
1739
1927
  ), /* @__PURE__ */ React33.createElement(
1740
1928
  Button3,
1741
1929
  {
@@ -1743,9 +1931,9 @@ var SvgMediaControl = createControl(() => {
1743
1931
  variant: "text",
1744
1932
  color: "inherit",
1745
1933
  startIcon: /* @__PURE__ */ React33.createElement(UploadIcon2, null),
1746
- onClick: () => open({ mode: "upload" })
1934
+ onClick: () => handleClick({ mode: "upload" })
1747
1935
  },
1748
- __12("Upload SVG", "elementor")
1936
+ __11("Upload", "elementor")
1749
1937
  ))
1750
1938
  ))));
1751
1939
  });
@@ -1754,7 +1942,7 @@ var SvgMediaControl = createControl(() => {
1754
1942
  import * as React39 from "react";
1755
1943
  import { backgroundPropTypeUtil } from "@elementor/editor-props";
1756
1944
  import { Grid as Grid14 } from "@elementor/ui";
1757
- import { __ as __18 } from "@wordpress/i18n";
1945
+ import { __ as __17 } from "@wordpress/i18n";
1758
1946
 
1759
1947
  // src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
1760
1948
  import * as React38 from "react";
@@ -1765,7 +1953,7 @@ import {
1765
1953
  } from "@elementor/editor-props";
1766
1954
  import { Box as Box4, CardMedia as CardMedia3, Grid as Grid13, Tab, TabPanel, Tabs, UnstableColorIndicator as UnstableColorIndicator2 } from "@elementor/ui";
1767
1955
  import { useWpMediaAttachment as useWpMediaAttachment3 } from "@elementor/wp-media";
1768
- import { __ as __17 } from "@wordpress/i18n";
1956
+ import { __ as __16 } from "@wordpress/i18n";
1769
1957
 
1770
1958
  // src/env.ts
1771
1959
  import { parseEnv } from "@elementor/env";
@@ -1775,46 +1963,46 @@ var { env } = parseEnv("@elementor/editor-controls");
1775
1963
  import * as React34 from "react";
1776
1964
  import { PinIcon, PinnedOffIcon } from "@elementor/icons";
1777
1965
  import { Grid as Grid9 } from "@elementor/ui";
1778
- import { __ as __13 } from "@wordpress/i18n";
1966
+ import { __ as __12 } from "@wordpress/i18n";
1779
1967
  var attachmentControlOptions = [
1780
1968
  {
1781
1969
  value: "fixed",
1782
- label: __13("Fixed", "elementor"),
1970
+ label: __12("Fixed", "elementor"),
1783
1971
  renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(PinIcon, { fontSize: size }),
1784
1972
  showTooltip: true
1785
1973
  },
1786
1974
  {
1787
1975
  value: "scroll",
1788
- label: __13("Scroll", "elementor"),
1976
+ label: __12("Scroll", "elementor"),
1789
1977
  renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(PinnedOffIcon, { fontSize: size }),
1790
1978
  showTooltip: true
1791
1979
  }
1792
1980
  ];
1793
1981
  var BackgroundImageOverlayAttachment = () => {
1794
- return /* @__PURE__ */ React34.createElement(PopoverGridContainer, null, /* @__PURE__ */ React34.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(ControlLabel, null, __13("Attachment", "elementor"))), /* @__PURE__ */ React34.createElement(Grid9, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React34.createElement(ToggleControl, { options: attachmentControlOptions })));
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 })));
1795
1983
  };
1796
1984
 
1797
1985
  // src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
1798
1986
  import * as React35 from "react";
1799
- import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil7 } from "@elementor/editor-props";
1987
+ import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil8 } from "@elementor/editor-props";
1800
1988
  import { LetterXIcon, LetterYIcon } from "@elementor/icons";
1801
- import { Grid as Grid10, MenuItem as MenuItem4, Select as Select2 } from "@elementor/ui";
1802
- import { __ as __14 } from "@wordpress/i18n";
1989
+ import { Grid as Grid10, MenuItem as MenuItem3, Select as Select2 } from "@elementor/ui";
1990
+ import { __ as __13 } from "@wordpress/i18n";
1803
1991
  var backgroundPositionOptions = [
1804
- { label: __14("Center center", "elementor"), value: "center center" },
1805
- { label: __14("Center left", "elementor"), value: "center left" },
1806
- { label: __14("Center right", "elementor"), value: "center right" },
1807
- { label: __14("Top center", "elementor"), value: "top center" },
1808
- { label: __14("Top left", "elementor"), value: "top left" },
1809
- { label: __14("Top right", "elementor"), value: "top right" },
1810
- { label: __14("Bottom center", "elementor"), value: "bottom center" },
1811
- { label: __14("Bottom left", "elementor"), value: "bottom left" },
1812
- { label: __14("Bottom right", "elementor"), value: "bottom right" },
1813
- { label: __14("Custom", "elementor"), value: "custom" }
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" }
1814
2002
  ];
1815
2003
  var BackgroundImageOverlayPosition = () => {
1816
2004
  const backgroundImageOffsetContext = useBoundProp(backgroundImagePositionOffsetPropTypeUtil);
1817
- const stringPropContext = useBoundProp(stringPropTypeUtil7);
2005
+ const stringPropContext = useBoundProp(stringPropTypeUtil8);
1818
2006
  const isCustom = !!backgroundImageOffsetContext.value;
1819
2007
  const handlePositionChange = (event) => {
1820
2008
  const value = event.target.value || null;
@@ -1824,7 +2012,7 @@ var BackgroundImageOverlayPosition = () => {
1824
2012
  stringPropContext.setValue(value);
1825
2013
  }
1826
2014
  };
1827
- 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, __14("Position", "elementor"))), /* @__PURE__ */ React35.createElement(Grid10, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React35.createElement(
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(
1828
2016
  Select2,
1829
2017
  {
1830
2018
  size: "tiny",
@@ -1832,7 +2020,7 @@ var BackgroundImageOverlayPosition = () => {
1832
2020
  onChange: handlePositionChange,
1833
2021
  fullWidth: true
1834
2022
  },
1835
- backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React35.createElement(MenuItem4, { key: value, value: value ?? "" }, label))
2023
+ backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React35.createElement(MenuItem3, { key: value, value: value ?? "" }, label))
1836
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);
1837
2025
  };
1838
2026
 
@@ -1840,40 +2028,40 @@ var BackgroundImageOverlayPosition = () => {
1840
2028
  import * as React36 from "react";
1841
2029
  import { DotsHorizontalIcon, DotsVerticalIcon, GridDotsIcon, XIcon as XIcon4 } from "@elementor/icons";
1842
2030
  import { Grid as Grid11 } from "@elementor/ui";
1843
- import { __ as __15 } from "@wordpress/i18n";
2031
+ import { __ as __14 } from "@wordpress/i18n";
1844
2032
  var repeatControlOptions = [
1845
2033
  {
1846
2034
  value: "repeat",
1847
- label: __15("Repeat", "elementor"),
2035
+ label: __14("Repeat", "elementor"),
1848
2036
  renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(GridDotsIcon, { fontSize: size }),
1849
2037
  showTooltip: true
1850
2038
  },
1851
2039
  {
1852
2040
  value: "repeat-x",
1853
- label: __15("Repeat-x", "elementor"),
2041
+ label: __14("Repeat-x", "elementor"),
1854
2042
  renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(DotsHorizontalIcon, { fontSize: size }),
1855
2043
  showTooltip: true
1856
2044
  },
1857
2045
  {
1858
2046
  value: "repeat-y",
1859
- label: __15("Repeat-y", "elementor"),
2047
+ label: __14("Repeat-y", "elementor"),
1860
2048
  renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(DotsVerticalIcon, { fontSize: size }),
1861
2049
  showTooltip: true
1862
2050
  },
1863
2051
  {
1864
2052
  value: "no-repeat",
1865
- label: __15("No-Repeat", "elementor"),
2053
+ label: __14("No-repeat", "elementor"),
1866
2054
  renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(XIcon4, { fontSize: size }),
1867
2055
  showTooltip: true
1868
2056
  }
1869
2057
  ];
1870
2058
  var BackgroundImageOverlayRepeat = () => {
1871
- return /* @__PURE__ */ React36.createElement(PopoverGridContainer, null, /* @__PURE__ */ React36.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(ControlLabel, null, __15("Repeat", "elementor"))), /* @__PURE__ */ React36.createElement(Grid11, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React36.createElement(ToggleControl, { options: repeatControlOptions })));
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 })));
1872
2060
  };
1873
2061
 
1874
2062
  // src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
1875
2063
  import * as React37 from "react";
1876
- import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil8 } from "@elementor/editor-props";
2064
+ import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil9 } from "@elementor/editor-props";
1877
2065
  import {
1878
2066
  ArrowBarBothIcon,
1879
2067
  ArrowsMaximizeIcon,
@@ -1883,36 +2071,36 @@ import {
1883
2071
  PencilIcon
1884
2072
  } from "@elementor/icons";
1885
2073
  import { Grid as Grid12 } from "@elementor/ui";
1886
- import { __ as __16 } from "@wordpress/i18n";
2074
+ import { __ as __15 } from "@wordpress/i18n";
1887
2075
  var sizeControlOptions = [
1888
2076
  {
1889
2077
  value: "auto",
1890
- label: __16("Auto", "elementor"),
2078
+ label: __15("Auto", "elementor"),
1891
2079
  renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(LetterAIcon, { fontSize: size }),
1892
2080
  showTooltip: true
1893
2081
  },
1894
2082
  {
1895
2083
  value: "cover",
1896
- label: __16("Cover", "elementor"),
2084
+ label: __15("Cover", "elementor"),
1897
2085
  renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(ArrowsMaximizeIcon, { fontSize: size }),
1898
2086
  showTooltip: true
1899
2087
  },
1900
2088
  {
1901
2089
  value: "contain",
1902
- label: __16("Contain", "elementor"),
2090
+ label: __15("Contain", "elementor"),
1903
2091
  renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(ArrowBarBothIcon, { fontSize: size }),
1904
2092
  showTooltip: true
1905
2093
  },
1906
2094
  {
1907
2095
  value: "custom",
1908
- label: __16("Custom", "elementor"),
2096
+ label: __15("Custom", "elementor"),
1909
2097
  renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(PencilIcon, { fontSize: size }),
1910
2098
  showTooltip: true
1911
2099
  }
1912
2100
  ];
1913
2101
  var BackgroundImageOverlaySize = () => {
1914
2102
  const backgroundImageScaleContext = useBoundProp(backgroundImageSizeScalePropTypeUtil);
1915
- const stringPropContext = useBoundProp(stringPropTypeUtil8);
2103
+ const stringPropContext = useBoundProp(stringPropTypeUtil9);
1916
2104
  const isCustom = !!backgroundImageScaleContext.value;
1917
2105
  const handleSizeChange = (size) => {
1918
2106
  if (size === "custom") {
@@ -1921,7 +2109,7 @@ var BackgroundImageOverlaySize = () => {
1921
2109
  stringPropContext.setValue(size);
1922
2110
  }
1923
2111
  };
1924
- 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, __16("Size", "elementor"))), /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React37.createElement(
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(
1925
2113
  ControlToggleButtonGroup,
1926
2114
  {
1927
2115
  exclusive: true,
@@ -1929,11 +2117,23 @@ var BackgroundImageOverlaySize = () => {
1929
2117
  value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value,
1930
2118
  onChange: handleSizeChange
1931
2119
  }
1932
- )))), isCustom ? /* @__PURE__ */ React37.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(PopoverGridContainer, null, /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React37.createElement(SizeControl, { startIcon: /* @__PURE__ */ React37.createElement(ArrowsMoveHorizontalIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React37.createElement(SizeControl, { startIcon: /* @__PURE__ */ React37.createElement(ArrowsMoveVerticalIcon, { fontSize: "tiny" }) })))))) : null);
2120
+ )))), isCustom ? /* @__PURE__ */ React37.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(PopoverGridContainer, null, /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React37.createElement(
2121
+ SizeControl,
2122
+ {
2123
+ startIcon: /* @__PURE__ */ React37.createElement(ArrowsMoveHorizontalIcon, { fontSize: "tiny" }),
2124
+ extendedValues: ["auto"]
2125
+ }
2126
+ ))), /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React37.createElement(
2127
+ SizeControl,
2128
+ {
2129
+ startIcon: /* @__PURE__ */ React37.createElement(ArrowsMoveVerticalIcon, { fontSize: "tiny" }),
2130
+ extendedValues: ["auto"]
2131
+ }
2132
+ )))))) : null);
1933
2133
  };
1934
2134
 
1935
2135
  // src/controls/background-control/background-overlay/use-background-tabs-history.ts
1936
- import { useRef as useRef3 } from "react";
2136
+ import { useRef as useRef4 } from "react";
1937
2137
  import {
1938
2138
  backgroundColorOverlayPropTypeUtil,
1939
2139
  backgroundImageOverlayPropTypeUtil
@@ -1946,7 +2146,7 @@ var useBackgroundTabsHistory = ({
1946
2146
  const { value: imageValue, setValue: setImageValue } = useBoundProp(backgroundImageOverlayPropTypeUtil);
1947
2147
  const { value: colorValue, setValue: setColorValue } = useBoundProp(backgroundColorOverlayPropTypeUtil);
1948
2148
  const { getTabsProps, getTabProps, getTabPanelProps } = useTabs(colorValue ? "color" : "image");
1949
- const valuesHistory = useRef3({
2149
+ const valuesHistory = useRef4({
1950
2150
  image: initialBackgroundImageOverlay,
1951
2151
  color: initialBackgroundColorOverlay2
1952
2152
  });
@@ -2004,10 +2204,10 @@ var getInitialBackgroundOverlay = () => ({
2004
2204
  }
2005
2205
  });
2006
2206
  var backgroundResolutionOptions = [
2007
- { label: __17("Thumbnail - 150 x 150", "elementor"), value: "thumbnail" },
2008
- { label: __17("Medium - 300 x 300", "elementor"), value: "medium" },
2009
- { label: __17("Large 1024 x 1024", "elementor"), value: "large" },
2010
- { label: __17("Full", "elementor"), value: "full" }
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" }
2011
2211
  ];
2012
2212
  var BackgroundOverlayRepeaterControl = createControl(() => {
2013
2213
  const { propType, value: overlayValues, setValue } = useBoundProp(backgroundOverlayPropTypeUtil);
@@ -2016,7 +2216,7 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
2016
2216
  {
2017
2217
  values: overlayValues ?? [],
2018
2218
  setValues: setValue,
2019
- label: __17("Overlay", "elementor"),
2219
+ label: __16("Overlay", "elementor"),
2020
2220
  itemSettings: {
2021
2221
  Icon: ItemIcon2,
2022
2222
  Label: ItemLabel2,
@@ -2034,7 +2234,7 @@ var Content2 = () => {
2034
2234
  image: getInitialBackgroundOverlay().value,
2035
2235
  color: initialBackgroundColorOverlay.value
2036
2236
  });
2037
- return /* @__PURE__ */ React38.createElement(Box4, { sx: { width: "100%" } }, /* @__PURE__ */ React38.createElement(Box4, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React38.createElement(Tabs, { ...getTabsProps(), "aria-label": __17("Background Overlay", "elementor") }, /* @__PURE__ */ React38.createElement(Tab, { label: __17("Image", "elementor"), ...getTabProps("image") }), /* @__PURE__ */ React38.createElement(Tab, { label: __17("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 })))));
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 })))));
2038
2238
  };
2039
2239
  var ItemIcon2 = ({ value }) => {
2040
2240
  switch (value.$$type) {
@@ -2075,7 +2275,7 @@ var ImageOverlayContent = () => {
2075
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(
2076
2276
  ImageControl,
2077
2277
  {
2078
- resolutionLabel: __17("Resolution", "elementor"),
2278
+ resolutionLabel: __16("Resolution", "elementor"),
2079
2279
  sizes: backgroundResolutionOptions
2080
2280
  }
2081
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)));
@@ -2098,7 +2298,7 @@ var useImage = (image) => {
2098
2298
  // src/controls/background-control/background-control.tsx
2099
2299
  var BackgroundControl = createControl(() => {
2100
2300
  const propContext = useBoundProp(backgroundPropTypeUtil);
2101
- 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, __18("Color", "elementor"))), /* @__PURE__ */ React39.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ColorControl, 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))))));
2102
2302
  });
2103
2303
  export {
2104
2304
  BackgroundControl,