@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
@@ -1,405 +1,5 @@
1
- import { useCardFill } from '../card/use-card-fill';
2
1
  import { Surface } from '../surface';
3
- /**
4
- * A controlled, presentational emoji grid.
5
- *
6
- * BLOOM SHIPS NO EMOJI DATASET, and that is the design rather than an omission:
7
- * a full set with names and keywords is tens of kilobytes that every app with
8
- * its own would still pay for, and emoji names are localised. `groups` arrives
9
- * as a prop. The object form of an entry (`{ char, name, keywords }`) is what
10
- * the built-in search matches on; a dataset of bare glyphs still renders, it
11
- * just only matches a pasted glyph — which is the honest behaviour, not a
12
- * silent one.
13
- *
14
- * The grid is a `FlatList` on BOTH platforms, over pre-chunked ROWS rather than
15
- * single emoji, with exact `getItemLayout` offsets. A few thousand entries is
16
- * the normal case: at eight columns that is a few hundred rows, of which a
17
- * dozen are mounted, and the exact offsets are what let a category tab jump
18
- * straight to its header instead of estimating.
19
- */
20
- import React, { useCallback, useMemo, useRef, useState } from 'react';
21
2
  import { Button } from '../button';
22
- import { FlatList, Pressable, TextInput, View } from 'react-native';
3
+ import { createEmojiPicker } from './create-emoji-picker';
23
4
 
24
- import { RiEmotionLine } from '../icons/remix/RiEmotionLine';
25
- import { RiSearchLine } from '../icons/remix/RiSearchLine';
26
- import { useControllableState } from '../hooks/use-controllable-state';
27
- import type { WebCssStyle } from '../styles/web-view-style';
28
- import { useTheme } from '../theme/use-theme';
29
- import { Text } from '../typography';
30
- import { TYPE_SCALE } from '../typography/scale';
31
- import {
32
- EMOJI_CATEGORY_ICONS,
33
- EMOJI_CATEGORY_SIZE,
34
- EMOJI_CELL,
35
- PANEL_RADIUS,
36
- SKIN_TONE_SWATCHES,
37
- applySkinTone,
38
- emojiChar,
39
- filterEmojiGroups,
40
- resolveChatComposerPalette,
41
- } from './shared';
42
- import type { EmojiEntry, EmojiGroup, EmojiPickerProps } from './types';
43
- import { dataHook, useChatComposerWebCss } from './web-hooks';
44
- import { useMessages } from '../locale/messages';
45
- import { CHAT_COMPOSER_MESSAGES } from './messages';
46
-
47
- const HEADER_HEIGHT = 26;
48
- const EMOJI_TAB = '__emoji';
49
-
50
- type Row =
51
- | { kind: 'header'; key: string; label: string }
52
- | { kind: 'emojis'; key: string; entries: EmojiEntry[] };
53
-
54
- function chunk(entries: ReadonlyArray<EmojiEntry>, columns: number): EmojiEntry[][] {
55
- const out: EmojiEntry[][] = [];
56
- for (let i = 0; i < entries.length; i += columns) out.push(entries.slice(i, i + columns));
57
- return out;
58
- }
59
-
60
- function entryName(entry: EmojiEntry, char: string): string {
61
- return typeof entry === 'string' ? char : (entry.name ?? char);
62
- }
63
-
64
- export function EmojiPicker({
65
- groups,
66
- onSelectEmoji,
67
- activeGroup,
68
- defaultActiveGroup,
69
- onActiveGroupChange,
70
- query,
71
- defaultQuery = '',
72
- onQueryChange,
73
- filter = true,
74
- frequentlyUsed,
75
- skinTone,
76
- defaultSkinTone = 0,
77
- onSkinToneChange,
78
- columns = 8,
79
- height = 288,
80
- tabs,
81
- activeTab,
82
- onActiveTabChange,
83
- labels: labelOverrides,
84
- style,
85
- testID,
86
- accessibilityLabel: accessibilityLabelProp,
87
- }: EmojiPickerProps) {
88
- const theme = useTheme();
89
- const palette = resolveChatComposerPalette(theme, useCardFill(style));
90
- useChatComposerWebCss();
91
- const { messages } = useMessages(CHAT_COMPOSER_MESSAGES);
92
- const accessibilityLabel = accessibilityLabelProp ?? messages.emojiPicker;
93
- const labels = {
94
- search: messages.searchEmoji,
95
- empty: messages.noEmoji,
96
- frequent: messages.frequentlyUsed,
97
- skinTone: messages.skinTone,
98
- emojiTab: messages.emoji,
99
- ...labelOverrides,
100
- };
101
-
102
- const [search, setSearch] = useControllableState<string>({
103
- value: query,
104
- defaultValue: defaultQuery,
105
- onChange: onQueryChange,
106
- });
107
- const [tone, setTone] = useControllableState<number>({
108
- value: skinTone,
109
- defaultValue: defaultSkinTone,
110
- onChange: onSkinToneChange,
111
- });
112
- const [category, setCategory] = useControllableState<string>({
113
- value: activeGroup,
114
- defaultValue: defaultActiveGroup ?? groups[0]?.key ?? '',
115
- onChange: onActiveGroupChange,
116
- });
117
- const [tab, setTab] = useControllableState<string>({
118
- value: activeTab,
119
- defaultValue: EMOJI_TAB,
120
- onChange: onActiveTabChange,
121
- });
122
- const [toneOpen, setToneOpen] = useState(false);
123
- const listRef = useRef<FlatList<Row> | null>(null);
124
-
125
- const visible = useMemo(
126
- () => (filter ? filterEmojiGroups(groups, search) : groups),
127
- [filter, groups, search],
128
- );
129
-
130
- const { rows, offsets, heights, headerIndex } = useMemo(() => {
131
- const all: EmojiGroup[] = [];
132
- if (frequentlyUsed && frequentlyUsed.length > 0 && !search.trim()) {
133
- all.push({ key: 'frequent', label: labels.frequent, emojis: frequentlyUsed });
134
- }
135
- all.push(...visible);
136
-
137
- const built: Row[] = [];
138
- const index: Record<string, number> = {};
139
- for (const group of all) {
140
- index[group.key] = built.length;
141
- built.push({ kind: 'header', key: `h-${group.key}`, label: group.label });
142
- chunk(group.emojis, columns).forEach((entries, i) =>
143
- built.push({ kind: 'emojis', key: `${group.key}-${i}`, entries }),
144
- );
145
- }
146
- const rowHeights = built.map((row) => (row.kind === 'header' ? HEADER_HEIGHT : EMOJI_CELL));
147
- const rowOffsets: number[] = [];
148
- let running = 0;
149
- for (const h of rowHeights) {
150
- rowOffsets.push(running);
151
- running += h;
152
- }
153
- return { rows: built, offsets: rowOffsets, heights: rowHeights, headerIndex: index };
154
- }, [columns, frequentlyUsed, labels.frequent, search, visible]);
155
-
156
- const jumpTo = useCallback(
157
- (key: string) => {
158
- setCategory(key);
159
- const at = headerIndex[key];
160
- if (at === undefined) return;
161
- listRef.current?.scrollToOffset({ offset: offsets[at] ?? 0, animated: true });
162
- },
163
- [headerIndex, offsets, setCategory],
164
- );
165
-
166
- const renderRow = useCallback(
167
- ({ item }: { item: Row }) => {
168
- if (item.kind === 'header') {
169
- return (
170
- <View style={{ height: HEADER_HEIGHT, justifyContent: 'flex-end', paddingLeft: 6 }}>
171
- <Text variant="caption-1-medium" style={{ color: palette.textSecondary }}>
172
- {item.label}
173
- </Text>
174
- </View>
175
- );
176
- }
177
- return (
178
- <View style={{ flexDirection: 'row', height: EMOJI_CELL }}>
179
- {item.entries.map((entry, i) => {
180
- const base = emojiChar(entry);
181
- const char = applySkinTone(base, tone);
182
- return (
183
- <Button appearance="plain" tone="neutral"
184
- key={`${base}-${i}`}
185
- accessibilityLabel={entryName(entry, char)}
186
- onPress={() => onSelectEmoji?.(char)}
187
- style={{ padding: 0, minWidth: 0, minHeight: 0, flexShrink: 0,
188
- width: EMOJI_CELL,
189
- height: EMOJI_CELL,
190
- alignItems: 'center',
191
- justifyContent: 'center',
192
- borderRadius: 8,
193
- }}
194
- testID={testID ? `${testID}-emoji-${base}` : undefined}>
195
- <Text variant="title-2-regular">{char}</Text>
196
- </Button>
197
- );
198
- })}
199
- </View>
200
- );
201
- },
202
- [onSelectEmoji, palette.textSecondary, testID, tone],
203
- );
204
-
205
- const panel: WebCssStyle = {
206
- borderRadius: PANEL_RADIUS,
207
- paddingTop: 8,
208
- paddingBottom: 8,
209
- paddingLeft: 8,
210
- paddingRight: 8,
211
- gap: 8,
212
- '--bloom-chat-composer-ring': palette.focusRing,
213
- };
214
-
215
- const topTabs = [{ key: EMOJI_TAB, label: labels.emojiTab, icon: RiEmotionLine }, ...(tabs ?? [])];
216
- const activeCustom = tabs?.find((t) => t.key === tab);
217
-
218
- return (
219
- <Surface accessibilityLabel={accessibilityLabel} style={[panel, style]} testID={testID}>
220
- {tabs && tabs.length > 0 ? (
221
- <View
222
- accessibilityRole="tablist"
223
- style={{ flexDirection: 'row', gap: 4 }}
224
- testID={testID ? `${testID}-tabs` : undefined}>
225
- {topTabs.map((entry) => {
226
- const selected = entry.key === tab;
227
- return (
228
- <Pressable
229
- key={entry.key}
230
- {...dataHook('bloomChatComposerRow')}
231
- accessibilityRole="tab"
232
- accessibilityLabel={entry.label}
233
- aria-selected={selected}
234
- accessibilityState={{ selected }}
235
- onPress={() => setTab(entry.key)}
236
- style={{
237
- flexGrow: 1,
238
- alignItems: 'center',
239
- justifyContent: 'center',
240
- height: 30,
241
- borderRadius: 9999,
242
- backgroundColor: selected ? palette.accentSoft : 'transparent',
243
- }}
244
- testID={testID ? `${testID}-tab-${entry.key}` : undefined}>
245
- <Text
246
- variant="body-2-medium"
247
- style={{ color: selected ? palette.accentStrong : palette.textSecondary }}>
248
- {entry.label}
249
- </Text>
250
- </Pressable>
251
- );
252
- })}
253
- </View>
254
- ) : null}
255
-
256
- {activeCustom ? (
257
- <View style={{ height }}>{activeCustom.content}</View>
258
- ) : (
259
- <>
260
- <View style={{ flexDirection: 'row', alignItems: 'center', gap: 6 }}>
261
- <View
262
- style={{
263
- flexGrow: 1,
264
- flexShrink: 1,
265
- flexDirection: 'row',
266
- alignItems: 'center',
267
- gap: 6,
268
- height: 32,
269
- borderRadius: 10,
270
- backgroundColor: palette.inset,
271
- paddingLeft: 8,
272
- paddingRight: 8,
273
- }}>
274
- <RiSearchLine width={16} height={16} fill={palette.iconSecondary} />
275
- <TextInput
276
- {...dataHook('bloomChatComposerInput')}
277
- accessibilityLabel={labels.search}
278
- placeholder={labels.search}
279
- placeholderTextColor={palette.textPlaceholder}
280
- value={search}
281
- onChangeText={setSearch}
282
- selectionColor={palette.accent}
283
- style={{
284
- flexGrow: 1,
285
- flexShrink: 1,
286
- padding: 0,
287
- margin: 0,
288
- ...TYPE_SCALE['body-2-regular'],
289
- color: palette.text,
290
- backgroundColor: 'transparent',
291
- }}
292
- testID={testID ? `${testID}-search` : undefined}
293
- />
294
- </View>
295
- <Button appearance="plain" tone="neutral"
296
- accessibilityLabel={labels.skinTone}
297
- aria-expanded={toneOpen}
298
- onPress={() => setToneOpen(!toneOpen)}
299
- style={{ padding: 0, minWidth: 0, minHeight: 0, flexShrink: 0,
300
- width: 32,
301
- height: 32,
302
- alignItems: 'center',
303
- justifyContent: 'center',
304
- borderRadius: 9999,
305
- backgroundColor: toneOpen ? palette.hover : palette.inset,
306
- }}
307
- testID={testID ? `${testID}-skin-tone` : undefined}>
308
- <Text variant="body-regular">{SKIN_TONE_SWATCHES[tone] ?? SKIN_TONE_SWATCHES[0]}</Text>
309
- </Button>
310
- </View>
311
-
312
- {toneOpen ? (
313
- <View
314
- style={{ flexDirection: 'row', gap: 2, justifyContent: 'flex-end' }}
315
- testID={testID ? `${testID}-skin-tones` : undefined}>
316
- {SKIN_TONE_SWATCHES.map((swatch, index) => {
317
- const selected = index === tone;
318
- return (
319
- <Button appearance="plain" tone="neutral"
320
- key={index}
321
- accessibilityLabel={`${labels.skinTone} ${index + 1}`}
322
- pressed={selected}
323
- onPress={() => {
324
- setTone(index);
325
- setToneOpen(false);
326
- }}
327
- style={{ padding: 0, minWidth: 0, minHeight: 0, flexShrink: 0,
328
- width: 30,
329
- height: 30,
330
- alignItems: 'center',
331
- justifyContent: 'center',
332
- borderRadius: 9999,
333
- backgroundColor: selected ? palette.accentSoft : 'transparent',
334
- }}
335
- testID={testID ? `${testID}-skin-tone-${index}` : undefined}>
336
- <Text variant="body-regular">{swatch}</Text>
337
- </Button>
338
- );
339
- })}
340
- </View>
341
- ) : null}
342
-
343
- <View
344
- accessibilityRole="tablist"
345
- style={{ flexDirection: 'row', justifyContent: 'space-between' }}
346
- testID={testID ? `${testID}-categories` : undefined}>
347
- {groups.map((group) => {
348
- const selected = group.key === category;
349
- const Glyph = group.icon ?? EMOJI_CATEGORY_ICONS[group.key] ?? RiEmotionLine;
350
- return (
351
- <Pressable
352
- key={group.key}
353
- {...dataHook('bloomChatComposerControl')}
354
- accessibilityRole="tab"
355
- accessibilityLabel={group.label}
356
- aria-selected={selected}
357
- accessibilityState={{ selected }}
358
- onPress={() => jumpTo(group.key)}
359
- style={{
360
- width: EMOJI_CATEGORY_SIZE,
361
- height: EMOJI_CATEGORY_SIZE,
362
- alignItems: 'center',
363
- justifyContent: 'center',
364
- borderRadius: 9999,
365
- backgroundColor: selected ? palette.accentSoft : 'transparent',
366
- }}
367
- testID={testID ? `${testID}-category-${group.key}` : undefined}>
368
- <Glyph
369
- width={18}
370
- height={18}
371
- fill={selected ? palette.accentStrong : palette.iconSecondary}
372
- />
373
- </Pressable>
374
- );
375
- })}
376
- </View>
377
-
378
- {rows.length === 0 ? (
379
- <View style={{ height, alignItems: 'center', justifyContent: 'center' }}>
380
- <Text variant="body-2-regular" style={{ color: palette.textSecondary }}>
381
- {labels.empty}
382
- </Text>
383
- </View>
384
- ) : (
385
- <FlatList
386
- ref={listRef}
387
- {...dataHook('bloomChatComposerScroll')}
388
- data={rows}
389
- keyExtractor={(row) => row.key}
390
- renderItem={renderRow}
391
- getItemLayout={(_data, index) => ({
392
- length: heights[index] ?? EMOJI_CELL,
393
- offset: offsets[index] ?? 0,
394
- index,
395
- })}
396
- style={{ height }}
397
- showsVerticalScrollIndicator={false}
398
- testID={testID ? `${testID}-grid` : undefined}
399
- />
400
- )}
401
- </>
402
- )}
403
- </Surface>
404
- );
405
- }
5
+ export const EmojiPicker = createEmojiPicker({ Surface, Button });
@@ -0,0 +1,5 @@
1
+ import { Surface } from '../surface/index.web';
2
+ import { Button } from '../button/index.web';
3
+ import { createEmojiPicker } from './create-emoji-picker';
4
+
5
+ export const EmojiPicker = createEmojiPicker({ Surface, Button });
@@ -1,19 +1,3 @@
1
- /**
2
- * The long-press / right-click menu for one message: the quick reaction bar on
3
- * top, then the rows the app decided apply.
4
- *
5
- * Built on `DropdownMenu`, which is already an anchored panel on a pointer and
6
- * a bottom sheet on a phone — so the rows, their destructive colour, their
7
- * dismissal and their keyboard behaviour are the ones Bloom already gates,
8
- * and this part only decides what goes in them.
9
- *
10
- * `items` is a prop and not a fixed list: which actions exist depends on who
11
- * sent the message, how old it is and what the channel allows, and a menu that
12
- * hid its own rows would be deciding policy the app owns.
13
- */
14
- import React from 'react';
15
- import { View } from 'react-native';
16
-
17
1
  import {
18
2
  DropdownMenu,
19
3
  DropdownMenuContent,
@@ -22,77 +6,7 @@ import {
22
6
  DropdownMenuShortcut,
23
7
  DropdownMenuTrigger,
24
8
  } from '../dropdown-menu';
25
- import { useTheme } from '../theme/use-theme';
26
9
  import { ReactionPicker } from './ReactionPicker';
27
- import { REACTION_PICKER_EMOJIS, resolveChatComposerPalette } from './shared';
28
- import type { MessageContextMenuProps } from './types';
29
- import { useMessages } from '../locale/messages';
30
- import { CHAT_COMPOSER_MESSAGES } from './messages';
31
-
32
- export function MessageContextMenu({
33
- children,
34
- open,
35
- defaultOpen,
36
- onOpenChange,
37
- items,
38
- onSelect,
39
- reactions = REACTION_PICKER_EMOJIS,
40
- selectedReaction,
41
- onSelectReaction,
42
- onMoreReactions,
43
- label: labelProp,
44
- style,
45
- reactionBarStyle,
46
- testID,
47
- }: MessageContextMenuProps) {
48
- const theme = useTheme();
49
- const { messages } = useMessages(CHAT_COMPOSER_MESSAGES);
50
- const label = labelProp ?? messages.messageActions;
51
- const palette = resolveChatComposerPalette(theme);
52
- const showReactions = reactions !== false && reactions.length > 0;
10
+ import { createMessageContextMenu } from './create-message-context-menu';
53
11
 
54
- return (
55
- <DropdownMenu open={open} defaultOpen={defaultOpen} onOpenChange={onOpenChange}>
56
- <DropdownMenuTrigger asChild>{children}</DropdownMenuTrigger>
57
- <DropdownMenuContent label={label} minWidth={224} style={style} testID={testID}>
58
- {showReactions ? (
59
- <View style={{ paddingBottom: 4 }}>
60
- <ReactionPicker
61
- emojis={reactions}
62
- selected={selectedReaction}
63
- onSelectEmoji={onSelectReaction}
64
- onMorePress={onMoreReactions}
65
- size="small"
66
- surface={false}
67
- style={[{ alignSelf: 'stretch', justifyContent: 'space-between' }, reactionBarStyle]}
68
- testID={testID ? `${testID}-reactions` : undefined}
69
- />
70
- <View style={{ height: 1, backgroundColor: palette.border, marginTop: 4 }} />
71
- </View>
72
- ) : null}
73
- {items.map((item) => (
74
- <React.Fragment key={item.id}>
75
- {item.separated ? <DropdownMenuSeparator /> : null}
76
- <DropdownMenuItem
77
- disabled={item.disabled}
78
- variant={item.variant}
79
- leading={
80
- item.icon ? (
81
- <item.icon
82
- width={18}
83
- height={18}
84
- fill={item.variant === 'destructive' ? palette.destructive : palette.iconSecondary}
85
- />
86
- ) : undefined
87
- }
88
- trailing={item.shortcut ? <DropdownMenuShortcut>{item.shortcut}</DropdownMenuShortcut> : undefined}
89
- onPress={() => onSelect?.(item.id, item)}
90
- testID={testID ? `${testID}-${item.id}` : undefined}>
91
- {item.label}
92
- </DropdownMenuItem>
93
- </React.Fragment>
94
- ))}
95
- </DropdownMenuContent>
96
- </DropdownMenu>
97
- );
98
- }
12
+ export const MessageContextMenu = createMessageContextMenu({ DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, ReactionPicker });
@@ -0,0 +1,12 @@
1
+ import {
2
+ DropdownMenu,
3
+ DropdownMenuContent,
4
+ DropdownMenuItem,
5
+ DropdownMenuSeparator,
6
+ DropdownMenuShortcut,
7
+ DropdownMenuTrigger,
8
+ } from '../dropdown-menu/index.web';
9
+ import { ReactionPicker } from './ReactionPicker.web';
10
+ import { createMessageContextMenu } from './create-message-context-menu';
11
+
12
+ export const MessageContextMenu = createMessageContextMenu({ DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, ReactionPicker });
@@ -1,103 +1,5 @@
1
- import { useSurfaceFill } from '../styles/surface-levels';
2
- import { useCardFill } from '../card/use-card-fill';
3
1
  import { Surface } from '../surface';
4
- /**
5
- * The quick reaction bar: six glyphs and a "+" that hands over to the full
6
- * `EmojiPicker`. It is its own part rather than a mode of the picker because it
7
- * is shown in a different place (over a message, above its menu) and must stay
8
- * one row tall at 390px.
9
- */
10
- import React from 'react';
11
- import { View } from 'react-native';
12
-
13
2
  import { Button } from '../button';
14
- import { RiAddLine } from '../icons/remix/RiAddLine';
15
- import type { WebCssStyle } from '../styles/web-view-style';
16
- import { useTheme } from '../theme/use-theme';
17
- import { Text } from '../typography';
18
- import { REACTION_PICKER_EMOJIS, resolveChatComposerPalette } from './shared';
19
- import type { ReactionPickerProps } from './types';
20
- import { useChatComposerWebCss } from './web-hooks';
21
- import { useMessages } from '../locale/messages';
22
- import { CHAT_COMPOSER_MESSAGES } from './messages';
23
-
24
- const BOX = { small: 30, medium: 36 } as const;
25
- const GLYPH = { small: 'title-3-regular', medium: 'title-2-regular' } as const;
26
-
27
- export function ReactionPicker({
28
- emojis = REACTION_PICKER_EMOJIS,
29
- selected,
30
- onSelectEmoji,
31
- onMorePress,
32
- moreLabel: moreLabelProp,
33
- size = 'medium',
34
- surface = true,
35
- style,
36
- testID,
37
- accessibilityLabel: accessibilityLabelProp,
38
- emojiLabel,
39
- }: ReactionPickerProps) {
40
- const theme = useTheme();
41
- const raisedFill = useCardFill(style);
42
- const parentFill = useSurfaceFill();
43
- const palette = resolveChatComposerPalette(theme, surface ? raisedFill : parentFill);
44
- const { messages } = useMessages(CHAT_COMPOSER_MESSAGES);
45
- const moreLabel = moreLabelProp ?? messages.moreReactions;
46
- const accessibilityLabel = accessibilityLabelProp ?? messages.quickReactions;
47
- useChatComposerWebCss();
48
- const box = BOX[size];
49
-
50
- const Container = surface ? Surface : View;
51
- const bar: WebCssStyle = {
52
- flexDirection: 'row',
53
- alignItems: 'center',
54
- gap: 2,
55
- alignSelf: 'flex-start',
56
- borderRadius: 9999,
57
- paddingLeft: 4,
58
- paddingRight: 4,
59
- paddingTop: 4,
60
- paddingBottom: 4,
61
- '--bloom-chat-composer-ring': palette.focusRing,
62
- };
63
-
64
- const cell: WebCssStyle = {
65
- width: box, height: box, minWidth: box, minHeight: box, flexShrink: 0, padding: 0, borderRadius: 9999,
66
- };
3
+ import { createReactionPicker } from './create-reaction-picker';
67
4
 
68
- return (
69
- <Container
70
- accessibilityLabel={accessibilityLabel}
71
- style={[bar, style]}
72
- testID={testID}>
73
- {emojis.map((emoji) => {
74
- const active = selected === emoji;
75
- return (
76
- <Button
77
- key={emoji}
78
- appearance="plain"
79
- tone={active ? 'accent' : 'neutral'}
80
- accessibilityLabel={emojiLabel ? emojiLabel(emoji) : emoji}
81
- pressed={active}
82
- onPress={() => onSelectEmoji?.(emoji)}
83
- style={cell}
84
- testID={testID ? `${testID}-${emoji}` : undefined}>
85
- <Text variant={GLYPH[size]}>{emoji}</Text>
86
- </Button>
87
- );
88
- })}
89
- {onMorePress ? (
90
- <Button
91
- appearance="subtle"
92
- tone="neutral"
93
- accessibilityLabel={moreLabel}
94
- onPress={onMorePress}
95
- iconOnly
96
- icon={RiAddLine}
97
- iconSize={18}
98
- style={cell}
99
- testID={testID ? `${testID}-more` : undefined} />
100
- ) : null}
101
- </Container>
102
- );
103
- }
5
+ export const ReactionPicker = createReactionPicker({ Surface, Button });
@@ -0,0 +1,5 @@
1
+ import { Surface } from '../surface/index.web';
2
+ import { Button } from '../button/index.web';
3
+ import { createReactionPicker } from './create-reaction-picker';
4
+
5
+ export const ReactionPicker = createReactionPicker({ Surface, Button });