@layers-app/shared 0.4.5 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/AppContainer.js +72 -79
- package/dist/components/AppContainer/AppContainer.module.css.js +6 -6
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +24 -22
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +46 -37
- package/dist/components/AppContainer/components/Header.d.ts.map +1 -1
- package/dist/components/AppContainer/components/Header.js +6 -5
- package/dist/components/AppContainer/components/Main.js +4 -4
- package/dist/components/AppContainer/components/SlideAnimation.js +4 -4
- package/dist/components/AppContainer/components/ToolSidebar.d.ts.map +1 -1
- package/dist/components/AppContainer/components/ToolSidebar.js +161 -128
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +131 -121
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.js +59 -56
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +4 -3
- package/dist/components/AppContainer/types.d.ts +1 -0
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +37 -37
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.js +68 -62
- package/dist/components/AttachmentsGalleryModal/helpers.d.ts +8 -0
- package/dist/components/AttachmentsGalleryModal/helpers.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/helpers.js +22 -17
- package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.js +28 -25
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.js +36 -41
- package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
- package/dist/components/AttachmentsPreview/AttachmentsPreview.js +135 -80
- package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +24 -14
- package/dist/components/BouncingLogo/BouncingLogo.d.ts +1 -3
- package/dist/components/BouncingLogo/BouncingLogo.d.ts.map +1 -1
- package/dist/components/BouncingLogo/BouncingLogo.js +14 -20
- package/dist/components/BouncingLogo/BouncingLogo.module.css.js +4 -8
- package/dist/components/Chat/ChatBubble/ChatBubble.module.css.js +5 -5
- package/dist/components/Chat/ChatInput/ChatInput.module.css.js +40 -28
- package/dist/components/Chat/ChatInput/index.d.ts +29 -1
- package/dist/components/Chat/ChatInput/index.d.ts.map +1 -1
- package/dist/components/Chat/ChatInput/index.js +178 -118
- package/dist/components/Chat/ChatInput/smilePlusIcon.d.ts +3 -0
- package/dist/components/Chat/ChatInput/smilePlusIcon.d.ts.map +1 -0
- package/dist/components/Chat/ChatInput/smilePlusIcon.js +49 -0
- package/dist/components/Chat/ChatMessage/ChatMessage.module.css.js +9 -9
- package/dist/components/Chat/ChatMessage/index.d.ts +2 -0
- package/dist/components/Chat/ChatMessage/index.d.ts.map +1 -1
- package/dist/components/Chat/ChatMessage/index.js +136 -118
- package/dist/components/Chat/MediaDocument/MediaDocument.module.css.js +4 -4
- package/dist/components/Chat/MessageActions/index.d.ts +7 -0
- package/dist/components/Chat/MessageActions/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageActions/index.js +33 -30
- package/dist/components/Chat/MessageList/MessageList.module.css.js +14 -10
- package/dist/components/Chat/MessageList/index.d.ts +30 -3
- package/dist/components/Chat/MessageList/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageList/index.js +154 -66
- package/dist/components/Chat/MessageReactions/MessageReactions.module.css.js +7 -7
- package/dist/components/Chat/MessageReactions/index.d.ts +17 -0
- package/dist/components/Chat/MessageReactions/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageReactions/index.js +60 -28
- package/dist/components/Chat/MessageStatus/MessageStatus.module.css.js +6 -4
- package/dist/components/Chat/MessageStatus/index.d.ts +1 -1
- package/dist/components/Chat/MessageStatus/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageStatus/index.js +49 -34
- package/dist/components/CircleColorPicker/CircleColorPicker.d.ts.map +1 -1
- package/dist/components/CircleColorPicker/CircleColorPicker.js +17 -15
- package/dist/components/ColorPicker/ColorPicker.module.css.js +26 -20
- package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerList.js +81 -68
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerToolbar.js +75 -70
- package/dist/components/ColorPicker/icons.js +5 -5
- package/dist/components/ColorPicker/types.d.ts +6 -0
- package/dist/components/ColorPicker/types.d.ts.map +1 -1
- package/dist/components/ColorPicker/types.js +53 -11
- package/dist/components/ColorPicker/useRecentColors.d.ts +3 -1
- package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -1
- package/dist/components/ColorPicker/useRecentColors.js +43 -20
- package/dist/components/EmojiPicker/EmojiPanel.d.ts +2 -1
- package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.js +73 -72
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +16 -1
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.js +121 -86
- package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/IconsPanel.js +28 -25
- package/dist/components/EntityIcon.d.ts +1 -0
- package/dist/components/EntityIcon.d.ts.map +1 -1
- package/dist/components/EntityIcon.js +80 -32
- package/dist/components/ErrorPage/components/Error403.d.ts +5 -1
- package/dist/components/ErrorPage/components/Error403.d.ts.map +1 -1
- package/dist/components/ErrorPage/components/Error403.js +25 -21
- package/dist/components/ErrorPage/index.d.ts +5 -1
- package/dist/components/ErrorPage/index.d.ts.map +1 -1
- package/dist/components/ErrorPage/index.js +17 -10
- package/dist/components/MusicPlayerBar/components/HoverActions.js +28 -28
- package/dist/components/NavMenu/NavMenu.d.ts +7 -1
- package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
- package/dist/components/NavMenu/NavMenu.js +54 -44
- package/dist/components/NavMenu/NavMenu.module.css.js +10 -10
- package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuItem.js +84 -84
- package/dist/components/NavMenu/types.d.ts +4 -0
- package/dist/components/NavMenu/types.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceItem.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceItem.js +16 -14
- package/dist/config/envConfig.d.ts +2 -0
- package/dist/config/envConfig.d.ts.map +1 -1
- package/dist/config/envConfig.js +41 -37
- package/dist/helpers/showNotifications.d.ts +15 -0
- package/dist/helpers/showNotifications.d.ts.map +1 -1
- package/dist/helpers/showNotifications.js +114 -72
- package/dist/helpers/showNotifications.module.css.js +16 -4
- package/dist/hooks/useUiPref.d.ts +2 -0
- package/dist/hooks/useUiPref.d.ts.map +1 -0
- package/dist/hooks/useUiPref.js +80 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +550 -540
- package/dist/lang/locales/ui_en.json.js +1 -1
- package/dist/lang/locales/ui_es.json.js +1 -1
- package/dist/lang/locales/ui_ru.json.js +1 -1
- package/package.json +1 -1
|
@@ -1,71 +1,159 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { ArrowDown01Icon as
|
|
4
|
-
import { HugeiconsIcon as
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
1
|
+
import { jsxs as T, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as D, useRef as i, useState as P, useEffect as u, useCallback as W, useImperativeHandle as k } from "react";
|
|
3
|
+
import { ArrowDown01Icon as C } from "@hugeicons/core-free-icons";
|
|
4
|
+
import { HugeiconsIcon as G } from "@hugeicons/react";
|
|
5
|
+
import { ScrollArea as J, ActionIcon as K } from "@mantine/core";
|
|
6
|
+
import s from "./MessageList.module.css.js";
|
|
7
|
+
const Q = D(
|
|
8
|
+
function({
|
|
9
|
+
children: L,
|
|
10
|
+
className: y,
|
|
11
|
+
style: E,
|
|
12
|
+
stickToBottom: f,
|
|
13
|
+
unreadCount: v = 0,
|
|
14
|
+
onStickChange: h,
|
|
15
|
+
resetKey: F,
|
|
16
|
+
onReachTop: g,
|
|
17
|
+
floatingTopAction: N,
|
|
18
|
+
bottomOffset: M = 0
|
|
19
|
+
}, $) {
|
|
20
|
+
const r = i(null), B = i(null), n = i(!0), w = i(0), [A, q] = P(!1), H = i(h), b = i(g), x = i(!1);
|
|
21
|
+
u(() => {
|
|
22
|
+
H.current = h;
|
|
23
|
+
}, [h]), u(() => {
|
|
24
|
+
b.current = g;
|
|
25
|
+
}, [g]), u(() => {
|
|
26
|
+
const e = r.current, o = B.current;
|
|
27
|
+
if (!e || !o) return;
|
|
28
|
+
const t = new IntersectionObserver(
|
|
29
|
+
(m) => {
|
|
30
|
+
if (!m[0]?.isIntersecting || x.current || !b.current || n.current) return;
|
|
31
|
+
x.current = !0;
|
|
32
|
+
const p = e.scrollHeight, c = e.scrollTop;
|
|
33
|
+
Promise.resolve(b.current()).then(() => {
|
|
34
|
+
requestAnimationFrame(() => {
|
|
35
|
+
const a = r.current;
|
|
36
|
+
if (!a) return;
|
|
37
|
+
const d = a.scrollHeight - p;
|
|
38
|
+
d > 0 && (a.scrollTop = c + d);
|
|
39
|
+
});
|
|
40
|
+
}).finally(() => {
|
|
41
|
+
x.current = !1;
|
|
42
|
+
});
|
|
44
43
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
{ root: e, rootMargin: "300px 0px 0px 0px" }
|
|
45
|
+
);
|
|
46
|
+
return t.observe(o), () => t.disconnect();
|
|
47
|
+
}, []);
|
|
48
|
+
const z = W(() => {
|
|
49
|
+
r.current && r.current.scrollTo({
|
|
50
|
+
top: r.current.scrollHeight,
|
|
51
|
+
behavior: "smooth"
|
|
52
|
+
});
|
|
53
|
+
}, []);
|
|
54
|
+
k(
|
|
55
|
+
$,
|
|
56
|
+
() => ({
|
|
57
|
+
scrollToBottom: () => {
|
|
58
|
+
const e = r.current;
|
|
59
|
+
if (!e) return;
|
|
60
|
+
n.current = !0, H.current?.(!0), e.scrollTop = e.scrollHeight;
|
|
61
|
+
const o = () => {
|
|
62
|
+
const t = r.current;
|
|
63
|
+
t && (t.scrollTop = t.scrollHeight, n.current = !0);
|
|
64
|
+
};
|
|
65
|
+
requestAnimationFrame(() => {
|
|
66
|
+
o(), requestAnimationFrame(o);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}),
|
|
70
|
+
[]
|
|
71
|
+
), u(() => {
|
|
72
|
+
!f || !r.current || (n.current = !0, w.current = r.current.scrollHeight, r.current.scrollTop = r.current.scrollHeight);
|
|
73
|
+
}, [f, F]), u(() => {
|
|
74
|
+
const e = r.current;
|
|
75
|
+
if (!f || !e) return;
|
|
76
|
+
const o = new ResizeObserver(() => {
|
|
77
|
+
const c = e.scrollHeight;
|
|
78
|
+
c !== w.current && n.current && (e.scrollTop = c), w.current = c;
|
|
79
|
+
}), t = e.firstElementChild;
|
|
80
|
+
t && o.observe(t);
|
|
81
|
+
let m = !1;
|
|
82
|
+
const p = () => {
|
|
83
|
+
const { scrollTop: c, scrollHeight: a, clientHeight: d } = e, I = a - c - d, S = I < 40;
|
|
84
|
+
S !== n.current && (n.current = S, H.current?.(S));
|
|
85
|
+
const R = I > 200;
|
|
86
|
+
R !== m && (m = R, q(R));
|
|
87
|
+
};
|
|
88
|
+
return e.addEventListener("scroll", p, { passive: !0 }), () => {
|
|
89
|
+
o.disconnect(), e.removeEventListener("scroll", p);
|
|
90
|
+
};
|
|
91
|
+
}, [f]);
|
|
92
|
+
const O = v > 999 ? "999+" : v, j = v > 0;
|
|
93
|
+
return /* @__PURE__ */ T(
|
|
94
|
+
"div",
|
|
53
95
|
{
|
|
54
|
-
className:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
96
|
+
className: s.container,
|
|
97
|
+
style: { "--ml-bottom-offset": `${M}px` },
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ l(
|
|
100
|
+
J,
|
|
101
|
+
{
|
|
102
|
+
className: `${s.root}${y ? ` ${y}` : ""}`,
|
|
103
|
+
style: E,
|
|
104
|
+
type: "auto",
|
|
105
|
+
scrollbars: "y",
|
|
106
|
+
viewportRef: r,
|
|
107
|
+
"data-testid": "message-list",
|
|
108
|
+
styles: {
|
|
109
|
+
content: {
|
|
110
|
+
display: "flex",
|
|
111
|
+
flexDirection: "column",
|
|
112
|
+
minHeight: "100%"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
children: /* @__PURE__ */ T("div", { className: s.wrapper, children: [
|
|
116
|
+
/* @__PURE__ */ l(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
ref: B,
|
|
120
|
+
className: s.top,
|
|
121
|
+
"data-testid": "message-list-top"
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
/* @__PURE__ */ l("div", { className: s.items, "data-testid": "message-list-items", children: L })
|
|
125
|
+
] })
|
|
126
|
+
}
|
|
127
|
+
),
|
|
128
|
+
A && /* @__PURE__ */ T("div", { className: s.scrollToBottomWrap, children: [
|
|
129
|
+
/* @__PURE__ */ l(
|
|
130
|
+
K,
|
|
131
|
+
{
|
|
132
|
+
variant: "default",
|
|
133
|
+
radius: "xl",
|
|
134
|
+
size: 34,
|
|
135
|
+
onClick: z,
|
|
136
|
+
"aria-label": "Scroll to bottom",
|
|
137
|
+
"data-testid": "scroll-to-bottom",
|
|
138
|
+
children: /* @__PURE__ */ l(G, { icon: C, size: 18 })
|
|
139
|
+
}
|
|
140
|
+
),
|
|
141
|
+
j && /* @__PURE__ */ l("span", { className: s.scrollToBottomBadge, children: O })
|
|
142
|
+
] }),
|
|
143
|
+
N && /* @__PURE__ */ l(
|
|
144
|
+
"div",
|
|
145
|
+
{
|
|
146
|
+
className: s.floatingTopAction,
|
|
147
|
+
"data-raised": A || void 0,
|
|
148
|
+
children: N
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
]
|
|
64
152
|
}
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
Q.displayName = "MessageList";
|
|
69
157
|
export {
|
|
70
|
-
|
|
158
|
+
Q as MessageList
|
|
71
159
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const
|
|
2
|
-
row:
|
|
3
|
-
pill:
|
|
1
|
+
const t = "_row_mtm4b_1", m = "_pill_mtm4b_19", o = "_emoji_mtm4b_99", _ = "_count_mtm4b_141", c = "_meta_mtm4b_185", e = {
|
|
2
|
+
row: t,
|
|
3
|
+
pill: m,
|
|
4
|
+
emoji: o,
|
|
4
5
|
count: _,
|
|
5
|
-
emoji: s,
|
|
6
6
|
meta: c
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
9
|
_ as count,
|
|
10
10
|
e as default,
|
|
11
|
-
|
|
11
|
+
o as emoji,
|
|
12
12
|
c as meta,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
m as pill,
|
|
14
|
+
t as row
|
|
15
15
|
};
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Max number of *distinct* emoji a single message can carry. Once reached, the
|
|
4
|
+
* add-reaction picker is hidden (you can still join one of the existing ones by
|
|
5
|
+
* clicking its pill). Mirrors the server cap so the UI and backend agree.
|
|
6
|
+
*/
|
|
7
|
+
export declare const MAX_MESSAGE_REACTIONS = 5;
|
|
8
|
+
export interface ReactionReactor {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
avatarUrl?: string;
|
|
12
|
+
}
|
|
2
13
|
export interface Reaction {
|
|
3
14
|
emoji: string;
|
|
4
15
|
count: number;
|
|
5
16
|
active?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Who left this reaction (resolved to name + avatar by the host). Drives the
|
|
19
|
+
* who-reacted hover popover. Optional — when absent, the pill is a plain
|
|
20
|
+
* toggle with no popover.
|
|
21
|
+
*/
|
|
22
|
+
reactors?: ReactionReactor[];
|
|
6
23
|
}
|
|
7
24
|
export interface MessageReactionsProps {
|
|
8
25
|
reactions: Reaction[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/MessageReactions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/MessageReactions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,eAAO,MAAM,gBAAgB,mDA0E3B,CAAC"}
|
|
@@ -1,40 +1,72 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as r, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import m from "react";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
import { HoverCard as n, ScrollArea as h, Stack as u, Group as f, Text as g } from "@mantine/core";
|
|
4
|
+
import { UserAvatar as v } from "../../UserAvatar/index.js";
|
|
5
|
+
import t from "./MessageReactions.module.css.js";
|
|
6
|
+
const R = 5, w = m.memo(function({
|
|
7
|
+
reactions: s,
|
|
8
|
+
onToggle: d,
|
|
9
|
+
meta: o,
|
|
10
|
+
className: l,
|
|
11
|
+
style: p
|
|
10
12
|
}) {
|
|
11
|
-
return !
|
|
13
|
+
return !s.length && !o ? null : /* @__PURE__ */ r(
|
|
12
14
|
"div",
|
|
13
15
|
{
|
|
14
|
-
className: `${
|
|
15
|
-
style:
|
|
16
|
+
className: `${t.row}${l ? ` ${l}` : ""}`,
|
|
17
|
+
style: p,
|
|
16
18
|
"data-testid": "message-reactions",
|
|
17
19
|
children: [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
s.map((e) => {
|
|
21
|
+
const c = /* @__PURE__ */ r(
|
|
22
|
+
"button",
|
|
23
|
+
{
|
|
24
|
+
className: t.pill,
|
|
25
|
+
"data-active": e.active || void 0,
|
|
26
|
+
onClick: () => d?.(e.emoji),
|
|
27
|
+
type: "button",
|
|
28
|
+
"aria-pressed": e.active ?? !1,
|
|
29
|
+
"aria-label": `${e.emoji} ${e.count}`,
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ a("span", { className: t.emoji, children: e.emoji }, e.count),
|
|
32
|
+
/* @__PURE__ */ a("span", { className: t.count, children: e.count })
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
return e.reactors?.length ? /* @__PURE__ */ r(
|
|
37
|
+
n,
|
|
38
|
+
{
|
|
39
|
+
withArrow: !0,
|
|
40
|
+
openDelay: 250,
|
|
41
|
+
closeDelay: 100,
|
|
42
|
+
position: "top",
|
|
43
|
+
shadow: "md",
|
|
44
|
+
withinPortal: !0,
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ a(n.Target, { children: c }),
|
|
47
|
+
/* @__PURE__ */ a(n.Dropdown, { p: "xs", children: /* @__PURE__ */ a(h.Autosize, { mah: 220, type: "auto", children: /* @__PURE__ */ a(u, { gap: 6, pr: 6, children: e.reactors.map((i) => /* @__PURE__ */ r(f, { gap: 8, wrap: "nowrap", miw: 0, children: [
|
|
48
|
+
/* @__PURE__ */ a(
|
|
49
|
+
v,
|
|
50
|
+
{
|
|
51
|
+
user: { id: i.id, name: i.name, avatarUrl: i.avatarUrl },
|
|
52
|
+
size: 20,
|
|
53
|
+
radius: "xl"
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ a(g, { size: "sm", lineClamp: 1, maw: 200, children: i.name })
|
|
57
|
+
] }, i.id)) }) }) })
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
e.emoji
|
|
61
|
+
) : /* @__PURE__ */ a(m.Fragment, { children: c }, e.emoji);
|
|
62
|
+
}),
|
|
63
|
+
o && /* @__PURE__ */ a("div", { className: t.meta, children: o })
|
|
33
64
|
]
|
|
34
65
|
}
|
|
35
66
|
);
|
|
36
67
|
});
|
|
37
|
-
|
|
68
|
+
w.displayName = "MessageReactions";
|
|
38
69
|
export {
|
|
39
|
-
|
|
70
|
+
R as MAX_MESSAGE_REACTIONS,
|
|
71
|
+
w as MessageReactions
|
|
40
72
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_root_ly31g_1", n = "_icon_ly31g_21", t = "_animateIn_ly31g_31", _ = {
|
|
2
2
|
root: o,
|
|
3
|
-
icon:
|
|
3
|
+
icon: n,
|
|
4
|
+
animateIn: t
|
|
4
5
|
};
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
t as animateIn,
|
|
8
|
+
_ as default,
|
|
9
|
+
n as icon,
|
|
8
10
|
o as root
|
|
9
11
|
};
|
|
@@ -7,7 +7,7 @@ export interface MessageStatusProps {
|
|
|
7
7
|
/** Custom style */
|
|
8
8
|
style?: React.CSSProperties;
|
|
9
9
|
}
|
|
10
|
-
export declare function MessageStatus({ status, className, style }: MessageStatusProps): import("react/jsx-runtime").JSX.Element
|
|
10
|
+
export declare function MessageStatus({ status, className, style }: MessageStatusProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export declare namespace MessageStatus {
|
|
12
12
|
var displayName: string;
|
|
13
13
|
}
|
|
@@ -1 +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;
|
|
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"}
|
|
@@ -1,53 +1,68 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import r from "react";
|
|
2
3
|
import i from "./MessageStatus.module.css.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */
|
|
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" })
|
|
8
10
|
] });
|
|
9
11
|
}
|
|
10
|
-
function
|
|
11
|
-
return /* @__PURE__ */
|
|
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" }) });
|
|
12
14
|
}
|
|
13
|
-
function
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
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" })
|
|
17
19
|
] });
|
|
18
20
|
}
|
|
19
|
-
function
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */
|
|
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" })
|
|
24
26
|
] });
|
|
25
27
|
}
|
|
26
|
-
const
|
|
27
|
-
sending:
|
|
28
|
-
sent:
|
|
29
|
-
delivered:
|
|
30
|
-
read:
|
|
31
|
-
error:
|
|
28
|
+
const h = {
|
|
29
|
+
sending: y,
|
|
30
|
+
sent: x,
|
|
31
|
+
delivered: u,
|
|
32
|
+
read: u,
|
|
33
|
+
error: S
|
|
32
34
|
};
|
|
33
|
-
function
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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(
|
|
39
49
|
"span",
|
|
40
50
|
{
|
|
41
|
-
className: `${i.root} ${
|
|
42
|
-
style: { ...
|
|
51
|
+
className: `${i.root} ${d || ""}`,
|
|
52
|
+
style: { ...a, color: p },
|
|
43
53
|
"data-testid": "message-status",
|
|
44
54
|
"data-status": e,
|
|
45
55
|
"aria-label": e,
|
|
46
|
-
children: /* @__PURE__ */
|
|
56
|
+
children: s && /* @__PURE__ */ n(
|
|
57
|
+
s,
|
|
58
|
+
{
|
|
59
|
+
className: `${i.icon}${m ? ` ${i.animateIn}` : ""}`
|
|
60
|
+
}
|
|
61
|
+
)
|
|
47
62
|
}
|
|
48
63
|
);
|
|
49
64
|
}
|
|
50
|
-
|
|
65
|
+
C.displayName = "MessageStatus";
|
|
51
66
|
export {
|
|
52
|
-
|
|
67
|
+
C as MessageStatus
|
|
53
68
|
};
|
|
@@ -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")
|