@liveblocks/react-ui 2.25.0-aiprivatebeta8 → 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 +14 -12
- package/dist/_private/index.cjs.map +1 -1
- package/dist/_private/index.d.cts +146 -113
- package/dist/_private/index.d.ts +146 -113
- package/dist/_private/index.js +10 -5
- package/dist/_private/index.js.map +1 -1
- package/dist/components/AiChat.cjs +85 -121
- package/dist/components/AiChat.cjs.map +1 -1
- package/dist/components/AiChat.js +87 -123
- package/dist/components/AiChat.js.map +1 -1
- package/dist/components/AiTool.cjs +188 -0
- package/dist/components/AiTool.cjs.map +1 -0
- package/dist/components/AiTool.js +186 -0
- package/dist/components/AiTool.js.map +1 -0
- package/dist/components/Comment.cjs +259 -238
- package/dist/components/Comment.cjs.map +1 -1
- package/dist/components/Comment.js +261 -240
- 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/InboxNotificationList.cjs +11 -3
- package/dist/components/InboxNotificationList.cjs.map +1 -1
- package/dist/components/InboxNotificationList.js +12 -4
- package/dist/components/InboxNotificationList.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 +75 -199
- package/dist/components/internal/AiChatAssistantMessage.cjs.map +1 -1
- package/dist/components/internal/AiChatAssistantMessage.js +77 -201
- package/dist/components/internal/AiChatAssistantMessage.js.map +1 -1
- package/dist/components/internal/AiChatComposer.cjs +1 -1
- package/dist/components/internal/AiChatComposer.cjs.map +1 -1
- package/dist/components/internal/AiChatComposer.js +1 -1
- package/dist/components/internal/AiChatComposer.js.map +1 -1
- package/dist/components/internal/AiChatUserMessage.cjs +17 -10
- package/dist/components/internal/AiChatUserMessage.cjs.map +1 -1
- package/dist/components/internal/AiChatUserMessage.js +17 -10
- package/dist/components/internal/AiChatUserMessage.js.map +1 -1
- package/dist/components/internal/Button.cjs.map +1 -1
- package/dist/components/internal/Button.js.map +1 -1
- package/dist/components/internal/CodeBlock.cjs +75 -0
- package/dist/components/internal/CodeBlock.cjs.map +1 -0
- package/dist/components/internal/CodeBlock.js +73 -0
- package/dist/components/internal/CodeBlock.js.map +1 -0
- 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/Emoji.cjs +12 -4
- package/dist/components/internal/Emoji.cjs.map +1 -1
- package/dist/components/internal/Emoji.js +12 -4
- package/dist/components/internal/Emoji.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/Prose.cjs +37 -0
- package/dist/components/internal/Prose.cjs.map +1 -0
- package/dist/components/internal/Prose.js +35 -0
- package/dist/components/internal/Prose.js.map +1 -0
- 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 +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +270 -22
- package/dist/index.d.ts +270 -22
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/overrides.cjs +6 -4
- package/dist/overrides.cjs.map +1 -1
- package/dist/overrides.js +6 -4
- package/dist/overrides.js.map +1 -1
- package/dist/primitives/AiMessage/contexts.cjs +18 -0
- package/dist/primitives/AiMessage/contexts.cjs.map +1 -0
- package/dist/primitives/AiMessage/contexts.js +15 -0
- package/dist/primitives/AiMessage/contexts.js.map +1 -0
- package/dist/primitives/AiMessage/index.cjs +77 -0
- package/dist/primitives/AiMessage/index.cjs.map +1 -0
- package/dist/primitives/AiMessage/index.js +75 -0
- package/dist/primitives/AiMessage/index.js.map +1 -0
- 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/{internal/Collapsible → Collapsible}/index.cjs +39 -17
- package/dist/primitives/Collapsible/index.cjs.map +1 -0
- package/dist/primitives/{internal/Collapsible → Collapsible}/index.js +37 -15
- package/dist/primitives/Collapsible/index.js.map +1 -0
- 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/{internal/Markdown.cjs → Markdown.cjs} +105 -65
- package/dist/primitives/Markdown.cjs.map +1 -0
- package/dist/primitives/{internal/Markdown.js → Markdown.js} +106 -65
- package/dist/primitives/Markdown.js.map +1 -0
- package/dist/primitives/index.cjs +4 -6
- package/dist/primitives/index.cjs.map +1 -1
- package/dist/primitives/index.d.cts +20 -93
- package/dist/primitives/index.d.ts +20 -93
- package/dist/primitives/index.js +4 -6
- package/dist/primitives/index.js.map +1 -1
- package/dist/utils/ErrorBoundary.cjs +48 -0
- package/dist/utils/ErrorBoundary.cjs.map +1 -0
- package/dist/utils/ErrorBoundary.js +45 -0
- package/dist/utils/ErrorBoundary.js.map +1 -0
- 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 +65 -45
- package/dist/utils/use-visible.cjs.map +1 -1
- package/dist/utils/use-visible.js +66 -46
- 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/constants.css +1 -1
- package/src/styles/dark/index.css +7 -3
- package/src/styles/index.css +572 -252
- package/src/styles/utils.css +1 -1
- 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/AiToolDebugger.cjs +0 -74
- package/dist/components/AiToolDebugger.cjs.map +0 -1
- package/dist/components/AiToolDebugger.js +0 -72
- package/dist/components/AiToolDebugger.js.map +0 -1
- package/dist/primitives/internal/Collapsible/index.cjs.map +0 -1
- package/dist/primitives/internal/Collapsible/index.js.map +0 -1
- package/dist/primitives/internal/Emoji.cjs +0 -32
- package/dist/primitives/internal/Emoji.cjs.map +0 -1
- package/dist/primitives/internal/Emoji.js +0 -30
- package/dist/primitives/internal/Emoji.js.map +0 -1
- package/dist/primitives/internal/Markdown.cjs.map +0 -1
- package/dist/primitives/internal/Markdown.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InboxNotificationThread.cjs","sources":["../../../src/components/internal/InboxNotificationThread.tsx"],"sourcesContent":["import type {\n BaseMetadata,\n CommentData,\n InboxNotificationThreadData,\n ThreadData,\n} from \"@liveblocks/core\";\nimport { getMentionedIdsFromCommentBody } from \"@liveblocks/core\";\nimport type { ComponentProps } from \"react\";\n\nimport {\n type CommentOverrides,\n type GlobalOverrides,\n useOverrides,\n} from \"../../overrides\";\nimport * as CommentPrimitive from \"../../primitives/Comment\";\nimport { classNames } from \"../../utils/class-names\";\nimport {\n CommentMention,\n CommentNonInteractiveFileAttachment,\n CommentNonInteractiveLink,\n CommentNonInteractiveReaction,\n} from \"../Comment\";\nimport { User } from \"./User\";\n\ntype InboxNotificationThreadCommentsContents = {\n type: \"comments\";\n unread: boolean;\n comments: CommentData[];\n userIds: string[];\n date: Date;\n};\n\ntype InboxNotificationThreadMentionContents = {\n type: \"mention\";\n unread: boolean;\n comments: CommentData[];\n userIds: string[];\n date: Date;\n};\n\nexport const INBOX_NOTIFICATION_THREAD_MAX_COMMENTS = 3;\n\ntype InboxNotificationThreadContents =\n | InboxNotificationThreadCommentsContents\n | InboxNotificationThreadMentionContents;\n\ninterface InboxNotificationCommentProps extends ComponentProps<\"div\"> {\n comment: CommentData;\n showHeader?: boolean;\n showAttachments?: boolean;\n showReactions?: boolean;\n overrides?: Partial<GlobalOverrides & CommentOverrides>;\n}\n\nexport function InboxNotificationComment({\n comment,\n showHeader = true,\n showAttachments = true,\n showReactions = true,\n overrides,\n className,\n ...props\n}: InboxNotificationCommentProps) {\n const $ = useOverrides(overrides);\n\n return (\n <div\n className={classNames(\n \"lb-root lb-inbox-notification-comment lb-comment\",\n className\n )}\n {...props}\n >\n {showHeader && (\n <div className=\"lb-comment-header\">\n <User className=\"lb-comment-author\" userId={comment.userId} />\n </div>\n )}\n <div className=\"lb-comment-content\">\n {comment.body ? (\n <>\n <CommentPrimitive.Body\n className=\"lb-comment-body\"\n body={comment.body}\n components={{\n Mention: CommentMention,\n Link: CommentNonInteractiveLink,\n }}\n />\n {showReactions && comment.reactions.length > 0 && (\n <div className=\"lb-comment-reactions\">\n {comment.reactions.map((reaction) => (\n <CommentNonInteractiveReaction\n key={reaction.emoji}\n reaction={reaction}\n overrides={overrides}\n disabled\n />\n ))}\n </div>\n )}\n {showAttachments && comment.attachments.length > 0 ? (\n <div className=\"lb-comment-attachments\">\n <div className=\"lb-attachments\">\n {comment.attachments.map((attachment) => (\n <CommentNonInteractiveFileAttachment\n key={attachment.id}\n attachment={attachment}\n overrides={overrides}\n roomId={comment.roomId}\n />\n ))}\n </div>\n </div>\n ) : null}\n </>\n ) : (\n <div className=\"lb-comment-body\">\n <p className=\"lb-comment-deleted\">{$.COMMENT_DELETED}</p>\n </div>\n )}\n </div>\n </div>\n );\n}\n\n/**\n * Find the last comment with a mention for the given user ID,\n * unless the comment was created by the user themselves.\n */\nfunction findLastCommentWithMentionedId(\n comments: CommentData[],\n mentionedId: string\n) {\n if (!comments.length) {\n return;\n }\n\n for (let i = comments.length - 1; i >= 0; i--) {\n const comment = comments[i]!;\n\n if (comment.userId === mentionedId) {\n continue;\n }\n\n if (comment.body) {\n const mentionedIds = getMentionedIdsFromCommentBody(comment.body);\n\n if (mentionedIds.includes(mentionedId)) {\n return comment;\n }\n }\n }\n\n return;\n}\n\nfunction getUserIdsFromComments(comments: CommentData[]) {\n return Array.from(new Set(comments.map((comment) => comment.userId)));\n}\n\nexport function generateInboxNotificationThreadContents(\n inboxNotification: InboxNotificationThreadData,\n thread: ThreadData<BaseMetadata>,\n userId: string\n): InboxNotificationThreadContents {\n const unreadComments = thread.comments.filter((comment) => {\n if (!comment.body) {\n return false;\n }\n\n return inboxNotification.readAt\n ? comment.createdAt > inboxNotification.readAt &&\n comment.createdAt <= inboxNotification.notifiedAt\n : comment.createdAt <= inboxNotification.notifiedAt;\n });\n\n // If the thread is read, show the last comments.\n if (unreadComments.length === 0) {\n const lastComments = thread.comments\n .filter((comment) => comment.body)\n .slice(-INBOX_NOTIFICATION_THREAD_MAX_COMMENTS);\n\n return {\n type: \"comments\",\n unread: false,\n comments: lastComments,\n userIds: getUserIdsFromComments(lastComments),\n date: inboxNotification.notifiedAt,\n };\n }\n\n const commentWithMention = findLastCommentWithMentionedId(\n unreadComments,\n userId\n );\n\n // If the thread contains one or more mentions for the current user, show the last comment with a mention.\n if (commentWithMention) {\n return {\n type: \"mention\",\n unread: true,\n comments: [commentWithMention],\n userIds: [commentWithMention.userId],\n date: commentWithMention.createdAt,\n };\n }\n\n const lastUnreadComments = unreadComments.slice(\n -INBOX_NOTIFICATION_THREAD_MAX_COMMENTS\n );\n\n // Otherwise, show the last unread comments.\n return {\n type: \"comments\",\n unread: true,\n comments: lastUnreadComments,\n userIds: getUserIdsFromComments(unreadComments),\n date: inboxNotification.notifiedAt,\n };\n}\n"],"names":["overrides","useOverrides","jsxs","classNames","jsx","User","Fragment","CommentPrimitive.Body","CommentMention","CommentNonInteractiveLink","CommentNonInteractiveReaction","CommentNonInteractiveFileAttachment","getMentionedIdsFromCommentBody"],"mappings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A,CAAC,sCAAsC,CAAA,CAAA;AAEhD,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,UAAA;AAAA,MACN,MAAQ,EAAA,KAAA;AAAA,MACR,QAAU,EAAA,YAAA;AAAA,MACV,OAAA,EAAS,uBAAuB,YAAY,CAAA;AAAA,MAC5C,MAAM,iBAAkB,CAAA,UAAA;AAAA,KAC1B,CAAA;AAAA,GACF;AAEA,EAAA,MAAM,kBAAqB,GAAA,8BAAA;AAAA,IACzB,cAAA;AAAA,IACA,MAAA;AAAA,GACF,CAAA;AAGA,EAAA,IAAI,kBAAoB,EAAA;AACtB,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,SAAA;AAAA,MACN,MAAQ,EAAA,IAAA;AAAA,MACR,QAAA,EAAU,CAAC,kBAAkB,CAAA;AAAA,MAC7B,OAAA,EAAS,CAAC,kBAAA,CAAmB,MAAM,CAAA;AAAA,MACnC,MAAM,kBAAmB,CAAA,SAAA;AAAA,KAC3B,CAAA;AAAA,GACF;AAEA,EAAA,MAAM,qBAAqB,cAAe,CAAA,KAAA;AAAA,IACxC,CAAC,sCAAA;AAAA,GACH,CAAA;AAGA,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,UAAA;AAAA,IACN,MAAQ,EAAA,IAAA;AAAA,IACR,QAAU,EAAA,kBAAA;AAAA,IACV,OAAA,EAAS,uBAAuB,cAAc,CAAA;AAAA,IAC9C,MAAM,iBAAkB,CAAA,UAAA;AAAA,GAC1B,CAAA;AACF;;;;;;"}
|
|
1
|
+
{"version":3,"file":"InboxNotificationThread.cjs","sources":["../../../src/components/internal/InboxNotificationThread.tsx"],"sourcesContent":["import type {\n BaseMetadata,\n CommentData,\n InboxNotificationThreadData,\n ThreadData,\n} from \"@liveblocks/core\";\nimport { getMentionsFromCommentBody } from \"@liveblocks/core\";\nimport type { ComponentProps } from \"react\";\n\nimport {\n type CommentOverrides,\n type GlobalOverrides,\n useOverrides,\n} from \"../../overrides\";\nimport * as CommentPrimitive from \"../../primitives/Comment\";\nimport { classNames } from \"../../utils/class-names\";\nimport {\n CommentMention,\n CommentNonInteractiveFileAttachment,\n CommentNonInteractiveLink,\n CommentNonInteractiveReaction,\n} from \"../Comment\";\nimport { User } from \"./User\";\n\ntype InboxNotificationThreadCommentsContents = {\n type: \"comments\";\n unread: boolean;\n comments: CommentData[];\n userIds: string[];\n date: Date;\n};\n\ntype InboxNotificationThreadMentionContents = {\n type: \"mention\";\n unread: boolean;\n comments: CommentData[];\n userIds: string[];\n date: Date;\n};\n\nexport const INBOX_NOTIFICATION_THREAD_MAX_COMMENTS = 3;\n\ntype InboxNotificationThreadContents =\n | InboxNotificationThreadCommentsContents\n | InboxNotificationThreadMentionContents;\n\ninterface InboxNotificationCommentProps extends ComponentProps<\"div\"> {\n comment: CommentData;\n showHeader?: boolean;\n showAttachments?: boolean;\n showReactions?: boolean;\n overrides?: Partial<GlobalOverrides & CommentOverrides>;\n}\n\nexport function InboxNotificationComment({\n comment,\n showHeader = true,\n showAttachments = true,\n showReactions = true,\n overrides,\n className,\n ...props\n}: InboxNotificationCommentProps) {\n const $ = useOverrides(overrides);\n\n return (\n <div\n className={classNames(\n \"lb-root lb-inbox-notification-comment lb-comment\",\n className\n )}\n {...props}\n >\n {showHeader && (\n <div className=\"lb-comment-header\">\n <User className=\"lb-comment-author\" userId={comment.userId} />\n </div>\n )}\n <div className=\"lb-comment-content\">\n {comment.body ? (\n <>\n <CommentPrimitive.Body\n className=\"lb-comment-body\"\n body={comment.body}\n components={{\n Mention: CommentMention,\n Link: CommentNonInteractiveLink,\n }}\n />\n {showReactions && comment.reactions.length > 0 && (\n <div className=\"lb-comment-reactions\">\n {comment.reactions.map((reaction) => (\n <CommentNonInteractiveReaction\n key={reaction.emoji}\n reaction={reaction}\n overrides={overrides}\n disabled\n />\n ))}\n </div>\n )}\n {showAttachments && comment.attachments.length > 0 ? (\n <div className=\"lb-comment-attachments\">\n <div className=\"lb-attachments\">\n {comment.attachments.map((attachment) => (\n <CommentNonInteractiveFileAttachment\n key={attachment.id}\n attachment={attachment}\n overrides={overrides}\n roomId={comment.roomId}\n />\n ))}\n </div>\n </div>\n ) : null}\n </>\n ) : (\n <div className=\"lb-comment-body\">\n <p className=\"lb-comment-deleted\">{$.COMMENT_DELETED}</p>\n </div>\n )}\n </div>\n </div>\n );\n}\n\n/**\n * Find the last comment with a mention for the given user ID,\n * unless the comment was created by the user themselves.\n */\nfunction findLastCommentWithMentionedId(\n comments: CommentData[],\n mentionedId: string\n) {\n if (!comments.length) {\n return;\n }\n\n for (let i = comments.length - 1; i >= 0; i--) {\n const comment = comments[i]!;\n\n if (comment.userId === mentionedId) {\n continue;\n }\n\n if (comment.body) {\n const mentions = getMentionsFromCommentBody(\n comment.body,\n (mention) => mention.kind === \"user\" && mention.id === mentionedId\n );\n\n if (mentions.length > 0) {\n return comment;\n }\n }\n }\n\n return;\n}\n\nfunction getUserIdsFromComments(comments: CommentData[]) {\n return Array.from(new Set(comments.map((comment) => comment.userId)));\n}\n\nexport function generateInboxNotificationThreadContents(\n inboxNotification: InboxNotificationThreadData,\n thread: ThreadData<BaseMetadata>,\n userId: string\n): InboxNotificationThreadContents {\n const unreadComments = thread.comments.filter((comment) => {\n if (!comment.body) {\n return false;\n }\n\n return inboxNotification.readAt\n ? comment.createdAt > inboxNotification.readAt &&\n comment.createdAt <= inboxNotification.notifiedAt\n : comment.createdAt <= inboxNotification.notifiedAt;\n });\n\n // If the thread is read, show the last comments.\n if (unreadComments.length === 0) {\n const lastComments = thread.comments\n .filter((comment) => comment.body)\n .slice(-INBOX_NOTIFICATION_THREAD_MAX_COMMENTS);\n\n return {\n type: \"comments\",\n unread: false,\n comments: lastComments,\n userIds: getUserIdsFromComments(lastComments),\n date: inboxNotification.notifiedAt,\n };\n }\n\n const commentWithMention = findLastCommentWithMentionedId(\n unreadComments,\n userId\n );\n\n // If the thread contains one or more mentions for the current user, show the last comment with a mention.\n if (commentWithMention) {\n return {\n type: \"mention\",\n unread: true,\n comments: [commentWithMention],\n userIds: [commentWithMention.userId],\n date: commentWithMention.createdAt,\n };\n }\n\n const lastUnreadComments = unreadComments.slice(\n -INBOX_NOTIFICATION_THREAD_MAX_COMMENTS\n );\n\n // Otherwise, show the last unread comments.\n return {\n type: \"comments\",\n unread: true,\n comments: lastUnreadComments,\n userIds: getUserIdsFromComments(unreadComments),\n date: inboxNotification.notifiedAt,\n };\n}\n"],"names":["overrides","useOverrides","jsxs","classNames","jsx","User","Fragment","CommentPrimitive.Body","CommentMention","CommentNonInteractiveLink","CommentNonInteractiveReaction","CommentNonInteractiveFileAttachment","getMentionsFromCommentBody"],"mappings":";;;;;;;;;;AAwCO,MAAM,sCAAyC,GAAA,EAAA;AAc/C,SAAS,wBAAyB,CAAA;AAAA,EACvC,OAAA;AAAA,EACA,UAAa,GAAA,IAAA;AAAA,EACb,eAAkB,GAAA,IAAA;AAAA,EAClB,aAAgB,GAAA,IAAA;AAAA,aAChBA,WAAA;AAAA,EACA,SAAA;AAAA,EACG,GAAA,KAAA;AACL,CAAkC,EAAA;AAChC,EAAM,MAAA,CAAA,GAAIC,uBAAaD,WAAS,CAAA,CAAA;AAEhC,EAAA,uBACGE,eAAA,CAAA,KAAA,EAAA;AAAA,IACC,SAAW,EAAAC,qBAAA;AAAA,MACT,kDAAA;AAAA,MACA,SAAA;AAAA,KACF;AAAA,IACC,GAAG,KAAA;AAAA,IAEH,QAAA,EAAA;AAAA,MAAA,UAAA,oBACEC,cAAA,CAAA,KAAA,EAAA;AAAA,QAAI,SAAU,EAAA,mBAAA;AAAA,QACb,QAAC,kBAAAA,cAAA,CAAAC,SAAA,EAAA;AAAA,UAAK,SAAU,EAAA,mBAAA;AAAA,UAAoB,QAAQ,OAAQ,CAAA,MAAA;AAAA,SAAQ,CAAA;AAAA,OAC9D,CAAA;AAAA,sBAEDD,cAAA,CAAA,KAAA,EAAA;AAAA,QAAI,SAAU,EAAA,oBAAA;AAAA,QACZ,kBAAQ,IACP,mBAAAF,eAAA,CAAAI,mBAAA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N,MAAQ,EAAA,IAAA;AAAA,IACR,QAAU,EAAA,kBAAA;AAAA,IACV,OAAA,EAAS,uBAAuB,cAAc,CAAA;AAAA,IAC9C,MAAM,iBAAkB,CAAA,UAAA;AAAA,GAC1B,CAAA;AACF;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { getMentionsFromCommentBody } from '@liveblocks/core';
|
|
3
3
|
import { useOverrides } from '../../overrides.js';
|
|
4
4
|
import { Body as CommentBody } from '../../primitives/Comment/index.js';
|
|
5
5
|
import { classNames } from '../../utils/class-names.js';
|
|
@@ -84,8 +84,11 @@ function findLastCommentWithMentionedId(comments, mentionedId) {
|
|
|
84
84
|
continue;
|
|
85
85
|
}
|
|
86
86
|
if (comment.body) {
|
|
87
|
-
const
|
|
88
|
-
|
|
87
|
+
const mentions = getMentionsFromCommentBody(
|
|
88
|
+
comment.body,
|
|
89
|
+
(mention) => mention.kind === "user" && mention.id === mentionedId
|
|
90
|
+
);
|
|
91
|
+
if (mentions.length > 0) {
|
|
89
92
|
return comment;
|
|
90
93
|
}
|
|
91
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InboxNotificationThread.js","sources":["../../../src/components/internal/InboxNotificationThread.tsx"],"sourcesContent":["import type {\n BaseMetadata,\n CommentData,\n InboxNotificationThreadData,\n ThreadData,\n} from \"@liveblocks/core\";\nimport { getMentionedIdsFromCommentBody } from \"@liveblocks/core\";\nimport type { ComponentProps } from \"react\";\n\nimport {\n type CommentOverrides,\n type GlobalOverrides,\n useOverrides,\n} from \"../../overrides\";\nimport * as CommentPrimitive from \"../../primitives/Comment\";\nimport { classNames } from \"../../utils/class-names\";\nimport {\n CommentMention,\n CommentNonInteractiveFileAttachment,\n CommentNonInteractiveLink,\n CommentNonInteractiveReaction,\n} from \"../Comment\";\nimport { User } from \"./User\";\n\ntype InboxNotificationThreadCommentsContents = {\n type: \"comments\";\n unread: boolean;\n comments: CommentData[];\n userIds: string[];\n date: Date;\n};\n\ntype InboxNotificationThreadMentionContents = {\n type: \"mention\";\n unread: boolean;\n comments: CommentData[];\n userIds: string[];\n date: Date;\n};\n\nexport const INBOX_NOTIFICATION_THREAD_MAX_COMMENTS = 3;\n\ntype InboxNotificationThreadContents =\n | InboxNotificationThreadCommentsContents\n | InboxNotificationThreadMentionContents;\n\ninterface InboxNotificationCommentProps extends ComponentProps<\"div\"> {\n comment: CommentData;\n showHeader?: boolean;\n showAttachments?: boolean;\n showReactions?: boolean;\n overrides?: Partial<GlobalOverrides & CommentOverrides>;\n}\n\nexport function InboxNotificationComment({\n comment,\n showHeader = true,\n showAttachments = true,\n showReactions = true,\n overrides,\n className,\n ...props\n}: InboxNotificationCommentProps) {\n const $ = useOverrides(overrides);\n\n return (\n <div\n className={classNames(\n \"lb-root lb-inbox-notification-comment lb-comment\",\n className\n )}\n {...props}\n >\n {showHeader && (\n <div className=\"lb-comment-header\">\n <User className=\"lb-comment-author\" userId={comment.userId} />\n </div>\n )}\n <div className=\"lb-comment-content\">\n {comment.body ? (\n <>\n <CommentPrimitive.Body\n className=\"lb-comment-body\"\n body={comment.body}\n components={{\n Mention: CommentMention,\n Link: CommentNonInteractiveLink,\n }}\n />\n {showReactions && comment.reactions.length > 0 && (\n <div className=\"lb-comment-reactions\">\n {comment.reactions.map((reaction) => (\n <CommentNonInteractiveReaction\n key={reaction.emoji}\n reaction={reaction}\n overrides={overrides}\n disabled\n />\n ))}\n </div>\n )}\n {showAttachments && comment.attachments.length > 0 ? (\n <div className=\"lb-comment-attachments\">\n <div className=\"lb-attachments\">\n {comment.attachments.map((attachment) => (\n <CommentNonInteractiveFileAttachment\n key={attachment.id}\n attachment={attachment}\n overrides={overrides}\n roomId={comment.roomId}\n />\n ))}\n </div>\n </div>\n ) : null}\n </>\n ) : (\n <div className=\"lb-comment-body\">\n <p className=\"lb-comment-deleted\">{$.COMMENT_DELETED}</p>\n </div>\n )}\n </div>\n </div>\n );\n}\n\n/**\n * Find the last comment with a mention for the given user ID,\n * unless the comment was created by the user themselves.\n */\nfunction findLastCommentWithMentionedId(\n comments: CommentData[],\n mentionedId: string\n) {\n if (!comments.length) {\n return;\n }\n\n for (let i = comments.length - 1; i >= 0; i--) {\n const comment = comments[i]!;\n\n if (comment.userId === mentionedId) {\n continue;\n }\n\n if (comment.body) {\n const mentionedIds = getMentionedIdsFromCommentBody(comment.body);\n\n if (mentionedIds.includes(mentionedId)) {\n return comment;\n }\n }\n }\n\n return;\n}\n\nfunction getUserIdsFromComments(comments: CommentData[]) {\n return Array.from(new Set(comments.map((comment) => comment.userId)));\n}\n\nexport function generateInboxNotificationThreadContents(\n inboxNotification: InboxNotificationThreadData,\n thread: ThreadData<BaseMetadata>,\n userId: string\n): InboxNotificationThreadContents {\n const unreadComments = thread.comments.filter((comment) => {\n if (!comment.body) {\n return false;\n }\n\n return inboxNotification.readAt\n ? comment.createdAt > inboxNotification.readAt &&\n comment.createdAt <= inboxNotification.notifiedAt\n : comment.createdAt <= inboxNotification.notifiedAt;\n });\n\n // If the thread is read, show the last comments.\n if (unreadComments.length === 0) {\n const lastComments = thread.comments\n .filter((comment) => comment.body)\n .slice(-INBOX_NOTIFICATION_THREAD_MAX_COMMENTS);\n\n return {\n type: \"comments\",\n unread: false,\n comments: lastComments,\n userIds: getUserIdsFromComments(lastComments),\n date: inboxNotification.notifiedAt,\n };\n }\n\n const commentWithMention = findLastCommentWithMentionedId(\n unreadComments,\n userId\n );\n\n // If the thread contains one or more mentions for the current user, show the last comment with a mention.\n if (commentWithMention) {\n return {\n type: \"mention\",\n unread: true,\n comments: [commentWithMention],\n userIds: [commentWithMention.userId],\n date: commentWithMention.createdAt,\n };\n }\n\n const lastUnreadComments = unreadComments.slice(\n -INBOX_NOTIFICATION_THREAD_MAX_COMMENTS\n );\n\n // Otherwise, show the last unread comments.\n return {\n type: \"comments\",\n unread: true,\n comments: lastUnreadComments,\n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AA,OAAA,CAAQ,IAAI,CAAA,CAChC,KAAM,CAAA,CAAC,sCAAsC,CAAA,CAAA;AAEhD,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,UAAA;AAAA,MACN,MAAQ,EAAA,KAAA;AAAA,MACR,QAAU,EAAA,YAAA;AAAA,MACV,OAAA,EAAS,uBAAuB,YAAY,CAAA;AAAA,MAC5C,MAAM,iBAAkB,CAAA,UAAA;AAAA,KAC1B,CAAA;AAAA,GACF;AAEA,EAAA,MAAM,kBAAqB,GAAA,8BAAA;AAAA,IACzB,cAAA;AAAA,IACA,MAAA;AAAA,GACF,CAAA;AAGA,EAAA,IAAI,kBAAoB,EAAA;AACtB,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,SAAA;AAAA,MACN,MAAQ,EAAA,IAAA;AAAA,MACR,QAAA,EAAU,CAAC,kBAAkB,CAAA;AAAA,MAC7B,OAAA,EAAS,CAAC,kBAAA,CAAmB,MAAM,CAAA;AAAA,MACnC,MAAM,kBAAmB,CAAA,SAAA;AAAA,KAC3B,CAAA;AAAA,GACF;AAEA,EAAA,MAAM,qBAAqB,cAAe,CAAA,KAAA;AAAA,IACxC,CAAC,sCAAA;AAAA,GACH,CAAA;AAGA,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,UAAA;AAAA,IACN,MAAQ,EAAA,IAAA;AAAA,IACR,QAAU,EAAA,kBAAA;AAAA,IACV,OAAA,EAAS,uBAAuB,cAAc,CAAA;AAAA,IAC9C,MAAM,iBAAkB,CAAA,UAAA;AAAA,GAC1B,CAAA;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"InboxNotificationThread.js","sources":["../../../src/components/internal/InboxNotificationThread.tsx"],"sourcesContent":["import type {\n BaseMetadata,\n CommentData,\n InboxNotificationThreadData,\n ThreadData,\n} from \"@liveblocks/core\";\nimport { getMentionsFromCommentBody } from \"@liveblocks/core\";\nimport type { ComponentProps } from \"react\";\n\nimport {\n type CommentOverrides,\n type GlobalOverrides,\n useOverrides,\n} from \"../../overrides\";\nimport * as CommentPrimitive from \"../../primitives/Comment\";\nimport { classNames } from \"../../utils/class-names\";\nimport {\n CommentMention,\n CommentNonInteractiveFileAttachment,\n CommentNonInteractiveLink,\n CommentNonInteractiveReaction,\n} from \"../Comment\";\nimport { User } from \"./User\";\n\ntype InboxNotificationThreadCommentsContents = {\n type: \"comments\";\n unread: boolean;\n comments: CommentData[];\n userIds: string[];\n date: Date;\n};\n\ntype InboxNotificationThreadMentionContents = {\n type: \"mention\";\n unread: boolean;\n comments: CommentData[];\n userIds: string[];\n date: Date;\n};\n\nexport const INBOX_NOTIFICATION_THREAD_MAX_COMMENTS = 3;\n\ntype InboxNotificationThreadContents =\n | InboxNotificationThreadCommentsContents\n | InboxNotificationThreadMentionContents;\n\ninterface InboxNotificationCommentProps extends ComponentProps<\"div\"> {\n comment: CommentData;\n showHeader?: boolean;\n showAttachments?: boolean;\n showReactions?: boolean;\n overrides?: Partial<GlobalOverrides & CommentOverrides>;\n}\n\nexport function InboxNotificationComment({\n comment,\n showHeader = true,\n showAttachments = true,\n showReactions = true,\n overrides,\n className,\n ...props\n}: InboxNotificationCommentProps) {\n const $ = useOverrides(overrides);\n\n return (\n <div\n className={classNames(\n \"lb-root lb-inbox-notification-comment lb-comment\",\n className\n )}\n {...props}\n >\n {showHeader && (\n <div className=\"lb-comment-header\">\n <User className=\"lb-comment-author\" userId={comment.userId} />\n </div>\n )}\n <div className=\"lb-comment-content\">\n {comment.body ? (\n <>\n <CommentPrimitive.Body\n className=\"lb-comment-body\"\n body={comment.body}\n components={{\n Mention: CommentMention,\n Link: CommentNonInteractiveLink,\n }}\n />\n {showReactions && comment.reactions.length > 0 && (\n <div className=\"lb-comment-reactions\">\n {comment.reactions.map((reaction) => (\n <CommentNonInteractiveReaction\n key={reaction.emoji}\n reaction={reaction}\n overrides={overrides}\n disabled\n />\n ))}\n </div>\n )}\n {showAttachments && comment.attachments.length > 0 ? (\n <div className=\"lb-comment-attachments\">\n <div className=\"lb-attachments\">\n {comment.attachments.map((attachment) => (\n <CommentNonInteractiveFileAttachment\n key={attachment.id}\n attachment={attachment}\n overrides={overrides}\n roomId={comment.roomId}\n />\n ))}\n </div>\n </div>\n ) : null}\n </>\n ) : (\n <div className=\"lb-comment-body\">\n <p className=\"lb-comment-deleted\">{$.COMMENT_DELETED}</p>\n </div>\n )}\n </div>\n </div>\n );\n}\n\n/**\n * Find the last comment with a mention for the given user ID,\n * unless the comment was created by the user themselves.\n */\nfunction findLastCommentWithMentionedId(\n comments: CommentData[],\n mentionedId: string\n) {\n if (!comments.length) {\n return;\n }\n\n for (let i = comments.length - 1; i >= 0; i--) {\n const comment = comments[i]!;\n\n if (comment.userId === mentionedId) {\n continue;\n }\n\n if (comment.body) {\n const mentions = getMentionsFromCommentBody(\n comment.body,\n (mention) => mention.kind === \"user\" && mention.id === mentionedId\n );\n\n if (mentions.length > 0) {\n return comment;\n }\n }\n }\n\n return;\n}\n\nfunction getUserIdsFromComments(comments: CommentData[]) {\n return Array.from(new Set(comments.map((comment) => comment.userId)));\n}\n\nexport function generateInboxNotificationThreadContents(\n inboxNotification: InboxNotificationThreadData,\n thread: ThreadData<BaseMetadata>,\n userId: string\n): InboxNotificationThreadContents {\n const unreadComments = thread.comments.filter((comment) => {\n if (!comment.body) {\n return false;\n }\n\n return inboxNotification.readAt\n ? comment.createdAt > inboxNotification.readAt &&\n comment.createdAt <= inboxNotification.notifiedAt\n : comment.createdAt <= inboxNotification.notifiedAt;\n });\n\n // If the thread is read, show the last comments.\n if (unreadComments.length === 0) {\n const lastComments = thread.comments\n .filter((comment) => comment.body)\n .slice(-INBOX_NOTIFICATION_THREAD_MAX_COMMENTS);\n\n return {\n type: \"comments\",\n unread: false,\n comments: lastComments,\n userIds: getUserIdsFromComments(lastComments),\n date: inboxNotification.notifiedAt,\n };\n }\n\n const commentWithMention = findLastCommentWithMentionedId(\n unreadComments,\n userId\n );\n\n // If the thread contains one or more mentions for the current user, show the last comment with a mention.\n if (commentWithMention) {\n return {\n type: \"mention\",\n unread: true,\n comments: [commentWithMention],\n userIds: [commentWithMention.userId],\n date: commentWithMention.createdAt,\n };\n }\n\n const lastUnreadComments = unreadComments.slice(\n -INBOX_NOTIFICATION_THREAD_MAX_COMMENTS\n );\n\n // Otherwise, show the last unread comments.\n return {\n type: \"comments\",\n unread: true,\n comments: lastUnreadComments,\n userIds: getUserIdsFromComments(unreadComments),\n date: inboxNotification.notifiedAt,\n };\n}\n"],"names":["CommentPrimitive.Body"],"mappings":";;;;;;;;AAwCO,MAAM,sCAAyC,GAAA,EAAA;AAc/C,SAAS,wBAAyB,CAAA;AAAA,EACvC,OAAA;AAAA,EACA,UAAa,GAAA,IAAA;AAAA,EACb,eAAkB,GAAA,IAAA;AAAA,EAClB,aAAgB,GAAA,IAAA;AAAA,EAChB,SAAA;AAAA,EACA,SAAA;AAAA,EACG,GAAA,KAAA;AACL,CAAkC,EAAA;AAChC,EAAM,MAAA,CAAA,GAAI,aAAa,SAAS,CAAA,CAAA;AAEhC,EAAA,uBACG,IAAA,CAAA,KAAA,EAAA;AAAA,IACC,SAAW,EAAA,UAAA;AAAA,MACT,kDAAA;AAAA,MACA,SAAA;AAAA,KACF;AAAA,IACC,GAAG,KAAA;AAAA,IAEH,QAAA,EAAA;AAAA,MAAA,UAAA,oBACE,GAAA,CAAA,KAAA,EAAA;AAAA,QAAI,SAAU,EAAA,mBAAA;AAAA,QACb,QAAC,kBAAA,GAAA,CAAA,IAAA,EAAA;AAAA,UAAK,SAAU,EAAA,mBAAA;AAAA,UAAoB,QAAQ,OAAQ,CAAA,MAAA;AAAA,SAAQ,CAAA;AAAA,OAC9D,CAAA;AAAA,sBAED,GAAA,CAAA,KAAA,EAAA;AAAA,QAAI,SAAU,EAAA,oBAAA;AAAA,QACZ,kBAAQ,IACP,mBAAA,IAAA,CAAA,QAAA,EAAA;AAAA,UACE,QAAA,EAAA;AAAA,4BAAA,GAAA,CAACA,WAAA,EAAA;AAAA,cACC,SAAU,EAAA,iB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M,iBAAkB,CAAA,UAAA;AAAA,GAC1B,CAAA;AACF;;;;"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var components = require('../../components.cjs');
|
|
5
|
+
var Markdown = require('../../primitives/Markdown.cjs');
|
|
6
|
+
var classNames = require('../../utils/class-names.cjs');
|
|
7
|
+
var CodeBlock$1 = require('./CodeBlock.cjs');
|
|
8
|
+
|
|
9
|
+
function Link({ href, title, children }) {
|
|
10
|
+
const { Anchor } = components.useComponents();
|
|
11
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Anchor, {
|
|
12
|
+
href,
|
|
13
|
+
title,
|
|
14
|
+
children
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function CodeBlock({ language, code }) {
|
|
18
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CodeBlock$1.CodeBlock, {
|
|
19
|
+
title: language || "Plain text",
|
|
20
|
+
code
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const markdownComponents = {
|
|
24
|
+
Link,
|
|
25
|
+
CodeBlock
|
|
26
|
+
};
|
|
27
|
+
function Prose({ content, className, ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Markdown.Markdown, {
|
|
29
|
+
content,
|
|
30
|
+
components: markdownComponents,
|
|
31
|
+
className: classNames.classNames("lb-prose", className),
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
exports.Prose = Prose;
|
|
37
|
+
//# sourceMappingURL=Prose.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Prose.cjs","sources":["../../../src/components/internal/Prose.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\n\nimport { useComponents } from \"../../components\";\nimport type {\n MarkdownComponents,\n MarkdownComponentsCodeBlockProps,\n MarkdownComponentsLinkProps,\n} from \"../../primitives/Markdown\";\nimport { Markdown } from \"../../primitives/Markdown\";\nimport { classNames } from \"../../utils/class-names\";\nimport { CodeBlock as DefaultCodeBlock } from \"./CodeBlock\";\n\ninterface ProseProps extends ComponentProps<\"div\"> {\n content: string;\n}\n\nfunction Link({ href, title, children }: MarkdownComponentsLinkProps) {\n const { Anchor } = useComponents();\n\n return (\n <Anchor href={href} title={title}>\n {children}\n </Anchor>\n );\n}\n\nfunction CodeBlock({ language, code }: MarkdownComponentsCodeBlockProps) {\n return <DefaultCodeBlock title={language || \"Plain text\"} code={code} />;\n}\n\nconst markdownComponents: Partial<MarkdownComponents> = {\n Link,\n CodeBlock,\n};\n\n/**\n * This component renders Markdown content with `lb-prose`\n * styles and custom components (code blocks, etc)\n */\nexport function Prose({ content, className, ...props }: ProseProps) {\n return (\n <Markdown\n content={content}\n components={markdownComponents}\n className={classNames(\"lb-prose\", className)}\n {...props}\n />\n );\n}\n"],"names":["useComponents","jsx","DefaultCodeBlock","Markdown","classNames"],"mappings":";;;;;;;;AAgBA,SAAS,IAAK,CAAA,EAAE,IAAM,EAAA,KAAA,EAAO,UAAyC,EAAA;AACpE,EAAM,MAAA,EAAE,MAAO,EAAA,GAAIA,wBAAc,EAAA,CAAA;AAEjC,EAAA,uBACGC,cAAA,CAAA,MAAA,EAAA;AAAA,IAAO,IAAA;AAAA,IAAY,KAAA;AAAA,IACjB,QAAA;AAAA,GACH,CAAA,CAAA;AAEJ,CAAA;AAEA,SAAS,SAAU,CAAA,EAAE,QAAU,EAAA,IAAA,EAA0C,EAAA;AACvE,EAAA,uBAAQA,cAAA,CAAAC,qBAAA,EAAA;AAAA,IAAiB,OAAO,QAAY,IAAA,YAAA;AAAA,IAAc,IAAA;AAAA,GAAY,CAAA,CAAA;AACxE,CAAA;AAEA,MAAM,kBAAkD,GAAA;AAAA,EACtD,IAAA;AAAA,EACA,SAAA;AACF,CAAA,CAAA;AAMO,SAAS,KAAM,CAAA,EAAE,OAAS,EAAA,SAAA,EAAA,GAAc,OAAqB,EAAA;AAClE,EAAA,uBACGD,cAAA,CAAAE,iBAAA,EAAA;AAAA,IACC,OAAA;AAAA,IACA,UAAY,EAAA,kBAAA;AAAA,IACZ,SAAA,EAAWC,qBAAW,CAAA,UAAA,EAAY,SAAS,CAAA;AAAA,IAC1C,GAAG,KAAA;AAAA,GACN,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useComponents } from '../../components.js';
|
|
3
|
+
import { Markdown } from '../../primitives/Markdown.js';
|
|
4
|
+
import { classNames } from '../../utils/class-names.js';
|
|
5
|
+
import { CodeBlock as CodeBlock$1 } from './CodeBlock.js';
|
|
6
|
+
|
|
7
|
+
function Link({ href, title, children }) {
|
|
8
|
+
const { Anchor } = useComponents();
|
|
9
|
+
return /* @__PURE__ */ jsx(Anchor, {
|
|
10
|
+
href,
|
|
11
|
+
title,
|
|
12
|
+
children
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function CodeBlock({ language, code }) {
|
|
16
|
+
return /* @__PURE__ */ jsx(CodeBlock$1, {
|
|
17
|
+
title: language || "Plain text",
|
|
18
|
+
code
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
const markdownComponents = {
|
|
22
|
+
Link,
|
|
23
|
+
CodeBlock
|
|
24
|
+
};
|
|
25
|
+
function Prose({ content, className, ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsx(Markdown, {
|
|
27
|
+
content,
|
|
28
|
+
components: markdownComponents,
|
|
29
|
+
className: classNames("lb-prose", className),
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { Prose };
|
|
35
|
+
//# sourceMappingURL=Prose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Prose.js","sources":["../../../src/components/internal/Prose.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\n\nimport { useComponents } from \"../../components\";\nimport type {\n MarkdownComponents,\n MarkdownComponentsCodeBlockProps,\n MarkdownComponentsLinkProps,\n} from \"../../primitives/Markdown\";\nimport { Markdown } from \"../../primitives/Markdown\";\nimport { classNames } from \"../../utils/class-names\";\nimport { CodeBlock as DefaultCodeBlock } from \"./CodeBlock\";\n\ninterface ProseProps extends ComponentProps<\"div\"> {\n content: string;\n}\n\nfunction Link({ href, title, children }: MarkdownComponentsLinkProps) {\n const { Anchor } = useComponents();\n\n return (\n <Anchor href={href} title={title}>\n {children}\n </Anchor>\n );\n}\n\nfunction CodeBlock({ language, code }: MarkdownComponentsCodeBlockProps) {\n return <DefaultCodeBlock title={language || \"Plain text\"} code={code} />;\n}\n\nconst markdownComponents: Partial<MarkdownComponents> = {\n Link,\n CodeBlock,\n};\n\n/**\n * This component renders Markdown content with `lb-prose`\n * styles and custom components (code blocks, etc)\n */\nexport function Prose({ content, className, ...props }: ProseProps) {\n return (\n <Markdown\n content={content}\n components={markdownComponents}\n className={classNames(\"lb-prose\", className)}\n {...props}\n />\n );\n}\n"],"names":["DefaultCodeBlock"],"mappings":";;;;;;AAgBA,SAAS,IAAK,CAAA,EAAE,IAAM,EAAA,KAAA,EAAO,UAAyC,EAAA;AACpE,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,aAAc,EAAA,CAAA;AAEjC,EAAA,uBACG,GAAA,CAAA,MAAA,EAAA;AAAA,IAAO,IAAA;AAAA,IAAY,KAAA;AAAA,IACjB,QAAA;AAAA,GACH,CAAA,CAAA;AAEJ,CAAA;AAEA,SAAS,SAAU,CAAA,EAAE,QAAU,EAAA,IAAA,EAA0C,EAAA;AACvE,EAAA,uBAAQ,GAAA,CAAAA,WAAA,EAAA;AAAA,IAAiB,OAAO,QAAY,IAAA,YAAA;AAAA,IAAc,IAAA;AAAA,GAAY,CAAA,CAAA;AACxE,CAAA;AAEA,MAAM,kBAAkD,GAAA;AAAA,EACtD,IAAA;AAAA,EACA,SAAA;AACF,CAAA,CAAA;AAMO,SAAS,KAAM,CAAA,EAAE,OAAS,EAAA,SAAA,EAAA,GAAc,OAAqB,EAAA;AAClE,EAAA,uBACG,GAAA,CAAA,QAAA,EAAA;AAAA,IACC,OAAA;AAAA,IACA,UAAY,EAAA,kBAAA;AAAA,IACZ,SAAA,EAAW,UAAW,CAAA,UAAA,EAAY,SAAS,CAAA;AAAA,IAC1C,GAAG,KAAA;AAAA,GACN,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -68,7 +68,7 @@ function getShortcutKbdFromKeymap(keymap) {
|
|
|
68
68
|
}
|
|
69
69
|
const Tooltip = react.forwardRef(
|
|
70
70
|
({ children, content, multiline, className, ...props }, forwardedRef) => {
|
|
71
|
-
const { portalContainer } = config.
|
|
71
|
+
const { portalContainer } = config.useLiveblocksUiConfig();
|
|
72
72
|
return /* @__PURE__ */ jsxRuntime.jsxs(TooltipPrimitive__namespace.Root, {
|
|
73
73
|
disableHoverableContent: true,
|
|
74
74
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.cjs","sources":["../../../src/components/internal/Tooltip.tsx"],"sourcesContent":["\"use client\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { forwardRef, useMemo } from \"react\";\n\nimport {
|
|
1
|
+
{"version":3,"file":"Tooltip.cjs","sources":["../../../src/components/internal/Tooltip.tsx"],"sourcesContent":["\"use client\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { forwardRef, useMemo } from \"react\";\n\nimport { useLiveblocksUiConfig } from \"../../config\";\nimport {\n FLOATING_ELEMENT_COLLISION_PADDING,\n FLOATING_ELEMENT_SIDE_OFFSET,\n} from \"../../constants\";\nimport { classNames } from \"../../utils/class-names\";\nimport { isApple } from \"../../utils/is-apple\";\n\nconst ALT_KEY = { title: \"Alt\", key: \"⌥\" };\nconst COMMAND_KEY = { title: \"Command\", key: \"⌘\" };\nconst CONTROL_KEY = { title: \"Ctrl\", key: \"⌃\" };\nconst SHIFT_KEY = { title: \"Shift\", key: \"⇧\" };\nconst ENTER_KEY = { title: \"Enter\", key: \"⏎\" };\nconst SPACE_KEY = { title: \"Space\", key: \"␣\" };\nconst ESCAPE_KEY = { title: \"Escape\", key: \"⎋\" };\n\nconst KEYS = {\n alt: () => ALT_KEY,\n mod: () => (isApple() ? COMMAND_KEY : CONTROL_KEY),\n control: () => CONTROL_KEY,\n ctrl: () => CONTROL_KEY,\n command: () => COMMAND_KEY,\n cmd: () => COMMAND_KEY,\n shift: () => SHIFT_KEY,\n enter: () => ENTER_KEY,\n \" \": () => SPACE_KEY,\n space: () => SPACE_KEY,\n escape: () => ESCAPE_KEY,\n esc: () => ESCAPE_KEY,\n} as const;\n\nexport interface TooltipProps\n extends Pick<TooltipPrimitive.TooltipTriggerProps, \"children\">,\n Omit<TooltipPrimitive.TooltipContentProps, \"content\"> {\n content: ReactNode;\n multiline?: boolean;\n}\n\nexport interface ShortcutTooltipProps extends TooltipProps {\n shortcut?: string;\n}\n\nexport interface ShortcutTooltipKeyProps extends ComponentProps<\"abbr\"> {\n name: keyof typeof KEYS;\n}\n\nfunction getShortcutKbdFromKeymap(keymap: string) {\n const keys = keymap.split(\"-\");\n\n return (\n <>\n {keys.map((key, index) => {\n const lowerKey = key.toLowerCase();\n\n if (lowerKey in KEYS) {\n return (\n <ShortcutTooltipKey\n key={index}\n name={lowerKey as keyof typeof KEYS}\n />\n );\n }\n\n return <span key={index}>{key}</span>;\n })}\n </>\n );\n}\n\nexport const Tooltip = forwardRef<HTMLButtonElement, TooltipProps>(\n ({ children, content, multiline, className, ...props }, forwardedRef) => {\n const { portalContainer } = useLiveblocksUiConfig();\n\n return (\n <TooltipPrimitive.Root disableHoverableContent>\n <TooltipPrimitive.Trigger asChild ref={forwardedRef}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal container={portalContainer}>\n <TooltipPrimitive.Content\n className={classNames(\n \"lb-root lb-portal lb-tooltip\",\n multiline && \"lb-tooltip:multiline\",\n className\n )}\n side=\"top\"\n align=\"center\"\n sideOffset={FLOATING_ELEMENT_SIDE_OFFSET}\n collisionPadding={FLOATING_ELEMENT_COLLISION_PADDING}\n {...props}\n >\n {content}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n }\n);\n\nexport const ShortcutTooltip = forwardRef<\n HTMLButtonElement,\n ShortcutTooltipProps\n>(({ children, content, shortcut, ...props }, forwardedRef) => {\n const shortcutKbd = useMemo(() => {\n return shortcut ? getShortcutKbdFromKeymap(shortcut) : null;\n }, [shortcut]);\n\n return (\n <Tooltip\n content={\n <>\n {content}\n {shortcutKbd && (\n <kbd className=\"lb-tooltip-shortcut\">{shortcutKbd}</kbd>\n )}\n </>\n }\n {...props}\n ref={forwardedRef}\n >\n {children}\n </Tooltip>\n );\n});\n\nfunction ShortcutTooltipKey({ name, ...props }: ShortcutTooltipKeyProps) {\n const { title, key } = useMemo(() => KEYS[name]?.(), [name]);\n\n return (\n <abbr title={title} {...props}>\n {key}\n </abbr>\n );\n}\n\nexport { TooltipProvider } from \"@radix-ui/react-tooltip\";\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAa;AACA;AAC2B;AACvB;AACH;AACG;AACJ;AACE;AACA;AACF;AACE;AACC;AAEhB;AAiBA;AACE;AAEA;AACE;AAEI;AAEA;AACE;AACG;AAEO;AACR;AAIJ;AAAQ;AAAkB;AAAI;AAC/B;AAGP;AAEO;AAAgB;AAEnB;AAEA;AACG;AAA6C;AAC5C;AAAC;AAAgC;AAAM;AACpC;AACH;AACC;AAAmC;AACjC;AACY;AACT;AACa;AACb;AACF;AACK;AACC;AACM;AACM;AACd;AAEH;AACH;AACF;AAAA;AACF;AAGN;AAEa;AAIX;AACE;AAAuD;AAGzD;AACG;AAEG;AACG;AAAA;AAEE;AAAc;AAAuB;AAAY;AAAA;AAEtD;AAEE;AACC;AAEJ;AAGP;AAEA;AACE;AAEA;AACG;AAAK;AAAkB;AACrB;AAGP;;;;;;;"}
|
|
@@ -3,7 +3,7 @@ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
|
3
3
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
4
4
|
export { TooltipProvider } from '@radix-ui/react-tooltip';
|
|
5
5
|
import { forwardRef, useMemo } from 'react';
|
|
6
|
-
import {
|
|
6
|
+
import { useLiveblocksUiConfig } from '../../config.js';
|
|
7
7
|
import { FLOATING_ELEMENT_SIDE_OFFSET, FLOATING_ELEMENT_COLLISION_PADDING } from '../../constants.js';
|
|
8
8
|
import { classNames } from '../../utils/class-names.js';
|
|
9
9
|
import { isApple } from '../../utils/is-apple.js';
|
|
@@ -48,7 +48,7 @@ function getShortcutKbdFromKeymap(keymap) {
|
|
|
48
48
|
}
|
|
49
49
|
const Tooltip = forwardRef(
|
|
50
50
|
({ children, content, multiline, className, ...props }, forwardedRef) => {
|
|
51
|
-
const { portalContainer } =
|
|
51
|
+
const { portalContainer } = useLiveblocksUiConfig();
|
|
52
52
|
return /* @__PURE__ */ jsxs(TooltipPrimitive.Root, {
|
|
53
53
|
disableHoverableContent: true,
|
|
54
54
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sources":["../../../src/components/internal/Tooltip.tsx"],"sourcesContent":["\"use client\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { forwardRef, useMemo } from \"react\";\n\nimport {
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sources":["../../../src/components/internal/Tooltip.tsx"],"sourcesContent":["\"use client\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { forwardRef, useMemo } from \"react\";\n\nimport { useLiveblocksUiConfig } from \"../../config\";\nimport {\n FLOATING_ELEMENT_COLLISION_PADDING,\n FLOATING_ELEMENT_SIDE_OFFSET,\n} from \"../../constants\";\nimport { classNames } from \"../../utils/class-names\";\nimport { isApple } from \"../../utils/is-apple\";\n\nconst ALT_KEY = { title: \"Alt\", key: \"⌥\" };\nconst COMMAND_KEY = { title: \"Command\", key: \"⌘\" };\nconst CONTROL_KEY = { title: \"Ctrl\", key: \"⌃\" };\nconst SHIFT_KEY = { title: \"Shift\", key: \"⇧\" };\nconst ENTER_KEY = { title: \"Enter\", key: \"⏎\" };\nconst SPACE_KEY = { title: \"Space\", key: \"␣\" };\nconst ESCAPE_KEY = { title: \"Escape\", key: \"⎋\" };\n\nconst KEYS = {\n alt: () => ALT_KEY,\n mod: () => (isApple() ? COMMAND_KEY : CONTROL_KEY),\n control: () => CONTROL_KEY,\n ctrl: () => CONTROL_KEY,\n command: () => COMMAND_KEY,\n cmd: () => COMMAND_KEY,\n shift: () => SHIFT_KEY,\n enter: () => ENTER_KEY,\n \" \": () => SPACE_KEY,\n space: () => SPACE_KEY,\n escape: () => ESCAPE_KEY,\n esc: () => ESCAPE_KEY,\n} as const;\n\nexport interface TooltipProps\n extends Pick<TooltipPrimitive.TooltipTriggerProps, \"children\">,\n Omit<TooltipPrimitive.TooltipContentProps, \"content\"> {\n content: ReactNode;\n multiline?: boolean;\n}\n\nexport interface ShortcutTooltipProps extends TooltipProps {\n shortcut?: string;\n}\n\nexport interface ShortcutTooltipKeyProps extends ComponentProps<\"abbr\"> {\n name: keyof typeof KEYS;\n}\n\nfunction getShortcutKbdFromKeymap(keymap: string) {\n const keys = keymap.split(\"-\");\n\n return (\n <>\n {keys.map((key, index) => {\n const lowerKey = key.toLowerCase();\n\n if (lowerKey in KEYS) {\n return (\n <ShortcutTooltipKey\n key={index}\n name={lowerKey as keyof typeof KEYS}\n />\n );\n }\n\n return <span key={index}>{key}</span>;\n })}\n </>\n );\n}\n\nexport const Tooltip = forwardRef<HTMLButtonElement, TooltipProps>(\n ({ children, content, multiline, className, ...props }, forwardedRef) => {\n const { portalContainer } = useLiveblocksUiConfig();\n\n return (\n <TooltipPrimitive.Root disableHoverableContent>\n <TooltipPrimitive.Trigger asChild ref={forwardedRef}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal container={portalContainer}>\n <TooltipPrimitive.Content\n className={classNames(\n \"lb-root lb-portal lb-tooltip\",\n multiline && \"lb-tooltip:multiline\",\n className\n )}\n side=\"top\"\n align=\"center\"\n sideOffset={FLOATING_ELEMENT_SIDE_OFFSET}\n collisionPadding={FLOATING_ELEMENT_COLLISION_PADDING}\n {...props}\n >\n {content}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n }\n);\n\nexport const ShortcutTooltip = forwardRef<\n HTMLButtonElement,\n ShortcutTooltipProps\n>(({ children, content, shortcut, ...props }, forwardedRef) => {\n const shortcutKbd = useMemo(() => {\n return shortcut ? getShortcutKbdFromKeymap(shortcut) : null;\n }, [shortcut]);\n\n return (\n <Tooltip\n content={\n <>\n {content}\n {shortcutKbd && (\n <kbd className=\"lb-tooltip-shortcut\">{shortcutKbd}</kbd>\n )}\n </>\n }\n {...props}\n ref={forwardedRef}\n >\n {children}\n </Tooltip>\n );\n});\n\nfunction ShortcutTooltipKey({ name, ...props }: ShortcutTooltipKeyProps) {\n const { title, key } = useMemo(() => KEYS[name]?.(), [name]);\n\n return (\n <abbr title={title} {...props}>\n {key}\n </abbr>\n );\n}\n\nexport { TooltipProvider } from \"@radix-ui/react-tooltip\";\n"],"names":[],"mappings":";;;;;;;;;;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAa;AACA;AAC2B;AACvB;AACH;AACG;AACJ;AACE;AACA;AACF;AACE;AACC;AAEhB;AAiBA;AACE;AAEA;AACE;AAEI;AAEA;AACE;AACG;AAEO;AACR;AAIJ;AAAQ;AAAkB;AAAI;AAC/B;AAGP;AAEO;AAAgB;AAEnB;AAEA;AACG;AAA6C;AAC5C;AAAC;AAAgC;AAAM;AACpC;AACH;AACC;AAAmC;AACjC;AACY;AACT;AACa;AACb;AACF;AACK;AACC;AACM;AACM;AACd;AAEH;AACH;AACF;AAAA;AACF;AAGN;AAEa;AAIX;AACE;AAAuD;AAGzD;AACG;AAEG;AACG;AAAA;AAEE;AAAc;AAAuB;AAAY;AAAA;AAEtD;AAEE;AACC;AAEJ;AAGP;AAEA;AACE;AAEA;AACG;AAAK;AAAkB;AACrB;AAGP;;"}
|
package/dist/config.cjs
CHANGED
|
@@ -7,11 +7,11 @@ var components = require('./components.cjs');
|
|
|
7
7
|
var overrides = require('./overrides.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
const
|
|
11
|
-
function
|
|
12
|
-
return react.useContext(
|
|
10
|
+
const LiveblocksUiConfigContext = react.createContext({});
|
|
11
|
+
function useLiveblocksUiConfig() {
|
|
12
|
+
return react.useContext(LiveblocksUiConfigContext);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function LiveblocksUiConfig({
|
|
15
15
|
overrides: overrides$1,
|
|
16
16
|
components: components$1,
|
|
17
17
|
portalContainer,
|
|
@@ -19,7 +19,7 @@ function LiveblocksUIConfig({
|
|
|
19
19
|
emojibaseUrl,
|
|
20
20
|
children
|
|
21
21
|
}) {
|
|
22
|
-
const
|
|
22
|
+
const liveblocksUiConfig = react.useMemo(
|
|
23
23
|
() => ({
|
|
24
24
|
portalContainer,
|
|
25
25
|
preventUnsavedComposerChanges,
|
|
@@ -27,8 +27,8 @@ function LiveblocksUIConfig({
|
|
|
27
27
|
}),
|
|
28
28
|
[portalContainer, preventUnsavedComposerChanges, emojibaseUrl]
|
|
29
29
|
);
|
|
30
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
31
|
-
value:
|
|
30
|
+
return /* @__PURE__ */ jsxRuntime.jsx(LiveblocksUiConfigContext.Provider, {
|
|
31
|
+
value: liveblocksUiConfig,
|
|
32
32
|
children: /* @__PURE__ */ jsxRuntime.jsx(overrides.OverridesProvider, {
|
|
33
33
|
overrides: overrides$1,
|
|
34
34
|
children: /* @__PURE__ */ jsxRuntime.jsx(components.ComponentsProvider, {
|
|
@@ -39,6 +39,6 @@ function LiveblocksUIConfig({
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
exports.
|
|
43
|
-
exports.
|
|
42
|
+
exports.LiveblocksUiConfig = LiveblocksUiConfig;
|
|
43
|
+
exports.useLiveblocksUiConfig = useLiveblocksUiConfig;
|
|
44
44
|
//# sourceMappingURL=config.cjs.map
|
package/dist/config.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.cjs","sources":["../src/config.tsx"],"sourcesContent":["\"use client\";\n\nimport type { PropsWithChildren } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\nimport { type Components, ComponentsProvider } from \"./components\";\nimport type { Overrides } from \"./overrides\";\nimport { OverridesProvider } from \"./overrides\";\n\ntype
|
|
1
|
+
{"version":3,"file":"config.cjs","sources":["../src/config.tsx"],"sourcesContent":["\"use client\";\n\nimport type { PropsWithChildren } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\nimport { type Components, ComponentsProvider } from \"./components\";\nimport type { Overrides } from \"./overrides\";\nimport { OverridesProvider } from \"./overrides\";\n\ntype LiveblocksUiConfigProps = PropsWithChildren<{\n /**\n * Override the components' strings.\n */\n overrides?: Partial<Overrides>;\n\n /**\n * Override the components' components.\n */\n components?: Partial<Components>;\n\n /**\n * The container to render the portal into.\n */\n portalContainer?: HTMLElement;\n\n /**\n * When `preventUnsavedChanges` is set on your Liveblocks client (or set on\n * <LiveblocksProvider>), then closing a browser tab will be prevented when\n * there are unsaved changes.\n *\n * By default, that will include draft texts or attachments that are (being)\n * uploaded via comments/threads composers, but not submitted yet.\n *\n * If you want to prevent unsaved changes with Liveblocks, but not for\n * composers, you can opt-out by setting this option to `false`.\n */\n preventUnsavedComposerChanges?: boolean;\n\n /**\n * The Liveblocks emoji picker (visible when adding reactions in `Comment`) is built with\n * {@link https://github.com/liveblocks/frimousse | Frimousse}, which fetches its data from\n * {@link https://emojibase.dev/docs/datasets/ | Emojibase}.\n *\n * This option allows you to change the base URL of where the {@link https://www.npmjs.com/package/emojibase-data | `emojibase-data`}\n * files should be fetched from, used as follows: `${emojibaseUrl}/${locale}/${file}.json`.\n * (e.g. `${emojibaseUrl}/en/data.json`).\n *\n * @example \"https://unpkg.com/emojibase-data\"\n *\n * @example \"https://example.com/self-hosted-emojibase-data\"\n */\n emojibaseUrl?: string;\n}>;\n\ninterface LiveblocksUiConfigContext {\n portalContainer?: HTMLElement;\n preventUnsavedComposerChanges?: boolean;\n emojibaseUrl?: string;\n}\n\nconst LiveblocksUiConfigContext = createContext<LiveblocksUiConfigContext>({});\n\nexport function useLiveblocksUiConfig() {\n return useContext(LiveblocksUiConfigContext);\n}\n\n/**\n * Set configuration options for all components.\n *\n * @example\n * <LiveblocksUiConfig overrides={{ locale: \"fr\", USER_UNKNOWN: \"Anonyme\", ... }}>\n * <App />\n * </LiveblocksUiConfig>\n */\nexport function LiveblocksUiConfig({\n overrides,\n components,\n portalContainer,\n preventUnsavedComposerChanges = true,\n emojibaseUrl,\n children,\n}: LiveblocksUiConfigProps) {\n const liveblocksUiConfig = useMemo(\n () => ({\n portalContainer,\n preventUnsavedComposerChanges,\n emojibaseUrl,\n }),\n [portalContainer, preventUnsavedComposerChanges, emojibaseUrl]\n );\n\n return (\n <LiveblocksUiConfigContext.Provider value={liveblocksUiConfig}>\n <OverridesProvider overrides={overrides}>\n <ComponentsProvider components={components}>\n {children}\n </ComponentsProvider>\n </OverridesProvider>\n </LiveblocksUiConfigContext.Provider>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AA4DA;AAEO;AACL;AACF;AAUO;AAA4B;AACjC;AACA;AACA;AACgC;AAChC;AAEF;AACE;AAA2B;AAClB;AACL;AACA;AACA;AACF;AAC6D;AAG/D;AACG;AAA0C;AACxC;AAAkB;AAChB;AAAmB;AACjB;AACH;AACF;AAGN;;;"}
|
package/dist/config.js
CHANGED
|
@@ -5,11 +5,11 @@ import { ComponentsProvider } from './components.js';
|
|
|
5
5
|
import { OverridesProvider } from './overrides.js';
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
return useContext(
|
|
8
|
+
const LiveblocksUiConfigContext = createContext({});
|
|
9
|
+
function useLiveblocksUiConfig() {
|
|
10
|
+
return useContext(LiveblocksUiConfigContext);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function LiveblocksUiConfig({
|
|
13
13
|
overrides,
|
|
14
14
|
components,
|
|
15
15
|
portalContainer,
|
|
@@ -17,7 +17,7 @@ function LiveblocksUIConfig({
|
|
|
17
17
|
emojibaseUrl,
|
|
18
18
|
children
|
|
19
19
|
}) {
|
|
20
|
-
const
|
|
20
|
+
const liveblocksUiConfig = useMemo(
|
|
21
21
|
() => ({
|
|
22
22
|
portalContainer,
|
|
23
23
|
preventUnsavedComposerChanges,
|
|
@@ -25,8 +25,8 @@ function LiveblocksUIConfig({
|
|
|
25
25
|
}),
|
|
26
26
|
[portalContainer, preventUnsavedComposerChanges, emojibaseUrl]
|
|
27
27
|
);
|
|
28
|
-
return /* @__PURE__ */ jsx(
|
|
29
|
-
value:
|
|
28
|
+
return /* @__PURE__ */ jsx(LiveblocksUiConfigContext.Provider, {
|
|
29
|
+
value: liveblocksUiConfig,
|
|
30
30
|
children: /* @__PURE__ */ jsx(OverridesProvider, {
|
|
31
31
|
overrides,
|
|
32
32
|
children: /* @__PURE__ */ jsx(ComponentsProvider, {
|
|
@@ -37,5 +37,5 @@ function LiveblocksUIConfig({
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
export {
|
|
40
|
+
export { LiveblocksUiConfig, useLiveblocksUiConfig };
|
|
41
41
|
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../src/config.tsx"],"sourcesContent":["\"use client\";\n\nimport type { PropsWithChildren } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\nimport { type Components, ComponentsProvider } from \"./components\";\nimport type { Overrides } from \"./overrides\";\nimport { OverridesProvider } from \"./overrides\";\n\ntype
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../src/config.tsx"],"sourcesContent":["\"use client\";\n\nimport type { PropsWithChildren } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\nimport { type Components, ComponentsProvider } from \"./components\";\nimport type { Overrides } from \"./overrides\";\nimport { OverridesProvider } from \"./overrides\";\n\ntype LiveblocksUiConfigProps = PropsWithChildren<{\n /**\n * Override the components' strings.\n */\n overrides?: Partial<Overrides>;\n\n /**\n * Override the components' components.\n */\n components?: Partial<Components>;\n\n /**\n * The container to render the portal into.\n */\n portalContainer?: HTMLElement;\n\n /**\n * When `preventUnsavedChanges` is set on your Liveblocks client (or set on\n * <LiveblocksProvider>), then closing a browser tab will be prevented when\n * there are unsaved changes.\n *\n * By default, that will include draft texts or attachments that are (being)\n * uploaded via comments/threads composers, but not submitted yet.\n *\n * If you want to prevent unsaved changes with Liveblocks, but not for\n * composers, you can opt-out by setting this option to `false`.\n */\n preventUnsavedComposerChanges?: boolean;\n\n /**\n * The Liveblocks emoji picker (visible when adding reactions in `Comment`) is built with\n * {@link https://github.com/liveblocks/frimousse | Frimousse}, which fetches its data from\n * {@link https://emojibase.dev/docs/datasets/ | Emojibase}.\n *\n * This option allows you to change the base URL of where the {@link https://www.npmjs.com/package/emojibase-data | `emojibase-data`}\n * files should be fetched from, used as follows: `${emojibaseUrl}/${locale}/${file}.json`.\n * (e.g. `${emojibaseUrl}/en/data.json`).\n *\n * @example \"https://unpkg.com/emojibase-data\"\n *\n * @example \"https://example.com/self-hosted-emojibase-data\"\n */\n emojibaseUrl?: string;\n}>;\n\ninterface LiveblocksUiConfigContext {\n portalContainer?: HTMLElement;\n preventUnsavedComposerChanges?: boolean;\n emojibaseUrl?: string;\n}\n\nconst LiveblocksUiConfigContext = createContext<LiveblocksUiConfigContext>({});\n\nexport function useLiveblocksUiConfig() {\n return useContext(LiveblocksUiConfigContext);\n}\n\n/**\n * Set configuration options for all components.\n *\n * @example\n * <LiveblocksUiConfig overrides={{ locale: \"fr\", USER_UNKNOWN: \"Anonyme\", ... }}>\n * <App />\n * </LiveblocksUiConfig>\n */\nexport function LiveblocksUiConfig({\n overrides,\n components,\n portalContainer,\n preventUnsavedComposerChanges = true,\n emojibaseUrl,\n children,\n}: LiveblocksUiConfigProps) {\n const liveblocksUiConfig = useMemo(\n () => ({\n portalContainer,\n preventUnsavedComposerChanges,\n emojibaseUrl,\n }),\n [portalContainer, preventUnsavedComposerChanges, emojibaseUrl]\n );\n\n return (\n <LiveblocksUiConfigContext.Provider value={liveblocksUiConfig}>\n <OverridesProvider overrides={overrides}>\n <ComponentsProvider components={components}>\n {children}\n </ComponentsProvider>\n </OverridesProvider>\n </LiveblocksUiConfigContext.Provider>\n );\n}\n"],"names":[],"mappings":";;;;;;;AA4DA;AAEO;AACL;AACF;AAUO;AAA4B;AACjC;AACA;AACA;AACgC;AAChC;AAEF;AACE;AAA2B;AAClB;AACL;AACA;AACA;AACF;AAC6D;AAG/D;AACG;AAA0C;AACxC;AAAkB;AAChB;AAAmB;AACjB;AACH;AACF;AAGN;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var Icon = require('../components/internal/Icon.cjs');
|
|
5
|
+
|
|
6
|
+
function CrossCircleFillIcon(props) {
|
|
7
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Icon.Icon, {
|
|
8
|
+
...props,
|
|
9
|
+
children: [
|
|
10
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", {
|
|
11
|
+
cx: 10,
|
|
12
|
+
cy: 10,
|
|
13
|
+
r: 7,
|
|
14
|
+
fill: "currentColor"
|
|
15
|
+
}),
|
|
16
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", {
|
|
17
|
+
d: "m12.5 7.5-5 5m0-5 5 5",
|
|
18
|
+
stroke: "var(--lb-icon-background)"
|
|
19
|
+
})
|
|
20
|
+
]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
exports.CrossCircleFillIcon = CrossCircleFillIcon;
|
|
25
|
+
//# sourceMappingURL=CrossCircleFill.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CrossCircleFill.cjs","sources":["../../src/icons/CrossCircleFill.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\n\nimport { Icon } from \"../components/internal/Icon\";\n\nexport function CrossCircleFillIcon(props: ComponentProps<\"svg\">) {\n return (\n <Icon {...props}>\n <circle cx={10} cy={10} r={7} fill=\"currentColor\" />\n <path d=\"m12.5 7.5-5 5m0-5 5 5\" stroke=\"var(--lb-icon-background)\" />\n </Icon>\n );\n}\n"],"names":["jsxs","Icon","jsx"],"mappings":";;;;;AAIO,SAAS,oBAAoB,KAA8B,EAAA;AAChE,EAAA,uBACGA,eAAA,CAAAC,SAAA,EAAA;AAAA,IAAM,GAAG,KAAA;AAAA,IACR,QAAA,EAAA;AAAA,sBAACC,cAAA,CAAA,QAAA,EAAA;AAAA,QAAO,EAAI,EAAA,EAAA;AAAA,QAAI,EAAI,EAAA,EAAA;AAAA,QAAI,CAAG,EAAA,CAAA;AAAA,QAAG,IAAK,EAAA,cAAA;AAAA,OAAe,CAAA;AAAA,sBACjDA,cAAA,CAAA,MAAA,EAAA;AAAA,QAAK,CAAE,EAAA,uBAAA;AAAA,QAAwB,MAAO,EAAA,2BAAA;AAAA,OAA4B,CAAA;AAAA,KAAA;AAAA,GACrE,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Icon } from '../components/internal/Icon.js';
|
|
3
|
+
|
|
4
|
+
function CrossCircleFillIcon(props) {
|
|
5
|
+
return /* @__PURE__ */ jsxs(Icon, {
|
|
6
|
+
...props,
|
|
7
|
+
children: [
|
|
8
|
+
/* @__PURE__ */ jsx("circle", {
|
|
9
|
+
cx: 10,
|
|
10
|
+
cy: 10,
|
|
11
|
+
r: 7,
|
|
12
|
+
fill: "currentColor"
|
|
13
|
+
}),
|
|
14
|
+
/* @__PURE__ */ jsx("path", {
|
|
15
|
+
d: "m12.5 7.5-5 5m0-5 5 5",
|
|
16
|
+
stroke: "var(--lb-icon-background)"
|
|
17
|
+
})
|
|
18
|
+
]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { CrossCircleFillIcon };
|
|
23
|
+
//# sourceMappingURL=CrossCircleFill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CrossCircleFill.js","sources":["../../src/icons/CrossCircleFill.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\n\nimport { Icon } from \"../components/internal/Icon\";\n\nexport function CrossCircleFillIcon(props: ComponentProps<\"svg\">) {\n return (\n <Icon {...props}>\n <circle cx={10} cy={10} r={7} fill=\"currentColor\" />\n <path d=\"m12.5 7.5-5 5m0-5 5 5\" stroke=\"var(--lb-icon-background)\" />\n </Icon>\n );\n}\n"],"names":[],"mappings":";;;AAIO,SAAS,oBAAoB,KAA8B,EAAA;AAChE,EAAA,uBACG,IAAA,CAAA,IAAA,EAAA;AAAA,IAAM,GAAG,KAAA;AAAA,IACR,QAAA,EAAA;AAAA,sBAAC,GAAA,CAAA,QAAA,EAAA;AAAA,QAAO,EAAI,EAAA,EAAA;AAAA,QAAI,EAAI,EAAA,EAAA;AAAA,QAAI,CAAG,EAAA,CAAA;AAAA,QAAG,IAAK,EAAA,cAAA;AAAA,OAAe,CAAA;AAAA,sBACjD,GAAA,CAAA,MAAA,EAAA;AAAA,QAAK,CAAE,EAAA,uBAAA;AAAA,QAAwB,MAAO,EAAA,2BAAA;AAAA,OAA4B,CAAA;AAAA,KAAA;AAAA,GACrE,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var Icon = require('../components/internal/Icon.cjs');
|
|
5
|
+
|
|
6
|
+
function MinusCircleIcon(props) {
|
|
7
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Icon.Icon, {
|
|
8
|
+
...props,
|
|
9
|
+
children: [
|
|
10
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", {
|
|
11
|
+
cx: 10,
|
|
12
|
+
cy: 10,
|
|
13
|
+
r: 7
|
|
14
|
+
}),
|
|
15
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", {
|
|
16
|
+
d: "M7 10h6"
|
|
17
|
+
})
|
|
18
|
+
]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
exports.MinusCircleIcon = MinusCircleIcon;
|
|
23
|
+
//# sourceMappingURL=MinusCircle.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MinusCircle.cjs","sources":["../../src/icons/MinusCircle.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\n\nimport { Icon } from \"../components/internal/Icon\";\n\nexport function MinusCircleIcon(props: ComponentProps<\"svg\">) {\n return (\n <Icon {...props}>\n <circle cx={10} cy={10} r={7} />\n <path d=\"M7 10h6\" />\n </Icon>\n );\n}\n"],"names":["jsxs","Icon","jsx"],"mappings":";;;;;AAIO,SAAS,gBAAgB,KAA8B,EAAA;AAC5D,EAAA,uBACGA,eAAA,CAAAC,SAAA,EAAA;AAAA,IAAM,GAAG,KAAA;AAAA,IACR,QAAA,EAAA;AAAA,sBAACC,cAAA,CAAA,QAAA,EAAA;AAAA,QAAO,EAAI,EAAA,EAAA;AAAA,QAAI,EAAI,EAAA,EAAA;AAAA,QAAI,CAAG,EAAA,CAAA;AAAA,OAAG,CAAA;AAAA,sBAC7BA,cAAA,CAAA,MAAA,EAAA;AAAA,QAAK,CAAE,EAAA,SAAA;AAAA,OAAU,CAAA;AAAA,KAAA;AAAA,GACpB,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Icon } from '../components/internal/Icon.js';
|
|
3
|
+
|
|
4
|
+
function MinusCircleIcon(props) {
|
|
5
|
+
return /* @__PURE__ */ jsxs(Icon, {
|
|
6
|
+
...props,
|
|
7
|
+
children: [
|
|
8
|
+
/* @__PURE__ */ jsx("circle", {
|
|
9
|
+
cx: 10,
|
|
10
|
+
cy: 10,
|
|
11
|
+
r: 7
|
|
12
|
+
}),
|
|
13
|
+
/* @__PURE__ */ jsx("path", {
|
|
14
|
+
d: "M7 10h6"
|
|
15
|
+
})
|
|
16
|
+
]
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { MinusCircleIcon };
|
|
21
|
+
//# sourceMappingURL=MinusCircle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MinusCircle.js","sources":["../../src/icons/MinusCircle.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\n\nimport { Icon } from \"../components/internal/Icon\";\n\nexport function MinusCircleIcon(props: ComponentProps<\"svg\">) {\n return (\n <Icon {...props}>\n <circle cx={10} cy={10} r={7} />\n <path d=\"M7 10h6\" />\n </Icon>\n );\n}\n"],"names":[],"mappings":";;;AAIO,SAAS,gBAAgB,KAA8B,EAAA;AAC5D,EAAA,uBACG,IAAA,CAAA,IAAA,EAAA;AAAA,IAAM,GAAG,KAAA;AAAA,IACR,QAAA,EAAA;AAAA,sBAAC,GAAA,CAAA,QAAA,EAAA;AAAA,QAAO,EAAI,EAAA,EAAA;AAAA,QAAI,EAAI,EAAA,EAAA;AAAA,QAAI,CAAG,EAAA,CAAA;AAAA,OAAG,CAAA;AAAA,sBAC7B,GAAA,CAAA,MAAA,EAAA;AAAA,QAAK,CAAE,EAAA,SAAA;AAAA,OAAU,CAAA;AAAA,KAAA;AAAA,GACpB,CAAA,CAAA;AAEJ;;;;"}
|
package/dist/icons/index.cjs
CHANGED
|
@@ -20,6 +20,7 @@ var Code = require('./Code.cjs');
|
|
|
20
20
|
var Comment = require('./Comment.cjs');
|
|
21
21
|
var Copy = require('./Copy.cjs');
|
|
22
22
|
var Cross = require('./Cross.cjs');
|
|
23
|
+
var CrossCircleFill = require('./CrossCircleFill.cjs');
|
|
23
24
|
var Delete = require('./Delete.cjs');
|
|
24
25
|
var Edit = require('./Edit.cjs');
|
|
25
26
|
var Ellipsis = require('./Ellipsis.cjs');
|
|
@@ -33,6 +34,7 @@ var Lengthen = require('./Lengthen.cjs');
|
|
|
33
34
|
var ListOrdered = require('./ListOrdered.cjs');
|
|
34
35
|
var ListUnordered = require('./ListUnordered.cjs');
|
|
35
36
|
var Mention = require('./Mention.cjs');
|
|
37
|
+
var MinusCircle = require('./MinusCircle.cjs');
|
|
36
38
|
var QuestionMark = require('./QuestionMark.cjs');
|
|
37
39
|
var Redo = require('./Redo.cjs');
|
|
38
40
|
var Restore = require('./Restore.cjs');
|
|
@@ -73,6 +75,7 @@ exports.CodeIcon = Code.CodeIcon;
|
|
|
73
75
|
exports.CommentIcon = Comment.CommentIcon;
|
|
74
76
|
exports.CopyIcon = Copy.CopyIcon;
|
|
75
77
|
exports.CrossIcon = Cross.CrossIcon;
|
|
78
|
+
exports.CrossCircleFillIcon = CrossCircleFill.CrossCircleFillIcon;
|
|
76
79
|
exports.DeleteIcon = Delete.DeleteIcon;
|
|
77
80
|
exports.EditIcon = Edit.EditIcon;
|
|
78
81
|
exports.EllipsisIcon = Ellipsis.EllipsisIcon;
|
|
@@ -86,6 +89,7 @@ exports.LengthenIcon = Lengthen.LengthenIcon;
|
|
|
86
89
|
exports.ListOrderedIcon = ListOrdered.ListOrderedIcon;
|
|
87
90
|
exports.ListUnorderedIcon = ListUnordered.ListUnorderedIcon;
|
|
88
91
|
exports.MentionIcon = Mention.MentionIcon;
|
|
92
|
+
exports.MinusCircleIcon = MinusCircle.MinusCircleIcon;
|
|
89
93
|
exports.QuestionMarkIcon = QuestionMark.QuestionMarkIcon;
|
|
90
94
|
exports.RedoIcon = Redo.RedoIcon;
|
|
91
95
|
exports.RestoreIcon = Restore.RestoreIcon;
|
package/dist/icons/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/icons/index.js
CHANGED
|
@@ -18,6 +18,7 @@ export { CodeIcon } from './Code.js';
|
|
|
18
18
|
export { CommentIcon } from './Comment.js';
|
|
19
19
|
export { CopyIcon } from './Copy.js';
|
|
20
20
|
export { CrossIcon } from './Cross.js';
|
|
21
|
+
export { CrossCircleFillIcon } from './CrossCircleFill.js';
|
|
21
22
|
export { DeleteIcon } from './Delete.js';
|
|
22
23
|
export { EditIcon } from './Edit.js';
|
|
23
24
|
export { EllipsisIcon } from './Ellipsis.js';
|
|
@@ -31,6 +32,7 @@ export { LengthenIcon } from './Lengthen.js';
|
|
|
31
32
|
export { ListOrderedIcon } from './ListOrdered.js';
|
|
32
33
|
export { ListUnorderedIcon } from './ListUnordered.js';
|
|
33
34
|
export { MentionIcon } from './Mention.js';
|
|
35
|
+
export { MinusCircleIcon } from './MinusCircle.js';
|
|
34
36
|
export { QuestionMarkIcon } from './QuestionMark.js';
|
|
35
37
|
export { RedoIcon } from './Redo.js';
|
|
36
38
|
export { RestoreIcon } from './Restore.js';
|
package/dist/icons/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|