@natoe/colab 0.1.31 → 0.1.36
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/index.d.mts +53 -1
- package/dist/index.d.ts +53 -1
- package/dist/index.js +154 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +154 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -465,6 +465,49 @@ interface CollabInboxProps {
|
|
|
465
465
|
*/
|
|
466
466
|
declare function CollabInbox({ initialConversationId, onSelectConversation, className, style, }: CollabInboxProps): react_jsx_runtime.JSX.Element;
|
|
467
467
|
|
|
468
|
+
interface HelpPanelProps {
|
|
469
|
+
/**
|
|
470
|
+
* The lab's help channel, already resolved by the host from
|
|
471
|
+
* `GET /help_channel`. Required — unlike a case thread there is nothing to
|
|
472
|
+
* look up and nothing to lazily create, so a HelpPanel without a channel has
|
|
473
|
+
* nothing to render.
|
|
474
|
+
*/
|
|
475
|
+
conversation: Conversation;
|
|
476
|
+
/** Show "seen by" under own messages (default true) */
|
|
477
|
+
showSeenBy?: boolean;
|
|
478
|
+
/** Rendered above the composer — the host's case-reference control lives here. */
|
|
479
|
+
composerAccessory?: React.ReactNode;
|
|
480
|
+
className?: string;
|
|
481
|
+
style?: React.CSSProperties;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* The imaging centre's support thread.
|
|
485
|
+
*
|
|
486
|
+
* A deliberately SEPARATE shell from CollabPanel rather than CollabPanel with
|
|
487
|
+
* flags. The two surfaces only look similar — CollabPanel is case-shaped, and
|
|
488
|
+
* serving support through it meant suppressing the patient header, the DICOM
|
|
489
|
+
* button, the open-case action, the participant roster and channel settings one
|
|
490
|
+
* at a time. Every case-oriented feature added another thing to suppress, and
|
|
491
|
+
* missing one is not cosmetic: a roster control that slipped through crashed
|
|
492
|
+
* the whole tree on an unmapped participant role.
|
|
493
|
+
*
|
|
494
|
+
* Building additively instead means a support thread can never inherit a
|
|
495
|
+
* case affordance by accident. What IS shared is the part worth sharing — the
|
|
496
|
+
* engine. useConversation, MessageList and MessageInput are identical here, so
|
|
497
|
+
* socket lifecycle, optimistic sends, read receipts, typing, attachments,
|
|
498
|
+
* audio and pagination all behave exactly as they do on a case thread, with no
|
|
499
|
+
* second implementation to drift.
|
|
500
|
+
*
|
|
501
|
+
* Deliberately absent, and none of it by oversight:
|
|
502
|
+
* - patient / study header — there is no patient
|
|
503
|
+
* - View DICOM, Open case — there is no order
|
|
504
|
+
* - participant roster — the roster is fixed by the backend (this lab
|
|
505
|
+
* plus Natoe support) and is not editable
|
|
506
|
+
* - channel settings — invite / remove / leave do not apply
|
|
507
|
+
* - pinned messages — a support thread is chronological
|
|
508
|
+
*/
|
|
509
|
+
declare function HelpPanel({ conversation, showSeenBy, composerAccessory, className, style, }: HelpPanelProps): react_jsx_runtime.JSX.Element;
|
|
510
|
+
|
|
468
511
|
type MessageCallback = (message: Message) => void;
|
|
469
512
|
type TypingCallback = (event: TypingEvent) => void;
|
|
470
513
|
type ParticipantCallback = (participant: Participant) => void;
|
|
@@ -616,6 +659,15 @@ interface CollabContextValue {
|
|
|
616
659
|
config: CollabConfig;
|
|
617
660
|
apiBaseUrl: string;
|
|
618
661
|
totalUnread: number;
|
|
662
|
+
/**
|
|
663
|
+
* Increments on EVERY `unread_update` push from the user-notifications
|
|
664
|
+
* channel, whether or not the totals changed. `totalUnread` alone cannot
|
|
665
|
+
* signal "something happened": your own sent message never counts toward
|
|
666
|
+
* your unread total, so after you send, the counts arrive unchanged and a
|
|
667
|
+
* value-keyed effect never fires. Consumers that resync on activity (the
|
|
668
|
+
* inbox's last-message previews) should depend on this instead.
|
|
669
|
+
*/
|
|
670
|
+
unreadUpdateSeq: number;
|
|
619
671
|
/**
|
|
620
672
|
* Per-conversation unread counts, keyed by conversation ID. Updated
|
|
621
673
|
* live via the user_notifications channel's unread_update push, so
|
|
@@ -1280,4 +1332,4 @@ declare const SUPPORTED_IMAGE_TYPES: string[];
|
|
|
1280
1332
|
/** Max file size in bytes (20MB) */
|
|
1281
1333
|
declare const MAX_FILE_SIZE: number;
|
|
1282
1334
|
|
|
1283
|
-
export { AUDIO_MIME_TYPE, type ChannelEvent, ChannelSettings, type ChannelUpdatePayload, type CollabConfig, type CollabError, CollabInbox, CollabInline, CollabPanel, CollabPopup, CollabProvider, CollabSocket, type Conversation, type ConversationKind, ConversationList, ConversationListItem, type ConversationListItem$1 as ConversationListItemData, type ConversationPreview, type CreateConversationResponse, DEEP_LINK_PREFIX, EVENTS, type InviteUserPayload, MAX_FILE_SIZE, MAX_PINNED_MESSAGES, MESSAGES_PAGE_SIZE, MESSAGE_TYPES, type Message, MessageActionsMenu, MessageBubble, MessageInput, MessageList, type MessageListHandle, type MessageSnapshot, type MessageType, type Participant, ParticipantsList, type PatientData, PatientHeader, PinnedMessagesBar, type PreviewBatchResponse, ReplyPreview, ReplyQuoteBlock, SUPPORTED_IMAGE_TYPES, SeenByIndicator, type SendMessagePayload, THEME_DEFAULTS, THEME_VAR, TYPING_DEBOUNCE_MS, type Theme, type TypingEvent, type UserRole, applyThemeOverrides, isCaseKind, isHelpKind, useAudioRecorder, useChannelSettings, useCollab, useConversation, useConversationList, useDeepLinks, useInlineCollab, useMessages, usePinnedMessages, useUnreadCount };
|
|
1335
|
+
export { AUDIO_MIME_TYPE, type ChannelEvent, ChannelSettings, type ChannelUpdatePayload, type CollabConfig, type CollabError, CollabInbox, CollabInline, CollabPanel, CollabPopup, CollabProvider, CollabSocket, type Conversation, type ConversationKind, ConversationList, ConversationListItem, type ConversationListItem$1 as ConversationListItemData, type ConversationPreview, type CreateConversationResponse, DEEP_LINK_PREFIX, EVENTS, HelpPanel, type InviteUserPayload, MAX_FILE_SIZE, MAX_PINNED_MESSAGES, MESSAGES_PAGE_SIZE, MESSAGE_TYPES, type Message, MessageActionsMenu, MessageBubble, MessageInput, MessageList, type MessageListHandle, type MessageSnapshot, type MessageType, type Participant, ParticipantsList, type PatientData, PatientHeader, PinnedMessagesBar, type PreviewBatchResponse, ReplyPreview, ReplyQuoteBlock, SUPPORTED_IMAGE_TYPES, SeenByIndicator, type SendMessagePayload, THEME_DEFAULTS, THEME_VAR, TYPING_DEBOUNCE_MS, type Theme, type TypingEvent, type UserRole, applyThemeOverrides, isCaseKind, isHelpKind, useAudioRecorder, useChannelSettings, useCollab, useConversation, useConversationList, useDeepLinks, useInlineCollab, useMessages, usePinnedMessages, useUnreadCount };
|
package/dist/index.d.ts
CHANGED
|
@@ -465,6 +465,49 @@ interface CollabInboxProps {
|
|
|
465
465
|
*/
|
|
466
466
|
declare function CollabInbox({ initialConversationId, onSelectConversation, className, style, }: CollabInboxProps): react_jsx_runtime.JSX.Element;
|
|
467
467
|
|
|
468
|
+
interface HelpPanelProps {
|
|
469
|
+
/**
|
|
470
|
+
* The lab's help channel, already resolved by the host from
|
|
471
|
+
* `GET /help_channel`. Required — unlike a case thread there is nothing to
|
|
472
|
+
* look up and nothing to lazily create, so a HelpPanel without a channel has
|
|
473
|
+
* nothing to render.
|
|
474
|
+
*/
|
|
475
|
+
conversation: Conversation;
|
|
476
|
+
/** Show "seen by" under own messages (default true) */
|
|
477
|
+
showSeenBy?: boolean;
|
|
478
|
+
/** Rendered above the composer — the host's case-reference control lives here. */
|
|
479
|
+
composerAccessory?: React.ReactNode;
|
|
480
|
+
className?: string;
|
|
481
|
+
style?: React.CSSProperties;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* The imaging centre's support thread.
|
|
485
|
+
*
|
|
486
|
+
* A deliberately SEPARATE shell from CollabPanel rather than CollabPanel with
|
|
487
|
+
* flags. The two surfaces only look similar — CollabPanel is case-shaped, and
|
|
488
|
+
* serving support through it meant suppressing the patient header, the DICOM
|
|
489
|
+
* button, the open-case action, the participant roster and channel settings one
|
|
490
|
+
* at a time. Every case-oriented feature added another thing to suppress, and
|
|
491
|
+
* missing one is not cosmetic: a roster control that slipped through crashed
|
|
492
|
+
* the whole tree on an unmapped participant role.
|
|
493
|
+
*
|
|
494
|
+
* Building additively instead means a support thread can never inherit a
|
|
495
|
+
* case affordance by accident. What IS shared is the part worth sharing — the
|
|
496
|
+
* engine. useConversation, MessageList and MessageInput are identical here, so
|
|
497
|
+
* socket lifecycle, optimistic sends, read receipts, typing, attachments,
|
|
498
|
+
* audio and pagination all behave exactly as they do on a case thread, with no
|
|
499
|
+
* second implementation to drift.
|
|
500
|
+
*
|
|
501
|
+
* Deliberately absent, and none of it by oversight:
|
|
502
|
+
* - patient / study header — there is no patient
|
|
503
|
+
* - View DICOM, Open case — there is no order
|
|
504
|
+
* - participant roster — the roster is fixed by the backend (this lab
|
|
505
|
+
* plus Natoe support) and is not editable
|
|
506
|
+
* - channel settings — invite / remove / leave do not apply
|
|
507
|
+
* - pinned messages — a support thread is chronological
|
|
508
|
+
*/
|
|
509
|
+
declare function HelpPanel({ conversation, showSeenBy, composerAccessory, className, style, }: HelpPanelProps): react_jsx_runtime.JSX.Element;
|
|
510
|
+
|
|
468
511
|
type MessageCallback = (message: Message) => void;
|
|
469
512
|
type TypingCallback = (event: TypingEvent) => void;
|
|
470
513
|
type ParticipantCallback = (participant: Participant) => void;
|
|
@@ -616,6 +659,15 @@ interface CollabContextValue {
|
|
|
616
659
|
config: CollabConfig;
|
|
617
660
|
apiBaseUrl: string;
|
|
618
661
|
totalUnread: number;
|
|
662
|
+
/**
|
|
663
|
+
* Increments on EVERY `unread_update` push from the user-notifications
|
|
664
|
+
* channel, whether or not the totals changed. `totalUnread` alone cannot
|
|
665
|
+
* signal "something happened": your own sent message never counts toward
|
|
666
|
+
* your unread total, so after you send, the counts arrive unchanged and a
|
|
667
|
+
* value-keyed effect never fires. Consumers that resync on activity (the
|
|
668
|
+
* inbox's last-message previews) should depend on this instead.
|
|
669
|
+
*/
|
|
670
|
+
unreadUpdateSeq: number;
|
|
619
671
|
/**
|
|
620
672
|
* Per-conversation unread counts, keyed by conversation ID. Updated
|
|
621
673
|
* live via the user_notifications channel's unread_update push, so
|
|
@@ -1280,4 +1332,4 @@ declare const SUPPORTED_IMAGE_TYPES: string[];
|
|
|
1280
1332
|
/** Max file size in bytes (20MB) */
|
|
1281
1333
|
declare const MAX_FILE_SIZE: number;
|
|
1282
1334
|
|
|
1283
|
-
export { AUDIO_MIME_TYPE, type ChannelEvent, ChannelSettings, type ChannelUpdatePayload, type CollabConfig, type CollabError, CollabInbox, CollabInline, CollabPanel, CollabPopup, CollabProvider, CollabSocket, type Conversation, type ConversationKind, ConversationList, ConversationListItem, type ConversationListItem$1 as ConversationListItemData, type ConversationPreview, type CreateConversationResponse, DEEP_LINK_PREFIX, EVENTS, type InviteUserPayload, MAX_FILE_SIZE, MAX_PINNED_MESSAGES, MESSAGES_PAGE_SIZE, MESSAGE_TYPES, type Message, MessageActionsMenu, MessageBubble, MessageInput, MessageList, type MessageListHandle, type MessageSnapshot, type MessageType, type Participant, ParticipantsList, type PatientData, PatientHeader, PinnedMessagesBar, type PreviewBatchResponse, ReplyPreview, ReplyQuoteBlock, SUPPORTED_IMAGE_TYPES, SeenByIndicator, type SendMessagePayload, THEME_DEFAULTS, THEME_VAR, TYPING_DEBOUNCE_MS, type Theme, type TypingEvent, type UserRole, applyThemeOverrides, isCaseKind, isHelpKind, useAudioRecorder, useChannelSettings, useCollab, useConversation, useConversationList, useDeepLinks, useInlineCollab, useMessages, usePinnedMessages, useUnreadCount };
|
|
1335
|
+
export { AUDIO_MIME_TYPE, type ChannelEvent, ChannelSettings, type ChannelUpdatePayload, type CollabConfig, type CollabError, CollabInbox, CollabInline, CollabPanel, CollabPopup, CollabProvider, CollabSocket, type Conversation, type ConversationKind, ConversationList, ConversationListItem, type ConversationListItem$1 as ConversationListItemData, type ConversationPreview, type CreateConversationResponse, DEEP_LINK_PREFIX, EVENTS, HelpPanel, type InviteUserPayload, MAX_FILE_SIZE, MAX_PINNED_MESSAGES, MESSAGES_PAGE_SIZE, MESSAGE_TYPES, type Message, MessageActionsMenu, MessageBubble, MessageInput, MessageList, type MessageListHandle, type MessageSnapshot, type MessageType, type Participant, ParticipantsList, type PatientData, PatientHeader, PinnedMessagesBar, type PreviewBatchResponse, ReplyPreview, ReplyQuoteBlock, SUPPORTED_IMAGE_TYPES, SeenByIndicator, type SendMessagePayload, THEME_DEFAULTS, THEME_VAR, TYPING_DEBOUNCE_MS, type Theme, type TypingEvent, type UserRole, applyThemeOverrides, isCaseKind, isHelpKind, useAudioRecorder, useChannelSettings, useCollab, useConversation, useConversationList, useDeepLinks, useInlineCollab, useMessages, usePinnedMessages, useUnreadCount };
|
package/dist/index.js
CHANGED
|
@@ -607,6 +607,7 @@ function CollabProvider({ config, apiBaseUrl, children }) {
|
|
|
607
607
|
});
|
|
608
608
|
const [unreadCounts, setUnreadCounts] = React4.useState({});
|
|
609
609
|
const [unreadCountsByOrder, setUnreadCountsByOrder] = React4.useState({});
|
|
610
|
+
const [unreadUpdateSeq, setUnreadUpdateSeq] = React4.useState(0);
|
|
610
611
|
const pendingKeys = React4.useRef(/* @__PURE__ */ new Set());
|
|
611
612
|
const pendingResolvers = React4.useRef(/* @__PURE__ */ new Map());
|
|
612
613
|
const previewCache = React4.useRef(/* @__PURE__ */ new Map());
|
|
@@ -625,6 +626,7 @@ function CollabProvider({ config, apiBaseUrl, children }) {
|
|
|
625
626
|
setUnreadCounts(counts.conversation);
|
|
626
627
|
setUnreadCountsByOrder(counts.order);
|
|
627
628
|
previewCache.current.clear();
|
|
629
|
+
setUnreadUpdateSeq((n) => n + 1);
|
|
628
630
|
});
|
|
629
631
|
if (!s.isConnected()) {
|
|
630
632
|
s.connect(config);
|
|
@@ -858,6 +860,7 @@ function CollabProvider({ config, apiBaseUrl, children }) {
|
|
|
858
860
|
config,
|
|
859
861
|
apiBaseUrl,
|
|
860
862
|
totalUnread,
|
|
863
|
+
unreadUpdateSeq,
|
|
861
864
|
unreadCounts,
|
|
862
865
|
unreadCountsByOrder,
|
|
863
866
|
requestPreview,
|
|
@@ -1645,7 +1648,7 @@ function PatientHeader({
|
|
|
1645
1648
|
}
|
|
1646
1649
|
)
|
|
1647
1650
|
] }) : null;
|
|
1648
|
-
const settingsButton = onOpenSettings ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1651
|
+
const settingsButton = onOpenSettings && !isSupportChannel ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1649
1652
|
"button",
|
|
1650
1653
|
{
|
|
1651
1654
|
onClick: onOpenSettings,
|
|
@@ -3937,6 +3940,7 @@ function fallbackName(role) {
|
|
|
3937
3940
|
return "User";
|
|
3938
3941
|
}
|
|
3939
3942
|
}
|
|
3943
|
+
var FALLBACK_ROLE_COLOR = { bg: "#f1f5f9", text: "#64748b" };
|
|
3940
3944
|
function RoleBadge({ role }) {
|
|
3941
3945
|
const colors = {
|
|
3942
3946
|
radiologist: { bg: "#eef2ff", text: "#4f46e5" },
|
|
@@ -3948,8 +3952,8 @@ function RoleBadge({ role }) {
|
|
|
3948
3952
|
admin: { bg: "#f1f5f9", text: "#64748b" }
|
|
3949
3953
|
// slate
|
|
3950
3954
|
};
|
|
3951
|
-
const color = colors[role];
|
|
3952
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { ...styles9.roleBadge, backgroundColor: color.bg, color: color.text }, children: role });
|
|
3955
|
+
const color = colors[role] ?? FALLBACK_ROLE_COLOR;
|
|
3956
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { ...styles9.roleBadge, backgroundColor: color.bg, color: color.text }, children: fallbackName(role) });
|
|
3953
3957
|
}
|
|
3954
3958
|
var styles9 = {
|
|
3955
3959
|
list: {
|
|
@@ -4863,6 +4867,7 @@ function CollabPopup({
|
|
|
4863
4867
|
const previouslyFocused = React4.useRef(null);
|
|
4864
4868
|
const titleId = React4.useId();
|
|
4865
4869
|
const titleText = cleanChannelName(loadedConversation?.name) || (patientData ? buildChannelName(patientData) : "Natoe Support");
|
|
4870
|
+
const isSupportChannel = !patientData;
|
|
4866
4871
|
const handleMouseDown = React4.useCallback(
|
|
4867
4872
|
(e) => {
|
|
4868
4873
|
if (!e.target.closest("[data-drag-handle]")) return;
|
|
@@ -4981,7 +4986,7 @@ function CollabPopup({
|
|
|
4981
4986
|
})()
|
|
4982
4987
|
] }),
|
|
4983
4988
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: styles13.titleActions, children: [
|
|
4984
|
-
loadedConversation && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4989
|
+
loadedConversation && !isSupportChannel && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4985
4990
|
"button",
|
|
4986
4991
|
{
|
|
4987
4992
|
type: "button",
|
|
@@ -5874,7 +5879,7 @@ var styles14 = {
|
|
|
5874
5879
|
}};
|
|
5875
5880
|
function useConversationList(options) {
|
|
5876
5881
|
const enabled = options?.enabled ?? true;
|
|
5877
|
-
const { fetchConversationList, config,
|
|
5882
|
+
const { fetchConversationList, config, unreadUpdateSeq } = useCollab();
|
|
5878
5883
|
const [conversations, setConversations] = React4.useState([]);
|
|
5879
5884
|
const [isLoading, setIsLoading] = React4.useState(enabled);
|
|
5880
5885
|
const [error, setError] = React4.useState(null);
|
|
@@ -5912,15 +5917,16 @@ function useConversationList(options) {
|
|
|
5912
5917
|
if (!enabled) return;
|
|
5913
5918
|
refresh();
|
|
5914
5919
|
}, [enabled, refresh]);
|
|
5915
|
-
const
|
|
5920
|
+
const hasHandledInitialSeqRef = React4.useRef(false);
|
|
5916
5921
|
React4.useEffect(() => {
|
|
5917
5922
|
if (!enabled) return;
|
|
5918
|
-
if (!
|
|
5919
|
-
|
|
5923
|
+
if (!hasHandledInitialSeqRef.current) {
|
|
5924
|
+
hasHandledInitialSeqRef.current = true;
|
|
5920
5925
|
return;
|
|
5921
5926
|
}
|
|
5922
|
-
silentRefresh
|
|
5923
|
-
|
|
5927
|
+
const t = setTimeout(silentRefresh, 250);
|
|
5928
|
+
return () => clearTimeout(t);
|
|
5929
|
+
}, [unreadUpdateSeq, enabled]);
|
|
5924
5930
|
const filter = React4.useCallback(
|
|
5925
5931
|
(query) => {
|
|
5926
5932
|
const q = query.trim().toLowerCase();
|
|
@@ -6687,6 +6693,143 @@ var styles17 = {
|
|
|
6687
6693
|
maxWidth: "320px"
|
|
6688
6694
|
}
|
|
6689
6695
|
};
|
|
6696
|
+
ensureGlobalStyles();
|
|
6697
|
+
function HelpPanel({
|
|
6698
|
+
conversation,
|
|
6699
|
+
showSeenBy = true,
|
|
6700
|
+
composerAccessory,
|
|
6701
|
+
className,
|
|
6702
|
+
style
|
|
6703
|
+
}) {
|
|
6704
|
+
const { config } = useCollab();
|
|
6705
|
+
const { handleDeepLink } = useDeepLinks();
|
|
6706
|
+
const messageListRef = React4.useRef(null);
|
|
6707
|
+
const {
|
|
6708
|
+
messages,
|
|
6709
|
+
typingUsers,
|
|
6710
|
+
isLoading,
|
|
6711
|
+
hasMore,
|
|
6712
|
+
error,
|
|
6713
|
+
replyTo,
|
|
6714
|
+
setReplyTo,
|
|
6715
|
+
sendMessage,
|
|
6716
|
+
retryMessage,
|
|
6717
|
+
sendAudioMessage,
|
|
6718
|
+
sendFileMessage,
|
|
6719
|
+
sendTyping,
|
|
6720
|
+
markAsRead,
|
|
6721
|
+
loadMoreMessages
|
|
6722
|
+
} = useConversation({ conversation, kind: "help_lab" });
|
|
6723
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6724
|
+
"div",
|
|
6725
|
+
{
|
|
6726
|
+
className: [ROOT_CLASS, className].filter(Boolean).join(" "),
|
|
6727
|
+
style: { ...styles18.container, ...style },
|
|
6728
|
+
children: [
|
|
6729
|
+
/* @__PURE__ */ jsxRuntime.jsxs("header", { style: styles18.header, children: [
|
|
6730
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: styles18.avatar, "aria-hidden": "true", children: "N" }),
|
|
6731
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: styles18.headerText, children: [
|
|
6732
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: styles18.title, children: "Natoe Support" }),
|
|
6733
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: styles18.subtitle, children: "Questions about your account, billing or a case" })
|
|
6734
|
+
] })
|
|
6735
|
+
] }),
|
|
6736
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: styles18.error, role: "alert", children: error }),
|
|
6737
|
+
isLoading && messages.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: styles18.loading, children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
6738
|
+
MessageList,
|
|
6739
|
+
{
|
|
6740
|
+
ref: messageListRef,
|
|
6741
|
+
messages,
|
|
6742
|
+
currentUserId: config.userId,
|
|
6743
|
+
showSeenBy,
|
|
6744
|
+
typingUsers,
|
|
6745
|
+
hasMore,
|
|
6746
|
+
isLoading,
|
|
6747
|
+
onLoadMore: loadMoreMessages,
|
|
6748
|
+
onDeepLinkClick: handleDeepLink,
|
|
6749
|
+
onMessageVisible: markAsRead,
|
|
6750
|
+
onReply: setReplyTo,
|
|
6751
|
+
onRetry: retryMessage,
|
|
6752
|
+
pinDisabled: true
|
|
6753
|
+
}
|
|
6754
|
+
),
|
|
6755
|
+
composerAccessory,
|
|
6756
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6757
|
+
MessageInput,
|
|
6758
|
+
{
|
|
6759
|
+
onSendText: sendMessage,
|
|
6760
|
+
onSendAudio: sendAudioMessage,
|
|
6761
|
+
onSendFile: sendFileMessage,
|
|
6762
|
+
onTyping: sendTyping,
|
|
6763
|
+
replyTo,
|
|
6764
|
+
onCancelReply: () => setReplyTo(null),
|
|
6765
|
+
placeholder: "Ask Natoe support\u2026"
|
|
6766
|
+
}
|
|
6767
|
+
)
|
|
6768
|
+
]
|
|
6769
|
+
}
|
|
6770
|
+
);
|
|
6771
|
+
}
|
|
6772
|
+
var styles18 = {
|
|
6773
|
+
container: {
|
|
6774
|
+
display: "flex",
|
|
6775
|
+
flexDirection: "column",
|
|
6776
|
+
height: "100%",
|
|
6777
|
+
minHeight: 0,
|
|
6778
|
+
fontFamily: FONT_STACK,
|
|
6779
|
+
background: COLOR.white
|
|
6780
|
+
},
|
|
6781
|
+
header: {
|
|
6782
|
+
display: "flex",
|
|
6783
|
+
alignItems: "center",
|
|
6784
|
+
gap: SPACE.S3,
|
|
6785
|
+
padding: `${SPACE.S3} ${SPACE.S4}`,
|
|
6786
|
+
borderBottom: `1px solid ${COLOR.neutral200}`,
|
|
6787
|
+
flex: "0 0 auto"
|
|
6788
|
+
},
|
|
6789
|
+
avatar: {
|
|
6790
|
+
flex: "0 0 auto",
|
|
6791
|
+
width: 32,
|
|
6792
|
+
height: 32,
|
|
6793
|
+
borderRadius: RADIUS.full,
|
|
6794
|
+
background: COLOR.primary,
|
|
6795
|
+
color: COLOR.white,
|
|
6796
|
+
display: "flex",
|
|
6797
|
+
alignItems: "center",
|
|
6798
|
+
justifyContent: "center",
|
|
6799
|
+
fontSize: FONT_SIZE.md,
|
|
6800
|
+
fontWeight: FONT_WEIGHT.semibold
|
|
6801
|
+
},
|
|
6802
|
+
headerText: {
|
|
6803
|
+
display: "flex",
|
|
6804
|
+
flexDirection: "column",
|
|
6805
|
+
minWidth: 0
|
|
6806
|
+
},
|
|
6807
|
+
title: {
|
|
6808
|
+
fontSize: FONT_SIZE.md,
|
|
6809
|
+
fontWeight: FONT_WEIGHT.semibold,
|
|
6810
|
+
color: COLOR.neutral900
|
|
6811
|
+
},
|
|
6812
|
+
subtitle: {
|
|
6813
|
+
fontSize: FONT_SIZE.sm,
|
|
6814
|
+
color: COLOR.neutral500,
|
|
6815
|
+
overflow: "hidden",
|
|
6816
|
+
textOverflow: "ellipsis",
|
|
6817
|
+
whiteSpace: "nowrap"
|
|
6818
|
+
},
|
|
6819
|
+
error: {
|
|
6820
|
+
padding: `${SPACE.S2} ${SPACE.S4}`,
|
|
6821
|
+
fontSize: FONT_SIZE.sm,
|
|
6822
|
+
color: COLOR.danger,
|
|
6823
|
+
background: COLOR.dangerBg,
|
|
6824
|
+
flex: "0 0 auto"
|
|
6825
|
+
},
|
|
6826
|
+
loading: {
|
|
6827
|
+
flex: "1 1 auto",
|
|
6828
|
+
display: "flex",
|
|
6829
|
+
alignItems: "center",
|
|
6830
|
+
justifyContent: "center"
|
|
6831
|
+
}
|
|
6832
|
+
};
|
|
6690
6833
|
function useMessages({
|
|
6691
6834
|
conversationId,
|
|
6692
6835
|
initialLimit = MESSAGES_PAGE_SIZE
|
|
@@ -6904,6 +7047,7 @@ exports.ConversationList = ConversationList;
|
|
|
6904
7047
|
exports.ConversationListItem = ConversationListItem;
|
|
6905
7048
|
exports.DEEP_LINK_PREFIX = DEEP_LINK_PREFIX;
|
|
6906
7049
|
exports.EVENTS = EVENTS;
|
|
7050
|
+
exports.HelpPanel = HelpPanel;
|
|
6907
7051
|
exports.MAX_FILE_SIZE = MAX_FILE_SIZE;
|
|
6908
7052
|
exports.MAX_PINNED_MESSAGES = MAX_PINNED_MESSAGES;
|
|
6909
7053
|
exports.MESSAGES_PAGE_SIZE = MESSAGES_PAGE_SIZE;
|