You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8bf644a
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: typescript/core/web_core/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,7 @@
39
39
-`GenericBinder` resolves a union property as an action only when it references `Action` or has an object option whose only key is `event` or `functionCall`, as in the specification's `Action`. A union whose object option has other keys beside `event`, such as `{label, event}`, now resolves as a plain value instead of an action closure. [#4086](https://github.com/a2ui-project/a2ui/issues/4086), [#4087](https://github.com/a2ui-project/a2ui/pull/4087)
40
40
- (v1_0) Function calls inside `${...}` template expressions of `formatString` now inherit the `catalogId` that the enclosing `formatString` call resolved to (preserving reserved `@`-prefixed system calls such as `${@index()}` as catalogless), so nested template calls resolve against `formatString`'s catalog on defaultless surfaces and when the surface defines a different default `catalogId` ([#3727](https://github.com/a2ui-project/a2ui/issues/3727), [#4028](https://github.com/a2ui-project/a2ui/pull/4028)).
41
41
-`extractRefFields`, `NodeResolver`, `GenericBinder`, `scrapeSchemaBehavior`, `scrapeComponentBehavior` (newly exported), and `Catalog.componentRefMap` now resolve child references and dynamic bindings across wrapped (`ZodCatch`, `ZodPipeline`), composite (`ZodIntersection`, `ZodUnion`, `ZodDiscriminatedUnion`), empty-shape (`z.object({})`), open (`.passthrough()`, `.catchall()`, `z.record()`, `z.any()`, `z.unknown()`), and unannotated `child` / `children` component schemas ([#3783](https://github.com/a2ui-project/a2ui/issues/3783), [#3938](https://github.com/a2ui-project/a2ui/pull/3938)).
42
+
- Export `getMarkdownRenderer`, `markdown`, and `setMarkdownRenderer` from `@a2ui/web_core/universal`, make `Catalog<T, F>` covariant in `T` and `F`, and infer `T` from the `catalogs` argument of `new MessageProcessor(catalogs)` so `SurfaceModel` instances carry the component implementation type of their registered catalogs ([#3423](https://github.com/a2ui-project/a2ui/issues/3423), [#4181](https://github.com/a2ui-project/a2ui/pull/4181)).
Copy file name to clipboardExpand all lines: typescript/renderers/react/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@
3
3
-**BREAKING CHANGE**: Stop assigning `element.context` in `WebComponentNode`, and deprecate `ReactComponentImplementation.render`, `ReactRenderProps`, `ReactRenderProps.context`, `ReactA2uiComponentProps.context`, and `ReactWcHost.context`. Recommended migration: accept `node` on custom `A2uiWebComponentElement` classes, implement `view({node, buildChild})` (or read resolved `props` and `metadata` in `createComponentImplementation`), and obtain the `SurfaceModel` via `useA2uiSurface()`. [#3841](https://github.com/a2ui-project/a2ui/pull/3841)
4
4
- **BREAKING CHANGE**: `a2ui-react-<name>` host elements apply the component's `accessibility` attributes: `aria-live`, `aria-hidden`, and `inert` on the host, and `aria-label` and `aria-description` on the host with `role="group"` (unless the host already has a `role`). A component built with `createComponentImplementation` or `createBinderlessComponentImplementation` can pass the new `accessibilityRef` prop to an inner element to receive `aria-label` and `aria-description` instead, along with `aria-invalid="true"` while a check fails. The new `validationErrorsRef` prop marks the element that shows the validation errors; while there are errors, the `accessibilityRef` element gets `aria-describedby` pointing at it. Recommended migration: a component that already sets `aria-label` from `props.accessibility.label` on an inner element should pass `accessibilityRef` to that element, or the label is announced twice. [#3499](https://github.com/a2ui-project/a2ui/issues/3499), [#3869](https://github.com/a2ui-project/a2ui/pull/3869)
5
5
- Widen `react` and `react-dom` peer dependency ranges to `^17.0.0 || ^18.0.0 || ^19.0.0`, with internal fallbacks for `useSyncExternalStore` and `useId` when running on React 17. [#2372](https://github.com/a2ui-project/a2ui/issues/2372), [#3964](https://github.com/a2ui-project/a2ui/pull/3964)
6
+
- Import core and universal symbols from `@a2ui/web_core` and `@a2ui/web_core/universal` instead of `@a2ui/web_core/v0_9/*` in the `@a2ui/react` runtime so v1.0 bundles no longer pull in v0.9 schemas or v0.9 basic catalog custom elements ([#3423](https://github.com/a2ui-project/a2ui/issues/3423), [#4181](https://github.com/a2ui-project/a2ui/pull/4181)).
// import {basicCatalog} from '@a2ui/web_core/v0_9/basic_catalog';
37
37
```
38
38
39
39
The `@a2ui/react/v0_9` entry point still works but only re-exports the package
@@ -47,12 +47,12 @@ The React renderer works alongside the `MessageProcessor` from `@a2ui/web_core`.
47
47
-**Surface** — an independent rendering area, uniquely identified by a string ID, that the agent creates and populates with components.
48
48
-**Catalog** — the set of components (e.g. `Text`, `Column`, `Button`) available for a surface to use.
49
49
50
-
The example below creates a processor with the `basicCatalog` from `@a2ui/web_core`, feeds it a sequence of hardcoded messages, and renders the resulting surface.
50
+
The example below creates a processor with the `basicCatalog` from `@a2ui/web_core/catalogs/basic/v1`, feeds it a sequence of hardcoded messages, and renders the resulting surface.
Running this example should display "Hello from A2UI!". The example demonstrates three message types:
124
124
125
-
-[`createSurface`](../../../specification/v0_9/docs/a2ui_protocol.md#createsurface) initializes the rendering surface.
126
-
-[`updateComponents`](../../../specification/v0_9/docs/a2ui_protocol.md#updatecomponents) defines the UI tree. Here, a `Column` containing two `Text` components.
127
-
-[`updateDataModel`](../../../specification/v0_9/docs/a2ui_protocol.md#updatedatamodel) provides the data that the components reference via [`path` bindings](../../../specification/v0_9/docs/a2ui_protocol.md#path-resolution--scope) (e.g. `{ path: '/title' }` resolves to the `title` field in the data model).
125
+
-[`createSurface`](../../../specification/v1_0/docs/a2ui_protocol.md#createsurface) initializes the rendering surface.
126
+
-[`updateComponents`](../../../specification/v1_0/docs/a2ui_protocol.md#updatecomponents) defines the UI tree. Here, a `Column` containing two `Text` components.
127
+
-[`updateDataModel`](../../../specification/v1_0/docs/a2ui_protocol.md#updatedatamodel) provides the data that the components reference via [`@path` bindings](../../../specification/v1_0/docs/a2ui_protocol.md#path-resolution--scope) (e.g. `{ '@path': '/title' }` resolves to the `title` field in the data model).
128
128
129
129
## Defining Custom Components
130
130
131
-
A2UI v0.9 strictly separates a component's API (Schema) from its implementation.
131
+
A2UI separates a component's API (Schema) from its implementation.
132
132
133
133
### 1. Define the Component API
134
134
135
-
Use Zod to define the properties. Using `CommonSchemas` from `web_core` enables automatic binding for A2UI primitives.
135
+
Use Zod to define the properties. Using `CommonSchemas` from `@a2ui/web_core/v1_0` (or `@a2ui/web_core/v0_9` for v0.9 catalogs) enables automatic binding for A2UI primitives.
136
136
137
137
```typescript
138
138
import {z} from'zod';
139
-
import {CommonSchemas} from'@a2ui/web_core/v0_9';
139
+
import {CommonSchemas} from'@a2ui/web_core/v1_0';
140
140
141
141
exportconst MyProfileApi = {
142
142
name: 'Profile',
143
143
schema: z.object({
144
-
username: CommonSchemas.DynamicString, // Can be literal "Alice" or {path: "/user/name"}
144
+
username: CommonSchemas.DynamicString, // Can be literal "Alice" or {'@path': "/user/name"}
145
145
bio: CommonSchemas.DynamicString,
146
146
avatarUrl: CommonSchemas.DynamicString,
147
147
onEdit: CommonSchemas.Action, // Resolves to a clickable () => void
148
148
isEditable: CommonSchemas.DynamicBoolean,
149
-
// Add 'checks' if you want validation support (standard in v0.9 interactive components)
[MyProfile, RawInspector], // List of ReactComponentImplementation
285
285
[myCheckFunc], // List of FunctionImplementation
286
286
);
287
287
```
288
288
289
289
## Basic Catalog Components
290
290
291
-
`@a2ui/web_core/v0_9/basic_catalog` (v0.9) and `@a2ui/web_core/catalogs/basic/v1` (v1.0) each provide a `basicCatalog` with the same standard components. They are W3C Custom Elements, and the React renderer renders them as elements:
291
+
`@a2ui/web_core/catalogs/basic/v1` (v1.0) and `@a2ui/web_core/v0_9/basic_catalog` (v0.9 and v0.9.1) each provide a `basicCatalog` with the same standard components. They are W3C Custom Elements, and the React renderer renders them as elements:
A2UI v0.8 is deprecated and maintained only for backward compatibility. It is available from the `@a2ui/react/v0_8` entry point. New projects should use the package root, which supports v0.9 and v1.0 with type-safe binders and logic functions.
344
+
A2UI v0.8 is deprecated and maintained only for backward compatibility. It is available from the `@a2ui/react/v0_8` entry point. New projects should use the package root (`@a2ui/react`), which supports v1.0, v0.9.1, and v0.9 with type-safe binders and logic functions.
0 commit comments