plutonium 0.56.2 → 0.56.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/app/assets/plutonium.css +1 -1
- data/app/assets/plutonium.js +2 -4
- data/app/assets/plutonium.js.map +2 -2
- data/app/assets/plutonium.min.js +1 -1
- data/app/assets/plutonium.min.js.map +2 -2
- data/lib/plutonium/ui/layout/base.rb +8 -7
- data/lib/plutonium/ui/layout/icon_rail.rb +6 -2
- data/lib/plutonium/ui/layout/sidebar.rb +1 -1
- data/lib/plutonium/ui/table/components/scopes_pills.rb +3 -2
- data/lib/plutonium/version.rb +1 -1
- data/package.json +1 -1
- data/src/css/components.css +4 -1
- data/src/js/controllers/icon_rail_controller.js +3 -4
- metadata +2 -2
|
@@ -44,11 +44,12 @@ module Plutonium
|
|
|
44
44
|
# preferences read from localStorage:
|
|
45
45
|
# - Color mode: applies `dark` class on <html> so dark theme renders
|
|
46
46
|
# from the first frame instead of flashing light.
|
|
47
|
-
# - Rail-pin:
|
|
48
|
-
# on
|
|
49
|
-
#
|
|
50
|
-
#
|
|
51
|
-
#
|
|
47
|
+
# - Rail-pin: the rail is pinned by default, so this applies
|
|
48
|
+
# `pu-rail-pinned` on <body> (when present) and on every incoming
|
|
49
|
+
# body via turbo:before-render unless the user explicitly collapsed
|
|
50
|
+
# it (localStorage "false"), so a Turbo.visit (e.g. the redirect
|
|
51
|
+
# after a form submit) doesn't flash the rail into its collapsed
|
|
52
|
+
# state before the icon-rail Stimulus controller can restore it.
|
|
52
53
|
def render_pre_paint_scripts
|
|
53
54
|
script do
|
|
54
55
|
raw(safe(<<~JS))
|
|
@@ -62,10 +63,10 @@ module Plutonium
|
|
|
62
63
|
} catch (e) {}
|
|
63
64
|
|
|
64
65
|
try {
|
|
65
|
-
if (localStorage.getItem("pu_rail_pinned")
|
|
66
|
+
if (localStorage.getItem("pu_rail_pinned") === "false") return;
|
|
66
67
|
if (document.body) document.body.classList.add("pu-rail-pinned");
|
|
67
68
|
document.addEventListener("turbo:before-render", function (event) {
|
|
68
|
-
if (localStorage.getItem("pu_rail_pinned")
|
|
69
|
+
if (localStorage.getItem("pu_rail_pinned") !== "false") {
|
|
69
70
|
event.detail.newBody.classList.add("pu-rail-pinned");
|
|
70
71
|
}
|
|
71
72
|
});
|
|
@@ -39,7 +39,7 @@ module Plutonium
|
|
|
39
39
|
id: "sidebar-navigation",
|
|
40
40
|
data: {controller: "sidebar icon-rail"},
|
|
41
41
|
aria: {label: "Sidebar Navigation"},
|
|
42
|
-
class: "fixed top-0 left-0 z-40 h-
|
|
42
|
+
class: "fixed top-0 left-0 z-40 h-dvh " \
|
|
43
43
|
"bg-[var(--pu-surface)] border-r border-[var(--pu-border)] " \
|
|
44
44
|
"flex flex-col transition-[width] duration-200 overflow-x-hidden " \
|
|
45
45
|
"-translate-x-full lg:translate-x-0"
|
|
@@ -54,7 +54,11 @@ module Plutonium
|
|
|
54
54
|
|
|
55
55
|
def render_brand_section
|
|
56
56
|
div(class: "h-12 flex items-center justify-center border-b border-[var(--pu-border)] shrink-0") do
|
|
57
|
-
|
|
57
|
+
next unless brand_slot?
|
|
58
|
+
|
|
59
|
+
a(href: root_path, aria: {label: "Home"}, class: "flex items-center justify-center") do
|
|
60
|
+
render brand_slot
|
|
61
|
+
end
|
|
58
62
|
end
|
|
59
63
|
end
|
|
60
64
|
|
|
@@ -18,7 +18,7 @@ module Plutonium
|
|
|
18
18
|
data: {controller: "sidebar"},
|
|
19
19
|
id: "sidebar-navigation",
|
|
20
20
|
aria: {label: "Sidebar Navigation"},
|
|
21
|
-
class: "fixed top-0 left-0 z-40 w-64 h-
|
|
21
|
+
class: "fixed top-0 left-0 z-40 w-64 h-dvh pt-14 transition-transform -translate-x-full lg:translate-x-0"
|
|
22
22
|
) do
|
|
23
23
|
div(
|
|
24
24
|
id: "sidebar-navigation-content",
|
|
@@ -10,7 +10,8 @@ module Plutonium
|
|
|
10
10
|
|
|
11
11
|
nav(role: "tablist",
|
|
12
12
|
aria: {label: "Scope"},
|
|
13
|
-
class: "flex items-center gap-1 px-4 py-2 border-b border-[var(--pu-border)]"
|
|
13
|
+
class: "flex flex-nowrap items-center gap-1 px-4 py-2 border-b border-[var(--pu-border)] " \
|
|
14
|
+
"overflow-x-auto whitespace-nowrap [scrollbar-width:none] [&::-webkit-scrollbar]:hidden") do
|
|
14
15
|
render_all_pill
|
|
15
16
|
scopes.each_key { |key| render_pill(key) }
|
|
16
17
|
end
|
|
@@ -43,7 +44,7 @@ module Plutonium
|
|
|
43
44
|
end
|
|
44
45
|
|
|
45
46
|
def pill_classes(active)
|
|
46
|
-
base = "px-3 py-1 rounded-md text-sm transition-colors"
|
|
47
|
+
base = "shrink-0 px-3 py-1 rounded-md text-sm transition-colors"
|
|
47
48
|
state = if active
|
|
48
49
|
"bg-primary-100 text-primary-700 dark:bg-primary-950/40 dark:text-primary-300"
|
|
49
50
|
else
|
data/lib/plutonium/version.rb
CHANGED
data/package.json
CHANGED
data/src/css/components.css
CHANGED
|
@@ -780,8 +780,11 @@ body.pu-rail-pinned .icon-rail-pin-expand {
|
|
|
780
780
|
box-shadow: var(--pu-shadow-lg);
|
|
781
781
|
padding: 6px;
|
|
782
782
|
animation: pu-rail-flyout-in 120ms ease-out;
|
|
783
|
-
/* Cap to the viewport so long menus scroll instead of overflowing.
|
|
783
|
+
/* Cap to the viewport so long menus scroll instead of overflowing.
|
|
784
|
+
dvh tracks the visible viewport so the cap holds on mobile (where
|
|
785
|
+
100vh sits behind the browser chrome); 100vh is the fallback. */
|
|
784
786
|
max-height: calc(100vh - 16px);
|
|
787
|
+
max-height: calc(100dvh - 16px);
|
|
785
788
|
overflow-y: auto;
|
|
786
789
|
overscroll-behavior: contain;
|
|
787
790
|
}
|
|
@@ -9,10 +9,9 @@ export default class extends Controller {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
connect() {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
12
|
+
// Pinned is the default; only an explicit "false" collapses the rail.
|
|
13
|
+
const pinned = localStorage.getItem(this.storageKeyValue) !== "false"
|
|
14
|
+
document.body.classList.toggle("pu-rail-pinned", pinned)
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
togglePin() {
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: plutonium
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.56.
|
|
4
|
+
version: 0.56.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stefan Froelich
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-06-
|
|
10
|
+
date: 2026-06-07 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: zeitwerk
|