@domql/element 2.5.187 → 2.5.188
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/create.js +10 -4
- package/dist/cjs/create.js +8 -3
- package/dist/cjs/mixins/registry.js +1 -1
- package/dist/cjs/set.js +7 -6
- package/dist/esm/create.js +8 -3
- package/dist/esm/mixins/registry.js +2 -2
- package/dist/esm/set.js +7 -6
- package/mixins/registry.js +2 -2
- package/package.json +2 -2
- package/set.js +7 -4
package/create.js
CHANGED
|
@@ -222,14 +222,20 @@ const renderElement = async (element, parent, options, attachOptions) => {
|
|
|
222
222
|
|
|
223
223
|
const { __ref: ref, key } = element
|
|
224
224
|
|
|
225
|
-
|
|
226
|
-
try {
|
|
225
|
+
const createNestedChild = async () => {
|
|
227
226
|
const isInfiniteLoopDetected = detectInfiniteLoop(ref.path)
|
|
228
227
|
if (ref.__uniqId || isInfiniteLoopDetected) return
|
|
229
228
|
await createNode(element, options)
|
|
230
229
|
ref.__uniqId = Math.random()
|
|
231
|
-
}
|
|
232
|
-
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// CREATE a real NODE
|
|
233
|
+
if (ENV === 'test' || ENV === 'development') {
|
|
234
|
+
await createNestedChild()
|
|
235
|
+
} else {
|
|
236
|
+
try {
|
|
237
|
+
await createNestedChild()
|
|
238
|
+
} catch (e) {
|
|
233
239
|
const path = ref.path
|
|
234
240
|
if (path.includes('ComponentsGrid')) path.splice(0, path.indexOf('ComponentsGrid') + 2)
|
|
235
241
|
if (path.includes('demoComponent')) path.splice(0, path.indexOf('demoComponent') + 1)
|
package/dist/cjs/create.js
CHANGED
|
@@ -178,14 +178,19 @@ const renderElement = async (element, parent, options, attachOptions) => {
|
|
|
178
178
|
}
|
|
179
179
|
visitedElements.set(element, true);
|
|
180
180
|
const { __ref: ref, key } = element;
|
|
181
|
-
|
|
181
|
+
const createNestedChild = async () => {
|
|
182
182
|
const isInfiniteLoopDetected = (0, import_utils.detectInfiniteLoop)(ref.path);
|
|
183
183
|
if (ref.__uniqId || isInfiniteLoopDetected)
|
|
184
184
|
return;
|
|
185
185
|
await (0, import_node.default)(element, options);
|
|
186
186
|
ref.__uniqId = Math.random();
|
|
187
|
-
}
|
|
188
|
-
|
|
187
|
+
};
|
|
188
|
+
if (ENV === "test" || ENV === "development") {
|
|
189
|
+
await createNestedChild();
|
|
190
|
+
} else {
|
|
191
|
+
try {
|
|
192
|
+
await createNestedChild();
|
|
193
|
+
} catch (e) {
|
|
189
194
|
const path = ref.path;
|
|
190
195
|
if (path.includes("ComponentsGrid"))
|
|
191
196
|
path.splice(0, path.indexOf("ComponentsGrid") + 2);
|
|
@@ -48,7 +48,7 @@ const REGISTRY = {
|
|
|
48
48
|
style: import_style.default,
|
|
49
49
|
text: import_text.default,
|
|
50
50
|
html: import_html.default,
|
|
51
|
-
|
|
51
|
+
content: import_content.default,
|
|
52
52
|
data: import_data.default,
|
|
53
53
|
class: import_classList.classList,
|
|
54
54
|
state: import_state.default,
|
package/dist/cjs/set.js
CHANGED
|
@@ -73,15 +73,16 @@ const set = function(params, options = {}, el) {
|
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
if (params) {
|
|
76
|
-
let { childExtend,
|
|
77
|
-
if (!
|
|
76
|
+
let { childExtend, props } = params;
|
|
77
|
+
if (!props)
|
|
78
|
+
props = params.props = {};
|
|
79
|
+
if (!childExtend && element.childExtend) {
|
|
78
80
|
params.childExtend = element.childExtend;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
props.ignoreChildExtend = true;
|
|
82
|
+
}
|
|
81
83
|
if (!(props == null ? void 0 : props.childProps) && ((_a = element.props) == null ? void 0 : _a.childProps)) {
|
|
82
|
-
if (!props)
|
|
83
|
-
props = params.props = {};
|
|
84
84
|
props.childProps = element.props.childProps;
|
|
85
|
+
props.ignoreChildProps = true;
|
|
85
86
|
}
|
|
86
87
|
if (lazyLoad) {
|
|
87
88
|
window.requestAnimationFrame(() => resetElement(params, element, options));
|
package/dist/esm/create.js
CHANGED
|
@@ -164,14 +164,19 @@ const renderElement = async (element, parent, options, attachOptions) => {
|
|
|
164
164
|
}
|
|
165
165
|
visitedElements.set(element, true);
|
|
166
166
|
const { __ref: ref, key } = element;
|
|
167
|
-
|
|
167
|
+
const createNestedChild = async () => {
|
|
168
168
|
const isInfiniteLoopDetected = detectInfiniteLoop(ref.path);
|
|
169
169
|
if (ref.__uniqId || isInfiniteLoopDetected)
|
|
170
170
|
return;
|
|
171
171
|
await createNode(element, options);
|
|
172
172
|
ref.__uniqId = Math.random();
|
|
173
|
-
}
|
|
174
|
-
|
|
173
|
+
};
|
|
174
|
+
if (ENV === "test" || ENV === "development") {
|
|
175
|
+
await createNestedChild();
|
|
176
|
+
} else {
|
|
177
|
+
try {
|
|
178
|
+
await createNestedChild();
|
|
179
|
+
} catch (e) {
|
|
175
180
|
const path = ref.path;
|
|
176
181
|
if (path.includes("ComponentsGrid"))
|
|
177
182
|
path.splice(0, path.indexOf("ComponentsGrid") + 2);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import attr from "./attr.js";
|
|
2
2
|
import { classList } from "./classList.js";
|
|
3
|
-
import
|
|
3
|
+
import content from "./content.js";
|
|
4
4
|
import data from "./data.js";
|
|
5
5
|
import html from "./html.js";
|
|
6
6
|
import scope from "./scope.js";
|
|
@@ -12,7 +12,7 @@ const REGISTRY = {
|
|
|
12
12
|
style,
|
|
13
13
|
text,
|
|
14
14
|
html,
|
|
15
|
-
|
|
15
|
+
content,
|
|
16
16
|
data,
|
|
17
17
|
class: classList,
|
|
18
18
|
state,
|
package/dist/esm/set.js
CHANGED
|
@@ -47,15 +47,16 @@ const set = function(params, options = {}, el) {
|
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
if (params) {
|
|
50
|
-
let { childExtend,
|
|
51
|
-
if (!
|
|
50
|
+
let { childExtend, props } = params;
|
|
51
|
+
if (!props)
|
|
52
|
+
props = params.props = {};
|
|
53
|
+
if (!childExtend && element.childExtend) {
|
|
52
54
|
params.childExtend = element.childExtend;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
props.ignoreChildExtend = true;
|
|
56
|
+
}
|
|
55
57
|
if (!(props == null ? void 0 : props.childProps) && ((_a = element.props) == null ? void 0 : _a.childProps)) {
|
|
56
|
-
if (!props)
|
|
57
|
-
props = params.props = {};
|
|
58
58
|
props.childProps = element.props.childProps;
|
|
59
|
+
props.ignoreChildProps = true;
|
|
59
60
|
}
|
|
60
61
|
if (lazyLoad) {
|
|
61
62
|
window.requestAnimationFrame(() => resetElement(params, element, options));
|
package/mixins/registry.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import attr from './attr.js'
|
|
4
4
|
import { classList } from './classList.js'
|
|
5
|
-
import
|
|
5
|
+
import content from './content.js'
|
|
6
6
|
import data from './data.js'
|
|
7
7
|
import html from './html.js'
|
|
8
8
|
import scope from './scope.js'
|
|
@@ -15,7 +15,7 @@ export const REGISTRY = {
|
|
|
15
15
|
style,
|
|
16
16
|
text,
|
|
17
17
|
html,
|
|
18
|
-
|
|
18
|
+
content,
|
|
19
19
|
data,
|
|
20
20
|
class: classList,
|
|
21
21
|
state,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/element",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.188",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@domql/state": "^2.5.187",
|
|
33
33
|
"@domql/utils": "^2.5.187"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "b240e178ba2f5c7a6d0f8fd28bbe7936e086642c",
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@babel/core": "^7.12.0"
|
|
38
38
|
}
|
package/set.js
CHANGED
|
@@ -51,12 +51,15 @@ export const set = function (params, options = {}, el) {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
if (params) {
|
|
54
|
-
let { childExtend,
|
|
55
|
-
if (!
|
|
56
|
-
if (!
|
|
54
|
+
let { childExtend, props } = params
|
|
55
|
+
if (!props) props = params.props = {}
|
|
56
|
+
if (!childExtend && element.childExtend) {
|
|
57
|
+
params.childExtend = element.childExtend
|
|
58
|
+
props.ignoreChildExtend = true
|
|
59
|
+
}
|
|
57
60
|
if (!props?.childProps && element.props?.childProps) {
|
|
58
|
-
if (!props) props = params.props = {}
|
|
59
61
|
props.childProps = element.props.childProps
|
|
62
|
+
props.ignoreChildProps = true
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
if (lazyLoad) {
|