@adia-ai/web-components 0.0.1 → 0.0.3
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/a2ui/index.js +23 -17
- package/components/accordion/accordion.js +1 -1
- package/components/action-list/action-list.js +1 -1
- package/components/agent-artifact/agent-artifact.js +1 -1
- package/components/agent-feedback-bar/agent-feedback-bar.js +1 -1
- package/components/agent-questions/agent-questions.js +1 -1
- package/components/agent-reasoning/agent-reasoning.a2ui.json +14 -8
- package/components/agent-reasoning/agent-reasoning.css +1 -1
- package/components/agent-reasoning/agent-reasoning.js +9 -9
- package/components/agent-reasoning/agent-reasoning.yaml +9 -6
- package/components/agent-suggestions/agent-suggestions.js +1 -1
- package/components/agent-trace/agent-trace.js +1 -1
- package/components/alert/alert.js +1 -1
- package/components/avatar/avatar.a2ui.json +0 -10
- package/components/avatar/avatar.css +1 -1
- package/components/avatar/avatar.js +1 -1
- package/components/avatar/avatar.yaml +0 -8
- package/components/badge/badge.a2ui.json +6 -6
- package/components/badge/badge.js +22 -1
- package/components/badge/badge.yaml +8 -5
- package/components/block/block.js +1 -1
- package/components/breadcrumb/breadcrumb.js +1 -1
- package/components/button/button.a2ui.json +0 -11
- package/components/button/button.css +1 -1
- package/components/button/button.js +3 -3
- package/components/button/button.yaml +0 -11
- package/components/calendar-picker/calendar-picker.js +25 -19
- package/components/canvas/canvas.js +3 -3
- package/components/card/card.a2ui.json +0 -21
- package/components/card/card.js +2 -2
- package/components/card/card.yaml +0 -14
- package/components/chart/chart.a2ui.json +9 -8
- package/components/chart/chart.js +1 -1
- package/components/chart/chart.yaml +7 -5
- package/components/chat/chat-input.js +1 -1
- package/components/chat/chat.js +2 -2
- package/components/check/check.css +1 -1
- package/components/check/check.js +2 -2
- package/components/code/code.a2ui.json +0 -5
- package/components/code/code.js +1 -1
- package/components/code/code.yaml +0 -4
- package/components/col/col.a2ui.json +0 -20
- package/components/col/col.js +1 -1
- package/components/col/col.yaml +0 -20
- package/components/color-picker/color-picker.a2ui.json +1 -1
- package/components/color-picker/color-picker.js +5 -2
- package/components/color-picker/color-picker.yaml +1 -1
- package/components/command/command.js +22 -11
- package/components/description-list/description-list.js +1 -1
- package/components/divider/divider.a2ui.json +0 -19
- package/components/divider/divider.js +1 -1
- package/components/divider/divider.yaml +0 -12
- package/components/drawer/drawer.a2ui.json +2 -2
- package/components/drawer/drawer.css +1 -1
- package/components/drawer/drawer.js +2 -2
- package/components/drawer/drawer.yaml +3 -3
- package/components/embed/embed.js +1 -1
- package/components/empty-state/empty-state.a2ui.json +0 -13
- package/components/empty-state/empty-state.js +1 -1
- package/components/empty-state/empty-state.yaml +0 -5
- package/components/footer/footer.a2ui.json +1 -1
- package/components/footer/footer.yaml +1 -1
- package/components/grid/grid.a2ui.json +0 -5
- package/components/grid/grid.js +1 -1
- package/components/grid/grid.yaml +0 -4
- package/components/header/header.a2ui.json +1 -1
- package/components/header/header.yaml +1 -1
- package/components/heatmap/heatmap.a2ui.json +4 -4
- package/components/heatmap/heatmap.js +4 -4
- package/components/heatmap/heatmap.yaml +4 -4
- package/components/icon/icon.a2ui.json +13 -0
- package/components/icon/icon.js +2 -2
- package/components/icon/icon.yaml +6 -0
- package/components/image/image.a2ui.json +10 -21
- package/components/image/image.js +1 -1
- package/components/image/image.yaml +8 -16
- package/components/input/input.a2ui.json +0 -15
- package/components/input/input.js +2 -2
- package/components/input/input.yaml +0 -12
- package/components/inspector/inspector.a2ui.json +0 -5
- package/components/inspector/inspector.js +2 -2
- package/components/inspector/inspector.yaml +0 -4
- package/components/kbd/kbd.js +1 -1
- package/components/list/list.a2ui.json +0 -33
- package/components/list/list.js +1 -1
- package/components/list/list.yaml +0 -27
- package/components/menu/menu.a2ui.json +0 -10
- package/components/menu/menu.js +9 -3
- package/components/menu/menu.yaml +0 -8
- package/components/modal/modal.a2ui.json +1 -25
- package/components/modal/modal.js +1 -1
- package/components/modal/modal.yaml +1 -22
- package/components/noodles/noodles.a2ui.json +0 -5
- package/components/noodles/noodles.js +1 -1
- package/components/noodles/noodles.yaml +0 -5
- package/components/otp-input/otp-input.a2ui.json +0 -5
- package/components/otp-input/otp-input.js +1 -1
- package/components/otp-input/otp-input.yaml +0 -4
- package/components/pagination/pagination.a2ui.json +3 -13
- package/components/pagination/pagination.css +1 -1
- package/components/pagination/pagination.js +1 -1
- package/components/pagination/pagination.yaml +5 -14
- package/components/pane/pane.a2ui.json +0 -10
- package/components/pane/pane.js +1 -1
- package/components/pane/pane.yaml +0 -9
- package/components/pipeline-status/pipeline-status.js +1 -1
- package/components/popover/popover.a2ui.json +0 -14
- package/components/popover/popover.js +9 -3
- package/components/popover/popover.yaml +0 -11
- package/components/progress/progress.a2ui.json +2 -12
- package/components/progress/progress.js +1 -1
- package/components/progress/progress.yaml +2 -11
- package/components/progress-row/progress-row.a2ui.json +3 -13
- package/components/progress-row/progress-row.js +1 -1
- package/components/progress-row/progress-row.yaml +3 -11
- package/components/radio/radio.css +1 -1
- package/components/radio/radio.js +2 -2
- package/components/range/range.js +1 -1
- package/components/rating/rating.js +1 -1
- package/components/richtext/richtext.js +2 -2
- package/components/row/row.a2ui.json +0 -5
- package/components/row/row.js +2 -2
- package/components/row/row.yaml +0 -4
- package/components/search/search.a2ui.json +0 -5
- package/components/search/search.js +1 -1
- package/components/search/search.yaml +0 -4
- package/components/section/section.a2ui.json +1 -1
- package/components/section/section.yaml +1 -1
- package/components/segment/segment.js +1 -1
- package/components/segmented/segmented.css +1 -1
- package/components/segmented/segmented.js +1 -1
- package/components/select/select.a2ui.json +5 -0
- package/components/select/select.js +13 -3
- package/components/select/select.yaml +5 -0
- package/components/skeleton/skeleton.a2ui.json +0 -11
- package/components/skeleton/skeleton.js +1 -1
- package/components/skeleton/skeleton.yaml +0 -5
- package/components/slider/slider.a2ui.json +0 -5
- package/components/slider/slider.js +1 -1
- package/components/slider/slider.yaml +0 -5
- package/components/stack/stack.js +1 -1
- package/components/stat/stat.js +1 -1
- package/components/stepper/stepper.js +1 -1
- package/components/stream/stream.js +1 -1
- package/components/swiper/swiper.a2ui.json +7 -7
- package/components/swiper/swiper.js +2 -2
- package/components/swiper/swiper.yaml +8 -6
- package/components/switch/switch.css +1 -1
- package/components/switch/switch.js +2 -2
- package/components/table/table.js +1 -1
- package/components/tabs/tab.js +1 -1
- package/components/tabs/tabs.js +1 -1
- package/components/tag/tag.a2ui.json +0 -5
- package/components/tag/tag.js +1 -1
- package/components/tag/tag.yaml +0 -4
- package/components/text/text.a2ui.json +5 -0
- package/components/text/text.css +2 -2
- package/components/text/text.js +1 -1
- package/components/text/text.yaml +5 -0
- package/components/textarea/textarea.js +1 -1
- package/components/timeline/timeline.a2ui.json +8 -13
- package/components/timeline/timeline.js +1 -1
- package/components/timeline/timeline.yaml +6 -11
- package/components/toast/toast.a2ui.json +0 -15
- package/components/toast/toast.js +1 -1
- package/components/toast/toast.yaml +0 -13
- package/components/toggle-group/toggle-group.js +1 -1
- package/components/toolbar/toolbar.a2ui.json +0 -23
- package/components/toolbar/toolbar.js +13 -3
- package/components/toolbar/toolbar.yaml +0 -19
- package/components/tooltip/tooltip.a2ui.json +0 -10
- package/components/tooltip/tooltip.js +2 -2
- package/components/tooltip/tooltip.yaml +0 -8
- package/components/tree/tree.js +1 -1
- package/components/upload/upload.js +1 -1
- package/core/markdown.js +1 -1
- package/core/provider.js +2 -2
- package/package.json +7 -3
- package/patterns/a2ui-root/a2ui-root.a2ui.json +118 -0
- package/{a2ui/root.js → patterns/a2ui-root/a2ui-root.js} +9 -4
- package/patterns/a2ui-root/a2ui-root.yaml +76 -0
- package/patterns/adia-chat/adia-chat.js +3 -3
- package/patterns/adia-chat/css/adia-chat.streaming.css +2 -2
- package/patterns/adia-editor/adia-editor.js +1 -1
- package/patterns/app-nav/app-nav.js +1 -1
- package/patterns/app-nav-group/app-nav-group.js +2 -2
- package/patterns/app-nav-item/app-nav-item.js +1 -1
- package/patterns/app-shell/app-shell.js +1 -1
- package/patterns/gen-ui/gen-ui.css +3 -3
- package/patterns/gen-ui/gen-ui.js +1 -1
- package/patterns/index.js +1 -0
- package/patterns/section-nav/section-nav.js +1 -1
- package/patterns/section-nav-group/section-nav-group.js +1 -1
- package/patterns/section-nav-item/section-nav-item.js +1 -1
- package/traits/define.js +1 -1
- package/a2ui/dockables/action.js +0 -152
- package/a2ui/dockables/base.js +0 -30
- package/a2ui/dockables/controller.js +0 -97
- package/a2ui/dockables/data-source.js +0 -103
- package/a2ui/dockables/index.js +0 -6
- package/a2ui/dockables/lifecycle.js +0 -84
- package/a2ui/dockables/provider.js +0 -59
- package/a2ui/manifest-runtime.js +0 -226
- package/a2ui/registry.js +0 -200
- package/a2ui/renderer.js +0 -361
- package/a2ui/stream.js +0 -243
- package/a2ui/surface-manifest.js +0 -294
- package/a2ui/surface.js +0 -222
- package/a2ui/wire-factory.js +0 -134
- package/a2ui/wiring-engine.js +0 -209
- package/a2ui/wiring-registry.js +0 -342
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
* Platform: Popover API (top-layer) + CSS Anchor Positioning via @core/anchor.js.
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
import { AdiaElement } from '
|
|
24
|
-
import { anchorPopover } from '
|
|
23
|
+
import { AdiaElement } from '../../core/element.js';
|
|
24
|
+
import { anchorPopover } from '../../core/anchor.js';
|
|
25
25
|
|
|
26
26
|
const SPILLOVER_ATTR = 'data-toolbar-spillover';
|
|
27
27
|
const SPILLOVER_MENU_ATTR = 'data-toolbar-spillover-menu';
|
|
@@ -48,6 +48,7 @@ class AdiaToolbar extends AdiaElement {
|
|
|
48
48
|
#spilloverCleanup = null;
|
|
49
49
|
#measuring = false;
|
|
50
50
|
#reflowQueued = false;
|
|
51
|
+
#rafId = null;
|
|
51
52
|
|
|
52
53
|
connected() {
|
|
53
54
|
this.setAttribute('role', 'toolbar');
|
|
@@ -111,7 +112,8 @@ class AdiaToolbar extends AdiaElement {
|
|
|
111
112
|
placement: 'bottom-end',
|
|
112
113
|
gap: 4,
|
|
113
114
|
});
|
|
114
|
-
requestAnimationFrame(() => {
|
|
115
|
+
this.#rafId = requestAnimationFrame(() => {
|
|
116
|
+
this.#rafId = null;
|
|
115
117
|
document.addEventListener('pointerdown', this.#onOutside, true);
|
|
116
118
|
document.addEventListener('keydown', this.#onKey, true);
|
|
117
119
|
});
|
|
@@ -121,6 +123,10 @@ class AdiaToolbar extends AdiaElement {
|
|
|
121
123
|
this.#spilloverCleanup?.();
|
|
122
124
|
this.#spilloverCleanup = null;
|
|
123
125
|
if (this.#popover?.matches(':popover-open')) this.#popover.hidePopover?.();
|
|
126
|
+
if (this.#rafId != null) {
|
|
127
|
+
cancelAnimationFrame(this.#rafId);
|
|
128
|
+
this.#rafId = null;
|
|
129
|
+
}
|
|
124
130
|
document.removeEventListener('pointerdown', this.#onOutside, true);
|
|
125
131
|
document.removeEventListener('keydown', this.#onKey, true);
|
|
126
132
|
}
|
|
@@ -168,6 +174,10 @@ class AdiaToolbar extends AdiaElement {
|
|
|
168
174
|
// Keep listeners cleaned up if closed externally.
|
|
169
175
|
this.#spilloverCleanup?.();
|
|
170
176
|
this.#spilloverCleanup = null;
|
|
177
|
+
if (this.#rafId != null) {
|
|
178
|
+
cancelAnimationFrame(this.#rafId);
|
|
179
|
+
this.#rafId = null;
|
|
180
|
+
}
|
|
171
181
|
document.removeEventListener('pointerdown', this.#onOutside, true);
|
|
172
182
|
document.removeEventListener('keydown', this.#onKey, true);
|
|
173
183
|
}
|
|
@@ -14,11 +14,6 @@ props:
|
|
|
14
14
|
type: boolean
|
|
15
15
|
default: false
|
|
16
16
|
reflect: true
|
|
17
|
-
vertical:
|
|
18
|
-
description: Stack items vertically (alias for orientation="vertical").
|
|
19
|
-
type: boolean
|
|
20
|
-
default: false
|
|
21
|
-
reflect: true
|
|
22
17
|
align:
|
|
23
18
|
description: Item alignment
|
|
24
19
|
type: string
|
|
@@ -27,13 +22,6 @@ props:
|
|
|
27
22
|
description: Gap between items
|
|
28
23
|
type: string
|
|
29
24
|
default: sm
|
|
30
|
-
orientation:
|
|
31
|
-
description: Layout direction. Vertical mode disables overflow.
|
|
32
|
-
type: string
|
|
33
|
-
default: horizontal
|
|
34
|
-
enum:
|
|
35
|
-
- horizontal
|
|
36
|
-
- vertical
|
|
37
25
|
overflow:
|
|
38
26
|
description: Overflow behavior
|
|
39
27
|
type: string
|
|
@@ -41,13 +29,6 @@ props:
|
|
|
41
29
|
enum:
|
|
42
30
|
- menu
|
|
43
31
|
- none
|
|
44
|
-
variant:
|
|
45
|
-
description: Visual style. Transparent removes background, border, and padding.
|
|
46
|
-
type: string
|
|
47
|
-
default: ""
|
|
48
|
-
enum:
|
|
49
|
-
- ""
|
|
50
|
-
- transparent
|
|
51
32
|
events: {}
|
|
52
33
|
slots: {}
|
|
53
34
|
states:
|
|
@@ -13,11 +13,6 @@
|
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
15
|
"properties": {
|
|
16
|
-
"anchor": {
|
|
17
|
-
"description": "ID of the anchor element that triggers the tooltip.",
|
|
18
|
-
"type": "string",
|
|
19
|
-
"default": ""
|
|
20
|
-
},
|
|
21
16
|
"component": {
|
|
22
17
|
"const": "Tooltip"
|
|
23
18
|
},
|
|
@@ -26,11 +21,6 @@
|
|
|
26
21
|
"type": "number",
|
|
27
22
|
"default": 400
|
|
28
23
|
},
|
|
29
|
-
"offset": {
|
|
30
|
-
"description": "Distance in pixels between the tooltip and the anchor element.",
|
|
31
|
-
"type": "number",
|
|
32
|
-
"default": 8
|
|
33
|
-
},
|
|
34
24
|
"placement": {
|
|
35
25
|
"description": "Preferred position relative to the anchor element.",
|
|
36
26
|
"type": "string",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* No click interaction — hover/focus only.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { AdiaElement } from '
|
|
14
|
-
import { anchorPopover } from '
|
|
13
|
+
import { AdiaElement } from '../../core/element.js';
|
|
14
|
+
import { anchorPopover } from '../../core/anchor.js';
|
|
15
15
|
|
|
16
16
|
class AdiaTooltip extends AdiaElement {
|
|
17
17
|
static properties = {
|
|
@@ -8,18 +8,10 @@ category: container
|
|
|
8
8
|
version: 1
|
|
9
9
|
description: Tooltip popup on hover/focus. Uses Popover API for top-layer rendering.
|
|
10
10
|
props:
|
|
11
|
-
anchor:
|
|
12
|
-
description: ID of the anchor element that triggers the tooltip.
|
|
13
|
-
type: string
|
|
14
|
-
default: ""
|
|
15
11
|
delay:
|
|
16
12
|
description: Delay in milliseconds before showing the tooltip on hover.
|
|
17
13
|
type: number
|
|
18
14
|
default: 400
|
|
19
|
-
offset:
|
|
20
|
-
description: Distance in pixels between the tooltip and the anchor element.
|
|
21
|
-
type: number
|
|
22
|
-
default: 8
|
|
23
15
|
placement:
|
|
24
16
|
description: Preferred position relative to the anchor element.
|
|
25
17
|
type: string
|
package/components/tree/tree.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* tree-select — fired on tree-ui when an item is selected (detail: { item, text, value })
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import { AdiaElement } from '
|
|
22
|
+
import { AdiaElement } from '../../core/element.js';
|
|
23
23
|
|
|
24
24
|
class AdiaTree extends AdiaElement {
|
|
25
25
|
static template = () => null;
|
package/core/markdown.js
CHANGED
package/core/provider.js
CHANGED
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
* ctrl.commands.navigate('/about');
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import { AdiaElement } from '
|
|
26
|
-
import { BaseController } from '
|
|
25
|
+
import { AdiaElement } from './element.js';
|
|
26
|
+
import { BaseController } from './controller.js';
|
|
27
27
|
|
|
28
28
|
// ═══════════════════════════════════════════════════════════════
|
|
29
29
|
// NANO PROVIDER (inline — tiny base class)
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adia-ai/web-components",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "AdiaUI web components — vanilla custom elements
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "AdiaUI web components — vanilla custom elements. A2UI runtime (renderer, registry, streams, wiring) lives in @adia-ai/a2ui-utils.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./index.js",
|
|
8
8
|
"./css": "./index.css",
|
|
9
9
|
"./a2ui": "./a2ui/index.js",
|
|
10
|
-
"./core": "./core/index.js"
|
|
10
|
+
"./core": "./core/index.js",
|
|
11
|
+
"./patterns": "./patterns/index.js"
|
|
11
12
|
},
|
|
12
13
|
"files": [
|
|
13
14
|
"core/",
|
|
@@ -26,6 +27,9 @@
|
|
|
26
27
|
"./patterns/**/*.js",
|
|
27
28
|
"./core/provider.js"
|
|
28
29
|
],
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@adia-ai/a2ui-utils": "^0.0.1"
|
|
32
|
+
},
|
|
29
33
|
"publishConfig": {
|
|
30
34
|
"access": "public",
|
|
31
35
|
"registry": "https://registry.npmjs.org"
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://adiaui.dev/a2ui/v0_9/components/A2UIRoot.json",
|
|
4
|
+
"title": "A2UIRoot",
|
|
5
|
+
"description": "A2UI protocol surface. Connects to a stream source (SSE, WebSocket, JSONL, MCP) and renders A2UI messages as AdiaUI components via the `@adia-ai/a2ui-utils` renderer.",
|
|
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
|
+
"active": {
|
|
17
|
+
"description": "True while the stream is connected and receiving messages.",
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"default": false
|
|
20
|
+
},
|
|
21
|
+
"batch": {
|
|
22
|
+
"description": "Batch renderer updates via requestAnimationFrame for large fan-in.",
|
|
23
|
+
"type": "boolean",
|
|
24
|
+
"default": false
|
|
25
|
+
},
|
|
26
|
+
"component": {
|
|
27
|
+
"const": "A2UIRoot"
|
|
28
|
+
},
|
|
29
|
+
"loading": {
|
|
30
|
+
"description": "True while the stream is connecting.",
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"default": false
|
|
33
|
+
},
|
|
34
|
+
"src": {
|
|
35
|
+
"description": "Stream source URL (endpoint for SSE/WebSocket, file path for JSONL, tool-call target for MCP).",
|
|
36
|
+
"type": "string",
|
|
37
|
+
"default": ""
|
|
38
|
+
},
|
|
39
|
+
"transport": {
|
|
40
|
+
"description": "Stream transport to use.",
|
|
41
|
+
"type": "string",
|
|
42
|
+
"enum": [
|
|
43
|
+
"sse",
|
|
44
|
+
"ws",
|
|
45
|
+
"websocket",
|
|
46
|
+
"jsonl",
|
|
47
|
+
"mcp"
|
|
48
|
+
],
|
|
49
|
+
"default": "sse"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"required": [
|
|
53
|
+
"component"
|
|
54
|
+
],
|
|
55
|
+
"unevaluatedProperties": false,
|
|
56
|
+
"x-adiaui": {
|
|
57
|
+
"anti_patterns": [],
|
|
58
|
+
"category": "container",
|
|
59
|
+
"events": {
|
|
60
|
+
"a2ui-action": {
|
|
61
|
+
"description": "Fired when a child element with [data-action] is clicked. detail: { name, sourceComponentId, context }"
|
|
62
|
+
},
|
|
63
|
+
"a2ui-closed": {
|
|
64
|
+
"description": "Fired when the stream ends."
|
|
65
|
+
},
|
|
66
|
+
"a2ui-connected": {
|
|
67
|
+
"description": "Fired when the stream is established."
|
|
68
|
+
},
|
|
69
|
+
"a2ui-error": {
|
|
70
|
+
"description": "Fired when the stream errors. detail: { error }"
|
|
71
|
+
},
|
|
72
|
+
"a2ui-message": {
|
|
73
|
+
"description": "Fired for each A2UI message received. detail: { message }"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"examples": [],
|
|
77
|
+
"keywords": [
|
|
78
|
+
"a2ui",
|
|
79
|
+
"protocol",
|
|
80
|
+
"renderer",
|
|
81
|
+
"stream",
|
|
82
|
+
"surface",
|
|
83
|
+
"sse",
|
|
84
|
+
"websocket",
|
|
85
|
+
"jsonl",
|
|
86
|
+
"mcp"
|
|
87
|
+
],
|
|
88
|
+
"name": "AdiaA2UIRoot",
|
|
89
|
+
"related": [
|
|
90
|
+
"canvas",
|
|
91
|
+
"inspector"
|
|
92
|
+
],
|
|
93
|
+
"slots": {
|
|
94
|
+
"default": {
|
|
95
|
+
"description": "The rendered surface. Children are stamped by the A2UI renderer."
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"states": [
|
|
99
|
+
{
|
|
100
|
+
"description": "Default, ready to connect.",
|
|
101
|
+
"name": "idle"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"description": "Stream is connecting.",
|
|
105
|
+
"name": "loading"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"description": "Stream is connected and receiving messages.",
|
|
109
|
+
"name": "active"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"synonyms": {},
|
|
113
|
+
"tag": "a2ui-root",
|
|
114
|
+
"tokens": {},
|
|
115
|
+
"traits": [],
|
|
116
|
+
"version": 1
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -13,10 +13,15 @@
|
|
|
13
13
|
* a2ui-action — user interaction (detail: { name, sourceComponentId, context })
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { AdiaElement } from '
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
import { AdiaElement } from '../../core/element.js';
|
|
17
|
+
import {
|
|
18
|
+
A2UIRenderer,
|
|
19
|
+
registry,
|
|
20
|
+
sseStream,
|
|
21
|
+
wsStream,
|
|
22
|
+
jsonlStream,
|
|
23
|
+
mcpStream,
|
|
24
|
+
} from '@adia-ai/a2ui-utils';
|
|
20
25
|
|
|
21
26
|
class AdiaA2UIRoot extends AdiaElement {
|
|
22
27
|
static properties = {
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Edit this file; run `npm run build:components` to regenerate a2ui.json.
|
|
2
|
+
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
3
|
+
name: AdiaA2UIRoot
|
|
4
|
+
tag: a2ui-root
|
|
5
|
+
component: A2UIRoot
|
|
6
|
+
category: container
|
|
7
|
+
version: 1
|
|
8
|
+
description: A2UI protocol surface. Connects to a stream source (SSE, WebSocket, JSONL, MCP) and renders A2UI messages as AdiaUI components via the `@adia-ai/a2ui-utils` renderer.
|
|
9
|
+
props:
|
|
10
|
+
src:
|
|
11
|
+
description: Stream source URL (endpoint for SSE/WebSocket, file path for JSONL, tool-call target for MCP).
|
|
12
|
+
type: string
|
|
13
|
+
default: ""
|
|
14
|
+
transport:
|
|
15
|
+
description: Stream transport to use.
|
|
16
|
+
type: string
|
|
17
|
+
default: sse
|
|
18
|
+
enum:
|
|
19
|
+
- sse
|
|
20
|
+
- ws
|
|
21
|
+
- websocket
|
|
22
|
+
- jsonl
|
|
23
|
+
- mcp
|
|
24
|
+
loading:
|
|
25
|
+
description: True while the stream is connecting.
|
|
26
|
+
type: boolean
|
|
27
|
+
default: false
|
|
28
|
+
reflect: true
|
|
29
|
+
active:
|
|
30
|
+
description: True while the stream is connected and receiving messages.
|
|
31
|
+
type: boolean
|
|
32
|
+
default: false
|
|
33
|
+
reflect: true
|
|
34
|
+
batch:
|
|
35
|
+
description: Batch renderer updates via requestAnimationFrame for large fan-in.
|
|
36
|
+
type: boolean
|
|
37
|
+
default: false
|
|
38
|
+
events:
|
|
39
|
+
a2ui-connected:
|
|
40
|
+
description: Fired when the stream is established.
|
|
41
|
+
a2ui-message:
|
|
42
|
+
description: "Fired for each A2UI message received. detail: { message }"
|
|
43
|
+
a2ui-action:
|
|
44
|
+
description: "Fired when a child element with [data-action] is clicked. detail: { name, sourceComponentId, context }"
|
|
45
|
+
a2ui-error:
|
|
46
|
+
description: "Fired when the stream errors. detail: { error }"
|
|
47
|
+
a2ui-closed:
|
|
48
|
+
description: Fired when the stream ends.
|
|
49
|
+
slots:
|
|
50
|
+
default:
|
|
51
|
+
description: The rendered surface. Children are stamped by the A2UI renderer.
|
|
52
|
+
states:
|
|
53
|
+
- name: idle
|
|
54
|
+
description: Default, ready to connect.
|
|
55
|
+
- name: loading
|
|
56
|
+
description: Stream is connecting.
|
|
57
|
+
- name: active
|
|
58
|
+
description: Stream is connected and receiving messages.
|
|
59
|
+
traits: []
|
|
60
|
+
tokens: {}
|
|
61
|
+
a2ui:
|
|
62
|
+
rules: []
|
|
63
|
+
anti_patterns: []
|
|
64
|
+
keywords:
|
|
65
|
+
- a2ui
|
|
66
|
+
- protocol
|
|
67
|
+
- renderer
|
|
68
|
+
- stream
|
|
69
|
+
- surface
|
|
70
|
+
- sse
|
|
71
|
+
- websocket
|
|
72
|
+
- jsonl
|
|
73
|
+
- mcp
|
|
74
|
+
related:
|
|
75
|
+
- canvas
|
|
76
|
+
- inspector
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AdiaElement } from '
|
|
2
|
-
import { renderMarkdown } from '
|
|
3
|
-
import { streamChat } from '
|
|
1
|
+
import { AdiaElement } from '../../core/element.js';
|
|
2
|
+
import { renderMarkdown } from '../../core/markdown.js';
|
|
3
|
+
import { streamChat } from '../../../gen-ui/llm/adapters/index.js';
|
|
4
4
|
|
|
5
5
|
function escapeHTML(s) {
|
|
6
6
|
return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
@@ -10,10 +10,10 @@ adia-chat-ui [data-cursor] {
|
|
|
10
10
|
background: var(--chat-cursor-color);
|
|
11
11
|
margin-inline-start: 1px;
|
|
12
12
|
vertical-align: text-bottom;
|
|
13
|
-
animation: adia-chat-
|
|
13
|
+
animation: adia-chat-blink var(--chat-cursor-speed) step-end infinite;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
@keyframes adia-chat-
|
|
16
|
+
@keyframes adia-chat-blink {
|
|
17
17
|
50% { opacity: 0; }
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* popover with its children instead of toggling inline expansion.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { AdiaElement } from '
|
|
10
|
-
import { anchorPopover } from '
|
|
9
|
+
import { AdiaElement } from '../../core/element.js';
|
|
10
|
+
import { anchorPopover } from '../../core/anchor.js';
|
|
11
11
|
|
|
12
12
|
class AdiaAppNavGroup extends AdiaElement {
|
|
13
13
|
static properties = {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
grid-template-columns: minmax(320px, 1fr) 1.5fr;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
:scope[mode="split"] >
|
|
40
|
+
:scope[mode="split"] > chat-ui {
|
|
41
41
|
border-right: var(--a-border-thin) solid var(--a-canvas-border-subtle);
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
grid-template-columns: 1fr;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
:scope[mode="canvas"] >
|
|
52
|
+
:scope[mode="canvas"] > chat-ui {
|
|
53
53
|
display: none;
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
CHILDREN — fill grid cells
|
|
75
75
|
═══════════════════════════════════════════════════════ */
|
|
76
76
|
|
|
77
|
-
:scope >
|
|
77
|
+
:scope > chat-ui,
|
|
78
78
|
:scope > canvas-ui,
|
|
79
79
|
:scope > inspector-ui {
|
|
80
80
|
min-height: 0;
|
package/patterns/index.js
CHANGED
|
@@ -8,3 +8,4 @@ export { AdiaSectionNavItem } from './section-nav-item/section-nav-item.js';
|
|
|
8
8
|
export { AdiaGenUI } from './gen-ui/gen-ui.js';
|
|
9
9
|
export { AdiaChatElement } from './adia-chat/adia-chat.js';
|
|
10
10
|
export { AdiaEditorElement } from './adia-editor/adia-editor.js';
|
|
11
|
+
export { AdiaA2UIRoot } from './a2ui-root/a2ui-root.js';
|
package/traits/define.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* A trait is a reusable behavior package: event listeners, attribute management,
|
|
5
5
|
* and cleanup — defined once, attached to any element.
|
|
6
6
|
*
|
|
7
|
-
* import { defineTrait } from '
|
|
7
|
+
* import { defineTrait } from './define.js';
|
|
8
8
|
*
|
|
9
9
|
* export const pressable = defineTrait({
|
|
10
10
|
* name: 'pressable',
|