@domql/element 2.5.20 → 2.5.22
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/cjs/props/create.js +15 -12
- package/package.json +2 -2
- package/props/create.js +19 -10
package/dist/cjs/props/create.js
CHANGED
|
@@ -63,22 +63,25 @@ const syncProps = (props, element) => {
|
|
|
63
63
|
};
|
|
64
64
|
const createProps = function(element, parent, cached) {
|
|
65
65
|
const { __ref: ref } = element;
|
|
66
|
-
|
|
66
|
+
const applyProps = () => {
|
|
67
|
+
const propsStack = cached || createPropsStack(element, parent);
|
|
68
|
+
if (propsStack.length) {
|
|
69
|
+
ref.__props = propsStack;
|
|
70
|
+
syncProps(propsStack, element);
|
|
71
|
+
} else {
|
|
72
|
+
ref.__props = cached || [];
|
|
73
|
+
element.props = {};
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
if (ref.__if)
|
|
77
|
+
applyProps();
|
|
78
|
+
else {
|
|
67
79
|
try {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
ref.__props = propsStack;
|
|
71
|
-
syncProps(propsStack, element);
|
|
72
|
-
} else {
|
|
73
|
-
element.props = {};
|
|
74
|
-
}
|
|
75
|
-
} catch (e) {
|
|
80
|
+
applyProps();
|
|
81
|
+
} catch {
|
|
76
82
|
element.props = {};
|
|
77
83
|
ref.__props = cached || [];
|
|
78
84
|
}
|
|
79
|
-
} else {
|
|
80
|
-
element.props = {};
|
|
81
|
-
ref.__props = cached || [];
|
|
82
85
|
}
|
|
83
86
|
const methods = { update: update.bind(element.props), __element: element };
|
|
84
87
|
Object.setPrototypeOf(element.props, methods);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/element",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.22",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@domql/state": "latest",
|
|
32
32
|
"@domql/utils": "latest"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "231fe90e14adace5408e9f5def451463ec1430ae",
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/core": "^7.12.0"
|
|
37
37
|
}
|
package/props/create.js
CHANGED
|
@@ -51,20 +51,29 @@ export const syncProps = (props, element) => {
|
|
|
51
51
|
export const createProps = function (element, parent, cached) {
|
|
52
52
|
const { __ref: ref } = element
|
|
53
53
|
|
|
54
|
-
if (
|
|
54
|
+
// if (element.parent.key === '0' && element.key === 'editor') {
|
|
55
|
+
// debugger
|
|
56
|
+
// }
|
|
57
|
+
|
|
58
|
+
const applyProps = () => {
|
|
59
|
+
const propsStack = cached || createPropsStack(element, parent)
|
|
60
|
+
if (propsStack.length) {
|
|
61
|
+
ref.__props = propsStack
|
|
62
|
+
syncProps(propsStack, element)
|
|
63
|
+
} else {
|
|
64
|
+
ref.__props = cached || []
|
|
65
|
+
element.props = {}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (ref.__if) applyProps()
|
|
70
|
+
else {
|
|
55
71
|
try {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
ref.__props = propsStack
|
|
59
|
-
syncProps(propsStack, element)
|
|
60
|
-
} else { element.props = {} }
|
|
61
|
-
} catch (e) {
|
|
72
|
+
applyProps()
|
|
73
|
+
} catch {
|
|
62
74
|
element.props = {}
|
|
63
75
|
ref.__props = cached || []
|
|
64
76
|
}
|
|
65
|
-
} else {
|
|
66
|
-
element.props = {}
|
|
67
|
-
ref.__props = cached || []
|
|
68
77
|
}
|
|
69
78
|
|
|
70
79
|
const methods = { update: update.bind(element.props), __element: element }
|