@elementor/editor-canvas 3.35.0-348 → 3.35.0-350
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 +9 -7
- package/dist/index.mjs +9 -7
- package/package.json +17 -17
- package/src/renderers/create-props-resolver.ts +12 -7
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
|
-
|
|
792
|
-
if (!
|
|
792
|
+
transformablePropType = type.prop_types[value.$$type];
|
|
793
|
+
if (!transformablePropType) {
|
|
793
794
|
return null;
|
|
794
795
|
}
|
|
795
796
|
}
|
|
796
|
-
|
|
797
|
+
transformablePropType = transformablePropType;
|
|
798
|
+
if (value.$$type !== transformablePropType.key) {
|
|
797
799
|
return null;
|
|
798
800
|
}
|
|
799
801
|
let resolvedValue = value.value;
|
|
800
|
-
if (
|
|
802
|
+
if (transformablePropType.kind === "object") {
|
|
801
803
|
resolvedValue = await resolve({
|
|
802
804
|
props: resolvedValue,
|
|
803
|
-
schema:
|
|
805
|
+
schema: transformablePropType.shape,
|
|
804
806
|
signal
|
|
805
807
|
});
|
|
806
808
|
}
|
|
807
|
-
if (
|
|
809
|
+
if (transformablePropType.kind === "array") {
|
|
808
810
|
resolvedValue = await Promise.all(
|
|
809
811
|
resolvedValue.map(
|
|
810
|
-
(item) => transform({ value: item, key, type:
|
|
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
|
-
|
|
755
|
-
if (!
|
|
755
|
+
transformablePropType = type.prop_types[value.$$type];
|
|
756
|
+
if (!transformablePropType) {
|
|
756
757
|
return null;
|
|
757
758
|
}
|
|
758
759
|
}
|
|
759
|
-
|
|
760
|
+
transformablePropType = transformablePropType;
|
|
761
|
+
if (value.$$type !== transformablePropType.key) {
|
|
760
762
|
return null;
|
|
761
763
|
}
|
|
762
764
|
let resolvedValue = value.value;
|
|
763
|
-
if (
|
|
765
|
+
if (transformablePropType.kind === "object") {
|
|
764
766
|
resolvedValue = await resolve({
|
|
765
767
|
props: resolvedValue,
|
|
766
|
-
schema:
|
|
768
|
+
schema: transformablePropType.shape,
|
|
767
769
|
signal
|
|
768
770
|
});
|
|
769
771
|
}
|
|
770
|
-
if (
|
|
772
|
+
if (transformablePropType.kind === "array") {
|
|
771
773
|
resolvedValue = await Promise.all(
|
|
772
774
|
resolvedValue.map(
|
|
773
|
-
(item) => transform({ value: item, key, type:
|
|
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-
|
|
4
|
+
"version": "3.35.0-350",
|
|
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-
|
|
41
|
-
"@elementor/editor-controls": "3.35.0-
|
|
42
|
-
"@elementor/editor-documents": "3.35.0-
|
|
43
|
-
"@elementor/editor-elements": "3.35.0-
|
|
44
|
-
"@elementor/editor-interactions": "3.35.0-
|
|
45
|
-
"@elementor/editor-notifications": "3.35.0-
|
|
46
|
-
"@elementor/editor-props": "3.35.0-
|
|
47
|
-
"@elementor/editor-responsive": "3.35.0-
|
|
48
|
-
"@elementor/editor-styles": "3.35.0-
|
|
49
|
-
"@elementor/editor-styles-repository": "3.35.0-
|
|
50
|
-
"@elementor/editor-v1-adapters": "3.35.0-
|
|
51
|
-
"@elementor/editor-mcp": "3.35.0-
|
|
52
|
-
"@elementor/schema": "3.35.0-
|
|
53
|
-
"@elementor/twing": "3.35.0-
|
|
40
|
+
"@elementor/editor": "3.35.0-350",
|
|
41
|
+
"@elementor/editor-controls": "3.35.0-350",
|
|
42
|
+
"@elementor/editor-documents": "3.35.0-350",
|
|
43
|
+
"@elementor/editor-elements": "3.35.0-350",
|
|
44
|
+
"@elementor/editor-interactions": "3.35.0-350",
|
|
45
|
+
"@elementor/editor-notifications": "3.35.0-350",
|
|
46
|
+
"@elementor/editor-props": "3.35.0-350",
|
|
47
|
+
"@elementor/editor-responsive": "3.35.0-350",
|
|
48
|
+
"@elementor/editor-styles": "3.35.0-350",
|
|
49
|
+
"@elementor/editor-styles-repository": "3.35.0-350",
|
|
50
|
+
"@elementor/editor-v1-adapters": "3.35.0-350",
|
|
51
|
+
"@elementor/editor-mcp": "3.35.0-350",
|
|
52
|
+
"@elementor/schema": "3.35.0-350",
|
|
53
|
+
"@elementor/twing": "3.35.0-350",
|
|
54
54
|
"@elementor/ui": "1.36.17",
|
|
55
|
-
"@elementor/utils": "3.35.0-
|
|
56
|
-
"@elementor/wp-media": "3.35.0-
|
|
55
|
+
"@elementor/utils": "3.35.0-350",
|
|
56
|
+
"@elementor/wp-media": "3.35.0-350",
|
|
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
|
-
|
|
90
|
+
transformablePropType = type.prop_types[ value.$$type ];
|
|
88
91
|
|
|
89
|
-
if ( !
|
|
92
|
+
if ( ! transformablePropType ) {
|
|
90
93
|
return null;
|
|
91
94
|
}
|
|
92
95
|
}
|
|
93
96
|
|
|
94
|
-
|
|
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 (
|
|
106
|
+
if ( transformablePropType.kind === 'object' ) {
|
|
102
107
|
resolvedValue = await resolve( {
|
|
103
108
|
props: resolvedValue,
|
|
104
|
-
schema:
|
|
109
|
+
schema: transformablePropType.shape,
|
|
105
110
|
signal,
|
|
106
111
|
} );
|
|
107
112
|
}
|
|
108
113
|
|
|
109
|
-
if (
|
|
114
|
+
if ( transformablePropType.kind === 'array' ) {
|
|
110
115
|
resolvedValue = await Promise.all(
|
|
111
116
|
resolvedValue.map( ( item: PropValue ) =>
|
|
112
|
-
transform( { value: item, key, type:
|
|
117
|
+
transform( { value: item, key, type: transformablePropType.item_prop_type, depth, signal } )
|
|
113
118
|
)
|
|
114
119
|
);
|
|
115
120
|
}
|