@schukai/monster 3.31.0 → 3.32.0
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -168,8 +168,6 @@ function transform(value) {
|
|
168
168
|
let key;
|
169
169
|
let defaultValue;
|
170
170
|
|
171
|
-
let element;
|
172
|
-
let attribute;
|
173
171
|
let translations;
|
174
172
|
let date;
|
175
173
|
let locale;
|
@@ -330,6 +328,15 @@ function transform(value) {
|
|
330
328
|
if (trueStatement === "\\value") {
|
331
329
|
trueStatement = "value";
|
332
330
|
}
|
331
|
+
|
332
|
+
if (trueStatement === "\\undefined") {
|
333
|
+
trueStatement = undefined;
|
334
|
+
}
|
335
|
+
|
336
|
+
if (trueStatement === "\\null") {
|
337
|
+
trueStatement = null;
|
338
|
+
}
|
339
|
+
|
333
340
|
if (falseStatement === "value") {
|
334
341
|
falseStatement = value;
|
335
342
|
}
|
@@ -337,6 +344,14 @@ function transform(value) {
|
|
337
344
|
falseStatement = "value";
|
338
345
|
}
|
339
346
|
|
347
|
+
if (falseStatement === "\\undefined") {
|
348
|
+
falseStatement = undefined;
|
349
|
+
}
|
350
|
+
|
351
|
+
if (falseStatement === "\\null") {
|
352
|
+
falseStatement = null;
|
353
|
+
}
|
354
|
+
|
340
355
|
let condition =
|
341
356
|
(value !== undefined && value !== "" && value !== "off" && value !== "false" && value !== false) ||
|
342
357
|
value === "on" ||
|
package/source/dom/updater.mjs
CHANGED
@@ -291,6 +291,7 @@ function retrieveAndSetValue(element) {
|
|
291
291
|
const pathfinder = new Pathfinder(self[internalSymbol].subject.getSubject());
|
292
292
|
|
293
293
|
let path = element.getAttribute(ATTRIBUTE_UPDATER_BIND);
|
294
|
+
if (path === null) throw new Error("the bind argument must start as a value with a path");
|
294
295
|
|
295
296
|
if (path.indexOf("path:") !== 0) {
|
296
297
|
throw new Error("the bind argument must start as a value with a path");
|
@@ -434,6 +435,8 @@ function insertElement(change) {
|
|
434
435
|
found = true;
|
435
436
|
|
436
437
|
const attributes = containerElement.getAttribute(ATTRIBUTE_UPDATER_INSERT);
|
438
|
+
if (attributes === null) continue;
|
439
|
+
|
437
440
|
let def = trimSpaces(attributes);
|
438
441
|
let i = def.indexOf(" ");
|
439
442
|
let key = trimSpaces(def.substr(0, i));
|
@@ -489,6 +492,7 @@ function insertElement(change) {
|
|
489
492
|
let nodes = containerElement.querySelectorAll(
|
490
493
|
`[${ATTRIBUTE_UPDATER_INSERT_REFERENCE}*="${refPrefix}"]`,
|
491
494
|
);
|
495
|
+
|
492
496
|
for (const [, node] of Object.entries(nodes)) {
|
493
497
|
if (!available.has(node.getAttribute(ATTRIBUTE_UPDATER_INSERT_REFERENCE))) {
|
494
498
|
try {
|
@@ -699,7 +703,7 @@ function runUpdateAttributes(container, parts, subject) {
|
|
699
703
|
|
700
704
|
let iterator = new Set();
|
701
705
|
|
702
|
-
const query = `[${ATTRIBUTE_UPDATER_SELECT_THIS}], [${ATTRIBUTE_UPDATER_ATTRIBUTES}*="path:${current}"], [${ATTRIBUTE_UPDATER_ATTRIBUTES}^="static:"], [${ATTRIBUTE_UPDATER_ATTRIBUTES}^="i18n:"]`;
|
706
|
+
const query = `[${ATTRIBUTE_UPDATER_SELECT_THIS}][${ATTRIBUTE_UPDATER_ATTRIBUTES}], [${ATTRIBUTE_UPDATER_ATTRIBUTES}*="path:${current}"], [${ATTRIBUTE_UPDATER_ATTRIBUTES}^="static:"], [${ATTRIBUTE_UPDATER_ATTRIBUTES}^="i18n:"]`;
|
703
707
|
|
704
708
|
const e = container.querySelectorAll(query);
|
705
709
|
|
@@ -715,6 +719,11 @@ function runUpdateAttributes(container, parts, subject) {
|
|
715
719
|
if (mem.has(element)) return;
|
716
720
|
mem.add(element);
|
717
721
|
|
722
|
+
// this case occurs when the ATTRIBUTE_UPDATER_SELECT_THIS attribute is set
|
723
|
+
if (!element.hasAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES)) {
|
724
|
+
continue;
|
725
|
+
}
|
726
|
+
|
718
727
|
const attributes = element.getAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES);
|
719
728
|
|
720
729
|
for (let [, def] of Object.entries(attributes.split(","))) {
|
package/source/types/version.mjs
CHANGED
package/test/cases/monster.mjs
CHANGED