@layers-app/shared 0.4.5 → 0.4.6
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/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/AppContainer.js +72 -79
- package/dist/components/AppContainer/AppContainer.module.css.js +6 -6
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +24 -22
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +46 -37
- package/dist/components/AppContainer/components/Header.d.ts.map +1 -1
- package/dist/components/AppContainer/components/Header.js +6 -5
- package/dist/components/AppContainer/components/Main.js +4 -4
- package/dist/components/AppContainer/components/SlideAnimation.js +4 -4
- package/dist/components/AppContainer/components/ToolSidebar.d.ts.map +1 -1
- package/dist/components/AppContainer/components/ToolSidebar.js +161 -128
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +131 -121
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.js +59 -56
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +4 -3
- package/dist/components/AppContainer/types.d.ts +1 -0
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +37 -37
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.js +68 -62
- package/dist/components/AttachmentsGalleryModal/helpers.d.ts +8 -0
- package/dist/components/AttachmentsGalleryModal/helpers.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/helpers.js +22 -17
- package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.js +28 -25
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.js +36 -41
- package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
- package/dist/components/AttachmentsPreview/AttachmentsPreview.js +135 -80
- package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +24 -14
- package/dist/components/BouncingLogo/BouncingLogo.d.ts +1 -3
- package/dist/components/BouncingLogo/BouncingLogo.d.ts.map +1 -1
- package/dist/components/BouncingLogo/BouncingLogo.js +14 -20
- package/dist/components/BouncingLogo/BouncingLogo.module.css.js +4 -8
- package/dist/components/Chat/ChatBubble/ChatBubble.module.css.js +5 -5
- package/dist/components/Chat/ChatInput/ChatInput.module.css.js +40 -28
- package/dist/components/Chat/ChatInput/index.d.ts +29 -1
- package/dist/components/Chat/ChatInput/index.d.ts.map +1 -1
- package/dist/components/Chat/ChatInput/index.js +178 -118
- package/dist/components/Chat/ChatInput/smilePlusIcon.d.ts +3 -0
- package/dist/components/Chat/ChatInput/smilePlusIcon.d.ts.map +1 -0
- package/dist/components/Chat/ChatInput/smilePlusIcon.js +49 -0
- package/dist/components/Chat/ChatMessage/ChatMessage.module.css.js +9 -9
- package/dist/components/Chat/ChatMessage/index.d.ts +2 -0
- package/dist/components/Chat/ChatMessage/index.d.ts.map +1 -1
- package/dist/components/Chat/ChatMessage/index.js +136 -118
- package/dist/components/Chat/MediaDocument/MediaDocument.module.css.js +4 -4
- package/dist/components/Chat/MessageActions/index.d.ts +7 -0
- package/dist/components/Chat/MessageActions/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageActions/index.js +33 -30
- package/dist/components/Chat/MessageList/MessageList.module.css.js +14 -10
- package/dist/components/Chat/MessageList/index.d.ts +30 -3
- package/dist/components/Chat/MessageList/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageList/index.js +154 -66
- package/dist/components/Chat/MessageReactions/MessageReactions.module.css.js +7 -7
- package/dist/components/Chat/MessageReactions/index.d.ts +17 -0
- package/dist/components/Chat/MessageReactions/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageReactions/index.js +60 -28
- package/dist/components/Chat/MessageStatus/MessageStatus.module.css.js +6 -4
- package/dist/components/Chat/MessageStatus/index.d.ts +1 -1
- package/dist/components/Chat/MessageStatus/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageStatus/index.js +49 -34
- package/dist/components/CircleColorPicker/CircleColorPicker.d.ts.map +1 -1
- package/dist/components/CircleColorPicker/CircleColorPicker.js +17 -15
- package/dist/components/ColorPicker/ColorPicker.module.css.js +26 -20
- package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerList.js +81 -68
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerToolbar.js +75 -70
- package/dist/components/ColorPicker/icons.js +5 -5
- package/dist/components/ColorPicker/types.d.ts +6 -0
- package/dist/components/ColorPicker/types.d.ts.map +1 -1
- package/dist/components/ColorPicker/types.js +53 -11
- package/dist/components/ColorPicker/useRecentColors.d.ts +3 -1
- package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -1
- package/dist/components/ColorPicker/useRecentColors.js +43 -20
- package/dist/components/EmojiPicker/EmojiPanel.d.ts +2 -1
- package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.js +73 -72
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +16 -1
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.js +121 -86
- package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/IconsPanel.js +28 -25
- package/dist/components/EntityIcon.d.ts +1 -0
- package/dist/components/EntityIcon.d.ts.map +1 -1
- package/dist/components/EntityIcon.js +80 -32
- package/dist/components/ErrorPage/components/Error403.d.ts +5 -1
- package/dist/components/ErrorPage/components/Error403.d.ts.map +1 -1
- package/dist/components/ErrorPage/components/Error403.js +25 -21
- package/dist/components/ErrorPage/index.d.ts +5 -1
- package/dist/components/ErrorPage/index.d.ts.map +1 -1
- package/dist/components/ErrorPage/index.js +17 -10
- package/dist/components/MusicPlayerBar/components/HoverActions.js +28 -28
- package/dist/components/NavMenu/NavMenu.d.ts +7 -1
- package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
- package/dist/components/NavMenu/NavMenu.js +54 -44
- package/dist/components/NavMenu/NavMenu.module.css.js +10 -10
- package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuItem.js +84 -84
- package/dist/components/NavMenu/types.d.ts +4 -0
- package/dist/components/NavMenu/types.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceItem.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceItem.js +16 -14
- package/dist/config/envConfig.d.ts +2 -0
- package/dist/config/envConfig.d.ts.map +1 -1
- package/dist/config/envConfig.js +41 -37
- package/dist/helpers/showNotifications.d.ts +15 -0
- package/dist/helpers/showNotifications.d.ts.map +1 -1
- package/dist/helpers/showNotifications.js +114 -72
- package/dist/helpers/showNotifications.module.css.js +16 -4
- package/dist/hooks/useUiPref.d.ts +2 -0
- package/dist/hooks/useUiPref.d.ts.map +1 -0
- package/dist/hooks/useUiPref.js +80 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +550 -540
- package/dist/lang/locales/ui_en.json.js +1 -1
- package/dist/lang/locales/ui_es.json.js +1 -1
- package/dist/lang/locales/ui_ru.json.js +1 -1
- package/package.json +1 -1
|
@@ -1,121 +1,138 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { AttachmentsPreview as
|
|
4
|
-
import { UserAvatar as
|
|
5
|
-
import { ChatBubble as
|
|
6
|
-
import { MessageActions as
|
|
7
|
-
import { MessageAuthor as
|
|
8
|
-
import { MessageForward as
|
|
9
|
-
import { MessageMeta as
|
|
10
|
-
import { MessageReactions as
|
|
11
|
-
import { MessageReply as
|
|
12
|
-
import { MessageStatus as
|
|
13
|
-
import { getAvatarColor as
|
|
14
|
-
import
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
children:
|
|
1
|
+
import { jsx as e, jsxs as d, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import _, { useMemo as $ } from "react";
|
|
3
|
+
import { AttachmentsPreview as P } from "../../AttachmentsPreview/AttachmentsPreview.js";
|
|
4
|
+
import { UserAvatar as T } from "../../UserAvatar/index.js";
|
|
5
|
+
import { ChatBubble as ee } from "../ChatBubble/index.js";
|
|
6
|
+
import { MessageActions as ae } from "../MessageActions/index.js";
|
|
7
|
+
import { MessageAuthor as te } from "../MessageAuthor/index.js";
|
|
8
|
+
import { MessageForward as se } from "../MessageForward/index.js";
|
|
9
|
+
import { MessageMeta as ie } from "../MessageMeta/index.js";
|
|
10
|
+
import { MessageReactions as re, MAX_MESSAGE_REACTIONS as oe } from "../MessageReactions/index.js";
|
|
11
|
+
import { MessageReply as le } from "../MessageReply/index.js";
|
|
12
|
+
import { MessageStatus as j } from "../MessageStatus/index.js";
|
|
13
|
+
import { getAvatarColor as me } from "../colors.js";
|
|
14
|
+
import t from "./ChatMessage.module.css.js";
|
|
15
|
+
const ce = { cursor: "pointer" }, de = _.memo(
|
|
16
|
+
_.forwardRef(function({
|
|
17
|
+
children: p,
|
|
18
18
|
outgoing: a,
|
|
19
|
-
senderName:
|
|
20
|
-
senderColor:
|
|
21
|
-
avatarName:
|
|
22
|
-
avatarSrc:
|
|
23
|
-
showAvatar:
|
|
24
|
-
timestamp:
|
|
25
|
-
status:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
senderName: o,
|
|
20
|
+
senderColor: n,
|
|
21
|
+
avatarName: g,
|
|
22
|
+
avatarSrc: B,
|
|
23
|
+
showAvatar: K,
|
|
24
|
+
timestamp: M,
|
|
25
|
+
status: l,
|
|
26
|
+
onRetry: h,
|
|
27
|
+
retryLabel: A,
|
|
28
|
+
replyTo: i,
|
|
29
|
+
forwardFrom: u,
|
|
30
|
+
edited: L,
|
|
29
31
|
attachments: r,
|
|
30
|
-
reactions:
|
|
31
|
-
onReactionToggle:
|
|
32
|
-
groupPosition:
|
|
33
|
-
onReaction:
|
|
34
|
-
onReply:
|
|
35
|
-
onEdit:
|
|
36
|
-
onDelete:
|
|
37
|
-
onCopy:
|
|
32
|
+
reactions: m,
|
|
33
|
+
onReactionToggle: O,
|
|
34
|
+
groupPosition: C = "single",
|
|
35
|
+
onReaction: w,
|
|
36
|
+
onReply: b,
|
|
37
|
+
onEdit: v,
|
|
38
|
+
onDelete: f,
|
|
39
|
+
onCopy: x,
|
|
38
40
|
onForward: N,
|
|
39
|
-
onPin:
|
|
40
|
-
onContextMenu:
|
|
41
|
-
onAvatarClick:
|
|
42
|
-
fullWidth:
|
|
43
|
-
noBubble:
|
|
44
|
-
mediaOnly:
|
|
45
|
-
hasMedia:
|
|
46
|
-
id:
|
|
47
|
-
className:
|
|
48
|
-
style:
|
|
41
|
+
onPin: S,
|
|
42
|
+
onContextMenu: z,
|
|
43
|
+
onAvatarClick: k,
|
|
44
|
+
fullWidth: D,
|
|
45
|
+
noBubble: G,
|
|
46
|
+
mediaOnly: U,
|
|
47
|
+
hasMedia: y,
|
|
48
|
+
id: W,
|
|
49
|
+
className: E,
|
|
50
|
+
style: X
|
|
49
51
|
}, Y) {
|
|
50
|
-
const q = !a && !!
|
|
51
|
-
const
|
|
52
|
+
const q = !a && !!o, F = !a && K, H = !!(w || b || v || f || x || N || S), J = $(() => {
|
|
53
|
+
const s = me(n);
|
|
52
54
|
return {
|
|
53
|
-
root: { "--avatar-bg":
|
|
54
|
-
placeholder: { backgroundColor:
|
|
55
|
+
root: { "--avatar-bg": s },
|
|
56
|
+
placeholder: { backgroundColor: s }
|
|
55
57
|
};
|
|
56
|
-
}, [
|
|
57
|
-
() => r?.filter((
|
|
58
|
+
}, [n]), I = m && m.length > 0, Q = (m?.length ?? 0) < oe, V = $(
|
|
59
|
+
() => r?.filter((s) => s.isImage).length ?? 0,
|
|
58
60
|
[r]
|
|
59
|
-
),
|
|
60
|
-
|
|
61
|
+
), c = M ? /* @__PURE__ */ e(
|
|
62
|
+
ie,
|
|
61
63
|
{
|
|
62
|
-
time:
|
|
63
|
-
edited:
|
|
64
|
+
time: M,
|
|
65
|
+
edited: L,
|
|
64
66
|
outgoing: a,
|
|
65
|
-
inReactions:
|
|
66
|
-
children: a &&
|
|
67
|
+
inReactions: I,
|
|
68
|
+
children: a && l && (l === "error" && h ? /* @__PURE__ */ e(
|
|
69
|
+
"span",
|
|
70
|
+
{
|
|
71
|
+
role: "button",
|
|
72
|
+
tabIndex: 0,
|
|
73
|
+
onClick: h,
|
|
74
|
+
onKeyDown: (s) => {
|
|
75
|
+
(s.key === "Enter" || s.key === " ") && (s.preventDefault(), h());
|
|
76
|
+
},
|
|
77
|
+
title: A,
|
|
78
|
+
"aria-label": A,
|
|
79
|
+
"data-testid": "message-retry",
|
|
80
|
+
style: { cursor: "pointer", display: "inline-flex" },
|
|
81
|
+
children: /* @__PURE__ */ e(j, { status: l })
|
|
82
|
+
}
|
|
83
|
+
) : /* @__PURE__ */ e(j, { status: l }))
|
|
67
84
|
}
|
|
68
|
-
) : null,
|
|
69
|
-
q && /* @__PURE__ */ e(
|
|
70
|
-
|
|
71
|
-
|
|
85
|
+
) : null, R = /* @__PURE__ */ d(Z, { children: [
|
|
86
|
+
q && /* @__PURE__ */ e(te, { name: o, color: n }),
|
|
87
|
+
i && /* @__PURE__ */ e(
|
|
88
|
+
le,
|
|
72
89
|
{
|
|
73
|
-
title:
|
|
74
|
-
subtitle:
|
|
75
|
-
color:
|
|
90
|
+
title: i.senderName,
|
|
91
|
+
subtitle: i.text,
|
|
92
|
+
color: i.color,
|
|
76
93
|
outgoing: a,
|
|
77
|
-
onClick:
|
|
94
|
+
onClick: i.onClick
|
|
78
95
|
}
|
|
79
96
|
),
|
|
80
|
-
|
|
81
|
-
|
|
97
|
+
u && /* @__PURE__ */ e(se, { from: u, outgoing: a }),
|
|
98
|
+
U ? /* @__PURE__ */ d(
|
|
82
99
|
"div",
|
|
83
100
|
{
|
|
84
|
-
className:
|
|
101
|
+
className: t.content,
|
|
85
102
|
style: { position: "relative" },
|
|
86
103
|
"data-testid": "chat-message-content",
|
|
87
|
-
"data-has-media":
|
|
104
|
+
"data-has-media": y || void 0,
|
|
88
105
|
"data-media-only": !0,
|
|
89
106
|
children: [
|
|
90
|
-
|
|
91
|
-
|
|
107
|
+
p,
|
|
108
|
+
c && /* @__PURE__ */ e("div", { className: t.mediaOnlyMeta, children: c })
|
|
92
109
|
]
|
|
93
110
|
}
|
|
94
|
-
) : /* @__PURE__ */
|
|
111
|
+
) : /* @__PURE__ */ d(
|
|
95
112
|
"div",
|
|
96
113
|
{
|
|
97
|
-
className:
|
|
114
|
+
className: t.content,
|
|
98
115
|
"data-testid": "chat-message-content",
|
|
99
|
-
"data-has-media":
|
|
100
|
-
"data-single-image":
|
|
116
|
+
"data-has-media": y || void 0,
|
|
117
|
+
"data-single-image": V === 1 || void 0,
|
|
101
118
|
children: [
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
V,
|
|
119
|
+
r && r.length > 0 && /* @__PURE__ */ e("div", { className: t.attachmentsWrap, children: /* @__PURE__ */ e(
|
|
120
|
+
P,
|
|
105
121
|
{
|
|
106
122
|
files: r,
|
|
107
123
|
mode: "view",
|
|
108
124
|
parentIsExisting: !0
|
|
109
125
|
}
|
|
110
126
|
) }),
|
|
111
|
-
|
|
112
|
-
|
|
127
|
+
p,
|
|
128
|
+
I ? /* @__PURE__ */ e(
|
|
129
|
+
re,
|
|
113
130
|
{
|
|
114
|
-
reactions:
|
|
115
|
-
onToggle:
|
|
116
|
-
meta:
|
|
131
|
+
reactions: m,
|
|
132
|
+
onToggle: O,
|
|
133
|
+
meta: c
|
|
117
134
|
}
|
|
118
|
-
) :
|
|
135
|
+
) : c
|
|
119
136
|
]
|
|
120
137
|
}
|
|
121
138
|
)
|
|
@@ -124,55 +141,56 @@ const ie = { cursor: "pointer" }, oe = I.memo(
|
|
|
124
141
|
"div",
|
|
125
142
|
{
|
|
126
143
|
ref: Y,
|
|
127
|
-
className: `${
|
|
144
|
+
className: `${t.messageRow}${E ? ` ${E}` : ""}`,
|
|
128
145
|
"data-outgoing": a || void 0,
|
|
129
|
-
"data-message-id":
|
|
130
|
-
onContextMenu:
|
|
131
|
-
style:
|
|
132
|
-
children: /* @__PURE__ */
|
|
146
|
+
"data-message-id": W,
|
|
147
|
+
onContextMenu: z,
|
|
148
|
+
style: X,
|
|
149
|
+
children: /* @__PURE__ */ d(
|
|
133
150
|
"div",
|
|
134
151
|
{
|
|
135
|
-
className:
|
|
152
|
+
className: t.wrapper,
|
|
136
153
|
"data-outgoing": a || void 0,
|
|
137
|
-
"data-group-position":
|
|
154
|
+
"data-group-position": C,
|
|
138
155
|
children: [
|
|
139
|
-
F ? /* @__PURE__ */ e("div", { className:
|
|
140
|
-
|
|
156
|
+
F ? /* @__PURE__ */ e("div", { className: t.avatar, children: /* @__PURE__ */ e(
|
|
157
|
+
T,
|
|
141
158
|
{
|
|
142
159
|
user: {
|
|
143
|
-
id:
|
|
144
|
-
name:
|
|
145
|
-
avatar:
|
|
160
|
+
id: g || o || "",
|
|
161
|
+
name: g || o,
|
|
162
|
+
avatar: B
|
|
146
163
|
},
|
|
147
164
|
size: 33,
|
|
148
165
|
radius: "xl",
|
|
149
|
-
onClick:
|
|
150
|
-
style:
|
|
151
|
-
styles:
|
|
166
|
+
onClick: k,
|
|
167
|
+
style: k ? ce : void 0,
|
|
168
|
+
styles: J
|
|
152
169
|
}
|
|
153
|
-
) }) : !a && /* @__PURE__ */ e("div", { className:
|
|
154
|
-
|
|
155
|
-
|
|
170
|
+
) }) : !a && /* @__PURE__ */ e("div", { className: t.spacer }),
|
|
171
|
+
G ? R : /* @__PURE__ */ e(
|
|
172
|
+
ee,
|
|
156
173
|
{
|
|
157
174
|
outgoing: a,
|
|
158
|
-
fullWidth:
|
|
159
|
-
groupPosition:
|
|
160
|
-
children:
|
|
175
|
+
fullWidth: D,
|
|
176
|
+
groupPosition: C,
|
|
177
|
+
children: R
|
|
161
178
|
}
|
|
162
179
|
),
|
|
163
|
-
|
|
164
|
-
|
|
180
|
+
H && /* @__PURE__ */ e(
|
|
181
|
+
ae,
|
|
165
182
|
{
|
|
166
|
-
className:
|
|
167
|
-
onReaction:
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
183
|
+
className: t.hoverActions,
|
|
184
|
+
onReaction: w,
|
|
185
|
+
canAddReaction: Q,
|
|
186
|
+
onReply: b,
|
|
187
|
+
onEdit: v,
|
|
188
|
+
onDelete: f,
|
|
189
|
+
onCopy: x,
|
|
172
190
|
onForward: N,
|
|
173
|
-
onPin:
|
|
174
|
-
showEdit: !!
|
|
175
|
-
showDelete: !!
|
|
191
|
+
onPin: S,
|
|
192
|
+
showEdit: !!v,
|
|
193
|
+
showDelete: !!f
|
|
176
194
|
}
|
|
177
195
|
)
|
|
178
196
|
]
|
|
@@ -182,7 +200,7 @@ const ie = { cursor: "pointer" }, oe = I.memo(
|
|
|
182
200
|
);
|
|
183
201
|
})
|
|
184
202
|
);
|
|
185
|
-
|
|
203
|
+
de.displayName = "ChatMessage";
|
|
186
204
|
export {
|
|
187
|
-
|
|
205
|
+
de as ChatMessage
|
|
188
206
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_root_pcicv_1", t = "_downloadButton_pcicv_39", e = "_fileName_pcicv_59", c = "_fileSize_pcicv_75", i = {
|
|
2
2
|
root: o,
|
|
3
3
|
downloadButton: t,
|
|
4
4
|
fileName: e,
|
|
5
|
-
fileSize:
|
|
5
|
+
fileSize: c
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
i as default,
|
|
9
9
|
t as downloadButton,
|
|
10
10
|
e as fileName,
|
|
11
|
-
|
|
11
|
+
c as fileSize,
|
|
12
12
|
o as root
|
|
13
13
|
};
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface MessageActionsProps {
|
|
3
3
|
onReaction?: (emoji: string) => void;
|
|
4
|
+
/**
|
|
5
|
+
* Whether a *new* reaction emoji may still be added. False once the message
|
|
6
|
+
* hit the distinct-reaction cap — we then hide the add-reaction picker
|
|
7
|
+
* entirely (joining an existing reaction is still possible via its pill).
|
|
8
|
+
* Defaults to true. See {@link MAX_MESSAGE_REACTIONS}.
|
|
9
|
+
*/
|
|
10
|
+
canAddReaction?: boolean;
|
|
4
11
|
onReply?: () => void;
|
|
5
12
|
onEdit?: () => void;
|
|
6
13
|
onDelete?: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/MessageActions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAiBxC,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/MessageActions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAiBxC,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,eAAO,MAAM,cAAc,iDA+FzB,CAAC"}
|
|
@@ -1,55 +1,58 @@
|
|
|
1
|
-
import { jsx as e, jsxs as n, Fragment as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as e, jsxs as n, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import w, { useState as v } from "react";
|
|
3
3
|
import { Group as y, ActionIcon as d, Menu as i } from "@mantine/core";
|
|
4
|
-
import { SmileIcon as j, LinkBackwardIcon as
|
|
4
|
+
import { SmileIcon as j, LinkBackwardIcon as A, MoreVerticalIcon as x, Copy01Icon as B, Share08Icon as P, PinIcon as $, Edit02Icon as E, Delete02Icon as O } from "@hugeicons/core-free-icons";
|
|
5
5
|
import { HugeiconsIcon as o } from "@hugeicons/react";
|
|
6
|
-
import { EmojiPicker as
|
|
7
|
-
import { IconEntity as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
10
|
-
onReaction:
|
|
6
|
+
import { EmojiPicker as _ } from "../../EmojiPicker/EmojiPicker.js";
|
|
7
|
+
import { IconEntity as D } from "../../ProjectIcon/ProjectIcon.js";
|
|
8
|
+
import G from "./MessageActions.module.css.js";
|
|
9
|
+
const H = w.memo(function({
|
|
10
|
+
onReaction: t,
|
|
11
|
+
canAddReaction: I = !0,
|
|
11
12
|
onReply: m,
|
|
12
|
-
onEdit:
|
|
13
|
+
onEdit: r,
|
|
13
14
|
onDelete: c,
|
|
14
15
|
onCopy: s,
|
|
15
16
|
onForward: a,
|
|
16
17
|
onPin: l,
|
|
17
18
|
showEdit: h,
|
|
18
19
|
showDelete: p,
|
|
19
|
-
className:
|
|
20
|
-
style:
|
|
20
|
+
className: u,
|
|
21
|
+
style: g
|
|
21
22
|
}) {
|
|
22
|
-
const [
|
|
23
|
-
if (!
|
|
24
|
-
const
|
|
25
|
-
|
|
23
|
+
const [z, k] = v(!1), S = !!(r || c || s || a || l || h || p), C = (f) => {
|
|
24
|
+
if (!t) return;
|
|
25
|
+
const M = D.parse(f);
|
|
26
|
+
t(M?.emoji ?? f);
|
|
26
27
|
};
|
|
27
28
|
return /* @__PURE__ */ e(
|
|
28
29
|
"div",
|
|
29
30
|
{
|
|
30
|
-
className: `${
|
|
31
|
-
style:
|
|
31
|
+
className: `${G.root}${u ? ` ${u}` : ""}`,
|
|
32
|
+
style: g,
|
|
32
33
|
"data-testid": "message-actions",
|
|
33
34
|
children: /* @__PURE__ */ n(y, { gap: 2, wrap: "nowrap", children: [
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
t && I && /* @__PURE__ */ e(
|
|
36
|
+
_,
|
|
36
37
|
{
|
|
37
|
-
onChange:
|
|
38
|
+
onChange: C,
|
|
38
39
|
position: "top-start",
|
|
39
40
|
showRemoveButton: !1,
|
|
40
41
|
showIcons: !1,
|
|
42
|
+
showRandomButton: !1,
|
|
43
|
+
withinPortal: !0,
|
|
41
44
|
children: /* @__PURE__ */ e(d, { variant: "subtle", color: "gray", size: 22, radius: 8, "aria-label": "Add reaction", children: /* @__PURE__ */ e(o, { icon: j, size: 16 }) })
|
|
42
45
|
}
|
|
43
46
|
),
|
|
44
|
-
m && /* @__PURE__ */ e(d, { variant: "subtle", color: "gray", size: 22, radius: 8, onClick: m, "aria-label": "Reply", children: /* @__PURE__ */ e(o, { icon:
|
|
45
|
-
|
|
46
|
-
/* @__PURE__ */ e(i.Target, { children: /* @__PURE__ */ e(d, { variant: "subtle", color: "gray", size: 22, radius: 8, "aria-label": "More actions", children: /* @__PURE__ */ e(o, { icon:
|
|
47
|
+
m && /* @__PURE__ */ e(d, { variant: "subtle", color: "gray", size: 22, radius: 8, onClick: m, "aria-label": "Reply", children: /* @__PURE__ */ e(o, { icon: A, size: 16 }) }),
|
|
48
|
+
S && /* @__PURE__ */ n(i, { position: "bottom-end", withinPortal: !0, shadow: "md", width: 200, opened: z, onChange: k, children: [
|
|
49
|
+
/* @__PURE__ */ e(i.Target, { children: /* @__PURE__ */ e(d, { variant: "subtle", color: "gray", size: 22, radius: 8, "aria-label": "More actions", children: /* @__PURE__ */ e(o, { icon: x, size: 16 }) }) }),
|
|
47
50
|
/* @__PURE__ */ n(i.Dropdown, { children: [
|
|
48
|
-
s && /* @__PURE__ */ e(i.Item, { leftSection: /* @__PURE__ */ e(o, { icon:
|
|
49
|
-
a && /* @__PURE__ */ e(i.Item, { leftSection: /* @__PURE__ */ e(o, { icon:
|
|
50
|
-
l && /* @__PURE__ */ e(i.Item, { leftSection: /* @__PURE__ */ e(o, { icon:
|
|
51
|
-
(h ||
|
|
52
|
-
(p || c) && /* @__PURE__ */ n(
|
|
51
|
+
s && /* @__PURE__ */ e(i.Item, { leftSection: /* @__PURE__ */ e(o, { icon: B, size: 16 }), onClick: s, children: "Copy" }),
|
|
52
|
+
a && /* @__PURE__ */ e(i.Item, { leftSection: /* @__PURE__ */ e(o, { icon: P, size: 16 }), onClick: a, children: "Forward" }),
|
|
53
|
+
l && /* @__PURE__ */ e(i.Item, { leftSection: /* @__PURE__ */ e(o, { icon: $, size: 16 }), onClick: l, children: "Pin" }),
|
|
54
|
+
(h || r) && /* @__PURE__ */ e(i.Item, { leftSection: /* @__PURE__ */ e(o, { icon: E, size: 16 }), onClick: r, children: "Edit" }),
|
|
55
|
+
(p || c) && /* @__PURE__ */ n(b, { children: [
|
|
53
56
|
/* @__PURE__ */ e(i.Divider, {}),
|
|
54
57
|
/* @__PURE__ */ e(i.Item, { color: "red", leftSection: /* @__PURE__ */ e(o, { icon: O, size: 16 }), onClick: c, children: "Delete" })
|
|
55
58
|
] })
|
|
@@ -59,7 +62,7 @@ const G = b.memo(function({
|
|
|
59
62
|
}
|
|
60
63
|
);
|
|
61
64
|
});
|
|
62
|
-
|
|
65
|
+
H.displayName = "MessageActions";
|
|
63
66
|
export {
|
|
64
|
-
|
|
67
|
+
H as MessageActions
|
|
65
68
|
};
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_container_r29um_1", t = "_root_r29um_31", r = "_wrapper_r29um_45", _ = "_top_r29um_55", c = "_items_r29um_55", n = "_scrollToBottomWrap_r29um_99", s = "_floatingTopAction_r29um_119", a = "_scrollToBottomBadge_r29um_149", l = {
|
|
2
2
|
container: o,
|
|
3
3
|
root: t,
|
|
4
|
-
wrapper:
|
|
5
|
-
top:
|
|
6
|
-
items:
|
|
7
|
-
|
|
4
|
+
wrapper: r,
|
|
5
|
+
top: _,
|
|
6
|
+
items: c,
|
|
7
|
+
scrollToBottomWrap: n,
|
|
8
|
+
floatingTopAction: s,
|
|
9
|
+
scrollToBottomBadge: a
|
|
8
10
|
};
|
|
9
11
|
export {
|
|
10
12
|
o as container,
|
|
11
|
-
|
|
12
|
-
s as
|
|
13
|
+
l as default,
|
|
14
|
+
s as floatingTopAction,
|
|
15
|
+
c as items,
|
|
13
16
|
t as root,
|
|
14
|
-
a as
|
|
15
|
-
|
|
16
|
-
_ as
|
|
17
|
+
a as scrollToBottomBadge,
|
|
18
|
+
n as scrollToBottomWrap,
|
|
19
|
+
_ as top,
|
|
20
|
+
r as wrapper
|
|
17
21
|
};
|
|
@@ -4,9 +4,36 @@ export interface MessageListProps {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
style?: React.CSSProperties;
|
|
6
6
|
stickToBottom?: boolean;
|
|
7
|
+
unreadCount?: number;
|
|
8
|
+
onStickChange?: (stuck: boolean) => void;
|
|
9
|
+
resetKey?: string | null;
|
|
10
|
+
/**
|
|
11
|
+
* Called when the user scrolls near the top — used to load an older page of
|
|
12
|
+
* history. Should resolve once the older messages have been prepended; the
|
|
13
|
+
* list preserves the visual scroll position across the prepend.
|
|
14
|
+
*/
|
|
15
|
+
onReachTop?: () => void | Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Floating control pinned bottom-right, stacked ABOVE the scroll-to-bottom
|
|
18
|
+
* arrow (e.g. the "jump to mention" button). Shown independently of the
|
|
19
|
+
* arrow — it raises above the arrow when the arrow is visible, otherwise
|
|
20
|
+
* sits at the arrow's spot.
|
|
21
|
+
*/
|
|
22
|
+
floatingTopAction?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Lift the floating controls (scroll-to-bottom arrow + floatingTopAction) up
|
|
25
|
+
* by this many px — so a composer that overlays the list bottom (frosted
|
|
26
|
+
* floating input) doesn't sit on top of them.
|
|
27
|
+
*/
|
|
28
|
+
bottomOffset?: number;
|
|
7
29
|
}
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
30
|
+
export interface MessageListHandle {
|
|
31
|
+
/**
|
|
32
|
+
* Snap to the latest message and re-arm bottom-stick. Hosts call this when
|
|
33
|
+
* the local user sends a message so the view jumps to their just-sent
|
|
34
|
+
* content even if they had scrolled up — matching Telegram/Slack behavior.
|
|
35
|
+
*/
|
|
36
|
+
scrollToBottom: () => void;
|
|
11
37
|
}
|
|
38
|
+
export declare const MessageList: React.ForwardRefExoticComponent<MessageListProps & React.RefAttributes<MessageListHandle>>;
|
|
12
39
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/MessageList/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/MessageList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAQf,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,eAAO,MAAM,WAAW,4FAoOvB,CAAC"}
|