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
package/package.json
CHANGED
|
@@ -120,10 +120,10 @@ export class IobrokerWebui3DScreenEditor extends BaseCustomWebComponentConstruct
|
|
|
120
120
|
document.head.appendChild(link);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
//
|
|
124
|
-
//
|
|
125
|
-
// esprima.js
|
|
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
|
|
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
|
-
|
|
341
|
-
|
|
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
|
}
|