@adia-ai/web-components 0.0.1
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/README.md +195 -0
- package/a2ui/dockables/action.js +152 -0
- package/a2ui/dockables/base.js +30 -0
- package/a2ui/dockables/controller.js +97 -0
- package/a2ui/dockables/data-source.js +103 -0
- package/a2ui/dockables/index.js +6 -0
- package/a2ui/dockables/lifecycle.js +84 -0
- package/a2ui/dockables/provider.js +59 -0
- package/a2ui/index.js +19 -0
- package/a2ui/manifest-runtime.js +226 -0
- package/a2ui/registry.js +200 -0
- package/a2ui/renderer.js +361 -0
- package/a2ui/root.js +152 -0
- package/a2ui/stream.js +243 -0
- package/a2ui/surface-manifest.js +294 -0
- package/a2ui/surface.js +222 -0
- package/a2ui/wire-factory.js +134 -0
- package/a2ui/wiring-engine.js +209 -0
- package/a2ui/wiring-registry.js +342 -0
- package/components/accordion/accordion.a2ui.json +129 -0
- package/components/accordion/accordion.css +133 -0
- package/components/accordion/accordion.js +125 -0
- package/components/accordion/accordion.yaml +527 -0
- package/components/action-list/action-list.a2ui.json +64 -0
- package/components/action-list/action-list.css +115 -0
- package/components/action-list/action-list.js +149 -0
- package/components/action-list/action-list.yaml +56 -0
- package/components/agent-artifact/agent-artifact.a2ui.json +99 -0
- package/components/agent-artifact/agent-artifact.css +94 -0
- package/components/agent-artifact/agent-artifact.js +169 -0
- package/components/agent-artifact/agent-artifact.yaml +71 -0
- package/components/agent-feedback-bar/agent-feedback-bar.a2ui.json +91 -0
- package/components/agent-feedback-bar/agent-feedback-bar.css +33 -0
- package/components/agent-feedback-bar/agent-feedback-bar.js +152 -0
- package/components/agent-feedback-bar/agent-feedback-bar.yaml +65 -0
- package/components/agent-questions/agent-questions.a2ui.json +89 -0
- package/components/agent-questions/agent-questions.css +146 -0
- package/components/agent-questions/agent-questions.js +189 -0
- package/components/agent-questions/agent-questions.yaml +63 -0
- package/components/agent-reasoning/agent-reasoning.a2ui.json +100 -0
- package/components/agent-reasoning/agent-reasoning.css +273 -0
- package/components/agent-reasoning/agent-reasoning.js +469 -0
- package/components/agent-reasoning/agent-reasoning.yaml +70 -0
- package/components/agent-suggestions/agent-suggestions.a2ui.json +87 -0
- package/components/agent-suggestions/agent-suggestions.css +18 -0
- package/components/agent-suggestions/agent-suggestions.js +87 -0
- package/components/agent-suggestions/agent-suggestions.yaml +59 -0
- package/components/agent-trace/agent-trace.a2ui.json +78 -0
- package/components/agent-trace/agent-trace.css +275 -0
- package/components/agent-trace/agent-trace.js +216 -0
- package/components/agent-trace/agent-trace.yaml +53 -0
- package/components/alert/alert.a2ui.json +211 -0
- package/components/alert/alert.css +88 -0
- package/components/alert/alert.js +96 -0
- package/components/alert/alert.yaml +205 -0
- package/components/avatar/avatar.a2ui.json +215 -0
- package/components/avatar/avatar.css +159 -0
- package/components/avatar/avatar.js +157 -0
- package/components/avatar/avatar.yaml +559 -0
- package/components/badge/badge.a2ui.json +169 -0
- package/components/badge/badge.css +78 -0
- package/components/badge/badge.js +53 -0
- package/components/badge/badge.yaml +612 -0
- package/components/block/block.a2ui.json +135 -0
- package/components/block/block.css +29 -0
- package/components/block/block.js +23 -0
- package/components/block/block.yaml +115 -0
- package/components/breadcrumb/breadcrumb.a2ui.json +86 -0
- package/components/breadcrumb/breadcrumb.css +78 -0
- package/components/breadcrumb/breadcrumb.js +44 -0
- package/components/breadcrumb/breadcrumb.yaml +84 -0
- package/components/button/button.a2ui.json +172 -0
- package/components/button/button.css +168 -0
- package/components/button/button.js +60 -0
- package/components/button/button.yaml +120 -0
- package/components/calendar-picker/calendar-picker.a2ui.json +139 -0
- package/components/calendar-picker/calendar-picker.css +321 -0
- package/components/calendar-picker/calendar-picker.js +324 -0
- package/components/calendar-picker/calendar-picker.yaml +243 -0
- package/components/canvas/canvas.a2ui.json +75 -0
- package/components/canvas/canvas.css +52 -0
- package/components/canvas/canvas.js +179 -0
- package/components/canvas/canvas.yaml +62 -0
- package/components/card/card.a2ui.json +276 -0
- package/components/card/card.css +362 -0
- package/components/card/card.js +58 -0
- package/components/card/card.yaml +527 -0
- package/components/chart/chart.a2ui.json +298 -0
- package/components/chart/chart.css +512 -0
- package/components/chart/chart.js +1075 -0
- package/components/chart/chart.yaml +540 -0
- package/components/chat/chat-input.css +141 -0
- package/components/chat/chat-input.js +242 -0
- package/components/chat/chat.a2ui.json +181 -0
- package/components/chat/chat.css +193 -0
- package/components/chat/chat.js +155 -0
- package/components/chat/chat.yaml +230 -0
- package/components/check/check.a2ui.json +134 -0
- package/components/check/check.css +126 -0
- package/components/check/check.js +58 -0
- package/components/check/check.yaml +109 -0
- package/components/code/code.a2ui.json +153 -0
- package/components/code/code.css +133 -0
- package/components/code/code.js +114 -0
- package/components/code/code.yaml +163 -0
- package/components/col/col.a2ui.json +104 -0
- package/components/col/col.css +36 -0
- package/components/col/col.js +19 -0
- package/components/col/col.yaml +364 -0
- package/components/color-picker/color-picker.a2ui.json +100 -0
- package/components/color-picker/color-picker.css +182 -0
- package/components/color-picker/color-picker.js +537 -0
- package/components/color-picker/color-picker.yaml +105 -0
- package/components/command/command.a2ui.json +221 -0
- package/components/command/command.css +251 -0
- package/components/command/command.js +284 -0
- package/components/command/command.yaml +186 -0
- package/components/description-list/description-list.a2ui.json +89 -0
- package/components/description-list/description-list.css +70 -0
- package/components/description-list/description-list.js +75 -0
- package/components/description-list/description-list.yaml +59 -0
- package/components/divider/divider.a2ui.json +126 -0
- package/components/divider/divider.css +102 -0
- package/components/divider/divider.js +47 -0
- package/components/divider/divider.yaml +366 -0
- package/components/drawer/drawer.a2ui.json +199 -0
- package/components/drawer/drawer.css +342 -0
- package/components/drawer/drawer.js +263 -0
- package/components/drawer/drawer.yaml +366 -0
- package/components/embed/embed.a2ui.json +150 -0
- package/components/embed/embed.css +28 -0
- package/components/embed/embed.js +63 -0
- package/components/embed/embed.yaml +224 -0
- package/components/empty-state/empty-state.a2ui.json +133 -0
- package/components/empty-state/empty-state.css +58 -0
- package/components/empty-state/empty-state.js +87 -0
- package/components/empty-state/empty-state.yaml +314 -0
- package/components/footer/footer.a2ui.json +79 -0
- package/components/footer/footer.yaml +239 -0
- package/components/grid/grid.a2ui.json +171 -0
- package/components/grid/grid.css +37 -0
- package/components/grid/grid.js +21 -0
- package/components/grid/grid.yaml +577 -0
- package/components/header/header.a2ui.json +76 -0
- package/components/header/header.yaml +336 -0
- package/components/heatmap/heatmap.a2ui.json +150 -0
- package/components/heatmap/heatmap.css +146 -0
- package/components/heatmap/heatmap.js +246 -0
- package/components/heatmap/heatmap.yaml +131 -0
- package/components/icon/icon.a2ui.json +79 -0
- package/components/icon/icon.css +20 -0
- package/components/icon/icon.js +26 -0
- package/components/icon/icon.yaml +233 -0
- package/components/image/image.a2ui.json +261 -0
- package/components/image/image.css +76 -0
- package/components/image/image.js +102 -0
- package/components/image/image.yaml +477 -0
- package/components/index.js +85 -0
- package/components/input/input.a2ui.json +284 -0
- package/components/input/input.css +162 -0
- package/components/input/input.js +148 -0
- package/components/input/input.yaml +496 -0
- package/components/inspector/inspector.a2ui.json +67 -0
- package/components/inspector/inspector.css +31 -0
- package/components/inspector/inspector.js +133 -0
- package/components/inspector/inspector.yaml +58 -0
- package/components/kbd/kbd.a2ui.json +96 -0
- package/components/kbd/kbd.css +62 -0
- package/components/kbd/kbd.js +24 -0
- package/components/kbd/kbd.yaml +213 -0
- package/components/list/list.a2ui.json +145 -0
- package/components/list/list.css +103 -0
- package/components/list/list.js +236 -0
- package/components/list/list.yaml +122 -0
- package/components/menu/menu.a2ui.json +146 -0
- package/components/menu/menu.css +146 -0
- package/components/menu/menu.js +296 -0
- package/components/menu/menu.yaml +123 -0
- package/components/modal/modal.a2ui.json +136 -0
- package/components/modal/modal.css +153 -0
- package/components/modal/modal.js +181 -0
- package/components/modal/modal.yaml +114 -0
- package/components/noodles/noodles.a2ui.json +145 -0
- package/components/noodles/noodles.css +118 -0
- package/components/noodles/noodles.js +470 -0
- package/components/noodles/noodles.yaml +123 -0
- package/components/otp-input/otp-input.a2ui.json +104 -0
- package/components/otp-input/otp-input.css +78 -0
- package/components/otp-input/otp-input.js +170 -0
- package/components/otp-input/otp-input.yaml +218 -0
- package/components/pagination/pagination.a2ui.json +122 -0
- package/components/pagination/pagination.css +162 -0
- package/components/pagination/pagination.js +185 -0
- package/components/pagination/pagination.yaml +165 -0
- package/components/pane/pane.a2ui.json +94 -0
- package/components/pane/pane.css +166 -0
- package/components/pane/pane.js +140 -0
- package/components/pane/pane.yaml +197 -0
- package/components/pipeline-status/pipeline-status.a2ui.json +90 -0
- package/components/pipeline-status/pipeline-status.css +162 -0
- package/components/pipeline-status/pipeline-status.js +176 -0
- package/components/pipeline-status/pipeline-status.yaml +99 -0
- package/components/popover/popover.a2ui.json +181 -0
- package/components/popover/popover.css +57 -0
- package/components/popover/popover.js +170 -0
- package/components/popover/popover.yaml +257 -0
- package/components/progress/progress.a2ui.json +199 -0
- package/components/progress/progress.css +88 -0
- package/components/progress/progress.js +64 -0
- package/components/progress/progress.yaml +342 -0
- package/components/progress-row/progress-row.a2ui.json +100 -0
- package/components/progress-row/progress-row.css +57 -0
- package/components/progress-row/progress-row.js +92 -0
- package/components/progress-row/progress-row.yaml +87 -0
- package/components/radio/radio.a2ui.json +232 -0
- package/components/radio/radio.css +102 -0
- package/components/radio/radio.js +73 -0
- package/components/radio/radio.yaml +248 -0
- package/components/range/range.a2ui.json +151 -0
- package/components/range/range.css +148 -0
- package/components/range/range.js +177 -0
- package/components/range/range.yaml +188 -0
- package/components/rating/rating.a2ui.json +105 -0
- package/components/rating/rating.css +92 -0
- package/components/rating/rating.js +138 -0
- package/components/rating/rating.yaml +74 -0
- package/components/richtext/richtext.a2ui.json +82 -0
- package/components/richtext/richtext.css +225 -0
- package/components/richtext/richtext.js +74 -0
- package/components/richtext/richtext.yaml +89 -0
- package/components/row/row.a2ui.json +102 -0
- package/components/row/row.css +51 -0
- package/components/row/row.js +39 -0
- package/components/row/row.yaml +358 -0
- package/components/search/search.a2ui.json +186 -0
- package/components/search/search.css +28 -0
- package/components/search/search.js +124 -0
- package/components/search/search.yaml +154 -0
- package/components/section/section.a2ui.json +78 -0
- package/components/section/section.yaml +338 -0
- package/components/segment/segment.a2ui.json +100 -0
- package/components/segment/segment.css +81 -0
- package/components/segment/segment.js +32 -0
- package/components/segment/segment.yaml +216 -0
- package/components/segmented/segmented.a2ui.json +106 -0
- package/components/segmented/segmented.css +67 -0
- package/components/segmented/segmented.js +149 -0
- package/components/segmented/segmented.yaml +91 -0
- package/components/select/select.a2ui.json +203 -0
- package/components/select/select.css +277 -0
- package/components/select/select.js +388 -0
- package/components/select/select.yaml +375 -0
- package/components/skeleton/skeleton.a2ui.json +120 -0
- package/components/skeleton/skeleton.css +47 -0
- package/components/skeleton/skeleton.js +43 -0
- package/components/skeleton/skeleton.yaml +153 -0
- package/components/slider/slider.a2ui.json +162 -0
- package/components/slider/slider.css +137 -0
- package/components/slider/slider.js +162 -0
- package/components/slider/slider.yaml +299 -0
- package/components/stack/stack.a2ui.json +62 -0
- package/components/stack/stack.css +28 -0
- package/components/stack/stack.js +18 -0
- package/components/stack/stack.yaml +54 -0
- package/components/stat/stat.a2ui.json +246 -0
- package/components/stat/stat.css +101 -0
- package/components/stat/stat.js +91 -0
- package/components/stat/stat.yaml +206 -0
- package/components/stepper/stepper.a2ui.json +77 -0
- package/components/stepper/stepper.css +243 -0
- package/components/stepper/stepper.js +118 -0
- package/components/stepper/stepper.yaml +73 -0
- package/components/stream/stream.a2ui.json +98 -0
- package/components/stream/stream.css +37 -0
- package/components/stream/stream.js +99 -0
- package/components/stream/stream.yaml +87 -0
- package/components/swiper/swiper.a2ui.json +140 -0
- package/components/swiper/swiper.css +267 -0
- package/components/swiper/swiper.js +285 -0
- package/components/swiper/swiper.yaml +268 -0
- package/components/switch/switch.a2ui.json +134 -0
- package/components/switch/switch.css +104 -0
- package/components/switch/switch.js +53 -0
- package/components/switch/switch.yaml +322 -0
- package/components/table/cell-types.js +296 -0
- package/components/table/table.a2ui.json +458 -0
- package/components/table/table.css +531 -0
- package/components/table/table.js +1392 -0
- package/components/table/table.yaml +528 -0
- package/components/tabs/tab.js +34 -0
- package/components/tabs/tabs.a2ui.json +174 -0
- package/components/tabs/tabs.css +162 -0
- package/components/tabs/tabs.js +226 -0
- package/components/tabs/tabs.yaml +255 -0
- package/components/tag/tag.a2ui.json +148 -0
- package/components/tag/tag.css +118 -0
- package/components/tag/tag.js +88 -0
- package/components/tag/tag.yaml +125 -0
- package/components/text/text.a2ui.json +99 -0
- package/components/text/text.css +65 -0
- package/components/text/text.js +35 -0
- package/components/text/text.yaml +360 -0
- package/components/textarea/textarea.a2ui.json +91 -0
- package/components/textarea/textarea.css +93 -0
- package/components/textarea/textarea.js +114 -0
- package/components/textarea/textarea.yaml +79 -0
- package/components/timeline/timeline.a2ui.json +82 -0
- package/components/timeline/timeline.css +389 -0
- package/components/timeline/timeline.js +171 -0
- package/components/timeline/timeline.yaml +185 -0
- package/components/toast/toast.a2ui.json +199 -0
- package/components/toast/toast.css +211 -0
- package/components/toast/toast.js +146 -0
- package/components/toast/toast.yaml +184 -0
- package/components/toggle-group/toggle-group.a2ui.json +126 -0
- package/components/toggle-group/toggle-group.css +102 -0
- package/components/toggle-group/toggle-group.js +147 -0
- package/components/toggle-group/toggle-group.yaml +98 -0
- package/components/toolbar/toolbar.a2ui.json +131 -0
- package/components/toolbar/toolbar.css +132 -0
- package/components/toolbar/toolbar.js +366 -0
- package/components/toolbar/toolbar.yaml +238 -0
- package/components/tooltip/tooltip.a2ui.json +148 -0
- package/components/tooltip/tooltip.css +39 -0
- package/components/tooltip/tooltip.js +96 -0
- package/components/tooltip/tooltip.yaml +201 -0
- package/components/tree/tree.a2ui.json +119 -0
- package/components/tree/tree.css +133 -0
- package/components/tree/tree.js +253 -0
- package/components/tree/tree.yaml +92 -0
- package/components/upload/upload.a2ui.json +185 -0
- package/components/upload/upload.css +115 -0
- package/components/upload/upload.js +189 -0
- package/components/upload/upload.yaml +302 -0
- package/core/anchor.js +187 -0
- package/core/controller.js +182 -0
- package/core/element.js +257 -0
- package/core/form.js +217 -0
- package/core/icons.js +180 -0
- package/core/markdown.js +95 -0
- package/core/polyfills.js +23 -0
- package/core/provider.js +262 -0
- package/core/signals.js +113 -0
- package/core/template.js +226 -0
- package/core/transport.js +77 -0
- package/package.json +38 -0
- package/patterns/adia-chat/adia-chat.a2ui.json +149 -0
- package/patterns/adia-chat/adia-chat.css +10 -0
- package/patterns/adia-chat/adia-chat.js +297 -0
- package/patterns/adia-chat/adia-chat.yaml +118 -0
- package/patterns/adia-chat/css/adia-chat.empty.css +12 -0
- package/patterns/adia-chat/css/adia-chat.layout.css +60 -0
- package/patterns/adia-chat/css/adia-chat.markdown.css +74 -0
- package/patterns/adia-chat/css/adia-chat.messages.css +87 -0
- package/patterns/adia-chat/css/adia-chat.streaming.css +30 -0
- package/patterns/adia-chat/css/adia-chat.tokens.css +95 -0
- package/patterns/adia-chat/index.html +93 -0
- package/patterns/adia-editor/adia-editor.a2ui.json +58 -0
- package/patterns/adia-editor/adia-editor.css +6 -0
- package/patterns/adia-editor/adia-editor.js +56 -0
- package/patterns/adia-editor/adia-editor.yaml +36 -0
- package/patterns/adia-editor/css/adia-editor.layout.css +86 -0
- package/patterns/adia-editor/css/adia-editor.tokens.css +28 -0
- package/patterns/adia-editor/index.html +179 -0
- package/patterns/app-nav/app-nav.a2ui.json +89 -0
- package/patterns/app-nav/app-nav.css +92 -0
- package/patterns/app-nav/app-nav.js +99 -0
- package/patterns/app-nav/app-nav.yaml +54 -0
- package/patterns/app-nav-group/app-nav-group.a2ui.json +82 -0
- package/patterns/app-nav-group/app-nav-group.css +261 -0
- package/patterns/app-nav-group/app-nav-group.js +116 -0
- package/patterns/app-nav-group/app-nav-group.yaml +59 -0
- package/patterns/app-nav-item/app-nav-item.a2ui.json +83 -0
- package/patterns/app-nav-item/app-nav-item.css +156 -0
- package/patterns/app-nav-item/app-nav-item.js +42 -0
- package/patterns/app-nav-item/app-nav-item.yaml +62 -0
- package/patterns/app-shell/app-shell.a2ui.json +114 -0
- package/patterns/app-shell/app-shell.css +14 -0
- package/patterns/app-shell/app-shell.js +251 -0
- package/patterns/app-shell/app-shell.yaml +66 -0
- package/patterns/app-shell/css/app-shell.collapsed.css +86 -0
- package/patterns/app-shell/css/app-shell.helpers.css +42 -0
- package/patterns/app-shell/css/app-shell.main.css +58 -0
- package/patterns/app-shell/css/app-shell.shell.css +44 -0
- package/patterns/app-shell/css/app-shell.sidebar.css +116 -0
- package/patterns/app-shell/css/app-shell.templates.css +214 -0
- package/patterns/app-shell/css/app-shell.tokens.css +116 -0
- package/patterns/app-shell/index.html +112 -0
- package/patterns/gen-ui/gen-ui.a2ui.json +72 -0
- package/patterns/gen-ui/gen-ui.css +83 -0
- package/patterns/gen-ui/gen-ui.js +136 -0
- package/patterns/gen-ui/gen-ui.yaml +43 -0
- package/patterns/index.js +10 -0
- package/patterns/section-nav/section-nav.a2ui.json +91 -0
- package/patterns/section-nav/section-nav.css +59 -0
- package/patterns/section-nav/section-nav.js +42 -0
- package/patterns/section-nav/section-nav.yaml +58 -0
- package/patterns/section-nav-group/section-nav-group.a2ui.json +95 -0
- package/patterns/section-nav-group/section-nav-group.css +74 -0
- package/patterns/section-nav-group/section-nav-group.js +84 -0
- package/patterns/section-nav-group/section-nav-group.yaml +66 -0
- package/patterns/section-nav-item/section-nav-item.a2ui.json +97 -0
- package/patterns/section-nav-item/section-nav-item.css +96 -0
- package/patterns/section-nav-item/section-nav-item.js +66 -0
- package/patterns/section-nav-item/section-nav-item.yaml +70 -0
- package/styles/colors/index.css +6 -0
- package/styles/colors/parameters.css +52 -0
- package/styles/colors/primitives-accent.css +89 -0
- package/styles/colors/primitives-brand.css +89 -0
- package/styles/colors/primitives-danger.css +89 -0
- package/styles/colors/primitives-info.css +89 -0
- package/styles/colors/primitives-neutral.css +91 -0
- package/styles/colors/primitives-shared.css +57 -0
- package/styles/colors/primitives-success.css +89 -0
- package/styles/colors/primitives-warning.css +89 -0
- package/styles/colors/primitives.css +17 -0
- package/styles/colors/scrims.css +182 -0
- package/styles/colors/semantics.css +595 -0
- package/styles/colors/surfaces.css +43 -0
- package/styles/fonts.css +99 -0
- package/styles/layouts/admin.css +7 -0
- package/styles/prose.css +186 -0
- package/styles/styles.css +193 -0
- package/styles/themes.css +155 -0
- package/styles/tokens.css +304 -0
- package/styles/typography.css +853 -0
- package/traits/active-state.js +24 -0
- package/traits/anchor-positioning.js +66 -0
- package/traits/attention-pulse.js +30 -0
- package/traits/confetti-burst.js +65 -0
- package/traits/confetti.js +57 -0
- package/traits/count-up.js +42 -0
- package/traits/define.js +76 -0
- package/traits/dirty-state.js +38 -0
- package/traits/drag-ghost.js +38 -0
- package/traits/draggable.js +73 -0
- package/traits/fade-presence.js +52 -0
- package/traits/focus-trap.js +63 -0
- package/traits/focusable.js +38 -0
- package/traits/glow-focus.js +33 -0
- package/traits/gradient-shift.js +32 -0
- package/traits/haptic-feedback.js +28 -0
- package/traits/hotkey.js +62 -0
- package/traits/hoverable.js +26 -0
- package/traits/index.js +55 -0
- package/traits/inertia-drag.js +133 -0
- package/traits/intersection-observer.js +33 -0
- package/traits/keyboard-nav.js +36 -0
- package/traits/magnetic-hover.js +37 -0
- package/traits/noise-texture.js +30 -0
- package/traits/parallax.js +42 -0
- package/traits/portal.js +27 -0
- package/traits/pressable.js +75 -0
- package/traits/resizable.js +100 -0
- package/traits/resize-observer.js +31 -0
- package/traits/ripple.js +53 -0
- package/traits/roving-tabindex.js +67 -0
- package/traits/scale-press.js +43 -0
- package/traits/scroll-lock.js +27 -0
- package/traits/shimmer-loading.js +44 -0
- package/traits/snap-to-grid.js +28 -0
- package/traits/sound-feedback.js +30 -0
- package/traits/spring-animate.js +56 -0
- package/traits/tilt-hover.js +37 -0
- package/traits/tossable.js +178 -0
- package/traits/typeahead.js +63 -0
- package/traits/typewriter.js +35 -0
- package/traits/validation.js +118 -0
package/a2ui/renderer.js
ADDED
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A2UI Renderer — processes A2UI messages and renders AdiaUI components.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* import { A2UIRenderer } from './renderer.js';
|
|
6
|
+
* const renderer = new A2UIRenderer(container);
|
|
7
|
+
* renderer.process(message);
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { resolveTag, registry } from './registry.js';
|
|
11
|
+
|
|
12
|
+
export class A2UIRenderer {
|
|
13
|
+
#container;
|
|
14
|
+
#registry;
|
|
15
|
+
#surfaces = new Map();
|
|
16
|
+
#elements = new Map();
|
|
17
|
+
#prevProps = new Map();
|
|
18
|
+
#queue = [];
|
|
19
|
+
#rafId = null;
|
|
20
|
+
#batching = false;
|
|
21
|
+
|
|
22
|
+
constructor(container, reg = registry, { batch = false } = {}) {
|
|
23
|
+
this.#container = container;
|
|
24
|
+
this.#registry = reg;
|
|
25
|
+
this.#batching = batch;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
process(message) {
|
|
29
|
+
if (!message) return;
|
|
30
|
+
if (this.#batching) {
|
|
31
|
+
this.#queue.push(message);
|
|
32
|
+
if (this.#rafId === null) {
|
|
33
|
+
this.#rafId = requestAnimationFrame(() => this.#flush());
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
this.#processOne(message);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#flush() {
|
|
41
|
+
this.#rafId = null;
|
|
42
|
+
const batch = this.#queue.splice(0);
|
|
43
|
+
for (const msg of batch) this.#processOne(msg);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
#processOne(message) {
|
|
47
|
+
switch (message.type || message.messageType) {
|
|
48
|
+
case 'createSurface': this.#createSurface(message); break;
|
|
49
|
+
case 'updateComponents': this.#updateComponents(message); break;
|
|
50
|
+
case 'updateDataModel': this.#updateDataModel(message); break;
|
|
51
|
+
case 'wireComponents': this.#wireComponents(message); break;
|
|
52
|
+
case 'deleteSurface': this.#deleteSurface(message); break;
|
|
53
|
+
case 'meta': break; // LLM self-critique — not renderable
|
|
54
|
+
default: console.warn('A2UI: unknown message type', message.type);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// ── wireComponents (lazy-loaded) ──
|
|
59
|
+
|
|
60
|
+
#wiringEngine = null;
|
|
61
|
+
|
|
62
|
+
async #wireComponents(message) {
|
|
63
|
+
if (!this.#wiringEngine) {
|
|
64
|
+
const { WiringEngine } = await import('./wiring-engine.js');
|
|
65
|
+
this.#wiringEngine = new WiringEngine({
|
|
66
|
+
updateDataModel: (surfaceId, path, data) => {
|
|
67
|
+
this.#updateDataModel({ surfaceId, path, value: data });
|
|
68
|
+
},
|
|
69
|
+
getElement: (surfaceId, componentId) => {
|
|
70
|
+
const surface = this.#surfaces.get(surfaceId);
|
|
71
|
+
return surface?.elements.get(componentId) || null;
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
await this.#wiringEngine.process(message);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async processStream(stream) {
|
|
79
|
+
for await (const message of stream) this.process(message);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// ── createSurface ──
|
|
83
|
+
|
|
84
|
+
#createSurface({ surfaceId, catalogId }) {
|
|
85
|
+
if (this.#surfaces.has(surfaceId)) return;
|
|
86
|
+
|
|
87
|
+
const root = document.createElement('div');
|
|
88
|
+
root.setAttribute('data-a2ui-surface', surfaceId);
|
|
89
|
+
if (catalogId) root.setAttribute('data-catalog', catalogId);
|
|
90
|
+
this.#container.appendChild(root);
|
|
91
|
+
|
|
92
|
+
this.#surfaces.set(surfaceId, {
|
|
93
|
+
root,
|
|
94
|
+
elements: new Map(),
|
|
95
|
+
dataModel: {},
|
|
96
|
+
bindings: new Map(),
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// ── updateComponents ──
|
|
101
|
+
|
|
102
|
+
#updateComponents({ surfaceId, components }) {
|
|
103
|
+
let surface = this.#surfaces.get(surfaceId);
|
|
104
|
+
|
|
105
|
+
if (!surface) {
|
|
106
|
+
surface = {
|
|
107
|
+
root: this.#container,
|
|
108
|
+
elements: new Map(),
|
|
109
|
+
dataModel: {},
|
|
110
|
+
bindings: new Map(),
|
|
111
|
+
};
|
|
112
|
+
this.#surfaces.set(surfaceId, surface);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// First pass: create/update elements
|
|
116
|
+
for (const comp of components) {
|
|
117
|
+
if (!comp.id && comp.id !== 0) continue;
|
|
118
|
+
if (comp.component === 'ContextBindings') {
|
|
119
|
+
surface.contextBindings = comp;
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
try {
|
|
124
|
+
let el = surface.elements.get(comp.id);
|
|
125
|
+
const tagName = comp.component === 'Text'
|
|
126
|
+
? this.#resolveTextTag(comp.variant, comp)
|
|
127
|
+
: resolveTag(comp.component, this.#registry);
|
|
128
|
+
|
|
129
|
+
if (!tagName) {
|
|
130
|
+
if (!el) {
|
|
131
|
+
el = document.createElement('div');
|
|
132
|
+
el.setAttribute('data-a2ui-id', comp.id);
|
|
133
|
+
el.setAttribute('data-a2ui-unknown', comp.component);
|
|
134
|
+
el.textContent = `[unknown: ${comp.component}]`;
|
|
135
|
+
surface.elements.set(comp.id, el);
|
|
136
|
+
this.#elements.set(comp.id, el);
|
|
137
|
+
}
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (!el) {
|
|
142
|
+
el = document.createElement(tagName);
|
|
143
|
+
el.setAttribute('data-a2ui-id', comp.id);
|
|
144
|
+
surface.elements.set(comp.id, el);
|
|
145
|
+
this.#elements.set(comp.id, el);
|
|
146
|
+
} else if (el.localName !== tagName) {
|
|
147
|
+
const newEl = document.createElement(tagName);
|
|
148
|
+
newEl.setAttribute('data-a2ui-id', comp.id);
|
|
149
|
+
el.replaceWith(newEl);
|
|
150
|
+
el = newEl;
|
|
151
|
+
surface.elements.set(comp.id, el);
|
|
152
|
+
this.#elements.set(comp.id, el);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
comp._surfaceId = surfaceId;
|
|
156
|
+
|
|
157
|
+
const hasBindings = Object.values(comp).some(v => v && typeof v === 'object' && v.path);
|
|
158
|
+
if (hasBindings) surface.bindings.set(comp.id, comp);
|
|
159
|
+
|
|
160
|
+
this.#applyProps(el, comp);
|
|
161
|
+
} catch (err) {
|
|
162
|
+
console.warn(`A2UI: component "${comp.id}" (${comp.component}) failed:`, err.message);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Build parent map for cycle detection
|
|
167
|
+
const parentMap = new Map();
|
|
168
|
+
for (const comp of components) {
|
|
169
|
+
for (const childId of (Array.isArray(comp.children) ? comp.children : [])) {
|
|
170
|
+
parentMap.set(childId, comp.id);
|
|
171
|
+
}
|
|
172
|
+
if (comp.child) parentMap.set(comp.child, comp.id);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const wouldCycle = (parentId, childId) => {
|
|
176
|
+
const visited = new Set();
|
|
177
|
+
let cursor = parentId;
|
|
178
|
+
while (cursor != null) {
|
|
179
|
+
if (cursor === childId) return true;
|
|
180
|
+
if (visited.has(cursor)) return true;
|
|
181
|
+
visited.add(cursor);
|
|
182
|
+
cursor = parentMap.get(cursor);
|
|
183
|
+
}
|
|
184
|
+
return false;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// Second pass: build tree
|
|
188
|
+
for (const comp of components) {
|
|
189
|
+
const el = surface.elements.get(comp.id);
|
|
190
|
+
if (!el) continue;
|
|
191
|
+
|
|
192
|
+
try {
|
|
193
|
+
const childIds = Array.isArray(comp.children) ? comp.children : [];
|
|
194
|
+
for (const childId of childIds) {
|
|
195
|
+
if (childId === comp.id || wouldCycle(comp.id, childId)) continue;
|
|
196
|
+
const childEl = surface.elements.get(childId);
|
|
197
|
+
if (childEl && childEl.parentElement !== el) el.appendChild(childEl);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if (comp.child && comp.child !== comp.id && !wouldCycle(comp.id, comp.child)) {
|
|
201
|
+
const childEl = surface.elements.get(comp.child);
|
|
202
|
+
if (childEl && childEl.parentElement !== el) el.appendChild(childEl);
|
|
203
|
+
}
|
|
204
|
+
} catch (err) {
|
|
205
|
+
console.warn(`A2UI: tree build failed for "${comp.id}":`, err.message);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// Attach root
|
|
210
|
+
const rootComp = components.find(c => c.id === 'root');
|
|
211
|
+
if (rootComp) {
|
|
212
|
+
const rootEl = surface.elements.get('root');
|
|
213
|
+
if (rootEl && rootEl.parentElement !== surface.root) {
|
|
214
|
+
surface.root.appendChild(rootEl);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// ── Apply props ──
|
|
220
|
+
|
|
221
|
+
static #JS_PROPS = new Set(['data', 'columns', 'options', 'itemRenderer', 'textContent']);
|
|
222
|
+
|
|
223
|
+
// Semantic HTML variants — these render as native tags (h1, p, small)
|
|
224
|
+
// Everything else renders as <text-ui> which is now display:inline
|
|
225
|
+
static #TEXT_TAG_MAP = {
|
|
226
|
+
h1: 'h1', h2: 'h2', h3: 'h3', h4: 'h4', h5: 'h5', h6: 'h6',
|
|
227
|
+
body: 'p', caption: 'small',
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
#resolveTextTag(variant, comp) {
|
|
231
|
+
// Semantic HTML variants get native tags (accessibility)
|
|
232
|
+
if (!comp?.slot && A2UIRenderer.#TEXT_TAG_MAP[variant]) {
|
|
233
|
+
return A2UIRenderer.#TEXT_TAG_MAP[variant];
|
|
234
|
+
}
|
|
235
|
+
// Everything else → text-ui (inline, supports truncate/lines/variant)
|
|
236
|
+
return 'text-ui';
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
#applyProps(el, comp) {
|
|
240
|
+
const skip = new Set(['id', 'component', 'children', 'child', '_surfaceId']);
|
|
241
|
+
// Skip variant attr when the tag IS the variant (h1 for h1, p for body, small for caption)
|
|
242
|
+
if (comp.component === 'Text' && comp.variant && !comp.slot && A2UIRenderer.#TEXT_TAG_MAP[comp.variant]) {
|
|
243
|
+
skip.add('variant');
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const prev = this.#prevProps.get(comp.id);
|
|
247
|
+
const next = {};
|
|
248
|
+
|
|
249
|
+
for (const [key, value] of Object.entries(comp)) {
|
|
250
|
+
if (skip.has(key)) continue;
|
|
251
|
+
|
|
252
|
+
const isBinding = value && typeof value === 'object' && value.path;
|
|
253
|
+
const resolved = this.#resolveValue(value, comp._surfaceId);
|
|
254
|
+
next[key] = resolved;
|
|
255
|
+
|
|
256
|
+
if (prev && Object.is(prev[key], resolved)) continue;
|
|
257
|
+
|
|
258
|
+
if (key === 'style' && typeof resolved === 'string') {
|
|
259
|
+
el.style.cssText = resolved;
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
if (A2UIRenderer.#JS_PROPS.has(key) && resolved != null) {
|
|
264
|
+
el[key] = resolved;
|
|
265
|
+
continue;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
if (typeof resolved === 'boolean') {
|
|
269
|
+
if (resolved) el.setAttribute(key, '');
|
|
270
|
+
else el.removeAttribute(key);
|
|
271
|
+
} else if (resolved != null) {
|
|
272
|
+
el.setAttribute(this.#toAttr(key), String(resolved));
|
|
273
|
+
} else if (isBinding) {
|
|
274
|
+
el.removeAttribute(this.#toAttr(key));
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if (prev) {
|
|
279
|
+
for (const key of Object.keys(prev)) {
|
|
280
|
+
if (!(key in next) && !skip.has(key)) el.removeAttribute(this.#toAttr(key));
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
this.#prevProps.set(comp.id, next);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
#toAttr(name) {
|
|
288
|
+
return name.replace(/([A-Z])/g, '-$1').toLowerCase();
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
#resolveValue(value, surfaceId) {
|
|
292
|
+
if (value == null) return null;
|
|
293
|
+
if (typeof value !== 'object') return value;
|
|
294
|
+
if (value.path) {
|
|
295
|
+
const surface = surfaceId ? this.#surfaces.get(surfaceId) : null;
|
|
296
|
+
return surface ? this.#getByPath(surface.dataModel, value.path) : value.path;
|
|
297
|
+
}
|
|
298
|
+
return value;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
#getByPath(obj, path) {
|
|
302
|
+
if (!path || path === '/') return obj;
|
|
303
|
+
return path.split('/').filter(Boolean).reduce((o, k) => o?.[k], obj);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// ── updateDataModel ──
|
|
307
|
+
|
|
308
|
+
#updateDataModel({ surfaceId, path, value }) {
|
|
309
|
+
const surface = this.#surfaces.get(surfaceId);
|
|
310
|
+
if (!surface) return;
|
|
311
|
+
|
|
312
|
+
if (!path || path === '/') {
|
|
313
|
+
surface.dataModel = value ?? {};
|
|
314
|
+
} else {
|
|
315
|
+
const parts = path.split('/').filter(Boolean);
|
|
316
|
+
let cur = surface.dataModel;
|
|
317
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
318
|
+
if (cur[parts[i]] == null) cur[parts[i]] = {};
|
|
319
|
+
cur = cur[parts[i]];
|
|
320
|
+
}
|
|
321
|
+
cur[parts[parts.length - 1]] = value;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
for (const [compId, comp] of surface.bindings) {
|
|
325
|
+
const el = surface.elements.get(compId);
|
|
326
|
+
if (el) this.#applyProps(el, comp);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// ── deleteSurface ──
|
|
331
|
+
|
|
332
|
+
#deleteSurface({ surfaceId }) {
|
|
333
|
+
const surface = this.#surfaces.get(surfaceId);
|
|
334
|
+
if (!surface) return;
|
|
335
|
+
this.#wiringEngine?.teardown(surfaceId);
|
|
336
|
+
for (const [id] of surface.elements) this.#elements.delete(id);
|
|
337
|
+
surface.root.remove();
|
|
338
|
+
this.#surfaces.delete(surfaceId);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// ── Public ──
|
|
342
|
+
|
|
343
|
+
getSurface(id) { return this.#surfaces.get(id); }
|
|
344
|
+
getElement(id) { return this.#elements.get(id); }
|
|
345
|
+
get surfaces() { return [...this.#surfaces.keys()]; }
|
|
346
|
+
|
|
347
|
+
reset() {
|
|
348
|
+
if (this.#rafId !== null) { cancelAnimationFrame(this.#rafId); this.#rafId = null; }
|
|
349
|
+
this.#queue.length = 0;
|
|
350
|
+
for (const [, s] of this.#surfaces) {
|
|
351
|
+
if (s.root === this.#container) s.root.innerHTML = '';
|
|
352
|
+
else s.root.remove();
|
|
353
|
+
}
|
|
354
|
+
this.#surfaces.clear();
|
|
355
|
+
this.#elements.clear();
|
|
356
|
+
this.#prevProps.clear();
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
set batching(v) { this.#batching = !!v; }
|
|
360
|
+
get batching() { return this.#batching; }
|
|
361
|
+
}
|
package/a2ui/root.js
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <a2ui-root> — A2UI protocol surface.
|
|
3
|
+
* Connects to a stream source and renders A2UI messages as AdiaUI components.
|
|
4
|
+
*
|
|
5
|
+
* <a2ui-root src="/api/agent" transport="sse"></a2ui-root>
|
|
6
|
+
* <a2ui-root src="ws://localhost:8080" transport="ws"></a2ui-root>
|
|
7
|
+
*
|
|
8
|
+
* Events:
|
|
9
|
+
* a2ui-connected — stream connected
|
|
10
|
+
* a2ui-message — each message received (detail: { message })
|
|
11
|
+
* a2ui-error — stream error (detail: { error })
|
|
12
|
+
* a2ui-closed — stream ended
|
|
13
|
+
* a2ui-action — user interaction (detail: { name, sourceComponentId, context })
|
|
14
|
+
*/
|
|
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';
|
|
20
|
+
|
|
21
|
+
class AdiaA2UIRoot extends AdiaElement {
|
|
22
|
+
static properties = {
|
|
23
|
+
src: { type: String, default: '', reflect: true },
|
|
24
|
+
transport: { type: String, default: 'sse', reflect: true },
|
|
25
|
+
loading: { type: Boolean, default: false, reflect: true },
|
|
26
|
+
active: { type: Boolean, default: false, reflect: true },
|
|
27
|
+
batch: { type: Boolean, default: false, reflect: true },
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
static template = () => null;
|
|
31
|
+
|
|
32
|
+
#renderer = null;
|
|
33
|
+
#abortCtrl = null;
|
|
34
|
+
|
|
35
|
+
connected() {
|
|
36
|
+
this.#renderer = new A2UIRenderer(this, registry, { batch: this.batch });
|
|
37
|
+
|
|
38
|
+
this.addEventListener('click', (e) => {
|
|
39
|
+
const actionEl = e.target.closest('[data-action]');
|
|
40
|
+
if (actionEl) {
|
|
41
|
+
this.dispatchEvent(new CustomEvent('a2ui-action', {
|
|
42
|
+
bubbles: true,
|
|
43
|
+
detail: {
|
|
44
|
+
name: actionEl.getAttribute('data-action'),
|
|
45
|
+
sourceComponentId: actionEl.getAttribute('data-a2ui-id') || '',
|
|
46
|
+
timestamp: Date.now(),
|
|
47
|
+
context: {},
|
|
48
|
+
},
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
render() {
|
|
55
|
+
if (this.src && !this.active) this.#connect();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async #connect() {
|
|
59
|
+
this.#abortCtrl?.abort();
|
|
60
|
+
this.#abortCtrl = new AbortController();
|
|
61
|
+
const signal = this.#abortCtrl.signal;
|
|
62
|
+
|
|
63
|
+
this.loading = true;
|
|
64
|
+
this.active = false;
|
|
65
|
+
|
|
66
|
+
let stream;
|
|
67
|
+
try {
|
|
68
|
+
switch (this.transport) {
|
|
69
|
+
case 'sse':
|
|
70
|
+
stream = sseStream(this.src, { signal, catalog: registry });
|
|
71
|
+
break;
|
|
72
|
+
case 'ws':
|
|
73
|
+
case 'websocket':
|
|
74
|
+
stream = wsStream(this.src, { signal, catalog: registry });
|
|
75
|
+
break;
|
|
76
|
+
case 'jsonl':
|
|
77
|
+
stream = jsonlStream(this.src, { signal, catalog: registry });
|
|
78
|
+
break;
|
|
79
|
+
case 'mcp':
|
|
80
|
+
stream = mcpStream(this.src, {
|
|
81
|
+
signal,
|
|
82
|
+
catalog: registry,
|
|
83
|
+
onAction: (name, params) => {
|
|
84
|
+
this.dispatchEvent(new CustomEvent('a2ui-action', {
|
|
85
|
+
bubbles: true,
|
|
86
|
+
detail: { name, params, timestamp: Date.now() },
|
|
87
|
+
}));
|
|
88
|
+
return Promise.resolve({ status: 'dispatched' });
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
break;
|
|
92
|
+
default:
|
|
93
|
+
console.warn(`a2ui-root: unknown transport "${this.transport}"`);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
this.active = true;
|
|
98
|
+
this.loading = false;
|
|
99
|
+
this.dispatchEvent(new Event('a2ui-connected', { bubbles: true }));
|
|
100
|
+
|
|
101
|
+
for await (const message of stream) {
|
|
102
|
+
if (signal.aborted) break;
|
|
103
|
+
this.#renderer.process(message);
|
|
104
|
+
this.dispatchEvent(new CustomEvent('a2ui-message', {
|
|
105
|
+
bubbles: true,
|
|
106
|
+
detail: { message },
|
|
107
|
+
}));
|
|
108
|
+
}
|
|
109
|
+
} catch (err) {
|
|
110
|
+
if (!signal.aborted) {
|
|
111
|
+
this.dispatchEvent(new CustomEvent('a2ui-error', {
|
|
112
|
+
bubbles: true,
|
|
113
|
+
detail: { error: err },
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
this.active = false;
|
|
119
|
+
this.loading = false;
|
|
120
|
+
this.dispatchEvent(new Event('a2ui-closed', { bubbles: true }));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
process(message) {
|
|
124
|
+
if (!this.#renderer) {
|
|
125
|
+
this.#renderer = new A2UIRenderer(this, registry);
|
|
126
|
+
}
|
|
127
|
+
this.#renderer.process(message);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
processAll(messages) {
|
|
131
|
+
for (const msg of messages) this.process(msg);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
reset() {
|
|
135
|
+
this.#renderer?.reset();
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
disconnect() {
|
|
139
|
+
this.#abortCtrl?.abort();
|
|
140
|
+
this.active = false;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
disconnected() {
|
|
144
|
+
this.#abortCtrl?.abort();
|
|
145
|
+
this.active = false;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
get renderer() { return this.#renderer; }
|
|
149
|
+
}
|
|
150
|
+
customElements.define('a2ui-root', AdiaA2UIRoot);
|
|
151
|
+
|
|
152
|
+
export { AdiaA2UIRoot };
|