@elementor/editor-controls 3.35.0-393 → 3.35.0-395

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/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.35.0-393",
4
+ "version": "3.35.0-395",
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.35.0-393",
44
- "@elementor/editor-elements": "3.35.0-393",
45
- "@elementor/editor-props": "3.35.0-393",
46
- "@elementor/editor-responsive": "3.35.0-393",
47
- "@elementor/editor-ui": "3.35.0-393",
48
- "@elementor/editor-v1-adapters": "3.35.0-393",
49
- "@elementor/env": "3.35.0-393",
50
- "@elementor/http-client": "3.35.0-393",
43
+ "@elementor/editor-current-user": "3.35.0-395",
44
+ "@elementor/editor-elements": "3.35.0-395",
45
+ "@elementor/editor-props": "3.35.0-395",
46
+ "@elementor/editor-responsive": "3.35.0-395",
47
+ "@elementor/editor-ui": "3.35.0-395",
48
+ "@elementor/editor-v1-adapters": "3.35.0-395",
49
+ "@elementor/env": "3.35.0-395",
50
+ "@elementor/http-client": "3.35.0-395",
51
51
  "@elementor/icons": "^1.63.0",
52
- "@elementor/locations": "3.35.0-393",
53
- "@elementor/mixpanel": "3.35.0-393",
54
- "@elementor/query": "3.35.0-393",
55
- "@elementor/session": "3.35.0-393",
52
+ "@elementor/locations": "3.35.0-395",
53
+ "@elementor/mixpanel": "3.35.0-395",
54
+ "@elementor/query": "3.35.0-395",
55
+ "@elementor/session": "3.35.0-395",
56
56
  "@elementor/ui": "1.36.17",
57
- "@elementor/utils": "3.35.0-393",
58
- "@elementor/wp-media": "3.35.0-393",
57
+ "@elementor/utils": "3.35.0-395",
58
+ "@elementor/wp-media": "3.35.0-395",
59
59
  "@wordpress/i18n": "^5.13.0",
60
60
  "@monaco-editor/react": "^4.7.0",
61
61
  "dayjs": "^1.11.18",
@@ -65,33 +65,33 @@ export function EqualUnequalSizesControl< TMultiPropType extends string, TPropVa
65
65
  const derivedValue = getMultiSizeValues( masterValue ) as unknown as TPropValue;
66
66
  const derivedPlaceholder = getMultiSizeValues( masterPlaceholder ) as unknown as TPropValue;
67
67
 
68
- const isEqualValues = ( values: ReturnType< typeof multiSizePropTypeUtil.create > ) => {
68
+ const isEqualValues = ( values: TPropValue | null ) => {
69
69
  if ( ! values ) {
70
70
  return true;
71
71
  }
72
72
 
73
+ const multiSizeValue = multiSizePropTypeUtil.create( values );
74
+
73
75
  const propValue: MultiSizePropValue = {};
74
76
 
75
77
  items.forEach( ( item ) => {
76
- propValue[ item.bind ] = values?.value?.[ item.bind ] ?? null;
78
+ propValue[ item.bind ] = multiSizeValue?.value?.[ item.bind ] ?? null;
77
79
  } );
78
80
 
79
81
  const allValues = Object.values( propValue ).map( ( value ) => JSON.stringify( value ) );
80
82
  return allValues.every( ( value ) => value === allValues[ 0 ] );
81
83
  };
82
84
 
83
- const isMixedPlaceholder = ! masterValue && ! isEqualValues( multiSizePropTypeUtil.create( derivedPlaceholder ) );
84
- const isMixed = isMixedPlaceholder || ! isEqualValues( multiSizePropTypeUtil.create( derivedValue ) );
85
+ const isMixedPlaceholder = ! masterValue && ! isEqualValues( derivedPlaceholder );
86
+ const isMixed = isMixedPlaceholder || ! isEqualValues( derivedValue );
85
87
 
86
88
  const applyMultiSizeValue = ( newValue: TPropValue ) => {
87
- const newPropValue = multiSizePropTypeUtil.create( newValue );
88
-
89
- if ( isEqualValues( newPropValue ) ) {
90
- setMasterValue( Object.values( newValue )?.pop() ?? null );
89
+ if ( ! isEqualValues( newValue ) ) {
90
+ setMasterValue( multiSizePropTypeUtil.create( newValue ) );
91
91
  return;
92
92
  }
93
93
 
94
- setMasterValue( newPropValue );
94
+ setMasterValue( Object.values( newValue )?.pop() ?? null );
95
95
  };
96
96
 
97
97
  return (