@layers-app/shared 0.4.4 → 0.4.5
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/AnimatedFigurePage/AnimatedFigurePage.module.css.js +13 -13
- package/dist/components/AppContainer/AppContainer.module.css.js +1 -1
- package/dist/components/AppContainer/components/SidebarToggleButton.d.ts.map +1 -1
- package/dist/components/AppContainer/components/SidebarToggleButton.js +25 -16
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +1 -1
- package/dist/components/AppShell/AppShell.module.css.js +5 -5
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.js +33 -33
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.js +54 -36
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts +2 -0
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.js +82 -41
- package/dist/components/AttachmentsGalleryModal/styles.module.css.js +7 -7
- package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
- package/dist/components/AttachmentsPreview/AttachmentsPreview.js +11 -12
- package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +1 -1
- package/dist/components/BouncingLogo/BouncingLogo.module.css.js +8 -8
- package/dist/components/Chat/CallMessage/CallMessage.module.css.js +15 -0
- package/dist/components/Chat/CallMessage/index.d.ts +21 -0
- package/dist/components/Chat/CallMessage/index.d.ts.map +1 -0
- package/dist/components/Chat/CallMessage/index.js +49 -0
- package/dist/components/Chat/ChatBubble/ChatBubble.module.css.js +9 -0
- package/dist/components/Chat/ChatBubble/index.d.ts +14 -0
- package/dist/components/Chat/ChatBubble/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatBubble/index.js +32 -0
- package/dist/components/Chat/ChatHeader/ChatHeader.module.css.js +17 -0
- package/dist/components/Chat/ChatHeader/index.d.ts +42 -0
- package/dist/components/Chat/ChatHeader/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatHeader/index.js +78 -0
- package/dist/components/Chat/ChatInput/ChatInput.module.css.js +37 -0
- package/dist/components/Chat/ChatInput/index.d.ts +46 -0
- package/dist/components/Chat/ChatInput/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatInput/index.js +228 -0
- package/dist/components/Chat/ChatLayout/ChatLayout.module.css.js +15 -0
- package/dist/components/Chat/ChatLayout/index.d.ts +17 -0
- package/dist/components/Chat/ChatLayout/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatLayout/index.js +43 -0
- package/dist/components/Chat/ChatMessage/ChatMessage.module.css.js +21 -0
- package/dist/components/Chat/ChatMessage/index.d.ts +45 -0
- package/dist/components/Chat/ChatMessage/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatMessage/index.js +188 -0
- package/dist/components/Chat/ChatPill/ChatPill.module.css.js +11 -0
- package/dist/components/Chat/ChatPill/index.d.ts +12 -0
- package/dist/components/Chat/ChatPill/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatPill/index.js +21 -0
- package/dist/components/Chat/DayMeta/index.d.ts +11 -0
- package/dist/components/Chat/DayMeta/index.d.ts.map +1 -0
- package/dist/components/Chat/DayMeta/index.js +9 -0
- package/dist/components/Chat/DialogItem/DialogItem.module.css.js +17 -0
- package/dist/components/Chat/DialogItem/index.d.ts +41 -0
- package/dist/components/Chat/DialogItem/index.d.ts.map +1 -0
- package/dist/components/Chat/DialogItem/index.js +107 -0
- package/dist/components/Chat/DialogList/DialogList.module.css.js +7 -0
- package/dist/components/Chat/DialogList/index.d.ts +11 -0
- package/dist/components/Chat/DialogList/index.d.ts.map +1 -0
- package/dist/components/Chat/DialogList/index.js +19 -0
- package/dist/components/Chat/MediaDocument/MediaDocument.module.css.js +13 -0
- package/dist/components/Chat/MediaDocument/index.d.ts +15 -0
- package/dist/components/Chat/MediaDocument/index.d.ts.map +1 -0
- package/dist/components/Chat/MediaDocument/index.js +73 -0
- package/dist/components/Chat/MessageActions/MessageActions.module.css.js +7 -0
- package/dist/components/Chat/MessageActions/index.d.ts +16 -0
- package/dist/components/Chat/MessageActions/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageActions/index.js +65 -0
- package/dist/components/Chat/MessageAuthor/index.d.ts +20 -0
- package/dist/components/Chat/MessageAuthor/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageAuthor/index.js +36 -0
- package/dist/components/Chat/MessageForward/MessageForward.module.css.js +7 -0
- package/dist/components/Chat/MessageForward/index.d.ts +13 -0
- package/dist/components/Chat/MessageForward/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageForward/index.js +30 -0
- package/dist/components/Chat/MessageList/MessageList.module.css.js +17 -0
- package/dist/components/Chat/MessageList/index.d.ts +12 -0
- package/dist/components/Chat/MessageList/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageList/index.js +71 -0
- package/dist/components/Chat/MessageMeta/MessageMeta.module.css.js +13 -0
- package/dist/components/Chat/MessageMeta/index.d.ts +16 -0
- package/dist/components/Chat/MessageMeta/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageMeta/index.js +33 -0
- package/dist/components/Chat/MessageReactions/MessageReactions.module.css.js +15 -0
- package/dist/components/Chat/MessageReactions/index.d.ts +15 -0
- package/dist/components/Chat/MessageReactions/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageReactions/index.js +40 -0
- package/dist/components/Chat/MessageReply/MessageReply.module.css.js +15 -0
- package/dist/components/Chat/MessageReply/index.d.ts +15 -0
- package/dist/components/Chat/MessageReply/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageReply/index.js +40 -0
- package/dist/components/Chat/MessageStatus/MessageStatus.module.css.js +9 -0
- package/dist/components/Chat/MessageStatus/index.d.ts +14 -0
- package/dist/components/Chat/MessageStatus/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageStatus/index.js +53 -0
- package/dist/components/Chat/ServiceMessage/ServiceMessage.module.css.js +11 -0
- package/dist/components/Chat/ServiceMessage/index.d.ts +13 -0
- package/dist/components/Chat/ServiceMessage/index.d.ts.map +1 -0
- package/dist/components/Chat/ServiceMessage/index.js +21 -0
- package/dist/components/Chat/UnreadSeparator/index.d.ts +11 -0
- package/dist/components/Chat/UnreadSeparator/index.d.ts.map +1 -0
- package/dist/components/Chat/UnreadSeparator/index.js +13 -0
- package/dist/components/Chat/colors.d.ts +7 -0
- package/dist/components/Chat/colors.d.ts.map +1 -0
- package/dist/components/Chat/colors.js +30 -0
- package/dist/components/Chat/icons.d.ts +9 -0
- package/dist/components/Chat/icons.d.ts.map +1 -0
- package/dist/components/Chat/icons.js +49 -0
- package/dist/components/Chat/index.d.ts +24 -0
- package/dist/components/Chat/index.d.ts.map +1 -0
- package/dist/components/Chat/mock-data.d.ts +32 -0
- package/dist/components/Chat/mock-data.d.ts.map +1 -0
- package/dist/components/Chat/types.d.ts +159 -0
- package/dist/components/Chat/types.d.ts.map +1 -0
- package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
- package/dist/components/ColorPicker/ColorPicker.module.css.js +24 -24
- package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
- package/dist/components/CommentComposer/types.js +9 -0
- package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
- package/dist/components/Copyright/Copyright.module.css.js +1 -1
- package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +8 -1
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.js +53 -50
- package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
- package/dist/components/EntityIcon.d.ts.map +1 -1
- package/dist/components/EntityIcon.js +36 -27
- package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
- package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
- package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
- package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePicker.js +135 -161
- package/dist/components/FilePicker/FilePicker.module.css.js +8 -12
- package/dist/components/FilePicker/FilePickerGallery.js +13 -13
- package/dist/components/FilePicker/FilePickerGiphy.js +4 -4
- package/dist/components/FilePicker/FilePickerGoogleDrive.js +3 -3
- package/dist/components/FilePicker/FilePickerUnsplash.js +18 -18
- package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUpload.js +55 -47
- package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
- package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
- package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
- package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
- package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +11 -11
- package/dist/components/LanguagePicker/LanguagePicker.module.css.js +1 -1
- package/dist/components/Loaders/styles.module.css.js +6 -6
- package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
- package/dist/components/MusicPlayerBar/MusicPlayerBar.module.css.js +23 -23
- package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
- package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
- package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
- package/dist/components/Notification/Notification.module.css.js +1 -1
- package/dist/components/PillTabs/PillTabs.d.ts +19 -0
- package/dist/components/PillTabs/PillTabs.d.ts.map +1 -0
- package/dist/components/PillTabs/PillTabs.js +50 -0
- package/dist/components/PillTabs/PillTabs.module.css.js +11 -0
- package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
- package/dist/components/SettingsSection/styles.module.css.js +1 -1
- package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
- package/dist/components/TreeIndent/TreeIndent.module.css.js +4 -4
- package/dist/components/modals/RemoveConfirmModal.js +1 -1
- package/dist/components/table/FrontTable.d.ts.map +1 -1
- package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
- package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
- package/dist/helpers/showNotifications.module.css.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +573 -522
- package/dist/lang/locales/ui_en.json.js +5 -5
- package/dist/lang/locales/ui_es.json.js +1 -1
- package/dist/lang/locales/ui_ru.json.js +1 -1
- package/docs/README.md +499 -499
- package/package.json +78 -75
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface DialogItemProps {
|
|
3
|
+
/** Chat title / name */
|
|
4
|
+
title: string;
|
|
5
|
+
/** Avatar image source */
|
|
6
|
+
avatarSrc?: string;
|
|
7
|
+
/** Avatar color index 1-7 */
|
|
8
|
+
avatarColor?: 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
9
|
+
/** Last message text */
|
|
10
|
+
lastMessage?: string;
|
|
11
|
+
/** Last message sender name (for groups) */
|
|
12
|
+
lastMessageSender?: string;
|
|
13
|
+
/** Timestamp string ("12:45", "Mon") */
|
|
14
|
+
timestamp?: string;
|
|
15
|
+
/** Unread messages count */
|
|
16
|
+
unreadCount?: number;
|
|
17
|
+
/** Muted chat */
|
|
18
|
+
muted?: boolean;
|
|
19
|
+
/** Online indicator */
|
|
20
|
+
online?: boolean;
|
|
21
|
+
/** Typing status text */
|
|
22
|
+
typing?: string;
|
|
23
|
+
/** Pinned chat */
|
|
24
|
+
pinned?: boolean;
|
|
25
|
+
/** Draft text */
|
|
26
|
+
draft?: string;
|
|
27
|
+
/** Verified badge */
|
|
28
|
+
verified?: boolean;
|
|
29
|
+
/** Selected state */
|
|
30
|
+
selected?: boolean;
|
|
31
|
+
/** Click handler */
|
|
32
|
+
onClick?: () => void;
|
|
33
|
+
/** Context menu handler */
|
|
34
|
+
onContextMenu?: (e: React.MouseEvent) => void;
|
|
35
|
+
/** Custom style */
|
|
36
|
+
style?: React.CSSProperties;
|
|
37
|
+
/** Custom className */
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare const DialogItem: React.NamedExoticComponent<DialogItemProps>;
|
|
41
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/DialogItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAMpD,MAAM,WAAW,eAAe;IAC9B,wBAAwB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6BAA6B;IAC7B,WAAW,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxC,wBAAwB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,uBAAuB;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yBAAyB;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,2BAA2B;IAC3B,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC9C,mBAAmB;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,UAAU,6CAoIrB,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t, Fragment as K } from "react/jsx-runtime";
|
|
2
|
+
import R, { useCallback as W, useMemo as g } from "react";
|
|
3
|
+
import { Badge as _, Indicator as E, Stack as F, Group as x, Text as y, Avatar as G } from "@mantine/core";
|
|
4
|
+
import { getAvatarColor as O } from "../colors.js";
|
|
5
|
+
import { VerifiedIcon as P, MutedIcon as T } from "../icons.js";
|
|
6
|
+
import r from "./DialogItem.module.css.js";
|
|
7
|
+
const V = R.memo(function({
|
|
8
|
+
title: c,
|
|
9
|
+
avatarSrc: I,
|
|
10
|
+
avatarColor: f = 1,
|
|
11
|
+
lastMessage: s,
|
|
12
|
+
lastMessageSender: d,
|
|
13
|
+
timestamp: p,
|
|
14
|
+
unreadCount: o,
|
|
15
|
+
muted: m,
|
|
16
|
+
online: N,
|
|
17
|
+
typing: l,
|
|
18
|
+
pinned: h,
|
|
19
|
+
draft: i,
|
|
20
|
+
verified: D,
|
|
21
|
+
selected: z,
|
|
22
|
+
onClick: a,
|
|
23
|
+
onContextMenu: B,
|
|
24
|
+
style: k,
|
|
25
|
+
className: b
|
|
26
|
+
}) {
|
|
27
|
+
const u = o != null && o > 0 || h, v = l || i || s, S = W(
|
|
28
|
+
(n) => {
|
|
29
|
+
n.key === "Enter" && a && a();
|
|
30
|
+
},
|
|
31
|
+
[a]
|
|
32
|
+
), $ = g(() => {
|
|
33
|
+
const n = O(f);
|
|
34
|
+
return {
|
|
35
|
+
root: { "--avatar-bg": n },
|
|
36
|
+
placeholder: { backgroundColor: n }
|
|
37
|
+
};
|
|
38
|
+
}, [f]), w = /* @__PURE__ */ e(
|
|
39
|
+
G,
|
|
40
|
+
{
|
|
41
|
+
src: I,
|
|
42
|
+
name: c,
|
|
43
|
+
size: 54,
|
|
44
|
+
radius: "xl",
|
|
45
|
+
styles: $
|
|
46
|
+
}
|
|
47
|
+
), j = g(() => {
|
|
48
|
+
if (!u) return null;
|
|
49
|
+
const n = h && (!o || o <= 0), C = m || n ? "var(--mantine-color-gray-4)" : "var(--mantine-color-green-6)", H = o != null && o > 999 ? "999+" : o;
|
|
50
|
+
return /* @__PURE__ */ e(
|
|
51
|
+
_,
|
|
52
|
+
{
|
|
53
|
+
size: "md",
|
|
54
|
+
radius: "xl",
|
|
55
|
+
variant: "filled",
|
|
56
|
+
styles: {
|
|
57
|
+
root: { backgroundColor: C, minWidth: 24, minHeight: 24, paddingInline: 6 },
|
|
58
|
+
label: { fontSize: 14, fontWeight: 500, lineHeight: "normal" }
|
|
59
|
+
},
|
|
60
|
+
children: n ? "📌" : H
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}, [u, h, o, m]), A = g(() => l ? /* @__PURE__ */ e("span", { className: r.dialogContent, style: { color: "var(--mantine-color-blue-6, #228be6)" }, children: l }) : v ? /* @__PURE__ */ t("span", { className: r.dialogContent, children: [
|
|
64
|
+
i && /* @__PURE__ */ e("span", { className: r.dialogContentDraft, children: "Draft: " }),
|
|
65
|
+
d && !i && /* @__PURE__ */ t(K, { children: [
|
|
66
|
+
/* @__PURE__ */ e("span", { className: r.dialogContentSender, children: d }),
|
|
67
|
+
": "
|
|
68
|
+
] }),
|
|
69
|
+
i || s
|
|
70
|
+
] }) : null, [l, i, s, d, v]);
|
|
71
|
+
return /* @__PURE__ */ t(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
className: `${r.root}${b ? ` ${b}` : ""}`,
|
|
75
|
+
"data-selected": z || void 0,
|
|
76
|
+
"data-testid": "dialog-item",
|
|
77
|
+
"aria-label": c,
|
|
78
|
+
onClick: a,
|
|
79
|
+
onContextMenu: B,
|
|
80
|
+
onKeyDown: S,
|
|
81
|
+
tabIndex: 0,
|
|
82
|
+
role: "button",
|
|
83
|
+
style: k,
|
|
84
|
+
children: [
|
|
85
|
+
N ? /* @__PURE__ */ e(E, { inline: !0, size: 14, offset: 4, position: "bottom-end", color: "green", withBorder: !0, processing: !1, children: w }) : w,
|
|
86
|
+
/* @__PURE__ */ e("div", { className: r.textContent, children: /* @__PURE__ */ t(F, { gap: 2, children: [
|
|
87
|
+
/* @__PURE__ */ t(x, { gap: 4, wrap: "nowrap", children: [
|
|
88
|
+
/* @__PURE__ */ t("div", { className: r.titleRow, children: [
|
|
89
|
+
/* @__PURE__ */ e(y, { size: "md", fw: 600, truncate: !0, children: c }),
|
|
90
|
+
D && /* @__PURE__ */ e(P, {}),
|
|
91
|
+
m && /* @__PURE__ */ e(T, {})
|
|
92
|
+
] }),
|
|
93
|
+
p && /* @__PURE__ */ e(y, { size: "xs", c: "dimmed", style: { flexShrink: 0 }, children: p })
|
|
94
|
+
] }),
|
|
95
|
+
/* @__PURE__ */ t(x, { gap: 4, wrap: "nowrap", children: [
|
|
96
|
+
A,
|
|
97
|
+
j
|
|
98
|
+
] })
|
|
99
|
+
] }) })
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
});
|
|
104
|
+
V.displayName = "DialogItem";
|
|
105
|
+
export {
|
|
106
|
+
V as DialogItem
|
|
107
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface DialogListProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
}
|
|
7
|
+
export declare function DialogList({ children, className, style }: DialogListProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare namespace DialogList {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/DialogList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,eAAe,2CAazE;yBAbe,UAAU"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { ScrollArea as a } from "@mantine/core";
|
|
3
|
+
import l from "./DialogList.module.css.js";
|
|
4
|
+
function e({ children: i, className: t, style: r }) {
|
|
5
|
+
return /* @__PURE__ */ o(
|
|
6
|
+
a,
|
|
7
|
+
{
|
|
8
|
+
className: `${l.root}${t ? ` ${t}` : ""}`,
|
|
9
|
+
style: r,
|
|
10
|
+
type: "auto",
|
|
11
|
+
"data-testid": "dialog-list",
|
|
12
|
+
children: /* @__PURE__ */ o("div", { role: "listbox", "aria-label": "Chats", children: i })
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
e.displayName = "DialogList";
|
|
17
|
+
export {
|
|
18
|
+
e as DialogList
|
|
19
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const o = "_root_67dvs_1", t = "_downloadButton_67dvs_31", e = "_fileName_67dvs_51", s = "_fileSize_67dvs_65", _ = {
|
|
2
|
+
root: o,
|
|
3
|
+
downloadButton: t,
|
|
4
|
+
fileName: e,
|
|
5
|
+
fileSize: s
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
_ as default,
|
|
9
|
+
t as downloadButton,
|
|
10
|
+
e as fileName,
|
|
11
|
+
s as fileSize,
|
|
12
|
+
o as root
|
|
13
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface MediaDocumentProps {
|
|
3
|
+
fileName: string;
|
|
4
|
+
fileSize?: string;
|
|
5
|
+
fileType?: string;
|
|
6
|
+
fileUrl?: string;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
}
|
|
11
|
+
export declare function MediaDocument({ fileName, fileSize, fileType, fileUrl, onClick, className, style, }: MediaDocumentProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare namespace MediaDocument {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/MediaDocument/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,OAAO,EACP,SAAS,EACT,KAAK,GACN,EAAE,kBAAkB,2CA8CpB;yBAtDe,aAAa"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { Box as p, Flex as u, Stack as f, Text as c, ActionIcon as h } from "@mantine/core";
|
|
3
|
+
import { Download01Icon as w } from "@hugeicons/core-free-icons";
|
|
4
|
+
import { HugeiconsIcon as x } from "@hugeicons/react";
|
|
5
|
+
import { getFileIcons as g } from "../../../helpers/getFileIcons.js";
|
|
6
|
+
import t from "./MediaDocument.module.css.js";
|
|
7
|
+
function b(o) {
|
|
8
|
+
try {
|
|
9
|
+
const r = new URL(o, window.location.origin);
|
|
10
|
+
return ["https:", "http:", "blob:"].includes(r.protocol);
|
|
11
|
+
} catch {
|
|
12
|
+
return !1;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function y({
|
|
16
|
+
fileName: o,
|
|
17
|
+
fileSize: r,
|
|
18
|
+
fileType: l,
|
|
19
|
+
fileUrl: a,
|
|
20
|
+
onClick: n,
|
|
21
|
+
className: m,
|
|
22
|
+
style: d
|
|
23
|
+
}) {
|
|
24
|
+
return /* @__PURE__ */ e(
|
|
25
|
+
p,
|
|
26
|
+
{
|
|
27
|
+
className: `${t.root} ${m || ""}`,
|
|
28
|
+
style: d,
|
|
29
|
+
onClick: n,
|
|
30
|
+
tabIndex: n ? 0 : void 0,
|
|
31
|
+
onKeyDown: n ? (i) => {
|
|
32
|
+
i.key === "Enter" && n();
|
|
33
|
+
} : void 0,
|
|
34
|
+
children: /* @__PURE__ */ s(u, { align: "center", gap: "xs", wrap: "nowrap", children: [
|
|
35
|
+
g(l || "other", !1, 36),
|
|
36
|
+
/* @__PURE__ */ s(f, { gap: 0, flex: 1, miw: 0, children: [
|
|
37
|
+
/* @__PURE__ */ e(
|
|
38
|
+
c,
|
|
39
|
+
{
|
|
40
|
+
size: "sm",
|
|
41
|
+
truncate: !0,
|
|
42
|
+
title: o,
|
|
43
|
+
className: t.fileName,
|
|
44
|
+
children: o
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
r && /* @__PURE__ */ e(c, { size: "xs", className: t.fileSize, children: r })
|
|
48
|
+
] }),
|
|
49
|
+
a && b(a) && /* @__PURE__ */ e(
|
|
50
|
+
h,
|
|
51
|
+
{
|
|
52
|
+
component: "a",
|
|
53
|
+
href: a,
|
|
54
|
+
target: "_blank",
|
|
55
|
+
download: o,
|
|
56
|
+
rel: "noopener noreferrer",
|
|
57
|
+
variant: "subtle",
|
|
58
|
+
color: "gray",
|
|
59
|
+
size: "sm",
|
|
60
|
+
className: t.downloadButton,
|
|
61
|
+
onClick: (i) => i.stopPropagation(),
|
|
62
|
+
"aria-label": "Download",
|
|
63
|
+
children: /* @__PURE__ */ e(x, { icon: w, size: 16 })
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
] })
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
y.displayName = "MediaDocument";
|
|
71
|
+
export {
|
|
72
|
+
y as MediaDocument
|
|
73
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface MessageActionsProps {
|
|
3
|
+
onReaction?: (emoji: string) => void;
|
|
4
|
+
onReply?: () => void;
|
|
5
|
+
onEdit?: () => void;
|
|
6
|
+
onDelete?: () => void;
|
|
7
|
+
onCopy?: () => void;
|
|
8
|
+
onForward?: () => void;
|
|
9
|
+
onPin?: () => void;
|
|
10
|
+
showEdit?: boolean;
|
|
11
|
+
showDelete?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
}
|
|
15
|
+
export declare const MessageActions: React.NamedExoticComponent<MessageActionsProps>;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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,iDAwFzB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx as e, jsxs as n, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import b, { useState as v } from "react";
|
|
3
|
+
import { Group as y, ActionIcon as d, Menu as i } from "@mantine/core";
|
|
4
|
+
import { SmileIcon as j, LinkBackwardIcon as w, MoreVerticalIcon as A, Copy01Icon as x, Share08Icon as $, PinIcon as B, Edit02Icon as E, Delete02Icon as O } from "@hugeicons/core-free-icons";
|
|
5
|
+
import { HugeiconsIcon as o } from "@hugeicons/react";
|
|
6
|
+
import { EmojiPicker as P } from "../../EmojiPicker/EmojiPicker.js";
|
|
7
|
+
import { IconEntity as _ } from "../../ProjectIcon/ProjectIcon.js";
|
|
8
|
+
import D from "./MessageActions.module.css.js";
|
|
9
|
+
const G = b.memo(function({
|
|
10
|
+
onReaction: r,
|
|
11
|
+
onReply: m,
|
|
12
|
+
onEdit: t,
|
|
13
|
+
onDelete: c,
|
|
14
|
+
onCopy: s,
|
|
15
|
+
onForward: a,
|
|
16
|
+
onPin: l,
|
|
17
|
+
showEdit: h,
|
|
18
|
+
showDelete: p,
|
|
19
|
+
className: f,
|
|
20
|
+
style: I
|
|
21
|
+
}) {
|
|
22
|
+
const [g, z] = v(!1), k = !!(t || c || s || a || l || h || p), S = (u) => {
|
|
23
|
+
if (!r) return;
|
|
24
|
+
const C = _.parse(u);
|
|
25
|
+
r(C?.emoji ?? u);
|
|
26
|
+
};
|
|
27
|
+
return /* @__PURE__ */ e(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
className: `${D.root}${f ? ` ${f}` : ""}`,
|
|
31
|
+
style: I,
|
|
32
|
+
"data-testid": "message-actions",
|
|
33
|
+
children: /* @__PURE__ */ n(y, { gap: 2, wrap: "nowrap", children: [
|
|
34
|
+
r && /* @__PURE__ */ e(
|
|
35
|
+
P,
|
|
36
|
+
{
|
|
37
|
+
onChange: S,
|
|
38
|
+
position: "top-start",
|
|
39
|
+
showRemoveButton: !1,
|
|
40
|
+
showIcons: !1,
|
|
41
|
+
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
|
+
}
|
|
43
|
+
),
|
|
44
|
+
m && /* @__PURE__ */ e(d, { variant: "subtle", color: "gray", size: 22, radius: 8, onClick: m, "aria-label": "Reply", children: /* @__PURE__ */ e(o, { icon: w, size: 16 }) }),
|
|
45
|
+
k && /* @__PURE__ */ n(i, { position: "bottom-end", withinPortal: !0, shadow: "md", width: 200, opened: g, onChange: z, children: [
|
|
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: A, size: 16 }) }) }),
|
|
47
|
+
/* @__PURE__ */ n(i.Dropdown, { children: [
|
|
48
|
+
s && /* @__PURE__ */ e(i.Item, { leftSection: /* @__PURE__ */ e(o, { icon: x, size: 16 }), onClick: s, children: "Copy" }),
|
|
49
|
+
a && /* @__PURE__ */ e(i.Item, { leftSection: /* @__PURE__ */ e(o, { icon: $, size: 16 }), onClick: a, children: "Forward" }),
|
|
50
|
+
l && /* @__PURE__ */ e(i.Item, { leftSection: /* @__PURE__ */ e(o, { icon: B, size: 16 }), onClick: l, children: "Pin" }),
|
|
51
|
+
(h || t) && /* @__PURE__ */ e(i.Item, { leftSection: /* @__PURE__ */ e(o, { icon: E, size: 16 }), onClick: t, children: "Edit" }),
|
|
52
|
+
(p || c) && /* @__PURE__ */ n(M, { children: [
|
|
53
|
+
/* @__PURE__ */ e(i.Divider, {}),
|
|
54
|
+
/* @__PURE__ */ e(i.Item, { color: "red", leftSection: /* @__PURE__ */ e(o, { icon: O, size: 16 }), onClick: c, children: "Delete" })
|
|
55
|
+
] })
|
|
56
|
+
] })
|
|
57
|
+
] })
|
|
58
|
+
] })
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
G.displayName = "MessageActions";
|
|
63
|
+
export {
|
|
64
|
+
G as MessageActions
|
|
65
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface MessageAuthorProps {
|
|
3
|
+
/** Author display name */
|
|
4
|
+
name: string;
|
|
5
|
+
/** Author color index 1-7 */
|
|
6
|
+
color?: 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
7
|
+
/** Outgoing message uses green palette */
|
|
8
|
+
outgoing?: boolean;
|
|
9
|
+
/** Click handler */
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
/** Additional className */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Custom style */
|
|
14
|
+
style?: React.CSSProperties;
|
|
15
|
+
}
|
|
16
|
+
export declare function MessageAuthor({ name, color, outgoing, onClick, className, style, }: MessageAuthorProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare namespace MessageAuthor {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/MessageAuthor/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,MAAM,WAAW,kBAAkB;IACjC,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAClC,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,KAAS,EACT,QAAQ,EACR,OAAO,EACP,SAAS,EACT,KAAK,GACN,EAAE,kBAAkB,2CAyBpB;yBAhCe,aAAa"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as d } from "react";
|
|
3
|
+
import { Text as n } from "@mantine/core";
|
|
4
|
+
import { getAuthorColor as c } from "../colors.js";
|
|
5
|
+
function l({
|
|
6
|
+
name: o,
|
|
7
|
+
color: s = 6,
|
|
8
|
+
outgoing: a,
|
|
9
|
+
onClick: e,
|
|
10
|
+
className: m,
|
|
11
|
+
style: r
|
|
12
|
+
}) {
|
|
13
|
+
const t = a ? "var(--mantine-color-green-6)" : c(s), i = d(
|
|
14
|
+
() => ({ ...r, color: t, maxHeight: 38, cursor: e ? "pointer" : void 0 }),
|
|
15
|
+
[r, t, e]
|
|
16
|
+
);
|
|
17
|
+
return /* @__PURE__ */ u(
|
|
18
|
+
n,
|
|
19
|
+
{
|
|
20
|
+
size: "sm",
|
|
21
|
+
fw: 600,
|
|
22
|
+
truncate: !0,
|
|
23
|
+
className: m,
|
|
24
|
+
style: i,
|
|
25
|
+
mb: 4,
|
|
26
|
+
"data-testid": "message-author",
|
|
27
|
+
"data-clickable": e ? !0 : void 0,
|
|
28
|
+
onClick: e,
|
|
29
|
+
children: o
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
l.displayName = "MessageAuthor";
|
|
34
|
+
export {
|
|
35
|
+
l as MessageAuthor
|
|
36
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface MessageForwardProps {
|
|
3
|
+
from: string;
|
|
4
|
+
outgoing?: boolean;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
}
|
|
9
|
+
export declare function MessageForward({ from, outgoing, onClick, className, style, }: MessageForwardProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare namespace MessageForward {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/MessageForward/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,SAAS,EACT,KAAK,GACN,EAAE,mBAAmB,2CAcrB;yBApBe,cAAc"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Text as e } from "@mantine/core";
|
|
3
|
+
import m from "./MessageForward.module.css.js";
|
|
4
|
+
function n({
|
|
5
|
+
from: o,
|
|
6
|
+
outgoing: s,
|
|
7
|
+
onClick: r,
|
|
8
|
+
className: a,
|
|
9
|
+
style: d
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ i(
|
|
12
|
+
e,
|
|
13
|
+
{
|
|
14
|
+
size: "sm",
|
|
15
|
+
truncate: !0,
|
|
16
|
+
className: `${m.root} ${a || ""}`,
|
|
17
|
+
style: d,
|
|
18
|
+
"data-outgoing": s || void 0,
|
|
19
|
+
"data-testid": "message-forward",
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ t(e, { span: !0, children: "Forwarded from " }),
|
|
22
|
+
/* @__PURE__ */ t(e, { span: !0, fw: 500, style: { cursor: r ? "pointer" : void 0 }, onClick: r, tabIndex: r ? 0 : void 0, role: r ? "button" : void 0, children: o })
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
n.displayName = "MessageForward";
|
|
28
|
+
export {
|
|
29
|
+
n as MessageForward
|
|
30
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const o = "_container_1ak80_1", t = "_root_1ak80_19", _ = "_wrapper_1ak80_33", r = "_top_1ak80_43", s = "_items_1ak80_43", a = "_scrollToBottom_1ak80_87", c = {
|
|
2
|
+
container: o,
|
|
3
|
+
root: t,
|
|
4
|
+
wrapper: _,
|
|
5
|
+
top: r,
|
|
6
|
+
items: s,
|
|
7
|
+
scrollToBottom: a
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
o as container,
|
|
11
|
+
c as default,
|
|
12
|
+
s as items,
|
|
13
|
+
t as root,
|
|
14
|
+
a as scrollToBottom,
|
|
15
|
+
r as top,
|
|
16
|
+
_ as wrapper
|
|
17
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface MessageListProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
stickToBottom?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function MessageList({ children, className, style, stickToBottom }: MessageListProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare namespace MessageList {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/MessageList/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAGxE,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;CACzB;AAED,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE,gBAAgB,2CA8F1F;yBA9Fe,WAAW"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsxs as f, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { ScrollArea as x, ActionIcon as N } from "@mantine/core";
|
|
3
|
+
import { ArrowDown01Icon as R } from "@hugeicons/core-free-icons";
|
|
4
|
+
import { HugeiconsIcon as E } from "@hugeicons/react";
|
|
5
|
+
import { useRef as c, useState as L, useCallback as z, useEffect as h } from "react";
|
|
6
|
+
import r from "./MessageList.module.css.js";
|
|
7
|
+
function A({ children: g, className: i, style: v, stickToBottom: l }) {
|
|
8
|
+
const e = c(null), n = c(!0), a = c(0), [b, w] = L(!1), H = z(() => {
|
|
9
|
+
e.current && e.current.scrollTo({ top: e.current.scrollHeight, behavior: "smooth" });
|
|
10
|
+
}, []);
|
|
11
|
+
return h(() => {
|
|
12
|
+
!l || !e.current || (e.current.scrollTop = e.current.scrollHeight);
|
|
13
|
+
}, [l]), h(() => {
|
|
14
|
+
const t = e.current;
|
|
15
|
+
if (!l || !t) return;
|
|
16
|
+
const u = new ResizeObserver(() => {
|
|
17
|
+
const o = t.scrollHeight;
|
|
18
|
+
o !== a.current && n.current && (t.scrollTop = o), a.current = o;
|
|
19
|
+
}), m = t.firstElementChild;
|
|
20
|
+
m && u.observe(m);
|
|
21
|
+
const d = () => {
|
|
22
|
+
const { scrollTop: o, scrollHeight: S, clientHeight: y } = t, p = S - o - y;
|
|
23
|
+
n.current = p < 40, w(p > 200);
|
|
24
|
+
};
|
|
25
|
+
return t.addEventListener("scroll", d, { passive: !0 }), () => {
|
|
26
|
+
u.disconnect(), t.removeEventListener("scroll", d);
|
|
27
|
+
};
|
|
28
|
+
}, [l]), /* @__PURE__ */ f("div", { className: r.container, children: [
|
|
29
|
+
/* @__PURE__ */ s(
|
|
30
|
+
x,
|
|
31
|
+
{
|
|
32
|
+
className: `${r.root}${i ? ` ${i}` : ""}`,
|
|
33
|
+
style: v,
|
|
34
|
+
type: "auto",
|
|
35
|
+
scrollbars: "y",
|
|
36
|
+
viewportRef: e,
|
|
37
|
+
"data-testid": "message-list",
|
|
38
|
+
styles: {
|
|
39
|
+
content: {
|
|
40
|
+
display: "flex",
|
|
41
|
+
flexDirection: "column",
|
|
42
|
+
minHeight: "100%"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
children: /* @__PURE__ */ f("div", { className: r.wrapper, children: [
|
|
46
|
+
/* @__PURE__ */ s("div", { className: r.top, "data-testid": "message-list-top" }),
|
|
47
|
+
/* @__PURE__ */ s("div", { className: r.items, "data-testid": "message-list-items", children: g })
|
|
48
|
+
] })
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
b && /* @__PURE__ */ s(
|
|
52
|
+
N,
|
|
53
|
+
{
|
|
54
|
+
className: r.scrollToBottom,
|
|
55
|
+
variant: "filled",
|
|
56
|
+
color: "gray",
|
|
57
|
+
radius: "xl",
|
|
58
|
+
size: 40,
|
|
59
|
+
onClick: H,
|
|
60
|
+
"aria-label": "Scroll to bottom",
|
|
61
|
+
"data-testid": "scroll-to-bottom",
|
|
62
|
+
style: { position: "absolute", bottom: 16, right: 24, left: "auto" },
|
|
63
|
+
children: /* @__PURE__ */ s(E, { icon: R, size: 20 })
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
] });
|
|
67
|
+
}
|
|
68
|
+
A.displayName = "MessageList";
|
|
69
|
+
export {
|
|
70
|
+
A as MessageList
|
|
71
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface MessageMetaProps {
|
|
3
|
+
time: string;
|
|
4
|
+
edited?: boolean;
|
|
5
|
+
views?: number;
|
|
6
|
+
outgoing?: boolean;
|
|
7
|
+
inReactions?: boolean;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
}
|
|
12
|
+
export declare function MessageMeta({ time, edited, views, outgoing, inReactions, children, className, style, }: MessageMetaProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare namespace MessageMeta {
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|