@elementor/editor-controls 3.33.0-244 → 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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-controls",
|
|
3
3
|
"description": "This package contains the controls model and utils for the Elementor editor",
|
|
4
|
-
"version": "3.33.0-
|
|
4
|
+
"version": "3.33.0-245",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -40,22 +40,22 @@
|
|
|
40
40
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elementor/editor-current-user": "3.33.0-
|
|
44
|
-
"@elementor/editor-elements": "3.33.0-
|
|
45
|
-
"@elementor/editor-props": "3.33.0-
|
|
46
|
-
"@elementor/editor-responsive": "3.33.0-
|
|
47
|
-
"@elementor/editor-ui": "3.33.0-
|
|
48
|
-
"@elementor/editor-v1-adapters": "3.33.0-
|
|
49
|
-
"@elementor/env": "3.33.0-
|
|
50
|
-
"@elementor/http-client": "3.33.0-
|
|
43
|
+
"@elementor/editor-current-user": "3.33.0-245",
|
|
44
|
+
"@elementor/editor-elements": "3.33.0-245",
|
|
45
|
+
"@elementor/editor-props": "3.33.0-245",
|
|
46
|
+
"@elementor/editor-responsive": "3.33.0-245",
|
|
47
|
+
"@elementor/editor-ui": "3.33.0-245",
|
|
48
|
+
"@elementor/editor-v1-adapters": "3.33.0-245",
|
|
49
|
+
"@elementor/env": "3.33.0-245",
|
|
50
|
+
"@elementor/http-client": "3.33.0-245",
|
|
51
51
|
"@elementor/icons": "1.55.0",
|
|
52
|
-
"@elementor/locations": "3.33.0-
|
|
53
|
-
"@elementor/mixpanel": "3.33.0-
|
|
54
|
-
"@elementor/query": "3.33.0-
|
|
55
|
-
"@elementor/session": "3.33.0-
|
|
52
|
+
"@elementor/locations": "3.33.0-245",
|
|
53
|
+
"@elementor/mixpanel": "3.33.0-245",
|
|
54
|
+
"@elementor/query": "3.33.0-245",
|
|
55
|
+
"@elementor/session": "3.33.0-245",
|
|
56
56
|
"@elementor/ui": "1.36.17",
|
|
57
|
-
"@elementor/utils": "3.33.0-
|
|
58
|
-
"@elementor/wp-media": "3.33.0-
|
|
57
|
+
"@elementor/utils": "3.33.0-245",
|
|
58
|
+
"@elementor/wp-media": "3.33.0-245",
|
|
59
59
|
"@wordpress/i18n": "^5.13.0",
|
|
60
60
|
"@monaco-editor/react": "^4.7.0",
|
|
61
61
|
"dayjs": "^1.11.18",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type RefObject, useEffect
|
|
2
|
+
import { type RefObject, useEffect } from 'react';
|
|
3
3
|
import { type PropType, sizePropTypeUtil, type SizePropValue } from '@elementor/editor-props';
|
|
4
4
|
import { useActiveBreakpoint } from '@elementor/editor-responsive';
|
|
5
5
|
import { usePopupState } from '@elementor/ui';
|
|
@@ -108,7 +108,6 @@ export const SizeControl = createControl(
|
|
|
108
108
|
propType,
|
|
109
109
|
} = useBoundProp( sizePropTypeUtil );
|
|
110
110
|
const actualDefaultUnit = defaultUnit ?? externalPlaceholder?.unit ?? defaultSelectedUnit[ variant ];
|
|
111
|
-
const [ internalState, setInternalState ] = useState( createStateFromSizeProp( sizeValue, actualDefaultUnit ) );
|
|
112
111
|
const activeBreakpoint = useActiveBreakpoint();
|
|
113
112
|
const actualUnits = resolveUnits( propType, enablePropTypeUnits, variant, units );
|
|
114
113
|
|
|
@@ -116,7 +115,7 @@ export const SizeControl = createControl(
|
|
|
116
115
|
const popupState = usePopupState( { variant: 'popover' } );
|
|
117
116
|
|
|
118
117
|
const [ state, setState ] = useSyncExternalState( {
|
|
119
|
-
external:
|
|
118
|
+
external: createStateFromSizeProp( sizeValue, actualDefaultUnit ),
|
|
120
119
|
setExternal: ( newState: State | null, options, meta ) =>
|
|
121
120
|
setSizeValue( extractValueFromState( newState ), options, meta ),
|
|
122
121
|
persistWhen: ( newState ) => !! extractValueFromState( newState ),
|
|
@@ -184,7 +183,7 @@ export const SizeControl = createControl(
|
|
|
184
183
|
}
|
|
185
184
|
|
|
186
185
|
if ( state.unit === newState.unit ) {
|
|
187
|
-
|
|
186
|
+
setState( mergedStates );
|
|
188
187
|
|
|
189
188
|
return;
|
|
190
189
|
}
|