@elliemae/ds-chat 2.4.2-rc.12 → 2.4.2-rc.13
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/exported-related/bubble/ChatBubble.js +7 -7
- package/cjs/exported-related/bubble/styled.js +30 -1
- package/cjs/exported-related/chat-card/props.js +2 -2
- package/cjs/exported-related/chat-container-header/props.js +1 -1
- package/cjs/exported-related/chat-sidebar/SideBarChat.js +1 -3
- package/cjs/exported-related/chat-sidebar/props.js +5 -1
- package/cjs/exported-related/chat-sidebar/sidebar-button/SidebarButton.js +1 -1
- package/cjs/exported-related/grid-influencer/styled.js +6 -2
- package/cjs/exported-related/message-delimiter/styled.js +1 -1
- package/cjs/exported-related/tile-button/TileButton.js +4 -4
- package/cjs/exported-related/tile-button/styled.js +7 -5
- package/cjs/parts/chat-composer/ChatContainerComposer.js +8 -13
- package/cjs/parts/chat-composer/styled.js +2 -2
- package/cjs/parts/chat-container/ChatContainer.js +9 -15
- package/cjs/parts/chat-container/styled.js +11 -1
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js +24 -50
- package/cjs/parts/chat-container-messages-list/styled.js +5 -1
- package/cjs/parts/chat-container-messages-list/useGetNewMessages.js +0 -1
- package/cjs/react-desc-prop-types.js +42 -5
- package/cjs/styled.js +1 -1
- package/esm/exported-related/bubble/ChatBubble.js +7 -7
- package/esm/exported-related/bubble/styled.js +30 -1
- package/esm/exported-related/chat-card/props.js +2 -2
- package/esm/exported-related/chat-container-header/props.js +1 -1
- package/esm/exported-related/chat-sidebar/SideBarChat.js +1 -3
- package/esm/exported-related/chat-sidebar/props.js +5 -1
- package/esm/exported-related/chat-sidebar/sidebar-button/SidebarButton.js +1 -1
- package/esm/exported-related/grid-influencer/styled.js +6 -2
- package/esm/exported-related/message-delimiter/styled.js +1 -1
- package/esm/exported-related/tile-button/TileButton.js +4 -4
- package/esm/exported-related/tile-button/styled.js +7 -4
- package/esm/parts/chat-composer/ChatContainerComposer.js +6 -11
- package/esm/parts/chat-composer/styled.js +2 -2
- package/esm/parts/chat-container/ChatContainer.js +9 -15
- package/esm/parts/chat-container/styled.js +11 -1
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js +24 -50
- package/esm/parts/chat-container-messages-list/styled.js +5 -1
- package/esm/parts/chat-container-messages-list/useGetNewMessages.js +0 -1
- package/esm/react-desc-prop-types.js +42 -5
- package/esm/styled.js +1 -1
- package/package.json +10 -10
|
@@ -23,8 +23,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
23
23
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
24
24
|
|
|
25
25
|
const ChatContainer = props => {
|
|
26
|
-
var _messagesListProps$me2, _containerRef$current;
|
|
27
|
-
|
|
28
26
|
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
29
27
|
useValidateTypescriptPropTypes(propsWithDefault, ChatContainerPropTypes);
|
|
30
28
|
const globalAttributes = useGetGlobalAttributes(propsWithDefault);
|
|
@@ -72,23 +70,19 @@ const ChatContainer = props => {
|
|
|
72
70
|
const ref = actionRef || listRef;
|
|
73
71
|
|
|
74
72
|
if (e.shiftKey && e.key === 'Tab') {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if (((_messagesListProps$me = messagesListProps.messages) === null || _messagesListProps$me === void 0 ? void 0 : _messagesListProps$me.length) > 0) {
|
|
73
|
+
if (messagesListProps.messages?.length > 0) {
|
|
78
74
|
e.preventDefault();
|
|
79
75
|
|
|
80
76
|
if (['top', 'bottom'].includes(bannerPosition)) {
|
|
81
77
|
bannerRef.current.focusOnWrapper();
|
|
82
78
|
} else {
|
|
83
|
-
var _ref$current;
|
|
84
|
-
|
|
85
79
|
const last = ref.current.getMessagesInView().pop();
|
|
86
|
-
|
|
80
|
+
ref.current?.focusToIndexWithoutScroll(last);
|
|
87
81
|
}
|
|
88
82
|
}
|
|
89
83
|
}
|
|
90
84
|
}
|
|
91
|
-
}, [actionRef, onComposerKeyDown, bannerPosition,
|
|
85
|
+
}, [actionRef, onComposerKeyDown, bannerPosition, messagesListProps.messages?.length]); // Map actions
|
|
92
86
|
|
|
93
87
|
React.useEffect(() => {
|
|
94
88
|
if (actionRef && actionRef.current) {
|
|
@@ -125,17 +119,17 @@ const ChatContainer = props => {
|
|
|
125
119
|
isLoading: bannerPosition
|
|
126
120
|
}, void 0, /*#__PURE__*/_jsx(DSBanner, {
|
|
127
121
|
showCloseButton: true,
|
|
128
|
-
label:
|
|
122
|
+
label: bannerProps?.label || 'Unread messages',
|
|
129
123
|
containerProps: {
|
|
130
124
|
id: 'ds-chat-banner'
|
|
131
125
|
},
|
|
132
126
|
actionLink: {
|
|
133
|
-
label:
|
|
134
|
-
onClick: bannerProps
|
|
127
|
+
label: bannerProps?.viewLabel || 'View',
|
|
128
|
+
onClick: bannerProps?.onView
|
|
135
129
|
},
|
|
136
|
-
onClose: bannerProps
|
|
130
|
+
onClose: bannerProps?.onClose,
|
|
137
131
|
isOpen: true,
|
|
138
|
-
type:
|
|
132
|
+
type: bannerProps?.type || BANNER_TYPES.INFO,
|
|
139
133
|
actionRef: bannerRef
|
|
140
134
|
})), sendingMessages && sendingMessages.length > 0 ? /*#__PURE__*/_jsx(StyledIndicatorContainer, {
|
|
141
135
|
isLoading: "bottom",
|
|
@@ -148,7 +142,7 @@ const ChatContainer = props => {
|
|
|
148
142
|
})) : null), /*#__PURE__*/jsx(ChatComposer, _objectSpread(_objectSpread({}, composerProps), {}, {
|
|
149
143
|
onKeyDown: handleTabs,
|
|
150
144
|
onResize: onResize,
|
|
151
|
-
maxHeight: (
|
|
145
|
+
maxHeight: (containerRef.current?.clientHeight || 0) / 2,
|
|
152
146
|
actionRef: actionRef || listRef
|
|
153
147
|
}))]
|
|
154
148
|
}));
|
|
@@ -10,7 +10,17 @@ const StyledChatContainerContent = /*#__PURE__*/styled(Grid).withConfig({
|
|
|
10
10
|
})(["height:100%;min-width:", "px;overflow:hidden;background:", ";position:relative;"], CONTAINER_WIDTH, props => props.theme.colors.neutral['050']);
|
|
11
11
|
const StyledIndicatorContainer = /*#__PURE__*/styled.div.withConfig({
|
|
12
12
|
componentId: "sc-d732wo-1"
|
|
13
|
-
})(["transition:0.4s ease-in-out;position:absolute;visibility:hidden;pointer-events:none;width:100%;padding:0 ", ";left:0;right:0;background:", ";", " ", " & div,a{font-size:13px;}"], props => !props.linear ? props.theme.space.xxs : 0, props => props.theme.colors.neutral['000'], props => props.isLoading === 'top' ?
|
|
13
|
+
})(["transition:0.4s ease-in-out;position:absolute;visibility:hidden;pointer-events:none;width:100%;padding:0 ", ";left:0;right:0;background:", ";", " ", " & div,a{font-size:13px;}"], props => !props.linear ? props.theme.space.xxs : 0, props => props.theme.colors.neutral['000'], props => props.isLoading === 'top' ? `
|
|
14
|
+
top: -41px;
|
|
15
|
+
transform: translate(0, 41px);
|
|
16
|
+
visibility: visible;
|
|
17
|
+
pointer-events: auto;
|
|
18
|
+
` : '', props => props.isLoading === 'bottom' ? `
|
|
19
|
+
bottom: -41px;
|
|
20
|
+
transform: translate(0, -41px);
|
|
21
|
+
visibility: visible;
|
|
22
|
+
pointer-events: auto;
|
|
23
|
+
` : '');
|
|
14
24
|
const MobileStyledChatContainerContent = /*#__PURE__*/styled(StyledChatContainerContent).withConfig({
|
|
15
25
|
componentId: "sc-d732wo-2"
|
|
16
26
|
})(["", ",", "{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;}", "{font-size:16px;}"], StyledTitleLeftBubble, StyleBodyWrapper, StyledTitleRightBubble, Wrapper, Title, Message, Time, StyledComposerInput, StyledIndicatorContainer);
|
|
@@ -69,7 +69,7 @@ const ChatContainerMessagesList = props => {
|
|
|
69
69
|
totalSize,
|
|
70
70
|
virtualItems
|
|
71
71
|
} = useVirtual(_objectSpread(_objectSpread({
|
|
72
|
-
size: messages
|
|
72
|
+
size: messages?.length,
|
|
73
73
|
parentRef: virtualListRef,
|
|
74
74
|
overscan: 15
|
|
75
75
|
}, getPadding({
|
|
@@ -81,8 +81,6 @@ const ChatContainerMessagesList = props => {
|
|
|
81
81
|
}));
|
|
82
82
|
const newMessages = useGetNewMessages(messages);
|
|
83
83
|
const debouncedScroll = React.useMemo(() => debounce(() => {
|
|
84
|
-
var _virtualListRef$curre;
|
|
85
|
-
|
|
86
84
|
if (document.visibilityState === 'hidden') {
|
|
87
85
|
pendingOnScroll.current = true;
|
|
88
86
|
return [];
|
|
@@ -93,7 +91,7 @@ const ChatContainerMessagesList = props => {
|
|
|
93
91
|
const {
|
|
94
92
|
bottom,
|
|
95
93
|
top
|
|
96
|
-
} =
|
|
94
|
+
} = virtualListRef.current?.getBoundingClientRect();
|
|
97
95
|
const list = virtualListRef.current.querySelectorAll('[data-element="chat-element-list-item"]');
|
|
98
96
|
const indexList = [];
|
|
99
97
|
list.forEach(item => {
|
|
@@ -108,7 +106,7 @@ const ChatContainerMessagesList = props => {
|
|
|
108
106
|
}, 500), [onScrollEnds]);
|
|
109
107
|
const onScrollStop = React.useCallback(debouncedScroll, [debouncedScroll]);
|
|
110
108
|
const onlyFocus = React.useCallback(index => {
|
|
111
|
-
virtualListRef.current.querySelector(
|
|
109
|
+
virtualListRef.current.querySelector(`[data-index="${index}"]`).focus();
|
|
112
110
|
}, []);
|
|
113
111
|
const scrollAndFocus = React.useCallback(function (index) {
|
|
114
112
|
let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
@@ -146,9 +144,7 @@ const ChatContainerMessagesList = props => {
|
|
|
146
144
|
actionRef.current.focusToIndexWithoutScroll = onlyFocus;
|
|
147
145
|
|
|
148
146
|
actionRef.current.focusToList = () => {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
(_virtualListRef$curre2 = virtualListRef.current) === null || _virtualListRef$curre2 === void 0 ? void 0 : _virtualListRef$curre2.focus();
|
|
147
|
+
virtualListRef.current?.focus();
|
|
152
148
|
};
|
|
153
149
|
}
|
|
154
150
|
}, [actionRef, onScrollStop, onlyFocus, scrollAndFocus, vScroll]);
|
|
@@ -184,13 +180,9 @@ const ChatContainerMessagesList = props => {
|
|
|
184
180
|
e.preventDefault();
|
|
185
181
|
|
|
186
182
|
if (index > 0) {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
((_virtualListRef$curre3 = virtualListRef.current) === null || _virtualListRef$curre3 === void 0 ? void 0 : _virtualListRef$curre3.querySelector("[data-index=\"".concat(index - 1, "\"]"))).focus();
|
|
183
|
+
(virtualListRef.current?.querySelector(`[data-index="${index - 1}"]`)).focus();
|
|
190
184
|
} else if (hasMoreItems === 'top') {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
(_loadMoreRef$current = loadMoreRef.current) === null || _loadMoreRef$current === void 0 ? void 0 : _loadMoreRef$current.focus();
|
|
185
|
+
loadMoreRef.current?.focus();
|
|
194
186
|
}
|
|
195
187
|
|
|
196
188
|
break;
|
|
@@ -198,10 +190,8 @@ const ChatContainerMessagesList = props => {
|
|
|
198
190
|
case 'ArrowDown':
|
|
199
191
|
e.preventDefault();
|
|
200
192
|
|
|
201
|
-
if (index <
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
((_virtualListRef$curre4 = virtualListRef.current) === null || _virtualListRef$curre4 === void 0 ? void 0 : _virtualListRef$curre4.querySelector("[data-index=\"".concat(index + 1, "\"]"))).focus();
|
|
193
|
+
if (index < messages?.length - 1) {
|
|
194
|
+
(virtualListRef.current?.querySelector(`[data-index="${index + 1}"]`)).focus();
|
|
205
195
|
}
|
|
206
196
|
|
|
207
197
|
break;
|
|
@@ -213,37 +203,29 @@ const ChatContainerMessagesList = props => {
|
|
|
213
203
|
|
|
214
204
|
case 'End':
|
|
215
205
|
e.preventDefault();
|
|
216
|
-
scrollAndFocus(
|
|
206
|
+
scrollAndFocus(messages?.length - 1);
|
|
217
207
|
break;
|
|
218
208
|
|
|
219
209
|
case 'Tab':
|
|
220
210
|
if (hasMoreItems === 'bottom' && !e.shiftKey) {
|
|
221
|
-
var _loadMoreRef$current2;
|
|
222
|
-
|
|
223
211
|
e.preventDefault();
|
|
224
|
-
|
|
212
|
+
loadMoreRef.current?.focus();
|
|
225
213
|
} else if (hasMoreItems === 'top' && e.shiftKey) {
|
|
226
|
-
var _loadMoreRef$current3;
|
|
227
|
-
|
|
228
214
|
e.preventDefault();
|
|
229
|
-
|
|
215
|
+
loadMoreRef.current?.focus();
|
|
230
216
|
} else if (!e.shiftKey) {
|
|
231
217
|
if (bannerPosition) {
|
|
232
|
-
var _bannerRef$current;
|
|
233
|
-
|
|
234
218
|
e.preventDefault();
|
|
235
|
-
bannerRef
|
|
219
|
+
bannerRef?.current?.focusOnWrapper();
|
|
236
220
|
}
|
|
237
221
|
} else {
|
|
238
|
-
var _virtualListRef$curre5;
|
|
239
|
-
|
|
240
222
|
e.preventDefault();
|
|
241
|
-
|
|
223
|
+
virtualListRef.current?.focus();
|
|
242
224
|
}
|
|
243
225
|
|
|
244
226
|
break;
|
|
245
227
|
}
|
|
246
|
-
}, [bannerRef, hasMoreItems, messages
|
|
228
|
+
}, [bannerRef, hasMoreItems, messages?.length, bannerPosition, scrollAndFocus]);
|
|
247
229
|
const handleListKey = React.useCallback(e => {
|
|
248
230
|
const {
|
|
249
231
|
key
|
|
@@ -254,9 +236,7 @@ const ChatContainerMessagesList = props => {
|
|
|
254
236
|
e.preventDefault();
|
|
255
237
|
|
|
256
238
|
if (document.activeElement !== loadMoreRef.current) {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
onlyFocus((_onScrollStop = onScrollStop()) === null || _onScrollStop === void 0 ? void 0 : _onScrollStop.shift());
|
|
239
|
+
onlyFocus(onScrollStop()?.shift());
|
|
260
240
|
}
|
|
261
241
|
|
|
262
242
|
break;
|
|
@@ -265,11 +245,9 @@ const ChatContainerMessagesList = props => {
|
|
|
265
245
|
e.preventDefault();
|
|
266
246
|
|
|
267
247
|
if (document.activeElement === loadMoreRef.current) {
|
|
268
|
-
virtualListRef.current.querySelector(
|
|
248
|
+
virtualListRef.current.querySelector(`[data-index="0"]`).focus();
|
|
269
249
|
} else {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
onlyFocus((_onScrollStop2 = onScrollStop()) === null || _onScrollStop2 === void 0 ? void 0 : _onScrollStop2.pop());
|
|
250
|
+
onlyFocus(onScrollStop()?.pop());
|
|
273
251
|
}
|
|
274
252
|
|
|
275
253
|
break;
|
|
@@ -281,16 +259,14 @@ const ChatContainerMessagesList = props => {
|
|
|
281
259
|
|
|
282
260
|
case 'End':
|
|
283
261
|
e.preventDefault();
|
|
284
|
-
scrollAndFocus(
|
|
262
|
+
scrollAndFocus(messages?.length - 1);
|
|
285
263
|
break;
|
|
286
264
|
|
|
287
265
|
case 'Tab':
|
|
288
266
|
if (document.activeElement !== loadMoreRef.current) {
|
|
289
267
|
if (hasMoreItems === 'bottom' && !e.shiftKey) {
|
|
290
|
-
var _loadMoreRef$current4;
|
|
291
|
-
|
|
292
268
|
e.preventDefault();
|
|
293
|
-
|
|
269
|
+
loadMoreRef.current?.focus();
|
|
294
270
|
} else if (!e.shiftKey) {
|
|
295
271
|
e.preventDefault();
|
|
296
272
|
actionRef.current.focusToComposer();
|
|
@@ -299,15 +275,13 @@ const ChatContainerMessagesList = props => {
|
|
|
299
275
|
e.preventDefault();
|
|
300
276
|
actionRef.current.focusToComposer();
|
|
301
277
|
} else {
|
|
302
|
-
var _virtualListRef$curre6;
|
|
303
|
-
|
|
304
278
|
e.preventDefault();
|
|
305
|
-
|
|
279
|
+
virtualListRef.current?.focus();
|
|
306
280
|
}
|
|
307
281
|
|
|
308
282
|
break;
|
|
309
283
|
}
|
|
310
|
-
}, [actionRef, hasMoreItems, messages
|
|
284
|
+
}, [actionRef, hasMoreItems, messages?.length, onScrollStop, onlyFocus, scrollAndFocus]);
|
|
311
285
|
const render = React.useMemo(() => virtualItems.map(virtualItem => {
|
|
312
286
|
const {
|
|
313
287
|
index,
|
|
@@ -320,7 +294,7 @@ const ChatContainerMessagesList = props => {
|
|
|
320
294
|
position: 'absolute',
|
|
321
295
|
top: 0,
|
|
322
296
|
left: 0,
|
|
323
|
-
transform:
|
|
297
|
+
transform: `translateY(${start}px)`,
|
|
324
298
|
width: '100%'
|
|
325
299
|
};
|
|
326
300
|
return /*#__PURE__*/jsx(ListItem, {
|
|
@@ -339,7 +313,7 @@ const ChatContainerMessagesList = props => {
|
|
|
339
313
|
jsx(ChatBubble, _objectSpread(_objectSpread({}, row), {}, {
|
|
340
314
|
helpMessage: isSending ? sendingText : row.helpMessage
|
|
341
315
|
})) : null, row.type === BUBBLE_TYPES.DELIMITER ? /*#__PURE__*/jsx(MessageDelimiter, _objectSpread({}, row)) : null, row.type === BUBBLE_TYPES.SYSTEM ? /*#__PURE__*/jsx(SystemMessage, _objectSpread({}, row)) : null)
|
|
342
|
-
},
|
|
316
|
+
}, `ds-chat-bubble-${index}-${row.dsId}-${row.type}`);
|
|
343
317
|
}), [virtualItems, messages, sendingMessages, handleKey, sendingText]);
|
|
344
318
|
return /*#__PURE__*/jsxs(StyledWrapper, _objectSpread(_objectSpread({}, globalAttributes), {}, {
|
|
345
319
|
children: [/*#__PURE__*/jsx(StyledChatContainerContentList, {
|
|
@@ -349,7 +323,7 @@ const ChatContainerMessagesList = props => {
|
|
|
349
323
|
role: "list",
|
|
350
324
|
onKeyDown: handleListKey,
|
|
351
325
|
children: /*#__PURE__*/_jsx(StyledChatContainerContentListScroll, {
|
|
352
|
-
height:
|
|
326
|
+
height: `${totalSize}px`
|
|
353
327
|
}, void 0, !isLoading && hasMoreItems ? /*#__PURE__*/_jsx(StyledLoadMoreContainer, {
|
|
354
328
|
hasMoreItems: hasMoreItems
|
|
355
329
|
}, void 0, /*#__PURE__*/_jsx(DSButton, {
|
|
@@ -8,7 +8,11 @@ const StyledWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
|
8
8
|
|
|
9
9
|
const StyledWrapperListItem = /*#__PURE__*/styled.div.withConfig({
|
|
10
10
|
componentId: "sc-1jhprzr-1"
|
|
11
|
-
})(["min-width:100%;", ";", ";", ";"], props => props.type === BUBBLE_TYPES.SENDER &&
|
|
11
|
+
})(["min-width:100%;", ";", ";", ";"], props => props.type === BUBBLE_TYPES.SENDER && `padding: ${props.theme.space.xxs} ${props.theme.space.xxs} ${props.theme.space.xxs} 13%
|
|
12
|
+
`, props => props.type === BUBBLE_TYPES.RECIPIENT && `padding: ${props.theme.space.xxs} 13% ${props.theme.space.xxs}
|
|
13
|
+
${props.theme.space.xxs}
|
|
14
|
+
`, props => props.type === BUBBLE_TYPES.SYSTEM && `padding: ${props.theme.space.xxs} 0px
|
|
15
|
+
`);
|
|
12
16
|
const StyledChatContainerContentList = /*#__PURE__*/styled.div.withConfig({
|
|
13
17
|
componentId: "sc-1jhprzr-2"
|
|
14
18
|
})(["width:100%;height:100%;padding:", ";padding-bottom:0;overflow-y:auto;overflow-x:hidden;"], props => props.theme.space.xs);
|
|
@@ -43,7 +43,17 @@ const ChatComposerPropTypes = {
|
|
|
43
43
|
inputMaxLength: PropTypes.number.description('Max length of the composer. `undefined` for no limit').defaultValue(defaultPropsComposer.inputMaxLength),
|
|
44
44
|
buttonDisabled: PropTypes.bool.description('Control the disabled for the send button').defaultValue(defaultPropsComposer.buttonDisabled),
|
|
45
45
|
dataTestid: PropTypes.string.description('Data testid').defaultValue(defaultPropsComposer.placeholder),
|
|
46
|
-
actionRef: PropTypes.object.description(
|
|
46
|
+
actionRef: PropTypes.object.description(`Reference:
|
|
47
|
+
{
|
|
48
|
+
scrollToIndex: (n: number) => void,
|
|
49
|
+
getMessagesInView: () => number[],
|
|
50
|
+
focusToIndex: (n: number) => void,
|
|
51
|
+
focusToList: () => void,
|
|
52
|
+
focusToComposer: () => void,
|
|
53
|
+
focusToSend: () => void,
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
`).defaultValue(defaultPropsComposer.actionRef)
|
|
47
57
|
};
|
|
48
58
|
const defaultPropsMessagesList = {
|
|
49
59
|
messages: [],
|
|
@@ -57,8 +67,19 @@ const defaultPropsMessagesList = {
|
|
|
57
67
|
};
|
|
58
68
|
const ChatContainerMessagesListPropTypes = _objectSpread(_objectSpread({}, globalAttributesPropTypes), {}, {
|
|
59
69
|
messages: PropTypes.arrayOf(PropTypes.object).description('The array of out-of-the-box items you want to render inside the ChatMessageList').defaultValue(defaultPropsMessagesList.messages),
|
|
60
|
-
actionRef: PropTypes.object.description(
|
|
61
|
-
|
|
70
|
+
actionRef: PropTypes.object.description(`Reference:
|
|
71
|
+
{
|
|
72
|
+
scrollToIndex: (n: number) => void,
|
|
73
|
+
getMessagesInView: () => number[],
|
|
74
|
+
focusToIndex: (n: number) => void,
|
|
75
|
+
focusToIndexWithoutScroll: (n: number) => void,
|
|
76
|
+
focusToList: () => void,
|
|
77
|
+
focusToComposer: () => void,
|
|
78
|
+
focusToSend: () => void,
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
`).defaultValue(defaultPropsMessagesList.actionRef),
|
|
82
|
+
onScrollEnds: PropTypes.func.description(`Called when the scroll stops.`),
|
|
62
83
|
isLoading: PropTypes.oneOf(['top', 'bottom', undefined]).description('Keeps the load more space while the loading is in progress'),
|
|
63
84
|
hasMoreItems: PropTypes.oneOf(['top', 'bottom', undefined]).description('Show Load More button at the `top` or `bottom` of the container'),
|
|
64
85
|
getMoreMessages: PropTypes.func.description('Called when the user clicks on load more').defaultValue(defaultPropsMessagesList.getMoreMessages),
|
|
@@ -94,10 +115,26 @@ const ChatContainerPropTypes = _objectSpread(_objectSpread({}, globalAttributesP
|
|
|
94
115
|
hasMoreItems: PropTypes.oneOf(['top', 'bottom', undefined]).description('Show Load More button at the `top` or `bottom` of the container'),
|
|
95
116
|
getMoreMessages: PropTypes.func.description('Called when the user clicks on load more').defaultValue(defaultProps.getMoreMessages),
|
|
96
117
|
bannerPosition: PropTypes.oneOf(['top', 'bottom', undefined]).description('Show Loading messages indicator at the `top` or `bottom` of the container'),
|
|
97
|
-
bannerProps: PropTypes.object.description(
|
|
118
|
+
bannerProps: PropTypes.object.description(`Banner configuration:
|
|
119
|
+
label: string;
|
|
120
|
+
viewLabel: string;
|
|
121
|
+
type: BANNER_TYPES;
|
|
122
|
+
onView: () => void;
|
|
123
|
+
onClose: () => void;
|
|
124
|
+
`).defaultValue(defaultProps.bannerProps),
|
|
98
125
|
sendingMessages: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.number)]).description('Array of ids of sending messages').defaultValue(defaultProps.sendingMessages),
|
|
99
126
|
sendingText: PropTypes.string.description('Label description for messages in sending status').defaultValue(defaultProps.sendingText),
|
|
100
|
-
actionRef: PropTypes.object.description(
|
|
127
|
+
actionRef: PropTypes.object.description(`Reference:
|
|
128
|
+
{
|
|
129
|
+
scrollToIndex: (n: number) => void,
|
|
130
|
+
getMessagesInView: () => number[],
|
|
131
|
+
focusToIndex: (n: number) => void,
|
|
132
|
+
focusToList: () => void,
|
|
133
|
+
focusToComposer: () => void,
|
|
134
|
+
focusToSend: () => void,
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
`).defaultValue(defaultProps.actionRef)
|
|
101
138
|
});
|
|
102
139
|
|
|
103
140
|
export { ChatComposerPropTypes, ChatContainerMessagesListPropTypes, ChatContainerPropTypes, defaultProps, defaultPropsComposer, defaultPropsMessagesList };
|
package/esm/styled.js
CHANGED
|
@@ -3,6 +3,6 @@ const BUTTON_SIDEBAR_HEIGHT = 48;
|
|
|
3
3
|
const BUTTON_FLOATING = 56;
|
|
4
4
|
const BOX_SHADOW = '0 5px 8px 0 rgba(53,60,70,0.55)';
|
|
5
5
|
const BOX_SHADOW_FLOATING = '0 5px 8px 0 rgba(53,60,70,0.35)';
|
|
6
|
-
const BOX_SHADOW_INSET =
|
|
6
|
+
const BOX_SHADOW_INSET = `inset 100px 3px 4px 0 rgba(53,60,70,0.50)`;
|
|
7
7
|
|
|
8
8
|
export { BOX_SHADOW, BOX_SHADOW_FLOATING, BOX_SHADOW_INSET, BUTTON_FLOATING, BUTTON_SIDEBAR_HEIGHT, MIN_WIDTH_SIDEBAR };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-chat",
|
|
3
|
-
"version": "2.4.2-rc.
|
|
3
|
+
"version": "2.4.2-rc.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Chat",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -261,15 +261,15 @@
|
|
|
261
261
|
"generateSubmodules": true
|
|
262
262
|
},
|
|
263
263
|
"dependencies": {
|
|
264
|
-
"@elliemae/ds-banner": "2.4.2-rc.
|
|
265
|
-
"@elliemae/ds-button": "2.4.2-rc.
|
|
266
|
-
"@elliemae/ds-grid": "2.4.2-rc.
|
|
267
|
-
"@elliemae/ds-icons": "2.4.2-rc.
|
|
268
|
-
"@elliemae/ds-indeterminate-progress-indicator": "2.4.2-rc.
|
|
269
|
-
"@elliemae/ds-props-helpers": "2.4.2-rc.
|
|
270
|
-
"@elliemae/ds-system": "2.4.2-rc.
|
|
271
|
-
"@elliemae/ds-tooltip": "2.4.2-rc.
|
|
272
|
-
"@elliemae/ds-truncated-tooltip-text": "2.4.2-rc.
|
|
264
|
+
"@elliemae/ds-banner": "2.4.2-rc.13",
|
|
265
|
+
"@elliemae/ds-button": "2.4.2-rc.13",
|
|
266
|
+
"@elliemae/ds-grid": "2.4.2-rc.13",
|
|
267
|
+
"@elliemae/ds-icons": "2.4.2-rc.13",
|
|
268
|
+
"@elliemae/ds-indeterminate-progress-indicator": "2.4.2-rc.13",
|
|
269
|
+
"@elliemae/ds-props-helpers": "2.4.2-rc.13",
|
|
270
|
+
"@elliemae/ds-system": "2.4.2-rc.13",
|
|
271
|
+
"@elliemae/ds-tooltip": "2.4.2-rc.13",
|
|
272
|
+
"@elliemae/ds-truncated-tooltip-text": "2.4.2-rc.13",
|
|
273
273
|
"prop-types": "~15.7.2",
|
|
274
274
|
"react-desc": "~4.1.2",
|
|
275
275
|
"react-virtual": "~2.8.2"
|