iobroker.mywebui 1.37.92 → 1.37.94

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.92",
4
+ "version": "1.37.94",
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.92",
3
+ "version": "1.37.94",
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,7 +440,7 @@ class AnimationInstance {
413
440
  const effect = this.cfg.effect;
414
441
 
415
442
  if (effect === 'motionPath' && this.cfg.pathId) {
416
- const pathEl = document.getElementById(this.cfg.pathId);
443
+ const pathEl = findElementAcrossShadows(this.element, this.cfg.pathId);
417
444
  if (!pathEl) { console.warn('[AnimationService] motionPath: path element not found:', this.cfg.pathId); return; }
418
445
  this.tween = gsap.to(this.element, {
419
446
  duration: parseFloat(this.cfg.duration) || 1,
@@ -422,8 +449,8 @@ class AnimationInstance {
422
449
  yoyo: this.cfg.yoyo === true,
423
450
  paused: true,
424
451
  motionPath: {
425
- path: '#' + this.cfg.pathId,
426
- align: this.cfg.alignToPath ? '#' + this.cfg.pathId : false,
452
+ path: pathEl,
453
+ align: this.cfg.alignToPath ? pathEl : false,
427
454
  autoRotate: this.cfg.orientToPath === true,
428
455
  alignOrigin: [0.5, 0.5],
429
456
  start: this.cfg.valueFrom ? parseFloat(this.cfg.valueFrom) / 100 : 0,