@botonic/react 0.36.0-alpha.0 → 0.36.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.
- package/lib/cjs/components/audio.d.ts +8 -7
- package/lib/cjs/components/audio.js +7 -4
- package/lib/cjs/components/audio.js.map +1 -1
- package/lib/cjs/components/{button.d.ts → button/index.d.ts} +4 -5
- package/lib/cjs/components/{button.js → button/index.js} +26 -57
- package/lib/cjs/components/button/index.js.map +1 -0
- package/lib/cjs/components/button/styles.d.ts +2 -0
- package/lib/cjs/components/button/styles.js +40 -0
- package/lib/cjs/components/button/styles.js.map +1 -0
- package/lib/cjs/components/buttons-disabler.d.ts +20 -23
- package/lib/cjs/components/buttons-disabler.js +11 -26
- package/lib/cjs/components/buttons-disabler.js.map +1 -1
- package/lib/cjs/components/carousel.d.ts +8 -9
- package/lib/cjs/components/carousel.js +28 -24
- package/lib/cjs/components/carousel.js.map +1 -1
- package/lib/cjs/components/custom-message.d.ts +16 -12
- package/lib/cjs/components/custom-message.js +3 -9
- package/lib/cjs/components/custom-message.js.map +1 -1
- package/lib/cjs/components/document.d.ts +8 -7
- package/lib/cjs/components/document.js +5 -5
- package/lib/cjs/components/document.js.map +1 -1
- package/lib/cjs/components/element.d.ts +7 -3
- package/lib/cjs/components/element.js +12 -12
- package/lib/cjs/components/element.js.map +1 -1
- package/lib/cjs/components/handoff.d.ts +1 -1
- package/lib/cjs/components/handoff.js +2 -2
- package/lib/cjs/components/handoff.js.map +1 -1
- package/lib/cjs/components/image.d.ts +8 -7
- package/lib/cjs/components/image.js +6 -6
- package/lib/cjs/components/image.js.map +1 -1
- package/lib/cjs/components/index-types.d.ts +31 -132
- package/lib/cjs/components/index.d.ts +8 -2
- package/lib/cjs/components/index.js +16 -3
- package/lib/cjs/components/index.js.map +1 -1
- package/lib/cjs/components/message/index.js +9 -8
- package/lib/cjs/components/message/index.js.map +1 -1
- package/lib/cjs/components/message/message-feedback.d.ts +1 -1
- package/lib/cjs/components/message/message-feedback.js +9 -20
- package/lib/cjs/components/message/message-feedback.js.map +1 -1
- package/lib/cjs/components/message/message-footer.d.ts +1 -1
- package/lib/cjs/components/message/message-footer.js +4 -4
- package/lib/cjs/components/message/message-footer.js.map +1 -1
- package/lib/cjs/components/message/message-image.js +3 -3
- package/lib/cjs/components/message/message-image.js.map +1 -1
- package/lib/cjs/components/message/styles.d.ts +11 -11
- package/lib/cjs/components/message/timestamps.d.ts +1 -1
- package/lib/cjs/components/message/timestamps.js +3 -3
- package/lib/cjs/components/message/timestamps.js.map +1 -1
- package/lib/cjs/components/multichannel/index-types.d.ts +0 -4
- package/lib/cjs/components/multichannel/multichannel-button.d.ts +1 -1
- package/lib/cjs/components/multichannel/multichannel-button.js +5 -5
- package/lib/cjs/components/multichannel/multichannel-button.js.map +1 -1
- package/lib/cjs/components/multichannel/multichannel-carousel.d.ts +1 -1
- package/lib/cjs/components/multichannel/multichannel-carousel.js +59 -62
- package/lib/cjs/components/multichannel/multichannel-carousel.js.map +1 -1
- package/lib/cjs/components/multichannel/multichannel-context.d.ts +0 -3
- package/lib/cjs/components/multichannel/multichannel-context.js +0 -3
- package/lib/cjs/components/multichannel/multichannel-context.js.map +1 -1
- package/lib/cjs/components/multichannel/multichannel-reply.d.ts +1 -1
- package/lib/cjs/components/multichannel/multichannel-text.d.ts +1 -1
- package/lib/cjs/components/multichannel/multichannel-text.js +19 -15
- package/lib/cjs/components/multichannel/multichannel-text.js.map +1 -1
- package/lib/cjs/components/multichannel/multichannel-utils.d.ts +9 -15
- package/lib/cjs/components/multichannel/multichannel-utils.js +48 -27
- package/lib/cjs/components/multichannel/multichannel-utils.js.map +1 -1
- package/lib/cjs/components/multichannel/multichannel.js +7 -7
- package/lib/cjs/components/multichannel/multichannel.js.map +1 -1
- package/lib/cjs/components/multichannel/whatsapp/constants.d.ts +11 -0
- package/lib/cjs/components/multichannel/whatsapp/constants.js +13 -0
- package/lib/cjs/components/multichannel/whatsapp/constants.js.map +1 -0
- package/lib/cjs/components/pic.d.ts +8 -5
- package/lib/cjs/components/pic.js +8 -8
- package/lib/cjs/components/pic.js.map +1 -1
- package/lib/cjs/components/raw.d.ts +1 -1
- package/lib/cjs/components/reply.d.ts +7 -6
- package/lib/cjs/components/reply.js +13 -7
- package/lib/cjs/components/reply.js.map +1 -1
- package/lib/cjs/components/subtitle.d.ts +9 -5
- package/lib/cjs/components/subtitle.js +6 -7
- package/lib/cjs/components/subtitle.js.map +1 -1
- package/lib/cjs/components/text.d.ts +1 -1
- package/lib/cjs/components/title.d.ts +9 -5
- package/lib/cjs/components/title.js +6 -7
- package/lib/cjs/components/title.js.map +1 -1
- package/lib/cjs/components/video.d.ts +8 -7
- package/lib/cjs/components/video.js +2 -3
- package/lib/cjs/components/video.js.map +1 -1
- package/lib/cjs/components/webchat-settings.d.ts +18 -2
- package/lib/cjs/components/webchat-settings.js +2 -2
- package/lib/cjs/components/webchat-settings.js.map +1 -1
- package/lib/cjs/components/whatsapp-button-list.js +6 -6
- package/lib/cjs/components/whatsapp-button-list.js.map +1 -1
- package/lib/cjs/components/whatsapp-catalog.d.ts +6 -0
- package/lib/cjs/components/whatsapp-catalog.js +25 -0
- package/lib/cjs/components/whatsapp-catalog.js.map +1 -0
- package/lib/cjs/components/whatsapp-cta-url-button.js +6 -6
- package/lib/cjs/components/whatsapp-cta-url-button.js.map +1 -1
- package/lib/cjs/components/whatsapp-media-carousel.d.ts +46 -0
- package/lib/cjs/components/whatsapp-media-carousel.js +40 -0
- package/lib/cjs/components/whatsapp-media-carousel.js.map +1 -0
- package/lib/cjs/components/whatsapp-product-carousel.d.ts +32 -0
- package/lib/cjs/components/whatsapp-product-carousel.js +34 -0
- package/lib/cjs/components/whatsapp-product-carousel.js.map +1 -0
- package/lib/cjs/components/whatsapp-product-list.d.ts +15 -0
- package/lib/cjs/components/whatsapp-product-list.js +26 -0
- package/lib/cjs/components/whatsapp-product-list.js.map +1 -0
- package/lib/cjs/components/whatsapp-product.d.ts +7 -0
- package/lib/cjs/components/whatsapp-product.js +25 -0
- package/lib/cjs/components/whatsapp-product.js.map +1 -0
- package/lib/cjs/constants.d.ts +0 -18
- package/lib/cjs/constants.js +1 -19
- package/lib/cjs/constants.js.map +1 -1
- package/lib/cjs/contexts.d.ts +10 -11
- package/lib/cjs/contexts.js +15 -78
- package/lib/cjs/contexts.js.map +1 -1
- package/lib/cjs/dev-app.d.ts +7 -0
- package/lib/cjs/dev-app.js +8 -13
- package/lib/cjs/dev-app.js.map +1 -1
- package/lib/cjs/index-types.d.ts +85 -77
- package/lib/cjs/index-types.js.map +1 -1
- package/lib/cjs/index.d.ts +1 -1
- package/lib/cjs/index.js +1 -2
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/msg-to-botonic.d.ts +1 -1
- package/lib/cjs/msg-to-botonic.js +9 -12
- package/lib/cjs/msg-to-botonic.js.map +1 -1
- package/lib/cjs/react-bot.d.ts +16 -6
- package/lib/cjs/react-bot.js +5 -6
- package/lib/cjs/react-bot.js.map +1 -1
- package/lib/cjs/shared/styles.d.ts +2 -2
- package/lib/cjs/time-zone-to-country-code.d.ts +1 -0
- package/lib/cjs/time-zone-to-country-code.js +108 -0
- package/lib/cjs/time-zone-to-country-code.js.map +1 -0
- package/lib/cjs/util/error-boundary.d.ts +1 -1
- package/lib/cjs/util/functional.d.ts +3 -0
- package/lib/cjs/util/functional.js +30 -0
- package/lib/cjs/util/functional.js.map +1 -0
- package/lib/cjs/util/react.d.ts +1 -1
- package/lib/cjs/util/webchat.d.ts +19 -6
- package/lib/cjs/util/webchat.js +44 -8
- package/lib/cjs/util/webchat.js.map +1 -1
- package/lib/cjs/webchat/chat-area/index.d.ts +1 -1
- package/lib/cjs/webchat/chat-area/index.js +3 -3
- package/lib/cjs/webchat/chat-area/index.js.map +1 -1
- package/lib/cjs/webchat/chat-area/styles.d.ts +1 -1
- package/lib/cjs/webchat/components/common.d.ts +1 -1
- package/lib/cjs/webchat/components/conditional-animation.d.ts +1 -1
- package/lib/cjs/webchat/components/conditional-animation.js +3 -3
- package/lib/cjs/webchat/components/conditional-animation.js.map +1 -1
- package/lib/cjs/webchat/components/opened-persistent-menu.d.ts +1 -1
- package/lib/cjs/webchat/components/opened-persistent-menu.js +6 -6
- package/lib/cjs/webchat/components/opened-persistent-menu.js.map +1 -1
- package/lib/{esm/webchat → cjs/webchat/context}/actions.d.ts +4 -1
- package/lib/cjs/webchat/{actions.js → context/actions.js} +4 -0
- package/lib/cjs/webchat/context/actions.js.map +1 -0
- package/lib/cjs/webchat/context/index.d.ts +5 -0
- package/lib/cjs/webchat/context/index.js +83 -0
- package/lib/cjs/webchat/context/index.js.map +1 -0
- package/lib/cjs/webchat/{messages-reducer.d.ts → context/messages-reducer.d.ts} +1 -1
- package/lib/cjs/webchat/{messages-reducer.js → context/messages-reducer.js} +3 -1
- package/lib/cjs/webchat/context/messages-reducer.js.map +1 -0
- package/lib/cjs/webchat/context/types.d.ts +83 -0
- package/lib/cjs/webchat/context/types.js +3 -0
- package/lib/cjs/webchat/context/types.js.map +1 -0
- package/lib/cjs/webchat/context/use-webchat.d.ts +46 -0
- package/lib/cjs/webchat/{hooks → context}/use-webchat.js +53 -47
- package/lib/cjs/webchat/context/use-webchat.js.map +1 -0
- package/lib/cjs/webchat/{webchat-reducer.d.ts → context/webchat-reducer.d.ts} +1 -1
- package/lib/cjs/webchat/{webchat-reducer.js → context/webchat-reducer.js} +4 -0
- package/lib/cjs/webchat/context/webchat-reducer.js.map +1 -0
- package/lib/cjs/webchat/cover-component/index.d.ts +6 -0
- package/lib/cjs/webchat/cover-component/index.js +21 -0
- package/lib/cjs/webchat/cover-component/index.js.map +1 -0
- package/lib/cjs/webchat/header/default-header.d.ts +1 -0
- package/lib/cjs/webchat/header/default-header.js +25 -0
- package/lib/cjs/webchat/header/default-header.js.map +1 -0
- package/lib/cjs/webchat/header/index.d.ts +2 -0
- package/lib/cjs/webchat/header/index.js +23 -0
- package/lib/cjs/webchat/header/index.js.map +1 -0
- package/lib/cjs/webchat/header/styles.d.ts +7 -0
- package/lib/cjs/webchat/header/styles.js +63 -0
- package/lib/cjs/webchat/header/styles.js.map +1 -0
- package/lib/cjs/webchat/hooks/index.d.ts +0 -1
- package/lib/cjs/webchat/hooks/index.js +1 -4
- package/lib/cjs/webchat/hooks/index.js.map +1 -1
- package/lib/cjs/webchat/hooks/use-previous.d.ts +1 -1
- package/lib/cjs/webchat/hooks/use-previous.js.map +1 -1
- package/lib/cjs/webchat/hooks/use-scroll-to-bottom.d.ts +6 -4
- package/lib/cjs/webchat/hooks/use-scroll-to-bottom.js.map +1 -1
- package/lib/cjs/webchat/hooks/use-scrollbar-controller.js +16 -16
- package/lib/cjs/webchat/hooks/use-scrollbar-controller.js.map +1 -1
- package/lib/cjs/webchat/hooks/use-typing.d.ts +1 -1
- package/lib/cjs/webchat/hooks/use-webchat-dimensions.js +4 -4
- package/lib/cjs/webchat/hooks/use-webchat-dimensions.js.map +1 -1
- package/lib/cjs/webchat/hooks/use-webchat-resizer.js +6 -6
- package/lib/cjs/webchat/hooks/use-webchat-resizer.js.map +1 -1
- package/lib/cjs/webchat/index-types.d.ts +2 -56
- package/lib/cjs/webchat/index.d.ts +1 -0
- package/lib/cjs/webchat/index.js +3 -1
- package/lib/cjs/webchat/index.js.map +1 -1
- package/lib/cjs/webchat/input-panel/attachment.d.ts +1 -2
- package/lib/cjs/webchat/input-panel/attachment.js +7 -6
- package/lib/cjs/webchat/input-panel/attachment.js.map +1 -1
- package/lib/cjs/webchat/input-panel/emoji-picker.d.ts +1 -2
- package/lib/cjs/webchat/input-panel/emoji-picker.js +7 -6
- package/lib/cjs/webchat/input-panel/emoji-picker.js.map +1 -1
- package/lib/cjs/webchat/input-panel/index.d.ts +2 -5
- package/lib/cjs/webchat/input-panel/index.js +10 -5
- package/lib/cjs/webchat/input-panel/index.js.map +1 -1
- package/lib/cjs/webchat/input-panel/opened-emoji-picker.d.ts +1 -1
- package/lib/cjs/webchat/input-panel/persistent-menu.d.ts +1 -2
- package/lib/cjs/webchat/input-panel/persistent-menu.js +6 -5
- package/lib/cjs/webchat/input-panel/persistent-menu.js.map +1 -1
- package/lib/cjs/webchat/input-panel/send-button.d.ts +1 -1
- package/lib/cjs/webchat/input-panel/send-button.js +5 -4
- package/lib/cjs/webchat/input-panel/send-button.js.map +1 -1
- package/lib/cjs/webchat/input-panel/styles.d.ts +3 -3
- package/lib/cjs/webchat/input-panel/textarea.d.ts +2 -4
- package/lib/cjs/webchat/input-panel/textarea.js +16 -6
- package/lib/cjs/webchat/input-panel/textarea.js.map +1 -1
- package/lib/cjs/webchat/message-list/index.d.ts +1 -1
- package/lib/cjs/webchat/message-list/index.js +64 -38
- package/lib/cjs/webchat/message-list/index.js.map +1 -1
- package/lib/cjs/webchat/message-list/intro-message.d.ts +1 -1
- package/lib/cjs/webchat/message-list/intro-message.js +3 -3
- package/lib/cjs/webchat/message-list/intro-message.js.map +1 -1
- package/lib/cjs/webchat/message-list/scroll-button.d.ts +1 -0
- package/lib/cjs/webchat/message-list/styles.d.ts +5 -5
- package/lib/cjs/webchat/message-list/styles.js +4 -3
- package/lib/cjs/webchat/message-list/styles.js.map +1 -1
- package/lib/cjs/webchat/message-list/unread-messages-banner.js +2 -2
- package/lib/cjs/webchat/message-list/unread-messages-banner.js.map +1 -1
- package/lib/cjs/webchat/message-list/use-notifications.js +6 -6
- package/lib/cjs/webchat/message-list/use-notifications.js.map +1 -1
- package/lib/cjs/webchat/replies/index.d.ts +1 -0
- package/lib/cjs/webchat/replies/index.js +32 -0
- package/lib/cjs/webchat/replies/index.js.map +1 -0
- package/lib/cjs/webchat/replies/styles.d.ts +8 -0
- package/lib/cjs/webchat/replies/styles.js +25 -0
- package/lib/cjs/webchat/replies/styles.js.map +1 -0
- package/lib/cjs/webchat/session-view.d.ts +1 -1
- package/lib/cjs/webchat/session-view.js +4 -4
- package/lib/cjs/webchat/session-view.js.map +1 -1
- package/lib/cjs/webchat/styles.d.ts +4 -0
- package/lib/cjs/webchat/styles.js +65 -0
- package/lib/cjs/webchat/styles.js.map +1 -0
- package/lib/cjs/webchat/theme/default-theme.d.ts +2 -0
- package/lib/cjs/webchat/theme/default-theme.js +104 -0
- package/lib/cjs/webchat/theme/default-theme.js.map +1 -0
- package/lib/cjs/webchat/theme/types.d.ts +214 -0
- package/lib/cjs/webchat/theme/types.js +3 -0
- package/lib/cjs/webchat/theme/types.js.map +1 -0
- package/lib/cjs/webchat/tracking.d.ts +10 -0
- package/lib/cjs/webchat/tracking.js +39 -1
- package/lib/cjs/webchat/tracking.js.map +1 -1
- package/lib/cjs/webchat/trigger-button/index.d.ts +1 -0
- package/lib/cjs/webchat/trigger-button/index.js +5 -5
- package/lib/cjs/webchat/trigger-button/index.js.map +1 -1
- package/lib/cjs/webchat/trigger-button/styles.d.ts +3 -3
- package/lib/cjs/webchat/typing-indicator/index.d.ts +3 -1
- package/lib/cjs/webchat/typing-indicator/index.js +4 -3
- package/lib/cjs/webchat/typing-indicator/index.js.map +1 -1
- package/lib/cjs/webchat/typing-indicator/styles.d.ts +4 -3
- package/lib/cjs/webchat/typing-indicator/styles.js +6 -3
- package/lib/cjs/webchat/typing-indicator/styles.js.map +1 -1
- package/lib/cjs/webchat/webchat-dev.d.ts +3 -3
- package/lib/cjs/webchat/webchat-dev.js +2 -2
- package/lib/cjs/webchat/webchat-dev.js.map +1 -1
- package/lib/cjs/webchat/webchat.d.ts +4 -2
- package/lib/cjs/webchat/webchat.js +110 -148
- package/lib/cjs/webchat/webchat.js.map +1 -1
- package/lib/cjs/webchat/webview/header.d.ts +1 -0
- package/lib/cjs/webchat/webview/header.js +16 -0
- package/lib/cjs/webchat/webview/header.js.map +1 -0
- package/lib/cjs/webchat/webview/index.d.ts +1 -0
- package/lib/cjs/webchat/webview/index.js +39 -0
- package/lib/cjs/webchat/webview/index.js.map +1 -0
- package/lib/cjs/webchat/webview/styles.d.ts +7 -0
- package/lib/cjs/webchat/webview/styles.js +60 -0
- package/lib/cjs/webchat/webview/styles.js.map +1 -0
- package/lib/cjs/webchat-app.d.ts +95 -86
- package/lib/cjs/webchat-app.js +164 -72
- package/lib/cjs/webchat-app.js.map +1 -1
- package/lib/cjs/webview-app.js +62 -14
- package/lib/cjs/webview-app.js.map +1 -1
- package/lib/esm/components/audio.d.ts +8 -7
- package/lib/esm/components/audio.js +7 -4
- package/lib/esm/components/audio.js.map +1 -1
- package/lib/esm/components/{button.d.ts → button/index.d.ts} +4 -5
- package/lib/esm/components/{button.js → button/index.js} +26 -56
- package/lib/esm/components/button/index.js.map +1 -0
- package/lib/esm/components/button/styles.d.ts +2 -0
- package/lib/esm/components/button/styles.js +36 -0
- package/lib/esm/components/button/styles.js.map +1 -0
- package/lib/esm/components/buttons-disabler.d.ts +20 -23
- package/lib/esm/components/buttons-disabler.js +11 -26
- package/lib/esm/components/buttons-disabler.js.map +1 -1
- package/lib/esm/components/carousel.d.ts +8 -9
- package/lib/esm/components/carousel.js +27 -23
- package/lib/esm/components/carousel.js.map +1 -1
- package/lib/esm/components/custom-message.d.ts +16 -12
- package/lib/esm/components/custom-message.js +3 -9
- package/lib/esm/components/custom-message.js.map +1 -1
- package/lib/esm/components/document.d.ts +8 -7
- package/lib/esm/components/document.js +4 -4
- package/lib/esm/components/document.js.map +1 -1
- package/lib/esm/components/element.d.ts +7 -3
- package/lib/esm/components/element.js +10 -10
- package/lib/esm/components/element.js.map +1 -1
- package/lib/esm/components/handoff.d.ts +1 -1
- package/lib/esm/components/handoff.js +1 -1
- package/lib/esm/components/handoff.js.map +1 -1
- package/lib/esm/components/image.d.ts +8 -7
- package/lib/esm/components/image.js +5 -5
- package/lib/esm/components/image.js.map +1 -1
- package/lib/esm/components/index-types.d.ts +31 -132
- package/lib/esm/components/index.d.ts +8 -2
- package/lib/esm/components/index.js +8 -2
- package/lib/esm/components/index.js.map +1 -1
- package/lib/esm/components/message/index.js +7 -6
- package/lib/esm/components/message/index.js.map +1 -1
- package/lib/esm/components/message/message-feedback.d.ts +1 -1
- package/lib/esm/components/message/message-feedback.js +10 -21
- package/lib/esm/components/message/message-feedback.js.map +1 -1
- package/lib/esm/components/message/message-footer.d.ts +1 -1
- package/lib/esm/components/message/message-footer.js +3 -3
- package/lib/esm/components/message/message-footer.js.map +1 -1
- package/lib/esm/components/message/message-image.js +2 -2
- package/lib/esm/components/message/message-image.js.map +1 -1
- package/lib/esm/components/message/styles.d.ts +11 -11
- package/lib/esm/components/message/timestamps.d.ts +1 -1
- package/lib/esm/components/message/timestamps.js +2 -2
- package/lib/esm/components/message/timestamps.js.map +1 -1
- package/lib/esm/components/multichannel/index-types.d.ts +0 -4
- package/lib/esm/components/multichannel/multichannel-button.d.ts +1 -1
- package/lib/esm/components/multichannel/multichannel-button.js +2 -2
- package/lib/esm/components/multichannel/multichannel-button.js.map +1 -1
- package/lib/esm/components/multichannel/multichannel-carousel.d.ts +1 -1
- package/lib/esm/components/multichannel/multichannel-carousel.js +62 -65
- package/lib/esm/components/multichannel/multichannel-carousel.js.map +1 -1
- package/lib/esm/components/multichannel/multichannel-context.d.ts +0 -3
- package/lib/esm/components/multichannel/multichannel-context.js +0 -3
- package/lib/esm/components/multichannel/multichannel-context.js.map +1 -1
- package/lib/esm/components/multichannel/multichannel-reply.d.ts +1 -1
- package/lib/esm/components/multichannel/multichannel-text.d.ts +1 -1
- package/lib/esm/components/multichannel/multichannel-text.js +9 -5
- package/lib/esm/components/multichannel/multichannel-text.js.map +1 -1
- package/lib/esm/components/multichannel/multichannel-utils.d.ts +9 -15
- package/lib/esm/components/multichannel/multichannel-utils.js +40 -24
- package/lib/esm/components/multichannel/multichannel-utils.js.map +1 -1
- package/lib/esm/components/multichannel/multichannel.js +7 -7
- package/lib/esm/components/multichannel/multichannel.js.map +1 -1
- package/lib/esm/components/multichannel/whatsapp/constants.d.ts +11 -0
- package/lib/esm/components/multichannel/whatsapp/constants.js +10 -0
- package/lib/esm/components/multichannel/whatsapp/constants.js.map +1 -0
- package/lib/esm/components/pic.d.ts +8 -5
- package/lib/esm/components/pic.js +6 -6
- package/lib/esm/components/pic.js.map +1 -1
- package/lib/esm/components/raw.d.ts +1 -1
- package/lib/esm/components/reply.d.ts +7 -6
- package/lib/esm/components/reply.js +13 -7
- package/lib/esm/components/reply.js.map +1 -1
- package/lib/esm/components/subtitle.d.ts +9 -5
- package/lib/esm/components/subtitle.js +4 -5
- package/lib/esm/components/subtitle.js.map +1 -1
- package/lib/esm/components/text.d.ts +1 -1
- package/lib/esm/components/title.d.ts +9 -5
- package/lib/esm/components/title.js +4 -5
- package/lib/esm/components/title.js.map +1 -1
- package/lib/esm/components/video.d.ts +8 -7
- package/lib/esm/components/video.js +2 -3
- package/lib/esm/components/video.js.map +1 -1
- package/lib/esm/components/webchat-settings.d.ts +18 -2
- package/lib/esm/components/webchat-settings.js +1 -1
- package/lib/esm/components/webchat-settings.js.map +1 -1
- package/lib/esm/components/whatsapp-button-list.js +6 -6
- package/lib/esm/components/whatsapp-button-list.js.map +1 -1
- package/lib/esm/components/whatsapp-catalog.d.ts +6 -0
- package/lib/esm/components/whatsapp-catalog.js +21 -0
- package/lib/esm/components/whatsapp-catalog.js.map +1 -0
- package/lib/esm/components/whatsapp-cta-url-button.js +3 -3
- package/lib/esm/components/whatsapp-cta-url-button.js.map +1 -1
- package/lib/esm/components/whatsapp-media-carousel.d.ts +46 -0
- package/lib/esm/components/whatsapp-media-carousel.js +36 -0
- package/lib/esm/components/whatsapp-media-carousel.js.map +1 -0
- package/lib/esm/components/whatsapp-product-carousel.d.ts +32 -0
- package/lib/esm/components/whatsapp-product-carousel.js +30 -0
- package/lib/esm/components/whatsapp-product-carousel.js.map +1 -0
- package/lib/esm/components/whatsapp-product-list.d.ts +15 -0
- package/lib/esm/components/whatsapp-product-list.js +22 -0
- package/lib/esm/components/whatsapp-product-list.js.map +1 -0
- package/lib/esm/components/whatsapp-product.d.ts +7 -0
- package/lib/esm/components/whatsapp-product.js +21 -0
- package/lib/esm/components/whatsapp-product.js.map +1 -0
- package/lib/esm/constants.d.ts +0 -18
- package/lib/esm/constants.js +0 -18
- package/lib/esm/constants.js.map +1 -1
- package/lib/esm/contexts.d.ts +10 -11
- package/lib/esm/contexts.js +14 -77
- package/lib/esm/contexts.js.map +1 -1
- package/lib/esm/dev-app.d.ts +7 -0
- package/lib/esm/dev-app.js +8 -13
- package/lib/esm/dev-app.js.map +1 -1
- package/lib/esm/index-types.d.ts +85 -77
- package/lib/esm/index-types.js.map +1 -1
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/msg-to-botonic.d.ts +1 -1
- package/lib/esm/msg-to-botonic.js +8 -11
- package/lib/esm/msg-to-botonic.js.map +1 -1
- package/lib/esm/react-bot.d.ts +16 -6
- package/lib/esm/react-bot.js +5 -6
- package/lib/esm/react-bot.js.map +1 -1
- package/lib/esm/shared/styles.d.ts +2 -2
- package/lib/esm/time-zone-to-country-code.d.ts +1 -0
- package/lib/esm/time-zone-to-country-code.js +105 -0
- package/lib/esm/time-zone-to-country-code.js.map +1 -0
- package/lib/esm/util/error-boundary.d.ts +1 -1
- package/lib/esm/util/functional.d.ts +3 -0
- package/lib/esm/util/functional.js +26 -0
- package/lib/esm/util/functional.js.map +1 -0
- package/lib/esm/util/react.d.ts +1 -1
- package/lib/esm/util/webchat.d.ts +19 -6
- package/lib/esm/util/webchat.js +42 -7
- package/lib/esm/util/webchat.js.map +1 -1
- package/lib/esm/webchat/chat-area/index.d.ts +1 -1
- package/lib/esm/webchat/chat-area/index.js +2 -2
- package/lib/esm/webchat/chat-area/index.js.map +1 -1
- package/lib/esm/webchat/chat-area/styles.d.ts +1 -1
- package/lib/esm/webchat/components/common.d.ts +1 -1
- package/lib/esm/webchat/components/conditional-animation.d.ts +1 -1
- package/lib/esm/webchat/components/conditional-animation.js +2 -2
- package/lib/esm/webchat/components/conditional-animation.js.map +1 -1
- package/lib/esm/webchat/components/opened-persistent-menu.d.ts +1 -1
- package/lib/esm/webchat/components/opened-persistent-menu.js +3 -3
- package/lib/esm/webchat/components/opened-persistent-menu.js.map +1 -1
- package/lib/{cjs/webchat → esm/webchat/context}/actions.d.ts +4 -1
- package/lib/esm/webchat/{actions.js → context/actions.js} +4 -0
- package/lib/esm/webchat/context/actions.js.map +1 -0
- package/lib/esm/webchat/context/index.d.ts +5 -0
- package/lib/esm/webchat/context/index.js +79 -0
- package/lib/esm/webchat/context/index.js.map +1 -0
- package/lib/esm/webchat/{messages-reducer.d.ts → context/messages-reducer.d.ts} +1 -1
- package/lib/esm/webchat/{messages-reducer.js → context/messages-reducer.js} +3 -1
- package/lib/esm/webchat/context/messages-reducer.js.map +1 -0
- package/lib/esm/webchat/context/types.d.ts +83 -0
- package/lib/esm/webchat/context/types.js +2 -0
- package/lib/esm/webchat/context/types.js.map +1 -0
- package/lib/esm/webchat/context/use-webchat.d.ts +46 -0
- package/lib/esm/webchat/{hooks → context}/use-webchat.js +51 -45
- package/lib/esm/webchat/context/use-webchat.js.map +1 -0
- package/lib/esm/webchat/{webchat-reducer.d.ts → context/webchat-reducer.d.ts} +1 -1
- package/lib/esm/webchat/{webchat-reducer.js → context/webchat-reducer.js} +4 -0
- package/lib/esm/webchat/context/webchat-reducer.js.map +1 -0
- package/lib/esm/webchat/cover-component/index.d.ts +6 -0
- package/lib/esm/webchat/cover-component/index.js +17 -0
- package/lib/esm/webchat/cover-component/index.js.map +1 -0
- package/lib/esm/webchat/header/default-header.d.ts +1 -0
- package/lib/esm/webchat/header/default-header.js +21 -0
- package/lib/esm/webchat/header/default-header.js.map +1 -0
- package/lib/esm/webchat/header/index.d.ts +2 -0
- package/lib/esm/webchat/header/index.js +20 -0
- package/lib/esm/webchat/header/index.js.map +1 -0
- package/lib/esm/webchat/header/styles.d.ts +7 -0
- package/lib/esm/webchat/header/styles.js +59 -0
- package/lib/esm/webchat/header/styles.js.map +1 -0
- package/lib/esm/webchat/hooks/index.d.ts +0 -1
- package/lib/esm/webchat/hooks/index.js +0 -1
- package/lib/esm/webchat/hooks/index.js.map +1 -1
- package/lib/esm/webchat/hooks/use-previous.d.ts +1 -1
- package/lib/esm/webchat/hooks/use-previous.js.map +1 -1
- package/lib/esm/webchat/hooks/use-scroll-to-bottom.d.ts +6 -4
- package/lib/esm/webchat/hooks/use-scroll-to-bottom.js.map +1 -1
- package/lib/esm/webchat/hooks/use-scrollbar-controller.js +16 -16
- package/lib/esm/webchat/hooks/use-scrollbar-controller.js.map +1 -1
- package/lib/esm/webchat/hooks/use-typing.d.ts +1 -1
- package/lib/esm/webchat/hooks/use-webchat-dimensions.js +4 -4
- package/lib/esm/webchat/hooks/use-webchat-dimensions.js.map +1 -1
- package/lib/esm/webchat/hooks/use-webchat-resizer.js +6 -6
- package/lib/esm/webchat/hooks/use-webchat-resizer.js.map +1 -1
- package/lib/esm/webchat/index-types.d.ts +2 -56
- package/lib/esm/webchat/index.d.ts +1 -0
- package/lib/esm/webchat/index.js +1 -0
- package/lib/esm/webchat/index.js.map +1 -1
- package/lib/esm/webchat/input-panel/attachment.d.ts +1 -2
- package/lib/esm/webchat/input-panel/attachment.js +8 -7
- package/lib/esm/webchat/input-panel/attachment.js.map +1 -1
- package/lib/esm/webchat/input-panel/emoji-picker.d.ts +1 -2
- package/lib/esm/webchat/input-panel/emoji-picker.js +8 -7
- package/lib/esm/webchat/input-panel/emoji-picker.js.map +1 -1
- package/lib/esm/webchat/input-panel/index.d.ts +2 -5
- package/lib/esm/webchat/input-panel/index.js +9 -4
- package/lib/esm/webchat/input-panel/index.js.map +1 -1
- package/lib/esm/webchat/input-panel/opened-emoji-picker.d.ts +1 -1
- package/lib/esm/webchat/input-panel/persistent-menu.d.ts +1 -2
- package/lib/esm/webchat/input-panel/persistent-menu.js +7 -6
- package/lib/esm/webchat/input-panel/persistent-menu.js.map +1 -1
- package/lib/esm/webchat/input-panel/send-button.d.ts +1 -1
- package/lib/esm/webchat/input-panel/send-button.js +6 -5
- package/lib/esm/webchat/input-panel/send-button.js.map +1 -1
- package/lib/esm/webchat/input-panel/styles.d.ts +3 -3
- package/lib/esm/webchat/input-panel/textarea.d.ts +2 -4
- package/lib/esm/webchat/input-panel/textarea.js +16 -6
- package/lib/esm/webchat/input-panel/textarea.js.map +1 -1
- package/lib/esm/webchat/message-list/index.d.ts +1 -1
- package/lib/esm/webchat/message-list/index.js +62 -37
- package/lib/esm/webchat/message-list/index.js.map +1 -1
- package/lib/esm/webchat/message-list/intro-message.d.ts +1 -1
- package/lib/esm/webchat/message-list/intro-message.js +2 -2
- package/lib/esm/webchat/message-list/intro-message.js.map +1 -1
- package/lib/esm/webchat/message-list/scroll-button.d.ts +1 -0
- package/lib/esm/webchat/message-list/styles.d.ts +5 -5
- package/lib/esm/webchat/message-list/styles.js +4 -3
- package/lib/esm/webchat/message-list/styles.js.map +1 -1
- package/lib/esm/webchat/message-list/unread-messages-banner.js +1 -1
- package/lib/esm/webchat/message-list/unread-messages-banner.js.map +1 -1
- package/lib/esm/webchat/message-list/use-notifications.js +5 -5
- package/lib/esm/webchat/message-list/use-notifications.js.map +1 -1
- package/lib/esm/webchat/replies/index.d.ts +1 -0
- package/lib/esm/webchat/replies/index.js +28 -0
- package/lib/esm/webchat/replies/index.js.map +1 -0
- package/lib/esm/webchat/replies/styles.d.ts +8 -0
- package/lib/esm/webchat/replies/styles.js +21 -0
- package/lib/esm/webchat/replies/styles.js.map +1 -0
- package/lib/esm/webchat/session-view.d.ts +1 -1
- package/lib/esm/webchat/session-view.js +2 -2
- package/lib/esm/webchat/session-view.js.map +1 -1
- package/lib/esm/webchat/styles.d.ts +4 -0
- package/lib/esm/webchat/styles.js +61 -0
- package/lib/esm/webchat/styles.js.map +1 -0
- package/lib/esm/webchat/theme/default-theme.d.ts +2 -0
- package/lib/esm/webchat/theme/default-theme.js +101 -0
- package/lib/esm/webchat/theme/default-theme.js.map +1 -0
- package/lib/esm/webchat/theme/types.d.ts +214 -0
- package/lib/esm/webchat/theme/types.js +2 -0
- package/lib/esm/webchat/theme/types.js.map +1 -0
- package/lib/esm/webchat/tracking.d.ts +10 -0
- package/lib/esm/webchat/tracking.js +37 -0
- package/lib/esm/webchat/tracking.js.map +1 -1
- package/lib/esm/webchat/trigger-button/index.d.ts +1 -0
- package/lib/esm/webchat/trigger-button/index.js +4 -4
- package/lib/esm/webchat/trigger-button/index.js.map +1 -1
- package/lib/esm/webchat/trigger-button/styles.d.ts +3 -3
- package/lib/esm/webchat/typing-indicator/index.d.ts +3 -1
- package/lib/esm/webchat/typing-indicator/index.js +5 -2
- package/lib/esm/webchat/typing-indicator/index.js.map +1 -1
- package/lib/esm/webchat/typing-indicator/styles.d.ts +4 -3
- package/lib/esm/webchat/typing-indicator/styles.js +5 -2
- package/lib/esm/webchat/typing-indicator/styles.js.map +1 -1
- package/lib/esm/webchat/webchat-dev.d.ts +3 -3
- package/lib/esm/webchat/webchat-dev.js +1 -1
- package/lib/esm/webchat/webchat-dev.js.map +1 -1
- package/lib/esm/webchat/webchat.d.ts +4 -2
- package/lib/esm/webchat/webchat.js +110 -148
- package/lib/esm/webchat/webchat.js.map +1 -1
- package/lib/esm/webchat/webview/header.d.ts +1 -0
- package/lib/esm/webchat/webview/header.js +12 -0
- package/lib/esm/webchat/webview/header.js.map +1 -0
- package/lib/esm/webchat/webview/index.d.ts +1 -0
- package/lib/esm/webchat/webview/index.js +35 -0
- package/lib/esm/webchat/webview/index.js.map +1 -0
- package/lib/esm/webchat/webview/styles.d.ts +7 -0
- package/lib/esm/webchat/webview/styles.js +56 -0
- package/lib/esm/webchat/webview/styles.js.map +1 -0
- package/lib/esm/webchat-app.d.ts +95 -86
- package/lib/esm/webchat-app.js +165 -73
- package/lib/esm/webchat-app.js.map +1 -1
- package/lib/esm/webview-app.js +64 -16
- package/lib/esm/webview-app.js.map +1 -1
- package/package.json +23 -18
- package/src/components/{audio.jsx → audio.tsx} +10 -4
- package/src/components/{button.tsx → button/index.tsx} +26 -104
- package/src/components/button/styles.ts +38 -0
- package/src/components/{buttons-disabler.js → buttons-disabler.ts} +35 -39
- package/src/components/{carousel.jsx → carousel.tsx} +60 -36
- package/src/components/{custom-message.jsx → custom-message.tsx} +19 -7
- package/src/components/{document.jsx → document.tsx} +5 -3
- package/src/components/{element.jsx → element.tsx} +12 -14
- package/src/components/handoff.jsx +1 -1
- package/src/components/{image.jsx → image.tsx} +13 -6
- package/src/components/index-types.ts +24 -119
- package/src/components/index.ts +23 -2
- package/src/components/message/index.jsx +7 -10
- package/src/components/message/message-feedback.tsx +10 -27
- package/src/components/message/message-footer.tsx +3 -3
- package/src/components/message/message-image.tsx +2 -5
- package/src/components/message/timestamps.tsx +2 -3
- package/src/components/multichannel/index-types.ts +0 -4
- package/src/components/multichannel/multichannel-button.jsx +2 -2
- package/src/components/multichannel/multichannel-carousel.jsx +96 -94
- package/src/components/multichannel/multichannel-context.jsx +0 -3
- package/src/components/multichannel/multichannel-text.jsx +12 -6
- package/src/components/multichannel/multichannel-utils.js +45 -27
- package/src/components/multichannel/multichannel.jsx +12 -7
- package/src/components/multichannel/whatsapp/constants.ts +10 -0
- package/src/components/{pic.jsx → pic.tsx} +12 -5
- package/src/components/{reply.jsx → reply.tsx} +12 -12
- package/src/components/{subtitle.jsx → subtitle.tsx} +10 -10
- package/src/components/{title.jsx → title.tsx} +8 -6
- package/src/components/{video.jsx → video.tsx} +3 -2
- package/src/components/webchat-settings.tsx +22 -2
- package/src/components/whatsapp-button-list.tsx +6 -6
- package/src/components/whatsapp-catalog.tsx +42 -0
- package/src/components/whatsapp-cta-url-button.tsx +6 -3
- package/src/components/whatsapp-media-carousel.tsx +104 -0
- package/src/components/whatsapp-product-carousel.tsx +83 -0
- package/src/components/whatsapp-product-list.tsx +56 -0
- package/src/components/whatsapp-product.tsx +44 -0
- package/src/constants.js +0 -19
- package/src/contexts.tsx +26 -91
- package/src/dev-app.jsx +6 -30
- package/src/index-types.ts +100 -84
- package/src/index.ts +1 -5
- package/src/msg-to-botonic.jsx +8 -12
- package/src/react-bot.tsx +51 -0
- package/src/time-zone-to-country-code.ts +104 -0
- package/src/util/functional.ts +31 -0
- package/src/util/webchat.ts +102 -0
- package/src/webchat/chat-area/index.tsx +2 -4
- package/src/webchat/components/conditional-animation.jsx +3 -3
- package/src/webchat/components/opened-persistent-menu.jsx +3 -4
- package/src/webchat/{actions.ts → context/actions.ts} +4 -0
- package/src/webchat/context/index.tsx +82 -0
- package/src/webchat/{messages-reducer.ts → context/messages-reducer.ts} +4 -2
- package/src/webchat/context/types.ts +91 -0
- package/src/webchat/{hooks → context}/use-webchat.ts +104 -53
- package/src/webchat/{webchat-reducer.ts → context/webchat-reducer.ts} +5 -1
- package/src/webchat/cover-component/index.tsx +31 -0
- package/src/webchat/global.d.ts +3 -0
- package/src/webchat/header/default-header.tsx +64 -0
- package/src/webchat/header/index.tsx +37 -0
- package/src/webchat/header/styles.ts +66 -0
- package/src/webchat/hooks/index.ts +0 -1
- package/src/webchat/hooks/use-previous.ts +1 -1
- package/src/webchat/hooks/use-scroll-to-bottom.ts +8 -2
- package/src/webchat/hooks/use-scrollbar-controller.ts +22 -17
- package/src/webchat/hooks/use-typing.ts +1 -1
- package/src/webchat/hooks/use-webchat-dimensions.ts +4 -4
- package/src/webchat/hooks/use-webchat-resizer.ts +6 -6
- package/src/webchat/index-types.ts +2 -63
- package/src/webchat/index.ts +1 -0
- package/src/webchat/input-panel/attachment.tsx +6 -17
- package/src/webchat/input-panel/emoji-picker.tsx +6 -16
- package/src/webchat/input-panel/index.tsx +9 -16
- package/src/webchat/input-panel/persistent-menu.tsx +6 -16
- package/src/webchat/input-panel/send-button.tsx +4 -10
- package/src/webchat/input-panel/textarea.tsx +22 -15
- package/src/webchat/message-list/index.tsx +78 -49
- package/src/webchat/message-list/intro-message.tsx +2 -3
- package/src/webchat/message-list/styles.ts +4 -3
- package/src/webchat/message-list/unread-messages-banner.tsx +1 -1
- package/src/webchat/message-list/use-notifications.ts +5 -9
- package/src/webchat/replies/index.tsx +47 -0
- package/src/webchat/replies/styles.ts +28 -0
- package/src/webchat/session-view.jsx +2 -2
- package/src/webchat/styles.ts +65 -0
- package/src/webchat/theme/default-theme.ts +102 -0
- package/src/webchat/theme/theme.d.ts +8 -0
- package/src/webchat/theme/types.ts +206 -0
- package/src/webchat/tracking.ts +59 -0
- package/src/webchat/trigger-button/index.tsx +4 -6
- package/src/webchat/typing-indicator/index.tsx +20 -12
- package/src/webchat/typing-indicator/styles.ts +7 -3
- package/src/webchat/webchat-dev.jsx +1 -1
- package/src/webchat/{webchat.jsx → webchat.tsx} +191 -243
- package/src/webchat/webview/header.tsx +22 -0
- package/src/webchat/webview/index.tsx +73 -0
- package/src/webchat/webview/styles.ts +62 -0
- package/src/webchat-app.tsx +575 -0
- package/src/webview-app.tsx +75 -20
- package/lib/cjs/components/button.js.map +0 -1
- package/lib/cjs/webchat/actions.js.map +0 -1
- package/lib/cjs/webchat/header.d.ts +0 -3
- package/lib/cjs/webchat/header.js +0 -86
- package/lib/cjs/webchat/header.js.map +0 -1
- package/lib/cjs/webchat/hooks/use-webchat.d.ts +0 -46
- package/lib/cjs/webchat/hooks/use-webchat.js.map +0 -1
- package/lib/cjs/webchat/messages-reducer.js.map +0 -1
- package/lib/cjs/webchat/replies.d.ts +0 -1
- package/lib/cjs/webchat/replies.js +0 -47
- package/lib/cjs/webchat/replies.js.map +0 -1
- package/lib/cjs/webchat/webchat-reducer.js.map +0 -1
- package/lib/cjs/webchat/webview.d.ts +0 -2
- package/lib/cjs/webchat/webview.js +0 -75
- package/lib/cjs/webchat/webview.js.map +0 -1
- package/lib/esm/components/button.js.map +0 -1
- package/lib/esm/webchat/actions.js.map +0 -1
- package/lib/esm/webchat/header.d.ts +0 -3
- package/lib/esm/webchat/header.js +0 -81
- package/lib/esm/webchat/header.js.map +0 -1
- package/lib/esm/webchat/hooks/use-webchat.d.ts +0 -46
- package/lib/esm/webchat/hooks/use-webchat.js.map +0 -1
- package/lib/esm/webchat/messages-reducer.js.map +0 -1
- package/lib/esm/webchat/replies.d.ts +0 -1
- package/lib/esm/webchat/replies.js +0 -42
- package/lib/esm/webchat/replies.js.map +0 -1
- package/lib/esm/webchat/webchat-reducer.js.map +0 -1
- package/lib/esm/webchat/webview.d.ts +0 -2
- package/lib/esm/webchat/webview.js +0 -70
- package/lib/esm/webchat/webview.js.map +0 -1
- package/src/react-bot.jsx +0 -38
- package/src/util/webchat.js +0 -57
- package/src/webchat/header.jsx +0 -149
- package/src/webchat/replies.jsx +0 -64
- package/src/webchat/webview.jsx +0 -105
- package/src/webchat-app.jsx +0 -389
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import React, { useContext, useEffect, useRef, useState } from 'react'
|
|
2
2
|
|
|
3
3
|
import { ROLES } from '../../constants'
|
|
4
|
-
import { WebchatContext } from '../../
|
|
4
|
+
import { WebchatContext } from '../../webchat/context'
|
|
5
5
|
import { BotonicContainerId } from '../constants'
|
|
6
|
-
import
|
|
6
|
+
import TypingIndicator from '../typing-indicator'
|
|
7
7
|
import { IntroMessage } from './intro-message'
|
|
8
8
|
import { ScrollButton } from './scroll-button'
|
|
9
9
|
import { ContainerMessage, ScrollableMessageList } from './styles'
|
|
10
10
|
import { UnreadMessagesBanner } from './unread-messages-banner'
|
|
11
11
|
import { useNotifications } from './use-notifications'
|
|
12
12
|
|
|
13
|
+
const SCROLL_TIMEOUT = 200
|
|
14
|
+
const scrollOptionsEnd: ScrollIntoViewOptions = {
|
|
15
|
+
block: 'end',
|
|
16
|
+
}
|
|
17
|
+
const scrollOptionsCenter: ScrollIntoViewOptions = {
|
|
18
|
+
block: 'center',
|
|
19
|
+
}
|
|
20
|
+
|
|
13
21
|
export const WebchatMessageList = () => {
|
|
14
22
|
const {
|
|
15
23
|
webchatState,
|
|
@@ -18,39 +26,50 @@ export const WebchatMessageList = () => {
|
|
|
18
26
|
scrollableMessagesListRef,
|
|
19
27
|
} = useContext(WebchatContext)
|
|
20
28
|
|
|
21
|
-
const
|
|
29
|
+
const { notificationsEnabled } = useNotifications()
|
|
22
30
|
|
|
23
|
-
const
|
|
31
|
+
const [firstUnreadMessageId, setFirstUnreadMessageId] = useState<string>()
|
|
24
32
|
|
|
25
|
-
const
|
|
33
|
+
const lastMessageRef = useRef<HTMLDivElement>(null)
|
|
34
|
+
const typingRef = useRef<HTMLDivElement>(null)
|
|
35
|
+
const unreadMessagesBannerRef = useRef<HTMLDivElement>(null)
|
|
36
|
+
|
|
37
|
+
const scrollToTyping = () => {
|
|
26
38
|
setTimeout(() => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
block: 'end',
|
|
30
|
-
})
|
|
31
|
-
}, 100)
|
|
39
|
+
typingRef.current?.scrollIntoView(scrollOptionsEnd)
|
|
40
|
+
}, SCROLL_TIMEOUT)
|
|
32
41
|
}
|
|
33
42
|
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
const scrollToLastMessage = () => {
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
lastMessageRef.current?.scrollIntoView(scrollOptionsEnd)
|
|
46
|
+
}, SCROLL_TIMEOUT)
|
|
37
47
|
}
|
|
38
48
|
|
|
39
|
-
const unreadMessagesBannerRef = useRef<HTMLDivElement>(null)
|
|
40
|
-
|
|
41
49
|
const scrollToBanner = () => {
|
|
42
50
|
setTimeout(() => {
|
|
43
|
-
unreadMessagesBannerRef.current?.scrollIntoView(
|
|
44
|
-
|
|
45
|
-
block: 'center',
|
|
46
|
-
})
|
|
47
|
-
}, 100)
|
|
51
|
+
unreadMessagesBannerRef.current?.scrollIntoView(scrollOptionsCenter)
|
|
52
|
+
}, SCROLL_TIMEOUT)
|
|
48
53
|
}
|
|
49
54
|
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
const handleScrollToBottom = () => {
|
|
56
|
+
resetUnreadMessages()
|
|
57
|
+
if (webchatState.typing) {
|
|
58
|
+
scrollToTyping()
|
|
59
|
+
return
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
scrollToLastMessage()
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const showUnreadMessagesBanner = (messageComponentId: string) => {
|
|
66
|
+
return (
|
|
67
|
+
!webchatState.isInputFocused &&
|
|
68
|
+
firstUnreadMessageId &&
|
|
69
|
+
messageComponentId === firstUnreadMessageId &&
|
|
70
|
+
webchatState.numUnreadMessages > 0
|
|
71
|
+
)
|
|
72
|
+
}
|
|
54
73
|
|
|
55
74
|
useEffect(() => {
|
|
56
75
|
const firstUnreadMessage = webchatState.messagesComponents.find(
|
|
@@ -60,39 +79,47 @@ export const WebchatMessageList = () => {
|
|
|
60
79
|
}, [webchatState.messagesComponents])
|
|
61
80
|
|
|
62
81
|
useEffect(() => {
|
|
63
|
-
if (
|
|
64
|
-
webchatState.messagesComponents.length > 0 &&
|
|
65
|
-
lastMessageBottomRef.current
|
|
66
|
-
) {
|
|
82
|
+
if (webchatState.messagesComponents.length > 0 && lastMessageRef.current) {
|
|
67
83
|
const observer = new IntersectionObserver(entries => {
|
|
68
84
|
entries.forEach(entry => {
|
|
69
85
|
setLastMessageVisible(entry.isIntersecting)
|
|
70
86
|
})
|
|
71
87
|
})
|
|
72
|
-
observer.observe(
|
|
88
|
+
observer.observe(lastMessageRef.current)
|
|
73
89
|
}
|
|
74
90
|
}, [webchatState.messagesComponents])
|
|
75
91
|
|
|
76
|
-
const { notificationsEnabled } = useNotifications()
|
|
77
|
-
|
|
78
92
|
useEffect(() => {
|
|
79
93
|
if (!notificationsEnabled) {
|
|
80
|
-
|
|
81
|
-
|
|
94
|
+
if (webchatState.typing) {
|
|
95
|
+
scrollToTyping()
|
|
96
|
+
return
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
scrollToLastMessage()
|
|
82
100
|
}
|
|
83
|
-
}, [webchatState.typing])
|
|
101
|
+
}, [webchatState.typing, webchatState.messagesComponents])
|
|
84
102
|
|
|
85
103
|
useEffect(() => {
|
|
86
|
-
if (notificationsEnabled) {
|
|
87
|
-
if (
|
|
104
|
+
if (webchatState.isWebchatOpen && notificationsEnabled) {
|
|
105
|
+
if (unreadMessagesBannerRef.current) {
|
|
88
106
|
scrollToBanner()
|
|
89
107
|
return
|
|
90
108
|
}
|
|
91
109
|
|
|
92
|
-
|
|
93
|
-
|
|
110
|
+
if (webchatState.typing) {
|
|
111
|
+
scrollToTyping()
|
|
112
|
+
return
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
scrollToLastMessage()
|
|
94
116
|
}
|
|
95
|
-
}, [
|
|
117
|
+
}, [
|
|
118
|
+
firstUnreadMessageId,
|
|
119
|
+
webchatState.isWebchatOpen,
|
|
120
|
+
webchatState.typing,
|
|
121
|
+
webchatState.messagesComponents,
|
|
122
|
+
])
|
|
96
123
|
|
|
97
124
|
const showScrollButton =
|
|
98
125
|
webchatState.numUnreadMessages > 0 && !webchatState.isLastMessageVisible
|
|
@@ -107,25 +134,27 @@ export const WebchatMessageList = () => {
|
|
|
107
134
|
<IntroMessage />
|
|
108
135
|
{webchatState.messagesComponents.map((messageComponent, index) => {
|
|
109
136
|
return (
|
|
110
|
-
<
|
|
111
|
-
{
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
137
|
+
<React.Fragment key={messageComponent.props.id}>
|
|
138
|
+
<ContainerMessage role={ROLES.MESSAGE}>
|
|
139
|
+
{showUnreadMessagesBanner(messageComponent.props.id) && (
|
|
140
|
+
<UnreadMessagesBanner
|
|
141
|
+
unreadMessagesBannerRef={unreadMessagesBannerRef}
|
|
142
|
+
/>
|
|
143
|
+
)}
|
|
144
|
+
{messageComponent}
|
|
145
|
+
</ContainerMessage>
|
|
117
146
|
{index === webchatState.messagesComponents.length - 1 && (
|
|
118
147
|
<div
|
|
119
|
-
ref={
|
|
148
|
+
ref={lastMessageRef}
|
|
120
149
|
style={{
|
|
121
150
|
content: '',
|
|
122
151
|
}}
|
|
123
152
|
></div>
|
|
124
153
|
)}
|
|
125
|
-
</
|
|
154
|
+
</React.Fragment>
|
|
126
155
|
)
|
|
127
156
|
})}
|
|
128
|
-
{webchatState.typing && <TypingIndicator />}
|
|
157
|
+
{webchatState.typing && <TypingIndicator ref={typingRef} />}
|
|
129
158
|
</ScrollableMessageList>
|
|
130
159
|
{showScrollButton && <ScrollButton handleClick={handleScrollToBottom} />}
|
|
131
160
|
</>
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import React, { useContext } from 'react'
|
|
2
2
|
|
|
3
3
|
import { WEBCHAT } from '../../constants'
|
|
4
|
-
import { WebchatContext } from '../../contexts'
|
|
5
4
|
import { Fade } from '../../shared/styles'
|
|
6
5
|
import { resolveImage } from '../../util/environment'
|
|
7
6
|
import { ConditionalWrapper } from '../../util/react'
|
|
7
|
+
import { WebchatContext } from '../../webchat/context'
|
|
8
8
|
import { DefaultIntroImage } from './styles'
|
|
9
9
|
|
|
10
10
|
export const IntroMessage = () => {
|
|
11
11
|
const { getThemeProperty } = useContext(WebchatContext)
|
|
12
12
|
|
|
13
13
|
const animationsEnabled = getThemeProperty(
|
|
14
|
-
WEBCHAT.CUSTOM_PROPERTIES.enableAnimations
|
|
15
|
-
true
|
|
14
|
+
WEBCHAT.CUSTOM_PROPERTIES.enableAnimations
|
|
16
15
|
)
|
|
17
16
|
const CustomIntro = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.customIntro)
|
|
18
17
|
const introImage = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.introImage)
|
|
@@ -15,9 +15,9 @@ export const DefaultIntroImage = styled.img`
|
|
|
15
15
|
`
|
|
16
16
|
|
|
17
17
|
export const ContainerScrollButton = styled.div`
|
|
18
|
-
position:
|
|
19
|
-
|
|
20
|
-
bottom:
|
|
18
|
+
position: sticky;
|
|
19
|
+
left: 85%;
|
|
20
|
+
bottom: 15px;
|
|
21
21
|
|
|
22
22
|
background-color: #6d6a78;
|
|
23
23
|
cursor: pointer;
|
|
@@ -55,5 +55,6 @@ export const ScrollableMessageList = styled.div`
|
|
|
55
55
|
overflow-y: auto;
|
|
56
56
|
overflow-x: hidden;
|
|
57
57
|
overscroll-behavior: contain; // https://css-tricks.com/almanac/properties/o/overscroll-behavior/
|
|
58
|
+
scroll-behavior: smooth;
|
|
58
59
|
-webkit-overflow-scrolling: touch;
|
|
59
60
|
`
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useContext } from 'react'
|
|
2
2
|
|
|
3
3
|
import ArrowDown from '../../assets/arrow-down.svg'
|
|
4
|
-
import { WebchatContext } from '../../contexts'
|
|
5
4
|
import { resolveImage } from '../../util/environment'
|
|
5
|
+
import { WebchatContext } from '../../webchat/context'
|
|
6
6
|
import { ContainerUnreadMessagesBanner } from './styles'
|
|
7
7
|
import { useNotifications } from './use-notifications'
|
|
8
8
|
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { useContext } from 'react'
|
|
2
2
|
|
|
3
3
|
import { WEBCHAT } from '../../constants'
|
|
4
|
-
import { WebchatContext } from '../../
|
|
4
|
+
import { WebchatContext } from '../../webchat/context'
|
|
5
5
|
|
|
6
6
|
export function useNotifications() {
|
|
7
7
|
const { getThemeProperty } = useContext(WebchatContext)
|
|
8
8
|
|
|
9
9
|
const CustomUnreadMessagesBanner = getThemeProperty(
|
|
10
|
-
WEBCHAT.CUSTOM_PROPERTIES.notificationsBannerCustom
|
|
11
|
-
undefined
|
|
10
|
+
WEBCHAT.CUSTOM_PROPERTIES.notificationsBannerCustom
|
|
12
11
|
)
|
|
13
12
|
|
|
14
13
|
const notificationsBannerEnabled = getThemeProperty(
|
|
15
|
-
WEBCHAT.CUSTOM_PROPERTIES.notificationsBannerEnabled
|
|
16
|
-
undefined
|
|
14
|
+
WEBCHAT.CUSTOM_PROPERTIES.notificationsBannerEnabled
|
|
17
15
|
)
|
|
18
16
|
|
|
19
17
|
const notificationsEnabled = getThemeProperty(
|
|
@@ -22,13 +20,11 @@ export function useNotifications() {
|
|
|
22
20
|
)
|
|
23
21
|
|
|
24
22
|
const bannerText = getThemeProperty(
|
|
25
|
-
WEBCHAT.CUSTOM_PROPERTIES.notificationsBannerText
|
|
26
|
-
'unread messages'
|
|
23
|
+
WEBCHAT.CUSTOM_PROPERTIES.notificationsBannerText
|
|
27
24
|
)
|
|
28
25
|
|
|
29
26
|
const CustomScrollButton = getThemeProperty(
|
|
30
|
-
WEBCHAT.CUSTOM_PROPERTIES.scrollButtonCustom
|
|
31
|
-
undefined
|
|
27
|
+
WEBCHAT.CUSTOM_PROPERTIES.scrollButtonCustom
|
|
32
28
|
)
|
|
33
29
|
|
|
34
30
|
const scrollButtonEnabled = getThemeProperty(
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React, { useContext } from 'react'
|
|
2
|
+
|
|
3
|
+
import { WEBCHAT } from '../../constants'
|
|
4
|
+
import { WebchatContext } from '../../webchat/context'
|
|
5
|
+
import { BotonicContainerId } from '../constants'
|
|
6
|
+
import { RepliesContainer, ReplyContainer, ScrollableReplies } from './styles'
|
|
7
|
+
|
|
8
|
+
const options = {
|
|
9
|
+
left: 'flex-start',
|
|
10
|
+
center: 'center',
|
|
11
|
+
right: 'flex-end',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const WebchatReplies = () => {
|
|
15
|
+
const { webchatState, getThemeProperty, repliesRef } =
|
|
16
|
+
useContext(WebchatContext)
|
|
17
|
+
|
|
18
|
+
let justifyContent = 'center'
|
|
19
|
+
const flexWrap = getThemeProperty(
|
|
20
|
+
WEBCHAT.CUSTOM_PROPERTIES.wrapReplies,
|
|
21
|
+
'wrap'
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
if (flexWrap === 'nowrap') {
|
|
25
|
+
justifyContent = 'flex-start'
|
|
26
|
+
} else if (getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.alignReplies)) {
|
|
27
|
+
justifyContent =
|
|
28
|
+
options[getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.alignReplies)]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<ScrollableReplies>
|
|
33
|
+
<RepliesContainer
|
|
34
|
+
id={BotonicContainerId.RepliesContainer}
|
|
35
|
+
ref={repliesRef}
|
|
36
|
+
className='replies-container'
|
|
37
|
+
justify={justifyContent}
|
|
38
|
+
wrap={flexWrap}
|
|
39
|
+
>
|
|
40
|
+
{webchatState.replies?.map((reply, i) => (
|
|
41
|
+
// @ts-ignore TODO: In this point reply is the the component to render
|
|
42
|
+
<ReplyContainer key={`reply-${i}`}>{reply}</ReplyContainer>
|
|
43
|
+
))}
|
|
44
|
+
</RepliesContainer>
|
|
45
|
+
</ScrollableReplies>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import styled from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const ScrollableReplies = styled.div`
|
|
4
|
+
overscroll-behavior: contain;
|
|
5
|
+
-webkit-overflow-scrolling: touch;
|
|
6
|
+
`
|
|
7
|
+
|
|
8
|
+
interface RepliesContainerProps {
|
|
9
|
+
justify: string
|
|
10
|
+
wrap: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const RepliesContainer = styled.div<RepliesContainerProps>`
|
|
14
|
+
display: flex;
|
|
15
|
+
text-align: center;
|
|
16
|
+
justify-content: ${props => props.justify};
|
|
17
|
+
flex-wrap: ${props => props.wrap};
|
|
18
|
+
padding-bottom: 10px;
|
|
19
|
+
margin-left: 5px;
|
|
20
|
+
margin-right: 5px;
|
|
21
|
+
overflow-x: auto;
|
|
22
|
+
`
|
|
23
|
+
|
|
24
|
+
export const ReplyContainer = styled.div`
|
|
25
|
+
flex: none;
|
|
26
|
+
display: inline-block;
|
|
27
|
+
margin: 3px;
|
|
28
|
+
`
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import JSONTree from 'react-json-tree'
|
|
2
|
+
import { JSONTree } from 'react-json-tree'
|
|
3
3
|
import styled from 'styled-components'
|
|
4
4
|
|
|
5
5
|
import { COLORS } from '../constants'
|
|
6
|
-
import { useWebchat } from './
|
|
6
|
+
import { useWebchat } from './context/use-webchat'
|
|
7
7
|
|
|
8
8
|
const AttributeContainer = styled.div`
|
|
9
9
|
display: flex;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import styled from 'styled-components'
|
|
2
|
+
|
|
3
|
+
import { COLORS } from '../constants'
|
|
4
|
+
|
|
5
|
+
export const StyledWebchat = styled.div`
|
|
6
|
+
position: fixed;
|
|
7
|
+
right: ${props => props.theme.style.right};
|
|
8
|
+
bottom: ${props => props.theme.style.bottom};
|
|
9
|
+
width: ${props => props.theme.style.width};
|
|
10
|
+
height: ${props => props.theme.style.height};
|
|
11
|
+
margin: auto;
|
|
12
|
+
background-color: ${props => props.theme.style.backgroundColor};
|
|
13
|
+
border-radius: 10px;
|
|
14
|
+
box-shadow: ${props => props.theme.style.boxShadow};
|
|
15
|
+
font-family: ${props => props.theme.style.fontFamily};
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
justify-content: space-between;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
|
|
21
|
+
@media (max-width: ${props => props.theme.mobileBreakpoint}px) {
|
|
22
|
+
position: ${props => props.theme.mobileStyle.position};
|
|
23
|
+
right: ${props => props.theme.mobileStyle.right};
|
|
24
|
+
bottom: ${props => props.theme.mobileStyle.bottom};
|
|
25
|
+
width: ${props => props.theme.mobileStyle.width};
|
|
26
|
+
height: ${props => props.theme.mobileStyle.height};
|
|
27
|
+
border-radius: ${props => props.theme.mobileStyle.borderRadius};
|
|
28
|
+
font-size: ${props => props.theme.mobileStyle.fontSize};
|
|
29
|
+
}
|
|
30
|
+
`
|
|
31
|
+
|
|
32
|
+
export const ErrorMessageContainer = styled.div`
|
|
33
|
+
position: relative;
|
|
34
|
+
display: flex;
|
|
35
|
+
z-index: 1;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
width: 100%;
|
|
38
|
+
`
|
|
39
|
+
|
|
40
|
+
export const ErrorMessage = styled.div`
|
|
41
|
+
position: absolute;
|
|
42
|
+
top: 10px;
|
|
43
|
+
font-size: 14px;
|
|
44
|
+
line-height: 20px;
|
|
45
|
+
padding: 4px 11px;
|
|
46
|
+
display: flex;
|
|
47
|
+
background-color: ${COLORS.ERROR_RED};
|
|
48
|
+
color: ${COLORS.CONCRETE_WHITE};
|
|
49
|
+
border-radius: 5px;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
font-family: ${props => props.theme.style.fontFamily};
|
|
53
|
+
`
|
|
54
|
+
|
|
55
|
+
export const DarkBackgroundMenu = styled.div`
|
|
56
|
+
background: ${COLORS.SOLID_BLACK};
|
|
57
|
+
opacity: 0.3;
|
|
58
|
+
z-index: 1;
|
|
59
|
+
right: 0;
|
|
60
|
+
bottom: 0;
|
|
61
|
+
border-radius: 10px;
|
|
62
|
+
position: absolute;
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: 100%;
|
|
65
|
+
`
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { COLORS, WEBCHAT } from '../../constants'
|
|
2
|
+
import { WebchatTheme } from './types'
|
|
3
|
+
|
|
4
|
+
export const defaultTheme: WebchatTheme = {
|
|
5
|
+
style: {
|
|
6
|
+
width: '300px',
|
|
7
|
+
height: '450px',
|
|
8
|
+
borderRadius: '10px',
|
|
9
|
+
fontFamily: "'Noto Sans JP', sans-serif",
|
|
10
|
+
fontSize: '16px',
|
|
11
|
+
position: 'fixed',
|
|
12
|
+
right: '20px',
|
|
13
|
+
bottom: '20px',
|
|
14
|
+
backgroundColor: COLORS.SOLID_WHITE,
|
|
15
|
+
boxShadow: `${COLORS.SOLID_BLACK_ALPHA_0_2} 0px 0px 12px`,
|
|
16
|
+
},
|
|
17
|
+
mobileBreakpoint: 768,
|
|
18
|
+
mobileStyle: {
|
|
19
|
+
width: '100%',
|
|
20
|
+
height: '100%',
|
|
21
|
+
borderRadius: '0px',
|
|
22
|
+
fontSize: '16px',
|
|
23
|
+
position: 'absolute',
|
|
24
|
+
right: '0px',
|
|
25
|
+
bottom: '0px',
|
|
26
|
+
},
|
|
27
|
+
header: {
|
|
28
|
+
title: 'Botonic',
|
|
29
|
+
subtitle: '',
|
|
30
|
+
image: WEBCHAT.DEFAULTS.LOGO,
|
|
31
|
+
style: {
|
|
32
|
+
borderRadius: '10px 10px 0px 0px',
|
|
33
|
+
},
|
|
34
|
+
mobileStyle: {
|
|
35
|
+
borderRadius: '0px',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
brand: {
|
|
39
|
+
color: COLORS.BOTONIC_BLUE,
|
|
40
|
+
image: WEBCHAT.DEFAULTS.LOGO,
|
|
41
|
+
},
|
|
42
|
+
button: {
|
|
43
|
+
autodisable: false,
|
|
44
|
+
disabledstyle: {
|
|
45
|
+
opacity: 0.5,
|
|
46
|
+
cursor: 'auto',
|
|
47
|
+
pointerEvents: 'none',
|
|
48
|
+
},
|
|
49
|
+
messageType: 'text',
|
|
50
|
+
hoverBackground: COLORS.CONCRETE_WHITE,
|
|
51
|
+
hoverTextColor: COLORS.SOLID_BLACK,
|
|
52
|
+
style: {
|
|
53
|
+
width: '100%',
|
|
54
|
+
maxHeight: '80px',
|
|
55
|
+
height: 'auto',
|
|
56
|
+
fontFamily: 'inherit',
|
|
57
|
+
fontSize: '14px',
|
|
58
|
+
fontWeight: 'normal',
|
|
59
|
+
background: COLORS.SOLID_WHITE,
|
|
60
|
+
color: COLORS.SOLID_BLACK,
|
|
61
|
+
outline: '0',
|
|
62
|
+
border: ` 1px solid ${COLORS.SEASHELL_WHITE}`,
|
|
63
|
+
borderRadius: '0px',
|
|
64
|
+
padding: '12px 32px',
|
|
65
|
+
overflow: 'hidden',
|
|
66
|
+
},
|
|
67
|
+
urlIcon: {
|
|
68
|
+
enable: false,
|
|
69
|
+
image: WEBCHAT.DEFAULTS.URL_ICON,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
message: {
|
|
73
|
+
user: {
|
|
74
|
+
blobTick: true,
|
|
75
|
+
},
|
|
76
|
+
bot: {
|
|
77
|
+
blobTick: true,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
triggerButton: { image: WEBCHAT.DEFAULTS.LOGO },
|
|
81
|
+
userInput: {
|
|
82
|
+
attachments: { enable: false },
|
|
83
|
+
box: {
|
|
84
|
+
placeholder: 'Ask me something...',
|
|
85
|
+
},
|
|
86
|
+
emojiPicker: { enable: false },
|
|
87
|
+
sendButton: { enable: true },
|
|
88
|
+
enable: true,
|
|
89
|
+
},
|
|
90
|
+
carousel: {
|
|
91
|
+
enableArrows: true,
|
|
92
|
+
},
|
|
93
|
+
animations: { enable: true },
|
|
94
|
+
notifications: {
|
|
95
|
+
enable: false,
|
|
96
|
+
banner: {
|
|
97
|
+
enable: false,
|
|
98
|
+
text: 'unread messages',
|
|
99
|
+
},
|
|
100
|
+
triggerButton: { enable: false },
|
|
101
|
+
},
|
|
102
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import 'styled-components'
|
|
2
|
+
|
|
3
|
+
import { WebchatTheme } from './types'
|
|
4
|
+
|
|
5
|
+
// With this declaration, we can use the theme prop in styled components with TypeScript defined in WebchatTheme
|
|
6
|
+
declare module 'styled-components' {
|
|
7
|
+
export interface DefaultTheme extends WebchatTheme {}
|
|
8
|
+
}
|