@botonic/react 0.31.0 → 0.31.1-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/components/index.d.ts +5 -0
- package/lib/cjs/components/index.js +11 -1
- package/lib/cjs/components/index.js.map +1 -1
- package/lib/cjs/components/whatsapp-catalog.d.ts +6 -0
- package/lib/cjs/components/whatsapp-catalog.js +25 -0
- package/lib/cjs/components/whatsapp-catalog.js.map +1 -0
- package/lib/cjs/components/whatsapp-media-carousel.d.ts +46 -0
- package/lib/cjs/components/whatsapp-media-carousel.js +40 -0
- package/lib/cjs/components/whatsapp-media-carousel.js.map +1 -0
- package/lib/cjs/components/whatsapp-product-carousel.d.ts +32 -0
- package/lib/cjs/components/whatsapp-product-carousel.js +34 -0
- package/lib/cjs/components/whatsapp-product-carousel.js.map +1 -0
- package/lib/cjs/components/whatsapp-product-list.d.ts +15 -0
- package/lib/cjs/components/whatsapp-product-list.js +26 -0
- package/lib/cjs/components/whatsapp-product-list.js.map +1 -0
- package/lib/cjs/components/whatsapp-product.d.ts +7 -0
- package/lib/cjs/components/whatsapp-product.js +25 -0
- package/lib/cjs/components/whatsapp-product.js.map +1 -0
- package/lib/cjs/util/functional.d.ts +3 -0
- package/lib/cjs/util/functional.js +30 -0
- package/lib/cjs/util/functional.js.map +1 -0
- package/package.json +2 -2
- package/src/components/index.ts +16 -0
- package/src/components/whatsapp-catalog.tsx +42 -0
- package/src/components/whatsapp-media-carousel.tsx +104 -0
- package/src/components/whatsapp-product-carousel.tsx +83 -0
- package/src/components/whatsapp-product-list.tsx +56 -0
- package/src/components/whatsapp-product.tsx +44 -0
- package/src/util/functional.ts +31 -0
- package/lib/esm/app.d.ts +0 -2
- package/lib/esm/app.js +0 -6
- package/lib/esm/app.js.map +0 -1
- package/lib/esm/botonic-tester.d.ts +0 -30
- package/lib/esm/botonic-tester.js +0 -78
- package/lib/esm/botonic-tester.js.map +0 -1
- package/lib/esm/components/audio.d.ts +0 -9
- package/lib/esm/components/audio.js +0 -21
- package/lib/esm/components/audio.js.map +0 -1
- package/lib/esm/components/button.d.ts +0 -17
- package/lib/esm/components/button.js +0 -159
- package/lib/esm/components/button.js.map +0 -1
- package/lib/esm/components/buttons-disabler.d.ts +0 -24
- package/lib/esm/components/buttons-disabler.js +0 -84
- package/lib/esm/components/buttons-disabler.js.map +0 -1
- package/lib/esm/components/carousel.d.ts +0 -10
- package/lib/esm/components/carousel.js +0 -105
- package/lib/esm/components/carousel.js.map +0 -1
- package/lib/esm/components/components.d.ts +0 -12
- package/lib/esm/components/components.js +0 -17
- package/lib/esm/components/components.js.map +0 -1
- package/lib/esm/components/custom-message.d.ts +0 -16
- package/lib/esm/components/custom-message.js +0 -50
- package/lib/esm/components/custom-message.js.map +0 -1
- package/lib/esm/components/document.d.ts +0 -9
- package/lib/esm/components/document.js +0 -42
- package/lib/esm/components/document.js.map +0 -1
- package/lib/esm/components/element.d.ts +0 -4
- package/lib/esm/components/element.js +0 -51
- package/lib/esm/components/element.js.map +0 -1
- package/lib/esm/components/handoff.d.ts +0 -1
- package/lib/esm/components/handoff.js +0 -49
- package/lib/esm/components/handoff.js.map +0 -1
- package/lib/esm/components/image.d.ts +0 -9
- package/lib/esm/components/image.js +0 -35
- package/lib/esm/components/image.js.map +0 -1
- package/lib/esm/components/index-types.d.ts +0 -89
- package/lib/esm/components/index-types.js +0 -2
- package/lib/esm/components/index-types.js.map +0 -1
- package/lib/esm/components/index.d.ts +0 -25
- package/lib/esm/components/index.js +0 -26
- package/lib/esm/components/index.js.map +0 -1
- package/lib/esm/components/location.d.ts +0 -11
- package/lib/esm/components/location.js +0 -27
- package/lib/esm/components/location.js.map +0 -1
- package/lib/esm/components/markdown.d.ts +0 -7
- package/lib/esm/components/markdown.js +0 -152
- package/lib/esm/components/markdown.js.map +0 -1
- package/lib/esm/components/message/index.d.ts +0 -1
- package/lib/esm/components/message/index.js +0 -147
- package/lib/esm/components/message/index.js.map +0 -1
- package/lib/esm/components/message/message-feedback.d.ts +0 -7
- package/lib/esm/components/message/message-feedback.js +0 -59
- package/lib/esm/components/message/message-feedback.js.map +0 -1
- package/lib/esm/components/message/message-footer.d.ts +0 -11
- package/lib/esm/components/message/message-footer.js +0 -17
- package/lib/esm/components/message/message-footer.js.map +0 -1
- package/lib/esm/components/message/message-image.d.ts +0 -7
- package/lib/esm/components/message/message-image.js +0 -19
- package/lib/esm/components/message/message-image.js.map +0 -1
- package/lib/esm/components/message/styles.d.ts +0 -33
- package/lib/esm/components/message/styles.js +0 -118
- package/lib/esm/components/message/styles.js.map +0 -1
- package/lib/esm/components/message/timestamps.d.ts +0 -13
- package/lib/esm/components/message/timestamps.js +0 -40
- package/lib/esm/components/message/timestamps.js.map +0 -1
- package/lib/esm/components/message-template.d.ts +0 -1
- package/lib/esm/components/message-template.js +0 -9
- package/lib/esm/components/message-template.js.map +0 -1
- package/lib/esm/components/multichannel/facebook/facebook.d.ts +0 -17
- package/lib/esm/components/multichannel/facebook/facebook.js +0 -43
- package/lib/esm/components/multichannel/facebook/facebook.js.map +0 -1
- package/lib/esm/components/multichannel/index-types.d.ts +0 -46
- package/lib/esm/components/multichannel/index-types.js +0 -2
- package/lib/esm/components/multichannel/index-types.js.map +0 -1
- package/lib/esm/components/multichannel/index.d.ts +0 -11
- package/lib/esm/components/multichannel/index.js +0 -12
- package/lib/esm/components/multichannel/index.js.map +0 -1
- package/lib/esm/components/multichannel/multichannel-button.d.ts +0 -1
- package/lib/esm/components/multichannel/multichannel-button.js +0 -67
- package/lib/esm/components/multichannel/multichannel-button.js.map +0 -1
- package/lib/esm/components/multichannel/multichannel-carousel.d.ts +0 -1
- package/lib/esm/components/multichannel/multichannel-carousel.js +0 -74
- package/lib/esm/components/multichannel/multichannel-carousel.js.map +0 -1
- package/lib/esm/components/multichannel/multichannel-context.d.ts +0 -11
- package/lib/esm/components/multichannel/multichannel-context.js +0 -12
- package/lib/esm/components/multichannel/multichannel-context.js.map +0 -1
- package/lib/esm/components/multichannel/multichannel-reply.d.ts +0 -1
- package/lib/esm/components/multichannel/multichannel-reply.js +0 -20
- package/lib/esm/components/multichannel/multichannel-reply.js.map +0 -1
- package/lib/esm/components/multichannel/multichannel-text.d.ts +0 -1
- package/lib/esm/components/multichannel/multichannel-text.js +0 -160
- package/lib/esm/components/multichannel/multichannel-text.js.map +0 -1
- package/lib/esm/components/multichannel/multichannel-utils.d.ts +0 -21
- package/lib/esm/components/multichannel/multichannel-utils.js +0 -81
- package/lib/esm/components/multichannel/multichannel-utils.js.map +0 -1
- package/lib/esm/components/multichannel/multichannel.d.ts +0 -1
- package/lib/esm/components/multichannel/multichannel.js +0 -57
- package/lib/esm/components/multichannel/multichannel.js.map +0 -1
- package/lib/esm/components/multichannel/whatsapp/constants.d.ts +0 -11
- package/lib/esm/components/multichannel/whatsapp/constants.js +0 -10
- package/lib/esm/components/multichannel/whatsapp/constants.js.map +0 -1
- package/lib/esm/components/multichannel/whatsapp/markdown-meta.d.ts +0 -1
- package/lib/esm/components/multichannel/whatsapp/markdown-meta.js +0 -38
- package/lib/esm/components/multichannel/whatsapp/markdown-meta.js.map +0 -1
- package/lib/esm/components/pic.d.ts +0 -6
- package/lib/esm/components/pic.js +0 -25
- package/lib/esm/components/pic.js.map +0 -1
- package/lib/esm/components/raw.d.ts +0 -9
- package/lib/esm/components/raw.js +0 -39
- package/lib/esm/components/raw.js.map +0 -1
- package/lib/esm/components/reply.d.ts +0 -10
- package/lib/esm/components/reply.js +0 -53
- package/lib/esm/components/reply.js.map +0 -1
- package/lib/esm/components/share-button.d.ts +0 -1
- package/lib/esm/components/share-button.js +0 -9
- package/lib/esm/components/share-button.js.map +0 -1
- package/lib/esm/components/subtitle.d.ts +0 -6
- package/lib/esm/components/subtitle.js +0 -19
- package/lib/esm/components/subtitle.js.map +0 -1
- package/lib/esm/components/text.d.ts +0 -7
- package/lib/esm/components/text.js +0 -40
- package/lib/esm/components/text.js.map +0 -1
- package/lib/esm/components/title.d.ts +0 -6
- package/lib/esm/components/title.js +0 -17
- package/lib/esm/components/title.js.map +0 -1
- package/lib/esm/components/video.d.ts +0 -9
- package/lib/esm/components/video.js +0 -25
- package/lib/esm/components/video.js.map +0 -1
- package/lib/esm/components/webchat-settings.d.ts +0 -16
- package/lib/esm/components/webchat-settings.js +0 -69
- package/lib/esm/components/webchat-settings.js.map +0 -1
- package/lib/esm/components/whatsapp-button-list.d.ts +0 -20
- package/lib/esm/components/whatsapp-button-list.js +0 -47
- package/lib/esm/components/whatsapp-button-list.js.map +0 -1
- package/lib/esm/components/whatsapp-cta-url-button.d.ts +0 -15
- package/lib/esm/components/whatsapp-cta-url-button.js +0 -33
- package/lib/esm/components/whatsapp-cta-url-button.js.map +0 -1
- package/lib/esm/components/whatsapp-template.d.ts +0 -1
- package/lib/esm/components/whatsapp-template.js +0 -20
- package/lib/esm/components/whatsapp-template.js.map +0 -1
- package/lib/esm/constants.d.ts +0 -165
- package/lib/esm/constants.js +0 -187
- package/lib/esm/constants.js.map +0 -1
- package/lib/esm/contexts.d.ts +0 -18
- package/lib/esm/contexts.js +0 -18
- package/lib/esm/contexts.js.map +0 -1
- package/lib/esm/dev-app.d.ts +0 -38
- package/lib/esm/dev-app.js +0 -81
- package/lib/esm/dev-app.js.map +0 -1
- package/lib/esm/index-types.d.ts +0 -178
- package/lib/esm/index-types.js +0 -12
- package/lib/esm/index-types.js.map +0 -1
- package/lib/esm/index.d.ts +0 -11
- package/lib/esm/index.js +0 -12
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/message-utils.d.ts +0 -19
- package/lib/esm/message-utils.js +0 -41
- package/lib/esm/message-utils.js.map +0 -1
- package/lib/esm/msg-to-botonic.d.ts +0 -18
- package/lib/esm/msg-to-botonic.js +0 -132
- package/lib/esm/msg-to-botonic.js.map +0 -1
- package/lib/esm/node-app.d.ts +0 -7
- package/lib/esm/node-app.js +0 -19
- package/lib/esm/node-app.js.map +0 -1
- package/lib/esm/react-bot.d.ts +0 -8
- package/lib/esm/react-bot.js +0 -32
- package/lib/esm/react-bot.js.map +0 -1
- package/lib/esm/shared/styles.d.ts +0 -2
- package/lib/esm/shared/styles.js +0 -28
- package/lib/esm/shared/styles.js.map +0 -1
- package/lib/esm/util/dom.d.ts +0 -4
- package/lib/esm/util/dom.js +0 -24
- package/lib/esm/util/dom.js.map +0 -1
- package/lib/esm/util/environment.d.ts +0 -6
- package/lib/esm/util/environment.js +0 -61
- package/lib/esm/util/environment.js.map +0 -1
- package/lib/esm/util/error-boundary.d.ts +0 -7
- package/lib/esm/util/error-boundary.js +0 -28
- package/lib/esm/util/error-boundary.js.map +0 -1
- package/lib/esm/util/index.d.ts +0 -9
- package/lib/esm/util/index.js +0 -10
- package/lib/esm/util/index.js.map +0 -1
- package/lib/esm/util/logs.d.ts +0 -2
- package/lib/esm/util/logs.js +0 -15
- package/lib/esm/util/logs.js.map +0 -1
- package/lib/esm/util/objects.d.ts +0 -3
- package/lib/esm/util/objects.js +0 -38
- package/lib/esm/util/objects.js.map +0 -1
- package/lib/esm/util/react.d.ts +0 -12
- package/lib/esm/util/react.js +0 -34
- package/lib/esm/util/react.js.map +0 -1
- package/lib/esm/util/regexs.d.ts +0 -2
- package/lib/esm/util/regexs.js +0 -18
- package/lib/esm/util/regexs.js.map +0 -1
- package/lib/esm/util/strings.d.ts +0 -1
- package/lib/esm/util/strings.js +0 -7
- package/lib/esm/util/strings.js.map +0 -1
- package/lib/esm/util/webchat.d.ts +0 -22
- package/lib/esm/util/webchat.js +0 -55
- package/lib/esm/util/webchat.js.map +0 -1
- package/lib/esm/util/webviews.d.ts +0 -1
- package/lib/esm/util/webviews.js +0 -6
- package/lib/esm/util/webviews.js.map +0 -1
- package/lib/esm/webchat/chat-area/index.d.ts +0 -1
- package/lib/esm/webchat/chat-area/index.js +0 -18
- package/lib/esm/webchat/chat-area/index.js.map +0 -1
- package/lib/esm/webchat/chat-area/styles.d.ts +0 -3
- package/lib/esm/webchat/chat-area/styles.js +0 -9
- package/lib/esm/webchat/chat-area/styles.js.map +0 -1
- package/lib/esm/webchat/components/common.d.ts +0 -1
- package/lib/esm/webchat/components/common.js +0 -9
- package/lib/esm/webchat/components/common.js.map +0 -1
- package/lib/esm/webchat/components/conditional-animation.d.ts +0 -1
- package/lib/esm/webchat/components/conditional-animation.js +0 -12
- package/lib/esm/webchat/components/conditional-animation.js.map +0 -1
- package/lib/esm/webchat/components/opened-persistent-menu.d.ts +0 -6
- package/lib/esm/webchat/components/opened-persistent-menu.js +0 -30
- package/lib/esm/webchat/components/opened-persistent-menu.js.map +0 -1
- package/lib/esm/webchat/constants.d.ts +0 -8
- package/lib/esm/webchat/constants.js +0 -10
- package/lib/esm/webchat/constants.js.map +0 -1
- package/lib/esm/webchat/context/actions.d.ts +0 -29
- package/lib/esm/webchat/context/actions.js +0 -32
- package/lib/esm/webchat/context/actions.js.map +0 -1
- package/lib/esm/webchat/context/index.d.ts +0 -5
- package/lib/esm/webchat/context/index.js +0 -78
- package/lib/esm/webchat/context/index.js.map +0 -1
- package/lib/esm/webchat/context/messages-reducer.d.ts +0 -6
- package/lib/esm/webchat/context/messages-reducer.js +0 -85
- package/lib/esm/webchat/context/messages-reducer.js.map +0 -1
- package/lib/esm/webchat/context/types.d.ts +0 -74
- package/lib/esm/webchat/context/types.js +0 -2
- package/lib/esm/webchat/context/types.js.map +0 -1
- package/lib/esm/webchat/context/use-webchat.d.ts +0 -47
- package/lib/esm/webchat/context/use-webchat.js +0 -195
- package/lib/esm/webchat/context/use-webchat.js.map +0 -1
- package/lib/esm/webchat/context/webchat-reducer.d.ts +0 -6
- package/lib/esm/webchat/context/webchat-reducer.js +0 -48
- package/lib/esm/webchat/context/webchat-reducer.js.map +0 -1
- package/lib/esm/webchat/cover-component/index.d.ts +0 -6
- package/lib/esm/webchat/cover-component/index.js +0 -17
- package/lib/esm/webchat/cover-component/index.js.map +0 -1
- package/lib/esm/webchat/devices/index.d.ts +0 -11
- package/lib/esm/webchat/devices/index.js +0 -18
- package/lib/esm/webchat/devices/index.js.map +0 -1
- package/lib/esm/webchat/header/default-header.d.ts +0 -1
- package/lib/esm/webchat/header/default-header.js +0 -21
- package/lib/esm/webchat/header/default-header.js.map +0 -1
- package/lib/esm/webchat/header/index.d.ts +0 -2
- package/lib/esm/webchat/header/index.js +0 -20
- package/lib/esm/webchat/header/index.js.map +0 -1
- package/lib/esm/webchat/header/styles.d.ts +0 -7
- package/lib/esm/webchat/header/styles.js +0 -55
- package/lib/esm/webchat/header/styles.js.map +0 -1
- package/lib/esm/webchat/hooks/index.d.ts +0 -10
- package/lib/esm/webchat/hooks/index.js +0 -11
- package/lib/esm/webchat/hooks/index.js.map +0 -1
- package/lib/esm/webchat/hooks/use-component-visible.d.ts +0 -8
- package/lib/esm/webchat/hooks/use-component-visible.js +0 -20
- package/lib/esm/webchat/hooks/use-component-visible.js.map +0 -1
- package/lib/esm/webchat/hooks/use-component-will-mount.d.ts +0 -1
- package/lib/esm/webchat/hooks/use-component-will-mount.js +0 -5
- package/lib/esm/webchat/hooks/use-component-will-mount.js.map +0 -1
- package/lib/esm/webchat/hooks/use-device-adapter.d.ts +0 -3
- package/lib/esm/webchat/hooks/use-device-adapter.js +0 -42
- package/lib/esm/webchat/hooks/use-device-adapter.js.map +0 -1
- package/lib/esm/webchat/hooks/use-previous.d.ts +0 -1
- package/lib/esm/webchat/hooks/use-previous.js +0 -9
- package/lib/esm/webchat/hooks/use-previous.js.map +0 -1
- package/lib/esm/webchat/hooks/use-scroll-to-bottom.d.ts +0 -9
- package/lib/esm/webchat/hooks/use-scroll-to-bottom.js +0 -19
- package/lib/esm/webchat/hooks/use-scroll-to-bottom.js.map +0 -1
- package/lib/esm/webchat/hooks/use-scrollbar-controller.d.ts +0 -6
- package/lib/esm/webchat/hooks/use-scrollbar-controller.js +0 -136
- package/lib/esm/webchat/hooks/use-scrollbar-controller.js.map +0 -1
- package/lib/esm/webchat/hooks/use-typing.d.ts +0 -10
- package/lib/esm/webchat/hooks/use-typing.js +0 -28
- package/lib/esm/webchat/hooks/use-typing.js.map +0 -1
- package/lib/esm/webchat/hooks/use-virtual-keyboard-detection.d.ts +0 -3
- package/lib/esm/webchat/hooks/use-virtual-keyboard-detection.js +0 -24
- package/lib/esm/webchat/hooks/use-virtual-keyboard-detection.js.map +0 -1
- package/lib/esm/webchat/hooks/use-webchat-dimensions.d.ts +0 -4
- package/lib/esm/webchat/hooks/use-webchat-dimensions.js +0 -36
- package/lib/esm/webchat/hooks/use-webchat-dimensions.js.map +0 -1
- package/lib/esm/webchat/hooks/use-webchat-resizer.d.ts +0 -4
- package/lib/esm/webchat/hooks/use-webchat-resizer.js +0 -30
- package/lib/esm/webchat/hooks/use-webchat-resizer.js.map +0 -1
- package/lib/esm/webchat/index-types.d.ts +0 -18
- package/lib/esm/webchat/index-types.js +0 -2
- package/lib/esm/webchat/index-types.js.map +0 -1
- package/lib/esm/webchat/index.d.ts +0 -5
- package/lib/esm/webchat/index.js +0 -11
- package/lib/esm/webchat/index.js.map +0 -1
- package/lib/esm/webchat/input-panel/attachment.d.ts +0 -7
- package/lib/esm/webchat/input-panel/attachment.js +0 -26
- package/lib/esm/webchat/input-panel/attachment.js.map +0 -1
- package/lib/esm/webchat/input-panel/emoji-picker.d.ts +0 -6
- package/lib/esm/webchat/input-panel/emoji-picker.js +0 -23
- package/lib/esm/webchat/input-panel/emoji-picker.js.map +0 -1
- package/lib/esm/webchat/input-panel/index.d.ts +0 -12
- package/lib/esm/webchat/input-panel/index.js +0 -55
- package/lib/esm/webchat/input-panel/index.js.map +0 -1
- package/lib/esm/webchat/input-panel/opened-emoji-picker.d.ts +0 -6
- package/lib/esm/webchat/input-panel/opened-emoji-picker.js +0 -10
- package/lib/esm/webchat/input-panel/opened-emoji-picker.js.map +0 -1
- package/lib/esm/webchat/input-panel/persistent-menu.d.ts +0 -6
- package/lib/esm/webchat/input-panel/persistent-menu.js +0 -14
- package/lib/esm/webchat/input-panel/persistent-menu.js.map +0 -1
- package/lib/esm/webchat/input-panel/send-button.d.ts +0 -5
- package/lib/esm/webchat/input-panel/send-button.js +0 -14
- package/lib/esm/webchat/input-panel/send-button.js.map +0 -1
- package/lib/esm/webchat/input-panel/styles.d.ts +0 -3
- package/lib/esm/webchat/input-panel/styles.js +0 -27
- package/lib/esm/webchat/input-panel/styles.js.map +0 -1
- package/lib/esm/webchat/input-panel/textarea.d.ts +0 -11
- package/lib/esm/webchat/input-panel/textarea.js +0 -58
- package/lib/esm/webchat/input-panel/textarea.js.map +0 -1
- package/lib/esm/webchat/message-list/index.d.ts +0 -1
- package/lib/esm/webchat/message-list/index.js +0 -107
- package/lib/esm/webchat/message-list/index.js.map +0 -1
- package/lib/esm/webchat/message-list/intro-message.d.ts +0 -1
- package/lib/esm/webchat/message-list/intro-message.js +0 -18
- package/lib/esm/webchat/message-list/intro-message.js.map +0 -1
- package/lib/esm/webchat/message-list/scroll-button.d.ts +0 -6
- package/lib/esm/webchat/message-list/scroll-button.js +0 -12
- package/lib/esm/webchat/message-list/scroll-button.js.map +0 -1
- package/lib/esm/webchat/message-list/styles.d.ts +0 -5
- package/lib/esm/webchat/message-list/styles.js +0 -56
- package/lib/esm/webchat/message-list/styles.js.map +0 -1
- package/lib/esm/webchat/message-list/unread-messages-banner.d.ts +0 -6
- package/lib/esm/webchat/message-list/unread-messages-banner.js +0 -13
- package/lib/esm/webchat/message-list/unread-messages-banner.js.map +0 -1
- package/lib/esm/webchat/message-list/use-debounce.d.ts +0 -1
- package/lib/esm/webchat/message-list/use-debounce.js +0 -14
- package/lib/esm/webchat/message-list/use-debounce.js.map +0 -1
- package/lib/esm/webchat/message-list/use-notifications.d.ts +0 -7
- package/lib/esm/webchat/message-list/use-notifications.js +0 -20
- package/lib/esm/webchat/message-list/use-notifications.js.map +0 -1
- package/lib/esm/webchat/replies/index.d.ts +0 -1
- package/lib/esm/webchat/replies/index.js +0 -28
- package/lib/esm/webchat/replies/index.js.map +0 -1
- package/lib/esm/webchat/replies/styles.d.ts +0 -8
- package/lib/esm/webchat/replies/styles.js +0 -21
- package/lib/esm/webchat/replies/styles.js.map +0 -1
- package/lib/esm/webchat/session-view.d.ts +0 -1
- package/lib/esm/webchat/session-view.js +0 -96
- package/lib/esm/webchat/session-view.js.map +0 -1
- package/lib/esm/webchat/styles.d.ts +0 -9
- package/lib/esm/webchat/styles.js +0 -50
- package/lib/esm/webchat/styles.js.map +0 -1
- package/lib/esm/webchat/theme/types.d.ts +0 -167
- package/lib/esm/webchat/theme/types.js +0 -2
- package/lib/esm/webchat/theme/types.js.map +0 -1
- package/lib/esm/webchat/tracking.d.ts +0 -7
- package/lib/esm/webchat/tracking.js +0 -10
- package/lib/esm/webchat/tracking.js.map +0 -1
- package/lib/esm/webchat/trigger-button/index.d.ts +0 -2
- package/lib/esm/webchat/trigger-button/index.js +0 -28
- package/lib/esm/webchat/trigger-button/index.js.map +0 -1
- package/lib/esm/webchat/trigger-button/styles.d.ts +0 -3
- package/lib/esm/webchat/trigger-button/styles.js +0 -36
- package/lib/esm/webchat/trigger-button/styles.js.map +0 -1
- package/lib/esm/webchat/typing-indicator/index.d.ts +0 -3
- package/lib/esm/webchat/typing-indicator/index.js +0 -8
- package/lib/esm/webchat/typing-indicator/index.js.map +0 -1
- package/lib/esm/webchat/typing-indicator/styles.d.ts +0 -7
- package/lib/esm/webchat/typing-indicator/styles.js +0 -46
- package/lib/esm/webchat/typing-indicator/styles.js.map +0 -1
- package/lib/esm/webchat/use-storage-state-hook.d.ts +0 -1
- package/lib/esm/webchat/use-storage-state-hook.js +0 -38
- package/lib/esm/webchat/use-storage-state-hook.js.map +0 -1
- package/lib/esm/webchat/utils.d.ts +0 -2
- package/lib/esm/webchat/utils.js +0 -8
- package/lib/esm/webchat/utils.js.map +0 -1
- package/lib/esm/webchat/webchat-dev.d.ts +0 -7
- package/lib/esm/webchat/webchat-dev.js +0 -56
- package/lib/esm/webchat/webchat-dev.js.map +0 -1
- package/lib/esm/webchat/webchat.d.ts +0 -4
- package/lib/esm/webchat/webchat.js +0 -522
- package/lib/esm/webchat/webchat.js.map +0 -1
- package/lib/esm/webchat/webview.d.ts +0 -2
- package/lib/esm/webchat/webview.js +0 -71
- package/lib/esm/webchat/webview.js.map +0 -1
- package/lib/esm/webchat-app.d.ts +0 -78
- package/lib/esm/webchat-app.js +0 -363
- package/lib/esm/webchat-app.js.map +0 -1
- package/lib/esm/webview-app.d.ts +0 -7
- package/lib/esm/webview-app.js +0 -105
- package/lib/esm/webview-app.js.map +0 -1
package/lib/esm/constants.js
DELETED
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import BotonicLogo from './assets/botonic_react_logo100x100.png';
|
|
2
|
-
import UrlIcon from './assets/url-icon.png';
|
|
3
|
-
export const COLORS = {
|
|
4
|
-
// http://chir.ag/projects/name-that-color
|
|
5
|
-
APPLE_GREEN: 'rgba(58, 156, 53, 1)',
|
|
6
|
-
BLEACHED_CEDAR_PURPLE: 'rgba(46, 32, 59, 1)',
|
|
7
|
-
BOTONIC_BLUE: 'rgba(0, 153, 255, 1)',
|
|
8
|
-
CACTUS_GREEN: 'rgba(96, 115, 94, 1)',
|
|
9
|
-
CONCRETE_WHITE: 'rgba(243, 243, 243, 1)',
|
|
10
|
-
CURIOUS_BLUE: 'rgba(38, 139, 210, 1)',
|
|
11
|
-
DAINTREE_BLUE: 'rgba(0, 43, 53, 1)',
|
|
12
|
-
ERROR_RED: 'rgba(255, 43, 94)',
|
|
13
|
-
FRINGY_FLOWER_GREEN: 'rgba(198, 231, 192, 1)',
|
|
14
|
-
GRAY: 'rgba(129, 129, 129, 1)',
|
|
15
|
-
LIGHT_GRAY: 'rgba(209, 209, 209, 1)',
|
|
16
|
-
MID_GRAY: 'rgba(105, 105, 115, 1)',
|
|
17
|
-
PIGEON_POST_BLUE_ALPHA_0_5: 'rgba(176, 196, 222, 0.5)',
|
|
18
|
-
RED_NOTIFICATIONS: 'rgba(255, 66, 111, 1)',
|
|
19
|
-
SCORPION_GRAY: 'rgba(87, 87, 87, 1)',
|
|
20
|
-
SEASHELL_WHITE: 'rgba(241, 240, 240, 1)',
|
|
21
|
-
SILVER: 'rgba(200, 200, 200, 1)',
|
|
22
|
-
SOLID_BLACK_ALPHA_0_2: 'rgba(0, 0, 0, 0.2)',
|
|
23
|
-
SOLID_BLACK_ALPHA_0_5: 'rgba(0, 0, 0, 0.5)',
|
|
24
|
-
SOLID_BLACK: 'rgba(0, 0, 0, 1)',
|
|
25
|
-
SOLID_WHITE_ALPHA_0_2: 'rgba(255, 255, 255, 0.2)',
|
|
26
|
-
SOLID_WHITE_ALPHA_0_8: 'rgba(255, 255, 255, 0.8)',
|
|
27
|
-
SOLID_WHITE: 'rgba(255, 255, 255, 1)',
|
|
28
|
-
TASMAN_GRAY: 'rgba(209, 216, 207, 1)',
|
|
29
|
-
TRANSPARENT: 'rgba(0, 0, 0, 0)',
|
|
30
|
-
WILD_SAND_WHITE: 'rgba(244, 244, 244, 1)',
|
|
31
|
-
};
|
|
32
|
-
export const WEBCHAT = {
|
|
33
|
-
DEFAULTS: {
|
|
34
|
-
WIDTH: 300,
|
|
35
|
-
HEIGHT: 450,
|
|
36
|
-
TITLE: 'Botonic',
|
|
37
|
-
LOGO: BotonicLogo,
|
|
38
|
-
URL_ICON: UrlIcon,
|
|
39
|
-
PLACEHOLDER: 'Ask me something...',
|
|
40
|
-
FONT_FAMILY: "'Noto Sans JP', sans-serif",
|
|
41
|
-
BORDER_RADIUS_TOP_CORNERS: '6px 6px 0px 0px',
|
|
42
|
-
ELEMENT_WIDTH: 222,
|
|
43
|
-
ELEMENT_MARGIN_RIGHT: 6,
|
|
44
|
-
STORAGE_KEY: 'botonicState',
|
|
45
|
-
HOST_ID: 'root',
|
|
46
|
-
ID: 'botonic-webchat',
|
|
47
|
-
BUTTON_AUTO_DISABLE: false,
|
|
48
|
-
BUTTON_DISABLED_STYLE: {
|
|
49
|
-
opacity: 0.5,
|
|
50
|
-
cursor: 'auto',
|
|
51
|
-
pointerEvents: 'none',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
CUSTOM_PROPERTIES: {
|
|
55
|
-
// General
|
|
56
|
-
enableAnimations: 'animations.enable',
|
|
57
|
-
markdownStyle: 'markdownStyle',
|
|
58
|
-
imagePreviewer: 'imagePreviewer',
|
|
59
|
-
// Mobile
|
|
60
|
-
mobileBreakpoint: 'mobileBreakpoint',
|
|
61
|
-
mobileStyle: 'mobileStyle',
|
|
62
|
-
// Webviews
|
|
63
|
-
webviewHeaderStyle: 'webview.header.style',
|
|
64
|
-
webviewStyle: 'webview.style',
|
|
65
|
-
// Brand
|
|
66
|
-
brandColor: 'brand.color',
|
|
67
|
-
brandImage: 'brand.image',
|
|
68
|
-
// Header
|
|
69
|
-
customHeader: 'header.custom',
|
|
70
|
-
headerImage: 'header.image',
|
|
71
|
-
headerStyle: 'header.style',
|
|
72
|
-
headerSubtitle: 'header.subtitle',
|
|
73
|
-
headerTitle: 'header.title',
|
|
74
|
-
// Bot Message
|
|
75
|
-
botMessageBackground: 'message.bot.style.background',
|
|
76
|
-
botMessageBlobTick: 'message.bot.blobTick',
|
|
77
|
-
botMessageBlobTickStyle: 'message.bot.blobTickStyle',
|
|
78
|
-
botMessageBlobWidth: 'message.bot.blobWidth',
|
|
79
|
-
botMessageBorderColor: 'message.bot.style.borderColor',
|
|
80
|
-
botMessageImage: 'message.bot.image',
|
|
81
|
-
botMessageImageStyle: 'message.bot.imageStyle',
|
|
82
|
-
botMessageStyle: 'message.bot.style',
|
|
83
|
-
// Agent Message
|
|
84
|
-
agentMessageImage: 'message.agent.image',
|
|
85
|
-
// User Message
|
|
86
|
-
customMessageTypes: 'message.customTypes',
|
|
87
|
-
messageStyle: 'message.style',
|
|
88
|
-
userMessageBackground: 'message.user.style.background',
|
|
89
|
-
userMessageBlobTick: 'message.user.blobTick',
|
|
90
|
-
userMessageBlobTickStyle: 'message.user.blobTickStyle',
|
|
91
|
-
userMessageBorderColor: 'message.user.style.borderColor',
|
|
92
|
-
userMessageStyle: 'message.user.style',
|
|
93
|
-
// Timestamps
|
|
94
|
-
enableMessageTimestamps: 'message.timestamps.enable',
|
|
95
|
-
messageTimestampsFormat: 'message.timestamps.format',
|
|
96
|
-
messageTimestampsStyle: 'message.timestamps.style',
|
|
97
|
-
messageTimestampsWithImage: 'message.timestamps.withImage',
|
|
98
|
-
// Intro
|
|
99
|
-
customIntro: 'intro.custom',
|
|
100
|
-
introImage: 'intro.image',
|
|
101
|
-
introStyle: 'intro.style',
|
|
102
|
-
// Buttons
|
|
103
|
-
buttonHoverBackground: 'button.hoverBackground',
|
|
104
|
-
buttonHoverTextColor: 'button.hoverTextColor',
|
|
105
|
-
buttonMessageType: 'button.messageType',
|
|
106
|
-
buttonStyle: 'button.style',
|
|
107
|
-
buttonDisabledStyle: 'button.disabledstyle',
|
|
108
|
-
buttonAutoDisable: 'button.autodisable',
|
|
109
|
-
buttonStyleBackground: 'button.style.background',
|
|
110
|
-
buttonStyleColor: 'button.style.color',
|
|
111
|
-
customButton: 'button.custom',
|
|
112
|
-
urlIconImage: 'button.urlIcon.image',
|
|
113
|
-
urlIconEnabled: 'button.urlIcon.enable',
|
|
114
|
-
// Replies
|
|
115
|
-
alignReplies: 'replies.align',
|
|
116
|
-
customReply: 'reply.custom',
|
|
117
|
-
replyStyle: 'reply.style',
|
|
118
|
-
wrapReplies: 'replies.wrap',
|
|
119
|
-
// TriggerButton
|
|
120
|
-
customTrigger: 'triggerButton.custom',
|
|
121
|
-
triggerButtonImage: 'triggerButton.image',
|
|
122
|
-
triggerButtonStyle: 'triggerButton.style',
|
|
123
|
-
// Notifications
|
|
124
|
-
notificationsEnabled: 'notifications.enable',
|
|
125
|
-
notificationsBannerEnabled: 'notifications.banner.enable',
|
|
126
|
-
notificationsBannerCustom: 'notifications.banner.custom',
|
|
127
|
-
notificationsBannerText: 'notifications.banner.text',
|
|
128
|
-
notificationsTriggerButtonEnabled: 'notifications.triggerButton.enable',
|
|
129
|
-
// Scroll Button
|
|
130
|
-
scrollButtonEnabled: 'scrollButton.enable',
|
|
131
|
-
scrollButtonCustom: 'scrollButton.custom',
|
|
132
|
-
// User Input
|
|
133
|
-
blockInputs: 'userInput.blockInputs',
|
|
134
|
-
documentDownload: 'documentDownload',
|
|
135
|
-
customMenuButton: 'userInput.menuButton.custom',
|
|
136
|
-
customPersistentMenu: 'userInput.menu.custom',
|
|
137
|
-
customEmojiPicker: 'userInput.emojiPicker.custom',
|
|
138
|
-
customAttachments: 'userInput.attachments.custom',
|
|
139
|
-
customSendButton: 'userInput.sendButton.custom',
|
|
140
|
-
darkBackgroundMenu: 'userInput.menu.darkBackground',
|
|
141
|
-
enableAttachments: 'userInput.attachments.enable',
|
|
142
|
-
enableEmojiPicker: 'userInput.emojiPicker.enable',
|
|
143
|
-
enableSendButton: 'userInput.sendButton.enable',
|
|
144
|
-
enableUserInput: 'userInput.enable',
|
|
145
|
-
persistentMenu: 'userInput.persistentMenu',
|
|
146
|
-
textPlaceholder: 'userInput.box.placeholder',
|
|
147
|
-
userInputBoxStyle: 'userInput.box.style',
|
|
148
|
-
userInputStyle: 'userInput.style',
|
|
149
|
-
// Cover Component
|
|
150
|
-
coverComponent: 'coverComponent.component',
|
|
151
|
-
coverComponentProps: 'coverComponent.props',
|
|
152
|
-
// Carousel
|
|
153
|
-
customCarouselLeftArrow: 'carousel.arrow.left',
|
|
154
|
-
customCarouselRightArrow: 'carousel.arrow.right',
|
|
155
|
-
enableCarouselArrows: 'carousel.enableArrows',
|
|
156
|
-
},
|
|
157
|
-
};
|
|
158
|
-
export const MIME_WHITELIST = {
|
|
159
|
-
audio: ['audio/mpeg', 'audio/mp3'],
|
|
160
|
-
document: ['application/pdf'],
|
|
161
|
-
image: ['image/jpeg', 'image/png'],
|
|
162
|
-
video: ['video/mp4', 'video/quicktime'],
|
|
163
|
-
};
|
|
164
|
-
export const MAX_ALLOWED_SIZE_MB = 10;
|
|
165
|
-
export const ROLES = {
|
|
166
|
-
ATTACHMENT_ICON: 'attachment-icon',
|
|
167
|
-
EMOJI_PICKER_ICON: 'emoji-picker-icon',
|
|
168
|
-
EMOJI_PICKER: 'emoji-picker',
|
|
169
|
-
HEADER: 'header',
|
|
170
|
-
MESSAGE_LIST: 'message-list',
|
|
171
|
-
PERSISTENT_MENU_ICON: 'persistent-menu-icon',
|
|
172
|
-
PERSISTENT_MENU: 'persistent-menu',
|
|
173
|
-
SEND_BUTTON_ICON: 'send-button-icon',
|
|
174
|
-
WEBCHAT: 'webchat',
|
|
175
|
-
TRIGGER_BUTTON: 'trigger-button',
|
|
176
|
-
TYPING_INDICATOR: 'typing-indicator',
|
|
177
|
-
TEXT_BOX: 'textbox',
|
|
178
|
-
WEBVIEW: 'webview',
|
|
179
|
-
WEBVIEW_HEADER: 'webview-header',
|
|
180
|
-
MESSAGE: 'message',
|
|
181
|
-
IMAGE_MESSAGE: 'image-message',
|
|
182
|
-
AUDIO_MESSAGE: 'audio-message',
|
|
183
|
-
VIDEO_MESSAGE: 'video-message',
|
|
184
|
-
DOCUMENT_MESSAGE: 'document-message',
|
|
185
|
-
RAW_MESSAGE: 'raw-message',
|
|
186
|
-
};
|
|
187
|
-
//# sourceMappingURL=constants.js.map
|
package/lib/esm/constants.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.js"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,wCAAwC,CAAA;AAChE,OAAO,OAAO,MAAM,uBAAuB,CAAA;AAE3C,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,0CAA0C;IAC1C,WAAW,EAAE,sBAAsB;IACnC,qBAAqB,EAAE,qBAAqB;IAC5C,YAAY,EAAE,sBAAsB;IACpC,YAAY,EAAE,sBAAsB;IACpC,cAAc,EAAE,wBAAwB;IACxC,YAAY,EAAE,uBAAuB;IACrC,aAAa,EAAE,oBAAoB;IACnC,SAAS,EAAE,mBAAmB;IAC9B,mBAAmB,EAAE,wBAAwB;IAC7C,IAAI,EAAE,wBAAwB;IAC9B,UAAU,EAAE,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,KAAK,EAAE,CAAC,WAAW,EAAE,iBAAiB,CAAC;CACxC,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAA;AAErC,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,eAAe,EAAE,iBAAiB;IAClC,iBAAiB,EAAE,mBAAmB;IACtC,YAAY,EAAE,cAAc;IAC5B,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,cAAc;IAC5B,oBAAoB,EAAE,sBAAsB;IAC5C,eAAe,EAAE,iBAAiB;IAClC,gBAAgB,EAAE,kBAAkB;IACpC,OAAO,EAAE,SAAS;IAClB,cAAc,EAAE,gBAAgB;IAChC,gBAAgB,EAAE,kBAAkB;IACpC,QAAQ,EAAE,SAAS;IACnB,OAAO,EAAE,SAAS;IAClB,cAAc,EAAE,gBAAgB;IAChC,OAAO,EAAE,SAAS;IAClB,aAAa,EAAE,eAAe;IAC9B,aAAa,EAAE,eAAe;IAC9B,aAAa,EAAE,eAAe;IAC9B,gBAAgB,EAAE,kBAAkB;IACpC,WAAW,EAAE,aAAa;CAC3B,CAAA"}
|
package/lib/esm/contexts.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Session as CoreSession } from '@botonic/core';
|
|
3
|
-
import { ActionRequest } from './index-types';
|
|
4
|
-
export declare const RequestContext: import("react").Context<Partial<ActionRequest> & {
|
|
5
|
-
getString: () => string;
|
|
6
|
-
setLocale: () => void;
|
|
7
|
-
}>;
|
|
8
|
-
export interface CloseWebviewOptions {
|
|
9
|
-
payload?: string;
|
|
10
|
-
path?: string;
|
|
11
|
-
params?: Record<string, any>;
|
|
12
|
-
}
|
|
13
|
-
export declare const WebviewRequestContext: import("react").Context<{
|
|
14
|
-
closeWebview: (options?: CloseWebviewOptions) => Promise<void>;
|
|
15
|
-
getString?: ((stringId: string) => string) | undefined;
|
|
16
|
-
params: Record<string, any>;
|
|
17
|
-
session: Partial<CoreSession>;
|
|
18
|
-
}>;
|
package/lib/esm/contexts.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { __awaiter } from "tslib";
|
|
2
|
-
import { createContext } from 'react';
|
|
3
|
-
export const RequestContext = createContext({
|
|
4
|
-
getString: () => '',
|
|
5
|
-
setLocale: () => undefined,
|
|
6
|
-
session: {},
|
|
7
|
-
params: {},
|
|
8
|
-
input: {},
|
|
9
|
-
defaultDelay: 0,
|
|
10
|
-
defaultTyping: 0,
|
|
11
|
-
});
|
|
12
|
-
export const WebviewRequestContext = createContext({
|
|
13
|
-
closeWebview: () => __awaiter(void 0, void 0, void 0, function* () { return undefined; }),
|
|
14
|
-
getString: undefined,
|
|
15
|
-
params: {},
|
|
16
|
-
session: {},
|
|
17
|
-
});
|
|
18
|
-
//# sourceMappingURL=contexts.js.map
|
package/lib/esm/contexts.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contexts.js","sourceRoot":"","sources":["../../src/contexts.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAIrC,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAKzC;IACA,SAAS,EAAE,GAAG,EAAE,CAAC,EAAE;IACnB,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS;IAC1B,OAAO,EAAE,EAAiB;IAC1B,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAe;IACtB,YAAY,EAAE,CAAC;IACf,aAAa,EAAE,CAAC;CACjB,CAAC,CAAA;AAQF,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAK/C;IACD,YAAY,EAAE,GAAS,EAAE,kDAAC,OAAA,SAAS,CAAA,GAAA;IACnC,SAAS,EAAE,SAAS;IACpB,MAAM,EAAE,EAAyB;IACjC,OAAO,EAAE,EAA0B;CACpC,CAAC,CAAA"}
|
package/lib/esm/dev-app.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export class DevApp extends WebchatApp {
|
|
2
|
-
constructor({ theme, persistentMenu, coverComponent, blockInputs, enableEmojiPicker, enableAttachments, enableUserInput, enableAnimations, shadowDOM, hostId, storage, storageKey, onInit, onOpen, onClose, onMessage, onTrackEvent, ...botOptions }: {
|
|
3
|
-
[x: string]: any;
|
|
4
|
-
theme?: {} | undefined;
|
|
5
|
-
persistentMenu: any;
|
|
6
|
-
coverComponent: any;
|
|
7
|
-
blockInputs: any;
|
|
8
|
-
enableEmojiPicker: any;
|
|
9
|
-
enableAttachments: any;
|
|
10
|
-
enableUserInput: any;
|
|
11
|
-
enableAnimations: any;
|
|
12
|
-
shadowDOM: any;
|
|
13
|
-
hostId: any;
|
|
14
|
-
storage: any;
|
|
15
|
-
storageKey: any;
|
|
16
|
-
onInit: any;
|
|
17
|
-
onOpen: any;
|
|
18
|
-
onClose: any;
|
|
19
|
-
onMessage: any;
|
|
20
|
-
onTrackEvent: any;
|
|
21
|
-
});
|
|
22
|
-
bot: ReactBot;
|
|
23
|
-
getComponent(host: any, optionsAtRuntime?: {}): import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
onInit: ((app: WebchatApp, args: any) => void) | undefined;
|
|
25
|
-
onOpen: ((app: WebchatApp, args: any) => void) | undefined;
|
|
26
|
-
onClose: ((app: WebchatApp, args: any) => void) | undefined;
|
|
27
|
-
onMessage: ((app: WebchatApp, message: import("./index-types").WebchatMessage) => void) | undefined;
|
|
28
|
-
onTrackEvent: ((request: import("./index-types").ActionRequest, eventName: string, args?: import("./index-types").EventArgs | undefined) => Promise<void>) | undefined;
|
|
29
|
-
hostId: string | undefined;
|
|
30
|
-
render(dest: any, optionsAtRuntime?: {}): void;
|
|
31
|
-
onUserInput({ input, session, lastRoutePath }: {
|
|
32
|
-
input: any;
|
|
33
|
-
session: any;
|
|
34
|
-
lastRoutePath: any;
|
|
35
|
-
}): Promise<void>;
|
|
36
|
-
}
|
|
37
|
-
import { WebchatApp } from "./webchat-app";
|
|
38
|
-
import { ReactBot } from "./react-bot";
|
package/lib/esm/dev-app.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { __awaiter, __rest } from "tslib";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import merge from 'lodash.merge';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { createRoot } from 'react-dom/client';
|
|
6
|
-
import { SENDERS } from './index-types';
|
|
7
|
-
import { ReactBot } from './react-bot';
|
|
8
|
-
import { onDOMLoaded } from './util/dom';
|
|
9
|
-
import { WebchatDev } from './webchat/webchat-dev';
|
|
10
|
-
import { WebchatApp } from './webchat-app';
|
|
11
|
-
export class DevApp extends WebchatApp {
|
|
12
|
-
constructor(_a) {
|
|
13
|
-
var { theme = {}, persistentMenu, coverComponent, blockInputs, enableEmojiPicker, enableAttachments, enableUserInput, enableAnimations, shadowDOM, hostId, storage, storageKey, onInit, onOpen, onClose, onMessage, onTrackEvent } = _a, botOptions = __rest(_a, ["theme", "persistentMenu", "coverComponent", "blockInputs", "enableEmojiPicker", "enableAttachments", "enableUserInput", "enableAnimations", "shadowDOM", "hostId", "storage", "storageKey", "onInit", "onOpen", "onClose", "onMessage", "onTrackEvent"]);
|
|
14
|
-
super({
|
|
15
|
-
theme,
|
|
16
|
-
persistentMenu,
|
|
17
|
-
coverComponent,
|
|
18
|
-
blockInputs,
|
|
19
|
-
enableEmojiPicker,
|
|
20
|
-
enableAttachments,
|
|
21
|
-
enableUserInput,
|
|
22
|
-
enableAnimations,
|
|
23
|
-
shadowDOM,
|
|
24
|
-
hostId,
|
|
25
|
-
storage,
|
|
26
|
-
storageKey,
|
|
27
|
-
onInit,
|
|
28
|
-
onOpen,
|
|
29
|
-
onClose,
|
|
30
|
-
onMessage,
|
|
31
|
-
onTrackEvent,
|
|
32
|
-
});
|
|
33
|
-
this.bot = new ReactBot(Object.assign({}, botOptions));
|
|
34
|
-
}
|
|
35
|
-
getComponent(host, optionsAtRuntime = {}) {
|
|
36
|
-
let { theme = {}, persistentMenu, coverComponent, blockInputs, enableEmojiPicker, enableAttachments, enableUserInput, enableAnimations, storage, storageKey, onInit, onOpen, onClose, onMessage, onTrackEvent, hostId } = optionsAtRuntime, webchatOptions = __rest(optionsAtRuntime, ["theme", "persistentMenu", "coverComponent", "blockInputs", "enableEmojiPicker", "enableAttachments", "enableUserInput", "enableAnimations", "storage", "storageKey", "onInit", "onOpen", "onClose", "onMessage", "onTrackEvent", "hostId"]);
|
|
37
|
-
theme = merge(this.theme, theme);
|
|
38
|
-
persistentMenu = persistentMenu || this.persistentMenu;
|
|
39
|
-
coverComponent = coverComponent || this.coverComponent;
|
|
40
|
-
blockInputs = blockInputs || this.blockInputs;
|
|
41
|
-
enableEmojiPicker = enableEmojiPicker || this.enableEmojiPicker;
|
|
42
|
-
enableAttachments = enableAttachments || this.enableAttachments;
|
|
43
|
-
enableUserInput = enableUserInput || this.enableUserInput;
|
|
44
|
-
enableAnimations = enableAnimations || this.enableAnimations;
|
|
45
|
-
storage = storage || this.storage;
|
|
46
|
-
storageKey = storageKey || this.storageKey;
|
|
47
|
-
this.onInit = onInit || this.onInit;
|
|
48
|
-
this.onOpen = onOpen || this.onOpen;
|
|
49
|
-
this.onClose = onClose || this.onClose;
|
|
50
|
-
this.onMessage = onMessage || this.onMessage;
|
|
51
|
-
this.onTrackEvent = onTrackEvent || this.onTrackEvent;
|
|
52
|
-
this.hostId = hostId || this.hostId;
|
|
53
|
-
this.createRootElement(host);
|
|
54
|
-
return (_jsx(WebchatDev, Object.assign({}, webchatOptions, { ref: this.webchatRef, host: this.host, shadowDOM: this.shadowDOM, theme: theme, persistentMenu: persistentMenu, coverComponent: coverComponent, blockInputs: blockInputs, enableEmojiPicker: enableEmojiPicker, enableAttachments: enableAttachments, enableUserInput: enableUserInput, enableAnimations: enableAnimations, storage: storage, storageKey: storageKey, getString: (stringId, session) => this.bot.getString(stringId, session), setLocale: (locale, session) => this.bot.setLocale(locale, session), onInit: (...args) => this.onInitWebchat(...args), onOpen: (...args) => this.onOpenWebchat(...args), onClose: (...args) => this.onCloseWebchat(...args), onUserInput: (...args) => this.onUserInput(...args), onTrackEvent: (...args) => this.onTrackEvent(...args) })));
|
|
55
|
-
}
|
|
56
|
-
render(dest, optionsAtRuntime = {}) {
|
|
57
|
-
onDOMLoaded(() => {
|
|
58
|
-
const devAppComponent = this.getComponent(dest, optionsAtRuntime);
|
|
59
|
-
const container = this.getReactMountNode(dest);
|
|
60
|
-
const reactRoot = createRoot(container);
|
|
61
|
-
reactRoot.render(devAppComponent);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
onUserInput({ input, session, lastRoutePath }) {
|
|
65
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
this.onMessage &&
|
|
67
|
-
this.onMessage(this, {
|
|
68
|
-
sentBy: SENDERS.user,
|
|
69
|
-
message: input,
|
|
70
|
-
});
|
|
71
|
-
const resp = yield this.bot.input({ input, session, lastRoutePath });
|
|
72
|
-
this.onMessage &&
|
|
73
|
-
resp.response.map(r => this.onMessage(this, {
|
|
74
|
-
sentBy: SENDERS.bot,
|
|
75
|
-
message: r,
|
|
76
|
-
}));
|
|
77
|
-
this.webchatRef.current.addBotResponse(resp);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
//# sourceMappingURL=dev-app.js.map
|
package/lib/esm/dev-app.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev-app.js","sourceRoot":"","sources":["../../src/dev-app.jsx"],"names":[],"mappings":";;AAAA,OAAO,KAAK,MAAM,cAAc,CAAA;AAChC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CA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gBACZ,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;oBACnB,MAAM,EAAE,OAAO,CAAC,IAAI;oBACpB,OAAO,EAAE,KAAK;iBACf,CAAC,CAAA;YACJ,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAA;YACpE,IAAI,CAAC,SAAS;gBACZ,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CACpB,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;oBACnB,MAAM,EAAE,OAAO,CAAC,GAAG;oBACnB,OAAO,EAAE,CAAC;iBACX,CAAC,CACH,CAAA;YACH,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;QAC9C,CAAC;KAAA;CACF"}
|
package/lib/esm/index-types.d.ts
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import { BotRequest as CoreBotRequest, Input as CoreInput, InputType as CoreInputType, Plugin as CorePlugin, Route as CoreRoute, Routes as CoreRoutes, ServerConfig, Session as CoreSession, SessionUser as CoreSessionUser } from '@botonic/core';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { BlockInputOption, ButtonProps, ReplyProps, WebchatSettingsProps } from './components';
|
|
4
|
-
import { CloseWebviewOptions } from './contexts';
|
|
5
|
-
import { UseWebchat } from './webchat/context/use-webchat';
|
|
6
|
-
import { CoverComponentOptions, PersistentMenuOptionsTheme, ThemeProps } from './webchat/theme/types';
|
|
7
|
-
import { WebchatApp } from './webchat-app';
|
|
8
|
-
/**
|
|
9
|
-
* See @botonic/core's Response for the description of the Response's semantics*/
|
|
10
|
-
export interface BotResponse extends CoreBotRequest {
|
|
11
|
-
response: [React.ReactNode];
|
|
12
|
-
}
|
|
13
|
-
export interface Route extends CoreRoute {
|
|
14
|
-
action?: React.ComponentType<any>;
|
|
15
|
-
retryAction?: React.ComponentType<any>;
|
|
16
|
-
}
|
|
17
|
-
export type Routes = CoreRoutes<Route>;
|
|
18
|
-
export interface ActionRequest {
|
|
19
|
-
defaultDelay: number;
|
|
20
|
-
defaultTyping: number;
|
|
21
|
-
input: CoreInput;
|
|
22
|
-
lastRoutePath: string;
|
|
23
|
-
params: {
|
|
24
|
-
[key: string]: string;
|
|
25
|
-
};
|
|
26
|
-
plugins: {
|
|
27
|
-
[id: string]: CorePlugin;
|
|
28
|
-
};
|
|
29
|
-
session: CoreSession;
|
|
30
|
-
}
|
|
31
|
-
export interface RequestContextInterface extends ActionRequest {
|
|
32
|
-
getString: (stringId: string) => string;
|
|
33
|
-
setLocale: (locale: string) => string;
|
|
34
|
-
}
|
|
35
|
-
export interface WebchatRef {
|
|
36
|
-
addBotResponse: ({ response, session, lastRoutePath, }: AddBotResponseArgs) => void;
|
|
37
|
-
setTyping: (typing: boolean) => void;
|
|
38
|
-
addUserMessage: (message: any) => Promise<void>;
|
|
39
|
-
updateUser: (userToUpdate: any) => void;
|
|
40
|
-
openWebchat: () => void;
|
|
41
|
-
closeWebchat: () => void;
|
|
42
|
-
toggleWebchat: () => void;
|
|
43
|
-
openCoverComponent: () => void;
|
|
44
|
-
closeCoverComponent: () => void;
|
|
45
|
-
toggleCoverComponent: () => void;
|
|
46
|
-
renderCustomComponent: (customComponent: any) => void;
|
|
47
|
-
unmountCustomComponent: () => void;
|
|
48
|
-
isOnline: () => boolean;
|
|
49
|
-
setOnline: (online: boolean) => void;
|
|
50
|
-
getMessages: () => {
|
|
51
|
-
id: string;
|
|
52
|
-
ack: number;
|
|
53
|
-
unsentInput: CoreInput;
|
|
54
|
-
}[];
|
|
55
|
-
clearMessages: () => void;
|
|
56
|
-
getLastMessageUpdate: () => string | undefined;
|
|
57
|
-
updateMessageInfo: (msgId: string, messageInfo: any) => void;
|
|
58
|
-
updateWebchatSettings: (settings: WebchatSettingsProps) => void;
|
|
59
|
-
closeWebview: (options?: CloseWebviewOptions) => Promise<void>;
|
|
60
|
-
}
|
|
61
|
-
interface AddBotResponseArgs {
|
|
62
|
-
response: any;
|
|
63
|
-
session?: any;
|
|
64
|
-
lastRoutePath?: any;
|
|
65
|
-
}
|
|
66
|
-
export interface WebchatArgs {
|
|
67
|
-
theme?: ThemeProps;
|
|
68
|
-
persistentMenu?: PersistentMenuOptionsTheme;
|
|
69
|
-
coverComponent?: CoverComponentOptions;
|
|
70
|
-
blockInputs?: BlockInputOption[];
|
|
71
|
-
enableEmojiPicker?: boolean;
|
|
72
|
-
enableAttachments?: boolean;
|
|
73
|
-
enableUserInput?: boolean;
|
|
74
|
-
enableAnimations?: boolean;
|
|
75
|
-
hostId?: string;
|
|
76
|
-
shadowDOM?: boolean | (() => boolean);
|
|
77
|
-
defaultDelay?: number;
|
|
78
|
-
defaultTyping?: number;
|
|
79
|
-
storage?: Storage | null;
|
|
80
|
-
storageKey?: string;
|
|
81
|
-
onInit?: (app: WebchatApp, args: any) => void;
|
|
82
|
-
onOpen?: (app: WebchatApp, args: any) => void;
|
|
83
|
-
onClose?: (app: WebchatApp, args: any) => void;
|
|
84
|
-
onMessage?: (app: WebchatApp, message: WebchatMessage) => void;
|
|
85
|
-
onTrackEvent?: TrackEventFunction;
|
|
86
|
-
onConnectionChange?: (app: WebchatApp, isOnline: boolean) => void;
|
|
87
|
-
appId?: string;
|
|
88
|
-
visibility?: boolean | (() => boolean) | 'dynamic';
|
|
89
|
-
server?: ServerConfig;
|
|
90
|
-
}
|
|
91
|
-
export interface WebchatProps {
|
|
92
|
-
webchatHooks?: UseWebchat;
|
|
93
|
-
initialSession?: any;
|
|
94
|
-
initialDevSettings?: any;
|
|
95
|
-
onStateChange: (args: OnStateChangeArgs) => void;
|
|
96
|
-
shadowDOM?: any;
|
|
97
|
-
theme?: ThemeProps;
|
|
98
|
-
persistentMenu?: PersistentMenuOptionsTheme;
|
|
99
|
-
coverComponent?: CoverComponentOptions;
|
|
100
|
-
blockInputs?: BlockInputOption[];
|
|
101
|
-
enableEmojiPicker?: boolean;
|
|
102
|
-
enableAttachments?: boolean;
|
|
103
|
-
enableUserInput?: boolean;
|
|
104
|
-
enableAnimations?: boolean;
|
|
105
|
-
storage?: Storage | null;
|
|
106
|
-
storageKey?: string | (() => string);
|
|
107
|
-
defaultDelay?: number;
|
|
108
|
-
defaultTyping?: number;
|
|
109
|
-
onInit?: (args?: any) => void;
|
|
110
|
-
onOpen?: (args?: any) => void;
|
|
111
|
-
onClose?: (args?: any) => void;
|
|
112
|
-
onUserInput(args: OnUserInputArgs): Promise<void>;
|
|
113
|
-
onTrackEvent?: TrackEventFunction;
|
|
114
|
-
host?: any;
|
|
115
|
-
server?: ServerConfig;
|
|
116
|
-
}
|
|
117
|
-
export type EventArgs = {
|
|
118
|
-
[key: string]: any;
|
|
119
|
-
};
|
|
120
|
-
export type TrackEventFunction = (request: ActionRequest, eventName: string, args?: EventArgs) => Promise<void>;
|
|
121
|
-
export declare enum SENDERS {
|
|
122
|
-
bot = "bot",
|
|
123
|
-
user = "user",
|
|
124
|
-
agent = "agent"
|
|
125
|
-
}
|
|
126
|
-
export declare enum Typing {
|
|
127
|
-
On = "typing_on",
|
|
128
|
-
Off = "typing_off"
|
|
129
|
-
}
|
|
130
|
-
export interface WebchatMessage {
|
|
131
|
-
ack: 0 | 1;
|
|
132
|
-
blob: boolean;
|
|
133
|
-
buttons: ButtonProps[];
|
|
134
|
-
children: any;
|
|
135
|
-
data: any;
|
|
136
|
-
delay: number;
|
|
137
|
-
display: boolean;
|
|
138
|
-
enabletimestamps?: boolean;
|
|
139
|
-
id: string;
|
|
140
|
-
imagestyle?: any;
|
|
141
|
-
isUnread: boolean;
|
|
142
|
-
json: any;
|
|
143
|
-
markdown: boolean;
|
|
144
|
-
replies: ReplyProps[];
|
|
145
|
-
sentBy: SENDERS;
|
|
146
|
-
style?: any;
|
|
147
|
-
timestamp: string;
|
|
148
|
-
type: CoreInputType;
|
|
149
|
-
typing: number;
|
|
150
|
-
}
|
|
151
|
-
export interface OnUserInputArgs {
|
|
152
|
-
input: CoreInput;
|
|
153
|
-
lastRoutePath?: string;
|
|
154
|
-
session?: CoreSession;
|
|
155
|
-
user?: CoreSessionUser;
|
|
156
|
-
}
|
|
157
|
-
export interface OnStateChangeArgs {
|
|
158
|
-
messagesJSON: WebchatMessage[];
|
|
159
|
-
user: CoreSessionUser;
|
|
160
|
-
}
|
|
161
|
-
export interface MessageInfo {
|
|
162
|
-
data: any | Typing.On;
|
|
163
|
-
id: string;
|
|
164
|
-
type: 'update_webchat_settings' | 'sender_action';
|
|
165
|
-
}
|
|
166
|
-
export type Event = ConnectionChangeEvent | UpdateMessageInfoEvent;
|
|
167
|
-
interface ConnectionChangeEvent {
|
|
168
|
-
action: 'connectionChange';
|
|
169
|
-
online: boolean;
|
|
170
|
-
isError?: boolean;
|
|
171
|
-
message?: MessageInfo;
|
|
172
|
-
}
|
|
173
|
-
interface UpdateMessageInfoEvent {
|
|
174
|
-
action: 'update_message_info';
|
|
175
|
-
message: MessageInfo;
|
|
176
|
-
isError?: boolean;
|
|
177
|
-
}
|
|
178
|
-
export {};
|
package/lib/esm/index-types.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export var SENDERS;
|
|
2
|
-
(function (SENDERS) {
|
|
3
|
-
SENDERS["bot"] = "bot";
|
|
4
|
-
SENDERS["user"] = "user";
|
|
5
|
-
SENDERS["agent"] = "agent";
|
|
6
|
-
})(SENDERS || (SENDERS = {}));
|
|
7
|
-
export var Typing;
|
|
8
|
-
(function (Typing) {
|
|
9
|
-
Typing["On"] = "typing_on";
|
|
10
|
-
Typing["Off"] = "typing_off";
|
|
11
|
-
})(Typing || (Typing = {}));
|
|
12
|
-
//# sourceMappingURL=index-types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-types.js","sourceRoot":"","sources":["../../src/index-types.ts"],"names":[],"mappings":"AAsJA,MAAM,CAAN,IAAY,OAIX;AAJD,WAAY,OAAO;IACjB,sBAAW,CAAA;IACX,wBAAa,CAAA;IACb,0BAAe,CAAA;AACjB,CAAC,EAJW,OAAO,KAAP,OAAO,QAIlB;AAED,MAAM,CAAN,IAAY,MAGX;AAHD,WAAY,MAAM;IAChB,0BAAgB,CAAA;IAChB,4BAAkB,CAAA;AACpB,CAAC,EAHW,MAAM,KAAN,MAAM,QAGjB"}
|
package/lib/esm/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { BotonicInputTester, BotonicOutputTester } from './botonic-tester';
|
|
2
|
-
export * from './components';
|
|
3
|
-
export { RequestContext, WebviewRequestContext } from './contexts';
|
|
4
|
-
export { DevApp } from './dev-app';
|
|
5
|
-
export * from './index-types';
|
|
6
|
-
export { msgsToBotonic, msgToBotonic } from './msg-to-botonic';
|
|
7
|
-
export { NodeApp } from './node-app';
|
|
8
|
-
export * from './util';
|
|
9
|
-
export * from './webchat';
|
|
10
|
-
export { WebchatApp } from './webchat-app';
|
|
11
|
-
export { WebviewApp } from './webview-app';
|
package/lib/esm/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { BotonicInputTester, BotonicOutputTester } from './botonic-tester';
|
|
2
|
-
export * from './components';
|
|
3
|
-
export { RequestContext, WebviewRequestContext } from './contexts';
|
|
4
|
-
export { DevApp } from './dev-app';
|
|
5
|
-
export * from './index-types';
|
|
6
|
-
export { msgsToBotonic, msgToBotonic } from './msg-to-botonic';
|
|
7
|
-
export { NodeApp } from './node-app';
|
|
8
|
-
export * from './util';
|
|
9
|
-
export * from './webchat';
|
|
10
|
-
export { WebchatApp } from './webchat-app';
|
|
11
|
-
export { WebviewApp } from './webview-app';
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAC1E,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,cAAc,QAAQ,CAAA;AACtB,cAAc,WAAW,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export function isOfType(msgType: any, type: any): boolean;
|
|
2
|
-
export function isText(msg: any): boolean;
|
|
3
|
-
export function isPostback(msg: any): boolean;
|
|
4
|
-
export function isAudio(msg: any): boolean;
|
|
5
|
-
export function isImage(msg: any): boolean;
|
|
6
|
-
export function isVideo(msg: any): boolean;
|
|
7
|
-
export function isDocument(msg: any): boolean;
|
|
8
|
-
export function isLocation(msg: any): boolean;
|
|
9
|
-
export function isContact(msg: any): boolean;
|
|
10
|
-
export function isCarousel(msg: any): boolean;
|
|
11
|
-
export function isCustom(msg: any): boolean;
|
|
12
|
-
export function isButtonMessage(msg: any): boolean;
|
|
13
|
-
export const INPUT_MEDIA_TYPES: INPUT[];
|
|
14
|
-
export function isMedia(message: any): boolean;
|
|
15
|
-
export function readDataURL(file: any): Promise<any>;
|
|
16
|
-
export function isAllowedSize(fileSize: any): boolean;
|
|
17
|
-
export function getMediaType(fileType: any): string;
|
|
18
|
-
export function getFullMimeWhitelist(): string[];
|
|
19
|
-
import { INPUT } from "@botonic/core/lib/cjs/models/legacy-types";
|
package/lib/esm/message-utils.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { INPUT } from '@botonic/core';
|
|
2
|
-
import { MAX_ALLOWED_SIZE_MB, MIME_WHITELIST } from './constants';
|
|
3
|
-
export const isOfType = (msgType, type) => msgType === type;
|
|
4
|
-
export const isText = msg => isOfType(msg.type, INPUT.TEXT);
|
|
5
|
-
export const isPostback = msg => isOfType(msg.type, INPUT.POSTBACK);
|
|
6
|
-
export const isAudio = msg => isOfType(msg.type, INPUT.AUDIO);
|
|
7
|
-
export const isImage = msg => isOfType(msg.type, INPUT.IMAGE);
|
|
8
|
-
export const isVideo = msg => isOfType(msg.type, INPUT.VIDEO);
|
|
9
|
-
export const isDocument = msg => isOfType(msg.type, INPUT.DOCUMENT);
|
|
10
|
-
export const isLocation = msg => isOfType(msg.type, INPUT.LOCATION);
|
|
11
|
-
export const isContact = msg => isOfType(msg.type, INPUT.CONTACT);
|
|
12
|
-
export const isCarousel = msg => isOfType(msg.type, INPUT.CAROUSEL);
|
|
13
|
-
export const isCustom = msg => isOfType(msg.type, INPUT.CUSTOM);
|
|
14
|
-
export const isButtonMessage = msg => isOfType(msg.type, INPUT.BUTTON_MESSAGE);
|
|
15
|
-
export const INPUT_MEDIA_TYPES = [
|
|
16
|
-
INPUT.AUDIO,
|
|
17
|
-
INPUT.IMAGE,
|
|
18
|
-
INPUT.VIDEO,
|
|
19
|
-
INPUT.DOCUMENT,
|
|
20
|
-
];
|
|
21
|
-
export const isMedia = message => INPUT_MEDIA_TYPES.some(type => isOfType(message.type, type));
|
|
22
|
-
// TODO: Centralize handling attachments in class
|
|
23
|
-
export const readDataURL = file => new Promise((resolve, reject) => {
|
|
24
|
-
const reader = new FileReader();
|
|
25
|
-
reader.readAsDataURL(file);
|
|
26
|
-
reader.onload = () => resolve(reader.result);
|
|
27
|
-
reader.onerror = error => reject(error);
|
|
28
|
-
});
|
|
29
|
-
export const isAllowedSize = fileSize => {
|
|
30
|
-
const maxAllowedBytesSize = MAX_ALLOWED_SIZE_MB * 1024 * 1024;
|
|
31
|
-
if (fileSize > maxAllowedBytesSize)
|
|
32
|
-
return false;
|
|
33
|
-
return true;
|
|
34
|
-
};
|
|
35
|
-
export const getMediaType = fileType => {
|
|
36
|
-
return Object.entries(MIME_WHITELIST)
|
|
37
|
-
.filter(([_, formatsForType]) => formatsForType.includes(fileType))
|
|
38
|
-
.map(([type, _]) => type)[0];
|
|
39
|
-
};
|
|
40
|
-
export const getFullMimeWhitelist = () => Object.values(MIME_WHITELIST).map(acceptedFormatsForType => acceptedFormatsForType.join(','));
|
|
41
|
-
//# sourceMappingURL=message-utils.js.map
|