-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add initial React Renderer v0.9 #827
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 61 commits
8dc92bf
c5a8eb3
5df86c2
07077b2
6ae4b24
0e75794
2f52cad
d9f328f
a4b2b61
f8c147c
2a74434
46a1504
a17edea
7d73d59
1daad96
a1fa3ec
dc958a6
1ceb3f1
e773e0f
f07b00d
1eebf0d
b95ab1d
4168208
110f87e
11399ee
6c113ff
88378d9
587cdd6
7a4b788
99e7095
502520d
d2d6069
64ff985
2fcf422
22f81bb
dc7f6a6
2774778
7c6ea9b
0105697
6d7bd40
de7c6ee
dbcba08
7725ee9
059c489
ae4372b
eb4d3f4
d213b55
cca2e02
a16520d
35e3750
4b675e1
b360c09
c771ea7
7e19997
77ac6b4
4038c92
628f271
00c6755
3bb5229
e2c0583
95bbf40
1998632
37c6f3b
3e75b5a
a926e26
72df38a
7e35c8c
b3823fa
5e917e0
be67f11
a457dee
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,62 @@ | ||
| # A2UI React Gallery App | ||
|
|
||
| This is the reference Gallery Application for the A2UI React renderer. It allows you to explore A2UI samples, inspect the live data model, and step through the message rendering process. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| This application depends on the following local libraries in this repository: | ||
| 1. `@a2ui/web_core` (located in `renderers/web_core`) | ||
| 2. `@a2ui/react_prototype` (located in `renderers/react_prototype`) | ||
|
||
|
|
||
| ## Building Dependencies | ||
|
|
||
| Before running the gallery app, you must build the local renderer library: | ||
|
|
||
| ```bash | ||
| # Navigate to the React renderer library | ||
| cd ../../../renderers/react_prototype | ||
|
|
||
| # Install and build the library | ||
| npm install | ||
| npm run build | ||
| ``` | ||
|
|
||
| *Note: Ensure `@a2ui/web_core` is also built if you have made changes to the core logic.* | ||
|
|
||
| ## Setup and Development | ||
|
|
||
| Once the dependencies are built, you can start the gallery app: | ||
|
|
||
| ```bash | ||
| # Navigate to this directory | ||
| cd samples/client/react | ||
|
|
||
| # Install dependencies | ||
| npm install | ||
|
|
||
| # Start the development server | ||
| npm run dev | ||
| ``` | ||
|
|
||
| ## Building for Production | ||
|
|
||
| To create a production build of the gallery app: | ||
|
|
||
| ```bash | ||
| npm run build | ||
| ``` | ||
|
|
||
| ## Running Tests | ||
|
|
||
| To run the integration tests: | ||
|
|
||
| ```bash | ||
| npm test | ||
| ``` | ||
|
|
||
| ## Gallery Features | ||
|
|
||
| - **3-Column Layout**: Left (Sample selection), Center (Live preview & Message stepper), Right (Data model & Action logs). | ||
| - **Progressive Stepper**: Use the "Advance" buttons next to each JSON message to see how the UI builds up incrementally. | ||
| - **Action Logs**: View real-time logs of actions triggered by user interactions. | ||
| - **Data Model Inspector**: Observe how the surface's data model changes as you interact with form fields. | ||
ava-cassiopeia marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /** | ||
| * Copyright 2026 Google LLC | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| import js from '@eslint/js' | ||
| import globals from 'globals' | ||
| import reactHooks from 'eslint-plugin-react-hooks' | ||
| import reactRefresh from 'eslint-plugin-react-refresh' | ||
| import tseslint from 'typescript-eslint' | ||
| import { defineConfig, globalIgnores } from 'eslint/config' | ||
|
|
||
| export default defineConfig([ | ||
| globalIgnores(['dist']), | ||
| { | ||
| files: ['**/*.{ts,tsx}'], | ||
| extends: [ | ||
| js.configs.recommended, | ||
| tseslint.configs.recommended, | ||
| reactHooks.configs.flat.recommended, | ||
| reactRefresh.configs.vite, | ||
| ], | ||
| languageOptions: { | ||
| ecmaVersion: 2020, | ||
| globals: globals.browser, | ||
| }, | ||
| }, | ||
| ]) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <!-- | ||
| Copyright 2026 Google LLC | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| --> | ||
|
|
||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" /> | ||
| <title>react</title> | ||
| </head> | ||
| <body> | ||
| <div id="root"></div> | ||
| <script type="module" src="/src/main.tsx"></script> | ||
| </body> | ||
| </html> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| /** | ||
| * Copyright 2026 Google LLC | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| #root { | ||
| max-width: 1280px; | ||
| margin: 0 auto; | ||
| padding: 2rem; | ||
| text-align: center; | ||
| } | ||
|
|
||
| .logo { | ||
| height: 6em; | ||
| padding: 1.5em; | ||
| will-change: filter; | ||
| transition: filter 300ms; | ||
| } | ||
| .logo:hover { | ||
| filter: drop-shadow(0 0 2em #646cffaa); | ||
| } | ||
| .logo.react:hover { | ||
| filter: drop-shadow(0 0 2em #61dafbaa); | ||
| } | ||
|
|
||
| @keyframes logo-spin { | ||
| from { | ||
| transform: rotate(0deg); | ||
| } | ||
| to { | ||
| transform: rotate(360deg); | ||
| } | ||
| } | ||
|
|
||
| @media (prefers-reduced-motion: no-preference) { | ||
| a:nth-of-type(2) .logo { | ||
ava-cassiopeia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| animation: logo-spin infinite 20s linear; | ||
| } | ||
| } | ||
|
|
||
| .card { | ||
| padding: 2em; | ||
| } | ||
|
|
||
| .read-the-docs { | ||
| color: #888; | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.