openproject-primer_view_components 0.48.0 → 0.48.1

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.
@@ -11,7 +11,7 @@ module Primer
11
11
  HEADING_TAG_OPTIONS = [:h1, :h2, :h3, :h4, :h5, :h6].freeze
12
12
  HEADING_TAG_FALLBACK = :h1
13
13
 
14
- renders_one :editable_form, lambda { |model: nil, update_path:, cancel_path:, input_name: :title, method: :put, label: I18n.t(:label_title), placeholder: I18n.t(:label_title), **system_arguments|
14
+ renders_one :editable_form, lambda { |model: false, update_path:, cancel_path:, input_name: :title, method: :put, label: I18n.t(:label_title), placeholder: I18n.t(:label_title), **system_arguments|
15
15
  primer_form_with(
16
16
  model: model,
17
17
  method: method,
@@ -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([
@@ -5,6 +5,17 @@ class ZenModeButtonElement extends HTMLElement {
5
5
  @target button: HTMLElement
6
6
  inZenMode = false
7
7
 
8
+ dispatchZenModeStatus() {
9
+ // Create a new custom event
10
+ const event = new CustomEvent('zenModeToggled', {
11
+ detail: {
12
+ active: this.inZenMode,
13
+ },
14
+ })
15
+ // Dispatch the custom event
16
+ window.dispatchEvent(event)
17
+ }
18
+
8
19
  private deactivateZenMode() {
9
20
  this.inZenMode = false
10
21
  this.button.setAttribute('aria-pressed', 'false')
@@ -27,6 +38,7 @@ class ZenModeButtonElement extends HTMLElement {
27
38
  } else {
28
39
  this.activateZenMode()
29
40
  }
41
+ this.dispatchZenModeStatus()
30
42
  }
31
43
  }
32
44
 
@@ -6,7 +6,7 @@ module Primer
6
6
  module VERSION
7
7
  MAJOR = 0
8
8
  MINOR = 48
9
- PATCH = 0
9
+ PATCH = 1
10
10
 
11
11
  STRING = [MAJOR, MINOR, PATCH].join(".")
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openproject-primer_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.48.0
4
+ version: 0.48.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Open Source
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-10-08 00:00:00.000000000 Z
12
+ date: 2024-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionview