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