@linktr.ee/messaging-react 1.34.0 → 1.35.0-rc-1777516919
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-mHUN_YWq.js → Card-C9TypY1v.js} +2 -2
- package/dist/{Card-mHUN_YWq.js.map → Card-C9TypY1v.js.map} +1 -1
- package/dist/{Card-KHDSM8Zs.js → Card-CeL8_2Rc.js} +2 -2
- package/dist/{Card-KHDSM8Zs.js.map → Card-CeL8_2Rc.js.map} +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/{index-DWk0f1PF.js → index-BhmonXWN.js} +1138 -1061
- package/dist/index-BhmonXWN.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/Avatar/Avatar.stories.tsx +29 -0
- package/src/components/Avatar/index.tsx +44 -20
- package/src/components/ChannelView.stories.tsx +45 -1
- package/src/components/ChannelView.tsx +9 -5
- package/src/components/CustomMessage/CustomMessage.stories.tsx +75 -15
- package/src/components/CustomMessage/MessageTag.stories.tsx +1 -1
- package/src/components/CustomTypingIndicator/CustomTypingIndicator.stories.tsx +114 -0
- package/src/components/CustomTypingIndicator/index.tsx +101 -0
- package/src/components/LockedAttachment/LockedAttachment.stories.tsx +91 -50
- package/src/components/MediaMessage/MediaMessage.stories.tsx +55 -17
- package/src/styles.css +0 -4
- package/dist/index-DWk0f1PF.js.map +0 -1
|
@@ -20,7 +20,7 @@ const AUDIO_THUMBNAIL = '/audio-thumbnail.jpg'
|
|
|
20
20
|
const AUDIO_SOURCE = '/audio-source.mp3'
|
|
21
21
|
|
|
22
22
|
const meta: Meta = {
|
|
23
|
-
title: '
|
|
23
|
+
title: 'LockedAttachment',
|
|
24
24
|
parameters: { layout: 'fullscreen' },
|
|
25
25
|
}
|
|
26
26
|
export default meta
|
|
@@ -137,7 +137,10 @@ export const Received: StoryFn = () => {
|
|
|
137
137
|
}, 1500)
|
|
138
138
|
}}
|
|
139
139
|
onDownloadClick={() => alert('Download clicked')}
|
|
140
|
-
onFetchSource={async () => ({
|
|
140
|
+
onFetchSource={async () => ({
|
|
141
|
+
sourceUrl: sourceUrl,
|
|
142
|
+
thumbnailUrl: thumbnailUnlockedUrl,
|
|
143
|
+
})}
|
|
141
144
|
/>
|
|
142
145
|
</td>
|
|
143
146
|
)
|
|
@@ -147,23 +150,34 @@ export const Received: StoryFn = () => {
|
|
|
147
150
|
<td className="text-xs text-right font-medium text-black/40 pr-4 align-top pt-2">
|
|
148
151
|
Unlocked
|
|
149
152
|
</td>
|
|
150
|
-
{VARIANTS.map(
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
153
|
+
{VARIANTS.map(
|
|
154
|
+
({
|
|
155
|
+
title,
|
|
156
|
+
mimeType,
|
|
157
|
+
detail,
|
|
158
|
+
thumbnailUrl,
|
|
159
|
+
thumbnailUnlockedUrl,
|
|
160
|
+
sourceUrl,
|
|
161
|
+
}) => (
|
|
162
|
+
<td key={mimeType} className="align-top">
|
|
163
|
+
<LockedAttachment.Visitor
|
|
164
|
+
title={title}
|
|
165
|
+
thumbnailUrl={thumbnailUrl}
|
|
166
|
+
mimeType={mimeType}
|
|
167
|
+
detail={detail}
|
|
168
|
+
amountText="AU$9.99"
|
|
169
|
+
paymentStatus="paid"
|
|
170
|
+
onUnlockClick={() => alert('Unlock clicked')}
|
|
171
|
+
onDownloadClick={() => alert('Download clicked')}
|
|
172
|
+
onFetchSource={async () => ({
|
|
173
|
+
sourceUrl: sourceUrl,
|
|
174
|
+
thumbnailUrl: thumbnailUnlockedUrl,
|
|
175
|
+
})}
|
|
176
|
+
/>
|
|
177
|
+
</td>
|
|
178
|
+
)
|
|
179
|
+
)}
|
|
165
180
|
</tr>
|
|
166
|
-
|
|
167
181
|
</tbody>
|
|
168
182
|
</Table>
|
|
169
183
|
)
|
|
@@ -194,7 +208,10 @@ export const Sent: StoryFn = () => (
|
|
|
194
208
|
detail={detail}
|
|
195
209
|
onFetchSource={async () => {
|
|
196
210
|
await new Promise((resolve) => setTimeout(resolve, 1500))
|
|
197
|
-
return {
|
|
211
|
+
return {
|
|
212
|
+
sourceUrl: sourceUrl,
|
|
213
|
+
thumbnailUrl: thumbnailUnlockedUrl,
|
|
214
|
+
}
|
|
198
215
|
}}
|
|
199
216
|
/>
|
|
200
217
|
</td>
|
|
@@ -222,42 +239,66 @@ export const Sent: StoryFn = () => (
|
|
|
222
239
|
<td className="text-xs text-right font-medium text-black/40 pr-4 align-top pt-2">
|
|
223
240
|
Sent
|
|
224
241
|
</td>
|
|
225
|
-
{VARIANTS.map(
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
242
|
+
{VARIANTS.map(
|
|
243
|
+
({
|
|
244
|
+
title,
|
|
245
|
+
mimeType,
|
|
246
|
+
detail,
|
|
247
|
+
thumbnailUrl,
|
|
248
|
+
thumbnailUnlockedUrl,
|
|
249
|
+
sourceUrl,
|
|
250
|
+
}) => (
|
|
251
|
+
<td key={mimeType} className="align-top">
|
|
252
|
+
<LockedAttachment.Creator
|
|
253
|
+
title={title}
|
|
254
|
+
thumbnailUrl={thumbnailUrl}
|
|
255
|
+
mimeType={mimeType}
|
|
256
|
+
detail={detail}
|
|
257
|
+
amountText="AU$9.99"
|
|
258
|
+
onFetchSource={async () => {
|
|
259
|
+
await new Promise((resolve) => setTimeout(resolve, 1500))
|
|
260
|
+
return {
|
|
261
|
+
sourceUrl: sourceUrl,
|
|
262
|
+
thumbnailUrl: thumbnailUnlockedUrl,
|
|
263
|
+
}
|
|
264
|
+
}}
|
|
265
|
+
/>
|
|
266
|
+
</td>
|
|
267
|
+
)
|
|
268
|
+
)}
|
|
240
269
|
</tr>
|
|
241
270
|
<tr>
|
|
242
271
|
<td className="text-xs text-right font-medium text-black/40 pr-4 align-top pt-2">
|
|
243
272
|
Sold
|
|
244
273
|
</td>
|
|
245
|
-
{VARIANTS.map(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
274
|
+
{VARIANTS.map(
|
|
275
|
+
({
|
|
276
|
+
title,
|
|
277
|
+
mimeType,
|
|
278
|
+
detail,
|
|
279
|
+
thumbnailUrl,
|
|
280
|
+
thumbnailUnlockedUrl,
|
|
281
|
+
sourceUrl,
|
|
282
|
+
}) => (
|
|
283
|
+
<td key={mimeType} className="align-top">
|
|
284
|
+
<LockedAttachment.Creator
|
|
285
|
+
title={title}
|
|
286
|
+
thumbnailUrl={thumbnailUrl}
|
|
287
|
+
mimeType={mimeType}
|
|
288
|
+
detail={detail}
|
|
289
|
+
amountText="AU$9.99"
|
|
290
|
+
paymentStatus="paid"
|
|
291
|
+
onFetchSource={async () => {
|
|
292
|
+
await new Promise((resolve) => setTimeout(resolve, 1500))
|
|
293
|
+
return {
|
|
294
|
+
sourceUrl: sourceUrl,
|
|
295
|
+
thumbnailUrl: thumbnailUnlockedUrl,
|
|
296
|
+
}
|
|
297
|
+
}}
|
|
298
|
+
/>
|
|
299
|
+
</td>
|
|
300
|
+
)
|
|
301
|
+
)}
|
|
261
302
|
</tr>
|
|
262
303
|
</tbody>
|
|
263
304
|
</Table>
|
|
@@ -5,7 +5,7 @@ import type { LocalMessage } from 'stream-chat'
|
|
|
5
5
|
import { MediaMessage } from '.'
|
|
6
6
|
|
|
7
7
|
const meta: Meta<typeof MediaMessage> = {
|
|
8
|
-
title: '
|
|
8
|
+
title: 'MediaMessage',
|
|
9
9
|
component: MediaMessage,
|
|
10
10
|
parameters: {
|
|
11
11
|
layout: 'fullscreen',
|
|
@@ -13,15 +13,31 @@ const meta: Meta<typeof MediaMessage> = {
|
|
|
13
13
|
}
|
|
14
14
|
export default meta
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
type MessageAttachment = NonNullable<LocalMessage['attachments']>[number]
|
|
17
|
+
|
|
18
|
+
const base = (overrides: Partial<LocalMessage> = {}): LocalMessage => {
|
|
19
|
+
const defaultMessage: LocalMessage = {
|
|
20
|
+
id: 'msg-1',
|
|
21
|
+
text: '',
|
|
22
|
+
type: 'regular',
|
|
23
|
+
created_at: new Date(),
|
|
24
|
+
updated_at: new Date(),
|
|
25
|
+
deleted_at: null,
|
|
26
|
+
pinned_at: null,
|
|
27
|
+
status: 'received',
|
|
28
|
+
attachments: [],
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
...defaultMessage,
|
|
33
|
+
...overrides,
|
|
34
|
+
created_at: overrides.created_at ?? defaultMessage.created_at,
|
|
35
|
+
updated_at: overrides.updated_at ?? defaultMessage.updated_at,
|
|
36
|
+
deleted_at: overrides.deleted_at ?? defaultMessage.deleted_at,
|
|
37
|
+
pinned_at: overrides.pinned_at ?? defaultMessage.pinned_at,
|
|
38
|
+
status: overrides.status ?? defaultMessage.status,
|
|
39
|
+
}
|
|
40
|
+
}
|
|
25
41
|
|
|
26
42
|
const VARIANTS = [
|
|
27
43
|
{
|
|
@@ -38,7 +54,8 @@ const VARIANTS = [
|
|
|
38
54
|
label: 'Audio',
|
|
39
55
|
attachment: {
|
|
40
56
|
type: 'audio',
|
|
41
|
-
asset_url:
|
|
57
|
+
asset_url:
|
|
58
|
+
'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3',
|
|
42
59
|
mime_type: 'audio/mpeg',
|
|
43
60
|
title: 'Morning Meditation',
|
|
44
61
|
file_size: 6_900_000,
|
|
@@ -119,12 +136,17 @@ const Table: React.FC<{ children: React.ReactNode }> = ({ children }) => (
|
|
|
119
136
|
</div>
|
|
120
137
|
)
|
|
121
138
|
|
|
122
|
-
const TableHead: React.FC<{ variants: readonly { label: string }[] }> = ({
|
|
139
|
+
const TableHead: React.FC<{ variants: readonly { label: string }[] }> = ({
|
|
140
|
+
variants,
|
|
141
|
+
}) => (
|
|
123
142
|
<thead>
|
|
124
143
|
<tr>
|
|
125
144
|
<th className="text-left text-xs font-medium text-black/40 pb-2" />
|
|
126
145
|
{variants.map(({ label }) => (
|
|
127
|
-
<th
|
|
146
|
+
<th
|
|
147
|
+
key={label}
|
|
148
|
+
className="text-left text-xs font-medium text-black/40 pb-2"
|
|
149
|
+
>
|
|
128
150
|
{label}
|
|
129
151
|
</th>
|
|
130
152
|
))}
|
|
@@ -144,7 +166,11 @@ export const Attachment: StoryFn = () => (
|
|
|
144
166
|
<td key={label} className="align-top">
|
|
145
167
|
<MediaMessage
|
|
146
168
|
isMyMessage={false}
|
|
147
|
-
message={base({
|
|
169
|
+
message={base({
|
|
170
|
+
attachments: [
|
|
171
|
+
attachment as MessageAttachment,
|
|
172
|
+
],
|
|
173
|
+
})}
|
|
148
174
|
/>
|
|
149
175
|
</td>
|
|
150
176
|
))}
|
|
@@ -157,7 +183,11 @@ export const Attachment: StoryFn = () => (
|
|
|
157
183
|
<td key={label} className="align-top">
|
|
158
184
|
<MediaMessage
|
|
159
185
|
isMyMessage={true}
|
|
160
|
-
message={base({
|
|
186
|
+
message={base({
|
|
187
|
+
attachments: [
|
|
188
|
+
attachment as MessageAttachment,
|
|
189
|
+
],
|
|
190
|
+
})}
|
|
161
191
|
/>
|
|
162
192
|
</td>
|
|
163
193
|
))}
|
|
@@ -178,7 +208,11 @@ export const Links: StoryFn = () => (
|
|
|
178
208
|
<td key={label} className="align-top">
|
|
179
209
|
<MediaMessage
|
|
180
210
|
isMyMessage={false}
|
|
181
|
-
message={base({
|
|
211
|
+
message={base({
|
|
212
|
+
attachments: [
|
|
213
|
+
attachment as MessageAttachment,
|
|
214
|
+
],
|
|
215
|
+
})}
|
|
182
216
|
/>
|
|
183
217
|
</td>
|
|
184
218
|
))}
|
|
@@ -191,7 +225,11 @@ export const Links: StoryFn = () => (
|
|
|
191
225
|
<td key={label} className="align-top">
|
|
192
226
|
<MediaMessage
|
|
193
227
|
isMyMessage={true}
|
|
194
|
-
message={base({
|
|
228
|
+
message={base({
|
|
229
|
+
attachments: [
|
|
230
|
+
attachment as MessageAttachment,
|
|
231
|
+
],
|
|
232
|
+
})}
|
|
195
233
|
/>
|
|
196
234
|
</td>
|
|
197
235
|
))}
|
package/src/styles.css
CHANGED