@domql/element 2.5.198 → 2.5.203
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 -5
- package/dist/cjs/create.js +4 -4
- package/dist/cjs/methods/index.js +3 -3
- package/dist/cjs/node.js +1 -1
- package/dist/cjs/utils/extendUtils.js +1 -1
- package/dist/esm/create.js +4 -4
- package/dist/esm/methods/index.js +3 -3
- package/dist/esm/node.js +1 -1
- package/dist/esm/utils/extendUtils.js +1 -1
- package/methods/index.js +3 -3
- package/node.js +1 -1
- package/package.json +8 -8
- package/utils/extendUtils.js +1 -1
package/create.js
CHANGED
|
@@ -128,13 +128,13 @@ export const create = async (element, parent, key, options = OPTIONS.create || {
|
|
|
128
128
|
const createBasedOnType = (element, parent, key, options) => {
|
|
129
129
|
// if ELEMENT is not given
|
|
130
130
|
if (element === undefined) {
|
|
131
|
-
if (ENV === '
|
|
131
|
+
if (ENV === 'testing' || ENV === 'development') {
|
|
132
132
|
console.warn(key, 'element is undefined in', parent && parent.__ref && parent.__ref.path)
|
|
133
133
|
}
|
|
134
134
|
return {}
|
|
135
135
|
}
|
|
136
136
|
if (isString(key) && key.slice(0, 2 === '__')) {
|
|
137
|
-
if (ENV === '
|
|
137
|
+
if (ENV === 'testing' || ENV === 'development') {
|
|
138
138
|
console.warn(key, 'seems like to be in __ref')
|
|
139
139
|
}
|
|
140
140
|
}
|
|
@@ -215,7 +215,7 @@ const addElementIntoParentChildren = (element, parent) => {
|
|
|
215
215
|
const visitedElements = new WeakMap()
|
|
216
216
|
const renderElement = async (element, parent, options, attachOptions) => {
|
|
217
217
|
if (visitedElements.has(element)) {
|
|
218
|
-
if (ENV === '
|
|
218
|
+
if (ENV === 'testing' || ENV === 'development') console.warn('Cyclic rendering detected:', element.__ref.path)
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
visitedElements.set(element, true)
|
|
@@ -230,7 +230,7 @@ const renderElement = async (element, parent, options, attachOptions) => {
|
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
// CREATE a real NODE
|
|
233
|
-
if (ENV === '
|
|
233
|
+
if (ENV === 'testing' || ENV === 'development') {
|
|
234
234
|
await createNestedChild()
|
|
235
235
|
} else {
|
|
236
236
|
try {
|
|
@@ -344,7 +344,7 @@ const addCaching = (element, parent) => {
|
|
|
344
344
|
if (!ref.root) ref.root = hasRoot ? element : parentRef.root
|
|
345
345
|
|
|
346
346
|
// set the PATH array
|
|
347
|
-
// if (ENV === '
|
|
347
|
+
// if (ENV === 'testing' || ENV === 'development') {
|
|
348
348
|
if (!parentRef) parentRef = parent.ref = {}
|
|
349
349
|
if (!parentRef.path) parentRef.path = []
|
|
350
350
|
ref.path = parentRef.path.concat(element.key)
|
package/dist/cjs/create.js
CHANGED
|
@@ -87,13 +87,13 @@ const create = async (element, parent, key, options = import_options.OPTIONS.cre
|
|
|
87
87
|
};
|
|
88
88
|
const createBasedOnType = (element, parent, key, options) => {
|
|
89
89
|
if (element === void 0) {
|
|
90
|
-
if (ENV === "
|
|
90
|
+
if (ENV === "testing" || ENV === "development") {
|
|
91
91
|
console.warn(key, "element is undefined in", parent && parent.__ref && parent.__ref.path);
|
|
92
92
|
}
|
|
93
93
|
return {};
|
|
94
94
|
}
|
|
95
95
|
if ((0, import_utils.isString)(key) && key.slice(0, 2 === "__")) {
|
|
96
|
-
if (ENV === "
|
|
96
|
+
if (ENV === "testing" || ENV === "development") {
|
|
97
97
|
console.warn(key, "seems like to be in __ref");
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -163,7 +163,7 @@ const visitedElements = /* @__PURE__ */ new WeakMap();
|
|
|
163
163
|
const renderElement = async (element, parent, options, attachOptions) => {
|
|
164
164
|
var _a, _b, _c, _d;
|
|
165
165
|
if (visitedElements.has(element)) {
|
|
166
|
-
if (ENV === "
|
|
166
|
+
if (ENV === "testing" || ENV === "development")
|
|
167
167
|
console.warn("Cyclic rendering detected:", element.__ref.path);
|
|
168
168
|
}
|
|
169
169
|
visitedElements.set(element, true);
|
|
@@ -175,7 +175,7 @@ const renderElement = async (element, parent, options, attachOptions) => {
|
|
|
175
175
|
await (0, import_node.createNode)(element, options);
|
|
176
176
|
ref.__uniqId = Math.random();
|
|
177
177
|
};
|
|
178
|
-
if (ENV === "
|
|
178
|
+
if (ENV === "testing" || ENV === "development") {
|
|
179
179
|
await createNestedChild();
|
|
180
180
|
} else {
|
|
181
181
|
try {
|
|
@@ -243,18 +243,18 @@ function verbose(...args) {
|
|
|
243
243
|
return element;
|
|
244
244
|
}
|
|
245
245
|
function log(...params) {
|
|
246
|
-
if (ENV === "
|
|
246
|
+
if (ENV === "testing" || ENV === "development") {
|
|
247
247
|
console.log(...params);
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
function warn(...params) {
|
|
251
|
-
if (ENV === "
|
|
251
|
+
if (ENV === "testing" || ENV === "development") {
|
|
252
252
|
console.warn(...params);
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
function error(...params) {
|
|
256
256
|
var _a, _b;
|
|
257
|
-
if (ENV === "
|
|
257
|
+
if (ENV === "testing" || ENV === "development") {
|
|
258
258
|
if ((_a = params[params.length - 1]) == null ? void 0 : _a.debugger)
|
|
259
259
|
debugger;
|
|
260
260
|
if ((_b = params[params.length - 1]) == null ? void 0 : _b.verbose)
|
package/dist/cjs/node.js
CHANGED
|
@@ -45,7 +45,7 @@ const createNode = async (element, options) => {
|
|
|
45
45
|
node = element.node = (0, import_render.cacheNode)(element);
|
|
46
46
|
(0, import_event.triggerEventOn)("attachNode", element, options);
|
|
47
47
|
}
|
|
48
|
-
if (ENV === "
|
|
48
|
+
if (ENV === "testing" || ENV === "development" || options.alowRefReference) {
|
|
49
49
|
node.ref = element;
|
|
50
50
|
if ((0, import_utils.isFunction)(node.setAttribute))
|
|
51
51
|
node.setAttribute("key", element.key);
|
|
@@ -117,7 +117,7 @@ const fallbackStringExtend = (extend, context, options = {}, variant) => {
|
|
|
117
117
|
else if (pageExists)
|
|
118
118
|
return pageExists;
|
|
119
119
|
else {
|
|
120
|
-
if (options.verbose && (ENV === "
|
|
120
|
+
if (options.verbose && (ENV === "testing" || ENV === "development")) {
|
|
121
121
|
console.warn("Extend is string but component was not found:", extend);
|
|
122
122
|
}
|
|
123
123
|
return {};
|
package/dist/esm/create.js
CHANGED
|
@@ -83,13 +83,13 @@ const create = async (element, parent, key, options = OPTIONS.create || {}, atta
|
|
|
83
83
|
};
|
|
84
84
|
const createBasedOnType = (element, parent, key, options) => {
|
|
85
85
|
if (element === void 0) {
|
|
86
|
-
if (ENV === "
|
|
86
|
+
if (ENV === "testing" || ENV === "development") {
|
|
87
87
|
console.warn(key, "element is undefined in", parent && parent.__ref && parent.__ref.path);
|
|
88
88
|
}
|
|
89
89
|
return {};
|
|
90
90
|
}
|
|
91
91
|
if (isString(key) && key.slice(0, 2 === "__")) {
|
|
92
|
-
if (ENV === "
|
|
92
|
+
if (ENV === "testing" || ENV === "development") {
|
|
93
93
|
console.warn(key, "seems like to be in __ref");
|
|
94
94
|
}
|
|
95
95
|
}
|
|
@@ -159,7 +159,7 @@ const visitedElements = /* @__PURE__ */ new WeakMap();
|
|
|
159
159
|
const renderElement = async (element, parent, options, attachOptions) => {
|
|
160
160
|
var _a, _b, _c, _d;
|
|
161
161
|
if (visitedElements.has(element)) {
|
|
162
|
-
if (ENV === "
|
|
162
|
+
if (ENV === "testing" || ENV === "development")
|
|
163
163
|
console.warn("Cyclic rendering detected:", element.__ref.path);
|
|
164
164
|
}
|
|
165
165
|
visitedElements.set(element, true);
|
|
@@ -171,7 +171,7 @@ const renderElement = async (element, parent, options, attachOptions) => {
|
|
|
171
171
|
await createNode(element, options);
|
|
172
172
|
ref.__uniqId = Math.random();
|
|
173
173
|
};
|
|
174
|
-
if (ENV === "
|
|
174
|
+
if (ENV === "testing" || ENV === "development") {
|
|
175
175
|
await createNestedChild();
|
|
176
176
|
} else {
|
|
177
177
|
try {
|
|
@@ -197,18 +197,18 @@ function verbose(...args) {
|
|
|
197
197
|
return element;
|
|
198
198
|
}
|
|
199
199
|
function log(...params) {
|
|
200
|
-
if (ENV === "
|
|
200
|
+
if (ENV === "testing" || ENV === "development") {
|
|
201
201
|
console.log(...params);
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
function warn(...params) {
|
|
205
|
-
if (ENV === "
|
|
205
|
+
if (ENV === "testing" || ENV === "development") {
|
|
206
206
|
console.warn(...params);
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
function error(...params) {
|
|
210
210
|
var _a, _b;
|
|
211
|
-
if (ENV === "
|
|
211
|
+
if (ENV === "testing" || ENV === "development") {
|
|
212
212
|
if ((_a = params[params.length - 1]) == null ? void 0 : _a.debugger)
|
|
213
213
|
debugger;
|
|
214
214
|
if ((_b = params[params.length - 1]) == null ? void 0 : _b.verbose)
|
package/dist/esm/node.js
CHANGED
|
@@ -25,7 +25,7 @@ const createNode = async (element, options) => {
|
|
|
25
25
|
node = element.node = cacheNode(element);
|
|
26
26
|
triggerEventOn("attachNode", element, options);
|
|
27
27
|
}
|
|
28
|
-
if (ENV === "
|
|
28
|
+
if (ENV === "testing" || ENV === "development" || options.alowRefReference) {
|
|
29
29
|
node.ref = element;
|
|
30
30
|
if (isFunction(node.setAttribute))
|
|
31
31
|
node.setAttribute("key", element.key);
|
|
@@ -80,7 +80,7 @@ const fallbackStringExtend = (extend, context, options = {}, variant) => {
|
|
|
80
80
|
else if (pageExists)
|
|
81
81
|
return pageExists;
|
|
82
82
|
else {
|
|
83
|
-
if (options.verbose && (ENV === "
|
|
83
|
+
if (options.verbose && (ENV === "testing" || ENV === "development")) {
|
|
84
84
|
console.warn("Extend is string but component was not found:", extend);
|
|
85
85
|
}
|
|
86
86
|
return {};
|
package/methods/index.js
CHANGED
|
@@ -205,19 +205,19 @@ export function verbose (...args) {
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
export function log (...params) {
|
|
208
|
-
if (ENV === '
|
|
208
|
+
if (ENV === 'testing' || ENV === 'development') {
|
|
209
209
|
console.log(...params)
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
export function warn (...params) {
|
|
214
|
-
if (ENV === '
|
|
214
|
+
if (ENV === 'testing' || ENV === 'development') {
|
|
215
215
|
console.warn(...params)
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
export function error (...params) {
|
|
220
|
-
if (ENV === '
|
|
220
|
+
if (ENV === 'testing' || ENV === 'development') {
|
|
221
221
|
if (params[params.length - 1]?.debugger) debugger // eslint-disable-line
|
|
222
222
|
if (params[params.length - 1]?.verbose) verbose.call(this)
|
|
223
223
|
throw new Error(...params)
|
package/node.js
CHANGED
|
@@ -38,7 +38,7 @@ export const createNode = async (element, options) => {
|
|
|
38
38
|
}
|
|
39
39
|
// node.dataset // .key = element.key
|
|
40
40
|
|
|
41
|
-
if (ENV === '
|
|
41
|
+
if (ENV === 'testing' || ENV === 'development' || options.alowRefReference) {
|
|
42
42
|
node.ref = element
|
|
43
43
|
if (isFunction(node.setAttribute)) node.setAttribute('key', element.key)
|
|
44
44
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/element",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.203",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "index.js",
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
"copy:package:cjs": "cp ../../build/package-cjs.json dist/cjs/package.json",
|
|
24
24
|
"build:esm": "npx esbuild *.js **/*.js --target=es2019 --format=esm --outdir=dist/esm",
|
|
25
25
|
"build:cjs": "npx esbuild *.js **/*.js --target=node16 --format=cjs --outdir=dist/cjs",
|
|
26
|
-
"build": "rimraf -I dist; npm run build:cjs; npm run build:esm",
|
|
27
|
-
"prepublish": "rimraf -I dist && npm run build && npm run copy:package:cjs"
|
|
26
|
+
"build": "npx rimraf -I dist; npm run build:cjs; npm run build:esm",
|
|
27
|
+
"prepublish": "npx rimraf -I dist && npm run build && npm run copy:package:cjs"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@domql/event": "^2.5.
|
|
31
|
-
"@domql/render": "^2.5.
|
|
32
|
-
"@domql/state": "^2.5.
|
|
33
|
-
"@domql/utils": "^2.5.
|
|
30
|
+
"@domql/event": "^2.5.203",
|
|
31
|
+
"@domql/render": "^2.5.203",
|
|
32
|
+
"@domql/state": "^2.5.203",
|
|
33
|
+
"@domql/utils": "^2.5.203"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "f8c712416647ab3789253b7176eaa762627fc677",
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@babel/core": "^7.12.0"
|
|
38
38
|
}
|
package/utils/extendUtils.js
CHANGED
|
@@ -88,7 +88,7 @@ export const fallbackStringExtend = (extend, context, options = {}, variant) =>
|
|
|
88
88
|
if (componentExists) return componentExists
|
|
89
89
|
else if (pageExists) return pageExists
|
|
90
90
|
else {
|
|
91
|
-
if (options.verbose && (ENV === '
|
|
91
|
+
if (options.verbose && (ENV === 'testing' || ENV === 'development')) {
|
|
92
92
|
console.warn('Extend is string but component was not found:', extend)
|
|
93
93
|
}
|
|
94
94
|
return {}
|