iobroker.mywebui 1.37.93 → 1.37.95

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/io-package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "mywebui",
4
- "version": "1.37.93",
4
+ "version": "1.37.95",
5
5
  "titleLang": {
6
6
  "en": "mywebui",
7
7
  "de": "mywebui",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.mywebui",
3
- "version": "1.37.93",
3
+ "version": "1.37.95",
4
4
  "description": "ioBroker mywebui - Custom edited mywebui by gokturk413",
5
5
  "type": "module",
6
6
  "main": "dist/backend/main.js",
@@ -2,6 +2,33 @@ import { iobrokerHandler } from '../common/IobrokerHandler.js';
2
2
 
3
3
  let _gsapLoadPromise = null;
4
4
 
5
+ /**
6
+ * Find an element by ID across all shadow DOM boundaries.
7
+ * Starts from the shadow root of fromElement, walks UP through host shadow roots,
8
+ * and at each level searches DOWN through all nested shadow roots.
9
+ * Covers: same root, path inside nested custom control, path in parent screen, etc.
10
+ */
11
+ function findElementAcrossShadows(fromElement, id) {
12
+ function searchDown(root) {
13
+ const found = root.getElementById ? root.getElementById(id) : root.querySelector('#' + id);
14
+ if (found) return found;
15
+ for (const el of root.querySelectorAll('*')) {
16
+ if (el.shadowRoot) {
17
+ const f = searchDown(el.shadowRoot);
18
+ if (f) return f;
19
+ }
20
+ }
21
+ return null;
22
+ }
23
+ let root = fromElement.getRootNode();
24
+ while (root instanceof ShadowRoot) {
25
+ const found = searchDown(root);
26
+ if (found) return found;
27
+ root = root.host.getRootNode();
28
+ }
29
+ return searchDown(document.body) ?? document.getElementById(id);
30
+ }
31
+
5
32
  // AnimationService.js is at dist/frontend/runtime/ → ../../vendor/gsap/ = dist/vendor/gsap/
6
33
  const _gsapBase = new URL('../../vendor/gsap/', import.meta.url).href;
7
34
 
@@ -413,11 +440,11 @@ class AnimationInstance {
413
440
  const effect = this.cfg.effect;
414
441
 
415
442
  if (effect === 'motionPath' && this.cfg.pathId) {
416
- // Search in shadow root first — document.getElementById doesn't see shadow DOM elements
417
- const rootNode = this.element.getRootNode();
418
- const pathEl = (rootNode instanceof ShadowRoot ? rootNode : document).getElementById(this.cfg.pathId)
419
- ?? document.getElementById(this.cfg.pathId);
443
+ let pathEl = findElementAcrossShadows(this.element, this.cfg.pathId);
420
444
  if (!pathEl) { console.warn('[AnimationService] motionPath: path element not found:', this.cfg.pathId); return; }
445
+ // If ID is on <svg> container, use the first <path> inside it
446
+ if (pathEl.tagName.toLowerCase() === 'svg')
447
+ pathEl = pathEl.querySelector('path') ?? pathEl;
421
448
  this.tween = gsap.to(this.element, {
422
449
  duration: parseFloat(this.cfg.duration) || 1,
423
450
  ease: this.cfg.ease || 'none',