@elliemae/ds-chat 2.2.0-alpha.3 → 3.0.0-next.0
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 +26 -54
- package/cjs/index.d.js +2 -27
- package/cjs/index.js +44 -69
- package/cjs/parts/bubble/ChatBubble.js +64 -74
- package/cjs/parts/bubble/ChatBubbleArrow.js +79 -96
- package/cjs/parts/bubble/config/useValidateProps.js +24 -47
- package/cjs/parts/bubble/index.js +12 -38
- package/cjs/parts/bubble/props.js +48 -60
- package/cjs/parts/bubble/styled.js +48 -141
- package/cjs/parts/chat-card/ChatCard.js +39 -55
- package/cjs/parts/chat-card/config/useValidateProps.js +9 -36
- package/cjs/parts/chat-card/index.js +10 -36
- package/cjs/parts/chat-card/props.js +12 -39
- package/cjs/parts/chat-card/styled.js +36 -71
- package/cjs/parts/chat-composer/ChatContainerComposer.js +98 -92
- package/cjs/parts/chat-composer/config/useValidateProps.js +9 -36
- package/cjs/parts/chat-composer/index.js +10 -36
- package/cjs/parts/chat-composer/props.js +36 -73
- package/cjs/parts/chat-composer/styled.js +34 -102
- package/cjs/parts/chat-container/ChatContainer.js +140 -122
- package/cjs/parts/chat-container/config/useValidateProps.js +9 -36
- package/cjs/parts/chat-container/index.js +10 -36
- package/cjs/parts/chat-container/props.js +42 -85
- package/cjs/parts/chat-container/styled.js +23 -104
- package/cjs/parts/chat-container-header/ChatContainerHeader.js +30 -48
- package/cjs/parts/chat-container-header/helpers.js +25 -38
- package/cjs/parts/chat-container-header/styled.js +24 -59
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js +225 -163
- package/cjs/parts/chat-container-messages-list/config/useValidateProps.js +9 -36
- package/cjs/parts/chat-container-messages-list/index.js +10 -36
- package/cjs/parts/chat-container-messages-list/props.js +24 -62
- package/cjs/parts/chat-container-messages-list/styled.js +38 -100
- package/cjs/parts/chat-empty-state/ChatEmptyState.js +42 -58
- package/cjs/parts/chat-empty-state/config/useValidateProps.js +9 -36
- package/cjs/parts/chat-empty-state/props.js +12 -39
- package/cjs/parts/chat-empty-state/styled.js +21 -47
- package/cjs/parts/chat-sidebar/SideBarChat.js +81 -82
- package/cjs/parts/chat-sidebar/config/useValidateProps.js +9 -36
- package/cjs/parts/chat-sidebar/index.js +10 -36
- package/cjs/parts/chat-sidebar/props.js +30 -72
- package/cjs/parts/chat-sidebar/styled.js +20 -56
- package/cjs/parts/floating-button/FloatingButton.js +34 -47
- package/cjs/parts/floating-button/index.js +9 -28
- package/cjs/parts/floating-button/props.js +15 -42
- package/cjs/parts/floating-button/styled.js +17 -63
- package/cjs/parts/floating-container/styled.js +17 -47
- package/cjs/parts/grid-influencer/InfluencerContainer.js +21 -41
- package/cjs/parts/grid-influencer/styled.js +21 -56
- package/cjs/parts/message-delimiter/MessageDelimiter.js +39 -53
- package/cjs/parts/message-delimiter/config/useValidateProps.js +9 -36
- package/cjs/parts/message-delimiter/index.js +10 -36
- package/cjs/parts/message-delimiter/props.js +19 -44
- package/cjs/parts/message-delimiter/styled.js +24 -53
- package/cjs/parts/sidebar-button/SidebarButton.js +53 -52
- package/cjs/parts/sidebar-button/index.js +2 -20
- package/cjs/parts/sidebar-button/props.js +26 -49
- package/cjs/parts/sidebar-button/styled.js +24 -68
- package/cjs/parts/system-message/SystemMessage.js +40 -55
- package/cjs/parts/system-message/config/useValidateProps.js +9 -36
- package/cjs/parts/system-message/index.js +10 -36
- package/cjs/parts/system-message/props.js +15 -42
- package/cjs/parts/system-message/style.js +32 -75
- package/cjs/parts/tile-button/TileButton.js +68 -98
- package/cjs/parts/tile-button/config/useValidateProps.js +9 -36
- package/cjs/parts/tile-button/index.js +10 -36
- package/cjs/parts/tile-button/props.js +45 -83
- package/cjs/parts/tile-button/styled.js +77 -229
- package/cjs/prop-types.js +26 -53
- package/cjs/styled.js +14 -42
- package/esm/ChatDataTestids.js +22 -25
- package/esm/index.d.js +1 -2
- package/esm/index.js +14 -40
- package/esm/parts/bubble/ChatBubble.js +51 -51
- package/esm/parts/bubble/ChatBubbleArrow.js +71 -67
- package/esm/parts/bubble/config/useValidateProps.js +19 -17
- package/esm/parts/bubble/index.js +2 -9
- package/esm/parts/bubble/props.js +36 -30
- package/esm/parts/bubble/styled.js +32 -112
- package/esm/parts/chat-card/ChatCard.js +27 -23
- package/esm/parts/chat-card/config/useValidateProps.js +4 -6
- package/esm/parts/chat-card/index.js +1 -7
- package/esm/parts/chat-card/props.js +8 -10
- package/esm/parts/chat-card/styled.js +23 -42
- package/esm/parts/chat-composer/ChatContainerComposer.js +83 -65
- package/esm/parts/chat-composer/config/useValidateProps.js +4 -6
- package/esm/parts/chat-composer/index.js +1 -7
- package/esm/parts/chat-composer/props.js +24 -37
- package/esm/parts/chat-composer/styled.js +22 -73
- package/esm/parts/chat-container/ChatContainer.js +122 -88
- package/esm/parts/chat-container/config/useValidateProps.js +4 -6
- package/esm/parts/chat-container/index.js +1 -7
- package/esm/parts/chat-container/props.js +31 -52
- package/esm/parts/chat-container/styled.js +16 -79
- package/esm/parts/chat-container-header/ChatContainerHeader.js +21 -22
- package/esm/parts/chat-container-header/helpers.js +17 -9
- package/esm/parts/chat-container-header/styled.js +14 -30
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js +210 -138
- package/esm/parts/chat-container-messages-list/config/useValidateProps.js +4 -6
- package/esm/parts/chat-container-messages-list/index.js +1 -10
- package/esm/parts/chat-container-messages-list/props.js +17 -31
- package/esm/parts/chat-container-messages-list/styled.js +25 -71
- package/esm/parts/chat-empty-state/ChatEmptyState.js +29 -25
- package/esm/parts/chat-empty-state/config/useValidateProps.js +4 -6
- package/esm/parts/chat-empty-state/props.js +7 -10
- package/esm/parts/chat-empty-state/styled.js +11 -18
- package/esm/parts/chat-sidebar/SideBarChat.js +67 -50
- package/esm/parts/chat-sidebar/config/useValidateProps.js +4 -6
- package/esm/parts/chat-sidebar/index.js +1 -7
- package/esm/parts/chat-sidebar/props.js +21 -39
- package/esm/parts/chat-sidebar/styled.js +11 -27
- package/esm/parts/floating-button/FloatingButton.js +26 -18
- package/esm/parts/floating-button/index.js +1 -3
- package/esm/parts/floating-button/props.js +8 -11
- package/esm/parts/floating-button/styled.js +9 -34
- package/esm/parts/floating-container/styled.js +9 -18
- package/esm/parts/grid-influencer/InfluencerContainer.js +12 -12
- package/esm/parts/grid-influencer/styled.js +12 -27
- package/esm/parts/message-delimiter/MessageDelimiter.js +26 -20
- package/esm/parts/message-delimiter/config/useValidateProps.js +4 -6
- package/esm/parts/message-delimiter/index.js +1 -10
- package/esm/parts/message-delimiter/props.js +14 -15
- package/esm/parts/message-delimiter/styled.js +14 -24
- package/esm/parts/sidebar-button/SidebarButton.js +41 -22
- package/esm/parts/sidebar-button/index.js +1 -2
- package/esm/parts/sidebar-button/props.js +15 -18
- package/esm/parts/sidebar-button/styled.js +14 -39
- package/esm/parts/system-message/SystemMessage.js +27 -22
- package/esm/parts/system-message/config/useValidateProps.js +4 -6
- package/esm/parts/system-message/index.js +1 -7
- package/esm/parts/system-message/props.js +10 -13
- package/esm/parts/system-message/style.js +20 -46
- package/esm/parts/tile-button/TileButton.js +54 -75
- package/esm/parts/tile-button/config/useValidateProps.js +4 -6
- package/esm/parts/tile-button/index.js +1 -7
- package/esm/parts/tile-button/props.js +33 -47
- package/esm/parts/tile-button/styled.js +60 -200
- package/esm/prop-types.js +16 -19
- package/esm/styled.js +5 -13
- package/package.json +10 -10
- package/cjs/ChatDataTestids.js.map +0 -7
- package/cjs/index.d.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/parts/bubble/ChatBubble.js.map +0 -7
- package/cjs/parts/bubble/ChatBubbleArrow.js.map +0 -7
- package/cjs/parts/bubble/config/useValidateProps.js.map +0 -7
- package/cjs/parts/bubble/index.js.map +0 -7
- package/cjs/parts/bubble/props.js.map +0 -7
- package/cjs/parts/bubble/styled.js.map +0 -7
- package/cjs/parts/chat-card/ChatCard.js.map +0 -7
- package/cjs/parts/chat-card/config/useValidateProps.js.map +0 -7
- package/cjs/parts/chat-card/index.js.map +0 -7
- package/cjs/parts/chat-card/props.js.map +0 -7
- package/cjs/parts/chat-card/styled.js.map +0 -7
- package/cjs/parts/chat-composer/ChatContainerComposer.js.map +0 -7
- package/cjs/parts/chat-composer/config/useValidateProps.js.map +0 -7
- package/cjs/parts/chat-composer/index.js.map +0 -7
- package/cjs/parts/chat-composer/props.js.map +0 -7
- package/cjs/parts/chat-composer/styled.js.map +0 -7
- package/cjs/parts/chat-container/ChatContainer.js.map +0 -7
- package/cjs/parts/chat-container/config/useValidateProps.js.map +0 -7
- package/cjs/parts/chat-container/index.js.map +0 -7
- package/cjs/parts/chat-container/props.js.map +0 -7
- package/cjs/parts/chat-container/styled.js.map +0 -7
- package/cjs/parts/chat-container-header/ChatContainerHeader.js.map +0 -7
- package/cjs/parts/chat-container-header/helpers.js.map +0 -7
- package/cjs/parts/chat-container-header/styled.js.map +0 -7
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +0 -7
- package/cjs/parts/chat-container-messages-list/config/useValidateProps.js.map +0 -7
- package/cjs/parts/chat-container-messages-list/index.js.map +0 -7
- package/cjs/parts/chat-container-messages-list/props.js.map +0 -7
- package/cjs/parts/chat-container-messages-list/styled.js.map +0 -7
- package/cjs/parts/chat-empty-state/ChatEmptyState.js.map +0 -7
- package/cjs/parts/chat-empty-state/config/useValidateProps.js.map +0 -7
- package/cjs/parts/chat-empty-state/props.js.map +0 -7
- package/cjs/parts/chat-empty-state/styled.js.map +0 -7
- package/cjs/parts/chat-sidebar/SideBarChat.js.map +0 -7
- package/cjs/parts/chat-sidebar/config/useValidateProps.js.map +0 -7
- package/cjs/parts/chat-sidebar/index.js.map +0 -7
- package/cjs/parts/chat-sidebar/props.js.map +0 -7
- package/cjs/parts/chat-sidebar/styled.js.map +0 -7
- package/cjs/parts/floating-button/FloatingButton.js.map +0 -7
- package/cjs/parts/floating-button/index.js.map +0 -7
- package/cjs/parts/floating-button/props.js.map +0 -7
- package/cjs/parts/floating-button/styled.js.map +0 -7
- package/cjs/parts/floating-container/styled.js.map +0 -7
- package/cjs/parts/grid-influencer/InfluencerContainer.js.map +0 -7
- package/cjs/parts/grid-influencer/styled.js.map +0 -7
- package/cjs/parts/message-delimiter/MessageDelimiter.js.map +0 -7
- package/cjs/parts/message-delimiter/config/useValidateProps.js.map +0 -7
- package/cjs/parts/message-delimiter/index.js.map +0 -7
- package/cjs/parts/message-delimiter/props.js.map +0 -7
- package/cjs/parts/message-delimiter/styled.js.map +0 -7
- package/cjs/parts/sidebar-button/SidebarButton.js.map +0 -7
- package/cjs/parts/sidebar-button/index.js.map +0 -7
- package/cjs/parts/sidebar-button/props.js.map +0 -7
- package/cjs/parts/sidebar-button/styled.js.map +0 -7
- package/cjs/parts/system-message/SystemMessage.js.map +0 -7
- package/cjs/parts/system-message/config/useValidateProps.js.map +0 -7
- package/cjs/parts/system-message/index.js.map +0 -7
- package/cjs/parts/system-message/props.js.map +0 -7
- package/cjs/parts/system-message/style.js.map +0 -7
- package/cjs/parts/tile-button/TileButton.js.map +0 -7
- package/cjs/parts/tile-button/config/useValidateProps.js.map +0 -7
- package/cjs/parts/tile-button/index.js.map +0 -7
- package/cjs/parts/tile-button/props.js.map +0 -7
- package/cjs/parts/tile-button/styled.js.map +0 -7
- package/cjs/prop-types.js.map +0 -7
- package/cjs/styled.js.map +0 -7
- package/cjs/tests/utils.js +0 -66
- package/cjs/tests/utils.js.map +0 -7
- package/esm/ChatDataTestids.js.map +0 -7
- package/esm/index.d.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/parts/bubble/ChatBubble.js.map +0 -7
- package/esm/parts/bubble/ChatBubbleArrow.js.map +0 -7
- package/esm/parts/bubble/config/useValidateProps.js.map +0 -7
- package/esm/parts/bubble/index.js.map +0 -7
- package/esm/parts/bubble/props.js.map +0 -7
- package/esm/parts/bubble/styled.js.map +0 -7
- package/esm/parts/chat-card/ChatCard.js.map +0 -7
- package/esm/parts/chat-card/config/useValidateProps.js.map +0 -7
- package/esm/parts/chat-card/index.js.map +0 -7
- package/esm/parts/chat-card/props.js.map +0 -7
- package/esm/parts/chat-card/styled.js.map +0 -7
- package/esm/parts/chat-composer/ChatContainerComposer.js.map +0 -7
- package/esm/parts/chat-composer/config/useValidateProps.js.map +0 -7
- package/esm/parts/chat-composer/index.js.map +0 -7
- package/esm/parts/chat-composer/props.js.map +0 -7
- package/esm/parts/chat-composer/styled.js.map +0 -7
- package/esm/parts/chat-container/ChatContainer.js.map +0 -7
- package/esm/parts/chat-container/config/useValidateProps.js.map +0 -7
- package/esm/parts/chat-container/index.js.map +0 -7
- package/esm/parts/chat-container/props.js.map +0 -7
- package/esm/parts/chat-container/styled.js.map +0 -7
- package/esm/parts/chat-container-header/ChatContainerHeader.js.map +0 -7
- package/esm/parts/chat-container-header/helpers.js.map +0 -7
- package/esm/parts/chat-container-header/styled.js.map +0 -7
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +0 -7
- package/esm/parts/chat-container-messages-list/config/useValidateProps.js.map +0 -7
- package/esm/parts/chat-container-messages-list/index.js.map +0 -7
- package/esm/parts/chat-container-messages-list/props.js.map +0 -7
- package/esm/parts/chat-container-messages-list/styled.js.map +0 -7
- package/esm/parts/chat-empty-state/ChatEmptyState.js.map +0 -7
- package/esm/parts/chat-empty-state/config/useValidateProps.js.map +0 -7
- package/esm/parts/chat-empty-state/props.js.map +0 -7
- package/esm/parts/chat-empty-state/styled.js.map +0 -7
- package/esm/parts/chat-sidebar/SideBarChat.js.map +0 -7
- package/esm/parts/chat-sidebar/config/useValidateProps.js.map +0 -7
- package/esm/parts/chat-sidebar/index.js.map +0 -7
- package/esm/parts/chat-sidebar/props.js.map +0 -7
- package/esm/parts/chat-sidebar/styled.js.map +0 -7
- package/esm/parts/floating-button/FloatingButton.js.map +0 -7
- package/esm/parts/floating-button/index.js.map +0 -7
- package/esm/parts/floating-button/props.js.map +0 -7
- package/esm/parts/floating-button/styled.js.map +0 -7
- package/esm/parts/floating-container/styled.js.map +0 -7
- package/esm/parts/grid-influencer/InfluencerContainer.js.map +0 -7
- package/esm/parts/grid-influencer/styled.js.map +0 -7
- package/esm/parts/message-delimiter/MessageDelimiter.js.map +0 -7
- package/esm/parts/message-delimiter/config/useValidateProps.js.map +0 -7
- package/esm/parts/message-delimiter/index.js.map +0 -7
- package/esm/parts/message-delimiter/props.js.map +0 -7
- package/esm/parts/message-delimiter/styled.js.map +0 -7
- package/esm/parts/sidebar-button/SidebarButton.js.map +0 -7
- package/esm/parts/sidebar-button/index.js.map +0 -7
- package/esm/parts/sidebar-button/props.js.map +0 -7
- package/esm/parts/sidebar-button/styled.js.map +0 -7
- package/esm/parts/system-message/SystemMessage.js.map +0 -7
- package/esm/parts/system-message/config/useValidateProps.js.map +0 -7
- package/esm/parts/system-message/index.js.map +0 -7
- package/esm/parts/system-message/props.js.map +0 -7
- package/esm/parts/system-message/style.js.map +0 -7
- package/esm/parts/tile-button/TileButton.js.map +0 -7
- package/esm/parts/tile-button/config/useValidateProps.js.map +0 -7
- package/esm/parts/tile-button/index.js.map +0 -7
- package/esm/parts/tile-button/props.js.map +0 -7
- package/esm/parts/tile-button/styled.js.map +0 -7
- package/esm/prop-types.js.map +0 -7
- package/esm/styled.js.map +0 -7
- package/esm/tests/utils.js +0 -37
- package/esm/tests/utils.js.map +0 -7
|
@@ -1,33 +1,48 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import {
|
|
19
|
-
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
3
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
4
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
5
|
+
import 'core-js/modules/esnext.async-iterator.some.js';
|
|
6
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
7
|
+
import 'core-js/modules/esnext.iterator.some.js';
|
|
8
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
9
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
10
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
11
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
12
|
+
import 'core-js/modules/esnext.async-iterator.find.js';
|
|
13
|
+
import 'core-js/modules/esnext.iterator.find.js';
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import { describe } from 'react-desc';
|
|
16
|
+
import { useVirtual } from 'react-virtual';
|
|
17
|
+
import DSButton from '@elliemae/ds-button';
|
|
18
|
+
import { debounce } from 'lodash';
|
|
19
|
+
import { ChatBubble } from '../bubble/ChatBubble.js';
|
|
20
|
+
import { BUBBLE_TYPES } from '../bubble/props.js';
|
|
21
|
+
import { MessageDelimiter } from '../message-delimiter/MessageDelimiter.js';
|
|
22
|
+
import { SystemMessage } from '../system-message/SystemMessage.js';
|
|
23
|
+
import { ListItem, StyledWrapperListItem, StyledWrapper, StyledChatContainerContentList, StyledChatContainerContentListScroll, StyledLoadMoreContainer } from './styled.js';
|
|
24
|
+
import { listProps, defaultProps } from './props.js';
|
|
25
|
+
import { jsx } from 'react/jsx-runtime';
|
|
26
|
+
|
|
27
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
28
|
+
|
|
29
|
+
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; }
|
|
30
|
+
|
|
31
|
+
const getPadding = _ref => {
|
|
32
|
+
let {
|
|
33
|
+
hasMoreItems,
|
|
34
|
+
bannerPosition,
|
|
35
|
+
isLoading
|
|
36
|
+
} = _ref;
|
|
20
37
|
const padding = {
|
|
21
38
|
paddingStart: 0,
|
|
22
39
|
paddingEnd: -5
|
|
23
40
|
};
|
|
24
|
-
if ([hasMoreItems, bannerPosition, isLoading].some(
|
|
25
|
-
padding.paddingStart = 42;
|
|
26
|
-
else if ([hasMoreItems, bannerPosition, isLoading].some((item) => item === "bottom"))
|
|
27
|
-
padding.paddingEnd = 42;
|
|
41
|
+
if ([hasMoreItems, bannerPosition, isLoading].some(item => item === 'top')) padding.paddingStart = 42;else if ([hasMoreItems, bannerPosition, isLoading].some(item => item === 'bottom')) padding.paddingEnd = 42;
|
|
28
42
|
return padding;
|
|
29
43
|
};
|
|
30
|
-
|
|
44
|
+
|
|
45
|
+
const ChatContainerMessagesList = props => {
|
|
31
46
|
const {
|
|
32
47
|
sendingText,
|
|
33
48
|
bannerPosition,
|
|
@@ -40,149 +55,206 @@ const ChatContainerMessagesList = (props) => {
|
|
|
40
55
|
isLoading,
|
|
41
56
|
bannerRef
|
|
42
57
|
} = props;
|
|
43
|
-
const pendingOnScroll =
|
|
44
|
-
const loadMoreRef =
|
|
45
|
-
const virtualListRef =
|
|
58
|
+
const pendingOnScroll = React.useRef(false);
|
|
59
|
+
const loadMoreRef = React.useRef(null);
|
|
60
|
+
const virtualListRef = React.useRef(); // estimateSize should not be really required given what was stated on
|
|
61
|
+
// https://github.com/tannerlinsley/react-virtual/issues/23
|
|
62
|
+
|
|
46
63
|
const {
|
|
47
64
|
scrollToIndex: vScroll,
|
|
48
65
|
totalSize,
|
|
49
66
|
virtualItems
|
|
50
|
-
} = useVirtual({
|
|
67
|
+
} = useVirtual(_objectSpread(_objectSpread({
|
|
51
68
|
size: messages.length,
|
|
52
69
|
parentRef: virtualListRef,
|
|
53
|
-
overscan: 15
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
70
|
+
overscan: 15
|
|
71
|
+
}, getPadding({
|
|
72
|
+
hasMoreItems,
|
|
73
|
+
bannerPosition,
|
|
74
|
+
isLoading
|
|
75
|
+
})), {}, {
|
|
76
|
+
estimateSize: React.useCallback(() => 80, [])
|
|
77
|
+
}));
|
|
78
|
+
const debouncedScroll = React.useMemo(() => debounce(() => {
|
|
79
|
+
var _virtualListRef$curre;
|
|
80
|
+
|
|
81
|
+
if (document.visibilityState === 'hidden') {
|
|
60
82
|
pendingOnScroll.current = true;
|
|
61
83
|
return [];
|
|
62
84
|
}
|
|
63
|
-
|
|
64
|
-
|
|
85
|
+
|
|
86
|
+
if (!virtualListRef.current) return [];
|
|
65
87
|
pendingOnScroll.current = false;
|
|
66
|
-
const {
|
|
88
|
+
const {
|
|
89
|
+
bottom,
|
|
90
|
+
top
|
|
91
|
+
} = (_virtualListRef$curre = virtualListRef.current) === null || _virtualListRef$curre === void 0 ? void 0 : _virtualListRef$curre.getBoundingClientRect();
|
|
67
92
|
const list = virtualListRef.current.querySelectorAll('[data-element="chat-element-list-item"]');
|
|
68
93
|
const indexList = [];
|
|
69
|
-
list.forEach(
|
|
70
|
-
const {
|
|
94
|
+
list.forEach(item => {
|
|
95
|
+
const {
|
|
96
|
+
top: itemTop
|
|
97
|
+
} = item.getBoundingClientRect();
|
|
71
98
|
const itemPadding = 10;
|
|
72
|
-
if (itemTop + itemPadding < bottom && itemTop + itemPadding > top)
|
|
73
|
-
indexList.push(item.dataset.index);
|
|
99
|
+
if (itemTop + itemPadding < bottom && itemTop + itemPadding > top) indexList.push(item.dataset.index);
|
|
74
100
|
});
|
|
75
|
-
if (onScrollEnds)
|
|
76
|
-
onScrollEnds(indexList);
|
|
101
|
+
if (onScrollEnds) onScrollEnds(indexList);
|
|
77
102
|
return indexList;
|
|
78
103
|
}, 500), [onScrollEnds]);
|
|
79
|
-
const onScrollStop =
|
|
80
|
-
const onlyFocus =
|
|
104
|
+
const onScrollStop = React.useCallback(debouncedScroll, [debouncedScroll]);
|
|
105
|
+
const onlyFocus = React.useCallback(index => {
|
|
81
106
|
setTimeout(() => {
|
|
82
|
-
virtualListRef.current.querySelector(
|
|
107
|
+
virtualListRef.current.querySelector("[data-index=\"".concat(index, "\"]")).focus();
|
|
83
108
|
}, 300);
|
|
84
109
|
}, []);
|
|
85
|
-
const scrollAndFocus =
|
|
110
|
+
const scrollAndFocus = React.useCallback(function (index) {
|
|
111
|
+
let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
112
|
+
align: 'center'
|
|
113
|
+
};
|
|
86
114
|
vScroll(index, b);
|
|
87
115
|
onlyFocus(index);
|
|
88
116
|
onScrollStop();
|
|
89
117
|
}, [onScrollStop, onlyFocus, vScroll]);
|
|
90
|
-
|
|
118
|
+
React.useEffect(() => {
|
|
91
119
|
if (actionRef && actionRef.current) {
|
|
92
|
-
actionRef.current.scrollToIndex = (a
|
|
120
|
+
actionRef.current.scrollToIndex = function (a) {
|
|
121
|
+
let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
122
|
+
align: 'center'
|
|
123
|
+
};
|
|
93
124
|
vScroll(a, b);
|
|
94
125
|
onScrollStop();
|
|
95
126
|
};
|
|
127
|
+
|
|
96
128
|
actionRef.current.getMessagesInView = onScrollStop;
|
|
97
|
-
onScrollStop();
|
|
98
|
-
|
|
129
|
+
onScrollStop(); // init useMemo due to debounce use.
|
|
130
|
+
|
|
131
|
+
actionRef.current.focusToIndex = function (a) {
|
|
132
|
+
let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
133
|
+
align: 'center'
|
|
134
|
+
};
|
|
99
135
|
scrollAndFocus(a, b);
|
|
100
136
|
};
|
|
137
|
+
|
|
101
138
|
actionRef.current.focusToIndexWithoutScroll = onlyFocus;
|
|
139
|
+
|
|
102
140
|
actionRef.current.focusToList = () => {
|
|
103
|
-
|
|
141
|
+
var _virtualListRef$curre2;
|
|
142
|
+
|
|
143
|
+
(_virtualListRef$curre2 = virtualListRef.current) === null || _virtualListRef$curre2 === void 0 ? void 0 : _virtualListRef$curre2.focus();
|
|
104
144
|
};
|
|
105
145
|
}
|
|
106
146
|
}, [actionRef, onScrollStop, onlyFocus, scrollAndFocus, vScroll]);
|
|
107
|
-
const handleKey =
|
|
108
|
-
const {
|
|
147
|
+
const handleKey = React.useCallback(e => {
|
|
148
|
+
const {
|
|
149
|
+
key
|
|
150
|
+
} = e;
|
|
109
151
|
const index = Number(e.currentTarget.dataset.index);
|
|
110
152
|
e.stopPropagation();
|
|
153
|
+
|
|
111
154
|
switch (key) {
|
|
112
|
-
case
|
|
155
|
+
case 'ArrowUp':
|
|
113
156
|
e.preventDefault();
|
|
157
|
+
|
|
114
158
|
if (index > 0) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
159
|
+
var _virtualListRef$curre3;
|
|
160
|
+
|
|
161
|
+
((_virtualListRef$curre3 = virtualListRef.current) === null || _virtualListRef$curre3 === void 0 ? void 0 : _virtualListRef$curre3.querySelector("[data-index=\"".concat(index - 1, "\"]"))).focus();
|
|
162
|
+
} else if (hasMoreItems === 'top') {
|
|
163
|
+
var _loadMoreRef$current;
|
|
164
|
+
|
|
165
|
+
(_loadMoreRef$current = loadMoreRef.current) === null || _loadMoreRef$current === void 0 ? void 0 : _loadMoreRef$current.focus();
|
|
118
166
|
}
|
|
167
|
+
|
|
119
168
|
break;
|
|
120
|
-
|
|
169
|
+
|
|
170
|
+
case 'ArrowDown':
|
|
121
171
|
e.preventDefault();
|
|
172
|
+
|
|
122
173
|
if (index < messages.length - 1) {
|
|
123
|
-
virtualListRef.current.querySelector(
|
|
174
|
+
virtualListRef.current.querySelector("[data-index=\"".concat(index + 1, "\"]")).focus();
|
|
124
175
|
}
|
|
176
|
+
|
|
125
177
|
break;
|
|
126
|
-
|
|
178
|
+
|
|
179
|
+
case 'Home':
|
|
127
180
|
e.preventDefault();
|
|
128
181
|
scrollAndFocus(0);
|
|
129
182
|
break;
|
|
130
|
-
|
|
183
|
+
|
|
184
|
+
case 'End':
|
|
131
185
|
e.preventDefault();
|
|
132
186
|
scrollAndFocus(messages.length - 1);
|
|
133
187
|
break;
|
|
134
|
-
|
|
135
|
-
|
|
188
|
+
|
|
189
|
+
case 'Tab':
|
|
190
|
+
if (hasMoreItems === 'bottom' && !e.shiftKey) {
|
|
191
|
+
var _loadMoreRef$current2;
|
|
192
|
+
|
|
136
193
|
e.preventDefault();
|
|
137
|
-
loadMoreRef.current
|
|
138
|
-
} else if (hasMoreItems ===
|
|
139
|
-
} else if (!e.shiftKey) {
|
|
194
|
+
(_loadMoreRef$current2 = loadMoreRef.current) === null || _loadMoreRef$current2 === void 0 ? void 0 : _loadMoreRef$current2.focus();
|
|
195
|
+
} else if (hasMoreItems === 'top' && e.shiftKey) ; else if (!e.shiftKey) {
|
|
140
196
|
if (bannerPosition) {
|
|
141
197
|
e.preventDefault();
|
|
142
198
|
bannerRef.current.focusOnWrapper();
|
|
143
199
|
}
|
|
144
200
|
} else {
|
|
201
|
+
var _virtualListRef$curre4;
|
|
202
|
+
|
|
145
203
|
e.preventDefault();
|
|
146
|
-
virtualListRef.current
|
|
204
|
+
(_virtualListRef$curre4 = virtualListRef.current) === null || _virtualListRef$curre4 === void 0 ? void 0 : _virtualListRef$curre4.focus();
|
|
147
205
|
}
|
|
148
|
-
|
|
149
|
-
default:
|
|
206
|
+
|
|
150
207
|
break;
|
|
151
208
|
}
|
|
152
209
|
}, [bannerRef, hasMoreItems, messages.length, bannerPosition, scrollAndFocus]);
|
|
153
|
-
const handleListKey =
|
|
154
|
-
const {
|
|
210
|
+
const handleListKey = React.useCallback(e => {
|
|
211
|
+
const {
|
|
212
|
+
key
|
|
213
|
+
} = e;
|
|
214
|
+
|
|
155
215
|
switch (key) {
|
|
156
|
-
case
|
|
216
|
+
case 'ArrowUp':
|
|
157
217
|
e.preventDefault();
|
|
218
|
+
|
|
158
219
|
if (document.activeElement !== loadMoreRef.current) {
|
|
159
220
|
onlyFocus(onScrollStop().shift());
|
|
160
221
|
}
|
|
222
|
+
|
|
161
223
|
break;
|
|
162
|
-
|
|
224
|
+
|
|
225
|
+
case 'ArrowDown':
|
|
163
226
|
e.preventDefault();
|
|
227
|
+
|
|
164
228
|
if (document.activeElement === loadMoreRef.current) {
|
|
165
|
-
virtualListRef.current.querySelector(
|
|
229
|
+
virtualListRef.current.querySelector("[data-index=\"0\"]").focus();
|
|
166
230
|
} else {
|
|
167
231
|
onlyFocus(onScrollStop().pop());
|
|
168
232
|
}
|
|
233
|
+
|
|
169
234
|
break;
|
|
170
|
-
|
|
235
|
+
|
|
236
|
+
case 'Home':
|
|
171
237
|
e.preventDefault();
|
|
172
238
|
scrollAndFocus(0);
|
|
173
239
|
break;
|
|
174
|
-
|
|
240
|
+
|
|
241
|
+
case 'End':
|
|
175
242
|
e.preventDefault();
|
|
176
243
|
scrollAndFocus(messages.length - 1);
|
|
177
244
|
break;
|
|
178
|
-
|
|
245
|
+
|
|
246
|
+
case 'Tab':
|
|
179
247
|
if (document.activeElement !== loadMoreRef.current) {
|
|
180
|
-
if (hasMoreItems ===
|
|
248
|
+
if (hasMoreItems === 'bottom' && !e.shiftKey) {
|
|
249
|
+
var _loadMoreRef$current3;
|
|
250
|
+
|
|
181
251
|
e.preventDefault();
|
|
182
|
-
loadMoreRef.current
|
|
183
|
-
} else if (hasMoreItems ===
|
|
252
|
+
(_loadMoreRef$current3 = loadMoreRef.current) === null || _loadMoreRef$current3 === void 0 ? void 0 : _loadMoreRef$current3.focus();
|
|
253
|
+
} else if (hasMoreItems === 'top' && e.shiftKey) {
|
|
254
|
+
var _loadMoreRef$current4;
|
|
255
|
+
|
|
184
256
|
e.preventDefault();
|
|
185
|
-
loadMoreRef.current
|
|
257
|
+
(_loadMoreRef$current4 = loadMoreRef.current) === null || _loadMoreRef$current4 === void 0 ? void 0 : _loadMoreRef$current4.focus();
|
|
186
258
|
} else if (!e.shiftKey) {
|
|
187
259
|
e.preventDefault();
|
|
188
260
|
actionRef.current.focusToComposer();
|
|
@@ -191,95 +263,95 @@ const ChatContainerMessagesList = (props) => {
|
|
|
191
263
|
e.preventDefault();
|
|
192
264
|
actionRef.current.focusToComposer();
|
|
193
265
|
} else {
|
|
266
|
+
var _virtualListRef$curre5;
|
|
267
|
+
|
|
194
268
|
e.preventDefault();
|
|
195
|
-
virtualListRef.current
|
|
269
|
+
(_virtualListRef$curre5 = virtualListRef.current) === null || _virtualListRef$curre5 === void 0 ? void 0 : _virtualListRef$curre5.focus();
|
|
196
270
|
}
|
|
197
|
-
|
|
198
|
-
default:
|
|
271
|
+
|
|
199
272
|
break;
|
|
200
273
|
}
|
|
201
274
|
}, [actionRef, hasMoreItems, messages.length, onScrollStop, onlyFocus, scrollAndFocus]);
|
|
202
|
-
const checkPendingOnScroll =
|
|
203
|
-
if (pendingOnScroll.current === true)
|
|
204
|
-
onScrollStop();
|
|
275
|
+
const checkPendingOnScroll = React.useCallback(() => {
|
|
276
|
+
if (pendingOnScroll.current === true) onScrollStop();
|
|
205
277
|
}, [onScrollStop]);
|
|
206
|
-
|
|
278
|
+
React.useEffect(() => {
|
|
207
279
|
let handlerCallback = null;
|
|
208
280
|
const localVirtualRef = virtualListRef.current;
|
|
281
|
+
|
|
209
282
|
const onScroll = () => {
|
|
210
|
-
if (handlerCallback)
|
|
211
|
-
clearTimeout(handlerCallback);
|
|
283
|
+
if (handlerCallback) clearTimeout(handlerCallback);
|
|
212
284
|
handlerCallback = setTimeout(onScrollStop, 300);
|
|
213
285
|
};
|
|
286
|
+
|
|
214
287
|
if (onScrollEnds) {
|
|
215
|
-
virtualListRef.current.addEventListener(
|
|
288
|
+
virtualListRef.current.addEventListener('scroll', onScroll);
|
|
216
289
|
}
|
|
217
|
-
|
|
290
|
+
|
|
291
|
+
document.addEventListener('visibilitychange', checkPendingOnScroll);
|
|
218
292
|
return () => {
|
|
219
|
-
if (handlerCallback)
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
localVirtualRef.removeEventListener("scroll", onScroll);
|
|
223
|
-
document.removeEventListener("visibilitychange", checkPendingOnScroll);
|
|
293
|
+
if (handlerCallback) clearTimeout(handlerCallback);
|
|
294
|
+
if (onScrollEnds) localVirtualRef.removeEventListener('scroll', onScroll);
|
|
295
|
+
document.removeEventListener('visibilitychange', checkPendingOnScroll);
|
|
224
296
|
};
|
|
225
297
|
}, [onScrollStop, onScrollEnds, checkPendingOnScroll]);
|
|
226
|
-
const render =
|
|
227
|
-
const {
|
|
298
|
+
const render = React.useMemo(() => virtualItems.map(virtualItem => {
|
|
299
|
+
const {
|
|
300
|
+
index,
|
|
301
|
+
measureRef,
|
|
302
|
+
start
|
|
303
|
+
} = virtualItem;
|
|
228
304
|
const row = messages[index];
|
|
229
|
-
const isSending = sendingMessages && sendingMessages.find(
|
|
305
|
+
const isSending = sendingMessages && sendingMessages.find(m => m === row.dsId);
|
|
230
306
|
const style = {
|
|
231
|
-
position:
|
|
307
|
+
position: 'absolute',
|
|
232
308
|
top: 0,
|
|
233
309
|
left: 0,
|
|
234
|
-
transform:
|
|
235
|
-
width:
|
|
310
|
+
transform: "translateY(".concat(start, "px)"),
|
|
311
|
+
width: '100%'
|
|
236
312
|
};
|
|
237
|
-
return
|
|
313
|
+
return /*#__PURE__*/jsx(ListItem, {
|
|
238
314
|
"data-element": "chat-element-list-item",
|
|
239
315
|
"data-index": index,
|
|
240
|
-
|
|
241
|
-
style,
|
|
316
|
+
style: style,
|
|
242
317
|
ref: measureRef,
|
|
243
318
|
tabIndex: -1,
|
|
244
319
|
onKeyDown: handleKey,
|
|
245
|
-
role: "listitem"
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}) : null));
|
|
320
|
+
role: "listitem",
|
|
321
|
+
children: /*#__PURE__*/_jsx(StyledWrapperListItem, {
|
|
322
|
+
type: row.type
|
|
323
|
+
}, void 0, row.type === BUBBLE_TYPES.SENDER || row.type === BUBBLE_TYPES.RECIPIENT ?
|
|
324
|
+
/*#__PURE__*/
|
|
325
|
+
// eslint-disable-next-line eslint-comments/no-unlimited-disable
|
|
326
|
+
jsx(ChatBubble, _objectSpread(_objectSpread({}, row), {}, {
|
|
327
|
+
helpMessage: isSending ? sendingText : row.helpMessage
|
|
328
|
+
})) : null, row.type === BUBBLE_TYPES.DELIMITER ? /*#__PURE__*/jsx(MessageDelimiter, _objectSpread({}, row)) : null, row.type === BUBBLE_TYPES.SYSTEM ? /*#__PURE__*/jsx(SystemMessage, _objectSpread({}, row)) : null)
|
|
329
|
+
}, "ds-chat-bubble-".concat(index, "-").concat(row.dsId, "-").concat(row.type));
|
|
256
330
|
}), [virtualItems, messages, sendingMessages, handleKey, sendingText]);
|
|
257
|
-
return
|
|
331
|
+
return /*#__PURE__*/_jsx(StyledWrapper, {}, void 0, /*#__PURE__*/jsx(StyledChatContainerContentList, {
|
|
258
332
|
"data-testid": "chat-thread-container",
|
|
259
333
|
tabIndex: 0,
|
|
260
334
|
"aria-live": "polite",
|
|
261
335
|
"aria-relevant": "additions",
|
|
262
336
|
ref: virtualListRef,
|
|
263
337
|
role: "list",
|
|
264
|
-
onKeyDown: handleListKey
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
338
|
+
onKeyDown: handleListKey,
|
|
339
|
+
children: /*#__PURE__*/_jsx(StyledChatContainerContentListScroll, {
|
|
340
|
+
height: "".concat(totalSize, "px")
|
|
341
|
+
}, void 0, !isLoading && hasMoreItems ? /*#__PURE__*/_jsx(StyledLoadMoreContainer, {
|
|
342
|
+
hasMoreItems: hasMoreItems
|
|
343
|
+
}, void 0, /*#__PURE__*/_jsx(DSButton, {
|
|
344
|
+
labelText: "Load More",
|
|
345
|
+
buttonType: "secondary",
|
|
346
|
+
onClick: getMoreMessages,
|
|
347
|
+
"data-testid": "ds-chat-load-more-btn",
|
|
348
|
+
innerRef: loadMoreRef
|
|
349
|
+
})) : null, render)
|
|
350
|
+
}));
|
|
276
351
|
};
|
|
277
|
-
|
|
352
|
+
|
|
278
353
|
ChatContainerMessagesList.defaultProps = defaultProps;
|
|
279
354
|
const ChatContainerMessagesListWithSchema = describe(ChatContainerMessagesList);
|
|
280
355
|
ChatContainerMessagesListWithSchema.propTypes = listProps;
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
ChatContainerMessagesListWithSchema
|
|
284
|
-
};
|
|
285
|
-
//# sourceMappingURL=ChatContainerMessagesList.js.map
|
|
356
|
+
|
|
357
|
+
export { ChatContainerMessagesList, ChatContainerMessagesListWithSchema };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';
|
|
2
|
+
|
|
3
3
|
const useValidateProps = (props, propTypes) => {
|
|
4
4
|
useValidateTypescriptPropTypes(props, propTypes);
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=useValidateProps.js.map
|
|
6
|
+
|
|
7
|
+
export { useValidateProps };
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
ChatContainerMessagesList,
|
|
4
|
-
ChatContainerMessagesListWithSchema
|
|
5
|
-
} from "./ChatContainerMessagesList";
|
|
6
|
-
export {
|
|
7
|
-
ChatContainerMessagesList,
|
|
8
|
-
ChatContainerMessagesListWithSchema
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { ChatContainerMessagesList, ChatContainerMessagesListWithSchema } from './ChatContainerMessagesList.js';
|
|
@@ -1,39 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { PropTypes } from 'react-desc';
|
|
2
|
+
import { noop } from 'lodash';
|
|
3
|
+
|
|
4
4
|
const defaultProps = {
|
|
5
5
|
messages: [],
|
|
6
6
|
actionRef: noop,
|
|
7
7
|
onScrollEnds: () => [],
|
|
8
8
|
getMoreMessages: noop,
|
|
9
|
-
sendingMessages:
|
|
10
|
-
sendingText:
|
|
11
|
-
bannerPosition:
|
|
12
|
-
bannerRef:
|
|
9
|
+
sendingMessages: undefined,
|
|
10
|
+
sendingText: 'Sending',
|
|
11
|
+
bannerPosition: undefined,
|
|
12
|
+
bannerRef: undefined
|
|
13
13
|
};
|
|
14
14
|
const listProps = {
|
|
15
|
-
messages: PropTypes.arrayOf(PropTypes.object).description(
|
|
16
|
-
actionRef: PropTypes.object.description(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
focusToComposer: () => void,
|
|
24
|
-
focusToSend: () => void,
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
`).defaultValue(defaultProps.actionRef),
|
|
28
|
-
onScrollEnds: PropTypes.func.description(`Called when the scroll stops.`),
|
|
29
|
-
isLoading: PropTypes.oneOf(["top", "bottom", void 0]).description("Keeps the load more space while the loading is in progress"),
|
|
30
|
-
hasMoreItems: PropTypes.oneOf(["top", "bottom", void 0]).description("Show Load More button at the `top` or `bottom` of the container"),
|
|
31
|
-
getMoreMessages: PropTypes.func.description("Called when the user clicks on load more").defaultValue(defaultProps.getMoreMessages),
|
|
32
|
-
sendingMessages: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.number)]).description("Array of ids of sending messages").defaultValue(defaultProps.sendingMessages),
|
|
33
|
-
sendingText: PropTypes.string.description("Label description for messages in sending status").defaultValue(defaultProps.sendingText)
|
|
15
|
+
messages: PropTypes.arrayOf(PropTypes.object).description('The array of out-of-the-box items you want to render inside the ChatMessageList').defaultValue(defaultProps.messages),
|
|
16
|
+
actionRef: PropTypes.object.description("Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToIndexWithoutScroll: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n ").defaultValue(defaultProps.actionRef),
|
|
17
|
+
onScrollEnds: PropTypes.func.description("Called when the scroll stops."),
|
|
18
|
+
isLoading: PropTypes.oneOf(['top', 'bottom', undefined]).description('Keeps the load more space while the loading is in progress'),
|
|
19
|
+
hasMoreItems: PropTypes.oneOf(['top', 'bottom', undefined]).description('Show Load More button at the `top` or `bottom` of the container'),
|
|
20
|
+
getMoreMessages: PropTypes.func.description('Called when the user clicks on load more').defaultValue(defaultProps.getMoreMessages),
|
|
21
|
+
sendingMessages: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.number)]).description('Array of ids of sending messages').defaultValue(defaultProps.sendingMessages),
|
|
22
|
+
sendingText: PropTypes.string.description('Label description for messages in sending status').defaultValue(defaultProps.sendingText)
|
|
34
23
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
listProps
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=props.js.map
|
|
24
|
+
|
|
25
|
+
export { defaultProps, listProps };
|