iobroker.mywebui 1.37.77 → 1.37.79
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 +1 -1
- package/package.json +1 -1
- package/www/dist/frontend/config/IobrokerWebuiScreenEditor.js +1 -1
- package/www/dist/frontend/runtime/AnimationService.js +7 -0
- package/www/dist/frontend/runtime/ScreenViewer.js +2 -15
- package/www/index.html +7 -5
- package/www/runtime.html +7 -4
package/io-package.json
CHANGED
package/package.json
CHANGED
|
@@ -107,7 +107,7 @@ export class IobrokerWebuiScreenEditor extends BaseCustomWebComponentConstructor
|
|
|
107
107
|
// Visibility configs are stored as HTML attributes (data-visibility-*)
|
|
108
108
|
// They are automatically loaded with HTML
|
|
109
109
|
|
|
110
|
-
this.documentContainer.designerView.designerCanvas.onContentChanged
|
|
110
|
+
this.documentContainer.designerView.designerCanvas.onContentChanged?.on(() => {
|
|
111
111
|
this.applyBindings();
|
|
112
112
|
});
|
|
113
113
|
}, 50);
|
|
@@ -16,15 +16,22 @@ async function ensureGSAP() {
|
|
|
16
16
|
s.onerror = rej;
|
|
17
17
|
document.head.appendChild(s);
|
|
18
18
|
});
|
|
19
|
+
// Monaco Editor's AMD loader sets window.define which causes GSAP plugins
|
|
20
|
+
// to register as anonymous AMD modules — Monaco rejects multiple anonymous
|
|
21
|
+
// defines. Temporarily remove define so GSAP loads as plain UMD globals.
|
|
22
|
+
const _savedDefine = window.define;
|
|
23
|
+
window.define = undefined;
|
|
19
24
|
loadScript(_gsapBase + 'gsap.min.js')
|
|
20
25
|
.then(() => loadScript(_gsapBase + 'MotionPathPlugin.min.js'))
|
|
21
26
|
.then(() => loadScript(_gsapBase + 'MorphSVGPlugin.min.js'))
|
|
22
27
|
.then(() => {
|
|
28
|
+
window.define = _savedDefine;
|
|
23
29
|
if (window.MotionPathPlugin) window.gsap.registerPlugin(window.MotionPathPlugin);
|
|
24
30
|
if (window.MorphSVGPlugin) window.gsap.registerPlugin(window.MorphSVGPlugin);
|
|
25
31
|
resolve(window.gsap);
|
|
26
32
|
})
|
|
27
33
|
.catch(() => {
|
|
34
|
+
window.define = _savedDefine;
|
|
28
35
|
console.warn('[AnimationService] Failed to load GSAP from local path:', _gsapBase);
|
|
29
36
|
resolve(window.gsap || null);
|
|
30
37
|
});
|
|
@@ -397,24 +397,11 @@ let ScreenViewer = class ScreenViewer extends BaseCustomWebComponentConstructorA
|
|
|
397
397
|
if (this._screenName && d.type == 'screen' && d.name === this._screenName)
|
|
398
398
|
this._loadScreen();
|
|
399
399
|
});
|
|
400
|
-
console.log('🔗 [ScreenViewer] connectedCallback for "' + this.screenName + '"');
|
|
401
|
-
|
|
402
|
-
// Check if module with default export
|
|
403
400
|
let scriptObj = this._scriptObject;
|
|
404
|
-
if (scriptObj?.default && !scriptObj?.connectedCallback)
|
|
405
|
-
console.log('🔄 [ScreenViewer] Using default export in connectedCallback');
|
|
401
|
+
if (scriptObj?.default && !scriptObj?.connectedCallback)
|
|
406
402
|
scriptObj = scriptObj.default;
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
console.log('🔗 [ScreenViewer] Final scriptObj:', scriptObj);
|
|
410
|
-
console.log('🔗 [ScreenViewer] Has callback?', typeof scriptObj?.connectedCallback);
|
|
411
|
-
|
|
412
|
-
if (scriptObj?.connectedCallback) {
|
|
413
|
-
console.log('✅ [ScreenViewer] Calling connectedCallback for "' + this.screenName + '"');
|
|
403
|
+
if (scriptObj?.connectedCallback)
|
|
414
404
|
scriptObj.connectedCallback(this, this._rootShadow);
|
|
415
|
-
} else {
|
|
416
|
-
console.warn('⚠️ [ScreenViewer] No connectedCallback for "' + this.screenName + '"');
|
|
417
|
-
}
|
|
418
405
|
for (let e of this.#eventListeners) {
|
|
419
406
|
this.addEventListener(e[0], e[1]);
|
|
420
407
|
}
|
package/www/index.html
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
|
-
<link rel="manifest" href="./manifest.json">
|
|
7
6
|
|
|
8
7
|
<script src="./node_modules/blockly/blockly_compressed.js"></script>
|
|
9
8
|
<script src="./node_modules/blockly/blocks_compressed.js"></script>
|
|
@@ -51,10 +50,13 @@
|
|
|
51
50
|
|
|
52
51
|
<script type="module">
|
|
53
52
|
try {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
await new Promise((resolve) => {
|
|
54
|
+
const scp = document.createElement('script');
|
|
55
|
+
scp.src = iobrokerWebRootUrl + "mywebui.0.widgets/importmap.js";
|
|
56
|
+
scp.onload = resolve;
|
|
57
|
+
scp.onerror = resolve; // file may not exist (no widgets installed)
|
|
58
|
+
document.head.appendChild(scp);
|
|
59
|
+
});
|
|
58
60
|
await importShim(iobrokerWebRootUrl + 'mywebui.0.widgets/importWidgetFiles.js');
|
|
59
61
|
} catch (err) {
|
|
60
62
|
console.warn(err);
|
package/www/runtime.html
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
|
-
<link rel="manifest" href="./manifest.json">
|
|
7
6
|
<script src="./node_modules/blockly/blockly_compressed.js"></script>
|
|
8
7
|
<script src="./node_modules/blockly/blocks_compressed.js"></script>
|
|
9
8
|
<script src="./node_modules/blockly/javascript_compressed.js"></script>
|
|
@@ -54,9 +53,13 @@
|
|
|
54
53
|
</body>
|
|
55
54
|
|
|
56
55
|
<script type="module">
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
await new Promise((resolve) => {
|
|
57
|
+
const scp = document.createElement('script');
|
|
58
|
+
scp.src = iobrokerWebRootUrl + "mywebui.0.widgets/importmap.js";
|
|
59
|
+
scp.onload = resolve;
|
|
60
|
+
scp.onerror = resolve; // file may not exist (no widgets installed)
|
|
61
|
+
document.head.appendChild(scp);
|
|
62
|
+
});
|
|
60
63
|
|
|
61
64
|
await importShim('./dist/frontend/runtime/init.js');
|
|
62
65
|
importShim('./dist/frontend/runtime/controls.js');
|