@botonic/react 0.31.0-alpha.4 → 0.31.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/audio.d.ts +8 -7
- package/lib/cjs/components/audio.js +7 -4
- package/lib/cjs/components/audio.js.map +1 -1
- package/lib/cjs/components/button.js +3 -4
- package/lib/cjs/components/button.js.map +1 -1
- package/lib/cjs/components/carousel.js +2 -2
- package/lib/cjs/components/carousel.js.map +1 -1
- package/lib/cjs/components/custom-message.d.ts +16 -12
- package/lib/cjs/components/custom-message.js +3 -9
- package/lib/cjs/components/custom-message.js.map +1 -1
- package/lib/cjs/components/document.d.ts +8 -7
- package/lib/cjs/components/document.js +5 -5
- package/lib/cjs/components/document.js.map +1 -1
- package/lib/cjs/components/handoff.js +2 -2
- package/lib/cjs/components/handoff.js.map +1 -1
- package/lib/cjs/components/image.d.ts +8 -7
- package/lib/cjs/components/image.js +5 -5
- package/lib/cjs/components/image.js.map +1 -1
- package/lib/cjs/components/index-types.d.ts +30 -128
- package/lib/cjs/components/index.d.ts +2 -1
- package/lib/cjs/components/index.js +4 -1
- package/lib/cjs/components/index.js.map +1 -1
- package/lib/cjs/components/message/index.js +2 -1
- package/lib/cjs/components/message/index.js.map +1 -1
- package/lib/cjs/components/message/message-feedback.js +2 -2
- package/lib/cjs/components/message/message-feedback.js.map +1 -1
- package/lib/cjs/components/message/message-footer.js +2 -2
- package/lib/cjs/components/message/message-footer.js.map +1 -1
- package/lib/cjs/components/message/message-image.js +2 -2
- package/lib/cjs/components/message/message-image.js.map +1 -1
- package/lib/cjs/components/message/timestamps.js +2 -2
- package/lib/cjs/components/message/timestamps.js.map +1 -1
- package/lib/cjs/components/reply.d.ts +7 -6
- package/lib/cjs/components/reply.js +10 -6
- package/lib/cjs/components/reply.js.map +1 -1
- package/lib/cjs/components/video.d.ts +8 -7
- package/lib/cjs/components/video.js +2 -3
- package/lib/cjs/components/video.js.map +1 -1
- package/lib/cjs/components/webchat-settings.d.ts +15 -2
- package/lib/cjs/components/webchat-settings.js +2 -2
- package/lib/cjs/components/webchat-settings.js.map +1 -1
- package/lib/cjs/contexts.d.ts +3 -4
- package/lib/cjs/contexts.js +2 -79
- package/lib/cjs/contexts.js.map +1 -1
- package/lib/cjs/index-types.d.ts +89 -56
- package/lib/cjs/index-types.js.map +1 -1
- package/lib/cjs/index.d.ts +2 -2
- package/lib/cjs/index.js +1 -2
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/msg-to-botonic.d.ts +1 -1
- package/lib/cjs/msg-to-botonic.js +5 -8
- package/lib/cjs/msg-to-botonic.js.map +1 -1
- package/lib/cjs/util/webchat.d.ts +17 -6
- package/lib/cjs/util/webchat.js +9 -7
- package/lib/cjs/util/webchat.js.map +1 -1
- package/lib/cjs/webchat/chat-area/index.js +3 -3
- package/lib/cjs/webchat/chat-area/index.js.map +1 -1
- package/lib/cjs/webchat/components/conditional-animation.js +2 -2
- package/lib/cjs/webchat/components/conditional-animation.js.map +1 -1
- package/lib/cjs/webchat/components/opened-persistent-menu.js +2 -2
- package/lib/cjs/webchat/components/opened-persistent-menu.js.map +1 -1
- package/lib/cjs/webchat/{actions.d.ts → context/actions.d.ts} +2 -0
- package/lib/cjs/webchat/{actions.js → context/actions.js} +3 -0
- package/lib/cjs/webchat/context/actions.js.map +1 -0
- package/lib/cjs/webchat/context/index.d.ts +5 -0
- package/lib/cjs/webchat/context/index.js +83 -0
- package/lib/cjs/webchat/context/index.js.map +1 -0
- package/lib/cjs/webchat/{messages-reducer.d.ts → context/messages-reducer.d.ts} +1 -1
- package/lib/cjs/webchat/{messages-reducer.js → context/messages-reducer.js} +3 -1
- package/lib/cjs/webchat/context/messages-reducer.js.map +1 -0
- package/lib/cjs/webchat/context/types.d.ts +74 -0
- package/lib/cjs/webchat/context/types.js +3 -0
- package/lib/cjs/webchat/context/types.js.map +1 -0
- package/lib/cjs/webchat/{hooks → context}/use-webchat.d.ts +20 -20
- package/lib/cjs/webchat/{hooks → context}/use-webchat.js +11 -5
- package/lib/cjs/webchat/context/use-webchat.js.map +1 -0
- package/lib/cjs/webchat/{webchat-reducer.d.ts → context/webchat-reducer.d.ts} +1 -1
- package/lib/cjs/webchat/{webchat-reducer.js → context/webchat-reducer.js} +2 -0
- package/lib/cjs/webchat/context/webchat-reducer.js.map +1 -0
- package/lib/cjs/webchat/cover-component/index.js +2 -2
- package/lib/cjs/webchat/cover-component/index.js.map +1 -1
- package/lib/cjs/webchat/header/default-header.d.ts +1 -0
- package/lib/cjs/webchat/header/default-header.js +25 -0
- package/lib/cjs/webchat/header/default-header.js.map +1 -0
- package/lib/cjs/webchat/header/index.d.ts +2 -0
- package/lib/cjs/webchat/header/index.js +23 -0
- package/lib/cjs/webchat/header/index.js.map +1 -0
- package/lib/cjs/webchat/header/styles.d.ts +7 -0
- package/lib/cjs/webchat/header/styles.js +59 -0
- package/lib/cjs/webchat/header/styles.js.map +1 -0
- package/lib/cjs/webchat/hooks/index.d.ts +0 -1
- package/lib/cjs/webchat/hooks/index.js +1 -4
- package/lib/cjs/webchat/hooks/index.js.map +1 -1
- package/lib/cjs/webchat/hooks/use-previous.d.ts +1 -1
- package/lib/cjs/webchat/hooks/use-previous.js.map +1 -1
- package/lib/cjs/webchat/hooks/use-scrollbar-controller.js +3 -3
- package/lib/cjs/webchat/hooks/use-scrollbar-controller.js.map +1 -1
- package/lib/cjs/webchat/hooks/use-typing.d.ts +1 -1
- package/lib/cjs/webchat/hooks/use-webchat-dimensions.js +2 -2
- package/lib/cjs/webchat/hooks/use-webchat-dimensions.js.map +1 -1
- package/lib/cjs/webchat/hooks/use-webchat-resizer.js +2 -2
- package/lib/cjs/webchat/hooks/use-webchat-resizer.js.map +1 -1
- package/lib/cjs/webchat/index-types.d.ts +3 -47
- package/lib/cjs/webchat/index.d.ts +1 -0
- package/lib/cjs/webchat/index.js +3 -1
- package/lib/cjs/webchat/index.js.map +1 -1
- package/lib/cjs/webchat/input-panel/attachment.d.ts +1 -1
- package/lib/cjs/webchat/input-panel/attachment.js +2 -2
- package/lib/cjs/webchat/input-panel/attachment.js.map +1 -1
- package/lib/cjs/webchat/input-panel/emoji-picker.d.ts +1 -1
- package/lib/cjs/webchat/input-panel/emoji-picker.js +2 -2
- package/lib/cjs/webchat/input-panel/emoji-picker.js.map +1 -1
- package/lib/cjs/webchat/input-panel/index.d.ts +3 -3
- package/lib/cjs/webchat/input-panel/index.js +8 -3
- package/lib/cjs/webchat/input-panel/index.js.map +1 -1
- package/lib/cjs/webchat/input-panel/persistent-menu.js +2 -2
- package/lib/cjs/webchat/input-panel/persistent-menu.js.map +1 -1
- package/lib/cjs/webchat/input-panel/send-button.js +2 -2
- package/lib/cjs/webchat/input-panel/send-button.js.map +1 -1
- package/lib/cjs/webchat/input-panel/textarea.d.ts +3 -3
- package/lib/cjs/webchat/input-panel/textarea.js +4 -2
- package/lib/cjs/webchat/input-panel/textarea.js.map +1 -1
- package/lib/cjs/webchat/message-list/index.js +5 -7
- package/lib/cjs/webchat/message-list/index.js.map +1 -1
- package/lib/cjs/webchat/message-list/intro-message.js +2 -2
- package/lib/cjs/webchat/message-list/intro-message.js.map +1 -1
- package/lib/cjs/webchat/message-list/styles.js +1 -0
- package/lib/cjs/webchat/message-list/styles.js.map +1 -1
- package/lib/cjs/webchat/message-list/unread-messages-banner.js +2 -2
- package/lib/cjs/webchat/message-list/unread-messages-banner.js.map +1 -1
- package/lib/cjs/webchat/message-list/use-notifications.js +2 -2
- package/lib/cjs/webchat/message-list/use-notifications.js.map +1 -1
- package/lib/cjs/webchat/replies/index.d.ts +1 -0
- package/lib/cjs/webchat/replies/index.js +32 -0
- package/lib/cjs/webchat/replies/index.js.map +1 -0
- package/lib/cjs/webchat/replies/styles.d.ts +8 -0
- package/lib/cjs/webchat/replies/styles.js +25 -0
- package/lib/cjs/webchat/replies/styles.js.map +1 -0
- package/lib/cjs/webchat/session-view.js +2 -2
- package/lib/cjs/webchat/session-view.js.map +1 -1
- package/lib/cjs/webchat/{webchat-typed/styles.d.ts → styles.d.ts} +6 -4
- package/lib/cjs/webchat/{webchat-typed/styles.js → styles.js} +1 -1
- package/lib/cjs/webchat/styles.js.map +1 -0
- package/lib/cjs/webchat/theme/types.d.ts +167 -0
- package/lib/cjs/webchat/theme/types.js +3 -0
- package/lib/cjs/webchat/theme/types.js.map +1 -0
- package/lib/cjs/webchat/trigger-button/index.js +2 -2
- package/lib/cjs/webchat/trigger-button/index.js.map +1 -1
- package/lib/cjs/webchat/webchat-dev.js +2 -2
- package/lib/cjs/webchat/webchat-dev.js.map +1 -1
- package/lib/cjs/webchat/webchat.d.ts +4 -2
- package/lib/cjs/webchat/webchat.js +85 -108
- package/lib/cjs/webchat/webchat.js.map +1 -1
- package/lib/cjs/webchat/webview.js +3 -2
- package/lib/cjs/webchat/webview.js.map +1 -1
- package/lib/cjs/webchat-app.d.ts +14 -80
- package/lib/cjs/webchat-app.js +28 -14
- package/lib/cjs/webchat-app.js.map +1 -1
- package/lib/esm/components/audio.d.ts +8 -7
- package/lib/esm/components/audio.js +7 -4
- package/lib/esm/components/audio.js.map +1 -1
- package/lib/esm/components/button.js +2 -3
- package/lib/esm/components/button.js.map +1 -1
- package/lib/esm/components/carousel.js +1 -1
- package/lib/esm/components/carousel.js.map +1 -1
- package/lib/esm/components/custom-message.d.ts +16 -12
- package/lib/esm/components/custom-message.js +3 -9
- package/lib/esm/components/custom-message.js.map +1 -1
- package/lib/esm/components/document.d.ts +8 -7
- package/lib/esm/components/document.js +4 -4
- package/lib/esm/components/document.js.map +1 -1
- package/lib/esm/components/handoff.js +1 -1
- package/lib/esm/components/handoff.js.map +1 -1
- package/lib/esm/components/image.d.ts +8 -7
- package/lib/esm/components/image.js +4 -4
- package/lib/esm/components/image.js.map +1 -1
- package/lib/esm/components/index-types.d.ts +30 -128
- package/lib/esm/components/index.d.ts +2 -1
- package/lib/esm/components/index.js +2 -1
- package/lib/esm/components/index.js.map +1 -1
- package/lib/esm/components/message/index.js +2 -1
- package/lib/esm/components/message/index.js.map +1 -1
- package/lib/esm/components/message/message-feedback.js +1 -1
- package/lib/esm/components/message/message-feedback.js.map +1 -1
- package/lib/esm/components/message/message-footer.js +1 -1
- package/lib/esm/components/message/message-footer.js.map +1 -1
- package/lib/esm/components/message/message-image.js +1 -1
- package/lib/esm/components/message/message-image.js.map +1 -1
- package/lib/esm/components/message/timestamps.js +1 -1
- package/lib/esm/components/message/timestamps.js.map +1 -1
- package/lib/esm/components/reply.d.ts +7 -6
- package/lib/esm/components/reply.js +9 -5
- package/lib/esm/components/reply.js.map +1 -1
- package/lib/esm/components/video.d.ts +8 -7
- package/lib/esm/components/video.js +2 -3
- package/lib/esm/components/video.js.map +1 -1
- package/lib/esm/components/webchat-settings.d.ts +15 -2
- package/lib/esm/components/webchat-settings.js +1 -1
- package/lib/esm/components/webchat-settings.js.map +1 -1
- package/lib/esm/contexts.d.ts +3 -4
- package/lib/esm/contexts.js +1 -78
- package/lib/esm/contexts.js.map +1 -1
- package/lib/esm/index-types.d.ts +89 -56
- package/lib/esm/index-types.js.map +1 -1
- package/lib/esm/index.d.ts +2 -2
- package/lib/esm/index.js +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/msg-to-botonic.d.ts +1 -1
- package/lib/esm/msg-to-botonic.js +5 -8
- package/lib/esm/msg-to-botonic.js.map +1 -1
- package/lib/esm/util/webchat.d.ts +17 -6
- package/lib/esm/util/webchat.js +9 -7
- package/lib/esm/util/webchat.js.map +1 -1
- package/lib/esm/webchat/chat-area/index.js +2 -2
- package/lib/esm/webchat/chat-area/index.js.map +1 -1
- package/lib/esm/webchat/components/conditional-animation.js +1 -1
- package/lib/esm/webchat/components/conditional-animation.js.map +1 -1
- package/lib/esm/webchat/components/opened-persistent-menu.js +1 -1
- package/lib/esm/webchat/components/opened-persistent-menu.js.map +1 -1
- package/lib/esm/webchat/{actions.d.ts → context/actions.d.ts} +2 -0
- package/lib/esm/webchat/{actions.js → context/actions.js} +3 -0
- package/lib/esm/webchat/context/actions.js.map +1 -0
- package/lib/esm/webchat/context/index.d.ts +5 -0
- package/lib/esm/webchat/context/index.js +78 -0
- package/lib/esm/webchat/context/index.js.map +1 -0
- package/lib/esm/webchat/{messages-reducer.d.ts → context/messages-reducer.d.ts} +1 -1
- package/lib/esm/webchat/{messages-reducer.js → context/messages-reducer.js} +3 -1
- package/lib/esm/webchat/context/messages-reducer.js.map +1 -0
- package/lib/esm/webchat/context/types.d.ts +74 -0
- package/lib/esm/webchat/context/types.js +2 -0
- package/lib/esm/webchat/context/types.js.map +1 -0
- package/lib/esm/webchat/{hooks → context}/use-webchat.d.ts +20 -20
- package/lib/esm/webchat/{hooks → context}/use-webchat.js +11 -5
- package/lib/esm/webchat/context/use-webchat.js.map +1 -0
- package/lib/esm/webchat/{webchat-reducer.d.ts → context/webchat-reducer.d.ts} +1 -1
- package/lib/esm/webchat/{webchat-reducer.js → context/webchat-reducer.js} +2 -0
- package/lib/esm/webchat/context/webchat-reducer.js.map +1 -0
- package/lib/esm/webchat/cover-component/index.js +1 -1
- package/lib/esm/webchat/cover-component/index.js.map +1 -1
- package/lib/esm/webchat/header/default-header.d.ts +1 -0
- package/lib/esm/webchat/header/default-header.js +21 -0
- package/lib/esm/webchat/header/default-header.js.map +1 -0
- package/lib/esm/webchat/header/index.d.ts +2 -0
- package/lib/esm/webchat/header/index.js +20 -0
- package/lib/esm/webchat/header/index.js.map +1 -0
- package/lib/esm/webchat/header/styles.d.ts +7 -0
- package/lib/esm/webchat/header/styles.js +55 -0
- package/lib/esm/webchat/header/styles.js.map +1 -0
- package/lib/esm/webchat/hooks/index.d.ts +0 -1
- package/lib/esm/webchat/hooks/index.js +0 -1
- package/lib/esm/webchat/hooks/index.js.map +1 -1
- package/lib/esm/webchat/hooks/use-previous.d.ts +1 -1
- package/lib/esm/webchat/hooks/use-previous.js.map +1 -1
- package/lib/esm/webchat/hooks/use-scrollbar-controller.js +2 -2
- package/lib/esm/webchat/hooks/use-scrollbar-controller.js.map +1 -1
- package/lib/esm/webchat/hooks/use-typing.d.ts +1 -1
- package/lib/esm/webchat/hooks/use-webchat-dimensions.js +1 -1
- package/lib/esm/webchat/hooks/use-webchat-dimensions.js.map +1 -1
- package/lib/esm/webchat/hooks/use-webchat-resizer.js +1 -1
- package/lib/esm/webchat/hooks/use-webchat-resizer.js.map +1 -1
- package/lib/esm/webchat/index-types.d.ts +3 -47
- package/lib/esm/webchat/index.d.ts +1 -0
- package/lib/esm/webchat/index.js +1 -0
- package/lib/esm/webchat/index.js.map +1 -1
- package/lib/esm/webchat/input-panel/attachment.d.ts +1 -1
- package/lib/esm/webchat/input-panel/attachment.js +1 -1
- package/lib/esm/webchat/input-panel/attachment.js.map +1 -1
- package/lib/esm/webchat/input-panel/emoji-picker.d.ts +1 -1
- package/lib/esm/webchat/input-panel/emoji-picker.js +1 -1
- package/lib/esm/webchat/input-panel/emoji-picker.js.map +1 -1
- package/lib/esm/webchat/input-panel/index.d.ts +3 -3
- package/lib/esm/webchat/input-panel/index.js +7 -2
- package/lib/esm/webchat/input-panel/index.js.map +1 -1
- package/lib/esm/webchat/input-panel/persistent-menu.js +1 -1
- package/lib/esm/webchat/input-panel/persistent-menu.js.map +1 -1
- package/lib/esm/webchat/input-panel/send-button.js +1 -1
- package/lib/esm/webchat/input-panel/send-button.js.map +1 -1
- package/lib/esm/webchat/input-panel/textarea.d.ts +3 -3
- package/lib/esm/webchat/input-panel/textarea.js +3 -1
- package/lib/esm/webchat/input-panel/textarea.js.map +1 -1
- package/lib/esm/webchat/message-list/index.js +4 -6
- package/lib/esm/webchat/message-list/index.js.map +1 -1
- package/lib/esm/webchat/message-list/intro-message.js +1 -1
- package/lib/esm/webchat/message-list/intro-message.js.map +1 -1
- package/lib/esm/webchat/message-list/styles.js +1 -0
- package/lib/esm/webchat/message-list/styles.js.map +1 -1
- package/lib/esm/webchat/message-list/unread-messages-banner.js +1 -1
- package/lib/esm/webchat/message-list/unread-messages-banner.js.map +1 -1
- package/lib/esm/webchat/message-list/use-notifications.js +1 -1
- package/lib/esm/webchat/message-list/use-notifications.js.map +1 -1
- package/lib/esm/webchat/replies/index.d.ts +1 -0
- package/lib/esm/webchat/replies/index.js +28 -0
- package/lib/esm/webchat/replies/index.js.map +1 -0
- package/lib/esm/webchat/replies/styles.d.ts +8 -0
- package/lib/esm/webchat/replies/styles.js +21 -0
- package/lib/esm/webchat/replies/styles.js.map +1 -0
- package/lib/esm/webchat/session-view.js +1 -1
- package/lib/esm/webchat/session-view.js.map +1 -1
- package/lib/esm/webchat/{webchat-typed/styles.d.ts → styles.d.ts} +6 -4
- package/lib/esm/webchat/{webchat-typed/styles.js → styles.js} +1 -1
- package/lib/esm/webchat/styles.js.map +1 -0
- package/lib/esm/webchat/theme/types.d.ts +167 -0
- package/lib/esm/webchat/theme/types.js +2 -0
- package/lib/esm/webchat/theme/types.js.map +1 -0
- package/lib/esm/webchat/trigger-button/index.js +1 -1
- package/lib/esm/webchat/trigger-button/index.js.map +1 -1
- package/lib/esm/webchat/webchat-dev.js +1 -1
- package/lib/esm/webchat/webchat-dev.js.map +1 -1
- package/lib/esm/webchat/webchat.d.ts +4 -2
- package/lib/esm/webchat/webchat.js +81 -104
- package/lib/esm/webchat/webchat.js.map +1 -1
- package/lib/esm/webchat/webview.js +2 -1
- package/lib/esm/webchat/webview.js.map +1 -1
- package/lib/esm/webchat-app.d.ts +14 -80
- package/lib/esm/webchat-app.js +28 -14
- package/lib/esm/webchat-app.js.map +1 -1
- package/package.json +2 -1
- package/src/components/{audio.jsx → audio.tsx} +10 -4
- package/src/components/button.tsx +1 -3
- package/src/components/carousel.jsx +1 -1
- package/src/components/{custom-message.jsx → custom-message.tsx} +19 -7
- package/src/components/{document.jsx → document.tsx} +5 -3
- package/src/components/handoff.jsx +1 -1
- package/src/components/{image.jsx → image.tsx} +10 -4
- package/src/components/index-types.ts +25 -117
- package/src/components/index.ts +6 -1
- package/src/components/message/index.jsx +2 -1
- package/src/components/message/message-feedback.tsx +1 -1
- package/src/components/message/message-footer.tsx +1 -1
- package/src/components/message/message-image.tsx +1 -1
- package/src/components/message/timestamps.tsx +1 -1
- package/src/components/{reply.jsx → reply.tsx} +10 -4
- package/src/components/{video.jsx → video.tsx} +3 -2
- package/src/components/webchat-settings.tsx +14 -2
- package/src/contexts.tsx +5 -83
- package/src/index-types.ts +99 -64
- package/src/index.ts +2 -6
- package/src/msg-to-botonic.jsx +5 -9
- package/src/util/{webchat.js → webchat.ts} +15 -9
- package/src/webchat/chat-area/index.tsx +2 -4
- package/src/webchat/components/conditional-animation.jsx +1 -1
- package/src/webchat/components/opened-persistent-menu.jsx +1 -1
- package/src/webchat/{actions.ts → context/actions.ts} +3 -0
- package/src/webchat/context/index.tsx +81 -0
- package/src/webchat/{messages-reducer.ts → context/messages-reducer.ts} +4 -2
- package/src/webchat/context/types.ts +84 -0
- package/src/webchat/{hooks → context}/use-webchat.ts +62 -13
- package/src/webchat/{webchat-reducer.ts → context/webchat-reducer.ts} +3 -1
- package/src/webchat/cover-component/index.tsx +1 -1
- package/src/webchat/global.d.ts +3 -0
- package/src/webchat/header/default-header.tsx +75 -0
- package/src/webchat/header/index.tsx +37 -0
- package/src/webchat/header/styles.ts +62 -0
- package/src/webchat/hooks/index.ts +0 -1
- package/src/webchat/hooks/use-previous.ts +1 -1
- package/src/webchat/hooks/use-scrollbar-controller.ts +2 -2
- package/src/webchat/hooks/use-typing.ts +1 -1
- package/src/webchat/hooks/use-webchat-dimensions.ts +1 -1
- package/src/webchat/hooks/use-webchat-resizer.ts +1 -1
- package/src/webchat/index-types.ts +3 -53
- package/src/webchat/index.ts +1 -0
- package/src/webchat/input-panel/attachment.tsx +2 -2
- package/src/webchat/input-panel/emoji-picker.tsx +2 -2
- package/src/webchat/input-panel/index.tsx +9 -5
- package/src/webchat/input-panel/persistent-menu.tsx +1 -1
- package/src/webchat/input-panel/send-button.tsx +1 -1
- package/src/webchat/input-panel/textarea.tsx +6 -4
- package/src/webchat/message-list/index.tsx +4 -6
- package/src/webchat/message-list/intro-message.tsx +1 -1
- package/src/webchat/message-list/styles.ts +1 -0
- package/src/webchat/message-list/unread-messages-banner.tsx +1 -1
- package/src/webchat/message-list/use-notifications.ts +1 -1
- package/src/webchat/replies/index.tsx +47 -0
- package/src/webchat/replies/styles.ts +28 -0
- package/src/webchat/session-view.jsx +1 -1
- package/src/webchat/{webchat-typed/styles.ts → styles.ts} +7 -2
- package/src/webchat/theme/types.ts +119 -0
- package/src/webchat/trigger-button/index.tsx +1 -1
- package/src/webchat/webchat-dev.jsx +1 -1
- package/src/webchat/{webchat.jsx → webchat.tsx} +114 -124
- package/src/webchat/webview.jsx +2 -1
- package/src/webchat-app.tsx +55 -95
- package/lib/cjs/webchat/actions.js.map +0 -1
- package/lib/cjs/webchat/header.d.ts +0 -3
- package/lib/cjs/webchat/header.js +0 -86
- package/lib/cjs/webchat/header.js.map +0 -1
- package/lib/cjs/webchat/hooks/use-webchat.js.map +0 -1
- package/lib/cjs/webchat/messages-reducer.js.map +0 -1
- package/lib/cjs/webchat/replies.d.ts +0 -1
- package/lib/cjs/webchat/replies.js +0 -47
- package/lib/cjs/webchat/replies.js.map +0 -1
- package/lib/cjs/webchat/webchat-reducer.js.map +0 -1
- package/lib/cjs/webchat/webchat-typed/styles.js.map +0 -1
- package/lib/cjs/webchat/webchat-typed/webchat-typed.d.ts +0 -0
- package/lib/cjs/webchat/webchat-typed/webchat-typed.js +0 -663
- package/lib/cjs/webchat/webchat-typed/webchat-typed.js.map +0 -1
- package/lib/esm/webchat/actions.js.map +0 -1
- package/lib/esm/webchat/header.d.ts +0 -3
- package/lib/esm/webchat/header.js +0 -81
- package/lib/esm/webchat/header.js.map +0 -1
- package/lib/esm/webchat/hooks/use-webchat.js.map +0 -1
- 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 -42
- package/lib/esm/webchat/replies.js.map +0 -1
- package/lib/esm/webchat/webchat-reducer.js.map +0 -1
- package/lib/esm/webchat/webchat-typed/styles.js.map +0 -1
- package/lib/esm/webchat/webchat-typed/webchat-typed.d.ts +0 -0
- package/lib/esm/webchat/webchat-typed/webchat-typed.js +0 -663
- package/lib/esm/webchat/webchat-typed/webchat-typed.js.map +0 -1
- package/src/webchat/header.jsx +0 -149
- package/src/webchat/replies.jsx +0 -64
- package/src/webchat/webchat-typed/webchat-typed.tsx +0 -728
|
@@ -3,11 +3,16 @@ import React, { useContext, useState } from 'react'
|
|
|
3
3
|
import styled from 'styled-components'
|
|
4
4
|
|
|
5
5
|
import { ROLES, WEBCHAT } from '../constants'
|
|
6
|
-
import { WebchatContext } from '../contexts'
|
|
7
6
|
import { staticAsset } from '../util/environment'
|
|
7
|
+
import { WebchatContext } from '../webchat/context'
|
|
8
|
+
import { ImageProps } from './index-types'
|
|
8
9
|
import { Message } from './message'
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
interface StyledImageProps {
|
|
12
|
+
hasPreviewer: boolean
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const StyledImage = styled.img<StyledImageProps>`
|
|
11
16
|
border-radius: 8px;
|
|
12
17
|
max-width: 150px;
|
|
13
18
|
max-height: 150px;
|
|
@@ -15,14 +20,15 @@ const StyledImage = styled.img`
|
|
|
15
20
|
cursor: ${({ hasPreviewer }) => (hasPreviewer ? 'pointer' : 'auto')};
|
|
16
21
|
`
|
|
17
22
|
|
|
18
|
-
const serialize = imageProps => {
|
|
23
|
+
const serialize = (imageProps: { src: string }) => {
|
|
19
24
|
return { image: imageProps.src }
|
|
20
25
|
}
|
|
21
26
|
|
|
22
|
-
export const Image = props => {
|
|
27
|
+
export const Image = (props: ImageProps) => {
|
|
23
28
|
props = props.input?.data
|
|
24
29
|
? { ...props, src: props.input.data }
|
|
25
30
|
: { ...props, src: staticAsset(props.src) }
|
|
31
|
+
|
|
26
32
|
let content = props.children
|
|
27
33
|
|
|
28
34
|
const [isPreviewerOpened, setIsPreviewerOpened] = useState(false)
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
3
|
import { SENDERS } from '../index-types'
|
|
4
|
-
import { CoverComponentProps } from '../webchat/index-types'
|
|
5
4
|
|
|
6
5
|
export type MessageType =
|
|
7
6
|
| 'audio'
|
|
@@ -16,7 +15,7 @@ export type MessageType =
|
|
|
16
15
|
|
|
17
16
|
export interface MessageProps {
|
|
18
17
|
blob?: boolean
|
|
19
|
-
children
|
|
18
|
+
children?: React.ReactNode
|
|
20
19
|
delay?: number
|
|
21
20
|
enabletimestamps?: boolean
|
|
22
21
|
sentBy?: SENDERS
|
|
@@ -64,7 +63,26 @@ export interface PicProps {
|
|
|
64
63
|
src: string
|
|
65
64
|
}
|
|
66
65
|
|
|
67
|
-
export
|
|
66
|
+
export interface ImageProps extends MessageProps {
|
|
67
|
+
src: string
|
|
68
|
+
input?: { data: string }
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface VideoProps extends MessageProps {
|
|
72
|
+
src: string
|
|
73
|
+
input?: { data: string }
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface AudioProps extends MessageProps {
|
|
77
|
+
src: string
|
|
78
|
+
input?: { data: string }
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface DocumentProps extends MessageProps {
|
|
82
|
+
src: string
|
|
83
|
+
input?: { data: string }
|
|
84
|
+
from?: any
|
|
85
|
+
}
|
|
68
86
|
|
|
69
87
|
export interface TitleProps {
|
|
70
88
|
children: React.ReactNode
|
|
@@ -73,21 +91,10 @@ export interface TitleProps {
|
|
|
73
91
|
|
|
74
92
|
export type SubtitleProps = TitleProps
|
|
75
93
|
|
|
76
|
-
export
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
export type PersistentMenuOption = { label: string } & ButtonProps
|
|
81
|
-
export type StyleProp = { style?: any }
|
|
82
|
-
|
|
83
|
-
export type PersistentMenuTheme = (
|
|
84
|
-
| PersistentMenuCloseOption
|
|
85
|
-
| PersistentMenuOption
|
|
86
|
-
)[]
|
|
87
|
-
|
|
88
|
-
export interface PersistentMenuProps {
|
|
89
|
-
onClick: () => void
|
|
90
|
-
options: any
|
|
94
|
+
export interface CustomMessageType {
|
|
95
|
+
(props: any): JSX.Element
|
|
96
|
+
customTypeName: string
|
|
97
|
+
deserialize(msg: any): JSX.Element
|
|
91
98
|
}
|
|
92
99
|
|
|
93
100
|
export type BlockInputOption = {
|
|
@@ -96,105 +103,6 @@ export type BlockInputOption = {
|
|
|
96
103
|
message: string
|
|
97
104
|
}
|
|
98
105
|
|
|
99
|
-
export interface BlobProps {
|
|
100
|
-
blobTick?: boolean
|
|
101
|
-
blobTickStyle?: any
|
|
102
|
-
blobWidth?: string
|
|
103
|
-
imageStyle?: any
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export interface ThemeProps extends StyleProp {
|
|
107
|
-
coverComponent?: CoverComponentOptions
|
|
108
|
-
mobileBreakpoint?: number
|
|
109
|
-
mobileStyle?: any
|
|
110
|
-
webview?: StyleProp & { header?: StyleProp }
|
|
111
|
-
animations?: EnableProp
|
|
112
|
-
intro?: StyleProp & ImageProp & CustomProp
|
|
113
|
-
brand?: { color?: string } & ImageProp
|
|
114
|
-
header?: { title?: string; subtitle?: string } & ImageProp &
|
|
115
|
-
StyleProp &
|
|
116
|
-
CustomProp
|
|
117
|
-
// TODO: Review if this is needed hear, or only in message.customTypes? use the same type in both places
|
|
118
|
-
customMessageTypes?: React.ComponentType[]
|
|
119
|
-
message?: {
|
|
120
|
-
bot?: BlobProps & ImageProp & StyleProp
|
|
121
|
-
agent?: ImageProp
|
|
122
|
-
user?: BlobProps & StyleProp
|
|
123
|
-
// TODO: Review type used in cutomTypes should be a component exported by default with customMessage function
|
|
124
|
-
customTypes?: React.ComponentType[]
|
|
125
|
-
} & StyleProp & {
|
|
126
|
-
timestamps?: {
|
|
127
|
-
withImage?: boolean
|
|
128
|
-
format: () => string
|
|
129
|
-
} & StyleProp &
|
|
130
|
-
EnableProp
|
|
131
|
-
}
|
|
132
|
-
button?: {
|
|
133
|
-
autodisable?: boolean
|
|
134
|
-
disabledstyle?: any
|
|
135
|
-
hoverBackground?: string
|
|
136
|
-
hoverTextColor?: string
|
|
137
|
-
messageType?: 'text' | 'payload'
|
|
138
|
-
urlIcon?: ImageProp & EnableProp
|
|
139
|
-
} & StyleProp &
|
|
140
|
-
CustomProp
|
|
141
|
-
replies?: {
|
|
142
|
-
align?: 'left' | 'center' | 'right'
|
|
143
|
-
wrap?: 'wrap' | 'nowrap'
|
|
144
|
-
}
|
|
145
|
-
carousel?: {
|
|
146
|
-
arrow?: {
|
|
147
|
-
left: CustomProp
|
|
148
|
-
right: CustomProp
|
|
149
|
-
}
|
|
150
|
-
enableArrows?: boolean
|
|
151
|
-
}
|
|
152
|
-
reply?: StyleProp & CustomProp
|
|
153
|
-
triggerButton?: ImageProp & StyleProp & CustomProp
|
|
154
|
-
notifications?: EnableProp & {
|
|
155
|
-
banner?: CustomProp & EnableProp & { text?: string }
|
|
156
|
-
triggerButton?: EnableProp
|
|
157
|
-
}
|
|
158
|
-
scrollButton?: EnableProp & CustomProp
|
|
159
|
-
markdownStyle?: string // string template with css styles
|
|
160
|
-
userInput?: {
|
|
161
|
-
attachments?: EnableProp & CustomProp
|
|
162
|
-
blockInputs?: BlockInputOption[]
|
|
163
|
-
box?: { placeholder: string } & StyleProp
|
|
164
|
-
emojiPicker?: EnableProp & CustomProp
|
|
165
|
-
menu?: { darkBackground?: boolean } & {
|
|
166
|
-
custom?: React.ComponentType<PersistentMenuProps>
|
|
167
|
-
}
|
|
168
|
-
menuButton?: CustomProp
|
|
169
|
-
persistentMenu?: PersistentMenuTheme
|
|
170
|
-
sendButton?: EnableProp & CustomProp
|
|
171
|
-
} & EnableProp &
|
|
172
|
-
StyleProp
|
|
173
|
-
imagePreviewer?: React.ComponentType<ImagePreviewerProps>
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
interface ImagePreviewerProps {
|
|
177
|
-
src: string
|
|
178
|
-
isPreviewerOpened: boolean
|
|
179
|
-
closePreviewer: () => void
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export interface CoverComponentOptions {
|
|
183
|
-
component: React.ComponentType<CoverComponentProps>
|
|
184
|
-
props?: any
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export interface WebchatSettingsProps {
|
|
188
|
-
blockInputs?: BlockInputOption[]
|
|
189
|
-
enableAnimations?: boolean
|
|
190
|
-
enableAttachments?: boolean
|
|
191
|
-
enableEmojiPicker?: boolean
|
|
192
|
-
enableUserInput?: boolean
|
|
193
|
-
persistentMenu?: PersistentMenuTheme
|
|
194
|
-
theme?: ThemeProps
|
|
195
|
-
user?: { extra_data?: any }
|
|
196
|
-
}
|
|
197
|
-
|
|
198
106
|
export type WrappedComponent<Props> = React.FunctionComponent<Props> & {
|
|
199
107
|
customTypeName: string
|
|
200
108
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { Carousel } from './carousel'
|
|
|
4
4
|
export { customMessage } from './custom-message'
|
|
5
5
|
export { Document } from './document'
|
|
6
6
|
export { Element } from './element'
|
|
7
|
+
export { Handoff } from './handoff'
|
|
7
8
|
export { Image } from './image'
|
|
8
9
|
export * from './index-types'
|
|
9
10
|
export { Location } from './location'
|
|
@@ -18,7 +19,11 @@ export { Subtitle } from './subtitle'
|
|
|
18
19
|
export { Text } from './text'
|
|
19
20
|
export { Title } from './title'
|
|
20
21
|
export { Video } from './video'
|
|
21
|
-
export {
|
|
22
|
+
export {
|
|
23
|
+
normalizeWebchatSettings,
|
|
24
|
+
WebchatSettings,
|
|
25
|
+
WebchatSettingsProps,
|
|
26
|
+
} from './webchat-settings'
|
|
22
27
|
export {
|
|
23
28
|
WhatsappButtonList,
|
|
24
29
|
WhatsappButtonListProps,
|
|
@@ -3,11 +3,12 @@ import React, { useContext, useEffect, useState } from 'react'
|
|
|
3
3
|
import { v7 as uuidv7 } from 'uuid'
|
|
4
4
|
|
|
5
5
|
import { COLORS, WEBCHAT } from '../../constants'
|
|
6
|
-
import { RequestContext
|
|
6
|
+
import { RequestContext } from '../../contexts'
|
|
7
7
|
import { SENDERS } from '../../index-types'
|
|
8
8
|
import { Fade } from '../../shared/styles'
|
|
9
9
|
import { isDev } from '../../util/environment'
|
|
10
10
|
import { ConditionalWrapper, renderComponent } from '../../util/react'
|
|
11
|
+
import { WebchatContext } from '../../webchat/context'
|
|
11
12
|
import { Button } from '../button'
|
|
12
13
|
import { ButtonsDisabler } from '../buttons-disabler'
|
|
13
14
|
import { getMarkdownStyle, renderLinks, renderMarkdown } from '../markdown'
|
|
@@ -3,9 +3,9 @@ import { v7 as uuidv7 } from 'uuid'
|
|
|
3
3
|
|
|
4
4
|
import ThumbsDown from '../../assets/thumbs-down.svg'
|
|
5
5
|
import ThumbsUp from '../../assets/thumbs-up.svg'
|
|
6
|
-
import { WebchatContext } from '../../contexts'
|
|
7
6
|
import { ActionRequest } from '../../index-types'
|
|
8
7
|
import { resolveImage } from '../../util'
|
|
8
|
+
import { WebchatContext } from '../../webchat/context'
|
|
9
9
|
import { EventAction, FeedbackOption } from '../../webchat/tracking'
|
|
10
10
|
import { FeedbackButton, FeedbackMessageContainer } from './styles'
|
|
11
11
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useContext } from 'react'
|
|
2
2
|
|
|
3
|
-
import { WebchatContext } from '../../contexts'
|
|
4
3
|
import { SENDERS } from '../../index-types'
|
|
4
|
+
import { WebchatContext } from '../../webchat/context'
|
|
5
5
|
import { MessageFeedback } from './message-feedback'
|
|
6
6
|
import { MessageFooterContainer } from './styles'
|
|
7
7
|
import { MessageTimestamp, resolveMessageTimestamps } from './timestamps'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useContext } from 'react'
|
|
2
2
|
|
|
3
3
|
import { WEBCHAT } from '../../constants'
|
|
4
|
-
import { WebchatContext } from '../../contexts'
|
|
5
4
|
import { SENDERS } from '../../index-types'
|
|
6
5
|
import { resolveImage } from '../../util/environment'
|
|
6
|
+
import { WebchatContext } from '../../webchat/context'
|
|
7
7
|
import { BotMessageImageContainer } from './styles'
|
|
8
8
|
|
|
9
9
|
interface MessageImageProps {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useContext } from 'react'
|
|
2
2
|
|
|
3
3
|
import { WEBCHAT } from '../../constants'
|
|
4
|
-
import { WebchatContext } from '../../contexts'
|
|
5
4
|
import { SENDERS } from '../../index-types'
|
|
6
5
|
import { resolveImage } from '../../util'
|
|
6
|
+
import { WebchatContext } from '../../webchat/context'
|
|
7
7
|
import { TimestampContainer, TimestampText } from './styles'
|
|
8
8
|
|
|
9
9
|
export const resolveMessageTimestamps = (
|
|
@@ -2,8 +2,9 @@ import React, { useContext } from 'react'
|
|
|
2
2
|
import styled from 'styled-components'
|
|
3
3
|
|
|
4
4
|
import { COLORS, WEBCHAT } from '../constants'
|
|
5
|
-
import { WebchatContext } from '../contexts'
|
|
6
5
|
import { renderComponent } from '../util/react'
|
|
6
|
+
import { WebchatContext } from '../webchat/context'
|
|
7
|
+
import { ReplyProps } from './index-types'
|
|
7
8
|
|
|
8
9
|
const StyledButton = styled.button`
|
|
9
10
|
width: 100%;
|
|
@@ -14,9 +15,10 @@ const StyledButton = styled.button`
|
|
|
14
15
|
outline: 0;
|
|
15
16
|
`
|
|
16
17
|
|
|
17
|
-
export const Reply = props => {
|
|
18
|
+
export const Reply = (props: ReplyProps) => {
|
|
18
19
|
const { sendText, getThemeProperty } = useContext(WebchatContext)
|
|
19
|
-
|
|
20
|
+
|
|
21
|
+
const handleClick = (event: any) => {
|
|
20
22
|
event.preventDefault()
|
|
21
23
|
if (props.children) {
|
|
22
24
|
let payload = props.payload
|
|
@@ -59,15 +61,19 @@ export const Reply = props => {
|
|
|
59
61
|
const renderNode = () => {
|
|
60
62
|
if (props.path) {
|
|
61
63
|
const payload = `__PATH_PAYLOAD__${props.path}`
|
|
64
|
+
// @ts-ignore
|
|
65
|
+
// eslint-disable-next-line react/no-unknown-property
|
|
62
66
|
return <reply payload={payload}>{props.children}</reply>
|
|
63
67
|
}
|
|
68
|
+
// @ts-ignore
|
|
69
|
+
// eslint-disable-next-line react/no-unknown-property
|
|
64
70
|
return <reply payload={props.payload}>{props.children}</reply>
|
|
65
71
|
}
|
|
66
72
|
|
|
67
73
|
return renderComponent({ renderBrowser, renderNode })
|
|
68
74
|
}
|
|
69
75
|
|
|
70
|
-
Reply.serialize = replyProps => {
|
|
76
|
+
Reply.serialize = (replyProps: ReplyProps) => {
|
|
71
77
|
let payload = replyProps.payload
|
|
72
78
|
if (replyProps.path) payload = `__PATH_PAYLOAD__${replyProps.path}`
|
|
73
79
|
return { reply: { title: replyProps.children, payload } }
|
|
@@ -4,6 +4,7 @@ import styled from 'styled-components'
|
|
|
4
4
|
|
|
5
5
|
import { COLORS, ROLES } from '../constants'
|
|
6
6
|
import { staticAsset } from '../util/environment'
|
|
7
|
+
import { VideoProps } from './index-types'
|
|
7
8
|
import { Message } from './message'
|
|
8
9
|
|
|
9
10
|
const StyledVideo = styled.video`
|
|
@@ -14,11 +15,11 @@ const StyledVideo = styled.video`
|
|
|
14
15
|
margin: 10px;
|
|
15
16
|
`
|
|
16
17
|
|
|
17
|
-
const serialize = videoProps => {
|
|
18
|
+
const serialize = (videoProps: { src: string }) => {
|
|
18
19
|
return { video: videoProps.src }
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
export const Video = props => {
|
|
22
|
+
export const Video = (props: VideoProps) => {
|
|
22
23
|
props = { ...props, src: staticAsset(props.src) }
|
|
23
24
|
let content = props.children
|
|
24
25
|
if (isBrowser())
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import { INPUT } from '@botonic/core'
|
|
2
2
|
import React, { useContext } from 'react'
|
|
3
3
|
|
|
4
|
-
import { WebchatContext } from '../contexts'
|
|
5
4
|
import { renderComponent } from '../util/react'
|
|
6
5
|
import { stringifyWithRegexs } from '../util/regexs'
|
|
7
|
-
import {
|
|
6
|
+
import { WebchatContext } from '../webchat/context'
|
|
7
|
+
import { PersistentMenuOptionsTheme, ThemeProps } from '../webchat/theme/types'
|
|
8
|
+
import { BlockInputOption } from './index-types'
|
|
9
|
+
|
|
10
|
+
export interface WebchatSettingsProps {
|
|
11
|
+
blockInputs?: BlockInputOption[]
|
|
12
|
+
enableAnimations?: boolean
|
|
13
|
+
enableAttachments?: boolean
|
|
14
|
+
enableEmojiPicker?: boolean
|
|
15
|
+
enableUserInput?: boolean
|
|
16
|
+
persistentMenu?: PersistentMenuOptionsTheme
|
|
17
|
+
theme?: ThemeProps
|
|
18
|
+
user?: { extra_data?: any }
|
|
19
|
+
}
|
|
8
20
|
|
|
9
21
|
export const WebchatSettings = ({
|
|
10
22
|
theme,
|
package/src/contexts.tsx
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Input as CoreInput, Session as CoreSession } from '@botonic/core'
|
|
2
2
|
import { createContext } from 'react'
|
|
3
3
|
|
|
4
|
-
import { ActionRequest
|
|
5
|
-
import { webchatInitialState } from './webchat/hooks'
|
|
4
|
+
import { ActionRequest } from './index-types'
|
|
6
5
|
|
|
7
6
|
export const RequestContext = createContext<
|
|
8
7
|
Partial<ActionRequest> & {
|
|
@@ -27,89 +26,12 @@ export interface CloseWebviewOptions {
|
|
|
27
26
|
|
|
28
27
|
export const WebviewRequestContext = createContext<{
|
|
29
28
|
closeWebview: (options?: CloseWebviewOptions) => Promise<void>
|
|
30
|
-
getString
|
|
29
|
+
getString?: (stringId: string) => string
|
|
31
30
|
params: Record<string, any>
|
|
32
|
-
session: CoreSession
|
|
31
|
+
session: Partial<CoreSession>
|
|
33
32
|
}>({
|
|
34
33
|
closeWebview: async () => undefined,
|
|
35
|
-
getString:
|
|
34
|
+
getString: undefined,
|
|
36
35
|
params: {} as Record<string, any>,
|
|
37
|
-
session: {} as CoreSession
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
export const WebchatContext = createContext<WebchatContextProps>({
|
|
41
|
-
addMessage: () => {
|
|
42
|
-
return
|
|
43
|
-
},
|
|
44
|
-
closeWebview: async () => {
|
|
45
|
-
return
|
|
46
|
-
},
|
|
47
|
-
getThemeProperty: () => {
|
|
48
|
-
return
|
|
49
|
-
}, // used to retrieve a specific property of the theme defined by the developer in his 'webchat/index.js'
|
|
50
|
-
openWebview: () => {
|
|
51
|
-
return
|
|
52
|
-
},
|
|
53
|
-
resolveCase: () => {
|
|
54
|
-
return
|
|
55
|
-
},
|
|
56
|
-
resetUnreadMessages: () => {
|
|
57
|
-
return
|
|
58
|
-
},
|
|
59
|
-
setIsInputFocused: () => {
|
|
60
|
-
return
|
|
61
|
-
},
|
|
62
|
-
setLastMessageVisible: () => {
|
|
63
|
-
return
|
|
64
|
-
},
|
|
65
|
-
sendAttachment: async () => {
|
|
66
|
-
return
|
|
67
|
-
},
|
|
68
|
-
sendInput: async () => {
|
|
69
|
-
return
|
|
70
|
-
},
|
|
71
|
-
sendPayload: async () => {
|
|
72
|
-
return
|
|
73
|
-
},
|
|
74
|
-
sendText: async () => {
|
|
75
|
-
return
|
|
76
|
-
},
|
|
77
|
-
theme: {},
|
|
78
|
-
toggleCoverComponent: () => {
|
|
79
|
-
return
|
|
80
|
-
},
|
|
81
|
-
toggleWebchat: () => {
|
|
82
|
-
return
|
|
83
|
-
},
|
|
84
|
-
toggleEmojiPicker: () => {
|
|
85
|
-
return
|
|
86
|
-
},
|
|
87
|
-
togglePersistentMenu: () => {
|
|
88
|
-
return
|
|
89
|
-
},
|
|
90
|
-
updateLatestInput: () => {
|
|
91
|
-
return
|
|
92
|
-
},
|
|
93
|
-
updateMessage: () => {
|
|
94
|
-
return
|
|
95
|
-
},
|
|
96
|
-
updateReplies: () => {
|
|
97
|
-
return
|
|
98
|
-
},
|
|
99
|
-
updateUser: () => {
|
|
100
|
-
return
|
|
101
|
-
},
|
|
102
|
-
updateWebchatDevSettings: () => {
|
|
103
|
-
return
|
|
104
|
-
},
|
|
105
|
-
webchatState: webchatInitialState,
|
|
106
|
-
trackEvent: async () => {
|
|
107
|
-
return
|
|
108
|
-
},
|
|
109
|
-
webchatRef: { current: null },
|
|
110
|
-
chatAreaRef: { current: null },
|
|
111
|
-
inputPanelRef: { current: null },
|
|
112
|
-
headerRef: { current: null },
|
|
113
|
-
scrollableMessagesListRef: { current: null },
|
|
114
|
-
repliesRef: { current: null },
|
|
36
|
+
session: {} as Partial<CoreSession>,
|
|
115
37
|
})
|