@domql/element 2.5.147 → 2.5.149
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 +5 -3
- package/dist/cjs/create.js +8 -4
- package/dist/cjs/methods/index.js +3 -2
- package/dist/cjs/methods/set.js +5 -7
- package/methods/index.js +3 -3
- package/methods/set.js +6 -8
- package/package.json +6 -6
package/create.js
CHANGED
|
@@ -232,9 +232,11 @@ const renderElement = (element, parent, options, attachOptions) => {
|
|
|
232
232
|
if (path.includes('ComponentsGrid')) path.splice(0, path.indexOf('ComponentsGrid') + 2)
|
|
233
233
|
if (path.includes('demoComponent')) path.splice(0, path.indexOf('demoComponent') + 1)
|
|
234
234
|
const isDemoComponent = element.lookup(el => el.state.key)?.state?.key
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
235
|
+
element.warn('Error happened in:', isDemoComponent ? isDemoComponent + ' ' : '' + path.join('.'))
|
|
236
|
+
element.verbose()
|
|
237
|
+
element.error(e)
|
|
238
|
+
if (element.on?.error) element.on.error(e, element, element.state, element.context, options)
|
|
239
|
+
if (element.props?.onError) element.props.onError(e, element, element.state, element.context, options)
|
|
238
240
|
}
|
|
239
241
|
}
|
|
240
242
|
|
package/dist/cjs/create.js
CHANGED
|
@@ -169,7 +169,7 @@ const addElementIntoParentChildren = (element, parent) => {
|
|
|
169
169
|
};
|
|
170
170
|
const visitedElements = /* @__PURE__ */ new WeakMap();
|
|
171
171
|
const renderElement = (element, parent, options, attachOptions) => {
|
|
172
|
-
var _a, _b;
|
|
172
|
+
var _a, _b, _c, _d;
|
|
173
173
|
if (visitedElements.has(element)) {
|
|
174
174
|
if (ENV === "test" || ENV === "development")
|
|
175
175
|
console.warn("Cyclic rendering detected:", element.__ref.path);
|
|
@@ -190,9 +190,13 @@ const renderElement = (element, parent, options, attachOptions) => {
|
|
|
190
190
|
if (path.includes("demoComponent"))
|
|
191
191
|
path.splice(0, path.indexOf("demoComponent") + 1);
|
|
192
192
|
const isDemoComponent = (_b = (_a = element.lookup((el) => el.state.key)) == null ? void 0 : _a.state) == null ? void 0 : _b.key;
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
element.warn("Error happened in:", isDemoComponent ? isDemoComponent + " " : "" + path.join("."));
|
|
194
|
+
element.verbose();
|
|
195
|
+
element.error(e);
|
|
196
|
+
if ((_c = element.on) == null ? void 0 : _c.error)
|
|
197
|
+
element.on.error(e, element, element.state, element.context, options);
|
|
198
|
+
if ((_d = element.props) == null ? void 0 : _d.onError)
|
|
199
|
+
element.props.onError(e, element, element.state, element.context, options);
|
|
196
200
|
}
|
|
197
201
|
}
|
|
198
202
|
if (!ref.__if) {
|
|
@@ -103,7 +103,6 @@ function lookdown(param) {
|
|
|
103
103
|
if (lookdown2)
|
|
104
104
|
return lookdown2;
|
|
105
105
|
}
|
|
106
|
-
return null;
|
|
107
106
|
}
|
|
108
107
|
function lookdownAll(param, results = []) {
|
|
109
108
|
var _a;
|
|
@@ -122,7 +121,7 @@ function lookdownAll(param, results = []) {
|
|
|
122
121
|
}
|
|
123
122
|
(_a = childElem == null ? void 0 : childElem.lookdownAll) == null ? void 0 : _a.call(childElem, param, results);
|
|
124
123
|
}
|
|
125
|
-
return results.length ? results :
|
|
124
|
+
return results.length ? results : void 0;
|
|
126
125
|
}
|
|
127
126
|
function setNodeStyles(params = {}) {
|
|
128
127
|
var _a;
|
|
@@ -213,6 +212,8 @@ function parseDeep(excl = []) {
|
|
|
213
212
|
return obj;
|
|
214
213
|
}
|
|
215
214
|
function verbose(...args) {
|
|
215
|
+
if (ENV !== "test" && ENV !== "development")
|
|
216
|
+
return;
|
|
216
217
|
const element = this;
|
|
217
218
|
const { __ref: ref } = element;
|
|
218
219
|
console.group(element.key);
|
package/dist/cjs/methods/set.js
CHANGED
|
@@ -55,15 +55,13 @@ const addMethods = (element, parent, options = {}) => {
|
|
|
55
55
|
parseDeep: import__.parseDeep,
|
|
56
56
|
keys: import__.keys,
|
|
57
57
|
nextElement: import__.nextElement,
|
|
58
|
-
previousElement: import__.previousElement
|
|
58
|
+
previousElement: import__.previousElement,
|
|
59
|
+
log: import__.log,
|
|
60
|
+
verbose: import__.verbose,
|
|
61
|
+
warn: import__.warn,
|
|
62
|
+
error: import__.error
|
|
59
63
|
};
|
|
60
64
|
if (element.context.methods)
|
|
61
65
|
(options.strict ? import_utils.merge : import_utils.overwrite)(proto, element.context.methods);
|
|
62
|
-
if ((0, import_utils.isDevelopment)()) {
|
|
63
|
-
proto.log = import__.log;
|
|
64
|
-
proto.verbose = import__.verbose;
|
|
65
|
-
proto.warn = import__.warn;
|
|
66
|
-
proto.error = import__.error;
|
|
67
|
-
}
|
|
68
66
|
Object.setPrototypeOf(element, proto);
|
|
69
67
|
};
|
package/methods/index.js
CHANGED
|
@@ -64,8 +64,6 @@ export function lookdown (param) {
|
|
|
64
64
|
const lookdown = childElem?.lookdown?.(param)
|
|
65
65
|
if (lookdown) return lookdown
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
return null
|
|
69
67
|
}
|
|
70
68
|
|
|
71
69
|
export function lookdownAll (param, results = []) {
|
|
@@ -85,7 +83,7 @@ export function lookdownAll (param, results = []) {
|
|
|
85
83
|
childElem?.lookdownAll?.(param, results)
|
|
86
84
|
}
|
|
87
85
|
|
|
88
|
-
return results.length ? results :
|
|
86
|
+
return results.length ? results : undefined
|
|
89
87
|
}
|
|
90
88
|
|
|
91
89
|
export function setNodeStyles (params = {}) {
|
|
@@ -177,6 +175,8 @@ export function parseDeep (excl = []) {
|
|
|
177
175
|
}
|
|
178
176
|
|
|
179
177
|
export function verbose (...args) {
|
|
178
|
+
if (ENV !== 'test' && ENV !== 'development') return
|
|
179
|
+
|
|
180
180
|
const element = this
|
|
181
181
|
const { __ref: ref } = element
|
|
182
182
|
console.group(element.key)
|
package/methods/set.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { merge, overwrite } from '@domql/utils'
|
|
4
4
|
|
|
5
5
|
import set, { reset } from '../set'
|
|
6
6
|
import update from '../update'
|
|
@@ -46,14 +46,12 @@ export const addMethods = (element, parent, options = {}) => {
|
|
|
46
46
|
parseDeep,
|
|
47
47
|
keys,
|
|
48
48
|
nextElement,
|
|
49
|
-
previousElement
|
|
49
|
+
previousElement,
|
|
50
|
+
log,
|
|
51
|
+
verbose,
|
|
52
|
+
warn,
|
|
53
|
+
error
|
|
50
54
|
}
|
|
51
55
|
if (element.context.methods) (options.strict ? merge : overwrite)(proto, element.context.methods)
|
|
52
|
-
if (isDevelopment()) {
|
|
53
|
-
proto.log = log
|
|
54
|
-
proto.verbose = verbose
|
|
55
|
-
proto.warn = warn
|
|
56
|
-
proto.error = error
|
|
57
|
-
}
|
|
58
56
|
Object.setPrototypeOf(element, proto)
|
|
59
57
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/element",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.149",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "index.js",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"prepublish": "rimraf -I dist && yarn build && yarn copy:package:cjs"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@domql/event": "^2.5.
|
|
30
|
-
"@domql/render": "^2.5.
|
|
31
|
-
"@domql/state": "^2.5.
|
|
32
|
-
"@domql/utils": "^2.5.
|
|
29
|
+
"@domql/event": "^2.5.148",
|
|
30
|
+
"@domql/render": "^2.5.148",
|
|
31
|
+
"@domql/state": "^2.5.148",
|
|
32
|
+
"@domql/utils": "^2.5.148"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "0fc54dc04c46c99dc37afab72464ac0457fcea73",
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/core": "^7.12.0"
|
|
37
37
|
}
|