@toon-ui/react 0.2.0 → 0.3.0
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 +422 -93
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
# @toon-ui/react
|
|
2
2
|
|
|
3
|
-
`@toon-ui/react` is the React
|
|
3
|
+
`@toon-ui/react` is the explicit React runtime for ToonUI.
|
|
4
4
|
|
|
5
|
-
Use
|
|
6
|
-
|
|
7
|
-
- React rendering
|
|
8
|
-
- your own component registry
|
|
9
|
-
- direct control of button, form, field, card, alert, and table components
|
|
10
|
-
- ToonUI event surfacing in React without the built-in preset package
|
|
5
|
+
Use this package when you want FULL control over the React component registry instead of relying on the convenience preset package.
|
|
11
6
|
|
|
12
7
|
---
|
|
13
8
|
|
|
14
9
|
## Quick path
|
|
15
10
|
|
|
16
|
-
1. Use `createToonProtocol()`
|
|
17
|
-
2. Use `createToonReactRuntime()`
|
|
18
|
-
3.
|
|
19
|
-
4.
|
|
20
|
-
5.
|
|
11
|
+
1. Use `createToonProtocol()` from `@toon-ui/core` on the server.
|
|
12
|
+
2. Use `createToonReactRuntime()` from `@toon-ui/react` on the client.
|
|
13
|
+
3. Render assistant content with `ToonMessage`.
|
|
14
|
+
4. Handle `onReply` and `onSubmit`.
|
|
15
|
+
5. Convert interaction payloads back into chat-ready messages with `runtime.createChatMessage(payload)`.
|
|
21
16
|
|
|
22
17
|
---
|
|
23
18
|
|
|
@@ -29,6 +24,27 @@ pnpm add @toon-ui/core @toon-ui/react react react-dom
|
|
|
29
24
|
|
|
30
25
|
---
|
|
31
26
|
|
|
27
|
+
## Recommended architecture
|
|
28
|
+
|
|
29
|
+
```txt
|
|
30
|
+
Server
|
|
31
|
+
@toon-ui/core
|
|
32
|
+
-> createToonProtocol()
|
|
33
|
+
-> toon.prompt
|
|
34
|
+
|
|
35
|
+
Client
|
|
36
|
+
@toon-ui/react
|
|
37
|
+
-> createToonReactRuntime()
|
|
38
|
+
-> ToonMessage / ToonRenderer
|
|
39
|
+
-> onReply / onSubmit
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`@toon-ui/react` is the CLIENT rendering layer.
|
|
43
|
+
|
|
44
|
+
It is NOT the server protocol layer.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
32
48
|
## Main exports
|
|
33
49
|
|
|
34
50
|
- `createToonReactRuntime()`
|
|
@@ -38,35 +54,62 @@ pnpm add @toon-ui/core @toon-ui/react react react-dom
|
|
|
38
54
|
- `useToonUI()`
|
|
39
55
|
- `useToonReply()`
|
|
40
56
|
- `useToonSubmit()`
|
|
57
|
+
- `useToonAction()`
|
|
41
58
|
- `basicPreset()`
|
|
42
59
|
|
|
43
60
|
---
|
|
44
61
|
|
|
45
62
|
## Server integration
|
|
46
63
|
|
|
47
|
-
`@toon-ui/
|
|
48
|
-
|
|
49
|
-
On the server, pair it with `@toon-ui/core`:
|
|
64
|
+
The server should use `@toon-ui/core`, not `@toon-ui/react`.
|
|
50
65
|
|
|
51
66
|
```ts
|
|
52
67
|
import { createToonProtocol } from '@toon-ui/core';
|
|
68
|
+
import { streamText } from 'ai';
|
|
69
|
+
import { openai } from '@ai-sdk/openai';
|
|
53
70
|
|
|
54
|
-
|
|
71
|
+
const toon = createToonProtocol();
|
|
55
72
|
|
|
56
|
-
|
|
73
|
+
const system = [
|
|
57
74
|
toon.prompt,
|
|
58
75
|
'Available tools:',
|
|
59
76
|
'- searchProducts(query)',
|
|
77
|
+
'- createProduct(name, price, stock)',
|
|
60
78
|
].join('\n\n');
|
|
79
|
+
|
|
80
|
+
export async function POST(req: Request) {
|
|
81
|
+
const { messages } = await req.json();
|
|
82
|
+
|
|
83
|
+
const result = streamText({
|
|
84
|
+
model: openai('gpt-4.1'),
|
|
85
|
+
system,
|
|
86
|
+
messages,
|
|
87
|
+
tools: {
|
|
88
|
+
searchProducts: async ({ query }) => ({ ok: true, query }),
|
|
89
|
+
createProduct: async ({ name, price, stock }) => ({ ok: true, name, price, stock }),
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
return result.toUIMessageStreamResponse();
|
|
94
|
+
}
|
|
61
95
|
```
|
|
62
96
|
|
|
63
|
-
|
|
97
|
+
Why not `@toon-ui/react` on the server?
|
|
98
|
+
|
|
99
|
+
Because the server needs:
|
|
100
|
+
|
|
101
|
+
- protocol
|
|
102
|
+
- prompts
|
|
103
|
+
- formatters
|
|
104
|
+
- validation
|
|
105
|
+
|
|
106
|
+
It does NOT need React rendering state.
|
|
64
107
|
|
|
65
108
|
---
|
|
66
109
|
|
|
67
110
|
## Frontend integration
|
|
68
111
|
|
|
69
|
-
This is the
|
|
112
|
+
This is the primary use case.
|
|
70
113
|
|
|
71
114
|
```tsx
|
|
72
115
|
import {
|
|
@@ -82,130 +125,416 @@ const runtime = createToonReactRuntime({
|
|
|
82
125
|
});
|
|
83
126
|
|
|
84
127
|
export function AssistantMessage({ content }: { content: string }) {
|
|
85
|
-
return
|
|
128
|
+
return (
|
|
129
|
+
<ToonMessage
|
|
130
|
+
content={content}
|
|
131
|
+
runtime={runtime}
|
|
132
|
+
onReply={(payload) => {
|
|
133
|
+
const message = runtime.createChatMessage(payload);
|
|
134
|
+
console.log(message.content);
|
|
135
|
+
}}
|
|
136
|
+
onSubmit={(payload) => {
|
|
137
|
+
const message = runtime.createChatMessage(payload);
|
|
138
|
+
console.log(message.content);
|
|
139
|
+
}}
|
|
140
|
+
/>
|
|
141
|
+
);
|
|
86
142
|
}
|
|
87
143
|
```
|
|
88
144
|
|
|
89
145
|
---
|
|
90
146
|
|
|
91
|
-
##
|
|
147
|
+
## Runtime creation
|
|
148
|
+
|
|
149
|
+
## `createToonReactRuntime()`
|
|
150
|
+
|
|
151
|
+
Creates the React runtime with your component registry.
|
|
152
|
+
|
|
153
|
+
### Use it when
|
|
154
|
+
|
|
155
|
+
- you want explicit runtime construction
|
|
156
|
+
- you want to override components
|
|
157
|
+
- you do NOT want the convenience wrapper package
|
|
158
|
+
|
|
159
|
+
### Example
|
|
92
160
|
|
|
93
161
|
```tsx
|
|
94
|
-
import {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
162
|
+
import { basicPreset, createToonReactRuntime } from '@toon-ui/react';
|
|
163
|
+
|
|
164
|
+
const runtime = createToonReactRuntime({
|
|
165
|
+
components: {
|
|
166
|
+
...basicPreset(),
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Important
|
|
172
|
+
|
|
173
|
+
This runtime also includes everything inherited from the core runtime:
|
|
174
|
+
|
|
175
|
+
- `prompt`
|
|
176
|
+
- `rules`
|
|
177
|
+
- `parse`
|
|
178
|
+
- `validate`
|
|
179
|
+
- `extractBlocks`
|
|
180
|
+
- `formatReplyMessage`
|
|
181
|
+
- `formatSubmitMessage`
|
|
182
|
+
- `createChatMessage`
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Rendering components
|
|
187
|
+
|
|
188
|
+
## `ToonMessage`
|
|
189
|
+
|
|
190
|
+
High-level renderer for a COMPLETE assistant message.
|
|
191
|
+
|
|
192
|
+
It:
|
|
193
|
+
|
|
194
|
+
- keeps normal markdown text
|
|
195
|
+
- extracts `toon-ui` blocks
|
|
196
|
+
- renders text + UI in one component
|
|
197
|
+
|
|
198
|
+
### Use it when
|
|
199
|
+
|
|
200
|
+
You have an assistant message string that may contain both:
|
|
201
|
+
|
|
202
|
+
- plain text
|
|
203
|
+
- one or more `toon-ui` blocks
|
|
204
|
+
|
|
205
|
+
### Props
|
|
206
|
+
|
|
207
|
+
- `content: string`
|
|
208
|
+
- `runtime: ToonReactRuntime`
|
|
209
|
+
- `onReply?: (payload: ToonReplyPayload) => void`
|
|
210
|
+
- `onSubmit?: (payload: ToonSubmitPayload) => void`
|
|
99
211
|
|
|
100
|
-
|
|
101
|
-
|
|
212
|
+
### Example
|
|
213
|
+
|
|
214
|
+
```tsx
|
|
215
|
+
<ToonMessage
|
|
216
|
+
content={message.content}
|
|
217
|
+
runtime={runtime}
|
|
218
|
+
onReply={(payload) => console.log(payload)}
|
|
219
|
+
onSubmit={(payload) => console.log(payload)}
|
|
220
|
+
/>
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### When NOT to use it
|
|
224
|
+
|
|
225
|
+
If you already separated the ToonUI block yourself and only want to render the structured UI, use `ToonRenderer`.
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## `ToonRenderer`
|
|
230
|
+
|
|
231
|
+
Low-level renderer for ONLY the ToonUI blocks inside a string.
|
|
232
|
+
|
|
233
|
+
It does NOT own the surrounding markdown presentation.
|
|
234
|
+
|
|
235
|
+
### Use it when
|
|
236
|
+
|
|
237
|
+
- your host app renders markdown separately
|
|
238
|
+
- you want ToonUI to handle only the structured UI section
|
|
239
|
+
|
|
240
|
+
### Props
|
|
241
|
+
|
|
242
|
+
- `content: string`
|
|
243
|
+
- `runtime: ToonReactRuntime`
|
|
244
|
+
- `onReply?: (payload: ToonReplyPayload) => void`
|
|
245
|
+
- `onSubmit?: (payload: ToonSubmitPayload) => void`
|
|
246
|
+
|
|
247
|
+
### Example
|
|
248
|
+
|
|
249
|
+
```tsx
|
|
250
|
+
<ToonRenderer
|
|
251
|
+
content={toonBlockContent}
|
|
252
|
+
runtime={runtime}
|
|
253
|
+
onReply={(payload) => console.log(payload)}
|
|
254
|
+
onSubmit={(payload) => console.log(payload)}
|
|
255
|
+
/>
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Difference vs `ToonMessage`
|
|
259
|
+
|
|
260
|
+
- `ToonMessage` = full message
|
|
261
|
+
- `ToonRenderer` = only ToonUI UI rendering
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## Context layer
|
|
266
|
+
|
|
267
|
+
## `ToonProvider`
|
|
268
|
+
|
|
269
|
+
Provides the Toon runtime and form/action context to the React tree.
|
|
270
|
+
|
|
271
|
+
Internally it manages:
|
|
272
|
+
|
|
273
|
+
- current runtime
|
|
274
|
+
- form field state
|
|
275
|
+
- `sendReply`
|
|
276
|
+
- `submitForm`
|
|
277
|
+
|
|
278
|
+
### Use it when
|
|
279
|
+
|
|
280
|
+
- you are building custom Toon trees manually
|
|
281
|
+
- you want direct access to Toon hooks in your own component subtree
|
|
282
|
+
|
|
283
|
+
### Example
|
|
284
|
+
|
|
285
|
+
```tsx
|
|
286
|
+
<ToonProvider runtime={runtime} onReply={handleReply} onSubmit={handleSubmit}>
|
|
287
|
+
<MyCustomTree />
|
|
288
|
+
</ToonProvider>
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Important
|
|
292
|
+
|
|
293
|
+
You usually do NOT need to mount this directly if you already use:
|
|
294
|
+
|
|
295
|
+
- `ToonMessage`
|
|
296
|
+
- `ToonRenderer`
|
|
297
|
+
|
|
298
|
+
Those components already create the provider internally.
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Hooks
|
|
303
|
+
|
|
304
|
+
## `useToonUI()`
|
|
305
|
+
|
|
306
|
+
Returns the active Toon runtime from context.
|
|
307
|
+
|
|
308
|
+
### Use it when
|
|
309
|
+
|
|
310
|
+
- you need access to runtime helpers inside a child component
|
|
311
|
+
- you need parsing, validation, or formatter helpers from context
|
|
312
|
+
|
|
313
|
+
### Example
|
|
314
|
+
|
|
315
|
+
```tsx
|
|
316
|
+
function RuntimeDebug() {
|
|
317
|
+
const runtime = useToonUI();
|
|
318
|
+
return <pre>{runtime.prompt}</pre>;
|
|
102
319
|
}
|
|
320
|
+
```
|
|
103
321
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
322
|
+
### Requirement
|
|
323
|
+
|
|
324
|
+
Must be used inside `ToonProvider`.
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## `useToonReply()`
|
|
329
|
+
|
|
330
|
+
Returns the `sendReply(payload)` function from context.
|
|
331
|
+
|
|
332
|
+
### Use it when
|
|
333
|
+
|
|
334
|
+
- you are building a custom component
|
|
335
|
+
- you want to emit a `ui_reply` manually
|
|
336
|
+
|
|
337
|
+
### Example
|
|
338
|
+
|
|
339
|
+
```tsx
|
|
340
|
+
function ReplyExample({ payload }: { payload: any }) {
|
|
341
|
+
const sendReply = useToonReply();
|
|
342
|
+
|
|
343
|
+
return <button onClick={() => sendReply(payload)}>Enviar reply</button>;
|
|
344
|
+
}
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### Requirement
|
|
348
|
+
|
|
349
|
+
Must be used inside `ToonProvider`.
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## `useToonSubmit()`
|
|
354
|
+
|
|
355
|
+
Returns the `submitForm(form)` function from context.
|
|
356
|
+
|
|
357
|
+
### Use it when
|
|
358
|
+
|
|
359
|
+
- you are building custom submit controls
|
|
360
|
+
- you want to trigger submit for a specific `FormNode`
|
|
361
|
+
|
|
362
|
+
### Example
|
|
363
|
+
|
|
364
|
+
```tsx
|
|
365
|
+
function SubmitExample({ form }: { form: any }) {
|
|
366
|
+
const submitForm = useToonSubmit();
|
|
367
|
+
|
|
368
|
+
return <button onClick={() => submitForm(form)}>Enviar</button>;
|
|
369
|
+
}
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
### Requirement
|
|
373
|
+
|
|
374
|
+
Must be used inside `ToonProvider`.
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
## `useToonAction()`
|
|
379
|
+
|
|
380
|
+
Returns protocol formatter helpers from the runtime context.
|
|
381
|
+
|
|
382
|
+
Current return shape:
|
|
383
|
+
|
|
384
|
+
```ts
|
|
385
|
+
{
|
|
386
|
+
formatSubmitMessage,
|
|
387
|
+
formatReplyMessage
|
|
388
|
+
}
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
### Use it when
|
|
392
|
+
|
|
393
|
+
- you want formatter access inside React components
|
|
394
|
+
- you do NOT need the whole runtime object
|
|
395
|
+
|
|
396
|
+
### Example
|
|
397
|
+
|
|
398
|
+
```tsx
|
|
399
|
+
function FormatterPreview() {
|
|
400
|
+
const { formatReplyMessage } = useToonAction();
|
|
401
|
+
|
|
402
|
+
return <pre>{formatReplyMessage('Sí, elimínalo')}</pre>;
|
|
114
403
|
}
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
### Important
|
|
407
|
+
|
|
408
|
+
`useToonAction()` does NOT dispatch actions by itself.
|
|
409
|
+
|
|
410
|
+
It currently exposes formatter helpers only.
|
|
411
|
+
|
|
412
|
+
---
|
|
413
|
+
|
|
414
|
+
## Preset
|
|
415
|
+
|
|
416
|
+
## `basicPreset()`
|
|
417
|
+
|
|
418
|
+
Returns the built-in neutral React component registry.
|
|
419
|
+
|
|
420
|
+
It includes default implementations for:
|
|
421
|
+
|
|
422
|
+
- `text`
|
|
423
|
+
- `badge`
|
|
424
|
+
- `button`
|
|
425
|
+
- `field`
|
|
426
|
+
- `card`
|
|
427
|
+
- `confirm`
|
|
428
|
+
- `form`
|
|
429
|
+
- `item`
|
|
430
|
+
- `list`
|
|
431
|
+
- `alert`
|
|
432
|
+
- `table`
|
|
433
|
+
|
|
434
|
+
### Use it when
|
|
435
|
+
|
|
436
|
+
- you want a working default UI immediately
|
|
437
|
+
- you want to override only some components
|
|
438
|
+
|
|
439
|
+
### Example
|
|
440
|
+
|
|
441
|
+
```tsx
|
|
442
|
+
import { basicPreset, createToonReactRuntime } from '@toon-ui/react';
|
|
115
443
|
|
|
116
444
|
const runtime = createToonReactRuntime({
|
|
117
445
|
components: {
|
|
118
446
|
...basicPreset(),
|
|
119
|
-
button:
|
|
120
|
-
field:
|
|
447
|
+
button: MyButton,
|
|
448
|
+
field: MyField,
|
|
121
449
|
},
|
|
122
450
|
});
|
|
123
|
-
|
|
124
|
-
export function AssistantMessage({ content }: { content: string }) {
|
|
125
|
-
return <ToonMessage content={content} runtime={runtime} />;
|
|
126
|
-
}
|
|
127
451
|
```
|
|
128
452
|
|
|
453
|
+
### What it is NOT
|
|
454
|
+
|
|
455
|
+
It is NOT a full design system.
|
|
456
|
+
|
|
457
|
+
It is a functional baseline so ToonUI works out of the box.
|
|
458
|
+
|
|
129
459
|
---
|
|
130
460
|
|
|
131
|
-
## Full
|
|
461
|
+
## Full custom registry example
|
|
132
462
|
|
|
133
463
|
```tsx
|
|
134
|
-
import { useState } from 'react';
|
|
135
464
|
import {
|
|
136
465
|
ToonMessage,
|
|
137
466
|
basicPreset,
|
|
138
467
|
createToonReactRuntime,
|
|
139
468
|
} from '@toon-ui/react';
|
|
140
469
|
|
|
470
|
+
function AppButton({ node, sendReply, submitForm }: any) {
|
|
471
|
+
return (
|
|
472
|
+
<button
|
|
473
|
+
className="rounded-md border px-3 py-2"
|
|
474
|
+
onClick={() =>
|
|
475
|
+
node.action.kind === 'reply'
|
|
476
|
+
? sendReply(node.action.value)
|
|
477
|
+
: submitForm()
|
|
478
|
+
}
|
|
479
|
+
>
|
|
480
|
+
{node.label}
|
|
481
|
+
</button>
|
|
482
|
+
);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
function AppField({ node, value, onChange }: any) {
|
|
486
|
+
return (
|
|
487
|
+
<label className="grid gap-2">
|
|
488
|
+
<span>{node.label}</span>
|
|
489
|
+
<input
|
|
490
|
+
value={value ?? ''}
|
|
491
|
+
onChange={(event) => onChange(event.currentTarget.value)}
|
|
492
|
+
/>
|
|
493
|
+
</label>
|
|
494
|
+
);
|
|
495
|
+
}
|
|
496
|
+
|
|
141
497
|
const runtime = createToonReactRuntime({
|
|
142
498
|
components: {
|
|
143
499
|
...basicPreset(),
|
|
500
|
+
button: AppButton,
|
|
501
|
+
field: AppField,
|
|
144
502
|
},
|
|
145
503
|
});
|
|
146
504
|
|
|
147
|
-
export function
|
|
148
|
-
const [events, setEvents] = useState<string[]>([]);
|
|
149
|
-
|
|
505
|
+
export function AssistantMessage({ content }: { content: string }) {
|
|
150
506
|
return (
|
|
151
|
-
<
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
const message = runtime.createChatMessage(payload);
|
|
164
|
-
setEvents((current) => [...current, message.content]);
|
|
165
|
-
}}
|
|
166
|
-
onSubmit={(payload) => {
|
|
167
|
-
const message = runtime.createChatMessage(payload);
|
|
168
|
-
setEvents((current) => [...current, message.content]);
|
|
169
|
-
}}
|
|
170
|
-
/>
|
|
171
|
-
|
|
172
|
-
<pre>{events.join('\\n\\n')}</pre>
|
|
173
|
-
</div>
|
|
507
|
+
<ToonMessage
|
|
508
|
+
content={content}
|
|
509
|
+
runtime={runtime}
|
|
510
|
+
onReply={(payload) => {
|
|
511
|
+
const message = runtime.createChatMessage(payload);
|
|
512
|
+
console.log(message);
|
|
513
|
+
}}
|
|
514
|
+
onSubmit={(payload) => {
|
|
515
|
+
const message = runtime.createChatMessage(payload);
|
|
516
|
+
console.log(message);
|
|
517
|
+
}}
|
|
518
|
+
/>
|
|
174
519
|
);
|
|
175
520
|
}
|
|
176
521
|
```
|
|
177
522
|
|
|
178
523
|
---
|
|
179
524
|
|
|
180
|
-
## When to prefer `@toon-ui/toon-ui`
|
|
181
|
-
|
|
182
|
-
Choose `@toon-ui/toon-ui` instead if you want:
|
|
183
|
-
|
|
184
|
-
- a built-in preset automatically merged
|
|
185
|
-
- a simpler public entrypoint
|
|
186
|
-
- fewer imports
|
|
187
|
-
|
|
188
|
-
Choose `@toon-ui/react` if you want:
|
|
189
|
-
|
|
190
|
-
- explicit runtime construction
|
|
191
|
-
- full control over the registry
|
|
192
|
-
- to avoid the convenience layer
|
|
193
|
-
|
|
194
|
-
---
|
|
195
|
-
|
|
196
525
|
## Boundary
|
|
197
526
|
|
|
198
527
|
`@toon-ui/react` owns:
|
|
199
528
|
|
|
200
|
-
- AST traversal
|
|
201
|
-
-
|
|
202
|
-
- React event surfacing
|
|
529
|
+
- AST traversal into React nodes
|
|
530
|
+
- registry-based rendering
|
|
203
531
|
- form state handling
|
|
532
|
+
- interaction surfacing in React
|
|
204
533
|
|
|
205
534
|
It does NOT own:
|
|
206
535
|
|
|
207
536
|
- server prompts
|
|
208
|
-
- tools
|
|
537
|
+
- backend tools
|
|
209
538
|
- persistence
|
|
210
539
|
- model orchestration
|
|
211
|
-
-
|
|
540
|
+
- business actions
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toon-ui/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "React runtime and component registry for ToonUI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"toon-ui",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@toon-ui/core": "0.
|
|
37
|
+
"@toon-ui/core": "0.3.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"react": "^19.2.6"
|