@liveblocks/react-ui 1.12.0-initial1 → 2.0.0-alpha2
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/components/Comment.js +8 -17
- package/dist/components/Comment.js.map +1 -1
- package/dist/components/Comment.mjs +1 -10
- package/dist/components/Comment.mjs.map +1 -1
- package/dist/components/Composer.js +6 -6
- package/dist/components/Composer.js.map +1 -1
- package/dist/components/Composer.mjs +3 -3
- package/dist/components/Composer.mjs.map +1 -1
- package/dist/components/InboxNotification.js +45 -5
- package/dist/components/InboxNotification.js.map +1 -1
- package/dist/components/InboxNotification.mjs +43 -3
- package/dist/components/InboxNotification.mjs.map +1 -1
- package/dist/components/InboxNotificationList.js.map +1 -1
- package/dist/components/InboxNotificationList.mjs.map +1 -1
- package/dist/components/Thread.js +2 -3
- package/dist/components/Thread.js.map +1 -1
- package/dist/components/Thread.mjs +1 -2
- package/dist/components/Thread.mjs.map +1 -1
- package/dist/components/internal/Avatar.js +1 -1
- package/dist/components/internal/Avatar.js.map +1 -1
- package/dist/components/internal/Avatar.mjs +1 -1
- package/dist/components/internal/Avatar.mjs.map +1 -1
- package/dist/components/internal/Room.js +1 -2
- package/dist/components/internal/Room.js.map +1 -1
- package/dist/components/internal/Room.mjs +1 -2
- package/dist/components/internal/Room.mjs.map +1 -1
- package/dist/index.d.mts +41 -5
- package/dist/index.d.ts +41 -5
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -1
- package/dist/overrides.js +2 -1
- package/dist/overrides.js.map +1 -1
- package/dist/overrides.mjs +2 -1
- package/dist/overrides.mjs.map +1 -1
- package/dist/primitives/Composer/index.js +4 -9
- package/dist/primitives/Composer/index.js.map +1 -1
- package/dist/primitives/Composer/index.mjs +2 -7
- package/dist/primitives/Composer/index.mjs.map +1 -1
- package/dist/shared.js +79 -6
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +81 -9
- package/dist/shared.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 +7 -6
- package/src/styles/index.css +6 -0
- package/styles.css +1 -1
- package/styles.css.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","sources":["../../../src/components/internal/Avatar.tsx"],"sourcesContent":["\"use client\";\n\nimport
|
|
1
|
+
{"version":3,"file":"Avatar.js","sources":["../../../src/components/internal/Avatar.tsx"],"sourcesContent":["\"use client\";\n\nimport { useUser } from \"@liveblocks/react\";\nimport type { ComponentProps } from \"react\";\nimport React, { useMemo } from \"react\";\n\nimport { classNames } from \"../../utils/class-names\";\nimport { getInitials } from \"../../utils/get-initials\";\n\nexport interface AvatarProps extends ComponentProps<\"div\"> {\n /**\n * The user ID to display the avatar for.\n */\n userId: string;\n}\n\nexport function Avatar({ userId, className, ...props }: AvatarProps) {\n const { user, isLoading } = useUser(userId);\n const resolvedUserName = useMemo(() => user?.name, [user]);\n const resolvedUserAvatar = useMemo(() => user?.avatar, [user]);\n const resolvedUserInitials = useMemo(\n () => (resolvedUserName ? getInitials(resolvedUserName) : undefined),\n [resolvedUserName]\n );\n const resolvedUserIdInitials = useMemo(\n () => (!isLoading && !user ? getInitials(userId) : undefined),\n [isLoading, user, userId]\n );\n\n return (\n <div\n className={classNames(\"lb-avatar\", className)}\n data-loading={isLoading ? \"\" : undefined}\n {...props}\n >\n {resolvedUserAvatar && (\n <img\n className=\"lb-avatar-image\"\n src={resolvedUserAvatar}\n alt={resolvedUserName}\n />\n )}\n {resolvedUserInitials ? (\n <span className=\"lb-avatar-fallback\" aria-hidden>\n {resolvedUserInitials}\n </span>\n ) : resolvedUserIdInitials ? (\n <span className=\"lb-avatar-fallback\" aria-label={userId} title={userId}>\n {resolvedUserIdInitials}\n </span>\n ) : null}\n </div>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AAgBO;AACL;AACA;AACA;AACA;AAA6B;AAC+B;AACzC;AAEnB;AAA+B;AACsB;AAC3B;AAG1B;AACG;AAC6C;AACb;AAC3B;AAGD;AACW;AACL;AACA;AAIN;AAAe;AAAgC;AAI/C;AAAe;AAAiC;AAAe;AAMxE;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import React__default, { useMemo } from 'react';
|
|
3
2
|
import { useUser } from '@liveblocks/react';
|
|
3
|
+
import React__default, { useMemo } from 'react';
|
|
4
4
|
import { classNames } from '../../utils/class-names.mjs';
|
|
5
5
|
import { getInitials } from '../../utils/get-initials.mjs';
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.mjs","sources":["../../../src/components/internal/Avatar.tsx"],"sourcesContent":["\"use client\";\n\nimport
|
|
1
|
+
{"version":3,"file":"Avatar.mjs","sources":["../../../src/components/internal/Avatar.tsx"],"sourcesContent":["\"use client\";\n\nimport { useUser } from \"@liveblocks/react\";\nimport type { ComponentProps } from \"react\";\nimport React, { useMemo } from \"react\";\n\nimport { classNames } from \"../../utils/class-names\";\nimport { getInitials } from \"../../utils/get-initials\";\n\nexport interface AvatarProps extends ComponentProps<\"div\"> {\n /**\n * The user ID to display the avatar for.\n */\n userId: string;\n}\n\nexport function Avatar({ userId, className, ...props }: AvatarProps) {\n const { user, isLoading } = useUser(userId);\n const resolvedUserName = useMemo(() => user?.name, [user]);\n const resolvedUserAvatar = useMemo(() => user?.avatar, [user]);\n const resolvedUserInitials = useMemo(\n () => (resolvedUserName ? getInitials(resolvedUserName) : undefined),\n [resolvedUserName]\n );\n const resolvedUserIdInitials = useMemo(\n () => (!isLoading && !user ? getInitials(userId) : undefined),\n [isLoading, user, userId]\n );\n\n return (\n <div\n className={classNames(\"lb-avatar\", className)}\n data-loading={isLoading ? \"\" : undefined}\n {...props}\n >\n {resolvedUserAvatar && (\n <img\n className=\"lb-avatar-image\"\n src={resolvedUserAvatar}\n alt={resolvedUserName}\n />\n )}\n {resolvedUserInitials ? (\n <span className=\"lb-avatar-fallback\" aria-hidden>\n {resolvedUserInitials}\n </span>\n ) : resolvedUserIdInitials ? (\n <span className=\"lb-avatar-fallback\" aria-label={userId} title={userId}>\n {resolvedUserIdInitials}\n </span>\n ) : null}\n </div>\n );\n}\n"],"names":[],"mappings":";;;;;;AAgBO;AACL;AACA;AACA;AACA;AAA6B;AAC+B;AACzC;AAEnB;AAA+B;AACsB;AAC3B;AAG1B;AACG;AAC6C;AACb;AAC3B;AAGD;AACW;AACL;AACA;AAIN;AAAe;AAAgC;AAI/C;AAAe;AAAiC;AAAe;AAMxE;;"}
|
|
@@ -6,8 +6,7 @@ var React = require('react');
|
|
|
6
6
|
var classNames = require('../../utils/class-names.js');
|
|
7
7
|
|
|
8
8
|
function Room({ roomId, className, ...props }) {
|
|
9
|
-
const {
|
|
10
|
-
const { info, isLoading } = useRoomInfo(roomId);
|
|
9
|
+
const { info, isLoading } = react.useRoomInfo(roomId);
|
|
11
10
|
const resolvedRoomName = React.useMemo(() => {
|
|
12
11
|
return info?.name ?? roomId;
|
|
13
12
|
}, [info?.name, roomId]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Room.js","sources":["../../../src/components/internal/Room.tsx"],"sourcesContent":["\"use client\";\n\nimport {
|
|
1
|
+
{"version":3,"file":"Room.js","sources":["../../../src/components/internal/Room.tsx"],"sourcesContent":["\"use client\";\n\nimport { useRoomInfo } from \"@liveblocks/react\";\nimport type { ComponentProps } from \"react\";\nimport React, { useMemo } from \"react\";\n\nimport { classNames } from \"../../utils/class-names\";\n\nexport interface RoomProps extends ComponentProps<\"span\"> {\n roomId: string;\n}\n\nexport function Room({ roomId, className, ...props }: RoomProps) {\n const { info, isLoading } = useRoomInfo(roomId);\n const resolvedRoomName = useMemo(() => {\n return info?.name ?? roomId;\n }, [info?.name, roomId]);\n\n return (\n <span\n className={classNames(\"lb-name lb-room\", className)}\n data-loading={isLoading ? \"\" : undefined}\n {...props}\n >\n {isLoading ? null : resolvedRoomName}\n </span>\n );\n}\n"],"names":[],"mappings":";;;;;;;AAYO;AACL;AACA;AACE;AAAqB;AAGvB;AACG;AACmD;AACnB;AAC3B;AAKV;;"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { useRoomInfo } from '@liveblocks/react';
|
|
3
3
|
import React__default, { useMemo } from 'react';
|
|
4
4
|
import { classNames } from '../../utils/class-names.mjs';
|
|
5
5
|
|
|
6
6
|
function Room({ roomId, className, ...props }) {
|
|
7
|
-
const { useRoomInfo } = useLiveblocksContextBundle();
|
|
8
7
|
const { info, isLoading } = useRoomInfo(roomId);
|
|
9
8
|
const resolvedRoomName = useMemo(() => {
|
|
10
9
|
return info?.name ?? roomId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Room.mjs","sources":["../../../src/components/internal/Room.tsx"],"sourcesContent":["\"use client\";\n\nimport {
|
|
1
|
+
{"version":3,"file":"Room.mjs","sources":["../../../src/components/internal/Room.tsx"],"sourcesContent":["\"use client\";\n\nimport { useRoomInfo } from \"@liveblocks/react\";\nimport type { ComponentProps } from \"react\";\nimport React, { useMemo } from \"react\";\n\nimport { classNames } from \"../../utils/class-names\";\n\nexport interface RoomProps extends ComponentProps<\"span\"> {\n roomId: string;\n}\n\nexport function Room({ roomId, className, ...props }: RoomProps) {\n const { info, isLoading } = useRoomInfo(roomId);\n const resolvedRoomName = useMemo(() => {\n return info?.name ?? roomId;\n }, [info?.name, roomId]);\n\n return (\n <span\n className={classNames(\"lb-name lb-room\", className)}\n data-loading={isLoading ? \"\" : undefined}\n {...props}\n >\n {isLoading ? null : resolvedRoomName}\n </span>\n );\n}\n"],"names":[],"mappings":";;;;;AAYO;AACL;AACA;AACE;AAAqB;AAGvB;AACG;AACmD;AACnB;AAC3B;AAKV;;"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommentData, CommentBody, BaseMetadata, InboxNotificationData, InboxNotificationThreadData, InboxNotificationCustomData, ThreadData } from '@liveblocks/core';
|
|
1
|
+
import { CommentData, CommentBody, BaseMetadata, InboxNotificationData, InboxNotificationThreadData, InboxNotificationTextMentionData, InboxNotificationCustomData, DAD, ThreadData } from '@liveblocks/core';
|
|
2
2
|
import React, { ReactNode, ComponentPropsWithoutRef, MouseEvent, ComponentType, FormEvent, RefAttributes, ComponentProps, PropsWithChildren } from 'react';
|
|
3
3
|
|
|
4
4
|
declare type Direction = "ltr" | "rtl";
|
|
@@ -58,8 +58,10 @@ interface InboxNotificationOverrides {
|
|
|
58
58
|
INBOX_NOTIFICATION_MARK_AS_READ: string;
|
|
59
59
|
INBOX_NOTIFICATION_THREAD_COMMENTS_LIST: (list: ReactNode, room: ReactNode | undefined, count: number) => ReactNode;
|
|
60
60
|
INBOX_NOTIFICATION_THREAD_MENTION: (user: ReactNode, room: ReactNode | undefined) => ReactNode;
|
|
61
|
+
INBOX_NOTIFICATION_TEXT_MENTION: (user: ReactNode, room: ReactNode | undefined) => ReactNode;
|
|
61
62
|
}
|
|
62
63
|
declare type Overrides = LocalizationOverrides & GlobalOverrides & ComposerOverrides & CommentOverrides & ThreadOverrides & InboxNotificationOverrides;
|
|
64
|
+
declare function useOverrides(overrides?: Partial<Overrides>): Overrides;
|
|
63
65
|
|
|
64
66
|
interface CommentProps extends ComponentPropsWithoutRef<"div"> {
|
|
65
67
|
/**
|
|
@@ -277,10 +279,12 @@ interface AvatarProps extends ComponentProps<"div"> {
|
|
|
277
279
|
userId: string;
|
|
278
280
|
}
|
|
279
281
|
|
|
280
|
-
declare type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
281
282
|
declare type ComponentTypeWithRef<T extends keyof JSX.IntrinsicElements, P> = ComponentType<P & Pick<ComponentProps<T>, "ref">>;
|
|
282
|
-
declare type InboxNotificationKinds =
|
|
283
|
-
|
|
283
|
+
declare type InboxNotificationKinds = {
|
|
284
|
+
[K in keyof DAD]: ComponentTypeWithRef<"a", InboxNotificationCustomKindProps<K>>;
|
|
285
|
+
} & {
|
|
286
|
+
thread: ComponentTypeWithRef<"a", InboxNotificationThreadKindProps>;
|
|
287
|
+
textMention: ComponentTypeWithRef<"a", InboxNotificationTextMentionProps>;
|
|
284
288
|
};
|
|
285
289
|
interface InboxNotificationSharedProps {
|
|
286
290
|
/**
|
|
@@ -316,6 +320,16 @@ interface InboxNotificationThreadProps extends Omit<InboxNotificationProps, "kin
|
|
|
316
320
|
*/
|
|
317
321
|
showRoomName?: boolean;
|
|
318
322
|
}
|
|
323
|
+
interface InboxNotificationTextMentionProps extends Omit<InboxNotificationProps, "kinds">, InboxNotificationSharedProps {
|
|
324
|
+
/**
|
|
325
|
+
* The inbox notification to display.
|
|
326
|
+
*/
|
|
327
|
+
inboxNotification: InboxNotificationTextMentionData;
|
|
328
|
+
/**
|
|
329
|
+
* Whether to show the room name in the title.
|
|
330
|
+
*/
|
|
331
|
+
showRoomName?: boolean;
|
|
332
|
+
}
|
|
319
333
|
interface InboxNotificationCustomProps extends Omit<InboxNotificationProps, "kinds">, InboxNotificationSharedProps, SlotProp {
|
|
320
334
|
/**
|
|
321
335
|
* The inbox notification to display.
|
|
@@ -339,11 +353,22 @@ interface InboxNotificationCustomProps extends Omit<InboxNotificationProps, "kin
|
|
|
339
353
|
*/
|
|
340
354
|
markAsReadOnClick?: boolean;
|
|
341
355
|
}
|
|
356
|
+
declare type InboxNotificationThreadKindProps = Omit<InboxNotificationProps, "kinds"> & {
|
|
357
|
+
inboxNotification: InboxNotificationThreadData;
|
|
358
|
+
};
|
|
359
|
+
declare type InboxNotificationTextMentionKindProps = Omit<InboxNotificationProps, "kinds"> & {
|
|
360
|
+
inboxNotification: InboxNotificationTextMentionData;
|
|
361
|
+
};
|
|
362
|
+
declare type InboxNotificationCustomKindProps<K extends `$${string}` = `$${string}`> = Omit<InboxNotificationProps, "kinds"> & {
|
|
363
|
+
inboxNotification: InboxNotificationCustomData<K>;
|
|
364
|
+
};
|
|
342
365
|
declare type InboxNotificationIconProps = ComponentProps<"div">;
|
|
343
366
|
declare type InboxNotificationAvatarProps = AvatarProps;
|
|
344
367
|
declare function InboxNotificationIcon({ className, ...props }: InboxNotificationIconProps): React.JSX.Element;
|
|
345
368
|
declare function InboxNotificationAvatar({ className, ...props }: InboxNotificationAvatarProps): React.JSX.Element;
|
|
346
369
|
/**
|
|
370
|
+
* @beta
|
|
371
|
+
*
|
|
347
372
|
* Displays a single inbox notification.
|
|
348
373
|
*
|
|
349
374
|
* @example
|
|
@@ -359,6 +384,7 @@ declare function InboxNotificationAvatar({ className, ...props }: InboxNotificat
|
|
|
359
384
|
*/
|
|
360
385
|
declare const InboxNotification: React.ForwardRefExoticComponent<InboxNotificationProps & React.RefAttributes<HTMLAnchorElement>> & {
|
|
361
386
|
Thread: React.ForwardRefExoticComponent<InboxNotificationThreadProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
387
|
+
TextMention: React.ForwardRefExoticComponent<InboxNotificationTextMentionProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
362
388
|
Custom: React.ForwardRefExoticComponent<InboxNotificationCustomProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
363
389
|
Icon: typeof InboxNotificationIcon;
|
|
364
390
|
Avatar: typeof InboxNotificationAvatar;
|
|
@@ -366,6 +392,8 @@ declare const InboxNotification: React.ForwardRefExoticComponent<InboxNotificati
|
|
|
366
392
|
|
|
367
393
|
declare type InboxNotificationListProps = ComponentPropsWithoutRef<"ol">;
|
|
368
394
|
/**
|
|
395
|
+
* @beta
|
|
396
|
+
*
|
|
369
397
|
* Displays inbox notifications as a list.
|
|
370
398
|
*
|
|
371
399
|
* @example
|
|
@@ -473,4 +501,12 @@ declare type LiveblocksUIConfigProps = PropsWithChildren<{
|
|
|
473
501
|
*/
|
|
474
502
|
declare function LiveblocksUIConfig({ overrides, components, portalContainer, children, }: LiveblocksUIConfigProps): React.JSX.Element;
|
|
475
503
|
|
|
476
|
-
|
|
504
|
+
/**
|
|
505
|
+
* @private For internal use only. Do not rely on this hook.
|
|
506
|
+
*
|
|
507
|
+
* Simplistic debounced search, we don't need to worry too much about deduping
|
|
508
|
+
* and race conditions as there can only be one search at a time.
|
|
509
|
+
*/
|
|
510
|
+
declare function useMentionSuggestions(search?: string): string[] | undefined;
|
|
511
|
+
|
|
512
|
+
export { Comment, CommentProps, Composer, ComposerProps, ComposerSubmitComment, InboxNotification, InboxNotificationAvatarProps, InboxNotificationCustomKindProps, InboxNotificationCustomProps, InboxNotificationIconProps, InboxNotificationList, InboxNotificationListProps, InboxNotificationProps, InboxNotificationTextMentionKindProps, InboxNotificationTextMentionProps, InboxNotificationThreadKindProps, InboxNotificationThreadProps, LiveblocksUIConfig, Thread, ThreadProps, useMentionSuggestions, useOverrides };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommentData, CommentBody, BaseMetadata, InboxNotificationData, InboxNotificationThreadData, InboxNotificationCustomData, ThreadData } from '@liveblocks/core';
|
|
1
|
+
import { CommentData, CommentBody, BaseMetadata, InboxNotificationData, InboxNotificationThreadData, InboxNotificationTextMentionData, InboxNotificationCustomData, DAD, ThreadData } from '@liveblocks/core';
|
|
2
2
|
import React, { ReactNode, ComponentPropsWithoutRef, MouseEvent, ComponentType, FormEvent, RefAttributes, ComponentProps, PropsWithChildren } from 'react';
|
|
3
3
|
|
|
4
4
|
declare type Direction = "ltr" | "rtl";
|
|
@@ -58,8 +58,10 @@ interface InboxNotificationOverrides {
|
|
|
58
58
|
INBOX_NOTIFICATION_MARK_AS_READ: string;
|
|
59
59
|
INBOX_NOTIFICATION_THREAD_COMMENTS_LIST: (list: ReactNode, room: ReactNode | undefined, count: number) => ReactNode;
|
|
60
60
|
INBOX_NOTIFICATION_THREAD_MENTION: (user: ReactNode, room: ReactNode | undefined) => ReactNode;
|
|
61
|
+
INBOX_NOTIFICATION_TEXT_MENTION: (user: ReactNode, room: ReactNode | undefined) => ReactNode;
|
|
61
62
|
}
|
|
62
63
|
declare type Overrides = LocalizationOverrides & GlobalOverrides & ComposerOverrides & CommentOverrides & ThreadOverrides & InboxNotificationOverrides;
|
|
64
|
+
declare function useOverrides(overrides?: Partial<Overrides>): Overrides;
|
|
63
65
|
|
|
64
66
|
interface CommentProps extends ComponentPropsWithoutRef<"div"> {
|
|
65
67
|
/**
|
|
@@ -277,10 +279,12 @@ interface AvatarProps extends ComponentProps<"div"> {
|
|
|
277
279
|
userId: string;
|
|
278
280
|
}
|
|
279
281
|
|
|
280
|
-
declare type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
281
282
|
declare type ComponentTypeWithRef<T extends keyof JSX.IntrinsicElements, P> = ComponentType<P & Pick<ComponentProps<T>, "ref">>;
|
|
282
|
-
declare type InboxNotificationKinds =
|
|
283
|
-
|
|
283
|
+
declare type InboxNotificationKinds = {
|
|
284
|
+
[K in keyof DAD]: ComponentTypeWithRef<"a", InboxNotificationCustomKindProps<K>>;
|
|
285
|
+
} & {
|
|
286
|
+
thread: ComponentTypeWithRef<"a", InboxNotificationThreadKindProps>;
|
|
287
|
+
textMention: ComponentTypeWithRef<"a", InboxNotificationTextMentionProps>;
|
|
284
288
|
};
|
|
285
289
|
interface InboxNotificationSharedProps {
|
|
286
290
|
/**
|
|
@@ -316,6 +320,16 @@ interface InboxNotificationThreadProps extends Omit<InboxNotificationProps, "kin
|
|
|
316
320
|
*/
|
|
317
321
|
showRoomName?: boolean;
|
|
318
322
|
}
|
|
323
|
+
interface InboxNotificationTextMentionProps extends Omit<InboxNotificationProps, "kinds">, InboxNotificationSharedProps {
|
|
324
|
+
/**
|
|
325
|
+
* The inbox notification to display.
|
|
326
|
+
*/
|
|
327
|
+
inboxNotification: InboxNotificationTextMentionData;
|
|
328
|
+
/**
|
|
329
|
+
* Whether to show the room name in the title.
|
|
330
|
+
*/
|
|
331
|
+
showRoomName?: boolean;
|
|
332
|
+
}
|
|
319
333
|
interface InboxNotificationCustomProps extends Omit<InboxNotificationProps, "kinds">, InboxNotificationSharedProps, SlotProp {
|
|
320
334
|
/**
|
|
321
335
|
* The inbox notification to display.
|
|
@@ -339,11 +353,22 @@ interface InboxNotificationCustomProps extends Omit<InboxNotificationProps, "kin
|
|
|
339
353
|
*/
|
|
340
354
|
markAsReadOnClick?: boolean;
|
|
341
355
|
}
|
|
356
|
+
declare type InboxNotificationThreadKindProps = Omit<InboxNotificationProps, "kinds"> & {
|
|
357
|
+
inboxNotification: InboxNotificationThreadData;
|
|
358
|
+
};
|
|
359
|
+
declare type InboxNotificationTextMentionKindProps = Omit<InboxNotificationProps, "kinds"> & {
|
|
360
|
+
inboxNotification: InboxNotificationTextMentionData;
|
|
361
|
+
};
|
|
362
|
+
declare type InboxNotificationCustomKindProps<K extends `$${string}` = `$${string}`> = Omit<InboxNotificationProps, "kinds"> & {
|
|
363
|
+
inboxNotification: InboxNotificationCustomData<K>;
|
|
364
|
+
};
|
|
342
365
|
declare type InboxNotificationIconProps = ComponentProps<"div">;
|
|
343
366
|
declare type InboxNotificationAvatarProps = AvatarProps;
|
|
344
367
|
declare function InboxNotificationIcon({ className, ...props }: InboxNotificationIconProps): React.JSX.Element;
|
|
345
368
|
declare function InboxNotificationAvatar({ className, ...props }: InboxNotificationAvatarProps): React.JSX.Element;
|
|
346
369
|
/**
|
|
370
|
+
* @beta
|
|
371
|
+
*
|
|
347
372
|
* Displays a single inbox notification.
|
|
348
373
|
*
|
|
349
374
|
* @example
|
|
@@ -359,6 +384,7 @@ declare function InboxNotificationAvatar({ className, ...props }: InboxNotificat
|
|
|
359
384
|
*/
|
|
360
385
|
declare const InboxNotification: React.ForwardRefExoticComponent<InboxNotificationProps & React.RefAttributes<HTMLAnchorElement>> & {
|
|
361
386
|
Thread: React.ForwardRefExoticComponent<InboxNotificationThreadProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
387
|
+
TextMention: React.ForwardRefExoticComponent<InboxNotificationTextMentionProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
362
388
|
Custom: React.ForwardRefExoticComponent<InboxNotificationCustomProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
363
389
|
Icon: typeof InboxNotificationIcon;
|
|
364
390
|
Avatar: typeof InboxNotificationAvatar;
|
|
@@ -366,6 +392,8 @@ declare const InboxNotification: React.ForwardRefExoticComponent<InboxNotificati
|
|
|
366
392
|
|
|
367
393
|
declare type InboxNotificationListProps = ComponentPropsWithoutRef<"ol">;
|
|
368
394
|
/**
|
|
395
|
+
* @beta
|
|
396
|
+
*
|
|
369
397
|
* Displays inbox notifications as a list.
|
|
370
398
|
*
|
|
371
399
|
* @example
|
|
@@ -473,4 +501,12 @@ declare type LiveblocksUIConfigProps = PropsWithChildren<{
|
|
|
473
501
|
*/
|
|
474
502
|
declare function LiveblocksUIConfig({ overrides, components, portalContainer, children, }: LiveblocksUIConfigProps): React.JSX.Element;
|
|
475
503
|
|
|
476
|
-
|
|
504
|
+
/**
|
|
505
|
+
* @private For internal use only. Do not rely on this hook.
|
|
506
|
+
*
|
|
507
|
+
* Simplistic debounced search, we don't need to worry too much about deduping
|
|
508
|
+
* and race conditions as there can only be one search at a time.
|
|
509
|
+
*/
|
|
510
|
+
declare function useMentionSuggestions(search?: string): string[] | undefined;
|
|
511
|
+
|
|
512
|
+
export { Comment, CommentProps, Composer, ComposerProps, ComposerSubmitComment, InboxNotification, InboxNotificationAvatarProps, InboxNotificationCustomKindProps, InboxNotificationCustomProps, InboxNotificationIconProps, InboxNotificationList, InboxNotificationListProps, InboxNotificationProps, InboxNotificationTextMentionKindProps, InboxNotificationTextMentionProps, InboxNotificationThreadKindProps, InboxNotificationThreadProps, LiveblocksUIConfig, Thread, ThreadProps, useMentionSuggestions, useOverrides };
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,8 @@ var InboxNotification = require('./components/InboxNotification.js');
|
|
|
8
8
|
var InboxNotificationList = require('./components/InboxNotificationList.js');
|
|
9
9
|
var Thread = require('./components/Thread.js');
|
|
10
10
|
var config = require('./config.js');
|
|
11
|
+
var overrides = require('./overrides.js');
|
|
12
|
+
var shared = require('./shared.js');
|
|
11
13
|
|
|
12
14
|
core.detectDupes(version.PKG_NAME, version.PKG_VERSION, version.PKG_FORMAT);
|
|
13
15
|
|
|
@@ -17,4 +19,6 @@ exports.InboxNotification = InboxNotification.InboxNotification;
|
|
|
17
19
|
exports.InboxNotificationList = InboxNotificationList.InboxNotificationList;
|
|
18
20
|
exports.Thread = Thread.Thread;
|
|
19
21
|
exports.LiveblocksUIConfig = config.LiveblocksUIConfig;
|
|
22
|
+
exports.useOverrides = overrides.useOverrides;
|
|
23
|
+
exports.useMentionSuggestions = shared.useMentionSuggestions;
|
|
20
24
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\n\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport type { CommentProps } from \"./components/Comment\";\nexport { Comment } from \"./components/Comment\";\nexport type { ComposerProps } from \"./components/Composer\";\nexport { Composer } from \"./components/Composer\";\nexport type {\n InboxNotificationAvatarProps,\n InboxNotificationCustomProps,\n InboxNotificationIconProps,\n InboxNotificationProps,\n InboxNotificationThreadProps,\n} from \"./components/InboxNotification\";\nexport { InboxNotification } from \"./components/InboxNotification\";\nexport type { InboxNotificationListProps } from \"./components/InboxNotificationList\";\nexport { InboxNotificationList } from \"./components/InboxNotificationList\";\nexport type { ThreadProps } from \"./components/Thread\";\nexport { Thread } from \"./components/Thread\";\nexport { LiveblocksUIConfig } from \"./config\";\nexport type { ComposerSubmitComment } from \"./primitives\";\n"],"names":["detectDupes","PKG_NAME","PKG_VERSION","PKG_FORMAT"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\n\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport type { CommentProps } from \"./components/Comment\";\nexport { Comment } from \"./components/Comment\";\nexport type { ComposerProps } from \"./components/Composer\";\nexport { Composer } from \"./components/Composer\";\nexport type {\n InboxNotificationAvatarProps,\n InboxNotificationCustomKindProps,\n InboxNotificationCustomProps,\n InboxNotificationIconProps,\n InboxNotificationProps,\n InboxNotificationTextMentionKindProps,\n InboxNotificationTextMentionProps,\n InboxNotificationThreadKindProps,\n InboxNotificationThreadProps,\n} from \"./components/InboxNotification\";\nexport { InboxNotification } from \"./components/InboxNotification\";\nexport type { InboxNotificationListProps } from \"./components/InboxNotificationList\";\nexport { InboxNotificationList } from \"./components/InboxNotificationList\";\nexport type { ThreadProps } from \"./components/Thread\";\nexport { Thread } from \"./components/Thread\";\nexport { LiveblocksUIConfig } from \"./config\";\nexport { useOverrides } from \"./overrides\";\nexport type { ComposerSubmitComment } from \"./primitives\";\nexport { useMentionSuggestions } from \"./shared\";\n"],"names":["detectDupes","PKG_NAME","PKG_VERSION","PKG_FORMAT"],"mappings":";;;;;;;;;;;;;AAIAA,gBAAY,CAAAC,gBAAA,EAAUC,qBAAaC,kBAAU,CAAA;;;;;;;;;;;"}
|
package/dist/index.mjs
CHANGED
|
@@ -6,6 +6,8 @@ export { InboxNotification } from './components/InboxNotification.mjs';
|
|
|
6
6
|
export { InboxNotificationList } from './components/InboxNotificationList.mjs';
|
|
7
7
|
export { Thread } from './components/Thread.mjs';
|
|
8
8
|
export { LiveblocksUIConfig } from './config.mjs';
|
|
9
|
+
export { useOverrides } from './overrides.mjs';
|
|
10
|
+
export { useMentionSuggestions } from './shared.mjs';
|
|
9
11
|
|
|
10
12
|
detectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);
|
|
11
13
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\n\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport type { CommentProps } from \"./components/Comment\";\nexport { Comment } from \"./components/Comment\";\nexport type { ComposerProps } from \"./components/Composer\";\nexport { Composer } from \"./components/Composer\";\nexport type {\n InboxNotificationAvatarProps,\n InboxNotificationCustomProps,\n InboxNotificationIconProps,\n InboxNotificationProps,\n InboxNotificationThreadProps,\n} from \"./components/InboxNotification\";\nexport { InboxNotification } from \"./components/InboxNotification\";\nexport type { InboxNotificationListProps } from \"./components/InboxNotificationList\";\nexport { InboxNotificationList } from \"./components/InboxNotificationList\";\nexport type { ThreadProps } from \"./components/Thread\";\nexport { Thread } from \"./components/Thread\";\nexport { LiveblocksUIConfig } from \"./config\";\nexport type { ComposerSubmitComment } from \"./primitives\";\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\n\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport type { CommentProps } from \"./components/Comment\";\nexport { Comment } from \"./components/Comment\";\nexport type { ComposerProps } from \"./components/Composer\";\nexport { Composer } from \"./components/Composer\";\nexport type {\n InboxNotificationAvatarProps,\n InboxNotificationCustomKindProps,\n InboxNotificationCustomProps,\n InboxNotificationIconProps,\n InboxNotificationProps,\n InboxNotificationTextMentionKindProps,\n InboxNotificationTextMentionProps,\n InboxNotificationThreadKindProps,\n InboxNotificationThreadProps,\n} from \"./components/InboxNotification\";\nexport { InboxNotification } from \"./components/InboxNotification\";\nexport type { InboxNotificationListProps } from \"./components/InboxNotificationList\";\nexport { InboxNotificationList } from \"./components/InboxNotificationList\";\nexport type { ThreadProps } from \"./components/Thread\";\nexport { Thread } from \"./components/Thread\";\nexport { LiveblocksUIConfig } from \"./config\";\nexport { useOverrides } from \"./overrides\";\nexport type { ComposerSubmitComment } from \"./primitives\";\nexport { useMentionSuggestions } from \"./shared\";\n"],"names":[],"mappings":";;;;;;;;;;;AAIA,WAAY,CAAA,QAAA,EAAU,aAAa,UAAU,CAAA"}
|
package/dist/overrides.js
CHANGED
|
@@ -61,7 +61,8 @@ const defaultOverrides = {
|
|
|
61
61
|
INBOX_NOTIFICATION_MORE: "More",
|
|
62
62
|
INBOX_NOTIFICATION_MARK_AS_READ: "Mark as read",
|
|
63
63
|
INBOX_NOTIFICATION_THREAD_COMMENTS_LIST: (list, room) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, list, " commented", room ? /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, " in ", room) : /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, " in a thread")),
|
|
64
|
-
INBOX_NOTIFICATION_THREAD_MENTION: (user, room) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, user, " mentioned you", room ? /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, " in ", room) : null)
|
|
64
|
+
INBOX_NOTIFICATION_THREAD_MENTION: (user, room) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, user, " mentioned you", room ? /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, " in ", room) : null),
|
|
65
|
+
INBOX_NOTIFICATION_TEXT_MENTION: (user, room) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, user, " mentioned you", room ? /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, " in ", room) : null)
|
|
65
66
|
};
|
|
66
67
|
const OverridesContext = React.createContext(void 0);
|
|
67
68
|
function useOverrides(overrides) {
|
package/dist/overrides.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overrides.js","sources":["../src/overrides.tsx"],"sourcesContent":["\"use client\";\n\nimport type { PropsWithChildren, ReactNode } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\nimport * as React from \"react\";\n\nimport { Emoji } from \"./components/internal/Emoji\";\nimport type { Direction } from \"./types\";\nimport { pluralize } from \"./utils/pluralize\";\n\nexport interface LocalizationOverrides {\n locale: string;\n dir: Direction;\n}\n\nexport interface GlobalOverrides {\n USER_SELF: string;\n USER_UNKNOWN: string;\n LIST_REMAINING: (count: number) => string;\n LIST_REMAINING_USERS: (count: number) => string;\n LIST_REMAINING_COMMENTS: (count: number) => string;\n EMOJI_PICKER_SEARCH_PLACEHOLDER: string;\n EMOJI_PICKER_EMPTY: ReactNode;\n EMOJI_PICKER_ERROR: (error: Error) => ReactNode;\n}\n\nexport interface CommentOverrides {\n COMMENT_EDITED: ReactNode;\n COMMENT_DELETED: ReactNode;\n COMMENT_MORE: string;\n COMMENT_EDIT: string;\n COMMENT_EDIT_COMPOSER_PLACEHOLDER: string;\n COMMENT_EDIT_COMPOSER_CANCEL: string;\n COMMENT_EDIT_COMPOSER_SAVE: string;\n COMMENT_DELETE: string;\n COMMENT_ADD_REACTION: string;\n COMMENT_REACTION_LIST: (\n list: ReactNode,\n emoji: string,\n count: number\n ) => ReactNode;\n COMMENT_REACTION_DESCRIPTION: (emoji: string, count: number) => string;\n}\n\nexport interface ComposerOverrides {\n COMPOSER_INSERT_MENTION: string;\n COMPOSER_INSERT_EMOJI: string;\n COMPOSER_PLACEHOLDER: string;\n COMPOSER_SEND: string;\n}\n\nexport interface ThreadOverrides {\n THREAD_RESOLVE: string;\n THREAD_UNRESOLVE: string;\n THREAD_NEW_INDICATOR: string;\n THREAD_NEW_INDICATOR_DESCRIPTION: string;\n THREAD_COMPOSER_PLACEHOLDER: string;\n THREAD_COMPOSER_SEND: string;\n}\n\nexport interface InboxNotificationOverrides {\n INBOX_NOTIFICATION_MORE: string;\n INBOX_NOTIFICATION_MARK_AS_READ: string;\n INBOX_NOTIFICATION_THREAD_COMMENTS_LIST: (\n list: ReactNode,\n room: ReactNode | undefined,\n count: number\n ) => ReactNode;\n INBOX_NOTIFICATION_THREAD_MENTION: (\n user: ReactNode,\n room: ReactNode | undefined\n ) => ReactNode;\n}\n\nexport type Overrides = LocalizationOverrides &\n GlobalOverrides &\n ComposerOverrides &\n CommentOverrides &\n ThreadOverrides &\n InboxNotificationOverrides;\n\ntype OverridesProviderProps = PropsWithChildren<{\n overrides?: Partial<Overrides>;\n}>;\n\nexport const defaultOverrides: Overrides = {\n locale: \"en\",\n dir: \"ltr\",\n USER_SELF: \"you\",\n USER_UNKNOWN: \"Anonymous\",\n LIST_REMAINING: (count) => `${count} more`,\n LIST_REMAINING_USERS: (count) => `${count} ${pluralize(count, \"other\")}`,\n LIST_REMAINING_COMMENTS: (count) =>\n `${count} more ${pluralize(count, \"comment\")}`,\n EMOJI_PICKER_SEARCH_PLACEHOLDER: \"Search…\",\n EMOJI_PICKER_EMPTY: \"No emoji found.\",\n EMOJI_PICKER_ERROR: () =>\n \"There was an error while getting the list of emoji.\",\n COMPOSER_INSERT_MENTION: \"Mention someone\",\n COMPOSER_INSERT_EMOJI: \"Add emoji\",\n COMPOSER_PLACEHOLDER: \"Write a comment…\",\n COMPOSER_SEND: \"Send\",\n COMMENT_EDITED: \"(edited)\",\n COMMENT_DELETED: \"This comment has been deleted.\",\n COMMENT_MORE: \"More\",\n COMMENT_EDIT: \"Edit comment\",\n COMMENT_EDIT_COMPOSER_PLACEHOLDER: \"Edit comment…\",\n COMMENT_EDIT_COMPOSER_CANCEL: \"Cancel\",\n COMMENT_EDIT_COMPOSER_SAVE: \"Save\",\n COMMENT_DELETE: \"Delete comment\",\n COMMENT_ADD_REACTION: \"Add reaction\",\n COMMENT_REACTION_LIST: (list, emoji) => (\n <>\n {list} reacted with <Emoji emoji={emoji} />\n </>\n ),\n COMMENT_REACTION_DESCRIPTION: (emoji, count) =>\n `${count} ${pluralize(count, \"reaction\")}, react with ${emoji}`,\n THREAD_RESOLVE: \"Resolve thread\",\n THREAD_UNRESOLVE: \"Re-open thread\",\n THREAD_NEW_INDICATOR: \"New\",\n THREAD_NEW_INDICATOR_DESCRIPTION: \"New comments\",\n THREAD_COMPOSER_PLACEHOLDER: \"Reply to thread…\",\n THREAD_COMPOSER_SEND: \"Reply\",\n INBOX_NOTIFICATION_MORE: \"More\",\n INBOX_NOTIFICATION_MARK_AS_READ: \"Mark as read\",\n INBOX_NOTIFICATION_THREAD_COMMENTS_LIST: (\n list: ReactNode,\n room: ReactNode\n ) => (\n <>\n {list} commented\n {room ? <> in {room}</> : <> in a thread</>}\n </>\n ),\n INBOX_NOTIFICATION_THREAD_MENTION: (user: ReactNode, room: ReactNode) => (\n <>\n {user} mentioned you{room ? <> in {room}</> : null}\n </>\n ),\n};\n\nexport const OverridesContext = createContext<Overrides | undefined>(undefined);\n\nexport function useOverrides(overrides?: Partial<Overrides>): Overrides {\n const contextOverrides = useContext(OverridesContext);\n\n return useMemo(\n () => ({\n ...defaultOverrides,\n ...contextOverrides,\n ...overrides,\n }),\n [contextOverrides, overrides]\n );\n}\n\nexport function OverridesProvider({\n children,\n overrides: providerOverrides,\n}: OverridesProviderProps) {\n const contextOverrides = useContext(OverridesContext);\n const overrides = useMemo(\n () => ({\n ...defaultOverrides,\n ...contextOverrides,\n ...providerOverrides,\n }),\n [contextOverrides, providerOverrides]\n );\n\n return (\n <OverridesContext.Provider value={overrides}>\n {children}\n </OverridesContext.Provider>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"overrides.js","sources":["../src/overrides.tsx"],"sourcesContent":["\"use client\";\n\nimport type { PropsWithChildren, ReactNode } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\nimport * as React from \"react\";\n\nimport { Emoji } from \"./components/internal/Emoji\";\nimport type { Direction } from \"./types\";\nimport { pluralize } from \"./utils/pluralize\";\n\nexport interface LocalizationOverrides {\n locale: string;\n dir: Direction;\n}\n\nexport interface GlobalOverrides {\n USER_SELF: string;\n USER_UNKNOWN: string;\n LIST_REMAINING: (count: number) => string;\n LIST_REMAINING_USERS: (count: number) => string;\n LIST_REMAINING_COMMENTS: (count: number) => string;\n EMOJI_PICKER_SEARCH_PLACEHOLDER: string;\n EMOJI_PICKER_EMPTY: ReactNode;\n EMOJI_PICKER_ERROR: (error: Error) => ReactNode;\n}\n\nexport interface CommentOverrides {\n COMMENT_EDITED: ReactNode;\n COMMENT_DELETED: ReactNode;\n COMMENT_MORE: string;\n COMMENT_EDIT: string;\n COMMENT_EDIT_COMPOSER_PLACEHOLDER: string;\n COMMENT_EDIT_COMPOSER_CANCEL: string;\n COMMENT_EDIT_COMPOSER_SAVE: string;\n COMMENT_DELETE: string;\n COMMENT_ADD_REACTION: string;\n COMMENT_REACTION_LIST: (\n list: ReactNode,\n emoji: string,\n count: number\n ) => ReactNode;\n COMMENT_REACTION_DESCRIPTION: (emoji: string, count: number) => string;\n}\n\nexport interface ComposerOverrides {\n COMPOSER_INSERT_MENTION: string;\n COMPOSER_INSERT_EMOJI: string;\n COMPOSER_PLACEHOLDER: string;\n COMPOSER_SEND: string;\n}\n\nexport interface ThreadOverrides {\n THREAD_RESOLVE: string;\n THREAD_UNRESOLVE: string;\n THREAD_NEW_INDICATOR: string;\n THREAD_NEW_INDICATOR_DESCRIPTION: string;\n THREAD_COMPOSER_PLACEHOLDER: string;\n THREAD_COMPOSER_SEND: string;\n}\n\nexport interface InboxNotificationOverrides {\n INBOX_NOTIFICATION_MORE: string;\n INBOX_NOTIFICATION_MARK_AS_READ: string;\n INBOX_NOTIFICATION_THREAD_COMMENTS_LIST: (\n list: ReactNode,\n room: ReactNode | undefined,\n count: number\n ) => ReactNode;\n INBOX_NOTIFICATION_THREAD_MENTION: (\n user: ReactNode,\n room: ReactNode | undefined\n ) => ReactNode;\n INBOX_NOTIFICATION_TEXT_MENTION: (\n user: ReactNode,\n room: ReactNode | undefined\n ) => ReactNode;\n}\n\nexport type Overrides = LocalizationOverrides &\n GlobalOverrides &\n ComposerOverrides &\n CommentOverrides &\n ThreadOverrides &\n InboxNotificationOverrides;\n\ntype OverridesProviderProps = PropsWithChildren<{\n overrides?: Partial<Overrides>;\n}>;\n\nexport const defaultOverrides: Overrides = {\n locale: \"en\",\n dir: \"ltr\",\n USER_SELF: \"you\",\n USER_UNKNOWN: \"Anonymous\",\n LIST_REMAINING: (count) => `${count} more`,\n LIST_REMAINING_USERS: (count) => `${count} ${pluralize(count, \"other\")}`,\n LIST_REMAINING_COMMENTS: (count) =>\n `${count} more ${pluralize(count, \"comment\")}`,\n EMOJI_PICKER_SEARCH_PLACEHOLDER: \"Search…\",\n EMOJI_PICKER_EMPTY: \"No emoji found.\",\n EMOJI_PICKER_ERROR: () =>\n \"There was an error while getting the list of emoji.\",\n COMPOSER_INSERT_MENTION: \"Mention someone\",\n COMPOSER_INSERT_EMOJI: \"Add emoji\",\n COMPOSER_PLACEHOLDER: \"Write a comment…\",\n COMPOSER_SEND: \"Send\",\n COMMENT_EDITED: \"(edited)\",\n COMMENT_DELETED: \"This comment has been deleted.\",\n COMMENT_MORE: \"More\",\n COMMENT_EDIT: \"Edit comment\",\n COMMENT_EDIT_COMPOSER_PLACEHOLDER: \"Edit comment…\",\n COMMENT_EDIT_COMPOSER_CANCEL: \"Cancel\",\n COMMENT_EDIT_COMPOSER_SAVE: \"Save\",\n COMMENT_DELETE: \"Delete comment\",\n COMMENT_ADD_REACTION: \"Add reaction\",\n COMMENT_REACTION_LIST: (list, emoji) => (\n <>\n {list} reacted with <Emoji emoji={emoji} />\n </>\n ),\n COMMENT_REACTION_DESCRIPTION: (emoji, count) =>\n `${count} ${pluralize(count, \"reaction\")}, react with ${emoji}`,\n THREAD_RESOLVE: \"Resolve thread\",\n THREAD_UNRESOLVE: \"Re-open thread\",\n THREAD_NEW_INDICATOR: \"New\",\n THREAD_NEW_INDICATOR_DESCRIPTION: \"New comments\",\n THREAD_COMPOSER_PLACEHOLDER: \"Reply to thread…\",\n THREAD_COMPOSER_SEND: \"Reply\",\n INBOX_NOTIFICATION_MORE: \"More\",\n INBOX_NOTIFICATION_MARK_AS_READ: \"Mark as read\",\n INBOX_NOTIFICATION_THREAD_COMMENTS_LIST: (\n list: ReactNode,\n room: ReactNode\n ) => (\n <>\n {list} commented\n {room ? <> in {room}</> : <> in a thread</>}\n </>\n ),\n INBOX_NOTIFICATION_THREAD_MENTION: (user: ReactNode, room: ReactNode) => (\n <>\n {user} mentioned you{room ? <> in {room}</> : null}\n </>\n ),\n INBOX_NOTIFICATION_TEXT_MENTION: (user: ReactNode, room: ReactNode) => (\n <>\n {user} mentioned you{room ? <> in {room}</> : null}\n </>\n ),\n};\n\nexport const OverridesContext = createContext<Overrides | undefined>(undefined);\n\nexport function useOverrides(overrides?: Partial<Overrides>): Overrides {\n const contextOverrides = useContext(OverridesContext);\n\n return useMemo(\n () => ({\n ...defaultOverrides,\n ...contextOverrides,\n ...overrides,\n }),\n [contextOverrides, overrides]\n );\n}\n\nexport function OverridesProvider({\n children,\n overrides: providerOverrides,\n}: OverridesProviderProps) {\n const contextOverrides = useContext(OverridesContext);\n const overrides = useMemo(\n () => ({\n ...defaultOverrides,\n ...contextOverrides,\n ...providerOverrides,\n }),\n [contextOverrides, providerOverrides]\n );\n\n return (\n <OverridesContext.Provider value={overrides}>\n {children}\n </OverridesContext.Provider>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAyFO;AAAoC;AACjC;AACH;AACM;AACG;AACgB;AACuC;AAExB;AACZ;AACb;AAElB;AACuB;AACF;AACD;AACP;AACC;AACC;AACH;AACA;AACqB;AACL;AACF;AACZ;AACM;AAGG;AAAM;AAC7B;AAGwD;AAC1C;AACE;AACI;AACY;AACL;AACP;AACG;AACQ;AAQ/B;AAKA;AAOJ;AAEa;AAEN;AACL;AAEA;AAAO;AACE;AACF;AACA;AACA;AACL;AAC4B;AAEhC;AAEO;AAA2B;AAChC;AAEF;AACE;AACA;AAAkB;AACT;AACF;AACA;AACA;AACL;AACoC;AAGtC;AACG;AAAiC;AAItC;;;;;"}
|
package/dist/overrides.mjs
CHANGED
|
@@ -41,7 +41,8 @@ const defaultOverrides = {
|
|
|
41
41
|
INBOX_NOTIFICATION_MORE: "More",
|
|
42
42
|
INBOX_NOTIFICATION_MARK_AS_READ: "Mark as read",
|
|
43
43
|
INBOX_NOTIFICATION_THREAD_COMMENTS_LIST: (list, room) => /* @__PURE__ */ React.createElement(React.Fragment, null, list, " commented", room ? /* @__PURE__ */ React.createElement(React.Fragment, null, " in ", room) : /* @__PURE__ */ React.createElement(React.Fragment, null, " in a thread")),
|
|
44
|
-
INBOX_NOTIFICATION_THREAD_MENTION: (user, room) => /* @__PURE__ */ React.createElement(React.Fragment, null, user, " mentioned you", room ? /* @__PURE__ */ React.createElement(React.Fragment, null, " in ", room) : null)
|
|
44
|
+
INBOX_NOTIFICATION_THREAD_MENTION: (user, room) => /* @__PURE__ */ React.createElement(React.Fragment, null, user, " mentioned you", room ? /* @__PURE__ */ React.createElement(React.Fragment, null, " in ", room) : null),
|
|
45
|
+
INBOX_NOTIFICATION_TEXT_MENTION: (user, room) => /* @__PURE__ */ React.createElement(React.Fragment, null, user, " mentioned you", room ? /* @__PURE__ */ React.createElement(React.Fragment, null, " in ", room) : null)
|
|
45
46
|
};
|
|
46
47
|
const OverridesContext = createContext(void 0);
|
|
47
48
|
function useOverrides(overrides) {
|
package/dist/overrides.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overrides.mjs","sources":["../src/overrides.tsx"],"sourcesContent":["\"use client\";\n\nimport type { PropsWithChildren, ReactNode } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\nimport * as React from \"react\";\n\nimport { Emoji } from \"./components/internal/Emoji\";\nimport type { Direction } from \"./types\";\nimport { pluralize } from \"./utils/pluralize\";\n\nexport interface LocalizationOverrides {\n locale: string;\n dir: Direction;\n}\n\nexport interface GlobalOverrides {\n USER_SELF: string;\n USER_UNKNOWN: string;\n LIST_REMAINING: (count: number) => string;\n LIST_REMAINING_USERS: (count: number) => string;\n LIST_REMAINING_COMMENTS: (count: number) => string;\n EMOJI_PICKER_SEARCH_PLACEHOLDER: string;\n EMOJI_PICKER_EMPTY: ReactNode;\n EMOJI_PICKER_ERROR: (error: Error) => ReactNode;\n}\n\nexport interface CommentOverrides {\n COMMENT_EDITED: ReactNode;\n COMMENT_DELETED: ReactNode;\n COMMENT_MORE: string;\n COMMENT_EDIT: string;\n COMMENT_EDIT_COMPOSER_PLACEHOLDER: string;\n COMMENT_EDIT_COMPOSER_CANCEL: string;\n COMMENT_EDIT_COMPOSER_SAVE: string;\n COMMENT_DELETE: string;\n COMMENT_ADD_REACTION: string;\n COMMENT_REACTION_LIST: (\n list: ReactNode,\n emoji: string,\n count: number\n ) => ReactNode;\n COMMENT_REACTION_DESCRIPTION: (emoji: string, count: number) => string;\n}\n\nexport interface ComposerOverrides {\n COMPOSER_INSERT_MENTION: string;\n COMPOSER_INSERT_EMOJI: string;\n COMPOSER_PLACEHOLDER: string;\n COMPOSER_SEND: string;\n}\n\nexport interface ThreadOverrides {\n THREAD_RESOLVE: string;\n THREAD_UNRESOLVE: string;\n THREAD_NEW_INDICATOR: string;\n THREAD_NEW_INDICATOR_DESCRIPTION: string;\n THREAD_COMPOSER_PLACEHOLDER: string;\n THREAD_COMPOSER_SEND: string;\n}\n\nexport interface InboxNotificationOverrides {\n INBOX_NOTIFICATION_MORE: string;\n INBOX_NOTIFICATION_MARK_AS_READ: string;\n INBOX_NOTIFICATION_THREAD_COMMENTS_LIST: (\n list: ReactNode,\n room: ReactNode | undefined,\n count: number\n ) => ReactNode;\n INBOX_NOTIFICATION_THREAD_MENTION: (\n user: ReactNode,\n room: ReactNode | undefined\n ) => ReactNode;\n}\n\nexport type Overrides = LocalizationOverrides &\n GlobalOverrides &\n ComposerOverrides &\n CommentOverrides &\n ThreadOverrides &\n InboxNotificationOverrides;\n\ntype OverridesProviderProps = PropsWithChildren<{\n overrides?: Partial<Overrides>;\n}>;\n\nexport const defaultOverrides: Overrides = {\n locale: \"en\",\n dir: \"ltr\",\n USER_SELF: \"you\",\n USER_UNKNOWN: \"Anonymous\",\n LIST_REMAINING: (count) => `${count} more`,\n LIST_REMAINING_USERS: (count) => `${count} ${pluralize(count, \"other\")}`,\n LIST_REMAINING_COMMENTS: (count) =>\n `${count} more ${pluralize(count, \"comment\")}`,\n EMOJI_PICKER_SEARCH_PLACEHOLDER: \"Search…\",\n EMOJI_PICKER_EMPTY: \"No emoji found.\",\n EMOJI_PICKER_ERROR: () =>\n \"There was an error while getting the list of emoji.\",\n COMPOSER_INSERT_MENTION: \"Mention someone\",\n COMPOSER_INSERT_EMOJI: \"Add emoji\",\n COMPOSER_PLACEHOLDER: \"Write a comment…\",\n COMPOSER_SEND: \"Send\",\n COMMENT_EDITED: \"(edited)\",\n COMMENT_DELETED: \"This comment has been deleted.\",\n COMMENT_MORE: \"More\",\n COMMENT_EDIT: \"Edit comment\",\n COMMENT_EDIT_COMPOSER_PLACEHOLDER: \"Edit comment…\",\n COMMENT_EDIT_COMPOSER_CANCEL: \"Cancel\",\n COMMENT_EDIT_COMPOSER_SAVE: \"Save\",\n COMMENT_DELETE: \"Delete comment\",\n COMMENT_ADD_REACTION: \"Add reaction\",\n COMMENT_REACTION_LIST: (list, emoji) => (\n <>\n {list} reacted with <Emoji emoji={emoji} />\n </>\n ),\n COMMENT_REACTION_DESCRIPTION: (emoji, count) =>\n `${count} ${pluralize(count, \"reaction\")}, react with ${emoji}`,\n THREAD_RESOLVE: \"Resolve thread\",\n THREAD_UNRESOLVE: \"Re-open thread\",\n THREAD_NEW_INDICATOR: \"New\",\n THREAD_NEW_INDICATOR_DESCRIPTION: \"New comments\",\n THREAD_COMPOSER_PLACEHOLDER: \"Reply to thread…\",\n THREAD_COMPOSER_SEND: \"Reply\",\n INBOX_NOTIFICATION_MORE: \"More\",\n INBOX_NOTIFICATION_MARK_AS_READ: \"Mark as read\",\n INBOX_NOTIFICATION_THREAD_COMMENTS_LIST: (\n list: ReactNode,\n room: ReactNode\n ) => (\n <>\n {list} commented\n {room ? <> in {room}</> : <> in a thread</>}\n </>\n ),\n INBOX_NOTIFICATION_THREAD_MENTION: (user: ReactNode, room: ReactNode) => (\n <>\n {user} mentioned you{room ? <> in {room}</> : null}\n </>\n ),\n};\n\nexport const OverridesContext = createContext<Overrides | undefined>(undefined);\n\nexport function useOverrides(overrides?: Partial<Overrides>): Overrides {\n const contextOverrides = useContext(OverridesContext);\n\n return useMemo(\n () => ({\n ...defaultOverrides,\n ...contextOverrides,\n ...overrides,\n }),\n [contextOverrides, overrides]\n );\n}\n\nexport function OverridesProvider({\n children,\n overrides: providerOverrides,\n}: OverridesProviderProps) {\n const contextOverrides = useContext(OverridesContext);\n const overrides = useMemo(\n () => ({\n ...defaultOverrides,\n ...contextOverrides,\n ...providerOverrides,\n }),\n [contextOverrides, providerOverrides]\n );\n\n return (\n <OverridesContext.Provider value={overrides}>\n {children}\n </OverridesContext.Provider>\n );\n}\n"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"overrides.mjs","sources":["../src/overrides.tsx"],"sourcesContent":["\"use client\";\n\nimport type { PropsWithChildren, ReactNode } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\nimport * as React from \"react\";\n\nimport { Emoji } from \"./components/internal/Emoji\";\nimport type { Direction } from \"./types\";\nimport { pluralize } from \"./utils/pluralize\";\n\nexport interface LocalizationOverrides {\n locale: string;\n dir: Direction;\n}\n\nexport interface GlobalOverrides {\n USER_SELF: string;\n USER_UNKNOWN: string;\n LIST_REMAINING: (count: number) => string;\n LIST_REMAINING_USERS: (count: number) => string;\n LIST_REMAINING_COMMENTS: (count: number) => string;\n EMOJI_PICKER_SEARCH_PLACEHOLDER: string;\n EMOJI_PICKER_EMPTY: ReactNode;\n EMOJI_PICKER_ERROR: (error: Error) => ReactNode;\n}\n\nexport interface CommentOverrides {\n COMMENT_EDITED: ReactNode;\n COMMENT_DELETED: ReactNode;\n COMMENT_MORE: string;\n COMMENT_EDIT: string;\n COMMENT_EDIT_COMPOSER_PLACEHOLDER: string;\n COMMENT_EDIT_COMPOSER_CANCEL: string;\n COMMENT_EDIT_COMPOSER_SAVE: string;\n COMMENT_DELETE: string;\n COMMENT_ADD_REACTION: string;\n COMMENT_REACTION_LIST: (\n list: ReactNode,\n emoji: string,\n count: number\n ) => ReactNode;\n COMMENT_REACTION_DESCRIPTION: (emoji: string, count: number) => string;\n}\n\nexport interface ComposerOverrides {\n COMPOSER_INSERT_MENTION: string;\n COMPOSER_INSERT_EMOJI: string;\n COMPOSER_PLACEHOLDER: string;\n COMPOSER_SEND: string;\n}\n\nexport interface ThreadOverrides {\n THREAD_RESOLVE: string;\n THREAD_UNRESOLVE: string;\n THREAD_NEW_INDICATOR: string;\n THREAD_NEW_INDICATOR_DESCRIPTION: string;\n THREAD_COMPOSER_PLACEHOLDER: string;\n THREAD_COMPOSER_SEND: string;\n}\n\nexport interface InboxNotificationOverrides {\n INBOX_NOTIFICATION_MORE: string;\n INBOX_NOTIFICATION_MARK_AS_READ: string;\n INBOX_NOTIFICATION_THREAD_COMMENTS_LIST: (\n list: ReactNode,\n room: ReactNode | undefined,\n count: number\n ) => ReactNode;\n INBOX_NOTIFICATION_THREAD_MENTION: (\n user: ReactNode,\n room: ReactNode | undefined\n ) => ReactNode;\n INBOX_NOTIFICATION_TEXT_MENTION: (\n user: ReactNode,\n room: ReactNode | undefined\n ) => ReactNode;\n}\n\nexport type Overrides = LocalizationOverrides &\n GlobalOverrides &\n ComposerOverrides &\n CommentOverrides &\n ThreadOverrides &\n InboxNotificationOverrides;\n\ntype OverridesProviderProps = PropsWithChildren<{\n overrides?: Partial<Overrides>;\n}>;\n\nexport const defaultOverrides: Overrides = {\n locale: \"en\",\n dir: \"ltr\",\n USER_SELF: \"you\",\n USER_UNKNOWN: \"Anonymous\",\n LIST_REMAINING: (count) => `${count} more`,\n LIST_REMAINING_USERS: (count) => `${count} ${pluralize(count, \"other\")}`,\n LIST_REMAINING_COMMENTS: (count) =>\n `${count} more ${pluralize(count, \"comment\")}`,\n EMOJI_PICKER_SEARCH_PLACEHOLDER: \"Search…\",\n EMOJI_PICKER_EMPTY: \"No emoji found.\",\n EMOJI_PICKER_ERROR: () =>\n \"There was an error while getting the list of emoji.\",\n COMPOSER_INSERT_MENTION: \"Mention someone\",\n COMPOSER_INSERT_EMOJI: \"Add emoji\",\n COMPOSER_PLACEHOLDER: \"Write a comment…\",\n COMPOSER_SEND: \"Send\",\n COMMENT_EDITED: \"(edited)\",\n COMMENT_DELETED: \"This comment has been deleted.\",\n COMMENT_MORE: \"More\",\n COMMENT_EDIT: \"Edit comment\",\n COMMENT_EDIT_COMPOSER_PLACEHOLDER: \"Edit comment…\",\n COMMENT_EDIT_COMPOSER_CANCEL: \"Cancel\",\n COMMENT_EDIT_COMPOSER_SAVE: \"Save\",\n COMMENT_DELETE: \"Delete comment\",\n COMMENT_ADD_REACTION: \"Add reaction\",\n COMMENT_REACTION_LIST: (list, emoji) => (\n <>\n {list} reacted with <Emoji emoji={emoji} />\n </>\n ),\n COMMENT_REACTION_DESCRIPTION: (emoji, count) =>\n `${count} ${pluralize(count, \"reaction\")}, react with ${emoji}`,\n THREAD_RESOLVE: \"Resolve thread\",\n THREAD_UNRESOLVE: \"Re-open thread\",\n THREAD_NEW_INDICATOR: \"New\",\n THREAD_NEW_INDICATOR_DESCRIPTION: \"New comments\",\n THREAD_COMPOSER_PLACEHOLDER: \"Reply to thread…\",\n THREAD_COMPOSER_SEND: \"Reply\",\n INBOX_NOTIFICATION_MORE: \"More\",\n INBOX_NOTIFICATION_MARK_AS_READ: \"Mark as read\",\n INBOX_NOTIFICATION_THREAD_COMMENTS_LIST: (\n list: ReactNode,\n room: ReactNode\n ) => (\n <>\n {list} commented\n {room ? <> in {room}</> : <> in a thread</>}\n </>\n ),\n INBOX_NOTIFICATION_THREAD_MENTION: (user: ReactNode, room: ReactNode) => (\n <>\n {user} mentioned you{room ? <> in {room}</> : null}\n </>\n ),\n INBOX_NOTIFICATION_TEXT_MENTION: (user: ReactNode, room: ReactNode) => (\n <>\n {user} mentioned you{room ? <> in {room}</> : null}\n </>\n ),\n};\n\nexport const OverridesContext = createContext<Overrides | undefined>(undefined);\n\nexport function useOverrides(overrides?: Partial<Overrides>): Overrides {\n const contextOverrides = useContext(OverridesContext);\n\n return useMemo(\n () => ({\n ...defaultOverrides,\n ...contextOverrides,\n ...overrides,\n }),\n [contextOverrides, overrides]\n );\n}\n\nexport function OverridesProvider({\n children,\n overrides: providerOverrides,\n}: OverridesProviderProps) {\n const contextOverrides = useContext(OverridesContext);\n const overrides = useMemo(\n () => ({\n ...defaultOverrides,\n ...contextOverrides,\n ...providerOverrides,\n }),\n [contextOverrides, providerOverrides]\n );\n\n return (\n <OverridesContext.Provider value={overrides}>\n {children}\n </OverridesContext.Provider>\n );\n}\n"],"names":[],"mappings":";;;;;;AAyFO;AAAoC;AACjC;AACH;AACM;AACG;AACgB;AACuC;AAExB;AACZ;AACb;AAElB;AACuB;AACF;AACD;AACP;AACC;AACC;AACH;AACA;AACqB;AACL;AACF;AACZ;AACM;AAGG;AAAM;AAC7B;AAGwD;AAC1C;AACE;AACI;AACY;AACL;AACP;AACG;AACQ;AAQ/B;AAKA;AAOJ;AAEa;AAEN;AACL;AAEA;AAAO;AACE;AACF;AACA;AACA;AACL;AAC4B;AAEhC;AAEO;AAA2B;AAChC;AAEF;AACE;AACA;AAAkB;AACT;AACF;AACA;AACA;AACL;AACoC;AAGtC;AACG;AAAiC;AAItC;;"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var reactDom = require('@floating-ui/react-dom');
|
|
5
|
-
var core = require('@liveblocks/core');
|
|
6
5
|
var react = require('@liveblocks/react');
|
|
7
6
|
var reactSlot = require('@radix-ui/react-slot');
|
|
8
7
|
var React = require('react');
|
|
@@ -11,6 +10,7 @@ var slateHistory = require('slate-history');
|
|
|
11
10
|
var slateReact = require('slate-react');
|
|
12
11
|
var config = require('../../config.js');
|
|
13
12
|
var constants = require('../../constants.js');
|
|
13
|
+
var shared = require('../../shared.js');
|
|
14
14
|
var autoFormatting = require('../../slate/plugins/auto-formatting.js');
|
|
15
15
|
var autoLinks = require('../../slate/plugins/auto-links.js');
|
|
16
16
|
var emptyClearFormatting = require('../../slate/plugins/empty-clear-formatting.js');
|
|
@@ -383,11 +383,7 @@ const ComposerEditor = React.forwardRef(
|
|
|
383
383
|
dir,
|
|
384
384
|
...props
|
|
385
385
|
}, forwardedRef) => {
|
|
386
|
-
const
|
|
387
|
-
[core.kInternal]: { useMentionSuggestions },
|
|
388
|
-
useSelf
|
|
389
|
-
} = react.useRoomContextBundle();
|
|
390
|
-
const self = useSelf();
|
|
386
|
+
const self = react.useSelf();
|
|
391
387
|
const isDisabled = React.useMemo(
|
|
392
388
|
() => disabled || !self?.canComment,
|
|
393
389
|
[disabled, self?.canComment]
|
|
@@ -403,7 +399,7 @@ const ComposerEditor = React.forwardRef(
|
|
|
403
399
|
[components]
|
|
404
400
|
);
|
|
405
401
|
const [mentionDraft, setMentionDraft] = React.useState();
|
|
406
|
-
const mentionSuggestions = useMentionSuggestions(mentionDraft?.text);
|
|
402
|
+
const mentionSuggestions = shared.useMentionSuggestions(mentionDraft?.text);
|
|
407
403
|
const [
|
|
408
404
|
selectedMentionSuggestionIndex,
|
|
409
405
|
setPreviousSelectedMentionSuggestionIndex,
|
|
@@ -734,9 +730,8 @@ const ComposerForm = React.forwardRef(
|
|
|
734
730
|
const ComposerSubmit = React.forwardRef(
|
|
735
731
|
({ children, disabled, asChild, ...props }, forwardedRef) => {
|
|
736
732
|
const Component = asChild ? reactSlot.Slot : "button";
|
|
737
|
-
const { useSelf } = react.useRoomContextBundle();
|
|
738
733
|
const { isEmpty } = contexts.useComposer();
|
|
739
|
-
const self = useSelf();
|
|
734
|
+
const self = react.useSelf();
|
|
740
735
|
const isDisabled = React.useMemo(
|
|
741
736
|
() => disabled || isEmpty || !self?.canComment,
|
|
742
737
|
[disabled, isEmpty, self?.canComment]
|