@elementor/editor-controls 3.33.0-249 → 3.33.0-251
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.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -39
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/controls/size-control.tsx +4 -3
package/dist/index.js
CHANGED
|
@@ -1031,12 +1031,13 @@ var SizeControl = createControl(
|
|
|
1031
1031
|
propType
|
|
1032
1032
|
} = useBoundProp(import_editor_props7.sizePropTypeUtil);
|
|
1033
1033
|
const actualDefaultUnit = defaultUnit ?? externalPlaceholder?.unit ?? defaultSelectedUnit[variant];
|
|
1034
|
+
const [internalState, setInternalState] = (0, import_react13.useState)(createStateFromSizeProp(sizeValue, actualDefaultUnit));
|
|
1034
1035
|
const activeBreakpoint = (0, import_editor_responsive.useActiveBreakpoint)();
|
|
1035
1036
|
const actualUnits = resolveUnits(propType, enablePropTypeUnits, variant, units2);
|
|
1036
1037
|
const actualExtendedOptions = useSizeExtendedOptions(extendedOptions || [], disableCustom ?? false);
|
|
1037
1038
|
const popupState = (0, import_ui13.usePopupState)({ variant: "popover" });
|
|
1038
1039
|
const [state, setState] = useSyncExternalState({
|
|
1039
|
-
external:
|
|
1040
|
+
external: internalState,
|
|
1040
1041
|
setExternal: (newState, options, meta) => setSizeValue(extractValueFromState(newState), options, meta),
|
|
1041
1042
|
persistWhen: (newState) => !!extractValueFromState(newState),
|
|
1042
1043
|
fallback: (newState) => ({
|
|
@@ -1091,7 +1092,7 @@ var SizeControl = createControl(
|
|
|
1091
1092
|
return;
|
|
1092
1093
|
}
|
|
1093
1094
|
if (state.unit === newState.unit) {
|
|
1094
|
-
|
|
1095
|
+
setInternalState(mergedStates);
|
|
1095
1096
|
return;
|
|
1096
1097
|
}
|
|
1097
1098
|
setState(newState);
|