@elementor/editor-variables 4.2.0-881 → 4.2.0-883
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 +12 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/variables-manager/hooks/use-variables-manager-state.ts +18 -2
- package/src/components/variables-manager/ui/variable-table-row.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-variables",
|
|
3
|
-
"version": "4.2.0-
|
|
3
|
+
"version": "4.2.0-883",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -39,22 +39,22 @@
|
|
|
39
39
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@elementor/editor": "4.2.0-
|
|
43
|
-
"@elementor/editor-canvas": "4.2.0-
|
|
44
|
-
"@elementor/editor-controls": "4.2.0-
|
|
45
|
-
"@elementor/editor-current-user": "4.2.0-
|
|
46
|
-
"@elementor/editor-mcp": "4.2.0-
|
|
47
|
-
"@elementor/editor-panels": "4.2.0-
|
|
48
|
-
"@elementor/editor-props": "4.2.0-
|
|
49
|
-
"@elementor/editor-ui": "4.2.0-
|
|
50
|
-
"@elementor/editor-v1-adapters": "4.2.0-
|
|
51
|
-
"@elementor/menus": "4.2.0-
|
|
52
|
-
"@elementor/http-client": "4.2.0-
|
|
42
|
+
"@elementor/editor": "4.2.0-883",
|
|
43
|
+
"@elementor/editor-canvas": "4.2.0-883",
|
|
44
|
+
"@elementor/editor-controls": "4.2.0-883",
|
|
45
|
+
"@elementor/editor-current-user": "4.2.0-883",
|
|
46
|
+
"@elementor/editor-mcp": "4.2.0-883",
|
|
47
|
+
"@elementor/editor-panels": "4.2.0-883",
|
|
48
|
+
"@elementor/editor-props": "4.2.0-883",
|
|
49
|
+
"@elementor/editor-ui": "4.2.0-883",
|
|
50
|
+
"@elementor/editor-v1-adapters": "4.2.0-883",
|
|
51
|
+
"@elementor/menus": "4.2.0-883",
|
|
52
|
+
"@elementor/http-client": "4.2.0-883",
|
|
53
53
|
"@elementor/icons": "~1.75.1",
|
|
54
|
-
"@elementor/events": "4.2.0-
|
|
55
|
-
"@elementor/schema": "4.2.0-
|
|
54
|
+
"@elementor/events": "4.2.0-883",
|
|
55
|
+
"@elementor/schema": "4.2.0-883",
|
|
56
56
|
"@elementor/ui": "1.37.5",
|
|
57
|
-
"@elementor/utils": "4.2.0-
|
|
57
|
+
"@elementor/utils": "4.2.0-883",
|
|
58
58
|
"@wordpress/i18n": "^5.13.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
@@ -33,8 +33,24 @@ export const useVariablesManagerState = () => {
|
|
|
33
33
|
|
|
34
34
|
const handleOnChange = useCallback(
|
|
35
35
|
( newVariables: TVariablesList ) => {
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
const hasChanges = Object.entries( newVariables ).some( ( [ id, newVar ] ) => {
|
|
37
|
+
const existingVar = variables[ id ];
|
|
38
|
+
if ( ! existingVar ) {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
return (
|
|
42
|
+
existingVar.label !== newVar.label ||
|
|
43
|
+
existingVar.value !== newVar.value ||
|
|
44
|
+
existingVar.order !== newVar.order ||
|
|
45
|
+
existingVar.type !== newVar.type ||
|
|
46
|
+
( existingVar.sync_to_v3 ?? false ) !== ( newVar.sync_to_v3 ?? false )
|
|
47
|
+
);
|
|
48
|
+
} );
|
|
49
|
+
|
|
50
|
+
if ( hasChanges ) {
|
|
51
|
+
setVariables( { ...variables, ...newVariables } );
|
|
52
|
+
setIsDirty( true );
|
|
53
|
+
}
|
|
38
54
|
},
|
|
39
55
|
[ variables ]
|
|
40
56
|
);
|
|
@@ -162,7 +162,7 @@ export const VariableRow = (
|
|
|
162
162
|
value,
|
|
163
163
|
onChange,
|
|
164
164
|
onPropTypeKeyChange: ( type ) => {
|
|
165
|
-
if ( ! isDisabled ) {
|
|
165
|
+
if ( ! isDisabled && type !== row.type ) {
|
|
166
166
|
handleOnChange( {
|
|
167
167
|
...variables,
|
|
168
168
|
[ row.id ]: { ...variables[ row.id ], type },
|