anentrypoint-design 0.0.477 → 0.0.480

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 (53) hide show
  1. package/README.md +101 -0
  2. package/chat.css +4 -4
  3. package/colors_and_type.css +33 -3
  4. package/community.css +22 -8
  5. package/dist/247420.css +324 -49
  6. package/dist/247420.js +123 -55
  7. package/dist/index.html +109 -32
  8. package/package.json +1 -1
  9. package/src/community-app.js +4 -2
  10. package/src/components/community/navigation.js +2 -2
  11. package/src/components/community/presence.js +10 -4
  12. package/src/components/community/views.js +8 -2
  13. package/src/components/content/avatar.js +30 -0
  14. package/src/components/content/hero.js +9 -2
  15. package/src/components/content.js +2 -2
  16. package/src/components/freddie/pages-missing.js +1 -1
  17. package/src/components/overlay-primitives/emoji-picker.js +15 -3
  18. package/src/components/shell/app-shell.js +15 -4
  19. package/src/components/shell/workspace-shell.js +1 -1
  20. package/src/components/theme-toggle.js +8 -3
  21. package/src/copy-code.js +103 -0
  22. package/src/css/app-shell/base.css +18 -0
  23. package/src/css/app-shell/catalog-theme.css +20 -2
  24. package/src/css/app-shell/chat-polish.css +12 -0
  25. package/src/css/app-shell/collab.css +5 -0
  26. package/src/css/app-shell/data-density.css +4 -0
  27. package/src/css/app-shell/files.css +7 -1
  28. package/src/css/app-shell/hero-content.css +14 -1
  29. package/src/css/app-shell/kits-appended.css +13 -0
  30. package/src/css/app-shell/loading-alerts.css +14 -12
  31. package/src/css/app-shell/otp-input.css +2 -2
  32. package/src/css/app-shell/panel-row.css +15 -0
  33. package/src/css/app-shell/plugins-config.css +3 -0
  34. package/src/css/app-shell/primitives.css +13 -4
  35. package/src/css/app-shell/responsive.css +13 -0
  36. package/src/css/app-shell/responsive2-workspace.css +4 -1
  37. package/src/css/app-shell/row-print.css +34 -0
  38. package/src/css/app-shell/states-interactions.css +62 -4
  39. package/src/css/app-shell/topbar.css +1 -0
  40. package/src/kits/os/app-panes.css +3 -2
  41. package/src/kits/os/icons.js +16 -0
  42. package/src/kits/os/shell-geometry.js +2 -2
  43. package/src/kits/os/shell.js +24 -3
  44. package/src/kits/os/theme.css +272 -78
  45. package/src/kits/os/wm.css +19 -6
  46. package/src/kits/os/wm.js +38 -1
  47. package/src/kits/spoint/host-join-lobby.css +3 -3
  48. package/src/page-html/client-script.js +96 -28
  49. package/src/page-html.js +3 -2
  50. package/src/theme.js +6 -2
  51. package/src/web-components/ds-chat.js +9 -0
  52. package/src/web-components/freddie-chat.js +2 -2
  53. package/types/components.d.ts +6 -0
package/README.md CHANGED
@@ -29,6 +29,14 @@ npm install anentrypoint-design
29
29
  </script>
30
30
  ```
31
31
 
32
+ `@latest` is unpinned — a production deploy tracking it silently picks up every future release, breaking or not, with no warning. Pin to the exact version you tested against instead:
33
+
34
+ ```html
35
+ <script type="importmap">
36
+ { "imports": { "anentrypoint-design": "https://unpkg.com/anentrypoint-design@0.0.476/dist/247420.js" } }
37
+ </script>
38
+ ```
39
+
32
40
  Add the scope class on a wrapping element and you are done:
33
41
 
34
42
  ```html
@@ -51,6 +59,72 @@ mount(document.getElementById('app'), () => C.AppShell({
51
59
 
52
60
  `mount` automatically adds `.ds-247420` to your root.
53
61
 
62
+ ## Framework integration
63
+
64
+ The SDK is framework-free (webjsx + custom elements), so React/Vue integration
65
+ means treating `<ds-chat>` (see below) as an imperative DOM element rather than
66
+ a native component.
67
+
68
+ **React** — set props/attributes on the element via `ref`, after import registers it:
69
+
70
+ ```jsx
71
+ import { useRef, useEffect } from 'react';
72
+ import 'anentrypoint-design'; // registers <ds-chat>
73
+
74
+ function ChatWidget({ messages, onSend }) {
75
+ const ref = useRef(null);
76
+
77
+ useEffect(() => {
78
+ const el = ref.current;
79
+ el.messages = messages;
80
+ const handleSend = (e) => onSend(e.detail.text);
81
+ el.addEventListener('send', handleSend);
82
+ return () => el.removeEventListener('send', handleSend);
83
+ }, [messages, onSend]);
84
+
85
+ return <ds-chat ref={ref} />;
86
+ }
87
+ ```
88
+
89
+ **Vue** — tell the compiler `ds-chat` is a custom element (not a Vue component)
90
+ so it isn't warned about / resolved against your component registry, then use
91
+ it directly in a template. In `vite.config.js`:
92
+
93
+ ```js
94
+ import vue from '@vitejs/plugin-vue';
95
+
96
+ export default {
97
+ plugins: [
98
+ vue({
99
+ template: {
100
+ compilerOptions: {
101
+ isCustomElement: (tag) => tag === 'ds-chat',
102
+ },
103
+ },
104
+ }),
105
+ ],
106
+ };
107
+ ```
108
+
109
+ Then in a Vue SFC:
110
+
111
+ ```vue
112
+ <script setup>
113
+ import 'anentrypoint-design'; // registers <ds-chat>
114
+ import { ref, onMounted } from 'vue';
115
+
116
+ const el = ref(null);
117
+ onMounted(() => {
118
+ el.value.messages = [{ role: 'assistant', text: 'gm.' }];
119
+ el.value.addEventListener('send', (e) => console.log(e.detail.text));
120
+ });
121
+ </script>
122
+
123
+ <template>
124
+ <ds-chat ref="el" />
125
+ </template>
126
+ ```
127
+
54
128
  ## what's in the box
55
129
 
56
130
  - **chrome** — `Topbar`, `Crumb`, `Side`, `Status`, `AppShell`, `Brand`, `Chip`, `Btn`, `Glyph`, `Heading`, `Lede`
@@ -257,6 +331,33 @@ Layout primitives worth knowing: `.ds-app-surface` is the Operate-mode page root
257
331
 
258
332
  The scanned set is computed, not listed: `COMPONENT_SHEETS` in `scripts/lint-tokens.mjs` names entry points and `expandSheets()` resolves each one's `@import` graph transitively, because the root `app-shell.css` is a barrel with no declarations of its own. A companion guard requires every `.css` file under `src/css/app-shell/` to appear in that expanded set, so a split sheet cannot be bundled into `dist/247420.css` while remaining invisible to both the linters and any consumer that `<link>`s `app-shell.css` directly.
259
333
 
334
+ ## Visual regression testing
335
+
336
+ `npm run visual` (`node scripts/visual-baseline.mjs check`) screenshots every
337
+ `preview/*.html` page (except `index.html`/`theme-map.html`) in three theme
338
+ states — `paper`, `ink`, `auto` (with `auto` pinned to an emulated `light`
339
+ color-scheme preference, so it captures deterministically) — via Chrome DevTools
340
+ Protocol `Page.captureScreenshot` at a fixed 1280×900 viewport, then diffs each
341
+ capture pixel-by-pixel against the matching committed PNG under
342
+ `visual-baselines/`. It needs no browser-automation package and no image
343
+ library: `scripts/cdp.mjs` drives an already-running Chrome over Node's built-in
344
+ `WebSocket` (it never launches a browser itself — start one with
345
+ `--headless --remote-debugging-port=9333`, or your own workflow step) and
346
+ `scripts/png-diff.mjs` decodes PNG bytes using only `node:zlib`.
347
+
348
+ A page fails the check when either: it has no committed baseline for a given
349
+ file+theme combination, or its diff ratio exceeds `DIFF_THRESHOLD_RATIO`
350
+ (0.5% of pixels), where a pixel only counts as differing once its per-channel
351
+ delta exceeds `CHANNEL_TOLERANCE` (24/255) — this tolerance absorbs
352
+ antialiasing/font-rendering jitter rather than flagging it as a regression. A
353
+ size mismatch between capture and baseline is always a failure regardless of
354
+ threshold.
355
+
356
+ To (re-)freeze the current rendering as the new baseline, run
357
+ `npm run visual:update` (`node scripts/visual-baseline.mjs update`), which
358
+ overwrites every `visual-baselines/*.png` with a fresh capture — no diffing,
359
+ no pass/fail, just a straight re-write.
360
+
260
361
  ## why scope-prefixed
261
362
 
262
363
  Every selector in the bundle is namespaced under `.ds-247420` via PostCSS. The bundle ships a system-font stack (`--ff-body`/`--ff-display`/`--ff-mono`, no web-font `@import`/`@font-face` -- see `colors_and_type.css`) + the design tokens **without** colliding with whatever the host app already runs. Add the class to a root element to opt in. The font tokens are fully overridable: set `--ff-body`/`--ff-display`/`--ff-mono` on any scope to swap typography without touching component code.
package/chat.css CHANGED
@@ -567,7 +567,7 @@
567
567
  background: var(--bg); border: var(--border-w) solid var(--accent); border-radius: var(--r-1);
568
568
  padding: var(--space-1) var(--space-2);
569
569
  }
570
- .ds-session-rename-input:focus { outline: none; }
570
+ .ds-session-rename-input:focus { outline: none; box-shadow: var(--focus-ring-inset); }
571
571
 
572
572
  /* Inline delete confirm — same row height, two flat buttons, no modal;
573
573
  mirrors SessionDashboard's arm-then-confirm bulk-stop control. */
@@ -1445,7 +1445,7 @@ button.chat-composer-context:focus-visible { outline: var(--focus-w) solid var(-
1445
1445
  /* Minimap internal order: centerline < viewport < dot < tooltip. All four
1446
1446
  live inside the one raised widget, so they share its rung and differ
1447
1447
  only by a local offset. */
1448
- z-index: calc(var(--z-raised) + 1);
1448
+ z-index: var(--z-raised-1);
1449
1449
  }
1450
1450
  .chat-minimap-centerline {
1451
1451
  position: absolute;
@@ -1465,7 +1465,7 @@ button.chat-composer-context:focus-visible { outline: var(--focus-w) solid var(-
1465
1465
  border-radius: var(--r-pill, 999px);
1466
1466
  transform: translate(-50%, -50%) scale(1);
1467
1467
  transition: transform 0.1s;
1468
- z-index: calc(var(--z-raised) + 2);
1468
+ z-index: var(--z-raised-2);
1469
1469
  }
1470
1470
  .chat-minimap-dot.is-user {
1471
1471
  background: color-mix(in oklab, var(--accent) 18%, transparent);
@@ -1490,7 +1490,7 @@ button.chat-composer-context:focus-visible { outline: var(--focus-w) solid var(-
1490
1490
  /* Top of the minimap's internal order. Deliberately NOT --z-tooltip: it is
1491
1491
  clipped to the minimap rail rather than floating over the app, so it must
1492
1492
  not outrank real overlays that may cover the rail. */
1493
- z-index: calc(var(--z-raised) + 3);
1493
+ z-index: var(--z-raised-3);
1494
1494
  pointer-events: none;
1495
1495
  opacity: 0.45;
1496
1496
  font-size: var(--fs-tiny);
@@ -201,12 +201,24 @@
201
201
  --fs-body: 16px;
202
202
  --fs-lg: 18px;
203
203
  --fs-xl: 21px;
204
- --fs-h4: clamp(22px, 2cqi, 26px);
204
+ --fs-h4: clamp(24px, 2cqi, 28px);
205
205
  --fs-h3: clamp(25px, 2.6cqi, 34px);
206
206
  --fs-h2: clamp(28px, 3.6cqi, 44px);
207
207
  --fs-h1: clamp(34px, 5cqi, 64px);
208
208
  --fs-hero: clamp(42px, 7cqi, 96px);
209
209
  --fs-mega: clamp(56px, 11cqi, 168px);
210
+ /* Bridges the fixed --fs-* ladder (tops out at --fs-xl, 21px) and the fluid
211
+ heading clamps below it — use for fixed (non-clamping) UI text that needs
212
+ to sit between --fs-xl and a heading tier, e.g. empty-state icon glyphs. */
213
+ --fs-2xl: 28px;
214
+
215
+ /* Icon size scale — canonical sizes for glyphs/icons across the kit going
216
+ forward. Existing ad-hoc pixel values (6/7/8/10/12/14/16/18px etc.)
217
+ don't need to be migrated in this pass; new/updated icon usage should. */
218
+ --icon-xs: 12px;
219
+ --icon-sm: 16px;
220
+ --icon-md: 20px;
221
+ --icon-lg: 24px;
210
222
 
211
223
  /* App/chrome typescale: the default heading scale above is tuned for
212
224
  marketing/hero layouts (h1 up to 64px). Application chrome — page titles,
@@ -355,6 +367,9 @@
355
367
  --z-below: -1;
356
368
  --z-base: 0;
357
369
  --z-raised: 100;
370
+ --z-raised-1: calc(var(--z-raised) + 1);
371
+ --z-raised-2: calc(var(--z-raised) + 2);
372
+ --z-raised-3: calc(var(--z-raised) + 3);
358
373
  --z-sticky: 200;
359
374
  --z-header: 300;
360
375
  --z-drawer: 400;
@@ -415,6 +430,9 @@
415
430
  --focus-w: 2px;
416
431
  --focus-offset: 2px;
417
432
  --focus-ring-inset: inset 0 0 0 var(--focus-w) var(--focus-color);
433
+
434
+ /* letterbox background for video/media containers */
435
+ --media-letterbox: #000;
418
436
  }
419
437
 
420
438
  /* ============================================================
@@ -716,8 +734,20 @@ select:focus-visible {
716
734
 
717
735
  /* Type-scale modifier — opt-in body/lg/xl bump for surfaces that want denser
718
736
  or larger reading sizes without a custom override. */
719
- [data-typescale="sm"] { --fs-body: 15px; --fs-lg: 17px; --fs-xl: 20px; }
720
- [data-typescale="lg"] { --fs-body: 17px; --fs-lg: 20px; --fs-xl: 24px; }
737
+ [data-typescale="sm"] {
738
+ --fs-body: 15px; --fs-lg: 17px; --fs-xl: 20px;
739
+ --fs-h4: clamp(22px, 1.9cqi, 24px);
740
+ --fs-h3: clamp(23px, 2.4cqi, 32px);
741
+ --fs-h2: clamp(26px, 3.4cqi, 41px);
742
+ --fs-h1: clamp(32px, 4.7cqi, 60px);
743
+ }
744
+ [data-typescale="lg"] {
745
+ --fs-body: 17px; --fs-lg: 20px; --fs-xl: 24px;
746
+ --fs-h4: clamp(27px, 2.2cqi, 31px);
747
+ --fs-h3: clamp(28px, 2.9cqi, 38px);
748
+ --fs-h2: clamp(31px, 4cqi, 49px);
749
+ --fs-h1: clamp(38px, 5.6cqi, 71px);
750
+ }
721
751
 
722
752
  /* Debug grid overlay — 8px mascot grid. Toggle via class on any container. */
723
753
  .with-grid-overlay {
package/community.css CHANGED
@@ -132,6 +132,9 @@
132
132
  min-width: 18px;
133
133
  height: 18px;
134
134
  padding: 0 var(--space-1-5);
135
+ /* TODO(a11y): --paper is a fixed near-white on --warn (#FF5A52) -- likely
136
+ ~3:1, below the 4.5:1 AA floor (same defect fixed via --ink elsewhere
137
+ for --warn text). Small numeric badge; needs contrast audit. */
135
138
  background: var(--warn);
136
139
  color: var(--paper);
137
140
  font-family: var(--ff-mono);
@@ -464,6 +467,9 @@
464
467
  min-width: 16px;
465
468
  height: 16px;
466
469
  padding: 0 var(--space-1-5);
470
+ /* TODO(a11y): --paper is a fixed near-white on --warn (#FF5A52) -- likely
471
+ ~3:1, below the 4.5:1 AA floor (same defect fixed via --ink elsewhere
472
+ for --warn text). Small numeric badge; needs contrast audit. */
467
473
  background: var(--warn);
468
474
  color: var(--paper);
469
475
  font-family: var(--ff-mono);
@@ -547,7 +553,7 @@
547
553
  height: 20px;
548
554
  border-radius: 50%;
549
555
  background: var(--avatar-bg, var(--bg-3));
550
- color: var(--fg-2);
556
+ color: var(--avatar-fg, var(--fg-2));
551
557
  display: inline-flex;
552
558
  align-items: center;
553
559
  justify-content: center;
@@ -653,8 +659,11 @@
653
659
  background: color-mix(in oklab, var(--fg) 18%, transparent);
654
660
  }
655
661
  .cm-vs-btn.danger {
662
+ /* --ink, not --paper: --paper is a fixed near-white, which measures ~3:1 on
663
+ --warn (#FF5A52) -- below the 4.5:1 AA floor. Same fix pattern as
664
+ .btn-primary.danger in app-shell/files.css. */
656
665
  background: var(--warn);
657
- color: var(--paper);
666
+ color: var(--ink);
658
667
  }
659
668
  .cm-vs-btn.danger:hover {
660
669
  background: color-mix(in oklab, var(--warn) 80%, var(--ink));
@@ -679,7 +688,7 @@
679
688
  height: 32px;
680
689
  border-radius: 50%;
681
690
  background: var(--avatar-bg, var(--bg-3));
682
- color: var(--fg-2);
691
+ color: var(--avatar-fg, var(--fg-2));
683
692
  display: inline-flex;
684
693
  align-items: center;
685
694
  justify-content: center;
@@ -890,7 +899,7 @@
890
899
  height: 28px;
891
900
  border-radius: 50%;
892
901
  background: var(--avatar-bg, var(--bg-3));
893
- color: var(--fg-2);
902
+ color: var(--avatar-fg, var(--fg-2));
894
903
  display: inline-flex;
895
904
  align-items: center;
896
905
  justify-content: center;
@@ -951,7 +960,7 @@
951
960
  height: 56px;
952
961
  border-radius: 50%;
953
962
  background: var(--avatar-bg, var(--bg-3));
954
- color: var(--fg-2);
963
+ color: var(--avatar-fg, var(--fg-2));
955
964
  display: inline-flex;
956
965
  align-items: center;
957
966
  justify-content: center;
@@ -1664,10 +1673,14 @@
1664
1673
  /* PageView — cm-page / cm-page-* */
1665
1674
  .cm-page { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow-y: auto; background: var(--bg-1, var(--bg-2)); color: var(--fg); }
1666
1675
  .cm-page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-3); border-bottom: var(--bw-hair) solid var(--rule); }
1676
+ .cm-page-head-title { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
1667
1677
  .cm-page-title { margin: 0; font-size: var(--fs-xl); font-weight: 700; }
1678
+ .cm-page-meta { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-xs); color: var(--fg-2, var(--fg)); }
1679
+ .cm-page-author { font-weight: 500; }
1680
+ .cm-page-time { opacity: .75; }
1668
1681
  .cm-page-edit { padding: var(--space-1) var(--space-2); border: var(--bw-hair) solid var(--rule-strong); border-radius: var(--r-1); background: var(--bg-3); color: var(--fg); cursor: pointer; }
1669
1682
  .cm-page-body { padding: var(--space-3); line-height: 1.6; }
1670
- .cm-page-empty { color: var(--fg-2, var(--fg)); opacity: .7; }
1683
+ .cm-page-empty { color: var(--fg-2, var(--fg)); opacity: .82; }
1671
1684
 
1672
1685
  /* ============================================================
1673
1686
  freddie pages — layout for FREDDIE_PAGES renderers.
@@ -1680,8 +1693,9 @@
1680
1693
  .fd-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2, 10px); padding: var(--space-5, 32px) var(--space-3, 16px); color: var(--fg-2, var(--fg)); text-align: center; }
1681
1694
  /* 28px is an ICON size (empty-state mark), not a type tier — the --fs-* ladder
1682
1695
  tops out at --fs-xl (21px) before every remaining rung becomes a fluid
1683
- heading clamp, so neither substitutes without visibly resizing the mark. */
1684
- .fd-empty-glyph { font-size: 28px; opacity: .55; line-height: 1; }
1696
+ heading clamp, so neither substitutes without visibly resizing the mark.
1697
+ --fs-2xl bridges that gap as a fixed 28px token. */
1698
+ .fd-empty-glyph { font-size: var(--fs-2xl); opacity: .55; line-height: 1; }
1685
1699
  .fd-pre { margin: 0; padding: var(--space-2, 10px); background: var(--bg-3, var(--panel-bg-2)); border: var(--bw-hair, 1px) solid var(--rule, var(--panel-accent)); border-radius: var(--r-1, 6px); overflow: auto; max-height: 460px; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font-family: var(--font-mono, ui-monospace, monospace); font-size: var(--fs-micro); line-height: 1.5; }
1686
1700
  .fd-skill-body { max-height: 320px; }
1687
1701
  .fd-row-actions { display: inline-flex; gap: var(--space-1, 6px); align-items: center; }