@adia-ai/web-components 0.0.2 → 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.js +1 -1
- 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.js +1 -1
- package/components/badge/badge.js +1 -1
- package/components/block/block.js +1 -1
- package/components/breadcrumb/breadcrumb.js +1 -1
- package/components/button/button.js +2 -2
- package/components/calendar-picker/calendar-picker.js +2 -2
- package/components/canvas/canvas.js +2 -2
- package/components/card/card.js +2 -2
- package/components/chart/chart.js +1 -1
- package/components/chat/chat-input.js +1 -1
- package/components/chat/chat.js +2 -2
- package/components/check/check.js +2 -2
- package/components/code/code.js +1 -1
- package/components/col/col.js +1 -1
- package/components/color-picker/color-picker.js +1 -1
- package/components/command/command.js +1 -1
- package/components/description-list/description-list.js +1 -1
- package/components/divider/divider.js +1 -1
- package/components/drawer/drawer.js +1 -1
- package/components/embed/embed.js +1 -1
- package/components/empty-state/empty-state.js +1 -1
- package/components/grid/grid.js +1 -1
- package/components/heatmap/heatmap.js +1 -1
- package/components/icon/icon.js +2 -2
- package/components/image/image.js +1 -1
- package/components/input/input.js +2 -2
- package/components/inspector/inspector.js +2 -2
- package/components/kbd/kbd.js +1 -1
- package/components/list/list.js +1 -1
- package/components/menu/menu.js +2 -2
- package/components/modal/modal.js +1 -1
- package/components/noodles/noodles.js +1 -1
- package/components/otp-input/otp-input.js +1 -1
- package/components/pagination/pagination.js +1 -1
- package/components/pane/pane.js +1 -1
- package/components/pipeline-status/pipeline-status.js +1 -1
- package/components/popover/popover.js +2 -2
- package/components/progress/progress.js +1 -1
- package/components/progress-row/progress-row.js +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.js +2 -2
- package/components/search/search.js +1 -1
- package/components/segment/segment.js +1 -1
- package/components/segmented/segmented.js +1 -1
- package/components/select/select.js +2 -2
- package/components/skeleton/skeleton.js +1 -1
- package/components/slider/slider.js +1 -1
- 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.js +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.js +1 -1
- package/components/text/text.js +1 -1
- package/components/textarea/textarea.js +1 -1
- package/components/timeline/timeline.js +1 -1
- package/components/toast/toast.js +1 -1
- package/components/toggle-group/toggle-group.js +1 -1
- package/components/toolbar/toolbar.js +2 -2
- package/components/tooltip/tooltip.js +2 -2
- 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-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.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
package/components/stat/stat.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Pure CSS track + thumb, no native <input>.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { AdiaFormElement } from '
|
|
7
|
-
import { html } from '
|
|
6
|
+
import { AdiaFormElement } from '../../core/form.js';
|
|
7
|
+
import { html } from '../../core/element.js';
|
|
8
8
|
|
|
9
9
|
class AdiaSwitch extends AdiaFormElement {
|
|
10
10
|
static properties = {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
* cell-click — { detail: { key, row, value, dataIndex } }
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
|
-
import { AdiaElement } from '
|
|
39
|
+
import { AdiaElement } from '../../core/element.js';
|
|
40
40
|
import { cellTypes, sortFns } from './cell-types.js';
|
|
41
41
|
|
|
42
42
|
// ── Helpers ──────────────────────────────────────────────────────────────────
|
package/components/tabs/tab.js
CHANGED
package/components/tabs/tabs.js
CHANGED
package/components/tag/tag.js
CHANGED
package/components/text/text.js
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
* .outcomes = string[] // renders an expandable sub-list under the row
|
|
41
41
|
*/
|
|
42
42
|
|
|
43
|
-
import { AdiaElement } from '
|
|
43
|
+
import { AdiaElement } from '../../core/element.js';
|
|
44
44
|
|
|
45
45
|
// ── Container ──────────────────────────────────────────────────
|
|
46
46
|
|
|
@@ -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';
|
|
@@ -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 = {
|
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, '>');
|
|
@@ -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 = {
|
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',
|