stream-chat-react-native-core 5.2.0 → 5.3.0-beta.3
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/lib/commonjs/components/Attachment/Card.js +29 -18
- package/lib/commonjs/components/Attachment/Card.js.map +1 -1
- package/lib/commonjs/components/Attachment/Gallery.js +16 -20
- package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
- package/lib/commonjs/components/Attachment/GalleryImage.js +34 -6
- package/lib/commonjs/components/Attachment/GalleryImage.js.map +1 -1
- package/lib/commonjs/components/Attachment/Giphy.js +37 -29
- package/lib/commonjs/components/Attachment/Giphy.js.map +1 -1
- package/lib/commonjs/components/Avatar/Avatar.js +10 -8
- package/lib/commonjs/components/Avatar/Avatar.js.map +1 -1
- package/lib/commonjs/components/Avatar/GroupAvatar.js +3 -1
- package/lib/commonjs/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelList.js +4 -4
- package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js +4 -4
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js +1 -1
- package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js +6 -7
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js +30 -6
- package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js.map +1 -1
- package/lib/commonjs/components/Chat/Chat.js +8 -5
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js +2 -0
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/commonjs/components/ImageBackground.js +64 -0
- package/lib/commonjs/components/ImageBackground.js.map +1 -0
- package/lib/commonjs/components/Message/Message.js +15 -16
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js +12 -4
- package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js +26 -5
- package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +58 -47
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/commonjs/contexts/chatContext/ChatContext.js +2 -2
- package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js +2 -2
- package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Card.js +29 -18
- package/lib/module/components/Attachment/Card.js.map +1 -1
- package/lib/module/components/Attachment/Gallery.js +16 -20
- package/lib/module/components/Attachment/Gallery.js.map +1 -1
- package/lib/module/components/Attachment/GalleryImage.js +34 -6
- package/lib/module/components/Attachment/GalleryImage.js.map +1 -1
- package/lib/module/components/Attachment/Giphy.js +37 -29
- package/lib/module/components/Attachment/Giphy.js.map +1 -1
- package/lib/module/components/Avatar/Avatar.js +10 -8
- package/lib/module/components/Avatar/Avatar.js.map +1 -1
- package/lib/module/components/Avatar/GroupAvatar.js +3 -1
- package/lib/module/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelList.js +4 -4
- package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListMessenger.js +4 -4
- package/lib/module/components/ChannelList/ChannelListMessenger.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js +1 -1
- package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js +6 -7
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelAvatar.js +30 -6
- package/lib/module/components/ChannelPreview/ChannelAvatar.js.map +1 -1
- package/lib/module/components/Chat/Chat.js +8 -5
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/Chat/hooks/useCreateChatContext.js +2 -0
- package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/module/components/ImageBackground.js +64 -0
- package/lib/module/components/ImageBackground.js.map +1 -0
- package/lib/module/components/Message/Message.js +15 -16
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageAvatar.js +12 -4
- package/lib/module/components/Message/MessageSimple/MessageAvatar.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js +26 -5
- package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js.map +1 -1
- package/lib/module/components/MessageOverlay/MessageOverlay.js +58 -47
- package/lib/module/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/module/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/module/contexts/chatContext/ChatContext.js +2 -2
- package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js +2 -2
- package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
- package/lib/module/native.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/Card.d.ts +3 -2
- package/lib/typescript/components/Attachment/GalleryImage.d.ts +8 -2
- package/lib/typescript/components/Attachment/Giphy.d.ts +2 -1
- package/lib/typescript/components/Avatar/Avatar.d.ts +2 -1
- package/lib/typescript/components/Avatar/GroupAvatar.d.ts +2 -1
- package/lib/typescript/components/ChannelList/hooks/usePaginatedChannels.d.ts +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelAvatar.d.ts +2 -0
- package/lib/typescript/components/Chat/Chat.d.ts +1 -1
- package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +1 -1
- package/lib/typescript/components/ImageBackground.d.ts +33 -0
- package/lib/typescript/components/Message/Message.d.ts +2 -1
- package/lib/typescript/components/Message/MessageSimple/MessageAvatar.d.ts +2 -1
- package/lib/typescript/components/Message/MessageSimple/MessageRepliesAvatars.d.ts +2 -0
- package/lib/typescript/contexts/channelsContext/ChannelsContext.d.ts +1 -1
- package/lib/typescript/contexts/chatContext/ChatContext.d.ts +3 -1
- package/lib/typescript/contexts/messageOverlayContext/MessageOverlayContext.d.ts +4 -0
- package/lib/typescript/native.d.ts +2 -2
- package/package.json +1 -1
- package/src/__tests__/offline-feature.test.js +3 -1
- package/src/components/Attachment/Card.tsx +11 -2
- package/src/components/Attachment/Gallery.tsx +1 -7
- package/src/components/Attachment/GalleryImage.tsx +31 -9
- package/src/components/Attachment/Giphy.tsx +8 -2
- package/src/components/Avatar/Avatar.tsx +12 -2
- package/src/components/Avatar/GroupAvatar.tsx +4 -4
- package/src/components/ChannelList/ChannelList.tsx +3 -2
- package/src/components/ChannelList/ChannelListMessenger.tsx +3 -3
- package/src/components/ChannelList/__tests__/ChannelList.test.js +1 -1
- package/src/components/ChannelList/hooks/listeners/__tests__/useChannelUpdated.test.tsx +2 -1
- package/src/components/ChannelList/hooks/useCreateChannelsContext.ts +1 -1
- package/src/components/ChannelList/hooks/usePaginatedChannels.ts +12 -11
- package/src/components/ChannelPreview/ChannelAvatar.tsx +23 -4
- package/src/components/Chat/Chat.tsx +98 -95
- package/src/components/Chat/hooks/useCreateChatContext.ts +2 -0
- package/src/components/ImageBackground.tsx +77 -0
- package/src/components/Message/Message.tsx +8 -8
- package/src/components/Message/MessageSimple/MessageAvatar.tsx +6 -2
- package/src/components/Message/MessageSimple/MessageRepliesAvatars.tsx +15 -3
- package/src/components/MessageOverlay/MessageOverlay.tsx +210 -205
- package/src/contexts/channelsContext/ChannelsContext.tsx +1 -1
- package/src/contexts/chatContext/ChatContext.tsx +3 -1
- package/src/contexts/messageOverlayContext/MessageOverlayContext.tsx +8 -1
- package/src/native.ts +2 -2
- package/src/version.json +1 -1
|
@@ -25,6 +25,8 @@ var _OverlayReactionList = require("./OverlayReactionList");
|
|
|
25
25
|
|
|
26
26
|
var _OverlayReactionsAvatar = require("./OverlayReactionsAvatar");
|
|
27
27
|
|
|
28
|
+
var _ChatContext = require("../../contexts/chatContext/ChatContext");
|
|
29
|
+
|
|
28
30
|
var _MessageContext = require("../../contexts/messageContext/MessageContext");
|
|
29
31
|
|
|
30
32
|
var _MessageOverlayContext = require("../../contexts/messageOverlayContext/MessageOverlayContext");
|
|
@@ -98,6 +100,7 @@ var MessageOverlayWithContext = function MessageOverlayWithContext(props) {
|
|
|
98
100
|
groupStyles = props.groupStyles,
|
|
99
101
|
handleReaction = props.handleReaction,
|
|
100
102
|
images = props.images,
|
|
103
|
+
chatContext = props.chatContext,
|
|
101
104
|
message = props.message,
|
|
102
105
|
messageActions = props.messageActions,
|
|
103
106
|
_props$MessageActionL = props.MessageActionList,
|
|
@@ -269,29 +272,37 @@ var MessageOverlayWithContext = function MessageOverlayWithContext(props) {
|
|
|
269
272
|
MessageAvatar = _ref2.MessageAvatar,
|
|
270
273
|
Reply = _ref2.Reply;
|
|
271
274
|
|
|
272
|
-
return _react["default"].createElement(
|
|
273
|
-
value:
|
|
275
|
+
return _react["default"].createElement(_ChatContext.ChatProvider, {
|
|
276
|
+
value: chatContext,
|
|
274
277
|
__self: _this,
|
|
275
278
|
__source: {
|
|
276
279
|
fileName: _jsxFileName,
|
|
277
|
-
lineNumber:
|
|
280
|
+
lineNumber: 306,
|
|
278
281
|
columnNumber: 5
|
|
279
282
|
}
|
|
283
|
+
}, _react["default"].createElement(_MessagesContext.MessagesProvider, {
|
|
284
|
+
value: messagesContext,
|
|
285
|
+
__self: _this,
|
|
286
|
+
__source: {
|
|
287
|
+
fileName: _jsxFileName,
|
|
288
|
+
lineNumber: 307,
|
|
289
|
+
columnNumber: 7
|
|
290
|
+
}
|
|
280
291
|
}, _react["default"].createElement(_MessageContext.MessageProvider, {
|
|
281
292
|
value: messageContext,
|
|
282
293
|
__self: _this,
|
|
283
294
|
__source: {
|
|
284
295
|
fileName: _jsxFileName,
|
|
285
|
-
lineNumber:
|
|
286
|
-
columnNumber:
|
|
296
|
+
lineNumber: 308,
|
|
297
|
+
columnNumber: 9
|
|
287
298
|
}
|
|
288
299
|
}, _react["default"].createElement(_ThemeContext.ThemeProvider, {
|
|
289
300
|
mergedStyle: wrapMessageInTheme ? modifiedTheme : theme,
|
|
290
301
|
__self: _this,
|
|
291
302
|
__source: {
|
|
292
303
|
fileName: _jsxFileName,
|
|
293
|
-
lineNumber:
|
|
294
|
-
columnNumber:
|
|
304
|
+
lineNumber: 309,
|
|
305
|
+
columnNumber: 11
|
|
295
306
|
}
|
|
296
307
|
}, _react["default"].createElement(_reactNativeReanimated["default"].View, {
|
|
297
308
|
pointerEvents: 'auto',
|
|
@@ -299,8 +310,8 @@ var MessageOverlayWithContext = function MessageOverlayWithContext(props) {
|
|
|
299
310
|
__self: _this,
|
|
300
311
|
__source: {
|
|
301
312
|
fileName: _jsxFileName,
|
|
302
|
-
lineNumber:
|
|
303
|
-
columnNumber:
|
|
313
|
+
lineNumber: 310,
|
|
314
|
+
columnNumber: 13
|
|
304
315
|
}
|
|
305
316
|
}, _react["default"].createElement(_reactNativeGestureHandler.PanGestureHandler, {
|
|
306
317
|
enabled: overlay === 'message',
|
|
@@ -310,24 +321,24 @@ var MessageOverlayWithContext = function MessageOverlayWithContext(props) {
|
|
|
310
321
|
__self: _this,
|
|
311
322
|
__source: {
|
|
312
323
|
fileName: _jsxFileName,
|
|
313
|
-
lineNumber:
|
|
314
|
-
columnNumber:
|
|
324
|
+
lineNumber: 314,
|
|
325
|
+
columnNumber: 15
|
|
315
326
|
}
|
|
316
327
|
}, _react["default"].createElement(_reactNativeReanimated["default"].View, {
|
|
317
328
|
style: [_reactNative.StyleSheet.absoluteFillObject],
|
|
318
329
|
__self: _this,
|
|
319
330
|
__source: {
|
|
320
331
|
fileName: _jsxFileName,
|
|
321
|
-
lineNumber:
|
|
322
|
-
columnNumber:
|
|
332
|
+
lineNumber: 320,
|
|
333
|
+
columnNumber: 17
|
|
323
334
|
}
|
|
324
335
|
}, _react["default"].createElement(_reactNative.SafeAreaView, {
|
|
325
336
|
style: styles.flex,
|
|
326
337
|
__self: _this,
|
|
327
338
|
__source: {
|
|
328
339
|
fileName: _jsxFileName,
|
|
329
|
-
lineNumber:
|
|
330
|
-
columnNumber:
|
|
340
|
+
lineNumber: 321,
|
|
341
|
+
columnNumber: 19
|
|
331
342
|
}
|
|
332
343
|
}, _react["default"].createElement(_reactNativeGestureHandler.TapGestureHandler, {
|
|
333
344
|
maxDist: 32,
|
|
@@ -341,16 +352,16 @@ var MessageOverlayWithContext = function MessageOverlayWithContext(props) {
|
|
|
341
352
|
__self: _this,
|
|
342
353
|
__source: {
|
|
343
354
|
fileName: _jsxFileName,
|
|
344
|
-
lineNumber:
|
|
345
|
-
columnNumber:
|
|
355
|
+
lineNumber: 322,
|
|
356
|
+
columnNumber: 21
|
|
346
357
|
}
|
|
347
358
|
}, _react["default"].createElement(_reactNativeReanimated["default"].View, {
|
|
348
359
|
style: [styles.flex, panStyle],
|
|
349
360
|
__self: _this,
|
|
350
361
|
__source: {
|
|
351
362
|
fileName: _jsxFileName,
|
|
352
|
-
lineNumber:
|
|
353
|
-
columnNumber:
|
|
363
|
+
lineNumber: 330,
|
|
364
|
+
columnNumber: 23
|
|
354
365
|
}
|
|
355
366
|
}, message && _react["default"].createElement(_reactNative.View, {
|
|
356
367
|
style: [styles.center, styles.overlayPadding, {
|
|
@@ -359,8 +370,8 @@ var MessageOverlayWithContext = function MessageOverlayWithContext(props) {
|
|
|
359
370
|
__self: _this,
|
|
360
371
|
__source: {
|
|
361
372
|
fileName: _jsxFileName,
|
|
362
|
-
lineNumber:
|
|
363
|
-
columnNumber:
|
|
373
|
+
lineNumber: 332,
|
|
374
|
+
columnNumber: 27
|
|
364
375
|
}
|
|
365
376
|
}, handleReaction && ownCapabilities != null && ownCapabilities.sendReaction ? _react["default"].createElement(OverlayReactionList, {
|
|
366
377
|
messageLayout: messageLayout,
|
|
@@ -371,8 +382,8 @@ var MessageOverlayWithContext = function MessageOverlayWithContext(props) {
|
|
|
371
382
|
__self: _this,
|
|
372
383
|
__source: {
|
|
373
384
|
fileName: _jsxFileName,
|
|
374
|
-
lineNumber:
|
|
375
|
-
columnNumber:
|
|
385
|
+
lineNumber: 341,
|
|
386
|
+
columnNumber: 31
|
|
376
387
|
}
|
|
377
388
|
}) : null, _react["default"].createElement(_reactNativeReanimated["default"].View, {
|
|
378
389
|
onLayout: function onLayout(_ref4) {
|
|
@@ -392,8 +403,8 @@ var MessageOverlayWithContext = function MessageOverlayWithContext(props) {
|
|
|
392
403
|
__self: _this,
|
|
393
404
|
__source: {
|
|
394
405
|
fileName: _jsxFileName,
|
|
395
|
-
lineNumber:
|
|
396
|
-
columnNumber:
|
|
406
|
+
lineNumber: 349,
|
|
407
|
+
columnNumber: 29
|
|
397
408
|
}
|
|
398
409
|
}, alignment === 'left' && MessageAvatar && _react["default"].createElement(MessageAvatar, {
|
|
399
410
|
alignment: alignment,
|
|
@@ -402,8 +413,8 @@ var MessageOverlayWithContext = function MessageOverlayWithContext(props) {
|
|
|
402
413
|
__self: _this,
|
|
403
414
|
__source: {
|
|
404
415
|
fileName: _jsxFileName,
|
|
405
|
-
lineNumber:
|
|
406
|
-
columnNumber:
|
|
416
|
+
lineNumber: 365,
|
|
417
|
+
columnNumber: 33
|
|
407
418
|
}
|
|
408
419
|
}), _react["default"].createElement(_reactNative.View, {
|
|
409
420
|
pointerEvents: "none",
|
|
@@ -418,8 +429,8 @@ var MessageOverlayWithContext = function MessageOverlayWithContext(props) {
|
|
|
418
429
|
__self: _this,
|
|
419
430
|
__source: {
|
|
420
431
|
fileName: _jsxFileName,
|
|
421
|
-
lineNumber:
|
|
422
|
-
columnNumber:
|
|
432
|
+
lineNumber: 367,
|
|
433
|
+
columnNumber: 31
|
|
423
434
|
}
|
|
424
435
|
}, messagesContext == null ? void 0 : (_messagesContext$mess = messagesContext.messageContentOrder) == null ? void 0 : _messagesContext$mess.map(function (messageContentType, messageContentOrderIndex) {
|
|
425
436
|
switch (messageContentType) {
|
|
@@ -430,8 +441,8 @@ var MessageOverlayWithContext = function MessageOverlayWithContext(props) {
|
|
|
430
441
|
__self: _this,
|
|
431
442
|
__source: {
|
|
432
443
|
fileName: _jsxFileName,
|
|
433
|
-
lineNumber:
|
|
434
|
-
columnNumber:
|
|
444
|
+
lineNumber: 412,
|
|
445
|
+
columnNumber: 45
|
|
435
446
|
}
|
|
436
447
|
}, _react["default"].createElement(Reply, {
|
|
437
448
|
quotedMessage: message.quoted_message,
|
|
@@ -443,8 +454,8 @@ var MessageOverlayWithContext = function MessageOverlayWithContext(props) {
|
|
|
443
454
|
__self: _this,
|
|
444
455
|
__source: {
|
|
445
456
|
fileName: _jsxFileName,
|
|
446
|
-
lineNumber:
|
|
447
|
-
columnNumber:
|
|
457
|
+
lineNumber: 416,
|
|
458
|
+
columnNumber: 47
|
|
448
459
|
}
|
|
449
460
|
}));
|
|
450
461
|
|
|
@@ -456,8 +467,8 @@ var MessageOverlayWithContext = function MessageOverlayWithContext(props) {
|
|
|
456
467
|
__self: _this,
|
|
457
468
|
__source: {
|
|
458
469
|
fileName: _jsxFileName,
|
|
459
|
-
lineNumber:
|
|
460
|
-
columnNumber:
|
|
470
|
+
lineNumber: 433,
|
|
471
|
+
columnNumber: 47
|
|
461
472
|
}
|
|
462
473
|
});
|
|
463
474
|
});
|
|
@@ -470,8 +481,8 @@ var MessageOverlayWithContext = function MessageOverlayWithContext(props) {
|
|
|
470
481
|
__self: _this,
|
|
471
482
|
__source: {
|
|
472
483
|
fileName: _jsxFileName,
|
|
473
|
-
lineNumber:
|
|
474
|
-
columnNumber:
|
|
484
|
+
lineNumber: 442,
|
|
485
|
+
columnNumber: 45
|
|
475
486
|
}
|
|
476
487
|
});
|
|
477
488
|
|
|
@@ -488,8 +499,8 @@ var MessageOverlayWithContext = function MessageOverlayWithContext(props) {
|
|
|
488
499
|
__self: _this,
|
|
489
500
|
__source: {
|
|
490
501
|
fileName: _jsxFileName,
|
|
491
|
-
lineNumber:
|
|
492
|
-
columnNumber:
|
|
502
|
+
lineNumber: 452,
|
|
503
|
+
columnNumber: 45
|
|
493
504
|
}
|
|
494
505
|
});
|
|
495
506
|
|
|
@@ -504,8 +515,8 @@ var MessageOverlayWithContext = function MessageOverlayWithContext(props) {
|
|
|
504
515
|
__self: _this,
|
|
505
516
|
__source: {
|
|
506
517
|
fileName: _jsxFileName,
|
|
507
|
-
lineNumber:
|
|
508
|
-
columnNumber:
|
|
518
|
+
lineNumber: 468,
|
|
519
|
+
columnNumber: 43
|
|
509
520
|
}
|
|
510
521
|
});
|
|
511
522
|
}
|
|
@@ -517,8 +528,8 @@ var MessageOverlayWithContext = function MessageOverlayWithContext(props) {
|
|
|
517
528
|
__self: _this,
|
|
518
529
|
__source: {
|
|
519
530
|
fileName: _jsxFileName,
|
|
520
|
-
lineNumber:
|
|
521
|
-
columnNumber:
|
|
531
|
+
lineNumber: 482,
|
|
532
|
+
columnNumber: 31
|
|
522
533
|
}
|
|
523
534
|
})), !!messageReactionTitle && message.latest_reactions && message.latest_reactions.length > 0 ? _react["default"].createElement(OverlayReactions, {
|
|
524
535
|
alignment: alignment,
|
|
@@ -540,10 +551,10 @@ var MessageOverlayWithContext = function MessageOverlayWithContext(props) {
|
|
|
540
551
|
__self: _this,
|
|
541
552
|
__source: {
|
|
542
553
|
fileName: _jsxFileName,
|
|
543
|
-
lineNumber:
|
|
544
|
-
columnNumber:
|
|
554
|
+
lineNumber: 492,
|
|
555
|
+
columnNumber: 31
|
|
545
556
|
}
|
|
546
|
-
}) : null))))))))));
|
|
557
|
+
}) : null)))))))))));
|
|
547
558
|
};
|
|
548
559
|
|
|
549
560
|
var areEqual = function areEqual(prevProps, nextProps) {
|
|
@@ -596,7 +607,7 @@ var MessageOverlay = function MessageOverlay(props) {
|
|
|
596
607
|
__self: _this,
|
|
597
608
|
__source: {
|
|
598
609
|
fileName: _jsxFileName,
|
|
599
|
-
lineNumber:
|
|
610
|
+
lineNumber: 600,
|
|
600
611
|
columnNumber: 5
|
|
601
612
|
}
|
|
602
613
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["MessageOverlay.tsx"],"names":["styles","StyleSheet","create","alignEnd","alignItems","alignStart","center","flexGrow","justifyContent","containerInner","borderTopLeftRadius","borderTopRightRadius","borderWidth","overflow","flex","overlayPadding","padding","replyContainer","flexDirection","paddingHorizontal","paddingTop","row","scrollView","Platform","OS","screenHeight","halfScreenHeight","DefaultMessageTextNumberOfLines","MessageOverlayWithContext","props","alignment","ownCapabilities","clientId","files","groupStyles","handleReaction","images","message","messageActions","MessageActionList","DefaultMessageActionList","MessageActionListItem","messageContext","messageReactionTitle","messageTextNumberOfLines","messagesContext","onlyEmojis","otherAttachments","overlay","overlayOpacity","OverlayReactionList","OverlayReactionListDefault","OverlayReactions","DefaultOverlayReactions","OverlayReactionsAvatar","OverlayReactionsAvatarDefault","setOverlay","threadList","videos","isMyMessage","messageReactions","error","isThreadMessage","messageActionProps","theme","myMessageTheme","wrapMessageInTheme","user","id","JSON","stringify","myMessageThemeString","setMyMessageThemeString","modifiedTheme","style","colors","blue_alice","grey_gainsboro","grey_whisper","transparent","white_smoke","messageSimple","content","container","borderRadiusL","borderRadiusS","containerStyle","messageHeight","messageLayout","x","y","messageWidth","offsetY","translateY","scale","showScreen","fadeScreen","value","damping","mass","restDisplacementThreshold","restSpeedThreshold","stiffness","velocity","Keyboard","dismiss","onPan","onActive","evt","translationY","Extrapolate","CLAMP","onFinish","finalYPosition","velocityY","duration","easing","Easing","out","ease","onStart","panStyle","transform","showScreenStyle","translateX","groupStyle","toLowerCase","hasThreadReplies","reply_count","Attachment","FileAttachmentGroup","Gallery","MessageAvatar","Reply","absoluteFillObject","state","nativeEvent","State","END","sendReaction","own_reactions","map","reaction","type","layout","layoutHeight","height","layoutWidth","width","showAvatar","backgroundColor","quoted_message","length","borderBottomLeftRadius","borderBottomRightRadius","borderColor","messageContentOrder","messageContentType","messageContentOrderIndex","messageContainer","maxWidth","attachment","attachmentIndex","actions","latest_reactions","image","name","user_id","supportedReactions","areEqual","prevProps","nextProps","prevAlignment","prevMessage","prevMessageReactionTitle","nextAlignment","nextMessage","nextMessageReactionTitle","alignmentEqual","messageReactionTitleEqual","latestReactionsEqual","Array","isArray","every","index","MemoizedMessageOverlay","React","memo","MessageOverlay","data","componentProps"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAMA;;AAcA;;AACA;;AACA;;AAEA;;AACA;;AAMA;;AACA;;AAKA;;AAGA;;AACA;;AACA;;;;;;;;;AAMA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,QAAQ,EAAE;AAAEC,IAAAA,UAAU,EAAE;AAAd,GADqB;AAE/BC,EAAAA,UAAU,EAAE;AAAED,IAAAA,UAAU,EAAE;AAAd,GAFmB;AAG/BE,EAAAA,MAAM,EAAE;AACNC,IAAAA,QAAQ,EAAE,CADJ;AAENC,IAAAA,cAAc,EAAE;AAFV,GAHuB;AAO/BC,EAAAA,cAAc,EAAE;AACdC,IAAAA,mBAAmB,EAAE,EADP;AAEdC,IAAAA,oBAAoB,EAAE,EAFR;AAGdC,IAAAA,WAAW,EAAE,CAHC;AAIdC,IAAAA,QAAQ,EAAE;AAJI,GAPe;AAa/BC,EAAAA,IAAI,EAAE;AACJA,IAAAA,IAAI,EAAE;AADF,GAbyB;AAgB/BC,EAAAA,cAAc,EAAE;AACdC,IAAAA,OAAO,EAAE;AADK,GA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,IAAN,CAC7B/J,yBAD6B,EAE7B6I,QAF6B,CAA/B;;AAiBO,IAAMmB,cAAc,GAAG,SAAjBA,cAAiB,CAG5B/J,KAH4B,EAIzB;AACH,8BAOI,sDAPJ;AAAA,MACEgK,IADF,yBACEA,IADF;AAAA,MAEEtJ,iBAFF,yBAEEA,iBAFF;AAAA,MAGEE,qBAHF,yBAGEA,qBAHF;AAAA,MAIES,mBAJF,yBAIEA,mBAJF;AAAA,MAKEE,gBALF,yBAKEA,gBALF;AAAA,MAMEE,sBANF,yBAMEA,sBANF;;AAQA,2BAAgC,wCAAhC;AAAA,MAAQN,OAAR,sBAAQA,OAAR;AAAA,MAAiBQ,UAAjB,sBAAiBA,UAAjB;;AAEA,MAAMsI,cAAc,GAAG;AACrBvJ,IAAAA,iBAAiB,EAAEV,KAAK,CAACU,iBAAN,IAA2BA,iBADzB;AAErBE,IAAAA,qBAAqB,EAAEZ,KAAK,CAACY,qBAAN,IAA+BA,qBAFjC;AAGrBS,IAAAA,mBAAmB,EACjBrB,KAAK,CAACqB,mBAAN,IAA6BA,mBAA7B,KAAoD2I,IAApD,oBAAoDA,IAAI,CAAE3I,mBAA1D,CAJmB;AAKrBE,IAAAA,gBAAgB,EAAEvB,KAAK,CAACuB,gBAAN,IAA0BA,gBALvB;AAMrBE,IAAAA,sBAAsB,EAAEzB,KAAK,CAACyB,sBAAN,IAAgCA;AANnC,GAAvB;AASA,SACE,gCAAC,sBAAD;AAEIN,IAAAA,OAAO,EAAPA,OAFJ;AAGIQ,IAAAA,UAAU,EAAVA;AAHJ,KAKMsI,cALN,EAMOD,IAAI,IAAI,EANf,EAOMhK,KAPN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KADF;AAWD,CAnCM","sourcesContent":["import React, { useEffect, useMemo, useState } from 'react';\nimport { Keyboard, Platform, SafeAreaView, StyleSheet, View, ViewStyle } from 'react-native';\nimport {\n PanGestureHandler,\n PanGestureHandlerGestureEvent,\n State,\n TapGestureHandler,\n} from 'react-native-gesture-handler';\nimport Animated, {\n cancelAnimation,\n Easing,\n Extrapolate,\n interpolate,\n runOnJS,\n useAnimatedGestureHandler,\n useAnimatedStyle,\n useSharedValue,\n withDecay,\n withSpring,\n withTiming,\n} from 'react-native-reanimated';\n\nimport { MessageActionList as DefaultMessageActionList } from './MessageActionList';\nimport { OverlayReactionList as OverlayReactionListDefault } from './OverlayReactionList';\nimport { OverlayReactionsAvatar as OverlayReactionsAvatarDefault } from './OverlayReactionsAvatar';\n\nimport { MessageProvider } from '../../contexts/messageContext/MessageContext';\nimport {\n MessageOverlayContextValue,\n MessageOverlayData,\n useMessageOverlayContext,\n} from '../../contexts/messageOverlayContext/MessageOverlayContext';\n\nimport { MessagesProvider } from '../../contexts/messagesContext/MessagesContext';\nimport {\n OverlayContextValue,\n OverlayProviderProps,\n useOverlayContext,\n} from '../../contexts/overlayContext/OverlayContext';\nimport { mergeThemes, ThemeProvider, useTheme } from '../../contexts/themeContext/ThemeContext';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { vh, vw } from '../../utils/utils';\nimport { MessageTextContainer } from '../Message/MessageSimple/MessageTextContainer';\nimport {\n OverlayReactions as DefaultOverlayReactions,\n Reaction,\n} from '../MessageOverlay/OverlayReactions';\nimport type { ReplyProps } from '../Reply/Reply';\n\nconst styles = StyleSheet.create({\n alignEnd: { alignItems: 'flex-end' },\n alignStart: { alignItems: 'flex-start' },\n center: {\n flexGrow: 1,\n justifyContent: 'center',\n },\n containerInner: {\n borderTopLeftRadius: 16,\n borderTopRightRadius: 16,\n borderWidth: 1,\n overflow: 'hidden',\n },\n flex: {\n flex: 1,\n },\n overlayPadding: {\n padding: 8,\n },\n replyContainer: {\n flexDirection: 'row',\n paddingHorizontal: 8,\n paddingTop: 8,\n },\n row: { flexDirection: 'row' },\n scrollView: { overflow: Platform.OS === 'ios' ? 'visible' : 'scroll' },\n});\n\nconst screenHeight = vh(100);\nconst halfScreenHeight = vh(50);\nconst DefaultMessageTextNumberOfLines = 5;\n\nexport type MessageOverlayPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<\n MessageOverlayContextValue<StreamChatGenerics>,\n | 'MessageActionList'\n | 'MessageActionListItem'\n | 'OverlayReactionList'\n | 'OverlayReactions'\n | 'OverlayReactionsAvatar'\n> &\n Omit<MessageOverlayData<StreamChatGenerics>, 'supportedReactions'> &\n Pick<OverlayContextValue, 'overlay' | 'setOverlay'> &\n Pick<\n OverlayProviderProps<StreamChatGenerics>,\n | 'error'\n | 'isMyMessage'\n | 'isThreadMessage'\n | 'message'\n | 'messageReactions'\n | 'messageTextNumberOfLines'\n > & {\n overlayOpacity: Animated.SharedValue<number>;\n showScreen?: Animated.SharedValue<number>;\n };\n\nconst MessageOverlayWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: MessageOverlayPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n alignment,\n ownCapabilities,\n clientId,\n files,\n groupStyles,\n handleReaction,\n images,\n message,\n messageActions,\n MessageActionList = DefaultMessageActionList,\n MessageActionListItem,\n messageContext,\n messageReactionTitle,\n messageTextNumberOfLines = DefaultMessageTextNumberOfLines,\n messagesContext,\n onlyEmojis,\n otherAttachments,\n overlay,\n overlayOpacity,\n OverlayReactionList = OverlayReactionListDefault,\n OverlayReactions = DefaultOverlayReactions,\n OverlayReactionsAvatar = OverlayReactionsAvatarDefault,\n setOverlay,\n threadList,\n videos,\n isMyMessage,\n messageReactions,\n error,\n isThreadMessage,\n } = props;\n\n const messageActionProps = {\n error,\n isMyMessage,\n isThreadMessage,\n message,\n messageReactions,\n };\n\n const { theme } = useTheme();\n\n const myMessageTheme = messagesContext?.myMessageTheme;\n const wrapMessageInTheme = clientId === message?.user?.id && !!myMessageTheme;\n\n const [myMessageThemeString, setMyMessageThemeString] = useState(JSON.stringify(myMessageTheme));\n\n useEffect(() => {\n if (myMessageTheme) {\n setMyMessageThemeString(JSON.stringify(myMessageTheme));\n }\n }, [myMessageTheme]);\n\n const modifiedTheme = useMemo(\n () => mergeThemes({ style: myMessageTheme, theme }),\n [myMessageThemeString, theme],\n );\n\n const {\n colors: { blue_alice, grey_gainsboro, grey_whisper, transparent, white_smoke },\n messageSimple: {\n content: {\n container: { borderRadiusL, borderRadiusS },\n containerInner,\n replyContainer,\n },\n },\n overlay: { container: containerStyle, padding: overlayPadding },\n } = wrapMessageInTheme ? modifiedTheme : theme;\n\n const messageHeight = useSharedValue(0);\n const messageLayout = useSharedValue({ x: 0, y: 0 });\n const messageWidth = useSharedValue(0);\n\n const offsetY = useSharedValue(0);\n const translateY = useSharedValue(0);\n const scale = useSharedValue(1);\n\n const showScreen = useSharedValue(0);\n const fadeScreen = () => {\n 'worklet';\n\n offsetY.value = 0;\n translateY.value = 0;\n scale.value = 1;\n showScreen.value = withSpring(1, {\n damping: 600,\n mass: 0.5,\n restDisplacementThreshold: 0.01,\n restSpeedThreshold: 0.01,\n stiffness: 200,\n velocity: 32,\n });\n };\n\n useEffect(() => {\n Keyboard.dismiss();\n fadeScreen();\n }, []);\n\n const onPan = useAnimatedGestureHandler<PanGestureHandlerGestureEvent>({\n onActive: (evt) => {\n translateY.value = offsetY.value + evt.translationY;\n overlayOpacity.value = interpolate(\n translateY.value,\n [0, halfScreenHeight],\n [1, 0.75],\n Extrapolate.CLAMP,\n );\n scale.value = interpolate(\n translateY.value,\n [0, halfScreenHeight],\n [1, 0.85],\n Extrapolate.CLAMP,\n );\n },\n onFinish: (evt) => {\n const finalYPosition = evt.translationY + evt.velocityY * 0.1;\n\n if (finalYPosition > halfScreenHeight && translateY.value > 0) {\n cancelAnimation(translateY);\n overlayOpacity.value = withTiming(\n 0,\n {\n duration: 200,\n easing: Easing.out(Easing.ease),\n },\n () => {\n runOnJS(setOverlay)('none');\n },\n );\n translateY.value =\n evt.velocityY > 1000\n ? withDecay({\n velocity: evt.velocityY,\n })\n : withTiming(screenHeight, {\n duration: 200,\n easing: Easing.out(Easing.ease),\n });\n } else {\n translateY.value = withTiming(0);\n scale.value = withTiming(1);\n overlayOpacity.value = withTiming(1);\n }\n },\n onStart: () => {\n cancelAnimation(translateY);\n offsetY.value = translateY.value;\n },\n });\n\n const panStyle = useAnimatedStyle<ViewStyle>(() => ({\n transform: [\n {\n translateY: translateY.value,\n },\n {\n scale: scale.value,\n },\n ],\n }));\n\n const showScreenStyle = useAnimatedStyle<ViewStyle>(\n () => ({\n transform: [\n {\n translateY: interpolate(showScreen.value, [0, 1], [messageHeight.value / 2, 0]),\n },\n {\n translateX: interpolate(\n showScreen.value,\n [0, 1],\n [alignment === 'left' ? -messageWidth.value / 2 : messageWidth.value / 2, 0],\n ),\n },\n {\n scale: showScreen.value,\n },\n ],\n }),\n [alignment],\n );\n\n const groupStyle = `${alignment}_${(groupStyles?.[0] || 'bottom').toLowerCase()}`;\n\n const hasThreadReplies = !!message?.reply_count;\n\n const { Attachment, FileAttachmentGroup, Gallery, MessageAvatar, Reply } = messagesContext || {};\n\n return (\n <MessagesProvider value={messagesContext}>\n <MessageProvider value={messageContext}>\n <ThemeProvider mergedStyle={wrapMessageInTheme ? modifiedTheme : theme}>\n <Animated.View\n pointerEvents={'auto'}\n style={[StyleSheet.absoluteFillObject, containerStyle]}\n >\n <PanGestureHandler\n enabled={overlay === 'message'}\n maxPointers={1}\n minDist={10}\n onGestureEvent={onPan}\n >\n <Animated.View style={[StyleSheet.absoluteFillObject]}>\n <SafeAreaView style={styles.flex}>\n <TapGestureHandler\n maxDist={32}\n onHandlerStateChange={({ nativeEvent: { state } }) => {\n if (state === State.END) {\n setOverlay('none');\n }\n }}\n >\n <Animated.View style={[styles.flex, panStyle]}>\n {message && (\n <View\n style={[\n styles.center,\n styles.overlayPadding,\n { padding: overlayPadding },\n alignment === 'left' ? styles.alignStart : styles.alignEnd,\n ]}\n >\n {handleReaction && ownCapabilities?.sendReaction ? (\n <OverlayReactionList\n messageLayout={messageLayout}\n ownReactionTypes={\n message?.own_reactions?.map((reaction) => reaction.type) || []\n }\n showScreen={showScreen}\n />\n ) : null}\n <Animated.View\n onLayout={({\n nativeEvent: {\n layout: { height: layoutHeight, width: layoutWidth, x, y },\n },\n }) => {\n messageLayout.value = {\n x: alignment === 'left' ? x + layoutWidth : x,\n y,\n };\n messageWidth.value = layoutWidth;\n messageHeight.value = layoutHeight;\n }}\n style={[styles.alignEnd, styles.row, showScreenStyle]}\n >\n {alignment === 'left' && MessageAvatar && (\n <MessageAvatar {...{ alignment, message, showAvatar: true }} />\n )}\n <View\n pointerEvents='none'\n style={[\n styles.containerInner,\n {\n backgroundColor:\n onlyEmojis && !message.quoted_message\n ? transparent\n : otherAttachments?.length\n ? otherAttachments[0].type === 'giphy'\n ? !message.quoted_message\n ? transparent\n : grey_gainsboro\n : blue_alice\n : alignment === 'left'\n ? white_smoke\n : grey_gainsboro,\n borderBottomLeftRadius:\n (groupStyle === 'left_bottom' ||\n groupStyle === 'left_single') &&\n (!hasThreadReplies || threadList)\n ? borderRadiusS\n : borderRadiusL,\n borderBottomRightRadius:\n (groupStyle === 'right_bottom' ||\n groupStyle === 'right_single') &&\n (!hasThreadReplies || threadList)\n ? borderRadiusS\n : borderRadiusL,\n borderColor: grey_whisper,\n },\n (onlyEmojis && !message.quoted_message) || otherAttachments?.length\n ? { borderWidth: 0 }\n : {},\n containerInner,\n ]}\n >\n {messagesContext?.messageContentOrder?.map(\n (messageContentType, messageContentOrderIndex) => {\n switch (messageContentType) {\n case 'quoted_reply':\n return (\n message.quoted_message &&\n Reply && (\n <View\n key={`quoted_reply_${messageContentOrderIndex}`}\n style={[styles.replyContainer, replyContainer]}\n >\n <Reply\n quotedMessage={\n message.quoted_message as ReplyProps<StreamChatGenerics>['quotedMessage']\n }\n styles={{\n messageContainer: {\n maxWidth: vw(60),\n },\n }}\n />\n </View>\n )\n );\n case 'attachments':\n return otherAttachments?.map(\n (attachment, attachmentIndex) =>\n Attachment && (\n <Attachment\n attachment={attachment}\n key={`${message.id}-${attachmentIndex}`}\n />\n ),\n );\n case 'files':\n return (\n FileAttachmentGroup && (\n <FileAttachmentGroup\n files={files}\n key={`file_attachment_group_${messageContentOrderIndex}`}\n messageId={message.id}\n />\n )\n );\n case 'gallery':\n return (\n Gallery && (\n <Gallery\n alignment={alignment}\n groupStyles={groupStyles}\n hasThreadReplies={!!message?.reply_count}\n images={images}\n key={`gallery_${messageContentOrderIndex}`}\n message={message}\n threadList={threadList}\n videos={videos}\n />\n )\n );\n case 'text':\n default:\n return otherAttachments?.length &&\n otherAttachments[0].actions ? null : (\n <MessageTextContainer<StreamChatGenerics>\n key={`message_text_container_${messageContentOrderIndex}`}\n message={message}\n messageOverlay\n messageTextNumberOfLines={messageTextNumberOfLines}\n onlyEmojis={onlyEmojis}\n />\n );\n }\n },\n )}\n </View>\n </Animated.View>\n {messageActions && (\n <MessageActionList\n MessageActionListItem={MessageActionListItem}\n showScreen={showScreen}\n {...messageActionProps}\n message={message}\n />\n )}\n {!!messageReactionTitle &&\n message.latest_reactions &&\n message.latest_reactions.length > 0 ? (\n <OverlayReactions\n alignment={alignment}\n OverlayReactionsAvatar={OverlayReactionsAvatar}\n reactions={\n message.latest_reactions.map((reaction) => ({\n alignment:\n clientId && clientId === reaction.user?.id ? 'right' : 'left',\n id: reaction?.user?.id || '',\n image: reaction?.user?.image,\n name: reaction?.user?.name || reaction.user_id || '',\n type: reaction.type,\n })) as Reaction[]\n }\n showScreen={showScreen}\n supportedReactions={messagesContext?.supportedReactions}\n title={messageReactionTitle}\n />\n ) : null}\n </View>\n )}\n </Animated.View>\n </TapGestureHandler>\n </SafeAreaView>\n </Animated.View>\n </PanGestureHandler>\n </Animated.View>\n </ThemeProvider>\n </MessageProvider>\n </MessagesProvider>\n );\n};\n\nconst areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(\n prevProps: MessageOverlayPropsWithContext<StreamChatGenerics>,\n nextProps: MessageOverlayPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n alignment: prevAlignment,\n message: prevMessage,\n messageReactionTitle: prevMessageReactionTitle,\n } = prevProps;\n const {\n alignment: nextAlignment,\n message: nextMessage,\n messageReactionTitle: nextMessageReactionTitle,\n } = nextProps;\n\n const alignmentEqual = prevAlignment === nextAlignment;\n if (!alignmentEqual) return false;\n\n const messageReactionTitleEqual = prevMessageReactionTitle === nextMessageReactionTitle;\n if (!messageReactionTitleEqual) return false;\n\n const latestReactionsEqual =\n Array.isArray(prevMessage?.latest_reactions) && Array.isArray(nextMessage?.latest_reactions)\n ? prevMessage?.latest_reactions.length === nextMessage?.latest_reactions.length &&\n prevMessage?.latest_reactions.every(\n ({ type }, index) => type === nextMessage?.latest_reactions?.[index].type,\n )\n : prevMessage?.latest_reactions === nextMessage?.latest_reactions;\n if (!latestReactionsEqual) return false;\n\n return true;\n};\n\nconst MemoizedMessageOverlay = React.memo(\n MessageOverlayWithContext,\n areEqual,\n) as typeof MessageOverlayWithContext;\n\nexport type MessageOverlayProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<Omit<MessageOverlayPropsWithContext<StreamChatGenerics>, 'overlayOpacity'>> &\n Pick<MessageOverlayPropsWithContext<StreamChatGenerics>, 'overlayOpacity'> &\n Pick<\n MessageOverlayPropsWithContext<StreamChatGenerics>,\n 'isMyMessage' | 'error' | 'isThreadMessage' | 'message' | 'messageReactions'\n >;\n\n/**\n * MessageOverlay - A high level component which implements all the logic required for a message overlay\n */\nexport const MessageOverlay = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: MessageOverlayProps<StreamChatGenerics>,\n) => {\n const {\n data,\n MessageActionList,\n MessageActionListItem,\n OverlayReactionList,\n OverlayReactions,\n OverlayReactionsAvatar,\n } = useMessageOverlayContext<StreamChatGenerics>();\n const { overlay, setOverlay } = useOverlayContext();\n\n const componentProps = {\n MessageActionList: props.MessageActionList || MessageActionList,\n MessageActionListItem: props.MessageActionListItem || MessageActionListItem,\n OverlayReactionList:\n props.OverlayReactionList || OverlayReactionList || data?.OverlayReactionList,\n OverlayReactions: props.OverlayReactions || OverlayReactions,\n OverlayReactionsAvatar: props.OverlayReactionsAvatar || OverlayReactionsAvatar,\n };\n\n return (\n <MemoizedMessageOverlay\n {...{\n overlay,\n setOverlay,\n }}\n {...componentProps}\n {...(data || {})}\n {...props}\n />\n );\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["MessageOverlay.tsx"],"names":["styles","StyleSheet","create","alignEnd","alignItems","alignStart","center","flexGrow","justifyContent","containerInner","borderTopLeftRadius","borderTopRightRadius","borderWidth","overflow","flex","overlayPadding","padding","replyContainer","flexDirection","paddingHorizontal","paddingTop","row","scrollView","Platform","OS","screenHeight","halfScreenHeight","DefaultMessageTextNumberOfLines","MessageOverlayWithContext","props","alignment","ownCapabilities","clientId","files","groupStyles","handleReaction","images","chatContext","message","messageActions","MessageActionList","DefaultMessageActionList","MessageActionListItem","messageContext","messageReactionTitle","messageTextNumberOfLines","messagesContext","onlyEmojis","otherAttachments","overlay","overlayOpacity","OverlayReactionList","OverlayReactionListDefault","OverlayReactions","DefaultOverlayReactions","OverlayReactionsAvatar","OverlayReactionsAvatarDefault","setOverlay","threadList","videos","isMyMessage","messageReactions","error","isThreadMessage","messageActionProps","theme","myMessageTheme","wrapMessageInTheme","user","id","JSON","stringify","myMessageThemeString","setMyMessageThemeString","modifiedTheme","style","colors","blue_alice","grey_gainsboro","grey_whisper","transparent","white_smoke","messageSimple","content","container","borderRadiusL","borderRadiusS","containerStyle","messageHeight","messageLayout","x","y","messageWidth","offsetY","translateY","scale","showScreen","fadeScreen","value","damping","mass","restDisplacementThreshold","restSpeedThreshold","stiffness","velocity","Keyboard","dismiss","onPan","onActive","evt","translationY","Extrapolate","CLAMP","onFinish","finalYPosition","velocityY","duration","easing","Easing","out","ease","onStart","panStyle","transform","showScreenStyle","translateX","groupStyle","toLowerCase","hasThreadReplies","reply_count","Attachment","FileAttachmentGroup","Gallery","MessageAvatar","Reply","absoluteFillObject","state","nativeEvent","State","END","sendReaction","own_reactions","map","reaction","type","layout","layoutHeight","height","layoutWidth","width","showAvatar","backgroundColor","quoted_message","length","borderBottomLeftRadius","borderBottomRightRadius","borderColor","messageContentOrder","messageContentType","messageContentOrderIndex","messageContainer","maxWidth","attachment","attachmentIndex","actions","latest_reactions","image","name","user_id","supportedReactions","areEqual","prevProps","nextProps","prevAlignment","prevMessage","prevMessageReactionTitle","nextAlignment","nextMessage","nextMessageReactionTitle","alignmentEqual","messageReactionTitleEqual","latestReactionsEqual","Array","isArray","every","index","MemoizedMessageOverlay","React","memo","MessageOverlay","data","componentProps"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAMA;;AAcA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAMA;;AACA;;AAKA;;AAGA;;AACA;;AACA;;;;;;;;;AAMA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,QAAQ,EAAE;AAAEC,IAAAA,UAAU,EAAE;AAAd,GADqB;AAE/BC,EAAAA,UAAU,EAAE;AAAED,IAAAA,UAAU,EAAE;AAAd,GAFmB;AAG/BE,EAAAA,MAAM,EAAE;AACNC,IAAAA,QAAQ,EAAE,CADJ;AAENC,IAAAA,cAAc,EAAE;AAFV,GAHuB;AAO/BC,EAAAA,cAAc,EAAE;AACdC,IAAAA,mBAAmB,EAAE,EADP;AAEdC,IAAAA,oBAAoB,EAAE,EAFR;AAGdC,IAAAA,WAAW,EAAE,CAHC;AAIdC,IAAAA,QAAQ,EAAE;AAJI,GAPe;AAa/BC,EAAAA,IAAI,EAAE;AACJA,IAAAA,IAAI,EAAE;AADF,GAbyB;AAgB/BC,EAAAA,cAAc,EAAE;AACdC,IAAAA,OAAO,EAAE;AADK,GAhBe;AAmB/BC,EAAAA,cAAc,EAAE;AACdC,IAAAA,aAAa,EAAE,KADD;AAEdC,IAAAA,iBAAiB,EAAE,CAFL;AAGdC,IAAAA,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/BD;;AAiCA,IAAMK,sBAAsB,GAAGC,kBAAMC,IAAN,CAC7BhK,yBAD6B,EAE7B8I,QAF6B,CAA/B;;AAiBO,IAAMmB,cAAc,GAAG,SAAjBA,cAAiB,CAG5BhK,KAH4B,EAIzB;AACH,8BAOI,sDAPJ;AAAA,MACEiK,IADF,yBACEA,IADF;AAAA,MAEEtJ,iBAFF,yBAEEA,iBAFF;AAAA,MAGEE,qBAHF,yBAGEA,qBAHF;AAAA,MAIES,mBAJF,yBAIEA,mBAJF;AAAA,MAKEE,gBALF,yBAKEA,gBALF;AAAA,MAMEE,sBANF,yBAMEA,sBANF;;AAQA,2BAAgC,wCAAhC;AAAA,MAAQN,OAAR,sBAAQA,OAAR;AAAA,MAAiBQ,UAAjB,sBAAiBA,UAAjB;;AAEA,MAAMsI,cAAc,GAAG;AACrBvJ,IAAAA,iBAAiB,EAAEX,KAAK,CAACW,iBAAN,IAA2BA,iBADzB;AAErBE,IAAAA,qBAAqB,EAAEb,KAAK,CAACa,qBAAN,IAA+BA,qBAFjC;AAGrBS,IAAAA,mBAAmB,EACjBtB,KAAK,CAACsB,mBAAN,IAA6BA,mBAA7B,KAAoD2I,IAApD,oBAAoDA,IAAI,CAAE3I,mBAA1D,CAJmB;AAKrBE,IAAAA,gBAAgB,EAAExB,KAAK,CAACwB,gBAAN,IAA0BA,gBALvB;AAMrBE,IAAAA,sBAAsB,EAAE1B,KAAK,CAAC0B,sBAAN,IAAgCA;AANnC,GAAvB;AASA,SACE,gCAAC,sBAAD;AAEIN,IAAAA,OAAO,EAAPA,OAFJ;AAGIQ,IAAAA,UAAU,EAAVA;AAHJ,KAKMsI,cALN,EAMOD,IAAI,IAAI,EANf,EAOMjK,KAPN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KADF;AAWD,CAnCM","sourcesContent":["import React, { useEffect, useMemo, useState } from 'react';\nimport { Keyboard, Platform, SafeAreaView, StyleSheet, View, ViewStyle } from 'react-native';\nimport {\n PanGestureHandler,\n PanGestureHandlerGestureEvent,\n State,\n TapGestureHandler,\n} from 'react-native-gesture-handler';\nimport Animated, {\n cancelAnimation,\n Easing,\n Extrapolate,\n interpolate,\n runOnJS,\n useAnimatedGestureHandler,\n useAnimatedStyle,\n useSharedValue,\n withDecay,\n withSpring,\n withTiming,\n} from 'react-native-reanimated';\n\nimport { MessageActionList as DefaultMessageActionList } from './MessageActionList';\nimport { OverlayReactionList as OverlayReactionListDefault } from './OverlayReactionList';\nimport { OverlayReactionsAvatar as OverlayReactionsAvatarDefault } from './OverlayReactionsAvatar';\n\nimport { ChatProvider } from '../../contexts/chatContext/ChatContext';\nimport { MessageProvider } from '../../contexts/messageContext/MessageContext';\nimport {\n MessageOverlayContextValue,\n MessageOverlayData,\n useMessageOverlayContext,\n} from '../../contexts/messageOverlayContext/MessageOverlayContext';\n\nimport { MessagesProvider } from '../../contexts/messagesContext/MessagesContext';\nimport {\n OverlayContextValue,\n OverlayProviderProps,\n useOverlayContext,\n} from '../../contexts/overlayContext/OverlayContext';\nimport { mergeThemes, ThemeProvider, useTheme } from '../../contexts/themeContext/ThemeContext';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { vh, vw } from '../../utils/utils';\nimport { MessageTextContainer } from '../Message/MessageSimple/MessageTextContainer';\nimport {\n OverlayReactions as DefaultOverlayReactions,\n Reaction,\n} from '../MessageOverlay/OverlayReactions';\nimport type { ReplyProps } from '../Reply/Reply';\n\nconst styles = StyleSheet.create({\n alignEnd: { alignItems: 'flex-end' },\n alignStart: { alignItems: 'flex-start' },\n center: {\n flexGrow: 1,\n justifyContent: 'center',\n },\n containerInner: {\n borderTopLeftRadius: 16,\n borderTopRightRadius: 16,\n borderWidth: 1,\n overflow: 'hidden',\n },\n flex: {\n flex: 1,\n },\n overlayPadding: {\n padding: 8,\n },\n replyContainer: {\n flexDirection: 'row',\n paddingHorizontal: 8,\n paddingTop: 8,\n },\n row: { flexDirection: 'row' },\n scrollView: { overflow: Platform.OS === 'ios' ? 'visible' : 'scroll' },\n});\n\nconst screenHeight = vh(100);\nconst halfScreenHeight = vh(50);\nconst DefaultMessageTextNumberOfLines = 5;\n\nexport type MessageOverlayPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<\n MessageOverlayContextValue<StreamChatGenerics>,\n | 'MessageActionList'\n | 'MessageActionListItem'\n | 'OverlayReactionList'\n | 'OverlayReactions'\n | 'OverlayReactionsAvatar'\n> &\n Omit<MessageOverlayData<StreamChatGenerics>, 'supportedReactions'> &\n Pick<OverlayContextValue, 'overlay' | 'setOverlay'> &\n Pick<\n OverlayProviderProps<StreamChatGenerics>,\n | 'error'\n | 'isMyMessage'\n | 'isThreadMessage'\n | 'message'\n | 'messageReactions'\n | 'messageTextNumberOfLines'\n > & {\n overlayOpacity: Animated.SharedValue<number>;\n showScreen?: Animated.SharedValue<number>;\n };\n\nconst MessageOverlayWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: MessageOverlayPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n alignment,\n ownCapabilities,\n clientId,\n files,\n groupStyles,\n handleReaction,\n images,\n chatContext,\n message,\n messageActions,\n MessageActionList = DefaultMessageActionList,\n MessageActionListItem,\n messageContext,\n messageReactionTitle,\n messageTextNumberOfLines = DefaultMessageTextNumberOfLines,\n messagesContext,\n onlyEmojis,\n otherAttachments,\n overlay,\n overlayOpacity,\n OverlayReactionList = OverlayReactionListDefault,\n OverlayReactions = DefaultOverlayReactions,\n OverlayReactionsAvatar = OverlayReactionsAvatarDefault,\n setOverlay,\n threadList,\n videos,\n isMyMessage,\n messageReactions,\n error,\n isThreadMessage,\n } = props;\n\n const messageActionProps = {\n error,\n isMyMessage,\n isThreadMessage,\n message,\n messageReactions,\n };\n\n const { theme } = useTheme();\n\n const myMessageTheme = messagesContext?.myMessageTheme;\n const wrapMessageInTheme = clientId === message?.user?.id && !!myMessageTheme;\n\n const [myMessageThemeString, setMyMessageThemeString] = useState(JSON.stringify(myMessageTheme));\n\n useEffect(() => {\n if (myMessageTheme) {\n setMyMessageThemeString(JSON.stringify(myMessageTheme));\n }\n }, [myMessageTheme]);\n\n const modifiedTheme = useMemo(\n () => mergeThemes({ style: myMessageTheme, theme }),\n [myMessageThemeString, theme],\n );\n\n const {\n colors: { blue_alice, grey_gainsboro, grey_whisper, transparent, white_smoke },\n messageSimple: {\n content: {\n container: { borderRadiusL, borderRadiusS },\n containerInner,\n replyContainer,\n },\n },\n overlay: { container: containerStyle, padding: overlayPadding },\n } = wrapMessageInTheme ? modifiedTheme : theme;\n\n const messageHeight = useSharedValue(0);\n const messageLayout = useSharedValue({ x: 0, y: 0 });\n const messageWidth = useSharedValue(0);\n\n const offsetY = useSharedValue(0);\n const translateY = useSharedValue(0);\n const scale = useSharedValue(1);\n\n const showScreen = useSharedValue(0);\n const fadeScreen = () => {\n 'worklet';\n\n offsetY.value = 0;\n translateY.value = 0;\n scale.value = 1;\n showScreen.value = withSpring(1, {\n damping: 600,\n mass: 0.5,\n restDisplacementThreshold: 0.01,\n restSpeedThreshold: 0.01,\n stiffness: 200,\n velocity: 32,\n });\n };\n\n useEffect(() => {\n Keyboard.dismiss();\n fadeScreen();\n }, []);\n\n const onPan = useAnimatedGestureHandler<PanGestureHandlerGestureEvent>({\n onActive: (evt) => {\n translateY.value = offsetY.value + evt.translationY;\n overlayOpacity.value = interpolate(\n translateY.value,\n [0, halfScreenHeight],\n [1, 0.75],\n Extrapolate.CLAMP,\n );\n scale.value = interpolate(\n translateY.value,\n [0, halfScreenHeight],\n [1, 0.85],\n Extrapolate.CLAMP,\n );\n },\n onFinish: (evt) => {\n const finalYPosition = evt.translationY + evt.velocityY * 0.1;\n\n if (finalYPosition > halfScreenHeight && translateY.value > 0) {\n cancelAnimation(translateY);\n overlayOpacity.value = withTiming(\n 0,\n {\n duration: 200,\n easing: Easing.out(Easing.ease),\n },\n () => {\n runOnJS(setOverlay)('none');\n },\n );\n translateY.value =\n evt.velocityY > 1000\n ? withDecay({\n velocity: evt.velocityY,\n })\n : withTiming(screenHeight, {\n duration: 200,\n easing: Easing.out(Easing.ease),\n });\n } else {\n translateY.value = withTiming(0);\n scale.value = withTiming(1);\n overlayOpacity.value = withTiming(1);\n }\n },\n onStart: () => {\n cancelAnimation(translateY);\n offsetY.value = translateY.value;\n },\n });\n\n const panStyle = useAnimatedStyle<ViewStyle>(() => ({\n transform: [\n {\n translateY: translateY.value,\n },\n {\n scale: scale.value,\n },\n ],\n }));\n\n const showScreenStyle = useAnimatedStyle<ViewStyle>(\n () => ({\n transform: [\n {\n translateY: interpolate(showScreen.value, [0, 1], [messageHeight.value / 2, 0]),\n },\n {\n translateX: interpolate(\n showScreen.value,\n [0, 1],\n [alignment === 'left' ? -messageWidth.value / 2 : messageWidth.value / 2, 0],\n ),\n },\n {\n scale: showScreen.value,\n },\n ],\n }),\n [alignment],\n );\n\n const groupStyle = `${alignment}_${(groupStyles?.[0] || 'bottom').toLowerCase()}`;\n\n const hasThreadReplies = !!message?.reply_count;\n\n const { Attachment, FileAttachmentGroup, Gallery, MessageAvatar, Reply } = messagesContext || {};\n\n return (\n <ChatProvider value={chatContext}>\n <MessagesProvider value={messagesContext}>\n <MessageProvider value={messageContext}>\n <ThemeProvider mergedStyle={wrapMessageInTheme ? modifiedTheme : theme}>\n <Animated.View\n pointerEvents={'auto'}\n style={[StyleSheet.absoluteFillObject, containerStyle]}\n >\n <PanGestureHandler\n enabled={overlay === 'message'}\n maxPointers={1}\n minDist={10}\n onGestureEvent={onPan}\n >\n <Animated.View style={[StyleSheet.absoluteFillObject]}>\n <SafeAreaView style={styles.flex}>\n <TapGestureHandler\n maxDist={32}\n onHandlerStateChange={({ nativeEvent: { state } }) => {\n if (state === State.END) {\n setOverlay('none');\n }\n }}\n >\n <Animated.View style={[styles.flex, panStyle]}>\n {message && (\n <View\n style={[\n styles.center,\n styles.overlayPadding,\n { padding: overlayPadding },\n alignment === 'left' ? styles.alignStart : styles.alignEnd,\n ]}\n >\n {handleReaction && ownCapabilities?.sendReaction ? (\n <OverlayReactionList\n messageLayout={messageLayout}\n ownReactionTypes={\n message?.own_reactions?.map((reaction) => reaction.type) || []\n }\n showScreen={showScreen}\n />\n ) : null}\n <Animated.View\n onLayout={({\n nativeEvent: {\n layout: { height: layoutHeight, width: layoutWidth, x, y },\n },\n }) => {\n messageLayout.value = {\n x: alignment === 'left' ? x + layoutWidth : x,\n y,\n };\n messageWidth.value = layoutWidth;\n messageHeight.value = layoutHeight;\n }}\n style={[styles.alignEnd, styles.row, showScreenStyle]}\n >\n {alignment === 'left' && MessageAvatar && (\n <MessageAvatar {...{ alignment, message, showAvatar: true }} />\n )}\n <View\n pointerEvents='none'\n style={[\n styles.containerInner,\n {\n backgroundColor:\n onlyEmojis && !message.quoted_message\n ? transparent\n : otherAttachments?.length\n ? otherAttachments[0].type === 'giphy'\n ? !message.quoted_message\n ? transparent\n : grey_gainsboro\n : blue_alice\n : alignment === 'left'\n ? white_smoke\n : grey_gainsboro,\n borderBottomLeftRadius:\n (groupStyle === 'left_bottom' ||\n groupStyle === 'left_single') &&\n (!hasThreadReplies || threadList)\n ? borderRadiusS\n : borderRadiusL,\n borderBottomRightRadius:\n (groupStyle === 'right_bottom' ||\n groupStyle === 'right_single') &&\n (!hasThreadReplies || threadList)\n ? borderRadiusS\n : borderRadiusL,\n borderColor: grey_whisper,\n },\n (onlyEmojis && !message.quoted_message) ||\n otherAttachments?.length\n ? { borderWidth: 0 }\n : {},\n containerInner,\n ]}\n >\n {messagesContext?.messageContentOrder?.map(\n (messageContentType, messageContentOrderIndex) => {\n switch (messageContentType) {\n case 'quoted_reply':\n return (\n message.quoted_message &&\n Reply && (\n <View\n key={`quoted_reply_${messageContentOrderIndex}`}\n style={[styles.replyContainer, replyContainer]}\n >\n <Reply\n quotedMessage={\n message.quoted_message as ReplyProps<StreamChatGenerics>['quotedMessage']\n }\n styles={{\n messageContainer: {\n maxWidth: vw(60),\n },\n }}\n />\n </View>\n )\n );\n case 'attachments':\n return otherAttachments?.map(\n (attachment, attachmentIndex) =>\n Attachment && (\n <Attachment\n attachment={attachment}\n key={`${message.id}-${attachmentIndex}`}\n />\n ),\n );\n case 'files':\n return (\n FileAttachmentGroup && (\n <FileAttachmentGroup\n files={files}\n key={`file_attachment_group_${messageContentOrderIndex}`}\n messageId={message.id}\n />\n )\n );\n case 'gallery':\n return (\n Gallery && (\n <Gallery\n alignment={alignment}\n groupStyles={groupStyles}\n hasThreadReplies={!!message?.reply_count}\n images={images}\n key={`gallery_${messageContentOrderIndex}`}\n message={message}\n threadList={threadList}\n videos={videos}\n />\n )\n );\n case 'text':\n default:\n return otherAttachments?.length &&\n otherAttachments[0].actions ? null : (\n <MessageTextContainer<StreamChatGenerics>\n key={`message_text_container_${messageContentOrderIndex}`}\n message={message}\n messageOverlay\n messageTextNumberOfLines={messageTextNumberOfLines}\n onlyEmojis={onlyEmojis}\n />\n );\n }\n },\n )}\n </View>\n </Animated.View>\n {messageActions && (\n <MessageActionList\n MessageActionListItem={MessageActionListItem}\n showScreen={showScreen}\n {...messageActionProps}\n message={message}\n />\n )}\n {!!messageReactionTitle &&\n message.latest_reactions &&\n message.latest_reactions.length > 0 ? (\n <OverlayReactions\n alignment={alignment}\n OverlayReactionsAvatar={OverlayReactionsAvatar}\n reactions={\n message.latest_reactions.map((reaction) => ({\n alignment:\n clientId && clientId === reaction.user?.id ? 'right' : 'left',\n id: reaction?.user?.id || '',\n image: reaction?.user?.image,\n name: reaction?.user?.name || reaction.user_id || '',\n type: reaction.type,\n })) as Reaction[]\n }\n showScreen={showScreen}\n supportedReactions={messagesContext?.supportedReactions}\n title={messageReactionTitle}\n />\n ) : null}\n </View>\n )}\n </Animated.View>\n </TapGestureHandler>\n </SafeAreaView>\n </Animated.View>\n </PanGestureHandler>\n </Animated.View>\n </ThemeProvider>\n </MessageProvider>\n </MessagesProvider>\n </ChatProvider>\n );\n};\n\nconst areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(\n prevProps: MessageOverlayPropsWithContext<StreamChatGenerics>,\n nextProps: MessageOverlayPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n alignment: prevAlignment,\n message: prevMessage,\n messageReactionTitle: prevMessageReactionTitle,\n } = prevProps;\n const {\n alignment: nextAlignment,\n message: nextMessage,\n messageReactionTitle: nextMessageReactionTitle,\n } = nextProps;\n\n const alignmentEqual = prevAlignment === nextAlignment;\n if (!alignmentEqual) return false;\n\n const messageReactionTitleEqual = prevMessageReactionTitle === nextMessageReactionTitle;\n if (!messageReactionTitleEqual) return false;\n\n const latestReactionsEqual =\n Array.isArray(prevMessage?.latest_reactions) && Array.isArray(nextMessage?.latest_reactions)\n ? prevMessage?.latest_reactions.length === nextMessage?.latest_reactions.length &&\n prevMessage?.latest_reactions.every(\n ({ type }, index) => type === nextMessage?.latest_reactions?.[index].type,\n )\n : prevMessage?.latest_reactions === nextMessage?.latest_reactions;\n if (!latestReactionsEqual) return false;\n\n return true;\n};\n\nconst MemoizedMessageOverlay = React.memo(\n MessageOverlayWithContext,\n areEqual,\n) as typeof MessageOverlayWithContext;\n\nexport type MessageOverlayProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<Omit<MessageOverlayPropsWithContext<StreamChatGenerics>, 'overlayOpacity'>> &\n Pick<MessageOverlayPropsWithContext<StreamChatGenerics>, 'overlayOpacity'> &\n Pick<\n MessageOverlayPropsWithContext<StreamChatGenerics>,\n 'isMyMessage' | 'error' | 'isThreadMessage' | 'message' | 'messageReactions'\n >;\n\n/**\n * MessageOverlay - A high level component which implements all the logic required for a message overlay\n */\nexport const MessageOverlay = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: MessageOverlayProps<StreamChatGenerics>,\n) => {\n const {\n data,\n MessageActionList,\n MessageActionListItem,\n OverlayReactionList,\n OverlayReactions,\n OverlayReactionsAvatar,\n } = useMessageOverlayContext<StreamChatGenerics>();\n const { overlay, setOverlay } = useOverlayContext();\n\n const componentProps = {\n MessageActionList: props.MessageActionList || MessageActionList,\n MessageActionListItem: props.MessageActionListItem || MessageActionListItem,\n OverlayReactionList:\n props.OverlayReactionList || OverlayReactionList || data?.OverlayReactionList,\n OverlayReactions: props.OverlayReactions || OverlayReactions,\n OverlayReactionsAvatar: props.OverlayReactionsAvatar || OverlayReactionsAvatar,\n };\n\n return (\n <MemoizedMessageOverlay\n {...{\n overlay,\n setOverlay,\n }}\n {...componentProps}\n {...(data || {})}\n {...props}\n />\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ChannelsContext.tsx"],"names":["ChannelsContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","ChannelsProvider","children","value","useChannelsContext","contextValue","Error","withChannelsContext","Component","WithChannelsContextComponent","props","channelsContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAqBA;;AAEA;;AACA;;;;;;;;;AA4LO,IAAMA,eAAe,GAAGC,kBAAMC,aAAN,CAC7BC,mDAD6B,CAAxB;;;;AAIA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB;AAAA,MAG9BC,QAH8B,QAG9BA,QAH8B;AAAA,MAI9BC,KAJ8B,QAI9BA,KAJ8B;AAAA,SAQ9B,gCAAC,eAAD,CAAiB,QAAjB;AAA0B,IAAA,KAAK,EAAEA,KAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAR8B;AAAA,CAAzB;;;;AAaA,IAAME,kBAAkB,GAAG,SAArBA,kBAAqB,GAE3B;AACL,MAAMC,YAAY,GAAG,uBACnBR,eADmB,CAArB;;AAIA,MAAIQ,YAAY,KAAKL,mDAAjB,IAA+C,CAAC,2CAApD,EAAyE;AACvE,UAAM,IAAIM,KAAJ,yOAAN;AAGD;;AAED,SAAOD,YAAP;AACD,CAdM;;;;AAoBA,IAAME,mBAAmB,GAAG,SAAtBA,mBAAsB,CAIjCC,SAJiC,EAKqC;AACtE,MAAMC,4BAA4B,GAAG,SAA/BA,4BAA+B,CACnCC,KADmC,EAEhC;AACH,QAAMC,eAAe,GAAGP,kBAAkB,EAA1C;AAEA,WAAO,gCAAC,SAAD,gCAAgBM,KAAhB,EAAiCC,eAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAND;;AAOAF,EAAAA,4BAA4B,CAACG,WAA7B,2BAAiE,oCAAeJ,SAAf,CAAjE;AACA,SAAOC,4BAAP;AACD,CAfM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport type { FlatListProps } from 'react-native';\nimport type { FlatList } from 'react-native-gesture-handler';\n\nimport type { ChannelPreviewMutedStatusProps } from 'src/components/ChannelPreview/ChannelPreviewMutedStatus';\n\nimport type { Channel } from 'stream-chat';\n\nimport type { HeaderErrorProps } from '../../components/ChannelList/ChannelListHeaderErrorIndicator';\nimport type { QueryChannels } from '../../components/ChannelList/hooks/usePaginatedChannels';\nimport type { ChannelAvatarProps } from '../../components/ChannelPreview/ChannelAvatar';\nimport type { ChannelPreviewMessageProps } from '../../components/ChannelPreview/ChannelPreviewMessage';\nimport type { ChannelPreviewMessengerProps } from '../../components/ChannelPreview/ChannelPreviewMessenger';\nimport type { ChannelPreviewStatusProps } from '../../components/ChannelPreview/ChannelPreviewStatus';\nimport type { ChannelPreviewTitleProps } from '../../components/ChannelPreview/ChannelPreviewTitle';\nimport type { ChannelPreviewUnreadCountProps } from '../../components/ChannelPreview/ChannelPreviewUnreadCount';\nimport type { EmptyStateProps } from '../../components/Indicators/EmptyStateIndicator';\nimport type { LoadingErrorProps } from '../../components/Indicators/LoadingErrorIndicator';\nimport type { LoadingProps } from '../../components/Indicators/LoadingIndicator';\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';\n\nimport { getDisplayName } from '../utils/getDisplayName';\nimport { isTestEnvironment } from '../utils/isTestEnvironment';\n\nexport type ChannelsContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * Besides the existing default behavior of the ChannelListMessenger component, you can attach\n * additional props to the underlying React Native FlatList.\n *\n * You can find list of all the available FlatList props here - https://facebook.github.io/react-native/docs/flatlist#props\n *\n * **EXAMPLE:**\n *\n * ```\n * <ChannelListMessenger\n * channels={channels}\n * additionalFlatListProps={{ bounces: true }}\n * />\n * ```\n *\n * **Note:** Don't use `additionalFlatListProps` to access the FlatList ref, use `setFlatListRef`\n */\n additionalFlatListProps: Partial<FlatListProps<Channel<StreamChatGenerics>>>;\n /**\n * Channels can be either an array of channels or a promise which resolves to an array of channels\n */\n channels: Channel<StreamChatGenerics>[];\n /**\n * Custom indicator to use when channel list is empty\n *\n * Default: [EmptyStateIndicator](https://getstream.io/chat/docs/sdk/reactnative/core-components/channel/#emptystateindicator)\n * */\n EmptyStateIndicator: React.ComponentType<EmptyStateProps>;\n /**\n * Custom loading indicator to display at bottom of the list, while loading further pages\n *\n * Default: [ChannelListFooterLoadingIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#footerloadingindicator)\n */\n FooterLoadingIndicator: React.ComponentType;\n /**\n * Incremental number change to force update the FlatList\n */\n forceUpdate: number;\n /**\n * Whether or not the FlatList has another page to render\n */\n hasNextPage: boolean;\n /**\n * Custom indicator to display error at top of list, if loading/pagination error occurs\n *\n * Default: [ChannelListHeaderErrorIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#headererrorindicator)\n */\n HeaderErrorIndicator: React.ComponentType<HeaderErrorProps>;\n /**\n * Custom indicator to display network-down error at top of list, if there is connectivity issue\n *\n * Default: [ChannelListHeaderNetworkDownIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#headernetworkdownindicator)\n */\n HeaderNetworkDownIndicator: React.ComponentType;\n /**\n * Initial channels query loading state, triggers the LoadingIndicator\n */\n loadingChannels: boolean;\n /**\n * Custom indicator to use when there is error in fetching channels\n *\n * Default: [LoadingErrorIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#loadingerrorindicator)\n * */\n LoadingErrorIndicator: React.ComponentType<LoadingErrorProps>;\n /**\n * Custom loading indicator to use on Channel List\n *\n * */\n LoadingIndicator: React.ComponentType<Pick<LoadingProps, 'listType'>>;\n /**\n * Whether or not additional channels are being loaded, triggers the FooterLoadingIndicator\n */\n loadingNextPage: boolean;\n /**\n * The React Native FlatList threshold to fetch more data\n * @see See loadMoreThreshold [doc](https://facebook.github.io/react-native/docs/flatlist#onendreachedthreshold)\n * */\n loadMoreThreshold: number;\n /**\n * Loads the next page of `channels`, which is present as a required prop\n */\n loadNextPage: QueryChannels | undefined;\n /**\n * Max number to display within notification badge. Default: 255 and it cannot be higher than that for now due to backend limitations\n */\n maxUnreadCount: number;\n /**\n * Number of skeletons that should show when loading. Default: 6\n */\n numberOfSkeletons: number;\n /**\n * Custom UI component to display individual channel list items\n *\n * Default: [ChannelPreviewMessenger](https://getstream.io/chat/docs/sdk/reactnative/ui-components/channel-preview-messenger/)\n */\n Preview: React.ComponentType<ChannelPreviewMessengerProps<StreamChatGenerics>>;\n /**\n * Triggered when the channel list is refreshing, displays a loading spinner at the top of the list\n */\n refreshing: boolean;\n /**\n * Function to refresh the channel list that is similar to `reloadList`, but it doesn't wipe out existing channels\n * from UI before loading the new ones\n */\n refreshList: () => void | Promise<void>;\n /**\n * Removes all the existing channels from UI and loads fresh channels\n * */\n reloadList: () => Promise<void>;\n // /**\n // * Function to set the currently active channel, acts as a bridge between ChannelList and Channel components\n // *\n // * @param channel A channel object\n // */\n // setActiveChannel?: (channel: Channel<StreamChatGenerics>) => void;\n /**\n * Function to gain access to the inner FlatList ref\n *\n * **Example:**\n *\n * ```\n * <ChannelListMessenger\n * setFlatListRef={(ref) => {\n * // Use ref for your own good\n * }}\n * ```\n */\n setFlatListRef: (ref: FlatList<Channel<StreamChatGenerics>> | null) => void;\n /**\n * Custom UI component to display loading channel skeletons\n *\n * Default: [Skeleton](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#skeleton)\n */\n Skeleton: React.ComponentType;\n /**\n * Error in channels query, if any\n */\n error?: Error;\n ListHeaderComponent?: React.ComponentType;\n /**\n * Function to set the currently active channel, acts as a bridge between ChannelList and Channel components\n *\n * @param channel A channel object\n */\n onSelect?: (channel: Channel<StreamChatGenerics>) => void;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelAvatar](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelAvatar.tsx)\n */\n PreviewAvatar?: React.ComponentType<ChannelAvatarProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview of latest message on channel.\n *\n * **Default** [ChannelPreviewMessage](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewMessage.tsx)\n */\n PreviewMessage?: React.ComponentType<ChannelPreviewMessageProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render muted status.\n *\n * **Default** [ChannelMutedStatus](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewMutedStatus.tsx)\n */\n PreviewMutedStatus?: React.ComponentType<ChannelPreviewMutedStatusProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewStatus](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewStatus.tsx)\n */\n PreviewStatus?: React.ComponentType<ChannelPreviewStatusProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewTitle](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewTitle.tsx)\n */\n PreviewTitle?: React.ComponentType<ChannelPreviewTitleProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewUnreadCount](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewUnreadCount.tsx)\n */\n PreviewUnreadCount?: React.ComponentType<ChannelPreviewUnreadCountProps<StreamChatGenerics>>;\n};\n\nexport const ChannelsContext = React.createContext(\n DEFAULT_BASE_CONTEXT_VALUE as ChannelsContextValue,\n);\n\nexport const ChannelsProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value: ChannelsContextValue<StreamChatGenerics>;\n}>) => (\n <ChannelsContext.Provider value={value as unknown as ChannelsContextValue}>\n {children}\n </ChannelsContext.Provider>\n);\n\nexport const useChannelsContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => {\n const contextValue = useContext(\n ChannelsContext,\n ) as unknown as ChannelsContextValue<StreamChatGenerics>;\n\n if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {\n throw new Error(\n `The useChannelsContext hook was called outside of the ChannelsContext provider. Make sure you have configured ChannelList component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#channel-list`,\n );\n }\n\n return contextValue;\n};\n/**\n * Typescript currently does not support partial inference so if ChatContext\n * typing is desired while using the HOC withChannelContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withChannelsContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof ChannelsContextValue<StreamChatGenerics>>> => {\n const WithChannelsContextComponent = (\n props: Omit<P, keyof ChannelsContextValue<StreamChatGenerics>>,\n ) => {\n const channelsContext = useChannelsContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...channelsContext} />;\n };\n WithChannelsContextComponent.displayName = `WithChannelsContext${getDisplayName(Component)}`;\n return WithChannelsContextComponent;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["ChannelsContext.tsx"],"names":["ChannelsContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","ChannelsProvider","children","value","useChannelsContext","contextValue","Error","withChannelsContext","Component","WithChannelsContextComponent","props","channelsContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAqBA;;AAEA;;AACA;;;;;;;;;AA4LO,IAAMA,eAAe,GAAGC,kBAAMC,aAAN,CAC7BC,mDAD6B,CAAxB;;;;AAIA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB;AAAA,MAG9BC,QAH8B,QAG9BA,QAH8B;AAAA,MAI9BC,KAJ8B,QAI9BA,KAJ8B;AAAA,SAQ9B,gCAAC,eAAD,CAAiB,QAAjB;AAA0B,IAAA,KAAK,EAAEA,KAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAR8B;AAAA,CAAzB;;;;AAaA,IAAME,kBAAkB,GAAG,SAArBA,kBAAqB,GAE3B;AACL,MAAMC,YAAY,GAAG,uBACnBR,eADmB,CAArB;;AAIA,MAAIQ,YAAY,KAAKL,mDAAjB,IAA+C,CAAC,2CAApD,EAAyE;AACvE,UAAM,IAAIM,KAAJ,yOAAN;AAGD;;AAED,SAAOD,YAAP;AACD,CAdM;;;;AAoBA,IAAME,mBAAmB,GAAG,SAAtBA,mBAAsB,CAIjCC,SAJiC,EAKqC;AACtE,MAAMC,4BAA4B,GAAG,SAA/BA,4BAA+B,CACnCC,KADmC,EAEhC;AACH,QAAMC,eAAe,GAAGP,kBAAkB,EAA1C;AAEA,WAAO,gCAAC,SAAD,gCAAgBM,KAAhB,EAAiCC,eAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAND;;AAOAF,EAAAA,4BAA4B,CAACG,WAA7B,2BAAiE,oCAAeJ,SAAf,CAAjE;AACA,SAAOC,4BAAP;AACD,CAfM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport type { FlatListProps } from 'react-native';\nimport type { FlatList } from 'react-native-gesture-handler';\n\nimport type { ChannelPreviewMutedStatusProps } from 'src/components/ChannelPreview/ChannelPreviewMutedStatus';\n\nimport type { Channel } from 'stream-chat';\n\nimport type { HeaderErrorProps } from '../../components/ChannelList/ChannelListHeaderErrorIndicator';\nimport type { QueryChannels } from '../../components/ChannelList/hooks/usePaginatedChannels';\nimport type { ChannelAvatarProps } from '../../components/ChannelPreview/ChannelAvatar';\nimport type { ChannelPreviewMessageProps } from '../../components/ChannelPreview/ChannelPreviewMessage';\nimport type { ChannelPreviewMessengerProps } from '../../components/ChannelPreview/ChannelPreviewMessenger';\nimport type { ChannelPreviewStatusProps } from '../../components/ChannelPreview/ChannelPreviewStatus';\nimport type { ChannelPreviewTitleProps } from '../../components/ChannelPreview/ChannelPreviewTitle';\nimport type { ChannelPreviewUnreadCountProps } from '../../components/ChannelPreview/ChannelPreviewUnreadCount';\nimport type { EmptyStateProps } from '../../components/Indicators/EmptyStateIndicator';\nimport type { LoadingErrorProps } from '../../components/Indicators/LoadingErrorIndicator';\nimport type { LoadingProps } from '../../components/Indicators/LoadingIndicator';\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';\n\nimport { getDisplayName } from '../utils/getDisplayName';\nimport { isTestEnvironment } from '../utils/isTestEnvironment';\n\nexport type ChannelsContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * Besides the existing default behavior of the ChannelListMessenger component, you can attach\n * additional props to the underlying React Native FlatList.\n *\n * You can find list of all the available FlatList props here - https://facebook.github.io/react-native/docs/flatlist#props\n *\n * **EXAMPLE:**\n *\n * ```\n * <ChannelListMessenger\n * channels={channels}\n * additionalFlatListProps={{ bounces: true }}\n * />\n * ```\n *\n * **Note:** Don't use `additionalFlatListProps` to access the FlatList ref, use `setFlatListRef`\n */\n additionalFlatListProps: Partial<FlatListProps<Channel<StreamChatGenerics>>>;\n /**\n * Channels can be either an array of channels or a promise which resolves to an array of channels\n */\n channels: Channel<StreamChatGenerics>[] | null;\n /**\n * Custom indicator to use when channel list is empty\n *\n * Default: [EmptyStateIndicator](https://getstream.io/chat/docs/sdk/reactnative/core-components/channel/#emptystateindicator)\n * */\n EmptyStateIndicator: React.ComponentType<EmptyStateProps>;\n /**\n * Custom loading indicator to display at bottom of the list, while loading further pages\n *\n * Default: [ChannelListFooterLoadingIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#footerloadingindicator)\n */\n FooterLoadingIndicator: React.ComponentType;\n /**\n * Incremental number change to force update the FlatList\n */\n forceUpdate: number;\n /**\n * Whether or not the FlatList has another page to render\n */\n hasNextPage: boolean;\n /**\n * Custom indicator to display error at top of list, if loading/pagination error occurs\n *\n * Default: [ChannelListHeaderErrorIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#headererrorindicator)\n */\n HeaderErrorIndicator: React.ComponentType<HeaderErrorProps>;\n /**\n * Custom indicator to display network-down error at top of list, if there is connectivity issue\n *\n * Default: [ChannelListHeaderNetworkDownIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#headernetworkdownindicator)\n */\n HeaderNetworkDownIndicator: React.ComponentType;\n /**\n * Initial channels query loading state, triggers the LoadingIndicator\n */\n loadingChannels: boolean;\n /**\n * Custom indicator to use when there is error in fetching channels\n *\n * Default: [LoadingErrorIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#loadingerrorindicator)\n * */\n LoadingErrorIndicator: React.ComponentType<LoadingErrorProps>;\n /**\n * Custom loading indicator to use on Channel List\n *\n * */\n LoadingIndicator: React.ComponentType<Pick<LoadingProps, 'listType'>>;\n /**\n * Whether or not additional channels are being loaded, triggers the FooterLoadingIndicator\n */\n loadingNextPage: boolean;\n /**\n * The React Native FlatList threshold to fetch more data\n * @see See loadMoreThreshold [doc](https://facebook.github.io/react-native/docs/flatlist#onendreachedthreshold)\n * */\n loadMoreThreshold: number;\n /**\n * Loads the next page of `channels`, which is present as a required prop\n */\n loadNextPage: QueryChannels | undefined;\n /**\n * Max number to display within notification badge. Default: 255 and it cannot be higher than that for now due to backend limitations\n */\n maxUnreadCount: number;\n /**\n * Number of skeletons that should show when loading. Default: 6\n */\n numberOfSkeletons: number;\n /**\n * Custom UI component to display individual channel list items\n *\n * Default: [ChannelPreviewMessenger](https://getstream.io/chat/docs/sdk/reactnative/ui-components/channel-preview-messenger/)\n */\n Preview: React.ComponentType<ChannelPreviewMessengerProps<StreamChatGenerics>>;\n /**\n * Triggered when the channel list is refreshing, displays a loading spinner at the top of the list\n */\n refreshing: boolean;\n /**\n * Function to refresh the channel list that is similar to `reloadList`, but it doesn't wipe out existing channels\n * from UI before loading the new ones\n */\n refreshList: () => void | Promise<void>;\n /**\n * Removes all the existing channels from UI and loads fresh channels\n * */\n reloadList: () => Promise<void>;\n // /**\n // * Function to set the currently active channel, acts as a bridge between ChannelList and Channel components\n // *\n // * @param channel A channel object\n // */\n // setActiveChannel?: (channel: Channel<StreamChatGenerics>) => void;\n /**\n * Function to gain access to the inner FlatList ref\n *\n * **Example:**\n *\n * ```\n * <ChannelListMessenger\n * setFlatListRef={(ref) => {\n * // Use ref for your own good\n * }}\n * ```\n */\n setFlatListRef: (ref: FlatList<Channel<StreamChatGenerics>> | null) => void;\n /**\n * Custom UI component to display loading channel skeletons\n *\n * Default: [Skeleton](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#skeleton)\n */\n Skeleton: React.ComponentType;\n /**\n * Error in channels query, if any\n */\n error?: Error;\n ListHeaderComponent?: React.ComponentType;\n /**\n * Function to set the currently active channel, acts as a bridge between ChannelList and Channel components\n *\n * @param channel A channel object\n */\n onSelect?: (channel: Channel<StreamChatGenerics>) => void;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelAvatar](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelAvatar.tsx)\n */\n PreviewAvatar?: React.ComponentType<ChannelAvatarProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview of latest message on channel.\n *\n * **Default** [ChannelPreviewMessage](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewMessage.tsx)\n */\n PreviewMessage?: React.ComponentType<ChannelPreviewMessageProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render muted status.\n *\n * **Default** [ChannelMutedStatus](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewMutedStatus.tsx)\n */\n PreviewMutedStatus?: React.ComponentType<ChannelPreviewMutedStatusProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewStatus](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewStatus.tsx)\n */\n PreviewStatus?: React.ComponentType<ChannelPreviewStatusProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewTitle](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewTitle.tsx)\n */\n PreviewTitle?: React.ComponentType<ChannelPreviewTitleProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewUnreadCount](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewUnreadCount.tsx)\n */\n PreviewUnreadCount?: React.ComponentType<ChannelPreviewUnreadCountProps<StreamChatGenerics>>;\n};\n\nexport const ChannelsContext = React.createContext(\n DEFAULT_BASE_CONTEXT_VALUE as ChannelsContextValue,\n);\n\nexport const ChannelsProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value: ChannelsContextValue<StreamChatGenerics>;\n}>) => (\n <ChannelsContext.Provider value={value as unknown as ChannelsContextValue}>\n {children}\n </ChannelsContext.Provider>\n);\n\nexport const useChannelsContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => {\n const contextValue = useContext(\n ChannelsContext,\n ) as unknown as ChannelsContextValue<StreamChatGenerics>;\n\n if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {\n throw new Error(\n `The useChannelsContext hook was called outside of the ChannelsContext provider. Make sure you have configured ChannelList component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#channel-list`,\n );\n }\n\n return contextValue;\n};\n/**\n * Typescript currently does not support partial inference so if ChatContext\n * typing is desired while using the HOC withChannelContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withChannelsContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof ChannelsContextValue<StreamChatGenerics>>> => {\n const WithChannelsContextComponent = (\n props: Omit<P, keyof ChannelsContextValue<StreamChatGenerics>>,\n ) => {\n const channelsContext = useChannelsContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...channelsContext} />;\n };\n WithChannelsContextComponent.displayName = `WithChannelsContext${getDisplayName(Component)}`;\n return WithChannelsContextComponent;\n};\n"]}
|
|
@@ -36,7 +36,7 @@ var ChatProvider = function ChatProvider(_ref) {
|
|
|
36
36
|
__self: _this,
|
|
37
37
|
__source: {
|
|
38
38
|
fileName: _jsxFileName,
|
|
39
|
-
lineNumber:
|
|
39
|
+
lineNumber: 78,
|
|
40
40
|
columnNumber: 3
|
|
41
41
|
}
|
|
42
42
|
}, children);
|
|
@@ -63,7 +63,7 @@ var withChatContext = function withChatContext(Component) {
|
|
|
63
63
|
__self: _this,
|
|
64
64
|
__source: {
|
|
65
65
|
fileName: _jsxFileName,
|
|
66
|
-
lineNumber:
|
|
66
|
+
lineNumber: 111,
|
|
67
67
|
columnNumber: 12
|
|
68
68
|
}
|
|
69
69
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ChatContext.tsx"],"names":["ChatContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","ChatProvider","children","value","useChatContext","contextValue","Error","withChatContext","Component","WithChatContextComponent","props","chatContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;
|
|
1
|
+
{"version":3,"sources":["ChatContext.tsx"],"names":["ChatContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","ChatProvider","children","value","useChatContext","contextValue","Error","withChatContext","Component","WithChatContextComponent","props","chatContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAMA;;AAEA;;AACA;;;;;;;;;AA0DO,IAAMA,WAAW,GAAGC,kBAAMC,aAAN,CAAoBC,mDAApB,CAApB;;;;AAEA,IAAMC,YAAY,GAAG,SAAfA,YAAe;AAAA,MAG1BC,QAH0B,QAG1BA,QAH0B;AAAA,MAI1BC,KAJ0B,QAI1BA,KAJ0B;AAAA,SAQ1B,gCAAC,WAAD,CAAa,QAAb;AAAsB,IAAA,KAAK,EAAEA,KAA7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAR0B;AAAA,CAArB;;;;AAaA,IAAME,cAAc,GAAG,SAAjBA,cAAiB,GAEvB;AACL,MAAMC,YAAY,GAAG,uBAAWR,WAAX,CAArB;;AAEA,MAAIQ,YAAY,KAAKL,mDAAjB,IAA+C,CAAC,2CAApD,EAAyE;AACvE,UAAM,IAAIM,KAAJ,+MAAN;AAGD;;AAED,SAAOD,YAAP;AACD,CAZM;;;;AAmBA,IAAME,eAAe,GAAG,SAAlBA,eAAkB,CAI7BC,SAJ6B,EAKqC;AAClE,MAAMC,wBAAwB,GAAG,SAA3BA,wBAA2B,CAACC,KAAD,EAAgE;AAC/F,QAAMC,WAAW,GAAGP,cAAc,EAAlC;AAEA,WAAO,gCAAC,SAAD,gCAAgBM,KAAhB,EAAiCC,WAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAJD;;AAKAF,EAAAA,wBAAwB,CAACG,WAAzB,uBAAyD,oCAAeJ,SAAf,CAAzD;AACA,SAAOC,wBAAP;AACD,CAbM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\nimport type { ImageProps } from 'react-native';\n\nimport type { AppSettingsAPIResponse, Channel, EventHandler, Mute, StreamChat } from 'stream-chat';\n\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';\n\nimport { getDisplayName } from '../utils/getDisplayName';\nimport { isTestEnvironment } from '../utils/isTestEnvironment';\n\nexport type ChatContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * Object of application settings returned from Stream.\n * */\n appSettings: AppSettingsAPIResponse<StreamChatGenerics> | null;\n /**\n * The StreamChat client object\n *\n * ```\n * import { StreamChat } from 'stream-chat';\n * import { Chat } from 'stream-chat-react-native';\n *\n * const client = StreamChat.getInstance('api_key);\n * await client.connectUser('user_id', 'userToken');\n *\n * <Chat client={client}>\n * </Chat>\n * ```\n *\n * @overrideType StreamChat\n * */\n client: StreamChat<StreamChatGenerics>;\n connectionRecovering: boolean;\n enableOfflineSupport: boolean;\n ImageComponent: React.ComponentType<ImageProps>;\n isOnline: boolean;\n mutedUsers: Mute<StreamChatGenerics>[];\n /**\n * @param newChannel Channel to set as active.\n *\n * @overrideType Function\n */\n setActiveChannel: (newChannel?: Channel<StreamChatGenerics>) => void;\n subscribeConnectionRecoveredCallback: (callback: EventHandler<StreamChatGenerics>) => () => void;\n /**\n * Instance of channel object from stream-chat package.\n *\n * Please check the docs around how to create or query channel - https://getstream.io/chat/docs/javascript/creating_channels/?language=javascript\n *\n * ```\n * import { StreamChat, Channel } from 'stream-chat';\n * import { Chat, Channel} from 'stream-chat-react-native';\n *\n * const client = StreamChat.getInstance('api_key');\n * await client.connectUser('user_id', 'user_token');\n * const channel = client.channel('messaging', 'channel_id');\n * await channel.watch();\n * ```\n *\n * @overrideType Channel\n */\n channel?: Channel<StreamChatGenerics>;\n};\n\nexport const ChatContext = React.createContext(DEFAULT_BASE_CONTEXT_VALUE as ChatContextValue);\n\nexport const ChatProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value?: ChatContextValue<StreamChatGenerics>;\n}>) => (\n <ChatContext.Provider value={value as unknown as ChatContextValue}>\n {children}\n </ChatContext.Provider>\n);\n\nexport const useChatContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => {\n const contextValue = useContext(ChatContext) as unknown as ChatContextValue<StreamChatGenerics>;\n\n if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {\n throw new Error(\n `The useChatContext hook was called outside the ChatContext Provider. Make sure you have configured Chat component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#chat`,\n );\n }\n\n return contextValue;\n};\n\n/**\n * Typescript currently does not support partial inference so if ChatContext\n * typing is desired while using the HOC withChatContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withChatContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof ChatContextValue<StreamChatGenerics>>> => {\n const WithChatContextComponent = (props: Omit<P, keyof ChatContextValue<StreamChatGenerics>>) => {\n const chatContext = useChatContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...chatContext} />;\n };\n WithChatContextComponent.displayName = `WithChatContext${getDisplayName(Component)}`;\n return WithChatContextComponent;\n};\n"]}
|
|
@@ -39,7 +39,7 @@ var MessageOverlayProvider = function MessageOverlayProvider(_ref) {
|
|
|
39
39
|
__self: _this,
|
|
40
40
|
__source: {
|
|
41
41
|
fileName: _jsxFileName,
|
|
42
|
-
lineNumber:
|
|
42
|
+
lineNumber: 97,
|
|
43
43
|
columnNumber: 5
|
|
44
44
|
}
|
|
45
45
|
}, children);
|
|
@@ -66,7 +66,7 @@ var withMessageOverlayContext = function withMessageOverlayContext(Component) {
|
|
|
66
66
|
__self: _this,
|
|
67
67
|
__source: {
|
|
68
68
|
fileName: _jsxFileName,
|
|
69
|
-
lineNumber:
|
|
69
|
+
lineNumber: 137,
|
|
70
70
|
columnNumber: 12
|
|
71
71
|
}
|
|
72
72
|
}));
|