@elliemae/ds-chat 1.61.10 → 1.61.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/cjs/ChatDataTestids.js.map +1 -1
  2. package/cjs/index.js +2 -1
  3. package/cjs/index.js.map +1 -1
  4. package/cjs/parts/bubble/ChatBubble.js.map +1 -1
  5. package/cjs/parts/bubble/ChatBubbleArrow.js.map +1 -1
  6. package/cjs/parts/bubble/config/useValidateProps.js.map +1 -1
  7. package/cjs/parts/bubble/props.js.map +1 -1
  8. package/cjs/parts/bubble/styled.js.map +1 -1
  9. package/cjs/parts/chat-card/ChatCard.js.map +1 -1
  10. package/cjs/parts/chat-card/config/useValidateProps.js.map +1 -1
  11. package/cjs/parts/chat-card/props.js.map +1 -1
  12. package/cjs/parts/chat-card/styled.js.map +1 -1
  13. package/cjs/parts/chat-composer/ChatContainerComposer.js.map +1 -1
  14. package/cjs/parts/chat-composer/config/useValidateProps.js.map +1 -1
  15. package/cjs/parts/chat-composer/props.js.map +1 -1
  16. package/cjs/parts/chat-composer/styled.js.map +1 -1
  17. package/cjs/parts/chat-container/ChatContainer.js +1 -0
  18. package/cjs/parts/chat-container/ChatContainer.js.map +1 -1
  19. package/cjs/parts/chat-container/config/useValidateProps.js.map +1 -1
  20. package/cjs/parts/chat-container/index.js +1 -0
  21. package/cjs/parts/chat-container/index.js.map +1 -1
  22. package/cjs/parts/chat-container/props.js.map +1 -1
  23. package/cjs/parts/chat-container/styled.js.map +1 -1
  24. package/cjs/parts/chat-container-header/ChatContainerHeader.js.map +1 -1
  25. package/cjs/parts/chat-container-header/helpers.js.map +1 -1
  26. package/cjs/parts/chat-container-header/styled.js.map +1 -1
  27. package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js +9 -3
  28. package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +1 -1
  29. package/cjs/parts/chat-container-messages-list/config/useValidateProps.js.map +1 -1
  30. package/cjs/parts/chat-container-messages-list/index.js +2 -0
  31. package/cjs/parts/chat-container-messages-list/index.js.map +1 -1
  32. package/cjs/parts/chat-container-messages-list/props.js.map +1 -1
  33. package/cjs/parts/chat-container-messages-list/styled.js +7 -3
  34. package/cjs/parts/chat-container-messages-list/styled.js.map +1 -1
  35. package/cjs/parts/chat-container-messages-list/useGetNewMessages.js +34 -0
  36. package/cjs/parts/chat-container-messages-list/useGetNewMessages.js.map +1 -0
  37. package/cjs/parts/chat-empty-state/ChatEmptyState.js.map +1 -1
  38. package/cjs/parts/chat-empty-state/config/useValidateProps.js.map +1 -1
  39. package/cjs/parts/chat-empty-state/props.js.map +1 -1
  40. package/cjs/parts/chat-empty-state/styled.js.map +1 -1
  41. package/cjs/parts/chat-sidebar/SideBarChat.js.map +1 -1
  42. package/cjs/parts/chat-sidebar/config/useValidateProps.js.map +1 -1
  43. package/cjs/parts/chat-sidebar/props.js.map +1 -1
  44. package/cjs/parts/chat-sidebar/styled.js.map +1 -1
  45. package/cjs/parts/floating-button/FloatingButton.js.map +1 -1
  46. package/cjs/parts/floating-button/props.js.map +1 -1
  47. package/cjs/parts/floating-button/styled.js.map +1 -1
  48. package/cjs/parts/floating-container/styled.js.map +1 -1
  49. package/cjs/parts/grid-influencer/InfluencerContainer.js +1 -0
  50. package/cjs/parts/grid-influencer/InfluencerContainer.js.map +1 -1
  51. package/cjs/parts/grid-influencer/styled.js.map +1 -1
  52. package/cjs/parts/message-delimiter/MessageDelimiter.js.map +1 -1
  53. package/cjs/parts/message-delimiter/config/useValidateProps.js.map +1 -1
  54. package/cjs/parts/message-delimiter/props.js.map +1 -1
  55. package/cjs/parts/message-delimiter/styled.js.map +1 -1
  56. package/cjs/parts/sidebar-button/SidebarButton.js.map +1 -1
  57. package/cjs/parts/sidebar-button/props.js.map +1 -1
  58. package/cjs/parts/sidebar-button/styled.js.map +1 -1
  59. package/cjs/parts/system-message/SystemMessage.js.map +1 -1
  60. package/cjs/parts/system-message/config/useValidateProps.js.map +1 -1
  61. package/cjs/parts/system-message/props.js.map +1 -1
  62. package/cjs/parts/system-message/style.js.map +1 -1
  63. package/cjs/parts/tile-button/TileButton.js.map +1 -1
  64. package/cjs/parts/tile-button/config/useValidateProps.js.map +1 -1
  65. package/cjs/parts/tile-button/props.js.map +1 -1
  66. package/cjs/parts/tile-button/styled.js.map +1 -1
  67. package/cjs/prop-types.js.map +1 -1
  68. package/cjs/tests/utils.js.map +1 -1
  69. package/esm/ChatDataTestids.js.map +1 -1
  70. package/esm/index.js +2 -1
  71. package/esm/index.js.map +1 -1
  72. package/esm/parts/bubble/ChatBubble.js.map +1 -1
  73. package/esm/parts/bubble/ChatBubbleArrow.js.map +1 -1
  74. package/esm/parts/bubble/config/useValidateProps.js.map +1 -1
  75. package/esm/parts/bubble/props.js.map +1 -1
  76. package/esm/parts/bubble/styled.js.map +1 -1
  77. package/esm/parts/chat-card/ChatCard.js.map +1 -1
  78. package/esm/parts/chat-card/config/useValidateProps.js.map +1 -1
  79. package/esm/parts/chat-card/props.js.map +1 -1
  80. package/esm/parts/chat-card/styled.js.map +1 -1
  81. package/esm/parts/chat-composer/ChatContainerComposer.js.map +1 -1
  82. package/esm/parts/chat-composer/config/useValidateProps.js.map +1 -1
  83. package/esm/parts/chat-composer/props.js.map +1 -1
  84. package/esm/parts/chat-composer/styled.js.map +1 -1
  85. package/esm/parts/chat-container/ChatContainer.js +1 -0
  86. package/esm/parts/chat-container/ChatContainer.js.map +1 -1
  87. package/esm/parts/chat-container/config/useValidateProps.js.map +1 -1
  88. package/esm/parts/chat-container/index.js +1 -0
  89. package/esm/parts/chat-container/index.js.map +1 -1
  90. package/esm/parts/chat-container/props.js.map +1 -1
  91. package/esm/parts/chat-container/styled.js.map +1 -1
  92. package/esm/parts/chat-container-header/ChatContainerHeader.js.map +1 -1
  93. package/esm/parts/chat-container-header/helpers.js.map +1 -1
  94. package/esm/parts/chat-container-header/styled.js.map +1 -1
  95. package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js +10 -4
  96. package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +1 -1
  97. package/esm/parts/chat-container-messages-list/config/useValidateProps.js.map +1 -1
  98. package/esm/parts/chat-container-messages-list/index.js +2 -0
  99. package/esm/parts/chat-container-messages-list/index.js.map +1 -1
  100. package/esm/parts/chat-container-messages-list/props.js.map +1 -1
  101. package/esm/parts/chat-container-messages-list/styled.js +7 -4
  102. package/esm/parts/chat-container-messages-list/styled.js.map +1 -1
  103. package/esm/parts/chat-container-messages-list/useGetNewMessages.js +26 -0
  104. package/esm/parts/chat-container-messages-list/useGetNewMessages.js.map +1 -0
  105. package/esm/parts/chat-empty-state/ChatEmptyState.js.map +1 -1
  106. package/esm/parts/chat-empty-state/config/useValidateProps.js.map +1 -1
  107. package/esm/parts/chat-empty-state/props.js.map +1 -1
  108. package/esm/parts/chat-empty-state/styled.js.map +1 -1
  109. package/esm/parts/chat-sidebar/SideBarChat.js.map +1 -1
  110. package/esm/parts/chat-sidebar/config/useValidateProps.js.map +1 -1
  111. package/esm/parts/chat-sidebar/props.js.map +1 -1
  112. package/esm/parts/chat-sidebar/styled.js.map +1 -1
  113. package/esm/parts/floating-button/FloatingButton.js.map +1 -1
  114. package/esm/parts/floating-button/props.js.map +1 -1
  115. package/esm/parts/floating-button/styled.js.map +1 -1
  116. package/esm/parts/floating-container/styled.js.map +1 -1
  117. package/esm/parts/grid-influencer/InfluencerContainer.js +1 -0
  118. package/esm/parts/grid-influencer/InfluencerContainer.js.map +1 -1
  119. package/esm/parts/grid-influencer/styled.js.map +1 -1
  120. package/esm/parts/message-delimiter/MessageDelimiter.js.map +1 -1
  121. package/esm/parts/message-delimiter/config/useValidateProps.js.map +1 -1
  122. package/esm/parts/message-delimiter/props.js.map +1 -1
  123. package/esm/parts/message-delimiter/styled.js.map +1 -1
  124. package/esm/parts/sidebar-button/SidebarButton.js.map +1 -1
  125. package/esm/parts/sidebar-button/props.js.map +1 -1
  126. package/esm/parts/sidebar-button/styled.js.map +1 -1
  127. package/esm/parts/system-message/SystemMessage.js.map +1 -1
  128. package/esm/parts/system-message/config/useValidateProps.js.map +1 -1
  129. package/esm/parts/system-message/props.js.map +1 -1
  130. package/esm/parts/system-message/style.js.map +1 -1
  131. package/esm/parts/tile-button/TileButton.js.map +1 -1
  132. package/esm/parts/tile-button/config/useValidateProps.js.map +1 -1
  133. package/esm/parts/tile-button/props.js.map +1 -1
  134. package/esm/parts/tile-button/styled.js.map +1 -1
  135. package/esm/prop-types.js.map +1 -1
  136. package/esm/tests/utils.js.map +1 -1
  137. package/package.json +9 -9
  138. package/parts/chat-container-messages-list/useGetNewMessages/package.json +10 -0
@@ -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';\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\n// eslint-disable-next-line complexity\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 onKeyDown,\n maxHeight = 300,\n placeholder,\n inputMaxLength,\n maxLengthMessage,\n ariaMaxLengthMessage,\n buttonDisabled,\n dataTestid,\n actionRef,\n } = props;\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 = 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","onKeyDown","maxHeight","placeholder","inputMaxLength","maxLengthMessage","ariaMaxLengthMessage","buttonDisabled","dataTestid","actionRef","COMPOSER_MIN_HEIGHT","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":";;;;;;;;;;;;;;;;;;IAiBMA,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAA2C;AAAA;;AAC9DC,EAAAA,gBAAgB,CAACD,KAAD,EAAQE,sBAAsB,CAACC,MAAvB,E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C,cAAxB,IAA2C,EAd5D,CADF,eAiBE,oBAAC,IAAD,OAjBF,CAjDF,CADF;AAuED;;AAEDd,YAAY,CAAC0D,SAAb,GAAyBC,aAAzB;AACA3D,YAAY,CAAC4D,YAAb,GAA4BC,mBAA5B;IACM1D,sBAAsB,GAAG2D,QAAQ,CAAC9D,YAAD;AACvCG,sBAAsB,CAACuD,SAAvB,GAAmCC,aAAnC;;;;"}
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\n// eslint-disable-next-line complexity\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 onKeyDown,\n maxHeight = 300,\n placeholder,\n inputMaxLength,\n maxLengthMessage,\n ariaMaxLengthMessage,\n buttonDisabled,\n dataTestid,\n actionRef,\n } = props;\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 = 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","onKeyDown","maxHeight","placeholder","inputMaxLength","maxLengthMessage","ariaMaxLengthMessage","buttonDisabled","dataTestid","actionRef","COMPOSER_MIN_HEIGHT","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":";;;;;;;;;;;;;;;;;;IAiBMA,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAA2C;EAAA;;EAC9DC,gBAAgB,CAACD,KAAD,EAAQE,sBAAsB,CAACC,MAAvB,EAAR,CAAhB;EAEA,IACEC,UADF,GAgBIJ,KAhBJ,CACEI,UADF;MAEEC,QAFF,GAgBIL,KAhBJ,CAEEK,QAFF;MAGEC,QAHF,GAgBIN,KAhBJ,CAGEM,QAHF;MAIEC,MAJF,GAgBIP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I,EAAE,CAAC,KAAD,EAAQ,MAAR,CAAZ;IAA6B,cAAc,EAAC,UAA5C;IAAuD,UAAU,EAAC,QAAlE;IAA2E,MAAM,EAAC,KAAlF;IAAwF,EAAE,EAAC;kBACzF,oBAAC,iBAAD;IAAmB,QAAQ,EAAE8C,QAA7B;IAAuC,eAAY;KAChDrC,cAAc,IAAIqC,QAAlB,gBACC,uDACE,oBAAC,sBAAD;IAAwB,IAAI,EAAC;KAC1BnC,oBAAoB,+BACCgC,WADD,wDAEjBA,WAAW,GAAGlC,cAFG,yCAGYA,cAHZ,kBADvB,CADF,EAOGC,gBAAgB,wCAAiCD,cAAjC,kBAPnB,CADD,GAWC,EAZJ,EAcGA,cAAc,cAAOkC,WAAP,gBAAwBlC,cAAxB,IAA2C,EAd5D,CADF,eAiBE,oBAAC,IAAD,OAjBF,CAjDF,CADF;AAuED;;AAEDd,YAAY,CAAC0D,SAAb,GAAyBC,aAAzB;AACA3D,YAAY,CAAC4D,YAAb,GAA4BC,mBAA5B;IACM1D,sBAAsB,GAAG2D,QAAQ,CAAC9D,YAAD;AACvCG,sBAAsB,CAACuD,SAAvB,GAAmCC,aAAnC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useValidateProps.js","sources":["../../../../../src/parts/chat-composer/config/useValidateProps.tsx"],"sourcesContent":["import { useValidatePropTypes } from '@elliemae/ds-props-helpers';\nimport { ChatComposerProps } from '../props';\n\nexport const useValidateProps = (props: ChatComposerProps, schema: unknown): void => {\n useValidatePropTypes(props, schema);\n};\n"],"names":["useValidateProps","props","schema","useValidatePropTypes"],"mappings":";;IAGaA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAA2BC,MAA3B,EAAqD;AACnFC,EAAAA,oBAAoB,CAACF,KAAD,EAAQC,MAAR,CAApB;AACD;;;;"}
1
+ {"version":3,"file":"useValidateProps.js","sources":["../../../../../src/parts/chat-composer/config/useValidateProps.tsx"],"sourcesContent":["import { useValidatePropTypes } from '@elliemae/ds-props-helpers';\nimport { ChatComposerProps } from '../props';\n\nexport const useValidateProps = (props: ChatComposerProps, schema: unknown): void => {\n useValidatePropTypes(props, schema);\n};\n"],"names":["useValidateProps","props","schema","useValidatePropTypes"],"mappings":";;IAGaA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAA2BC,MAA3B,EAAqD;EACnFC,oBAAoB,CAACF,KAAD,EAAQC,MAAR,CAApB;AACD;;;;"}
@@ -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 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: noop,\n};\n\nexport interface ChatComposerProps {\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: 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 ariaMaxLengthMessage: PropTypes.string\n .description('Aria message for Max length message when exceeded')\n .defaultValue(defaultComposerPros.maxLengthMessage),\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 onKeyDown: PropTypes.func.description('Input on key down').defaultValue(defaultComposerPros.onKeyDown),\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","ariaMaxLengthMessage","onChange","noop","onResize","onSend","onFocus","onBlur","onKeyDown","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,oBAAoB,EAAE,EAH8B;AAIpDC,EAAAA,QAAQ,EAAEC,I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,WAAf,CAA2B,4BAA3B,EAAyDC,YAAzD,CAAsEtB,mBAAmB,CAACO,MAA1F,CAbmB;AAc3BC,EAAAA,OAAO,EAAEW,SAAS,CAACI,IAAV,CAAeF,WAAf,CAA2B,aAA3B,EAA0CC,YAA1C,CAAuDtB,mBAAmB,CAACQ,OAA3E,CAdkB;AAe3BC,EAAAA,MAAM,EAAEU,SAAS,CAACI,IAAV,CAAeF,WAAf,CAA2B,YAA3B,EAAyCC,YAAzC,CAAsDtB,mBAAmB,CAACS,MAA1E,CAfmB;AAgB3BC,EAAAA,SAAS,EAAES,SAAS,CAACI,IAAV,CAAeF,WAAf,CAA2B,mBAA3B,EAAgDC,YAAhD,CAA6DtB,mBAAmB,CAACU,SAAjF,CAhBgB;AAiB3BC,EAAAA,SAAS,EAAEQ,SAAS,CAACK,MAAV,CACRH,WADQ,CACI,gDADJ,EAERC,YAFQ,CAEKtB,mBAAmB,CAACS,MAFzB,CAjBgB;AAoB3BG,EAAAA,cAAc,EAAEO,SAAS,CAACK,MAAV,CACbH,WADa,CACD,sDADC,EAEbC,YAFa,CAEAtB,mBAAmB,CAACY,cAFpB,CApBW;AAuB3BG,EAAAA,cAAc,EAAEI,SAAS,CAACM,IAAV,CACbJ,WADa,CACD,0CADC,EAEbC,YAFa,CAEAtB,mBAAmB,CAACe,cAFpB,CAvBW;AA0B3BC,EAAAA,UAAU,EAAEG,SAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,aAA7B,EAA4CC,YAA5C,CAAyDtB,mBAAmB,CAACC,WAA7E,CA1Be;AA2B3BgB,EAAAA,SAAS,EAAEE,SAAS,CAACO,MAAV,CACRL,WADQ,oTAcRC,YAdQ,CAcKtB,mBAAmB,CAACiB,SAdzB;AA3BgB;;;;"}
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 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: noop,\n};\n\nexport interface ChatComposerProps {\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: 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 ariaMaxLengthMessage: PropTypes.string\n .description('Aria message for Max length message when exceeded')\n .defaultValue(defaultComposerPros.maxLengthMessage),\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 onKeyDown: PropTypes.func.description('Input on key down').defaultValue(defaultComposerPros.onKeyDown),\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","ariaMaxLengthMessage","onChange","noop","onResize","onSend","onFocus","onBlur","onKeyDown","maxHeight","inputMaxLength","undefined","maxLengthMessage","buttonDisabled","dataTestid","actionRef","composerProps","PropTypes","string","description","defaultValue","func","number","bool","object"],"mappings":";;;IASaA,mBAAsC,GAAG;EACpDC,WAAW,EAAE,mBADuC;EAEpDC,UAAU,EAAE,EAFwC;EAGpDC,oBAAoB,EAAE,EAH8B;EAIpDC,QAAQ,EAAEC,IAJ0C;EAKpDC,QAAQ,EAAED,IAL0C;EAMpDE,MAAM,EAAEF,IAN4C;EAOpDG,OAAO,EAAEH,IAP2C;EAQpDI,MAAM,EAAEJ,IAR4C;EASpDK,SAAS,EAAEL,IATyC;EAUpDM,SAAS,EAAE,CAVyC;EAWpDC,cAAc,EAAEC,SAXoC;EAYpDC,gBAAgB,EAAED,SAZkC;EAapDE,cAAc,EAAE,KAboC;EAcpDC,UAAU,EAAE,kBAdwC;EAepDC,SAAS,EAAEZ;AAfyC;IAoCzCa,aAAa,GAAG;EAC3BjB,WAAW,EAAEkB,SAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,mBAA7B,EAAkDC,YAAlD,CAA+DtB,mBAAmB,CAACC,WAAnF,CADc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K,MAAV,CACbH,WADa,CACD,sDADC,EAEbC,YAFa,CAEAtB,mBAAmB,CAACY,cAFpB,CApBW;EAuB3BG,cAAc,EAAEI,SAAS,CAACM,IAAV,CACbJ,WADa,CACD,0CADC,EAEbC,YAFa,CAEAtB,mBAAmB,CAACe,cAFpB,CAvBW;EA0B3BC,UAAU,EAAEG,SAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,aAA7B,EAA4CC,YAA5C,CAAyDtB,mBAAmB,CAACC,WAA7E,CA1Be;EA2B3BgB,SAAS,EAAEE,SAAS,CAACO,MAAV,CACRL,WADQ,oTAcRC,YAdQ,CAcKtB,mBAAmB,CAACiB,SAdzB;AA3BgB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"styled.js","sources":["../../../../src/parts/chat-composer/styled.ts"],"sourcesContent":["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"],"names":["StyledChatContainerContentComposer","styled","Grid","props","theme","colors","neutral","space","xxs","xs","maxHeight","StyledComposerInput","textarea","height","brand","StyledComposerButton","DSButton","StyledCounterArea","hasError","danger","StyledCounterErrorA11y","span"],"mappings":";;;;AAKA;IACaA,kCAAkC,gBAAGC,MAAM,CAACC,IAAD,CAAT;AAAA;AAAA,mKAG/B,UAACC,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBC,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CAH+B,EAIlC,UAACH,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYG,KAAZ,CAAkBC,GAA7B;AAAA,CAJkC,EAO7B,UAACL,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYG,KAAZ,CAAkBE,EAA7B;AAAA,CAP6B,EAQ/B,UAACN,KAAD;AAAA,SAAWA,KAAK,CAACO,SAAjB;AAAA,CAR+B;IAYlCC,mBAAmB,gBAAGV,MAAM,CAACW,QAAV;AAAA;AAAA,6TACnB,UAACT,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYG,KAAZ,CAAkBC,GAA7B;AAAA,CADmB,EAOpB,UAACL,KAAD;AAAA,SAA2B,OAAOA,KAAK,CAACU,MAAb,KAAwB,QAAxB,aAAsCV,KAAK,CAACU,MAA5C,UAAyDV,KAAK,CAACU,MAA1F;AAAA,CAPoB,EAgBR,UAACV,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBS,KAAnB,CAAyB,GAAzB,CAAX;AAAA,CAhBQ;IAqBnBC,oBAAoB,gBAAGd,MAAM,CAACe,QAAD,CAAT;AAAA;AAAA,+FAQrB,UAACb,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBS,KAAnB,CAAyB,GAAzB,CAAX;AAAA,CARqB,EAWf,UAACX,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBS,KAAnB,CAAyB,GAAzB,CAAX;AAAA,CAXe;IAepBG,iBAAiB,gBAAGhB,MAAM,CAACC,IAAD,CAAT;AAAA;AAAA,iHAM1B,UAACC,KAAD;AAAA,SAAYA,KAAK,CAACe,QAAN,mBAA0Bf,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBc,MAAnB,CAA0B,GAA1B,CAA1B,SAA8D,EAA1E;AAAA,CAN0B;IAUjBC,sBAAsB,gBAAGnB,MAAM,CAACoB,IAAV;AAAA;AAAA;;;;"}
1
+ {"version":3,"file":"styled.js","sources":["../../../../src/parts/chat-composer/styled.ts"],"sourcesContent":["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"],"names":["StyledChatContainerContentComposer","styled","Grid","props","theme","colors","neutral","space","xxs","xs","maxHeight","StyledComposerInput","textarea","height","brand","StyledComposerButton","DSButton","StyledCounterArea","hasError","danger","StyledCounterErrorA11y","span"],"mappings":";;;;AAKA;IACaA,kCAAkC,gBAAGC,MAAM,CAACC,IAAD,CAAT;EAAA;AAAA,mKAG/B,UAACC,KAAD;EAAA,OAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBC,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CAH+B,EAIlC,UAACH,KAAD;EAAA,OAAWA,KAAK,CAACC,KAAN,CAAYG,KAAZ,CAAkBC,GAA7B;AAAA,CAJkC,EAO7B,UAACL,KAAD;EAAA,OAAWA,KAAK,CAACC,KAAN,CAAYG,KAAZ,CAAkBE,EAA7B;AAAA,CAP6B,EAQ/B,UAACN,KAAD;EAAA,OAAWA,KAAK,CAACO,SAAjB;AAAA,CAR+B;IAYlCC,mBAAmB,gBAAGV,MAAM,CAACW,QAAV;EAAA;AAAA,6TACnB,UAACT,KAAD;EAAA,OAAWA,KAAK,CAACC,KAAN,CAAYG,KAAZ,CAAkBC,GAA7B;AAAA,CADmB,EAOpB,UAACL,KAAD;EAAA,OAA2B,OAAOA,KAAK,CAACU,MAAb,KAAwB,QAAxB,aAAsCV,KAAK,CAACU,MAA5C,UAAyDV,KAAK,CAACU,MAA1F;AAAA,CAPoB,EAgBR,UAACV,KAAD;EAAA,OAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBS,KAAnB,CAAyB,GAAzB,CAAX;AAAA,CAhBQ;IAqBnBC,oBAAoB,gBAAGd,MAAM,CAACe,QAAD,CAAT;EAAA;AAAA,+FAQrB,UAACb,KAAD;EAAA,OAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBS,KAAnB,CAAyB,GAAzB,CAAX;AAAA,CARqB,EAWf,UAACX,KAAD;EAAA,OAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBS,KAAnB,CAAyB,GAAzB,CAAX;AAAA,CAXe;IAepBG,iBAAiB,gBAAGhB,MAAM,CAACC,IAAD,CAAT;EAAA;AAAA,iHAM1B,UAACC,KAAD;EAAA,OAAYA,KAAK,CAACe,QAAN,mBAA0Bf,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBc,MAAnB,CAA0B,GAA1B,CAA1B,SAA8D,EAA1E;AAAA,CAN0B;IAUjBC,sBAAsB,gBAAGnB,MAAM,CAACoB,IAAV;EAAA;AAAA;;;;"}
@@ -37,6 +37,7 @@ import '../system-message/config/useValidateProps.js';
37
37
  import '../chat-container-messages-list/styled.js';
38
38
  import '../chat-container-messages-list/props.js';
39
39
  import '../chat-container-messages-list/config/useValidateProps.js';
40
+ import '../chat-container-messages-list/useGetNewMessages.js';
40
41
 
41
42
  var ChatContainer = function ChatContainer(props) {
42
43
  var _messagesListProps$me2, _containerRef$current;
@@ -1 +1 @@
1
- {"version":3,"file":"ChatContainer.js","sources":["../../../../src/parts/chat-container/ChatContainer.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n/* 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, onKeyDown: onComposerKeyDown },\n actionRef,\n device,\n isLoading,\n hasMoreItems,\n getMoreMessages,\n ariaLabel,\n } = props;\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\n return (\n <Container rows={['minmax(0, 1fr)', 'auto']} ref={containerRef} role=\"region\" aria-label={ariaLabel}>\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 {['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 = 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","onComposerKeyDown","onKeyDown","actionRef","device","isLoading","hasMoreItems","getMoreMessages","ariaLabel","bannerRef","React","useRef","focusOnWrapper","noop","focusOnLink","containerRef","listRef","scrollToIndex","useCallback","height","setTimeout","current","messages","length","align","Container","StyledChatContainerContent","MobileStyledChatContainerContent","handleTabs","e","ref","shiftKey","key","preventDefault","includes","last","getMessagesInView","pop","focusToIndexWithoutScroll","useEffect","focusOnBanner","focusOnBannerLink","position","overflow","label","id","viewLabel","onClick","onView","onClose","type","BANNER_TYPES","INFO","clientHeight","propTypes","containerProps","defaultProps","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAaMA,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,eAFF;AAAA,MAGEC,cAHF,GAcIN,KAdJ,CAGEM,cAHF;AAAA,MAIEC,WAJF,GAcIP,KAdJ,CAIEO,WAJF;AAAA,MAKEC,iBALF,GAcIR,KAdJ,CAKEQ,iBALF;AAAA,MAMEC,aANF,GAcIT,KAdJ,CAMES,aANF;AAAA,6BAcIT,KAdJ,CAOES,aAPF;AAAA,MAO6BC,gBAP7B,wBAOmBC,QAPnB;AAAA,MAO0DC,iBAP1D,wBAO+CC,SAP/C;AAAA,MAQEC,SARF,GAcId,KAdJ,CAQEc,SARF;AAAA,MASEC,MATF,GAcIf,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ACC,oBAAC,wBAAD;AAA0B,IAAA,SAAS,EAAC,QAApC;AAA6C,IAAA,MAAM,MAAnD;AAAoD,mBAAY;AAAhE,kBACE,oBAAC,gCAAD;AAAkC,IAAA,UAAU,MAA5C;AAA6C,IAAA,KAAK,EAAE9B,WAApD;AAAiE,IAAA,QAAQ;AAAzE,IADF,CADD,GAIG,IApCN,CADF,eAuCE,oBAAC,YAAD,eACMK,aADN;AAEE,IAAA,SAAS,EAAE8B,UAFb;AAGE,IAAA,QAAQ,EAAE5B,QAHZ;AAIE,IAAA,SAAS,EAAE,CAAC,0BAAAe,YAAY,CAACM,OAAb,gFAAsBgC,YAAtB,KAAsC,CAAvC,IAA4C,CAJzD;AAKE,IAAA,SAAS,EAAElD,SAAS,IAAIa;AAL1B,KAvCF,CADF;AAiDD;;AAED5B,aAAa,CAACkE,SAAd,GAA0BC,cAA1B;AACAnE,aAAa,CAACoE,YAAd,GAA6BA,YAA7B;IACMjE,uBAAuB,GAAGkE,QAAQ,CAACrE,aAAD;AACxCG,uBAAuB,CAAC+D,SAAxB,GAAoCC,cAApC;;;;"}
1
+ {"version":3,"file":"ChatContainer.js","sources":["../../../../src/parts/chat-container/ChatContainer.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n/* 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, onKeyDown: onComposerKeyDown },\n actionRef,\n device,\n isLoading,\n hasMoreItems,\n getMoreMessages,\n ariaLabel,\n } = props;\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\n return (\n <Container rows={['minmax(0, 1fr)', 'auto']} ref={containerRef} role=\"region\" aria-label={ariaLabel}>\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 {['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 = 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","onComposerKeyDown","onKeyDown","actionRef","device","isLoading","hasMoreItems","getMoreMessages","ariaLabel","bannerRef","React","useRef","focusOnWrapper","noop","focusOnLink","containerRef","listRef","scrollToIndex","useCallback","height","setTimeout","current","messages","length","align","Container","StyledChatContainerContent","MobileStyledChatContainerContent","handleTabs","e","ref","shiftKey","key","preventDefault","includes","last","getMessagesInView","pop","focusToIndexWithoutScroll","useEffect","focusOnBanner","focusOnBannerLink","position","overflow","label","id","viewLabel","onClick","onView","onClose","type","BANNER_TYPES","INFO","clientHeight","propTypes","containerProps","defaultProps","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAaMA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD,EAA4C;EAAA;;EAChEC,gBAAgB,CAACD,KAAD,EAAQE,uBAAuB,CAACC,YAAxB,EAAR,CAAhB;EAEA,IACEC,WADF,GAcIJ,KAdJ,CACEI,WADF;MAEEC,eAFF,GAcIL,KAdJ,CAEEK,eAFF;MAGEC,cAHF,GAcIN,KAdJ,CAGEM,cAHF;MAIEC,WAJF,GAcIP,KAdJ,CAIEO,WAJF;MAKEC,iBALF,GAcIR,KAdJ,CAKEQ,iBALF;MAMEC,aANF,GAcIT,KAdJ,CAMES,aANF;6BAcIT,KAdJ,CAOES,aAPF;MAO6BC,gBAP7B,wBAOmBC,QAPnB;MAO0DC,iBAP1D,wBAO+CC,SAP/C;MAQEC,SARF,GAcId,KAdJ,CAQEc,SARF;MASEC,MATF,GAcIf,KAdJ,CASEe,MATF;MAUEC,SAVF,GAcIhB,KAdJ,CAUEgB,SAVF;MAWEC,YAXF,GAcIjB,KAdJ,CAWEiB,YAXF;MAYEC,eAZF,GAcIlB,KAdJ,CAYEkB,eAZF;MAaEC,SAbF,GAcInB,KAdJ,CAaEmB,SAbF;EAeA,IAAMC,SAAS,GAAGC,KAAK,CAACC,MAAN,CAAa;IAAEC,cAAc,EAAEC,IAAlB;IAAwBC,WAAW,EAAED;GAAlD,CAAlB;EACA,IAAME,YAAY,GAAGL,KAAK,CAACC,MAAN,EAArB;EACA,IAAMK,OAAO,GAAGN,KAAK,CAACC,MAAN,CAAa;IAAEM,aAAa,EAAEJ;GAA9B,CAAhB;EAEA,IAAMb,QAAQ,GAAGU,KAAK,CAACQ,WAAN,CACf,UAACC,MAAD,EAAoB;IAClB,IAAIpB,gBAAJ,EAAsBA,gBAAgB,CAACoB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MADtB;MAEVC,OAAO,EAAEnD,WAAW,CAACoD;KANzB;IAQE,OAAO,EAAEpD,WAAW,CAACqD,OARvB;IASE,MAAM,MATR;IAUE,IAAI,EAAErD,WAAW,CAACsD,IAAZ,IAAoBC,YAAY,CAACC,IAVzC;IAWE,SAAS,EAAE3C;IAZf,CAjBF,EAgCGf,eAAe,IAAIA,eAAe,CAAC6B,MAAhB,GAAyB,CAA5C,gBACC,oBAAC,wBAAD;IAA0B,SAAS,EAAC,QAApC;IAA6C,MAAM,MAAnD;IAAoD,eAAY;kBAC9D,oBAAC,gCAAD;IAAkC,UAAU,MAA5C;IAA6C,KAAK,EAAE9B,WAApD;IAAiE,QAAQ;IAD3E,CADD,GAIG,IApCN,CADF,eAuCE,oBAAC,YAAD,eACMK,aADN;IAEE,SAAS,EAAE8B,UAFb;IAGE,QAAQ,EAAE5B,QAHZ;IAIE,SAAS,EAAE,CAAC,0BAAAe,YAAY,CAACM,OAAb,gFAAsBgC,YAAtB,KAAsC,CAAvC,IAA4C,CAJzD;IAKE,SAAS,EAAElD,SAAS,IAAIa;KA5C5B,CADF;AAiDD;;AAED5B,aAAa,CAACkE,SAAd,GAA0BC,cAA1B;AACAnE,aAAa,CAACoE,YAAd,GAA6BA,YAA7B;IACMjE,uBAAuB,GAAGkE,QAAQ,CAACrE,aAAD;AACxCG,uBAAuB,CAAC+D,SAAxB,GAAoCC,cAApC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useValidateProps.js","sources":["../../../../../src/parts/chat-container/config/useValidateProps.tsx"],"sourcesContent":["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { ChatContainerProps } from '../props';\n\nexport const useValidateProps = (props: ChatContainerProps, schema: unknown): void => {\n useValidateTypescriptPropTypes(props, schema);\n};\n"],"names":["useValidateProps","props","schema","useValidateTypescriptPropTypes"],"mappings":";;IAGaA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAA4BC,MAA5B,EAAsD;AACpFC,EAAAA,8BAA8B,CAACF,KAAD,EAAQC,MAAR,CAA9B;AACD;;;;"}
1
+ {"version":3,"file":"useValidateProps.js","sources":["../../../../../src/parts/chat-container/config/useValidateProps.tsx"],"sourcesContent":["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { ChatContainerProps } from '../props';\n\nexport const useValidateProps = (props: ChatContainerProps, schema: unknown): void => {\n useValidateTypescriptPropTypes(props, schema);\n};\n"],"names":["useValidateProps","props","schema","useValidateTypescriptPropTypes"],"mappings":";;IAGaA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAA4BC,MAA5B,EAAsD;EACpFC,8BAA8B,CAACF,KAAD,EAAQC,MAAR,CAA9B;AACD;;;;"}
@@ -35,6 +35,7 @@ import '../system-message/config/useValidateProps.js';
35
35
  import '../chat-container-messages-list/styled.js';
36
36
  import '../chat-container-messages-list/props.js';
37
37
  import '../chat-container-messages-list/config/useValidateProps.js';
38
+ import '../chat-container-messages-list/useGetNewMessages.js';
38
39
  import './props.js';
39
40
  import './styled.js';
40
41
  import './config/useValidateProps.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"props.js","sources":["../../../../src/parts/chat-container/props.ts"],"sourcesContent":["import { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\nimport { BANNER_TYPES } from '@elliemae/ds-banner';\nimport {\n ChatContainerMessagesListProps,\n defaultProps as defaultListProps,\n} from '../chat-container-messages-list/props';\nimport { defaultComposerPros, ChatComposerProps } from '../chat-composer/props';\n\ninterface ChatBannerProps {\n label: string;\n viewLabel: string;\n type?: BANNER_TYPES;\n onView: () => void;\n onClose: () => void;\n}\nexport interface ChatContainerProps {\n messagesListProps: Pick<ChatContainerMessagesListProps, 'messages' | 'onScrollEnds'>;\n composerProps: ChatComposerProps;\n actionRef: PropTypes.func;\n autoScroll: boolean;\n device: 'desktop' | 'mobile';\n isLoading?: 'top' | 'bottom';\n hasMoreItems?: 'top' | 'bottom';\n getMoreMessages: PropTypes.func;\n bannerPosition?: 'top' | 'bottom';\n bannerProps?: ChatBannerProps;\n sendingMessages?: string[] | number[];\n sendingText: string;\n ariaLabel: string;\n}\n\nexport const defaultProps: ChatContainerProps = {\n messagesListProps: defaultListProps,\n composerProps: defaultComposerPros,\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 ariaLabel: 'Chat window',\n};\n\nexport const containerProps = {\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 ariaLabel: PropTypes.string\n .description('Aria Label description for chat container')\n .defaultValue(defaultProps.ariaLabel),\n};\n"],"names":["defaultProps","messagesListProps","defaultListProps","composerProps","defaultComposerPros","actionRef","undefined","autoScroll","device","isLoading","hasMoreItems","getMoreMessages","noop","bannerPosition","bannerProps","type","BANNER_TYPES","INFO","label","viewLabel","onView","onClose","sendingMessages","sendingText","ariaLabel","containerProps","PropTypes","object","description","defaultValue","bool","string","oneOf","func","oneOfType","arrayOf","number"],"mappings":";;;;;;IAgCaA,YAAgC,GAAG;AAC9CC,EAAAA,iBAAiB,EAAEC,cAD2B;AAE9CC,EAAAA,aAAa,EAAEC,mBAF+B;AAG9CC,EAAAA,SAAS,EAAEC,SAHmC;AAI9CC,EAAAA,UAAU,EAAE,KAJkC;AAK9CC,EAAAA,MAAM,EAAE,SALsC;AAM9CC,EAAAA,SAAS,EAAEH,SANmC;AAO9CI,EAAAA,YAAY,EAAEJ,SAPgC;AAQ9CK,EAAAA,eAAe,EAAEC,IAR6B;AAS9CC,EAAAA,cAAc,EAAEP,SAT8B;AAU9CQ,EAAAA,WAAW,EAAE;AACXC,IAAAA,IAAI,EAAEC,YAAY,CAACC,IADR;AAEXC,IAAAA,KAAK,EAAE,iBAFI;AAG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hB,EAA8CsB,WAA9C,CACd,2EADc,CAlBY;AAqB5Bd,EAAAA,WAAW,EAAEY,SAAS,CAACC,MAAV,CACVC,WADU,4IAUVC,YAVU,CAUG7B,YAAY,CAACc,WAVhB,CArBe;AAgC5BQ,EAAAA,eAAe,EAAEI,SAAS,CAACQ,SAAV,CAAoB,CAACR,SAAS,CAACS,OAAV,CAAkBT,SAAS,CAACK,MAA5B,CAAD,EAAsCL,SAAS,CAACS,OAAV,CAAkBT,SAAS,CAACU,MAA5B,CAAtC,CAApB,EACdR,WADc,CACF,kCADE,EAEdC,YAFc,CAED7B,YAAY,CAACsB,eAFZ,CAhCW;AAmC5BC,EAAAA,WAAW,EAAEG,SAAS,CAACK,MAAV,CACVH,WADU,CACE,kDADF,EAEVC,YAFU,CAEG7B,YAAY,CAACuB,WAFhB,CAnCe;AAsC5BlB,EAAAA,SAAS,EAAEqB,SAAS,CAACC,MAAV,CACRC,WADQ,oTAcRC,YAdQ,CAcK7B,YAAY,CAACK,SAdlB,CAtCiB;AAqD5BmB,EAAAA,SAAS,EAAEE,SAAS,CAACK,MAAV,CACRH,WADQ,CACI,2CADJ,EAERC,YAFQ,CAEK7B,YAAY,CAACwB,SAFlB;AArDiB;;;;"}
1
+ {"version":3,"file":"props.js","sources":["../../../../src/parts/chat-container/props.ts"],"sourcesContent":["import { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\nimport { BANNER_TYPES } from '@elliemae/ds-banner';\nimport {\n ChatContainerMessagesListProps,\n defaultProps as defaultListProps,\n} from '../chat-container-messages-list/props';\nimport { defaultComposerPros, ChatComposerProps } from '../chat-composer/props';\n\ninterface ChatBannerProps {\n label: string;\n viewLabel: string;\n type?: BANNER_TYPES;\n onView: () => void;\n onClose: () => void;\n}\nexport interface ChatContainerProps {\n messagesListProps: Pick<ChatContainerMessagesListProps, 'messages' | 'onScrollEnds'>;\n composerProps: ChatComposerProps;\n actionRef: PropTypes.func;\n autoScroll: boolean;\n device: 'desktop' | 'mobile';\n isLoading?: 'top' | 'bottom';\n hasMoreItems?: 'top' | 'bottom';\n getMoreMessages: PropTypes.func;\n bannerPosition?: 'top' | 'bottom';\n bannerProps?: ChatBannerProps;\n sendingMessages?: string[] | number[];\n sendingText: string;\n ariaLabel: string;\n}\n\nexport const defaultProps: ChatContainerProps = {\n messagesListProps: defaultListProps,\n composerProps: defaultComposerPros,\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 ariaLabel: 'Chat window',\n};\n\nexport const containerProps = {\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 ariaLabel: PropTypes.string\n .description('Aria Label description for chat container')\n .defaultValue(defaultProps.ariaLabel),\n};\n"],"names":["defaultProps","messagesListProps","defaultListProps","composerProps","defaultComposerPros","actionRef","undefined","autoScroll","device","isLoading","hasMoreItems","getMoreMessages","noop","bannerPosition","bannerProps","type","BANNER_TYPES","INFO","label","viewLabel","onView","onClose","sendingMessages","sendingText","ariaLabel","containerProps","PropTypes","object","description","defaultValue","bool","string","oneOf","func","oneOfType","arrayOf","number"],"mappings":";;;;;;IAgCaA,YAAgC,GAAG;EAC9CC,iBAAiB,EAAEC,cAD2B;EAE9CC,aAAa,EAAEC,mBAF+B;EAG9CC,SAAS,EAAEC,SAHmC;EAI9CC,UAAU,EAAE,KAJkC;EAK9CC,MAAM,EAAE,SALsC;EAM9CC,SAAS,EAAEH,SANmC;EAO9CI,YAAY,EAAEJ,SAPgC;EAQ9CK,eAAe,EAAEC,IAR6B;EAS9CC,cAAc,EAAEP,SAT8B;EAU9CQ,WAAW,EAAE;IACXC,IAAI,EAAEC,YAAY,CAACC,IADR;IAEXC,KAAK,EAAE,iBAFI;IAGXC,SAAS,EAAE,MAHA;IAIXC,MAAM,EAAER,IAJG;IAKXS,OAAO,EAAET;GAfmC;EAiB9CU,eAAe,EAAEhB,SAjB6B;EAkB9CiB,WAAW,EAAE,SAlBiC;EAmB9CC,SAAS,EAAE;AAnBmC;IAsBnCC,cAAc,GAAG;EAC5BxB,iBAAiB,EAAEyB,SAAS,CAACC,MAAV,CAChBC,WAD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c,CAED7B,YAAY,CAACsB,eAFZ,CAhCW;EAmC5BC,WAAW,EAAEG,SAAS,CAACK,MAAV,CACVH,WADU,CACE,kDADF,EAEVC,YAFU,CAEG7B,YAAY,CAACuB,WAFhB,CAnCe;EAsC5BlB,SAAS,EAAEqB,SAAS,CAACC,MAAV,CACRC,WADQ,oTAcRC,YAdQ,CAcK7B,YAAY,CAACK,SAdlB,CAtCiB;EAqD5BmB,SAAS,EAAEE,SAAS,CAACK,MAAV,CACRH,WADQ,CACI,2CADJ,EAERC,YAFQ,CAEK7B,YAAY,CAACwB,SAFlB;AArDiB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"styled.js","sources":["../../../../src/parts/chat-container/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\nimport { StyledTitleRightBubble, StyledTitleLeftBubble, StyleBodyWrapper } from '../bubble/styled';\nimport { StyledComposerInput } from '../chat-composer/styled';\nimport { Wrapper, Title, Time, Message } from '../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"],"names":["CONTAINER_WIDTH","StyledChatContainerContent","styled","Grid","props","theme","colors","neutral","StyledIndicatorContainer","div","linear","space","xxs","isLoading","MobileStyledChatContainerContent","StyledTitleLeftBubble","StyleBodyWrapper","StyledTitleRightBubble","Wrapper","Title","Message","Time","StyledComposerInput"],"mappings":";;;;;;;;;;;IAKaA,eAAe,GAAG;IAElBC,0BAA0B,gBAAGC,MAAM,CAACC,IAAD,CAAT;AAAA;AAAA,wFAExBH,eAFwB,EAIvB,UAACI,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBC,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CAJuB;IAO1BC,wBAAwB,gBAAGN,MAAM,CAACO,GAAV;AAAA;AAAA,wLAStB,UAACL,KAAD;AAAA,SAAY,CAACA,KAAK,CAACM,MAAP,GAAgBN,KAAK,CAACC,KAAN,CAAYM,KAAZ,CAAkBC,GAAlC,GAAwC,CAApD;AAAA,CATsB,EAYrB,UAACR,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBC,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CAZqB,EAajC,UAACH,KAAD;AAAA,SACAA,KAAK,CAACS,SAAN,KAAoB,KAApB,8GAOI,EARJ;AAAA,CAbiC,EAsBjC,UAACT,KAAD;AAAA,SACAA,KAAK,CAACS,SAAN,KAAoB,QAApB,kHAOI,EARJ;AAAA,CAtBiC;IAqCxBC,gCAAgC,gBAAGZ,MAAM,CAACD,0BAAD,CAAT;AAAA;AAAA,sOACzCc,qBADyC,EAEzCC,gBAFyC,EAMzCC,sBANyC,EAUzCC,OAVyC,EAezCC,KAfyC,EAgBzCC,OAhByC,EAqBzCC,IArByC,EAyBzCC,mBAzByC,EA6BzCd,wBA7ByC;;;;"}
1
+ {"version":3,"file":"styled.js","sources":["../../../../src/parts/chat-container/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\nimport { StyledTitleRightBubble, StyledTitleLeftBubble, StyleBodyWrapper } from '../bubble/styled';\nimport { StyledComposerInput } from '../chat-composer/styled';\nimport { Wrapper, Title, Time, Message } from '../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"],"names":["CONTAINER_WIDTH","StyledChatContainerContent","styled","Grid","props","theme","colors","neutral","StyledIndicatorContainer","div","linear","space","xxs","isLoading","MobileStyledChatContainerContent","StyledTitleLeftBubble","StyleBodyWrapper","StyledTitleRightBubble","Wrapper","Title","Message","Time","StyledComposerInput"],"mappings":";;;;;;;;;;;IAKaA,eAAe,GAAG;IAElBC,0BAA0B,gBAAGC,MAAM,CAACC,IAAD,CAAT;EAAA;AAAA,wFAExBH,eAFwB,EAIvB,UAACI,KAAD;EAAA,OAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBC,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CAJuB;IAO1BC,wBAAwB,gBAAGN,MAAM,CAACO,GAAV;EAAA;AAAA,wLAStB,UAACL,KAAD;EAAA,OAAY,CAACA,KAAK,CAACM,MAAP,GAAgBN,KAAK,CAACC,KAAN,CAAYM,KAAZ,CAAkBC,GAAlC,GAAwC,CAApD;AAAA,CATsB,EAYrB,UAACR,KAAD;EAAA,OAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBC,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CAZqB,EAajC,UAACH,KAAD;EAAA,OACAA,KAAK,CAACS,SAAN,KAAoB,KAApB,8GAOI,EARJ;AAAA,CAbiC,EAsBjC,UAACT,KAAD;EAAA,OACAA,KAAK,CAACS,SAAN,KAAoB,QAApB,kHAOI,EARJ;AAAA,CAtBiC;IAqCxBC,gCAAgC,gBAAGZ,MAAM,CAACD,0BAAD,CAAT;EAAA;AAAA,sOACzCc,qBADyC,EAEzCC,gBAFyC,EAMzCC,sBANyC,EAUzCC,OAVyC,EAezCC,KAfyC,EAgBzCC,OAhByC,EAqBzCC,IArByC,EAyBzCC,mBAzByC,EA6BzCd,wBA7ByC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChatContainerHeader.js","sources":["../../../../src/parts/chat-container-header/ChatContainerHeader.tsx"],"sourcesContent":["import React from 'react';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport {\n StyledChatContainerContentHeader,\n StyledChatContainerContentHeaderLabel,\n StyledChatContainerContentHeaderActions,\n} from './styled';\nimport { validHeaderChilds } from './helpers';\n\nexport const ChatContainerHeader: React.ComponentType = (props: any) => {\n const { title, floating, children } = props;\n\n return (\n <StyledChatContainerContentHeader\n alignItems=\"center\"\n cols={['minmax(calc(100% - 64px), 1fr)', children ? 'auto' : '0px']}\n floating={floating}\n role=\"heading\"\n >\n <StyledChatContainerContentHeaderLabel data-testid=\"chat-container-header-title\" pl=\"xxs\" pr=\"xxs\">\n <SimpleTruncatedTooltipText value={title} />\n </StyledChatContainerContentHeaderLabel>\n <StyledChatContainerContentHeaderActions\n cols={validHeaderChilds(children)}\n justifyContent=\"flex-end\"\n data-testid=\"chat-container-header-children\"\n >\n {children}\n </StyledChatContainerContentHeaderActions>\n </StyledChatContainerContentHeader>\n );\n};\n"],"names":["ChatContainerHeader","props","title","floating","children","validHeaderChilds"],"mappings":";;;;;;;IASaA,mBAAwC,GAAG,SAA3CA,mBAA2C,CAACC,KAAD,EAAgB;AACtE,MAAQC,KAAR,GAAsCD,KAAtC,CAAQC,KAAR;AAAA,MAAeC,QAAf,GAAsCF,KAAtC,CAAeE,QAAf;AAAA,MAAyBC,QAAzB,GAAsCH,KAAtC,CAAyBG,QAAzB;AAEA,sBACE,oBAAC,gCAAD;AACE,IAAA,UAAU,EAAC,QADb;AAEE,IAAA,IAAI,EAAE,CAAC,gCAAD,EAAmCA,QAAQ,GAAG,MAAH,GAAY,KAAvD,CAFR;AAGE,IAAA,QAAQ,EAAED,QAHZ;AAIE,IAAA,IAAI,EAAC;AAJP,kBAME,oBAAC,qCAAD;AAAuC,mBAAY,6BAAnD;AAAiF,IAAA,EAAE,EAAC,KAApF;AAA0F,IAAA,EAAE,EAAC;AAA7F,kBACE,oBAAC,0BAAD;AAA4B,IAAA,KAAK,EAAED;AAAnC,IADF,CANF,eASE,oBAAC,uCAAD;AACE,IAAA,IAAI,EAAEG,iBAAiB,CAACD,QAAD,CADzB;AAEE,IAAA,cAAc,EAAC,UAFjB;AAGE,mBAAY;AAHd,KAKGA,QALH,CATF,CADF;AAmBD;;;;"}
1
+ {"version":3,"file":"ChatContainerHeader.js","sources":["../../../../src/parts/chat-container-header/ChatContainerHeader.tsx"],"sourcesContent":["import React from 'react';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport {\n StyledChatContainerContentHeader,\n StyledChatContainerContentHeaderLabel,\n StyledChatContainerContentHeaderActions,\n} from './styled';\nimport { validHeaderChilds } from './helpers';\n\nexport const ChatContainerHeader: React.ComponentType = (props: any) => {\n const { title, floating, children } = props;\n\n return (\n <StyledChatContainerContentHeader\n alignItems=\"center\"\n cols={['minmax(calc(100% - 64px), 1fr)', children ? 'auto' : '0px']}\n floating={floating}\n role=\"heading\"\n >\n <StyledChatContainerContentHeaderLabel data-testid=\"chat-container-header-title\" pl=\"xxs\" pr=\"xxs\">\n <SimpleTruncatedTooltipText value={title} />\n </StyledChatContainerContentHeaderLabel>\n <StyledChatContainerContentHeaderActions\n cols={validHeaderChilds(children)}\n justifyContent=\"flex-end\"\n data-testid=\"chat-container-header-children\"\n >\n {children}\n </StyledChatContainerContentHeaderActions>\n </StyledChatContainerContentHeader>\n );\n};\n"],"names":["ChatContainerHeader","props","title","floating","children","validHeaderChilds"],"mappings":";;;;;;;IASaA,mBAAwC,GAAG,SAA3CA,mBAA2C,CAACC,KAAD,EAAgB;EACtE,IAAQC,KAAR,GAAsCD,KAAtC,CAAQC,KAAR;MAAeC,QAAf,GAAsCF,KAAtC,CAAeE,QAAf;MAAyBC,QAAzB,GAAsCH,KAAtC,CAAyBG,QAAzB;EAEA,oBACE,oBAAC,gCAAD;IACE,UAAU,EAAC,QADb;IAEE,IAAI,EAAE,CAAC,gCAAD,EAAmCA,QAAQ,GAAG,MAAH,GAAY,KAAvD,CAFR;IAGE,QAAQ,EAAED,QAHZ;IAIE,IAAI,EAAC;kBAEL,oBAAC,qCAAD;IAAuC,eAAY,6BAAnD;IAAiF,EAAE,EAAC,KAApF;IAA0F,EAAE,EAAC;kBAC3F,oBAAC,0BAAD;IAA4B,KAAK,EAAED;IADrC,CANF,eASE,oBAAC,uCAAD;IACE,IAAI,EAAEG,iBAAiB,CAACD,QAAD,CADzB;IAEE,cAAc,EAAC,UAFjB;IAGE,eAAY;KAEXA,QALH,CATF,CADF;AAmBD;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sources":["../../../../src/parts/chat-container-header/helpers.tsx"],"sourcesContent":["import React from 'react';\n\ninterface validParamT {\n childs: React.ReactChild | React.ReactFragment | React.ReactPortal;\n}\n\nexport const validHeaderChilds = (children: validParamT): any =>\n React.Children.toArray(children)\n .filter((e) => {\n if (Array.isArray(e.props.children)) {\n return false;\n }\n if (e.props.children === undefined && e.$$typeof.toString() === 'Symbol(react.element)') {\n return true;\n }\n return !!e.props.children;\n })\n .map(() => '32px');\n"],"names":["validHeaderChilds","children","React","Children","toArray","filter","e","Array","isArray","props","undefined","$$typeof","toString","map"],"mappings":";;IAMaA,iBAAiB,GAAG,SAApBA,iBAAoB,CAACC,QAAD;AAAA,SAC/BC,KAAK,CAACC,QAAN,CAAeC,OAAf,CAAuBH,QAAvB,EACGI,MADH,CACU,UAACC,CAAD,EAAO;AACb,QAAIC,KAAK,CAACC,OAAN,CAAcF,CAAC,CAACG,KAAF,CAAQR,QAAtB,CAAJ,EAAqC;AACnC,aAAO,KAAP;AACD;;AACD,QAAIK,CAAC,CAACG,KAAF,CAAQR,QAAR,KAAqBS,SAArB,IAAkCJ,CAAC,CAACK,QAAF,CAAWC,QAAX,OAA0B,uBAAhE,EAAyF;AACvF,aAAO,IAAP;AACD;;AACD,WAAO,CAAC,CAACN,CAAC,CAACG,KAAF,CAAQR,QAAjB;AACD,GATH,EAUGY,GAVH,CAUO;AAAA,WAAM,MAAN;AAAA,GAVP,CAD+B;AAAA;;;;"}
1
+ {"version":3,"file":"helpers.js","sources":["../../../../src/parts/chat-container-header/helpers.tsx"],"sourcesContent":["import React from 'react';\n\ninterface validParamT {\n childs: React.ReactChild | React.ReactFragment | React.ReactPortal;\n}\n\nexport const validHeaderChilds = (children: validParamT): any =>\n React.Children.toArray(children)\n .filter((e) => {\n if (Array.isArray(e.props.children)) {\n return false;\n }\n if (e.props.children === undefined && e.$$typeof.toString() === 'Symbol(react.element)') {\n return true;\n }\n return !!e.props.children;\n })\n .map(() => '32px');\n"],"names":["validHeaderChilds","children","React","Children","toArray","filter","e","Array","isArray","props","undefined","$$typeof","toString","map"],"mappings":";;IAMaA,iBAAiB,GAAG,SAApBA,iBAAoB,CAACC,QAAD;EAAA,OAC/BC,KAAK,CAACC,QAAN,CAAeC,OAAf,CAAuBH,QAAvB,EACGI,MADH,CACU,UAACC,CAAD,EAAO;IACb,IAAIC,KAAK,CAACC,OAAN,CAAcF,CAAC,CAACG,KAAF,CAAQR,QAAtB,CAAJ,EAAqC;MACnC,OAAO,KAAP;;;IAEF,IAAIK,CAAC,CAACG,KAAF,CAAQR,QAAR,KAAqBS,SAArB,IAAkCJ,CAAC,CAACK,QAAF,CAAWC,QAAX,OAA0B,uBAAhE,EAAyF;MACvF,OAAO,IAAP;;;IAEF,OAAO,CAAC,CAACN,CAAC,CAACG,KAAF,CAAQR,QAAjB;GARJ,EAUGY,GAVH,CAUO;IAAA,OAAM,MAAN;GAVP,CAD+B;AAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"styled.js","sources":["../../../../src/parts/chat-container-header/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\n\nexport const StyledChatContainerContentHeaderActions = styled(Grid)`\n max-width: 80px;\n`;\n\nexport const StyledChatContainerContentHeader = styled(Grid)`\n width: 100%;\n min-height: 48px;\n border-bottom: 1px solid ${(props) => props.theme.colors.neutral['200']};\n background: ${(props) => props.theme.colors.neutral['050']};\n ${StyledChatContainerContentHeaderActions} {\n & button {\n background: transparent;\n }\n }\n`;\n\nexport const StyledChatContainerContentHeaderLabel = styled(Grid)`\n justify-content: center;\n align-items: center;\n font-weight: bold;\n font-size: 18px;\n color: ${(props) => props.theme.colors.neutral['700']};\n`;\n"],"names":["StyledChatContainerContentHeaderActions","styled","Grid","StyledChatContainerContentHeader","props","theme","colors","neutral","StyledChatContainerContentHeaderLabel"],"mappings":";;;IAGaA,uCAAuC,gBAAGC,MAAM,CAACC,IAAD,CAAT;AAAA;AAAA;IAIvCC,gCAAgC,gBAAGF,MAAM,CAACC,IAAD,CAAT;AAAA;AAAA,wHAGhB,UAACE,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBC,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CAHgB,EAI7B,UAACH,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBC,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CAJ6B,EAKzCP,uCALyC;IAYhCQ,qCAAqC,gBAAGP,MAAM,CAACC,IAAD,CAAT;AAAA;AAAA,8FAKvC,UAACE,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBC,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CALuC;;;;"}
1
+ {"version":3,"file":"styled.js","sources":["../../../../src/parts/chat-container-header/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\n\nexport const StyledChatContainerContentHeaderActions = styled(Grid)`\n max-width: 80px;\n`;\n\nexport const StyledChatContainerContentHeader = styled(Grid)`\n width: 100%;\n min-height: 48px;\n border-bottom: 1px solid ${(props) => props.theme.colors.neutral['200']};\n background: ${(props) => props.theme.colors.neutral['050']};\n ${StyledChatContainerContentHeaderActions} {\n & button {\n background: transparent;\n }\n }\n`;\n\nexport const StyledChatContainerContentHeaderLabel = styled(Grid)`\n justify-content: center;\n align-items: center;\n font-weight: bold;\n font-size: 18px;\n color: ${(props) => props.theme.colors.neutral['700']};\n`;\n"],"names":["StyledChatContainerContentHeaderActions","styled","Grid","StyledChatContainerContentHeader","props","theme","colors","neutral","StyledChatContainerContentHeaderLabel"],"mappings":";;;IAGaA,uCAAuC,gBAAGC,MAAM,CAACC,IAAD,CAAT;EAAA;AAAA;IAIvCC,gCAAgC,gBAAGF,MAAM,CAACC,IAAD,CAAT;EAAA;AAAA,wHAGhB,UAACE,KAAD;EAAA,OAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBC,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CAHgB,EAI7B,UAACH,KAAD;EAAA,OAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBC,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CAJ6B,EAKzCP,uCALyC;IAYhCQ,qCAAqC,gBAAGP,MAAM,CAACC,IAAD,CAAT;EAAA;AAAA,8FAKvC,UAACE,KAAD;EAAA,OAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBC,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CALuC;;;;"}
@@ -9,9 +9,10 @@ import { ChatBubble } from '../bubble/ChatBubble.js';
9
9
  import { BUBBLE_TYPES } from '../bubble/props.js';
10
10
  import { MessageDelimiter } from '../message-delimiter/MessageDelimiter.js';
11
11
  import { SystemMessage } from '../system-message/SystemMessage.js';
12
- import { ListItem, StyledWrapperListItem, StyledWrapper, StyledChatContainerContentList, StyledChatContainerContentListScroll, StyledLoadMoreContainer } from './styled.js';
12
+ import { ListItem, StyledWrapperListItem, StyledWrapper, StyledChatContainerContentList, StyledChatContainerContentListScroll, StyledLoadMoreContainer, StyledNewMessagesHiddenContainer } from './styled.js';
13
13
  import { listProps, defaultProps } from './props.js';
14
14
  import { useValidateProps } from './config/useValidateProps.js';
15
+ import { useGetNewMessages } from './useGetNewMessages.js';
15
16
  import '@elliemae/ds-icons';
16
17
  import '../bubble/styled.js';
17
18
  import 'styled-components';
@@ -26,6 +27,7 @@ import '../message-delimiter/config/useValidateProps.js';
26
27
  import '../system-message/style.js';
27
28
  import '../system-message/props.js';
28
29
  import '../system-message/config/useValidateProps.js';
30
+ import '@babel/runtime/helpers/esm/slicedToArray';
29
31
 
30
32
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
31
33
 
@@ -81,6 +83,7 @@ var ChatContainerMessagesList = function ChatContainerMessagesList(props) {
81
83
  totalSize = _useVirtual.totalSize,
82
84
  virtualItems = _useVirtual.virtualItems;
83
85
 
86
+ var newMessages = useGetNewMessages(messages);
84
87
  var debouncedScroll = React.useMemo(function () {
85
88
  return debounce(function () {
86
89
  var _virtualListRef$curre2;
@@ -338,8 +341,6 @@ var ChatContainerMessagesList = function ChatContainerMessagesList(props) {
338
341
  return /*#__PURE__*/React.createElement(StyledWrapper, null, /*#__PURE__*/React.createElement(StyledChatContainerContentList, {
339
342
  "data-testid": "chat-thread-container",
340
343
  tabIndex: 0,
341
- "aria-live": "polite",
342
- "aria-relevant": "additions",
343
344
  ref: virtualListRef,
344
345
  role: "list",
345
346
  onKeyDown: handleListKey
@@ -353,7 +354,12 @@ var ChatContainerMessagesList = function ChatContainerMessagesList(props) {
353
354
  onClick: getMoreMessages,
354
355
  "data-testid": "ds-chat-load-more-btn",
355
356
  innerRef: loadMoreRef
356
- })) : null, render)));
357
+ })) : null, render)), /*#__PURE__*/React.createElement(StyledNewMessagesHiddenContainer, {
358
+ "aria-live": "polite",
359
+ "aria-hidden": "false"
360
+ }, newMessages.map(function (newMessage) {
361
+ return /*#__PURE__*/React.createElement("p", null, newMessage.title, " ", newMessage.time, " ", newMessage.body, " ", newMessage.errorMessage, " ", newMessage.helpMessage);
362
+ })));
357
363
  };
358
364
 
359
365
  ChatContainerMessagesList.propTypes = listProps;
@@ -1 +1 @@
1
- {"version":3,"file":"ChatContainerMessagesList.js","sources":["../../../../src/parts/chat-container-messages-list/ChatContainerMessagesList.tsx"],"sourcesContent":["/* eslint-disable complexity */\n/* 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 { debounce } from 'lodash';\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\ntype getPaddingT = {\n hasMoreItems: string | undefined;\n bannerPosition: string | undefined;\n isLoading: string | undefined;\n};\nconst getPadding = ({ hasMoreItems, bannerPosition, isLoading }: 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};\n\nconst ChatContainerMessagesList = (props: ChatContainerMessagesListProps): JSX.Element => {\n useValidateProps(props, ChatContainerMessagesListWithSchema.toTypescript());\n\n const {\n sendingText,\n bannerPosition,\n sendingMessages,\n messages,\n actionRef,\n onScrollEnds,\n getMoreMessages,\n hasMoreItems,\n isLoading,\n bannerRef,\n } = props;\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 debouncedScroll = React.useMemo(\n () =>\n debounce((): number[] => {\n console.log('debound');\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 setTimeout(() => {\n (virtualListRef.current.querySelector(`[data-index=\"${index}\"]`) as HTMLDivElement).focus();\n }, 300);\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 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 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 (hasMoreItems === 'top' && 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 checkPendingOnScroll = React.useCallback(() => {\n if (pendingOnScroll.current === true) onScrollStop();\n }, [onScrollStop]);\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 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\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 aria-relevant=\"additions\"\n ref={virtualListRef}\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 </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","bannerPosition","isLoading","padding","paddingStart","paddingEnd","some","item","ChatContainerMessagesList","props","useValidateProps","ChatContainerMessagesListWithSchema","toTypescript","sendingText","sendingMessages","messages","actionRef","onScrollEnds","getMoreMessages","bannerRef","pendingOnScroll","React","useRef","loadMoreRef","virtualListRef","useVirtual","size","length","parentRef","overscan","estimateSize","useCallback","vScroll","scrollToIndex","totalSize","virtualItems","debouncedScroll","useMemo","debounce","document","visibilityState","current","getBoundingClientRect","bottom","top","list","querySelectorAll","indexList","forEach","itemTop","itemPadding","push","dataset","index","onScrollStop","onlyFocus","setTimeout","querySelector","focus","scrollAndFocus","b","align","useEffect","a","getMessagesInView","focusToIndex","focusToIndexWithoutScroll","focusToList","handleKey","e","key","Number","currentTarget","stopPropagation","preventDefault","shiftKey","focusOnWrapper","handleListKey","activeElement","shift","pop","focusToComposer","checkPendingOnScroll","handlerCallback","localVirtualRef","onScroll","clearTimeout","addEventListener","removeEventListener","render","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,IAAMA,UAAU,GAAG,SAAbA,UAAa,OAA8D;AAAA,MAA3DC,YAA2D,QAA3DA,YAA2D;AAAA,MAA7CC,cAA6C,QAA7CA,cAA6C;AAAA,MAA7BC,SAA6B,QAA7BA,SAA6B;AAC/E,MAAMC,OAAO,GAAG;AACdC,IAAAA,YAAY,EAAE,CADA;AAEdC,IAAAA,UAAU,EAAE,CAAC;AAFC,GAAhB;AAIA,MAAI,CAACL,YAAD,EAAeC,cAAf,EAA+BC,SAA/B,EAA0CI,IAA1C,CAA+C,UAACC,IAAD;AAAA,WAAUA,IAAI,KAAK,KAAnB;AAAA,GAA/C,CAAJ,EAA8EJ,OAAO,CAACC,YAAR,GAAuB,EAAvB,CAA9E,KACK,IAAI,CAACJ,YAAD,EAAeC,cAAf,EAA+BC,SAA/B,EAA0CI,IAA1C,CAA+C,UAACC,IAAD;AAAA,WAAUA,IAAI,KAAK,QAAnB;AAAA,GAA/C,CAAJ,EAAiFJ,OAA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KGd,GAAG,CAACU,IAAJ,KAAaC,YAAY,CAACI,SAA1B,gBAAsC,oBAAC,gBAAD,EAAuBf,GAAvB,CAAtC,GAA+E,IALlF,EAMGA,GAAG,CAACU,IAAJ,KAAaC,YAAY,CAACK,MAA1B,gBAAmC,oBAAC,aAAD,EAAoBhB,GAApB,CAAnC,GAAyE,IAN5E,CAVF,CADF;AAqBD,KAjCD,CADF;AAAA,GADa,EAoCb,CAAC3D,YAAD,EAAepB,QAAf,EAAyBD,eAAzB,EAA0CsD,SAA1C,EAAqDvD,WAArD,CApCa,CAAf;AAuCA,sBACE,oBAAC,aAAD,qBACE,oBAAC,8BAAD;AACE,mBAAY,uBADd;AAEE,IAAA,QAAQ,EAAE,CAFZ;AAGE,iBAAU,QAHZ;AAIE,qBAAc,WAJhB;AAKE,IAAA,GAAG,EAAEW,cALP;AAME,IAAA,IAAI,EAAC,MANP;AAOE,IAAA,SAAS,EAAEqD;AAPb,kBASE,oBAAC,oCAAD;AAAsC,IAAA,MAAM,YAAK3C,SAAL;AAA5C,KACG,CAAChC,SAAD,IAAcF,YAAd,gBACC,oBAAC,uBAAD;AAAyB,IAAA,YAAY,EAAEA;AAAvC,kBACE,oBAAC,QAAD;AACE,IAAA,SAAS,EAAC,WADZ;AAEE,IAAA,UAAU,EAAC,WAFb;AAGE,IAAA,OAAO,EAAEkB,eAHX;AAIE,mBAAY,uBAJd;AAKE,IAAA,QAAQ,EAAEK;AALZ,IADF,CADD,GAUG,IAXN,EAYGkE,MAZH,CATF,CADF,CADF;AA4BD;;AAEDjF,yBAAyB,CAACuG,SAA1B,GAAsCC,SAAtC;AACAxG,yBAAyB,CAACyG,YAA1B,GAAyCA,YAAzC;IACMtG,mCAAmC,GAAGuG,QAAQ,CAAC1G,yBAAD;AACpDG,mCAAmC,CAACoG,SAApC,GAAgDC,SAAhD;;;;"}
1
+ {"version":3,"file":"ChatContainerMessagesList.js","sources":["../../../../src/parts/chat-container-messages-list/ChatContainerMessagesList.tsx"],"sourcesContent":["/* eslint-disable complexity */\n/* 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 { debounce } from 'lodash';\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 StyledNewMessagesHiddenContainer,\n} from './styled';\nimport { defaultProps, listProps, ChatContainerMessagesListProps } from './props';\nimport { useValidateProps } from './config/useValidateProps';\nimport { useGetNewMessages } from './useGetNewMessages';\n\ntype getPaddingT = {\n hasMoreItems: string | undefined;\n bannerPosition: string | undefined;\n isLoading: string | undefined;\n};\nconst getPadding = ({ hasMoreItems, bannerPosition, isLoading }: 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};\n\nconst ChatContainerMessagesList = (props: ChatContainerMessagesListProps): JSX.Element => {\n useValidateProps(props, ChatContainerMessagesListWithSchema.toTypescript());\n\n const {\n sendingText,\n bannerPosition,\n sendingMessages,\n messages,\n actionRef,\n onScrollEnds,\n getMoreMessages,\n hasMoreItems,\n isLoading,\n bannerRef,\n } = props;\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 console.log('debound');\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 setTimeout(() => {\n (virtualListRef.current.querySelector(`[data-index=\"${index}\"]`) as HTMLDivElement).focus();\n }, 300);\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 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 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 (hasMoreItems === 'top' && 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 checkPendingOnScroll = React.useCallback(() => {\n if (pendingOnScroll.current === true) onScrollStop();\n }, [onScrollStop]);\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 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\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 ref={virtualListRef}\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>\n {newMessage.title} {newMessage.time} {newMessage.body} {newMessage.errorMessage} {newMessage.helpMessage}\n </p>\n ))}\n </StyledNewMessagesHiddenContainer>\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","bannerPosition","isLoading","padding","paddingStart","paddingEnd","some","item","ChatContainerMessagesList","props","useValidateProps","ChatContainerMessagesListWithSchema","toTypescript","sendingText","sendingMessages","messages","actionRef","onScrollEnds","getMoreMessages","bannerRef","pendingOnScroll","React","useRef","loadMoreRef","virtualListRef","useVirtual","size","length","parentRef","overscan","estimateSize","useCallback","vScroll","scrollToIndex","totalSize","virtualItems","newMessages","useGetNewMessages","debouncedScroll","useMemo","debounce","document","visibilityState","current","getBoundingClientRect","bottom","top","list","querySelectorAll","indexList","forEach","itemTop","itemPadding","push","dataset","index","onScrollStop","onlyFocus","setTimeout","querySelector","focus","scrollAndFocus","b","align","useEffect","a","getMessagesInView","focusToIndex","focusToIndexWithoutScroll","focusToList","handleKey","e","key","Number","currentTarget","stopPropagation","preventDefault","shiftKey","focusOnWrapper","handleListKey","activeElement","shift","pop","focusToComposer","checkPendingOnScroll","handlerCallback","localVirtualRef","onScroll","clearTimeout","addEventListener","removeEventListener","render","map","virtualItem","measureRef","start","row","isSending","find","m","dsId","style","position","left","transform","width","type","BUBBLE_TYPES","SENDER","RECIPIENT","helpMessage","DELIMITER","SYSTEM","newMessage","title","time","body","errorMessage","propTypes","listProps","defaultProps","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,IAAMA,UAAU,GAAG,SAAbA,UAAa,OAA8D;EAAA,IAA3DC,YAA2D,QAA3DA,YAA2D;MAA7CC,cAA6C,QAA7CA,cAA6C;MAA7BC,SAA6B,QAA7BA,SAA6B;EAC/E,IAAMC,OAAO,GAAG;IACdC,YAAY,EAAE,CADA;IAEdC,UAAU,EAAE,CAAC;GAFf;EAIA,IAAI,CAACL,YAAD,EAAeC,cAAf,EAA+BC,SAA/B,EAA0CI,IAA1C,CAA+C,UAACC,IAAD;IAAA,OAAUA,IAAI,KAAK,KAAnB;GAA/C,CAAJ,EAA8EJ,OAAO,CAACC,YAAR,GAAuB,EAAvB,CAA9E,KACK,IAAI,CAACJ,YAAD,EAAeC,cAAf,EAA+BC,SAA/B,EAA0CI,IAA1C,CAA+C,UAACC,IAAD;IAAA,OAAUA,IAAI,KAAK,QAAnB;GAA/C,CAAJ,EAAiFJ,OAAO,CAACE,UAAR,GAAqB,EAArB;EACtF,OAAOF,OAAP;AACD,CARD;;IAUMK,yBAAyB,GAAG,S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ACf,+BACGA,UAAU,CAACC,KADd,OACsBD,UAAU,CAACE,IADjC,OACwCF,UAAU,CAACG,IADnD,OAC0DH,UAAU,CAACI,YADrE,OACoFJ,UAAU,CAACH,WAD/F,CADe;GAAhB,CADH,CAxBF,CADF;AAkCD;;AAEDtG,yBAAyB,CAAC8G,SAA1B,GAAsCC,SAAtC;AACA/G,yBAAyB,CAACgH,YAA1B,GAAyCA,YAAzC;IACM7G,mCAAmC,GAAG8G,QAAQ,CAACjH,yBAAD;AACpDG,mCAAmC,CAAC2G,SAApC,GAAgDC,SAAhD;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useValidateProps.js","sources":["../../../../../src/parts/chat-container-messages-list/config/useValidateProps.tsx"],"sourcesContent":["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { ChatContainerMessagesListProps } from '../props';\n\nexport const useValidateProps = (props: ChatContainerMessagesListProps, schema: unknown): void => {\n useValidateTypescriptPropTypes(props, schema);\n};\n"],"names":["useValidateProps","props","schema","useValidateTypescriptPropTypes"],"mappings":";;IAGaA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAAwCC,MAAxC,EAAkE;AAChGC,EAAAA,8BAA8B,CAACF,KAAD,EAAQC,MAAR,CAA9B;AACD;;;;"}
1
+ {"version":3,"file":"useValidateProps.js","sources":["../../../../../src/parts/chat-container-messages-list/config/useValidateProps.tsx"],"sourcesContent":["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { ChatContainerMessagesListProps } from '../props';\n\nexport const useValidateProps = (props: ChatContainerMessagesListProps, schema: unknown): void => {\n useValidateTypescriptPropTypes(props, schema);\n};\n"],"names":["useValidateProps","props","schema","useValidateTypescriptPropTypes"],"mappings":";;IAGaA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAAwCC,MAAxC,EAAkE;EAChGC,8BAA8B,CAACF,KAAD,EAAQC,MAAR,CAA9B;AACD;;;;"}
@@ -27,4 +27,6 @@ import '../system-message/config/useValidateProps.js';
27
27
  import './styled.js';
28
28
  import './props.js';
29
29
  import './config/useValidateProps.js';
30
+ import './useGetNewMessages.js';
31
+ import '@babel/runtime/helpers/esm/slicedToArray';
30
32
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"props.js","sources":["../../../../src/parts/chat-container-messages-list/props.ts"],"sourcesContent":["import { Ref } from 'react';\nimport { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\nimport { BubbleProps } from '../bubble/props';\n\ninterface ActionRef {\n scrollToIndex: (n: number, b: { align: 'end' | 'center' | 'start' }) => void;\n getMessagesInView: () => number[];\n}\nexport interface ChatContainerMessagesListProps {\n messages: BubbleProps[];\n actionRef: any;\n onScrollEnds: (indexList: number[]) => number[];\n isLoading?: 'top' | 'bottom';\n hasMoreItems?: 'top' | 'bottom';\n getMoreMessages: PropTypes.func;\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\nexport const defaultProps: ChatContainerMessagesListProps = {\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 listProps = {\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(defaultProps.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(defaultProps.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(defaultProps.getMoreMessages),\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};\n"],"names":["defaultProps","messages","actionRef","noop","onScrollEnds","getMoreMessages","sendingMessages","undefined","sendingText","bannerPosition","bannerRef","listProps","PropTypes","arrayOf","object","description","defaultValue","func","isLoading","oneOf","hasMoreItems","oneOfType","string","number"],"mappings":";;;IAyBaA,YAA4C,GAAG;AAC1DC,EAAAA,QAAQ,EAAE,EADgD;AAE1DC,EAAAA,SAAS,EAAEC,IAF+C;AAG1DC,EAAAA,YAAY,EAAE;AAAA,WAAM,EAAN;AAAA,GAH4C;AAI1DC,EAAAA,eAAe,EAAEF,IAJyC;AAK1DG,EAAAA,eAAe,EAAEC,SALyC;AAM1DC,EAAAA,WAAW,EAAE,SAN6C;AAO1DC,EAAAA,cAAc,EAAEF,SAP0C;AAQ1DG,EAAAA,SAAS,EAAEH;AAR+C;IAW/CI,SAAS,GAAG;AACvBV,EAAAA,QAAQ,EAAEW,SAAS,CAACC,OAAV,CAAkBD,SAAS,CAACE,MAA5B,EACPC,WADO,CACK,iFADL,EAEPC,YAFO,CAEMhB,YAAY,CAACC,QAFnB,CADa;AAIvBC,EAAAA,SAAS,EAAEU,SAAS,CAACE,MAAV,CACRC,WADQ,+WAeRC,YAfQ,CAeKhB,YAAY,CAACE,SAflB,CAJY;AAoBvBE,EAAAA,YAAY,EAAEQ,SAAS,CAACK,IAAV,CAAeF,WAAf,iCApBS;AAqBvBG,EAAAA,SAAS,EAAEN,SAAS,CAACO,KAAV,CAAgB,CAAC,KAAD,EAAQ,QAAR,EAAkBZ,SAAlB,CAAhB,EAA8CQ,WAA9C,CACT,4DADS,CArBY;AAwBvBK,EAAAA,YAAY,EAAER,SAAS,CAACO,KAAV,CAAgB,CAAC,KAAD,EAAQ,QAAR,EAAkBZ,SAAlB,CAAhB,EAA8CQ,WAA9C,CACZ,iEADY,CAxBS;AA2BvBV,EAAAA,eAAe,EAAEO,SAAS,CAACK,IAAV,CACdF,WADc,CACF,0CADE,EAEdC,YAFc,CAEDhB,YAAY,CAACK,eAFZ,CA3BM;AA8BvBC,EAAAA,eAAe,EAAEM,SAAS,CAACS,SAAV,CAAoB,CAACT,SAAS,CAACC,OAAV,CAAkBD,SAAS,CAACU,MAA5B,CAAD,EAAsCV,SAAS,CAACC,OAAV,CAAkBD,SAAS,CAACW,MAA5B,CAAtC,CAApB,EACdR,WADc,CACF,kCADE,EAEdC,YAFc,CAEDhB,YAAY,CAACM,eAFZ,CA9BM;AAiCvBE,EAAAA,WAAW,EAAEI,SAAS,CAACU,MAAV,CACVP,WADU,CACE,kDADF,EAEVC,YAFU,CAEGhB,YAAY,CAACQ,WAFhB;AAjCU;;;;"}
1
+ {"version":3,"file":"props.js","sources":["../../../../src/parts/chat-container-messages-list/props.ts"],"sourcesContent":["import { Ref } from 'react';\nimport { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\nimport { BubbleProps } from '../bubble/props';\n\ninterface ActionRef {\n scrollToIndex: (n: number, b: { align: 'end' | 'center' | 'start' }) => void;\n getMessagesInView: () => number[];\n}\nexport interface ChatContainerMessagesListProps {\n messages: BubbleProps[];\n actionRef: any;\n onScrollEnds: (indexList: number[]) => number[];\n isLoading?: 'top' | 'bottom';\n hasMoreItems?: 'top' | 'bottom';\n getMoreMessages: PropTypes.func;\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\nexport const defaultProps: ChatContainerMessagesListProps = {\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 listProps = {\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(defaultProps.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(defaultProps.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(defaultProps.getMoreMessages),\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};\n"],"names":["defaultProps","messages","actionRef","noop","onScrollEnds","getMoreMessages","sendingMessages","undefined","sendingText","bannerPosition","bannerRef","listProps","PropTypes","arrayOf","object","description","defaultValue","func","isLoading","oneOf","hasMoreItems","oneOfType","string","number"],"mappings":";;;IAyBaA,YAA4C,GAAG;EAC1DC,QAAQ,EAAE,EADgD;EAE1DC,SAAS,EAAEC,IAF+C;EAG1DC,YAAY,EAAE;IAAA,OAAM,EAAN;GAH4C;EAI1DC,eAAe,EAAEF,IAJyC;EAK1DG,eAAe,EAAEC,SALyC;EAM1DC,WAAW,EAAE,SAN6C;EAO1DC,cAAc,EAAEF,SAP0C;EAQ1DG,SAAS,EAAEH;AAR+C;IAW/CI,SAAS,GAAG;EACvBV,QAAQ,EAAEW,SAAS,CAACC,OAAV,CAAkBD,SAAS,CAACE,MAA5B,EACPC,WADO,CACK,iFADL,EAEPC,YAFO,CAEMhB,YAAY,CAACC,QAFnB,CADa;EAIvBC,SAAS,EAAEU,SAAS,CAACE,MAAV,CACRC,WADQ,+WAeRC,YAfQ,CAeKhB,YAAY,CAACE,SAflB,CAJY;EAoBvBE,YAAY,EAAEQ,SAAS,CAACK,IAAV,CAAeF,WAAf,iCApBS;EAqBvBG,SAAS,EAAEN,SAAS,CAACO,KAAV,CAAgB,CAAC,KAAD,EAAQ,QAAR,EAAkBZ,SAAlB,CAAhB,EAA8CQ,WAA9C,CACT,4DADS,CArBY;EAwBvBK,YAAY,EAAER,SAAS,CAACO,KAAV,CAAgB,CAAC,KAAD,EAAQ,QAAR,EAAkBZ,SAAlB,CAAhB,EAA8CQ,WAA9C,CACZ,iEADY,CAxBS;EA2BvBV,eAAe,EAAEO,SAAS,CAACK,IAAV,CACdF,WADc,CACF,0CADE,EAEdC,YAFc,CAEDhB,YAAY,CAACK,eAFZ,CA3BM;EA8BvBC,eAAe,EAAEM,SAAS,CAACS,SAAV,CAAoB,CAACT,SAAS,CAACC,OAAV,CAAkBD,SAAS,CAACU,MAA5B,CAAD,EAAsCV,SAAS,CAACC,OAAV,CAAkBD,SAAS,CAACW,MAA5B,CAAtC,CAApB,EACdR,WADc,CACF,kCADE,EAEdC,YAFc,CAEDhB,YAAY,CAACM,eAFZ,CA9BM;EAiCvBE,WAAW,EAAEI,SAAS,CAACU,MAAV,CACVP,WADU,CACE,kDADF,EAEVC,YAFU,CAEGhB,YAAY,CAACQ,WAFhB;AAjCU;;;;"}
@@ -30,13 +30,16 @@ var StyledChatContainerContentList = /*#__PURE__*/styled.div.withConfig({
30
30
  })(["width:100%;height:100%;padding:", ";padding-bottom:0;overflow-y:auto;overflow-x:hidden;"], function (props) {
31
31
  return props.theme.space.xs;
32
32
  });
33
- var StyledChatContainerContentListScroll = /*#__PURE__*/styled.div.withConfig({
33
+ var StyledNewMessagesHiddenContainer = /*#__PURE__*/styled.div.withConfig({
34
34
  componentId: "sc-1jhprzr-3"
35
+ })(["position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(100%);white-space:nowrap;"]);
36
+ var StyledChatContainerContentListScroll = /*#__PURE__*/styled.div.withConfig({
37
+ componentId: "sc-1jhprzr-4"
35
38
  })(["width:100%;height:", ";position:relative;"], function (props) {
36
39
  return props.height;
37
40
  });
38
41
  var StyledLoadMoreContainer = /*#__PURE__*/styled.div.withConfig({
39
- componentId: "sc-1jhprzr-4"
42
+ componentId: "sc-1jhprzr-5"
40
43
  })(["position:absolute;width:calc(100% + ", ");padding:", ";left:-", ";right:-", ";display:grid;justify-content:center;align-items:center;", " ", ""], function (props) {
41
44
  return props.theme.space.xxs;
42
45
  }, function (props) {
@@ -51,10 +54,10 @@ var StyledLoadMoreContainer = /*#__PURE__*/styled.div.withConfig({
51
54
  return props.hasMoreItems === 'bottom' ? 'bottom: 0;' : '';
52
55
  });
53
56
  var ListItem = /*#__PURE__*/styled.div.withConfig({
54
- componentId: "sc-1jhprzr-5"
57
+ componentId: "sc-1jhprzr-6"
55
58
  })(["&:focus,&:focus-visible{outline:none;&:after{content:'';display:block;position:absolute;top:0;left:-", ";pointer-events:none;border-radius:2px;background-color:#ebedf0;width:calc(100% + 24px);border:2px solid #1e79c2;height:100%;z-index:-1;}}"], function (props) {
56
59
  return props.theme.space.xxs;
57
60
  });
58
61
 
59
- export { ListItem, StyledChatContainerContentList, StyledChatContainerContentListScroll, StyledLoadMoreContainer, StyledWrapper, StyledWrapperListItem };
62
+ export { ListItem, StyledChatContainerContentList, StyledChatContainerContentListScroll, StyledLoadMoreContainer, StyledNewMessagesHiddenContainer, StyledWrapper, StyledWrapperListItem };
60
63
  //# sourceMappingURL=styled.js.map