@aparte/core 0.16.5 → 0.16.7

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.
package/dist/index.css CHANGED
@@ -453,11 +453,91 @@
453
453
  --aparte-model-select-chevron-room: 28px;
454
454
  }
455
455
 
456
+ /* =========================================
457
+ The system decides, by default.
458
+
459
+ Dark used to exist only behind the attribute: on a dark OS an un-attributed chat
460
+ rendered LIGHT on the host's dark page, unreadable, with no error. This block is
461
+ the DARK block above, verbatim, applied when the OS asks and the host has not
462
+ said otherwise — `data-aparte-theme="light"` on the root is the veto.
463
+
464
+ A duplicate on purpose (CSS cannot share one block between a media query and an
465
+ attribute selector): `check:derived-vars` holds the two byte-identical, so
466
+ editing one without the other fails the build rather than forking the theme.
467
+ No `color-scheme` here — it is not namespaced, and a library setting it on the
468
+ host's :root would flip the whole page's native controls.
469
+ ========================================= */
470
+ @media (prefers-color-scheme: dark) {
471
+ :root:not([data-aparte-theme="light"]) {
472
+ --aparte-bg: #17141c;
473
+ --aparte-surface-1: #211b28;
474
+ --aparte-surface-2: #2a2333;
475
+ --aparte-message-content-bg-assistant: transparent;
476
+ --aparte-text: #f2eee7;
477
+ --aparte-text-muted: #a89bb6;
478
+ --aparte-neutral: #a89bb6;
479
+ --aparte-border: #342a40;
480
+ --aparte-primary: #d9a24b;
481
+ --aparte-primary-hover: #e7c588;
482
+ --aparte-scroll-btn-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
483
+ --aparte-select-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(0, 0, 0, 0.55);
484
+ --aparte-menu-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
485
+ --aparte-popover-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(0, 0, 0, 0.55);
486
+ --aparte-tooltip-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
487
+ --aparte-switch-thumb-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
488
+ --aparte-range-thumb-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
489
+ --aparte-ink-l: 0.85;
490
+ --aparte-error-bg: #2d1b1b;
491
+ --aparte-error-border: #7f1d1d;
492
+ --aparte-error-solid: #f87171;
493
+ --aparte-error-text: #fca5a5;
494
+ --aparte-error-title: #fecaca;
495
+ }
496
+ }
497
+
498
+ /* =========================================
499
+ Forced light — the veto, and the subtree escape.
500
+
501
+ New with the system default: without it, a host that wants light-always on a
502
+ dark OS has no lever, and a light island inside a dark page cannot exist. The
503
+ values are the light literals from the `:root` block above, one per property
504
+ the dark block overrides — `check:derived-vars` holds that pairing, so a light
505
+ literal edited above cannot drift from its copy here.
506
+ ========================================= */
507
+ [data-aparte-theme="light"] {
508
+ color-scheme: light;
509
+ --aparte-bg: #f6f2ea;
510
+ --aparte-surface-1: #fffdf8;
511
+ --aparte-surface-2: #f1ebdf;
512
+ --aparte-message-content-bg-assistant: transparent;
513
+ --aparte-text: #241f2b;
514
+ --aparte-text-muted: #6d6479;
515
+ --aparte-neutral: #6d6479;
516
+ --aparte-border: #e5ddce;
517
+ --aparte-primary: #b07d33;
518
+ --aparte-primary-hover: #a06f28;
519
+ --aparte-scroll-btn-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
520
+ --aparte-select-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 10px 28px rgba(0, 0, 0, 0.16);
521
+ --aparte-menu-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
522
+ --aparte-popover-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 10px 28px rgba(0, 0, 0, 0.16);
523
+ --aparte-tooltip-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
524
+ --aparte-switch-thumb-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
525
+ --aparte-range-thumb-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
526
+ --aparte-ink-l: 0.40;
527
+ --aparte-error-bg: #fef2f2;
528
+ --aparte-error-border: #fecaca;
529
+ --aparte-error-solid: #dc2626;
530
+ --aparte-error-text: #991b1b;
531
+ --aparte-error-title: #7f1d1d;
532
+ }
533
+
534
+
456
535
  /* =========================================
457
536
  Dark Theme (App-controlled via attribute)
458
537
  Usage: <div data-aparte-theme="dark">...</div>
459
538
  ========================================= */
460
539
  [data-aparte-theme="dark"] {
540
+ color-scheme: dark;
461
541
  /* Backgrounds */
462
542
  --aparte-bg: #17141c;
463
543
  --aparte-surface-1: #211b28;
@@ -6112,7 +6192,11 @@ details[open] > .aparte-tool-summary .aparte-tool-toggle { transform: rotate(180
6112
6192
  }
6113
6193
 
6114
6194
  .aparte-elic-message {
6115
- margin: 0 var(--aparte-space-3) var(--aparte-space-3);
6195
+ /* The end margin is the room the corner "Skip" needs, from the same token the tab
6196
+ rail reserves — the button is absolutely positioned, so nothing in the flow knows
6197
+ it is there, and a long question printed its first line underneath it (#50). One
6198
+ token, because the button holds a word and the word changes width per locale. */
6199
+ margin: 0 var(--aparte-elic-dismiss-room) var(--aparte-space-3) var(--aparte-space-3);
6116
6200
  font-size: var(--aparte-elic-message-size);
6117
6201
  font-weight: var(--aparte-font-weight-semibold);
6118
6202
  color: var(--aparte-text);
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { $ as resolveConfig, a4 as subscribeConfigChange, a1 as runWithConfig, o as AparteElicitationAbortError, w as buildApprovalPanel, x as buildElicitationPanel, J as escapeAttr, F as cssEscape, a7 as mergeSegmentUpdate, K as escapeHtml, a8 as writeStreamedMarkdown, C as copyText, N as getSegmentRenderer, O as installDefaultRenderersOnce, r as AparteMessageRepository, a9 as stampSegmentActivity, aa as stampSegmentOnInsert, ab as stampSegmentOnUpdate, ac as renumberSegments, ad as openSegmentIds, ae as isTerminalStatus, af as adoptMessageSegments, Q as isAwaitingReply, W as populateBubbleFromMessage, a6 as uuid, a0 as revokeAttachmentUrls, e as APARTE_DEFAULT_LOCALE, P as installDialogTriggersOnce } from "./dialog-triggers-CVCxqKg3.js";
2
- import { A, a, b, c, d, f, g, h, i, j, k, l, m, n, p, q, s, t, u, v, y, z, B, D, E, G, H, I, L, M, R, S, T, U, V, X, Y, Z, _, a2, a3, a5 } from "./dialog-triggers-CVCxqKg3.js";
1
+ import { $ as resolveConfig, a4 as subscribeConfigChange, a1 as runWithConfig, o as AparteElicitationAbortError, w as buildApprovalPanel, x as buildElicitationPanel, J as escapeAttr, F as cssEscape, a7 as mergeSegmentUpdate, K as escapeHtml, a8 as writeStreamedMarkdown, C as copyText, N as getSegmentRenderer, O as installDefaultRenderersOnce, r as AparteMessageRepository, a9 as stampSegmentActivity, aa as stampSegmentOnInsert, ab as stampSegmentOnUpdate, ac as renumberSegments, ad as openSegmentIds, ae as isTerminalStatus, af as adoptMessageSegments, Q as isAwaitingReply, W as populateBubbleFromMessage, a6 as uuid, a0 as revokeAttachmentUrls, e as APARTE_DEFAULT_LOCALE, P as installDialogTriggersOnce } from "./dialog-triggers-Dw_DIlQ7.js";
2
+ import { A, a, b, c, d, f, g, h, i, j, k, l, m, n, p, q, s, t, u, v, y, z, B, D, E, G, H, I, L, M, R, S, T, U, V, X, Y, Z, _, a2, a3, a5 } from "./dialog-triggers-Dw_DIlQ7.js";
3
3
  class AparteOption extends HTMLElement {
4
4
  static get observedAttributes() {
5
5
  return ["value", "disabled", "selected", "data-status"];
@@ -5914,6 +5914,9 @@ class AparteScrollRail extends HTMLElement {
5914
5914
  if (!customElements.get("aparte-scroll-rail")) {
5915
5915
  customElements.define("aparte-scroll-rail", AparteScrollRail);
5916
5916
  }
5917
+ function presenceOn(value) {
5918
+ return value === "" ? true : Boolean(value);
5919
+ }
5917
5920
  const DRAWER_QUERY = "(max-width: 48rem)";
5918
5921
  class AparteSidebar extends HTMLElement {
5919
5922
  static get observedAttributes() {
@@ -5963,7 +5966,7 @@ class AparteSidebar extends HTMLElement {
5963
5966
  return this.hasAttribute("collapsed");
5964
5967
  }
5965
5968
  set collapsed(value) {
5966
- this.toggleAttribute("collapsed", value);
5969
+ this.toggleAttribute("collapsed", presenceOn(value));
5967
5970
  }
5968
5971
  /** True while the window is under the breakpoint and the sidebar is a drawer. */
5969
5972
  get drawer() {
@@ -6307,7 +6310,7 @@ class AparteSplit extends HTMLElement {
6307
6310
  return this.hasAttribute("collapsed");
6308
6311
  }
6309
6312
  set collapsed(value) {
6310
- this.toggleAttribute("collapsed", value);
6313
+ this.toggleAttribute("collapsed", presenceOn(value));
6311
6314
  }
6312
6315
  /** Which pane is shown while the split is stacked. */
6313
6316
  get pane() {
@@ -6321,7 +6324,7 @@ class AparteSplit extends HTMLElement {
6321
6324
  return this.hasAttribute("disabled");
6322
6325
  }
6323
6326
  set disabled(value) {
6324
- this.toggleAttribute("disabled", value);
6327
+ this.toggleAttribute("disabled", presenceOn(value));
6325
6328
  }
6326
6329
  /**
6327
6330
  * True while the split is showing one pane. Read-only.
@@ -6341,7 +6344,7 @@ class AparteSplit extends HTMLElement {
6341
6344
  return this.hasAttribute("single");
6342
6345
  }
6343
6346
  set single(value) {
6344
- this.toggleAttribute("single", value);
6347
+ this.toggleAttribute("single", presenceOn(value));
6345
6348
  }
6346
6349
  // ─── Public API ───────────────────────────────────────────────────────
6347
6350
  /** Fold the primary pane to its minimum, remembering the size it had. */