@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.
Files changed (128) hide show
  1. package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
  2. package/dist/components/AppContainer/AppContainer.js +72 -79
  3. package/dist/components/AppContainer/AppContainer.module.css.js +6 -6
  4. package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
  5. package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +24 -22
  6. package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
  7. package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +46 -37
  8. package/dist/components/AppContainer/components/Header.d.ts.map +1 -1
  9. package/dist/components/AppContainer/components/Header.js +6 -5
  10. package/dist/components/AppContainer/components/Main.js +4 -4
  11. package/dist/components/AppContainer/components/SlideAnimation.js +4 -4
  12. package/dist/components/AppContainer/components/ToolSidebar.d.ts.map +1 -1
  13. package/dist/components/AppContainer/components/ToolSidebar.js +161 -128
  14. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
  15. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +131 -121
  16. package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
  17. package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
  18. package/dist/components/AppContainer/hooks/useAppContainer.js +59 -56
  19. package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
  20. package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +4 -3
  21. package/dist/components/AppContainer/types.d.ts +1 -0
  22. package/dist/components/AppContainer/types.d.ts.map +1 -1
  23. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
  24. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +37 -37
  25. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts.map +1 -1
  26. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.js +68 -62
  27. package/dist/components/AttachmentsGalleryModal/helpers.d.ts +8 -0
  28. package/dist/components/AttachmentsGalleryModal/helpers.d.ts.map +1 -1
  29. package/dist/components/AttachmentsGalleryModal/helpers.js +22 -17
  30. package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.d.ts.map +1 -1
  31. package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.js +28 -25
  32. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts.map +1 -1
  33. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.js +36 -41
  34. package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
  35. package/dist/components/AttachmentsPreview/AttachmentsPreview.js +135 -80
  36. package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +24 -14
  37. package/dist/components/BouncingLogo/BouncingLogo.d.ts +1 -3
  38. package/dist/components/BouncingLogo/BouncingLogo.d.ts.map +1 -1
  39. package/dist/components/BouncingLogo/BouncingLogo.js +14 -20
  40. package/dist/components/BouncingLogo/BouncingLogo.module.css.js +4 -8
  41. package/dist/components/Chat/ChatBubble/ChatBubble.module.css.js +5 -5
  42. package/dist/components/Chat/ChatInput/ChatInput.module.css.js +40 -28
  43. package/dist/components/Chat/ChatInput/index.d.ts +29 -1
  44. package/dist/components/Chat/ChatInput/index.d.ts.map +1 -1
  45. package/dist/components/Chat/ChatInput/index.js +178 -118
  46. package/dist/components/Chat/ChatInput/smilePlusIcon.d.ts +3 -0
  47. package/dist/components/Chat/ChatInput/smilePlusIcon.d.ts.map +1 -0
  48. package/dist/components/Chat/ChatInput/smilePlusIcon.js +49 -0
  49. package/dist/components/Chat/ChatMessage/ChatMessage.module.css.js +9 -9
  50. package/dist/components/Chat/ChatMessage/index.d.ts +2 -0
  51. package/dist/components/Chat/ChatMessage/index.d.ts.map +1 -1
  52. package/dist/components/Chat/ChatMessage/index.js +136 -118
  53. package/dist/components/Chat/MediaDocument/MediaDocument.module.css.js +4 -4
  54. package/dist/components/Chat/MessageActions/index.d.ts +7 -0
  55. package/dist/components/Chat/MessageActions/index.d.ts.map +1 -1
  56. package/dist/components/Chat/MessageActions/index.js +33 -30
  57. package/dist/components/Chat/MessageList/MessageList.module.css.js +14 -10
  58. package/dist/components/Chat/MessageList/index.d.ts +30 -3
  59. package/dist/components/Chat/MessageList/index.d.ts.map +1 -1
  60. package/dist/components/Chat/MessageList/index.js +154 -66
  61. package/dist/components/Chat/MessageReactions/MessageReactions.module.css.js +7 -7
  62. package/dist/components/Chat/MessageReactions/index.d.ts +17 -0
  63. package/dist/components/Chat/MessageReactions/index.d.ts.map +1 -1
  64. package/dist/components/Chat/MessageReactions/index.js +60 -28
  65. package/dist/components/Chat/MessageStatus/MessageStatus.module.css.js +6 -4
  66. package/dist/components/Chat/MessageStatus/index.d.ts +1 -1
  67. package/dist/components/Chat/MessageStatus/index.d.ts.map +1 -1
  68. package/dist/components/Chat/MessageStatus/index.js +49 -34
  69. package/dist/components/CircleColorPicker/CircleColorPicker.d.ts.map +1 -1
  70. package/dist/components/CircleColorPicker/CircleColorPicker.js +17 -15
  71. package/dist/components/ColorPicker/ColorPicker.module.css.js +26 -20
  72. package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -1
  73. package/dist/components/ColorPicker/ColorPickerList.js +81 -68
  74. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
  75. package/dist/components/ColorPicker/ColorPickerToolbar.js +75 -70
  76. package/dist/components/ColorPicker/icons.js +5 -5
  77. package/dist/components/ColorPicker/types.d.ts +6 -0
  78. package/dist/components/ColorPicker/types.d.ts.map +1 -1
  79. package/dist/components/ColorPicker/types.js +53 -11
  80. package/dist/components/ColorPicker/useRecentColors.d.ts +3 -1
  81. package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -1
  82. package/dist/components/ColorPicker/useRecentColors.js +43 -20
  83. package/dist/components/EmojiPicker/EmojiPanel.d.ts +2 -1
  84. package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
  85. package/dist/components/EmojiPicker/EmojiPanel.js +73 -72
  86. package/dist/components/EmojiPicker/EmojiPicker.d.ts +16 -1
  87. package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
  88. package/dist/components/EmojiPicker/EmojiPicker.js +121 -86
  89. package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
  90. package/dist/components/EmojiPicker/IconsPanel.js +28 -25
  91. package/dist/components/EntityIcon.d.ts +1 -0
  92. package/dist/components/EntityIcon.d.ts.map +1 -1
  93. package/dist/components/EntityIcon.js +80 -32
  94. package/dist/components/ErrorPage/components/Error403.d.ts +5 -1
  95. package/dist/components/ErrorPage/components/Error403.d.ts.map +1 -1
  96. package/dist/components/ErrorPage/components/Error403.js +25 -21
  97. package/dist/components/ErrorPage/index.d.ts +5 -1
  98. package/dist/components/ErrorPage/index.d.ts.map +1 -1
  99. package/dist/components/ErrorPage/index.js +17 -10
  100. package/dist/components/MusicPlayerBar/components/HoverActions.js +28 -28
  101. package/dist/components/NavMenu/NavMenu.d.ts +7 -1
  102. package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
  103. package/dist/components/NavMenu/NavMenu.js +54 -44
  104. package/dist/components/NavMenu/NavMenu.module.css.js +10 -10
  105. package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
  106. package/dist/components/NavMenu/components/NavMenuItem.js +84 -84
  107. package/dist/components/NavMenu/types.d.ts +4 -0
  108. package/dist/components/NavMenu/types.d.ts.map +1 -1
  109. package/dist/components/WorkspaceMenu/WorkspaceItem.d.ts.map +1 -1
  110. package/dist/components/WorkspaceMenu/WorkspaceItem.js +16 -14
  111. package/dist/config/envConfig.d.ts +2 -0
  112. package/dist/config/envConfig.d.ts.map +1 -1
  113. package/dist/config/envConfig.js +41 -37
  114. package/dist/helpers/showNotifications.d.ts +15 -0
  115. package/dist/helpers/showNotifications.d.ts.map +1 -1
  116. package/dist/helpers/showNotifications.js +114 -72
  117. package/dist/helpers/showNotifications.module.css.js +16 -4
  118. package/dist/hooks/useUiPref.d.ts +2 -0
  119. package/dist/hooks/useUiPref.d.ts.map +1 -0
  120. package/dist/hooks/useUiPref.js +80 -0
  121. package/dist/index.css +1 -1
  122. package/dist/index.d.ts +1 -0
  123. package/dist/index.d.ts.map +1 -1
  124. package/dist/index.js +550 -540
  125. package/dist/lang/locales/ui_en.json.js +1 -1
  126. package/dist/lang/locales/ui_es.json.js +1 -1
  127. package/dist/lang/locales/ui_ru.json.js +1 -1
  128. package/package.json +1 -1
@@ -1,121 +1,138 @@
1
- import { jsx as e, jsxs as c, Fragment as Q } from "react/jsx-runtime";
2
- import I, { useMemo as L } from "react";
3
- import { AttachmentsPreview as V } from "../../AttachmentsPreview/AttachmentsPreview.js";
4
- import { UserAvatar as X } from "../../UserAvatar/index.js";
5
- import { ChatBubble as Z } from "../ChatBubble/index.js";
6
- import { MessageActions as D } from "../MessageActions/index.js";
7
- import { MessageAuthor as P } from "../MessageAuthor/index.js";
8
- import { MessageForward as T } from "../MessageForward/index.js";
9
- import { MessageMeta as ee } from "../MessageMeta/index.js";
10
- import { MessageReactions as ae } from "../MessageReactions/index.js";
11
- import { MessageReply as se } from "../MessageReply/index.js";
12
- import { MessageStatus as te } from "../MessageStatus/index.js";
13
- import { getAvatarColor as re } from "../colors.js";
14
- import s from "./ChatMessage.module.css.js";
15
- const ie = { cursor: "pointer" }, oe = I.memo(
16
- I.forwardRef(function({
17
- children: v,
1
+ import { jsx as e, jsxs as d, Fragment as Z } from "react/jsx-runtime";
2
+ import _, { useMemo as $ } from "react";
3
+ import { AttachmentsPreview as P } from "../../AttachmentsPreview/AttachmentsPreview.js";
4
+ import { UserAvatar as T } from "../../UserAvatar/index.js";
5
+ import { ChatBubble as ee } from "../ChatBubble/index.js";
6
+ import { MessageActions as ae } from "../MessageActions/index.js";
7
+ import { MessageAuthor as te } from "../MessageAuthor/index.js";
8
+ import { MessageForward as se } from "../MessageForward/index.js";
9
+ import { MessageMeta as ie } from "../MessageMeta/index.js";
10
+ import { MessageReactions as re, MAX_MESSAGE_REACTIONS as oe } from "../MessageReactions/index.js";
11
+ import { MessageReply as le } from "../MessageReply/index.js";
12
+ import { MessageStatus as j } from "../MessageStatus/index.js";
13
+ import { getAvatarColor as me } from "../colors.js";
14
+ import t from "./ChatMessage.module.css.js";
15
+ const ce = { cursor: "pointer" }, de = _.memo(
16
+ _.forwardRef(function({
17
+ children: p,
18
18
  outgoing: a,
19
- senderName: i,
20
- senderColor: l,
21
- avatarName: f,
22
- avatarSrc: _,
23
- showAvatar: $,
24
- timestamp: p,
25
- status: g,
26
- replyTo: t,
27
- forwardFrom: M,
28
- edited: j,
19
+ senderName: o,
20
+ senderColor: n,
21
+ avatarName: g,
22
+ avatarSrc: B,
23
+ showAvatar: K,
24
+ timestamp: M,
25
+ status: l,
26
+ onRetry: h,
27
+ retryLabel: A,
28
+ replyTo: i,
29
+ forwardFrom: u,
30
+ edited: L,
29
31
  attachments: r,
30
- reactions: d,
31
- onReactionToggle: B,
32
- groupPosition: u = "single",
33
- onReaction: A,
34
- onReply: C,
35
- onEdit: n,
36
- onDelete: h,
37
- onCopy: w,
32
+ reactions: m,
33
+ onReactionToggle: O,
34
+ groupPosition: C = "single",
35
+ onReaction: w,
36
+ onReply: b,
37
+ onEdit: v,
38
+ onDelete: f,
39
+ onCopy: x,
38
40
  onForward: N,
39
- onPin: b,
40
- onContextMenu: E,
41
- onAvatarClick: x,
42
- fullWidth: z,
43
- noBubble: K,
44
- mediaOnly: O,
45
- hasMedia: R,
46
- id: U,
47
- className: S,
48
- style: W
41
+ onPin: S,
42
+ onContextMenu: z,
43
+ onAvatarClick: k,
44
+ fullWidth: D,
45
+ noBubble: G,
46
+ mediaOnly: U,
47
+ hasMedia: y,
48
+ id: W,
49
+ className: E,
50
+ style: X
49
51
  }, Y) {
50
- const q = !a && !!i, F = !a && $, G = !!(A || C || n || h || w || N || b), H = L(() => {
51
- const m = re(l);
52
+ const q = !a && !!o, F = !a && K, H = !!(w || b || v || f || x || N || S), J = $(() => {
53
+ const s = me(n);
52
54
  return {
53
- root: { "--avatar-bg": m },
54
- placeholder: { backgroundColor: m }
55
+ root: { "--avatar-bg": s },
56
+ placeholder: { backgroundColor: s }
55
57
  };
56
- }, [l]), k = d && d.length > 0, J = L(
57
- () => r?.filter((m) => m.isImage).length ?? 0,
58
+ }, [n]), I = m && m.length > 0, Q = (m?.length ?? 0) < oe, V = $(
59
+ () => r?.filter((s) => s.isImage).length ?? 0,
58
60
  [r]
59
- ), o = p ? /* @__PURE__ */ e(
60
- ee,
61
+ ), c = M ? /* @__PURE__ */ e(
62
+ ie,
61
63
  {
62
- time: p,
63
- edited: j,
64
+ time: M,
65
+ edited: L,
64
66
  outgoing: a,
65
- inReactions: k,
66
- children: a && g && /* @__PURE__ */ e(te, { status: g })
67
+ inReactions: I,
68
+ children: a && l && (l === "error" && h ? /* @__PURE__ */ e(
69
+ "span",
70
+ {
71
+ role: "button",
72
+ tabIndex: 0,
73
+ onClick: h,
74
+ onKeyDown: (s) => {
75
+ (s.key === "Enter" || s.key === " ") && (s.preventDefault(), h());
76
+ },
77
+ title: A,
78
+ "aria-label": A,
79
+ "data-testid": "message-retry",
80
+ style: { cursor: "pointer", display: "inline-flex" },
81
+ children: /* @__PURE__ */ e(j, { status: l })
82
+ }
83
+ ) : /* @__PURE__ */ e(j, { status: l }))
67
84
  }
68
- ) : null, y = /* @__PURE__ */ c(Q, { children: [
69
- q && /* @__PURE__ */ e(P, { name: i, color: l }),
70
- t && /* @__PURE__ */ e(
71
- se,
85
+ ) : null, R = /* @__PURE__ */ d(Z, { children: [
86
+ q && /* @__PURE__ */ e(te, { name: o, color: n }),
87
+ i && /* @__PURE__ */ e(
88
+ le,
72
89
  {
73
- title: t.senderName,
74
- subtitle: t.text,
75
- color: t.color,
90
+ title: i.senderName,
91
+ subtitle: i.text,
92
+ color: i.color,
76
93
  outgoing: a,
77
- onClick: t.onClick
94
+ onClick: i.onClick
78
95
  }
79
96
  ),
80
- M && /* @__PURE__ */ e(T, { from: M, outgoing: a }),
81
- O ? /* @__PURE__ */ c(
97
+ u && /* @__PURE__ */ e(se, { from: u, outgoing: a }),
98
+ U ? /* @__PURE__ */ d(
82
99
  "div",
83
100
  {
84
- className: s.content,
101
+ className: t.content,
85
102
  style: { position: "relative" },
86
103
  "data-testid": "chat-message-content",
87
- "data-has-media": R || void 0,
104
+ "data-has-media": y || void 0,
88
105
  "data-media-only": !0,
89
106
  children: [
90
- v,
91
- o && /* @__PURE__ */ e("div", { className: s.mediaOnlyMeta, children: o })
107
+ p,
108
+ c && /* @__PURE__ */ e("div", { className: t.mediaOnlyMeta, children: c })
92
109
  ]
93
110
  }
94
- ) : /* @__PURE__ */ c(
111
+ ) : /* @__PURE__ */ d(
95
112
  "div",
96
113
  {
97
- className: s.content,
114
+ className: t.content,
98
115
  "data-testid": "chat-message-content",
99
- "data-has-media": R || void 0,
100
- "data-single-image": J === 1 || void 0,
116
+ "data-has-media": y || void 0,
117
+ "data-single-image": V === 1 || void 0,
101
118
  children: [
102
- v,
103
- r && r.length > 0 && /* @__PURE__ */ e("div", { className: s.attachmentsWrap, children: /* @__PURE__ */ e(
104
- V,
119
+ r && r.length > 0 && /* @__PURE__ */ e("div", { className: t.attachmentsWrap, children: /* @__PURE__ */ e(
120
+ P,
105
121
  {
106
122
  files: r,
107
123
  mode: "view",
108
124
  parentIsExisting: !0
109
125
  }
110
126
  ) }),
111
- k ? /* @__PURE__ */ e(
112
- ae,
127
+ p,
128
+ I ? /* @__PURE__ */ e(
129
+ re,
113
130
  {
114
- reactions: d,
115
- onToggle: B,
116
- meta: o
131
+ reactions: m,
132
+ onToggle: O,
133
+ meta: c
117
134
  }
118
- ) : o
135
+ ) : c
119
136
  ]
120
137
  }
121
138
  )
@@ -124,55 +141,56 @@ const ie = { cursor: "pointer" }, oe = I.memo(
124
141
  "div",
125
142
  {
126
143
  ref: Y,
127
- className: `${s.messageRow}${S ? ` ${S}` : ""}`,
144
+ className: `${t.messageRow}${E ? ` ${E}` : ""}`,
128
145
  "data-outgoing": a || void 0,
129
- "data-message-id": U,
130
- onContextMenu: E,
131
- style: W,
132
- children: /* @__PURE__ */ c(
146
+ "data-message-id": W,
147
+ onContextMenu: z,
148
+ style: X,
149
+ children: /* @__PURE__ */ d(
133
150
  "div",
134
151
  {
135
- className: s.wrapper,
152
+ className: t.wrapper,
136
153
  "data-outgoing": a || void 0,
137
- "data-group-position": u,
154
+ "data-group-position": C,
138
155
  children: [
139
- F ? /* @__PURE__ */ e("div", { className: s.avatar, children: /* @__PURE__ */ e(
140
- X,
156
+ F ? /* @__PURE__ */ e("div", { className: t.avatar, children: /* @__PURE__ */ e(
157
+ T,
141
158
  {
142
159
  user: {
143
- id: f || i || "",
144
- name: f || i,
145
- avatar: _
160
+ id: g || o || "",
161
+ name: g || o,
162
+ avatar: B
146
163
  },
147
164
  size: 33,
148
165
  radius: "xl",
149
- onClick: x,
150
- style: x ? ie : void 0,
151
- styles: H
166
+ onClick: k,
167
+ style: k ? ce : void 0,
168
+ styles: J
152
169
  }
153
- ) }) : !a && /* @__PURE__ */ e("div", { className: s.spacer }),
154
- K ? y : /* @__PURE__ */ e(
155
- Z,
170
+ ) }) : !a && /* @__PURE__ */ e("div", { className: t.spacer }),
171
+ G ? R : /* @__PURE__ */ e(
172
+ ee,
156
173
  {
157
174
  outgoing: a,
158
- fullWidth: z,
159
- groupPosition: u,
160
- children: y
175
+ fullWidth: D,
176
+ groupPosition: C,
177
+ children: R
161
178
  }
162
179
  ),
163
- G && /* @__PURE__ */ e(
164
- D,
180
+ H && /* @__PURE__ */ e(
181
+ ae,
165
182
  {
166
- className: s.hoverActions,
167
- onReaction: A,
168
- onReply: C,
169
- onEdit: n,
170
- onDelete: h,
171
- onCopy: w,
183
+ className: t.hoverActions,
184
+ onReaction: w,
185
+ canAddReaction: Q,
186
+ onReply: b,
187
+ onEdit: v,
188
+ onDelete: f,
189
+ onCopy: x,
172
190
  onForward: N,
173
- onPin: b,
174
- showEdit: !!n,
175
- showDelete: !!h
191
+ onPin: S,
192
+ showEdit: !!v,
193
+ showDelete: !!f
176
194
  }
177
195
  )
178
196
  ]
@@ -182,7 +200,7 @@ const ie = { cursor: "pointer" }, oe = I.memo(
182
200
  );
183
201
  })
184
202
  );
185
- oe.displayName = "ChatMessage";
203
+ de.displayName = "ChatMessage";
186
204
  export {
187
- oe as ChatMessage
205
+ de as ChatMessage
188
206
  };
@@ -1,13 +1,13 @@
1
- const o = "_root_67dvs_1", t = "_downloadButton_67dvs_31", e = "_fileName_67dvs_51", s = "_fileSize_67dvs_65", _ = {
1
+ const o = "_root_pcicv_1", t = "_downloadButton_pcicv_39", e = "_fileName_pcicv_59", c = "_fileSize_pcicv_75", i = {
2
2
  root: o,
3
3
  downloadButton: t,
4
4
  fileName: e,
5
- fileSize: s
5
+ fileSize: c
6
6
  };
7
7
  export {
8
- _ as default,
8
+ i as default,
9
9
  t as downloadButton,
10
10
  e as fileName,
11
- s as fileSize,
11
+ c as fileSize,
12
12
  o as root
13
13
  };
@@ -1,6 +1,13 @@
1
1
  import React from 'react';
2
2
  export interface MessageActionsProps {
3
3
  onReaction?: (emoji: string) => void;
4
+ /**
5
+ * Whether a *new* reaction emoji may still be added. False once the message
6
+ * hit the distinct-reaction cap — we then hide the add-reaction picker
7
+ * entirely (joining an existing reaction is still possible via its pill).
8
+ * Defaults to true. See {@link MAX_MESSAGE_REACTIONS}.
9
+ */
10
+ canAddReaction?: boolean;
4
11
  onReply?: () => void;
5
12
  onEdit?: () => void;
6
13
  onDelete?: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/MessageActions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAiBxC,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,eAAO,MAAM,cAAc,iDAwFzB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/MessageActions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAiBxC,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,eAAO,MAAM,cAAc,iDA+FzB,CAAC"}
@@ -1,55 +1,58 @@
1
- import { jsx as e, jsxs as n, Fragment as M } from "react/jsx-runtime";
2
- import b, { useState as v } from "react";
1
+ import { jsx as e, jsxs as n, Fragment as b } from "react/jsx-runtime";
2
+ import w, { useState as v } from "react";
3
3
  import { Group as y, ActionIcon as d, Menu as i } from "@mantine/core";
4
- import { SmileIcon as j, LinkBackwardIcon as w, MoreVerticalIcon as A, Copy01Icon as x, Share08Icon as $, PinIcon as B, Edit02Icon as E, Delete02Icon as O } from "@hugeicons/core-free-icons";
4
+ import { SmileIcon as j, LinkBackwardIcon as A, MoreVerticalIcon as x, Copy01Icon as B, Share08Icon as P, PinIcon as $, Edit02Icon as E, Delete02Icon as O } from "@hugeicons/core-free-icons";
5
5
  import { HugeiconsIcon as o } from "@hugeicons/react";
6
- import { EmojiPicker as P } from "../../EmojiPicker/EmojiPicker.js";
7
- import { IconEntity as _ } from "../../ProjectIcon/ProjectIcon.js";
8
- import D from "./MessageActions.module.css.js";
9
- const G = b.memo(function({
10
- onReaction: r,
6
+ import { EmojiPicker as _ } from "../../EmojiPicker/EmojiPicker.js";
7
+ import { IconEntity as D } from "../../ProjectIcon/ProjectIcon.js";
8
+ import G from "./MessageActions.module.css.js";
9
+ const H = w.memo(function({
10
+ onReaction: t,
11
+ canAddReaction: I = !0,
11
12
  onReply: m,
12
- onEdit: t,
13
+ onEdit: r,
13
14
  onDelete: c,
14
15
  onCopy: s,
15
16
  onForward: a,
16
17
  onPin: l,
17
18
  showEdit: h,
18
19
  showDelete: p,
19
- className: f,
20
- style: I
20
+ className: u,
21
+ style: g
21
22
  }) {
22
- const [g, z] = v(!1), k = !!(t || c || s || a || l || h || p), S = (u) => {
23
- if (!r) return;
24
- const C = _.parse(u);
25
- r(C?.emoji ?? u);
23
+ const [z, k] = v(!1), S = !!(r || c || s || a || l || h || p), C = (f) => {
24
+ if (!t) return;
25
+ const M = D.parse(f);
26
+ t(M?.emoji ?? f);
26
27
  };
27
28
  return /* @__PURE__ */ e(
28
29
  "div",
29
30
  {
30
- className: `${D.root}${f ? ` ${f}` : ""}`,
31
- style: I,
31
+ className: `${G.root}${u ? ` ${u}` : ""}`,
32
+ style: g,
32
33
  "data-testid": "message-actions",
33
34
  children: /* @__PURE__ */ n(y, { gap: 2, wrap: "nowrap", children: [
34
- r && /* @__PURE__ */ e(
35
- P,
35
+ t && I && /* @__PURE__ */ e(
36
+ _,
36
37
  {
37
- onChange: S,
38
+ onChange: C,
38
39
  position: "top-start",
39
40
  showRemoveButton: !1,
40
41
  showIcons: !1,
42
+ showRandomButton: !1,
43
+ withinPortal: !0,
41
44
  children: /* @__PURE__ */ e(d, { variant: "subtle", color: "gray", size: 22, radius: 8, "aria-label": "Add reaction", children: /* @__PURE__ */ e(o, { icon: j, size: 16 }) })
42
45
  }
43
46
  ),
44
- m && /* @__PURE__ */ e(d, { variant: "subtle", color: "gray", size: 22, radius: 8, onClick: m, "aria-label": "Reply", children: /* @__PURE__ */ e(o, { icon: w, size: 16 }) }),
45
- k && /* @__PURE__ */ n(i, { position: "bottom-end", withinPortal: !0, shadow: "md", width: 200, opened: g, onChange: z, children: [
46
- /* @__PURE__ */ e(i.Target, { children: /* @__PURE__ */ e(d, { variant: "subtle", color: "gray", size: 22, radius: 8, "aria-label": "More actions", children: /* @__PURE__ */ e(o, { icon: A, size: 16 }) }) }),
47
+ m && /* @__PURE__ */ e(d, { variant: "subtle", color: "gray", size: 22, radius: 8, onClick: m, "aria-label": "Reply", children: /* @__PURE__ */ e(o, { icon: A, size: 16 }) }),
48
+ S && /* @__PURE__ */ n(i, { position: "bottom-end", withinPortal: !0, shadow: "md", width: 200, opened: z, onChange: k, children: [
49
+ /* @__PURE__ */ e(i.Target, { children: /* @__PURE__ */ e(d, { variant: "subtle", color: "gray", size: 22, radius: 8, "aria-label": "More actions", children: /* @__PURE__ */ e(o, { icon: x, size: 16 }) }) }),
47
50
  /* @__PURE__ */ n(i.Dropdown, { children: [
48
- s && /* @__PURE__ */ e(i.Item, { leftSection: /* @__PURE__ */ e(o, { icon: x, size: 16 }), onClick: s, children: "Copy" }),
49
- a && /* @__PURE__ */ e(i.Item, { leftSection: /* @__PURE__ */ e(o, { icon: $, size: 16 }), onClick: a, children: "Forward" }),
50
- l && /* @__PURE__ */ e(i.Item, { leftSection: /* @__PURE__ */ e(o, { icon: B, size: 16 }), onClick: l, children: "Pin" }),
51
- (h || t) && /* @__PURE__ */ e(i.Item, { leftSection: /* @__PURE__ */ e(o, { icon: E, size: 16 }), onClick: t, children: "Edit" }),
52
- (p || c) && /* @__PURE__ */ n(M, { children: [
51
+ s && /* @__PURE__ */ e(i.Item, { leftSection: /* @__PURE__ */ e(o, { icon: B, size: 16 }), onClick: s, children: "Copy" }),
52
+ a && /* @__PURE__ */ e(i.Item, { leftSection: /* @__PURE__ */ e(o, { icon: P, size: 16 }), onClick: a, children: "Forward" }),
53
+ l && /* @__PURE__ */ e(i.Item, { leftSection: /* @__PURE__ */ e(o, { icon: $, size: 16 }), onClick: l, children: "Pin" }),
54
+ (h || r) && /* @__PURE__ */ e(i.Item, { leftSection: /* @__PURE__ */ e(o, { icon: E, size: 16 }), onClick: r, children: "Edit" }),
55
+ (p || c) && /* @__PURE__ */ n(b, { children: [
53
56
  /* @__PURE__ */ e(i.Divider, {}),
54
57
  /* @__PURE__ */ e(i.Item, { color: "red", leftSection: /* @__PURE__ */ e(o, { icon: O, size: 16 }), onClick: c, children: "Delete" })
55
58
  ] })
@@ -59,7 +62,7 @@ const G = b.memo(function({
59
62
  }
60
63
  );
61
64
  });
62
- G.displayName = "MessageActions";
65
+ H.displayName = "MessageActions";
63
66
  export {
64
- G as MessageActions
67
+ H as MessageActions
65
68
  };
@@ -1,17 +1,21 @@
1
- const o = "_container_1ak80_1", t = "_root_1ak80_19", _ = "_wrapper_1ak80_33", r = "_top_1ak80_43", s = "_items_1ak80_43", a = "_scrollToBottom_1ak80_87", c = {
1
+ const o = "_container_r29um_1", t = "_root_r29um_31", r = "_wrapper_r29um_45", _ = "_top_r29um_55", c = "_items_r29um_55", n = "_scrollToBottomWrap_r29um_99", s = "_floatingTopAction_r29um_119", a = "_scrollToBottomBadge_r29um_149", l = {
2
2
  container: o,
3
3
  root: t,
4
- wrapper: _,
5
- top: r,
6
- items: s,
7
- scrollToBottom: a
4
+ wrapper: r,
5
+ top: _,
6
+ items: c,
7
+ scrollToBottomWrap: n,
8
+ floatingTopAction: s,
9
+ scrollToBottomBadge: a
8
10
  };
9
11
  export {
10
12
  o as container,
11
- c as default,
12
- s as items,
13
+ l as default,
14
+ s as floatingTopAction,
15
+ c as items,
13
16
  t as root,
14
- a as scrollToBottom,
15
- r as top,
16
- _ as wrapper
17
+ a as scrollToBottomBadge,
18
+ n as scrollToBottomWrap,
19
+ _ as top,
20
+ r as wrapper
17
21
  };
@@ -4,9 +4,36 @@ export interface MessageListProps {
4
4
  className?: string;
5
5
  style?: React.CSSProperties;
6
6
  stickToBottom?: boolean;
7
+ unreadCount?: number;
8
+ onStickChange?: (stuck: boolean) => void;
9
+ resetKey?: string | null;
10
+ /**
11
+ * Called when the user scrolls near the top — used to load an older page of
12
+ * history. Should resolve once the older messages have been prepended; the
13
+ * list preserves the visual scroll position across the prepend.
14
+ */
15
+ onReachTop?: () => void | Promise<void>;
16
+ /**
17
+ * Floating control pinned bottom-right, stacked ABOVE the scroll-to-bottom
18
+ * arrow (e.g. the "jump to mention" button). Shown independently of the
19
+ * arrow — it raises above the arrow when the arrow is visible, otherwise
20
+ * sits at the arrow's spot.
21
+ */
22
+ floatingTopAction?: React.ReactNode;
23
+ /**
24
+ * Lift the floating controls (scroll-to-bottom arrow + floatingTopAction) up
25
+ * by this many px — so a composer that overlays the list bottom (frosted
26
+ * floating input) doesn't sit on top of them.
27
+ */
28
+ bottomOffset?: number;
7
29
  }
8
- export declare function MessageList({ children, className, style, stickToBottom }: MessageListProps): import("react/jsx-runtime").JSX.Element;
9
- export declare namespace MessageList {
10
- var displayName: string;
30
+ export interface MessageListHandle {
31
+ /**
32
+ * Snap to the latest message and re-arm bottom-stick. Hosts call this when
33
+ * the local user sends a message so the view jumps to their just-sent
34
+ * content even if they had scrolled up — matching Telegram/Slack behavior.
35
+ */
36
+ scrollToBottom: () => void;
11
37
  }
38
+ export declare const MessageList: React.ForwardRefExoticComponent<MessageListProps & React.RefAttributes<MessageListHandle>>;
12
39
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/MessageList/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAGxE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE,gBAAgB,2CA8F1F;yBA9Fe,WAAW"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/MessageList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAQf,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,eAAO,MAAM,WAAW,4FAoOvB,CAAC"}