@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
|
@@ -16,7 +16,7 @@ const WhatsappProduct = (props) => {
|
|
|
16
16
|
};
|
|
17
17
|
const renderNode = () => {
|
|
18
18
|
return (
|
|
19
|
-
// @ts-
|
|
19
|
+
// @ts-expect-error Property 'message' does not exist on type 'JSX.IntrinsicElements'.
|
|
20
20
|
(0, jsx_runtime_1.jsx)("message", { ...props, body: props.body, footer: props.footer, catalogId: props.catalogId, productId: props.productId, type: core_1.INPUT.WHATSAPP_PRODUCT }));
|
|
21
21
|
};
|
|
22
22
|
return (0, react_1.renderComponent)({ renderBrowser, renderNode });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whatsapp-product.js","sourceRoot":"","sources":["../../../src/components/whatsapp-product.tsx"],"names":[],"mappings":";;;;AAAA,wCAAqC;
|
|
1
|
+
{"version":3,"file":"whatsapp-product.js","sourceRoot":"","sources":["../../../src/components/whatsapp-product.tsx"],"names":[],"mappings":";;;;AAAA,wCAAqC;AAErC,yCAA+C;AAC/C,uCAAmC;AASnC,MAAM,SAAS,GAAG,CAAC,OAAe,EAAE,EAAE;IACpC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAA;AAC1B,CAAC,CAAA;AAEM,MAAM,eAAe,GAAG,CAAC,KAA2B,EAAE,EAAE;IAC7D,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,qCAAqC;QACrC,MAAM,OAAO,GAAG,6CAA6C,CAAA;QAC7D,OAAO,CACL,uBAAC,iBAAO,IAAC,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,KAAM,KAAK,EAAE,IAAI,EAAE,YAAK,CAAC,IAAI,YAC3D,OAAO,GACA,CACX,CAAA;IACH,CAAC,CAAA;IAED,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,OAAO;QACL,sFAAsF;QACtF,uCACM,KAAK,EACT,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,IAAI,EAAE,YAAK,CAAC,gBAAgB,GAC5B,CACH,CAAA;IACH,CAAC,CAAA;IAED,OAAO,IAAA,uBAAe,EAAC,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,CAAA;AACvD,CAAC,CAAA;AA1BY,QAAA,eAAe,mBA0B3B"}
|
|
@@ -16,7 +16,7 @@ const WhatsappTemplate = (props) => {
|
|
|
16
16
|
};
|
|
17
17
|
const renderNode = () => {
|
|
18
18
|
return (
|
|
19
|
-
// @ts-
|
|
19
|
+
// @ts-expect-error Property 'message' does not exist on type 'JSX.IntrinsicElements'.
|
|
20
20
|
(0, jsx_runtime_1.jsx)("message", { ...props, name: props.name, language: props.language, namespace: props.namespace, header: props.header && JSON.stringify(props.header), body: props.body && JSON.stringify(props.body), footer: props.footer && JSON.stringify(props.footer), buttons: props.buttons && JSON.stringify(props.buttons), type: core_1.INPUT.WHATSAPP_TEMPLATE }));
|
|
21
21
|
};
|
|
22
22
|
return (0, react_1.renderComponent)({ renderBrowser, renderNode });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/whatsapp-template/index.tsx"],"names":[],"mappings":";;;;AAAA,wCAAqC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/whatsapp-template/index.tsx"],"names":[],"mappings":";;;;AAAA,wCAAqC;AAErC,4CAAkD;AAClD,wCAAoC;AAEpC,MAAM,SAAS,GAAG,CAAC,OAAe,EAAE,EAAE;IACpC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAA;AAC1B,CAAC,CAAA;AAYM,MAAM,gBAAgB,GAAG,CAAC,KAA4B,EAAE,EAAE;IAC/D,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,qCAAqC;QACrC,MAAM,OAAO,GAAG,YAAY,KAAK,CAAC,IAAI,kBAAkB,KAAK,CAAC,QAAQ,kBAAkB,KAAK,CAAC,SAAS,6BAA6B,CAAA;QACpI,OAAO,CACL,uBAAC,iBAAO,IAAC,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,KAAM,KAAK,EAAE,IAAI,EAAE,YAAK,CAAC,IAAI,YAC3D,OAAO,GACA,CACX,CAAA;IACH,CAAC,CAAA;IAED,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,OAAO;QACL,sFAAsF;QACtF,uCACM,KAAK,EACT,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,EACpD,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAC9C,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,EACpD,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,EACvD,IAAI,EAAE,YAAK,CAAC,iBAAiB,GAC7B,CACH,CAAA;IACH,CAAC,CAAA;IAED,OAAO,IAAA,uBAAe,EAAC,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,CAAA;AACvD,CAAC,CAAA;AA7BY,QAAA,gBAAgB,oBA6B5B"}
|
package/lib/esm/contexts.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Session as CoreSession } from '@botonic/core';
|
|
2
|
-
import { ActionRequest } from './index-types';
|
|
1
|
+
import type { Session as CoreSession } from '@botonic/core';
|
|
2
|
+
import type { ActionRequest } from './index-types';
|
|
3
3
|
export declare const RequestContext: import("react").Context<ActionRequest>;
|
|
4
4
|
export interface CloseWebviewOptions {
|
|
5
5
|
payload?: string;
|
package/lib/esm/dev-app.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DevApp = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const react_1 = tslib_1.__importDefault(require("react"));
|
|
7
5
|
const client_1 = require("react-dom/client");
|
|
8
6
|
const index_types_1 = require("./index-types");
|
|
9
7
|
const react_bot_1 = require("./react-bot");
|
|
@@ -59,11 +57,10 @@ class DevApp extends webchat_app_1.WebchatApp {
|
|
|
59
57
|
});
|
|
60
58
|
}
|
|
61
59
|
async onUserInput({ input, session, lastRoutePath }) {
|
|
62
|
-
this.onMessage
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
});
|
|
60
|
+
this.onMessage?.(this, {
|
|
61
|
+
sentBy: index_types_1.SENDERS.user,
|
|
62
|
+
message: input,
|
|
63
|
+
});
|
|
67
64
|
const resp = await this.bot.input({ input, session, lastRoutePath });
|
|
68
65
|
this.onMessage &&
|
|
69
66
|
resp.response.map(r => this.onMessage(this, {
|
package/lib/esm/dev-app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-app.js","sourceRoot":"","sources":["../../src/dev-app.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev-app.js","sourceRoot":"","sources":["../../src/dev-app.jsx"],"names":[],"mappings":";;;;AAAA,6CAA6C;AAE7C,+CAAuC;AACvC,2CAAsC;AACtC,oCAAwC;AACxC,uDAAkD;AAClD,+CAA0C;AAE1C,MAAa,MAAO,SAAQ,wBAAU;IACpC,YAAY,EACV,KAAK,GAAG,EAAE,EACV,cAA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AAC,SAAS,CAAC,CAAA;YACvC,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;QACnC,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE;QACjD,IAAI,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE;YACrB,MAAM,EAAE,qBAAO,CAAC,IAAI;YACpB,OAAO,EAAE,KAAK;SACf,CAAC,CAAA;QACF,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAA;QACpE,IAAI,CAAC,SAAS;YACZ,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CACpB,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;gBACnB,MAAM,EAAE,qBAAO,CAAC,GAAG;gBACnB,OAAO,EAAE,CAAC;aACX,CAAC,CACH,CAAA;QACH,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;IAC9C,CAAC;CACF;AAjHD,wBAiHC"}
|
package/lib/esm/index-types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { BotContext, BotRequest as CoreBotRequest, Input as CoreInput, InputType as CoreInputType, Route as CoreRoute, Routes as CoreRoutes,
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { BlockInputOption, ButtonProps, ReplyProps, WebchatSettingsProps } from './components';
|
|
1
|
+
import type { BotContext, BotRequest as CoreBotRequest, Input as CoreInput, InputType as CoreInputType, Route as CoreRoute, Routes as CoreRoutes, Session as CoreSession, SessionUser as CoreSessionUser, ServerConfig } from '@botonic/core';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import type { BlockInputOption, ButtonProps, ReplyProps, WebchatSettingsProps } from './components';
|
|
4
4
|
import { ChunkIdsGroupedBySourceData } from './components/system-debug-trace/events/knowledge-bases-types';
|
|
5
|
-
import { CloseWebviewOptions } from './contexts';
|
|
6
|
-
import { UseWebchat } from './webchat/context/use-webchat';
|
|
7
|
-
import { CoverComponentOptions, PersistentMenuOptionsTheme, WebchatTheme } from './webchat/theme/types';
|
|
8
|
-
import { WebchatApp } from './webchat-app';
|
|
5
|
+
import type { CloseWebviewOptions } from './contexts';
|
|
6
|
+
import type { UseWebchat } from './webchat/context/use-webchat';
|
|
7
|
+
import { type CoverComponentOptions, type PersistentMenuOptionsTheme, WebchatTheme } from './webchat/theme/types';
|
|
8
|
+
import type { WebchatApp } from './webchat-app';
|
|
9
9
|
/**
|
|
10
10
|
* See @botonic/core's Response for the description of the Response's semantics*/
|
|
11
11
|
export interface BotResponse extends CoreBotRequest {
|
package/lib/esm/message-utils.js
CHANGED
|
@@ -47,8 +47,9 @@ const readDataURL = file => new Promise((resolve, reject) => {
|
|
|
47
47
|
exports.readDataURL = readDataURL;
|
|
48
48
|
const isAllowedSize = fileSize => {
|
|
49
49
|
const maxAllowedBytesSize = constants_1.MAX_ALLOWED_SIZE_MB * 1024 * 1024;
|
|
50
|
-
if (fileSize > maxAllowedBytesSize)
|
|
50
|
+
if (fileSize > maxAllowedBytesSize) {
|
|
51
51
|
return false;
|
|
52
|
+
}
|
|
52
53
|
return true;
|
|
53
54
|
};
|
|
54
55
|
exports.isAllowedSize = isAllowedSize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-utils.js","sourceRoot":"","sources":["../../src/message-utils.js"],"names":[],"mappings":";;;AAAA,wCAAqC;AAErC,2CAAiE;AAE1D,MAAM,QAAQ,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,KAAK,IAAI,CAAA;AAA9C,QAAA,QAAQ,YAAsC;AAEpD,MAAM,MAAM,GAAG,GAAG,CAAC,EAAE,CAAC,IAAA,gBAAQ,EAAC,GAAG,CAAC,IAAI,EAAE,YAAK,CAAC,IAAI,CA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sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,CACjC,CAAA;AAHU,QAAA,oBAAoB,wBAG9B"}
|
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.msgToBotonic = msgToBotonic;
|
|
4
4
|
exports.msgsToBotonic = msgsToBotonic;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
6
|
const react_1 = require("react");
|
|
8
|
-
/* eslint-disable complexity */
|
|
9
|
-
const react_2 = tslib_1.__importDefault(require("react"));
|
|
10
7
|
const audio_1 = require("./components/audio");
|
|
11
8
|
const index_1 = require("./components/button/index");
|
|
12
9
|
const buttons_disabler_1 = require("./components/buttons-disabler");
|
|
@@ -29,6 +26,7 @@ const message_utils_1 = require("./message-utils");
|
|
|
29
26
|
* @param customMessageTypes {{customTypeName}[]?}
|
|
30
27
|
* @return {React.ReactNode}
|
|
31
28
|
*/
|
|
29
|
+
// eslint-disable-next-line complexity
|
|
32
30
|
function msgToBotonic(msg, customMessageTypes = []) {
|
|
33
31
|
delete msg.display;
|
|
34
32
|
if ((0, message_utils_1.isCustom)(msg)) {
|
|
@@ -67,9 +65,9 @@ function msgToBotonic(msg, customMessageTypes = []) {
|
|
|
67
65
|
}
|
|
68
66
|
else if ((0, message_utils_1.isButtonMessage)(msg)) {
|
|
69
67
|
const buttons = buttonsParse(msg.buttons);
|
|
70
|
-
return ((0,
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
return ((0, react_1.createElement)(text_1.Text, { ...msg, key: msg.key },
|
|
69
|
+
msg.text,
|
|
70
|
+
buttons));
|
|
73
71
|
}
|
|
74
72
|
else if ((0, message_utils_1.isSystemDebugTrace)(msg)) {
|
|
75
73
|
return (0, react_1.createElement)(system_debug_trace_1.SystemDebugTrace, { ...msg, key: msg.key });
|
|
@@ -95,32 +93,34 @@ function msgsToBotonic(msgs, customMessageTypes) {
|
|
|
95
93
|
}
|
|
96
94
|
function textToBotonic(msg) {
|
|
97
95
|
const txt = msg.data?.text ?? String(msg.data);
|
|
98
|
-
if (
|
|
99
|
-
(msg.keyboard && msg.keyboard.length))
|
|
96
|
+
if (msg.replies?.length || msg.keyboard?.length) {
|
|
100
97
|
return ((0, react_1.createElement)(text_1.Text, { ...msg, key: msg.key },
|
|
101
98
|
txt,
|
|
102
99
|
parseQuickReplies(msg)));
|
|
103
|
-
|
|
100
|
+
}
|
|
101
|
+
if (msg.buttons?.length) {
|
|
104
102
|
return ((0, react_1.createElement)(text_1.Text, { ...msg, key: msg.key },
|
|
105
103
|
txt,
|
|
106
104
|
buttonsParse(msg.buttons)));
|
|
105
|
+
}
|
|
107
106
|
return ((0, react_1.createElement)(text_1.Text, { ...msg, key: msg.key }, txt));
|
|
108
107
|
}
|
|
109
108
|
function elementsParse(elements) {
|
|
110
|
-
return elements.map((e, i) => ((0, jsx_runtime_1.jsxs)(element_1.Element, { children: [(0, jsx_runtime_1.jsx)(pic_1.Pic, { src: e.img || e.pic || e.image_url }), (0, jsx_runtime_1.jsx)(title_1.Title, { children: e.title }), (0, jsx_runtime_1.jsx)(subtitle_1.Subtitle, { children: e.subtitle }), buttonsParse(e.button || e.buttons)] }, i)));
|
|
109
|
+
return elements.map((e, i) => ((0, jsx_runtime_1.jsxs)(element_1.Element, { children: [(0, jsx_runtime_1.jsx)(pic_1.Pic, { src: e.img || e.pic || e.image_url }), (0, jsx_runtime_1.jsx)(title_1.Title, { children: e.title }), (0, jsx_runtime_1.jsx)(subtitle_1.Subtitle, { children: e.subtitle }), buttonsParse(e.button || e.buttons)] }, `element-${i}`)));
|
|
111
110
|
}
|
|
112
111
|
function buttonsParse(buttons) {
|
|
113
112
|
return buttons.map((b, i) => {
|
|
114
113
|
const props = b.props || b;
|
|
115
114
|
let payload = props.payload;
|
|
116
|
-
if (props.path)
|
|
115
|
+
if (props.path) {
|
|
117
116
|
payload = `__PATH_PAYLOAD__${props.path}`;
|
|
117
|
+
}
|
|
118
118
|
const url = props.messenger_extensions ? null : props.url;
|
|
119
119
|
const target = props.messenger_extensions ? null : props.target;
|
|
120
120
|
const title = props.title;
|
|
121
121
|
const webview = props.messenger_extensions ? props.url : props.webview;
|
|
122
122
|
const disabledProps = buttons_disabler_1.ButtonsDisabler.constructBrowserProps(props);
|
|
123
|
-
return ((0, jsx_runtime_1.jsx)(index_1.Button, { payload: payload, url: url, target: target, webview: webview, ...disabledProps, children: title }, i));
|
|
123
|
+
return ((0, jsx_runtime_1.jsx)(index_1.Button, { payload: payload, url: url, target: target, webview: webview, ...disabledProps, children: title }, `button-${i}`));
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
126
|
function parseQuickReplies(msg) {
|
|
@@ -128,13 +128,14 @@ function parseQuickReplies(msg) {
|
|
|
128
128
|
if (msg.replies) {
|
|
129
129
|
replies = msg.replies.map((el, i) => {
|
|
130
130
|
let payload = el.payload;
|
|
131
|
-
if (el.path)
|
|
131
|
+
if (el.path) {
|
|
132
132
|
payload = `__PATH_PAYLOAD__${el.path}`;
|
|
133
|
-
|
|
133
|
+
}
|
|
134
|
+
return ((0, jsx_runtime_1.jsx)(reply_1.Reply, { payload: payload, children: el.text }, `reply-${i}`));
|
|
134
135
|
});
|
|
135
136
|
}
|
|
136
137
|
if (msg.keyboard) {
|
|
137
|
-
replies = msg.keyboard.map((el, i) => ((0, jsx_runtime_1.jsx)(reply_1.Reply, { payload: el.data, children: el.label }, i)));
|
|
138
|
+
replies = msg.keyboard.map((el, i) => ((0, jsx_runtime_1.jsx)(reply_1.Reply, { payload: el.data, children: el.label }, `reply-${i}`)));
|
|
138
139
|
}
|
|
139
140
|
return replies;
|
|
140
141
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"msg-to-botonic.js","sourceRoot":"","sources":["../../src/msg-to-botonic.jsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"msg-to-botonic.js","sourceRoot":"","sources":["../../src/ms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AO,GAAG,EAAE,CAAC,OAAO,CAAA;YACxB,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC;gBACZ,OAAO,GAAG,mBAAmB,EAAE,CAAC,IAAI,EAAE,CAAA;YACxC,CAAC;YACD,OAAO,CACL,uBAAC,aAAK,IAAoB,OAAO,EAAE,OAAO,YACvC,EAAE,CAAC,IAAI,IADE,SAAS,CAAC,EAAE,CAEhB,CACT,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IACD,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC;QACjB,OAAO,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CACpC,uBAAC,aAAK,IAAoB,OAAO,EAAE,EAAE,CAAC,IAAI,YACvC,EAAE,CAAC,KAAK,IADC,SAAS,CAAC,EAAE,CAEhB,CACT,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
package/lib/esm/react-bot.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CoreBot } from '@botonic/core';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import type React from 'react';
|
|
3
3
|
import { RequestContext } from './contexts';
|
|
4
|
-
import { ActionRequest } from './index-types';
|
|
4
|
+
import type { ActionRequest } from './index-types';
|
|
5
5
|
type ActionComponentType<P = any> = React.ComponentType<P> & {
|
|
6
6
|
botonicInit?: (request: ActionRequest) => Promise<P>;
|
|
7
7
|
contextType?: React.Context<typeof RequestContext>;
|
package/lib/esm/util/dom.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isShadowDOMSupported = exports.onDOMLoaded = exports.getScrollableMessagesListElement = exports.getWebchatElement = void 0;
|
|
4
4
|
const constants_1 = require("../webchat/constants");
|
|
5
|
-
const getWebchatElement = host => host
|
|
5
|
+
const getWebchatElement = host => host?.querySelector(`#${constants_1.BotonicContainerId.Webchat}`);
|
|
6
6
|
exports.getWebchatElement = getWebchatElement;
|
|
7
|
-
const getScrollableMessagesListElement = host => host
|
|
7
|
+
const getScrollableMessagesListElement = host => host?.querySelector(`#${constants_1.BotonicContainerId.ScrollableMessagesList}`);
|
|
8
8
|
exports.getScrollableMessagesListElement = getScrollableMessagesListElement;
|
|
9
9
|
// https://stackoverflow.com/questions/9457891/how-to-detect-if-domcontentloaded-was-fired
|
|
10
10
|
const onDOMLoaded = callback => {
|
|
@@ -23,7 +23,7 @@ const isShadowDOMSupported = () => {
|
|
|
23
23
|
try {
|
|
24
24
|
return document.head.createShadowRoot || document.head.attachShadow;
|
|
25
25
|
}
|
|
26
|
-
catch (
|
|
26
|
+
catch (_e) {
|
|
27
27
|
return false;
|
|
28
28
|
}
|
|
29
29
|
};
|
package/lib/esm/util/dom.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.js","sourceRoot":"","sources":["../../../src/util/dom.js"],"names":[],"mappings":";;;AAAA,oDAAyD;AAElD,MAAM,iBAAiB,GAAG,IAAI,CAAC,EAAE,CACtC,IAAI,
|
|
1
|
+
{"version":3,"file":"dom.js","sourceRoot":"","sources":["../../../src/util/dom.js"],"names":[],"mappings":";;;AAAA,oDAAyD;AAElD,MAAM,iBAAiB,GAAG,IAAI,CAAC,EAAE,CACtC,IAAI,EAAE,aAAa,CAAC,IAAI,8BAAkB,CAAC,OAAO,EAAE,CAAC,CAAA;AAD1C,QAAA,iBAAiB,qBACyB;AAEhD,MAAM,gCAAgC,GAAG,IAAI,CAAC,EAAE,CACrD,IAAI,EAAE,aAAa,CAAC,IAAI,8BAAkB,CAAC,sBAAsB,EAAE,CAAC,CAAA;AADzD,QAAA,gCAAgC,oCACyB;AAEtE,0FAA0F;AACnF,MAAM,WAAW,GAAG,QAAQ,CAAC,EAAE;IACpC,IAAI,6BAA6B,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5D,wEAAwE;QACxE,kEAAkE;QAClE,QAAQ,EAAE,CAAA;IACZ,CAAC;SAAM,CAAC;QACN,wEAAwE;QACxE,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;IAChE,CAAC;AACH,CAAC,CAAA;AATY,QAAA,WAAW,eASvB;AAEM,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACvC,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC,gBAAgB,IAAI,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAA;IACrE,CAAC;IAAC,OAAO,EAAE,EAAE,CAAC;QACZ,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC,CAAA;AANY,QAAA,oBAAoB,wBAMhC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
export function isURL(urlPath: any): boolean;
|
|
1
2
|
export function normalize(path: any): string;
|
|
2
3
|
export function isInWebviewApp(): boolean;
|
|
3
4
|
export const isDev: boolean;
|
|
4
5
|
export const isProd: boolean;
|
|
5
6
|
export function staticAsset(path: any): any;
|
|
6
7
|
export function resolveImage(src: any): any;
|
|
7
|
-
export function isURL(urlPath: any): boolean;
|
|
@@ -1,57 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.resolveImage = exports.staticAsset = exports.isProd = exports.isDev = void 0;
|
|
4
|
+
exports.isURL = isURL;
|
|
4
5
|
exports.normalize = normalize;
|
|
5
6
|
exports.isInWebviewApp = isInWebviewApp;
|
|
6
7
|
exports.isDev = process.env.NODE_ENV === 'development';
|
|
7
8
|
exports.isProd = process.env.NODE_ENV === 'production';
|
|
8
9
|
const staticAsset = path => {
|
|
9
10
|
try {
|
|
10
|
-
if (
|
|
11
|
-
return path; // Webpack 5 >= fully resolves absolute path to assets
|
|
11
|
+
if (isURL(path)) {
|
|
12
|
+
return path; // Webpack 5 or Rspack >= fully resolves absolute path to assets
|
|
13
|
+
}
|
|
12
14
|
const scriptBaseURL = document
|
|
13
15
|
.querySelector('script[src*="webchat.botonic.js"]')
|
|
14
16
|
.getAttribute('src');
|
|
15
17
|
const scriptName = scriptBaseURL.split('/').pop();
|
|
16
|
-
const basePath = scriptBaseURL.replace(
|
|
18
|
+
const basePath = scriptBaseURL.replace(`/${scriptName}`, '/');
|
|
17
19
|
const resolvedStaticAssetPath = basePath + path;
|
|
18
20
|
return resolvedStaticAssetPath;
|
|
19
21
|
}
|
|
20
|
-
catch (
|
|
22
|
+
catch (_e) {
|
|
21
23
|
console.error(`Could not resolve path: '${path}'`);
|
|
22
24
|
return normalize(path);
|
|
23
25
|
}
|
|
24
26
|
};
|
|
25
27
|
exports.staticAsset = staticAsset;
|
|
26
28
|
const resolveImage = src => {
|
|
27
|
-
if (
|
|
29
|
+
if (isURL(src)) {
|
|
28
30
|
return src;
|
|
31
|
+
}
|
|
29
32
|
return (0, exports.staticAsset)(src);
|
|
30
33
|
};
|
|
31
34
|
exports.resolveImage = resolveImage;
|
|
32
|
-
|
|
35
|
+
function isURL(urlPath) {
|
|
33
36
|
// @stephenhay (38 chars) from: https://mathiasbynens.be/demo/url-regex
|
|
34
37
|
const pattern = new RegExp(/^(blob:)?(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/);
|
|
35
38
|
return !!pattern.test(urlPath);
|
|
36
|
-
}
|
|
37
|
-
exports.isURL = isURL;
|
|
39
|
+
}
|
|
38
40
|
function normalize(path) {
|
|
39
41
|
const isAbsolute = path.charAt(0) === '/';
|
|
40
42
|
const trailingSlash = path && path[path.length - 1] === '/';
|
|
41
43
|
// Normalize the path
|
|
42
44
|
path = normalizeArray(path.split('/'), !isAbsolute).join('/');
|
|
43
|
-
if (!path && !isAbsolute)
|
|
45
|
+
if (!path && !isAbsolute) {
|
|
44
46
|
path = '.';
|
|
45
|
-
|
|
47
|
+
}
|
|
48
|
+
if (path && trailingSlash) {
|
|
46
49
|
path += '/';
|
|
50
|
+
}
|
|
47
51
|
return (isAbsolute ? '/' : '') + path;
|
|
48
52
|
}
|
|
49
53
|
function normalizeArray(parts, allowAboveRoot) {
|
|
50
54
|
const res = [];
|
|
51
55
|
for (let i = 0; i < parts.length; i++) {
|
|
52
56
|
const p = parts[i];
|
|
53
|
-
if (!p || p === '.')
|
|
57
|
+
if (!p || p === '.') {
|
|
54
58
|
continue;
|
|
59
|
+
}
|
|
55
60
|
if (p === '..') {
|
|
56
61
|
if (res.length && res[res.length - 1] !== '..') {
|
|
57
62
|
res.pop();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../src/util/environment.js"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../src/util/environment.js"],"names":[],"mappings":";;;AA4BA,sBAIC;AAED,8BAYC;AAsBD,wCAcC;AAlFY,QAAA,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAA;AAC9C,QAAA,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAA;AAEpD,MAAM,WAAW,GAAG,IAAI,CAAC,EAAE;IAChC,IAAI,CAAC;QACH,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAChB,OAAO,IAAI,CAAA,CAAC,gEAAgE;QAC9E,CAAC;QACD,MAAM,aAAa,GAAG,QAAQ;aAC3B,aAAa,CAAC,mCAAmC,CAAC;aAClD,YAAY,CAAC,KAAK,CAAC,CAAA;QACtB,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAA;QACjD,MAAM,QAAQ,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,UAAU,EAAE,EAAE,GAAG,CAAC,CAAA;QAC7D,MAAM,uBAAuB,GAAG,QAAQ,GAAG,IAAI,CAA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,SAAS,IAAI,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAE9D,OAAO,YAAY,IAAI,gBAAgB,CAAA;AACzC,CAAC"}
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createErrorBoundary = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
5
|
// @ts-nocheck
|
|
7
6
|
const core_1 = require("@botonic/core");
|
|
8
|
-
const react_1 =
|
|
7
|
+
const react_1 = require("react");
|
|
9
8
|
const text_1 = require("../components/text");
|
|
10
9
|
const createErrorBoundary = ({ errorComponent = ({ errorMessage }) => ((0, jsx_runtime_1.jsx)(text_1.Text, { children: "The message cannot be displayed" })), } = {}) => {
|
|
11
10
|
const ErrorBoundary = ({ children }) => {
|
|
12
|
-
const [error,
|
|
13
|
-
const
|
|
11
|
+
const [error, _setError] = (0, react_1.useState)(null);
|
|
12
|
+
const _componentDidCatch = (error, _errorInfo) => {
|
|
14
13
|
if ((0, core_1.isNode)()) {
|
|
15
14
|
console.error(`Failure at:`, error);
|
|
16
15
|
}
|
|
17
16
|
};
|
|
18
|
-
const
|
|
17
|
+
const _getDerivedStateFromError = error => {
|
|
19
18
|
return { error };
|
|
20
19
|
};
|
|
21
20
|
if (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-boundary.js","sourceRoot":"","sources":["../../../src/util/error-boundary.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error-boundary.js","sourceRoot":"","sources":["../../../src/util/error-boundary.jsx"],"names":[],"mappings":";;;;AAAA,cAAc;AACd,wCAAsC;AACtC,iCAAgC;AAEhC,6CAAyC;AAElC,MAAM,mBAAmB,GAAG,CAAC,EAClC,cAAc,GAAG,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CACrC,uBAAC,WAAI,kDAAuC,CAC7C,GACF,GAAG,EAAE,EAAE,EAAE;IACR,MAAM,aAAa,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;QACrC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAA;QAEzC,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE;YAC/C,IAAI,IAAA,aAAM,GAAE,EAAE,CAAC;gBACb,OAAO,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,CAAA;YACrC,CAAC;QACH,CAAC,CAAA;QAED,MAAM,yBAAyB,GAAG,KAAK,CAAC,EAAE;YACxC,OAAO,EAAE,KAAK,EAAE,CAAA;QAClB,CAAC,CAAA;QAED,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,cAAc,CAAC;gBACpB,YAAY,EAAE,KAAK,CAAC,OAAO;aAC5B,CAAC,CAAA;QACJ,CAAC;aAAM,CAAC;YACN,OAAO,QAAQ,CAAA;QACjB,CAAC;IACH,CAAC,CAAA;IAED,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA;AA5BY,QAAA,mBAAmB,uBA4B/B"}
|
package/lib/esm/util/logs.js
CHANGED
|
@@ -12,8 +12,9 @@ function warnDeprecatedProps(props, extraInfo) {
|
|
|
12
12
|
{ legacy: 'imageStyle', new: 'imagestyle' },
|
|
13
13
|
];
|
|
14
14
|
legacyNewProps.forEach(p => {
|
|
15
|
-
if ((0, objects_1.getProperty)(props, p.legacy) !== undefined)
|
|
15
|
+
if ((0, objects_1.getProperty)(props, p.legacy) !== undefined) {
|
|
16
16
|
warnDeprecated(p.legacy, p.new, extraInfo);
|
|
17
|
+
}
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
20
|
//# sourceMappingURL=logs.js.map
|
package/lib/esm/util/logs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../../../src/util/logs.js"],"names":[],"mappings":";;AAEA,wCAMC;AAED,
|
|
1
|
+
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../../../src/util/logs.js"],"names":[],"mappings":";;AAEA,wCAMC;AAED,kDAUC;AApBD,6CAA6C;AAE7C,SAAgB,cAAc,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,SAAS;IACvE,OAAO,CAAC,IAAI,CACV,GACE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAC1B,KAAK,UAAU,yBAAyB,OAAO,YAAY,CAC5D,CAAA;AACH,CAAC;AAED,SAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS;IAClD,MAAM,cAAc,GAAG;QACrB,EAAE,MAAM,EAAE,kBAAkB,EAAE,GAAG,EAAE,kBAAkB,EAAE;QACvD,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY,EAAE;KAC5C,CAAA;IACD,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QACzB,IAAI,IAAA,qBAAW,EAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,SAAS,EAAE,CAAC;YAC/C,cAAc,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;QAC5C,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/lib/esm/util/objects.js
CHANGED
|
@@ -10,13 +10,14 @@ exports.strToBool = strToBool;
|
|
|
10
10
|
* getProperty(obj, 'a.b.z'), returns undefined
|
|
11
11
|
*/
|
|
12
12
|
const getProperty = (obj, property) => {
|
|
13
|
-
if (!property)
|
|
13
|
+
if (!property) {
|
|
14
14
|
return undefined;
|
|
15
|
+
}
|
|
15
16
|
const properties = property.split('.');
|
|
16
17
|
for (let i = 0; i < properties.length; i++) {
|
|
17
18
|
const prop = properties[i];
|
|
18
19
|
// eslint-disable-next-line no-prototype-builtins
|
|
19
|
-
if (!obj || !
|
|
20
|
+
if (!obj || !Object.hasOwn(obj, prop)) {
|
|
20
21
|
return undefined;
|
|
21
22
|
}
|
|
22
23
|
else {
|
|
@@ -35,7 +36,7 @@ const mapObject = (obj, conversion = ([key, value]) => [key, value]) => {
|
|
|
35
36
|
return (obj &&
|
|
36
37
|
Object.entries(obj)
|
|
37
38
|
.map(conversion)
|
|
38
|
-
.reduce(
|
|
39
|
+
.reduce((prev, curr) => {
|
|
39
40
|
prev[curr[0]] = curr[1];
|
|
40
41
|
return prev;
|
|
41
42
|
}, {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objects.js","sourceRoot":"","sources":["../../../src/util/objects.js"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"objects.js","sourceRoot":"","sources":["../../../src/util/objects.js"],"names":[],"mappings":";;;AAwBA,8BAIC;AA5BD;;;;;;GAMG;AACI,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE;IAC3C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,MAAM,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,MAAM,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA;QAC1B,iDAAiD;QACjD,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC;YACtC,OAAO,SAAS,CAAA;QAClB,CAAC;aAAM,CAAC;YACN,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,CAAA;QACjB,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAfY,QAAA,WAAW,eAevB;AAED,SAAgB,SAAS,CAAC,MAAM;IAC9B,MAAM,KAAK,GAAG,sBAAsB,CAAA;IACpC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;IACvB,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAC3B,CAAC;AAEM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;IAC5E,OAAO,CACL,GAAG;QACH,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;aAChB,GAAG,CAAC,UAAU,CAAC;aACf,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;YACrB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;YACvB,OAAO,IAAI,CAAA;QACb,CAAC,EAAE,EAAE,CAAC,CACT,CAAA;AACH,CAAC,CAAA;AAVY,QAAA,SAAS,aAUrB"}
|
package/lib/esm/util/react.js
CHANGED
|
@@ -8,17 +8,20 @@ const objects_1 = require("./objects");
|
|
|
8
8
|
const ConditionalWrapper = ({ condition, wrapper, children }) => condition ? wrapper(children) : children;
|
|
9
9
|
exports.ConditionalWrapper = ConditionalWrapper;
|
|
10
10
|
function renderComponent({ renderBrowser, renderNode }) {
|
|
11
|
-
if ((0, core_1.isBrowser)())
|
|
11
|
+
if ((0, core_1.isBrowser)()) {
|
|
12
12
|
return renderBrowser();
|
|
13
|
-
|
|
13
|
+
}
|
|
14
|
+
else if ((0, core_1.isNode)()) {
|
|
14
15
|
return renderNode();
|
|
16
|
+
}
|
|
15
17
|
throw new Error('Unexpected process type. Not recognized as browser nor node');
|
|
16
18
|
}
|
|
17
19
|
const mapObjectNonBooleanValues = obj => {
|
|
18
20
|
// to avoid React SSR warnings: https://github.com/styled-components/styled-components/issues/1198#issue-262022540
|
|
19
21
|
return (0, objects_1.mapObject)(obj, ([key, value]) => {
|
|
20
|
-
if (typeof value === 'boolean')
|
|
22
|
+
if (typeof value === 'boolean') {
|
|
21
23
|
return [key, Number(value)];
|
|
24
|
+
}
|
|
22
25
|
return [key, value];
|
|
23
26
|
});
|
|
24
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/util/react.js"],"names":[],"mappings":";;;AAQA,
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/util/react.js"],"names":[],"mappings":";;;AAQA,0CAOC;AAfD,wCAAiD;AACjD,iCAA8D;AAE9D,uCAAqC;AAE9B,MAAM,kBAAkB,GAAG,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CACrE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAA;AAD7B,QAAA,kBAAkB,sBACW;AAE1C,SAAgB,eAAe,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE;IAC3D,IAAI,IAAA,gBAAS,GAAE,EAAE,CAAC;QAChB,OAAO,aAAa,EAAE,CAAA;IACxB,CAAC;SAAM,IAAI,IAAA,aAAM,GAAE,EAAE,CAAC;QACpB,OAAO,UAAU,EAAE,CAAA;IACrB,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAA;AAChF,CAAC;AAEM,MAAM,yBAAyB,GAAG,GAAG,CAAC,EAAE;IAC7C,kHAAkH;IAClH,OAAO,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACrC,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;YAC/B,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;QAC7B,CAAC;QACD,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IACrB,CAAC,CAA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s.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.stringifyWithRegexs = exports.deserializeRegex = void 0;
|
|
4
4
|
const deserializeRegex = regexStr => {
|
|
5
5
|
/* eslint-disable no-useless-escape */
|
|
6
|
-
const fragments = regexStr.match(/\/(.[
|
|
6
|
+
const fragments = regexStr.match(/\/(.[^/]+)\/([a-z]{1})?$/i); // https://stackoverflow.com/a/33642463, https://github.com/hubtype/botonic/pull/805#discussion_r437309074
|
|
7
7
|
const deserialized = new RegExp(fragments[1], fragments[2] || '');
|
|
8
8
|
return deserialized;
|
|
9
9
|
};
|
|
@@ -14,8 +14,9 @@ exports.deserializeRegex = deserializeRegex;
|
|
|
14
14
|
*/
|
|
15
15
|
const stringifyWithRegexs = object => {
|
|
16
16
|
return JSON.stringify(object, (_, value) => {
|
|
17
|
-
if (value instanceof RegExp)
|
|
17
|
+
if (value instanceof RegExp) {
|
|
18
18
|
return value.toString();
|
|
19
|
+
}
|
|
19
20
|
return value;
|
|
20
21
|
});
|
|
21
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regexs.js","sourceRoot":"","sources":["../../../src/util/regexs.js"],"names":[],"mappings":";;;AAAO,MAAM,gBAAgB,GAAG,QAAQ,CAAC,EAAE;IACzC,sCAAsC;IACtC,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"regexs.js","sourceRoot":"","sources":["../../../src/util/regexs.js"],"names":[],"mappings":";;;AAAO,MAAM,gBAAgB,GAAG,QAAQ,CAAC,EAAE;IACzC,sCAAsC;IACtC,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAA,CAAC,0GAA0G;IACxK,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;IACjE,OAAO,YAAY,CAAA;AACrB,CAAC,CAAA;AALY,QAAA,gBAAgB,oBAK5B;AACD;;;GAGG;AACI,MAAM,mBAAmB,GAAG,MAAM,CAAC,EAAE;IAC1C,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;QACzC,IAAI,KAAK,YAAY,MAAM,EAAE,CAAC;YAC5B,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAA;QACzB,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAPY,QAAA,mBAAmB,uBAO/B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ClientUser } from '../webchat/context/types';
|
|
2
|
-
import { WebchatTheme } from '../webchat/theme/types';
|
|
1
|
+
import type { ClientUser } from '../webchat/context/types';
|
|
2
|
+
import type { WebchatTheme } from '../webchat/theme/types';
|
|
3
3
|
/**
|
|
4
4
|
* Returns the value of a property defined in bot's theme based on WEBCHAT.CUSTOM_PROPERTIES dictionary.
|
|
5
5
|
* It gives preference to nested defined properties (e.g.: header.style) over plain properties (e.g.: headerStyle).
|