@botonic/react 0.31.0-alpha.3 → 0.31.0-alpha.5
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 +33 -4
- 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 +1 -1
- 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 +87 -55
- 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 +18 -19
- package/lib/cjs/webchat/{hooks → context}/use-webchat.js +10 -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 -44
- 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 +1 -1
- 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/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 +83 -104
- 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 +12 -84
- package/lib/cjs/webchat-app.js +45 -26
- 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 +33 -4
- 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 +1 -1
- 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 +87 -55
- 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 +18 -19
- package/lib/esm/webchat/{hooks → context}/use-webchat.js +10 -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 -44
- 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 +1 -1
- 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/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 +82 -103
- 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 +12 -84
- package/lib/esm/webchat-app.js +45 -26
- package/lib/esm/webchat-app.js.map +1 -1
- package/package.json +5 -4
- 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 +29 -4
- 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 +2 -2
- package/src/contexts.tsx +5 -83
- package/src/index-types.ts +92 -59
- 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 +88 -0
- package/src/webchat/{hooks → context}/use-webchat.ts +59 -12
- 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 -49
- 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 +4 -2
- 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/trigger-button/index.tsx +1 -1
- package/src/webchat/webchat-dev.jsx +1 -1
- package/src/webchat/{webchat.jsx → webchat.tsx} +113 -123
- package/src/webchat/webview.jsx +2 -1
- package/src/webchat-app.tsx +79 -102
- 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
package/src/webchat/header.jsx
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef, useContext } from 'react'
|
|
2
|
-
import styled from 'styled-components'
|
|
3
|
-
|
|
4
|
-
import { COLORS, ROLES, WEBCHAT } from '../constants'
|
|
5
|
-
import { WebchatContext } from '../contexts'
|
|
6
|
-
import { Scale } from '../shared/styles'
|
|
7
|
-
import { resolveImage } from '../util/environment'
|
|
8
|
-
import { ConditionalWrapper } from '../util/react'
|
|
9
|
-
import { BotonicContainerId } from './constants'
|
|
10
|
-
|
|
11
|
-
const Header = styled.div`
|
|
12
|
-
display: flex;
|
|
13
|
-
background: linear-gradient(
|
|
14
|
-
90deg,
|
|
15
|
-
${COLORS.BLEACHED_CEDAR_PURPLE} 0%,
|
|
16
|
-
${props => props.color} 100%
|
|
17
|
-
);
|
|
18
|
-
border-radius: ${WEBCHAT.DEFAULTS.BORDER_RADIUS_TOP_CORNERS};
|
|
19
|
-
z-index: 2;
|
|
20
|
-
height: inherit;
|
|
21
|
-
`
|
|
22
|
-
|
|
23
|
-
const ImageContainer = styled.div`
|
|
24
|
-
padding: 10px;
|
|
25
|
-
align-items: center;
|
|
26
|
-
`
|
|
27
|
-
|
|
28
|
-
const Image = styled.img`
|
|
29
|
-
width: 32px;
|
|
30
|
-
border-radius: 50%;
|
|
31
|
-
`
|
|
32
|
-
|
|
33
|
-
const TextContainer = styled.div`
|
|
34
|
-
display: flex;
|
|
35
|
-
flex-direction: column;
|
|
36
|
-
justify-content: center;
|
|
37
|
-
flex: 1 1 auto;
|
|
38
|
-
`
|
|
39
|
-
|
|
40
|
-
const Title = styled.div`
|
|
41
|
-
display: flex;
|
|
42
|
-
font-family: inherit;
|
|
43
|
-
font-size: 15px;
|
|
44
|
-
font-weight: bold;
|
|
45
|
-
color: ${COLORS.SOLID_WHITE};
|
|
46
|
-
`
|
|
47
|
-
|
|
48
|
-
const Subtitle = styled.div`
|
|
49
|
-
display: flex;
|
|
50
|
-
font-family: inherit;
|
|
51
|
-
font-size: 11px;
|
|
52
|
-
color: ${COLORS.SOLID_WHITE};
|
|
53
|
-
`
|
|
54
|
-
|
|
55
|
-
const CloseHeader = styled.div`
|
|
56
|
-
padding: 0px 16px;
|
|
57
|
-
cursor: pointer;
|
|
58
|
-
color: ${COLORS.SOLID_WHITE};
|
|
59
|
-
font-family: inherit;
|
|
60
|
-
font-size: 36px;
|
|
61
|
-
`
|
|
62
|
-
|
|
63
|
-
export const DefaultHeader = props => {
|
|
64
|
-
const { getThemeProperty } = props
|
|
65
|
-
const animationsEnabled = getThemeProperty(
|
|
66
|
-
WEBCHAT.CUSTOM_PROPERTIES.enableAnimations,
|
|
67
|
-
true
|
|
68
|
-
)
|
|
69
|
-
const headerImage = getThemeProperty(
|
|
70
|
-
WEBCHAT.CUSTOM_PROPERTIES.headerImage,
|
|
71
|
-
getThemeProperty(
|
|
72
|
-
WEBCHAT.CUSTOM_PROPERTIES.brandImage,
|
|
73
|
-
WEBCHAT.DEFAULTS.LOGO
|
|
74
|
-
)
|
|
75
|
-
)
|
|
76
|
-
|
|
77
|
-
const headerTitle = getThemeProperty(
|
|
78
|
-
WEBCHAT.CUSTOM_PROPERTIES.headerTitle,
|
|
79
|
-
WEBCHAT.DEFAULTS.TITLE
|
|
80
|
-
)
|
|
81
|
-
const headerSubtitle = getThemeProperty(
|
|
82
|
-
WEBCHAT.CUSTOM_PROPERTIES.headerSubtitle,
|
|
83
|
-
''
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
return (
|
|
87
|
-
<Header
|
|
88
|
-
role={ROLES.HEADER}
|
|
89
|
-
color={props.color}
|
|
90
|
-
style={{ ...getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.headerStyle) }}
|
|
91
|
-
>
|
|
92
|
-
{headerImage && (
|
|
93
|
-
<ImageContainer>
|
|
94
|
-
<Image src={resolveImage(headerImage)} />
|
|
95
|
-
</ImageContainer>
|
|
96
|
-
)}
|
|
97
|
-
<TextContainer ml={headerImage ? '0px' : '16px'}>
|
|
98
|
-
<Title mb={headerSubtitle ? '6px' : '0px'}>{headerTitle}</Title>
|
|
99
|
-
<Subtitle>{headerSubtitle}</Subtitle>
|
|
100
|
-
</TextContainer>
|
|
101
|
-
<ConditionalWrapper
|
|
102
|
-
condition={animationsEnabled}
|
|
103
|
-
wrapper={children => <Scale>{children}</Scale>}
|
|
104
|
-
>
|
|
105
|
-
<CloseHeader onClick={props.onCloseClick}>⨯</CloseHeader>
|
|
106
|
-
</ConditionalWrapper>
|
|
107
|
-
</Header>
|
|
108
|
-
)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const StyledWebchatHeader = styled.div`
|
|
112
|
-
border-radius: 8px 8px 0px 0px;
|
|
113
|
-
box-shadow: ${COLORS.PIGEON_POST_BLUE_ALPHA_0_5} 0px 2px 5px;
|
|
114
|
-
height: 55px;
|
|
115
|
-
flex: none;
|
|
116
|
-
`
|
|
117
|
-
|
|
118
|
-
export const WebchatHeader = forwardRef((props, ref) => {
|
|
119
|
-
const { webchatState, getThemeProperty } = useContext(WebchatContext)
|
|
120
|
-
|
|
121
|
-
const handleCloseWebchat = event => {
|
|
122
|
-
props.onCloseClick(event.target.value)
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
const CustomHeader = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.customHeader)
|
|
126
|
-
if (CustomHeader) {
|
|
127
|
-
return (
|
|
128
|
-
<div id={BotonicContainerId.Header} ref={ref}>
|
|
129
|
-
<CustomHeader onCloseClick={handleCloseWebchat} />
|
|
130
|
-
</div>
|
|
131
|
-
)
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return (
|
|
135
|
-
<StyledWebchatHeader id={BotonicContainerId.Header} ref={ref}>
|
|
136
|
-
<DefaultHeader
|
|
137
|
-
webchatState={webchatState}
|
|
138
|
-
getThemeProperty={getThemeProperty}
|
|
139
|
-
color={getThemeProperty(
|
|
140
|
-
WEBCHAT.CUSTOM_PROPERTIES.brandColor,
|
|
141
|
-
COLORS.BOTONIC_BLUE
|
|
142
|
-
)}
|
|
143
|
-
onCloseClick={handleCloseWebchat}
|
|
144
|
-
/>
|
|
145
|
-
</StyledWebchatHeader>
|
|
146
|
-
)
|
|
147
|
-
})
|
|
148
|
-
|
|
149
|
-
WebchatHeader.displayName = 'WebchatHeader'
|
package/src/webchat/replies.jsx
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import React, { useContext } from 'react'
|
|
2
|
-
import styled from 'styled-components'
|
|
3
|
-
|
|
4
|
-
import { WEBCHAT } from '../constants'
|
|
5
|
-
import { WebchatContext } from '../contexts'
|
|
6
|
-
import { BotonicContainerId } from './constants'
|
|
7
|
-
|
|
8
|
-
const ScrollableReplies = styled.div`
|
|
9
|
-
overscroll-behavior: contain;
|
|
10
|
-
-webkit-overflow-scrolling: touch;
|
|
11
|
-
`
|
|
12
|
-
|
|
13
|
-
const RepliesContainer = styled.div`
|
|
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: scroll;
|
|
22
|
-
`
|
|
23
|
-
|
|
24
|
-
const ReplyContainer = styled.div`
|
|
25
|
-
flex: none;
|
|
26
|
-
display: inline-block;
|
|
27
|
-
margin: 3px;
|
|
28
|
-
`
|
|
29
|
-
|
|
30
|
-
const options = {
|
|
31
|
-
left: 'flex-start',
|
|
32
|
-
center: 'center',
|
|
33
|
-
right: 'flex-end',
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export const WebchatReplies = props => {
|
|
37
|
-
const { webchatState, getThemeProperty, repliesRef } =
|
|
38
|
-
useContext(WebchatContext)
|
|
39
|
-
let justifyContent = 'center'
|
|
40
|
-
const flexWrap = getThemeProperty(
|
|
41
|
-
WEBCHAT.CUSTOM_PROPERTIES.wrapReplies,
|
|
42
|
-
'wrap'
|
|
43
|
-
)
|
|
44
|
-
if (flexWrap == 'nowrap') justifyContent = 'flex-start'
|
|
45
|
-
else if (getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.alignReplies))
|
|
46
|
-
justifyContent =
|
|
47
|
-
options[getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.alignReplies)]
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<ScrollableReplies>
|
|
51
|
-
<RepliesContainer
|
|
52
|
-
id={BotonicContainerId.RepliesContainer}
|
|
53
|
-
ref={repliesRef}
|
|
54
|
-
className='replies-container'
|
|
55
|
-
justify={justifyContent}
|
|
56
|
-
wrap={flexWrap}
|
|
57
|
-
>
|
|
58
|
-
{webchatState.replies.map((r, i) => (
|
|
59
|
-
<ReplyContainer key={i}>{r}</ReplyContainer>
|
|
60
|
-
))}
|
|
61
|
-
</RepliesContainer>
|
|
62
|
-
</ScrollableReplies>
|
|
63
|
-
)
|
|
64
|
-
}
|