@botonic/react 0.24.0-alpha.1 → 0.24.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/botonic-tester.js +4 -4
- package/lib/cjs/botonic-tester.js.map +1 -1
- package/lib/cjs/components/multichannel/multichannel-text.js +4 -4
- package/lib/cjs/components/multichannel/multichannel-text.js.map +1 -1
- package/lib/cjs/index-types.d.ts +1 -1
- package/lib/cjs/message-utils.d.ts +1 -1
- package/lib/cjs/message-utils.js +16 -16
- package/lib/cjs/message-utils.js.map +1 -1
- package/lib/cjs/node-app.d.ts +1 -1
- package/lib/cjs/react-bot.d.ts +1 -1
- package/lib/cjs/react-bot.js +2 -2
- package/lib/cjs/react-bot.js.map +1 -1
- package/lib/cjs/webchat/trigger-button/index.js +2 -3
- package/lib/cjs/webchat/trigger-button/index.js.map +1 -1
- package/lib/cjs/webchat-app.js +3 -4
- package/lib/cjs/webchat-app.js.map +1 -1
- package/lib/cjs/webview-app.js +10 -12
- package/lib/cjs/webview-app.js.map +1 -1
- package/package.json +1 -1
- package/src/botonic-tester.jsx +1 -1
- package/src/components/multichannel/multichannel-text.jsx +1 -1
- package/src/index-types.ts +1 -1
- package/src/message-utils.js +1 -1
- package/src/react-bot.jsx +1 -1
- package/src/webchat/trigger-button/index.tsx +5 -10
- package/src/webchat-app.jsx +1 -2
- package/src/webview-app.tsx +1 -3
- 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/assets/index-types.d.ts +0 -4
- package/lib/esm/assets/index-types.js +0 -2
- package/lib/esm/assets/index-types.js.map +0 -1
- package/lib/esm/botonic-tester.d.ts +0 -18
- package/lib/esm/botonic-tester.js +0 -62
- package/lib/esm/botonic-tester.js.map +0 -1
- package/lib/esm/components/audio.d.ts +0 -8
- package/lib/esm/components/audio.js +0 -18
- package/lib/esm/components/audio.js.map +0 -1
- package/lib/esm/components/button.d.ts +0 -15
- package/lib/esm/components/button.js +0 -140
- 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 -102
- 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 -12
- package/lib/esm/components/custom-message.js +0 -55
- package/lib/esm/components/custom-message.js.map +0 -1
- package/lib/esm/components/document.d.ts +0 -8
- 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 -8
- 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 -189
- package/lib/esm/components/index-types.js +0 -16
- package/lib/esm/components/index-types.js.map +0 -1
- package/lib/esm/components/index.d.ts +0 -23
- package/lib/esm/components/index.js +0 -24
- 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-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/message.d.ts +0 -1
- package/lib/esm/components/message.js +0 -188
- package/lib/esm/components/message.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 -71
- 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 -73
- 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 -153
- package/lib/esm/components/multichannel/multichannel-text.js.map +0 -1
- package/lib/esm/components/multichannel/multichannel-utils.d.ts +0 -26
- package/lib/esm/components/multichannel/multichannel-utils.js +0 -69
- 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 -55
- package/lib/esm/components/multichannel/multichannel.js.map +0 -1
- package/lib/esm/components/multichannel/whatsapp/markdown.d.ts +0 -1
- package/lib/esm/components/multichannel/whatsapp/markdown.js +0 -53
- package/lib/esm/components/multichannel/whatsapp/markdown.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 -9
- package/lib/esm/components/reply.js +0 -49
- 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 -8
- package/lib/esm/components/text.js +0 -42
- package/lib/esm/components/text.js.map +0 -1
- package/lib/esm/components/timestamps.d.ts +0 -10
- package/lib/esm/components/timestamps.js +0 -45
- package/lib/esm/components/timestamps.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 -8
- package/lib/esm/components/video.js +0 -26
- package/lib/esm/components/video.js.map +0 -1
- package/lib/esm/components/webchat-settings.d.ts +0 -3
- 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 -17
- package/lib/esm/components/whatsapp-button-list.js +0 -22
- package/lib/esm/components/whatsapp-button-list.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 -172
- package/lib/esm/constants.js +0 -192
- package/lib/esm/constants.js.map +0 -1
- package/lib/esm/contexts.d.ts +0 -12
- package/lib/esm/contexts.js +0 -67
- package/lib/esm/contexts.js.map +0 -1
- package/lib/esm/dev-app.d.ts +0 -30
- package/lib/esm/dev-app.js +0 -74
- package/lib/esm/dev-app.js.map +0 -1
- package/lib/esm/index-types.d.ts +0 -128
- 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 -135
- package/lib/esm/msg-to-botonic.js.map +0 -1
- package/lib/esm/node-app.d.ts +0 -12
- package/lib/esm/node-app.js +0 -21
- 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 -29
- package/lib/esm/react-bot.js.map +0 -1
- package/lib/esm/util/dom.d.ts +0 -13
- package/lib/esm/util/dom.js +0 -46
- 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 -8
- package/lib/esm/util/index.js +0 -9
- 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/webchat.d.ts +0 -11
- package/lib/esm/util/webchat.js +0 -53
- package/lib/esm/util/webchat.js.map +0 -1
- package/lib/esm/webchat/actions.d.ts +0 -27
- package/lib/esm/webchat/actions.js +0 -29
- package/lib/esm/webchat/actions.js.map +0 -1
- package/lib/esm/webchat/components/attachment.d.ts +0 -5
- package/lib/esm/webchat/components/attachment.js +0 -24
- package/lib/esm/webchat/components/attachment.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/emoji-picker.d.ts +0 -5
- package/lib/esm/webchat/components/emoji-picker.js +0 -37
- package/lib/esm/webchat/components/emoji-picker.js.map +0 -1
- package/lib/esm/webchat/components/persistent-menu.d.ts +0 -10
- package/lib/esm/webchat/components/persistent-menu.js +0 -39
- package/lib/esm/webchat/components/persistent-menu.js.map +0 -1
- package/lib/esm/webchat/components/send-button.d.ts +0 -3
- package/lib/esm/webchat/components/send-button.js +0 -14
- package/lib/esm/webchat/components/send-button.js.map +0 -1
- package/lib/esm/webchat/components/styled-scrollbar.d.ts +0 -1
- package/lib/esm/webchat/components/styled-scrollbar.js +0 -50
- package/lib/esm/webchat/components/styled-scrollbar.js.map +0 -1
- package/lib/esm/webchat/components/typing-indicator.d.ts +0 -1
- package/lib/esm/webchat/components/typing-indicator.js +0 -6
- package/lib/esm/webchat/components/typing-indicator.js.map +0 -1
- package/lib/esm/webchat/devices/device-adapter.d.ts +0 -12
- package/lib/esm/webchat/devices/device-adapter.js +0 -43
- package/lib/esm/webchat/devices/device-adapter.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/devices/scrollbar-controller.d.ts +0 -12
- package/lib/esm/webchat/devices/scrollbar-controller.js +0 -99
- package/lib/esm/webchat/devices/scrollbar-controller.js.map +0 -1
- package/lib/esm/webchat/devices/webchat-resizer.d.ts +0 -9
- package/lib/esm/webchat/devices/webchat-resizer.js +0 -43
- package/lib/esm/webchat/devices/webchat-resizer.js.map +0 -1
- package/lib/esm/webchat/header.d.ts +0 -3
- package/lib/esm/webchat/header.js +0 -79
- package/lib/esm/webchat/header.js.map +0 -1
- package/lib/esm/webchat/hooks/index.d.ts +0 -5
- package/lib/esm/webchat/hooks/index.js +0 -6
- 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-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-typing.d.ts +0 -10
- package/lib/esm/webchat/hooks/use-typing.js +0 -26
- package/lib/esm/webchat/hooks/use-typing.js.map +0 -1
- package/lib/esm/webchat/hooks/use-webchat.d.ts +0 -41
- package/lib/esm/webchat/hooks/use-webchat.js +0 -177
- package/lib/esm/webchat/hooks/use-webchat.js.map +0 -1
- package/lib/esm/webchat/index-types.d.ts +0 -62
- 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 -4
- package/lib/esm/webchat/index.js +0 -10
- package/lib/esm/webchat/index.js.map +0 -1
- package/lib/esm/webchat/message-list/index.d.ts +0 -1
- package/lib/esm/webchat/message-list/index.js +0 -73
- 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 -5
- package/lib/esm/webchat/message-list/scroll-button.js +0 -17
- package/lib/esm/webchat/message-list/scroll-button.js.map +0 -1
- package/lib/esm/webchat/message-list/styles.d.ts +0 -4
- package/lib/esm/webchat/message-list/styles.js +0 -46
- 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 -16
- 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/messages-reducer.d.ts +0 -6
- package/lib/esm/webchat/messages-reducer.js +0 -82
- package/lib/esm/webchat/messages-reducer.js.map +0 -1
- package/lib/esm/webchat/replies.d.ts +0 -1
- package/lib/esm/webchat/replies.js +0 -38
- package/lib/esm/webchat/replies.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/trigger-button/index.d.ts +0 -1
- 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/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/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-reducer.d.ts +0 -6
- package/lib/esm/webchat/webchat-reducer.js +0 -46
- package/lib/esm/webchat/webchat-reducer.js.map +0 -1
- package/lib/esm/webchat/webchat.d.ts +0 -3
- package/lib/esm/webchat/webchat.js +0 -637
- 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 -78
- package/lib/esm/webchat/webview.js.map +0 -1
- package/lib/esm/webchat-app.d.ts +0 -99
- package/lib/esm/webchat-app.js +0 -282
- 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 -97
- package/lib/esm/webview-app.js.map +0 -1
- package/src/.DS_Store +0 -0
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { INPUT, isBrowser } from '@botonic/core';
|
|
3
|
-
import React, { useContext } from 'react';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
import { ROLES, WEBCHAT } from '../constants';
|
|
6
|
-
import { WebchatContext } from '../contexts';
|
|
7
|
-
import { staticAsset } from '../util/environment';
|
|
8
|
-
import { Message } from './message';
|
|
9
|
-
const StyledButton = styled.a `
|
|
10
|
-
display: block;
|
|
11
|
-
height: 25px;
|
|
12
|
-
background-color: #f0f0f0;
|
|
13
|
-
padding: 10px;
|
|
14
|
-
text-align: center;
|
|
15
|
-
border-radius: 5px;
|
|
16
|
-
color: black;
|
|
17
|
-
font-weight: bold;
|
|
18
|
-
line-height: 25px;
|
|
19
|
-
text-decoration: none;
|
|
20
|
-
border: 1px solid black;
|
|
21
|
-
opacity: 0.9;
|
|
22
|
-
&:hover {
|
|
23
|
-
opacity: 1;
|
|
24
|
-
}
|
|
25
|
-
`;
|
|
26
|
-
const serialize = documentProps => {
|
|
27
|
-
return { document: documentProps.src };
|
|
28
|
-
};
|
|
29
|
-
export const Document = props => {
|
|
30
|
-
props = Object.assign(Object.assign({}, props), { src: staticAsset(props.src) });
|
|
31
|
-
let content = props.children;
|
|
32
|
-
const { getThemeProperty } = useContext(WebchatContext);
|
|
33
|
-
let documentDownload = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.documentDownload, {});
|
|
34
|
-
if (typeof documentDownload === 'function')
|
|
35
|
-
documentDownload = documentDownload(props.from);
|
|
36
|
-
if (isBrowser()) {
|
|
37
|
-
content = (_jsx(StyledButton, Object.assign({ href: props.src, target: '_blank', rel: 'noreferrer', style: Object.assign({}, documentDownload.style) }, { children: documentDownload.text || 'Download' })));
|
|
38
|
-
}
|
|
39
|
-
return (_jsx(Message, Object.assign({ role: ROLES.DOCUMENT_MESSAGE, json: serialize(props) }, props, { type: INPUT.DOCUMENT }, { children: content })));
|
|
40
|
-
};
|
|
41
|
-
Document.serialize = serialize;
|
|
42
|
-
//# sourceMappingURL=document.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"document.js","sourceRoot":"src/","sources":["components/document.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,MAAM,YAAY,GAAG,MAAM,CAAC,CAAC,CAAA;;;;;;;;;;;;;;;;CAgB5B,CAAA;AAED,MAAM,SAAS,GAAG,aAAa,CAAC,EAAE;IAChC,OAAO,EAAE,QAAQ,EAAE,aAAa,CAAC,GAAG,EAAE,CAAA;AACxC,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAAC,EAAE;IAC9B,KAAK,mCAAQ,KAAK,KAAE,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,GAAE,CAAA;IACjD,IAAI,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAA;IAE5B,MAAM,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IACvD,IAAI,gBAAgB,GAAG,gBAAgB,CACrC,OAAO,CAAC,iBAAiB,CAAC,gBAAgB,EAC1C,EAAE,CACH,CAAA;IACD,IAAI,OAAO,gBAAgB,KAAK,UAAU;QACxC,gBAAgB,GAAG,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAEjD,IAAI,SAAS,EAAE,EAAE;QACf,OAAO,GAAG,CACR,KAAC,YAAY,kBACX,IAAI,EAAE,KAAK,CAAC,GAAG,EACf,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,YAAY,EAChB,KAAK,oBACA,gBAAgB,CAAC,KAAK,iBAG1B,gBAAgB,CAAC,IAAI,IAAI,UAAU,IACvB,CAChB,CAAA;KACF;IAED,OAAO,CACL,KAAC,OAAO,kBACN,IAAI,EAAE,KAAK,CAAC,gBAAgB,EAC5B,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,IAClB,KAAK,IACT,IAAI,EAAE,KAAK,CAAC,QAAQ,gBAEnB,OAAO,IACA,CACX,CAAA;AACH,CAAC,CAAA;AAED,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAA"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { COLORS, WEBCHAT } from '../constants';
|
|
5
|
-
import { renderComponent } from '../util/react';
|
|
6
|
-
const ElementContainer = styled.div `
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: column;
|
|
9
|
-
width: ${WEBCHAT.DEFAULTS.ELEMENT_WIDTH}px;
|
|
10
|
-
margin-right: ${WEBCHAT.DEFAULTS.ELEMENT_MARGIN_RIGHT}px;
|
|
11
|
-
border-radius: 6px;
|
|
12
|
-
border: 1px solid ${COLORS.SEASHELL_WHITE};
|
|
13
|
-
overflow: hidden;
|
|
14
|
-
justify-content: space-between;
|
|
15
|
-
`;
|
|
16
|
-
export const Element = props => {
|
|
17
|
-
const renderBrowser = () => (_jsx(ElementContainer, { children: props.children }));
|
|
18
|
-
const renderNode = () => _jsx("element", { children: props.children });
|
|
19
|
-
return renderComponent({ renderBrowser, renderNode });
|
|
20
|
-
};
|
|
21
|
-
Element.serialize = elementProps => {
|
|
22
|
-
const element = Object.assign({}, ...elementProps.children
|
|
23
|
-
.filter(c => c && c.type && c.type.name != 'Button')
|
|
24
|
-
.map(c => c.type.serialize && c.type.serialize(c.props)));
|
|
25
|
-
// When we are serializer buttons from backend, we are receiving the data
|
|
26
|
-
// as an array of buttons, so we have to keep robust with serve and deal with arrays
|
|
27
|
-
element.buttons = [
|
|
28
|
-
...elementProps.children
|
|
29
|
-
.filter(c => {
|
|
30
|
-
if (c instanceof Array)
|
|
31
|
-
return true;
|
|
32
|
-
return c && c.type && c.type.name == 'Button';
|
|
33
|
-
})
|
|
34
|
-
.map(b => {
|
|
35
|
-
if (b instanceof Array) {
|
|
36
|
-
return b.map(bb => bb &&
|
|
37
|
-
bb.type &&
|
|
38
|
-
bb.type.serialize &&
|
|
39
|
-
bb.type.serialize(bb.props).button);
|
|
40
|
-
}
|
|
41
|
-
return (b && b.type && b.type.serialize && b.type.serialize(b.props).button);
|
|
42
|
-
}),
|
|
43
|
-
];
|
|
44
|
-
// When we have the buttons from backend, we have all buttons inside an array on the first position
|
|
45
|
-
// of another array in element['buttons'] we want that element['buttons'] to be an array of buttons,
|
|
46
|
-
// not an array of another array of buttons
|
|
47
|
-
if (element.buttons[0] instanceof Array)
|
|
48
|
-
element.buttons = element.buttons[0];
|
|
49
|
-
return element;
|
|
50
|
-
};
|
|
51
|
-
//# sourceMappingURL=element.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"element.js","sourceRoot":"src/","sources":["components/element.jsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;WAGxB,OAAO,CAAC,QAAQ,CAAC,aAAa;kBACvB,OAAO,CAAC,QAAQ,CAAC,oBAAoB;;sBAEjC,MAAM,CAAC,cAAc;;;CAG1C,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,CAAC,EAAE;IAC7B,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,CAC1B,KAAC,gBAAgB,cAAE,KAAK,CAAC,QAAQ,GAAoB,CACtD,CAAA;IAED,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,4BAAU,KAAK,CAAC,QAAQ,GAAW,CAAA;IAE5D,OAAO,eAAe,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,CAAA;AACvD,CAAC,CAAA;AAED,OAAO,CAAC,SAAS,GAAG,YAAY,CAAC,EAAE;IACjC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAC3B,EAAE,EACF,GAAG,YAAY,CAAC,QAAQ;SACrB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC;SACnD,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAC3D,CAAA;IACD,yEAAyE;IACzE,oFAAoF;IACpF,OAAO,CAAC,OAAO,GAAG;QAChB,GAAG,YAAY,CAAC,QAAQ;aACrB,MAAM,CAAC,CAAC,CAAC,EAAE;YACV,IAAI,CAAC,YAAY,KAAK;gBAAE,OAAO,IAAI,CAAA;YACnC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAA;QAC/C,CAAC,CAAC;aACD,GAAG,CAAC,CAAC,CAAC,EAAE;YACP,IAAI,CAAC,YAAY,KAAK,EAAE;gBACtB,OAAO,CAAC,CAAC,GAAG,CACV,EAAE,CAAC,EAAE,CACH,EAAE;oBACF,EAAE,CAAC,IAAI;oBACP,EAAE,CAAC,IAAI,CAAC,SAAS;oBACjB,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,MAAM,CACrC,CAAA;aACF;YACD,OAAO,CACL,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CACpE,CAAA;QACH,CAAC,CAAC;KACL,CAAA;IACD,mGAAmG;IACnG,oGAAoG;IACpG,2CAA2C;IAC3C,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,KAAK;QAAE,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAC7E,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function Handoff(props: any): JSX.Element;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useContext, useState } from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { COLORS } from '../constants';
|
|
5
|
-
import { WebchatContext } from '../contexts';
|
|
6
|
-
const Container = styled.div `
|
|
7
|
-
display: flex;
|
|
8
|
-
font-family: inherit;
|
|
9
|
-
flex-direction: column;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
align-items: center;
|
|
12
|
-
padding: 24px;
|
|
13
|
-
`;
|
|
14
|
-
const TransferredContainer = styled.div `
|
|
15
|
-
text-align: center;
|
|
16
|
-
white-space: normal;
|
|
17
|
-
`;
|
|
18
|
-
const EndedContainer = styled.div `
|
|
19
|
-
text-align: center;
|
|
20
|
-
white-space: normal;
|
|
21
|
-
`;
|
|
22
|
-
const StyledButton = styled.button `
|
|
23
|
-
max-width: 60%;
|
|
24
|
-
padding: 12px 24px;
|
|
25
|
-
background-color: ${COLORS.SOLID_WHITE};
|
|
26
|
-
border: none;
|
|
27
|
-
border-radius: 4px;
|
|
28
|
-
margin-top: 8px;
|
|
29
|
-
cursor: pointer;
|
|
30
|
-
`;
|
|
31
|
-
export const Handoff = props => {
|
|
32
|
-
const { resolveCase } = useContext(WebchatContext);
|
|
33
|
-
const [state, setState] = useState({ showContinue: true });
|
|
34
|
-
const continueClick = () => {
|
|
35
|
-
setState({ showContinue: false });
|
|
36
|
-
resolveCase();
|
|
37
|
-
};
|
|
38
|
-
const bgColor = state.showContinue
|
|
39
|
-
? COLORS.FRINGY_FLOWER_GREEN
|
|
40
|
-
: COLORS.TASMAN_GRAY;
|
|
41
|
-
const fontColor = state.showContinue
|
|
42
|
-
? COLORS.APPLE_GREEN
|
|
43
|
-
: COLORS.CACTUS_GREEN;
|
|
44
|
-
return (_jsxs(Container, Object.assign({ style: {
|
|
45
|
-
color: fontColor,
|
|
46
|
-
backgroundColor: bgColor,
|
|
47
|
-
} }, { children: [state.showContinue ? (_jsx(TransferredContainer, { children: "Conversation transferred to a human agent..." })) : (_jsx(EndedContainer, { children: "Human handoff ended" })), state.showContinue && (_jsx(StyledButton, Object.assign({ onClick: continueClick }, { children: "Continue" })))] })));
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=handoff.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handoff.js","sourceRoot":"src/","sources":["components/handoff.jsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACnD,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAO3B,CAAA;AAED,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGtC,CAAA;AAED,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGhC,CAAA;AAED,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAA;;;sBAGZ,MAAM,CAAC,WAAW;;;;;CAKvC,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,CAAC,EAAE;IAC7B,MAAM,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IAClD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAA;IAE1D,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,QAAQ,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAA;QACjC,WAAW,EAAE,CAAA;IACf,CAAC,CAAA;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,YAAY;QAChC,CAAC,CAAC,MAAM,CAAC,mBAAmB;QAC5B,CAAC,CAAC,MAAM,CAAC,WAAW,CAAA;IACtB,MAAM,SAAS,GAAG,KAAK,CAAC,YAAY;QAClC,CAAC,CAAC,MAAM,CAAC,WAAW;QACpB,CAAC,CAAC,MAAM,CAAC,YAAY,CAAA;IACvB,OAAO,CACL,MAAC,SAAS,kBACR,KAAK,EAAE;YACL,KAAK,EAAE,SAAS;YAChB,eAAe,EAAE,OAAO;SACzB,iBAEA,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CACpB,KAAC,oBAAoB,+DAEE,CACxB,CAAC,CAAC,CAAC,CACF,KAAC,cAAc,sCAAqC,CACrD,EACA,KAAK,CAAC,YAAY,IAAI,CACrB,KAAC,YAAY,kBAAC,OAAO,EAAE,aAAa,8BAAyB,CAC9D,KACS,CACb,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { INPUT, isBrowser } from '@botonic/core';
|
|
3
|
-
import React, { useContext, useState } from 'react';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
import { ROLES, WEBCHAT } from '../constants';
|
|
6
|
-
import { WebchatContext } from '../contexts';
|
|
7
|
-
import { staticAsset } from '../util/environment';
|
|
8
|
-
import { Message } from './message';
|
|
9
|
-
const StyledImage = styled.img `
|
|
10
|
-
border-radius: 8px;
|
|
11
|
-
max-width: 150px;
|
|
12
|
-
max-height: 150px;
|
|
13
|
-
margin: -3px -6px;
|
|
14
|
-
cursor: ${({ hasPreviewer }) => (hasPreviewer ? 'pointer' : 'auto')};
|
|
15
|
-
`;
|
|
16
|
-
const serialize = imageProps => {
|
|
17
|
-
return { image: imageProps.src };
|
|
18
|
-
};
|
|
19
|
-
export const Image = props => {
|
|
20
|
-
var _a;
|
|
21
|
-
props = ((_a = props.input) === null || _a === void 0 ? void 0 : _a.data)
|
|
22
|
-
? Object.assign(Object.assign({}, props), { src: props.input.data }) : Object.assign(Object.assign({}, props), { src: staticAsset(props.src) });
|
|
23
|
-
let content = props.children;
|
|
24
|
-
const [isPreviewerOpened, setIsPreviewerOpened] = useState(false);
|
|
25
|
-
const openPreviewer = () => setIsPreviewerOpened(true);
|
|
26
|
-
const closePreviewer = () => setIsPreviewerOpened(false);
|
|
27
|
-
const { getThemeProperty } = useContext(WebchatContext);
|
|
28
|
-
const ImagePreviewer = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.imagePreviewer, null);
|
|
29
|
-
if (isBrowser()) {
|
|
30
|
-
content = (_jsxs(_Fragment, { children: [_jsx(StyledImage, { src: props.src, onClick: openPreviewer, hasPreviewer: Boolean(ImagePreviewer) }), ImagePreviewer && (_jsx(ImagePreviewer, { src: props.src, isPreviewerOpened: isPreviewerOpened, openPreviewer: openPreviewer, closePreviewer: closePreviewer }))] }));
|
|
31
|
-
}
|
|
32
|
-
return (_jsx(Message, Object.assign({ role: ROLES.IMAGE_MESSAGE, json: serialize(props) }, props, { type: INPUT.IMAGE }, { children: content })));
|
|
33
|
-
};
|
|
34
|
-
Image.serialize = serialize;
|
|
35
|
-
//# sourceMappingURL=image.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"src/","sources":["components/image.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACnD,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;YAKlB,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;CACpE,CAAA;AAED,MAAM,SAAS,GAAG,UAAU,CAAC,EAAE;IAC7B,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,GAAG,EAAE,CAAA;AAClC,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,CAAC,EAAE;;IAC3B,KAAK,GAAG,CAAA,MAAA,KAAK,CAAC,KAAK,0CAAE,IAAI;QACvB,CAAC,iCAAM,KAAK,KAAE,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,IACnC,CAAC,iCAAM,KAAK,KAAE,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,GAAE,CAAA;IAC7C,IAAI,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAA;IAE5B,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IACjE,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;IACtD,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAA;IAExD,MAAM,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IACvD,MAAM,cAAc,GAAG,gBAAgB,CACrC,OAAO,CAAC,iBAAiB,CAAC,cAAc,EACxC,IAAI,CACL,CAAA;IACD,IAAI,SAAS,EAAE,EAAE;QACf,OAAO,GAAG,CACR,8BACE,KAAC,WAAW,IACV,GAAG,EAAE,KAAK,CAAC,GAAG,EACd,OAAO,EAAE,aAAa,EACtB,YAAY,EAAE,OAAO,CAAC,cAAc,CAAC,GACrC,EACD,cAAc,IAAI,CACjB,KAAC,cAAc,IACb,GAAG,EAAE,KAAK,CAAC,GAAG,EACd,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,GAC9B,CACH,IACA,CACJ,CAAA;KACF;IACD,OAAO,CACL,KAAC,OAAO,kBACN,IAAI,EAAE,KAAK,CAAC,aAAa,EACzB,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,IAClB,KAAK,IACT,IAAI,EAAE,KAAK,CAAC,KAAK,gBAEhB,OAAO,IACA,CACX,CAAA;AACH,CAAC,CAAA;AAED,KAAK,CAAC,SAAS,GAAG,SAAS,CAAA"}
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SENDERS } from '../index-types';
|
|
3
|
-
import { CoverComponentProps } from '../webchat/index-types';
|
|
4
|
-
export type MessageType = 'audio' | 'buttonmessage' | 'carousel' | 'custom' | 'document' | 'image' | 'location' | 'text' | 'video';
|
|
5
|
-
export interface MessageProps {
|
|
6
|
-
blob?: boolean;
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
delay?: number;
|
|
9
|
-
enabletimestamps?: boolean;
|
|
10
|
-
sentBy?: SENDERS;
|
|
11
|
-
json?: Record<string, unknown>;
|
|
12
|
-
style?: Record<string, unknown>;
|
|
13
|
-
type?: MessageType;
|
|
14
|
-
typing?: number;
|
|
15
|
-
}
|
|
16
|
-
export interface TextProps extends MessageProps {
|
|
17
|
-
markdown?: boolean;
|
|
18
|
-
}
|
|
19
|
-
export interface Webview {
|
|
20
|
-
name: string;
|
|
21
|
-
}
|
|
22
|
-
export interface ButtonProps {
|
|
23
|
-
params?: any;
|
|
24
|
-
path?: string;
|
|
25
|
-
payload?: string;
|
|
26
|
-
target?: string;
|
|
27
|
-
url?: string;
|
|
28
|
-
webview?: Webview;
|
|
29
|
-
onClick?: () => void;
|
|
30
|
-
autodisable?: boolean;
|
|
31
|
-
disabled?: boolean;
|
|
32
|
-
disabledstyle?: boolean;
|
|
33
|
-
}
|
|
34
|
-
export interface ReplyProps {
|
|
35
|
-
path?: string;
|
|
36
|
-
payload?: string;
|
|
37
|
-
children: string;
|
|
38
|
-
}
|
|
39
|
-
export interface PicProps {
|
|
40
|
-
src: string;
|
|
41
|
-
}
|
|
42
|
-
export type ImageProps = PicProps;
|
|
43
|
-
export interface TitleProps {
|
|
44
|
-
children: React.ReactNode;
|
|
45
|
-
style: string;
|
|
46
|
-
}
|
|
47
|
-
export type SubtitleProps = TitleProps;
|
|
48
|
-
export type CustomProp = {
|
|
49
|
-
custom?: React.ComponentType;
|
|
50
|
-
};
|
|
51
|
-
export type EnableProp = {
|
|
52
|
-
enable?: boolean;
|
|
53
|
-
};
|
|
54
|
-
export type ImageProp = {
|
|
55
|
-
image?: string;
|
|
56
|
-
};
|
|
57
|
-
export type PersistentMenuCloseOption = {
|
|
58
|
-
closeLabel: string;
|
|
59
|
-
};
|
|
60
|
-
export type PersistentMenuOption = {
|
|
61
|
-
label: string;
|
|
62
|
-
} & ButtonProps;
|
|
63
|
-
export type StyleProp = {
|
|
64
|
-
style?: any;
|
|
65
|
-
};
|
|
66
|
-
export type PersistentMenuTheme = (PersistentMenuCloseOption | PersistentMenuOption)[];
|
|
67
|
-
export interface PersistentMenuProps {
|
|
68
|
-
onClick: () => void;
|
|
69
|
-
options: any;
|
|
70
|
-
}
|
|
71
|
-
export type BlockInputOption = {
|
|
72
|
-
preprocess?: (message: string) => string;
|
|
73
|
-
match: RegExp[];
|
|
74
|
-
message: string;
|
|
75
|
-
};
|
|
76
|
-
export interface BlobProps {
|
|
77
|
-
blobTick?: boolean;
|
|
78
|
-
blobTickStyle?: any;
|
|
79
|
-
blobWidth?: string;
|
|
80
|
-
imageStyle?: any;
|
|
81
|
-
}
|
|
82
|
-
export interface ScrollbarProps {
|
|
83
|
-
autoHide?: boolean;
|
|
84
|
-
thumb?: {
|
|
85
|
-
bgcolor?: string;
|
|
86
|
-
border?: string;
|
|
87
|
-
color?: string;
|
|
88
|
-
opacity?: string;
|
|
89
|
-
};
|
|
90
|
-
track?: {
|
|
91
|
-
bgcolor?: string;
|
|
92
|
-
border?: string;
|
|
93
|
-
color?: string;
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
export interface ThemeProps extends StyleProp {
|
|
97
|
-
mobileBreakpoint?: number;
|
|
98
|
-
mobileStyle?: any;
|
|
99
|
-
webview?: StyleProp & {
|
|
100
|
-
header?: StyleProp;
|
|
101
|
-
};
|
|
102
|
-
animations?: EnableProp;
|
|
103
|
-
intro?: StyleProp & ImageProp & CustomProp;
|
|
104
|
-
brand?: {
|
|
105
|
-
color?: string;
|
|
106
|
-
} & ImageProp;
|
|
107
|
-
header?: {
|
|
108
|
-
title?: string;
|
|
109
|
-
subtitle?: string;
|
|
110
|
-
} & ImageProp & StyleProp & CustomProp;
|
|
111
|
-
message?: {
|
|
112
|
-
bot?: BlobProps & ImageProp & StyleProp;
|
|
113
|
-
user?: BlobProps & StyleProp;
|
|
114
|
-
customTypes?: React.ComponentType[];
|
|
115
|
-
} & StyleProp & {
|
|
116
|
-
timestamps?: {
|
|
117
|
-
enable?: boolean;
|
|
118
|
-
format: () => string;
|
|
119
|
-
} & StyleProp;
|
|
120
|
-
};
|
|
121
|
-
button?: {
|
|
122
|
-
autodisable?: boolean;
|
|
123
|
-
disabledstyle?: any;
|
|
124
|
-
hoverBackground?: string;
|
|
125
|
-
hoverTextColor?: string;
|
|
126
|
-
messageType?: 'text' | 'payload';
|
|
127
|
-
} & StyleProp & CustomProp;
|
|
128
|
-
replies?: {
|
|
129
|
-
align?: 'left' | 'center' | 'right';
|
|
130
|
-
wrap?: 'wrap' | 'nowrap';
|
|
131
|
-
};
|
|
132
|
-
carousel?: {
|
|
133
|
-
arrow?: {
|
|
134
|
-
left: CustomProp;
|
|
135
|
-
right: CustomProp;
|
|
136
|
-
};
|
|
137
|
-
enableArrows?: boolean;
|
|
138
|
-
};
|
|
139
|
-
reply?: StyleProp & CustomProp;
|
|
140
|
-
triggerButton?: ImageProp & StyleProp & CustomProp;
|
|
141
|
-
notifications?: EnableProp & {
|
|
142
|
-
banner?: CustomProp & EnableProp & {
|
|
143
|
-
text?: string;
|
|
144
|
-
};
|
|
145
|
-
triggerButton?: EnableProp;
|
|
146
|
-
};
|
|
147
|
-
scrollButton?: EnableProp & CustomProp;
|
|
148
|
-
markdownStyle?: string;
|
|
149
|
-
scrollbar?: ScrollbarProps & EnableProp;
|
|
150
|
-
userInput?: {
|
|
151
|
-
attachments?: EnableProp & CustomProp;
|
|
152
|
-
blockInputs?: BlockInputOption[];
|
|
153
|
-
box?: {
|
|
154
|
-
placeholder: string;
|
|
155
|
-
} & StyleProp;
|
|
156
|
-
emojiPicker?: EnableProp & CustomProp;
|
|
157
|
-
menu?: {
|
|
158
|
-
darkBackground?: boolean;
|
|
159
|
-
} & {
|
|
160
|
-
custom?: React.ComponentType<PersistentMenuProps>;
|
|
161
|
-
};
|
|
162
|
-
menuButton?: CustomProp;
|
|
163
|
-
persistentMenu?: PersistentMenuTheme;
|
|
164
|
-
sendButton?: EnableProp & CustomProp;
|
|
165
|
-
} & EnableProp & StyleProp;
|
|
166
|
-
imagePreviewer?: React.ComponentType<ImagePreviewerProps>;
|
|
167
|
-
}
|
|
168
|
-
interface ImagePreviewerProps {
|
|
169
|
-
src: string;
|
|
170
|
-
isPreviewerOpened: boolean;
|
|
171
|
-
closePreviewer: () => void;
|
|
172
|
-
}
|
|
173
|
-
export interface CoverComponentOptions {
|
|
174
|
-
component: React.ComponentType<CoverComponentProps>;
|
|
175
|
-
props?: any;
|
|
176
|
-
}
|
|
177
|
-
export interface WebchatSettingsProps {
|
|
178
|
-
blockInputs?: BlockInputOption[];
|
|
179
|
-
enableAnimations?: boolean;
|
|
180
|
-
enableAttachments?: boolean;
|
|
181
|
-
enableEmojiPicker?: boolean;
|
|
182
|
-
enableUserInput?: boolean;
|
|
183
|
-
persistentMenu?: PersistentMenuTheme;
|
|
184
|
-
theme?: ThemeProps;
|
|
185
|
-
}
|
|
186
|
-
export type WrappedComponent<Props> = React.FunctionComponent<Props> & {
|
|
187
|
-
customTypeName: string;
|
|
188
|
-
};
|
|
189
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
// TODO: Reuse types to be typed in respective functions
|
|
3
|
-
// export class ErrorBoundary<Props> extends React.Component<Props> {
|
|
4
|
-
// componentDidCatch(error: Error, errorInfo: ErrorInfo): void
|
|
5
|
-
// }
|
|
6
|
-
// export function createErrorBoundary<Props>(_?: {
|
|
7
|
-
// errorComponent: React.ComponentType
|
|
8
|
-
// }): ErrorBoundary<Props>
|
|
9
|
-
// export function customMessage<Props>(_: {
|
|
10
|
-
// name: string
|
|
11
|
-
// component: React.ComponentType<Props>
|
|
12
|
-
// defaultProps?: Record<string, unknown>
|
|
13
|
-
// errorBoundary?: ErrorBoundary<Props>
|
|
14
|
-
// }): WrappedComponent<Props>
|
|
15
|
-
// export function getDisplayName(component: React.ComponentType): string
|
|
16
|
-
//# sourceMappingURL=index-types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-types.js","sourceRoot":"src/","sources":["components/index-types.ts"],"names":[],"mappings":";AA2MA,wDAAwD;AACxD,qEAAqE;AACrE,gEAAgE;AAChE,IAAI;AAEJ,mDAAmD;AACnD,wCAAwC;AACxC,2BAA2B;AAE3B,4CAA4C;AAC5C,iBAAiB;AACjB,0CAA0C;AAC1C,2CAA2C;AAC3C,yCAAyC;AACzC,8BAA8B;AAE9B,yEAAyE"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export { Audio } from './audio';
|
|
2
|
-
export { Button } from './button';
|
|
3
|
-
export { Carousel } from './carousel';
|
|
4
|
-
export { customMessage } from './custom-message';
|
|
5
|
-
export { Document } from './document';
|
|
6
|
-
export { Element } from './element';
|
|
7
|
-
export { Image } from './image';
|
|
8
|
-
export * from './index-types';
|
|
9
|
-
export { Location } from './location';
|
|
10
|
-
export { Message } from './message';
|
|
11
|
-
export { MessageTemplate } from './message-template';
|
|
12
|
-
export * from './multichannel';
|
|
13
|
-
export { Pic } from './pic';
|
|
14
|
-
export { Raw } from './raw';
|
|
15
|
-
export { Reply } from './reply';
|
|
16
|
-
export { ShareButton } from './share-button';
|
|
17
|
-
export { Subtitle } from './subtitle';
|
|
18
|
-
export { Text } from './text';
|
|
19
|
-
export { Title } from './title';
|
|
20
|
-
export { Video } from './video';
|
|
21
|
-
export { WebchatSettings } from './webchat-settings';
|
|
22
|
-
export { WhatsappButtonList, WhatsappButtonListProps, WhatsappButtonListRowProps, WhatsappButtonListSectionProps, } from './whatsapp-button-list';
|
|
23
|
-
export { WhatsappTemplate } from './whatsapp-template';
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export { Audio } from './audio';
|
|
2
|
-
export { Button } from './button';
|
|
3
|
-
export { Carousel } from './carousel';
|
|
4
|
-
export { customMessage } from './custom-message';
|
|
5
|
-
export { Document } from './document';
|
|
6
|
-
export { Element } from './element';
|
|
7
|
-
export { Image } from './image';
|
|
8
|
-
export * from './index-types';
|
|
9
|
-
export { Location } from './location';
|
|
10
|
-
export { Message } from './message';
|
|
11
|
-
export { MessageTemplate } from './message-template';
|
|
12
|
-
export * from './multichannel';
|
|
13
|
-
export { Pic } from './pic';
|
|
14
|
-
export { Raw } from './raw';
|
|
15
|
-
export { Reply } from './reply';
|
|
16
|
-
export { ShareButton } from './share-button';
|
|
17
|
-
export { Subtitle } from './subtitle';
|
|
18
|
-
export { Text } from './text';
|
|
19
|
-
export { Title } from './title';
|
|
20
|
-
export { Video } from './video';
|
|
21
|
-
export { WebchatSettings } from './webchat-settings';
|
|
22
|
-
export { WhatsappButtonList, } from './whatsapp-button-list';
|
|
23
|
-
export { WhatsappTemplate } from './whatsapp-template';
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EACL,kBAAkB,GAInB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { INPUT } from '@botonic/core';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
import { renderComponent } from '../util/react';
|
|
6
|
-
import { Message } from './message';
|
|
7
|
-
const Link = styled.a `
|
|
8
|
-
text-decoration: none;
|
|
9
|
-
font-weight: bold;
|
|
10
|
-
target: blank;
|
|
11
|
-
`;
|
|
12
|
-
const serialize = locationProps => {
|
|
13
|
-
return { location: { lat: locationProps.lat, long: locationProps.long } };
|
|
14
|
-
};
|
|
15
|
-
export const Location = props => {
|
|
16
|
-
const { lat, long } = props;
|
|
17
|
-
const renderBrowser = () => {
|
|
18
|
-
const locationUrl = `https://www.google.com/maps/search/?api=1&query=${lat},${long}`;
|
|
19
|
-
return (_jsx(Message, Object.assign({ json: serialize(props) }, props, { type: INPUT.LOCATION }, { children: _jsx(Link, Object.assign({ href: locationUrl, target: '_blank', rel: 'noopener noreferrer' }, { children: props.text || 'Open Location' })) })));
|
|
20
|
-
};
|
|
21
|
-
const renderNode = () => {
|
|
22
|
-
return (_jsxs("message", Object.assign({ type: INPUT.LOCATION }, { children: [_jsx("lat", { children: lat }), _jsx("long", { children: long })] })));
|
|
23
|
-
};
|
|
24
|
-
return renderComponent({ renderBrowser, renderNode });
|
|
25
|
-
};
|
|
26
|
-
Location.serialize = serialize;
|
|
27
|
-
//# sourceMappingURL=location.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"location.js","sourceRoot":"src/","sources":["components/location.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAA;;;;CAIpB,CAAA;AAED,MAAM,SAAS,GAAG,aAAa,CAAC,EAAE;IAChC,OAAO,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,aAAa,CAAC,IAAI,EAAE,EAAE,CAAA;AAC3E,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAAC,EAAE;IAC9B,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,CAAA;IAE3B,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,MAAM,WAAW,GAAG,mDAAmD,GAAG,IAAI,IAAI,EAAE,CAAA;QACpF,OAAO,CACL,KAAC,OAAO,kBAAC,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,IAAM,KAAK,IAAE,IAAI,EAAE,KAAK,CAAC,QAAQ,gBAC9D,KAAC,IAAI,kBAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,gBAC/D,KAAK,CAAC,IAAI,IAAI,eAAe,IACzB,IACC,CACX,CAAA;IACH,CAAC,CAAA;IAED,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,OAAO,CACL,iCAAS,IAAI,EAAE,KAAK,CAAC,QAAQ,iBAC3B,wBAAM,GAAG,GAAO,EAChB,yBAAO,IAAI,GAAQ,KACX,CACX,CAAA;IACH,CAAC,CAAA;IAED,OAAO,eAAe,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,CAAA;AACvD,CAAC,CAAA;AAED,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export const ESCAPED_LINE_BREAK: "<br>";
|
|
2
|
-
export function renderMarkdown(text: any): any;
|
|
3
|
-
export function renderLinks(text: any): any;
|
|
4
|
-
export function serializeMarkdown(children: any): any;
|
|
5
|
-
export function toMarkdownChildren(children: any): any;
|
|
6
|
-
export function getMarkdownStyle(getThemeFn: any, defaultColor: any): any;
|
|
7
|
-
export function getDefaultMarkdownStyle(color: any): string;
|