@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
@@ -0,0 +1,400 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createChatComposer = createChatComposer;
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 _shared = require("./shared.js");
22
+ var _webHooks = require("./web-hooks.js");
23
+ var _messages = require("../locale/messages.js");
24
+ var _messages2 = require("./messages.js");
25
+ var _commonMessages = require("../locale/common-messages.js");
26
+ var _jsxRuntime = require("react/jsx-runtime");
27
+ 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); }
28
+ /**
29
+ * The message input bar of a person-to-person chat: a radius-24 pill with a
30
+ * left attach button, an autosizing field, an emoji button and a right control
31
+ * that swaps between a mic (nothing to send) and an accent send disc (there is).
32
+ *
33
+ * Presentational. Every piece of state — the draft, the banners, the pending
34
+ * attachments, which suggestion is highlighted — arrives as a prop, because the
35
+ * app owns drafts per conversation and a composer that kept its own would lose
36
+ * them on every navigation.
37
+ */
38
+
39
+ /** Platform dependencies are bound once; shared rendering adds no wrapper. */
40
+ function createChatComposer({
41
+ ComposerAttachmentStrip,
42
+ ComposerIconButton,
43
+ SuggestionList
44
+ }) {
45
+ const EASE_OUT = _reactNativeReanimated.Easing.bezier(0, 0, 0.2, 1);
46
+
47
+ /**
48
+ * One half of the mic ↔ send crossfade.
49
+ *
50
+ * Two things the fade must not break, neither of which the animation expresses:
51
+ *
52
+ * `pointerEvents` is a PROP, not a style entry — react-native-web drops it from
53
+ * a style object silently, and a hidden layer that still takes the press is a
54
+ * send button that fires when the field is empty.
55
+ *
56
+ * The hidden half leaves the ACCESSIBILITY TREE too. Both halves stay mounted so
57
+ * they can cross-fade, so without this every composer announces "Send" and
58
+ * "Record a voice message" side by side and only one of them does anything.
59
+ * `aria-hidden` is what react-native-web reads and
60
+ * `importantForAccessibility` is what React Native reads; a surface that sets
61
+ * one of the two is hidden on one platform only.
62
+ */
63
+ function SwapLayer({
64
+ shown,
65
+ children
66
+ }) {
67
+ const reducedMotion = (0, _reactNativeReanimated.useReducedMotion)();
68
+ const progress = (0, _reactNativeReanimated.useSharedValue)(shown ? 1 : 0);
69
+ _react.default.useEffect(() => {
70
+ progress.value = reducedMotion ? shown ? 1 : 0 : (0, _reactNativeReanimated.withTiming)(shown ? 1 : 0, {
71
+ duration: _shared.SWAP_MS,
72
+ easing: EASE_OUT
73
+ });
74
+ }, [shown, reducedMotion, progress]);
75
+ const animated = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
76
+ opacity: progress.value
77
+ }), [progress]);
78
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
79
+ pointerEvents: shown ? 'auto' : 'none',
80
+ "aria-hidden": !shown,
81
+ accessibilityElementsHidden: !shown,
82
+ importantForAccessibility: shown ? 'auto' : 'no-hide-descendants',
83
+ style: [{
84
+ position: 'absolute',
85
+ top: 0,
86
+ left: 0
87
+ }, animated],
88
+ children: children
89
+ });
90
+ }
91
+
92
+ /** A DOM keyboard event as react-native-web hands it to `onKeyPress`. */
93
+
94
+ function ChatComposer({
95
+ value,
96
+ defaultValue = '',
97
+ onValueChange,
98
+ placeholder: placeholderProp,
99
+ onSend,
100
+ sendOn = 'enter',
101
+ maxLines = _shared.DEFAULT_MAX_LINES,
102
+ minLines = 1,
103
+ disabled = false,
104
+ notice,
105
+ noticeIcon,
106
+ banner,
107
+ attachments,
108
+ onRemoveAttachment,
109
+ leading,
110
+ onAttachPress,
111
+ emojiSlot,
112
+ onEmojiPress,
113
+ onCameraPress,
114
+ onMicPress,
115
+ onMicPressIn,
116
+ onMicPressOut,
117
+ canSend,
118
+ recorder,
119
+ suggestions,
120
+ suggestionKind = 'mention',
121
+ activeIndex = -1,
122
+ onActiveIndexChange,
123
+ onSelectSuggestion,
124
+ onEscape,
125
+ onEditLast,
126
+ showKeyboardHint = false,
127
+ inputRef,
128
+ onFocus,
129
+ onBlur,
130
+ labels: labelOverrides,
131
+ style,
132
+ testID,
133
+ accessibilityLabel
134
+ }) {
135
+ const theme = (0, _useTheme.useTheme)();
136
+ const {
137
+ messages
138
+ } = (0, _messages.useMessages)(_messages2.CHAT_COMPOSER_MESSAGES);
139
+ const common = (0, _commonMessages.useCommonMessages)();
140
+ const palette = (0, _shared.resolveChatComposerPalette)(theme);
141
+ (0, _webHooks.useChatComposerWebCss)();
142
+ const labels = (0, _react.useMemo)(() => ({
143
+ ...(0, _shared.chatComposerLabels)(messages, common.send),
144
+ ...labelOverrides
145
+ }), [common.send, labelOverrides, messages]);
146
+ const placeholder = placeholderProp ?? messages.message;
147
+ const [text, setText] = (0, _useControllableState.useControllableState)({
148
+ value,
149
+ defaultValue,
150
+ onChange: onValueChange
151
+ });
152
+ const localRef = (0, _react.useRef)(null);
153
+ const setFieldRef = (0, _react.useCallback)(node => {
154
+ localRef.current = node;
155
+ if (inputRef) inputRef.current = node;
156
+ }, [inputRef]);
157
+ const minHeight = Math.max(1, minLines) * _shared.LINE_HEIGHT;
158
+ const maxHeight = Math.max(minLines, maxLines) * _shared.LINE_HEIGHT;
159
+ const [contentHeight, setContentHeight] = (0, _react.useState)(minHeight);
160
+ const height = Math.min(maxHeight, Math.max(minHeight, contentHeight));
161
+
162
+ /**
163
+ * Web autosize measures the node, native reads `onContentSizeChange`.
164
+ *
165
+ * They are not interchangeable: react-native-web reports `scrollHeight`,
166
+ * which never falls below the height already applied, so a field grown to six
167
+ * lines and then emptied would stay six lines tall. `useTextareaAutosize`
168
+ * collapses the node to measure it only when the draft may have got SHORTER —
169
+ * collapsing on every keystroke re-laid-out the whole page three times a key.
170
+ */
171
+ (0, _useTextareaAutosize.useTextareaAutosize)(localRef, text, {
172
+ enabled: _webHooks.IS_WEB,
173
+ height,
174
+ minHeight,
175
+ onMeasure: setContentHeight
176
+ });
177
+ const onContentSizeChange = (0, _react.useCallback)(event => {
178
+ if (_webHooks.IS_WEB) return;
179
+ setContentHeight(event.nativeEvent.contentSize.height);
180
+ }, []);
181
+ const trimmed = text.trim();
182
+ const hasAttachments = !!attachments && attachments.length > 0;
183
+ const showSend = canSend ?? (trimmed.length > 0 || hasAttachments);
184
+ const submit = (0, _react.useCallback)(() => {
185
+ if (disabled || !showSend) return;
186
+ onSend?.(text);
187
+ if (value === undefined) setText('');
188
+ }, [disabled, showSend, onSend, text, value, setText]);
189
+ const openSuggestions = !!suggestions && suggestions.length > 0;
190
+ const onKeyPress = (0, _react.useCallback)(event => {
191
+ if (!_webHooks.IS_WEB) return;
192
+ const native = event.nativeEvent;
193
+ // An IME candidate window is using the same keys; committing a
194
+ // composition must never send the half-written word behind it.
195
+ if (native.isComposing) return;
196
+ const mod = native.metaKey === true || native.ctrlKey === true;
197
+ if (openSuggestions && (native.key === 'ArrowDown' || native.key === 'ArrowUp')) {
198
+ event.preventDefault();
199
+ const count = suggestions?.length ?? 0;
200
+ const step = native.key === 'ArrowDown' ? 1 : -1;
201
+ const from = activeIndex < 0 ? step > 0 ? -1 : 0 : activeIndex;
202
+ onActiveIndexChange?.((from + step + count) % count);
203
+ return;
204
+ }
205
+ if (native.key === 'Escape') {
206
+ event.preventDefault();
207
+ onEscape?.();
208
+ return;
209
+ }
210
+ if (native.key === 'ArrowUp' && text.length === 0) {
211
+ event.preventDefault();
212
+ onEditLast?.();
213
+ return;
214
+ }
215
+ if (native.key !== 'Enter') return;
216
+ if (openSuggestions && activeIndex >= 0) {
217
+ const picked = suggestions?.[activeIndex];
218
+ if (picked && !picked.disabled) {
219
+ event.preventDefault();
220
+ onSelectSuggestion?.(picked, activeIndex);
221
+ return;
222
+ }
223
+ }
224
+ if (sendOn === 'enter' ? native.shiftKey !== true && !mod : mod) {
225
+ event.preventDefault();
226
+ submit();
227
+ }
228
+ }, [activeIndex, onActiveIndexChange, onEditLast, onEscape, onSelectSuggestion, openSuggestions, sendOn, submit, suggestions, text.length]);
229
+ const bar = {
230
+ flexDirection: 'row',
231
+ alignItems: 'flex-end',
232
+ gap: 2,
233
+ minHeight: _shared.CONTROL_SIZE + _shared.BAR_PADDING * 2,
234
+ borderRadius: _shared.BAR_RADIUS,
235
+ borderWidth: 1,
236
+ borderColor: palette.border,
237
+ // A disabled bar changes its FILL rather than its opacity. Dimming the
238
+ // container compounds with each control's own disabled opacity — 0.55 × 0.4
239
+ // put the send disc at 0.22, which reads as a rendering fault rather than a
240
+ // state.
241
+ backgroundColor: disabled ? palette.inset : palette.surface,
242
+ paddingLeft: _shared.BAR_PADDING,
243
+ paddingRight: _shared.BAR_PADDING,
244
+ paddingTop: _shared.BAR_PADDING,
245
+ paddingBottom: _shared.BAR_PADDING,
246
+ '--bloom-chat-composer-ring': palette.focusRing
247
+ };
248
+ const NoticeIcon = noticeIcon ?? _RiForbidLine.RiForbidLine;
249
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
250
+ accessibilityLabel: accessibilityLabel,
251
+ style: [{
252
+ width: '100%',
253
+ flexDirection: 'column',
254
+ gap: 6
255
+ }, style],
256
+ testID: testID,
257
+ children: [openSuggestions ? /*#__PURE__*/(0, _jsxRuntime.jsx)(SuggestionList, {
258
+ kind: suggestionKind,
259
+ suggestions: suggestions ?? [],
260
+ activeIndex: activeIndex,
261
+ onActiveIndexChange: onActiveIndexChange,
262
+ onSelectSuggestion: onSelectSuggestion,
263
+ testID: testID ? `${testID}-suggestions` : undefined
264
+ }) : null, banner, hasAttachments ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ComposerAttachmentStrip, {
265
+ attachments: attachments ?? [],
266
+ onRemove: onRemoveAttachment,
267
+ testID: testID ? `${testID}-attachments` : undefined
268
+ }) : null, recorder ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
269
+ style: bar,
270
+ testID: testID ? `${testID}-bar` : undefined,
271
+ children: notice !== undefined ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
272
+ style: {
273
+ flexDirection: 'row',
274
+ alignItems: 'center',
275
+ justifyContent: 'center',
276
+ gap: 8,
277
+ flexGrow: 1,
278
+ minHeight: _shared.CONTROL_SIZE,
279
+ paddingLeft: 12,
280
+ paddingRight: 12
281
+ },
282
+ testID: testID ? `${testID}-notice` : undefined,
283
+ children: typeof notice === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
284
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(NoticeIcon, {
285
+ width: 16,
286
+ height: 16,
287
+ fill: palette.iconSecondary
288
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
289
+ variant: "body-2-regular",
290
+ numberOfLines: 2,
291
+ style: {
292
+ color: palette.textSecondary,
293
+ textAlign: 'center'
294
+ },
295
+ children: notice
296
+ })]
297
+ }) : notice
298
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
299
+ children: [leading ?? (onAttachPress ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ComposerIconButton, {
300
+ icon: _RiAddLine.RiAddLine,
301
+ accessibilityLabel: labels.attach,
302
+ onPress: onAttachPress,
303
+ disabled: disabled,
304
+ iconSize: 22,
305
+ testID: testID ? `${testID}-attach` : undefined
306
+ }) : null), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
307
+ style: {
308
+ flexGrow: 1,
309
+ flexShrink: 1,
310
+ justifyContent: 'center',
311
+ minHeight: _shared.CONTROL_SIZE,
312
+ paddingLeft: 6,
313
+ paddingRight: 6
314
+ },
315
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
316
+ ref: setFieldRef,
317
+ ...(0, _webHooks.dataHook)('bloomChatComposerInput'),
318
+ accessibilityLabel: labels.input,
319
+ multiline: true,
320
+ editable: !disabled,
321
+ value: text,
322
+ onChangeText: setText,
323
+ onKeyPress: onKeyPress,
324
+ onContentSizeChange: onContentSizeChange,
325
+ onFocus: onFocus,
326
+ onBlur: onBlur,
327
+ placeholder: placeholder,
328
+ placeholderTextColor: palette.textPlaceholder,
329
+ selectionColor: palette.accent,
330
+ cursorColor: palette.accent,
331
+ scrollEnabled: height >= maxHeight,
332
+ style: {
333
+ width: '100%',
334
+ height,
335
+ maxHeight,
336
+ padding: 0,
337
+ margin: 0,
338
+ ..._scale.TYPE_SCALE['body-regular'],
339
+ fontFamily: _webHooks.IS_WEB ? 'var(--bloom-font-sans)' : 'Inter',
340
+ color: disabled ? palette.textSecondary : palette.text,
341
+ backgroundColor: 'transparent'
342
+ },
343
+ testID: testID ? `${testID}-input` : undefined
344
+ })
345
+ }), onCameraPress ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ComposerIconButton, {
346
+ icon: _RiCameraLine.RiCameraLine,
347
+ accessibilityLabel: labels.camera,
348
+ onPress: onCameraPress,
349
+ disabled: disabled,
350
+ testID: testID ? `${testID}-camera` : undefined
351
+ }) : null, emojiSlot ?? (onEmojiPress ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ComposerIconButton, {
352
+ icon: _RiEmotionLine.RiEmotionLine,
353
+ accessibilityLabel: labels.emoji,
354
+ onPress: onEmojiPress,
355
+ disabled: disabled,
356
+ testID: testID ? `${testID}-emoji` : undefined
357
+ }) : null), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
358
+ style: {
359
+ width: _shared.CONTROL_SIZE,
360
+ height: _shared.CONTROL_SIZE,
361
+ marginLeft: 2
362
+ },
363
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(SwapLayer, {
364
+ shown: showSend,
365
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ComposerIconButton, {
366
+ icon: _RiSendPlaneLine.RiSendPlaneLine,
367
+ tone: "accent",
368
+ accessibilityLabel: labels.send,
369
+ onPress: submit,
370
+ disabled: disabled,
371
+ iconSize: 18,
372
+ testID: testID ? `${testID}-send` : undefined
373
+ })
374
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(SwapLayer, {
375
+ shown: !showSend,
376
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ComposerIconButton, {
377
+ icon: _RiMic2Line.RiMic2Line,
378
+ accessibilityLabel: labels.mic,
379
+ onPress: onMicPress,
380
+ onPressIn: onMicPressIn,
381
+ onPressOut: onMicPressOut,
382
+ disabled: disabled,
383
+ testID: testID ? `${testID}-mic` : undefined
384
+ })
385
+ })]
386
+ })]
387
+ })
388
+ }), showKeyboardHint && _webHooks.IS_WEB && notice === undefined ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
389
+ variant: "caption-2-regular",
390
+ style: {
391
+ color: palette.textPlaceholder,
392
+ paddingLeft: 14
393
+ },
394
+ children: sendOn === 'enter' ? labels.enterHint : labels.modEnterHint
395
+ }) : null]
396
+ });
397
+ }
398
+ return ChatComposer;
399
+ }
400
+ //# sourceMappingURL=create-chat-composer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_RiAddLine","_RiCameraLine","_RiEmotionLine","_RiForbidLine","_RiMic2Line","_RiSendPlaneLine","_useControllableState","_useTextareaAutosize","_useTheme","_index","_scale","_shared","_webHooks","_messages","_messages2","_commonMessages","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","createChatComposer","ComposerAttachmentStrip","ComposerIconButton","SuggestionList","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","kind","onRemove","justifyContent","flexGrow","Fragment","fill","iconSecondary","Text","variant","numberOfLines","color","textSecondary","textAlign","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/create-chat-composer.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;AAGA,IAAAc,OAAA,GAAAd,OAAA;AAYA,IAAAe,SAAA,GAAAf,OAAA;AACA,IAAAgB,SAAA,GAAAhB,OAAA;AACA,IAAAiB,UAAA,GAAAjB,OAAA;AACA,IAAAkB,eAAA,GAAAlB,OAAA;AAA8D,IAAAmB,WAAA,GAAAnB,OAAA;AAAA,SAAAD,wBAAAqB,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAvB,uBAAA,YAAAA,CAAAqB,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CA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,MAAM,EAAEA,MAAM,GAAG,GAAGA,MAAM,OAAO,GAAGkD;cAAU,CAC/C;YAAC,CACO,CAAC,eACZ,IAAA9I,WAAA,CAAA4C,GAAA,EAACjB,SAAS;cAACC,KAAK,EAAE,CAACgH,QAAS;cAAA/G,QAAA,eAC1B,IAAA7B,WAAA,CAAA4C,GAAA,EAACtB,kBAAkB;gBACjB2K,IAAI,EAAE8B,sBAAW;gBACjBlI,kBAAkB,EAAEH,MAAM,CAACsI,GAAI;gBAC/B5B,OAAO,EAAE1H,UAAW;gBACpBuJ,SAAS,EAAEtJ,YAAa;gBACxBuJ,UAAU,EAAEtJ,aAAc;gBAC1Bb,QAAQ,EAAEA,QAAS;gBACnB6B,MAAM,EAAEA,MAAM,GAAG,GAAGA,MAAM,MAAM,GAAGkD;cAAU,CAC9C;YAAC,CACO,CAAC;UAAA,CACR,CAAC;QAAA,CACP;MACH,CACG,CACP,EAEAxD,gBAAgB,IAAI4C,gBAAM,IAAIlE,MAAM,KAAK8E,SAAS,gBACjD,IAAA9I,WAAA,CAAA4C,GAAA,EAACnD,MAAA,CAAAkM,IAAI;QACHC,OAAO,EAAC,mBAAmB;QAC3B3I,KAAK,EAAE;UAAE6I,KAAK,EAAEzF,OAAO,CAAC0G,eAAe;UAAEpC,WAAW,EAAE;QAAG,CAAE;QAAA9I,QAAA,EAC1D8B,MAAM,KAAK,OAAO,GAAG+B,MAAM,CAACyI,SAAS,GAAGzI,MAAM,CAAC0I;MAAY,CACxD,CAAC,GACL,IAAI;IAAA,CACJ,CAAC;EAEX;EAEA,OAAO/K,YAAY;AACrB","ignoreList":[]}
@@ -0,0 +1,212 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createComposerAttachmentStrip = createComposerAttachmentStrip;
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");
16
+ var _shared2 = require("./shared.js");
17
+ var _webHooks = require("./web-hooks.js");
18
+ var _messages = require("../locale/messages.js");
19
+ var _messages2 = require("./messages.js");
20
+ var _jsxRuntime = require("react/jsx-runtime");
21
+ 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); }
22
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
23
+ /**
24
+ * The pending-attachment strip between the banner stack and the bar.
25
+ *
26
+ * The tile geometry and the rounded-rect progress path are `composer-panel`'s —
27
+ * imported rather than retyped, because a second ring drawn from a second path
28
+ * helper is how two composers end up with rings that close at different angles.
29
+ */
30
+
31
+ /** Platform dependencies are bound once; shared rendering adds no wrapper. */
32
+ function createComposerAttachmentStrip({
33
+ ComposerIconButton
34
+ }) {
35
+ function isUrl(value) {
36
+ return /^(https?:)?\/\//.test(value) || value.startsWith('data:') || value.startsWith('file:');
37
+ }
38
+ function Tile({
39
+ attachment,
40
+ size,
41
+ onRemove,
42
+ removeLabel,
43
+ onOpen,
44
+ openLabel,
45
+ testID
46
+ }) {
47
+ const theme = (0, _useTheme.useTheme)();
48
+ const palette = (0, _shared2.resolveChatComposerPalette)(theme);
49
+ const resolveImage = (0, _context.useImageResolver)();
50
+ const Glyph = attachment.icon ?? _RiFileTextLine.RiFileTextLine;
51
+ const uploading = attachment.progress !== undefined;
52
+ const progress = Math.min(100, Math.max(0, attachment.progress ?? 0));
53
+ const radius = _shared2.TILE_RADIUS - 1;
54
+ const path = (0, _shared.ringPath)(size, size, 1, radius);
55
+ // No `pathLength` on native, so the dash arithmetic needs the real length:
56
+ // four straight runs plus one full circle of the corner radius.
57
+ const length = 4 * (size - 2 - 2 * radius) + 2 * Math.PI * radius;
58
+ const uri = attachment.source === undefined ? undefined : isUrl(attachment.source) ? attachment.source : resolveImage?.(attachment.source, 'thumb');
59
+
60
+ // The box is a button only where the caller gave it something to do. A tile
61
+ // that is `role="button"` with no handler announces an action that is not
62
+ // there, and one that opens on press without a role is unreachable.
63
+ const Box = onOpen === undefined ? _reactNative.View : _reactNative.Pressable;
64
+ const boxProps = onOpen === undefined ? {} : {
65
+ role: 'button',
66
+ accessibilityLabel: (openLabel ?? (a => a.name))(attachment),
67
+ onPress: () => onOpen(attachment.id)
68
+ };
69
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
70
+ style: {
71
+ width: size,
72
+ gap: 4
73
+ },
74
+ testID: testID,
75
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
76
+ style: {
77
+ position: 'relative',
78
+ width: size,
79
+ height: size
80
+ },
81
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
82
+ ...boxProps,
83
+ style: {
84
+ width: size,
85
+ height: size,
86
+ borderRadius: _shared2.TILE_RADIUS,
87
+ borderWidth: 1,
88
+ borderColor: palette.border,
89
+ backgroundColor: palette.inset,
90
+ alignItems: 'center',
91
+ justifyContent: 'center',
92
+ overflow: 'hidden'
93
+ },
94
+ children: uri ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
95
+ source: {
96
+ uri
97
+ },
98
+ accessibilityIgnoresInvertColors: true,
99
+ style: {
100
+ width: size,
101
+ height: size,
102
+ opacity: uploading ? 0.6 : 1
103
+ }
104
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(Glyph, {
105
+ width: 22,
106
+ height: 22,
107
+ fill: palette.iconSecondary
108
+ })
109
+ }), uploading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
110
+ ...(0, _webHooks.dataHook)('bloomChatComposerRing'),
111
+ pointerEvents: "none",
112
+ style: {
113
+ position: 'absolute',
114
+ top: 0,
115
+ left: 0,
116
+ width: size,
117
+ height: size
118
+ },
119
+ testID: testID ? `${testID}-ring` : undefined,
120
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.default, {
121
+ width: size,
122
+ height: size,
123
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Path, {
124
+ d: path,
125
+ fill: "none",
126
+ stroke: palette.accent,
127
+ strokeWidth: 2,
128
+ strokeLinecap: "round",
129
+ strokeDasharray: `${length * progress / 100} ${length}`
130
+ })
131
+ })
132
+ }) : null]
133
+ }), onRemove && !uploading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
134
+ style: {
135
+ position: 'absolute',
136
+ top: -6,
137
+ right: -6
138
+ },
139
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ComposerIconButton, {
140
+ icon: _RiCloseLine.RiCloseLine,
141
+ accessibilityLabel: removeLabel(attachment),
142
+ onPress: () => onRemove(attachment.id),
143
+ size: 20,
144
+ iconSize: 12,
145
+ style: {
146
+ backgroundColor: palette.surface,
147
+ borderWidth: 1,
148
+ borderColor: palette.border
149
+ },
150
+ testID: testID ? `${testID}-remove` : undefined
151
+ })
152
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
153
+ variant: "caption-2-regular",
154
+ numberOfLines: 1,
155
+ style: {
156
+ color: uploading ? palette.accent : palette.textSecondary
157
+ },
158
+ children: uploading ? `${Math.round(progress)}%` : attachment.caption ?? attachment.name
159
+ })]
160
+ });
161
+ }
162
+ function ComposerAttachmentStrip({
163
+ attachments,
164
+ onRemove,
165
+ onOpen,
166
+ size = _shared2.TILE,
167
+ removeLabel: removeLabelProp,
168
+ openLabel,
169
+ style,
170
+ testID,
171
+ accessibilityLabel: accessibilityLabelProp
172
+ }) {
173
+ const {
174
+ messages
175
+ } = (0, _messages.useMessages)(_messages2.CHAT_COMPOSER_MESSAGES);
176
+ const removeLabel = removeLabelProp ?? (attachment => messages.removeAttachment(attachment.name));
177
+ const accessibilityLabel = accessibilityLabelProp ?? messages.attachments;
178
+ if (attachments.length === 0) return null;
179
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
180
+ ...(0, _webHooks.dataHook)('bloomChatComposerScroll'),
181
+ horizontal: true,
182
+ showsHorizontalScrollIndicator: false,
183
+ accessibilityLabel: accessibilityLabel,
184
+ contentContainerStyle: {
185
+ flexDirection: 'row',
186
+ gap: 10,
187
+ // The remove disc hangs 6px past the tile on both axes and a horizontal
188
+ // ScrollView clips its cross axis (`overflow-y: hidden` on web), so the
189
+ // top pad is the disc's overhang plus its border — not a rhythm value.
190
+ paddingLeft: 8,
191
+ paddingRight: 8,
192
+ paddingTop: 10,
193
+ paddingBottom: 2
194
+ },
195
+ style: [{
196
+ flexGrow: 0
197
+ }, style],
198
+ testID: testID,
199
+ children: attachments.map(attachment => /*#__PURE__*/(0, _jsxRuntime.jsx)(Tile, {
200
+ attachment: attachment,
201
+ size: size,
202
+ onRemove: onRemove,
203
+ removeLabel: removeLabel,
204
+ onOpen: onOpen,
205
+ openLabel: openLabel,
206
+ testID: testID ? `${testID}-${attachment.id}` : undefined
207
+ }, attachment.id))
208
+ });
209
+ }
210
+ return ComposerAttachmentStrip;
211
+ }
212
+ //# sourceMappingURL=create-composer-attachment-strip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_reactNativeSvg","_interopRequireWildcard","_shared","_RiCloseLine","_RiFileTextLine","_context","_useTheme","_index","_shared2","_webHooks","_messages","_messages2","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","createComposerAttachmentStrip","ComposerIconButton","isUrl","value","test","startsWith","Tile","attachment","size","onRemove","removeLabel","onOpen","openLabel","testID","theme","useTheme","palette","resolveChatComposerPalette","resolveImage","useImageResolver","Glyph","icon","RiFileTextLine","uploading","progress","undefined","Math","min","max","radius","TILE_RADIUS","path","ringPath","length","PI","uri","source","Box","View","Pressable","boxProps","role","accessibilityLabel","a","name","onPress","id","jsxs","style","width","gap","children","position","height","jsx","borderRadius","borderWidth","borderColor","border","backgroundColor","inset","alignItems","justifyContent","overflow","Image","accessibilityIgnoresInvertColors","opacity","fill","iconSecondary","dataHook","pointerEvents","top","left","Path","d","stroke","accent","strokeWidth","strokeLinecap","strokeDasharray","right","RiCloseLine","iconSize","surface","Text","variant","numberOfLines","color","textSecondary","round","caption","ComposerAttachmentStrip","attachments","TILE","removeLabelProp","accessibilityLabelProp","messages","useMessages","CHAT_COMPOSER_MESSAGES","removeAttachment","ScrollView","horizontal","showsHorizontalScrollIndicator","contentContainerStyle","flexDirection","paddingLeft","paddingRight","paddingTop","paddingBottom","flexGrow","map"],"sourceRoot":"../../../src","sources":["chat-composer/create-composer-attachment-strip.tsx"],"mappings":";;;;;;AAOA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAC,uBAAA,CAAAH,OAAA;AAEA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AAEA,IAAAU,QAAA,GAAAV,OAAA;AAEA,IAAAW,SAAA,GAAAX,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