@elliemae/ds-chat 1.53.4-rc.3 → 1.53.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/cjs/index.js +14 -1
- package/cjs/index.js.map +1 -1
- package/cjs/parts/bubble/ChatBubble.js +8 -1
- package/cjs/parts/bubble/ChatBubble.js.map +1 -1
- package/cjs/parts/bubble/config/useValidateProps.js +32 -0
- package/cjs/parts/bubble/config/useValidateProps.js.map +1 -0
- package/cjs/parts/bubble/index.js +4 -1
- package/cjs/parts/bubble/index.js.map +1 -1
- package/cjs/parts/bubble/props.js +4 -4
- package/cjs/parts/bubble/props.js.map +1 -1
- package/cjs/parts/bubble/styled.js +1 -1
- package/cjs/parts/bubble/styled.js.map +1 -1
- package/cjs/parts/chat-card/ChatCard.js +9 -6
- package/cjs/parts/chat-card/ChatCard.js.map +1 -1
- package/cjs/parts/chat-card/config/useValidateProps.js +12 -0
- package/cjs/parts/chat-card/config/useValidateProps.js.map +1 -0
- package/cjs/parts/chat-card/index.js +3 -1
- package/cjs/parts/chat-card/index.js.map +1 -1
- package/cjs/parts/chat-card/props.js +1 -1
- package/cjs/parts/chat-card/props.js.map +1 -1
- package/cjs/parts/chat-composer/ChatContainerComposer.js +19 -2
- package/cjs/parts/chat-composer/ChatContainerComposer.js.map +1 -1
- package/cjs/parts/chat-composer/config/useValidateProps.js +12 -0
- package/cjs/parts/chat-composer/config/useValidateProps.js.map +1 -0
- package/cjs/parts/chat-composer/index.js +2 -0
- package/cjs/parts/chat-composer/index.js.map +1 -1
- package/cjs/parts/chat-composer/props.js +6 -4
- package/cjs/parts/chat-composer/props.js.map +1 -1
- package/cjs/parts/chat-composer/styled.js +2 -2
- package/cjs/parts/chat-composer/styled.js.map +1 -1
- package/cjs/parts/chat-container/ChatContainer.js +10 -1
- package/cjs/parts/chat-container/ChatContainer.js.map +1 -1
- package/cjs/parts/chat-container/config/useValidateProps.js +12 -0
- package/cjs/parts/chat-container/config/useValidateProps.js.map +1 -0
- package/cjs/parts/chat-container/index.js +7 -0
- package/cjs/parts/chat-container/index.js.map +1 -1
- package/cjs/parts/chat-container/props.js +3 -2
- package/cjs/parts/chat-container/props.js.map +1 -1
- package/cjs/parts/chat-container/styled.js +3 -1
- package/cjs/parts/chat-container/styled.js.map +1 -1
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js +70 -11
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +1 -1
- package/cjs/parts/chat-container-messages-list/config/useValidateProps.js +12 -0
- package/cjs/parts/chat-container-messages-list/config/useValidateProps.js.map +1 -0
- package/cjs/parts/chat-container-messages-list/index.js +5 -0
- package/cjs/parts/chat-container-messages-list/index.js.map +1 -1
- package/cjs/parts/chat-container-messages-list/props.js +1 -1
- package/cjs/parts/chat-container-messages-list/props.js.map +1 -1
- package/cjs/parts/chat-container-messages-list/styled.js +9 -1
- package/cjs/parts/chat-container-messages-list/styled.js.map +1 -1
- package/cjs/parts/chat-empty-state/ChatEmptyState.js +14 -3
- package/cjs/parts/chat-empty-state/ChatEmptyState.js.map +1 -1
- package/cjs/parts/chat-empty-state/config/useValidateProps.js +12 -0
- package/cjs/parts/chat-empty-state/config/useValidateProps.js.map +1 -0
- package/cjs/parts/chat-empty-state/props.js +2 -1
- package/cjs/parts/chat-empty-state/props.js.map +1 -1
- package/cjs/parts/chat-sidebar/SideBarChat.js +12 -8
- package/cjs/parts/chat-sidebar/SideBarChat.js.map +1 -1
- package/cjs/parts/chat-sidebar/config/useValidateProps.js +12 -0
- package/cjs/parts/chat-sidebar/config/useValidateProps.js.map +1 -0
- package/cjs/parts/chat-sidebar/index.js +4 -1
- package/cjs/parts/chat-sidebar/index.js.map +1 -1
- package/cjs/parts/floating-button/FloatingButton.js.map +1 -1
- package/cjs/parts/grid-influencer/InfluencerContainer.js +9 -0
- package/cjs/parts/grid-influencer/InfluencerContainer.js.map +1 -1
- package/cjs/parts/message-delimiter/MessageDelimiter.js +8 -5
- package/cjs/parts/message-delimiter/MessageDelimiter.js.map +1 -1
- package/cjs/parts/message-delimiter/config/useValidateProps.js +12 -0
- package/cjs/parts/message-delimiter/config/useValidateProps.js.map +1 -0
- package/cjs/parts/message-delimiter/index.js +2 -0
- package/cjs/parts/message-delimiter/index.js.map +1 -1
- package/cjs/parts/message-delimiter/props.js +1 -1
- package/cjs/parts/message-delimiter/props.js.map +1 -1
- package/cjs/parts/sidebar-button/SidebarButton.js.map +1 -1
- package/cjs/parts/sidebar-button/styled.js +3 -1
- package/cjs/parts/sidebar-button/styled.js.map +1 -1
- package/cjs/parts/system-message/SystemMessage.js +7 -4
- package/cjs/parts/system-message/SystemMessage.js.map +1 -1
- package/cjs/parts/system-message/config/useValidateProps.js +12 -0
- package/cjs/parts/system-message/config/useValidateProps.js.map +1 -0
- package/cjs/parts/system-message/index.js +2 -0
- package/cjs/parts/system-message/index.js.map +1 -1
- package/cjs/parts/tile-button/TileButton.js +3 -1
- package/cjs/parts/tile-button/TileButton.js.map +1 -1
- package/cjs/parts/tile-button/config/useValidateProps.js +12 -0
- package/cjs/parts/tile-button/config/useValidateProps.js.map +1 -0
- package/cjs/parts/tile-button/index.js +2 -1
- package/cjs/parts/tile-button/index.js.map +1 -1
- package/cjs/parts/tile-button/props.js +3 -5
- package/cjs/parts/tile-button/props.js.map +1 -1
- package/cjs/parts/tile-button/styled.js +9 -5
- package/cjs/parts/tile-button/styled.js.map +1 -1
- package/esm/index.js +14 -2
- package/esm/index.js.map +1 -1
- package/esm/parts/bubble/ChatBubble.js +8 -2
- package/esm/parts/bubble/ChatBubble.js.map +1 -1
- package/esm/parts/bubble/config/useValidateProps.js +28 -0
- package/esm/parts/bubble/config/useValidateProps.js.map +1 -0
- package/esm/parts/bubble/index.js +4 -2
- package/esm/parts/bubble/index.js.map +1 -1
- package/esm/parts/bubble/props.js +4 -4
- package/esm/parts/bubble/props.js.map +1 -1
- package/esm/parts/bubble/styled.js +1 -1
- package/esm/parts/bubble/styled.js.map +1 -1
- package/esm/parts/chat-card/ChatCard.js +9 -6
- package/esm/parts/chat-card/ChatCard.js.map +1 -1
- package/esm/parts/chat-card/config/useValidateProps.js +8 -0
- package/esm/parts/chat-card/config/useValidateProps.js.map +1 -0
- package/esm/parts/chat-card/index.js +3 -1
- package/esm/parts/chat-card/index.js.map +1 -1
- package/esm/parts/chat-card/props.js +1 -1
- package/esm/parts/chat-card/props.js.map +1 -1
- package/esm/parts/chat-composer/ChatContainerComposer.js +19 -2
- package/esm/parts/chat-composer/ChatContainerComposer.js.map +1 -1
- package/esm/parts/chat-composer/config/useValidateProps.js +8 -0
- package/esm/parts/chat-composer/config/useValidateProps.js.map +1 -0
- package/esm/parts/chat-composer/index.js +2 -0
- package/esm/parts/chat-composer/index.js.map +1 -1
- package/esm/parts/chat-composer/props.js +6 -4
- package/esm/parts/chat-composer/props.js.map +1 -1
- package/esm/parts/chat-composer/styled.js +2 -2
- package/esm/parts/chat-composer/styled.js.map +1 -1
- package/esm/parts/chat-container/ChatContainer.js +10 -1
- package/esm/parts/chat-container/ChatContainer.js.map +1 -1
- package/esm/parts/chat-container/config/useValidateProps.js +8 -0
- package/esm/parts/chat-container/config/useValidateProps.js.map +1 -0
- package/esm/parts/chat-container/index.js +7 -0
- package/esm/parts/chat-container/index.js.map +1 -1
- package/esm/parts/chat-container/props.js +3 -2
- package/esm/parts/chat-container/props.js.map +1 -1
- package/esm/parts/chat-container/styled.js +3 -1
- package/esm/parts/chat-container/styled.js.map +1 -1
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js +71 -12
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +1 -1
- package/esm/parts/chat-container-messages-list/config/useValidateProps.js +8 -0
- package/esm/parts/chat-container-messages-list/config/useValidateProps.js.map +1 -0
- package/esm/parts/chat-container-messages-list/index.js +5 -0
- package/esm/parts/chat-container-messages-list/index.js.map +1 -1
- package/esm/parts/chat-container-messages-list/props.js +1 -1
- package/esm/parts/chat-container-messages-list/props.js.map +1 -1
- package/esm/parts/chat-container-messages-list/styled.js +9 -2
- package/esm/parts/chat-container-messages-list/styled.js.map +1 -1
- package/esm/parts/chat-empty-state/ChatEmptyState.js +14 -4
- package/esm/parts/chat-empty-state/ChatEmptyState.js.map +1 -1
- package/esm/parts/chat-empty-state/config/useValidateProps.js +8 -0
- package/esm/parts/chat-empty-state/config/useValidateProps.js.map +1 -0
- package/esm/parts/chat-empty-state/props.js +2 -1
- package/esm/parts/chat-empty-state/props.js.map +1 -1
- package/esm/parts/chat-sidebar/SideBarChat.js +12 -8
- package/esm/parts/chat-sidebar/SideBarChat.js.map +1 -1
- package/esm/parts/chat-sidebar/config/useValidateProps.js +8 -0
- package/esm/parts/chat-sidebar/config/useValidateProps.js.map +1 -0
- package/esm/parts/chat-sidebar/index.js +4 -1
- package/esm/parts/chat-sidebar/index.js.map +1 -1
- package/esm/parts/floating-button/FloatingButton.js.map +1 -1
- package/esm/parts/grid-influencer/InfluencerContainer.js +9 -0
- package/esm/parts/grid-influencer/InfluencerContainer.js.map +1 -1
- package/esm/parts/message-delimiter/MessageDelimiter.js +8 -5
- package/esm/parts/message-delimiter/MessageDelimiter.js.map +1 -1
- package/esm/parts/message-delimiter/config/useValidateProps.js +8 -0
- package/esm/parts/message-delimiter/config/useValidateProps.js.map +1 -0
- package/esm/parts/message-delimiter/index.js +2 -0
- package/esm/parts/message-delimiter/index.js.map +1 -1
- package/esm/parts/message-delimiter/props.js +1 -1
- package/esm/parts/message-delimiter/props.js.map +1 -1
- package/esm/parts/sidebar-button/SidebarButton.js.map +1 -1
- package/esm/parts/sidebar-button/styled.js +3 -1
- package/esm/parts/sidebar-button/styled.js.map +1 -1
- package/esm/parts/system-message/SystemMessage.js +7 -4
- package/esm/parts/system-message/SystemMessage.js.map +1 -1
- package/esm/parts/system-message/config/useValidateProps.js +8 -0
- package/esm/parts/system-message/config/useValidateProps.js.map +1 -0
- package/esm/parts/system-message/index.js +2 -0
- package/esm/parts/system-message/index.js.map +1 -1
- package/esm/parts/tile-button/TileButton.js +3 -1
- package/esm/parts/tile-button/TileButton.js.map +1 -1
- package/esm/parts/tile-button/config/useValidateProps.js +8 -0
- package/esm/parts/tile-button/config/useValidateProps.js.map +1 -0
- package/esm/parts/tile-button/index.js +2 -1
- package/esm/parts/tile-button/index.js.map +1 -1
- package/esm/parts/tile-button/props.js +3 -4
- package/esm/parts/tile-button/props.js.map +1 -1
- package/esm/parts/tile-button/styled.js +9 -5
- package/esm/parts/tile-button/styled.js.map +1 -1
- package/package.json +5 -5
- package/parts/bubble/config/useValidateProps/package.json +10 -0
- package/parts/chat-card/config/useValidateProps/package.json +10 -0
- package/parts/chat-composer/config/useValidateProps/package.json +10 -0
- package/parts/chat-container/config/useValidateProps/package.json +10 -0
- package/parts/chat-container-messages-list/config/useValidateProps/package.json +10 -0
- package/parts/chat-empty-state/config/useValidateProps/package.json +10 -0
- package/parts/chat-sidebar/config/useValidateProps/package.json +10 -0
- package/parts/message-delimiter/config/useValidateProps/package.json +10 -0
- package/parts/system-message/config/useValidateProps/package.json +10 -0
- package/parts/tile-button/config/useValidateProps/package.json +10 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","sources":["../../../../src/parts/chat-composer/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSButton } from '@elliemae/ds-button';\nimport { TextAreaProps } from './props';\n\n// Composer\nexport const StyledChatContainerContentComposer = styled(Grid)`\n width: 100%;\n min-height: 56px;\n background: ${(props) => props.theme.colors.neutral['050']};\n padding: ${(props) => props.theme.space.xxs};\n padding-bottom: 3px;\n padding-top: 6px;\n padding-left: ${(props) => props.theme.space.xs};\n max-height: ${(props) => props.maxHeight};\n border-top: 1px solid #cbcfd7;\n`;\n\nexport const StyledComposerInput = styled.textarea<any>`\n padding: ${(props) => props.theme.space.xxs};\n resize: none;\n min-height: 32px;\n border-radius: 2px;\n border: solid 1px #cbcfd7;\n color: #25292f;\n height: ${(props: TextAreaProps) => (typeof props.height === 'number' ? `${props.height}px` : props.height)};\n min-width: 244px;\n overflow-y: auto;\n font-size:
|
|
1
|
+
{"version":3,"file":"styled.js","sources":["../../../../src/parts/chat-composer/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSButton } from '@elliemae/ds-button';\nimport { TextAreaProps } from './props';\n\n// Composer\nexport const StyledChatContainerContentComposer = styled(Grid)`\n width: 100%;\n min-height: 56px;\n background: ${(props) => props.theme.colors.neutral['050']};\n padding: ${(props) => props.theme.space.xxs};\n padding-bottom: 3px;\n padding-top: 6px;\n padding-left: ${(props) => props.theme.space.xs};\n max-height: ${(props) => props.maxHeight};\n border-top: 1px solid #cbcfd7;\n`;\n\nexport const StyledComposerInput = styled.textarea<any>`\n padding: ${(props) => props.theme.space.xxs};\n resize: none;\n min-height: 32px;\n border-radius: 2px;\n border: solid 1px #cbcfd7;\n color: #25292f;\n height: ${(props: TextAreaProps) => (typeof props.height === 'number' ? `${props.height}px` : props.height)};\n min-width: 244px;\n overflow-y: auto;\n font-size: 13px;\n font-weight: 400;\n line-height: 1;\n transition: height 0.3s;\n &:focus {\n outline: none;\n border: 1px solid ${(props) => props.theme.colors.brand[600]};\n box-shadow: inset 0 0 0 1px #8cc2ed;\n border-radius: 2px;\n }\n`;\nexport const StyledComposerButton = styled(DSButton)`\n &:disabled {\n background: none;\n svg {\n fill: #5d6775;\n }\n }\n svg {\n fill: ${(props) => props.theme.colors.brand[600]};\n }\n &:focus {\n background: ${(props) => props.theme.colors.brand[200]};\n }\n`;\n\nexport const StyledCounterArea = styled(Grid)`\n text-align: right;\n font-size: 11px;\n height: 15px;\n align-items: center;\n font-style: italic;\n ${(props) => (props.hasError ? `color:${props.theme.colors.danger[900]};` : '')}\n position:relative;\n`;\n\nexport const StyledCounterErrorA11y = styled.span`\n width: 1px;\n height: 1px;\n position: absolute;\n clip: rect(1px, 1px, 1px, 1px);\n`;\n"],"names":["StyledChatContainerContentComposer","styled","Grid","props","theme","colors","neutral","space","xxs","xs","maxHeight","StyledComposerInput","textarea","height","brand","StyledComposerButton","DSButton","StyledCounterArea","hasError","danger","StyledCounterErrorA11y","span"],"mappings":";;;;;;;;;;;;AAKA;IACaA,kCAAkC,gBAAGC,0BAAM,CAACC,WAAD,CAAT;AAAA;AAAA,mKAG/B,UAACC,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBC,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CAH+B,EAIlC,UAACH,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYG,KAAZ,CAAkBC,GAA7B;AAAA,CAJkC,EAO7B,UAACL,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYG,KAAZ,CAAkBE,EAA7B;AAAA,CAP6B,EAQ/B,UAACN,KAAD;AAAA,SAAWA,KAAK,CAACO,SAAjB;AAAA,CAR+B;IAYlCC,mBAAmB,gBAAGV,0BAAM,CAACW,QAAV;AAAA;AAAA,4TACnB,UAACT,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYG,KAAZ,CAAkBC,GAA7B;AAAA,CADmB,EAOpB,UAACL,KAAD;AAAA,SAA2B,OAAOA,KAAK,CAACU,MAAb,KAAwB,QAAxB,aAAsCV,KAAK,CAACU,MAA5C,UAAyDV,KAAK,CAACU,MAA1F;AAAA,CAPoB,EAgBR,UAACV,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBS,KAAnB,CAAyB,GAAzB,CAAX;AAAA,CAhBQ;IAqBnBC,oBAAoB,gBAAGd,0BAAM,CAACe,iBAAD,CAAT;AAAA;AAAA,+FAQrB,UAACb,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBS,KAAnB,CAAyB,GAAzB,CAAX;AAAA,CARqB,EAWf,UAACX,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBS,KAAnB,CAAyB,GAAzB,CAAX;AAAA,CAXe;IAepBG,iBAAiB,gBAAGhB,0BAAM,CAACC,WAAD,CAAT;AAAA;AAAA,iHAM1B,UAACC,KAAD;AAAA,SAAYA,KAAK,CAACe,QAAN,mBAA0Bf,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBc,MAAnB,CAA0B,GAA1B,CAA1B,SAA8D,EAA1E;AAAA,CAN0B;IAUjBC,sBAAsB,gBAAGnB,0BAAM,CAACoB,IAAV;AAAA;AAAA;;;;;;;;"}
|
|
@@ -12,6 +12,7 @@ var parts_chatComposer_ChatContainerComposer = require('../chat-composer/ChatCon
|
|
|
12
12
|
var parts_chatContainerMessagesList_ChatContainerMessagesList = require('../chat-container-messages-list/ChatContainerMessagesList.js');
|
|
13
13
|
var parts_chatContainer_props = require('./props.js');
|
|
14
14
|
var parts_chatContainer_styled = require('./styled.js');
|
|
15
|
+
var parts_chatContainer_config_useValidateProps = require('./config/useValidateProps.js');
|
|
15
16
|
require('@babel/runtime/helpers/defineProperty');
|
|
16
17
|
require('@babel/runtime/helpers/slicedToArray');
|
|
17
18
|
require('@elliemae/ds-grid');
|
|
@@ -19,6 +20,8 @@ require('@elliemae/ds-icons/PaperAirplane');
|
|
|
19
20
|
require('../chat-composer/styled.js');
|
|
20
21
|
require('styled-components');
|
|
21
22
|
require('@elliemae/ds-button');
|
|
23
|
+
require('../chat-composer/config/useValidateProps.js');
|
|
24
|
+
require('@elliemae/ds-props-helpers');
|
|
22
25
|
require('../chat-composer/props.js');
|
|
23
26
|
require('react-virtual');
|
|
24
27
|
require('@elliemae/ds-basic/Button');
|
|
@@ -27,15 +30,19 @@ require('@elliemae/ds-icons/WarningCircleFill');
|
|
|
27
30
|
require('../bubble/styled.js');
|
|
28
31
|
require('../bubble/props.js');
|
|
29
32
|
require('prop-types');
|
|
33
|
+
require('../bubble/config/useValidateProps.js');
|
|
30
34
|
require('../bubble/ChatBubbleArrow.js');
|
|
31
35
|
require('../message-delimiter/MessageDelimiter.js');
|
|
32
36
|
require('../message-delimiter/styled.js');
|
|
33
37
|
require('../message-delimiter/props.js');
|
|
38
|
+
require('../message-delimiter/config/useValidateProps.js');
|
|
34
39
|
require('../system-message/SystemMessage.js');
|
|
35
40
|
require('../system-message/style.js');
|
|
36
41
|
require('../system-message/props.js');
|
|
42
|
+
require('../system-message/config/useValidateProps.js');
|
|
37
43
|
require('../chat-container-messages-list/styled.js');
|
|
38
44
|
require('../chat-container-messages-list/props.js');
|
|
45
|
+
require('../chat-container-messages-list/config/useValidateProps.js');
|
|
39
46
|
|
|
40
47
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
41
48
|
|
|
@@ -47,6 +54,7 @@ var DSBanner__default = /*#__PURE__*/_interopDefaultLegacy(DSBanner);
|
|
|
47
54
|
var ChatContainer = function ChatContainer(props) {
|
|
48
55
|
var _containerRef$current;
|
|
49
56
|
|
|
57
|
+
parts_chatContainer_config_useValidateProps.useValidateProps(props, ChatContainerWithSchema.toJSON());
|
|
50
58
|
var sendingText = props.sendingText,
|
|
51
59
|
sendingMessages = props.sendingMessages,
|
|
52
60
|
bannerPosition = props.bannerPosition,
|
|
@@ -119,7 +127,8 @@ var ChatContainer = function ChatContainer(props) {
|
|
|
119
127
|
lineOnly: true
|
|
120
128
|
})) : null), /*#__PURE__*/React__default['default'].createElement(parts_chatComposer_ChatContainerComposer.ChatComposer, _extends__default['default']({}, composerProps, {
|
|
121
129
|
onResize: onResize,
|
|
122
|
-
maxHeight: (((_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.clientHeight) || 0) / 2
|
|
130
|
+
maxHeight: (((_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.clientHeight) || 0) / 2,
|
|
131
|
+
actionRef: actionRef || listRef
|
|
123
132
|
})));
|
|
124
133
|
};
|
|
125
134
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatContainer.js","sources":["../../../../src/parts/chat-container/ChatContainer.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"ChatContainer.js","sources":["../../../../src/parts/chat-container/ChatContainer.tsx"],"sourcesContent":["/* eslint-disable complexity */\nimport React from 'react';\nimport { noop } from 'lodash';\nimport { describe } from 'react-desc';\nimport DSIndeterminateProgressIndicator from '@elliemae/ds-basic/IndeterminateProgressIndicator';\nimport DSBanner, { BANNER_TYPES } from '@elliemae/ds-banner';\nimport { ChatComposer } from '../chat-composer';\nimport { ChatContainerMessagesList } from '../chat-container-messages-list';\nimport { ChatContainerProps, defaultProps, containerProps } from './props';\nimport { StyledChatContainerContent, StyledIndicatorContainer, MobileStyledChatContainerContent } from './styled';\nimport { useValidateProps } from './config/useValidateProps';\n\nconst ChatContainer = (props: ChatContainerProps): JSX.Element => {\n useValidateProps(props, ChatContainerWithSchema.toJSON());\n\n const {\n sendingText,\n sendingMessages,\n bannerPosition,\n bannerProps,\n messagesListProps,\n composerProps,\n composerProps: { onResize: onComposerResize },\n actionRef,\n autoScroll,\n device,\n isLoading,\n hasMoreItems,\n getMoreMessages,\n } = props;\n\n const containerRef = React.useRef<HTMLElement>();\n const listRef = React.useRef({ scrollToIndex: noop });\n const onResize = React.useCallback(\n (height: number) => {\n if (onComposerResize) onComposerResize(height);\n if (autoScroll) {\n listRef.current.scrollToIndex(messagesListProps.messages.length - 1, {\n align: 'end',\n });\n }\n },\n [onComposerResize, messagesListProps.messages, autoScroll],\n );\n const Container = device === 'desktop' ? StyledChatContainerContent : MobileStyledChatContainerContent;\n\n return (\n <Container rows={['minmax(0, 1fr)', 'auto']} ref={containerRef} role=\"region\" aria-label=\"chat window\">\n <div style={{ position: 'relative' }}>\n <ChatContainerMessagesList\n {...messagesListProps}\n actionRef={actionRef || listRef}\n isLoading={isLoading}\n hasMoreItems={hasMoreItems}\n getMoreMessages={getMoreMessages}\n sendingMessages={sendingMessages}\n sendingText={sendingText}\n />\n {['top', 'bottom'].includes(isLoading) ? (\n <StyledIndicatorContainer isLoading={isLoading}>\n <DSIndeterminateProgressIndicator processing title=\"Loading\" />\n </StyledIndicatorContainer>\n ) : null}\n {['top', 'bottom'].includes(bannerPosition) ? (\n <StyledIndicatorContainer isLoading={bannerPosition}>\n <DSBanner\n showCloseButton\n label={bannerProps.label || 'Unread messages'}\n containerProps={{ id: 'ds-chat-banner' }}\n actionLink={{\n label: bannerProps.viewLabel || 'View',\n onClick: bannerProps.onView,\n }}\n onClose={bannerProps.onClose}\n isOpen\n type={BANNER_TYPES.INFO}\n />\n </StyledIndicatorContainer>\n ) : null}\n {sendingMessages && sendingMessages.length > 0 ? (\n <StyledIndicatorContainer isLoading=\"bottom\" linear>\n <DSIndeterminateProgressIndicator processing title=\"Loading\" lineOnly />\n </StyledIndicatorContainer>\n ) : null}\n </div>\n <ChatComposer\n {...composerProps}\n onResize={onResize}\n maxHeight={(containerRef.current?.clientHeight || 0) / 2}\n actionRef={actionRef || listRef}\n />\n </Container>\n );\n};\n\nChatContainer.propTypes = containerProps;\nChatContainer.defaultProps = defaultProps;\nconst ChatContainerWithSchema = describe(ChatContainer);\nChatContainerWithSchema.propTypes = containerProps;\n\nexport { ChatContainer, ChatContainerWithSchema };\n"],"names":["ChatContainer","props","useValidateProps","ChatContainerWithSchema","toJSON","sendingText","sendingMessages","bannerPosition","bannerProps","messagesListProps","composerProps","onComposerResize","onResize","actionRef","autoScroll","device","isLoading","hasMoreItems","getMoreMessages","containerRef","React","useRef","listRef","scrollToIndex","noop","useCallback","height","current","messages","length","align","Container","StyledChatContainerContent","MobileStyledChatContainerContent","position","ChatContainerMessagesList","includes","StyledIndicatorContainer","DSIndeterminateProgressIndicator","DSBanner","label","id","viewLabel","onClick","onView","onClose","BANNER_TYPES","INFO","ChatComposer","clientHeight","propTypes","containerProps","defaultProps","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAYMA,aA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AAZ,IAAyB,MADtB;AAEVC,MAAAA,OAAO,EAAEnC,WAAW,CAACoC;AAFX,KAJd;AAQE,IAAA,OAAO,EAAEpC,WAAW,CAACqC,OARvB;AASE,IAAA,MAAM,MATR;AAUE,IAAA,IAAI,EAAEC,qBAAY,CAACC;AAVrB,IADF,CADD,GAeG,IA9BN,EA+BGzC,eAAe,IAAIA,eAAe,CAACuB,MAAhB,GAAyB,CAA5C,gBACCT,wCAACiB,mDAAD;AAA0B,IAAA,SAAS,EAAC,QAApC;AAA6C,IAAA,MAAM;AAAnD,kBACEjB,wCAACkB,oDAAD;AAAkC,IAAA,UAAU,MAA5C;AAA6C,IAAA,KAAK,EAAC,SAAnD;AAA6D,IAAA,QAAQ;AAArE,IADF,CADD,GAIG,IAnCN,CADF,eAsCElB,wCAAC4B,qDAAD,mCACMtC,aADN;AAEE,IAAA,QAAQ,EAAEE,QAFZ;AAGE,IAAA,SAAS,EAAE,CAAC,0BAAAO,YAAY,CAACQ,OAAb,gFAAsBsB,YAAtB,KAAsC,CAAvC,IAA4C,CAHzD;AAIE,IAAA,SAAS,EAAEpC,SAAS,IAAIS;AAJ1B,KAtCF,CADF;AA+CD;;AAEDtB,aAAa,CAACkD,SAAd,GAA0BC,wCAA1B;AACAnD,aAAa,CAACoD,YAAd,GAA6BA,sCAA7B;IACMjD,uBAAuB,GAAGkD,kBAAQ,CAACrD,aAAD;AACxCG,uBAAuB,CAAC+C,SAAxB,GAAoCC,wCAApC;;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
6
|
+
|
|
7
|
+
var useValidateProps = function useValidateProps(props, schema) {
|
|
8
|
+
dsPropsHelpers.useValidatePropTypes(props, schema);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
exports.useValidateProps = useValidateProps;
|
|
12
|
+
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useValidateProps.js","sources":["../../../../../src/parts/chat-container/config/useValidateProps.tsx"],"sourcesContent":["import { useValidatePropTypes } from '@elliemae/ds-props-helpers';\nimport { ChatContainerProps } from '../props';\n\nexport const useValidateProps = (props: ChatContainerProps, schema: unknown): void => {\n useValidatePropTypes(props, schema);\n};\n"],"names":["useValidateProps","props","schema","useValidatePropTypes"],"mappings":";;;;;;IAGaA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAA4BC,MAA5B,EAAsD;AACpFC,EAAAA,mCAAoB,CAACF,KAAD,EAAQC,MAAR,CAApB;AACD;;;;"}
|
|
@@ -17,6 +17,8 @@ require('@elliemae/ds-icons/PaperAirplane');
|
|
|
17
17
|
require('../chat-composer/styled.js');
|
|
18
18
|
require('styled-components');
|
|
19
19
|
require('@elliemae/ds-button');
|
|
20
|
+
require('../chat-composer/config/useValidateProps.js');
|
|
21
|
+
require('@elliemae/ds-props-helpers');
|
|
20
22
|
require('../chat-composer/props.js');
|
|
21
23
|
require('../chat-container-messages-list/ChatContainerMessagesList.js');
|
|
22
24
|
require('react-virtual');
|
|
@@ -26,17 +28,22 @@ require('@elliemae/ds-icons/WarningCircleFill');
|
|
|
26
28
|
require('../bubble/styled.js');
|
|
27
29
|
require('../bubble/props.js');
|
|
28
30
|
require('prop-types');
|
|
31
|
+
require('../bubble/config/useValidateProps.js');
|
|
29
32
|
require('../bubble/ChatBubbleArrow.js');
|
|
30
33
|
require('../message-delimiter/MessageDelimiter.js');
|
|
31
34
|
require('../message-delimiter/styled.js');
|
|
32
35
|
require('../message-delimiter/props.js');
|
|
36
|
+
require('../message-delimiter/config/useValidateProps.js');
|
|
33
37
|
require('../system-message/SystemMessage.js');
|
|
34
38
|
require('../system-message/style.js');
|
|
35
39
|
require('../system-message/props.js');
|
|
40
|
+
require('../system-message/config/useValidateProps.js');
|
|
36
41
|
require('../chat-container-messages-list/styled.js');
|
|
37
42
|
require('../chat-container-messages-list/props.js');
|
|
43
|
+
require('../chat-container-messages-list/config/useValidateProps.js');
|
|
38
44
|
require('./props.js');
|
|
39
45
|
require('./styled.js');
|
|
46
|
+
require('./config/useValidateProps.js');
|
|
40
47
|
|
|
41
48
|
|
|
42
49
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -10,7 +10,7 @@ var parts_chatComposer_props = require('../chat-composer/props.js');
|
|
|
10
10
|
var defaultProps = {
|
|
11
11
|
messagesListProps: parts_chatContainerMessagesList_props.defaultProps,
|
|
12
12
|
composerProps: parts_chatComposer_props.defaultComposerPros,
|
|
13
|
-
actionRef:
|
|
13
|
+
actionRef: undefined,
|
|
14
14
|
autoScroll: false,
|
|
15
15
|
device: 'desktop',
|
|
16
16
|
isLoading: undefined,
|
|
@@ -37,7 +37,8 @@ var containerProps = {
|
|
|
37
37
|
bannerPosition: reactDesc.PropTypes.oneOf(['top', 'bottom', undefined]).description('Show Loading messages indicator at the `top` or `bottom` of the container'),
|
|
38
38
|
bannerProps: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.object).description('Banner configuration').defaultValue(defaultProps.bannerProps),
|
|
39
39
|
sendingMessages: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.number])).description('Array of ids of sending messages').defaultValue(defaultProps.sendingMessages),
|
|
40
|
-
sendingText: reactDesc.PropTypes.string.description('Label description for messages in sending status').defaultValue(defaultProps.sendingText)
|
|
40
|
+
sendingText: reactDesc.PropTypes.string.description('Label description for messages in sending status').defaultValue(defaultProps.sendingText),
|
|
41
|
+
actionRef: reactDesc.PropTypes.object.description("Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n ").defaultValue(defaultProps.actionRef)
|
|
41
42
|
};
|
|
42
43
|
|
|
43
44
|
exports.containerProps = containerProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sources":["../../../../src/parts/chat-container/props.ts"],"sourcesContent":["import { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\nimport {\n ChatContainerMessagesListProps,\n defaultProps as defaultListProps,\n} from '../chat-container-messages-list/props';\nimport { defaultComposerPros, ChatComposerProps } from '../chat-composer/props';\n\ninterface ChatBannerProps {\n label: string;\n viewLabel: string;\n onView: () => void;\n onClose: () => void;\n}\nexport interface ChatContainerProps {\n messagesListProps: Pick<ChatContainerMessagesListProps, 'messages' | 'onScrollEnds'>;\n composerProps: ChatComposerProps;\n actionRef: PropTypes.func;\n autoScroll: boolean;\n device: 'desktop' | 'mobile';\n isLoading?: 'top' | 'bottom';\n hasMoreItems?: 'top' | 'bottom';\n getMoreMessages: PropTypes.func;\n bannerPosition?: 'top' | 'bottom';\n bannerProps?: ChatBannerProps;\n sendingMessages?: string[] | number[];\n sendingText: string;\n}\n\nexport const defaultProps: ChatContainerProps = {\n messagesListProps: defaultListProps,\n composerProps: defaultComposerPros,\n actionRef:
|
|
1
|
+
{"version":3,"file":"props.js","sources":["../../../../src/parts/chat-container/props.ts"],"sourcesContent":["import { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\nimport {\n ChatContainerMessagesListProps,\n defaultProps as defaultListProps,\n} from '../chat-container-messages-list/props';\nimport { defaultComposerPros, ChatComposerProps } from '../chat-composer/props';\n\ninterface ChatBannerProps {\n label: string;\n viewLabel: string;\n onView: () => void;\n onClose: () => void;\n}\nexport interface ChatContainerProps {\n messagesListProps: Pick<ChatContainerMessagesListProps, 'messages' | 'onScrollEnds'>;\n composerProps: ChatComposerProps;\n actionRef: PropTypes.func;\n autoScroll: boolean;\n device: 'desktop' | 'mobile';\n isLoading?: 'top' | 'bottom';\n hasMoreItems?: 'top' | 'bottom';\n getMoreMessages: PropTypes.func;\n bannerPosition?: 'top' | 'bottom';\n bannerProps?: ChatBannerProps;\n sendingMessages?: string[] | number[];\n sendingText: string;\n}\n\nexport const defaultProps: ChatContainerProps = {\n messagesListProps: defaultListProps,\n composerProps: defaultComposerPros,\n actionRef: undefined,\n autoScroll: false,\n device: 'desktop',\n isLoading: undefined,\n hasMoreItems: undefined,\n getMoreMessages: noop,\n bannerPosition: undefined,\n bannerProps: {\n label: 'Unread Messages',\n viewLabel: 'View',\n onView: noop,\n onClose: noop,\n },\n sendingMessages: undefined,\n sendingText: 'Sending',\n};\n\nexport const containerProps = {\n messagesListProps: PropTypes.arrayOf(PropTypes.object)\n .description('ChatMessageList props \"messages\" / \"onScrollEnds\"')\n .defaultValue(defaultProps.messagesListProps),\n composerProps: PropTypes.arrayOf(PropTypes.object)\n .description('Composer configuration')\n .defaultValue(defaultProps.composerProps),\n autoScroll: PropTypes.bool.description('Auto scroll to bottom on resize').defaultValue(defaultProps.autoScroll),\n device: PropTypes.string\n .description('Option to render mobile or desktop style composer')\n .defaultValue(defaultProps.device),\n isLoading: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Loading messages indicator at the `top` or `bottom` of the container',\n ),\n hasMoreItems: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Load More button at the `top` or `bottom` of the container',\n ),\n getMoreMessages: PropTypes.func\n .description('Called when the user clicks on load more')\n .defaultValue(defaultProps.getMoreMessages),\n bannerPosition: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Loading messages indicator at the `top` or `bottom` of the container',\n ),\n bannerProps: PropTypes.arrayOf(PropTypes.object)\n .description('Banner configuration')\n .defaultValue(defaultProps.bannerProps),\n sendingMessages: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n .description('Array of ids of sending messages')\n .defaultValue(defaultProps.sendingMessages),\n sendingText: PropTypes.string\n .description('Label description for messages in sending status')\n .defaultValue(defaultProps.sendingText),\n actionRef: PropTypes.object\n .description(\n `Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n `,\n )\n .defaultValue(defaultProps.actionRef),\n};\n"],"names":["defaultProps","messagesListProps","defaultListProps","composerProps","defaultComposerPros","actionRef","undefined","autoScroll","device","isLoading","hasMoreItems","getMoreMessages","noop","bannerPosition","bannerProps","label","viewLabel","onView","onClose","sendingMessages","sendingText","containerProps","PropTypes","arrayOf","object","description","defaultValue","bool","string","oneOf","func","oneOfType","number"],"mappings":";;;;;;;;;IA6BaA,YAAgC,GAAG;AAC9CC,EAAAA,iBAAiB,EAAEC,kDAD2B;AAE9CC,EAAAA,aAAa,EAAEC,4CAF+B;AAG9CC,EAAAA,SAAS,EAAEC,SAHmC;AAI9CC,EAAAA,UAAU,EAAE,KAJkC;AAK9CC,EAAAA,MAAM,EAAE,SALsC;AAM9CC,EAAAA,SAAS,EAAEH,SANmC;AAO9CI,EAAAA,YAAY,EAAEJ,SAPgC;AAQ9CK,EAAAA,eAAe,EAAEC,WAR6B;AAS9CC,EAAAA,cAAc,EAAEP,SAT8B;AAU9CQ,EAAAA,WAAW,EAAE;AACXC,IAAAA,KAAK,EAAE,iBADI;AAEXC,IAAAA,SAAS,EAAE,MAFA;AAGXC,IAAAA,MAAM,EAAEL,WAHG;AAIXM,IAAAA,OAAO,EAAEN;AAJE,GAViC;AAgB9CO,EAAAA,eAAe,EAAEb,SAhB6B;AAiB9Cc,EAAAA,WAAW,EAAE;AAjBiC;IAoBnCC,cAAc,GAAG;AAC5BpB,EAAAA,iBAAiB,EAAEqB,mBAAS,CAACC,OAAV,CAAkBD,mBAAS,CAACE,MAA5B,EAChBC,WADgB,C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BAAS,CAACM,MAAX,EAAmBN,mBAAS,CAACU,MAA7B,CAApB,CAAlB,EACdP,WADc,CACF,kCADE,EAEdC,YAFc,CAED1B,YAAY,CAACmB,eAFZ,CA1BW;AA6B5BC,EAAAA,WAAW,EAAEE,mBAAS,CAACM,MAAV,CACVH,WADU,CACE,kDADF,EAEVC,YAFU,CAEG1B,YAAY,CAACoB,WAFhB,CA7Be;AAgC5Bf,EAAAA,SAAS,EAAEiB,mBAAS,CAACE,MAAV,CACRC,WADQ,oTAcRC,YAdQ,CAcK1B,YAAY,CAACK,SAdlB;AAhCiB;;;;;"}
|
|
@@ -5,11 +5,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var styled = require('styled-components');
|
|
6
6
|
var dsGrid = require('@elliemae/ds-grid');
|
|
7
7
|
var parts_bubble_styled = require('../bubble/styled.js');
|
|
8
|
+
var parts_chatComposer_styled = require('../chat-composer/styled.js');
|
|
8
9
|
var parts_systemMessage_style = require('../system-message/style.js');
|
|
9
10
|
require('../bubble/props.js');
|
|
10
11
|
require('prop-types');
|
|
11
12
|
require('react-desc');
|
|
12
13
|
require('lodash');
|
|
14
|
+
require('@elliemae/ds-button');
|
|
13
15
|
|
|
14
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
17
|
|
|
@@ -40,7 +42,7 @@ var StyledIndicatorContainer = /*#__PURE__*/styled__default['default'].div.withC
|
|
|
40
42
|
});
|
|
41
43
|
var MobileStyledChatContainerContent = /*#__PURE__*/styled__default['default'](StyledChatContainerContent).withConfig({
|
|
42
44
|
componentId: "sc-d732wo-2"
|
|
43
|
-
})(["", ",", "{font-size:16px;}", "{font-size:13px;}", "{background-color:#fff;box-shadow:-0 1px 3px rgba(53,60,70,0.8);}", ",", "{font-size:16px;text-align:left;}", "{font-size:13px;}"], parts_bubble_styled.StyledTitleLeftBubble, parts_bubble_styled.StyleBodyWrapper, parts_bubble_styled.StyledTitleRightBubble, parts_systemMessage_style.Wrapper, parts_systemMessage_style.Title, parts_systemMessage_style.Message, parts_systemMessage_style.Time);
|
|
45
|
+
})(["", ",", "{font-size:16px;}", "{font-size:13px;}", "{background-color:#fff;box-shadow:-0 1px 3px rgba(53,60,70,0.8);}", ",", "{font-size:16px;text-align:left;}", "{font-size:13px;}", "{font-size:16px;}"], parts_bubble_styled.StyledTitleLeftBubble, parts_bubble_styled.StyleBodyWrapper, parts_bubble_styled.StyledTitleRightBubble, parts_systemMessage_style.Wrapper, parts_systemMessage_style.Title, parts_systemMessage_style.Message, parts_systemMessage_style.Time, parts_chatComposer_styled.StyledComposerInput);
|
|
44
46
|
|
|
45
47
|
exports.CONTAINER_WIDTH = CONTAINER_WIDTH;
|
|
46
48
|
exports.MobileStyledChatContainerContent = MobileStyledChatContainerContent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","sources":["../../../../src/parts/chat-container/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\nimport { StyledTitleRightBubble, StyledTitleLeftBubble, StyleBodyWrapper } from '../bubble/styled';\nimport { Wrapper, Title, Time, Message } from '../system-message/style';\nexport const CONTAINER_WIDTH = 300;\n\nexport const StyledChatContainerContent = styled(Grid)`\n height: 100%;\n min-width: ${CONTAINER_WIDTH}px;\n overflow: hidden;\n background: ${(props) => props.theme.colors.neutral['050']};\n position: relative;\n`;\nexport const StyledIndicatorContainer = styled.div<{\n isLoading?: 'top' | 'bottom';\n linear?: boolean;\n}>`\n position: absolute;\n width: calc(100% + ${(props) => props.theme.space.xxs});\n padding: ${(props) => (!props.linear ? props.theme.space.xxs : 0)};\n left: -${(props) => props.theme.space.xxs};\n right: -${(props) => props.theme.space.xxs};\n background: ${(props) => props.theme.colors.neutral['000']};\n ${(props) => (props.isLoading === 'top' ? 'top: 0;' : '')}\n ${(props) => (props.isLoading === 'bottom' ? 'bottom: 0;' : '')}\n`;\n\nexport const MobileStyledChatContainerContent = styled(StyledChatContainerContent)`\n ${StyledTitleLeftBubble},\n ${StyleBodyWrapper} {\n font-size: 16px;\n }\n\n ${StyledTitleRightBubble} {\n font-size: 13px;\n }\n\n ${Wrapper} {\n background-color: #fff;\n box-shadow: -0 1px 3px rgba(53, 60, 70, 0.8);\n }\n\n ${Title},\n ${Message} {\n font-size: 16px;\n text-align: left;\n }\n\n ${Time} {\n font-size: 13px;\n }\n`;\n"],"names":["CONTAINER_WIDTH","StyledChatContainerContent","styled","Grid","props","theme","colors","neutral","StyledIndicatorContainer","div","space","xxs","linear","isLoading","MobileStyledChatContainerContent","StyledTitleLeftBubble","StyleBodyWrapper","StyledTitleRightBubble","Wrapper","Title","Message","Time"],"mappings":"
|
|
1
|
+
{"version":3,"file":"styled.js","sources":["../../../../src/parts/chat-container/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\nimport { StyledTitleRightBubble, StyledTitleLeftBubble, StyleBodyWrapper } from '../bubble/styled';\nimport { StyledComposerInput } from '../chat-composer/styled';\nimport { Wrapper, Title, Time, Message } from '../system-message/style';\nexport const CONTAINER_WIDTH = 300;\n\nexport const StyledChatContainerContent = styled(Grid)`\n height: 100%;\n min-width: ${CONTAINER_WIDTH}px;\n overflow: hidden;\n background: ${(props) => props.theme.colors.neutral['050']};\n position: relative;\n`;\nexport const StyledIndicatorContainer = styled.div<{\n isLoading?: 'top' | 'bottom';\n linear?: boolean;\n}>`\n position: absolute;\n width: calc(100% + ${(props) => props.theme.space.xxs});\n padding: ${(props) => (!props.linear ? props.theme.space.xxs : 0)};\n left: -${(props) => props.theme.space.xxs};\n right: -${(props) => props.theme.space.xxs};\n background: ${(props) => props.theme.colors.neutral['000']};\n ${(props) => (props.isLoading === 'top' ? 'top: 0;' : '')}\n ${(props) => (props.isLoading === 'bottom' ? 'bottom: 0;' : '')}\n`;\n\nexport const MobileStyledChatContainerContent = styled(StyledChatContainerContent)`\n ${StyledTitleLeftBubble},\n ${StyleBodyWrapper} {\n font-size: 16px;\n }\n\n ${StyledTitleRightBubble} {\n font-size: 13px;\n }\n\n ${Wrapper} {\n background-color: #fff;\n box-shadow: -0 1px 3px rgba(53, 60, 70, 0.8);\n }\n\n ${Title},\n ${Message} {\n font-size: 16px;\n text-align: left;\n }\n\n ${Time} {\n font-size: 13px;\n }\n\n ${StyledComposerInput} {\n font-size: 16px;\n }\n`;\n"],"names":["CONTAINER_WIDTH","StyledChatContainerContent","styled","Grid","props","theme","colors","neutral","StyledIndicatorContainer","div","space","xxs","linear","isLoading","MobileStyledChatContainerContent","StyledTitleLeftBubble","StyleBodyWrapper","StyledTitleRightBubble","Wrapper","Title","Message","Time","StyledComposerInput"],"mappings":";;;;;;;;;;;;;;;;;;;IAKaA,eAAe,GAAG;IAElBC,0BAA0B,gBAAGC,0BAAM,CAACC,WAAD,CAAT;AAAA;AAAA,wFAExBH,eAFwB,EAIvB,UAACI,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBC,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CAJuB;IAO1BC,wBAAwB,gBAAGN,0BAAM,CAACO,GAAV;AAAA;AAAA,gHAKd,UAACL,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYK,KAAZ,CAAkBC,GAA7B;AAAA,CALc,EAMxB,UAACP,KAAD;AAAA,SAAY,CAACA,KAAK,CAACQ,MAAP,GAAgBR,KAAK,CAACC,KAAN,CAAYK,KAAZ,CAAkBC,GAAlC,GAAwC,CAApD;AAAA,CANwB,EAO1B,UAACP,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYK,KAAZ,CAAkBC,GAA7B;AAAA,CAP0B,EAQzB,UAACP,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYK,KAAZ,CAAkBC,GAA7B;AAAA,CARyB,EASrB,UAACP,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBC,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CATqB,EAUjC,UAACH,KAAD;AAAA,SAAYA,KAAK,CAACS,SAAN,KAAoB,KAApB,GAA4B,SAA5B,GAAwC,EAApD;AAAA,CAViC,EAWjC,UAACT,KAAD;AAAA,SAAYA,KAAK,CAACS,SAAN,KAAoB,QAApB,GAA+B,YAA/B,GAA8C,EAA1D;AAAA,CAXiC;IAcxBC,gCAAgC,gBAAGZ,0BAAM,CAACD,0BAAD,CAAT;AAAA;AAAA,iNACzCc,yCADyC,EAEzCC,oCAFyC,EAMzCC,0CANyC,EAUzCC,iCAVyC,EAezCC,+BAfyC,EAgBzCC,iCAhByC,EAqBzCC,8BArByC,EAyBzCC,6CAzByC;;;;;;;"}
|
|
@@ -14,17 +14,22 @@ var parts_messageDelimiter_MessageDelimiter = require('../message-delimiter/Mess
|
|
|
14
14
|
var parts_systemMessage_SystemMessage = require('../system-message/SystemMessage.js');
|
|
15
15
|
var parts_chatContainerMessagesList_styled = require('./styled.js');
|
|
16
16
|
var parts_chatContainerMessagesList_props = require('./props.js');
|
|
17
|
+
var parts_chatContainerMessagesList_config_useValidateProps = require('./config/useValidateProps.js');
|
|
17
18
|
require('@elliemae/ds-icons/WarningCircleFill');
|
|
18
19
|
require('../bubble/styled.js');
|
|
19
20
|
require('styled-components');
|
|
20
21
|
require('@elliemae/ds-grid');
|
|
22
|
+
require('../bubble/config/useValidateProps.js');
|
|
23
|
+
require('@elliemae/ds-props-helpers');
|
|
21
24
|
require('../bubble/ChatBubbleArrow.js');
|
|
22
25
|
require('prop-types');
|
|
23
26
|
require('lodash');
|
|
24
27
|
require('../message-delimiter/styled.js');
|
|
25
28
|
require('../message-delimiter/props.js');
|
|
29
|
+
require('../message-delimiter/config/useValidateProps.js');
|
|
26
30
|
require('../system-message/style.js');
|
|
27
31
|
require('../system-message/props.js');
|
|
32
|
+
require('../system-message/config/useValidateProps.js');
|
|
28
33
|
|
|
29
34
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
30
35
|
|
|
@@ -47,6 +52,7 @@ var getPadding = function getPadding(hasMoreItems) {
|
|
|
47
52
|
};
|
|
48
53
|
|
|
49
54
|
var ChatContainerMessagesList = function ChatContainerMessagesList(props) {
|
|
55
|
+
parts_chatContainerMessagesList_config_useValidateProps.useValidateProps(props, ChatContainerMessagesListWithSchema.toJSON());
|
|
50
56
|
var sendingText = props.sendingText,
|
|
51
57
|
sendingMessages = props.sendingMessages,
|
|
52
58
|
messages = props.messages,
|
|
@@ -87,17 +93,65 @@ var ChatContainerMessagesList = function ChatContainerMessagesList(props) {
|
|
|
87
93
|
if (onScrollEnds) onScrollEnds(indexList);
|
|
88
94
|
return indexList;
|
|
89
95
|
}, [onScrollEnds]);
|
|
90
|
-
React__default['default'].
|
|
91
|
-
|
|
92
|
-
|
|
96
|
+
var scrollAndFocus = React__default['default'].useCallback(function (index) {
|
|
97
|
+
vScroll(index, {
|
|
98
|
+
align: 'center'
|
|
99
|
+
});
|
|
100
|
+
setTimeout(function () {
|
|
101
|
+
virtualListRef.current.querySelector("[data-index=\"".concat(index, "\"]")).focus();
|
|
102
|
+
}, 300);
|
|
103
|
+
}, [vScroll]);
|
|
104
|
+
React__default['default'].useEffect(function () {
|
|
105
|
+
if (actionRef && actionRef.current) {
|
|
106
|
+
actionRef.current.scrollToIndex = function (a) {
|
|
93
107
|
var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
94
108
|
align: 'center'
|
|
95
109
|
};
|
|
96
110
|
vScroll(a, b);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
actionRef.current.getMessagesInView = onScrollStop;
|
|
114
|
+
|
|
115
|
+
actionRef.current.focusToIndex = function (a) {
|
|
116
|
+
scrollAndFocus(a);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
actionRef.current.focusToList = function (a) {
|
|
120
|
+
var _virtualListRef$curre2;
|
|
121
|
+
(_virtualListRef$curre2 = virtualListRef.current) === null || _virtualListRef$curre2 === void 0 ? void 0 : _virtualListRef$curre2.focus();
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
}, [actionRef, onScrollStop, scrollAndFocus, vScroll]);
|
|
125
|
+
var handleKey = React__default['default'].useCallback(function (e) {
|
|
126
|
+
e.preventDefault();
|
|
127
|
+
var key = e.key;
|
|
128
|
+
var index = Number(e.currentTarget.dataset.index);
|
|
129
|
+
|
|
130
|
+
switch (key) {
|
|
131
|
+
case 'ArrowUp':
|
|
132
|
+
if (index > 0) virtualListRef.current.querySelector("[data-index=\"".concat(index - 1, "\"]")).focus();
|
|
133
|
+
break;
|
|
134
|
+
|
|
135
|
+
case 'ArrowDown':
|
|
136
|
+
if (index < messages.length - 1) {
|
|
137
|
+
virtualListRef.current.querySelector("[data-index=\"".concat(index + 1, "\"]")).focus();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
break;
|
|
141
|
+
|
|
142
|
+
case 'Home':
|
|
143
|
+
scrollAndFocus(0);
|
|
144
|
+
break;
|
|
145
|
+
|
|
146
|
+
case 'End':
|
|
147
|
+
scrollAndFocus(messages.length - 1);
|
|
148
|
+
break;
|
|
149
|
+
|
|
150
|
+
case 'Tab':
|
|
151
|
+
actionRef.current.focusToComposer();
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
}, [actionRef, messages.length, scrollAndFocus]);
|
|
101
155
|
React__default['default'].useEffect(function () {
|
|
102
156
|
var handlerCallback = null;
|
|
103
157
|
var localVirtualRef = virtualListRef.current;
|
|
@@ -132,12 +186,15 @@ var ChatContainerMessagesList = function ChatContainerMessagesList(props) {
|
|
|
132
186
|
transform: "translateY(".concat(start, "px)"),
|
|
133
187
|
width: '100%'
|
|
134
188
|
};
|
|
135
|
-
return /*#__PURE__*/React__default['default'].createElement(
|
|
189
|
+
return /*#__PURE__*/React__default['default'].createElement(parts_chatContainerMessagesList_styled.ListItem, {
|
|
136
190
|
"data-element": "chat-element-list-item",
|
|
137
191
|
"data-index": index,
|
|
138
192
|
key: "ds-chat-bubble-".concat(index),
|
|
139
193
|
style: style,
|
|
140
|
-
ref: measureRef
|
|
194
|
+
ref: measureRef,
|
|
195
|
+
tabIndex: 0,
|
|
196
|
+
onKeyDown: handleKey,
|
|
197
|
+
role: "listitem"
|
|
141
198
|
}, /*#__PURE__*/React__default['default'].createElement(parts_chatContainerMessagesList_styled.StyledWrapperListItem, {
|
|
142
199
|
type: row.type
|
|
143
200
|
}, row.type === parts_bubble_props.BUBBLE_TYPES.SENDER || row.type === parts_bubble_props.BUBBLE_TYPES.RECIPIENT ?
|
|
@@ -147,12 +204,14 @@ var ChatContainerMessagesList = function ChatContainerMessagesList(props) {
|
|
|
147
204
|
helpMessage: isSending ? sendingText : row.helpMessage
|
|
148
205
|
})) : null, row.type === parts_bubble_props.BUBBLE_TYPES.DELIMITER ? /*#__PURE__*/React__default['default'].createElement(parts_messageDelimiter_MessageDelimiter.MessageDelimiter, row) : null, row.type === parts_bubble_props.BUBBLE_TYPES.SYSTEM ? /*#__PURE__*/React__default['default'].createElement(parts_systemMessage_SystemMessage.SystemMessage, row) : null));
|
|
149
206
|
});
|
|
150
|
-
}, [virtualItems, messages, sendingMessages]);
|
|
207
|
+
}, [virtualItems, messages, sendingMessages, handleKey, sendingText]);
|
|
151
208
|
return /*#__PURE__*/React__default['default'].createElement(parts_chatContainerMessagesList_styled.StyledWrapper, null, /*#__PURE__*/React__default['default'].createElement(parts_chatContainerMessagesList_styled.StyledChatContainerContentList, {
|
|
152
209
|
"data-testid": "chat-thread-container",
|
|
153
210
|
tabIndex: 0,
|
|
154
211
|
"aria-live": "polite",
|
|
155
|
-
ref: virtualListRef
|
|
212
|
+
ref: virtualListRef,
|
|
213
|
+
role: "list",
|
|
214
|
+
onKeyDown: handleKey
|
|
156
215
|
}, /*#__PURE__*/React__default['default'].createElement(parts_chatContainerMessagesList_styled.StyledChatContainerContentListScroll, {
|
|
157
216
|
height: "".concat(totalSize, "px")
|
|
158
217
|
}, render, !isLoading && hasMoreItems ? /*#__PURE__*/React__default['default'].createElement(parts_chatContainerMessagesList_styled.StyledLoadMoreContainer, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatContainerMessagesList.js","sources":["../../../../src/parts/chat-container-messages-list/ChatContainerMessagesList.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React, { CSSProperties } from 'react';\nimport { describe } from 'react-desc';\nimport { useVirtual } from 'react-virtual';\nimport DSButton from '@elliemae/ds-basic/Button';\nimport { ChatBubble, BUBBLE_TYPES } from '../bubble';\nimport { MessageDelimiter } from '../message-delimiter';\nimport { SystemMessage } from '../system-message';\nimport {\n StyledWrapperListItem,\n StyledChatContainerContentList,\n StyledChatContainerContentListScroll,\n StyledWrapper,\n StyledLoadMoreContainer,\n} from './styled';\nimport { defaultProps, listProps, ChatContainerMessagesListProps } from './props';\n\nconst getPadding = (hasMoreItems) => {\n const padding = {\n paddingStart: 0,\n paddingEnd: -5,\n };\n if (hasMoreItems === 'top') padding.paddingStart = 42;\n else if (hasMoreItems === 'bottom') padding.paddingEnd = 42;\n return padding;\n};\n\nconst ChatContainerMessagesList = (props: ChatContainerMessagesListProps): JSX.Element => {\n const { sendingText, sendingMessages, messages, actionRef, onScrollEnds, getMoreMessages, hasMoreItems, isLoading } =\n props;\n const virtualListRef = React.useRef<HTMLDivElement>();\n // estimateSize should not be really required given what was stated on\n // https://github.com/tannerlinsley/react-virtual/issues/23\n const {\n scrollToIndex: vScroll,\n totalSize,\n virtualItems,\n } = useVirtual({\n size: messages.length,\n parentRef: virtualListRef,\n overscan: 15,\n ...getPadding(hasMoreItems),\n estimateSize: React.useCallback(() => 80, []),\n });\n\n const onScrollStop = React.useCallback((): number[] => {\n const { bottom, top } = virtualListRef.current.getBoundingClientRect();\n const list = virtualListRef.current.querySelectorAll(\n '[data-element=\"chat-element-list-item\"]',\n ) as NodeListOf<HTMLDivElement>;\n const indexList = [];\n list.forEach((item: HTMLDivElement) => {\n const { top: itemTop } = item.getBoundingClientRect();\n if (itemTop < bottom && itemTop > top) indexList.push(item.dataset.index);\n });\n if (onScrollEnds) onScrollEnds(indexList);\n return indexList;\n }, [onScrollEnds]);\n\n React.useImperativeHandle(actionRef, () => ({\n scrollToIndex: (a, b = { align: 'center' }) => {\n vScroll(a, b);\n },\n getMessagesInView: onScrollStop,\n }));\n\n React.useEffect(() => {\n let handlerCallback = null;\n const localVirtualRef = virtualListRef.current;\n const onScroll = () => {\n if (handlerCallback) clearTimeout(handlerCallback);\n handlerCallback = setTimeout(onScrollStop, 300);\n };\n if (onScrollEnds) {\n virtualListRef.current.addEventListener('scroll', onScroll);\n }\n return () => {\n if (handlerCallback) clearTimeout(handlerCallback);\n if (onScrollEnds) localVirtualRef.removeEventListener('scroll', onScroll);\n };\n }, [onScrollStop, onScrollEnds]);\n\n const render = React.useMemo(\n () =>\n virtualItems.map((virtualItem) => {\n const { index, measureRef, start } = virtualItem;\n const row = messages[index];\n const isSending = sendingMessages && sendingMessages.find((m) => m === row.dsId);\n const style: CSSProperties = {\n position: 'absolute',\n top: 0,\n left: 0,\n transform: `translateY(${start}px)`,\n width: '100%',\n };\n\n return (\n <div\n data-element=\"chat-element-list-item\"\n data-index={index}\n key={`ds-chat-bubble-${index}`}\n style={style}\n ref={measureRef}\n >\n <StyledWrapperListItem type={row.type}>\n {row.type === BUBBLE_TYPES.SENDER || row.type === BUBBLE_TYPES.RECIPIENT ? (\n // eslint-disable-next-line\n <ChatBubble {...(row as any)} helpMessage={isSending? sendingText : row.helpMessage }/>\n ) : null}\n {row.type === BUBBLE_TYPES.DELIMITER ? <MessageDelimiter {...(row as any)} /> : null}\n {row.type === BUBBLE_TYPES.SYSTEM ? <SystemMessage {...(row as any)} /> : null}\n </StyledWrapperListItem>\n </div>\n );\n }),\n [virtualItems, messages, sendingMessages],\n );\n\n return (\n <StyledWrapper>\n <StyledChatContainerContentList\n data-testid=\"chat-thread-container\"\n tabIndex={0}\n aria-live=\"polite\"\n ref={virtualListRef}\n >\n <StyledChatContainerContentListScroll height={`${totalSize}px`}>\n {render}\n {!isLoading && hasMoreItems ? (\n <StyledLoadMoreContainer hasMoreItems={hasMoreItems}>\n <DSButton labelText=\"Load More\" buttonType=\"secondary\" onClick={getMoreMessages} />\n </StyledLoadMoreContainer>\n ) : null}\n </StyledChatContainerContentListScroll>\n </StyledChatContainerContentList>\n </StyledWrapper>\n );\n};\n\nChatContainerMessagesList.propTypes = listProps;\nChatContainerMessagesList.defaultProps = defaultProps;\nconst ChatContainerMessagesListWithSchema = describe(ChatContainerMessagesList);\nChatContainerMessagesListWithSchema.propTypes = listProps;\n\nexport { ChatContainerMessagesList, ChatContainerMessagesListWithSchema };\n"],"names":["getPadding","hasMoreItems","padding","paddingStart","paddingEnd","ChatContainerMessagesList","props","sendingText","sendingMessages","messages","actionRef","onScrollEnds","getMoreMessages","isLoading","virtualListRef","React","useRef","useVirtual","size","length","parentRef","overscan","estimateSize","useCallback","vScroll","scrollToIndex","totalSize","virtualItems","onScrollStop","current","getBoundingClientRect","bottom","top","list","querySelectorAll","indexList","forEach","item","itemTop","push","dataset","index","useImperativeHandle","a","b","align","getMessagesInView","useEffect","handlerCallback","localVirtualRef","onScroll","clearTimeout","setTimeout","addEventListener","removeEventListener","render","useMemo","map","virtualItem","measureRef","start","row","isSending","find","m","dsId","style","position","left","transform","width","StyledWrapperListItem","type","BUBBLE_TYPES","SENDER","RECIPIENT","ChatBubble","helpMessage","DELIMITER","MessageDelimiter","SYSTEM","SystemMessage","StyledWrapper","StyledChatContainerContentList","StyledChatContainerContentListScroll","StyledLoadMoreContainer","DSButton","propTypes","listProps","defaultProps","ChatContainerMessagesListWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAACC,YAAD,EAAkB;AACnC,MAAMC,OAAO,GAAG;AACdC,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ApC,GAAgDC,+CAAhD;;;;;"}
|
|
1
|
+
{"version":3,"file":"ChatContainerMessagesList.js","sources":["../../../../src/parts/chat-container-messages-list/ChatContainerMessagesList.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-noninteractive-tabindex */\n/* eslint-disable max-lines */\nimport React, { CSSProperties } from 'react';\nimport { describe } from 'react-desc';\nimport { useVirtual } from 'react-virtual';\nimport DSButton from '@elliemae/ds-basic/Button';\nimport { ChatBubble, BUBBLE_TYPES } from '../bubble';\nimport { MessageDelimiter } from '../message-delimiter';\nimport { SystemMessage } from '../system-message';\nimport {\n StyledWrapperListItem,\n StyledChatContainerContentList,\n StyledChatContainerContentListScroll,\n StyledWrapper,\n StyledLoadMoreContainer,\n ListItem,\n} from './styled';\nimport { defaultProps, listProps, ChatContainerMessagesListProps } from './props';\nimport { useValidateProps } from './config/useValidateProps';\n\nconst getPadding = (hasMoreItems) => {\n const padding = {\n paddingStart: 0,\n paddingEnd: -5,\n };\n if (hasMoreItems === 'top') padding.paddingStart = 42;\n else if (hasMoreItems === 'bottom') padding.paddingEnd = 42;\n return padding;\n};\n\nconst ChatContainerMessagesList = (props: ChatContainerMessagesListProps): JSX.Element => {\n useValidateProps(props, ChatContainerMessagesListWithSchema.toJSON());\n\n const { sendingText, sendingMessages, messages, actionRef, onScrollEnds, getMoreMessages, hasMoreItems, isLoading } =\n props;\n const virtualListRef = React.useRef<HTMLDivElement>();\n // estimateSize should not be really required given what was stated on\n // https://github.com/tannerlinsley/react-virtual/issues/23\n const {\n scrollToIndex: vScroll,\n totalSize,\n virtualItems,\n } = useVirtual({\n size: messages.length,\n parentRef: virtualListRef,\n overscan: 15,\n ...getPadding(hasMoreItems),\n estimateSize: React.useCallback(() => 80, []),\n });\n\n const onScrollStop = React.useCallback((): number[] => {\n const { bottom, top } = virtualListRef.current.getBoundingClientRect();\n const list = virtualListRef.current.querySelectorAll(\n '[data-element=\"chat-element-list-item\"]',\n ) as NodeListOf<HTMLDivElement>;\n const indexList = [];\n list.forEach((item: HTMLDivElement) => {\n const { top: itemTop } = item.getBoundingClientRect();\n if (itemTop < bottom && itemTop > top) indexList.push(item.dataset.index);\n });\n if (onScrollEnds) onScrollEnds(indexList);\n return indexList;\n }, [onScrollEnds]);\n\n const scrollAndFocus = React.useCallback(\n (index: number) => {\n vScroll(index, { align: 'center' });\n setTimeout(() => {\n (virtualListRef.current.querySelector(`[data-index=\"${index}\"]`) as HTMLDivElement).focus();\n }, 300);\n },\n [vScroll],\n );\n\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.scrollToIndex = (a, b = { align: 'center' }) => {\n vScroll(a, b);\n };\n actionRef.current.getMessagesInView = onScrollStop;\n actionRef.current.focusToIndex = (a, b = { align: 'center' }) => {\n scrollAndFocus(a);\n };\n actionRef.current.focusToList = (a, b = { align: 'center' }) => {\n virtualListRef.current?.focus();\n };\n }\n }, [actionRef, onScrollStop, scrollAndFocus, vScroll]);\n\n const handleKey = React.useCallback(\n (e) => {\n e.preventDefault();\n const { key } = e;\n const index = Number(e.currentTarget.dataset.index);\n switch (key) {\n case 'ArrowUp':\n if (index > 0)\n (virtualListRef.current.querySelector(`[data-index=\"${index - 1}\"]`) as HTMLDivElement).focus();\n break;\n case 'ArrowDown':\n if (index < messages.length - 1) {\n (virtualListRef.current.querySelector(`[data-index=\"${index + 1}\"]`) as HTMLDivElement).focus();\n }\n break;\n case 'Home':\n scrollAndFocus(0);\n break;\n case 'End':\n scrollAndFocus(messages.length - 1);\n break;\n case 'Tab':\n actionRef.current.focusToComposer();\n break;\n default:\n break;\n }\n },\n [actionRef, messages.length, scrollAndFocus],\n );\n\n React.useEffect(() => {\n let handlerCallback = null;\n const localVirtualRef = virtualListRef.current;\n const onScroll = () => {\n if (handlerCallback) clearTimeout(handlerCallback);\n handlerCallback = setTimeout(onScrollStop, 300);\n };\n if (onScrollEnds) {\n virtualListRef.current.addEventListener('scroll', onScroll);\n }\n return () => {\n if (handlerCallback) clearTimeout(handlerCallback);\n if (onScrollEnds) localVirtualRef.removeEventListener('scroll', onScroll);\n };\n }, [onScrollStop, onScrollEnds]);\n\n const render = React.useMemo(\n () =>\n virtualItems.map((virtualItem) => {\n const { index, measureRef, start } = virtualItem;\n const row = messages[index];\n const isSending = sendingMessages && sendingMessages.find((m) => m === row.dsId);\n const style: CSSProperties = {\n position: 'absolute',\n top: 0,\n left: 0,\n transform: `translateY(${start}px)`,\n width: '100%',\n };\n\n return (\n <ListItem\n data-element=\"chat-element-list-item\"\n data-index={index}\n key={`ds-chat-bubble-${index}`}\n style={style}\n ref={measureRef}\n tabIndex={0}\n onKeyDown={handleKey}\n role=\"listitem\"\n >\n <StyledWrapperListItem type={row.type}>\n {row.type === BUBBLE_TYPES.SENDER || row.type === BUBBLE_TYPES.RECIPIENT ? (\n // eslint-disable-next-line\n <ChatBubble {...(row as any)} helpMessage={isSending ? sendingText : row.helpMessage} />\n ) : null}\n {row.type === BUBBLE_TYPES.DELIMITER ? <MessageDelimiter {...(row as any)} /> : null}\n {row.type === BUBBLE_TYPES.SYSTEM ? <SystemMessage {...(row as any)} /> : null}\n </StyledWrapperListItem>\n </ListItem>\n );\n }),\n [virtualItems, messages, sendingMessages, handleKey, sendingText],\n );\n\n return (\n <StyledWrapper>\n <StyledChatContainerContentList\n data-testid=\"chat-thread-container\"\n tabIndex={0}\n aria-live=\"polite\"\n ref={virtualListRef}\n role=\"list\"\n onKeyDown={handleKey}\n >\n <StyledChatContainerContentListScroll height={`${totalSize}px`}>\n {render}\n {!isLoading && hasMoreItems ? (\n <StyledLoadMoreContainer hasMoreItems={hasMoreItems}>\n <DSButton labelText=\"Load More\" buttonType=\"secondary\" onClick={getMoreMessages} />\n </StyledLoadMoreContainer>\n ) : null}\n </StyledChatContainerContentListScroll>\n </StyledChatContainerContentList>\n </StyledWrapper>\n );\n};\n\nChatContainerMessagesList.propTypes = listProps;\nChatContainerMessagesList.defaultProps = defaultProps;\nconst ChatContainerMessagesListWithSchema = describe(ChatContainerMessagesList);\nChatContainerMessagesListWithSchema.propTypes = listProps;\n\nexport { ChatContainerMessagesList, ChatContainerMessagesListWithSchema };\n"],"names":["getPadding","hasMoreItems","padding","paddingStart","paddingEnd","ChatContainerMessagesList","props","useValidateProps","ChatContainerMessagesListWithSchema","toJSON","sendingText","sendingMessages","messages","actionRef","onScrollEnds","getMoreMessages","isLoading","virtualListRef","React","useRef","useVirtual","size","length","parentRef","overscan","estimateSize","useCallback","vScroll","scrollToIndex","totalSize","virtualItems","onScrollStop","current","getBoundingClientRect","bottom","top","list","querySelectorAll","indexList","forEach","item","itemTop","push","dataset","index","scrollAndFocus","align","setTimeout","querySelector","focus","useEffect","a","b","getMessagesInView","focusToIndex","focusToList","handleKey","e","preventDefault","key","Number","currentTarget","focusToComposer","handlerCallback","localVirtualRef","onScroll","clearTimeout","addEventListener","removeEventListener","render","useMemo","map","virtualItem","measureRef","start","row","isSending","find","m","dsId","style","position","left","transform","width","ListItem","StyledWrapperListItem","type","BUBBLE_TYPES","SENDER","RECIPIENT","ChatBubble","helpMessage","DELIMITER","MessageDelimiter","SYSTEM","SystemMessage","StyledWrapper","StyledChatContainerContentList","StyledChatContainerContentListScroll","StyledLoadMoreContainer","DSButton","propTypes","listProps","defaultProps","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAACC,YAAD,EAAkB;AACnC,MAAMC,OAAO,GAAG;AACdC,IAAAA,YAAY,EAAE,CADA;AAEdC,IAAAA,UAAU,EAAE,CAAC;AAFC,GAAhB;AAIA,MAAIH,YAAY,KAAK,KAArB,EAA4BC,OAAO,CAACC,YAAR,GAAuB,EAAvB,CAA5B,KACK,IAAIF,YAAY,KAAK,QAArB,EAA+BC,OAAO,CAACE,UAAR,GAAqB,EAArB;AACpC,SAAOF,OAAP;AACD,CARD;;IAUMG,yBAAyB,GAAG,SAA5BA,yBAA4B,CAACC,KAAD,EAAwD;AAC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2EAAD;AAAsC,IAAA,MAAM,YAAKtE,SAAL;AAA5C,KACGwC,MADH,EAEG,CAACrD,SAAD,IAAcf,YAAd,gBACCiB,wCAACkF,8DAAD;AAAyB,IAAA,YAAY,EAAEnG;AAAvC,kBACEiB,wCAACmF,4BAAD;AAAU,IAAA,SAAS,EAAC,WAApB;AAAgC,IAAA,UAAU,EAAC,WAA3C;AAAuD,IAAA,OAAO,EAAEtF;AAAhE,IADF,CADD,GAIG,IANN,CARF,CADF,CADF;AAqBD;;AAEDV,yBAAyB,CAACiG,SAA1B,GAAsCC,+CAAtC;AACAlG,yBAAyB,CAACmG,YAA1B,GAAyCA,kDAAzC;IACMhG,mCAAmC,GAAGiG,kBAAQ,CAACpG,yBAAD;AACpDG,mCAAmC,CAAC8F,SAApC,GAAgDC,+CAAhD;;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
6
|
+
|
|
7
|
+
var useValidateProps = function useValidateProps(props, schema) {
|
|
8
|
+
dsPropsHelpers.useValidatePropTypes(props, schema);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
exports.useValidateProps = useValidateProps;
|
|
12
|
+
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useValidateProps.js","sources":["../../../../../src/parts/chat-container-messages-list/config/useValidateProps.tsx"],"sourcesContent":["import { useValidatePropTypes } from '@elliemae/ds-props-helpers';\nimport { ChatContainerMessagesListProps } from '../props';\n\nexport const useValidateProps = (props: ChatContainerMessagesListProps, schema: unknown): void => {\n useValidatePropTypes(props, schema);\n};\n"],"names":["useValidateProps","props","schema","useValidatePropTypes"],"mappings":";;;;;;IAGaA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAAwCC,MAAxC,EAAkE;AAChGC,EAAAA,mCAAoB,CAACF,KAAD,EAAQC,MAAR,CAApB;AACD;;;;"}
|
|
@@ -17,15 +17,20 @@ require('@elliemae/ds-grid');
|
|
|
17
17
|
require('../bubble/props.js');
|
|
18
18
|
require('prop-types');
|
|
19
19
|
require('lodash');
|
|
20
|
+
require('../bubble/config/useValidateProps.js');
|
|
21
|
+
require('@elliemae/ds-props-helpers');
|
|
20
22
|
require('../bubble/ChatBubbleArrow.js');
|
|
21
23
|
require('../message-delimiter/MessageDelimiter.js');
|
|
22
24
|
require('../message-delimiter/styled.js');
|
|
23
25
|
require('../message-delimiter/props.js');
|
|
26
|
+
require('../message-delimiter/config/useValidateProps.js');
|
|
24
27
|
require('../system-message/SystemMessage.js');
|
|
25
28
|
require('../system-message/style.js');
|
|
26
29
|
require('../system-message/props.js');
|
|
30
|
+
require('../system-message/config/useValidateProps.js');
|
|
27
31
|
require('./styled.js');
|
|
28
32
|
require('./props.js');
|
|
33
|
+
require('./config/useValidateProps.js');
|
|
29
34
|
|
|
30
35
|
|
|
31
36
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -17,7 +17,7 @@ var defaultProps = {
|
|
|
17
17
|
};
|
|
18
18
|
var listProps = {
|
|
19
19
|
messages: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.object).description('The array of out-of-the-box items you want to render inside the ChatMessageList').defaultValue(defaultProps.messages),
|
|
20
|
-
actionRef: reactDesc.PropTypes.
|
|
20
|
+
actionRef: reactDesc.PropTypes.object.description("Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n ").defaultValue(defaultProps.actionRef),
|
|
21
21
|
onScrollEnds: reactDesc.PropTypes.func.description("Called when the scroll stops."),
|
|
22
22
|
isLoading: reactDesc.PropTypes.oneOf(['top', 'bottom', undefined]).description('Keeps the load more space while the loading is in progress'),
|
|
23
23
|
hasMoreItems: reactDesc.PropTypes.oneOf(['top', 'bottom', undefined]).description('Show Load More button at the `top` or `bottom` of the container'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sources":["../../../../src/parts/chat-container-messages-list/props.ts"],"sourcesContent":["import { Ref } from 'react';\nimport { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\nimport { BubbleProps } from '../bubble/props';\n\ninterface ActionRef {\n scrollToIndex: (n: number, b: { align: 'end' | 'center' | 'start' }) => void;\n getMessagesInView: () => number[];\n}\nexport interface ChatContainerMessagesListProps {\n messages: BubbleProps[];\n actionRef:
|
|
1
|
+
{"version":3,"file":"props.js","sources":["../../../../src/parts/chat-container-messages-list/props.ts"],"sourcesContent":["import { Ref } from 'react';\nimport { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\nimport { BubbleProps } from '../bubble/props';\n\ninterface ActionRef {\n scrollToIndex: (n: number, b: { align: 'end' | 'center' | 'start' }) => void;\n getMessagesInView: () => number[];\n}\nexport interface ChatContainerMessagesListProps {\n messages: BubbleProps[];\n actionRef: any;\n onScrollEnds: (indexList: number[]) => number[];\n isLoading?: 'top' | 'bottom';\n hasMoreItems?: 'top' | 'bottom';\n getMoreMessages: PropTypes.func;\n sendingMessages?: Array<string | number>;\n sendingText: string;\n}\n\nexport const defaultProps: ChatContainerMessagesListProps = {\n messages: [],\n actionRef: noop,\n onScrollEnds: () => [],\n getMoreMessages: noop,\n sendingMessages: undefined,\n sendingText: 'Sending',\n};\n\nexport const listProps = {\n messages: PropTypes.arrayOf(PropTypes.object)\n .description('The array of out-of-the-box items you want to render inside the ChatMessageList')\n .defaultValue(defaultProps.messages),\n actionRef: PropTypes.object\n .description(\n `Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n `,\n )\n .defaultValue(defaultProps.actionRef),\n onScrollEnds: PropTypes.func.description(`Called when the scroll stops.`),\n isLoading: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Keeps the load more space while the loading is in progress',\n ),\n hasMoreItems: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Load More button at the `top` or `bottom` of the container',\n ),\n getMoreMessages: PropTypes.func\n .description('Called when the user clicks on load more')\n .defaultValue(defaultProps.getMoreMessages),\n sendingMessages: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n .description('Array of ids of sending messages')\n .defaultValue(defaultProps.sendingMessages),\n sendingText: PropTypes.string\n .description('Label description for messages in sending status')\n .defaultValue(defaultProps.sendingText),\n};\n"],"names":["defaultProps","messages","actionRef","noop","onScrollEnds","getMoreMessages","sendingMessages","undefined","sendingText","listProps","PropTypes","arrayOf","object","description","defaultValue","func","isLoading","oneOf","hasMoreItems","oneOfType","string","number"],"mappings":";;;;;;;IAoBaA,YAA4C,GAAG;AAC1DC,EAAAA,QAAQ,EAAE,EADgD;AAE1DC,EAAAA,SAAS,EAAEC,WAF+C;AAG1DC,EAAAA,YAAY,EAAE;AAAA,WAAM,EAAN;AAAA,GAH4C;AAI1DC,EAAAA,eAAe,EAAEF,WAJyC;AAK1DG,EAAAA,eAAe,EAAEC,SALyC;AAM1DC,EAAAA,WAAW,EAAE;AAN6C;IAS/CC,SAAS,GAAG;AACvBR,EAAAA,QAAQ,EAAES,mBAAS,CAACC,OAAV,CAAkBD,mBAAS,CAACE,MAA5B,EACPC,WADO,CACK,iFADL,EAEPC,YAFO,CAEMd,YAAY,CAACC,QAFnB,CADa;AAIvBC,EAAAA,SAAS,EAAEQ,mBAAS,CAACE,MAAV,CACRC,WADQ,oTAcRC,YAdQ,CAcKd,YAAY,CAACE,SAdlB,CAJY;AAmBvBE,EAAAA,YAAY,EAAEM,mBAAS,CAACK,IAAV,CAAeF,WAAf,iCAnBS;AAoBvBG,EAAAA,SAAS,EAAEN,mBAAS,CAACO,KAAV,CAAgB,CAAC,KAAD,EAAQ,QAAR,EAAkBV,SAAlB,CAAhB,EAA8CM,WAA9C,CACT,4DADS,CApBY;AAuBvBK,EAAAA,YAAY,EAAER,mBAAS,CAACO,KAAV,CAAgB,CAAC,KAAD,EAAQ,QAAR,EAAkBV,SAAlB,CAAhB,EAA8CM,WAA9C,CACZ,iEADY,CAvBS;AA0BvBR,EAAAA,eAAe,EAAEK,mBAAS,CAACK,IAAV,CACdF,WADc,CACF,0CADE,EAEdC,YAFc,CAEDd,YAAY,CAACK,eAFZ,CA1BM;AA6BvBC,EAAAA,eAAe,EAAEI,mBAAS,CAACC,OAAV,CAAkBD,mBAAS,CAACS,SAAV,CAAoB,CAACT,mBAAS,CAACU,MAAX,EAAmBV,mBAAS,CAACW,MAA7B,CAApB,CAAlB,EACdR,WADc,CACF,kCADE,EAEdC,YAFc,CAEDd,YAAY,CAACM,eAFZ,CA7BM;AAgCvBE,EAAAA,WAAW,EAAEE,mBAAS,CAACU,MAAV,CACVP,WADU,CACE,kDADF,EAEVC,YAFU,CAEGd,YAAY,CAACQ,WAFhB;AAhCU;;;;;"}
|
|
@@ -6,12 +6,14 @@ var styled = require('styled-components');
|
|
|
6
6
|
require('../bubble/ChatBubble.js');
|
|
7
7
|
var parts_bubble_props = require('../bubble/props.js');
|
|
8
8
|
require('react');
|
|
9
|
+
require('react-desc');
|
|
9
10
|
require('@elliemae/ds-icons/WarningCircleFill');
|
|
10
11
|
require('../bubble/styled.js');
|
|
11
12
|
require('@elliemae/ds-grid');
|
|
13
|
+
require('../bubble/config/useValidateProps.js');
|
|
14
|
+
require('@elliemae/ds-props-helpers');
|
|
12
15
|
require('../bubble/ChatBubbleArrow.js');
|
|
13
16
|
require('prop-types');
|
|
14
|
-
require('react-desc');
|
|
15
17
|
require('lodash');
|
|
16
18
|
|
|
17
19
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -56,7 +58,13 @@ var StyledLoadMoreContainer = /*#__PURE__*/styled__default['default'].div.withCo
|
|
|
56
58
|
}, function (props) {
|
|
57
59
|
return props.hasMoreItems === 'bottom' ? 'bottom: 0;' : '';
|
|
58
60
|
});
|
|
61
|
+
var ListItem = /*#__PURE__*/styled__default['default'].div.withConfig({
|
|
62
|
+
componentId: "sc-1jhprzr-5"
|
|
63
|
+
})(["&:focus,&:focus-visible{outline:none;&:after{content:'';display:block;position:absolute;pointer-events:none;background:rgba(255,255,255,0.5);width:calc(100% + ", ");height:100%;}}"], function (props) {
|
|
64
|
+
return props.theme.space.xxs;
|
|
65
|
+
});
|
|
59
66
|
|
|
67
|
+
exports.ListItem = ListItem;
|
|
60
68
|
exports.StyledChatContainerContentList = StyledChatContainerContentList;
|
|
61
69
|
exports.StyledChatContainerContentListScroll = StyledChatContainerContentListScroll;
|
|
62
70
|
exports.StyledLoadMoreContainer = StyledLoadMoreContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","sources":["../../../../src/parts/chat-container-messages-list/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { BUBBLE_TYPES } from '../bubble/index';\nimport { BubbleProps } from '../bubble/props';\n\nexport const StyledWrapper = styled.div`\n width: 100%;\n height: 100%;\n`;\n\n// list\nexport const StyledWrapperListItem = styled.div<Partial<BubbleProps>>`\n min-width: 100%;\n ${(props) =>\n props.type === BUBBLE_TYPES.SENDER &&\n `padding: ${props.theme.space.xxs} ${props.theme.space.xxs} 0px 13%\n `};\n ${(props) =>\n props.type === BUBBLE_TYPES.RECIPIENT &&\n `padding: ${props.theme.space.xxs} 13% ${props.theme.space.xxs}\n ${props.theme.space.xxs}\n `};\n ${(props) =>\n props.type === BUBBLE_TYPES.SYSTEM &&\n `padding: ${props.theme.space.xxs} 0px\n `};\n`;\n\nexport const StyledChatContainerContentList = styled.div`\n width: 100%;\n height: 100%;\n padding: ${(props) => props.theme.space.xs};\n padding-bottom: 0;\n overflow-y: auto;\n overflow-x: hidden;\n`;\nexport const StyledChatContainerContentListScroll = styled.div<{ height: string }>`\n width: 100%;\n height: ${(props) => props.height};\n position: relative;\n`;\n\nexport const StyledLoadMoreContainer = styled.div<{ hasMoreItems?: 'top' | 'bottom' }>`\n position: absolute;\n width: calc(100% + ${(props) => props.theme.space.xxs});\n padding: ${(props) => props.theme.space.xxs};\n left: -${(props) => props.theme.space.xxs};\n right: -${(props) => props.theme.space.xxs};\n display: grid;\n justify-content: center;\n align-items: center;\n ${(props) => (props.hasMoreItems === 'top' ? 'top: 0;' : '')}\n ${(props) => (props.hasMoreItems === 'bottom' ? 'bottom: 0;' : '')}\n`;\n"],"names":["StyledWrapper","styled","div","StyledWrapperListItem","props","type","BUBBLE_TYPES","SENDER","theme","space","xxs","RECIPIENT","SYSTEM","StyledChatContainerContentList","xs","StyledChatContainerContentListScroll","height","StyledLoadMoreContainer","hasMoreItems"],"mappings":"
|
|
1
|
+
{"version":3,"file":"styled.js","sources":["../../../../src/parts/chat-container-messages-list/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { BUBBLE_TYPES } from '../bubble/index';\nimport { BubbleProps } from '../bubble/props';\n\nexport const StyledWrapper = styled.div`\n width: 100%;\n height: 100%;\n`;\n\n// list\nexport const StyledWrapperListItem = styled.div<Partial<BubbleProps>>`\n min-width: 100%;\n ${(props) =>\n props.type === BUBBLE_TYPES.SENDER &&\n `padding: ${props.theme.space.xxs} ${props.theme.space.xxs} 0px 13%\n `};\n ${(props) =>\n props.type === BUBBLE_TYPES.RECIPIENT &&\n `padding: ${props.theme.space.xxs} 13% ${props.theme.space.xxs}\n ${props.theme.space.xxs}\n `};\n ${(props) =>\n props.type === BUBBLE_TYPES.SYSTEM &&\n `padding: ${props.theme.space.xxs} 0px\n `};\n`;\n\nexport const StyledChatContainerContentList = styled.div`\n width: 100%;\n height: 100%;\n padding: ${(props) => props.theme.space.xs};\n padding-bottom: 0;\n overflow-y: auto;\n overflow-x: hidden;\n`;\nexport const StyledChatContainerContentListScroll = styled.div<{ height: string }>`\n width: 100%;\n height: ${(props) => props.height};\n position: relative;\n`;\n\nexport const StyledLoadMoreContainer = styled.div<{ hasMoreItems?: 'top' | 'bottom' }>`\n position: absolute;\n width: calc(100% + ${(props) => props.theme.space.xxs});\n padding: ${(props) => props.theme.space.xxs};\n left: -${(props) => props.theme.space.xxs};\n right: -${(props) => props.theme.space.xxs};\n display: grid;\n justify-content: center;\n align-items: center;\n ${(props) => (props.hasMoreItems === 'top' ? 'top: 0;' : '')}\n ${(props) => (props.hasMoreItems === 'bottom' ? 'bottom: 0;' : '')}\n`;\nexport const ListItem = styled.div`\n &:focus,\n &:focus-visible {\n outline: none;\n &:after {\n content: '';\n display: block;\n position: absolute;\n pointer-events: none;\n background: rgba(255, 255, 255, 0.5);\n width: calc(100% + ${(props) => props.theme.space.xxs});\n height: 100%;\n }\n }\n`;\n"],"names":["StyledWrapper","styled","div","StyledWrapperListItem","props","type","BUBBLE_TYPES","SENDER","theme","space","xxs","RECIPIENT","SYSTEM","StyledChatContainerContentList","xs","StyledChatContainerContentListScroll","height","StyledLoadMoreContainer","hasMoreItems","ListItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IAIaA,aAAa,gBAAGC,0BAAM,CAACC,GAAV;AAAA;AAAA;;IAMbC,qBAAqB,gBAAGF,0BAAM,CAACC,GAAV;AAAA;AAAA,uCAE9B,UAACE,KAAD;AAAA,SACAA,KAAK,CAACC,IAAN,KAAeC,+BAAY,CAACC,MAA5B,uBACYH,KAAK,CAACI,KAAN,CAAYC,KAAZ,CAAkBC,GAD9B,cACqCN,KAAK,CAACI,KAAN,CAAYC,KAAZ,CAAkBC,GADvD,iBADA;AAAA,CAF8B,EAM9B,UAACN,KAAD;AAAA,SACAA,KAAK,CAACC,IAAN,KA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QAAvB,GAAkC,YAAlC,GAAiD,EAA7D;AAAA,CAVgC;IAYvBC,QAAQ,gBAAGlB,0BAAM,CAACC,GAAV;AAAA;AAAA,4LAUM,UAACE,KAAD;AAAA,SAAWA,KAAK,CAACI,KAAN,CAAYC,KAAZ,CAAkBC,GAA7B;AAAA,CAVN;;;;;;;;;"}
|
|
@@ -3,19 +3,24 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
+
var reactDesc = require('react-desc');
|
|
6
7
|
var dsGrid = require('@elliemae/ds-grid');
|
|
7
8
|
var Communications = require('@elliemae/ds-icons/Communications');
|
|
9
|
+
var parts_chatEmptyState_props = require('./props.js');
|
|
8
10
|
var parts_chatEmptyState_styled = require('./styled.js');
|
|
11
|
+
var parts_chatEmptyState_config_useValidateProps = require('./config/useValidateProps.js');
|
|
9
12
|
require('styled-components');
|
|
13
|
+
require('@elliemae/ds-props-helpers');
|
|
10
14
|
|
|
11
15
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
16
|
|
|
13
17
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
18
|
var Communications__default = /*#__PURE__*/_interopDefaultLegacy(Communications);
|
|
15
19
|
|
|
16
|
-
var ChatEmptyState = function ChatEmptyState(
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
var ChatEmptyState = function ChatEmptyState(props) {
|
|
21
|
+
parts_chatEmptyState_config_useValidateProps.useValidateProps(props, ChatEmptyStateListWithSchema.toJSON());
|
|
22
|
+
var label = props.label,
|
|
23
|
+
action = props.action;
|
|
19
24
|
var MainContent = React.useMemo(function () {
|
|
20
25
|
return /*#__PURE__*/React__default['default'].createElement(dsGrid.Grid, {
|
|
21
26
|
alignItems: "center",
|
|
@@ -40,5 +45,11 @@ var ChatEmptyState = function ChatEmptyState(_ref) {
|
|
|
40
45
|
}, MainContent);
|
|
41
46
|
};
|
|
42
47
|
|
|
48
|
+
ChatEmptyState.propTypes = parts_chatEmptyState_props.emptyStateProps;
|
|
49
|
+
ChatEmptyState.defaultProps = parts_chatEmptyState_props.defaultProps;
|
|
50
|
+
var ChatEmptyStateListWithSchema = reactDesc.describe(ChatEmptyState);
|
|
51
|
+
ChatEmptyStateListWithSchema.propTypes = parts_chatEmptyState_props.emptyStateProps;
|
|
52
|
+
|
|
43
53
|
exports.ChatEmptyState = ChatEmptyState;
|
|
54
|
+
exports.ChatEmptyStateListWithSchema = ChatEmptyStateListWithSchema;
|
|
44
55
|
//# sourceMappingURL=ChatEmptyState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatEmptyState.js","sources":["../../../../src/parts/chat-empty-state/ChatEmptyState.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport Communications from '@elliemae/ds-icons/Communications';\nimport { ChatEmptyStateProps } from './props';\nimport { ChatEmptyStateWrapper, MessageWrapper } from './styled';\n\
|
|
1
|
+
{"version":3,"file":"ChatEmptyState.js","sources":["../../../../src/parts/chat-empty-state/ChatEmptyState.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { describe } from 'react-desc';\nimport { Grid } from '@elliemae/ds-grid';\nimport Communications from '@elliemae/ds-icons/Communications';\nimport { ChatEmptyStateProps, emptyStateProps, defaultProps } from './props';\nimport { ChatEmptyStateWrapper, MessageWrapper } from './styled';\nimport { useValidateProps } from './config/useValidateProps';\n\nconst ChatEmptyState = (props: ChatEmptyStateProps): JSX.Element => {\n useValidateProps(props, ChatEmptyStateListWithSchema.toJSON());\n const { label, action } = props;\n const MainContent = useMemo(\n () => (\n <Grid alignItems=\"center\" justifyContent=\"center\">\n <Grid alignItems=\"center\" justifyContent=\"center\">\n <Communications size=\"xxl\" color={['neutral', 400]} />\n </Grid>\n <Grid alignItems=\"center\" justifyContent=\"center\">\n <MessageWrapper>{label}</MessageWrapper>\n </Grid>\n <Grid alignItems=\"center\" justifyContent=\"center\">\n {action}\n </Grid>\n </Grid>\n ),\n [label, action],\n );\n return (\n <ChatEmptyStateWrapper alignItems=\"center\" justifyContent=\"center\">\n {MainContent}\n </ChatEmptyStateWrapper>\n );\n};\n\nChatEmptyState.propTypes = emptyStateProps;\nChatEmptyState.defaultProps = defaultProps;\nconst ChatEmptyStateListWithSchema = describe(ChatEmptyState);\nChatEmptyStateListWithSchema.propTypes = emptyStateProps;\n\nexport { ChatEmptyState, ChatEmptyStateListWithSchema };\n"],"names":["ChatEmptyState","props","useValidateProps","ChatEmptyStateListWithSchema","toJSON","label","action","MainContent","useMemo","React","Grid","Communications","MessageWrapper","ChatEmptyStateWrapper","propTypes","emptyStateProps","defaultProps","describe"],"mappings":";;;;;;;;;;;;;;;;;;;IAQMA,cAAc,GAAG,SAAjBA,cAAiB,CAACC,KAAD,EAA6C;AAClEC,EAAAA,6DAAgB,CAACD,KAAD,EAAQE,4BAA4B,CAACC,MAA7B,EAAR,CAAhB;AACA,MAAQC,KAAR,GAA0BJ,KAA1B,CAAQI,KAAR;AAAA,MAAeC,MAAf,GAA0BL,KAA1B,CAAeK,MAAf;AACA,MAAMC,WAAW,GAAGC,aAAO,CACzB;AAAA,wBACEC,wCAACC,WAAD;AAAM,MAAA,UAAU,EAAC,QAAjB;AAA0B,MAAA,cAAc,EAAC;AAAzC,oBACED,wCAACC,WAAD;AAAM,MAAA,UAAU,EAAC,QAAjB;AAA0B,MAAA,cAAc,EAAC;AAAzC,oBACED,wCAACE,kCAAD;AAAgB,MAAA,IAAI,EAAC,KAArB;AAA2B,MAAA,KAAK,EAAE,CAAC,SAAD,EAAY,GAAZ;AAAlC,MADF,CADF,eAIEF,wCAACC,WAAD;AAAM,MAAA,UAAU,EAAC,QAAjB;AAA0B,MAAA,cAAc,EAAC;AAAzC,oBACED,wCAACG,0CAAD,QAAiBP,KAAjB,CADF,CAJF,eAOEI,wCAACC,WAAD;AAAM,MAAA,UAAU,EAA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