@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
|
@@ -3,8 +3,9 @@ import React, { useContext } from 'react'
|
|
|
3
3
|
import styled from 'styled-components'
|
|
4
4
|
|
|
5
5
|
import { ROLES, WEBCHAT } from '../constants'
|
|
6
|
-
import { WebchatContext } from '../contexts'
|
|
7
6
|
import { staticAsset } from '../util/environment'
|
|
7
|
+
import { WebchatContext } from '../webchat/context'
|
|
8
|
+
import { DocumentProps } from './index-types'
|
|
8
9
|
import { Message } from './message'
|
|
9
10
|
|
|
10
11
|
const StyledButton = styled.a`
|
|
@@ -25,12 +26,13 @@ const StyledButton = styled.a`
|
|
|
25
26
|
}
|
|
26
27
|
`
|
|
27
28
|
|
|
28
|
-
const serialize = documentProps => {
|
|
29
|
+
const serialize = (documentProps: { src: string }) => {
|
|
29
30
|
return { document: documentProps.src }
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
export const Document = props => {
|
|
33
|
+
export const Document = (props: DocumentProps) => {
|
|
33
34
|
props = { ...props, src: staticAsset(props.src) }
|
|
35
|
+
|
|
34
36
|
let content = props.children
|
|
35
37
|
|
|
36
38
|
const { getThemeProperty } = useContext(WebchatContext)
|
|
@@ -3,6 +3,7 @@ import styled from 'styled-components'
|
|
|
3
3
|
|
|
4
4
|
import { COLORS, WEBCHAT } from '../constants'
|
|
5
5
|
import { renderComponent } from '../util/react'
|
|
6
|
+
import { Button } from './button/index'
|
|
6
7
|
|
|
7
8
|
const ElementContainer = styled.div`
|
|
8
9
|
display: flex;
|
|
@@ -15,11 +16,16 @@ const ElementContainer = styled.div`
|
|
|
15
16
|
justify-content: space-between;
|
|
16
17
|
`
|
|
17
18
|
|
|
18
|
-
export
|
|
19
|
+
export interface ElementProps {
|
|
20
|
+
children: React.ReactNode[]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const Element = (props: ElementProps) => {
|
|
19
24
|
const renderBrowser = () => (
|
|
20
25
|
<ElementContainer>{props.children}</ElementContainer>
|
|
21
26
|
)
|
|
22
27
|
|
|
28
|
+
// @ts-ignore
|
|
23
29
|
const renderNode = () => <element>{props.children}</element>
|
|
24
30
|
|
|
25
31
|
return renderComponent({ renderBrowser, renderNode })
|
|
@@ -29,8 +35,8 @@ Element.serialize = elementProps => {
|
|
|
29
35
|
const element = Object.assign(
|
|
30
36
|
{},
|
|
31
37
|
...elementProps.children
|
|
32
|
-
.filter(c => c
|
|
33
|
-
.map(c => c
|
|
38
|
+
.filter(c => c?.type?.name !== Button.name)
|
|
39
|
+
.map(c => c?.type?.serialize && c.type.serialize(c.props))
|
|
34
40
|
)
|
|
35
41
|
// When we are serializer buttons from backend, we are receiving the data
|
|
36
42
|
// as an array of buttons, so we have to keep robust with serve and deal with arrays
|
|
@@ -38,21 +44,13 @@ Element.serialize = elementProps => {
|
|
|
38
44
|
...elementProps.children
|
|
39
45
|
.filter(c => {
|
|
40
46
|
if (c instanceof Array) return true
|
|
41
|
-
return c
|
|
47
|
+
return c?.type?.name === Button.name
|
|
42
48
|
})
|
|
43
49
|
.map(b => {
|
|
44
50
|
if (b instanceof Array) {
|
|
45
|
-
|
|
46
|
-
bb =>
|
|
47
|
-
bb &&
|
|
48
|
-
bb.type &&
|
|
49
|
-
bb.type.serialize &&
|
|
50
|
-
bb.type.serialize(bb.props).button
|
|
51
|
-
)
|
|
51
|
+
b.map(bb => bb?.type?.serialize?.(bb.props)?.button)
|
|
52
52
|
}
|
|
53
|
-
return (
|
|
54
|
-
b && b.type && b.type.serialize && b.type.serialize(b.props).button
|
|
55
|
-
)
|
|
53
|
+
return b?.type?.serialize(b.props).button
|
|
56
54
|
}),
|
|
57
55
|
]
|
|
58
56
|
// When we have the buttons from backend, we have all buttons inside an array on the first position
|
|
@@ -2,7 +2,7 @@ import React, { useContext, useState } from 'react'
|
|
|
2
2
|
import styled from 'styled-components'
|
|
3
3
|
|
|
4
4
|
import { COLORS } from '../constants'
|
|
5
|
-
import { WebchatContext } from '../
|
|
5
|
+
import { WebchatContext } from '../webchat/context'
|
|
6
6
|
|
|
7
7
|
const Container = styled.div`
|
|
8
8
|
display: flex;
|
|
@@ -3,11 +3,16 @@ import React, { useContext, useState } from 'react'
|
|
|
3
3
|
import styled from 'styled-components'
|
|
4
4
|
|
|
5
5
|
import { ROLES, WEBCHAT } from '../constants'
|
|
6
|
-
import { WebchatContext } from '../contexts'
|
|
7
6
|
import { staticAsset } from '../util/environment'
|
|
7
|
+
import { WebchatContext } from '../webchat/context'
|
|
8
|
+
import { ImageProps } from './index-types'
|
|
8
9
|
import { Message } from './message'
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
interface StyledImageProps {
|
|
12
|
+
hasPreviewer: boolean
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const StyledImage = styled.img<StyledImageProps>`
|
|
11
16
|
border-radius: 8px;
|
|
12
17
|
max-width: 150px;
|
|
13
18
|
max-height: 150px;
|
|
@@ -15,14 +20,15 @@ const StyledImage = styled.img`
|
|
|
15
20
|
cursor: ${({ hasPreviewer }) => (hasPreviewer ? 'pointer' : 'auto')};
|
|
16
21
|
`
|
|
17
22
|
|
|
18
|
-
const serialize = imageProps => {
|
|
23
|
+
const serialize = (imageProps: { src: string }) => {
|
|
19
24
|
return { image: imageProps.src }
|
|
20
25
|
}
|
|
21
26
|
|
|
22
|
-
export const Image = props => {
|
|
27
|
+
export const Image = (props: ImageProps) => {
|
|
23
28
|
props = props.input?.data
|
|
24
29
|
? { ...props, src: props.input.data }
|
|
25
30
|
: { ...props, src: staticAsset(props.src) }
|
|
31
|
+
|
|
26
32
|
let content = props.children
|
|
27
33
|
|
|
28
34
|
const [isPreviewerOpened, setIsPreviewerOpened] = useState(false)
|
|
@@ -31,9 +37,9 @@ export const Image = props => {
|
|
|
31
37
|
|
|
32
38
|
const { getThemeProperty } = useContext(WebchatContext)
|
|
33
39
|
const ImagePreviewer = getThemeProperty(
|
|
34
|
-
WEBCHAT.CUSTOM_PROPERTIES.imagePreviewer
|
|
35
|
-
null
|
|
40
|
+
WEBCHAT.CUSTOM_PROPERTIES.imagePreviewer
|
|
36
41
|
)
|
|
42
|
+
|
|
37
43
|
if (isBrowser()) {
|
|
38
44
|
content = (
|
|
39
45
|
<>
|
|
@@ -53,6 +59,7 @@ export const Image = props => {
|
|
|
53
59
|
</>
|
|
54
60
|
)
|
|
55
61
|
}
|
|
62
|
+
|
|
56
63
|
return (
|
|
57
64
|
<Message
|
|
58
65
|
role={ROLES.IMAGE_MESSAGE}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
3
|
import { SENDERS } from '../index-types'
|
|
4
|
-
import { CoverComponentProps } from '../webchat/index-types'
|
|
5
4
|
|
|
6
5
|
export type MessageType =
|
|
7
6
|
| 'audio'
|
|
@@ -16,7 +15,7 @@ export type MessageType =
|
|
|
16
15
|
|
|
17
16
|
export interface MessageProps {
|
|
18
17
|
blob?: boolean
|
|
19
|
-
children
|
|
18
|
+
children?: React.ReactNode
|
|
20
19
|
delay?: number
|
|
21
20
|
enabletimestamps?: boolean
|
|
22
21
|
sentBy?: SENDERS
|
|
@@ -34,6 +33,10 @@ export interface TextProps extends MessageProps {
|
|
|
34
33
|
botInteractionId?: string
|
|
35
34
|
}
|
|
36
35
|
|
|
36
|
+
export interface CarouselProps extends MessageProps {
|
|
37
|
+
children: React.ReactNode[]
|
|
38
|
+
}
|
|
39
|
+
|
|
37
40
|
export interface Webview {
|
|
38
41
|
name: string
|
|
39
42
|
}
|
|
@@ -48,7 +51,7 @@ export interface ButtonProps {
|
|
|
48
51
|
onClick?: () => void
|
|
49
52
|
autodisable?: boolean
|
|
50
53
|
disabled?: boolean
|
|
51
|
-
disabledstyle?:
|
|
54
|
+
disabledstyle?: Record<string, string> | string
|
|
52
55
|
children: string
|
|
53
56
|
setDisabled?: (disabled: boolean) => void
|
|
54
57
|
parentId?: string
|
|
@@ -60,34 +63,31 @@ export interface ReplyProps {
|
|
|
60
63
|
children: string
|
|
61
64
|
}
|
|
62
65
|
|
|
63
|
-
export interface
|
|
66
|
+
export interface ImageProps extends MessageProps {
|
|
64
67
|
src: string
|
|
68
|
+
input?: { data: string }
|
|
65
69
|
}
|
|
66
70
|
|
|
67
|
-
export
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
children: React.ReactNode
|
|
71
|
-
style: string
|
|
71
|
+
export interface VideoProps extends MessageProps {
|
|
72
|
+
src: string
|
|
73
|
+
input?: { data: string }
|
|
72
74
|
}
|
|
73
75
|
|
|
74
|
-
export
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
export type ImageProp = { image?: string } // https URL or imported Image asset
|
|
79
|
-
export type PersistentMenuCloseOption = { closeLabel: string }
|
|
80
|
-
export type PersistentMenuOption = { label: string } & ButtonProps
|
|
81
|
-
export type StyleProp = { style?: any }
|
|
76
|
+
export interface AudioProps extends MessageProps {
|
|
77
|
+
src: string
|
|
78
|
+
input?: { data: string }
|
|
79
|
+
}
|
|
82
80
|
|
|
83
|
-
export
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
export interface DocumentProps extends MessageProps {
|
|
82
|
+
src: string
|
|
83
|
+
input?: { data: string }
|
|
84
|
+
from?: any
|
|
85
|
+
}
|
|
87
86
|
|
|
88
|
-
export interface
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
export interface CustomMessageType {
|
|
88
|
+
(props: any): JSX.Element
|
|
89
|
+
customTypeName: string
|
|
90
|
+
deserialize(msg: any): JSX.Element
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
export type BlockInputOption = {
|
|
@@ -96,101 +96,6 @@ export type BlockInputOption = {
|
|
|
96
96
|
message: string
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
export interface BlobProps {
|
|
100
|
-
blobTick?: boolean
|
|
101
|
-
blobTickStyle?: any
|
|
102
|
-
blobWidth?: string
|
|
103
|
-
imageStyle?: any
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export interface ThemeProps extends StyleProp {
|
|
107
|
-
mobileBreakpoint?: number
|
|
108
|
-
mobileStyle?: any
|
|
109
|
-
webview?: StyleProp & { header?: StyleProp }
|
|
110
|
-
animations?: EnableProp
|
|
111
|
-
intro?: StyleProp & ImageProp & CustomProp
|
|
112
|
-
brand?: { color?: string } & ImageProp
|
|
113
|
-
header?: { title?: string; subtitle?: string } & ImageProp &
|
|
114
|
-
StyleProp &
|
|
115
|
-
CustomProp
|
|
116
|
-
message?: {
|
|
117
|
-
bot?: BlobProps & ImageProp & StyleProp
|
|
118
|
-
agent?: ImageProp
|
|
119
|
-
user?: BlobProps & StyleProp
|
|
120
|
-
customTypes?: React.ComponentType[]
|
|
121
|
-
} & StyleProp & {
|
|
122
|
-
timestamps?: {
|
|
123
|
-
withImage?: boolean
|
|
124
|
-
format: () => string
|
|
125
|
-
} & StyleProp &
|
|
126
|
-
EnableProp
|
|
127
|
-
}
|
|
128
|
-
button?: {
|
|
129
|
-
autodisable?: boolean
|
|
130
|
-
disabledstyle?: any
|
|
131
|
-
hoverBackground?: string
|
|
132
|
-
hoverTextColor?: string
|
|
133
|
-
messageType?: 'text' | 'payload'
|
|
134
|
-
urlIcon?: ImageProp & EnableProp
|
|
135
|
-
} & StyleProp &
|
|
136
|
-
CustomProp
|
|
137
|
-
replies?: {
|
|
138
|
-
align?: 'left' | 'center' | 'right'
|
|
139
|
-
wrap?: 'wrap' | 'nowrap'
|
|
140
|
-
}
|
|
141
|
-
carousel?: {
|
|
142
|
-
arrow?: {
|
|
143
|
-
left: CustomProp
|
|
144
|
-
right: CustomProp
|
|
145
|
-
}
|
|
146
|
-
enableArrows?: boolean
|
|
147
|
-
}
|
|
148
|
-
reply?: StyleProp & CustomProp
|
|
149
|
-
triggerButton?: ImageProp & StyleProp & CustomProp
|
|
150
|
-
notifications?: EnableProp & {
|
|
151
|
-
banner?: CustomProp & EnableProp & { text?: string }
|
|
152
|
-
triggerButton?: EnableProp
|
|
153
|
-
}
|
|
154
|
-
scrollButton?: EnableProp & CustomProp
|
|
155
|
-
markdownStyle?: string // string template with css styles
|
|
156
|
-
userInput?: {
|
|
157
|
-
attachments?: EnableProp & CustomProp
|
|
158
|
-
blockInputs?: BlockInputOption[]
|
|
159
|
-
box?: { placeholder: string } & StyleProp
|
|
160
|
-
emojiPicker?: EnableProp & CustomProp
|
|
161
|
-
menu?: { darkBackground?: boolean } & {
|
|
162
|
-
custom?: React.ComponentType<PersistentMenuProps>
|
|
163
|
-
}
|
|
164
|
-
menuButton?: CustomProp
|
|
165
|
-
persistentMenu?: PersistentMenuTheme
|
|
166
|
-
sendButton?: EnableProp & CustomProp
|
|
167
|
-
} & EnableProp &
|
|
168
|
-
StyleProp
|
|
169
|
-
imagePreviewer?: React.ComponentType<ImagePreviewerProps>
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
interface ImagePreviewerProps {
|
|
173
|
-
src: string
|
|
174
|
-
isPreviewerOpened: boolean
|
|
175
|
-
closePreviewer: () => void
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
export interface CoverComponentOptions {
|
|
179
|
-
component: React.ComponentType<CoverComponentProps>
|
|
180
|
-
props?: any
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export interface WebchatSettingsProps {
|
|
184
|
-
blockInputs?: BlockInputOption[]
|
|
185
|
-
enableAnimations?: boolean
|
|
186
|
-
enableAttachments?: boolean
|
|
187
|
-
enableEmojiPicker?: boolean
|
|
188
|
-
enableUserInput?: boolean
|
|
189
|
-
persistentMenu?: PersistentMenuTheme
|
|
190
|
-
theme?: ThemeProps
|
|
191
|
-
user?: { extra_data?: any }
|
|
192
|
-
}
|
|
193
|
-
|
|
194
99
|
export type WrappedComponent<Props> = React.FunctionComponent<Props> & {
|
|
195
100
|
customTypeName: string
|
|
196
101
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export { Audio } from './audio'
|
|
2
|
-
export { Button } from './button'
|
|
2
|
+
export { Button } from './button/index'
|
|
3
3
|
export { Carousel } from './carousel'
|
|
4
4
|
export { customMessage } from './custom-message'
|
|
5
5
|
export { Document } from './document'
|
|
6
6
|
export { Element } from './element'
|
|
7
|
+
export { Handoff } from './handoff'
|
|
7
8
|
export { Image } from './image'
|
|
8
9
|
export * from './index-types'
|
|
9
10
|
export { Location } from './location'
|
|
@@ -18,15 +19,35 @@ export { Subtitle } from './subtitle'
|
|
|
18
19
|
export { Text } from './text'
|
|
19
20
|
export { Title } from './title'
|
|
20
21
|
export { Video } from './video'
|
|
21
|
-
export {
|
|
22
|
+
export {
|
|
23
|
+
normalizeWebchatSettings,
|
|
24
|
+
WebchatSettings,
|
|
25
|
+
WebchatSettingsProps,
|
|
26
|
+
} from './webchat-settings'
|
|
22
27
|
export {
|
|
23
28
|
WhatsappButtonList,
|
|
24
29
|
WhatsappButtonListProps,
|
|
25
30
|
WhatsappButtonListRowProps,
|
|
26
31
|
WhatsappButtonListSectionProps,
|
|
27
32
|
} from './whatsapp-button-list'
|
|
33
|
+
export { WhatsappCatalog, WhatsappCatalogProps } from './whatsapp-catalog'
|
|
28
34
|
export {
|
|
29
35
|
WhatsappCTAUrlButton,
|
|
30
36
|
WhatsappCTAUrlButtonProps,
|
|
31
37
|
} from './whatsapp-cta-url-button'
|
|
38
|
+
export {
|
|
39
|
+
WhatsappMediaCarousel,
|
|
40
|
+
WhatsappMediaCarouselProps,
|
|
41
|
+
} from './whatsapp-media-carousel'
|
|
42
|
+
export { WhatsappProduct } from './whatsapp-product'
|
|
43
|
+
export {
|
|
44
|
+
WhatsappProductCarousel,
|
|
45
|
+
WhatsappProductCarouselProps,
|
|
46
|
+
} from './whatsapp-product-carousel'
|
|
47
|
+
export {
|
|
48
|
+
ProductItem,
|
|
49
|
+
WhatsappProductList,
|
|
50
|
+
WhatsappProductListProps,
|
|
51
|
+
WhatsappProductListSection,
|
|
52
|
+
} from './whatsapp-product-list'
|
|
32
53
|
export { WhatsappTemplate } from './whatsapp-template'
|
|
@@ -3,12 +3,13 @@ import React, { useContext, useEffect, useState } from 'react'
|
|
|
3
3
|
import { v7 as uuidv7 } from 'uuid'
|
|
4
4
|
|
|
5
5
|
import { COLORS, WEBCHAT } from '../../constants'
|
|
6
|
-
import { RequestContext
|
|
6
|
+
import { RequestContext } from '../../contexts'
|
|
7
7
|
import { SENDERS } from '../../index-types'
|
|
8
8
|
import { Fade } from '../../shared/styles'
|
|
9
9
|
import { isDev } from '../../util/environment'
|
|
10
10
|
import { ConditionalWrapper, renderComponent } from '../../util/react'
|
|
11
|
-
import {
|
|
11
|
+
import { WebchatContext } from '../../webchat/context'
|
|
12
|
+
import { Button } from '../button/index'
|
|
12
13
|
import { ButtonsDisabler } from '../buttons-disabler'
|
|
13
14
|
import { getMarkdownStyle, renderLinks, renderMarkdown } from '../markdown'
|
|
14
15
|
import { Reply } from '../reply'
|
|
@@ -48,7 +49,7 @@ export const Message = props => {
|
|
|
48
49
|
const markdown = props.markdown
|
|
49
50
|
const { webchatState, addMessage, updateReplies, getThemeProperty } =
|
|
50
51
|
useContext(WebchatContext)
|
|
51
|
-
const [state
|
|
52
|
+
const [state] = useState({
|
|
52
53
|
id: props.id || uuidv7(),
|
|
53
54
|
})
|
|
54
55
|
|
|
@@ -138,10 +139,7 @@ export const Message = props => {
|
|
|
138
139
|
}
|
|
139
140
|
}, [webchatState.messagesJSON])
|
|
140
141
|
|
|
141
|
-
const brandColor = getThemeProperty(
|
|
142
|
-
WEBCHAT.CUSTOM_PROPERTIES.brandColor,
|
|
143
|
-
COLORS.BOTONIC_BLUE
|
|
144
|
-
)
|
|
142
|
+
const brandColor = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.brandColor)
|
|
145
143
|
|
|
146
144
|
const getBgColor = () => {
|
|
147
145
|
if (!blob) return COLORS.TRANSPARENT
|
|
@@ -164,7 +162,7 @@ export const Message = props => {
|
|
|
164
162
|
|
|
165
163
|
const userOrBotMessage = isSentByUser ? SENDERS.user : SENDERS.bot
|
|
166
164
|
const hasBlobTick = () =>
|
|
167
|
-
getThemeProperty(`message.${userOrBotMessage}.blobTick
|
|
165
|
+
getThemeProperty(`message.${userOrBotMessage}.blobTick`)
|
|
168
166
|
|
|
169
167
|
const renderBrowser = () => {
|
|
170
168
|
const messageJSON = webchatState.messagesJSON.find(m => m.id === state.id)
|
|
@@ -204,8 +202,7 @@ export const Message = props => {
|
|
|
204
202
|
}
|
|
205
203
|
|
|
206
204
|
const animationsEnabled = getThemeProperty(
|
|
207
|
-
WEBCHAT.CUSTOM_PROPERTIES.enableAnimations
|
|
208
|
-
true
|
|
205
|
+
WEBCHAT.CUSTOM_PROPERTIES.enableAnimations
|
|
209
206
|
)
|
|
210
207
|
|
|
211
208
|
const resolveCustomTypeName = () =>
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import React, { useContext, useEffect, useState } from 'react'
|
|
2
|
-
import { v7 as uuidv7 } from 'uuid'
|
|
3
2
|
|
|
4
3
|
import ThumbsDown from '../../assets/thumbs-down.svg'
|
|
5
4
|
import ThumbsUp from '../../assets/thumbs-up.svg'
|
|
6
|
-
import { WebchatContext } from '../../contexts'
|
|
7
|
-
import { ActionRequest } from '../../index-types'
|
|
8
5
|
import { resolveImage } from '../../util'
|
|
9
|
-
import {
|
|
6
|
+
import { WebchatContext } from '../../webchat/context'
|
|
7
|
+
import { useTracking } from '../../webchat/tracking'
|
|
10
8
|
import { FeedbackButton, FeedbackMessageContainer } from './styles'
|
|
11
9
|
|
|
12
10
|
interface ButtonsState {
|
|
@@ -25,7 +23,8 @@ export const MessageFeedback = ({
|
|
|
25
23
|
inferenceId,
|
|
26
24
|
messageId,
|
|
27
25
|
}: RatingProps) => {
|
|
28
|
-
const { webchatState, updateMessage
|
|
26
|
+
const { webchatState, updateMessage } = useContext(WebchatContext)
|
|
27
|
+
const { trackKnowledgebaseFeedback } = useTracking()
|
|
29
28
|
|
|
30
29
|
const [className, setClassName] = useState('')
|
|
31
30
|
const [disabled, setDisabled] = useState<ButtonsState>({
|
|
@@ -56,34 +55,18 @@ export const MessageFeedback = ({
|
|
|
56
55
|
}, [disabled])
|
|
57
56
|
|
|
58
57
|
const handleClick = async (isUseful: boolean) => {
|
|
59
|
-
if (!trackEvent) {
|
|
60
|
-
return
|
|
61
|
-
}
|
|
62
|
-
|
|
63
58
|
if (isUseful) {
|
|
64
59
|
setDisabled({ positive: false, negative: true })
|
|
65
60
|
} else {
|
|
66
61
|
setDisabled({ positive: true, negative: false })
|
|
67
62
|
}
|
|
68
63
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
possibleValues: [0, 1],
|
|
76
|
-
option: isUseful ? FeedbackOption.ThumbsUp : FeedbackOption.ThumbsDown,
|
|
77
|
-
value: isUseful ? 1 : 0,
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const request = {
|
|
81
|
-
session: {
|
|
82
|
-
...webchatState.session,
|
|
83
|
-
},
|
|
84
|
-
} as unknown as ActionRequest
|
|
85
|
-
|
|
86
|
-
await trackEvent(request, EventAction.FeedbackKnowledgebase, args)
|
|
64
|
+
await trackKnowledgebaseFeedback({
|
|
65
|
+
messageId,
|
|
66
|
+
isUseful,
|
|
67
|
+
botInteractionId,
|
|
68
|
+
inferenceId,
|
|
69
|
+
})
|
|
87
70
|
}
|
|
88
71
|
|
|
89
72
|
return (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useContext } from 'react'
|
|
2
2
|
|
|
3
|
-
import { WebchatContext } from '../../contexts'
|
|
4
3
|
import { SENDERS } from '../../index-types'
|
|
4
|
+
import { WebchatContext } from '../../webchat/context'
|
|
5
5
|
import { MessageFeedback } from './message-feedback'
|
|
6
6
|
import { MessageFooterContainer } from './styles'
|
|
7
7
|
import { MessageTimestamp, resolveMessageTimestamps } from './timestamps'
|
|
@@ -30,13 +30,13 @@ export const MessageFooter = ({
|
|
|
30
30
|
enabletimestamps
|
|
31
31
|
)
|
|
32
32
|
const isSentByUser = sentBy === SENDERS.user
|
|
33
|
-
const
|
|
33
|
+
const messageFooterClass = isSentByUser
|
|
34
34
|
? 'message-footer-user'
|
|
35
35
|
: 'message-footer-bot'
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
38
|
<MessageFooterContainer
|
|
39
|
-
className={
|
|
39
|
+
className={messageFooterClass}
|
|
40
40
|
isSentByUser={isSentByUser}
|
|
41
41
|
>
|
|
42
42
|
{timestampsEnabled ? (
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useContext } from 'react'
|
|
2
2
|
|
|
3
3
|
import { WEBCHAT } from '../../constants'
|
|
4
|
-
import { WebchatContext } from '../../contexts'
|
|
5
4
|
import { SENDERS } from '../../index-types'
|
|
6
5
|
import { resolveImage } from '../../util/environment'
|
|
6
|
+
import { WebchatContext } from '../../webchat/context'
|
|
7
7
|
import { BotMessageImageContainer } from './styles'
|
|
8
8
|
|
|
9
9
|
interface MessageImageProps {
|
|
@@ -23,10 +23,7 @@ export const MessageImage = ({ imagestyle, sentBy }: MessageImageProps) => {
|
|
|
23
23
|
|
|
24
24
|
const BotMessageImage = getThemeProperty(
|
|
25
25
|
WEBCHAT.CUSTOM_PROPERTIES.botMessageImage,
|
|
26
|
-
getThemeProperty(
|
|
27
|
-
WEBCHAT.CUSTOM_PROPERTIES.brandImage,
|
|
28
|
-
WEBCHAT.DEFAULTS.LOGO
|
|
29
|
-
)
|
|
26
|
+
getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.brandImage)
|
|
30
27
|
)
|
|
31
28
|
|
|
32
29
|
const AgentMessageImage = getThemeProperty(
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useContext } from 'react'
|
|
2
2
|
|
|
3
3
|
import { WEBCHAT } from '../../constants'
|
|
4
|
-
import { WebchatContext } from '../../contexts'
|
|
5
4
|
import { SENDERS } from '../../index-types'
|
|
6
5
|
import { resolveImage } from '../../util'
|
|
6
|
+
import { WebchatContext } from '../../webchat/context'
|
|
7
7
|
import { TimestampContainer, TimestampText } from './styles'
|
|
8
8
|
|
|
9
9
|
export const resolveMessageTimestamps = (
|
|
@@ -62,8 +62,7 @@ export const MessageTimestamp = ({
|
|
|
62
62
|
const isSentByAgent = sentBy === SENDERS.agent
|
|
63
63
|
|
|
64
64
|
const BotMessageImage = getThemeProperty(
|
|
65
|
-
WEBCHAT.CUSTOM_PROPERTIES.botMessageImage
|
|
66
|
-
undefined
|
|
65
|
+
WEBCHAT.CUSTOM_PROPERTIES.botMessageImage
|
|
67
66
|
)
|
|
68
67
|
|
|
69
68
|
const AgentMessageImage = getThemeProperty(
|
|
@@ -25,10 +25,6 @@ export interface MultichannelTextProps extends MultichannelViewOptions {
|
|
|
25
25
|
// Carousel
|
|
26
26
|
export interface MultichannelCarouselProps extends MultichannelViewOptions {
|
|
27
27
|
enableURL?: boolean
|
|
28
|
-
indexMode?: IndexMode
|
|
29
|
-
showTitle?: boolean
|
|
30
|
-
showSubtitle?: boolean
|
|
31
|
-
buttonsAsText?: boolean
|
|
32
28
|
}
|
|
33
29
|
|
|
34
30
|
// Button
|
|
@@ -3,9 +3,9 @@ import React, { useContext } from 'react'
|
|
|
3
3
|
|
|
4
4
|
import { RequestContext } from '../../contexts'
|
|
5
5
|
import { truncateText } from '../../util'
|
|
6
|
-
import { Button } from '../button'
|
|
6
|
+
import { Button } from '../button/index'
|
|
7
7
|
import { MultichannelContext } from './multichannel-context'
|
|
8
|
-
import { WHATSAPP_MAX_BUTTON_CHARS } from './
|
|
8
|
+
import { WHATSAPP_MAX_BUTTON_CHARS } from './whatsapp/constants'
|
|
9
9
|
|
|
10
10
|
export const MultichannelButton = props => {
|
|
11
11
|
const requestContext = useContext(RequestContext)
|