@assistant-ui/mcp-docs-server 0.1.1
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/local-ollama.md +1135 -0
- package/.docs/organized/code-examples/search-agent-for-e-commerce.md +1721 -0
- package/.docs/organized/code-examples/with-ai-sdk.md +1081 -0
- package/.docs/organized/code-examples/with-cloud.md +1164 -0
- package/.docs/organized/code-examples/with-external-store.md +1064 -0
- package/.docs/organized/code-examples/with-ffmpeg.md +1305 -0
- package/.docs/organized/code-examples/with-langgraph.md +1819 -0
- package/.docs/organized/code-examples/with-openai-assistants.md +1175 -0
- package/.docs/organized/code-examples/with-react-hook-form.md +1727 -0
- package/.docs/organized/code-examples/with-vercel-ai-rsc.md +1157 -0
- package/.docs/raw/blog/2024-07-29-hello/index.mdx +65 -0
- package/.docs/raw/blog/2024-09-11/index.mdx +10 -0
- package/.docs/raw/blog/2024-12-15/index.mdx +10 -0
- package/.docs/raw/blog/2025-01-31-changelog/index.mdx +129 -0
- package/.docs/raw/docs/about-assistantui.mdx +44 -0
- package/.docs/raw/docs/api-reference/context-providers/AssistantRuntimeProvider.mdx +30 -0
- package/.docs/raw/docs/api-reference/context-providers/TextContentPartProvider.mdx +26 -0
- package/.docs/raw/docs/api-reference/integrations/react-hook-form.mdx +103 -0
- package/.docs/raw/docs/api-reference/integrations/vercel-ai-sdk.mdx +145 -0
- package/.docs/raw/docs/api-reference/overview.mdx +583 -0
- package/.docs/raw/docs/api-reference/primitives/ActionBar.mdx +264 -0
- package/.docs/raw/docs/api-reference/primitives/AssistantModal.mdx +129 -0
- package/.docs/raw/docs/api-reference/primitives/Attachment.mdx +96 -0
- package/.docs/raw/docs/api-reference/primitives/BranchPicker.mdx +87 -0
- package/.docs/raw/docs/api-reference/primitives/Composer.mdx +204 -0
- package/.docs/raw/docs/api-reference/primitives/ContentPart.mdx +173 -0
- package/.docs/raw/docs/api-reference/primitives/Error.mdx +70 -0
- package/.docs/raw/docs/api-reference/primitives/Message.mdx +181 -0
- package/.docs/raw/docs/api-reference/primitives/Thread.mdx +197 -0
- package/.docs/raw/docs/api-reference/primitives/composition.mdx +21 -0
- package/.docs/raw/docs/api-reference/runtimes/AssistantRuntime.mdx +33 -0
- package/.docs/raw/docs/api-reference/runtimes/AttachmentRuntime.mdx +46 -0
- package/.docs/raw/docs/api-reference/runtimes/ComposerRuntime.mdx +69 -0
- package/.docs/raw/docs/api-reference/runtimes/ContentPartRuntime.mdx +22 -0
- package/.docs/raw/docs/api-reference/runtimes/MessageRuntime.mdx +49 -0
- package/.docs/raw/docs/api-reference/runtimes/ThreadListItemRuntime.mdx +32 -0
- package/.docs/raw/docs/api-reference/runtimes/ThreadListRuntime.mdx +31 -0
- package/.docs/raw/docs/api-reference/runtimes/ThreadRuntime.mdx +48 -0
- package/.docs/raw/docs/architecture.mdx +92 -0
- package/.docs/raw/docs/cloud/authorization.mdx +152 -0
- package/.docs/raw/docs/cloud/overview.mdx +55 -0
- package/.docs/raw/docs/cloud/persistence/ai-sdk.mdx +54 -0
- package/.docs/raw/docs/cloud/persistence/langgraph.mdx +123 -0
- package/.docs/raw/docs/concepts/architecture.mdx +19 -0
- package/.docs/raw/docs/concepts/runtime-layer.mdx +163 -0
- package/.docs/raw/docs/concepts/why.mdx +9 -0
- package/.docs/raw/docs/copilots/make-assistant-readable.mdx +71 -0
- package/.docs/raw/docs/copilots/make-assistant-tool-ui.mdx +76 -0
- package/.docs/raw/docs/copilots/make-assistant-tool.mdx +117 -0
- package/.docs/raw/docs/copilots/model-context.mdx +135 -0
- package/.docs/raw/docs/copilots/motivation.mdx +191 -0
- package/.docs/raw/docs/copilots/use-assistant-instructions.mdx +62 -0
- package/.docs/raw/docs/getting-started.mdx +1133 -0
- package/.docs/raw/docs/guides/Attachments.mdx +640 -0
- package/.docs/raw/docs/guides/Branching.mdx +59 -0
- package/.docs/raw/docs/guides/Editing.mdx +56 -0
- package/.docs/raw/docs/guides/Speech.mdx +43 -0
- package/.docs/raw/docs/guides/ToolUI.mdx +663 -0
- package/.docs/raw/docs/guides/Tools.mdx +496 -0
- package/.docs/raw/docs/index.mdx +7 -0
- package/.docs/raw/docs/legacy/styled/AssistantModal.mdx +85 -0
- package/.docs/raw/docs/legacy/styled/Decomposition.mdx +633 -0
- package/.docs/raw/docs/legacy/styled/Markdown.mdx +86 -0
- package/.docs/raw/docs/legacy/styled/Scrollbar.mdx +71 -0
- package/.docs/raw/docs/legacy/styled/Thread.mdx +84 -0
- package/.docs/raw/docs/legacy/styled/ThreadWidth.mdx +21 -0
- package/.docs/raw/docs/mcp-docs-server.mdx +324 -0
- package/.docs/raw/docs/migrations/deprecation-policy.mdx +41 -0
- package/.docs/raw/docs/migrations/v0-7.mdx +188 -0
- package/.docs/raw/docs/migrations/v0-8.mdx +160 -0
- package/.docs/raw/docs/migrations/v0-9.mdx +75 -0
- package/.docs/raw/docs/react-compatibility.mdx +208 -0
- package/.docs/raw/docs/runtimes/ai-sdk/rsc.mdx +226 -0
- package/.docs/raw/docs/runtimes/ai-sdk/use-assistant-hook.mdx +195 -0
- package/.docs/raw/docs/runtimes/ai-sdk/use-chat-hook.mdx +138 -0
- package/.docs/raw/docs/runtimes/ai-sdk/use-chat.mdx +136 -0
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +1624 -0
- package/.docs/raw/docs/runtimes/custom/local.mdx +1185 -0
- package/.docs/raw/docs/runtimes/helicone.mdx +60 -0
- package/.docs/raw/docs/runtimes/langgraph/index.mdx +320 -0
- package/.docs/raw/docs/runtimes/langgraph/tutorial/index.mdx +11 -0
- package/.docs/raw/docs/runtimes/langgraph/tutorial/introduction.mdx +28 -0
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +120 -0
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +336 -0
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +385 -0
- package/.docs/raw/docs/runtimes/langserve.mdx +126 -0
- package/.docs/raw/docs/runtimes/mastra/full-stack-integration.mdx +218 -0
- package/.docs/raw/docs/runtimes/mastra/overview.mdx +17 -0
- package/.docs/raw/docs/runtimes/mastra/separate-server-integration.mdx +196 -0
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +222 -0
- package/.docs/raw/docs/ui/AssistantModal.mdx +46 -0
- package/.docs/raw/docs/ui/AssistantSidebar.mdx +42 -0
- package/.docs/raw/docs/ui/Attachment.mdx +82 -0
- package/.docs/raw/docs/ui/Markdown.mdx +72 -0
- package/.docs/raw/docs/ui/Mermaid.mdx +79 -0
- package/.docs/raw/docs/ui/Scrollbar.mdx +59 -0
- package/.docs/raw/docs/ui/SyntaxHighlighting.mdx +253 -0
- package/.docs/raw/docs/ui/Thread.mdx +47 -0
- package/.docs/raw/docs/ui/ThreadList.mdx +49 -0
- package/.docs/raw/docs/ui/ToolFallback.mdx +64 -0
- package/.docs/raw/docs/ui/primitives/Thread.mdx +197 -0
- package/LICENSE +21 -0
- package/README.md +128 -0
- package/dist/chunk-C7O7EFKU.js +38 -0
- package/dist/chunk-CZCDQ3YH.js +420 -0
- package/dist/index.js +1 -0
- package/dist/prepare-docs/prepare.js +199 -0
- package/dist/stdio.js +8 -0
- package/package.json +43 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ActionBarPrimitive
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Buttons to interact with the message.
|
|
6
|
+
|
|
7
|
+
import { ParametersTable, DataAttributesTable } from "@/components/docs";
|
|
8
|
+
import { Code } from "@radix-ui/themes";
|
|
9
|
+
|
|
10
|
+
## Anatomy
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
import { ActionBarPrimitive } from "@assistant-ui/react";
|
|
14
|
+
|
|
15
|
+
const UserMessageBar = () => (
|
|
16
|
+
<ActionBarPrimitive.Root>
|
|
17
|
+
<ActionBarPrimitive.Edit />
|
|
18
|
+
<ActionBarPrimitive.Copy />
|
|
19
|
+
</ActionBarPrimitive.Root>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const AssistantMessageBar = () => (
|
|
23
|
+
<ActionBarPrimitive.Root>
|
|
24
|
+
<ActionBarPrimitive.Reload />
|
|
25
|
+
<ActionBarPrimitive.Copy />
|
|
26
|
+
</ActionBarPrimitive.Root>
|
|
27
|
+
);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## API Reference
|
|
31
|
+
|
|
32
|
+
### Container
|
|
33
|
+
|
|
34
|
+
Containts all parts of the action bar.
|
|
35
|
+
|
|
36
|
+
This primitive renders a `<div>` element unless `asChild` is set.
|
|
37
|
+
|
|
38
|
+
<ParametersTable
|
|
39
|
+
type="ActionBarPrimitiveRootProps"
|
|
40
|
+
parameters={[
|
|
41
|
+
{
|
|
42
|
+
name: "asChild",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "hideWhenRunning",
|
|
46
|
+
type: "boolean",
|
|
47
|
+
default: "false",
|
|
48
|
+
description: (
|
|
49
|
+
<span>
|
|
50
|
+
Do not render the ActionBar when the thread is in running state.
|
|
51
|
+
</span>
|
|
52
|
+
),
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "autohide",
|
|
56
|
+
type: '"always" | "not-last" | "never"',
|
|
57
|
+
default: '"never"',
|
|
58
|
+
description: (
|
|
59
|
+
<span>
|
|
60
|
+
Do not render the ActionBar unless the mouse is hovering over the
|
|
61
|
+
message.
|
|
62
|
+
<br />
|
|
63
|
+
<br />
|
|
64
|
+
<Code>"always"</Code>: always autohide.
|
|
65
|
+
<br />
|
|
66
|
+
<Code>"not-last"</Code>; only autohide if the message is not the last
|
|
67
|
+
one in the thread.
|
|
68
|
+
</span>
|
|
69
|
+
),
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "autohideFloat",
|
|
73
|
+
type: '"always" | "single-branch" | "never"',
|
|
74
|
+
default: '"never"',
|
|
75
|
+
description: (
|
|
76
|
+
<span>
|
|
77
|
+
Float the ActionBar during autohide.
|
|
78
|
+
<br />
|
|
79
|
+
<br />
|
|
80
|
+
<Code>"always"</Code>: always float during autohide.
|
|
81
|
+
<br />
|
|
82
|
+
<Code>"single-branch"</Code>: only float if the message is the only
|
|
83
|
+
one in the thread.
|
|
84
|
+
<br />
|
|
85
|
+
<br />
|
|
86
|
+
Note: this only sets `data-floating` on the ActionBar. You need to set
|
|
87
|
+
the appropriate styles on the ActionBar to make it float.
|
|
88
|
+
</span>
|
|
89
|
+
),
|
|
90
|
+
},
|
|
91
|
+
]}
|
|
92
|
+
/>
|
|
93
|
+
|
|
94
|
+
<DataAttributesTable
|
|
95
|
+
data={[
|
|
96
|
+
{
|
|
97
|
+
attribute: "[data-floating]",
|
|
98
|
+
values: "Present when floating",
|
|
99
|
+
},
|
|
100
|
+
]}
|
|
101
|
+
/>
|
|
102
|
+
|
|
103
|
+
### Edit
|
|
104
|
+
|
|
105
|
+
Enables edit mode on user message.
|
|
106
|
+
|
|
107
|
+
This primitive renders a `<button>` element unless `asChild` is set.
|
|
108
|
+
|
|
109
|
+
<ParametersTable
|
|
110
|
+
type="ActionBarPrimitiveEditProps"
|
|
111
|
+
parameters={[
|
|
112
|
+
{
|
|
113
|
+
name: "asChild",
|
|
114
|
+
},
|
|
115
|
+
]}
|
|
116
|
+
/>
|
|
117
|
+
|
|
118
|
+
### Reload
|
|
119
|
+
|
|
120
|
+
Regenerates the assistant message.
|
|
121
|
+
|
|
122
|
+
This primitive renders a `<button>` element unless `asChild` is set.
|
|
123
|
+
|
|
124
|
+
<ParametersTable
|
|
125
|
+
type="ActionBarPrimitiveReloadProps"
|
|
126
|
+
parameters={[
|
|
127
|
+
{
|
|
128
|
+
name: "asChild",
|
|
129
|
+
},
|
|
130
|
+
]}
|
|
131
|
+
/>{" "}
|
|
132
|
+
|
|
133
|
+
### Copy
|
|
134
|
+
|
|
135
|
+
Copies the message to the clipboard.
|
|
136
|
+
|
|
137
|
+
This primitive renders a `<button>` element unless `asChild` is set.
|
|
138
|
+
|
|
139
|
+
<ParametersTable
|
|
140
|
+
type="ActionBarPrimitiveCopyProps"
|
|
141
|
+
parameters={[
|
|
142
|
+
{
|
|
143
|
+
name: "asChild",
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: "copiedDuration",
|
|
147
|
+
type: "number",
|
|
148
|
+
description:
|
|
149
|
+
"The duration in milliseconds to change the message status to 'copied'.",
|
|
150
|
+
default: "3000",
|
|
151
|
+
},
|
|
152
|
+
]}
|
|
153
|
+
/>
|
|
154
|
+
|
|
155
|
+
<DataAttributesTable
|
|
156
|
+
data={[
|
|
157
|
+
{
|
|
158
|
+
attribute: "[data-copied]",
|
|
159
|
+
values: "Present when the message was recently copied.",
|
|
160
|
+
},
|
|
161
|
+
]}
|
|
162
|
+
/>
|
|
163
|
+
|
|
164
|
+
#### Copied state
|
|
165
|
+
|
|
166
|
+
Show a different icon for a few seconds after the message is copied.
|
|
167
|
+
|
|
168
|
+
```tsx
|
|
169
|
+
<ActionBarPrimitive.Copy>
|
|
170
|
+
<MessagePrimitive.If copied={false}>
|
|
171
|
+
<CopyIcon />
|
|
172
|
+
</MessagePrimitive.If>
|
|
173
|
+
<MessagePrimitive.If copied>
|
|
174
|
+
<CopySuccessIcon />
|
|
175
|
+
</MessagePrimitive.If>
|
|
176
|
+
</ActionBarPrimitive.Copy>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
or using the `data-copied` attribute:
|
|
180
|
+
|
|
181
|
+
```tsx
|
|
182
|
+
<ActionBarPrimitive.Copy className="group">
|
|
183
|
+
<CopyIcon className="group-data-[copied]:hidden" />
|
|
184
|
+
<CheckIcon className="hidden group-data-[copied]:block" />
|
|
185
|
+
</ActionBarPrimitive.Copy>
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Speak
|
|
189
|
+
|
|
190
|
+
Plays the message text as speech.
|
|
191
|
+
|
|
192
|
+
This primitive renders a `<button>` element unless `asChild` is set.
|
|
193
|
+
|
|
194
|
+
<ParametersTable
|
|
195
|
+
type="ActionBarPrimitiveSpeakProps"
|
|
196
|
+
parameters={[
|
|
197
|
+
{
|
|
198
|
+
name: "asChild",
|
|
199
|
+
},
|
|
200
|
+
]}
|
|
201
|
+
/>
|
|
202
|
+
|
|
203
|
+
### StopSpeaking
|
|
204
|
+
|
|
205
|
+
Stops the message text from being played as speech.
|
|
206
|
+
|
|
207
|
+
This primitive renders a `<button>` element unless `asChild` is set.
|
|
208
|
+
|
|
209
|
+
<ParametersTable
|
|
210
|
+
type="ActionBarPrimitiveStopSpeakingProps"
|
|
211
|
+
parameters={[
|
|
212
|
+
{
|
|
213
|
+
name: "asChild",
|
|
214
|
+
},
|
|
215
|
+
]}
|
|
216
|
+
/>
|
|
217
|
+
|
|
218
|
+
### Feedback Positive
|
|
219
|
+
|
|
220
|
+
Shows a positive feedback submission button.
|
|
221
|
+
|
|
222
|
+
This primitive renders a `<button>` element unless `asChild` is set.
|
|
223
|
+
|
|
224
|
+
<ParametersTable
|
|
225
|
+
type="ActionBarPrimitiveFeedbackPositiveProps"
|
|
226
|
+
parameters={[
|
|
227
|
+
{
|
|
228
|
+
name: "asChild",
|
|
229
|
+
},
|
|
230
|
+
]}
|
|
231
|
+
/>
|
|
232
|
+
|
|
233
|
+
<DataAttributesTable
|
|
234
|
+
data={[
|
|
235
|
+
{
|
|
236
|
+
attribute: "[data-submitted]",
|
|
237
|
+
values: "Present when positive feedback was submitted.",
|
|
238
|
+
},
|
|
239
|
+
]}
|
|
240
|
+
/>
|
|
241
|
+
|
|
242
|
+
### Feedback Negative
|
|
243
|
+
|
|
244
|
+
Shows a negative feedback submission button.
|
|
245
|
+
|
|
246
|
+
This primitive renders a `<button>` element unless `asChild` is set.
|
|
247
|
+
|
|
248
|
+
<ParametersTable
|
|
249
|
+
type="ActionBarPrimitiveFeedbackNegativeProps"
|
|
250
|
+
parameters={[
|
|
251
|
+
{
|
|
252
|
+
name: "asChild",
|
|
253
|
+
},
|
|
254
|
+
]}
|
|
255
|
+
/>
|
|
256
|
+
|
|
257
|
+
<DataAttributesTable
|
|
258
|
+
data={[
|
|
259
|
+
{
|
|
260
|
+
attribute: "[data-submitted]",
|
|
261
|
+
values: "Present when negative feedback was submitted.",
|
|
262
|
+
},
|
|
263
|
+
]}
|
|
264
|
+
/>
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: AssistantModalPrimitive
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
A modal chat UI usually displayed in the bottom right corner of the screen.
|
|
6
|
+
|
|
7
|
+
import { Code } from "@radix-ui/themes";
|
|
8
|
+
import { ParametersTable, DataAttributesTable } from "@/components/docs";
|
|
9
|
+
|
|
10
|
+
## Anatomy
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
import { AssistantModalPrimitive } from "@assistant-ui/react";
|
|
14
|
+
|
|
15
|
+
const Thread = () => (
|
|
16
|
+
<AssistantModalPrimitive.Root>
|
|
17
|
+
<AssistantModalPrimitive.Trigger>
|
|
18
|
+
<FloatingAssistantButton />
|
|
19
|
+
</AssistantModalPrimitive.Trigger>
|
|
20
|
+
<AssistantModalPrimitive.Content>
|
|
21
|
+
<Thread />
|
|
22
|
+
</AssistantModalPrimitive.Content>
|
|
23
|
+
</AssistantModalPrimitive.Root>
|
|
24
|
+
);
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## API Reference
|
|
28
|
+
|
|
29
|
+
### Root
|
|
30
|
+
|
|
31
|
+
Contains all parts of the assistant modal.
|
|
32
|
+
|
|
33
|
+
<ParametersTable
|
|
34
|
+
type="AssistantModalPrimitiveRootProps"
|
|
35
|
+
parameters={[
|
|
36
|
+
{
|
|
37
|
+
name: "defaultOpen",
|
|
38
|
+
type: "boolean",
|
|
39
|
+
default: "false",
|
|
40
|
+
description:
|
|
41
|
+
"The open state of the assistant modal when it is initially rendered. Use when you do not need to control its open state.",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "open",
|
|
45
|
+
type: "boolean",
|
|
46
|
+
description:
|
|
47
|
+
"Not recommended. The controlled open state of the assistant modal. Must be used in conjunction with onOpenChange.",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "onOpenChange",
|
|
51
|
+
type: "(open: boolean) => void",
|
|
52
|
+
description:
|
|
53
|
+
"Event handler called when the open state of the assistant modal changes.",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "modal",
|
|
57
|
+
type: "boolean",
|
|
58
|
+
default: "false",
|
|
59
|
+
description:
|
|
60
|
+
"The modality of the assistant modal. When set to true, interaction with outside elements will be disabled and only modal content will be visible to screen readers.",
|
|
61
|
+
},
|
|
62
|
+
]}
|
|
63
|
+
/>
|
|
64
|
+
|
|
65
|
+
### Trigger
|
|
66
|
+
|
|
67
|
+
A button that toggles the open state of the assistant modal. `AssistantModalPrimitive.Content` will position itself against this button.
|
|
68
|
+
|
|
69
|
+
This primitive renders a `<button>` element unless `asChild` is set.
|
|
70
|
+
|
|
71
|
+
<ParametersTable
|
|
72
|
+
type="AssistantModalPrimitiveTriggerProps"
|
|
73
|
+
parameters={[
|
|
74
|
+
{
|
|
75
|
+
name: "asChild",
|
|
76
|
+
},
|
|
77
|
+
]}
|
|
78
|
+
/>
|
|
79
|
+
|
|
80
|
+
<DataAttributesTable
|
|
81
|
+
data={[
|
|
82
|
+
{
|
|
83
|
+
attribute: "[data-state]",
|
|
84
|
+
values: <Code>"open" | "closed"</Code>,
|
|
85
|
+
},
|
|
86
|
+
]}
|
|
87
|
+
/>
|
|
88
|
+
|
|
89
|
+
### Anchor
|
|
90
|
+
|
|
91
|
+
The anchor element that the assistant modal is attached to. Defaults to the `Trigger` element.
|
|
92
|
+
|
|
93
|
+
This primitive renders a `<div>` element unless `asChild` is set.
|
|
94
|
+
|
|
95
|
+
### Content
|
|
96
|
+
|
|
97
|
+
The component that pops out when the assistant modal is open.
|
|
98
|
+
|
|
99
|
+
This primitive renders a `<div>` element unless `asChild` is set.
|
|
100
|
+
|
|
101
|
+
<ParametersTable
|
|
102
|
+
type="AssistantModalPrimitiveContentProps"
|
|
103
|
+
parameters={[
|
|
104
|
+
{
|
|
105
|
+
name: "asChild",
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "side",
|
|
109
|
+
type: "'top' | 'right' | 'bottom' | 'left'",
|
|
110
|
+
default: "'top'",
|
|
111
|
+
description: "The side of the assistant modal to position against.",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: "align",
|
|
115
|
+
type: "'start' | 'center' | 'end'",
|
|
116
|
+
default: "'end'",
|
|
117
|
+
description: "The alignment of the assistant modal to position against.",
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: "dissmissOnInteractOutside",
|
|
121
|
+
type: "boolean",
|
|
122
|
+
default: "false",
|
|
123
|
+
description:
|
|
124
|
+
"Dismiss the assistant modal when the user interacts outside of it.",
|
|
125
|
+
},
|
|
126
|
+
]}
|
|
127
|
+
/>
|
|
128
|
+
|
|
129
|
+
Refer to Radix UI's Documentation for [Popover.Content](https://www.radix-ui.com/primitives/docs/components/popover#content) for more details.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: AttachmentPrimitive
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Buttons to interact with attachments.
|
|
6
|
+
|
|
7
|
+
import { ParametersTable, DataAttributesTable } from "@/components/docs";
|
|
8
|
+
import { Code } from "@radix-ui/themes";
|
|
9
|
+
import { Callout } from "fumadocs-ui/components/callout";
|
|
10
|
+
|
|
11
|
+
<Callout>
|
|
12
|
+
**Dual Use!** Attachments can appear in both messages and composers.
|
|
13
|
+
</Callout>
|
|
14
|
+
|
|
15
|
+
## Anatomy
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { AttachmentPrimitive } from "@assistant-ui/react";
|
|
19
|
+
|
|
20
|
+
const MyMessageAttachment = () => (
|
|
21
|
+
<AttachmentPrimitive.Root>
|
|
22
|
+
<AttachmentPrimitive.Thumbnail />
|
|
23
|
+
<AttachmentPrimitive.Name />
|
|
24
|
+
</AttachmentPrimitive.Root>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const MyComposerAttachment = () => (
|
|
28
|
+
<AttachmentPrimitive.Root>
|
|
29
|
+
<AttachmentPrimitive.Thumbnail />
|
|
30
|
+
<AttachmentPrimitive.Name />
|
|
31
|
+
<AttachmentPrimitive.Remove />
|
|
32
|
+
</AttachmentPrimitive.Root>
|
|
33
|
+
);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## API Reference
|
|
37
|
+
|
|
38
|
+
### Container
|
|
39
|
+
|
|
40
|
+
Containts all parts of the attachment.
|
|
41
|
+
|
|
42
|
+
This primitive renders a `<div>` element unless `asChild` is set.
|
|
43
|
+
|
|
44
|
+
<ParametersTable
|
|
45
|
+
type="AttachmentPrimitiveRootProps"
|
|
46
|
+
parameters={[
|
|
47
|
+
{
|
|
48
|
+
name: "asChild",
|
|
49
|
+
},
|
|
50
|
+
]}
|
|
51
|
+
/>
|
|
52
|
+
|
|
53
|
+
### Thumbnail
|
|
54
|
+
|
|
55
|
+
The thumbnail of the attachment.
|
|
56
|
+
|
|
57
|
+
This primitive renders a `<div>` element unless `asChild` is set.
|
|
58
|
+
|
|
59
|
+
<ParametersTable
|
|
60
|
+
type="AttachmentPrimitiveThumbnailProps"
|
|
61
|
+
parameters={[
|
|
62
|
+
{
|
|
63
|
+
name: "asChild",
|
|
64
|
+
},
|
|
65
|
+
]}
|
|
66
|
+
/>
|
|
67
|
+
|
|
68
|
+
### Name
|
|
69
|
+
|
|
70
|
+
The name of the attachment.
|
|
71
|
+
|
|
72
|
+
This primitive renders a `<div>` element unless `asChild` is set.
|
|
73
|
+
|
|
74
|
+
<ParametersTable
|
|
75
|
+
type="AttachmentPrimitiveNameProps"
|
|
76
|
+
parameters={[
|
|
77
|
+
{
|
|
78
|
+
name: "asChild",
|
|
79
|
+
},
|
|
80
|
+
]}
|
|
81
|
+
/>
|
|
82
|
+
|
|
83
|
+
### Remove
|
|
84
|
+
|
|
85
|
+
Removes the attachment.
|
|
86
|
+
|
|
87
|
+
This primitive renders a `<button>` element unless `asChild` is set.
|
|
88
|
+
|
|
89
|
+
<ParametersTable
|
|
90
|
+
type="AttachmentPrimitiveRemoveProps"
|
|
91
|
+
parameters={[
|
|
92
|
+
{
|
|
93
|
+
name: "asChild",
|
|
94
|
+
},
|
|
95
|
+
]}
|
|
96
|
+
/>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: BranchPickerPrimitive
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
View and switch between branches.
|
|
6
|
+
|
|
7
|
+
import { ParametersTable } from "@/components/docs";
|
|
8
|
+
|
|
9
|
+
## Anatomy
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { BranchPickerPrimitive } from "@assistant-ui/react";
|
|
13
|
+
|
|
14
|
+
const BranchPicker = () => (
|
|
15
|
+
<BranchPickerPrimitive.Root>
|
|
16
|
+
<BranchPickerPrimitive.Previous />
|
|
17
|
+
<BranchPickerPrimitive.Number /> / <BranchPickerPrimitive.Count />
|
|
18
|
+
<BranchPickerPrimitive.Next />
|
|
19
|
+
</BranchPickerPrimitive.Root>
|
|
20
|
+
);
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## API Reference
|
|
24
|
+
|
|
25
|
+
### Root
|
|
26
|
+
|
|
27
|
+
Containts all parts of the branch picker.
|
|
28
|
+
|
|
29
|
+
This primitive renders a `<div>` element unless `asChild` is set.
|
|
30
|
+
|
|
31
|
+
<ParametersTable
|
|
32
|
+
type="BranchPickerPrimitiveRootProps"
|
|
33
|
+
parameters={[
|
|
34
|
+
{
|
|
35
|
+
name: "asChild",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "hideWhenSingleBranch",
|
|
39
|
+
type: "boolean",
|
|
40
|
+
default: "false",
|
|
41
|
+
description:
|
|
42
|
+
"Do not render the BranchPicker when there is only one branch at the current message.",
|
|
43
|
+
},
|
|
44
|
+
]}
|
|
45
|
+
/>
|
|
46
|
+
|
|
47
|
+
### Number
|
|
48
|
+
|
|
49
|
+
The current branch number.
|
|
50
|
+
|
|
51
|
+
This primitive renders the raw number as a string.
|
|
52
|
+
|
|
53
|
+
### Count
|
|
54
|
+
|
|
55
|
+
The total number of branches.
|
|
56
|
+
|
|
57
|
+
This primitive renders the raw number as a string.
|
|
58
|
+
|
|
59
|
+
### Previous
|
|
60
|
+
|
|
61
|
+
Navigates to the previous branch.
|
|
62
|
+
|
|
63
|
+
This primitive renders a `<button>` element unless `asChild` is set.
|
|
64
|
+
|
|
65
|
+
<ParametersTable
|
|
66
|
+
type="BranchPickerPrimitivePreviousProps"
|
|
67
|
+
parameters={[
|
|
68
|
+
{
|
|
69
|
+
name: "asChild",
|
|
70
|
+
},
|
|
71
|
+
]}
|
|
72
|
+
/>
|
|
73
|
+
|
|
74
|
+
### Next
|
|
75
|
+
|
|
76
|
+
Navigates to the next branch.
|
|
77
|
+
|
|
78
|
+
This primitive renders a `<button>` element unless `asChild` is set.
|
|
79
|
+
|
|
80
|
+
<ParametersTable
|
|
81
|
+
type="BranchPickerPrimitiveNextProps"
|
|
82
|
+
parameters={[
|
|
83
|
+
{
|
|
84
|
+
name: "asChild",
|
|
85
|
+
},
|
|
86
|
+
]}
|
|
87
|
+
/>
|