@droppii-org/chat-sdk 0.3.8 → 0.4.1
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/components/canned-response/CannedResponseBody.js +1 -1
- package/dist/components/canned-response/CannedResponseFooter.js +1 -1
- package/dist/components/canned-response/CannedResponseHeader.js +1 -1
- package/dist/components/canned-response/index.js +1 -1
- package/dist/components/canned-response/team/TeamItem.js +1 -1
- package/dist/components/common/ConfirmModal.d.ts.map +1 -1
- package/dist/components/common/ConfirmModal.js +1 -1
- package/dist/components/common/InfoModal.d.ts.map +1 -1
- package/dist/components/common/InfoModal.js +1 -1
- package/dist/components/compose/ComposeNewMessageModal.d.ts.map +1 -1
- package/dist/components/compose/ComposeNewMessageModal.js +1 -1
- package/dist/components/conversation/ConversationByGroupItem.d.ts.map +1 -1
- package/dist/components/conversation/ConversationByGroupItem.js +2 -1
- package/dist/components/conversation/ConversationBySessionItem.d.ts.map +1 -1
- package/dist/components/conversation/ConversationBySessionItem.js +2 -1
- package/dist/components/conversation/DeskConversationList.d.ts.map +1 -1
- package/dist/components/conversation/DeskConversationList.js +1 -1
- package/dist/components/conversation/MentionIndicatorIcon.d.ts +7 -0
- package/dist/components/conversation/MentionIndicatorIcon.d.ts.map +1 -0
- package/dist/components/conversation/MentionIndicatorIcon.js +17 -0
- package/dist/components/conversation/SwipeActionButton.d.ts.map +1 -1
- package/dist/components/conversation/SwipeActionButton.js +1 -1
- package/dist/components/conversation/SwipeableRow.d.ts.map +1 -1
- package/dist/components/conversation/SwipeableRow.js +1 -1
- package/dist/components/conversation/ThreadCard.d.ts +2 -1
- package/dist/components/conversation/ThreadCard.d.ts.map +1 -1
- package/dist/components/conversation/ThreadCard.js +4 -4
- package/dist/components/conversation-detail/ConversationDetailHeader.d.ts.map +1 -1
- package/dist/components/conversation-detail/ConversationDetailHeader.js +2 -2
- package/dist/components/conversation-detail/ConversationDetailInput.d.ts.map +1 -1
- package/dist/components/conversation-detail/ConversationDetailInput.js +5 -1
- package/dist/components/conversation-detail/ConversationMessageList.d.ts.map +1 -1
- package/dist/components/conversation-detail/ConversationMessageList.js +1 -1
- package/dist/components/conversation-detail/ConversationMoreOptionItem.d.ts.map +1 -1
- package/dist/components/conversation-detail/ConversationMoreOptionItem.js +1 -1
- package/dist/components/conversation-detail/ConversationMoreOptionPanel.d.ts.map +1 -1
- package/dist/components/conversation-detail/ConversationMoreOptionPanel.js +1 -1
- package/dist/components/conversation-detail/LeaveGroupBlockedModal.d.ts +12 -0
- package/dist/components/conversation-detail/LeaveGroupBlockedModal.d.ts.map +1 -0
- package/dist/components/conversation-detail/LeaveGroupBlockedModal.js +18 -0
- package/dist/components/conversation-detail/LeaveGroupConfirmModal.d.ts +16 -0
- package/dist/components/conversation-detail/LeaveGroupConfirmModal.d.ts.map +1 -0
- package/dist/components/conversation-detail/LeaveGroupConfirmModal.js +21 -0
- package/dist/components/conversation-detail/PinLimitModal.d.ts.map +1 -1
- package/dist/components/conversation-detail/PinLimitModal.js +1 -1
- package/dist/components/conversation-detail/PinnedMessageBar.d.ts.map +1 -1
- package/dist/components/conversation-detail/PinnedMessageBar.js +8 -4
- package/dist/components/conversation-detail/PinnedMessageItem.d.ts.map +1 -1
- package/dist/components/conversation-detail/PinnedMessageItem.js +1 -1
- package/dist/components/conversation-detail/PinnedMessagesPanel.d.ts.map +1 -1
- package/dist/components/conversation-detail/PinnedMessagesPanel.js +1 -1
- package/dist/components/conversation-detail/ThreadProfilePanel.d.ts.map +1 -1
- package/dist/components/conversation-detail/ThreadProfilePanel.js +12 -2
- package/dist/components/conversation-detail/bot/BotButtonMessage.d.ts.map +1 -1
- package/dist/components/conversation-detail/bot/BotButtonMessage.js +1 -1
- package/dist/components/conversation-detail/bot/BotInactiveNotice.d.ts.map +1 -1
- package/dist/components/conversation-detail/bot/BotInactiveNotice.js +1 -1
- package/dist/components/conversation-detail/bot/BotMenuSheet.d.ts.map +1 -1
- package/dist/components/conversation-detail/bot/BotMenuSheet.js +1 -1
- package/dist/components/conversation-detail/bot/BotStartButton.d.ts.map +1 -1
- package/dist/components/conversation-detail/bot/BotStartButton.js +1 -1
- package/dist/components/conversation-detail/bot/BotSuggest.d.ts.map +1 -1
- package/dist/components/conversation-detail/bot/BotSuggest.js +2 -2
- package/dist/components/conversation-detail/bot/CsSessionConfirmModal.d.ts.map +1 -1
- package/dist/components/conversation-detail/bot/CsSessionConfirmModal.js +1 -1
- package/dist/components/conversation-detail/index.d.ts +4 -0
- package/dist/components/conversation-detail/index.d.ts.map +1 -1
- package/dist/components/conversation-detail/index.js +2 -0
- package/dist/components/conversation-inbox/ConversationInboxHeader.d.ts.map +1 -1
- package/dist/components/conversation-inbox/ConversationInboxHeader.js +1 -1
- package/dist/components/conversation-inbox/ConversationInboxItem.d.ts.map +1 -1
- package/dist/components/conversation-inbox/ConversationInboxItem.js +2 -1
- package/dist/components/conversation-inbox/ConversationInboxList.d.ts.map +1 -1
- package/dist/components/conversation-inbox/ConversationInboxList.js +1 -1
- package/dist/components/conversation-inbox/ConversationInboxTitle.d.ts.map +1 -1
- package/dist/components/conversation-inbox/ConversationInboxTitle.js +1 -1
- package/dist/components/conversation-inbox/ConversationPeerAvatar.d.ts.map +1 -1
- package/dist/components/conversation-inbox/ConversationPeerAvatar.js +1 -1
- package/dist/components/conversation-inbox/MuteConversationConfirmModal.d.ts.map +1 -1
- package/dist/components/conversation-inbox/MuteConversationConfirmModal.js +1 -1
- package/dist/components/group/AddMemberModal.d.ts.map +1 -1
- package/dist/components/group/AddMemberModal.js +1 -1
- package/dist/components/group/CreateGroupForm.d.ts.map +1 -1
- package/dist/components/group/CreateGroupForm.js +1 -3
- package/dist/components/group/GroupMemberPicker.js +1 -1
- package/dist/components/group/MemberPermissionPanel.js +1 -1
- package/dist/components/icon/index.d.ts.map +1 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/media-collection/FileCollection.d.ts.map +1 -1
- package/dist/components/media-collection/FileCollection.js +1 -1
- package/dist/components/media-collection/ImageCollection.d.ts.map +1 -1
- package/dist/components/media-collection/ImageCollection.js +1 -1
- package/dist/components/media-collection/LinkCollection.d.ts.map +1 -1
- package/dist/components/media-collection/LinkCollection.js +2 -2
- package/dist/components/media-collection/VideoCollection.d.ts.map +1 -1
- package/dist/components/media-collection/VideoCollection.js +1 -1
- package/dist/components/media-collection/index.js +1 -1
- package/dist/components/media-resources/FileResourceList.d.ts.map +1 -1
- package/dist/components/media-resources/FileResourceList.js +1 -1
- package/dist/components/media-resources/ImageResourceGrid.d.ts.map +1 -1
- package/dist/components/media-resources/ImageResourceGrid.js +1 -1
- package/dist/components/media-resources/LinkResourceItem.d.ts.map +1 -1
- package/dist/components/media-resources/LinkResourceItem.js +1 -1
- package/dist/components/media-resources/LinkResourceList.d.ts.map +1 -1
- package/dist/components/media-resources/LinkResourceList.js +1 -1
- package/dist/components/media-resources/MediaEntryCard.d.ts.map +1 -1
- package/dist/components/media-resources/MediaEntryCard.js +1 -1
- package/dist/components/media-resources/MediaResourcePanel.d.ts.map +1 -1
- package/dist/components/media-resources/MediaResourcePanel.js +1 -1
- package/dist/components/media-resources/MediaResourceTabBar.d.ts.map +1 -1
- package/dist/components/media-resources/MediaResourceTabBar.js +1 -1
- package/dist/components/media-resources/MediaResourceTabs.js +1 -1
- package/dist/components/media-resources/ResourceEmptyState.d.ts.map +1 -1
- package/dist/components/media-resources/ResourceEmptyState.js +1 -1
- package/dist/components/media-resources/ResourceScrollContainer.d.ts.map +1 -1
- package/dist/components/media-resources/ResourceScrollContainer.js +1 -1
- package/dist/components/media-resources/VideoResourceGrid.d.ts.map +1 -1
- package/dist/components/media-resources/VideoResourceGrid.js +1 -1
- package/dist/components/message/GroupMembersDrawer.js +1 -1
- package/dist/components/message/MessageHeader.d.ts.map +1 -1
- package/dist/components/message/MessageHeader.js +3 -2
- package/dist/components/message/MessageInfiniteScroll.d.ts.map +1 -1
- package/dist/components/message/MessageInfiniteScroll.js +1 -1
- package/dist/components/message/MessageList.d.ts.map +1 -1
- package/dist/components/message/MessageList.js +22 -12
- package/dist/components/message/SelectSession.js +1 -1
- package/dist/components/message/UnassignedSessionFooter.d.ts.map +1 -1
- package/dist/components/message/UnassignedSessionFooter.js +1 -1
- package/dist/components/message/footer/ActionBar.d.ts.map +1 -1
- package/dist/components/message/footer/ActionBar.js +4 -1
- package/dist/components/message/footer/ComposerEditor.js +1 -1
- package/dist/components/message/footer/ComposerTabs.d.ts.map +1 -1
- package/dist/components/message/footer/ComposerTabs.js +1 -1
- package/dist/components/message/footer/EmojiPicker.js +1 -1
- package/dist/components/message/footer/EnterHandler.d.ts.map +1 -1
- package/dist/components/message/footer/EnterHandler.js +10 -1
- package/dist/components/message/footer/FilePreview.d.ts.map +1 -1
- package/dist/components/message/footer/FilePreview.js +4 -4
- package/dist/components/message/footer/LinkInputPreview.d.ts.map +1 -1
- package/dist/components/message/footer/LinkInputPreview.js +1 -1
- package/dist/components/message/footer/MediaActions.js +1 -1
- package/dist/components/message/footer/SessionClosedModal.d.ts.map +1 -1
- package/dist/components/message/footer/SessionClosedModal.js +1 -1
- package/dist/components/message/footer/ToolbarPlugin.js +1 -1
- package/dist/components/message/footer/editorConfig.d.ts +2 -1
- package/dist/components/message/footer/editorConfig.d.ts.map +1 -1
- package/dist/components/message/footer/editorConfig.js +2 -0
- package/dist/components/message/footer/index.d.ts.map +1 -1
- package/dist/components/message/footer/index.js +16 -2
- package/dist/components/message/footer/mention/MentionMenu.d.ts +6 -0
- package/dist/components/message/footer/mention/MentionMenu.d.ts.map +1 -0
- package/dist/components/message/footer/mention/MentionMenu.js +51 -0
- package/dist/components/message/footer/mention/MentionNode.d.ts +20 -0
- package/dist/components/message/footer/mention/MentionNode.d.ts.map +1 -0
- package/dist/components/message/footer/mention/MentionNode.js +39 -0
- package/dist/components/message/footer/mention/extractMentions.d.ts +6 -0
- package/dist/components/message/footer/mention/extractMentions.d.ts.map +1 -0
- package/dist/components/message/footer/mention/extractMentions.js +66 -0
- package/dist/components/message/footer/mention/useMentionOptions.d.ts +8 -0
- package/dist/components/message/footer/mention/useMentionOptions.d.ts.map +1 -0
- package/dist/components/message/footer/mention/useMentionOptions.js +45 -0
- package/dist/components/message/item/AtTextMessage.d.ts +16 -0
- package/dist/components/message/item/AtTextMessage.d.ts.map +1 -0
- package/dist/components/message/item/AtTextMessage.js +112 -0
- package/dist/components/message/item/FileMessage.js +1 -1
- package/dist/components/message/item/GroupNotificationMessage.d.ts.map +1 -1
- package/dist/components/message/item/GroupNotificationMessage.js +2 -2
- package/dist/components/message/item/ImageMessage.js +1 -1
- package/dist/components/message/item/LinkCard.d.ts.map +1 -1
- package/dist/components/message/item/LinkCard.js +1 -1
- package/dist/components/message/item/LinkText.d.ts.map +1 -1
- package/dist/components/message/item/LinkText.js +1 -1
- package/dist/components/message/item/MergeImageMessage.js +1 -1
- package/dist/components/message/item/MessageBubble.d.ts.map +1 -1
- package/dist/components/message/item/MessageBubble.js +2 -2
- package/dist/components/message/item/QuoteMessage.d.ts.map +1 -1
- package/dist/components/message/item/QuoteMessage.js +1 -1
- package/dist/components/message/item/RevokeMessage.d.ts.map +1 -1
- package/dist/components/message/item/RevokeMessage.js +1 -1
- package/dist/components/message/item/VideoMessage.js +1 -1
- package/dist/components/message/item/index.d.ts.map +1 -1
- package/dist/components/message/item/index.js +3 -3
- package/dist/components/message/item/renderMessageContent.d.ts.map +1 -1
- package/dist/components/message/item/renderMessageContent.js +3 -0
- package/dist/components/message/reply/ReplyPreviewBar.d.ts.map +1 -1
- package/dist/components/message/reply/ReplyPreviewBar.js +1 -1
- package/dist/components/message/reply/ReplyQuoteContent.d.ts.map +1 -1
- package/dist/components/message/reply/ReplyQuoteContent.js +7 -5
- package/dist/components/message/toolbox/MessageToolboxMenu.js +1 -1
- package/dist/components/message/toolbox/getCopyableMessageText.d.ts.map +1 -1
- package/dist/components/message/toolbox/getCopyableMessageText.js +5 -3
- package/dist/components/message/toolbox/isPinnableMessageType.d.ts.map +1 -1
- package/dist/components/message/toolbox/isPinnableMessageType.js +1 -0
- package/dist/components/search-conversation/SearchAll.d.ts.map +1 -1
- package/dist/components/search-conversation/SearchAll.js +9 -3
- package/dist/components/search-conversation/SearchConversationAsGroups.d.ts +6 -0
- package/dist/components/search-conversation/SearchConversationAsGroups.d.ts.map +1 -0
- package/dist/components/search-conversation/SearchConversationAsGroups.js +20 -0
- package/dist/components/search-conversation/SearchConversationAsMessages.d.ts.map +1 -1
- package/dist/components/search-conversation/SearchConversationAsMessages.js +1 -1
- package/dist/components/search-conversation/SearchConversationAsUsers.d.ts.map +1 -1
- package/dist/components/search-conversation/SearchConversationAsUsers.js +1 -1
- package/dist/components/search-conversation/SearchConversationMyInbox.js +1 -1
- package/dist/components/search-conversation/SearchDrawer.js +1 -1
- package/dist/components/search-conversation/SearchMessageOnCurrentConversation.d.ts.map +1 -1
- package/dist/components/search-conversation/SearchMessageOnCurrentConversation.js +1 -1
- package/dist/components/search-conversation/index.d.ts +2 -1
- package/dist/components/search-conversation/index.d.ts.map +1 -1
- package/dist/components/search-conversation/index.js +8 -1
- package/dist/components/search-conversation/item/SearchItemAsGroup.d.ts +8 -0
- package/dist/components/search-conversation/item/SearchItemAsGroup.d.ts.map +1 -0
- package/dist/components/search-conversation/item/SearchItemAsGroup.js +34 -0
- package/dist/components/search-conversation/item/SearchItemAsMessage.d.ts.map +1 -1
- package/dist/components/search-conversation/item/SearchItemAsMessage.js +1 -1
- package/dist/components/search-conversation/item/SearchItemAsUser.d.ts.map +1 -1
- package/dist/components/search-conversation/item/SearchItemAsUser.js +1 -1
- package/dist/components/session/DeskTeamInbox.d.ts.map +1 -1
- package/dist/components/session/DeskTeamInbox.js +3 -2
- package/dist/components/session/SessionFilterMenu.d.ts.map +1 -1
- package/dist/components/session/SessionFilterMenu.js +1 -1
- package/dist/components/thread/AssignConfirmModal.d.ts.map +1 -1
- package/dist/components/thread/AssignConfirmModal.js +1 -1
- package/dist/components/thread/GroupThreadInfo.d.ts.map +1 -1
- package/dist/components/thread/GroupThreadInfo.js +7 -4
- package/dist/components/thread/ManualAssignPopover.d.ts.map +1 -1
- package/dist/components/thread/ManualAssignPopover.js +1 -1
- package/dist/components/thread/SessionSection.d.ts.map +1 -1
- package/dist/components/thread/SessionSection.js +2 -2
- package/dist/components/thread/SingleThreadInfo.d.ts.map +1 -1
- package/dist/components/thread/SingleThreadInfo.js +1 -1
- package/dist/components/thread/ThreadInfo.js +1 -1
- package/dist/components/thread/UserSection.d.ts.map +1 -1
- package/dist/components/thread/UserSection.js +1 -1
- package/dist/components/video-player/VideoPlayerModal.d.ts.map +1 -1
- package/dist/components/video-player/VideoPlayerModal.js +1 -1
- package/dist/context/ChatContext.d.ts +1 -1
- package/dist/context/ChatContext.d.ts.map +1 -1
- package/dist/context/ChatContext.js +2 -1
- package/dist/hooks/global/useGlobalEvent.d.ts.map +1 -1
- package/dist/hooks/global/useGlobalEvent.js +125 -25
- package/dist/hooks/group/useConversationGroups.d.ts +5 -1
- package/dist/hooks/group/useConversationGroups.d.ts.map +1 -1
- package/dist/hooks/group/useConversationGroups.js +3 -3
- package/dist/hooks/group/useGroupPermission.d.ts +1 -1
- package/dist/hooks/group/useGroupPermission.d.ts.map +1 -1
- package/dist/hooks/group/useGroupPermission.js +2 -2
- package/dist/hooks/group/useLeaveGroupAction.d.ts +24 -0
- package/dist/hooks/group/useLeaveGroupAction.d.ts.map +1 -0
- package/dist/hooks/group/useLeaveGroupAction.js +79 -0
- package/dist/hooks/group/useQuitGroup.d.ts +6 -0
- package/dist/hooks/group/useQuitGroup.d.ts.map +1 -0
- package/dist/hooks/group/useQuitGroup.js +62 -0
- package/dist/hooks/message/useMessage.d.ts +4 -1
- package/dist/hooks/message/useMessage.d.ts.map +1 -1
- package/dist/hooks/message/useMessage.js +9 -2
- package/dist/hooks/message/useSendMessage.d.ts +8 -4
- package/dist/hooks/message/useSendMessage.d.ts.map +1 -1
- package/dist/hooks/message/useSendMessage.js +46 -12
- package/dist/hooks/search/useSearchGroups.d.ts +16 -0
- package/dist/hooks/search/useSearchGroups.d.ts.map +1 -0
- package/dist/hooks/search/useSearchGroups.js +65 -0
- package/dist/hooks/session/useConversationSessionState.d.ts +2 -1
- package/dist/hooks/session/useConversationSessionState.d.ts.map +1 -1
- package/dist/hooks/session/useConversationSessionState.js +5 -5
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +10 -1
- package/dist/locales/vi/common.json +12 -0
- package/dist/locales/vi/conversation-inbox.json +18 -1
- package/dist/services/query.d.ts +1 -0
- package/dist/services/query.d.ts.map +1 -1
- package/dist/services/query.js +1 -0
- package/dist/services/routes.d.ts +1 -0
- package/dist/services/routes.d.ts.map +1 -1
- package/dist/services/routes.js +1 -0
- package/dist/store/auth.js +1 -1
- package/dist/store/conversation.d.ts.map +1 -1
- package/dist/store/conversation.js +96 -51
- package/dist/store/type.d.ts +8 -2
- package/dist/store/type.d.ts.map +1 -1
- package/dist/styles/global.css +1 -1
- package/dist/types/chat.d.ts +28 -2
- package/dist/types/chat.d.ts.map +1 -1
- package/dist/types/dto.d.ts +3 -1
- package/dist/types/dto.d.ts.map +1 -1
- package/dist/utils/common.d.ts.map +1 -1
- package/dist/utils/common.js +19 -9
- package/dist/utils/messageLog.d.ts +2 -2
- package/dist/utils/messageLog.d.ts.map +1 -1
- package/dist/utils/messageLog.js +33 -3
- package/package.json +17 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssignConfirmModal.d.ts","sourceRoot":"","sources":["../../../src/components/thread/AssignConfirmModal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGjD,UAAU,uBAAuB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,kBAAkB,GAAI,4DAOzB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"AssignConfirmModal.d.ts","sourceRoot":"","sources":["../../../src/components/thread/AssignConfirmModal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGjD,UAAU,uBAAuB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,kBAAkB,GAAI,4DAOzB,uBAAuB,4CAyDzB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { useTranslation, Trans } from "react-i18next";
|
|
|
4
4
|
const AssignConfirmModal = ({ open, agent, loading, onCancel, onConfirm, afterClose, }) => {
|
|
5
5
|
var _a;
|
|
6
6
|
const { t } = useTranslation();
|
|
7
|
-
return (_jsx(Modal, { open: open, onCancel: onCancel, footer: null, closable: !loading, centered: true, forceRender: true, width: 400, maskClosable: !loading, keyboard: !loading, afterClose: afterClose, children: _jsxs("div", { className: "flex flex-col items-center gap-4 pt-2", role: "alertdialog", "aria-label": t("manual_assign_confirm_question", {
|
|
7
|
+
return (_jsx(Modal, { open: open, onCancel: onCancel, footer: null, closable: !loading, centered: true, forceRender: true, width: 400, maskClosable: !loading, keyboard: !loading, afterClose: afterClose, "data-cp-name": "AssignConfirmModal", children: _jsxs("div", { className: "flex flex-col items-center gap-4 pt-2", role: "alertdialog", "aria-label": t("manual_assign_confirm_question", {
|
|
8
8
|
name: agent === null || agent === void 0 ? void 0 : agent.displayName,
|
|
9
9
|
}), children: [_jsx(Avatar, { src: agent === null || agent === void 0 ? void 0 : agent.avatar, size: 48, children: ((_a = agent === null || agent === void 0 ? void 0 : agent.displayName) === null || _a === void 0 ? void 0 : _a.charAt(0)) || "A" }), _jsx("p", { className: "text-base text-center", children: _jsx(Trans, { i18nKey: "manual_assign_confirm_question", values: { name: agent === null || agent === void 0 ? void 0 : agent.displayName }, components: { bold: _jsx("strong", {}) } }) }), _jsxs("div", { className: "flex gap-3 w-full", children: [_jsx(Button, { className: "flex-1", size: "large", onClick: onCancel, disabled: loading, children: t("cancel") }), _jsx(Button, { type: "primary", className: "flex-1", size: "large", onClick: onConfirm, loading: loading, disabled: !agent, children: t("manual_assign_button_reassign") })] })] }) }));
|
|
10
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupThreadInfo.d.ts","sourceRoot":"","sources":["../../../src/components/thread/GroupThreadInfo.tsx"],"names":[],"mappings":"AAoBA,MAAM,WAAW,qBAAqB;IACpC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,UAAU,oBAAoB;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAChC;AAID,QAAA,MAAM,eAAe,GAAI,qBAAqB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"GroupThreadInfo.d.ts","sourceRoot":"","sources":["../../../src/components/thread/GroupThreadInfo.tsx"],"names":[],"mappings":"AAoBA,MAAM,WAAW,qBAAqB;IACpC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,UAAU,oBAAoB;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAChC;AAID,QAAA,MAAM,eAAe,GAAI,qBAAqB,oBAAoB,mDAqkBjE,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -22,11 +22,11 @@ const GroupThreadInfo = ({ onClose, config }) => {
|
|
|
22
22
|
var _a, _b, _c, _d;
|
|
23
23
|
const { t } = useTranslation();
|
|
24
24
|
const conversationData = useConversationStore((state) => state.conversationData);
|
|
25
|
-
const currentGroupInfo = useConversationStore((state) => state.currentGroupInfo);
|
|
26
25
|
const groupID = (conversationData === null || conversationData === void 0 ? void 0 : conversationData.groupID) || "";
|
|
26
|
+
const currentGroupInfo = useConversationStore((state) => state.currentGroupInfo.get(groupID));
|
|
27
27
|
const conversationID = (conversationData === null || conversationData === void 0 ? void 0 : conversationData.conversationID) || "";
|
|
28
28
|
const permissions = useGroupPermission(groupID);
|
|
29
|
-
const currentMemberInGroup = useConversationStore((state) => state.currentMemberInGroup);
|
|
29
|
+
const currentMemberInGroup = useConversationStore((state) => state.currentMemberInGroup.get(groupID));
|
|
30
30
|
// Muted-chat-list and disband-group aren't part of the 11-permission
|
|
31
31
|
// matrix in the spec — kept as a role check like before, not mocked
|
|
32
32
|
// per-permission.
|
|
@@ -36,6 +36,9 @@ const GroupThreadInfo = ({ onClose, config }) => {
|
|
|
36
36
|
// unlike other admin-manageable rows in this panel, admins may view but
|
|
37
37
|
// not change this toggle.
|
|
38
38
|
const isOwner = (currentMemberInGroup === null || currentMemberInGroup === void 0 ? void 0 : currentMemberInGroup.roleLevel) === GroupMemberRole.Owner;
|
|
39
|
+
// Non-member viewing an existing public group in view-only mode — no
|
|
40
|
+
// longer a member, so "Rời khỏi nhóm" (leave) doesn't apply.
|
|
41
|
+
const isViewOnlyMember = useConversationStore((state) => state.isViewOnlyMember);
|
|
39
42
|
const [editingField, setEditingField] = useState(null);
|
|
40
43
|
const [nameValue, setNameValue] = useState((_a = currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.groupName) !== null && _a !== void 0 ? _a : "");
|
|
41
44
|
const [descriptionValue, setDescriptionValue] = useState((_b = currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.introduction) !== null && _b !== void 0 ? _b : "");
|
|
@@ -213,9 +216,9 @@ const GroupThreadInfo = ({ onClose, config }) => {
|
|
|
213
216
|
if (!groupID) {
|
|
214
217
|
return null;
|
|
215
218
|
}
|
|
216
|
-
return (_jsxs("div", { className: "h-full w-[330px] bg-white shadow-md flex flex-col relative overflow-hidden", children: [_jsxs("div", { className: "flex items-center justify-between px-4 py-4 border-b border-gray-100", children: [_jsx("span", { className: "text-lg font-medium", children: t("thread_info_title") }), _jsx("button", { type: "button", className: "flex items-center justify-center w-8 h-8 rounded-full text-gray-500 hover:bg-gray-100", onClick: onClose, children: _jsx(Icon, { icon: "close-o", size: 20 }) })] }), _jsxs("div", { className: "flex-1 overflow-y-auto", children: [_jsxs("div", { className: "flex items-center gap-3 px-4 py-4", children: [_jsxs("div", { className: "relative shrink-0", children: [_jsx(GroupCompositeAvatar, { groupID: groupID, faceURL: currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.faceURL, ownerUserID: currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.ownerUserID, groupName: currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.groupName, size: 56 }), isAvatarUploading && (_jsx("span", { className: "absolute inset-0 flex items-center justify-center rounded-full bg-black/30", children: _jsx("span", { className: "h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent" }) })), permissions.updateGroupAvatar && (_jsxs(_Fragment, { children: [_jsx("input", { ref: avatarInputRef, type: "file", accept: ACCEPTED_IMAGE_TYPES.join(", "), className: "hidden", onChange: handleAvatarSelect }), _jsx("button", { type: "button", disabled: isAvatarUploading, onClick: handleAvatarClick, className: "absolute -bottom-1 -right-1 flex items-center justify-center w-5 h-5 rounded-full bg-black text-white", children: _jsx(Icon, { icon: "camera-o", size: 12 }) })] }))] }), _jsx("div", { className: "flex-1 min-w-0", children: editingField !== "name" && (_jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [_jsx("p", { className: "text-base font-medium truncate", children: currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.groupName }), permissions.updateGroupName && (_jsx(Icon, { icon: "edit-o", size: 16, className: "shrink-0 cursor-pointer text-gray-500", onClick: startEditName }))] })) })] }), editingField === "name" && (_jsx("div", { className: "px-4 pb-4", children: _jsxs("div", { className: "flex flex-col gap-3 bg-[#f5f5f5] rounded-lg p-3", children: [_jsx(Input, { autoFocus: true, value: nameValue, onChange: (event) => setNameValue(event.target.value), maxLength: 255, showCount: true, disabled: isSavingGroupInfo, className: "bg-white" }), _jsxs("div", { className: "flex items-center justify-end gap-2", children: [_jsx("button", { type: "button", className: "px-4 py-1.5 rounded-lg border border-primary-500 text-primary-500 text-sm font-medium disabled:border-gray-200 disabled:text-gray-300", disabled: isSavingGroupInfo, onClick: cancelEditName, children: t("cancel") }), _jsx("button", { type: "button", className: "px-4 py-1.5 rounded-lg bg-primary-500 text-white text-sm font-medium disabled:bg-gray-100 disabled:text-gray-300", disabled: isSavingGroupInfo ||
|
|
219
|
+
return (_jsxs("div", { className: "h-full w-[330px] bg-white shadow-md flex flex-col relative overflow-hidden", "data-cp-name": "GroupThreadInfo", children: [_jsxs("div", { className: "flex items-center justify-between px-4 py-4 border-b border-gray-100", children: [_jsx("span", { className: "text-lg font-medium", children: t("thread_info_title") }), _jsx("button", { type: "button", className: "flex items-center justify-center w-8 h-8 rounded-full text-gray-500 hover:bg-gray-100", onClick: onClose, children: _jsx(Icon, { icon: "close-o", size: 20 }) })] }), _jsxs("div", { className: "flex-1 overflow-y-auto", children: [_jsxs("div", { className: "flex items-center gap-3 px-4 py-4", children: [_jsxs("div", { className: "relative shrink-0", children: [_jsx(GroupCompositeAvatar, { groupID: groupID, faceURL: currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.faceURL, ownerUserID: currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.ownerUserID, groupName: currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.groupName, size: 56 }), isAvatarUploading && (_jsx("span", { className: "absolute inset-0 flex items-center justify-center rounded-full bg-black/30", children: _jsx("span", { className: "h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent" }) })), permissions.updateGroupAvatar && (_jsxs(_Fragment, { children: [_jsx("input", { ref: avatarInputRef, type: "file", accept: ACCEPTED_IMAGE_TYPES.join(", "), className: "hidden", onChange: handleAvatarSelect }), _jsx("button", { type: "button", disabled: isAvatarUploading, onClick: handleAvatarClick, className: "absolute -bottom-1 -right-1 flex items-center justify-center w-5 h-5 rounded-full bg-black text-white", children: _jsx(Icon, { icon: "camera-o", size: 12 }) })] }))] }), _jsx("div", { className: "flex-1 min-w-0", children: editingField !== "name" && (_jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [_jsx("p", { className: "text-base font-medium truncate", children: currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.groupName }), permissions.updateGroupName && (_jsx(Icon, { icon: "edit-o", size: 16, className: "shrink-0 cursor-pointer text-gray-500", onClick: startEditName }))] })) })] }), editingField === "name" && (_jsx("div", { className: "px-4 pb-4", children: _jsxs("div", { className: "flex flex-col gap-3 bg-[#f5f5f5] rounded-lg p-3", children: [_jsx(Input, { autoFocus: true, value: nameValue, onChange: (event) => setNameValue(event.target.value), maxLength: 255, showCount: true, disabled: isSavingGroupInfo, className: "bg-white" }), _jsxs("div", { className: "flex items-center justify-end gap-2", children: [_jsx("button", { type: "button", className: "px-4 py-1.5 rounded-lg border border-primary-500 text-primary-500 text-sm font-medium disabled:border-gray-200 disabled:text-gray-300", disabled: isSavingGroupInfo, onClick: cancelEditName, children: t("cancel") }), _jsx("button", { type: "button", className: "px-4 py-1.5 rounded-lg bg-primary-500 text-white text-sm font-medium disabled:bg-gray-100 disabled:text-gray-300", disabled: isSavingGroupInfo ||
|
|
217
220
|
!nameValue.trim() ||
|
|
218
221
|
nameValue.trim() === ((_c = currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.groupName) !== null && _c !== void 0 ? _c : ""), onClick: saveName, children: t("save") })] })] }) })), _jsx("div", { className: "px-4 pb-4", children: editingField === "description" ? (_jsxs("div", { className: "flex flex-col gap-3 bg-[#f5f5f5] rounded-lg p-3", children: [_jsxs("span", { className: "flex items-center gap-2 text-sm font-medium text-gray-900", children: [_jsx(Icon, { icon: "info-circle-o", size: 18, className: "text-gray-500" }), t("description")] }), _jsx(Input.TextArea, { autoFocus: true, value: descriptionValue, onChange: (event) => setDescriptionValue(event.target.value), placeholder: t("enter_group_description"), autoSize: { minRows: 1, maxRows: 4 }, maxLength: 500, showCount: true, disabled: isSavingGroupInfo, className: "bg-white" }), _jsxs("div", { className: "flex items-center justify-end gap-2", children: [_jsx("button", { type: "button", className: "px-4 py-1.5 rounded-lg border border-primary-500 text-primary-500 text-sm font-medium disabled:border-gray-200 disabled:text-gray-300", disabled: isSavingGroupInfo, onClick: cancelEditDescription, children: t("cancel") }), _jsx("button", { type: "button", className: "px-4 py-1.5 rounded-lg bg-primary-500 text-white text-sm font-medium disabled:bg-gray-100 disabled:text-gray-300", disabled: isSavingGroupInfo ||
|
|
219
|
-
descriptionValue.trim() === ((_d = currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.introduction) !== null && _d !== void 0 ? _d : ""), onClick: saveDescription, children: t("save") })] })] })) : (_jsxs("div", { className: "flex items-start justify-between gap-2 bg-[#f5f5f5] rounded-lg px-3 py-2.5", children: [_jsxs("div", { className: "flex items-start gap-2 flex-1 min-w-0", children: [_jsx(Icon, { icon: "info-circle-o", size: 18, className: "shrink-0 mt-0.5 text-gray-900" }), _jsxs("div", { className: "flex flex-col gap-0.5 min-w-0", children: [_jsx("span", { className: "text-sm font-semibold text-gray-900", children: t("description") }), _jsx("p", { className: "text-sm text-gray-400 truncate", children: (currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.introduction) || t("no_description") })] })] }), permissions.updateGroupDescription && (_jsx(Icon, { icon: "edit-o", size: 16, className: "shrink-0 cursor-pointer text-gray-500", onClick: startEditDescription }))] })) }), _jsxs("div", { className: "flex flex-col gap-1 bg-[#f5f5f5] mx-4 rounded-lg overflow-hidden", children: [_jsxs("div", { className: "flex items-center justify-between px-3 py-3", children: [_jsxs("span", { className: "flex items-center gap-3 text-sm", children: [_jsx(Icon, { icon: "bell-o", size: 18 }), t("notification")] }), _jsx(Switch, { checked: notifyEnabled, onChange: handleToggleNotification, loading: isTogglingNotification })] }), (config === null || config === void 0 ? void 0 : config.showAllowSendMessage) && isOwner && (_jsxs("div", { className: "flex items-center justify-between px-3 py-3", children: [_jsxs("span", { className: "flex items-center gap-3 text-sm", children: [_jsx(Icon, { icon: "user-check-o", size: 18 }), t("allow_send_message")] }), _jsx(Switch, { checked: allowSendMessage, onChange: handleToggleSendMessage, loading: isTogglingSendMessage })] })), isAdminOrOwner && (config === null || config === void 0 ? void 0 : config.showMutedChatList) && (_jsxs("button", { type: "button", className: "flex items-center justify-between px-3 py-3 text-left", onClick: () => setActiveRow("muted-chat-list"), children: [_jsxs("span", { className: "flex items-center gap-3 text-sm", children: [_jsx(Icon, { icon: "bell-off-o", size: 18 }), t("muted_chat_list")] }), _jsx(Icon, { icon: "angle-right-o", size: 16, className: "text-gray-400" })] })), isAdminOrOwner && (_jsxs("button", { type: "button", className: "flex items-center justify-between px-3 py-3 text-left", onClick: () => setActiveRow("block-list"), children: [_jsxs("span", { className: "flex items-center gap-3 text-sm", children: [_jsx(Icon, { icon: "user-del-o", size: 18 }), t("block_list")] }), _jsx(Icon, { icon: "angle-right-o", size: 16, className: "text-gray-400" })] }))] }), permissions.configGroupPermission && (_jsxs("div", { className: "flex flex-col gap-1 bg-[#f5f5f5] mx-4 mt-3 rounded-lg overflow-hidden", children: [_jsxs("button", { type: "button", className: "flex items-center justify-between px-3 py-3 text-left", onClick: () => setActiveRow("member-permission"), children: [_jsxs("span", { className: "flex items-center gap-3 text-sm", children: [_jsx(Icon, { icon: "shield-o", size: 18 }), t("member_permission_settings")] }), _jsx(Icon, { icon: "angle-right-o", size: 16, className: "text-gray-400" })] }), _jsxs("button", { type: "button", className: "flex items-center justify-between px-3 py-3 text-left", onClick: () => setActiveRow("admin-permission"), children: [_jsxs("span", { className: "flex items-center gap-3 text-sm", children: [_jsx(Icon, { icon: "shield-done-o", size: 18 }), t("admin_permission_settings")] }), _jsx(Icon, { icon: "angle-right-o", size: 16, className: "text-gray-400" })] })] })), _jsx("div", { className: "mx-4 mt-3 rounded-lg overflow-hidden bg-[#f5f5f5]", children: _jsxs("button", { type: "button", className: "w-full flex items-center gap-3 px-3 py-3 text-left text-sm text-gray-400 cursor-not-allowed", disabled: true, title: t("invite_via_link_pending"), children: [_jsx(Icon, { icon: "link-alt-o", size: 18 }), t("invite_via_link")] }) }), _jsxs("div", { className: "flex flex-col gap-1 bg-[#f5f5f5] mx-4 mt-3 mb-4 rounded-lg overflow-hidden", children: [isAdminOrOwner && (_jsxs("button", { type: "button", className: "flex items-center gap-3 px-3 py-3 text-left text-sm text-red-500", onClick: () => setConfirmAction("delete"), children: [_jsx(Icon, { icon: "trash-o", size: 18 }), t("delete_conversation")] })), _jsxs("button", { type: "button", className: "flex items-center gap-3 px-3 py-3 text-left text-sm text-red-500", onClick: () => setConfirmAction("leave"), children: [_jsx(Icon, { icon: "logout-o", size: 18 }), t("leave_group")] }), isOwner && (_jsxs("button", { type: "button", className: "flex items-center gap-3 px-3 py-3 text-left text-sm text-red-500", onClick: () => setConfirmAction("disband"), children: [_jsx(Icon, { icon: "user-del-o", size: 18 }), t("disband_group")] }))] })] }), _jsx(ConfirmModal, { open: confirmAction === "leave", onOk: handleConfirmLeave, onCancel: () => setConfirmAction(null), title: t("leave_group_confirm_title"), okText: t("leave_group"), cancelText: t("cancel"), okType: "danger", confirmLoading: isLeaving, children: _jsx("p", { children: t("leave_group_confirm_message") }) }), _jsx(ConfirmModal, { open: confirmAction === "disband", onOk: handleConfirmDisband, onCancel: () => setConfirmAction(null), title: t("disband_group_confirm_title"), okText: t("disband_group"), cancelText: t("cancel"), okType: "danger", confirmLoading: isDismissing, children: _jsx("p", { children: t("disband_group_confirm_message") }) }), _jsx(ConfirmModal, { open: confirmAction === "delete", onOk: handleConfirmDelete, onCancel: () => setConfirmAction(null), title: t("delete_conversation_confirm_title"), okText: t("delete_conversation"), cancelText: t("cancel"), okType: "danger", confirmLoading: isDeleting, children: _jsx("p", { children: t("delete_conversation_confirm_message") }) }), _jsx(MemberPermissionPanel, { open: activeRow === "member-permission", groupID: groupID, onClose: () => setActiveRow(null) }), _jsx(AdminPermissionModal, { open: activeRow === "admin-permission", groupID: groupID, onClose: () => setActiveRow(null), inline: true }), (activeRow === "muted-chat-list" || activeRow === "block-list") && (_jsx(Modal, { centered: true, open: true, footer: null, onCancel: () => setActiveRow(null), title: t(activeRow === "muted-chat-list" ? "muted_chat_list" : "block_list"), getContainer: false, forceRender: true, children: _jsx("p", { className: "text-sm text-gray-500", children: t("feature_coming_soon") }) }))] }));
|
|
222
|
+
descriptionValue.trim() === ((_d = currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.introduction) !== null && _d !== void 0 ? _d : ""), onClick: saveDescription, children: t("save") })] })] })) : (_jsxs("div", { className: "flex items-start justify-between gap-2 bg-[#f5f5f5] rounded-lg px-3 py-2.5", children: [_jsxs("div", { className: "flex items-start gap-2 flex-1 min-w-0", children: [_jsx(Icon, { icon: "info-circle-o", size: 18, className: "shrink-0 mt-0.5 text-gray-900" }), _jsxs("div", { className: "flex flex-col gap-0.5 min-w-0", children: [_jsx("span", { className: "text-sm font-semibold text-gray-900", children: t("description") }), _jsx("p", { className: "text-sm text-gray-400 truncate", children: (currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.introduction) || t("no_description") })] })] }), permissions.updateGroupDescription && (_jsx(Icon, { icon: "edit-o", size: 16, className: "shrink-0 cursor-pointer text-gray-500", onClick: startEditDescription }))] })) }), _jsxs("div", { className: "flex flex-col gap-1 bg-[#f5f5f5] mx-4 rounded-lg overflow-hidden", children: [_jsxs("div", { className: "flex items-center justify-between px-3 py-3", children: [_jsxs("span", { className: "flex items-center gap-3 text-sm", children: [_jsx(Icon, { icon: "bell-o", size: 18 }), t("notification")] }), _jsx(Switch, { checked: notifyEnabled, onChange: handleToggleNotification, loading: isTogglingNotification })] }), (config === null || config === void 0 ? void 0 : config.showAllowSendMessage) && isOwner && (_jsxs("div", { className: "flex items-center justify-between px-3 py-3", children: [_jsxs("span", { className: "flex items-center gap-3 text-sm", children: [_jsx(Icon, { icon: "user-check-o", size: 18 }), t("allow_send_message")] }), _jsx(Switch, { checked: allowSendMessage, onChange: handleToggleSendMessage, loading: isTogglingSendMessage })] })), isAdminOrOwner && (config === null || config === void 0 ? void 0 : config.showMutedChatList) && (_jsxs("button", { type: "button", className: "flex items-center justify-between px-3 py-3 text-left", onClick: () => setActiveRow("muted-chat-list"), children: [_jsxs("span", { className: "flex items-center gap-3 text-sm", children: [_jsx(Icon, { icon: "bell-off-o", size: 18 }), t("muted_chat_list")] }), _jsx(Icon, { icon: "angle-right-o", size: 16, className: "text-gray-400" })] })), isAdminOrOwner && (_jsxs("button", { type: "button", className: "flex items-center justify-between px-3 py-3 text-left", onClick: () => setActiveRow("block-list"), children: [_jsxs("span", { className: "flex items-center gap-3 text-sm", children: [_jsx(Icon, { icon: "user-del-o", size: 18 }), t("block_list")] }), _jsx(Icon, { icon: "angle-right-o", size: 16, className: "text-gray-400" })] }))] }), permissions.configGroupPermission && (_jsxs("div", { className: "flex flex-col gap-1 bg-[#f5f5f5] mx-4 mt-3 rounded-lg overflow-hidden", children: [_jsxs("button", { type: "button", className: "flex items-center justify-between px-3 py-3 text-left", onClick: () => setActiveRow("member-permission"), children: [_jsxs("span", { className: "flex items-center gap-3 text-sm", children: [_jsx(Icon, { icon: "shield-o", size: 18 }), t("member_permission_settings")] }), _jsx(Icon, { icon: "angle-right-o", size: 16, className: "text-gray-400" })] }), _jsxs("button", { type: "button", className: "flex items-center justify-between px-3 py-3 text-left", onClick: () => setActiveRow("admin-permission"), children: [_jsxs("span", { className: "flex items-center gap-3 text-sm", children: [_jsx(Icon, { icon: "shield-done-o", size: 18 }), t("admin_permission_settings")] }), _jsx(Icon, { icon: "angle-right-o", size: 16, className: "text-gray-400" })] })] })), _jsx("div", { className: "mx-4 mt-3 rounded-lg overflow-hidden bg-[#f5f5f5]", children: _jsxs("button", { type: "button", className: "w-full flex items-center gap-3 px-3 py-3 text-left text-sm text-gray-400 cursor-not-allowed", disabled: true, title: t("invite_via_link_pending"), children: [_jsx(Icon, { icon: "link-alt-o", size: 18 }), t("invite_via_link")] }) }), _jsxs("div", { className: "flex flex-col gap-1 bg-[#f5f5f5] mx-4 mt-3 mb-4 rounded-lg overflow-hidden", children: [isAdminOrOwner && (_jsxs("button", { type: "button", className: "flex items-center gap-3 px-3 py-3 text-left text-sm text-red-500", onClick: () => setConfirmAction("delete"), children: [_jsx(Icon, { icon: "trash-o", size: 18 }), t("delete_conversation")] })), !isViewOnlyMember && (_jsxs("button", { type: "button", className: "flex items-center gap-3 px-3 py-3 text-left text-sm text-red-500", onClick: () => setConfirmAction("leave"), children: [_jsx(Icon, { icon: "logout-o", size: 18 }), t("leave_group")] })), isOwner && (_jsxs("button", { type: "button", className: "flex items-center gap-3 px-3 py-3 text-left text-sm text-red-500", onClick: () => setConfirmAction("disband"), children: [_jsx(Icon, { icon: "user-del-o", size: 18 }), t("disband_group")] }))] })] }), _jsx(ConfirmModal, { open: confirmAction === "leave", onOk: handleConfirmLeave, onCancel: () => setConfirmAction(null), title: t("leave_group_confirm_title"), okText: t("leave_group"), cancelText: t("cancel"), okType: "danger", confirmLoading: isLeaving, children: _jsx("p", { children: t("leave_group_confirm_message") }) }), _jsx(ConfirmModal, { open: confirmAction === "disband", onOk: handleConfirmDisband, onCancel: () => setConfirmAction(null), title: t("disband_group_confirm_title"), okText: t("disband_group"), cancelText: t("cancel"), okType: "danger", confirmLoading: isDismissing, children: _jsx("p", { children: t("disband_group_confirm_message") }) }), _jsx(ConfirmModal, { open: confirmAction === "delete", onOk: handleConfirmDelete, onCancel: () => setConfirmAction(null), title: t("delete_conversation_confirm_title"), okText: t("delete_conversation"), cancelText: t("cancel"), okType: "danger", confirmLoading: isDeleting, children: _jsx("p", { children: t("delete_conversation_confirm_message") }) }), _jsx(MemberPermissionPanel, { open: activeRow === "member-permission", groupID: groupID, onClose: () => setActiveRow(null) }), _jsx(AdminPermissionModal, { open: activeRow === "admin-permission", groupID: groupID, onClose: () => setActiveRow(null), inline: true }), (activeRow === "muted-chat-list" || activeRow === "block-list") && (_jsx(Modal, { centered: true, open: true, footer: null, onCancel: () => setActiveRow(null), title: t(activeRow === "muted-chat-list" ? "muted_chat_list" : "block_list"), getContainer: false, forceRender: true, children: _jsx("p", { className: "text-sm text-gray-500", children: t("feature_coming_soon") }) }))] }));
|
|
220
223
|
};
|
|
221
224
|
export default GroupThreadInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManualAssignPopover.d.ts","sourceRoot":"","sources":["../../../src/components/thread/ManualAssignPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAkBjD,UAAU,aAAa;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,UAAU,wBAAwB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;
|
|
1
|
+
{"version":3,"file":"ManualAssignPopover.d.ts","sourceRoot":"","sources":["../../../src/components/thread/ManualAssignPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAkBjD,UAAU,aAAa;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,UAAU,wBAAwB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AA+CD,QAAA,MAAM,mBAAmB,GAAI,6EAM1B,wBAAwB,4CA4O1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -15,7 +15,7 @@ const SupporterItem = ({ supporter, onClick, isCurrentUser, }) => {
|
|
|
15
15
|
var _a;
|
|
16
16
|
const { t } = useTranslation();
|
|
17
17
|
const isOnline = supporter.status === "ONLINE";
|
|
18
|
-
return (_jsxs("div", { role: "option", tabIndex: 0, className: "flex items-center gap-3 px-3 py-2 rounded-md transition-colors cursor-pointer hover:bg-[#f5f5f5]", onClick: () => onClick(supporter), children: [_jsx(Badge, { dot: true, color: isOnline ? "#52c41a" : "#d9d9d9", offset: [-2, 24], children: _jsx(Avatar, { src: supporter.avatar, size: 32, children: ((_a = supporter.displayName) === null || _a === void 0 ? void 0 : _a.charAt(0)) || "A" }) }), _jsxs("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [_jsx("span", { className: "text-sm truncate", children: supporter.displayName }), isCurrentUser && (_jsx("span", { className: "text-xs text-blue-500 shrink-0", children: t("current_account") }))] }), _jsx("div", { className: "flex items-center gap-2 shrink-0", children: !!supporter.openSessionCount && supporter.openSessionCount > 0 && (_jsxs("span", { className: "flex items-center gap-0.5 bg-blue-500 text-white text-xs font-medium px-1.5 py-0.5 rounded-full", children: [_jsx(Icon, { icon: "chat-square-b", size: 11 }), supporter.openSessionCount] })) })] }));
|
|
18
|
+
return (_jsxs("div", { role: "option", tabIndex: 0, className: "flex items-center gap-3 px-3 py-2 rounded-md transition-colors cursor-pointer hover:bg-[#f5f5f5]", onClick: () => onClick(supporter), "data-cp-name": "SupporterItem", children: [_jsx(Badge, { dot: true, color: isOnline ? "#52c41a" : "#d9d9d9", offset: [-2, 24], children: _jsx(Avatar, { src: supporter.avatar, size: 32, children: ((_a = supporter.displayName) === null || _a === void 0 ? void 0 : _a.charAt(0)) || "A" }) }), _jsxs("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [_jsx("span", { className: "text-sm truncate", children: supporter.displayName }), isCurrentUser && (_jsx("span", { className: "text-xs text-blue-500 shrink-0", children: t("current_account") }))] }), _jsx("div", { className: "flex items-center gap-2 shrink-0", children: !!supporter.openSessionCount && supporter.openSessionCount > 0 && (_jsxs("span", { className: "flex items-center gap-0.5 bg-blue-500 text-white text-xs font-medium px-1.5 py-0.5 rounded-full", children: [_jsx(Icon, { icon: "chat-square-b", size: 11 }), supporter.openSessionCount] })) })] }));
|
|
19
19
|
};
|
|
20
20
|
const ManualAssignPopover = ({ sessionId, supporter, teamId: propTeamId, children, excludeCurrentUser = false, }) => {
|
|
21
21
|
var _a, _b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionSection.d.ts","sourceRoot":"","sources":["../../../src/components/thread/SessionSection.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAkB,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAqB/D,eAAO,MAAM,iBAAiB,GAAI,wBAG/B;IACD,OAAO,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;CACnB,
|
|
1
|
+
{"version":3,"file":"SessionSection.d.ts","sourceRoot":"","sources":["../../../src/components/thread/SessionSection.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAkB,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAqB/D,eAAO,MAAM,iBAAiB,GAAI,wBAG/B;IACD,OAAO,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;CACnB,4CAmNA,CAAC;AAiDF,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,cAAc,GAAI,yBAAyB,mBAAmB,4CAqCnE,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -113,7 +113,7 @@ export const SessionDetailCard = ({ session, isActive, }) => {
|
|
|
113
113
|
value: label.id,
|
|
114
114
|
label: label.name,
|
|
115
115
|
}));
|
|
116
|
-
return (_jsxs("div", { className: `p-3 border rounded-lg shadow-md ${isActive ? "border-blue-500" : "border-gray-300"}`, children: [_jsxs("div", { className: "flex justify-between items-start mb-3", children: [_jsx("div", { className: "flex items-center gap-2", children: _jsxs("div", { className: "flex flex-col", children: [_jsxs("div", { className: "flex items-center gap-1", children: [_jsx(Icon, { icon: "chat-square-b", size: 16, className: "text-gray-500" }), _jsx("p", { className: "font-semibold text-sm", children: t("session_label", { order: session.order }) })] }), _jsx("p", { className: "text-xs text-gray-400", children: formatSessionDate(session.closedDate || session.createdDate) })] }) }), isActive ? (_jsx(Tag, { color: "processing", children: t("session_active") })) : (_jsx(Avatar, { src: (_a = session.supporter) === null || _a === void 0 ? void 0 : _a.avatar, size: 24, children: ((_d = (_c = (_b = session.supporter) === null || _b === void 0 ? void 0 : _b.fullName) === null || _c === void 0 ? void 0 : _c.charAt) === null || _d === void 0 ? void 0 : _d.call(_c, 0)) || "A" }))] }), _jsxs("div", { className: "flex flex-col gap-3 text-sm", children: [_jsxs("div", { className: "flex items-center gap-2 text-gray-500", children: [_jsx(Icon, { icon: "tag-o", size: 16, className: "mt-1" }), _jsx(Select, { mode: "multiple", loading: isLoadingLabels, className: "w-full", placeholder: t("session_add_tag_placeholder"), options: labelOptions, value: (_e = session.labels) === null || _e === void 0 ? void 0 : _e.map((label) => label.id), onChange: handleUpdateLabels, removeIcon: true })] }), _jsxs("div", { className: "flex items-start gap-2 text-gray-500", children: [_jsx(Icon, { icon: "info-circle-o", size: 16, className: "mt-1" }), _jsx(TextArea, { value: issueDetailInput.value, onChange: (e) => setIssueDetailInput({
|
|
116
|
+
return (_jsxs("div", { className: `p-3 border rounded-lg shadow-md ${isActive ? "border-blue-500" : "border-gray-300"}`, "data-cp-name": "SessionDetailCard", children: [_jsxs("div", { className: "flex justify-between items-start mb-3", children: [_jsx("div", { className: "flex items-center gap-2", children: _jsxs("div", { className: "flex flex-col", children: [_jsxs("div", { className: "flex items-center gap-1", children: [_jsx(Icon, { icon: "chat-square-b", size: 16, className: "text-gray-500" }), _jsx("p", { className: "font-semibold text-sm", children: t("session_label", { order: session.order }) })] }), _jsx("p", { className: "text-xs text-gray-400", children: formatSessionDate(session.closedDate || session.createdDate) })] }) }), isActive ? (_jsx(Tag, { color: "processing", children: t("session_active") })) : (_jsx(Avatar, { src: (_a = session.supporter) === null || _a === void 0 ? void 0 : _a.avatar, size: 24, children: ((_d = (_c = (_b = session.supporter) === null || _b === void 0 ? void 0 : _b.fullName) === null || _c === void 0 ? void 0 : _c.charAt) === null || _d === void 0 ? void 0 : _d.call(_c, 0)) || "A" }))] }), _jsxs("div", { className: "flex flex-col gap-3 text-sm", children: [_jsxs("div", { className: "flex items-center gap-2 text-gray-500", children: [_jsx(Icon, { icon: "tag-o", size: 16, className: "mt-1" }), _jsx(Select, { mode: "multiple", loading: isLoadingLabels, className: "w-full", placeholder: t("session_add_tag_placeholder"), options: labelOptions, value: (_e = session.labels) === null || _e === void 0 ? void 0 : _e.map((label) => label.id), onChange: handleUpdateLabels, removeIcon: true })] }), _jsxs("div", { className: "flex items-start gap-2 text-gray-500", children: [_jsx(Icon, { icon: "info-circle-o", size: 16, className: "mt-1" }), _jsx(TextArea, { value: issueDetailInput.value, onChange: (e) => setIssueDetailInput({
|
|
117
117
|
value: e.target.value,
|
|
118
118
|
sessionId: session.id,
|
|
119
119
|
}), placeholder: t("session_issue_detail_placeholder"), className: "border-none !shadow-none py-0 px-2", autoSize: { minRows: 1, maxRows: 3 } })] }), _jsxs("div", { className: "flex items-start gap-2 text-gray-500", children: [_jsx(Icon, { icon: "paper-o", size: 16, className: "mt-1" }), _jsx(TextArea, { value: noteInput.value, onChange: (e) => setNoteInput({ value: e.target.value, sessionId: session.id }), placeholder: t("session_note_placeholder"), className: "border-none !shadow-none py-0 px-2", autoSize: { minRows: 1, maxRows: 3 } })] })] }), isActive && (_jsxs("div", { className: "flex items-center gap-2 mt-4 border-t border-gray-200 pt-4", children: [session.status !== SessionStatus.UNASSIGNED &&
|
|
@@ -137,6 +137,6 @@ const SessionSection = ({ sessions, isLoading }) => {
|
|
|
137
137
|
const handleToggleExpand = (sessionId) => {
|
|
138
138
|
setExpandedSessionId((prevId) => (prevId === sessionId ? null : sessionId));
|
|
139
139
|
};
|
|
140
|
-
return (_jsxs("div", { className: "flex flex-col border-b", children: [_jsx("div", { className: "flex items-center justify-between px-4 py-2 sticky top-0 bg-white z-10", children: _jsx("h3", { className: "font-bold text-gray-500 text-xs tracking-wider", children: t("sessions_heading") }) }), _jsx("div", { className: "px-4 pt-2 pb-4", children: isLoading ? (_jsx("div", { className: "text-center mt-4", children: _jsx(Spin, {}) })) : (_jsx("div", { className: "flex flex-col gap-1", children: sessions.map((session) => (_jsx(ClosedSessionItem, { session: session, expandedSessionId: expandedSessionId, onToggleExpand: handleToggleExpand }, session.id))) })) })] }));
|
|
140
|
+
return (_jsxs("div", { className: "flex flex-col border-b", "data-cp-name": "SessionSection", children: [_jsx("div", { className: "flex items-center justify-between px-4 py-2 sticky top-0 bg-white z-10", children: _jsx("h3", { className: "font-bold text-gray-500 text-xs tracking-wider", children: t("sessions_heading") }) }), _jsx("div", { className: "px-4 pt-2 pb-4", children: isLoading ? (_jsx("div", { className: "text-center mt-4", children: _jsx(Spin, {}) })) : (_jsx("div", { className: "flex flex-col gap-1", children: sessions.map((session) => (_jsx(ClosedSessionItem, { session: session, expandedSessionId: expandedSessionId, onToggleExpand: handleToggleExpand }, session.id))) })) })] }));
|
|
141
141
|
};
|
|
142
142
|
export default SessionSection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingleThreadInfo.d.ts","sourceRoot":"","sources":["../../../src/components/thread/SingleThreadInfo.tsx"],"names":[],"mappings":"AAaA,UAAU,qBAAqB;IAC7B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,QAAA,MAAM,gBAAgB,GAAI,aAAa,qBAAqB,
|
|
1
|
+
{"version":3,"file":"SingleThreadInfo.d.ts","sourceRoot":"","sources":["../../../src/components/thread/SingleThreadInfo.tsx"],"names":[],"mappings":"AAaA,UAAU,qBAAqB;IAC7B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,QAAA,MAAM,gBAAgB,GAAI,aAAa,qBAAqB,mDAoJ3D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -66,6 +66,6 @@ const SingleThreadInfo = ({ onClose }) => {
|
|
|
66
66
|
if (!conversationID) {
|
|
67
67
|
return null;
|
|
68
68
|
}
|
|
69
|
-
return (_jsxs("div", { className: "h-full w-[330px] bg-white shadow-md flex flex-col relative", children: [_jsxs("div", { className: "flex items-center justify-between px-4 py-4 border-b border-gray-100", children: [_jsx("span", { className: "text-lg font-medium", children: t("thread_info_title") }), _jsx("button", { type: "button", className: "flex items-center justify-center w-8 h-8 rounded-full text-gray-500 hover:bg-gray-100", onClick: onClose, children: _jsx(Icon, { icon: "close-o", size: 20 }) })] }), _jsxs("div", { className: "flex-1 overflow-y-auto", children: [_jsxs("div", { className: "flex items-center gap-3 px-4 py-4", children: [_jsx(Avatar, { src: avatar, size: 56, className: "shrink-0", children: ((_a = displayName === null || displayName === void 0 ? void 0 : displayName.charAt) === null || _a === void 0 ? void 0 : _a.call(displayName, 0)) || "A" }), _jsxs("div", { className: "flex-1 min-w-0 flex items-center gap-2", children: [_jsx("p", { className: "text-base font-medium truncate", children: displayName }), isBot && (_jsx("span", { className: "shrink-0 rounded px-1.5 py-0.5 text-xs font-semibold bg-orange-50 text-orange-500", children: t("bot_tag") }))] })] }), _jsx("div", { className: "bg-[#f5f5f5] mx-4 rounded-lg overflow-hidden", children: _jsxs("div", { className: "flex items-center justify-between px-3 py-3", children: [_jsxs("span", { className: "flex items-center gap-3 text-sm", children: [_jsx(Icon, { icon: "bell-o", size: 18 }), t("notification")] }), _jsx(Switch, { checked: notifyEnabled, onChange: handleToggleNotification, loading: isTogglingNotification })] }) }), _jsx("div", { className: "bg-[#f5f5f5] mx-4 mt-3 rounded-lg overflow-hidden", children: _jsxs("button", { type: "button", className: "flex items-center gap-3 px-3 py-3 text-left text-sm w-full", onClick: handleToggleBlock, disabled: isTogglingBlock, children: [_jsx(Icon, { icon: "user-del-o", size: 18 }), t(isBlocked ? "unblock_user" : "block_user")] }) }), _jsx("div", { className: "flex flex-col gap-1 bg-[#f5f5f5] mx-4 mt-3 rounded-lg overflow-hidden", children: _jsxs("button", { type: "button", className: "flex items-center gap-3 px-3 py-3 text-left text-sm text-red-500", onClick: () => setConfirmDelete(true), children: [_jsx(Icon, { icon: "trash-o", size: 18 }), t("delete_conversation")] }) })] }), _jsx(ConfirmModal, { open: confirmDelete, onOk: handleConfirmDelete, onCancel: () => setConfirmDelete(false), title: t("delete_conversation_confirm_title"), okText: t("delete_conversation"), cancelText: t("cancel"), okType: "danger", confirmLoading: isDeleting, children: _jsx("p", { children: t("delete_conversation_confirm_message") }) })] }));
|
|
69
|
+
return (_jsxs("div", { className: "h-full w-[330px] bg-white shadow-md flex flex-col relative", "data-cp-name": "SingleThreadInfo", children: [_jsxs("div", { className: "flex items-center justify-between px-4 py-4 border-b border-gray-100", children: [_jsx("span", { className: "text-lg font-medium", children: t("thread_info_title") }), _jsx("button", { type: "button", className: "flex items-center justify-center w-8 h-8 rounded-full text-gray-500 hover:bg-gray-100", onClick: onClose, children: _jsx(Icon, { icon: "close-o", size: 20 }) })] }), _jsxs("div", { className: "flex-1 overflow-y-auto", children: [_jsxs("div", { className: "flex items-center gap-3 px-4 py-4", children: [_jsx(Avatar, { src: avatar, size: 56, className: "shrink-0", children: ((_a = displayName === null || displayName === void 0 ? void 0 : displayName.charAt) === null || _a === void 0 ? void 0 : _a.call(displayName, 0)) || "A" }), _jsxs("div", { className: "flex-1 min-w-0 flex items-center gap-2", children: [_jsx("p", { className: "text-base font-medium truncate", children: displayName }), isBot && (_jsx("span", { className: "shrink-0 rounded px-1.5 py-0.5 text-xs font-semibold bg-orange-50 text-orange-500", children: t("bot_tag") }))] })] }), _jsx("div", { className: "bg-[#f5f5f5] mx-4 rounded-lg overflow-hidden", children: _jsxs("div", { className: "flex items-center justify-between px-3 py-3", children: [_jsxs("span", { className: "flex items-center gap-3 text-sm", children: [_jsx(Icon, { icon: "bell-o", size: 18 }), t("notification")] }), _jsx(Switch, { checked: notifyEnabled, onChange: handleToggleNotification, loading: isTogglingNotification })] }) }), _jsx("div", { className: "bg-[#f5f5f5] mx-4 mt-3 rounded-lg overflow-hidden", children: _jsxs("button", { type: "button", className: "flex items-center gap-3 px-3 py-3 text-left text-sm w-full", onClick: handleToggleBlock, disabled: isTogglingBlock, children: [_jsx(Icon, { icon: "user-del-o", size: 18 }), t(isBlocked ? "unblock_user" : "block_user")] }) }), _jsx("div", { className: "flex flex-col gap-1 bg-[#f5f5f5] mx-4 mt-3 rounded-lg overflow-hidden", children: _jsxs("button", { type: "button", className: "flex items-center gap-3 px-3 py-3 text-left text-sm text-red-500", onClick: () => setConfirmDelete(true), children: [_jsx(Icon, { icon: "trash-o", size: 18 }), t("delete_conversation")] }) })] }), _jsx(ConfirmModal, { open: confirmDelete, onOk: handleConfirmDelete, onCancel: () => setConfirmDelete(false), title: t("delete_conversation_confirm_title"), okText: t("delete_conversation"), cancelText: t("cancel"), okType: "danger", confirmLoading: isDeleting, children: _jsx("p", { children: t("delete_conversation_confirm_message") }) })] }));
|
|
70
70
|
};
|
|
71
71
|
export default SingleThreadInfo;
|
|
@@ -36,6 +36,6 @@ const ThreadInfo = ({ isOpen = true, onClose, groupConfig }) => {
|
|
|
36
36
|
if (!isOpen && !isBot) {
|
|
37
37
|
return null;
|
|
38
38
|
}
|
|
39
|
-
return (_jsxs("div", { className: "h-full flex flex-row", children: [isOpen && _jsx(SingleThreadInfo, { onClose: onClose }), isBot && (_jsxs("div", { className: "h-full w-[330px] bg-white shadow-md flex flex-col relative", children: [_jsxs("div", { className: `flex-grow overflow-y-auto ${activeSession ? "pb-60" : ""}`, children: [_jsx(UserSection, {}), _jsx(SessionSection, { sessions: closedSessions, isLoading: isLoading })] }), activeSession && (_jsx("div", { className: "absolute bottom-0 left-0 right-0 p-4 z-20 bg-white backdrop-blur-sm", children: _jsx(SessionDetailCard, { session: activeSession, isActive: true }) }))] }))] }));
|
|
39
|
+
return (_jsxs("div", { className: "h-full flex flex-row", "data-cp-name": "ThreadInfo", children: [isOpen && _jsx(SingleThreadInfo, { onClose: onClose }), isBot && (_jsxs("div", { className: "h-full w-[330px] bg-white shadow-md flex flex-col relative", children: [_jsxs("div", { className: `flex-grow overflow-y-auto ${activeSession ? "pb-60" : ""}`, children: [_jsx(UserSection, {}), _jsx(SessionSection, { sessions: closedSessions, isLoading: isLoading })] }), activeSession && (_jsx("div", { className: "absolute bottom-0 left-0 right-0 p-4 z-20 bg-white backdrop-blur-sm", children: _jsx(SessionDetailCard, { session: activeSession, isActive: true }) }))] }))] }));
|
|
40
40
|
};
|
|
41
41
|
export default ThreadInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserSection.d.ts","sourceRoot":"","sources":["../../../src/components/thread/UserSection.tsx"],"names":[],"mappings":"AAYA,QAAA,MAAM,WAAW,+
|
|
1
|
+
{"version":3,"file":"UserSection.d.ts","sourceRoot":"","sources":["../../../src/components/thread/UserSection.tsx"],"names":[],"mappings":"AAYA,QAAA,MAAM,WAAW,+CA2IhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -66,7 +66,7 @@ const UserSection = () => {
|
|
|
66
66
|
setNoteValue((_b = (_a = data === null || data === void 0 ? void 0 : data.note) === null || _a === void 0 ? void 0 : _a.content) !== null && _b !== void 0 ? _b : "");
|
|
67
67
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
68
68
|
}, [(_e = data === null || data === void 0 ? void 0 : data.note) === null || _e === void 0 ? void 0 : _e.content, conversationId, userId]);
|
|
69
|
-
return (_jsxs("div", { className: "flex flex-col gap-3 border-b px-4 py-3", children: [_jsxs("div", { role: "button", onClick: toggle, className: "flex items-center gap-3 bg-white flex-wrap", children: [_jsx(Avatar, { src: data === null || data === void 0 ? void 0 : data.avatar, className: "min-w-6 min-h-6", children: ((_g = (_f = data === null || data === void 0 ? void 0 : data.fullName) === null || _f === void 0 ? void 0 : _f.charAt) === null || _g === void 0 ? void 0 : _g.call(_f, 0)) || "A" }), _jsx("div", { className: "flex flex-col overflow-hidden flex-1", children: _jsxs("p", { className: "text-sm truncate", children: [(data === null || data === void 0 ? void 0 : data.fullName) || "", "(", data === null || data === void 0 ? void 0 : data.username, ")"] }) }), _jsx(Icon, { icon: isOpen ? "angle-up-o" : "angle-down-o", size: 18 })] }), isOpen && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex justify-between items-center gap-2", children: [_jsxs("p", { className: "text-sm flex items-center gap-3 flex-1 min-w-0", children: [" ", _jsx("span", { className: "font-light w-16 text-gray-400 flex-shrink-0", children: "User ID" }), _jsx("span", { className: "truncate", children: (data === null || data === void 0 ? void 0 : data.id) || "" }), " "] }), _jsx(Icon, { icon: "copy-o", size: 16, onClick: () => {
|
|
69
|
+
return (_jsxs("div", { className: "flex flex-col gap-3 border-b px-4 py-3", "data-cp-name": "UserSection", children: [_jsxs("div", { role: "button", onClick: toggle, className: "flex items-center gap-3 bg-white flex-wrap", children: [_jsx(Avatar, { src: data === null || data === void 0 ? void 0 : data.avatar, className: "min-w-6 min-h-6", children: ((_g = (_f = data === null || data === void 0 ? void 0 : data.fullName) === null || _f === void 0 ? void 0 : _f.charAt) === null || _g === void 0 ? void 0 : _g.call(_f, 0)) || "A" }), _jsx("div", { className: "flex flex-col overflow-hidden flex-1", children: _jsxs("p", { className: "text-sm truncate", children: [(data === null || data === void 0 ? void 0 : data.fullName) || "", "(", data === null || data === void 0 ? void 0 : data.username, ")"] }) }), _jsx(Icon, { icon: isOpen ? "angle-up-o" : "angle-down-o", size: 18 })] }), isOpen && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex justify-between items-center gap-2", children: [_jsxs("p", { className: "text-sm flex items-center gap-3 flex-1 min-w-0", children: [" ", _jsx("span", { className: "font-light w-16 text-gray-400 flex-shrink-0", children: "User ID" }), _jsx("span", { className: "truncate", children: (data === null || data === void 0 ? void 0 : data.id) || "" }), " "] }), _jsx(Icon, { icon: "copy-o", size: 16, onClick: () => {
|
|
70
70
|
navigator.clipboard.writeText((data === null || data === void 0 ? void 0 : data.id) || "");
|
|
71
71
|
message.success(t("copied_to_clipboard"));
|
|
72
72
|
} })] }), _jsxs("div", { className: "flex justify-between items-center gap-2", children: [_jsxs("p", { className: "text-sm truncate flex gap-3", children: [_jsx("span", { className: "font-light text-gray-400 w-16", children: "Username" }), (data === null || data === void 0 ? void 0 : data.username) || ""] }), _jsx(Icon, { icon: "copy-o", size: 16, onClick: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoPlayerModal.d.ts","sourceRoot":"","sources":["../../../src/components/video-player/VideoPlayerModal.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,qBAAqB;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAQD,eAAO,MAAM,oBAAoB,GAC/B,OAAO,iBAAiB,EAAE,KACzB,iBAAiB,EAWhB,CAAC;AAEL,QAAA,MAAM,gBAAgB,GAAI,0CAKvB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"VideoPlayerModal.d.ts","sourceRoot":"","sources":["../../../src/components/video-player/VideoPlayerModal.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,qBAAqB;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAQD,eAAO,MAAM,oBAAoB,GAC/B,OAAO,iBAAiB,EAAE,KACzB,iBAAiB,EAWhB,CAAC;AAEL,QAAA,MAAM,gBAAgB,GAAI,0CAKvB,qBAAqB,4CAuFvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -34,7 +34,7 @@ const VideoPlayerModal = ({ open, videos, initialIndex, onClose, }) => {
|
|
|
34
34
|
const currentVideo = videos[currentIndex];
|
|
35
35
|
const { snapshotWidth = 0, snapshotHeight = 0 } = currentVideo || {};
|
|
36
36
|
const hasSnapshotSize = snapshotWidth > 0 && snapshotHeight > 0;
|
|
37
|
-
return (_jsx(Modal, { open: open, onCancel: onClose, footer: null, centered: true, destroyOnHidden: true, getContainer: false, forceRender: true, closeIcon: _jsx("span", { className: CLOSE_BUTTON_CLASS, children: _jsx(Icon, { icon: "close-b", size: 18 }) }), styles: {
|
|
37
|
+
return (_jsx(Modal, { "data-cp-name": "VideoPlayerModal", open: open, onCancel: onClose, footer: null, centered: true, destroyOnHidden: true, getContainer: false, forceRender: true, closeIcon: _jsx("span", { className: CLOSE_BUTTON_CLASS, children: _jsx(Icon, { icon: "close-b", size: 18 }) }), styles: {
|
|
38
38
|
content: {
|
|
39
39
|
padding: 0,
|
|
40
40
|
},
|
|
@@ -2,5 +2,5 @@ import "../styles/global.css";
|
|
|
2
2
|
import { ChatContextType, ChatProviderProps } from "../types/chat";
|
|
3
3
|
export declare const ChatContext: import("react").Context<ChatContextType>;
|
|
4
4
|
export declare const useChatContext: () => ChatContextType;
|
|
5
|
-
export declare const ChatProvider: ({ children, config, renderCustomMessage, onNavigate, }: ChatProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const ChatProvider: ({ children, config, renderCustomMessage, onNavigate, renderGroupAccessModal, }: ChatProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=ChatContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatContext.d.ts","sourceRoot":"","sources":["../../src/context/ChatContext.tsx"],"names":[],"mappings":"AAEA,OAAO,sBAAsB,CAAC;AAG9B,OAAO,EACL,eAAe,EACf,iBAAiB,EAGlB,MAAM,cAAc,CAAC;AAStB,eAAO,MAAM,WAAW,0CAOtB,CAAC;AAEH,eAAO,MAAM,cAAc,uBAAgC,CAAC;AAE5D,eAAO,MAAM,YAAY,GAAI,
|
|
1
|
+
{"version":3,"file":"ChatContext.d.ts","sourceRoot":"","sources":["../../src/context/ChatContext.tsx"],"names":[],"mappings":"AAEA,OAAO,sBAAsB,CAAC;AAG9B,OAAO,EACL,eAAe,EACf,iBAAiB,EAGlB,MAAM,cAAc,CAAC;AAStB,eAAO,MAAM,WAAW,0CAOtB,CAAC;AAEH,eAAO,MAAM,cAAc,uBAAgC,CAAC;AAE5D,eAAO,MAAM,YAAY,GAAI,gFAM1B,iBAAiB,4CAwGnB,CAAC"}
|
|
@@ -18,7 +18,7 @@ export const ChatContext = createContext({
|
|
|
18
18
|
updateSyncStatus: () => { },
|
|
19
19
|
});
|
|
20
20
|
export const useChatContext = () => useContext(ChatContext);
|
|
21
|
-
export const ChatProvider = ({ children, config, renderCustomMessage, onNavigate, }) => {
|
|
21
|
+
export const ChatProvider = ({ children, config, renderCustomMessage, onNavigate, renderGroupAccessModal, }) => {
|
|
22
22
|
const [connectStatus, setConnectStatus] = useState(ConnectStatus.Disconnected);
|
|
23
23
|
const [syncStatus, setSyncStatus] = useState(SyncStatus.Success);
|
|
24
24
|
const [user, setUser] = useState(null);
|
|
@@ -93,5 +93,6 @@ export const ChatProvider = ({ children, config, renderCustomMessage, onNavigate
|
|
|
93
93
|
updateSyncStatus,
|
|
94
94
|
renderCustomMessage,
|
|
95
95
|
onNavigate,
|
|
96
|
+
renderGroupAccessModal,
|
|
96
97
|
}, children: _jsx(ConfigProvider, { getPopupContainer: (triggerNode) => document.body, children: _jsx(QueryClientProvider, { client: queryClient, children: _jsx(MainLayout, { children: children }) }) }) }));
|
|
97
98
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGlobalEvent.d.ts","sourceRoot":"","sources":["../../../src/hooks/global/useGlobalEvent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useGlobalEvent.d.ts","sourceRoot":"","sources":["../../../src/hooks/global/useGlobalEvent.ts"],"names":[],"mappings":"AAyCA,eAAO,MAAM,cAAc,YA6hB1B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
2
|
import { useLatest } from "ahooks";
|
|
3
3
|
import { DChatSDK } from "../../constants/sdk";
|
|
4
|
-
import { CbEvents, MessageType, SessionType, } from "@droppii-org/wasm-client-sdk";
|
|
4
|
+
import { CbEvents, GroupVisibility, MessageType, SessionType, } from "@droppii-org/wasm-client-sdk";
|
|
5
5
|
import { BusinessNotificationType, ConnectStatus, CustomType, SyncStatus, } from "../../types/chat";
|
|
6
6
|
import { pushNewMessage, updateOneMessage } from "../../hooks/message/useMessage";
|
|
7
7
|
import { fetchPinnedMessages } from "../../hooks/message/usePinnedMessages";
|
|
@@ -13,7 +13,7 @@ import { useRefetchChatToken } from "../../hooks/init/useChatToken";
|
|
|
13
13
|
import { updateSession } from "../../hooks/session/useUpdateSession";
|
|
14
14
|
import { QUERY_KEYS } from "../../services/query";
|
|
15
15
|
import { useQueryClient } from "@tanstack/react-query";
|
|
16
|
-
import {
|
|
16
|
+
import { isGroupConversation } from "../../utils/imCommon";
|
|
17
17
|
import { ignoreInternalLatestMessage } from "../../utils/common";
|
|
18
18
|
import { invalidateSessionQueries } from "../../utils/queryHelpers";
|
|
19
19
|
import emitter from "../../utils/events";
|
|
@@ -37,8 +37,7 @@ export const useGlobalEvent = () => {
|
|
|
37
37
|
});
|
|
38
38
|
const refreshCurrentGroupState = async () => {
|
|
39
39
|
const currentConversation = useConversationStore.getState().currentConversation;
|
|
40
|
-
if (!(currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.groupID) ||
|
|
41
|
-
!isGroupSession(currentConversation.conversationType)) {
|
|
40
|
+
if (!(currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.groupID) || !isGroupConversation(currentConversation)) {
|
|
42
41
|
return;
|
|
43
42
|
}
|
|
44
43
|
await Promise.all([
|
|
@@ -49,6 +48,33 @@ export const useGlobalEvent = () => {
|
|
|
49
48
|
getCurrentMemberInGroupByReq(currentConversation.groupID),
|
|
50
49
|
]);
|
|
51
50
|
};
|
|
51
|
+
// For a groupID cache entry that isn't the currently-open conversation:
|
|
52
|
+
// evict rather than refetch (per the "no background refetch" decision) —
|
|
53
|
+
// the next time that group is reopened, updateCurrentConversation's
|
|
54
|
+
// cache-miss path fetches it fresh.
|
|
55
|
+
const evictGroupCache = (groupID) => {
|
|
56
|
+
useConversationStore.setState((state) => {
|
|
57
|
+
const groupInfo = new Map(state.currentGroupInfo);
|
|
58
|
+
groupInfo.delete(groupID);
|
|
59
|
+
const memberInGroup = new Map(state.currentMemberInGroup);
|
|
60
|
+
memberInGroup.delete(groupID);
|
|
61
|
+
return { currentGroupInfo: groupInfo, currentMemberInGroup: memberInGroup };
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
// Refetch when the change is for the group currently open (fresh data
|
|
65
|
+
// needed right now); evict when it's for a different cached group (no
|
|
66
|
+
// background refetch — just don't serve stale data on next reopen).
|
|
67
|
+
const refreshOrEvictGroupState = async (groupID) => {
|
|
68
|
+
const currentConversation = useConversationStore.getState().currentConversation;
|
|
69
|
+
const isCurrentGroupOpen = !!groupID && (currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.groupID) === groupID;
|
|
70
|
+
if (isCurrentGroupOpen) {
|
|
71
|
+
await refreshCurrentGroupState();
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (groupID) {
|
|
75
|
+
evictGroupCache(groupID);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
52
78
|
const revokedMessageHandler = ({ data }) => {
|
|
53
79
|
applyRevokedMessage(data.clientMsgID);
|
|
54
80
|
};
|
|
@@ -201,24 +227,53 @@ export const useGlobalEvent = () => {
|
|
|
201
227
|
break;
|
|
202
228
|
}
|
|
203
229
|
};
|
|
204
|
-
|
|
205
|
-
|
|
230
|
+
// OnGroupMemberAdded's payload isn't in the SDK's typed EventDataMap —
|
|
231
|
+
// assumed to carry a GroupItem-shaped groupID, consistent with every
|
|
232
|
+
// other group event in this file that IS typed that way.
|
|
233
|
+
const groupMemberChangedHandler = ({ data }) => {
|
|
234
|
+
void refreshOrEvictGroupState(data === null || data === void 0 ? void 0 : data.groupID);
|
|
206
235
|
emitter.emit("GROUP_MEMBERS_CHANGED");
|
|
207
236
|
};
|
|
208
|
-
|
|
209
|
-
|
|
237
|
+
// OnGroupInfoChanged's payload isn't in the SDK's typed EventDataMap —
|
|
238
|
+
// same assumption as groupMemberChangedHandler above.
|
|
239
|
+
const groupInfoChangedHandler = ({ data }) => {
|
|
240
|
+
void refreshOrEvictGroupState(data === null || data === void 0 ? void 0 : data.groupID);
|
|
210
241
|
};
|
|
211
242
|
// BE pushes this when a member's role/permissions change (DROPPII-30248
|
|
212
243
|
// spec: actions must always check the LATEST permissions, not stale UI) —
|
|
213
|
-
// refetch so useGroupPermission picks up the new permissions[] right away
|
|
214
|
-
|
|
215
|
-
|
|
244
|
+
// refetch so useGroupPermission picks up the new permissions[] right away
|
|
245
|
+
// if it's the open group; evict the cache entry otherwise.
|
|
246
|
+
const groupMemberInfoChangedHandler = ({ data }) => {
|
|
247
|
+
void refreshOrEvictGroupState(data.groupID);
|
|
216
248
|
};
|
|
217
|
-
//
|
|
218
|
-
//
|
|
219
|
-
|
|
249
|
+
// OnGroupDismissed always blocks + navigates away (group is gone either
|
|
250
|
+
// way). OnJoinedGroupDeleted (kicked) branches by visibility: PRIVATE ->
|
|
251
|
+
// fully blocked, same as disbanded; PUBLIC -> stays open in view-only.
|
|
252
|
+
const leftGroupHandler = (data, reason) => {
|
|
220
253
|
const currentConversation = useConversationStore.getState().currentConversation;
|
|
221
|
-
|
|
254
|
+
const isCurrentGroupOpen = (currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.groupID) === data.groupID;
|
|
255
|
+
// A voluntary leave arrives as OnJoinedGroupDeleted on the leaver's own
|
|
256
|
+
// client too. It must not fall into the public-group view-only branch —
|
|
257
|
+
// AC-6 requires navigating to My Inbox regardless of visibility.
|
|
258
|
+
const isSelfLeave = useConversationStore.getState().selfLeftGroupID === data.groupID;
|
|
259
|
+
const staysViewOnly = !isSelfLeave &&
|
|
260
|
+
reason === "kicked" &&
|
|
261
|
+
data.visibility === GroupVisibility.Public;
|
|
262
|
+
// The kicked/disbanded group's own cached membership is stale the
|
|
263
|
+
// instant this event fires, whether or not it's currently open —
|
|
264
|
+
// nonMemberGroupID guards against a still-in-flight fetch resurrecting
|
|
265
|
+
// it (see the kick-guard in getCurrentMemberInGroupByReq/
|
|
266
|
+
// getSelfGroupPermissionByReq).
|
|
267
|
+
useConversationStore.setState((state) => {
|
|
268
|
+
const memberInGroup = new Map(state.currentMemberInGroup);
|
|
269
|
+
memberInGroup.delete(data.groupID);
|
|
270
|
+
return { currentMemberInGroup: memberInGroup, nonMemberGroupID: data.groupID };
|
|
271
|
+
});
|
|
272
|
+
if (isCurrentGroupOpen && staysViewOnly) {
|
|
273
|
+
useConversationStore.setState({ isViewOnlyMember: true });
|
|
274
|
+
void getCurrentGroupInfoByReq(data.groupID);
|
|
275
|
+
}
|
|
276
|
+
else if (isCurrentGroupOpen) {
|
|
222
277
|
useConversationStore.getState().clearSelectedConversation();
|
|
223
278
|
// OnGroupDismissed also fires on the disbanding owner's own client —
|
|
224
279
|
// skip the modal for them, useDismissGroup already shows a toast.
|
|
@@ -226,6 +281,10 @@ export const useGlobalEvent = () => {
|
|
|
226
281
|
if (selfDisbandedGroupID === data.groupID) {
|
|
227
282
|
useConversationStore.getState().setSelfDisbandedGroupID(null);
|
|
228
283
|
}
|
|
284
|
+
else if (isSelfLeave) {
|
|
285
|
+
// The leaver chose this — useQuitGroup already navigates and toasts.
|
|
286
|
+
useConversationStore.getState().setSelfLeftGroupID(null);
|
|
287
|
+
}
|
|
229
288
|
else {
|
|
230
289
|
useConversationStore.getState().showRemovedFromGroupModal();
|
|
231
290
|
}
|
|
@@ -238,9 +297,39 @@ export const useGlobalEvent = () => {
|
|
|
238
297
|
const pathname = window.location.pathname;
|
|
239
298
|
onNavigate === null || onNavigate === void 0 ? void 0 : onNavigate(query ? `${pathname}?${query}` : pathname);
|
|
240
299
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
300
|
+
// Public groups the user can still view-only stay in conversationList;
|
|
301
|
+
// private-blocked/disbanded groups get dropped.
|
|
302
|
+
if (!staysViewOnly) {
|
|
303
|
+
useConversationStore.setState((state) => ({
|
|
304
|
+
conversationList: state.conversationList.filter((conversation) => conversation.groupID !== data.groupID),
|
|
305
|
+
}));
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
// Thin wrappers matching the SDK's fixed callback signature, forwarding
|
|
309
|
+
// to leftGroupHandler with the right reason.
|
|
310
|
+
const groupDismissedHandler = ({ data }) => {
|
|
311
|
+
leftGroupHandler(data, "disbanded");
|
|
312
|
+
};
|
|
313
|
+
const joinedGroupDeletedHandler = ({ data }) => {
|
|
314
|
+
leftGroupHandler(data, "kicked");
|
|
315
|
+
};
|
|
316
|
+
// Fires for every member add/remove in a group, including other people's
|
|
317
|
+
// — only treat it as "I lost access" when the removed member is myself.
|
|
318
|
+
// The event payload (GroupMemberItem) has no visibility field, so read it
|
|
319
|
+
// from currentGroupInfo — but only trust that if it's actually info for
|
|
320
|
+
// THIS group (currentGroupInfo tracks whatever conversation is open, not
|
|
321
|
+
// necessarily the group being removed from) — otherwise fail closed.
|
|
322
|
+
const groupMemberDeletedHandler = ({ data }) => {
|
|
323
|
+
var _a, _b;
|
|
324
|
+
if (data.userID !== ((_a = userRef.current) === null || _a === void 0 ? void 0 : _a.userID)) {
|
|
325
|
+
void refreshOrEvictGroupState(data.groupID);
|
|
326
|
+
emitter.emit("GROUP_MEMBERS_CHANGED");
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
const visibility = (_b = useConversationStore
|
|
330
|
+
.getState()
|
|
331
|
+
.currentGroupInfo.get(data.groupID)) === null || _b === void 0 ? void 0 : _b.visibility;
|
|
332
|
+
leftGroupHandler({ groupID: data.groupID, visibility }, "kicked");
|
|
244
333
|
};
|
|
245
334
|
const blackListChangedHandler = () => {
|
|
246
335
|
emitter.emit("BLACK_LIST_CHANGED");
|
|
@@ -252,8 +341,19 @@ export const useGlobalEvent = () => {
|
|
|
252
341
|
// query are separate stages"). OnJoinedGroupAdded fires as soon as the
|
|
253
342
|
// client is confirmed a member, so refetch here instead of waiting on the
|
|
254
343
|
// conversation-side events to eventually catch up.
|
|
255
|
-
const joinedGroupAddedHandler = (
|
|
344
|
+
const joinedGroupAddedHandler = ({ data }) => {
|
|
256
345
|
loadConversationList();
|
|
346
|
+
// Re-added as a member of the group currently open in view-only mode —
|
|
347
|
+
// clear the flag and refetch so membership-gated UI (send box, Leave
|
|
348
|
+
// group button) comes back instead of staying stuck read-only.
|
|
349
|
+
const currentConversation = useConversationStore.getState().currentConversation;
|
|
350
|
+
if ((currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.groupID) === data.groupID) {
|
|
351
|
+
useConversationStore.setState({
|
|
352
|
+
isViewOnlyMember: false,
|
|
353
|
+
nonMemberGroupID: null,
|
|
354
|
+
});
|
|
355
|
+
void refreshCurrentGroupState();
|
|
356
|
+
}
|
|
257
357
|
};
|
|
258
358
|
const setIMListener = () => {
|
|
259
359
|
//account
|
|
@@ -276,13 +376,13 @@ export const useGlobalEvent = () => {
|
|
|
276
376
|
DChatSDK.on(CbEvents.OnNewConversation, newConversationHandler);
|
|
277
377
|
// group members
|
|
278
378
|
DChatSDK.on(CbEvents.OnGroupMemberAdded, groupMemberChangedHandler);
|
|
279
|
-
DChatSDK.on(CbEvents.OnGroupMemberDeleted,
|
|
379
|
+
DChatSDK.on(CbEvents.OnGroupMemberDeleted, groupMemberDeletedHandler);
|
|
280
380
|
DChatSDK.on(CbEvents.OnJoinedGroupAdded, joinedGroupAddedHandler);
|
|
281
381
|
// group info
|
|
282
382
|
DChatSDK.on(CbEvents.OnGroupInfoChanged, groupInfoChangedHandler);
|
|
283
383
|
DChatSDK.on(CbEvents.OnGroupMemberInfoChanged, groupMemberInfoChangedHandler);
|
|
284
|
-
DChatSDK.on(CbEvents.OnGroupDismissed,
|
|
285
|
-
DChatSDK.on(CbEvents.OnJoinedGroupDeleted,
|
|
384
|
+
DChatSDK.on(CbEvents.OnGroupDismissed, groupDismissedHandler);
|
|
385
|
+
DChatSDK.on(CbEvents.OnJoinedGroupDeleted, joinedGroupDeletedHandler);
|
|
286
386
|
// black list
|
|
287
387
|
DChatSDK.on(CbEvents.OnBlackAdded, blackListChangedHandler);
|
|
288
388
|
DChatSDK.on(CbEvents.OnBlackDeleted, blackListChangedHandler);
|
|
@@ -310,13 +410,13 @@ export const useGlobalEvent = () => {
|
|
|
310
410
|
DChatSDK.off(CbEvents.OnNewConversation, newConversationHandler);
|
|
311
411
|
// group members
|
|
312
412
|
DChatSDK.off(CbEvents.OnGroupMemberAdded, groupMemberChangedHandler);
|
|
313
|
-
DChatSDK.off(CbEvents.OnGroupMemberDeleted,
|
|
413
|
+
DChatSDK.off(CbEvents.OnGroupMemberDeleted, groupMemberDeletedHandler);
|
|
314
414
|
DChatSDK.off(CbEvents.OnJoinedGroupAdded, joinedGroupAddedHandler);
|
|
315
415
|
// group info
|
|
316
416
|
DChatSDK.off(CbEvents.OnGroupInfoChanged, groupInfoChangedHandler);
|
|
317
417
|
DChatSDK.off(CbEvents.OnGroupMemberInfoChanged, groupMemberInfoChangedHandler);
|
|
318
|
-
DChatSDK.off(CbEvents.OnGroupDismissed,
|
|
319
|
-
DChatSDK.off(CbEvents.OnJoinedGroupDeleted,
|
|
418
|
+
DChatSDK.off(CbEvents.OnGroupDismissed, groupDismissedHandler);
|
|
419
|
+
DChatSDK.off(CbEvents.OnJoinedGroupDeleted, joinedGroupDeletedHandler);
|
|
320
420
|
// black list
|
|
321
421
|
DChatSDK.off(CbEvents.OnBlackAdded, blackListChangedHandler);
|
|
322
422
|
DChatSDK.off(CbEvents.OnBlackDeleted, blackListChangedHandler);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConversationItem } from "@droppii-org/wasm-client-sdk";
|
|
1
|
+
import { ConversationItem, GroupVisibility } from "@droppii-org/wasm-client-sdk";
|
|
2
2
|
import { BaseResponse, IConversationGroupItem } from "../../types/dto";
|
|
3
3
|
interface UseConversationGroupsParams {
|
|
4
4
|
enabled?: boolean;
|
|
@@ -8,7 +8,11 @@ export interface ConversationGroupDisplayItem {
|
|
|
8
8
|
groupId: string;
|
|
9
9
|
conversationId: string;
|
|
10
10
|
conversation: ConversationItem;
|
|
11
|
+
visibility?: GroupVisibility;
|
|
12
|
+
memberCount?: number;
|
|
11
13
|
}
|
|
14
|
+
export declare const buildFallbackConversation: (group: IConversationGroupItem) => ConversationItem;
|
|
15
|
+
export declare const syncGroupConversationsToStore: (groups: IConversationGroupItem[]) => Promise<void>;
|
|
12
16
|
export declare const useConversationGroups: ({ enabled, pageSize, }?: UseConversationGroupsParams) => {
|
|
13
17
|
groups: ConversationGroupDisplayItem[];
|
|
14
18
|
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<IConversationGroupItem[]>, unknown>, Error>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConversationGroups.d.ts","sourceRoot":"","sources":["../../../src/hooks/group/useConversationGroups.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"useConversationGroups.d.ts","sourceRoot":"","sources":["../../../src/hooks/group/useConversationGroups.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,gBAAgB,EAChB,eAAe,EAEhB,MAAM,8BAA8B,CAAC;AAKtC,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAKnE,UAAU,2BAA2B;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,gBAAgB,CAAC;IAG/B,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAMD,eAAO,MAAM,yBAAyB,GACpC,OAAO,sBAAsB,KAC5B,gBAyBD,CAAC;AAMH,eAAO,MAAM,6BAA6B,GACxC,QAAQ,sBAAsB,EAAE,kBAuBjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,yBAGnC,2BAAgC;;;;;;CAoElC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import { useInfiniteQuery } from "@tanstack/react-query";
|
|
4
|
-
import { SessionType } from "@droppii-org/wasm-client-sdk";
|
|
4
|
+
import { SessionType, } from "@droppii-org/wasm-client-sdk";
|
|
5
5
|
import { apiInstance } from "../../services/api";
|
|
6
6
|
import { ENDPOINTS } from "../../services/routes";
|
|
7
7
|
import { QUERY_KEYS } from "../../services/query";
|
|
@@ -13,7 +13,7 @@ import { DChatSDK } from "../../constants/sdk";
|
|
|
13
13
|
// a brand new group (e.g. right after create-group, or first time this list
|
|
14
14
|
// loads) — carries just enough for ConversationByGroupItem to render
|
|
15
15
|
// something instead of the row disappearing while the sync is in flight.
|
|
16
|
-
const buildFallbackConversation = (group) => ({
|
|
16
|
+
export const buildFallbackConversation = (group) => ({
|
|
17
17
|
conversationID: group.conversationId,
|
|
18
18
|
conversationType: SessionType.Group,
|
|
19
19
|
userID: "",
|
|
@@ -43,7 +43,7 @@ const buildFallbackConversation = (group) => ({
|
|
|
43
43
|
// metadata (no latestMsg) — sync each group's full ConversationItem (which
|
|
44
44
|
// carries latestMsg/latestMsgSendTime/unreadCount) into the shared
|
|
45
45
|
// conversationList store via the SDK, then join on conversationId.
|
|
46
|
-
const syncGroupConversationsToStore = async (groups) => {
|
|
46
|
+
export const syncGroupConversationsToStore = async (groups) => {
|
|
47
47
|
const currentList = useConversationStore.getState().conversationList;
|
|
48
48
|
const newGroups = groups.filter((group) => !currentList.some((conversation) => conversation.conversationID === group.conversationId));
|
|
49
49
|
if (!newGroups.length)
|
|
@@ -13,5 +13,5 @@ export interface GroupPermissions {
|
|
|
13
13
|
viewMemberInformation: boolean;
|
|
14
14
|
}
|
|
15
15
|
export declare const permissionListToGroupPermissions: (permissionList: string[] | undefined, roleLevel: GroupMemberRole) => GroupPermissions;
|
|
16
|
-
export declare const useGroupPermission: (
|
|
16
|
+
export declare const useGroupPermission: (groupID?: string) => GroupPermissions;
|
|
17
17
|
//# sourceMappingURL=useGroupPermission.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGroupPermission.d.ts","sourceRoot":"","sources":["../../../src/hooks/group/useGroupPermission.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAI/D,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,sBAAsB,EAAE,OAAO,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,qBAAqB,EAAE,OAAO,CAAC;CAChC;AA+CD,eAAO,MAAM,gCAAgC,GAC3C,gBAAgB,MAAM,EAAE,GAAG,SAAS,EACpC,WAAW,eAAe,KACzB,gBAcF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,
|
|
1
|
+
{"version":3,"file":"useGroupPermission.d.ts","sourceRoot":"","sources":["../../../src/hooks/group/useGroupPermission.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAI/D,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,sBAAsB,EAAE,OAAO,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,qBAAqB,EAAE,OAAO,CAAC;CAChC;AA+CD,eAAO,MAAM,gCAAgC,GAC3C,gBAAgB,MAAM,EAAE,GAAG,SAAS,EACpC,WAAW,eAAe,KACzB,gBAcF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,UAAU,MAAM,KAAG,gBAYrD,CAAC"}
|