@botonic/react 0.44.1-alpha.3 → 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
|
@@ -13,7 +13,7 @@ const Textarea = ({ host, textareaRef, sendChatEvent, sendTextAreaText, }) => {
|
|
|
13
13
|
const { webchatState, setIsInputFocused } = (0, react_1.useContext)(context_1.WebchatContext);
|
|
14
14
|
(0, hooks_1.useDeviceAdapter)(host, webchatState.isWebchatOpen);
|
|
15
15
|
let isTyping = false;
|
|
16
|
-
let typingTimeout;
|
|
16
|
+
let typingTimeout = null;
|
|
17
17
|
const persistentMenuOptions = webchatState.theme.userInput?.persistentMenu;
|
|
18
18
|
const placeholder = webchatState.theme.userInput?.box?.placeholder;
|
|
19
19
|
const userInputBoxStyle = webchatState.theme.userInput?.box?.style;
|
|
@@ -25,8 +25,9 @@ const Textarea = ({ host, textareaRef, sendChatEvent, sendTextAreaText, }) => {
|
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
const onKeyUp = () => {
|
|
28
|
-
if (!textareaRef.current)
|
|
28
|
+
if (!textareaRef.current) {
|
|
29
29
|
return;
|
|
30
|
+
}
|
|
30
31
|
if (textareaRef.current.value === '') {
|
|
31
32
|
stopTyping();
|
|
32
33
|
return;
|
|
@@ -38,10 +39,12 @@ const Textarea = ({ host, textareaRef, sendChatEvent, sendTextAreaText, }) => {
|
|
|
38
39
|
};
|
|
39
40
|
const clearTimeoutWithReset = (reset) => {
|
|
40
41
|
const waitTime = 20 * 1000;
|
|
41
|
-
if (typingTimeout)
|
|
42
|
+
if (typingTimeout) {
|
|
42
43
|
clearTimeout(typingTimeout);
|
|
43
|
-
|
|
44
|
+
}
|
|
45
|
+
if (reset) {
|
|
44
46
|
typingTimeout = setTimeout(stopTyping, waitTime);
|
|
47
|
+
}
|
|
45
48
|
};
|
|
46
49
|
const startTyping = () => {
|
|
47
50
|
isTyping = true;
|
|
@@ -58,7 +61,9 @@ const Textarea = ({ host, textareaRef, sendChatEvent, sendTextAreaText, }) => {
|
|
|
58
61
|
const handleBlur = () => {
|
|
59
62
|
setIsInputFocused(false);
|
|
60
63
|
};
|
|
61
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.TextAreaContainer, { children: (0, jsx_runtime_1.jsx)(react_textarea_autosize_1.default, { ref: (ref) =>
|
|
64
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.TextAreaContainer, { children: (0, jsx_runtime_1.jsx)(react_textarea_autosize_1.default, { ref: (ref) => {
|
|
65
|
+
textareaRef.current = ref;
|
|
66
|
+
}, onFocus: handleFocus, onBlur: handleBlur, name: 'text', maxRows: 4, wrap: 'soft', maxLength: 1000, placeholder: placeholder, autoFocus: false, onKeyDown: e => onKeyDown(e), onKeyUp: onKeyUp, style: {
|
|
62
67
|
display: 'flex',
|
|
63
68
|
fontSize: 16,
|
|
64
69
|
width: '100%',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../../../src/webchat/input-panel/textarea.tsx"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../../../src/webchat/input-panel/textarea.tsx"],"names":[],"mappings":";;;;;AAEA,iCAAkC;AAClC,8FAAsD;AAEtD,mDAA0C;AAC1C,mDAAsD;AACtD,oCAA2C;AAC3C,qCAA4C;AASrC,MAAM,QAAQ,GAAG,CAAC,EACvB,IAAI,EACJ,WAAW,EACX,aAAa,EACb,gBAAgB,GACF,EAAE,EAAE;IAClB,MAAM,EAAE,YAAY,EAAE,iBAAiB,EAAE,GAAG,IAAA,kBAAU,EAAC,wBAAc,CAAC,CAAA;IAEtE,IAAA,wBAAgB,EAAC,IAAI,EAAE,YAAY,CAAC,aAAa,CAAC,CAAA;IAElD,IAAI,QAAQ,GAAG,KAAK,CAAA;IACpB,IAAI,aAAa,GAA0B,IAAI,CAAA;IAE/C,MAAM,qBAAqB,GAAG,YAAY,CAAC,KAAK,CAA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1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/webchat/message-list/index.tsx"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/webchat/message-list/index.tsx"],"names":[],"mappings":";;;;;AAAA,uDAAsE;AAEtE,+CAAuC;AACvC,mDAA2C;AAC3C,mDAAsD;AACtD,4CAAiD;AACjD,mFAAiD;AACjD,mDAA8C;AAC9C,mDAA8C;AAC9C,qCAAkE;AAClE,qEAA+D;AAC/D,2DAAsD;AAEtD,MAAM,cAAc,GAAG,GAAG,CAAA;AAC1B,MAAM,gBAAgB,GAA0B;IAC9C,KAAK,EAAE,KAAK;CACb,CAAA;AACD,MAAM,mBAAmB,GAA0B;IACjD,KAAK,EAAE,QAAQ;CAChB,CAAA;AAEM,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,MAAM,EACJ,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,GAC1B,GAAG,IAAA,kBAAU,EAAC,wBAAc,CAAC,CAAA;IAE9B,MAAM,EAAE,oBAAoB,EAAE,GAAG,IAAA,oCAAgB,GAAE,CAAA;IAEnD,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAAG,IAAA,gBAAQ,GAAU,CAAA;IAE1E,MAAM,cAAc,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAA;IACnD,MAAM,SAAS,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAA;IAC9C,MAAM,uBAAuB,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAA;IAE5D,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,UAAU,CAAC,GAAG,EAAE;YACd,SAAS,CAAC,OAAO,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAA;QACrD,CAAC,EAAE,cAAc,CAAC,CAAA;IACpB,CAAC,CAAA;IAED,MAAM,mBAAmB,GAAG,GAAG,EAAE;Q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@@
|
|
|
1
|
-
{"version":3,"file":"intro-message.js","sourceRoot":"","sources":["../../../../src/webchat/message-list/intro-message.tsx"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"intro-message.js","sourceRoot":"","sources":["../../../../src/webchat/message-list/intro-message.tsx"],"names":[],"mappings":";;;;AAAA,iCAAkC;AAElC,+CAAyC;AACzC,gDAA0C;AAC1C,wDAAqD;AACrD,4CAAqD;AACrD,mDAAsD;AACtD,qCAA4C;AAErC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAA,kBAAU,EAAC,wBAAc,CAAC,CAAA;IAEvD,MAAM,iBAAiB,GAAG,gBAAgB,CACxC,mBAAO,CAAC,iBAAiB,CAAC,gBAAgB,CAC3C,CAAA;IACD,MAAM,WAAW,GAAG,gBAAgB,CAAC,mBAAO,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAA;IAC3E,MAAM,UAAU,GAAG,gBAAgB,CAAC,mBAAO,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAA;IACzE,MAAM,UAAU,GAAG,gBAAgB,CAAC,mBAAO,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAA;IAEzE,MAAM,YAAY,GAAG,UAAU,IAAI,CACjC,uBAAC,0BAAiB,IAChB,KAAK,EAAE;YACL,GAAG,UAAU;SACd,EACD,GAAG,EAAE,IAAA,0BAAY,EAAC,UAAU,CAAC,GAC7B,CACH,CAAA;IAED,OAAO,WAAW,IAAI,YAAY,CAAC,CAAC,CAAC,CACnC,uBAAC,0BAAkB,IACjB,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC,uBAAC,aAAI,cAAE,QAAQ,GAAQ,YAE3C,WAAW,CAAC,CAAC,CAAC,uBAAC,WAAW,KAAG,CAAC,CAAC,CAAC,YAAY,GAC1B,CACtB,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC,CAAA;AA3BY,QAAA,YAAY,gBA2BxB"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ScrollButton = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
/** biome-ignore-all lint/a11y/useAltText: This is a SVG icon */
|
|
6
7
|
const arrow_scroll_down_svg_1 = tslib_1.__importDefault(require("../../assets/arrow-scroll-down.svg"));
|
|
7
8
|
const environment_1 = require("../../util/environment");
|
|
8
9
|
const styles_1 = require("./styles");
|
|
@@ -11,7 +12,7 @@ const use_notifications_1 = require("./use-notifications");
|
|
|
11
12
|
const ScrollButton = ({ handleClick, }) => {
|
|
12
13
|
const { CustomScrollButton, scrollButtonEnabled } = (0, use_notifications_1.useNotifications)();
|
|
13
14
|
const show = (0, use_debounce_1.useDebounce)();
|
|
14
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: scrollButtonEnabled && show ? (
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: scrollButtonEnabled && show ? (CustomScrollButton ? ((0, jsx_runtime_1.jsx)(CustomScrollButton, { handleScrollToBottom: handleClick })) : ((0, jsx_runtime_1.jsx)(styles_1.ContainerScrollButton, { onClick: handleClick, children: (0, jsx_runtime_1.jsx)("img", { src: (0, environment_1.resolveImage)(arrow_scroll_down_svg_1.default) }) }))) : null }));
|
|
15
16
|
};
|
|
16
17
|
exports.ScrollButton = ScrollButton;
|
|
17
18
|
//# sourceMappingURL=scroll-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-button.js","sourceRoot":"","sources":["../../../../src/webchat/message-list/scroll-button.tsx"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"scroll-button.js","sourceRoot":"","sources":["../../../../src/webchat/message-list/scroll-button.tsx"],"names":[],"mappings":";;;;;AAAA,gEAAgE;AAChE,uGAAgE;AAChE,wDAAqD;AACrD,qCAAgD;AAChD,iDAA4C;AAC5C,2DAAsD;AAM/C,MAAM,YAAY,GAAG,CAAC,EAC3B,WAAW,GACO,EAAe,EAAE;IACnC,MAAM,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,GAAG,IAAA,oCAAgB,GAAE,CAAA;IAEtE,MAAM,IAAI,GAAG,IAAA,0BAAW,GAAE,CAAA;IAE1B,OAAO,CACL,2DACG,mBAAmB,IAAI,IAAI,CAAC,CAAC,CAAC,CAC7B,kBAAkB,CAAC,CAAC,CAAC,CACnB,uBAAC,kBAAkB,IAAC,oBAAoB,EAAE,WAAW,GAAI,CAC1D,CAAC,CAAC,CAAC,CACF,uBAAC,8BAAqB,IAAC,OAAO,EAAE,WAAW,YACzC,gCAAK,GAAG,EAAE,IAAA,0BAAY,EAAC,+BAAe,CAAC,GAAI,GACrB,CACzB,CACF,CAAC,CAAC,CAAC,IAAI,GACP,CACJ,CAAA;AACH,CAAC,CAAA;AApBY,QAAA,YAAY,gBAoBxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unread-messages-banner.js","sourceRoot":"","sources":["../../../../src/webchat/message-list/unread-messages-banner.tsx"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"unread-messages-banner.js","sourceRoot":"","sources":["../../../../src/webchat/message-list/unread-messages-banner.tsx"],"names":[],"mappings":";;;;;AAEA,iCAAkC;AAElC,yFAAmD;AACnD,wDAAqD;AACrD,mDAAsD;AACtD,qCAAwD;AACxD,2DAAsD;AAM/C,MAAM,oBAAoB,GAAG,CAAC,EACnC,uBAAuB,GACG,EAAe,EAAE;IAC3C,MAAM,EAAE,YAAY,EAAE,GAAG,IAAA,kBAAU,EAAC,wBAAc,CAAC,CAAA;IAEnD,MAAM,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,UAAU,EAAE,GACpE,IAAA,oCAAgB,GAAE,CAAA;IAEpB,OAAO,CACL,2DACG,oBAAoB,CAAC,CAAC,CAAC,CACtB,gCAAK,GAAG,EAAE,uBAAuB,YAC9B,0BAA0B,CAAC,CAAC,CAAC,CAC5B,uBAAC,0BAA0B,KAAG,CAC/B,CAAC,CAAC,CAAC,CACF,wBAAC,sCAA6B,eAC5B,gCAAK,GAAG,EAAE,IAAA,0BAAY,EAAC,wBAAS,CAAC,GAAI,EACpC,YAAY,CAAC,iBAAiB,OAAG,UAAU,IACd,CACjC,GACG,CACP,CAAC,CAAC,CAAC,IAAI,GACP,CACJ,CAAA;AACH,CAAC,CAAA;AAxBY,QAAA,oBAAoB,wBAwBhC"}
|
|
@@ -24,7 +24,7 @@ const WebchatReplies = () => {
|
|
|
24
24
|
options[getThemeProperty(constants_1.WEBCHAT.CUSTOM_PROPERTIES.alignReplies)];
|
|
25
25
|
}
|
|
26
26
|
return ((0, jsx_runtime_1.jsx)(styles_1.ScrollableReplies, { children: (0, jsx_runtime_1.jsx)(styles_1.RepliesContainer, { id: constants_2.BotonicContainerId.RepliesContainer, ref: repliesRef, className: 'replies-container', justify: justifyContent, wrap: flexWrap, children: webchatState.replies?.map((reply, i) => (
|
|
27
|
-
// @ts-
|
|
27
|
+
// @ts-expect-error TODO: In this point reply is the the component to render
|
|
28
28
|
(0, jsx_runtime_1.jsx)(styles_1.ReplyContainer, { children: reply }, `reply-${i}`))) }) }));
|
|
29
29
|
};
|
|
30
30
|
exports.WebchatReplies = WebchatReplies;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/webchat/replies/index.tsx"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/webchat/replies/index.tsx"],"names":[],"mappings":";;;;AAAA,iCAAkC;AAElC,+CAAyC;AACzC,mDAAsD;AACtD,4CAAiD;AACjD,qCAA8E;AAE9E,MAAM,OAAO,GAAG;IACd,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,UAAU;CAClB,CAAA;AAEM,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,GAClD,IAAA,kBAAU,EAAC,wBAAc,CAAC,CAAA;IAE5B,IAAI,cAAc,GAAG,QAAQ,CAAA;IAC7B,MAAM,QAAQ,GAAG,gBAAgB,CAC/B,mBAAO,CAAC,iBAAiB,CAAC,WAAW,EACrC,MAAM,CACP,CAAA;IAED,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1B,cAAc,GAAG,YAAY,CAAA;IAC/B,CAAC;SAAM,IAAI,gBAAgB,CAAC,mBAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,EAAE,CAAC;QACpE,cAAc;YACZ,OAAO,CAAC,gBAAgB,CAAC,mBAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,CAAA;IACrE,CAAC;IAED,OAAO,CACL,uBAAC,0BAAiB,cAChB,uBAAC,yBAAgB,IACf,EAAE,EAAE,8BAAkB,CAAC,gBAAgB,EACvC,GAAG,EAAE,UAAU,EACf,SAAS,EAAC,mBAAmB,EAC7B,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,QAAQ,YAEb,YAAY,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;YACvC,4EAA4E;YAC5E,uBAAC,uBAAc,cAAqB,KAAK,IAApB,SAAS,CAAC,EAAE,CAA0B,CAC5D,CAAC,GACe,GACD,CACrB,CAAA;AACH,CAAC,CAAA;AAjCY,QAAA,cAAc,kBAiC1B"}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SessionView = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const react_1 = tslib_1.__importDefault(require("react"));
|
|
7
6
|
const react_json_tree_1 = require("react-json-tree");
|
|
8
7
|
const styled_components_1 = tslib_1.__importDefault(require("styled-components"));
|
|
9
8
|
const constants_1 = require("../constants");
|
|
@@ -86,7 +85,6 @@ const KeepSessionContainer = styled_components_1.default.div `
|
|
|
86
85
|
font-size: 12px;
|
|
87
86
|
`;
|
|
88
87
|
const SessionView = props => {
|
|
89
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
90
88
|
const { webchatState, updateDevSettings } = props.webchatHooks || (0, use_webchat_1.useWebchat)();
|
|
91
89
|
const { latestInput: input, session, lastRoutePath } = webchatState;
|
|
92
90
|
const toggleSessionView = () => updateDevSettings({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-view.js","sourceRoot":"","sources":["../../../src/webchat/session-view.jsx"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"session-view.js","sourceRoot":"","sources":["../../../src/webchat/session-view.jsx"],"names":[],"mappings":";;;;;AAAA,qDAA0C;AAC1C,kFAAsC;AAEtC,4CAAqC;AACrC,uDAAkD;AAElD,MAAM,kBAAkB,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;;;;WAO1B,kBAAM,CAAC,WAAW;;CAE5B,CAAA;AAED,MAAM,KAAK,GAAG,2BAAM,CAAC,GAAG,CAAA;;CAEvB,CAAA;AAED,MAAM,KAAK,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;;;WAMb,kBAAM,CAAC,YAAY;;CAE7B,CAAA;AAED,MAAM,oBAAoB,GAAG,KAAK,CAAC,EAAE,CAAC,CACpC,wBAAC,kBAAkB,eACjB,uBAAC,KAAK,cAAE,KAAK,CAAC,KAAK,GAAS,EAC5B,uBAAC,KAAK,cAAE,KAAK,CAAC,KAAK,GAAS,IACT,CACtB,CAAA;AAED,MAAM,kBAAkB,GAAG,2BAAM,CAAC,GAAG,CAAA;;WAE1B,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,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C,SAAS,IAAC,OAAO,EAAE,iBAAiB,YAClC,YAAY,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAC3C,EACZ,wBAAC,gBAAgB,eACf,uBAAC,KAAK,sCAA4B,EAClC,uBAAC,oBAAoB,IACnB,KAAK,EAAC,QAAQ,EACd,KAAK,EACH,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM;4BAChC,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,EAAE,EAAE;4BACvC,CAAC,CAAC,EAAE,GAER,EACF,uBAAC,oBAAoB,IAAC,KAAK,EAAC,UAAU,EAAC,KAAK,EAAE,KAAK,CAAC,OAAO,GAAI,EAC/D,uBAAC,oBAAoB,IACnB,KAAK,EAAC,OAAO,EACb,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC,CAAC,GAAG,GAChD,EACF,uBAAC,oBAAoB,IAAC,KAAK,EAAC,UAAU,GAAG,EACzC,uBAAC,gBAAgB,cACf,uBAAC,0BAAQ,IAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,GAAI,GAC1B,EACnB,uBAAC,oBAAoB,cACnB,8CACE,kCACE,IAAI,EAAC,UAAU,EACf,IAAI,EAAC,2BAA2B,EAChC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,mBAAmB,CAAC,EAC9D,QAAQ,EAAE,yBAAyB,GACnC,8BAEI,GACa,IACN,IACA,CACtB,CAAA;AACH,CAAC,CAAA;AAnDY,QAAA,WAAW,eAmDvB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { WebchatTheme } from './types';
|
|
1
|
+
import type { WebchatTheme } from './types';
|
|
2
2
|
export declare const defaultTheme: WebchatTheme;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockInputOption, ButtonProps, CustomMessageType } from '../../components/index-types';
|
|
1
|
+
import type { BlockInputOption, ButtonProps, CustomMessageType } from '../../components/index-types';
|
|
2
2
|
export interface ImagePreviewerProps {
|
|
3
3
|
src: string;
|
|
4
4
|
isPreviewerOpened: boolean;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TriggerButton = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
/** biome-ignore-all lint/a11y/noStaticElementInteractions: we need to use static elements for the trigger button */
|
|
6
|
+
/** biome-ignore-all lint/a11y/useKeyWithClickEvents: we need to use key with click events for the trigger button */
|
|
5
7
|
const react_1 = require("react");
|
|
6
8
|
const constants_1 = require("../../constants");
|
|
7
9
|
const environment_1 = require("../../util/environment");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/webchat/trigger-button/index.tsx"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/webchat/trigger-button/index.tsx"],"names":[],"mappings":";;;;AAAA,oHAAoH;AACpH,oHAAoH;AACpH,iCAAkC;AAElC,+CAAgD;AAChD,wDAAqD;AACrD,mDAAsD;AACtD,qCAIiB;AAEV,MAAM,aAAa,GAAG,GAAgB,EAAE;IAC7C,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,GACrD,IAAA,kBAAU,EAAC,wBAAc,CAAC,CAAA;IAE5B,MAAM,eAAe,GAAG,GAAG,EAAE;QAC3B,MAAM,KAAK,GAAG,gBAAgB,CAC5B,mBAAO,CAAC,iBAAiB,CAAC,kBAAkB,EAC5C,SAAS,CACV,CAAA;QAED,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,YAAY,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,GAAG,mBAAO,CAAC,QAAQ,CAAC,IAAI,CA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: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
1
|
+
declare const TypingIndicator: import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
2
|
export default TypingIndicator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/webchat/typing-indicator/index.tsx"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/webchat/typing-indicator/index.tsx"],"names":[],"mappings":";;;AAAA,iCAAqD;AAErD,+CAA+C;AAC/C,qCAAiE;AAEjE,MAAM,eAAe,GAAG,IAAA,kBAAU,EAChC,CAAC,MAAM,EAAE,GAAiC,EAAE,EAAE,CAAC,CAC7C,uBAAC,wBAAe,IAAC,GAAG,EAAE,GAAG,YACvB,wBAAC,yBAAgB,IACf,IAAI,EAAE,iBAAK,CAAC,gBAAgB,EAC5B,SAAS,EAAC,kBAAkB,EAC5B,eAAe,EAAE,kBAAM,CAAC,cAAc,aAEtC,uBAAC,YAAG,KAAG,EACP,uBAAC,YAAG,KAAG,EACP,uBAAC,YAAG,KAAG,IACU,GACH,CACnB,CACF,CAAA;AAED,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAA;AAE/C,kBAAe,eAAe,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { BotonicActionType } from '@botonic/core';
|
|
1
|
+
import { type BotonicActionType } from '@botonic/core';
|
|
2
2
|
export declare const getParsedAction: (botonicAction: BotonicActionType) => any;
|
package/lib/cjs/webchat/utils.js
CHANGED
|
@@ -4,8 +4,9 @@ exports.getParsedAction = void 0;
|
|
|
4
4
|
const core_1 = require("@botonic/core");
|
|
5
5
|
const getParsedAction = (botonicAction) => {
|
|
6
6
|
const splittedAction = botonicAction.split(`${core_1.BotonicAction.CreateCase}:`);
|
|
7
|
-
if (splittedAction.length <= 1)
|
|
7
|
+
if (splittedAction.length <= 1) {
|
|
8
8
|
return undefined;
|
|
9
|
+
}
|
|
9
10
|
return JSON.parse(splittedAction[1]);
|
|
10
11
|
};
|
|
11
12
|
exports.getParsedAction = getParsedAction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/webchat/utils.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/webchat/utils.ts"],"names":[],"mappings":";;;AAAA,wCAAqE;AAE9D,MAAM,eAAe,GAAG,CAAC,aAAgC,EAAE,EAAE;IAClE,MAAM,cAAc,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,oBAAa,CAAC,UAAU,GAAG,CAAC,CAAA;IAC1E,IAAI,cAAc,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QAC/B,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;AACtC,CAAC,CAAA;AANY,QAAA,eAAe,mBAM3B"}
|
|
@@ -2,6 +2,5 @@ export const DebugTab: import("styled-components").StyledComponent<"div", import
|
|
|
2
2
|
export function DebugTabPortal({ webchatHooks, ...props }: {
|
|
3
3
|
[x: string]: any;
|
|
4
4
|
webchatHooks: any;
|
|
5
|
-
}):
|
|
6
|
-
export const WebchatDev:
|
|
7
|
-
import React from 'react';
|
|
5
|
+
}): import("react").ReactPortal;
|
|
6
|
+
export const WebchatDev: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
|
|
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const core_1 = require("@botonic/core");
|
|
7
7
|
const lodash_merge_1 = tslib_1.__importDefault(require("lodash.merge"));
|
|
8
|
-
const react_1 =
|
|
8
|
+
const react_1 = require("react");
|
|
9
9
|
const react_dom_1 = require("react-dom");
|
|
10
10
|
const styled_components_1 = tslib_1.__importDefault(require("styled-components"));
|
|
11
11
|
const use_webchat_1 = require("./context/use-webchat");
|
|
@@ -39,7 +39,6 @@ const initialSession = {
|
|
|
39
39
|
name: 'botName',
|
|
40
40
|
},
|
|
41
41
|
};
|
|
42
|
-
// eslint-disable-next-line react/display-name
|
|
43
42
|
exports.WebchatDev = (0, react_1.forwardRef)((props, ref) => {
|
|
44
43
|
const webchatHooks = (0, use_webchat_1.useWebchat)();
|
|
45
44
|
const { webchatState, updateTheme } = webchatHooks;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webchat-dev.js","sourceRoot":"","sources":["../../../src/webchat/webchat-dev.jsx"],"names":[],"mappings":";;;;;AAAA,wCAAwC;AACxC,wEAAgC;AAChC,
|
|
1
|
+
{"version":3,"file":"webchat-dev.js","sourceRoot":"","sources":["../../../src/webchat/webchat-dev.jsx"],"names":[],"mappings":";;;;;AAAA,wCAAwC;AACxC,wEAAgC;AAChC,iCAA6C;AAC7C,yCAAwC;AACxC,kFAAsC;AAEtC,uDAAkD;AAClD,iDAA4C;AAC5C,uCAAmC;AAEtB,QAAA,QAAQ,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;WAIvB,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;YACvC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;CAClD,CAAA;AAED,iEAAiE;AACjE,wEAAwE;AACjE,MAAM,cAAc,GAAG,CAAC,EAAE,YAAY,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,CAC3D,IAAA,wBAAY,EACV,uBAAC,gBAAQ,OAAK,KAAK,YACjB,uBAAC,0BAAW,IAAC,YAAY,EAAE,YAAY,GAAI,GAClC,EACX,QA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,WAAW,CAAC,eAAe,EAC9C,YAAY,EAAE,YAAY,GAC1B,IACD,CACJ,CAAA;AACH,CAAC,CAAC,CAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
declare const Webchat: React.ForwardRefExoticComponent<WebchatProps & React.RefAttributes<WebchatRef | null>>;
|
|
1
|
+
import { type WebchatProps, type WebchatRef } from '../index-types';
|
|
2
|
+
declare const Webchat: import("react").ForwardRefExoticComponent<WebchatProps & import("react").RefAttributes<WebchatRef | null>>;
|
|
4
3
|
export { Webchat };
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Webchat = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
6
7
|
const core_1 = require("@botonic/core");
|
|
7
8
|
const lodash_merge_1 = tslib_1.__importDefault(require("lodash.merge"));
|
|
8
9
|
const react_1 = require("react");
|
|
@@ -29,11 +30,8 @@ const trigger_button_1 = require("./trigger-button");
|
|
|
29
30
|
const use_storage_state_hook_1 = require("./use-storage-state-hook");
|
|
30
31
|
const utils_1 = require("./utils");
|
|
31
32
|
const index_1 = require("./webview/index");
|
|
32
|
-
// eslint-disable-next-line complexity, react/display-name
|
|
33
33
|
const Webchat = (0, react_1.forwardRef)((props, ref) => {
|
|
34
|
-
const { addMessage, addMessageComponent, clearMessages, doRenderCustomComponent, resetUnreadMessages, setCurrentAttachment, setError, setIsInputFocused, setLastMessageVisible, setOnline, toggleCoverComponent, toggleEmojiPicker, togglePersistentMenu, toggleWebchat, updateCustomMessageProps, updateDevSettings, updateHandoff, updateLastMessageDate, updateLastRoutePath, updateLatestInput, updateMessage, updateReplies, updateSession, updateTheme, updateTyping, updateWebview, removeWebview, removeReplies, webchatState, webchatContainerRef, chatAreaRef, inputPanelRef, headerRef, repliesRef, scrollableMessagesListRef,
|
|
35
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
36
|
-
} = props.webchatHooks || (0, context_1.useWebchat)(props.theme);
|
|
34
|
+
const { addMessage, addMessageComponent, clearMessages, doRenderCustomComponent, resetUnreadMessages, setCurrentAttachment, setError, setIsInputFocused, setLastMessageVisible, setOnline, toggleCoverComponent, toggleEmojiPicker, togglePersistentMenu, toggleWebchat, updateCustomMessageProps, updateDevSettings, updateHandoff, updateLastMessageDate, updateLastRoutePath, updateLatestInput, updateMessage, updateReplies, updateSession, updateTheme, updateTyping, updateWebview, removeWebview, removeReplies, webchatState, webchatContainerRef, chatAreaRef, inputPanelRef, headerRef, repliesRef, scrollableMessagesListRef, } = props.webchatHooks || (0, context_1.useWebchat)(props.theme);
|
|
37
35
|
const firstUpdate = (0, react_1.useRef)(true);
|
|
38
36
|
const isOnline = () => webchatState.online;
|
|
39
37
|
const currentDateString = () => new Date().toISOString();
|
|
@@ -79,7 +77,7 @@ const Webchat = (0, react_1.forwardRef)((props, ref) => {
|
|
|
79
77
|
user: webchatState.session.user,
|
|
80
78
|
// TODO: Review if this input.sentBy exists in the frontend
|
|
81
79
|
input: input,
|
|
82
|
-
//@ts-
|
|
80
|
+
//@ts-expect-error
|
|
83
81
|
session: webchatState.session,
|
|
84
82
|
// TODO: Review why we were passing lastRoutePath, is only for devMode?
|
|
85
83
|
lastRoutePath: webchatState.lastRoutePath,
|
|
@@ -87,16 +85,18 @@ const Webchat = (0, react_1.forwardRef)((props, ref) => {
|
|
|
87
85
|
}
|
|
88
86
|
};
|
|
89
87
|
// Load styles stored in window._botonicInsertStyles by Webpack
|
|
88
|
+
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: this is a complex useEffect that needs to be refactored, but it's not a problem for now
|
|
90
89
|
(0, hooks_1.useComponentWillMount)(() => {
|
|
91
|
-
if (window._botonicInsertStyles
|
|
90
|
+
if (window._botonicInsertStyles?.length) {
|
|
92
91
|
for (const botonicStyle of window._botonicInsertStyles) {
|
|
93
92
|
// Injecting styles at head is needed even if we use shadowDOM
|
|
94
93
|
// as some dependencies like simplebar rely on creating ephemeral elements
|
|
95
94
|
// on document.body and assume styles will be available globally
|
|
96
95
|
document.head.appendChild(botonicStyle);
|
|
97
96
|
// injecting styles in host node too so that shadowDOM works
|
|
98
|
-
if (props.shadowDOM)
|
|
97
|
+
if (props.shadowDOM) {
|
|
99
98
|
host.appendChild(botonicStyle.cloneNode(true));
|
|
99
|
+
}
|
|
100
100
|
}
|
|
101
101
|
delete window._botonicInsertStyles;
|
|
102
102
|
}
|
|
@@ -104,9 +104,9 @@ const Webchat = (0, react_1.forwardRef)((props, ref) => {
|
|
|
104
104
|
// emoji-picker-react injects styles in head, so we need to
|
|
105
105
|
// re-inject them in our host node to make it work with shadowDOM
|
|
106
106
|
for (const style of document.querySelectorAll('style')) {
|
|
107
|
-
if (style.textContent
|
|
108
|
-
style.textContent.includes('emoji-picker-react'))
|
|
107
|
+
if (style.textContent?.includes('emoji-picker-react')) {
|
|
109
108
|
host.appendChild(style.cloneNode(true));
|
|
109
|
+
}
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
});
|
|
@@ -120,22 +120,27 @@ const Webchat = (0, react_1.forwardRef)((props, ref) => {
|
|
|
120
120
|
messages.forEach(message => {
|
|
121
121
|
addMessage(message);
|
|
122
122
|
const newMessageComponent = (0, msg_to_botonic_1.msgToBotonic)({ ...message, delay: 0, typing: 0 }, props.theme?.message?.customTypes);
|
|
123
|
-
|
|
124
|
-
if (newMessageComponent)
|
|
123
|
+
if (newMessageComponent) {
|
|
125
124
|
addMessageComponent(newMessageComponent);
|
|
125
|
+
}
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
-
if (initialSession)
|
|
128
|
+
if (initialSession) {
|
|
129
129
|
updateSession((0, lodash_merge_1.default)(initialSession, session));
|
|
130
|
-
|
|
130
|
+
}
|
|
131
|
+
if (lastRoutePath) {
|
|
131
132
|
updateLastRoutePath(lastRoutePath);
|
|
133
|
+
}
|
|
132
134
|
}
|
|
133
|
-
else
|
|
135
|
+
else {
|
|
134
136
|
updateSession((0, lodash_merge_1.default)(initialSession, session));
|
|
135
|
-
|
|
137
|
+
}
|
|
138
|
+
if (devSettings) {
|
|
136
139
|
updateDevSettings(devSettings);
|
|
137
|
-
|
|
140
|
+
}
|
|
141
|
+
else if (initialDevSettings) {
|
|
138
142
|
updateDevSettings(initialDevSettings);
|
|
143
|
+
}
|
|
139
144
|
if (lastMessageUpdate) {
|
|
140
145
|
updateLastMessageDate(lastMessageUpdate);
|
|
141
146
|
}
|
|
@@ -212,26 +217,28 @@ const Webchat = (0, react_1.forwardRef)((props, ref) => {
|
|
|
212
217
|
? rule.preprocess(inputData)
|
|
213
218
|
: inputData;
|
|
214
219
|
return rule.match.some(regex => {
|
|
215
|
-
if (typeof regex === 'string')
|
|
220
|
+
if (typeof regex === 'string') {
|
|
216
221
|
regex = (0, regexs_1.deserializeRegex)(regex);
|
|
222
|
+
}
|
|
217
223
|
return regex.test(processedInput);
|
|
218
224
|
});
|
|
219
225
|
};
|
|
220
226
|
const checkBlockInput = input => {
|
|
221
227
|
// if is a text we check if it is a serialized RE
|
|
222
228
|
const blockInputs = webchatState.theme.userInput?.blockInputs;
|
|
223
|
-
if (!Array.isArray(blockInputs))
|
|
229
|
+
if (!Array.isArray(blockInputs)) {
|
|
224
230
|
return false;
|
|
231
|
+
}
|
|
225
232
|
for (const rule of blockInputs) {
|
|
226
233
|
if (getBlockInputs(rule, input.data)) {
|
|
227
234
|
addMessageComponent((0, jsx_runtime_1.jsx)(components_1.Text
|
|
228
235
|
// Is necessary to add the id of the input
|
|
229
236
|
// to keep the input.id generated in the frontend as id of the message
|
|
230
|
-
// @ts-
|
|
237
|
+
// @ts-expect-error input.id is not typed
|
|
231
238
|
, {
|
|
232
239
|
// Is necessary to add the id of the input
|
|
233
240
|
// to keep the input.id generated in the frontend as id of the message
|
|
234
|
-
// @ts-
|
|
241
|
+
// @ts-expect-error input.id is not typed
|
|
235
242
|
id: input.id, sentBy: index_types_1.SENDERS.user, blob: false, style: {
|
|
236
243
|
backgroundColor: constants_1.COLORS.SCORPION_GRAY,
|
|
237
244
|
borderColor: constants_1.COLORS.SCORPION_GRAY,
|
|
@@ -252,26 +259,28 @@ const Webchat = (0, react_1.forwardRef)((props, ref) => {
|
|
|
252
259
|
const coverComponent = webchatState.theme.coverComponent;
|
|
253
260
|
const coverComponentProps = webchatState.theme.coverComponent?.props;
|
|
254
261
|
(0, react_1.useEffect)(() => {
|
|
255
|
-
if (!coverComponent)
|
|
262
|
+
if (!coverComponent) {
|
|
256
263
|
return;
|
|
264
|
+
}
|
|
257
265
|
if (!botonicState ||
|
|
258
|
-
(botonicState.messages && botonicState.messages.length === 0))
|
|
266
|
+
(botonicState.messages && botonicState.messages.length === 0)) {
|
|
259
267
|
toggleCoverComponent(true);
|
|
268
|
+
}
|
|
260
269
|
}, []);
|
|
270
|
+
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: messageComponentFromInput is a complex
|
|
261
271
|
const messageComponentFromInput = input => {
|
|
262
272
|
let messageComponent = null;
|
|
263
273
|
if ((0, message_utils_1.isText)(input)) {
|
|
264
274
|
messageComponent = ((0, jsx_runtime_1.jsx)(components_1.Text
|
|
265
275
|
// Is necessary to add the id of the input
|
|
266
276
|
// to keep the input.id generated in the frontend as id of the message
|
|
267
|
-
// @ts-
|
|
277
|
+
// @ts-expect-error input.id is not typed
|
|
268
278
|
, {
|
|
269
279
|
// Is necessary to add the id of the input
|
|
270
280
|
// to keep the input.id generated in the frontend as id of the message
|
|
271
|
-
// @ts-
|
|
281
|
+
// @ts-expect-error input.id is not typed
|
|
272
282
|
id: input.id,
|
|
273
283
|
// Is necessary to add the payload of the input when user clicks a button
|
|
274
|
-
// @ts-ignore
|
|
275
284
|
payload: input.payload, sentBy: index_types_1.SENDERS.user, children: input.data }));
|
|
276
285
|
}
|
|
277
286
|
else if ((0, message_utils_1.isMedia)(input)) {
|
|
@@ -287,29 +296,38 @@ const Webchat = (0, react_1.forwardRef)((props, ref) => {
|
|
|
287
296
|
mediaProps.input = input;
|
|
288
297
|
messageComponent = (0, jsx_runtime_1.jsx)(components_1.Image, { ...mediaProps });
|
|
289
298
|
}
|
|
290
|
-
else if ((0, message_utils_1.isAudio)(input))
|
|
299
|
+
else if ((0, message_utils_1.isAudio)(input)) {
|
|
291
300
|
messageComponent = (0, jsx_runtime_1.jsx)(components_1.Audio, { ...mediaProps });
|
|
292
|
-
|
|
301
|
+
}
|
|
302
|
+
else if ((0, message_utils_1.isVideo)(input)) {
|
|
293
303
|
messageComponent = (0, jsx_runtime_1.jsx)(components_1.Video, { ...mediaProps });
|
|
294
|
-
|
|
304
|
+
}
|
|
305
|
+
else if ((0, message_utils_1.isDocument)(input)) {
|
|
295
306
|
messageComponent = (0, jsx_runtime_1.jsx)(components_1.Document, { ...mediaProps });
|
|
307
|
+
}
|
|
296
308
|
}
|
|
297
309
|
return messageComponent;
|
|
298
310
|
};
|
|
299
311
|
const sendInput = async (input) => {
|
|
300
|
-
if (!input || Object.keys(input).length
|
|
312
|
+
if (!input || Object.keys(input).length === 0) {
|
|
301
313
|
return;
|
|
302
|
-
|
|
314
|
+
}
|
|
315
|
+
if ((0, message_utils_1.isText)(input) && (!input.data || !input.data.trim())) {
|
|
303
316
|
return; // in case trim() doesn't work in a browser we can use !/\S/.test(input.data)
|
|
304
|
-
|
|
317
|
+
}
|
|
318
|
+
if ((0, message_utils_1.isText)(input) && checkBlockInput(input)) {
|
|
305
319
|
return;
|
|
306
|
-
|
|
320
|
+
}
|
|
321
|
+
if (!input.id) {
|
|
307
322
|
input.id = (0, uuid_1.v7)();
|
|
323
|
+
}
|
|
308
324
|
const messageComponent = messageComponentFromInput(input);
|
|
309
|
-
if (messageComponent)
|
|
325
|
+
if (messageComponent) {
|
|
310
326
|
addMessageComponent(messageComponent);
|
|
311
|
-
|
|
327
|
+
}
|
|
328
|
+
if ((0, message_utils_1.isMedia)(input)) {
|
|
312
329
|
input.data = await (0, message_utils_1.readDataURL)(input.data);
|
|
330
|
+
}
|
|
313
331
|
sendUserInput(input);
|
|
314
332
|
updateLatestInput(input);
|
|
315
333
|
isOnline() && updateLastMessageDate(currentDateString());
|
|
@@ -342,12 +360,14 @@ const Webchat = (0, react_1.forwardRef)((props, ref) => {
|
|
|
342
360
|
updateSession((0, lodash_merge_1.default)(session, { user: webchatState.session.user }));
|
|
343
361
|
const action = session._botonic_action || '';
|
|
344
362
|
const handoff = action.startsWith(core_1.BotonicAction.CreateCase);
|
|
345
|
-
if (handoff && environment_1.isDev)
|
|
363
|
+
if (handoff && environment_1.isDev) {
|
|
346
364
|
addMessageComponent((0, jsx_runtime_1.jsx)(components_1.Handoff, {}));
|
|
365
|
+
}
|
|
347
366
|
updateHandoff(handoff);
|
|
348
367
|
}
|
|
349
|
-
if (lastRoutePath)
|
|
368
|
+
if (lastRoutePath) {
|
|
350
369
|
updateLastRoutePath(lastRoutePath);
|
|
370
|
+
}
|
|
351
371
|
updateLastMessageDate(currentDateString());
|
|
352
372
|
},
|
|
353
373
|
addSystemResponse: ({ response }) => {
|
|
@@ -389,8 +409,9 @@ const Webchat = (0, react_1.forwardRef)((props, ref) => {
|
|
|
389
409
|
updateMessageInfo: (msgId, messageInfo) => {
|
|
390
410
|
const messageToUpdate = webchatState.messagesJSON.filter(m => m.id === msgId)[0];
|
|
391
411
|
const updatedMsg = (0, lodash_merge_1.default)(messageToUpdate, messageInfo);
|
|
392
|
-
if (updatedMsg.ack === 1)
|
|
412
|
+
if (updatedMsg.ack === 1) {
|
|
393
413
|
delete updatedMsg.unsentInput;
|
|
414
|
+
}
|
|
394
415
|
updateMessage(updatedMsg);
|
|
395
416
|
},
|
|
396
417
|
updateWebchatSettings: (settings) => {
|
|
@@ -412,27 +433,31 @@ const Webchat = (0, react_1.forwardRef)((props, ref) => {
|
|
|
412
433
|
// Resume conversation after handoff
|
|
413
434
|
if (prevSession?._botonic_action && !webchatState.session._botonic_action) {
|
|
414
435
|
const action = (0, utils_1.getParsedAction)(prevSession._botonic_action);
|
|
415
|
-
if (action?.on_finish)
|
|
436
|
+
if (action?.on_finish) {
|
|
416
437
|
sendPayload(action.on_finish);
|
|
438
|
+
}
|
|
417
439
|
}
|
|
418
440
|
}, [webchatState.session._botonic_action]);
|
|
419
441
|
const sendText = async (text, payload) => {
|
|
420
|
-
if (!text)
|
|
442
|
+
if (!text) {
|
|
421
443
|
return;
|
|
444
|
+
}
|
|
422
445
|
const input = { type: core_1.INPUT.TEXT, data: text, payload };
|
|
423
446
|
await sendInput(input);
|
|
424
447
|
};
|
|
425
448
|
const sendPayload = async (payload) => {
|
|
426
|
-
if (!payload)
|
|
449
|
+
if (!payload) {
|
|
427
450
|
return;
|
|
451
|
+
}
|
|
428
452
|
const input = { type: core_1.INPUT.POSTBACK, payload };
|
|
429
453
|
await sendInput(input);
|
|
430
454
|
};
|
|
431
455
|
const sendAttachment = async (attachment) => {
|
|
432
456
|
if (attachment) {
|
|
433
457
|
const attachmentType = (0, message_utils_1.getMediaType)(attachment.type);
|
|
434
|
-
if (!attachmentType)
|
|
458
|
+
if (!attachmentType) {
|
|
435
459
|
return;
|
|
460
|
+
}
|
|
436
461
|
const input = {
|
|
437
462
|
type: attachmentType,
|
|
438
463
|
data: attachment,
|
|
@@ -446,8 +471,9 @@ const Webchat = (0, react_1.forwardRef)((props, ref) => {
|
|
|
446
471
|
firstUpdate.current = false;
|
|
447
472
|
return;
|
|
448
473
|
}
|
|
449
|
-
if (webchatState.isWebchatOpen && props.onOpen)
|
|
474
|
+
if (webchatState.isWebchatOpen && props.onOpen) {
|
|
450
475
|
props.onOpen();
|
|
476
|
+
}
|
|
451
477
|
if (!webchatState.isWebchatOpen && props.onClose && !firstUpdate.current) {
|
|
452
478
|
props.onClose();
|
|
453
479
|
toggleEmojiPicker(false);
|
|
@@ -465,7 +491,6 @@ const Webchat = (0, react_1.forwardRef)((props, ref) => {
|
|
|
465
491
|
}, [webchatState.themeUpdates]);
|
|
466
492
|
// Only needed for dev/serve mode
|
|
467
493
|
const updateWebchatDevSettings = settings => {
|
|
468
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
469
494
|
(0, react_1.useEffect)(() => {
|
|
470
495
|
const themeUpdates = (0, components_1.normalizeWebchatSettings)(settings);
|
|
471
496
|
updateTheme((0, lodash_merge_1.default)(webchatState.theme, themeUpdates), themeUpdates);
|
|
@@ -477,10 +502,12 @@ const Webchat = (0, react_1.forwardRef)((props, ref) => {
|
|
|
477
502
|
} })), component] }));
|
|
478
503
|
};
|
|
479
504
|
const _renderCustomComponent = () => {
|
|
480
|
-
if (!customComponent)
|
|
505
|
+
if (!customComponent) {
|
|
481
506
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
482
|
-
|
|
507
|
+
}
|
|
508
|
+
else {
|
|
483
509
|
return customComponent;
|
|
510
|
+
}
|
|
484
511
|
};
|
|
485
512
|
const WebchatComponent = ((0, jsx_runtime_1.jsx)(context_1.WebchatContext.Provider, { value: {
|
|
486
513
|
addMessage,
|