@schukai/monster 4.87.0 → 4.89.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
 
4
4
 
5
+ ## [4.89.0] - 2026-01-11
6
+
7
+ ### Add Features
8
+
9
+ - Enhance root node retrieval for linked forms
10
+
11
+
12
+
13
+ ## [4.88.0] - 2026-01-11
14
+
15
+ ### Add Features
16
+
17
+ - Enhance save-button functionality to support multiple document scopes [#371](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/371)
18
+
19
+
20
+
5
21
  ## [4.87.0] - 2026-01-11
6
22
 
7
23
  ### Add Features
package/package.json CHANGED
@@ -1 +1 @@
1
- {"author":"Volker Schukai","dependencies":{"@floating-ui/dom":"^1.7.4","@popperjs/core":"^2.11.8"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"4.87.0"}
1
+ {"author":"Volker Schukai","dependencies":{"@floating-ui/dom":"^1.7.4","@popperjs/core":"^2.11.8"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"4.89.0"}
@@ -398,8 +398,34 @@ function flushLinkedForms() {
398
398
  return Promise.resolve();
399
399
  }
400
400
 
401
+ const roots = new Set();
402
+ let current = this;
403
+ while (current) {
404
+ const root = current.getRootNode?.();
405
+ if (root && typeof root.querySelectorAll === "function") {
406
+ roots.add(root);
407
+ }
408
+
409
+ if (root instanceof ShadowRoot) {
410
+ current = root.host;
411
+ } else {
412
+ break;
413
+ }
414
+ }
415
+
401
416
  const doc = getDocument();
402
- const forms = doc.querySelectorAll("monster-form");
417
+ if (doc) {
418
+ roots.add(doc);
419
+ }
420
+
421
+ const forms = new Set();
422
+ for (const scope of roots) {
423
+ const nodes = scope.querySelectorAll?.("monster-form") || [];
424
+ for (const node of nodes) {
425
+ forms.add(node);
426
+ }
427
+ }
428
+
403
429
  const writes = [];
404
430
 
405
431
  for (const form of forms) {