@liveblocks/react-ui 3.15.0-components1 → 3.15.0-thread2
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/dist/_private/index.cjs +7 -1
- package/dist/_private/index.cjs.map +1 -1
- package/dist/_private/index.d.cts +10 -4
- package/dist/_private/index.d.ts +10 -4
- package/dist/_private/index.js +3 -1
- package/dist/_private/index.js.map +1 -1
- package/dist/components/AiChat.cjs +10 -2
- package/dist/components/AiChat.cjs.map +1 -1
- package/dist/components/AiChat.js +10 -2
- package/dist/components/AiChat.js.map +1 -1
- package/dist/components/Comment.cjs +277 -232
- package/dist/components/Comment.cjs.map +1 -1
- package/dist/components/Comment.js +263 -237
- package/dist/components/Comment.js.map +1 -1
- package/dist/components/Composer.cjs +4 -2
- package/dist/components/Composer.cjs.map +1 -1
- package/dist/components/Composer.js +5 -3
- package/dist/components/Composer.js.map +1 -1
- package/dist/components/InboxNotification.cjs +6 -4
- package/dist/components/InboxNotification.cjs.map +1 -1
- package/dist/components/InboxNotification.js +7 -5
- package/dist/components/InboxNotification.js.map +1 -1
- package/dist/components/Thread.cjs +71 -45
- package/dist/components/Thread.cjs.map +1 -1
- package/dist/components/Thread.js +56 -49
- package/dist/components/Thread.js.map +1 -1
- package/dist/components/internal/AiComposer.cjs +2 -1
- package/dist/components/internal/AiComposer.cjs.map +1 -1
- package/dist/components/internal/AiComposer.js +2 -1
- package/dist/components/internal/AiComposer.js.map +1 -1
- package/dist/components/internal/CodeBlock.cjs +2 -1
- package/dist/components/internal/CodeBlock.cjs.map +1 -1
- package/dist/components/internal/CodeBlock.js +2 -1
- package/dist/components/internal/CodeBlock.js.map +1 -1
- package/dist/components/internal/Dropdown.cjs +28 -7
- package/dist/components/internal/Dropdown.cjs.map +1 -1
- package/dist/components/internal/Dropdown.js +7 -7
- package/dist/components/internal/Dropdown.js.map +1 -1
- package/dist/components/internal/EmojiPicker.cjs +27 -6
- package/dist/components/internal/EmojiPicker.cjs.map +1 -1
- package/dist/components/internal/EmojiPicker.js +6 -6
- package/dist/components/internal/EmojiPicker.js.map +1 -1
- package/dist/components/internal/List.cjs +2 -2
- package/dist/components/internal/List.cjs.map +1 -1
- package/dist/components/internal/List.js +2 -2
- package/dist/components/internal/List.js.map +1 -1
- package/dist/components/internal/Tooltip.cjs +28 -7
- package/dist/components/internal/Tooltip.cjs.map +1 -1
- package/dist/components/internal/Tooltip.js +7 -7
- package/dist/components/internal/Tooltip.js.map +1 -1
- package/dist/index.cjs +0 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +197 -213
- package/dist/index.d.ts +197 -213
- package/dist/index.js +0 -6
- package/dist/index.js.map +1 -1
- package/dist/primitives/AiComposer/index.cjs +4 -5
- package/dist/primitives/AiComposer/index.cjs.map +1 -1
- package/dist/primitives/AiComposer/index.js +4 -5
- package/dist/primitives/AiComposer/index.js.map +1 -1
- package/dist/primitives/AiMessage/index.cjs +2 -2
- package/dist/primitives/AiMessage/index.cjs.map +1 -1
- package/dist/primitives/AiMessage/index.js +2 -2
- package/dist/primitives/AiMessage/index.js.map +1 -1
- package/dist/primitives/Collapsible/index.cjs +4 -4
- package/dist/primitives/Collapsible/index.cjs.map +1 -1
- package/dist/primitives/Collapsible/index.js +4 -4
- package/dist/primitives/Collapsible/index.js.map +1 -1
- package/dist/primitives/Comment/index.cjs +4 -4
- package/dist/primitives/Comment/index.cjs.map +1 -1
- package/dist/primitives/Comment/index.js +4 -4
- package/dist/primitives/Comment/index.js.map +1 -1
- package/dist/primitives/Composer/index.cjs +35 -23
- package/dist/primitives/Composer/index.cjs.map +1 -1
- package/dist/primitives/Composer/index.js +16 -23
- package/dist/primitives/Composer/index.js.map +1 -1
- package/dist/primitives/Duration.cjs +2 -2
- package/dist/primitives/Duration.cjs.map +1 -1
- package/dist/primitives/Duration.js +2 -2
- package/dist/primitives/Duration.js.map +1 -1
- package/dist/primitives/FileSize.cjs +2 -2
- package/dist/primitives/FileSize.cjs.map +1 -1
- package/dist/primitives/FileSize.js +2 -2
- package/dist/primitives/FileSize.js.map +1 -1
- package/dist/primitives/Markdown.cjs +2 -2
- package/dist/primitives/Markdown.cjs.map +1 -1
- package/dist/primitives/Markdown.js +2 -2
- package/dist/primitives/Markdown.js.map +1 -1
- package/dist/primitives/Timestamp.cjs +2 -2
- package/dist/primitives/Timestamp.cjs.map +1 -1
- package/dist/primitives/Timestamp.js +2 -2
- package/dist/primitives/Timestamp.js.map +1 -1
- package/dist/utils/Portal.cjs +2 -2
- package/dist/utils/Portal.cjs.map +1 -1
- package/dist/utils/Portal.js +2 -2
- package/dist/utils/Portal.js.map +1 -1
- package/dist/utils/use-stable-component.cjs +32 -0
- package/dist/utils/use-stable-component.cjs.map +1 -0
- package/dist/utils/use-stable-component.js +30 -0
- package/dist/utils/use-stable-component.js.map +1 -0
- 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 +10 -6
- package/src/styles/dark/index.css +1 -1
- package/src/styles/index.css +4 -252
- package/styles/dark/attributes.css +1 -1
- package/styles/dark/attributes.css.map +1 -1
- package/styles/dark/media-query.css +1 -1
- package/styles/dark/media-query.css.map +1 -1
- package/styles.css +1 -1
- package/styles.css.map +1 -1
- package/dist/components/AvatarStack.cjs +0 -115
- package/dist/components/AvatarStack.cjs.map +0 -1
- package/dist/components/AvatarStack.js +0 -113
- package/dist/components/AvatarStack.js.map +0 -1
- package/dist/components/CommentPin.cjs +0 -27
- package/dist/components/CommentPin.cjs.map +0 -1
- package/dist/components/CommentPin.js +0 -25
- package/dist/components/CommentPin.js.map +0 -1
- package/dist/components/Cursor.cjs +0 -40
- package/dist/components/Cursor.cjs.map +0 -1
- package/dist/components/Cursor.js +0 -38
- package/dist/components/Cursor.js.map +0 -1
- package/dist/components/Cursors.cjs +0 -252
- package/dist/components/Cursors.cjs.map +0 -1
- package/dist/components/Cursors.js +0 -250
- package/dist/components/Cursors.js.map +0 -1
- package/dist/components/FloatingComposer.cjs +0 -82
- package/dist/components/FloatingComposer.cjs.map +0 -1
- package/dist/components/FloatingComposer.js +0 -80
- package/dist/components/FloatingComposer.js.map +0 -1
- package/dist/components/FloatingThread.cjs +0 -82
- package/dist/components/FloatingThread.cjs.map +0 -1
- package/dist/components/FloatingThread.js +0 -80
- package/dist/components/FloatingThread.js.map +0 -1
- package/dist/utils/animation-loop.cjs +0 -44
- package/dist/utils/animation-loop.cjs.map +0 -1
- package/dist/utils/animation-loop.js +0 -42
- package/dist/utils/animation-loop.js.map +0 -1
- package/dist/utils/use-pre-resolve-user.cjs +0 -18
- package/dist/utils/use-pre-resolve-user.cjs.map +0 -1
- package/dist/utils/use-pre-resolve-user.js +0 -16
- package/dist/utils/use-pre-resolve-user.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ComponentType, ComponentPropsWithoutRef, ElementType, ReactNode, ComponentProps, FormEvent, RefAttributes, MouseEvent, PropsWithChildren } from 'react';
|
|
3
|
-
import { CommentAttachment, AiReasoningPart, AiRetrievalPart, Relax, WithNavigation, AiAssistantMessage, CopilotId, AiKnowledgeSource, AiOpaqueToolDefinition, AiToolTypePack, JsonObject, AiToolExecuteCallback, NoInfr, CommentBody, MentionData, BaseMetadata, DTM, DCM, Patchable, CommentData,
|
|
3
|
+
import { CommentAttachment, AiReasoningPart, AiRetrievalPart, Relax, WithNavigation, AiAssistantMessage, CopilotId, AiKnowledgeSource, AiOpaqueToolDefinition, AiToolTypePack, JsonObject, AiToolExecuteCallback, NoInfr, CommentBody, MentionData, BaseMetadata, DTM, DCM, Patchable, CommentData, HistoryVersion, InboxNotificationData, InboxNotificationThreadData, InboxNotificationTextMentionData, InboxNotificationCustomData, KDAD, ThreadData } from '@liveblocks/core';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
-
import { Popover } from 'radix-ui';
|
|
6
5
|
|
|
7
6
|
interface GlobalComponents {
|
|
8
7
|
Anchor: ComponentType<ComponentPropsWithoutRef<"a">> | "a";
|
|
@@ -810,25 +809,6 @@ declare const AiTool: react.ForwardRefExoticComponent<Omit<AiToolProps, "ref"> &
|
|
|
810
809
|
Confirmation: typeof AiToolConfirmation;
|
|
811
810
|
};
|
|
812
811
|
|
|
813
|
-
interface AvatarStackProps extends ComponentPropsWithoutRef<"div"> {
|
|
814
|
-
/**
|
|
815
|
-
* Optional additional user IDs to include in the stack.
|
|
816
|
-
*/
|
|
817
|
-
userIds?: string[];
|
|
818
|
-
/**
|
|
819
|
-
* The maximum number of visible avatars.
|
|
820
|
-
*/
|
|
821
|
-
max?: number;
|
|
822
|
-
/**
|
|
823
|
-
* Override the component's strings.
|
|
824
|
-
*/
|
|
825
|
-
overrides?: Partial<GlobalOverrides>;
|
|
826
|
-
}
|
|
827
|
-
/**
|
|
828
|
-
* Displays a stack of avatars for the users currently present in the room.
|
|
829
|
-
*/
|
|
830
|
-
declare const AvatarStack: react.ForwardRefExoticComponent<AvatarStackProps & react.RefAttributes<HTMLDivElement>>;
|
|
831
|
-
|
|
832
812
|
interface ComposerEditorMentionProps {
|
|
833
813
|
/**
|
|
834
814
|
* Whether the mention is selected.
|
|
@@ -1051,11 +1031,27 @@ type ComposerProps<TM extends BaseMetadata = DTM, CM extends BaseMetadata = DCM>
|
|
|
1051
1031
|
*/
|
|
1052
1032
|
declare const Composer: <TM extends BaseMetadata = DTM, CM extends BaseMetadata = DCM>(props: ComposerProps<TM, CM> & RefAttributes<HTMLFormElement>) => JSX.Element;
|
|
1053
1033
|
|
|
1054
|
-
interface CommentProps extends ComponentPropsWithoutRef<"div"> {
|
|
1034
|
+
interface CommentProps<CM extends BaseMetadata = DCM> extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
|
|
1055
1035
|
/**
|
|
1056
1036
|
* The comment to display.
|
|
1057
1037
|
*/
|
|
1058
|
-
comment: CommentData
|
|
1038
|
+
comment: CommentData<CM>;
|
|
1039
|
+
/**
|
|
1040
|
+
* The comment's avatar.
|
|
1041
|
+
* Can be combined with `Comment.Avatar` to easily follow default styles.
|
|
1042
|
+
*/
|
|
1043
|
+
avatar?: ReactNode;
|
|
1044
|
+
/**
|
|
1045
|
+
* The comment's author.
|
|
1046
|
+
* Can be combined with `Comment.Author` to easily follow default styles.
|
|
1047
|
+
*/
|
|
1048
|
+
author?: ReactNode;
|
|
1049
|
+
/**
|
|
1050
|
+
* The comment's date.
|
|
1051
|
+
* Can be combined with `Comment.Date` to easily follow default styles,
|
|
1052
|
+
* or the `Timestamp` primitive for more control.
|
|
1053
|
+
*/
|
|
1054
|
+
date?: ReactNode;
|
|
1059
1055
|
/**
|
|
1060
1056
|
* How to show or hide the actions.
|
|
1061
1057
|
*/
|
|
@@ -1080,6 +1076,10 @@ interface CommentProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
1080
1076
|
* Whether to indent the comment's content.
|
|
1081
1077
|
*/
|
|
1082
1078
|
indentContent?: boolean;
|
|
1079
|
+
/**
|
|
1080
|
+
* Additional content to display below the comment's body.
|
|
1081
|
+
*/
|
|
1082
|
+
additionalContent?: ReactNode;
|
|
1083
1083
|
/**
|
|
1084
1084
|
* The event handler called when the comment is edited.
|
|
1085
1085
|
*/
|
|
@@ -1104,7 +1104,13 @@ interface CommentProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
1104
1104
|
* Add (or change) items to display in the comment's dropdown.
|
|
1105
1105
|
*/
|
|
1106
1106
|
dropdownItems?: ReactNode | ((props: PropsWithChildren<{
|
|
1107
|
-
comment: CommentData
|
|
1107
|
+
comment: CommentData<CM>;
|
|
1108
|
+
}>) => ReactNode);
|
|
1109
|
+
/**
|
|
1110
|
+
* Override the comment's content.
|
|
1111
|
+
*/
|
|
1112
|
+
children?: ReactNode | ((props: PropsWithChildren<{
|
|
1113
|
+
comment: CommentData<CM>;
|
|
1108
1114
|
}>) => ReactNode);
|
|
1109
1115
|
/**
|
|
1110
1116
|
* Override the component's strings.
|
|
@@ -1115,6 +1121,31 @@ interface CommentProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
1115
1121
|
*/
|
|
1116
1122
|
components?: Partial<GlobalComponents>;
|
|
1117
1123
|
}
|
|
1124
|
+
interface CommentAvatarProps extends Omit<ComponentProps<"div">, "children"> {
|
|
1125
|
+
/**
|
|
1126
|
+
* The user ID to display the avatar for.
|
|
1127
|
+
*/
|
|
1128
|
+
userId: string;
|
|
1129
|
+
}
|
|
1130
|
+
interface CommentAuthorProps extends Omit<ComponentProps<"span">, "children"> {
|
|
1131
|
+
/**
|
|
1132
|
+
* The user ID to display the author for.
|
|
1133
|
+
*/
|
|
1134
|
+
userId: string;
|
|
1135
|
+
}
|
|
1136
|
+
interface CommentDateProps extends Omit<ComponentProps<"span">, "children"> {
|
|
1137
|
+
/**
|
|
1138
|
+
* The date to display.
|
|
1139
|
+
*/
|
|
1140
|
+
date: Date | string | number;
|
|
1141
|
+
/**
|
|
1142
|
+
* The locale used when formatting the date.
|
|
1143
|
+
*/
|
|
1144
|
+
locale?: string;
|
|
1145
|
+
}
|
|
1146
|
+
declare function CommentAvatar(props: CommentAvatarProps): react_jsx_runtime.JSX.Element;
|
|
1147
|
+
declare function CommentAuthor(props: CommentAuthorProps): react_jsx_runtime.JSX.Element;
|
|
1148
|
+
declare function CommentDate({ locale, date, className, ...props }: CommentDateProps): react_jsx_runtime.JSX.Element;
|
|
1118
1149
|
interface CommentDropdownItemProps extends Omit<ComponentPropsWithoutRef<"div">, "onSelect"> {
|
|
1119
1150
|
/**
|
|
1120
1151
|
* An optional icon displayed in this dropdown item.
|
|
@@ -1135,204 +1166,24 @@ interface CommentDropdownItemProps extends Omit<ComponentPropsWithoutRef<"div">,
|
|
|
1135
1166
|
* ))}
|
|
1136
1167
|
* </>
|
|
1137
1168
|
*/
|
|
1138
|
-
declare const Comment: react.ForwardRefExoticComponent<CommentProps & react.RefAttributes<HTMLDivElement>> & {
|
|
1169
|
+
declare const Comment: react.ForwardRefExoticComponent<CommentProps<BaseMetadata> & react.RefAttributes<HTMLDivElement>> & {
|
|
1139
1170
|
/**
|
|
1140
1171
|
* Displays a dropdown item in the comment's dropdown.
|
|
1141
1172
|
*/
|
|
1142
1173
|
DropdownItem: react.ForwardRefExoticComponent<CommentDropdownItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
1143
|
-
};
|
|
1144
|
-
|
|
1145
|
-
interface CommentPinProps extends ComponentPropsWithoutRef<"button"> {
|
|
1146
|
-
/**
|
|
1147
|
-
* The corner that points to the comment position.
|
|
1148
|
-
*/
|
|
1149
|
-
corner?: "top-left" | "top-right" | "bottom-right" | "bottom-left";
|
|
1150
|
-
/**
|
|
1151
|
-
* The user ID to optionally display an avatar for.
|
|
1152
|
-
*/
|
|
1153
|
-
userId?: string;
|
|
1154
|
-
}
|
|
1155
|
-
/**
|
|
1156
|
-
* Displays a comment pin that can be used as a trigger
|
|
1157
|
-
* for `FloatingComposer` and `FloatingThread`.
|
|
1158
|
-
*/
|
|
1159
|
-
declare const CommentPin: react.ForwardRefExoticComponent<CommentPinProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1160
|
-
|
|
1161
|
-
interface CursorProps extends ComponentPropsWithoutRef<"div"> {
|
|
1162
|
-
/**
|
|
1163
|
-
* A floating label to display next to the cursor.
|
|
1164
|
-
*/
|
|
1165
|
-
label?: ReactNode;
|
|
1166
|
-
/**
|
|
1167
|
-
* The color of the cursor.
|
|
1168
|
-
*/
|
|
1169
|
-
color?: string;
|
|
1170
|
-
}
|
|
1171
|
-
/**
|
|
1172
|
-
* Displays a multiplayer cursor.
|
|
1173
|
-
*/
|
|
1174
|
-
declare const Cursor: react.ForwardRefExoticComponent<CursorProps & react.RefAttributes<HTMLDivElement>>;
|
|
1175
|
-
|
|
1176
|
-
interface CursorsProps extends ComponentPropsWithoutRef<"div"> {
|
|
1177
|
-
/**
|
|
1178
|
-
* The key used to store the cursors in users' Presence.
|
|
1179
|
-
* This can be used to have multiple `Cursors` in a single room.
|
|
1180
|
-
*/
|
|
1181
|
-
presenceKey?: string;
|
|
1182
|
-
}
|
|
1183
|
-
/**
|
|
1184
|
-
* Displays multiplayer cursors.
|
|
1185
|
-
*/
|
|
1186
|
-
declare const Cursors: react.ForwardRefExoticComponent<CursorsProps & react.RefAttributes<HTMLDivElement>>;
|
|
1187
|
-
|
|
1188
|
-
interface FloatingComposerProps<TM extends BaseMetadata = DTM, CM extends BaseMetadata = DCM> extends Omit<ComposerProps<TM, CM>, "collapsed" | "onCollapsedChange" | "defaultCollapsed">, Relax<Pick<Popover.PopoverProps, "defaultOpen" | "open" | "onOpenChange"> & Pick<Popover.PopoverContentProps, "side" | "sideOffset" | "align" | "alignOffset">> {
|
|
1189
|
-
/**
|
|
1190
|
-
* The element which opens the floating composer.
|
|
1191
|
-
*/
|
|
1192
|
-
children: ReactNode;
|
|
1193
|
-
}
|
|
1194
|
-
/**
|
|
1195
|
-
* Displays a floating composer attached to a trigger element.
|
|
1196
|
-
*/
|
|
1197
|
-
declare const FloatingComposer: <TM extends BaseMetadata = DTM, CM extends BaseMetadata = DCM>(props: FloatingComposerProps<TM, CM> & RefAttributes<HTMLFormElement>) => JSX.Element;
|
|
1198
|
-
|
|
1199
|
-
interface ThreadProps<TM extends BaseMetadata = DTM, CM extends BaseMetadata = DCM> extends ComponentPropsWithoutRef<"div"> {
|
|
1200
|
-
/**
|
|
1201
|
-
* The thread to display.
|
|
1202
|
-
*/
|
|
1203
|
-
thread: ThreadData<TM, CM>;
|
|
1204
|
-
/**
|
|
1205
|
-
* How to show or hide the composer to reply to the thread.
|
|
1206
|
-
*/
|
|
1207
|
-
showComposer?: boolean | "collapsed";
|
|
1208
|
-
/**
|
|
1209
|
-
* Whether to show the action to resolve the thread.
|
|
1210
|
-
*/
|
|
1211
|
-
showResolveAction?: boolean;
|
|
1212
1174
|
/**
|
|
1213
|
-
*
|
|
1214
|
-
*/
|
|
1215
|
-
showActions?: CommentProps["showActions"];
|
|
1216
|
-
/**
|
|
1217
|
-
* Whether to show reactions.
|
|
1218
|
-
*/
|
|
1219
|
-
showReactions?: CommentProps["showReactions"];
|
|
1220
|
-
/**
|
|
1221
|
-
* Whether to show the composer's formatting controls.
|
|
1222
|
-
*/
|
|
1223
|
-
showComposerFormattingControls?: ComposerProps["showFormattingControls"];
|
|
1224
|
-
/**
|
|
1225
|
-
* Add (or change) items to display in a comment's dropdown.
|
|
1226
|
-
*/
|
|
1227
|
-
commentDropdownItems?: ReactNode | ((props: PropsWithChildren<{
|
|
1228
|
-
comment: CommentData;
|
|
1229
|
-
}>) => ReactNode);
|
|
1230
|
-
/**
|
|
1231
|
-
* The maximum number of comments to show.
|
|
1232
|
-
*
|
|
1233
|
-
* The first and last comments are always shown and by default if some comments
|
|
1234
|
-
* are hidden, only the first comment will be shown before the "show more" button
|
|
1235
|
-
* and after it will be shown all the newest comments to fit the limit set.
|
|
1236
|
-
*
|
|
1237
|
-
* It's possible to customize this by setting `maxVisibleComments` to an object:
|
|
1238
|
-
*
|
|
1239
|
-
* @example
|
|
1240
|
-
* // Only show the last comment, and all the older ones to fit the limit.
|
|
1241
|
-
* <Thread maxVisibleComments={{ max: 5, show: "oldest" }} />
|
|
1242
|
-
*
|
|
1243
|
-
* @example
|
|
1244
|
-
* // Show as many old comments as new ones to fit the limit.
|
|
1245
|
-
* <Thread maxVisibleComments={{ max: 5, show: "both" }} />
|
|
1246
|
-
*/
|
|
1247
|
-
maxVisibleComments?: number | {
|
|
1248
|
-
max: number;
|
|
1249
|
-
show: "oldest" | "both" | "newest";
|
|
1250
|
-
};
|
|
1251
|
-
/**
|
|
1252
|
-
* Whether to blur the composer editor when the composer is submitted.
|
|
1253
|
-
*/
|
|
1254
|
-
blurComposerOnSubmit?: ComposerProps["blurOnSubmit"];
|
|
1255
|
-
/**
|
|
1256
|
-
* Whether to indent the comments' content.
|
|
1257
|
-
*/
|
|
1258
|
-
indentCommentContent?: CommentProps["indentContent"];
|
|
1259
|
-
/**
|
|
1260
|
-
* Whether to show deleted comments.
|
|
1261
|
-
*/
|
|
1262
|
-
showDeletedComments?: CommentProps["showDeleted"];
|
|
1263
|
-
/**
|
|
1264
|
-
* Whether to show attachments.
|
|
1265
|
-
*/
|
|
1266
|
-
showAttachments?: boolean;
|
|
1267
|
-
/**
|
|
1268
|
-
* The event handler called when changing the resolved status.
|
|
1269
|
-
*/
|
|
1270
|
-
onResolvedChange?: (resolved: boolean) => void;
|
|
1271
|
-
/**
|
|
1272
|
-
* The event handler called when a comment is edited.
|
|
1273
|
-
*/
|
|
1274
|
-
onCommentEdit?: CommentProps["onCommentEdit"];
|
|
1275
|
-
/**
|
|
1276
|
-
* The event handler called when a comment is deleted.
|
|
1277
|
-
*/
|
|
1278
|
-
onCommentDelete?: CommentProps["onCommentDelete"];
|
|
1279
|
-
/**
|
|
1280
|
-
* The event handler called when the thread is deleted.
|
|
1281
|
-
* A thread is deleted when all its comments are deleted.
|
|
1282
|
-
*/
|
|
1283
|
-
onThreadDelete?: (thread: ThreadData<TM, CM>) => void;
|
|
1284
|
-
/**
|
|
1285
|
-
* The event handler called when clicking on a comment's author.
|
|
1286
|
-
*/
|
|
1287
|
-
onAuthorClick?: CommentProps["onAuthorClick"];
|
|
1288
|
-
/**
|
|
1289
|
-
* The event handler called when clicking on a mention.
|
|
1175
|
+
* Displays a comment's avatar.
|
|
1290
1176
|
*/
|
|
1291
|
-
|
|
1177
|
+
Avatar: typeof CommentAvatar;
|
|
1292
1178
|
/**
|
|
1293
|
-
*
|
|
1179
|
+
* Displays a comment's author.
|
|
1294
1180
|
*/
|
|
1295
|
-
|
|
1181
|
+
Author: typeof CommentAuthor;
|
|
1296
1182
|
/**
|
|
1297
|
-
*
|
|
1183
|
+
* Displays a comment's date.
|
|
1298
1184
|
*/
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
* Whether to focus the composer on mount.
|
|
1302
|
-
*/
|
|
1303
|
-
autoFocus?: ComposerProps["autoFocus"];
|
|
1304
|
-
/**
|
|
1305
|
-
* Override the component's strings.
|
|
1306
|
-
*/
|
|
1307
|
-
overrides?: Partial<GlobalOverrides & ThreadOverrides & CommentOverrides & ComposerOverrides>;
|
|
1308
|
-
/**
|
|
1309
|
-
* Override the component's components.
|
|
1310
|
-
*/
|
|
1311
|
-
components?: Partial<GlobalComponents>;
|
|
1312
|
-
}
|
|
1313
|
-
/**
|
|
1314
|
-
* Displays a thread of comments, with a composer to reply
|
|
1315
|
-
* to it.
|
|
1316
|
-
*
|
|
1317
|
-
* @example
|
|
1318
|
-
* <>
|
|
1319
|
-
* {threads.map((thread) => (
|
|
1320
|
-
* <Thread key={thread.id} thread={thread} />
|
|
1321
|
-
* ))}
|
|
1322
|
-
* </>
|
|
1323
|
-
*/
|
|
1324
|
-
declare const Thread: <TM extends BaseMetadata = DTM, CM extends BaseMetadata = DCM>(props: ThreadProps<TM, CM> & RefAttributes<HTMLDivElement>) => JSX.Element;
|
|
1325
|
-
|
|
1326
|
-
interface FloatingThreadProps<TM extends BaseMetadata = DTM, CM extends BaseMetadata = DCM> extends ThreadProps<TM, CM>, Relax<Pick<Popover.PopoverProps, "defaultOpen" | "open" | "onOpenChange"> & Pick<Popover.PopoverContentProps, "side" | "sideOffset" | "align" | "alignOffset">> {
|
|
1327
|
-
/**
|
|
1328
|
-
* The element which opens the floating thread.
|
|
1329
|
-
*/
|
|
1330
|
-
children: ReactNode;
|
|
1331
|
-
}
|
|
1332
|
-
/**
|
|
1333
|
-
* Displays a floating thread attached to a trigger element.
|
|
1334
|
-
*/
|
|
1335
|
-
declare const FloatingThread: <TM extends BaseMetadata = DTM, CM extends BaseMetadata = DCM>(props: FloatingThreadProps<TM, CM> & RefAttributes<HTMLDivElement>) => JSX.Element;
|
|
1185
|
+
Date: typeof CommentDate;
|
|
1186
|
+
};
|
|
1336
1187
|
|
|
1337
1188
|
interface HistoryVersionSummaryProps extends ComponentPropsWithoutRef<"button"> {
|
|
1338
1189
|
version: HistoryVersion;
|
|
@@ -1529,6 +1380,139 @@ interface InboxNotificationListProps extends ComponentPropsWithoutRef<"ol"> {
|
|
|
1529
1380
|
*/
|
|
1530
1381
|
declare const InboxNotificationList: react.ForwardRefExoticComponent<InboxNotificationListProps & react.RefAttributes<HTMLOListElement>>;
|
|
1531
1382
|
|
|
1383
|
+
interface ThreadComponents<_TM extends BaseMetadata = DTM, CM extends BaseMetadata = DCM> {
|
|
1384
|
+
/**
|
|
1385
|
+
* The component used to display comments.
|
|
1386
|
+
*/
|
|
1387
|
+
Comment: ComponentType<CommentProps<CM>>;
|
|
1388
|
+
}
|
|
1389
|
+
interface ThreadProps<TM extends BaseMetadata = DTM, CM extends BaseMetadata = DCM> extends ComponentPropsWithoutRef<"div"> {
|
|
1390
|
+
/**
|
|
1391
|
+
* The thread to display.
|
|
1392
|
+
*/
|
|
1393
|
+
thread: ThreadData<TM, CM>;
|
|
1394
|
+
/**
|
|
1395
|
+
* How to show or hide the composer to reply to the thread.
|
|
1396
|
+
*/
|
|
1397
|
+
showComposer?: boolean | "collapsed";
|
|
1398
|
+
/**
|
|
1399
|
+
* Whether to show the action to resolve the thread.
|
|
1400
|
+
*/
|
|
1401
|
+
showResolveAction?: boolean;
|
|
1402
|
+
/**
|
|
1403
|
+
* How to show or hide the actions.
|
|
1404
|
+
*/
|
|
1405
|
+
showActions?: CommentProps["showActions"];
|
|
1406
|
+
/**
|
|
1407
|
+
* Whether to show reactions.
|
|
1408
|
+
*/
|
|
1409
|
+
showReactions?: CommentProps["showReactions"];
|
|
1410
|
+
/**
|
|
1411
|
+
* Whether to show the composer's formatting controls.
|
|
1412
|
+
*/
|
|
1413
|
+
showComposerFormattingControls?: ComposerProps["showFormattingControls"];
|
|
1414
|
+
/**
|
|
1415
|
+
* Add (or change) items to display in a comment's dropdown.
|
|
1416
|
+
*/
|
|
1417
|
+
commentDropdownItems?: ReactNode | ((props: PropsWithChildren<{
|
|
1418
|
+
comment: CommentData<CM>;
|
|
1419
|
+
}>) => ReactNode);
|
|
1420
|
+
/**
|
|
1421
|
+
* The maximum number of comments to show.
|
|
1422
|
+
*
|
|
1423
|
+
* The first and last comments are always shown and by default if some comments
|
|
1424
|
+
* are hidden, only the first comment will be shown before the "show more" button
|
|
1425
|
+
* and after it will be shown all the newest comments to fit the limit set.
|
|
1426
|
+
*
|
|
1427
|
+
* It's possible to customize this by setting `maxVisibleComments` to an object:
|
|
1428
|
+
*
|
|
1429
|
+
* @example
|
|
1430
|
+
* // Only show the last comment, and all the older ones to fit the limit.
|
|
1431
|
+
* <Thread maxVisibleComments={{ max: 5, show: "oldest" }} />
|
|
1432
|
+
*
|
|
1433
|
+
* @example
|
|
1434
|
+
* // Show as many old comments as new ones to fit the limit.
|
|
1435
|
+
* <Thread maxVisibleComments={{ max: 5, show: "both" }} />
|
|
1436
|
+
*/
|
|
1437
|
+
maxVisibleComments?: number | {
|
|
1438
|
+
max: number;
|
|
1439
|
+
show: "oldest" | "both" | "newest";
|
|
1440
|
+
};
|
|
1441
|
+
/**
|
|
1442
|
+
* Whether to blur the composer editor when the composer is submitted.
|
|
1443
|
+
*/
|
|
1444
|
+
blurComposerOnSubmit?: ComposerProps["blurOnSubmit"];
|
|
1445
|
+
/**
|
|
1446
|
+
* Whether to indent the comments' content.
|
|
1447
|
+
*/
|
|
1448
|
+
indentCommentContent?: CommentProps["indentContent"];
|
|
1449
|
+
/**
|
|
1450
|
+
* Additional content to display below the thread's comments.
|
|
1451
|
+
*/
|
|
1452
|
+
additionalContent?: ReactNode;
|
|
1453
|
+
/**
|
|
1454
|
+
* Whether to show deleted comments.
|
|
1455
|
+
*/
|
|
1456
|
+
showDeletedComments?: CommentProps["showDeleted"];
|
|
1457
|
+
/**
|
|
1458
|
+
* Whether to show attachments.
|
|
1459
|
+
*/
|
|
1460
|
+
showAttachments?: boolean;
|
|
1461
|
+
/**
|
|
1462
|
+
* The event handler called when changing the resolved status.
|
|
1463
|
+
*/
|
|
1464
|
+
onResolvedChange?: (resolved: boolean) => void;
|
|
1465
|
+
/**
|
|
1466
|
+
* The event handler called when a comment is edited.
|
|
1467
|
+
*/
|
|
1468
|
+
onCommentEdit?: CommentProps["onCommentEdit"];
|
|
1469
|
+
/**
|
|
1470
|
+
* The event handler called when a comment is deleted.
|
|
1471
|
+
*/
|
|
1472
|
+
onCommentDelete?: CommentProps["onCommentDelete"];
|
|
1473
|
+
/**
|
|
1474
|
+
* The event handler called when the thread is deleted.
|
|
1475
|
+
* A thread is deleted when all its comments are deleted.
|
|
1476
|
+
*/
|
|
1477
|
+
onThreadDelete?: (thread: ThreadData<TM, CM>) => void;
|
|
1478
|
+
/**
|
|
1479
|
+
* The event handler called when clicking on a comment's author.
|
|
1480
|
+
*/
|
|
1481
|
+
onAuthorClick?: CommentProps["onAuthorClick"];
|
|
1482
|
+
/**
|
|
1483
|
+
* The event handler called when clicking on a mention.
|
|
1484
|
+
*/
|
|
1485
|
+
onMentionClick?: CommentProps["onMentionClick"];
|
|
1486
|
+
/**
|
|
1487
|
+
* The event handler called when clicking on a comment's attachment.
|
|
1488
|
+
*/
|
|
1489
|
+
onAttachmentClick?: CommentProps["onAttachmentClick"];
|
|
1490
|
+
/**
|
|
1491
|
+
* The event handler called when the composer is submitted.
|
|
1492
|
+
*/
|
|
1493
|
+
onComposerSubmit?: ComposerProps["onComposerSubmit"];
|
|
1494
|
+
/**
|
|
1495
|
+
* Override the component's strings.
|
|
1496
|
+
*/
|
|
1497
|
+
overrides?: Partial<GlobalOverrides & ThreadOverrides & CommentOverrides & ComposerOverrides>;
|
|
1498
|
+
/**
|
|
1499
|
+
* Override the component's components.
|
|
1500
|
+
*/
|
|
1501
|
+
components?: Partial<GlobalComponents & ThreadComponents>;
|
|
1502
|
+
}
|
|
1503
|
+
/**
|
|
1504
|
+
* Displays a thread of comments, with a composer to reply
|
|
1505
|
+
* to it.
|
|
1506
|
+
*
|
|
1507
|
+
* @example
|
|
1508
|
+
* <>
|
|
1509
|
+
* {threads.map((thread) => (
|
|
1510
|
+
* <Thread key={thread.id} thread={thread} />
|
|
1511
|
+
* ))}
|
|
1512
|
+
* </>
|
|
1513
|
+
*/
|
|
1514
|
+
declare const Thread: <TM extends BaseMetadata = DTM, CM extends BaseMetadata = DCM>(props: ThreadProps<TM, CM> & RefAttributes<HTMLDivElement>) => JSX.Element;
|
|
1515
|
+
|
|
1532
1516
|
type LiveblocksUiConfigProps = PropsWithChildren<{
|
|
1533
1517
|
/**
|
|
1534
1518
|
* Override the components' strings.
|
|
@@ -1728,4 +1712,4 @@ declare namespace icon {
|
|
|
1728
1712
|
};
|
|
1729
1713
|
}
|
|
1730
1714
|
|
|
1731
|
-
export { AiChat, AiChatComponents, AiChatComponentsEmptyProps, AiChatComponentsLoadingProps, AiChatProps, AiComposerSubmitMessage, AiTool, AiToolIconProps, AiToolProps,
|
|
1715
|
+
export { AiChat, AiChatComponents, AiChatComponentsEmptyProps, AiChatComponentsLoadingProps, AiChatProps, AiComposerSubmitMessage, AiTool, AiToolIconProps, AiToolProps, Comment, CommentAttachmentArgs, CommentAuthorProps, CommentAvatarProps, CommentDateProps, CommentDropdownItemProps, CommentOverrides, CommentProps, Composer, ComposerBodyMark, ComposerBodyMarks, ComposerOverrides, ComposerProps, ComposerSubmitComment, GlobalOverrides, HistoryVersionSummary, HistoryVersionSummaryList, HistoryVersionSummaryListProps, HistoryVersionSummaryProps, icon as Icon, InboxNotification, InboxNotificationAvatarProps, InboxNotificationCustomKindProps, InboxNotificationCustomProps, InboxNotificationIconProps, InboxNotificationInspectorProps, InboxNotificationList, InboxNotificationListProps, InboxNotificationOverrides, InboxNotificationProps, InboxNotificationTextMentionKindProps, InboxNotificationTextMentionProps, InboxNotificationThreadKindProps, InboxNotificationThreadProps, LiveblocksUiConfig, LocalizationOverrides, Overrides, Thread, ThreadOverrides, ThreadProps, useOverrides };
|
package/dist/index.js
CHANGED
|
@@ -2,14 +2,8 @@ import { detectDupes } from '@liveblocks/core';
|
|
|
2
2
|
import { PKG_NAME, PKG_VERSION, PKG_FORMAT } from './version.js';
|
|
3
3
|
export { AiChat } from './components/AiChat.js';
|
|
4
4
|
export { AiTool } from './components/AiTool.js';
|
|
5
|
-
export { AvatarStack } from './components/AvatarStack.js';
|
|
6
5
|
export { Comment } from './components/Comment.js';
|
|
7
|
-
export { CommentPin } from './components/CommentPin.js';
|
|
8
6
|
export { Composer } from './components/Composer.js';
|
|
9
|
-
export { Cursor } from './components/Cursor.js';
|
|
10
|
-
export { Cursors } from './components/Cursors.js';
|
|
11
|
-
export { FloatingComposer } from './components/FloatingComposer.js';
|
|
12
|
-
export { FloatingThread } from './components/FloatingThread.js';
|
|
13
7
|
export { HistoryVersionSummary } from './components/HistoryVersionSummary.js';
|
|
14
8
|
export { HistoryVersionSummaryList } from './components/HistoryVersionSummaryList.js';
|
|
15
9
|
export { InboxNotification } from './components/InboxNotification.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\n\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport type {\n AiChatComponents,\n AiChatComponentsEmptyProps,\n AiChatComponentsLoadingProps,\n AiChatProps,\n} from \"./components/AiChat\";\nexport { AiChat } from \"./components/AiChat\";\nexport type { AiToolIconProps, AiToolProps } from \"./components/AiTool\";\nexport { AiTool } from \"./components/AiTool\";\nexport type {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\n\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport type {\n AiChatComponents,\n AiChatComponentsEmptyProps,\n AiChatComponentsLoadingProps,\n AiChatProps,\n} from \"./components/AiChat\";\nexport { AiChat } from \"./components/AiChat\";\nexport type { AiToolIconProps, AiToolProps } from \"./components/AiTool\";\nexport { AiTool } from \"./components/AiTool\";\nexport type {\n CommentAuthorProps,\n CommentAvatarProps,\n CommentDateProps,\n CommentDropdownItemProps,\n CommentProps,\n} from \"./components/Comment\";\nexport { Comment } from \"./components/Comment\";\nexport type { ComposerProps } from \"./components/Composer\";\nexport { Composer } from \"./components/Composer\";\nexport type { HistoryVersionSummaryProps } from \"./components/HistoryVersionSummary\";\nexport { HistoryVersionSummary } from \"./components/HistoryVersionSummary\";\nexport type { HistoryVersionSummaryListProps } from \"./components/HistoryVersionSummaryList\";\nexport { HistoryVersionSummaryList } from \"./components/HistoryVersionSummaryList\";\nexport type {\n InboxNotificationAvatarProps,\n InboxNotificationCustomKindProps,\n InboxNotificationCustomProps,\n InboxNotificationIconProps,\n InboxNotificationInspectorProps,\n InboxNotificationProps,\n InboxNotificationTextMentionKindProps,\n InboxNotificationTextMentionProps,\n InboxNotificationThreadKindProps,\n InboxNotificationThreadProps,\n} from \"./components/InboxNotification\";\nexport { InboxNotification } from \"./components/InboxNotification\";\nexport type { InboxNotificationListProps } from \"./components/InboxNotificationList\";\nexport { InboxNotificationList } from \"./components/InboxNotificationList\";\nexport type { ThreadProps } from \"./components/Thread\";\nexport { Thread } from \"./components/Thread\";\nexport { LiveblocksUiConfig } from \"./config\";\nexport * as Icon from \"./icon\";\nexport type {\n CommentOverrides,\n ComposerOverrides,\n GlobalOverrides,\n InboxNotificationOverrides,\n LocalizationOverrides,\n Overrides,\n ThreadOverrides,\n} from \"./overrides\";\nexport { useOverrides } from \"./overrides\";\nexport type {\n AiComposerSubmitMessage,\n ComposerSubmitComment,\n} from \"./primitives\";\nexport type {\n CommentAttachmentArgs,\n ComposerBodyMark,\n ComposerBodyMarks,\n} from \"./types\";\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAIA,WAAY,CAAA,QAAA,EAAU,aAAa,UAAU,CAAA"}
|
|
@@ -4,7 +4,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
4
4
|
var core = require('@liveblocks/core');
|
|
5
5
|
var react$1 = require('@liveblocks/react');
|
|
6
6
|
var _private = require('@liveblocks/react/_private');
|
|
7
|
-
var
|
|
7
|
+
var reactSlot = require('@radix-ui/react-slot');
|
|
8
8
|
var react = require('react');
|
|
9
9
|
var slate = require('slate');
|
|
10
10
|
var slateHistory = require('slate-history');
|
|
@@ -43,7 +43,7 @@ const AiComposerForm = react.forwardRef(
|
|
|
43
43
|
asChild,
|
|
44
44
|
...props
|
|
45
45
|
}, forwardedRef) => {
|
|
46
|
-
const Component = asChild ?
|
|
46
|
+
const Component = asChild ? reactSlot.Slot : "form";
|
|
47
47
|
const client = react$1.useClient();
|
|
48
48
|
const formRef = react.useRef(null);
|
|
49
49
|
const editor = useInitial.useInitial(
|
|
@@ -302,7 +302,6 @@ const AiComposerEditor = react.forwardRef(
|
|
|
302
302
|
slateReact.Editable,
|
|
303
303
|
{
|
|
304
304
|
dir,
|
|
305
|
-
tabIndex: isDisabled ? -1 : 0,
|
|
306
305
|
enterKeyHint: "send",
|
|
307
306
|
autoCapitalize: "sentences",
|
|
308
307
|
"aria-label": "Composer editor",
|
|
@@ -322,7 +321,7 @@ const AiComposerEditor = react.forwardRef(
|
|
|
322
321
|
}
|
|
323
322
|
);
|
|
324
323
|
const AiComposerSubmit = react.forwardRef(({ disabled, asChild, ...props }, forwardedRef) => {
|
|
325
|
-
const Component = asChild ?
|
|
324
|
+
const Component = asChild ? reactSlot.Slot : "button";
|
|
326
325
|
const { isDisabled: isComposerDisabled, canSubmit } = contexts.useAiComposer();
|
|
327
326
|
const isDisabled = isComposerDisabled || disabled || !canSubmit;
|
|
328
327
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -336,7 +335,7 @@ const AiComposerSubmit = react.forwardRef(({ disabled, asChild, ...props }, forw
|
|
|
336
335
|
);
|
|
337
336
|
});
|
|
338
337
|
const AiComposerAbort = react.forwardRef(({ disabled, onClick, asChild, ...props }, forwardedRef) => {
|
|
339
|
-
const Component = asChild ?
|
|
338
|
+
const Component = asChild ? reactSlot.Slot : "button";
|
|
340
339
|
const { isDisabled: isComposerDisabled, canAbort, abort } = contexts.useAiComposer();
|
|
341
340
|
const isDisabled = isComposerDisabled || disabled || !canAbort;
|
|
342
341
|
const handleClick = react.useCallback(
|