@elementor/editor-controls 3.33.0-250 → 3.33.0-252
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 +16 -16
- package/src/controls/size-control.tsx +4 -3
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-252",
|
|
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-
|
|
51
|
-
"@elementor/icons": "1.
|
|
52
|
-
"@elementor/locations": "3.33.0-
|
|
53
|
-
"@elementor/mixpanel": "3.33.0-
|
|
54
|
-
"@elementor/query": "3.33.0-
|
|
55
|
-
"@elementor/session": "3.33.0-
|
|
43
|
+
"@elementor/editor-current-user": "3.33.0-252",
|
|
44
|
+
"@elementor/editor-elements": "3.33.0-252",
|
|
45
|
+
"@elementor/editor-props": "3.33.0-252",
|
|
46
|
+
"@elementor/editor-responsive": "3.33.0-252",
|
|
47
|
+
"@elementor/editor-ui": "3.33.0-252",
|
|
48
|
+
"@elementor/editor-v1-adapters": "3.33.0-252",
|
|
49
|
+
"@elementor/env": "3.33.0-252",
|
|
50
|
+
"@elementor/http-client": "3.33.0-252",
|
|
51
|
+
"@elementor/icons": "^1.61.0",
|
|
52
|
+
"@elementor/locations": "3.33.0-252",
|
|
53
|
+
"@elementor/mixpanel": "3.33.0-252",
|
|
54
|
+
"@elementor/query": "3.33.0-252",
|
|
55
|
+
"@elementor/session": "3.33.0-252",
|
|
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-252",
|
|
58
|
+
"@elementor/wp-media": "3.33.0-252",
|
|
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 } from 'react';
|
|
2
|
+
import { type RefObject, useEffect, useState } 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,6 +108,7 @@ 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 ) );
|
|
111
112
|
const activeBreakpoint = useActiveBreakpoint();
|
|
112
113
|
const actualUnits = resolveUnits( propType, enablePropTypeUnits, variant, units );
|
|
113
114
|
|
|
@@ -115,7 +116,7 @@ export const SizeControl = createControl(
|
|
|
115
116
|
const popupState = usePopupState( { variant: 'popover' } );
|
|
116
117
|
|
|
117
118
|
const [ state, setState ] = useSyncExternalState( {
|
|
118
|
-
external:
|
|
119
|
+
external: internalState,
|
|
119
120
|
setExternal: ( newState: State | null, options, meta ) =>
|
|
120
121
|
setSizeValue( extractValueFromState( newState ), options, meta ),
|
|
121
122
|
persistWhen: ( newState ) => !! extractValueFromState( newState ),
|
|
@@ -183,7 +184,7 @@ export const SizeControl = createControl(
|
|
|
183
184
|
}
|
|
184
185
|
|
|
185
186
|
if ( state.unit === newState.unit ) {
|
|
186
|
-
|
|
187
|
+
setInternalState( mergedStates );
|
|
187
188
|
|
|
188
189
|
return;
|
|
189
190
|
}
|