@linktr.ee/messaging-react 3.12.7 → 3.13.0-rc-1784206423
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-Dvcwvr5y.js → Card-DRuAkKPA.js} +2 -2
- package/dist/{Card-Dvcwvr5y.js.map → Card-DRuAkKPA.js.map} +1 -1
- package/dist/{Card-CUeDtVX9.cjs → Card-DoiU-rmw.cjs} +2 -2
- package/dist/{Card-CUeDtVX9.cjs.map → Card-DoiU-rmw.cjs.map} +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/{index-CQm_f20V.js → index-5x3u5nJw.js} +381 -343
- package/dist/{index-CQm_f20V.js.map → index-5x3u5nJw.js.map} +1 -1
- package/dist/{index-qzfxhUVd.cjs → index-BrVUDc5h.cjs} +2 -2
- package/dist/{index-qzfxhUVd.cjs.map → index-BrVUDc5h.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/ChannelView.tsx +43 -41
- package/src/components/CustomMessageInput/index.tsx +77 -25
- package/src/styles.css +127 -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-BrVUDc5h.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.MessageBubble=e.MessageBubble;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.optimizeMessagingAttachmentUrl=e.optimizeMessagingAttachmentUrl;exports.resolveConversationParticipant=e.resolveConversationParticipant;exports.resolveLinkAttachment=e.resolveLinkAttachment;exports.resolveMediaFromMessage=e.resolveMediaFromMessage;exports.resolveParticipantDisplayName=e.resolveParticipantDisplayName;exports.useComposerLocked=e.useComposerLocked;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 o, d as n, e as m, F as r, f as g, L as l, h as M, M as c, i as u, j as L, k as h, l as p, m as d, n as v, p as C, q as A, s as k, t as F, u as b, v as P, w as f, x, o as y, y as z, z as B, B as S, D as q, E as D, G as E, H as V, I as w } from "./index-
|
|
1
|
+
import { a as e, b as t, C as i, c as o, d as n, e as m, F as r, f as g, L as l, h as M, M as c, i as u, j as L, k as h, l as p, m as d, n as v, p as C, q as A, s as k, t as F, u as b, v as P, w as f, x, o as y, y as z, z as B, B as S, D as q, E as D, G as E, H as V, I as w } from "./index-5x3u5nJw.js";
|
|
2
2
|
export {
|
|
3
3
|
e as ActionButton,
|
|
4
4
|
t as Avatar,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linktr.ee/messaging-react",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.0-rc-1784206423",
|
|
4
4
|
"description": "React messaging components built on messaging-core for web applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@linktr.ee/component-library": "11.8.6",
|
|
53
|
-
"@linktr.ee/messaging-core": "
|
|
53
|
+
"@linktr.ee/messaging-core": "2.3.0-rc-1784206423",
|
|
54
54
|
"@phosphor-icons/react": "^2.1.10"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
@@ -555,53 +555,55 @@ const ChannelViewInner: React.FC<{
|
|
|
555
555
|
</>
|
|
556
556
|
)}
|
|
557
557
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
558
|
+
<div className="messaging-channel-layout relative flex min-h-0 flex-1 flex-col">
|
|
559
|
+
{/* Message List */}
|
|
560
|
+
<div
|
|
561
|
+
key="lt-channel-message-list"
|
|
562
|
+
className="messaging-channel-message-list relative min-h-0 flex-1 overflow-hidden"
|
|
563
|
+
>
|
|
564
|
+
{/* Stream only renders MessageList.head when there are messages, so
|
|
564
565
|
empty redesigned channels need the header and banner in normal flow. */}
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
{redesignedHeader}
|
|
569
|
-
{channelBanner}
|
|
570
|
-
</div>
|
|
571
|
-
</div>
|
|
572
|
-
)}
|
|
573
|
-
|
|
574
|
-
<MessageList
|
|
575
|
-
head={
|
|
576
|
-
onParticipantNameClick && hasVisibleMessages ? (
|
|
577
|
-
<div className="sticky top-0 z-10">
|
|
566
|
+
{onParticipantNameClick && !hasVisibleMessages && (
|
|
567
|
+
<div className="str-chat__list">
|
|
568
|
+
<div className="str-chat__message-list-scroll">
|
|
578
569
|
{redesignedHeader}
|
|
579
570
|
{channelBanner}
|
|
580
571
|
</div>
|
|
581
|
-
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
572
|
+
</div>
|
|
573
|
+
)}
|
|
574
|
+
|
|
575
|
+
<MessageList
|
|
576
|
+
head={
|
|
577
|
+
onParticipantNameClick && hasVisibleMessages ? (
|
|
578
|
+
<div className="sticky top-0 z-10">
|
|
579
|
+
{redesignedHeader}
|
|
580
|
+
{channelBanner}
|
|
581
|
+
</div>
|
|
582
|
+
) : undefined
|
|
583
|
+
}
|
|
584
|
+
hideDeletedMessages
|
|
585
|
+
hideNewMessageSeparator={false}
|
|
586
|
+
/>
|
|
587
|
+
</div>
|
|
587
588
|
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
589
|
+
{renderConversationFooter ? (
|
|
590
|
+
<React.Fragment key="lt-channel-conversation-footer">
|
|
591
|
+
{renderConversationFooter(channel)}
|
|
592
|
+
</React.Fragment>
|
|
593
|
+
) : null}
|
|
593
594
|
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
595
|
+
{/* Message Input */}
|
|
596
|
+
<CustomMessageInput
|
|
597
|
+
key="lt-channel-message-input"
|
|
598
|
+
{...(renderMessageInputActions && {
|
|
599
|
+
renderActions: () => renderMessageInputActions?.(channel),
|
|
600
|
+
})}
|
|
601
|
+
renderFooter={() => renderMessageInputFooter?.(channel)}
|
|
602
|
+
disabled={composerDisabled}
|
|
603
|
+
disabledReason={composerDisabledReason}
|
|
604
|
+
composerInput={composerInput}
|
|
605
|
+
/>
|
|
606
|
+
</div>
|
|
605
607
|
</Window>
|
|
606
608
|
</WithComponents>
|
|
607
609
|
</>
|
|
@@ -147,42 +147,94 @@ export const CustomMessageInput: React.FC<CustomMessageInputProps> = ({
|
|
|
147
147
|
}) => {
|
|
148
148
|
const { channel } = useChannelStateContext()
|
|
149
149
|
const isFrozen = channel?.data?.frozen === true
|
|
150
|
+
const composerRef = React.useRef<HTMLDivElement>(null)
|
|
151
|
+
|
|
152
|
+
React.useEffect(() => {
|
|
153
|
+
const composer = composerRef.current
|
|
154
|
+
const layout = composer?.parentElement
|
|
155
|
+
|
|
156
|
+
if (!composer || !layout) {
|
|
157
|
+
return
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const updateComposerHeight = () => {
|
|
161
|
+
layout.style.setProperty(
|
|
162
|
+
'--messaging-composer-height',
|
|
163
|
+
`${composer.offsetHeight + 16}px`
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
updateComposerHeight()
|
|
168
|
+
|
|
169
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
170
|
+
return
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const resizeObserver = new ResizeObserver(updateComposerHeight)
|
|
174
|
+
resizeObserver.observe(composer)
|
|
175
|
+
|
|
176
|
+
return () => {
|
|
177
|
+
resizeObserver.disconnect()
|
|
178
|
+
layout.style.removeProperty('--messaging-composer-height')
|
|
179
|
+
}
|
|
180
|
+
}, [])
|
|
150
181
|
|
|
151
182
|
// Linktree official channel: the composer is replaced by an info panel
|
|
152
183
|
// explaining the linker cannot send messages on this thread.
|
|
153
184
|
if (disabled) {
|
|
154
185
|
return (
|
|
155
|
-
|
|
156
|
-
<div className="messaging-composer-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
186
|
+
<div ref={composerRef} className="messaging-composer-chrome">
|
|
187
|
+
<div className="messaging-composer-backdrop" aria-hidden="true">
|
|
188
|
+
<div className="messaging-composer-backdrop-blur" />
|
|
189
|
+
<div className="messaging-composer-backdrop-blur" />
|
|
190
|
+
<div className="messaging-composer-backdrop-blur" />
|
|
191
|
+
<div className="messaging-composer-backdrop-blur" />
|
|
192
|
+
<div className="messaging-composer-backdrop-blur" />
|
|
193
|
+
<div className="messaging-composer-backdrop-gradient" />
|
|
162
194
|
</div>
|
|
163
|
-
|
|
164
|
-
|
|
195
|
+
<div className="relative z-10 flex flex-col">
|
|
196
|
+
<div className="messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4">
|
|
197
|
+
{disabledReason ? (
|
|
198
|
+
<p className="max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40">
|
|
199
|
+
{disabledReason}
|
|
200
|
+
</p>
|
|
201
|
+
) : null}
|
|
202
|
+
</div>
|
|
203
|
+
{renderFooter?.()}
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|
|
165
206
|
)
|
|
166
207
|
}
|
|
167
208
|
|
|
168
209
|
return (
|
|
169
|
-
<div className="
|
|
170
|
-
<div
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
className="
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
210
|
+
<div ref={composerRef} className="messaging-composer-chrome">
|
|
211
|
+
<div className="messaging-composer-backdrop" aria-hidden="true">
|
|
212
|
+
<div className="messaging-composer-backdrop-blur" />
|
|
213
|
+
<div className="messaging-composer-backdrop-blur" />
|
|
214
|
+
<div className="messaging-composer-backdrop-blur" />
|
|
215
|
+
<div className="messaging-composer-backdrop-blur" />
|
|
216
|
+
<div className="messaging-composer-backdrop-blur" />
|
|
217
|
+
<div className="messaging-composer-backdrop-gradient" />
|
|
218
|
+
</div>
|
|
219
|
+
|
|
220
|
+
<div className="relative z-10 flex min-h-0 flex-col gap-4 p-4">
|
|
221
|
+
<div
|
|
222
|
+
// @ts-expect-error Only React 19 onwards has `inert` in its types.
|
|
223
|
+
inert={isFrozen ? '' : undefined}
|
|
224
|
+
aria-disabled={isFrozen || undefined}
|
|
225
|
+
className="message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40"
|
|
226
|
+
>
|
|
227
|
+
{renderActions && (
|
|
228
|
+
<div className="flex h-12 shrink-0 items-center justify-center">
|
|
229
|
+
{renderActions()}
|
|
230
|
+
</div>
|
|
231
|
+
)}
|
|
232
|
+
<ComposerLockedContext.Provider value={isFrozen}>
|
|
233
|
+
<MessageInput Input={composerInput ?? CustomMessageInputInner} />
|
|
234
|
+
</ComposerLockedContext.Provider>
|
|
235
|
+
</div>
|
|
236
|
+
{renderFooter?.()}
|
|
184
237
|
</div>
|
|
185
|
-
{renderFooter?.()}
|
|
186
238
|
</div>
|
|
187
239
|
)
|
|
188
240
|
}
|
package/src/styles.css
CHANGED
|
@@ -15,6 +15,131 @@
|
|
|
15
15
|
--str-chat__own-message-bubble-color: #fff;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
.messaging-channel-message-list .str-chat__message-list-scroll {
|
|
19
|
+
padding-bottom: var(--messaging-composer-height, 9rem);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.messaging-composer-chrome {
|
|
23
|
+
position: relative;
|
|
24
|
+
right: 0;
|
|
25
|
+
bottom: 0;
|
|
26
|
+
left: 0;
|
|
27
|
+
z-index: 20;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.messaging-channel-layout > .messaging-composer-chrome {
|
|
31
|
+
position: absolute;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.messaging-composer-backdrop {
|
|
35
|
+
position: absolute;
|
|
36
|
+
inset: 0;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
isolation: isolate;
|
|
39
|
+
pointer-events: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.messaging-composer-backdrop-blur {
|
|
43
|
+
position: absolute;
|
|
44
|
+
inset: 0;
|
|
45
|
+
pointer-events: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.messaging-composer-backdrop-blur:nth-child(1) {
|
|
49
|
+
backdrop-filter: blur(2px);
|
|
50
|
+
-webkit-backdrop-filter: blur(2px);
|
|
51
|
+
mask: linear-gradient(
|
|
52
|
+
to bottom,
|
|
53
|
+
transparent 0%,
|
|
54
|
+
black 12%,
|
|
55
|
+
black 28%,
|
|
56
|
+
transparent 44%
|
|
57
|
+
);
|
|
58
|
+
-webkit-mask: linear-gradient(
|
|
59
|
+
to bottom,
|
|
60
|
+
transparent 0%,
|
|
61
|
+
black 12%,
|
|
62
|
+
black 28%,
|
|
63
|
+
transparent 44%
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.messaging-composer-backdrop-blur:nth-child(2) {
|
|
68
|
+
backdrop-filter: blur(4px);
|
|
69
|
+
-webkit-backdrop-filter: blur(4px);
|
|
70
|
+
mask: linear-gradient(
|
|
71
|
+
to bottom,
|
|
72
|
+
transparent 12%,
|
|
73
|
+
black 28%,
|
|
74
|
+
black 44%,
|
|
75
|
+
transparent 60%
|
|
76
|
+
);
|
|
77
|
+
-webkit-mask: linear-gradient(
|
|
78
|
+
to bottom,
|
|
79
|
+
transparent 12%,
|
|
80
|
+
black 28%,
|
|
81
|
+
black 44%,
|
|
82
|
+
transparent 60%
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.messaging-composer-backdrop-blur:nth-child(3) {
|
|
87
|
+
backdrop-filter: blur(8px);
|
|
88
|
+
-webkit-backdrop-filter: blur(8px);
|
|
89
|
+
mask: linear-gradient(
|
|
90
|
+
to bottom,
|
|
91
|
+
transparent 28%,
|
|
92
|
+
black 44%,
|
|
93
|
+
black 60%,
|
|
94
|
+
transparent 76%
|
|
95
|
+
);
|
|
96
|
+
-webkit-mask: linear-gradient(
|
|
97
|
+
to bottom,
|
|
98
|
+
transparent 28%,
|
|
99
|
+
black 44%,
|
|
100
|
+
black 60%,
|
|
101
|
+
transparent 76%
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.messaging-composer-backdrop-blur:nth-child(4) {
|
|
106
|
+
backdrop-filter: blur(12px);
|
|
107
|
+
-webkit-backdrop-filter: blur(12px);
|
|
108
|
+
mask: linear-gradient(
|
|
109
|
+
to bottom,
|
|
110
|
+
transparent 44%,
|
|
111
|
+
black 60%,
|
|
112
|
+
black 76%,
|
|
113
|
+
transparent 92%
|
|
114
|
+
);
|
|
115
|
+
-webkit-mask: linear-gradient(
|
|
116
|
+
to bottom,
|
|
117
|
+
transparent 44%,
|
|
118
|
+
black 60%,
|
|
119
|
+
black 76%,
|
|
120
|
+
transparent 92%
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.messaging-composer-backdrop-blur:nth-child(5) {
|
|
125
|
+
backdrop-filter: blur(16px);
|
|
126
|
+
-webkit-backdrop-filter: blur(16px);
|
|
127
|
+
mask: linear-gradient(to bottom, transparent 60%, black 76%, black 100%);
|
|
128
|
+
-webkit-mask: linear-gradient(
|
|
129
|
+
to bottom,
|
|
130
|
+
transparent 60%,
|
|
131
|
+
black 76%,
|
|
132
|
+
black 100%
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.messaging-composer-backdrop-gradient {
|
|
137
|
+
position: absolute;
|
|
138
|
+
inset: 0;
|
|
139
|
+
pointer-events: none;
|
|
140
|
+
background: linear-gradient(180deg, rgba(251, 250, 249, 0) 0%, #fbfaf9 100%);
|
|
141
|
+
}
|
|
142
|
+
|
|
18
143
|
/* Dialog component styles - used by messaging components */
|
|
19
144
|
/* Note: Dialogs get moved to the top layer when opened with .showModal() */
|
|
20
145
|
.mes-dialog {
|
|
@@ -813,6 +938,7 @@
|
|
|
813
938
|
}
|
|
814
939
|
|
|
815
940
|
}
|
|
941
|
+
|
|
816
942
|
/* Locked attachment wrapper: stack card + text bubble in the correct direction */
|
|
817
943
|
.str-chat__li .str-chat__message--me .str-chat__message-bubble-wrapper {
|
|
818
944
|
display: flex;
|
|
@@ -855,4 +981,4 @@
|
|
|
855
981
|
|
|
856
982
|
.message-locked-attachment-text .str-chat__message-text-inner {
|
|
857
983
|
color: inherit;
|
|
858
|
-
}
|
|
984
|
+
}
|