@elementor/editor-controls 0.13.0 → 0.14.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
@@ -289,7 +289,7 @@ var ImageMediaControl = createControl((props) => {
289
289
  startIcon: /* @__PURE__ */ React8.createElement(UploadIcon, null),
290
290
  onClick: () => open({ mode: "upload" })
291
291
  },
292
- __("Upload image", "elementor")
292
+ __("Upload", "elementor")
293
293
  )))));
294
294
  });
295
295
 
@@ -322,7 +322,7 @@ var SelectControl = createControl(({ options, onChange }) => {
322
322
  var ImageControl = createControl(
323
323
  ({ sizes, resolutionLabel = __2("Image resolution", "elementor") }) => {
324
324
  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 }))))));
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("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 }))))));
326
326
  }
327
327
  );
328
328
 
@@ -370,7 +370,7 @@ var TextAreaControl = createControl(({ placeholder }) => {
370
370
 
371
371
  // src/controls/size-control.tsx
372
372
  import * as React14 from "react";
373
- import { sizePropTypeUtil } from "@elementor/editor-props";
373
+ import { sizePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil4 } from "@elementor/editor-props";
374
374
  import { InputAdornment as InputAdornment2 } from "@elementor/ui";
375
375
 
376
376
  // src/components/text-field-inner-selection.tsx
@@ -459,27 +459,74 @@ var useSyncExternalState = ({
459
459
  var defaultUnits = ["px", "%", "em", "rem", "vw", "vh"];
460
460
  var defaultUnit = "px";
461
461
  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
- }));
462
+ var SizeControl = createControl(
463
+ ({ units: units2 = defaultUnits, extendedValues = [], placeholder, startIcon }) => {
464
+ const { value: sizeValue, setValue: setSizeValue } = useBoundProp(sizePropTypeUtil);
465
+ const [state, setState] = useSyncExternalState({
466
+ external: sizeValue,
467
+ setExternal: setSizeValue,
468
+ persistWhen: (controlValue) => !!controlValue?.size || controlValue?.size === 0,
469
+ fallback: (controlValue) => ({ unit: controlValue?.unit || defaultUnit, size: defaultSize })
470
+ });
471
+ const handleUnitChange = (unit) => {
472
+ setState((prev) => ({
473
+ size: prev?.size ?? defaultSize,
474
+ unit
475
+ }));
476
+ };
477
+ const handleSizeChange = (event) => {
478
+ const { value: size } = event.target;
479
+ setState((prev) => ({
480
+ ...prev,
481
+ size: size || size === "0" ? parseFloat(size) : defaultSize
482
+ }));
483
+ };
484
+ const inputProps = {
485
+ size: state.size,
486
+ unit: state.unit,
487
+ placeholder,
488
+ startIcon,
489
+ units: units2,
490
+ extendedValues,
491
+ handleSizeChange,
492
+ handleUnitChange
493
+ };
494
+ if (extendedValues?.length) {
495
+ return /* @__PURE__ */ React14.createElement(ExtendedSizeInput, { ...inputProps });
496
+ }
497
+ return /* @__PURE__ */ React14.createElement(SizeInput, { ...inputProps });
498
+ }
499
+ );
500
+ var ExtendedSizeInput = (props) => {
501
+ const { value: stringValue, setValue: setStringValue } = useBoundProp(stringPropTypeUtil4);
502
+ const { extendedValues = [] } = props;
503
+ const unit = stringValue ?? props.unit;
504
+ const handleUnitChange = (newUnit) => {
505
+ if (extendedValues.includes(newUnit)) {
506
+ setStringValue(newUnit);
507
+ } else {
508
+ props.handleUnitChange(newUnit);
509
+ }
482
510
  };
511
+ return /* @__PURE__ */ React14.createElement(
512
+ SizeInput,
513
+ {
514
+ ...props,
515
+ units: [...props.units, ...extendedValues],
516
+ handleUnitChange,
517
+ unit
518
+ }
519
+ );
520
+ };
521
+ var SizeInput = ({
522
+ units: units2,
523
+ handleUnitChange,
524
+ handleSizeChange,
525
+ placeholder,
526
+ startIcon,
527
+ size,
528
+ unit
529
+ }) => {
483
530
  return /* @__PURE__ */ React14.createElement(ControlActions, null, /* @__PURE__ */ React14.createElement(
484
531
  TextFieldInnerSelection,
485
532
  {
@@ -488,17 +535,17 @@ var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, st
488
535
  {
489
536
  options: units2,
490
537
  onClick: handleUnitChange,
491
- value: state?.unit ?? defaultUnit
538
+ value: unit ?? defaultUnit
492
539
  }
493
540
  ),
494
541
  placeholder,
495
542
  startAdornment: startIcon ? /* @__PURE__ */ React14.createElement(InputAdornment2, { position: "start" }, startIcon) : void 0,
496
543
  type: "number",
497
- value: Number.isNaN(state?.size) ? "" : state?.size,
544
+ value: Number.isNaN(size) ? "" : size,
498
545
  onChange: handleSizeChange
499
546
  }
500
547
  ));
501
- });
548
+ };
502
549
 
503
550
  // src/controls/stroke-control.tsx
504
551
  import * as React17 from "react";
@@ -801,7 +848,8 @@ var RepeaterItem = ({
801
848
  "aria-label": __4("Remove item", "elementor")
802
849
  },
803
850
  /* @__PURE__ */ React21.createElement(XIcon, { fontSize: SIZE })
804
- ))
851
+ )),
852
+ sx: { backgroundColor: "background.paper" }
805
853
  }
806
854
  ), /* @__PURE__ */ React21.createElement(
807
855
  Popover,
@@ -916,7 +964,7 @@ var initialShadow = {
916
964
 
917
965
  // src/controls/toggle-control.tsx
918
966
  import * as React24 from "react";
919
- import { stringPropTypeUtil as stringPropTypeUtil4 } from "@elementor/editor-props";
967
+ import { stringPropTypeUtil as stringPropTypeUtil5 } from "@elementor/editor-props";
920
968
 
921
969
  // src/components/control-toggle-button-group.tsx
922
970
  import * as React23 from "react";
@@ -973,7 +1021,7 @@ var ControlToggleButtonGroup = ({
973
1021
  // src/controls/toggle-control.tsx
974
1022
  var ToggleControl = createControl(
975
1023
  ({ options, fullWidth = false, size = "tiny" }) => {
976
- const { value, setValue } = useBoundProp(stringPropTypeUtil4);
1024
+ const { value, setValue } = useBoundProp(stringPropTypeUtil5);
977
1025
  const handleToggle = (option) => {
978
1026
  setValue(option);
979
1027
  };
@@ -1126,76 +1174,91 @@ import { dimensionsPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil3 } from "@
1126
1174
  import { DetachIcon, LinkIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
1127
1175
  import { Grid as Grid6, Stack as Stack7, ToggleButton as ToggleButton3 } from "@elementor/ui";
1128
1176
  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 }) => {
1177
+ var LinkedDimensionsControl = createControl(
1178
+ ({ label, extendedValues }) => {
1179
+ const {
1180
+ value: dimensionsValue,
1181
+ setValue: setDimensionsValue,
1182
+ propType
1183
+ } = useBoundProp(dimensionsPropTypeUtil);
1184
+ const { value: sizeValue, setValue: setSizeValue } = useBoundProp(sizePropTypeUtil3);
1185
+ const isLinked = !dimensionsValue && !sizeValue ? true : !!sizeValue;
1186
+ const onLinkToggle = () => {
1187
+ if (!isLinked) {
1188
+ setSizeValue(dimensionsValue?.top?.value);
1189
+ return;
1190
+ }
1191
+ const value = sizeValue ? sizePropTypeUtil3.create(sizeValue) : null;
1192
+ setDimensionsValue({
1193
+ top: value,
1194
+ right: value,
1195
+ bottom: value,
1196
+ left: value
1197
+ });
1198
+ };
1199
+ const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
1200
+ 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(
1201
+ ToggleButton3,
1202
+ {
1203
+ "aria-label": __7("Link Inputs", "elementor"),
1204
+ size: "tiny",
1205
+ value: "check",
1206
+ selected: isLinked,
1207
+ sx: { marginLeft: "auto" },
1208
+ onChange: onLinkToggle
1209
+ },
1210
+ /* @__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(
1212
+ Control3,
1213
+ {
1214
+ bind: "top",
1215
+ startIcon: /* @__PURE__ */ React27.createElement(SideTopIcon, { fontSize: "tiny" }),
1216
+ isLinked,
1217
+ extendedValues
1218
+ }
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(
1220
+ Control3,
1221
+ {
1222
+ bind: "right",
1223
+ startIcon: /* @__PURE__ */ React27.createElement(SideRightIcon, { fontSize: "tiny" }),
1224
+ isLinked,
1225
+ extendedValues
1226
+ }
1227
+ )))), /* @__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
+ Control3,
1229
+ {
1230
+ bind: "bottom",
1231
+ startIcon: /* @__PURE__ */ React27.createElement(SideBottomIcon, { fontSize: "tiny" }),
1232
+ isLinked,
1233
+ extendedValues
1234
+ }
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(
1236
+ Control3,
1237
+ {
1238
+ bind: "left",
1239
+ startIcon: /* @__PURE__ */ React27.createElement(SideLeftIcon, { fontSize: "tiny" }),
1240
+ isLinked,
1241
+ extendedValues
1242
+ }
1243
+ )))));
1244
+ }
1245
+ );
1246
+ var Control3 = ({
1247
+ bind,
1248
+ startIcon,
1249
+ isLinked,
1250
+ extendedValues
1251
+ }) => {
1189
1252
  if (isLinked) {
1190
- return /* @__PURE__ */ React27.createElement(SizeControl, { startIcon });
1253
+ return /* @__PURE__ */ React27.createElement(SizeControl, { startIcon, extendedValues });
1191
1254
  }
1192
- return /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React27.createElement(SizeControl, { startIcon }));
1255
+ return /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React27.createElement(SizeControl, { startIcon, extendedValues }));
1193
1256
  };
1194
1257
 
1195
1258
  // src/controls/font-family-control.tsx
1196
1259
  import { Fragment as Fragment4, useId as useId3, useState as useState3 } from "react";
1197
1260
  import * as React28 from "react";
1198
- import { stringPropTypeUtil as stringPropTypeUtil5 } from "@elementor/editor-props";
1261
+ import { stringPropTypeUtil as stringPropTypeUtil6 } from "@elementor/editor-props";
1199
1262
  import { ChevronDownIcon, EditIcon, PhotoIcon, SearchIcon, XIcon as XIcon2 } from "@elementor/icons";
1200
1263
  import {
1201
1264
  bindPopover as bindPopover3,
@@ -1251,7 +1314,7 @@ var useFilteredFontFamilies = (fontFamilies, searchValue) => {
1251
1314
  var SIZE2 = "tiny";
1252
1315
  var FontFamilyControl = createControl(({ fontFamilies }) => {
1253
1316
  const [searchValue, setSearchValue] = useState3("");
1254
- const { value: fontFamily, setValue: setFontFamily } = useBoundProp(stringPropTypeUtil5);
1317
+ const { value: fontFamily, setValue: setFontFamily } = useBoundProp(stringPropTypeUtil6);
1255
1318
  const popupId = useId3();
1256
1319
  const popoverState = usePopupState4({ variant: "popover", popupId });
1257
1320
  const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
@@ -1283,13 +1346,13 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
1283
1346
  ...bindPopover3(popoverState),
1284
1347
  onClose: handleClose
1285
1348
  },
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(
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" }, __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(
1287
1350
  TextField5,
1288
1351
  {
1289
1352
  fullWidth: true,
1290
1353
  size: SIZE2,
1291
1354
  value: searchValue,
1292
- placeholder: __9("Search", "elementor"),
1355
+ placeholder: __9("Search fonts\u2026", "elementor"),
1293
1356
  onChange: handleSearch,
1294
1357
  InputProps: {
1295
1358
  startAdornment: /* @__PURE__ */ React28.createElement(InputAdornment3, { position: "start" }, /* @__PURE__ */ React28.createElement(SearchIcon, { fontSize: SIZE2 }))
@@ -1357,13 +1420,14 @@ import {
1357
1420
  booleanPropTypeUtil,
1358
1421
  linkPropTypeUtil,
1359
1422
  numberPropTypeUtil as numberPropTypeUtil2,
1360
- stringPropTypeUtil as stringPropTypeUtil6,
1423
+ stringPropTypeUtil as stringPropTypeUtil7,
1361
1424
  urlPropTypeUtil as urlPropTypeUtil2
1362
1425
  } from "@elementor/editor-props";
1363
1426
  import { httpService } from "@elementor/http";
1364
1427
  import { MinusIcon, PlusIcon as PlusIcon2 } from "@elementor/icons";
1365
1428
  import { useSessionStorage } from "@elementor/session";
1366
1429
  import { Collapse, Divider as Divider3, Grid as Grid7, IconButton as IconButton4, Stack as Stack9, Switch } from "@elementor/ui";
1430
+ import { debounce } from "@elementor/utils";
1367
1431
  import { __ as __10 } from "@wordpress/i18n";
1368
1432
 
1369
1433
  // src/components/autocomplete.tsx
@@ -1502,7 +1566,7 @@ var LinkControl = createControl((props) => {
1502
1566
  const valueToSave = newValue ? {
1503
1567
  ...value,
1504
1568
  destination: numberPropTypeUtil2.create(newValue),
1505
- label: stringPropTypeUtil6.create(findMatchingOption(options, newValue)?.label || null)
1569
+ label: stringPropTypeUtil7.create(findMatchingOption(options, newValue)?.label || null)
1506
1570
  } : null;
1507
1571
  onSaveNewValue(valueToSave);
1508
1572
  };
@@ -1575,7 +1639,7 @@ var SwitchControl = () => {
1575
1639
  const onClick = () => {
1576
1640
  setValue(!value);
1577
1641
  };
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 })));
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, __10("Open in a new tab", "elementor"))), /* @__PURE__ */ React31.createElement(Grid7, { item: true }, /* @__PURE__ */ React31.createElement(Switch, { checked: value, onClick })));
1579
1643
  };
1580
1644
  async function fetchOptions(ajaxUrl, params) {
1581
1645
  if (!params || !ajaxUrl) {
@@ -1605,15 +1669,6 @@ function generateFirstLoadedOption(unionValue) {
1605
1669
  }
1606
1670
  ] : [];
1607
1671
  }
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
1672
 
1618
1673
  // src/controls/gap-control.tsx
1619
1674
  import * as React32 from "react";
@@ -1631,7 +1686,7 @@ var GapControl = createControl(({ label }) => {
1631
1686
  const isLinked = !directionValue && !sizeValue ? true : !!sizeValue;
1632
1687
  const onLinkToggle = () => {
1633
1688
  if (!isLinked) {
1634
- setSizeValue(directionValue?.column.value);
1689
+ setSizeValue(directionValue?.column?.value);
1635
1690
  return;
1636
1691
  }
1637
1692
  const value = sizeValue ? sizePropTypeUtil4.create(sizeValue) : null;
@@ -1710,7 +1765,7 @@ var SvgMediaControl = createControl(() => {
1710
1765
  });
1711
1766
  }
1712
1767
  });
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(
1768
+ return /* @__PURE__ */ React33.createElement(Stack11, { gap: 1 }, /* @__PURE__ */ React33.createElement(ControlLabel, null, " ", __12("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
1769
  CardMedia2,
1715
1770
  {
1716
1771
  component: "img",
@@ -1745,7 +1800,7 @@ var SvgMediaControl = createControl(() => {
1745
1800
  startIcon: /* @__PURE__ */ React33.createElement(UploadIcon2, null),
1746
1801
  onClick: () => open({ mode: "upload" })
1747
1802
  },
1748
- __12("Upload SVG", "elementor")
1803
+ __12("Upload", "elementor")
1749
1804
  ))
1750
1805
  ))));
1751
1806
  });
@@ -1796,7 +1851,7 @@ var BackgroundImageOverlayAttachment = () => {
1796
1851
 
1797
1852
  // src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
1798
1853
  import * as React35 from "react";
1799
- import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil7 } from "@elementor/editor-props";
1854
+ import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil8 } from "@elementor/editor-props";
1800
1855
  import { LetterXIcon, LetterYIcon } from "@elementor/icons";
1801
1856
  import { Grid as Grid10, MenuItem as MenuItem4, Select as Select2 } from "@elementor/ui";
1802
1857
  import { __ as __14 } from "@wordpress/i18n";
@@ -1814,7 +1869,7 @@ var backgroundPositionOptions = [
1814
1869
  ];
1815
1870
  var BackgroundImageOverlayPosition = () => {
1816
1871
  const backgroundImageOffsetContext = useBoundProp(backgroundImagePositionOffsetPropTypeUtil);
1817
- const stringPropContext = useBoundProp(stringPropTypeUtil7);
1872
+ const stringPropContext = useBoundProp(stringPropTypeUtil8);
1818
1873
  const isCustom = !!backgroundImageOffsetContext.value;
1819
1874
  const handlePositionChange = (event) => {
1820
1875
  const value = event.target.value || null;
@@ -1862,7 +1917,7 @@ var repeatControlOptions = [
1862
1917
  },
1863
1918
  {
1864
1919
  value: "no-repeat",
1865
- label: __15("No-Repeat", "elementor"),
1920
+ label: __15("No-repeat", "elementor"),
1866
1921
  renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(XIcon4, { fontSize: size }),
1867
1922
  showTooltip: true
1868
1923
  }
@@ -1873,7 +1928,7 @@ var BackgroundImageOverlayRepeat = () => {
1873
1928
 
1874
1929
  // src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
1875
1930
  import * as React37 from "react";
1876
- import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil8 } from "@elementor/editor-props";
1931
+ import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil9 } from "@elementor/editor-props";
1877
1932
  import {
1878
1933
  ArrowBarBothIcon,
1879
1934
  ArrowsMaximizeIcon,
@@ -1912,7 +1967,7 @@ var sizeControlOptions = [
1912
1967
  ];
1913
1968
  var BackgroundImageOverlaySize = () => {
1914
1969
  const backgroundImageScaleContext = useBoundProp(backgroundImageSizeScalePropTypeUtil);
1915
- const stringPropContext = useBoundProp(stringPropTypeUtil8);
1970
+ const stringPropContext = useBoundProp(stringPropTypeUtil9);
1916
1971
  const isCustom = !!backgroundImageScaleContext.value;
1917
1972
  const handleSizeChange = (size) => {
1918
1973
  if (size === "custom") {
@@ -1929,7 +1984,19 @@ var BackgroundImageOverlaySize = () => {
1929
1984
  value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value,
1930
1985
  onChange: handleSizeChange
1931
1986
  }
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);
1987
+ )))), 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(
1988
+ SizeControl,
1989
+ {
1990
+ startIcon: /* @__PURE__ */ React37.createElement(ArrowsMoveHorizontalIcon, { fontSize: "tiny" }),
1991
+ extendedValues: ["auto"]
1992
+ }
1993
+ ))), /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React37.createElement(
1994
+ SizeControl,
1995
+ {
1996
+ startIcon: /* @__PURE__ */ React37.createElement(ArrowsMoveVerticalIcon, { fontSize: "tiny" }),
1997
+ extendedValues: ["auto"]
1998
+ }
1999
+ )))))) : null);
1933
2000
  };
1934
2001
 
1935
2002
  // src/controls/background-control/background-overlay/use-background-tabs-history.ts