@layers-app/shared 0.4.4 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +13 -13
- package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/AppContainer.js +72 -79
- package/dist/components/AppContainer/AppContainer.module.css.js +6 -6
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +24 -22
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +46 -37
- package/dist/components/AppContainer/components/Header.d.ts.map +1 -1
- package/dist/components/AppContainer/components/Header.js +6 -5
- package/dist/components/AppContainer/components/Main.js +4 -4
- package/dist/components/AppContainer/components/SidebarToggleButton.d.ts.map +1 -1
- package/dist/components/AppContainer/components/SidebarToggleButton.js +25 -16
- package/dist/components/AppContainer/components/SlideAnimation.js +4 -4
- package/dist/components/AppContainer/components/ToolSidebar.d.ts.map +1 -1
- package/dist/components/AppContainer/components/ToolSidebar.js +161 -128
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +131 -121
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.js +59 -56
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +4 -3
- package/dist/components/AppContainer/types.d.ts +1 -0
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/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/ModalHeader.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +37 -37
- 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 +84 -37
- package/dist/components/AttachmentsGalleryModal/helpers.d.ts +8 -0
- package/dist/components/AttachmentsGalleryModal/helpers.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/helpers.js +22 -17
- package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.js +28 -25
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.js +36 -41
- package/dist/components/AttachmentsGalleryModal/styles.module.css.js +7 -7
- package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
- package/dist/components/AttachmentsPreview/AttachmentsPreview.js +138 -84
- package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +24 -14
- package/dist/components/BouncingLogo/BouncingLogo.d.ts +1 -3
- package/dist/components/BouncingLogo/BouncingLogo.d.ts.map +1 -1
- package/dist/components/BouncingLogo/BouncingLogo.js +14 -20
- package/dist/components/BouncingLogo/BouncingLogo.module.css.js +4 -8
- package/dist/components/Chat/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 +49 -0
- package/dist/components/Chat/ChatInput/index.d.ts +74 -0
- package/dist/components/Chat/ChatInput/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatInput/index.js +288 -0
- package/dist/components/Chat/ChatInput/smilePlusIcon.d.ts +3 -0
- package/dist/components/Chat/ChatInput/smilePlusIcon.d.ts.map +1 -0
- package/dist/components/Chat/ChatInput/smilePlusIcon.js +49 -0
- package/dist/components/Chat/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 +47 -0
- package/dist/components/Chat/ChatMessage/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatMessage/index.js +206 -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 +23 -0
- package/dist/components/Chat/MessageActions/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageActions/index.js +68 -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 +21 -0
- package/dist/components/Chat/MessageList/index.d.ts +39 -0
- package/dist/components/Chat/MessageList/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageList/index.js +159 -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 +32 -0
- package/dist/components/Chat/MessageReactions/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageReactions/index.js +72 -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 +11 -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 +68 -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/CircleColorPicker/CircleColorPicker.d.ts.map +1 -1
- package/dist/components/CircleColorPicker/CircleColorPicker.js +17 -15
- package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
- package/dist/components/ColorPicker/ColorPicker.module.css.js +32 -26
- package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerList.js +81 -68
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerToolbar.js +75 -70
- package/dist/components/ColorPicker/icons.js +5 -5
- package/dist/components/ColorPicker/types.d.ts +6 -0
- package/dist/components/ColorPicker/types.d.ts.map +1 -1
- package/dist/components/ColorPicker/types.js +53 -11
- package/dist/components/ColorPicker/useRecentColors.d.ts +3 -1
- package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -1
- package/dist/components/ColorPicker/useRecentColors.js +43 -20
- package/dist/components/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/EmojiPanel.d.ts +2 -1
- package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.js +73 -72
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +23 -1
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.js +126 -88
- package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
- package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/IconsPanel.js +28 -25
- package/dist/components/EntityIcon.d.ts +1 -0
- package/dist/components/EntityIcon.d.ts.map +1 -1
- package/dist/components/EntityIcon.js +90 -33
- package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
- package/dist/components/ErrorPage/components/Error403.d.ts +5 -1
- package/dist/components/ErrorPage/components/Error403.d.ts.map +1 -1
- package/dist/components/ErrorPage/components/Error403.js +25 -21
- package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
- package/dist/components/ErrorPage/index.d.ts +5 -1
- package/dist/components/ErrorPage/index.d.ts.map +1 -1
- package/dist/components/ErrorPage/index.js +17 -10
- package/dist/components/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/MusicPlayerBar/components/HoverActions.js +28 -28
- package/dist/components/NavMenu/NavMenu.d.ts +7 -1
- package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
- package/dist/components/NavMenu/NavMenu.js +54 -44
- package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
- package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuItem.js +84 -84
- package/dist/components/NavMenu/types.d.ts +4 -0
- package/dist/components/NavMenu/types.d.ts.map +1 -1
- package/dist/components/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/WorkspaceMenu/WorkspaceItem.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceItem.js +16 -14
- 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/config/envConfig.d.ts +2 -0
- package/dist/config/envConfig.d.ts.map +1 -1
- package/dist/config/envConfig.js +41 -37
- package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
- package/dist/helpers/showNotifications.d.ts +15 -0
- package/dist/helpers/showNotifications.d.ts.map +1 -1
- package/dist/helpers/showNotifications.js +114 -72
- package/dist/helpers/showNotifications.module.css.js +16 -4
- package/dist/hooks/useUiPref.d.ts +2 -0
- package/dist/hooks/useUiPref.d.ts.map +1 -0
- package/dist/hooks/useUiPref.js +80 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +588 -527
- 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,40 @@
|
|
|
1
|
+
import { jsxs as r, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { getAuthorColor as y } from "../colors.js";
|
|
3
|
+
import t from "./MessageReply.module.css.js";
|
|
4
|
+
function p({
|
|
5
|
+
title: i,
|
|
6
|
+
subtitle: l,
|
|
7
|
+
color: o,
|
|
8
|
+
outgoing: a,
|
|
9
|
+
onClick: e,
|
|
10
|
+
className: m,
|
|
11
|
+
style: v
|
|
12
|
+
}) {
|
|
13
|
+
const s = a ? void 0 : o ? y(o) : void 0;
|
|
14
|
+
return /* @__PURE__ */ r(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
className: `${t.root} ${m || ""}`,
|
|
18
|
+
style: v,
|
|
19
|
+
"data-outgoing": a || void 0,
|
|
20
|
+
"data-testid": "message-reply",
|
|
21
|
+
onClick: e,
|
|
22
|
+
tabIndex: e ? 0 : void 0,
|
|
23
|
+
role: e ? "button" : void 0,
|
|
24
|
+
onKeyDown: e ? (n) => {
|
|
25
|
+
n.key === "Enter" && e();
|
|
26
|
+
} : void 0,
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ d("div", { className: t.border, style: s ? { background: s } : void 0 }),
|
|
29
|
+
/* @__PURE__ */ r("div", { className: t.content, children: [
|
|
30
|
+
/* @__PURE__ */ d("div", { className: t.title, style: s ? { color: s } : void 0, "data-testid": "message-reply-title", children: i }),
|
|
31
|
+
/* @__PURE__ */ d("div", { className: t.subtitle, "data-testid": "message-reply-subtitle", children: l })
|
|
32
|
+
] })
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
p.displayName = "MessageReply";
|
|
38
|
+
export {
|
|
39
|
+
p as MessageReply
|
|
40
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type MessageDeliveryStatus = 'sending' | 'sent' | 'delivered' | 'read' | 'error';
|
|
3
|
+
export interface MessageStatusProps {
|
|
4
|
+
status: MessageDeliveryStatus;
|
|
5
|
+
/** Additional className */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** Custom style */
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
}
|
|
10
|
+
export declare function MessageStatus({ status, className, style }: MessageStatusProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare namespace MessageStatus {
|
|
12
|
+
var displayName: string;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/MessageStatus/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;AAIxF,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AA+CD,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,kBAAkB,2CAsC7E;yBAtCe,aAAa"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as n, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import r from "react";
|
|
3
|
+
import i from "./MessageStatus.module.css.js";
|
|
4
|
+
const v = 500;
|
|
5
|
+
function y(e) {
|
|
6
|
+
return /* @__PURE__ */ l("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: 1.5, ...e, children: [
|
|
7
|
+
/* @__PURE__ */ n("circle", { cx: "8", cy: "8", r: "6" }),
|
|
8
|
+
/* @__PURE__ */ n("polyline", { points: "8,4 8,8" }),
|
|
9
|
+
/* @__PURE__ */ n("polyline", { points: "8,8 10.5,10" })
|
|
10
|
+
] });
|
|
11
|
+
}
|
|
12
|
+
function x(e) {
|
|
13
|
+
return /* @__PURE__ */ n("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: 1.5, ...e, children: /* @__PURE__ */ n("polyline", { points: "3,8.5 6.5,12 13,4" }) });
|
|
14
|
+
}
|
|
15
|
+
function u(e) {
|
|
16
|
+
return /* @__PURE__ */ l("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: 1.5, ...e, children: [
|
|
17
|
+
/* @__PURE__ */ n("polyline", { points: "1.5,8.5 5,12 11.5,4" }),
|
|
18
|
+
/* @__PURE__ */ n("polyline", { points: "5.5,8.5 9,12 15.5,4" })
|
|
19
|
+
] });
|
|
20
|
+
}
|
|
21
|
+
function S(e) {
|
|
22
|
+
return /* @__PURE__ */ l("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: 1.5, ...e, children: [
|
|
23
|
+
/* @__PURE__ */ n("circle", { cx: "8", cy: "8", r: "6" }),
|
|
24
|
+
/* @__PURE__ */ n("line", { x1: "8", y1: "4.5", x2: "8", y2: "9" }),
|
|
25
|
+
/* @__PURE__ */ n("circle", { cx: "8", cy: "11.5", r: "0.5", fill: "currentColor", stroke: "none" })
|
|
26
|
+
] });
|
|
27
|
+
}
|
|
28
|
+
const h = {
|
|
29
|
+
sending: y,
|
|
30
|
+
sent: x,
|
|
31
|
+
delivered: u,
|
|
32
|
+
read: u,
|
|
33
|
+
error: S
|
|
34
|
+
};
|
|
35
|
+
function C({ status: e, className: d, style: a }) {
|
|
36
|
+
const [f, c] = r.useState(!1);
|
|
37
|
+
r.useEffect(() => {
|
|
38
|
+
if (e !== "sending") {
|
|
39
|
+
c(!1);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const g = setTimeout(() => c(!0), v);
|
|
43
|
+
return () => clearTimeout(g);
|
|
44
|
+
}, [e]);
|
|
45
|
+
const o = e === "sending" && !f ? null : e, s = o ? h[o] : null, p = o === "error" ? "var(--mantine-color-red-6)" : "currentColor", t = r.useRef(null), m = t.current !== null && t.current !== e;
|
|
46
|
+
return r.useEffect(() => {
|
|
47
|
+
t.current = e;
|
|
48
|
+
}, [e]), /* @__PURE__ */ n(
|
|
49
|
+
"span",
|
|
50
|
+
{
|
|
51
|
+
className: `${i.root} ${d || ""}`,
|
|
52
|
+
style: { ...a, color: p },
|
|
53
|
+
"data-testid": "message-status",
|
|
54
|
+
"data-status": e,
|
|
55
|
+
"aria-label": e,
|
|
56
|
+
children: s && /* @__PURE__ */ n(
|
|
57
|
+
s,
|
|
58
|
+
{
|
|
59
|
+
className: `${i.icon}${m ? ` ${i.animateIn}` : ""}`
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
C.displayName = "MessageStatus";
|
|
66
|
+
export {
|
|
67
|
+
C as MessageStatus
|
|
68
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ServiceMessageProps {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
subtitle?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
}
|
|
9
|
+
export declare function ServiceMessage({ children, subtitle, title, className, style }: ServiceMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare namespace ServiceMessage {
|
|
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/ServiceMessage/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,mBAAmB,2CAYlG;yBAZe,cAAc"}
|
|
@@ -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
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
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AAC;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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CircleColorPicker.d.ts","sourceRoot":"","sources":["../../../src/components/CircleColorPicker/CircleColorPicker.tsx"],"names":[],"mappings":"AAGA,OAAO,EAIL,gBAAgB,
|
|
1
|
+
{"version":3,"file":"CircleColorPicker.d.ts","sourceRoot":"","sources":["../../../src/components/CircleColorPicker/CircleColorPicker.tsx"],"names":[],"mappings":"AAGA,OAAO,EAIL,gBAAgB,EAIhB,SAAS,EAOV,MAAM,eAAe,CAAC;AAevB,eAAO,MAAM,iBAAiB,GAAI,mDAK/B;IACD,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,4CAiFA,CAAC"}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { jsxs as h, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as E, useState as u, useEffect as H } from "react";
|
|
3
3
|
import { useTranslation as S } from "react-i18next";
|
|
4
|
-
import { useMantineTheme as k,
|
|
4
|
+
import { useMantineTheme as k, useComputedColorScheme as V, parseThemeColor as b, Menu as m, ActionIcon as I, ColorSwatch as M, Stack as j, ColorPicker as w, DEFAULT_THEME as y, TextInput as D, isColorValid as z, Button as A } from "@mantine/core";
|
|
5
5
|
const d = (e, t) => !e || typeof e != "string" ? null : e === "var(--mantine-color-bright)" ? t === "dark" ? "#ffffff" : "#000000" : e, L = ({
|
|
6
6
|
value: e,
|
|
7
7
|
onChange: t,
|
|
8
8
|
menuProps: p,
|
|
9
9
|
colorPickerProps: x
|
|
10
10
|
}) => {
|
|
11
|
-
const { t: s } = S("common"), f = k(),
|
|
12
|
-
|
|
11
|
+
const { t: s } = S("common"), f = k(), l = V("light", {
|
|
12
|
+
getInitialValueInEffect: !0
|
|
13
|
+
}), a = E(() => {
|
|
14
|
+
const r = d(e, l);
|
|
13
15
|
return r ? b({ color: r, theme: f }) : { value: "", color: "", isThemeColor: !1, shade: void 0 };
|
|
14
|
-
}, [e, f,
|
|
16
|
+
}, [e, f, l]), [C, i] = u(a.value), [g, n] = u(null);
|
|
15
17
|
H(() => {
|
|
16
|
-
i(d(e,
|
|
17
|
-
}, [
|
|
18
|
+
i(d(e, l) || "");
|
|
19
|
+
}, [l, e]);
|
|
18
20
|
const [T, v] = u(!1);
|
|
19
21
|
return /* @__PURE__ */ h(
|
|
20
22
|
m,
|
|
@@ -24,39 +26,39 @@ const d = (e, t) => !e || typeof e != "string" ? null : e === "var(--mantine-col
|
|
|
24
26
|
onChange: v,
|
|
25
27
|
...p,
|
|
26
28
|
children: [
|
|
27
|
-
/* @__PURE__ */ o(m.Target, { children: /* @__PURE__ */ o(
|
|
28
|
-
/* @__PURE__ */ o(m.Dropdown, { style: { padding: 8, minWidth: 220 }, children: /* @__PURE__ */ h(
|
|
29
|
+
/* @__PURE__ */ o(m.Target, { children: /* @__PURE__ */ o(I, { size: "md", variant: "subtle", radius: "xl", children: /* @__PURE__ */ o(M, { color: a.value || "transparent" }) }) }),
|
|
30
|
+
/* @__PURE__ */ o(m.Dropdown, { style: { padding: 8, minWidth: 220 }, children: /* @__PURE__ */ h(j, { gap: "sm", children: [
|
|
29
31
|
/* @__PURE__ */ o(
|
|
30
|
-
|
|
32
|
+
w,
|
|
31
33
|
{
|
|
32
34
|
value: a.value,
|
|
33
35
|
onChange: (r) => {
|
|
34
|
-
t(r), i(r),
|
|
36
|
+
t(r), i(r), n(null);
|
|
35
37
|
},
|
|
36
38
|
format: "hex",
|
|
37
|
-
swatches: Object.values(
|
|
39
|
+
swatches: Object.values(y.colors).map((r) => r[5]),
|
|
38
40
|
...x
|
|
39
41
|
}
|
|
40
42
|
),
|
|
41
43
|
/* @__PURE__ */ o(
|
|
42
|
-
|
|
44
|
+
D,
|
|
43
45
|
{
|
|
44
46
|
label: s("HEXValue"),
|
|
45
47
|
onChange: (r) => {
|
|
46
48
|
const c = r.currentTarget.value;
|
|
47
|
-
i(c),
|
|
49
|
+
i(c), z(c) ? (t(c), n(null)) : n(s("invalidColorFormat"));
|
|
48
50
|
},
|
|
49
51
|
error: g,
|
|
50
52
|
value: C
|
|
51
53
|
}
|
|
52
54
|
),
|
|
53
55
|
/* @__PURE__ */ o(
|
|
54
|
-
|
|
56
|
+
A,
|
|
55
57
|
{
|
|
56
58
|
variant: "light",
|
|
57
59
|
size: "xs",
|
|
58
60
|
onClick: () => {
|
|
59
|
-
t(null),
|
|
61
|
+
t(null), n(null);
|
|
60
62
|
},
|
|
61
63
|
mt: "xs",
|
|
62
64
|
children: s("resetColor")
|