iobroker.mywebui 1.37.90 → 1.37.91
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
|
@@ -1101,11 +1101,13 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
|
|
|
1101
1101
|
const fxCb = this._getDomElement('effectsDock')?.querySelector('#editor-fx-cb');
|
|
1102
1102
|
if (animCb) animCb.checked = value;
|
|
1103
1103
|
if (fxCb) fxCb.checked = value;
|
|
1104
|
-
// Apply to all open screen editors
|
|
1104
|
+
// Apply to all open screen editors (designer canvas level)
|
|
1105
1105
|
for (const ed of this._dock.querySelectorAll('iobroker-webui-screen-editor')) {
|
|
1106
1106
|
const canvas = ed.documentContainer?.designerView?.designerCanvas;
|
|
1107
1107
|
if (canvas) canvas.pauseAnimations = value;
|
|
1108
1108
|
}
|
|
1109
|
+
// Notify all ScreenViewer instances (including nested ones inside webcomponents)
|
|
1110
|
+
window.dispatchEvent(new CustomEvent('webui-editor-animations-changed', { detail: { disabled: value } }));
|
|
1109
1111
|
}
|
|
1110
1112
|
|
|
1111
1113
|
_updateEffectsPanel() {
|
|
@@ -330,9 +330,12 @@ let ScreenViewer = class ScreenViewer extends BaseCustomWebComponentConstructorA
|
|
|
330
330
|
|
|
331
331
|
// Group visibility is now handled before applyAllBindings (SSR-style, above)
|
|
332
332
|
|
|
333
|
-
// Apply GSAP animations and effects
|
|
334
|
-
|
|
335
|
-
|
|
333
|
+
// Apply GSAP animations and effects — skip in editor mode when disabled
|
|
334
|
+
if (!this._isEditorAnimationsPaused()) {
|
|
335
|
+
scanAndApplyAnimations(this._rootShadow).catch(() => {});
|
|
336
|
+
scanAndApplyEffects(this._rootShadow).catch(() => {});
|
|
337
|
+
}
|
|
338
|
+
this._applyEditorAnimationState();
|
|
336
339
|
}
|
|
337
340
|
_stretchView(settings) {
|
|
338
341
|
const stretch = this.stretch ?? settings?.stretch;
|
|
@@ -377,7 +380,28 @@ let ScreenViewer = class ScreenViewer extends BaseCustomWebComponentConstructorA
|
|
|
377
380
|
_getRelativeSignalsPath() {
|
|
378
381
|
return this._relativeSignalsPath;
|
|
379
382
|
}
|
|
383
|
+
_isEditorAnimationsPaused() {
|
|
384
|
+
return !window.location.href.includes('runtime.html') && window.appShell?._editorAnimationsEnabled === true;
|
|
385
|
+
}
|
|
386
|
+
_editorPauseSheet = null;
|
|
387
|
+
_applyEditorAnimationState() {
|
|
388
|
+
if (window.location.href.includes('runtime.html')) return;
|
|
389
|
+
const shouldPause = window.appShell?._editorAnimationsEnabled === true;
|
|
390
|
+
if (shouldPause) {
|
|
391
|
+
if (!this._editorPauseSheet) {
|
|
392
|
+
this._editorPauseSheet = new CSSStyleSheet();
|
|
393
|
+
this._editorPauseSheet.replaceSync('*, ::before, ::after { animation-play-state: paused !important; transition: none !important; }');
|
|
394
|
+
}
|
|
395
|
+
if (!this._rootShadow.adoptedStyleSheets.includes(this._editorPauseSheet))
|
|
396
|
+
this._rootShadow.adoptedStyleSheets = [...this._rootShadow.adoptedStyleSheets, this._editorPauseSheet];
|
|
397
|
+
} else {
|
|
398
|
+
if (this._editorPauseSheet)
|
|
399
|
+
this._rootShadow.adoptedStyleSheets = this._rootShadow.adoptedStyleSheets.filter(s => s !== this._editorPauseSheet);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
_onEditorAnimationsChanged = (e) => this._applyEditorAnimationState();
|
|
380
403
|
connectedCallback() {
|
|
404
|
+
window.addEventListener('webui-editor-animations-changed', this._onEditorAnimationsChanged);
|
|
381
405
|
this._refreshViewSubscription = iobrokerHandler.refreshView.on(() => this._loadScreen());
|
|
382
406
|
this._screensChangedSubscription = iobrokerHandler.objectsChanged.on(d => {
|
|
383
407
|
if (this._screenName && d.type == 'screen' && d.name === this._screenName)
|
|
@@ -395,6 +419,7 @@ let ScreenViewer = class ScreenViewer extends BaseCustomWebComponentConstructorA
|
|
|
395
419
|
this._resizeObserver.observe(this);
|
|
396
420
|
}
|
|
397
421
|
disconnectedCallback() {
|
|
422
|
+
window.removeEventListener('webui-editor-animations-changed', this._onEditorAnimationsChanged);
|
|
398
423
|
for (let e of this.#eventListeners) {
|
|
399
424
|
this.removeEventListener(e[0], e[1]);
|
|
400
425
|
}
|