@elliemae/ds-chat 2.0.0-next.8 → 2.0.0-rc.11
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/ChatDataTestids.js +27 -0
- package/cjs/parts/bubble/ChatBubble.js +9 -6
- package/cjs/parts/bubble/ChatBubbleArrow.js +64 -61
- package/cjs/parts/bubble/props.js +1 -1
- package/cjs/parts/bubble/styled.js +1 -1
- package/cjs/parts/chat-composer/ChatContainerComposer.js +14 -7
- package/cjs/parts/chat-composer/props.js +4 -0
- package/cjs/parts/chat-composer/styled.js +2 -2
- package/cjs/parts/chat-container/ChatContainer.js +56 -14
- package/cjs/parts/chat-container/config/useValidateProps.js +2 -2
- package/cjs/parts/chat-container/props.js +7 -3
- package/cjs/parts/chat-container/styled.js +1 -1
- package/cjs/parts/chat-container-header/ChatContainerHeader.js +3 -3
- package/cjs/parts/chat-container-header/helpers.js +31 -0
- package/cjs/parts/chat-container-header/styled.js +6 -6
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js +137 -32
- package/cjs/parts/chat-container-messages-list/config/useValidateProps.js +2 -2
- package/cjs/parts/chat-container-messages-list/props.js +4 -2
- package/cjs/parts/chat-container-messages-list/styled.js +2 -2
- package/cjs/parts/chat-empty-state/ChatEmptyState.js +2 -3
- package/cjs/parts/chat-sidebar/SideBarChat.js +57 -29
- package/cjs/parts/chat-sidebar/props.js +11 -1
- package/cjs/parts/chat-sidebar/styled.js +2 -2
- package/cjs/parts/floating-button/FloatingButton.js +18 -10
- package/cjs/parts/floating-button/props.js +6 -2
- package/cjs/parts/sidebar-button/SidebarButton.js +5 -0
- package/cjs/parts/sidebar-button/props.js +2 -3
- package/cjs/parts/system-message/style.js +1 -1
- package/cjs/parts/tile-button/TileButton.js +30 -27
- package/cjs/parts/tile-button/props.js +12 -8
- package/cjs/parts/tile-button/styled.js +11 -4
- package/esm/ChatDataTestids.js +23 -0
- package/esm/parts/bubble/ChatBubble.js +8 -5
- package/esm/parts/bubble/ChatBubbleArrow.js +64 -61
- package/esm/parts/bubble/props.js +1 -1
- package/esm/parts/bubble/styled.js +1 -1
- package/esm/parts/chat-composer/ChatContainerComposer.js +13 -5
- package/esm/parts/chat-composer/props.js +4 -0
- package/esm/parts/chat-container/ChatContainer.js +54 -12
- package/esm/parts/chat-container/config/useValidateProps.js +2 -2
- package/esm/parts/chat-container/props.js +7 -3
- package/esm/parts/chat-container/styled.js +1 -1
- package/esm/parts/chat-container-header/ChatContainerHeader.js +3 -2
- package/esm/parts/chat-container-header/helpers.js +23 -0
- package/esm/parts/chat-container-header/styled.js +6 -6
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js +135 -30
- package/esm/parts/chat-container-messages-list/config/useValidateProps.js +2 -2
- package/esm/parts/chat-container-messages-list/props.js +4 -2
- package/esm/parts/chat-container-messages-list/styled.js +2 -2
- package/esm/parts/chat-empty-state/ChatEmptyState.js +1 -1
- package/esm/parts/chat-sidebar/SideBarChat.js +57 -28
- package/esm/parts/chat-sidebar/props.js +11 -1
- package/esm/parts/chat-sidebar/styled.js +2 -2
- package/esm/parts/floating-button/FloatingButton.js +18 -9
- package/esm/parts/floating-button/props.js +6 -2
- package/esm/parts/sidebar-button/SidebarButton.js +5 -0
- package/esm/parts/sidebar-button/props.js +1 -1
- package/esm/parts/system-message/style.js +1 -1
- package/esm/parts/tile-button/TileButton.js +31 -26
- package/esm/parts/tile-button/props.js +11 -3
- package/esm/parts/tile-button/styled.js +11 -6
- package/package.json +28 -6
- package/types/ChatDataTestids.d.ts +21 -0
- package/types/parts/bubble/ChatBubble.d.ts +18 -5
- package/types/parts/bubble/props.d.ts +13 -4
- package/types/parts/bubble/styled.d.ts +9 -9
- package/types/parts/bubble/tests/ChatBubble.test.d.ts +1 -0
- package/types/parts/chat-card/ChatCard.d.ts +24 -4
- package/types/parts/chat-card/props.d.ts +19 -3
- package/types/parts/chat-card/styled.d.ts +6 -6
- package/types/parts/chat-composer/ChatContainerComposer.d.ts +48 -13
- package/types/parts/chat-composer/styled.d.ts +117 -24
- package/types/parts/chat-composer/tests/ChatContainerComposer.test.d.ts +1 -0
- package/types/parts/chat-container/ChatContainer.d.ts +54 -13
- package/types/parts/chat-container/config/useValidateProps.d.ts +1 -1
- package/types/parts/chat-container/styled.d.ts +4 -4
- package/types/parts/chat-container/tests/ChatContainer.test.d.ts +1 -0
- package/types/parts/chat-container-header/helpers.d.ts +6 -0
- package/types/parts/chat-container-header/styled.d.ts +3 -3
- package/types/parts/chat-container-messages-list/ChatContainerMessagesList.d.ts +39 -9
- package/types/parts/chat-container-messages-list/config/useValidateProps.d.ts +1 -1
- package/types/parts/chat-container-messages-list/styled.d.ts +7 -7
- package/types/parts/chat-empty-state/ChatEmptyState.d.ts +12 -3
- package/types/parts/chat-empty-state/props.d.ts +7 -2
- package/types/parts/chat-empty-state/styled.d.ts +2 -2
- package/types/parts/chat-sidebar/SideBarChat.d.ts +39 -9
- package/types/parts/chat-sidebar/props.d.ts +39 -9
- package/types/parts/chat-sidebar/styled.d.ts +2 -2
- package/types/parts/floating-button/FloatingButton.d.ts +11 -2
- package/types/parts/floating-button/props.d.ts +13 -1
- package/types/parts/floating-button/styled.d.ts +1 -1
- package/types/parts/floating-container/styled.d.ts +1 -2
- package/types/parts/grid-influencer/styled.d.ts +2 -2
- package/types/parts/message-delimiter/MessageDelimiter.d.ts +21 -4
- package/types/parts/message-delimiter/props.d.ts +16 -3
- package/types/parts/message-delimiter/styled.d.ts +3 -3
- package/types/parts/sidebar-button/SidebarButton.d.ts +16 -5
- package/types/parts/sidebar-button/props.d.ts +16 -5
- package/types/parts/sidebar-button/styled.d.ts +3 -3
- package/types/parts/system-message/SystemMessage.d.ts +12 -2
- package/types/parts/system-message/props.d.ts +7 -1
- package/types/parts/system-message/style.d.ts +5 -5
- package/types/parts/tile-button/TileButton.d.ts +66 -17
- package/types/parts/tile-button/props.d.ts +64 -16
- package/types/parts/tile-button/styled.d.ts +9 -8
- package/types/prop-types.d.ts +28 -9
- package/types/tests/utils.d.ts +27 -0
- package/types/parts/chat-composer/props.d.ts +0 -35
- package/types/parts/chat-container/props.d.ts +0 -39
- package/types/parts/chat-container-messages-list/props.d.ts +0 -23
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const ChatDataTestIds = {
|
|
6
|
+
COMPOSER_TEXTAREA: 'chat-composer-textarea',
|
|
7
|
+
COMPOSER_SEND_BUTTON: 'chat-composer-send-button',
|
|
8
|
+
CARD_TITLE: 'chat-card-title',
|
|
9
|
+
CARD_WRAPPER: 'chat-card-wrapper',
|
|
10
|
+
CARD_TIME: 'chat-card-time',
|
|
11
|
+
CARD_RIGHT_ADDON: 'chat-right-addon',
|
|
12
|
+
CARD_CONTENT: 'chat-card-content',
|
|
13
|
+
LOADING_INDICATOR: 'ds-chat-loading-indicator',
|
|
14
|
+
HEADER_TITLE: 'chat-header-title',
|
|
15
|
+
HEADER_CHILDREN: 'chat-header-children',
|
|
16
|
+
THREAD_CONTAINER: 'chat-thread-container',
|
|
17
|
+
LOAD_MORE_BUTTON: 'ds-chat-load-more-btn',
|
|
18
|
+
FLOATING_BUTTON: 'chat-floating-button',
|
|
19
|
+
SYSTEM_MSG_TITLE: 'chat-system-message-title',
|
|
20
|
+
SYSTEM_MSG_BODY: 'chat-system-message-body',
|
|
21
|
+
SYSTEM_MSG_TIME: 'chat-system-message-time',
|
|
22
|
+
BUBBLE: 'ds-chat-bubble',
|
|
23
|
+
BUBBLE_TITLE: 'chat-bubble-title',
|
|
24
|
+
BUBBLE_BODY: 'chat-bubble-body'
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.ChatDataTestIds = ChatDataTestIds;
|
|
@@ -4,9 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
6
|
require('core-js/modules/web.url.to-json.js');
|
|
7
|
-
require('
|
|
7
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
9
|
+
var React = require('react');
|
|
8
10
|
var reactDesc = require('react-desc');
|
|
9
|
-
var
|
|
11
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
10
12
|
var styled = require('./styled.js');
|
|
11
13
|
var props = require('./props.js');
|
|
12
14
|
var useValidateProps = require('./config/useValidateProps.js');
|
|
@@ -15,9 +17,9 @@ var ChatBubbleArrow = require('./ChatBubbleArrow.js');
|
|
|
15
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
18
|
|
|
17
19
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
18
|
-
var
|
|
20
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
21
|
|
|
20
|
-
var
|
|
22
|
+
var _br, _WarningCircleFill;
|
|
21
23
|
|
|
22
24
|
const ChatBubble = props => {
|
|
23
25
|
useValidateProps.useValidateProps(props, ChatBubbleWithSchema.toJSON());
|
|
@@ -30,6 +32,7 @@ const ChatBubble = props => {
|
|
|
30
32
|
errorMessage,
|
|
31
33
|
helpMessage
|
|
32
34
|
} = props;
|
|
35
|
+
const bodyParts = React__default["default"].useMemo(() => typeof body === 'string' ? body.split('\n') : [body], [body]);
|
|
33
36
|
return /*#__PURE__*/_jsx__default["default"](styled.StyledWrapper, {
|
|
34
37
|
"data-testid": "ds-chat-bubble-".concat(dsId),
|
|
35
38
|
type: type
|
|
@@ -49,14 +52,14 @@ const ChatBubble = props => {
|
|
|
49
52
|
"data-testid": "chat-bubble-time-".concat(dsId)
|
|
50
53
|
}, void 0, time)), /*#__PURE__*/_jsx__default["default"](styled.StyleBodyWrapper, {
|
|
51
54
|
"data-testid": "chat-bubble-body-".concat(dsId)
|
|
52
|
-
}, void 0,
|
|
55
|
+
}, void 0, bodyParts.map((item, index) => /*#__PURE__*/_jsx__default["default"](React__default["default"].Fragment, {}, "".concat(item, "-").concat(index), item, index < bodyParts.length - 1 ? _br || (_br = /*#__PURE__*/_jsx__default["default"]("br", {})) : null))), /*#__PURE__*/_jsx__default["default"](ChatBubbleArrow.ChatBubbleArrow, {
|
|
53
56
|
type: type
|
|
54
57
|
})), errorMessage ? /*#__PURE__*/_jsx__default["default"](styled.StyleErrorMessage, {
|
|
55
58
|
"data-testid": "chat-bubble-error-message-".concat(dsId),
|
|
56
59
|
p: "xxs",
|
|
57
60
|
gutter: "xxs",
|
|
58
61
|
cols: [1, 'auto']
|
|
59
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"]("span", {}, void 0, errorMessage),
|
|
62
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"]("span", {}, void 0, errorMessage), _WarningCircleFill || (_WarningCircleFill = /*#__PURE__*/_jsx__default["default"](dsIcons.WarningCircleFill, {}))) : null, helpMessage ? /*#__PURE__*/_jsx__default["default"](styled.StyleHelpMessage, {
|
|
60
63
|
"data-testid": "chat-bubble-help-message-".concat(dsId),
|
|
61
64
|
p: "xxs",
|
|
62
65
|
gutter: "xxs",
|
|
@@ -12,66 +12,69 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
12
12
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
13
13
|
|
|
14
14
|
var _svg, _svg2;
|
|
15
|
-
const ChatBubbleArrow =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
15
|
+
const ChatBubbleArrow = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
type
|
|
18
|
+
} = _ref;
|
|
19
|
+
return /*#__PURE__*/_jsx__default["default"](styled.StyledBubbleArrow, {}, void 0, type === props.BUBBLE_TYPES.RECIPIENT ? _svg || (_svg = /*#__PURE__*/_jsx__default["default"]("svg", {
|
|
20
|
+
width: "15px",
|
|
21
|
+
height: "14px",
|
|
22
|
+
viewBox: "0 0 15 14"
|
|
23
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"]("defs", {}, void 0, /*#__PURE__*/_jsx__default["default"]("path", {
|
|
24
|
+
d: "M12,8.5 C12,7.9373169 11.6782751,7.4856453 11.2282104,7.196228 C11.2286673,7.1967363 3,2 3,2 L3,10 L10.5627441,10 L10.5658569,9.9933472 C11.3630371,9.9580688 12,9.3058472 12,8.5 Z",
|
|
25
|
+
id: "path-chat-bubble"
|
|
26
|
+
}), /*#__PURE__*/_jsx__default["default"]("filter", {
|
|
27
|
+
x: "-55.6%",
|
|
28
|
+
y: "-50.0%",
|
|
29
|
+
width: "211.1%",
|
|
30
|
+
height: "225.0%",
|
|
31
|
+
filterUnits: "objectBoundingBox",
|
|
32
|
+
id: "filter-2"
|
|
33
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"]("feOffset", {
|
|
34
|
+
dx: "2.3",
|
|
35
|
+
dy: "1.2",
|
|
36
|
+
in: "SourceAlpha",
|
|
37
|
+
result: "shadowOffsetOuter1"
|
|
38
|
+
}), /*#__PURE__*/_jsx__default["default"]("feGaussianBlur", {
|
|
39
|
+
stdDeviation: "1.5",
|
|
40
|
+
in: "shadowOffsetOuter1",
|
|
41
|
+
result: "shadowBlurOuter1"
|
|
42
|
+
}), /*#__PURE__*/_jsx__default["default"]("feColorMatrix", {
|
|
43
|
+
values: "0 0 0 0 0.207843137 0 0 0 0 0.235294118 0 0 0 0 0.274509804 0 0 0 0.8 0",
|
|
44
|
+
type: "matrix",
|
|
45
|
+
in: "shadowBlurOuter1"
|
|
46
|
+
}))), /*#__PURE__*/_jsx__default["default"]("g", {
|
|
47
|
+
id: "[DSK]-Visual-Design",
|
|
48
|
+
stroke: "none",
|
|
49
|
+
strokeWidth: "1",
|
|
50
|
+
fill: "none",
|
|
51
|
+
fillRule: "evenodd"
|
|
52
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"]("g", {
|
|
53
|
+
id: "Path-Copy",
|
|
54
|
+
transform: "translate(7.500000, 6.000000) scale(-1, 1) translate(-7.500000, -6.000000) "
|
|
55
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"]("use", {
|
|
56
|
+
fill: "black",
|
|
57
|
+
fillOpacity: "1",
|
|
58
|
+
filter: "url(#filter-2)",
|
|
59
|
+
xlinkHref: "#path-chat-bubble"
|
|
60
|
+
}), /*#__PURE__*/_jsx__default["default"]("use", {
|
|
61
|
+
fill: "#FFFFFF",
|
|
62
|
+
fillRule: "evenodd",
|
|
63
|
+
xlinkHref: "#path-chat-bubble"
|
|
64
|
+
}))))) : _svg2 || (_svg2 = /*#__PURE__*/_jsx__default["default"]("svg", {
|
|
65
|
+
width: "9px",
|
|
66
|
+
height: "8px",
|
|
67
|
+
viewBox: "0 0 9 8"
|
|
68
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"]("g", {
|
|
69
|
+
stroke: "none",
|
|
70
|
+
strokeWidth: "1",
|
|
71
|
+
fill: "none",
|
|
72
|
+
fillRule: "evenodd"
|
|
73
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"]("path", {
|
|
74
|
+
d: "M9,6.5 C9,5.9373169 8.6782751,5.4856453 8.2282104,5.196228 C8.2286673,5.1967363 0,0 0,0 L0,8 L7.5627441,8 L7.5658569,7.9933472 C8.3630371,7.9580688 9,7.3058472 9,6.5 Z",
|
|
75
|
+
id: "Path",
|
|
76
|
+
fill: "#1E79C2"
|
|
77
|
+
})))));
|
|
78
|
+
};
|
|
76
79
|
|
|
77
80
|
exports.ChatBubbleArrow = ChatBubbleArrow;
|
|
@@ -36,7 +36,7 @@ const propsBubbles = {
|
|
|
36
36
|
type: reactDesc.PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]).isRequired.description('Define bubble type ').defaultValue(defaultBubbleProps.type),
|
|
37
37
|
title: reactDesc.PropTypes.string.isRequired.description('Title of the bubble').defaultValue(defaultBubbleProps.title),
|
|
38
38
|
time: reactDesc.PropTypes.string.isRequired.description('Time of the bubble').defaultValue(defaultBubbleProps.title),
|
|
39
|
-
body: reactDesc.PropTypes.
|
|
39
|
+
body: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.element]).isRequired.description('Bubble content').defaultValue(defaultBubbleProps.body),
|
|
40
40
|
onClick: reactDesc.PropTypes.string.description('Callback when the bubble is tapped').defaultValue(defaultBubbleProps.onClick),
|
|
41
41
|
errorMessage: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.element]).description('Error message to display at bottom of the bubble').defaultValue(defaultBubbleProps.onClick),
|
|
42
42
|
helpMessage: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.element]).description('Help message to display at bottom of the bubble').defaultValue(defaultBubbleProps.onClick)
|
|
@@ -30,7 +30,7 @@ const StyleBodyWrapper = /*#__PURE__*/styled__default["default"].div.withConfig(
|
|
|
30
30
|
})(["font-size:13px;font-weight:400;line-height:15px;min-height:18px;padding:0px 10px 8px 10px;"]);
|
|
31
31
|
const StyleErrorMessage = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
32
32
|
componentId: "sc-fe8e9o-5"
|
|
33
|
-
})(["font-size:12px;font-weight:400;padding-top:", ";
|
|
33
|
+
})(["font-size:12px;font-weight:400;padding-top:", ";color:", ";align-items:flex-end;justify-content:center;text-align:right;line-height:15px;svg{fill:", ";}a{font-size:12px;color:", ";}.em-ds-icon{margin-left:8px;}"], props => props.theme.space.xxxs, props => props.theme.colors.danger[900], props => props.theme.colors.danger[900], props => props.theme.colors.danger[900]);
|
|
34
34
|
const StyleHelpMessage = /*#__PURE__*/styled__default["default"](StyleErrorMessage).withConfig({
|
|
35
35
|
componentId: "sc-fe8e9o-6"
|
|
36
36
|
})(["font-size:12px;line-height:15px;color:", ";svg{fill:", ";}a{font-size:12px;color:", ";}"], props => props.theme.colors.neutral[500], props => props.theme.colors.danger[500], props => props.theme.colors.danger[500]); // bubble sender/ recipient
|
|
@@ -6,10 +6,15 @@ var _jsx = require('@babel/runtime/helpers/jsx');
|
|
|
6
6
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
7
|
require('core-js/modules/web.url.to-json.js');
|
|
8
8
|
require('core-js/modules/web.dom-collections.iterator.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
12
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
9
14
|
var React = require('react');
|
|
10
15
|
var dsGrid = require('@elliemae/ds-grid');
|
|
11
16
|
var reactDesc = require('react-desc');
|
|
12
|
-
var
|
|
17
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
13
18
|
var styled = require('./styled.js');
|
|
14
19
|
var useValidateProps = require('./config/useValidateProps.js');
|
|
15
20
|
var props = require('./props.js');
|
|
@@ -20,7 +25,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
20
25
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
21
26
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
22
27
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
-
var PaperAirplane__default = /*#__PURE__*/_interopDefaultLegacy(PaperAirplane);
|
|
24
28
|
|
|
25
29
|
var _PaperAirplane, _Grid;
|
|
26
30
|
|
|
@@ -39,9 +43,11 @@ const ChatComposer = props => {
|
|
|
39
43
|
onSend,
|
|
40
44
|
onFocus,
|
|
41
45
|
onBlur,
|
|
46
|
+
onKeyDown,
|
|
42
47
|
maxHeight = 300,
|
|
43
48
|
placeholder,
|
|
44
49
|
inputMaxLength,
|
|
50
|
+
maxLengthMessage,
|
|
45
51
|
buttonDisabled,
|
|
46
52
|
dataTestid,
|
|
47
53
|
actionRef
|
|
@@ -59,7 +65,7 @@ const ChatComposer = props => {
|
|
|
59
65
|
onResize(newHeight);
|
|
60
66
|
setHeight(newHeight);
|
|
61
67
|
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);
|
|
62
|
-
}, [inputValue, internalMaxHeight]);
|
|
68
|
+
}, [inputValue, internalMaxHeight, onResize]);
|
|
63
69
|
React__default["default"].useEffect(() => {
|
|
64
70
|
if (actionRef && actionRef.current) {
|
|
65
71
|
actionRef.current.focusToComposer = () => {
|
|
@@ -70,7 +76,7 @@ const ChatComposer = props => {
|
|
|
70
76
|
inputSend.current.focus();
|
|
71
77
|
};
|
|
72
78
|
}
|
|
73
|
-
}, [actionRef
|
|
79
|
+
}, [actionRef]);
|
|
74
80
|
const handleChange = React__default["default"].useCallback(e => {
|
|
75
81
|
onChange(e.target.value);
|
|
76
82
|
}, [onChange]);
|
|
@@ -96,6 +102,7 @@ const ChatComposer = props => {
|
|
|
96
102
|
value: inputValue,
|
|
97
103
|
onFocus: onFocus,
|
|
98
104
|
onBlur: onBlur,
|
|
105
|
+
onKeyDown: onKeyDown,
|
|
99
106
|
placeholder: placeholder,
|
|
100
107
|
"aria-label": "Message to send",
|
|
101
108
|
"data-testid": "chat-composer-textarea"
|
|
@@ -104,7 +111,7 @@ const ChatComposer = props => {
|
|
|
104
111
|
alignItems: "center"
|
|
105
112
|
}, void 0, /*#__PURE__*/_jsx__default["default"](styled.StyledComposerButton, {
|
|
106
113
|
buttonType: "text",
|
|
107
|
-
icon: _PaperAirplane || (_PaperAirplane = /*#__PURE__*/_jsx__default["default"](
|
|
114
|
+
icon: _PaperAirplane || (_PaperAirplane = /*#__PURE__*/_jsx__default["default"](dsIcons.PaperAirplane, {
|
|
108
115
|
width: 18,
|
|
109
116
|
height: 18
|
|
110
117
|
})),
|
|
@@ -139,8 +146,8 @@ const ChatComposer = props => {
|
|
|
139
146
|
}, void 0, inputMaxLength && hasError ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
140
147
|
children: [/*#__PURE__*/_jsx__default["default"](styled.StyledCounterErrorA11y, {
|
|
141
148
|
role: "alert"
|
|
142
|
-
}, void 0, "You have exceeded the character limit by "
|
|
143
|
-
}) : '', inputMaxLength ? "".concat(inputLength, " / ").concat(inputMaxLength) : ''), _Grid || (_Grid = /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {}))));
|
|
149
|
+
}, void 0, maxLengthMessage || "You have exceeded the character limit by ".concat(inputLength - inputMaxLength)), maxLengthMessage || "Please limit to less than ".concat(inputMaxLength, " characters. ")]
|
|
150
|
+
}) : '', inputMaxLength ? " ".concat(inputLength, " / ").concat(inputMaxLength) : ''), _Grid || (_Grid = /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {}))));
|
|
144
151
|
};
|
|
145
152
|
|
|
146
153
|
ChatComposer.defaultProps = props.defaultComposerPros;
|
|
@@ -13,8 +13,10 @@ const defaultComposerPros = {
|
|
|
13
13
|
onSend: lodash.noop,
|
|
14
14
|
onFocus: lodash.noop,
|
|
15
15
|
onBlur: lodash.noop,
|
|
16
|
+
onKeyDown: lodash.noop,
|
|
16
17
|
maxHeight: 0,
|
|
17
18
|
inputMaxLength: undefined,
|
|
19
|
+
maxLengthMessage: undefined,
|
|
18
20
|
buttonDisabled: false,
|
|
19
21
|
dataTestid: 'ds-chat-composer',
|
|
20
22
|
actionRef: lodash.noop
|
|
@@ -22,11 +24,13 @@ const defaultComposerPros = {
|
|
|
22
24
|
const composerProps = {
|
|
23
25
|
placeholder: reactDesc.PropTypes.string.description('Input Placeholder').defaultValue(defaultComposerPros.placeholder),
|
|
24
26
|
inputValue: reactDesc.PropTypes.string.description('Input value').defaultValue(defaultComposerPros.inputValue),
|
|
27
|
+
maxLengthMessage: reactDesc.PropTypes.string.description('Max length message').defaultValue(defaultComposerPros.maxLengthMessage),
|
|
25
28
|
onChange: reactDesc.PropTypes.func.description('Called when the user types').defaultValue(defaultComposerPros.onChange),
|
|
26
29
|
onResize: reactDesc.PropTypes.func.description('Called the input changes his height').defaultValue(defaultComposerPros.onResize),
|
|
27
30
|
onSend: reactDesc.PropTypes.func.description('Called when the click send').defaultValue(defaultComposerPros.onSend),
|
|
28
31
|
onFocus: reactDesc.PropTypes.func.description('Input focus').defaultValue(defaultComposerPros.onFocus),
|
|
29
32
|
onBlur: reactDesc.PropTypes.func.description('Input blur').defaultValue(defaultComposerPros.onBlur),
|
|
33
|
+
onKeyDown: reactDesc.PropTypes.func.description('Input on key down').defaultValue(defaultComposerPros.onKeyDown),
|
|
30
34
|
maxHeight: reactDesc.PropTypes.number.description('Max height of the composer. Use 0 for no limit').defaultValue(defaultComposerPros.onBlur),
|
|
31
35
|
inputMaxLength: reactDesc.PropTypes.number.description('Max length of the composer. `undefined` for no limit').defaultValue(defaultComposerPros.inputMaxLength),
|
|
32
36
|
buttonDisabled: reactDesc.PropTypes.bool.description('Control the disabled for the send button').defaultValue(defaultComposerPros.buttonDisabled),
|
|
@@ -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
|
|
|
@@ -17,7 +17,7 @@ const StyledChatContainerContentComposer = /*#__PURE__*/styled__default["default
|
|
|
17
17
|
const StyledComposerInput = /*#__PURE__*/styled__default["default"].textarea.withConfig({
|
|
18
18
|
componentId: "sc-1ahwpce-1"
|
|
19
19
|
})(["padding:", ";resize:none;min-height:32px;border-radius:2px;border:solid 1px #cbcfd7;color:#25292f;height:", ";min-width:244px;overflow-y:auto;font-size:13px;font-weight:400;line-height:1;transition:height 0.3s;&:focus{outline:none;border:1px solid ", ";box-shadow:inset 0 0 0 1px #8cc2ed;border-radius:2px;}"], props => props.theme.space.xxs, props => typeof props.height === 'number' ? "".concat(props.height, "px") : props.height, props => props.theme.colors.brand[600]);
|
|
20
|
-
const StyledComposerButton = /*#__PURE__*/styled__default["default"](
|
|
20
|
+
const StyledComposerButton = /*#__PURE__*/styled__default["default"](DSButton.DSButton).withConfig({
|
|
21
21
|
componentId: "sc-1ahwpce-2"
|
|
22
22
|
})(["&:disabled{background:none;svg{fill:#5d6775;}}svg{fill:", ";}&:focus{background:", ";}"], props => props.theme.colors.brand[600], props => props.theme.colors.brand[200]);
|
|
23
23
|
const StyledCounterArea = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
|
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
5
10
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
11
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
12
|
var React = require('react');
|
|
8
13
|
var lodash = require('lodash');
|
|
9
14
|
var reactDesc = require('react-desc');
|
|
10
|
-
var DSIndeterminateProgressIndicator = require('@elliemae/ds-
|
|
15
|
+
var DSIndeterminateProgressIndicator = require('@elliemae/ds-indeterminate-progress-indicator');
|
|
11
16
|
var DSBanner = require('@elliemae/ds-banner');
|
|
12
17
|
var ChatContainerComposer = require('../chat-composer/ChatContainerComposer.js');
|
|
13
18
|
var ChatContainerMessagesList = require('../chat-container-messages-list/ChatContainerMessagesList.js');
|
|
@@ -30,10 +35,10 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
30
35
|
|
|
31
36
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
32
37
|
|
|
33
|
-
const ChatContainer = props => {
|
|
38
|
+
const ChatContainer = props$1 => {
|
|
34
39
|
var _containerRef$current;
|
|
35
40
|
|
|
36
|
-
useValidateProps.useValidateProps(props,
|
|
41
|
+
useValidateProps.useValidateProps(props$1, props.containerProps);
|
|
37
42
|
const {
|
|
38
43
|
sendingText,
|
|
39
44
|
sendingMessages,
|
|
@@ -42,15 +47,21 @@ const ChatContainer = props => {
|
|
|
42
47
|
messagesListProps,
|
|
43
48
|
composerProps,
|
|
44
49
|
composerProps: {
|
|
45
|
-
onResize: onComposerResize
|
|
50
|
+
onResize: onComposerResize,
|
|
51
|
+
onKeyDown: onComposerKeyDown
|
|
46
52
|
},
|
|
47
53
|
actionRef,
|
|
48
54
|
autoScroll,
|
|
49
55
|
device,
|
|
50
56
|
isLoading,
|
|
51
57
|
hasMoreItems,
|
|
52
|
-
getMoreMessages
|
|
53
|
-
|
|
58
|
+
getMoreMessages,
|
|
59
|
+
ariaLabel
|
|
60
|
+
} = props$1;
|
|
61
|
+
const bannerRef = React__default["default"].useRef({
|
|
62
|
+
focusOnWrapper: lodash.noop,
|
|
63
|
+
focusOnLink: lodash.noop
|
|
64
|
+
});
|
|
54
65
|
const containerRef = React__default["default"].useRef();
|
|
55
66
|
const listRef = React__default["default"].useRef({
|
|
56
67
|
scrollToIndex: lodash.noop
|
|
@@ -65,14 +76,38 @@ const ChatContainer = props => {
|
|
|
65
76
|
}
|
|
66
77
|
}, [onComposerResize, messagesListProps.messages, autoScroll]);
|
|
67
78
|
const Container = device === 'desktop' ? styled.StyledChatContainerContent : styled.MobileStyledChatContainerContent;
|
|
79
|
+
const handleTabs = React__default["default"].useCallback(e => {
|
|
80
|
+
if (onComposerKeyDown) onComposerKeyDown(e);else {
|
|
81
|
+
const ref = actionRef || listRef;
|
|
82
|
+
|
|
83
|
+
if (e.shiftKey && e.key === 'Tab') {
|
|
84
|
+
e.preventDefault();
|
|
85
|
+
|
|
86
|
+
if (['top', 'bottom'].includes(bannerPosition)) {
|
|
87
|
+
bannerRef.current.focusOnWrapper();
|
|
88
|
+
} else {
|
|
89
|
+
const last = ref.current.getMessagesInView().pop();
|
|
90
|
+
ref.current.focusToIndexWithoutScroll(last);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}, [actionRef, onComposerKeyDown, bannerPosition]); // Map actions
|
|
95
|
+
|
|
96
|
+
React__default["default"].useEffect(() => {
|
|
97
|
+
if (actionRef && actionRef.current) {
|
|
98
|
+
actionRef.current.focusOnBanner = bannerRef.current.focusOnWrapper;
|
|
99
|
+
actionRef.current.focusOnBannerLink = bannerRef.current.focusOnLink;
|
|
100
|
+
}
|
|
101
|
+
}, [actionRef]);
|
|
68
102
|
return /*#__PURE__*/jsxRuntime.jsxs(Container, {
|
|
69
103
|
rows: ['minmax(0, 1fr)', 'auto'],
|
|
70
104
|
ref: containerRef,
|
|
71
105
|
role: "region",
|
|
72
|
-
"aria-label":
|
|
106
|
+
"aria-label": ariaLabel,
|
|
73
107
|
children: [/*#__PURE__*/_jsx__default["default"]("div", {
|
|
74
108
|
style: {
|
|
75
|
-
position: 'relative'
|
|
109
|
+
position: 'relative',
|
|
110
|
+
overflow: 'hidden'
|
|
76
111
|
}
|
|
77
112
|
}, void 0, /*#__PURE__*/jsxRuntime.jsx(ChatContainerMessagesList.ChatContainerMessagesList, _objectSpread(_objectSpread({}, messagesListProps), {}, {
|
|
78
113
|
actionRef: actionRef || listRef,
|
|
@@ -80,13 +115,17 @@ const ChatContainer = props => {
|
|
|
80
115
|
hasMoreItems: hasMoreItems,
|
|
81
116
|
getMoreMessages: getMoreMessages,
|
|
82
117
|
sendingMessages: sendingMessages,
|
|
83
|
-
sendingText: sendingText
|
|
118
|
+
sendingText: sendingText,
|
|
119
|
+
bannerPosition: bannerPosition,
|
|
120
|
+
bannerRef: bannerRef
|
|
84
121
|
})), ['top', 'bottom'].includes(isLoading) ? /*#__PURE__*/_jsx__default["default"](styled.StyledIndicatorContainer, {
|
|
85
|
-
isLoading: isLoading
|
|
122
|
+
isLoading: isLoading,
|
|
123
|
+
"data-testid": "ds-chat-loading-indicator"
|
|
86
124
|
}, void 0, _DSIndeterminateProgr || (_DSIndeterminateProgr = /*#__PURE__*/_jsx__default["default"](DSIndeterminateProgressIndicator__default["default"], {
|
|
87
125
|
processing: true,
|
|
88
126
|
title: "Loading"
|
|
89
|
-
}))) : null,
|
|
127
|
+
}))) : null, /*#__PURE__*/_jsx__default["default"](styled.StyledIndicatorContainer, {
|
|
128
|
+
linear: true,
|
|
90
129
|
isLoading: bannerPosition
|
|
91
130
|
}, void 0, /*#__PURE__*/_jsx__default["default"](DSBanner__default["default"], {
|
|
92
131
|
showCloseButton: true,
|
|
@@ -100,15 +139,18 @@ const ChatContainer = props => {
|
|
|
100
139
|
},
|
|
101
140
|
onClose: bannerProps.onClose,
|
|
102
141
|
isOpen: true,
|
|
103
|
-
type: DSBanner.BANNER_TYPES.INFO
|
|
104
|
-
|
|
142
|
+
type: bannerProps.type || DSBanner.BANNER_TYPES.INFO,
|
|
143
|
+
actionRef: bannerRef
|
|
144
|
+
})), sendingMessages && sendingMessages.length > 0 ? _StyledIndicatorConta || (_StyledIndicatorConta = /*#__PURE__*/_jsx__default["default"](styled.StyledIndicatorContainer, {
|
|
105
145
|
isLoading: "bottom",
|
|
106
|
-
linear: true
|
|
146
|
+
linear: true,
|
|
147
|
+
"data-testid": "ds-chat-loading-indicator"
|
|
107
148
|
}, void 0, /*#__PURE__*/_jsx__default["default"](DSIndeterminateProgressIndicator__default["default"], {
|
|
108
149
|
processing: true,
|
|
109
150
|
title: "Loading",
|
|
110
151
|
lineOnly: true
|
|
111
152
|
}))) : null), /*#__PURE__*/jsxRuntime.jsx(ChatContainerComposer.ChatComposer, _objectSpread(_objectSpread({}, composerProps), {}, {
|
|
153
|
+
onKeyDown: handleTabs,
|
|
112
154
|
onResize: onResize,
|
|
113
155
|
maxHeight: (((_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.clientHeight) || 0) / 2,
|
|
114
156
|
actionRef: actionRef || listRef
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
6
6
|
|
|
7
|
-
const useValidateProps = (props,
|
|
8
|
-
dsPropsHelpers.useValidateTypescriptPropTypes(props,
|
|
7
|
+
const useValidateProps = (props, propTypes) => {
|
|
8
|
+
dsPropsHelpers.useValidateTypescriptPropTypes(props, propTypes);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
exports.useValidateProps = useValidateProps;
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var reactDesc = require('react-desc');
|
|
6
6
|
var lodash = require('lodash');
|
|
7
|
+
var DSBanner = require('@elliemae/ds-banner');
|
|
7
8
|
var props = require('../chat-container-messages-list/props.js');
|
|
8
9
|
var props$1 = require('../chat-composer/props.js');
|
|
9
10
|
|
|
@@ -18,13 +19,15 @@ const defaultProps = {
|
|
|
18
19
|
getMoreMessages: lodash.noop,
|
|
19
20
|
bannerPosition: undefined,
|
|
20
21
|
bannerProps: {
|
|
22
|
+
type: DSBanner.BANNER_TYPES.INFO,
|
|
21
23
|
label: 'Unread Messages',
|
|
22
24
|
viewLabel: 'View',
|
|
23
25
|
onView: lodash.noop,
|
|
24
26
|
onClose: lodash.noop
|
|
25
27
|
},
|
|
26
28
|
sendingMessages: undefined,
|
|
27
|
-
sendingText: 'Sending'
|
|
29
|
+
sendingText: 'Sending',
|
|
30
|
+
ariaLabel: 'Chat window'
|
|
28
31
|
};
|
|
29
32
|
const containerProps = {
|
|
30
33
|
messagesListProps: reactDesc.PropTypes.object.description('ChatMessageList props "messages" / "onScrollEnds"').defaultValue(defaultProps.messagesListProps),
|
|
@@ -35,10 +38,11 @@ const containerProps = {
|
|
|
35
38
|
hasMoreItems: reactDesc.PropTypes.oneOf(['top', 'bottom', undefined]).description('Show Load More button at the `top` or `bottom` of the container'),
|
|
36
39
|
getMoreMessages: reactDesc.PropTypes.func.description('Called when the user clicks on load more').defaultValue(defaultProps.getMoreMessages),
|
|
37
40
|
bannerPosition: reactDesc.PropTypes.oneOf(['top', 'bottom', undefined]).description('Show Loading messages indicator at the `top` or `bottom` of the container'),
|
|
38
|
-
bannerProps: reactDesc.PropTypes.object.description(
|
|
41
|
+
bannerProps: reactDesc.PropTypes.object.description("Banner configuration:\n label: string;\n viewLabel: string;\n type: BANNER_TYPES;\n onView: () => void;\n onClose: () => void;\n ").defaultValue(defaultProps.bannerProps),
|
|
39
42
|
sendingMessages: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.string), reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.number)]).description('Array of ids of sending messages').defaultValue(defaultProps.sendingMessages),
|
|
40
43
|
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)
|
|
44
|
+
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),
|
|
45
|
+
ariaLabel: reactDesc.PropTypes.string.description('Aria Label description for chat container').defaultValue(defaultProps.ariaLabel)
|
|
42
46
|
};
|
|
43
47
|
|
|
44
48
|
exports.containerProps = containerProps;
|
|
@@ -18,7 +18,7 @@ const StyledChatContainerContent = /*#__PURE__*/styled__default["default"](dsGri
|
|
|
18
18
|
})(["height:100%;min-width:", "px;overflow:hidden;background:", ";position:relative;"], CONTAINER_WIDTH, props => props.theme.colors.neutral['050']);
|
|
19
19
|
const StyledIndicatorContainer = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
20
20
|
componentId: "sc-d732wo-1"
|
|
21
|
-
})(["position:absolute;width:
|
|
21
|
+
})(["transition:0.4s ease-in-out;position:absolute;visibility:hidden;pointer-events:none;width:100%;padding:0 ", ";left:0;right:0;background:", ";", " ", ""], props => !props.linear ? props.theme.space.xxs : 0, props => props.theme.colors.neutral['000'], props => props.isLoading === 'top' ? "\n top: -41px;\n transform: translate(0, 41px);\n visibility: visible;\n pointer-events: auto\n " : '', props => props.isLoading === 'bottom' ? "\n bottom: -41px;\n transform: translate(0, -41px);\n visibility: visible;\n pointer-events: auto;\n " : '');
|
|
22
22
|
const MobileStyledChatContainerContent = /*#__PURE__*/styled__default["default"](StyledChatContainerContent).withConfig({
|
|
23
23
|
componentId: "sc-d732wo-2"
|
|
24
24
|
})(["", ",", "{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;}"], styled$1.StyledTitleLeftBubble, styled$1.StyleBodyWrapper, styled$1.StyledTitleRightBubble, style.Wrapper, style.Title, style.Message, style.Time, styled$2.StyledComposerInput);
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
-
|
|
6
|
+
require('react');
|
|
7
7
|
var dsTruncatedTooltipText = require('@elliemae/ds-truncated-tooltip-text');
|
|
8
8
|
var styled = require('./styled.js');
|
|
9
|
+
var helpers = require('./helpers.js');
|
|
9
10
|
|
|
10
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
12
|
|
|
12
13
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
13
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
14
|
|
|
15
15
|
const ChatContainerHeader = props => {
|
|
16
16
|
const {
|
|
@@ -30,7 +30,7 @@ const ChatContainerHeader = props => {
|
|
|
30
30
|
}, void 0, /*#__PURE__*/_jsx__default["default"](dsTruncatedTooltipText.SimpleTruncatedTooltipText, {
|
|
31
31
|
value: title
|
|
32
32
|
})), /*#__PURE__*/_jsx__default["default"](styled.StyledChatContainerContentHeaderActions, {
|
|
33
|
-
cols:
|
|
33
|
+
cols: helpers.validHeaderChilds(children),
|
|
34
34
|
justifyContent: "flex-end",
|
|
35
35
|
"data-testid": "chat-container-header-children"
|
|
36
36
|
}, void 0, children));
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
7
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
10
|
+
require('core-js/modules/esnext.async-iterator.constructor.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.to-array.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.to-array.js');
|
|
13
|
+
var React = require('react');
|
|
14
|
+
|
|
15
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
+
|
|
17
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
18
|
+
|
|
19
|
+
const validHeaderChilds = children => React__default["default"].Children.toArray(children).filter(e => {
|
|
20
|
+
if (Array.isArray(e.props.children)) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (e.props.children === undefined && e.$$typeof.toString() === 'Symbol(react.element)') {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return !!e.props.children;
|
|
29
|
+
}).map(() => '32px');
|
|
30
|
+
|
|
31
|
+
exports.validHeaderChilds = validHeaderChilds;
|