@droppii-org/chat-sdk 0.7.2 → 0.7.4
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/boot/BootProgressBar.d.ts +13 -0
- package/dist/components/boot/BootProgressBar.d.ts.map +1 -0
- package/dist/components/boot/BootProgressBar.js +18 -0
- package/dist/components/canned-response/CannedResponsePanel.d.ts.map +1 -1
- package/dist/components/canned-response/CannedResponsePanel.js +2 -2
- package/dist/components/common/BottomSheet.d.ts +18 -0
- package/dist/components/common/BottomSheet.d.ts.map +1 -0
- package/dist/components/common/BottomSheet.js +49 -0
- package/dist/components/common/DeskPanelDrawer.d.ts.map +1 -1
- package/dist/components/common/DeskPanelDrawer.js +29 -15
- package/dist/components/common/DeskSidePanel.d.ts.map +1 -1
- package/dist/components/common/DeskSidePanel.js +1 -1
- package/dist/components/compose/ComposeNewMessageModal.d.ts.map +1 -1
- package/dist/components/compose/ComposeNewMessageModal.js +3 -3
- package/dist/components/conversation/ConversationByGroupItem.d.ts.map +1 -1
- package/dist/components/conversation/ConversationByGroupItem.js +3 -8
- package/dist/components/conversation/ConversationBySessionItem.d.ts.map +1 -1
- package/dist/components/conversation/ConversationBySessionItem.js +3 -8
- package/dist/components/conversation/DeskConversationList.d.ts +4 -1
- package/dist/components/conversation/DeskConversationList.d.ts.map +1 -1
- package/dist/components/conversation/DeskConversationList.js +2 -2
- package/dist/components/conversation/DeskListHeader.d.ts +2 -0
- package/dist/components/conversation/DeskListHeader.d.ts.map +1 -1
- package/dist/components/conversation/DeskListHeader.js +3 -3
- package/dist/components/conversation-detail/ConversationMessageList.d.ts.map +1 -1
- package/dist/components/conversation-detail/ConversationMessageList.js +23 -5
- package/dist/components/conversation-inbox/ConversationInboxItem.d.ts.map +1 -1
- package/dist/components/conversation-inbox/ConversationInboxItem.js +1 -1
- package/dist/components/conversation-inbox/ConversationInboxList.d.ts.map +1 -1
- package/dist/components/conversation-inbox/ConversationInboxList.js +12 -3
- package/dist/components/conversation-inbox/InboxBootStatus.d.ts +10 -0
- package/dist/components/conversation-inbox/InboxBootStatus.d.ts.map +1 -0
- package/dist/components/conversation-inbox/InboxBootStatus.js +34 -0
- package/dist/components/conversation-inbox/InboxListSkeleton.d.ts +6 -0
- package/dist/components/conversation-inbox/InboxListSkeleton.d.ts.map +1 -0
- package/dist/components/conversation-inbox/InboxListSkeleton.js +8 -0
- package/dist/components/group/GroupPanelHeader.js +1 -1
- package/dist/components/icon/strokeIconNodes.d.ts +6 -0
- package/dist/components/icon/strokeIconNodes.d.ts.map +1 -1
- package/dist/components/icon/strokeIconNodes.js +5 -0
- package/dist/components/message/MessageHeader.d.ts +3 -1
- package/dist/components/message/MessageHeader.d.ts.map +1 -1
- package/dist/components/message/MessageHeader.js +10 -6
- package/dist/components/message/MessageList.d.ts +2 -0
- package/dist/components/message/MessageList.d.ts.map +1 -1
- package/dist/components/message/MessageList.js +15 -4
- package/dist/components/message/SelectSession.js +1 -1
- package/dist/components/message/footer/ActionBar.d.ts.map +1 -1
- package/dist/components/message/footer/ActionBar.js +2 -2
- package/dist/components/message/footer/ComposerTabs.js +1 -1
- package/dist/components/message/footer/CrmComposerCard.js +1 -1
- package/dist/components/message/footer/EmojiPicker.d.ts +3 -1
- package/dist/components/message/footer/EmojiPicker.d.ts.map +1 -1
- package/dist/components/message/footer/EmojiPicker.js +3 -2
- package/dist/components/message/footer/EnterHandler.d.ts.map +1 -1
- package/dist/components/message/footer/EnterHandler.js +16 -2
- package/dist/components/message/footer/MediaActions.d.ts +2 -1
- package/dist/components/message/footer/MediaActions.d.ts.map +1 -1
- package/dist/components/message/footer/MediaActions.js +4 -4
- package/dist/components/message/footer/ToolbarPlugin.js +1 -1
- package/dist/components/message/footer/mention/MentionMenu.js +1 -1
- package/dist/components/message/headerIconButton.js +1 -1
- package/dist/components/message/item/ConsultantChatButton.d.ts +6 -0
- package/dist/components/message/item/ConsultantChatButton.d.ts.map +1 -0
- package/dist/components/message/item/ConsultantChatButton.js +19 -0
- package/dist/components/message/item/CustomMessage.d.ts.map +1 -1
- package/dist/components/message/item/CustomMessage.js +6 -1
- package/dist/components/message/item/EventMessage.d.ts +11 -0
- package/dist/components/message/item/EventMessage.d.ts.map +1 -0
- package/dist/components/message/item/EventMessage.js +28 -0
- package/dist/components/message/item/MessageMoreButton.d.ts.map +1 -1
- package/dist/components/message/item/MessageMoreButton.js +18 -5
- package/dist/components/message/item/QuoteMessage.d.ts.map +1 -1
- package/dist/components/message/item/QuoteMessage.js +3 -50
- package/dist/components/message/item/consultantCta.d.ts +8 -0
- package/dist/components/message/item/consultantCta.d.ts.map +1 -0
- package/dist/components/message/item/consultantCta.js +5 -0
- package/dist/components/message/item/index.d.ts.map +1 -1
- package/dist/components/message/item/index.js +10 -4
- package/dist/components/message/item/otherSenders.d.ts.map +1 -1
- package/dist/components/message/item/otherSenders.js +4 -1
- package/dist/components/message/reply/ReplyPreviewBar.d.ts.map +1 -1
- package/dist/components/message/reply/ReplyPreviewBar.js +4 -13
- package/dist/components/rich-text-editor/RichTextEditor.d.ts +3 -1
- package/dist/components/rich-text-editor/RichTextEditor.d.ts.map +1 -1
- package/dist/components/rich-text-editor/RichTextEditor.js +4 -2
- package/dist/components/search-conversation/item/SearchItemAsGroup.d.ts.map +1 -1
- package/dist/components/search-conversation/item/SearchItemAsGroup.js +3 -3
- package/dist/components/search-conversation/item/SearchItemAsMessage.d.ts.map +1 -1
- package/dist/components/search-conversation/item/SearchItemAsMessage.js +10 -0
- package/dist/components/search-conversation/item/SearchItemAsUser.d.ts.map +1 -1
- package/dist/components/search-conversation/item/SearchItemAsUser.js +6 -0
- package/dist/components/session/DeskAssignedSession.js +2 -2
- package/dist/components/session/FolderRow.js +1 -1
- package/dist/components/thread/ManualAssignPopover.d.ts.map +1 -1
- package/dist/components/thread/ManualAssignPopover.js +13 -6
- package/dist/components/thread/SessionDetailCard.js +1 -1
- package/dist/components/thread/SessionTagPicker.js +1 -1
- package/dist/components/thread/SupportSessionPanel.d.ts +1 -1
- package/dist/components/thread/SupportSessionPanel.d.ts.map +1 -1
- package/dist/components/thread/SupportSessionPanel.js +1 -1
- package/dist/components/thread/ThreadInfo.d.ts.map +1 -1
- package/dist/components/thread/ThreadInfo.js +3 -1
- package/dist/components/thread/ThreadInfoHeader.d.ts +1 -1
- package/dist/components/thread/ThreadInfoHeader.d.ts.map +1 -1
- package/dist/components/thread/ThreadInfoHeader.js +1 -1
- package/dist/components/thread/UserSection.js +2 -2
- package/dist/constants/layout.d.ts +10 -1
- package/dist/constants/layout.d.ts.map +1 -1
- package/dist/constants/layout.js +10 -1
- package/dist/hooks/common/useDeskShortcuts.d.ts.map +1 -1
- package/dist/hooks/common/useDeskShortcuts.js +3 -1
- package/dist/hooks/common/useIsDeskWorkspaceMounted.d.ts +3 -0
- package/dist/hooks/common/useIsDeskWorkspaceMounted.d.ts.map +1 -0
- package/dist/hooks/common/useIsDeskWorkspaceMounted.js +4 -0
- package/dist/hooks/common/useViewportTier.d.ts +4 -0
- package/dist/hooks/common/useViewportTier.d.ts.map +1 -0
- package/dist/hooks/common/useViewportTier.js +9 -0
- package/dist/hooks/common/useVisualViewportHeight.d.ts +10 -0
- package/dist/hooks/common/useVisualViewportHeight.d.ts.map +1 -0
- package/dist/hooks/common/useVisualViewportHeight.js +30 -0
- package/dist/hooks/conversation/useConsultantChatNavigation.d.ts +12 -0
- package/dist/hooks/conversation/useConsultantChatNavigation.d.ts.map +1 -0
- package/dist/hooks/conversation/useConsultantChatNavigation.js +94 -0
- package/dist/hooks/conversation/useConversationList.d.ts.map +1 -1
- package/dist/hooks/conversation/useConversationList.js +31 -0
- package/dist/hooks/conversation/useDeskOfflineLock.d.ts +9 -0
- package/dist/hooks/conversation/useDeskOfflineLock.d.ts.map +1 -0
- package/dist/hooks/conversation/useDeskOfflineLock.js +46 -0
- package/dist/hooks/conversation/useDeskThreadNavigation.d.ts +19 -0
- package/dist/hooks/conversation/useDeskThreadNavigation.d.ts.map +1 -0
- package/dist/hooks/conversation/useDeskThreadNavigation.js +68 -0
- package/dist/hooks/global/useGlobalEvent.d.ts.map +1 -1
- package/dist/hooks/global/useGlobalEvent.js +22 -2
- package/dist/hooks/group/useCreateGroup.d.ts.map +1 -1
- package/dist/hooks/group/useCreateGroup.js +4 -4
- package/dist/hooks/init/useChatBootPhase.d.ts +30 -0
- package/dist/hooks/init/useChatBootPhase.d.ts.map +1 -0
- package/dist/hooks/init/useChatBootPhase.js +72 -0
- package/dist/hooks/message/useMessage.d.ts +1 -1
- package/dist/hooks/message/useMessage.d.ts.map +1 -1
- package/dist/hooks/message/useMessage.js +7 -4
- package/dist/hooks/message/useNewMessageAnnouncement.d.ts.map +1 -1
- package/dist/hooks/message/useNewMessageAnnouncement.js +3 -1
- package/dist/hooks/message/usePinMessage.d.ts +0 -2
- package/dist/hooks/message/usePinMessage.d.ts.map +1 -1
- package/dist/hooks/message/usePinMessage.js +7 -11
- package/dist/hooks/message/useQuotedSenderName.d.ts +14 -0
- package/dist/hooks/message/useQuotedSenderName.d.ts.map +1 -0
- package/dist/hooks/message/useQuotedSenderName.js +41 -0
- package/dist/hooks/user/useAuth.d.ts.map +1 -1
- package/dist/hooks/user/useAuth.js +2 -0
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/locales/i18n.d.ts.map +1 -1
- package/dist/locales/i18n.js +3 -2
- package/dist/locales/i18n.ts +3 -2
- package/dist/locales/vi/boot.json +28 -0
- package/dist/locales/vi/common.json +2 -1
- package/dist/screens/conversation-detail/index.d.ts.map +1 -1
- package/dist/screens/conversation-detail/index.js +28 -4
- package/dist/screens/desk-message/DeskBootCard.d.ts +7 -0
- package/dist/screens/desk-message/DeskBootCard.d.ts.map +1 -0
- package/dist/screens/desk-message/DeskBootCard.js +69 -0
- package/dist/screens/desk-message/DeskOfflineOverlay.d.ts +10 -0
- package/dist/screens/desk-message/DeskOfflineOverlay.d.ts.map +1 -0
- package/dist/screens/desk-message/DeskOfflineOverlay.js +11 -0
- package/dist/screens/desk-message/DeskWorkspace.d.ts +7 -1
- package/dist/screens/desk-message/DeskWorkspace.d.ts.map +1 -1
- package/dist/screens/desk-message/DeskWorkspace.js +82 -13
- package/dist/screens/desk-message/DeskWorkspaceSkeleton.d.ts +10 -0
- package/dist/screens/desk-message/DeskWorkspaceSkeleton.d.ts.map +1 -0
- package/dist/screens/desk-message/DeskWorkspaceSkeleton.js +18 -0
- package/dist/screens/desk-message/PhoneThreadFallbackHeader.d.ts +8 -0
- package/dist/screens/desk-message/PhoneThreadFallbackHeader.d.ts.map +1 -0
- package/dist/screens/desk-message/PhoneThreadFallbackHeader.js +11 -0
- package/dist/screens/desk-message/index.d.ts +2 -0
- package/dist/screens/desk-message/index.d.ts.map +1 -1
- package/dist/screens/desk-message/index.js +47 -3
- package/dist/store/boot.d.ts +29 -0
- package/dist/store/boot.d.ts.map +1 -0
- package/dist/store/boot.js +21 -0
- package/dist/store/conversation.d.ts +2 -0
- package/dist/store/conversation.d.ts.map +1 -1
- package/dist/store/conversation.js +16 -12
- package/dist/store/deskPanelHost.d.ts +2 -0
- package/dist/store/deskPanelHost.d.ts.map +1 -1
- package/dist/store/deskPanelHost.js +1 -0
- package/dist/store/type.d.ts +12 -1
- package/dist/store/type.d.ts.map +1 -1
- package/dist/store/workspaceLayout.d.ts +3 -0
- package/dist/store/workspaceLayout.d.ts.map +1 -1
- package/dist/store/workspaceLayout.js +2 -0
- package/dist/styles/global.css +1 -1
- package/dist/types/customMessage.d.ts +17 -0
- package/dist/types/customMessage.d.ts.map +1 -1
- package/dist/types/customMessage.js +8 -0
- package/dist/utils/common.d.ts +2 -0
- package/dist/utils/common.d.ts.map +1 -1
- package/dist/utils/common.js +14 -4
- package/dist/utils/conversation.d.ts +1 -0
- package/dist/utils/conversation.d.ts.map +1 -1
- package/dist/utils/conversation.js +1 -1
- package/dist/utils/customMessage.d.ts +7 -1
- package/dist/utils/customMessage.d.ts.map +1 -1
- package/dist/utils/customMessage.js +55 -1
- package/package.json +1 -1
- package/dist/screens/desk-message/ViewportNotice.d.ts +0 -4
- package/dist/screens/desk-message/ViewportNotice.d.ts.map +0 -1
- package/dist/screens/desk-message/ViewportNotice.js +0 -9
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MessageItem } from "@droppii-org/wasm-client-sdk";
|
|
2
|
+
import type { CustomElemEventData } from "../../../types/customMessage";
|
|
3
|
+
interface EventMessageItemProps {
|
|
4
|
+
message: MessageItem;
|
|
5
|
+
/** null when customElem.data didn't parse — the text still renders. */
|
|
6
|
+
data: CustomElemEventData | null;
|
|
7
|
+
}
|
|
8
|
+
/** Draws its own surface: MessageItem renders it in a transparent bubble. */
|
|
9
|
+
declare const EventMessageItem: ({ message, data }: EventMessageItemProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export default EventMessageItem;
|
|
11
|
+
//# sourceMappingURL=EventMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/EventMessage.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAcjE,UAAU,qBAAqB;IAC7B,OAAO,EAAE,WAAW,CAAC;IACrB,uEAAuE;IACvE,IAAI,EAAE,mBAAmB,GAAG,IAAI,CAAC;CAClC;AAED,6EAA6E;AAC7E,QAAA,MAAM,gBAAgB,GAAI,mBAAmB,qBAAqB,mDAgCjE,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { sanitizeHtml } from "../../../utils/common";
|
|
5
|
+
import { getEventMessageHtml } from "../../../utils/customMessage";
|
|
6
|
+
import ConsultantChatButton from "./ConsultantChatButton";
|
|
7
|
+
import { useConsultantCta } from "./consultantCta";
|
|
8
|
+
import { MESSAGE_TEXT_CLASS } from "./textStyle";
|
|
9
|
+
// Same text size as every other message in the thread, with one blank line
|
|
10
|
+
// (1.6em at the default 160% line height) between paragraphs.
|
|
11
|
+
const EVENT_TEXT_CLASS = clsx("min-w-0 [overflow-wrap:anywhere] [&_p+p]:mt-[1.6em]", MESSAGE_TEXT_CLASS);
|
|
12
|
+
/** Draws its own surface: MessageItem renders it in a transparent bubble. */
|
|
13
|
+
const EventMessageItem = ({ message, data }) => {
|
|
14
|
+
var _a;
|
|
15
|
+
const consultantCta = useConsultantCta();
|
|
16
|
+
const html = getEventMessageHtml(message);
|
|
17
|
+
const fallbackText = ((_a = message === null || message === void 0 ? void 0 : message.customElem) === null || _a === void 0 ? void 0 : _a.description) || (data === null || data === void 0 ? void 0 : data.message) || "";
|
|
18
|
+
const consultantId = data === null || data === void 0 ? void 0 : data.consultantId;
|
|
19
|
+
const openConsultantChat = consultantCta &&
|
|
20
|
+
consultantId &&
|
|
21
|
+
consultantCta.ctaMessageId === (message === null || message === void 0 ? void 0 : message.clientMsgID)
|
|
22
|
+
? () => consultantCta.onOpenConsultantChat(consultantId)
|
|
23
|
+
: null;
|
|
24
|
+
if (!html && !fallbackText)
|
|
25
|
+
return null;
|
|
26
|
+
return (_jsxs("div", { "data-testid": "event-message", className: "flex min-w-0 flex-col gap-2 rounded-[20px] rounded-bl bg-[var(--dc-color-neutral-surface)] px-4 py-3", children: [html ? (_jsx("div", { className: EVENT_TEXT_CLASS, dangerouslySetInnerHTML: { __html: sanitizeHtml(html) } })) : (_jsx("p", { className: EVENT_TEXT_CLASS, children: fallbackText })), openConsultantChat && (_jsx(ConsultantChatButton, { onClick: openConsultantChat }))] }));
|
|
27
|
+
};
|
|
28
|
+
export default EventMessageItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageMoreButton.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/MessageMoreButton.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"MessageMoreButton.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/MessageMoreButton.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAsCtC,UAAU,sBAAsB;IAC9B,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,MAAM,EAAE,OAAO,CAAC;IAChB,uEAAuE;IACvE,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,oFAAoF;AACpF,QAAA,MAAM,iBAAiB,GAAI,mDAMxB,sBAAsB,4CAmFxB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useRef } from "react";
|
|
4
|
-
import { Dropdown } from "antd";
|
|
4
|
+
import { Dropdown, Menu } from "antd";
|
|
5
5
|
import clsx from "clsx";
|
|
6
6
|
import { StrokeIcon } from "../../../components/icon/StrokeIcon";
|
|
7
7
|
import { useTranslation } from "react-i18next";
|
|
8
8
|
import { useEscapeLayer } from "../../../hooks/common/useEscapeLayer";
|
|
9
|
+
import BottomSheet from "../../../components/common/BottomSheet";
|
|
10
|
+
import { LAYOUT_MEDIA } from "../../../constants/layout";
|
|
9
11
|
// Compact text menu from the design: 260px, 36px rows, 14px text, 18px icons.
|
|
10
12
|
const MORE_MENU_CLASSNAME = clsx("[&_.ant-dropdown-menu]:!w-[260px]", "[&_.ant-dropdown-menu]:!rounded-xl", "[&_.ant-dropdown-menu]:!p-1", "[&_.ant-dropdown-menu-item]:!h-9", "[&_.ant-dropdown-menu-item]:!rounded-lg", "[&_.ant-dropdown-menu-item]:!px-3", "[&_.ant-dropdown-menu-item]:!py-0", "[&_.ant-dropdown-menu-item]:flex", "[&_.ant-dropdown-menu-item]:items-center", "[&_[data-cp-name=ToolboxMenuRow]]:gap-2.5", "[&_[data-cp-name=ToolboxMenuRow]_span]:!text-sm", "[&_[data-cp-name=ToolboxMenuRow]_span]:!font-normal", "[&_[data-cp-name=ToolboxMenuRow]_svg]:!h-[18px]", "[&_[data-cp-name=ToolboxMenuRow]_svg]:!w-[18px]");
|
|
13
|
+
// Sheet rows: 48px, borderless, same labeled items as the dropdown.
|
|
14
|
+
const SHEET_MENU_CLASSNAME = clsx("!border-0", "[&_.ant-menu-item]:!h-12", "[&_.ant-menu-item]:!leading-[48px]", "[&_.ant-menu-item]:!rounded-lg", "[&_.ant-menu-item]:!px-3", "[&_.ant-menu-item]:!m-0", "[&_.ant-menu-item]:!w-full", "[&_[data-cp-name=ToolboxMenuRow]]:gap-3");
|
|
11
15
|
/** CRM only: "…" beside the bubble that opens the same text menu as right-click. */
|
|
12
16
|
const MessageMoreButton = ({ items, open, onOpenChange, isMine, reachable, }) => {
|
|
13
17
|
const { t } = useTranslation();
|
|
14
18
|
const buttonRef = useRef(null);
|
|
15
19
|
useEscapeLayer(open, () => onOpenChange(false));
|
|
20
|
+
// A plain matchMedia read per render, no per-row subscription.
|
|
21
|
+
const isPhoneTier = typeof window !== "undefined" && window.matchMedia(LAYOUT_MEDIA.phone).matches;
|
|
22
|
+
const asSheet = open && isPhoneTier;
|
|
23
|
+
// Mounted on first sheet use only, so rows that never open one carry no Drawer.
|
|
24
|
+
const sheetUsedRef = useRef(false);
|
|
25
|
+
if (asSheet)
|
|
26
|
+
sheetUsedRef.current = true;
|
|
16
27
|
// Opened from the keyboard: move into the menu; closing returns focus to the button.
|
|
17
28
|
const openedByKeyboardRef = useRef(false);
|
|
18
29
|
useEffect(() => {
|
|
@@ -25,7 +36,9 @@ const MessageMoreButton = ({ items, open, onOpenChange, isMine, reachable, }) =>
|
|
|
25
36
|
// The popup mounts a frame or two after `open`; retry briefly.
|
|
26
37
|
let tries = 0;
|
|
27
38
|
const id = window.setInterval(() => {
|
|
28
|
-
const item = document.querySelector(
|
|
39
|
+
const item = document.querySelector(asSheet
|
|
40
|
+
? ".ant-drawer-open [role=menuitem]"
|
|
41
|
+
: ".ant-dropdown:not(.ant-dropdown-hidden) [role=menuitem]");
|
|
29
42
|
item === null || item === void 0 ? void 0 : item.focus();
|
|
30
43
|
if (item || ++tries > 20)
|
|
31
44
|
window.clearInterval(id);
|
|
@@ -36,7 +49,7 @@ const MessageMoreButton = ({ items, open, onOpenChange, isMine, reachable, }) =>
|
|
|
36
49
|
openedByKeyboardRef.current = false;
|
|
37
50
|
(_b = buttonRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
38
51
|
}
|
|
39
|
-
}, [open]);
|
|
40
|
-
return (_jsx(Dropdown, { menu: { items }, trigger: ["click"], open: open, onOpenChange: onOpenChange, placement: isMine ? "bottomRight" : "bottomLeft", overlayClassName: MORE_MENU_CLASSNAME, children: _jsx("button", { ref: buttonRef, type: "button", "data-testid": "message-more-button", "aria-label": t("message_actions"), title: t("message_actions"), "aria-haspopup": "menu", "aria-expanded": open, tabIndex: reachable || open ? 0 : -1, className: clsx("absolute top-1/2 z-[1] flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-lg border-0 bg-gray-5 p-0 text-gray-900 opacity-0 transition-opacity hover:bg-gray-25 focus-visible:opacity-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary-200 group-hover/msg:opacity-100 group-focus-within/msg:opacity-100", open && "opacity-100", isMine ? "right-full mr-1" : "left-full ml-1"), children: _jsx(StrokeIcon, { name: "more", size: 18 }) }) }));
|
|
52
|
+
}, [open, asSheet]);
|
|
53
|
+
return (_jsxs(_Fragment, { children: [_jsx(Dropdown, { menu: { items }, trigger: ["click"], open: open && !asSheet, onOpenChange: onOpenChange, placement: isMine ? "bottomRight" : "bottomLeft", overlayClassName: MORE_MENU_CLASSNAME, children: _jsx("button", { ref: buttonRef, type: "button", "data-testid": "message-more-button", "aria-label": t("message_actions"), title: t("message_actions"), "aria-haspopup": isPhoneTier ? "dialog" : "menu", "aria-expanded": open, tabIndex: reachable || open ? 0 : -1, className: clsx("absolute top-1/2 z-[1] flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-lg border-0 bg-gray-5 p-0 text-gray-900 opacity-0 transition-opacity hover:bg-gray-25 focus-visible:opacity-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary-200 group-hover/msg:opacity-100 group-focus-within/msg:opacity-100 touch-any:opacity-100 touch:min-h-10 touch:min-w-10", open && "opacity-100", isMine ? "right-full mr-1" : "left-full ml-1"), children: _jsx(StrokeIcon, { name: "more", size: 18 }) }) }), sheetUsedRef.current && (_jsx(BottomSheet, { open: asSheet, title: t("message_actions"), onClose: () => onOpenChange(false), children: _jsx(Menu, { items: items, selectable: false, onClick: () => onOpenChange(false), className: SHEET_MENU_CLASSNAME }) }))] }));
|
|
41
54
|
};
|
|
42
55
|
export default MessageMoreButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuoteMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/QuoteMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"QuoteMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/QuoteMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAK3D,UAAU,qBAAqB;IAC7B,OAAO,EAAE,WAAW,CAAC;IACrB,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;CACrD;AAED,QAAA,MAAM,gBAAgB,GAAI,mCAGvB,qBAAqB,mDAoBvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,62 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
|
-
import { useCallback, useMemo } from "react";
|
|
4
|
-
import useAuthStore from "../../../store/auth";
|
|
5
|
-
import useConversationStore from "../../../store/conversation";
|
|
6
3
|
import ReplyQuoteContent from "../../../components/message/reply/ReplyQuoteContent";
|
|
7
|
-
import {
|
|
8
|
-
import { isSupportSessionAgentView } from "../../../utils/conversation";
|
|
4
|
+
import { useQuotedSenderName } from "../../../hooks/message/useQuotedSenderName";
|
|
9
5
|
const QuoteMessageItem = ({ message, onPressQuoteMessage, }) => {
|
|
10
6
|
var _a, _b;
|
|
11
|
-
const userID = useAuthStore((state) => state.userID);
|
|
12
|
-
const isCrm = useAuthStore((state) => state.isCrm);
|
|
13
|
-
const conversationData = useConversationStore((state) => state.conversationData);
|
|
14
7
|
const { t } = useTranslation();
|
|
15
|
-
const isChatSupport = useMemo(() => {
|
|
16
|
-
var _a, _b, _c;
|
|
17
|
-
try {
|
|
18
|
-
return (_c = (_b = (_a = JSON.parse((conversationData === null || conversationData === void 0 ? void 0 : conversationData.ex) || "{}")) === null || _a === void 0 ? void 0 : _a.sessionInfo) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.botId;
|
|
19
|
-
}
|
|
20
|
-
catch (_d) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
}, [conversationData === null || conversationData === void 0 ? void 0 : conversationData.ex]);
|
|
24
8
|
const quoteMessage = ((_a = message === null || message === void 0 ? void 0 : message.quoteElem) === null || _a === void 0 ? void 0 : _a.quoteMessage) || ((_b = message === null || message === void 0 ? void 0 : message.atTextElem) === null || _b === void 0 ? void 0 : _b.quoteMessage);
|
|
25
|
-
|
|
26
|
-
// owner keeps seeing the thread's own name.
|
|
27
|
-
const isAgentView = !isCrm && isSupportSessionAgentView(conversationData, userID);
|
|
28
|
-
const quotedUsername = useUserUsername(isAgentView && (quoteMessage === null || quoteMessage === void 0 ? void 0 : quoteMessage.sendID) !== userID
|
|
29
|
-
? quoteMessage === null || quoteMessage === void 0 ? void 0 : quoteMessage.sendID
|
|
30
|
-
: undefined);
|
|
31
|
-
const getDisplayName = useCallback(({ name, id }) => {
|
|
32
|
-
if (isAgentView) {
|
|
33
|
-
if (id === userID)
|
|
34
|
-
return t("you");
|
|
35
|
-
return quotedUsername || name || "";
|
|
36
|
-
}
|
|
37
|
-
if (!name)
|
|
38
|
-
return "";
|
|
39
|
-
if (!isCrm && isChatSupport) {
|
|
40
|
-
return conversationData === null || conversationData === void 0 ? void 0 : conversationData.showName;
|
|
41
|
-
}
|
|
42
|
-
if (id === userID)
|
|
43
|
-
return t("you");
|
|
44
|
-
return name;
|
|
45
|
-
}, [
|
|
46
|
-
isAgentView,
|
|
47
|
-
quotedUsername,
|
|
48
|
-
isCrm,
|
|
49
|
-
isChatSupport,
|
|
50
|
-
conversationData === null || conversationData === void 0 ? void 0 : conversationData.showName,
|
|
51
|
-
userID,
|
|
52
|
-
t,
|
|
53
|
-
]);
|
|
9
|
+
const { isMe, name } = useQuotedSenderName(quoteMessage);
|
|
54
10
|
if (!quoteMessage)
|
|
55
11
|
return null;
|
|
56
|
-
const title =
|
|
57
|
-
name: quoteMessage.senderNickname,
|
|
58
|
-
id: quoteMessage.sendID,
|
|
59
|
-
});
|
|
12
|
+
const title = isMe ? t("you") : name;
|
|
60
13
|
return (_jsx("div", { className: "flex cursor-pointer items-center overflow-hidden rounded-r-xl bg-white/70", onClick: () => onPressQuoteMessage === null || onPressQuoteMessage === void 0 ? void 0 : onPressQuoteMessage(quoteMessage.clientMsgID || ""), "data-cp-name": "QuoteMessageItem", children: _jsx(ReplyQuoteContent, { message: quoteMessage, title: title }) }));
|
|
61
14
|
};
|
|
62
15
|
export default QuoteMessageItem;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface ConsultantCtaContextValue {
|
|
2
|
+
/** clientMsgID of the single message allowed to show the button, if any. */
|
|
3
|
+
ctaMessageId: string | null;
|
|
4
|
+
onOpenConsultantChat: (consultantId: string) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const ConsultantCtaContext: import("react").Context<ConsultantCtaContextValue | null>;
|
|
7
|
+
export declare const useConsultantCta: () => ConsultantCtaContextValue | null;
|
|
8
|
+
//# sourceMappingURL=consultantCta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consultantCta.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/consultantCta.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,yBAAyB;IACxC,4EAA4E;IAC5E,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,oBAAoB,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;CACtD;AAID,eAAO,MAAM,oBAAoB,2DACsB,CAAC;AAExD,eAAO,MAAM,gBAAgB,wCAAyC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
// Only the conversation-detail message list provides it; other timelines
|
|
3
|
+
// (CRM desk, pinned/search previews) render event messages without a button.
|
|
4
|
+
export const ConsultantCtaContext = createContext(null);
|
|
5
|
+
export const useConsultantCta = () => useContext(ConsultantCtaContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,IAAI,eAAe,EAG/B,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,IAAI,eAAe,EAG/B,MAAM,8BAA8B,CAAC;AA8DtC,UAAU,gBAAgB;IACxB,OAAO,EAAE,eAAe,CAAC;IACzB,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uBAAuB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,eAAe,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IACpD,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAClD,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IACpD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,2EAA2E;IAC3E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,uEAAuE;IACvE,kBAAkB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AAiDD,QAAA,MAAM,WAAW,GAAI,kSAkBlB,gBAAgB,mDA0flB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -10,6 +10,7 @@ import { getImmediateNeighbor, getVisibleNeighbor, isMessageHiddenForViewer, } f
|
|
|
10
10
|
import { MSG_ITEM_BUBBLE_GROUP_PREFIX, MSG_ITEM_CONTENT_PREFIX, MSG_ITEM_PREFIX, SUPPORT_SYSTEM_SENDER_ID, } from "../../../constants";
|
|
11
11
|
import { formatDividerTimestamp } from "../../../utils/common";
|
|
12
12
|
import { CustomMessageType } from "../../../types/customMessage";
|
|
13
|
+
import { isEventCustomMessage, isSystemEventMessage, } from "../../../utils/customMessage";
|
|
13
14
|
import useAuthStore from "../../../store/auth";
|
|
14
15
|
import useConversationStore from "../../../store/conversation";
|
|
15
16
|
import { useMemo, useRef, useState } from "react";
|
|
@@ -53,6 +54,8 @@ const MessageItem = ({ message, allMessages, isGroupChat = false, forceHideTip =
|
|
|
53
54
|
const { resendMessage } = useSendMessage();
|
|
54
55
|
const userID = useAuthStore((state) => state.userID);
|
|
55
56
|
const isCrm = useAuthStore((state) => state.isCrm);
|
|
57
|
+
// Bot-thread event messages draw their own surface and can't be replied to.
|
|
58
|
+
const isEventMessage = isSystemEventMessage(message);
|
|
56
59
|
const conversationData = useConversationStore((state) => state.conversationData);
|
|
57
60
|
// CRM only: the "…" menu and whether the message holds focus (so Tab reaches it).
|
|
58
61
|
const [moreOpen, setMoreOpen] = useState(false);
|
|
@@ -67,7 +70,7 @@ const MessageItem = ({ message, allMessages, isGroupChat = false, forceHideTip =
|
|
|
67
70
|
}
|
|
68
71
|
const closeToolbox = () => onContextMenuOpenChange === null || onContextMenuOpenChange === void 0 ? void 0 : onContextMenuOpenChange(false);
|
|
69
72
|
const actions = [];
|
|
70
|
-
if (isDeliveredForUi && onQuoteMessage) {
|
|
73
|
+
if (isDeliveredForUi && onQuoteMessage && !isEventMessage) {
|
|
71
74
|
actions.push({
|
|
72
75
|
key: MessageToolboxActionKey.REPLY,
|
|
73
76
|
label: t("context_menu_reply"),
|
|
@@ -143,6 +146,7 @@ const MessageItem = ({ message, allMessages, isGroupChat = false, forceHideTip =
|
|
|
143
146
|
onContextMenuOpenChange,
|
|
144
147
|
onCopyMessageLink,
|
|
145
148
|
isMessageLinkCopyable,
|
|
149
|
+
isEventMessage,
|
|
146
150
|
]);
|
|
147
151
|
const bubbleWrapperRef = useRef(null);
|
|
148
152
|
useLongPress(() => onContextMenuOpenChange === null || onContextMenuOpenChange === void 0 ? void 0 : onContextMenuOpenChange(true), enableLongPress ? bubbleWrapperRef : undefined, { delay: 500 });
|
|
@@ -186,8 +190,10 @@ const MessageItem = ({ message, allMessages, isGroupChat = false, forceHideTip =
|
|
|
186
190
|
const hasContextMenu = contextMenuItems.length > 0;
|
|
187
191
|
const isLatestMine = ((_a = allMessages.find((m) => m.sendID === userID)) === null || _a === void 0 ? void 0 : _a.clientMsgID) ===
|
|
188
192
|
message.clientMsgID;
|
|
189
|
-
|
|
190
|
-
const
|
|
193
|
+
// CRM hides event messages, so they must not anchor its dividers or groups.
|
|
194
|
+
const isHiddenNeighbour = (candidate) => isCrm && isEventCustomMessage(candidate);
|
|
195
|
+
const previousMessage = getVisibleNeighbor(allMessages, message, "prev", isHiddenNeighbour);
|
|
196
|
+
const nextMessage = getVisibleNeighbor(allMessages, message, "next", isHiddenNeighbour);
|
|
191
197
|
const isOrder = isOrderMessage(message);
|
|
192
198
|
// A system-log, group-notification, or session-event item breaks the
|
|
193
199
|
// group even though it's skipped by getVisibleNeighbor's "next ordinary
|
|
@@ -266,7 +272,7 @@ const MessageItem = ({ message, allMessages, isGroupChat = false, forceHideTip =
|
|
|
266
272
|
timeBreakNode,
|
|
267
273
|
_jsx(SessionEventMessageItem, { message: message })));
|
|
268
274
|
}
|
|
269
|
-
const bubbleNode = (_jsx(MessageBubble, { isMine: isMine, isInternal: isInternalMessage, supportSender: supportSender, senderName: message === null || message === void 0 ? void 0 : message.senderNickname, showSenderName: showSenderName, showTip: showTip, id: `${MSG_ITEM_CONTENT_PREFIX}${message === null || message === void 0 ? void 0 : message.clientMsgID}`, content: renderBubbleContent(message, onPressQuoteMessage), isTransparent: isStickerMessage, timeLabel: isCrm ? undefined : dayjs.tz(message.sendTime).format("HH:mm"), timeRevealed: timeRevealed, onToggleTimeReveal: () => onToggleTimeReveal === null || onToggleTimeReveal === void 0 ? void 0 : onToggleTimeReveal(message.clientMsgID) }));
|
|
275
|
+
const bubbleNode = (_jsx(MessageBubble, { isMine: isMine, isInternal: isInternalMessage, supportSender: supportSender, senderName: message === null || message === void 0 ? void 0 : message.senderNickname, showSenderName: showSenderName, showTip: showTip, id: `${MSG_ITEM_CONTENT_PREFIX}${message === null || message === void 0 ? void 0 : message.clientMsgID}`, content: renderBubbleContent(message, onPressQuoteMessage), isTransparent: isStickerMessage || isEventMessage, timeLabel: isCrm ? undefined : dayjs.tz(message.sendTime).format("HH:mm"), timeRevealed: timeRevealed, onToggleTimeReveal: () => onToggleTimeReveal === null || onToggleTimeReveal === void 0 ? void 0 : onToggleTimeReveal(message.clientMsgID) }));
|
|
270
276
|
const showPinnedBadge = Boolean(message === null || message === void 0 ? void 0 : message.isPinned);
|
|
271
277
|
const showGroupTime = isCrm && !nextSameUser;
|
|
272
278
|
const pinnedBadgeNode = showPinnedBadge ? (_jsx("span", { "data-testid": "message-pinned-badge", className: clsx("absolute -top-2.5 z-[1] flex h-[22px] w-[26px] items-center justify-center rounded-full border border-white bg-gray-25", isMine ? "left-0" : "right-0"), children: _jsx(AdaptiveIcon, { stroke: "pin", font: "thumbtack-b", size: 12, className: "text-[var(--dc-color-primary)]" }) })) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otherSenders.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/otherSenders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"otherSenders.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/otherSenders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAmBhE;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAClC,UAAU,WAAW,EAAE,EACvB,UAAU,MAAM,KACf,OAeF,CAAC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { MessageType } from "@droppii-org/wasm-client-sdk";
|
|
2
|
+
import { isEventCustomMessage } from "../../../utils/customMessage";
|
|
2
3
|
import { isGroupNotificationMessageType, isSessionEventMessage, isSystemLogMessageType, } from "../../../utils/messageLog";
|
|
3
4
|
const cache = new WeakMap();
|
|
4
5
|
const isChatMessage = (message) => message.contentType !== MessageType.RevokeMessage &&
|
|
5
6
|
!isSystemLogMessageType(message.contentType) &&
|
|
6
7
|
!isGroupNotificationMessageType(message.contentType) &&
|
|
7
|
-
!isSessionEventMessage(message)
|
|
8
|
+
!isSessionEventMessage(message) &&
|
|
9
|
+
// CRM-only helper, and CRM hides event messages.
|
|
10
|
+
!isEventCustomMessage(message);
|
|
8
11
|
/**
|
|
9
12
|
* True when at least two different people other than the viewer have spoken (bot and
|
|
10
13
|
* customer, or several members). Only then does an incoming group need a sender label.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReplyPreviewBar.d.ts","sourceRoot":"","sources":["../../../../src/components/message/reply/ReplyPreviewBar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ReplyPreviewBar.d.ts","sourceRoot":"","sources":["../../../../src/components/message/reply/ReplyPreviewBar.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe,sDAuC3B,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,30 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
3
|
import { AdaptiveIcon } from "../../../components/icon/AdaptiveIcon";
|
|
4
|
-
import useAuthStore from "../../../store/auth";
|
|
5
4
|
import useConversationStore from "../../../store/conversation";
|
|
6
|
-
import {
|
|
7
|
-
import { isSupportSessionAgentView } from "../../../utils/conversation";
|
|
5
|
+
import { useQuotedSenderName } from "../../../hooks/message/useQuotedSenderName";
|
|
8
6
|
import { ReplyQuoteContent } from "./ReplyQuoteContent";
|
|
9
7
|
export const ReplyPreviewBar = () => {
|
|
10
8
|
const { t } = useTranslation();
|
|
11
9
|
const quotedMessage = useConversationStore((state) => state.quotedMessage);
|
|
12
10
|
const setQuotedMessage = useConversationStore((state) => state.setQuotedMessage);
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
const isCrm = useAuthStore((state) => state.isCrm);
|
|
16
|
-
const isMe = (quotedMessage === null || quotedMessage === void 0 ? void 0 : quotedMessage.sendID) === userID;
|
|
17
|
-
// Matches the sent quote's title, which shows agents outside CRM the username.
|
|
18
|
-
const isAgentView = !isCrm && isSupportSessionAgentView(conversationData, userID);
|
|
19
|
-
const quotedUsername = useUserUsername(isAgentView && !isMe ? quotedMessage === null || quotedMessage === void 0 ? void 0 : quotedMessage.sendID : undefined);
|
|
11
|
+
// Same name the sent quote will carry.
|
|
12
|
+
const { isMe, name } = useQuotedSenderName(quotedMessage);
|
|
20
13
|
const handleClearQuotedMessage = () => {
|
|
21
14
|
setQuotedMessage(null);
|
|
22
15
|
};
|
|
23
16
|
if (!quotedMessage)
|
|
24
17
|
return null;
|
|
25
|
-
const senderName = isMe
|
|
26
|
-
? t("your_self")
|
|
27
|
-
: quotedUsername || quotedMessage.senderNickname || "";
|
|
18
|
+
const senderName = isMe ? t("your_self") : name;
|
|
28
19
|
return (_jsxs("div", { "data-testid": "reply-preview-bar", "data-cp-name": "ReplyPreviewBar", className: "flex h-[59px] w-full shrink-0 items-center bg-gray-200/10 px-2 py-1", children: [_jsx(ReplyQuoteContent, { message: quotedMessage, title: t("reply_to", { name: senderName }) }), _jsx("button", { type: "button", onClick: handleClearQuotedMessage, "aria-label": t("cancel"), "data-testid": "reply-preview-bar-close", className: "flex h-4 w-4 shrink-0 items-center justify-center", children: _jsx(AdaptiveIcon, { stroke: "x", font: "close-o", size: 16, className: "text-gray-600" }) })] }));
|
|
29
20
|
};
|
|
30
21
|
export default ReplyPreviewBar;
|
|
@@ -6,7 +6,9 @@ interface RichTextEditorProps {
|
|
|
6
6
|
onFilesChange?: (files: UploadFile[]) => void;
|
|
7
7
|
minHeight?: string;
|
|
8
8
|
showMediaUpload?: boolean;
|
|
9
|
+
/** CRM: hide the emoji button on phones (the system keyboard has emoji). */
|
|
10
|
+
hideEmojiOnPhone?: boolean;
|
|
9
11
|
}
|
|
10
|
-
export default function RichTextEditor({ initialHtml, placeholder, onChange, onFilesChange, minHeight, showMediaUpload, }: RichTextEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default function RichTextEditor({ initialHtml, placeholder, onChange, onFilesChange, minHeight, showMediaUpload, hideEmojiOnPhone, }: RichTextEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export {};
|
|
12
14
|
//# sourceMappingURL=RichTextEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.d.ts","sourceRoot":"","sources":["../../../src/components/rich-text-editor/RichTextEditor.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"RichTextEditor.d.ts","sourceRoot":"","sources":["../../../src/components/rich-text-editor/RichTextEditor.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AA2ClC,UAAU,mBAAmB;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,WAAW,EACX,WAAW,EACX,QAAQ,EACR,aAAa,EACb,SAAmB,EACnB,eAAsB,EACtB,gBAAwB,GACzB,EAAE,mBAAmB,2CAkErB"}
|
|
@@ -13,6 +13,7 @@ import { $getRoot } from "lexical";
|
|
|
13
13
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
14
14
|
import { useEffect } from "react";
|
|
15
15
|
import { ToolbarPlugin } from "../../components/message/footer/ToolbarPlugin";
|
|
16
|
+
import clsx from "clsx";
|
|
16
17
|
import MediaActions from "../../components/message/footer/MediaActions";
|
|
17
18
|
import { FilePreviewList } from "../../components/message/footer/FilePreview";
|
|
18
19
|
import { editorTheme, editorNodes, editorOnError, } from "../../components/message/footer/editorConfig";
|
|
@@ -38,7 +39,7 @@ function HtmlPlugin({ initialHtml }) {
|
|
|
38
39
|
}, [editor, initialHtml]);
|
|
39
40
|
return null;
|
|
40
41
|
}
|
|
41
|
-
export default function RichTextEditor({ initialHtml, placeholder, onChange, onFilesChange, minHeight = "160px", showMediaUpload = true, }) {
|
|
42
|
+
export default function RichTextEditor({ initialHtml, placeholder, onChange, onFilesChange, minHeight = "160px", showMediaUpload = true, hideEmojiOnPhone = false, }) {
|
|
42
43
|
const [listUploadFiles, setListUploadFiles] = useState([]);
|
|
43
44
|
const handleChange = (editorState, editor, tags) => {
|
|
44
45
|
if (tags.has("initial-html"))
|
|
@@ -58,5 +59,6 @@ export default function RichTextEditor({ initialHtml, placeholder, onChange, onF
|
|
|
58
59
|
setListUploadFiles(files);
|
|
59
60
|
onFilesChange === null || onFilesChange === void 0 ? void 0 : onFilesChange(files);
|
|
60
61
|
};
|
|
61
|
-
return (_jsxs(LexicalComposer, { initialConfig: EDITOR_CONFIG, children: [_jsxs("div", { className: "border border-gray-200 rounded-lg", children: [_jsx(FilePreviewList, { files: listUploadFiles, onRemove: handleRemoveFile }), _jsx("div", { className: "relative", children: _jsx(RichTextPlugin, { contentEditable: _jsx(ContentEditable, { className: "px-3 py-2 text-sm outline-none", style: { minHeight } }), ErrorBoundary: LexicalErrorBoundary, placeholder: placeholder ? (_jsx("div", { className: "absolute top-2 left-3 pointer-events-none", children: _jsx("p", { className: "text-gray-400 text-sm", children: placeholder }) })) : null }) }), _jsxs("div", { className: "flex items-center border-t border-gray-100 px-2 py-1",
|
|
62
|
+
return (_jsxs(LexicalComposer, { initialConfig: EDITOR_CONFIG, children: [_jsxs("div", { className: "border border-gray-200 rounded-lg", children: [_jsx(FilePreviewList, { files: listUploadFiles, onRemove: handleRemoveFile }), _jsx("div", { className: "relative", children: _jsx(RichTextPlugin, { contentEditable: _jsx(ContentEditable, { className: "px-3 py-2 text-sm outline-none", style: { minHeight } }), ErrorBoundary: LexicalErrorBoundary, placeholder: placeholder ? (_jsx("div", { className: "absolute top-2 left-3 pointer-events-none", children: _jsx("p", { className: "text-gray-400 text-sm", children: placeholder }) })) : null }) }), _jsxs("div", { className: clsx("flex items-center border-t border-gray-100 px-2 py-1", hideEmojiOnPhone &&
|
|
63
|
+
"flex-wrap max-sm:[&_[data-cp-name=ToolbarPlugin]]:!gap-1 max-sm:[&_[data-cp-name=ToolbarPlugin]]:!px-1"), children: [_jsx(ToolbarPlugin, {}), _jsx(MediaActions, { listUploadFiles: listUploadFiles, onFilesChange: handleFilesChange, showMediaUpload: showMediaUpload, hideEmojiOnPhone: hideEmojiOnPhone })] })] }), _jsx(LinkPlugin, {}), _jsx(ListPlugin, {}), _jsx(OnChangePlugin, { onChange: handleChange, ignoreSelectionChange: true }), _jsx(HtmlPlugin, { initialHtml: initialHtml })] }));
|
|
62
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchItemAsGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/search-conversation/item/SearchItemAsGroup.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAUxF,UAAU,sBAAsB;IAC9B,KAAK,EAAE,4BAA4B,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,iBAAiB,GAAI,OAAO,sBAAsB,
|
|
1
|
+
{"version":3,"file":"SearchItemAsGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/search-conversation/item/SearchItemAsGroup.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAUxF,UAAU,sBAAsB;IAC9B,KAAK,EAAE,4BAA4B,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,iBAAiB,GAAI,OAAO,sBAAsB,4CA+FvD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -7,7 +7,7 @@ import { AdaptiveIcon } from "../../../components/icon/AdaptiveIcon";
|
|
|
7
7
|
import { useTranslation } from "react-i18next";
|
|
8
8
|
import { GroupVisibility } from "@droppii-org/wasm-client-sdk";
|
|
9
9
|
import useConversationStore from "../../../store/conversation";
|
|
10
|
-
import {
|
|
10
|
+
import { useDeskThreadNavigation } from "../../../hooks/conversation/useDeskThreadNavigation";
|
|
11
11
|
import { highlightSearch, sanitizeHtml } from "../../../utils/common";
|
|
12
12
|
import GroupCompositeAvatar from "../../../components/group/GroupCompositeAvatar";
|
|
13
13
|
import RowChip from "../../../components/conversation/RowChip";
|
|
@@ -18,7 +18,7 @@ const SearchItemAsGroup = (props) => {
|
|
|
18
18
|
const { group, searchTerm = "" } = props;
|
|
19
19
|
const { t } = useTranslation();
|
|
20
20
|
const isCrm = useAuthStore((state) => state.isCrm);
|
|
21
|
-
const
|
|
21
|
+
const { openThread } = useDeskThreadNavigation();
|
|
22
22
|
const scope = useSearchScope();
|
|
23
23
|
const openPdpResult = useOpenPdpSearchResult();
|
|
24
24
|
const setConversationData = useConversationStore((state) => state.setConversationData);
|
|
@@ -39,7 +39,7 @@ const SearchItemAsGroup = (props) => {
|
|
|
39
39
|
newSearchParams.delete("userId");
|
|
40
40
|
newSearchParams.delete("groupId");
|
|
41
41
|
newSearchParams.delete("botId");
|
|
42
|
-
|
|
42
|
+
openThread({ threadId: conversation.conversationID }, `${window.location.pathname}?${newSearchParams.toString()}`);
|
|
43
43
|
};
|
|
44
44
|
return (_jsxs("div", Object.assign({ className: searchRowClass(isCrm) }, clickableProps(onPressItem), { "data-cp-name": "SearchItemAsGroup", children: [_jsx(GroupCompositeAvatar, { groupID: group.groupId, faceURL: conversation.faceURL, groupName: conversation.showName, size: isCrm ? 40 : 48 }), _jsxs("div", { className: "flex flex-col flex-1 min-w-0 gap-0.5", children: [_jsx("p", { className: isCrm
|
|
45
45
|
? "m-0 truncate text-sm font-medium text-gray-900"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchItemAsMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/search-conversation/item/SearchItemAsMessage.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAA4B,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchItemAsMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/search-conversation/item/SearchItemAsMessage.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAA4B,MAAM,8BAA8B,CAAC;AA2BrF,UAAU,wBAAwB;IAChC,OAAO,EAAE,WAAW,GAAG;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,QAAA,MAAM,mBAAmB,GAAI,OAAO,wBAAwB,4CA+J3D,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -16,6 +16,7 @@ import RowChip from "../../../components/conversation/RowChip";
|
|
|
16
16
|
import useAuthStore from "../../../store/auth";
|
|
17
17
|
import { getConversationIdFromMessage } from "../../../utils/conversation";
|
|
18
18
|
import { useOpenPdpSearchResult } from "../../../hooks/search/useOpenPdpSearchResult";
|
|
19
|
+
import { useDeskThreadNavigation } from "../../../hooks/conversation/useDeskThreadNavigation";
|
|
19
20
|
import { useSearchScope } from "../SearchScopeContext";
|
|
20
21
|
// PDP labels the source by its inbox tab; BE's displayTag carries the CS team name.
|
|
21
22
|
const PDP_TAG_LABEL_KEYS = {
|
|
@@ -31,6 +32,7 @@ const SearchItemAsMessage = (props) => {
|
|
|
31
32
|
const scope = useSearchScope();
|
|
32
33
|
const isPdpPortal = scope === "pdp-portal";
|
|
33
34
|
const openPdpResult = useOpenPdpSearchResult();
|
|
35
|
+
const { openFromList } = useDeskThreadNavigation();
|
|
34
36
|
const conversationData = useConversationStore((state) => state.conversationData);
|
|
35
37
|
const useConversationDisplay = useMemo(() => {
|
|
36
38
|
// PDP results span many threads, so show the sender like CRM does.
|
|
@@ -66,9 +68,17 @@ const SearchItemAsMessage = (props) => {
|
|
|
66
68
|
.setConversationData(data, message.clientMsgID, {
|
|
67
69
|
forceRevalidate: true,
|
|
68
70
|
});
|
|
71
|
+
const previousId = useConversationStore.getState().selectedConversationId;
|
|
69
72
|
useConversationStore
|
|
70
73
|
.getState()
|
|
71
74
|
.setSelectedConversationId(data.conversationID);
|
|
75
|
+
// CRM hits get a URL (and history entry) like list rows; hits inside the open thread don't.
|
|
76
|
+
if (isCrm && data.conversationID !== previousId) {
|
|
77
|
+
openFromList({
|
|
78
|
+
threadId: data.conversationID,
|
|
79
|
+
messageId: message.clientMsgID,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
72
82
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
73
83
|
};
|
|
74
84
|
let msgContent = "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchItemAsUser.d.ts","sourceRoot":"","sources":["../../../../src/components/search-conversation/item/SearchItemAsUser.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchItemAsUser.d.ts","sourceRoot":"","sources":["../../../../src/components/search-conversation/item/SearchItemAsUser.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAelF,UAAU,qBAAqB;IAE7B,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC,CAAC;IAC9E,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,gBAAgB,GAAI,OAAO,qBAAqB,4CA2FrD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -7,6 +7,7 @@ import { highlightSearch, sanitizeHtml } from "../../../utils/common";
|
|
|
7
7
|
import useConversationStore from "../../../store/conversation";
|
|
8
8
|
import { useTranslation } from "react-i18next";
|
|
9
9
|
import { useOpenPdpSearchResult } from "../../../hooks/search/useOpenPdpSearchResult";
|
|
10
|
+
import { useDeskThreadNavigation } from "../../../hooks/conversation/useDeskThreadNavigation";
|
|
10
11
|
import { useSearchScope } from "../SearchScopeContext";
|
|
11
12
|
import useAuthStore from "../../../store/auth";
|
|
12
13
|
import { SessionStatus } from "../../../types/chat";
|
|
@@ -23,6 +24,7 @@ const SearchItemAsUser = (props) => {
|
|
|
23
24
|
const { t } = useTranslation();
|
|
24
25
|
const scope = useSearchScope();
|
|
25
26
|
const openPdpResult = useOpenPdpSearchResult();
|
|
27
|
+
const { openFromList } = useDeskThreadNavigation();
|
|
26
28
|
const isCrm = useAuthStore((state) => state.isCrm);
|
|
27
29
|
const ownerName = `${(_a = session.owner) === null || _a === void 0 ? void 0 : _a.fullName}${((_b = session.owner) === null || _b === void 0 ? void 0 : _b.username) ? ` (${(_c = session.owner) === null || _c === void 0 ? void 0 : _c.username})` : ""}`;
|
|
28
30
|
const onPressItem = async () => {
|
|
@@ -32,10 +34,14 @@ const SearchItemAsUser = (props) => {
|
|
|
32
34
|
if (!(session === null || session === void 0 ? void 0 : session.conversation)) {
|
|
33
35
|
return message.error(t("err_get_conversation"));
|
|
34
36
|
}
|
|
37
|
+
const previousId = useConversationStore.getState().selectedConversationId;
|
|
35
38
|
useConversationStore.getState().setConversationData(session.conversation);
|
|
36
39
|
useConversationStore
|
|
37
40
|
.getState()
|
|
38
41
|
.setSelectedConversationId(session.conversationId);
|
|
42
|
+
if (isCrm && session.conversationId !== previousId) {
|
|
43
|
+
openFromList({ threadId: session.conversationId });
|
|
44
|
+
}
|
|
39
45
|
};
|
|
40
46
|
return (_jsxs("div", Object.assign({ className: searchRowClass(isCrm) }, clickableProps(onPressItem), { "data-cp-name": "SearchItemAsUser", children: [isCrm ? (_jsx(TintedAvatar, { name: ((_d = session.owner) === null || _d === void 0 ? void 0 : _d.fullName) || ((_e = session.owner) === null || _e === void 0 ? void 0 : _e.username) || "", src: (_f = session.owner) === null || _f === void 0 ? void 0 : _f.avatar, size: 40 })) : (_jsx(Avatar, { size: "large", src: (_g = session.owner) === null || _g === void 0 ? void 0 : _g.avatar, alt: (_h = session.owner) === null || _h === void 0 ? void 0 : _h.username, children: (_k = (_j = session.owner) === null || _j === void 0 ? void 0 : _j.fullName) === null || _k === void 0 ? void 0 : _k.charAt(0).toUpperCase() })), _jsxs("div", { className: "flex flex-col flex-1 min-w-0", children: [_jsx("p", { className: isCrm
|
|
41
47
|
? "m-0 truncate text-sm font-medium text-gray-900"
|
|
@@ -54,9 +54,9 @@ const DeskAssignedSession = ({ variant = "inline" }) => {
|
|
|
54
54
|
};
|
|
55
55
|
}, [refetch]);
|
|
56
56
|
if (collapsed) {
|
|
57
|
-
return (_jsx("div", { className: "flex flex-col items-center shrink-0 pt-3 rounded-xl bg-white shadow-sm", style: { width: LAYOUT_WIDTHS.folderCollapsed }, "data-cp-name": "DeskAssignedSession", children: _jsx(Tooltip, { title: t("folder_panel_expand"), placement: "right", children: _jsx(Button, { type: "text", className: "text-gray-600 w-8 h-8 p-0", "aria-label": t("folder_panel_expand"), onClick: () => setFolderCollapsedChoice(false), children: _jsx(StrokeIcon, { name: "chevrons-right", size: 20 }) }) }) }));
|
|
57
|
+
return (_jsx("div", { className: "flex flex-col items-center shrink-0 pt-3 rounded-xl bg-white shadow-sm", style: { width: LAYOUT_WIDTHS.folderCollapsed }, "data-cp-name": "DeskAssignedSession", children: _jsx(Tooltip, { title: t("folder_panel_expand"), placement: "right", children: _jsx(Button, { type: "text", className: "text-gray-600 w-8 h-8 p-0 touch:min-h-10 touch:min-w-10", "aria-label": t("folder_panel_expand"), onClick: () => setFolderCollapsedChoice(false), children: _jsx(StrokeIcon, { name: "chevrons-right", size: 20 }) }) }) }));
|
|
58
58
|
}
|
|
59
|
-
return (_jsxs("aside", { "aria-label": t("folder_panel_title"), className: `flex flex-col h-full shrink-0 overflow-hidden rounded-xl bg-white ${isOverlay ? "shadow-lg" : "shadow-sm"}`, style: { width: LAYOUT_WIDTHS.folder }, "data-cp-name": "DeskAssignedSession", children: [_jsxs("div", { className: "flex items-center justify-between h-14 pl-4 pr-2 border-b border-gray-25 shrink-0", children: [_jsx("span", { className: "text-base font-bold flex-1 truncate", children: t("desk_brand") }), _jsx(Tooltip, { title: t(isOverlay ? "folder_panel_close" : "folder_panel_collapse"), children: _jsx(Button, { type: "text", className: "text-gray-600 w-8 h-8 p-0", "aria-label": t(isOverlay ? "folder_panel_close" : "folder_panel_collapse"), onClick: () => isOverlay ? setFolderOverlayOpen(false) : setFolderCollapsedChoice(true), children: _jsx(StrokeIcon, { name: isOverlay ? "x" : "chevrons-left", size: 18 }) }) })] }), _jsxs("div", { className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-2 pb-2 pt-1", children: [_jsx("div", { className: "px-2 pb-1 pt-3 text-xs font-medium text-gray-600", children: t("my_messages") }), sessionSummary && (_jsx(SessionFolderList, { summary: sessionSummary, activeFolderId: activeFolderId, onFilterSelect: onFilterSelect, allGroups: {
|
|
59
|
+
return (_jsxs("aside", { "aria-label": t("folder_panel_title"), className: `flex flex-col h-full shrink-0 overflow-hidden rounded-xl bg-white ${isOverlay ? "shadow-lg" : "shadow-sm"}`, style: { width: LAYOUT_WIDTHS.folder }, "data-cp-name": "DeskAssignedSession", children: [_jsxs("div", { className: "flex items-center justify-between h-14 pl-4 pr-2 border-b border-gray-25 shrink-0", children: [_jsx("span", { className: "text-base font-bold flex-1 truncate", children: t("desk_brand") }), _jsx(Tooltip, { title: t(isOverlay ? "folder_panel_close" : "folder_panel_collapse"), children: _jsx(Button, { type: "text", className: "text-gray-600 w-8 h-8 p-0 touch:min-h-10 touch:min-w-10", "aria-label": t(isOverlay ? "folder_panel_close" : "folder_panel_collapse"), onClick: () => isOverlay ? setFolderOverlayOpen(false) : setFolderCollapsedChoice(true), children: _jsx(StrokeIcon, { name: isOverlay ? "x" : "chevrons-left", size: 18 }) }) })] }), _jsxs("div", { className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-2 pb-2 pt-1", children: [_jsx("div", { className: "px-2 pb-1 pt-3 text-xs font-medium text-gray-600", children: t("my_messages") }), sessionSummary && (_jsx(SessionFolderList, { summary: sessionSummary, activeFolderId: activeFolderId, onFilterSelect: onFilterSelect, allGroups: {
|
|
60
60
|
active: viewMode === "allGroups",
|
|
61
61
|
onSelect: onAllGroupsSelect,
|
|
62
62
|
} })), _jsx(DeskTeamInbox, {})] })] }));
|
|
@@ -10,7 +10,7 @@ export const FolderCount = ({ count, highlighted, }) => {
|
|
|
10
10
|
return highlighted ? (_jsx("span", { className: "inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full bg-danger-600 px-1.5 text-xs font-semibold tabular-nums text-white", children: formatCount(count) })) : (_jsx("span", { className: "shrink-0 text-xs tabular-nums text-gray-600", children: formatCount(count) }));
|
|
11
11
|
};
|
|
12
12
|
/** One selectable folder in the desk sidebar. */
|
|
13
|
-
const FolderRow = ({ label, iconName, iconClassName, count = 0, highlighted, active = false, indentClassName = "pl-2", onClick, }) => (_jsxs("button", { type: "button", onClick: onClick, "aria-current": active ? "true" : undefined, "data-cp-name": "FolderRow", className: clsx("flex h-9 min-w-0 flex-1 items-center gap-2 rounded-lg pr-2 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-400", indentClassName, active
|
|
13
|
+
const FolderRow = ({ label, iconName, iconClassName, count = 0, highlighted, active = false, indentClassName = "pl-2", onClick, }) => (_jsxs("button", { type: "button", onClick: onClick, "aria-current": active ? "true" : undefined, "data-cp-name": "FolderRow", className: clsx("flex h-9 touch:min-h-10 min-w-0 flex-1 items-center gap-2 rounded-lg pr-2 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-400", indentClassName, active
|
|
14
14
|
? "bg-primary-25 font-semibold text-primary-500"
|
|
15
15
|
: "text-gray-900 hover:bg-gray-5"), children: [_jsx(StrokeIcon, { name: iconName, size: 18, className: iconClassName }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: label }), _jsx(FolderCount, { count: count, highlighted: highlighted })] }));
|
|
16
16
|
export default FolderRow;
|
|
@@ -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;AAIjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;
|
|
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;AAIjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAsBzC,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;IAC7B,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;CACvC;AA0ED,QAAA,MAAM,mBAAmB,GAAI,wFAO1B,wBAAwB,4CA+P1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|