@domql/element 2.5.21 → 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.
@@ -63,17 +63,25 @@ const syncProps = (props, element) => {
63
63
  };
64
64
  const createProps = function(element, parent, cached) {
65
65
  const { __ref: ref } = element;
66
- if (ref.__if) {
66
+ const applyProps = () => {
67
67
  const propsStack = cached || createPropsStack(element, parent);
68
68
  if (propsStack.length) {
69
69
  ref.__props = propsStack;
70
70
  syncProps(propsStack, element);
71
71
  } else {
72
+ ref.__props = cached || [];
72
73
  element.props = {};
73
74
  }
74
- } else {
75
- element.props = {};
76
- ref.__props = cached || [];
75
+ };
76
+ if (ref.__if)
77
+ applyProps();
78
+ else {
79
+ try {
80
+ applyProps();
81
+ } catch {
82
+ element.props = {};
83
+ ref.__props = cached || [];
84
+ }
77
85
  }
78
86
  const methods = { update: update.bind(element.props), __element: element };
79
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.21",
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": "bc6fd0276b416145cb0d1435a6ec12c97ea97753",
34
+ "gitHead": "231fe90e14adace5408e9f5def451463ec1430ae",
35
35
  "devDependencies": {
36
36
  "@babel/core": "^7.12.0"
37
37
  }
package/props/create.js CHANGED
@@ -51,15 +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 (ref.__if) {
54
+ // if (element.parent.key === '0' && element.key === 'editor') {
55
+ // debugger
56
+ // }
57
+
58
+ const applyProps = () => {
55
59
  const propsStack = cached || createPropsStack(element, parent)
56
60
  if (propsStack.length) {
57
61
  ref.__props = propsStack
58
62
  syncProps(propsStack, element)
59
- } else { element.props = {} }
60
- } else {
61
- element.props = {}
62
- ref.__props = cached || []
63
+ } else {
64
+ ref.__props = cached || []
65
+ element.props = {}
66
+ }
67
+ }
68
+
69
+ if (ref.__if) applyProps()
70
+ else {
71
+ try {
72
+ applyProps()
73
+ } catch {
74
+ element.props = {}
75
+ ref.__props = cached || []
76
+ }
63
77
  }
64
78
 
65
79
  const methods = { update: update.bind(element.props), __element: element }