@oxy.so/bloom 5.1.0 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/adoption-matrix.mdx +9 -9
- package/docs/button.mdx +2 -0
- package/docs/card-form.mdx +2 -0
- package/docs/chat-composer.mdx +1 -1
- package/docs/earnings.mdx +2 -0
- package/docs/field.mdx +2 -0
- package/docs/label.mdx +2 -0
- package/docs/payment-method.mdx +2 -0
- package/docs/place-details.mdx +2 -2
- package/docs/proof-of-delivery.mdx +4 -0
- package/docs/select.mdx +2 -0
- package/lib/commonjs/button/Button.js +36 -3
- package/lib/commonjs/button/Button.js.map +1 -1
- package/lib/commonjs/button/GlyphButton.js +7 -3
- package/lib/commonjs/button/GlyphButton.js.map +1 -1
- package/lib/commonjs/card-form/shared.js +3 -2
- package/lib/commonjs/card-form/shared.js.map +1 -1
- package/lib/commonjs/chat-composer/AttachmentMenu.js +8 -227
- package/lib/commonjs/chat-composer/AttachmentMenu.js.map +1 -1
- package/lib/commonjs/chat-composer/AttachmentMenu.web.js +16 -0
- package/lib/commonjs/chat-composer/AttachmentMenu.web.js.map +1 -0
- package/lib/commonjs/chat-composer/ChatComposer.js +9 -388
- package/lib/commonjs/chat-composer/ChatComposer.js.map +1 -1
- package/lib/commonjs/chat-composer/ChatComposer.web.js +16 -0
- package/lib/commonjs/chat-composer/ChatComposer.web.js.map +1 -0
- package/lib/commonjs/chat-composer/ComposerAttachmentStrip.js +5 -200
- package/lib/commonjs/chat-composer/ComposerAttachmentStrip.js.map +1 -1
- package/lib/commonjs/chat-composer/ComposerAttachmentStrip.web.js +12 -0
- package/lib/commonjs/chat-composer/ComposerAttachmentStrip.web.js.map +1 -0
- package/lib/commonjs/chat-composer/ComposerBanner.js +5 -163
- package/lib/commonjs/chat-composer/ComposerBanner.js.map +1 -1
- package/lib/commonjs/chat-composer/ComposerBanner.web.js +12 -0
- package/lib/commonjs/chat-composer/ComposerBanner.web.js.map +1 -0
- package/lib/commonjs/chat-composer/EmojiPicker.js +6 -443
- package/lib/commonjs/chat-composer/EmojiPicker.js.map +1 -1
- package/lib/commonjs/chat-composer/EmojiPicker.web.js +14 -0
- package/lib/commonjs/chat-composer/EmojiPicker.web.js.map +1 -0
- package/lib/commonjs/chat-composer/MessageContextMenu.js +12 -102
- package/lib/commonjs/chat-composer/MessageContextMenu.js.map +1 -1
- package/lib/commonjs/chat-composer/MessageContextMenu.web.js +19 -0
- package/lib/commonjs/chat-composer/MessageContextMenu.web.js.map +1 -0
- package/lib/commonjs/chat-composer/ReactionPicker.js +6 -107
- package/lib/commonjs/chat-composer/ReactionPicker.js.map +1 -1
- package/lib/commonjs/chat-composer/ReactionPicker.web.js +14 -0
- package/lib/commonjs/chat-composer/ReactionPicker.web.js.map +1 -0
- package/lib/commonjs/chat-composer/SuggestionList.js +5 -222
- package/lib/commonjs/chat-composer/SuggestionList.js.map +1 -1
- package/lib/commonjs/chat-composer/SuggestionList.web.js +12 -0
- package/lib/commonjs/chat-composer/SuggestionList.web.js.map +1 -0
- package/lib/commonjs/chat-composer/VoiceRecorder.js +7 -263
- package/lib/commonjs/chat-composer/VoiceRecorder.js.map +1 -1
- package/lib/commonjs/chat-composer/VoiceRecorder.web.js +16 -0
- package/lib/commonjs/chat-composer/VoiceRecorder.web.js.map +1 -0
- package/lib/commonjs/chat-composer/create-attachment-menu.js +243 -0
- package/lib/commonjs/chat-composer/create-attachment-menu.js.map +1 -0
- package/lib/commonjs/chat-composer/create-chat-composer.js +400 -0
- package/lib/commonjs/chat-composer/create-chat-composer.js.map +1 -0
- package/lib/commonjs/chat-composer/create-composer-attachment-strip.js +212 -0
- package/lib/commonjs/chat-composer/create-composer-attachment-strip.js.map +1 -0
- package/lib/commonjs/chat-composer/create-composer-banner.js +176 -0
- package/lib/commonjs/chat-composer/create-composer-banner.js.map +1 -0
- package/lib/commonjs/chat-composer/create-emoji-picker.js +456 -0
- package/lib/commonjs/chat-composer/create-emoji-picker.js.map +1 -0
- package/lib/commonjs/chat-composer/create-message-context-menu.js +119 -0
- package/lib/commonjs/chat-composer/create-message-context-menu.js.map +1 -0
- package/lib/commonjs/chat-composer/create-reaction-picker.js +120 -0
- package/lib/commonjs/chat-composer/create-reaction-picker.js.map +1 -0
- package/lib/commonjs/chat-composer/create-suggestion-list.js +234 -0
- package/lib/commonjs/chat-composer/create-suggestion-list.js.map +1 -0
- package/lib/commonjs/chat-composer/create-voice-recorder.js +277 -0
- package/lib/commonjs/chat-composer/create-voice-recorder.js.map +1 -0
- package/lib/commonjs/chat-composer/index.js +9 -9
- package/lib/commonjs/chat-composer/index.web.js +18 -18
- package/lib/commonjs/chat-composer/index.web.js.map +1 -1
- package/lib/commonjs/earnings/EarningsSummary.js +12 -2
- package/lib/commonjs/earnings/EarningsSummary.js.map +1 -1
- package/lib/commonjs/field/Field.js +2 -0
- package/lib/commonjs/field/Field.js.map +1 -1
- package/lib/commonjs/item/Item.js +16 -8
- package/lib/commonjs/item/Item.js.map +1 -1
- package/lib/commonjs/job-board/JobCard.js +6 -2
- package/lib/commonjs/job-board/JobCard.js.map +1 -1
- package/lib/commonjs/label/Label.js +2 -1
- package/lib/commonjs/label/Label.js.map +1 -1
- package/lib/commonjs/listing-details/AmenityList.js +4 -3
- package/lib/commonjs/listing-details/AmenityList.js.map +1 -1
- package/lib/commonjs/mail-compose/MailComposeSurface.js +1 -1
- package/lib/commonjs/overlay/InteractionBoundary.js +28 -0
- package/lib/commonjs/overlay/InteractionBoundary.js.map +1 -0
- package/lib/commonjs/payment-method/PaymentMethodList.js +3 -2
- package/lib/commonjs/payment-method/PaymentMethodList.js.map +1 -1
- package/lib/commonjs/place-details/PlaceAmenities.js +17 -6
- package/lib/commonjs/place-details/PlaceAmenities.js.map +1 -1
- package/lib/commonjs/place-details/PlacePopularTimes.js +7 -1
- package/lib/commonjs/place-details/PlacePopularTimes.js.map +1 -1
- package/lib/commonjs/proof-of-delivery/ProofOfDelivery.js +10 -1
- package/lib/commonjs/proof-of-delivery/ProofOfDelivery.js.map +1 -1
- package/lib/commonjs/proof-of-delivery/shared.js +1 -1
- package/lib/commonjs/proof-of-delivery/shared.js.map +1 -1
- package/lib/commonjs/select/Select.js +7 -4
- package/lib/commonjs/select/Select.js.map +1 -1
- package/lib/commonjs/select/Select.web.js +7 -4
- package/lib/commonjs/select/Select.web.js.map +1 -1
- package/lib/commonjs/select/use-required-description.js +37 -0
- package/lib/commonjs/select/use-required-description.js.map +1 -0
- package/lib/module/button/Button.js +36 -3
- package/lib/module/button/Button.js.map +1 -1
- package/lib/module/button/GlyphButton.js +7 -3
- package/lib/module/button/GlyphButton.js.map +1 -1
- package/lib/module/card-form/shared.js +3 -2
- package/lib/module/card-form/shared.js.map +1 -1
- package/lib/module/chat-composer/AttachmentMenu.js +7 -226
- package/lib/module/chat-composer/AttachmentMenu.js.map +1 -1
- package/lib/module/chat-composer/AttachmentMenu.web.js +12 -0
- package/lib/module/chat-composer/AttachmentMenu.web.js.map +1 -0
- package/lib/module/chat-composer/ChatComposer.js +8 -385
- package/lib/module/chat-composer/ChatComposer.js.map +1 -1
- package/lib/module/chat-composer/ChatComposer.web.js +12 -0
- package/lib/module/chat-composer/ChatComposer.web.js.map +1 -0
- package/lib/module/chat-composer/ComposerAttachmentStrip.js +4 -196
- package/lib/module/chat-composer/ComposerAttachmentStrip.js.map +1 -1
- package/lib/module/chat-composer/ComposerAttachmentStrip.web.js +8 -0
- package/lib/module/chat-composer/ComposerAttachmentStrip.web.js.map +1 -0
- package/lib/module/chat-composer/ComposerBanner.js +4 -162
- package/lib/module/chat-composer/ComposerBanner.js.map +1 -1
- package/lib/module/chat-composer/ComposerBanner.web.js +8 -0
- package/lib/module/chat-composer/ComposerBanner.web.js.map +1 -0
- package/lib/module/chat-composer/EmojiPicker.js +5 -440
- package/lib/module/chat-composer/EmojiPicker.js.map +1 -1
- package/lib/module/chat-composer/EmojiPicker.web.js +10 -0
- package/lib/module/chat-composer/EmojiPicker.web.js.map +1 -0
- package/lib/module/chat-composer/MessageContextMenu.js +11 -99
- package/lib/module/chat-composer/MessageContextMenu.js.map +1 -1
- package/lib/module/chat-composer/MessageContextMenu.web.js +15 -0
- package/lib/module/chat-composer/MessageContextMenu.web.js.map +1 -0
- package/lib/module/chat-composer/ReactionPicker.js +5 -104
- package/lib/module/chat-composer/ReactionPicker.js.map +1 -1
- package/lib/module/chat-composer/ReactionPicker.web.js +10 -0
- package/lib/module/chat-composer/ReactionPicker.web.js.map +1 -0
- package/lib/module/chat-composer/SuggestionList.js +4 -219
- package/lib/module/chat-composer/SuggestionList.js.map +1 -1
- package/lib/module/chat-composer/SuggestionList.web.js +8 -0
- package/lib/module/chat-composer/SuggestionList.web.js.map +1 -0
- package/lib/module/chat-composer/VoiceRecorder.js +6 -260
- package/lib/module/chat-composer/VoiceRecorder.js.map +1 -1
- package/lib/module/chat-composer/VoiceRecorder.web.js +12 -0
- package/lib/module/chat-composer/VoiceRecorder.web.js.map +1 -0
- package/lib/module/chat-composer/create-attachment-menu.js +238 -0
- package/lib/module/chat-composer/create-attachment-menu.js.map +1 -0
- package/lib/module/chat-composer/create-chat-composer.js +395 -0
- package/lib/module/chat-composer/create-chat-composer.js.map +1 -0
- package/lib/module/chat-composer/create-composer-attachment-strip.js +206 -0
- package/lib/module/chat-composer/create-composer-attachment-strip.js.map +1 -0
- package/lib/module/chat-composer/create-composer-banner.js +171 -0
- package/lib/module/chat-composer/create-composer-banner.js.map +1 -0
- package/lib/module/chat-composer/create-emoji-picker.js +451 -0
- package/lib/module/chat-composer/create-emoji-picker.js.map +1 -0
- package/lib/module/chat-composer/create-message-context-menu.js +114 -0
- package/lib/module/chat-composer/create-message-context-menu.js.map +1 -0
- package/lib/module/chat-composer/create-reaction-picker.js +115 -0
- package/lib/module/chat-composer/create-reaction-picker.js.map +1 -0
- package/lib/module/chat-composer/create-suggestion-list.js +229 -0
- package/lib/module/chat-composer/create-suggestion-list.js.map +1 -0
- package/lib/module/chat-composer/create-voice-recorder.js +272 -0
- package/lib/module/chat-composer/create-voice-recorder.js.map +1 -0
- package/lib/module/chat-composer/index.js +9 -9
- package/lib/module/chat-composer/index.js.map +1 -1
- package/lib/module/chat-composer/index.web.js +9 -9
- package/lib/module/chat-composer/index.web.js.map +1 -1
- package/lib/module/earnings/EarningsSummary.js +12 -2
- package/lib/module/earnings/EarningsSummary.js.map +1 -1
- package/lib/module/field/Field.js +2 -0
- package/lib/module/field/Field.js.map +1 -1
- package/lib/module/item/Item.js +16 -8
- package/lib/module/item/Item.js.map +1 -1
- package/lib/module/job-board/JobCard.js +6 -2
- package/lib/module/job-board/JobCard.js.map +1 -1
- package/lib/module/label/Label.js +2 -1
- package/lib/module/label/Label.js.map +1 -1
- package/lib/module/listing-details/AmenityList.js +4 -3
- package/lib/module/listing-details/AmenityList.js.map +1 -1
- package/lib/module/mail-compose/MailComposeSurface.js +1 -1
- package/lib/module/mail-compose/MailComposeSurface.js.map +1 -1
- package/lib/module/overlay/InteractionBoundary.js +25 -0
- package/lib/module/overlay/InteractionBoundary.js.map +1 -0
- package/lib/module/payment-method/PaymentMethodList.js +3 -2
- package/lib/module/payment-method/PaymentMethodList.js.map +1 -1
- package/lib/module/place-details/PlaceAmenities.js +15 -4
- package/lib/module/place-details/PlaceAmenities.js.map +1 -1
- package/lib/module/place-details/PlacePopularTimes.js +7 -1
- package/lib/module/place-details/PlacePopularTimes.js.map +1 -1
- package/lib/module/proof-of-delivery/ProofOfDelivery.js +10 -1
- package/lib/module/proof-of-delivery/ProofOfDelivery.js.map +1 -1
- package/lib/module/proof-of-delivery/shared.js +1 -1
- package/lib/module/proof-of-delivery/shared.js.map +1 -1
- package/lib/module/select/Select.js +7 -4
- package/lib/module/select/Select.js.map +1 -1
- package/lib/module/select/Select.web.js +7 -4
- package/lib/module/select/Select.web.js.map +1 -1
- package/lib/module/select/use-required-description.js +33 -0
- package/lib/module/select/use-required-description.js.map +1 -0
- package/lib/typescript/commonjs/button/Button.d.ts.map +1 -1
- package/lib/typescript/commonjs/card-form/shared.d.ts +2 -1
- package/lib/typescript/commonjs/card-form/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/chat-composer/AttachmentMenu.d.ts +1 -2
- package/lib/typescript/commonjs/chat-composer/AttachmentMenu.d.ts.map +1 -1
- package/lib/typescript/commonjs/chat-composer/AttachmentMenu.web.d.ts +2 -0
- package/lib/typescript/commonjs/chat-composer/AttachmentMenu.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/chat-composer/ChatComposer.d.ts +1 -2
- package/lib/typescript/commonjs/chat-composer/ChatComposer.d.ts.map +1 -1
- package/lib/typescript/commonjs/chat-composer/ChatComposer.web.d.ts +2 -0
- package/lib/typescript/commonjs/chat-composer/ChatComposer.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/chat-composer/ComposerAttachmentStrip.d.ts +1 -2
- package/lib/typescript/commonjs/chat-composer/ComposerAttachmentStrip.d.ts.map +1 -1
- package/lib/typescript/commonjs/chat-composer/ComposerAttachmentStrip.web.d.ts +2 -0
- package/lib/typescript/commonjs/chat-composer/ComposerAttachmentStrip.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/chat-composer/ComposerBanner.d.ts +1 -2
- package/lib/typescript/commonjs/chat-composer/ComposerBanner.d.ts.map +1 -1
- package/lib/typescript/commonjs/chat-composer/ComposerBanner.web.d.ts +2 -0
- package/lib/typescript/commonjs/chat-composer/ComposerBanner.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/chat-composer/EmojiPicker.d.ts +1 -2
- package/lib/typescript/commonjs/chat-composer/EmojiPicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/chat-composer/EmojiPicker.web.d.ts +2 -0
- package/lib/typescript/commonjs/chat-composer/EmojiPicker.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/chat-composer/MessageContextMenu.d.ts +1 -2
- package/lib/typescript/commonjs/chat-composer/MessageContextMenu.d.ts.map +1 -1
- package/lib/typescript/commonjs/chat-composer/MessageContextMenu.web.d.ts +2 -0
- package/lib/typescript/commonjs/chat-composer/MessageContextMenu.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/chat-composer/ReactionPicker.d.ts +1 -2
- package/lib/typescript/commonjs/chat-composer/ReactionPicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/chat-composer/ReactionPicker.web.d.ts +2 -0
- package/lib/typescript/commonjs/chat-composer/ReactionPicker.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/chat-composer/SuggestionList.d.ts +1 -2
- package/lib/typescript/commonjs/chat-composer/SuggestionList.d.ts.map +1 -1
- package/lib/typescript/commonjs/chat-composer/SuggestionList.web.d.ts +2 -0
- package/lib/typescript/commonjs/chat-composer/SuggestionList.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/chat-composer/VoiceRecorder.d.ts +1 -2
- package/lib/typescript/commonjs/chat-composer/VoiceRecorder.d.ts.map +1 -1
- package/lib/typescript/commonjs/chat-composer/VoiceRecorder.web.d.ts +2 -0
- package/lib/typescript/commonjs/chat-composer/VoiceRecorder.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/chat-composer/create-attachment-menu.d.ts +11 -0
- package/lib/typescript/commonjs/chat-composer/create-attachment-menu.d.ts.map +1 -0
- package/lib/typescript/commonjs/chat-composer/create-chat-composer.d.ts +11 -0
- package/lib/typescript/commonjs/chat-composer/create-chat-composer.d.ts.map +1 -0
- package/lib/typescript/commonjs/chat-composer/create-composer-attachment-strip.d.ts +7 -0
- package/lib/typescript/commonjs/chat-composer/create-composer-attachment-strip.d.ts.map +1 -0
- package/lib/typescript/commonjs/chat-composer/create-composer-banner.d.ts +7 -0
- package/lib/typescript/commonjs/chat-composer/create-composer-banner.d.ts.map +1 -0
- package/lib/typescript/commonjs/chat-composer/create-emoji-picker.d.ts +9 -0
- package/lib/typescript/commonjs/chat-composer/create-emoji-picker.d.ts.map +1 -0
- package/lib/typescript/commonjs/chat-composer/create-message-context-menu.d.ts +14 -0
- package/lib/typescript/commonjs/chat-composer/create-message-context-menu.d.ts.map +1 -0
- package/lib/typescript/commonjs/chat-composer/create-reaction-picker.d.ts +9 -0
- package/lib/typescript/commonjs/chat-composer/create-reaction-picker.d.ts.map +1 -0
- package/lib/typescript/commonjs/chat-composer/create-suggestion-list.d.ts +7 -0
- package/lib/typescript/commonjs/chat-composer/create-suggestion-list.d.ts.map +1 -0
- package/lib/typescript/commonjs/chat-composer/create-voice-recorder.d.ts +11 -0
- package/lib/typescript/commonjs/chat-composer/create-voice-recorder.d.ts.map +1 -0
- package/lib/typescript/commonjs/chat-composer/index.web.d.ts +9 -9
- package/lib/typescript/commonjs/chat-composer/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/earnings/EarningsSummary.d.ts.map +1 -1
- package/lib/typescript/commonjs/field/Field.d.ts +1 -1
- package/lib/typescript/commonjs/field/Field.d.ts.map +1 -1
- package/lib/typescript/commonjs/field/types.d.ts +2 -0
- package/lib/typescript/commonjs/field/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/floating/types.d.ts +1 -0
- package/lib/typescript/commonjs/floating/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/item/Item.d.ts.map +1 -1
- package/lib/typescript/commonjs/job-board/JobCard.d.ts.map +1 -1
- package/lib/typescript/commonjs/label/Label.d.ts +1 -1
- package/lib/typescript/commonjs/label/Label.d.ts.map +1 -1
- package/lib/typescript/commonjs/label/types.d.ts +2 -0
- package/lib/typescript/commonjs/label/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/listing-details/AmenityList.d.ts.map +1 -1
- package/lib/typescript/commonjs/overlay/InteractionBoundary.d.ts +7 -0
- package/lib/typescript/commonjs/overlay/InteractionBoundary.d.ts.map +1 -0
- package/lib/typescript/commonjs/payment-method/PaymentMethodList.d.ts.map +1 -1
- package/lib/typescript/commonjs/place-details/PlaceAmenities.d.ts.map +1 -1
- package/lib/typescript/commonjs/place-details/PlacePopularTimes.d.ts.map +1 -1
- package/lib/typescript/commonjs/proof-of-delivery/ProofOfDelivery.d.ts.map +1 -1
- package/lib/typescript/commonjs/select/Select.d.ts.map +1 -1
- package/lib/typescript/commonjs/select/Select.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/select/use-required-description.d.ts +7 -0
- package/lib/typescript/commonjs/select/use-required-description.d.ts.map +1 -0
- package/lib/typescript/module/button/Button.d.ts.map +1 -1
- package/lib/typescript/module/card-form/shared.d.ts +2 -1
- package/lib/typescript/module/card-form/shared.d.ts.map +1 -1
- package/lib/typescript/module/chat-composer/AttachmentMenu.d.ts +1 -2
- package/lib/typescript/module/chat-composer/AttachmentMenu.d.ts.map +1 -1
- package/lib/typescript/module/chat-composer/AttachmentMenu.web.d.ts +2 -0
- package/lib/typescript/module/chat-composer/AttachmentMenu.web.d.ts.map +1 -0
- package/lib/typescript/module/chat-composer/ChatComposer.d.ts +1 -2
- package/lib/typescript/module/chat-composer/ChatComposer.d.ts.map +1 -1
- package/lib/typescript/module/chat-composer/ChatComposer.web.d.ts +2 -0
- package/lib/typescript/module/chat-composer/ChatComposer.web.d.ts.map +1 -0
- package/lib/typescript/module/chat-composer/ComposerAttachmentStrip.d.ts +1 -2
- package/lib/typescript/module/chat-composer/ComposerAttachmentStrip.d.ts.map +1 -1
- package/lib/typescript/module/chat-composer/ComposerAttachmentStrip.web.d.ts +2 -0
- package/lib/typescript/module/chat-composer/ComposerAttachmentStrip.web.d.ts.map +1 -0
- package/lib/typescript/module/chat-composer/ComposerBanner.d.ts +1 -2
- package/lib/typescript/module/chat-composer/ComposerBanner.d.ts.map +1 -1
- package/lib/typescript/module/chat-composer/ComposerBanner.web.d.ts +2 -0
- package/lib/typescript/module/chat-composer/ComposerBanner.web.d.ts.map +1 -0
- package/lib/typescript/module/chat-composer/EmojiPicker.d.ts +1 -2
- package/lib/typescript/module/chat-composer/EmojiPicker.d.ts.map +1 -1
- package/lib/typescript/module/chat-composer/EmojiPicker.web.d.ts +2 -0
- package/lib/typescript/module/chat-composer/EmojiPicker.web.d.ts.map +1 -0
- package/lib/typescript/module/chat-composer/MessageContextMenu.d.ts +1 -2
- package/lib/typescript/module/chat-composer/MessageContextMenu.d.ts.map +1 -1
- package/lib/typescript/module/chat-composer/MessageContextMenu.web.d.ts +2 -0
- package/lib/typescript/module/chat-composer/MessageContextMenu.web.d.ts.map +1 -0
- package/lib/typescript/module/chat-composer/ReactionPicker.d.ts +1 -2
- package/lib/typescript/module/chat-composer/ReactionPicker.d.ts.map +1 -1
- package/lib/typescript/module/chat-composer/ReactionPicker.web.d.ts +2 -0
- package/lib/typescript/module/chat-composer/ReactionPicker.web.d.ts.map +1 -0
- package/lib/typescript/module/chat-composer/SuggestionList.d.ts +1 -2
- package/lib/typescript/module/chat-composer/SuggestionList.d.ts.map +1 -1
- package/lib/typescript/module/chat-composer/SuggestionList.web.d.ts +2 -0
- package/lib/typescript/module/chat-composer/SuggestionList.web.d.ts.map +1 -0
- package/lib/typescript/module/chat-composer/VoiceRecorder.d.ts +1 -2
- package/lib/typescript/module/chat-composer/VoiceRecorder.d.ts.map +1 -1
- package/lib/typescript/module/chat-composer/VoiceRecorder.web.d.ts +2 -0
- package/lib/typescript/module/chat-composer/VoiceRecorder.web.d.ts.map +1 -0
- package/lib/typescript/module/chat-composer/create-attachment-menu.d.ts +11 -0
- package/lib/typescript/module/chat-composer/create-attachment-menu.d.ts.map +1 -0
- package/lib/typescript/module/chat-composer/create-chat-composer.d.ts +11 -0
- package/lib/typescript/module/chat-composer/create-chat-composer.d.ts.map +1 -0
- package/lib/typescript/module/chat-composer/create-composer-attachment-strip.d.ts +7 -0
- package/lib/typescript/module/chat-composer/create-composer-attachment-strip.d.ts.map +1 -0
- package/lib/typescript/module/chat-composer/create-composer-banner.d.ts +7 -0
- package/lib/typescript/module/chat-composer/create-composer-banner.d.ts.map +1 -0
- package/lib/typescript/module/chat-composer/create-emoji-picker.d.ts +9 -0
- package/lib/typescript/module/chat-composer/create-emoji-picker.d.ts.map +1 -0
- package/lib/typescript/module/chat-composer/create-message-context-menu.d.ts +14 -0
- package/lib/typescript/module/chat-composer/create-message-context-menu.d.ts.map +1 -0
- package/lib/typescript/module/chat-composer/create-reaction-picker.d.ts +9 -0
- package/lib/typescript/module/chat-composer/create-reaction-picker.d.ts.map +1 -0
- package/lib/typescript/module/chat-composer/create-suggestion-list.d.ts +7 -0
- package/lib/typescript/module/chat-composer/create-suggestion-list.d.ts.map +1 -0
- package/lib/typescript/module/chat-composer/create-voice-recorder.d.ts +11 -0
- package/lib/typescript/module/chat-composer/create-voice-recorder.d.ts.map +1 -0
- package/lib/typescript/module/chat-composer/index.web.d.ts +9 -9
- package/lib/typescript/module/chat-composer/index.web.d.ts.map +1 -1
- package/lib/typescript/module/earnings/EarningsSummary.d.ts.map +1 -1
- package/lib/typescript/module/field/Field.d.ts +1 -1
- package/lib/typescript/module/field/Field.d.ts.map +1 -1
- package/lib/typescript/module/field/types.d.ts +2 -0
- package/lib/typescript/module/field/types.d.ts.map +1 -1
- package/lib/typescript/module/floating/types.d.ts +1 -0
- package/lib/typescript/module/floating/types.d.ts.map +1 -1
- package/lib/typescript/module/item/Item.d.ts.map +1 -1
- package/lib/typescript/module/job-board/JobCard.d.ts.map +1 -1
- package/lib/typescript/module/label/Label.d.ts +1 -1
- package/lib/typescript/module/label/Label.d.ts.map +1 -1
- package/lib/typescript/module/label/types.d.ts +2 -0
- package/lib/typescript/module/label/types.d.ts.map +1 -1
- package/lib/typescript/module/listing-details/AmenityList.d.ts.map +1 -1
- package/lib/typescript/module/overlay/InteractionBoundary.d.ts +7 -0
- package/lib/typescript/module/overlay/InteractionBoundary.d.ts.map +1 -0
- package/lib/typescript/module/payment-method/PaymentMethodList.d.ts.map +1 -1
- package/lib/typescript/module/place-details/PlaceAmenities.d.ts.map +1 -1
- package/lib/typescript/module/place-details/PlacePopularTimes.d.ts.map +1 -1
- package/lib/typescript/module/proof-of-delivery/ProofOfDelivery.d.ts.map +1 -1
- package/lib/typescript/module/select/Select.d.ts.map +1 -1
- package/lib/typescript/module/select/Select.web.d.ts.map +1 -1
- package/lib/typescript/module/select/use-required-description.d.ts +7 -0
- package/lib/typescript/module/select/use-required-description.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/support/adoption-matrix.ts +708 -0
- package/src/__tests__/support/card-surface.ts +17 -0
- package/src/__tests__/support/collision-fixture-barrel.ts +20 -0
- package/src/__tests__/support/commerce-harness.tsx +97 -0
- package/src/__tests__/support/composite.ts +68 -0
- package/src/__tests__/support/constructed-style-sheets.ts +68 -0
- package/src/__tests__/support/press-host.ts +30 -0
- package/src/__tests__/support/rendered-style.ts +99 -0
- package/src/__tests__/support/unread-hook-fixture.ts +33 -0
- package/src/__tests__/support/worklet-capture-fixture.tsx +28 -0
- package/src/button/Button.tsx +35 -10
- package/src/button/GlyphButton.tsx +3 -3
- package/src/card-form/shared.ts +3 -2
- package/src/chat-composer/AttachmentMenu.tsx +2 -214
- package/src/chat-composer/AttachmentMenu.web.tsx +5 -0
- package/src/chat-composer/ChatComposer.tsx +2 -459
- package/src/chat-composer/ChatComposer.web.tsx +6 -0
- package/src/chat-composer/ComposerAttachmentStrip.tsx +2 -202
- package/src/chat-composer/ComposerAttachmentStrip.web.tsx +4 -0
- package/src/chat-composer/ComposerBanner.tsx +2 -157
- package/src/chat-composer/ComposerBanner.web.tsx +4 -0
- package/src/chat-composer/EmojiPicker.tsx +2 -402
- package/src/chat-composer/EmojiPicker.web.tsx +5 -0
- package/src/chat-composer/MessageContextMenu.tsx +2 -88
- package/src/chat-composer/MessageContextMenu.web.tsx +12 -0
- package/src/chat-composer/ReactionPicker.tsx +2 -100
- package/src/chat-composer/ReactionPicker.web.tsx +5 -0
- package/src/chat-composer/SuggestionList.tsx +2 -209
- package/src/chat-composer/SuggestionList.web.tsx +4 -0
- package/src/chat-composer/VoiceRecorder.tsx +2 -287
- package/src/chat-composer/VoiceRecorder.web.tsx +6 -0
- package/src/chat-composer/create-attachment-menu.tsx +228 -0
- package/src/chat-composer/create-chat-composer.tsx +473 -0
- package/src/chat-composer/create-composer-attachment-strip.tsx +212 -0
- package/src/chat-composer/create-composer-banner.tsx +167 -0
- package/src/chat-composer/create-emoji-picker.tsx +414 -0
- package/src/chat-composer/create-message-context-menu.tsx +112 -0
- package/src/chat-composer/create-reaction-picker.tsx +112 -0
- package/src/chat-composer/create-suggestion-list.tsx +219 -0
- package/src/chat-composer/create-voice-recorder.tsx +301 -0
- package/src/chat-composer/index.web.ts +9 -9
- package/src/earnings/EarningsSummary.tsx +9 -2
- package/src/field/Field.tsx +2 -1
- package/src/field/types.ts +2 -0
- package/src/floating/types.ts +1 -0
- package/src/item/Item.tsx +16 -11
- package/src/job-board/JobCard.tsx +4 -1
- package/src/label/Label.tsx +2 -1
- package/src/label/types.ts +2 -0
- package/src/listing-details/AmenityList.tsx +4 -3
- package/src/overlay/InteractionBoundary.tsx +24 -0
- package/src/payment-method/PaymentMethodList.tsx +2 -1
- package/src/place-details/PlaceAmenities.tsx +9 -0
- package/src/place-details/PlacePopularTimes.tsx +7 -1
- package/src/proof-of-delivery/ProofOfDelivery.tsx +9 -1
- package/src/proof-of-delivery/shared.ts +1 -1
- package/src/select/Select.tsx +5 -1
- package/src/select/Select.web.tsx +5 -1
- package/src/select/use-required-description.tsx +20 -0
- package/src/theme/__tests__/__fixtures__/golden-resolved-tokens.json +9346 -0
- package/src/theme/__tests__/__fixtures__/tonal-glass-primary-failures.json +69 -0
- package/src/theme/__tests__/fixtures/color-engine-golden.json +1 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createComposerBanner = createComposerBanner;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _RiCloseLine = require("../icons/remix/RiCloseLine.js");
|
|
10
|
+
var _context = require("../image-resolver/context.js");
|
|
11
|
+
var _useTheme = require("../theme/use-theme.js");
|
|
12
|
+
var _index = require("../typography/index.js");
|
|
13
|
+
var _shared = require("./shared.js");
|
|
14
|
+
var _commonMessages = require("../locale/common-messages.js");
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
/**
|
|
18
|
+
* The stack above the input: a reply / edit / forward preview, or the one-line
|
|
19
|
+
* `note` a slow-mode countdown and a scheduled send use.
|
|
20
|
+
*
|
|
21
|
+
* Every banner is the same row — rail, glyph, optional thumbnail, two lines of
|
|
22
|
+
* text, a close button — because they are the same affordance ("the next
|
|
23
|
+
* message is about THIS, and here is how to get out of it"). `note` drops the
|
|
24
|
+
* rail and the surface, which is the difference between "you are in a mode" and
|
|
25
|
+
* "here is a fact about sending".
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/** Platform dependencies are bound once; shared rendering adds no wrapper. */
|
|
29
|
+
function createComposerBanner({
|
|
30
|
+
ComposerIconButton
|
|
31
|
+
}) {
|
|
32
|
+
/** A URL passes through; a bare id goes to the app's `ImageResolver`. */
|
|
33
|
+
function isUrl(value) {
|
|
34
|
+
return /^(https?:)?\/\//.test(value) || value.startsWith('data:') || value.startsWith('file:');
|
|
35
|
+
}
|
|
36
|
+
function ComposerBanner({
|
|
37
|
+
kind,
|
|
38
|
+
title,
|
|
39
|
+
preview,
|
|
40
|
+
thumbnail,
|
|
41
|
+
icon,
|
|
42
|
+
accentColor,
|
|
43
|
+
onClose,
|
|
44
|
+
closeLabel: closeLabelProp,
|
|
45
|
+
trailing,
|
|
46
|
+
style,
|
|
47
|
+
testID,
|
|
48
|
+
accessibilityLabel
|
|
49
|
+
}) {
|
|
50
|
+
const common = (0, _commonMessages.useCommonMessages)();
|
|
51
|
+
const closeLabel = closeLabelProp ?? common.cancel;
|
|
52
|
+
const theme = (0, _useTheme.useTheme)();
|
|
53
|
+
const palette = (0, _shared.resolveChatComposerPalette)(theme);
|
|
54
|
+
const resolveImage = (0, _context.useImageResolver)();
|
|
55
|
+
const Icon = icon ?? _shared.BANNER_ICONS[kind];
|
|
56
|
+
const accent = accentColor ?? palette.accent;
|
|
57
|
+
const note = kind === 'note';
|
|
58
|
+
const thumbUri = thumbnail === undefined ? undefined : isUrl(thumbnail) ? thumbnail : resolveImage?.(thumbnail, 'thumb');
|
|
59
|
+
if (note) {
|
|
60
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
61
|
+
accessibilityRole: "text",
|
|
62
|
+
accessibilityLabel: accessibilityLabel ?? (preview ? `${title}. ${preview}` : title),
|
|
63
|
+
style: [{
|
|
64
|
+
flexDirection: 'row',
|
|
65
|
+
alignItems: 'center',
|
|
66
|
+
gap: 6,
|
|
67
|
+
paddingLeft: 10,
|
|
68
|
+
paddingRight: 6,
|
|
69
|
+
paddingTop: 2,
|
|
70
|
+
paddingBottom: 2
|
|
71
|
+
}, style],
|
|
72
|
+
testID: testID,
|
|
73
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
|
|
74
|
+
width: 14,
|
|
75
|
+
height: 14,
|
|
76
|
+
fill: palette.iconSecondary
|
|
77
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
|
|
78
|
+
variant: "caption-1-regular",
|
|
79
|
+
numberOfLines: 1,
|
|
80
|
+
style: {
|
|
81
|
+
color: palette.textSecondary,
|
|
82
|
+
flexShrink: 1
|
|
83
|
+
},
|
|
84
|
+
children: title
|
|
85
|
+
}), preview ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
|
|
86
|
+
variant: "caption-1-regular",
|
|
87
|
+
numberOfLines: 1,
|
|
88
|
+
style: {
|
|
89
|
+
color: palette.textPlaceholder,
|
|
90
|
+
flexShrink: 1
|
|
91
|
+
},
|
|
92
|
+
children: preview
|
|
93
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
94
|
+
style: {
|
|
95
|
+
flexGrow: 1
|
|
96
|
+
}
|
|
97
|
+
}), trailing, onClose ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ComposerIconButton, {
|
|
98
|
+
icon: _RiCloseLine.RiCloseLine,
|
|
99
|
+
accessibilityLabel: closeLabel,
|
|
100
|
+
onPress: onClose,
|
|
101
|
+
size: 24,
|
|
102
|
+
iconSize: 14
|
|
103
|
+
}) : null]
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
107
|
+
accessibilityLabel: accessibilityLabel ?? (preview ? `${title}. ${preview}` : title),
|
|
108
|
+
style: [{
|
|
109
|
+
flexDirection: 'row',
|
|
110
|
+
alignItems: 'center',
|
|
111
|
+
gap: 10,
|
|
112
|
+
borderRadius: _shared.BANNER_RADIUS,
|
|
113
|
+
backgroundColor: palette.accentSoft,
|
|
114
|
+
paddingLeft: 8,
|
|
115
|
+
paddingRight: 4,
|
|
116
|
+
paddingTop: 6,
|
|
117
|
+
paddingBottom: 6
|
|
118
|
+
}, style],
|
|
119
|
+
testID: testID,
|
|
120
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
121
|
+
testID: testID ? `${testID}-rail` : undefined,
|
|
122
|
+
style: {
|
|
123
|
+
width: _shared.BANNER_RAIL_WIDTH,
|
|
124
|
+
alignSelf: 'stretch',
|
|
125
|
+
minHeight: 32,
|
|
126
|
+
borderRadius: 2,
|
|
127
|
+
backgroundColor: accent
|
|
128
|
+
}
|
|
129
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
|
|
130
|
+
width: 18,
|
|
131
|
+
height: 18,
|
|
132
|
+
fill: accent
|
|
133
|
+
}), thumbUri ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
|
|
134
|
+
source: {
|
|
135
|
+
uri: thumbUri
|
|
136
|
+
},
|
|
137
|
+
accessibilityIgnoresInvertColors: true,
|
|
138
|
+
style: {
|
|
139
|
+
width: 32,
|
|
140
|
+
height: 32,
|
|
141
|
+
borderRadius: 8,
|
|
142
|
+
backgroundColor: palette.inset
|
|
143
|
+
}
|
|
144
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
145
|
+
style: {
|
|
146
|
+
flexShrink: 1,
|
|
147
|
+
flexGrow: 1,
|
|
148
|
+
gap: 1
|
|
149
|
+
},
|
|
150
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
|
|
151
|
+
variant: "body-2-medium",
|
|
152
|
+
numberOfLines: 1,
|
|
153
|
+
style: {
|
|
154
|
+
color: accent
|
|
155
|
+
},
|
|
156
|
+
children: title
|
|
157
|
+
}), preview ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
|
|
158
|
+
variant: "body-2-regular",
|
|
159
|
+
numberOfLines: 1,
|
|
160
|
+
style: {
|
|
161
|
+
color: palette.textSecondary
|
|
162
|
+
},
|
|
163
|
+
children: preview
|
|
164
|
+
}) : null]
|
|
165
|
+
}), trailing, onClose ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ComposerIconButton, {
|
|
166
|
+
icon: _RiCloseLine.RiCloseLine,
|
|
167
|
+
accessibilityLabel: closeLabel,
|
|
168
|
+
onPress: onClose,
|
|
169
|
+
size: 28,
|
|
170
|
+
iconSize: 16
|
|
171
|
+
}) : null]
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
return ComposerBanner;
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=create-composer-banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_RiCloseLine","_context","_useTheme","_index","_shared","_commonMessages","_jsxRuntime","e","__esModule","default","createComposerBanner","ComposerIconButton","isUrl","value","test","startsWith","ComposerBanner","kind","title","preview","thumbnail","icon","accentColor","onClose","closeLabel","closeLabelProp","trailing","style","testID","accessibilityLabel","common","useCommonMessages","cancel","theme","useTheme","palette","resolveChatComposerPalette","resolveImage","useImageResolver","Icon","BANNER_ICONS","accent","note","thumbUri","undefined","jsxs","View","accessibilityRole","flexDirection","alignItems","gap","paddingLeft","paddingRight","paddingTop","paddingBottom","children","jsx","width","height","fill","iconSecondary","Text","variant","numberOfLines","color","textSecondary","flexShrink","textPlaceholder","flexGrow","RiCloseLine","onPress","size","iconSize","borderRadius","BANNER_RADIUS","backgroundColor","accentSoft","BANNER_RAIL_WIDTH","alignSelf","minHeight","Image","source","uri","accessibilityIgnoresInvertColors","inset"],"sourceRoot":"../../../src","sources":["chat-composer/create-composer-banner.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createEmojiPicker = createEmojiPicker;
|
|
7
|
+
var _useCardFill = require("../card/use-card-fill.js");
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactNative = require("react-native");
|
|
10
|
+
var _RiEmotionLine = require("../icons/remix/RiEmotionLine.js");
|
|
11
|
+
var _RiSearchLine = require("../icons/remix/RiSearchLine.js");
|
|
12
|
+
var _useControllableState = require("../hooks/use-controllable-state.js");
|
|
13
|
+
var _useTheme = require("../theme/use-theme.js");
|
|
14
|
+
var _index = require("../typography/index.js");
|
|
15
|
+
var _scale = require("../typography/scale.js");
|
|
16
|
+
var _shared = 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
|
+
/**
|
|
23
|
+
* A controlled, presentational emoji grid.
|
|
24
|
+
*
|
|
25
|
+
* BLOOM SHIPS NO EMOJI DATASET, and that is the design rather than an omission:
|
|
26
|
+
* a full set with names and keywords is tens of kilobytes that every app with
|
|
27
|
+
* its own would still pay for, and emoji names are localised. `groups` arrives
|
|
28
|
+
* as a prop. The object form of an entry (`{ char, name, keywords }`) is what
|
|
29
|
+
* the built-in search matches on; a dataset of bare glyphs still renders, it
|
|
30
|
+
* just only matches a pasted glyph — which is the honest behaviour, not a
|
|
31
|
+
* silent one.
|
|
32
|
+
*
|
|
33
|
+
* The grid is a `FlatList` on BOTH platforms, over pre-chunked ROWS rather than
|
|
34
|
+
* single emoji, with exact `getItemLayout` offsets. A few thousand entries is
|
|
35
|
+
* the normal case: at eight columns that is a few hundred rows, of which a
|
|
36
|
+
* dozen are mounted, and the exact offsets are what let a category tab jump
|
|
37
|
+
* straight to its header instead of estimating.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
/** Platform dependencies are bound once; shared rendering adds no wrapper. */
|
|
41
|
+
function createEmojiPicker({
|
|
42
|
+
Surface,
|
|
43
|
+
Button
|
|
44
|
+
}) {
|
|
45
|
+
const HEADER_HEIGHT = 26;
|
|
46
|
+
const EMOJI_TAB = '__emoji';
|
|
47
|
+
function chunk(entries, columns) {
|
|
48
|
+
const out = [];
|
|
49
|
+
for (let i = 0; i < entries.length; i += columns) out.push(entries.slice(i, i + columns));
|
|
50
|
+
return out;
|
|
51
|
+
}
|
|
52
|
+
function entryName(entry, char) {
|
|
53
|
+
return typeof entry === 'string' ? char : entry.name ?? char;
|
|
54
|
+
}
|
|
55
|
+
function EmojiPicker({
|
|
56
|
+
groups,
|
|
57
|
+
onSelectEmoji,
|
|
58
|
+
activeGroup,
|
|
59
|
+
defaultActiveGroup,
|
|
60
|
+
onActiveGroupChange,
|
|
61
|
+
query,
|
|
62
|
+
defaultQuery = '',
|
|
63
|
+
onQueryChange,
|
|
64
|
+
filter = true,
|
|
65
|
+
frequentlyUsed,
|
|
66
|
+
skinTone,
|
|
67
|
+
defaultSkinTone = 0,
|
|
68
|
+
onSkinToneChange,
|
|
69
|
+
columns = 8,
|
|
70
|
+
height = 288,
|
|
71
|
+
tabs,
|
|
72
|
+
activeTab,
|
|
73
|
+
onActiveTabChange,
|
|
74
|
+
labels: labelOverrides,
|
|
75
|
+
style,
|
|
76
|
+
testID,
|
|
77
|
+
accessibilityLabel: accessibilityLabelProp
|
|
78
|
+
}) {
|
|
79
|
+
const theme = (0, _useTheme.useTheme)();
|
|
80
|
+
const palette = (0, _shared.resolveChatComposerPalette)(theme, (0, _useCardFill.useCardFill)(style));
|
|
81
|
+
(0, _webHooks.useChatComposerWebCss)();
|
|
82
|
+
const {
|
|
83
|
+
messages
|
|
84
|
+
} = (0, _messages.useMessages)(_messages2.CHAT_COMPOSER_MESSAGES);
|
|
85
|
+
const accessibilityLabel = accessibilityLabelProp ?? messages.emojiPicker;
|
|
86
|
+
const labels = {
|
|
87
|
+
search: messages.searchEmoji,
|
|
88
|
+
empty: messages.noEmoji,
|
|
89
|
+
frequent: messages.frequentlyUsed,
|
|
90
|
+
skinTone: messages.skinTone,
|
|
91
|
+
emojiTab: messages.emoji,
|
|
92
|
+
...labelOverrides
|
|
93
|
+
};
|
|
94
|
+
const [search, setSearch] = (0, _useControllableState.useControllableState)({
|
|
95
|
+
value: query,
|
|
96
|
+
defaultValue: defaultQuery,
|
|
97
|
+
onChange: onQueryChange
|
|
98
|
+
});
|
|
99
|
+
const [tone, setTone] = (0, _useControllableState.useControllableState)({
|
|
100
|
+
value: skinTone,
|
|
101
|
+
defaultValue: defaultSkinTone,
|
|
102
|
+
onChange: onSkinToneChange
|
|
103
|
+
});
|
|
104
|
+
const [category, setCategory] = (0, _useControllableState.useControllableState)({
|
|
105
|
+
value: activeGroup,
|
|
106
|
+
defaultValue: defaultActiveGroup ?? groups[0]?.key ?? '',
|
|
107
|
+
onChange: onActiveGroupChange
|
|
108
|
+
});
|
|
109
|
+
const [tab, setTab] = (0, _useControllableState.useControllableState)({
|
|
110
|
+
value: activeTab,
|
|
111
|
+
defaultValue: EMOJI_TAB,
|
|
112
|
+
onChange: onActiveTabChange
|
|
113
|
+
});
|
|
114
|
+
const [toneOpen, setToneOpen] = (0, _react.useState)(false);
|
|
115
|
+
const listRef = (0, _react.useRef)(null);
|
|
116
|
+
const visible = (0, _react.useMemo)(() => filter ? (0, _shared.filterEmojiGroups)(groups, search) : groups, [filter, groups, search]);
|
|
117
|
+
const {
|
|
118
|
+
rows,
|
|
119
|
+
offsets,
|
|
120
|
+
heights,
|
|
121
|
+
headerIndex
|
|
122
|
+
} = (0, _react.useMemo)(() => {
|
|
123
|
+
const all = [];
|
|
124
|
+
if (frequentlyUsed && frequentlyUsed.length > 0 && !search.trim()) {
|
|
125
|
+
all.push({
|
|
126
|
+
key: 'frequent',
|
|
127
|
+
label: labels.frequent,
|
|
128
|
+
emojis: frequentlyUsed
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
all.push(...visible);
|
|
132
|
+
const built = [];
|
|
133
|
+
const index = {};
|
|
134
|
+
for (const group of all) {
|
|
135
|
+
index[group.key] = built.length;
|
|
136
|
+
built.push({
|
|
137
|
+
kind: 'header',
|
|
138
|
+
key: `h-${group.key}`,
|
|
139
|
+
label: group.label
|
|
140
|
+
});
|
|
141
|
+
chunk(group.emojis, columns).forEach((entries, i) => built.push({
|
|
142
|
+
kind: 'emojis',
|
|
143
|
+
key: `${group.key}-${i}`,
|
|
144
|
+
entries
|
|
145
|
+
}));
|
|
146
|
+
}
|
|
147
|
+
const rowHeights = built.map(row => row.kind === 'header' ? HEADER_HEIGHT : _shared.EMOJI_CELL);
|
|
148
|
+
const rowOffsets = [];
|
|
149
|
+
let running = 0;
|
|
150
|
+
for (const h of rowHeights) {
|
|
151
|
+
rowOffsets.push(running);
|
|
152
|
+
running += h;
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
rows: built,
|
|
156
|
+
offsets: rowOffsets,
|
|
157
|
+
heights: rowHeights,
|
|
158
|
+
headerIndex: index
|
|
159
|
+
};
|
|
160
|
+
}, [columns, frequentlyUsed, labels.frequent, search, visible]);
|
|
161
|
+
const jumpTo = (0, _react.useCallback)(key => {
|
|
162
|
+
setCategory(key);
|
|
163
|
+
const at = headerIndex[key];
|
|
164
|
+
if (at === undefined) return;
|
|
165
|
+
listRef.current?.scrollToOffset({
|
|
166
|
+
offset: offsets[at] ?? 0,
|
|
167
|
+
animated: true
|
|
168
|
+
});
|
|
169
|
+
}, [headerIndex, offsets, setCategory]);
|
|
170
|
+
const renderRow = (0, _react.useCallback)(({
|
|
171
|
+
item
|
|
172
|
+
}) => {
|
|
173
|
+
if (item.kind === 'header') {
|
|
174
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
175
|
+
style: {
|
|
176
|
+
height: HEADER_HEIGHT,
|
|
177
|
+
justifyContent: 'flex-end',
|
|
178
|
+
paddingLeft: 6
|
|
179
|
+
},
|
|
180
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
|
|
181
|
+
variant: "caption-1-medium",
|
|
182
|
+
style: {
|
|
183
|
+
color: palette.textSecondary
|
|
184
|
+
},
|
|
185
|
+
children: item.label
|
|
186
|
+
})
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
190
|
+
style: {
|
|
191
|
+
flexDirection: 'row',
|
|
192
|
+
height: _shared.EMOJI_CELL
|
|
193
|
+
},
|
|
194
|
+
children: item.entries.map((entry, i) => {
|
|
195
|
+
const base = (0, _shared.emojiChar)(entry);
|
|
196
|
+
const char = (0, _shared.applySkinTone)(base, tone);
|
|
197
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Button, {
|
|
198
|
+
appearance: "plain",
|
|
199
|
+
tone: "neutral",
|
|
200
|
+
accessibilityLabel: entryName(entry, char),
|
|
201
|
+
onPress: () => onSelectEmoji?.(char),
|
|
202
|
+
style: {
|
|
203
|
+
padding: 0,
|
|
204
|
+
minWidth: 0,
|
|
205
|
+
minHeight: 0,
|
|
206
|
+
flexShrink: 0,
|
|
207
|
+
width: _shared.EMOJI_CELL,
|
|
208
|
+
height: _shared.EMOJI_CELL,
|
|
209
|
+
alignItems: 'center',
|
|
210
|
+
justifyContent: 'center',
|
|
211
|
+
borderRadius: 8
|
|
212
|
+
},
|
|
213
|
+
testID: testID ? `${testID}-emoji-${base}` : undefined,
|
|
214
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
|
|
215
|
+
variant: "title-2-regular",
|
|
216
|
+
children: char
|
|
217
|
+
})
|
|
218
|
+
}, `${base}-${i}`);
|
|
219
|
+
})
|
|
220
|
+
});
|
|
221
|
+
}, [onSelectEmoji, palette.textSecondary, testID, tone]);
|
|
222
|
+
const panel = {
|
|
223
|
+
borderRadius: _shared.PANEL_RADIUS,
|
|
224
|
+
paddingTop: 8,
|
|
225
|
+
paddingBottom: 8,
|
|
226
|
+
paddingLeft: 8,
|
|
227
|
+
paddingRight: 8,
|
|
228
|
+
gap: 8,
|
|
229
|
+
'--bloom-chat-composer-ring': palette.focusRing
|
|
230
|
+
};
|
|
231
|
+
const topTabs = [{
|
|
232
|
+
key: EMOJI_TAB,
|
|
233
|
+
label: labels.emojiTab,
|
|
234
|
+
icon: _RiEmotionLine.RiEmotionLine
|
|
235
|
+
}, ...(tabs ?? [])];
|
|
236
|
+
const activeCustom = tabs?.find(t => t.key === tab);
|
|
237
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Surface, {
|
|
238
|
+
accessibilityLabel: accessibilityLabel,
|
|
239
|
+
style: [panel, style],
|
|
240
|
+
testID: testID,
|
|
241
|
+
children: [tabs && tabs.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
242
|
+
accessibilityRole: "tablist",
|
|
243
|
+
style: {
|
|
244
|
+
flexDirection: 'row',
|
|
245
|
+
gap: 4
|
|
246
|
+
},
|
|
247
|
+
testID: testID ? `${testID}-tabs` : undefined,
|
|
248
|
+
children: topTabs.map(entry => {
|
|
249
|
+
const selected = entry.key === tab;
|
|
250
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
251
|
+
...(0, _webHooks.dataHook)('bloomChatComposerRow'),
|
|
252
|
+
accessibilityRole: "tab",
|
|
253
|
+
accessibilityLabel: entry.label,
|
|
254
|
+
"aria-selected": selected,
|
|
255
|
+
accessibilityState: {
|
|
256
|
+
selected
|
|
257
|
+
},
|
|
258
|
+
onPress: () => setTab(entry.key),
|
|
259
|
+
style: {
|
|
260
|
+
flexGrow: 1,
|
|
261
|
+
alignItems: 'center',
|
|
262
|
+
justifyContent: 'center',
|
|
263
|
+
height: 30,
|
|
264
|
+
borderRadius: 9999,
|
|
265
|
+
backgroundColor: selected ? palette.accentSoft : 'transparent'
|
|
266
|
+
},
|
|
267
|
+
testID: testID ? `${testID}-tab-${entry.key}` : undefined,
|
|
268
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
|
|
269
|
+
variant: "body-2-medium",
|
|
270
|
+
style: {
|
|
271
|
+
color: selected ? palette.accentStrong : palette.textSecondary
|
|
272
|
+
},
|
|
273
|
+
children: entry.label
|
|
274
|
+
})
|
|
275
|
+
}, entry.key);
|
|
276
|
+
})
|
|
277
|
+
}) : null, activeCustom ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
278
|
+
style: {
|
|
279
|
+
height
|
|
280
|
+
},
|
|
281
|
+
children: activeCustom.content
|
|
282
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
283
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
284
|
+
style: {
|
|
285
|
+
flexDirection: 'row',
|
|
286
|
+
alignItems: 'center',
|
|
287
|
+
gap: 6
|
|
288
|
+
},
|
|
289
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
290
|
+
style: {
|
|
291
|
+
flexGrow: 1,
|
|
292
|
+
flexShrink: 1,
|
|
293
|
+
flexDirection: 'row',
|
|
294
|
+
alignItems: 'center',
|
|
295
|
+
gap: 6,
|
|
296
|
+
height: 32,
|
|
297
|
+
borderRadius: 10,
|
|
298
|
+
backgroundColor: palette.inset,
|
|
299
|
+
paddingLeft: 8,
|
|
300
|
+
paddingRight: 8
|
|
301
|
+
},
|
|
302
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_RiSearchLine.RiSearchLine, {
|
|
303
|
+
width: 16,
|
|
304
|
+
height: 16,
|
|
305
|
+
fill: palette.iconSecondary
|
|
306
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
307
|
+
...(0, _webHooks.dataHook)('bloomChatComposerInput'),
|
|
308
|
+
accessibilityLabel: labels.search,
|
|
309
|
+
placeholder: labels.search,
|
|
310
|
+
placeholderTextColor: palette.textPlaceholder,
|
|
311
|
+
value: search,
|
|
312
|
+
onChangeText: setSearch,
|
|
313
|
+
selectionColor: palette.accent,
|
|
314
|
+
style: {
|
|
315
|
+
flexGrow: 1,
|
|
316
|
+
flexShrink: 1,
|
|
317
|
+
padding: 0,
|
|
318
|
+
margin: 0,
|
|
319
|
+
..._scale.TYPE_SCALE['body-2-regular'],
|
|
320
|
+
color: palette.text,
|
|
321
|
+
backgroundColor: 'transparent'
|
|
322
|
+
},
|
|
323
|
+
testID: testID ? `${testID}-search` : undefined
|
|
324
|
+
})]
|
|
325
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Button, {
|
|
326
|
+
appearance: "plain",
|
|
327
|
+
tone: "neutral",
|
|
328
|
+
accessibilityLabel: labels.skinTone,
|
|
329
|
+
"aria-expanded": toneOpen,
|
|
330
|
+
onPress: () => setToneOpen(!toneOpen),
|
|
331
|
+
style: {
|
|
332
|
+
padding: 0,
|
|
333
|
+
minWidth: 0,
|
|
334
|
+
minHeight: 0,
|
|
335
|
+
flexShrink: 0,
|
|
336
|
+
width: 32,
|
|
337
|
+
height: 32,
|
|
338
|
+
alignItems: 'center',
|
|
339
|
+
justifyContent: 'center',
|
|
340
|
+
borderRadius: 9999,
|
|
341
|
+
backgroundColor: toneOpen ? palette.hover : palette.inset
|
|
342
|
+
},
|
|
343
|
+
testID: testID ? `${testID}-skin-tone` : undefined,
|
|
344
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
|
|
345
|
+
variant: "body-regular",
|
|
346
|
+
children: _shared.SKIN_TONE_SWATCHES[tone] ?? _shared.SKIN_TONE_SWATCHES[0]
|
|
347
|
+
})
|
|
348
|
+
})]
|
|
349
|
+
}), toneOpen ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
350
|
+
style: {
|
|
351
|
+
flexDirection: 'row',
|
|
352
|
+
gap: 2,
|
|
353
|
+
justifyContent: 'flex-end'
|
|
354
|
+
},
|
|
355
|
+
testID: testID ? `${testID}-skin-tones` : undefined,
|
|
356
|
+
children: _shared.SKIN_TONE_SWATCHES.map((swatch, index) => {
|
|
357
|
+
const selected = index === tone;
|
|
358
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Button, {
|
|
359
|
+
appearance: "plain",
|
|
360
|
+
tone: "neutral",
|
|
361
|
+
accessibilityLabel: `${labels.skinTone} ${index + 1}`,
|
|
362
|
+
pressed: selected,
|
|
363
|
+
onPress: () => {
|
|
364
|
+
setTone(index);
|
|
365
|
+
setToneOpen(false);
|
|
366
|
+
},
|
|
367
|
+
style: {
|
|
368
|
+
padding: 0,
|
|
369
|
+
minWidth: 0,
|
|
370
|
+
minHeight: 0,
|
|
371
|
+
flexShrink: 0,
|
|
372
|
+
width: 30,
|
|
373
|
+
height: 30,
|
|
374
|
+
alignItems: 'center',
|
|
375
|
+
justifyContent: 'center',
|
|
376
|
+
borderRadius: 9999,
|
|
377
|
+
backgroundColor: selected ? palette.accentSoft : 'transparent'
|
|
378
|
+
},
|
|
379
|
+
testID: testID ? `${testID}-skin-tone-${index}` : undefined,
|
|
380
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
|
|
381
|
+
variant: "body-regular",
|
|
382
|
+
children: swatch
|
|
383
|
+
})
|
|
384
|
+
}, index);
|
|
385
|
+
})
|
|
386
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
387
|
+
accessibilityRole: "tablist",
|
|
388
|
+
style: {
|
|
389
|
+
flexDirection: 'row',
|
|
390
|
+
justifyContent: 'space-between'
|
|
391
|
+
},
|
|
392
|
+
testID: testID ? `${testID}-categories` : undefined,
|
|
393
|
+
children: groups.map(group => {
|
|
394
|
+
const selected = group.key === category;
|
|
395
|
+
const Glyph = group.icon ?? _shared.EMOJI_CATEGORY_ICONS[group.key] ?? _RiEmotionLine.RiEmotionLine;
|
|
396
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
397
|
+
...(0, _webHooks.dataHook)('bloomChatComposerControl'),
|
|
398
|
+
accessibilityRole: "tab",
|
|
399
|
+
accessibilityLabel: group.label,
|
|
400
|
+
"aria-selected": selected,
|
|
401
|
+
accessibilityState: {
|
|
402
|
+
selected
|
|
403
|
+
},
|
|
404
|
+
onPress: () => jumpTo(group.key),
|
|
405
|
+
style: {
|
|
406
|
+
width: _shared.EMOJI_CATEGORY_SIZE,
|
|
407
|
+
height: _shared.EMOJI_CATEGORY_SIZE,
|
|
408
|
+
alignItems: 'center',
|
|
409
|
+
justifyContent: 'center',
|
|
410
|
+
borderRadius: 9999,
|
|
411
|
+
backgroundColor: selected ? palette.accentSoft : 'transparent'
|
|
412
|
+
},
|
|
413
|
+
testID: testID ? `${testID}-category-${group.key}` : undefined,
|
|
414
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Glyph, {
|
|
415
|
+
width: 18,
|
|
416
|
+
height: 18,
|
|
417
|
+
fill: selected ? palette.accentStrong : palette.iconSecondary
|
|
418
|
+
})
|
|
419
|
+
}, group.key);
|
|
420
|
+
})
|
|
421
|
+
}), rows.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
422
|
+
style: {
|
|
423
|
+
height,
|
|
424
|
+
alignItems: 'center',
|
|
425
|
+
justifyContent: 'center'
|
|
426
|
+
},
|
|
427
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
|
|
428
|
+
variant: "body-2-regular",
|
|
429
|
+
style: {
|
|
430
|
+
color: palette.textSecondary
|
|
431
|
+
},
|
|
432
|
+
children: labels.empty
|
|
433
|
+
})
|
|
434
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.FlatList, {
|
|
435
|
+
ref: listRef,
|
|
436
|
+
...(0, _webHooks.dataHook)('bloomChatComposerScroll'),
|
|
437
|
+
data: rows,
|
|
438
|
+
keyExtractor: row => row.key,
|
|
439
|
+
renderItem: renderRow,
|
|
440
|
+
getItemLayout: (_data, index) => ({
|
|
441
|
+
length: heights[index] ?? _shared.EMOJI_CELL,
|
|
442
|
+
offset: offsets[index] ?? 0,
|
|
443
|
+
index
|
|
444
|
+
}),
|
|
445
|
+
style: {
|
|
446
|
+
height
|
|
447
|
+
},
|
|
448
|
+
showsVerticalScrollIndicator: false,
|
|
449
|
+
testID: testID ? `${testID}-grid` : undefined
|
|
450
|
+
})]
|
|
451
|
+
})]
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
return EmojiPicker;
|
|
455
|
+
}
|
|
456
|
+
//# sourceMappingURL=create-emoji-picker.js.map
|