@medipha/chat 1.0.67 → 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.
@@ -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;
@@ -0,0 +1,7 @@
1
+ interface SavedForwardEntryProps {
2
+ isOpening: boolean;
3
+ disabled: boolean;
4
+ onSelect: () => void;
5
+ }
6
+ export declare function SavedForwardEntry({ isOpening, disabled, onSelect }: SavedForwardEntryProps): import('react/jsx-runtime').JSX.Element;
7
+ export {};
@@ -1,22 +1,14 @@
1
1
  interface UseForwardMessageOptions {
2
- /** Called once a forward has actually been emitted — re-pins the scroll, since a
3
- * forwarded image resizes its bubble once it loads and can otherwise settle mid-list
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;