@elementor/editor-canvas 3.35.0-347 → 3.35.0-349

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 CHANGED
@@ -787,27 +787,29 @@ function createPropsResolver({ transformers, schema: initialSchema, onPropResolv
787
787
  if (!(0, import_editor_props3.isTransformable)(value)) {
788
788
  return value;
789
789
  }
790
+ let transformablePropType = type;
790
791
  if (type.kind === "union") {
791
- type = type.prop_types[value.$$type];
792
- if (!type) {
792
+ transformablePropType = type.prop_types[value.$$type];
793
+ if (!transformablePropType) {
793
794
  return null;
794
795
  }
795
796
  }
796
- if (value.$$type !== type.key) {
797
+ transformablePropType = transformablePropType;
798
+ if (value.$$type !== transformablePropType.key) {
797
799
  return null;
798
800
  }
799
801
  let resolvedValue = value.value;
800
- if (type.kind === "object") {
802
+ if (transformablePropType.kind === "object") {
801
803
  resolvedValue = await resolve({
802
804
  props: resolvedValue,
803
- schema: type.shape,
805
+ schema: transformablePropType.shape,
804
806
  signal
805
807
  });
806
808
  }
807
- if (type.kind === "array") {
809
+ if (transformablePropType.kind === "array") {
808
810
  resolvedValue = await Promise.all(
809
811
  resolvedValue.map(
810
- (item) => transform({ value: item, key, type: type.item_prop_type, depth, signal })
812
+ (item) => transform({ value: item, key, type: transformablePropType.item_prop_type, depth, signal })
811
813
  )
812
814
  );
813
815
  }
package/dist/index.mjs CHANGED
@@ -750,27 +750,29 @@ function createPropsResolver({ transformers, schema: initialSchema, onPropResolv
750
750
  if (!isTransformable(value)) {
751
751
  return value;
752
752
  }
753
+ let transformablePropType = type;
753
754
  if (type.kind === "union") {
754
- type = type.prop_types[value.$$type];
755
- if (!type) {
755
+ transformablePropType = type.prop_types[value.$$type];
756
+ if (!transformablePropType) {
756
757
  return null;
757
758
  }
758
759
  }
759
- if (value.$$type !== type.key) {
760
+ transformablePropType = transformablePropType;
761
+ if (value.$$type !== transformablePropType.key) {
760
762
  return null;
761
763
  }
762
764
  let resolvedValue = value.value;
763
- if (type.kind === "object") {
765
+ if (transformablePropType.kind === "object") {
764
766
  resolvedValue = await resolve({
765
767
  props: resolvedValue,
766
- schema: type.shape,
768
+ schema: transformablePropType.shape,
767
769
  signal
768
770
  });
769
771
  }
770
- if (type.kind === "array") {
772
+ if (transformablePropType.kind === "array") {
771
773
  resolvedValue = await Promise.all(
772
774
  resolvedValue.map(
773
- (item) => transform({ value: item, key, type: type.item_prop_type, depth, signal })
775
+ (item) => transform({ value: item, key, type: transformablePropType.item_prop_type, depth, signal })
774
776
  )
775
777
  );
776
778
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elementor/editor-canvas",
3
3
  "description": "Elementor Editor Canvas",
4
- "version": "3.35.0-347",
4
+ "version": "3.35.0-349",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -37,23 +37,23 @@
37
37
  "react-dom": "^18.3.1"
38
38
  },
39
39
  "dependencies": {
40
- "@elementor/editor": "3.35.0-347",
41
- "@elementor/editor-controls": "3.35.0-347",
42
- "@elementor/editor-documents": "3.35.0-347",
43
- "@elementor/editor-elements": "3.35.0-347",
44
- "@elementor/editor-interactions": "3.35.0-347",
45
- "@elementor/editor-notifications": "3.35.0-347",
46
- "@elementor/editor-props": "3.35.0-347",
47
- "@elementor/editor-responsive": "3.35.0-347",
48
- "@elementor/editor-styles": "3.35.0-347",
49
- "@elementor/editor-styles-repository": "3.35.0-347",
50
- "@elementor/editor-v1-adapters": "3.35.0-347",
51
- "@elementor/editor-mcp": "3.35.0-347",
52
- "@elementor/schema": "3.35.0-347",
53
- "@elementor/twing": "3.35.0-347",
40
+ "@elementor/editor": "3.35.0-349",
41
+ "@elementor/editor-controls": "3.35.0-349",
42
+ "@elementor/editor-documents": "3.35.0-349",
43
+ "@elementor/editor-elements": "3.35.0-349",
44
+ "@elementor/editor-interactions": "3.35.0-349",
45
+ "@elementor/editor-notifications": "3.35.0-349",
46
+ "@elementor/editor-props": "3.35.0-349",
47
+ "@elementor/editor-responsive": "3.35.0-349",
48
+ "@elementor/editor-styles": "3.35.0-349",
49
+ "@elementor/editor-styles-repository": "3.35.0-349",
50
+ "@elementor/editor-v1-adapters": "3.35.0-349",
51
+ "@elementor/editor-mcp": "3.35.0-349",
52
+ "@elementor/schema": "3.35.0-349",
53
+ "@elementor/twing": "3.35.0-349",
54
54
  "@elementor/ui": "1.36.17",
55
- "@elementor/utils": "3.35.0-347",
56
- "@elementor/wp-media": "3.35.0-347",
55
+ "@elementor/utils": "3.35.0-349",
56
+ "@elementor/wp-media": "3.35.0-349",
57
57
  "@floating-ui/react": "^0.27.5",
58
58
  "@wordpress/i18n": "^5.13.0"
59
59
  },
@@ -6,6 +6,7 @@ import {
6
6
  type PropsSchema,
7
7
  type PropType,
8
8
  type PropValue,
9
+ type TransformablePropType,
9
10
  } from '@elementor/editor-props';
10
11
 
11
12
  import { type TransformersRegistry } from '../transformers/create-transformers-registry';
@@ -83,33 +84,37 @@ export function createPropsResolver( { transformers, schema: initialSchema, onPr
83
84
  return value;
84
85
  }
85
86
 
87
+ let transformablePropType = type;
88
+
86
89
  if ( type.kind === 'union' ) {
87
- type = type.prop_types[ value.$$type ];
90
+ transformablePropType = type.prop_types[ value.$$type ];
88
91
 
89
- if ( ! type ) {
92
+ if ( ! transformablePropType ) {
90
93
  return null;
91
94
  }
92
95
  }
93
96
 
94
- if ( value.$$type !== type.key ) {
97
+ transformablePropType = transformablePropType as TransformablePropType;
98
+
99
+ if ( value.$$type !== transformablePropType.key ) {
95
100
  return null;
96
101
  }
97
102
 
98
103
  // Warning: This variable is loosely-typed - use with caution.
99
104
  let resolvedValue = value.value;
100
105
 
101
- if ( type.kind === 'object' ) {
106
+ if ( transformablePropType.kind === 'object' ) {
102
107
  resolvedValue = await resolve( {
103
108
  props: resolvedValue,
104
- schema: type.shape,
109
+ schema: transformablePropType.shape,
105
110
  signal,
106
111
  } );
107
112
  }
108
113
 
109
- if ( type.kind === 'array' ) {
114
+ if ( transformablePropType.kind === 'array' ) {
110
115
  resolvedValue = await Promise.all(
111
116
  resolvedValue.map( ( item: PropValue ) =>
112
- transform( { value: item, key, type: type.item_prop_type, depth, signal } )
117
+ transform( { value: item, key, type: transformablePropType.item_prop_type, depth, signal } )
113
118
  )
114
119
  );
115
120
  }