shadok-ai 0.18.1 → 0.18.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/public/index.html +13 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shadok-ai",
3
- "version": "0.18.1",
3
+ "version": "0.18.2",
4
4
  "main": "dist/session.js",
5
5
  "scripts": {
6
6
  "test": "node --import tsx --test --test-timeout=120000 test/*.ts context/*/test/*.test.mjs",
package/public/index.html CHANGED
@@ -48,7 +48,7 @@
48
48
  /* Light mode. An ORTHOGONAL axis to the accent palette: only the base surfaces
49
49
  and text flip; the instance's accent (--amber/--phosphor) stays its identity.
50
50
  Applied via `data-mode="light"` on <html>, a PER-BROWSER comfort choice set
51
- from localStorage before first paint (the small head script) — default dark.
51
+ from localStorage before first paint (the small head script) — default light.
52
52
  --phosphor darkens here: the selection bar is a 3px inset of it, invisible as
53
53
  a pale amber on white. Accent-tinted surfaces (--amber-soft) derive from
54
54
  --amber and follow on their own. */
@@ -3237,10 +3237,17 @@
3237
3237
  }
3238
3238
  </style>
3239
3239
  <!-- Light/dark mode is a per-browser choice (localStorage). Set it BEFORE the
3240
- body paints — here in <head> — so a light-preferring viewer never sees a
3241
- flash of the dark default. Nonce'd like every inline script (invariant 12). -->
3240
+ body paints — here in <head> — so a dark-preferring viewer never sees a
3241
+ flash of the light default. Nonce'd like every inline script (invariant 12).
3242
+ Default LIGHT: the attribute is set unless the viewer explicitly chose dark,
3243
+ so a fresh browser (and a storage read that throws) lands on light. Dark
3244
+ stays the ABSENCE of the attribute, which every `:not([data-mode="light"])`
3245
+ rule relies on — only the default this script picks has flipped. -->
3242
3246
  <script nonce="__CSP_NONCE__">
3243
- try { if (localStorage.getItem("cp.mode") === "light") document.documentElement.setAttribute("data-mode", "light"); } catch (e) {}
3247
+ try {
3248
+ if (localStorage.getItem("cp.mode") === "dark") document.documentElement.removeAttribute("data-mode");
3249
+ else document.documentElement.setAttribute("data-mode", "light");
3250
+ } catch (e) { document.documentElement.setAttribute("data-mode", "light"); }
3244
3251
  // When the cockpit's OWN session expires mid-use (the account cookie lapses —
3245
3252
  // a week by default — or the GUI password changes under us), the server starts
3246
3253
  // answering every request 401 and refuses the WebSocket upgrade. The page used
@@ -3321,7 +3328,7 @@
3321
3328
  <button id="starMenuItem">★ Star on GitHub</button>
3322
3329
  <div class="mm-sep"></div>
3323
3330
  <div class="mm-label">Appearance</div>
3324
- <!-- Light / dark mode — per browser (localStorage), default dark. -->
3331
+ <!-- Light / dark mode — per browser (localStorage), default light. -->
3325
3332
  <div id="modeRow" class="mm-mode">
3326
3333
  <button type="button" data-mode="dark">☾ Dark</button>
3327
3334
  <button type="button" data-mode="light">☀ Light</button>
@@ -7275,7 +7282,7 @@
7275
7282
  // A comfort choice that belongs to the person, not the cockpit's identity (the
7276
7283
  // accent palette is the shared one). The <head> script already set the
7277
7284
  // attribute before paint; this syncs the toggle and re-paints the favicon
7278
- // (which reads --bg / --amber live). Default dark → no attribute.
7285
+ // (which reads --bg / --amber live). Dark → no attribute (default is light).
7279
7286
  function syncModeButtons() {
7280
7287
  const light = document.documentElement.getAttribute("data-mode") === "light";
7281
7288
  for (const b of document.querySelectorAll("#modeRow button")) {