@liveblocks/react-ui 2.17.0-usrnotsettings3 → 2.18.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/dist/_private/index.d.mts +7 -1
- package/dist/_private/index.d.ts +7 -1
- package/dist/_private/index.js +6 -0
- package/dist/_private/index.js.map +1 -1
- package/dist/_private/index.mjs +3 -0
- package/dist/_private/index.mjs.map +1 -1
- package/dist/components/internal/InboxNotificationThread.js.map +1 -1
- package/dist/components/internal/InboxNotificationThread.mjs.map +1 -1
- package/dist/icon.js +6 -0
- package/dist/icon.js.map +1 -1
- package/dist/icon.mjs +3 -0
- package/dist/icon.mjs.map +1 -1
- package/dist/icons/ArrowCornerDownRight.js +16 -0
- package/dist/icons/ArrowCornerDownRight.js.map +1 -0
- package/dist/icons/ArrowCornerDownRight.mjs +14 -0
- package/dist/icons/ArrowCornerDownRight.mjs.map +1 -0
- package/dist/icons/ArrowCornerUpRight.js +16 -0
- package/dist/icons/ArrowCornerUpRight.js.map +1 -0
- package/dist/icons/ArrowCornerUpRight.mjs +14 -0
- package/dist/icons/ArrowCornerUpRight.mjs.map +1 -0
- package/dist/icons/SparklesText.js +21 -0
- package/dist/icons/SparklesText.js.map +1 -0
- package/dist/icons/SparklesText.mjs +19 -0
- package/dist/icons/SparklesText.mjs.map +1 -0
- package/dist/icons/index.js +6 -0
- package/dist/icons/index.js.map +1 -1
- package/dist/icons/index.mjs +3 -0
- package/dist/icons/index.mjs.map +1 -1
- package/dist/index.d.mts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/primitives/Composer/index.js +13 -7
- package/dist/primitives/Composer/index.js.map +1 -1
- package/dist/primitives/Composer/index.mjs +13 -7
- package/dist/primitives/Composer/index.mjs.map +1 -1
- package/dist/utils/use-refs.js +1 -1
- package/dist/utils/use-refs.js.map +1 -1
- package/dist/utils/use-refs.mjs +1 -1
- package/dist/utils/use-refs.mjs.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/package.json +4 -4
- package/src/styles/index.css +42 -0
- package/styles.css +1 -1
- package/styles.css.map +1 -1
|
@@ -51,6 +51,10 @@ interface UserProps extends ComponentProps<"span"> {
|
|
|
51
51
|
}
|
|
52
52
|
declare function User({ userId, replaceSelf, className, ...props }: UserProps): react_jsx_runtime.JSX.Element;
|
|
53
53
|
|
|
54
|
+
declare function ArrowCornerDownRightIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
55
|
+
|
|
56
|
+
declare function ArrowCornerUpRightIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
57
|
+
|
|
54
58
|
declare function ArrowDownIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
55
59
|
|
|
56
60
|
declare function ArrowUpIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
@@ -121,6 +125,8 @@ declare function ShortenIcon(props: ComponentProps<"svg">): react_jsx_runtime.JS
|
|
|
121
125
|
|
|
122
126
|
declare function SparklesIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
123
127
|
|
|
128
|
+
declare function SparklesTextIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
129
|
+
|
|
124
130
|
declare function SpinnerIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
125
131
|
|
|
126
132
|
declare function StrikethroughIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
@@ -147,4 +153,4 @@ declare function useInitial<T>(value: T | (() => T)): T;
|
|
|
147
153
|
|
|
148
154
|
declare function useRefs<T>(...refs: Ref<T>[]): RefCallback<T>;
|
|
149
155
|
|
|
150
|
-
export { ArrowDownIcon, ArrowUpIcon, AttachmentIcon, BlockquoteIcon, BoldIcon, Button, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CodeIcon, CommentIcon, CrossIcon, DeleteIcon, EditIcon, EllipsisIcon, EmojiAddIcon, EmojiIcon, H1Icon, H2Icon, H3Icon, ItalicIcon, LengthenIcon, List, ListOrderedIcon, ListUnorderedIcon, MentionIcon, QuestionMarkIcon, RedoIcon, ResolveIcon, ResolvedIcon, RestoreIcon, SearchIcon, SelectButton, SendIcon, ShortcutTooltip, ShortenIcon, SparklesIcon, SpinnerIcon, StrikethroughIcon, TextIcon, Tooltip, TranslateIcon, UnderlineIcon, UndoIcon, User, WarningIcon, capitalize, useInitial, useRefs };
|
|
156
|
+
export { ArrowCornerDownRightIcon, ArrowCornerUpRightIcon, ArrowDownIcon, ArrowUpIcon, AttachmentIcon, BlockquoteIcon, BoldIcon, Button, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CodeIcon, CommentIcon, CrossIcon, DeleteIcon, EditIcon, EllipsisIcon, EmojiAddIcon, EmojiIcon, H1Icon, H2Icon, H3Icon, ItalicIcon, LengthenIcon, List, ListOrderedIcon, ListUnorderedIcon, MentionIcon, QuestionMarkIcon, RedoIcon, ResolveIcon, ResolvedIcon, RestoreIcon, SearchIcon, SelectButton, SendIcon, ShortcutTooltip, ShortenIcon, SparklesIcon, SparklesTextIcon, SpinnerIcon, StrikethroughIcon, TextIcon, Tooltip, TranslateIcon, UnderlineIcon, UndoIcon, User, WarningIcon, capitalize, useInitial, useRefs };
|
package/dist/_private/index.d.ts
CHANGED
|
@@ -51,6 +51,10 @@ interface UserProps extends ComponentProps<"span"> {
|
|
|
51
51
|
}
|
|
52
52
|
declare function User({ userId, replaceSelf, className, ...props }: UserProps): react_jsx_runtime.JSX.Element;
|
|
53
53
|
|
|
54
|
+
declare function ArrowCornerDownRightIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
55
|
+
|
|
56
|
+
declare function ArrowCornerUpRightIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
57
|
+
|
|
54
58
|
declare function ArrowDownIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
55
59
|
|
|
56
60
|
declare function ArrowUpIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
@@ -121,6 +125,8 @@ declare function ShortenIcon(props: ComponentProps<"svg">): react_jsx_runtime.JS
|
|
|
121
125
|
|
|
122
126
|
declare function SparklesIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
123
127
|
|
|
128
|
+
declare function SparklesTextIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
129
|
+
|
|
124
130
|
declare function SpinnerIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
125
131
|
|
|
126
132
|
declare function StrikethroughIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
@@ -147,4 +153,4 @@ declare function useInitial<T>(value: T | (() => T)): T;
|
|
|
147
153
|
|
|
148
154
|
declare function useRefs<T>(...refs: Ref<T>[]): RefCallback<T>;
|
|
149
155
|
|
|
150
|
-
export { ArrowDownIcon, ArrowUpIcon, AttachmentIcon, BlockquoteIcon, BoldIcon, Button, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CodeIcon, CommentIcon, CrossIcon, DeleteIcon, EditIcon, EllipsisIcon, EmojiAddIcon, EmojiIcon, H1Icon, H2Icon, H3Icon, ItalicIcon, LengthenIcon, List, ListOrderedIcon, ListUnorderedIcon, MentionIcon, QuestionMarkIcon, RedoIcon, ResolveIcon, ResolvedIcon, RestoreIcon, SearchIcon, SelectButton, SendIcon, ShortcutTooltip, ShortenIcon, SparklesIcon, SpinnerIcon, StrikethroughIcon, TextIcon, Tooltip, TranslateIcon, UnderlineIcon, UndoIcon, User, WarningIcon, capitalize, useInitial, useRefs };
|
|
156
|
+
export { ArrowCornerDownRightIcon, ArrowCornerUpRightIcon, ArrowDownIcon, ArrowUpIcon, AttachmentIcon, BlockquoteIcon, BoldIcon, Button, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CodeIcon, CommentIcon, CrossIcon, DeleteIcon, EditIcon, EllipsisIcon, EmojiAddIcon, EmojiIcon, H1Icon, H2Icon, H3Icon, ItalicIcon, LengthenIcon, List, ListOrderedIcon, ListUnorderedIcon, MentionIcon, QuestionMarkIcon, RedoIcon, ResolveIcon, ResolvedIcon, RestoreIcon, SearchIcon, SelectButton, SendIcon, ShortcutTooltip, ShortenIcon, SparklesIcon, SparklesTextIcon, SpinnerIcon, StrikethroughIcon, TextIcon, Tooltip, TranslateIcon, UnderlineIcon, UndoIcon, User, WarningIcon, capitalize, useInitial, useRefs };
|
package/dist/_private/index.js
CHANGED
|
@@ -9,6 +9,8 @@ var capitalize = require('../utils/capitalize.js');
|
|
|
9
9
|
var useInitial = require('../utils/use-initial.js');
|
|
10
10
|
var useRefs = require('../utils/use-refs.js');
|
|
11
11
|
var TooltipPrimitive = require('@radix-ui/react-tooltip');
|
|
12
|
+
var ArrowCornerDownRight = require('../icons/ArrowCornerDownRight.js');
|
|
13
|
+
var ArrowCornerUpRight = require('../icons/ArrowCornerUpRight.js');
|
|
12
14
|
var ArrowDown = require('../icons/ArrowDown.js');
|
|
13
15
|
var ArrowUp = require('../icons/ArrowUp.js');
|
|
14
16
|
var Attachment = require('../icons/Attachment.js');
|
|
@@ -44,6 +46,7 @@ var Search = require('../icons/Search.js');
|
|
|
44
46
|
var Send = require('../icons/Send.js');
|
|
45
47
|
var Shorten = require('../icons/Shorten.js');
|
|
46
48
|
var Sparkles = require('../icons/Sparkles.js');
|
|
49
|
+
var SparklesText = require('../icons/SparklesText.js');
|
|
47
50
|
var Spinner = require('../icons/Spinner.js');
|
|
48
51
|
var Strikethrough = require('../icons/Strikethrough.js');
|
|
49
52
|
var Text = require('../icons/Text.js');
|
|
@@ -67,6 +70,8 @@ Object.defineProperty(exports, 'TooltipProvider', {
|
|
|
67
70
|
enumerable: true,
|
|
68
71
|
get: function () { return TooltipPrimitive.TooltipProvider; }
|
|
69
72
|
});
|
|
73
|
+
exports.ArrowCornerDownRightIcon = ArrowCornerDownRight.ArrowCornerDownRightIcon;
|
|
74
|
+
exports.ArrowCornerUpRightIcon = ArrowCornerUpRight.ArrowCornerUpRightIcon;
|
|
70
75
|
exports.ArrowDownIcon = ArrowDown.ArrowDownIcon;
|
|
71
76
|
exports.ArrowUpIcon = ArrowUp.ArrowUpIcon;
|
|
72
77
|
exports.AttachmentIcon = Attachment.AttachmentIcon;
|
|
@@ -102,6 +107,7 @@ exports.SearchIcon = Search.SearchIcon;
|
|
|
102
107
|
exports.SendIcon = Send.SendIcon;
|
|
103
108
|
exports.ShortenIcon = Shorten.ShortenIcon;
|
|
104
109
|
exports.SparklesIcon = Sparkles.SparklesIcon;
|
|
110
|
+
exports.SparklesTextIcon = SparklesText.SparklesTextIcon;
|
|
105
111
|
exports.SpinnerIcon = Spinner.SpinnerIcon;
|
|
106
112
|
exports.StrikethroughIcon = Strikethrough.StrikethroughIcon;
|
|
107
113
|
exports.TextIcon = Text.TextIcon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/_private/index.mjs
CHANGED
|
@@ -7,6 +7,8 @@ export { capitalize } from '../utils/capitalize.mjs';
|
|
|
7
7
|
export { useInitial } from '../utils/use-initial.mjs';
|
|
8
8
|
export { useRefs } from '../utils/use-refs.mjs';
|
|
9
9
|
export { TooltipProvider } from '@radix-ui/react-tooltip';
|
|
10
|
+
export { ArrowCornerDownRightIcon } from '../icons/ArrowCornerDownRight.mjs';
|
|
11
|
+
export { ArrowCornerUpRightIcon } from '../icons/ArrowCornerUpRight.mjs';
|
|
10
12
|
export { ArrowDownIcon } from '../icons/ArrowDown.mjs';
|
|
11
13
|
export { ArrowUpIcon } from '../icons/ArrowUp.mjs';
|
|
12
14
|
export { AttachmentIcon } from '../icons/Attachment.mjs';
|
|
@@ -42,6 +44,7 @@ export { SearchIcon } from '../icons/Search.mjs';
|
|
|
42
44
|
export { SendIcon } from '../icons/Send.mjs';
|
|
43
45
|
export { ShortenIcon } from '../icons/Shorten.mjs';
|
|
44
46
|
export { SparklesIcon } from '../icons/Sparkles.mjs';
|
|
47
|
+
export { SparklesTextIcon } from '../icons/SparklesText.mjs';
|
|
45
48
|
export { SpinnerIcon } from '../icons/Spinner.mjs';
|
|
46
49
|
export { StrikethroughIcon } from '../icons/Strikethrough.mjs';
|
|
47
50
|
export { TextIcon } from '../icons/Text.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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 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":";;;;;;;;;;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,EAAA;AAAA,UACE,QAAA,EAAA;AAAA,4BAAAF,cAAA,CAACG,UAAA,EAAA;AAAA,cACC,SAAU,EAAA,iBAAA;AAAA,cACV,MAAM,OAAQ,CAAA,IAAA;AAAA,cACd,UAAY,EAAA;AAAA,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["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 // Those behaviors are also used in `@liveblocks/emails` to extract email data\n // for a thread notification event.\n // See → https://github.com/liveblocks/liveblocks/blob/a2e621ce5e0db2b810413e8711c227a759141820/packages/liveblocks-emails/src/thread-notification.tsx#L34\n //\n // Make sure to reflect any changes you may want to do here in `@liveblocks/emails` as well\n // if the changes are applicable and relevant.\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":";;;;;;;;;;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,I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AA;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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InboxNotificationThread.mjs","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":["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,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AAA;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.mjs","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 // Those behaviors are also used in `@liveblocks/emails` to extract email data\n // for a thread notification event.\n // See → https://github.com/liveblocks/liveblocks/blob/a2e621ce5e0db2b810413e8711c227a759141820/packages/liveblocks-emails/src/thread-notification.tsx#L34\n //\n // Make sure to reflect any changes you may want to do here in `@liveblocks/emails` as well\n // if the changes are applicable and relevant.\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,iBAAA;AAAA,cACV,MAAM,OAAQ,CAAA,IAAA;AAAA,cACd,UAAY,EAAA;AAAA,gBAC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4
|
+
var ArrowCornerDownRight = require('./icons/ArrowCornerDownRight.js');
|
|
5
|
+
var ArrowCornerUpRight = require('./icons/ArrowCornerUpRight.js');
|
|
4
6
|
var Attachment = require('./icons/Attachment.js');
|
|
5
7
|
var Blockquote = require('./icons/Blockquote.js');
|
|
6
8
|
var Bold = require('./icons/Bold.js');
|
|
@@ -23,6 +25,7 @@ var Redo = require('./icons/Redo.js');
|
|
|
23
25
|
var Send = require('./icons/Send.js');
|
|
24
26
|
var Shorten = require('./icons/Shorten.js');
|
|
25
27
|
var Sparkles = require('./icons/Sparkles.js');
|
|
28
|
+
var SparklesText = require('./icons/SparklesText.js');
|
|
26
29
|
var Strikethrough = require('./icons/Strikethrough.js');
|
|
27
30
|
var Text = require('./icons/Text.js');
|
|
28
31
|
var Translate = require('./icons/Translate.js');
|
|
@@ -32,6 +35,8 @@ var Warning = require('./icons/Warning.js');
|
|
|
32
35
|
|
|
33
36
|
|
|
34
37
|
|
|
38
|
+
exports.ArrowCornerDownRight = ArrowCornerDownRight.ArrowCornerDownRightIcon;
|
|
39
|
+
exports.ArrowCornerUpRight = ArrowCornerUpRight.ArrowCornerUpRightIcon;
|
|
35
40
|
exports.Attachment = Attachment.AttachmentIcon;
|
|
36
41
|
exports.Blockquote = Blockquote.BlockquoteIcon;
|
|
37
42
|
exports.Bold = Bold.BoldIcon;
|
|
@@ -54,6 +59,7 @@ exports.Redo = Redo.RedoIcon;
|
|
|
54
59
|
exports.Send = Send.SendIcon;
|
|
55
60
|
exports.Shorten = Shorten.ShortenIcon;
|
|
56
61
|
exports.Sparkles = Sparkles.SparklesIcon;
|
|
62
|
+
exports.SparklesText = SparklesText.SparklesTextIcon;
|
|
57
63
|
exports.Strikethrough = Strikethrough.StrikethroughIcon;
|
|
58
64
|
exports.Text = Text.TextIcon;
|
|
59
65
|
exports.Translate = Translate.TranslateIcon;
|
package/dist/icon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"icon.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/icon.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import './icons/index.mjs';
|
|
2
|
+
export { ArrowCornerDownRightIcon as ArrowCornerDownRight } from './icons/ArrowCornerDownRight.mjs';
|
|
3
|
+
export { ArrowCornerUpRightIcon as ArrowCornerUpRight } from './icons/ArrowCornerUpRight.mjs';
|
|
2
4
|
export { AttachmentIcon as Attachment } from './icons/Attachment.mjs';
|
|
3
5
|
export { BlockquoteIcon as Blockquote } from './icons/Blockquote.mjs';
|
|
4
6
|
export { BoldIcon as Bold } from './icons/Bold.mjs';
|
|
@@ -21,6 +23,7 @@ export { RedoIcon as Redo } from './icons/Redo.mjs';
|
|
|
21
23
|
export { SendIcon as Send } from './icons/Send.mjs';
|
|
22
24
|
export { ShortenIcon as Shorten } from './icons/Shorten.mjs';
|
|
23
25
|
export { SparklesIcon as Sparkles } from './icons/Sparkles.mjs';
|
|
26
|
+
export { SparklesTextIcon as SparklesText } from './icons/SparklesText.mjs';
|
|
24
27
|
export { StrikethroughIcon as Strikethrough } from './icons/Strikethrough.mjs';
|
|
25
28
|
export { TextIcon as Text } from './icons/Text.mjs';
|
|
26
29
|
export { TranslateIcon as Translate } from './icons/Translate.mjs';
|
package/dist/icon.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"icon.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var Icon = require('../components/internal/Icon.js');
|
|
5
|
+
|
|
6
|
+
function ArrowCornerDownRightIcon(props) {
|
|
7
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, {
|
|
8
|
+
...props,
|
|
9
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", {
|
|
10
|
+
d: "M16 12.5H7.5a3 3 0 0 1-3-3V4M16 12.5 12.5 16m3.5-3.5L12.5 9"
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
exports.ArrowCornerDownRightIcon = ArrowCornerDownRightIcon;
|
|
16
|
+
//# sourceMappingURL=ArrowCornerDownRight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArrowCornerDownRight.js","sources":["../../src/icons/ArrowCornerDownRight.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\n\nimport { Icon } from \"../components/internal/Icon\";\n\nexport function ArrowCornerDownRightIcon(props: ComponentProps<\"svg\">) {\n return (\n <Icon {...props}>\n <path d=\"M16 12.5H7.5a3 3 0 0 1-3-3V4M16 12.5 12.5 16m3.5-3.5L12.5 9\" />\n </Icon>\n );\n}\n"],"names":["jsx","Icon"],"mappings":";;;;;AAIO,SAAS,yBAAyB,KAA8B,EAAA;AACrE,EAAA,uBACGA,cAAA,CAAAC,SAAA,EAAA;AAAA,IAAM,GAAG,KAAA;AAAA,IACR,QAAC,kBAAAD,cAAA,CAAA,MAAA,EAAA;AAAA,MAAK,CAAE,EAAA,6DAAA;AAAA,KAA8D,CAAA;AAAA,GACxE,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Icon } from '../components/internal/Icon.mjs';
|
|
3
|
+
|
|
4
|
+
function ArrowCornerDownRightIcon(props) {
|
|
5
|
+
return /* @__PURE__ */ jsx(Icon, {
|
|
6
|
+
...props,
|
|
7
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
8
|
+
d: "M16 12.5H7.5a3 3 0 0 1-3-3V4M16 12.5 12.5 16m3.5-3.5L12.5 9"
|
|
9
|
+
})
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { ArrowCornerDownRightIcon };
|
|
14
|
+
//# sourceMappingURL=ArrowCornerDownRight.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArrowCornerDownRight.mjs","sources":["../../src/icons/ArrowCornerDownRight.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\n\nimport { Icon } from \"../components/internal/Icon\";\n\nexport function ArrowCornerDownRightIcon(props: ComponentProps<\"svg\">) {\n return (\n <Icon {...props}>\n <path d=\"M16 12.5H7.5a3 3 0 0 1-3-3V4M16 12.5 12.5 16m3.5-3.5L12.5 9\" />\n </Icon>\n );\n}\n"],"names":[],"mappings":";;;AAIO,SAAS,yBAAyB,KAA8B,EAAA;AACrE,EAAA,uBACG,GAAA,CAAA,IAAA,EAAA;AAAA,IAAM,GAAG,KAAA;AAAA,IACR,QAAC,kBAAA,GAAA,CAAA,MAAA,EAAA;AAAA,MAAK,CAAE,EAAA,6DAAA;AAAA,KAA8D,CAAA;AAAA,GACxE,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var Icon = require('../components/internal/Icon.js');
|
|
5
|
+
|
|
6
|
+
function ArrowCornerUpRightIcon(props) {
|
|
7
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, {
|
|
8
|
+
...props,
|
|
9
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", {
|
|
10
|
+
d: "M16 7.5H7.5a3 3 0 0 0-3 3V16M16 7.5 12.5 4M16 7.5 12.5 11"
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
exports.ArrowCornerUpRightIcon = ArrowCornerUpRightIcon;
|
|
16
|
+
//# sourceMappingURL=ArrowCornerUpRight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArrowCornerUpRight.js","sources":["../../src/icons/ArrowCornerUpRight.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\n\nimport { Icon } from \"../components/internal/Icon\";\n\nexport function ArrowCornerUpRightIcon(props: ComponentProps<\"svg\">) {\n return (\n <Icon {...props}>\n <path d=\"M16 7.5H7.5a3 3 0 0 0-3 3V16M16 7.5 12.5 4M16 7.5 12.5 11\" />\n </Icon>\n );\n}\n"],"names":["jsx","Icon"],"mappings":";;;;;AAIO,SAAS,uBAAuB,KAA8B,EAAA;AACnE,EAAA,uBACGA,cAAA,CAAAC,SAAA,EAAA;AAAA,IAAM,GAAG,KAAA;AAAA,IACR,QAAC,kBAAAD,cAAA,CAAA,MAAA,EAAA;AAAA,MAAK,CAAE,EAAA,2DAAA;AAAA,KAA4D,CAAA;AAAA,GACtE,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Icon } from '../components/internal/Icon.mjs';
|
|
3
|
+
|
|
4
|
+
function ArrowCornerUpRightIcon(props) {
|
|
5
|
+
return /* @__PURE__ */ jsx(Icon, {
|
|
6
|
+
...props,
|
|
7
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
8
|
+
d: "M16 7.5H7.5a3 3 0 0 0-3 3V16M16 7.5 12.5 4M16 7.5 12.5 11"
|
|
9
|
+
})
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { ArrowCornerUpRightIcon };
|
|
14
|
+
//# sourceMappingURL=ArrowCornerUpRight.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArrowCornerUpRight.mjs","sources":["../../src/icons/ArrowCornerUpRight.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\n\nimport { Icon } from \"../components/internal/Icon\";\n\nexport function ArrowCornerUpRightIcon(props: ComponentProps<\"svg\">) {\n return (\n <Icon {...props}>\n <path d=\"M16 7.5H7.5a3 3 0 0 0-3 3V16M16 7.5 12.5 4M16 7.5 12.5 11\" />\n </Icon>\n );\n}\n"],"names":[],"mappings":";;;AAIO,SAAS,uBAAuB,KAA8B,EAAA;AACnE,EAAA,uBACG,GAAA,CAAA,IAAA,EAAA;AAAA,IAAM,GAAG,KAAA;AAAA,IACR,QAAC,kBAAA,GAAA,CAAA,MAAA,EAAA;AAAA,MAAK,CAAE,EAAA,2DAAA;AAAA,KAA4D,CAAA;AAAA,GACtE,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var Icon = require('../components/internal/Icon.js');
|
|
5
|
+
|
|
6
|
+
function SparklesTextIcon(props) {
|
|
7
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Icon.Icon, {
|
|
8
|
+
...props,
|
|
9
|
+
children: [
|
|
10
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", {
|
|
11
|
+
d: "M9 11.5H4.5m3.5 3H4.5m11-6h-11m11-3h-11"
|
|
12
|
+
}),
|
|
13
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", {
|
|
14
|
+
d: "M16 13.5a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1-2.5 2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1 2.5-2.5Z"
|
|
15
|
+
})
|
|
16
|
+
]
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
exports.SparklesTextIcon = SparklesTextIcon;
|
|
21
|
+
//# sourceMappingURL=SparklesText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SparklesText.js","sources":["../../src/icons/SparklesText.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\n\nimport { Icon } from \"../components/internal/Icon\";\n\nexport function SparklesTextIcon(props: ComponentProps<\"svg\">) {\n return (\n <Icon {...props}>\n <path d=\"M9 11.5H4.5m3.5 3H4.5m11-6h-11m11-3h-11\" />\n <path d=\"M16 13.5a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1-2.5 2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1 2.5-2.5Z\" />\n </Icon>\n );\n}\n"],"names":["jsxs","Icon","jsx"],"mappings":";;;;;AAIO,SAAS,iBAAiB,KAA8B,EAAA;AAC7D,EAAA,uBACGA,eAAA,CAAAC,SAAA,EAAA;AAAA,IAAM,GAAG,KAAA;AAAA,IACR,QAAA,EAAA;AAAA,sBAACC,cAAA,CAAA,MAAA,EAAA;AAAA,QAAK,CAAE,EAAA,yCAAA;AAAA,OAA0C,CAAA;AAAA,sBACjDA,cAAA,CAAA,MAAA,EAAA;AAAA,QAAK,CAAE,EAAA,mGAAA;AAAA,OAAoG,CAAA;AAAA,KAAA;AAAA,GAC9G,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Icon } from '../components/internal/Icon.mjs';
|
|
3
|
+
|
|
4
|
+
function SparklesTextIcon(props) {
|
|
5
|
+
return /* @__PURE__ */ jsxs(Icon, {
|
|
6
|
+
...props,
|
|
7
|
+
children: [
|
|
8
|
+
/* @__PURE__ */ jsx("path", {
|
|
9
|
+
d: "M9 11.5H4.5m3.5 3H4.5m11-6h-11m11-3h-11"
|
|
10
|
+
}),
|
|
11
|
+
/* @__PURE__ */ jsx("path", {
|
|
12
|
+
d: "M16 13.5a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1-2.5 2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1 2.5-2.5Z"
|
|
13
|
+
})
|
|
14
|
+
]
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { SparklesTextIcon };
|
|
19
|
+
//# sourceMappingURL=SparklesText.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SparklesText.mjs","sources":["../../src/icons/SparklesText.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\n\nimport { Icon } from \"../components/internal/Icon\";\n\nexport function SparklesTextIcon(props: ComponentProps<\"svg\">) {\n return (\n <Icon {...props}>\n <path d=\"M9 11.5H4.5m3.5 3H4.5m11-6h-11m11-3h-11\" />\n <path d=\"M16 13.5a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1-2.5 2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1 2.5-2.5Z\" />\n </Icon>\n );\n}\n"],"names":[],"mappings":";;;AAIO,SAAS,iBAAiB,KAA8B,EAAA;AAC7D,EAAA,uBACG,IAAA,CAAA,IAAA,EAAA;AAAA,IAAM,GAAG,KAAA;AAAA,IACR,QAAA,EAAA;AAAA,sBAAC,GAAA,CAAA,MAAA,EAAA;AAAA,QAAK,CAAE,EAAA,yCAAA;AAAA,OAA0C,CAAA;AAAA,sBACjD,GAAA,CAAA,MAAA,EAAA;AAAA,QAAK,CAAE,EAAA,mGAAA;AAAA,OAAoG,CAAA;AAAA,KAAA;AAAA,GAC9G,CAAA,CAAA;AAEJ;;;;"}
|
package/dist/icons/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var ArrowCornerDownRight = require('./ArrowCornerDownRight.js');
|
|
4
|
+
var ArrowCornerUpRight = require('./ArrowCornerUpRight.js');
|
|
3
5
|
var ArrowDown = require('./ArrowDown.js');
|
|
4
6
|
var ArrowUp = require('./ArrowUp.js');
|
|
5
7
|
var Attachment = require('./Attachment.js');
|
|
@@ -35,6 +37,7 @@ var Search = require('./Search.js');
|
|
|
35
37
|
var Send = require('./Send.js');
|
|
36
38
|
var Shorten = require('./Shorten.js');
|
|
37
39
|
var Sparkles = require('./Sparkles.js');
|
|
40
|
+
var SparklesText = require('./SparklesText.js');
|
|
38
41
|
var Spinner = require('./Spinner.js');
|
|
39
42
|
var Strikethrough = require('./Strikethrough.js');
|
|
40
43
|
var Text = require('./Text.js');
|
|
@@ -45,6 +48,8 @@ var Warning = require('./Warning.js');
|
|
|
45
48
|
|
|
46
49
|
|
|
47
50
|
|
|
51
|
+
exports.ArrowCornerDownRightIcon = ArrowCornerDownRight.ArrowCornerDownRightIcon;
|
|
52
|
+
exports.ArrowCornerUpRightIcon = ArrowCornerUpRight.ArrowCornerUpRightIcon;
|
|
48
53
|
exports.ArrowDownIcon = ArrowDown.ArrowDownIcon;
|
|
49
54
|
exports.ArrowUpIcon = ArrowUp.ArrowUpIcon;
|
|
50
55
|
exports.AttachmentIcon = Attachment.AttachmentIcon;
|
|
@@ -80,6 +85,7 @@ exports.SearchIcon = Search.SearchIcon;
|
|
|
80
85
|
exports.SendIcon = Send.SendIcon;
|
|
81
86
|
exports.ShortenIcon = Shorten.ShortenIcon;
|
|
82
87
|
exports.SparklesIcon = Sparkles.SparklesIcon;
|
|
88
|
+
exports.SparklesTextIcon = SparklesText.SparklesTextIcon;
|
|
83
89
|
exports.SpinnerIcon = Spinner.SpinnerIcon;
|
|
84
90
|
exports.StrikethroughIcon = Strikethrough.StrikethroughIcon;
|
|
85
91
|
exports.TextIcon = Text.TextIcon;
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/icons/index.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { ArrowCornerDownRightIcon } from './ArrowCornerDownRight.mjs';
|
|
2
|
+
export { ArrowCornerUpRightIcon } from './ArrowCornerUpRight.mjs';
|
|
1
3
|
export { ArrowDownIcon } from './ArrowDown.mjs';
|
|
2
4
|
export { ArrowUpIcon } from './ArrowUp.mjs';
|
|
3
5
|
export { AttachmentIcon } from './Attachment.mjs';
|
|
@@ -33,6 +35,7 @@ export { SearchIcon } from './Search.mjs';
|
|
|
33
35
|
export { SendIcon } from './Send.mjs';
|
|
34
36
|
export { ShortenIcon } from './Shorten.mjs';
|
|
35
37
|
export { SparklesIcon } from './Sparkles.mjs';
|
|
38
|
+
export { SparklesTextIcon } from './SparklesText.mjs';
|
|
36
39
|
export { SpinnerIcon } from './Spinner.mjs';
|
|
37
40
|
export { StrikethroughIcon } from './Strikethrough.mjs';
|
|
38
41
|
export { TextIcon } from './Text.mjs';
|
package/dist/icons/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.mts
CHANGED
|
@@ -664,6 +664,10 @@ type LiveblocksUIConfigProps = PropsWithChildren<{
|
|
|
664
664
|
*/
|
|
665
665
|
declare function LiveblocksUIConfig({ overrides, components, portalContainer, preventUnsavedComposerChanges, children, }: LiveblocksUIConfigProps): react_jsx_runtime.JSX.Element;
|
|
666
666
|
|
|
667
|
+
declare function ArrowCornerDownRightIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
668
|
+
|
|
669
|
+
declare function ArrowCornerUpRightIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
670
|
+
|
|
667
671
|
declare function AttachmentIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
668
672
|
|
|
669
673
|
declare function BlockquoteIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
@@ -708,6 +712,8 @@ declare function ShortenIcon(props: ComponentProps<"svg">): react_jsx_runtime.JS
|
|
|
708
712
|
|
|
709
713
|
declare function SparklesIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
710
714
|
|
|
715
|
+
declare function SparklesTextIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
716
|
+
|
|
711
717
|
declare function StrikethroughIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
712
718
|
|
|
713
719
|
declare function TextIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
@@ -722,6 +728,8 @@ declare function WarningIcon(props: ComponentProps<"svg">): react_jsx_runtime.JS
|
|
|
722
728
|
|
|
723
729
|
declare namespace icon {
|
|
724
730
|
export {
|
|
731
|
+
ArrowCornerDownRightIcon as ArrowCornerDownRight,
|
|
732
|
+
ArrowCornerUpRightIcon as ArrowCornerUpRight,
|
|
725
733
|
AttachmentIcon as Attachment,
|
|
726
734
|
BlockquoteIcon as Blockquote,
|
|
727
735
|
BoldIcon as Bold,
|
|
@@ -744,6 +752,7 @@ declare namespace icon {
|
|
|
744
752
|
SendIcon as Send,
|
|
745
753
|
ShortenIcon as Shorten,
|
|
746
754
|
SparklesIcon as Sparkles,
|
|
755
|
+
SparklesTextIcon as SparklesText,
|
|
747
756
|
StrikethroughIcon as Strikethrough,
|
|
748
757
|
TextIcon as Text,
|
|
749
758
|
TranslateIcon as Translate,
|
package/dist/index.d.ts
CHANGED
|
@@ -664,6 +664,10 @@ type LiveblocksUIConfigProps = PropsWithChildren<{
|
|
|
664
664
|
*/
|
|
665
665
|
declare function LiveblocksUIConfig({ overrides, components, portalContainer, preventUnsavedComposerChanges, children, }: LiveblocksUIConfigProps): react_jsx_runtime.JSX.Element;
|
|
666
666
|
|
|
667
|
+
declare function ArrowCornerDownRightIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
668
|
+
|
|
669
|
+
declare function ArrowCornerUpRightIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
670
|
+
|
|
667
671
|
declare function AttachmentIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
668
672
|
|
|
669
673
|
declare function BlockquoteIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
@@ -708,6 +712,8 @@ declare function ShortenIcon(props: ComponentProps<"svg">): react_jsx_runtime.JS
|
|
|
708
712
|
|
|
709
713
|
declare function SparklesIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
710
714
|
|
|
715
|
+
declare function SparklesTextIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
716
|
+
|
|
711
717
|
declare function StrikethroughIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
712
718
|
|
|
713
719
|
declare function TextIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
|
|
@@ -722,6 +728,8 @@ declare function WarningIcon(props: ComponentProps<"svg">): react_jsx_runtime.JS
|
|
|
722
728
|
|
|
723
729
|
declare namespace icon {
|
|
724
730
|
export {
|
|
731
|
+
ArrowCornerDownRightIcon as ArrowCornerDownRight,
|
|
732
|
+
ArrowCornerUpRightIcon as ArrowCornerUpRight,
|
|
725
733
|
AttachmentIcon as Attachment,
|
|
726
734
|
BlockquoteIcon as Blockquote,
|
|
727
735
|
BoldIcon as Bold,
|
|
@@ -744,6 +752,7 @@ declare namespace icon {
|
|
|
744
752
|
SendIcon as Send,
|
|
745
753
|
ShortenIcon as Shorten,
|
|
746
754
|
SparklesIcon as Sparkles,
|
|
755
|
+
SparklesTextIcon as SparklesText,
|
|
747
756
|
StrikethroughIcon as Strikethrough,
|
|
748
757
|
TextIcon as Text,
|
|
749
758
|
TranslateIcon as Translate,
|
|
@@ -957,18 +957,24 @@ const ComposerForm = react.forwardRef(
|
|
|
957
957
|
}, [editor]);
|
|
958
958
|
const focus = react.useCallback(
|
|
959
959
|
(resetSelection = true) => {
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
960
|
+
try {
|
|
961
|
+
if (!slateReact.ReactEditor.isFocused(editor)) {
|
|
962
|
+
slate.Transforms.select(
|
|
963
|
+
editor,
|
|
964
|
+
resetSelection || !editor.selection ? slate.Editor.end(editor, []) : editor.selection
|
|
965
|
+
);
|
|
966
|
+
slateReact.ReactEditor.focus(editor);
|
|
967
|
+
}
|
|
968
|
+
} catch {
|
|
966
969
|
}
|
|
967
970
|
},
|
|
968
971
|
[editor]
|
|
969
972
|
);
|
|
970
973
|
const blur = react.useCallback(() => {
|
|
971
|
-
|
|
974
|
+
try {
|
|
975
|
+
slateReact.ReactEditor.blur(editor);
|
|
976
|
+
} catch {
|
|
977
|
+
}
|
|
972
978
|
}, [editor]);
|
|
973
979
|
const createMention = react.useCallback(() => {
|
|
974
980
|
if (disabled) {
|