@adia-ai/web-modules 0.3.2 → 0.3.4

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 (54) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/chat/chat-shell/chat-shell.examples.html +85 -0
  3. package/chat/chat-shell/chat-shell.html +42 -0
  4. package/editor/editor-shell/editor-shell.examples.html +71 -0
  5. package/editor/editor-shell/editor-shell.html +42 -0
  6. package/package.json +2 -2
  7. package/shell/admin-command/admin-command.a2ui.json +102 -0
  8. package/shell/admin-command/admin-command.examples.html +83 -0
  9. package/shell/admin-command/admin-command.html +42 -0
  10. package/shell/admin-command/admin-command.js +161 -0
  11. package/shell/admin-command/admin-command.test.js +115 -0
  12. package/shell/admin-command/admin-command.yaml +102 -0
  13. package/shell/admin-content/admin-content.a2ui.json +73 -0
  14. package/shell/admin-content/admin-content.examples.html +33 -0
  15. package/shell/admin-content/admin-content.html +42 -0
  16. package/shell/admin-content/admin-content.yaml +63 -0
  17. package/shell/admin-page/admin-page.a2ui.json +74 -0
  18. package/shell/admin-page/admin-page.examples.html +37 -0
  19. package/shell/admin-page/admin-page.html +42 -0
  20. package/shell/admin-page/admin-page.yaml +61 -0
  21. package/shell/admin-page-body/admin-page-body.a2ui.json +62 -0
  22. package/shell/admin-page-body/admin-page-body.examples.html +34 -0
  23. package/shell/admin-page-body/admin-page-body.html +42 -0
  24. package/shell/admin-page-body/admin-page-body.yaml +49 -0
  25. package/shell/admin-page-header/admin-page-header.a2ui.json +62 -0
  26. package/shell/admin-page-header/admin-page-header.examples.html +34 -0
  27. package/shell/admin-page-header/admin-page-header.html +42 -0
  28. package/shell/admin-page-header/admin-page-header.yaml +47 -0
  29. package/shell/admin-scroll/admin-scroll.a2ui.json +62 -0
  30. package/shell/admin-scroll/admin-scroll.examples.html +31 -0
  31. package/shell/admin-scroll/admin-scroll.html +42 -0
  32. package/shell/admin-scroll/admin-scroll.yaml +51 -0
  33. package/shell/admin-shell/admin-shell.a2ui.json +0 -10
  34. package/shell/admin-shell/admin-shell.css +1 -0
  35. package/shell/admin-shell/admin-shell.examples.html +61 -5
  36. package/shell/admin-shell/admin-shell.js +165 -121
  37. package/shell/admin-shell/admin-shell.yaml +6 -6
  38. package/shell/admin-shell/css/admin-shell.bespoke.css +198 -0
  39. package/shell/admin-shell/css/admin-shell.tokens.css +10 -0
  40. package/shell/admin-sidebar/admin-sidebar.a2ui.json +138 -0
  41. package/shell/admin-sidebar/admin-sidebar.examples.html +76 -0
  42. package/shell/admin-sidebar/admin-sidebar.html +47 -0
  43. package/shell/admin-sidebar/admin-sidebar.js +227 -0
  44. package/shell/admin-sidebar/admin-sidebar.test.js +123 -0
  45. package/shell/admin-sidebar/admin-sidebar.yaml +140 -0
  46. package/shell/admin-statusbar/admin-statusbar.a2ui.json +81 -0
  47. package/shell/admin-statusbar/admin-statusbar.examples.html +29 -0
  48. package/shell/admin-statusbar/admin-statusbar.html +42 -0
  49. package/shell/admin-statusbar/admin-statusbar.yaml +68 -0
  50. package/shell/admin-topbar/admin-topbar.a2ui.json +83 -0
  51. package/shell/admin-topbar/admin-topbar.examples.html +31 -0
  52. package/shell/admin-topbar/admin-topbar.html +42 -0
  53. package/shell/admin-topbar/admin-topbar.yaml +75 -0
  54. package/shell/index.js +2 -0
package/CHANGELOG.md CHANGED
@@ -11,6 +11,70 @@ Built from `@adia-ai/web-components` primitives.
11
11
 
12
12
  _No pending changes._
13
13
 
14
+ ## [0.3.4] - 2026-05-07
15
+
16
+ ### Added
17
+
18
+ - **`<admin-sidebar slot="leading|trailing" resizable collapsible>`** — first JS-bearing bespoke shell-tier child per ADR-0023. 227 LOC + 10 unit tests. Owns: resize drag with snap thresholds (96 floor / 160 min-usable), `[collapsed]` reflected attribute, localStorage persistence (`adia-sidebar-{name}`), ResizeObserver for narrow-mode children. Public API: `.toggle()` / `.collapse()` / `.expand()`. Events: `sidebar-toggle`, `sidebar-resize` (both bubble).
19
+
20
+ - **`<admin-command shortcut="cmd+k|ctrl+k|both">`** — second JS-bearing bespoke child. 156 LOC + 9 unit tests. Owns: keyboard shortcut listener (default both Cmd+K + Ctrl+K), dialog focus management, dismiss handlers, dialog wrapping. Reflects `[open]`. Public API: `.show()` / `.hide()` / `.toggle()`. Forwards `command-select` events.
21
+
22
+ - **7 CSS-only structural children** for the admin shell cluster: `<admin-content>`, `<admin-topbar>`, `<admin-statusbar>`, `<admin-scroll>`, `<admin-page>`, `<admin-page-header>`, `<admin-page-body>`. Pure CSS-only stubs (no `.js`, no own `.css`) — same pattern as `web-components/components/aside/`. Styled by parent `<admin-shell>` via tag-presence selectors.
23
+
24
+ - **CSS bridge** `shell/admin-shell/css/admin-shell.bespoke.css` — maps the 7 bespoke tags to existing CSS layer rules without touching legacy CSS files.
25
+
26
+ - **Sibling shell demo pages** (closes A1 from admin-shell deep review):
27
+ - `chat/chat-shell/chat-shell.html` + `.examples.html`
28
+ - `editor/editor-shell/editor-shell.html` + `.examples.html`
29
+
30
+ - **`shell/index.js` exports** all 3 JS-bearing children (AdminShell + AdminSidebar + AdminCommand). Subpath import unchanged: `import '@adia-ai/web-modules/shell'`.
31
+
32
+ ### Changed
33
+
34
+ - **`<admin-shell>` host** — now coordinates bespoke children rather than centralizing their behavior. Source LOC actually grew (261 → 305) because the legacy compatibility layer is preserved inline (per ADR-0023 Phase 1 backwards-compat); once legacy shapes deprecate in Phase 3, the host drops to ~80 LOC.
35
+
36
+ - **`admin-shell.examples.html` reorganized** — split "Basic shape" into "Basic shape (legacy)" + "Basic shape (bespoke — recommended)" with full 9-element bespoke composition + new "State as attribute" section with CSS `:has()` examples + ADR-0023 cross-reference.
37
+
38
+ - **`--nav-*` tokens in `admin-shell.tokens.css` documented as shell-context overrides** (closes G4 from deep review). They're not canonical; canonical lives in `nav.css`, `nav-group.css`, `nav-item.css` `:where()` roots.
39
+
40
+ ### Fixed
41
+
42
+ - **G1**: `data-sidebar-{name}-collapsed` states removed from `admin-shell.yaml` — they were declared but never set in JS. New semantic: `[collapsed]` reflected on `<admin-sidebar>` directly.
43
+
44
+ - **G2 + G3**: Phantom attrs (`leading-min/max-width`, `[cmd-k]`) removed from `admin-shell.examples.html` behavior-wiring table.
45
+
46
+ ### Backwards compatibility
47
+
48
+ Legacy authoring shapes (`<aside data-sidebar="leading">`, `<dialog data-command>`, `<div data-resize>`, `[data-sidebar-toggle]`, `<aside-ui slot="leading">`) all still work identically. Mixed markup (some bespoke, some legacy) renders the same. Migration is opt-in.
49
+
50
+ ## [0.3.3] - 2026-05-07
51
+
52
+ **Lockstep cut.** All 9 published `@adia-ai/*` packages now share version `0.3.3`, governed by [`docs/specs/package-architecture.md` § 15](../../../docs/specs/package-architecture.md#15-versioning-policy).
53
+
54
+ ### Changed
55
+
56
+ - `version`: `0.3.2` → `0.3.3`.
57
+ - `dependencies["@adia-ai/...]`: `^0.3.0` (patch-cut asymmetry — caret already covers 0.3.x; ranges unchanged).
58
+
59
+ ### No source changes
60
+
61
+ `@adia-ai/web-modules` source is byte-identical to `0.3.2`. The cut is a version bump + ride-along on the lockstep policy.
62
+
63
+ ## [0.3.2] - 2026-05-06
64
+
65
+ **9-package lockstep patch cut to v0.3.2.** All lockstep members share
66
+ one version per [`docs/specs/package-architecture.md` § 15](../../../docs/specs/package-architecture.md#15-versioning-policy).
67
+ Internal `@adia-ai/*` dep ranges unchanged at `^0.3.0`.
68
+
69
+ ### No source changes
70
+
71
+ This package's source is byte-identical to v0.3.1. The cut bumps
72
+ version only.
73
+
74
+ ### Changed
75
+
76
+ - `version`: `0.3.1` → `0.3.2`.
77
+
14
78
  ## [0.3.1] - 2026-05-06
15
79
 
16
80
  **9-package lockstep patch cut.** All 9 published `@adia-ai/*` packages bump 0.3.0 → 0.3.1 per [`docs/specs/package-architecture.md` § 15](../../docs/specs/package-architecture.md#15-versioning-policy). Internal `@adia-ai/*` dep ranges remain at `^0.3.0` (covers `0.3.1` under semver — patch-cut asymmetry).
@@ -0,0 +1,85 @@
1
+ <header>
2
+ <div>
3
+ <h1>Chat Shell</h1>
4
+ <div data-actions>
5
+ <tag-ui size="sm">chat-shell</tag-ui>
6
+ <tag-ui size="sm" variant="ghost">module-tier</tag-ui>
7
+ </div>
8
+ </div>
9
+ <p>Behavior-only chat orchestrator (LLM-streaming module). Author supplies the DOM structure via <code>[data-chat-messages]</code>, <code>[data-chat-input]</code>, <code>[data-chat-empty]</code>, <code>[data-chat-status]</code> elements; chat-shell wires message streaming, markdown rendering, code-block upgrades, and an LLM integration path via <code>proxy-url</code> (or via external submit).</p>
10
+ </header>
11
+
12
+ <section data-section>
13
+ <h2 variant="section">Basic shape</h2>
14
+ <p data-note>Author provides the structural DOM; the shell binds the LLM streaming behavior and renders chunks into the messages container.</p>
15
+ <code-ui language="html">&lt;chat-shell provider="anthropic" model="claude-sonnet-4-7" proxy-url="/api/llm"&gt;
16
+ &lt;header&gt;
17
+ &lt;span slot="heading"&gt;Chat&lt;/span&gt;
18
+ &lt;span slot="description"&gt;claude-sonnet-4-7&lt;/span&gt;
19
+ &lt;/header&gt;
20
+
21
+ &lt;div data-chat-messages&gt;&lt;/div&gt;
22
+ &lt;div data-chat-empty&gt;
23
+ &lt;p&gt;Send a message to start.&lt;/p&gt;
24
+ &lt;/div&gt;
25
+
26
+ &lt;div data-chat-input&gt;
27
+ &lt;input-ui placeholder="Ask anything..." submit-on-enter&gt;&lt;/input-ui&gt;
28
+ &lt;/div&gt;
29
+
30
+ &lt;div data-chat-status&gt;&lt;/div&gt;
31
+ &lt;/chat-shell&gt;</code-ui>
32
+ </section>
33
+
34
+ <section data-section>
35
+ <h2 variant="section">Properties</h2>
36
+ <table>
37
+ <thead><tr><th>Prop</th><th>Type</th><th>Default</th><th>Description</th></tr></thead>
38
+ <tbody>
39
+ <tr><td><code>provider</code></td><td>string</td><td>—</td><td>LLM provider name: <code>anthropic | openai | google | stub</code>.</td></tr>
40
+ <tr><td><code>model</code></td><td>string</td><td>—</td><td>Model identifier (e.g. <code>claude-sonnet-4-7</code>, <code>gpt-4o</code>, <code>gemini-1.5-pro</code>).</td></tr>
41
+ <tr><td><code>system</code></td><td>string</td><td>—</td><td>System prompt prepended to conversations.</td></tr>
42
+ <tr><td><code>proxy-url</code></td><td>string</td><td>—</td><td>API proxy endpoint for LLM calls; enables self-contained chat without external submit handler.</td></tr>
43
+ <tr><td><code>thinking</code></td><td>boolean</td><td><code>false</code></td><td>Enable Anthropic extended-thinking mode.</td></tr>
44
+ <tr><td><code>streaming</code></td><td>boolean</td><td>—</td><td>Reflected — set while a response is streaming.</td></tr>
45
+ </tbody>
46
+ </table>
47
+ </section>
48
+
49
+ <section data-section>
50
+ <h2 variant="section">Events</h2>
51
+ <table>
52
+ <thead><tr><th>Event</th><th>Detail</th></tr></thead>
53
+ <tbody>
54
+ <tr><td><code>submit</code></td><td><code>{ text, model }</code> — fired on user message submit before LLM call begins.</td></tr>
55
+ <tr><td><code>chunk</code></td><td><code>{ text, role }</code> — fired for each streaming chunk.</td></tr>
56
+ <tr><td><code>complete</code></td><td><code>{ text }</code> — fired when streaming finishes.</td></tr>
57
+ <tr><td><code>error</code></td><td><code>{ error }</code> — fired on LLM call failures.</td></tr>
58
+ </tbody>
59
+ </table>
60
+ </section>
61
+
62
+ <section data-section>
63
+ <h2 variant="section">Behavior wiring</h2>
64
+ <table>
65
+ <thead><tr><th>Affordance</th><th>Author markup</th><th>What the shell does</th></tr></thead>
66
+ <tbody>
67
+ <tr><td>Message stream</td><td><code>[data-chat-messages]</code></td><td>Each LLM chunk appended; markdown rendered; <code>code-ui</code> upgraded for code blocks.</td></tr>
68
+ <tr><td>Input submit</td><td><code>[data-chat-input]</code> containing an <code>&lt;input-ui&gt;</code></td><td>Listens for input's submit event; calls LLM via <code>proxy-url</code> or fires <code>submit</code> for external handler.</td></tr>
69
+ <tr><td>Empty state</td><td><code>[data-chat-empty]</code></td><td>Hidden when messages are present; shown when empty.</td></tr>
70
+ <tr><td>Status indicator</td><td><code>[data-chat-status]</code></td><td>Updated with streaming/idle text.</td></tr>
71
+ </tbody>
72
+ </table>
73
+ </section>
74
+
75
+ <section data-section>
76
+ <h2 variant="section">Family pattern (forward-looking)</h2>
77
+ <p>Per <a href="../../../../.brain/adrs/0023-bespoke-shell-tier-children.md">ADR-0023</a>, future releases extend the bespoke-children family to the chat cluster. Planned children:</p>
78
+ <ul data-features>
79
+ <li><code>&lt;chat-thread&gt;</code> — replaces <code>[data-chat-messages]</code>; owns scroll-to-bottom, virtualization, message render</li>
80
+ <li><code>&lt;chat-composer&gt;</code> — replaces <code>[data-chat-input]</code>; owns file attach, autocomplete, submit-on-enter</li>
81
+ <li><code>&lt;chat-message&gt;</code> + <code>&lt;chat-message-list&gt;</code> — message-tier semantic markup</li>
82
+ <li><code>&lt;chat-sidebar&gt;</code> — conversation history rail (mirrors <code>&lt;admin-sidebar&gt;</code>)</li>
83
+ </ul>
84
+ <p data-note>Today's <code>data-*</code> shape is fully supported and will continue to work alongside the bespoke vocabulary when it lands.</p>
85
+ </section>
@@ -0,0 +1,42 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en" data-theme="auto">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Chat Shell — AdiaUI</title>
7
+
8
+ <link rel="stylesheet" href="../../../web-components/styles/resets.css">
9
+ <link rel="stylesheet" href="../../../web-components/styles/tokens.css">
10
+ <link rel="stylesheet" href="./chat-shell.css">
11
+ <link rel="stylesheet" href="../../../web-components/components/code/code.css">
12
+ <link rel="stylesheet" href="../../../web-components/components/tag/tag.css">
13
+
14
+ <script type="module" src="./chat-shell.js"></script>
15
+ <script type="module" src="../../../web-components/components/code/code.js"></script>
16
+ <script type="module" src="../../../web-components/components/tag/tag.js"></script>
17
+
18
+ <style>
19
+ :where(html, body) { margin: 0; min-height: 100vh; background: var(--a-bg); color: var(--a-fg); font-family: var(--a-font); }
20
+ main { max-width: 960px; margin-inline: auto; padding: var(--a-space-6) var(--a-space-5); }
21
+ </style>
22
+ </head>
23
+ <body>
24
+
25
+ <main id="demo-root">
26
+ <p>Loading examples…</p>
27
+ </main>
28
+
29
+ <script type="module">
30
+ const root = document.getElementById('demo-root');
31
+ try {
32
+ const res = await fetch('./chat-shell.examples.html');
33
+ if (!res.ok) throw new Error(`fetch failed (${res.status})`);
34
+ root.innerHTML = await res.text();
35
+ } catch (err) {
36
+ root.innerHTML = `<p style="color:var(--a-danger-strong);">Failed to load chat-shell.examples.html — ${err.message}</p>`;
37
+ console.error('[chat-shell.html]', err);
38
+ }
39
+ </script>
40
+
41
+ </body>
42
+ </html>
@@ -0,0 +1,71 @@
1
+ <header>
2
+ <div>
3
+ <h1>Editor Shell</h1>
4
+ <div data-actions>
5
+ <tag-ui size="sm">editor-shell</tag-ui>
6
+ <tag-ui size="sm" variant="ghost">module-tier</tag-ui>
7
+ </div>
8
+ </div>
9
+ <p>Behavior-only editor shell module for design-tool layouts. Author provides the structural DOM — header (topbar), <code>[data-editor-body]</code> with pane-ui children (<code>[data-left]</code>, <code>[data-right]</code>), <code>[data-canvas]</code> for the central surface, and a footer (statusbar). editor-shell wires <code>select-ui[data-options]</code> for JSON-parsed option lists.</p>
10
+ </header>
11
+
12
+ <section data-section>
13
+ <h2 variant="section">Basic shape</h2>
14
+ <p data-note>Author supplies the structural DOM — header, body with pane-ui rails + canvas, footer. The shell binds toolbar select wiring + responsive pane collapse.</p>
15
+ <code-ui language="html">&lt;editor-shell&gt;
16
+ &lt;header&gt;
17
+ &lt;icon-ui slot="icon" name="layers"&gt;&lt;/icon-ui&gt;
18
+ &lt;span slot="heading"&gt;Untitled.fig&lt;/span&gt;
19
+ &lt;span slot="description"&gt;1920 × 1080&lt;/span&gt;
20
+ &lt;button-ui slot="action" variant="ghost"&gt;Share&lt;/button-ui&gt;
21
+ &lt;/header&gt;
22
+
23
+ &lt;div data-editor-body&gt;
24
+ &lt;pane-ui data-left&gt;…tools panel…&lt;/pane-ui&gt;
25
+ &lt;div data-canvas&gt;…central canvas…&lt;/div&gt;
26
+ &lt;pane-ui data-right&gt;…inspector panel…&lt;/pane-ui&gt;
27
+ &lt;/div&gt;
28
+
29
+ &lt;footer&gt;
30
+ &lt;icon-ui slot="icon" name="zoom-in"&gt;&lt;/icon-ui&gt;
31
+ &lt;span&gt;100%&lt;/span&gt;
32
+ &lt;/footer&gt;
33
+ &lt;/editor-shell&gt;</code-ui>
34
+ </section>
35
+
36
+ <section data-section>
37
+ <h2 variant="section">Slots</h2>
38
+ <table>
39
+ <thead><tr><th>Slot</th><th>Purpose</th></tr></thead>
40
+ <tbody>
41
+ <tr><td><code>icon</code></td><td>Leading glyph in <code>&lt;header&gt;</code> or <code>&lt;footer&gt;</code> — status dot, app icon, zoom badge.</td></tr>
42
+ <tr><td><code>heading</code></td><td>Primary label inside chrome bars.</td></tr>
43
+ <tr><td><code>description</code></td><td>Secondary metadata (document name, artboard size, zoom level).</td></tr>
44
+ <tr><td><code>action</code></td><td>Trailing control cluster. First <code>[slot="action"]</code> child pushes itself + siblings to the end.</td></tr>
45
+ <tr><td><code>action-leading</code></td><td>Leading control cluster (back, undo). Pairs with <code>action</code> for dual-cluster bars.</td></tr>
46
+ </tbody>
47
+ </table>
48
+ </section>
49
+
50
+ <section data-section>
51
+ <h2 variant="section">Behavior wiring</h2>
52
+ <table>
53
+ <thead><tr><th>Affordance</th><th>Author markup</th><th>What the shell does</th></tr></thead>
54
+ <tbody>
55
+ <tr><td>Editor body</td><td><code>[data-editor-body]</code> wrapping <code>pane-ui[data-left]</code>, <code>[data-canvas]</code>, <code>pane-ui[data-right]</code></td><td>Lays out the canvas + flanking panes; handles responsive collapse.</td></tr>
56
+ <tr><td>Toolbar selects</td><td><code>select-ui[data-options]</code> with JSON in the attribute</td><td>Parses <code>data-options</code> JSON to populate option lists at connect.</td></tr>
57
+ </tbody>
58
+ </table>
59
+ </section>
60
+
61
+ <section data-section>
62
+ <h2 variant="section">Family pattern (forward-looking)</h2>
63
+ <p>Per <a href="../../../../.brain/adrs/0023-bespoke-shell-tier-children.md">ADR-0023</a>, future releases extend the bespoke-children family to the editor cluster. Planned children:</p>
64
+ <ul data-features>
65
+ <li><code>&lt;editor-canvas&gt;</code> — replaces <code>[data-canvas]</code>; owns zoom/pan, viewport state</li>
66
+ <li><code>&lt;editor-toolbar&gt;</code> — replaces toolbar headers; owns select-ui wiring</li>
67
+ <li><code>&lt;editor-inspector&gt;</code> + <code>&lt;editor-tools&gt;</code> — replace <code>pane-ui[data-left/right]</code>; owns pane state attributes</li>
68
+ <li><code>&lt;editor-statusbar&gt;</code> — zoom level, artboard info</li>
69
+ </ul>
70
+ <p data-note>Today's <code>data-*</code> shape is fully supported and will continue to work alongside the bespoke vocabulary when it lands.</p>
71
+ </section>
@@ -0,0 +1,42 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en" data-theme="auto">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Editor Shell — AdiaUI</title>
7
+
8
+ <link rel="stylesheet" href="../../../web-components/styles/resets.css">
9
+ <link rel="stylesheet" href="../../../web-components/styles/tokens.css">
10
+ <link rel="stylesheet" href="./editor-shell.css">
11
+ <link rel="stylesheet" href="../../../web-components/components/code/code.css">
12
+ <link rel="stylesheet" href="../../../web-components/components/tag/tag.css">
13
+
14
+ <script type="module" src="./editor-shell.js"></script>
15
+ <script type="module" src="../../../web-components/components/code/code.js"></script>
16
+ <script type="module" src="../../../web-components/components/tag/tag.js"></script>
17
+
18
+ <style>
19
+ :where(html, body) { margin: 0; min-height: 100vh; background: var(--a-bg); color: var(--a-fg); font-family: var(--a-font); }
20
+ main { max-width: 960px; margin-inline: auto; padding: var(--a-space-6) var(--a-space-5); }
21
+ </style>
22
+ </head>
23
+ <body>
24
+
25
+ <main id="demo-root">
26
+ <p>Loading examples…</p>
27
+ </main>
28
+
29
+ <script type="module">
30
+ const root = document.getElementById('demo-root');
31
+ try {
32
+ const res = await fetch('./editor-shell.examples.html');
33
+ if (!res.ok) throw new Error(`fetch failed (${res.status})`);
34
+ root.innerHTML = await res.text();
35
+ } catch (err) {
36
+ root.innerHTML = `<p style="color:var(--a-danger-strong);">Failed to load editor-shell.examples.html — ${err.message}</p>`;
37
+ console.error('[editor-shell.html]', err);
38
+ }
39
+ </script>
40
+
41
+ </body>
42
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adia-ai/web-modules",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "AdiaUI composite custom elements \u2014 shell, chat, editor, runtime clusters built from @adia-ai/web-components primitives. Subpath exports per cluster.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -46,4 +46,4 @@
46
46
  "url": "git+https://github.com/adiahealth/gen-ui-kit.git",
47
47
  "directory": "packages/web-modules"
48
48
  }
49
- }
49
+ }
@@ -0,0 +1,102 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://adiaui.dev/a2ui/v0_9/components/AdminCommand.json",
4
+ "title": "AdminCommand",
5
+ "description": "Module-tier command palette wrapper — wraps a native <dialog> and the\ninner <command-ui>. Owns the keyboard shortcut listener, focus\nmanagement, and dismiss handlers. Reflects [open].\n\nSits inside <admin-shell> as a direct child. The host wires\n[data-command-trigger] elements to <admin-command>.show() via lookup.\n\nThis is the bespoke web-component replacement for the legacy\n<dialog data-command> shape. <admin-shell> still recognizes the\nlegacy shape via :is() selector. New code should prefer <admin-command>.\n",
6
+ "type": "object",
7
+ "allOf": [
8
+ {
9
+ "$ref": "common_types.json#/$defs/ComponentCommon"
10
+ },
11
+ {
12
+ "$ref": "common_types.json#/$defs/CatalogComponentCommon"
13
+ }
14
+ ],
15
+ "properties": {
16
+ "component": {
17
+ "const": "AdminCommand"
18
+ },
19
+ "no-shortcut": {
20
+ "description": "Opts out of the keyboard listener entirely. Use when the host\nwires its own shortcut handling, or when the palette should be\nmouse-only.\n",
21
+ "type": "boolean",
22
+ "default": false
23
+ },
24
+ "open": {
25
+ "description": "Reflected — set while the dialog is showing. Synced with both\nprogrammatic .show()/.hide() and native dialog close events\n(esc key, backdrop click).\n",
26
+ "type": "boolean",
27
+ "default": false
28
+ },
29
+ "shortcut": {
30
+ "description": "Keyboard shortcut binding. \"cmd+k\" responds only on Mac\n(metaKey); \"ctrl+k\" responds only when ctrlKey; \"both\" (default)\nresponds to either, which is the canonical AdiaUI behavior for\ncross-platform Cmd+K affordance.\n",
31
+ "type": "string",
32
+ "enum": [
33
+ "both",
34
+ "cmd+k",
35
+ "ctrl+k"
36
+ ],
37
+ "default": "both"
38
+ }
39
+ },
40
+ "required": [
41
+ "component"
42
+ ],
43
+ "unevaluatedProperties": false,
44
+ "x-adiaui": {
45
+ "anti_patterns": [],
46
+ "category": "interaction",
47
+ "events": {
48
+ "command-select": {
49
+ "description": "Forwarded from the inner <command-ui> when an option is chosen. Detail mirrors the inner event's detail.",
50
+ "detail": {
51
+ "value": "string"
52
+ }
53
+ }
54
+ },
55
+ "examples": [],
56
+ "keywords": [
57
+ "admin-command",
58
+ "command-palette",
59
+ "palette",
60
+ "cmd-k",
61
+ "keyboard-shortcut",
62
+ "quickaction"
63
+ ],
64
+ "name": "AdminCommand",
65
+ "related": [
66
+ "AdminShell",
67
+ "AdminSidebar",
68
+ "Command"
69
+ ],
70
+ "slots": {
71
+ "default": {
72
+ "description": "Default slot — the inner <command-ui> (and any other content inside the dialog). Authors typically place exactly one <command-ui placeholder=\"…\">."
73
+ }
74
+ },
75
+ "states": [
76
+ {
77
+ "description": "Default, palette closed.",
78
+ "name": "idle"
79
+ },
80
+ {
81
+ "description": "Dialog is showing; first input has focus.",
82
+ "attribute": "open",
83
+ "name": "open"
84
+ }
85
+ ],
86
+ "synonyms": {
87
+ "cmd-k": [
88
+ "ctrl-k",
89
+ "command-shortcut"
90
+ ],
91
+ "command-palette": [
92
+ "palette",
93
+ "quick-action",
94
+ "omnibox"
95
+ ]
96
+ },
97
+ "tag": "admin-command",
98
+ "tokens": {},
99
+ "traits": [],
100
+ "version": 1
101
+ }
102
+ }
@@ -0,0 +1,83 @@
1
+ <header>
2
+ <div>
3
+ <h1>Admin Command</h1>
4
+ <div data-actions>
5
+ <tag-ui size="sm">admin-command</tag-ui>
6
+ </div>
7
+ </div>
8
+ <p>Module-tier command palette wrapper — wraps a native <code>&lt;dialog&gt;</code> and the inner <code>&lt;command-ui&gt;</code>. Owns the keyboard shortcut listener, focus management, and dismiss handlers. Reflects <code>[open]</code>.</p>
9
+ </header>
10
+
11
+ <section data-section>
12
+ <h2 variant="section">Basic shape</h2>
13
+ <p data-note>Place <code>&lt;admin-command&gt;</code> as a direct child of <code>&lt;admin-shell&gt;</code>. The host wires <code>[data-command-trigger]</code> elements to <code>.show()</code> via lookup; you don't reach across siblings.</p>
14
+ <code-ui language="html">&lt;admin-shell&gt;
15
+ …sidebars + content…
16
+
17
+ &lt;admin-command&gt;
18
+ &lt;command-ui placeholder="Search…"&gt;&lt;/command-ui&gt;
19
+ &lt;/admin-command&gt;
20
+ &lt;/admin-shell&gt;</code-ui>
21
+ </section>
22
+
23
+ <section data-section>
24
+ <h2 variant="section">Keyboard shortcut</h2>
25
+ <table>
26
+ <thead><tr><th>Value</th><th>Behavior</th></tr></thead>
27
+ <tbody>
28
+ <tr><td><code>both</code> (default)</td><td>Responds to Cmd+K (mac) AND Ctrl+K (other platforms) — the AdiaUI cross-platform convention.</td></tr>
29
+ <tr><td><code>cmd+k</code></td><td>Responds only when <code>metaKey</code> is held.</td></tr>
30
+ <tr><td><code>ctrl+k</code></td><td>Responds only when <code>ctrlKey</code> is held.</td></tr>
31
+ <tr><td><code>[no-shortcut]</code></td><td>Disables the keyboard listener entirely. Use when the host wires its own shortcut handling.</td></tr>
32
+ </tbody>
33
+ </table>
34
+ </section>
35
+
36
+ <section data-section>
37
+ <h2 variant="section">State as attribute</h2>
38
+ <table>
39
+ <thead><tr><th>Attribute</th><th>When set</th><th>Use for</th></tr></thead>
40
+ <tbody>
41
+ <tr><td><code>open</code></td><td>Dialog is showing</td><td>CSS <code>:has(admin-command[open])</code>; JS <code>.hasAttribute('open')</code>; programmatic round-trip via <code>.toggle()</code></td></tr>
42
+ </tbody>
43
+ </table>
44
+ <p>The <code>[open]</code> attribute is synced both ways — programmatic <code>.show()</code> sets it, native dialog close (esc key, backdrop click) clears it.</p>
45
+ </section>
46
+
47
+ <section data-section>
48
+ <h2 variant="section">Public methods</h2>
49
+ <table>
50
+ <thead><tr><th>Method</th><th>Effect</th></tr></thead>
51
+ <tbody>
52
+ <tr><td><code>.show()</code></td><td>Open via <code>showModal()</code>; focus the inner <code>command-ui</code>; clear its value.</td></tr>
53
+ <tr><td><code>.hide()</code></td><td>Close the dialog; clear inner palette state.</td></tr>
54
+ <tr><td><code>.toggle()</code></td><td>Flip open state. Returns the new <code>open</code> value.</td></tr>
55
+ </tbody>
56
+ </table>
57
+ </section>
58
+
59
+ <section data-section>
60
+ <h2 variant="section">Events</h2>
61
+ <table>
62
+ <thead><tr><th>Event</th><th>Detail</th></tr></thead>
63
+ <tbody>
64
+ <tr><td><code>command-select</code></td><td>Forwarded from the inner <code>command-ui</code> when an option is chosen. Detail mirrors the inner event's detail.</td></tr>
65
+ </tbody>
66
+ </table>
67
+ </section>
68
+
69
+ <section data-section>
70
+ <h2 variant="section">Trigger wiring</h2>
71
+ <p>Triggers (any element with <code>[data-command-trigger]</code>) live anywhere in the shell — typically a search row in the leading sidebar. The host (<code>&lt;admin-shell&gt;</code>) finds the inner <code>&lt;admin-command&gt;</code> on connect and wires every trigger's click to <code>command.show()</code>.</p>
72
+ <code-ui language="html">&lt;admin-shell&gt;
73
+ &lt;admin-sidebar slot="leading"&gt;
74
+ &lt;nav-ui&gt;
75
+ &lt;nav-item-ui data-command-trigger icon="magnifying-glass"&gt;Search&lt;/nav-item-ui&gt;
76
+ &lt;/nav-ui&gt;
77
+ &lt;/admin-sidebar&gt;
78
+
79
+ &lt;admin-command&gt;
80
+ &lt;command-ui placeholder="Search…"&gt;&lt;/command-ui&gt;
81
+ &lt;/admin-command&gt;
82
+ &lt;/admin-shell&gt;</code-ui>
83
+ </section>
@@ -0,0 +1,42 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en" data-theme="auto">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Admin Command — AdiaUI</title>
7
+
8
+ <link rel="stylesheet" href="../../../web-components/styles/resets.css">
9
+ <link rel="stylesheet" href="../../../web-components/styles/tokens.css">
10
+ <link rel="stylesheet" href="../admin-shell/admin-shell.css">
11
+ <link rel="stylesheet" href="../../../web-components/components/code/code.css">
12
+ <link rel="stylesheet" href="../../../web-components/components/tag/tag.css">
13
+
14
+ <script type="module" src="./admin-command.js"></script>
15
+ <script type="module" src="../../../web-components/components/code/code.js"></script>
16
+ <script type="module" src="../../../web-components/components/tag/tag.js"></script>
17
+
18
+ <style>
19
+ :where(html, body) { margin: 0; min-height: 100vh; background: var(--a-bg); color: var(--a-fg); font-family: var(--a-font); }
20
+ main { max-width: 960px; margin-inline: auto; padding: var(--a-space-6) var(--a-space-5); }
21
+ </style>
22
+ </head>
23
+ <body>
24
+
25
+ <main id="demo-root">
26
+ <p>Loading examples…</p>
27
+ </main>
28
+
29
+ <script type="module">
30
+ const root = document.getElementById('demo-root');
31
+ try {
32
+ const res = await fetch('./admin-command.examples.html');
33
+ if (!res.ok) throw new Error(`fetch failed (${res.status})`);
34
+ root.innerHTML = await res.text();
35
+ } catch (err) {
36
+ root.innerHTML = `<p style="color:var(--a-danger-strong);">Failed to load admin-command.examples.html — ${err.message}</p>`;
37
+ console.error('[admin-command.html]', err);
38
+ }
39
+ </script>
40
+
41
+ </body>
42
+ </html>