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

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 +36 -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":"useActionsFragment.js","names":["React","useCallback","useMemo","Actions","AttachmentButton","resolveAttachments","getAttachmentTabs","renderComponentOrElement","useActionsFragment","props","closeEmoji","$","_c","renderActions","onPressActionButton","actions","actionSheetOptionTintColor","icon","wrapperStyle","containerStyle","attachmentsProp","attachments","t0","attachmentsConfig","requestedTabs","tabs","hasAttachments","t1","join","requestedTabsId","t2","bb0","t3","Symbol","for","undefined","split","filter","Boolean","attachmentTabs","onSendProp","onSend","messages","shouldReset","onSendForAttachments","t4","bb1","actionsProps","length","t5"],"sources":["../../src/InputToolbar/useActionsFragment.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from 'react'\n\nimport { Actions } from '../Actions'\nimport { AttachmentButton, resolveAttachments } from '../attachments/AttachmentButton'\nimport { getAttachmentTabs } from '../attachments/buildMessages'\nimport { AttachmentTab } from '../attachments/types'\nimport { IMessage } from '../Models'\nimport { renderComponentOrElement } from '../utils'\nimport { InputToolbarProps, OnSend } from './types'\n\n/** The control behind the paperclip: custom actions, the legacy sheet, or the attachment menu. */\nexport function useActionsFragment<TMessage extends IMessage> (\n props: InputToolbarProps<TMessage>,\n closeEmoji: () => void\n) {\n const {\n renderActions,\n onPressActionButton,\n actions,\n actionSheetOptionTintColor,\n icon,\n wrapperStyle,\n containerStyle,\n } = props\n\n // The built-in attachment menu, behind the paperclip when no legacy `actions` are given.\n const attachmentsProp = props.attachments\n const attachmentsConfig = useMemo(() => resolveAttachments<TMessage>(attachmentsProp), [attachmentsProp])\n const requestedTabs = attachmentsConfig?.tabs\n const hasAttachments = !!attachmentsConfig\n // Keyed by the tab list, not its identity: an inline array would rebuild the menu every render.\n const requestedTabsId = requestedTabs?.join(',')\n const attachmentTabs = useMemo(() => {\n if (!hasAttachments)\n return []\n return getAttachmentTabs(requestedTabsId === undefined\n ? undefined\n : requestedTabsId.split(',').filter(Boolean) as AttachmentTab[])\n }, [hasAttachments, requestedTabsId])\n const onSendProp = (props as { onSend?: OnSend<TMessage> }).onSend\n const onSendForAttachments = useCallback((messages: Partial<TMessage>[], shouldReset: boolean) => {\n onSendProp?.(messages, shouldReset)\n }, [onSendProp])\n\n return useMemo(() => {\n const actionsProps = {\n onPressActionButton,\n actions,\n actionSheetOptionTintColor,\n icon,\n wrapperStyle,\n containerStyle,\n }\n\n if (renderActions)\n return renderComponentOrElement(renderActions, actionsProps)\n\n if (onPressActionButton || actions?.length)\n return <Actions {...actionsProps} />\n\n if (attachmentsConfig && attachmentTabs.length > 0)\n return (\n <AttachmentButton<TMessage>\n tabs={attachmentTabs}\n config={attachmentsConfig}\n onSend={onSendForAttachments}\n onOpen={closeEmoji}\n icon={icon}\n wrapperStyle={wrapperStyle}\n />\n )\n\n return null\n }, [\n renderActions,\n onPressActionButton,\n actions,\n actionSheetOptionTintColor,\n icon,\n wrapperStyle,\n containerStyle,\n attachmentsConfig,\n attachmentTabs,\n onSendForAttachments,\n closeEmoji,\n ])\n}\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAEnD,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,gBAAgB,EAAEC,kBAAkB,QAAQ,iCAAiC;AACtF,SAASC,iBAAiB,QAAQ,8BAA8B;AAGhE,SAASC,wBAAwB,QAAQ,UAAU;AAGnD;AACA,OAAO,SAAAC,mBAAAC,KAAA,EAAAC,UAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EAIL;IAAAC,aAAA;IAAAC,mBAAA;IAAAC,OAAA;IAAAC,0BAAA;IAAAC,IAAA;IAAAC,YAAA;IAAAC;EAAA,IAQIV,KAAK;EAGT,MAAAW,eAAA,GAAwBX,KAAK,CAAAY,WAAY;EAAA,IAAAC,EAAA;EAAA,IAAAX,CAAA,QAAAS,eAAA;IACDE,EAAA,GAAAjB,kBAAkB,CAAWe,eAAe,CAAC;IAAAT,CAAA,MAAAS,eAAA;IAAAT,CAAA,MAAAW,EAAA;EAAA;IAAAA,EAAA,GAAAX,CAAA;EAAA;EAArF,MAAAY,iBAAA,GAAwCD,EAA6C;EACrF,MAAAE,aAAA,GAAsBD,iBAAiB,EAAAE,IAAM;EAC7C,MAAAC,cAAA,GAAuB,CAAC,CAACH,iBAAiB;EAAA,IAAAI,EAAA;EAAA,IAAAhB,CAAA,QAAAa,aAAA;IAElBG,EAAA,GAAAH,aAAa,EAAAI,IAAW,CAAJ,GAAG,CAAC;IAAAjB,CAAA,MAAAa,aAAA;IAAAb,CAAA,MAAAgB,EAAA;EAAA;IAAAA,EAAA,GAAAhB,CAAA;EAAA;EAAhD,MAAAkB,eAAA,GAAwBF,EAAwB;EAAA,IAAAG,EAAA;EAAAC,GAAA;IAE9C,IAAI,CAACL,cAAc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P,CAAA,OAAAsC,EAAA;QAAA;UAAAA,EAAA,GAAAtC,CAAA;QAAA;QARJkC,EAAA,GACEI,EAOE;QARJ,MAAAH,GAAA;MASC;MAEHD,EAAA,GAAO,IAAI;IAAA;IAAAlC,CAAA,MAAAK,0BAAA;IAAAL,CAAA,OAAAI,OAAA;IAAAJ,CAAA,OAAA4B,cAAA;IAAA5B,CAAA,OAAAY,iBAAA;IAAAZ,CAAA,OAAAD,UAAA;IAAAC,CAAA,OAAAQ,cAAA;IAAAR,CAAA,OAAAM,IAAA;IAAAN,CAAA,OAAAG,mBAAA;IAAAH,CAAA,OAAAiC,oBAAA;IAAAjC,CAAA,OAAAE,aAAA;IAAAF,CAAA,OAAAO,YAAA;IAAAP,CAAA,OAAAkC,EAAA;EAAA;IAAAA,EAAA,GAAAlC,CAAA;EAAA;EAAA,OA5BNkC,EAyCL;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"useActionsFragment.js","names":["React","useCallback","useMemo","Actions","AttachmentButton","resolveAttachments","getAttachmentTabs","renderComponentOrElement","useActionsFragment","props","closeEmoji","$","_c","renderActions","onPressActionButton","actions","actionSheetOptionTintColor","icon","wrapperStyle","containerStyle","attachmentsProp","attachments","t0","attachmentsConfig","requestedTabs","tabs","hasAttachments","t1","join","requestedTabsId","pickers","t2","Symbol","for","t3","filter","tab","customPickersId","isGalleryGridEnabled","t4","bb0","t5","custom","Object","fromEntries","split","Boolean","map","_temp","undefined","attachmentTabs","onSendProp","onSend","messages","shouldReset","onSendForAttachments","t6","bb1","actionsProps","length","t7","tab_0"],"sources":["../../src/InputToolbar/useActionsFragment.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from 'react'\n\nimport { Actions } from '../Actions'\nimport { AttachmentButton, resolveAttachments } from '../attachments/AttachmentButton'\nimport { getAttachmentTabs } from '../attachments/buildMessages'\nimport { AttachmentTab } from '../attachments/types'\nimport { IMessage } from '../Models'\nimport { renderComponentOrElement } from '../utils'\nimport { InputToolbarProps, OnSend } from './types'\n\n/** The control behind the paperclip: custom actions, the legacy sheet, or the attachment menu. */\nexport function useActionsFragment<TMessage extends IMessage> (\n props: InputToolbarProps<TMessage>,\n closeEmoji: () => void\n) {\n const {\n renderActions,\n onPressActionButton,\n actions,\n actionSheetOptionTintColor,\n icon,\n wrapperStyle,\n containerStyle,\n } = props\n\n // The built-in attachment menu, behind the paperclip when no legacy `actions` are given.\n const attachmentsProp = props.attachments\n const attachmentsConfig = useMemo(() => resolveAttachments<TMessage>(attachmentsProp), [attachmentsProp])\n const requestedTabs = attachmentsConfig?.tabs\n const hasAttachments = !!attachmentsConfig\n // Keyed by the tab list, not its identity: an inline array would rebuild the menu every render.\n const requestedTabsId = requestedTabs?.join(',')\n // Which tabs have the app's own picker, as a key for the same reason.\n const pickers = attachmentsConfig?.pickers\n const customPickersId = (['gallery', 'camera', 'file'] as const).filter(tab => !!pickers?.[tab]).join(',')\n const isGalleryGridEnabled = attachmentsConfig?.isGalleryGridEnabled !== false\n const attachmentTabs = useMemo(() => {\n if (!hasAttachments)\n return []\n const custom = Object.fromEntries(customPickersId.split(',').filter(Boolean).map(tab => [tab, true]))\n return getAttachmentTabs(requestedTabsId === undefined\n ? undefined\n : requestedTabsId.split(',').filter(Boolean) as AttachmentTab[], custom, isGalleryGridEnabled)\n }, [hasAttachments, requestedTabsId, customPickersId, isGalleryGridEnabled])\n const onSendProp = (props as { onSend?: OnSend<TMessage> }).onSend\n const onSendForAttachments = useCallback((messages: Partial<TMessage>[], shouldReset: boolean) => {\n onSendProp?.(messages, shouldReset)\n }, [onSendProp])\n\n return useMemo(() => {\n const actionsProps = {\n onPressActionButton,\n actions,\n actionSheetOptionTintColor,\n icon,\n wrapperStyle,\n containerStyle,\n }\n\n if (renderActions)\n return renderComponentOrElement(renderActions, actionsProps)\n\n if (onPressActionButton || actions?.length)\n return <Actions {...actionsProps} />\n\n if (attachmentsConfig && attachmentTabs.length > 0)\n return (\n <AttachmentButton<TMessage>\n tabs={attachmentTabs}\n config={attachmentsConfig}\n onSend={onSendForAttachments}\n onOpen={closeEmoji}\n icon={icon}\n wrapperStyle={wrapperStyle}\n />\n )\n\n return null\n }, [\n renderActions,\n onPressActionButton,\n actions,\n actionSheetOptionTintColor,\n icon,\n wrapperStyle,\n containerStyle,\n attachmentsConfig,\n attachmentTabs,\n onSendForAttachments,\n closeEmoji,\n ])\n}\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAEnD,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,gBAAgB,EAAEC,kBAAkB,QAAQ,iCAAiC;AACtF,SAASC,iBAAiB,QAAQ,8BAA8B;AAGhE,SAASC,wBAAwB,QAAQ,UAAU;AAGnD;AACA,OAAO,SAAAC,mBAAAC,KAAA,EAAAC,UAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EAIL;IAAAC,aAAA;IAAAC,mBAAA;IAAAC,OAAA;IAAAC,0BAAA;IAAAC,IAAA;IAAAC,YAAA;IAAAC;EAAA,IAQIV,KAAK;EAGT,MAAAW,eAAA,GAAwBX,KAAK,CAAAY,WAAY;EAAA,IAAAC,EAAA;EAAA,IAAAX,CAAA,QAAAS,eAAA;IACDE,EAAA,GAAAjB,kBAAkB,CAAWe,eAAe,CAAC;IAAAT,CAAA,MAAAS,eAAA;IAAAT,CAAA,MAAAW,EAAA;EAAA;IAAAA,EAAA,GAAAX,CAAA;EAAA;EAArF,MAAAY,iBAAA,GAAwCD,EAA6C;EACrF,MAAAE,aAAA,GAAsBD,iBAAiB,EAAAE,IAAM;EAC7C,MAAAC,cAAA,GAAuB,CAAC,CAACH,iBAAiB;EAAA,IAAAI,EAAA;EAAA,IAAAhB,CAAA,QAAAa,aAAA;IAElBG,EAAA,GAAAH,aAAa,EAAAI,IAAW,CAAJ,GAAG,CAAC;IAAAjB,CAAA,MAAAa,aAAA;IAAAb,CAAA,MAAAgB,EAAA;EAAA;IAAAA,EAAA,GAAAhB,CAAA;EAAA;EAA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,CAAA,OAAAI,OAAA;IAAAJ,CAAA,OAAAuC,cAAA;IAAAvC,CAAA,OAAAY,iBAAA;IAAAZ,CAAA,OAAAD,UAAA;IAAAC,CAAA,OAAAQ,cAAA;IAAAR,CAAA,OAAAM,IAAA;IAAAN,CAAA,OAAAG,mBAAA;IAAAH,CAAA,OAAA4C,oBAAA;IAAA5C,CAAA,OAAAE,aAAA;IAAAF,CAAA,OAAAO,YAAA;IAAAP,CAAA,OAAA6C,EAAA;EAAA;IAAAA,EAAA,GAAA7C,CAAA;EAAA;EAAA,OA5BN6C,EAyCL;AAAA;AA/EG,SAAAR,MAAAa,KAAA;EAAA,OA4BqF,CAACzB,KAAG,EAAE,IAAI,CAAC;AAAA","ignoreList":[]}
@@ -3,7 +3,7 @@ import { SharedValue } from 'react-native-reanimated';
3
3
  * The toolbar's bottom padding: the home indicator's inset, given up as the keyboard or the
4
4
  * emoji panel (`emojiOpen`) covers it.
5
5
  */
6
- export declare function useKeyboardInset(emojiOpen: SharedValue<number>): import("react-native-reanimated/lib/typescript/hook/commonTypes").AnimatedStyleHandle<{
6
+ export declare function useKeyboardInset(emojiOpen: SharedValue<number>, bottomInsetProp?: number): import("react-native-reanimated/lib/typescript/hook/commonTypes").AnimatedStyleHandle<{
7
7
  paddingBottom: number;
8
8
  }>;
9
9
  //# sourceMappingURL=useKeyboardInset.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useKeyboardInset.d.ts","sourceRoot":"","sources":["../../src/InputToolbar/useKeyboardInset.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAoC,MAAM,yBAAyB,CAAA;AAKvF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAE,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC;;GAqB/D"}
1
+ {"version":3,"file":"useKeyboardInset.d.ts","sourceRoot":"","sources":["../../src/InputToolbar/useKeyboardInset.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAoC,MAAM,yBAAyB,CAAA;AAKvF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAE,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC,EAAE,MAAM;;GAqBzF"}
@@ -7,13 +7,13 @@ import { useTheme } from '../hooks/useTheme';
7
7
  * The toolbar's bottom padding: the home indicator's inset, given up as the keyboard or the
8
8
  * emoji panel (`emojiOpen`) covers it.
9
9
  */
10
- export function useKeyboardInset(emojiOpen) {
10
+ export function useKeyboardInset(emojiOpen, bottomInsetProp) {
11
11
  const theme = useTheme();
12
12
  const insets = useSafeAreaInsets();
13
13
  const keyboard = useReanimatedKeyboardAnimation();
14
14
  const noKeyboard = useSharedValue(0);
15
15
  const keyboardHeight = keyboard?.height ?? noKeyboard;
16
- const bottomInset = insets.bottom;
16
+ const bottomInset = bottomInsetProp ?? insets.bottom;
17
17
  const bottomGap = theme.spacing.inputToolbarPaddingV;
18
18
  return useAnimatedStyle(() => {
19
19
  const covered = bottomInset > 0 ? Math.min(1, Math.max(0, -keyboardHeight.value / bottomInset)) : 1;
@@ -1 +1 @@
1
- {"version":3,"file":"useKeyboardInset.js","names":["useReanimatedKeyboardAnimation","useAnimatedStyle","useSharedValue","useSafeAreaInsets","useTheme","useKeyboardInset","emojiOpen","theme","insets","keyboard","noKeyboard","keyboardHeight","height","bottomInset","bottom","bottomGap","spacing","inputToolbarPaddingV","covered","Math","min","max","value","paddingBottom"],"sources":["../../src/InputToolbar/useKeyboardInset.ts"],"sourcesContent":["import { useReanimatedKeyboardAnimation } from 'react-native-keyboard-controller'\nimport { SharedValue, useAnimatedStyle, useSharedValue } from 'react-native-reanimated'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\n\nimport { useTheme } from '../hooks/useTheme'\n\n/**\n * The toolbar's bottom padding: the home indicator's inset, given up as the keyboard or the\n * emoji panel (`emojiOpen`) covers it.\n */\nexport function useKeyboardInset (emojiOpen: SharedValue<number>) {\n const theme = useTheme()\n const insets = useSafeAreaInsets()\n\n // The island floats 9 above the home indicator (`INPUT_BUBBLE_BOTTOM`), and 9 above the\n // keyboard once it covers the indicator: the inset fades out with the keyboard's progress.\n const keyboard = useReanimatedKeyboardAnimation()\n const noKeyboard = useSharedValue(0)\n // Guarded for mocks that return nothing.\n const keyboardHeight = keyboard?.height ?? noKeyboard\n const bottomInset = insets.bottom\n const bottomGap = theme.spacing.inputToolbarPaddingV\n // Driven by how much of the inset the keyboard actually covers, not by its progress: a\n // floating or split keyboard on Android (or a hardware keyboard's suggestion strip) reports\n // full progress at a height of 0-ish, and the toolbar then dropped onto the gesture bar.\n return useAnimatedStyle(() => {\n const covered = bottomInset > 0 ? Math.min(1, Math.max(0, -keyboardHeight.value / bottomInset)) : 1\n return {\n paddingBottom: bottomGap + bottomInset * (1 - Math.min(1, Math.max(covered, emojiOpen.value))),\n }\n })\n}\n"],"mappings":"AAAA,SAASA,8BAA8B,QAAQ,kCAAkC;AACjF,SAAsBC,gBAAgB,EAAEC,cAAc,QAAQ,yBAAyB;AACvF,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,SAASC,QAAQ,QAAQ,mBAAmB;;AAE5C;AACA;AACA;AACA;AACA,OAAO,SAAAC,iBAAAC,SAAA;EACL,MAAAC,KAAA,GAAcH,QAAQ,CAAC,CAAC;EACxB,MAAAI,MAAA,GAAeL,iBAAiB,CAAC,CAAC;EAIlC,MAAAM,QAAA,GAAiBT,8BAA8B,CAAC,CAAC;EACjD,MAAAU,UAAA,GAAmBR,cAAc,CAAC,CAAC,CAAC;EAEpC,MAAAS,cAAA,GAAuBF,QAAQ,EAAAG,MAAsB,IAA9BF,UAA8B;EACrD,MAAAG,WAAA,GAAoBL,MAAM,CAAAM,MAAO;EACjC,MAAAC,SAAA,GAAkBR,KAAK,CAAAS,OAAQ,CAAAC,oBAAqB;EAAA,OAI7ChB,gBAAgB,CAAC;IACtB,MAAAiB,OAAA,GAAgBL,WAAW,GAAG,CAAqE,GAAjEM,IAAI,CAAAC,GAAI,CAAC,CAAC,EAAED,IAAI,CAAAE,GAAI,CAAC,CAAC,EAAE,CAACV,cAAc,CAAAW,KAAM,GAAGT,WAAW,CAAK,CAAC,GAAnF,CAAmF;IAAA,OAC5F;MAAAU,aAAA,EACUR,SAAS,GAAGF,WAAW,IAAI,CAAC,GAAGM,IAAI,CAAAC,GAAI,CAAC,CAAC,EAAED,IAAI,CAAAE,GAAI,CAACH,OAAO,EAAEZ,SAAS,CAAAgB,KAAM,CAAC,CAAC;IAC/F,CAAC;EAAA,CACF,CAAC;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"useKeyboardInset.js","names":["useReanimatedKeyboardAnimation","useAnimatedStyle","useSharedValue","useSafeAreaInsets","useTheme","useKeyboardInset","emojiOpen","bottomInsetProp","theme","insets","keyboard","noKeyboard","keyboardHeight","height","bottomInset","bottom","bottomGap","spacing","inputToolbarPaddingV","covered","Math","min","max","value","paddingBottom"],"sources":["../../src/InputToolbar/useKeyboardInset.ts"],"sourcesContent":["import { useReanimatedKeyboardAnimation } from 'react-native-keyboard-controller'\nimport { SharedValue, useAnimatedStyle, useSharedValue } from 'react-native-reanimated'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\n\nimport { useTheme } from '../hooks/useTheme'\n\n/**\n * The toolbar's bottom padding: the home indicator's inset, given up as the keyboard or the\n * emoji panel (`emojiOpen`) covers it.\n */\nexport function useKeyboardInset (emojiOpen: SharedValue<number>, bottomInsetProp?: number) {\n const theme = useTheme()\n const insets = useSafeAreaInsets()\n\n // The island floats 9 above the home indicator (`INPUT_BUBBLE_BOTTOM`), and 9 above the\n // keyboard once it covers the indicator: the inset fades out with the keyboard's progress.\n const keyboard = useReanimatedKeyboardAnimation()\n const noKeyboard = useSharedValue(0)\n // Guarded for mocks that return nothing.\n const keyboardHeight = keyboard?.height ?? noKeyboard\n const bottomInset = bottomInsetProp ?? insets.bottom\n const bottomGap = theme.spacing.inputToolbarPaddingV\n // Driven by how much of the inset the keyboard actually covers, not by its progress: a\n // floating or split keyboard on Android (or a hardware keyboard's suggestion strip) reports\n // full progress at a height of 0-ish, and the toolbar then dropped onto the gesture bar.\n return useAnimatedStyle(() => {\n const covered = bottomInset > 0 ? Math.min(1, Math.max(0, -keyboardHeight.value / bottomInset)) : 1\n return {\n paddingBottom: bottomGap + bottomInset * (1 - Math.min(1, Math.max(covered, emojiOpen.value))),\n }\n })\n}\n"],"mappings":"AAAA,SAASA,8BAA8B,QAAQ,kCAAkC;AACjF,SAAsBC,gBAAgB,EAAEC,cAAc,QAAQ,yBAAyB;AACvF,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,SAASC,QAAQ,QAAQ,mBAAmB;;AAE5C;AACA;AACA;AACA;AACA,OAAO,SAAAC,iBAAAC,SAAA,EAAAC,eAAA;EACL,MAAAC,KAAA,GAAcJ,QAAQ,CAAC,CAAC;EACxB,MAAAK,MAAA,GAAeN,iBAAiB,CAAC,CAAC;EAIlC,MAAAO,QAAA,GAAiBV,8BAA8B,CAAC,CAAC;EACjD,MAAAW,UAAA,GAAmBT,cAAc,CAAC,CAAC,CAAC;EAEpC,MAAAU,cAAA,GAAuBF,QAAQ,EAAAG,MAAsB,IAA9BF,UAA8B;EACrD,MAAAG,WAAA,GAAoBP,eAAgC,IAAbE,MAAM,CAAAM,MAAO;EACpD,MAAAC,SAAA,GAAkBR,KAAK,CAAAS,OAAQ,CAAAC,oBAAqB;EAAA,OAI7CjB,gBAAgB,CAAC;IACtB,MAAAkB,OAAA,GAAgBL,WAAW,GAAG,CAAqE,GAAjEM,IAAI,CAAAC,GAAI,CAAC,CAAC,EAAED,IAAI,CAAAE,GAAI,CAAC,CAAC,EAAE,CAACV,cAAc,CAAAW,KAAM,GAAGT,WAAW,CAAK,CAAC,GAAnF,CAAmF;IAAA,OAC5F;MAAAU,aAAA,EACUR,SAAS,GAAGF,WAAW,IAAI,CAAC,GAAGM,IAAI,CAAAC,GAAI,CAAC,CAAC,EAAED,IAAI,CAAAE,GAAI,CAACH,OAAO,EAAEb,SAAS,CAAAi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B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,QAAQ,KACX,IAAI,CAAA;IAET,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAA;IACxB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,6HAA6H;IAC7H,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACvC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,wBAAgB,WAAW,CAAC,QAAQ,SAAS,QAAQ,EAAE,EACrD,cAAc,EACd,QAAiB,EACjB,cAAc,EACd,SAAS,EACT,SAAS,EAAE,aAAa,EACxB,eAAe,EACf,OAAO,EAAE,WAAW,EACpB,QAAQ,EACR,KAAY,EACZ,KAAY,EACZ,GAAU,EACV,OAAe,EACf,OAAe,EACf,UAAU,EACV,UAAU,EACV,WAAmB,EACnB,QAAQ,EACR,aAAa,EACb,QAAQ,GACT,EAAE,gBAAgB,CAAC,QAAQ,CAAC,qBA6G5B"}
@@ -4,10 +4,11 @@ import { StyleSheet, View, Text } from 'react-native';
4
4
  import { BasicMarkdown } from './components/BasicMarkdown';
5
5
  import { MarkdownMessageText, canUseStreamdown } from './components/MarkdownMessageText';
6
6
  import { StreamingCursor } from './components/StreamingCursor';
7
+ import { useTextHighlight } from './components/textHighlight';
7
8
  import { useThemedStyles } from './hooks/useTheme';
8
9
  import { LinkParser } from './linkParser';
9
10
  export function MessageText(t0) {
10
- const $ = _c(77);
11
+ const $ = _c(79);
11
12
  const {
12
13
  currentMessage,
13
14
  position: t1,
@@ -37,6 +38,7 @@ export function MessageText(t0) {
37
38
  const mention = t6 === undefined ? false : t6;
38
39
  const stripPrefix = t7 === undefined ? false : t7;
39
40
  const styles = useThemedStyles(createStyles);
41
+ const highlight = useTextHighlight();
40
42
  let t8;
41
43
  if ($[0] !== linkStyleProp || $[1] !== position || $[2] !== styles) {
42
44
  t8 = StyleSheet.flatten([styles.link, styles[`link_${position}`], linkStyleProp?.[position]]);
@@ -187,10 +189,12 @@ export function MessageText(t0) {
187
189
  }
188
190
  return t21;
189
191
  }
190
- const t14 = onPressProp ? handlePress : undefined;
191
- let t15;
192
- if ($[52] !== currentMessage.text || $[53] !== email || $[54] !== hashtag || $[55] !== hashtagUrl || $[56] !== linkStyle || $[57] !== matchers || $[58] !== mention || $[59] !== mentionUrl || $[60] !== phone || $[61] !== stripPrefix || $[62] !== style || $[63] !== t14 || $[64] !== url) {
193
- t15 = <LinkParser text={currentMessage.text} matchers={matchers} email={email} phone={phone} url={url} hashtag={hashtag} mention={mention} hashtagUrl={hashtagUrl} mentionUrl={mentionUrl} stripPrefix={stripPrefix} linkStyle={linkStyle} textStyle={style} onPress={t14} TextComponent={Text} />;
192
+ const t14 = highlight?.text;
193
+ const t15 = highlight?.style;
194
+ const t16 = onPressProp ? handlePress : undefined;
195
+ let t17;
196
+ if ($[52] !== currentMessage.text || $[53] !== email || $[54] !== hashtag || $[55] !== hashtagUrl || $[56] !== linkStyle || $[57] !== matchers || $[58] !== mention || $[59] !== mentionUrl || $[60] !== phone || $[61] !== stripPrefix || $[62] !== style || $[63] !== t14 || $[64] !== t15 || $[65] !== t16 || $[66] !== url) {
197
+ t17 = <LinkParser text={currentMessage.text} matchers={matchers} email={email} phone={phone} url={url} hashtag={hashtag} mention={mention} hashtagUrl={hashtagUrl} mentionUrl={mentionUrl} stripPrefix={stripPrefix} linkStyle={linkStyle} textStyle={style} highlight={t14} highlightStyle={t15} onPress={t16} TextComponent={Text} />;
194
198
  $[52] = currentMessage.text;
195
199
  $[53] = email;
196
200
  $[54] = hashtag;
@@ -203,43 +207,45 @@ export function MessageText(t0) {
203
207
  $[61] = stripPrefix;
204
208
  $[62] = style;
205
209
  $[63] = t14;
206
- $[64] = url;
207
- $[65] = t15;
210
+ $[64] = t15;
211
+ $[65] = t16;
212
+ $[66] = url;
213
+ $[67] = t17;
208
214
  } else {
209
- t15 = $[65];
215
+ t17 = $[67];
210
216
  }
211
- const parsed = t15;
212
- const t16 = containerStyle?.[position];
213
- let t17;
214
- if ($[66] !== styles.container || $[67] !== t16) {
215
- t17 = [styles.container, t16];
216
- $[66] = styles.container;
217
- $[67] = t16;
218
- $[68] = t17;
217
+ const parsed = t17;
218
+ const t18 = containerStyle?.[position];
219
+ let t19;
220
+ if ($[68] !== styles.container || $[69] !== t18) {
221
+ t19 = [styles.container, t18];
222
+ $[68] = styles.container;
223
+ $[69] = t18;
224
+ $[70] = t19;
219
225
  } else {
220
- t17 = $[68];
226
+ t19 = $[70];
221
227
  }
222
- let t18;
223
- if ($[69] !== isStreaming || $[70] !== parsed || $[71] !== style || $[72] !== trailing) {
224
- t18 = isStreaming || trailing ? <Text style={style}>{parsed}{isStreaming && <StreamingCursor />}{trailing}</Text> : parsed;
225
- $[69] = isStreaming;
226
- $[70] = parsed;
227
- $[71] = style;
228
- $[72] = trailing;
229
- $[73] = t18;
228
+ let t20;
229
+ if ($[71] !== isStreaming || $[72] !== parsed || $[73] !== style || $[74] !== trailing) {
230
+ t20 = isStreaming || trailing ? <Text style={style}>{parsed}{isStreaming && <StreamingCursor />}{trailing}</Text> : parsed;
231
+ $[71] = isStreaming;
232
+ $[72] = parsed;
233
+ $[73] = style;
234
+ $[74] = trailing;
235
+ $[75] = t20;
230
236
  } else {
231
- t18 = $[73];
237
+ t20 = $[75];
232
238
  }
233
- let t19;
234
- if ($[74] !== t17 || $[75] !== t18) {
235
- t19 = <View style={t17}>{t18}</View>;
236
- $[74] = t17;
237
- $[75] = t18;
239
+ let t21;
240
+ if ($[76] !== t19 || $[77] !== t20) {
241
+ t21 = <View style={t19}>{t20}</View>;
238
242
  $[76] = t19;
243
+ $[77] = t20;
244
+ $[78] = t21;
239
245
  } else {
240
- t19 = $[76];
246
+ t21 = $[78];
241
247
  }
242
- return t19;
248
+ return t21;
243
249
  }
244
250
  const createStyles = theme => StyleSheet.create({
245
251
  container: {
@@ -1 +1 @@
1
- {"version":3,"file":"MessageText.js","names":["React","useMemo","useCallback","StyleSheet","View","Text","BasicMarkdown","MarkdownMessageText","canUseStreamdown","StreamingCursor","useThemedStyles","LinkParser","MessageText","t0","$","_c","currentMessage","position","t1","containerStyle","textStyle","linkStyle","linkStyleProp","customTextStyle","onPress","onPressProp","matchers","email","t2","phone","t3","url","t4","hashtag","t5","mention","t6","hashtagUrl","mentionUrl","stripPrefix","t7","markdown","markdownProps","trailing","undefined","styles","createStyles","t8","flatten","link","t9","t10","t11","text","style","t12","url_0","type","handlePress","isStreaming","streaming","wantMarkdown","t13","trailingLine","t14","t15","container","t16","t17","t18","link_0","t19","t20","t21","parsed","theme","create","marginTop","spacing","bubblePaddingV","marginBottom","bubblePaddingBottom","marginHorizontal","bubblePaddingH","fontSize","typography","message","lineHeight","fontWeight","text_left","color","colors","incomingText","text_right","outgoingText","link_left","incomingLink","link_right","outgoingLink"],"sources":["../src/MessageText.tsx"],"sourcesContent":["import React, { useMemo, useCallback } from 'react'\nimport {\n StyleSheet,\n StyleProp,\n ViewStyle,\n TextStyle,\n View,\n Text } from 'react-native'\n\nimport { BasicMarkdown } from './components/BasicMarkdown'\nimport { MarkdownMessageText, canUseStreamdown } from './components/MarkdownMessageText'\nimport { StreamingCursor } from './components/StreamingCursor'\nimport { useThemedStyles } from './hooks/useTheme'\nimport { LinkParser, LinkMatcher, LinkType } from './linkParser'\nimport { LeftRightStyle, IMessage } from './Models'\nimport { ChatTheme } from './Theme'\n\nexport type MessageTextProps<TMessage extends IMessage> = {\n position?: 'left' | 'right'\n currentMessage: TMessage\n containerStyle?: LeftRightStyle<ViewStyle>\n textStyle?: LeftRightStyle<TextStyle>\n linkStyle?: LeftRightStyle<TextStyle>\n customTextStyle?: StyleProp<TextStyle>\n onPress?: (\n message: TMessage,\n url: string,\n type: LinkType\n ) => void\n // Link parser options\n matchers?: LinkMatcher[]\n email?: boolean\n phone?: boolean\n url?: boolean\n hashtag?: boolean\n mention?: boolean\n hashtagUrl?: string\n mentionUrl?: string\n stripPrefix?: boolean\n /**\n * Render the message body as markdown (great for AI/streamed replies). `true`\n * forces markdown for every message, `false` disables it; when left unset,\n * streamed messages render as markdown automatically. Uses the optional\n * `react-native-streamdown` peer when installed (best handling of\n * streaming-incomplete markdown), otherwise a built-in dependency-free renderer\n * covering headings, lists, blockquotes, code, bold/italic/strikethrough and links.\n */\n markdown?: boolean\n /** Extra props forwarded to the Streamdown component (its own theming/rules API); only used when streamdown is installed. */\n markdownProps?: Record<string, unknown>\n /**\n * Inline content after the last word. `Bubble` puts an invisible copy of the time here, so\n * the visible time can sit on the last line when it fits and the text wraps around it\n * when it does not. In markdown it follows the closing paragraph,\n * heading or list item; after a code block or a quote it takes a line of its own.\n */\n trailing?: React.ReactNode\n}\n\nexport function MessageText<TMessage extends IMessage>({\n currentMessage,\n position = 'left',\n containerStyle,\n textStyle,\n linkStyle: linkStyleProp,\n customTextStyle,\n onPress: onPressProp,\n matchers,\n email = true,\n phone = true,\n url = true,\n hashtag = false,\n mention = false,\n hashtagUrl,\n mentionUrl,\n stripPrefix = false,\n markdown,\n markdownProps,\n trailing,\n}: MessageTextProps<TMessage>) {\n const styles = useThemedStyles(createStyles)\n\n const linkStyle = useMemo(() => StyleSheet.flatten([\n styles.link,\n styles[`link_${position}`],\n linkStyleProp?.[position],\n ]), [styles, position, linkStyleProp])\n\n const style = useMemo(() => [\n styles.text,\n styles[`text_${position}`],\n textStyle?.[position],\n customTextStyle,\n ], [styles, position, textStyle, customTextStyle])\n\n const handlePress = useCallback((url: string, type: LinkType) => {\n onPressProp?.(currentMessage, url, type)\n }, [onPressProp, currentMessage])\n\n const isStreaming = !!currentMessage?.streaming\n\n // Render markdown when explicitly enabled, or when the message is being\n // streamed (AI replies) and it wasn't explicitly disabled. Prefer\n // react-native-streamdown when installed (best streaming-incomplete handling),\n // otherwise fall back to the built-in dependency-free renderer.\n const wantMarkdown = markdown !== false && (markdown === true || isStreaming)\n\n // Blocks of markdown have no last line to share, so the time gets one of its own.\n const trailingLine = trailing ? <Text style={style}>{trailing}</Text> : null\n\n if (wantMarkdown && canUseStreamdown())\n return (\n <View style={[styles.container, containerStyle?.[position]]}>\n <MarkdownMessageText\n text={currentMessage!.text}\n isStreaming={isStreaming}\n textStyle={style}\n linkStyle={linkStyle}\n onLinkPress={onPressProp ? (link: string) => handlePress(link, 'url') : undefined}\n componentProps={markdownProps}\n />\n {trailingLine}\n </View>\n )\n\n if (wantMarkdown)\n return (\n <View style={[styles.container, containerStyle?.[position]]}>\n <BasicMarkdown\n text={currentMessage!.text}\n textStyle={style}\n linkStyle={linkStyle}\n onLinkPress={onPressProp ? (link: string) => handlePress(link, 'url') : undefined}\n // The time shares the last line when it fits, as with plain text; a streaming reply\n // keeps its caret on the line after, so the time waits below it.\n trailing={isStreaming ? undefined : trailing}\n />\n {isStreaming && (\n <Text style={style}>\n <StreamingCursor />\n </Text>\n )}\n {isStreaming && trailingLine}\n </View>\n )\n\n const parsed = (\n <LinkParser\n text={currentMessage!.text}\n matchers={matchers}\n email={email}\n phone={phone}\n url={url}\n hashtag={hashtag}\n mention={mention}\n hashtagUrl={hashtagUrl}\n mentionUrl={mentionUrl}\n stripPrefix={stripPrefix}\n linkStyle={linkStyle}\n textStyle={style}\n onPress={onPressProp ? handlePress : undefined}\n TextComponent={Text}\n />\n )\n\n return (\n <View\n style={[\n styles.container,\n containerStyle?.[position],\n ]}\n >\n {isStreaming || trailing\n ? (\n // Wrap in a Text so the caret and the reserved time space flow inline after the\n // last word and inherit the bubble text color.\n <Text style={style}>\n {parsed}\n {isStreaming && <StreamingCursor />}\n {trailing}\n </Text>\n )\n : parsed}\n </View>\n )\n}\n\nconst createStyles = (theme: ChatTheme) => StyleSheet.create({\n container: {\n marginTop: theme.spacing.bubblePaddingV,\n marginBottom: theme.spacing.bubblePaddingBottom,\n marginHorizontal: theme.spacing.bubblePaddingH,\n },\n text: {\n fontSize: theme.typography.message.fontSize,\n lineHeight: theme.typography.message.lineHeight,\n fontWeight: theme.typography.message.fontWeight,\n },\n text_left: {\n color: theme.colors.incomingText,\n },\n text_right: {\n color: theme.colors.outgoingText,\n },\n // Links are colored, not underlined.\n link: {},\n link_left: {\n color: theme.colors.incomingLink,\n },\n link_right: {\n color: theme.colors.outgoingLink,\n },\n})\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,EAAEC,WAAW,QAAQ,OAAO;AACnD,SACEC,UAAU,EAIVC,IAAI,EACJC,IAAI,QAAQ,cAAc;AAE5B,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,mBAAmB,EAAEC,gBAAgB,QAAQ,kCAAkC;AACxF,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SAASC,eAAe,QAAQ,kBAAkB;AAClD,SAASC,UAAU,QAA+B,cAAc;AA8ChE,OAAO,SAAAC,YAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EAAgD;IAAAC,cAAA;IAAAC,QAAA,EAAAC,EAAA;IAAAC,cAAA;IAAAC,SAAA;IAAAC,SAAA,EAAAC,aAAA;IAAAC,eAAA;IAAAC,OAAA,EAAAC,WAAA;IAAAC,QAAA;IAAAC,KAAA,EAAAC,EAAA;IAAAC,KAAA,EAAAC,EAAA;IAAAC,GAAA,EAAAC,EAAA;IAAAC,OAAA,EAAAC,EAAA;IAAAC,OAAA,EAAAC,EAAA;IAAAC,UAAA;IAAAC,UAAA;IAAAC,WAAA,EAAAC,EAAA;IAAAC,QAAA;IAAAC,aAAA;IAAAC;EAAA,IAAA9B,EAoB1B;EAlB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M,CAACC;EACtB,CAAC;EACDC,UAAU,EAAE;IACVH,KAAK,EAAEf,KAAK,CAACgB,MAAM,CAACG;EACtB,CAAC;EACD;EACA7C,IAAI,EAAE,CAAC,CAAC;EACR8C,SAAS,EAAE;IACTL,KAAK,EAAEf,KAAK,CAACgB,MAAM,CAACK;EACtB,CAAC;EACDC,UAAU,EAAE;IACVP,KAAK,EAAEf,KAAK,CAACgB,MAAM,CAACO;EACtB;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"MessageText.js","names":["React","useMemo","useCallback","StyleSheet","View","Text","BasicMarkdown","MarkdownMessageText","canUseStreamdown","StreamingCursor","useTextHighlight","useThemedStyles","LinkParser","MessageText","t0","$","_c","currentMessage","position","t1","containerStyle","textStyle","linkStyle","linkStyleProp","customTextStyle","onPress","onPressProp","matchers","email","t2","phone","t3","url","t4","hashtag","t5","mention","t6","hashtagUrl","mentionUrl","stripPrefix","t7","markdown","markdownProps","trailing","undefined","styles","createStyles","highlight","t8","flatten","link","t9","t10","t11","text","style","t12","url_0","type","handlePress","isStreaming","streaming","wantMarkdown","t13","trailingLine","t14","t15","container","t16","t17","t18","link_0","t19","t20","t21","parsed","theme","create","marginTop","spacing","bubblePaddingV","marginBottom","bubblePaddingBottom","marginHorizontal","bubblePaddingH","fontSize","typography","message","lineHeight","fontWeight","text_left","color","colors","incomingText","text_right","outgoingText","link_left","incomingLink","link_right","outgoingLink"],"sources":["../src/MessageText.tsx"],"sourcesContent":["import React, { useMemo, useCallback } from 'react'\nimport {\n StyleSheet,\n StyleProp,\n ViewStyle,\n TextStyle,\n View,\n Text } from 'react-native'\n\nimport { BasicMarkdown } from './components/BasicMarkdown'\nimport { MarkdownMessageText, canUseStreamdown } from './components/MarkdownMessageText'\nimport { StreamingCursor } from './components/StreamingCursor'\nimport { useTextHighlight } from './components/textHighlight'\nimport { useThemedStyles } from './hooks/useTheme'\nimport { LinkParser, LinkMatcher, LinkType } from './linkParser'\nimport { LeftRightStyle, IMessage } from './Models'\nimport { ChatTheme } from './Theme'\n\nexport type MessageTextProps<TMessage extends IMessage> = {\n position?: 'left' | 'right'\n currentMessage: TMessage\n containerStyle?: LeftRightStyle<ViewStyle>\n textStyle?: LeftRightStyle<TextStyle>\n linkStyle?: LeftRightStyle<TextStyle>\n customTextStyle?: StyleProp<TextStyle>\n onPress?: (\n message: TMessage,\n url: string,\n type: LinkType\n ) => void\n // Link parser options\n matchers?: LinkMatcher[]\n email?: boolean\n phone?: boolean\n url?: boolean\n hashtag?: boolean\n mention?: boolean\n hashtagUrl?: string\n mentionUrl?: string\n stripPrefix?: boolean\n /**\n * Render the message body as markdown (great for AI/streamed replies). `true`\n * forces markdown for every message, `false` disables it; when left unset,\n * streamed messages render as markdown automatically. Uses the optional\n * `react-native-streamdown` peer when installed (best handling of\n * streaming-incomplete markdown), otherwise a built-in dependency-free renderer\n * covering headings, lists, blockquotes, code, bold/italic/strikethrough and links.\n */\n markdown?: boolean\n /** Extra props forwarded to the Streamdown component (its own theming/rules API); only used when streamdown is installed. */\n markdownProps?: Record<string, unknown>\n /**\n * Inline content after the last word. `Bubble` puts an invisible copy of the time here, so\n * the visible time can sit on the last line when it fits and the text wraps around it\n * when it does not. In markdown it follows the closing paragraph,\n * heading or list item; after a code block or a quote it takes a line of its own.\n */\n trailing?: React.ReactNode\n}\n\nexport function MessageText<TMessage extends IMessage>({\n currentMessage,\n position = 'left',\n containerStyle,\n textStyle,\n linkStyle: linkStyleProp,\n customTextStyle,\n onPress: onPressProp,\n matchers,\n email = true,\n phone = true,\n url = true,\n hashtag = false,\n mention = false,\n hashtagUrl,\n mentionUrl,\n stripPrefix = false,\n markdown,\n markdownProps,\n trailing,\n}: MessageTextProps<TMessage>) {\n const styles = useThemedStyles(createStyles)\n const highlight = useTextHighlight()\n\n const linkStyle = useMemo(() => StyleSheet.flatten([\n styles.link,\n styles[`link_${position}`],\n linkStyleProp?.[position],\n ]), [styles, position, linkStyleProp])\n\n const style = useMemo(() => [\n styles.text,\n styles[`text_${position}`],\n textStyle?.[position],\n customTextStyle,\n ], [styles, position, textStyle, customTextStyle])\n\n const handlePress = useCallback((url: string, type: LinkType) => {\n onPressProp?.(currentMessage, url, type)\n }, [onPressProp, currentMessage])\n\n const isStreaming = !!currentMessage?.streaming\n\n // Render markdown when explicitly enabled, or when the message is being\n // streamed (AI replies) and it wasn't explicitly disabled. Prefer\n // react-native-streamdown when installed (best streaming-incomplete handling),\n // otherwise fall back to the built-in dependency-free renderer.\n const wantMarkdown = markdown !== false && (markdown === true || isStreaming)\n\n // Blocks of markdown have no last line to share, so the time gets one of its own.\n const trailingLine = trailing ? <Text style={style}>{trailing}</Text> : null\n\n if (wantMarkdown && canUseStreamdown())\n return (\n <View style={[styles.container, containerStyle?.[position]]}>\n <MarkdownMessageText\n text={currentMessage!.text}\n isStreaming={isStreaming}\n textStyle={style}\n linkStyle={linkStyle}\n onLinkPress={onPressProp ? (link: string) => handlePress(link, 'url') : undefined}\n componentProps={markdownProps}\n />\n {trailingLine}\n </View>\n )\n\n if (wantMarkdown)\n return (\n <View style={[styles.container, containerStyle?.[position]]}>\n <BasicMarkdown\n text={currentMessage!.text}\n textStyle={style}\n linkStyle={linkStyle}\n onLinkPress={onPressProp ? (link: string) => handlePress(link, 'url') : undefined}\n // The time shares the last line when it fits, as with plain text; a streaming reply\n // keeps its caret on the line after, so the time waits below it.\n trailing={isStreaming ? undefined : trailing}\n />\n {isStreaming && (\n <Text style={style}>\n <StreamingCursor />\n </Text>\n )}\n {isStreaming && trailingLine}\n </View>\n )\n\n const parsed = (\n <LinkParser\n text={currentMessage!.text}\n matchers={matchers}\n email={email}\n phone={phone}\n url={url}\n hashtag={hashtag}\n mention={mention}\n hashtagUrl={hashtagUrl}\n mentionUrl={mentionUrl}\n stripPrefix={stripPrefix}\n linkStyle={linkStyle}\n textStyle={style}\n highlight={highlight?.text}\n highlightStyle={highlight?.style}\n onPress={onPressProp ? handlePress : undefined}\n TextComponent={Text}\n />\n )\n\n return (\n <View\n style={[\n styles.container,\n containerStyle?.[position],\n ]}\n >\n {isStreaming || trailing\n ? (\n // Wrap in a Text so the caret and the reserved time space flow inline after the\n // last word and inherit the bubble text color.\n <Text style={style}>\n {parsed}\n {isStreaming && <StreamingCursor />}\n {trailing}\n </Text>\n )\n : parsed}\n </View>\n )\n}\n\nconst createStyles = (theme: ChatTheme) => StyleSheet.create({\n container: {\n marginTop: theme.spacing.bubblePaddingV,\n marginBottom: theme.spacing.bubblePaddingBottom,\n marginHorizontal: theme.spacing.bubblePaddingH,\n },\n text: {\n fontSize: theme.typography.message.fontSize,\n lineHeight: theme.typography.message.lineHeight,\n fontWeight: theme.typography.message.fontWeight,\n },\n text_left: {\n color: theme.colors.incomingText,\n },\n text_right: {\n color: theme.colors.outgoingText,\n },\n // Links are colored, not underlined.\n link: {},\n link_left: {\n color: theme.colors.incomingLink,\n },\n link_right: {\n color: theme.colors.outgoingLink,\n },\n})\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,EAAEC,WAAW,QAAQ,OAAO;AACnD,SACEC,UAAU,EAIVC,IAAI,EACJC,IAAI,QAAQ,cAAc;AAE5B,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,mBAAmB,EAAEC,gBAAgB,QAAQ,kCAAkC;AACxF,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,eAAe,QAAQ,kBAAkB;AAClD,SAASC,UAAU,QAA+B,cAAc;AA8ChE,OAAO,SAAAC,YAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EAAgD;IAAAC,cAAA;IAAAC,QAAA,EAAAC,EAAA;IAAAC,cAAA;IAAAC,SAAA;IAAAC,SAAA,EAAAC,aAAA;IAAAC,eAAA;IAAAC,OAAA,EAAAC,WAAA;IAAAC,QAAA;IAAAC,KAAA,EAAAC,EAAA;IAAAC,KAAA,EAAAC,EAAA;IAAAC,GAAA,EAAAC,EAAA;IAAA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I8B,KAAgB,IAAK1E,UAAU,CAAC2E,MAAM,CAAC;EAC3DV,SAAS,EAAE;IACTW,SAAS,EAAEF,KAAK,CAACG,OAAO,CAACC,cAAc;IACvCC,YAAY,EAAEL,KAAK,CAACG,OAAO,CAACG,mBAAmB;IAC/CC,gBAAgB,EAAEP,KAAK,CAACG,OAAO,CAACK;EAClC,CAAC;EACD9B,IAAI,EAAE;IACJ+B,QAAQ,EAAET,KAAK,CAACU,UAAU,CAACC,OAAO,CAACF,QAAQ;IAC3CG,UAAU,EAAEZ,KAAK,CAACU,UAAU,CAACC,OAAO,CAACC,UAAU;IAC/CC,UAAU,EAAEb,KAAK,CAACU,UAAU,CAACC,OAAO,CAACE;EACvC,CAAC;EACDC,SAAS,EAAE;IACTC,KAAK,EAAEf,KAAK,CAACgB,MAAM,CAACC;EACtB,CAAC;EACDC,UAAU,EAAE;IACVH,KAAK,EAAEf,KAAK,CAACgB,MAAM,CAACG;EACtB,CAAC;EACD;EACA7C,IAAI,EAAE,CAAC,CAAC;EACR8C,SAAS,EAAE;IACTL,KAAK,EAAEf,KAAK,CAACgB,MAAM,CAACK;EACtB,CAAC;EACDC,UAAU,EAAE;IACVP,KAAK,EAAEf,KAAK,CAACgB,MAAM,CAACO;EACtB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MessagesContainer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAOlD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAWpC,OAAO,EAAE,sBAAsB,EAAiB,MAAM,SAAS,CAAA;AAa/D,cAAc,SAAS,CAAA;AAEvB,eAAO,MAAM,iBAAiB,GAAI,QAAQ,SAAS,QAAQ,EAAE,OAAO,sBAAsB,CAAC,QAAQ,CAAC,sBAiOnG,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MessagesContainer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAOlD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAWpC,OAAO,EAAE,sBAAsB,EAAiB,MAAM,SAAS,CAAA;AAc/D,cAAc,SAAS,CAAA;AAEvB,eAAO,MAAM,iBAAiB,GAAI,QAAQ,SAAS,QAAQ,EAAE,OAAO,sBAAsB,CAAC,QAAQ,CAAC,sBAgPnG,CAAA"}
@@ -17,6 +17,7 @@ import { MessageRowConfigContext, RowTargetsContext } from './rowConfig';
17
17
  import { MessageRowStoreContext } from './rowStore';
18
18
  import styles, { createThemedStyles } from './styles';
19
19
  import { useCellLayouts } from './useCellLayouts';
20
+ import { useChained } from './useChained';
20
21
  import { useDaysPositions } from './useDaysPositions';
21
22
  import { useListChrome } from './useListChrome';
22
23
  import { useListMetrics, useRowsHeight } from './useListMetrics';
@@ -28,7 +29,7 @@ import { useTapToClosePanels } from './useTapToClosePanels';
28
29
  import { useViewabilityPairs } from './viewability';
29
30
  export * from './types';
30
31
  export const MessagesContainer = props => {
31
- const $ = _c(106);
32
+ const $ = _c(109);
32
33
  const {
33
34
  messages: t0,
34
35
  user,
@@ -239,131 +240,149 @@ export const MessagesContainer = props => {
239
240
  onListTouchStart,
240
241
  onListTouchEnd
241
242
  } = useTapToClosePanels();
242
- const t14 = isLayoutAnimated ? listCellTransition : undefined;
243
- let t15;
244
- if ($[40] !== ListFooterComponent || $[41] !== ListHeaderComponent || $[42] !== alignItemsAtEnd || $[43] !== forwardRef || $[44] !== initialScroll || $[45] !== keyExtractor || $[46] !== listProps || $[47] !== maintainScrollAtEnd || $[48] !== onContentSizeChange || $[49] !== onItemSizeChanged || $[50] !== onLayoutList || $[51] !== onMetricsChange || $[52] !== onMomentumScrollBegin || $[53] !== onMomentumScrollEnd || $[54] !== onScrollBeginDrag || $[55] !== onScrollEndDrag || $[56] !== onStartReached || $[57] !== orderedData || $[58] !== renderChatEmpty || $[59] !== renderItem || $[60] !== sharedValues || $[61] !== t14 || $[62] !== viewabilityPairs) {
245
- t15 = <AnimatedLegendList ref={forwardRef} keyExtractor={keyExtractor} data={orderedData} renderItem={renderItem} estimatedItemSize={64} alignItemsAtEnd={alignItemsAtEnd} {...initialScroll} maintainScrollAtEnd={maintainScrollAtEnd} maintainVisibleContentPosition={true} itemLayoutAnimation={t14} sharedValues={sharedValues} style={stylesCommon.fill} contentContainerStyle={styles.messagesContainer} ListEmptyComponent={renderChatEmpty} ListHeaderComponent={ListHeaderComponent} ListFooterComponent={ListFooterComponent} onStartReached={onStartReached} onStartReachedThreshold={0.1} keyboardDismissMode="interactive" keyboardShouldPersistTaps="handled" {...listProps} onScrollBeginDrag={onScrollBeginDrag} onScrollEndDrag={onScrollEndDrag} onMomentumScrollBegin={onMomentumScrollBegin} onMomentumScrollEnd={onMomentumScrollEnd} onContentSizeChange={onContentSizeChange} onItemSizeChanged={onItemSizeChanged} onMetricsChange={onMetricsChange} onViewableItemsChanged={undefined} viewabilityConfig={undefined} viewabilityConfigCallbackPairs={viewabilityPairs} onLayout={onLayoutList} />;
246
- $[40] = ListFooterComponent;
247
- $[41] = ListHeaderComponent;
248
- $[42] = alignItemsAtEnd;
249
- $[43] = forwardRef;
250
- $[44] = initialScroll;
251
- $[45] = keyExtractor;
252
- $[46] = listProps;
253
- $[47] = maintainScrollAtEnd;
254
- $[48] = onContentSizeChange;
255
- $[49] = onItemSizeChanged;
256
- $[50] = onLayoutList;
257
- $[51] = onMetricsChange;
258
- $[52] = onMomentumScrollBegin;
259
- $[53] = onMomentumScrollEnd;
260
- $[54] = onScrollBeginDrag;
261
- $[55] = onScrollEndDrag;
262
- $[56] = onStartReached;
263
- $[57] = orderedData;
264
- $[58] = renderChatEmpty;
265
- $[59] = renderItem;
266
- $[60] = sharedValues;
267
- $[61] = t14;
268
- $[62] = viewabilityPairs;
269
- $[63] = t15;
243
+ const handleScrollBeginDrag = useChained(onScrollBeginDrag, listProps?.onScrollBeginDrag);
244
+ const handleScrollEndDrag = useChained(onScrollEndDrag, listProps?.onScrollEndDrag);
245
+ const handleMomentumScrollBegin = useChained(onMomentumScrollBegin, listProps?.onMomentumScrollBegin);
246
+ const handleMomentumScrollEnd = useChained(onMomentumScrollEnd, listProps?.onMomentumScrollEnd);
247
+ const handleContentSizeChange = useChained(onContentSizeChange, listProps?.onContentSizeChange);
248
+ const handleItemSizeChanged = useChained(onItemSizeChanged, listProps?.onItemSizeChanged);
249
+ const handleMetricsChange = useChained(onMetricsChange, listProps?.onMetricsChange);
250
+ const listContentStyle = listProps?.contentContainerStyle;
251
+ let t14;
252
+ if ($[40] !== listContentStyle) {
253
+ t14 = listContentStyle ? [styles.messagesContainer, listContentStyle] : styles.messagesContainer;
254
+ $[40] = listContentStyle;
255
+ $[41] = t14;
270
256
  } else {
271
- t15 = $[63];
257
+ t14 = $[41];
272
258
  }
273
- const listEngine = t15;
259
+ const contentContainerStyle = t14;
260
+ const t15 = isLayoutAnimated ? listCellTransition : undefined;
274
261
  let t16;
275
- if ($[64] !== themedStyles.root) {
276
- t16 = [styles.contentContainerStyle, themedStyles.root, stylesCommon.fill];
277
- $[64] = themedStyles.root;
278
- $[65] = t16;
262
+ if ($[42] !== ListFooterComponent || $[43] !== ListHeaderComponent || $[44] !== alignItemsAtEnd || $[45] !== contentContainerStyle || $[46] !== forwardRef || $[47] !== handleContentSizeChange || $[48] !== handleItemSizeChanged || $[49] !== handleMetricsChange || $[50] !== handleMomentumScrollBegin || $[51] !== handleMomentumScrollEnd || $[52] !== handleScrollBeginDrag || $[53] !== handleScrollEndDrag || $[54] !== initialScroll || $[55] !== keyExtractor || $[56] !== listProps || $[57] !== maintainScrollAtEnd || $[58] !== onLayoutList || $[59] !== onStartReached || $[60] !== orderedData || $[61] !== renderChatEmpty || $[62] !== renderItem || $[63] !== sharedValues || $[64] !== t15 || $[65] !== viewabilityPairs) {
263
+ t16 = <AnimatedLegendList ref={forwardRef} keyExtractor={keyExtractor} data={orderedData} renderItem={renderItem} estimatedItemSize={64} alignItemsAtEnd={alignItemsAtEnd} {...initialScroll} maintainScrollAtEnd={maintainScrollAtEnd} maintainVisibleContentPosition={true} itemLayoutAnimation={t15} sharedValues={sharedValues} style={stylesCommon.fill} ListEmptyComponent={renderChatEmpty} ListHeaderComponent={ListHeaderComponent} ListFooterComponent={ListFooterComponent} onStartReached={onStartReached} onStartReachedThreshold={0.1} keyboardDismissMode="interactive" keyboardShouldPersistTaps="handled" {...listProps} contentContainerStyle={contentContainerStyle} onScrollBeginDrag={handleScrollBeginDrag} onScrollEndDrag={handleScrollEndDrag} onMomentumScrollBegin={handleMomentumScrollBegin} onMomentumScrollEnd={handleMomentumScrollEnd} onContentSizeChange={handleContentSizeChange} onItemSizeChanged={handleItemSizeChanged} onMetricsChange={handleMetricsChange} onViewableItemsChanged={undefined} viewabilityConfig={undefined} viewabilityConfigCallbackPairs={viewabilityPairs} onLayout={onLayoutList} />;
264
+ $[42] = ListFooterComponent;
265
+ $[43] = ListHeaderComponent;
266
+ $[44] = alignItemsAtEnd;
267
+ $[45] = contentContainerStyle;
268
+ $[46] = forwardRef;
269
+ $[47] = handleContentSizeChange;
270
+ $[48] = handleItemSizeChanged;
271
+ $[49] = handleMetricsChange;
272
+ $[50] = handleMomentumScrollBegin;
273
+ $[51] = handleMomentumScrollEnd;
274
+ $[52] = handleScrollBeginDrag;
275
+ $[53] = handleScrollEndDrag;
276
+ $[54] = initialScroll;
277
+ $[55] = keyExtractor;
278
+ $[56] = listProps;
279
+ $[57] = maintainScrollAtEnd;
280
+ $[58] = onLayoutList;
281
+ $[59] = onStartReached;
282
+ $[60] = orderedData;
283
+ $[61] = renderChatEmpty;
284
+ $[62] = renderItem;
285
+ $[63] = sharedValues;
286
+ $[64] = t15;
287
+ $[65] = viewabilityPairs;
288
+ $[66] = t16;
279
289
  } else {
280
- t16 = $[65];
290
+ t16 = $[66];
281
291
  }
292
+ const listEngine = t16;
282
293
  let t17;
283
- if ($[66] !== handleScrollToBottomPress || $[67] !== isScrollToBottomEnabled || $[68] !== isScrollToBottomVisible || $[69] !== scrollToBottomComponentProp || $[70] !== scrollToBottomContentStyle || $[71] !== scrollToBottomOpacity || $[72] !== scrollToBottomStyle || $[73] !== unreadCount) {
284
- t17 = <ScrollToBottomButton isEnabled={isScrollToBottomEnabled} isVisible={isScrollToBottomVisible} opacity={scrollToBottomOpacity} unreadCount={unreadCount} onPress={handleScrollToBottomPress} style={scrollToBottomStyle} contentStyle={scrollToBottomContentStyle} scrollToBottomComponent={scrollToBottomComponentProp} />;
285
- $[66] = handleScrollToBottomPress;
286
- $[67] = isScrollToBottomEnabled;
287
- $[68] = isScrollToBottomVisible;
288
- $[69] = scrollToBottomComponentProp;
289
- $[70] = scrollToBottomContentStyle;
290
- $[71] = scrollToBottomOpacity;
291
- $[72] = scrollToBottomStyle;
292
- $[73] = unreadCount;
293
- $[74] = t17;
294
+ if ($[67] !== themedStyles.root) {
295
+ t17 = [styles.contentContainerStyle, themedStyles.root, stylesCommon.fill];
296
+ $[67] = themedStyles.root;
297
+ $[68] = t17;
294
298
  } else {
295
- t17 = $[74];
299
+ t17 = $[68];
296
300
  }
297
301
  let t18;
298
- if ($[75] !== daysPositions || $[76] !== floatingDayOpacity || $[77] !== floatingRenderedDate || $[78] !== isDayAnimationEnabled || $[79] !== isScrollActive || $[80] !== listHeight || $[81] !== loadEarlierMessagesProps?.isLoading || $[82] !== props.dateFormat || $[83] !== props.dateFormatCalendar || $[84] !== renderDayProp || $[85] !== scrolledY) {
299
- t18 = isDayAnimationEnabled && <DayAnimated scrolledY={scrolledY} daysPositions={daysPositions} listHeight={listHeight} isScrollActive={isScrollActive} floatingRenderedDate={floatingRenderedDate} opacity={floatingDayOpacity} renderDay={renderDayProp} isLoading={loadEarlierMessagesProps?.isLoading ?? false} dateFormat={props.dateFormat} dateFormatCalendar={props.dateFormatCalendar} />;
300
- $[75] = daysPositions;
301
- $[76] = floatingDayOpacity;
302
- $[77] = floatingRenderedDate;
303
- $[78] = isDayAnimationEnabled;
304
- $[79] = isScrollActive;
305
- $[80] = listHeight;
306
- $[81] = loadEarlierMessagesProps?.isLoading;
307
- $[82] = props.dateFormat;
308
- $[83] = props.dateFormatCalendar;
309
- $[84] = renderDayProp;
310
- $[85] = scrolledY;
311
- $[86] = t18;
302
+ if ($[69] !== handleScrollToBottomPress || $[70] !== isScrollToBottomEnabled || $[71] !== isScrollToBottomVisible || $[72] !== scrollToBottomComponentProp || $[73] !== scrollToBottomContentStyle || $[74] !== scrollToBottomOpacity || $[75] !== scrollToBottomStyle || $[76] !== unreadCount) {
303
+ t18 = <ScrollToBottomButton isEnabled={isScrollToBottomEnabled} isVisible={isScrollToBottomVisible} opacity={scrollToBottomOpacity} unreadCount={unreadCount} onPress={handleScrollToBottomPress} style={scrollToBottomStyle} contentStyle={scrollToBottomContentStyle} scrollToBottomComponent={scrollToBottomComponentProp} />;
304
+ $[69] = handleScrollToBottomPress;
305
+ $[70] = isScrollToBottomEnabled;
306
+ $[71] = isScrollToBottomVisible;
307
+ $[72] = scrollToBottomComponentProp;
308
+ $[73] = scrollToBottomContentStyle;
309
+ $[74] = scrollToBottomOpacity;
310
+ $[75] = scrollToBottomStyle;
311
+ $[76] = unreadCount;
312
+ $[77] = t18;
312
313
  } else {
313
- t18 = $[86];
314
+ t18 = $[77];
314
315
  }
315
316
  let t19;
316
- if ($[87] !== listEngine || $[88] !== onListTouchEnd || $[89] !== onListTouchStart || $[90] !== t16 || $[91] !== t17 || $[92] !== t18) {
317
- const list = <View style={t16} onTouchStart={onListTouchStart} onTouchEnd={onListTouchEnd}>{listEngine}{t17}{t18}</View>;
318
- t19 = <TypingIndicatorListAnimationContext.Provider value={true}>{list}</TypingIndicatorListAnimationContext.Provider>;
319
- $[87] = listEngine;
320
- $[88] = onListTouchEnd;
321
- $[89] = onListTouchStart;
322
- $[90] = t16;
323
- $[91] = t17;
324
- $[92] = t18;
325
- $[93] = t19;
317
+ if ($[78] !== daysPositions || $[79] !== floatingDayOpacity || $[80] !== floatingRenderedDate || $[81] !== isDayAnimationEnabled || $[82] !== isScrollActive || $[83] !== listHeight || $[84] !== loadEarlierMessagesProps?.isLoading || $[85] !== props.dateFormat || $[86] !== props.dateFormatCalendar || $[87] !== renderDayProp || $[88] !== scrolledY) {
318
+ t19 = isDayAnimationEnabled && <DayAnimated scrolledY={scrolledY} daysPositions={daysPositions} listHeight={listHeight} isScrollActive={isScrollActive} floatingRenderedDate={floatingRenderedDate} opacity={floatingDayOpacity} renderDay={renderDayProp} isLoading={loadEarlierMessagesProps?.isLoading ?? false} dateFormat={props.dateFormat} dateFormatCalendar={props.dateFormatCalendar} />;
319
+ $[78] = daysPositions;
320
+ $[79] = floatingDayOpacity;
321
+ $[80] = floatingRenderedDate;
322
+ $[81] = isDayAnimationEnabled;
323
+ $[82] = isScrollActive;
324
+ $[83] = listHeight;
325
+ $[84] = loadEarlierMessagesProps?.isLoading;
326
+ $[85] = props.dateFormat;
327
+ $[86] = props.dateFormatCalendar;
328
+ $[87] = renderDayProp;
329
+ $[88] = scrolledY;
330
+ $[89] = t19;
326
331
  } else {
327
- t19 = $[93];
332
+ t19 = $[89];
328
333
  }
329
- const animatedList = t19;
330
- const t20 = rowStore;
331
- let t21;
332
- if ($[94] !== animatedList || $[95] !== rowTargets) {
333
- t21 = <RowTargetsContext.Provider value={rowTargets}>{animatedList}</RowTargetsContext.Provider>;
334
- $[94] = animatedList;
335
- $[95] = rowTargets;
336
- $[96] = t21;
334
+ let t20;
335
+ if ($[90] !== listEngine || $[91] !== onListTouchEnd || $[92] !== onListTouchStart || $[93] !== t17 || $[94] !== t18 || $[95] !== t19) {
336
+ const list = <View style={t17} onTouchStart={onListTouchStart} onTouchEnd={onListTouchEnd}>{listEngine}{t18}{t19}</View>;
337
+ t20 = <TypingIndicatorListAnimationContext.Provider value={true}>{list}</TypingIndicatorListAnimationContext.Provider>;
338
+ $[90] = listEngine;
339
+ $[91] = onListTouchEnd;
340
+ $[92] = onListTouchStart;
341
+ $[93] = t17;
342
+ $[94] = t18;
343
+ $[95] = t19;
344
+ $[96] = t20;
337
345
  } else {
338
- t21 = $[96];
346
+ t20 = $[96];
339
347
  }
348
+ const animatedList = t20;
349
+ const t21 = rowStore;
340
350
  let t22;
341
- if ($[97] !== rowConfig || $[98] !== t21) {
342
- t22 = <MessageRowConfigContext.Provider value={rowConfig}>{t21}</MessageRowConfigContext.Provider>;
343
- $[97] = rowConfig;
344
- $[98] = t21;
351
+ if ($[97] !== animatedList || $[98] !== rowTargets) {
352
+ t22 = <RowTargetsContext.Provider value={rowTargets}>{animatedList}</RowTargetsContext.Provider>;
353
+ $[97] = animatedList;
354
+ $[98] = rowTargets;
345
355
  $[99] = t22;
346
356
  } else {
347
357
  t22 = $[99];
348
358
  }
349
359
  let t23;
350
- if ($[100] !== t20 || $[101] !== t22) {
351
- t23 = <MessageRowStoreContext.Provider value={t20}>{t22}</MessageRowStoreContext.Provider>;
352
- $[100] = t20;
360
+ if ($[100] !== rowConfig || $[101] !== t22) {
361
+ t23 = <MessageRowConfigContext.Provider value={rowConfig}>{t22}</MessageRowConfigContext.Provider>;
362
+ $[100] = rowConfig;
353
363
  $[101] = t22;
354
364
  $[102] = t23;
355
365
  } else {
356
366
  t23 = $[102];
357
367
  }
358
368
  let t24;
359
- if ($[103] !== gradientStore || $[104] !== t23) {
360
- t24 = <BubbleGradientContext.Provider value={gradientStore}>{t23}</BubbleGradientContext.Provider>;
361
- $[103] = gradientStore;
369
+ if ($[103] !== t21 || $[104] !== t23) {
370
+ t24 = <MessageRowStoreContext.Provider value={t21}>{t23}</MessageRowStoreContext.Provider>;
371
+ $[103] = t21;
362
372
  $[104] = t23;
363
373
  $[105] = t24;
364
374
  } else {
365
375
  t24 = $[105];
366
376
  }
367
- return t24;
377
+ let t25;
378
+ if ($[106] !== gradientStore || $[107] !== t24) {
379
+ t25 = <BubbleGradientContext.Provider value={gradientStore}>{t24}</BubbleGradientContext.Provider>;
380
+ $[106] = gradientStore;
381
+ $[107] = t24;
382
+ $[108] = t25;
383
+ } else {
384
+ t25 = $[108];
385
+ }
386
+ return t25;
368
387
  };
369
388
  //# sourceMappingURL=index.js.map