-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add a minimal catalog for use with experimental renderers #732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Minimal A2UI Catalog | ||
|
|
||
| This folder contains a minimal A2UI component catalog (`minimal_catalog.json`) to be used as a test bed for testing new renderer implementations. | ||
|
|
||
| ## Purpose | ||
|
|
||
| The basic A2UI catalog is comprehensive and features many components, functions, and layout primitives. Building a new renderer from scratch to support the entire catalog can be overwhelming. The minimal catalog reduces the surface area to a core set of fundamental components: | ||
|
|
||
| - **Text**: For rendering text strings. | ||
| - **Row**: For horizontal flex layouts. | ||
| - **Column**: For vertical flex layouts. | ||
| - **Button**: For basic interactivity and action dispatching. | ||
| - **TextField**: For two-way data-bound user inputs. | ||
|
|
||
| By targeting this minimal catalog first, new renderer implementations can establish a solid foundation—covering layout algorithms, component nesting, data binding, and event handling—before scaling up to the full basic catalog. | ||
|
|
||
| ## Examples | ||
|
|
||
| The `examples/` directory contains 5 JSON arrays of layout messages (`server_to_client_list` format) demonstrating various UI scenarios using only the components defined in this minimal catalog. They serve as basic integration tests. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| [ | ||
| { | ||
| "version": "v0.9", | ||
| "createSurface": { | ||
| "surfaceId": "example_1", | ||
| "catalogId": "https://a2ui.org/specification/v0_9/catalogs/minimal/minimal_catalog.json" | ||
| } | ||
| }, | ||
| { | ||
| "version": "v0.9", | ||
| "updateComponents": { | ||
| "surfaceId": "example_1", | ||
| "components": [ | ||
| { | ||
| "id": "root", | ||
| "component": "Text", | ||
| "text": "Hello, Minimal Catalog!", | ||
| "variant": "h1" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| [ | ||
| { | ||
| "version": "v0.9", | ||
| "createSurface": { | ||
| "surfaceId": "example_2", | ||
| "catalogId": "https://a2ui.org/specification/v0_9/catalogs/minimal/minimal_catalog.json" | ||
| } | ||
| }, | ||
| { | ||
| "version": "v0.9", | ||
| "updateComponents": { | ||
| "surfaceId": "example_2", | ||
| "components": [ | ||
| { | ||
| "id": "root", | ||
| "component": "Row", | ||
| "children": ["left_text", "right_text"], | ||
| "justify": "spaceBetween", | ||
| "align": "center" | ||
| }, | ||
| { | ||
| "id": "left_text", | ||
| "component": "Text", | ||
| "text": "Left Content", | ||
| "variant": "body" | ||
| }, | ||
| { | ||
| "id": "right_text", | ||
| "component": "Text", | ||
| "text": "Right Content", | ||
| "variant": "caption" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| [ | ||
| { | ||
| "version": "v0.9", | ||
| "createSurface": { | ||
| "surfaceId": "example_3", | ||
| "catalogId": "https://a2ui.org/specification/v0_9/catalogs/minimal/minimal_catalog.json" | ||
| } | ||
| }, | ||
| { | ||
| "version": "v0.9", | ||
| "updateComponents": { | ||
| "surfaceId": "example_3", | ||
| "components": [ | ||
| { | ||
| "id": "root", | ||
| "component": "Column", | ||
| "children": ["title", "action_button"], | ||
| "justify": "center", | ||
| "align": "center" | ||
| }, | ||
| { | ||
| "id": "title", | ||
| "component": "Text", | ||
| "text": "Click the button below", | ||
| "variant": "body" | ||
| }, | ||
| { | ||
| "id": "action_button", | ||
| "component": "Button", | ||
| "child": "button_label", | ||
| "variant": "primary", | ||
| "action": { | ||
| "event": { | ||
| "name": "button_clicked", | ||
| "context": {} | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "id": "button_label", | ||
| "component": "Text", | ||
| "text": "Click Me" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| [ | ||
| { | ||
| "version": "v0.9", | ||
| "createSurface": { | ||
| "surfaceId": "example_4", | ||
| "catalogId": "https://a2ui.org/specification/v0_9/catalogs/minimal/minimal_catalog.json", | ||
| "sendDataModel": true | ||
| } | ||
| }, | ||
| { | ||
| "version": "v0.9", | ||
| "updateComponents": { | ||
| "surfaceId": "example_4", | ||
| "components": [ | ||
| { | ||
| "id": "root", | ||
| "component": "Column", | ||
| "children": ["form_title", "username_field", "password_field", "submit_button"], | ||
| "justify": "start", | ||
| "align": "stretch" | ||
| }, | ||
| { | ||
| "id": "form_title", | ||
| "component": "Text", | ||
| "text": "Login", | ||
| "variant": "h2" | ||
| }, | ||
| { | ||
| "id": "username_field", | ||
| "component": "TextField", | ||
| "label": "Username", | ||
| "value": { "path": "/username" }, | ||
| "variant": "shortText" | ||
| }, | ||
| { | ||
| "id": "password_field", | ||
| "component": "TextField", | ||
| "label": "Password", | ||
| "value": { "path": "/password" }, | ||
| "variant": "obscured" | ||
| }, | ||
| { | ||
| "id": "submit_button", | ||
| "component": "Button", | ||
| "child": "submit_label", | ||
| "variant": "primary", | ||
| "action": { | ||
| "event": { | ||
| "name": "login_submitted", | ||
| "context": { | ||
| "user": { "path": "/username" }, | ||
| "pass": { "path": "/password" } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "id": "submit_label", | ||
| "component": "Text", | ||
| "text": "Sign In" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| [ | ||
| { | ||
| "version": "v0.9", | ||
| "createSurface": { | ||
| "surfaceId": "example_5", | ||
| "catalogId": "https://a2ui.org/specification/v0_9/catalogs/minimal/minimal_catalog.json" | ||
| } | ||
| }, | ||
| { | ||
| "version": "v0.9", | ||
| "updateComponents": { | ||
| "surfaceId": "example_5", | ||
| "components": [ | ||
| { | ||
| "id": "root", | ||
| "component": "Column", | ||
| "children": ["header", "form_row", "footer"], | ||
| "justify": "spaceBetween", | ||
| "align": "stretch" | ||
| }, | ||
| { | ||
| "id": "header", | ||
| "component": "Text", | ||
| "text": "User Profile Form", | ||
| "variant": "h1" | ||
| }, | ||
| { | ||
| "id": "form_row", | ||
| "component": "Row", | ||
| "children": ["first_name", "last_name"], | ||
| "justify": "start", | ||
| "align": "start" | ||
| }, | ||
| { | ||
| "id": "first_name", | ||
| "component": "TextField", | ||
| "label": "First Name", | ||
| "value": { "path": "/firstName" }, | ||
| "weight": 1 | ||
| }, | ||
| { | ||
| "id": "last_name", | ||
| "component": "TextField", | ||
| "label": "Last Name", | ||
| "value": { "path": "/lastName" }, | ||
| "weight": 1 | ||
| }, | ||
| { | ||
| "id": "footer", | ||
| "component": "Text", | ||
| "text": "Please fill out all fields.", | ||
| "variant": "caption" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a standard convention to end files with a newline character. Some tools and systems expect this and may not process the file correctly without it. I've noticed this in all the new JSON files in this pull request.