@liveblocks/react-ui 2.25.0-aiprivatebeta9 → 3.0.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/_private/package.json +2 -2
- package/dist/_private/index.cjs +4 -0
- package/dist/_private/index.cjs.map +1 -1
- package/dist/_private/index.d.cts +8 -4
- package/dist/_private/index.d.ts +8 -4
- package/dist/_private/index.js +2 -0
- package/dist/_private/index.js.map +1 -1
- package/dist/components/AiChat.cjs +15 -19
- package/dist/components/AiChat.cjs.map +1 -1
- package/dist/components/AiChat.js +16 -20
- package/dist/components/AiChat.js.map +1 -1
- package/dist/components/AiTool.cjs +52 -28
- package/dist/components/AiTool.cjs.map +1 -1
- package/dist/components/AiTool.js +53 -29
- package/dist/components/AiTool.js.map +1 -1
- package/dist/components/Comment.cjs +254 -235
- package/dist/components/Comment.cjs.map +1 -1
- package/dist/components/Comment.js +255 -236
- package/dist/components/Comment.js.map +1 -1
- package/dist/components/Composer.cjs +42 -30
- package/dist/components/Composer.cjs.map +1 -1
- package/dist/components/Composer.js +44 -32
- package/dist/components/Composer.js.map +1 -1
- package/dist/components/Thread.cjs +7 -1
- package/dist/components/Thread.cjs.map +1 -1
- package/dist/components/Thread.js +8 -2
- package/dist/components/Thread.js.map +1 -1
- package/dist/components/internal/AiChatAssistantMessage.cjs +38 -6
- package/dist/components/internal/AiChatAssistantMessage.cjs.map +1 -1
- package/dist/components/internal/AiChatAssistantMessage.js +39 -7
- package/dist/components/internal/AiChatAssistantMessage.js.map +1 -1
- package/dist/components/internal/AiChatComposer.cjs.map +1 -1
- package/dist/components/internal/AiChatComposer.js.map +1 -1
- package/dist/components/internal/AiChatUserMessage.cjs.map +1 -1
- package/dist/components/internal/AiChatUserMessage.js.map +1 -1
- package/dist/components/internal/CodeBlock.cjs +6 -3
- package/dist/components/internal/CodeBlock.cjs.map +1 -1
- package/dist/components/internal/CodeBlock.js +6 -3
- package/dist/components/internal/CodeBlock.js.map +1 -1
- package/dist/components/internal/Dropdown.cjs +1 -1
- package/dist/components/internal/Dropdown.cjs.map +1 -1
- package/dist/components/internal/Dropdown.js +2 -2
- package/dist/components/internal/Dropdown.js.map +1 -1
- package/dist/components/internal/EmojiPicker.cjs +1 -1
- package/dist/components/internal/EmojiPicker.cjs.map +1 -1
- package/dist/components/internal/EmojiPicker.js +2 -2
- package/dist/components/internal/EmojiPicker.js.map +1 -1
- package/dist/components/internal/InboxNotificationThread.cjs +5 -2
- package/dist/components/internal/InboxNotificationThread.cjs.map +1 -1
- package/dist/components/internal/InboxNotificationThread.js +6 -3
- package/dist/components/internal/InboxNotificationThread.js.map +1 -1
- package/dist/components/internal/Tooltip.cjs +1 -1
- package/dist/components/internal/Tooltip.cjs.map +1 -1
- package/dist/components/internal/Tooltip.js +2 -2
- package/dist/components/internal/Tooltip.js.map +1 -1
- package/dist/config.cjs +9 -9
- package/dist/config.cjs.map +1 -1
- package/dist/config.js +8 -8
- package/dist/config.js.map +1 -1
- package/dist/icons/CrossCircleFill.cjs +25 -0
- package/dist/icons/CrossCircleFill.cjs.map +1 -0
- package/dist/icons/CrossCircleFill.js +23 -0
- package/dist/icons/CrossCircleFill.js.map +1 -0
- package/dist/icons/MinusCircle.cjs +23 -0
- package/dist/icons/MinusCircle.cjs.map +1 -0
- package/dist/icons/MinusCircle.js +21 -0
- package/dist/icons/MinusCircle.js.map +1 -0
- package/dist/icons/index.cjs +4 -0
- package/dist/icons/index.cjs.map +1 -1
- package/dist/icons/index.js +2 -0
- package/dist/icons/index.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +232 -25
- package/dist/index.d.ts +232 -25
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/overrides.cjs +5 -1
- package/dist/overrides.cjs.map +1 -1
- package/dist/overrides.js +5 -1
- package/dist/overrides.js.map +1 -1
- package/dist/primitives/AiMessage/index.cjs +11 -67
- package/dist/primitives/AiMessage/index.cjs.map +1 -1
- package/dist/primitives/AiMessage/index.js +13 -69
- package/dist/primitives/AiMessage/index.js.map +1 -1
- package/dist/primitives/AiMessage/tool-invocation.cjs +70 -0
- package/dist/primitives/AiMessage/tool-invocation.cjs.map +1 -0
- package/dist/primitives/AiMessage/tool-invocation.js +68 -0
- package/dist/primitives/AiMessage/tool-invocation.js.map +1 -0
- package/dist/primitives/Collapsible/index.cjs +3 -3
- package/dist/primitives/Collapsible/index.cjs.map +1 -1
- package/dist/primitives/Collapsible/index.js +3 -3
- package/dist/primitives/Collapsible/index.js.map +1 -1
- package/dist/primitives/Comment/index.cjs +5 -4
- package/dist/primitives/Comment/index.cjs.map +1 -1
- package/dist/primitives/Comment/index.js +5 -4
- package/dist/primitives/Comment/index.js.map +1 -1
- package/dist/primitives/Composer/index.cjs +49 -41
- package/dist/primitives/Composer/index.cjs.map +1 -1
- package/dist/primitives/Composer/index.js +50 -42
- package/dist/primitives/Composer/index.js.map +1 -1
- package/dist/primitives/Composer/slate/plugins/mentions.cjs +4 -4
- package/dist/primitives/Composer/slate/plugins/mentions.cjs.map +1 -1
- package/dist/primitives/Composer/slate/plugins/mentions.js +4 -4
- package/dist/primitives/Composer/slate/plugins/mentions.js.map +1 -1
- package/dist/primitives/Composer/utils.cjs +3 -6
- package/dist/primitives/Composer/utils.cjs.map +1 -1
- package/dist/primitives/Composer/utils.js +3 -6
- package/dist/primitives/Composer/utils.js.map +1 -1
- package/dist/primitives/Markdown.cjs +6 -2
- package/dist/primitives/Markdown.cjs.map +1 -1
- package/dist/primitives/Markdown.js +6 -2
- package/dist/primitives/Markdown.js.map +1 -1
- package/dist/primitives/index.d.cts +18 -18
- package/dist/primitives/index.d.ts +18 -18
- package/dist/utils/use-controllable-state.cjs +25 -2
- package/dist/utils/use-controllable-state.cjs.map +1 -1
- package/dist/utils/use-controllable-state.js +25 -3
- package/dist/utils/use-controllable-state.js.map +1 -1
- package/dist/utils/use-visible.cjs +3 -1
- package/dist/utils/use-visible.cjs.map +1 -1
- package/dist/utils/use-visible.js +3 -1
- package/dist/utils/use-visible.js.map +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +16 -5
- package/primitives/package.json +2 -2
- package/src/styles/index.css +22 -4
- package/styles.css +1 -1
- package/styles.css.map +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ComponentType, ComponentPropsWithoutRef, ElementType, ReactNode, ComponentProps, FormEvent, RefAttributes, MouseEvent, PropsWithChildren } from 'react';
|
|
3
|
-
import { CommentAttachment, AiKnowledgeSource, AiOpaqueToolDefinition, AiToolTypePack, JsonObject,
|
|
3
|
+
import { CommentAttachment, AiKnowledgeSource, AiOpaqueToolDefinition, AiToolTypePack, JsonObject, AiToolExecuteCallback, NoInfr, CommentBody, MentionData, BaseMetadata, DM, CommentData, HistoryVersion, InboxNotificationData, InboxNotificationThreadData, InboxNotificationTextMentionData, InboxNotificationCustomData, KDAD, ThreadData } from '@liveblocks/core';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
interface GlobalComponents {
|
|
@@ -54,6 +54,7 @@ interface GlobalOverrides {
|
|
|
54
54
|
EMOJI_PICKER_CHANGE_SKIN_TONE: string;
|
|
55
55
|
ATTACHMENT_TOO_LARGE: (maxSize?: string) => string;
|
|
56
56
|
ATTACHMENT_ERROR: (error: Error) => string;
|
|
57
|
+
COPY_TO_CLIPBOARD: string;
|
|
57
58
|
}
|
|
58
59
|
interface CommentOverrides {
|
|
59
60
|
COMMENT_EDITED: ReactNode;
|
|
@@ -78,6 +79,10 @@ interface ComposerOverrides {
|
|
|
78
79
|
COMPOSER_SEND: string;
|
|
79
80
|
COMPOSER_TOGGLE_MARK: (mark: ComposerBodyMark) => string;
|
|
80
81
|
}
|
|
82
|
+
interface AiToolConfirmationOverrides {
|
|
83
|
+
AI_TOOL_CONFIRMATION_CONFIRM: string;
|
|
84
|
+
AI_TOOL_CONFIRMATION_CANCEL: string;
|
|
85
|
+
}
|
|
81
86
|
interface AiChatComposerOverrides {
|
|
82
87
|
AI_CHAT_COMPOSER_PLACEHOLDER: string;
|
|
83
88
|
AI_CHAT_COMPOSER_SEND: string;
|
|
@@ -86,6 +91,7 @@ interface AiChatComposerOverrides {
|
|
|
86
91
|
interface AiChatMessageOverrides {
|
|
87
92
|
AI_CHAT_MESSAGE_DELETED: string;
|
|
88
93
|
AI_CHAT_MESSAGE_THINKING: string;
|
|
94
|
+
AI_CHAT_MESSAGE_REASONING: (isStreaming: boolean) => string;
|
|
89
95
|
}
|
|
90
96
|
interface AiChatOverrides {
|
|
91
97
|
AI_CHAT_MESSAGES_ERROR: (error: Error) => ReactNode;
|
|
@@ -114,13 +120,28 @@ interface HistoryVersionPreviewOverrides {
|
|
|
114
120
|
HISTORY_VERSION_PREVIEW_EMPTY: ReactNode;
|
|
115
121
|
HISTORY_VERSION_PREVIEW_ERROR: (error: Error) => ReactNode;
|
|
116
122
|
}
|
|
117
|
-
type Overrides = LocalizationOverrides & GlobalOverrides & ComposerOverrides & CommentOverrides & ThreadOverrides & InboxNotificationOverrides & HistoryVersionPreviewOverrides & AiChatComposerOverrides & AiChatMessageOverrides & AiChatOverrides;
|
|
123
|
+
type Overrides = LocalizationOverrides & GlobalOverrides & ComposerOverrides & CommentOverrides & ThreadOverrides & InboxNotificationOverrides & HistoryVersionPreviewOverrides & AiChatComposerOverrides & AiChatMessageOverrides & AiChatOverrides & AiToolConfirmationOverrides;
|
|
118
124
|
declare function useOverrides(overrides?: Partial<Overrides>): Overrides;
|
|
119
125
|
|
|
120
|
-
type AiChatComponentsEmptyProps =
|
|
126
|
+
type AiChatComponentsEmptyProps = {
|
|
127
|
+
/**
|
|
128
|
+
* The chat id provided to the `AiChat` component.
|
|
129
|
+
*/
|
|
130
|
+
chatId: string;
|
|
131
|
+
/**
|
|
132
|
+
* The copilot id provided to the `AiChat` component.
|
|
133
|
+
*/
|
|
134
|
+
copilotId?: string;
|
|
135
|
+
};
|
|
121
136
|
type AiChatComponentsLoadingProps = Record<string, never>;
|
|
122
137
|
type AiChatComponents = {
|
|
138
|
+
/**
|
|
139
|
+
* The component used to render the empty state of the chat.
|
|
140
|
+
*/
|
|
123
141
|
Empty: ComponentType<AiChatComponentsEmptyProps>;
|
|
142
|
+
/**
|
|
143
|
+
* The component used to render the loading state of the chat.
|
|
144
|
+
*/
|
|
124
145
|
Loading: ComponentType<AiChatComponentsLoadingProps>;
|
|
125
146
|
};
|
|
126
147
|
interface AiChatProps extends ComponentProps<"div"> {
|
|
@@ -177,26 +198,204 @@ interface AiToolProps extends Omit<ComponentProps<"div">, "title" | "children">
|
|
|
177
198
|
* The content shown in the tool.
|
|
178
199
|
*/
|
|
179
200
|
children?: ReactNode;
|
|
201
|
+
/**
|
|
202
|
+
* Whether the content is currently collapsed.
|
|
203
|
+
* It is not a traditional controlled value, as in if you set it to `true` it would only stay expanded.
|
|
204
|
+
* Instead, it is "semi-controlled", meaning that setting it to `true` will expand it, but it
|
|
205
|
+
* can still be collapsed/expanded by clicking on it.
|
|
206
|
+
*/
|
|
207
|
+
collapsed?: boolean;
|
|
208
|
+
/**
|
|
209
|
+
* The event handler called when the content is collapsed or expanded by clicking on it.
|
|
210
|
+
*/
|
|
211
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
180
212
|
}
|
|
181
213
|
type AiToolIconProps = ComponentProps<"div">;
|
|
182
214
|
type AiToolInspectorProps = ComponentProps<"div">;
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
*/
|
|
188
|
-
interface AiToolConfirmationProps<A extends JsonObject, R extends ToolResultData> extends ComponentProps<"div"> {
|
|
189
|
-
args?: A;
|
|
215
|
+
interface AiToolConfirmationProps<A extends JsonObject, R extends JsonObject> extends ComponentProps<"div"> {
|
|
216
|
+
/**
|
|
217
|
+
* The callback invoked when the user clicks the confirm button.
|
|
218
|
+
*/
|
|
190
219
|
confirm: AiToolExecuteCallback<A, R>;
|
|
191
|
-
|
|
220
|
+
/**
|
|
221
|
+
* The callback invoked when the user clicks the cancel button.
|
|
222
|
+
*/
|
|
223
|
+
cancel?: AiToolExecuteCallback<A, R>;
|
|
224
|
+
/**
|
|
225
|
+
* The visual appearance.
|
|
226
|
+
*/
|
|
192
227
|
variant?: "default" | "destructive";
|
|
228
|
+
/**
|
|
229
|
+
* Override the component's strings.
|
|
230
|
+
*/
|
|
231
|
+
overrides?: Partial<GlobalOverrides & AiToolConfirmationOverrides>;
|
|
232
|
+
/**
|
|
233
|
+
* The tool's result type, to be used with the `types` prop in the `render` method.
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* defineAiTool<{ value: number }>()({
|
|
237
|
+
* // ...
|
|
238
|
+
* render: ({ types }) => (
|
|
239
|
+
* <AiTool.Confirmation
|
|
240
|
+
* types={types}
|
|
241
|
+
* confirm={() => {
|
|
242
|
+
* return {
|
|
243
|
+
* // Using `types` makes the result type-safe
|
|
244
|
+
* // based on the tool's definition
|
|
245
|
+
* data: { value: 123 },
|
|
246
|
+
* };
|
|
247
|
+
* }}
|
|
248
|
+
* />
|
|
249
|
+
* ),
|
|
250
|
+
* })
|
|
251
|
+
*/
|
|
252
|
+
types?: NoInfr<AiToolTypePack<A, R>>;
|
|
193
253
|
}
|
|
194
254
|
declare function AiToolIcon({ className, ...props }: AiToolIconProps): react_jsx_runtime.JSX.Element;
|
|
195
255
|
declare function AiToolInspector({ className, ...props }: AiToolInspectorProps): react_jsx_runtime.JSX.Element;
|
|
196
|
-
declare function AiToolConfirmation<TPack extends AiToolTypePack, A extends JsonObject = TPack["A"], R extends
|
|
256
|
+
declare function AiToolConfirmation<TPack extends AiToolTypePack, A extends JsonObject = TPack["A"], R extends JsonObject = TPack["R"]>({ children, variant, confirm, cancel, overrides, className, ...props }: AiToolConfirmationProps<A, R>): react_jsx_runtime.JSX.Element | null;
|
|
257
|
+
/**
|
|
258
|
+
* A pre-built component which displays a tool call.
|
|
259
|
+
*
|
|
260
|
+
* By default, a human-readable version of the tool's name is used as a title:
|
|
261
|
+
* - `"showTodo"` → "Show todo"
|
|
262
|
+
* - `"get_weather"` → "Get weather"
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
* defineAiTool()({
|
|
266
|
+
* // ...
|
|
267
|
+
* render: () => (
|
|
268
|
+
* <AiTool />
|
|
269
|
+
* ),
|
|
270
|
+
* })
|
|
271
|
+
*
|
|
272
|
+
* It can be customized in various ways:
|
|
273
|
+
* - adding an icon
|
|
274
|
+
* - customizing the title (even dynamically)
|
|
275
|
+
* - adding custom content inside it
|
|
276
|
+
* - collapsing it conditionally
|
|
277
|
+
* - etc.
|
|
278
|
+
*
|
|
279
|
+
* @example
|
|
280
|
+
* defineAiTool()({
|
|
281
|
+
* // ...
|
|
282
|
+
* render: ({ stage, result }) => (
|
|
283
|
+
* <AiTool
|
|
284
|
+
* icon="🔍"
|
|
285
|
+
*
|
|
286
|
+
* // Override the default title based on the tool's stage
|
|
287
|
+
* title={stage === "executing" ? "Searching…" : "Search results"}
|
|
288
|
+
*
|
|
289
|
+
* // Start open and automatically collapse after it is executed
|
|
290
|
+
* // The user can still expand/collapse it manually at any time
|
|
291
|
+
* collapsed={stage === "executed"}
|
|
292
|
+
* >
|
|
293
|
+
* <SearchResults data={result.data} />
|
|
294
|
+
* </AiTool>
|
|
295
|
+
* ),
|
|
296
|
+
* })
|
|
297
|
+
*
|
|
298
|
+
* It also comes with a few built-in sub-components:
|
|
299
|
+
* - `AiTool.Confirmation` to display a human-in-the-loop confirmation step
|
|
300
|
+
* which can be accepted or cancelled by the user.
|
|
301
|
+
* - `AiTool.Inspector` to display the tool's arguments and result which can
|
|
302
|
+
* be useful during development.
|
|
303
|
+
*
|
|
304
|
+
* @example
|
|
305
|
+
* defineAiTool()({
|
|
306
|
+
* // ...
|
|
307
|
+
* render: () => (
|
|
308
|
+
* <AiTool>
|
|
309
|
+
* <AiTool.Confirmation
|
|
310
|
+
* // Use a destructive visual appearance
|
|
311
|
+
* variant="destructive"
|
|
312
|
+
*
|
|
313
|
+
* // The tool's arguments can be directly accessed like in `execute`
|
|
314
|
+
* confirm={({ pageIds }) => {
|
|
315
|
+
* const deletedPageTitles = pages
|
|
316
|
+
* .filter((p) => pageIds.includes(p.id))
|
|
317
|
+
* .map((page) => page.title);
|
|
318
|
+
*
|
|
319
|
+
* deletePages(pageIds);
|
|
320
|
+
*
|
|
321
|
+
* // This result will be available as `result` in the tool's `render` props
|
|
322
|
+
* return { data: { deletedPageTitles } };
|
|
323
|
+
* }}
|
|
324
|
+
*
|
|
325
|
+
* // If needed, `cancel={() => ...}` would work similarly
|
|
326
|
+
* >
|
|
327
|
+
* Do you want to delete these pages?
|
|
328
|
+
* <PagesPreviews />
|
|
329
|
+
* </AiTool.Confirmation>
|
|
330
|
+
* </AiTool>
|
|
331
|
+
* ),
|
|
332
|
+
* })
|
|
333
|
+
*
|
|
334
|
+
* @example
|
|
335
|
+
* defineAiTool()({
|
|
336
|
+
* // ...
|
|
337
|
+
* render: () => (
|
|
338
|
+
* <AiTool>
|
|
339
|
+
* <AiTool.Inspector />
|
|
340
|
+
* </AiTool>
|
|
341
|
+
* ),
|
|
342
|
+
* })
|
|
343
|
+
*/
|
|
197
344
|
declare const AiTool: react.ForwardRefExoticComponent<Omit<AiToolProps, "ref"> & react.RefAttributes<HTMLDivElement>> & {
|
|
345
|
+
/**
|
|
346
|
+
* Display an icon in a container.
|
|
347
|
+
*
|
|
348
|
+
* @example
|
|
349
|
+
* <AiTool
|
|
350
|
+
* icon={
|
|
351
|
+
* <AiTool.Icon>🔍</AiTool.Icon>
|
|
352
|
+
* }
|
|
353
|
+
* />
|
|
354
|
+
*/
|
|
198
355
|
Icon: typeof AiToolIcon;
|
|
356
|
+
/**
|
|
357
|
+
* Display the tool's arguments and result, which can be useful during
|
|
358
|
+
* development.
|
|
359
|
+
*
|
|
360
|
+
* @example
|
|
361
|
+
* <AiTool>
|
|
362
|
+
* <AiTool.Inspector />
|
|
363
|
+
* </AiTool>
|
|
364
|
+
*/
|
|
199
365
|
Inspector: typeof AiToolInspector;
|
|
366
|
+
/**
|
|
367
|
+
* Display a human-in-the-loop confirmation step which can be accepted
|
|
368
|
+
* or cancelled by the user.
|
|
369
|
+
*
|
|
370
|
+
* The `confirm` and `cancel` callbacks work like `execute` in tool definitions: they can
|
|
371
|
+
* perform side-effects, be async if needed, and return a result. The tool call will stay
|
|
372
|
+
* pending until either `confirm` or `cancel` is called.
|
|
373
|
+
*
|
|
374
|
+
* @example
|
|
375
|
+
* <AiTool>
|
|
376
|
+
* <AiTool.Confirmation
|
|
377
|
+
* // Use a destructive visual appearance
|
|
378
|
+
* variant="destructive"
|
|
379
|
+
*
|
|
380
|
+
* // The tool's arguments can be directly accessed like in `execute`
|
|
381
|
+
* confirm={({ pageIds }) => {
|
|
382
|
+
* const deletedPageTitles = pages
|
|
383
|
+
* .filter((p) => pageIds.includes(p.id))
|
|
384
|
+
* .map((page) => page.title);
|
|
385
|
+
*
|
|
386
|
+
* deletePages(pageIds);
|
|
387
|
+
*
|
|
388
|
+
* // This result will be available as `result` in the tool's `render` props
|
|
389
|
+
* return { data: { deletedPageTitles } };
|
|
390
|
+
* }}
|
|
391
|
+
*
|
|
392
|
+
* // If needed, `cancel={() => ...}` would work similarly
|
|
393
|
+
* >
|
|
394
|
+
* Do you want to delete these pages?
|
|
395
|
+
* <PagesPreviews />
|
|
396
|
+
* </AiTool.Confirmation>
|
|
397
|
+
* </AiTool>
|
|
398
|
+
*/
|
|
200
399
|
Confirmation: typeof AiToolConfirmation;
|
|
201
400
|
};
|
|
202
401
|
|
|
@@ -206,9 +405,9 @@ interface ComposerEditorMentionProps {
|
|
|
206
405
|
*/
|
|
207
406
|
isSelected: boolean;
|
|
208
407
|
/**
|
|
209
|
-
* The mention
|
|
408
|
+
* The mention to display.
|
|
210
409
|
*/
|
|
211
|
-
|
|
410
|
+
mention: MentionData;
|
|
212
411
|
}
|
|
213
412
|
interface ComposerEditorLinkProps {
|
|
214
413
|
/**
|
|
@@ -226,13 +425,13 @@ interface ComposerEditorLinkProps {
|
|
|
226
425
|
}
|
|
227
426
|
type ComposerEditorMentionSuggestionsProps = {
|
|
228
427
|
/**
|
|
229
|
-
* The list of
|
|
428
|
+
* The list of mention suggestions.
|
|
230
429
|
*/
|
|
231
|
-
|
|
430
|
+
mentions: MentionData[];
|
|
232
431
|
/**
|
|
233
|
-
* The currently selected
|
|
432
|
+
* The currently selected mention's ID.
|
|
234
433
|
*/
|
|
235
|
-
|
|
434
|
+
selectedMentionId?: string;
|
|
236
435
|
};
|
|
237
436
|
type ComposerEditorFloatingToolbarProps = Record<string, never>;
|
|
238
437
|
interface ComposerEditorComponents {
|
|
@@ -253,7 +452,7 @@ interface ComposerEditorComponents {
|
|
|
253
452
|
*/
|
|
254
453
|
FloatingToolbar?: ComponentType<ComposerEditorFloatingToolbarProps>;
|
|
255
454
|
}
|
|
256
|
-
interface ComposerEditorProps extends Omit<ComponentPropsWithoutRef<"div">, "defaultValue"> {
|
|
455
|
+
interface ComposerEditorProps extends Omit<ComponentPropsWithoutRef<"div">, "defaultValue" | "children"> {
|
|
257
456
|
/**
|
|
258
457
|
* The reading direction of the editor and related elements.
|
|
259
458
|
*/
|
|
@@ -446,7 +645,7 @@ interface CommentProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
446
645
|
/**
|
|
447
646
|
* The event handler called when clicking on a mention.
|
|
448
647
|
*/
|
|
449
|
-
onMentionClick?: (
|
|
648
|
+
onMentionClick?: (mention: MentionData, event: MouseEvent<HTMLElement>) => void;
|
|
450
649
|
/**
|
|
451
650
|
* The event handler called when clicking on a comment's attachment.
|
|
452
651
|
*/
|
|
@@ -455,6 +654,10 @@ interface CommentProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
455
654
|
* Override the component's strings.
|
|
456
655
|
*/
|
|
457
656
|
overrides?: Partial<GlobalOverrides & CommentOverrides & ComposerOverrides>;
|
|
657
|
+
/**
|
|
658
|
+
* Override the component's components.
|
|
659
|
+
*/
|
|
660
|
+
components?: Partial<GlobalComponents>;
|
|
458
661
|
}
|
|
459
662
|
/**
|
|
460
663
|
* Displays a single comment.
|
|
@@ -712,6 +915,10 @@ interface ThreadProps<M extends BaseMetadata = DM> extends ComponentPropsWithout
|
|
|
712
915
|
* Override the component's strings.
|
|
713
916
|
*/
|
|
714
917
|
overrides?: Partial<GlobalOverrides & ThreadOverrides & CommentOverrides & ComposerOverrides>;
|
|
918
|
+
/**
|
|
919
|
+
* Override the component's components.
|
|
920
|
+
*/
|
|
921
|
+
components?: Partial<GlobalComponents>;
|
|
715
922
|
}
|
|
716
923
|
/**
|
|
717
924
|
* Displays a thread of comments, with a composer to reply
|
|
@@ -726,7 +933,7 @@ interface ThreadProps<M extends BaseMetadata = DM> extends ComponentPropsWithout
|
|
|
726
933
|
*/
|
|
727
934
|
declare const Thread: <M extends BaseMetadata = DM>(props: ThreadProps<M> & RefAttributes<HTMLDivElement>) => JSX.Element;
|
|
728
935
|
|
|
729
|
-
type
|
|
936
|
+
type LiveblocksUiConfigProps = PropsWithChildren<{
|
|
730
937
|
/**
|
|
731
938
|
* Override the components' strings.
|
|
732
939
|
*/
|
|
@@ -770,11 +977,11 @@ type LiveblocksUIConfigProps = PropsWithChildren<{
|
|
|
770
977
|
* Set configuration options for all components.
|
|
771
978
|
*
|
|
772
979
|
* @example
|
|
773
|
-
* <
|
|
980
|
+
* <LiveblocksUiConfig overrides={{ locale: "fr", USER_UNKNOWN: "Anonyme", ... }}>
|
|
774
981
|
* <App />
|
|
775
|
-
* </
|
|
982
|
+
* </LiveblocksUiConfig>
|
|
776
983
|
*/
|
|
777
|
-
declare function
|
|
984
|
+
declare function LiveblocksUiConfig({ overrides, components, portalContainer, preventUnsavedComposerChanges, emojibaseUrl, children, }: LiveblocksUiConfigProps): react_jsx_runtime.JSX.Element;
|
|
778
985
|
|
|
779
986
|
declare function ArrowCornerDownRightIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
780
987
|
|
|
@@ -916,4 +1123,4 @@ declare namespace icon {
|
|
|
916
1123
|
};
|
|
917
1124
|
}
|
|
918
1125
|
|
|
919
|
-
export { AiChat, AiChatProps, AiTool, AiToolIconProps, AiToolProps, Comment, CommentAttachmentArgs, CommentOverrides, CommentProps, Composer, ComposerBodyMark, ComposerBodyMarks, ComposerOverrides, ComposerProps, ComposerSubmitComment, GlobalOverrides, HistoryVersionSummary, HistoryVersionSummaryList, HistoryVersionSummaryListProps, HistoryVersionSummaryProps, icon as Icon, InboxNotification, InboxNotificationAvatarProps, InboxNotificationCustomKindProps, InboxNotificationCustomProps, InboxNotificationIconProps, InboxNotificationList, InboxNotificationListProps, InboxNotificationOverrides, InboxNotificationProps, InboxNotificationTextMentionKindProps, InboxNotificationTextMentionProps, InboxNotificationThreadKindProps, InboxNotificationThreadProps,
|
|
1126
|
+
export { AiChat, AiChatComponents, AiChatComponentsEmptyProps, AiChatComponentsLoadingProps, AiChatProps, AiTool, AiToolIconProps, AiToolProps, Comment, CommentAttachmentArgs, CommentOverrides, CommentProps, Composer, ComposerBodyMark, ComposerBodyMarks, ComposerOverrides, ComposerProps, ComposerSubmitComment, GlobalOverrides, HistoryVersionSummary, HistoryVersionSummaryList, HistoryVersionSummaryListProps, HistoryVersionSummaryProps, icon as Icon, InboxNotification, InboxNotificationAvatarProps, InboxNotificationCustomKindProps, InboxNotificationCustomProps, InboxNotificationIconProps, InboxNotificationList, InboxNotificationListProps, InboxNotificationOverrides, InboxNotificationProps, InboxNotificationTextMentionKindProps, InboxNotificationTextMentionProps, InboxNotificationThreadKindProps, InboxNotificationThreadProps, LiveblocksUiConfig, LocalizationOverrides, Overrides, Thread, ThreadOverrides, ThreadProps, useOverrides };
|