iobroker.mywebui 1.42.27 → 1.42.28

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.42.27",
4
+ "version": "1.42.28",
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.42.27",
3
+ "version": "1.42.28",
4
4
  "description": "ioBroker mywebui - Custom edited mywebui by gokturk413 with 3D Editor",
5
5
  "type": "module",
6
6
  "main": "dist/backend/main.js",
@@ -120,10 +120,10 @@ export class IobrokerWebui3DScreenEditor extends BaseCustomWebComponentConstruct
120
120
  document.head.appendChild(link);
121
121
  }
122
122
 
123
- // Load required global libs (signals, jsonlint)
124
- // esprima is NOT loaded: Script.js is disabled (no CodeMirror) and
125
- // esprima.js conflicts with the webui's AMD loader (anonymous define conflict)
126
- await this._loadScript(EDITOR_BASE + 'js/libs/signals.min.js');
123
+ // signals.min.js uses UMD: if AMD define() is present it registers as AMD
124
+ // module instead of setting window.signals. Hide define temporarily.
125
+ // esprima.js is NOT loaded (Script.js disabled no CodeMirror needed).
126
+ await this._loadScript(EDITOR_BASE + 'js/libs/signals.min.js', true);
127
127
  await this._loadScript(EDITOR_BASE + 'js/libs/jsonlint.js');
128
128
 
129
129
  // Dynamically import all editor modules (they use the importmap for 'three')
@@ -332,13 +332,20 @@ export class IobrokerWebui3DScreenEditor extends BaseCustomWebComponentConstruct
332
332
 
333
333
  // ── Helpers ───────────────────────────────────────────────────────────────
334
334
 
335
- _loadScript(src) {
336
- return new Promise((resolve, reject) => {
335
+ _loadScript(src, hideAMD = false) {
336
+ return new Promise((resolve) => {
337
337
  if (document.querySelector(`script[src="${src}"]`)) { resolve(); return; }
338
338
  const s = document.createElement('script');
339
339
  s.src = src;
340
- s.onload = resolve;
341
- s.onerror = () => { console.warn('Script load failed:', src); resolve(); };
340
+ // Some UMD libs (e.g. signals.min.js) prefer AMD define() over window.*
341
+ // when define is present. Hide it so they fall back to window assignment.
342
+ const savedDefine = hideAMD ? window.define : undefined;
343
+ if (hideAMD) window.define = undefined;
344
+ s.onload = () => {
345
+ if (hideAMD) window.define = savedDefine;
346
+ resolve();
347
+ };
348
+ s.onerror = () => { if (hideAMD) window.define = savedDefine; resolve(); };
342
349
  document.head.appendChild(s);
343
350
  });
344
351
  }