@droppii-org/chat-mobile 0.2.23 → 0.2.25
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/lib/module/assets/images/btn_resend.png +0 -0
- package/lib/module/assets/images/index.js +2 -1
- package/lib/module/assets/images/index.js.map +1 -1
- package/lib/module/components/AttachmentPreview/FilePreview.js +1 -1
- package/lib/module/components/AttachmentPreview/FilePreview.js.map +1 -1
- package/lib/module/components/messages/MessageStatusIndicator.js +70 -0
- package/lib/module/components/messages/MessageStatusIndicator.js.map +1 -0
- package/lib/module/components/messages/fileMessage/index.js.map +1 -1
- package/lib/module/components/messages/imageMessage/index.js +59 -50
- package/lib/module/components/messages/imageMessage/index.js.map +1 -1
- package/lib/module/components/messages/linkMessage/index.js +14 -6
- package/lib/module/components/messages/linkMessage/index.js.map +1 -1
- package/lib/module/components/messages/mergedMessage/index.js.map +1 -1
- package/lib/module/components/messages/textMessage/index.js +14 -6
- package/lib/module/components/messages/textMessage/index.js.map +1 -1
- package/lib/module/components/messages/videoMessage/index.js.map +1 -1
- package/lib/module/config/uploadLimits.js +13 -0
- package/lib/module/config/uploadLimits.js.map +1 -0
- package/lib/module/core/useChatListener.js +35 -4
- package/lib/module/core/useChatListener.js.map +1 -1
- package/lib/module/core/useUserListener.js +17 -7
- package/lib/module/core/useUserListener.js.map +1 -1
- package/lib/module/hooks/message/useSendMessage.js +62 -15
- package/lib/module/hooks/message/useSendMessage.js.map +1 -1
- package/lib/module/hooks/useChatCompose.js +153 -0
- package/lib/module/hooks/useChatCompose.js.map +1 -0
- package/lib/module/hooks/useChatMessages.js +39 -8
- package/lib/module/hooks/useChatMessages.js.map +1 -1
- package/lib/module/hooks/useFileAttachment.js +1 -1
- package/lib/module/hooks/useFileAttachment.js.map +1 -1
- package/lib/module/hooks/useFileDownload.js +1 -1
- package/lib/module/hooks/useFileDownload.js.map +1 -1
- package/lib/module/hooks/useImageAttachment.js +81 -152
- package/lib/module/hooks/useImageAttachment.js.map +1 -1
- package/lib/module/hooks/useSendAttachment.js +2 -2
- package/lib/module/hooks/useSendAttachment.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatComposer.js +50 -185
- package/lib/module/screens/chat-detail/ChatComposer.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatDetail.js +29 -137
- package/lib/module/screens/chat-detail/ChatDetail.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatListLegend.js +20 -15
- package/lib/module/screens/chat-detail/ChatListLegend.js.map +1 -1
- package/lib/module/screens/chat-detail/index.js +0 -1
- package/lib/module/screens/chat-detail/index.js.map +1 -1
- package/lib/module/screens/chat-detail/legend/LegendChatMessage.js +18 -13
- package/lib/module/screens/chat-detail/legend/LegendChatMessage.js.map +1 -1
- package/lib/module/services/attachmentHandlers/fileAttachmentHandler.js +2 -2
- package/lib/module/services/attachmentHandlers/fileAttachmentHandler.js.map +1 -1
- package/lib/module/services/attachmentHandlers/imageAttachmentHandler.js +3 -3
- package/lib/module/services/attachmentHandlers/imageAttachmentHandler.js.map +1 -1
- package/lib/module/services/attachmentHandlers/videoAttachmentHandler.js +2 -1
- package/lib/module/services/attachmentHandlers/videoAttachmentHandler.js.map +1 -1
- package/lib/module/services/attachmentOrchestrator.js +40 -17
- package/lib/module/services/attachmentOrchestrator.js.map +1 -1
- package/lib/module/services/message.js +13 -5
- package/lib/module/services/message.js.map +1 -1
- package/lib/module/translation/resources/i18n.js +4 -3
- package/lib/module/translation/resources/i18n.js.map +1 -1
- package/lib/module/types/chat.js.map +1 -1
- package/lib/module/types/global.d.js +2 -0
- package/lib/module/types/global.d.js.map +1 -0
- package/lib/module/types/index.d.js +3 -0
- package/lib/module/types/index.d.js.map +1 -0
- package/lib/module/utils/UIUtils.js +37 -0
- package/lib/module/utils/UIUtils.js.map +1 -0
- package/lib/module/utils/imageUtils.js +3 -3
- package/lib/module/utils/imageUtils.js.map +1 -1
- package/lib/module/utils/pLimit.js +19 -0
- package/lib/module/utils/pLimit.js.map +1 -0
- package/lib/module/utils/videoThumbnail.js +8 -3
- package/lib/module/utils/videoThumbnail.js.map +1 -1
- package/lib/module/utils/videoThumbnailUpload.js +76 -0
- package/lib/module/utils/videoThumbnailUpload.js.map +1 -0
- package/lib/typescript/src/assets/images/index.d.ts +1 -0
- package/lib/typescript/src/assets/images/index.d.ts.map +1 -1
- package/lib/typescript/src/components/messages/MessageStatusIndicator.d.ts +9 -0
- package/lib/typescript/src/components/messages/MessageStatusIndicator.d.ts.map +1 -0
- package/lib/typescript/src/components/messages/fileMessage/index.d.ts.map +1 -1
- package/lib/typescript/src/components/messages/imageMessage/index.d.ts.map +1 -1
- package/lib/typescript/src/components/messages/linkMessage/index.d.ts +3 -8
- package/lib/typescript/src/components/messages/linkMessage/index.d.ts.map +1 -1
- package/lib/typescript/src/components/messages/mergedMessage/index.d.ts.map +1 -1
- package/lib/typescript/src/components/messages/textMessage/index.d.ts +2 -8
- package/lib/typescript/src/components/messages/textMessage/index.d.ts.map +1 -1
- package/lib/typescript/src/components/messages/videoMessage/index.d.ts.map +1 -1
- package/lib/typescript/src/config/uploadLimits.d.ts +7 -0
- package/lib/typescript/src/config/uploadLimits.d.ts.map +1 -0
- package/lib/typescript/src/core/useChatListener.d.ts.map +1 -1
- package/lib/typescript/src/core/useUserListener.d.ts.map +1 -1
- package/lib/typescript/src/hooks/message/useSendMessage.d.ts +2 -0
- package/lib/typescript/src/hooks/message/useSendMessage.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useChatCompose.d.ts +27 -0
- package/lib/typescript/src/hooks/useChatCompose.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useChatMessages.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useImageAttachment.d.ts +2 -2
- package/lib/typescript/src/hooks/useImageAttachment.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useSendAttachment.d.ts +1 -1
- package/lib/typescript/src/hooks/useSendAttachment.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatComposer.d.ts +5 -2
- package/lib/typescript/src/screens/chat-detail/ChatComposer.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatListLegend.d.ts +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatListLegend.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/index.d.ts +0 -2
- package/lib/typescript/src/screens/chat-detail/index.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/legend/LegendChatMessage.d.ts +3 -5
- package/lib/typescript/src/screens/chat-detail/legend/LegendChatMessage.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/types.d.ts +1 -35
- package/lib/typescript/src/screens/chat-detail/types.d.ts.map +1 -1
- package/lib/typescript/src/services/attachmentHandlers/fileAttachmentHandler.d.ts.map +1 -1
- package/lib/typescript/src/services/attachmentHandlers/imageAttachmentHandler.d.ts.map +1 -1
- package/lib/typescript/src/services/attachmentHandlers/videoAttachmentHandler.d.ts.map +1 -1
- package/lib/typescript/src/services/attachmentOrchestrator.d.ts +1 -1
- package/lib/typescript/src/services/attachmentOrchestrator.d.ts.map +1 -1
- package/lib/typescript/src/services/message.d.ts +7 -0
- package/lib/typescript/src/services/message.d.ts.map +1 -1
- package/lib/typescript/src/translation/resources/i18n.d.ts.map +1 -1
- package/lib/typescript/src/types/chat.d.ts +11 -0
- package/lib/typescript/src/types/chat.d.ts.map +1 -1
- package/lib/typescript/src/utils/UIUtils.d.ts +4 -0
- package/lib/typescript/src/utils/UIUtils.d.ts.map +1 -0
- package/lib/typescript/src/utils/imageUtils.d.ts.map +1 -1
- package/lib/typescript/src/utils/pLimit.d.ts +6 -0
- package/lib/typescript/src/utils/pLimit.d.ts.map +1 -0
- package/lib/typescript/src/utils/videoThumbnail.d.ts.map +1 -1
- package/lib/typescript/src/utils/videoThumbnailUpload.d.ts +11 -0
- package/lib/typescript/src/utils/videoThumbnailUpload.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/assets/images/btn_resend.png +0 -0
- package/src/assets/images/index.ts +1 -0
- package/src/components/AttachmentPreview/FilePreview.tsx +1 -1
- package/src/components/messages/MessageStatusIndicator.tsx +82 -0
- package/src/components/messages/fileMessage/index.tsx +0 -1
- package/src/components/messages/imageMessage/index.tsx +71 -57
- package/src/components/messages/linkMessage/index.tsx +13 -19
- package/src/components/messages/mergedMessage/index.tsx +0 -1
- package/src/components/messages/textMessage/index.tsx +13 -18
- package/src/components/messages/videoMessage/index.tsx +0 -1
- package/src/config/uploadLimits.ts +11 -0
- package/src/core/useChatListener.ts +38 -4
- package/src/core/useUserListener.ts +17 -7
- package/src/hooks/message/useSendMessage.ts +103 -24
- package/src/hooks/useChatCompose.ts +195 -0
- package/src/hooks/useChatMessages.ts +54 -10
- package/src/hooks/useFileAttachment.ts +1 -1
- package/src/hooks/useFileDownload.ts +1 -1
- package/src/hooks/useImageAttachment.ts +120 -199
- package/src/hooks/useSendAttachment.ts +3 -6
- package/src/index.tsx +3 -5
- package/src/screens/chat-detail/ChatComposer.tsx +88 -240
- package/src/screens/chat-detail/ChatDetail.tsx +36 -195
- package/src/screens/chat-detail/ChatListLegend.tsx +16 -13
- package/src/screens/chat-detail/index.ts +1 -5
- package/src/screens/chat-detail/legend/LegendChatMessage.tsx +19 -12
- package/src/screens/chat-detail/types.ts +1 -38
- package/src/services/attachmentHandlers/fileAttachmentHandler.ts +3 -2
- package/src/services/attachmentHandlers/imageAttachmentHandler.ts +6 -3
- package/src/services/attachmentHandlers/videoAttachmentHandler.ts +2 -1
- package/src/services/attachmentOrchestrator.ts +49 -27
- package/src/services/message.ts +21 -4
- package/src/translation/resources/i18n.ts +6 -3
- package/src/types/chat.ts +6 -0
- package/src/types/global.d.ts +299 -0
- package/src/types/index.d.ts +1 -0
- package/src/utils/UIUtils.ts +31 -0
- package/src/utils/imageUtils.ts +3 -4
- package/src/utils/pLimit.ts +20 -0
- package/src/utils/videoThumbnail.ts +10 -3
- package/src/utils/videoThumbnailUpload.ts +103 -0
- package/lib/module/hooks/useVideoAttachment.js +0 -251
- package/lib/module/hooks/useVideoAttachment.js.map +0 -1
- package/lib/module/screens/chat-detail/hooks/useAttachmentSendHandler.js +0 -288
- package/lib/module/screens/chat-detail/hooks/useAttachmentSendHandler.js.map +0 -1
- package/lib/module/utils/giftedChatMessage.js +0 -90
- package/lib/module/utils/giftedChatMessage.js.map +0 -1
- package/lib/module/utils/ui.js +0 -17
- package/lib/module/utils/ui.js.map +0 -1
- package/lib/typescript/src/hooks/useVideoAttachment.d.ts +0 -29
- package/lib/typescript/src/hooks/useVideoAttachment.d.ts.map +0 -1
- package/lib/typescript/src/screens/chat-detail/hooks/useAttachmentSendHandler.d.ts +0 -26
- package/lib/typescript/src/screens/chat-detail/hooks/useAttachmentSendHandler.d.ts.map +0 -1
- package/lib/typescript/src/utils/giftedChatMessage.d.ts +0 -10
- package/lib/typescript/src/utils/giftedChatMessage.d.ts.map +0 -1
- package/lib/typescript/src/utils/ui.d.ts +0 -13
- package/lib/typescript/src/utils/ui.d.ts.map +0 -1
- package/src/hooks/useVideoAttachment.ts +0 -334
- package/src/screens/chat-detail/hooks/useAttachmentSendHandler.ts +0 -386
- package/src/utils/giftedChatMessage.ts +0 -137
- package/src/utils/ui.ts +0 -19
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ChatDetailProps } from './types';
|
|
2
|
-
declare const ChatDetail: import("react").MemoExoticComponent<({ conversationId, enabled, title, subtitle, avatarUri, avatarFullName, showAddMember, getSubtitle, onBack, onPressSearch, onPressAddMember, onPressMenu, onPressAvatar,
|
|
2
|
+
declare const ChatDetail: import("react").MemoExoticComponent<({ conversationId, enabled, title, subtitle, avatarUri, avatarFullName, showAddMember, getSubtitle, onBack, onPressSearch, onPressAddMember, onPressMenu, onPressAvatar, onPressUrl, customMessageItemFactory, }: ChatDetailProps) => import("react").JSX.Element>;
|
|
3
3
|
export default ChatDetail;
|
|
4
4
|
//# sourceMappingURL=ChatDetail.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatDetail.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatDetail.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatDetail.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatDetail.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAK/C,QAAA,MAAM,UAAU,wPAiBX,eAAe,iCA+GnB,CAAC;AAQF,eAAe,UAAU,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ChatListProps } from './types';
|
|
2
|
-
export declare const ChatListLegend: import("react").MemoExoticComponent<({ messages, currentUserId, customMessageItemFactory, onLoadEarlier,
|
|
2
|
+
export declare const ChatListLegend: import("react").MemoExoticComponent<({ messages, currentUserId, customMessageItemFactory, onLoadEarlier, isLoadingEarlier, hasMoreEarlier, onLoadNewer, isLoadingNewer, hasMoreNewer, onMediaPress, onPressUrl, }: ChatListProps) => import("react").JSX.Element>;
|
|
3
3
|
//# sourceMappingURL=ChatListLegend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatListLegend.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatListLegend.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatListLegend.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatListLegend.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAY7C,eAAO,MAAM,cAAc,qNAatB,aAAa,iCAsWjB,CAAC"}
|
|
@@ -6,7 +6,5 @@ export { ChatAttachmentPanel } from './ChatAttachmentPanel';
|
|
|
6
6
|
export { DEFAULT_Chat_QUICK_ACTIONS, DEFAULT_ATTACHMENT_ACTIONS, DEFAULT_ATTACHMENT_PANEL_HEIGHT, } from './constants';
|
|
7
7
|
export { getConversationTitle, getConversationAvatarUri, getConversationSubtitle, shouldShowAddMember, } from './conversationHeader.utils';
|
|
8
8
|
export type { DChatActionItem, DChatActionIconProvider, DChatQuickAction, DChatAttachmentAction, ChatDetailProps, ChatDetailHeaderProps, ChatListProps, ChatComposerProps, ChatQuickActionsProps, ChatQuickActionsRenderParams, ChatAttachmentPanelProps, } from './types';
|
|
9
|
-
export type { DGiftedChatMessage } from '../../utils/giftedChatMessage';
|
|
10
9
|
export { DChatMessageType, CUSTOM_MESSAGE_DATA_TYPE, } from '../../types/message';
|
|
11
|
-
export { mapOpenIMMessageToGiftedChat, mapOpenIMMessagesToGiftedChat, } from '../../utils/giftedChatMessage';
|
|
12
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,+BAA+B,GAChC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,+BAA+B,GAChC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { MessageItem } from '@droppii/openim-rn-client-sdk';
|
|
2
3
|
import type { DMessageItem } from '../../../types/chat';
|
|
3
4
|
import type { MediaItem } from '../../../hooks/useMediaViewer';
|
|
4
5
|
interface LegendChatMessageProps {
|
|
@@ -7,12 +8,9 @@ interface LegendChatMessageProps {
|
|
|
7
8
|
createdAtTime: number;
|
|
8
9
|
onMediaPress?: (items: MediaItem[], index?: number) => void;
|
|
9
10
|
onPressUrl?: (url: string) => void;
|
|
11
|
+
onRetry?: (message: MessageItem) => void;
|
|
10
12
|
customMessageItemFactory?: (m: DMessageItem) => ReactNode;
|
|
11
13
|
}
|
|
12
|
-
|
|
13
|
-
* Dispatcher component - renders the appropriate message component
|
|
14
|
-
* based on message type. Extensible for new message types.
|
|
15
|
-
*/
|
|
16
|
-
export declare const LegendChatMessage: import("react").MemoExoticComponent<({ message, isOutgoing, createdAtTime, onMediaPress, onPressUrl, customMessageItemFactory, }: LegendChatMessageProps) => string | number | bigint | true | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode>> | import("react").JSX.Element>;
|
|
14
|
+
export declare const LegendChatMessage: import("react").MemoExoticComponent<({ message, isOutgoing, createdAtTime, onMediaPress, onPressUrl, onRetry, customMessageItemFactory, }: LegendChatMessageProps) => string | number | bigint | true | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode>> | import("react").JSX.Element>;
|
|
17
15
|
export {};
|
|
18
16
|
//# sourceMappingURL=LegendChatMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendChatMessage.d.ts","sourceRoot":"","sources":["../../../../../../src/screens/chat-detail/legend/LegendChatMessage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"LegendChatMessage.d.ts","sourceRoot":"","sources":["../../../../../../src/screens/chat-detail/legend/LegendChatMessage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAc/D,UAAU,sBAAsB;IAC9B,OAAO,EAAE,YAAY,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IACzC,wBAAwB,CAAC,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,SAAS,CAAC;CAC3D;AAwBD,eAAO,MAAM,iBAAiB,6IASzB,sBAAsB,wRA+B1B,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { MediaItem } from '../../hooks/useMediaViewer';
|
|
3
3
|
import type { DMessageItem } from '../../types/chat';
|
|
4
|
-
import type { IUrlMetadata } from '../../types/common';
|
|
5
4
|
import type { ConversationItem } from '@droppii/openim-rn-client-sdk';
|
|
6
5
|
export type DChatActionIconProvider = 'MaterialCommunityIcons' | 'DroppiiNew';
|
|
7
6
|
export interface DChatActionItem {
|
|
@@ -46,23 +45,7 @@ export interface ChatAttachmentPanelProps {
|
|
|
46
45
|
renderAction?: (action: DChatAttachmentAction, onPress: () => void) => ReactNode;
|
|
47
46
|
}
|
|
48
47
|
export interface ChatComposerProps {
|
|
49
|
-
|
|
50
|
-
placeholder?: string;
|
|
51
|
-
onChangeText?: (text?: string) => void;
|
|
52
|
-
onSend?: (urlMetadata?: IUrlMetadata) => void;
|
|
53
|
-
onPressAttach?: () => void;
|
|
54
|
-
onPressEmoji?: () => void;
|
|
55
|
-
onMessageSent?: (message: DMessageItem) => void;
|
|
56
|
-
showQuickActions?: boolean;
|
|
57
|
-
quickActions?: DChatQuickAction[];
|
|
58
|
-
attachmentActions?: DChatAttachmentAction[];
|
|
59
|
-
onQuickActionPress?: (action: DChatQuickAction) => void;
|
|
60
|
-
onAttachmentAction?: (action: DChatAttachmentAction) => void;
|
|
61
|
-
renderQuickAction?: ChatQuickActionsProps['renderAction'];
|
|
62
|
-
renderQuickActions?: ChatQuickActionsProps['renderQuickActions'];
|
|
63
|
-
renderAttachmentAction?: ChatAttachmentPanelProps['renderAction'];
|
|
64
|
-
attachmentColumns?: number;
|
|
65
|
-
isEmptyMessage: boolean;
|
|
48
|
+
isEmptyMessage?: boolean;
|
|
66
49
|
}
|
|
67
50
|
export interface ChatListProps {
|
|
68
51
|
messages?: DMessageItem[];
|
|
@@ -87,23 +70,6 @@ export interface ChatDetailProps extends Omit<ChatDetailHeaderProps, 'title' | '
|
|
|
87
70
|
avatarFullName?: string;
|
|
88
71
|
showAddMember?: boolean;
|
|
89
72
|
getSubtitle?: (conversation: ConversationItem) => string | undefined;
|
|
90
|
-
renderChat?: (item: DMessageItem) => ReactNode;
|
|
91
|
-
showQuickActions?: boolean;
|
|
92
|
-
showAttachmentActions?: boolean;
|
|
93
|
-
quickActions?: DChatQuickAction[];
|
|
94
|
-
getQuickActions?: (conversation: ConversationItem) => DChatQuickAction[] | undefined;
|
|
95
|
-
attachmentActions?: DChatAttachmentAction[];
|
|
96
|
-
inputPlaceholder?: string;
|
|
97
|
-
onChangeInput?: (text: string) => void;
|
|
98
|
-
onSend?: () => void;
|
|
99
|
-
onPressAttach?: () => void;
|
|
100
|
-
onPressEmoji?: () => void;
|
|
101
|
-
onQuickActionPress?: (action: DChatQuickAction) => void;
|
|
102
|
-
onAttachmentAction?: (action: DChatAttachmentAction) => void;
|
|
103
|
-
renderQuickAction?: ChatQuickActionsProps['renderAction'];
|
|
104
|
-
renderQuickActions?: ChatQuickActionsProps['renderQuickActions'];
|
|
105
|
-
renderAttachmentAction?: ChatAttachmentPanelProps['renderAction'];
|
|
106
|
-
attachmentColumns?: number;
|
|
107
73
|
onPressUrl?: (url: string) => void;
|
|
108
74
|
customMessageItemFactory?: (item: DMessageItem) => ReactNode;
|
|
109
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,MAAM,uBAAuB,GAAG,wBAAwB,GAAG,YAAY,CAAC;AAE9E,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,uBAAuB,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAC/C,MAAM,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAEpD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,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AC;CAC9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileAttachmentHandler.d.ts","sourceRoot":"","sources":["../../../../../src/services/attachmentHandlers/fileAttachmentHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAkB,MAAM,wBAAwB,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;
|
|
1
|
+
{"version":3,"file":"fileAttachmentHandler.d.ts","sourceRoot":"","sources":["../../../../../src/services/attachmentHandlers/fileAttachmentHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAkB,MAAM,wBAAwB,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAID,eAAO,MAAM,aAAa,QAAqB,CAAC;AAEhD,qBAAa,qBAAsB,YAAW,kBAAkB;IAC9D,QAAQ,CACN,UAAU,EAAE,UAAU,GACrB;QAAE,KAAK,EAAE,IAAI,CAAA;KAAE,GAAG;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAkC/C,YAAY,CAChB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,QAAQ,CAAC;CAsBrB;;AAED,wBAA2C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imageAttachmentHandler.d.ts","sourceRoot":"","sources":["../../../../../src/services/attachmentHandlers/imageAttachmentHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"imageAttachmentHandler.d.ts","sourceRoot":"","sources":["../../../../../src/services/attachmentHandlers/imageAttachmentHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAIxE,eAAO,MAAM,sBAAsB,EAAE,kBA6DpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"videoAttachmentHandler.d.ts","sourceRoot":"","sources":["../../../../../src/services/attachmentHandlers/videoAttachmentHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAmB,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"videoAttachmentHandler.d.ts","sourceRoot":"","sources":["../../../../../src/services/attachmentHandlers/videoAttachmentHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAmB,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAGxE,UAAU,YAAY;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,sBAAuB,YAAW,kBAAkB;IAC/D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAuB;IAC7D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAoC;IAE3E,QAAQ,CACN,UAAU,EAAE,UAAU,GACrB;QAAE,KAAK,EAAE,IAAI,CAAA;KAAE,GAAG;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAqC/C,YAAY,CAChB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,YAAY,CAAC;CA8CzB;;AAED,wBAA4C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Attachment, AttachmentSendOptions, AttachmentSendResult } from '../types/attachment';
|
|
2
2
|
export declare namespace AttachmentOrchestratorService {
|
|
3
|
-
function sendPreparedAttachments(attachments: Attachment[], uploadedUrls: Record<string, string>, options?: AttachmentSendOptions
|
|
3
|
+
function sendPreparedAttachments(attachments: Attachment[], uploadedUrls: Record<string, string>, options?: AttachmentSendOptions): Promise<AttachmentSendResult>;
|
|
4
4
|
}
|
|
5
5
|
//# sourceMappingURL=attachmentOrchestrator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachmentOrchestrator.d.ts","sourceRoot":"","sources":["../../../../src/services/attachmentOrchestrator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"attachmentOrchestrator.d.ts","sourceRoot":"","sources":["../../../../src/services/attachmentOrchestrator.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,UAAU,EACV,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAS7B,yBAAiB,6BAA6B,CAAC;IAC7C,SAAsB,uBAAuB,CAC3C,WAAW,EAAE,UAAU,EAAE,EACzB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,OAAO,GAAE,qBAAkD,GAC1D,OAAO,CAAC,oBAAoB,CAAC,CA6F/B;CA6MF"}
|
|
@@ -8,10 +8,17 @@ export declare namespace ChatMessageAPI {
|
|
|
8
8
|
count?: number;
|
|
9
9
|
startClientMsgID?: string;
|
|
10
10
|
lastMinSeq?: number;
|
|
11
|
+
applicationType?: string;
|
|
11
12
|
}): Promise<HistoryMessageResult>;
|
|
12
13
|
function sendTextMessage(params: {
|
|
13
14
|
text: string;
|
|
14
15
|
}): Promise<DMessageItem>;
|
|
16
|
+
function searchLocalMessages(conversationID: string, options?: {
|
|
17
|
+
keywordList?: string[];
|
|
18
|
+
messageTypeList?: number[];
|
|
19
|
+
pageIndex?: number;
|
|
20
|
+
count?: number;
|
|
21
|
+
}): Promise<import("@droppii/openim-rn-client-sdk").SearchMessageResult>;
|
|
15
22
|
function markConversationAsRead(conversationID: string): Promise<unknown>;
|
|
16
23
|
function getCurrentUserId(): Promise<string>;
|
|
17
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/services/message.ts"],"names":[],"mappings":"AAAA,OAAkB,EAEhB,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EACjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAMlD,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,GAAG;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,yBAAiB,cAAc,CAAC;IAC9B,SAAsB,oBAAoB,CACxC,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/services/message.ts"],"names":[],"mappings":"AAAA,OAAkB,EAEhB,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EACjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAMlD,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,GAAG;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,yBAAiB,cAAc,CAAC;IAC9B,SAAsB,oBAAoB,CACxC,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,GACA,OAAO,CAAC,oBAAoB,CAAC,CAQ/B;IAED,SAAsB,eAAe,CAAC,MAAM,EAAE;QAC5C,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,YAAY,CAAC,CAaxB;IAED,SAAsB,mBAAmB,CACvC,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE;QACR,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;QACvB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,wEASF;IAED,SAAsB,sBAAsB,CAAC,cAAc,EAAE,MAAM,oBAElE;IAED,SAAsB,gBAAgB,oBAErC;CACF;AAED,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../../src/translation/resources/i18n.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../../src/translation/resources/i18n.ts"],"names":[],"mappings":";;;AAwCA,wBAEE"}
|
|
@@ -9,6 +9,17 @@ export declare const EventProvider: {
|
|
|
9
9
|
readonly netcore: "netcore";
|
|
10
10
|
};
|
|
11
11
|
type LogGA = (event: string, params?: any, provider?: `${keyof typeof EventProvider}`) => void;
|
|
12
|
+
export interface ChatUIAdapter {
|
|
13
|
+
toast?: {
|
|
14
|
+
open: (params: any) => void;
|
|
15
|
+
};
|
|
16
|
+
alert?: {
|
|
17
|
+
open: (params: any) => void;
|
|
18
|
+
};
|
|
19
|
+
popup?: {
|
|
20
|
+
open: (params: any) => void;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
12
23
|
export interface ChatContextType {
|
|
13
24
|
logGA?: LogGA;
|
|
14
25
|
applicationType: DChatApplicationType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../../src/types/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AAErD,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,KAAK,KAAK,GAAG,CACX,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,GAAG,EACZ,QAAQ,CAAC,EAAE,GAAG,MAAM,OAAO,aAAa,EAAE,KACvC,IAAI,CAAC;AAEV,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,eAAe,EAAE,oBAAoB,CAAC;CACvC;AAED,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;IAChD,KAAK,CAAC,EAAE,KAAK,CA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AAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IACrC,uBAAuB,EAAE,MAAM,IAAI,CAAC;IACpC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,sBAAsB,EAAE,CAAC,IAAI,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;CAChE;AAED,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;CAAG;AAErE,MAAM,WAAW,mBAAmB;IAClC,eAAe,EAAE,oBAAoB,CAAC;IACtC,WAAW,CAAC,EAAE;QACZ,IAAI,EAAE,cAAc,CAAC;QACrB,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM,CAAC;YAChB,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;KACH,CAAC;IACF,YAAY,EAAE,aAAa,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UIUtils.d.ts","sourceRoot":"","sources":["../../../../src/utils/UIUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAenD,eAAO,MAAM,eAAe,GAAI,SAAS,aAAa,KAAG,IAExD,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,aAAa,CAU3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imageUtils.d.ts","sourceRoot":"","sources":["../../../../src/utils/imageUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"imageUtils.d.ts","sourceRoot":"","sources":["../../../../src/utils/imageUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAItD,eAAO,MAAM,YAAY,QAAO,MAE/B,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,GAAG,SAAS,KAAG,OAI1D,CAAC;AAGF,eAAO,MAAM,iBAAiB,GAAI,YAAY,GAAG,KAAG,OAInD,CAAC;AA+BF,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,KAAG,MAG9C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,WAAW,MAAM,KAAG,MAkB/C,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,KAAG,MAM9C,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,MAAM,SAAS,KAAG,MAAM,GAAG,IAiB5D,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,SAAS,MAAM,KAAG,MAExD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run `items` through `fn` with at most `concurrency` items in-flight at once.
|
|
3
|
+
* Errors per-item are swallowed — wrap `fn` if you need to capture them.
|
|
4
|
+
*/
|
|
5
|
+
export declare function pLimit<T>(items: T[], fn: (item: T, index: number) => Promise<void>, concurrency: number): Promise<void>;
|
|
6
|
+
//# sourceMappingURL=pLimit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pLimit.d.ts","sourceRoot":"","sources":["../../../../src/utils/pLimit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAsB,MAAM,CAAC,CAAC,EAC5B,KAAK,EAAE,CAAC,EAAE,EACV,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EAC7C,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAWf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"videoThumbnail.d.ts","sourceRoot":"","sources":["../../../../src/utils/videoThumbnail.ts"],"names":[],"mappings":"AAIA,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"videoThumbnail.d.ts","sourceRoot":"","sources":["../../../../src/utils/videoThumbnail.ts"],"names":[],"mappings":"AAIA,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAmED,eAAO,MAAM,kBAAkB;mCAEhB,MAAM,YACR,gBAAgB,KACxB,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;sCA4DM,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;0CAYhD,MAAM,EAAE,YACX,gBAAgB,KACxB,OAAO,CAAC,eAAe,EAAE,CAAC;CAe9B,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Video as PickedVideo } from 'react-native-image-crop-picker';
|
|
2
|
+
import type { ImageWithUploadStatus } from '../hooks/useImageAttachment';
|
|
3
|
+
export type VideoWithUploadStatus = Omit<ImageWithUploadStatus, 'image'> & {
|
|
4
|
+
image: PickedVideo;
|
|
5
|
+
};
|
|
6
|
+
export interface VideoThumbnailResult {
|
|
7
|
+
url: string;
|
|
8
|
+
size: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function generateAndUploadVideoThumbnails(videos: VideoWithUploadStatus[]): Promise<Record<string, VideoThumbnailResult>>;
|
|
11
|
+
//# sourceMappingURL=videoThumbnailUpload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"videoThumbnailUpload.d.ts","sourceRoot":"","sources":["../../../../src/utils/videoThumbnailUpload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEzE,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,EAAE,OAAO,CAAC,GAAG;IACzE,KAAK,EAAE,WAAW,CAAC;CACpB,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,qBAAqB,EAAE,GAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAoF/C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@droppii-org/chat-mobile",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.25",
|
|
4
4
|
"description": "Droppii chat mobile",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"example-legacy": "yarn workspace @droppii-org/chat-mobile-example-legacy"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@droppii/openim-rn-client-sdk": "git+ssh://git@github.com/droppii/open-im-sdk-reactnative.git#v1.0.0-
|
|
72
|
+
"@droppii/openim-rn-client-sdk": "git+ssh://git@github.com/droppii/open-im-sdk-reactnative.git#v1.0.0-rc12",
|
|
73
73
|
"@legendapp/list": "^3.0.6",
|
|
74
74
|
"axios": "^1.16.1",
|
|
75
75
|
"lodash": "^4.18.1",
|
|
Binary file
|
|
@@ -2,7 +2,7 @@ import { memo, useCallback } from 'react';
|
|
|
2
2
|
import { ActivityIndicator, StyleSheet } from 'react-native';
|
|
3
3
|
import { KContainer, KImage, KLabel, KColors } from '@droppii/libs';
|
|
4
4
|
import FileViewer from 'react-native-file-viewer';
|
|
5
|
-
import UIUtils from '../../utils/
|
|
5
|
+
import { UIUtils } from '../../utils/UIUtils';
|
|
6
6
|
import { trans } from '../../translation';
|
|
7
7
|
import { formatFileSize, getFileIcon } from '../../utils/imageUtils';
|
|
8
8
|
import type { AttachmentItem } from '../../types/attachment';
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { memo } from 'react';
|
|
2
|
+
import { ActivityIndicator, StyleSheet } from 'react-native';
|
|
3
|
+
import { KColors, KContainer, KImage, KSpacingValue } from '@droppii/libs';
|
|
4
|
+
import { MessageStatus } from '@droppii/openim-rn-client-sdk';
|
|
5
|
+
import type { MessageItem } from '@droppii/openim-rn-client-sdk';
|
|
6
|
+
import Images from '../../assets/images';
|
|
7
|
+
|
|
8
|
+
interface MessageStatusIndicatorProps {
|
|
9
|
+
message: MessageItem;
|
|
10
|
+
isOutgoing: boolean;
|
|
11
|
+
onRetry?: (message: MessageItem) => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const MessageStatusIndicator = memo(
|
|
15
|
+
({ message, isOutgoing, onRetry }: MessageStatusIndicatorProps) => {
|
|
16
|
+
if (!isOutgoing) return null;
|
|
17
|
+
|
|
18
|
+
const status = message.status;
|
|
19
|
+
|
|
20
|
+
if (status === MessageStatus.Sending) {
|
|
21
|
+
return (
|
|
22
|
+
<ActivityIndicator
|
|
23
|
+
size={3}
|
|
24
|
+
color={KColors.gray.normal}
|
|
25
|
+
style={styles.spinner}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// if (status === MessageStatus.Succeed) {
|
|
31
|
+
// return (
|
|
32
|
+
// <KImage.CommonIcon
|
|
33
|
+
// vectorName="check-multiple-o"
|
|
34
|
+
// vectorProvider="DroppiiNew"
|
|
35
|
+
// tintColor={STATUS_GREEN}
|
|
36
|
+
// size={14}
|
|
37
|
+
// />
|
|
38
|
+
// );
|
|
39
|
+
// }
|
|
40
|
+
|
|
41
|
+
if (status === MessageStatus.Failed) {
|
|
42
|
+
return (
|
|
43
|
+
<KContainer.Touchable
|
|
44
|
+
onPress={() => onRetry?.(message)}
|
|
45
|
+
style={styles.resendButton}
|
|
46
|
+
activeOpacity={0.7}
|
|
47
|
+
>
|
|
48
|
+
<KImage.Base
|
|
49
|
+
uri={Images.BTN_RESEND}
|
|
50
|
+
style={styles.resendIcon}
|
|
51
|
+
resizeMode="contain"
|
|
52
|
+
/>
|
|
53
|
+
</KContainer.Touchable>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
MessageStatusIndicator.displayName = 'MessageStatusIndicator';
|
|
62
|
+
|
|
63
|
+
const styles = StyleSheet.create({
|
|
64
|
+
spinner: {
|
|
65
|
+
width: 14,
|
|
66
|
+
height: 14,
|
|
67
|
+
marginRight: KSpacingValue['0.5rem'],
|
|
68
|
+
},
|
|
69
|
+
resendButton: {
|
|
70
|
+
marginRight: KSpacingValue['0.5rem'],
|
|
71
|
+
width: 28,
|
|
72
|
+
height: 28,
|
|
73
|
+
borderRadius: 14,
|
|
74
|
+
backgroundColor: KColors.palette.danger.w25,
|
|
75
|
+
alignItems: 'center',
|
|
76
|
+
justifyContent: 'center',
|
|
77
|
+
},
|
|
78
|
+
resendIcon: {
|
|
79
|
+
width: 16,
|
|
80
|
+
height: 16,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
formatFileSize,
|
|
12
12
|
} from '../../../utils/imageUtils';
|
|
13
13
|
import { trans } from '../../../translation';
|
|
14
|
-
|
|
15
14
|
export const FileMessage = memo(
|
|
16
15
|
({ message, isOutgoing }: BaseLegendMessageProps) => {
|
|
17
16
|
const fileName = message.fileElem?.fileName || '[File]';
|
|
@@ -1,9 +1,39 @@
|
|
|
1
1
|
import { memo, useState, useCallback, useMemo } from 'react';
|
|
2
|
-
import { StyleSheet,
|
|
2
|
+
import { StyleSheet, useWindowDimensions } from 'react-native';
|
|
3
3
|
import { KContainer, KImage } from '@droppii/libs';
|
|
4
4
|
import ChatImageDimens from '../../../utils/chatImageDimens';
|
|
5
5
|
import { messageStyles } from '../styles';
|
|
6
6
|
import type { BaseLegendMessageProps } from '../types';
|
|
7
|
+
const DEFAULT_DIMS = { width: 300, height: 300 };
|
|
8
|
+
|
|
9
|
+
// Module-level cache: survives component unmount/remount (e.g. status updates)
|
|
10
|
+
// Bounded to ~500 entries (~40KB) — evicts oldest when full
|
|
11
|
+
const MAX_CACHE = 500;
|
|
12
|
+
const dimsCache = new Map<string, { width: number; height: number }>();
|
|
13
|
+
const cacheDims = (url: string, dims: { width: number; height: number }) => {
|
|
14
|
+
if (dimsCache.size >= MAX_CACHE) {
|
|
15
|
+
dimsCache.delete(dimsCache.keys().next().value!);
|
|
16
|
+
}
|
|
17
|
+
dimsCache.set(url, dims);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const calcDisplayDims = (
|
|
21
|
+
imgWidth: number,
|
|
22
|
+
imgHeight: number,
|
|
23
|
+
windowWidth: number
|
|
24
|
+
) => {
|
|
25
|
+
const aspectRatio = imgWidth / imgHeight;
|
|
26
|
+
const horizontalBuffer = 16;
|
|
27
|
+
const maxWidth = Math.floor(windowWidth * 0.75 - horizontalBuffer);
|
|
28
|
+
let finalWidth = maxWidth;
|
|
29
|
+
let finalHeight = maxWidth / aspectRatio;
|
|
30
|
+
const maxHeight = 500;
|
|
31
|
+
if (finalHeight > maxHeight) {
|
|
32
|
+
finalHeight = maxHeight;
|
|
33
|
+
finalWidth = finalHeight * aspectRatio;
|
|
34
|
+
}
|
|
35
|
+
return { width: Math.round(finalWidth), height: Math.round(finalHeight) };
|
|
36
|
+
};
|
|
7
37
|
|
|
8
38
|
export const ImageMessage = memo(
|
|
9
39
|
({ message, onMediaPress }: BaseLegendMessageProps) => {
|
|
@@ -15,60 +45,46 @@ export const ImageMessage = memo(
|
|
|
15
45
|
pictureElem?.bigPicture?.url ||
|
|
16
46
|
pictureElem?.sourcePicture?.url;
|
|
17
47
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
48
|
+
const metaWidth =
|
|
49
|
+
pictureElem?.bigPicture?.width ||
|
|
50
|
+
pictureElem?.snapshotPicture?.width ||
|
|
51
|
+
pictureElem?.width;
|
|
52
|
+
const metaHeight =
|
|
53
|
+
pictureElem?.bigPicture?.height ||
|
|
54
|
+
pictureElem?.snapshotPicture?.height ||
|
|
55
|
+
pictureElem?.height;
|
|
56
|
+
|
|
57
|
+
// Fallback dims from onLoad when metadata is missing (zero extra request)
|
|
58
|
+
const cachedDims = rawImageUrl
|
|
59
|
+
? (dimsCache.get(rawImageUrl) ?? null)
|
|
60
|
+
: null;
|
|
61
|
+
const [loadedDims, setLoadedDims] = useState<{
|
|
62
|
+
width: number;
|
|
63
|
+
height: number;
|
|
64
|
+
} | null>(cachedDims);
|
|
30
65
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (!
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
66
|
+
const imageDimensions = useMemo(() => {
|
|
67
|
+
if (!rawImageUrl) return DEFAULT_DIMS;
|
|
68
|
+
const srcWidth = metaWidth || loadedDims?.width;
|
|
69
|
+
const srcHeight = metaHeight || loadedDims?.height;
|
|
70
|
+
if (!srcWidth || !srcHeight) return DEFAULT_DIMS;
|
|
71
|
+
return calcDisplayDims(srcWidth, srcHeight, windowWidth);
|
|
72
|
+
}, [metaWidth, metaHeight, loadedDims, rawImageUrl, windowWidth]);
|
|
73
|
+
|
|
74
|
+
const handleLoad = useCallback(
|
|
75
|
+
(e: any) => {
|
|
76
|
+
setIsLoading(false);
|
|
77
|
+
if (!metaWidth || !metaHeight) {
|
|
78
|
+
const { width, height } = e?.nativeEvent ?? {};
|
|
79
|
+
if (width && height) {
|
|
80
|
+
const dims = { width, height };
|
|
81
|
+
if (rawImageUrl) cacheDims(rawImageUrl, dims);
|
|
82
|
+
setLoadedDims(dims);
|
|
83
|
+
}
|
|
44
84
|
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// Account for all margins/padding: use 75% of window width with buffer
|
|
49
|
-
const horizontalBuffer = 16; // Left and right combined buffer
|
|
50
|
-
const maxWidth = Math.floor(windowWidth * 0.75 - horizontalBuffer);
|
|
51
|
-
|
|
52
|
-
// Calculate final dimensions
|
|
53
|
-
let finalWidth = maxWidth;
|
|
54
|
-
let finalHeight = maxWidth / aspectRatio;
|
|
55
|
-
|
|
56
|
-
// Cap maximum height to avoid overly tall images
|
|
57
|
-
const maxHeight = 500;
|
|
58
|
-
if (finalHeight > maxHeight) {
|
|
59
|
-
finalHeight = maxHeight;
|
|
60
|
-
finalWidth = finalHeight * aspectRatio;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return {
|
|
64
|
-
width: Math.round(finalWidth),
|
|
65
|
-
height: Math.round(finalHeight),
|
|
66
|
-
};
|
|
67
|
-
}, [pictureElem, rawImageUrl, windowWidth]);
|
|
68
|
-
|
|
69
|
-
const handleLoadEnd = useCallback(() => {
|
|
70
|
-
setIsLoading(false);
|
|
71
|
-
}, []);
|
|
85
|
+
},
|
|
86
|
+
[metaWidth, metaHeight, rawImageUrl]
|
|
87
|
+
);
|
|
72
88
|
|
|
73
89
|
const handlePress = useCallback(() => {
|
|
74
90
|
onMediaPress?.([{ url: rawImageUrl }], 0);
|
|
@@ -78,12 +94,12 @@ export const ImageMessage = memo(
|
|
|
78
94
|
return null;
|
|
79
95
|
}
|
|
80
96
|
|
|
81
|
-
// Use dynamic optimization matching calculated dimensions
|
|
82
97
|
const optimizedUrl = ChatImageDimens.getOptimizedImageUrlWithDimensions(
|
|
83
98
|
rawImageUrl,
|
|
84
99
|
imageDimensions.width,
|
|
85
100
|
imageDimensions.height
|
|
86
101
|
);
|
|
102
|
+
|
|
87
103
|
return (
|
|
88
104
|
<KContainer.View style={[messageStyles.wrapper, styles.wrapper]}>
|
|
89
105
|
<KContainer.Touchable
|
|
@@ -102,9 +118,8 @@ export const ImageMessage = memo(
|
|
|
102
118
|
width={imageDimensions.width}
|
|
103
119
|
height={imageDimensions.height}
|
|
104
120
|
style={[messageStyles.imageBubble]}
|
|
105
|
-
|
|
121
|
+
onLoad={handleLoad}
|
|
106
122
|
/>
|
|
107
|
-
|
|
108
123
|
{isLoading && <KContainer.View style={styles.skeleton} />}
|
|
109
124
|
</KContainer.Touchable>
|
|
110
125
|
</KContainer.View>
|
|
@@ -116,7 +131,6 @@ ImageMessage.displayName = 'ImageMessage';
|
|
|
116
131
|
|
|
117
132
|
const styles = StyleSheet.create({
|
|
118
133
|
wrapper: {
|
|
119
|
-
// paddingRight: 8,
|
|
120
134
|
overflow: 'hidden',
|
|
121
135
|
},
|
|
122
136
|
skeleton: {
|