@medipha/chat 1.0.66 → 1.0.68
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/features/forward/forward-attempt.d.ts +15 -0
- package/dist/features/forward/saved-forward-entry.d.ts +7 -0
- package/dist/features/forward/use-forward-message.d.ts +5 -13
- package/dist/features/saved-messages/saved-conversation.d.ts +4 -0
- package/dist/features/tags/tag-filter.d.ts +1 -0
- package/dist/index.cjs +67 -67
- package/dist/index.js +11155 -10649
- package/dist/module/widget/chat-widget.types.d.ts +8 -0
- package/dist/module/widget/widget-chat-shell.d.ts +3 -2
- package/dist/pages/sidebar/conversation-list-entries.d.ts +17 -0
- package/dist/pages/sidebar/sidbar-conversation-list/saved-conversation-entry.d.ts +7 -0
- package/dist/pages/sidebar/sidbar-conversation-list/sidbar-conversation-list.d.ts +5 -2
- package/dist/shared/components/conversation-avatar.d.ts +2 -1
- package/dist/shared/components/selection-panel.d.ts +3 -1
- package/dist/store/conversationsStore.d.ts +9 -0
- package/dist/store/forwardStore.d.ts +12 -0
- package/dist/styles.css +1 -1
- package/dist/utils/chat.d.ts +10 -3
- package/package.json +3 -2
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MessageForwardPayload, MessageForwardResult } from '@medipha/chat-core';
|
|
2
|
+
export declare const MAX_FORWARD_TARGETS = 20;
|
|
3
|
+
export interface ForwardDestination {
|
|
4
|
+
kind: 'conversation' | 'user';
|
|
5
|
+
id: string;
|
|
6
|
+
clientMessageId: string;
|
|
7
|
+
noteClientMessageId: string;
|
|
8
|
+
noteEmitted: boolean;
|
|
9
|
+
message: Record<string, unknown> | null;
|
|
10
|
+
}
|
|
11
|
+
export declare const getForwardDestinationKey: (kind: ForwardDestination["kind"], id: string) => string;
|
|
12
|
+
export declare function prepareForwardDestinations(conversationIds: string[], userIds: string[], existing: ForwardDestination[]): ForwardDestination[];
|
|
13
|
+
export declare function buildForwardPayload(sourceMessageId: string, destinations: ForwardDestination[]): MessageForwardPayload;
|
|
14
|
+
export declare function readForwardedMessage(destination: ForwardDestination, result: MessageForwardResult | undefined): Record<string, unknown> | null;
|
|
15
|
+
export declare function findForwardResult(destination: ForwardDestination, results: MessageForwardResult[]): MessageForwardResult | undefined;
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
interface UseForwardMessageOptions {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* instead of following down, same as a normal send. */
|
|
5
|
-
onForwarded: () => void;
|
|
2
|
+
conversationId: string | undefined;
|
|
3
|
+
onForwarded: (messages: Record<string, unknown>[]) => void;
|
|
6
4
|
}
|
|
7
|
-
|
|
8
|
-
* Owns the "Chuyển tiếp" (forward) submit flow: the socket calls that send the staged
|
|
9
|
-
* message on to the picked conversations, with an optional note sent ahead of it.
|
|
10
|
-
* Which message is staged (and whether ForwardDialog is open) comes from the shared
|
|
11
|
-
* `forwardStore` — `openForward`/`closeForward`/`clearIfTarget` are that store's actions
|
|
12
|
-
* directly, re-exported here only so existing call sites don't need to change.
|
|
13
|
-
*/
|
|
14
|
-
export declare function useForwardMessage({ onForwarded }: UseForwardMessageOptions): {
|
|
5
|
+
export declare function useForwardMessage(options: UseForwardMessageOptions): {
|
|
15
6
|
forwardSource: import('../../utils/chat').ChatMessage | null;
|
|
16
7
|
forwardConversationId: string | null;
|
|
8
|
+
forwardSessionId: number;
|
|
17
9
|
openForward: (message: import('../../utils/chat').ChatMessage, conversationId?: string) => void;
|
|
18
10
|
closeForward: () => void;
|
|
19
11
|
clearIfTarget: (messageId: string) => void;
|
|
20
|
-
submitForward: (targetConversationIds: string[], targetUserIds: string[], note: string) => void
|
|
12
|
+
submitForward: (targetConversationIds: string[], targetUserIds: string[], note: string) => Promise<void>;
|
|
21
13
|
};
|
|
22
14
|
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Conversation } from '../../utils/chat';
|
|
2
|
+
export declare function isSavedConversationForUser(conversation: Conversation, userId: string | null): boolean;
|
|
3
|
+
export declare function findSavedConversation(conversations: Conversation[], userId: string | null): Conversation | undefined;
|
|
4
|
+
export declare function mergeSavedConversation(current: Conversation | undefined, incoming: Conversation): Conversation;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Conversation, ConversationTag } from '../../utils/chat';
|
|
2
2
|
export declare const TAG_FILTER_UNTAGGED = "untagged";
|
|
3
3
|
export declare function resolveTagFilter(selectedFilters: string[], tags: ConversationTag[]): string[];
|
|
4
|
+
export declare function matchesConversationTagFilter(tag: ConversationTag | null | undefined, selectedFilters: string[]): boolean;
|
|
4
5
|
export declare function matchesTagFilter(conversation: Conversation, selectedFilters: string[]): boolean;
|