@elliemae/ds-chat 1.57.0-rc.2 → 1.57.0-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.js +3 -10
- package/cjs/index.js.map +1 -1
- package/cjs/parts/bubble/ChatBubble.js +2 -3
- package/cjs/parts/bubble/ChatBubble.js.map +1 -1
- package/cjs/parts/bubble/index.js +1 -1
- package/cjs/parts/chat-composer/ChatContainerComposer.js +6 -6
- package/cjs/parts/chat-composer/ChatContainerComposer.js.map +1 -1
- package/cjs/parts/chat-composer/index.js +1 -1
- package/cjs/parts/chat-composer/props.js +2 -0
- package/cjs/parts/chat-composer/props.js.map +1 -1
- package/cjs/parts/chat-composer/styled.js +2 -2
- package/cjs/parts/chat-container/ChatContainer.js +2 -4
- package/cjs/parts/chat-container/ChatContainer.js.map +1 -1
- package/cjs/parts/chat-container/index.js +2 -4
- package/cjs/parts/chat-container/index.js.map +1 -1
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js +2 -2
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +1 -1
- package/cjs/parts/chat-container-messages-list/index.js +2 -2
- package/cjs/parts/chat-container-messages-list/styled.js +1 -1
- package/cjs/parts/chat-empty-state/ChatEmptyState.js +2 -3
- package/cjs/parts/chat-empty-state/ChatEmptyState.js.map +1 -1
- package/cjs/parts/chat-sidebar/SideBarChat.js +2 -7
- package/cjs/parts/chat-sidebar/SideBarChat.js.map +1 -1
- package/cjs/parts/chat-sidebar/index.js +1 -4
- package/cjs/parts/chat-sidebar/index.js.map +1 -1
- package/cjs/parts/floating-button/FloatingButton.js +2 -3
- package/cjs/parts/floating-button/FloatingButton.js.map +1 -1
- package/cjs/parts/floating-button/index.js +1 -1
- package/cjs/parts/grid-influencer/InfluencerContainer.js +2 -8
- package/cjs/parts/grid-influencer/InfluencerContainer.js.map +1 -1
- package/cjs/parts/sidebar-button/SidebarButton.js +1 -1
- package/cjs/parts/sidebar-button/props.js +2 -3
- package/cjs/parts/sidebar-button/props.js.map +1 -1
- package/cjs/parts/tile-button/TileButton.js +2 -4
- package/cjs/parts/tile-button/TileButton.js.map +1 -1
- package/cjs/parts/tile-button/index.js +1 -2
- package/cjs/parts/tile-button/index.js.map +1 -1
- package/cjs/parts/tile-button/props.js +2 -6
- package/cjs/parts/tile-button/props.js.map +1 -1
- package/esm/index.js +3 -10
- package/esm/index.js.map +1 -1
- package/esm/parts/bubble/ChatBubble.js +2 -2
- package/esm/parts/bubble/ChatBubble.js.map +1 -1
- package/esm/parts/bubble/index.js +1 -1
- package/esm/parts/chat-composer/ChatContainerComposer.js +5 -4
- package/esm/parts/chat-composer/ChatContainerComposer.js.map +1 -1
- package/esm/parts/chat-composer/index.js +1 -1
- package/esm/parts/chat-composer/props.js +2 -0
- package/esm/parts/chat-composer/props.js.map +1 -1
- package/esm/parts/chat-container/ChatContainer.js +2 -4
- package/esm/parts/chat-container/ChatContainer.js.map +1 -1
- package/esm/parts/chat-container/index.js +2 -4
- package/esm/parts/chat-container/index.js.map +1 -1
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js +2 -2
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +1 -1
- package/esm/parts/chat-container-messages-list/index.js +2 -2
- package/esm/parts/chat-container-messages-list/styled.js +1 -1
- package/esm/parts/chat-empty-state/ChatEmptyState.js +1 -1
- package/esm/parts/chat-empty-state/ChatEmptyState.js.map +1 -1
- package/esm/parts/chat-sidebar/SideBarChat.js +1 -4
- package/esm/parts/chat-sidebar/SideBarChat.js.map +1 -1
- package/esm/parts/chat-sidebar/index.js +1 -4
- package/esm/parts/chat-sidebar/index.js.map +1 -1
- package/esm/parts/floating-button/FloatingButton.js +1 -1
- package/esm/parts/floating-button/FloatingButton.js.map +1 -1
- package/esm/parts/floating-button/index.js +1 -1
- package/esm/parts/grid-influencer/InfluencerContainer.js +2 -8
- package/esm/parts/grid-influencer/InfluencerContainer.js.map +1 -1
- package/esm/parts/sidebar-button/SidebarButton.js +1 -1
- package/esm/parts/sidebar-button/props.js +1 -1
- package/esm/parts/sidebar-button/props.js.map +1 -1
- package/esm/parts/tile-button/TileButton.js +1 -2
- package/esm/parts/tile-button/TileButton.js.map +1 -1
- package/esm/parts/tile-button/index.js +1 -2
- package/esm/parts/tile-button/index.js.map +1 -1
- package/esm/parts/tile-button/props.js +1 -1
- package/esm/parts/tile-button/props.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatContainerComposer.js","sources":["../../../../src/parts/chat-composer/ChatContainerComposer.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { describe } from 'react-desc';\nimport PaperAirplane from '@elliemae/ds-icons
|
|
1
|
+
{"version":3,"file":"ChatContainerComposer.js","sources":["../../../../src/parts/chat-composer/ChatContainerComposer.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { describe } from 'react-desc';\nimport { PaperAirplane } from '@elliemae/ds-icons';\nimport {\n StyledChatContainerContentComposer,\n StyledComposerInput,\n StyledComposerButton,\n StyledCounterArea,\n StyledCounterErrorA11y,\n} from './styled';\nimport { useValidateProps } from './config/useValidateProps';\n\nimport { defaultComposerPros, composerProps, ChatComposerProps } from './props';\n\nconst ChatComposer = (props: ChatComposerProps): JSX.Element => {\n useValidateProps(props, ChatComposerWithSchema.toJSON());\n\n const {\n inputValue,\n onChange,\n onResize,\n onSend,\n onFocus,\n onBlur,\n maxHeight = 300,\n placeholder,\n inputMaxLength,\n maxLengthMessage,\n buttonDisabled,\n dataTestid,\n actionRef,\n } = props;\n\n const input = React.useRef<HTMLTextAreaElement>();\n const inputSize = React.useRef<HTMLTextAreaElement>();\n const inputSend = React.useRef<HTMLButtonElement>();\n const [height, setHeight] = React.useState(32);\n const internalMaxHeight = React.useMemo(() => maxHeight - 24, [maxHeight]);\n const [showScroll, setShowScroll] = React.useState(true);\n\n React.useEffect(() => {\n const newHeight =\n inputSize.current?.scrollHeight > internalMaxHeight ? internalMaxHeight : inputSize.current?.scrollHeight;\n onResize(newHeight);\n setHeight(newHeight);\n setShowScroll(inputSize.current?.scrollHeight - inputSize.current?.clientHeight > 5);\n }, [inputValue, internalMaxHeight, onResize]);\n\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusToComposer = () => {\n input.current.focus();\n };\n actionRef.current.focusToSend = () => {\n inputSend.current.focus();\n };\n }\n }, [actionRef]);\n\n const handleChange = React.useCallback(\n (e) => {\n onChange(e.target.value);\n },\n [onChange],\n );\n const heightProps = { height, overflow: showScroll ? 'auto' : 'hidden' };\n\n const inputLength = String(inputValue || '').length;\n const hasError = React.useMemo(() => inputLength > inputMaxLength, [inputLength, inputMaxLength]);\n\n return (\n <StyledChatContainerContentComposer rows={['auto', '15px']} maxHeight={`${maxHeight}px`} data-testid={dataTestid}>\n <Grid cols={['1fr', '24px']} justifyContent=\"center\" alignItems=\"flex-end\" gutter=\"xxs\">\n <StyledComposerInput\n ref={input}\n onChange={handleChange}\n style={{ ...heightProps }}\n value={inputValue}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n aria-label=\"Message to send\"\n data-testid=\"chat-composer-textarea\"\n />\n\n <Grid height=\"32px\" alignItems=\"center\">\n <StyledComposerButton\n buttonType=\"text\"\n icon={<PaperAirplane width={18} height={18} />}\n onClick={onSend}\n size=\"s\"\n disabled={!inputValue || buttonDisabled || hasError}\n data-testid=\"chat-composer-send-button\"\n aria-label=\"Send\"\n innerRef={inputSend}\n />\n </Grid>\n </Grid>\n <StyledComposerInput\n ref={inputSize}\n style={{\n height: 32,\n visibility: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n top: 0,\n width: input.current?.clientWidth,\n }}\n onChange={handleChange}\n value={inputValue}\n // maxLength={inputMaxLength}\n />\n <Grid cols={['1fr', '24px']} justifyContent=\"flex-end\" alignItems=\"center\" gutter=\"xxs\" pb=\"xxs\">\n <StyledCounterArea hasError={hasError} data-testid=\"composer-counter-area\">\n {inputMaxLength && hasError ? (\n <>\n <StyledCounterErrorA11y role=\"alert\">\n {maxLengthMessage || `You have exceeded the character limit by ${inputLength - inputMaxLength}`}\n </StyledCounterErrorA11y>\n {maxLengthMessage || `Please limit to less than ${inputMaxLength} characters. `}\n </>\n ) : (\n ''\n )}\n {inputMaxLength ? ` ${inputLength} / ${inputMaxLength}` : ''}\n </StyledCounterArea>\n <Grid />\n </Grid>\n </StyledChatContainerContentComposer>\n );\n};\n\nChatComposer.propTypes = composerProps;\nChatComposer.defaultProps = defaultComposerPros;\nconst ChatComposerWithSchema = describe(ChatComposer);\nChatComposerWithSchema.propTypes = composerProps;\n\nexport { ChatComposer, ChatComposerWithSchema };\n"],"names":["ChatComposer","props","useValidateProps","ChatComposerWithSchema","toJSON","inputValue","onChange","onResize","onSend","onFocus","onBlur","maxHeight","placeholder","inputMaxLength","maxLengthMessage","buttonDisabled","dataTestid","actionRef","input","React","useRef","inputSize","inputSend","useState","height","setHeight","internalMaxHeight","useMemo","showScroll","setShowScroll","useEffect","newHeight","current","scrollHeight","clientHeight","focusToComposer","focus","focusToSend","handleChange","useCallback","e","target","value","heightProps","overflow","inputLength","String","length","hasError","visibility","pointerEvents","position","top","width","clientWidth","propTypes","composerProps","defaultProps","defaultComposerPros","describe"],"mappings":";;;;;;;;;;;;;;;;;;IAgBMA,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAA2C;AAAA;;AAC9DC,EAAAA,gBAAgB,CAACD,KAAD,EAAQE,sBAAsB,CAACC,MAAvB,EAAR,CAAhB;AAEA,MACEC,UADF,GAcIJ,KAdJ,CACEI,UADF;AAAA,MAEEC,QAFF,GAcIL,KAdJ,CAEEK,QAFF;AAAA,MAGEC,QAHF,GAcIN,KAdJ,CAGEM,QAHF;AAAA,MAIEC,MAJF,GAcIP,KAdJ,CAIEO,MA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AFT;AAUE,IAAA,QAAQ,EAAEhB,YAVZ;AAWE,IAAA,KAAK,EAAEjC,UAXT;;AAAA,IA3BF,eAyCE,oBAAC,IAAD;AAAM,IAAA,IAAI,EAAE,CAAC,KAAD,EAAQ,MAAR,CAAZ;AAA6B,IAAA,cAAc,EAAC,UAA5C;AAAuD,IAAA,UAAU,EAAC,QAAlE;AAA2E,IAAA,MAAM,EAAC,KAAlF;AAAwF,IAAA,EAAE,EAAC;AAA3F,kBACE,oBAAC,iBAAD;AAAmB,IAAA,QAAQ,EAAE2C,QAA7B;AAAuC,mBAAY;AAAnD,KACGnC,cAAc,IAAImC,QAAlB,gBACC,uDACE,oBAAC,sBAAD;AAAwB,IAAA,IAAI,EAAC;AAA7B,KACGlC,gBAAgB,uDAAgD+B,WAAW,GAAGhC,cAA9D,CADnB,CADF,EAIGC,gBAAgB,wCAAiCD,cAAjC,kBAJnB,CADD,GAQC,EATJ,EAWGA,cAAc,cAAOgC,WAAP,gBAAwBhC,cAAxB,IAA2C,EAX5D,CADF,eAcE,oBAAC,IAAD,OAdF,CAzCF,CADF;AA4DD;;AAEDb,YAAY,CAACuD,SAAb,GAAyBC,aAAzB;AACAxD,YAAY,CAACyD,YAAb,GAA4BC,mBAA5B;IACMvD,sBAAsB,GAAGwD,QAAQ,CAAC3D,YAAD;AACvCG,sBAAsB,CAACoD,SAAvB,GAAmCC,aAAnC;;;;"}
|
|
@@ -4,7 +4,7 @@ import '@babel/runtime/helpers/esm/slicedToArray';
|
|
|
4
4
|
import 'react';
|
|
5
5
|
import '@elliemae/ds-grid';
|
|
6
6
|
import 'react-desc';
|
|
7
|
-
import '@elliemae/ds-icons
|
|
7
|
+
import '@elliemae/ds-icons';
|
|
8
8
|
import './styled.js';
|
|
9
9
|
import 'styled-components';
|
|
10
10
|
import '@elliemae/ds-button';
|
|
@@ -11,6 +11,7 @@ var defaultComposerPros = {
|
|
|
11
11
|
onBlur: noop,
|
|
12
12
|
maxHeight: 0,
|
|
13
13
|
inputMaxLength: undefined,
|
|
14
|
+
maxLengthMessage: undefined,
|
|
14
15
|
buttonDisabled: false,
|
|
15
16
|
dataTestid: 'ds-chat-composer',
|
|
16
17
|
actionRef: noop
|
|
@@ -18,6 +19,7 @@ var defaultComposerPros = {
|
|
|
18
19
|
var composerProps = {
|
|
19
20
|
placeholder: PropTypes.string.description('Input Placeholder').defaultValue(defaultComposerPros.placeholder),
|
|
20
21
|
inputValue: PropTypes.string.description('Input value').defaultValue(defaultComposerPros.inputValue),
|
|
22
|
+
maxLengthMessage: PropTypes.string.description('Max length message').defaultValue(defaultComposerPros.maxLengthMessage),
|
|
21
23
|
onChange: PropTypes.func.description('Called when the user types').defaultValue(defaultComposerPros.onChange),
|
|
22
24
|
onResize: PropTypes.func.description('Called the input changes his height').defaultValue(defaultComposerPros.onResize),
|
|
23
25
|
onSend: PropTypes.func.description('Called when the click send').defaultValue(defaultComposerPros.onSend),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sources":["../../../../src/parts/chat-composer/props.tsx"],"sourcesContent":["import React from 'react';\nimport { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\n\nexport interface TextAreaProps {\n height: string | number;\n style: React.CSSProperties;\n}\n\nexport const defaultComposerPros: ChatComposerProps = {\n placeholder: 'Type your message',\n inputValue: '',\n onChange: noop,\n onResize: noop,\n onSend: noop,\n onFocus: noop,\n onBlur: noop,\n maxHeight: 0,\n inputMaxLength: undefined,\n buttonDisabled: false,\n dataTestid: 'ds-chat-composer',\n actionRef: noop,\n};\n\nexport interface ChatComposerProps {\n placeholder
|
|
1
|
+
{"version":3,"file":"props.js","sources":["../../../../src/parts/chat-composer/props.tsx"],"sourcesContent":["import React from 'react';\nimport { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\n\nexport interface TextAreaProps {\n height: string | number;\n style: React.CSSProperties;\n}\n\nexport const defaultComposerPros: ChatComposerProps = {\n placeholder: 'Type your message',\n inputValue: '',\n onChange: noop,\n onResize: noop,\n onSend: noop,\n onFocus: noop,\n onBlur: noop,\n maxHeight: 0,\n inputMaxLength: undefined,\n maxLengthMessage: undefined,\n buttonDisabled: false,\n dataTestid: 'ds-chat-composer',\n actionRef: noop,\n};\n\nexport interface ChatComposerProps {\n placeholder?: string;\n inputValue?: string;\n maxLengthMessage?: string;\n onChange: (value: string) => void;\n onResize?: (value: number) => void;\n onSend: (value: string) => void;\n onFocus?: (e: React.ChangeEvent<HTMLTextAreaElement>, value: string) => void;\n onBlur?: (e: React.ChangeEvent<HTMLTextAreaElement>, value: string) => void;\n maxHeight?: number;\n inputMaxLength: number | undefined;\n buttonDisabled: boolean;\n dataTestid?: string;\n actionRef: PropTypes.func;\n}\n\nexport const composerProps = {\n placeholder: PropTypes.string.description('Input Placeholder').defaultValue(defaultComposerPros.placeholder),\n inputValue: PropTypes.string.description('Input value').defaultValue(defaultComposerPros.inputValue),\n maxLengthMessage: PropTypes.string\n .description('Max length message')\n .defaultValue(defaultComposerPros.maxLengthMessage),\n onChange: PropTypes.func.description('Called when the user types').defaultValue(defaultComposerPros.onChange),\n onResize: PropTypes.func\n .description('Called the input changes his height')\n .defaultValue(defaultComposerPros.onResize),\n onSend: PropTypes.func.description('Called when the click send').defaultValue(defaultComposerPros.onSend),\n onFocus: PropTypes.func.description('Input focus').defaultValue(defaultComposerPros.onFocus),\n onBlur: PropTypes.func.description('Input blur').defaultValue(defaultComposerPros.onBlur),\n maxHeight: PropTypes.number\n .description('Max height of the composer. Use 0 for no limit')\n .defaultValue(defaultComposerPros.onBlur),\n inputMaxLength: PropTypes.number\n .description('Max length of the composer. `undefined` for no limit')\n .defaultValue(defaultComposerPros.inputMaxLength),\n buttonDisabled: PropTypes.bool\n .description('Control the disabled for the send button')\n .defaultValue(defaultComposerPros.buttonDisabled),\n dataTestid: PropTypes.string.description('Data testid').defaultValue(defaultComposerPros.placeholder),\n actionRef: PropTypes.object\n .description(\n `Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n `,\n )\n .defaultValue(defaultComposerPros.actionRef),\n};\n"],"names":["defaultComposerPros","placeholder","inputValue","onChange","noop","onResize","onSend","onFocus","onBlur","maxHeight","inputMaxLength","undefined","maxLengthMessage","buttonDisabled","dataTestid","actionRef","composerProps","PropTypes","string","description","defaultValue","func","number","bool","object"],"mappings":";;;IASaA,mBAAsC,GAAG;AACpDC,EAAAA,WAAW,EAAE,mBADuC;AAEpDC,EAAAA,UAAU,EAAE,EAFwC;AAGpDC,EAAAA,QAAQ,EAAEC,IAH0C;AAIpDC,EAAAA,QAAQ,EAAED,IAJ0C;AAKpDE,EAAAA,MAAM,EAAEF,IAL4C;AAMpDG,EAAAA,OAAO,EAAEH,IAN2C;AAOpDI,EAAAA,MAAM,EAAEJ,IAP4C;AAQpDK,EAAAA,SAAS,EAAE,CARyC;AASpDC,EAAAA,cAAc,EAAEC,SAToC;AAUpDC,EAAAA,gBAAgB,EAAED,SAVkC;AAWpDE,EAAAA,cAAc,EAAE,KAXoC;AAYpDC,EAAAA,UAAU,EAAE,kBAZwC;AAapDC,EAAAA,SAAS,EAAEX;AAbyC;IAgCzCY,aAAa,GAAG;AAC3Bf,EAAAA,WAAW,EAAEgB,SAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,mBAA7B,EAAkDC,YAAlD,CAA+DpB,mBAAmB,CAACC,WAAnF,CADc;AAE3BC,EAAAA,UAAU,EAAEe,SAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,aAA7B,EAA4CC,YAA5C,CAAyDpB,mBAAmB,CAACE,UAA7E,CAFe;AAG3BU,EAAAA,gBAAgB,EAAEK,SAAS,CAACC,MAAV,CACfC,WADe,CACH,oBADG,EAEfC,YAFe,CAEFpB,mBAAmB,CAACY,gBAFlB,CAHS;AAM3BT,EAAAA,QAAQ,EAAEc,SAAS,CAACI,IAAV,CAAeF,WAAf,CAA2B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ers/esm/extends';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { noop } from 'lodash';
|
|
4
4
|
import { describe } from 'react-desc';
|
|
5
|
-
import DSIndeterminateProgressIndicator from '@elliemae/ds-
|
|
5
|
+
import DSIndeterminateProgressIndicator from '@elliemae/ds-indeterminate-progress-indicator';
|
|
6
6
|
import DSBanner, { BANNER_TYPES } from '@elliemae/ds-banner';
|
|
7
7
|
import { ChatComposer } from '../chat-composer/ChatContainerComposer.js';
|
|
8
8
|
import { ChatContainerMessagesList } from '../chat-container-messages-list/ChatContainerMessagesList.js';
|
|
@@ -12,7 +12,7 @@ import { useValidateProps } from './config/useValidateProps.js';
|
|
|
12
12
|
import '@babel/runtime/helpers/esm/defineProperty';
|
|
13
13
|
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
14
14
|
import '@elliemae/ds-grid';
|
|
15
|
-
import '@elliemae/ds-icons
|
|
15
|
+
import '@elliemae/ds-icons';
|
|
16
16
|
import '../chat-composer/styled.js';
|
|
17
17
|
import 'styled-components';
|
|
18
18
|
import '@elliemae/ds-button';
|
|
@@ -20,9 +20,7 @@ import '../chat-composer/config/useValidateProps.js';
|
|
|
20
20
|
import '@elliemae/ds-props-helpers';
|
|
21
21
|
import '../chat-composer/props.js';
|
|
22
22
|
import 'react-virtual';
|
|
23
|
-
import '@elliemae/ds-basic/Button';
|
|
24
23
|
import '../bubble/ChatBubble.js';
|
|
25
|
-
import '@elliemae/ds-icons/WarningCircleFill';
|
|
26
24
|
import '../bubble/styled.js';
|
|
27
25
|
import '../bubble/props.js';
|
|
28
26
|
import 'prop-types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatContainer.js","sources":["../../../../src/parts/chat-container/ChatContainer.tsx"],"sourcesContent":["/* eslint-disable complexity */\nimport React from 'react';\nimport { noop } from 'lodash';\nimport { describe } from 'react-desc';\nimport DSIndeterminateProgressIndicator from '@elliemae/ds-
|
|
1
|
+
{"version":3,"file":"ChatContainer.js","sources":["../../../../src/parts/chat-container/ChatContainer.tsx"],"sourcesContent":["/* eslint-disable complexity */\nimport React from 'react';\nimport { noop } from 'lodash';\nimport { describe } from 'react-desc';\nimport DSIndeterminateProgressIndicator from '@elliemae/ds-indeterminate-progress-indicator';\nimport DSBanner, { BANNER_TYPES } from '@elliemae/ds-banner';\nimport { ChatComposer } from '../chat-composer';\nimport { ChatContainerMessagesList } from '../chat-container-messages-list';\nimport { ChatContainerProps, defaultProps, containerProps } from './props';\nimport { StyledChatContainerContent, StyledIndicatorContainer, MobileStyledChatContainerContent } from './styled';\nimport { useValidateProps } from './config/useValidateProps';\n\nconst ChatContainer = (props: ChatContainerProps): JSX.Element => {\n useValidateProps(props, ChatContainerWithSchema.toTypescript());\n\n const {\n sendingText,\n sendingMessages,\n bannerPosition,\n bannerProps,\n messagesListProps,\n composerProps,\n composerProps: { onResize: onComposerResize },\n actionRef,\n autoScroll,\n device,\n isLoading,\n hasMoreItems,\n getMoreMessages,\n } = props;\n\n const containerRef = React.useRef<HTMLElement>();\n const listRef = React.useRef({ scrollToIndex: noop });\n const onResize = React.useCallback(\n (height: number) => {\n if (onComposerResize) onComposerResize(height);\n if (autoScroll) {\n listRef.current.scrollToIndex(messagesListProps.messages.length - 1, {\n align: 'end',\n });\n }\n },\n [onComposerResize, messagesListProps.messages, autoScroll],\n );\n const Container = device === 'desktop' ? StyledChatContainerContent : MobileStyledChatContainerContent;\n\n return (\n <Container rows={['minmax(0, 1fr)', 'auto']} ref={containerRef} role=\"region\" aria-label=\"chat window\">\n <div style={{ position: 'relative', overflow: 'hidden' }}>\n <ChatContainerMessagesList\n {...messagesListProps}\n actionRef={actionRef || listRef}\n isLoading={isLoading}\n hasMoreItems={hasMoreItems}\n getMoreMessages={getMoreMessages}\n sendingMessages={sendingMessages}\n sendingText={sendingText}\n />\n {['top', 'bottom'].includes(isLoading) ? (\n <StyledIndicatorContainer isLoading={isLoading}>\n <DSIndeterminateProgressIndicator processing title=\"Loading\" />\n </StyledIndicatorContainer>\n ) : null}\n <StyledIndicatorContainer isLoading={bannerPosition}>\n <DSBanner\n showCloseButton\n label={bannerProps.label || 'Unread messages'}\n containerProps={{ id: 'ds-chat-banner' }}\n actionLink={{\n label: bannerProps.viewLabel || 'View',\n onClick: bannerProps.onView,\n }}\n onClose={bannerProps.onClose}\n isOpen\n type={BANNER_TYPES.INFO}\n />\n </StyledIndicatorContainer>\n {sendingMessages && sendingMessages.length > 0 ? (\n <StyledIndicatorContainer isLoading=\"bottom\" linear>\n <DSIndeterminateProgressIndicator processing title=\"Loading\" lineOnly />\n </StyledIndicatorContainer>\n ) : null}\n </div>\n <ChatComposer\n {...composerProps}\n onResize={onResize}\n maxHeight={(containerRef.current?.clientHeight || 0) / 2}\n actionRef={actionRef || listRef}\n />\n </Container>\n );\n};\n\nChatContainer.propTypes = containerProps;\nChatContainer.defaultProps = defaultProps;\nconst ChatContainerWithSchema = describe(ChatContainer);\nChatContainerWithSchema.propTypes = containerProps;\n\nexport { ChatContainer, ChatContainerWithSchema };\n"],"names":["ChatContainer","props","useValidateProps","ChatContainerWithSchema","toTypescript","sendingText","sendingMessages","bannerPosition","bannerProps","messagesListProps","composerProps","onComposerResize","onResize","actionRef","autoScroll","device","isLoading","hasMoreItems","getMoreMessages","containerRef","React","useRef","listRef","scrollToIndex","noop","useCallback","height","current","messages","length","align","Container","StyledChatContainerContent","MobileStyledChatContainerContent","position","overflow","includes","label","id","viewLabel","onClick","onView","onClose","BANNER_TYPES","INFO","clientHeight","propTypes","containerProps","defaultProps","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAYMA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD,EAA4C;AAAA;;AAChEC,EAAAA,gBAAgB,CAACD,KAAD,EAAQE,uBAAuB,CAACC,YAAxB,EAAR,CAAhB;AAEA,MACEC,WADF,GAcIJ,KAdJ,CACEI,WADF;AAAA,MAEEC,eAFF,GAcIL,KAdJ,CAEEK,eA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AAC,wBAAD;AAA0B,IAAA,SAAS,EAAC,QAApC;AAA6C,IAAA,MAAM;AAAnD,kBACE,oBAAC,gCAAD;AAAkC,IAAA,UAAU,MAA5C;AAA6C,IAAA,KAAK,EAAC,SAAnD;AAA6D,IAAA,QAAQ;AAArE,IADF,CADD,GAIG,IAjCN,CADF,eAoCE,oBAAC,YAAD,eACMnB,aADN;AAEE,IAAA,QAAQ,EAAEE,QAFZ;AAGE,IAAA,SAAS,EAAE,CAAC,0BAAAO,YAAY,CAACQ,OAAb,gFAAsBkB,YAAtB,KAAsC,CAAvC,IAA4C,CAHzD;AAIE,IAAA,SAAS,EAAEhC,SAAS,IAAIS;AAJ1B,KApCF,CADF;AA6CD;;AAEDtB,aAAa,CAAC8C,SAAd,GAA0BC,cAA1B;AACA/C,aAAa,CAACgD,YAAd,GAA6BA,YAA7B;IACM7C,uBAAuB,GAAG8C,QAAQ,CAACjD,aAAD;AACxCG,uBAAuB,CAAC2C,SAAxB,GAAoCC,cAApC;;;;"}
|
|
@@ -3,13 +3,13 @@ import '@babel/runtime/helpers/esm/extends';
|
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'lodash';
|
|
5
5
|
import 'react-desc';
|
|
6
|
-
import '@elliemae/ds-
|
|
6
|
+
import '@elliemae/ds-indeterminate-progress-indicator';
|
|
7
7
|
import '@elliemae/ds-banner';
|
|
8
8
|
import '../chat-composer/ChatContainerComposer.js';
|
|
9
9
|
import '@babel/runtime/helpers/esm/defineProperty';
|
|
10
10
|
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
11
11
|
import '@elliemae/ds-grid';
|
|
12
|
-
import '@elliemae/ds-icons
|
|
12
|
+
import '@elliemae/ds-icons';
|
|
13
13
|
import '../chat-composer/styled.js';
|
|
14
14
|
import 'styled-components';
|
|
15
15
|
import '@elliemae/ds-button';
|
|
@@ -18,9 +18,7 @@ import '@elliemae/ds-props-helpers';
|
|
|
18
18
|
import '../chat-composer/props.js';
|
|
19
19
|
import '../chat-container-messages-list/ChatContainerMessagesList.js';
|
|
20
20
|
import 'react-virtual';
|
|
21
|
-
import '@elliemae/ds-basic/Button';
|
|
22
21
|
import '../bubble/ChatBubble.js';
|
|
23
|
-
import '@elliemae/ds-icons/WarningCircleFill';
|
|
24
22
|
import '../bubble/styled.js';
|
|
25
23
|
import '../bubble/props.js';
|
|
26
24
|
import 'prop-types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,7 +3,7 @@ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { describe } from 'react-desc';
|
|
5
5
|
import { useVirtual } from 'react-virtual';
|
|
6
|
-
import DSButton from '@elliemae/ds-
|
|
6
|
+
import DSButton from '@elliemae/ds-button';
|
|
7
7
|
import { ChatBubble } from '../bubble/ChatBubble.js';
|
|
8
8
|
import { BUBBLE_TYPES } from '../bubble/props.js';
|
|
9
9
|
import { MessageDelimiter } from '../message-delimiter/MessageDelimiter.js';
|
|
@@ -11,7 +11,7 @@ import { SystemMessage } from '../system-message/SystemMessage.js';
|
|
|
11
11
|
import { ListItem, StyledWrapperListItem, StyledWrapper, StyledChatContainerContentList, StyledChatContainerContentListScroll, StyledLoadMoreContainer } from './styled.js';
|
|
12
12
|
import { listProps, defaultProps } from './props.js';
|
|
13
13
|
import { useValidateProps } from './config/useValidateProps.js';
|
|
14
|
-
import '@elliemae/ds-icons
|
|
14
|
+
import '@elliemae/ds-icons';
|
|
15
15
|
import '../bubble/styled.js';
|
|
16
16
|
import 'styled-components';
|
|
17
17
|
import '@elliemae/ds-grid';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatContainerMessagesList.js","sources":["../../../../src/parts/chat-container-messages-list/ChatContainerMessagesList.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-noninteractive-tabindex */\n/* eslint-disable max-lines */\nimport React, { CSSProperties } from 'react';\nimport { describe } from 'react-desc';\nimport { useVirtual } from 'react-virtual';\nimport DSButton from '@elliemae/ds-basic/Button';\nimport { ChatBubble, BUBBLE_TYPES } from '../bubble';\nimport { MessageDelimiter } from '../message-delimiter';\nimport { SystemMessage } from '../system-message';\nimport {\n StyledWrapperListItem,\n StyledChatContainerContentList,\n StyledChatContainerContentListScroll,\n StyledWrapper,\n StyledLoadMoreContainer,\n ListItem,\n} from './styled';\nimport { defaultProps, listProps, ChatContainerMessagesListProps } from './props';\nimport { useValidateProps } from './config/useValidateProps';\n\nconst getPadding = (hasMoreItems) => {\n const padding = {\n paddingStart: 0,\n paddingEnd: -5,\n };\n if (hasMoreItems === 'top') padding.paddingStart = 42;\n else if (hasMoreItems === 'bottom') padding.paddingEnd = 42;\n return padding;\n};\n\nconst ChatContainerMessagesList = (props: ChatContainerMessagesListProps): JSX.Element => {\n useValidateProps(props, ChatContainerMessagesListWithSchema.toTypescript());\n\n const { sendingText, sendingMessages, messages, actionRef, onScrollEnds, getMoreMessages, hasMoreItems, isLoading } =\n props;\n const virtualListRef = React.useRef<HTMLDivElement>();\n // estimateSize should not be really required given what was stated on\n // https://github.com/tannerlinsley/react-virtual/issues/23\n const {\n scrollToIndex: vScroll,\n totalSize,\n virtualItems,\n } = useVirtual({\n size: messages.length,\n parentRef: virtualListRef,\n overscan: 15,\n ...getPadding(hasMoreItems),\n estimateSize: React.useCallback(() => 80, []),\n });\n\n const onScrollStop = React.useCallback((): number[] => {\n const { bottom, top } = virtualListRef.current.getBoundingClientRect();\n const list = virtualListRef.current.querySelectorAll(\n '[data-element=\"chat-element-list-item\"]',\n ) as NodeListOf<HTMLDivElement>;\n const indexList = [];\n list.forEach((item: HTMLDivElement) => {\n const { top: itemTop } = item.getBoundingClientRect();\n if (itemTop < bottom && itemTop > top) indexList.push(item.dataset.index);\n });\n if (onScrollEnds) onScrollEnds(indexList);\n return indexList;\n }, [onScrollEnds]);\n\n const scrollAndFocus = React.useCallback(\n (index: number) => {\n vScroll(index, { align: 'center' });\n setTimeout(() => {\n (virtualListRef.current.querySelector(`[data-index=\"${index}\"]`) as HTMLDivElement).focus();\n }, 300);\n },\n [vScroll],\n );\n\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.scrollToIndex = (a, b = { align: 'center' }) => {\n vScroll(a, b);\n };\n actionRef.current.getMessagesInView = onScrollStop;\n actionRef.current.focusToIndex = (a, b = { align: 'center' }) => {\n scrollAndFocus(a);\n };\n actionRef.current.focusToList = (a, b = { align: 'center' }) => {\n virtualListRef.current?.focus();\n };\n }\n }, [actionRef, onScrollStop, scrollAndFocus, vScroll]);\n\n const handleKey = React.useCallback(\n (e) => {\n e.preventDefault();\n const { key } = e;\n const index = Number(e.currentTarget.dataset.index);\n switch (key) {\n case 'ArrowUp':\n if (index > 0)\n (virtualListRef.current.querySelector(`[data-index=\"${index - 1}\"]`) as HTMLDivElement).focus();\n break;\n case 'ArrowDown':\n if (index < messages.length - 1) {\n (virtualListRef.current.querySelector(`[data-index=\"${index + 1}\"]`) as HTMLDivElement).focus();\n }\n break;\n case 'Home':\n scrollAndFocus(0);\n break;\n case 'End':\n scrollAndFocus(messages.length - 1);\n break;\n case 'Tab':\n actionRef.current.focusToComposer();\n break;\n default:\n break;\n }\n },\n [actionRef, messages.length, scrollAndFocus],\n );\n\n React.useEffect(() => {\n let handlerCallback = null;\n const localVirtualRef = virtualListRef.current;\n const onScroll = () => {\n if (handlerCallback) clearTimeout(handlerCallback);\n handlerCallback = setTimeout(onScrollStop, 300);\n };\n if (onScrollEnds) {\n virtualListRef.current.addEventListener('scroll', onScroll);\n }\n return () => {\n if (handlerCallback) clearTimeout(handlerCallback);\n if (onScrollEnds) localVirtualRef.removeEventListener('scroll', onScroll);\n };\n }, [onScrollStop, onScrollEnds]);\n\n const render = React.useMemo(\n () =>\n virtualItems.map((virtualItem) => {\n const { index, measureRef, start } = virtualItem;\n const row = messages[index];\n const isSending = sendingMessages && sendingMessages.find((m) => m === row.dsId);\n const style: CSSProperties = {\n position: 'absolute',\n top: 0,\n left: 0,\n transform: `translateY(${start}px)`,\n width: '100%',\n };\n\n return (\n <ListItem\n data-element=\"chat-element-list-item\"\n data-index={index}\n key={`ds-chat-bubble-${index}`}\n style={style}\n ref={measureRef}\n tabIndex={0}\n onKeyDown={handleKey}\n role=\"listitem\"\n >\n <StyledWrapperListItem type={row.type}>\n {row.type === BUBBLE_TYPES.SENDER || row.type === BUBBLE_TYPES.RECIPIENT ? (\n // eslint-disable-next-line\n <ChatBubble {...(row as any)} helpMessage={isSending ? sendingText : row.helpMessage} />\n ) : null}\n {row.type === BUBBLE_TYPES.DELIMITER ? <MessageDelimiter {...(row as any)} /> : null}\n {row.type === BUBBLE_TYPES.SYSTEM ? <SystemMessage {...(row as any)} /> : null}\n </StyledWrapperListItem>\n </ListItem>\n );\n }),\n [virtualItems, messages, sendingMessages, handleKey, sendingText],\n );\n\n return (\n <StyledWrapper>\n <StyledChatContainerContentList\n data-testid=\"chat-thread-container\"\n tabIndex={0}\n aria-live=\"polite\"\n ref={virtualListRef}\n role=\"list\"\n onKeyDown={handleKey}\n >\n <StyledChatContainerContentListScroll height={`${totalSize}px`}>\n {render}\n {!isLoading && hasMoreItems ? (\n <StyledLoadMoreContainer hasMoreItems={hasMoreItems}>\n <DSButton labelText=\"Load More\" buttonType=\"secondary\" onClick={getMoreMessages} />\n </StyledLoadMoreContainer>\n ) : null}\n </StyledChatContainerContentListScroll>\n </StyledChatContainerContentList>\n </StyledWrapper>\n );\n};\n\nChatContainerMessagesList.propTypes = listProps;\nChatContainerMessagesList.defaultProps = defaultProps;\nconst ChatContainerMessagesListWithSchema = describe(ChatContainerMessagesList);\nChatContainerMessagesListWithSchema.propTypes = listProps;\n\nexport { ChatContainerMessagesList, ChatContainerMessagesListWithSchema };\n"],"names":["getPadding","hasMoreItems","padding","paddingStart","paddingEnd","ChatContainerMessagesList","props","useValidateProps","ChatContainerMessagesListWithSchema","toTypescript","sendingText","sendingMessages","messages","actionRef","onScrollEnds","getMoreMessages","isLoading","virtualListRef","React","useRef","useVirtual","size","length","parentRef","overscan","estimateSize","useCallback","vScroll","scrollToIndex","totalSize","virtualItems","onScrollStop","current","getBoundingClientRect","bottom","top","list","querySelectorAll","indexList","forEach","item","itemTop","push","dataset","index","scrollAndFocus","align","setTimeout","querySelector","focus","useEffect","a","b","getMessagesInView","focusToIndex","focusToList","handleKey","e","preventDefault","key","Number","currentTarget","focusToComposer","handlerCallback","localVirtualRef","onScroll","clearTimeout","addEventListener","removeEventListener","render","useMemo","map","virtualItem","measureRef","start","row","isSending","find","m","dsId","style","position","left","transform","width","type","BUBBLE_TYPES","SENDER","RECIPIENT","helpMessage","DELIMITER","SYSTEM","propTypes","listProps","defaultProps","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAACC,YAAD,EAAkB;AACnC,MAAMC,OAAO,GAAG;AACdC,IAAAA,YAAY,EAAE,CADA;AAEdC,IAAAA,UAAU,EAAE,CAAC;AAFC,GAAhB;AAIA,MAAIH,YAAY,KAAK,KAArB,EAA4BC,OAAO,CAACC,YAAR,GAAuB,EAAvB,CAA5B,KACK,IAAIF,YAAY,KAAK,QAArB,EAA+BC,OAAO,CAACE,UAAR,GAAqB,EAArB;AACpC,SAAOF,OAAP;AACD,CARD;;IAUMG,yBAAyB,GAAG,SAA5BA,yBAA4B,CAACC,KAAD,EAAwD;AACxFC,EAAAA,gBAAgB,CAACD,KAAD,EAAQE,mCAAmC,CAACC,YAApC,EAAR,CAAhB;AAEA,MAAQC,WAAR,GACEJ,KADF,CAAQI,WAAR;AAAA,MAAqBC,eAArB,GACEL,KADF,CAAqBK,eAArB;AAAA,MAAsCC,QAAtC,GACEN,KADF,CAAsCM,QAAtC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F,CADD,GAIG,IANN,CARF,CADF,CADF;AAqBD;;AAEDV,yBAAyB,CAACuF,SAA1B,GAAsCC,SAAtC;AACAxF,yBAAyB,CAACyF,YAA1B,GAAyCA,YAAzC;IACMtF,mCAAmC,GAAGuF,QAAQ,CAAC1F,yBAAD;AACpDG,mCAAmC,CAACoF,SAApC,GAAgDC,SAAhD;;;;"}
|
|
1
|
+
{"version":3,"file":"ChatContainerMessagesList.js","sources":["../../../../src/parts/chat-container-messages-list/ChatContainerMessagesList.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-noninteractive-tabindex */\n/* eslint-disable max-lines */\nimport React, { CSSProperties } from 'react';\nimport { describe } from 'react-desc';\nimport { useVirtual } from 'react-virtual';\nimport DSButton from '@elliemae/ds-button';\nimport { ChatBubble, BUBBLE_TYPES } from '../bubble';\nimport { MessageDelimiter } from '../message-delimiter';\nimport { SystemMessage } from '../system-message';\nimport {\n StyledWrapperListItem,\n StyledChatContainerContentList,\n StyledChatContainerContentListScroll,\n StyledWrapper,\n StyledLoadMoreContainer,\n ListItem,\n} from './styled';\nimport { defaultProps, listProps, ChatContainerMessagesListProps } from './props';\nimport { useValidateProps } from './config/useValidateProps';\n\nconst getPadding = (hasMoreItems) => {\n const padding = {\n paddingStart: 0,\n paddingEnd: -5,\n };\n if (hasMoreItems === 'top') padding.paddingStart = 42;\n else if (hasMoreItems === 'bottom') padding.paddingEnd = 42;\n return padding;\n};\n\nconst ChatContainerMessagesList = (props: ChatContainerMessagesListProps): JSX.Element => {\n useValidateProps(props, ChatContainerMessagesListWithSchema.toTypescript());\n\n const { sendingText, sendingMessages, messages, actionRef, onScrollEnds, getMoreMessages, hasMoreItems, isLoading } =\n props;\n const virtualListRef = React.useRef<HTMLDivElement>();\n // estimateSize should not be really required given what was stated on\n // https://github.com/tannerlinsley/react-virtual/issues/23\n const {\n scrollToIndex: vScroll,\n totalSize,\n virtualItems,\n } = useVirtual({\n size: messages.length,\n parentRef: virtualListRef,\n overscan: 15,\n ...getPadding(hasMoreItems),\n estimateSize: React.useCallback(() => 80, []),\n });\n\n const onScrollStop = React.useCallback((): number[] => {\n const { bottom, top } = virtualListRef.current.getBoundingClientRect();\n const list = virtualListRef.current.querySelectorAll(\n '[data-element=\"chat-element-list-item\"]',\n ) as NodeListOf<HTMLDivElement>;\n const indexList = [];\n list.forEach((item: HTMLDivElement) => {\n const { top: itemTop } = item.getBoundingClientRect();\n if (itemTop < bottom && itemTop > top) indexList.push(item.dataset.index);\n });\n if (onScrollEnds) onScrollEnds(indexList);\n return indexList;\n }, [onScrollEnds]);\n\n const scrollAndFocus = React.useCallback(\n (index: number) => {\n vScroll(index, { align: 'center' });\n setTimeout(() => {\n (virtualListRef.current.querySelector(`[data-index=\"${index}\"]`) as HTMLDivElement).focus();\n }, 300);\n },\n [vScroll],\n );\n\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.scrollToIndex = (a, b = { align: 'center' }) => {\n vScroll(a, b);\n };\n actionRef.current.getMessagesInView = onScrollStop;\n actionRef.current.focusToIndex = (a, b = { align: 'center' }) => {\n scrollAndFocus(a);\n };\n actionRef.current.focusToList = (a, b = { align: 'center' }) => {\n virtualListRef.current?.focus();\n };\n }\n }, [actionRef, onScrollStop, scrollAndFocus, vScroll]);\n\n const handleKey = React.useCallback(\n (e) => {\n e.preventDefault();\n const { key } = e;\n const index = Number(e.currentTarget.dataset.index);\n switch (key) {\n case 'ArrowUp':\n if (index > 0)\n (virtualListRef.current.querySelector(`[data-index=\"${index - 1}\"]`) as HTMLDivElement).focus();\n break;\n case 'ArrowDown':\n if (index < messages.length - 1) {\n (virtualListRef.current.querySelector(`[data-index=\"${index + 1}\"]`) as HTMLDivElement).focus();\n }\n break;\n case 'Home':\n scrollAndFocus(0);\n break;\n case 'End':\n scrollAndFocus(messages.length - 1);\n break;\n case 'Tab':\n actionRef.current.focusToComposer();\n break;\n default:\n break;\n }\n },\n [actionRef, messages.length, scrollAndFocus],\n );\n\n React.useEffect(() => {\n let handlerCallback = null;\n const localVirtualRef = virtualListRef.current;\n const onScroll = () => {\n if (handlerCallback) clearTimeout(handlerCallback);\n handlerCallback = setTimeout(onScrollStop, 300);\n };\n if (onScrollEnds) {\n virtualListRef.current.addEventListener('scroll', onScroll);\n }\n return () => {\n if (handlerCallback) clearTimeout(handlerCallback);\n if (onScrollEnds) localVirtualRef.removeEventListener('scroll', onScroll);\n };\n }, [onScrollStop, onScrollEnds]);\n\n const render = React.useMemo(\n () =>\n virtualItems.map((virtualItem) => {\n const { index, measureRef, start } = virtualItem;\n const row = messages[index];\n const isSending = sendingMessages && sendingMessages.find((m) => m === row.dsId);\n const style: CSSProperties = {\n position: 'absolute',\n top: 0,\n left: 0,\n transform: `translateY(${start}px)`,\n width: '100%',\n };\n\n return (\n <ListItem\n data-element=\"chat-element-list-item\"\n data-index={index}\n key={`ds-chat-bubble-${index}`}\n style={style}\n ref={measureRef}\n tabIndex={0}\n onKeyDown={handleKey}\n role=\"listitem\"\n >\n <StyledWrapperListItem type={row.type}>\n {row.type === BUBBLE_TYPES.SENDER || row.type === BUBBLE_TYPES.RECIPIENT ? (\n // eslint-disable-next-line\n <ChatBubble {...(row as any)} helpMessage={isSending ? sendingText : row.helpMessage} />\n ) : null}\n {row.type === BUBBLE_TYPES.DELIMITER ? <MessageDelimiter {...(row as any)} /> : null}\n {row.type === BUBBLE_TYPES.SYSTEM ? <SystemMessage {...(row as any)} /> : null}\n </StyledWrapperListItem>\n </ListItem>\n );\n }),\n [virtualItems, messages, sendingMessages, handleKey, sendingText],\n );\n\n return (\n <StyledWrapper>\n <StyledChatContainerContentList\n data-testid=\"chat-thread-container\"\n tabIndex={0}\n aria-live=\"polite\"\n ref={virtualListRef}\n role=\"list\"\n onKeyDown={handleKey}\n >\n <StyledChatContainerContentListScroll height={`${totalSize}px`}>\n {render}\n {!isLoading && hasMoreItems ? (\n <StyledLoadMoreContainer hasMoreItems={hasMoreItems}>\n <DSButton labelText=\"Load More\" buttonType=\"secondary\" onClick={getMoreMessages} />\n </StyledLoadMoreContainer>\n ) : null}\n </StyledChatContainerContentListScroll>\n </StyledChatContainerContentList>\n </StyledWrapper>\n );\n};\n\nChatContainerMessagesList.propTypes = listProps;\nChatContainerMessagesList.defaultProps = defaultProps;\nconst ChatContainerMessagesListWithSchema = describe(ChatContainerMessagesList);\nChatContainerMessagesListWithSchema.propTypes = listProps;\n\nexport { ChatContainerMessagesList, ChatContainerMessagesListWithSchema };\n"],"names":["getPadding","hasMoreItems","padding","paddingStart","paddingEnd","ChatContainerMessagesList","props","useValidateProps","ChatContainerMessagesListWithSchema","toTypescript","sendingText","sendingMessages","messages","actionRef","onScrollEnds","getMoreMessages","isLoading","virtualListRef","React","useRef","useVirtual","size","length","parentRef","overscan","estimateSize","useCallback","vScroll","scrollToIndex","totalSize","virtualItems","onScrollStop","current","getBoundingClientRect","bottom","top","list","querySelectorAll","indexList","forEach","item","itemTop","push","dataset","index","scrollAndFocus","align","setTimeout","querySelector","focus","useEffect","a","b","getMessagesInView","focusToIndex","focusToList","handleKey","e","preventDefault","key","Number","currentTarget","focusToComposer","handlerCallback","localVirtualRef","onScroll","clearTimeout","addEventListener","removeEventListener","render","useMemo","map","virtualItem","measureRef","start","row","isSending","find","m","dsId","style","position","left","transform","width","type","BUBBLE_TYPES","SENDER","RECIPIENT","helpMessage","DELIMITER","SYSTEM","propTypes","listProps","defaultProps","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAACC,YAAD,EAAkB;AACnC,MAAMC,OAAO,GAAG;AACdC,IAAAA,YAAY,EAAE,CADA;AAEdC,IAAAA,UAAU,EAAE,CAAC;AAFC,GAAhB;AAIA,MAAIH,YAAY,KAAK,KAArB,EAA4BC,OAAO,CAACC,YAAR,GAAuB,EAAvB,CAA5B,KACK,IAAIF,YAAY,KAAK,QAArB,EAA+BC,OAAO,CAACE,UAAR,GAAqB,EAArB;AACpC,SAAOF,O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C;AANb,kBAQE,oBAAC,oCAAD;AAAsC,IAAA,MAAM,YAAK3B,SAAL;AAA5C,KACGwC,MADH,EAEG,CAACrD,SAAD,IAAcf,YAAd,gBACC,oBAAC,uBAAD;AAAyB,IAAA,YAAY,EAAEA;AAAvC,kBACE,oBAAC,QAAD;AAAU,IAAA,SAAS,EAAC,WAApB;AAAgC,IAAA,UAAU,EAAC,WAA3C;AAAuD,IAAA,OAAO,EAAEc;AAAhE,IADF,CADD,GAIG,IANN,CARF,CADF,CADF;AAqBD;;AAEDV,yBAAyB,CAACuF,SAA1B,GAAsCC,SAAtC;AACAxF,yBAAyB,CAACyF,YAA1B,GAAyCA,YAAzC;IACMtF,mCAAmC,GAAGuF,QAAQ,CAAC1F,yBAAD;AACpDG,mCAAmC,CAACoF,SAApC,GAAgDC,SAAhD;;;;"}
|
|
@@ -4,9 +4,9 @@ import '@babel/runtime/helpers/esm/defineProperty';
|
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'react-desc';
|
|
6
6
|
import 'react-virtual';
|
|
7
|
-
import '@elliemae/ds-
|
|
7
|
+
import '@elliemae/ds-button';
|
|
8
8
|
import '../bubble/ChatBubble.js';
|
|
9
|
-
import '@elliemae/ds-icons
|
|
9
|
+
import '@elliemae/ds-icons';
|
|
10
10
|
import '../bubble/styled.js';
|
|
11
11
|
import 'styled-components';
|
|
12
12
|
import '@elliemae/ds-grid';
|
|
@@ -3,7 +3,7 @@ import '../bubble/ChatBubble.js';
|
|
|
3
3
|
import { BUBBLE_TYPES } from '../bubble/props.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'react-desc';
|
|
6
|
-
import '@elliemae/ds-icons
|
|
6
|
+
import '@elliemae/ds-icons';
|
|
7
7
|
import '../bubble/styled.js';
|
|
8
8
|
import '@elliemae/ds-grid';
|
|
9
9
|
import '../bubble/config/useValidateProps.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { describe } from 'react-desc';
|
|
3
3
|
import { Grid } from '@elliemae/ds-grid';
|
|
4
|
-
import Communications from '@elliemae/ds-icons
|
|
4
|
+
import { Communications } from '@elliemae/ds-icons';
|
|
5
5
|
import { emptyStateProps, defaultProps } from './props.js';
|
|
6
6
|
import { MessageWrapper, ChatEmptyStateWrapper } from './styled.js';
|
|
7
7
|
import { useValidateProps } from './config/useValidateProps.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatEmptyState.js","sources":["../../../../src/parts/chat-empty-state/ChatEmptyState.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { describe } from 'react-desc';\nimport { Grid } from '@elliemae/ds-grid';\nimport Communications from '@elliemae/ds-icons
|
|
1
|
+
{"version":3,"file":"ChatEmptyState.js","sources":["../../../../src/parts/chat-empty-state/ChatEmptyState.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { describe } from 'react-desc';\nimport { Grid } from '@elliemae/ds-grid';\nimport { Communications } from '@elliemae/ds-icons';\nimport { ChatEmptyStateProps, emptyStateProps, defaultProps } from './props';\nimport { ChatEmptyStateWrapper, MessageWrapper } from './styled';\nimport { useValidateProps } from './config/useValidateProps';\n\nconst ChatEmptyState = (props: ChatEmptyStateProps): JSX.Element => {\n useValidateProps(props, ChatEmptyStateListWithSchema.toJSON());\n const { label, action } = props;\n const MainContent = useMemo(\n () => (\n <Grid alignItems=\"center\" justifyContent=\"center\">\n <Grid alignItems=\"center\" justifyContent=\"center\">\n <Communications size=\"xxl\" color={['neutral', 400]} />\n </Grid>\n <Grid alignItems=\"center\" justifyContent=\"center\">\n <MessageWrapper>{label}</MessageWrapper>\n </Grid>\n <Grid alignItems=\"center\" justifyContent=\"center\">\n {action}\n </Grid>\n </Grid>\n ),\n [label, action],\n );\n return (\n <ChatEmptyStateWrapper alignItems=\"center\" justifyContent=\"center\">\n {MainContent}\n </ChatEmptyStateWrapper>\n );\n};\n\nChatEmptyState.propTypes = emptyStateProps;\nChatEmptyState.defaultProps = defaultProps;\nconst ChatEmptyStateListWithSchema = describe(ChatEmptyState);\nChatEmptyStateListWithSchema.propTypes = emptyStateProps;\n\nexport { ChatEmptyState, ChatEmptyStateListWithSchema };\n"],"names":["ChatEmptyState","props","useValidateProps","ChatEmptyStateListWithSchema","toJSON","label","action","MainContent","useMemo","propTypes","emptyStateProps","defaultProps","describe"],"mappings":";;;;;;;;;;IAQMA,cAAc,GAAG,SAAjBA,cAAiB,CAACC,KAAD,EAA6C;AAClEC,EAAAA,gBAAgB,CAACD,KAAD,EAAQE,4BAA4B,CAACC,MAA7B,EAAR,CAAhB;AACA,MAAQC,KAAR,GAA0BJ,KAA1B,CAAQI,KAAR;AAAA,MAAeC,MAAf,GAA0BL,KAA1B,CAAeK,MAAf;AACA,MAAMC,WAAW,GAAGC,OAAO,CACzB;AAAA,wBACE,oBAAC,IAAD;AAAM,MAAA,UAAU,EAAC,QAAjB;AAA0B,MAAA,cAAc,EAAC;AAAzC,oBACE,oBAAC,IAAD;AAAM,MAAA,UAAU,EAAC,QAAjB;AAA0B,MAAA,cAAc,EAAC;AAAzC,oBACE,oBAAC,cAAD;AAAgB,MAAA,IAAI,EAAC,KAArB;AAA2B,MAAA,KAAK,EAAE,CAAC,SAAD,EAAY,GAAZ;AAAlC,MADF,CADF,eAIE,oBAAC,IAAD;AAAM,MAAA,UAAU,EAAC,QAAjB;AAA0B,MAAA,cAAc,EAAC;AAAzC,oBACE,oBAAC,cAAD,QAAiBH,KAAjB,CADF,CAJF,eAOE,oBAAC,IAAD;AAAM,MAAA,UAAU,EAAC,QAAjB;AAA0B,MAAA,cAAc,EAAC;AAAzC,OACGC,MADH,CAPF,CADF;AAAA,GADyB,EAczB,CAACD,KAAD,EAAQC,MAAR,CAdyB,CAA3B;AAgBA,sBACE,oBAAC,qBAAD;AAAuB,IAAA,UAAU,EAAC,QAAlC;AAA2C,IAAA,cAAc,EAAC;AAA1D,KACGC,WADH,CADF;AAKD;;AAEDP,cAAc,CAACS,SAAf,GAA2BC,eAA3B;AACAV,cAAc,CAACW,YAAf,GAA8BA,YAA9B;IACMR,4BAA4B,GAAGS,QAAQ,CAACZ,cAAD;AAC7CG,4BAA4B,CAACM,SAA7B,GAAyCC,eAAzC;;;;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _extends from '@babel/runtime/helpers/esm/extends';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { describe } from 'react-desc';
|
|
4
|
-
import MenuExpand from '@elliemae/ds-icons
|
|
5
|
-
import MenuCollapse from '@elliemae/ds-icons/MenuCollapse';
|
|
4
|
+
import { MenuCollapse, MenuExpand } from '@elliemae/ds-icons';
|
|
6
5
|
import { StyledSideBarContainer, StyledSideBarButtonsContainer } from './styled.js';
|
|
7
6
|
import { TileButton } from '../tile-button/TileButton.js';
|
|
8
7
|
import { SidebarButton } from '../sidebar-button/SidebarButton.js';
|
|
@@ -12,11 +11,9 @@ import 'styled-components';
|
|
|
12
11
|
import '@elliemae/ds-grid';
|
|
13
12
|
import '../../styled.js';
|
|
14
13
|
import '@elliemae/ds-tooltip';
|
|
15
|
-
import '@elliemae/ds-icons/CloseXsmall';
|
|
16
14
|
import '../tile-button/styled.js';
|
|
17
15
|
import '../tile-button/props.js';
|
|
18
16
|
import 'lodash';
|
|
19
|
-
import '@elliemae/ds-icons/Comments';
|
|
20
17
|
import '../tile-button/config/useValidateProps.js';
|
|
21
18
|
import '@elliemae/ds-props-helpers';
|
|
22
19
|
import '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideBarChat.js","sources":["../../../../src/parts/chat-sidebar/SideBarChat.tsx"],"sourcesContent":["import React from 'react';\nimport { describe } from 'react-desc';\nimport
|
|
1
|
+
{"version":3,"file":"SideBarChat.js","sources":["../../../../src/parts/chat-sidebar/SideBarChat.tsx"],"sourcesContent":["import React from 'react';\nimport { describe } from 'react-desc';\nimport { MenuCollapse, MenuExpand } from '@elliemae/ds-icons';\nimport { StyledSideBarContainer, StyledSideBarButtonsContainer } from './styled';\nimport { TileButton } from '../tile-button';\nimport { SidebarButton } from '../sidebar-button/SidebarButton';\nimport { CharSidebarProps, defaultProps, chatSidebarProps } from './props';\nimport { useValidateProps } from './config/useValidateProps';\n\nconst FooterChat = ({\n expanded,\n onFooterClose,\n onFooterExpand,\n footerButtonExtraProps,\n}: Pick<CharSidebarProps, 'expanded' | 'onFooterClose' | 'onFooterExpand' | 'footerButtonExtraProps'>) => (\n <SidebarButton\n dsId=\"sidebar_footer\"\n label={null}\n Icon={!expanded ? MenuCollapse : MenuExpand}\n onClick={expanded ? onFooterClose : onFooterExpand}\n aria-pressed={expanded}\n aria-label={footerButtonExtraProps['aria-label']}\n />\n);\n\nconst SideBarChat = (props: CharSidebarProps): JSX.Element => {\n useValidateProps(props, SideBarChatWithSchema.toJSON());\n const {\n sidebarItems,\n expanded,\n onFooterClose,\n onFooterExpand,\n selectedItem,\n footerButtonExtraProps,\n tooltipPlacement,\n enableTooltipWhenIsClosed,\n } = props;\n return (\n <StyledSideBarContainer rows={[1, 'auto']}>\n <StyledSideBarButtonsContainer>\n {sidebarItems.map((p) => (\n <TileButton\n {...p}\n selected={selectedItem === p.dsId}\n tooltipPlacement={tooltipPlacement}\n disableTooltip={enableTooltipWhenIsClosed ? false : !expanded}\n />\n ))}\n </StyledSideBarButtonsContainer>\n <FooterChat\n expanded={expanded}\n onFooterClose={onFooterClose}\n onFooterExpand={onFooterExpand}\n footerButtonExtraProps={footerButtonExtraProps}\n />\n </StyledSideBarContainer>\n );\n};\n\nSideBarChat.propTypes = chatSidebarProps;\nSideBarChat.defaultProps = defaultProps;\nconst SideBarChatWithSchema = describe(SideBarChat);\nSideBarChatWithSchema.propTypes = chatSidebarProps;\n\nexport { SideBarChat, SideBarChatWithSchema };\n"],"names":["FooterChat","expanded","onFooterClose","onFooterExpand","footerButtonExtraProps","MenuCollapse","MenuExpand","SideBarChat","props","useValidateProps","SideBarChatWithSchema","toJSON","sidebarItems","selectedItem","tooltipPlacement","enableTooltipWhenIsClosed","map","p","dsId","propTypes","chatSidebarProps","defaultProps","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AASA,IAAMA,UAAU,GAAG,SAAbA,UAAa;AAAA,MACjBC,QADiB,QACjBA,QADiB;AAAA,MAEjBC,aAFiB,QAEjBA,aAFiB;AAAA,MAGjBC,cAHiB,QAGjBA,cAHiB;AAAA,MAIjBC,sBAJiB,QAIjBA,sBAJiB;AAAA,sBAMjB,oBAAC,aAAD;AACE,IAAA,IAAI,EAAC,gBADP;AAEE,IAAA,KAAK,EAAE,IAFT;AAGE,IAAA,IAAI,EAAE,CAACH,QAAD,GAAYI,YAAZ,GAA2BC,UAHnC;AAIE,IAAA,OAAO,EAAEL,QAAQ,GAAGC,aAAH,GAAmBC,cAJtC;AAKE,oBAAcF,QALhB;AAME,kBAAYG,sBAAsB,CAAC,YAAD;AANpC,IANiB;AAAA,CAAnB;;IAgBMG,WAAW,GAAG,SAAdA,WAAc,CAACC,KAAD,EAA0C;AAC5DC,EAAAA,gBAAgB,CAACD,KAAD,EAAQE,qBAAqB,CAACC,MAAtB,EAAR,CAAhB;AACA,MACEC,YADF,GASIJ,KATJ,CACEI,YADF;AAAA,MAEEX,QAFF,GASIO,KATJ,CAEEP,QAFF;AAAA,MAGEC,aAHF,GASIM,KATJ,CAGEN,aAHF;AAAA,MAIEC,cAJF,GASIK,KATJ,CAIEL,cAJF;AAAA,MAKEU,YALF,GASIL,KATJ,CAKEK,YALF;AAAA,MAMET,sBANF,GASII,KATJ,CAMEJ,sBANF;AAAA,MAOEU,gBAPF,GASIN,KATJ,CAOEM,gBAPF;AAAA,MAQEC,yBARF,GASIP,KATJ,CAQEO,yBARF;AAUA,sBACE,oBAAC,sBAAD;AAAwB,IAAA,IAAI,EAAE,CAAC,CAAD,EAAI,MAAJ;AAA9B,kBACE,oBAAC,6BAAD,QACGH,YAAY,CAACI,GAAb,CAAiB,UAACC,CAAD;AAAA,wBAChB,oBAAC,UAAD,eACMA,CADN;AAEE,MAAA,QAAQ,EAAEJ,YAAY,KAAKI,CAAC,CAACC,IAF/B;AAGE,MAAA,gBAAgB,EAAEJ,gBAHpB;AAIE,MAAA,cAAc,EAAEC,yBAAyB,GAAG,KAAH,GAAW,CAACd;AAJvD,OADgB;AAAA,GAAjB,CADH,CADF,eAWE,oBAAC,UAAD;AACE,IAAA,QAAQ,EAAEA,QADZ;AAEE,IAAA,aAAa,EAAEC,aAFjB;AAGE,IAAA,cAAc,EAAEC,cAHlB;AAIE,IAAA,sBAAsB,EAAEC;AAJ1B,IAXF,CADF;AAoBD;;AAEDG,WAAW,CAACY,SAAZ,GAAwBC,gBAAxB;AACAb,WAAW,CAACc,YAAZ,GAA2BA,YAA3B;IACMX,qBAAqB,GAAGY,QAAQ,CAACf,WAAD;AACtCG,qBAAqB,CAACS,SAAtB,GAAkCC,gBAAlC;;;;"}
|
|
@@ -2,19 +2,16 @@ export { SideBarChat, SideBarChatWithSchema } from './SideBarChat.js';
|
|
|
2
2
|
import '@babel/runtime/helpers/esm/extends';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'react-desc';
|
|
5
|
-
import '@elliemae/ds-icons
|
|
6
|
-
import '@elliemae/ds-icons/MenuCollapse';
|
|
5
|
+
import '@elliemae/ds-icons';
|
|
7
6
|
import './styled.js';
|
|
8
7
|
import 'styled-components';
|
|
9
8
|
import '@elliemae/ds-grid';
|
|
10
9
|
import '../../styled.js';
|
|
11
10
|
import '../tile-button/TileButton.js';
|
|
12
11
|
import '@elliemae/ds-tooltip';
|
|
13
|
-
import '@elliemae/ds-icons/CloseXsmall';
|
|
14
12
|
import '../tile-button/styled.js';
|
|
15
13
|
import '../tile-button/props.js';
|
|
16
14
|
import 'lodash';
|
|
17
|
-
import '@elliemae/ds-icons/Comments';
|
|
18
15
|
import '../tile-button/config/useValidateProps.js';
|
|
19
16
|
import '@elliemae/ds-props-helpers';
|
|
20
17
|
import '../sidebar-button/SidebarButton.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import Comments from '@elliemae/ds-icons
|
|
2
|
+
import { Comments } from '@elliemae/ds-icons';
|
|
3
3
|
import { StyledFloatingButton } from './styled.js';
|
|
4
4
|
import { propsFloatingButton, defaultFloatingButton } from './props.js';
|
|
5
5
|
import 'styled-components';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingButton.js","sources":["../../../../src/parts/floating-button/FloatingButton.tsx"],"sourcesContent":["import React from 'react';\nimport Comments from '@elliemae/ds-icons
|
|
1
|
+
{"version":3,"file":"FloatingButton.js","sources":["../../../../src/parts/floating-button/FloatingButton.tsx"],"sourcesContent":["import React from 'react';\nimport { Comments } from '@elliemae/ds-icons';\nimport { StyledFloatingButton } from './styled';\nimport { defaultFloatingButton, propsFloatingButton, FloatingButtonProps } from './props';\n\nexport const FloatingButton = ({ onClick }: FloatingButtonProps): JSX.Element => (\n <StyledFloatingButton data-testid=\"chat-floating-button\" onClick={onClick}>\n <Comments size=\"l\" />\n </StyledFloatingButton>\n);\n\nFloatingButton.propTypes = propsFloatingButton;\nFloatingButton.defaultProps = defaultFloatingButton;\n"],"names":["FloatingButton","onClick","propTypes","propsFloatingButton","defaultProps","defaultFloatingButton"],"mappings":";;;;;;;;IAKaA,cAAc,GAAG,SAAjBA,cAAiB;AAAA,MAAGC,OAAH,QAAGA,OAAH;AAAA,sBAC5B,oBAAC,oBAAD;AAAsB,mBAAY,sBAAlC;AAAyD,IAAA,OAAO,EAAEA;AAAlE,kBACE,oBAAC,QAAD;AAAU,IAAA,IAAI,EAAC;AAAf,IADF,CAD4B;AAAA;AAM9BD,cAAc,CAACE,SAAf,GAA2BC,mBAA3B;AACAH,cAAc,CAACI,YAAf,GAA8BC,qBAA9B;;;;"}
|
|
@@ -8,12 +8,12 @@ import '../../styled.js';
|
|
|
8
8
|
import '@babel/runtime/helpers/esm/extends';
|
|
9
9
|
import 'lodash';
|
|
10
10
|
import 'react-desc';
|
|
11
|
-
import '@elliemae/ds-
|
|
11
|
+
import '@elliemae/ds-indeterminate-progress-indicator';
|
|
12
12
|
import '@elliemae/ds-banner';
|
|
13
13
|
import '../chat-composer/ChatContainerComposer.js';
|
|
14
14
|
import '@babel/runtime/helpers/esm/defineProperty';
|
|
15
15
|
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
16
|
-
import '@elliemae/ds-icons
|
|
16
|
+
import '@elliemae/ds-icons';
|
|
17
17
|
import '../chat-composer/styled.js';
|
|
18
18
|
import '@elliemae/ds-button';
|
|
19
19
|
import '../chat-composer/config/useValidateProps.js';
|
|
@@ -21,9 +21,7 @@ import '@elliemae/ds-props-helpers';
|
|
|
21
21
|
import '../chat-composer/props.js';
|
|
22
22
|
import '../chat-container-messages-list/ChatContainerMessagesList.js';
|
|
23
23
|
import 'react-virtual';
|
|
24
|
-
import '@elliemae/ds-basic/Button';
|
|
25
24
|
import '../bubble/ChatBubble.js';
|
|
26
|
-
import '@elliemae/ds-icons/WarningCircleFill';
|
|
27
25
|
import '../bubble/styled.js';
|
|
28
26
|
import '../bubble/props.js';
|
|
29
27
|
import 'prop-types';
|
|
@@ -43,15 +41,11 @@ import '../chat-container-messages-list/config/useValidateProps.js';
|
|
|
43
41
|
import '../chat-container/props.js';
|
|
44
42
|
import '../chat-container/styled.js';
|
|
45
43
|
import '../chat-container/config/useValidateProps.js';
|
|
46
|
-
import '@elliemae/ds-icons/MenuExpand';
|
|
47
|
-
import '@elliemae/ds-icons/MenuCollapse';
|
|
48
44
|
import '../chat-sidebar/styled.js';
|
|
49
45
|
import '../tile-button/TileButton.js';
|
|
50
46
|
import '@elliemae/ds-tooltip';
|
|
51
|
-
import '@elliemae/ds-icons/CloseXsmall';
|
|
52
47
|
import '../tile-button/styled.js';
|
|
53
48
|
import '../tile-button/props.js';
|
|
54
|
-
import '@elliemae/ds-icons/Comments';
|
|
55
49
|
import '../tile-button/config/useValidateProps.js';
|
|
56
50
|
import '../sidebar-button/SidebarButton.js';
|
|
57
51
|
import '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfluencerContainer.js","sources":["../../../../src/parts/grid-influencer/InfluencerContainer.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { StyledChatContainer } from './styled';\nimport { ChatContainer } from '../chat-container/ChatContainer';\nimport { SideBarChat } from '../chat-sidebar/SideBarChat';\n\nexport const InfluencerContainer: React.ComponentType<any> = (props) =>\n React.useMemo(\n () =>\n props.floating ? null : (\n <StyledChatContainer\n cols={['auto', props.expanded ? 1 : '0px']}\n expanded={props.expanded}\n expandedWidth={props.expandedWidth}\n >\n <SideBarChat />\n {props.expanded ? <ChatContainer /> : <div />}\n </StyledChatContainer>\n ),\n [props.floating, props.expanded, props.expandedWidth],\n );\n"],"names":["InfluencerContainer","props","React","useMemo","floating","expanded","expandedWidth"],"mappings":"
|
|
1
|
+
{"version":3,"file":"InfluencerContainer.js","sources":["../../../../src/parts/grid-influencer/InfluencerContainer.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { StyledChatContainer } from './styled';\nimport { ChatContainer } from '../chat-container/ChatContainer';\nimport { SideBarChat } from '../chat-sidebar/SideBarChat';\n\nexport const InfluencerContainer: React.ComponentType<any> = (props) =>\n React.useMemo(\n () =>\n props.floating ? null : (\n <StyledChatContainer\n cols={['auto', props.expanded ? 1 : '0px']}\n expanded={props.expanded}\n expandedWidth={props.expandedWidth}\n >\n <SideBarChat />\n {props.expanded ? <ChatContainer /> : <div />}\n </StyledChatContainer>\n ),\n [props.floating, props.expanded, props.expandedWidth],\n );\n"],"names":["InfluencerContainer","props","React","useMemo","floating","expanded","expandedWidth"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;IAMaA,mBAA6C,GAAG,SAAhDA,mBAAgD,CAACC,KAAD;AAAA,SAC3DC,KAAK,CAACC,OAAN,CACE;AAAA,WACEF,KAAK,CAACG,QAAN,GAAiB,IAAjB,gBACE,oBAAC,mBAAD;AACE,MAAA,IAAI,EAAE,CAAC,MAAD,EAASH,KAAK,CAACI,QAAN,GAAiB,CAAjB,GAAqB,KAA9B,CADR;AAEE,MAAA,QAAQ,EAAEJ,KAAK,CAACI,QAFlB;AAGE,MAAA,aAAa,EAAEJ,KAAK,CAACK;AAHvB,oBAKE,oBAAC,WAAD,OALF,EAMGL,KAAK,CAACI,QAAN,gBAAiB,oBAAC,aAAD,OAAjB,gBAAqC,gCANxC,CAFJ;AAAA,GADF,EAYE,CAACJ,KAAK,CAACG,QAAP,EAAiBH,KAAK,CAACI,QAAvB,EAAiCJ,KAAK,CAACK,aAAvC,CAZF,CAD2D;AAAA;;;;"}
|
|
@@ -9,7 +9,7 @@ import '../../styled.js';
|
|
|
9
9
|
import 'prop-types';
|
|
10
10
|
import 'react-desc';
|
|
11
11
|
import 'lodash';
|
|
12
|
-
import '@elliemae/ds-icons
|
|
12
|
+
import '@elliemae/ds-icons';
|
|
13
13
|
|
|
14
14
|
var _excluded = ["label", "dsId", "onClick", "Icon"];
|
|
15
15
|
var SidebarButton = function SidebarButton(_ref) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sources":["../../../../src/parts/sidebar-button/props.ts"],"sourcesContent":["import React from 'react';\nimport propsTypes from 'prop-types';\nimport { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\nimport Comments from '@elliemae/ds-icons
|
|
1
|
+
{"version":3,"file":"props.js","sources":["../../../../src/parts/sidebar-button/props.ts"],"sourcesContent":["import React from 'react';\nimport propsTypes from 'prop-types';\nimport { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\nimport { Comments } from '@elliemae/ds-icons';\n\nexport interface SidebarButtonProps {\n Icon: React.FC<{ size: string }>;\n dsId: string | number;\n label: string;\n onClick?: (dsId: string | number) => void;\n title: string;\n}\n\nexport const defaultSidebarButton: SidebarButtonProps = {\n Icon: Comments,\n dsId: undefined,\n label: '',\n onClick: noop,\n title: '',\n};\n\nexport const propsSidebarButton = {\n Icon: PropTypes.element.description('Icon component').defaultValue(defaultSidebarButton.Icon),\n dsId: PropTypes.oneOfType([propsTypes.number, propsTypes.string])\n .description('Unique id for the button')\n .defaultValue(defaultSidebarButton.dsId),\n label: PropTypes.string.description('It will display under the icon').defaultValue(defaultSidebarButton.label),\n title: PropTypes.string.description('Tooltip').defaultValue(defaultSidebarButton.title),\n onClick: PropTypes.func\n .description('The function to call when the is clicked')\n .defaultValue(defaultSidebarButton.onClick),\n};\n"],"names":["defaultSidebarButton","Icon","Comments","dsId","undefined","label","onClick","noop","title","propsSidebarButton","PropTypes","element","description","defaultValue","oneOfType","propsTypes","number","string","func"],"mappings":";;;;;IAcaA,oBAAwC,GAAG;AACtDC,EAAAA,IAAI,EAAEC,QADgD;AAEtDC,EAAAA,IAAI,EAAEC,SAFgD;AAGtDC,EAAAA,KAAK,EAAE,EAH+C;AAItDC,EAAAA,OAAO,EAAEC,IAJ6C;AAKtDC,EAAAA,KAAK,EAAE;AAL+C;IAQ3CC,kBAAkB,GAAG;AAChCR,EAAAA,IAAI,EAAES,SAAS,CAACC,OAAV,CAAkBC,WAAlB,CAA8B,gBAA9B,EAAgDC,YAAhD,CAA6Db,oBAAoB,CAACC,IAAlF,CAD0B;AAEhCE,EAAAA,IAAI,EAAEO,SAAS,CAACI,SAAV,CAAoB,CAACC,UAAU,CAACC,MAAZ,EAAoBD,UAAU,CAACE,MAA/B,CAApB,EACHL,WADG,CACS,0BADT,EAEHC,YAFG,CAEUb,oBAAoB,CAACG,IAF/B,CAF0B;AAKhCE,EAAAA,KAAK,EAAEK,SAAS,CAACO,MAAV,CAAiBL,WAAjB,CAA6B,gCAA7B,EAA+DC,YAA/D,CAA4Eb,oBAAoB,CAACK,KAAjG,CALyB;AAMhCG,EAAAA,KAAK,EAAEE,SAAS,CAACO,MAAV,CAAiBL,WAAjB,CAA6B,SAA7B,EAAwCC,YAAxC,CAAqDb,oBAAoB,CAACQ,KAA1E,CANyB;AAOhCF,EAAAA,OAAO,EAAEI,SAAS,CAACQ,IAAV,CACNN,WADM,CACM,0CADN,EAENC,YAFM,CAEOb,oBAAoB,CAACM,OAF5B;AAPuB;;;;"}
|
|
@@ -2,13 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import { describe } from 'react-desc';
|
|
3
3
|
import { DSTooltipV3 } from '@elliemae/ds-tooltip';
|
|
4
4
|
import { Grid } from '@elliemae/ds-grid';
|
|
5
|
-
import CloseXsmall from '@elliemae/ds-icons
|
|
5
|
+
import { CloseXsmall } from '@elliemae/ds-icons';
|
|
6
6
|
import { StyledWrapperCentralContent, StyledTileButtonIcon, StyledStatusBadge, StyledTileButtonLabel, StyledTileButton, StyledWrapper, StyledWrapperLeftBorder, CloseButton } from './styled.js';
|
|
7
7
|
import { propsTileButton, defaultTileButton } from './props.js';
|
|
8
8
|
import { useValidateProps } from './config/useValidateProps.js';
|
|
9
9
|
import 'styled-components';
|
|
10
10
|
import 'lodash';
|
|
11
|
-
import '@elliemae/ds-icons/Comments';
|
|
12
11
|
import '@elliemae/ds-props-helpers';
|
|
13
12
|
|
|
14
13
|
var TileButton = function TileButton(props) {
|