@linktr.ee/messaging-react 3.3.6-rc-1780987607 → 3.3.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/{Card-IjOI7UXs.js → Card-B9QrjooN.js} +3 -3
- package/dist/{Card-IjOI7UXs.js.map → Card-B9QrjooN.js.map} +1 -1
- package/dist/{Card-Cn7Zxc6U.cjs → Card-BRRlz4kq.cjs} +2 -2
- package/dist/{Card-Cn7Zxc6U.cjs.map → Card-BRRlz4kq.cjs.map} +1 -1
- package/dist/{Card-BlviN8Fb.cjs → Card-C-FCwjGa.cjs} +2 -2
- package/dist/{Card-BlviN8Fb.cjs.map → Card-C-FCwjGa.cjs.map} +1 -1
- package/dist/{Card-DE5bfj0l.js → Card-CVZzYmYW.js} +2 -2
- package/dist/{Card-DE5bfj0l.js.map → Card-CVZzYmYW.js.map} +1 -1
- package/dist/{Card-KgQxeR-B.cjs → Card-D_oLlfPw.cjs} +2 -2
- package/dist/{Card-KgQxeR-B.cjs.map → Card-D_oLlfPw.cjs.map} +1 -1
- package/dist/{Card-C4ncqjxJ.js → Card-DzjYyrie.js} +2 -2
- package/dist/{Card-C4ncqjxJ.js.map → Card-DzjYyrie.js.map} +1 -1
- package/dist/{LockedThumbnail-4-54cyJG.js → LockedThumbnail-CJfXY_Ut.js} +2 -2
- package/dist/{LockedThumbnail-4-54cyJG.js.map → LockedThumbnail-CJfXY_Ut.js.map} +1 -1
- package/dist/{LockedThumbnail-DL5NZzWJ.cjs → LockedThumbnail-Cth1yWnH.cjs} +2 -2
- package/dist/{LockedThumbnail-DL5NZzWJ.cjs.map → LockedThumbnail-Cth1yWnH.cjs.map} +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/index-CBtOPvxW.cjs +2 -0
- package/dist/index-CBtOPvxW.cjs.map +1 -0
- package/dist/{index-C2wfgpUU.js → index-D7eRkXoG.js} +551 -585
- package/dist/index-D7eRkXoG.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/ChannelView.test.tsx +1 -12
- package/src/components/ChannelView.tsx +17 -34
- package/src/components/CustomMessageInput/index.tsx +4 -14
- package/src/styles.css +1 -0
- package/dist/index-C2wfgpUU.js.map +0 -1
- package/dist/index-nanry0Io.cjs +0 -2
- package/dist/index-nanry0Io.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CBtOPvxW.cjs");exports.ActionButton=e.ActionButton;exports.Avatar=e.Avatar;exports.ChannelEmptyState=e.ChannelEmptyState;exports.ChannelList=e.ChannelList;exports.ChannelView=e.ChannelView;exports.CustomMessageProvider=e.CustomMessageProvider;exports.FaqList=e.FaqList;exports.FaqListItem=e.FaqListItem;exports.LinkAttachment=e.LinkAttachment;exports.LockedAttachment=e.LockedAttachment;exports.MediaMessage=e.MediaMessage;exports.MessageAttachment=e.MessageAttachment;exports.MessageVoteButtons=e.MessageVoteButtons;exports.MessagingProvider=e.MessagingProvider;exports.MessagingShell=e.MessagingShell;exports.buildCompactMetaLabel=e.buildCompactMetaLabel;exports.formatFileSize=e.formatFileSize;exports.formatRelativeTime=e.formatRelativeTime;exports.getFileExtensionLabel=e.getFileExtensionLabel;exports.getMessageDisplayText=e.getMessageDisplayText;exports.isLinkAttachment=e.isLinkAttachment;exports.isUuidLike=e.isUuidLike;exports.messageAttachmentGroupPositionFromStream=e.bubbleGroupPositionFromStream;exports.normalizeLanguageCode=e.normalizeLanguageCode;exports.resolveLinkAttachment=e.resolveLinkAttachment;exports.resolveMediaFromMessage=e.resolveMediaFromMessage;exports.resolveParticipantDisplayName=e.resolveParticipantDisplayName;exports.useCustomMessage=e.useCustomMessage;exports.useMessageVote=e.useMessageVote;exports.useMessaging=e.useMessaging;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, b as t, C as i, c as n, d as o, e as m, F as g, f as l, L as r, h as M, M as u, i as L, j as c, k as h, l as d, m as p, n as v, o as A, p as C, q as F, s as k, t as b, u as f, v as x, w as y, x as P, y as S, z as q, B as z, D as B } from "./index-
|
|
1
|
+
import { a as e, b as t, C as i, c as n, d as o, e as m, F as g, f as l, L as r, h as M, M as u, i as L, j as c, k as h, l as d, m as p, n as v, o as A, p as C, q as F, s as k, t as b, u as f, v as x, w as y, x as P, y as S, z as q, B as z, D as B } from "./index-D7eRkXoG.js";
|
|
2
2
|
export {
|
|
3
3
|
e as ActionButton,
|
|
4
4
|
t as Avatar,
|
package/package.json
CHANGED
|
@@ -22,18 +22,7 @@ vi.mock('stream-chat-react', () => ({
|
|
|
22
22
|
Window: ({ children }: { children: React.ReactNode }) => (
|
|
23
23
|
<div data-testid="window">{children}</div>
|
|
24
24
|
),
|
|
25
|
-
MessageList: (
|
|
26
|
-
renderMessages,
|
|
27
|
-
}: {
|
|
28
|
-
renderMessages?: (options: Record<string, unknown>) => React.ReactNode[]
|
|
29
|
-
}) => (
|
|
30
|
-
<ul data-testid="message-list">
|
|
31
|
-
{renderMessages?.({ messages: [] }) ?? null}
|
|
32
|
-
</ul>
|
|
33
|
-
),
|
|
34
|
-
defaultRenderMessages: () => [
|
|
35
|
-
<li key="message-list-item" data-testid="message-list-item" />,
|
|
36
|
-
],
|
|
25
|
+
MessageList: () => <div data-testid="message-list" />,
|
|
37
26
|
WithComponents: ({ children }: { children: React.ReactNode }) => (
|
|
38
27
|
<>{children}</>
|
|
39
28
|
),
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
useChannelStateContext,
|
|
11
11
|
WithComponents,
|
|
12
12
|
MessageUIComponentProps,
|
|
13
|
-
defaultRenderMessages,
|
|
14
13
|
} from 'stream-chat-react'
|
|
15
14
|
|
|
16
15
|
import { useChannelStar } from '../hooks/useChannelStar'
|
|
@@ -400,41 +399,25 @@ const ChannelViewInner: React.FC<{
|
|
|
400
399
|
key="lt-channel-message-list"
|
|
401
400
|
className="flex-1 overflow-hidden relative"
|
|
402
401
|
>
|
|
403
|
-
<MessageList
|
|
404
|
-
|
|
405
|
-
hideNewMessageSeparator={false}
|
|
406
|
-
renderMessages={(options) => {
|
|
407
|
-
const elements = defaultRenderMessages(options)
|
|
408
|
-
|
|
409
|
-
if (renderConversationFooter) {
|
|
410
|
-
elements.push(
|
|
411
|
-
<li key="lt-channel-conversation-footer">
|
|
412
|
-
{renderConversationFooter(channel)}
|
|
413
|
-
</li>
|
|
414
|
-
)
|
|
415
|
-
}
|
|
402
|
+
<MessageList hideDeletedMessages hideNewMessageSeparator={false} />
|
|
403
|
+
</div>
|
|
416
404
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
>
|
|
423
|
-
<div className="absolute bottom-0 inset-x-0 w-full h-4/5 backdrop-blur-[16px] [mask-image:linear-gradient(to_top,black_0%,transparent_100%)] [-webkit-mask-image:linear-gradient(to_top,black_0%,transparent_100%)]" />
|
|
424
|
-
<CustomMessageInput
|
|
425
|
-
className="isolate w-full"
|
|
426
|
-
renderActions={() => renderMessageInputActions?.(channel)}
|
|
427
|
-
renderFooter={() => renderMessageInputFooter?.(channel)}
|
|
428
|
-
disabled={composerDisabled}
|
|
429
|
-
disabledReason={composerDisabledReason}
|
|
430
|
-
/>
|
|
431
|
-
</li>
|
|
432
|
-
)
|
|
405
|
+
{renderConversationFooter ? (
|
|
406
|
+
<React.Fragment key="lt-channel-conversation-footer">
|
|
407
|
+
{renderConversationFooter(channel)}
|
|
408
|
+
</React.Fragment>
|
|
409
|
+
) : null}
|
|
433
410
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
411
|
+
{/* Message Input */}
|
|
412
|
+
<CustomMessageInput
|
|
413
|
+
key="lt-channel-message-input"
|
|
414
|
+
{...(renderMessageInputActions && {
|
|
415
|
+
renderActions: () => renderMessageInputActions?.(channel),
|
|
416
|
+
})}
|
|
417
|
+
renderFooter={() => renderMessageInputFooter?.(channel)}
|
|
418
|
+
disabled={composerDisabled}
|
|
419
|
+
disabledReason={composerDisabledReason}
|
|
420
|
+
/>
|
|
438
421
|
</Window>
|
|
439
422
|
</WithComponents>
|
|
440
423
|
</>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ArrowUpIcon } from '@phosphor-icons/react'
|
|
2
|
-
import classNames from 'classnames'
|
|
3
2
|
import React, { useContext } from 'react'
|
|
4
3
|
import {
|
|
5
4
|
AttachmentPreviewList as DefaultAttachmentPreviewList,
|
|
@@ -102,11 +101,9 @@ export interface CustomMessageInputProps {
|
|
|
102
101
|
* `disabled` is true.
|
|
103
102
|
*/
|
|
104
103
|
disabledReason?: string
|
|
105
|
-
className?: string
|
|
106
104
|
}
|
|
107
105
|
|
|
108
106
|
export const CustomMessageInput: React.FC<CustomMessageInputProps> = ({
|
|
109
|
-
className,
|
|
110
107
|
renderActions,
|
|
111
108
|
renderFooter,
|
|
112
109
|
disabled = false,
|
|
@@ -120,12 +117,7 @@ export const CustomMessageInput: React.FC<CustomMessageInputProps> = ({
|
|
|
120
117
|
if (disabled) {
|
|
121
118
|
return (
|
|
122
119
|
<>
|
|
123
|
-
<div
|
|
124
|
-
className={classNames(
|
|
125
|
-
'messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3',
|
|
126
|
-
className
|
|
127
|
-
)}
|
|
128
|
-
>
|
|
120
|
+
<div className="messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4">
|
|
129
121
|
{disabledReason ? (
|
|
130
122
|
<p className="max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40">
|
|
131
123
|
{disabledReason}
|
|
@@ -137,19 +129,17 @@ export const CustomMessageInput: React.FC<CustomMessageInputProps> = ({
|
|
|
137
129
|
)
|
|
138
130
|
}
|
|
139
131
|
|
|
140
|
-
const actions = renderActions?.()
|
|
141
|
-
|
|
142
132
|
return (
|
|
143
|
-
<div className=
|
|
133
|
+
<div className="flex flex-col gap-4 p-4">
|
|
144
134
|
<div
|
|
145
135
|
// @ts-expect-error Only React 19 onwards has `inert` in its types.
|
|
146
136
|
inert={isFrozen ? '' : undefined}
|
|
147
137
|
aria-disabled={isFrozen || undefined}
|
|
148
138
|
className="message-input flex items-end gap-4 aria-disabled:opacity-40"
|
|
149
139
|
>
|
|
150
|
-
{
|
|
140
|
+
{renderActions && (
|
|
151
141
|
<div className="flex h-12 shrink-0 items-center justify-center">
|
|
152
|
-
{
|
|
142
|
+
{renderActions()}
|
|
153
143
|
</div>
|
|
154
144
|
)}
|
|
155
145
|
<ComposerLockedContext.Provider value={isFrozen}>
|