@botonic/react 0.44.1 → 0.45.0-alpha.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/botonic-tester.js +0 -1
- package/lib/cjs/botonic-tester.js.map +1 -1
- package/lib/cjs/components/audio.d.ts +1 -1
- package/lib/cjs/components/audio.js +2 -1
- package/lib/cjs/components/audio.js.map +1 -1
- package/lib/cjs/components/button/index.d.ts +1 -1
- package/lib/cjs/components/button/index.js +5 -8
- package/lib/cjs/components/button/index.js.map +1 -1
- package/lib/cjs/components/buttons-disabler.d.ts +2 -2
- package/lib/cjs/components/buttons-disabler.js +12 -6
- package/lib/cjs/components/buttons-disabler.js.map +1 -1
- package/lib/cjs/components/carousel.d.ts +1 -1
- package/lib/cjs/components/carousel.js +5 -4
- package/lib/cjs/components/carousel.js.map +1 -1
- package/lib/cjs/components/custom-message.d.ts +1 -1
- package/lib/cjs/components/custom-message.js +1 -2
- package/lib/cjs/components/custom-message.js.map +1 -1
- package/lib/cjs/components/document.d.ts +1 -1
- package/lib/cjs/components/document.js +2 -1
- package/lib/cjs/components/document.js.map +1 -1
- package/lib/cjs/components/element.d.ts +1 -1
- package/lib/cjs/components/element.js +7 -5
- 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 +1 -1
- package/lib/cjs/components/image.js.map +1 -1
- package/lib/cjs/components/index-types.d.ts +2 -2
- package/lib/cjs/components/location.js +2 -3
- package/lib/cjs/components/location.js.map +1 -1
- package/lib/cjs/components/markdown.d.ts +1 -1
- package/lib/cjs/components/markdown.js +24 -16
- package/lib/cjs/components/markdown.js.map +1 -1
- package/lib/cjs/components/message/index.js +25 -20
- package/lib/cjs/components/message/index.js.map +1 -1
- package/lib/cjs/components/message/message-feedback.js.map +1 -1
- package/lib/cjs/components/message/message-footer.js.map +1 -1
- package/lib/cjs/components/message/message-image.js.map +1 -1
- package/lib/cjs/components/message/timestamps.js +1 -1
- package/lib/cjs/components/message/timestamps.js.map +1 -1
- package/lib/cjs/components/message-template.js +3 -4
- package/lib/cjs/components/message-template.js.map +1 -1
- package/lib/cjs/components/multichannel/facebook/facebook.js +3 -2
- package/lib/cjs/components/multichannel/facebook/facebook.js.map +1 -1
- package/lib/cjs/components/multichannel/multichannel-button.js +6 -6
- package/lib/cjs/components/multichannel/multichannel-button.js.map +1 -1
- package/lib/cjs/components/multichannel/multichannel-carousel.js +11 -7
- package/lib/cjs/components/multichannel/multichannel-carousel.js.map +1 -1
- package/lib/cjs/components/multichannel/multichannel-reply.js +3 -3
- package/lib/cjs/components/multichannel/multichannel-reply.js.map +1 -1
- package/lib/cjs/components/multichannel/multichannel-text.js +15 -9
- package/lib/cjs/components/multichannel/multichannel-text.js.map +1 -1
- package/lib/cjs/components/multichannel/multichannel-utils.js +8 -4
- package/lib/cjs/components/multichannel/multichannel-utils.js.map +1 -1
- package/lib/cjs/components/multichannel/multichannel.js +1 -2
- package/lib/cjs/components/multichannel/multichannel.js.map +1 -1
- package/lib/cjs/components/pic.js +1 -1
- package/lib/cjs/components/pic.js.map +1 -1
- package/lib/cjs/components/raw.js +3 -2
- package/lib/cjs/components/raw.js.map +1 -1
- package/lib/cjs/components/reply.d.ts +1 -1
- package/lib/cjs/components/reply.js +6 -4
- package/lib/cjs/components/reply.js.map +1 -1
- package/lib/cjs/components/share-button.js +3 -4
- package/lib/cjs/components/share-button.js.map +1 -1
- package/lib/cjs/components/subtitle.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/debug-message.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/debug-message.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/events/ai-agent.d.ts +2 -2
- package/lib/cjs/components/system-debug-trace/events/ai-agent.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/events/bot-action.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/events/bot-action.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/events/components/guardrail-item.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/events/components/sources-section.d.ts +2 -2
- package/lib/cjs/components/system-debug-trace/events/components/sources-section.js +2 -1
- package/lib/cjs/components/system-debug-trace/events/components/sources-section.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/events/conditional-channel.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/events/conditional-channel.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/events/conditional-country.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/events/conditional-country.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/events/conditional-custom.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/events/conditional-custom.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/events/conditional-queue-status.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/events/conditional-queue-status.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/events/fallback.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/events/fallback.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/events/handoff-success.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/events/handoff-success.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/events/keyword.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/events/keyword.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/events/knowledge-base.d.ts +2 -2
- package/lib/cjs/components/system-debug-trace/events/knowledge-base.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/events/redirect-flow.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/events/redirect-flow.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/events/smart-intent.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/events/smart-intent.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/events/webview-action-triggered.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/events/webview-action-triggered.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/hooks/use-knowledge-base-info.d.ts +2 -2
- package/lib/cjs/components/system-debug-trace/hooks/use-knowledge-base-info.js +2 -2
- package/lib/cjs/components/system-debug-trace/hooks/use-knowledge-base-info.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/hooks/use-last-label-position.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/hooks/use-last-label-position.js +6 -3
- package/lib/cjs/components/system-debug-trace/hooks/use-last-label-position.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/icons/arrow-progress.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/icons/arrow-progress.js +3 -1
- package/lib/cjs/components/system-debug-trace/icons/arrow-progress.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/icons/brain.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/icons/brain.js +3 -1
- package/lib/cjs/components/system-debug-trace/icons/brain.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/icons/caret-down.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/icons/caret-down.js +3 -1
- package/lib/cjs/components/system-debug-trace/icons/caret-down.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/icons/caret-up.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/icons/caret-up.js +3 -1
- package/lib/cjs/components/system-debug-trace/icons/caret-up.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/icons/circle-check.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/icons/circle-check.js +1 -0
- package/lib/cjs/components/system-debug-trace/icons/circle-check.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/icons/code.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/icons/code.js +1 -0
- package/lib/cjs/components/system-debug-trace/icons/code.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/icons/file-pdf.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/icons/file-pdf.js +3 -1
- package/lib/cjs/components/system-debug-trace/icons/file-pdf.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/icons/file-word.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/icons/file-word.js +3 -1
- package/lib/cjs/components/system-debug-trace/icons/file-word.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/icons/hand.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/icons/hand.js +3 -1
- package/lib/cjs/components/system-debug-trace/icons/hand.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/icons/head-set.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/icons/head-set.js +3 -1
- package/lib/cjs/components/system-debug-trace/icons/head-set.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/icons/life-ring.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/icons/life-ring.js +3 -1
- package/lib/cjs/components/system-debug-trace/icons/life-ring.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/icons/link.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/icons/link.js +3 -1
- package/lib/cjs/components/system-debug-trace/icons/link.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/icons/quote-right.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/icons/quote-right.js +3 -1
- package/lib/cjs/components/system-debug-trace/icons/quote-right.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/icons/screwdriver-wrench.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/icons/screwdriver-wrench.js +3 -1
- package/lib/cjs/components/system-debug-trace/icons/screwdriver-wrench.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/icons/split.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/icons/split.js +3 -1
- package/lib/cjs/components/system-debug-trace/icons/split.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/icons/wand.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/icons/wand.js +3 -1
- package/lib/cjs/components/system-debug-trace/icons/wand.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/icons/window-restore.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/icons/window-restore.js +3 -1
- package/lib/cjs/components/system-debug-trace/icons/window-restore.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/index.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/types.d.ts +2 -2
- package/lib/cjs/components/text.d.ts +1 -1
- package/lib/cjs/components/text.js +8 -4
- package/lib/cjs/components/text.js.map +1 -1
- package/lib/cjs/components/title.d.ts +1 -1
- package/lib/cjs/components/video.d.ts +1 -1
- package/lib/cjs/components/video.js +2 -1
- package/lib/cjs/components/video.js.map +1 -1
- package/lib/cjs/components/webchat-settings.d.ts +3 -3
- package/lib/cjs/components/webchat-settings.js +40 -35
- package/lib/cjs/components/webchat-settings.js.map +1 -1
- package/lib/cjs/components/whatsapp-button-list.js +1 -1
- package/lib/cjs/components/whatsapp-button-list.js.map +1 -1
- package/lib/cjs/components/whatsapp-catalog.js +1 -1
- package/lib/cjs/components/whatsapp-catalog.js.map +1 -1
- package/lib/cjs/components/whatsapp-cta-url-button.js +1 -1
- package/lib/cjs/components/whatsapp-cta-url-button.js.map +1 -1
- package/lib/cjs/components/whatsapp-interactive-media-carousel.js +1 -1
- package/lib/cjs/components/whatsapp-interactive-media-carousel.js.map +1 -1
- package/lib/cjs/components/whatsapp-media-carousel.js +1 -1
- package/lib/cjs/components/whatsapp-media-carousel.js.map +1 -1
- package/lib/cjs/components/whatsapp-product-carousel.js +1 -1
- package/lib/cjs/components/whatsapp-product-carousel.js.map +1 -1
- package/lib/cjs/components/whatsapp-product-list.js +1 -1
- package/lib/cjs/components/whatsapp-product-list.js.map +1 -1
- package/lib/cjs/components/whatsapp-product.js +1 -1
- package/lib/cjs/components/whatsapp-product.js.map +1 -1
- package/lib/cjs/components/whatsapp-template/index.js +1 -1
- package/lib/cjs/components/whatsapp-template/index.js.map +1 -1
- package/lib/cjs/contexts.d.ts +2 -2
- package/lib/cjs/dev-app.js +4 -7
- package/lib/cjs/dev-app.js.map +1 -1
- package/lib/cjs/index-types.d.ts +7 -7
- package/lib/cjs/message-utils.js +2 -1
- package/lib/cjs/message-utils.js.map +1 -1
- package/lib/cjs/msg-to-botonic.d.ts +0 -1
- package/lib/cjs/msg-to-botonic.js +16 -15
- package/lib/cjs/msg-to-botonic.js.map +1 -1
- package/lib/cjs/react-bot.d.ts +2 -2
- package/lib/cjs/util/dom.js +3 -3
- package/lib/cjs/util/dom.js.map +1 -1
- package/lib/cjs/util/environment.d.ts +1 -1
- package/lib/cjs/util/environment.js +17 -12
- package/lib/cjs/util/environment.js.map +1 -1
- package/lib/cjs/util/error-boundary.js +4 -5
- package/lib/cjs/util/error-boundary.js.map +1 -1
- package/lib/cjs/util/logs.js +2 -1
- package/lib/cjs/util/logs.js.map +1 -1
- package/lib/cjs/util/objects.js +4 -3
- package/lib/cjs/util/objects.js.map +1 -1
- package/lib/cjs/util/react.js +6 -3
- package/lib/cjs/util/react.js.map +1 -1
- package/lib/cjs/util/regexs.js +3 -2
- package/lib/cjs/util/regexs.js.map +1 -1
- package/lib/cjs/util/webchat.d.ts +2 -2
- package/lib/cjs/util/webchat.js +13 -7
- package/lib/cjs/util/webchat.js.map +1 -1
- package/lib/cjs/webchat/chat-area/index.js.map +1 -1
- package/lib/cjs/webchat/components/common.js +0 -1
- package/lib/cjs/webchat/components/common.js.map +1 -1
- package/lib/cjs/webchat/components/conditional-animation.js +1 -2
- package/lib/cjs/webchat/components/conditional-animation.js.map +1 -1
- package/lib/cjs/webchat/components/opened-persistent-menu.js +4 -2
- package/lib/cjs/webchat/components/opened-persistent-menu.js.map +1 -1
- package/lib/cjs/webchat/context/index.d.ts +1 -1
- package/lib/cjs/webchat/context/messages-reducer.d.ts +1 -1
- package/lib/cjs/webchat/context/messages-reducer.js +2 -2
- package/lib/cjs/webchat/context/messages-reducer.js.map +1 -1
- package/lib/cjs/webchat/context/types.d.ts +5 -5
- package/lib/cjs/webchat/context/use-webchat.d.ts +6 -6
- package/lib/cjs/webchat/context/use-webchat.js.map +1 -1
- package/lib/cjs/webchat/context/webchat-reducer.d.ts +1 -1
- package/lib/cjs/webchat/cover-component/index.js.map +1 -1
- package/lib/cjs/webchat/custom-messages/rating/icons/face-angry.d.ts +2 -1
- package/lib/cjs/webchat/custom-messages/rating/icons/face-angry.js.map +1 -1
- package/lib/cjs/webchat/custom-messages/rating/icons/face-frown.d.ts +2 -1
- package/lib/cjs/webchat/custom-messages/rating/icons/face-frown.js.map +1 -1
- package/lib/cjs/webchat/custom-messages/rating/icons/face-grin-beam.d.ts +2 -1
- package/lib/cjs/webchat/custom-messages/rating/icons/face-grin-beam.js.map +1 -1
- package/lib/cjs/webchat/custom-messages/rating/icons/face-meh.d.ts +2 -1
- package/lib/cjs/webchat/custom-messages/rating/icons/face-meh.js.map +1 -1
- package/lib/cjs/webchat/custom-messages/rating/icons/face-smile.d.ts +2 -1
- package/lib/cjs/webchat/custom-messages/rating/icons/face-smile.js.map +1 -1
- package/lib/cjs/webchat/custom-messages/rating/icons/star.d.ts +2 -1
- package/lib/cjs/webchat/custom-messages/rating/icons/star.js.map +1 -1
- package/lib/cjs/webchat/custom-messages/rating/index.js +2 -1
- package/lib/cjs/webchat/custom-messages/rating/index.js.map +1 -1
- package/lib/cjs/webchat/custom-messages/rating/rating-selector.js +5 -2
- package/lib/cjs/webchat/custom-messages/rating/rating-selector.js.map +1 -1
- package/lib/cjs/webchat/custom-messages/rating/smileys.d.ts +1 -1
- package/lib/cjs/webchat/custom-messages/rating/smileys.js.map +1 -1
- package/lib/cjs/webchat/custom-messages/rating/stars.d.ts +1 -1
- package/lib/cjs/webchat/custom-messages/rating/stars.js.map +1 -1
- package/lib/cjs/webchat/header/default-header.js +1 -1
- package/lib/cjs/webchat/header/default-header.js.map +1 -1
- package/lib/cjs/webchat/header/index.d.ts +1 -2
- package/lib/cjs/webchat/header/index.js.map +1 -1
- package/lib/cjs/webchat/hooks/use-device-adapter.d.ts +1 -1
- package/lib/cjs/webchat/hooks/use-device-adapter.js +8 -5
- package/lib/cjs/webchat/hooks/use-device-adapter.js.map +1 -1
- package/lib/cjs/webchat/hooks/use-scroll-to-bottom.js +4 -2
- package/lib/cjs/webchat/hooks/use-scroll-to-bottom.js.map +1 -1
- package/lib/cjs/webchat/hooks/use-scrollbar-controller.js +15 -11
- package/lib/cjs/webchat/hooks/use-scrollbar-controller.js.map +1 -1
- package/lib/cjs/webchat/hooks/use-typing.d.ts +2 -2
- package/lib/cjs/webchat/hooks/use-typing.js +11 -6
- package/lib/cjs/webchat/hooks/use-typing.js.map +1 -1
- package/lib/cjs/webchat/hooks/use-virtual-keyboard-detection.d.ts +1 -1
- package/lib/cjs/webchat/hooks/use-virtual-keyboard-detection.js +3 -5
- package/lib/cjs/webchat/hooks/use-virtual-keyboard-detection.js.map +1 -1
- package/lib/cjs/webchat/hooks/use-webchat-dimensions.js +5 -4
- package/lib/cjs/webchat/hooks/use-webchat-dimensions.js.map +1 -1
- package/lib/cjs/webchat/index-types.d.ts +1 -1
- package/lib/cjs/webchat/input-panel/attachment.js.map +1 -1
- package/lib/cjs/webchat/input-panel/emoji-picker.js +2 -0
- package/lib/cjs/webchat/input-panel/emoji-picker.js.map +1 -1
- package/lib/cjs/webchat/input-panel/index.d.ts +1 -1
- package/lib/cjs/webchat/input-panel/index.js +4 -2
- package/lib/cjs/webchat/input-panel/index.js.map +1 -1
- package/lib/cjs/webchat/input-panel/persistent-menu.js +2 -0
- package/lib/cjs/webchat/input-panel/persistent-menu.js.map +1 -1
- package/lib/cjs/webchat/input-panel/send-button.js +2 -0
- package/lib/cjs/webchat/input-panel/send-button.js.map +1 -1
- package/lib/cjs/webchat/input-panel/textarea.d.ts +1 -1
- package/lib/cjs/webchat/input-panel/textarea.js +10 -5
- package/lib/cjs/webchat/input-panel/textarea.js.map +1 -1
- package/lib/cjs/webchat/message-list/index.js.map +1 -1
- package/lib/cjs/webchat/message-list/intro-message.js.map +1 -1
- package/lib/cjs/webchat/message-list/scroll-button.js +2 -1
- package/lib/cjs/webchat/message-list/scroll-button.js.map +1 -1
- package/lib/cjs/webchat/message-list/unread-messages-banner.d.ts +2 -1
- package/lib/cjs/webchat/message-list/unread-messages-banner.js.map +1 -1
- package/lib/cjs/webchat/replies/index.js +1 -1
- package/lib/cjs/webchat/replies/index.js.map +1 -1
- package/lib/cjs/webchat/session-view.js +0 -2
- package/lib/cjs/webchat/session-view.js.map +1 -1
- package/lib/cjs/webchat/theme/default-theme.d.ts +1 -1
- package/lib/cjs/webchat/theme/types.d.ts +1 -1
- package/lib/cjs/webchat/tracking.d.ts +1 -1
- package/lib/cjs/webchat/trigger-button/index.js +2 -0
- package/lib/cjs/webchat/trigger-button/index.js.map +1 -1
- package/lib/cjs/webchat/typing-indicator/index.d.ts +1 -2
- package/lib/cjs/webchat/typing-indicator/index.js.map +1 -1
- package/lib/cjs/webchat/utils.d.ts +1 -1
- package/lib/cjs/webchat/utils.js +2 -1
- package/lib/cjs/webchat/utils.js.map +1 -1
- package/lib/cjs/webchat/webchat-dev.d.ts +2 -3
- package/lib/cjs/webchat/webchat-dev.js +1 -2
- package/lib/cjs/webchat/webchat-dev.js.map +1 -1
- package/lib/cjs/webchat/webchat.d.ts +2 -3
- package/lib/cjs/webchat/webchat.js +72 -45
- package/lib/cjs/webchat/webchat.js.map +1 -1
- package/lib/cjs/webchat/webview/header.js.map +1 -1
- package/lib/cjs/webchat/webview/index.d.ts +1 -1
- package/lib/cjs/webchat/webview/index.js.map +1 -1
- package/lib/cjs/webchat/webview/styles.js.map +1 -1
- package/lib/cjs/webchat-app.d.ts +6 -6
- package/lib/cjs/webchat-app.js +25 -22
- package/lib/cjs/webchat-app.js.map +1 -1
- package/lib/cjs/webview-app.js +7 -4
- package/lib/cjs/webview-app.js.map +1 -1
- package/lib/esm/botonic-tester.js +0 -1
- package/lib/esm/botonic-tester.js.map +1 -1
- package/lib/esm/components/audio.d.ts +1 -1
- package/lib/esm/components/audio.js +2 -1
- package/lib/esm/components/audio.js.map +1 -1
- package/lib/esm/components/button/index.d.ts +1 -1
- package/lib/esm/components/button/index.js +5 -8
- package/lib/esm/components/button/index.js.map +1 -1
- package/lib/esm/components/buttons-disabler.d.ts +2 -2
- package/lib/esm/components/buttons-disabler.js +12 -6
- package/lib/esm/components/buttons-disabler.js.map +1 -1
- package/lib/esm/components/carousel.d.ts +1 -1
- package/lib/esm/components/carousel.js +5 -4
- package/lib/esm/components/carousel.js.map +1 -1
- package/lib/esm/components/custom-message.d.ts +1 -1
- package/lib/esm/components/custom-message.js +1 -2
- package/lib/esm/components/custom-message.js.map +1 -1
- package/lib/esm/components/document.d.ts +1 -1
- package/lib/esm/components/document.js +2 -1
- package/lib/esm/components/document.js.map +1 -1
- package/lib/esm/components/element.d.ts +1 -1
- package/lib/esm/components/element.js +7 -5
- package/lib/esm/components/element.js.map +1 -1
- package/lib/esm/components/handoff.d.ts +1 -1
- package/lib/esm/components/handoff.js +2 -2
- package/lib/esm/components/handoff.js.map +1 -1
- package/lib/esm/components/image.d.ts +1 -1
- package/lib/esm/components/image.js.map +1 -1
- package/lib/esm/components/index-types.d.ts +2 -2
- package/lib/esm/components/location.js +2 -3
- package/lib/esm/components/location.js.map +1 -1
- package/lib/esm/components/markdown.d.ts +1 -1
- package/lib/esm/components/markdown.js +24 -16
- package/lib/esm/components/markdown.js.map +1 -1
- package/lib/esm/components/message/index.js +25 -20
- package/lib/esm/components/message/index.js.map +1 -1
- package/lib/esm/components/message/message-feedback.js.map +1 -1
- package/lib/esm/components/message/message-footer.js.map +1 -1
- package/lib/esm/components/message/message-image.js.map +1 -1
- package/lib/esm/components/message/timestamps.js +1 -1
- package/lib/esm/components/message/timestamps.js.map +1 -1
- package/lib/esm/components/message-template.js +3 -4
- package/lib/esm/components/message-template.js.map +1 -1
- package/lib/esm/components/multichannel/facebook/facebook.js +3 -2
- package/lib/esm/components/multichannel/facebook/facebook.js.map +1 -1
- package/lib/esm/components/multichannel/multichannel-button.js +6 -6
- package/lib/esm/components/multichannel/multichannel-button.js.map +1 -1
- package/lib/esm/components/multichannel/multichannel-carousel.js +11 -7
- package/lib/esm/components/multichannel/multichannel-carousel.js.map +1 -1
- package/lib/esm/components/multichannel/multichannel-reply.js +3 -3
- package/lib/esm/components/multichannel/multichannel-reply.js.map +1 -1
- package/lib/esm/components/multichannel/multichannel-text.js +15 -9
- package/lib/esm/components/multichannel/multichannel-text.js.map +1 -1
- package/lib/esm/components/multichannel/multichannel-utils.js +8 -4
- package/lib/esm/components/multichannel/multichannel-utils.js.map +1 -1
- package/lib/esm/components/multichannel/multichannel.js +1 -2
- package/lib/esm/components/multichannel/multichannel.js.map +1 -1
- package/lib/esm/components/pic.js +1 -1
- package/lib/esm/components/pic.js.map +1 -1
- package/lib/esm/components/raw.js +3 -2
- package/lib/esm/components/raw.js.map +1 -1
- package/lib/esm/components/reply.d.ts +1 -1
- package/lib/esm/components/reply.js +6 -4
- package/lib/esm/components/reply.js.map +1 -1
- package/lib/esm/components/share-button.js +3 -4
- package/lib/esm/components/share-button.js.map +1 -1
- package/lib/esm/components/subtitle.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/debug-message.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/debug-message.js.map +1 -1
- package/lib/esm/components/system-debug-trace/events/ai-agent.d.ts +2 -2
- package/lib/esm/components/system-debug-trace/events/ai-agent.js.map +1 -1
- package/lib/esm/components/system-debug-trace/events/bot-action.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/events/bot-action.js.map +1 -1
- package/lib/esm/components/system-debug-trace/events/components/guardrail-item.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/events/components/sources-section.d.ts +2 -2
- package/lib/esm/components/system-debug-trace/events/components/sources-section.js +2 -1
- package/lib/esm/components/system-debug-trace/events/components/sources-section.js.map +1 -1
- package/lib/esm/components/system-debug-trace/events/conditional-channel.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/events/conditional-channel.js.map +1 -1
- package/lib/esm/components/system-debug-trace/events/conditional-country.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/events/conditional-country.js.map +1 -1
- package/lib/esm/components/system-debug-trace/events/conditional-custom.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/events/conditional-custom.js.map +1 -1
- package/lib/esm/components/system-debug-trace/events/conditional-queue-status.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/events/conditional-queue-status.js.map +1 -1
- package/lib/esm/components/system-debug-trace/events/fallback.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/events/fallback.js.map +1 -1
- package/lib/esm/components/system-debug-trace/events/handoff-success.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/events/handoff-success.js.map +1 -1
- package/lib/esm/components/system-debug-trace/events/keyword.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/events/keyword.js.map +1 -1
- package/lib/esm/components/system-debug-trace/events/knowledge-base.d.ts +2 -2
- package/lib/esm/components/system-debug-trace/events/knowledge-base.js.map +1 -1
- package/lib/esm/components/system-debug-trace/events/redirect-flow.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/events/redirect-flow.js.map +1 -1
- package/lib/esm/components/system-debug-trace/events/smart-intent.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/events/smart-intent.js.map +1 -1
- package/lib/esm/components/system-debug-trace/events/webview-action-triggered.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/events/webview-action-triggered.js.map +1 -1
- package/lib/esm/components/system-debug-trace/hooks/use-knowledge-base-info.d.ts +2 -2
- package/lib/esm/components/system-debug-trace/hooks/use-knowledge-base-info.js +2 -2
- package/lib/esm/components/system-debug-trace/hooks/use-knowledge-base-info.js.map +1 -1
- package/lib/esm/components/system-debug-trace/hooks/use-last-label-position.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/hooks/use-last-label-position.js +6 -3
- package/lib/esm/components/system-debug-trace/hooks/use-last-label-position.js.map +1 -1
- package/lib/esm/components/system-debug-trace/icons/arrow-progress.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/icons/arrow-progress.js +3 -1
- package/lib/esm/components/system-debug-trace/icons/arrow-progress.js.map +1 -1
- package/lib/esm/components/system-debug-trace/icons/brain.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/icons/brain.js +3 -1
- package/lib/esm/components/system-debug-trace/icons/brain.js.map +1 -1
- package/lib/esm/components/system-debug-trace/icons/caret-down.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/icons/caret-down.js +3 -1
- package/lib/esm/components/system-debug-trace/icons/caret-down.js.map +1 -1
- package/lib/esm/components/system-debug-trace/icons/caret-up.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/icons/caret-up.js +3 -1
- package/lib/esm/components/system-debug-trace/icons/caret-up.js.map +1 -1
- package/lib/esm/components/system-debug-trace/icons/circle-check.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/icons/circle-check.js +1 -0
- package/lib/esm/components/system-debug-trace/icons/circle-check.js.map +1 -1
- package/lib/esm/components/system-debug-trace/icons/code.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/icons/code.js +1 -0
- package/lib/esm/components/system-debug-trace/icons/code.js.map +1 -1
- package/lib/esm/components/system-debug-trace/icons/file-pdf.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/icons/file-pdf.js +3 -1
- package/lib/esm/components/system-debug-trace/icons/file-pdf.js.map +1 -1
- package/lib/esm/components/system-debug-trace/icons/file-word.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/icons/file-word.js +3 -1
- package/lib/esm/components/system-debug-trace/icons/file-word.js.map +1 -1
- package/lib/esm/components/system-debug-trace/icons/hand.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/icons/hand.js +3 -1
- package/lib/esm/components/system-debug-trace/icons/hand.js.map +1 -1
- package/lib/esm/components/system-debug-trace/icons/head-set.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/icons/head-set.js +3 -1
- package/lib/esm/components/system-debug-trace/icons/head-set.js.map +1 -1
- package/lib/esm/components/system-debug-trace/icons/life-ring.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/icons/life-ring.js +3 -1
- package/lib/esm/components/system-debug-trace/icons/life-ring.js.map +1 -1
- package/lib/esm/components/system-debug-trace/icons/link.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/icons/link.js +3 -1
- package/lib/esm/components/system-debug-trace/icons/link.js.map +1 -1
- package/lib/esm/components/system-debug-trace/icons/quote-right.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/icons/quote-right.js +3 -1
- package/lib/esm/components/system-debug-trace/icons/quote-right.js.map +1 -1
- package/lib/esm/components/system-debug-trace/icons/screwdriver-wrench.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/icons/screwdriver-wrench.js +3 -1
- package/lib/esm/components/system-debug-trace/icons/screwdriver-wrench.js.map +1 -1
- package/lib/esm/components/system-debug-trace/icons/split.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/icons/split.js +3 -1
- package/lib/esm/components/system-debug-trace/icons/split.js.map +1 -1
- package/lib/esm/components/system-debug-trace/icons/wand.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/icons/wand.js +3 -1
- package/lib/esm/components/system-debug-trace/icons/wand.js.map +1 -1
- package/lib/esm/components/system-debug-trace/icons/window-restore.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/icons/window-restore.js +3 -1
- package/lib/esm/components/system-debug-trace/icons/window-restore.js.map +1 -1
- package/lib/esm/components/system-debug-trace/index.js.map +1 -1
- package/lib/esm/components/system-debug-trace/types.d.ts +2 -2
- package/lib/esm/components/text.d.ts +1 -1
- package/lib/esm/components/text.js +8 -4
- package/lib/esm/components/text.js.map +1 -1
- package/lib/esm/components/title.d.ts +1 -1
- package/lib/esm/components/video.d.ts +1 -1
- package/lib/esm/components/video.js +2 -1
- package/lib/esm/components/video.js.map +1 -1
- package/lib/esm/components/webchat-settings.d.ts +3 -3
- package/lib/esm/components/webchat-settings.js +40 -35
- package/lib/esm/components/webchat-settings.js.map +1 -1
- package/lib/esm/components/whatsapp-button-list.js +1 -1
- package/lib/esm/components/whatsapp-button-list.js.map +1 -1
- package/lib/esm/components/whatsapp-catalog.js +1 -1
- package/lib/esm/components/whatsapp-catalog.js.map +1 -1
- package/lib/esm/components/whatsapp-cta-url-button.js +1 -1
- package/lib/esm/components/whatsapp-cta-url-button.js.map +1 -1
- package/lib/esm/components/whatsapp-interactive-media-carousel.js +1 -1
- package/lib/esm/components/whatsapp-interactive-media-carousel.js.map +1 -1
- package/lib/esm/components/whatsapp-media-carousel.js +1 -1
- package/lib/esm/components/whatsapp-media-carousel.js.map +1 -1
- package/lib/esm/components/whatsapp-product-carousel.js +1 -1
- package/lib/esm/components/whatsapp-product-carousel.js.map +1 -1
- package/lib/esm/components/whatsapp-product-list.js +1 -1
- package/lib/esm/components/whatsapp-product-list.js.map +1 -1
- package/lib/esm/components/whatsapp-product.js +1 -1
- package/lib/esm/components/whatsapp-product.js.map +1 -1
- package/lib/esm/components/whatsapp-template/index.js +1 -1
- package/lib/esm/components/whatsapp-template/index.js.map +1 -1
- package/lib/esm/contexts.d.ts +2 -2
- package/lib/esm/dev-app.js +4 -7
- package/lib/esm/dev-app.js.map +1 -1
- package/lib/esm/index-types.d.ts +7 -7
- package/lib/esm/message-utils.js +2 -1
- package/lib/esm/message-utils.js.map +1 -1
- package/lib/esm/msg-to-botonic.d.ts +0 -1
- package/lib/esm/msg-to-botonic.js +16 -15
- package/lib/esm/msg-to-botonic.js.map +1 -1
- package/lib/esm/react-bot.d.ts +2 -2
- package/lib/esm/util/dom.js +3 -3
- package/lib/esm/util/dom.js.map +1 -1
- package/lib/esm/util/environment.d.ts +1 -1
- package/lib/esm/util/environment.js +17 -12
- package/lib/esm/util/environment.js.map +1 -1
- package/lib/esm/util/error-boundary.js +4 -5
- package/lib/esm/util/error-boundary.js.map +1 -1
- package/lib/esm/util/logs.js +2 -1
- package/lib/esm/util/logs.js.map +1 -1
- package/lib/esm/util/objects.js +4 -3
- package/lib/esm/util/objects.js.map +1 -1
- package/lib/esm/util/react.js +6 -3
- package/lib/esm/util/react.js.map +1 -1
- package/lib/esm/util/regexs.js +3 -2
- package/lib/esm/util/regexs.js.map +1 -1
- package/lib/esm/util/webchat.d.ts +2 -2
- package/lib/esm/util/webchat.js +13 -7
- package/lib/esm/util/webchat.js.map +1 -1
- package/lib/esm/webchat/chat-area/index.js.map +1 -1
- package/lib/esm/webchat/components/common.js +0 -1
- package/lib/esm/webchat/components/common.js.map +1 -1
- package/lib/esm/webchat/components/conditional-animation.js +1 -2
- package/lib/esm/webchat/components/conditional-animation.js.map +1 -1
- package/lib/esm/webchat/components/opened-persistent-menu.js +4 -2
- package/lib/esm/webchat/components/opened-persistent-menu.js.map +1 -1
- package/lib/esm/webchat/context/index.d.ts +1 -1
- package/lib/esm/webchat/context/messages-reducer.d.ts +1 -1
- package/lib/esm/webchat/context/messages-reducer.js +2 -2
- package/lib/esm/webchat/context/messages-reducer.js.map +1 -1
- package/lib/esm/webchat/context/types.d.ts +5 -5
- package/lib/esm/webchat/context/use-webchat.d.ts +6 -6
- package/lib/esm/webchat/context/use-webchat.js.map +1 -1
- package/lib/esm/webchat/context/webchat-reducer.d.ts +1 -1
- package/lib/esm/webchat/cover-component/index.js.map +1 -1
- package/lib/esm/webchat/custom-messages/rating/icons/face-angry.d.ts +2 -1
- package/lib/esm/webchat/custom-messages/rating/icons/face-angry.js.map +1 -1
- package/lib/esm/webchat/custom-messages/rating/icons/face-frown.d.ts +2 -1
- package/lib/esm/webchat/custom-messages/rating/icons/face-frown.js.map +1 -1
- package/lib/esm/webchat/custom-messages/rating/icons/face-grin-beam.d.ts +2 -1
- package/lib/esm/webchat/custom-messages/rating/icons/face-grin-beam.js.map +1 -1
- package/lib/esm/webchat/custom-messages/rating/icons/face-meh.d.ts +2 -1
- package/lib/esm/webchat/custom-messages/rating/icons/face-meh.js.map +1 -1
- package/lib/esm/webchat/custom-messages/rating/icons/face-smile.d.ts +2 -1
- package/lib/esm/webchat/custom-messages/rating/icons/face-smile.js.map +1 -1
- package/lib/esm/webchat/custom-messages/rating/icons/star.d.ts +2 -1
- package/lib/esm/webchat/custom-messages/rating/icons/star.js.map +1 -1
- package/lib/esm/webchat/custom-messages/rating/index.js +2 -1
- package/lib/esm/webchat/custom-messages/rating/index.js.map +1 -1
- package/lib/esm/webchat/custom-messages/rating/rating-selector.js +5 -2
- package/lib/esm/webchat/custom-messages/rating/rating-selector.js.map +1 -1
- package/lib/esm/webchat/custom-messages/rating/smileys.d.ts +1 -1
- package/lib/esm/webchat/custom-messages/rating/smileys.js.map +1 -1
- package/lib/esm/webchat/custom-messages/rating/stars.d.ts +1 -1
- package/lib/esm/webchat/custom-messages/rating/stars.js.map +1 -1
- package/lib/esm/webchat/header/default-header.js +1 -1
- package/lib/esm/webchat/header/default-header.js.map +1 -1
- package/lib/esm/webchat/header/index.d.ts +1 -2
- package/lib/esm/webchat/header/index.js.map +1 -1
- package/lib/esm/webchat/hooks/use-device-adapter.d.ts +1 -1
- package/lib/esm/webchat/hooks/use-device-adapter.js +8 -5
- package/lib/esm/webchat/hooks/use-device-adapter.js.map +1 -1
- package/lib/esm/webchat/hooks/use-scroll-to-bottom.js +4 -2
- package/lib/esm/webchat/hooks/use-scroll-to-bottom.js.map +1 -1
- package/lib/esm/webchat/hooks/use-scrollbar-controller.js +15 -11
- package/lib/esm/webchat/hooks/use-scrollbar-controller.js.map +1 -1
- package/lib/esm/webchat/hooks/use-typing.d.ts +2 -2
- package/lib/esm/webchat/hooks/use-typing.js +11 -6
- package/lib/esm/webchat/hooks/use-typing.js.map +1 -1
- package/lib/esm/webchat/hooks/use-virtual-keyboard-detection.d.ts +1 -1
- package/lib/esm/webchat/hooks/use-virtual-keyboard-detection.js +3 -5
- package/lib/esm/webchat/hooks/use-virtual-keyboard-detection.js.map +1 -1
- package/lib/esm/webchat/hooks/use-webchat-dimensions.js +5 -4
- package/lib/esm/webchat/hooks/use-webchat-dimensions.js.map +1 -1
- package/lib/esm/webchat/index-types.d.ts +1 -1
- package/lib/esm/webchat/input-panel/attachment.js.map +1 -1
- package/lib/esm/webchat/input-panel/emoji-picker.js +2 -0
- package/lib/esm/webchat/input-panel/emoji-picker.js.map +1 -1
- package/lib/esm/webchat/input-panel/index.d.ts +1 -1
- package/lib/esm/webchat/input-panel/index.js +4 -2
- package/lib/esm/webchat/input-panel/index.js.map +1 -1
- package/lib/esm/webchat/input-panel/persistent-menu.js +2 -0
- package/lib/esm/webchat/input-panel/persistent-menu.js.map +1 -1
- package/lib/esm/webchat/input-panel/send-button.js +2 -0
- package/lib/esm/webchat/input-panel/send-button.js.map +1 -1
- package/lib/esm/webchat/input-panel/textarea.d.ts +1 -1
- package/lib/esm/webchat/input-panel/textarea.js +10 -5
- package/lib/esm/webchat/input-panel/textarea.js.map +1 -1
- package/lib/esm/webchat/message-list/index.js.map +1 -1
- package/lib/esm/webchat/message-list/intro-message.js.map +1 -1
- package/lib/esm/webchat/message-list/scroll-button.js +2 -1
- package/lib/esm/webchat/message-list/scroll-button.js.map +1 -1
- package/lib/esm/webchat/message-list/unread-messages-banner.d.ts +2 -1
- package/lib/esm/webchat/message-list/unread-messages-banner.js.map +1 -1
- package/lib/esm/webchat/replies/index.js +1 -1
- package/lib/esm/webchat/replies/index.js.map +1 -1
- package/lib/esm/webchat/session-view.js +0 -2
- package/lib/esm/webchat/session-view.js.map +1 -1
- package/lib/esm/webchat/theme/default-theme.d.ts +1 -1
- package/lib/esm/webchat/theme/types.d.ts +1 -1
- package/lib/esm/webchat/tracking.d.ts +1 -1
- package/lib/esm/webchat/trigger-button/index.js +2 -0
- package/lib/esm/webchat/trigger-button/index.js.map +1 -1
- package/lib/esm/webchat/typing-indicator/index.d.ts +1 -2
- package/lib/esm/webchat/typing-indicator/index.js.map +1 -1
- package/lib/esm/webchat/utils.d.ts +1 -1
- package/lib/esm/webchat/utils.js +2 -1
- package/lib/esm/webchat/utils.js.map +1 -1
- package/lib/esm/webchat/webchat-dev.d.ts +2 -3
- package/lib/esm/webchat/webchat-dev.js +1 -2
- package/lib/esm/webchat/webchat-dev.js.map +1 -1
- package/lib/esm/webchat/webchat.d.ts +2 -3
- package/lib/esm/webchat/webchat.js +72 -45
- package/lib/esm/webchat/webchat.js.map +1 -1
- package/lib/esm/webchat/webview/header.js.map +1 -1
- package/lib/esm/webchat/webview/index.d.ts +1 -1
- package/lib/esm/webchat/webview/index.js.map +1 -1
- package/lib/esm/webchat/webview/styles.js.map +1 -1
- package/lib/esm/webchat-app.d.ts +6 -6
- package/lib/esm/webchat-app.js +25 -22
- package/lib/esm/webchat-app.js.map +1 -1
- package/lib/esm/webview-app.js +7 -4
- package/lib/esm/webview-app.js.map +1 -1
- package/package.json +5 -5
- package/src/botonic-tester.jsx +0 -1
- package/src/components/audio.tsx +3 -3
- package/src/components/button/index.tsx +7 -10
- package/src/components/buttons-disabler.ts +16 -8
- package/src/components/carousel.tsx +8 -8
- package/src/components/custom-message.tsx +2 -3
- package/src/components/document.tsx +4 -3
- package/src/components/element.tsx +10 -6
- package/src/components/handoff.jsx +2 -2
- package/src/components/image.tsx +2 -2
- package/src/components/index-types.ts +2 -2
- package/src/components/location.jsx +0 -1
- package/src/components/markdown.js +26 -22
- package/src/components/message/index.jsx +72 -64
- package/src/components/message/message-feedback.tsx +1 -1
- package/src/components/message/message-footer.tsx +1 -1
- package/src/components/message/message-image.tsx +1 -1
- package/src/components/message/timestamps.tsx +2 -1
- package/src/components/message-template.jsx +1 -2
- package/src/components/multichannel/facebook/facebook.jsx +3 -3
- package/src/components/multichannel/multichannel-button.jsx +7 -5
- package/src/components/multichannel/multichannel-carousel.jsx +16 -6
- package/src/components/multichannel/multichannel-reply.jsx +4 -2
- package/src/components/multichannel/multichannel-text.jsx +17 -9
- package/src/components/multichannel/multichannel-utils.ts +12 -4
- package/src/components/multichannel/multichannel.jsx +1 -1
- package/src/components/pic.tsx +1 -2
- package/src/components/raw.jsx +3 -2
- package/src/components/reply.tsx +11 -7
- package/src/components/share-button.jsx +1 -2
- package/src/components/subtitle.tsx +1 -1
- package/src/components/system-debug-trace/debug-message.tsx +3 -2
- package/src/components/system-debug-trace/events/ai-agent.tsx +3 -3
- package/src/components/system-debug-trace/events/bot-action.tsx +1 -2
- package/src/components/system-debug-trace/events/components/guardrail-item.tsx +1 -1
- package/src/components/system-debug-trace/events/components/sources-section.tsx +5 -3
- package/src/components/system-debug-trace/events/conditional-channel.tsx +1 -2
- package/src/components/system-debug-trace/events/conditional-country.tsx +1 -2
- package/src/components/system-debug-trace/events/conditional-custom.tsx +1 -2
- package/src/components/system-debug-trace/events/conditional-queue-status.tsx +1 -2
- package/src/components/system-debug-trace/events/fallback.tsx +1 -2
- package/src/components/system-debug-trace/events/handoff-success.tsx +2 -2
- package/src/components/system-debug-trace/events/keyword.tsx +1 -2
- package/src/components/system-debug-trace/events/knowledge-base.tsx +3 -3
- package/src/components/system-debug-trace/events/redirect-flow.tsx +1 -2
- package/src/components/system-debug-trace/events/smart-intent.tsx +1 -2
- package/src/components/system-debug-trace/events/webview-action-triggered.tsx +1 -2
- package/src/components/system-debug-trace/hooks/use-knowledge-base-info.tsx +9 -5
- package/src/components/system-debug-trace/hooks/use-last-label-position.ts +10 -4
- package/src/components/system-debug-trace/icons/arrow-progress.tsx +2 -3
- package/src/components/system-debug-trace/icons/brain.tsx +2 -3
- package/src/components/system-debug-trace/icons/caret-down.tsx +2 -3
- package/src/components/system-debug-trace/icons/caret-up.tsx +2 -3
- package/src/components/system-debug-trace/icons/circle-check.tsx +2 -3
- package/src/components/system-debug-trace/icons/code.tsx +2 -3
- package/src/components/system-debug-trace/icons/file-pdf.tsx +2 -3
- package/src/components/system-debug-trace/icons/file-word.tsx +2 -3
- package/src/components/system-debug-trace/icons/hand.tsx +2 -3
- package/src/components/system-debug-trace/icons/head-set.tsx +2 -3
- package/src/components/system-debug-trace/icons/life-ring.tsx +2 -3
- package/src/components/system-debug-trace/icons/link.tsx +2 -3
- package/src/components/system-debug-trace/icons/quote-right.tsx +2 -3
- package/src/components/system-debug-trace/icons/screwdriver-wrench.tsx +2 -3
- package/src/components/system-debug-trace/icons/split.tsx +2 -3
- package/src/components/system-debug-trace/icons/wand.tsx +2 -3
- package/src/components/system-debug-trace/icons/window-restore.tsx +2 -3
- package/src/components/system-debug-trace/index.tsx +0 -1
- package/src/components/system-debug-trace/types.ts +2 -2
- package/src/components/text.tsx +11 -6
- package/src/components/title.tsx +1 -1
- package/src/components/video.tsx +3 -3
- package/src/components/webchat-settings.tsx +51 -40
- package/src/components/whatsapp-button-list.tsx +1 -2
- package/src/components/whatsapp-catalog.tsx +1 -2
- package/src/components/whatsapp-cta-url-button.tsx +1 -2
- package/src/components/whatsapp-interactive-media-carousel.tsx +5 -4
- package/src/components/whatsapp-media-carousel.tsx +1 -2
- package/src/components/whatsapp-product-carousel.tsx +1 -2
- package/src/components/whatsapp-product-list.tsx +1 -2
- package/src/components/whatsapp-product.tsx +1 -2
- package/src/components/whatsapp-template/index.tsx +1 -2
- package/src/contexts.tsx +2 -2
- package/src/dev-app.jsx +4 -6
- package/src/index-types.ts +9 -9
- package/src/message-utils.js +3 -1
- package/src/msg-to-botonic.jsx +19 -20
- package/src/react-bot.tsx +2 -2
- package/src/util/dom.js +3 -3
- package/src/util/environment.js +18 -8
- package/src/util/error-boundary.jsx +4 -4
- package/src/util/logs.js +2 -1
- package/src/util/objects.js +5 -3
- package/src/util/react.js +8 -3
- package/src/util/regexs.js +4 -2
- package/src/util/webchat.ts +20 -9
- package/src/webchat/chat-area/index.tsx +1 -1
- package/src/webchat/components/common.jsx +0 -1
- package/src/webchat/components/conditional-animation.jsx +1 -1
- package/src/webchat/components/opened-persistent-menu.jsx +4 -2
- package/src/webchat/context/index.tsx +3 -3
- package/src/webchat/context/messages-reducer.ts +3 -5
- package/src/webchat/context/types.ts +5 -5
- package/src/webchat/context/use-webchat.ts +11 -6
- package/src/webchat/context/webchat-reducer.ts +1 -1
- package/src/webchat/cover-component/index.tsx +1 -1
- package/src/webchat/custom-messages/rating/icons/face-angry.tsx +2 -3
- package/src/webchat/custom-messages/rating/icons/face-frown.tsx +2 -3
- package/src/webchat/custom-messages/rating/icons/face-grin-beam.tsx +2 -3
- package/src/webchat/custom-messages/rating/icons/face-meh.tsx +2 -3
- package/src/webchat/custom-messages/rating/icons/face-smile.tsx +2 -3
- package/src/webchat/custom-messages/rating/icons/star.tsx +2 -3
- package/src/webchat/custom-messages/rating/index.tsx +7 -4
- package/src/webchat/custom-messages/rating/rating-selector.tsx +7 -3
- package/src/webchat/custom-messages/rating/smileys.tsx +1 -3
- package/src/webchat/custom-messages/rating/stars.tsx +1 -3
- package/src/webchat/header/default-header.tsx +2 -2
- package/src/webchat/header/index.tsx +1 -1
- package/src/webchat/hooks/use-device-adapter.ts +17 -4
- package/src/webchat/hooks/use-scroll-to-bottom.ts +6 -2
- package/src/webchat/hooks/use-scrollbar-controller.ts +18 -11
- package/src/webchat/hooks/use-typing.ts +14 -8
- package/src/webchat/hooks/use-virtual-keyboard-detection.ts +4 -5
- package/src/webchat/hooks/use-webchat-dimensions.ts +7 -5
- package/src/webchat/index-types.ts +1 -1
- package/src/webchat/input-panel/attachment.tsx +1 -1
- package/src/webchat/input-panel/emoji-picker.tsx +3 -1
- package/src/webchat/input-panel/index.tsx +8 -3
- package/src/webchat/input-panel/opened-emoji-picker.tsx +1 -1
- package/src/webchat/input-panel/persistent-menu.tsx +3 -1
- package/src/webchat/input-panel/send-button.tsx +3 -1
- package/src/webchat/input-panel/textarea.tsx +16 -7
- package/src/webchat/message-list/index.tsx +1 -1
- package/src/webchat/message-list/intro-message.tsx +1 -1
- package/src/webchat/message-list/scroll-button.tsx +8 -11
- package/src/webchat/message-list/unread-messages-banner.tsx +3 -1
- package/src/webchat/replies/index.tsx +2 -2
- package/src/webchat/session-view.jsx +0 -2
- package/src/webchat/theme/default-theme.ts +1 -1
- package/src/webchat/theme/types.ts +1 -1
- package/src/webchat/tracking.ts +2 -2
- package/src/webchat/trigger-button/index.tsx +3 -1
- package/src/webchat/typing-indicator/index.tsx +1 -1
- package/src/webchat/utils.ts +4 -2
- package/src/webchat/webchat-dev.jsx +1 -2
- package/src/webchat/webchat.tsx +99 -49
- package/src/webchat/webview/header.tsx +1 -1
- package/src/webchat/webview/index.tsx +7 -6
- package/src/webchat/webview/styles.ts +1 -1
- package/src/webchat-app.tsx +46 -38
- package/src/webview-app.tsx +12 -6
package/src/util/react.js
CHANGED
|
@@ -7,15 +7,20 @@ export const ConditionalWrapper = ({ condition, wrapper, children }) =>
|
|
|
7
7
|
condition ? wrapper(children) : children
|
|
8
8
|
|
|
9
9
|
export function renderComponent({ renderBrowser, renderNode }) {
|
|
10
|
-
if (isBrowser())
|
|
11
|
-
|
|
10
|
+
if (isBrowser()) {
|
|
11
|
+
return renderBrowser()
|
|
12
|
+
} else if (isNode()) {
|
|
13
|
+
return renderNode()
|
|
14
|
+
}
|
|
12
15
|
throw new Error('Unexpected process type. Not recognized as browser nor node')
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
export const mapObjectNonBooleanValues = obj => {
|
|
16
19
|
// to avoid React SSR warnings: https://github.com/styled-components/styled-components/issues/1198#issue-262022540
|
|
17
20
|
return mapObject(obj, ([key, value]) => {
|
|
18
|
-
if (typeof value === 'boolean')
|
|
21
|
+
if (typeof value === 'boolean') {
|
|
22
|
+
return [key, Number(value)]
|
|
23
|
+
}
|
|
19
24
|
return [key, value]
|
|
20
25
|
})
|
|
21
26
|
}
|
package/src/util/regexs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const deserializeRegex = regexStr => {
|
|
2
2
|
/* eslint-disable no-useless-escape */
|
|
3
|
-
const fragments = regexStr.match(/\/(.[
|
|
3
|
+
const fragments = regexStr.match(/\/(.[^/]+)\/([a-z]{1})?$/i) // https://stackoverflow.com/a/33642463, https://github.com/hubtype/botonic/pull/805#discussion_r437309074
|
|
4
4
|
const deserialized = new RegExp(fragments[1], fragments[2] || '')
|
|
5
5
|
return deserialized
|
|
6
6
|
}
|
|
@@ -10,7 +10,9 @@ export const deserializeRegex = regexStr => {
|
|
|
10
10
|
*/
|
|
11
11
|
export const stringifyWithRegexs = object => {
|
|
12
12
|
return JSON.stringify(object, (_, value) => {
|
|
13
|
-
if (value instanceof RegExp)
|
|
13
|
+
if (value instanceof RegExp) {
|
|
14
|
+
return value.toString()
|
|
15
|
+
}
|
|
14
16
|
return value
|
|
15
17
|
})
|
|
16
18
|
}
|
package/src/util/webchat.ts
CHANGED
|
@@ -3,8 +3,8 @@ import UAParser from 'ua-parser-js'
|
|
|
3
3
|
import { v7 as uuidv7 } from 'uuid'
|
|
4
4
|
|
|
5
5
|
import { WEBCHAT } from '../constants'
|
|
6
|
-
import { ClientUser } from '../webchat/context/types'
|
|
7
|
-
import { WebchatTheme } from '../webchat/theme/types'
|
|
6
|
+
import type { ClientUser } from '../webchat/context/types'
|
|
7
|
+
import type { WebchatTheme } from '../webchat/theme/types'
|
|
8
8
|
import { getCountryFromTimeZone, normalizeLocale } from './i18n'
|
|
9
9
|
import { getProperty } from './objects'
|
|
10
10
|
|
|
@@ -18,9 +18,13 @@ export const _getThemeProperty =
|
|
|
18
18
|
for (const [key, value] of Object.entries(WEBCHAT.CUSTOM_PROPERTIES)) {
|
|
19
19
|
if (value === property) {
|
|
20
20
|
const nestedProperty = getProperty(theme, value)
|
|
21
|
-
if (nestedProperty !== undefined)
|
|
21
|
+
if (nestedProperty !== undefined) {
|
|
22
|
+
return nestedProperty
|
|
23
|
+
}
|
|
22
24
|
const plainProperty = getProperty(theme, key)
|
|
23
|
-
if (plainProperty !== undefined)
|
|
25
|
+
if (plainProperty !== undefined) {
|
|
26
|
+
return plainProperty
|
|
27
|
+
}
|
|
24
28
|
return defaultValue
|
|
25
29
|
}
|
|
26
30
|
}
|
|
@@ -34,7 +38,9 @@ export const createUser = (): {
|
|
|
34
38
|
const parser = new UAParser()
|
|
35
39
|
const ua = parser.getResult()
|
|
36
40
|
let name = `${ua.os.name} ${ua.browser.name}`
|
|
37
|
-
if (ua.device
|
|
41
|
+
if (ua.device?.type) {
|
|
42
|
+
name = `${ua.device.type} ${name}`
|
|
43
|
+
}
|
|
38
44
|
return {
|
|
39
45
|
id: uuidv7(),
|
|
40
46
|
name,
|
|
@@ -43,10 +49,13 @@ export const createUser = (): {
|
|
|
43
49
|
export const initSession = (
|
|
44
50
|
session: any
|
|
45
51
|
): { user: { id: string; name: string } } => {
|
|
46
|
-
if (!session)
|
|
52
|
+
if (!session) {
|
|
53
|
+
session = {}
|
|
54
|
+
}
|
|
47
55
|
const hasUserId = session?.user?.id !== undefined
|
|
48
|
-
if (!session.user || Object.keys(session.user).length === 0 || !hasUserId)
|
|
56
|
+
if (!session.user || Object.keys(session.user).length === 0 || !hasUserId) {
|
|
49
57
|
session.user = !hasUserId ? merge(session.user, createUser()) : createUser()
|
|
58
|
+
}
|
|
50
59
|
return session
|
|
51
60
|
}
|
|
52
61
|
|
|
@@ -90,11 +99,13 @@ function getSystemLocale(user: Partial<ClientUser>) {
|
|
|
90
99
|
export const shouldKeepSessionOnReload = ({
|
|
91
100
|
initialDevSettings,
|
|
92
101
|
devSettings,
|
|
93
|
-
}) => !initialDevSettings ||
|
|
102
|
+
}) => !initialDevSettings || devSettings?.keepSessionOnReload
|
|
94
103
|
|
|
95
104
|
//TODO: Review param serverConfig if is of type ServerConfig this never have errorMessage
|
|
96
105
|
export const getServerErrorMessage = serverConfig => {
|
|
97
|
-
if (!serverConfig || !serverConfig.errorMessage)
|
|
106
|
+
if (!serverConfig || !serverConfig.errorMessage) {
|
|
107
|
+
return 'Connection issues'
|
|
108
|
+
}
|
|
98
109
|
if (typeof serverConfig.errorMessage === 'function') {
|
|
99
110
|
return serverConfig.errorMessage()
|
|
100
111
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useContext } from 'react'
|
|
2
2
|
import styled from 'styled-components'
|
|
3
3
|
|
|
4
4
|
import { Button } from '../../components/button/index'
|
|
@@ -24,7 +24,9 @@ export const OpenedPersistentMenu = ({ onClick, options, borderRadius }) => {
|
|
|
24
24
|
try {
|
|
25
25
|
closeLabel = options.filter(opt => opt.closeLabel !== undefined)[0]
|
|
26
26
|
.closeLabel
|
|
27
|
-
} catch
|
|
27
|
+
} catch {
|
|
28
|
+
// do nothing
|
|
29
|
+
}
|
|
28
30
|
return (
|
|
29
31
|
<div ref={ref} role={ROLES.PERSISTENT_MENU}>
|
|
30
32
|
{isComponentVisible && CustomPersistentMenu ? (
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createContext } from 'react'
|
|
2
2
|
|
|
3
|
-
import { ChunkIdsGroupedBySourceData } from '../../components/system-debug-trace/events/knowledge-bases-types'
|
|
4
|
-
import { MinimalHubtypeMessage } from '../../index-types'
|
|
5
|
-
import { WebchatContextProps, WebchatState } from './types'
|
|
3
|
+
import type { ChunkIdsGroupedBySourceData } from '../../components/system-debug-trace/events/knowledge-bases-types'
|
|
4
|
+
import type { MinimalHubtypeMessage } from '../../index-types'
|
|
5
|
+
import type { WebchatContextProps, WebchatState } from './types'
|
|
6
6
|
|
|
7
7
|
export { ClientSession, WebchatState } from './types'
|
|
8
8
|
export { useWebchat } from './use-webchat'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SENDERS } from '../../index-types'
|
|
2
2
|
import { WebchatAction } from './actions'
|
|
3
|
-
import { WebchatState } from './types'
|
|
3
|
+
import type { WebchatState } from './types'
|
|
4
4
|
|
|
5
5
|
export const messagesReducer = (
|
|
6
6
|
state: WebchatState,
|
|
@@ -138,11 +138,9 @@ function addMessageReducer(
|
|
|
138
138
|
state: WebchatState,
|
|
139
139
|
action: { type: WebchatAction; payload?: any }
|
|
140
140
|
) {
|
|
141
|
-
if (
|
|
142
|
-
state.messagesJSON &&
|
|
143
|
-
state.messagesJSON.find(m => m.id === action.payload.id)
|
|
144
|
-
)
|
|
141
|
+
if (state.messagesJSON?.find(m => m.id === action.payload.id)) {
|
|
145
142
|
return state
|
|
143
|
+
}
|
|
146
144
|
return {
|
|
147
145
|
...state,
|
|
148
146
|
messagesJSON: [...(state.messagesJSON || []), action.payload],
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Input as CoreInput, Session as CoreSession } from '@botonic/core'
|
|
1
|
+
import type { Input as CoreInput, Session as CoreSession } from '@botonic/core'
|
|
2
2
|
|
|
3
|
-
import { Reply, WebchatSettingsProps, Webview } from '../../components'
|
|
4
|
-
import { CloseWebviewOptions } from '../../contexts'
|
|
5
|
-
import {
|
|
3
|
+
import type { Reply, WebchatSettingsProps, Webview } from '../../components'
|
|
4
|
+
import type { CloseWebviewOptions } from '../../contexts'
|
|
5
|
+
import type {
|
|
6
6
|
PreviewUtils,
|
|
7
7
|
TrackEventFunction,
|
|
8
8
|
WebchatMessage,
|
|
9
9
|
} from '../../index-types'
|
|
10
|
-
import { WebchatTheme } from '../theme/types'
|
|
10
|
+
import type { WebchatTheme } from '../theme/types'
|
|
11
11
|
|
|
12
12
|
export interface ErrorMessage {
|
|
13
13
|
message?: string
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import { Session } from '@botonic/core'
|
|
1
|
+
import type { Session } from '@botonic/core'
|
|
2
2
|
import { useReducer, useRef } from 'react'
|
|
3
3
|
|
|
4
|
-
import { Reply } from '../../components'
|
|
5
|
-
import { Webview } from '../../components/index-types'
|
|
6
|
-
import { WebchatMessage } from '../../index-types'
|
|
4
|
+
import type { Reply } from '../../components'
|
|
5
|
+
import type { Webview } from '../../components/index-types'
|
|
6
|
+
import type { WebchatMessage } from '../../index-types'
|
|
7
7
|
import { defaultTheme } from '../theme/default-theme'
|
|
8
|
-
import { WebchatTheme } from '../theme/types'
|
|
8
|
+
import type { WebchatTheme } from '../theme/types'
|
|
9
9
|
import { WebchatAction } from './actions'
|
|
10
|
-
import {
|
|
10
|
+
import type {
|
|
11
|
+
ClientInput,
|
|
12
|
+
DevSettings,
|
|
13
|
+
ErrorMessage,
|
|
14
|
+
WebchatState,
|
|
15
|
+
} from './types'
|
|
11
16
|
import { webchatReducer } from './webchat-reducer'
|
|
12
17
|
|
|
13
18
|
function getWebchatInitialState(initialTheme: WebchatTheme): WebchatState {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { RatingIconProps } from '../types'
|
|
1
|
+
/** biome-ignore-all lint/a11y/noSvgWithoutTitle: This is a SVG icon */
|
|
2
|
+
import type { RatingIconProps } from '../types'
|
|
4
3
|
|
|
5
4
|
export const FaceAngrySvg = ({ color, selected }: RatingIconProps) => {
|
|
6
5
|
return selected ? (
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { RatingIconProps } from '../types'
|
|
1
|
+
/** biome-ignore-all lint/a11y/noSvgWithoutTitle: This is a SVG icon */
|
|
2
|
+
import type { RatingIconProps } from '../types'
|
|
4
3
|
|
|
5
4
|
export const FaceFrownSvg = ({ color, selected }: RatingIconProps) => {
|
|
6
5
|
return selected ? (
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { RatingIconProps } from '../types'
|
|
1
|
+
/** biome-ignore-all lint/a11y/noSvgWithoutTitle: This is a SVG icon */
|
|
2
|
+
import type { RatingIconProps } from '../types'
|
|
4
3
|
|
|
5
4
|
export const FaceGrinBeamSvg = ({ color, selected }: RatingIconProps) => {
|
|
6
5
|
return selected ? (
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { RatingIconProps } from '../types'
|
|
1
|
+
/** biome-ignore-all lint/a11y/noSvgWithoutTitle: we don't need a title for the svg */
|
|
2
|
+
import type { RatingIconProps } from '../types'
|
|
4
3
|
|
|
5
4
|
export const FaceMehSvg = ({ color, selected }: RatingIconProps) => {
|
|
6
5
|
return selected ? (
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { RatingIconProps } from '../types'
|
|
1
|
+
/** biome-ignore-all lint/a11y/noSvgWithoutTitle: This is a SVG icon */
|
|
2
|
+
import type { RatingIconProps } from '../types'
|
|
4
3
|
|
|
5
4
|
export const FaceSmileSvg = ({ color, selected }: RatingIconProps) => {
|
|
6
5
|
return selected ? (
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { RatingIconProps } from '../types'
|
|
1
|
+
/** biome-ignore-all lint/a11y/noSvgWithoutTitle: This is a SVG icon */
|
|
2
|
+
import type { RatingIconProps } from '../types'
|
|
4
3
|
|
|
5
4
|
export const StarSvg = ({ color, selected }: RatingIconProps) => {
|
|
6
5
|
return selected ? (
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { INPUT, InputType } from '@botonic/core'
|
|
2
|
-
import React
|
|
1
|
+
import { INPUT, type InputType } from '@botonic/core'
|
|
2
|
+
import type React from 'react'
|
|
3
|
+
import { useContext, useState } from 'react'
|
|
3
4
|
import { ThemeContext } from 'styled-components'
|
|
4
5
|
|
|
5
6
|
import { Button, customMessage } from '../../../components'
|
|
6
7
|
import { WebchatContext } from '../../context'
|
|
7
8
|
import { RatingSelector } from './rating-selector'
|
|
8
9
|
import { MessageBubble } from './styles'
|
|
9
|
-
import { RatingType } from './types'
|
|
10
|
+
import type { RatingType } from './types'
|
|
10
11
|
|
|
11
12
|
interface CustomRatingMessageProps {
|
|
12
13
|
payloads: string[]
|
|
@@ -32,7 +33,9 @@ const CustomRatingMessage: React.FC<CustomRatingMessageProps> = props => {
|
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
const handleButtonSend = () => {
|
|
35
|
-
if (ratingValue === -1)
|
|
36
|
+
if (ratingValue === -1) {
|
|
37
|
+
return
|
|
38
|
+
}
|
|
36
39
|
|
|
37
40
|
const json = {
|
|
38
41
|
valueSent: ratingValue,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/** biome-ignore-all lint/a11y/noStaticElementInteractions: we need to use static elements for the rating selector */
|
|
2
|
+
/** biome-ignore-all lint/a11y/useKeyWithClickEvents: we need to use key with click events for the rating selector */
|
|
3
|
+
import { useState } from 'react'
|
|
2
4
|
|
|
3
5
|
import { Smileys } from './smileys'
|
|
4
6
|
import { Stars } from './stars'
|
|
@@ -26,7 +28,9 @@ export const RatingSelector = ({
|
|
|
26
28
|
const [hover, setHover] = useState<number>(valueSent ? valueSent : -1)
|
|
27
29
|
|
|
28
30
|
const onHover = (ratingNumber: number) => {
|
|
29
|
-
if (!valueSent)
|
|
31
|
+
if (!valueSent) {
|
|
32
|
+
setHover(ratingNumber)
|
|
33
|
+
}
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
return (
|
|
@@ -36,7 +40,7 @@ export const RatingSelector = ({
|
|
|
36
40
|
|
|
37
41
|
return (
|
|
38
42
|
<div
|
|
39
|
-
key={
|
|
43
|
+
key={ratingNumber}
|
|
40
44
|
onMouseEnter={() => onHover(ratingNumber)}
|
|
41
45
|
onMouseLeave={() => onHover(ratingValue)}
|
|
42
46
|
onClick={() => onRatingChange(ratingNumber)}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
1
|
import {
|
|
4
2
|
FaceAngrySvg,
|
|
5
3
|
FaceFrownSvg,
|
|
@@ -7,7 +5,7 @@ import {
|
|
|
7
5
|
FaceMehSvg,
|
|
8
6
|
FaceSmileSvg,
|
|
9
7
|
} from './icons'
|
|
10
|
-
import { RatingItemProps } from './types'
|
|
8
|
+
import type { RatingItemProps } from './types'
|
|
11
9
|
|
|
12
10
|
const SMILEY_MAP = {
|
|
13
11
|
1: FaceAngrySvg,
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
1
|
import { StarSvg } from './icons/index'
|
|
4
|
-
import { RatingItemProps } from './types'
|
|
2
|
+
import type { RatingItemProps } from './types'
|
|
5
3
|
|
|
6
4
|
export const Stars = ({ color, ratingNumber, hover }: RatingItemProps) => {
|
|
7
5
|
const isSelected = hover >= ratingNumber
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useContext } from 'react'
|
|
2
2
|
|
|
3
3
|
import { ROLES, WEBCHAT } from '../../constants'
|
|
4
4
|
import { Scale } from '../../shared/styles'
|
|
@@ -46,7 +46,7 @@ export const DefaultHeader = () => {
|
|
|
46
46
|
>
|
|
47
47
|
{headerImage && (
|
|
48
48
|
<ImageContainer>
|
|
49
|
-
<img src={resolveImage(headerImage)} />
|
|
49
|
+
<img src={resolveImage(headerImage)} alt='Header' />
|
|
50
50
|
</ImageContainer>
|
|
51
51
|
)}
|
|
52
52
|
<TextContainer>
|
|
@@ -6,9 +6,18 @@ import { useScrollbarController } from './use-scrollbar-controller'
|
|
|
6
6
|
import { useVirtualKeyboardDetection } from './use-virtual-keyboard-detection'
|
|
7
7
|
import { useWebchatResizer } from './use-webchat-resizer'
|
|
8
8
|
|
|
9
|
+
// To avoid type error using experimental new API supported by some browsers like Chrome but not in Safari
|
|
10
|
+
interface NavigatorWithUserAgentData extends Navigator {
|
|
11
|
+
userAgentData?: {
|
|
12
|
+
platform: string
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
9
16
|
function getCurrentDevice() {
|
|
10
|
-
|
|
11
|
-
if (
|
|
17
|
+
const nav = navigator as NavigatorWithUserAgentData
|
|
18
|
+
if (nav.userAgentData) {
|
|
19
|
+
return nav.userAgentData.platform
|
|
20
|
+
}
|
|
12
21
|
return navigator.platform
|
|
13
22
|
}
|
|
14
23
|
|
|
@@ -26,7 +35,9 @@ export const useDeviceAdapter = (host, isWebchatOpen) => {
|
|
|
26
35
|
const { handleScrollEvents } = useScrollbarController(currentDevice, host)
|
|
27
36
|
|
|
28
37
|
useEffect(() => {
|
|
29
|
-
if (currentDevice !== DEVICES.MOBILE.IPHONE)
|
|
38
|
+
if (currentDevice !== DEVICES.MOBILE.IPHONE) {
|
|
39
|
+
return
|
|
40
|
+
}
|
|
30
41
|
if (isVirtualKeyboardVisible) {
|
|
31
42
|
handleKeyboardShown()
|
|
32
43
|
scrollToBottom()
|
|
@@ -39,7 +50,9 @@ export const useDeviceAdapter = (host, isWebchatOpen) => {
|
|
|
39
50
|
|
|
40
51
|
useEffect(() => {
|
|
41
52
|
if (host && isWebchatOpen) {
|
|
42
|
-
if (currentDevice !== DEVICES.MOBILE.IPHONE)
|
|
53
|
+
if (currentDevice !== DEVICES.MOBILE.IPHONE) {
|
|
54
|
+
return
|
|
55
|
+
}
|
|
43
56
|
handleScrollEvents()
|
|
44
57
|
}
|
|
45
58
|
}, [host, isWebchatOpen, handleScrollEvents])
|
|
@@ -16,9 +16,13 @@ export const useScrollToBottom = ({
|
|
|
16
16
|
}: UseScrollToBottom) => {
|
|
17
17
|
const scrollToBottom = () => {
|
|
18
18
|
const webchatElement = getWebchatElement(host)
|
|
19
|
-
if (!webchatElement)
|
|
19
|
+
if (!webchatElement) {
|
|
20
|
+
return
|
|
21
|
+
}
|
|
20
22
|
const scrollableMessagesListElement = getScrollableMessagesListElement(host)
|
|
21
|
-
if (!scrollableMessagesListElement)
|
|
23
|
+
if (!scrollableMessagesListElement) {
|
|
24
|
+
return
|
|
25
|
+
}
|
|
22
26
|
|
|
23
27
|
setTimeout(() => {
|
|
24
28
|
scrollableMessagesListElement.scrollTo({
|
|
@@ -6,8 +6,8 @@ import { DEVICES, isMobileDevice } from '../devices'
|
|
|
6
6
|
// TODO: Investigate why when we have some messages, scroll actions are not disabled properly
|
|
7
7
|
|
|
8
8
|
const debounced = (delay, fn) => {
|
|
9
|
-
let timerId
|
|
10
|
-
return
|
|
9
|
+
let timerId: NodeJS.Timeout | null = null
|
|
10
|
+
return (...args) => {
|
|
11
11
|
if (timerId) {
|
|
12
12
|
clearTimeout(timerId)
|
|
13
13
|
}
|
|
@@ -19,9 +19,12 @@ const debounced = (delay, fn) => {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
const stopAtScrollLimit = element => {
|
|
22
|
-
if (element.scrollTop === 0)
|
|
23
|
-
|
|
22
|
+
if (element.scrollTop === 0) {
|
|
23
|
+
element.scrollTop = 1
|
|
24
|
+
}
|
|
25
|
+
if (element.scrollHeight - element.scrollTop === element.clientHeight) {
|
|
24
26
|
element.scrollTop -= 1
|
|
27
|
+
}
|
|
25
28
|
}
|
|
26
29
|
|
|
27
30
|
export const useScrollbarController = (currentDevice, host) => {
|
|
@@ -54,11 +57,11 @@ export const useScrollbarController = (currentDevice, host) => {
|
|
|
54
57
|
const toggleOnMouseWheelEvents = () => {
|
|
55
58
|
if (scrollableMessagesListRef.current) {
|
|
56
59
|
if (hasScrollbar()) {
|
|
57
|
-
// @ts-
|
|
60
|
+
// @ts-expect-error
|
|
58
61
|
scrollableMessagesListRef.current.onmousewheel = {}
|
|
59
62
|
return
|
|
60
63
|
}
|
|
61
|
-
// @ts-
|
|
64
|
+
// @ts-expect-error
|
|
62
65
|
scrollableMessagesListRef.current.onmousewheel = e => {
|
|
63
66
|
e.preventDefault()
|
|
64
67
|
}
|
|
@@ -105,21 +108,23 @@ export const useScrollbarController = (currentDevice, host) => {
|
|
|
105
108
|
}
|
|
106
109
|
|
|
107
110
|
const limitScrollBoundaries = () => {
|
|
108
|
-
if (currentDevice !== DEVICES.MOBILE.IPHONE)
|
|
111
|
+
if (currentDevice !== DEVICES.MOBILE.IPHONE) {
|
|
112
|
+
return
|
|
113
|
+
}
|
|
109
114
|
const chatArea = chatAreaRef.current
|
|
110
115
|
const dStopAtScrollLimit = debounced(100, stopAtScrollLimit)
|
|
111
116
|
|
|
112
117
|
if (chatArea) {
|
|
113
|
-
// @ts-
|
|
118
|
+
// @ts-expect-error
|
|
114
119
|
if (window.addEventListener) {
|
|
115
120
|
chatArea.addEventListener(
|
|
116
121
|
'scroll',
|
|
117
122
|
() => dStopAtScrollLimit(chatArea),
|
|
118
123
|
true
|
|
119
124
|
)
|
|
120
|
-
// @ts-
|
|
125
|
+
// @ts-expect-error
|
|
121
126
|
} else if (window.attachEvent) {
|
|
122
|
-
// @ts-
|
|
127
|
+
// @ts-expect-error
|
|
123
128
|
chatAreaRef.attachEvent('scroll', () => dStopAtScrollLimit(chatArea))
|
|
124
129
|
}
|
|
125
130
|
}
|
|
@@ -128,7 +133,9 @@ export const useScrollbarController = (currentDevice, host) => {
|
|
|
128
133
|
const handleScrollEvents = () => {
|
|
129
134
|
if (webchatContainerRef.current) {
|
|
130
135
|
if (isMobileDevice()) {
|
|
131
|
-
if (currentDevice !== DEVICES.MOBILE.IPHONE)
|
|
136
|
+
if (currentDevice !== DEVICES.MOBILE.IPHONE) {
|
|
137
|
+
return
|
|
138
|
+
}
|
|
132
139
|
|
|
133
140
|
limitScrollBoundaries()
|
|
134
141
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/* eslint-disable no-empty */
|
|
1
2
|
import { useEffect } from 'react'
|
|
2
3
|
|
|
3
|
-
import { WebchatMessage } from '../../index-types'
|
|
4
|
-
import { WebchatState } from '../context'
|
|
4
|
+
import type { WebchatMessage } from '../../index-types'
|
|
5
|
+
import type { WebchatState } from '../context'
|
|
5
6
|
|
|
6
7
|
interface UseTyping {
|
|
7
8
|
webchatState: WebchatState
|
|
@@ -16,7 +17,8 @@ export function useTyping({
|
|
|
16
17
|
updateMessage,
|
|
17
18
|
}: UseTyping): void {
|
|
18
19
|
useEffect(() => {
|
|
19
|
-
let delayTimeout
|
|
20
|
+
let delayTimeout: NodeJS.Timeout | null = null
|
|
21
|
+
let typingTimeout: NodeJS.Timeout | null = null
|
|
20
22
|
try {
|
|
21
23
|
const nextMsg = webchatState.messagesJSON.filter(m => !m.display)[0]
|
|
22
24
|
if (nextMsg) {
|
|
@@ -25,18 +27,22 @@ export function useTyping({
|
|
|
25
27
|
() => updateTyping(true),
|
|
26
28
|
nextMsg.delay * 1000
|
|
27
29
|
)
|
|
28
|
-
} else if (nextMsg.typing)
|
|
30
|
+
} else if (nextMsg.typing) {
|
|
31
|
+
updateTyping(true)
|
|
32
|
+
}
|
|
29
33
|
const totalDelay = nextMsg.delay + nextMsg.typing
|
|
30
|
-
if (totalDelay)
|
|
34
|
+
if (totalDelay) {
|
|
31
35
|
typingTimeout = setTimeout(() => {
|
|
32
36
|
updateMessage({ ...nextMsg, display: true })
|
|
33
37
|
updateTyping(false)
|
|
34
38
|
}, totalDelay * 1000)
|
|
39
|
+
}
|
|
35
40
|
}
|
|
36
|
-
|
|
41
|
+
// biome-ignore lint/suspicious/noEmptyBlockStatements: error is not used
|
|
42
|
+
} catch (_e) {}
|
|
37
43
|
return () => {
|
|
38
|
-
clearTimeout(delayTimeout)
|
|
39
|
-
clearTimeout(typingTimeout)
|
|
44
|
+
delayTimeout && clearTimeout(delayTimeout)
|
|
45
|
+
typingTimeout && clearTimeout(typingTimeout)
|
|
40
46
|
}
|
|
41
47
|
}, [webchatState.messagesJSON, webchatState.typing])
|
|
42
48
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react'
|
|
2
2
|
|
|
3
|
-
export const useVirtualKeyboardDetection = originalHeight => {
|
|
3
|
+
export const useVirtualKeyboardDetection = (originalHeight: number) => {
|
|
4
4
|
const [isVirtualKeyboardVisible, setIsVirtualKeyboardVisible] =
|
|
5
5
|
useState(false)
|
|
6
|
+
|
|
6
7
|
useEffect(() => {
|
|
7
8
|
const handleResize = () => {
|
|
8
9
|
if (window.visualViewport) {
|
|
@@ -14,12 +15,10 @@ export const useVirtualKeyboardDetection = originalHeight => {
|
|
|
14
15
|
return
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
|
-
window.visualViewport
|
|
18
|
-
window.visualViewport.addEventListener('resize', handleResize)
|
|
18
|
+
window.visualViewport?.addEventListener('resize', handleResize)
|
|
19
19
|
|
|
20
20
|
return () => {
|
|
21
|
-
window.visualViewport
|
|
22
|
-
window.visualViewport.removeEventListener('resize', handleResize)
|
|
21
|
+
window.visualViewport?.removeEventListener('resize', handleResize)
|
|
23
22
|
}
|
|
24
23
|
}, [originalHeight])
|
|
25
24
|
|