@assistant-ui/mcp-docs-server 0.1.23 → 0.1.25
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/.docs/organized/code-examples/waterfall.md +5 -3
- package/.docs/organized/code-examples/with-a2a.md +676 -0
- package/.docs/organized/code-examples/with-ag-ui.md +7 -8
- package/.docs/organized/code-examples/with-ai-sdk-v6.md +28 -16
- package/.docs/organized/code-examples/with-artifacts.md +5 -5
- package/.docs/organized/code-examples/with-assistant-transport.md +3 -3
- package/.docs/organized/code-examples/with-chain-of-thought.md +34 -26
- package/.docs/organized/code-examples/with-cloud-standalone.md +10 -8
- package/.docs/organized/code-examples/with-cloud.md +5 -5
- package/.docs/organized/code-examples/with-custom-thread-list.md +7 -7
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +8 -8
- package/.docs/organized/code-examples/with-expo.md +571 -539
- package/.docs/organized/code-examples/with-external-store.md +3 -4
- package/.docs/organized/code-examples/with-ffmpeg.md +5 -5
- package/.docs/organized/code-examples/with-google-adk.md +353 -0
- package/.docs/organized/code-examples/with-heat-graph.md +304 -0
- package/.docs/organized/code-examples/with-langgraph.md +25 -23
- package/.docs/organized/code-examples/with-parent-id-grouping.md +4 -4
- package/.docs/organized/code-examples/with-react-hook-form.md +6 -9
- package/.docs/organized/code-examples/with-react-ink.md +265 -0
- package/.docs/organized/code-examples/with-react-router.md +10 -11
- package/.docs/organized/code-examples/with-store.md +29 -18
- package/.docs/organized/code-examples/with-tanstack.md +7 -7
- package/.docs/organized/code-examples/with-tap-runtime.md +6 -4
- package/.docs/raw/blog/2025-01-31-changelog/index.mdx +1 -1
- package/.docs/raw/blog/2026-03-launch-week/index.mdx +227 -0
- package/.docs/raw/docs/(docs)/architecture.mdx +1 -1
- package/.docs/raw/docs/(docs)/cli.mdx +14 -9
- package/.docs/raw/docs/(docs)/copilots/make-assistant-tool-ui.mdx +8 -3
- package/.docs/raw/docs/(docs)/copilots/make-assistant-tool.mdx +5 -1
- package/.docs/raw/docs/(docs)/copilots/{make-assistant-readable.mdx → make-assistant-visible.mdx} +14 -5
- package/.docs/raw/docs/(docs)/copilots/model-context.mdx +11 -11
- package/.docs/raw/docs/(docs)/copilots/motivation.mdx +2 -2
- package/.docs/raw/docs/(docs)/devtools.mdx +3 -2
- package/.docs/raw/docs/(docs)/guides/attachments.mdx +9 -11
- package/.docs/raw/docs/(docs)/guides/branching.mdx +11 -6
- package/.docs/raw/docs/(docs)/guides/chain-of-thought.mdx +18 -16
- package/.docs/raw/docs/(docs)/guides/context-api.mdx +81 -43
- package/.docs/raw/docs/(docs)/guides/dictation.mdx +5 -5
- package/.docs/raw/docs/(docs)/guides/editing.mdx +16 -7
- package/.docs/raw/docs/(docs)/guides/latex.mdx +3 -0
- package/.docs/raw/docs/(docs)/guides/message-timing.mdx +2 -1
- package/.docs/raw/docs/(docs)/guides/multi-agent.mdx +173 -0
- package/.docs/raw/docs/(docs)/guides/quoting.mdx +55 -206
- package/.docs/raw/docs/(docs)/guides/speech.mdx +1 -4
- package/.docs/raw/docs/(docs)/guides/suggestions.mdx +9 -15
- package/.docs/raw/docs/(docs)/guides/tool-ui.mdx +17 -7
- package/.docs/raw/docs/(docs)/guides/tools.mdx +24 -9
- package/.docs/raw/docs/(docs)/index.mdx +3 -3
- package/.docs/raw/docs/(docs)/installation.mdx +69 -46
- package/.docs/raw/docs/(reference)/api-reference/context-providers/text-message-part-provider.mdx +20 -6
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-data-stream.mdx +24 -4
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-hook-form.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/integrations/vercel-ai-sdk.mdx +20 -19
- package/.docs/raw/docs/(reference)/api-reference/overview.mdx +28 -53
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar.mdx +4 -4
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-modal.mdx +7 -1
- package/.docs/raw/docs/(reference)/api-reference/primitives/attachment.mdx +20 -14
- package/.docs/raw/docs/(reference)/api-reference/primitives/branch-picker.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +99 -45
- package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +52 -40
- package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +343 -23
- package/.docs/raw/docs/(reference)/api-reference/primitives/suggestion.mdx +4 -6
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item.mdx +4 -2
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list.mdx +3 -5
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +169 -22
- package/.docs/raw/docs/(reference)/api-reference/runtimes/assistant-runtime.mdx +14 -4
- package/.docs/raw/docs/(reference)/api-reference/runtimes/attachment-runtime.mdx +15 -26
- package/.docs/raw/docs/(reference)/api-reference/runtimes/composer-runtime.mdx +39 -21
- package/.docs/raw/docs/(reference)/api-reference/runtimes/message-part-runtime.mdx +33 -9
- package/.docs/raw/docs/(reference)/api-reference/runtimes/message-runtime.mdx +48 -21
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-item-runtime.mdx +36 -7
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-runtime.mdx +30 -10
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-runtime.mdx +12 -10
- package/.docs/raw/docs/(reference)/migrations/deprecation-policy.mdx +1 -1
- package/.docs/raw/docs/(reference)/migrations/react-langgraph-v0-7.mdx +9 -4
- package/.docs/raw/docs/(reference)/migrations/v0-11.mdx +7 -5
- package/.docs/raw/docs/(reference)/migrations/v0-12.mdx +9 -7
- package/.docs/raw/docs/(reference)/migrations/v0-14.mdx +159 -0
- package/.docs/raw/docs/(reference)/react-compatibility.mdx +5 -134
- package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +89 -7
- package/.docs/raw/docs/cloud/ai-sdk.mdx +19 -5
- package/.docs/raw/docs/cloud/langgraph.mdx +13 -3
- package/.docs/raw/docs/ink/adapters.mdx +41 -0
- package/.docs/raw/docs/ink/custom-backend.mdx +203 -0
- package/.docs/raw/docs/ink/hooks.mdx +448 -0
- package/.docs/raw/docs/ink/index.mdx +239 -0
- package/.docs/raw/docs/ink/migration.mdx +140 -0
- package/.docs/raw/docs/ink/primitives.mdx +699 -0
- package/.docs/raw/docs/react-native/adapters.mdx +63 -87
- package/.docs/raw/docs/react-native/custom-backend.mdx +11 -14
- package/.docs/raw/docs/react-native/hooks.mdx +214 -232
- package/.docs/raw/docs/react-native/index.mdx +118 -159
- package/.docs/raw/docs/react-native/migration.mdx +144 -0
- package/.docs/raw/docs/react-native/primitives.mdx +431 -302
- package/.docs/raw/docs/runtimes/a2a/index.mdx +294 -0
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +9 -9
- package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +14 -3
- package/.docs/raw/docs/runtimes/ai-sdk/v6.mdx +53 -0
- package/.docs/raw/docs/runtimes/assistant-transport.mdx +59 -25
- package/.docs/raw/docs/runtimes/custom/custom-thread-list.mdx +13 -6
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +138 -38
- package/.docs/raw/docs/runtimes/custom/local.mdx +184 -42
- package/.docs/raw/docs/runtimes/data-stream.mdx +92 -19
- package/.docs/raw/docs/runtimes/google-adk/index.mdx +624 -0
- package/.docs/raw/docs/runtimes/helicone.mdx +6 -6
- package/.docs/raw/docs/runtimes/langgraph/index.mdx +38 -27
- package/.docs/raw/docs/runtimes/langgraph/tutorial/introduction.mdx +1 -1
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +15 -20
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +7 -11
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +8 -11
- package/.docs/raw/docs/runtimes/langserve.mdx +6 -7
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +18 -3
- package/.docs/raw/docs/ui/context-display.mdx +147 -0
- package/.docs/raw/docs/ui/file.mdx +5 -4
- package/.docs/raw/docs/ui/image.mdx +5 -4
- package/.docs/raw/docs/ui/markdown.mdx +3 -1
- package/.docs/raw/docs/ui/model-selector.mdx +8 -8
- package/.docs/raw/docs/ui/part-grouping.mdx +7 -10
- package/.docs/raw/docs/ui/quote.mdx +210 -0
- package/.docs/raw/docs/ui/reasoning.mdx +12 -11
- package/.docs/raw/docs/ui/sources.mdx +88 -17
- package/.docs/raw/docs/ui/streamdown.mdx +16 -7
- package/.docs/raw/docs/ui/thread-list.mdx +11 -13
- package/.docs/raw/docs/ui/thread.mdx +28 -33
- package/.docs/raw/docs/ui/tool-fallback.mdx +5 -6
- package/.docs/raw/docs/ui/tool-group.mdx +9 -8
- package/.docs/raw/docs/utilities/heat-graph.mdx +236 -0
- package/.docs/raw/docs/utilities/tw-shimmer.mdx +211 -0
- package/package.json +4 -4
- package/.docs/raw/docs/(reference)/legacy/styled/assistant-modal.mdx +0 -77
- package/.docs/raw/docs/(reference)/legacy/styled/decomposition.mdx +0 -635
- package/.docs/raw/docs/(reference)/legacy/styled/markdown.mdx +0 -77
- package/.docs/raw/docs/(reference)/legacy/styled/scrollbar.mdx +0 -72
- package/.docs/raw/docs/(reference)/legacy/styled/thread-width.mdx +0 -22
- package/.docs/raw/docs/(reference)/legacy/styled/thread.mdx +0 -77
- /package/.docs/raw/docs/cloud/{overview.mdx → index.mdx} +0 -0
|
@@ -16,10 +16,6 @@ export const contextColors = {
|
|
|
16
16
|
"ThreadListItem Context": "#c678dd",
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
<Callout title="Work in progress" type="warn">
|
|
20
|
-
This page is under construction. Most links will not work yet.
|
|
21
|
-
</Callout>
|
|
22
|
-
|
|
23
19
|
## Cloud
|
|
24
20
|
|
|
25
21
|
- [`AssistantCloud`](#assistant-cloud)
|
|
@@ -93,7 +89,7 @@ export const contextColors = {
|
|
|
93
89
|
link: "#composer-context",
|
|
94
90
|
},
|
|
95
91
|
]}
|
|
96
|
-
docsLink="./context-providers/
|
|
92
|
+
docsLink="./context-providers/assistant-runtime-provider"
|
|
97
93
|
tooltip="Provides the highest level context for the assistant-ui"
|
|
98
94
|
props="runtime={runtime}"
|
|
99
95
|
>
|
|
@@ -111,7 +107,7 @@ export const contextColors = {
|
|
|
111
107
|
link: "#MessagePart-context",
|
|
112
108
|
},
|
|
113
109
|
]}
|
|
114
|
-
docsLink="./context-providers/
|
|
110
|
+
docsLink="./context-providers/text-message-part-provider"
|
|
115
111
|
tooltip="Provides context for text message parts"
|
|
116
112
|
props="text={text}"
|
|
117
113
|
>
|
|
@@ -126,9 +122,7 @@ The context available to components inside `<AssistantRuntimeProvider />`. You u
|
|
|
126
122
|
|
|
127
123
|
### AssistantRuntime
|
|
128
124
|
|
|
129
|
-
Programmatically access the assistant's state and actions
|
|
130
|
-
|
|
131
|
-
- [`useAssistantRuntime`](#use-assistant-runtime)
|
|
125
|
+
Programmatically access the assistant's state and actions via `useAui()`.
|
|
132
126
|
|
|
133
127
|
### Instructions
|
|
134
128
|
|
|
@@ -145,10 +139,7 @@ Register tool UIs
|
|
|
145
139
|
- [`useAssistantTool`](#use-assistant-tool)
|
|
146
140
|
- [`useAssistantToolUI`](#use-assistant-tool-ui)
|
|
147
141
|
|
|
148
|
-
Programmatically access the list of registered tool UIs (
|
|
149
|
-
|
|
150
|
-
- [`useToolUIs`](#use-tool-uis)
|
|
151
|
-
- [`useToolUIsStore`](#use-tool-uis-store)
|
|
142
|
+
Programmatically access the list of registered tool UIs via `useAuiState((s) => s.tools)` and `useAui().tools()`.
|
|
152
143
|
|
|
153
144
|
### ThreadListPrimitive
|
|
154
145
|
|
|
@@ -191,13 +182,13 @@ The context for a single thread. Currently always corresponds to the runtime's m
|
|
|
191
182
|
|
|
192
183
|
Programmatically access the thread's state and actions.
|
|
193
184
|
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
-
|
|
185
|
+
- State: `useAuiState((s) => s.thread)`
|
|
186
|
+
- Actions: `useAui().thread()`
|
|
187
|
+
- Composer: `useAuiState((s) => s.composer)`
|
|
197
188
|
|
|
198
189
|
### ModelContext
|
|
199
190
|
|
|
200
|
-
-
|
|
191
|
+
- `useAui().thread().getModelContext()`
|
|
201
192
|
|
|
202
193
|
### ThreadViewportStore
|
|
203
194
|
|
|
@@ -239,11 +230,6 @@ A conversation thread.
|
|
|
239
230
|
docsLink="#thread-primitive-scroll-to-bottom"
|
|
240
231
|
tooltip="Scrolls to the bottom of the thread"
|
|
241
232
|
/>
|
|
242
|
-
<Component
|
|
243
|
-
name="ThreadPrimitive.Empty"
|
|
244
|
-
docsLink="#thread-primitive-empty"
|
|
245
|
-
tooltip="Displayed when the thread is empty"
|
|
246
|
-
/>
|
|
247
233
|
<Component
|
|
248
234
|
name="AuiIf"
|
|
249
235
|
docsLink="#assistant-if"
|
|
@@ -294,8 +280,8 @@ Manages the state and actions for the message composer
|
|
|
294
280
|
|
|
295
281
|
### ComposerRuntime
|
|
296
282
|
|
|
297
|
-
-
|
|
298
|
-
-
|
|
283
|
+
- State: `useAuiState((s) => s.composer)`
|
|
284
|
+
- Actions: `useAui().composer()`
|
|
299
285
|
|
|
300
286
|
### ComposerPrimitive
|
|
301
287
|
|
|
@@ -348,14 +334,10 @@ Manages the state and actions for individual messages
|
|
|
348
334
|
|
|
349
335
|
### MessageRuntime
|
|
350
336
|
|
|
351
|
-
-
|
|
352
|
-
-
|
|
353
|
-
-
|
|
354
|
-
|
|
355
|
-
### MessageUtilsStore
|
|
356
|
-
|
|
357
|
-
- [`useMessageUtils`](#use-message-utils)
|
|
358
|
-
- [`useMessageUtilsStore`](#use-message-utils-store)
|
|
337
|
+
- State: `useAuiState((s) => s.message)`
|
|
338
|
+
- Edit Composer: `useAuiState((s) => s.message.composer)`
|
|
339
|
+
- Actions: `useAui().message()`
|
|
340
|
+
- Utilities: `useAuiState((s) => s.message.isCopied)` / `useAuiState((s) => s.message.isHovering)`
|
|
359
341
|
|
|
360
342
|
### MessagePrimitive
|
|
361
343
|
|
|
@@ -473,10 +455,8 @@ Manages the state and actions for message parts within messages
|
|
|
473
455
|
|
|
474
456
|
### MessagePartRuntime
|
|
475
457
|
|
|
476
|
-
-
|
|
477
|
-
-
|
|
478
|
-
- [`useMessagePartReasoning`](#use-content-part-reasoning)
|
|
479
|
-
- [`useMessagePartRuntime`](#use-content-part-runtime)
|
|
458
|
+
- State: `useAuiState((s) => s.part)`
|
|
459
|
+
- Actions: `useAui().part()`
|
|
480
460
|
|
|
481
461
|
### MessagePartPrimitive
|
|
482
462
|
|
|
@@ -504,8 +484,8 @@ Manages the state and actions for attachments in messages and composer
|
|
|
504
484
|
|
|
505
485
|
### AttachmentRuntime
|
|
506
486
|
|
|
507
|
-
-
|
|
508
|
-
-
|
|
487
|
+
- State: `useAuiState((s) => s.attachment)`
|
|
488
|
+
- Actions: `useAui().attachment()`
|
|
509
489
|
|
|
510
490
|
### AttachmentPrimitive
|
|
511
491
|
|
|
@@ -520,12 +500,12 @@ Manages the state and actions for attachments in messages and composer
|
|
|
520
500
|
tooltip="Displays the name of the attachment"
|
|
521
501
|
/>
|
|
522
502
|
<Component
|
|
523
|
-
name="AttachmentPrimitive.
|
|
524
|
-
docsLink="#attachment-primitive-
|
|
525
|
-
tooltip="
|
|
503
|
+
name="AttachmentPrimitive.Remove"
|
|
504
|
+
docsLink="#attachment-primitive-remove"
|
|
505
|
+
tooltip="Removes the attachment"
|
|
526
506
|
/>
|
|
527
507
|
<Component
|
|
528
|
-
name="AttachmentPrimitive.
|
|
508
|
+
name="AttachmentPrimitive.unstable_Thumb"
|
|
529
509
|
docsLink="#attachment-primitive-thumb"
|
|
530
510
|
tooltip="Displays a thumbnail of the attachment"
|
|
531
511
|
/>
|
|
@@ -541,8 +521,8 @@ Manages the state and actions for individual thread list items
|
|
|
541
521
|
|
|
542
522
|
### ThreadListItemRuntime
|
|
543
523
|
|
|
544
|
-
-
|
|
545
|
-
-
|
|
524
|
+
- State: `useAuiState((s) => s.threadListItem)`
|
|
525
|
+
- Actions: `useAui().threadListItem()`
|
|
546
526
|
|
|
547
527
|
### ThreadListItem
|
|
548
528
|
|
|
@@ -557,9 +537,9 @@ Manages the state and actions for individual thread list items
|
|
|
557
537
|
tooltip="Trigger for thread list item actions"
|
|
558
538
|
>
|
|
559
539
|
<Component
|
|
560
|
-
name="ThreadListItemPrimitive.
|
|
561
|
-
docsLink="#thread-list-item-primitive-
|
|
562
|
-
tooltip="Displays the
|
|
540
|
+
name="ThreadListItemPrimitive.Title"
|
|
541
|
+
docsLink="#thread-list-item-primitive-title"
|
|
542
|
+
tooltip="Displays the title of the thread"
|
|
563
543
|
/>
|
|
564
544
|
</Component>
|
|
565
545
|
<Component
|
|
@@ -577,16 +557,11 @@ Manages the state and actions for individual thread list items
|
|
|
577
557
|
docsLink="#thread-list-item-primitive-delete"
|
|
578
558
|
tooltip="Deletes the thread"
|
|
579
559
|
/>
|
|
580
|
-
<Component
|
|
581
|
-
name="ThreadListItemPrimitive.Rename"
|
|
582
|
-
docsLink="#thread-list-item-primitive-rename"
|
|
583
|
-
tooltip="Renames the thread"
|
|
584
|
-
/>
|
|
585
560
|
</Component>
|
|
586
561
|
|
|
587
562
|
</ContextLevel>
|
|
588
563
|
|
|
589
564
|
## Utilities
|
|
590
565
|
|
|
591
|
-
- [`
|
|
566
|
+
- [`useThreadViewportAutoScroll`](#use-thread-viewport-autoscroll)
|
|
592
567
|
- [`useInlineRender`](#use-inline-render)
|
|
@@ -28,9 +28,9 @@ const AssistantMessageBar = () => (
|
|
|
28
28
|
|
|
29
29
|
## API Reference
|
|
30
30
|
|
|
31
|
-
###
|
|
31
|
+
### Root
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
Contains all parts of the action bar.
|
|
34
34
|
|
|
35
35
|
This primitive renders a `<div>` element unless `asChild` is set.
|
|
36
36
|
|
|
@@ -62,7 +62,7 @@ This primitive renders a `<div>` element unless `asChild` is set.
|
|
|
62
62
|
<br />
|
|
63
63
|
<Code>"always"</Code>: always autohide.
|
|
64
64
|
<br />
|
|
65
|
-
<Code>"not-last"</Code
|
|
65
|
+
<Code>"not-last"</Code>: only autohide if the message is not the last
|
|
66
66
|
one in the thread.
|
|
67
67
|
</span>
|
|
68
68
|
),
|
|
@@ -122,7 +122,7 @@ This primitive renders a `<button>` element unless `asChild` is set.
|
|
|
122
122
|
name: "asChild",
|
|
123
123
|
},
|
|
124
124
|
]}
|
|
125
|
-
/>
|
|
125
|
+
/>
|
|
126
126
|
|
|
127
127
|
### Copy
|
|
128
128
|
|
|
@@ -11,7 +11,7 @@ A modal chat UI usually displayed in the bottom right corner of the screen.
|
|
|
11
11
|
```tsx
|
|
12
12
|
import { AssistantModalPrimitive } from "@assistant-ui/react";
|
|
13
13
|
|
|
14
|
-
const
|
|
14
|
+
const AssistantModal = () => (
|
|
15
15
|
<AssistantModalPrimitive.Root>
|
|
16
16
|
<AssistantModalPrimitive.Trigger>
|
|
17
17
|
<FloatingAssistantButton />
|
|
@@ -117,6 +117,12 @@ This primitive renders a `<div>` element unless `asChild` is set.
|
|
|
117
117
|
description:
|
|
118
118
|
"Dismiss the assistant modal when the user interacts outside of it.",
|
|
119
119
|
},
|
|
120
|
+
{
|
|
121
|
+
name: "portalProps",
|
|
122
|
+
type: "{ container?: HTMLElement | null; forceMount?: true }",
|
|
123
|
+
description:
|
|
124
|
+
"Props to pass to the underlying Radix UI Popover.Portal. Use container to render the modal into a specific DOM node, or forceMount to keep it mounted for animation control.",
|
|
125
|
+
},
|
|
120
126
|
]}
|
|
121
127
|
/>
|
|
122
128
|
|
|
@@ -17,14 +17,14 @@ import { AttachmentPrimitive } from "@assistant-ui/react";
|
|
|
17
17
|
|
|
18
18
|
const MyMessageAttachment = () => (
|
|
19
19
|
<AttachmentPrimitive.Root>
|
|
20
|
-
<AttachmentPrimitive.
|
|
20
|
+
<AttachmentPrimitive.unstable_Thumb />
|
|
21
21
|
<AttachmentPrimitive.Name />
|
|
22
22
|
</AttachmentPrimitive.Root>
|
|
23
23
|
);
|
|
24
24
|
|
|
25
25
|
const MyComposerAttachment = () => (
|
|
26
26
|
<AttachmentPrimitive.Root>
|
|
27
|
-
<AttachmentPrimitive.
|
|
27
|
+
<AttachmentPrimitive.unstable_Thumb />
|
|
28
28
|
<AttachmentPrimitive.Name />
|
|
29
29
|
<AttachmentPrimitive.Remove />
|
|
30
30
|
</AttachmentPrimitive.Root>
|
|
@@ -33,11 +33,11 @@ const MyComposerAttachment = () => (
|
|
|
33
33
|
|
|
34
34
|
## API Reference
|
|
35
35
|
|
|
36
|
-
###
|
|
36
|
+
### Root
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
Contains all parts of the attachment.
|
|
39
39
|
|
|
40
|
-
This primitive renders a `<div>` element unless `asChild` is set.
|
|
40
|
+
This primitive renders a `<div>` element unless `asChild` is set. Accepts all standard HTML div element props.
|
|
41
41
|
|
|
42
42
|
<ParametersTable
|
|
43
43
|
type="AttachmentPrimitiveRootProps"
|
|
@@ -45,21 +45,31 @@ This primitive renders a `<div>` element unless `asChild` is set.
|
|
|
45
45
|
{
|
|
46
46
|
name: "asChild",
|
|
47
47
|
},
|
|
48
|
+
{
|
|
49
|
+
name: "...props",
|
|
50
|
+
type: "HTMLAttributes<HTMLDivElement>",
|
|
51
|
+
description: "All standard div element props are forwarded to the underlying element.",
|
|
52
|
+
},
|
|
48
53
|
]}
|
|
49
54
|
/>
|
|
50
55
|
|
|
51
|
-
###
|
|
56
|
+
### unstable_Thumb
|
|
52
57
|
|
|
53
58
|
The thumbnail of the attachment.
|
|
54
59
|
|
|
55
|
-
This primitive renders a `<div>` element unless `asChild` is set.
|
|
60
|
+
This primitive renders a `<div>` element unless `asChild` is set. Accepts all standard HTML div element props.
|
|
56
61
|
|
|
57
62
|
<ParametersTable
|
|
58
|
-
type="
|
|
63
|
+
type="AttachmentPrimitiveThumbProps"
|
|
59
64
|
parameters={[
|
|
60
65
|
{
|
|
61
66
|
name: "asChild",
|
|
62
67
|
},
|
|
68
|
+
{
|
|
69
|
+
name: "...props",
|
|
70
|
+
type: "HTMLAttributes<HTMLDivElement>",
|
|
71
|
+
description: "All standard div element props are forwarded to the underlying element.",
|
|
72
|
+
},
|
|
63
73
|
]}
|
|
64
74
|
/>
|
|
65
75
|
|
|
@@ -67,15 +77,11 @@ This primitive renders a `<div>` element unless `asChild` is set.
|
|
|
67
77
|
|
|
68
78
|
The name of the attachment.
|
|
69
79
|
|
|
70
|
-
This primitive renders a
|
|
80
|
+
This primitive renders a text node with the attachment's file name. It accepts no props.
|
|
71
81
|
|
|
72
82
|
<ParametersTable
|
|
73
83
|
type="AttachmentPrimitiveNameProps"
|
|
74
|
-
parameters={[
|
|
75
|
-
{
|
|
76
|
-
name: "asChild",
|
|
77
|
-
},
|
|
78
|
-
]}
|
|
84
|
+
parameters={[]}
|
|
79
85
|
/>
|
|
80
86
|
|
|
81
87
|
### Remove
|
|
@@ -20,14 +20,16 @@ import { ComposerPrimitive } from "@assistant-ui/react";
|
|
|
20
20
|
// creating a new message
|
|
21
21
|
const Composer = () => (
|
|
22
22
|
<ComposerPrimitive.Root>
|
|
23
|
-
<ComposerPrimitive.
|
|
24
|
-
<ComposerPrimitive.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
<ComposerPrimitive.AttachmentDropzone>
|
|
24
|
+
<ComposerPrimitive.Quote>
|
|
25
|
+
<ComposerPrimitive.QuoteText />
|
|
26
|
+
<ComposerPrimitive.QuoteDismiss />
|
|
27
|
+
</ComposerPrimitive.Quote>
|
|
28
|
+
<ComposerPrimitive.Attachments />
|
|
29
|
+
<ComposerPrimitive.AddAttachment />
|
|
30
|
+
<ComposerPrimitive.Input />
|
|
31
|
+
<ComposerPrimitive.Send />
|
|
32
|
+
</ComposerPrimitive.AttachmentDropzone>
|
|
31
33
|
</ComposerPrimitive.Root>
|
|
32
34
|
);
|
|
33
35
|
|
|
@@ -44,12 +46,12 @@ const EditComposer = () => (
|
|
|
44
46
|
const ComposerWithDictation = () => (
|
|
45
47
|
<ComposerPrimitive.Root>
|
|
46
48
|
<ComposerPrimitive.Input />
|
|
47
|
-
<
|
|
49
|
+
<AuiIf condition={(s) => s.composer.dictation == null}>
|
|
48
50
|
<ComposerPrimitive.Dictate />
|
|
49
|
-
</
|
|
50
|
-
<
|
|
51
|
+
</AuiIf>
|
|
52
|
+
<AuiIf condition={(s) => s.composer.dictation != null}>
|
|
51
53
|
<ComposerPrimitive.StopDictation />
|
|
52
|
-
</
|
|
54
|
+
</AuiIf>
|
|
53
55
|
<ComposerPrimitive.Send />
|
|
54
56
|
</ComposerPrimitive.Root>
|
|
55
57
|
);
|
|
@@ -59,7 +61,7 @@ const ComposerWithDictation = () => (
|
|
|
59
61
|
|
|
60
62
|
### Root
|
|
61
63
|
|
|
62
|
-
|
|
64
|
+
Contains all parts of the composer.
|
|
63
65
|
|
|
64
66
|
This primitive renders a `<form>` element unless `asChild` is set.
|
|
65
67
|
|
|
@@ -91,6 +93,41 @@ This primitive renders a `<textarea>` element unless `asChild` is set.
|
|
|
91
93
|
description:
|
|
92
94
|
'Controls how the Enter key submits messages. "enter": plain Enter submits (Shift+Enter for newline). "ctrlEnter": Ctrl/Cmd+Enter submits (plain Enter for newline). "none": keyboard submission disabled.',
|
|
93
95
|
},
|
|
96
|
+
{
|
|
97
|
+
name: "cancelOnEscape",
|
|
98
|
+
type: "boolean",
|
|
99
|
+
default: "true",
|
|
100
|
+
description:
|
|
101
|
+
"Whether to cancel message composition when Escape is pressed.",
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: "unstable_focusOnRunStart",
|
|
105
|
+
type: "boolean",
|
|
106
|
+
default: "true",
|
|
107
|
+
description:
|
|
108
|
+
"Whether to automatically focus the input when a new run starts.",
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "unstable_focusOnScrollToBottom",
|
|
112
|
+
type: "boolean",
|
|
113
|
+
default: "true",
|
|
114
|
+
description:
|
|
115
|
+
"Whether to automatically focus the input when scrolling to bottom.",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "unstable_focusOnThreadSwitched",
|
|
119
|
+
type: "boolean",
|
|
120
|
+
default: "true",
|
|
121
|
+
description:
|
|
122
|
+
"Whether to automatically focus the input when switching threads.",
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "addAttachmentOnPaste",
|
|
126
|
+
type: "boolean",
|
|
127
|
+
default: "true",
|
|
128
|
+
description:
|
|
129
|
+
"Whether to automatically add pasted files as attachments.",
|
|
130
|
+
},
|
|
94
131
|
]}
|
|
95
132
|
/>
|
|
96
133
|
|
|
@@ -124,12 +161,6 @@ This primitive renders a `<button>` element unless `asChild` is set.
|
|
|
124
161
|
{
|
|
125
162
|
name: "asChild",
|
|
126
163
|
},
|
|
127
|
-
{
|
|
128
|
-
name: "multiple",
|
|
129
|
-
type: "boolean | undefined",
|
|
130
|
-
description: "Allow selecting multiple attachments at the same time.",
|
|
131
|
-
default: "true",
|
|
132
|
-
},
|
|
133
164
|
]}
|
|
134
165
|
/>
|
|
135
166
|
|
|
@@ -183,9 +214,9 @@ Renders attachments. This primitive renders a separate component for each attach
|
|
|
183
214
|
description: "The component to render for each file attachment.",
|
|
184
215
|
},
|
|
185
216
|
{
|
|
186
|
-
name: "
|
|
217
|
+
name: "Attachment",
|
|
187
218
|
type: "ComponentType",
|
|
188
|
-
description: "The component to render for each attachment type.",
|
|
219
|
+
description: "The fallback component to render for each attachment type.",
|
|
189
220
|
},
|
|
190
221
|
],
|
|
191
222
|
},
|
|
@@ -237,6 +268,41 @@ This primitive renders a `<button>` element unless `asChild` is set.
|
|
|
237
268
|
{
|
|
238
269
|
name: "asChild",
|
|
239
270
|
},
|
|
271
|
+
{
|
|
272
|
+
name: "multiple",
|
|
273
|
+
type: "boolean | undefined",
|
|
274
|
+
description: "Allow selecting multiple attachments at the same time.",
|
|
275
|
+
default: "true",
|
|
276
|
+
},
|
|
277
|
+
]}
|
|
278
|
+
/>
|
|
279
|
+
|
|
280
|
+
### AttachmentDropzone
|
|
281
|
+
|
|
282
|
+
A drag-and-drop zone that accepts file drops and adds them as attachments to the composer.
|
|
283
|
+
|
|
284
|
+
When a file is dragged over the zone, a `data-dragging="true"` attribute is set on the element, which can be used for styling the active drag state.
|
|
285
|
+
|
|
286
|
+
This primitive renders a `<div>` element unless `asChild` is set.
|
|
287
|
+
|
|
288
|
+
```tsx
|
|
289
|
+
<ComposerPrimitive.AttachmentDropzone className="relative data-[dragging]:ring-2">
|
|
290
|
+
<ComposerPrimitive.Input />
|
|
291
|
+
<ComposerPrimitive.Send />
|
|
292
|
+
</ComposerPrimitive.AttachmentDropzone>
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
<ParametersTable
|
|
296
|
+
type="ComposerPrimitiveAttachmentDropzoneProps"
|
|
297
|
+
parameters={[
|
|
298
|
+
{
|
|
299
|
+
name: "asChild",
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
name: "disabled",
|
|
303
|
+
type: "boolean | undefined",
|
|
304
|
+
description: "When true, drag-and-drop is disabled and files will not be added on drop.",
|
|
305
|
+
},
|
|
240
306
|
]}
|
|
241
307
|
/>
|
|
242
308
|
|
|
@@ -289,11 +355,11 @@ This primitive renders a `<span>` element.
|
|
|
289
355
|
|
|
290
356
|
```tsx
|
|
291
357
|
{/* Optional: Display interim transcript separately with custom styling */}
|
|
292
|
-
<
|
|
358
|
+
<AuiIf condition={(s) => s.composer.dictation != null}>
|
|
293
359
|
<div className="dictation-preview">
|
|
294
360
|
<ComposerPrimitive.DictationTranscript className="italic text-muted" />
|
|
295
361
|
</div>
|
|
296
|
-
</
|
|
362
|
+
</AuiIf>
|
|
297
363
|
```
|
|
298
364
|
|
|
299
365
|
### Quote
|
|
@@ -334,30 +400,18 @@ This primitive renders a `<button>` element unless `asChild` is set.
|
|
|
334
400
|
See the [Quoting guide](/docs/guides/quoting) for a complete walkthrough including the floating selection toolbar and backend handling.
|
|
335
401
|
</Callout>
|
|
336
402
|
|
|
337
|
-
###
|
|
403
|
+
### Conditional Rendering
|
|
338
404
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
<ParametersTable
|
|
342
|
-
type="UseComposerIfProps"
|
|
343
|
-
parameters={[
|
|
344
|
-
{
|
|
345
|
-
name: "editing",
|
|
346
|
-
required: false,
|
|
347
|
-
type: "boolean | undefined",
|
|
348
|
-
description: "Render children if the message is being edited.",
|
|
349
|
-
},
|
|
350
|
-
{
|
|
351
|
-
name: "dictation",
|
|
352
|
-
required: false,
|
|
353
|
-
type: "boolean | undefined",
|
|
354
|
-
description: "Render children if dictation is active.",
|
|
355
|
-
},
|
|
356
|
-
]}
|
|
357
|
-
/>
|
|
405
|
+
Use `AuiIf` for conditional rendering based on composer state:
|
|
358
406
|
|
|
359
407
|
```tsx
|
|
360
|
-
|
|
408
|
+
import { AuiIf } from "@assistant-ui/react";
|
|
409
|
+
|
|
410
|
+
<AuiIf condition={(s) => s.composer.isEditing}>
|
|
411
|
+
{/* rendered if message is being edited */}
|
|
412
|
+
</AuiIf>
|
|
361
413
|
|
|
362
|
-
<
|
|
414
|
+
<AuiIf condition={(s) => s.composer.dictation != null}>
|
|
415
|
+
{/* rendered if dictation is active */}
|
|
416
|
+
</AuiIf>
|
|
363
417
|
```
|