@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,21 @@
|
|
|
1
|
+
import { jsxs as m, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import e from "./ServiceMessage.module.css.js";
|
|
3
|
+
function n({ children: t, subtitle: s, title: r, className: a, style: c }) {
|
|
4
|
+
return /* @__PURE__ */ m(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
className: `${e.root}${a ? ` ${a}` : ""}`,
|
|
8
|
+
style: c,
|
|
9
|
+
"data-testid": "service-message",
|
|
10
|
+
children: [
|
|
11
|
+
s && /* @__PURE__ */ i("span", { className: e.subtitle, children: s }),
|
|
12
|
+
r && /* @__PURE__ */ i("span", { className: e.title, children: r }),
|
|
13
|
+
t
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
n.displayName = "ServiceMessage";
|
|
19
|
+
export {
|
|
20
|
+
n as ServiceMessage
|
|
21
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface UnreadSeparatorProps {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
}
|
|
7
|
+
export declare function UnreadSeparator({ children, className, style, }: UnreadSeparatorProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare namespace UnreadSeparator {
|
|
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/UnreadSeparator/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,eAAe,CAAC,EAC9B,QAA4B,EAC5B,SAAS,EACT,KAAK,GACN,EAAE,oBAAoB,2CAMtB;yBAVe,eAAe"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { ChatPill as o } from "../ChatPill/index.js";
|
|
3
|
+
function d({
|
|
4
|
+
children: r = "Unread Messages",
|
|
5
|
+
className: a,
|
|
6
|
+
style: e
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ t(o, { className: a, style: e, "data-testid": "unread-separator", children: r });
|
|
9
|
+
}
|
|
10
|
+
d.displayName = "UnreadSeparator";
|
|
11
|
+
export {
|
|
12
|
+
d as UnreadSeparator
|
|
13
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type AvatarColorIndex = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 'gray';
|
|
2
|
+
export declare const AVATAR_COLORS: Record<AvatarColorIndex, string>;
|
|
3
|
+
export type AuthorColorIndex = 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
4
|
+
export declare const AUTHOR_COLORS: Record<AuthorColorIndex, string>;
|
|
5
|
+
export declare function getAvatarColor(index?: AvatarColorIndex | number): string;
|
|
6
|
+
export declare function getAuthorColor(index?: AuthorColorIndex | number): string;
|
|
7
|
+
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/colors.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;AAElE,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAS1D,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEzD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAQ1D,CAAC;AAEF,wBAAgB,cAAc,CAAC,KAAK,CAAC,EAAE,gBAAgB,GAAG,MAAM,GAAG,MAAM,CAExE;AAED,wBAAgB,cAAc,CAAC,KAAK,CAAC,EAAE,gBAAgB,GAAG,MAAM,GAAG,MAAM,CAExE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const c = {
|
|
2
|
+
1: "#e36f74",
|
|
3
|
+
2: "#fca76f",
|
|
4
|
+
3: "#a693e9",
|
|
5
|
+
4: "#78ca5c",
|
|
6
|
+
5: "#6ac9cc",
|
|
7
|
+
6: "#50a2e9",
|
|
8
|
+
7: "#f078ae",
|
|
9
|
+
gray: "#9aa7b2"
|
|
10
|
+
}, t = {
|
|
11
|
+
1: "#b7635d",
|
|
12
|
+
2: "#c07844",
|
|
13
|
+
3: "#8365ab",
|
|
14
|
+
4: "#539e4f",
|
|
15
|
+
5: "#5397b4",
|
|
16
|
+
6: "#4979a3",
|
|
17
|
+
7: "#b3577a"
|
|
18
|
+
};
|
|
19
|
+
function e(a) {
|
|
20
|
+
return c[a] ?? c[1];
|
|
21
|
+
}
|
|
22
|
+
function o(a) {
|
|
23
|
+
return t[a] ?? t[6];
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
t as AUTHOR_COLORS,
|
|
27
|
+
c as AVATAR_COLORS,
|
|
28
|
+
o as getAuthorColor,
|
|
29
|
+
e as getAvatarColor
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/icons.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY;;;CAexB,CAAC;AAIF,eAAO,MAAM,SAAS;;;CAerB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsxs as r, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
const e = { flexShrink: 0, color: "var(--mantine-primary-color-filled)" }, i = { flexShrink: 0, color: "var(--mantine-color-dimmed)" }, l = () => /* @__PURE__ */ r(
|
|
3
|
+
"svg",
|
|
4
|
+
{
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
width: "16",
|
|
7
|
+
height: "16",
|
|
8
|
+
viewBox: "0 0 16 16",
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
style: e,
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ o("circle", { cx: "8", cy: "8", r: "8" }),
|
|
13
|
+
/* @__PURE__ */ o(
|
|
14
|
+
"path",
|
|
15
|
+
{
|
|
16
|
+
d: "M6.5 11.5L3.5 8.5L4.5 7.5L6.5 9.5L11.5 4.5L12.5 5.5L6.5 11.5Z",
|
|
17
|
+
fill: "var(--mantine-color-white)"
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
l.displayName = "VerifiedIcon";
|
|
24
|
+
const t = () => /* @__PURE__ */ r(
|
|
25
|
+
"svg",
|
|
26
|
+
{
|
|
27
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28
|
+
width: "16",
|
|
29
|
+
height: "16",
|
|
30
|
+
viewBox: "0 0 16 16",
|
|
31
|
+
fill: "none",
|
|
32
|
+
style: i,
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ o(
|
|
35
|
+
"path",
|
|
36
|
+
{
|
|
37
|
+
d: "M8 2C8.55 2 9 2.45 9 3V9.17L7 7.17V3C7 2.45 7.45 2 8 2ZM4 6V9H6L8 11V10.83L3.41 6.24C3.16 6.5 3 6.83 3 7.2V8.8C3 9.46 3.45 10 4 10H6L8.71 12.71C8.89 12.89 9 12.95 9 13V13C9 13 8.89 13.05 8.71 12.87L4 6ZM12.5 3.5L11.5 4.5L13 6L14 5L12.5 3.5ZM2 2L1 3L4.17 6.17L4 6H2V10H4L8 14V10.83L11.17 14L12 13.17L2 2Z",
|
|
38
|
+
fill: "currentColor"
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ o("line", { x1: "2", y1: "14", x2: "14", y2: "2", stroke: "currentColor", strokeWidth: "1.5" })
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
t.displayName = "MutedIcon";
|
|
46
|
+
export {
|
|
47
|
+
t as MutedIcon,
|
|
48
|
+
l as VerifiedIcon
|
|
49
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export * from './CallMessage';
|
|
2
|
+
export * from './ChatBubble';
|
|
3
|
+
export * from './ChatMessage';
|
|
4
|
+
export * from './ChatInput';
|
|
5
|
+
export * from './ChatHeader';
|
|
6
|
+
export * from './ChatLayout';
|
|
7
|
+
export * from './MessageList';
|
|
8
|
+
export * from './MediaDocument';
|
|
9
|
+
export * from './MessageAuthor';
|
|
10
|
+
export * from './MessageMeta';
|
|
11
|
+
export * from './MessageStatus';
|
|
12
|
+
export * from './MessageReply';
|
|
13
|
+
export * from './MessageActions';
|
|
14
|
+
export * from './MessageReactions';
|
|
15
|
+
export * from './MessageForward';
|
|
16
|
+
export * from './ChatPill';
|
|
17
|
+
export * from './DayMeta';
|
|
18
|
+
export * from './UnreadSeparator';
|
|
19
|
+
export * from './ServiceMessage';
|
|
20
|
+
export * from './DialogItem';
|
|
21
|
+
export * from './DialogList';
|
|
22
|
+
export * from './colors';
|
|
23
|
+
export * from './types';
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ChatMessageData, Chat } from './types';
|
|
2
|
+
export interface MockUser {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
avatarSrc?: string;
|
|
6
|
+
avatarColor?: 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
7
|
+
online?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const MOCK_USERS: MockUser[];
|
|
10
|
+
export interface MockChat {
|
|
11
|
+
id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
chatType?: Chat['type'];
|
|
14
|
+
icon?: string | null;
|
|
15
|
+
avatarSrc?: string;
|
|
16
|
+
avatarColor?: 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
17
|
+
lastMessage?: {
|
|
18
|
+
text: string;
|
|
19
|
+
senderName?: string;
|
|
20
|
+
timestamp: string;
|
|
21
|
+
};
|
|
22
|
+
unreadCount?: number;
|
|
23
|
+
muted?: boolean;
|
|
24
|
+
online?: boolean;
|
|
25
|
+
typing?: string;
|
|
26
|
+
pinned?: boolean;
|
|
27
|
+
draft?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const MOCK_CHATS: MockChat[];
|
|
30
|
+
export declare const MOCK_CHANNELS: MockChat[];
|
|
31
|
+
export declare const MOCK_MESSAGES_BY_CHAT: Record<string, ChatMessageData[]>;
|
|
32
|
+
//# sourceMappingURL=mock-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-data.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/mock-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAOf,IAAI,EACL,MAAM,SAAS,CAAC;AAIjB,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,UAAU,EAAE,QAAQ,EAMhC,CAAC;AAkCF,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxC,WAAW,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,UAAU,EAAE,QAAQ,EAIhC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,QAAQ,EAGnC,CAAC;AAoHF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,CAInE,CAAC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat Message Schema — Universal message structure for the chat system.
|
|
3
|
+
*
|
|
4
|
+
* Design principles (from Matrix, Telegram, Slack, Signal):
|
|
5
|
+
* 1. Envelope + Content separation: shared metadata vs type-specific payload
|
|
6
|
+
* 2. Discriminated union on `type`: TypeScript narrows `content` automatically
|
|
7
|
+
* 3. Attachments as first-class: separate from message type (any message can have files)
|
|
8
|
+
* 4. Reactions/replies on envelope: they apply to any message type
|
|
9
|
+
* 5. Extensible: `metadata` bag for app-specific data, new types don't break old code
|
|
10
|
+
*
|
|
11
|
+
* Compatible with existing backend patterns:
|
|
12
|
+
* - ApiComments.Comment (parentType/parentId for entity binding)
|
|
13
|
+
* - BackendMessage (meet package text chat)
|
|
14
|
+
* - LivekitStreamEvent (discriminated union pattern)
|
|
15
|
+
*/
|
|
16
|
+
export type ChatMessageStatus = 'sending' | 'sent' | 'delivered' | 'read' | 'failed';
|
|
17
|
+
export interface MessageReaction {
|
|
18
|
+
emoji: string;
|
|
19
|
+
count: number;
|
|
20
|
+
userIds?: string[];
|
|
21
|
+
active?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface MessageAttachment {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
mimeType: string;
|
|
27
|
+
size: number;
|
|
28
|
+
url: string;
|
|
29
|
+
thumbnailUrl?: string;
|
|
30
|
+
width?: number;
|
|
31
|
+
height?: number;
|
|
32
|
+
duration?: number;
|
|
33
|
+
}
|
|
34
|
+
export interface MessageEnvelope {
|
|
35
|
+
id: string;
|
|
36
|
+
chatId: string;
|
|
37
|
+
senderId: string;
|
|
38
|
+
timestamp: number;
|
|
39
|
+
status?: ChatMessageStatus;
|
|
40
|
+
editedAt?: number;
|
|
41
|
+
replyToId?: string;
|
|
42
|
+
replyToPreview?: {
|
|
43
|
+
senderId: string;
|
|
44
|
+
senderName: string;
|
|
45
|
+
text: string;
|
|
46
|
+
};
|
|
47
|
+
forwardFromId?: string;
|
|
48
|
+
forwardFromName?: string;
|
|
49
|
+
threadId?: string;
|
|
50
|
+
reactions?: MessageReaction[];
|
|
51
|
+
attachments?: MessageAttachment[];
|
|
52
|
+
metadata?: Record<string, unknown>;
|
|
53
|
+
}
|
|
54
|
+
export interface TextContent {
|
|
55
|
+
body: string;
|
|
56
|
+
format?: 'plain' | 'markdown' | 'html';
|
|
57
|
+
mentions?: string[];
|
|
58
|
+
}
|
|
59
|
+
export interface MediaContent {
|
|
60
|
+
mediaType: 'image' | 'video' | 'audio';
|
|
61
|
+
url: string;
|
|
62
|
+
mimeType: string;
|
|
63
|
+
size: number;
|
|
64
|
+
name?: string;
|
|
65
|
+
thumbnailUrl?: string;
|
|
66
|
+
width?: number;
|
|
67
|
+
height?: number;
|
|
68
|
+
duration?: number;
|
|
69
|
+
caption?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface FileContent {
|
|
72
|
+
url: string;
|
|
73
|
+
name: string;
|
|
74
|
+
mimeType: string;
|
|
75
|
+
size: number;
|
|
76
|
+
}
|
|
77
|
+
export interface CallContent {
|
|
78
|
+
callStatus: 'active' | 'ended' | 'missed' | 'declined';
|
|
79
|
+
callType: 'audio' | 'video';
|
|
80
|
+
duration?: number;
|
|
81
|
+
participantCount?: number;
|
|
82
|
+
participantIds?: string[];
|
|
83
|
+
}
|
|
84
|
+
export type ServiceAction = 'user_joined' | 'user_left' | 'user_invited' | 'user_removed' | 'channel_created' | 'channel_renamed' | 'channel_archived' | 'pinned_message' | 'unpinned_message' | 'call_started' | 'call_ended';
|
|
85
|
+
export interface ServiceContent {
|
|
86
|
+
action: ServiceAction;
|
|
87
|
+
actorId?: string;
|
|
88
|
+
targetId?: string;
|
|
89
|
+
title?: string;
|
|
90
|
+
description?: string;
|
|
91
|
+
}
|
|
92
|
+
export interface ChatTextMessage extends MessageEnvelope {
|
|
93
|
+
type: 'text';
|
|
94
|
+
content: TextContent;
|
|
95
|
+
}
|
|
96
|
+
export interface ChatMediaMessage extends MessageEnvelope {
|
|
97
|
+
type: 'media';
|
|
98
|
+
content: MediaContent;
|
|
99
|
+
}
|
|
100
|
+
export interface ChatFileMessage extends MessageEnvelope {
|
|
101
|
+
type: 'file';
|
|
102
|
+
content: FileContent;
|
|
103
|
+
}
|
|
104
|
+
export interface ChatCallMessage extends MessageEnvelope {
|
|
105
|
+
type: 'call';
|
|
106
|
+
content: CallContent;
|
|
107
|
+
}
|
|
108
|
+
export interface ChatServiceMessage extends MessageEnvelope {
|
|
109
|
+
type: 'service';
|
|
110
|
+
content: ServiceContent;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Union of all message types.
|
|
114
|
+
* Use `switch (msg.type)` to narrow and access type-specific `content`.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* function renderMessage(msg: ChatMessageData) {
|
|
118
|
+
* switch (msg.type) {
|
|
119
|
+
* case 'text': return <TextBubble body={msg.content.body} />;
|
|
120
|
+
* case 'media': return <MediaBubble url={msg.content.url} />;
|
|
121
|
+
* case 'call': return <CallBubble status={msg.content.callStatus} />;
|
|
122
|
+
* case 'service': return <ServiceBanner action={msg.content.action} />;
|
|
123
|
+
* case 'file': return <FileCard name={msg.content.name} />;
|
|
124
|
+
* }
|
|
125
|
+
* }
|
|
126
|
+
*/
|
|
127
|
+
export type ChatMessageData = ChatTextMessage | ChatMediaMessage | ChatFileMessage | ChatCallMessage | ChatServiceMessage;
|
|
128
|
+
export type ChatType = 'dm' | 'group' | 'channel';
|
|
129
|
+
export interface Chat {
|
|
130
|
+
id: string;
|
|
131
|
+
type: ChatType;
|
|
132
|
+
name: string;
|
|
133
|
+
icon?: string;
|
|
134
|
+
avatarUrl?: string;
|
|
135
|
+
memberCount?: number;
|
|
136
|
+
lastMessage?: {
|
|
137
|
+
senderId: string;
|
|
138
|
+
senderName?: string;
|
|
139
|
+
text: string;
|
|
140
|
+
timestamp: number;
|
|
141
|
+
type: ChatMessageData['type'];
|
|
142
|
+
};
|
|
143
|
+
unreadCount?: number;
|
|
144
|
+
muted?: boolean;
|
|
145
|
+
pinned?: boolean;
|
|
146
|
+
draft?: string;
|
|
147
|
+
createdAt: number;
|
|
148
|
+
metadata?: Record<string, unknown>;
|
|
149
|
+
}
|
|
150
|
+
export type ParticipantRole = 'owner' | 'admin' | 'member' | 'guest';
|
|
151
|
+
export interface ChatParticipant {
|
|
152
|
+
userId: string;
|
|
153
|
+
name: string;
|
|
154
|
+
avatarUrl?: string;
|
|
155
|
+
role: ParticipantRole;
|
|
156
|
+
online?: boolean;
|
|
157
|
+
lastSeen?: number;
|
|
158
|
+
}
|
|
159
|
+
//#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AAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;KAC/B,CAAC;IACF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAID,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAErE,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_commentComposerWrapper_jn3k1_1", e = "_commentComposerFloat_jn3k1_135", r = "_composerContainer_jn3k1_193", t = "_editorWrapper_jn3k1_225", n = "_editMode_jn3k1_383", p = {
|
|
2
2
|
commentComposerWrapper: o,
|
|
3
3
|
commentComposerFloat: e,
|
|
4
4
|
composerContainer: r,
|
|
5
5
|
editorWrapper: t,
|
|
6
|
-
editMode:
|
|
6
|
+
editMode: n
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
9
|
e as commentComposerFloat,
|
|
10
10
|
o as commentComposerWrapper,
|
|
11
11
|
r as composerContainer,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
p as default,
|
|
13
|
+
n as editMode,
|
|
14
14
|
t as editorWrapper
|
|
15
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/index.tsx"],"names":[],"mappings":"AA4BA,OAAO,EAAE,oBAAoB,EAAwB,MAAM,SAAS,CAAC;AA0CrE,eAAO,MAAM,eAAe,GAAI,4EAQ7B,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/index.tsx"],"names":[],"mappings":"AA4BA,OAAO,EAAE,oBAAoB,EAAwB,MAAM,SAAS,CAAC;AA0CrE,eAAO,MAAM,eAAe,GAAI,4EAQ7B,oBAAoB,4CAsctB,CAAC"}
|