@domql/element 2.5.21 → 2.5.23
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 +12 -4
- package/dist/cjs/update.js +1 -2
- package/package.json +2 -2
- package/props/create.js +19 -5
- package/update.js +1 -2
package/dist/cjs/props/create.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
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/dist/cjs/update.js
CHANGED
|
@@ -42,7 +42,6 @@ var import_iterate = require("./iterate");
|
|
|
42
42
|
var import_mixins = require("./mixins");
|
|
43
43
|
var import_applyParam = require("./applyParam");
|
|
44
44
|
var import_options = __toESM(require("./cache/options"), 1);
|
|
45
|
-
var import_inherit = require("../state/inherit");
|
|
46
45
|
const snapshot = {
|
|
47
46
|
snapshotId: import_utils.createSnapshotId
|
|
48
47
|
};
|
|
@@ -191,7 +190,7 @@ const inheritStateUpdates = (element, options) => {
|
|
|
191
190
|
state.set(execState, { ...options, preventUpdate: true });
|
|
192
191
|
return;
|
|
193
192
|
}
|
|
194
|
-
const keyInParentState = (0,
|
|
193
|
+
const keyInParentState = (0, import_state.findInheritedState)(element, element.parent);
|
|
195
194
|
if (!keyInParentState || options.preventInheritedStateUpdate)
|
|
196
195
|
return;
|
|
197
196
|
if (!options.preventInitStateUpdateListener) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/element",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.23",
|
|
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": "34d9106fa933dde10e587dda3f485418561a3f3c",
|
|
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 (
|
|
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 {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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 }
|
package/update.js
CHANGED
|
@@ -4,7 +4,7 @@ import { window, exec, isArray, isFunction, isNumber, isObject, isString, isUnde
|
|
|
4
4
|
import { applyEvent, triggerEventOn, triggerEventOnUpdate } from '@domql/event'
|
|
5
5
|
import { isMethod } from './methods'
|
|
6
6
|
import { updateProps } from './props'
|
|
7
|
-
import { createState } from '@domql/state'
|
|
7
|
+
import { createState, findInheritedState } from '@domql/state'
|
|
8
8
|
|
|
9
9
|
import { METHODS_EXL, isVariant } from './utils'
|
|
10
10
|
import create from './create'
|
|
@@ -12,7 +12,6 @@ import { throughUpdatedDefine, throughUpdatedExec } from './iterate'
|
|
|
12
12
|
import { registry } from './mixins'
|
|
13
13
|
import { applyParam } from './applyParam'
|
|
14
14
|
import OPTIONS from './cache/options'
|
|
15
|
-
import { findInheritedState } from '../state/inherit'
|
|
16
15
|
|
|
17
16
|
const snapshot = {
|
|
18
17
|
snapshotId: createSnapshotId
|