@openproject/primer-view-components 0.48.0 → 0.48.1-rc.0c99d18a

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.
@@ -1,6 +1,7 @@
1
1
  declare class ZenModeButtonElement extends HTMLElement {
2
2
  button: HTMLElement;
3
3
  inZenMode: boolean;
4
+ dispatchZenModeStatus(): void;
4
5
  private deactivateZenMode;
5
6
  private activateZenMode;
6
7
  performAction(): void;
@@ -10,6 +10,16 @@ let ZenModeButtonElement = class ZenModeButtonElement extends HTMLElement {
10
10
  super(...arguments);
11
11
  this.inZenMode = false;
12
12
  }
13
+ dispatchZenModeStatus() {
14
+ // Create a new custom event
15
+ const event = new CustomEvent('zenModeToggled', {
16
+ detail: {
17
+ active: this.inZenMode,
18
+ },
19
+ });
20
+ // Dispatch the custom event
21
+ window.dispatchEvent(event);
22
+ }
13
23
  deactivateZenMode() {
14
24
  this.inZenMode = false;
15
25
  this.button.setAttribute('aria-pressed', 'false');
@@ -31,6 +41,7 @@ let ZenModeButtonElement = class ZenModeButtonElement extends HTMLElement {
31
41
  else {
32
42
  this.activateZenMode();
33
43
  }
44
+ this.dispatchZenModeStatus();
34
45
  }
35
46
  };
36
47
  __decorate([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openproject/primer-view-components",
3
- "version": "0.48.0",
3
+ "version": "0.48.1-rc.0c99d18a",
4
4
  "description": "ViewComponents of the Primer Design System for OpenProject",
5
5
  "main": "app/assets/javascripts/primer_view_components.js",
6
6
  "module": "app/components/primer/primer.js",