@elementor/editor-controls 4.1.0-782 → 4.1.0-784

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
@@ -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: restoreValue,
1242
+ onBlur: handleBlur,
1237
1243
  onClick: onInputClick,
1238
1244
  popupState,
1239
1245
  min,
@@ -4121,6 +4127,7 @@ var RestrictedLinkInfotip = ({
4121
4127
  {
4122
4128
  color: "secondary",
4123
4129
  icon: /* @__PURE__ */ React68.createElement(InfoCircleFilledIcon, null),
4130
+ size: "small",
4124
4131
  action: /* @__PURE__ */ React68.createElement(
4125
4132
  AlertAction,
4126
4133
  {