iobroker.mywebui 1.37.90 → 1.37.92

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.90",
4
+ "version": "1.37.92",
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.90",
3
+ "version": "1.37.92",
4
4
  "description": "ioBroker mywebui - Custom edited mywebui by gokturk413",
5
5
  "type": "module",
6
6
  "main": "dist/backend/main.js",
@@ -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
- scanAndApplyAnimations(this._rootShadow).catch(() => {});
335
- scanAndApplyEffects(this._rootShadow).catch(() => {});
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,38 @@ 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
+ // Stop GSAP-driven animations and effects (background-color, effects, etc.)
392
+ cleanupAnimations(this._rootShadow);
393
+ cleanupEffects(this._rootShadow);
394
+ // Also pause any remaining CSS @keyframes animations
395
+ if (!this._editorPauseSheet) {
396
+ this._editorPauseSheet = new CSSStyleSheet();
397
+ this._editorPauseSheet.replaceSync('*, ::before, ::after { animation-play-state: paused !important; transition: none !important; }');
398
+ }
399
+ if (!this._rootShadow.adoptedStyleSheets.includes(this._editorPauseSheet))
400
+ this._rootShadow.adoptedStyleSheets = [...this._rootShadow.adoptedStyleSheets, this._editorPauseSheet];
401
+ } else {
402
+ // Remove CSS pause sheet
403
+ if (this._editorPauseSheet)
404
+ this._rootShadow.adoptedStyleSheets = this._rootShadow.adoptedStyleSheets.filter(s => s !== this._editorPauseSheet);
405
+ // Restart GSAP animations if screen content is present
406
+ if (this._rootShadow.childElementCount > 0) {
407
+ scanAndApplyAnimations(this._rootShadow).catch(() => {});
408
+ scanAndApplyEffects(this._rootShadow).catch(() => {});
409
+ }
410
+ }
411
+ }
412
+ _onEditorAnimationsChanged = (e) => this._applyEditorAnimationState();
380
413
  connectedCallback() {
414
+ window.addEventListener('webui-editor-animations-changed', this._onEditorAnimationsChanged);
381
415
  this._refreshViewSubscription = iobrokerHandler.refreshView.on(() => this._loadScreen());
382
416
  this._screensChangedSubscription = iobrokerHandler.objectsChanged.on(d => {
383
417
  if (this._screenName && d.type == 'screen' && d.name === this._screenName)
@@ -395,6 +429,7 @@ let ScreenViewer = class ScreenViewer extends BaseCustomWebComponentConstructorA
395
429
  this._resizeObserver.observe(this);
396
430
  }
397
431
  disconnectedCallback() {
432
+ window.removeEventListener('webui-editor-animations-changed', this._onEditorAnimationsChanged);
398
433
  for (let e of this.#eventListeners) {
399
434
  this.removeEventListener(e[0], e[1]);
400
435
  }