@kesha-antonov/react-native-chat 6.0.1 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/README.md +27 -4
  2. package/lib/Actions.d.ts.map +1 -1
  3. package/lib/Actions.js +33 -27
  4. package/lib/Actions.js.map +1 -1
  5. package/lib/Chat/Chat.d.ts.map +1 -1
  6. package/lib/Chat/Chat.js +253 -203
  7. package/lib/Chat/Chat.js.map +1 -1
  8. package/lib/Chat/ChatMessageList.d.ts.map +1 -1
  9. package/lib/Chat/ChatMessageList.js +4 -0
  10. package/lib/Chat/ChatMessageList.js.map +1 -1
  11. package/lib/Chat/index.d.ts +9 -1
  12. package/lib/Chat/index.d.ts.map +1 -1
  13. package/lib/Chat/index.js +14 -1
  14. package/lib/Chat/index.js.map +1 -1
  15. package/lib/Chat/types.d.ts +29 -0
  16. package/lib/Chat/types.d.ts.map +1 -1
  17. package/lib/Chat/types.js.map +1 -1
  18. package/lib/Chat/useMessageActions.d.ts +1 -0
  19. package/lib/Chat/useMessageActions.d.ts.map +1 -1
  20. package/lib/Chat/useMessageActions.js +97 -89
  21. package/lib/Chat/useMessageActions.js.map +1 -1
  22. package/lib/ChatHeader.d.ts +50 -0
  23. package/lib/ChatHeader.d.ts.map +1 -0
  24. package/lib/ChatHeader.js +356 -0
  25. package/lib/ChatHeader.js.map +1 -0
  26. package/lib/ChatList/ChatListCell.d.ts +1 -1
  27. package/lib/ChatList/ChatListCell.d.ts.map +1 -1
  28. package/lib/ChatList/ChatListCell.js +42 -11
  29. package/lib/ChatList/ChatListCell.js.map +1 -1
  30. package/lib/ChatList/index.js +332 -323
  31. package/lib/ChatList/index.js.map +1 -1
  32. package/lib/ChatList/types.d.ts +17 -1
  33. package/lib/ChatList/types.d.ts.map +1 -1
  34. package/lib/ChatList/types.js.map +1 -1
  35. package/lib/ChatList/utils.d.ts +4 -1
  36. package/lib/ChatList/utils.d.ts.map +1 -1
  37. package/lib/ChatList/utils.js +3 -2
  38. package/lib/ChatList/utils.js.map +1 -1
  39. package/lib/Composer.js +5 -1
  40. package/lib/Composer.js.map +1 -1
  41. package/lib/InputToolbar/fragments.d.ts +1 -1
  42. package/lib/InputToolbar/fragments.d.ts.map +1 -1
  43. package/lib/InputToolbar/fragments.js +9 -7
  44. package/lib/InputToolbar/fragments.js.map +1 -1
  45. package/lib/InputToolbar/index.d.ts.map +1 -1
  46. package/lib/InputToolbar/index.js +3 -2
  47. package/lib/InputToolbar/index.js.map +1 -1
  48. package/lib/InputToolbar/types.d.ts +6 -0
  49. package/lib/InputToolbar/types.d.ts.map +1 -1
  50. package/lib/InputToolbar/types.js.map +1 -1
  51. package/lib/InputToolbar/useActionsFragment.d.ts.map +1 -1
  52. package/lib/InputToolbar/useActionsFragment.js +83 -59
  53. package/lib/InputToolbar/useActionsFragment.js.map +1 -1
  54. package/lib/InputToolbar/useKeyboardInset.d.ts +1 -1
  55. package/lib/InputToolbar/useKeyboardInset.d.ts.map +1 -1
  56. package/lib/InputToolbar/useKeyboardInset.js +2 -2
  57. package/lib/InputToolbar/useKeyboardInset.js.map +1 -1
  58. package/lib/MessageText.d.ts.map +1 -1
  59. package/lib/MessageText.js +39 -33
  60. package/lib/MessageText.js.map +1 -1
  61. package/lib/MessagesContainer/index.d.ts.map +1 -1
  62. package/lib/MessagesContainer/index.js +113 -94
  63. package/lib/MessagesContainer/index.js.map +1 -1
  64. package/lib/MessagesContainer/types.d.ts +5 -2
  65. package/lib/MessagesContainer/types.d.ts.map +1 -1
  66. package/lib/MessagesContainer/types.js.map +1 -1
  67. package/lib/MessagesContainer/useChained.d.ts +6 -0
  68. package/lib/MessagesContainer/useChained.d.ts.map +1 -0
  69. package/lib/MessagesContainer/useChained.js +38 -0
  70. package/lib/MessagesContainer/useChained.js.map +1 -0
  71. package/lib/MessagesContainer/useListChrome.d.ts.map +1 -1
  72. package/lib/MessagesContainer/useListChrome.js +1 -1
  73. package/lib/MessagesContainer/useListChrome.js.map +1 -1
  74. package/lib/Models.d.ts +2 -1
  75. package/lib/Models.d.ts.map +1 -1
  76. package/lib/Models.js.map +1 -1
  77. package/lib/Send.d.ts.map +1 -1
  78. package/lib/Send.js +18 -13
  79. package/lib/Send.js.map +1 -1
  80. package/lib/Theme.d.ts +11 -0
  81. package/lib/Theme.d.ts.map +1 -1
  82. package/lib/Theme.js +17 -1
  83. package/lib/Theme.js.map +1 -1
  84. package/lib/attachments/AttachmentButton.js +17 -15
  85. package/lib/attachments/AttachmentButton.js.map +1 -1
  86. package/lib/attachments/AttachmentMenu/GalleryGrid.d.ts +3 -1
  87. package/lib/attachments/AttachmentMenu/GalleryGrid.d.ts.map +1 -1
  88. package/lib/attachments/AttachmentMenu/GalleryGrid.js +69 -68
  89. package/lib/attachments/AttachmentMenu/GalleryGrid.js.map +1 -1
  90. package/lib/attachments/AttachmentMenu/TabPanel.d.ts +3 -1
  91. package/lib/attachments/AttachmentMenu/TabPanel.d.ts.map +1 -1
  92. package/lib/attachments/AttachmentMenu/TabPanel.js +23 -21
  93. package/lib/attachments/AttachmentMenu/TabPanel.js.map +1 -1
  94. package/lib/attachments/AttachmentMenu/index.d.ts +6 -2
  95. package/lib/attachments/AttachmentMenu/index.d.ts.map +1 -1
  96. package/lib/attachments/AttachmentMenu/index.js +259 -247
  97. package/lib/attachments/AttachmentMenu/index.js.map +1 -1
  98. package/lib/attachments/buildMessages.d.ts +4 -4
  99. package/lib/attachments/buildMessages.d.ts.map +1 -1
  100. package/lib/attachments/buildMessages.js +9 -8
  101. package/lib/attachments/buildMessages.js.map +1 -1
  102. package/lib/attachments/types.d.ts +19 -0
  103. package/lib/attachments/types.d.ts.map +1 -1
  104. package/lib/attachments/types.js.map +1 -1
  105. package/lib/components/TouchableOpacity.d.ts +5 -0
  106. package/lib/components/TouchableOpacity.d.ts.map +1 -1
  107. package/lib/components/TouchableOpacity.js +59 -54
  108. package/lib/components/TouchableOpacity.js.map +1 -1
  109. package/lib/components/defaultMessageActions.d.ts +3 -1
  110. package/lib/components/defaultMessageActions.d.ts.map +1 -1
  111. package/lib/components/defaultMessageActions.js +9 -1
  112. package/lib/components/defaultMessageActions.js.map +1 -1
  113. package/lib/components/textHighlight.d.ts +14 -0
  114. package/lib/components/textHighlight.d.ts.map +1 -0
  115. package/lib/components/textHighlight.js +39 -0
  116. package/lib/components/textHighlight.js.map +1 -0
  117. package/lib/hooks/useKeyboardVerticalOffset.d.ts +6 -0
  118. package/lib/hooks/useKeyboardVerticalOffset.d.ts.map +1 -1
  119. package/lib/hooks/useKeyboardVerticalOffset.js +35 -13
  120. package/lib/hooks/useKeyboardVerticalOffset.js.map +1 -1
  121. package/lib/i18n.d.ts +2 -0
  122. package/lib/i18n.d.ts.map +1 -1
  123. package/lib/i18n.js +1 -0
  124. package/lib/i18n.js.map +1 -1
  125. package/lib/index.d.ts +3 -1
  126. package/lib/index.d.ts.map +1 -1
  127. package/lib/index.js +1 -0
  128. package/lib/index.js.map +1 -1
  129. package/lib/linkParser.d.ts +4 -1
  130. package/lib/linkParser.d.ts.map +1 -1
  131. package/lib/linkParser.js +115 -78
  132. package/lib/linkParser.js.map +1 -1
  133. package/lib/locales/ar.d.ts.map +1 -1
  134. package/lib/locales/ar.js +1 -0
  135. package/lib/locales/ar.js.map +1 -1
  136. package/lib/locales/de.d.ts.map +1 -1
  137. package/lib/locales/de.js +1 -0
  138. package/lib/locales/de.js.map +1 -1
  139. package/lib/locales/es.d.ts.map +1 -1
  140. package/lib/locales/es.js +1 -0
  141. package/lib/locales/es.js.map +1 -1
  142. package/lib/locales/fr.d.ts.map +1 -1
  143. package/lib/locales/fr.js +1 -0
  144. package/lib/locales/fr.js.map +1 -1
  145. package/lib/locales/hi.d.ts.map +1 -1
  146. package/lib/locales/hi.js +1 -0
  147. package/lib/locales/hi.js.map +1 -1
  148. package/lib/locales/id.d.ts.map +1 -1
  149. package/lib/locales/id.js +1 -0
  150. package/lib/locales/id.js.map +1 -1
  151. package/lib/locales/it.d.ts.map +1 -1
  152. package/lib/locales/it.js +1 -0
  153. package/lib/locales/it.js.map +1 -1
  154. package/lib/locales/ja.d.ts.map +1 -1
  155. package/lib/locales/ja.js +1 -0
  156. package/lib/locales/ja.js.map +1 -1
  157. package/lib/locales/ko.d.ts.map +1 -1
  158. package/lib/locales/ko.js +1 -0
  159. package/lib/locales/ko.js.map +1 -1
  160. package/lib/locales/nl.d.ts.map +1 -1
  161. package/lib/locales/nl.js +1 -0
  162. package/lib/locales/nl.js.map +1 -1
  163. package/lib/locales/pl.d.ts.map +1 -1
  164. package/lib/locales/pl.js +1 -0
  165. package/lib/locales/pl.js.map +1 -1
  166. package/lib/locales/pt.d.ts.map +1 -1
  167. package/lib/locales/pt.js +1 -0
  168. package/lib/locales/pt.js.map +1 -1
  169. package/lib/locales/ru.d.ts.map +1 -1
  170. package/lib/locales/ru.js +1 -0
  171. package/lib/locales/ru.js.map +1 -1
  172. package/lib/locales/tr.d.ts.map +1 -1
  173. package/lib/locales/tr.js +1 -0
  174. package/lib/locales/tr.js.map +1 -1
  175. package/lib/locales/zh.d.ts.map +1 -1
  176. package/lib/locales/zh.js +1 -0
  177. package/lib/locales/zh.js.map +1 -1
  178. package/llms.txt +1 -1
  179. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useContext","useMemo","View","AnimatedLegendList","useSharedValue","BubbleGradientContext","useIsKeyboardVisible","useTheme","useThemedStyles","stylesCommon","TypingIndicatorListAnimationContext","DayAnimated","ScrollToBottomButton","useListState","listCellTransition","PageDownReturnContext","MessageRowConfigContext","RowTargetsContext","MessageRowStoreContext","styles","createThemedStyles","useCellLayouts","useDaysPositions","useListChrome","useListMetrics","useRowsHeight","useMessageRows","usePageDownUnread","useScrollActivity","useScrollToBottom","useTapToClosePanels","useViewabilityPairs","MessagesContainer","props","$","_c","messages","t0","user","isInverted","t1","listProps","isScrollToBottomEnabled","t2","isScrollToBottomBadgeEnabled","t3","scrollToBottomOffset","t4","isAlignedTop","t5","scrollToBottomStyle","scrollToBottomContentStyle","loadEarlierMessagesProps","forwardRef","scrollToBottomComponent","scrollToBottomComponentProp","renderDay","renderDayProp","isDayAnimationEnabled","t6","t7","undefined","themedStyles","theme","isKeyboardVisible","isTopAligned","alignItemsAtEnd","isListLaidOut","isLayoutAnimated","listHeight","contentHeight","scrollOffset","sharedValues","rowsHeight","scrolledY","onLayoutList","onContentSizeChange","onMetricsChange","maintainScrollAtEnd","listState","cellLayout","onItemSizeChanged","daysPositions","floatingRenderedDate","isScrollActive","floatingDayOpacity","onScrollBeginDrag","onScrollEndDrag","onMomentumScrollBegin","onMomentumScrollEnd","isScreenGradient","bubble","outgoingGradient","length","outgoingGradientMode","t8","gradientStore","ListHeaderComponent","ListFooterComponent","renderChatEmpty","onStartReached","pageDownReturn","t9","scrollToBottomOpacity","isScrollToBottomVisible","isScrollToBottomShown","isShownByScroll","distanceFromNewestSV","handleScrollToBottomPress","t10","rowStore","orderedData","initialScroll","rowConfig","rowTargets","renderItem","keyExtractor","t11","_id","t12","userId","unreadCount","markRowsSeen","viewabilityPairs","t13","onListTouchStart","onListTouchEnd","t14","t15","fill","messagesContainer","listEngine","t16","root","contentContainerStyle","t17","t18","isLoading","dateFormat","dateFormatCalendar","t19","list","animatedList","t20","t21","t22","t23","t24"],"sources":["../../src/MessagesContainer/index.tsx"],"sourcesContent":["import React, { useContext, useMemo } from 'react'\nimport { View } from 'react-native'\nimport { AnimatedLegendList } from '@legendapp/list/reanimated'\nimport { useSharedValue } from 'react-native-reanimated'\nimport { BubbleGradientContext, BubbleGradientStore } from '../components/BubbleBackground'\nimport { useIsKeyboardVisible } from '../hooks/useIsKeyboardVisible'\nimport { useTheme, useThemedStyles } from '../hooks/useTheme'\nimport { IMessage } from '../Models'\nimport stylesCommon from '../styles'\nimport { TypingIndicatorListAnimationContext } from '../TypingIndicator'\nimport { DayAnimated } from './components/DayAnimated'\nimport { ScrollToBottomButton } from './components/ScrollToBottomButton'\nimport { useListState } from './listState'\nimport { listCellTransition } from './listTransitions'\nimport { PageDownReturnContext } from './pageDownReturn'\nimport { MessageRowConfigContext, RowTargetsContext } from './rowConfig'\nimport { MessageRowStore, MessageRowStoreContext } from './rowStore'\nimport styles, { createThemedStyles } from './styles'\nimport { MessagesContainerProps, DaysPositions } from './types'\nimport { useCellLayouts } from './useCellLayouts'\nimport { useDaysPositions } from './useDaysPositions'\nimport { useListChrome } from './useListChrome'\nimport { useListMetrics, useRowsHeight } from './useListMetrics'\nimport { useMessageRows } from './useMessageRows'\nimport { usePageDownUnread } from './usePageDownUnread'\nimport { useScrollActivity } from './useScrollActivity'\nimport { useScrollToBottom } from './useScrollToBottom'\nimport { useTapToClosePanels } from './useTapToClosePanels'\nimport { useViewabilityPairs } from './viewability'\n\n\nexport * from './types'\n\nexport const MessagesContainer = <TMessage extends IMessage>(props: MessagesContainerProps<TMessage>) => {\n const {\n messages = [],\n user,\n isInverted = true,\n listProps,\n isScrollToBottomEnabled = true,\n isScrollToBottomBadgeEnabled = true,\n // How far to scroll before the scroll-to-bottom button comes up.\n scrollToBottomOffset = 100,\n isAlignedTop = false,\n scrollToBottomStyle,\n scrollToBottomContentStyle,\n loadEarlierMessagesProps,\n forwardRef,\n scrollToBottomComponent: scrollToBottomComponentProp,\n renderDay: renderDayProp,\n isDayAnimationEnabled = true,\n } = props\n\n const themedStyles = useThemedStyles(createThemedStyles)\n const theme = useTheme()\n\n // `'auto'` is the only mode that cares about the keyboard, so the other two never\n // subscribe - and never re-render the whole list when the keyboard moves.\n const isKeyboardVisible = useIsKeyboardVisible(isAlignedTop === 'auto')\n\n const isTopAligned = isAlignedTop === 'auto'\n ? !isKeyboardVisible\n : isAlignedTop === true\n // The list renders oldest first, top to bottom, and a conversation shorter than the list sits\n // at its bottom - unless `isAlignedTop` says otherwise.\n const alignItemsAtEnd = !isTopAligned\n\n const {\n isListLaidOut,\n isLayoutAnimated,\n listHeight,\n contentHeight,\n scrollOffset,\n sharedValues,\n rowsHeight,\n scrolledY,\n onLayoutList,\n onContentSizeChange,\n onMetricsChange,\n maintainScrollAtEnd,\n } = useListMetrics(listProps)\n const listState = useListState(forwardRef)\n const { cellLayout, onItemSizeChanged } = useCellLayouts(listState, isListLaidOut)\n\n const daysPositions = useSharedValue<DaysPositions>({})\n // The date (createdAt ms) the floating day header is currently rendering. Used to\n // keep the inline separator visible until the header's text has caught up, hiding\n // the 1-frame JS-thread lag of the header on each day change.\n const floatingRenderedDate = useSharedValue<number | undefined>(undefined)\n const {\n isScrollActive,\n floatingDayOpacity,\n onScrollBeginDrag,\n onScrollEndDrag,\n onMomentumScrollBegin,\n onMomentumScrollEnd,\n } = useScrollActivity()\n\n const isScreenGradient = !!theme.bubble.outgoingGradient && theme.bubble.outgoingGradient.length > 1 &&\n theme.bubble.outgoingGradientMode === 'screen'\n const gradientStore = useMemo((): BubbleGradientStore | null => isScreenGradient\n ? { scrolledY, listHeight, cellLayout, isInverted: false }\n : null\n , [isScreenGradient, scrolledY, listHeight, cellLayout])\n\n const { ListHeaderComponent, ListFooterComponent, renderChatEmpty, onStartReached } = useListChrome(props)\n\n const pageDownReturn = useContext(PageDownReturnContext)\n const {\n scrollToBottomOpacity,\n isScrollToBottomVisible,\n isScrollToBottomShown,\n isShownByScroll,\n distanceFromNewestSV,\n handleScrollToBottomPress,\n } = useScrollToBottom({\n forwardRef,\n scrollOffset,\n contentHeight,\n listHeight,\n scrollToBottomOffset,\n pageDownReturn,\n })\n\n const { rowStore, orderedData, initialScroll, rowConfig, rowTargets, renderItem, keyExtractor } = useMessageRows(props, {\n scrolledY,\n daysPositions,\n listHeight,\n floatingRenderedDate,\n floatingDayOpacity,\n })\n\n const { unreadCount, markRowsSeen } = usePageDownUnread({\n messages,\n isInverted,\n userId: user?._id,\n isScrollToBottomEnabled,\n isScrollToBottomBadgeEnabled,\n isScrollToBottomVisible,\n distanceFromNewestSV,\n isShownByScroll,\n isScrollToBottomShown,\n listState,\n pageDownReturn,\n })\n\n const viewabilityPairs = useViewabilityPairs(listProps, markRowsSeen)\n\n useDaysPositions({\n messages,\n isInverted,\n isListLaidOut,\n isDayAnimationEnabled,\n listState,\n daysPositions,\n rowStore,\n })\n\n useRowsHeight(isListLaidOut, listState, rowsHeight, orderedData)\n\n const { onListTouchStart, onListTouchEnd } = useTapToClosePanels()\n\n // Memoized, so a render of the container that leaves the list's inputs alone - a status\n // change or a reaction, which keep the data's identity - does not walk the list's rows.\n const listEngine = useMemo(() => (\n <AnimatedLegendList\n ref={forwardRef}\n keyExtractor={keyExtractor}\n data={orderedData}\n renderItem={renderItem}\n estimatedItemSize={64}\n // Oldest first, top to bottom: no inverted list, no flipped rows.\n alignItemsAtEnd={alignItemsAtEnd}\n {...initialScroll}\n maintainScrollAtEnd={maintainScrollAtEnd}\n maintainVisibleContentPosition\n // Rows that move (a message arriving, a row growing a reaction, the typing bubble\n // coming or going) slide to their new place instead of jumping there.\n itemLayoutAnimation={isLayoutAnimated ? listCellTransition : undefined}\n sharedValues={sharedValues}\n style={stylesCommon.fill}\n contentContainerStyle={styles.messagesContainer}\n ListEmptyComponent={renderChatEmpty}\n ListHeaderComponent={ListHeaderComponent}\n ListFooterComponent={ListFooterComponent}\n onStartReached={onStartReached}\n onStartReachedThreshold={0.1}\n keyboardDismissMode='interactive'\n keyboardShouldPersistTaps='handled'\n {...listProps}\n onScrollBeginDrag={onScrollBeginDrag}\n onScrollEndDrag={onScrollEndDrag}\n onMomentumScrollBegin={onMomentumScrollBegin}\n onMomentumScrollEnd={onMomentumScrollEnd}\n onContentSizeChange={onContentSizeChange}\n onItemSizeChanged={onItemSizeChanged}\n onMetricsChange={onMetricsChange}\n onViewableItemsChanged={undefined}\n viewabilityConfig={undefined}\n viewabilityConfigCallbackPairs={viewabilityPairs}\n onLayout={onLayoutList}\n />\n ), [forwardRef, keyExtractor, orderedData, renderItem, alignItemsAtEnd, isLayoutAnimated, initialScroll, maintainScrollAtEnd, sharedValues, renderChatEmpty, ListHeaderComponent, ListFooterComponent, onStartReached, listProps, onScrollBeginDrag, onScrollEndDrag, onMomentumScrollBegin, onMomentumScrollEnd, onContentSizeChange, onItemSizeChanged, onMetricsChange, viewabilityPairs, onLayoutList])\n\n const list = (\n <View\n style={[styles.contentContainerStyle, themedStyles.root, stylesCommon.fill]}\n onTouchStart={onListTouchStart}\n onTouchEnd={onListTouchEnd}\n >\n {listEngine}\n <ScrollToBottomButton\n isEnabled={isScrollToBottomEnabled}\n isVisible={isScrollToBottomVisible}\n opacity={scrollToBottomOpacity}\n unreadCount={unreadCount}\n onPress={handleScrollToBottomPress}\n style={scrollToBottomStyle}\n contentStyle={scrollToBottomContentStyle}\n scrollToBottomComponent={scrollToBottomComponentProp}\n />\n {isDayAnimationEnabled && (\n <DayAnimated\n scrolledY={scrolledY}\n daysPositions={daysPositions}\n listHeight={listHeight}\n isScrollActive={isScrollActive}\n floatingRenderedDate={floatingRenderedDate}\n opacity={floatingDayOpacity}\n renderDay={renderDayProp}\n isLoading={loadEarlierMessagesProps?.isLoading ?? false}\n dateFormat={props.dateFormat}\n dateFormatCalendar={props.dateFormatCalendar}\n />\n )}\n </View>\n )\n\n const animatedList = (\n <TypingIndicatorListAnimationContext.Provider value>\n {list}\n </TypingIndicatorListAnimationContext.Provider>\n )\n\n // Always mounted, with `null` outside the screen-gradient theme: wrapping the list only in\n // that theme moved it in the tree whenever the color scheme flipped, and React remounted\n // the whole list - back at the newest message, wherever the user had scrolled.\n return (\n <BubbleGradientContext.Provider value={gradientStore}>\n <MessageRowStoreContext.Provider value={rowStore as unknown as MessageRowStore}>\n <MessageRowConfigContext.Provider value={rowConfig}>\n <RowTargetsContext.Provider value={rowTargets}>\n {animatedList}\n </RowTargetsContext.Provider>\n </MessageRowConfigContext.Provider>\n </MessageRowStoreContext.Provider>\n </BubbleGradientContext.Provider>\n )\n}\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAClD,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,kBA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G,CAAA,OAAA+G,GAAA;EAAA;IAAAA,GAAA,GAAA/G,CAAA;EAAA;EAAA,IAAAgH,GAAA;EAAA,IAAAhH,CAAA,UAAA6G,GAAA,IAAA7G,CAAA,UAAA+G,GAAA;IALrCC,GAAA,oCAAwC,KAAsC,CAAtC,CAAAH,GAAqC,CAAC,CAC5E,CAAAE,GAIkC,CACpC,kCAAkC;IAAA/G,CAAA,QAAA6G,GAAA;IAAA7G,CAAA,QAAA+G,GAAA;IAAA/G,CAAA,QAAAgH,GAAA;EAAA;IAAAA,GAAA,GAAAhH,CAAA;EAAA;EAAA,IAAAiH,GAAA;EAAA,IAAAjH,CAAA,UAAA8D,aAAA,IAAA9D,CAAA,UAAAgH,GAAA;IAPpCC,GAAA,mCAAuCnD,KAAa,CAAbA,cAAY,CAAC,CAClD,CAAAkD,GAMiC,CACnC,iCAAiC;IAAAhH,CAAA,QAAA8D,aAAA;IAAA9D,CAAA,QAAAgH,GAAA;IAAAhH,CAAA,QAAAiH,GAAA;EAAA;IAAAA,GAAA,GAAAjH,CAAA;EAAA;EAAA,OARjCiH,GAQiC;AAAA,CAEpC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","useContext","useMemo","View","AnimatedLegendList","useSharedValue","BubbleGradientContext","useIsKeyboardVisible","useTheme","useThemedStyles","stylesCommon","TypingIndicatorListAnimationContext","DayAnimated","ScrollToBottomButton","useListState","listCellTransition","PageDownReturnContext","MessageRowConfigContext","RowTargetsContext","MessageRowStoreContext","styles","createThemedStyles","useCellLayouts","useChained","useDaysPositions","useListChrome","useListMetrics","useRowsHeight","useMessageRows","usePageDownUnread","useScrollActivity","useScrollToBottom","useTapToClosePanels","useViewabilityPairs","MessagesContainer","props","$","_c","messages","t0","user","isInverted","t1","listProps","isScrollToBottomEnabled","t2","isScrollToBottomBadgeEnabled","t3","scrollToBottomOffset","t4","isAlignedTop","t5","scrollToBottomStyle","scrollToBottomContentStyle","loadEarlierMessagesProps","forwardRef","scrollToBottomComponent","scrollToBottomComponentProp","renderDay","renderDayProp","isDayAnimationEnabled","t6","t7","undefined","themedStyles","theme","isKeyboardVisible","isTopAligned","alignItemsAtEnd","isListLaidOut","isLayoutAnimated","listHeight","contentHeight","scrollOffset","sharedValues","rowsHeight","scrolledY","onLayoutList","onContentSizeChange","onMetricsChange","maintainScrollAtEnd","listState","cellLayout","onItemSizeChanged","daysPositions","floatingRenderedDate","isScrollActive","floatingDayOpacity","onScrollBeginDrag","onScrollEndDrag","onMomentumScrollBegin","onMomentumScrollEnd","isScreenGradient","bubble","outgoingGradient","length","outgoingGradientMode","t8","gradientStore","ListHeaderComponent","ListFooterComponent","renderChatEmpty","onStartReached","pageDownReturn","t9","scrollToBottomOpacity","isScrollToBottomVisible","isScrollToBottomShown","isShownByScroll","distanceFromNewestSV","handleScrollToBottomPress","t10","rowStore","orderedData","initialScroll","rowConfig","rowTargets","renderItem","keyExtractor","t11","_id","t12","userId","unreadCount","markRowsSeen","viewabilityPairs","t13","onListTouchStart","onListTouchEnd","handleScrollBeginDrag","handleScrollEndDrag","handleMomentumScrollBegin","handleMomentumScrollEnd","handleContentSizeChange","handleItemSizeChanged","handleMetricsChange","listContentStyle","contentContainerStyle","t14","messagesContainer","t15","t16","fill","listEngine","t17","root","t18","t19","isLoading","dateFormat","dateFormatCalendar","t20","list","animatedList","t21","t22","t23","t24","t25"],"sources":["../../src/MessagesContainer/index.tsx"],"sourcesContent":["import React, { useContext, useMemo } from 'react'\nimport { View } from 'react-native'\nimport { AnimatedLegendList } from '@legendapp/list/reanimated'\nimport { useSharedValue } from 'react-native-reanimated'\nimport { BubbleGradientContext, BubbleGradientStore } from '../components/BubbleBackground'\nimport { useIsKeyboardVisible } from '../hooks/useIsKeyboardVisible'\nimport { useTheme, useThemedStyles } from '../hooks/useTheme'\nimport { IMessage } from '../Models'\nimport stylesCommon from '../styles'\nimport { TypingIndicatorListAnimationContext } from '../TypingIndicator'\nimport { DayAnimated } from './components/DayAnimated'\nimport { ScrollToBottomButton } from './components/ScrollToBottomButton'\nimport { useListState } from './listState'\nimport { listCellTransition } from './listTransitions'\nimport { PageDownReturnContext } from './pageDownReturn'\nimport { MessageRowConfigContext, RowTargetsContext } from './rowConfig'\nimport { MessageRowStore, MessageRowStoreContext } from './rowStore'\nimport styles, { createThemedStyles } from './styles'\nimport { MessagesContainerProps, DaysPositions } from './types'\nimport { useCellLayouts } from './useCellLayouts'\nimport { useChained } from './useChained'\nimport { useDaysPositions } from './useDaysPositions'\nimport { useListChrome } from './useListChrome'\nimport { useListMetrics, useRowsHeight } from './useListMetrics'\nimport { useMessageRows } from './useMessageRows'\nimport { usePageDownUnread } from './usePageDownUnread'\nimport { useScrollActivity } from './useScrollActivity'\nimport { useScrollToBottom } from './useScrollToBottom'\nimport { useTapToClosePanels } from './useTapToClosePanels'\nimport { useViewabilityPairs } from './viewability'\n\n\nexport * from './types'\n\nexport const MessagesContainer = <TMessage extends IMessage>(props: MessagesContainerProps<TMessage>) => {\n const {\n messages = [],\n user,\n isInverted = true,\n listProps,\n isScrollToBottomEnabled = true,\n isScrollToBottomBadgeEnabled = true,\n // How far to scroll before the scroll-to-bottom button comes up.\n scrollToBottomOffset = 100,\n isAlignedTop = false,\n scrollToBottomStyle,\n scrollToBottomContentStyle,\n loadEarlierMessagesProps,\n forwardRef,\n scrollToBottomComponent: scrollToBottomComponentProp,\n renderDay: renderDayProp,\n isDayAnimationEnabled = true,\n } = props\n\n const themedStyles = useThemedStyles(createThemedStyles)\n const theme = useTheme()\n\n // `'auto'` is the only mode that cares about the keyboard, so the other two never\n // subscribe - and never re-render the whole list when the keyboard moves.\n const isKeyboardVisible = useIsKeyboardVisible(isAlignedTop === 'auto')\n\n const isTopAligned = isAlignedTop === 'auto'\n ? !isKeyboardVisible\n : isAlignedTop === true\n // The list renders oldest first, top to bottom, and a conversation shorter than the list sits\n // at its bottom - unless `isAlignedTop` says otherwise.\n const alignItemsAtEnd = !isTopAligned\n\n const {\n isListLaidOut,\n isLayoutAnimated,\n listHeight,\n contentHeight,\n scrollOffset,\n sharedValues,\n rowsHeight,\n scrolledY,\n onLayoutList,\n onContentSizeChange,\n onMetricsChange,\n maintainScrollAtEnd,\n } = useListMetrics(listProps)\n const listState = useListState(forwardRef)\n const { cellLayout, onItemSizeChanged } = useCellLayouts(listState, isListLaidOut)\n\n const daysPositions = useSharedValue<DaysPositions>({})\n // The date (createdAt ms) the floating day header is currently rendering. Used to\n // keep the inline separator visible until the header's text has caught up, hiding\n // the 1-frame JS-thread lag of the header on each day change.\n const floatingRenderedDate = useSharedValue<number | undefined>(undefined)\n const {\n isScrollActive,\n floatingDayOpacity,\n onScrollBeginDrag,\n onScrollEndDrag,\n onMomentumScrollBegin,\n onMomentumScrollEnd,\n } = useScrollActivity()\n\n const isScreenGradient = !!theme.bubble.outgoingGradient && theme.bubble.outgoingGradient.length > 1 &&\n theme.bubble.outgoingGradientMode === 'screen'\n const gradientStore = useMemo((): BubbleGradientStore | null => isScreenGradient\n ? { scrolledY, listHeight, cellLayout, isInverted: false }\n : null\n , [isScreenGradient, scrolledY, listHeight, cellLayout])\n\n const { ListHeaderComponent, ListFooterComponent, renderChatEmpty, onStartReached } = useListChrome(props)\n\n const pageDownReturn = useContext(PageDownReturnContext)\n const {\n scrollToBottomOpacity,\n isScrollToBottomVisible,\n isScrollToBottomShown,\n isShownByScroll,\n distanceFromNewestSV,\n handleScrollToBottomPress,\n } = useScrollToBottom({\n forwardRef,\n scrollOffset,\n contentHeight,\n listHeight,\n scrollToBottomOffset,\n pageDownReturn,\n })\n\n const { rowStore, orderedData, initialScroll, rowConfig, rowTargets, renderItem, keyExtractor } = useMessageRows(props, {\n scrolledY,\n daysPositions,\n listHeight,\n floatingRenderedDate,\n floatingDayOpacity,\n })\n\n const { unreadCount, markRowsSeen } = usePageDownUnread({\n messages,\n isInverted,\n userId: user?._id,\n isScrollToBottomEnabled,\n isScrollToBottomBadgeEnabled,\n isScrollToBottomVisible,\n distanceFromNewestSV,\n isShownByScroll,\n isScrollToBottomShown,\n listState,\n pageDownReturn,\n })\n\n const viewabilityPairs = useViewabilityPairs(listProps, markRowsSeen)\n\n useDaysPositions({\n messages,\n isInverted,\n isListLaidOut,\n isDayAnimationEnabled,\n listState,\n daysPositions,\n rowStore,\n })\n\n useRowsHeight(isListLaidOut, listState, rowsHeight, orderedData)\n\n const { onListTouchStart, onListTouchEnd } = useTapToClosePanels()\n\n // The list's own handlers run first, then the app's from `listProps` (they used to be dropped).\n const handleScrollBeginDrag = useChained(onScrollBeginDrag, listProps?.onScrollBeginDrag)\n const handleScrollEndDrag = useChained(onScrollEndDrag, listProps?.onScrollEndDrag)\n const handleMomentumScrollBegin = useChained(onMomentumScrollBegin, listProps?.onMomentumScrollBegin)\n const handleMomentumScrollEnd = useChained(onMomentumScrollEnd, listProps?.onMomentumScrollEnd)\n const handleContentSizeChange = useChained(onContentSizeChange, listProps?.onContentSizeChange)\n const handleItemSizeChanged = useChained(onItemSizeChanged, listProps?.onItemSizeChanged)\n const handleMetricsChange = useChained(onMetricsChange, listProps?.onMetricsChange)\n // The app's padding goes on top of the list's own, rather than in its place.\n const listContentStyle = listProps?.contentContainerStyle\n const contentContainerStyle = useMemo(\n () => (listContentStyle ? [styles.messagesContainer, listContentStyle] : styles.messagesContainer),\n [listContentStyle]\n )\n\n // Memoized, so a render of the container that leaves the list's inputs alone - a status\n // change or a reaction, which keep the data's identity - does not walk the list's rows.\n const listEngine = useMemo(() => (\n <AnimatedLegendList\n ref={forwardRef}\n keyExtractor={keyExtractor}\n data={orderedData}\n renderItem={renderItem}\n estimatedItemSize={64}\n // Oldest first, top to bottom: no inverted list, no flipped rows.\n alignItemsAtEnd={alignItemsAtEnd}\n {...initialScroll}\n maintainScrollAtEnd={maintainScrollAtEnd}\n maintainVisibleContentPosition\n // Rows that move (a message arriving, a row growing a reaction, the typing bubble\n // coming or going) slide to their new place instead of jumping there.\n itemLayoutAnimation={isLayoutAnimated ? listCellTransition : undefined}\n sharedValues={sharedValues}\n style={stylesCommon.fill}\n ListEmptyComponent={renderChatEmpty}\n ListHeaderComponent={ListHeaderComponent}\n ListFooterComponent={ListFooterComponent}\n onStartReached={onStartReached}\n onStartReachedThreshold={0.1}\n keyboardDismissMode='interactive'\n keyboardShouldPersistTaps='handled'\n {...listProps}\n contentContainerStyle={contentContainerStyle}\n onScrollBeginDrag={handleScrollBeginDrag}\n onScrollEndDrag={handleScrollEndDrag}\n onMomentumScrollBegin={handleMomentumScrollBegin}\n onMomentumScrollEnd={handleMomentumScrollEnd}\n onContentSizeChange={handleContentSizeChange}\n onItemSizeChanged={handleItemSizeChanged}\n onMetricsChange={handleMetricsChange}\n onViewableItemsChanged={undefined}\n viewabilityConfig={undefined}\n viewabilityConfigCallbackPairs={viewabilityPairs}\n onLayout={onLayoutList}\n />\n ), [forwardRef, keyExtractor, orderedData, renderItem, alignItemsAtEnd, isLayoutAnimated, initialScroll, maintainScrollAtEnd, sharedValues, renderChatEmpty, ListHeaderComponent, ListFooterComponent, onStartReached, listProps, contentContainerStyle, handleScrollBeginDrag, handleScrollEndDrag, handleMomentumScrollBegin, handleMomentumScrollEnd, handleContentSizeChange, handleItemSizeChanged, handleMetricsChange, viewabilityPairs, onLayoutList])\n\n const list = (\n <View\n style={[styles.contentContainerStyle, themedStyles.root, stylesCommon.fill]}\n onTouchStart={onListTouchStart}\n onTouchEnd={onListTouchEnd}\n >\n {listEngine}\n <ScrollToBottomButton\n isEnabled={isScrollToBottomEnabled}\n isVisible={isScrollToBottomVisible}\n opacity={scrollToBottomOpacity}\n unreadCount={unreadCount}\n onPress={handleScrollToBottomPress}\n style={scrollToBottomStyle}\n contentStyle={scrollToBottomContentStyle}\n scrollToBottomComponent={scrollToBottomComponentProp}\n />\n {isDayAnimationEnabled && (\n <DayAnimated\n scrolledY={scrolledY}\n daysPositions={daysPositions}\n listHeight={listHeight}\n isScrollActive={isScrollActive}\n floatingRenderedDate={floatingRenderedDate}\n opacity={floatingDayOpacity}\n renderDay={renderDayProp}\n isLoading={loadEarlierMessagesProps?.isLoading ?? false}\n dateFormat={props.dateFormat}\n dateFormatCalendar={props.dateFormatCalendar}\n />\n )}\n </View>\n )\n\n const animatedList = (\n <TypingIndicatorListAnimationContext.Provider value>\n {list}\n </TypingIndicatorListAnimationContext.Provider>\n )\n\n // Always mounted, with `null` outside the screen-gradient theme: wrapping the list only in\n // that theme moved it in the tree whenever the color scheme flipped, and React remounted\n // the whole list - back at the newest message, wherever the user had scrolled.\n return (\n <BubbleGradientContext.Provider value={gradientStore}>\n <MessageRowStoreContext.Provider value={rowStore as unknown as MessageRowStore}>\n <MessageRowConfigContext.Provider value={rowConfig}>\n <RowTargetsContext.Provider value={rowTargets}>\n {animatedList}\n </RowTargetsContext.Provider>\n </MessageRowConfigContext.Provider>\n </MessageRowStoreContext.Provider>\n </BubbleGradientContext.Provider>\n )\n}\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAClD,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,kBAAkB,QAAQ,4BAA4B;AAC/D,SAASC,cAAc,QAAQ,yBAAyB;AACxD,SAASC,qBAAqB,QAA6B,gCAAgC;AAC3F,SAASC,oBAAoB,QAAQ,+BAA+B;AACpE,SAASC,QAAQ,EAAEC,eAAe,QAAQ,mBAAmB;AAE7D,OAAOC,YAAY,MAAM,WAAW;AACpC,SAASC,mCAAmC,QAAQ,oBAAoB;AACxE,SAASC,WAAW,QAAQ,0BAA0B;AACtD,SAASC,oBAAoB,QAAQ,mCAAmC;AACxE,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,kBAAkB,QAAQ,mBAAmB;AACtD,SAASC,qBAAqB,QAAQ,kBAAkB;AACxD,SAASC,uBAAuB,EAAEC,iBAAiB,QAAQ,aAAa;AACxE,SAA0BC,sBAAsB,QAAQ,YAAY;AACpE,OAAOC,MAAM,IAAIC,kBAAkB,QAAQ,UAAU;AAErD,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC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age extends IMessage = IMessage> ex
68
68
  firstUnreadMessageId?: string | number | null;
69
69
  /** Custom "Unread Messages" bar, or `null` to only scroll to the first unread message. */
70
70
  renderUnreadSeparator?: (() => React.ReactNode) | null;
71
- /** Custom footer component on the ListView, e.g. 'User is typing...' */
72
- renderFooter?: (props: MessagesContainerProps<TMessage>) => React.ReactNode;
71
+ /**
72
+ * Custom footer at the newest end of the list, in place of the typing indicator. The indicator
73
+ * comes as the second argument, to draw it along with the footer's own content.
74
+ */
75
+ renderFooter?: (props: MessagesContainerProps<TMessage>, typingIndicator: React.ReactNode) => React.ReactNode;
73
76
  /** Custom message container */
74
77
  renderMessage?: (props: MessageProps<TMessage>) => React.ReactElement;
75
78
  /** Custom day above a message */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/MessagesContainer/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AAEzE,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAE/D,2EAA2E;AAC3E,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI,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GAAG;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/MessagesContainer/types.ts"],"sourcesContent":["import { RefObject } from 'react'\nimport { StyleProp, ViewStyle } from 'react-native'\nimport type { LegendListRef } from '@legendapp/list/react-native'\nimport type { AnimatedLegendListProps } from '@legendapp/list/reanimated'\n\nimport { DayProps } from '../Day'\nimport { LoadEarlierMessagesProps } from '../LoadEarlierMessages'\nimport { MessageProps } from '../Message'\nimport { User, IMessage, Reply } from '../Models'\nimport { ReactionsProps } from '../Reactions'\nimport { ReplyProps } from '../Reply'\nimport { TypingIndicatorProps } from '../TypingIndicator/types'\n\n/** Extra props for the message list, a Legend List (`@legendapp/list`). */\nexport type AnimatedListProps<TMessage extends IMessage = IMessage> = Partial<AnimatedLegendListProps<TMessage>>\n\n/** The message list's ref: Legend List's (`scrollToEnd`, `scrollToKey`, `scrollToOffset`, `getState`...). */\nexport type AnimatedList = LegendListRef\n\nexport interface MessagesContainerProps<TMessage extends IMessage = IMessage>\n extends Omit<TypingIndicatorProps, 'style'> {\n /** Ref for the message list (a Legend List) */\n forwardRef?: RefObject<AnimatedList | null>\n /** Messages to display */\n messages?: TMessage[]\n /** Format to use for rendering dates; default is 'll' */\n dateFormat?: string\n /** Format to use for rendering relative times */\n dateFormatCalendar?: object\n /** User sending the messages: { _id, name, avatar } */\n user?: User\n /** Additional props for the message list, a [Legend List](https://legendapp.com/open-source/list/) */\n listProps?: AnimatedListProps<TMessage>\n /** Reverses display order of messages; default is true */\n isInverted?: boolean\n /**\n * Where the bubbles sit while the whole conversation fits on screen. Once it is taller\n * than the list this has no effect - the messages fill it either way.\n *\n * - `false` (default) - bottom, the usual chat look.\n * - `true` - top.\n * - `'auto'` - top while the keyboard is closed, bottom while it is open, so a short\n * conversation starts under the header and re-anchors above the keyboard when the\n * composer is focused.\n *\n * Works with both `isInverted` settings.\n */\n isAlignedTop?: boolean | 'auto'\n /** Show the scroll-to-bottom button once scrolled away from the newest message; default is true */\n isScrollToBottomEnabled?: boolean\n /**\n * Count incoming messages that arrive while scrolled up, in a badge on the scroll-to-bottom\n * button; default is true\n */\n isScrollToBottomBadgeEnabled?: boolean\n /** Scroll to bottom wrapper style */\n scrollToBottomStyle?: StyleProp<ViewStyle>\n /** Scroll to bottom content style */\n scrollToBottomContentStyle?: StyleProp<ViewStyle>\n /** Distance from bottom before showing scroll to bottom button */\n scrollToBottomOffset?: number\n /**\n * What to show while there are no messages. `Chat` shows a greeting card by default\n * (\"No messages here yet...\" and a 👋 that sends itself); pass your own render function to\n * replace it, or `null` for nothing.\n */\n renderChatEmpty?: (() => React.ReactNode) | null\n /**\n * The first message the user has not read yet. An \"Unread Messages\" bar is drawn above\n * it, and the chat opens scrolled so the bar is at the top. Keep it fixed while the chat is\n * open (the bar stays until you leave), e.g. from the unread count when it opened.\n */\n firstUnreadMessageId?: string | number | null\n /** Custom \"Unread Messages\" bar, or `null` to only scroll to the first unread message. */\n renderUnreadSeparator?: (() => React.ReactNode) | null\n /** Custom footer component on the ListView, e.g. 'User is typing...' */\n renderFooter?: (props: MessagesContainerProps<TMessage>) => React.ReactNode\n /** Custom message container */\n renderMessage?: (props: MessageProps<TMessage>) => React.ReactElement\n /** Custom day above a message */\n renderDay?: (props: DayProps) => React.ReactNode\n /** Custom \"Load earlier messages\" button */\n renderLoadEarlier?: (props: LoadEarlierMessagesProps) => React.ReactNode\n /** Custom typing indicator */\n renderTypingIndicator?: () => React.ReactNode\n /** Scroll to bottom custom component */\n scrollToBottomComponent?: () => React.ReactNode\n /** Callback when quick reply is sent */\n onQuickReply?: (replies: Reply[]) => void\n /** Props to pass to the LoadEarlierMessages component. The LoadEarlierMessages button is only visible when isAvailable is true. Includes isAvailable (controls button visibility), isInfiniteScrollEnabled (infinite scroll up when reach the top of messages container, automatically call onPress function if it exists - not yet supported for web), onPress (callback when button is pressed), isLoading (display loading indicator), label (override default \"Load earlier messages\" text), and styling props (containerStyle, wrapperStyle, textStyle, activityIndicatorStyle, activityIndicatorColor, activityIndicatorSize). */\n loadEarlierMessagesProps?: LoadEarlierMessagesProps\n /** Style for TypingIndicator component */\n typingIndicatorStyle?: StyleProp<ViewStyle>\n /** Whether incoming messages leave room for an avatar; the typing bubble lines up with them */\n isAvatarVisible?: boolean\n /** Enable animated day label that appears on scroll; default is true */\n isDayAnimationEnabled?: boolean\n /** Reply functionality configuration */\n reply?: ReplyProps<TMessage>\n /** Emoji reactions configuration */\n reactions?: ReactionsProps<TMessage>\n}\n\nexport interface State {\n showScrollBottom: boolean\n hasScrolled: boolean\n}\n\ninterface ViewLayout {\n x: number\n y: number\n width: number\n height: number\n}\n\n// `dayKey` is the local calendar day as a sortable integer (YYYYMMDD-ish). It is\n// computed once, on the JS side, where a Date is already in hand - the worklet that\n// compares entries runs on every cell layout, and constructing Dates there to compare\n// them allocated two objects per entry per layout.\nexport type DaysPositions = { [key: string]: ViewLayout & { createdAt: number, dayKey: number } }\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/MessagesContainer/types.ts"],"sourcesContent":["import { RefObject } from 'react'\nimport { StyleProp, ViewStyle } from 'react-native'\nimport type { LegendListRef } from '@legendapp/list/react-native'\nimport type { AnimatedLegendListProps } from '@legendapp/list/reanimated'\n\nimport { DayProps } from '../Day'\nimport { LoadEarlierMessagesProps } from '../LoadEarlierMessages'\nimport { MessageProps } from '../Message'\nimport { User, IMessage, Reply } from '../Models'\nimport { ReactionsProps } from '../Reactions'\nimport { ReplyProps } from '../Reply'\nimport { TypingIndicatorProps } from '../TypingIndicator/types'\n\n/** Extra props for the message list, a Legend List (`@legendapp/list`). */\nexport type AnimatedListProps<TMessage extends IMessage = IMessage> = Partial<AnimatedLegendListProps<TMessage>>\n\n/** The message list's ref: Legend List's (`scrollToEnd`, `scrollToKey`, `scrollToOffset`, `getState`...). */\nexport type AnimatedList = LegendListRef\n\nexport interface MessagesContainerProps<TMessage extends IMessage = IMessage>\n extends Omit<TypingIndicatorProps, 'style'> {\n /** Ref for the message list (a Legend List) */\n forwardRef?: RefObject<AnimatedList | null>\n /** Messages to display */\n messages?: TMessage[]\n /** Format to use for rendering dates; default is 'll' */\n dateFormat?: string\n /** Format to use for rendering relative times */\n dateFormatCalendar?: object\n /** User sending the messages: { _id, name, avatar } */\n user?: User\n /** Additional props for the message list, a [Legend List](https://legendapp.com/open-source/list/) */\n listProps?: AnimatedListProps<TMessage>\n /** Reverses display order of messages; default is true */\n isInverted?: boolean\n /**\n * Where the bubbles sit while the whole conversation fits on screen. Once it is taller\n * than the list this has no effect - the messages fill it either way.\n *\n * - `false` (default) - bottom, the usual chat look.\n * - `true` - top.\n * - `'auto'` - top while the keyboard is closed, bottom while it is open, so a short\n * conversation starts under the header and re-anchors above the keyboard when the\n * composer is focused.\n *\n * Works with both `isInverted` settings.\n */\n isAlignedTop?: boolean | 'auto'\n /** Show the scroll-to-bottom button once scrolled away from the newest message; default is true */\n isScrollToBottomEnabled?: boolean\n /**\n * Count incoming messages that arrive while scrolled up, in a badge on the scroll-to-bottom\n * button; default is true\n */\n isScrollToBottomBadgeEnabled?: boolean\n /** Scroll to bottom wrapper style */\n scrollToBottomStyle?: StyleProp<ViewStyle>\n /** Scroll to bottom content style */\n scrollToBottomContentStyle?: StyleProp<ViewStyle>\n /** Distance from bottom before showing scroll to bottom button */\n scrollToBottomOffset?: number\n /**\n * What to show while there are no messages. `Chat` shows a greeting card by default\n * (\"No messages here yet...\" and a 👋 that sends itself); pass your own render function to\n * replace it, or `null` for nothing.\n */\n renderChatEmpty?: (() => React.ReactNode) | null\n /**\n * The first message the user has not read yet. An \"Unread Messages\" bar is drawn above\n * it, and the chat opens scrolled so the bar is at the top. Keep it fixed while the chat is\n * open (the bar stays until you leave), e.g. from the unread count when it opened.\n */\n firstUnreadMessageId?: string | number | null\n /** Custom \"Unread Messages\" bar, or `null` to only scroll to the first unread message. */\n renderUnreadSeparator?: (() => React.ReactNode) | null\n /**\n * Custom footer at the newest end of the list, in place of the typing indicator. The indicator\n * comes as the second argument, to draw it along with the footer's own content.\n */\n renderFooter?: (props: MessagesContainerProps<TMessage>, typingIndicator: React.ReactNode) => React.ReactNode\n /** Custom message container */\n renderMessage?: (props: MessageProps<TMessage>) => React.ReactElement\n /** Custom day above a message */\n renderDay?: (props: DayProps) => React.ReactNode\n /** Custom \"Load earlier messages\" button */\n renderLoadEarlier?: (props: LoadEarlierMessagesProps) => React.ReactNode\n /** Custom typing indicator */\n renderTypingIndicator?: () => React.ReactNode\n /** Scroll to bottom custom component */\n scrollToBottomComponent?: () => React.ReactNode\n /** Callback when quick reply is sent */\n onQuickReply?: (replies: Reply[]) => void\n /** Props to pass to the LoadEarlierMessages component. The LoadEarlierMessages button is only visible when isAvailable is true. Includes isAvailable (controls button visibility), isInfiniteScrollEnabled (infinite scroll up when reach the top of messages container, automatically call onPress function if it exists - not yet supported for web), onPress (callback when button is pressed), isLoading (display loading indicator), label (override default \"Load earlier messages\" text), and styling props (containerStyle, wrapperStyle, textStyle, activityIndicatorStyle, activityIndicatorColor, activityIndicatorSize). */\n loadEarlierMessagesProps?: LoadEarlierMessagesProps\n /** Style for TypingIndicator component */\n typingIndicatorStyle?: StyleProp<ViewStyle>\n /** Whether incoming messages leave room for an avatar; the typing bubble lines up with them */\n isAvatarVisible?: boolean\n /** Enable animated day label that appears on scroll; default is true */\n isDayAnimationEnabled?: boolean\n /** Reply functionality configuration */\n reply?: ReplyProps<TMessage>\n /** Emoji reactions configuration */\n reactions?: ReactionsProps<TMessage>\n}\n\nexport interface State {\n showScrollBottom: boolean\n hasScrolled: boolean\n}\n\ninterface ViewLayout {\n x: number\n y: number\n width: number\n height: number\n}\n\n// `dayKey` is the local calendar day as a sortable integer (YYYYMMDD-ish). It is\n// computed once, on the JS side, where a Date is already in hand - the worklet that\n// compares entries runs on every cell layout, and constructing Dates there to compare\n// them allocated two objects per entry per layout.\nexport type DaysPositions = { [key: string]: ViewLayout & { createdAt: number, dayKey: number } }\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * One handler that calls the list's own and then the app's, keeping its identity while neither
3
+ * changes. Without the app's handler it is the list's own.
4
+ */
5
+ export declare function useChained<TArgs extends any[]>(own: ((...args: NoInfer<TArgs>) => void) | undefined, user: ((...args: TArgs) => void) | undefined): ((...args: TArgs) => void) | undefined;
6
+ //# sourceMappingURL=useChained.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChained.d.ts","sourceRoot":"","sources":["../../src/MessagesContainer/useChained.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,wBAAgB,UAAU,CAAC,KAAK,SAAS,GAAG,EAAE,EAC5C,GAAG,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,EACpD,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,SAAS,GAC3C,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,SAAS,CAWxC"}
@@ -0,0 +1,38 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { useMemo } from 'react';
3
+
4
+ /**
5
+ * One handler that calls the list's own and then the app's, keeping its identity while neither
6
+ * changes. Without the app's handler it is the list's own.
7
+ */
8
+
9
+ export function useChained(own, user) {
10
+ const $ = _c(3);
11
+ let t0;
12
+ bb0: {
13
+ if (!user) {
14
+ t0 = own;
15
+ break bb0;
16
+ }
17
+ if (!own) {
18
+ t0 = user;
19
+ break bb0;
20
+ }
21
+ let t1;
22
+ if ($[0] !== own || $[1] !== user) {
23
+ t1 = (...t2) => {
24
+ const args = t2;
25
+ own(...args);
26
+ user(...args);
27
+ };
28
+ $[0] = own;
29
+ $[1] = user;
30
+ $[2] = t1;
31
+ } else {
32
+ t1 = $[2];
33
+ }
34
+ t0 = t1;
35
+ }
36
+ return t0;
37
+ }
38
+ //# sourceMappingURL=useChained.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChained.js","names":["useMemo","useChained","own","user","$","_c","t0","bb0","t1","t2","args"],"sources":["../../src/MessagesContainer/useChained.ts"],"sourcesContent":["import { useMemo } from 'react'\n\n/**\n * One handler that calls the list's own and then the app's, keeping its identity while neither\n * changes. Without the app's handler it is the list's own.\n */\n \nexport function useChained<TArgs extends any[]> (\n own: ((...args: NoInfer<TArgs>) => void) | undefined,\n user: ((...args: TArgs) => void) | undefined\n): ((...args: TArgs) => void) | undefined {\n return useMemo(() => {\n if (!user)\n return own\n if (!own)\n return user\n return (...args: TArgs) => {\n own(...args)\n user(...args)\n }\n }, [own, user])\n}\n"],"mappings":";AAAA,SAASA,OAAO,QAAQ,OAAO;;AAE/B;AACA;AACA;AACA;;AAEA,OAAO,SAAAC,WAAAC,GAAA,EAAAC,IAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EAAA,IAAAC,EAAA;EAAAC,GAAA;IAKH,IAAI,CAACJ,IAAI;MACPG,EAAA,GAAOJ,GAAG;MAAV,MAAAK,GAAA;IAAU;IACZ,IAAI,CAACL,GAAG;MACNI,EAAA,GAAOH,IAAI;MAAX,MAAAI,GAAA;IAAW;IAAA,IAAAC,EAAA;IAAA,IAAAJ,CAAA,QAAAF,GAAA,IAAAE,CAAA,QAAAD,IAAA;MACNK,EAAA,GAAAA,CAAA,GAAAC,EAAA;QAAC,MAAAC,IAAA,GAAAD,EAAc;QACpBP,GAAG,IAAIQ,IAAI,CAAC;QACZP,IAAI,IAAIO,IAAI,CAAC;MAAA,CACd;MAAAN,CAAA,MAAAF,GAAA;MAAAE,CAAA,MAAAD,IAAA;MAAAC,CAAA,MAAAI,EAAA;IAAA;MAAAA,EAAA,GAAAJ,CAAA;IAAA;IAHDE,EAAA,GAAOE,EAGN;EAAA;EAAA,OARIF,EASQ;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useListChrome.d.ts","sourceRoot":"","sources":["../../src/MessagesContainer/useListChrome.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAA;AAKnD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAGpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAEhD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,QAAQ,SAAS,QAAQ,EAAG,KAAK,EAAE,sBAAsB,CAAC,QAAQ,CAAC;;;;;EA+EhG"}
1
+ {"version":3,"file":"useListChrome.d.ts","sourceRoot":"","sources":["../../src/MessagesContainer/useListChrome.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAA;AAKnD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAGpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAEhD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,QAAQ,SAAS,QAAQ,EAAG,KAAK,EAAE,sBAAsB,CAAC,QAAQ,CAAC;;;;;EAiFhG"}
@@ -54,7 +54,7 @@ export function useListChrome(props) {
54
54
  const footerProps = renderFooterProp ? props : undefined;
55
55
  let t4;
56
56
  if ($[8] !== footerProps || $[9] !== renderFooterProp || $[10] !== renderTypingIndicator) {
57
- t4 = renderFooterProp ? renderFooterProp(footerProps) : renderTypingIndicator();
57
+ t4 = renderFooterProp ? renderFooterProp(footerProps, renderTypingIndicator()) : renderTypingIndicator();
58
58
  $[8] = footerProps;
59
59
  $[9] = renderFooterProp;
60
60
  $[10] = renderTypingIndicator;
@@ -1 +1 @@
1
- {"version":3,"file":"useListChrome.js","names":["React","useCallback","useMemo","View","useTheme","LoadEarlierMessages","stylesCommon","TypingIndicator","useListChrome","props","$","_c","isTyping","t0","renderChatEmpty","renderChatEmptyProp","loadEarlierMessagesProps","renderTypingIndicator","renderTypingIndicatorProp","renderFooter","renderFooterProp","renderLoadEarlier","renderLoadEarlierProp","undefined","theme","t1","avatar","size","t2","marginLeft","typingIndicatorAvatarInset","t3","isAvatarVisible","typingIndicatorStyle","footerProps","t4","t5","ListFooterComponent","t6","isAvailable","t7","bb0","t8","emptyContent","t9","fill","t10","bb1","t11","content","t12","ListHeaderComponent","isInfiniteScrollEnabled","isLoading","onPress","onStartReached"],"sources":["../../src/MessagesContainer/useListChrome.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from 'react'\nimport { View } from 'react-native'\n\nimport { useTheme } from '../hooks/useTheme'\nimport { LoadEarlierMessages } from '../LoadEarlierMessages'\nimport { IMessage } from '../Models'\nimport stylesCommon from '../styles'\nimport { TypingIndicator } from '../TypingIndicator'\nimport { MessagesContainerProps } from './types'\n\n/**\n * What the list draws around the rows: the \"Load earlier\" header, the typing indicator (or a\n * custom footer), the empty state, and loading earlier messages on reaching the top.\n */\nexport function useListChrome<TMessage extends IMessage> (props: MessagesContainerProps<TMessage>) {\n const {\n isTyping = false,\n renderChatEmpty: renderChatEmptyProp,\n loadEarlierMessagesProps,\n renderTypingIndicator: renderTypingIndicatorProp,\n renderFooter: renderFooterProp,\n renderLoadEarlier: renderLoadEarlierProp,\n } = props\n\n const theme = useTheme()\n\n // The incoming bubbles start past the avatar column: the row's 8, then the avatar\n // (pulled 2 towards the edge) and the 11 the tail curls into (see `Avatar`).\n const typingIndicatorAvatarInset = useMemo(() => ({ marginLeft: 8 - 2 + theme.avatar.size + 11 }), [theme.avatar.size])\n\n const renderTypingIndicator = useCallback(() => {\n if (renderTypingIndicatorProp)\n return renderTypingIndicatorProp()\n\n return <TypingIndicator isTyping={isTyping} style={[props.isAvatarVisible && typingIndicatorAvatarInset, props.typingIndicatorStyle]} />\n }, [isTyping, renderTypingIndicatorProp, props.isAvatarVisible, typingIndicatorAvatarInset, props.typingIndicatorStyle])\n\n // Only a custom footer is handed the props, so only then does it depend on them - the\n // typing indicator would otherwise be rebuilt, and the list with it, on every render.\n const footerProps = renderFooterProp ? props : undefined\n const ListFooterComponent = useMemo(() => (\n <>\n {renderFooterProp ? renderFooterProp(footerProps!) : renderTypingIndicator()}\n </>\n ), [renderFooterProp, renderTypingIndicator, footerProps])\n\n const renderLoadEarlier = useCallback(() => {\n if (loadEarlierMessagesProps?.isAvailable) {\n if (renderLoadEarlierProp)\n return renderLoadEarlierProp(loadEarlierMessagesProps)\n\n return <LoadEarlierMessages {...loadEarlierMessagesProps} />\n }\n\n return null\n }, [loadEarlierMessagesProps, renderLoadEarlierProp])\n\n const emptyContent = useMemo(() => {\n if (!renderChatEmptyProp)\n return null\n\n return renderChatEmptyProp()\n }, [renderChatEmptyProp])\n\n const renderChatEmpty = useMemo(() => (\n <View style={stylesCommon.fill}>\n {renderChatEmptyProp ? emptyContent : null}\n </View>\n ), [renderChatEmptyProp, emptyContent])\n\n const ListHeaderComponent = useMemo(() => {\n const content = renderLoadEarlier()\n\n if (!content)\n return undefined\n\n return (\n <View style={stylesCommon.fill}>{content}</View>\n )\n }, [renderLoadEarlier])\n\n // The oldest messages are at the top, so infinite scroll loads earlier ones on reaching it.\n const onStartReached = useCallback(() => {\n if (\n loadEarlierMessagesProps &&\n loadEarlierMessagesProps.isAvailable &&\n loadEarlierMessagesProps.isInfiniteScrollEnabled &&\n !loadEarlierMessagesProps.isLoading\n )\n loadEarlierMessagesProps.onPress()\n }, [loadEarlierMessagesProps])\n\n return { ListHeaderComponent, ListFooterComponent, renderChatEmpty, onStartReached }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACnD,SAASC,IAAI,QAAQ,cAAc;AAEnC,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,mBAAmB,QAAQ,wBAAwB;AAE5D,OAAOC,YAAY,MAAM,WAAW;AACpC,SAASC,eAAe,QAAQ,oBAAoB;AAGpD;AACA;AACA;AACA;AACA,OAAO,SAAAC,cAAAC,KAAA;EAAA,MAAAC,CAAA,GAAAC,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,CAAAuC,IAAI,CAAC,CAAGI,QAAM,CAAE,EAAxC,IAAI,CAA2C;MAAAvC,CAAA,OAAAuC,OAAA;MAAAvC,CAAA,OAAAwC,GAAA;IAAA;MAAAA,GAAA,GAAAxC,CAAA;IAAA;IADlDoC,GAAA,GACEI,GAAgD;EACjD;EARH,MAAAC,mBAAA,GAA4BL,GASL;EAAA,IAAAE,GAAA;EAAA,IAAAtC,CAAA,SAAAM,wBAAA;IAGYgC,GAAA,GAAAA,CAAA;MACjC,IACEhC,wBACoC,IAApCA,wBAAwB,CAAAuB,WACwB,IAAhDvB,wBAAwB,CAAAoC,uBACW,IAHnC,CAGCpC,wBAAwB,CAAAqC,SAAU;QAEnCrC,wBAAwB,CAAAsC,OAAQ,CAAC,CAAC;MAAA;IAAA,CACrC;IAAA5C,CAAA,OAAAM,wBAAA;IAAAN,CAAA,OAAAsC,GAAA;EAAA;IAAAA,GAAA,GAAAtC,CAAA;EAAA;EARD,MAAA6C,cAAA,GAAuBP,GAQO;EAAA,IAAAE,GAAA;EAAA,IAAAxC,CAAA,SAAA2B,mBAAA,IAAA3B,CAAA,SAAAyC,mBAAA,IAAAzC,CAAA,SAAA6C,cAAA,IAAA7C,CAAA,SAAAI,eAAA;IAEvBoC,GAAA;MAAAC,mBAAA;MAAAd,mBAAA;MAAAvB,eAAA;MAAAyC;IAA4E,CAAC;IAAA7C,CAAA,OAAA2B,mBAAA;IAAA3B,CAAA,OAAAyC,mBAAA;IAAAzC,CAAA,OAAA6C,cAAA;IAAA7C,CAAA,OAAAI,eAAA;IAAAJ,CAAA,OAAAwC,GAAA;EAAA;IAAAA,GAAA,GAAAxC,CAAA;EAAA;EAAA,OAA7EwC,GAA6E;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"useListChrome.js","names":["React","useCallback","useMemo","View","useTheme","LoadEarlierMessages","stylesCommon","TypingIndicator","useListChrome","props","$","_c","isTyping","t0","renderChatEmpty","renderChatEmptyProp","loadEarlierMessagesProps","renderTypingIndicator","renderTypingIndicatorProp","renderFooter","renderFooterProp","renderLoadEarlier","renderLoadEarlierProp","undefined","theme","t1","avatar","size","t2","marginLeft","typingIndicatorAvatarInset","t3","isAvatarVisible","typingIndicatorStyle","footerProps","t4","t5","ListFooterComponent","t6","isAvailable","t7","bb0","t8","emptyContent","t9","fill","t10","bb1","t11","content","t12","ListHeaderComponent","isInfiniteScrollEnabled","isLoading","onPress","onStartReached"],"sources":["../../src/MessagesContainer/useListChrome.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from 'react'\nimport { View } from 'react-native'\n\nimport { useTheme } from '../hooks/useTheme'\nimport { LoadEarlierMessages } from '../LoadEarlierMessages'\nimport { IMessage } from '../Models'\nimport stylesCommon from '../styles'\nimport { TypingIndicator } from '../TypingIndicator'\nimport { MessagesContainerProps } from './types'\n\n/**\n * What the list draws around the rows: the \"Load earlier\" header, the typing indicator (or a\n * custom footer), the empty state, and loading earlier messages on reaching the top.\n */\nexport function useListChrome<TMessage extends IMessage> (props: MessagesContainerProps<TMessage>) {\n const {\n isTyping = false,\n renderChatEmpty: renderChatEmptyProp,\n loadEarlierMessagesProps,\n renderTypingIndicator: renderTypingIndicatorProp,\n renderFooter: renderFooterProp,\n renderLoadEarlier: renderLoadEarlierProp,\n } = props\n\n const theme = useTheme()\n\n // The incoming bubbles start past the avatar column: the row's 8, then the avatar\n // (pulled 2 towards the edge) and the 11 the tail curls into (see `Avatar`).\n const typingIndicatorAvatarInset = useMemo(() => ({ marginLeft: 8 - 2 + theme.avatar.size + 11 }), [theme.avatar.size])\n\n const renderTypingIndicator = useCallback(() => {\n if (renderTypingIndicatorProp)\n return renderTypingIndicatorProp()\n\n return <TypingIndicator isTyping={isTyping} style={[props.isAvatarVisible && typingIndicatorAvatarInset, props.typingIndicatorStyle]} />\n }, [isTyping, renderTypingIndicatorProp, props.isAvatarVisible, typingIndicatorAvatarInset, props.typingIndicatorStyle])\n\n // Only a custom footer is handed the props, so only then does it depend on them - the\n // typing indicator would otherwise be rebuilt, and the list with it, on every render.\n // A custom footer takes the typing indicator's place and gets it as the second argument, to keep\n // it next to its own content.\n const footerProps = renderFooterProp ? props : undefined\n const ListFooterComponent = useMemo(() => (\n <>\n {renderFooterProp ? renderFooterProp(footerProps!, renderTypingIndicator()) : renderTypingIndicator()}\n </>\n ), [renderFooterProp, renderTypingIndicator, footerProps])\n\n const renderLoadEarlier = useCallback(() => {\n if (loadEarlierMessagesProps?.isAvailable) {\n if (renderLoadEarlierProp)\n return renderLoadEarlierProp(loadEarlierMessagesProps)\n\n return <LoadEarlierMessages {...loadEarlierMessagesProps} />\n }\n\n return null\n }, [loadEarlierMessagesProps, renderLoadEarlierProp])\n\n const emptyContent = useMemo(() => {\n if (!renderChatEmptyProp)\n return null\n\n return renderChatEmptyProp()\n }, [renderChatEmptyProp])\n\n const renderChatEmpty = useMemo(() => (\n <View style={stylesCommon.fill}>\n {renderChatEmptyProp ? emptyContent : null}\n </View>\n ), [renderChatEmptyProp, emptyContent])\n\n const ListHeaderComponent = useMemo(() => {\n const content = renderLoadEarlier()\n\n if (!content)\n return undefined\n\n return (\n <View style={stylesCommon.fill}>{content}</View>\n )\n }, [renderLoadEarlier])\n\n // The oldest messages are at the top, so infinite scroll loads earlier ones on reaching it.\n const onStartReached = useCallback(() => {\n if (\n loadEarlierMessagesProps &&\n loadEarlierMessagesProps.isAvailable &&\n loadEarlierMessagesProps.isInfiniteScrollEnabled &&\n !loadEarlierMessagesProps.isLoading\n )\n loadEarlierMessagesProps.onPress()\n }, [loadEarlierMessagesProps])\n\n return { ListHeaderComponent, ListFooterComponent, renderChatEmpty, onStartReached }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACnD,SAASC,IAAI,QAAQ,cAAc;AAEnC,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,mBAAmB,QAAQ,wBAAwB;AAE5D,OAAOC,YAAY,MAAM,WAAW;AACpC,SAASC,eAAe,QAAQ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it<T, K> = Pick<T, Exclude<keyof T, K>>;
5
5
  * The actions the chat can put in the long-press menu by itself, in this order:
6
6
  * `reply`, `copy`, `forward`, `pin`, `edit`, `delete`.
7
7
  */
8
- export type MessageActionKey = 'reply' | 'copy' | 'forward' | 'pin' | 'edit' | 'select' | 'delete';
8
+ export type MessageActionKey = 'retry' | 'reply' | 'copy' | 'forward' | 'pin' | 'edit' | 'select' | 'delete';
9
9
  /** An action shown in the message long-press context menu. */
10
10
  export interface MessageMenuItem {
11
11
  /**
@@ -87,6 +87,7 @@ export interface LinkPreview {
87
87
  export interface IMessage {
88
88
  _id: string | number;
89
89
  text: string;
90
+ /** A Date, or a timestamp in milliseconds (as `Date.now()` gives). */
90
91
  createdAt: Date | number;
91
92
  user: User;
92
93
  image?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Models.d.ts","sourceRoot":"","sources":["../src/Models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC,MAAM,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAErD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAElG,8DAA8D;AAC9D,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,GAAG,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAAA;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,mEAAmE;IACnE,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,yDAAyD;IACzD,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED,MAAM,WAA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js","names":[],"sources":["../src/Models.ts"],"sourcesContent":["import { StyleProp, ViewStyle } from 'react-native'\nimport { IconRenderer } from './Icons'\n\nexport type Omit<T, K> = Pick<T, Exclude<keyof T, K>>\n\n/**\n * The actions the chat can put in the long-press menu by itself, in this order:\n * `reply`, `copy`, `forward`, `pin`, `edit`, `delete`.\n */\nexport type MessageActionKey = 'reply' | 'copy' | 'forward' | 'pin' | 'edit' | 'select' | 'delete'\n\n/** An action shown in the message long-press context menu. */\nexport interface MessageMenuItem {\n /**\n * Identifies the action. The built-in ones carry their `MessageActionKey`, so a\n * `messageActions` function can find, drop or reorder them.\n */\n key?: MessageActionKey | string\n label: string\n /** Optional leading icon, e.g. a lucide-react-native component. */\n icon?: IconRenderer\n onPress: () => void\n /** Render the label in the destructive (error) color. */\n destructive?: boolean\n}\n\nexport interface LeftRightStyle<T> {\n left?: StyleProp<T>\n right?: StyleProp<T>\n}\n\ntype renderFunction = (x: unknown) => React.ReactNode\n\nexport interface User {\n _id: string | number\n name?: string\n avatar?: string | number | renderFunction\n}\n\nexport interface Reply {\n title: string\n value: string\n messageId?: number | string\n}\n\nexport interface QuickReplies {\n type: 'radio' | 'checkbox'\n values: Reply[]\n keepIt?: boolean\n}\n\nexport interface ReplyMessage extends Pick<IMessage, '_id' | 'text' | 'user' | 'audio' | 'image'> {}\n\nexport interface MessageReaction {\n /** The emoji character (e.g. '👍') */\n emoji: string\n /** IDs of the users who reacted with this emoji */\n userIds: (string | number)[]\n}\n\n/** A document attached to a message (`IMessage.file`), drawn as a file bubble. */\nexport interface IMessageFile {\n /** Where the file is: a local `file://` path or a remote URL. */\n uri: string\n /** The file name shown in the bubble, with its extension. */\n name: string\n /** Size in bytes, shown under the name. */\n size?: number\n /** MIME type, used when the file is opened or shared. */\n mimeType?: string\n}\n\n/**\n * A web page preview for the first link in a message: a block under the text\n * (accent bar, site name, title, description, picture). Fetching it takes a request to the page,\n * so the app supplies it, on the message or through `Chat`'s `fetchLinkPreview`.\n */\nexport interface LinkPreview {\n /** The page the preview is for; a tap opens it. Defaults to the first link in the text. */\n url?: string\n /** The site's name, drawn in the accent color on top (`og:site_name`). */\n siteName?: string\n /** The page title, bold (`og:title`). */\n title?: string\n /** A few lines of the page's description (`og:description`). */\n description?: string\n /** The page's picture (`og:image`). */\n image?: string\n /** The picture's size, so it keeps its aspect ratio before it has loaded. */\n imageWidth?: number\n imageHeight?: number\n /**\n * `'large'` draws the picture full width under the text, `'small'` as a 48dp thumbnail at the\n * top right, as for articles. Default: large when the picture is wider than tall.\n */\n imageSize?: 'large' | 'small'\n}\n\nexport interface IMessage {\n _id: string | number\n text: string\n createdAt: Date | number\n user: User\n image?: string\n /**\n * A tiny stand-in shown under `image` until it has loaded, like a blurred thumbnail:\n * a small image uri (drawn blurred), or a blurhash string when\n * `expo-image` is installed.\n */\n imagePlaceholder?: string\n video?: string\n /** Render `video` as a round video note (circular, autoplay/muted) instead of a rectangular player. */\n videoNote?: boolean\n audio?: string\n /**\n * The voice or round note has not been played by its recipient yet. Draws\n * an unread dot: on an incoming note until you play it, on an\n * outgoing one until the recipient does.\n */\n isMediaUnread?: boolean\n /**\n * A view-once voice or round note: it plays a\n * single time, then `mediaPlayback.onViewOnceEnd` lets the app remove it.\n */\n isViewOnce?: boolean\n /** Text of a transcribed voice or round note, shown under it. */\n transcription?: string\n /**\n * Length of `audio` / `video` in seconds. Set by the built-in recorders and\n * used to label a voice note before its file has been decoded, so a bubble can\n * render its duration without downloading the whole clip first.\n */\n duration?: number\n system?: boolean\n /** The message is pinned; the menu's pin action then reads \"Unpin\". */\n isPinned?: boolean\n sent?: boolean\n received?: boolean\n pending?: boolean\n /** Sending failed: the ticks give way to a red error badge. */\n isFailed?: boolean\n /** The message was edited; its time reads \"edited 14:05\". Set by `useChatMessages`'s edit. */\n isEdited?: boolean\n /** When the message was last edited; any value also shows the \"edited\" mark. */\n editedAt?: Date | number\n /** True while this message's text is still being streamed in (shows a typing cursor) */\n streaming?: boolean\n quickReplies?: QuickReplies\n replyMessage?: ReplyMessage\n reactions?: MessageReaction[]\n location?: {\n latitude: number\n longitude: number\n }\n /** A document: a file bubble (icon, name, size); a tap opens it. */\n file?: IMessageFile\n /** A preview of the first link in `text`, drawn under it. `null` hides the preview for this message. */\n linkPreview?: LinkPreview | null\n /**\n * The message's media (photo, video, file, voice or round note) is uploading or downloading.\n * Draws a progress ring with a cancel ✕ over it; a tap calls `mediaTransfer.onCancel`.\n */\n transfer?: MediaTransfer\n /**\n * The media is not on the device and is not fetched by itself: a download arrow,\n * which calls `mediaTransfer.onDownload` when tapped. Without that handler a voice note\n * downloads itself on the tap.\n */\n isDownloadRequired?: boolean\n /**\n * A voice note's waveform, as the server sends it with the note: levels in 0..1, or 5-bit\n * 0..31 values. Drawn at once, before the audio has downloaded, and resampled to the\n * bubble's bar count; without it the waveform is decoded from the audio.\n */\n waveform?: number[]\n}\n\n/** An upload or download of a message's media, `IMessage.transfer`. */\nexport interface MediaTransfer {\n /** `upload` while sending, `download` while fetching. Both draw the same ring. */\n type: 'upload' | 'download'\n /** 0..1. Leave it out while unknown: the ring then shows a 4-degree dot, still turning. */\n progress?: number\n /** The file's size in bytes: a photo or video then shows \"1.2 MB / 4.5 MB\" while it moves. */\n totalBytes?: number\n}\n\n/** Handlers for the media buttons of messages with `transfer` or `isDownloadRequired`. */\nexport interface MediaTransferProps {\n /** The download arrow was tapped: start fetching, and set `transfer` while it runs. */\n onDownload?: (message: IMessage) => void\n /** The cancel ✕ was tapped during an upload or download. */\n onCancel?: (message: IMessage) => void\n}\n\nexport type IChatMessage = IMessage\n\nexport interface MessageVideoProps<TMessage extends IMessage> {\n currentMessage: TMessage\n position?: 'left' | 'right'\n containerStyle?: StyleProp<ViewStyle>\n videoStyle?: StyleProp<ViewStyle>\n videoProps?: object\n}\n\nexport interface MessageAudioProps<TMessage extends IMessage> {\n currentMessage: TMessage\n position?: 'left' | 'right'\n containerStyle?: StyleProp<ViewStyle>\n audioStyle?: StyleProp<ViewStyle>\n audioProps?: object\n}\n\nexport interface MessageFileProps<TMessage extends IMessage> {\n currentMessage: TMessage\n position?: 'left' | 'right'\n containerStyle?: StyleProp<ViewStyle>\n /** Override opening the file (the system share sheet with `expo-sharing`, else `Linking`). */\n onPress?: (file: IMessageFile) => void\n}\n\nexport interface MessageLocationProps<TMessage extends IMessage> {\n currentMessage: TMessage\n position?: 'left' | 'right'\n containerStyle?: StyleProp<ViewStyle>\n locationStyle?: StyleProp<ViewStyle>\n /** Override the default behavior (opening the system maps app) when tapped. */\n onPress?: (location: { latitude: number, longitude: number }) => void\n}\n\n/**\n * Hold-to-record voice messages. Requires the optional\n * `expo-audio` peer dependency; when it is absent the mic button is hidden.\n */\nexport interface AudioRecordingProps {\n /**\n * Show the \"view once\" toggle above the lock while a take is locked.\n * A take sent with it on arrives in `onSend` with `isViewOnce: true`.\n */\n isViewOnceEnabled?: boolean\n /** On by default when `expo-audio` is installed; `false` hides the mic button. */\n isEnabled?: boolean\n /** Minimum recording length (ms) below which the take is discarded. Default 800. */\n minDurationMs?: number\n /**\n * Maximum recording length (ms); the take is sent automatically when reached.\n * Matters most for a locked recording, which otherwise runs until the user\n * sends it. Default 600000 (10 minutes).\n */\n maxDurationMs?: number\n /**\n * Called when the microphone permission is refused. iOS never re-prompts, so\n * this is the hook for pointing the user at Settings - without it a denied\n * permission leaves the mic button silently dead.\n */\n onPermissionDenied?: () => void\n /** Called when a take is dropped for being shorter than `minDurationMs`. */\n onTooShort?: () => void\n onError?: (error: unknown) => void\n}\n\n/**\n * Record-and-send video messages from the camera. Requires the optional\n * `expo-image-picker` peer dependency; when it is absent the button is hidden.\n */\nexport interface VideoRecordingProps {\n /** As `audioRecording.isViewOnceEnabled`, for round video takes. */\n isViewOnceEnabled?: boolean\n /**\n * On by default when `react-native-vision-camera` is installed; `false` turns round video\n * off, `true` also falls back to the system camera (`expo-image-picker`) without it.\n */\n isEnabled?: boolean\n /** Max video length in seconds. Default 60. */\n maxDuration?: number\n /** Minimum video length (ms) below which the take is discarded. Default 800. */\n minDurationMs?: number\n /**\n * Called when the camera (or microphone) permission is refused, so the app can\n * point the user at Settings instead of leaving a dead button.\n */\n onPermissionDenied?: () => void\n /** Called when a take is dropped for being shorter than `minDurationMs`. */\n onTooShort?: () => void\n onError?: (error: unknown) => void\n}\n\n/**\n * How voice notes and round video notes play back in the chat: one speed\n * shared by every note, and a run of notes playing one after another.\n */\nexport interface MediaPlaybackProps {\n /**\n * When a voice or round video note plays to its end, start the next newer\n * one in the chat. Default true.\n */\n isAutoPlayNextEnabled?: boolean\n /**\n * Playback speed to start with (1, 1.5 or 2). The speed is shared by every\n * note; pair this with `onPlaybackRateChange` to keep it across launches.\n */\n playbackRate?: number\n /** Called when the user changes the playback speed on any note. */\n onPlaybackRateChange?: (rate: number) => void\n /**\n * Round video notes loop silently in the list until tapped (\"autoplay\n * videos\"). Default false: a note holds its first frame with a play\n * button, and grows when tapped.\n */\n isRoundVideoAutoplayEnabled?: boolean\n /**\n * A \"now playing\" bar at the top of the chat while a voice or round\n * note plays or is paused: play/pause, sender, speed and close. Default true.\n */\n isNowPlayingBarEnabled?: boolean\n /**\n * The floating round note: a round note still\n * playing or paused when its row scrolls out of view keeps going in a small\n * draggable circle over the list. Default true; when false, the note stops\n * with its row instead, as a voice note does.\n */\n isFloatingRoundNoteEnabled?: boolean\n /**\n * Called when an incoming voice or round note marked `isMediaUnread` starts\n * playing, so the app can mark it listened.\n */\n onMediaRead?: (message: IMessage) => void\n /**\n * The phone is held to the ear, from the app's proximity sensor. Raise to\n * listen: playback moves to the earpiece, a note under a second in\n * restarts, and lowering the phone pauses it.\n */\n isNearEar?: boolean\n /**\n * Shows a transcribe button on voice and round notes. Called on tap; the app\n * transcribes and sets `IMessage.transcription`, which is then shown.\n */\n onTranscribe?: (message: IMessage) => void\n /** A view-once note finished playing; the app should remove it. */\n onViewOnceEnd?: (message: IMessage) => void\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"Models.js","names":[],"sources":["../src/Models.ts"],"sourcesContent":["import { StyleProp, ViewStyle } from 'react-native'\nimport { IconRenderer } from './Icons'\n\nexport type Omit<T, K> = Pick<T, Exclude<keyof T, K>>\n\n/**\n * The actions the chat can put in the long-press menu by itself, in this order:\n * `reply`, `copy`, `forward`, `pin`, `edit`, `delete`.\n */\nexport type MessageActionKey = 'retry' | 'reply' | 'copy' | 'forward' | 'pin' | 'edit' | 'select' | 'delete'\n\n/** An action shown in the message long-press context menu. */\nexport interface MessageMenuItem {\n /**\n * Identifies the action. The built-in ones carry their `MessageActionKey`, so a\n * `messageActions` function can find, drop or reorder them.\n */\n key?: MessageActionKey | string\n label: string\n /** Optional leading icon, e.g. a lucide-react-native component. */\n icon?: IconRenderer\n onPress: () => void\n /** Render the label in the destructive (error) color. */\n destructive?: boolean\n}\n\nexport interface LeftRightStyle<T> {\n left?: StyleProp<T>\n right?: StyleProp<T>\n}\n\ntype renderFunction = (x: unknown) => React.ReactNode\n\nexport interface User {\n _id: string | number\n name?: string\n avatar?: string | number | renderFunction\n}\n\nexport interface Reply {\n title: string\n value: string\n messageId?: number | string\n}\n\nexport interface QuickReplies {\n type: 'radio' | 'checkbox'\n values: Reply[]\n keepIt?: boolean\n}\n\nexport interface ReplyMessage extends Pick<IMessage, '_id' | 'text' | 'user' | 'audio' | 'image'> {}\n\nexport interface MessageReaction {\n /** The emoji character (e.g. '👍') */\n emoji: string\n /** IDs of the users who reacted with this emoji */\n userIds: (string | number)[]\n}\n\n/** A document attached to a message (`IMessage.file`), drawn as a file bubble. */\nexport interface IMessageFile {\n /** Where the file is: a local `file://` path or a remote URL. */\n uri: string\n /** The file name shown in the bubble, with its extension. */\n name: string\n /** Size in bytes, shown under the name. */\n size?: number\n /** MIME type, used when the file is opened or shared. */\n mimeType?: string\n}\n\n/**\n * A web page preview for the first link in a message: a block under the text\n * (accent bar, site name, title, description, picture). Fetching it takes a request to the page,\n * so the app supplies it, on the message or through `Chat`'s `fetchLinkPreview`.\n */\nexport interface LinkPreview {\n /** The page the preview is for; a tap opens it. Defaults to the first link in the text. */\n url?: string\n /** The site's name, drawn in the accent color on top (`og:site_name`). */\n siteName?: string\n /** The page title, bold (`og:title`). */\n title?: string\n /** A few lines of the page's description (`og:description`). */\n description?: string\n /** The page's picture (`og:image`). */\n image?: string\n /** The picture's size, so it keeps its aspect ratio before it has loaded. */\n imageWidth?: number\n imageHeight?: number\n /**\n * `'large'` draws the picture full width under the text, `'small'` as a 48dp thumbnail at the\n * top right, as for articles. Default: large when the picture is wider than tall.\n */\n imageSize?: 'large' | 'small'\n}\n\nexport interface IMessage {\n _id: string | number\n text: string\n /** A Date, or a timestamp in milliseconds (as `Date.now()` gives). */\n createdAt: Date | number\n user: User\n image?: string\n /**\n * A tiny stand-in shown under `image` until it has loaded, like a blurred thumbnail:\n * a small image uri (drawn blurred), or a blurhash string when\n * `expo-image` is installed.\n */\n imagePlaceholder?: string\n video?: string\n /** Render `video` as a round video note (circular, autoplay/muted) instead of a rectangular player. */\n videoNote?: boolean\n audio?: string\n /**\n * The voice or round note has not been played by its recipient yet. Draws\n * an unread dot: on an incoming note until you play it, on an\n * outgoing one until the recipient does.\n */\n isMediaUnread?: boolean\n /**\n * A view-once voice or round note: it plays a\n * single time, then `mediaPlayback.onViewOnceEnd` lets the app remove it.\n */\n isViewOnce?: boolean\n /** Text of a transcribed voice or round note, shown under it. */\n transcription?: string\n /**\n * Length of `audio` / `video` in seconds. Set by the built-in recorders and\n * used to label a voice note before its file has been decoded, so a bubble can\n * render its duration without downloading the whole clip first.\n */\n duration?: number\n system?: boolean\n /** The message is pinned; the menu's pin action then reads \"Unpin\". */\n isPinned?: boolean\n sent?: boolean\n received?: boolean\n pending?: boolean\n /** Sending failed: the ticks give way to a red error badge. */\n isFailed?: boolean\n /** The message was edited; its time reads \"edited 14:05\". Set by `useChatMessages`'s edit. */\n isEdited?: boolean\n /** When the message was last edited; any value also shows the \"edited\" mark. */\n editedAt?: Date | number\n /** True while this message's text is still being streamed in (shows a typing cursor) */\n streaming?: boolean\n quickReplies?: QuickReplies\n replyMessage?: ReplyMessage\n reactions?: MessageReaction[]\n location?: {\n latitude: number\n longitude: number\n }\n /** A document: a file bubble (icon, name, size); a tap opens it. */\n file?: IMessageFile\n /** A preview of the first link in `text`, drawn under it. `null` hides the preview for this message. */\n linkPreview?: LinkPreview | null\n /**\n * The message's media (photo, video, file, voice or round note) is uploading or downloading.\n * Draws a progress ring with a cancel ✕ over it; a tap calls `mediaTransfer.onCancel`.\n */\n transfer?: MediaTransfer\n /**\n * The media is not on the device and is not fetched by itself: a download arrow,\n * which calls `mediaTransfer.onDownload` when tapped. Without that handler a voice note\n * downloads itself on the tap.\n */\n isDownloadRequired?: boolean\n /**\n * A voice note's waveform, as the server sends it with the note: levels in 0..1, or 5-bit\n * 0..31 values. Drawn at once, before the audio has downloaded, and resampled to the\n * bubble's bar count; without it the waveform is decoded from the audio.\n */\n waveform?: number[]\n}\n\n/** An upload or download of a message's media, `IMessage.transfer`. */\nexport interface MediaTransfer {\n /** `upload` while sending, `download` while fetching. Both draw the same ring. */\n type: 'upload' | 'download'\n /** 0..1. Leave it out while unknown: the ring then shows a 4-degree dot, still turning. */\n progress?: number\n /** The file's size in bytes: a photo or video then shows \"1.2 MB / 4.5 MB\" while it moves. */\n totalBytes?: number\n}\n\n/** Handlers for the media buttons of messages with `transfer` or `isDownloadRequired`. */\nexport interface MediaTransferProps {\n /** The download arrow was tapped: start fetching, and set `transfer` while it runs. */\n onDownload?: (message: IMessage) => void\n /** The cancel ✕ was tapped during an upload or download. */\n onCancel?: (message: IMessage) => void\n}\n\nexport type IChatMessage = IMessage\n\nexport interface MessageVideoProps<TMessage extends IMessage> {\n currentMessage: TMessage\n position?: 'left' | 'right'\n containerStyle?: StyleProp<ViewStyle>\n videoStyle?: StyleProp<ViewStyle>\n videoProps?: object\n}\n\nexport interface MessageAudioProps<TMessage extends IMessage> {\n currentMessage: TMessage\n position?: 'left' | 'right'\n containerStyle?: StyleProp<ViewStyle>\n audioStyle?: StyleProp<ViewStyle>\n audioProps?: object\n}\n\nexport interface MessageFileProps<TMessage extends IMessage> {\n currentMessage: TMessage\n position?: 'left' | 'right'\n containerStyle?: StyleProp<ViewStyle>\n /** Override opening the file (the system share sheet with `expo-sharing`, else `Linking`). */\n onPress?: (file: IMessageFile) => void\n}\n\nexport interface MessageLocationProps<TMessage extends IMessage> {\n currentMessage: TMessage\n position?: 'left' | 'right'\n containerStyle?: StyleProp<ViewStyle>\n locationStyle?: StyleProp<ViewStyle>\n /** Override the default behavior (opening the system maps app) when tapped. */\n onPress?: (location: { latitude: number, longitude: number }) => void\n}\n\n/**\n * Hold-to-record voice messages. Requires the optional\n * `expo-audio` peer dependency; when it is absent the mic button is hidden.\n */\nexport interface AudioRecordingProps {\n /**\n * Show the \"view once\" toggle above the lock while a take is locked.\n * A take sent with it on arrives in `onSend` with `isViewOnce: true`.\n */\n isViewOnceEnabled?: boolean\n /** On by default when `expo-audio` is installed; `false` hides the mic button. */\n isEnabled?: boolean\n /** Minimum recording length (ms) below which the take is discarded. Default 800. */\n minDurationMs?: number\n /**\n * Maximum recording length (ms); the take is sent automatically when reached.\n * Matters most for a locked recording, which otherwise runs until the user\n * sends it. Default 600000 (10 minutes).\n */\n maxDurationMs?: number\n /**\n * Called when the microphone permission is refused. iOS never re-prompts, so\n * this is the hook for pointing the user at Settings - without it a denied\n * permission leaves the mic button silently dead.\n */\n onPermissionDenied?: () => void\n /** Called when a take is dropped for being shorter than `minDurationMs`. */\n onTooShort?: () => void\n onError?: (error: unknown) => void\n}\n\n/**\n * Record-and-send video messages from the camera. Requires the optional\n * `expo-image-picker` peer dependency; when it is absent the button is hidden.\n */\nexport interface VideoRecordingProps {\n /** As `audioRecording.isViewOnceEnabled`, for round video takes. */\n isViewOnceEnabled?: boolean\n /**\n * On by default when `react-native-vision-camera` is installed; `false` turns round video\n * off, `true` also falls back to the system camera (`expo-image-picker`) without it.\n */\n isEnabled?: boolean\n /** Max video length in seconds. Default 60. */\n maxDuration?: number\n /** Minimum video length (ms) below which the take is discarded. Default 800. */\n minDurationMs?: number\n /**\n * Called when the camera (or microphone) permission is refused, so the app can\n * point the user at Settings instead of leaving a dead button.\n */\n onPermissionDenied?: () => void\n /** Called when a take is dropped for being shorter than `minDurationMs`. */\n onTooShort?: () => void\n onError?: (error: unknown) => void\n}\n\n/**\n * How voice notes and round video notes play back in the chat: one speed\n * shared by every note, and a run of notes playing one after another.\n */\nexport interface MediaPlaybackProps {\n /**\n * When a voice or round video note plays to its end, start the next newer\n * one in the chat. Default true.\n */\n isAutoPlayNextEnabled?: boolean\n /**\n * Playback speed to start with (1, 1.5 or 2). The speed is shared by every\n * note; pair this with `onPlaybackRateChange` to keep it across launches.\n */\n playbackRate?: number\n /** Called when the user changes the playback speed on any note. */\n onPlaybackRateChange?: (rate: number) => void\n /**\n * Round video notes loop silently in the list until tapped (\"autoplay\n * videos\"). Default false: a note holds its first frame with a play\n * button, and grows when tapped.\n */\n isRoundVideoAutoplayEnabled?: boolean\n /**\n * A \"now playing\" bar at the top of the chat while a voice or round\n * note plays or is paused: play/pause, sender, speed and close. Default true.\n */\n isNowPlayingBarEnabled?: boolean\n /**\n * The floating round note: a round note still\n * playing or paused when its row scrolls out of view keeps going in a small\n * draggable circle over the list. Default true; when false, the note stops\n * with its row instead, as a voice note does.\n */\n isFloatingRoundNoteEnabled?: boolean\n /**\n * Called when an incoming voice or round note marked `isMediaUnread` starts\n * playing, so the app can mark it listened.\n */\n onMediaRead?: (message: IMessage) => void\n /**\n * The phone is held to the ear, from the app's proximity sensor. Raise to\n * listen: playback moves to the earpiece, a note under a second in\n * restarts, and lowering the phone pauses it.\n */\n isNearEar?: boolean\n /**\n * Shows a transcribe button on voice and round notes. Called on tap; the app\n * transcribes and sets `IMessage.transcription`, which is then shown.\n */\n onTranscribe?: (message: IMessage) => void\n /** A view-once note finished playing; the app should remove it. */\n onViewOnceEnd?: (message: IMessage) => void\n}\n"],"mappings":"","ignoreList":[]}
package/lib/Send.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Send.d.ts","sourceRoot":"","sources":["../src/Send.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAA;AAC9D,OAAO,EAEL,SAAS,EACT,SAAS,EACT,SAAS,EACH,MAAM,cAAc,CAAA;AAK5B,OAAO,EAAoB,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAIvF,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AA6BnC,MAAM,WAAW,SAAS,CAAC,QAAQ,SAAS,QAAQ;IAClD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IACrC,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,uEAAuE;IACvE,yBAAyB,CAAC,EAAE,OAAO,CAAA;IACnC,sFAAsF;IACtF,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAA;IAChD,MAAM,CAAC,CACL,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,EAAE,EACjD,uBAAuB,EAAE,OAAO,GAC/B,IAAI,CAAA;CACR;AAED,eAAO,MAAM,IAAI,GAAI,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EAAE,yGAQxD,SAAS,CAAC,QAAQ,CAAC,sBAoDrB,CAAA"}
1
+ {"version":3,"file":"Send.d.ts","sourceRoot":"","sources":["../src/Send.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAA;AAC9D,OAAO,EAEL,SAAS,EACT,SAAS,EACT,SAAS,EACH,MAAM,cAAc,CAAA;AAK5B,OAAO,EAAoB,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAIvF,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AA6BnC,MAAM,WAAW,SAAS,CAAC,QAAQ,SAAS,QAAQ;IAClD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IACrC,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,uEAAuE;IACvE,yBAAyB,CAAC,EAAE,OAAO,CAAA;IACnC,sFAAsF;IACtF,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAA;IAChD,MAAM,CAAC,CACL,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,EAAE,EACjD,uBAAuB,EAAE,OAAO,GAC/B,IAAI,CAAA;CACR;AAED,eAAO,MAAM,IAAI,GAAI,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EAAE,yGAQxD,SAAS,CAAC,QAAQ,CAAC,sBAsDrB,CAAA"}
package/lib/Send.js CHANGED
@@ -72,7 +72,7 @@ const PlaneIcon = t0 => {
72
72
  return t2;
73
73
  };
74
74
  export const Send = t0 => {
75
- const $ = _c(33);
75
+ const $ = _c(34);
76
76
  const {
77
77
  text,
78
78
  containerStyle,
@@ -176,26 +176,27 @@ export const Send = t0 => {
176
176
  t10 = $[22];
177
177
  }
178
178
  let t11;
179
- if ($[23] !== canSend || $[24] !== handleOnPress || $[25] !== sendButtonProps || $[26] !== styles.touchable || $[27] !== t10 || $[28] !== t9) {
180
- t11 = <TouchableOpacity testID={TEST_ID.SEND_TOUCHABLE} style={styles.touchable} onPress={handleOnPress} enabled={canSend} accessible={true} accessibilityLabel="send" accessibilityRole="button" accessibilityState={t9} {...sendButtonProps}>{t10}</TouchableOpacity>;
179
+ if ($[23] !== canSend || $[24] !== handleOnPress || $[25] !== sendButtonProps || $[26] !== styles.button || $[27] !== styles.touchable || $[28] !== t10 || $[29] !== t9) {
180
+ t11 = <TouchableOpacity testID={TEST_ID.SEND_TOUCHABLE} style={styles.touchable} buttonStyle={styles.button} onPress={handleOnPress} enabled={canSend} accessible={true} accessibilityLabel="send" accessibilityRole="button" accessibilityState={t9} {...sendButtonProps}>{t10}</TouchableOpacity>;
181
181
  $[23] = canSend;
182
182
  $[24] = handleOnPress;
183
183
  $[25] = sendButtonProps;
184
- $[26] = styles.touchable;
185
- $[27] = t10;
186
- $[28] = t9;
187
- $[29] = t11;
184
+ $[26] = styles.button;
185
+ $[27] = styles.touchable;
186
+ $[28] = t10;
187
+ $[29] = t9;
188
+ $[30] = t11;
188
189
  } else {
189
- t11 = $[29];
190
+ t11 = $[30];
190
191
  }
191
192
  let t12;
192
- if ($[30] !== t11 || $[31] !== t7) {
193
+ if ($[31] !== t11 || $[32] !== t7) {
193
194
  t12 = <View style={t7}>{t11}</View>;
194
- $[30] = t11;
195
- $[31] = t7;
196
- $[32] = t12;
195
+ $[31] = t11;
196
+ $[32] = t7;
197
+ $[33] = t12;
197
198
  } else {
198
- t12 = $[32];
199
+ t12 = $[33];
199
200
  }
200
201
  return t12;
201
202
  };
@@ -210,6 +211,10 @@ const createStyles = theme => StyleSheet.create({
210
211
  touchable: {
211
212
  justifyContent: 'center'
212
213
  },
214
+ button: {
215
+ borderRadius: theme.sendButton.size / 2,
216
+ overflow: 'hidden'
217
+ },
213
218
  // A solid 36 circle in the accent color.
214
219
  circle: {
215
220
  width: theme.sendButton.size,
package/lib/Send.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Send.js","names":["React","useMemo","useCallback","useEffect","StyleSheet","View","Animated","useAnimatedStyle","useSharedValue","withTiming","Icon","SendIcon","TouchableOpacity","TEST_ID","useIcons","useTheme","useThemedStyles","EASE_OUT_QUINT","getSvg","svg","Svg","default","Path","PLANE","MORPH","duration","easing","PlaneIcon","t0","$","_c","color","size","icons","send","t1","t2","Send","text","containerStyle","children","isTextOptional","isSendButtonAlwaysVisible","sendButtonProps","onSend","undefined","theme","styles","createStyles","t3","trim","length","canSend","isShown","shown","t4","t5","value","circleStyle","opacity","transform","scale","t6","trimmedText","message","handleOnPress","sendButton","t7","container","t8","t9","disabled","t10","circle","circleInactive","Math","round","t11","touchable","SEND_TOUCHABLE","t12","create","minHeight","composer","minWidth","justifyContent","alignItems","width","height","borderRadius","radii","backgroundColor","colors","accent","placeholder"],"sources":["../src/Send.tsx"],"sourcesContent":["import React, { useMemo, useCallback, useEffect } from 'react'\nimport {\n StyleSheet,\n StyleProp,\n ViewStyle,\n TextStyle,\n View } from 'react-native'\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated'\n\nimport { Icon } from './components/Icon'\nimport { SendIcon } from './components/SendIcon'\nimport { TouchableOpacity, TouchableOpacityProps } from './components/TouchableOpacity'\nimport { TEST_ID } from './Constant'\nimport { useIcons } from './hooks/useIcons'\nimport { useTheme, useThemedStyles } from './hooks/useTheme'\nimport { IMessage } from './Models'\nimport { EASE_OUT_QUINT } from './motion'\nimport { getSvg } from './optional'\nimport { ChatTheme } from './Theme'\n\nconst svg = getSvg()\nconst Svg: any = svg ? svg.default ?? svg.Svg : null\nconst Path: any = svg?.Path\n\n// A solid paper plane pointing right.\nconst PLANE = 'M3.4 20.3 L21.2 12.6 a0.65 0.65 0 0 0 0 -1.2 L3.4 3.7 a0.7 0.7 0 0 0 -1 0.75 L3.9 10.6 L14.5 12 L3.9 13.4 L2.4 19.55 a0.7 0.7 0 0 0 1 0.75 Z'\n\n// The send button grows in from 0.1 as text appears and shrinks away with it, over 220ms\n// on EASE_OUT_QUINT.\nconst MORPH = { duration: 220, easing: EASE_OUT_QUINT }\n\nconst PlaneIcon = ({ color, size }: { color: string, size: number }) => {\n const icons = useIcons()\n\n if (icons.send || !(Svg && Path))\n return <Icon name='send' color={color} size={size} fallback={<SendIcon color={color} size={size} />} />\n\n return (\n <Svg width={size} height={size} viewBox='0 0 24 24'>\n <Path d={PLANE} fill={color} />\n </Svg>\n )\n}\n\nexport interface SendProps<TMessage extends IMessage> {\n text?: string\n label?: string\n containerStyle?: StyleProp<ViewStyle>\n textStyle?: StyleProp<TextStyle>\n children?: React.ReactNode\n /** Keep the send button showing even when there is nothing to send. */\n isSendButtonAlwaysVisible?: boolean\n /** Text is optional, allow sending empty messages (useful for media-only messages) */\n isTextOptional?: boolean\n sendButtonProps?: Partial<TouchableOpacityProps>\n onSend?(\n messages: Partial<TMessage> | Partial<TMessage>[],\n shouldResetInputToolbar: boolean,\n ): void\n}\n\nexport const Send = <TMessage extends IMessage = IMessage>({\n text,\n containerStyle,\n children,\n isTextOptional = false,\n isSendButtonAlwaysVisible = false,\n sendButtonProps,\n onSend,\n}: SendProps<TMessage>) => {\n const theme = useTheme()\n const styles = useThemedStyles(createStyles)\n\n const canSend = useMemo(\n () => !!text?.trim().length || isTextOptional,\n [text, isTextOptional]\n )\n\n // No greyed-out send button: it is only there while there is something to send.\n const isShown = canSend || isSendButtonAlwaysVisible\n const shown = useSharedValue(isShown ? 1 : 0)\n useEffect(() => {\n shown.value = withTiming(isShown ? 1 : 0, MORPH)\n }, [isShown, shown])\n const circleStyle = useAnimatedStyle(() => ({\n opacity: shown.value,\n transform: [{ scale: 0.1 + 0.9 * shown.value }],\n }))\n\n const handleOnPress = useCallback(() => {\n const trimmedText = text?.trim() ?? ''\n const message = { text: trimmedText } as Partial<TMessage>\n\n if (onSend && (trimmedText.length || isTextOptional))\n onSend(message, true)\n }, [text, onSend, isTextOptional])\n\n const { size } = theme.sendButton\n\n return (\n <View style={[styles.container, containerStyle]}>\n <TouchableOpacity\n testID={TEST_ID.SEND_TOUCHABLE}\n style={styles.touchable}\n onPress={handleOnPress}\n enabled={canSend}\n accessible\n accessibilityLabel='send'\n accessibilityRole='button'\n accessibilityState={{ disabled: !canSend }}\n {...sendButtonProps}\n >\n {\n children ||\n <Animated.View style={[styles.circle, !canSend && styles.circleInactive, circleStyle]}>\n <PlaneIcon color='#fff' size={Math.round(size * 0.62)} />\n </Animated.View>\n }\n </TouchableOpacity>\n </View>\n )\n}\n\nconst createStyles = (theme: ChatTheme) => StyleSheet.create({\n // A 44 cell at the island's end; the button is bottom-aligned with the last line of text.\n container: {\n minHeight: theme.composer.minHeight,\n minWidth: 44,\n justifyContent: 'center',\n alignItems: 'center',\n },\n touchable: {\n justifyContent: 'center',\n },\n // A solid 36 circle in the accent color.\n circle: {\n width: theme.sendButton.size,\n height: theme.sendButton.size,\n borderRadius: theme.radii.sendButton,\n backgroundColor: theme.colors.accent,\n alignItems: 'center',\n justifyContent: 'center',\n },\n // Shown (by `isSendButtonAlwaysVisible`) with nothing to send.\n circleInactive: {\n backgroundColor: theme.colors.placeholder,\n },\n})\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,EAAEC,WAAW,EAAEC,SAAS,QAAQ,OAAO;AAC9D,SACEC,UAAU,EAIVC,IAAI,QAAQ,cAAc;AAC5B,OAAOC,QAAQ,IAAIC,gBAAgB,EAAEC,cAAc,EAAEC,UAAU,QAAQ,yBAAyB;AAEhG,SAASC,IAAI,QAAQ,mBAAmB;AACxC,SAASC,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,gBAAgB,QAA+B,+BAA+B;AACvF,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,QAAQ,QAAQ,kBAAkB;AAC3C,SAASC,QAAQ,EAAEC,eAAe,QAAQ,kBAAkB;AAE5D,SAASC,cAAc,QAAQ,UAAU;AACzC,SAASC,MAAM,QAAQ,YAAY;AAGnC,MAAMC,GAAG,GAAGD,MAAM,CAAC,CAAC;AACpB,MAAME,GAAQ,GAAGD,GAAG,GAAGA,GAAG,CAACE,OAAO,IAAIF,GAAG,CAACC,GAAG,GAAG,IAAI;AACpD,MAAME,IAAS,GAAGH,GAAG,EAAEG,IAAI;;AAE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AhD,CAAA;EAAA;EAAA,IAAAmD,GAAA;EAAA,IAAAnD,CAAA,SAAAgD,GAAA,IAAAhD,CAAA,SAAAsC,EAAA;IAlBrBa,GAAA,IAAC,IAAI,CAAQ,KAAkC,CAAlC,CAAAb,EAAiC,CAAC,CAC7C,CAAAU,GAiBkB,CACpB,EAnBC,IAAI,CAmBE;IAAAhD,CAAA,OAAAgD,GAAA;IAAAhD,CAAA,OAAAsC,EAAA;IAAAtC,CAAA,OAAAmD,GAAA;EAAA;IAAAA,GAAA,GAAAnD,CAAA;EAAA;EAAA,OAnBPmD,GAmBO;AAAA,CAEV;AAED,MAAMhC,YAAY,GAAIF,KAAgB,IAAK1C,UAAU,CAAC6E,MAAM,CAAC;EAC3D;EACAb,SAAS,EAAE;IACTc,SAAS,EAAEpC,KAAK,CAACqC,QAAQ,CAACD,SAAS;IACnCE,QAAQ,EAAE,EAAE;IACZC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDR,SAAS,EAAE;IACTO,cAAc,EAAE;EAClB,CAAC;EACD;EACAZ,MAAM,EAAE;IACNc,KAAK,EAAEzC,KAAK,CAACoB,UAAU,CAAClC,IAAI;IAC5BwD,MAAM,EAAE1C,KAAK,CAACoB,UAAU,CAAClC,IAAI;IAC7ByD,YAAY,EAAE3C,KAAK,CAAC4C,KAAK,CAACxB,UAAU;IACpCyB,eAAe,EAAE7C,KAAK,CAAC8C,MAAM,CAACC,MAAM;IACpCP,UAAU,EAAE,QAAQ;IACpBD,cAAc,EAAE;EAClB,CAAC;EACD;EACAX,cAAc,EAAE;IACdiB,eAAe,EAAE7C,KAAK,CAAC8C,MAAM,CAACE;EAChC;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Send.js","names":["React","useMemo","useCallback","useEffect","StyleSheet","View","Animated","useAnimatedStyle","useSharedValue","withTiming","Icon","SendIcon","TouchableOpacity","TEST_ID","useIcons","useTheme","useThemedStyles","EASE_OUT_QUINT","getSvg","svg","Svg","default","Path","PLANE","MORPH","duration","easing","PlaneIcon","t0","$","_c","color","size","icons","send","t1","t2","Send","text","containerStyle","children","isTextOptional","isSendButtonAlwaysVisible","sendButtonProps","onSend","undefined","theme","styles","createStyles","t3","trim","length","canSend","isShown","shown","t4","t5","value","circleStyle","opacity","transform","scale","t6","trimmedText","message","handleOnPress","sendButton","t7","container","t8","t9","disabled","t10","circle","circleInactive","Math","round","t11","button","touchable","SEND_TOUCHABLE","t12","create","minHeight","composer","minWidth","justifyContent","alignItems","borderRadius","overflow","width","height","radii","backgroundColor","colors","accent","placeholder"],"sources":["../src/Send.tsx"],"sourcesContent":["import React, { useMemo, useCallback, useEffect } from 'react'\nimport {\n StyleSheet,\n StyleProp,\n ViewStyle,\n TextStyle,\n View } from 'react-native'\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated'\n\nimport { Icon } from './components/Icon'\nimport { SendIcon } from './components/SendIcon'\nimport { TouchableOpacity, TouchableOpacityProps } from './components/TouchableOpacity'\nimport { TEST_ID } from './Constant'\nimport { useIcons } from './hooks/useIcons'\nimport { useTheme, useThemedStyles } from './hooks/useTheme'\nimport { IMessage } from './Models'\nimport { EASE_OUT_QUINT } from './motion'\nimport { getSvg } from './optional'\nimport { ChatTheme } from './Theme'\n\nconst svg = getSvg()\nconst Svg: any = svg ? svg.default ?? svg.Svg : null\nconst Path: any = svg?.Path\n\n// A solid paper plane pointing right.\nconst PLANE = 'M3.4 20.3 L21.2 12.6 a0.65 0.65 0 0 0 0 -1.2 L3.4 3.7 a0.7 0.7 0 0 0 -1 0.75 L3.9 10.6 L14.5 12 L3.9 13.4 L2.4 19.55 a0.7 0.7 0 0 0 1 0.75 Z'\n\n// The send button grows in from 0.1 as text appears and shrinks away with it, over 220ms\n// on EASE_OUT_QUINT.\nconst MORPH = { duration: 220, easing: EASE_OUT_QUINT }\n\nconst PlaneIcon = ({ color, size }: { color: string, size: number }) => {\n const icons = useIcons()\n\n if (icons.send || !(Svg && Path))\n return <Icon name='send' color={color} size={size} fallback={<SendIcon color={color} size={size} />} />\n\n return (\n <Svg width={size} height={size} viewBox='0 0 24 24'>\n <Path d={PLANE} fill={color} />\n </Svg>\n )\n}\n\nexport interface SendProps<TMessage extends IMessage> {\n text?: string\n label?: string\n containerStyle?: StyleProp<ViewStyle>\n textStyle?: StyleProp<TextStyle>\n children?: React.ReactNode\n /** Keep the send button showing even when there is nothing to send. */\n isSendButtonAlwaysVisible?: boolean\n /** Text is optional, allow sending empty messages (useful for media-only messages) */\n isTextOptional?: boolean\n sendButtonProps?: Partial<TouchableOpacityProps>\n onSend?(\n messages: Partial<TMessage> | Partial<TMessage>[],\n shouldResetInputToolbar: boolean,\n ): void\n}\n\nexport const Send = <TMessage extends IMessage = IMessage>({\n text,\n containerStyle,\n children,\n isTextOptional = false,\n isSendButtonAlwaysVisible = false,\n sendButtonProps,\n onSend,\n}: SendProps<TMessage>) => {\n const theme = useTheme()\n const styles = useThemedStyles(createStyles)\n\n const canSend = useMemo(\n () => !!text?.trim().length || isTextOptional,\n [text, isTextOptional]\n )\n\n // No greyed-out send button: it is only there while there is something to send.\n const isShown = canSend || isSendButtonAlwaysVisible\n const shown = useSharedValue(isShown ? 1 : 0)\n useEffect(() => {\n shown.value = withTiming(isShown ? 1 : 0, MORPH)\n }, [isShown, shown])\n const circleStyle = useAnimatedStyle(() => ({\n opacity: shown.value,\n transform: [{ scale: 0.1 + 0.9 * shown.value }],\n }))\n\n const handleOnPress = useCallback(() => {\n const trimmedText = text?.trim() ?? ''\n const message = { text: trimmedText } as Partial<TMessage>\n\n if (onSend && (trimmedText.length || isTextOptional))\n onSend(message, true)\n }, [text, onSend, isTextOptional])\n\n const { size } = theme.sendButton\n\n return (\n <View style={[styles.container, containerStyle]}>\n <TouchableOpacity\n testID={TEST_ID.SEND_TOUCHABLE}\n style={styles.touchable}\n // Android's press ripple takes the button's shape: the circle, not its square box\n buttonStyle={styles.button}\n onPress={handleOnPress}\n enabled={canSend}\n accessible\n accessibilityLabel='send'\n accessibilityRole='button'\n accessibilityState={{ disabled: !canSend }}\n {...sendButtonProps}\n >\n {\n children ||\n <Animated.View style={[styles.circle, !canSend && styles.circleInactive, circleStyle]}>\n <PlaneIcon color='#fff' size={Math.round(size * 0.62)} />\n </Animated.View>\n }\n </TouchableOpacity>\n </View>\n )\n}\n\nconst createStyles = (theme: ChatTheme) => StyleSheet.create({\n // A 44 cell at the island's end; the button is bottom-aligned with the last line of text.\n container: {\n minHeight: theme.composer.minHeight,\n minWidth: 44,\n justifyContent: 'center',\n alignItems: 'center',\n },\n touchable: {\n justifyContent: 'center',\n },\n button: {\n borderRadius: theme.sendButton.size / 2,\n overflow: 'hidden',\n },\n // A solid 36 circle in the accent color.\n circle: {\n width: theme.sendButton.size,\n height: theme.sendButton.size,\n borderRadius: theme.radii.sendButton,\n backgroundColor: theme.colors.accent,\n alignItems: 'center',\n justifyContent: 'center',\n },\n // Shown (by `isSendButtonAlwaysVisible`) with nothing to send.\n circleInactive: {\n backgroundColor: theme.colors.placeholder,\n },\n})\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,EAAEC,WAAW,EAAEC,SAAS,QAAQ,OAAO;AAC9D,SACEC,UAAU,EAIVC,IAAI,QAAQ,cAAc;AAC5B,OAAOC,QAAQ,IAAIC,gBAAgB,EAAEC,cAAc,EAAEC,UAAU,QAAQ,yBAAyB;AAEhG,SAASC,IAAI,QAAQ,mBAAmB;AACxC,SAASC,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,gBAAgB,QAA+B,+BAA+B;AACvF,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,QAAQ,QAAQ,kBAAkB;AAC3C,SAASC,QAAQ,EAAEC,eAAe,QAAQ,kBAAkB;AAE5D,SAASC,cAAc,QAAQ,UAAU;AACzC,SAASC,MAAM,QAAQ,YAAY;AAGnC,MAAMC,GAAG,GAAGD,MAAM,CAAC,CAAC;AACpB,MAAME,GAAQ,GAAGD,GAAG,GAA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