@botonic/react 0.21.5 → 0.21.7-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/app.d.ts +2 -0
- package/lib/cjs/app.js +10 -0
- package/lib/cjs/app.js.map +1 -0
- package/lib/cjs/botonic-tester.d.ts +18 -0
- package/lib/cjs/botonic-tester.js +70 -0
- package/lib/cjs/botonic-tester.js.map +1 -0
- package/lib/cjs/components/audio.d.ts +8 -0
- package/lib/cjs/components/audio.js +27 -0
- package/lib/cjs/components/audio.js.map +1 -0
- package/lib/cjs/components/button.d.ts +15 -0
- package/lib/cjs/components/button.js +156 -0
- package/lib/cjs/components/button.js.map +1 -0
- package/lib/cjs/components/buttons-disabler.d.ts +24 -0
- package/lib/cjs/components/buttons-disabler.js +88 -0
- package/lib/cjs/components/buttons-disabler.js.map +1 -0
- package/lib/cjs/components/carousel.d.ts +9 -0
- package/lib/cjs/components/carousel.js +120 -0
- package/lib/cjs/components/carousel.js.map +1 -0
- package/lib/cjs/components/components.d.ts +12 -0
- package/lib/{components → cjs/components}/components.js +6 -11
- package/lib/cjs/components/components.js.map +1 -0
- package/lib/cjs/components/custom-message.d.ts +10 -0
- package/lib/cjs/components/custom-message.js +65 -0
- package/lib/cjs/components/custom-message.js.map +1 -0
- package/lib/cjs/components/document.d.ts +8 -0
- package/lib/cjs/components/document.js +50 -0
- package/lib/cjs/components/document.js.map +1 -0
- package/lib/cjs/components/element.d.ts +4 -0
- package/lib/cjs/components/element.js +55 -0
- package/lib/cjs/components/element.js.map +1 -0
- package/lib/cjs/components/handoff.d.ts +1 -0
- package/lib/cjs/components/handoff.js +58 -0
- package/lib/cjs/components/handoff.js.map +1 -0
- package/lib/cjs/components/image.d.ts +8 -0
- package/lib/cjs/components/image.js +42 -0
- package/lib/cjs/components/image.js.map +1 -0
- package/lib/cjs/components/index.d.ts +1 -0
- package/lib/cjs/components/index.js +44 -0
- package/lib/cjs/components/index.js.map +1 -0
- package/lib/cjs/components/location.d.ts +11 -0
- package/lib/cjs/components/location.js +38 -0
- package/lib/cjs/components/location.js.map +1 -0
- package/lib/cjs/components/markdown.d.ts +7 -0
- package/lib/cjs/components/markdown.js +162 -0
- package/lib/cjs/components/markdown.js.map +1 -0
- package/lib/cjs/components/message-template.d.ts +1 -0
- package/lib/cjs/components/message-template.js +15 -0
- package/lib/cjs/components/message-template.js.map +1 -0
- package/lib/cjs/components/message.d.ts +1 -0
- package/lib/cjs/components/message.js +206 -0
- package/lib/cjs/components/message.js.map +1 -0
- package/lib/cjs/components/multichannel/facebook/facebook.d.ts +17 -0
- package/lib/cjs/components/multichannel/facebook/facebook.js +47 -0
- package/lib/cjs/components/multichannel/facebook/facebook.js.map +1 -0
- package/lib/cjs/components/multichannel/index.d.ts +1 -0
- package/lib/cjs/components/multichannel/index.js +14 -0
- package/lib/cjs/components/multichannel/index.js.map +1 -0
- package/lib/cjs/components/multichannel/multichannel-button.d.ts +1 -0
- package/lib/cjs/components/multichannel/multichannel-button.js +77 -0
- package/lib/cjs/components/multichannel/multichannel-button.js.map +1 -0
- package/lib/cjs/components/multichannel/multichannel-carousel.d.ts +1 -0
- package/lib/cjs/components/multichannel/multichannel-carousel.js +95 -0
- package/lib/cjs/components/multichannel/multichannel-carousel.js.map +1 -0
- package/lib/cjs/components/multichannel/multichannel-context.d.ts +11 -0
- package/lib/cjs/components/multichannel/multichannel-context.js +16 -0
- package/lib/cjs/components/multichannel/multichannel-context.js.map +1 -0
- package/lib/cjs/components/multichannel/multichannel-reply.d.ts +1 -0
- package/lib/cjs/components/multichannel/multichannel-reply.js +24 -0
- package/lib/cjs/components/multichannel/multichannel-reply.js.map +1 -0
- package/lib/cjs/components/multichannel/multichannel-text.d.ts +1 -0
- package/lib/cjs/components/multichannel/multichannel-text.js +147 -0
- package/lib/cjs/components/multichannel/multichannel-text.js.map +1 -0
- package/lib/cjs/components/multichannel/multichannel-utils.d.ts +24 -0
- package/lib/cjs/components/multichannel/multichannel-utils.js +83 -0
- package/lib/cjs/components/multichannel/multichannel-utils.js.map +1 -0
- package/lib/cjs/components/multichannel/multichannel.d.ts +1 -0
- package/lib/cjs/components/multichannel/multichannel.js +72 -0
- package/lib/cjs/components/multichannel/multichannel.js.map +1 -0
- package/lib/cjs/components/pic.d.ts +6 -0
- package/lib/cjs/components/pic.js +29 -0
- package/lib/cjs/components/pic.js.map +1 -0
- package/lib/cjs/components/raw.d.ts +9 -0
- package/lib/cjs/components/raw.js +53 -0
- package/lib/cjs/components/raw.js.map +1 -0
- package/lib/cjs/components/reply.d.ts +9 -0
- package/lib/cjs/components/reply.js +57 -0
- package/lib/cjs/components/reply.js.map +1 -0
- package/lib/cjs/components/share-button.d.ts +1 -0
- package/lib/cjs/components/share-button.js +15 -0
- package/lib/cjs/components/share-button.js.map +1 -0
- package/lib/cjs/components/subtitle.d.ts +6 -0
- package/lib/cjs/components/subtitle.js +25 -0
- package/lib/cjs/components/subtitle.js.map +1 -0
- package/lib/cjs/components/text.d.ts +8 -0
- package/lib/cjs/components/text.js +50 -0
- package/lib/cjs/components/text.js.map +1 -0
- package/lib/cjs/components/timestamps.d.ts +10 -0
- package/lib/cjs/components/timestamps.js +54 -0
- package/lib/cjs/components/timestamps.js.map +1 -0
- package/lib/cjs/components/title.d.ts +6 -0
- package/lib/cjs/components/title.js +21 -0
- package/lib/cjs/components/title.js.map +1 -0
- package/lib/cjs/components/video.d.ts +8 -0
- package/lib/cjs/components/video.js +34 -0
- package/lib/cjs/components/video.js.map +1 -0
- package/lib/cjs/components/webchat-settings.d.ts +10 -0
- package/lib/cjs/components/webchat-settings.js +78 -0
- package/lib/cjs/components/webchat-settings.js.map +1 -0
- package/lib/cjs/components/whatsapp-template.d.ts +1 -0
- package/lib/cjs/components/whatsapp-template.js +26 -0
- package/lib/cjs/components/whatsapp-template.js.map +1 -0
- package/lib/cjs/constants.d.ts +168 -0
- package/lib/cjs/constants.js +190 -0
- package/lib/cjs/constants.js.map +1 -0
- package/lib/cjs/contexts.d.ts +69 -0
- package/lib/cjs/contexts.js +38 -0
- package/lib/cjs/contexts.js.map +1 -0
- package/lib/cjs/dev-app.d.ts +34 -0
- package/lib/cjs/dev-app.js +71 -0
- package/lib/cjs/dev-app.js.map +1 -0
- package/lib/cjs/index.d.ts +3 -0
- package/lib/cjs/index.js +28 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/message-utils.d.ts +18 -0
- package/lib/cjs/message-utils.js +61 -0
- package/lib/cjs/message-utils.js.map +1 -0
- package/lib/cjs/msg-to-botonic.d.ts +18 -0
- package/lib/cjs/msg-to-botonic.js +160 -0
- package/lib/cjs/msg-to-botonic.js.map +1 -0
- package/lib/cjs/node-app.d.ts +11 -0
- package/lib/cjs/node-app.js +25 -0
- package/lib/cjs/node-app.js.map +1 -0
- package/lib/cjs/react-bot.d.ts +8 -0
- package/lib/cjs/react-bot.js +35 -0
- package/lib/cjs/react-bot.js.map +1 -0
- package/lib/cjs/util/dom.d.ts +13 -0
- package/lib/cjs/util/dom.js +55 -0
- package/lib/cjs/util/dom.js.map +1 -0
- package/lib/cjs/util/environment.d.ts +6 -0
- package/lib/cjs/util/environment.js +68 -0
- package/lib/cjs/util/environment.js.map +1 -0
- package/lib/cjs/util/error-boundary.js +47 -0
- package/lib/cjs/util/error-boundary.js.map +1 -0
- package/lib/cjs/util/index.d.ts +0 -0
- package/lib/cjs/util/index.js +2 -0
- package/lib/cjs/util/index.js.map +1 -0
- package/lib/cjs/util/logs.d.ts +2 -0
- package/lib/cjs/util/logs.js +20 -0
- package/lib/cjs/util/logs.js.map +1 -0
- package/lib/cjs/util/objects.d.ts +3 -0
- package/lib/cjs/util/objects.js +44 -0
- package/lib/cjs/util/objects.js.map +1 -0
- package/lib/cjs/util/react.d.ts +12 -0
- package/lib/cjs/util/react.js +42 -0
- package/lib/cjs/util/react.js.map +1 -0
- package/lib/cjs/util/regexs.d.ts +2 -0
- package/lib/cjs/util/regexs.js +23 -0
- package/lib/cjs/util/regexs.js.map +1 -0
- package/lib/cjs/util/webchat.d.ts +11 -0
- package/lib/cjs/util/webchat.js +62 -0
- package/lib/cjs/util/webchat.js.map +1 -0
- package/lib/cjs/webchat/actions.d.ts +23 -0
- package/lib/cjs/webchat/actions.js +27 -0
- package/lib/cjs/webchat/actions.js.map +1 -0
- package/lib/cjs/webchat/components/attachment.d.ts +5 -0
- package/lib/cjs/webchat/components/attachment.js +32 -0
- package/lib/cjs/webchat/components/attachment.js.map +1 -0
- package/lib/cjs/webchat/components/common.d.ts +1 -0
- package/lib/cjs/webchat/components/common.js +13 -0
- package/lib/cjs/webchat/components/common.js.map +1 -0
- package/lib/cjs/webchat/components/conditional-animation.d.ts +1 -0
- package/lib/cjs/webchat/components/conditional-animation.js +18 -0
- package/lib/cjs/webchat/components/conditional-animation.js.map +1 -0
- package/lib/cjs/webchat/components/emoji-picker.d.ts +5 -0
- package/lib/cjs/webchat/components/emoji-picker.js +52 -0
- package/lib/cjs/webchat/components/emoji-picker.js.map +1 -0
- package/lib/cjs/webchat/components/persistent-menu.d.ts +10 -0
- package/lib/cjs/webchat/components/persistent-menu.js +59 -0
- package/lib/cjs/webchat/components/persistent-menu.js.map +1 -0
- package/lib/cjs/webchat/components/send-button.d.ts +3 -0
- package/lib/cjs/webchat/components/send-button.js +24 -0
- package/lib/cjs/webchat/components/send-button.js.map +1 -0
- package/lib/cjs/webchat/components/styled-scrollbar.d.ts +1 -0
- package/lib/cjs/webchat/components/styled-scrollbar.js +54 -0
- package/lib/cjs/webchat/components/styled-scrollbar.js.map +1 -0
- package/lib/cjs/webchat/components/typing-indicator.d.ts +1 -0
- package/lib/cjs/webchat/components/typing-indicator.js +14 -0
- package/lib/cjs/webchat/components/typing-indicator.js.map +1 -0
- package/lib/cjs/webchat/devices/device-adapter.d.ts +12 -0
- package/lib/cjs/webchat/devices/device-adapter.js +47 -0
- package/lib/cjs/webchat/devices/device-adapter.js.map +1 -0
- package/lib/cjs/webchat/devices/index.d.ts +11 -0
- package/lib/cjs/webchat/devices/index.js +23 -0
- package/lib/cjs/webchat/devices/index.js.map +1 -0
- package/lib/cjs/webchat/devices/scrollbar-controller.d.ts +12 -0
- package/lib/cjs/webchat/devices/scrollbar-controller.js +103 -0
- package/lib/cjs/webchat/devices/scrollbar-controller.js.map +1 -0
- package/lib/cjs/webchat/devices/webchat-resizer.d.ts +9 -0
- package/lib/cjs/webchat/devices/webchat-resizer.js +47 -0
- package/lib/cjs/webchat/devices/webchat-resizer.js.map +1 -0
- package/lib/cjs/webchat/header.d.ts +3 -0
- package/lib/cjs/webchat/header.js +95 -0
- package/lib/cjs/webchat/header.js.map +1 -0
- package/lib/cjs/webchat/hooks.d.ts +80 -0
- package/lib/cjs/webchat/hooks.js +218 -0
- package/lib/cjs/webchat/hooks.js.map +1 -0
- package/lib/cjs/webchat/index.d.ts +4 -0
- package/lib/cjs/webchat/index.js +17 -0
- package/lib/cjs/webchat/index.js.map +1 -0
- package/lib/cjs/webchat/message-list.d.ts +1 -0
- package/lib/cjs/webchat/message-list.js +46 -0
- package/lib/cjs/webchat/message-list.js.map +1 -0
- package/lib/cjs/webchat/messages-reducer.d.ts +1 -0
- package/lib/cjs/webchat/messages-reducer.js +58 -0
- package/lib/cjs/webchat/messages-reducer.js.map +1 -0
- package/lib/cjs/webchat/replies.d.ts +1 -0
- package/lib/cjs/webchat/replies.js +46 -0
- package/lib/cjs/webchat/replies.js.map +1 -0
- package/lib/cjs/webchat/session-view.d.ts +1 -0
- package/lib/cjs/webchat/session-view.js +124 -0
- package/lib/cjs/webchat/session-view.js.map +1 -0
- package/lib/cjs/webchat/use-storage-state-hook.d.ts +1 -0
- package/lib/cjs/webchat/use-storage-state-hook.js +32 -0
- package/lib/cjs/webchat/use-storage-state-hook.js.map +1 -0
- package/lib/cjs/webchat/webchat-dev.d.ts +7 -0
- package/lib/cjs/webchat/webchat-dev.js +64 -0
- package/lib/cjs/webchat/webchat-dev.js.map +1 -0
- package/lib/cjs/webchat/webchat-reducer.d.ts +1 -0
- package/lib/cjs/webchat/webchat-reducer.js +48 -0
- package/lib/cjs/webchat/webchat-reducer.js.map +1 -0
- package/lib/cjs/webchat/webchat.d.ts +3 -0
- package/lib/cjs/webchat/webchat.js +703 -0
- package/lib/cjs/webchat/webchat.js.map +1 -0
- package/lib/cjs/webchat/webview.d.ts +2 -0
- package/lib/cjs/webchat/webview.js +92 -0
- package/lib/cjs/webchat/webview.js.map +1 -0
- package/lib/cjs/webchat-app.d.ts +99 -0
- package/lib/cjs/webchat-app.js +269 -0
- package/lib/cjs/webchat-app.js.map +1 -0
- package/lib/cjs/webview.d.ts +9 -0
- package/lib/cjs/webview.js +102 -0
- package/lib/cjs/webview.js.map +1 -0
- package/package.json +3 -3
- package/src/util/environment.js +29 -1
- package/lib/app.js +0 -19
- package/lib/app.js.map +0 -1
- package/lib/assets/attachment-icon.svg +0 -7
- package/lib/assets/audio.svg +0 -4
- package/lib/assets/botonic_react_logo100x100.png +0 -0
- package/lib/assets/document.svg +0 -3
- package/lib/assets/emojiButton.svg +0 -6
- package/lib/assets/image.svg +0 -4
- package/lib/assets/leftArrow.svg +0 -3
- package/lib/assets/menuButton.svg +0 -3
- package/lib/assets/rightArrow.svg +0 -3
- package/lib/assets/send-button.svg +0 -1
- package/lib/assets/video.svg +0 -3
- package/lib/botonic-tester.js +0 -224
- package/lib/botonic-tester.js.map +0 -1
- package/lib/components/audio.js +0 -48
- package/lib/components/audio.js.map +0 -1
- package/lib/components/button.js +0 -224
- package/lib/components/button.js.map +0 -1
- package/lib/components/buttons-disabler.js +0 -133
- package/lib/components/buttons-disabler.js.map +0 -1
- package/lib/components/carousel.js +0 -194
- package/lib/components/carousel.js.map +0 -1
- package/lib/components/components.js.map +0 -1
- package/lib/components/custom-message.js +0 -131
- package/lib/components/custom-message.js.map +0 -1
- package/lib/components/document.js +0 -76
- package/lib/components/document.js.map +0 -1
- package/lib/components/element.js +0 -69
- package/lib/components/element.js.map +0 -1
- package/lib/components/handoff.js +0 -69
- package/lib/components/handoff.js.map +0 -1
- package/lib/components/image.js +0 -91
- package/lib/components/image.js.map +0 -1
- package/lib/components/index.d.ts +0 -228
- package/lib/components/index.js +0 -193
- package/lib/components/index.js.map +0 -1
- package/lib/components/location.js +0 -69
- package/lib/components/location.js.map +0 -1
- package/lib/components/markdown.js +0 -108
- package/lib/components/markdown.js.map +0 -1
- package/lib/components/message-template.js +0 -36
- package/lib/components/message-template.js.map +0 -1
- package/lib/components/message.js +0 -351
- package/lib/components/message.js.map +0 -1
- package/lib/components/multichannel/facebook/facebook.js +0 -96
- package/lib/components/multichannel/facebook/facebook.js.map +0 -1
- package/lib/components/multichannel/index.d.ts +0 -65
- package/lib/components/multichannel/index.js +0 -46
- package/lib/components/multichannel/index.js.map +0 -1
- package/lib/components/multichannel/multichannel-button.js +0 -119
- package/lib/components/multichannel/multichannel-button.js.map +0 -1
- package/lib/components/multichannel/multichannel-carousel.js +0 -143
- package/lib/components/multichannel/multichannel-carousel.js.map +0 -1
- package/lib/components/multichannel/multichannel-context.js +0 -24
- package/lib/components/multichannel/multichannel-context.js.map +0 -1
- package/lib/components/multichannel/multichannel-reply.js +0 -46
- package/lib/components/multichannel/multichannel-reply.js.map +0 -1
- package/lib/components/multichannel/multichannel-text.js +0 -222
- package/lib/components/multichannel/multichannel-text.js.map +0 -1
- package/lib/components/multichannel/multichannel-utils.js +0 -126
- package/lib/components/multichannel/multichannel-utils.js.map +0 -1
- package/lib/components/multichannel/multichannel.js +0 -111
- package/lib/components/multichannel/multichannel.js.map +0 -1
- package/lib/components/pic.js +0 -50
- package/lib/components/pic.js.map +0 -1
- package/lib/components/raw.js +0 -70
- package/lib/components/raw.js.map +0 -1
- package/lib/components/reply.js +0 -107
- package/lib/components/reply.js.map +0 -1
- package/lib/components/share-button.js +0 -36
- package/lib/components/share-button.js.map +0 -1
- package/lib/components/subtitle.js +0 -54
- package/lib/components/subtitle.js.map +0 -1
- package/lib/components/text.js +0 -80
- package/lib/components/text.js.map +0 -1
- package/lib/components/timestamps.js +0 -69
- package/lib/components/timestamps.js.map +0 -1
- package/lib/components/title.js +0 -52
- package/lib/components/title.js.map +0 -1
- package/lib/components/video.js +0 -51
- package/lib/components/video.js.map +0 -1
- package/lib/components/webchat-settings.js +0 -118
- package/lib/components/webchat-settings.js.map +0 -1
- package/lib/components/whatsapp-template.js +0 -53
- package/lib/components/whatsapp-template.js.map +0 -1
- package/lib/constants.js +0 -203
- package/lib/constants.js.map +0 -1
- package/lib/contexts.js +0 -57
- package/lib/contexts.js.map +0 -1
- package/lib/dev-app.js +0 -241
- package/lib/dev-app.js.map +0 -1
- package/lib/index.d.ts +0 -238
- package/lib/index.js +0 -131
- package/lib/index.js.map +0 -1
- package/lib/message-utils.js +0 -149
- package/lib/message-utils.js.map +0 -1
- package/lib/msg-to-botonic.js +0 -199
- package/lib/msg-to-botonic.js.map +0 -1
- package/lib/node-app.js +0 -97
- package/lib/node-app.js.map +0 -1
- package/lib/react-bot.js +0 -167
- package/lib/react-bot.js.map +0 -1
- package/lib/util/dom.js +0 -84
- package/lib/util/dom.js.map +0 -1
- package/lib/util/environment.js +0 -42
- package/lib/util/environment.js.map +0 -1
- package/lib/util/error-boundary.js +0 -105
- package/lib/util/error-boundary.js.map +0 -1
- package/lib/util/index.d.ts +0 -9
- package/lib/util/index.js +0 -2
- package/lib/util/index.js.map +0 -1
- package/lib/util/logs.js +0 -28
- package/lib/util/logs.js.map +0 -1
- package/lib/util/objects.js +0 -60
- package/lib/util/objects.js.map +0 -1
- package/lib/util/react.js +0 -75
- package/lib/util/react.js.map +0 -1
- package/lib/util/regexs.js +0 -31
- package/lib/util/regexs.js.map +0 -1
- package/lib/util/webchat.js +0 -92
- package/lib/util/webchat.js.map +0 -1
- package/lib/webchat/actions.js +0 -53
- package/lib/webchat/actions.js.map +0 -1
- package/lib/webchat/components/attachment.js +0 -68
- package/lib/webchat/components/attachment.js.map +0 -1
- package/lib/webchat/components/common.js +0 -29
- package/lib/webchat/components/common.js.map +0 -1
- package/lib/webchat/components/conditional-animation.js +0 -42
- package/lib/webchat/components/conditional-animation.js.map +0 -1
- package/lib/webchat/components/emoji-picker.js +0 -89
- package/lib/webchat/components/emoji-picker.js.map +0 -1
- package/lib/webchat/components/persistent-menu.js +0 -104
- package/lib/webchat/components/persistent-menu.js.map +0 -1
- package/lib/webchat/components/send-button.js +0 -45
- package/lib/webchat/components/send-button.js.map +0 -1
- package/lib/webchat/components/styled-scrollbar.js +0 -55
- package/lib/webchat/components/styled-scrollbar.js.map +0 -1
- package/lib/webchat/components/styled-scrollbar.scss +0 -12
- package/lib/webchat/components/typing-indicator.js +0 -27
- package/lib/webchat/components/typing-indicator.js.map +0 -1
- package/lib/webchat/components/typing-indicator.scss +0 -38
- package/lib/webchat/devices/device-adapter.js +0 -82
- package/lib/webchat/devices/device-adapter.js.map +0 -1
- package/lib/webchat/devices/index.js +0 -32
- package/lib/webchat/devices/index.js.map +0 -1
- package/lib/webchat/devices/scrollbar-controller.js +0 -152
- package/lib/webchat/devices/scrollbar-controller.js.map +0 -1
- package/lib/webchat/devices/webchat-resizer.js +0 -76
- package/lib/webchat/devices/webchat-resizer.js.map +0 -1
- package/lib/webchat/header.js +0 -116
- package/lib/webchat/header.js.map +0 -1
- package/lib/webchat/hooks.js +0 -359
- package/lib/webchat/hooks.js.map +0 -1
- package/lib/webchat/index.d.ts +0 -62
- package/lib/webchat/index.js +0 -32
- package/lib/webchat/index.js.map +0 -1
- package/lib/webchat/message-list.js +0 -88
- package/lib/webchat/message-list.js.map +0 -1
- package/lib/webchat/messages-reducer.js +0 -93
- package/lib/webchat/messages-reducer.js.map +0 -1
- package/lib/webchat/replies.js +0 -78
- package/lib/webchat/replies.js.map +0 -1
- package/lib/webchat/session-view.js +0 -106
- package/lib/webchat/session-view.js.map +0 -1
- package/lib/webchat/use-storage-state-hook.js +0 -60
- package/lib/webchat/use-storage-state-hook.js.map +0 -1
- package/lib/webchat/webchat-dev.js +0 -109
- package/lib/webchat/webchat-dev.js.map +0 -1
- package/lib/webchat/webchat-reducer.js +0 -108
- package/lib/webchat/webchat-reducer.js.map +0 -1
- package/lib/webchat/webchat.js +0 -1108
- package/lib/webchat/webchat.js.map +0 -1
- package/lib/webchat/webview.js +0 -122
- package/lib/webchat/webview.js.map +0 -1
- package/lib/webchat-app.js +0 -660
- package/lib/webchat-app.js.map +0 -1
- package/lib/webchat.template.html +0 -37
- package/lib/webview.js +0 -231
- package/lib/webview.js.map +0 -1
- package/lib/webview.template.html +0 -39
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import { ErrorInfo } from 'react'
|
|
3
|
-
|
|
4
|
-
import { CoverComponentProps } from '../webchat'
|
|
5
|
-
|
|
6
|
-
export type MessageType =
|
|
7
|
-
| 'audio'
|
|
8
|
-
| 'buttonmessage'
|
|
9
|
-
| 'carousel'
|
|
10
|
-
| 'custom'
|
|
11
|
-
| 'document'
|
|
12
|
-
| 'image'
|
|
13
|
-
| 'location'
|
|
14
|
-
| 'text'
|
|
15
|
-
| 'video'
|
|
16
|
-
|
|
17
|
-
export interface MessageProps {
|
|
18
|
-
blob?: boolean
|
|
19
|
-
children: React.ReactNode
|
|
20
|
-
delay?: number
|
|
21
|
-
enabletimestamps?: boolean
|
|
22
|
-
from?: 'user' | 'bot'
|
|
23
|
-
json?: Record<string, unknown>
|
|
24
|
-
style?: Record<string, unknown>
|
|
25
|
-
type?: MessageType
|
|
26
|
-
typing?: number
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const Audio: React.FunctionComponent<MessageProps>
|
|
30
|
-
export const Document: React.FunctionComponent<MessageProps>
|
|
31
|
-
|
|
32
|
-
export const Message: React.FunctionComponent<MessageProps>
|
|
33
|
-
export type Message = React.FunctionComponent<MessageProps>
|
|
34
|
-
export const Video: React.FunctionComponent<MessageProps>
|
|
35
|
-
|
|
36
|
-
export interface TextProps extends MessageProps {
|
|
37
|
-
// converts markdown syntax to HTML
|
|
38
|
-
markdown?: boolean
|
|
39
|
-
}
|
|
40
|
-
export const Text: React.FunctionComponent<TextProps>
|
|
41
|
-
|
|
42
|
-
export interface Webview {
|
|
43
|
-
name: string
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface ButtonProps {
|
|
47
|
-
params?: any
|
|
48
|
-
path?: string
|
|
49
|
-
payload?: string
|
|
50
|
-
target?: string
|
|
51
|
-
url?: string
|
|
52
|
-
webview?: Webview
|
|
53
|
-
onClick?: () => void
|
|
54
|
-
autodisable?: boolean
|
|
55
|
-
disabled?: boolean
|
|
56
|
-
disabledstyle?: boolean
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export const Button: React.FunctionComponent<ButtonProps>
|
|
60
|
-
|
|
61
|
-
export interface ReplyProps {
|
|
62
|
-
path?: string
|
|
63
|
-
payload?: string
|
|
64
|
-
children: string
|
|
65
|
-
}
|
|
66
|
-
export const Reply: React.FunctionComponent<ReplyProps>
|
|
67
|
-
export type Reply = React.FunctionComponent<ReplyProps>
|
|
68
|
-
|
|
69
|
-
export interface PicProps {
|
|
70
|
-
src: string
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export const Carousel: React.FunctionComponent<MessageProps>
|
|
74
|
-
export const Image: React.FunctionComponent<ImageProps>
|
|
75
|
-
export const Pic: React.FunctionComponent<PicProps>
|
|
76
|
-
export type ImageProps = PicProps
|
|
77
|
-
|
|
78
|
-
export interface TitleProps {
|
|
79
|
-
children: React.ReactNode
|
|
80
|
-
style: string
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export const Element: React.FunctionComponent<MessageProps>
|
|
84
|
-
export const Subtitle: React.FunctionComponent<SubtitleProps>
|
|
85
|
-
export const Title: React.FunctionComponent<TitleProps>
|
|
86
|
-
export type SubtitleProps = TitleProps
|
|
87
|
-
|
|
88
|
-
type CustomProp = { custom?: React.ComponentType }
|
|
89
|
-
type EnableProp = { enable?: boolean }
|
|
90
|
-
type ImageProp = { image?: string } // https URL or imported Image asset
|
|
91
|
-
type PersistentMenuCloseOption = { closeLabel: string }
|
|
92
|
-
type PersistentMenuOption = { label: string } & ButtonProps
|
|
93
|
-
type StyleProp = { style?: any }
|
|
94
|
-
|
|
95
|
-
export type PersistentMenuTheme = (
|
|
96
|
-
| PersistentMenuCloseOption
|
|
97
|
-
| PersistentMenuOption
|
|
98
|
-
)[]
|
|
99
|
-
|
|
100
|
-
export interface PersistentMenuProps {
|
|
101
|
-
onClick: () => void
|
|
102
|
-
options: any
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export type BlockInputOption = {
|
|
106
|
-
preprocess?: (message: string) => string
|
|
107
|
-
match: RegExp[]
|
|
108
|
-
message: string
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export interface BlobProps {
|
|
112
|
-
blobTick?: boolean
|
|
113
|
-
blobTickStyle?: any
|
|
114
|
-
blobWidth?: string
|
|
115
|
-
imageStyle?: any
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export interface ScrollbarProps {
|
|
119
|
-
autoHide?: boolean
|
|
120
|
-
thumb?: {
|
|
121
|
-
bgcolor?: string
|
|
122
|
-
border?: string
|
|
123
|
-
color?: string
|
|
124
|
-
opacity?: string
|
|
125
|
-
}
|
|
126
|
-
track?: {
|
|
127
|
-
bgcolor?: string
|
|
128
|
-
border?: string
|
|
129
|
-
color?: string
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export interface ThemeProps extends StyleProp {
|
|
134
|
-
mobileBreakpoint?: number
|
|
135
|
-
mobileStyle?: any
|
|
136
|
-
webview?: StyleProp & { header?: StyleProp }
|
|
137
|
-
animations?: EnableProp
|
|
138
|
-
intro?: StyleProp & ImageProp & CustomProp
|
|
139
|
-
brand?: { color?: string } & ImageProp
|
|
140
|
-
header?: { title?: string; subtitle?: string } & ImageProp &
|
|
141
|
-
StyleProp &
|
|
142
|
-
CustomProp
|
|
143
|
-
message?: {
|
|
144
|
-
bot?: BlobProps & ImageProp & StyleProp
|
|
145
|
-
user?: BlobProps & StyleProp
|
|
146
|
-
customTypes?: React.ComponentType[]
|
|
147
|
-
} & StyleProp & {
|
|
148
|
-
timestamps?: {
|
|
149
|
-
enable?: boolean
|
|
150
|
-
format(): string
|
|
151
|
-
} & StyleProp
|
|
152
|
-
}
|
|
153
|
-
button?: {
|
|
154
|
-
autodisable?: boolean
|
|
155
|
-
disabledstyle?: any
|
|
156
|
-
hoverBackground?: string
|
|
157
|
-
hoverTextColor?: string
|
|
158
|
-
messageType?: 'text' | 'payload'
|
|
159
|
-
} & StyleProp &
|
|
160
|
-
CustomProp
|
|
161
|
-
replies?: {
|
|
162
|
-
align?: 'left' | 'center' | 'right'
|
|
163
|
-
wrap?: 'wrap' | 'nowrap'
|
|
164
|
-
}
|
|
165
|
-
carousel?: {
|
|
166
|
-
arrow?: {
|
|
167
|
-
left: CustomProp
|
|
168
|
-
right: CustomProp
|
|
169
|
-
}
|
|
170
|
-
enableArrows?: boolean
|
|
171
|
-
}
|
|
172
|
-
reply?: StyleProp & CustomProp
|
|
173
|
-
triggerButton?: ImageProp & StyleProp & CustomProp
|
|
174
|
-
markdownStyle?: string // string template with css styles
|
|
175
|
-
scrollbar?: ScrollbarProps & EnableProp
|
|
176
|
-
userInput?: {
|
|
177
|
-
attachments?: EnableProp & CustomProp
|
|
178
|
-
blockInputs?: BlockInputOption[]
|
|
179
|
-
box?: { placeholder: string } & StyleProp
|
|
180
|
-
emojiPicker?: EnableProp & CustomProp
|
|
181
|
-
menu?: { darkBackground?: boolean } & {
|
|
182
|
-
custom?: React.ComponentType<PersistentMenuProps>
|
|
183
|
-
}
|
|
184
|
-
menuButton?: CustomProp
|
|
185
|
-
persistentMenu?: PersistentMenuTheme
|
|
186
|
-
sendButton?: EnableProp & CustomProp
|
|
187
|
-
} & EnableProp &
|
|
188
|
-
StyleProp
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export interface CoverComponentOptions {
|
|
192
|
-
component: React.ComponentType<CoverComponentProps>
|
|
193
|
-
props?: any
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
export interface WebchatSettingsProps {
|
|
197
|
-
blockInputs?: BlockInputOption[]
|
|
198
|
-
enableAnimations?: boolean
|
|
199
|
-
enableAttachments?: boolean
|
|
200
|
-
enableEmojiPicker?: boolean
|
|
201
|
-
enableUserInput?: boolean
|
|
202
|
-
persistentMenu?: PersistentMenuTheme
|
|
203
|
-
theme?: ThemeProps
|
|
204
|
-
}
|
|
205
|
-
export const WebchatSettings: React.FunctionComponent<WebchatSettingsProps>
|
|
206
|
-
|
|
207
|
-
export type WrappedComponent<Props> = React.FunctionComponent<Props> & {
|
|
208
|
-
customTypeName: string
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
export class ErrorBoundary<Props> extends React.Component<Props> {
|
|
212
|
-
componentDidCatch(error: Error, errorInfo: ErrorInfo): void
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
export function createErrorBoundary<Props>(_?: {
|
|
216
|
-
errorComponent: React.ComponentType
|
|
217
|
-
}): ErrorBoundary<Props>
|
|
218
|
-
|
|
219
|
-
export function customMessage<Props>(_: {
|
|
220
|
-
name: string
|
|
221
|
-
component: React.ComponentType<Props>
|
|
222
|
-
defaultProps?: Record<string, unknown>
|
|
223
|
-
errorBoundary?: ErrorBoundary<Props>
|
|
224
|
-
}): WrappedComponent<Props>
|
|
225
|
-
|
|
226
|
-
export function getDisplayName(component: React.ComponentType): string
|
|
227
|
-
|
|
228
|
-
export * from './multichannel'
|
package/lib/components/index.js
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _exportNames = {
|
|
7
|
-
Audio: true,
|
|
8
|
-
Button: true,
|
|
9
|
-
Carousel: true,
|
|
10
|
-
customMessage: true,
|
|
11
|
-
Document: true,
|
|
12
|
-
Element: true,
|
|
13
|
-
Image: true,
|
|
14
|
-
Location: true,
|
|
15
|
-
MessageTemplate: true,
|
|
16
|
-
Pic: true,
|
|
17
|
-
Raw: true,
|
|
18
|
-
Reply: true,
|
|
19
|
-
ShareButton: true,
|
|
20
|
-
Subtitle: true,
|
|
21
|
-
Text: true,
|
|
22
|
-
Title: true,
|
|
23
|
-
Video: true,
|
|
24
|
-
WebchatSettings: true,
|
|
25
|
-
WhatsappTemplate: true
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "Audio", {
|
|
28
|
-
enumerable: true,
|
|
29
|
-
get: function get() {
|
|
30
|
-
return _audio.Audio;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
Object.defineProperty(exports, "Button", {
|
|
34
|
-
enumerable: true,
|
|
35
|
-
get: function get() {
|
|
36
|
-
return _button.Button;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
Object.defineProperty(exports, "Carousel", {
|
|
40
|
-
enumerable: true,
|
|
41
|
-
get: function get() {
|
|
42
|
-
return _carousel.Carousel;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
Object.defineProperty(exports, "Document", {
|
|
46
|
-
enumerable: true,
|
|
47
|
-
get: function get() {
|
|
48
|
-
return _document.Document;
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
Object.defineProperty(exports, "Element", {
|
|
52
|
-
enumerable: true,
|
|
53
|
-
get: function get() {
|
|
54
|
-
return _element.Element;
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
Object.defineProperty(exports, "Image", {
|
|
58
|
-
enumerable: true,
|
|
59
|
-
get: function get() {
|
|
60
|
-
return _image.Image;
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
Object.defineProperty(exports, "Location", {
|
|
64
|
-
enumerable: true,
|
|
65
|
-
get: function get() {
|
|
66
|
-
return _location.Location;
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
Object.defineProperty(exports, "MessageTemplate", {
|
|
70
|
-
enumerable: true,
|
|
71
|
-
get: function get() {
|
|
72
|
-
return _messageTemplate.MessageTemplate;
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
Object.defineProperty(exports, "Pic", {
|
|
76
|
-
enumerable: true,
|
|
77
|
-
get: function get() {
|
|
78
|
-
return _pic.Pic;
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
Object.defineProperty(exports, "Raw", {
|
|
82
|
-
enumerable: true,
|
|
83
|
-
get: function get() {
|
|
84
|
-
return _raw.Raw;
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
Object.defineProperty(exports, "Reply", {
|
|
88
|
-
enumerable: true,
|
|
89
|
-
get: function get() {
|
|
90
|
-
return _reply.Reply;
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
Object.defineProperty(exports, "ShareButton", {
|
|
94
|
-
enumerable: true,
|
|
95
|
-
get: function get() {
|
|
96
|
-
return _shareButton.ShareButton;
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
Object.defineProperty(exports, "Subtitle", {
|
|
100
|
-
enumerable: true,
|
|
101
|
-
get: function get() {
|
|
102
|
-
return _subtitle.Subtitle;
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
Object.defineProperty(exports, "Text", {
|
|
106
|
-
enumerable: true,
|
|
107
|
-
get: function get() {
|
|
108
|
-
return _text.Text;
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
Object.defineProperty(exports, "Title", {
|
|
112
|
-
enumerable: true,
|
|
113
|
-
get: function get() {
|
|
114
|
-
return _title.Title;
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
Object.defineProperty(exports, "Video", {
|
|
118
|
-
enumerable: true,
|
|
119
|
-
get: function get() {
|
|
120
|
-
return _video.Video;
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
Object.defineProperty(exports, "WebchatSettings", {
|
|
124
|
-
enumerable: true,
|
|
125
|
-
get: function get() {
|
|
126
|
-
return _webchatSettings.WebchatSettings;
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
Object.defineProperty(exports, "WhatsappTemplate", {
|
|
130
|
-
enumerable: true,
|
|
131
|
-
get: function get() {
|
|
132
|
-
return _whatsappTemplate.WhatsappTemplate;
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
Object.defineProperty(exports, "customMessage", {
|
|
136
|
-
enumerable: true,
|
|
137
|
-
get: function get() {
|
|
138
|
-
return _customMessage.customMessage;
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
var _audio = require("./audio");
|
|
143
|
-
|
|
144
|
-
var _button = require("./button");
|
|
145
|
-
|
|
146
|
-
var _carousel = require("./carousel");
|
|
147
|
-
|
|
148
|
-
var _customMessage = require("./custom-message");
|
|
149
|
-
|
|
150
|
-
var _document = require("./document");
|
|
151
|
-
|
|
152
|
-
var _element = require("./element");
|
|
153
|
-
|
|
154
|
-
var _image = require("./image");
|
|
155
|
-
|
|
156
|
-
var _location = require("./location");
|
|
157
|
-
|
|
158
|
-
var _messageTemplate = require("./message-template");
|
|
159
|
-
|
|
160
|
-
var _multichannel = require("./multichannel");
|
|
161
|
-
|
|
162
|
-
Object.keys(_multichannel).forEach(function (key) {
|
|
163
|
-
if (key === "default" || key === "__esModule") return;
|
|
164
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
165
|
-
if (key in exports && exports[key] === _multichannel[key]) return;
|
|
166
|
-
Object.defineProperty(exports, key, {
|
|
167
|
-
enumerable: true,
|
|
168
|
-
get: function get() {
|
|
169
|
-
return _multichannel[key];
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
var _pic = require("./pic");
|
|
175
|
-
|
|
176
|
-
var _raw = require("./raw");
|
|
177
|
-
|
|
178
|
-
var _reply = require("./reply");
|
|
179
|
-
|
|
180
|
-
var _shareButton = require("./share-button");
|
|
181
|
-
|
|
182
|
-
var _subtitle = require("./subtitle");
|
|
183
|
-
|
|
184
|
-
var _text = require("./text");
|
|
185
|
-
|
|
186
|
-
var _title = require("./title");
|
|
187
|
-
|
|
188
|
-
var _video = require("./video");
|
|
189
|
-
|
|
190
|
-
var _webchatSettings = require("./webchat-settings");
|
|
191
|
-
|
|
192
|
-
var _whatsappTemplate = require("./whatsapp-template");
|
|
193
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA","sourcesContent":["export { Audio } from './audio'\nexport { Button } from './button'\nexport { Carousel } from './carousel'\nexport { customMessage } from './custom-message'\nexport { Document } from './document'\nexport { Element } from './element'\nexport { Image } from './image'\nexport { Location } from './location'\nexport { MessageTemplate } from './message-template'\nexport * from './multichannel'\nexport { Pic } from './pic'\nexport { Raw } from './raw'\nexport { Reply } from './reply'\nexport { ShareButton } from './share-button'\nexport { Subtitle } from './subtitle'\nexport { Text } from './text'\nexport { Title } from './title'\nexport { Video } from './video'\nexport { WebchatSettings } from './webchat-settings'\nexport { WhatsappTemplate } from './whatsapp-template'\n"],"file":"index.js"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.Location = void 0;
|
|
9
|
-
|
|
10
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
-
|
|
14
|
-
var _core = require("@botonic/core");
|
|
15
|
-
|
|
16
|
-
var _react = _interopRequireDefault(require("react"));
|
|
17
|
-
|
|
18
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
19
|
-
|
|
20
|
-
var _react2 = require("../util/react");
|
|
21
|
-
|
|
22
|
-
var _message = require("./message");
|
|
23
|
-
|
|
24
|
-
var _templateObject;
|
|
25
|
-
|
|
26
|
-
var Link = _styledComponents["default"].a(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n text-decoration: none;\n font-weight: bold;\n target: blank;\n"])));
|
|
27
|
-
|
|
28
|
-
var serialize = function serialize(locationProps) {
|
|
29
|
-
return {
|
|
30
|
-
location: {
|
|
31
|
-
lat: locationProps.lat,
|
|
32
|
-
"long": locationProps["long"]
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
var Location = function Location(props) {
|
|
38
|
-
var lat = parseFloat(props.lat);
|
|
39
|
-
|
|
40
|
-
var _long = parseFloat(props["long"]);
|
|
41
|
-
|
|
42
|
-
var renderBrowser = function renderBrowser() {
|
|
43
|
-
var locationUrl = "https://www.google.com/maps/search/?api=1&query=".concat(lat, ",").concat(_long);
|
|
44
|
-
return /*#__PURE__*/_react["default"].createElement(_message.Message, (0, _extends2["default"])({
|
|
45
|
-
json: serialize(props)
|
|
46
|
-
}, props, {
|
|
47
|
-
type: _core.INPUT.LOCATION
|
|
48
|
-
}), /*#__PURE__*/_react["default"].createElement(Link, {
|
|
49
|
-
href: locationUrl,
|
|
50
|
-
target: "_blank",
|
|
51
|
-
rel: "noopener noreferrer"
|
|
52
|
-
}, props.text || 'Open Location'));
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
var renderNode = function renderNode() {
|
|
56
|
-
return /*#__PURE__*/_react["default"].createElement("message", {
|
|
57
|
-
type: _core.INPUT.LOCATION
|
|
58
|
-
}, /*#__PURE__*/_react["default"].createElement("lat", null, lat), /*#__PURE__*/_react["default"].createElement("long", null, _long));
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
return (0, _react2.renderComponent)({
|
|
62
|
-
renderBrowser: renderBrowser,
|
|
63
|
-
renderNode: renderNode
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
exports.Location = Location;
|
|
68
|
-
Location.serialize = serialize;
|
|
69
|
-
//# sourceMappingURL=location.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/location.jsx"],"names":["Link","styled","a","serialize","locationProps","location","lat","Location","props","parseFloat","long","renderBrowser","locationUrl","INPUT","LOCATION","text","renderNode"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;;;AAEA,IAAMA,IAAI,GAAGC,6BAAOC,CAAV,0JAAV;;AAMA,IAAMC,SAAS,GAAG,SAAZA,SAAY,CAAAC,aAAa,EAAI;AACjC,SAAO;AAAEC,IAAAA,QAAQ,EAAE;AAAEC,MAAAA,GAAG,EAAEF,aAAa,CAACE,GAArB;AAA0B,cAAMF,aAAa;AAA7C;AAAZ,GAAP;AACD,CAFD;;AAIO,IAAMG,QAAQ,GAAG,SAAXA,QAAW,CAAAC,KAAK,EAAI;AAC/B,MAAMF,GAAG,GAAGG,UAAU,CAACD,KAAK,CAACF,GAAP,CAAtB;;AACA,MAAMI,KAAI,GAAGD,UAAU,CAACD,KAAK,QAAN,CAAvB;;AACA,MAAMG,aAAa,GAAG,SAAhBA,aAAgB,GAAM;AAC1B,QAAMC,WAAW,6DAAsDN,GAAtD,cAA6DI,KAA7D,CAAjB;AACA,wBACE,gCAAC,gBAAD;AAAS,MAAA,IAAI,EAAEP,SAAS,CAACK,KAAD;AAAxB,OAAqCA,KAArC;AAA4C,MAAA,IAAI,EAAEK,YAAMC;AAAxD,qBACE,gCAAC,IAAD;AAAM,MAAA,IAAI,EAAEF,WAAZ;AAAyB,MAAA,MAAM,EAAC,QAAhC;AAAyC,MAAA,GAAG,EAAC;AAA7C,OACGJ,KAAK,CAACO,IAAN,IAAc,eADjB,CADF,CADF;AAOD,GATD;;AAWA,MAAMC,UAAU,GAAG,SAAbA,UAAa,GAAM;AACvB,wBACE;AAAS,MAAA,IAAI,EAAEH,YAAMC;AAArB,oBACE,6CAAMR,GAAN,CADF,eAEE,8CAAOI,KAAP,CAFF,CADF;AAMD,GAPD;;AASA,SAAO,6BAAgB;AAAEC,IAAAA,aAAa,EAAbA,aAAF;AAAiBK,IAAAA,UAAU,EAAVA;AAAjB,GAAhB,CAAP;AACD,CAxBM;;;AA0BPT,QAAQ,CAACJ,SAAT,GAAqBA,SAArB","sourcesContent":["import { INPUT } from '@botonic/core'\nimport React from 'react'\nimport styled from 'styled-components'\n\nimport { renderComponent } from '../util/react'\nimport { Message } from './message'\n\nconst Link = styled.a`\n text-decoration: none;\n font-weight: bold;\n target: blank;\n`\n\nconst serialize = locationProps => {\n return { location: { lat: locationProps.lat, long: locationProps.long } }\n}\n\nexport const Location = props => {\n const lat = parseFloat(props.lat)\n const long = parseFloat(props.long)\n const renderBrowser = () => {\n const locationUrl = `https://www.google.com/maps/search/?api=1&query=${lat},${long}`\n return (\n <Message json={serialize(props)} {...props} type={INPUT.LOCATION}>\n <Link href={locationUrl} target='_blank' rel='noopener noreferrer'>\n {props.text || 'Open Location'}\n </Link>\n </Message>\n )\n }\n\n const renderNode = () => {\n return (\n <message type={INPUT.LOCATION}>\n <lat>{lat}</lat>\n <long>{long}</long>\n </message>\n )\n }\n\n return renderComponent({ renderBrowser, renderNode })\n}\n\nLocation.serialize = serialize\n"],"file":"location.js"}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.toMarkdownChildren = exports.serializeMarkdown = exports.renderMarkdown = exports.renderLinks = exports.getMarkdownStyle = exports.getDefaultMarkdownStyle = exports.ESCAPED_LINE_BREAK = void 0;
|
|
9
|
-
|
|
10
|
-
var _markdownIt = _interopRequireDefault(require("markdown-it"));
|
|
11
|
-
|
|
12
|
-
var BR_STRING_TAG = '<br/>';
|
|
13
|
-
var BR_STRING_TAG_REGEX = new RegExp('<br\\s*/?>', 'g');
|
|
14
|
-
var ESCAPED_LINE_BREAK = '<br>';
|
|
15
|
-
exports.ESCAPED_LINE_BREAK = ESCAPED_LINE_BREAK;
|
|
16
|
-
var ESCAPED_LINE_BREAK_REGEX = new RegExp(ESCAPED_LINE_BREAK, 'g');
|
|
17
|
-
|
|
18
|
-
var isLineBreakElement = function isLineBreakElement(element) {
|
|
19
|
-
return element.type === 'br';
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
var withLinksTarget = function withLinksTarget(renderer) {
|
|
23
|
-
var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '_blank';
|
|
24
|
-
|
|
25
|
-
// Support opening links in new tabs: https://github.com/markdown-it/markdown-it/blob/master/docs/architecture.md#renderer
|
|
26
|
-
var newRenderer = renderer.renderer.rules.link_open || function (tokens, idx, options, env, self) {
|
|
27
|
-
return self.renderToken(tokens, idx, options);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
renderer.renderer.rules.link_open = function (tokens, idx, options, env, self) {
|
|
31
|
-
var aIndex = tokens[idx].attrIndex('target');
|
|
32
|
-
if (aIndex < 0) tokens[idx].attrPush(['target', target]);else tokens[idx].attrs[aIndex][1] = target;
|
|
33
|
-
return newRenderer(tokens, idx, options, env, self);
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
var configureLinksRenderer = function configureLinksRenderer() {
|
|
38
|
-
// zero preset comes with all options disabled, only enabling links
|
|
39
|
-
var linksRenderer = new _markdownIt["default"]('zero', {
|
|
40
|
-
linkify: true
|
|
41
|
-
}).enable(['linkify']);
|
|
42
|
-
withLinksTarget(linksRenderer);
|
|
43
|
-
return linksRenderer;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
var configureMarkdownRenderer = function configureMarkdownRenderer() {
|
|
47
|
-
var markdownRenderer = new _markdownIt["default"]({
|
|
48
|
-
html: true,
|
|
49
|
-
linkify: true,
|
|
50
|
-
typographer: true
|
|
51
|
-
});
|
|
52
|
-
withLinksTarget(markdownRenderer);
|
|
53
|
-
return markdownRenderer;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
var markdownRenderer = configureMarkdownRenderer();
|
|
57
|
-
|
|
58
|
-
var renderMarkdown = function renderMarkdown(text) {
|
|
59
|
-
// markdown-it renderer expects '<br/>' strings to render correctly line breaks
|
|
60
|
-
// Supporting multiline: https://stackoverflow.com/a/20543835
|
|
61
|
-
text = text.map(function (e) {
|
|
62
|
-
if (isLineBreakElement(e)) return BR_STRING_TAG;else if (typeof e === 'string') return e.replace(BR_STRING_TAG_REGEX, BR_STRING_TAG).replace(ESCAPED_LINE_BREAK_REGEX, BR_STRING_TAG);else return String(e);
|
|
63
|
-
}).join('');
|
|
64
|
-
return markdownRenderer.render(text);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
exports.renderMarkdown = renderMarkdown;
|
|
68
|
-
var linksRenderer = configureLinksRenderer();
|
|
69
|
-
|
|
70
|
-
var renderLinks = function renderLinks(text) {
|
|
71
|
-
return linksRenderer.render(text);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
exports.renderLinks = renderLinks;
|
|
75
|
-
|
|
76
|
-
var serializeMarkdown = function serializeMarkdown(children) {
|
|
77
|
-
children = Array.isArray(children) ? children : [children];
|
|
78
|
-
var text = children.filter(function (e) {
|
|
79
|
-
return isLineBreakElement(e) || !e.type;
|
|
80
|
-
}).map(function (e) {
|
|
81
|
-
if (Array.isArray(e)) return serializeMarkdown(e);
|
|
82
|
-
if (isLineBreakElement(e)) return ESCAPED_LINE_BREAK;else return String(e).replace(BR_STRING_TAG_REGEX, ESCAPED_LINE_BREAK);
|
|
83
|
-
}).join('');
|
|
84
|
-
return text;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
exports.serializeMarkdown = serializeMarkdown;
|
|
88
|
-
|
|
89
|
-
var toMarkdownChildren = function toMarkdownChildren(children) {
|
|
90
|
-
return children.map(function (e) {
|
|
91
|
-
return isLineBreakElement(e) ? ESCAPED_LINE_BREAK : e;
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
exports.toMarkdownChildren = toMarkdownChildren;
|
|
96
|
-
|
|
97
|
-
var getMarkdownStyle = function getMarkdownStyle(getThemeFn, defaultColor) {
|
|
98
|
-
return getThemeFn('markdownStyle', getDefaultMarkdownStyle(defaultColor));
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
exports.getMarkdownStyle = getMarkdownStyle;
|
|
102
|
-
|
|
103
|
-
var getDefaultMarkdownStyle = function getDefaultMarkdownStyle(color) {
|
|
104
|
-
return "\n*{\n margin: 0px;\n}\n\na {\n text-decoration:none;\n}\n\na:link{\n color:".concat(color, "; \n}\n\na:visited {\n color:").concat(color, ";\n}\n\na:hover {\n text-shadow: 0px 1px black;\n}\n\nblockquote {\n margin: 0;\n padding-left: 1.4rem;\n border-left: 4px solid #dadada; \n}\n\npre code {\n margin: 0;\n padding: 0;\n white-space: pre;\n border: none;\n background: transparent; \n}\n\npre {\n background-color: #f8f8f8;\n border: 1px solid #cccccc;\n font-size: 13px;\n line-height: 19px;\n overflow: auto;\n padding: 6px 10px;\n border-radius: 3px; \n}\n\ncode, tt {\n margin: 0 2px;\n padding: 0 5px;\n white-space: nowrap;\n border: 1px solid #eaeaea;\n background-color: #f8f8f8;\n border-radius: 3px; \n}\n\npre {\n background-color: #f8f8f8;\n border: 1px solid #cccccc;\n font-size: 13px;\n line-height: 19px;\n overflow: auto;\n padding: 6px 10px;\n border-radius: 3px; \n}\n\npre code, pre tt {\n background-color: transparent;\n border: none; \n}\n \ntable, td, th {\n border: 1px solid black;\n padding:10px;\n}\n");
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
exports.getDefaultMarkdownStyle = getDefaultMarkdownStyle;
|
|
108
|
-
//# sourceMappingURL=markdown.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/markdown.js"],"names":["BR_STRING_TAG","BR_STRING_TAG_REGEX","RegExp","ESCAPED_LINE_BREAK","ESCAPED_LINE_BREAK_REGEX","isLineBreakElement","element","type","withLinksTarget","renderer","target","newRenderer","rules","link_open","tokens","idx","options","env","self","renderToken","aIndex","attrIndex","attrPush","attrs","configureLinksRenderer","linksRenderer","MarkdownIt","linkify","enable","configureMarkdownRenderer","markdownRenderer","html","typographer","renderMarkdown","text","map","e","replace","String","join","render","renderLinks","serializeMarkdown","children","Array","isArray","filter","toMarkdownChildren","getMarkdownStyle","getThemeFn","defaultColor","getDefaultMarkdownStyle","color"],"mappings":"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","sourcesContent":["import MarkdownIt from 'markdown-it'\n\nconst BR_STRING_TAG = '<br/>'\nconst BR_STRING_TAG_REGEX = new RegExp('<br\\\\s*/?>', 'g')\nexport const ESCAPED_LINE_BREAK = '<br>'\nconst ESCAPED_LINE_BREAK_REGEX = new RegExp(ESCAPED_LINE_BREAK, 'g')\nconst isLineBreakElement = element => element.type === 'br'\n\nconst withLinksTarget = (renderer, target = '_blank') => {\n // Support opening links in new tabs: https://github.com/markdown-it/markdown-it/blob/master/docs/architecture.md#renderer\n const newRenderer =\n renderer.renderer.rules.link_open ||\n function (tokens, idx, options, env, self) {\n return self.renderToken(tokens, idx, options)\n }\n renderer.renderer.rules.link_open = function (\n tokens,\n idx,\n options,\n env,\n self\n ) {\n const aIndex = tokens[idx].attrIndex('target')\n if (aIndex < 0) tokens[idx].attrPush(['target', target])\n else tokens[idx].attrs[aIndex][1] = target\n return newRenderer(tokens, idx, options, env, self)\n }\n}\n\nconst configureLinksRenderer = () => {\n // zero preset comes with all options disabled, only enabling links\n const linksRenderer = new MarkdownIt('zero', { linkify: true }).enable([\n 'linkify',\n ])\n withLinksTarget(linksRenderer)\n return linksRenderer\n}\n\nconst configureMarkdownRenderer = () => {\n const markdownRenderer = new MarkdownIt({\n html: true,\n linkify: true,\n typographer: true,\n })\n withLinksTarget(markdownRenderer)\n return markdownRenderer\n}\n\nconst markdownRenderer = configureMarkdownRenderer()\nexport const renderMarkdown = text => {\n // markdown-it renderer expects '<br/>' strings to render correctly line breaks\n // Supporting multiline: https://stackoverflow.com/a/20543835\n text = text\n .map(e => {\n if (isLineBreakElement(e)) return BR_STRING_TAG\n else if (typeof e === 'string')\n return e\n .replace(BR_STRING_TAG_REGEX, BR_STRING_TAG)\n .replace(ESCAPED_LINE_BREAK_REGEX, BR_STRING_TAG)\n else return String(e)\n })\n .join('')\n return markdownRenderer.render(text)\n}\n\nconst linksRenderer = configureLinksRenderer()\nexport const renderLinks = text => {\n return linksRenderer.render(text)\n}\n\nexport const serializeMarkdown = children => {\n children = Array.isArray(children) ? children : [children]\n const text = children\n .filter(e => isLineBreakElement(e) || !e.type)\n .map(e => {\n if (Array.isArray(e)) return serializeMarkdown(e)\n if (isLineBreakElement(e)) return ESCAPED_LINE_BREAK\n else return String(e).replace(BR_STRING_TAG_REGEX, ESCAPED_LINE_BREAK)\n })\n .join('')\n return text\n}\n\nexport const toMarkdownChildren = children =>\n children.map(e => (isLineBreakElement(e) ? ESCAPED_LINE_BREAK : e))\n\nexport const getMarkdownStyle = (getThemeFn, defaultColor) =>\n getThemeFn('markdownStyle', getDefaultMarkdownStyle(defaultColor))\n\nexport const getDefaultMarkdownStyle = color => `\n*{\n margin: 0px;\n}\n\na {\n text-decoration:none;\n}\n\na:link{\n color:${color}; \n}\n\na:visited {\n color:${color};\n}\n\na:hover {\n text-shadow: 0px 1px black;\n}\n\nblockquote {\n margin: 0;\n padding-left: 1.4rem;\n border-left: 4px solid #dadada; \n}\n\npre code {\n margin: 0;\n padding: 0;\n white-space: pre;\n border: none;\n background: transparent; \n}\n\npre {\n background-color: #f8f8f8;\n border: 1px solid #cccccc;\n font-size: 13px;\n line-height: 19px;\n overflow: auto;\n padding: 6px 10px;\n border-radius: 3px; \n}\n\ncode, tt {\n margin: 0 2px;\n padding: 0 5px;\n white-space: nowrap;\n border: 1px solid #eaeaea;\n background-color: #f8f8f8;\n border-radius: 3px; \n}\n\npre {\n background-color: #f8f8f8;\n border: 1px solid #cccccc;\n font-size: 13px;\n line-height: 19px;\n overflow: auto;\n padding: 6px 10px;\n border-radius: 3px; \n}\n\npre code, pre tt {\n background-color: transparent;\n border: none; \n}\n \ntable, td, th {\n border: 1px solid black;\n padding:10px;\n}\n`\n"],"file":"markdown.js"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.MessageTemplate = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _react2 = require("../util/react");
|
|
13
|
-
|
|
14
|
-
var MessageTemplate = function MessageTemplate(props) {
|
|
15
|
-
var renderBrowser = function renderBrowser() {
|
|
16
|
-
return null;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
var renderNode = function renderNode() {
|
|
20
|
-
return /*#__PURE__*/_react["default"].createElement("message", {
|
|
21
|
-
type: "template"
|
|
22
|
-
}, /*#__PURE__*/_react["default"].createElement("pre", {
|
|
23
|
-
dangerouslySetInnerHTML: {
|
|
24
|
-
__html: JSON.stringify(props.payload)
|
|
25
|
-
}
|
|
26
|
-
}));
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
return (0, _react2.renderComponent)({
|
|
30
|
-
renderBrowser: renderBrowser,
|
|
31
|
-
renderNode: renderNode
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
exports.MessageTemplate = MessageTemplate;
|
|
36
|
-
//# sourceMappingURL=message-template.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/message-template.jsx"],"names":["MessageTemplate","props","renderBrowser","renderNode","__html","JSON","stringify","payload"],"mappings":";;;;;;;;;AAAA;;AAEA;;AAEO,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,KAAK,EAAI;AACtC,MAAMC,aAAa,GAAG,SAAhBA,aAAgB;AAAA,WAAM,IAAN;AAAA,GAAtB;;AACA,MAAMC,UAAU,GAAG,SAAbA,UAAa;AAAA,wBACjB;AAAS,MAAA,IAAI,EAAC;AAAd,oBACE;AACE,MAAA,uBAAuB,EAAE;AAAEC,QAAAA,MAAM,EAAEC,IAAI,CAACC,SAAL,CAAeL,KAAK,CAACM,OAArB;AAAV;AAD3B,MADF,CADiB;AAAA,GAAnB;;AAOA,SAAO,6BAAgB;AAAEL,IAAAA,aAAa,EAAbA,aAAF;AAAiBC,IAAAA,UAAU,EAAVA;AAAjB,GAAhB,CAAP;AACD,CAVM","sourcesContent":["import React from 'react'\n\nimport { renderComponent } from '../util/react'\n\nexport const MessageTemplate = props => {\n const renderBrowser = () => null\n const renderNode = () => (\n <message type='template'>\n <pre\n dangerouslySetInnerHTML={{ __html: JSON.stringify(props.payload) }}\n />\n </message>\n )\n return renderComponent({ renderBrowser, renderNode })\n}\n"],"file":"message-template.js"}
|