@medipha/chat 1.0.35 → 1.0.37

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,7 @@
1
+ interface LocalTransportConfig {
2
+ apiBaseUrl: string;
3
+ getAccessToken: () => string;
4
+ }
5
+ export declare function configureLocalTransport(config: LocalTransportConfig): void;
6
+ export declare function localFetch<T>(path: string, init?: RequestInit): Promise<T>;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ConversationMember, GroupMessagePermission, PendingMember } from '../utils/chat';
2
+ export declare function getPendingMembers(conversationId: string): Promise<PendingMember[]>;
3
+ export declare function approveConversationMembers(conversationId: string, userIds: string[]): Promise<ConversationMember[]>;
4
+ export declare function rejectConversationMembers(conversationId: string, userIds: string[]): Promise<void>;
5
+ export declare function updateGroupApprovalSettings(conversationId: string, payload: {
6
+ messagePermission?: GroupMessagePermission;
7
+ requireApprovalForNewMembers?: boolean;
8
+ }): Promise<unknown>;
@@ -3,11 +3,11 @@ export declare const ACCEPT_ATTRIBUTE = ".jpg,.jpeg,.png,.webp,.gif,.pdf,.doc,.d
3
3
  export declare const ACCEPTED_FILE_EXTENSIONS: Set<string>;
4
4
  export declare const getFileExtension: (file: File) => string;
5
5
  export declare const isImageFile: (file: File) => boolean;
6
- /** A clipboard image is not a file on disk, so the browser invents its name — usually
7
- * "image.png", but it can arrive without a usable extension, which both the staging
8
- * filter and the backend reject (they key off the extension, never the mimetype). Rebuild
9
- * those under a real extension derived from the mimetype; anything already named like an
10
- * image, and anything not an image at all, is returned untouched. */
6
+ /** A clipboard image is not a file on disk, so the browser invents its name — usually the
7
+ * same generic "image.png" for every paste, which both the staging filter and the backend
8
+ * reject when it lacks a usable extension (they key off the extension, never the mimetype).
9
+ * Every pasted image is rebuilt under a fresh unique name so two screenshots pasted in the
10
+ * same batch never collide once uploaded; anything not an image is returned untouched. */
11
11
  export declare const withImageFileExtension: (file: File) => File;
12
12
  /** Splits staged files into same-kind runs (images vs. documents) so each becomes one grouped message. */
13
13
  export declare const groupAttachmentsByKind: (attachments: PendingAttachment[]) => PendingAttachment[][];
@@ -1,16 +1,15 @@
1
- import { flattenFileEntries } from '../../pages/Setting/archive/archive-helpers';
2
1
  import { ChatMessage } from '../../utils/chat';
3
2
  import { MediaPreviewState } from './media-preview-modal';
4
3
  /**
5
- * Owns the fullscreen media-preview overlay. `openFromBubble` resolves a bubble image
6
- * click to its position in the conversation's full media archive ("Kho lưu trữ") so the
7
- * rail shows every image, not just this message's own — falling back to just that
8
- * message's own images if the archive hasn't loaded (or doesn't have this image) yet.
4
+ * Owns the fullscreen media-preview overlay. `openFromBubble` shows only the clicked
5
+ * message's own images — swiping across the whole conversation's media only happens from
6
+ * the Settings-panel preview and "Kho lưu trữ", which back the rail with the full archive
7
+ * themselves.
9
8
  */
10
9
  export declare function useImageLightbox(): {
11
10
  imageLightbox: MediaPreviewState | null;
12
11
  openItems: (items: MediaPreviewState["items"], index: number) => void;
13
- openFromBubble: (message: ChatMessage, mediaArchiveItems: Parameters<typeof flattenFileEntries>[0], urls: string[], clickedIndex: number) => void;
12
+ openFromBubble: (message: ChatMessage, urls: string[], clickedIndex: number) => void;
14
13
  setIndex: (index: number) => void;
15
14
  close: () => void;
16
15
  };