@adia-ai/web-modules 0.4.7 → 0.4.9
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/CHANGELOG.md +85 -0
- package/chat/chat-composer/chat-composer.a2ui.json +1 -0
- package/chat/chat-composer/chat-composer.d.ts +47 -0
- package/chat/chat-empty/chat-empty.a2ui.json +1 -0
- package/chat/chat-header/chat-header.a2ui.json +1 -0
- package/chat/chat-shell/chat-shell.a2ui.json +3 -0
- package/chat/chat-shell/chat-shell.d.ts +86 -0
- package/chat/chat-shell/chat-shell.yaml +4 -0
- package/chat/chat-sidebar/chat-sidebar.a2ui.json +1 -0
- package/chat/chat-sidebar/chat-sidebar.d.ts +70 -0
- package/chat/chat-status/chat-status.a2ui.json +1 -0
- package/chat/chat-thread/chat-thread.a2ui.json +1 -0
- package/chat/chat-thread/chat-thread.d.ts +38 -0
- package/editor/editor-canvas/editor-canvas.a2ui.json +1 -0
- package/editor/editor-canvas/editor-canvas.d.ts +40 -0
- package/editor/editor-canvas-empty/editor-canvas-empty.a2ui.json +1 -0
- package/editor/editor-shell/editor-shell.a2ui.json +1 -0
- package/editor/editor-shell/editor-shell.d.ts +21 -0
- package/editor/editor-sidebar/editor-sidebar.a2ui.json +11 -0
- package/editor/editor-sidebar/editor-sidebar.d.ts +63 -0
- package/editor/editor-sidebar/editor-sidebar.js +13 -6
- package/editor/editor-sidebar/editor-sidebar.yaml +14 -0
- package/editor/editor-statusbar/editor-statusbar.a2ui.json +1 -0
- package/editor/editor-toolbar/editor-toolbar.a2ui.json +1 -0
- package/editor/editor-toolbar/editor-toolbar.d.ts +39 -0
- package/editor/index.d.ts +5 -0
- package/editor/index.js +1 -0
- package/editor/utils.d.ts +8 -0
- package/editor/utils.js +47 -0
- package/package.json +9 -2
- package/runtime/a2ui-root/a2ui-root.a2ui.json +1 -0
- package/runtime/a2ui-root/a2ui-root.d.ts +47 -0
- package/runtime/gen-root/gen-root.a2ui.json +5 -0
- package/runtime/gen-root/gen-root.d.ts +23 -0
- package/runtime/gen-root/gen-root.yaml +6 -0
- package/shell/admin-command/admin-command.a2ui.json +1 -0
- package/shell/admin-command/admin-command.d.ts +50 -0
- package/shell/admin-content/admin-content.a2ui.json +1 -0
- package/shell/admin-page/admin-page.a2ui.json +1 -0
- package/shell/admin-page-body/admin-page-body.a2ui.json +1 -0
- package/shell/admin-page-header/admin-page-header.a2ui.json +1 -0
- package/shell/admin-scroll/admin-scroll.a2ui.json +1 -0
- package/shell/admin-shell/admin-shell.a2ui.json +1 -0
- package/shell/admin-shell/admin-shell.d.ts +49 -0
- package/shell/admin-sidebar/admin-sidebar.a2ui.json +1 -0
- package/shell/admin-sidebar/admin-sidebar.d.ts +68 -0
- package/shell/admin-statusbar/admin-statusbar.a2ui.json +1 -0
- package/shell/admin-topbar/admin-topbar.a2ui.json +1 -0
- package/simple/simple-content/simple-content.a2ui.json +1 -0
- package/simple/simple-hero/simple-hero.a2ui.json +1 -0
- package/simple/simple-shell/simple-shell.a2ui.json +1 -0
- package/simple/simple-shell/simple-shell.d.ts +29 -0
- package/theme/theme-panel/theme-panel.a2ui.json +9 -0
- package/theme/theme-panel/theme-panel.d.ts +77 -0
- package/theme/theme-panel/theme-panel.html +2 -0
- package/theme/theme-panel/theme-panel.yaml +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,91 @@ Built from `@adia-ai/web-components` primitives.
|
|
|
11
11
|
|
|
12
12
|
_No pending changes._
|
|
13
13
|
|
|
14
|
+
## [0.4.9] - 2026-05-13
|
|
15
|
+
|
|
16
|
+
### Added — `<editor-sidebar>` `[persist]` attribute (§91c, FEEDBACK-04 #6)
|
|
17
|
+
|
|
18
|
+
Closes FEEDBACK-04 claim #6 discoverability gap. `<editor-sidebar>` has persisted pane width to `localStorage` since the module shipped, keyed by `[name]` (with `[slot]` fallback). The consumer's mental model expected `[persist="dts-layout"]` — that attribute name better describes what the surface does. v0.4.9 adds `[persist]` as the preferred attribute:
|
|
19
|
+
|
|
20
|
+
```html
|
|
21
|
+
<!-- Preferred (v0.4.9+) -->
|
|
22
|
+
<editor-sidebar slot="leading" collapsible persist="dts-layout">
|
|
23
|
+
<pane-ui resizable>...</pane-ui>
|
|
24
|
+
</editor-sidebar>
|
|
25
|
+
|
|
26
|
+
<!-- Back-compat (v0.4.x) — still works -->
|
|
27
|
+
<editor-sidebar slot="leading" collapsible name="dts-layout">
|
|
28
|
+
<pane-ui resizable>...</pane-ui>
|
|
29
|
+
</editor-sidebar>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Both map to the same `localStorage["adia-editor-sidebar-dts-layout"]` namespace. Precedence is `[persist]` > `[name]` > `[slot]` — if both `[persist]` and `[name]` are set, `[persist]` wins (more descriptive attribute beats the legacy alias). The `sidebar-toggle` event's `detail.name` reflects the chosen key.
|
|
33
|
+
|
|
34
|
+
`[name]` is now documented as deprecated; not scheduled for removal in v0.5.x.
|
|
35
|
+
|
|
36
|
+
**Migration:**
|
|
37
|
+
|
|
38
|
+
```diff
|
|
39
|
+
- <editor-sidebar collapsible name="dts-layout">
|
|
40
|
+
+ <editor-sidebar collapsible persist="dts-layout">
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Added — `isFocusInInput()` utility on `@adia-ai/web-modules/editor` (§90, FEEDBACK-04 P2 #5)
|
|
44
|
+
|
|
45
|
+
`FEEDBACK-04--adia-ui--2026-05-13.md` item #5: consumer building global keyboard shortcuts for an editor app hit the TypeScript ergonomics gap on `document.activeElement.isContentEditable` (the `Element` type doesn't have `isContentEditable`; only `HTMLElement` does). Every consumer reimplements the cast boilerplate.
|
|
46
|
+
|
|
47
|
+
Ships `isFocusInInput()` as a small helper:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { isFocusInInput } from '@adia-ai/web-modules/editor';
|
|
51
|
+
|
|
52
|
+
document.addEventListener('keydown', (e) => {
|
|
53
|
+
if (isFocusInInput()) return; // user is typing — don't fire shortcut
|
|
54
|
+
if (e.key === '/') openCommandPalette();
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Returns `true` when focus is inside `<input>` / `<textarea>` / any `contenteditable` host / or an AdiaUI text-input primitive (`<input-ui>`, `<textarea-ui>`, `<otp-input-ui>`, `<search-ui>`). The AdiaUI tag-name checks catch focus that lands on the host element (not just the inner native input).
|
|
59
|
+
|
|
60
|
+
**Files:**
|
|
61
|
+
- NEW `packages/web-modules/editor/utils.js` — implementation
|
|
62
|
+
- NEW `packages/web-modules/editor/utils.d.ts` — types
|
|
63
|
+
- NEW `packages/web-modules/editor/index.d.ts` — barrel re-export of the editor module types incl. `isFocusInInput`
|
|
64
|
+
- `packages/web-modules/editor/index.js` — re-export
|
|
65
|
+
- `packages/web-modules/package.json` — `./editor` exports gains `types` conditional; new explicit `./editor/utils` entry for direct subpath import
|
|
66
|
+
|
|
67
|
+
Two reachable import paths:
|
|
68
|
+
- `import { isFocusInInput } from '@adia-ai/web-modules/editor';` (via barrel)
|
|
69
|
+
- `import { isFocusInInput } from '@adia-ai/web-modules/editor/utils';` (direct subpath)
|
|
70
|
+
|
|
71
|
+
Both carry types via the new `types` conditionals.
|
|
72
|
+
|
|
73
|
+
## [0.4.8] - 2026-05-12
|
|
74
|
+
|
|
75
|
+
### Added — TypeScript declarations for all web-modules (FEEDBACK-02 #1, v0.4.8)
|
|
76
|
+
|
|
77
|
+
Closes consumer-friction item #1 from FEEDBACK-adia-packages-02. Hand-codegen'd `.d.ts` declarations now ship for every web-module across all clusters:
|
|
78
|
+
|
|
79
|
+
- **chat** (6): `chat-composer`, `chat-shell`, `chat-sidebar`, `chat-thread` + supporting types.
|
|
80
|
+
- **editor** (5): `editor-canvas`, `editor-shell`, `editor-sidebar`, `editor-toolbar` + supporting types.
|
|
81
|
+
- **runtime** (2): `a2ui-root`, `gen-root`.
|
|
82
|
+
- **admin shell** (10): admin-command, admin-content, admin-page, admin-page-{body,header}, admin-scroll, admin-shell, admin-sidebar, admin-statusbar, admin-topbar.
|
|
83
|
+
- **simple** + **theme** clusters: companion `.d.ts` files for the remaining modules.
|
|
84
|
+
|
|
85
|
+
TypeScript consumers now get typed `document.querySelector('admin-shell')` returns `AdminShell`, typed reflected properties, typed methods (`.toggle()`, `.collapse()`, etc.), and typed custom events. `HTMLElementTagNameMap` augmentation in the package barrel makes the tag-name lookups type-aware. Mirrors the `@adia-ai/web-components@0.4.7` §74 codegen pattern.
|
|
86
|
+
|
|
87
|
+
### Added — `composes:` field on YAMLs + `.a2ui.json` regen (ADR-0027 wiring, v0.4.8)
|
|
88
|
+
|
|
89
|
+
Each web-module YAML now declares a `composes:` field listing the `@adia-ai/web-components` primitives it instantiates internally. ADR-0027 (cross-primitive composition imports are consumer's responsibility) becomes mechanically auditable — the `composes:` linter ships in this release and runs as part of `npm run components`. `.a2ui.json` sidecars regenerated to surface the `composes:` data through the v0.9 catalog.
|
|
90
|
+
|
|
91
|
+
`chat-shell.yaml` + `gen-root.yaml` documented the LLM-pipeline wiring expectations alongside the composes declarations.
|
|
92
|
+
|
|
93
|
+
### Documentation — lexical-scope authoring guide
|
|
94
|
+
|
|
95
|
+
`README.md` § Module authoring updated with the `composes:` field semantics + lexical-scope rationale (why composes-declared imports must live at the consumer page, not transitively pulled by the module). Aligns with §66's `adaptV09Component()` catalog reader work.
|
|
96
|
+
|
|
97
|
+
See root [CHANGELOG.md `[Unreleased]`](../../CHANGELOG.md) for the cross-cutting arc narrative.
|
|
98
|
+
|
|
14
99
|
## [0.4.7] - 2026-05-12
|
|
15
100
|
|
|
16
101
|
### Changed — `chat/chat-thread.yaml` populates `synonyms.tags` (§72)
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"x-adiaui": {
|
|
30
30
|
"anti_patterns": [],
|
|
31
31
|
"category": "input",
|
|
32
|
+
"composes": [],
|
|
32
33
|
"events": {
|
|
33
34
|
"composer-submit": {
|
|
34
35
|
"description": "Bubbles when the inner input fires its 'submit' event. Detail mirrors the inner event's detail (typically text + model).",
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<chat-composer-ui>` — Module-tier chat composer wrapper — replaces legacy <chat-input-ui
|
|
3
|
+
data-chat-input> direct child of <chat-shell> per ADR-0023.
|
|
4
|
+
Forwards submit events as 'composer-submit', propagates [disabled]
|
|
5
|
+
to the inner input, provides slot vocabulary for future composer
|
|
6
|
+
surfaces (file attach, autocomplete, model picker).
|
|
7
|
+
|
|
8
|
+
Sits inside <chat-shell> as the input region (typically inside or
|
|
9
|
+
alongside the footer). Authors place an inner <chat-input-ui>
|
|
10
|
+
(or input-ui / textarea-ui) as the primary input.
|
|
11
|
+
|
|
12
|
+
Backwards compat — <chat-shell> still recognizes the legacy
|
|
13
|
+
<chat-input-ui data-chat-input> shape via :is() selector. New
|
|
14
|
+
code should prefer <chat-composer>.
|
|
15
|
+
|
|
16
|
+
*
|
|
17
|
+
* @see https://ui-kit.exe.xyz/site/components/chat-composer
|
|
18
|
+
*
|
|
19
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
20
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
21
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
22
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
23
|
+
* needed beyond what the yaml `events:` block can express.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
27
|
+
|
|
28
|
+
export interface ChatComposerComposerSubmitEventDetail {
|
|
29
|
+
model: string;
|
|
30
|
+
text: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type ChatComposerComposerSubmitEvent = CustomEvent<ChatComposerComposerSubmitEventDetail>;
|
|
34
|
+
|
|
35
|
+
export class UIChatComposer extends UIElement {
|
|
36
|
+
/** Reflected — set by the host while streaming, or by application
|
|
37
|
+
code. Propagated to the inner input element automatically.
|
|
38
|
+
*/
|
|
39
|
+
disabled: boolean;
|
|
40
|
+
|
|
41
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
42
|
+
type: K,
|
|
43
|
+
listener: (this: UIChatComposer, ev: HTMLElementEventMap[K]) => unknown,
|
|
44
|
+
options?: boolean | AddEventListenerOptions,
|
|
45
|
+
): void;
|
|
46
|
+
addEventListener(type: 'composer-submit', listener: (ev: ChatComposerComposerSubmitEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
47
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<chat-shell-ui>` — Behavior-only chat orchestrator (LLM-streaming module). Author supplies the
|
|
3
|
+
DOM structure via [data-chat-messages], [data-chat-input], [data-chat-empty],
|
|
4
|
+
[data-chat-status] elements; chat-shell wires message streaming, markdown
|
|
5
|
+
rendering, code-block upgrades, and an LLM integration path via proxy-url
|
|
6
|
+
(or via external submit).
|
|
7
|
+
|
|
8
|
+
*
|
|
9
|
+
* @see https://ui-kit.exe.xyz/site/components/chat-shell
|
|
10
|
+
*
|
|
11
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
12
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
13
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
14
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
15
|
+
* needed beyond what the yaml `events:` block can express.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
19
|
+
|
|
20
|
+
export type ChatShellAbortEvent = CustomEvent<unknown>;
|
|
21
|
+
export interface ChatShellChunkEventDetail {
|
|
22
|
+
snapshot: string;
|
|
23
|
+
text: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type ChatShellChunkEvent = CustomEvent<ChatShellChunkEventDetail>;
|
|
27
|
+
export type ChatShellClearEvent = CustomEvent<unknown>;
|
|
28
|
+
export interface ChatShellDoneEventDetail {
|
|
29
|
+
stopReason: string;
|
|
30
|
+
text: string;
|
|
31
|
+
usage: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type ChatShellDoneEvent = CustomEvent<ChatShellDoneEventDetail>;
|
|
35
|
+
export interface ChatShellErrorEventDetail {
|
|
36
|
+
error: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type ChatShellErrorEvent = CustomEvent<ChatShellErrorEventDetail>;
|
|
40
|
+
export interface ChatShellMessageEventDetail {
|
|
41
|
+
content: string;
|
|
42
|
+
id: string;
|
|
43
|
+
role: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type ChatShellMessageEvent = CustomEvent<ChatShellMessageEventDetail>;
|
|
47
|
+
export interface ChatShellSubmitEventDetail {
|
|
48
|
+
model: string;
|
|
49
|
+
text: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type ChatShellSubmitEvent = CustomEvent<ChatShellSubmitEventDetail>;
|
|
53
|
+
export interface ChatShellThinkingEventDetail {
|
|
54
|
+
text: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type ChatShellThinkingEvent = CustomEvent<ChatShellThinkingEventDetail>;
|
|
58
|
+
|
|
59
|
+
export class UIChatShell extends UIElement {
|
|
60
|
+
/** Model identifier. */
|
|
61
|
+
model: string;
|
|
62
|
+
/** LLM provider name (anthropic | openai | google | stub). */
|
|
63
|
+
provider: string;
|
|
64
|
+
/** API proxy endpoint for LLM calls; enables self-contained chat without external wiring. */
|
|
65
|
+
proxyUrl: string;
|
|
66
|
+
/** Active streaming indicator; toggled while a response is being received. */
|
|
67
|
+
streaming: boolean;
|
|
68
|
+
/** System prompt prepended to conversations. */
|
|
69
|
+
system: string;
|
|
70
|
+
/** Enable Anthropic extended-thinking mode. */
|
|
71
|
+
thinking: boolean;
|
|
72
|
+
|
|
73
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
74
|
+
type: K,
|
|
75
|
+
listener: (this: UIChatShell, ev: HTMLElementEventMap[K]) => unknown,
|
|
76
|
+
options?: boolean | AddEventListenerOptions,
|
|
77
|
+
): void;
|
|
78
|
+
addEventListener(type: 'abort', listener: (ev: ChatShellAbortEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
79
|
+
addEventListener(type: 'chunk', listener: (ev: ChatShellChunkEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
80
|
+
addEventListener(type: 'clear', listener: (ev: ChatShellClearEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
81
|
+
addEventListener(type: 'done', listener: (ev: ChatShellDoneEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
82
|
+
addEventListener(type: 'error', listener: (ev: ChatShellErrorEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
83
|
+
addEventListener(type: 'message', listener: (ev: ChatShellMessageEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
84
|
+
addEventListener(type: 'submit', listener: (ev: ChatShellSubmitEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
85
|
+
addEventListener(type: 'thinking', listener: (ev: ChatShellThinkingEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
86
|
+
}
|
|
@@ -11,6 +11,10 @@ description: |
|
|
|
11
11
|
rendering, code-block upgrades, and an LLM integration path via proxy-url
|
|
12
12
|
(or via external submit).
|
|
13
13
|
|
|
14
|
+
# Per ADR-0027 — primitives that programmatically create other primitives
|
|
15
|
+
# do NOT auto-import them. Consumer (or demo shell) must explicitly import.
|
|
16
|
+
composes:
|
|
17
|
+
- code-ui
|
|
14
18
|
props:
|
|
15
19
|
streaming:
|
|
16
20
|
type: boolean
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<chat-sidebar-ui>` — Module-tier chat-cluster sidebar — owns resize, snap-to-collapsed,
|
|
3
|
+
persistence, and the [collapsed] reflected attribute. Sits inside
|
|
4
|
+
<chat-shell> as slot="leading" (conversation history rail) or
|
|
5
|
+
slot="trailing" (artifacts/citations panel). Mirrors the admin-sidebar
|
|
6
|
+
shape — same 4 concerns, cluster-namespaced for the chat family.
|
|
7
|
+
|
|
8
|
+
This is the chat-cluster equivalent of <admin-sidebar> per ADR-0023.
|
|
9
|
+
<chat-shell> doesn't currently have a legacy sidebar shape (chat is
|
|
10
|
+
typically a single-pane experience), so <chat-sidebar> is purely
|
|
11
|
+
forward-looking — for chat apps that want conversation-history or
|
|
12
|
+
inspector rails.
|
|
13
|
+
|
|
14
|
+
*
|
|
15
|
+
* @see https://ui-kit.exe.xyz/site/components/chat-sidebar
|
|
16
|
+
*
|
|
17
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
18
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
19
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
20
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
21
|
+
* needed beyond what the yaml `events:` block can express.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
25
|
+
|
|
26
|
+
export interface ChatSidebarSidebarResizeEventDetail {
|
|
27
|
+
name: string;
|
|
28
|
+
width: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type ChatSidebarSidebarResizeEvent = CustomEvent<ChatSidebarSidebarResizeEventDetail>;
|
|
32
|
+
export interface ChatSidebarSidebarToggleEventDetail {
|
|
33
|
+
expanded: string;
|
|
34
|
+
name: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type ChatSidebarSidebarToggleEvent = CustomEvent<ChatSidebarSidebarToggleEventDetail>;
|
|
38
|
+
|
|
39
|
+
export class UIChatSidebar extends UIElement {
|
|
40
|
+
/** Reflected — set when the sidebar's measured width is at or below
|
|
41
|
+
96px. Consumers query this to style "collapsed mode" without
|
|
42
|
+
duplicating threshold math.
|
|
43
|
+
*/
|
|
44
|
+
collapsed: boolean;
|
|
45
|
+
/** Opts in to programmatic collapse — toggle button wiring + the
|
|
46
|
+
.toggle() / .collapse() / .expand() public methods.
|
|
47
|
+
*/
|
|
48
|
+
collapsible: boolean;
|
|
49
|
+
/** Identifier for localStorage namespacing. Defaults to slot value
|
|
50
|
+
("leading" or "trailing"). Override when running multiple sidebars
|
|
51
|
+
with the same slot.
|
|
52
|
+
*/
|
|
53
|
+
name: string;
|
|
54
|
+
/** Opts in to drag-to-resize behavior. Author supplies a child
|
|
55
|
+
[data-resize] element as the drag handle.
|
|
56
|
+
*/
|
|
57
|
+
resizable: boolean;
|
|
58
|
+
/** Reflected — set during an active pointer-drag on the resize handle.
|
|
59
|
+
Useful for suppressing transitions while dragging.
|
|
60
|
+
*/
|
|
61
|
+
resizing: boolean;
|
|
62
|
+
|
|
63
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
64
|
+
type: K,
|
|
65
|
+
listener: (this: UIChatSidebar, ev: HTMLElementEventMap[K]) => unknown,
|
|
66
|
+
options?: boolean | AddEventListenerOptions,
|
|
67
|
+
): void;
|
|
68
|
+
addEventListener(type: 'sidebar-resize', listener: (ev: ChatSidebarSidebarResizeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
69
|
+
addEventListener(type: 'sidebar-toggle', listener: (ev: ChatSidebarSidebarToggleEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
70
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<chat-thread-ui>` — Module-tier chat message thread container — replaces legacy
|
|
3
|
+
<section data-chat-messages> per ADR-0023. Owns scroll-to-bottom
|
|
4
|
+
on new message (with user-scroll-up suspension), [streaming] and
|
|
5
|
+
[empty] reflected attributes, and a stable target for the host's
|
|
6
|
+
message rendering pipeline.
|
|
7
|
+
|
|
8
|
+
Sits inside <chat-shell> as the central scroll surface. Authors
|
|
9
|
+
compose <chat-empty> as an optional first child for the empty
|
|
10
|
+
state; message children are appended dynamically by the host.
|
|
11
|
+
|
|
12
|
+
Backwards compat — <chat-shell> still recognizes the legacy
|
|
13
|
+
<section data-chat-messages> shape via :is() selector. New code
|
|
14
|
+
should prefer <chat-thread>.
|
|
15
|
+
|
|
16
|
+
*
|
|
17
|
+
* @see https://ui-kit.exe.xyz/site/components/chat-thread
|
|
18
|
+
*
|
|
19
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
20
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
21
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
22
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
23
|
+
* needed beyond what the yaml `events:` block can express.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
27
|
+
|
|
28
|
+
export class UIChatThread extends UIElement {
|
|
29
|
+
/** Reflected — set when zero message children. Drives the
|
|
30
|
+
<chat-empty> visibility via CSS — no JS toggling needed.
|
|
31
|
+
*/
|
|
32
|
+
empty: boolean;
|
|
33
|
+
/** Reflected — set by the host while an LLM response is streaming.
|
|
34
|
+
Consumers can style streaming-mode (e.g. cursor blink) via
|
|
35
|
+
:has(chat-thread[streaming]) or attribute selectors.
|
|
36
|
+
*/
|
|
37
|
+
streaming: boolean;
|
|
38
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<editor-canvas-ui>` — Module-tier editor canvas surface — replaces legacy <div data-canvas>
|
|
3
|
+
inside <editor-shell> per ADR-0023. Owns scroll/zoom container
|
|
4
|
+
semantics, [empty] and [focused] reflected attributes, and a stable
|
|
5
|
+
target for the host's content rendering pipeline.
|
|
6
|
+
|
|
7
|
+
Sits as the central content region inside <editor-shell>, between
|
|
8
|
+
the optional <editor-sidebar slot="leading"> and <editor-sidebar
|
|
9
|
+
slot="trailing">. Authors compose <editor-canvas-empty> as an
|
|
10
|
+
optional first child for the empty state; canvas content children
|
|
11
|
+
(artboards, document body, etc.) are appended either statically or
|
|
12
|
+
dynamically by the host.
|
|
13
|
+
|
|
14
|
+
Backwards compat — <editor-shell> still recognizes the legacy
|
|
15
|
+
<div data-canvas> shape via :is() selector. New code should prefer
|
|
16
|
+
<editor-canvas>.
|
|
17
|
+
|
|
18
|
+
*
|
|
19
|
+
* @see https://ui-kit.exe.xyz/site/components/editor-canvas
|
|
20
|
+
*
|
|
21
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
22
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
23
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
24
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
25
|
+
* needed beyond what the yaml `events:` block can express.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
29
|
+
|
|
30
|
+
export class UIEditorCanvas extends UIElement {
|
|
31
|
+
/** Reflected — set when zero non-<editor-canvas-empty> children.
|
|
32
|
+
Drives the <editor-canvas-empty> visibility via parent CSS —
|
|
33
|
+
no JS toggling needed.
|
|
34
|
+
*/
|
|
35
|
+
empty: boolean;
|
|
36
|
+
/** Reflected — set when canvas claims focus ownership (programmatic
|
|
37
|
+
.focus() call or toolbar full-screen toggle).
|
|
38
|
+
*/
|
|
39
|
+
focused: boolean;
|
|
40
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<editor-shell-ui>` — Behavior-only editor shell module for design-tool layouts. Author
|
|
3
|
+
provides the structural DOM — header (topbar), [data-editor-body] with
|
|
4
|
+
pane-ui children ([data-left], [data-right]), [data-canvas] for the
|
|
5
|
+
central surface, and a footer (statusbar). editor-shell wires
|
|
6
|
+
select-ui[data-options] for JSON-parsed option lists.
|
|
7
|
+
|
|
8
|
+
*
|
|
9
|
+
* @see https://ui-kit.exe.xyz/site/components/editor-shell
|
|
10
|
+
*
|
|
11
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
12
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
13
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
14
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
15
|
+
* needed beyond what the yaml `events:` block can express.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
19
|
+
|
|
20
|
+
export class UIEditorShell extends UIElement {
|
|
21
|
+
}
|
|
@@ -21,6 +21,16 @@
|
|
|
21
21
|
"component": {
|
|
22
22
|
"const": "EditorSidebar"
|
|
23
23
|
},
|
|
24
|
+
"name": {
|
|
25
|
+
"description": "Alias for [persist]; kept for v0.4.x back-compat. Deprecated —\nnew code should use [persist]. If both are set, [persist] wins.\n",
|
|
26
|
+
"type": "string",
|
|
27
|
+
"default": ""
|
|
28
|
+
},
|
|
29
|
+
"persist": {
|
|
30
|
+
"description": "localStorage key suffix. When set, the sidebar persists its pane\nwidth across reloads under `adia-editor-sidebar-{persist}`.\nPreferred over the [name] alias kept for v0.4.x back-compat.\nDefaults to [name] then [slot] if neither set.\n",
|
|
31
|
+
"type": "string",
|
|
32
|
+
"default": ""
|
|
33
|
+
},
|
|
24
34
|
"resizing": {
|
|
25
35
|
"description": "Reflected — set during an active pointer-drag of the pane's\nresize handle. Used to disable transitions and visual treatments\nthat would feel laggy during drag.\n",
|
|
26
36
|
"type": "boolean",
|
|
@@ -34,6 +44,7 @@
|
|
|
34
44
|
"x-adiaui": {
|
|
35
45
|
"anti_patterns": [],
|
|
36
46
|
"category": "layout",
|
|
47
|
+
"composes": [],
|
|
37
48
|
"events": {
|
|
38
49
|
"sidebar-toggle": {
|
|
39
50
|
"description": "Bubbles when .toggle() / .collapse() / .expand() is called.",
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<editor-sidebar-ui>` — Module-tier editor-cluster sidebar — wraps <pane-ui resizable>
|
|
3
|
+
(the primitive that owns drag) and adds [collapsed] reflected
|
|
4
|
+
state, localStorage persistence (adia-editor-sidebar-{name}),
|
|
5
|
+
and .toggle() / .collapse() / .expand() public API.
|
|
6
|
+
|
|
7
|
+
Sits inside <editor-shell> as slot="leading" (navigator pane) or
|
|
8
|
+
slot="trailing" (inspector pane). Mirrors the cluster-namespace
|
|
9
|
+
shape from <admin-sidebar> and <chat-sidebar>, but DELEGATES to
|
|
10
|
+
<pane-ui> for resize rather than reimplementing it (per
|
|
11
|
+
bespoke-shell-children skill §When NOT to promote — pane primitive
|
|
12
|
+
already owns this concern).
|
|
13
|
+
|
|
14
|
+
This is the FIRST bespoke shell child that delegates rather than
|
|
15
|
+
duplicates a primitive's behavior. Pattern is: cluster-namespace +
|
|
16
|
+
state-as-attribute + persistence at the bespoke tier; physical
|
|
17
|
+
drag at the primitive tier.
|
|
18
|
+
|
|
19
|
+
*
|
|
20
|
+
* @see https://ui-kit.exe.xyz/site/components/editor-sidebar
|
|
21
|
+
*
|
|
22
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
23
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
24
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
25
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
26
|
+
* needed beyond what the yaml `events:` block can express.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
30
|
+
|
|
31
|
+
export interface EditorSidebarSidebarToggleEventDetail {
|
|
32
|
+
expanded: string;
|
|
33
|
+
name: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type EditorSidebarSidebarToggleEvent = CustomEvent<EditorSidebarSidebarToggleEventDetail>;
|
|
37
|
+
|
|
38
|
+
export class UIEditorSidebar extends UIElement {
|
|
39
|
+
/** Reflected — set when inner <pane-ui> width is at or below 96px snap threshold. */
|
|
40
|
+
collapsed: boolean;
|
|
41
|
+
/** Alias for [persist]; kept for v0.4.x back-compat. Deprecated —
|
|
42
|
+
new code should use [persist]. If both are set, [persist] wins.
|
|
43
|
+
*/
|
|
44
|
+
name: string;
|
|
45
|
+
/** localStorage key suffix. When set, the sidebar persists its pane
|
|
46
|
+
width across reloads under `adia-editor-sidebar-{persist}`.
|
|
47
|
+
Preferred over the [name] alias kept for v0.4.x back-compat.
|
|
48
|
+
Defaults to [name] then [slot] if neither set.
|
|
49
|
+
*/
|
|
50
|
+
persist: string;
|
|
51
|
+
/** Reflected — set during an active pointer-drag of the pane's
|
|
52
|
+
resize handle. Used to disable transitions and visual treatments
|
|
53
|
+
that would feel laggy during drag.
|
|
54
|
+
*/
|
|
55
|
+
resizing: boolean;
|
|
56
|
+
|
|
57
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
58
|
+
type: K,
|
|
59
|
+
listener: (this: UIEditorSidebar, ev: HTMLElementEventMap[K]) => unknown,
|
|
60
|
+
options?: boolean | AddEventListenerOptions,
|
|
61
|
+
): void;
|
|
62
|
+
addEventListener(type: 'sidebar-toggle', listener: (ev: EditorSidebarSidebarToggleEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
63
|
+
}
|
|
@@ -25,8 +25,11 @@
|
|
|
25
25
|
* [slot="leading"|"trailing"] — required, drives localStorage
|
|
26
26
|
* namespacing
|
|
27
27
|
* [collapsible] — opts in to programmatic collapse
|
|
28
|
-
* [
|
|
29
|
-
*
|
|
28
|
+
* [persist="<id>"] — optional override for the localStorage
|
|
29
|
+
* key (defaults to slot). Preferred over
|
|
30
|
+
* [name]; if both set, [persist] wins.
|
|
31
|
+
* [name="<id>"] — alias for [persist]; kept for v0.4.x
|
|
32
|
+
* back-compat. Deprecated; prefer [persist].
|
|
30
33
|
*
|
|
31
34
|
* Reflected attributes:
|
|
32
35
|
* [collapsed] — set when inner pane width ≤ SNAP_THRESHOLD
|
|
@@ -69,10 +72,14 @@ class EditorSidebar extends UIElement {
|
|
|
69
72
|
this.#pane = this.querySelector('pane-ui');
|
|
70
73
|
if (!this.#pane) return;
|
|
71
74
|
|
|
72
|
-
// Resolve storage key
|
|
75
|
+
// Resolve storage key. Source of truth is [persist], with [name] as an
|
|
76
|
+
// alias kept for back-compat — both map to the same `${STORAGE_PREFIX}${key}`
|
|
77
|
+
// localStorage namespace. If both are set, [persist] wins (more descriptive
|
|
78
|
+
// attribute should beat the legacy alias). Final fallback is [slot] so an
|
|
79
|
+
// un-named sidebar still namespaces itself per-position.
|
|
73
80
|
const slot = this.getAttribute('slot') || 'leading';
|
|
74
|
-
const
|
|
75
|
-
this.#storageKey = `${STORAGE_PREFIX}${
|
|
81
|
+
const key = this.getAttribute('persist') || this.getAttribute('name') || slot;
|
|
82
|
+
this.#storageKey = `${STORAGE_PREFIX}${key}`;
|
|
76
83
|
|
|
77
84
|
// Restore persisted width
|
|
78
85
|
this.#restoreWidth();
|
|
@@ -169,7 +176,7 @@ class EditorSidebar extends UIElement {
|
|
|
169
176
|
|
|
170
177
|
#emitToggle() {
|
|
171
178
|
const slot = this.getAttribute('slot') || 'leading';
|
|
172
|
-
const name = this.getAttribute('name') || slot;
|
|
179
|
+
const name = this.getAttribute('persist') || this.getAttribute('name') || slot;
|
|
173
180
|
this.dispatchEvent(new CustomEvent('sidebar-toggle', {
|
|
174
181
|
bubbles: true,
|
|
175
182
|
detail: { name, expanded: !this.collapsed },
|
|
@@ -37,6 +37,20 @@ props:
|
|
|
37
37
|
type: boolean
|
|
38
38
|
default: false
|
|
39
39
|
reflect: true
|
|
40
|
+
persist:
|
|
41
|
+
description: |
|
|
42
|
+
localStorage key suffix. When set, the sidebar persists its pane
|
|
43
|
+
width across reloads under `adia-editor-sidebar-{persist}`.
|
|
44
|
+
Preferred over the [name] alias kept for v0.4.x back-compat.
|
|
45
|
+
Defaults to [name] then [slot] if neither set.
|
|
46
|
+
type: string
|
|
47
|
+
default: ""
|
|
48
|
+
name:
|
|
49
|
+
description: |
|
|
50
|
+
Alias for [persist]; kept for v0.4.x back-compat. Deprecated —
|
|
51
|
+
new code should use [persist]. If both are set, [persist] wins.
|
|
52
|
+
type: string
|
|
53
|
+
default: ""
|
|
40
54
|
|
|
41
55
|
events:
|
|
42
56
|
sidebar-toggle:
|