@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.
Files changed (211) hide show
  1. package/a2ui/index.js +23 -17
  2. package/components/accordion/accordion.js +1 -1
  3. package/components/action-list/action-list.js +1 -1
  4. package/components/agent-artifact/agent-artifact.js +1 -1
  5. package/components/agent-feedback-bar/agent-feedback-bar.js +1 -1
  6. package/components/agent-questions/agent-questions.js +1 -1
  7. package/components/agent-reasoning/agent-reasoning.a2ui.json +14 -8
  8. package/components/agent-reasoning/agent-reasoning.css +1 -1
  9. package/components/agent-reasoning/agent-reasoning.js +9 -9
  10. package/components/agent-reasoning/agent-reasoning.yaml +9 -6
  11. package/components/agent-suggestions/agent-suggestions.js +1 -1
  12. package/components/agent-trace/agent-trace.js +1 -1
  13. package/components/alert/alert.js +1 -1
  14. package/components/avatar/avatar.a2ui.json +0 -10
  15. package/components/avatar/avatar.css +1 -1
  16. package/components/avatar/avatar.js +1 -1
  17. package/components/avatar/avatar.yaml +0 -8
  18. package/components/badge/badge.a2ui.json +6 -6
  19. package/components/badge/badge.js +22 -1
  20. package/components/badge/badge.yaml +8 -5
  21. package/components/block/block.js +1 -1
  22. package/components/breadcrumb/breadcrumb.js +1 -1
  23. package/components/button/button.a2ui.json +0 -11
  24. package/components/button/button.css +1 -1
  25. package/components/button/button.js +3 -3
  26. package/components/button/button.yaml +0 -11
  27. package/components/calendar-picker/calendar-picker.js +25 -19
  28. package/components/canvas/canvas.js +3 -3
  29. package/components/card/card.a2ui.json +0 -21
  30. package/components/card/card.js +2 -2
  31. package/components/card/card.yaml +0 -14
  32. package/components/chart/chart.a2ui.json +9 -8
  33. package/components/chart/chart.js +1 -1
  34. package/components/chart/chart.yaml +7 -5
  35. package/components/chat/chat-input.js +1 -1
  36. package/components/chat/chat.js +2 -2
  37. package/components/check/check.css +1 -1
  38. package/components/check/check.js +2 -2
  39. package/components/code/code.a2ui.json +0 -5
  40. package/components/code/code.js +1 -1
  41. package/components/code/code.yaml +0 -4
  42. package/components/col/col.a2ui.json +0 -20
  43. package/components/col/col.js +1 -1
  44. package/components/col/col.yaml +0 -20
  45. package/components/color-picker/color-picker.a2ui.json +1 -1
  46. package/components/color-picker/color-picker.js +5 -2
  47. package/components/color-picker/color-picker.yaml +1 -1
  48. package/components/command/command.js +22 -11
  49. package/components/description-list/description-list.js +1 -1
  50. package/components/divider/divider.a2ui.json +0 -19
  51. package/components/divider/divider.js +1 -1
  52. package/components/divider/divider.yaml +0 -12
  53. package/components/drawer/drawer.a2ui.json +2 -2
  54. package/components/drawer/drawer.css +1 -1
  55. package/components/drawer/drawer.js +2 -2
  56. package/components/drawer/drawer.yaml +3 -3
  57. package/components/embed/embed.js +1 -1
  58. package/components/empty-state/empty-state.a2ui.json +0 -13
  59. package/components/empty-state/empty-state.js +1 -1
  60. package/components/empty-state/empty-state.yaml +0 -5
  61. package/components/footer/footer.a2ui.json +1 -1
  62. package/components/footer/footer.yaml +1 -1
  63. package/components/grid/grid.a2ui.json +0 -5
  64. package/components/grid/grid.js +1 -1
  65. package/components/grid/grid.yaml +0 -4
  66. package/components/header/header.a2ui.json +1 -1
  67. package/components/header/header.yaml +1 -1
  68. package/components/heatmap/heatmap.a2ui.json +4 -4
  69. package/components/heatmap/heatmap.js +4 -4
  70. package/components/heatmap/heatmap.yaml +4 -4
  71. package/components/icon/icon.a2ui.json +13 -0
  72. package/components/icon/icon.js +2 -2
  73. package/components/icon/icon.yaml +6 -0
  74. package/components/image/image.a2ui.json +10 -21
  75. package/components/image/image.js +1 -1
  76. package/components/image/image.yaml +8 -16
  77. package/components/input/input.a2ui.json +0 -15
  78. package/components/input/input.js +2 -2
  79. package/components/input/input.yaml +0 -12
  80. package/components/inspector/inspector.a2ui.json +0 -5
  81. package/components/inspector/inspector.js +2 -2
  82. package/components/inspector/inspector.yaml +0 -4
  83. package/components/kbd/kbd.js +1 -1
  84. package/components/list/list.a2ui.json +0 -33
  85. package/components/list/list.js +1 -1
  86. package/components/list/list.yaml +0 -27
  87. package/components/menu/menu.a2ui.json +0 -10
  88. package/components/menu/menu.js +9 -3
  89. package/components/menu/menu.yaml +0 -8
  90. package/components/modal/modal.a2ui.json +1 -25
  91. package/components/modal/modal.js +1 -1
  92. package/components/modal/modal.yaml +1 -22
  93. package/components/noodles/noodles.a2ui.json +0 -5
  94. package/components/noodles/noodles.js +1 -1
  95. package/components/noodles/noodles.yaml +0 -5
  96. package/components/otp-input/otp-input.a2ui.json +0 -5
  97. package/components/otp-input/otp-input.js +1 -1
  98. package/components/otp-input/otp-input.yaml +0 -4
  99. package/components/pagination/pagination.a2ui.json +3 -13
  100. package/components/pagination/pagination.css +1 -1
  101. package/components/pagination/pagination.js +1 -1
  102. package/components/pagination/pagination.yaml +5 -14
  103. package/components/pane/pane.a2ui.json +0 -10
  104. package/components/pane/pane.js +1 -1
  105. package/components/pane/pane.yaml +0 -9
  106. package/components/pipeline-status/pipeline-status.js +1 -1
  107. package/components/popover/popover.a2ui.json +0 -14
  108. package/components/popover/popover.js +9 -3
  109. package/components/popover/popover.yaml +0 -11
  110. package/components/progress/progress.a2ui.json +2 -12
  111. package/components/progress/progress.js +1 -1
  112. package/components/progress/progress.yaml +2 -11
  113. package/components/progress-row/progress-row.a2ui.json +3 -13
  114. package/components/progress-row/progress-row.js +1 -1
  115. package/components/progress-row/progress-row.yaml +3 -11
  116. package/components/radio/radio.css +1 -1
  117. package/components/radio/radio.js +2 -2
  118. package/components/range/range.js +1 -1
  119. package/components/rating/rating.js +1 -1
  120. package/components/richtext/richtext.js +2 -2
  121. package/components/row/row.a2ui.json +0 -5
  122. package/components/row/row.js +2 -2
  123. package/components/row/row.yaml +0 -4
  124. package/components/search/search.a2ui.json +0 -5
  125. package/components/search/search.js +1 -1
  126. package/components/search/search.yaml +0 -4
  127. package/components/section/section.a2ui.json +1 -1
  128. package/components/section/section.yaml +1 -1
  129. package/components/segment/segment.js +1 -1
  130. package/components/segmented/segmented.css +1 -1
  131. package/components/segmented/segmented.js +1 -1
  132. package/components/select/select.a2ui.json +5 -0
  133. package/components/select/select.js +13 -3
  134. package/components/select/select.yaml +5 -0
  135. package/components/skeleton/skeleton.a2ui.json +0 -11
  136. package/components/skeleton/skeleton.js +1 -1
  137. package/components/skeleton/skeleton.yaml +0 -5
  138. package/components/slider/slider.a2ui.json +0 -5
  139. package/components/slider/slider.js +1 -1
  140. package/components/slider/slider.yaml +0 -5
  141. package/components/stack/stack.js +1 -1
  142. package/components/stat/stat.js +1 -1
  143. package/components/stepper/stepper.js +1 -1
  144. package/components/stream/stream.js +1 -1
  145. package/components/swiper/swiper.a2ui.json +7 -7
  146. package/components/swiper/swiper.js +2 -2
  147. package/components/swiper/swiper.yaml +8 -6
  148. package/components/switch/switch.css +1 -1
  149. package/components/switch/switch.js +2 -2
  150. package/components/table/table.js +1 -1
  151. package/components/tabs/tab.js +1 -1
  152. package/components/tabs/tabs.js +1 -1
  153. package/components/tag/tag.a2ui.json +0 -5
  154. package/components/tag/tag.js +1 -1
  155. package/components/tag/tag.yaml +0 -4
  156. package/components/text/text.a2ui.json +5 -0
  157. package/components/text/text.css +2 -2
  158. package/components/text/text.js +1 -1
  159. package/components/text/text.yaml +5 -0
  160. package/components/textarea/textarea.js +1 -1
  161. package/components/timeline/timeline.a2ui.json +8 -13
  162. package/components/timeline/timeline.js +1 -1
  163. package/components/timeline/timeline.yaml +6 -11
  164. package/components/toast/toast.a2ui.json +0 -15
  165. package/components/toast/toast.js +1 -1
  166. package/components/toast/toast.yaml +0 -13
  167. package/components/toggle-group/toggle-group.js +1 -1
  168. package/components/toolbar/toolbar.a2ui.json +0 -23
  169. package/components/toolbar/toolbar.js +13 -3
  170. package/components/toolbar/toolbar.yaml +0 -19
  171. package/components/tooltip/tooltip.a2ui.json +0 -10
  172. package/components/tooltip/tooltip.js +2 -2
  173. package/components/tooltip/tooltip.yaml +0 -8
  174. package/components/tree/tree.js +1 -1
  175. package/components/upload/upload.js +1 -1
  176. package/core/markdown.js +1 -1
  177. package/core/provider.js +2 -2
  178. package/package.json +7 -3
  179. package/patterns/a2ui-root/a2ui-root.a2ui.json +118 -0
  180. package/{a2ui/root.js → patterns/a2ui-root/a2ui-root.js} +9 -4
  181. package/patterns/a2ui-root/a2ui-root.yaml +76 -0
  182. package/patterns/adia-chat/adia-chat.js +3 -3
  183. package/patterns/adia-chat/css/adia-chat.streaming.css +2 -2
  184. package/patterns/adia-editor/adia-editor.js +1 -1
  185. package/patterns/app-nav/app-nav.js +1 -1
  186. package/patterns/app-nav-group/app-nav-group.js +2 -2
  187. package/patterns/app-nav-item/app-nav-item.js +1 -1
  188. package/patterns/app-shell/app-shell.js +1 -1
  189. package/patterns/gen-ui/gen-ui.css +3 -3
  190. package/patterns/gen-ui/gen-ui.js +1 -1
  191. package/patterns/index.js +1 -0
  192. package/patterns/section-nav/section-nav.js +1 -1
  193. package/patterns/section-nav-group/section-nav-group.js +1 -1
  194. package/patterns/section-nav-item/section-nav-item.js +1 -1
  195. package/traits/define.js +1 -1
  196. package/a2ui/dockables/action.js +0 -152
  197. package/a2ui/dockables/base.js +0 -30
  198. package/a2ui/dockables/controller.js +0 -97
  199. package/a2ui/dockables/data-source.js +0 -103
  200. package/a2ui/dockables/index.js +0 -6
  201. package/a2ui/dockables/lifecycle.js +0 -84
  202. package/a2ui/dockables/provider.js +0 -59
  203. package/a2ui/manifest-runtime.js +0 -226
  204. package/a2ui/registry.js +0 -200
  205. package/a2ui/renderer.js +0 -361
  206. package/a2ui/stream.js +0 -243
  207. package/a2ui/surface-manifest.js +0 -294
  208. package/a2ui/surface.js +0 -222
  209. package/a2ui/wire-factory.js +0 -134
  210. package/a2ui/wiring-engine.js +0 -209
  211. 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 '@core/element.js';
24
- import { anchorPopover } from '@core/anchor.js';
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 '@core/element.js';
14
- import { anchorPopover } from '@core/anchor.js';
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
@@ -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 '@core/element.js';
22
+ import { AdiaElement } from '../../core/element.js';
23
23
 
24
24
  class AdiaTree extends AdiaElement {
25
25
  static template = () => null;
@@ -4,7 +4,7 @@
4
4
  * Form-associated via AdiaFormElement + ElementInternals.
5
5
  */
6
6
 
7
- import { AdiaFormElement } from '@core/form.js';
7
+ import { AdiaFormElement } from '../../core/form.js';
8
8
 
9
9
  class AdiaUpload extends AdiaFormElement {
10
10
  static properties = {
package/core/markdown.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * No dependencies. ~80 lines.
5
5
  *
6
6
  * Usage:
7
- * import { renderMarkdown } from '@core/markdown.js';
7
+ * import { renderMarkdown } from './markdown.js';
8
8
  * element.innerHTML = renderMarkdown(text);
9
9
  */
10
10
 
package/core/provider.js CHANGED
@@ -22,8 +22,8 @@
22
22
  * ctrl.commands.navigate('/about');
23
23
  */
24
24
 
25
- import { AdiaElement } from '@core/element.js';
26
- import { BaseController } from '@core/controller.js';
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.1",
4
- "description": "AdiaUI web components — vanilla custom elements + A2UI runtime. Training corpus lives in @adia-ai/gen-ui-training.",
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 '@core/element.js';
17
- import { A2UIRenderer } from './renderer.js';
18
- import { registry } from './registry.js';
19
- import { sseStream, wsStream, jsonlStream, mcpStream } from './stream.js';
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 '@core/element.js';
2
- import { renderMarkdown } from '@core/markdown.js';
3
- import { streamChat } from '@llm/index.js';
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, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
@@ -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-n-blink var(--chat-cursor-speed) step-end infinite;
13
+ animation: adia-chat-blink var(--chat-cursor-speed) step-end infinite;
14
14
  }
15
15
 
16
- @keyframes adia-chat-n-blink {
16
+ @keyframes adia-chat-blink {
17
17
  50% { opacity: 0; }
18
18
  }
19
19
 
@@ -1,4 +1,4 @@
1
- import { AdiaElement } from '@core/element.js';
1
+ import { AdiaElement } from '../../core/element.js';
2
2
 
3
3
  /**
4
4
  * <adia-editor-ui> — Editor layout pattern.
@@ -15,7 +15,7 @@
15
15
  * Event: nav-select (detail: { item, text, value })
16
16
  */
17
17
 
18
- import { AdiaElement } from '@core/element.js';
18
+ import { AdiaElement } from '../../core/element.js';
19
19
 
20
20
  class AdiaAppNav extends AdiaElement {
21
21
  static properties = {
@@ -6,8 +6,8 @@
6
6
  * popover with its children instead of toggling inline expansion.
7
7
  */
8
8
 
9
- import { AdiaElement } from '@core/element.js';
10
- import { anchorPopover } from '@core/anchor.js';
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 = {
@@ -6,7 +6,7 @@
6
6
  * a side-effect of calling nav.select(item) or user click.
7
7
  */
8
8
 
9
- import { AdiaElement } from '@core/element.js';
9
+ import { AdiaElement } from '../../core/element.js';
10
10
 
11
11
  class AdiaAppNavItem extends AdiaElement {
12
12
  static properties = {
@@ -19,7 +19,7 @@
19
19
  * sticky headers, scroll containment, mode composition.
20
20
  */
21
21
 
22
- import { AdiaElement } from '@core/element.js';
22
+ import { AdiaElement } from '../../core/element.js';
23
23
 
24
24
  const SNAP_THRESHOLD = 96;
25
25
  const SNAP_MIN_USABLE = 160;
@@ -37,7 +37,7 @@
37
37
  grid-template-columns: minmax(320px, 1fr) 1.5fr;
38
38
  }
39
39
 
40
- :scope[mode="split"] > thread-n {
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"] > thread-n {
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 > thread-n,
77
+ :scope > chat-ui,
78
78
  :scope > canvas-ui,
79
79
  :scope > inspector-ui {
80
80
  min-height: 0;
@@ -1,4 +1,4 @@
1
- import { AdiaElement } from '@core/element.js';
1
+ import { AdiaElement } from '../../core/element.js';
2
2
  import '../../components/chat/chat.js';
3
3
  import '../../components/canvas/canvas.js';
4
4
  import '../../components/inspector/inspector.js';
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';
@@ -7,7 +7,7 @@
7
7
  * Event: nav-select (bubbles from items). detail: { item, text, value }
8
8
  */
9
9
 
10
- import { AdiaElement } from '@core/element.js';
10
+ import { AdiaElement } from '../../core/element.js';
11
11
 
12
12
  class AdiaSectionNav extends AdiaElement {
13
13
  static properties = {
@@ -4,7 +4,7 @@
4
4
  * that emits `group-toggle` (detail: { text, open }).
5
5
  */
6
6
 
7
- import { AdiaElement } from '@core/element.js';
7
+ import { AdiaElement } from '../../core/element.js';
8
8
 
9
9
  class AdiaSectionNavGroup extends AdiaElement {
10
10
  static properties = {
@@ -5,7 +5,7 @@
5
5
  * Event: nav-select. detail: { item, text, value }
6
6
  */
7
7
 
8
- import { AdiaElement } from '@core/element.js';
8
+ import { AdiaElement } from '../../core/element.js';
9
9
 
10
10
  class AdiaSectionNavItem extends AdiaElement {
11
11
  static properties = {
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 '@traits/define.js';
7
+ * import { defineTrait } from './define.js';
8
8
  *
9
9
  * export const pressable = defineTrait({
10
10
  * name: 'pressable',