@elementor/editor-controls 4.1.0-781 → 4.1.0-783

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.d.mts CHANGED
@@ -358,9 +358,10 @@ type RepeatableControlProps = {
358
358
  patternLabel?: string;
359
359
  placeholder?: string;
360
360
  propKey?: string;
361
+ isSortable?: boolean;
361
362
  addItemTooltipProps?: TooltipAddItemActionProps;
362
363
  };
363
- declare const RepeatableControl: ControlComponent$1<({ repeaterLabel, childControlConfig, showDuplicate, showToggle, initialValues, patternLabel, placeholder, propKey, addItemTooltipProps, }: RepeatableControlProps) => React$1.JSX.Element | null>;
364
+ declare const RepeatableControl: ControlComponent$1<({ repeaterLabel, childControlConfig, showDuplicate, showToggle, initialValues, patternLabel, placeholder, propKey, isSortable, addItemTooltipProps, }: RepeatableControlProps) => React$1.JSX.Element | null>;
364
365
 
365
366
  type KeyValueControlProps = {
366
367
  keyName?: string;
package/dist/index.d.ts CHANGED
@@ -358,9 +358,10 @@ type RepeatableControlProps = {
358
358
  patternLabel?: string;
359
359
  placeholder?: string;
360
360
  propKey?: string;
361
+ isSortable?: boolean;
361
362
  addItemTooltipProps?: TooltipAddItemActionProps;
362
363
  };
363
- declare const RepeatableControl: ControlComponent$1<({ repeaterLabel, childControlConfig, showDuplicate, showToggle, initialValues, patternLabel, placeholder, propKey, addItemTooltipProps, }: RepeatableControlProps) => React$1.JSX.Element | null>;
364
+ declare const RepeatableControl: ControlComponent$1<({ repeaterLabel, childControlConfig, showDuplicate, showToggle, initialValues, patternLabel, placeholder, propKey, isSortable, addItemTooltipProps, }: RepeatableControlProps) => React$1.JSX.Element | null>;
364
365
 
365
366
  type KeyValueControlProps = {
366
367
  keyName?: string;
package/dist/index.js CHANGED
@@ -1279,7 +1279,7 @@ var SizeControl = createControl(
1279
1279
  const actualUnits = resolveUnits(propType, enablePropTypeUnits, variant, units2, actualExtendedOptions);
1280
1280
  const popupState = (0, import_ui14.usePopupState)({ variant: "popover" });
1281
1281
  const memorizedExternalState = (0, import_react14.useMemo)(
1282
- () => createStateFromSizeProp(sizeValue, actualDefaultUnit),
1282
+ () => sizeValue ? createStateFromSizeProp(sizeValue, actualDefaultUnit) : null,
1283
1283
  [sizeValue, actualDefaultUnit]
1284
1284
  );
1285
1285
  const [state, setState] = useSyncExternalState({
@@ -1293,6 +1293,12 @@ var SizeControl = createControl(
1293
1293
  })
1294
1294
  });
1295
1295
  const { size: controlSize = DEFAULT_SIZE, unit: controlUnit = actualDefaultUnit } = extractValueFromState(state, true) || {};
1296
+ const handleBlur = () => {
1297
+ if (!extractValueFromState(state)) {
1298
+ setState((prev) => ({ ...prev, unit: actualDefaultUnit }));
1299
+ }
1300
+ restoreValue();
1301
+ };
1296
1302
  const handleUnitChange = (newUnit) => {
1297
1303
  if (newUnit === "custom") {
1298
1304
  popupState.open(anchorRef?.current);
@@ -1340,7 +1346,7 @@ var SizeControl = createControl(
1340
1346
  startIcon,
1341
1347
  handleSizeChange,
1342
1348
  handleUnitChange,
1343
- onBlur: restoreValue,
1349
+ onBlur: handleBlur,
1344
1350
  onClick: onInputClick,
1345
1351
  popupState,
1346
1352
  min,
@@ -5741,6 +5747,7 @@ var RepeatableControl = createControl(
5741
5747
  patternLabel,
5742
5748
  placeholder,
5743
5749
  propKey,
5750
+ isSortable,
5744
5751
  addItemTooltipProps
5745
5752
  }) => {
5746
5753
  const { propTypeUtil: childPropTypeUtil, isItemDisabled: isItemDisabled2 } = childControlConfig;
@@ -5760,6 +5767,7 @@ var RepeatableControl = createControl(
5760
5767
  [childControlConfig, placeholder, patternLabel]
5761
5768
  );
5762
5769
  const { propType, value, setValue } = useBoundProp(childArrayPropTypeUtil2);
5770
+ const newItemIndex = addItemTooltipProps?.newItemIndex === null ? void 0 : 0;
5763
5771
  return /* @__PURE__ */ React87.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React87.createElement(RepeatableControlContext.Provider, { value: contextValue }, /* @__PURE__ */ React87.createElement(
5764
5772
  ControlRepeater,
5765
5773
  {
@@ -5771,11 +5779,11 @@ var RepeatableControl = createControl(
5771
5779
  TooltipAddItemAction,
5772
5780
  {
5773
5781
  ...addItemTooltipProps,
5774
- newItemIndex: 0,
5782
+ newItemIndex,
5775
5783
  ariaLabel: repeaterLabel
5776
5784
  }
5777
5785
  )),
5778
- /* @__PURE__ */ React87.createElement(ItemsContainer, { isSortable: false }, /* @__PURE__ */ React87.createElement(
5786
+ /* @__PURE__ */ React87.createElement(ItemsContainer, { isSortable }, /* @__PURE__ */ React87.createElement(
5779
5787
  Item,
5780
5788
  {
5781
5789
  Icon: ItemIcon3,