@elliemae/ds-chat 3.0.0-next.4 → 3.0.0-next.40
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/dist/cjs/ChatDataTestids.js.map +1 -1
- package/dist/cjs/exported-related/bubble/ChatBubble.js +4 -4
- package/dist/cjs/exported-related/bubble/ChatBubble.js.map +2 -2
- package/dist/cjs/exported-related/bubble/ChatBubbleArrow.js.map +1 -1
- package/dist/cjs/exported-related/bubble/props.js +10 -10
- package/dist/cjs/exported-related/bubble/props.js.map +2 -2
- package/dist/cjs/exported-related/bubble/styled.js.map +1 -1
- package/dist/cjs/exported-related/chat-card/ChatCard.js +4 -4
- package/dist/cjs/exported-related/chat-card/ChatCard.js.map +2 -2
- package/dist/cjs/exported-related/chat-card/props.js +5 -5
- package/dist/cjs/exported-related/chat-card/props.js.map +2 -2
- package/dist/cjs/exported-related/chat-card/styled.js.map +1 -1
- package/dist/cjs/exported-related/chat-container-header/ChatContainerHeader.js +4 -4
- package/dist/cjs/exported-related/chat-container-header/ChatContainerHeader.js.map +2 -2
- package/dist/cjs/exported-related/chat-container-header/props.js +3 -3
- package/dist/cjs/exported-related/chat-container-header/props.js.map +2 -2
- package/dist/cjs/exported-related/chat-container-header/styled.js.map +1 -1
- package/dist/cjs/exported-related/chat-empty-state/ChatEmptyState.js +4 -4
- package/dist/cjs/exported-related/chat-empty-state/ChatEmptyState.js.map +2 -2
- package/dist/cjs/exported-related/chat-empty-state/props.js +3 -3
- package/dist/cjs/exported-related/chat-empty-state/props.js.map +2 -2
- package/dist/cjs/exported-related/chat-empty-state/styled.js.map +1 -1
- package/dist/cjs/exported-related/chat-sidebar/SideBarChat.js +4 -4
- package/dist/cjs/exported-related/chat-sidebar/SideBarChat.js.map +2 -2
- package/dist/cjs/exported-related/chat-sidebar/props.js.map +1 -1
- package/dist/cjs/exported-related/chat-sidebar/sidebar-button/SidebarButton.js.map +1 -1
- package/dist/cjs/exported-related/chat-sidebar/sidebar-button/props.js +6 -6
- package/dist/cjs/exported-related/chat-sidebar/sidebar-button/props.js.map +2 -2
- package/dist/cjs/exported-related/chat-sidebar/sidebar-button/styled.js.map +1 -1
- package/dist/cjs/exported-related/chat-sidebar/styled.js.map +1 -1
- package/dist/cjs/exported-related/floating-button/FloatingButton.js +4 -4
- package/dist/cjs/exported-related/floating-button/FloatingButton.js.map +2 -2
- package/dist/cjs/exported-related/floating-button/props.js.map +1 -1
- package/dist/cjs/exported-related/floating-container/styled.js.map +1 -1
- package/dist/cjs/exported-related/grid-influencer/InfluencerContainer.js.map +1 -1
- package/dist/cjs/exported-related/grid-influencer/styled.js.map +1 -1
- package/dist/cjs/exported-related/message-delimiter/MessageDelimiter.js +5 -5
- package/dist/cjs/exported-related/message-delimiter/MessageDelimiter.js.map +2 -2
- package/dist/cjs/exported-related/message-delimiter/props.js +6 -6
- package/dist/cjs/exported-related/message-delimiter/props.js.map +2 -2
- package/dist/cjs/exported-related/message-delimiter/styled.js.map +1 -1
- package/dist/cjs/exported-related/system-message/SystemMessage.js +4 -4
- package/dist/cjs/exported-related/system-message/SystemMessage.js.map +2 -2
- package/dist/cjs/exported-related/system-message/props.js.map +1 -1
- package/dist/cjs/exported-related/system-message/style.js.map +1 -1
- package/dist/cjs/exported-related/tile-button/TileButton.js +4 -4
- package/dist/cjs/exported-related/tile-button/TileButton.js.map +2 -2
- package/dist/cjs/exported-related/tile-button/props.js +20 -20
- package/dist/cjs/exported-related/tile-button/props.js.map +2 -2
- package/dist/cjs/exported-related/tile-button/styled.js.map +1 -1
- package/dist/cjs/parts/chat-composer/ChatContainerComposer.js +4 -4
- package/dist/cjs/parts/chat-composer/ChatContainerComposer.js.map +2 -2
- package/dist/cjs/parts/chat-composer/styled.js.map +1 -1
- package/dist/cjs/parts/chat-container/ChatContainer.js +5 -5
- package/dist/cjs/parts/chat-container/ChatContainer.js.map +2 -2
- package/dist/cjs/parts/chat-container/styled.js.map +1 -1
- package/dist/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js +5 -5
- package/dist/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +2 -2
- package/dist/cjs/parts/chat-container-messages-list/useGetNewMessages.js.map +1 -1
- package/dist/cjs/react-desc-prop-types.js +38 -38
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/tests/utils.js.map +1 -1
- package/dist/esm/ChatDataTestids.js.map +1 -1
- package/dist/esm/exported-related/bubble/ChatBubble.js +1 -1
- package/dist/esm/exported-related/bubble/ChatBubble.js.map +2 -2
- package/dist/esm/exported-related/bubble/ChatBubbleArrow.js.map +1 -1
- package/dist/esm/exported-related/bubble/props.js +1 -1
- package/dist/esm/exported-related/bubble/props.js.map +2 -2
- package/dist/esm/exported-related/bubble/styled.js.map +1 -1
- package/dist/esm/exported-related/chat-card/ChatCard.js +1 -1
- package/dist/esm/exported-related/chat-card/ChatCard.js.map +2 -2
- package/dist/esm/exported-related/chat-card/props.js +1 -1
- package/dist/esm/exported-related/chat-card/props.js.map +2 -2
- package/dist/esm/exported-related/chat-card/styled.js.map +1 -1
- package/dist/esm/exported-related/chat-container-header/ChatContainerHeader.js +1 -1
- package/dist/esm/exported-related/chat-container-header/ChatContainerHeader.js.map +2 -2
- package/dist/esm/exported-related/chat-container-header/props.js +1 -1
- package/dist/esm/exported-related/chat-container-header/props.js.map +2 -2
- package/dist/esm/exported-related/chat-container-header/styled.js.map +1 -1
- package/dist/esm/exported-related/chat-empty-state/ChatEmptyState.js +1 -1
- package/dist/esm/exported-related/chat-empty-state/ChatEmptyState.js.map +2 -2
- package/dist/esm/exported-related/chat-empty-state/props.js +1 -1
- package/dist/esm/exported-related/chat-empty-state/props.js.map +2 -2
- package/dist/esm/exported-related/chat-empty-state/styled.js.map +1 -1
- package/dist/esm/exported-related/chat-sidebar/SideBarChat.js +1 -1
- package/dist/esm/exported-related/chat-sidebar/SideBarChat.js.map +2 -2
- package/dist/esm/exported-related/chat-sidebar/props.js.map +1 -1
- package/dist/esm/exported-related/chat-sidebar/sidebar-button/SidebarButton.js.map +1 -1
- package/dist/esm/exported-related/chat-sidebar/sidebar-button/props.js +1 -1
- package/dist/esm/exported-related/chat-sidebar/sidebar-button/props.js.map +2 -2
- package/dist/esm/exported-related/chat-sidebar/sidebar-button/styled.js.map +1 -1
- package/dist/esm/exported-related/chat-sidebar/styled.js.map +1 -1
- package/dist/esm/exported-related/floating-button/FloatingButton.js +1 -1
- package/dist/esm/exported-related/floating-button/FloatingButton.js.map +2 -2
- package/dist/esm/exported-related/floating-button/props.js.map +1 -1
- package/dist/esm/exported-related/floating-container/styled.js.map +1 -1
- package/dist/esm/exported-related/grid-influencer/InfluencerContainer.js.map +1 -1
- package/dist/esm/exported-related/grid-influencer/styled.js.map +1 -1
- package/dist/esm/exported-related/message-delimiter/MessageDelimiter.js +1 -1
- package/dist/esm/exported-related/message-delimiter/MessageDelimiter.js.map +2 -2
- package/dist/esm/exported-related/message-delimiter/props.js +1 -1
- package/dist/esm/exported-related/message-delimiter/props.js.map +2 -2
- package/dist/esm/exported-related/message-delimiter/styled.js.map +1 -1
- package/dist/esm/exported-related/system-message/SystemMessage.js +1 -1
- package/dist/esm/exported-related/system-message/SystemMessage.js.map +2 -2
- package/dist/esm/exported-related/system-message/props.js.map +1 -1
- package/dist/esm/exported-related/system-message/style.js.map +1 -1
- package/dist/esm/exported-related/tile-button/TileButton.js +1 -1
- package/dist/esm/exported-related/tile-button/TileButton.js.map +2 -2
- package/dist/esm/exported-related/tile-button/props.js +1 -1
- package/dist/esm/exported-related/tile-button/props.js.map +2 -2
- package/dist/esm/exported-related/tile-button/styled.js.map +1 -1
- package/dist/esm/parts/chat-composer/ChatContainerComposer.js +1 -1
- package/dist/esm/parts/chat-composer/ChatContainerComposer.js.map +2 -2
- package/dist/esm/parts/chat-composer/styled.js.map +1 -1
- package/dist/esm/parts/chat-container/ChatContainer.js +1 -1
- package/dist/esm/parts/chat-container/ChatContainer.js.map +2 -2
- package/dist/esm/parts/chat-container/styled.js.map +1 -1
- package/dist/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js +1 -1
- package/dist/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +2 -2
- package/dist/esm/parts/chat-container-messages-list/useGetNewMessages.js.map +1 -1
- package/dist/esm/react-desc-prop-types.js +1 -1
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/tests/utils.js.map +1 -1
- package/package.json +15 -15
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/message-delimiter/styled.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { Grid } from '@elliemae/ds-grid';\nimport styled from 'styled-components';\nimport { MessageDelimiterProps } from './props';\n\nconst Wrapper = styled(Grid)`\n align-items: center;\n justify-content: center;\n width: 100%;\n min-height: 8px;\n`;\n\nconst Line = styled.span`\n border-top: 1px solid ${(props) => props.theme.colors.neutral['400']};\n`;\n\nconst Text = styled.p<Pick<MessageDelimiterProps, 'size' | 'verticalMargin'>>`\n color: ${(props) => props.theme.colors.neutral['600']};\n font-size: ${(props) => (props.size === 's' ? '12px' : '14px')};\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n margin: ${(props) =>\n typeof props.verticalMargin === 'number' ? `${props.verticalMargin}px 8px` : `${props.verticalMargin} 8px`};\n`;\n\nexport { Wrapper, Line, Text };\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AAGA,MAAM,UAAU,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAGA,MAAM,UAAU,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAO3B,MAAM,OAAO,OAAO;AAAA,0BACM,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAGhE,MAAM,OAAO,OAAO;AAAA,WACT,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA,eAClC,CAAC,UAAW,MAAM,SAAS,MAAM,SAAS;AAAA,iBACxC,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,YACxC,CAAC,UACT,OAAO,MAAM,mBAAmB,WAAW,GAAG,MAAM,yBAAyB,GAAG,MAAM;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import React2 from "react";
|
|
3
|
-
import { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from "@elliemae/ds-
|
|
3
|
+
import { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from "@elliemae/ds-utilities";
|
|
4
4
|
import { Wrapper, Header, Title, Time, Message } from "./style";
|
|
5
5
|
import { systemMessageProps, defaultProps } from "./props";
|
|
6
6
|
const SystemMessage = (props) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/system-message/SystemMessage.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { WeakValidationMap } from 'react';\nimport { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from '@elliemae/ds-
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEA,MAAM,gBAAyD,CAAC,UAAU;AACxE,QAAM,mBAAmB,6BAA6B,OAAO;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { WeakValidationMap } from 'react';\nimport { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { Wrapper, Header, Title, Time, Message } from './style';\nimport { SystemMessageProps, systemMessageProps, defaultProps } from './props';\n\nconst SystemMessage: React.ComponentType<SystemMessageProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, systemMessageProps);\n\n const { title, time, body } = propsWithDefault;\n return (\n <Wrapper rows={['auto', 'auto']}>\n <Header cols={['1fr', 'auto', '1fr']}>\n <span />\n <Title data-testid=\"chat-system-message-title\">{title}</Title>\n <Time data-testid=\"chat-system-message-time\">{time}</Time>\n </Header>\n <Message data-testid=\"chat-system-message-body\">{body}</Message>\n </Wrapper>\n );\n};\n\nSystemMessage.propTypes = systemMessageProps as WeakValidationMap<unknown>;\nconst SystemMessageWithSchema = describe(SystemMessage);\nSystemMessageWithSchema.propTypes = systemMessageProps as WeakValidationMap<unknown>;\n\nexport { SystemMessage, SystemMessageWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEA,MAAM,gBAAyD,CAAC,UAAU;AACxE,QAAM,mBAAmB,6BAA6B,OAAO,YAAY;AACzE,iCAA+B,kBAAkB,kBAAkB;AAEnE,QAAM,EAAE,OAAO,MAAM,SAAS;AAC9B,SACE,qCAAC;AAAA,IAAQ,MAAM,CAAC,QAAQ,MAAM;AAAA,KAC5B,qCAAC;AAAA,IAAO,MAAM,CAAC,OAAO,QAAQ,KAAK;AAAA,KACjC,qCAAC,YAAK,GACN,qCAAC;AAAA,IAAM,eAAY;AAAA,KAA6B,KAAM,GACtD,qCAAC;AAAA,IAAK,eAAY;AAAA,KAA4B,IAAK,CACrD,GACA,qCAAC;AAAA,IAAQ,eAAY;AAAA,KAA4B,IAAK,CACxD;AAEJ;AAEA,cAAc,YAAY;AAC1B,MAAM,0BAA0B,SAAS,aAAa;AACtD,wBAAwB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/system-message/props.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from 'react-desc';\n\nexport interface SystemMessageProps {\n title: string;\n time: string;\n body: string;\n}\n\nexport const defaultProps: SystemMessageProps = {\n title: 'System Message',\n time: '',\n body: '',\n};\n\nexport const systemMessageProps = {\n title: PropTypes.string.isRequired\n .description('Message title')\n .defaultValue('System Message'),\n time: PropTypes.string.description('data of the message, ie: hour'),\n body: PropTypes.string.isRequired.description('message'),\n};\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AAQO,MAAM,eAAmC;AAAA,EAC9C,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;
|
|
5
|
+
"mappings": "AAAA;ACAA;AAQO,MAAM,eAAmC;AAAA,EAC9C,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AAEO,MAAM,qBAAqB;AAAA,EAChC,OAAO,UAAU,OAAO,WACrB,YAAY,eAAe,EAC3B,aAAa,gBAAgB;AAAA,EAChC,MAAM,UAAU,OAAO,YAAY,+BAA+B;AAAA,EAClE,MAAM,UAAU,OAAO,WAAW,YAAY,SAAS;AACzD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/system-message/style.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\n\nconst Wrapper = styled(Grid)`\n align-items: center;\n justify-content: center;\n max-width: 100%;\n padding: 0 8px 8px;\n border: 1px solid ${(props) => props.theme.colors.neutral['100']};\n border-radius: 10px;\n background-color: ${(props) => props.theme.colors.neutral['080']};\n box-shadow: none;\n`;\n\nconst Header = styled(Grid)`\n align-items: center;\n height: 36px;\n`;\n\nconst Title = styled.p<any>`\n font-size: 14px;\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n color: ${(props) => props.theme.colors.neutral['700']};\n margin: 0;\n`;\n\nconst Time = styled.p<any>`\n font-size: 12px;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n color: ${(props) => props.theme.colors.neutral['700']};\n margin: 0;\n text-align: right;\n`;\n\nconst Message = styled.p<any>`\n font-size: 13px;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n color: ${(props) => props.theme.colors.neutral['700']};\n min-height: 32px;\n text-align: center;\n margin: 0;\n`;\n\nexport { Wrapper, Header, Title, Time, Message };\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AAEA,MAAM,UAAU,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAEA,MAAM,UAAU,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA,sBAKL,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA,sBAEtC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAI5D,MAAM,SAAS,OAAO,IAAI;AAAA;AAAA;AAAA;AAK1B,MAAM,QAAQ,OAAO;AAAA;AAAA,iBAEJ,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAIjD,MAAM,OAAO,OAAO;AAAA;AAAA,iBAEH,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAKjD,MAAM,UAAU,OAAO;AAAA;AAAA,iBAEN,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import React2 from "react";
|
|
3
|
-
import { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from "@elliemae/ds-
|
|
3
|
+
import { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from "@elliemae/ds-utilities";
|
|
4
4
|
import { DSTooltipV3 } from "@elliemae/ds-tooltip";
|
|
5
5
|
import { Grid } from "@elliemae/ds-grid";
|
|
6
6
|
import { CloseXsmall } from "@elliemae/ds-icons";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/tile-button/TileButton.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { WeakValidationMap } from 'react';\nimport { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from '@elliemae/ds-
|
|
5
|
-
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA;AAEA,MAAM,aAAmD,CAAC,UAAU;AAClE,QAAM,mBAAmB,6BAA6B,OAAO;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { WeakValidationMap } from 'react';\nimport { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { DSTooltipV3 } from '@elliemae/ds-tooltip';\nimport { Grid } from '@elliemae/ds-grid';\nimport { CloseXsmall } from '@elliemae/ds-icons';\nimport {\n StyledTooltipV3ButtonWrapper,\n StyledTileButton,\n StyledTileButtonIcon,\n StyledTileButtonLabel,\n StyledWrapper,\n StyledWrapperLeftBorder,\n StyledStatusBadge,\n StyledWrapperCentralContent,\n CloseButton,\n} from './styled';\nimport { propsTileButton, defaultTileButton, TileButtonProps } from './props';\n\nconst TileButton: React.ComponentType<TileButtonProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultTileButton);\n useValidateTypescriptPropTypes(propsWithDefault, propsTileButton);\n\n const {\n label,\n title,\n dsId,\n onClick,\n onFocus,\n onBlur,\n Icon,\n showClose,\n onClose,\n badge,\n badgeColor,\n badgePosition,\n disabled,\n selected,\n isHeader,\n ariaLabel,\n tooltipPlacement,\n disableTooltip,\n innerRef,\n } = propsWithDefault;\n const handleClick = React.useCallback(() => {\n onClick(dsId, title);\n }, [dsId, onClick, title]);\n\n const MainContent = React.useMemo(\n () => (\n <StyledWrapperCentralContent alignItems={isHeader ? 'center' : undefined}>\n <Grid width=\"100%\" alignItems=\"center\" justifyContent=\"center\">\n <StyledTileButtonIcon alignItems=\"center\" justifyContent=\"center\">\n <Icon size=\"m\" />\n {badge ? (\n <StyledStatusBadge\n badgeColor={badgeColor}\n badgePosition={badgePosition}\n data-testid={`tile-badge-${dsId}`}\n />\n ) : null}\n </StyledTileButtonIcon>\n </Grid>\n {!isHeader ? (\n <Grid width=\"100%\" justifyContent=\"center\">\n {label ? <StyledTileButtonLabel>{label}</StyledTileButtonLabel> : null}\n </Grid>\n ) : null}\n </StyledWrapperCentralContent>\n ),\n [isHeader, Icon, badge, dsId, badgeColor, badgePosition, label],\n );\n\n const Btn = React.useMemo(\n () => (\n <StyledTileButton\n key={dsId}\n isHeader={isHeader}\n value={dsId}\n data-testid={`tile-button-${dsId}`}\n data-key={dsId}\n onClick={handleClick}\n onFocus={onFocus}\n onBlur={onBlur}\n disabled={disabled}\n selected={selected}\n badgeColor={badgeColor}\n badgePosition={badgePosition}\n aria-pressed={selected}\n aria-label={ariaLabel}\n ref={innerRef}\n >\n <StyledWrapper alignItems=\"center\" justifyContent=\"center\">\n <span>{MainContent}</span>\n <StyledWrapperLeftBorder />\n {showClose && !disabled ? (\n <CloseButton onClick={onClose} value={dsId} data-testid={`tile-close-btn-${dsId}`}>\n <CloseXsmall />\n </CloseButton>\n ) : null}\n </StyledWrapper>\n </StyledTileButton>\n ),\n [\n MainContent,\n ariaLabel,\n badgeColor,\n badgePosition,\n disabled,\n dsId,\n handleClick,\n isHeader,\n onBlur,\n onClose,\n onFocus,\n selected,\n showClose,\n innerRef,\n ],\n );\n\n return title && !disableTooltip ? (\n <StyledTooltipV3ButtonWrapper>\n <DSTooltipV3 id={`ds-chat-tile-tooltip-button-${dsId}`} text={title} startPlacementPreference={tooltipPlacement}>\n {Btn}\n </DSTooltipV3>\n </StyledTooltipV3ButtonWrapper>\n ) : (\n Btn\n );\n};\n\nTileButton.propTypes = propsTileButton as WeakValidationMap<unknown>;\n\nconst TileButtonWithSchema = describe(TileButton);\nTileButtonWithSchema.propTypes = propsTileButton as WeakValidationMap<unknown>;\n\nexport { TileButton, TileButtonWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA;AAEA,MAAM,aAAmD,CAAC,UAAU;AAClE,QAAM,mBAAmB,6BAA6B,OAAO,iBAAiB;AAC9E,iCAA+B,kBAAkB,eAAe;AAEhE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE;AACJ,QAAM,cAAc,OAAM,YAAY,MAAM;AAC1C,YAAQ,MAAM,KAAK;AAAA,EACrB,GAAG,CAAC,MAAM,SAAS,KAAK,CAAC;AAEzB,QAAM,cAAc,OAAM,QACxB,MACE,qCAAC;AAAA,IAA4B,YAAY,WAAW,WAAW;AAAA,KAC7D,qCAAC;AAAA,IAAK,OAAM;AAAA,IAAO,YAAW;AAAA,IAAS,gBAAe;AAAA,KACpD,qCAAC;AAAA,IAAqB,YAAW;AAAA,IAAS,gBAAe;AAAA,KACvD,qCAAC;AAAA,IAAK,MAAK;AAAA,GAAI,GACd,QACC,q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|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/tile-button/props.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes } from '@elliemae/ds-
|
|
5
|
-
"mappings": "AAAA;ACCA;AACA;AACA;AAoCO,MAAM,oBAAqC;AAAA,EAChD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,WAAW;AAAA,EACX,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,UAAU;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { noop } from 'lodash';\nimport { Comments } from '@elliemae/ds-icons';\n\nexport interface TileButtonProps {\n Icon: React.FC<{ size: string }>;\n dsId: string | number;\n label: string;\n onClick?: (dsId: string | number, label: string) => void;\n onBlur?: (e: React.ChangeEvent<HTMLButtonElement>) => void;\n onFocus?: (e: React.ChangeEvent<HTMLButtonElement>) => void;\n title: string;\n showClose: boolean;\n onClose?: (dsId: string | number) => void;\n badge: boolean;\n badgeColor: 'blue' | 'green';\n badgePosition: 'left' | 'right';\n disabled: boolean;\n selected: boolean;\n isHeader: boolean;\n ariaLabel: string;\n tooltipPlacement:\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'right-start'\n | 'right'\n | 'right-end'\n | 'bottom-end'\n | 'bottom'\n | 'bottom-start'\n | 'left-end'\n | 'left'\n | 'left-start';\n disableTooltip: boolean;\n innerRef?: React.MutableRefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);\n}\n\nexport const defaultTileButton: TileButtonProps = {\n Icon: Comments,\n dsId: '',\n label: '',\n onClick: noop,\n onBlur: noop,\n onFocus: noop,\n title: '',\n onClose: noop,\n showClose: false,\n badge: false,\n badgeColor: 'blue',\n badgePosition: 'left',\n disabled: false,\n selected: false,\n isHeader: false,\n ariaLabel: 'Tile button',\n tooltipPlacement: 'right',\n disableTooltip: false,\n innerRef: noop,\n};\n\nexport const propsTileButton = {\n Icon: PropTypes.func.description('Icon component').defaultValue(defaultTileButton.Icon),\n dsId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('Unique id for the button')\n .defaultValue(defaultTileButton.dsId),\n label: PropTypes.string.description('It will display under the icon').defaultValue(defaultTileButton.label),\n title: PropTypes.string.description('Tooltip').defaultValue(defaultTileButton.title),\n onClick: PropTypes.func.description('The function to call when is clicked').defaultValue(defaultTileButton.onClick),\n onFocus: PropTypes.func.description('The function to call when is focused').defaultValue(defaultTileButton.onFocus),\n onBlur: PropTypes.func.description('The function to call when is on blur').defaultValue(defaultTileButton.onBlur),\n onClose: PropTypes.func\n .description('The function to call when the X is Clicked')\n .defaultValue(defaultTileButton.onClose),\n showClose: PropTypes.bool.description('It will display the X').defaultValue(defaultTileButton.showClose),\n badge: PropTypes.bool.description('It will display the badge').defaultValue(defaultTileButton.badge),\n badgeColor: PropTypes.oneOf(['blue', 'green'])\n .description('Color badge: blue or green')\n .defaultValue(defaultTileButton.badgeColor),\n badgePosition: PropTypes.oneOf(['left', 'right'])\n .description('Color badge: blue or green')\n .defaultValue(defaultTileButton.badgePosition),\n disabled: PropTypes.bool.description('It will disabled the button').defaultValue(defaultTileButton.disabled),\n selected: PropTypes.bool.description('Indicate that the button is selected').defaultValue(defaultTileButton.disabled),\n isHeader: PropTypes.bool.description(\"It won't render the label\").defaultValue(defaultTileButton.disabled),\n ariaLabel: PropTypes.string.description('aria-label attribute').defaultValue(defaultTileButton.ariaLabel),\n tooltipPlacement: PropTypes.oneOf([\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n ])\n .description('start placement preferences, as per popperjs placement option')\n .defaultValue(\"'right'\"),\n disableTooltip: PropTypes.bool.description('Disable tooltip option').defaultValue(defaultTileButton.disableTooltip),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(\n 'reference to the component',\n ),\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AAoCO,MAAM,oBAAqC;AAAA,EAChD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,WAAW;AAAA,EACX,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,UAAU;AACZ;AAEO,MAAM,kBAAkB;AAAA,EAC7B,MAAM,UAAU,KAAK,YAAY,gBAAgB,EAAE,aAAa,kBAAkB,IAAI;AAAA,EACtF,MAAM,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAC3D,YAAY,0BAA0B,EACtC,aAAa,kBAAkB,IAAI;AAAA,EACtC,OAAO,UAAU,OAAO,YAAY,gCAAgC,EAAE,aAAa,kBAAkB,KAAK;AAAA,EAC1G,OAAO,UAAU,OAAO,YAAY,SAAS,EAAE,aAAa,kBAAkB,KAAK;AAAA,EACnF,SAAS,UAAU,KAAK,YAAY,sCAAsC,EAAE,aAAa,kBAAkB,OAAO;AAAA,EAClH,SAAS,UAAU,KAAK,YAAY,sCAAsC,EAAE,aAAa,kBAAkB,OAAO;AAAA,EAClH,QAAQ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6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/tile-button/styled.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\n/* eslint-disable max-lines */\nimport styled from 'styled-components';\nimport { css } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { TileButtonProps } from './props';\nconst MIN_WIDTH_SIDEBAR = 48;\nconst BUTTON_SIDEBAR_HEIGHT = 48;\n\n// Buttons\nexport const StyledWrapperLeftBorder = styled(Grid)`\n height: 100%;\n width: 4px;\n position: absolute;\n top: 0;\n left: 0;\n`;\n\nexport const StyledStatusBadge = styled.div<Partial<TileButtonProps>>`\n height: 8px;\n width: 8px;\n position: absolute;\n top: 0;\n background: ${(props) => {\n switch (props.badgeColor) {\n case 'blue':\n return props.theme.colors.brand[600];\n case 'green':\n return props.theme.colors.success[900];\n default:\n return props.theme.colors.brand[600];\n }\n }};\n ${(props) => {\n switch (props.badgePosition) {\n case 'left':\n return 'left: -4px;';\n case 'right':\n return 'right: -4px;';\n default:\n return 'left: -4px;';\n }\n }};\n border-radius: 50%;\n box-sizing: content-box;\n`;\n\nexport const StyledWrapperCentralContent = styled(Grid)`\n width: 24px;\n height: 40px;\n`;\n\nexport const StyledTileButtonIcon = styled(Grid)`\n position: relative;\n height: 24px;\n width: 24px;\n svg {\n fill: ${(props) => props.theme.colors.neutral[500]};\n }\n\n &:focus {\n svg {\n fill: ${(props) => props.theme.colors.brand[800]};\n }\n }\n`;\n\nexport const StyledTileButtonLabel = styled.div`\n width: 24px;\n height: ${(props) => props.theme.space.xs};\n text-transform: uppercase;\n overflow: hidden;\n text-align: center;\n font-size: 13px;\n color: ${(props) => props.theme.colors.neutral[600]};\n line-height: 17px;\n`;\n\nexport const CloseButton = styled.button`\n outline: none;\n background: none;\n height: 9px;\n width: 9px;\n position: absolute;\n top: 1px;\n right: 1px;\n overflow: hidden;\n padding: 0;\n border: none;\n span {\n position: absolute;\n left: -3px;\n top: -4px;\n }\n\n &:focus,\n &:hover {\n svg {\n fill: ${(props) => props.theme.colors.brand[600]};\n }\n &:after {\n display: block;\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: solid 1px ${(props) => props.theme.colors.brand[600]};\n border-radius: 2px;\n }\n }\n cursor: pointer;\n`;\n\n// MAIN WRAPPER\nexport const StyledTooltipV3ButtonWrapper = styled.div`\n height: ${BUTTON_SIDEBAR_HEIGHT}px;\n width: ${MIN_WIDTH_SIDEBAR}px;\n`;\nexport const StyledTileButton = styled.button<Partial<TileButtonProps>>`\n outline: none;\n background: transparent;\n height: ${BUTTON_SIDEBAR_HEIGHT}px;\n width: ${MIN_WIDTH_SIDEBAR}px;\n position: relative;\n padding: 0;\n border: none;\n cursor: pointer;\n border-bottom: ${(props) => (props.isHeader ? `1px solid ${props.theme.colors.neutral['200']}` : 'none')};\n &:focus,\n &:hover,\n &:active,\n &:disabled {\n background: ${(props) => props.theme.colors.neutral['080']};\n & ${StyledStatusBadge} {\n border: 2px solid ${(props) => props.theme.colors.neutral['080']};\n margin-top: -2px;\n ${(props) => {\n switch (props.badgePosition) {\n case 'left':\n return 'margin-left: -2px;';\n case 'right':\n return 'margin-right: -2px;';\n default:\n return 'margin-left: -2px;';\n }\n }};\n }\n }\n\n &:focus,\n &:hover {\n & ${StyledWrapperLeftBorder} {\n background: ${(props) => props.theme.colors.brand[800]};\n }\n & ${StyledTileButtonLabel} {\n color: ${(props) => props.theme.colors.neutral[600]};\n }\n\n & svg {\n fill: ${(props) => props.theme.colors.brand[800]};\n }\n }\n\n &:active:not(:disabled) {\n background: ${(props) => props.theme.colors.neutral['050']};\n & ${StyledWrapperLeftBorder} {\n background: ${(props) => props.theme.colors.brand[600]};\n }\n & ${StyledTileButtonLabel} {\n color: ${(props) => props.theme.colors.neutral[600]};\n font-weight: 600;\n }\n & svg {\n fill: ${(props) => props.theme.colors.brand[600]};\n }\n & ${StyledStatusBadge} {\n border: 2px solid ${(props) => props.theme.colors.neutral['050']};\n }\n }\n\n &:disabled {\n background: ${(props) => props.theme.colors.neutral['080']};\n ${StyledWrapperLeftBorder} {\n background: ${(props) => props.theme.colors.neutral['400']};\n }\n & ${StyledStatusBadge} {\n background: ${(props) => props.theme.colors.neutral['500']};\n border: 2px solid ${(props) => props.theme.colors.neutral['080']};\n }\n ${StyledTileButtonIcon} {\n svg {\n fill: ${(props) => props.theme.colors.neutral[400]};\n }\n }\n ${StyledTileButtonLabel} {\n color: ${(props) => props.theme.colors.neutral[400]};\n }\n }\n\n ${(props) => {\n if (props.selected) {\n return css`\n & ${StyledWrapperLeftBorder} {\n background: ${(nestedProps) => nestedProps.theme.colors.brand[600]};\n }\n `;\n }\n return '';\n }}\n`;\n\nexport const StyledWrapper = styled(Grid)`\n height: 100%;\n width: 100%;\n position: relative;\n`;\n"],
|
|
5
|
-
"mappings": "AAAA;ACEA;AACA;AACA;AAEA,MAAM,oBAAoB;AAC1B,MAAM,wBAAwB;AAGvB,MAAM,0BAA0B,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
5
|
+
"mappings": "AAAA;ACEA;AACA;AACA;AAEA,MAAM,oBAAoB;AAC1B,MAAM,wBAAwB;AAGvB,MAAM,0BAA0B,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ3C,MAAM,oBAAoB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,gBAKxB,CAAC,UAAU;AACvB,UAAQ,MAAM;AAAA,SACP;AACH,aAAO,MAAM,MAAM,OAAO,MAAM;AAAA,SAC7B;AACH,aAAO,MAAM,MAAM,OAAO,QAAQ;AAAA;AAElC,aAAO,MAAM,MAAM,OAAO,MAAM;AAAA;AAEtC;AAAA,IACE,CAAC,UAAU;AACX,UAAQ,MAAM;AAAA,SACP;AACH,aAAO;AAAA,SACJ;AACH,aAAO;AAAA;AAEP,aAA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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,7 +18,7 @@ import * as React from "react";
|
|
|
18
18
|
import React2 from "react";
|
|
19
19
|
import { Grid } from "@elliemae/ds-grid";
|
|
20
20
|
import { PaperAirplane } from "@elliemae/ds-icons";
|
|
21
|
-
import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, describe } from "@elliemae/ds-
|
|
21
|
+
import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, describe } from "@elliemae/ds-utilities";
|
|
22
22
|
import {
|
|
23
23
|
StyledChatContainerContentComposer,
|
|
24
24
|
StyledComposerInput,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/chat-composer/ChatContainerComposer.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { WeakValidationMap } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { PaperAirplane } from '@elliemae/ds-icons';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, describe } from '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAEA,MAAM,eAA2D,CAAC,UAAU;AAC1E,QAAM,mBAAmB,6BAAoD,OAAO;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { WeakValidationMap } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { PaperAirplane } from '@elliemae/ds-icons';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, describe } from '@elliemae/ds-utilities';\nimport {\n StyledChatContainerContentComposer,\n StyledComposerInput,\n StyledComposerButton,\n StyledCounterArea,\n StyledCounterErrorA11y,\n} from './styled';\n\nimport { DSChatT, ChatComposerPropTypes, defaultPropsComposer } from '../../react-desc-prop-types';\n// eslint-disable-next-line complexity\nconst ChatComposer: React.ComponentType<DSChatT.ComposerProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatT.ComposerProps>(props, defaultPropsComposer);\n useValidateTypescriptPropTypes<DSChatT.ComposerProps>(propsWithDefault, ChatComposerPropTypes);\n const {\n inputValue,\n onChange,\n onResize,\n onSend,\n onFocus,\n onBlur,\n onKeyDown,\n maxHeight = 300,\n placeholder,\n inputMaxLength,\n maxLengthMessage,\n ariaMaxLengthMessage,\n buttonDisabled,\n dataTestid,\n actionRef,\n } = propsWithDefault;\n\n const COMPOSER_MIN_HEIGHT = 32;\n const input = React.useRef<HTMLTextAreaElement>();\n const inputSize = React.useRef<HTMLTextAreaElement>();\n const inputSend = React.useRef<HTMLButtonElement>();\n const [height, setHeight] = React.useState(32);\n const internalMaxHeight = React.useMemo(() => maxHeight - 24, [maxHeight]);\n const [showScroll, setShowScroll] = React.useState(true);\n\n React.useEffect(() => {\n const newHeight =\n inputSize.current?.scrollHeight > internalMaxHeight ? internalMaxHeight : inputSize.current?.scrollHeight;\n if (newHeight !== height && newHeight > COMPOSER_MIN_HEIGHT) onResize(newHeight);\n setHeight(newHeight);\n setShowScroll(inputSize.current?.scrollHeight - inputSize.current?.clientHeight > 5);\n }, [inputValue, internalMaxHeight, height, onResize]);\n\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusToComposer = () => {\n input.current.focus();\n };\n actionRef.current.focusToSend = () => {\n inputSend.current.focus();\n };\n }\n }, [actionRef]);\n\n const handleChange = React.useCallback(\n (e) => {\n onChange(e.target.value);\n },\n [onChange],\n );\n const heightProps = { height, overflow: showScroll ? 'auto' : 'hidden' };\n\n const inputLength = String(inputValue || '').length;\n const hasError = React.useMemo(() => inputLength > inputMaxLength, [inputLength, inputMaxLength]);\n return (\n <StyledChatContainerContentComposer rows={['auto', '15px']} maxHeight={`${maxHeight}px`} data-testid={dataTestid}>\n <Grid\n cols={['1fr', '24px']}\n style={{ height: heightProps.height }}\n justifyContent=\"center\"\n alignItems=\"flex-end\"\n gutter=\"xxs\"\n >\n <StyledComposerInput\n ref={input}\n onChange={handleChange}\n style={{ ...heightProps }}\n value={inputValue}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n placeholder={placeholder}\n aria-label=\"Message to send\"\n data-testid=\"chat-composer-textarea\"\n name=\"chat-composer-textarea\"\n id=\"chat-composer-textarea\"\n />\n\n <Grid height=\"32px\" alignItems=\"center\">\n <StyledComposerButton\n buttonType=\"text\"\n icon={<PaperAirplane width={18} height={18} />}\n onClick={onSend}\n size=\"s\"\n disabled={!inputValue || buttonDisabled || hasError}\n data-testid=\"chat-composer-send-button\"\n aria-label=\"Send\"\n innerRef={inputSend}\n />\n </Grid>\n </Grid>\n <StyledComposerInput\n ref={inputSize}\n style={{\n height: 32,\n visibility: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n top: 0,\n width: input.current?.clientWidth,\n }}\n onChange={handleChange}\n value={inputValue}\n />\n <Grid cols={['1fr', '24px']} justifyContent=\"flex-end\" alignItems=\"center\" gutter=\"xxs\" pb=\"xxs\">\n <StyledCounterArea hasError={hasError} data-testid=\"composer-counter-area\">\n {inputMaxLength && hasError ? (\n <>\n <StyledCounterErrorA11y role=\"alert\">\n {ariaMaxLengthMessage ||\n `You have entered ${inputLength} characters and have exceeded the limit by ${\n inputLength - inputMaxLength\n }. Please limit to less than ${inputMaxLength} characters. `}\n </StyledCounterErrorA11y>\n {maxLengthMessage || `Please limit to less than ${inputMaxLength} characters. `}\n </>\n ) : (\n ''\n )}\n {inputMaxLength ? ` ${inputLength} / ${inputMaxLength}` : ''}\n </StyledCounterArea>\n <Grid />\n </Grid>\n </StyledChatContainerContentComposer>\n );\n};\n\nChatComposer.propTypes = ChatComposerPropTypes as WeakValidationMap<unknown>;\nconst ChatComposerWithSchema = describe(ChatComposer);\nChat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AA,MACf,UAAU;AAAA,MACV,KAAK;AAAA,MACL,OAAO,MAAM,SAAS;AAAA,IACxB;AAAA,IACA,UAAU;AAAA,IACV,OAAO;AAAA,GACT,GACA,qCAAC;AAAA,IAAK,MAAM,CAAC,OAAO,MAAM;AAAA,IAAG,gBAAe;AAAA,IAAW,YAAW;AAAA,IAAS,QAAO;AAAA,IAAM,IAAG;AAAA,KACzF,qCAAC;AAAA,IAAkB;AAAA,IAAoB,eAAY;AAAA,KAChD,kBAAkB,WACjB,4DACE,qCAAC;AAAA,IAAuB,MAAK;AAAA,KAC1B,wBACC,oBAAoB,yDAClB,cAAc,6CACe,6BACnC,GACC,oBAAoB,6BAA6B,6BACpD,IAEA,IAED,iBAAiB,IAAI,iBAAiB,mBAAmB,EAC5D,GACA,qCAAC,UAAK,CACR,CACF;AAEJ;AAEA,aAAa,YAAY;AACzB,MAAM,yBAAyB,SAAS,YAAY;AACpD,uBAAuB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/chat-composer/styled.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSButton } from '@elliemae/ds-button';\nimport { TextAreaProps } from './props';\n\n// Composer\nexport const StyledChatContainerContentComposer = styled(Grid)`\n width: 100%;\n min-height: 56px;\n background: ${(props) => props.theme.colors.neutral['050']};\n padding: ${(props) => props.theme.space.xxs};\n padding-bottom: 3px;\n padding-top: 6px;\n padding-left: ${(props) => props.theme.space.xs};\n max-height: ${(props) => props.maxHeight};\n border-top: 1px solid #cbcfd7;\n`;\n\nexport const StyledComposerInput = styled.textarea<any>`\n padding: ${(props) => props.theme.space.xxs};\n resize: none;\n min-height: 32px;\n border-radius: 2px;\n border: solid 1px #cbcfd7;\n color: #25292f;\n height: ${(props: TextAreaProps) => (typeof props.height === 'number' ? `${props.height}px` : props.height)};\n min-width: 244px;\n overflow-y: auto;\n font-size: 13px;\n font-weight: 400;\n line-height: 1;\n transition: height 0.05s;\n &:focus {\n outline: none;\n border: 1px solid ${(props) => props.theme.colors.brand[600]};\n box-shadow: inset 0 0 0 1px #8cc2ed;\n border-radius: 2px;\n }\n`;\nexport const StyledComposerButton = styled(DSButton)`\n &:disabled {\n background: none;\n svg {\n fill: #5d6775;\n }\n }\n svg {\n fill: ${(props) => props.theme.colors.brand[600]};\n }\n &:focus {\n background: ${(props) => props.theme.colors.brand[200]};\n }\n`;\n\nexport const StyledCounterArea = styled(Grid)`\n text-align: right;\n font-size: 11px;\n height: 15px;\n align-items: center;\n font-style: italic;\n ${(props) => (props.hasError ? `color:${props.theme.colors.danger[900]};` : '')}\n position:relative;\n`;\n\nexport const StyledCounterErrorA11y = styled.span`\n width: 1px;\n height: 1px;\n position: absolute;\n clip: rect(1px, 1px, 1px, 1px);\n`;\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;AAIO,MAAM,qCAAqC,OAAO;AAAA;AAAA;AAAA,
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAIO,MAAM,qCAAqC,OAAO,IAAI;AAAA;AAAA;AAAA,gBAG7C,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA,aACzC,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA;AAAA;AAAA,kBAGxB,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,gBAC/B,CAAC,UAAU,MAAM;AAAA;AAAA;AAI1B,MAAM,sBAAsB,OAAO;AAAA,aAC7B,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAM9B,CAAC,UAA0B,OAAO,MAAM,WAAW,WAAW,GAAG,MAAM,aAAa,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAS9E,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAKrD,MAAM,uBAAuB,OAAO,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAQvC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA,kBAG9B,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAI/C,MAAM,oBAAoB,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMxC,CAAC,UAAW,MAAM,WAAW,SAAS,MAAM,MAAM,OAAO,OAAO,UAAU;AAAA;AAAA;AAIvE,MAAM,yBAAyB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
useGetGlobalAttributes,
|
|
26
26
|
useValidateTypescriptPropTypes,
|
|
27
27
|
describe
|
|
28
|
-
} from "@elliemae/ds-
|
|
28
|
+
} from "@elliemae/ds-utilities";
|
|
29
29
|
import DSIndeterminateProgressIndicator from "@elliemae/ds-indeterminate-progress-indicator";
|
|
30
30
|
import DSBanner, { BANNER_TYPES } from "@elliemae/ds-banner";
|
|
31
31
|
import { ChatComposer } from "../chat-composer";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/chat-container/ChatContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { WeakValidationMap } from 'react';\nimport { noop } from 'lodash';\nimport {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n describe,\n} from '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACEA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AACA;AACA;AACA;AACA;AAEA;AAEA,MAAM,gBAA6D,CAAC,UAAU;AAC5E,QAAM,mBAAmB,6BAAqD,OAAO;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { WeakValidationMap } from 'react';\nimport { noop } from 'lodash';\nimport {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n describe,\n} from '@elliemae/ds-utilities';\n\nimport DSIndeterminateProgressIndicator from '@elliemae/ds-indeterminate-progress-indicator';\nimport DSBanner, { BANNER_TYPES } from '@elliemae/ds-banner';\nimport { ChatComposer } from '../chat-composer';\nimport { ChatContainerMessagesList } from '../chat-container-messages-list';\nimport { DSChatT, defaultProps, ChatContainerPropTypes } from '../../react-desc-prop-types';\n\nimport { StyledChatContainerContent, StyledIndicatorContainer, MobileStyledChatContainerContent } from './styled';\n\nconst ChatContainer: React.ComponentType<DSChatT.ContainerProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatT.ContainerProps>(props, defaultProps);\n useValidateTypescriptPropTypes<DSChatT.ContainerProps>(propsWithDefault, ChatContainerPropTypes);\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n\n const {\n sendingText,\n sendingMessages,\n bannerPosition,\n bannerProps,\n messagesListProps,\n composerProps,\n composerProps: { onResize: onComposerResize, onKeyDown: onComposerKeyDown },\n actionRef,\n device,\n isLoading,\n hasMoreItems,\n getMoreMessages,\n } = propsWithDefault;\n const bannerRef = React.useRef({ focusOnWrapper: noop, focusOnLink: noop });\n const containerRef = React.useRef<HTMLElement>();\n const listRef = React.useRef({ scrollToIndex: noop });\n\n const onResize = React.useCallback(\n (height: number) => {\n if (onComposerResize) onComposerResize(height);\n /*\n setTimeout is used to equal the animation duration from the \n composer text area when increase its size\n */\n setTimeout(() => {\n actionRef.current.scrollToIndex(messagesListProps.messages.length - 1, {\n align: 'start',\n });\n }, 50);\n },\n [onComposerResize, messagesListProps.messages, actionRef],\n );\n const Container = device === 'desktop' ? StyledChatContainerContent : MobileStyledChatContainerContent;\n const handleTabs = React.useCallback(\n (e: React.KeyboardEvent) => {\n if (onComposerKeyDown) onComposerKeyDown(e);\n else {\n const ref = actionRef || listRef;\n if (e.shiftKey && e.key === 'Tab') {\n if (messagesListProps.messages?.length > 0) {\n e.preventDefault();\n if (['top', 'bottom'].includes(bannerPosition)) {\n bannerRef.current.focusOnWrapper();\n } else {\n const last = ref.current.getMessagesInView().pop();\n ref.current?.focusToIndexWithoutScroll(last);\n }\n }\n }\n }\n },\n [actionRef, onComposerKeyDown, bannerPosition, messagesListProps.messages?.length],\n );\n\n // Map actions\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusOnBanner = bannerRef.current.focusOnWrapper;\n actionRef.current.focusOnBannerLink = bannerRef.current.focusOnLink;\n }\n }, [actionRef]);\n return (\n <Container {...globalAttributes} rows={['minmax(0, 1fr)', 'auto']} ref={containerRef} role=\"region\">\n <div style={{ position: 'relative', overflow: 'hidden' }}>\n <ChatContainerMessagesList\n {...messagesListProps}\n actionRef={actionRef || listRef}\n isLoading={isLoading}\n hasMoreItems={hasMoreItems}\n getMoreMessages={getMoreMessages}\n sendingMessages={sendingMessages}\n sendingText={sendingText}\n bannerPosition={bannerPosition}\n bannerRef={bannerRef}\n />\n {isLoading && ['top', 'bottom'].includes(isLoading) ? (\n <StyledIndicatorContainer isLoading={isLoading} data-testid=\"ds-chat-loading-indicator\">\n <DSIndeterminateProgressIndicator processing title=\"Loading\" />\n </StyledIndicatorContainer>\n ) : null}\n <StyledIndicatorContainer linear isLoading={bannerPosition}>\n <DSBanner\n showCloseButton\n label={bannerProps?.label || 'Unread messages'}\n containerProps={{ id: 'ds-chat-banner' }}\n actionLink={{\n label: bannerProps?.viewLabel || 'View',\n onClick: bannerProps?.onView,\n }}\n onClose={bannerProps?.onClose}\n isOpen\n type={bannerProps?.type || BANNER_TYPES.INFO}\n actionRef={bannerRef}\n />\n </StyledIndicatorContainer>\n {sendingMessages && sendingMessages.length > 0 ? (\n <StyledIndicatorContainer isLoading=\"bottom\" linear data-testid=\"ds-chat-loading-indicator\">\n <DSIndeterminateProgressIndicator processing title={sendingText} lineOnly />\n </StyledIndicatorContainer>\n ) : null}\n </div>\n <ChatComposer\n {...composerProps}\n onKeyDown={handleTabs}\n onResize={onResize}\n maxHeight={(containerRef.current?.clientHeight || 0) / 2}\n actionRef={actionRef || listRef}\n />\n </Container>\n );\n};\n\nChatContainer.propTypes = ChatContainerPropTypes as WeakValidationMap<unknown>;\nconst ChatContainerWithSchema = describe(ChatContainer);\nChatContainerWithSchema.propTypes = ChatContainerPropTypes as WeakValidationMap<unknown>;\n\nexport { ChatContainer, ChatContainerWithSchema };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACEA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AACA;AACA;AACA;AACA;AAEA;AAEA,MAAM,gBAA6D,CAAC,UAAU;AAC5E,QAAM,mBAAmB,6BAAqD,OAAO,YAAY;AACjG,iCAAuD,kBAAkB,sBAAsB;AAC/F,QAAM,mBAAmB,uBAAuB,gBAAgB;AAEhE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe,EAAE,UAAU,kBAAkB,WAAW;AAAA,IACxD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE;AACJ,QAAM,YAAY,OAAM,OAAO,EAAE,gBAAgB,MAAM,aAAa,KAAK,CAAC;AAC1E,QAAM,eAAe,OAAM,OAAoB;AAC/C,QAAM,UAAU,OAAM,OAAO,EAAE,eAAe,KAAK,CAAC;AAEpD,QAAM,WAAW,OAAM,YACrB,CAAC,WAAmB;AAClB,QAAI;AAAkB,uBAAiB,MAAM;AAK7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AA,IACF,GACC,aAAa,CAAC,OAAO,QAAQ,EAAE,SAAS,SAAS,IAChD,qCAAC;AAAA,IAAyB;AAAA,IAAsB,eAAY;AAAA,KAC1D,qCAAC;AAAA,IAAiC,YAAU;AAAA,IAAC,OAAM;AAAA,GAAU,CAC/D,IACE,MACJ,qCAAC;AAAA,IAAyB,QAAM;AAAA,IAAC,WAAW;AAAA,KAC1C,qCAAC;AAAA,IACC,iBAAe;AAAA,IACf,OAAO,aAAa,SAAS;AAAA,IAC7B,gBAAgB,EAAE,IAAI,iBAAiB;AAAA,IACvC,YAAY;AAAA,MACV,OAAO,aAAa,aAAa;AAAA,MACjC,SAAS,aAAa;AAAA,IACxB;AAAA,IACA,SAAS,aAAa;AAAA,IACtB,QAAM;AAAA,IACN,MAAM,aAAa,QAAQ,aAAa;AAAA,IACxC,WAAW;AAAA,GACb,CACF,GACC,mBAAmB,gBAAgB,SAAS,IAC3C,qCAAC;AAAA,IAAyB,WAAU;AAAA,IAAS,QAAM;AAAA,IAAC,eAAY;AAAA,KAC9D,qCAAC;AAAA,IAAiC,YAAU;AAAA,IAAC,OAAO;AAAA,IAAa,UAAQ;AAAA,GAAC,CAC5E,IACE,IACN,GACA,qCAAC,+CACK,gBADL;AAAA,IAEC,WAAW;AAAA,IACX;AAAA,IACA,WAAY,cAAa,SAAS,gBAAgB,KAAK;AAAA,IACvD,WAAW,aAAa;AAAA,IAC1B,CACF;AAEJ;AAEA,cAAc,YAAY;AAC1B,MAAM,0BAA0B,SAAS,aAAa;AACtD,wBAAwB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/chat-container/styled.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\nimport { StyledTitleRightBubble, StyledTitleLeftBubble, StyleBodyWrapper } from '../../exported-related/bubble/styled';\nimport { StyledComposerInput } from '../chat-composer/styled';\nimport { Wrapper, Title, Time, Message } from '../../exported-related/system-message/style';\nexport const CONTAINER_WIDTH = 300;\n\nexport const StyledChatContainerContent = styled(Grid)`\n height: 100%;\n min-width: ${CONTAINER_WIDTH}px;\n overflow: hidden;\n background: ${(props) => props.theme.colors.neutral['050']};\n position: relative;\n`;\nexport const StyledIndicatorContainer = styled.div<{\n isLoading?: 'top' | 'bottom';\n linear?: boolean;\n}>`\n transition: 0.4s ease-in-out;\n position: absolute;\n visibility: hidden;\n pointer-events: none;\n width: 100%;\n padding: 0 ${(props) => (!props.linear ? props.theme.space.xxs : 0)};\n left: 0;\n right: 0;\n background: ${(props) => props.theme.colors.neutral['000']};\n ${(props) =>\n props.isLoading === 'top'\n ? `\n top: -41px;\n transform: translate(0, 41px);\n visibility: visible;\n pointer-events: auto;\n `\n : ''}\n ${(props) =>\n props.isLoading === 'bottom'\n ? `\n bottom: -41px;\n transform: translate(0, -41px);\n visibility: visible;\n pointer-events: auto;\n `\n : ''}\n\n & div,a {\n font-size: 13px;\n }\n`;\n\nexport const MobileStyledChatContainerContent = styled(StyledChatContainerContent)`\n ${StyledTitleLeftBubble},\n ${StyleBodyWrapper} {\n font-size: 16px;\n }\n\n ${StyledTitleRightBubble} {\n font-size: 13px;\n }\n\n ${Wrapper} {\n background-color: #fff;\n box-shadow: -0 1px 3px rgba(53, 60, 70, 0.8);\n }\n\n ${Title},\n ${Message} {\n font-size: 16px;\n text-align: left;\n }\n\n ${Time} {\n font-size: 13px;\n }\n\n ${StyledComposerInput} {\n font-size: 16px;\n }\n\n ${StyledIndicatorContainer} {\n font-size: 16px;\n }\n`;\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACO,MAAM,kBAAkB;AAExB,MAAM,6BAA6B,OAAO;AAAA;AAAA,
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACO,MAAM,kBAAkB;AAExB,MAAM,6BAA6B,OAAO,IAAI;AAAA;AAAA,eAEtC;AAAA;AAAA,gBAEC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAG/C,MAAM,2BAA2B,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAShC,CAAC,UAAW,CAAC,MAAM,SAAS,MAAM,MAAM,MAAM,MAAM;AAAA;AAAA;AAAA,gBAGnD,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA,IAClD,CAAC,UACD,MAAM,cAAc,QAChB;AAAA;AAAA;AAAA;AAAA;AAAA,MAMA;AAAA,IACJ,CAAC,UACD,MAAM,cAAc,WAChB;AAAA;AAAA;AAAA;AAAA;AAAA,MAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOD,MAAM,mCAAmC,OAAO,0BAA0B;AAAA,IAC7E;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
useGetGlobalAttributes,
|
|
25
25
|
useValidateTypescriptPropTypes,
|
|
26
26
|
describe
|
|
27
|
-
} from "@elliemae/ds-
|
|
27
|
+
} from "@elliemae/ds-utilities";
|
|
28
28
|
import { useVirtual } from "react-virtual";
|
|
29
29
|
import DSButton from "@elliemae/ds-button";
|
|
30
30
|
import { debounce } from "lodash";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/chat-container-messages-list/ChatContainerMessagesList.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable jsx-a11y/no-noninteractive-tabindex */\n/* eslint-disable max-lines */\nimport React, { CSSProperties, WeakValidationMap } from 'react';\nimport {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n describe,\n} from '@elliemae/ds-props-helpers';\nimport { useVirtual } from 'react-virtual';\nimport DSButton from '@elliemae/ds-button';\nimport { debounce } from 'lodash';\nimport { ChatBubble, BUBBLE_TYPES } from '../../exported-related/bubble';\nimport { MessageDelimiter } from '../../exported-related/message-delimiter';\nimport { SystemMessage } from '../../exported-related/system-message';\nimport {\n StyledWrapperListItem,\n StyledChatContainerContentList,\n StyledChatContainerContentListScroll,\n StyledWrapper,\n StyledLoadMoreContainer,\n ListItem,\n StyledNewMessagesHiddenContainer,\n} from './styled';\nimport { DSChatT, ChatContainerMessagesListPropTypes, defaultPropsMessagesList } from '../../react-desc-prop-types';\nimport { useGetNewMessages } from './useGetNewMessages';\n\nconst getPadding = ({ hasMoreItems, bannerPosition, isLoading }: DSChatT.GetPaddingT) => {\n const padding = {\n paddingStart: 0,\n paddingEnd: -5,\n };\n if ([hasMoreItems, bannerPosition, isLoading].some((item) => item === 'top')) padding.paddingStart = 42;\n else if ([hasMoreItems, bannerPosition, isLoading].some((item) => item === 'bottom')) padding.paddingEnd = 42;\n return padding;\n};\nconst ChatContainerMessagesList: React.ComponentType<DSChatT.MessagesListProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatT.MessagesListProps>(props, defaultPropsMessagesList);\n useValidateTypescriptPropTypes<DSChatT.MessagesListProps>(propsWithDefault, ChatContainerMessagesListPropTypes);\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n const {\n sendingText,\n bannerPosition,\n sendingMessages,\n messages,\n actionRef,\n onScrollEnds,\n getMoreMessages,\n hasMoreItems,\n isLoading,\n bannerRef,\n } = propsWithDefault;\n const pendingOnScroll = React.useRef(false);\n const loadMoreRef = React.useRef(null);\n const virtualListRef = React.useRef<HTMLDivElement>();\n // estimateSize should not be really required given what was stated on\n // https://github.com/tannerlinsley/react-virtual/issues/23\n const {\n scrollToIndex: vScroll,\n totalSize,\n virtualItems,\n } = useVirtual({\n size: messages?.length,\n parentRef: virtualListRef,\n overscan: 15,\n ...getPadding({ hasMoreItems, bannerPosition, isLoading }),\n estimateSize: React.useCallback(() => 80, []),\n });\n\n const newMessages = useGetNewMessages(messages);\n\n const debouncedScroll = React.useMemo(\n () =>\n debounce((): number[] => {\n if (document.visibilityState === 'hidden') {\n pendingOnScroll.current = true;\n return [];\n }\n if (!virtualListRef.current) return [];\n pendingOnScroll.current = false;\n const { bottom, top } = virtualListRef.current?.getBoundingClientRect();\n\n const list = virtualListRef.current.querySelectorAll(\n '[data-element=\"chat-element-list-item\"]',\n ) as NodeListOf<HTMLDivElement>;\n const indexList = [];\n list.forEach((item: HTMLElement) => {\n const { top: itemTop } = item.getBoundingClientRect();\n\n const itemPadding = 10;\n if (itemTop + itemPadding < bottom && itemTop + itemPadding > top) indexList.push(item.dataset.index);\n });\n if (onScrollEnds) onScrollEnds(indexList);\n return indexList;\n }, 500),\n [onScrollEnds],\n );\n\n const onScrollStop = React.useCallback(debouncedScroll, [debouncedScroll]);\n\n const onlyFocus = React.useCallback((index?: number) => {\n (virtualListRef.current.querySelector(`[data-index=\"${index}\"]`) as HTMLDivElement).focus();\n }, []);\n\n const scrollAndFocus = React.useCallback(\n (index: number, b = { align: 'center' }) => {\n vScroll(index, b);\n onlyFocus(index);\n onScrollStop();\n },\n [onScrollStop, onlyFocus, vScroll],\n );\n\n const checkPendingOnScroll = React.useCallback(() => {\n if (pendingOnScroll.current === true) onScrollStop();\n }, [onScrollStop]);\n\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.scrollToIndex = (a, b = { align: 'center' }) => {\n vScroll(a, b as any);\n onScrollStop();\n };\n actionRef.current.getMessagesInView = onScrollStop;\n onScrollStop(); // init useMemo due to debounce use.\n actionRef.current.focusToIndex = (a, b = { align: 'center' } as ScrollToOptions) => {\n scrollAndFocus(a, b);\n };\n actionRef.current.focusToIndexWithoutScroll = onlyFocus;\n actionRef.current.focusToList = () => {\n virtualListRef.current?.focus();\n };\n }\n }, [actionRef, onScrollStop, onlyFocus, scrollAndFocus, vScroll]);\n\n React.useEffect(() => {\n let handlerCallback = null;\n const localVirtualRef = virtualListRef.current;\n const onScroll = () => {\n if (handlerCallback) clearTimeout(handlerCallback);\n handlerCallback = setTimeout(onScrollStop, 300);\n };\n if (onScrollEnds) {\n virtualListRef.current.addEventListener('scroll', onScroll);\n }\n document.addEventListener('visibilitychange', checkPendingOnScroll);\n return () => {\n if (handlerCallback) clearTimeout(handlerCallback);\n if (onScrollEnds) localVirtualRef.removeEventListener('scroll', onScroll);\n document.removeEventListener('visibilitychange', checkPendingOnScroll);\n };\n }, [onScrollStop, onScrollEnds, checkPendingOnScroll]);\n\n const handleKey = React.useCallback(\n (e: React.KeyboardEvent) => {\n const { key } = e;\n const index = Number(e.currentTarget.dataset.index);\n e.stopPropagation();\n switch (key) {\n case 'ArrowUp':\n e.preventDefault();\n if (index > 0) {\n (virtualListRef.current?.querySelector(`[data-index=\"${index - 1}\"]`) as HTMLDivElement).focus();\n } else if (hasMoreItems === 'top') {\n loadMoreRef.current?.focus();\n }\n break;\n case 'ArrowDown':\n e.preventDefault();\n if (index < messages?.length - 1) {\n (virtualListRef.current?.querySelector(`[data-index=\"${index + 1}\"]`) as HTMLDivElement).focus();\n }\n break;\n case 'Home':\n e.preventDefault();\n scrollAndFocus(0);\n break;\n case 'End':\n e.preventDefault();\n scrollAndFocus(messages?.length - 1);\n break;\n case 'Tab':\n if (hasMoreItems === 'bottom' && !e.shiftKey) {\n e.preventDefault();\n loadMoreRef.current?.focus();\n } else if (hasMoreItems === 'top' && e.shiftKey) {\n e.preventDefault();\n loadMoreRef.current?.focus();\n } else if (!e.shiftKey) {\n if (bannerPosition) {\n e.preventDefault();\n bannerRef?.current?.focusOnWrapper();\n }\n } else {\n e.preventDefault();\n virtualListRef.current?.focus();\n }\n break;\n default:\n break;\n }\n },\n [bannerRef, hasMoreItems, messages?.length, bannerPosition, scrollAndFocus],\n );\n const handleListKey = React.useCallback(\n (e: React.KeyboardEvent) => {\n const { key } = e;\n switch (key) {\n case 'ArrowUp':\n e.preventDefault();\n if (document.activeElement !== loadMoreRef.current) {\n onlyFocus(onScrollStop()?.shift());\n }\n break;\n case 'ArrowDown':\n e.preventDefault();\n if (document.activeElement === loadMoreRef.current) {\n (virtualListRef.current.querySelector(`[data-index=\"0\"]`) as HTMLDivElement).focus();\n } else {\n onlyFocus(onScrollStop()?.pop());\n }\n break;\n case 'Home':\n e.preventDefault();\n scrollAndFocus(0);\n break;\n case 'End':\n e.preventDefault();\n scrollAndFocus(messages?.length - 1);\n break;\n case 'Tab':\n if (document.activeElement !== loadMoreRef.current) {\n if (hasMoreItems === 'bottom' && !e.shiftKey) {\n e.preventDefault();\n loadMoreRef.current?.focus();\n } else if (!e.shiftKey) {\n e.preventDefault();\n actionRef.current.focusToComposer();\n }\n } else if (!e.shiftKey) {\n e.preventDefault();\n actionRef.current.focusToComposer();\n } else {\n e.preventDefault();\n virtualListRef.current?.focus();\n }\n break;\n default:\n break;\n }\n },\n [actionRef, hasMoreItems, messages?.length, onScrollStop, onlyFocus, scrollAndFocus],\n );\n\n const render = React.useMemo(\n () =>\n virtualItems.map((virtualItem) => {\n const { index, measureRef, start } = virtualItem;\n const row = messages[index];\n const isSending = sendingMessages && sendingMessages.find((m) => m === row.dsId);\n const style: CSSProperties = {\n position: 'absolute',\n top: 0,\n left: 0,\n transform: `translateY(${start}px)`,\n width: '100%',\n };\n\n return (\n <ListItem\n data-element=\"chat-element-list-item\"\n data-index={index}\n key={`ds-chat-bubble-${index}-${row.dsId}-${row.type}`}\n style={style}\n ref={measureRef}\n tabIndex={-1}\n onKeyDown={handleKey}\n role=\"listitem\"\n >\n <StyledWrapperListItem type={row.type}>\n {row.type === BUBBLE_TYPES.SENDER || row.type === BUBBLE_TYPES.RECIPIENT ? (\n // eslint-disable-next-line eslint-comments/no-unlimited-disable\n <ChatBubble {...row} helpMessage={isSending ? sendingText : row.helpMessage} />\n ) : null}\n {row.type === BUBBLE_TYPES.DELIMITER ? <MessageDelimiter {...row} /> : null}\n {row.type === BUBBLE_TYPES.SYSTEM ? <SystemMessage {...row} /> : null}\n </StyledWrapperListItem>\n </ListItem>\n );\n }),\n [virtualItems, messages, sendingMessages, handleKey, sendingText],\n );\n\n return (\n <StyledWrapper {...globalAttributes}>\n <StyledChatContainerContentList\n data-testid=\"chat-thread-container\"\n tabIndex={0}\n ref={virtualListRef as React.RefObject<HTMLDivElement>}\n role=\"list\"\n onKeyDown={handleListKey}\n >\n <StyledChatContainerContentListScroll height={`${totalSize}px`}>\n {!isLoading && hasMoreItems ? (\n <StyledLoadMoreContainer hasMoreItems={hasMoreItems}>\n <DSButton\n labelText=\"Load More\"\n buttonType=\"secondary\"\n onClick={getMoreMessages}\n data-testid=\"ds-chat-load-more-btn\"\n innerRef={loadMoreRef}\n />\n </StyledLoadMoreContainer>\n ) : null}\n {render}\n </StyledChatContainerContentListScroll>\n </StyledChatContainerContentList>\n {/* We repeat the render with the new available messages */}\n <StyledNewMessagesHiddenContainer aria-live=\"polite\" aria-hidden=\"false\">\n {newMessages.map((newMessage) => (\n <p key={newMessage.dsId}>\n {newMessage.title} {newMessage.time} {newMessage.body} {newMessage.errorMessage} {newMessage.helpMessage}\n </p>\n ))}\n </StyledNewMessagesHiddenContainer>\n </StyledWrapper>\n );\n};\n\nChatContainerMessagesList.propTypes = ChatContainerMessagesListPropTypes as WeakValidationMap<unknown>;\nconst ChatContainerMessagesListWithSchema = describe(ChatContainerMessagesList);\nChatContainerMessagesListWithSchema.propTypes = ChatContainerMessagesListPropTypes as WeakValidationMap<unknown>;\n\nexport { ChatContainerMessagesList, ChatContainerMessagesListWithSchema };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACGA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA;AACA;AAEA,MAAM,aAAa,CAAC,EAAE,cAAc,gBAAgB,gBAAqC;AACvF,QAAM,UAAU;AAAA,IACd,cAAc;AAAA,IACd,YAAY;AAAA;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable jsx-a11y/no-noninteractive-tabindex */\n/* eslint-disable max-lines */\nimport React, { CSSProperties, WeakValidationMap } from 'react';\nimport {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n describe,\n} from '@elliemae/ds-utilities';\nimport { useVirtual } from 'react-virtual';\nimport DSButton from '@elliemae/ds-button';\nimport { debounce } from 'lodash';\nimport { ChatBubble, BUBBLE_TYPES } from '../../exported-related/bubble';\nimport { MessageDelimiter } from '../../exported-related/message-delimiter';\nimport { SystemMessage } from '../../exported-related/system-message';\nimport {\n StyledWrapperListItem,\n StyledChatContainerContentList,\n StyledChatContainerContentListScroll,\n StyledWrapper,\n StyledLoadMoreContainer,\n ListItem,\n StyledNewMessagesHiddenContainer,\n} from './styled';\nimport { DSChatT, ChatContainerMessagesListPropTypes, defaultPropsMessagesList } from '../../react-desc-prop-types';\nimport { useGetNewMessages } from './useGetNewMessages';\n\nconst getPadding = ({ hasMoreItems, bannerPosition, isLoading }: DSChatT.GetPaddingT) => {\n const padding = {\n paddingStart: 0,\n paddingEnd: -5,\n };\n if ([hasMoreItems, bannerPosition, isLoading].some((item) => item === 'top')) padding.paddingStart = 42;\n else if ([hasMoreItems, bannerPosition, isLoading].some((item) => item === 'bottom')) padding.paddingEnd = 42;\n return padding;\n};\nconst ChatContainerMessagesList: React.ComponentType<DSChatT.MessagesListProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatT.MessagesListProps>(props, defaultPropsMessagesList);\n useValidateTypescriptPropTypes<DSChatT.MessagesListProps>(propsWithDefault, ChatContainerMessagesListPropTypes);\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n const {\n sendingText,\n bannerPosition,\n sendingMessages,\n messages,\n actionRef,\n onScrollEnds,\n getMoreMessages,\n hasMoreItems,\n isLoading,\n bannerRef,\n } = propsWithDefault;\n const pendingOnScroll = React.useRef(false);\n const loadMoreRef = React.useRef(null);\n const virtualListRef = React.useRef<HTMLDivElement>();\n // estimateSize should not be really required given what was stated on\n // https://github.com/tannerlinsley/react-virtual/issues/23\n const {\n scrollToIndex: vScroll,\n totalSize,\n virtualItems,\n } = useVirtual({\n size: messages?.length,\n parentRef: virtualListRef,\n overscan: 15,\n ...getPadding({ hasMoreItems, bannerPosition, isLoading }),\n estimateSize: React.useCallback(() => 80, []),\n });\n\n const newMessages = useGetNewMessages(messages);\n\n const debouncedScroll = React.useMemo(\n () =>\n debounce((): number[] => {\n if (document.visibilityState === 'hidden') {\n pendingOnScroll.current = true;\n return [];\n }\n if (!virtualListRef.current) return [];\n pendingOnScroll.current = false;\n const { bottom, top } = virtualListRef.current?.getBoundingClientRect();\n\n const list = virtualListRef.current.querySelectorAll(\n '[data-element=\"chat-element-list-item\"]',\n ) as NodeListOf<HTMLDivElement>;\n const indexList = [];\n list.forEach((item: HTMLElement) => {\n const { top: itemTop } = item.getBoundingClientRect();\n\n const itemPadding = 10;\n if (itemTop + itemPadding < bottom && itemTop + itemPadding > top) indexList.push(item.dataset.index);\n });\n if (onScrollEnds) onScrollEnds(indexList);\n return indexList;\n }, 500),\n [onScrollEnds],\n );\n\n const onScrollStop = React.useCallback(debouncedScroll, [debouncedScroll]);\n\n const onlyFocus = React.useCallback((index?: number) => {\n (virtualListRef.current.querySelector(`[data-index=\"${index}\"]`) as HTMLDivElement).focus();\n }, []);\n\n const scrollAndFocus = React.useCallback(\n (index: number, b = { align: 'center' }) => {\n vScroll(index, b);\n onlyFocus(index);\n onScrollStop();\n },\n [onScrollStop, onlyFocus, vScroll],\n );\n\n const checkPendingOnScroll = React.useCallback(() => {\n if (pendingOnScroll.current === true) onScrollStop();\n }, [onScrollStop]);\n\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.scrollToIndex = (a, b = { align: 'center' }) => {\n vScroll(a, b as any);\n onScrollStop();\n };\n actionRef.current.getMessagesInView = onScrollStop;\n onScrollStop(); // init useMemo due to debounce use.\n actionRef.current.focusToIndex = (a, b = { align: 'center' } as ScrollToOptions) => {\n scrollAndFocus(a, b);\n };\n actionRef.current.focusToIndexWithoutScroll = onlyFocus;\n actionRef.current.focusToList = () => {\n virtualListRef.current?.focus();\n };\n }\n }, [actionRef, onScrollStop, onlyFocus, scrollAndFocus, vScroll]);\n\n React.useEffect(() => {\n let handlerCallback = null;\n const localVirtualRef = virtualListRef.current;\n const onScroll = () => {\n if (handlerCallback) clearTimeout(handlerCallback);\n handlerCallback = setTimeout(onScrollStop, 300);\n };\n if (onScrollEnds) {\n virtualListRef.current.addEventListener('scroll', onScroll);\n }\n document.addEventListener('visibilitychange', checkPendingOnScroll);\n return () => {\n if (handlerCallback) clearTimeout(handlerCallback);\n if (onScrollEnds) localVirtualRef.removeEventListener('scroll', onScroll);\n document.removeEventListener('visibilitychange', checkPendingOnScroll);\n };\n }, [onScrollStop, onScrollEnds, checkPendingOnScroll]);\n\n const handleKey = React.useCallback(\n (e: React.KeyboardEvent) => {\n const { key } = e;\n const index = Number(e.currentTarget.dataset.index);\n e.stopPropagation();\n switch (key) {\n case 'ArrowUp':\n e.preventDefault();\n if (index > 0) {\n (virtualListRef.current?.querySelector(`[data-index=\"${index - 1}\"]`) as HTMLDivElement).focus();\n } else if (hasMoreItems === 'top') {\n loadMoreRef.current?.focus();\n }\n break;\n case 'ArrowDown':\n e.preventDefault();\n if (index < messages?.length - 1) {\n (virtualListRef.current?.querySelector(`[data-index=\"${index + 1}\"]`) as HTMLDivElement).focus();\n }\n break;\n case 'Home':\n e.preventDefault();\n scrollAndFocus(0);\n break;\n case 'End':\n e.preventDefault();\n scrollAndFocus(messages?.length - 1);\n break;\n case 'Tab':\n if (hasMoreItems === 'bottom' && !e.shiftKey) {\n e.preventDefault();\n loadMoreRef.current?.focus();\n } else if (hasMoreItems === 'top' && e.shiftKey) {\n e.preventDefault();\n loadMoreRef.current?.focus();\n } else if (!e.shiftKey) {\n if (bannerPosition) {\n e.preventDefault();\n bannerRef?.current?.focusOnWrapper();\n }\n } else {\n e.preventDefault();\n virtualListRef.current?.focus();\n }\n break;\n default:\n break;\n }\n },\n [bannerRef, hasMoreItems, messages?.length, bannerPosition, scrollAndFocus],\n );\n const handleListKey = React.useCallback(\n (e: React.KeyboardEvent) => {\n const { key } = e;\n switch (key) {\n case 'ArrowUp':\n e.preventDefault();\n if (document.activeElement !== loadMoreRef.current) {\n onlyFocus(onScrollStop()?.shift());\n }\n break;\n case 'ArrowDown':\n e.preventDefault();\n if (document.activeElement === loadMoreRef.current) {\n (virtualListRef.current.querySelector(`[data-index=\"0\"]`) as HTMLDivElement).focus();\n } else {\n onlyFocus(onScrollStop()?.pop());\n }\n break;\n case 'Home':\n e.preventDefault();\n scrollAndFocus(0);\n break;\n case 'End':\n e.preventDefault();\n scrollAndFocus(messages?.length - 1);\n break;\n case 'Tab':\n if (document.activeElement !== loadMoreRef.current) {\n if (hasMoreItems === 'bottom' && !e.shiftKey) {\n e.preventDefault();\n loadMoreRef.current?.focus();\n } else if (!e.shiftKey) {\n e.preventDefault();\n actionRef.current.focusToComposer();\n }\n } else if (!e.shiftKey) {\n e.preventDefault();\n actionRef.current.focusToComposer();\n } else {\n e.preventDefault();\n virtualListRef.current?.focus();\n }\n break;\n default:\n break;\n }\n },\n [actionRef, hasMoreItems, messages?.length, onScrollStop, onlyFocus, scrollAndFocus],\n );\n\n const render = React.useMemo(\n () =>\n virtualItems.map((virtualItem) => {\n const { index, measureRef, start } = virtualItem;\n const row = messages[index];\n const isSending = sendingMessages && sendingMessages.find((m) => m === row.dsId);\n const style: CSSProperties = {\n position: 'absolute',\n top: 0,\n left: 0,\n transform: `translateY(${start}px)`,\n width: '100%',\n };\n\n return (\n <ListItem\n data-element=\"chat-element-list-item\"\n data-index={index}\n key={`ds-chat-bubble-${index}-${row.dsId}-${row.type}`}\n style={style}\n ref={measureRef}\n tabIndex={-1}\n onKeyDown={handleKey}\n role=\"listitem\"\n >\n <StyledWrapperListItem type={row.type}>\n {row.type === BUBBLE_TYPES.SENDER || row.type === BUBBLE_TYPES.RECIPIENT ? (\n // eslint-disable-next-line eslint-comments/no-unlimited-disable\n <ChatBubble {...row} helpMessage={isSending ? sendingText : row.helpMessage} />\n ) : null}\n {row.type === BUBBLE_TYPES.DELIMITER ? <MessageDelimiter {...row} /> : null}\n {row.type === BUBBLE_TYPES.SYSTEM ? <SystemMessage {...row} /> : null}\n </StyledWrapperListItem>\n </ListItem>\n );\n }),\n [virtualItems, messages, sendingMessages, handleKey, sendingText],\n );\n\n return (\n <StyledWrapper {...globalAttributes}>\n <StyledChatContainerContentList\n data-testid=\"chat-thread-container\"\n tabIndex={0}\n ref={virtualListRef as React.RefObject<HTMLDivElement>}\n role=\"list\"\n onKeyDown={handleListKey}\n >\n <StyledChatContainerContentListScroll height={`${totalSize}px`}>\n {!isLoading && hasMoreItems ? (\n <StyledLoadMoreContainer hasMoreItems={hasMoreItems}>\n <DSButton\n labelText=\"Load More\"\n buttonType=\"secondary\"\n onClick={getMoreMessages}\n data-testid=\"ds-chat-load-more-btn\"\n innerRef={loadMoreRef}\n />\n </StyledLoadMoreContainer>\n ) : null}\n {render}\n </StyledChatContainerContentListScroll>\n </StyledChatContainerContentList>\n {/* We repeat the render with the new available messages */}\n <StyledNewMessagesHiddenContainer aria-live=\"polite\" aria-hidden=\"false\">\n {newMessages.map((newMessage) => (\n <p key={newMessage.dsId}>\n {newMessage.title} {newMessage.time} {newMessage.body} {newMessage.errorMessage} {newMessage.helpMessage}\n </p>\n ))}\n </StyledNewMessagesHiddenContainer>\n </StyledWrapper>\n );\n};\n\nChatContainerMessagesList.propTypes = ChatContainerMessagesListPropTypes as WeakValidationMap<unknown>;\nconst ChatContainerMessagesListWithSchema = describe(ChatContainerMessagesList);\nChatContainerMessagesListWithSchema.propTypes = ChatContainerMessagesListPropTypes as WeakValidationMap<unknown>;\n\nexport { ChatContainerMessagesList, ChatContainerMessagesListWithSchema };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACGA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA;AACA;AAEA,MAAM,aAAa,CAAC,EAAE,cAAc,gBAAgB,gBAAqC;AACvF,QAAM,UAAU;AAAA,IACd,cAAc;AAAA,IACd,YAAY;AAAA,EACd;AACA,MAAI,CAAC,cAAc,gBAAgB,SAAS,EAAE,KAAK,CAAC,SAAS,SAAS,KAAK;AAAG,YAAQ,eAAe;AAAA,WAC5F,CAAC,cAAc,gBAAgB,SAAS,EAAE,KAAK,CAAC,SAAS,SAAS,QAAQ;AAAG,YAAQ,aAAa;AAC3G,SAAO;AACT;AACA,MAAM,4BAA4E,CAAC,UAAU;AAC3F,QAAM,mBAAmB,6BAAwD,OAAO,wBAAwB;AAChH,iCAA0D,kBAAkB,kCAAkC;AAC9G,QAAM,mBAAmB,uBAAuB,gBAAgB;AAChE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE;AACJ,QAAM,kBAAkB,OAAM,OAAO,KAAK;AAC1C,QAAM,cAAc,OAAM,OAAO,IAAI;AACrC,QAAM,iBAAiB,OAAM,OAAuB;AAGpD,QAAM;AAAA,IACJ,eAAe;AAAA,IACf;AAAA,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,OAC9B,IAAI,SAAS,aAAa,UAAU,IAAI,SAAS,aAAa,YAE7D,qCAAC,6CAAe,MAAf;AAAA,MAAoB,aAAa,YAAY,cAAc,IAAI;AAAA,MAAa,IAC3E,MACH,IAAI,SAAS,aAAa,YAAY,qCAAC,qCAAqB,IAAK,IAAK,MACtE,IAAI,SAAS,aAAa,SAAS,qCAAC,kCAAkB,IAAK,IAAK,IACnE,CACF;AAAA,EAEJ,CAAC,GACH,CAAC,cAAc,UAAU,iBAAiB,WAAW,WAAW,CAClE;AAEA,SACE,qCAAC,kCAAkB,mBACjB,qCAAC;AAAA,IACC,eAAY;AAAA,IACZ,UAAU;AAAA,IACV,KAAK;AAAA,IACL,MAAK;AAAA,IACL,WAAW;AAAA,KAEX,qCAAC;AAAA,IAAqC,QAAQ,GAAG;AAAA,KAC9C,CAAC,aAAa,eACb,qCAAC;AAAA,IAAwB;AAAA,KACvB,qCAAC;AAAA,IACC,WAAU;AAAA,IACV,YAAW;AAAA,IACX,SAAS;AAAA,IACT,eAAY;AAAA,IACZ,UAAU;AAAA,GACZ,CACF,IACE,MACH,MACH,CACF,GAEA,qCAAC;AAAA,IAAiC,aAAU;AAAA,IAAS,eAAY;AAAA,KAC9D,YAAY,IAAI,CAAC,eAChB,qCAAC;AAAA,IAAE,KAAK,WAAW;AAAA,KAChB,WAAW,OAAM,KAAE,WAAW,MAAK,KAAE,WAAW,MAAK,KAAE,WAAW,cAAa,KAAE,WAAW,WAC/F,CACD,CACH,CACF;AAEJ;AAEA,0BAA0B,YAAY;AACtC,MAAM,sCAAsC,SAAS,yBAAyB;AAC9E,oCAAoC,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/chat-container-messages-list/useGetNewMessages.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo, useState } from 'react';\nimport { BubbleProps } from '../bubble/props';\n\nexport const useGetNewMessages = (messages: BubbleProps[]) => {\n const [seenMessages, setSeenMessages] = useState<Record<BubbleProps['dsId'], true>>({});\n const newMessages = useMemo(() => {\n const list: BubbleProps[] = [];\n messages.forEach((message) => {\n if (!(message.dsId in seenMessages)) {\n list.push(message);\n }\n });\n setSeenMessages(Object.fromEntries(messages.map((m) => [m.dsId, true])));\n return list;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [messages]);\n\n return newMessages;\n};\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AAGO,MAAM,oBAAoB,CAAC,aAA4B;AAC5D,QAAM,CAAC,cAAc,mBAAmB,SAA4C;
|
|
5
|
+
"mappings": "AAAA;ACAA;AAGO,MAAM,oBAAoB,CAAC,aAA4B;AAC5D,QAAM,CAAC,cAAc,mBAAmB,SAA4C,CAAC,CAAC;AACtF,QAAM,cAAc,QAAQ,MAAM;AAChC,UAAM,OAAsB,CAAC;AAC7B,aAAS,QAAQ,CAAC,YAAY;AAC5B,UAAI,CAAE,SAAQ,QAAQ,eAAe;AACnC,aAAK,KAAK,OAAO;AAAA,MACnB;AAAA,IACF,CAAC;AACD,oBAAgB,OAAO,YAAY,SAAS,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC;AACvE,WAAO;AAAA,EAET,GAAG,CAAC,QAAQ,CAAC;AAEb,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -19,7 +19,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
import * as React from "react";
|
|
21
21
|
import { noop } from "lodash";
|
|
22
|
-
import { PropTypes, globalAttributesPropTypes } from "@elliemae/ds-
|
|
22
|
+
import { PropTypes, globalAttributesPropTypes } from "@elliemae/ds-utilities";
|
|
23
23
|
import { BANNER_TYPES } from "@elliemae/ds-banner";
|
|
24
24
|
const defaultPropsComposer = {
|
|
25
25
|
placeholder: "Type your message",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { noop } from 'lodash';\nimport { PropTypes, globalAttributesPropTypes } from '@elliemae/ds-props-helpers';\nimport { BANNER_TYPES } from '@elliemae/ds-banner';\nimport { BubblePropsT } from './exported-related/bubble/props';\n\nexport declare namespace DSChatT {\n export interface ContainerProps {\n messagesListProps: Pick<MessagesListProps, 'messages' | 'onScrollEnds'>;\n composerProps: ComposerProps;\n actionRef?: ActionRef;\n autoScroll: boolean;\n device: 'desktop' | 'mobile';\n isLoading?: 'top' | 'bottom';\n hasMoreItems?: 'top' | 'bottom';\n getMoreMessages: () => void;\n bannerPosition?: 'top' | 'bottom';\n bannerProps?: ChatBannerProps;\n sendingMessages?: string[] | number[];\n sendingText: string;\n }\n\n export interface ComposerProps {\n placeholder?: string;\n inputValue?: string;\n ariaMaxLengthMessage?: string;\n maxLengthMessage?: string;\n onChange: (value: string) => void;\n onResize?: (value: number) => void;\n onSend: (value: string) => void;\n onFocus?: (e: React.ChangeEvent<HTMLTextAreaElement>, value: string) => void;\n onBlur?: (e: React.ChangeEvent<HTMLTextAreaElement>, value: string) => void;\n onKeyDown?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;\n maxHeight?: number;\n inputMaxLength: number | undefined;\n buttonDisabled: boolean;\n dataTestid?: string;\n actionRef?: ActionRef;\n }\n\n export interface MessagesListProps {\n messages: BubblePropsT[];\n actionRef: () => void;\n onScrollEnds: (indexList: number[]) => number[];\n isLoading?: 'top' | 'bottom';\n hasMoreItems?: 'top' | 'bottom';\n getMoreMessages: () => void;\n sendingMessages?: Array<string | number>;\n sendingText: string;\n bannerPosition?: 'top' | 'bottom';\n bannerRef?: React.MutableRefObject<{\n focusOnWrapper: (...args: any[]) => void;\n focusOnLink: (...args: any[]) => void;\n }>;\n }\n\n interface ChatBannerProps {\n label: string;\n viewLabel: string;\n type?: string;\n onView: () => void;\n onClose: () => void;\n }\n\n interface ActionRef {\n scrollToIndex: (n: number, b: { align: 'end' | 'center' | 'start' }) => void;\n getMessagesInView: () => number[];\n }\n\n export interface GetPaddingT {\n hasMoreItems: string | undefined;\n bannerPosition: string | undefined;\n isLoading: string | undefined;\n }\n}\n\nexport interface TextAreaProps {\n height: string | number;\n style: React.CSSProperties;\n}\n\nexport const defaultPropsComposer: DSChatT.ComposerProps = {\n placeholder: 'Type your message',\n inputValue: '',\n ariaMaxLengthMessage: '',\n onChange: noop,\n onResize: noop,\n onSend: noop,\n onFocus: noop,\n onBlur: noop,\n onKeyDown: noop,\n maxHeight: 0,\n inputMaxLength: undefined,\n maxLengthMessage: undefined,\n buttonDisabled: false,\n dataTestid: 'ds-chat-composer',\n actionRef: undefined,\n};\n\nexport const ChatComposerPropTypes = {\n placeholder: PropTypes.string.description('Input Placeholder').defaultValue(defaultPropsComposer.placeholder),\n inputValue: PropTypes.string.description('Input value').defaultValue(defaultPropsComposer.inputValue),\n ariaMaxLengthMessage: PropTypes.string\n .description('Aria message for Max length message when exceeded')\n .defaultValue(defaultPropsComposer.maxLengthMessage),\n maxLengthMessage: PropTypes.string\n .description('Max length message')\n .defaultValue(defaultPropsComposer.maxLengthMessage),\n onChange: PropTypes.func.description('Called when the user types').defaultValue(defaultPropsComposer.onChange),\n onResize: PropTypes.func\n .description('Called the input changes his height')\n .defaultValue(defaultPropsComposer.onResize),\n onSend: PropTypes.func.description('Called when the click send').defaultValue(defaultPropsComposer.onSend),\n onFocus: PropTypes.func.description('Input focus').defaultValue(defaultPropsComposer.onFocus),\n onBlur: PropTypes.func.description('Input blur').defaultValue(defaultPropsComposer.onBlur),\n onKeyDown: PropTypes.func.description('Input on key down').defaultValue(defaultPropsComposer.onKeyDown),\n maxHeight: PropTypes.number\n .description('Max height of the composer. Use 0 for no limit')\n .defaultValue(defaultPropsComposer.onBlur),\n inputMaxLength: PropTypes.number\n .description('Max length of the composer. `undefined` for no limit')\n .defaultValue(defaultPropsComposer.inputMaxLength),\n buttonDisabled: PropTypes.bool\n .description('Control the disabled for the send button')\n .defaultValue(defaultPropsComposer.buttonDisabled),\n dataTestid: PropTypes.string.description('Data testid').defaultValue(defaultPropsComposer.placeholder),\n actionRef: PropTypes.object\n .description(\n `Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n `,\n )\n .defaultValue(defaultPropsComposer.actionRef),\n};\n\nexport const defaultPropsMessagesList: DSChatT.MessagesListProps = {\n messages: [],\n actionRef: noop,\n onScrollEnds: () => [],\n getMoreMessages: noop,\n sendingMessages: undefined,\n sendingText: 'Sending',\n bannerPosition: undefined,\n bannerRef: undefined,\n};\n\nexport const ChatContainerMessagesListPropTypes = {\n ...globalAttributesPropTypes,\n\n messages: PropTypes.arrayOf(PropTypes.object)\n .description('The array of out-of-the-box items you want to render inside the ChatMessageList')\n .defaultValue(defaultPropsMessagesList.messages),\n actionRef: PropTypes.object\n .description(\n `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 `,\n )\n .defaultValue(defaultPropsMessagesList.actionRef),\n onScrollEnds: PropTypes.func.description(`Called when the scroll stops.`),\n isLoading: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Keeps the load more space while the loading is in progress',\n ),\n hasMoreItems: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Load More button at the `top` or `bottom` of the container',\n ),\n getMoreMessages: PropTypes.func\n .description('Called when the user clicks on load more')\n .defaultValue(defaultPropsMessagesList.getMoreMessages),\n sendingMessages: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.number)])\n .description('Array of ids of sending messages')\n .defaultValue(defaultPropsMessagesList.sendingMessages),\n sendingText: PropTypes.string\n .description('Label description for messages in sending status')\n .defaultValue(defaultPropsMessagesList.sendingText),\n};\n\nexport const defaultProps: DSChatT.ContainerProps = {\n messagesListProps: defaultPropsMessagesList,\n composerProps: defaultPropsComposer,\n actionRef: undefined,\n autoScroll: false,\n device: 'desktop',\n isLoading: undefined,\n hasMoreItems: undefined,\n getMoreMessages: noop,\n bannerPosition: undefined,\n bannerProps: {\n type: BANNER_TYPES.INFO,\n label: 'Unread Messages',\n viewLabel: 'View',\n onView: noop,\n onClose: noop,\n },\n sendingMessages: undefined,\n sendingText: 'Sending',\n};\n\nexport const ChatContainerPropTypes = {\n ...globalAttributesPropTypes,\n messagesListProps: PropTypes.object\n .description('ChatMessageList props \"messages\" / \"onScrollEnds\"')\n .defaultValue(defaultProps.messagesListProps),\n composerProps: PropTypes.object.description('Composer configuration').defaultValue(defaultProps.composerProps),\n autoScroll: PropTypes.bool.description('Auto scroll to bottom on resize').defaultValue(defaultProps.autoScroll),\n device: PropTypes.string\n .description('Option to render mobile or desktop style composer')\n .defaultValue(defaultProps.device),\n isLoading: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Loading messages indicator at the `top` or `bottom` of the container',\n ),\n hasMoreItems: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Load More button at the `top` or `bottom` of the container',\n ),\n getMoreMessages: PropTypes.func\n .description('Called when the user clicks on load more')\n .defaultValue(defaultProps.getMoreMessages),\n bannerPosition: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Loading messages indicator at the `top` or `bottom` of the container',\n ),\n bannerProps: PropTypes.object\n .description(\n `Banner configuration:\n label: string;\n viewLabel: string;\n type: BANNER_TYPES;\n onView: () => void;\n onClose: () => void;\n `,\n )\n .defaultValue(defaultProps.bannerProps),\n sendingMessages: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.number)])\n .description('Array of ids of sending messages')\n .defaultValue(defaultProps.sendingMessages),\n sendingText: PropTypes.string\n .description('Label description for messages in sending status')\n .defaultValue(defaultProps.sendingText),\n actionRef: PropTypes.object\n .description(\n `Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n `,\n )\n .defaultValue(defaultProps.actionRef),\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AA8EO,MAAM,uBAA8C;AAAA,EACzD,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,sBAAsB;AAAA,EACtB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { noop } from 'lodash';\nimport { PropTypes, globalAttributesPropTypes } from '@elliemae/ds-utilities';\nimport { BANNER_TYPES } from '@elliemae/ds-banner';\nimport { BubblePropsT } from './exported-related/bubble/props';\n\nexport declare namespace DSChatT {\n export interface ContainerProps {\n messagesListProps: Pick<MessagesListProps, 'messages' | 'onScrollEnds'>;\n composerProps: ComposerProps;\n actionRef?: ActionRef;\n autoScroll: boolean;\n device: 'desktop' | 'mobile';\n isLoading?: 'top' | 'bottom';\n hasMoreItems?: 'top' | 'bottom';\n getMoreMessages: () => void;\n bannerPosition?: 'top' | 'bottom';\n bannerProps?: ChatBannerProps;\n sendingMessages?: string[] | number[];\n sendingText: string;\n }\n\n export interface ComposerProps {\n placeholder?: string;\n inputValue?: string;\n ariaMaxLengthMessage?: string;\n maxLengthMessage?: string;\n onChange: (value: string) => void;\n onResize?: (value: number) => void;\n onSend: (value: string) => void;\n onFocus?: (e: React.ChangeEvent<HTMLTextAreaElement>, value: string) => void;\n onBlur?: (e: React.ChangeEvent<HTMLTextAreaElement>, value: string) => void;\n onKeyDown?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;\n maxHeight?: number;\n inputMaxLength: number | undefined;\n buttonDisabled: boolean;\n dataTestid?: string;\n actionRef?: ActionRef;\n }\n\n export interface MessagesListProps {\n messages: BubblePropsT[];\n actionRef: () => void;\n onScrollEnds: (indexList: number[]) => number[];\n isLoading?: 'top' | 'bottom';\n hasMoreItems?: 'top' | 'bottom';\n getMoreMessages: () => void;\n sendingMessages?: Array<string | number>;\n sendingText: string;\n bannerPosition?: 'top' | 'bottom';\n bannerRef?: React.MutableRefObject<{\n focusOnWrapper: (...args: any[]) => void;\n focusOnLink: (...args: any[]) => void;\n }>;\n }\n\n interface ChatBannerProps {\n label: string;\n viewLabel: string;\n type?: string;\n onView: () => void;\n onClose: () => void;\n }\n\n interface ActionRef {\n scrollToIndex: (n: number, b: { align: 'end' | 'center' | 'start' }) => void;\n getMessagesInView: () => number[];\n }\n\n export interface GetPaddingT {\n hasMoreItems: string | undefined;\n bannerPosition: string | undefined;\n isLoading: string | undefined;\n }\n}\n\nexport interface TextAreaProps {\n height: string | number;\n style: React.CSSProperties;\n}\n\nexport const defaultPropsComposer: DSChatT.ComposerProps = {\n placeholder: 'Type your message',\n inputValue: '',\n ariaMaxLengthMessage: '',\n onChange: noop,\n onResize: noop,\n onSend: noop,\n onFocus: noop,\n onBlur: noop,\n onKeyDown: noop,\n maxHeight: 0,\n inputMaxLength: undefined,\n maxLengthMessage: undefined,\n buttonDisabled: false,\n dataTestid: 'ds-chat-composer',\n actionRef: undefined,\n};\n\nexport const ChatComposerPropTypes = {\n placeholder: PropTypes.string.description('Input Placeholder').defaultValue(defaultPropsComposer.placeholder),\n inputValue: PropTypes.string.description('Input value').defaultValue(defaultPropsComposer.inputValue),\n ariaMaxLengthMessage: PropTypes.string\n .description('Aria message for Max length message when exceeded')\n .defaultValue(defaultPropsComposer.maxLengthMessage),\n maxLengthMessage: PropTypes.string\n .description('Max length message')\n .defaultValue(defaultPropsComposer.maxLengthMessage),\n onChange: PropTypes.func.description('Called when the user types').defaultValue(defaultPropsComposer.onChange),\n onResize: PropTypes.func\n .description('Called the input changes his height')\n .defaultValue(defaultPropsComposer.onResize),\n onSend: PropTypes.func.description('Called when the click send').defaultValue(defaultPropsComposer.onSend),\n onFocus: PropTypes.func.description('Input focus').defaultValue(defaultPropsComposer.onFocus),\n onBlur: PropTypes.func.description('Input blur').defaultValue(defaultPropsComposer.onBlur),\n onKeyDown: PropTypes.func.description('Input on key down').defaultValue(defaultPropsComposer.onKeyDown),\n maxHeight: PropTypes.number\n .description('Max height of the composer. Use 0 for no limit')\n .defaultValue(defaultPropsComposer.onBlur),\n inputMaxLength: PropTypes.number\n .description('Max length of the composer. `undefined` for no limit')\n .defaultValue(defaultPropsComposer.inputMaxLength),\n buttonDisabled: PropTypes.bool\n .description('Control the disabled for the send button')\n .defaultValue(defaultPropsComposer.buttonDisabled),\n dataTestid: PropTypes.string.description('Data testid').defaultValue(defaultPropsComposer.placeholder),\n actionRef: PropTypes.object\n .description(\n `Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n `,\n )\n .defaultValue(defaultPropsComposer.actionRef),\n};\n\nexport const defaultPropsMessagesList: DSChatT.MessagesListProps = {\n messages: [],\n actionRef: noop,\n onScrollEnds: () => [],\n getMoreMessages: noop,\n sendingMessages: undefined,\n sendingText: 'Sending',\n bannerPosition: undefined,\n bannerRef: undefined,\n};\n\nexport const ChatContainerMessagesListPropTypes = {\n ...globalAttributesPropTypes,\n\n messages: PropTypes.arrayOf(PropTypes.object)\n .description('The array of out-of-the-box items you want to render inside the ChatMessageList')\n .defaultValue(defaultPropsMessagesList.messages),\n actionRef: PropTypes.object\n .description(\n `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 `,\n )\n .defaultValue(defaultPropsMessagesList.actionRef),\n onScrollEnds: PropTypes.func.description(`Called when the scroll stops.`),\n isLoading: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Keeps the load more space while the loading is in progress',\n ),\n hasMoreItems: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Load More button at the `top` or `bottom` of the container',\n ),\n getMoreMessages: PropTypes.func\n .description('Called when the user clicks on load more')\n .defaultValue(defaultPropsMessagesList.getMoreMessages),\n sendingMessages: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.number)])\n .description('Array of ids of sending messages')\n .defaultValue(defaultPropsMessagesList.sendingMessages),\n sendingText: PropTypes.string\n .description('Label description for messages in sending status')\n .defaultValue(defaultPropsMessagesList.sendingText),\n};\n\nexport const defaultProps: DSChatT.ContainerProps = {\n messagesListProps: defaultPropsMessagesList,\n composerProps: defaultPropsComposer,\n actionRef: undefined,\n autoScroll: false,\n device: 'desktop',\n isLoading: undefined,\n hasMoreItems: undefined,\n getMoreMessages: noop,\n bannerPosition: undefined,\n bannerProps: {\n type: BANNER_TYPES.INFO,\n label: 'Unread Messages',\n viewLabel: 'View',\n onView: noop,\n onClose: noop,\n },\n sendingMessages: undefined,\n sendingText: 'Sending',\n};\n\nexport const ChatContainerPropTypes = {\n ...globalAttributesPropTypes,\n messagesListProps: PropTypes.object\n .description('ChatMessageList props \"messages\" / \"onScrollEnds\"')\n .defaultValue(defaultProps.messagesListProps),\n composerProps: PropTypes.object.description('Composer configuration').defaultValue(defaultProps.composerProps),\n autoScroll: PropTypes.bool.description('Auto scroll to bottom on resize').defaultValue(defaultProps.autoScroll),\n device: PropTypes.string\n .description('Option to render mobile or desktop style composer')\n .defaultValue(defaultProps.device),\n isLoading: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Loading messages indicator at the `top` or `bottom` of the container',\n ),\n hasMoreItems: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Load More button at the `top` or `bottom` of the container',\n ),\n getMoreMessages: PropTypes.func\n .description('Called when the user clicks on load more')\n .defaultValue(defaultProps.getMoreMessages),\n bannerPosition: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Loading messages indicator at the `top` or `bottom` of the container',\n ),\n bannerProps: PropTypes.object\n .description(\n `Banner configuration:\n label: string;\n viewLabel: string;\n type: BANNER_TYPES;\n onView: () => void;\n onClose: () => void;\n `,\n )\n .defaultValue(defaultProps.bannerProps),\n sendingMessages: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.number)])\n .description('Array of ids of sending messages')\n .defaultValue(defaultProps.sendingMessages),\n sendingText: PropTypes.string\n .description('Label description for messages in sending status')\n .defaultValue(defaultProps.sendingText),\n actionRef: PropTypes.object\n .description(\n `Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n `,\n )\n .defaultValue(defaultProps.actionRef),\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AA8EO,MAAM,uBAA8C;AAAA,EACzD,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,sBAAsB;AAAA,EACtB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,WAAW;AAAA,E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