openproject-primer_view_components 0.48.0 → 0.48.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/app/assets/javascripts/app/components/primer/open_project/zen_mode_button.d.ts +1 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/components/primer/open_project/page_header/title.rb +1 -1
- data/app/components/primer/open_project/zen_mode_button.d.ts +1 -0
- data/app/components/primer/open_project/zen_mode_button.js +11 -0
- data/app/components/primer/open_project/zen_mode_button.ts +12 -0
- data/lib/primer/view_components/version.rb +1 -1
- metadata +2 -2
@@ -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:
|
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,
|
@@ -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
|
|
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.
|
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-
|
12
|
+
date: 2024-10-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionview
|