@elliemae/ds-chat 1.57.0-rc.2 → 1.57.0-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.js +3 -10
- package/cjs/index.js.map +1 -1
- package/cjs/parts/bubble/ChatBubble.js +2 -3
- package/cjs/parts/bubble/ChatBubble.js.map +1 -1
- package/cjs/parts/bubble/index.js +1 -1
- package/cjs/parts/chat-composer/ChatContainerComposer.js +6 -6
- package/cjs/parts/chat-composer/ChatContainerComposer.js.map +1 -1
- package/cjs/parts/chat-composer/index.js +1 -1
- package/cjs/parts/chat-composer/props.js +2 -0
- package/cjs/parts/chat-composer/props.js.map +1 -1
- package/cjs/parts/chat-composer/styled.js +2 -2
- package/cjs/parts/chat-container/ChatContainer.js +2 -4
- package/cjs/parts/chat-container/ChatContainer.js.map +1 -1
- package/cjs/parts/chat-container/index.js +2 -4
- package/cjs/parts/chat-container/index.js.map +1 -1
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js +2 -2
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +1 -1
- package/cjs/parts/chat-container-messages-list/index.js +2 -2
- package/cjs/parts/chat-container-messages-list/styled.js +1 -1
- package/cjs/parts/chat-empty-state/ChatEmptyState.js +2 -3
- package/cjs/parts/chat-empty-state/ChatEmptyState.js.map +1 -1
- package/cjs/parts/chat-sidebar/SideBarChat.js +2 -7
- package/cjs/parts/chat-sidebar/SideBarChat.js.map +1 -1
- package/cjs/parts/chat-sidebar/index.js +1 -4
- package/cjs/parts/chat-sidebar/index.js.map +1 -1
- package/cjs/parts/floating-button/FloatingButton.js +2 -3
- package/cjs/parts/floating-button/FloatingButton.js.map +1 -1
- package/cjs/parts/floating-button/index.js +1 -1
- package/cjs/parts/grid-influencer/InfluencerContainer.js +2 -8
- package/cjs/parts/grid-influencer/InfluencerContainer.js.map +1 -1
- package/cjs/parts/sidebar-button/SidebarButton.js +1 -1
- package/cjs/parts/sidebar-button/props.js +2 -3
- package/cjs/parts/sidebar-button/props.js.map +1 -1
- package/cjs/parts/tile-button/TileButton.js +2 -4
- package/cjs/parts/tile-button/TileButton.js.map +1 -1
- package/cjs/parts/tile-button/index.js +1 -2
- package/cjs/parts/tile-button/index.js.map +1 -1
- package/cjs/parts/tile-button/props.js +2 -6
- package/cjs/parts/tile-button/props.js.map +1 -1
- package/esm/index.js +3 -10
- package/esm/index.js.map +1 -1
- package/esm/parts/bubble/ChatBubble.js +2 -2
- package/esm/parts/bubble/ChatBubble.js.map +1 -1
- package/esm/parts/bubble/index.js +1 -1
- package/esm/parts/chat-composer/ChatContainerComposer.js +5 -4
- package/esm/parts/chat-composer/ChatContainerComposer.js.map +1 -1
- package/esm/parts/chat-composer/index.js +1 -1
- package/esm/parts/chat-composer/props.js +2 -0
- package/esm/parts/chat-composer/props.js.map +1 -1
- package/esm/parts/chat-container/ChatContainer.js +2 -4
- package/esm/parts/chat-container/ChatContainer.js.map +1 -1
- package/esm/parts/chat-container/index.js +2 -4
- package/esm/parts/chat-container/index.js.map +1 -1
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js +2 -2
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +1 -1
- package/esm/parts/chat-container-messages-list/index.js +2 -2
- package/esm/parts/chat-container-messages-list/styled.js +1 -1
- package/esm/parts/chat-empty-state/ChatEmptyState.js +1 -1
- package/esm/parts/chat-empty-state/ChatEmptyState.js.map +1 -1
- package/esm/parts/chat-sidebar/SideBarChat.js +1 -4
- package/esm/parts/chat-sidebar/SideBarChat.js.map +1 -1
- package/esm/parts/chat-sidebar/index.js +1 -4
- package/esm/parts/chat-sidebar/index.js.map +1 -1
- package/esm/parts/floating-button/FloatingButton.js +1 -1
- package/esm/parts/floating-button/FloatingButton.js.map +1 -1
- package/esm/parts/floating-button/index.js +1 -1
- package/esm/parts/grid-influencer/InfluencerContainer.js +2 -8
- package/esm/parts/grid-influencer/InfluencerContainer.js.map +1 -1
- package/esm/parts/sidebar-button/SidebarButton.js +1 -1
- package/esm/parts/sidebar-button/props.js +1 -1
- package/esm/parts/sidebar-button/props.js.map +1 -1
- package/esm/parts/tile-button/TileButton.js +1 -2
- package/esm/parts/tile-button/TileButton.js.map +1 -1
- package/esm/parts/tile-button/index.js +1 -2
- package/esm/parts/tile-button/index.js.map +1 -1
- package/esm/parts/tile-button/props.js +1 -1
- package/esm/parts/tile-button/props.js.map +1 -1
- package/package.json +9 -9
package/cjs/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var parts_systemMessage_SystemMessage = require('./parts/system-message/SystemMe
|
|
|
18
18
|
var parts_chatCard_ChatCard = require('./parts/chat-card/ChatCard.js');
|
|
19
19
|
require('react');
|
|
20
20
|
require('react-desc');
|
|
21
|
-
require('@elliemae/ds-icons
|
|
21
|
+
require('@elliemae/ds-icons');
|
|
22
22
|
require('./parts/bubble/styled.js');
|
|
23
23
|
require('styled-components');
|
|
24
24
|
require('@elliemae/ds-grid');
|
|
@@ -27,20 +27,18 @@ require('lodash');
|
|
|
27
27
|
require('./parts/bubble/config/useValidateProps.js');
|
|
28
28
|
require('@elliemae/ds-props-helpers');
|
|
29
29
|
require('./parts/bubble/ChatBubbleArrow.js');
|
|
30
|
-
require('@elliemae/ds-icons/Comments');
|
|
31
30
|
require('./parts/floating-button/styled.js');
|
|
32
31
|
require('./parts/floating-button/props.js');
|
|
33
32
|
require('./styled.js');
|
|
34
33
|
require('@elliemae/ds-truncated-tooltip-text');
|
|
35
34
|
require('./parts/chat-container-header/styled.js');
|
|
36
|
-
require('@elliemae/ds-icons/Communications');
|
|
37
35
|
require('./parts/chat-empty-state/props.js');
|
|
38
36
|
require('./parts/chat-empty-state/styled.js');
|
|
39
37
|
require('./parts/chat-empty-state/config/useValidateProps.js');
|
|
40
38
|
require('@babel/runtime/helpers/extends');
|
|
41
39
|
require('@babel/runtime/helpers/defineProperty');
|
|
42
40
|
require('react-virtual');
|
|
43
|
-
require('@elliemae/ds-
|
|
41
|
+
require('@elliemae/ds-button');
|
|
44
42
|
require('./parts/chat-container-messages-list/styled.js');
|
|
45
43
|
require('./parts/chat-container-messages-list/props.js');
|
|
46
44
|
require('./parts/chat-container-messages-list/config/useValidateProps.js');
|
|
@@ -51,13 +49,9 @@ require('./parts/system-message/style.js');
|
|
|
51
49
|
require('./parts/system-message/props.js');
|
|
52
50
|
require('./parts/system-message/config/useValidateProps.js');
|
|
53
51
|
require('@babel/runtime/helpers/slicedToArray');
|
|
54
|
-
require('@elliemae/ds-icons/PaperAirplane');
|
|
55
52
|
require('./parts/chat-composer/styled.js');
|
|
56
|
-
require('@elliemae/ds-button');
|
|
57
53
|
require('./parts/chat-composer/config/useValidateProps.js');
|
|
58
54
|
require('./parts/chat-composer/props.js');
|
|
59
|
-
require('@elliemae/ds-icons/MenuExpand');
|
|
60
|
-
require('@elliemae/ds-icons/MenuCollapse');
|
|
61
55
|
require('./parts/chat-sidebar/styled.js');
|
|
62
56
|
require('./parts/sidebar-button/SidebarButton.js');
|
|
63
57
|
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
@@ -66,11 +60,10 @@ require('./parts/sidebar-button/props.js');
|
|
|
66
60
|
require('./parts/chat-sidebar/props.js');
|
|
67
61
|
require('./parts/chat-sidebar/config/useValidateProps.js');
|
|
68
62
|
require('@elliemae/ds-tooltip');
|
|
69
|
-
require('@elliemae/ds-icons/CloseXsmall');
|
|
70
63
|
require('./parts/tile-button/styled.js');
|
|
71
64
|
require('./parts/tile-button/props.js');
|
|
72
65
|
require('./parts/tile-button/config/useValidateProps.js');
|
|
73
|
-
require('@elliemae/ds-
|
|
66
|
+
require('@elliemae/ds-indeterminate-progress-indicator');
|
|
74
67
|
require('@elliemae/ds-banner');
|
|
75
68
|
require('./parts/chat-container/props.js');
|
|
76
69
|
require('./parts/chat-container/styled.js');
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var reactDesc = require('react-desc');
|
|
7
|
-
var
|
|
7
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
8
8
|
var parts_bubble_styled = require('./styled.js');
|
|
9
9
|
var parts_bubble_props = require('./props.js');
|
|
10
10
|
var parts_bubble_config_useValidateProps = require('./config/useValidateProps.js');
|
|
@@ -18,7 +18,6 @@ require('@elliemae/ds-props-helpers');
|
|
|
18
18
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
19
|
|
|
20
20
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
21
|
-
var Warning__default = /*#__PURE__*/_interopDefaultLegacy(Warning);
|
|
22
21
|
|
|
23
22
|
var ChatBubble = function ChatBubble(props) {
|
|
24
23
|
parts_bubble_config_useValidateProps.useValidateProps(props, ChatBubbleWithSchema.toJSON());
|
|
@@ -62,7 +61,7 @@ var ChatBubble = function ChatBubble(props) {
|
|
|
62
61
|
p: "xxs",
|
|
63
62
|
gutter: "xxs",
|
|
64
63
|
cols: [1, 'auto']
|
|
65
|
-
}, /*#__PURE__*/React__default['default'].createElement("span", null, errorMessage), /*#__PURE__*/React__default['default'].createElement(
|
|
64
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", null, errorMessage), /*#__PURE__*/React__default['default'].createElement(dsIcons.WarningCircleFill, null)) : null, helpMessage ? /*#__PURE__*/React__default['default'].createElement(parts_bubble_styled.StyleHelpMessage, {
|
|
66
65
|
"data-testid": "chat-bubble-help-message-".concat(dsId),
|
|
67
66
|
p: "xxs",
|
|
68
67
|
gutter: "xxs",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatBubble.js","sources":["../../../../src/parts/bubble/ChatBubble.tsx"],"sourcesContent":["import React from 'react';\nimport { describe } from 'react-desc';\nimport
|
|
1
|
+
{"version":3,"file":"ChatBubble.js","sources":["../../../../src/parts/bubble/ChatBubble.tsx"],"sourcesContent":["import React from 'react';\nimport { describe } from 'react-desc';\nimport { WarningCircleFill } from '@elliemae/ds-icons';\nimport {\n StyledWrapper,\n StyledColoredBubble,\n StyledTitleBubble,\n StyledTitleLeftBubble,\n StyledTitleRightBubble,\n StyleBodyWrapper,\n StyleErrorMessage,\n StyleHelpMessage,\n} from './styled';\nimport { propsBubbles, BubbleProps } from './props';\nimport { useValidateProps } from './config/useValidateProps';\nimport { ChatBubbleArrow } from './ChatBubbleArrow';\n\nconst ChatBubble = (props: BubbleProps): JSX.Element => {\n useValidateProps(props, ChatBubbleWithSchema.toJSON());\n\n const { dsId, type, title, time, body, errorMessage, helpMessage } = props;\n const bodyParts = React.useMemo(() => body.split('\\n'), [body]);\n\n return (\n <StyledWrapper data-testid={`ds-chat-bubble-${dsId}`} type={type}>\n <StyledColoredBubble type={type}>\n <StyledTitleBubble cols={[1, 'auto']} gutter=\"xs\" alignItems=\"flex-end\" className=\"sr-only\">\n <StyledTitleLeftBubble alignItems=\"center\" data-testid={`chat-bubble-title-${dsId}`}>\n {title}\n </StyledTitleLeftBubble>\n <StyledTitleRightBubble alignItems=\"center\" type={type} data-testid={`chat-bubble-time-${dsId}`}>\n {time}\n </StyledTitleRightBubble>\n </StyledTitleBubble>\n <StyleBodyWrapper data-testid={`chat-bubble-body-${dsId}`}>\n {bodyParts.map((item, index) => (\n <React.Fragment key={item}>\n {item}\n {index < bodyParts.length - 1 ? <br /> : null}\n </React.Fragment>\n ))}\n </StyleBodyWrapper>\n <ChatBubbleArrow type={type} />\n </StyledColoredBubble>\n {errorMessage ? (\n <StyleErrorMessage data-testid={`chat-bubble-error-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{errorMessage}</span>\n <WarningCircleFill />\n </StyleErrorMessage>\n ) : null}\n {helpMessage ? (\n <StyleHelpMessage data-testid={`chat-bubble-help-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{helpMessage}</span>\n </StyleHelpMessage>\n ) : null}\n </StyledWrapper>\n );\n};\nChatBubble.propTypes = propsBubbles;\n\nconst ChatBubbleWithSchema = describe(ChatBubble);\nChatBubbleWithSchema.propTypes = propsBubbles;\n\nexport { ChatBubble, ChatBubbleWithSchema };\n"],"names":["ChatBubble","props","useValidateProps","ChatBubbleWithSchema","toJSON","dsId","type","title","time","body","errorMessage","helpMessage","bodyParts","React","useMemo","split","StyledWrapper","StyledColoredBubble","StyledTitleBubble","StyledTitleLeftBubble","StyledTitleRightBubble","StyleBodyWrapper","map","item","index","length","ChatBubbleArrow","StyleErrorMessage","WarningCircleFill","StyleHelpMessage","propTypes","propsBubbles","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;IAiBMA,UAAU,GAAG,SAAbA,UAAa,CAACC,KAAD,EAAqC;AACtDC,EAAAA,qDAAgB,CAACD,KAAD,EAAQE,oBAAoB,CAACC,MAArB,EAAR,CAAhB;AAEA,MAAQC,IAAR,GAAqEJ,KAArE,CAAQI,IAAR;AAAA,MAAcC,IAAd,GAAqEL,KAArE,CAAcK,IAAd;AAAA,MAAoBC,KAApB,GAAqEN,KAArE,CAAoBM,KAApB;AAAA,MAA2BC,IAA3B,GAAqEP,KAArE,CAA2BO,IAA3B;AAAA,MAAiCC,IAAjC,GAAqER,KAArE,CAAiCQ,IAAjC;AAAA,MAAuCC,YAAvC,GAAqET,KAArE,CAAuCS,YAAvC;AAAA,MAAqDC,WAArD,GAAqEV,KAArE,CAAqDU,WAArD;AACA,MAAMC,SAAS,GAAGC,yBAAK,CAACC,OAAN,CAAc;AAAA,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H,YAAP,CADF,eAEEG,wCAACe,yBAAD,OAFF,CADW,GAKT,IAzBN,EA0BGjB,WAAW,gBACVE,wCAACgB,oCAAD;AAAkB,sDAAyCxB,IAAzC,CAAlB;AAAmE,IAAA,CAAC,EAAC,KAArE;AAA2E,IAAA,MAAM,EAAC,KAAlF;AAAwF,IAAA,IAAI,EAAE,CAAC,CAAD,EAAI,MAAJ;AAA9F,kBACEQ,sDAAOF,WAAP,CADF,CADU,GAIR,IA9BN,CADF;AAkCD;;AACDX,UAAU,CAAC8B,SAAX,GAAuBC,+BAAvB;IAEM5B,oBAAoB,GAAG6B,kBAAQ,CAAChC,UAAD;AACrCG,oBAAoB,CAAC2B,SAArB,GAAiCC,+BAAjC;;;;;"}
|
|
@@ -6,7 +6,7 @@ var parts_bubble_ChatBubble = require('./ChatBubble.js');
|
|
|
6
6
|
var parts_bubble_props = require('./props.js');
|
|
7
7
|
require('react');
|
|
8
8
|
require('react-desc');
|
|
9
|
-
require('@elliemae/ds-icons
|
|
9
|
+
require('@elliemae/ds-icons');
|
|
10
10
|
require('./styled.js');
|
|
11
11
|
require('styled-components');
|
|
12
12
|
require('@elliemae/ds-grid');
|
|
@@ -7,7 +7,7 @@ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var dsGrid = require('@elliemae/ds-grid');
|
|
9
9
|
var reactDesc = require('react-desc');
|
|
10
|
-
var
|
|
10
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
11
11
|
var parts_chatComposer_styled = require('./styled.js');
|
|
12
12
|
var parts_chatComposer_config_useValidateProps = require('./config/useValidateProps.js');
|
|
13
13
|
var parts_chatComposer_props = require('./props.js');
|
|
@@ -21,7 +21,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
21
21
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
22
22
|
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
23
23
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
|
-
var PaperAirplane__default = /*#__PURE__*/_interopDefaultLegacy(PaperAirplane);
|
|
25
24
|
|
|
26
25
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
27
26
|
|
|
@@ -41,6 +40,7 @@ var ChatComposer = function ChatComposer(props) {
|
|
|
41
40
|
maxHeight = _props$maxHeight === void 0 ? 300 : _props$maxHeight,
|
|
42
41
|
placeholder = props.placeholder,
|
|
43
42
|
inputMaxLength = props.inputMaxLength,
|
|
43
|
+
maxLengthMessage = props.maxLengthMessage,
|
|
44
44
|
buttonDisabled = props.buttonDisabled,
|
|
45
45
|
dataTestid = props.dataTestid,
|
|
46
46
|
actionRef = props.actionRef;
|
|
@@ -69,7 +69,7 @@ var ChatComposer = function ChatComposer(props) {
|
|
|
69
69
|
onResize(newHeight);
|
|
70
70
|
setHeight(newHeight);
|
|
71
71
|
setShowScroll(((_inputSize$current3 = inputSize.current) === null || _inputSize$current3 === void 0 ? void 0 : _inputSize$current3.scrollHeight) - ((_inputSize$current4 = inputSize.current) === null || _inputSize$current4 === void 0 ? void 0 : _inputSize$current4.clientHeight) > 5);
|
|
72
|
-
}, [inputValue, internalMaxHeight]);
|
|
72
|
+
}, [inputValue, internalMaxHeight, onResize]);
|
|
73
73
|
React__default['default'].useEffect(function () {
|
|
74
74
|
if (actionRef && actionRef.current) {
|
|
75
75
|
actionRef.current.focusToComposer = function () {
|
|
@@ -80,7 +80,7 @@ var ChatComposer = function ChatComposer(props) {
|
|
|
80
80
|
inputSend.current.focus();
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
}, [actionRef
|
|
83
|
+
}, [actionRef]);
|
|
84
84
|
var handleChange = React__default['default'].useCallback(function (e) {
|
|
85
85
|
onChange(e.target.value);
|
|
86
86
|
}, [onChange]);
|
|
@@ -116,7 +116,7 @@ var ChatComposer = function ChatComposer(props) {
|
|
|
116
116
|
alignItems: "center"
|
|
117
117
|
}, /*#__PURE__*/React__default['default'].createElement(parts_chatComposer_styled.StyledComposerButton, {
|
|
118
118
|
buttonType: "text",
|
|
119
|
-
icon: /*#__PURE__*/React__default['default'].createElement(
|
|
119
|
+
icon: /*#__PURE__*/React__default['default'].createElement(dsIcons.PaperAirplane, {
|
|
120
120
|
width: 18,
|
|
121
121
|
height: 18
|
|
122
122
|
}),
|
|
@@ -150,7 +150,7 @@ var ChatComposer = function ChatComposer(props) {
|
|
|
150
150
|
"data-testid": "composer-counter-area"
|
|
151
151
|
}, inputMaxLength && hasError ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(parts_chatComposer_styled.StyledCounterErrorA11y, {
|
|
152
152
|
role: "alert"
|
|
153
|
-
}, "You have exceeded the character limit by "
|
|
153
|
+
}, maxLengthMessage || "You have exceeded the character limit by ".concat(inputLength - inputMaxLength)), maxLengthMessage || "Please limit to less than ".concat(inputMaxLength, " characters. ")) : '', inputMaxLength ? " ".concat(inputLength, " / ").concat(inputMaxLength) : ''), /*#__PURE__*/React__default['default'].createElement(dsGrid.Grid, null)));
|
|
154
154
|
};
|
|
155
155
|
|
|
156
156
|
ChatComposer.propTypes = parts_chatComposer_props.composerProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatContainerComposer.js","sources":["../../../../src/parts/chat-composer/ChatContainerComposer.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { describe } from 'react-desc';\nimport PaperAirplane from '@elliemae/ds-icons/PaperAirplane';\nimport {\n StyledChatContainerContentComposer,\n StyledComposerInput,\n StyledComposerButton,\n StyledCounterArea,\n StyledCounterErrorA11y,\n} from './styled';\nimport { useValidateProps } from './config/useValidateProps';\n\nimport { defaultComposerPros, composerProps, ChatComposerProps } from './props';\n\nconst ChatComposer = (props: ChatComposerProps): JSX.Element => {\n useValidateProps(props, ChatComposerWithSchema.toJSON());\n\n const {\n inputValue,\n onChange,\n onResize,\n onSend,\n onFocus,\n onBlur,\n maxHeight = 300,\n placeholder,\n inputMaxLength,\n buttonDisabled,\n dataTestid,\n actionRef,\n } = props;\n\n const input = React.useRef<HTMLTextAreaElement>();\n const inputSize = React.useRef<HTMLTextAreaElement>();\n const inputSend = React.useRef<HTMLButtonElement>();\n const [height, setHeight] = React.useState(32);\n const internalMaxHeight = React.useMemo(() => maxHeight - 24, [maxHeight]);\n const [showScroll, setShowScroll] = React.useState(true);\n\n React.useEffect(() => {\n const newHeight =\n inputSize.current?.scrollHeight > internalMaxHeight ? internalMaxHeight : inputSize.current?.scrollHeight;\n onResize(newHeight);\n setHeight(newHeight);\n setShowScroll(inputSize.current?.scrollHeight - inputSize.current?.clientHeight > 5);\n }, [inputValue, internalMaxHeight]);\n\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusToComposer = () => {\n input.current.focus();\n };\n actionRef.current.focusToSend = () => {\n inputSend.current.focus();\n };\n }\n }, [actionRef.current]);\n\n const handleChange = React.useCallback(\n (e) => {\n onChange(e.target.value);\n },\n [onChange],\n );\n const heightProps = { height, overflow: showScroll ? 'auto' : 'hidden' };\n\n const inputLength = String(inputValue || '').length;\n const hasError = React.useMemo(() => inputLength > inputMaxLength, [inputLength, inputMaxLength]);\n\n return (\n <StyledChatContainerContentComposer rows={['auto', '15px']} maxHeight={`${maxHeight}px`} data-testid={dataTestid}>\n <Grid cols={['1fr', '24px']} justifyContent=\"center\" alignItems=\"flex-end\" gutter=\"xxs\">\n <StyledComposerInput\n ref={input}\n onChange={handleChange}\n style={{ ...heightProps }}\n value={inputValue}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n aria-label=\"Message to send\"\n data-testid=\"chat-composer-textarea\"\n />\n\n <Grid height=\"32px\" alignItems=\"center\">\n <StyledComposerButton\n buttonType=\"text\"\n icon={<PaperAirplane width={18} height={18} />}\n onClick={onSend}\n size=\"s\"\n disabled={!inputValue || buttonDisabled || hasError}\n data-testid=\"chat-composer-send-button\"\n aria-label=\"Send\"\n innerRef={inputSend}\n />\n </Grid>\n </Grid>\n <StyledComposerInput\n ref={inputSize}\n style={{\n height: 32,\n visibility: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n top: 0,\n width: input.current?.clientWidth,\n }}\n onChange={handleChange}\n value={inputValue}\n // maxLength={inputMaxLength}\n />\n <Grid cols={['1fr', '24px']} justifyContent=\"flex-end\" alignItems=\"center\" gutter=\"xxs\" pb=\"xxs\">\n <StyledCounterArea hasError={hasError} data-testid=\"composer-counter-area\">\n {inputMaxLength && hasError ? (\n <>\n <StyledCounterErrorA11y role=\"alert\">\n You have exceeded the character limit by {inputLength - inputMaxLength}\n </StyledCounterErrorA11y>\n Please limit to less than {inputMaxLength} characters.{' '}\n </>\n ) : (\n ''\n )}\n {inputMaxLength ? `${inputLength} / ${inputMaxLength}` : ''}\n </StyledCounterArea>\n <Grid />\n </Grid>\n </StyledChatContainerContentComposer>\n );\n};\n\nChatComposer.propTypes = composerProps;\nChatComposer.defaultProps = defaultComposerPros;\nconst ChatComposerWithSchema = describe(ChatComposer);\nChatComposerWithSchema.propTypes = composerProps;\n\nexport { ChatComposer, ChatComposerWithSchema };\n"],"names":["ChatComposer","props","useValidateProps","ChatComposerWithSchema","toJSON","inputValue","onChange","onResize","onSend","onFocus","onBlur","maxHeight","placeholder","inputMaxLength","buttonDisabled","dataTestid","actionRef","input","React","useRef","inputSize","inputSend","useState","height","setHeight","internalMaxHeight","useMemo","showScroll","setShowScroll","useEffect","newHeight","current","scrollHeight","clientHeight","focusToComposer","focus","focusToSend","handleChange","useCallback","e","target","value","heightProps","overflow","inputLength","String","length","hasError","StyledChatContainerContentComposer","Grid","StyledComposerInput","StyledComposerButton","PaperAirplane","visibility","pointerEvents","position","top","width","clientWidth","StyledCounterArea","StyledCounterErrorA11y","propTypes","composerProps","defaultProps","defaultComposerPros","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgBMA,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAA2C;AAAA;;AAC9DC,EAAAA,2DAAgB,CAACD,KAAD,EAAQE,sBAAsB,CAACC,MAAvB,EAAR,CAAhB;AAEA,MACEC,UADF,GAaIJ,KAbJ,CACEI,UADF;AAAA,MAEEC,QAFF,GAaIL,KAbJ,CAEEK,QAFF;AAAA,MAGEC,QAHF,GAaIN,KAbJ,CAGEM,QAHF;AAAA,MAIEC,MAJF,GAaIP,KAbJ,CAIEO,MAJF;AAAA,MAKEC,OALF,GAaIR,KAbJ,CAKEQ,OALF;AAAA,MAMEC,MANF,GAaIT,KAbJ,CAMES,MANF;AAAA,yBAaIT,KAbJ,CAOEU,SAPF;AAAA,MAOEA,SAPF,iCAOc,GAPd;AAAA,MAQEC,WARF,GAaIX,KAbJ,CAQEW,WARF;AAAA,MASEC,cATF,GAaIZ,KAbJ,CASEY,cATF;AAAA,MAUEC,cAVF,GAaIb,KAbJ,CAUEa,cAVF;AAAA,MAWEC,UAXF,GAaId,KAbJ,CAWEc,UAXF;AAAA,MAYEC,SAZF,GAaIf,KAbJ,CAYEe,SAZF;AAeA,MAAMC,KAAK,GAAGC,yBAAK,CAACC,MAAN,EAAd;AACA,MAAMC,SAAS,GAAGF,yBAAK,CAACC,MAAN,EAAlB;AACA,MAAME,SAAS,GAAGH,yBAAK,CAACC,MAAN,EAAlB;;AACA,wBAA4BD,yBAAK,CAACI,QAAN,CAAe,EAAf,CAA5B;AAAA;AAAA,MAAOC,MAAP;AAAA,MAAeC,SAAf;;AACA,MAAMC,iBAAiB,GAAGP,yBAAK,CAACQ,OAAN,CAAc;AAAA,WAAMf,SAAS,GAAG,EAAlB;AAAA,G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C,4CAA5B;IACM7D,sBAAsB,GAAG8D,kBAAQ,CAACjE,YAAD;AACvCG,sBAAsB,CAAC0D,SAAvB,GAAmCC,sCAAnC;;;;;"}
|
|
1
|
+
{"version":3,"file":"ChatContainerComposer.js","sources":["../../../../src/parts/chat-composer/ChatContainerComposer.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { describe } from 'react-desc';\nimport { PaperAirplane } from '@elliemae/ds-icons';\nimport {\n StyledChatContainerContentComposer,\n StyledComposerInput,\n StyledComposerButton,\n StyledCounterArea,\n StyledCounterErrorA11y,\n} from './styled';\nimport { useValidateProps } from './config/useValidateProps';\n\nimport { defaultComposerPros, composerProps, ChatComposerProps } from './props';\n\nconst ChatComposer = (props: ChatComposerProps): JSX.Element => {\n useValidateProps(props, ChatComposerWithSchema.toJSON());\n\n const {\n inputValue,\n onChange,\n onResize,\n onSend,\n onFocus,\n onBlur,\n maxHeight = 300,\n placeholder,\n inputMaxLength,\n maxLengthMessage,\n buttonDisabled,\n dataTestid,\n actionRef,\n } = props;\n\n const input = React.useRef<HTMLTextAreaElement>();\n const inputSize = React.useRef<HTMLTextAreaElement>();\n const inputSend = React.useRef<HTMLButtonElement>();\n const [height, setHeight] = React.useState(32);\n const internalMaxHeight = React.useMemo(() => maxHeight - 24, [maxHeight]);\n const [showScroll, setShowScroll] = React.useState(true);\n\n React.useEffect(() => {\n const newHeight =\n inputSize.current?.scrollHeight > internalMaxHeight ? internalMaxHeight : inputSize.current?.scrollHeight;\n onResize(newHeight);\n setHeight(newHeight);\n setShowScroll(inputSize.current?.scrollHeight - inputSize.current?.clientHeight > 5);\n }, [inputValue, internalMaxHeight, onResize]);\n\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusToComposer = () => {\n input.current.focus();\n };\n actionRef.current.focusToSend = () => {\n inputSend.current.focus();\n };\n }\n }, [actionRef]);\n\n const handleChange = React.useCallback(\n (e) => {\n onChange(e.target.value);\n },\n [onChange],\n );\n const heightProps = { height, overflow: showScroll ? 'auto' : 'hidden' };\n\n const inputLength = String(inputValue || '').length;\n const hasError = React.useMemo(() => inputLength > inputMaxLength, [inputLength, inputMaxLength]);\n\n return (\n <StyledChatContainerContentComposer rows={['auto', '15px']} maxHeight={`${maxHeight}px`} data-testid={dataTestid}>\n <Grid cols={['1fr', '24px']} justifyContent=\"center\" alignItems=\"flex-end\" gutter=\"xxs\">\n <StyledComposerInput\n ref={input}\n onChange={handleChange}\n style={{ ...heightProps }}\n value={inputValue}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n aria-label=\"Message to send\"\n data-testid=\"chat-composer-textarea\"\n />\n\n <Grid height=\"32px\" alignItems=\"center\">\n <StyledComposerButton\n buttonType=\"text\"\n icon={<PaperAirplane width={18} height={18} />}\n onClick={onSend}\n size=\"s\"\n disabled={!inputValue || buttonDisabled || hasError}\n data-testid=\"chat-composer-send-button\"\n aria-label=\"Send\"\n innerRef={inputSend}\n />\n </Grid>\n </Grid>\n <StyledComposerInput\n ref={inputSize}\n style={{\n height: 32,\n visibility: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n top: 0,\n width: input.current?.clientWidth,\n }}\n onChange={handleChange}\n value={inputValue}\n // maxLength={inputMaxLength}\n />\n <Grid cols={['1fr', '24px']} justifyContent=\"flex-end\" alignItems=\"center\" gutter=\"xxs\" pb=\"xxs\">\n <StyledCounterArea hasError={hasError} data-testid=\"composer-counter-area\">\n {inputMaxLength && hasError ? (\n <>\n <StyledCounterErrorA11y role=\"alert\">\n {maxLengthMessage || `You have exceeded the character limit by ${inputLength - inputMaxLength}`}\n </StyledCounterErrorA11y>\n {maxLengthMessage || `Please limit to less than ${inputMaxLength} characters. `}\n </>\n ) : (\n ''\n )}\n {inputMaxLength ? ` ${inputLength} / ${inputMaxLength}` : ''}\n </StyledCounterArea>\n <Grid />\n </Grid>\n </StyledChatContainerContentComposer>\n );\n};\n\nChatComposer.propTypes = composerProps;\nChatComposer.defaultProps = defaultComposerPros;\nconst ChatComposerWithSchema = describe(ChatComposer);\nChatComposerWithSchema.propTypes = composerProps;\n\nexport { ChatComposer, ChatComposerWithSchema };\n"],"names":["ChatComposer","props","useValidateProps","ChatComposerWithSchema","toJSON","inputValue","onChange","onResize","onSend","onFocus","onBlur","maxHeight","placeholder","inputMaxLength","maxLengthMessage","buttonDisabled","dataTestid","actionRef","input","React","useRef","inputSize","inputSend","useState","height","setHeight","internalMaxHeight","useMemo","showScroll","setShowScroll","useEffect","newHeight","current","scrollHeight","clientHeight","focusToComposer","focus","focusToSend","handleChange","useCallback","e","target","value","heightProps","overflow","inputLength","String","length","hasError","StyledChatContainerContentComposer","Grid","StyledComposerInput","StyledComposerButton","PaperAirplane","visibility","pointerEvents","position","top","width","clientWidth","StyledCounterArea","StyledCounterErrorA11y","propTypes","composerProps","defaultProps","defaultComposerPros","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgBMA,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAA2C;AAAA;;AAC9DC,EAAAA,2DAAgB,CAACD,KAAD,EAAQE,sBAAsB,CAACC,MAAvB,EAAR,CAAhB;AAEA,MACEC,UADF,GAcIJ,KAdJ,CACEI,UADF;AAAA,MAEEC,QAFF,GAcIL,KAdJ,CAEEK,QAFF;AAAA,MAGEC,QAHF,GAcIN,KAdJ,CAGEM,QAHF;AAAA,MAIEC,MAJF,GAcIP,KAdJ,CAIEO,MAJF;AAAA,MAKEC,OALF,GAcIR,KAdJ,CAKEQ,OALF;AAAA,MAMEC,MANF,GAcIT,KAdJ,CAMES,MANF;AAAA,yBAcIT,KAdJ,CAOEU,SAPF;AAAA,MAOEA,SAPF,iCAOc,GAPd;AAAA,MAQEC,WARF,GAcIX,KAdJ,CAQEW,WARF;AAAA,MASEC,cATF,GAcIZ,KAdJ,CASEY,cATF;AAAA,MAUEC,gBAVF,GAcIb,KAdJ,CAUEa,gBAVF;AAAA,M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F;AAAwF,IAAA,EAAE,EAAC;AAA3F,kBACE/B,wCAACyC,2CAAD;AAAmB,IAAA,QAAQ,EAAEZ,QAA7B;AAAuC,mBAAY;AAAnD,KACGnC,cAAc,IAAImC,QAAlB,gBACC7B,+FACEA,wCAAC0C,gDAAD;AAAwB,IAAA,IAAI,EAAC;AAA7B,KACG/C,gBAAgB,uDAAgD+B,WAAW,GAAGhC,cAA9D,CADnB,CADF,EAIGC,gBAAgB,wCAAiCD,cAAjC,kBAJnB,CADD,GAQC,EATJ,EAWGA,cAAc,cAAOgC,WAAP,gBAAwBhC,cAAxB,IAA2C,EAX5D,CADF,eAcEM,wCAAC+B,WAAD,OAdF,CAzCF,CADF;AA4DD;;AAEDlD,YAAY,CAAC8D,SAAb,GAAyBC,sCAAzB;AACA/D,YAAY,CAACgE,YAAb,GAA4BC,4CAA5B;IACM9D,sBAAsB,GAAG+D,kBAAQ,CAAClE,YAAD;AACvCG,sBAAsB,CAAC2D,SAAvB,GAAmCC,sCAAnC;;;;;"}
|
|
@@ -8,7 +8,7 @@ require('@babel/runtime/helpers/slicedToArray');
|
|
|
8
8
|
require('react');
|
|
9
9
|
require('@elliemae/ds-grid');
|
|
10
10
|
require('react-desc');
|
|
11
|
-
require('@elliemae/ds-icons
|
|
11
|
+
require('@elliemae/ds-icons');
|
|
12
12
|
require('./styled.js');
|
|
13
13
|
require('styled-components');
|
|
14
14
|
require('@elliemae/ds-button');
|
|
@@ -15,6 +15,7 @@ var defaultComposerPros = {
|
|
|
15
15
|
onBlur: lodash.noop,
|
|
16
16
|
maxHeight: 0,
|
|
17
17
|
inputMaxLength: undefined,
|
|
18
|
+
maxLengthMessage: undefined,
|
|
18
19
|
buttonDisabled: false,
|
|
19
20
|
dataTestid: 'ds-chat-composer',
|
|
20
21
|
actionRef: lodash.noop
|
|
@@ -22,6 +23,7 @@ var defaultComposerPros = {
|
|
|
22
23
|
var composerProps = {
|
|
23
24
|
placeholder: reactDesc.PropTypes.string.description('Input Placeholder').defaultValue(defaultComposerPros.placeholder),
|
|
24
25
|
inputValue: reactDesc.PropTypes.string.description('Input value').defaultValue(defaultComposerPros.inputValue),
|
|
26
|
+
maxLengthMessage: reactDesc.PropTypes.string.description('Max length message').defaultValue(defaultComposerPros.maxLengthMessage),
|
|
25
27
|
onChange: reactDesc.PropTypes.func.description('Called when the user types').defaultValue(defaultComposerPros.onChange),
|
|
26
28
|
onResize: reactDesc.PropTypes.func.description('Called the input changes his height').defaultValue(defaultComposerPros.onResize),
|
|
27
29
|
onSend: reactDesc.PropTypes.func.description('Called when the click send').defaultValue(defaultComposerPros.onSend),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sources":["../../../../src/parts/chat-composer/props.tsx"],"sourcesContent":["import React from 'react';\nimport { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\n\nexport interface TextAreaProps {\n height: string | number;\n style: React.CSSProperties;\n}\n\nexport const defaultComposerPros: ChatComposerProps = {\n placeholder: 'Type your message',\n inputValue: '',\n onChange: noop,\n onResize: noop,\n onSend: noop,\n onFocus: noop,\n onBlur: noop,\n maxHeight: 0,\n inputMaxLength: undefined,\n buttonDisabled: false,\n dataTestid: 'ds-chat-composer',\n actionRef: noop,\n};\n\nexport interface ChatComposerProps {\n placeholder
|
|
1
|
+
{"version":3,"file":"props.js","sources":["../../../../src/parts/chat-composer/props.tsx"],"sourcesContent":["import React from 'react';\nimport { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\n\nexport interface TextAreaProps {\n height: string | number;\n style: React.CSSProperties;\n}\n\nexport const defaultComposerPros: ChatComposerProps = {\n placeholder: 'Type your message',\n inputValue: '',\n onChange: noop,\n onResize: noop,\n onSend: noop,\n onFocus: noop,\n onBlur: noop,\n maxHeight: 0,\n inputMaxLength: undefined,\n maxLengthMessage: undefined,\n buttonDisabled: false,\n dataTestid: 'ds-chat-composer',\n actionRef: noop,\n};\n\nexport interface ChatComposerProps {\n placeholder?: string;\n inputValue?: string;\n maxLengthMessage?: string;\n onChange: (value: string) => void;\n onResize?: (value: number) => void;\n onSend: (value: string) => void;\n onFocus?: (e: React.ChangeEvent<HTMLTextAreaElement>, value: string) => void;\n onBlur?: (e: React.ChangeEvent<HTMLTextAreaElement>, value: string) => void;\n maxHeight?: number;\n inputMaxLength: number | undefined;\n buttonDisabled: boolean;\n dataTestid?: string;\n actionRef: PropTypes.func;\n}\n\nexport const composerProps = {\n placeholder: PropTypes.string.description('Input Placeholder').defaultValue(defaultComposerPros.placeholder),\n inputValue: PropTypes.string.description('Input value').defaultValue(defaultComposerPros.inputValue),\n maxLengthMessage: PropTypes.string\n .description('Max length message')\n .defaultValue(defaultComposerPros.maxLengthMessage),\n onChange: PropTypes.func.description('Called when the user types').defaultValue(defaultComposerPros.onChange),\n onResize: PropTypes.func\n .description('Called the input changes his height')\n .defaultValue(defaultComposerPros.onResize),\n onSend: PropTypes.func.description('Called when the click send').defaultValue(defaultComposerPros.onSend),\n onFocus: PropTypes.func.description('Input focus').defaultValue(defaultComposerPros.onFocus),\n onBlur: PropTypes.func.description('Input blur').defaultValue(defaultComposerPros.onBlur),\n maxHeight: PropTypes.number\n .description('Max height of the composer. Use 0 for no limit')\n .defaultValue(defaultComposerPros.onBlur),\n inputMaxLength: PropTypes.number\n .description('Max length of the composer. `undefined` for no limit')\n .defaultValue(defaultComposerPros.inputMaxLength),\n buttonDisabled: PropTypes.bool\n .description('Control the disabled for the send button')\n .defaultValue(defaultComposerPros.buttonDisabled),\n dataTestid: PropTypes.string.description('Data testid').defaultValue(defaultComposerPros.placeholder),\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(defaultComposerPros.actionRef),\n};\n"],"names":["defaultComposerPros","placeholder","inputValue","onChange","noop","onResize","onSend","onFocus","onBlur","maxHeight","inputMaxLength","undefined","maxLengthMessage","buttonDisabled","dataTestid","actionRef","composerProps","PropTypes","string","description","defaultValue","func","number","bool","object"],"mappings":";;;;;;;IASaA,mBAAsC,GAAG;AACpDC,EAAAA,WAAW,EAAE,mBADuC;AAEpDC,EAAAA,UAAU,EAAE,EAFwC;AAGpDC,EAAAA,QAAQ,EAAEC,WAH0C;AAIpDC,EAAAA,QAAQ,EAAED,WAJ0C;AAKpDE,EAAAA,MAAM,EAAEF,WAL4C;AAMpDG,EAAAA,OAAO,EAAEH,WAN2C;AAOpDI,EAAAA,MAAM,EAAEJ,WAP4C;AAQpDK,EAAAA,SAAS,EAAE,CARyC;AASpDC,EAAAA,cAAc,EAAEC,SAToC;AAUpDC,EAAAA,gBAAgB,EAAED,SAVkC;AAWpDE,EAAAA,cAAc,EAAE,KAXoC;AAYpDC,EAAAA,UAAU,EAAE,kBAZwC;AAapDC,EAAAA,SAAS,EAAEX;AAbyC;IAgCzCY,aAAa,GAAG;AAC3Bf,EAAAA,WAAW,EAAEgB,mBAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,mBAA7B,EAAkDC,YAAlD,CAA+DpB,mBAAmB,CAACC,WAAnF,CADc;AAE3BC,EAAAA,UAAU,EAAEe,mBAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,aAA7B,EAA4CC,YAA5C,CAAyDpB,mBAAmB,CAACE,UAA7E,CAFe;AAG3BU,EAAAA,gBAAgB,EAAEK,mBAAS,CAACC,MAAV,CACfC,WADe,CACH,oBADG,EAEfC,YAFe,CAEFpB,mBAAmB,CAACY,gBAFlB,CAHS;AAM3BT,EAAAA,QAAQ,EAAEc,mBAAS,CAACI,IAAV,CAAeF,WAAf,CAA2B,4BAA3B,EAAyDC,YAAzD,CAAsEpB,mBAAmB,CAACG,QAA1F,CANiB;AAO3BE,EAAAA,QAAQ,EAAEY,mBAAS,CAACI,IAAV,CACPF,WADO,CACK,qCADL,EAEPC,YAFO,CAEMpB,mBAAmB,CAACK,QAF1B,CAPiB;AAU3BC,EAAAA,MAAM,EAAEW,mBAAS,CAACI,IAAV,CAAeF,WAAf,CAA2B,4BAA3B,EAAyDC,YAAzD,CAAsEpB,mBAAmB,CAACM,MAA1F,CAVmB;AAW3BC,EAAAA,OAAO,EAAEU,mBAAS,CAACI,IAAV,CAAeF,WAAf,CAA2B,aAA3B,EAA0CC,YAA1C,CAAuDpB,mBAAmB,CAACO,OAA3E,CAXkB;AAY3BC,EAAAA,MAAM,EAAES,mBAAS,CAACI,IAAV,CAAeF,WAAf,CAA2B,YAA3B,EAAyCC,YAAzC,CAAsDpB,mBAAmB,CAACQ,MAA1E,CAZmB;AAa3BC,EAAAA,SAAS,EAAEQ,mBAAS,CAACK,MAAV,CACRH,WADQ,CACI,gDADJ,EAERC,YAFQ,CAEKpB,mBAAmB,CAACQ,MAFzB,CAbgB;AAgB3BE,EAAAA,cAAc,EAAEO,mBAAS,CAACK,MAAV,CACbH,WADa,CACD,sDADC,EAEbC,YAFa,CAEApB,mBAAmB,CAACU,cAFpB,CAhBW;AAmB3BG,EAAAA,cAAc,EAAEI,mBAAS,CAACM,IAAV,CACbJ,WADa,CACD,0CADC,EAEbC,YAFa,CAEApB,mBAAmB,CAACa,cAFpB,CAnBW;AAsB3BC,EAAAA,UAAU,EAAEG,mBAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,aAA7B,EAA4CC,YAA5C,CAAyDpB,mBAAmB,CAACC,WAA7E,CAtBe;AAuB3Bc,EAAAA,SAAS,EAAEE,mBAAS,CAACO,MAAV,CACRL,WADQ,oTAcRC,YAdQ,CAcKpB,mBAAmB,CAACe,SAdzB;AAvBgB;;;;;"}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var styled = require('styled-components');
|
|
6
6
|
var dsGrid = require('@elliemae/ds-grid');
|
|
7
|
-
var
|
|
7
|
+
var DSButton = require('@elliemae/ds-button');
|
|
8
8
|
|
|
9
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
10
|
|
|
@@ -31,7 +31,7 @@ var StyledComposerInput = /*#__PURE__*/styled__default['default'].textarea.withC
|
|
|
31
31
|
}, function (props) {
|
|
32
32
|
return props.theme.colors.brand[600];
|
|
33
33
|
});
|
|
34
|
-
var StyledComposerButton = /*#__PURE__*/styled__default['default'](
|
|
34
|
+
var StyledComposerButton = /*#__PURE__*/styled__default['default'](DSButton.DSButton).withConfig({
|
|
35
35
|
componentId: "sc-1ahwpce-2"
|
|
36
36
|
})(["&:disabled{background:none;svg{fill:#5d6775;}}svg{fill:", ";}&:focus{background:", ";}"], function (props) {
|
|
37
37
|
return props.theme.colors.brand[600];
|
|
@@ -6,7 +6,7 @@ var _extends = require('@babel/runtime/helpers/extends');
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var lodash = require('lodash');
|
|
8
8
|
var reactDesc = require('react-desc');
|
|
9
|
-
var DSIndeterminateProgressIndicator = require('@elliemae/ds-
|
|
9
|
+
var DSIndeterminateProgressIndicator = require('@elliemae/ds-indeterminate-progress-indicator');
|
|
10
10
|
var DSBanner = require('@elliemae/ds-banner');
|
|
11
11
|
var parts_chatComposer_ChatContainerComposer = require('../chat-composer/ChatContainerComposer.js');
|
|
12
12
|
var parts_chatContainerMessagesList_ChatContainerMessagesList = require('../chat-container-messages-list/ChatContainerMessagesList.js');
|
|
@@ -16,7 +16,7 @@ var parts_chatContainer_config_useValidateProps = require('./config/useValidateP
|
|
|
16
16
|
require('@babel/runtime/helpers/defineProperty');
|
|
17
17
|
require('@babel/runtime/helpers/slicedToArray');
|
|
18
18
|
require('@elliemae/ds-grid');
|
|
19
|
-
require('@elliemae/ds-icons
|
|
19
|
+
require('@elliemae/ds-icons');
|
|
20
20
|
require('../chat-composer/styled.js');
|
|
21
21
|
require('styled-components');
|
|
22
22
|
require('@elliemae/ds-button');
|
|
@@ -24,9 +24,7 @@ require('../chat-composer/config/useValidateProps.js');
|
|
|
24
24
|
require('@elliemae/ds-props-helpers');
|
|
25
25
|
require('../chat-composer/props.js');
|
|
26
26
|
require('react-virtual');
|
|
27
|
-
require('@elliemae/ds-basic/Button');
|
|
28
27
|
require('../bubble/ChatBubble.js');
|
|
29
|
-
require('@elliemae/ds-icons/WarningCircleFill');
|
|
30
28
|
require('../bubble/styled.js');
|
|
31
29
|
require('../bubble/props.js');
|
|
32
30
|
require('prop-types');
|
|
@@ -1 +1 @@
|
|
|
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-
|
|
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-indeterminate-progress-indicator';\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.toTypescript());\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', overflow: 'hidden' }}>\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 <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 {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","toTypescript","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","overflow","ChatContainerMessagesList","includes","StyledIndicatorContainer","DSIndeterminateProgressIndicator","DSBanner","label","id","viewLabel","onClick","onView","onClose","BANNER_TYPES","INFO","ChatComposer","clientHeight","propTypes","containerProps","defaultProps","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAYMA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD,EAA4C;AAAA;;AAChEC,EAAAA,4DAAgB,CAACD,KAAD,EAAQE,uBAAuB,CAACC,YAAxB,EAAR,CAAhB;AAEA,MACEC,WADF,GAcIJ,KAdJ,CACEI,WADF;AAAA,MAEEC,eAFF,GAcIL,KAdJ,CAEEK,eAFF;AAAA,MAGEC,cAHF,GAcIN,KAdJ,CAGEM,cAHF;AAAA,MAIEC,WAJF,GAcIP,KAdJ,CAIEO,WAJF;AAAA,MAKEC,iBALF,GAcIR,KAdJ,CAKEQ,iBALF;AAAA,MAMEC,aANF,GAcIT,KAdJ,CAMES,aANF;AAAA,MAO6BC,gBAP7B,GAcIV,KAdJ,CAOES,aAPF,CAOmBE,QAPnB;AAAA,MAQEC,SARF,GAcIZ,KAdJ,CAQEY,SARF;AAAA,MASEC,UATF,GAcIb,KAdJ,CASEa,UATF;AAAA,MAUEC,MAVF,GAcId,KAdJ,CAUEc,MAVF;AAAA,MAWEC,SAXF,GAcIf,KAdJ,CAWEe,SAXF;AAAA,MAYEC,YAZF,GAcIhB,KAdJ,CAYEgB,YAZF;AAAA,MAaEC,eAbF,GAcIjB,KAdJ,CAaEiB,eAbF;AAgBA,MAAMC,YAAY,GAAGC,yBAAK,CAACC,MAAN,EAArB;AACA,MAAMC,OAAO,GAAGF,yBAAK,CAACC,MAAN,CAAa;AAAEE,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C,wCAApC;;;;;"}
|
|
@@ -7,13 +7,13 @@ require('@babel/runtime/helpers/extends');
|
|
|
7
7
|
require('react');
|
|
8
8
|
require('lodash');
|
|
9
9
|
require('react-desc');
|
|
10
|
-
require('@elliemae/ds-
|
|
10
|
+
require('@elliemae/ds-indeterminate-progress-indicator');
|
|
11
11
|
require('@elliemae/ds-banner');
|
|
12
12
|
require('../chat-composer/ChatContainerComposer.js');
|
|
13
13
|
require('@babel/runtime/helpers/defineProperty');
|
|
14
14
|
require('@babel/runtime/helpers/slicedToArray');
|
|
15
15
|
require('@elliemae/ds-grid');
|
|
16
|
-
require('@elliemae/ds-icons
|
|
16
|
+
require('@elliemae/ds-icons');
|
|
17
17
|
require('../chat-composer/styled.js');
|
|
18
18
|
require('styled-components');
|
|
19
19
|
require('@elliemae/ds-button');
|
|
@@ -22,9 +22,7 @@ require('@elliemae/ds-props-helpers');
|
|
|
22
22
|
require('../chat-composer/props.js');
|
|
23
23
|
require('../chat-container-messages-list/ChatContainerMessagesList.js');
|
|
24
24
|
require('react-virtual');
|
|
25
|
-
require('@elliemae/ds-basic/Button');
|
|
26
25
|
require('../bubble/ChatBubble.js');
|
|
27
|
-
require('@elliemae/ds-icons/WarningCircleFill');
|
|
28
26
|
require('../bubble/styled.js');
|
|
29
27
|
require('../bubble/props.js');
|
|
30
28
|
require('prop-types');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -7,7 +7,7 @@ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var reactDesc = require('react-desc');
|
|
9
9
|
var reactVirtual = require('react-virtual');
|
|
10
|
-
var DSButton = require('@elliemae/ds-
|
|
10
|
+
var DSButton = require('@elliemae/ds-button');
|
|
11
11
|
var parts_bubble_ChatBubble = require('../bubble/ChatBubble.js');
|
|
12
12
|
var parts_bubble_props = require('../bubble/props.js');
|
|
13
13
|
var parts_messageDelimiter_MessageDelimiter = require('../message-delimiter/MessageDelimiter.js');
|
|
@@ -15,7 +15,7 @@ var parts_systemMessage_SystemMessage = require('../system-message/SystemMessage
|
|
|
15
15
|
var parts_chatContainerMessagesList_styled = require('./styled.js');
|
|
16
16
|
var parts_chatContainerMessagesList_props = require('./props.js');
|
|
17
17
|
var parts_chatContainerMessagesList_config_useValidateProps = require('./config/useValidateProps.js');
|
|
18
|
-
require('@elliemae/ds-icons
|
|
18
|
+
require('@elliemae/ds-icons');
|
|
19
19
|
require('../bubble/styled.js');
|
|
20
20
|
require('styled-components');
|
|
21
21
|
require('@elliemae/ds-grid');
|
|
@@ -1 +1 @@
|
|
|
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.toTypescript());\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","toTypescript","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;AACxFC,EAAAA,wEAAgB,CAACD,KAAD,EAAQE,mCAAmC,CAACC,YAApC,EAAR,CAAhB;AAEA,MAAQC,WAAR,GACEJ,KADF,CAAQI,WAAR;AAAA,MAAqBC,eAArB,GACEL,KADF,CAAqBK,eAArB;AAAA,MAAsCC,QAAtC,GACEN,KADF,CAAsCM,QAAtC;AAAA,MAAgDC,SAAhD,GACEP,KADF,CAAgDO,SAAhD;AAAA,MAA2DC,YAA3D,GACER,KADF,CAA2DQ,YAA3D;AAAA,MAAyEC,eAAzE,GACET,KADF,CAAyES,eAAzE;AAAA,MAA0Fd,YAA1F,GACEK,KADF,CAA0FL,YAA1F;AAAA,MAAwGe,SAAxG,GACEV,KADF,CAAwGU,SAAxG;AAEA,MAAMC,cAAc,GAAGC,yBAAK,CAACC,MAAN,EAAvB,CALwF;AAOxF;;AACA,oBAIIC,uBAAU;AACZC,IAAAA,IAAI,EAAET,QAAQ,CAACU,MADH;AAEZC,IAAAA,SAAS,EAAEN,cAFC;AAGZO,IAAAA,QAAQ,EAAE;AAHE,KAITxB,UAAU,CAACC,YAAD,CAJD;AAKZwB,IAAAA,YAAY,EAAEP,yB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GAAvB,CAAtC,GAA+E,IALlF,EAMGA,GAAG,CAACY,IAAJ,KAAaC,+BAAY,CAACO,MAA1B,gBAAmC7E,wCAAC8E,+CAAD,EAAoBrB,GAApB,CAAnC,GAAyE,IAN5E,CAVF,CADF;AAqBD,KAjCD,CADF;AAAA,GADa,EAoCb,CAAC7C,YAAD,EAAelB,QAAf,EAAyBD,eAAzB,EAA0C6C,SAA1C,EAAqD9C,WAArD,CApCa,CAAf;AAuCA,sBACEQ,wCAAC+E,oDAAD,qBACE/E,wCAACgF,qEAAD;AACE,mBAAY,uBADd;AAEE,IAAA,QAAQ,EAAE,CAFZ;AAGE,iBAAU,QAHZ;AAIE,IAAA,GAAG,EAAEjF,cAJP;AAKE,IAAA,IAAI,EAAC,MALP;AAME,IAAA,SAAS,EAAEuC;AANb,kBAQEtC,wCAACiF,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;;;;;"}
|
|
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-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.toTypescript());\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","toTypescript","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;AACxFC,EAAAA,wEAAgB,CAACD,KAAD,EAAQE,mCAAmC,CAACC,YAApC,EAAR,CAAhB;AAEA,MAAQC,WAAR,GACEJ,KADF,CAAQI,WAAR;AAAA,MAAqBC,eAArB,GACEL,KADF,CAAqBK,eAArB;AAAA,MAAsCC,QAAtC,GACEN,KADF,CAAsCM,QAAtC;AAAA,MAAgDC,SAAh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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;;;;;"}
|
|
@@ -8,9 +8,9 @@ require('@babel/runtime/helpers/defineProperty');
|
|
|
8
8
|
require('react');
|
|
9
9
|
require('react-desc');
|
|
10
10
|
require('react-virtual');
|
|
11
|
-
require('@elliemae/ds-
|
|
11
|
+
require('@elliemae/ds-button');
|
|
12
12
|
require('../bubble/ChatBubble.js');
|
|
13
|
-
require('@elliemae/ds-icons
|
|
13
|
+
require('@elliemae/ds-icons');
|
|
14
14
|
require('../bubble/styled.js');
|
|
15
15
|
require('styled-components');
|
|
16
16
|
require('@elliemae/ds-grid');
|
|
@@ -7,7 +7,7 @@ require('../bubble/ChatBubble.js');
|
|
|
7
7
|
var parts_bubble_props = require('../bubble/props.js');
|
|
8
8
|
require('react');
|
|
9
9
|
require('react-desc');
|
|
10
|
-
require('@elliemae/ds-icons
|
|
10
|
+
require('@elliemae/ds-icons');
|
|
11
11
|
require('../bubble/styled.js');
|
|
12
12
|
require('@elliemae/ds-grid');
|
|
13
13
|
require('../bubble/config/useValidateProps.js');
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var reactDesc = require('react-desc');
|
|
7
7
|
var dsGrid = require('@elliemae/ds-grid');
|
|
8
|
-
var
|
|
8
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
9
9
|
var parts_chatEmptyState_props = require('./props.js');
|
|
10
10
|
var parts_chatEmptyState_styled = require('./styled.js');
|
|
11
11
|
var parts_chatEmptyState_config_useValidateProps = require('./config/useValidateProps.js');
|
|
@@ -15,7 +15,6 @@ require('@elliemae/ds-props-helpers');
|
|
|
15
15
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
16
|
|
|
17
17
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
18
|
-
var Communications__default = /*#__PURE__*/_interopDefaultLegacy(Communications);
|
|
19
18
|
|
|
20
19
|
var ChatEmptyState = function ChatEmptyState(props) {
|
|
21
20
|
parts_chatEmptyState_config_useValidateProps.useValidateProps(props, ChatEmptyStateListWithSchema.toJSON());
|
|
@@ -28,7 +27,7 @@ var ChatEmptyState = function ChatEmptyState(props) {
|
|
|
28
27
|
}, /*#__PURE__*/React__default['default'].createElement(dsGrid.Grid, {
|
|
29
28
|
alignItems: "center",
|
|
30
29
|
justifyContent: "center"
|
|
31
|
-
}, /*#__PURE__*/React__default['default'].createElement(
|
|
30
|
+
}, /*#__PURE__*/React__default['default'].createElement(dsIcons.Communications, {
|
|
32
31
|
size: "xxl",
|
|
33
32
|
color: ['neutral', 400]
|
|
34
33
|
})), /*#__PURE__*/React__default['default'].createElement(dsGrid.Grid, {
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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';\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,sBAAD;AAAgB,MAAA,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