@blocklet/discuss-kit-ux 1.6.222 → 1.6.223
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/avatars/author-info.d.ts +2 -1
- package/dist/components/chat/chat-client.d.ts +11 -0
- package/dist/components/chat/chat-in-wallet.d.ts +7 -0
- package/dist/components/chat/chat-list-in-wallet.d.ts +7 -0
- package/dist/components/chat/chat-list.d.ts +2 -1
- package/dist/components/chat/chat-room.d.ts +2 -1
- package/dist/components/chat/context.d.ts +5 -2
- package/dist/components/chat/index.d.ts +2 -0
- package/dist/components/chat/user-search.d.ts +7 -0
- package/dist/{editor-Bv0IhrR_.mjs → editor-xw6iQCuH.mjs} +1 -1
- package/dist/{index-BHZcv0rr.mjs → index-BYwPg7XF.mjs} +370 -69
- package/dist/index.es.js +35 -33
- package/dist/index.umd.js +335 -35
- package/package.json +7 -6
|
@@ -12,6 +12,7 @@ interface Props {
|
|
|
12
12
|
showDID?: boolean;
|
|
13
13
|
profileUse?: boolean;
|
|
14
14
|
children?: React.ReactNode;
|
|
15
|
+
linkToProfile?: boolean;
|
|
15
16
|
}
|
|
16
|
-
export default function AuthorInfo({ user, createdAt, append, size, responsive, showProfileCard, showBadge, showDID, newTitle, profileUse, children, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default function AuthorInfo({ user, createdAt, append, size, responsive, showProfileCard, showBadge, showDID, newTitle, profileUse, children, linkToProfile, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
export {};
|
|
@@ -24,6 +24,9 @@ type Events = {
|
|
|
24
24
|
deleteChannel: {
|
|
25
25
|
chatId: string;
|
|
26
26
|
};
|
|
27
|
+
updateLastAckTime: {
|
|
28
|
+
chatId: string;
|
|
29
|
+
};
|
|
27
30
|
};
|
|
28
31
|
interface FetchChatResponse {
|
|
29
32
|
chat: Chat;
|
|
@@ -56,6 +59,9 @@ export default abstract class ChatClient {
|
|
|
56
59
|
onDeleteChannel(callback: (payload: {
|
|
57
60
|
chatId: string;
|
|
58
61
|
}) => void): () => void;
|
|
62
|
+
onUpdateLastAckTime(callback: (payload: {
|
|
63
|
+
chatId: string;
|
|
64
|
+
}) => void): () => void;
|
|
59
65
|
abstract fetchChats: () => Promise<Chat[]>;
|
|
60
66
|
abstract fetchChat: (chatId: string) => Promise<FetchChatResponse>;
|
|
61
67
|
abstract fetchMessages: (chatId: string, cursor?: string) => Promise<{
|
|
@@ -69,5 +75,10 @@ export default abstract class ChatClient {
|
|
|
69
75
|
abstract deleteChannel: (chatId: string) => Promise<void>;
|
|
70
76
|
abstract updateLastAckTime: (chatId: string) => Promise<void>;
|
|
71
77
|
abstract deleteMessage: (messageId: string) => Promise<void>;
|
|
78
|
+
abstract searchUsers: ({ search, dids }: {
|
|
79
|
+
search?: string | null;
|
|
80
|
+
dids?: string[];
|
|
81
|
+
}) => Promise<User[]>;
|
|
82
|
+
abstract createDM: (oppositeUserDid: string) => Promise<Chat>;
|
|
72
83
|
}
|
|
73
84
|
export {};
|
|
@@ -2,6 +2,7 @@ import { SxProps } from '@mui/material';
|
|
|
2
2
|
|
|
3
3
|
interface Props {
|
|
4
4
|
sx?: SxProps;
|
|
5
|
+
inWallet?: boolean;
|
|
5
6
|
}
|
|
6
|
-
export default function ChatList(
|
|
7
|
+
export default function ChatList({ inWallet, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -2,6 +2,7 @@ import { Chat } from './types';
|
|
|
2
2
|
|
|
3
3
|
interface ChatProps {
|
|
4
4
|
chat: Chat;
|
|
5
|
+
inWallet: boolean;
|
|
5
6
|
}
|
|
6
|
-
export default function ChatRoom({ chat, ...rest }: ChatProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default function ChatRoom({ chat, inWallet, ...rest }: ChatProps): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -6,6 +6,7 @@ export interface ChatProviderProps {
|
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
client: ChatClient;
|
|
8
8
|
activeChatId?: string | null;
|
|
9
|
+
isInWallet: boolean;
|
|
9
10
|
}
|
|
10
11
|
interface ChatState {
|
|
11
12
|
initialized: boolean;
|
|
@@ -16,6 +17,7 @@ interface ChatState {
|
|
|
16
17
|
interface ChatContextValue extends ChatState {
|
|
17
18
|
client: ChatClient;
|
|
18
19
|
setActiveChat: (chat: ChatType | null) => void;
|
|
20
|
+
setActiveChatInWallet: (chat: ChatType | null) => void;
|
|
19
21
|
isActiveChat: (chatId: string) => boolean;
|
|
20
22
|
getOppositeUser: (chat: ChatType) => User | null;
|
|
21
23
|
loadMessages: (chatId: string, cursor?: string) => Promise<void>;
|
|
@@ -27,10 +29,11 @@ interface ChatContextValue extends ChatState {
|
|
|
27
29
|
deleteChannel: (chatId: string) => Promise<void>;
|
|
28
30
|
hasUnreadMessages: (chat: ChatType) => boolean;
|
|
29
31
|
deleteMessage: (chatId: string, messageId: string) => Promise<void>;
|
|
30
|
-
|
|
32
|
+
createDM: (oppositeUserDid: string) => Promise<ChatType>;
|
|
31
33
|
orderedChats: ChatType[];
|
|
32
34
|
getLastMessageText: (chat: ChatType) => string;
|
|
35
|
+
isInWallet: boolean;
|
|
33
36
|
}
|
|
34
37
|
export declare const useChatContext: () => ChatContextValue;
|
|
35
|
-
export declare function ChatProvider({ client, activeChatId, children }: ChatProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare function ChatProvider({ client, activeChatId, children, isInWallet }: ChatProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
36
39
|
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { default as ChatClient } from './chat-client';
|
|
2
2
|
export { default as Chat } from './chat';
|
|
3
|
+
export { default as ChatInWallet } from './chat-in-wallet';
|
|
4
|
+
export { default as ChatListInWallet } from './chat-list-in-wallet';
|
|
3
5
|
export { default as ChatHeaderAddon } from './chat-header-addon';
|
|
4
6
|
export * from './context';
|
|
5
7
|
export * from './unread-notification';
|
|
@@ -4,7 +4,7 @@ import { OnContentChangePlugin } from "@blocklet/editor/lib/ext/OnContentChangeP
|
|
|
4
4
|
import { CtrlsShortcutPlugin } from "@blocklet/editor/lib/ext/ShortcutPlugin";
|
|
5
5
|
import { SafeAreaPlugin } from "@blocklet/editor/lib/ext/SafeAreaPlugin";
|
|
6
6
|
import { lazy } from "react";
|
|
7
|
-
import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-
|
|
7
|
+
import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-BYwPg7XF.mjs";
|
|
8
8
|
const BlockletEditor = lazy(() => import("@blocklet/editor"));
|
|
9
9
|
const Root = styled(Box)`
|
|
10
10
|
.be-editable,
|