@liveblocks/react-ui 3.15.0-thread2 → 3.15.1-rc1

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.
Files changed (157) hide show
  1. package/README.md +6 -16
  2. package/dist/_private/index.cjs +3 -5
  3. package/dist/_private/index.cjs.map +1 -1
  4. package/dist/_private/index.d.cts +6 -4
  5. package/dist/_private/index.d.ts +6 -4
  6. package/dist/_private/index.js +2 -2
  7. package/dist/components/AvatarStack.cjs +122 -0
  8. package/dist/components/AvatarStack.cjs.map +1 -0
  9. package/dist/components/AvatarStack.js +120 -0
  10. package/dist/components/AvatarStack.js.map +1 -0
  11. package/dist/components/Comment.cjs +10 -28
  12. package/dist/components/Comment.cjs.map +1 -1
  13. package/dist/components/Comment.js +12 -11
  14. package/dist/components/Comment.js.map +1 -1
  15. package/dist/components/CommentPin.cjs +38 -0
  16. package/dist/components/CommentPin.cjs.map +1 -0
  17. package/dist/components/CommentPin.js +36 -0
  18. package/dist/components/CommentPin.js.map +1 -0
  19. package/dist/components/Composer.cjs +2 -4
  20. package/dist/components/Composer.cjs.map +1 -1
  21. package/dist/components/Composer.js +3 -5
  22. package/dist/components/Composer.js.map +1 -1
  23. package/dist/components/Cursor.cjs +40 -0
  24. package/dist/components/Cursor.cjs.map +1 -0
  25. package/dist/components/Cursor.js +38 -0
  26. package/dist/components/Cursor.js.map +1 -0
  27. package/dist/components/Cursors.cjs +256 -0
  28. package/dist/components/Cursors.cjs.map +1 -0
  29. package/dist/components/Cursors.js +254 -0
  30. package/dist/components/Cursors.js.map +1 -0
  31. package/dist/components/FloatingComposer.cjs +97 -0
  32. package/dist/components/FloatingComposer.cjs.map +1 -0
  33. package/dist/components/FloatingComposer.js +95 -0
  34. package/dist/components/FloatingComposer.js.map +1 -0
  35. package/dist/components/FloatingThread.cjs +83 -0
  36. package/dist/components/FloatingThread.cjs.map +1 -0
  37. package/dist/components/FloatingThread.js +81 -0
  38. package/dist/components/FloatingThread.js.map +1 -0
  39. package/dist/components/InboxNotification.cjs +4 -6
  40. package/dist/components/InboxNotification.cjs.map +1 -1
  41. package/dist/components/InboxNotification.js +5 -7
  42. package/dist/components/InboxNotification.js.map +1 -1
  43. package/dist/components/Thread.cjs +19 -28
  44. package/dist/components/Thread.cjs.map +1 -1
  45. package/dist/components/Thread.js +19 -9
  46. package/dist/components/Thread.js.map +1 -1
  47. package/dist/components/internal/AiComposer.cjs +1 -2
  48. package/dist/components/internal/AiComposer.cjs.map +1 -1
  49. package/dist/components/internal/AiComposer.js +1 -2
  50. package/dist/components/internal/AiComposer.js.map +1 -1
  51. package/dist/components/internal/Avatar.cjs +10 -13
  52. package/dist/components/internal/Avatar.cjs.map +1 -1
  53. package/dist/components/internal/Avatar.js +11 -14
  54. package/dist/components/internal/Avatar.js.map +1 -1
  55. package/dist/components/internal/CodeBlock.cjs +1 -2
  56. package/dist/components/internal/CodeBlock.cjs.map +1 -1
  57. package/dist/components/internal/CodeBlock.js +1 -2
  58. package/dist/components/internal/CodeBlock.js.map +1 -1
  59. package/dist/components/internal/Dropdown.cjs +8 -28
  60. package/dist/components/internal/Dropdown.cjs.map +1 -1
  61. package/dist/components/internal/Dropdown.js +8 -7
  62. package/dist/components/internal/Dropdown.js.map +1 -1
  63. package/dist/components/internal/EmojiPicker.cjs +7 -27
  64. package/dist/components/internal/EmojiPicker.cjs.map +1 -1
  65. package/dist/components/internal/EmojiPicker.js +7 -6
  66. package/dist/components/internal/EmojiPicker.js.map +1 -1
  67. package/dist/components/internal/List.cjs +2 -2
  68. package/dist/components/internal/List.cjs.map +1 -1
  69. package/dist/components/internal/List.js +2 -2
  70. package/dist/components/internal/List.js.map +1 -1
  71. package/dist/components/internal/Tooltip.cjs +8 -28
  72. package/dist/components/internal/Tooltip.cjs.map +1 -1
  73. package/dist/components/internal/Tooltip.js +8 -7
  74. package/dist/components/internal/Tooltip.js.map +1 -1
  75. package/dist/icon.cjs +2 -0
  76. package/dist/icon.cjs.map +1 -1
  77. package/dist/icon.js +1 -0
  78. package/dist/icon.js.map +1 -1
  79. package/dist/icons/Plus.cjs +11 -0
  80. package/dist/icons/Plus.cjs.map +1 -0
  81. package/dist/icons/Plus.js +9 -0
  82. package/dist/icons/Plus.js.map +1 -0
  83. package/dist/icons/index.cjs +2 -0
  84. package/dist/icons/index.cjs.map +1 -1
  85. package/dist/icons/index.js +1 -0
  86. package/dist/icons/index.js.map +1 -1
  87. package/dist/index.cjs +12 -0
  88. package/dist/index.cjs.map +1 -1
  89. package/dist/index.d.cts +240 -137
  90. package/dist/index.d.ts +240 -137
  91. package/dist/index.js +6 -0
  92. package/dist/index.js.map +1 -1
  93. package/dist/primitives/AiComposer/index.cjs +5 -4
  94. package/dist/primitives/AiComposer/index.cjs.map +1 -1
  95. package/dist/primitives/AiComposer/index.js +5 -4
  96. package/dist/primitives/AiComposer/index.js.map +1 -1
  97. package/dist/primitives/AiMessage/index.cjs +2 -2
  98. package/dist/primitives/AiMessage/index.cjs.map +1 -1
  99. package/dist/primitives/AiMessage/index.js +2 -2
  100. package/dist/primitives/AiMessage/index.js.map +1 -1
  101. package/dist/primitives/Collapsible/index.cjs +4 -4
  102. package/dist/primitives/Collapsible/index.cjs.map +1 -1
  103. package/dist/primitives/Collapsible/index.js +4 -4
  104. package/dist/primitives/Collapsible/index.js.map +1 -1
  105. package/dist/primitives/Comment/index.cjs +4 -4
  106. package/dist/primitives/Comment/index.cjs.map +1 -1
  107. package/dist/primitives/Comment/index.js +4 -4
  108. package/dist/primitives/Comment/index.js.map +1 -1
  109. package/dist/primitives/Composer/index.cjs +23 -35
  110. package/dist/primitives/Composer/index.cjs.map +1 -1
  111. package/dist/primitives/Composer/index.js +23 -16
  112. package/dist/primitives/Composer/index.js.map +1 -1
  113. package/dist/primitives/Duration.cjs +2 -2
  114. package/dist/primitives/Duration.cjs.map +1 -1
  115. package/dist/primitives/Duration.js +2 -2
  116. package/dist/primitives/Duration.js.map +1 -1
  117. package/dist/primitives/FileSize.cjs +2 -2
  118. package/dist/primitives/FileSize.cjs.map +1 -1
  119. package/dist/primitives/FileSize.js +2 -2
  120. package/dist/primitives/FileSize.js.map +1 -1
  121. package/dist/primitives/Markdown.cjs +2 -2
  122. package/dist/primitives/Markdown.cjs.map +1 -1
  123. package/dist/primitives/Markdown.js +2 -2
  124. package/dist/primitives/Markdown.js.map +1 -1
  125. package/dist/primitives/Timestamp.cjs +2 -2
  126. package/dist/primitives/Timestamp.cjs.map +1 -1
  127. package/dist/primitives/Timestamp.js +2 -2
  128. package/dist/primitives/Timestamp.js.map +1 -1
  129. package/dist/utils/Portal.cjs +2 -2
  130. package/dist/utils/Portal.cjs.map +1 -1
  131. package/dist/utils/Portal.js +2 -2
  132. package/dist/utils/Portal.js.map +1 -1
  133. package/dist/utils/animation-loop.cjs +44 -0
  134. package/dist/utils/animation-loop.cjs.map +1 -0
  135. package/dist/utils/animation-loop.js +42 -0
  136. package/dist/utils/animation-loop.js.map +1 -0
  137. package/dist/utils/px.cjs +14 -0
  138. package/dist/utils/px.cjs.map +1 -0
  139. package/dist/utils/px.js +12 -0
  140. package/dist/utils/px.js.map +1 -0
  141. package/dist/utils/use-pre-resolve-user.cjs +18 -0
  142. package/dist/utils/use-pre-resolve-user.cjs.map +1 -0
  143. package/dist/utils/use-pre-resolve-user.js +16 -0
  144. package/dist/utils/use-pre-resolve-user.js.map +1 -0
  145. package/dist/version.cjs +1 -1
  146. package/dist/version.cjs.map +1 -1
  147. package/dist/version.js +1 -1
  148. package/dist/version.js.map +1 -1
  149. package/package.json +7 -10
  150. package/src/styles/dark/index.css +1 -1
  151. package/src/styles/index.css +259 -4
  152. package/styles/dark/attributes.css +1 -1
  153. package/styles/dark/attributes.css.map +1 -1
  154. package/styles/dark/media-query.css +1 -1
  155. package/styles/dark/media-query.css.map +1 -1
  156. package/styles.css +1 -1
  157. package/styles.css.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","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":["detectDupes","PKG_NAME","PKG_VERSION","PKG_FORMAT"],"mappings":";;;;;;;;;;;;;;;;;AAIAA,gBAAY,CAAAC,gBAAA,EAAUC,qBAAaC,kBAAU,CAAA;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","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 { AvatarStackProps } from \"./components/AvatarStack\";\nexport { AvatarStack } from \"./components/AvatarStack\";\nexport type {\n CommentAuthorProps,\n CommentAvatarProps,\n CommentDateProps,\n CommentDropdownItemProps,\n CommentProps,\n} from \"./components/Comment\";\nexport { Comment } from \"./components/Comment\";\nexport type { CommentPinProps } from \"./components/CommentPin\";\nexport { CommentPin } from \"./components/CommentPin\";\nexport type { ComposerProps } from \"./components/Composer\";\nexport { Composer } from \"./components/Composer\";\nexport type { CursorProps } from \"./components/Cursor\";\nexport { Cursor } from \"./components/Cursor\";\nexport type { CursorsProps } from \"./components/Cursors\";\nexport { Cursors } from \"./components/Cursors\";\nexport type { FloatingComposerProps } from \"./components/FloatingComposer\";\nexport { FloatingComposer } from \"./components/FloatingComposer\";\nexport type { FloatingThreadProps } from \"./components/FloatingThread\";\nexport { FloatingThread } from \"./components/FloatingThread\";\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":["detectDupes","PKG_NAME","PKG_VERSION","PKG_FORMAT"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAIAA,gBAAY,CAAAC,gBAAA,EAAUC,qBAAaC,kBAAU,CAAA;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.cts CHANGED
@@ -1,7 +1,8 @@
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, HistoryVersion, InboxNotificationData, InboxNotificationThreadData, InboxNotificationTextMentionData, InboxNotificationCustomData, KDAD, ThreadData } from '@liveblocks/core';
3
+ import { CommentAttachment, AiReasoningPart, AiRetrievalPart, Relax, WithNavigation, AiAssistantMessage, CopilotId, AiKnowledgeSource, AiOpaqueToolDefinition, AiToolTypePack, JsonObject, AiToolExecuteCallback, NoInfr, CommentBody, MentionData, BaseMetadata, DTM, DCM, Patchable, CommentData, ThreadData, HistoryVersion, InboxNotificationData, InboxNotificationThreadData, InboxNotificationTextMentionData, InboxNotificationCustomData, KDAD } from '@liveblocks/core';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
+ import { Popover } from 'radix-ui';
5
6
 
6
7
  interface GlobalComponents {
7
8
  Anchor: ComponentType<ComponentPropsWithoutRef<"a">> | "a";
@@ -809,6 +810,30 @@ declare const AiTool: react.ForwardRefExoticComponent<Omit<AiToolProps, "ref"> &
809
810
  Confirmation: typeof AiToolConfirmation;
810
811
  };
811
812
 
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 items in the stack (at least 2).
820
+ * Defaults to 3, set to `undefined` to show all avatars.
821
+ */
822
+ max?: number;
823
+ /**
824
+ * The size of the avatars.
825
+ */
826
+ size?: string | number;
827
+ /**
828
+ * Override the component's strings.
829
+ */
830
+ overrides?: Partial<GlobalOverrides>;
831
+ }
832
+ /**
833
+ * Displays a stack of avatars for the users currently present in the room.
834
+ */
835
+ declare const AvatarStack: react.ForwardRefExoticComponent<AvatarStackProps & react.RefAttributes<HTMLDivElement>>;
836
+
812
837
  interface ComposerEditorMentionProps {
813
838
  /**
814
839
  * Whether the mention is selected.
@@ -1166,11 +1191,11 @@ interface CommentDropdownItemProps extends Omit<ComponentPropsWithoutRef<"div">,
1166
1191
  * ))}
1167
1192
  * </>
1168
1193
  */
1169
- declare const Comment: react.ForwardRefExoticComponent<CommentProps<BaseMetadata> & react.RefAttributes<HTMLDivElement>> & {
1194
+ declare const Comment: (<CM extends BaseMetadata = BaseMetadata>(props: CommentProps<CM> & RefAttributes<HTMLDivElement>) => JSX.Element) & {
1170
1195
  /**
1171
1196
  * Displays a dropdown item in the comment's dropdown.
1172
1197
  */
1173
- DropdownItem: react.ForwardRefExoticComponent<CommentDropdownItemProps & react.RefAttributes<HTMLDivElement>>;
1198
+ DropdownItem: react.ForwardRefExoticComponent<CommentDropdownItemProps & RefAttributes<HTMLDivElement>>;
1174
1199
  /**
1175
1200
  * Displays a comment's avatar.
1176
1201
  */
@@ -1185,6 +1210,214 @@ declare const Comment: react.ForwardRefExoticComponent<CommentProps<BaseMetadata
1185
1210
  Date: typeof CommentDate;
1186
1211
  };
1187
1212
 
1213
+ interface CommentPinProps extends ComponentPropsWithoutRef<"button"> {
1214
+ /**
1215
+ * The corner that points to the comment position.
1216
+ * Defaults to the bottom left corner.
1217
+ */
1218
+ corner?: "top-left" | "top-right" | "bottom-right" | "bottom-left";
1219
+ /**
1220
+ * The user ID to optionally display an avatar for.
1221
+ */
1222
+ userId?: string;
1223
+ /**
1224
+ * The size of the pin.
1225
+ */
1226
+ size?: string | number;
1227
+ /**
1228
+ * The content shown in the pin.
1229
+ * If provided, the `userId` prop is ignored.
1230
+ */
1231
+ children?: ReactNode;
1232
+ }
1233
+ /**
1234
+ * Displays a comment pin that can be used as a trigger
1235
+ * for `FloatingComposer` and `FloatingThread`.
1236
+ */
1237
+ declare const CommentPin: react.ForwardRefExoticComponent<CommentPinProps & react.RefAttributes<HTMLButtonElement>>;
1238
+
1239
+ interface CursorProps extends ComponentPropsWithoutRef<"div"> {
1240
+ /**
1241
+ * A floating label to display next to the cursor.
1242
+ */
1243
+ label?: ReactNode;
1244
+ /**
1245
+ * The color of the cursor.
1246
+ */
1247
+ color?: string;
1248
+ }
1249
+ /**
1250
+ * Displays a multiplayer cursor.
1251
+ */
1252
+ declare const Cursor: react.ForwardRefExoticComponent<CursorProps & react.RefAttributes<HTMLDivElement>>;
1253
+
1254
+ interface CursorsProps extends ComponentPropsWithoutRef<"div"> {
1255
+ /**
1256
+ * The key used to store the cursors in users' Presence.
1257
+ * This can be used to have multiple `Cursors` in a single room.
1258
+ */
1259
+ presenceKey?: string;
1260
+ }
1261
+ /**
1262
+ * Displays multiplayer cursors.
1263
+ */
1264
+ declare const Cursors: react.ForwardRefExoticComponent<CursorsProps & react.RefAttributes<HTMLDivElement>>;
1265
+
1266
+ 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">> {
1267
+ /**
1268
+ * The element which opens the floating composer.
1269
+ */
1270
+ children: ReactNode;
1271
+ }
1272
+ /**
1273
+ * Displays a floating composer attached to a trigger element.
1274
+ */
1275
+ declare const FloatingComposer: <TM extends BaseMetadata = DTM, CM extends BaseMetadata = DCM>(props: FloatingComposerProps<TM, CM> & RefAttributes<HTMLFormElement>) => JSX.Element;
1276
+
1277
+ interface ThreadComponents<_TM extends BaseMetadata = DTM, CM extends BaseMetadata = DCM> {
1278
+ /**
1279
+ * The component used to display comments.
1280
+ */
1281
+ Comment: ComponentType<CommentProps<CM>>;
1282
+ }
1283
+ interface ThreadProps<TM extends BaseMetadata = DTM, CM extends BaseMetadata = DCM> extends ComponentPropsWithoutRef<"div"> {
1284
+ /**
1285
+ * The thread to display.
1286
+ */
1287
+ thread: ThreadData<TM, CM>;
1288
+ /**
1289
+ * How to show or hide the composer to reply to the thread.
1290
+ */
1291
+ showComposer?: boolean | "collapsed";
1292
+ /**
1293
+ * Whether to show the action to resolve the thread.
1294
+ */
1295
+ showResolveAction?: boolean;
1296
+ /**
1297
+ * How to show or hide the actions.
1298
+ */
1299
+ showActions?: CommentProps["showActions"];
1300
+ /**
1301
+ * Whether to show reactions.
1302
+ */
1303
+ showReactions?: CommentProps["showReactions"];
1304
+ /**
1305
+ * Whether to show the composer's formatting controls.
1306
+ */
1307
+ showComposerFormattingControls?: ComposerProps["showFormattingControls"];
1308
+ /**
1309
+ * Add (or change) items to display in a comment's dropdown.
1310
+ */
1311
+ commentDropdownItems?: ReactNode | ((props: PropsWithChildren<{
1312
+ comment: CommentData<CM>;
1313
+ }>) => ReactNode);
1314
+ /**
1315
+ * The maximum number of comments to show.
1316
+ *
1317
+ * The first and last comments are always shown and by default if some comments
1318
+ * are hidden, only the first comment will be shown before the "show more" button
1319
+ * and after it will be shown all the newest comments to fit the limit set.
1320
+ *
1321
+ * It's possible to customize this by setting `maxVisibleComments` to an object:
1322
+ *
1323
+ * @example
1324
+ * // Only show the last comment, and all the older ones to fit the limit.
1325
+ * <Thread maxVisibleComments={{ max: 5, show: "oldest" }} />
1326
+ *
1327
+ * @example
1328
+ * // Show as many old comments as new ones to fit the limit.
1329
+ * <Thread maxVisibleComments={{ max: 5, show: "both" }} />
1330
+ */
1331
+ maxVisibleComments?: number | {
1332
+ max: number;
1333
+ show: "oldest" | "both" | "newest";
1334
+ };
1335
+ /**
1336
+ * Whether to blur the composer editor when the composer is submitted.
1337
+ */
1338
+ blurComposerOnSubmit?: ComposerProps["blurOnSubmit"];
1339
+ /**
1340
+ * Whether to indent the comments' content.
1341
+ */
1342
+ indentCommentContent?: CommentProps["indentContent"];
1343
+ /**
1344
+ * Whether to show deleted comments.
1345
+ */
1346
+ showDeletedComments?: CommentProps["showDeleted"];
1347
+ /**
1348
+ * Whether to show attachments.
1349
+ */
1350
+ showAttachments?: boolean;
1351
+ /**
1352
+ * The event handler called when changing the resolved status.
1353
+ */
1354
+ onResolvedChange?: (resolved: boolean) => void;
1355
+ /**
1356
+ * The event handler called when a comment is edited.
1357
+ */
1358
+ onCommentEdit?: CommentProps["onCommentEdit"];
1359
+ /**
1360
+ * The event handler called when a comment is deleted.
1361
+ */
1362
+ onCommentDelete?: CommentProps["onCommentDelete"];
1363
+ /**
1364
+ * The event handler called when the thread is deleted.
1365
+ * A thread is deleted when all its comments are deleted.
1366
+ */
1367
+ onThreadDelete?: (thread: ThreadData<TM, CM>) => void;
1368
+ /**
1369
+ * The event handler called when clicking on a comment's author.
1370
+ */
1371
+ onAuthorClick?: CommentProps["onAuthorClick"];
1372
+ /**
1373
+ * The event handler called when clicking on a mention.
1374
+ */
1375
+ onMentionClick?: CommentProps["onMentionClick"];
1376
+ /**
1377
+ * The event handler called when clicking on a comment's attachment.
1378
+ */
1379
+ onAttachmentClick?: CommentProps["onAttachmentClick"];
1380
+ /**
1381
+ * The event handler called when the composer is submitted.
1382
+ */
1383
+ onComposerSubmit?: ComposerProps["onComposerSubmit"];
1384
+ /**
1385
+ * Whether to focus the composer on mount.
1386
+ */
1387
+ autoFocus?: ComposerProps["autoFocus"];
1388
+ /**
1389
+ * Override the component's strings.
1390
+ */
1391
+ overrides?: Partial<GlobalOverrides & ThreadOverrides & CommentOverrides & ComposerOverrides>;
1392
+ /**
1393
+ * Override the component's components.
1394
+ */
1395
+ components?: Partial<GlobalComponents & ThreadComponents<TM, CM>>;
1396
+ }
1397
+ /**
1398
+ * Displays a thread of comments, with a composer to reply
1399
+ * to it.
1400
+ *
1401
+ * @example
1402
+ * <>
1403
+ * {threads.map((thread) => (
1404
+ * <Thread key={thread.id} thread={thread} />
1405
+ * ))}
1406
+ * </>
1407
+ */
1408
+ declare const Thread: <TM extends BaseMetadata = DTM, CM extends BaseMetadata = DCM>(props: ThreadProps<TM, CM> & RefAttributes<HTMLDivElement>) => JSX.Element;
1409
+
1410
+ 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">> {
1411
+ /**
1412
+ * The element which opens the floating thread.
1413
+ */
1414
+ children: ReactNode;
1415
+ }
1416
+ /**
1417
+ * Displays a floating thread attached to a trigger element.
1418
+ */
1419
+ declare const FloatingThread: <TM extends BaseMetadata = DTM, CM extends BaseMetadata = DCM>(props: FloatingThreadProps<TM, CM> & RefAttributes<HTMLDivElement>) => JSX.Element;
1420
+
1188
1421
  interface HistoryVersionSummaryProps extends ComponentPropsWithoutRef<"button"> {
1189
1422
  version: HistoryVersion;
1190
1423
  selected?: boolean;
@@ -1380,139 +1613,6 @@ interface InboxNotificationListProps extends ComponentPropsWithoutRef<"ol"> {
1380
1613
  */
1381
1614
  declare const InboxNotificationList: react.ForwardRefExoticComponent<InboxNotificationListProps & react.RefAttributes<HTMLOListElement>>;
1382
1615
 
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
-
1516
1616
  type LiveblocksUiConfigProps = PropsWithChildren<{
1517
1617
  /**
1518
1618
  * Override the components' strings.
@@ -1625,6 +1725,8 @@ declare function ListUnorderedIcon(props: ComponentProps<"svg">): react_jsx_runt
1625
1725
 
1626
1726
  declare function MentionIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
1627
1727
 
1728
+ declare function PlusIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
1729
+
1628
1730
  declare function QuestionMarkIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
1629
1731
 
1630
1732
  declare function RedoIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
@@ -1692,6 +1794,7 @@ declare namespace icon {
1692
1794
  ListOrderedIcon as ListOrdered,
1693
1795
  ListUnorderedIcon as ListUnordered,
1694
1796
  MentionIcon as Mention,
1797
+ PlusIcon as Plus,
1695
1798
  QuestionMarkIcon as QuestionMark,
1696
1799
  RedoIcon as Redo,
1697
1800
  RetryIcon as Retry,
@@ -1712,4 +1815,4 @@ declare namespace icon {
1712
1815
  };
1713
1816
  }
1714
1817
 
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 };
1818
+ export { AiChat, AiChatComponents, AiChatComponentsEmptyProps, AiChatComponentsLoadingProps, AiChatProps, AiComposerSubmitMessage, AiTool, AiToolIconProps, AiToolProps, AvatarStack, AvatarStackProps, Comment, CommentAttachmentArgs, CommentAuthorProps, CommentAvatarProps, CommentDateProps, CommentDropdownItemProps, CommentOverrides, CommentPin, CommentPinProps, CommentProps, Composer, ComposerBodyMark, ComposerBodyMarks, ComposerOverrides, ComposerProps, ComposerSubmitComment, Cursor, CursorProps, Cursors, CursorsProps, FloatingComposer, FloatingComposerProps, FloatingThread, FloatingThreadProps, 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 };