@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 +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +12 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/controls/repeatable-control.tsx +5 -2
- package/src/controls/size-control.tsx +10 -2
package/dist/index.mjs
CHANGED
|
@@ -1172,7 +1172,7 @@ var SizeControl = createControl(
|
|
|
1172
1172
|
const actualUnits = resolveUnits(propType, enablePropTypeUnits, variant, units2, actualExtendedOptions);
|
|
1173
1173
|
const popupState = usePopupState2({ variant: "popover" });
|
|
1174
1174
|
const memorizedExternalState = useMemo2(
|
|
1175
|
-
() => createStateFromSizeProp(sizeValue, actualDefaultUnit),
|
|
1175
|
+
() => sizeValue ? createStateFromSizeProp(sizeValue, actualDefaultUnit) : null,
|
|
1176
1176
|
[sizeValue, actualDefaultUnit]
|
|
1177
1177
|
);
|
|
1178
1178
|
const [state, setState] = useSyncExternalState({
|
|
@@ -1186,6 +1186,12 @@ var SizeControl = createControl(
|
|
|
1186
1186
|
})
|
|
1187
1187
|
});
|
|
1188
1188
|
const { size: controlSize = DEFAULT_SIZE, unit: controlUnit = actualDefaultUnit } = extractValueFromState(state, true) || {};
|
|
1189
|
+
const handleBlur = () => {
|
|
1190
|
+
if (!extractValueFromState(state)) {
|
|
1191
|
+
setState((prev) => ({ ...prev, unit: actualDefaultUnit }));
|
|
1192
|
+
}
|
|
1193
|
+
restoreValue();
|
|
1194
|
+
};
|
|
1189
1195
|
const handleUnitChange = (newUnit) => {
|
|
1190
1196
|
if (newUnit === "custom") {
|
|
1191
1197
|
popupState.open(anchorRef?.current);
|
|
@@ -1233,7 +1239,7 @@ var SizeControl = createControl(
|
|
|
1233
1239
|
startIcon,
|
|
1234
1240
|
handleSizeChange,
|
|
1235
1241
|
handleUnitChange,
|
|
1236
|
-
onBlur:
|
|
1242
|
+
onBlur: handleBlur,
|
|
1237
1243
|
onClick: onInputClick,
|
|
1238
1244
|
popupState,
|
|
1239
1245
|
min,
|
|
@@ -5710,6 +5716,7 @@ var RepeatableControl = createControl(
|
|
|
5710
5716
|
patternLabel,
|
|
5711
5717
|
placeholder,
|
|
5712
5718
|
propKey,
|
|
5719
|
+
isSortable,
|
|
5713
5720
|
addItemTooltipProps
|
|
5714
5721
|
}) => {
|
|
5715
5722
|
const { propTypeUtil: childPropTypeUtil, isItemDisabled: isItemDisabled2 } = childControlConfig;
|
|
@@ -5729,6 +5736,7 @@ var RepeatableControl = createControl(
|
|
|
5729
5736
|
[childControlConfig, placeholder, patternLabel]
|
|
5730
5737
|
);
|
|
5731
5738
|
const { propType, value, setValue } = useBoundProp(childArrayPropTypeUtil2);
|
|
5739
|
+
const newItemIndex = addItemTooltipProps?.newItemIndex === null ? void 0 : 0;
|
|
5732
5740
|
return /* @__PURE__ */ React87.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React87.createElement(RepeatableControlContext.Provider, { value: contextValue }, /* @__PURE__ */ React87.createElement(
|
|
5733
5741
|
ControlRepeater,
|
|
5734
5742
|
{
|
|
@@ -5740,11 +5748,11 @@ var RepeatableControl = createControl(
|
|
|
5740
5748
|
TooltipAddItemAction,
|
|
5741
5749
|
{
|
|
5742
5750
|
...addItemTooltipProps,
|
|
5743
|
-
newItemIndex
|
|
5751
|
+
newItemIndex,
|
|
5744
5752
|
ariaLabel: repeaterLabel
|
|
5745
5753
|
}
|
|
5746
5754
|
)),
|
|
5747
|
-
/* @__PURE__ */ React87.createElement(ItemsContainer, { isSortable
|
|
5755
|
+
/* @__PURE__ */ React87.createElement(ItemsContainer, { isSortable }, /* @__PURE__ */ React87.createElement(
|
|
5748
5756
|
Item,
|
|
5749
5757
|
{
|
|
5750
5758
|
Icon: ItemIcon3,
|