Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changeset/seven-llamas-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---

---
1 change: 1 addition & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"packages/react/runtime/**",

"packages/tools/**",
"packages/genui/a2ui/tools/**",

"packages/use-sync-external-store/test/**",

Expand Down
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export default tseslint.config(
// TODO: enable eslint for tools
// tools
'packages/tools/**',
'packages/genui/a2ui/tools/**',

// TODO: enable eslint for web-platform
// web-platform
Expand Down
91 changes: 47 additions & 44 deletions packages/genui/a2ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,92 +6,95 @@
"type": "module",
"exports": {
".": {
"types": "./src/index.ts",
"default": "./src/index.js"
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./core": {
"types": "./src/core/index.ts",
"default": "./src/core/index.js"
"types": "./dist/core/index.d.ts",
"default": "./dist/core/index.js"
},
"./chat": {
"types": "./src/chat/index.ts",
"default": "./src/chat/index.js"
"types": "./dist/chat/index.d.ts",
"default": "./dist/chat/index.js"
},
"./catalog/all": {
"types": "./src/catalog/all.ts",
"default": "./src/catalog/all.js"
"types": "./dist/catalog/all.d.ts",
"default": "./dist/catalog/all.js"
},
"./catalog/Text": {
"types": "./src/catalog/Text.ts",
"default": "./src/catalog/Text.js"
"types": "./dist/catalog/Text.d.ts",
"default": "./dist/catalog/Text.js"
},
"./catalog/Image": {
"types": "./src/catalog/Image.ts",
"default": "./src/catalog/Image.js"
"types": "./dist/catalog/Image.d.ts",
"default": "./dist/catalog/Image.js"
},
"./catalog/Button": {
"types": "./src/catalog/Button.ts",
"default": "./src/catalog/Button.js"
"types": "./dist/catalog/Button.d.ts",
"default": "./dist/catalog/Button.js"
},
"./catalog/Row": {
"types": "./src/catalog/Row.ts",
"default": "./src/catalog/Row.js"
"types": "./dist/catalog/Row.d.ts",
"default": "./dist/catalog/Row.js"
},
"./catalog/Column": {
"types": "./src/catalog/Column.ts",
"default": "./src/catalog/Column.js"
"types": "./dist/catalog/Column.d.ts",
"default": "./dist/catalog/Column.js"
},
"./catalog/List": {
"types": "./src/catalog/List.ts",
"default": "./src/catalog/List.js"
"types": "./dist/catalog/List.d.ts",
"default": "./dist/catalog/List.js"
},
"./catalog/Card": {
"types": "./src/catalog/Card.ts",
"default": "./src/catalog/Card.js"
"types": "./dist/catalog/Card.d.ts",
"default": "./dist/catalog/Card.js"
},
"./catalog/Divider": {
"types": "./src/catalog/Divider.ts",
"default": "./src/catalog/Divider.js"
"types": "./dist/catalog/Divider.d.ts",
"default": "./dist/catalog/Divider.js"
},
"./catalog/TextField": {
"types": "./src/catalog/TextField.ts",
"default": "./src/catalog/TextField.js"
"types": "./dist/catalog/TextField.d.ts",
"default": "./dist/catalog/TextField.js"
},
"./catalog/Icon": {
"types": "./src/catalog/Icon.ts",
"default": "./src/catalog/Icon.js"
"types": "./dist/catalog/Icon.d.ts",
"default": "./dist/catalog/Icon.js"
},
"./catalog/Tabs": {
"types": "./src/catalog/Tabs.ts",
"default": "./src/catalog/Tabs.js"
"types": "./dist/catalog/Tabs.d.ts",
"default": "./dist/catalog/Tabs.js"
},
"./catalog/Modal": {
"types": "./src/catalog/Modal.ts",
"default": "./src/catalog/Modal.js"
"types": "./dist/catalog/Modal.d.ts",
"default": "./dist/catalog/Modal.js"
},
"./catalog/AudioPlayer": {
"types": "./src/catalog/AudioPlayer.ts",
"default": "./src/catalog/AudioPlayer.js"
"types": "./dist/catalog/AudioPlayer.d.ts",
"default": "./dist/catalog/AudioPlayer.js"
},
"./catalog/Slider": {
"types": "./src/catalog/Slider.ts",
"default": "./src/catalog/Slider.js"
"types": "./dist/catalog/Slider.d.ts",
"default": "./dist/catalog/Slider.js"
},
"./catalog/DateTimeInput": {
"types": "./src/catalog/DateTimeInput.ts",
"default": "./src/catalog/DateTimeInput.js"
"types": "./dist/catalog/DateTimeInput.d.ts",
"default": "./dist/catalog/DateTimeInput.js"
},
"./catalog/ChoicePicker": {
"types": "./src/catalog/ChoicePicker.ts",
"default": "./src/catalog/ChoicePicker.js"
"types": "./dist/catalog/ChoicePicker.d.ts",
"default": "./dist/catalog/ChoicePicker.js"
},
"./catalog/CheckBox": {
"types": "./src/catalog/CheckBox.ts",
"default": "./src/catalog/CheckBox.js"
"types": "./dist/catalog/CheckBox.d.ts",
"default": "./dist/catalog/CheckBox.js"
}
},
"main": "./src/index.js",
"types": "./src/index.ts",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "node --experimental-strip-types tools/catalog_generator.ts && tsc -b"
},
Comment thread
coderabbitai[bot] marked this conversation as resolved.
"dependencies": {
"@a2ui/web_core": "0.9.1",
"@preact/signals": "^2.5.1"
Expand Down
71 changes: 0 additions & 71 deletions packages/genui/a2ui/src/catalog/Button/catalog.json

This file was deleted.

17 changes: 15 additions & 2 deletions packages/genui/a2ui/src/catalog/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,21 @@ import type { GenericComponentProps } from '../../core/types.js';

import './style.css';

export interface ButtonProps extends GenericComponentProps {
child: string;
variant?: 'primary' | 'borderless';
/** v0.9 actions should use the `event` wrapper for server-dispatched clicks. */
action: {
event: {
name: string;
/** Context is a JSON object map in v0.9. */
context?: Record<string, string | number | boolean | { path: string }>;
};
};
}

export function Button(
props: GenericComponentProps,
props: ButtonProps,
): import('@lynx-js/react').ReactNode {
const { action, child, surface, sendAction } = props;

Expand All @@ -18,7 +31,7 @@ export function Button(
};

const childResource = child
? surface.resources.get(child as string)
? surface.resources.get(child)
: undefined;

return (
Expand Down
12 changes: 0 additions & 12 deletions packages/genui/a2ui/src/catalog/Card/catalog.json

This file was deleted.

13 changes: 4 additions & 9 deletions packages/genui/a2ui/src/catalog/Card/index.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.
import type * as v0_9 from '@a2ui/web_core/v0_9';

import { NodeRenderer } from '../../core/A2UIRender.jsx';
import type { ComponentProps } from '../../core/ComponentRegistry.js';
import type { GenericComponentProps } from '../../core/types.js';

import './style.css';

export interface CardProps extends ComponentProps {
component: v0_9.AnyComponent & { dataContextPath?: string };
export interface CardProps extends GenericComponentProps {
child: string;
}

export function Card(
props: GenericComponentProps,
): import('@lynx-js/react').ReactNode {
export function Card(props: CardProps): import('@lynx-js/react').ReactNode {
const { child: childId, surface, dataContextPath } = props;
const childComponent = surface.components.get(childId as string);
const childComponent = surface.components.get(childId);
const childWithContext = childComponent && dataContextPath
? { ...childComponent, dataContextPath: dataContextPath }
: childComponent;
Expand Down
48 changes: 0 additions & 48 deletions packages/genui/a2ui/src/catalog/CheckBox/catalog.json

This file was deleted.

10 changes: 4 additions & 6 deletions packages/genui/a2ui/src/catalog/CheckBox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.
import type * as v0_9 from '@a2ui/web_core/v0_9';

import type { ComponentProps } from '../../core/ComponentRegistry.js';
import type { GenericComponentProps } from '../../core/types.js';

import './style.css';

export interface CheckBoxProps extends ComponentProps {
component: v0_9.AnyComponent & { dataContextPath?: string };
export interface CheckBoxProps extends GenericComponentProps {
label: string | { path: string };
value: boolean | { path: string };
}

export function CheckBox(
props: GenericComponentProps,
props: CheckBoxProps,
): import('@lynx-js/react').ReactNode {
const { id, label = 'CheckBox', value, setValue } = props;

Expand Down
Loading
Loading