@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useContext } from 'react'
|
|
2
2
|
|
|
3
3
|
import ArrowDown from '../../assets/arrow-down.svg'
|
|
4
|
-
import { WebchatContext } from '../../contexts'
|
|
5
4
|
import { resolveImage } from '../../util/environment'
|
|
5
|
+
import { WebchatContext } from '../../webchat/context'
|
|
6
6
|
import { ContainerUnreadMessagesBanner } from './styles'
|
|
7
7
|
import { useNotifications } from './use-notifications'
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useContext } from 'react'
|
|
2
2
|
|
|
3
3
|
import { WEBCHAT } from '../../constants'
|
|
4
|
-
import { WebchatContext } from '../../
|
|
4
|
+
import { WebchatContext } from '../../webchat/context'
|
|
5
5
|
|
|
6
6
|
export function useNotifications() {
|
|
7
7
|
const { getThemeProperty } = useContext(WebchatContext)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React, { useContext } from 'react'
|
|
2
|
+
|
|
3
|
+
import { WEBCHAT } from '../../constants'
|
|
4
|
+
import { WebchatContext } from '../../webchat/context'
|
|
5
|
+
import { BotonicContainerId } from '../constants'
|
|
6
|
+
import { RepliesContainer, ReplyContainer, ScrollableReplies } from './styles'
|
|
7
|
+
|
|
8
|
+
const options = {
|
|
9
|
+
left: 'flex-start',
|
|
10
|
+
center: 'center',
|
|
11
|
+
right: 'flex-end',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const WebchatReplies = () => {
|
|
15
|
+
const { webchatState, getThemeProperty, repliesRef } =
|
|
16
|
+
useContext(WebchatContext)
|
|
17
|
+
|
|
18
|
+
let justifyContent = 'center'
|
|
19
|
+
const flexWrap = getThemeProperty(
|
|
20
|
+
WEBCHAT.CUSTOM_PROPERTIES.wrapReplies,
|
|
21
|
+
'wrap'
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
if (flexWrap === 'nowrap') {
|
|
25
|
+
justifyContent = 'flex-start'
|
|
26
|
+
} else if (getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.alignReplies)) {
|
|
27
|
+
justifyContent =
|
|
28
|
+
options[getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.alignReplies)]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<ScrollableReplies>
|
|
33
|
+
<RepliesContainer
|
|
34
|
+
id={BotonicContainerId.RepliesContainer}
|
|
35
|
+
ref={repliesRef}
|
|
36
|
+
className='replies-container'
|
|
37
|
+
justify={justifyContent}
|
|
38
|
+
wrap={flexWrap}
|
|
39
|
+
>
|
|
40
|
+
{webchatState.replies?.map((reply, i) => (
|
|
41
|
+
// @ts-ignore TODO: In this point reply is the the component to render
|
|
42
|
+
<ReplyContainer key={`reply-${i}`}>{reply}</ReplyContainer>
|
|
43
|
+
))}
|
|
44
|
+
</RepliesContainer>
|
|
45
|
+
</ScrollableReplies>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import styled from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const ScrollableReplies = styled.div`
|
|
4
|
+
overscroll-behavior: contain;
|
|
5
|
+
-webkit-overflow-scrolling: touch;
|
|
6
|
+
`
|
|
7
|
+
|
|
8
|
+
interface RepliesContainerProps {
|
|
9
|
+
justify: string
|
|
10
|
+
wrap: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const RepliesContainer = styled.div<RepliesContainerProps>`
|
|
14
|
+
display: flex;
|
|
15
|
+
text-align: center;
|
|
16
|
+
justify-content: ${props => props.justify};
|
|
17
|
+
flex-wrap: ${props => props.wrap};
|
|
18
|
+
padding-bottom: 10px;
|
|
19
|
+
margin-left: 5px;
|
|
20
|
+
margin-right: 5px;
|
|
21
|
+
overflow-x: auto;
|
|
22
|
+
`
|
|
23
|
+
|
|
24
|
+
export const ReplyContainer = styled.div`
|
|
25
|
+
flex: none;
|
|
26
|
+
display: inline-block;
|
|
27
|
+
margin: 3px;
|
|
28
|
+
`
|
|
@@ -3,7 +3,7 @@ import { JSONTree } from 'react-json-tree'
|
|
|
3
3
|
import styled from 'styled-components'
|
|
4
4
|
|
|
5
5
|
import { COLORS } from '../constants'
|
|
6
|
-
import { useWebchat } from './
|
|
6
|
+
import { useWebchat } from './context/use-webchat'
|
|
7
7
|
|
|
8
8
|
const AttributeContainer = styled.div`
|
|
9
9
|
display: flex;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import styled from 'styled-components'
|
|
2
2
|
|
|
3
|
-
import { COLORS, WEBCHAT } from '
|
|
3
|
+
import { COLORS, WEBCHAT } from '../constants'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
interface StyledWebchatProps {
|
|
6
|
+
width: number
|
|
7
|
+
height: number
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const StyledWebchat = styled.div<StyledWebchatProps>`
|
|
6
11
|
position: fixed;
|
|
7
12
|
right: 20px;
|
|
8
13
|
bottom: 20px;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BlockInputOption,
|
|
3
|
+
ButtonProps,
|
|
4
|
+
CustomMessageType,
|
|
5
|
+
} from '../../components/index-types'
|
|
6
|
+
|
|
7
|
+
interface ImagePreviewerProps {
|
|
8
|
+
src: string
|
|
9
|
+
isPreviewerOpened: boolean
|
|
10
|
+
closePreviewer: () => void
|
|
11
|
+
}
|
|
12
|
+
export interface CoverComponentProps {
|
|
13
|
+
closeComponent: () => void
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface CoverComponentOptions {
|
|
17
|
+
component: React.ComponentType<CoverComponentProps>
|
|
18
|
+
props?: any
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type PersistentMenuCloseOption = { closeLabel: string }
|
|
22
|
+
export type PersistentMenuOption = { label: string } & ButtonProps
|
|
23
|
+
|
|
24
|
+
export type PersistentMenuOptionsTheme = (
|
|
25
|
+
| PersistentMenuCloseOption
|
|
26
|
+
| PersistentMenuOption
|
|
27
|
+
)[]
|
|
28
|
+
|
|
29
|
+
export interface PersistentMenuOptionsProps {
|
|
30
|
+
onClick: () => void
|
|
31
|
+
options: any
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface BlobProps {
|
|
35
|
+
blobTick?: boolean
|
|
36
|
+
blobTickStyle?: any
|
|
37
|
+
blobWidth?: string
|
|
38
|
+
imageStyle?: any
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ThemeProps {
|
|
42
|
+
style?: any
|
|
43
|
+
coverComponent?: CoverComponentOptions
|
|
44
|
+
mobileBreakpoint?: number
|
|
45
|
+
mobileStyle?: any
|
|
46
|
+
webview?: { style?: any; header?: { style?: any } }
|
|
47
|
+
animations?: { enable?: boolean }
|
|
48
|
+
intro?: { style?: any; image?: string; custom?: React.ComponentType }
|
|
49
|
+
brand?: { color?: string; image?: string }
|
|
50
|
+
header?: {
|
|
51
|
+
title?: string
|
|
52
|
+
subtitle?: string
|
|
53
|
+
image?: string
|
|
54
|
+
style?: any
|
|
55
|
+
custom?: React.ComponentType
|
|
56
|
+
}
|
|
57
|
+
// TODO: Review if this is needed hear, or only in message.customTypes? use the same type in both places
|
|
58
|
+
customMessageTypes?: CustomMessageType[]
|
|
59
|
+
message?: {
|
|
60
|
+
bot?: BlobProps & { image?: string; style?: any }
|
|
61
|
+
agent?: { image?: string }
|
|
62
|
+
user?: BlobProps & { style?: any }
|
|
63
|
+
// TODO: Review type used in cutomTypes should be a component exported by default with customMessage function
|
|
64
|
+
customTypes?: CustomMessageType[]
|
|
65
|
+
style?: any
|
|
66
|
+
timestamps?: {
|
|
67
|
+
withImage?: boolean
|
|
68
|
+
format: () => string
|
|
69
|
+
style?: any
|
|
70
|
+
enable?: boolean
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
button?: {
|
|
74
|
+
autodisable?: boolean
|
|
75
|
+
disabledstyle?: any
|
|
76
|
+
hoverBackground?: string
|
|
77
|
+
hoverTextColor?: string
|
|
78
|
+
messageType?: 'text' | 'payload'
|
|
79
|
+
urlIcon?: { image?: string; enable?: boolean }
|
|
80
|
+
style?: any
|
|
81
|
+
custom?: React.ComponentType
|
|
82
|
+
}
|
|
83
|
+
replies?: {
|
|
84
|
+
align?: 'left' | 'center' | 'right'
|
|
85
|
+
wrap?: 'wrap' | 'nowrap'
|
|
86
|
+
}
|
|
87
|
+
carousel?: {
|
|
88
|
+
arrow?: {
|
|
89
|
+
left: { custom?: React.ComponentType }
|
|
90
|
+
right: { custom?: React.ComponentType }
|
|
91
|
+
}
|
|
92
|
+
enableArrows?: boolean
|
|
93
|
+
}
|
|
94
|
+
reply?: { style?: any; custom?: React.ComponentType }
|
|
95
|
+
triggerButton?: { image?: string; style?: any; custom?: React.ComponentType }
|
|
96
|
+
notifications?: {
|
|
97
|
+
enable?: boolean
|
|
98
|
+
banner?: { custom?: React.ComponentType; enable?: boolean; text?: string }
|
|
99
|
+
triggerButton?: { enable?: boolean }
|
|
100
|
+
}
|
|
101
|
+
scrollButton?: { enable?: boolean; custom?: React.ComponentType }
|
|
102
|
+
markdownStyle?: string // string template with css styles
|
|
103
|
+
userInput?: {
|
|
104
|
+
attachments?: { enable?: boolean; custom?: React.ComponentType }
|
|
105
|
+
blockInputs?: BlockInputOption[]
|
|
106
|
+
box?: { placeholder: string; style?: any }
|
|
107
|
+
emojiPicker?: { enable?: boolean; custom?: React.ComponentType }
|
|
108
|
+
menu?: {
|
|
109
|
+
darkBackground?: boolean
|
|
110
|
+
custom?: React.ComponentType<PersistentMenuOptionsProps>
|
|
111
|
+
}
|
|
112
|
+
menuButton?: { custom?: React.ComponentType }
|
|
113
|
+
persistentMenu?: PersistentMenuOptionsTheme
|
|
114
|
+
sendButton?: { enable?: boolean; custom?: React.ComponentType }
|
|
115
|
+
enable?: boolean
|
|
116
|
+
style?: any
|
|
117
|
+
}
|
|
118
|
+
imagePreviewer?: React.ComponentType<ImagePreviewerProps>
|
|
119
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useContext } from 'react'
|
|
2
2
|
|
|
3
3
|
import { ROLES, WEBCHAT } from '../../constants'
|
|
4
|
-
import { WebchatContext } from '../../contexts'
|
|
5
4
|
import { resolveImage } from '../../util/environment'
|
|
5
|
+
import { WebchatContext } from '../../webchat/context'
|
|
6
6
|
import {
|
|
7
7
|
StyledTriggerButton,
|
|
8
8
|
TriggerImage,
|
|
@@ -4,7 +4,7 @@ import React, { forwardRef, useEffect } from 'react'
|
|
|
4
4
|
import { createPortal } from 'react-dom'
|
|
5
5
|
import styled from 'styled-components'
|
|
6
6
|
|
|
7
|
-
import { useWebchat } from './
|
|
7
|
+
import { useWebchat } from './context/use-webchat'
|
|
8
8
|
import { SessionView } from './session-view'
|
|
9
9
|
import { Webchat } from './webchat'
|
|
10
10
|
|