@elementor/editor-controls 4.3.0-965 → 4.3.0-966

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
@@ -779,11 +779,11 @@ function useTypingBuffer(options = {}) {
779
779
  var lengthUnits = ["px", "%", "em", "rem", "vw", "vh", "ch"];
780
780
  var angleUnits = ["deg", "rad", "grad", "turn"];
781
781
  var timeUnits = ["s", "ms"];
782
- var defaultExtendedOptions = ["auto", "custom"];
783
782
  var DEFAULT_UNIT = "px";
784
783
  var DEFAULT_SIZE = NaN;
784
+ var extendedOptions = ["auto", "custom"];
785
785
  function isUnitExtendedOption(unit) {
786
- return defaultExtendedOptions.includes(unit);
786
+ return extendedOptions.includes(unit);
787
787
  }
788
788
 
789
789
  // src/components/size-control/text-field-inner-selection.tsx
@@ -1121,13 +1121,13 @@ var TextFieldPopover = (props) => {
1121
1121
  import { useMemo } from "react";
1122
1122
  function useSizeExtendedOptions(options, disableCustom) {
1123
1123
  return useMemo(() => {
1124
- const extendedOptions = [...options];
1125
- if (!disableCustom && !extendedOptions.includes("custom")) {
1126
- extendedOptions.push("custom");
1124
+ const extendedOptions2 = [...options];
1125
+ if (!disableCustom && !extendedOptions2.includes("custom")) {
1126
+ extendedOptions2.push("custom");
1127
1127
  } else if (options.includes("custom")) {
1128
- extendedOptions.splice(extendedOptions.indexOf("custom"), 1);
1128
+ extendedOptions2.splice(extendedOptions2.indexOf("custom"), 1);
1129
1129
  }
1130
- return extendedOptions;
1130
+ return extendedOptions2;
1131
1131
  }, [options, disableCustom]);
1132
1132
  }
1133
1133
 
@@ -1164,6 +1164,11 @@ var useSyncExternalState = ({
1164
1164
  return [internal, setInternalValue];
1165
1165
  };
1166
1166
 
1167
+ // src/controls/size-control/utils/settings/get-prop-type-settings.ts
1168
+ var getPropTypeSettings = (propType) => {
1169
+ return propType.settings;
1170
+ };
1171
+
1167
1172
  // src/controls/size-control.tsx
1168
1173
  var defaultSelectedUnit = {
1169
1174
  length: "px",
@@ -1184,7 +1189,7 @@ var SizeControl = createControl(
1184
1189
  placeholder,
1185
1190
  startIcon,
1186
1191
  anchorRef,
1187
- extendedOptions,
1192
+ extendedOptions: extendedOptions2,
1188
1193
  disableCustom,
1189
1194
  min = 0,
1190
1195
  enablePropTypeUnits = false,
@@ -1201,7 +1206,7 @@ var SizeControl = createControl(
1201
1206
  } = useBoundProp(sizePropTypeUtil2);
1202
1207
  const actualDefaultUnit = defaultUnit ?? externalPlaceholder?.unit ?? defaultSelectedUnit[variant];
1203
1208
  const activeBreakpoint = useActiveBreakpoint();
1204
- const actualExtendedOptions = useSizeExtendedOptions(extendedOptions || [], disableCustom ?? false);
1209
+ const actualExtendedOptions = useSizeExtendedOptions(extendedOptions2 || [], disableCustom ?? false);
1205
1210
  const actualUnits = resolveUnits(propType, enablePropTypeUnits, variant, units2, actualExtendedOptions);
1206
1211
  const popupState = usePopupState2({ variant: "popover" });
1207
1212
  const memorizedExternalState = useMemo2(
@@ -1290,7 +1295,7 @@ function resolveUnits(propType, enablePropTypeUnits, variant, externalUnits, act
1290
1295
  if (!enablePropTypeUnits) {
1291
1296
  return [...externalUnits ?? fallback, ...actualExtendedOptions || []];
1292
1297
  }
1293
- return propType.settings?.available_units ?? fallback;
1298
+ return getPropTypeSettings(propType)?.available_units ?? fallback;
1294
1299
  }
1295
1300
  function formatSize(size, unit) {
1296
1301
  if (isUnitExtendedOption(unit)) {
@@ -3626,11 +3631,6 @@ var resolvePlaceholder = (placeholder) => {
3626
3631
  return typeof size === "number" ? size.toString() : size;
3627
3632
  };
3628
3633
 
3629
- // src/controls/size-control/utils/settings/get-prop-type-settings.ts
3630
- var getPropTypeSettings = (propType) => {
3631
- return propType.settings;
3632
- };
3633
-
3634
3634
  // src/controls/size-control/utils/settings/get-default-unit.ts
3635
3635
  var getDefaultUnit = (propType) => {
3636
3636
  return getPropTypeSettings(propType)?.default_unit;