@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.
- package/dist/api/local-transport.d.ts +7 -0
- package/dist/api/member-approval-client.d.ts +8 -0
- package/dist/features/composer/attachment-file-helpers.d.ts +5 -5
- package/dist/features/media-preview/use-image-lightbox.d.ts +5 -6
- package/dist/index.cjs +47 -47
- package/dist/index.js +9915 -9464
- package/dist/pages/Setting/hooks/use-pending-join-requests.d.ts +4 -0
- package/dist/pages/Setting/members/join-requests-modal.d.ts +10 -0
- package/dist/pages/conversation/conversation-header/conversation-header.d.ts +3 -1
- package/dist/shared/components/user-approved-icon.d.ts +5 -0
- package/dist/store/pendingJoinRequestsStore.d.ts +18 -0
- package/dist/styles.css +1 -1
- package/dist/utils/chat-display.d.ts +13 -3
- package/dist/utils/chat.d.ts +20 -1
- package/package.json +1 -1
|
@@ -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"
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
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`
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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,
|
|
12
|
+
openFromBubble: (message: ChatMessage, urls: string[], clickedIndex: number) => void;
|
|
14
13
|
setIndex: (index: number) => void;
|
|
15
14
|
close: () => void;
|
|
16
15
|
};
|