@medipha/chat 1.0.42 → 1.0.44
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/README.md +4 -0
- package/dist/features/pinned-messages/pinned-messages-bar.d.ts +2 -1
- package/dist/features/pinned-messages/pinned-preview.d.ts +2 -0
- package/dist/index.cjs +47 -47
- package/dist/index.js +11733 -11442
- package/dist/module/chat-module.types.d.ts +2 -1
- package/dist/module/navigation/chat-navigation-context.d.ts +1 -0
- package/dist/module/session/chat-session.d.ts +3 -1
- package/dist/module/widget/chat-widget.types.d.ts +4 -0
- package/dist/module/widget/use-widget-window-capacity.d.ts +1 -0
- package/dist/module/widget/widget-chat-navigation.d.ts +12 -4
- package/dist/module/widget/widget-chat-shell.d.ts +17 -0
- package/dist/module/widget/widget-conversation-window.d.ts +15 -0
- package/dist/pages/Setting/board/conversation-board-modal.d.ts +9 -0
- package/dist/pages/Setting/index.d.ts +0 -9
- package/dist/pages/conversation/index.d.ts +1 -0
- package/dist/pages/sidebar/sidbar-conversation-list/sidbar-conversation-list.d.ts +2 -1
- package/dist/store/boardModalStore.d.ts +7 -0
- package/dist/store/pinnedMessagesStore.d.ts +0 -5
- package/dist/styles.css +1 -1
- package/dist/utils/chat.d.ts +1 -0
- package/package.json +2 -2
- package/dist/module/widget/widget-conversation-screen.d.ts +0 -10
|
@@ -4,9 +4,10 @@ export interface ChatModuleProps {
|
|
|
4
4
|
hasDeleteGroupVerified: boolean;
|
|
5
5
|
userId: string;
|
|
6
6
|
accessToken: string;
|
|
7
|
+
expireTime: string | number;
|
|
7
8
|
apiUrl: string;
|
|
8
9
|
socketUrl: string;
|
|
9
10
|
onUnauthorized?: () => void;
|
|
10
|
-
onRefreshToken?: () =>
|
|
11
|
+
onRefreshToken?: () => Promise<string>;
|
|
11
12
|
onNavigateOutsideChat?: (path: string) => void;
|
|
12
13
|
}
|
|
@@ -8,6 +8,7 @@ export interface CloseConversationOptions {
|
|
|
8
8
|
}
|
|
9
9
|
export interface ChatNavigation {
|
|
10
10
|
activeConversationId: string | undefined;
|
|
11
|
+
openConversationIds?: readonly string[];
|
|
11
12
|
openConversation: (conversationId: string, options?: OpenConversationOptions) => void;
|
|
12
13
|
closeConversation: (options?: CloseConversationOptions) => void;
|
|
13
14
|
buildConversationPath?: (conversationId: string) => string;
|
|
@@ -3,7 +3,9 @@ export interface ChatSessionConfig {
|
|
|
3
3
|
apiUrl: string;
|
|
4
4
|
socketUrl: string;
|
|
5
5
|
userId: string;
|
|
6
|
+
onRefreshToken?: () => Promise<string>;
|
|
7
|
+
onUnauthorized?: () => void;
|
|
6
8
|
}
|
|
7
9
|
export declare function configureChatTransport(config: ChatSessionConfig): void;
|
|
8
10
|
export declare function acquireChatSession(config: ChatSessionConfig): () => void;
|
|
9
|
-
export declare function useChatSession(
|
|
11
|
+
export declare function useChatSession(config: ChatSessionConfig): void;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { ChatModuleProps } from '../chat-module.types';
|
|
2
|
+
export interface WidgetFocusRequest {
|
|
3
|
+
conversationId: string;
|
|
4
|
+
nonce: number;
|
|
5
|
+
}
|
|
2
6
|
export interface ChatWidgetProps extends ChatModuleProps {
|
|
3
7
|
/** Whether the host is currently showing the widget. Keep the widget mounted while this
|
|
4
8
|
* is false — the conversation list stays warm and onUnreadTotalChange keeps reporting —
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useWidgetWindowCapacity(isRailExpanded: boolean, maxWindows: number): number;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
interface
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
interface WidgetShellNavigationProviderProps {
|
|
3
|
+
openConversationIds: string[];
|
|
4
|
+
onOpenConversation: (conversationId: string) => void;
|
|
5
|
+
onCloseConversation: (conversationId: string) => void;
|
|
5
6
|
children: ReactNode;
|
|
6
7
|
}
|
|
7
|
-
export declare function
|
|
8
|
+
export declare function WidgetShellNavigationProvider({ openConversationIds, onOpenConversation, onCloseConversation, children, }: WidgetShellNavigationProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
interface WidgetWindowNavigationProviderProps {
|
|
10
|
+
conversationId: string;
|
|
11
|
+
onOpenConversation: (conversationId: string) => void;
|
|
12
|
+
onCloseConversation: (conversationId: string) => void;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare function WidgetWindowNavigationProvider({ conversationId, onOpenConversation, onCloseConversation, children, }: WidgetWindowNavigationProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
16
|
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { WidgetFocusRequest } from './chat-widget.types';
|
|
2
|
+
interface WidgetChatShellProps {
|
|
3
|
+
isWindowVisible: boolean;
|
|
4
|
+
isExpanded: boolean;
|
|
5
|
+
openConversationIds: string[];
|
|
6
|
+
windowCapacity: number;
|
|
7
|
+
focusedConversationId: string | undefined;
|
|
8
|
+
composerFocusRequest: WidgetFocusRequest | null;
|
|
9
|
+
onToggleExpand: () => void;
|
|
10
|
+
onOpenConversation: (conversationId: string) => void;
|
|
11
|
+
onCloseConversation: (conversationId: string) => void;
|
|
12
|
+
onFocusConversation: (conversationId: string) => void;
|
|
13
|
+
onOpenFullPage?: (conversationId: string | undefined) => void;
|
|
14
|
+
onRequestClose?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function WidgetChatShell({ isWindowVisible, isExpanded, openConversationIds, windowCapacity, focusedConversationId, composerFocusRequest, onToggleExpand, onOpenConversation, onCloseConversation, onFocusConversation, onOpenFullPage, onRequestClose, }: WidgetChatShellProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface WidgetConversationWindowProps {
|
|
2
|
+
conversationId: string;
|
|
3
|
+
index: number;
|
|
4
|
+
isWindowVisible: boolean;
|
|
5
|
+
isExpanded: boolean;
|
|
6
|
+
isFocused: boolean;
|
|
7
|
+
focusNonce: number;
|
|
8
|
+
onOpenConversation: (conversationId: string) => void;
|
|
9
|
+
onCloseConversation: (conversationId: string) => void;
|
|
10
|
+
onFocusConversation: (conversationId: string) => void;
|
|
11
|
+
onOpenUserProfile: (userId: string | null, conversationId: string) => void;
|
|
12
|
+
onOpenFullPage?: (conversationId: string | undefined) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const WidgetConversationWindow: import('react').NamedExoticComponent<WidgetConversationWindowProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChatMessage } from '../../../utils/chat';
|
|
2
|
+
interface ConversationBoardModalProps {
|
|
3
|
+
conversationId: string | undefined;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
onJumpToMessage?: (message: ChatMessage) => void;
|
|
6
|
+
resolveUserAvatar?: (userId?: string) => string | null;
|
|
7
|
+
}
|
|
8
|
+
export declare function ConversationBoardModal({ conversationId, onClose, onJumpToMessage, resolveUserAvatar, }: ConversationBoardModalProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -16,16 +16,7 @@ interface ConversationSettingProps {
|
|
|
16
16
|
onForwardMessage: (message: ChatMessage) => void;
|
|
17
17
|
onOpenUserProfile: (userId: string) => void;
|
|
18
18
|
onSelectSearchMessage: (messageId: string) => Promise<boolean>;
|
|
19
|
-
/** Scrolls the timeline to a message chosen from the documents/media lists. The panel
|
|
20
|
-
* stays open on purpose - jumping is a navigation aid used while browsing the list, so
|
|
21
|
-
* closing it would throw the user out of the list they were working through. Required
|
|
22
|
-
* rather than optional so the jump buttons cannot silently disappear again if this prop
|
|
23
|
-
* is ever dropped while moving these panels around. */
|
|
24
19
|
onJumpToMessage: (message: ChatMessage) => void;
|
|
25
|
-
/** Notifies the page whenever the settings panel or the search panel open/close — the
|
|
26
|
-
* page needs `isSettingsOpen` specifically (the header's settings-toggle button shows
|
|
27
|
-
* its own active state from it) and the combination of both for its "has-side-panel"
|
|
28
|
-
* layout class. The panels themselves stay owned here. */
|
|
29
20
|
onOpenChange: (state: {
|
|
30
21
|
isSettingsOpen: boolean;
|
|
31
22
|
isSearchOpen: boolean;
|
|
@@ -25,6 +25,7 @@ interface ConversationGroupProps {
|
|
|
25
25
|
onCloseConversation?: () => void;
|
|
26
26
|
composerPlaceholder?: string;
|
|
27
27
|
isCompactComposer?: boolean;
|
|
28
|
+
canReviewJoinRequests?: boolean;
|
|
28
29
|
}
|
|
29
30
|
/** Header + detail + footer for the currently open conversation. Owns only what's
|
|
30
31
|
* genuinely shared across those three (message window, membership, reply target,
|
|
@@ -5,6 +5,7 @@ interface SidbarConversationListProps {
|
|
|
5
5
|
error: string;
|
|
6
6
|
currentUserId: string | null;
|
|
7
7
|
activeConversationId: string | undefined;
|
|
8
|
+
openConversationIds?: readonly string[];
|
|
8
9
|
isCompact?: boolean;
|
|
9
10
|
buildConversationPath?: (targetId: string) => string;
|
|
10
11
|
onSelectConversation: (conversation: Conversation) => void;
|
|
@@ -12,5 +13,5 @@ interface SidbarConversationListProps {
|
|
|
12
13
|
onClearConversation: (conversationId: string) => Promise<boolean>;
|
|
13
14
|
}
|
|
14
15
|
/** The scrollable list of conversation rows — already-filtered input in, Link rows out. */
|
|
15
|
-
export declare function SidbarConversationList({ conversations, isLoading, error, currentUserId, activeConversationId, isCompact, buildConversationPath, onSelectConversation, onTogglePin, onClearConversation, }: SidbarConversationListProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function SidbarConversationList({ conversations, isLoading, error, currentUserId, activeConversationId, openConversationIds, isCompact, buildConversationPath, onSelectConversation, onTogglePin, onClearConversation, }: SidbarConversationListProps): import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface BoardModalState {
|
|
2
|
+
conversationId: string | undefined;
|
|
3
|
+
open: (conversationId: string | undefined) => void;
|
|
4
|
+
close: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const useBoardModalStore: import('zustand').UseBoundStore<import('zustand').StoreApi<BoardModalState>>;
|
|
7
|
+
export {};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ChatMessage } from '../utils/chat';
|
|
2
2
|
interface PinnedMessagesState {
|
|
3
|
-
/** Only the currently open conversation's pinned list is ever held — a stray update for
|
|
4
|
-
* a conversation the user has since navigated away from is dropped, not applied. */
|
|
5
3
|
conversationId: string | undefined;
|
|
6
4
|
pinnedMessages: ChatMessage[];
|
|
7
5
|
setForConversation: (conversationId: string | undefined, messages: ChatMessage[]) => void;
|
|
@@ -9,8 +7,5 @@ interface PinnedMessagesState {
|
|
|
9
7
|
clearIfTarget: (conversationId: string | undefined, messageId: string) => void;
|
|
10
8
|
reset: () => void;
|
|
11
9
|
}
|
|
12
|
-
/** Shared pinned-messages state for the open conversation — read by both the pinned-bar
|
|
13
|
-
* (the list itself) and every message bubble (per-message pin icon), so a pin/unpin from
|
|
14
|
-
* either place is reflected in the other immediately, with no prop drilling between them. */
|
|
15
10
|
export declare const usePinnedMessagesStore: import('zustand').UseBoundStore<import('zustand').StoreApi<PinnedMessagesState>>;
|
|
16
11
|
export {};
|