@botonic/react 0.31.0-alpha.1 → 0.31.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/element.js +6 -6
- package/lib/cjs/components/element.js.map +1 -1
- package/lib/cjs/components/index-types.d.ts +2 -0
- package/lib/cjs/components/multichannel/multichannel-button.js +2 -2
- package/lib/cjs/components/multichannel/multichannel-button.js.map +1 -1
- package/lib/cjs/components/multichannel/multichannel-carousel.js +4 -4
- package/lib/cjs/components/multichannel/multichannel-carousel.js.map +1 -1
- package/lib/cjs/components/multichannel/multichannel-text.js +12 -11
- package/lib/cjs/components/multichannel/multichannel-text.js.map +1 -1
- package/lib/cjs/components/multichannel/multichannel-utils.d.ts +9 -15
- package/lib/cjs/components/multichannel/multichannel-utils.js +48 -27
- package/lib/cjs/components/multichannel/multichannel-utils.js.map +1 -1
- package/lib/cjs/components/multichannel/multichannel.js +7 -7
- package/lib/cjs/components/multichannel/multichannel.js.map +1 -1
- package/lib/cjs/components/multichannel/whatsapp/constants.d.ts +11 -0
- package/lib/cjs/components/multichannel/whatsapp/constants.js +13 -0
- package/lib/cjs/components/multichannel/whatsapp/constants.js.map +1 -0
- package/lib/cjs/components/whatsapp-button-list.js +2 -2
- package/lib/cjs/components/whatsapp-button-list.js.map +1 -1
- package/lib/cjs/components/whatsapp-cta-url-button.js +5 -5
- package/lib/cjs/components/whatsapp-cta-url-button.js.map +1 -1
- package/lib/cjs/constants.d.ts +0 -6
- package/lib/cjs/constants.js +1 -7
- package/lib/cjs/constants.js.map +1 -1
- package/lib/cjs/contexts.js +6 -0
- package/lib/cjs/contexts.js.map +1 -1
- package/lib/cjs/dev-app.d.ts +7 -0
- package/lib/cjs/dev-app.js +5 -2
- package/lib/cjs/dev-app.js.map +1 -1
- package/lib/cjs/index-types.d.ts +4 -7
- package/lib/cjs/index-types.js.map +1 -1
- package/lib/cjs/index.d.ts +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/webchat/actions.d.ts +2 -1
- package/lib/cjs/webchat/actions.js +1 -0
- package/lib/cjs/webchat/actions.js.map +1 -1
- package/lib/cjs/webchat/cover-component/index.d.ts +6 -0
- package/lib/cjs/webchat/cover-component/index.js +21 -0
- package/lib/cjs/webchat/cover-component/index.js.map +1 -0
- package/lib/cjs/webchat/hooks/use-scroll-to-bottom.d.ts +6 -4
- package/lib/cjs/webchat/hooks/use-scroll-to-bottom.js.map +1 -1
- package/lib/cjs/webchat/hooks/use-webchat.d.ts +1 -0
- package/lib/cjs/webchat/hooks/use-webchat.js +8 -0
- package/lib/cjs/webchat/hooks/use-webchat.js.map +1 -1
- package/lib/cjs/webchat/index-types.d.ts +1 -0
- package/lib/cjs/webchat/input-panel/textarea.js +8 -2
- package/lib/cjs/webchat/input-panel/textarea.js.map +1 -1
- package/lib/cjs/webchat/message-list/index.js +63 -35
- package/lib/cjs/webchat/message-list/index.js.map +1 -1
- package/lib/cjs/webchat/message-list/styles.js +3 -3
- package/lib/cjs/webchat/typing-indicator/index.d.ts +3 -1
- package/lib/cjs/webchat/typing-indicator/index.js +4 -3
- package/lib/cjs/webchat/typing-indicator/index.js.map +1 -1
- package/lib/cjs/webchat/typing-indicator/styles.d.ts +3 -2
- package/lib/cjs/webchat/typing-indicator/styles.js +6 -3
- package/lib/cjs/webchat/typing-indicator/styles.js.map +1 -1
- package/lib/cjs/webchat/webchat-reducer.js +2 -0
- package/lib/cjs/webchat/webchat-reducer.js.map +1 -1
- package/lib/cjs/webchat/webchat-typed/styles.d.ts +7 -0
- package/lib/cjs/webchat/webchat-typed/styles.js +54 -0
- package/lib/cjs/webchat/webchat-typed/styles.js.map +1 -0
- package/lib/cjs/webchat/webchat-typed/webchat-typed.d.ts +0 -0
- package/lib/cjs/webchat/webchat-typed/webchat-typed.js +663 -0
- package/lib/cjs/webchat/webchat-typed/webchat-typed.js.map +1 -0
- package/lib/cjs/webchat/webchat.js +16 -18
- package/lib/cjs/webchat/webchat.js.map +1 -1
- package/lib/cjs/webchat-app.d.ts +119 -72
- package/lib/cjs/webchat-app.js +98 -53
- package/lib/cjs/webchat-app.js.map +1 -1
- package/lib/cjs/webview-app.js +5 -2
- package/lib/cjs/webview-app.js.map +1 -1
- package/lib/esm/components/element.js +6 -6
- package/lib/esm/components/element.js.map +1 -1
- package/lib/esm/components/index-types.d.ts +2 -0
- package/lib/esm/components/multichannel/multichannel-button.js +1 -1
- package/lib/esm/components/multichannel/multichannel-carousel.js +5 -5
- package/lib/esm/components/multichannel/multichannel-carousel.js.map +1 -1
- package/lib/esm/components/multichannel/multichannel-text.js +2 -1
- package/lib/esm/components/multichannel/multichannel-text.js.map +1 -1
- package/lib/esm/components/multichannel/multichannel-utils.d.ts +9 -15
- package/lib/esm/components/multichannel/multichannel-utils.js +40 -24
- package/lib/esm/components/multichannel/multichannel-utils.js.map +1 -1
- package/lib/esm/components/multichannel/multichannel.js +7 -7
- package/lib/esm/components/multichannel/multichannel.js.map +1 -1
- package/lib/esm/components/multichannel/whatsapp/constants.d.ts +11 -0
- package/lib/esm/components/multichannel/whatsapp/constants.js +10 -0
- package/lib/esm/components/multichannel/whatsapp/constants.js.map +1 -0
- package/lib/esm/components/whatsapp-button-list.js +1 -1
- package/lib/esm/components/whatsapp-cta-url-button.js +1 -1
- package/lib/esm/constants.d.ts +0 -6
- package/lib/esm/constants.js +0 -6
- package/lib/esm/constants.js.map +1 -1
- package/lib/esm/contexts.js +6 -0
- package/lib/esm/contexts.js.map +1 -1
- package/lib/esm/dev-app.d.ts +7 -0
- package/lib/esm/dev-app.js +5 -2
- package/lib/esm/dev-app.js.map +1 -1
- package/lib/esm/index-types.d.ts +4 -7
- package/lib/esm/index-types.js.map +1 -1
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/webchat/actions.d.ts +2 -1
- package/lib/esm/webchat/actions.js +1 -0
- package/lib/esm/webchat/actions.js.map +1 -1
- package/lib/esm/webchat/cover-component/index.d.ts +6 -0
- package/lib/esm/webchat/cover-component/index.js +17 -0
- package/lib/esm/webchat/cover-component/index.js.map +1 -0
- package/lib/esm/webchat/hooks/use-scroll-to-bottom.d.ts +6 -4
- package/lib/esm/webchat/hooks/use-scroll-to-bottom.js.map +1 -1
- package/lib/esm/webchat/hooks/use-webchat.d.ts +1 -0
- package/lib/esm/webchat/hooks/use-webchat.js +8 -0
- package/lib/esm/webchat/hooks/use-webchat.js.map +1 -1
- package/lib/esm/webchat/index-types.d.ts +1 -0
- package/lib/esm/webchat/input-panel/textarea.js +8 -2
- package/lib/esm/webchat/input-panel/textarea.js.map +1 -1
- package/lib/esm/webchat/message-list/index.js +62 -35
- package/lib/esm/webchat/message-list/index.js.map +1 -1
- package/lib/esm/webchat/message-list/styles.js +3 -3
- package/lib/esm/webchat/typing-indicator/index.d.ts +3 -1
- package/lib/esm/webchat/typing-indicator/index.js +5 -2
- package/lib/esm/webchat/typing-indicator/index.js.map +1 -1
- package/lib/esm/webchat/typing-indicator/styles.d.ts +3 -2
- package/lib/esm/webchat/typing-indicator/styles.js +5 -2
- package/lib/esm/webchat/typing-indicator/styles.js.map +1 -1
- package/lib/esm/webchat/webchat-reducer.js +2 -0
- package/lib/esm/webchat/webchat-reducer.js.map +1 -1
- package/lib/esm/webchat/webchat-typed/styles.d.ts +7 -0
- package/lib/esm/webchat/webchat-typed/styles.js +50 -0
- package/lib/esm/webchat/webchat-typed/styles.js.map +1 -0
- package/lib/esm/webchat/webchat-typed/webchat-typed.d.ts +0 -0
- package/lib/esm/webchat/webchat-typed/webchat-typed.js +663 -0
- package/lib/esm/webchat/webchat-typed/webchat-typed.js.map +1 -0
- package/lib/esm/webchat/webchat.js +16 -18
- package/lib/esm/webchat/webchat.js.map +1 -1
- package/lib/esm/webchat-app.d.ts +119 -72
- package/lib/esm/webchat-app.js +99 -54
- package/lib/esm/webchat-app.js.map +1 -1
- package/lib/esm/webview-app.js +5 -2
- package/lib/esm/webview-app.js.map +1 -1
- package/package.json +3 -2
- package/src/components/element.jsx +4 -11
- package/src/components/index-types.ts +4 -0
- package/src/components/multichannel/multichannel-button.jsx +1 -1
- package/src/components/multichannel/multichannel-carousel.jsx +7 -5
- package/src/components/multichannel/multichannel-text.jsx +4 -2
- package/src/components/multichannel/multichannel-utils.js +45 -27
- package/src/components/multichannel/multichannel.jsx +12 -7
- package/src/components/multichannel/whatsapp/constants.ts +10 -0
- package/src/components/whatsapp-button-list.tsx +1 -1
- package/src/components/whatsapp-cta-url-button.tsx +1 -1
- package/src/constants.js +0 -7
- package/src/contexts.tsx +6 -0
- package/src/dev-app.jsx +5 -5
- package/src/index-types.ts +4 -7
- package/src/index.ts +1 -1
- package/src/webchat/actions.ts +1 -0
- package/src/webchat/cover-component/index.tsx +31 -0
- package/src/webchat/hooks/use-scroll-to-bottom.ts +8 -2
- package/src/webchat/hooks/use-webchat.ts +9 -0
- package/src/webchat/index-types.ts +1 -0
- package/src/webchat/input-panel/textarea.tsx +12 -1
- package/src/webchat/message-list/index.tsx +79 -48
- package/src/webchat/message-list/styles.ts +3 -3
- package/src/webchat/typing-indicator/index.tsx +20 -12
- package/src/webchat/typing-indicator/styles.ts +7 -3
- package/src/webchat/webchat-reducer.ts +2 -0
- package/src/webchat/webchat-typed/styles.ts +54 -0
- package/src/webchat/webchat-typed/webchat-typed.tsx +728 -0
- package/src/webchat/webchat.jsx +48 -48
- package/src/webchat-app.tsx +546 -0
- package/src/webview-app.tsx +6 -4
- package/src/webchat-app.jsx +0 -389
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { ForwardedRef, forwardRef } from 'react'
|
|
2
2
|
|
|
3
3
|
import { COLORS, ROLES } from '../../constants'
|
|
4
|
-
import { Dot,
|
|
4
|
+
import { Dot, TypingContainer, TypingMsgWrapper } from './styles'
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
const TypingIndicator = forwardRef<HTMLDivElement, any>(
|
|
7
|
+
(_props, ref: ForwardedRef<HTMLDivElement>) => (
|
|
8
|
+
<TypingContainer ref={ref}>
|
|
9
|
+
<TypingMsgWrapper
|
|
10
|
+
role={ROLES.TYPING_INDICATOR}
|
|
11
|
+
className='typing-indicator'
|
|
12
|
+
backgroundColor={COLORS.SEASHELL_WHITE}
|
|
13
|
+
>
|
|
14
|
+
<Dot />
|
|
15
|
+
<Dot />
|
|
16
|
+
<Dot />
|
|
17
|
+
</TypingMsgWrapper>
|
|
18
|
+
</TypingContainer>
|
|
19
|
+
)
|
|
16
20
|
)
|
|
21
|
+
|
|
22
|
+
TypingIndicator.displayName = 'TypingIndicator'
|
|
23
|
+
|
|
24
|
+
export default TypingIndicator
|
|
@@ -12,16 +12,20 @@ const bulge = keyframes`
|
|
|
12
12
|
}
|
|
13
13
|
`
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
export const TypingContainer = styled.div`
|
|
16
|
+
padding: 0px 8px 8px 8px;
|
|
17
|
+
`
|
|
18
|
+
|
|
19
|
+
interface TypingMsgWrapperProps {
|
|
16
20
|
backgroundColor: string
|
|
17
21
|
}
|
|
18
22
|
|
|
19
|
-
export const
|
|
23
|
+
export const TypingMsgWrapper = styled.div<TypingMsgWrapperProps>`
|
|
20
24
|
will-change: transform;
|
|
21
25
|
width: 44px;
|
|
22
26
|
line-height: 0px;
|
|
23
27
|
border-radius: 20px;
|
|
24
|
-
padding: 8px 2px
|
|
28
|
+
padding: 8px 2px;
|
|
25
29
|
text-align: center;
|
|
26
30
|
display: block;
|
|
27
31
|
margin: 8px;
|
|
@@ -48,6 +48,8 @@ export function webchatReducer(
|
|
|
48
48
|
return { ...state, lastRoutePath: action.payload }
|
|
49
49
|
case WebchatAction.SET_CURRENT_ATTACHMENT:
|
|
50
50
|
return { ...state, currentAttachment: action.payload }
|
|
51
|
+
case WebchatAction.SET_IS_INPUT_FOCUSED:
|
|
52
|
+
return { ...state, isInputFocused: action.payload }
|
|
51
53
|
default:
|
|
52
54
|
return messagesReducer(state, action)
|
|
53
55
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import styled from 'styled-components'
|
|
2
|
+
|
|
3
|
+
import { COLORS, WEBCHAT } from '../../constants'
|
|
4
|
+
|
|
5
|
+
export const StyledWebchat = styled.div<{ height: string; width: string }>`
|
|
6
|
+
position: fixed;
|
|
7
|
+
right: 20px;
|
|
8
|
+
bottom: 20px;
|
|
9
|
+
width: ${props => props.width}px;
|
|
10
|
+
height: ${props => props.height}px;
|
|
11
|
+
margin: auto;
|
|
12
|
+
background-color: ${COLORS.SOLID_WHITE};
|
|
13
|
+
border-radius: 10px;
|
|
14
|
+
box-shadow: ${COLORS.SOLID_BLACK_ALPHA_0_2} 0px 0px 12px;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
`
|
|
20
|
+
|
|
21
|
+
export const ErrorMessageContainer = styled.div`
|
|
22
|
+
position: relative;
|
|
23
|
+
display: flex;
|
|
24
|
+
z-index: 1;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
width: 100%;
|
|
27
|
+
`
|
|
28
|
+
|
|
29
|
+
export const ErrorMessage = styled.div`
|
|
30
|
+
position: absolute;
|
|
31
|
+
top: 10px;
|
|
32
|
+
font-size: 14px;
|
|
33
|
+
line-height: 20px;
|
|
34
|
+
padding: 4px 11px;
|
|
35
|
+
display: flex;
|
|
36
|
+
background-color: ${COLORS.ERROR_RED};
|
|
37
|
+
color: ${COLORS.CONCRETE_WHITE};
|
|
38
|
+
border-radius: 5px;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
font-family: ${WEBCHAT.DEFAULTS.FONT_FAMILY};
|
|
42
|
+
`
|
|
43
|
+
|
|
44
|
+
export const DarkBackgroundMenu = styled.div`
|
|
45
|
+
background: ${COLORS.SOLID_BLACK};
|
|
46
|
+
opacity: 0.3;
|
|
47
|
+
z-index: 1;
|
|
48
|
+
right: 0;
|
|
49
|
+
bottom: 0;
|
|
50
|
+
border-radius: 10px;
|
|
51
|
+
position: absolute;
|
|
52
|
+
width: 100%;
|
|
53
|
+
height: 100%;
|
|
54
|
+
`
|