plutonium 0.48.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d07d40ddf359fb63528f92bae1e1c10c0ec19d4d8101a7202e1c7ae30a798e90
4
- data.tar.gz: 30fe5b1d2c89bd08552b3d64eb84795bc12e5417805b7ffd6c18f84f5f05d8d1
3
+ metadata.gz: 1fd296597ba3188b150bdf43c10dd2dbea52a5e1868a5fde7aa0f294c51422b1
4
+ data.tar.gz: 9bf3369f203a8abb9dfdc044f431280c76b4f2692209005d7f4ec0ca07ccb4bb
5
5
  SHA512:
6
- metadata.gz: f5652a759d23236d48265376846ed7269a34ab6a7796bb40c6cc2331a7be308a8de472cda0405e7453ce52ae6452bcb291aaf2c784d305a9dbec451d1be3efa8
7
- data.tar.gz: 3aee38cfc32329df17558559fcda9f1cae1c0605dc8c5a70d3e8ccd74ec5a4de9a04082e95b7368a07e812fe9a1b7d59e89405077e1dfb8210241710f59b3397
6
+ metadata.gz: 973f8e43740f8de1406bc904cc70926d3d09dcf25bb323a592b50514bfa7652179c0a93e7149aa4be8982f1c1893518d803810d7dcca4936c9f0ef9cf9832192
7
+ data.tar.gz: f5c97706349048b20be9f8771d0c75c5ab36d74904a7cedf158183ed772f7fe362c13d5b0583c373d1bf667689332edfcde5aaa5325aa88c6b3585aa6a7943e5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
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
1
24
  ## [0.48.0] - 2026-04-16
2
25
 
3
26
  ### 🚀 Features
@@ -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
- const mode = localStorage.getItem("theme") || "light";
13390
- this.setMode(mode);
13390
+ this.applyMode(this.readMode());
13391
13391
  this.handleStorageChange = (e4) => {
13392
- console.log("Storage event received in color-mode controller:", e4.key, e4.newValue, e4.oldValue);
13393
- if (e4.key === "theme" && e4.newValue) {
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.currentValue || "light";
13405
- const next = current === "light" ? "dark" : "light";
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
- if (mode === "dark") {
13410
- document.documentElement.classList.add("dark");
13411
- } else {
13412
- document.documentElement.classList.remove("dark");
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
- localStorage.setItem("theme", mode);
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 sun = this.element.querySelector(".color-mode-icon-light");
13420
- const moon = this.element.querySelector(".color-mode-icon-dark");
13421
- if (sun && moon) {
13422
- if (mode === "light") {
13423
- sun.classList.remove("hidden");
13424
- moon.classList.add("hidden");
13425
- } else {
13426
- sun.classList.add("hidden");
13427
- moon.classList.remove("hidden");
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
  };