plutonium 0.47.0 โ 0.49.0
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 +36 -0
- data/Rakefile +10 -1
- data/app/assets/plutonium.js +38 -25
- data/app/assets/plutonium.js.map +2 -2
- data/app/assets/plutonium.min.js +29 -29
- data/app/assets/plutonium.min.js.map +3 -3
- data/config/initializers/pagy.rb +1 -1
- data/docs/public/templates/plutonium.rb +3 -0
- data/gemfiles/rails_7.gemfile.lock +27 -1
- data/gemfiles/rails_8.0.gemfile.lock +27 -1
- data/gemfiles/rails_8.1.gemfile.lock +27 -1
- data/lib/generators/pu/gem/actual_db_schema/actual_db_schema_generator.rb +24 -0
- data/lib/generators/pu/lib/plutonium_generators/concerns/configures_sqlite.rb +9 -3
- data/lib/generators/pu/lite/rails_pulse/rails_pulse_generator.rb +6 -3
- data/lib/generators/pu/lite/rails_pulse/templates/config/initializers/rails_pulse.rb.tt +18 -0
- data/lib/plutonium/action/interactive.rb +2 -1
- data/lib/plutonium/core/controller.rb +10 -3
- data/lib/plutonium/engine.rb +1 -1
- data/lib/plutonium/helpers/turbo_stream_actions_helper.rb +20 -1
- data/lib/plutonium/rodauth/controller_methods.rb +5 -1
- data/lib/plutonium/ui/action_button.rb +1 -1
- data/lib/plutonium/ui/color_mode_selector.rb +7 -18
- data/lib/plutonium/ui/layout/rodauth_layout.rb +6 -0
- data/lib/plutonium/ui/table/components/pagy_info.rb +1 -1
- data/lib/plutonium/version.rb +1 -1
- data/package.json +1 -1
- data/plutonium.gemspec +18 -0
- data/src/js/controllers/color_mode_controller.js +41 -34
- metadata +45 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1fd296597ba3188b150bdf43c10dd2dbea52a5e1868a5fde7aa0f294c51422b1
|
|
4
|
+
data.tar.gz: 9bf3369f203a8abb9dfdc044f431280c76b4f2692209005d7f4ec0ca07ccb4bb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 973f8e43740f8de1406bc904cc70926d3d09dcf25bb323a592b50514bfa7652179c0a93e7149aa4be8982f1c1893518d803810d7dcca4936c9f0ef9cf9832192
|
|
7
|
+
data.tar.gz: f5c97706349048b20be9f8771d0c75c5ab36d74904a7cedf158183ed772f7fe362c13d5b0583c373d1bf667689332edfcde5aaa5325aa88c6b3585aa6a7943e5
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
## [0.49.0] - 2026-05-04
|
|
2
|
+
|
|
3
|
+
### ๐ Features
|
|
4
|
+
|
|
5
|
+
- *(generators)* Add `pu:gem:actual_db_schema` and wire into app template
|
|
6
|
+
- *(ui)* Add auto mode to color mode selector
|
|
7
|
+
- *(ui)* Render color mode selector on rodauth layout
|
|
8
|
+
- *(generators)* Flesh out rails_pulse initializer template
|
|
9
|
+
|
|
10
|
+
### ๐ Bug Fixes
|
|
11
|
+
|
|
12
|
+
- *(controller)* Return clean 403 from non-HTML unauthorized handler
|
|
13
|
+
- *(generators)* Align pu:lite:rails_pulse with v0.3 schema flow
|
|
14
|
+
- *(rodauth)* Prefer main_app.root_path over login_redirect
|
|
15
|
+
|
|
16
|
+
### ๐ Refactor
|
|
17
|
+
|
|
18
|
+
- *(routing)* Rename entity scope prefix from `_scope` to `_scoped`
|
|
19
|
+
|
|
20
|
+
### โ๏ธ Miscellaneous Tasks
|
|
21
|
+
|
|
22
|
+
- *(pagy)* Rename :client_max_limit to :max_limit
|
|
23
|
+
- Run appraisals
|
|
24
|
+
## [0.48.0] - 2026-04-16
|
|
25
|
+
|
|
26
|
+
### ๐ Features
|
|
27
|
+
|
|
28
|
+
- *(turbo)* Preserve scroll by emitting refresh when redirect target matches referer
|
|
29
|
+
|
|
30
|
+
### ๐ Bug Fixes
|
|
31
|
+
|
|
32
|
+
- *(action)* Respect `confirmation: false` on interactive actions
|
|
33
|
+
|
|
34
|
+
### ๐งช Testing
|
|
35
|
+
|
|
36
|
+
- *(system)* Browser coverage for Turbo refresh + scroll preservation
|
|
1
37
|
## [0.47.0] - 2026-04-15
|
|
2
38
|
|
|
3
39
|
### ๐ Features
|
data/Rakefile
CHANGED
|
@@ -17,7 +17,16 @@ Rake::Task["build"].enhance ["assets"]
|
|
|
17
17
|
# Unit + integration tests (safe to run together)
|
|
18
18
|
Rake::TestTask.new(:test) do |t|
|
|
19
19
|
t.libs << "test"
|
|
20
|
-
t.test_files = FileList["test/**/*_test.rb"]
|
|
20
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
|
21
|
+
.exclude("test/generators/**/*_test.rb")
|
|
22
|
+
.exclude("test/system/**/*_test.rb")
|
|
23
|
+
t.verbose = true
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# System tests โ require a browser (headless Chrome) and run real Turbo/JS.
|
|
27
|
+
Rake::TestTask.new("test:system") do |t|
|
|
28
|
+
t.libs << "test"
|
|
29
|
+
t.test_files = FileList["test/system/**/*_test.rb"]
|
|
21
30
|
t.verbose = true
|
|
22
31
|
end
|
|
23
32
|
|
data/app/assets/plutonium.js
CHANGED
|
@@ -13383,49 +13383,62 @@
|
|
|
13383
13383
|
};
|
|
13384
13384
|
|
|
13385
13385
|
// src/js/controllers/color_mode_controller.js
|
|
13386
|
+
var ORDER = ["auto", "light", "dark"];
|
|
13386
13387
|
var color_mode_controller_default = class extends Controller {
|
|
13387
13388
|
static values = { current: String };
|
|
13388
13389
|
connect() {
|
|
13389
|
-
|
|
13390
|
-
this.setMode(mode);
|
|
13390
|
+
this.applyMode(this.readMode());
|
|
13391
13391
|
this.handleStorageChange = (e4) => {
|
|
13392
|
-
|
|
13393
|
-
|
|
13394
|
-
console.log("Updating color-mode theme to:", e4.newValue);
|
|
13395
|
-
this.setMode(e4.newValue);
|
|
13396
|
-
}
|
|
13392
|
+
if (e4.key === "theme")
|
|
13393
|
+
this.applyMode(this.readMode());
|
|
13397
13394
|
};
|
|
13398
13395
|
window.addEventListener("storage", this.handleStorageChange);
|
|
13396
|
+
this.mq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
13397
|
+
this.handleMqChange = () => {
|
|
13398
|
+
if (this.readMode() === "auto")
|
|
13399
|
+
this.applyMode("auto");
|
|
13400
|
+
};
|
|
13401
|
+
this.mq.addEventListener("change", this.handleMqChange);
|
|
13399
13402
|
}
|
|
13400
13403
|
disconnect() {
|
|
13401
13404
|
window.removeEventListener("storage", this.handleStorageChange);
|
|
13405
|
+
if (this.mq)
|
|
13406
|
+
this.mq.removeEventListener("change", this.handleMqChange);
|
|
13402
13407
|
}
|
|
13403
13408
|
toggleMode() {
|
|
13404
|
-
const current = this.
|
|
13405
|
-
const next = current
|
|
13409
|
+
const current = this.readMode();
|
|
13410
|
+
const next = ORDER[(ORDER.indexOf(current) + 1) % ORDER.length];
|
|
13406
13411
|
this.setMode(next);
|
|
13407
13412
|
}
|
|
13408
13413
|
setMode(mode) {
|
|
13409
|
-
|
|
13410
|
-
|
|
13411
|
-
|
|
13412
|
-
|
|
13413
|
-
|
|
13414
|
+
localStorage.setItem("theme", mode);
|
|
13415
|
+
this.applyMode(mode);
|
|
13416
|
+
}
|
|
13417
|
+
applyMode(mode) {
|
|
13418
|
+
const effective = this.effectiveMode(mode);
|
|
13419
|
+
document.documentElement.classList.toggle("dark", effective === "dark");
|
|
13414
13420
|
this.currentValue = mode;
|
|
13415
13421
|
this.toggleIcons(mode);
|
|
13416
|
-
|
|
13422
|
+
}
|
|
13423
|
+
readMode() {
|
|
13424
|
+
const saved = localStorage.getItem("theme");
|
|
13425
|
+
return ORDER.includes(saved) ? saved : "auto";
|
|
13426
|
+
}
|
|
13427
|
+
effectiveMode(mode) {
|
|
13428
|
+
if (mode === "light" || mode === "dark")
|
|
13429
|
+
return mode;
|
|
13430
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
13417
13431
|
}
|
|
13418
13432
|
toggleIcons(mode) {
|
|
13419
|
-
const
|
|
13420
|
-
|
|
13421
|
-
|
|
13422
|
-
|
|
13423
|
-
|
|
13424
|
-
|
|
13425
|
-
|
|
13426
|
-
|
|
13427
|
-
|
|
13428
|
-
}
|
|
13433
|
+
const icons = {
|
|
13434
|
+
auto: this.element.querySelector(".color-mode-icon-auto"),
|
|
13435
|
+
light: this.element.querySelector(".color-mode-icon-light"),
|
|
13436
|
+
dark: this.element.querySelector(".color-mode-icon-dark")
|
|
13437
|
+
};
|
|
13438
|
+
for (const [key, el] of Object.entries(icons)) {
|
|
13439
|
+
if (!el)
|
|
13440
|
+
continue;
|
|
13441
|
+
el.classList.toggle("hidden", key !== mode);
|
|
13429
13442
|
}
|
|
13430
13443
|
}
|
|
13431
13444
|
};
|