@oxy.so/bloom 5.1.0 → 5.2.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 (502) hide show
  1. package/docs/adoption-matrix.mdx +9 -9
  2. package/docs/app-shell.mdx +3 -1
  3. package/docs/button.mdx +2 -0
  4. package/docs/card-form.mdx +2 -0
  5. package/docs/chat-composer.mdx +1 -1
  6. package/docs/chat-people.mdx +8 -0
  7. package/docs/earnings.mdx +2 -0
  8. package/docs/field.mdx +2 -0
  9. package/docs/label.mdx +2 -0
  10. package/docs/payment-method.mdx +2 -0
  11. package/docs/place-details.mdx +2 -2
  12. package/docs/proof-of-delivery.mdx +4 -0
  13. package/docs/select.mdx +2 -0
  14. package/docs/settings-modal.mdx +15 -0
  15. package/lib/commonjs/ai-chat/AiChatResizeHandle.js +166 -0
  16. package/lib/commonjs/ai-chat/AiChatResizeHandle.js.map +1 -0
  17. package/lib/commonjs/ai-chat/AiChatShell.js +6 -154
  18. package/lib/commonjs/ai-chat/AiChatShell.js.map +1 -1
  19. package/lib/commonjs/ai-chat/index.js +2 -1
  20. package/lib/commonjs/ai-chat/index.js.map +1 -1
  21. package/lib/commonjs/ai-chat/index.web.js +2 -1
  22. package/lib/commonjs/ai-chat/index.web.js.map +1 -1
  23. package/lib/commonjs/ai-chat/messages.js +15 -30
  24. package/lib/commonjs/ai-chat/messages.js.map +1 -1
  25. package/lib/commonjs/app-shell/AppShellSplit.js +2 -2
  26. package/lib/commonjs/app-shell/AppShellSplit.js.map +1 -1
  27. package/lib/commonjs/button/Button.js +36 -3
  28. package/lib/commonjs/button/Button.js.map +1 -1
  29. package/lib/commonjs/button/GlyphButton.js +7 -3
  30. package/lib/commonjs/button/GlyphButton.js.map +1 -1
  31. package/lib/commonjs/card-form/shared.js +3 -2
  32. package/lib/commonjs/card-form/shared.js.map +1 -1
  33. package/lib/commonjs/chat-composer/AttachmentMenu.js +8 -227
  34. package/lib/commonjs/chat-composer/AttachmentMenu.js.map +1 -1
  35. package/lib/commonjs/chat-composer/AttachmentMenu.web.js +16 -0
  36. package/lib/commonjs/chat-composer/AttachmentMenu.web.js.map +1 -0
  37. package/lib/commonjs/chat-composer/ChatComposer.js +9 -388
  38. package/lib/commonjs/chat-composer/ChatComposer.js.map +1 -1
  39. package/lib/commonjs/chat-composer/ChatComposer.web.js +16 -0
  40. package/lib/commonjs/chat-composer/ChatComposer.web.js.map +1 -0
  41. package/lib/commonjs/chat-composer/ComposerAttachmentStrip.js +5 -200
  42. package/lib/commonjs/chat-composer/ComposerAttachmentStrip.js.map +1 -1
  43. package/lib/commonjs/chat-composer/ComposerAttachmentStrip.web.js +12 -0
  44. package/lib/commonjs/chat-composer/ComposerAttachmentStrip.web.js.map +1 -0
  45. package/lib/commonjs/chat-composer/ComposerBanner.js +5 -163
  46. package/lib/commonjs/chat-composer/ComposerBanner.js.map +1 -1
  47. package/lib/commonjs/chat-composer/ComposerBanner.web.js +12 -0
  48. package/lib/commonjs/chat-composer/ComposerBanner.web.js.map +1 -0
  49. package/lib/commonjs/chat-composer/EmojiPicker.js +6 -443
  50. package/lib/commonjs/chat-composer/EmojiPicker.js.map +1 -1
  51. package/lib/commonjs/chat-composer/EmojiPicker.web.js +14 -0
  52. package/lib/commonjs/chat-composer/EmojiPicker.web.js.map +1 -0
  53. package/lib/commonjs/chat-composer/MessageContextMenu.js +12 -102
  54. package/lib/commonjs/chat-composer/MessageContextMenu.js.map +1 -1
  55. package/lib/commonjs/chat-composer/MessageContextMenu.web.js +19 -0
  56. package/lib/commonjs/chat-composer/MessageContextMenu.web.js.map +1 -0
  57. package/lib/commonjs/chat-composer/ReactionPicker.js +6 -107
  58. package/lib/commonjs/chat-composer/ReactionPicker.js.map +1 -1
  59. package/lib/commonjs/chat-composer/ReactionPicker.web.js +14 -0
  60. package/lib/commonjs/chat-composer/ReactionPicker.web.js.map +1 -0
  61. package/lib/commonjs/chat-composer/SuggestionList.js +5 -222
  62. package/lib/commonjs/chat-composer/SuggestionList.js.map +1 -1
  63. package/lib/commonjs/chat-composer/SuggestionList.web.js +12 -0
  64. package/lib/commonjs/chat-composer/SuggestionList.web.js.map +1 -0
  65. package/lib/commonjs/chat-composer/VoiceRecorder.js +7 -263
  66. package/lib/commonjs/chat-composer/VoiceRecorder.js.map +1 -1
  67. package/lib/commonjs/chat-composer/VoiceRecorder.web.js +16 -0
  68. package/lib/commonjs/chat-composer/VoiceRecorder.web.js.map +1 -0
  69. package/lib/commonjs/chat-composer/create-attachment-menu.js +243 -0
  70. package/lib/commonjs/chat-composer/create-attachment-menu.js.map +1 -0
  71. package/lib/commonjs/chat-composer/create-chat-composer.js +400 -0
  72. package/lib/commonjs/chat-composer/create-chat-composer.js.map +1 -0
  73. package/lib/commonjs/chat-composer/create-composer-attachment-strip.js +212 -0
  74. package/lib/commonjs/chat-composer/create-composer-attachment-strip.js.map +1 -0
  75. package/lib/commonjs/chat-composer/create-composer-banner.js +176 -0
  76. package/lib/commonjs/chat-composer/create-composer-banner.js.map +1 -0
  77. package/lib/commonjs/chat-composer/create-emoji-picker.js +456 -0
  78. package/lib/commonjs/chat-composer/create-emoji-picker.js.map +1 -0
  79. package/lib/commonjs/chat-composer/create-message-context-menu.js +119 -0
  80. package/lib/commonjs/chat-composer/create-message-context-menu.js.map +1 -0
  81. package/lib/commonjs/chat-composer/create-reaction-picker.js +120 -0
  82. package/lib/commonjs/chat-composer/create-reaction-picker.js.map +1 -0
  83. package/lib/commonjs/chat-composer/create-suggestion-list.js +234 -0
  84. package/lib/commonjs/chat-composer/create-suggestion-list.js.map +1 -0
  85. package/lib/commonjs/chat-composer/create-voice-recorder.js +277 -0
  86. package/lib/commonjs/chat-composer/create-voice-recorder.js.map +1 -0
  87. package/lib/commonjs/chat-composer/index.js +9 -9
  88. package/lib/commonjs/chat-composer/index.web.js +18 -18
  89. package/lib/commonjs/chat-composer/index.web.js.map +1 -1
  90. package/lib/commonjs/chat-people/contact-row.js +13 -0
  91. package/lib/commonjs/chat-people/contact-row.js.map +1 -0
  92. package/lib/commonjs/chat-screen/ChatSplitLayout.js +2 -2
  93. package/lib/commonjs/chat-screen/ChatSplitLayout.js.map +1 -1
  94. package/lib/commonjs/earnings/EarningsSummary.js +12 -2
  95. package/lib/commonjs/earnings/EarningsSummary.js.map +1 -1
  96. package/lib/commonjs/field/Field.js +2 -0
  97. package/lib/commonjs/field/Field.js.map +1 -1
  98. package/lib/commonjs/item/Item.js +16 -8
  99. package/lib/commonjs/item/Item.js.map +1 -1
  100. package/lib/commonjs/job-board/JobCard.js +6 -2
  101. package/lib/commonjs/job-board/JobCard.js.map +1 -1
  102. package/lib/commonjs/label/Label.js +2 -1
  103. package/lib/commonjs/label/Label.js.map +1 -1
  104. package/lib/commonjs/listing-details/AmenityList.js +4 -3
  105. package/lib/commonjs/listing-details/AmenityList.js.map +1 -1
  106. package/lib/commonjs/locale/common-messages.js +30 -15
  107. package/lib/commonjs/locale/common-messages.js.map +1 -1
  108. package/lib/commonjs/mail-compose/MailComposeSurface.js +1 -1
  109. package/lib/commonjs/overlay/InteractionBoundary.js +28 -0
  110. package/lib/commonjs/overlay/InteractionBoundary.js.map +1 -0
  111. package/lib/commonjs/payment-method/PaymentMethodList.js +3 -2
  112. package/lib/commonjs/payment-method/PaymentMethodList.js.map +1 -1
  113. package/lib/commonjs/place-details/PlaceAmenities.js +17 -6
  114. package/lib/commonjs/place-details/PlaceAmenities.js.map +1 -1
  115. package/lib/commonjs/place-details/PlacePopularTimes.js +7 -1
  116. package/lib/commonjs/place-details/PlacePopularTimes.js.map +1 -1
  117. package/lib/commonjs/proof-of-delivery/ProofOfDelivery.js +10 -1
  118. package/lib/commonjs/proof-of-delivery/ProofOfDelivery.js.map +1 -1
  119. package/lib/commonjs/proof-of-delivery/shared.js +1 -1
  120. package/lib/commonjs/proof-of-delivery/shared.js.map +1 -1
  121. package/lib/commonjs/select/Select.js +7 -4
  122. package/lib/commonjs/select/Select.js.map +1 -1
  123. package/lib/commonjs/select/Select.web.js +7 -4
  124. package/lib/commonjs/select/Select.web.js.map +1 -1
  125. package/lib/commonjs/select/use-required-description.js +37 -0
  126. package/lib/commonjs/select/use-required-description.js.map +1 -0
  127. package/lib/commonjs/settings-modal/rows.js +37 -0
  128. package/lib/commonjs/settings-modal/rows.js.map +1 -0
  129. package/lib/module/ai-chat/AiChatResizeHandle.js +160 -0
  130. package/lib/module/ai-chat/AiChatResizeHandle.js.map +1 -0
  131. package/lib/module/ai-chat/AiChatShell.js +5 -152
  132. package/lib/module/ai-chat/AiChatShell.js.map +1 -1
  133. package/lib/module/ai-chat/index.js +2 -1
  134. package/lib/module/ai-chat/index.js.map +1 -1
  135. package/lib/module/ai-chat/index.web.js +2 -1
  136. package/lib/module/ai-chat/index.web.js.map +1 -1
  137. package/lib/module/ai-chat/messages.js +15 -30
  138. package/lib/module/ai-chat/messages.js.map +1 -1
  139. package/lib/module/app-shell/AppShellSplit.js +1 -1
  140. package/lib/module/app-shell/AppShellSplit.js.map +1 -1
  141. package/lib/module/button/Button.js +36 -3
  142. package/lib/module/button/Button.js.map +1 -1
  143. package/lib/module/button/GlyphButton.js +7 -3
  144. package/lib/module/button/GlyphButton.js.map +1 -1
  145. package/lib/module/card-form/shared.js +3 -2
  146. package/lib/module/card-form/shared.js.map +1 -1
  147. package/lib/module/chat-composer/AttachmentMenu.js +7 -226
  148. package/lib/module/chat-composer/AttachmentMenu.js.map +1 -1
  149. package/lib/module/chat-composer/AttachmentMenu.web.js +12 -0
  150. package/lib/module/chat-composer/AttachmentMenu.web.js.map +1 -0
  151. package/lib/module/chat-composer/ChatComposer.js +8 -385
  152. package/lib/module/chat-composer/ChatComposer.js.map +1 -1
  153. package/lib/module/chat-composer/ChatComposer.web.js +12 -0
  154. package/lib/module/chat-composer/ChatComposer.web.js.map +1 -0
  155. package/lib/module/chat-composer/ComposerAttachmentStrip.js +4 -196
  156. package/lib/module/chat-composer/ComposerAttachmentStrip.js.map +1 -1
  157. package/lib/module/chat-composer/ComposerAttachmentStrip.web.js +8 -0
  158. package/lib/module/chat-composer/ComposerAttachmentStrip.web.js.map +1 -0
  159. package/lib/module/chat-composer/ComposerBanner.js +4 -162
  160. package/lib/module/chat-composer/ComposerBanner.js.map +1 -1
  161. package/lib/module/chat-composer/ComposerBanner.web.js +8 -0
  162. package/lib/module/chat-composer/ComposerBanner.web.js.map +1 -0
  163. package/lib/module/chat-composer/EmojiPicker.js +5 -440
  164. package/lib/module/chat-composer/EmojiPicker.js.map +1 -1
  165. package/lib/module/chat-composer/EmojiPicker.web.js +10 -0
  166. package/lib/module/chat-composer/EmojiPicker.web.js.map +1 -0
  167. package/lib/module/chat-composer/MessageContextMenu.js +11 -99
  168. package/lib/module/chat-composer/MessageContextMenu.js.map +1 -1
  169. package/lib/module/chat-composer/MessageContextMenu.web.js +15 -0
  170. package/lib/module/chat-composer/MessageContextMenu.web.js.map +1 -0
  171. package/lib/module/chat-composer/ReactionPicker.js +5 -104
  172. package/lib/module/chat-composer/ReactionPicker.js.map +1 -1
  173. package/lib/module/chat-composer/ReactionPicker.web.js +10 -0
  174. package/lib/module/chat-composer/ReactionPicker.web.js.map +1 -0
  175. package/lib/module/chat-composer/SuggestionList.js +4 -219
  176. package/lib/module/chat-composer/SuggestionList.js.map +1 -1
  177. package/lib/module/chat-composer/SuggestionList.web.js +8 -0
  178. package/lib/module/chat-composer/SuggestionList.web.js.map +1 -0
  179. package/lib/module/chat-composer/VoiceRecorder.js +6 -260
  180. package/lib/module/chat-composer/VoiceRecorder.js.map +1 -1
  181. package/lib/module/chat-composer/VoiceRecorder.web.js +12 -0
  182. package/lib/module/chat-composer/VoiceRecorder.web.js.map +1 -0
  183. package/lib/module/chat-composer/create-attachment-menu.js +238 -0
  184. package/lib/module/chat-composer/create-attachment-menu.js.map +1 -0
  185. package/lib/module/chat-composer/create-chat-composer.js +395 -0
  186. package/lib/module/chat-composer/create-chat-composer.js.map +1 -0
  187. package/lib/module/chat-composer/create-composer-attachment-strip.js +206 -0
  188. package/lib/module/chat-composer/create-composer-attachment-strip.js.map +1 -0
  189. package/lib/module/chat-composer/create-composer-banner.js +171 -0
  190. package/lib/module/chat-composer/create-composer-banner.js.map +1 -0
  191. package/lib/module/chat-composer/create-emoji-picker.js +451 -0
  192. package/lib/module/chat-composer/create-emoji-picker.js.map +1 -0
  193. package/lib/module/chat-composer/create-message-context-menu.js +114 -0
  194. package/lib/module/chat-composer/create-message-context-menu.js.map +1 -0
  195. package/lib/module/chat-composer/create-reaction-picker.js +115 -0
  196. package/lib/module/chat-composer/create-reaction-picker.js.map +1 -0
  197. package/lib/module/chat-composer/create-suggestion-list.js +229 -0
  198. package/lib/module/chat-composer/create-suggestion-list.js.map +1 -0
  199. package/lib/module/chat-composer/create-voice-recorder.js +272 -0
  200. package/lib/module/chat-composer/create-voice-recorder.js.map +1 -0
  201. package/lib/module/chat-composer/index.js +9 -9
  202. package/lib/module/chat-composer/index.js.map +1 -1
  203. package/lib/module/chat-composer/index.web.js +9 -9
  204. package/lib/module/chat-composer/index.web.js.map +1 -1
  205. package/lib/module/chat-people/contact-row.js +10 -0
  206. package/lib/module/chat-people/contact-row.js.map +1 -0
  207. package/lib/module/chat-screen/ChatSplitLayout.js +1 -1
  208. package/lib/module/chat-screen/ChatSplitLayout.js.map +1 -1
  209. package/lib/module/earnings/EarningsSummary.js +12 -2
  210. package/lib/module/earnings/EarningsSummary.js.map +1 -1
  211. package/lib/module/field/Field.js +2 -0
  212. package/lib/module/field/Field.js.map +1 -1
  213. package/lib/module/item/Item.js +16 -8
  214. package/lib/module/item/Item.js.map +1 -1
  215. package/lib/module/job-board/JobCard.js +6 -2
  216. package/lib/module/job-board/JobCard.js.map +1 -1
  217. package/lib/module/label/Label.js +2 -1
  218. package/lib/module/label/Label.js.map +1 -1
  219. package/lib/module/listing-details/AmenityList.js +4 -3
  220. package/lib/module/listing-details/AmenityList.js.map +1 -1
  221. package/lib/module/locale/common-messages.js +30 -15
  222. package/lib/module/locale/common-messages.js.map +1 -1
  223. package/lib/module/mail-compose/MailComposeSurface.js +1 -1
  224. package/lib/module/mail-compose/MailComposeSurface.js.map +1 -1
  225. package/lib/module/overlay/InteractionBoundary.js +25 -0
  226. package/lib/module/overlay/InteractionBoundary.js.map +1 -0
  227. package/lib/module/payment-method/PaymentMethodList.js +3 -2
  228. package/lib/module/payment-method/PaymentMethodList.js.map +1 -1
  229. package/lib/module/place-details/PlaceAmenities.js +15 -4
  230. package/lib/module/place-details/PlaceAmenities.js.map +1 -1
  231. package/lib/module/place-details/PlacePopularTimes.js +7 -1
  232. package/lib/module/place-details/PlacePopularTimes.js.map +1 -1
  233. package/lib/module/proof-of-delivery/ProofOfDelivery.js +10 -1
  234. package/lib/module/proof-of-delivery/ProofOfDelivery.js.map +1 -1
  235. package/lib/module/proof-of-delivery/shared.js +1 -1
  236. package/lib/module/proof-of-delivery/shared.js.map +1 -1
  237. package/lib/module/select/Select.js +7 -4
  238. package/lib/module/select/Select.js.map +1 -1
  239. package/lib/module/select/Select.web.js +7 -4
  240. package/lib/module/select/Select.web.js.map +1 -1
  241. package/lib/module/select/use-required-description.js +33 -0
  242. package/lib/module/select/use-required-description.js.map +1 -0
  243. package/lib/module/settings-modal/rows.js +10 -0
  244. package/lib/module/settings-modal/rows.js.map +1 -0
  245. package/lib/typescript/commonjs/ai-chat/AiChatResizeHandle.d.ts +11 -0
  246. package/lib/typescript/commonjs/ai-chat/AiChatResizeHandle.d.ts.map +1 -0
  247. package/lib/typescript/commonjs/ai-chat/AiChatShell.d.ts +1 -10
  248. package/lib/typescript/commonjs/ai-chat/AiChatShell.d.ts.map +1 -1
  249. package/lib/typescript/commonjs/ai-chat/index.d.ts +2 -1
  250. package/lib/typescript/commonjs/ai-chat/index.d.ts.map +1 -1
  251. package/lib/typescript/commonjs/ai-chat/index.web.d.ts +2 -1
  252. package/lib/typescript/commonjs/ai-chat/index.web.d.ts.map +1 -1
  253. package/lib/typescript/commonjs/ai-chat/messages.d.ts +0 -1
  254. package/lib/typescript/commonjs/ai-chat/messages.d.ts.map +1 -1
  255. package/lib/typescript/commonjs/button/Button.d.ts.map +1 -1
  256. package/lib/typescript/commonjs/card-form/shared.d.ts +2 -1
  257. package/lib/typescript/commonjs/card-form/shared.d.ts.map +1 -1
  258. package/lib/typescript/commonjs/chat-composer/AttachmentMenu.d.ts +1 -2
  259. package/lib/typescript/commonjs/chat-composer/AttachmentMenu.d.ts.map +1 -1
  260. package/lib/typescript/commonjs/chat-composer/AttachmentMenu.web.d.ts +2 -0
  261. package/lib/typescript/commonjs/chat-composer/AttachmentMenu.web.d.ts.map +1 -0
  262. package/lib/typescript/commonjs/chat-composer/ChatComposer.d.ts +1 -2
  263. package/lib/typescript/commonjs/chat-composer/ChatComposer.d.ts.map +1 -1
  264. package/lib/typescript/commonjs/chat-composer/ChatComposer.web.d.ts +2 -0
  265. package/lib/typescript/commonjs/chat-composer/ChatComposer.web.d.ts.map +1 -0
  266. package/lib/typescript/commonjs/chat-composer/ComposerAttachmentStrip.d.ts +1 -2
  267. package/lib/typescript/commonjs/chat-composer/ComposerAttachmentStrip.d.ts.map +1 -1
  268. package/lib/typescript/commonjs/chat-composer/ComposerAttachmentStrip.web.d.ts +2 -0
  269. package/lib/typescript/commonjs/chat-composer/ComposerAttachmentStrip.web.d.ts.map +1 -0
  270. package/lib/typescript/commonjs/chat-composer/ComposerBanner.d.ts +1 -2
  271. package/lib/typescript/commonjs/chat-composer/ComposerBanner.d.ts.map +1 -1
  272. package/lib/typescript/commonjs/chat-composer/ComposerBanner.web.d.ts +2 -0
  273. package/lib/typescript/commonjs/chat-composer/ComposerBanner.web.d.ts.map +1 -0
  274. package/lib/typescript/commonjs/chat-composer/EmojiPicker.d.ts +1 -2
  275. package/lib/typescript/commonjs/chat-composer/EmojiPicker.d.ts.map +1 -1
  276. package/lib/typescript/commonjs/chat-composer/EmojiPicker.web.d.ts +2 -0
  277. package/lib/typescript/commonjs/chat-composer/EmojiPicker.web.d.ts.map +1 -0
  278. package/lib/typescript/commonjs/chat-composer/MessageContextMenu.d.ts +1 -2
  279. package/lib/typescript/commonjs/chat-composer/MessageContextMenu.d.ts.map +1 -1
  280. package/lib/typescript/commonjs/chat-composer/MessageContextMenu.web.d.ts +2 -0
  281. package/lib/typescript/commonjs/chat-composer/MessageContextMenu.web.d.ts.map +1 -0
  282. package/lib/typescript/commonjs/chat-composer/ReactionPicker.d.ts +1 -2
  283. package/lib/typescript/commonjs/chat-composer/ReactionPicker.d.ts.map +1 -1
  284. package/lib/typescript/commonjs/chat-composer/ReactionPicker.web.d.ts +2 -0
  285. package/lib/typescript/commonjs/chat-composer/ReactionPicker.web.d.ts.map +1 -0
  286. package/lib/typescript/commonjs/chat-composer/SuggestionList.d.ts +1 -2
  287. package/lib/typescript/commonjs/chat-composer/SuggestionList.d.ts.map +1 -1
  288. package/lib/typescript/commonjs/chat-composer/SuggestionList.web.d.ts +2 -0
  289. package/lib/typescript/commonjs/chat-composer/SuggestionList.web.d.ts.map +1 -0
  290. package/lib/typescript/commonjs/chat-composer/VoiceRecorder.d.ts +1 -2
  291. package/lib/typescript/commonjs/chat-composer/VoiceRecorder.d.ts.map +1 -1
  292. package/lib/typescript/commonjs/chat-composer/VoiceRecorder.web.d.ts +2 -0
  293. package/lib/typescript/commonjs/chat-composer/VoiceRecorder.web.d.ts.map +1 -0
  294. package/lib/typescript/commonjs/chat-composer/create-attachment-menu.d.ts +11 -0
  295. package/lib/typescript/commonjs/chat-composer/create-attachment-menu.d.ts.map +1 -0
  296. package/lib/typescript/commonjs/chat-composer/create-chat-composer.d.ts +11 -0
  297. package/lib/typescript/commonjs/chat-composer/create-chat-composer.d.ts.map +1 -0
  298. package/lib/typescript/commonjs/chat-composer/create-composer-attachment-strip.d.ts +7 -0
  299. package/lib/typescript/commonjs/chat-composer/create-composer-attachment-strip.d.ts.map +1 -0
  300. package/lib/typescript/commonjs/chat-composer/create-composer-banner.d.ts +7 -0
  301. package/lib/typescript/commonjs/chat-composer/create-composer-banner.d.ts.map +1 -0
  302. package/lib/typescript/commonjs/chat-composer/create-emoji-picker.d.ts +9 -0
  303. package/lib/typescript/commonjs/chat-composer/create-emoji-picker.d.ts.map +1 -0
  304. package/lib/typescript/commonjs/chat-composer/create-message-context-menu.d.ts +14 -0
  305. package/lib/typescript/commonjs/chat-composer/create-message-context-menu.d.ts.map +1 -0
  306. package/lib/typescript/commonjs/chat-composer/create-reaction-picker.d.ts +9 -0
  307. package/lib/typescript/commonjs/chat-composer/create-reaction-picker.d.ts.map +1 -0
  308. package/lib/typescript/commonjs/chat-composer/create-suggestion-list.d.ts +7 -0
  309. package/lib/typescript/commonjs/chat-composer/create-suggestion-list.d.ts.map +1 -0
  310. package/lib/typescript/commonjs/chat-composer/create-voice-recorder.d.ts +11 -0
  311. package/lib/typescript/commonjs/chat-composer/create-voice-recorder.d.ts.map +1 -0
  312. package/lib/typescript/commonjs/chat-composer/index.web.d.ts +9 -9
  313. package/lib/typescript/commonjs/chat-composer/index.web.d.ts.map +1 -1
  314. package/lib/typescript/commonjs/chat-people/contact-row.d.ts +9 -0
  315. package/lib/typescript/commonjs/chat-people/contact-row.d.ts.map +1 -0
  316. package/lib/typescript/commonjs/earnings/EarningsSummary.d.ts.map +1 -1
  317. package/lib/typescript/commonjs/field/Field.d.ts +1 -1
  318. package/lib/typescript/commonjs/field/Field.d.ts.map +1 -1
  319. package/lib/typescript/commonjs/field/types.d.ts +2 -0
  320. package/lib/typescript/commonjs/field/types.d.ts.map +1 -1
  321. package/lib/typescript/commonjs/floating/types.d.ts +1 -0
  322. package/lib/typescript/commonjs/floating/types.d.ts.map +1 -1
  323. package/lib/typescript/commonjs/item/Item.d.ts.map +1 -1
  324. package/lib/typescript/commonjs/job-board/JobCard.d.ts.map +1 -1
  325. package/lib/typescript/commonjs/label/Label.d.ts +1 -1
  326. package/lib/typescript/commonjs/label/Label.d.ts.map +1 -1
  327. package/lib/typescript/commonjs/label/types.d.ts +2 -0
  328. package/lib/typescript/commonjs/label/types.d.ts.map +1 -1
  329. package/lib/typescript/commonjs/listing-details/AmenityList.d.ts.map +1 -1
  330. package/lib/typescript/commonjs/locale/common-messages.d.ts +2 -0
  331. package/lib/typescript/commonjs/locale/common-messages.d.ts.map +1 -1
  332. package/lib/typescript/commonjs/overlay/InteractionBoundary.d.ts +7 -0
  333. package/lib/typescript/commonjs/overlay/InteractionBoundary.d.ts.map +1 -0
  334. package/lib/typescript/commonjs/payment-method/PaymentMethodList.d.ts.map +1 -1
  335. package/lib/typescript/commonjs/place-details/PlaceAmenities.d.ts.map +1 -1
  336. package/lib/typescript/commonjs/place-details/PlacePopularTimes.d.ts.map +1 -1
  337. package/lib/typescript/commonjs/proof-of-delivery/ProofOfDelivery.d.ts.map +1 -1
  338. package/lib/typescript/commonjs/select/Select.d.ts.map +1 -1
  339. package/lib/typescript/commonjs/select/Select.web.d.ts.map +1 -1
  340. package/lib/typescript/commonjs/select/use-required-description.d.ts +7 -0
  341. package/lib/typescript/commonjs/select/use-required-description.d.ts.map +1 -0
  342. package/lib/typescript/commonjs/settings-modal/rows.d.ts +9 -0
  343. package/lib/typescript/commonjs/settings-modal/rows.d.ts.map +1 -0
  344. package/lib/typescript/module/ai-chat/AiChatResizeHandle.d.ts +11 -0
  345. package/lib/typescript/module/ai-chat/AiChatResizeHandle.d.ts.map +1 -0
  346. package/lib/typescript/module/ai-chat/AiChatShell.d.ts +1 -10
  347. package/lib/typescript/module/ai-chat/AiChatShell.d.ts.map +1 -1
  348. package/lib/typescript/module/ai-chat/index.d.ts +2 -1
  349. package/lib/typescript/module/ai-chat/index.d.ts.map +1 -1
  350. package/lib/typescript/module/ai-chat/index.web.d.ts +2 -1
  351. package/lib/typescript/module/ai-chat/index.web.d.ts.map +1 -1
  352. package/lib/typescript/module/ai-chat/messages.d.ts +0 -1
  353. package/lib/typescript/module/ai-chat/messages.d.ts.map +1 -1
  354. package/lib/typescript/module/button/Button.d.ts.map +1 -1
  355. package/lib/typescript/module/card-form/shared.d.ts +2 -1
  356. package/lib/typescript/module/card-form/shared.d.ts.map +1 -1
  357. package/lib/typescript/module/chat-composer/AttachmentMenu.d.ts +1 -2
  358. package/lib/typescript/module/chat-composer/AttachmentMenu.d.ts.map +1 -1
  359. package/lib/typescript/module/chat-composer/AttachmentMenu.web.d.ts +2 -0
  360. package/lib/typescript/module/chat-composer/AttachmentMenu.web.d.ts.map +1 -0
  361. package/lib/typescript/module/chat-composer/ChatComposer.d.ts +1 -2
  362. package/lib/typescript/module/chat-composer/ChatComposer.d.ts.map +1 -1
  363. package/lib/typescript/module/chat-composer/ChatComposer.web.d.ts +2 -0
  364. package/lib/typescript/module/chat-composer/ChatComposer.web.d.ts.map +1 -0
  365. package/lib/typescript/module/chat-composer/ComposerAttachmentStrip.d.ts +1 -2
  366. package/lib/typescript/module/chat-composer/ComposerAttachmentStrip.d.ts.map +1 -1
  367. package/lib/typescript/module/chat-composer/ComposerAttachmentStrip.web.d.ts +2 -0
  368. package/lib/typescript/module/chat-composer/ComposerAttachmentStrip.web.d.ts.map +1 -0
  369. package/lib/typescript/module/chat-composer/ComposerBanner.d.ts +1 -2
  370. package/lib/typescript/module/chat-composer/ComposerBanner.d.ts.map +1 -1
  371. package/lib/typescript/module/chat-composer/ComposerBanner.web.d.ts +2 -0
  372. package/lib/typescript/module/chat-composer/ComposerBanner.web.d.ts.map +1 -0
  373. package/lib/typescript/module/chat-composer/EmojiPicker.d.ts +1 -2
  374. package/lib/typescript/module/chat-composer/EmojiPicker.d.ts.map +1 -1
  375. package/lib/typescript/module/chat-composer/EmojiPicker.web.d.ts +2 -0
  376. package/lib/typescript/module/chat-composer/EmojiPicker.web.d.ts.map +1 -0
  377. package/lib/typescript/module/chat-composer/MessageContextMenu.d.ts +1 -2
  378. package/lib/typescript/module/chat-composer/MessageContextMenu.d.ts.map +1 -1
  379. package/lib/typescript/module/chat-composer/MessageContextMenu.web.d.ts +2 -0
  380. package/lib/typescript/module/chat-composer/MessageContextMenu.web.d.ts.map +1 -0
  381. package/lib/typescript/module/chat-composer/ReactionPicker.d.ts +1 -2
  382. package/lib/typescript/module/chat-composer/ReactionPicker.d.ts.map +1 -1
  383. package/lib/typescript/module/chat-composer/ReactionPicker.web.d.ts +2 -0
  384. package/lib/typescript/module/chat-composer/ReactionPicker.web.d.ts.map +1 -0
  385. package/lib/typescript/module/chat-composer/SuggestionList.d.ts +1 -2
  386. package/lib/typescript/module/chat-composer/SuggestionList.d.ts.map +1 -1
  387. package/lib/typescript/module/chat-composer/SuggestionList.web.d.ts +2 -0
  388. package/lib/typescript/module/chat-composer/SuggestionList.web.d.ts.map +1 -0
  389. package/lib/typescript/module/chat-composer/VoiceRecorder.d.ts +1 -2
  390. package/lib/typescript/module/chat-composer/VoiceRecorder.d.ts.map +1 -1
  391. package/lib/typescript/module/chat-composer/VoiceRecorder.web.d.ts +2 -0
  392. package/lib/typescript/module/chat-composer/VoiceRecorder.web.d.ts.map +1 -0
  393. package/lib/typescript/module/chat-composer/create-attachment-menu.d.ts +11 -0
  394. package/lib/typescript/module/chat-composer/create-attachment-menu.d.ts.map +1 -0
  395. package/lib/typescript/module/chat-composer/create-chat-composer.d.ts +11 -0
  396. package/lib/typescript/module/chat-composer/create-chat-composer.d.ts.map +1 -0
  397. package/lib/typescript/module/chat-composer/create-composer-attachment-strip.d.ts +7 -0
  398. package/lib/typescript/module/chat-composer/create-composer-attachment-strip.d.ts.map +1 -0
  399. package/lib/typescript/module/chat-composer/create-composer-banner.d.ts +7 -0
  400. package/lib/typescript/module/chat-composer/create-composer-banner.d.ts.map +1 -0
  401. package/lib/typescript/module/chat-composer/create-emoji-picker.d.ts +9 -0
  402. package/lib/typescript/module/chat-composer/create-emoji-picker.d.ts.map +1 -0
  403. package/lib/typescript/module/chat-composer/create-message-context-menu.d.ts +14 -0
  404. package/lib/typescript/module/chat-composer/create-message-context-menu.d.ts.map +1 -0
  405. package/lib/typescript/module/chat-composer/create-reaction-picker.d.ts +9 -0
  406. package/lib/typescript/module/chat-composer/create-reaction-picker.d.ts.map +1 -0
  407. package/lib/typescript/module/chat-composer/create-suggestion-list.d.ts +7 -0
  408. package/lib/typescript/module/chat-composer/create-suggestion-list.d.ts.map +1 -0
  409. package/lib/typescript/module/chat-composer/create-voice-recorder.d.ts +11 -0
  410. package/lib/typescript/module/chat-composer/create-voice-recorder.d.ts.map +1 -0
  411. package/lib/typescript/module/chat-composer/index.web.d.ts +9 -9
  412. package/lib/typescript/module/chat-composer/index.web.d.ts.map +1 -1
  413. package/lib/typescript/module/chat-people/contact-row.d.ts +9 -0
  414. package/lib/typescript/module/chat-people/contact-row.d.ts.map +1 -0
  415. package/lib/typescript/module/earnings/EarningsSummary.d.ts.map +1 -1
  416. package/lib/typescript/module/field/Field.d.ts +1 -1
  417. package/lib/typescript/module/field/Field.d.ts.map +1 -1
  418. package/lib/typescript/module/field/types.d.ts +2 -0
  419. package/lib/typescript/module/field/types.d.ts.map +1 -1
  420. package/lib/typescript/module/floating/types.d.ts +1 -0
  421. package/lib/typescript/module/floating/types.d.ts.map +1 -1
  422. package/lib/typescript/module/item/Item.d.ts.map +1 -1
  423. package/lib/typescript/module/job-board/JobCard.d.ts.map +1 -1
  424. package/lib/typescript/module/label/Label.d.ts +1 -1
  425. package/lib/typescript/module/label/Label.d.ts.map +1 -1
  426. package/lib/typescript/module/label/types.d.ts +2 -0
  427. package/lib/typescript/module/label/types.d.ts.map +1 -1
  428. package/lib/typescript/module/listing-details/AmenityList.d.ts.map +1 -1
  429. package/lib/typescript/module/locale/common-messages.d.ts +2 -0
  430. package/lib/typescript/module/locale/common-messages.d.ts.map +1 -1
  431. package/lib/typescript/module/overlay/InteractionBoundary.d.ts +7 -0
  432. package/lib/typescript/module/overlay/InteractionBoundary.d.ts.map +1 -0
  433. package/lib/typescript/module/payment-method/PaymentMethodList.d.ts.map +1 -1
  434. package/lib/typescript/module/place-details/PlaceAmenities.d.ts.map +1 -1
  435. package/lib/typescript/module/place-details/PlacePopularTimes.d.ts.map +1 -1
  436. package/lib/typescript/module/proof-of-delivery/ProofOfDelivery.d.ts.map +1 -1
  437. package/lib/typescript/module/select/Select.d.ts.map +1 -1
  438. package/lib/typescript/module/select/Select.web.d.ts.map +1 -1
  439. package/lib/typescript/module/select/use-required-description.d.ts +7 -0
  440. package/lib/typescript/module/select/use-required-description.d.ts.map +1 -0
  441. package/lib/typescript/module/settings-modal/rows.d.ts +9 -0
  442. package/lib/typescript/module/settings-modal/rows.d.ts.map +1 -0
  443. package/package.json +35 -1
  444. package/src/ai-chat/AiChatResizeHandle.tsx +151 -0
  445. package/src/ai-chat/AiChatShell.tsx +8 -143
  446. package/src/ai-chat/index.ts +2 -1
  447. package/src/ai-chat/index.web.ts +2 -1
  448. package/src/ai-chat/messages.ts +0 -16
  449. package/src/app-shell/AppShellSplit.tsx +1 -1
  450. package/src/button/Button.tsx +35 -10
  451. package/src/button/GlyphButton.tsx +3 -3
  452. package/src/card-form/shared.ts +3 -2
  453. package/src/chat-composer/AttachmentMenu.tsx +2 -214
  454. package/src/chat-composer/AttachmentMenu.web.tsx +5 -0
  455. package/src/chat-composer/ChatComposer.tsx +2 -459
  456. package/src/chat-composer/ChatComposer.web.tsx +6 -0
  457. package/src/chat-composer/ComposerAttachmentStrip.tsx +2 -202
  458. package/src/chat-composer/ComposerAttachmentStrip.web.tsx +4 -0
  459. package/src/chat-composer/ComposerBanner.tsx +2 -157
  460. package/src/chat-composer/ComposerBanner.web.tsx +4 -0
  461. package/src/chat-composer/EmojiPicker.tsx +2 -402
  462. package/src/chat-composer/EmojiPicker.web.tsx +5 -0
  463. package/src/chat-composer/MessageContextMenu.tsx +2 -88
  464. package/src/chat-composer/MessageContextMenu.web.tsx +12 -0
  465. package/src/chat-composer/ReactionPicker.tsx +2 -100
  466. package/src/chat-composer/ReactionPicker.web.tsx +5 -0
  467. package/src/chat-composer/SuggestionList.tsx +2 -209
  468. package/src/chat-composer/SuggestionList.web.tsx +4 -0
  469. package/src/chat-composer/VoiceRecorder.tsx +2 -287
  470. package/src/chat-composer/VoiceRecorder.web.tsx +6 -0
  471. package/src/chat-composer/create-attachment-menu.tsx +228 -0
  472. package/src/chat-composer/create-chat-composer.tsx +473 -0
  473. package/src/chat-composer/create-composer-attachment-strip.tsx +212 -0
  474. package/src/chat-composer/create-composer-banner.tsx +167 -0
  475. package/src/chat-composer/create-emoji-picker.tsx +414 -0
  476. package/src/chat-composer/create-message-context-menu.tsx +112 -0
  477. package/src/chat-composer/create-reaction-picker.tsx +112 -0
  478. package/src/chat-composer/create-suggestion-list.tsx +219 -0
  479. package/src/chat-composer/create-voice-recorder.tsx +301 -0
  480. package/src/chat-composer/index.web.ts +9 -9
  481. package/src/chat-people/contact-row.ts +8 -0
  482. package/src/chat-screen/ChatSplitLayout.tsx +1 -1
  483. package/src/earnings/EarningsSummary.tsx +9 -2
  484. package/src/field/Field.tsx +2 -1
  485. package/src/field/types.ts +2 -0
  486. package/src/floating/types.ts +1 -0
  487. package/src/item/Item.tsx +16 -11
  488. package/src/job-board/JobCard.tsx +4 -1
  489. package/src/label/Label.tsx +2 -1
  490. package/src/label/types.ts +2 -0
  491. package/src/listing-details/AmenityList.tsx +4 -3
  492. package/src/locale/common-messages.ts +17 -0
  493. package/src/overlay/InteractionBoundary.tsx +24 -0
  494. package/src/payment-method/PaymentMethodList.tsx +2 -1
  495. package/src/place-details/PlaceAmenities.tsx +9 -0
  496. package/src/place-details/PlacePopularTimes.tsx +7 -1
  497. package/src/proof-of-delivery/ProofOfDelivery.tsx +9 -1
  498. package/src/proof-of-delivery/shared.ts +1 -1
  499. package/src/select/Select.tsx +5 -1
  500. package/src/select/Select.web.tsx +5 -1
  501. package/src/select/use-required-description.tsx +20 -0
  502. package/src/settings-modal/rows.ts +21 -0
@@ -3,393 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ChatComposer = ChatComposer;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _reactNative = require("react-native");
9
- var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
10
- var _RiAddLine = require("../icons/remix/RiAddLine.js");
11
- var _RiCameraLine = require("../icons/remix/RiCameraLine.js");
12
- var _RiEmotionLine = require("../icons/remix/RiEmotionLine.js");
13
- var _RiForbidLine = require("../icons/remix/RiForbidLine.js");
14
- var _RiMic2Line = require("../icons/remix/RiMic2Line.js");
15
- var _RiSendPlaneLine = require("../icons/remix/RiSendPlaneLine.js");
16
- var _useControllableState = require("../hooks/use-controllable-state.js");
17
- var _useTextareaAutosize = require("../hooks/use-textarea-autosize.js");
18
- var _useTheme = require("../theme/use-theme.js");
19
- var _index = require("../typography/index.js");
20
- var _scale = require("../typography/scale.js");
21
- var _ComposerAttachmentStrip = require("./ComposerAttachmentStrip.js");
6
+ exports.ChatComposer = void 0;
7
+ var _ComposerAttachmentStrip = require("./ComposerAttachmentStrip");
22
8
  var _ComposerIconButton = require("./ComposerIconButton");
23
- var _shared = require("./shared.js");
24
- var _SuggestionList = require("./SuggestionList.js");
25
- var _webHooks = require("./web-hooks.js");
26
- var _messages = require("../locale/messages.js");
27
- var _messages2 = require("./messages.js");
28
- var _commonMessages = require("../locale/common-messages.js");
29
- var _jsxRuntime = require("react/jsx-runtime");
30
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
31
- /**
32
- * The message input bar of a person-to-person chat: a radius-24 pill with a
33
- * left attach button, an autosizing field, an emoji button and a right control
34
- * that swaps between a mic (nothing to send) and an accent send disc (there is).
35
- *
36
- * Presentational. Every piece of state — the draft, the banners, the pending
37
- * attachments, which suggestion is highlighted — arrives as a prop, because the
38
- * app owns drafts per conversation and a composer that kept its own would lose
39
- * them on every navigation.
40
- */
41
-
42
- const EASE_OUT = _reactNativeReanimated.Easing.bezier(0, 0, 0.2, 1);
43
-
44
- /**
45
- * One half of the mic ↔ send crossfade.
46
- *
47
- * Two things the fade must not break, neither of which the animation expresses:
48
- *
49
- * `pointerEvents` is a PROP, not a style entry — react-native-web drops it from
50
- * a style object silently, and a hidden layer that still takes the press is a
51
- * send button that fires when the field is empty.
52
- *
53
- * The hidden half leaves the ACCESSIBILITY TREE too. Both halves stay mounted so
54
- * they can cross-fade, so without this every composer announces "Send" and
55
- * "Record a voice message" side by side and only one of them does anything.
56
- * `aria-hidden` is what react-native-web reads and
57
- * `importantForAccessibility` is what React Native reads; a surface that sets
58
- * one of the two is hidden on one platform only.
59
- */
60
- function SwapLayer({
61
- shown,
62
- children
63
- }) {
64
- const reducedMotion = (0, _reactNativeReanimated.useReducedMotion)();
65
- const progress = (0, _reactNativeReanimated.useSharedValue)(shown ? 1 : 0);
66
- _react.default.useEffect(() => {
67
- progress.value = reducedMotion ? shown ? 1 : 0 : (0, _reactNativeReanimated.withTiming)(shown ? 1 : 0, {
68
- duration: _shared.SWAP_MS,
69
- easing: EASE_OUT
70
- });
71
- }, [shown, reducedMotion, progress]);
72
- const animated = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
73
- opacity: progress.value
74
- }), [progress]);
75
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
76
- pointerEvents: shown ? 'auto' : 'none',
77
- "aria-hidden": !shown,
78
- accessibilityElementsHidden: !shown,
79
- importantForAccessibility: shown ? 'auto' : 'no-hide-descendants',
80
- style: [{
81
- position: 'absolute',
82
- top: 0,
83
- left: 0
84
- }, animated],
85
- children: children
86
- });
87
- }
88
-
89
- /** A DOM keyboard event as react-native-web hands it to `onKeyPress`. */
90
-
91
- function ChatComposer({
92
- value,
93
- defaultValue = '',
94
- onValueChange,
95
- placeholder: placeholderProp,
96
- onSend,
97
- sendOn = 'enter',
98
- maxLines = _shared.DEFAULT_MAX_LINES,
99
- minLines = 1,
100
- disabled = false,
101
- notice,
102
- noticeIcon,
103
- banner,
104
- attachments,
105
- onRemoveAttachment,
106
- leading,
107
- onAttachPress,
108
- emojiSlot,
109
- onEmojiPress,
110
- onCameraPress,
111
- onMicPress,
112
- onMicPressIn,
113
- onMicPressOut,
114
- canSend,
115
- recorder,
116
- suggestions,
117
- suggestionKind = 'mention',
118
- activeIndex = -1,
119
- onActiveIndexChange,
120
- onSelectSuggestion,
121
- onEscape,
122
- onEditLast,
123
- showKeyboardHint = false,
124
- inputRef,
125
- onFocus,
126
- onBlur,
127
- labels: labelOverrides,
128
- style,
129
- testID,
130
- accessibilityLabel
131
- }) {
132
- const theme = (0, _useTheme.useTheme)();
133
- const {
134
- messages
135
- } = (0, _messages.useMessages)(_messages2.CHAT_COMPOSER_MESSAGES);
136
- const common = (0, _commonMessages.useCommonMessages)();
137
- const palette = (0, _shared.resolveChatComposerPalette)(theme);
138
- (0, _webHooks.useChatComposerWebCss)();
139
- const labels = (0, _react.useMemo)(() => ({
140
- ...(0, _shared.chatComposerLabels)(messages, common.send),
141
- ...labelOverrides
142
- }), [common.send, labelOverrides, messages]);
143
- const placeholder = placeholderProp ?? messages.message;
144
- const [text, setText] = (0, _useControllableState.useControllableState)({
145
- value,
146
- defaultValue,
147
- onChange: onValueChange
148
- });
149
- const localRef = (0, _react.useRef)(null);
150
- const setFieldRef = (0, _react.useCallback)(node => {
151
- localRef.current = node;
152
- if (inputRef) inputRef.current = node;
153
- }, [inputRef]);
154
- const minHeight = Math.max(1, minLines) * _shared.LINE_HEIGHT;
155
- const maxHeight = Math.max(minLines, maxLines) * _shared.LINE_HEIGHT;
156
- const [contentHeight, setContentHeight] = (0, _react.useState)(minHeight);
157
- const height = Math.min(maxHeight, Math.max(minHeight, contentHeight));
158
-
159
- /**
160
- * Web autosize measures the node, native reads `onContentSizeChange`.
161
- *
162
- * They are not interchangeable: react-native-web reports `scrollHeight`,
163
- * which never falls below the height already applied, so a field grown to six
164
- * lines and then emptied would stay six lines tall. `useTextareaAutosize`
165
- * collapses the node to measure it only when the draft may have got SHORTER —
166
- * collapsing on every keystroke re-laid-out the whole page three times a key.
167
- */
168
- (0, _useTextareaAutosize.useTextareaAutosize)(localRef, text, {
169
- enabled: _webHooks.IS_WEB,
170
- height,
171
- minHeight,
172
- onMeasure: setContentHeight
173
- });
174
- const onContentSizeChange = (0, _react.useCallback)(event => {
175
- if (_webHooks.IS_WEB) return;
176
- setContentHeight(event.nativeEvent.contentSize.height);
177
- }, []);
178
- const trimmed = text.trim();
179
- const hasAttachments = !!attachments && attachments.length > 0;
180
- const showSend = canSend ?? (trimmed.length > 0 || hasAttachments);
181
- const submit = (0, _react.useCallback)(() => {
182
- if (disabled || !showSend) return;
183
- onSend?.(text);
184
- if (value === undefined) setText('');
185
- }, [disabled, showSend, onSend, text, value, setText]);
186
- const openSuggestions = !!suggestions && suggestions.length > 0;
187
- const onKeyPress = (0, _react.useCallback)(event => {
188
- if (!_webHooks.IS_WEB) return;
189
- const native = event.nativeEvent;
190
- // An IME candidate window is using the same keys; committing a
191
- // composition must never send the half-written word behind it.
192
- if (native.isComposing) return;
193
- const mod = native.metaKey === true || native.ctrlKey === true;
194
- if (openSuggestions && (native.key === 'ArrowDown' || native.key === 'ArrowUp')) {
195
- event.preventDefault();
196
- const count = suggestions?.length ?? 0;
197
- const step = native.key === 'ArrowDown' ? 1 : -1;
198
- const from = activeIndex < 0 ? step > 0 ? -1 : 0 : activeIndex;
199
- onActiveIndexChange?.((from + step + count) % count);
200
- return;
201
- }
202
- if (native.key === 'Escape') {
203
- event.preventDefault();
204
- onEscape?.();
205
- return;
206
- }
207
- if (native.key === 'ArrowUp' && text.length === 0) {
208
- event.preventDefault();
209
- onEditLast?.();
210
- return;
211
- }
212
- if (native.key !== 'Enter') return;
213
- if (openSuggestions && activeIndex >= 0) {
214
- const picked = suggestions?.[activeIndex];
215
- if (picked && !picked.disabled) {
216
- event.preventDefault();
217
- onSelectSuggestion?.(picked, activeIndex);
218
- return;
219
- }
220
- }
221
- if (sendOn === 'enter' ? native.shiftKey !== true && !mod : mod) {
222
- event.preventDefault();
223
- submit();
224
- }
225
- }, [activeIndex, onActiveIndexChange, onEditLast, onEscape, onSelectSuggestion, openSuggestions, sendOn, submit, suggestions, text.length]);
226
- const bar = {
227
- flexDirection: 'row',
228
- alignItems: 'flex-end',
229
- gap: 2,
230
- minHeight: _shared.CONTROL_SIZE + _shared.BAR_PADDING * 2,
231
- borderRadius: _shared.BAR_RADIUS,
232
- borderWidth: 1,
233
- borderColor: palette.border,
234
- // A disabled bar changes its FILL rather than its opacity. Dimming the
235
- // container compounds with each control's own disabled opacity — 0.55 × 0.4
236
- // put the send disc at 0.22, which reads as a rendering fault rather than a
237
- // state.
238
- backgroundColor: disabled ? palette.inset : palette.surface,
239
- paddingLeft: _shared.BAR_PADDING,
240
- paddingRight: _shared.BAR_PADDING,
241
- paddingTop: _shared.BAR_PADDING,
242
- paddingBottom: _shared.BAR_PADDING,
243
- '--bloom-chat-composer-ring': palette.focusRing
244
- };
245
- const NoticeIcon = noticeIcon ?? _RiForbidLine.RiForbidLine;
246
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
247
- accessibilityLabel: accessibilityLabel,
248
- style: [{
249
- width: '100%',
250
- flexDirection: 'column',
251
- gap: 6
252
- }, style],
253
- testID: testID,
254
- children: [openSuggestions ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_SuggestionList.SuggestionList, {
255
- kind: suggestionKind,
256
- suggestions: suggestions ?? [],
257
- activeIndex: activeIndex,
258
- onActiveIndexChange: onActiveIndexChange,
259
- onSelectSuggestion: onSelectSuggestion,
260
- testID: testID ? `${testID}-suggestions` : undefined
261
- }) : null, banner, hasAttachments ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComposerAttachmentStrip.ComposerAttachmentStrip, {
262
- attachments: attachments ?? [],
263
- onRemove: onRemoveAttachment,
264
- testID: testID ? `${testID}-attachments` : undefined
265
- }) : null, recorder ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
266
- style: bar,
267
- testID: testID ? `${testID}-bar` : undefined,
268
- children: notice !== undefined ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
269
- style: {
270
- flexDirection: 'row',
271
- alignItems: 'center',
272
- justifyContent: 'center',
273
- gap: 8,
274
- flexGrow: 1,
275
- minHeight: _shared.CONTROL_SIZE,
276
- paddingLeft: 12,
277
- paddingRight: 12
278
- },
279
- testID: testID ? `${testID}-notice` : undefined,
280
- children: typeof notice === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
281
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(NoticeIcon, {
282
- width: 16,
283
- height: 16,
284
- fill: palette.iconSecondary
285
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
286
- variant: "body-2-regular",
287
- numberOfLines: 2,
288
- style: {
289
- color: palette.textSecondary,
290
- textAlign: 'center'
291
- },
292
- children: notice
293
- })]
294
- }) : notice
295
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
296
- children: [leading ?? (onAttachPress ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComposerIconButton.ComposerIconButton, {
297
- icon: _RiAddLine.RiAddLine,
298
- accessibilityLabel: labels.attach,
299
- onPress: onAttachPress,
300
- disabled: disabled,
301
- iconSize: 22,
302
- testID: testID ? `${testID}-attach` : undefined
303
- }) : null), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
304
- style: {
305
- flexGrow: 1,
306
- flexShrink: 1,
307
- justifyContent: 'center',
308
- minHeight: _shared.CONTROL_SIZE,
309
- paddingLeft: 6,
310
- paddingRight: 6
311
- },
312
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
313
- ref: setFieldRef,
314
- ...(0, _webHooks.dataHook)('bloomChatComposerInput'),
315
- accessibilityLabel: labels.input,
316
- multiline: true,
317
- editable: !disabled,
318
- value: text,
319
- onChangeText: setText,
320
- onKeyPress: onKeyPress,
321
- onContentSizeChange: onContentSizeChange,
322
- onFocus: onFocus,
323
- onBlur: onBlur,
324
- placeholder: placeholder,
325
- placeholderTextColor: palette.textPlaceholder,
326
- selectionColor: palette.accent,
327
- cursorColor: palette.accent,
328
- scrollEnabled: height >= maxHeight,
329
- style: {
330
- width: '100%',
331
- height,
332
- maxHeight,
333
- padding: 0,
334
- margin: 0,
335
- ..._scale.TYPE_SCALE['body-regular'],
336
- fontFamily: _webHooks.IS_WEB ? 'var(--bloom-font-sans)' : 'Inter',
337
- color: disabled ? palette.textSecondary : palette.text,
338
- backgroundColor: 'transparent'
339
- },
340
- testID: testID ? `${testID}-input` : undefined
341
- })
342
- }), onCameraPress ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComposerIconButton.ComposerIconButton, {
343
- icon: _RiCameraLine.RiCameraLine,
344
- accessibilityLabel: labels.camera,
345
- onPress: onCameraPress,
346
- disabled: disabled,
347
- testID: testID ? `${testID}-camera` : undefined
348
- }) : null, emojiSlot ?? (onEmojiPress ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComposerIconButton.ComposerIconButton, {
349
- icon: _RiEmotionLine.RiEmotionLine,
350
- accessibilityLabel: labels.emoji,
351
- onPress: onEmojiPress,
352
- disabled: disabled,
353
- testID: testID ? `${testID}-emoji` : undefined
354
- }) : null), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
355
- style: {
356
- width: _shared.CONTROL_SIZE,
357
- height: _shared.CONTROL_SIZE,
358
- marginLeft: 2
359
- },
360
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(SwapLayer, {
361
- shown: showSend,
362
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComposerIconButton.ComposerIconButton, {
363
- icon: _RiSendPlaneLine.RiSendPlaneLine,
364
- tone: "accent",
365
- accessibilityLabel: labels.send,
366
- onPress: submit,
367
- disabled: disabled,
368
- iconSize: 18,
369
- testID: testID ? `${testID}-send` : undefined
370
- })
371
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(SwapLayer, {
372
- shown: !showSend,
373
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComposerIconButton.ComposerIconButton, {
374
- icon: _RiMic2Line.RiMic2Line,
375
- accessibilityLabel: labels.mic,
376
- onPress: onMicPress,
377
- onPressIn: onMicPressIn,
378
- onPressOut: onMicPressOut,
379
- disabled: disabled,
380
- testID: testID ? `${testID}-mic` : undefined
381
- })
382
- })]
383
- })]
384
- })
385
- }), showKeyboardHint && _webHooks.IS_WEB && notice === undefined ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
386
- variant: "caption-2-regular",
387
- style: {
388
- color: palette.textPlaceholder,
389
- paddingLeft: 14
390
- },
391
- children: sendOn === 'enter' ? labels.enterHint : labels.modEnterHint
392
- }) : null]
393
- });
394
- }
9
+ var _SuggestionList = require("./SuggestionList");
10
+ var _createChatComposer = require("./create-chat-composer.js");
11
+ const ChatComposer = exports.ChatComposer = (0, _createChatComposer.createChatComposer)({
12
+ ComposerAttachmentStrip: _ComposerAttachmentStrip.ComposerAttachmentStrip,
13
+ ComposerIconButton: _ComposerIconButton.ComposerIconButton,
14
+ SuggestionList: _SuggestionList.SuggestionList
15
+ });
395
16
  //# sourceMappingURL=ChatComposer.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_RiAddLine","_RiCameraLine","_RiEmotionLine","_RiForbidLine","_RiMic2Line","_RiSendPlaneLine","_useControllableState","_useTextareaAutosize","_useTheme","_index","_scale","_ComposerAttachmentStrip","_ComposerIconButton","_shared","_SuggestionList","_webHooks","_messages","_messages2","_commonMessages","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","EASE_OUT","Easing","bezier","SwapLayer","shown","children","reducedMotion","useReducedMotion","progress","useSharedValue","React","useEffect","value","withTiming","duration","SWAP_MS","easing","animated","useAnimatedStyle","opacity","jsx","View","pointerEvents","accessibilityElementsHidden","importantForAccessibility","style","position","top","left","ChatComposer","defaultValue","onValueChange","placeholder","placeholderProp","onSend","sendOn","maxLines","DEFAULT_MAX_LINES","minLines","disabled","notice","noticeIcon","banner","attachments","onRemoveAttachment","leading","onAttachPress","emojiSlot","onEmojiPress","onCameraPress","onMicPress","onMicPressIn","onMicPressOut","canSend","recorder","suggestions","suggestionKind","activeIndex","onActiveIndexChange","onSelectSuggestion","onEscape","onEditLast","showKeyboardHint","inputRef","onFocus","onBlur","labels","labelOverrides","testID","accessibilityLabel","theme","useTheme","messages","useMessages","CHAT_COMPOSER_MESSAGES","common","useCommonMessages","palette","resolveChatComposerPalette","useChatComposerWebCss","useMemo","chatComposerLabels","send","message","text","setText","useControllableState","onChange","localRef","useRef","setFieldRef","useCallback","node","current","minHeight","Math","max","LINE_HEIGHT","maxHeight","contentHeight","setContentHeight","useState","height","min","useTextareaAutosize","enabled","IS_WEB","onMeasure","onContentSizeChange","event","nativeEvent","contentSize","trimmed","trim","hasAttachments","length","showSend","submit","undefined","openSuggestions","onKeyPress","native","isComposing","mod","metaKey","ctrlKey","key","preventDefault","count","step","from","picked","shiftKey","bar","flexDirection","alignItems","gap","CONTROL_SIZE","BAR_PADDING","borderRadius","BAR_RADIUS","borderWidth","borderColor","border","backgroundColor","inset","surface","paddingLeft","paddingRight","paddingTop","paddingBottom","focusRing","NoticeIcon","RiForbidLine","jsxs","width","SuggestionList","kind","ComposerAttachmentStrip","onRemove","justifyContent","flexGrow","Fragment","fill","iconSecondary","Text","variant","numberOfLines","color","textSecondary","textAlign","ComposerIconButton","icon","RiAddLine","attach","onPress","iconSize","flexShrink","TextInput","ref","dataHook","input","multiline","editable","onChangeText","placeholderTextColor","textPlaceholder","selectionColor","accent","cursorColor","scrollEnabled","padding","margin","TYPE_SCALE","fontFamily","RiCameraLine","camera","RiEmotionLine","emoji","marginLeft","RiSendPlaneLine","tone","RiMic2Line","mic","onPressIn","onPressOut","enterHint","modEnterHint"],"sourceRoot":"../../../src","sources":["chat-composer/ChatComposer.tsx"],"mappings":";;;;;;AAUA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAQA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,gBAAA,GAAAR,OAAA;AACA,IAAAS,qBAAA,GAAAT,OAAA;AACA,IAAAU,oBAAA,GAAAV,OAAA;AAEA,IAAAW,SAAA,GAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,wBAAA,GAAAd,OAAA;AACA,IAAAe,mBAAA,GAAAf,OAAA;AACA,IAAAgB,OAAA,GAAAhB,OAAA;AAUA,IAAAiB,eAAA,GAAAjB,OAAA;AAEA,IAAAkB,SAAA,GAAAlB,OAAA;AACA,IAAAmB,SAAA,GAAAnB,OAAA;AACA,IAAAoB,UAAA,GAAApB,OAAA;AACA,IAAAqB,eAAA,GAAArB,OAAA;AAA8D,IAAAsB,WAAA,GAAAtB,OAAA;AAAA,SAAAD,wBAAAwB,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAA1B,uBAAA,YAAAA,CAAAwB,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,M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AM,EAAEA,MAAM,GAAG,GAAGA,MAAM,OAAO,GAAGkD;YAAU,CAC/C;UAAC,CACO,CAAC,eACZ,IAAA1I,WAAA,CAAAwC,GAAA,EAACjB,SAAS;YAACC,KAAK,EAAE,CAACgH,QAAS;YAAA/G,QAAA,eAC1B,IAAAzB,WAAA,CAAAwC,GAAA,EAAC/C,mBAAA,CAAAsM,kBAAkB;cACjBC,IAAI,EAAE8B,sBAAW;cACjBrI,kBAAkB,EAAEH,MAAM,CAACyI,GAAI;cAC/B5B,OAAO,EAAE7H,UAAW;cACpB0J,SAAS,EAAEzJ,YAAa;cACxB0J,UAAU,EAAEzJ,aAAc;cAC1Bb,QAAQ,EAAEA,QAAS;cACnB6B,MAAM,EAAEA,MAAM,GAAG,GAAGA,MAAM,MAAM,GAAGkD;YAAU,CAC9C;UAAC,CACO,CAAC;QAAA,CACR,CAAC;MAAA,CACP;IACH,CACG,CACP,EAEAxD,gBAAgB,IAAI4C,gBAAM,IAAIlE,MAAM,KAAK8E,SAAS,gBACjD,IAAA1I,WAAA,CAAAwC,GAAA,EAAClD,MAAA,CAAAmM,IAAI;MACHC,OAAO,EAAC,mBAAmB;MAC3B7I,KAAK,EAAE;QAAE+I,KAAK,EAAE3F,OAAO,CAAC6G,eAAe;QAAEvC,WAAW,EAAE;MAAG,CAAE;MAAA9I,QAAA,EAC1D8B,MAAM,KAAK,OAAO,GAAG+B,MAAM,CAAC4I,SAAS,GAAG5I,MAAM,CAAC6I;IAAY,CACxD,CAAC,GACL,IAAI;EAAA,CACJ,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["_ComposerAttachmentStrip","require","_ComposerIconButton","_SuggestionList","_createChatComposer","ChatComposer","exports","createChatComposer","ComposerAttachmentStrip","ComposerIconButton","SuggestionList"],"sourceRoot":"../../../src","sources":["chat-composer/ChatComposer.tsx"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AAEO,MAAMI,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,sCAAkB,EAAC;EAAEC,uBAAuB,EAAvBA,gDAAuB;EAAEC,kBAAkB,EAAlBA,sCAAkB;EAAEC,cAAc,EAAdA;AAAe,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ChatComposer = void 0;
7
+ var _ComposerAttachmentStripWeb = require("./ComposerAttachmentStrip.web.js");
8
+ var _ComposerIconButtonWeb = require("./ComposerIconButton.web.js");
9
+ var _SuggestionListWeb = require("./SuggestionList.web.js");
10
+ var _createChatComposer = require("./create-chat-composer.js");
11
+ const ChatComposer = exports.ChatComposer = (0, _createChatComposer.createChatComposer)({
12
+ ComposerAttachmentStrip: _ComposerAttachmentStripWeb.ComposerAttachmentStrip,
13
+ ComposerIconButton: _ComposerIconButtonWeb.ComposerIconButton,
14
+ SuggestionList: _SuggestionListWeb.SuggestionList
15
+ });
16
+ //# sourceMappingURL=ChatComposer.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_ComposerAttachmentStripWeb","require","_ComposerIconButtonWeb","_SuggestionListWeb","_createChatComposer","ChatComposer","exports","createChatComposer","ComposerAttachmentStrip","ComposerIconButton","SuggestionList"],"sourceRoot":"../../../src","sources":["chat-composer/ChatComposer.web.tsx"],"mappings":";;;;;;AAAA,IAAAA,2BAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AAEO,MAAMI,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,sCAAkB,EAAC;EAAEC,uBAAuB,EAAvBA,mDAAuB;EAAEC,kBAAkB,EAAlBA,yCAAkB;EAAEC,cAAc,EAAdA;AAAe,CAAC,CAAC","ignoreList":[]}
@@ -3,205 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ComposerAttachmentStrip = ComposerAttachmentStrip;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _reactNative = require("react-native");
9
- var _reactNativeSvg = _interopRequireWildcard(require("react-native-svg"));
10
- var _shared = require("../composer-panel/shared.js");
11
- var _RiCloseLine = require("../icons/remix/RiCloseLine.js");
12
- var _RiFileTextLine = require("../icons/remix/RiFileTextLine.js");
13
- var _context = require("../image-resolver/context.js");
14
- var _useTheme = require("../theme/use-theme.js");
15
- var _index = require("../typography/index.js");
6
+ exports.ComposerAttachmentStrip = void 0;
16
7
  var _ComposerIconButton = require("./ComposerIconButton");
17
- var _shared2 = require("./shared.js");
18
- var _webHooks = require("./web-hooks.js");
19
- var _messages = require("../locale/messages.js");
20
- var _messages2 = require("./messages.js");
21
- var _jsxRuntime = require("react/jsx-runtime");
22
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
23
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
24
- /**
25
- * The pending-attachment strip between the banner stack and the bar.
26
- *
27
- * The tile geometry and the rounded-rect progress path are `composer-panel`'s —
28
- * imported rather than retyped, because a second ring drawn from a second path
29
- * helper is how two composers end up with rings that close at different angles.
30
- */
31
-
32
- function isUrl(value) {
33
- return /^(https?:)?\/\//.test(value) || value.startsWith('data:') || value.startsWith('file:');
34
- }
35
- function Tile({
36
- attachment,
37
- size,
38
- onRemove,
39
- removeLabel,
40
- onOpen,
41
- openLabel,
42
- testID
43
- }) {
44
- const theme = (0, _useTheme.useTheme)();
45
- const palette = (0, _shared2.resolveChatComposerPalette)(theme);
46
- const resolveImage = (0, _context.useImageResolver)();
47
- const Glyph = attachment.icon ?? _RiFileTextLine.RiFileTextLine;
48
- const uploading = attachment.progress !== undefined;
49
- const progress = Math.min(100, Math.max(0, attachment.progress ?? 0));
50
- const radius = _shared2.TILE_RADIUS - 1;
51
- const path = (0, _shared.ringPath)(size, size, 1, radius);
52
- // No `pathLength` on native, so the dash arithmetic needs the real length:
53
- // four straight runs plus one full circle of the corner radius.
54
- const length = 4 * (size - 2 - 2 * radius) + 2 * Math.PI * radius;
55
- const uri = attachment.source === undefined ? undefined : isUrl(attachment.source) ? attachment.source : resolveImage?.(attachment.source, 'thumb');
56
-
57
- // The box is a button only where the caller gave it something to do. A tile
58
- // that is `role="button"` with no handler announces an action that is not
59
- // there, and one that opens on press without a role is unreachable.
60
- const Box = onOpen === undefined ? _reactNative.View : _reactNative.Pressable;
61
- const boxProps = onOpen === undefined ? {} : {
62
- role: 'button',
63
- accessibilityLabel: (openLabel ?? (a => a.name))(attachment),
64
- onPress: () => onOpen(attachment.id)
65
- };
66
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
67
- style: {
68
- width: size,
69
- gap: 4
70
- },
71
- testID: testID,
72
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
73
- style: {
74
- position: 'relative',
75
- width: size,
76
- height: size
77
- },
78
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
79
- ...boxProps,
80
- style: {
81
- width: size,
82
- height: size,
83
- borderRadius: _shared2.TILE_RADIUS,
84
- borderWidth: 1,
85
- borderColor: palette.border,
86
- backgroundColor: palette.inset,
87
- alignItems: 'center',
88
- justifyContent: 'center',
89
- overflow: 'hidden'
90
- },
91
- children: uri ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
92
- source: {
93
- uri
94
- },
95
- accessibilityIgnoresInvertColors: true,
96
- style: {
97
- width: size,
98
- height: size,
99
- opacity: uploading ? 0.6 : 1
100
- }
101
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(Glyph, {
102
- width: 22,
103
- height: 22,
104
- fill: palette.iconSecondary
105
- })
106
- }), uploading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
107
- ...(0, _webHooks.dataHook)('bloomChatComposerRing'),
108
- pointerEvents: "none",
109
- style: {
110
- position: 'absolute',
111
- top: 0,
112
- left: 0,
113
- width: size,
114
- height: size
115
- },
116
- testID: testID ? `${testID}-ring` : undefined,
117
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.default, {
118
- width: size,
119
- height: size,
120
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Path, {
121
- d: path,
122
- fill: "none",
123
- stroke: palette.accent,
124
- strokeWidth: 2,
125
- strokeLinecap: "round",
126
- strokeDasharray: `${length * progress / 100} ${length}`
127
- })
128
- })
129
- }) : null]
130
- }), onRemove && !uploading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
131
- style: {
132
- position: 'absolute',
133
- top: -6,
134
- right: -6
135
- },
136
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComposerIconButton.ComposerIconButton, {
137
- icon: _RiCloseLine.RiCloseLine,
138
- accessibilityLabel: removeLabel(attachment),
139
- onPress: () => onRemove(attachment.id),
140
- size: 20,
141
- iconSize: 12,
142
- style: {
143
- backgroundColor: palette.surface,
144
- borderWidth: 1,
145
- borderColor: palette.border
146
- },
147
- testID: testID ? `${testID}-remove` : undefined
148
- })
149
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
150
- variant: "caption-2-regular",
151
- numberOfLines: 1,
152
- style: {
153
- color: uploading ? palette.accent : palette.textSecondary
154
- },
155
- children: uploading ? `${Math.round(progress)}%` : attachment.caption ?? attachment.name
156
- })]
157
- });
158
- }
159
- function ComposerAttachmentStrip({
160
- attachments,
161
- onRemove,
162
- onOpen,
163
- size = _shared2.TILE,
164
- removeLabel: removeLabelProp,
165
- openLabel,
166
- style,
167
- testID,
168
- accessibilityLabel: accessibilityLabelProp
169
- }) {
170
- const {
171
- messages
172
- } = (0, _messages.useMessages)(_messages2.CHAT_COMPOSER_MESSAGES);
173
- const removeLabel = removeLabelProp ?? (attachment => messages.removeAttachment(attachment.name));
174
- const accessibilityLabel = accessibilityLabelProp ?? messages.attachments;
175
- if (attachments.length === 0) return null;
176
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
177
- ...(0, _webHooks.dataHook)('bloomChatComposerScroll'),
178
- horizontal: true,
179
- showsHorizontalScrollIndicator: false,
180
- accessibilityLabel: accessibilityLabel,
181
- contentContainerStyle: {
182
- flexDirection: 'row',
183
- gap: 10,
184
- // The remove disc hangs 6px past the tile on both axes and a horizontal
185
- // ScrollView clips its cross axis (`overflow-y: hidden` on web), so the
186
- // top pad is the disc's overhang plus its border — not a rhythm value.
187
- paddingLeft: 8,
188
- paddingRight: 8,
189
- paddingTop: 10,
190
- paddingBottom: 2
191
- },
192
- style: [{
193
- flexGrow: 0
194
- }, style],
195
- testID: testID,
196
- children: attachments.map(attachment => /*#__PURE__*/(0, _jsxRuntime.jsx)(Tile, {
197
- attachment: attachment,
198
- size: size,
199
- onRemove: onRemove,
200
- removeLabel: removeLabel,
201
- onOpen: onOpen,
202
- openLabel: openLabel,
203
- testID: testID ? `${testID}-${attachment.id}` : undefined
204
- }, attachment.id))
205
- });
206
- }
8
+ var _createComposerAttachmentStrip = require("./create-composer-attachment-strip.js");
9
+ const ComposerAttachmentStrip = exports.ComposerAttachmentStrip = (0, _createComposerAttachmentStrip.createComposerAttachmentStrip)({
10
+ ComposerIconButton: _ComposerIconButton.ComposerIconButton
11
+ });
207
12
  //# sourceMappingURL=ComposerAttachmentStrip.js.map