@layers-app/shared 0.4.3 → 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/AppContainer/components/SidebarToggleButton.d.ts.map +1 -1
- package/dist/components/AppContainer/components/SidebarToggleButton.js +25 -16
- 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/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
- package/dist/components/AttachmentsPreview/AttachmentsPreview.js +11 -12
- 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/CommentComposer/CommentComposer.module.css.js +4 -4
- package/dist/components/CommentComposer/index.d.ts.map +1 -1
- package/dist/components/CommentComposer/index.js +53 -54
- package/dist/components/CommentComposer/types.js +9 -0
- 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/EntityIcon.d.ts.map +1 -1
- package/dist/components/EntityIcon.js +36 -27
- 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/MusicPlayerBar/MusicPlayerBar.module.css.js +42 -42
- package/dist/components/MusicPlayerBar/components/VolumePopover.d.ts.map +1 -1
- package/dist/components/MusicPlayerBar/components/VolumePopover.js +22 -20
- 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/modals/RemoveConfirmModal.js +1 -1
- package/dist/hooks/useOfficePreviewAvailable.d.ts +2 -0
- package/dist/hooks/useOfficePreviewAvailable.d.ts.map +1 -0
- package/dist/hooks/useOfficePreviewAvailable.js +20 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +573 -520
- 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/package.json +6 -3
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsxs as v, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import w from "react";
|
|
3
|
+
import { ArrowUpRight01Icon as y, ArrowDownLeft01Icon as O, Video01Icon as b, CallOutgoing04Icon as x, CallIncoming04Icon as A, Calling02Icon as D, CallRinging03Icon as R } from "@hugeicons/core-free-icons";
|
|
4
|
+
import { HugeiconsIcon as u } from "@hugeicons/react";
|
|
5
|
+
import n from "./CallMessage.module.css.js";
|
|
6
|
+
const z = w.memo(function({
|
|
7
|
+
variant: m,
|
|
8
|
+
outgoing: i,
|
|
9
|
+
callType: M = "audio",
|
|
10
|
+
mode: $ = "dm",
|
|
11
|
+
duration: s,
|
|
12
|
+
time: a,
|
|
13
|
+
participantCount: f = 0,
|
|
14
|
+
className: h,
|
|
15
|
+
style: V
|
|
16
|
+
}) {
|
|
17
|
+
const I = m === "active", o = m === "missed", d = m === "declined", c = M === "video", t = $ === "dm", C = i;
|
|
18
|
+
let g;
|
|
19
|
+
t ? g = c ? b : i ? x : A : g = I ? D : R;
|
|
20
|
+
let e;
|
|
21
|
+
t ? o ? e = c ? "Missed Video Call" : "Missed Call" : d ? e = c ? "Canceled Video Call" : "Canceled Call" : i ? e = c ? "Outgoing Video Call" : "Outgoing Call" : e = c ? "Incoming Video Call" : "Incoming Call" : I ? e = i ? "You started the call" : "Started a call" : o ? e = "Missed call" : e = "Call ended";
|
|
22
|
+
const l = [], p = t ? i ? y : O : null;
|
|
23
|
+
t ? a && s ? l.push(`${a}, ${s}`) : a ? l.push(a) : s && l.push(s) : (s && l.push(s), f > 0 && l.push(`${f} person${f > 1 ? "s" : ""} joined`));
|
|
24
|
+
const N = C ? "var(--mantine-color-white)" : void 0, j = o || d ? "var(--mantine-color-red-6)" : "var(--mantine-color-green-6)";
|
|
25
|
+
return /* @__PURE__ */ v(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
className: `${n.root}${h ? ` ${h}` : ""}`,
|
|
29
|
+
style: V,
|
|
30
|
+
"data-outgoing": C || void 0,
|
|
31
|
+
"data-missed": o || d || void 0,
|
|
32
|
+
"data-testid": "call-message",
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ r("div", { className: n.icon, children: /* @__PURE__ */ r(u, { icon: g, size: 24, color: N || (o || d ? "var(--mantine-color-red-6)" : void 0) }) }),
|
|
35
|
+
/* @__PURE__ */ v("div", { className: n.body, children: [
|
|
36
|
+
/* @__PURE__ */ r("div", { className: n.title, children: e }),
|
|
37
|
+
l.length > 0 && /* @__PURE__ */ v("div", { className: n.meta, style: { color: C ? void 0 : j }, children: [
|
|
38
|
+
p && /* @__PURE__ */ r(u, { icon: p, size: 14 }),
|
|
39
|
+
l.join(" • ")
|
|
40
|
+
] })
|
|
41
|
+
] })
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
z.displayName = "CallMessage";
|
|
47
|
+
export {
|
|
48
|
+
z as CallMessage
|
|
49
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type ChatBubbleGroupPosition = 'single' | 'first' | 'middle' | 'last';
|
|
3
|
+
export interface ChatBubbleProps {
|
|
4
|
+
outgoing?: boolean;
|
|
5
|
+
fullWidth?: boolean;
|
|
6
|
+
groupPosition?: ChatBubbleGroupPosition;
|
|
7
|
+
selected?: boolean;
|
|
8
|
+
highlighted?: boolean;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
}
|
|
13
|
+
export declare const ChatBubble: React.NamedExoticComponent<ChatBubbleProps>;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/ChatBubble/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE7E,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,eAAO,MAAM,UAAU,6CA0BrB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import u from "react";
|
|
3
|
+
import a from "./ChatBubble.module.css.js";
|
|
4
|
+
const m = u.memo(function({
|
|
5
|
+
outgoing: e,
|
|
6
|
+
fullWidth: o,
|
|
7
|
+
groupPosition: d = "single",
|
|
8
|
+
children: i,
|
|
9
|
+
selected: l,
|
|
10
|
+
highlighted: b,
|
|
11
|
+
className: s,
|
|
12
|
+
style: r
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ t(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
className: `${a.root} ${s || ""}`,
|
|
18
|
+
"data-outgoing": e || void 0,
|
|
19
|
+
"data-full-width": o || void 0,
|
|
20
|
+
"data-group-position": d,
|
|
21
|
+
"data-selected": l || void 0,
|
|
22
|
+
"data-highlighted": b || void 0,
|
|
23
|
+
"data-testid": "chat-bubble",
|
|
24
|
+
style: r,
|
|
25
|
+
children: /* @__PURE__ */ t("div", { className: a.bubble, "data-testid": "chat-bubble-content", children: i })
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
m.displayName = "ChatBubble";
|
|
30
|
+
export {
|
|
31
|
+
m as ChatBubble
|
|
32
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const t = "_root_13wo5_1", o = "_info_13wo5_23", e = "_title_13wo5_43", n = "_subtitle_13wo5_61", s = "_selectionBar_13wo5_87", _ = "_selectionCount_13wo5_97", i = {
|
|
2
|
+
root: t,
|
|
3
|
+
info: o,
|
|
4
|
+
title: e,
|
|
5
|
+
subtitle: n,
|
|
6
|
+
selectionBar: s,
|
|
7
|
+
selectionCount: _
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
i as default,
|
|
11
|
+
o as info,
|
|
12
|
+
t as root,
|
|
13
|
+
s as selectionBar,
|
|
14
|
+
_ as selectionCount,
|
|
15
|
+
n as subtitle,
|
|
16
|
+
e as title
|
|
17
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ChatHeaderProps {
|
|
3
|
+
/** Chat title */
|
|
4
|
+
title: string;
|
|
5
|
+
/** Subtitle: "online", "2 members", etc. */
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
/** Avatar image source */
|
|
8
|
+
avatarSrc?: string;
|
|
9
|
+
/** Avatar color index 1-7 */
|
|
10
|
+
avatarColor?: 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
11
|
+
/** Online status (colors subtitle) */
|
|
12
|
+
online?: boolean;
|
|
13
|
+
/** Back button handler (mobile) */
|
|
14
|
+
onBack?: () => void;
|
|
15
|
+
/** Menu button handler (opens sidebar drawer on mobile) */
|
|
16
|
+
onMenu?: () => void;
|
|
17
|
+
/** Search button handler */
|
|
18
|
+
onSearch?: () => void;
|
|
19
|
+
/** More button handler */
|
|
20
|
+
onMore?: () => void;
|
|
21
|
+
/** Selection mode -- shows action bar instead of normal header */
|
|
22
|
+
selectionMode?: boolean;
|
|
23
|
+
/** Number of selected messages */
|
|
24
|
+
selectedCount?: number;
|
|
25
|
+
/** Forward selected messages */
|
|
26
|
+
onForward?: () => void;
|
|
27
|
+
/** Delete selected messages */
|
|
28
|
+
onDelete?: () => void;
|
|
29
|
+
/** Cancel selection mode */
|
|
30
|
+
onCancelSelection?: () => void;
|
|
31
|
+
/** Extra action elements */
|
|
32
|
+
children?: React.ReactNode;
|
|
33
|
+
/** Custom className */
|
|
34
|
+
className?: string;
|
|
35
|
+
/** Custom style */
|
|
36
|
+
style?: React.CSSProperties;
|
|
37
|
+
}
|
|
38
|
+
export declare function ChatHeader({ title, subtitle, avatarSrc, avatarColor, online, onBack, onMenu, onSearch, onMore, selectionMode, selectedCount, onForward, onDelete, onCancelSelection, children, className, style, }: ChatHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export declare namespace ChatHeader {
|
|
40
|
+
var displayName: string;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/ChatHeader/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,eAAe;IAC9B,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,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,sCAAsC;IACtC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,0BAA0B;IAC1B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,kEAAkE;IAClE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kCAAkC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,4BAA4B;IAC5B,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,WAAe,EACf,MAAM,EACN,MAAM,EACN,MAAM,EACN,QAAQ,EACR,MAAM,EACN,aAAa,EACb,aAAiB,EACjB,SAAS,EACT,QAAQ,EACR,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,KAAK,GACN,EAAE,eAAe,2CA8FjB;yBAhHe,UAAU"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { ActionIcon as r, Group as C, Indicator as x, Avatar as A } from "@mantine/core";
|
|
3
|
+
import { Cancel01Icon as N, Forward01Icon as w, Delete02Icon as H, Menu01Icon as j, ArrowLeft01Icon as F, Search01Icon as G, MoreVerticalIcon as B } from "@hugeicons/core-free-icons";
|
|
4
|
+
import { HugeiconsIcon as i } from "@hugeicons/react";
|
|
5
|
+
import { getAvatarColor as D } from "../colors.js";
|
|
6
|
+
import a from "./ChatHeader.module.css.js";
|
|
7
|
+
function E({
|
|
8
|
+
title: c,
|
|
9
|
+
subtitle: n,
|
|
10
|
+
avatarSrc: f,
|
|
11
|
+
avatarColor: I = 1,
|
|
12
|
+
online: t,
|
|
13
|
+
onBack: s,
|
|
14
|
+
onMenu: d,
|
|
15
|
+
onSearch: h,
|
|
16
|
+
onMore: g,
|
|
17
|
+
selectionMode: k,
|
|
18
|
+
selectedCount: m = 0,
|
|
19
|
+
onForward: b,
|
|
20
|
+
onDelete: u,
|
|
21
|
+
onCancelSelection: y,
|
|
22
|
+
children: $,
|
|
23
|
+
className: l,
|
|
24
|
+
style: p
|
|
25
|
+
}) {
|
|
26
|
+
if (k)
|
|
27
|
+
return /* @__PURE__ */ o(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
className: `${a.root} ${a.selectionBar}${l ? ` ${l}` : ""}`,
|
|
31
|
+
style: p,
|
|
32
|
+
"data-testid": "chat-header",
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ e(r, { variant: "subtle", color: "gray", size: "lg", onClick: y, "aria-label": "Cancel selection", children: /* @__PURE__ */ e(i, { icon: N, size: 24 }) }),
|
|
35
|
+
/* @__PURE__ */ o("span", { className: a.selectionCount, children: [
|
|
36
|
+
m,
|
|
37
|
+
" ",
|
|
38
|
+
m === 1 ? "message" : "messages"
|
|
39
|
+
] }),
|
|
40
|
+
/* @__PURE__ */ o(C, { gap: 6, children: [
|
|
41
|
+
b && /* @__PURE__ */ e(r, { variant: "subtle", color: "blue", size: "lg", onClick: b, "aria-label": "Forward", children: /* @__PURE__ */ e(i, { icon: w, size: 20 }) }),
|
|
42
|
+
u && /* @__PURE__ */ e(r, { variant: "subtle", color: "red", size: "lg", onClick: u, "aria-label": "Delete", children: /* @__PURE__ */ e(i, { icon: H, size: 20 }) })
|
|
43
|
+
] })
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
const v = D(I), z = /* @__PURE__ */ e(
|
|
48
|
+
A,
|
|
49
|
+
{
|
|
50
|
+
src: f,
|
|
51
|
+
name: c,
|
|
52
|
+
size: 44,
|
|
53
|
+
radius: "xl",
|
|
54
|
+
styles: {
|
|
55
|
+
root: { "--avatar-bg": v },
|
|
56
|
+
placeholder: { backgroundColor: v }
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
return /* @__PURE__ */ o("div", { className: `${a.root}${l ? ` ${l}` : ""}`, style: p, "data-testid": "chat-header", children: [
|
|
61
|
+
d && /* @__PURE__ */ e(r, { variant: "subtle", color: "gray", size: "lg", onClick: d, "aria-label": "Open menu", hiddenFrom: "md", children: /* @__PURE__ */ e(i, { icon: j, size: 24 }) }),
|
|
62
|
+
s && /* @__PURE__ */ e(r, { variant: "subtle", color: "gray", size: "lg", onClick: s, "aria-label": "Go back", children: /* @__PURE__ */ e(i, { icon: F, size: 24 }) }),
|
|
63
|
+
t ? /* @__PURE__ */ e(x, { inline: !0, size: 12, offset: 2, position: "bottom-end", color: "green", withBorder: !0, processing: !1, children: z }) : z,
|
|
64
|
+
/* @__PURE__ */ o("div", { className: a.info, children: [
|
|
65
|
+
/* @__PURE__ */ e("div", { className: a.title, children: c }),
|
|
66
|
+
n && /* @__PURE__ */ e("div", { className: a.subtitle, "data-online": t || void 0, children: n })
|
|
67
|
+
] }),
|
|
68
|
+
/* @__PURE__ */ o(C, { gap: 6, children: [
|
|
69
|
+
$,
|
|
70
|
+
h && /* @__PURE__ */ e(r, { variant: "subtle", color: "gray", size: "lg", onClick: h, "aria-label": "Search", children: /* @__PURE__ */ e(i, { icon: G, size: 20 }) }),
|
|
71
|
+
g && /* @__PURE__ */ e(r, { variant: "subtle", color: "gray", size: "lg", onClick: g, "aria-label": "More options", children: /* @__PURE__ */ e(i, { icon: B, size: 20 }) })
|
|
72
|
+
] })
|
|
73
|
+
] });
|
|
74
|
+
}
|
|
75
|
+
E.displayName = "ChatHeader";
|
|
76
|
+
export {
|
|
77
|
+
E as ChatHeader
|
|
78
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const t = "_root_6rx8s_1", e = "_inputRow_6rx8s_17", n = "_inputBox_6rx8s_31", r = "_header_6rx8s_49", _ = "_headerIcon_6rx8s_63", a = "_headerBar_6rx8s_83", o = "_headerTitle_6rx8s_111", s = "_headerText_6rx8s_131", c = "_headerAttachment_6rx8s_149", x = "_hiddenFileInput_6rx8s_177", d = "_attachments_6rx8s_195", h = "_inputArea_6rx8s_203", u = "_iconButton_6rx8s_221", i = "_textarea_6rx8s_229", p = "_textareaInput_6rx8s_239", B = "_sendButton_6rx8s_267", I = {
|
|
2
|
+
root: t,
|
|
3
|
+
inputRow: e,
|
|
4
|
+
inputBox: n,
|
|
5
|
+
header: r,
|
|
6
|
+
headerIcon: _,
|
|
7
|
+
headerBar: a,
|
|
8
|
+
headerTitle: o,
|
|
9
|
+
headerText: s,
|
|
10
|
+
headerAttachment: c,
|
|
11
|
+
hiddenFileInput: x,
|
|
12
|
+
attachments: d,
|
|
13
|
+
inputArea: h,
|
|
14
|
+
iconButton: u,
|
|
15
|
+
textarea: i,
|
|
16
|
+
textareaInput: p,
|
|
17
|
+
sendButton: B
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
d as attachments,
|
|
21
|
+
I as default,
|
|
22
|
+
r as header,
|
|
23
|
+
c as headerAttachment,
|
|
24
|
+
a as headerBar,
|
|
25
|
+
_ as headerIcon,
|
|
26
|
+
s as headerText,
|
|
27
|
+
o as headerTitle,
|
|
28
|
+
x as hiddenFileInput,
|
|
29
|
+
u as iconButton,
|
|
30
|
+
h as inputArea,
|
|
31
|
+
n as inputBox,
|
|
32
|
+
e as inputRow,
|
|
33
|
+
t as root,
|
|
34
|
+
B as sendButton,
|
|
35
|
+
i as textarea,
|
|
36
|
+
p as textareaInput
|
|
37
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CommentComposerTypes } from '../../CommentComposer/types';
|
|
3
|
+
export interface ChatInputReplyTo {
|
|
4
|
+
senderName: string;
|
|
5
|
+
text: string;
|
|
6
|
+
/**
|
|
7
|
+
* When the replied message has attachments, the host passes the first
|
|
8
|
+
* attachment's display name + kind. We fall back to it when `text` is
|
|
9
|
+
* empty (image/video/file-only messages) and prepend a kind-specific icon
|
|
10
|
+
* — Telegram-style preview.
|
|
11
|
+
*/
|
|
12
|
+
attachmentName?: string;
|
|
13
|
+
attachmentKind?: 'image' | 'video' | 'file';
|
|
14
|
+
onCancel: () => void;
|
|
15
|
+
}
|
|
16
|
+
export interface ChatInputEditing {
|
|
17
|
+
text: string;
|
|
18
|
+
onCancel: () => void;
|
|
19
|
+
}
|
|
20
|
+
export interface ChatInputProps {
|
|
21
|
+
value?: string;
|
|
22
|
+
onChange?: (value: string) => void;
|
|
23
|
+
onSend?: (value: string) => void;
|
|
24
|
+
onAttach?: (files: File[]) => void;
|
|
25
|
+
onEmojiSelect?: (emoji: string) => void;
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
replyTo?: ChatInputReplyTo;
|
|
28
|
+
editing?: ChatInputEditing;
|
|
29
|
+
attachments?: CommentComposerTypes.AnyCommentFile[];
|
|
30
|
+
onRemoveAttachment?: (index: number) => void;
|
|
31
|
+
maxLength?: number;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Hide the paperclip / file-input affordance. Used by surfaces where uploads
|
|
35
|
+
* are nonsensical — Instant Meet's in-call chat is ephemeral (data channel,
|
|
36
|
+
* no persistence), so attaching files there has nowhere to go.
|
|
37
|
+
*/
|
|
38
|
+
disableAttachments?: boolean;
|
|
39
|
+
className?: string;
|
|
40
|
+
style?: React.CSSProperties;
|
|
41
|
+
}
|
|
42
|
+
export declare function ChatInput({ value: controlledValue, onChange, onSend, onAttach, onEmojiSelect, placeholder, replyTo, editing, attachments, onRemoveAttachment, maxLength, disabled, disableAttachments, className, style, }: ChatInputProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export declare namespace ChatInput {
|
|
44
|
+
var displayName: string;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/ChatInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAgBxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAMnE,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;IAC5C,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IACnC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,WAAW,CAAC,EAAE,oBAAoB,CAAC,cAAc,EAAE,CAAC;IACpD,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,SAAS,CAAC,EACxB,KAAK,EAAE,eAAe,EACtB,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,aAAa,EACb,WAAgC,EAChC,OAAO,EACP,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACR,kBAAkB,EAClB,SAAS,EACT,KAAK,GACN,EAAE,cAAc,2CAoQhB;yBApRe,SAAS"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { jsxs as s, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as J, useRef as N, useEffect as y, useCallback as m } from "react";
|
|
3
|
+
import { Edit04Icon as M, LinkBackwardIcon as Q, Image01Icon as T, PlayIcon as W, File01Icon as X, SmileIcon as Y, Attachment02Icon as Z, Sent02Icon as _ } from "@hugeicons/core-free-icons";
|
|
4
|
+
import { HugeiconsIcon as l } from "@hugeicons/react";
|
|
5
|
+
import { Box as ee, CloseButton as j, ActionIcon as I, Textarea as ae } from "@mantine/core";
|
|
6
|
+
import { AttachmentsPreview as te } from "../../AttachmentsPreview/AttachmentsPreview.js";
|
|
7
|
+
import { EmojiPicker as ne } from "../../EmojiPicker/EmojiPicker.js";
|
|
8
|
+
import { IconEntity as ie } from "../../ProjectIcon/ProjectIcon.js";
|
|
9
|
+
import t from "./ChatInput.module.css.js";
|
|
10
|
+
function se({
|
|
11
|
+
value: g,
|
|
12
|
+
onChange: C,
|
|
13
|
+
onSend: z,
|
|
14
|
+
onAttach: k,
|
|
15
|
+
onEmojiSelect: u,
|
|
16
|
+
placeholder: K = "Add a message...",
|
|
17
|
+
replyTo: n,
|
|
18
|
+
editing: o,
|
|
19
|
+
attachments: i,
|
|
20
|
+
onRemoveAttachment: S,
|
|
21
|
+
maxLength: $,
|
|
22
|
+
disabled: w,
|
|
23
|
+
disableAttachments: B,
|
|
24
|
+
className: D,
|
|
25
|
+
style: F
|
|
26
|
+
}) {
|
|
27
|
+
const f = g !== void 0, [H, P] = J(""), c = f ? g : H, h = N(null), v = N(null), b = N(i?.length ?? 0);
|
|
28
|
+
y(() => {
|
|
29
|
+
const e = i?.length ?? 0;
|
|
30
|
+
e > b.current && v.current?.focus(), b.current = e;
|
|
31
|
+
}, [i?.length]);
|
|
32
|
+
const R = !!n, A = !!o;
|
|
33
|
+
y(() => {
|
|
34
|
+
(R || A) && v.current?.focus();
|
|
35
|
+
}, [R, A]);
|
|
36
|
+
const d = m(
|
|
37
|
+
(e) => {
|
|
38
|
+
f || P(e), C?.(e);
|
|
39
|
+
},
|
|
40
|
+
[f, C]
|
|
41
|
+
), p = m(() => {
|
|
42
|
+
const e = c.trim();
|
|
43
|
+
(e || i && i.length > 0) && (z?.(e), d(""));
|
|
44
|
+
}, [c, i, z, d]), V = m(
|
|
45
|
+
(e) => {
|
|
46
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), p());
|
|
47
|
+
},
|
|
48
|
+
[p]
|
|
49
|
+
), L = m(
|
|
50
|
+
(e) => {
|
|
51
|
+
const r = ie.parse(e)?.emoji ?? e;
|
|
52
|
+
u ? u(r) : d(c + r);
|
|
53
|
+
},
|
|
54
|
+
[u, d, c]
|
|
55
|
+
), O = m(
|
|
56
|
+
(e) => {
|
|
57
|
+
const r = e.target.files;
|
|
58
|
+
r && r.length > 0 && k?.(Array.from(r)), h.current && (h.current.value = "");
|
|
59
|
+
},
|
|
60
|
+
[k]
|
|
61
|
+
), U = c.trim().length > 0, x = i && i.length > 0, E = x && i.some((e) => "isTemp" in e && e.isTemp), q = U || x && !E, G = !!(o || n);
|
|
62
|
+
return /* @__PURE__ */ s(
|
|
63
|
+
ee,
|
|
64
|
+
{
|
|
65
|
+
className: `${t.root} ${D || ""}`,
|
|
66
|
+
style: F,
|
|
67
|
+
"data-testid": "chat-input",
|
|
68
|
+
px: "md",
|
|
69
|
+
pb: "md",
|
|
70
|
+
children: [
|
|
71
|
+
!B && /* @__PURE__ */ a(
|
|
72
|
+
"input",
|
|
73
|
+
{
|
|
74
|
+
ref: h,
|
|
75
|
+
type: "file",
|
|
76
|
+
multiple: !0,
|
|
77
|
+
accept: "*/*",
|
|
78
|
+
className: t.hiddenFileInput,
|
|
79
|
+
onChange: O,
|
|
80
|
+
tabIndex: -1
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
/* @__PURE__ */ s("div", { className: t.inputRow, children: [
|
|
84
|
+
/* @__PURE__ */ s(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
className: `${t.inputBox} ${G ? t.withHeader : ""}`,
|
|
88
|
+
children: [
|
|
89
|
+
o ? /* @__PURE__ */ s("div", { className: t.header, children: [
|
|
90
|
+
/* @__PURE__ */ a("div", { className: t.headerIcon, children: /* @__PURE__ */ a(l, { icon: M, size: 20 }) }),
|
|
91
|
+
/* @__PURE__ */ s("div", { className: t.headerBar, "data-variant": "edit", children: [
|
|
92
|
+
/* @__PURE__ */ a("div", { className: t.headerTitle, "data-variant": "edit", children: "Edit" }),
|
|
93
|
+
/* @__PURE__ */ a("div", { className: t.headerText, children: o.text })
|
|
94
|
+
] }),
|
|
95
|
+
/* @__PURE__ */ a(
|
|
96
|
+
j,
|
|
97
|
+
{
|
|
98
|
+
size: "sm",
|
|
99
|
+
onClick: o.onCancel,
|
|
100
|
+
"aria-label": "Close"
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
] }) : n ? /* @__PURE__ */ s("div", { className: t.header, children: [
|
|
104
|
+
/* @__PURE__ */ a("div", { className: t.headerIcon, children: /* @__PURE__ */ a(l, { icon: Q, size: 20 }) }),
|
|
105
|
+
/* @__PURE__ */ s("div", { className: t.headerBar, "data-variant": "reply", children: [
|
|
106
|
+
/* @__PURE__ */ a("div", { className: t.headerTitle, "data-variant": "reply", children: n.senderName }),
|
|
107
|
+
/* @__PURE__ */ a("div", { className: t.headerText, children: (() => {
|
|
108
|
+
if (n.text && n.text.trim().length > 0) return n.text;
|
|
109
|
+
if (n.attachmentName) {
|
|
110
|
+
const r = n.attachmentKind === "image" ? T : n.attachmentKind === "video" ? W : X;
|
|
111
|
+
return /* @__PURE__ */ s("span", { className: t.headerAttachment, children: [
|
|
112
|
+
/* @__PURE__ */ a(l, { icon: r, size: 14 }),
|
|
113
|
+
/* @__PURE__ */ a("span", { children: n.attachmentName })
|
|
114
|
+
] });
|
|
115
|
+
}
|
|
116
|
+
return "";
|
|
117
|
+
})() })
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ a(
|
|
120
|
+
j,
|
|
121
|
+
{
|
|
122
|
+
size: "sm",
|
|
123
|
+
onClick: n.onCancel,
|
|
124
|
+
"aria-label": "Close"
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
] }) : null,
|
|
128
|
+
x && /* @__PURE__ */ a("div", { className: t.attachments, children: /* @__PURE__ */ a(
|
|
129
|
+
te,
|
|
130
|
+
{
|
|
131
|
+
files: i,
|
|
132
|
+
mode: "draft",
|
|
133
|
+
onRemove: S
|
|
134
|
+
}
|
|
135
|
+
) }),
|
|
136
|
+
/* @__PURE__ */ s("div", { className: t.inputArea, children: [
|
|
137
|
+
/* @__PURE__ */ a(
|
|
138
|
+
ne,
|
|
139
|
+
{
|
|
140
|
+
onChange: L,
|
|
141
|
+
showIcons: !1,
|
|
142
|
+
showRemoveButton: !1,
|
|
143
|
+
position: "top-start",
|
|
144
|
+
closeOnSelect: !1,
|
|
145
|
+
children: /* @__PURE__ */ a(
|
|
146
|
+
I,
|
|
147
|
+
{
|
|
148
|
+
variant: "subtle",
|
|
149
|
+
radius: "xl",
|
|
150
|
+
size: 34,
|
|
151
|
+
color: "gray",
|
|
152
|
+
className: t.iconButton,
|
|
153
|
+
"aria-label": "Emoji",
|
|
154
|
+
children: /* @__PURE__ */ a(l, { icon: Y, size: 24 })
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
),
|
|
159
|
+
/* @__PURE__ */ a(
|
|
160
|
+
ae,
|
|
161
|
+
{
|
|
162
|
+
ref: v,
|
|
163
|
+
classNames: {
|
|
164
|
+
root: t.textarea,
|
|
165
|
+
input: t.textareaInput
|
|
166
|
+
},
|
|
167
|
+
w: "100%",
|
|
168
|
+
flex: 1,
|
|
169
|
+
value: c,
|
|
170
|
+
onChange: (e) => d(e.currentTarget.value),
|
|
171
|
+
onKeyDown: V,
|
|
172
|
+
placeholder: K,
|
|
173
|
+
autosize: !0,
|
|
174
|
+
minRows: 1,
|
|
175
|
+
maxRows: 6,
|
|
176
|
+
disabled: w,
|
|
177
|
+
variant: "unstyled",
|
|
178
|
+
maxLength: $
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
!B && /* @__PURE__ */ a(
|
|
182
|
+
I,
|
|
183
|
+
{
|
|
184
|
+
variant: "subtle",
|
|
185
|
+
radius: "xl",
|
|
186
|
+
size: 34,
|
|
187
|
+
color: "gray",
|
|
188
|
+
className: t.iconButton,
|
|
189
|
+
"aria-label": "Attach file",
|
|
190
|
+
onClick: () => h.current?.click(),
|
|
191
|
+
children: /* @__PURE__ */ a(
|
|
192
|
+
l,
|
|
193
|
+
{
|
|
194
|
+
icon: Z,
|
|
195
|
+
size: 24,
|
|
196
|
+
style: { transform: "rotate(30deg)" }
|
|
197
|
+
}
|
|
198
|
+
)
|
|
199
|
+
}
|
|
200
|
+
)
|
|
201
|
+
] })
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
),
|
|
205
|
+
/* @__PURE__ */ a(
|
|
206
|
+
I,
|
|
207
|
+
{
|
|
208
|
+
className: t.sendButton,
|
|
209
|
+
variant: "filled",
|
|
210
|
+
color: "indigo",
|
|
211
|
+
radius: 12,
|
|
212
|
+
size: 50,
|
|
213
|
+
onClick: p,
|
|
214
|
+
disabled: w || !q,
|
|
215
|
+
loading: E,
|
|
216
|
+
"aria-label": "Send message",
|
|
217
|
+
children: /* @__PURE__ */ a(l, { icon: _, size: 24 })
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
] })
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
se.displayName = "ChatInput";
|
|
226
|
+
export {
|
|
227
|
+
se as ChatInput
|
|
228
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const o = "_root_uj82d_1", d = "_sidebar_uj82d_23", t = "_chat_uj82d_45", _ = "_info_uj82d_67", r = "_drawerBody_uj82d_87", s = {
|
|
2
|
+
root: o,
|
|
3
|
+
sidebar: d,
|
|
4
|
+
chat: t,
|
|
5
|
+
info: _,
|
|
6
|
+
drawerBody: r
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
t as chat,
|
|
10
|
+
s as default,
|
|
11
|
+
r as drawerBody,
|
|
12
|
+
_ as info,
|
|
13
|
+
o as root,
|
|
14
|
+
d as sidebar
|
|
15
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ChatLayoutProps {
|
|
3
|
+
sidebar: React.ReactNode;
|
|
4
|
+
chat: React.ReactNode;
|
|
5
|
+
info?: React.ReactNode;
|
|
6
|
+
showInfo?: boolean;
|
|
7
|
+
sidebarOpened?: boolean;
|
|
8
|
+
onSidebarClose?: () => void;
|
|
9
|
+
maxWidth?: number;
|
|
10
|
+
className?: string;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
}
|
|
13
|
+
export declare function ChatLayout({ sidebar, chat, info, showInfo, sidebarOpened, onSidebarClose, maxWidth, className, style, }: ChatLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare namespace ChatLayout {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/ChatLayout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,cAAc,EACd,QAAe,EACf,SAAS,EACT,KAAK,GACN,EAAE,eAAe,2CAuBjB;yBAjCe,UAAU"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Drawer as h } from "@mantine/core";
|
|
3
|
+
import a from "./ChatLayout.module.css.js";
|
|
4
|
+
function p({
|
|
5
|
+
sidebar: o,
|
|
6
|
+
chat: r,
|
|
7
|
+
info: s,
|
|
8
|
+
showInfo: i,
|
|
9
|
+
sidebarOpened: d,
|
|
10
|
+
onSidebarClose: l,
|
|
11
|
+
maxWidth: c = 1680,
|
|
12
|
+
className: t,
|
|
13
|
+
style: m
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ n(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
className: `${a.root}${t ? ` ${t}` : ""}`,
|
|
19
|
+
style: { ...m, "--chat-layout-max-width": `${c}px` },
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ e("div", { className: a.sidebar, children: o }),
|
|
22
|
+
/* @__PURE__ */ e(
|
|
23
|
+
h,
|
|
24
|
+
{
|
|
25
|
+
opened: !!d,
|
|
26
|
+
onClose: () => l?.(),
|
|
27
|
+
size: 320,
|
|
28
|
+
withCloseButton: !1,
|
|
29
|
+
padding: 0,
|
|
30
|
+
classNames: { body: a.drawerBody },
|
|
31
|
+
children: o
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ e("div", { className: a.chat, children: r }),
|
|
35
|
+
i && s && /* @__PURE__ */ e("div", { className: a.info, children: s })
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
p.displayName = "ChatLayout";
|
|
41
|
+
export {
|
|
42
|
+
p as ChatLayout
|
|
43
|
+
};
|