isometrik-plugin-chat-sdk 2.0.20 → 2.0.22
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/cjs/admin-transfer-dialog.cjs.entry.js +2 -2
- package/dist/cjs/{app-globals-2824b330.js → app-globals-0e7848be.js} +3 -3
- package/dist/cjs/{app-globals-2824b330.js.map → app-globals-0e7848be.js.map} +1 -1
- package/dist/cjs/{attachment-preview_22.cjs.entry.js → attachment-preview_23.cjs.entry.js} +692 -388
- package/dist/cjs/attachment-preview_23.cjs.entry.js.map +1 -0
- package/dist/cjs/audio-bubble_4.cjs.entry.js +66 -22
- package/dist/cjs/audio-bubble_4.cjs.entry.js.map +1 -1
- package/dist/cjs/chat-app.cjs.entry.js +1 -1
- package/dist/cjs/chat-document-message-bubble.cjs.entry.js +1 -1
- package/dist/cjs/chat-image-message-bubble.cjs.entry.js +1 -1
- package/dist/cjs/chat-tile_3.cjs.entry.js +14 -10
- package/dist/cjs/chat-tile_3.cjs.entry.js.map +1 -1
- package/dist/cjs/chat-video-message-bubble.cjs.entry.js +1 -1
- package/dist/cjs/confirm-dialog.cjs.entry.js +1 -1
- package/dist/cjs/{content-ebca062a.js → content-8b271b56.js} +3 -1
- package/dist/cjs/content-8b271b56.js.map +1 -0
- package/dist/cjs/delete-message.cjs.entry.js +1 -1
- package/dist/cjs/download-9ccc0a6c.js +120 -0
- package/dist/cjs/download-9ccc0a6c.js.map +1 -0
- package/dist/cjs/{drawer-00a2323a.js → drawer-3f9c87b4.js} +42 -5
- package/dist/cjs/drawer-3f9c87b4.js.map +1 -0
- package/dist/cjs/forward-memebers.cjs.entry.js +61 -24
- package/dist/cjs/forward-memebers.cjs.entry.js.map +1 -1
- package/dist/cjs/forward-message.cjs.entry.js +2 -2
- package/dist/cjs/group-chat-contacts.cjs.entry.js +2 -2
- package/dist/cjs/{group-members-b3bea06e.js → group-members-1205fc4c.js} +5 -5
- package/dist/cjs/{group-members-b3bea06e.js.map → group-members-1205fc4c.js.map} +1 -1
- package/dist/cjs/{groupcast-8441b4df.js → groupcast-bb393c81.js} +14 -54
- package/dist/cjs/groupcast-bb393c81.js.map +1 -0
- package/dist/cjs/{groupcast-f24da720.js → groupcast-e1e52bd1.js} +16 -16
- package/dist/cjs/{groupcast-f24da720.js.map → groupcast-e1e52bd1.js.map} +1 -1
- package/dist/cjs/{helpers-154861e9.js → helpers-877a7116.js} +30 -1
- package/dist/cjs/helpers-877a7116.js.map +1 -0
- package/dist/cjs/index.cjs.js +8 -6
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/{toast-91093c84.js → index.m-ff115b26.js} +1 -156
- package/dist/cjs/{toast-91093c84.js.map → index.m-ff115b26.js.map} +1 -1
- package/dist/cjs/info-panel-media_2.cjs.entry.js +244 -0
- package/dist/cjs/info-panel-media_2.cjs.entry.js.map +1 -0
- package/dist/cjs/isometrik-webchat.cjs.js +11 -9
- package/dist/cjs/isometrik-webchat.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +11 -9
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/{local-notification-bdd04d7a.js → local-notification-a86a2b34.js} +3 -3
- package/dist/cjs/local-notification-a86a2b34.js.map +1 -0
- package/dist/cjs/login-page_3.cjs.entry.js +258 -104
- package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
- package/dist/cjs/media-gallery.cjs.entry.js +10 -2
- package/dist/cjs/media-gallery.cjs.entry.js.map +1 -1
- package/dist/cjs/member-add.cjs.entry.js +20 -11
- package/dist/cjs/member-add.cjs.entry.js.map +1 -1
- package/dist/cjs/message-bubble.cjs.entry.js +2 -2
- package/dist/cjs/{message-reaction-82a4f93c.js → message-reaction-8f93a048.js} +5 -5
- package/dist/cjs/{message-reaction-82a4f93c.js.map → message-reaction-8f93a048.js.map} +1 -1
- package/dist/cjs/messages-e129b34d.js +179 -0
- package/dist/cjs/messages-e129b34d.js.map +1 -0
- package/dist/cjs/my-component.cjs.entry.js +1 -1
- package/dist/cjs/new-chat-sidebar.cjs.entry.js +2 -2
- package/dist/cjs/play-b473e0ab.js +13 -0
- package/dist/cjs/play-b473e0ab.js.map +1 -0
- package/dist/cjs/profile-avatar.cjs.entry.js +1 -1
- package/dist/cjs/reaction-container.cjs.entry.js +5 -4
- package/dist/cjs/reaction-container.cjs.entry.js.map +1 -1
- package/dist/cjs/{runtime-controls-cfc8fc31.js → runtime-controls-a70872fe.js} +33 -15
- package/dist/cjs/runtime-controls-a70872fe.js.map +1 -0
- package/dist/cjs/{send-media-4ee967d4.js → send-media-8a841e50.js} +559 -192
- package/dist/cjs/send-media-8a841e50.js.map +1 -0
- package/dist/cjs/share-popup.cjs.entry.js +1 -1
- package/dist/cjs/signup-page.cjs.entry.js +2 -2
- package/dist/cjs/spinner-loader.cjs.entry.js +1 -1
- package/dist/cjs/{group-members-cef1198e.js → storage-quota-2e81fb71.js} +254 -10
- package/dist/cjs/storage-quota-2e81fb71.js.map +1 -0
- package/dist/cjs/toast-a75f822c.js +159 -0
- package/dist/cjs/toast-a75f822c.js.map +1 -0
- package/dist/collection/collection-manifest.json +10 -8
- package/dist/collection/components/ChatUIComponent/AddMember.js +14 -7
- package/dist/collection/components/ChatUIComponent/AddMember.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/ChatDocumentMessageBubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/ChatImageMessageBubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/ChatOwnProfile/Profile.js +8 -2
- package/dist/collection/components/ChatUIComponent/ChatOwnProfile/Profile.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js +90 -47
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/ChatVideoMessageBubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +105 -37
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js +45 -11
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/ReactionContainer.js +2 -2
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js +38 -13
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/WebChatBody/web-chat-body.css +1 -0
- package/dist/collection/components/ChatUIComponent/shared/AudioBubble/AudioBubble.js +22 -10
- package/dist/collection/components/ChatUIComponent/shared/AudioBubble/AudioBubble.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.js +55 -19
- package/dist/collection/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/admin-transfer-dialog/admin-transfer-dialog.js +2 -2
- package/dist/collection/components/ChatUIComponent/shared/attachment-preview/attachment-preview.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/block chatlist/BlockChatList.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/chat-loading-placeholder/chat-loading-placeholder.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/chat-tile/chat-tile.js +31 -9
- package/dist/collection/components/ChatUIComponent/shared/chat-tile/chat-tile.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/confirm-dialog/confirm-dialog.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js +66 -157
- package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/delete-message/delete-message.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/document-message/document-message.js +14 -4
- package/dist/collection/components/ChatUIComponent/shared/document-message/document-message.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/forward-message/forward-message.js +2 -2
- package/dist/collection/components/ChatUIComponent/shared/group-info/group-info.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/image-message/image-message.js +65 -2
- package/dist/collection/components/ChatUIComponent/shared/image-message/image-message.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/incoming-text-message-bubble/incoming-text-message-bubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/info-panel-media/info-panel-media.js +335 -0
- package/dist/collection/components/ChatUIComponent/shared/info-panel-media/info-panel-media.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/shared/link-preview/link-preview.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/media-gallery/media-gallery.js +11 -2
- package/dist/collection/components/ChatUIComponent/shared/media-gallery/media-gallery.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/message-bubble/message-bubble.js +2 -2
- package/dist/collection/components/ChatUIComponent/shared/message-date-pill/message-date-pill.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/message-info/message-info.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/message-search/message-search.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/new chat/new-chat.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/outgoing-text-message-bubble/outgoing-text-message-bubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/profile sidebar/profile-sidebar.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/profile-avatar/profile-avatar.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/profile-info/profile-info.js +70 -3
- package/dist/collection/components/ChatUIComponent/shared/profile-info/profile-info.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/reply-block/reply-block.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/reply-message-container/reply-message-container.js +31 -2
- package/dist/collection/components/ChatUIComponent/shared/reply-message-container/reply-message-container.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/reply-message-container/reply-message-container.stories.js +10 -6
- package/dist/collection/components/ChatUIComponent/shared/searchable list/searchable-list.js +3 -3
- package/dist/collection/components/ChatUIComponent/shared/share-popup/share-popup.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/spinner-loader/spinner-loader.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/storage/storage-manager.js +140 -0
- package/dist/collection/components/ChatUIComponent/shared/storage/storage-manager.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/shared/video-message/video-message.js +35 -3
- package/dist/collection/components/ChatUIComponent/shared/video-message/video-message.js.map +1 -1
- package/dist/collection/components/Login.js +1 -1
- package/dist/collection/components/Signup.js +2 -2
- package/dist/collection/components/chat-main.js +1 -1
- package/dist/collection/components/my-component/my-component.js +1 -1
- package/dist/collection/components/my-component/web-chat/WebChat.js +145 -1
- package/dist/collection/components/my-component/web-chat/WebChat.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/WebchatRightSide.js +44 -2
- package/dist/collection/components/my-component/web-chat/WebchatRightSide.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/bootstrap.js +1 -0
- package/dist/collection/components/my-component/web-chat/bootstrap.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/conversation-ops.js +22 -2
- package/dist/collection/components/my-component/web-chat/conversation-ops.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/data-fetch.js +9 -4
- package/dist/collection/components/my-component/web-chat/data-fetch.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/event-handlers.js +51 -10
- package/dist/collection/components/my-component/web-chat/event-handlers.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/mutations.js +38 -8
- package/dist/collection/components/my-component/web-chat/mutations.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/offline-host.js +31 -17
- package/dist/collection/components/my-component/web-chat/offline-host.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/public-send.js +6 -1
- package/dist/collection/components/my-component/web-chat/public-send.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/shell-render.js +11 -9
- package/dist/collection/components/my-component/web-chat/shell-render.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/web-chat.css +40 -3
- package/dist/collection/components/theme-provider.js +1 -1
- package/dist/collection/constants/content.js +2 -0
- package/dist/collection/lib/chat/block-status.js +12 -0
- package/dist/collection/lib/chat/block-status.js.map +1 -0
- package/dist/collection/lib/chat/clipboard-paste.js +68 -0
- package/dist/collection/lib/chat/clipboard-paste.js.map +1 -0
- package/dist/collection/lib/chat/conversations.js +47 -3
- package/dist/collection/lib/chat/conversations.js.map +1 -1
- package/dist/collection/lib/chat/download-media.js +112 -0
- package/dist/collection/lib/chat/download-media.js.map +1 -0
- package/dist/collection/lib/chat/index.js +6 -2
- package/dist/collection/lib/chat/index.js.map +1 -1
- package/dist/collection/lib/chat/local-notification.js +1 -1
- package/dist/collection/lib/chat/local-notification.js.map +1 -1
- package/dist/collection/lib/chat/same-name-upload.js +53 -0
- package/dist/collection/lib/chat/same-name-upload.js.map +1 -0
- package/dist/collection/lib/chat/send-media.js +194 -27
- package/dist/collection/lib/chat/send-media.js.map +1 -1
- package/dist/collection/lib/chat/session.js +9 -3
- package/dist/collection/lib/chat/session.js.map +1 -1
- package/dist/collection/lib/chat/storage-quota.js +226 -0
- package/dist/collection/lib/chat/storage-quota.js.map +1 -0
- package/dist/collection/lib/custom-ui/public-api.js +5 -0
- package/dist/collection/lib/custom-ui/public-api.js.map +1 -1
- package/dist/collection/lib/drawer.js +42 -4
- package/dist/collection/lib/drawer.js.map +1 -1
- package/dist/collection/lib/helpers.js +29 -1
- package/dist/collection/lib/mqtt/dispatch.js +7 -3
- package/dist/collection/lib/mqtt/dispatch.js.map +1 -1
- package/dist/collection/sdk/headless-api.js +8 -0
- package/dist/collection/sdk/headless-api.js.map +1 -1
- package/dist/collection/sdk/index.js +1 -0
- package/dist/collection/sdk/index.js.map +1 -1
- package/dist/collection/sdk/webchat-api.js +5 -0
- package/dist/collection/sdk/webchat-api.js.map +1 -1
- package/dist/collection/store/storage-quota.js +244 -0
- package/dist/collection/store/storage-quota.js.map +1 -0
- package/dist/collection/testing/iso-chat-sdk-mock.js +10 -6
- package/dist/components/AudioBubble.js +22 -10
- package/dist/components/AudioBubble.js.map +1 -1
- package/dist/components/BlockChatList.js +2 -2
- package/dist/components/ChatFooter.js +172 -37
- package/dist/components/ChatFooter.js.map +1 -1
- package/dist/components/ChatSidebar.js +102 -49
- package/dist/components/ChatSidebar.js.map +1 -1
- package/dist/components/GroupCast2.js +1 -1
- package/dist/components/Login.js +1 -1
- package/dist/components/Profile.js +20 -9
- package/dist/components/Profile.js.map +1 -1
- package/dist/components/WebChat.js +301 -126
- package/dist/components/WebChat.js.map +1 -1
- package/dist/components/WebChatBody.js +39 -14
- package/dist/components/WebChatBody.js.map +1 -1
- package/dist/components/WebChatHeader.js +48 -15
- package/dist/components/WebChatHeader.js.map +1 -1
- package/dist/components/WebchatRightSide.js +22 -7
- package/dist/components/WebchatRightSide.js.map +1 -1
- package/dist/components/admin-transfer-dialog.js +2 -2
- package/dist/components/attachment-preview2.js +1 -1
- package/dist/components/chat-app.js +85 -73
- package/dist/components/chat-app.js.map +1 -1
- package/dist/components/chat-assets.js +1 -1
- package/dist/components/chat-document-message-bubble.js +1 -1
- package/dist/components/chat-image-message-bubble.js +1 -1
- package/dist/components/chat-loading-placeholder2.js +1 -1
- package/dist/components/chat-tile2.js +12 -7
- package/dist/components/chat-tile2.js.map +1 -1
- package/dist/components/chat-video-message-bubble.js +1 -1
- package/dist/components/client.js +11 -47
- package/dist/components/client.js.map +1 -1
- package/dist/components/confirm-dialog.js +1 -1
- package/dist/components/contact-info2.js +73 -162
- package/dist/components/contact-info2.js.map +1 -1
- package/dist/components/content.js +2 -0
- package/dist/components/content.js.map +1 -1
- package/dist/components/conversation.js +1 -1
- package/dist/components/conversations.js +91 -0
- package/dist/components/conversations.js.map +1 -0
- package/dist/components/delete-message.js +1 -1
- package/dist/components/document-message2.js +15 -6
- package/dist/components/document-message2.js.map +1 -1
- package/dist/components/download-media.js +115 -0
- package/dist/components/download-media.js.map +1 -0
- package/dist/components/download.js +5 -0
- package/dist/components/download.js.map +1 -0
- package/dist/components/drawer.js +42 -5
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/forward-memebers.js +56 -20
- package/dist/components/forward-memebers.js.map +1 -1
- package/dist/components/forward-message.js +2 -2
- package/dist/components/group-chat-contacts2.js +1 -1
- package/dist/components/group-info.js +1 -1
- package/dist/components/group-members.js +26 -298
- package/dist/components/group-members.js.map +1 -1
- package/dist/components/helpers.js +28 -1
- package/dist/components/helpers.js.map +1 -1
- package/dist/components/image-message2.js +17 -2
- package/dist/components/image-message2.js.map +1 -1
- package/dist/components/incoming-text-message-bubble2.js +1 -1
- package/dist/components/index.js +21 -2
- package/dist/components/index.js.map +1 -1
- package/dist/{esm/group-members-7909941c.js → components/index3.js} +3 -52
- package/dist/components/index3.js.map +1 -0
- package/dist/components/info-panel-media.d.ts +11 -0
- package/dist/components/info-panel-media.js +8 -0
- package/dist/components/info-panel-media.js.map +1 -0
- package/dist/components/info-panel-media2.js +242 -0
- package/dist/components/info-panel-media2.js.map +1 -0
- package/dist/components/link-preview2.js +1 -1
- package/dist/components/local-notification.js +1 -1
- package/dist/components/local-notification.js.map +1 -1
- package/dist/components/media-gallery.js +11 -2
- package/dist/components/media-gallery.js.map +1 -1
- package/dist/components/member-add.js +16 -9
- package/dist/components/member-add.js.map +1 -1
- package/dist/components/message-bubble2.js +2 -2
- package/dist/components/message-date-pill2.js +1 -1
- package/dist/components/message-info2.js +2 -2
- package/dist/components/message-search2.js +1 -1
- package/dist/components/messages.js +1 -1
- package/dist/components/my-component.js +1 -1
- package/dist/components/new-chat-sidebar.js +1 -1
- package/dist/components/new-chat2.js +1 -1
- package/dist/components/outgoing-text-message-bubble2.js +1 -1
- package/dist/components/profile-avatar2.js +1 -1
- package/dist/components/profile-info2.js +69 -6
- package/dist/components/profile-info2.js.map +1 -1
- package/dist/components/profile-sidebar2.js +2 -2
- package/dist/components/prompt-exit-group.js +26 -3
- package/dist/components/prompt-exit-group.js.map +1 -1
- package/dist/components/reaction-container.js +2 -2
- package/dist/components/reply-block2.js +1 -1
- package/dist/components/reply-message-container2.js +12 -2
- package/dist/components/reply-message-container2.js.map +1 -1
- package/dist/components/searchable-list2.js +3 -3
- package/dist/components/send-media.js +242 -33
- package/dist/components/send-media.js.map +1 -1
- package/dist/components/share-popup.js +1 -1
- package/dist/components/signup-page.js +2 -2
- package/dist/components/spinner-loader2.js +1 -1
- package/dist/components/storage-manager.js +125 -0
- package/dist/components/storage-manager.js.map +1 -0
- package/dist/components/storage-quota.js +223 -0
- package/dist/components/storage-quota.js.map +1 -0
- package/dist/components/storage-quota2.js +248 -0
- package/dist/components/storage-quota2.js.map +1 -0
- package/dist/components/theme-provider2.js +1 -1
- package/dist/components/video-message2.js +19 -3
- package/dist/components/video-message2.js.map +1 -1
- package/dist/components/web-chat-storage.d.ts +11 -0
- package/dist/components/web-chat-storage.js +8 -0
- package/dist/components/web-chat-storage.js.map +1 -0
- package/dist/esm/admin-transfer-dialog.entry.js +2 -2
- package/dist/esm/{app-globals-e3f4717b.js → app-globals-eba1ca0c.js} +3 -3
- package/dist/esm/{app-globals-e3f4717b.js.map → app-globals-eba1ca0c.js.map} +1 -1
- package/dist/esm/{attachment-preview_22.entry.js → attachment-preview_23.entry.js} +657 -354
- package/dist/esm/attachment-preview_23.entry.js.map +1 -0
- package/dist/esm/audio-bubble_4.entry.js +66 -22
- package/dist/esm/audio-bubble_4.entry.js.map +1 -1
- package/dist/esm/chat-app.entry.js +1 -1
- package/dist/esm/chat-document-message-bubble.entry.js +1 -1
- package/dist/esm/chat-image-message-bubble.entry.js +1 -1
- package/dist/esm/chat-tile_3.entry.js +15 -11
- package/dist/esm/chat-tile_3.entry.js.map +1 -1
- package/dist/esm/chat-video-message-bubble.entry.js +1 -1
- package/dist/esm/confirm-dialog.entry.js +1 -1
- package/dist/esm/{content-fb138a93.js → content-fd0af283.js} +3 -1
- package/dist/esm/content-fd0af283.js.map +1 -0
- package/dist/esm/delete-message.entry.js +1 -1
- package/dist/esm/download-5368a10f.js +117 -0
- package/dist/esm/download-5368a10f.js.map +1 -0
- package/dist/esm/{drawer-7de04622.js → drawer-a457d820.js} +43 -6
- package/dist/esm/drawer-a457d820.js.map +1 -0
- package/dist/esm/forward-memebers.entry.js +59 -22
- package/dist/esm/forward-memebers.entry.js.map +1 -1
- package/dist/esm/forward-message.entry.js +2 -2
- package/dist/esm/group-chat-contacts.entry.js +2 -2
- package/dist/esm/{group-members-36cf9395.js → group-members-d603f29f.js} +2 -2
- package/dist/esm/{group-members-36cf9395.js.map → group-members-d603f29f.js.map} +1 -1
- package/dist/esm/{groupcast-5fb19ec3.js → groupcast-4f15b050.js} +14 -50
- package/dist/esm/groupcast-4f15b050.js.map +1 -0
- package/dist/esm/{groupcast-f96c1d9e.js → groupcast-c6da3918.js} +2 -2
- package/dist/esm/{groupcast-f96c1d9e.js.map → groupcast-c6da3918.js.map} +1 -1
- package/dist/esm/{helpers-f33b895c.js → helpers-1632a4c7.js} +29 -2
- package/dist/esm/helpers-1632a4c7.js.map +1 -0
- package/dist/esm/index.js +9 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/{toast-a1531088.js → index.m-8c70037f.js} +2 -156
- package/dist/esm/{toast-a1531088.js.map → index.m-8c70037f.js.map} +1 -1
- package/dist/esm/info-panel-media_2.entry.js +239 -0
- package/dist/esm/info-panel-media_2.entry.js.map +1 -0
- package/dist/esm/isometrik-webchat.js +11 -9
- package/dist/esm/isometrik-webchat.js.map +1 -1
- package/dist/esm/loader.js +11 -9
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/{local-notification-4c1e166d.js → local-notification-f9ae9062.js} +3 -3
- package/dist/esm/local-notification-f9ae9062.js.map +1 -0
- package/dist/esm/login-page_3.entry.js +219 -65
- package/dist/esm/login-page_3.entry.js.map +1 -1
- package/dist/esm/media-gallery.entry.js +10 -2
- package/dist/esm/media-gallery.entry.js.map +1 -1
- package/dist/esm/member-add.entry.js +20 -11
- package/dist/esm/member-add.entry.js.map +1 -1
- package/dist/esm/message-bubble.entry.js +2 -2
- package/dist/esm/{message-reaction-0d2ef75f.js → message-reaction-0a2bb115.js} +2 -2
- package/dist/esm/{message-reaction-0d2ef75f.js.map → message-reaction-0a2bb115.js.map} +1 -1
- package/dist/esm/messages-057dbecb.js +167 -0
- package/dist/esm/messages-057dbecb.js.map +1 -0
- package/dist/esm/my-component.entry.js +1 -1
- package/dist/esm/new-chat-sidebar.entry.js +2 -2
- package/dist/esm/play-05ae077a.js +9 -0
- package/dist/esm/play-05ae077a.js.map +1 -0
- package/dist/esm/profile-avatar.entry.js +1 -1
- package/dist/esm/reaction-container.entry.js +5 -4
- package/dist/esm/reaction-container.entry.js.map +1 -1
- package/dist/esm/{runtime-controls-ff81e90a.js → runtime-controls-bdb84aeb.js} +21 -3
- package/dist/esm/runtime-controls-bdb84aeb.js.map +1 -0
- package/dist/esm/{send-media-58e7145b.js → send-media-04f7ca0a.js} +533 -180
- package/dist/esm/send-media-04f7ca0a.js.map +1 -0
- package/dist/esm/share-popup.entry.js +1 -1
- package/dist/esm/signup-page.entry.js +2 -2
- package/dist/esm/spinner-loader.entry.js +1 -1
- package/dist/esm/storage-quota-6329fabe.js +578 -0
- package/dist/esm/storage-quota-6329fabe.js.map +1 -0
- package/dist/esm/toast-f681e916.js +157 -0
- package/dist/esm/toast-f681e916.js.map +1 -0
- package/dist/isometrik-webchat/index.esm.js +1 -1
- package/dist/isometrik-webchat/index.esm.js.map +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.esm.js.map +1 -1
- package/dist/isometrik-webchat/p-0161f40b.js +2 -0
- package/dist/isometrik-webchat/p-0161f40b.js.map +1 -0
- package/dist/isometrik-webchat/{p-d892b4d4.entry.js → p-02db2116.entry.js} +2 -2
- package/dist/isometrik-webchat/p-03933431.entry.js +2 -0
- package/dist/isometrik-webchat/{p-352b589e.entry.js.map → p-03933431.entry.js.map} +1 -1
- package/dist/isometrik-webchat/{p-c591fa45.js → p-04fdbd0a.js} +2 -2
- package/dist/isometrik-webchat/p-0bb42151.entry.js +2 -0
- package/dist/isometrik-webchat/p-0bb42151.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-c5bff6a1.entry.js → p-119fc683.entry.js} +2 -2
- package/dist/isometrik-webchat/p-19d37e1f.js +2 -0
- package/dist/isometrik-webchat/p-19d37e1f.js.map +1 -0
- package/dist/isometrik-webchat/{p-925decda.js → p-1dc52239.js} +2 -2
- package/dist/isometrik-webchat/p-1f0e8230.entry.js +2 -0
- package/dist/isometrik-webchat/p-1f0e8230.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-7b25f234.entry.js → p-35f2b9ae.entry.js} +2 -2
- package/dist/isometrik-webchat/p-3a0409fc.js +2 -0
- package/dist/isometrik-webchat/p-3a0409fc.js.map +1 -0
- package/dist/isometrik-webchat/{p-9982fa21.js → p-3dca1e56.js} +2 -2
- package/dist/isometrik-webchat/p-3dca1e56.js.map +1 -0
- package/dist/isometrik-webchat/p-40217f22.js +2 -0
- package/dist/isometrik-webchat/p-40217f22.js.map +1 -0
- package/dist/isometrik-webchat/{p-3b3dc33e.js → p-46be73c5.js} +2 -2
- package/dist/isometrik-webchat/p-56521ea4.entry.js +2 -0
- package/dist/isometrik-webchat/{p-f7d05551.entry.js → p-57f97cef.entry.js} +2 -2
- package/dist/isometrik-webchat/p-5f7eebbf.entry.js +2 -0
- package/dist/isometrik-webchat/p-605cb14e.entry.js +2 -0
- package/dist/isometrik-webchat/p-605cb14e.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-640e2c03.entry.js +2 -0
- package/dist/isometrik-webchat/p-69d953cb.entry.js +2 -0
- package/dist/isometrik-webchat/p-69d953cb.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-6c5eb178.js +2 -0
- package/dist/isometrik-webchat/{p-d8b65cf4.entry.js → p-6eadaa6c.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-161fcb35.entry.js → p-7130f547.entry.js} +2 -2
- package/dist/isometrik-webchat/p-782d1bd2.js +2 -0
- package/dist/isometrik-webchat/p-782d1bd2.js.map +1 -0
- package/dist/isometrik-webchat/p-8142a54d.js +2 -0
- package/dist/isometrik-webchat/p-8142a54d.js.map +1 -0
- package/dist/isometrik-webchat/{p-cbb1179b.entry.js → p-89a8fc58.entry.js} +2 -2
- package/dist/isometrik-webchat/p-8f17345f.js +7 -0
- package/dist/isometrik-webchat/p-8f17345f.js.map +1 -0
- package/dist/isometrik-webchat/p-991d5437.js +2 -0
- package/dist/isometrik-webchat/p-991d5437.js.map +1 -0
- package/dist/isometrik-webchat/p-9b70e93f.entry.js +2 -0
- package/dist/isometrik-webchat/p-a5faa465.entry.js +2 -0
- package/dist/isometrik-webchat/p-a5faa465.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-a83932d4.js +2 -0
- package/dist/isometrik-webchat/p-a83932d4.js.map +1 -0
- package/dist/isometrik-webchat/p-b0f6f9ab.entry.js +2 -0
- package/dist/isometrik-webchat/p-b0f6f9ab.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-3664e0ad.entry.js → p-b431d864.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-0ccfbe90.entry.js → p-b516938b.entry.js} +2 -2
- package/dist/isometrik-webchat/p-be09cdc8.js +2 -0
- package/dist/isometrik-webchat/p-be09cdc8.js.map +1 -0
- package/dist/isometrik-webchat/{p-5b965e04.js → p-c4b7babb.js} +2 -2
- package/dist/isometrik-webchat/{p-5b965e04.js.map → p-c4b7babb.js.map} +1 -1
- package/dist/isometrik-webchat/p-d0f6679d.entry.js +2 -0
- package/dist/isometrik-webchat/p-d0f6679d.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-d44c612a.entry.js +2 -0
- package/dist/isometrik-webchat/p-dc963574.entry.js +2 -0
- package/dist/isometrik-webchat/{p-5d1877d1.entry.js.map → p-dc963574.entry.js.map} +1 -1
- package/dist/isometrik-webchat/p-eb1f3118.entry.js +2 -0
- package/dist/isometrik-webchat/p-f18fa23d.js +2 -0
- package/dist/isometrik-webchat/p-f18fa23d.js.map +1 -0
- package/dist/isometrik-webchat/{p-08ba6153.entry.js → p-f5502a63.entry.js} +2 -2
- package/dist/types/components/ChatUIComponent/ChatOwnProfile/Profile.d.ts +2 -0
- package/dist/types/components/ChatUIComponent/ChatSidebar/ChatSidebar.d.ts +10 -0
- package/dist/types/components/ChatUIComponent/Footer/ChatFooter.d.ts +3 -0
- package/dist/types/components/ChatUIComponent/Header/WebChatHeader.d.ts +3 -0
- package/dist/types/components/ChatUIComponent/WebChatBody/WebChatBody.d.ts +5 -0
- package/dist/types/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.d.ts +5 -2
- package/dist/types/components/ChatUIComponent/shared/chat-tile/chat-tile.d.ts +4 -1
- package/dist/types/components/ChatUIComponent/shared/contact-info/contact-info.d.ts +8 -22
- package/dist/types/components/ChatUIComponent/shared/image-message/image-message.d.ts +5 -0
- package/dist/types/components/ChatUIComponent/shared/info-panel-media/info-panel-media.d.ts +45 -0
- package/dist/types/components/ChatUIComponent/shared/media-gallery/media-gallery.d.ts +1 -0
- package/dist/types/components/ChatUIComponent/shared/profile-info/profile-info.d.ts +8 -0
- package/dist/types/components/ChatUIComponent/shared/reply-message-container/reply-message-container.d.ts +3 -0
- package/dist/types/components/ChatUIComponent/shared/storage/storage-manager.d.ts +17 -0
- package/dist/types/components/ChatUIComponent/shared/video-message/video-message.d.ts +3 -0
- package/dist/types/components/my-component/web-chat/WebChat.d.ts +22 -0
- package/dist/types/components/my-component/web-chat/WebchatRightSide.d.ts +7 -0
- package/dist/types/components/my-component/web-chat/conversation-ops.d.ts +10 -2
- package/dist/types/components/my-component/web-chat/event-handlers.d.ts +5 -0
- package/dist/types/components/my-component/web-chat/mutations.d.ts +2 -2
- package/dist/types/components.d.ts +133 -2
- package/dist/types/lib/chat/block-status.d.ts +11 -0
- package/dist/types/lib/chat/clipboard-paste.d.ts +16 -0
- package/dist/types/lib/chat/download-media.d.ts +11 -0
- package/dist/types/lib/chat/index.d.ts +6 -2
- package/dist/types/lib/chat/same-name-upload.d.ts +24 -0
- package/dist/types/lib/chat/send-media.d.ts +90 -0
- package/dist/types/lib/chat/storage-quota.d.ts +98 -0
- package/dist/types/lib/custom-ui/public-api.d.ts +1 -1
- package/dist/types/lib/drawer.d.ts +1 -0
- package/dist/types/sdk/headless-api.d.ts +7 -0
- package/dist/types/sdk/index.d.ts +1 -0
- package/dist/types/sdk/webchat-api.d.ts +14 -0
- package/dist/types/store/storage-quota.d.ts +64 -0
- package/docs/MEDIA_STORAGE_QUOTA.md +130 -0
- package/package.json +3 -2
- package/dist/cjs/attachment-preview_22.cjs.entry.js.map +0 -1
- package/dist/cjs/content-ebca062a.js.map +0 -1
- package/dist/cjs/drawer-00a2323a.js.map +0 -1
- package/dist/cjs/group-members-cef1198e.js.map +0 -1
- package/dist/cjs/groupcast-8441b4df.js.map +0 -1
- package/dist/cjs/helpers-154861e9.js.map +0 -1
- package/dist/cjs/link-preview.cjs.entry.js +0 -49
- package/dist/cjs/link-preview.cjs.entry.js.map +0 -1
- package/dist/cjs/local-notification-bdd04d7a.js.map +0 -1
- package/dist/cjs/runtime-controls-cfc8fc31.js.map +0 -1
- package/dist/cjs/send-media-4ee967d4.js.map +0 -1
- package/dist/components/group-members2.js +0 -37
- package/dist/components/group-members2.js.map +0 -1
- package/dist/esm/attachment-preview_22.entry.js.map +0 -1
- package/dist/esm/content-fb138a93.js.map +0 -1
- package/dist/esm/drawer-7de04622.js.map +0 -1
- package/dist/esm/group-members-7909941c.js.map +0 -1
- package/dist/esm/groupcast-5fb19ec3.js.map +0 -1
- package/dist/esm/helpers-f33b895c.js.map +0 -1
- package/dist/esm/link-preview.entry.js +0 -45
- package/dist/esm/link-preview.entry.js.map +0 -1
- package/dist/esm/local-notification-4c1e166d.js.map +0 -1
- package/dist/esm/runtime-controls-ff81e90a.js.map +0 -1
- package/dist/esm/send-media-58e7145b.js.map +0 -1
- package/dist/isometrik-webchat/p-09980c53.entry.js +0 -2
- package/dist/isometrik-webchat/p-09980c53.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-1eecc7c5.entry.js +0 -2
- package/dist/isometrik-webchat/p-1eecc7c5.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-2cf296e6.entry.js +0 -2
- package/dist/isometrik-webchat/p-2e9974e1.entry.js +0 -2
- package/dist/isometrik-webchat/p-343f50b4.js +0 -7
- package/dist/isometrik-webchat/p-343f50b4.js.map +0 -1
- package/dist/isometrik-webchat/p-352b589e.entry.js +0 -2
- package/dist/isometrik-webchat/p-44da28d3.entry.js +0 -2
- package/dist/isometrik-webchat/p-44da28d3.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-48ce4dca.entry.js +0 -2
- package/dist/isometrik-webchat/p-52a575c0.entry.js +0 -2
- package/dist/isometrik-webchat/p-52a575c0.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-5cfb953d.js +0 -2
- package/dist/isometrik-webchat/p-5cfb953d.js.map +0 -1
- package/dist/isometrik-webchat/p-5d1877d1.entry.js +0 -2
- package/dist/isometrik-webchat/p-6f5037b2.js +0 -2
- package/dist/isometrik-webchat/p-6f5037b2.js.map +0 -1
- package/dist/isometrik-webchat/p-78fb47c4.js +0 -2
- package/dist/isometrik-webchat/p-78fb47c4.js.map +0 -1
- package/dist/isometrik-webchat/p-9982fa21.js.map +0 -1
- package/dist/isometrik-webchat/p-a9efcf1c.entry.js +0 -2
- package/dist/isometrik-webchat/p-a9efcf1c.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-ad02a8ca.entry.js +0 -2
- package/dist/isometrik-webchat/p-b0baa9ad.entry.js +0 -2
- package/dist/isometrik-webchat/p-b0baa9ad.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-b385ac4b.js +0 -2
- package/dist/isometrik-webchat/p-b385ac4b.js.map +0 -1
- package/dist/isometrik-webchat/p-c83e2d5d.entry.js +0 -2
- package/dist/isometrik-webchat/p-d758e431.js +0 -2
- package/dist/isometrik-webchat/p-d864bb9f.entry.js +0 -2
- package/dist/isometrik-webchat/p-d864bb9f.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-dab06d54.js +0 -2
- package/dist/isometrik-webchat/p-dab06d54.js.map +0 -1
- package/dist/isometrik-webchat/p-e40e8866.js +0 -2
- package/dist/isometrik-webchat/p-e40e8866.js.map +0 -1
- package/dist/isometrik-webchat/p-e48a1217.entry.js +0 -2
- /package/dist/isometrik-webchat/{p-d892b4d4.entry.js.map → p-02db2116.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-c591fa45.js.map → p-04fdbd0a.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-c5bff6a1.entry.js.map → p-119fc683.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-925decda.js.map → p-1dc52239.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-7b25f234.entry.js.map → p-35f2b9ae.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-3b3dc33e.js.map → p-46be73c5.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-2cf296e6.entry.js.map → p-56521ea4.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-f7d05551.entry.js.map → p-57f97cef.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-ad02a8ca.entry.js.map → p-5f7eebbf.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-c83e2d5d.entry.js.map → p-640e2c03.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-d758e431.js.map → p-6c5eb178.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-d8b65cf4.entry.js.map → p-6eadaa6c.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-161fcb35.entry.js.map → p-7130f547.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-cbb1179b.entry.js.map → p-89a8fc58.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-e48a1217.entry.js.map → p-9b70e93f.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-3664e0ad.entry.js.map → p-b431d864.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-0ccfbe90.entry.js.map → p-b516938b.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-48ce4dca.entry.js.map → p-d44c612a.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-2e9974e1.entry.js.map → p-eb1f3118.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-08ba6153.entry.js.map → p-f5502a63.entry.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download-media.js","sourceRoot":"","sources":["../../../src/lib/chat/download-media.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,QAAQ,GAA2B;IACvC,YAAY,EAAE,KAAK;IACnB,WAAW,EAAE,KAAK;IAClB,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,MAAM;IACpB,YAAY,EAAE,MAAM;IACpB,YAAY,EAAE,MAAM;IACpB,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,MAAM;IACpB,iBAAiB,EAAE,KAAK;IACxB,YAAY,EAAE,KAAK;IACnB,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,MAAM;CACrB,CAAC;AAEF,SAAS,iBAAiB,CAAC,QAAiB;IAC1C,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IACzB,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACzD,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;AAC9B,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,uBAAuB,CAAC,GAAW,EAAE,QAAiB;IACpE,IAAI,CAAC,GAAG;QAAE,OAAO,YAAY,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;IAE1C,IAAI,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,MAAM,KAAK,GAAG,iBA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K,CAAC,iBAAiB,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;gBACrD,SAAS;YACX,CAAC;YACD,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;YAC9B,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC;YAC/B,SAAS,GAAG,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;QACtC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,SAAS,GAAG,GAAG,CAAC;QAClB,CAAC;IACH,CAAC;IACD,MAAM,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;AAC/C,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,GAAW,EAAE,QAAiB,EAAE,QAAiB;IAC1F,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE,OAAO;IAEpD,MAAM,IAAI,GAAG,eAAe,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAEtD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,cAAc,CAAC,GAAG,CAAC,CAAC;QACvC,MAAM,SAAS,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC5C,aAAa,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QACtC,+FAA+F;QAC/F,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE,KAAM,CAAC,CAAC;QAChE,OAAO;IACT,CAAC;IAAC,WAAM,CAAC;QACP,sCAAsC;IACxC,CAAC;IAED,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACjC,CAAC","sourcesContent":["/**\n * Save chat media (images/videos) from preview UI.\n * Prefer fetch+blob when CORS allows; otherwise fall back to a download/open link.\n */\n\nconst MIME_EXT: Record<string, string> = {\n 'image/jpeg': 'jpg',\n 'image/png': 'png',\n 'image/gif': 'gif',\n 'image/webp': 'webp',\n 'image/heic': 'heic',\n 'image/heif': 'heif',\n 'video/mp4': 'mp4',\n 'video/webm': 'webm',\n 'video/quicktime': 'mov',\n 'audio/mpeg': 'mp3',\n 'audio/mp4': 'm4a',\n 'audio/webm': 'webm',\n};\n\nfunction extensionFromMime(mimeType?: string): string {\n if (!mimeType) return '';\n const base = mimeType.split(';')[0].trim().toLowerCase();\n return MIME_EXT[base] || '';\n}\n\n/** Basename from URL path, or timestamp + mime extension when unknown. */\nexport function defaultDownloadFileName(url: string, mimeType?: string): string {\n if (!url) return `download-${Date.now()}`;\n\n if (url.startsWith('data:')) {\n const match = /^data:([^;,]+)/i.exec(url);\n const ext = extensionFromMime(match?.[1] || mimeType);\n return ext ? `download-${Date.now()}.${ext}` : `download-${Date.now()}`;\n }\n\n try {\n const parsed = new URL(url, 'http://local.invalid');\n const segment = parsed.pathname.split('/').filter(Boolean).pop() || '';\n const decoded = decodeURIComponent(segment);\n if (decoded && decoded !== 'blob' && !decoded.startsWith('blob:')) {\n if (decoded.includes('.')) return decoded;\n const ext = extensionFromMime(mimeType);\n return ext ? `${decoded}.${ext}` : decoded;\n }\n } catch {\n /* data: URLs and relative paths */\n }\n\n const ext = extensionFromMime(mimeType);\n return ext ? `download-${Date.now()}.${ext}` : `download-${Date.now()}`;\n}\n\nfunction resolveFileName(url: string, fileName?: string, mimeType?: string): string {\n const trimmed = (fileName || '').trim();\n if (trimmed) return trimmed;\n return defaultDownloadFileName(url, mimeType);\n}\n\nfunction triggerAnchor(href: string, download: string, newTab: boolean) {\n const a = document.createElement('a');\n a.href = href;\n a.download = download;\n if (newTab) {\n a.target = '_blank';\n a.rel = 'noopener noreferrer';\n }\n a.style.display = 'none';\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n}\n\nasync function fetchMediaBlob(url: string): Promise<Blob> {\n const attempts: RequestInit[] = [{ credentials: 'include', mode: 'cors' }, { credentials: 'omit', mode: 'cors' }];\n let lastError: unknown;\n for (const init of attempts) {\n try {\n const res = await fetch(url, init);\n if (!res.ok) {\n lastError = new Error(`fetch failed: ${res.status}`);\n continue;\n }\n const blob = await res.blob();\n if (blob.size > 0) return blob;\n lastError = new Error('empty blob');\n } catch (err) {\n lastError = err;\n }\n }\n throw lastError ?? new Error('fetch failed');\n}\n\n/**\n * Trigger a browser download for a media URL.\n * Cross-origin URLs without CORS may only open in a new tab (fallback).\n */\nexport async function downloadMediaFromUrl(url: string, fileName?: string, mimeType?: string): Promise<void> {\n if (!url || typeof document === 'undefined') return;\n\n const name = resolveFileName(url, fileName, mimeType);\n\n try {\n const blob = await fetchMediaBlob(url);\n const objectUrl = URL.createObjectURL(blob);\n triggerAnchor(objectUrl, name, false);\n // Revoke after the browser has picked up the blob (immediate revoke breaks video/large files).\n window.setTimeout(() => URL.revokeObjectURL(objectUrl), 30_000);\n return;\n } catch {\n /* CORS / network — use direct link */\n }\n\n triggerAnchor(url, name, true);\n}"]}
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
* Chat data helpers used by <web-chat>.
|
|
3
3
|
* Plain functions — no Stencil. WebChat owns @State and calls these.
|
|
4
4
|
*/
|
|
5
|
-
export { sortConversationsByLatestMessage, fetchConversationsPage, fetchConversationDetails, mergeUniqueConversations } from './conversations';
|
|
5
|
+
export { sortConversationsByLatestMessage, fetchConversationsPage, fetchConversationDetails, mergeUniqueConversations, normalizeConversationSearchTag, conversationMatchesSearch, filterConversationsBySearch, } from './conversations';
|
|
6
|
+
export { isDmBlockedByCurrentUser } from './block-status';
|
|
6
7
|
export { fetchMessagesPage, markConversationRead, mergeMessagesById, searchMessages, fetchLinkMessages, fetchMediaCount, fetchMediaAttachments, filterMediaMessages, attachmentBucket, splitSharedMessages, mediaPreviewUrl, mediaPreviewUrls, docIconKind, } from './messages';
|
|
7
8
|
export { initializeChatSdk, fetchUserDetails } from './session';
|
|
8
9
|
export { fetchGroupcastDetails, fetchGroupcastMembersPage, fetchGroupcastContactsPage } from './groupcast';
|
|
9
|
-
export { ATTACHMENT_BODY_PLACEHOLDER, mediaTypeFromMime, customTypeFromMime, isAttachmentBodyPlaceholder, attachmentCaption, attachmentBodyForApi, attachmentBodyForOutgoing, resolveCustomTypeForUpload, resolveMimeType, extensionFromFileName, mimeTypeForAttachmentExtension, prepareMediaAttachments, buildLocalMediaAttachments, buildReplyMetaData, captureVideoThumbnailBlob, capturePdfThumbnailBlob, captureOfficeThumbnailBlob, isPdfFileAttachment, isOfficeFileAttachment, documentThumbnailUrl, uploadPresignedMediaAttachment, uploadAndPostMediaMessage, } from './send-media';
|
|
10
|
+
export { ATTACHMENT_BODY_PLACEHOLDER, mediaTypeFromMime, customTypeFromMime, isAttachmentBodyPlaceholder, attachmentCaption, attachmentFileLabel, suppressDuplicateFileCaption, attachmentBodyForApi, attachmentBodyForOutgoing, resolveCustomTypeForUpload, resolveMimeType, extensionFromFileName, mimeTypeForAttachmentExtension, prepareMediaAttachments, buildLocalMediaAttachments, buildReplyMetaData, captureVideoThumbnailBlob, capturePdfThumbnailBlob, captureOfficeThumbnailBlob, isPdfFileAttachment, isOfficeFileAttachment, documentThumbnailUrl, uploadPresignedMediaAttachment, uploadAndPostMediaMessage, resolveAttachmentPayloads, fetchPresignedUrlSlots, buildReshareAttachmentPayload, mapOutgoingAttachmentsForApi, isPresignDuplicateSlot, presignedSlotsByMediaId, SameNameUploadCancelledError, isSameNameUploadCancelledError, } from './send-media';
|
|
11
|
+
export { promptSameNameUpload, SAME_NAME_UPLOAD_WARNING, } from './same-name-upload';
|
|
10
12
|
export { MAX_MEDIA_PER_MESSAGE, takeMediaFiles, mediaLimitToastMessage, } from './media-limits';
|
|
13
|
+
export { extensionFromImageMime, filesFromClipboardData, normalizePastedImageFile, normalizePastedImageFiles, } from './clipboard-paste';
|
|
11
14
|
export { filesToOutboxMedia, outboxMediaToFiles, MAX_OUTBOX_MEDIA_BYTES } from './media-outbox';
|
|
12
15
|
export { isPdfAttachment, previewKindFromAttachment, deliveryUiState } from './preview-kind';
|
|
13
16
|
export { toMentionedUsersPayload, } from './mentioned-users';
|
|
@@ -15,4 +18,5 @@ export { normalizeGroupTitle } from './group-title';
|
|
|
15
18
|
export { senderDisplayName, messagePushContextFrom, findConversationForPush, resolveNotificationBody, resolveNotificationTitle, withMessagePushFields, } from './message-notification';
|
|
16
19
|
export { isPushNotificationsEnabled, isLocalNotificationsEnabled, withHostMessagePushFields, showLocalMessageNotification, buildLocalNotificationDetail, } from './local-notification';
|
|
17
20
|
export { buildConversationNotificationsPatch, updateConversationNotifications, withConversationPushFlag, } from './conversation-notifications';
|
|
21
|
+
export { defaultDownloadFileName, downloadMediaFromUrl } from './download-media';
|
|
18
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/chat/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/chat/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,gCAAgC,EAChC,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,8BAA8B,EAC9B,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAA0B,MAAM,WAAW,CAAC;AACxF,OAAO,EAAE,qBAAqB,EA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EAC3B,yBAAyB,EACzB,4BAA4B,EAC5B,4BAA4B,GAE7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,mCAAmC,EACnC,+BAA+B,EAC/B,wBAAwB,GAEzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["/**\n * Chat data helpers used by <web-chat>.\n * Plain functions — no Stencil. WebChat owns @State and calls these.\n */\nexport {\n sortConversationsByLatestMessage,\n fetchConversationsPage,\n fetchConversationDetails,\n mergeUniqueConversations,\n normalizeConversationSearchTag,\n conversationMatchesSearch,\n filterConversationsBySearch,\n} from './conversations';\nexport { isDmBlockedByCurrentUser } from './block-status';\nexport {\n fetchMessagesPage,\n markConversationRead,\n mergeMessagesById,\n searchMessages,\n fetchLinkMessages,\n fetchMediaCount,\n fetchMediaAttachments,\n filterMediaMessages,\n attachmentBucket,\n splitSharedMessages,\n mediaPreviewUrl,\n mediaPreviewUrls,\n docIconKind,\n} from './messages';\nexport { initializeChatSdk, fetchUserDetails, type ChatSdkInitConfig } from './session';\nexport { fetchGroupcastDetails, fetchGroupcastMembersPage, fetchGroupcastContactsPage } from './groupcast';\nexport {\n ATTACHMENT_BODY_PLACEHOLDER,\n mediaTypeFromMime,\n customTypeFromMime,\n isAttachmentBodyPlaceholder,\n attachmentCaption,\n attachmentFileLabel,\n suppressDuplicateFileCaption,\n attachmentBodyForApi,\n attachmentBodyForOutgoing,\n resolveCustomTypeForUpload,\n resolveMimeType,\n extensionFromFileName,\n mimeTypeForAttachmentExtension,\n prepareMediaAttachments,\n buildLocalMediaAttachments,\n buildReplyMetaData,\n captureVideoThumbnailBlob,\n capturePdfThumbnailBlob,\n captureOfficeThumbnailBlob,\n isPdfFileAttachment,\n isOfficeFileAttachment,\n documentThumbnailUrl,\n uploadPresignedMediaAttachment,\n uploadAndPostMediaMessage,\n resolveAttachmentPayloads,\n fetchPresignedUrlSlots,\n buildReshareAttachmentPayload,\n mapOutgoingAttachmentsForApi,\n isPresignDuplicateSlot,\n presignedSlotsByMediaId,\n SameNameUploadCancelledError,\n isSameNameUploadCancelledError,\n} from './send-media';\nexport {\n promptSameNameUpload,\n SAME_NAME_UPLOAD_WARNING,\n type SameNameUploadChoice,\n} from './same-name-upload';\nexport {\n MAX_MEDIA_PER_MESSAGE,\n takeMediaFiles,\n mediaLimitToastMessage,\n} from './media-limits';\nexport {\n extensionFromImageMime,\n filesFromClipboardData,\n normalizePastedImageFile,\n normalizePastedImageFiles,\n} from './clipboard-paste';\nexport { filesToOutboxMedia, outboxMediaToFiles, MAX_OUTBOX_MEDIA_BYTES } from './media-outbox';\nexport { isPdfAttachment, previewKindFromAttachment, deliveryUiState } from './preview-kind';\nexport {\n toMentionedUsersPayload,\n type MentionedUserPayload,\n} from './mentioned-users';\nexport { normalizeGroupTitle } from './group-title';\nexport {\n senderDisplayName,\n messagePushContextFrom,\n findConversationForPush,\n resolveNotificationBody,\n resolveNotificationTitle,\n withMessagePushFields,\n type MessagePushContext,\n} from './message-notification';\nexport {\n isPushNotificationsEnabled,\n isLocalNotificationsEnabled,\n withHostMessagePushFields,\n showLocalMessageNotification,\n buildLocalNotificationDetail,\n type LocalNotificationDetail,\n} from './local-notification';\nexport {\n buildConversationNotificationsPatch,\n updateConversationNotifications,\n withConversationPushFlag,\n type ConversationNotificationsPatch,\n} from './conversation-notifications';\nexport { defaultDownloadFileName, downloadMediaFromUrl } from './download-media';\n"]}
|
|
@@ -40,8 +40,8 @@ export function buildLocalNotificationDetail(message, pushCtx = {}) {
|
|
|
40
40
|
message.senderName ||
|
|
41
41
|
((_a = message.senderInfo) === null || _a === void 0 ? void 0 : _a.userName) ||
|
|
42
42
|
message.userName, conversationTitle: (_c = (_b = pushCtx.conversationTitle) !== null && _b !== void 0 ? _b : message.conversationTitle) !== null && _c !== void 0 ? _c : null, isGroup: (_d = pushCtx.isGroup) !== null && _d !== void 0 ? _d : !!message.isGroup }));
|
|
43
|
+
// In-app alerts match chat bubble text — server notificationBody may be unmasked (FCM).
|
|
43
44
|
const body = resolveNotificationBody({
|
|
44
|
-
notificationBody: message.notificationBody,
|
|
45
45
|
body: message.body,
|
|
46
46
|
customType: message.customType,
|
|
47
47
|
attachments: message.attachments,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-notification.js","sourceRoot":"","sources":["../../../src/lib/chat/local-notification.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,GAEtB,MAAM,wBAAwB,CAAC;AAmBhC,MAAM,UAAU,uBAAuB,CAAC,IAAqB;IAC3D,OAAO,CACJ,eAAe,CAAC,IAAI,CAAoC;QACxD,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAoC,CACzE,CAAC;AACJ,CAAC;AAED,wCAAwC;AACxC,MAAM,UAAU,0BAA0B,CAAC,IAAqB;IAC9D,MAAM,IAAI,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;IAC3C,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,uBAAuB,MAAK,KAAK,CAAC;AACjD,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,yBAAyB,CACvC,OAAU,EACV,MAA0B,EAAE,EAC5B,IAAqB;IAErB,OAAO,qBAAqB,CAAC,OAAO,EAAE,GAAG,EAAE;QACzC,uBAAuB,EAAE,0BAA0B,CAAC,IAAI,CAAC;KAC1D,CAAC,CAAC;AACL,CAAC;AAED,4CAA4C;AAC5C,MAAM,UAAU,2BAA2B,CAAC,IAAqB;IAC/D,MAAM,IAAI,GAAG,uBAAuB,CAAC,IAAI,CAAC,C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E,CAAC;QACX,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAClC,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,EAAE,EAAE,IAAI,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,CAAC;QACR,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK;QACvE,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/**\n * Inbound local alerts (MQTT) — Flutter `showNotification` parity for web.\n *\n * Host can:\n * - turn off with `enableLocalNotifications: false`\n * - handle via `onLocalNotification` callback\n * - paint via `customParts.messageNotification`\n * - or fall back to SDK toast\n */\nimport { createCustomPartElement, findWebChatHost, getWebChatElement } from '../custom-ui';\nimport { showToast } from '../toast';\nimport {\n resolveNotificationBody,\n resolveNotificationTitle,\n withMessagePushFields,\n type MessagePushContext,\n} from './message-notification';\n\nexport type LocalNotificationDetail = {\n title: string;\n body: string;\n conversationId: string;\n messageId?: string;\n /** Full MQTT / message map for tap handlers. */\n data: Record<string, any>;\n};\n\ntype WebChatNotificationHost = HTMLElement & {\n enablePushNotifications?: boolean;\n enableLocalNotifications?: boolean;\n onLocalNotification?: (detail: LocalNotificationDetail) => void;\n selectedConversationId?: string | null;\n customParts?: { messageNotification?: string; toast?: string };\n};\n\nexport function resolveNotificationHost(from?: Element | null): WebChatNotificationHost | null {\n return (\n (findWebChatHost(from) as WebChatNotificationHost | null) ||\n ((!from ? getWebChatElement() : null) as WebChatNotificationHost | null)\n );\n}\n\n/** Outbound FCM fields — default on. */\nexport function isPushNotificationsEnabled(host?: Element | null): boolean {\n const chat = resolveNotificationHost(host);\n return chat?.enablePushNotifications !== false;\n}\n\n/** Apply push title/body/events, honoring host `enablePushNotifications`. */\nexport function withHostMessagePushFields<T extends Record<string, any>>(\n payload: T,\n ctx: MessagePushContext = {},\n host?: Element | null,\n): T {\n return withMessagePushFields(payload, ctx, {\n enablePushNotifications: isPushNotificationsEnabled(host),\n });\n}\n\n/** Inbound local UI alerts — default on. */\nexport function isLocalNotificationsEnabled(host?: Element | null): boolean {\n const chat = resolveNotificationHost(host);\n return chat?.enableLocalNotifications !== false;\n}\n\nexport function buildLocalNotificationDetail(\n message: Record<string, any>,\n pushCtx: MessagePushContext = {},\n): LocalNotificationDetail {\n const title = resolveNotificationTitle(\n {\n notificationTitle: message.notificationTitle,\n body: message.body,\n customType: message.customType,\n },\n {\n ...pushCtx,\n senderName:\n pushCtx.senderName ||\n message.senderName ||\n message.senderInfo?.userName ||\n message.userName,\n conversationTitle:\n pushCtx.conversationTitle ?? message.conversationTitle ?? null,\n isGroup: pushCtx.isGroup ?? !!message.isGroup,\n },\n );\n // In-app alerts match chat bubble text — server notificationBody may be unmasked (FCM).\n const body = resolveNotificationBody({\n body: message.body,\n customType: message.customType,\n attachments: message.attachments,\n });\n return {\n title,\n body,\n conversationId: String(message.conversationId || ''),\n messageId: message.messageId ? String(message.messageId) : undefined,\n data: { ...message },\n };\n}\n\n/**\n * Show (or skip) a local inbound message alert.\n * Returns true when something was shown / handed to the host.\n */\nexport function showLocalMessageNotification(\n message: Record<string, any>,\n opts: {\n host?: Element | null;\n pushCtx?: MessagePushContext;\n /** Skip when this conversation is already open (default true). */\n suppressWhenActiveChat?: boolean;\n conversationPushEnabled?: boolean;\n } = {},\n): boolean {\n const host = resolveNotificationHost(opts.host);\n if (!isLocalNotificationsEnabled(host)) return false;\n if (opts.conversationPushEnabled === false) return false;\n\n const conversationId = String(message.conversationId || '');\n const suppress = opts.suppressWhenActiveChat !== false;\n if (\n suppress &&\n conversationId &&\n host?.selectedConversationId &&\n host.selectedConversationId === conversationId\n ) {\n return false;\n }\n\n const detail = buildLocalNotificationDetail(message, opts.pushCtx);\n\n if (typeof host?.onLocalNotification === 'function') {\n host.onLocalNotification(detail);\n return true;\n }\n\n const pushCtx = opts.pushCtx || {};\n const enrichedData = {\n ...detail.data,\n // Host CE needs these for group “Sender · body” layout — MQTT often omits them.\n isGroup: pushCtx.isGroup ?? detail.data.isGroup,\n conversationTitle:\n pushCtx.conversationTitle ?? detail.data.conversationTitle ?? null,\n senderName:\n pushCtx.senderName ||\n detail.data.senderName ||\n (detail.data.senderInfo as { userName?: string } | undefined)?.userName ||\n detail.data.userName,\n };\n\n let custom: HTMLElement | null = null;\n custom = createCustomPartElement(\n 'messageNotification',\n {\n title: detail.title,\n body: detail.body,\n data: enrichedData,\n conversationId: detail.conversationId,\n messageId: detail.messageId,\n onDismiss: () => custom?.remove(),\n onOpen: () => {\n const chat = host as any;\n if (detail.conversationId && typeof chat?.selectConversation === 'function') {\n void chat.selectConversation(detail.conversationId);\n }\n custom?.remove();\n },\n },\n host,\n );\n if (custom) {\n document.body.appendChild(custom);\n setTimeout(() => custom?.remove(), 6000);\n return true;\n }\n\n showToast({\n message: detail.body ? `${detail.title}: ${detail.body}` : detail.title,\n type: 'info',\n position: 'top-right',\n duration: 4000,\n });\n return true;\n}\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same-name storage upload UX (quota feature).
|
|
3
|
+
*
|
|
4
|
+
* Contract: see SAME_NAME_UPLOAD_FRONTEND.md in product docs — presign returns
|
|
5
|
+
* `duplicate: true` without PUT URLs; user picks reshare vs `forceUpload: true`.
|
|
6
|
+
* Reused from send-media.ts, ChatFooter, and uploadAndPostMediaMessage.
|
|
7
|
+
*/
|
|
8
|
+
export const SAME_NAME_UPLOAD_WARNING = 'A file with the same name is already in your storage.';
|
|
9
|
+
export class SameNameUploadCancelledError extends Error {
|
|
10
|
+
constructor(message = 'Same-name upload cancelled') {
|
|
11
|
+
super(message);
|
|
12
|
+
this.name = 'SameNameUploadCancelledError';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export function isSameNameUploadCancelledError(err) {
|
|
16
|
+
return err instanceof SameNameUploadCancelledError;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Modal: primary = new copy (forceUpload path), secondary = reshare older file.
|
|
20
|
+
* Drawer dismiss → cancel (caller removes optimistic message).
|
|
21
|
+
*
|
|
22
|
+
* Dynamic-imports drawer so unit tests that import send-media do not load Stencil shells.
|
|
23
|
+
*/
|
|
24
|
+
export function promptSameNameUpload(args) {
|
|
25
|
+
const { fileName, warning } = args;
|
|
26
|
+
const description = (warning === null || warning === void 0 ? void 0 : warning.trim()) || `“${fileName}”\n\n${SAME_NAME_UPLOAD_WARNING}`;
|
|
27
|
+
return import('../drawer').then(({ drawerDialogService }) => {
|
|
28
|
+
return new Promise(resolve => {
|
|
29
|
+
const finish = (choice) => {
|
|
30
|
+
drawerDialogService.closeDialog('confirm-dialog');
|
|
31
|
+
resolve(choice);
|
|
32
|
+
};
|
|
33
|
+
let settled = false;
|
|
34
|
+
const settle = (choice) => {
|
|
35
|
+
if (settled)
|
|
36
|
+
return;
|
|
37
|
+
settled = true;
|
|
38
|
+
finish(choice);
|
|
39
|
+
};
|
|
40
|
+
drawerDialogService.openDialog('confirm-dialog', {
|
|
41
|
+
title: 'File already in storage',
|
|
42
|
+
description,
|
|
43
|
+
yesText: 'Upload a copy',
|
|
44
|
+
noText: 'Reshare older file',
|
|
45
|
+
handleConfirm: () => settle('forceUpload'),
|
|
46
|
+
handleCancel: () => settle('reshare'),
|
|
47
|
+
// Overlay / × close (drawer.ts calls onDismiss) → cancel send.
|
|
48
|
+
onDismiss: () => settle('cancel'),
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=same-name-upload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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C,WAAW;gBACX,OAAO,EAAE,eAAe;gBACxB,MAAM,EAAE,oBAAoB;gBAC5B,aAAa,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC;gBAC1C,YAAY,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC;gBACrC,+DAA+D;gBAC/D,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC;aAClC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * Same-name storage upload UX (quota feature).\n *\n * Contract: see SAME_NAME_UPLOAD_FRONTEND.md in product docs — presign returns\n * `duplicate: true` without PUT URLs; user picks reshare vs `forceUpload: true`.\n * Reused from send-media.ts, ChatFooter, and uploadAndPostMediaMessage.\n */\n\nexport const SAME_NAME_UPLOAD_WARNING =\n 'A file with the same name is already in your storage.';\n\nexport type SameNameUploadChoice = 'reshare' | 'forceUpload' | 'cancel';\n\nexport class SameNameUploadCancelledError extends Error {\n constructor(message = 'Same-name upload cancelled') {\n super(message);\n this.name = 'SameNameUploadCancelledError';\n }\n}\n\nexport function isSameNameUploadCancelledError(err: unknown): boolean {\n return err instanceof SameNameUploadCancelledError;\n}\n\nexport type SameNameUploadPromptArgs = {\n fileName: string;\n warning?: string;\n};\n\n/**\n * Modal: primary = new copy (forceUpload path), secondary = reshare older file.\n * Drawer dismiss → cancel (caller removes optimistic message).\n *\n * Dynamic-imports drawer so unit tests that import send-media do not load Stencil shells.\n */\nexport function promptSameNameUpload(args: SameNameUploadPromptArgs): Promise<SameNameUploadChoice> {\n const { fileName, warning } = args;\n const description =\n warning?.trim() || `“${fileName}”\\n\\n${SAME_NAME_UPLOAD_WARNING}`;\n\n return import('../drawer').then(({ drawerDialogService }) => {\n return new Promise<SameNameUploadChoice>(resolve => {\n const finish = (choice: SameNameUploadChoice) => {\n drawerDialogService.closeDialog('confirm-dialog');\n resolve(choice);\n };\n\n let settled = false;\n const settle = (choice: SameNameUploadChoice) => {\n if (settled) return;\n settled = true;\n finish(choice);\n };\n\n drawerDialogService.openDialog('confirm-dialog', {\n title: 'File already in storage',\n description,\n yesText: 'Upload a copy',\n noText: 'Reshare older file',\n handleConfirm: () => settle('forceUpload'),\n handleCancel: () => settle('reshare'),\n // Overlay / × close (drawer.ts calls onDismiss) → cancel send.\n onDismiss: () => settle('cancel'),\n });\n });\n });\n}"]}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s)
|
|
4
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
1
13
|
/**
|
|
2
14
|
* Shared media-send helpers for ChatFooter + public web-chat.sendMedia.
|
|
3
15
|
* Conversation path only (groupcast keeps using ChatFooter).
|
|
@@ -10,8 +22,25 @@ import ChatSDK from "test-iso-chat-sdk";
|
|
|
10
22
|
import { takeMediaFiles } from "./media-limits";
|
|
11
23
|
import { withHostMessagePushFields } from "./local-notification";
|
|
12
24
|
import { captureOfficeThumbnailBlob, looksLikeDocumentFileUrl, officePreviewKind } from "./document-thumbnail";
|
|
25
|
+
import { promptSameNameUpload, SameNameUploadCancelledError, } from "./same-name-upload";
|
|
13
26
|
export { captureOfficeThumbnailBlob };
|
|
14
27
|
export const ATTACHMENT_BODY_PLACEHOLDER = 'AttachmentMessage:Multiple';
|
|
28
|
+
const DOCUMENT_ATTACHMENT_CUSTOM_TYPES = new Set(['AttachmentMessage:Doc', 'AttachmentMessage:File']);
|
|
29
|
+
/** Display/download filename on an attachment record (API may use `name` or `nameWithExtension`). */
|
|
30
|
+
export function attachmentFileLabel(attachment) {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
return String((_b = (_a = attachment === null || attachment === void 0 ? void 0 : attachment.name) !== null && _a !== void 0 ? _a : attachment === null || attachment === void 0 ? void 0 : attachment.nameWithExtension) !== null && _b !== void 0 ? _b : '').trim();
|
|
33
|
+
}
|
|
34
|
+
function labelsEqual(a, b) {
|
|
35
|
+
return a.localeCompare(b, undefined, { sensitivity: 'accent' }) === 0;
|
|
36
|
+
}
|
|
37
|
+
function attachmentFileLabels(attachments) {
|
|
38
|
+
return (attachments || []).map(a => attachmentFileLabel(a)).filter(Boolean);
|
|
39
|
+
}
|
|
40
|
+
/** Filename-only API body for a single document (e.g. `report.pdf`). */
|
|
41
|
+
function bodyLooksLikeStandaloneFileName(body) {
|
|
42
|
+
return /^[^\s/\\]+\.[^\s.]+$/i.test(body);
|
|
43
|
+
}
|
|
15
44
|
export function mediaTypeFromMime(mime) {
|
|
16
45
|
if (!mime)
|
|
17
46
|
return 3;
|
|
@@ -45,8 +74,12 @@ export function attachmentCaption(message) {
|
|
|
45
74
|
var _a, _b, _c, _d;
|
|
46
75
|
const meta = message === null || message === void 0 ? void 0 : message.metaData;
|
|
47
76
|
const fromMeta = String((_b = (_a = meta === null || meta === void 0 ? void 0 : meta.caption) !== null && _a !== void 0 ? _a : meta === null || meta === void 0 ? void 0 : meta.captionMessage) !== null && _b !== void 0 ? _b : '').trim();
|
|
48
|
-
|
|
77
|
+
const labels = attachmentFileLabels(message === null || message === void 0 ? void 0 : message.attachments);
|
|
78
|
+
if (fromMeta) {
|
|
79
|
+
if (labels.some(l => labelsEqual(l, fromMeta)))
|
|
80
|
+
return '';
|
|
49
81
|
return fromMeta;
|
|
82
|
+
}
|
|
50
83
|
const body = String((_c = message === null || message === void 0 ? void 0 : message.body) !== null && _c !== void 0 ? _c : '').trim();
|
|
51
84
|
const customType = String((_d = message === null || message === void 0 ? void 0 : message.customType) !== null && _d !== void 0 ? _d : '').trim();
|
|
52
85
|
// Multiple attachments: real caption lives in metaData only (Flutter/Swift/web); never use body text
|
|
@@ -54,8 +87,26 @@ export function attachmentCaption(message) {
|
|
|
54
87
|
return '';
|
|
55
88
|
if (isAttachmentBodyPlaceholder(body))
|
|
56
89
|
return '';
|
|
90
|
+
// Single doc without caption: body is the filename for the API — already shown on the card
|
|
91
|
+
if (labels.some(l => labelsEqual(l, body)))
|
|
92
|
+
return '';
|
|
93
|
+
if (DOCUMENT_ATTACHMENT_CUSTOM_TYPES.has(customType) &&
|
|
94
|
+
bodyLooksLikeStandaloneFileName(body) &&
|
|
95
|
+
labels.length <= 1) {
|
|
96
|
+
return '';
|
|
97
|
+
}
|
|
57
98
|
return body;
|
|
58
99
|
}
|
|
100
|
+
/** Document bubble caption — drop text that only repeats the attachment filename. */
|
|
101
|
+
export function suppressDuplicateFileCaption(caption, attachment) {
|
|
102
|
+
const text = String(caption !== null && caption !== void 0 ? caption : '').trim();
|
|
103
|
+
if (!text)
|
|
104
|
+
return '';
|
|
105
|
+
const label = attachmentFileLabel(attachment);
|
|
106
|
+
if (label && labelsEqual(text, label))
|
|
107
|
+
return '';
|
|
108
|
+
return text;
|
|
109
|
+
}
|
|
59
110
|
/** @deprecated Prefer attachmentBodyForOutgoing — kept for callers that only pass caption. */
|
|
60
111
|
export function attachmentBodyForApi(caption) {
|
|
61
112
|
return (caption === null || caption === void 0 ? void 0 : caption.trim()) || ATTACHMENT_BODY_PLACEHOLDER;
|
|
@@ -211,6 +262,143 @@ export function buildLocalMediaAttachments(files) {
|
|
|
211
262
|
};
|
|
212
263
|
});
|
|
213
264
|
}
|
|
265
|
+
export { SameNameUploadCancelledError, isSameNameUploadCancelledError, promptSameNameUpload, } from './same-name-upload';
|
|
266
|
+
export function isPresignDuplicateSlot(slot) {
|
|
267
|
+
return (slot === null || slot === void 0 ? void 0 : slot.duplicate) === true;
|
|
268
|
+
}
|
|
269
|
+
export function presignedSlotsByMediaId(slots) {
|
|
270
|
+
const map = new Map();
|
|
271
|
+
for (const slot of slots || []) {
|
|
272
|
+
if ((slot === null || slot === void 0 ? void 0 : slot.mediaId) != null)
|
|
273
|
+
map.set(String(slot.mediaId), slot);
|
|
274
|
+
}
|
|
275
|
+
return map;
|
|
276
|
+
}
|
|
277
|
+
function presignRequestAttachments(attachments, forceUploadMediaIds) {
|
|
278
|
+
return attachments.map(a => (Object.assign({ mediaId: a.mediaId, mediaType: a.mediaType, nameWithExtension: a.nameWithExtension }, ((forceUploadMediaIds === null || forceUploadMediaIds === void 0 ? void 0 : forceUploadMediaIds.has(a.mediaId)) ? { forceUpload: true } : {}))));
|
|
279
|
+
}
|
|
280
|
+
export async function fetchPresignedUrlSlots(conversationId, attachments, forceUploadMediaIds) {
|
|
281
|
+
const res = await ChatSDK.getInstance().message.postMessagesPresignedurls({
|
|
282
|
+
conversationId,
|
|
283
|
+
attachments: presignRequestAttachments(attachments, forceUploadMediaIds),
|
|
284
|
+
});
|
|
285
|
+
const presignedUrls = (res === null || res === void 0 ? void 0 : res.presignedUrls)
|
|
286
|
+
? res.presignedUrls
|
|
287
|
+
: (res === null || res === void 0 ? void 0 : res.presignedUrl)
|
|
288
|
+
? [res]
|
|
289
|
+
: null;
|
|
290
|
+
if (!(presignedUrls === null || presignedUrls === void 0 ? void 0 : presignedUrls.length)) {
|
|
291
|
+
throw new Error('No presigned URLs returned for media upload');
|
|
292
|
+
}
|
|
293
|
+
return presignedUrls;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Build message attachment for reshare after `duplicate: true` — no PUT.
|
|
297
|
+
* Presign request uses client `attachment.mediaId` to match the slot; POST /chat/message
|
|
298
|
+
* must use `slot.existingMediaId` so the server reuses the stored object (0 quota bytes).
|
|
299
|
+
*/
|
|
300
|
+
export function buildReshareAttachmentPayload(slot, attachment) {
|
|
301
|
+
const mediaUrl = String(slot.mediaUrl || '');
|
|
302
|
+
if (!mediaUrl) {
|
|
303
|
+
throw new Error('Duplicate file response missing mediaUrl');
|
|
304
|
+
}
|
|
305
|
+
const existingMediaId = String(slot.existingMediaId || '').trim();
|
|
306
|
+
if (!existingMediaId) {
|
|
307
|
+
throw new Error('Duplicate file response missing existingMediaId');
|
|
308
|
+
}
|
|
309
|
+
const isPdf = isPdfFileAttachment(attachment);
|
|
310
|
+
const isOffice = isOfficeFileAttachment(attachment);
|
|
311
|
+
const needsImageThumb = isPdf || isOffice;
|
|
312
|
+
const thumbnailUrl = needsImageThumb
|
|
313
|
+
? documentThumbnailUrl({ mediaUrl, thumbnailUrl: slot.thumbnailUrl })
|
|
314
|
+
: String(slot.thumbnailUrl || mediaUrl);
|
|
315
|
+
const fileExt = extensionFromFileName(attachment.nameWithExtension);
|
|
316
|
+
return {
|
|
317
|
+
mediaId: existingMediaId,
|
|
318
|
+
mediaUrl,
|
|
319
|
+
thumbnailUrl,
|
|
320
|
+
mediaType: attachment.mediaType,
|
|
321
|
+
nameWithExtension: attachment.nameWithExtension,
|
|
322
|
+
name: attachment.nameWithExtension,
|
|
323
|
+
mimeType: attachment.mimeType,
|
|
324
|
+
extension: fileExt,
|
|
325
|
+
size: attachment.size,
|
|
326
|
+
attachmentType: attachment.mediaType,
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
export function mapOutgoingAttachmentsForApi(payloads) {
|
|
330
|
+
return payloads.map(p => {
|
|
331
|
+
if (p.forceUpload) {
|
|
332
|
+
const { forceUpload } = p, rest = __rest(p, ["forceUpload"]);
|
|
333
|
+
return Object.assign(Object.assign({}, rest), { forceUpload: true });
|
|
334
|
+
}
|
|
335
|
+
const { forceUpload: _omit } = p, rest = __rest(p, ["forceUpload"]);
|
|
336
|
+
return rest;
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Presign → (optional same-name prompt) → PUT or reshare → payloads for postMessages.
|
|
341
|
+
* Processes duplicates sequentially so the user can choose per file.
|
|
342
|
+
*/
|
|
343
|
+
export async function resolveAttachmentPayloads(args) {
|
|
344
|
+
var _a, _b, _c, _d;
|
|
345
|
+
const { conversationId, attachments, renderPdfThumbnail, renderOfficeThumbnail } = args;
|
|
346
|
+
const prompt = (_a = args.sameNameUploadPrompt) !== null && _a !== void 0 ? _a : promptSameNameUpload;
|
|
347
|
+
const slots = (_b = args.presignedSlots) !== null && _b !== void 0 ? _b : (await fetchPresignedUrlSlots(conversationId, attachments));
|
|
348
|
+
const slotById = presignedSlotsByMediaId(slots);
|
|
349
|
+
const payloads = [];
|
|
350
|
+
for (let index = 0; index < attachments.length; index++) {
|
|
351
|
+
const attachment = attachments[index];
|
|
352
|
+
const urlDetails = (_c = slotById.get(attachment.mediaId)) !== null && _c !== void 0 ? _c : slots[index];
|
|
353
|
+
if (!urlDetails)
|
|
354
|
+
continue;
|
|
355
|
+
if (isPresignDuplicateSlot(urlDetails)) {
|
|
356
|
+
const choice = await prompt({
|
|
357
|
+
fileName: attachment.nameWithExtension,
|
|
358
|
+
warning: urlDetails.warning,
|
|
359
|
+
});
|
|
360
|
+
if (choice === 'cancel') {
|
|
361
|
+
throw new SameNameUploadCancelledError();
|
|
362
|
+
}
|
|
363
|
+
if (choice === 'reshare') {
|
|
364
|
+
payloads.push(buildReshareAttachmentPayload(urlDetails, attachment));
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
const forced = await fetchPresignedUrlSlots(conversationId, [attachment], new Set([attachment.mediaId]));
|
|
368
|
+
const forceSlot = (_d = presignedSlotsByMediaId(forced).get(attachment.mediaId)) !== null && _d !== void 0 ? _d : forced[0];
|
|
369
|
+
if (!forceSlot || isPresignDuplicateSlot(forceSlot)) {
|
|
370
|
+
throw new Error('Could not get upload URL for duplicate file copy');
|
|
371
|
+
}
|
|
372
|
+
const uploaded = await uploadPresignedMediaAttachment({
|
|
373
|
+
urlDetails: forceSlot,
|
|
374
|
+
attachment,
|
|
375
|
+
conversationId,
|
|
376
|
+
renderPdfThumbnail,
|
|
377
|
+
renderOfficeThumbnail,
|
|
378
|
+
});
|
|
379
|
+
if (!uploaded) {
|
|
380
|
+
throw new Error('Upload failed for duplicate file copy');
|
|
381
|
+
}
|
|
382
|
+
payloads.push(Object.assign(Object.assign({}, uploaded), { forceUpload: true }));
|
|
383
|
+
continue;
|
|
384
|
+
}
|
|
385
|
+
const uploaded = await uploadPresignedMediaAttachment({
|
|
386
|
+
urlDetails,
|
|
387
|
+
attachment,
|
|
388
|
+
conversationId,
|
|
389
|
+
renderPdfThumbnail,
|
|
390
|
+
renderOfficeThumbnail,
|
|
391
|
+
});
|
|
392
|
+
if (!uploaded) {
|
|
393
|
+
throw new Error(`Upload failed for ${attachment.nameWithExtension}`);
|
|
394
|
+
}
|
|
395
|
+
payloads.push(uploaded);
|
|
396
|
+
}
|
|
397
|
+
if (!payloads.length) {
|
|
398
|
+
throw new Error('No attachments to send');
|
|
399
|
+
}
|
|
400
|
+
return payloads;
|
|
401
|
+
}
|
|
214
402
|
/** PDF (or a file named *.pdf). The app cannot paint these bytes with Image.network. */
|
|
215
403
|
export function isPdfFileAttachment(file) {
|
|
216
404
|
const mime = String((file === null || file === void 0 ? void 0 : file.mimeType) || '').toLowerCase();
|
|
@@ -428,7 +616,7 @@ export async function uploadPresignedMediaAttachment(opts) {
|
|
|
428
616
|
if (!attachment)
|
|
429
617
|
return null;
|
|
430
618
|
const mediaPresignedUrl = (urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.mediaPresignedUrl) || (urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.presignedUrl);
|
|
431
|
-
const mediaId = (urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.mediaId) || (urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.mediaUrl);
|
|
619
|
+
const mediaId = attachment.mediaId || (urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.mediaId) || (urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.mediaUrl);
|
|
432
620
|
const mediaUrl = urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.mediaUrl;
|
|
433
621
|
const thumbnailPresignedUrl = urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.thumbnailPresignedUrl;
|
|
434
622
|
const isPdf = isPdfFileAttachment(attachment);
|
|
@@ -498,35 +686,14 @@ export async function uploadPresignedMediaAttachment(opts) {
|
|
|
498
686
|
}
|
|
499
687
|
/** Presign → PUT files → postMessages. Returns API messageId. */
|
|
500
688
|
export async function uploadAndPostMediaMessage(args) {
|
|
501
|
-
const { conversationId, deviceId, attachments, replyMessage, caption, mentionedUsers, pushContext } = args;
|
|
689
|
+
const { conversationId, deviceId, attachments, replyMessage, caption, mentionedUsers, pushContext, sameNameUploadPrompt, } = args;
|
|
502
690
|
if (!conversationId || !(attachments === null || attachments === void 0 ? void 0 : attachments.length))
|
|
503
691
|
return null;
|
|
504
|
-
const
|
|
692
|
+
const allPayloads = await resolveAttachmentPayloads({
|
|
505
693
|
conversationId,
|
|
506
694
|
attachments,
|
|
695
|
+
sameNameUploadPrompt,
|
|
507
696
|
});
|
|
508
|
-
const presignedUrls = (resForPresignedUrl === null || resForPresignedUrl === void 0 ? void 0 : resForPresignedUrl.presignedUrls)
|
|
509
|
-
? resForPresignedUrl.presignedUrls
|
|
510
|
-
: (resForPresignedUrl === null || resForPresignedUrl === void 0 ? void 0 : resForPresignedUrl.presignedUrl)
|
|
511
|
-
? [resForPresignedUrl]
|
|
512
|
-
: null;
|
|
513
|
-
if (!(presignedUrls === null || presignedUrls === void 0 ? void 0 : presignedUrls.length)) {
|
|
514
|
-
throw new Error('No presigned URLs returned for media upload');
|
|
515
|
-
}
|
|
516
|
-
/** Typed array so `postMessages` payload is not `any[]` (strict noImplicitAny). */
|
|
517
|
-
const allPayloads = [];
|
|
518
|
-
await Promise.all(presignedUrls.map(async (urlDetails, index) => {
|
|
519
|
-
const attachmentPayload = attachments[index];
|
|
520
|
-
if (!attachmentPayload)
|
|
521
|
-
return;
|
|
522
|
-
const payload = await uploadPresignedMediaAttachment({
|
|
523
|
-
urlDetails,
|
|
524
|
-
attachment: attachmentPayload,
|
|
525
|
-
conversationId,
|
|
526
|
-
});
|
|
527
|
-
if (payload)
|
|
528
|
-
allPayloads.push(payload);
|
|
529
|
-
}));
|
|
530
697
|
const customType = resolveCustomTypeForUpload(attachments);
|
|
531
698
|
const payload = {
|
|
532
699
|
showInConversation: true,
|
|
@@ -536,7 +703,7 @@ export async function uploadAndPostMediaMessage(args) {
|
|
|
536
703
|
conversationId,
|
|
537
704
|
body: attachmentBodyForOutgoing(caption, attachments),
|
|
538
705
|
customType,
|
|
539
|
-
attachments: allPayloads,
|
|
706
|
+
attachments: mapOutgoingAttachmentsForApi(allPayloads),
|
|
540
707
|
deviceId,
|
|
541
708
|
metaData: buildReplyMetaData(replyMessage, caption),
|
|
542
709
|
};
|