@solexllc/usx-react 0.11.0 → 0.12.0
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/README.md +16 -0
- package/dist/Popover-BzDCTuQM.cjs +984 -0
- package/dist/Popover-LToVWsWc.js +985 -0
- package/dist/chat.cjs +1391 -0
- package/dist/chat.js +1391 -0
- package/dist/index.cjs +4428 -5290
- package/dist/index.js +58 -917
- package/package.json +7 -3
- package/src/chat.js +15 -0
- package/src/components/avatar/Avatar.tsx +54 -16
- package/src/components/avatar/avatar.django-snapshot.html +112 -0
- package/src/components/avatar/avatar.django.html +2 -2
- package/src/components/avatar/avatar.html +25 -0
- package/src/components/avatar/avatar.react-snapshot.html +104 -0
- package/src/components/avatar/config.json +13 -15
- package/src/components/avatar-group/AvatarGroup.tsx +17 -15
- package/src/components/avatar-group/avatar-group.django-snapshot.html +22 -0
- package/src/components/avatar-group/avatar-group.django.html +1 -1
- package/src/components/avatar-group/avatar-group.react-snapshot.html +20 -0
- package/src/components/avatar-group/config.json +2 -2
- package/src/components/back-to-top/BackToTop.tsx +21 -57
- package/src/components/back-to-top/back-to-top.django-snapshot.html +101 -202
- package/src/components/back-to-top/back-to-top.django.html +11 -38
- package/src/components/back-to-top/back-to-top.html +22 -106
- package/src/components/back-to-top/back-to-top.react-snapshot.html +94 -148
- package/src/components/back-to-top/config.json +41 -10
- package/src/components/button/Button.tsx +12 -3
- package/src/components/button/button.django-snapshot.html +18 -0
- package/src/components/button/button.django.html +3 -2
- package/src/components/button/button.react-snapshot.html +16 -0
- package/src/components/button/config.json +11 -2
- package/src/components/callout/callout.django.html +1 -1
- package/src/components/callout/config.json +7 -16
- package/src/components/character-count/CharacterCount.tsx +2 -0
- package/src/components/character-count/character-count.react-snapshot.html +7 -0
- package/src/components/chat/Chat.tsx +575 -0
- package/src/components/chat/README.md +174 -0
- package/src/components/chat/avatarProps.ts +32 -0
- package/src/components/chat/chat.django-snapshot.html +23515 -0
- package/src/components/chat/chat.django.html +75 -0
- package/src/components/chat/chat.html +116 -0
- package/src/components/chat/chat.react-snapshot.html +16895 -0
- package/src/components/chat/config.json +1241 -0
- package/src/components/chat-attachment/ChatAttachment.tsx +39 -0
- package/src/components/chat-attachment/chat-attachment.django.html +24 -0
- package/src/components/chat-attachment/chat-attachment.html +10 -0
- package/src/components/chat-attachment/config.json +27 -0
- package/src/components/chat-attachments/ChatAttachments.tsx +17 -0
- package/src/components/chat-attachments/chat-attachments.django-snapshot.html +58 -0
- package/src/components/chat-attachments/chat-attachments.django.html +10 -0
- package/src/components/chat-attachments/chat-attachments.html +14 -0
- package/src/components/chat-attachments/chat-attachments.react-snapshot.html +46 -0
- package/src/components/chat-attachments/config.json +25 -0
- package/src/components/chat-bubble/ChatBubble.tsx +39 -0
- package/src/components/chat-bubble/ChatFormattedText.tsx +138 -0
- package/src/components/chat-bubble/chat-bubble.django-snapshot.html +128 -0
- package/src/components/chat-bubble/chat-bubble.django.html +19 -0
- package/src/components/chat-bubble/chat-bubble.html +1 -0
- package/src/components/chat-bubble/chat-bubble.react-snapshot.html +118 -0
- package/src/components/chat-bubble/config.json +70 -0
- package/src/components/chat-composer/ChatComposer.tsx +210 -0
- package/src/components/chat-composer/README.md +15 -0
- package/src/components/chat-composer/chat-composer.django-snapshot.html +575 -0
- package/src/components/chat-composer/chat-composer.django.html +77 -0
- package/src/components/chat-composer/chat-composer.html +44 -0
- package/src/components/chat-composer/chat-composer.react-snapshot.html +519 -0
- package/src/components/chat-composer/chat-formatting.django.html +59 -0
- package/src/components/chat-composer/config.json +137 -0
- package/src/components/chat-context/ChatContext.tsx +46 -0
- package/src/components/chat-context/chat-context.django-snapshot.html +35 -0
- package/src/components/chat-context/chat-context.django.html +20 -0
- package/src/components/chat-context/chat-context.html +9 -0
- package/src/components/chat-context/chat-context.react-snapshot.html +30 -0
- package/src/components/chat-context/config.json +36 -0
- package/src/components/chat-controls/ChatControls.tsx +67 -0
- package/src/components/chat-controls/chat-controls.django-snapshot.html +114 -0
- package/src/components/chat-controls/chat-controls.django.html +36 -0
- package/src/components/chat-controls/chat-controls.html +11 -0
- package/src/components/chat-controls/chat-controls.react-snapshot.html +107 -0
- package/src/components/chat-controls/config.json +67 -0
- package/src/components/chat-directory/ChatDirectory.tsx +168 -0
- package/src/components/chat-directory/chat-directory.django-snapshot.html +546 -0
- package/src/components/chat-directory/chat-directory.django.html +14 -0
- package/src/components/chat-directory/chat-directory.html +4 -0
- package/src/components/chat-directory/chat-directory.react-snapshot.html +471 -0
- package/src/components/chat-directory/config.json +242 -0
- package/src/components/chat-directory-item/ChatDirectoryItem.tsx +150 -0
- package/src/components/chat-directory-item/chat-directory-item.django-snapshot.html +281 -0
- package/src/components/chat-directory-item/chat-directory-item.django.html +38 -0
- package/src/components/chat-directory-item/chat-directory-item.html +9 -0
- package/src/components/chat-directory-item/chat-directory-item.react-snapshot.html +249 -0
- package/src/components/chat-directory-item/config.json +103 -0
- package/src/components/chat-history/ChatHistory.tsx +30 -0
- package/src/components/chat-history/chat-history.django-snapshot.html +113 -0
- package/src/components/chat-history/chat-history.django.html +20 -0
- package/src/components/chat-history/chat-history.html +9 -0
- package/src/components/chat-history/chat-history.react-snapshot.html +111 -0
- package/src/components/chat-history/config.json +24 -0
- package/src/components/chat-message/ChatMessage.tsx +148 -0
- package/src/components/chat-message/chat-message.django-snapshot.html +758 -0
- package/src/components/chat-message/chat-message.django.html +56 -0
- package/src/components/chat-message/chat-message.html +12 -0
- package/src/components/chat-message/chat-message.react-snapshot.html +627 -0
- package/src/components/chat-message/config.json +278 -0
- package/src/components/chat-message-actions/ChatMessageActions.tsx +133 -0
- package/src/components/chat-message-actions/chat-message-actions.django-snapshot.html +345 -0
- package/src/components/chat-message-actions/chat-message-actions.django.html +29 -0
- package/src/components/chat-message-actions/chat-message-actions.html +53 -0
- package/src/components/chat-message-actions/chat-message-actions.react-snapshot.html +295 -0
- package/src/components/chat-message-actions/config.json +121 -0
- package/src/components/chat-window/ChatWindow.tsx +133 -0
- package/src/components/chat-window/chat-window.django-snapshot.html +448 -0
- package/src/components/chat-window/chat-window.django.html +39 -0
- package/src/components/chat-window/chat-window.html +26 -0
- package/src/components/chat-window/chat-window.react-snapshot.html +286 -0
- package/src/components/chat-window/config.json +123 -0
- package/src/components/clickable/Clickable.tsx +19 -5
- package/src/components/clickable/clickable.django-snapshot.html +11 -2
- package/src/components/clickable/clickable.django.html +2 -0
- package/src/components/clickable/clickable.react-snapshot.html +10 -2
- package/src/components/clickable/config.json +4 -0
- package/src/components/code/code.django-snapshot.html +25 -18
- package/src/components/code/code.react-snapshot.html +41 -4
- package/src/components/copy-to-clipboard/CopyToClipboard.tsx +2 -7
- package/src/components/copy-to-clipboard/copy-to-clipboard.django-snapshot.html +6 -4
- package/src/components/copy-to-clipboard/copy-to-clipboard.django.html +3 -2
- package/src/components/copy-to-clipboard/copy-to-clipboard.react-snapshot.html +14 -2
- package/src/components/file-list/FileList.tsx +3 -2
- package/src/components/file-list/config.json +5 -0
- package/src/components/file-list/file-list.django-snapshot.html +63 -0
- package/src/components/file-list/file-list.django.html +1 -1
- package/src/components/file-list/file-list.react-snapshot.html +53 -0
- package/src/components/footer/footer.django-snapshot.html +0 -3
- package/src/components/header/header.django-snapshot.html +0 -160
- package/src/components/header/header.django.html +2 -2
- package/src/components/hero/hero.django-snapshot.html +0 -20
- package/src/components/hero/hero.django.html +3 -3
- package/src/components/image/image.django.html +4 -4
- package/src/components/input/Input.tsx +1 -1
- package/src/components/input/config.json +2 -3
- package/src/components/input/input.django-snapshot.html +4 -21
- package/src/components/input/input.django.html +2 -2
- package/src/components/link/Link.tsx +7 -4
- package/src/components/link/config.json +2 -3
- package/src/components/link/link.django-snapshot.html +8 -0
- package/src/components/link/link.django.html +2 -2
- package/src/components/link/link.html +4 -1
- package/src/components/link/link.react-snapshot.html +8 -0
- package/src/components/memorable-date/memorable-date.django-snapshot.html +0 -8
- package/src/components/memorable-date/memorable-date.django.html +2 -2
- package/src/components/misc-banner/misc-banner.django-snapshot.html +12 -12
- package/src/components/misc-banner/misc-banner.django.html +4 -2
- package/src/components/popover/Popover.tsx +60 -9
- package/src/components/popover/PopoverMenu.tsx +33 -15
- package/src/components/popover/config.json +88 -14
- package/src/components/popover/popover-menu.django.html +13 -2
- package/src/components/popover/popover.django-snapshot.html +229 -7
- package/src/components/popover/popover.django.html +3 -2
- package/src/components/popover/popover.react-snapshot.html +127 -4
- package/src/components/process-list/config.json +41 -3
- package/src/components/quote/Quote.tsx +9 -2
- package/src/components/search/Search.tsx +1 -1
- package/src/components/search/config.json +3 -4
- package/src/components/search/search.django-snapshot.html +262 -1684
- package/src/components/search/search.django.html +1 -20
- package/src/components/select/select.django-snapshot.html +7 -7
- package/src/components/select/select.react-snapshot.html +7 -7
- package/src/components/summary/Summary.tsx +4 -2
- package/src/components/summary/config.json +4 -0
- package/src/components/summary/summary.django.html +4 -4
- package/src/components/table/Table.tsx +58 -25
- package/src/components/table/config.json +61 -13
- package/src/components/tag/Tag.tsx +40 -7
- package/src/components/tag/config.json +18 -2
- package/src/components/tag/tag.django-snapshot.html +16 -1
- package/src/components/tag/tag.django.html +12 -6
- package/src/components/tag/tag.html +4 -0
- package/src/components/tag/tag.react-snapshot.html +16 -1
- package/src/components/tag-group/TagGroup.tsx +6 -9
- package/src/components/tag-group/config.json +4 -0
- package/src/components/tag-group/tag-group.django.html +1 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<h3 class="site-preview-heading">Default</h3>
|
|
2
|
+
<div>
|
|
3
|
+
<section id="react-example-history-default" class="usx-chat" style="max-width: 28rem">
|
|
4
|
+
<div data-chat-view="conversation" class="usx-chat__window" style="height: auto">
|
|
5
|
+
<span class="usx-chat__copy-status usa-sr-only" role="status"></span>
|
|
6
|
+
<ol class="usx-chat__messages" aria-busy="false" data-usx-chat-older-cursor="6">
|
|
7
|
+
<li class="usx-chat__older-history">
|
|
8
|
+
<button
|
|
9
|
+
type="button"
|
|
10
|
+
class="usa-button usx-button usa-button--unstyled usx-chat__load-older"
|
|
11
|
+
data-usx-chat-load-older=""
|
|
12
|
+
>
|
|
13
|
+
Load earlier messages
|
|
14
|
+
</button>
|
|
15
|
+
</li>
|
|
16
|
+
<li>
|
|
17
|
+
<div class="usx-chat__bubble"><p>Earlier update 7.</p></div>
|
|
18
|
+
</li>
|
|
19
|
+
<li>
|
|
20
|
+
<div class="usx-chat__bubble"><p>Earlier update 8.</p></div>
|
|
21
|
+
</li>
|
|
22
|
+
<li>
|
|
23
|
+
<div class="usx-chat__bubble"><p>Earlier update 9.</p></div>
|
|
24
|
+
</li>
|
|
25
|
+
</ol>
|
|
26
|
+
</div>
|
|
27
|
+
</section>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<h3 class="site-preview-heading">Loading</h3>
|
|
31
|
+
<div>
|
|
32
|
+
<section id="react-example-history-loading" class="usx-chat" style="max-width: 28rem">
|
|
33
|
+
<div data-chat-view="conversation" class="usx-chat__window" style="height: auto">
|
|
34
|
+
<span class="usx-chat__copy-status usa-sr-only" role="status"></span>
|
|
35
|
+
<ol class="usx-chat__messages" aria-busy="true" data-usx-chat-older-cursor="6">
|
|
36
|
+
<li class="usx-chat__older-history">
|
|
37
|
+
<button
|
|
38
|
+
type="button"
|
|
39
|
+
class="usa-button usx-button usa-button--unstyled usx-chat__load-older"
|
|
40
|
+
disabled=""
|
|
41
|
+
aria-disabled="true"
|
|
42
|
+
data-usx-chat-load-older=""
|
|
43
|
+
>
|
|
44
|
+
Loading earlier messages…
|
|
45
|
+
</button>
|
|
46
|
+
</li>
|
|
47
|
+
<li>
|
|
48
|
+
<div class="usx-chat__bubble"><p>Earlier update 7.</p></div>
|
|
49
|
+
</li>
|
|
50
|
+
<li>
|
|
51
|
+
<div class="usx-chat__bubble"><p>Earlier update 8.</p></div>
|
|
52
|
+
</li>
|
|
53
|
+
<li>
|
|
54
|
+
<div class="usx-chat__bubble"><p>Earlier update 9.</p></div>
|
|
55
|
+
</li>
|
|
56
|
+
</ol>
|
|
57
|
+
</div>
|
|
58
|
+
</section>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<h3 class="site-preview-heading">Error</h3>
|
|
62
|
+
<div>
|
|
63
|
+
<section id="react-example-history-error" class="usx-chat" style="max-width: 28rem">
|
|
64
|
+
<div data-chat-view="conversation" class="usx-chat__window" style="height: auto">
|
|
65
|
+
<span class="usx-chat__copy-status usa-sr-only" role="status"></span>
|
|
66
|
+
<ol class="usx-chat__messages" aria-busy="false" data-usx-chat-older-cursor="6">
|
|
67
|
+
<li class="usx-chat__older-history">
|
|
68
|
+
<button
|
|
69
|
+
type="button"
|
|
70
|
+
class="usa-button usx-button usa-button--unstyled usx-chat__load-older"
|
|
71
|
+
data-usx-chat-load-older=""
|
|
72
|
+
>
|
|
73
|
+
Try again</button
|
|
74
|
+
><span class="usx-chat__history-error" role="alert">Try loading again.</span>
|
|
75
|
+
</li>
|
|
76
|
+
<li>
|
|
77
|
+
<div class="usx-chat__bubble"><p>Earlier update 7.</p></div>
|
|
78
|
+
</li>
|
|
79
|
+
<li>
|
|
80
|
+
<div class="usx-chat__bubble"><p>Earlier update 8.</p></div>
|
|
81
|
+
</li>
|
|
82
|
+
<li>
|
|
83
|
+
<div class="usx-chat__bubble"><p>Earlier update 9.</p></div>
|
|
84
|
+
</li>
|
|
85
|
+
</ol>
|
|
86
|
+
</div>
|
|
87
|
+
</section>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<h3 class="site-preview-heading">Beginning</h3>
|
|
91
|
+
<div>
|
|
92
|
+
<section id="react-example-history-beginning" class="usx-chat" style="max-width: 28rem">
|
|
93
|
+
<div data-chat-view="conversation" class="usx-chat__window" style="height: auto">
|
|
94
|
+
<span class="usx-chat__copy-status usa-sr-only" role="status"></span>
|
|
95
|
+
<ol class="usx-chat__messages" aria-busy="false" data-usx-chat-older-cursor="6">
|
|
96
|
+
<li class="usx-chat__older-history">
|
|
97
|
+
<span class="usx-chat__history-start">Beginning of conversation</span>
|
|
98
|
+
</li>
|
|
99
|
+
<li>
|
|
100
|
+
<div class="usx-chat__bubble"><p>Earlier update 7.</p></div>
|
|
101
|
+
</li>
|
|
102
|
+
<li>
|
|
103
|
+
<div class="usx-chat__bubble"><p>Earlier update 8.</p></div>
|
|
104
|
+
</li>
|
|
105
|
+
<li>
|
|
106
|
+
<div class="usx-chat__bubble"><p>Earlier update 9.</p></div>
|
|
107
|
+
</li>
|
|
108
|
+
</ol>
|
|
109
|
+
</div>
|
|
110
|
+
</section>
|
|
111
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "chat-history",
|
|
3
|
+
"template": "chat-history/chat-history.django.html",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"default": {
|
|
6
|
+
"hasMore": true
|
|
7
|
+
},
|
|
8
|
+
"props": {
|
|
9
|
+
"hasMore": {
|
|
10
|
+
"type": "boolean",
|
|
11
|
+
"description": "Whether earlier messages are available.",
|
|
12
|
+
"default": false
|
|
13
|
+
},
|
|
14
|
+
"loading": {
|
|
15
|
+
"type": "boolean",
|
|
16
|
+
"description": "Whether earlier messages are loading.",
|
|
17
|
+
"default": false
|
|
18
|
+
},
|
|
19
|
+
"error": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "History loading error."
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ClassNames from 'classnames';
|
|
3
|
+
import Avatar from '../avatar/Avatar';
|
|
4
|
+
import chatAvatarProps from '../chat/avatarProps';
|
|
5
|
+
import Alert from '../alert/Alert';
|
|
6
|
+
import Button from '../button/Button';
|
|
7
|
+
import ChatBubble from '../chat-bubble/ChatBubble';
|
|
8
|
+
import ChatMessageActions from '../chat-message-actions/ChatMessageActions';
|
|
9
|
+
import type { ChatParticipant, ChatMessageData, ChatReactionOption } from '../chat/Chat';
|
|
10
|
+
export interface ChatMessageProps {
|
|
11
|
+
id: string;
|
|
12
|
+
message: ChatMessageData;
|
|
13
|
+
participant?: ChatParticipant;
|
|
14
|
+
own?: boolean;
|
|
15
|
+
isThread?: boolean;
|
|
16
|
+
allowForward?: boolean;
|
|
17
|
+
allowThreads?: boolean;
|
|
18
|
+
showCopyMessageAction?: boolean;
|
|
19
|
+
reactionOptions?: ChatReactionOption[];
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default function ChatMessage({
|
|
24
|
+
id,
|
|
25
|
+
message,
|
|
26
|
+
participant,
|
|
27
|
+
own = false,
|
|
28
|
+
isThread = false,
|
|
29
|
+
allowForward = false,
|
|
30
|
+
allowThreads = false,
|
|
31
|
+
showCopyMessageAction = true,
|
|
32
|
+
reactionOptions = [],
|
|
33
|
+
disabled = false,
|
|
34
|
+
}: ChatMessageProps) {
|
|
35
|
+
const name = participant?.name || message.senderId;
|
|
36
|
+
const unconfirmed = Boolean(message.deliveryState);
|
|
37
|
+
const position = unconfirmed ? 'single' : (message.groupPosition ?? 'single');
|
|
38
|
+
const showIdentity = position === 'single' || position === 'first';
|
|
39
|
+
const showTime = position === 'single' || position === 'last';
|
|
40
|
+
const isPanel = message.layout === 'panel';
|
|
41
|
+
const deliveryStatus =
|
|
42
|
+
message.deliveryStatus ?? (message.deliveryState === 'sending' ? 'Sending…' : undefined);
|
|
43
|
+
const availableReactions =
|
|
44
|
+
isPanel || unconfirmed ? [] : (message.reactionOptions ?? reactionOptions ?? []).slice(0, 100);
|
|
45
|
+
const canCopyMessage =
|
|
46
|
+
!isPanel &&
|
|
47
|
+
!unconfirmed &&
|
|
48
|
+
showCopyMessageAction &&
|
|
49
|
+
Boolean(
|
|
50
|
+
(message.exportText ??
|
|
51
|
+
message.text ??
|
|
52
|
+
(typeof message.content === 'string' ? message.content : '')) ||
|
|
53
|
+
message.attachments?.length
|
|
54
|
+
);
|
|
55
|
+
const visibleReplyCount = message.replyCount ?? message.replies?.length ?? 0;
|
|
56
|
+
const canOpenThread = !isPanel && !unconfirmed && !isThread && allowThreads;
|
|
57
|
+
const canForward = !isPanel && !unconfirmed && allowForward;
|
|
58
|
+
return (
|
|
59
|
+
<li
|
|
60
|
+
className={ClassNames('usx-chat__message', `usx-chat__message--${position}`, {
|
|
61
|
+
'usx-chat__message--own': own,
|
|
62
|
+
'usx-chat__message--panel': message.layout === 'panel',
|
|
63
|
+
'usx-chat__message--failed': message.deliveryState === 'failed',
|
|
64
|
+
})}
|
|
65
|
+
data-message-id={message.id}
|
|
66
|
+
data-usx-chat-client-message-id={message.clientMessageId}
|
|
67
|
+
data-usx-chat-delivery-state={message.deliveryState}
|
|
68
|
+
data-sender-name={name}
|
|
69
|
+
data-export-text={message.exportText ?? message.text ?? undefined}
|
|
70
|
+
>
|
|
71
|
+
{showIdentity ? (
|
|
72
|
+
<Avatar {...chatAvatarProps(participant, name)} />
|
|
73
|
+
) : (
|
|
74
|
+
<span className="usx-chat__avatar-space" aria-hidden="true" />
|
|
75
|
+
)}
|
|
76
|
+
<div className="usx-chat__message-body">
|
|
77
|
+
{showIdentity && <span className="usx-chat__sender">{name}</span>}
|
|
78
|
+
<ChatBubble
|
|
79
|
+
text={message.text}
|
|
80
|
+
content={message.content}
|
|
81
|
+
attachments={message.attachments}
|
|
82
|
+
reactions={!isPanel && !unconfirmed ? message.reactions : undefined}
|
|
83
|
+
/>
|
|
84
|
+
{message.deliveryState === 'failed' && (
|
|
85
|
+
<Alert variant="error" noIcon slim className="usx-chat__delivery-error">
|
|
86
|
+
<span>Message not sent.</span>
|
|
87
|
+
{
|
|
88
|
+
<Button
|
|
89
|
+
variant="unstyled"
|
|
90
|
+
className="usx-chat__retry"
|
|
91
|
+
aria-label="Retry sending message"
|
|
92
|
+
data-usx-chat-retry={message.id}
|
|
93
|
+
disabled={disabled}
|
|
94
|
+
>
|
|
95
|
+
Retry
|
|
96
|
+
</Button>
|
|
97
|
+
}
|
|
98
|
+
</Alert>
|
|
99
|
+
)}
|
|
100
|
+
{!isPanel && message.timeLabel && !showTime && (
|
|
101
|
+
<time className="usx-chat__time usa-sr-only" dateTime={message.sentAt}>
|
|
102
|
+
{message.timeLabel}
|
|
103
|
+
</time>
|
|
104
|
+
)}
|
|
105
|
+
{!isPanel &&
|
|
106
|
+
(Boolean(message.timeLabel && showTime) ||
|
|
107
|
+
message.edited ||
|
|
108
|
+
deliveryStatus ||
|
|
109
|
+
(canOpenThread && visibleReplyCount > 0)) && (
|
|
110
|
+
<div className="usx-chat__message-footer">
|
|
111
|
+
{message.timeLabel && showTime && (
|
|
112
|
+
<time className="usx-chat__time" dateTime={message.sentAt}>
|
|
113
|
+
{message.timeLabel}
|
|
114
|
+
</time>
|
|
115
|
+
)}
|
|
116
|
+
{(message.edited || deliveryStatus) && (
|
|
117
|
+
<span className="usx-chat__message-meta">
|
|
118
|
+
{message.edited && 'Edited'}
|
|
119
|
+
{message.edited && deliveryStatus && ' · '}
|
|
120
|
+
{deliveryStatus}
|
|
121
|
+
</span>
|
|
122
|
+
)}
|
|
123
|
+
{canOpenThread && visibleReplyCount > 0 && (
|
|
124
|
+
<Button
|
|
125
|
+
variant="unstyled"
|
|
126
|
+
className="usx-chat__thread-link"
|
|
127
|
+
data-usx-chat-thread={message.id}
|
|
128
|
+
>
|
|
129
|
+
{visibleReplyCount} {visibleReplyCount === 1 ? 'reply' : 'replies'}
|
|
130
|
+
</Button>
|
|
131
|
+
)}
|
|
132
|
+
</div>
|
|
133
|
+
)}
|
|
134
|
+
<ChatMessageActions
|
|
135
|
+
id={id}
|
|
136
|
+
messageId={message.id}
|
|
137
|
+
senderName={name}
|
|
138
|
+
reactions={message.reactions}
|
|
139
|
+
reactionOptions={availableReactions}
|
|
140
|
+
actions={!isPanel && !unconfirmed ? message.actions : undefined}
|
|
141
|
+
canCopy={canCopyMessage}
|
|
142
|
+
canReply={canOpenThread}
|
|
143
|
+
canForward={canForward}
|
|
144
|
+
/>
|
|
145
|
+
</div>
|
|
146
|
+
</li>
|
|
147
|
+
);
|
|
148
|
+
}
|