@elliemae/ds-chat 3.0.0-next.4 → 3.0.0-next.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/dist/cjs/ChatDataTestids.js.map +1 -1
  2. package/dist/cjs/exported-related/bubble/ChatBubble.js +4 -4
  3. package/dist/cjs/exported-related/bubble/ChatBubble.js.map +2 -2
  4. package/dist/cjs/exported-related/bubble/ChatBubbleArrow.js.map +1 -1
  5. package/dist/cjs/exported-related/bubble/props.js +10 -10
  6. package/dist/cjs/exported-related/bubble/props.js.map +2 -2
  7. package/dist/cjs/exported-related/bubble/styled.js.map +1 -1
  8. package/dist/cjs/exported-related/chat-card/ChatCard.js +4 -4
  9. package/dist/cjs/exported-related/chat-card/ChatCard.js.map +2 -2
  10. package/dist/cjs/exported-related/chat-card/props.js +5 -5
  11. package/dist/cjs/exported-related/chat-card/props.js.map +2 -2
  12. package/dist/cjs/exported-related/chat-card/styled.js.map +1 -1
  13. package/dist/cjs/exported-related/chat-container-header/ChatContainerHeader.js +4 -4
  14. package/dist/cjs/exported-related/chat-container-header/ChatContainerHeader.js.map +2 -2
  15. package/dist/cjs/exported-related/chat-container-header/props.js +3 -3
  16. package/dist/cjs/exported-related/chat-container-header/props.js.map +2 -2
  17. package/dist/cjs/exported-related/chat-container-header/styled.js.map +1 -1
  18. package/dist/cjs/exported-related/chat-empty-state/ChatEmptyState.js +4 -4
  19. package/dist/cjs/exported-related/chat-empty-state/ChatEmptyState.js.map +2 -2
  20. package/dist/cjs/exported-related/chat-empty-state/props.js +3 -3
  21. package/dist/cjs/exported-related/chat-empty-state/props.js.map +2 -2
  22. package/dist/cjs/exported-related/chat-empty-state/styled.js.map +1 -1
  23. package/dist/cjs/exported-related/chat-sidebar/SideBarChat.js +4 -4
  24. package/dist/cjs/exported-related/chat-sidebar/SideBarChat.js.map +2 -2
  25. package/dist/cjs/exported-related/chat-sidebar/props.js.map +1 -1
  26. package/dist/cjs/exported-related/chat-sidebar/sidebar-button/SidebarButton.js.map +1 -1
  27. package/dist/cjs/exported-related/chat-sidebar/sidebar-button/props.js +6 -6
  28. package/dist/cjs/exported-related/chat-sidebar/sidebar-button/props.js.map +2 -2
  29. package/dist/cjs/exported-related/chat-sidebar/sidebar-button/styled.js.map +1 -1
  30. package/dist/cjs/exported-related/chat-sidebar/styled.js.map +1 -1
  31. package/dist/cjs/exported-related/floating-button/FloatingButton.js +4 -4
  32. package/dist/cjs/exported-related/floating-button/FloatingButton.js.map +2 -2
  33. package/dist/cjs/exported-related/floating-button/props.js.map +1 -1
  34. package/dist/cjs/exported-related/floating-container/styled.js.map +1 -1
  35. package/dist/cjs/exported-related/grid-influencer/InfluencerContainer.js.map +1 -1
  36. package/dist/cjs/exported-related/grid-influencer/styled.js.map +1 -1
  37. package/dist/cjs/exported-related/message-delimiter/MessageDelimiter.js +5 -5
  38. package/dist/cjs/exported-related/message-delimiter/MessageDelimiter.js.map +2 -2
  39. package/dist/cjs/exported-related/message-delimiter/props.js +6 -6
  40. package/dist/cjs/exported-related/message-delimiter/props.js.map +2 -2
  41. package/dist/cjs/exported-related/message-delimiter/styled.js.map +1 -1
  42. package/dist/cjs/exported-related/system-message/SystemMessage.js +4 -4
  43. package/dist/cjs/exported-related/system-message/SystemMessage.js.map +2 -2
  44. package/dist/cjs/exported-related/system-message/props.js.map +1 -1
  45. package/dist/cjs/exported-related/system-message/style.js.map +1 -1
  46. package/dist/cjs/exported-related/tile-button/TileButton.js +4 -4
  47. package/dist/cjs/exported-related/tile-button/TileButton.js.map +2 -2
  48. package/dist/cjs/exported-related/tile-button/props.js +20 -20
  49. package/dist/cjs/exported-related/tile-button/props.js.map +2 -2
  50. package/dist/cjs/exported-related/tile-button/styled.js.map +1 -1
  51. package/dist/cjs/parts/chat-composer/ChatContainerComposer.js +4 -4
  52. package/dist/cjs/parts/chat-composer/ChatContainerComposer.js.map +2 -2
  53. package/dist/cjs/parts/chat-composer/styled.js.map +1 -1
  54. package/dist/cjs/parts/chat-container/ChatContainer.js +5 -5
  55. package/dist/cjs/parts/chat-container/ChatContainer.js.map +2 -2
  56. package/dist/cjs/parts/chat-container/styled.js.map +1 -1
  57. package/dist/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js +5 -5
  58. package/dist/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +2 -2
  59. package/dist/cjs/parts/chat-container-messages-list/useGetNewMessages.js.map +1 -1
  60. package/dist/cjs/react-desc-prop-types.js +38 -38
  61. package/dist/cjs/react-desc-prop-types.js.map +2 -2
  62. package/dist/cjs/tests/utils.js.map +1 -1
  63. package/dist/esm/ChatDataTestids.js.map +1 -1
  64. package/dist/esm/exported-related/bubble/ChatBubble.js +1 -1
  65. package/dist/esm/exported-related/bubble/ChatBubble.js.map +2 -2
  66. package/dist/esm/exported-related/bubble/ChatBubbleArrow.js.map +1 -1
  67. package/dist/esm/exported-related/bubble/props.js +1 -1
  68. package/dist/esm/exported-related/bubble/props.js.map +2 -2
  69. package/dist/esm/exported-related/bubble/styled.js.map +1 -1
  70. package/dist/esm/exported-related/chat-card/ChatCard.js +1 -1
  71. package/dist/esm/exported-related/chat-card/ChatCard.js.map +2 -2
  72. package/dist/esm/exported-related/chat-card/props.js +1 -1
  73. package/dist/esm/exported-related/chat-card/props.js.map +2 -2
  74. package/dist/esm/exported-related/chat-card/styled.js.map +1 -1
  75. package/dist/esm/exported-related/chat-container-header/ChatContainerHeader.js +1 -1
  76. package/dist/esm/exported-related/chat-container-header/ChatContainerHeader.js.map +2 -2
  77. package/dist/esm/exported-related/chat-container-header/props.js +1 -1
  78. package/dist/esm/exported-related/chat-container-header/props.js.map +2 -2
  79. package/dist/esm/exported-related/chat-container-header/styled.js.map +1 -1
  80. package/dist/esm/exported-related/chat-empty-state/ChatEmptyState.js +1 -1
  81. package/dist/esm/exported-related/chat-empty-state/ChatEmptyState.js.map +2 -2
  82. package/dist/esm/exported-related/chat-empty-state/props.js +1 -1
  83. package/dist/esm/exported-related/chat-empty-state/props.js.map +2 -2
  84. package/dist/esm/exported-related/chat-empty-state/styled.js.map +1 -1
  85. package/dist/esm/exported-related/chat-sidebar/SideBarChat.js +1 -1
  86. package/dist/esm/exported-related/chat-sidebar/SideBarChat.js.map +2 -2
  87. package/dist/esm/exported-related/chat-sidebar/props.js.map +1 -1
  88. package/dist/esm/exported-related/chat-sidebar/sidebar-button/SidebarButton.js.map +1 -1
  89. package/dist/esm/exported-related/chat-sidebar/sidebar-button/props.js +1 -1
  90. package/dist/esm/exported-related/chat-sidebar/sidebar-button/props.js.map +2 -2
  91. package/dist/esm/exported-related/chat-sidebar/sidebar-button/styled.js.map +1 -1
  92. package/dist/esm/exported-related/chat-sidebar/styled.js.map +1 -1
  93. package/dist/esm/exported-related/floating-button/FloatingButton.js +1 -1
  94. package/dist/esm/exported-related/floating-button/FloatingButton.js.map +2 -2
  95. package/dist/esm/exported-related/floating-button/props.js.map +1 -1
  96. package/dist/esm/exported-related/floating-container/styled.js.map +1 -1
  97. package/dist/esm/exported-related/grid-influencer/InfluencerContainer.js.map +1 -1
  98. package/dist/esm/exported-related/grid-influencer/styled.js.map +1 -1
  99. package/dist/esm/exported-related/message-delimiter/MessageDelimiter.js +1 -1
  100. package/dist/esm/exported-related/message-delimiter/MessageDelimiter.js.map +2 -2
  101. package/dist/esm/exported-related/message-delimiter/props.js +1 -1
  102. package/dist/esm/exported-related/message-delimiter/props.js.map +2 -2
  103. package/dist/esm/exported-related/message-delimiter/styled.js.map +1 -1
  104. package/dist/esm/exported-related/system-message/SystemMessage.js +1 -1
  105. package/dist/esm/exported-related/system-message/SystemMessage.js.map +2 -2
  106. package/dist/esm/exported-related/system-message/props.js.map +1 -1
  107. package/dist/esm/exported-related/system-message/style.js.map +1 -1
  108. package/dist/esm/exported-related/tile-button/TileButton.js +1 -1
  109. package/dist/esm/exported-related/tile-button/TileButton.js.map +2 -2
  110. package/dist/esm/exported-related/tile-button/props.js +1 -1
  111. package/dist/esm/exported-related/tile-button/props.js.map +2 -2
  112. package/dist/esm/exported-related/tile-button/styled.js.map +1 -1
  113. package/dist/esm/parts/chat-composer/ChatContainerComposer.js +1 -1
  114. package/dist/esm/parts/chat-composer/ChatContainerComposer.js.map +2 -2
  115. package/dist/esm/parts/chat-composer/styled.js.map +1 -1
  116. package/dist/esm/parts/chat-container/ChatContainer.js +1 -1
  117. package/dist/esm/parts/chat-container/ChatContainer.js.map +2 -2
  118. package/dist/esm/parts/chat-container/styled.js.map +1 -1
  119. package/dist/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js +1 -1
  120. package/dist/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +2 -2
  121. package/dist/esm/parts/chat-container-messages-list/useGetNewMessages.js.map +1 -1
  122. package/dist/esm/react-desc-prop-types.js +1 -1
  123. package/dist/esm/react-desc-prop-types.js.map +2 -2
  124. package/dist/esm/tests/utils.js.map +1 -1
  125. package/package.json +15 -15
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/chat-composer/ChatContainerComposer.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\nimport React, { WeakValidationMap } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { PaperAirplane } from '@elliemae/ds-icons';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, describe } from '@elliemae/ds-props-helpers';\nimport {\n StyledChatContainerContentComposer,\n StyledComposerInput,\n StyledComposerButton,\n StyledCounterArea,\n StyledCounterErrorA11y,\n} from './styled';\n\nimport { DSChatT, ChatComposerPropTypes, defaultPropsComposer } from '../../react-desc-prop-types';\n// eslint-disable-next-line complexity\nconst ChatComposer: React.ComponentType<DSChatT.ComposerProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatT.ComposerProps>(props, defaultPropsComposer);\n useValidateTypescriptPropTypes<DSChatT.ComposerProps>(propsWithDefault, ChatComposerPropTypes);\n const {\n inputValue,\n onChange,\n onResize,\n onSend,\n onFocus,\n onBlur,\n onKeyDown,\n maxHeight = 300,\n placeholder,\n inputMaxLength,\n maxLengthMessage,\n ariaMaxLengthMessage,\n buttonDisabled,\n dataTestid,\n actionRef,\n } = propsWithDefault;\n\n const COMPOSER_MIN_HEIGHT = 32;\n const input = React.useRef<HTMLTextAreaElement>();\n const inputSize = React.useRef<HTMLTextAreaElement>();\n const inputSend = React.useRef<HTMLButtonElement>();\n const [height, setHeight] = React.useState(32);\n const internalMaxHeight = React.useMemo(() => maxHeight - 24, [maxHeight]);\n const [showScroll, setShowScroll] = React.useState(true);\n\n React.useEffect(() => {\n const newHeight =\n inputSize.current?.scrollHeight > internalMaxHeight ? internalMaxHeight : inputSize.current?.scrollHeight;\n if (newHeight !== height && newHeight > COMPOSER_MIN_HEIGHT) onResize(newHeight);\n setHeight(newHeight);\n setShowScroll(inputSize.current?.scrollHeight - inputSize.current?.clientHeight > 5);\n }, [inputValue, internalMaxHeight, height, onResize]);\n\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusToComposer = () => {\n input.current.focus();\n };\n actionRef.current.focusToSend = () => {\n inputSend.current.focus();\n };\n }\n }, [actionRef]);\n\n const handleChange = React.useCallback(\n (e) => {\n onChange(e.target.value);\n },\n [onChange],\n );\n const heightProps = { height, overflow: showScroll ? 'auto' : 'hidden' };\n\n const inputLength = String(inputValue || '').length;\n const hasError = React.useMemo(() => inputLength > inputMaxLength, [inputLength, inputMaxLength]);\n return (\n <StyledChatContainerContentComposer rows={['auto', '15px']} maxHeight={`${maxHeight}px`} data-testid={dataTestid}>\n <Grid\n cols={['1fr', '24px']}\n style={{ height: heightProps.height }}\n justifyContent=\"center\"\n alignItems=\"flex-end\"\n gutter=\"xxs\"\n >\n <StyledComposerInput\n ref={input}\n onChange={handleChange}\n style={{ ...heightProps }}\n value={inputValue}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n placeholder={placeholder}\n aria-label=\"Message to send\"\n data-testid=\"chat-composer-textarea\"\n name=\"chat-composer-textarea\"\n id=\"chat-composer-textarea\"\n />\n\n <Grid height=\"32px\" alignItems=\"center\">\n <StyledComposerButton\n buttonType=\"text\"\n icon={<PaperAirplane width={18} height={18} />}\n onClick={onSend}\n size=\"s\"\n disabled={!inputValue || buttonDisabled || hasError}\n data-testid=\"chat-composer-send-button\"\n aria-label=\"Send\"\n innerRef={inputSend}\n />\n </Grid>\n </Grid>\n <StyledComposerInput\n ref={inputSize}\n style={{\n height: 32,\n visibility: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n top: 0,\n width: input.current?.clientWidth,\n }}\n onChange={handleChange}\n value={inputValue}\n />\n <Grid cols={['1fr', '24px']} justifyContent=\"flex-end\" alignItems=\"center\" gutter=\"xxs\" pb=\"xxs\">\n <StyledCounterArea hasError={hasError} data-testid=\"composer-counter-area\">\n {inputMaxLength && hasError ? (\n <>\n <StyledCounterErrorA11y role=\"alert\">\n {ariaMaxLengthMessage ||\n `You have entered ${inputLength} characters and have exceeded the limit by ${\n inputLength - inputMaxLength\n }. Please limit to less than ${inputMaxLength} characters. `}\n </StyledCounterErrorA11y>\n {maxLengthMessage || `Please limit to less than ${inputMaxLength} characters. `}\n </>\n ) : (\n ''\n )}\n {inputMaxLength ? ` ${inputLength} / ${inputMaxLength}` : ''}\n </StyledCounterArea>\n <Grid />\n </Grid>\n </StyledChatContainerContentComposer>\n );\n};\n\nChatComposer.propTypes = ChatComposerPropTypes as WeakValidationMap<unknown>;\nconst ChatComposerWithSchema = describe(ChatComposer);\nChatComposerWithSchema.propTypes = ChatComposerPropTypes as WeakValidationMap<unknown>;\n\nexport { ChatComposer, ChatComposerWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAyC;AACzC,qBAAqB;AACr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B,wFACE,mDAAC,sCAAD;AAAA,IAAwB,MAAK;AAAA,KAC1B,wBACC,oBAAoB,yDAClB,cAAc,6CACe,gCAElC,oBAAoB,6BAA6B,iCAGpD,IAED,iBAAiB,IAAI,iBAAiB,mBAAmB,KAE5D,mDAAC,qBAAD;AAAA;AAMR,aAAa,YAAY;AACzB,MAAM,yBAAyB,sCAAS;AACxC,uBAAuB,YAAY;",
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport React, { WeakValidationMap } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { PaperAirplane } from '@elliemae/ds-icons';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, describe } from '@elliemae/ds-utilities';\nimport {\n StyledChatContainerContentComposer,\n StyledComposerInput,\n StyledComposerButton,\n StyledCounterArea,\n StyledCounterErrorA11y,\n} from './styled';\n\nimport { DSChatT, ChatComposerPropTypes, defaultPropsComposer } from '../../react-desc-prop-types';\n// eslint-disable-next-line complexity\nconst ChatComposer: React.ComponentType<DSChatT.ComposerProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatT.ComposerProps>(props, defaultPropsComposer);\n useValidateTypescriptPropTypes<DSChatT.ComposerProps>(propsWithDefault, ChatComposerPropTypes);\n const {\n inputValue,\n onChange,\n onResize,\n onSend,\n onFocus,\n onBlur,\n onKeyDown,\n maxHeight = 300,\n placeholder,\n inputMaxLength,\n maxLengthMessage,\n ariaMaxLengthMessage,\n buttonDisabled,\n dataTestid,\n actionRef,\n } = propsWithDefault;\n\n const COMPOSER_MIN_HEIGHT = 32;\n const input = React.useRef<HTMLTextAreaElement>();\n const inputSize = React.useRef<HTMLTextAreaElement>();\n const inputSend = React.useRef<HTMLButtonElement>();\n const [height, setHeight] = React.useState(32);\n const internalMaxHeight = React.useMemo(() => maxHeight - 24, [maxHeight]);\n const [showScroll, setShowScroll] = React.useState(true);\n\n React.useEffect(() => {\n const newHeight =\n inputSize.current?.scrollHeight > internalMaxHeight ? internalMaxHeight : inputSize.current?.scrollHeight;\n if (newHeight !== height && newHeight > COMPOSER_MIN_HEIGHT) onResize(newHeight);\n setHeight(newHeight);\n setShowScroll(inputSize.current?.scrollHeight - inputSize.current?.clientHeight > 5);\n }, [inputValue, internalMaxHeight, height, onResize]);\n\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusToComposer = () => {\n input.current.focus();\n };\n actionRef.current.focusToSend = () => {\n inputSend.current.focus();\n };\n }\n }, [actionRef]);\n\n const handleChange = React.useCallback(\n (e) => {\n onChange(e.target.value);\n },\n [onChange],\n );\n const heightProps = { height, overflow: showScroll ? 'auto' : 'hidden' };\n\n const inputLength = String(inputValue || '').length;\n const hasError = React.useMemo(() => inputLength > inputMaxLength, [inputLength, inputMaxLength]);\n return (\n <StyledChatContainerContentComposer rows={['auto', '15px']} maxHeight={`${maxHeight}px`} data-testid={dataTestid}>\n <Grid\n cols={['1fr', '24px']}\n style={{ height: heightProps.height }}\n justifyContent=\"center\"\n alignItems=\"flex-end\"\n gutter=\"xxs\"\n >\n <StyledComposerInput\n ref={input}\n onChange={handleChange}\n style={{ ...heightProps }}\n value={inputValue}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n placeholder={placeholder}\n aria-label=\"Message to send\"\n data-testid=\"chat-composer-textarea\"\n name=\"chat-composer-textarea\"\n id=\"chat-composer-textarea\"\n />\n\n <Grid height=\"32px\" alignItems=\"center\">\n <StyledComposerButton\n buttonType=\"text\"\n icon={<PaperAirplane width={18} height={18} />}\n onClick={onSend}\n size=\"s\"\n disabled={!inputValue || buttonDisabled || hasError}\n data-testid=\"chat-composer-send-button\"\n aria-label=\"Send\"\n innerRef={inputSend}\n />\n </Grid>\n </Grid>\n <StyledComposerInput\n ref={inputSize}\n style={{\n height: 32,\n visibility: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n top: 0,\n width: input.current?.clientWidth,\n }}\n onChange={handleChange}\n value={inputValue}\n />\n <Grid cols={['1fr', '24px']} justifyContent=\"flex-end\" alignItems=\"center\" gutter=\"xxs\" pb=\"xxs\">\n <StyledCounterArea hasError={hasError} data-testid=\"composer-counter-area\">\n {inputMaxLength && hasError ? (\n <>\n <StyledCounterErrorA11y role=\"alert\">\n {ariaMaxLengthMessage ||\n `You have entered ${inputLength} characters and have exceeded the limit by ${\n inputLength - inputMaxLength\n }. Please limit to less than ${inputMaxLength} characters. `}\n </StyledCounterErrorA11y>\n {maxLengthMessage || `Please limit to less than ${inputMaxLength} characters. `}\n </>\n ) : (\n ''\n )}\n {inputMaxLength ? ` ${inputLength} / ${inputMaxLength}` : ''}\n </StyledCounterArea>\n <Grid />\n </Grid>\n </StyledChatContainerContentComposer>\n );\n};\n\nChatComposer.propTypes = ChatComposerPropTypes as WeakValidationMap<unknown>;\nconst ChatComposerWithSchema = describe(ChatComposer);\nChatComposerWithSchema.propTypes = ChatComposerPropTypes as WeakValidationMap<unknown>;\n\nexport { ChatComposer, ChatComposerWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAyC;AACzC,qBAAqB;AACrB,sBAA8B;AAC9B,0BAAuF;AACvF,oBAMO;AAEP,mCAAqE;AAErE,MAAM,eAA2D,CAAC,UAAU;AAC1E,QAAM,mBAAmB,sDAAoD,OAAO,iDAAoB;AACxG,0DAAsD,kBAAkB,kDAAqB;AAC7F,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE;AAEJ,QAAM,sBAAsB;AAC5B,QAAM,QAAQ,qBAAM,OAA4B;AAChD,QAAM,YAAY,qBAAM,OAA4B;AACpD,Q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YAAY;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/chat-composer/styled.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "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", "import * as React from 'react';\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qB;AACrB,uBAAyB;AAIlB,MAAM,qCAAqC,sCAAO,mBAAI;AAAA;AAAA;AAAA,gBAG7C,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA,aACzC,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA;AAAA;AAAA,kBAGxB,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,gBAC/B,CAAC,UAAU,MAAM;AAAA;AAAA;AAI1B,MAAM,sBAAsB,iCAAO;AAAA,aAC7B,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAM9B,CAAC,UAA0B,OAAO,MAAM,WAAW,WAAW,GAAG,MAAM,aAAa,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAS9E,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAKrD,MAAM,uBAAuB,sCAAO,yBAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAQvC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA,kBAG9B,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAI/C,MAAM,oBAAoB,sCAAO,mBAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMxC,CAAC,UAAW,MAAM,WAAW,SAAS,MAAM,MAAM,OAAO,OAAO,UAAU;AAAA;AAAA;AAIvE,MAAM,yBAAyB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -50,7 +50,7 @@ __export(ChatContainer_exports, {
50
50
  var React = __toESM(require("react"));
51
51
  var import_react = __toESM(require("react"));
52
52
  var import_lodash = require("lodash");
53
- var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
53
+ var import_ds_utilities = require("@elliemae/ds-utilities");
54
54
  var import_ds_indeterminate_progress_indicator = __toESM(require("@elliemae/ds-indeterminate-progress-indicator"));
55
55
  var import_ds_banner = __toESM(require("@elliemae/ds-banner"));
56
56
  var import_chat_composer = require("../chat-composer");
@@ -58,9 +58,9 @@ var import_chat_container_messages_list = require("../chat-container-messages-li
58
58
  var import_react_desc_prop_types = require("../../react-desc-prop-types");
59
59
  var import_styled = require("./styled");
60
60
  const ChatContainer = (props) => {
61
- const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultProps);
62
- (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.ChatContainerPropTypes);
63
- const globalAttributes = (0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefault);
61
+ const propsWithDefault = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultProps);
62
+ (0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.ChatContainerPropTypes);
63
+ const globalAttributes = (0, import_ds_utilities.useGetGlobalAttributes)(propsWithDefault);
64
64
  const {
65
65
  sendingText,
66
66
  sendingMessages,
@@ -164,7 +164,7 @@ const ChatContainer = (props) => {
164
164
  })));
165
165
  };
166
166
  ChatContainer.propTypes = import_react_desc_prop_types.ChatContainerPropTypes;
167
- const ChatContainerWithSchema = (0, import_ds_props_helpers.describe)(ChatContainer);
167
+ const ChatContainerWithSchema = (0, import_ds_utilities.describe)(ChatContainer);
168
168
  ChatContainerWithSchema.propTypes = import_react_desc_prop_types.ChatContainerPropTypes;
169
169
  module.exports = __toCommonJS(ChatContainer_exports);
170
170
  //# sourceMappingURL=ChatContainer.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/chat-container/ChatContainer.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { WeakValidationMap } from 'react';\nimport { noop } from 'lodash';\nimport {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n describe,\n} from '@elliemae/ds-props-helpers';\n\nimport DSIndeterminateProgressIndicator from '@elliemae/ds-indeterminate-progress-indicator';\nimport DSBanner, { BANNER_TYPES } from '@elliemae/ds-banner';\nimport { ChatComposer } from '../chat-composer';\nimport { ChatContainerMessagesList } from '../chat-container-messages-list';\nimport { DSChatT, defaultProps, ChatContainerPropTypes } from '../../react-desc-prop-types';\n\nimport { StyledChatContainerContent, StyledIndicatorContainer, MobileStyledChatContainerContent } from './styled';\n\nconst ChatContainer: React.ComponentType<DSChatT.ContainerProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatT.ContainerProps>(props, defaultProps);\n useValidateTypescriptPropTypes<DSChatT.ContainerProps>(propsWithDefault, ChatContainerPropTypes);\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n\n const {\n sendingText,\n sendingMessages,\n bannerPosition,\n bannerProps,\n messagesListProps,\n composerProps,\n composerProps: { onResize: onComposerResize, onKeyDown: onComposerKeyDown },\n actionRef,\n device,\n isLoading,\n hasMoreItems,\n getMoreMessages,\n } = propsWithDefault;\n const bannerRef = React.useRef({ focusOnWrapper: noop, focusOnLink: noop });\n const containerRef = React.useRef<HTMLElement>();\n const listRef = React.useRef({ scrollToIndex: noop });\n\n const onResize = React.useCallback(\n (height: number) => {\n if (onComposerResize) onComposerResize(height);\n /*\n setTimeout is used to equal the animation duration from the \n composer text area when increase its size\n */\n setTimeout(() => {\n actionRef.current.scrollToIndex(messagesListProps.messages.length - 1, {\n align: 'start',\n });\n }, 50);\n },\n [onComposerResize, messagesListProps.messages, actionRef],\n );\n const Container = device === 'desktop' ? StyledChatContainerContent : MobileStyledChatContainerContent;\n const handleTabs = React.useCallback(\n (e: React.KeyboardEvent) => {\n if (onComposerKeyDown) onComposerKeyDown(e);\n else {\n const ref = actionRef || listRef;\n if (e.shiftKey && e.key === 'Tab') {\n if (messagesListProps.messages?.length > 0) {\n e.preventDefault();\n if (['top', 'bottom'].includes(bannerPosition)) {\n bannerRef.current.focusOnWrapper();\n } else {\n const last = ref.current.getMessagesInView().pop();\n ref.current?.focusToIndexWithoutScroll(last);\n }\n }\n }\n }\n },\n [actionRef, onComposerKeyDown, bannerPosition, messagesListProps.messages?.length],\n );\n\n // Map actions\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusOnBanner = bannerRef.current.focusOnWrapper;\n actionRef.current.focusOnBannerLink = bannerRef.current.focusOnLink;\n }\n }, [actionRef]);\n return (\n <Container {...globalAttributes} rows={['minmax(0, 1fr)', 'auto']} ref={containerRef} role=\"region\">\n <div style={{ position: 'relative', overflow: 'hidden' }}>\n <ChatContainerMessagesList\n {...messagesListProps}\n actionRef={actionRef || listRef}\n isLoading={isLoading}\n hasMoreItems={hasMoreItems}\n getMoreMessages={getMoreMessages}\n sendingMessages={sendingMessages}\n sendingText={sendingText}\n bannerPosition={bannerPosition}\n bannerRef={bannerRef}\n />\n {isLoading && ['top', 'bottom'].includes(isLoading) ? (\n <StyledIndicatorContainer isLoading={isLoading} data-testid=\"ds-chat-loading-indicator\">\n <DSIndeterminateProgressIndicator processing title=\"Loading\" />\n </StyledIndicatorContainer>\n ) : null}\n <StyledIndicatorContainer linear isLoading={bannerPosition}>\n <DSBanner\n showCloseButton\n label={bannerProps?.label || 'Unread messages'}\n containerProps={{ id: 'ds-chat-banner' }}\n actionLink={{\n label: bannerProps?.viewLabel || 'View',\n onClick: bannerProps?.onView,\n }}\n onClose={bannerProps?.onClose}\n isOpen\n type={bannerProps?.type || BANNER_TYPES.INFO}\n actionRef={bannerRef}\n />\n </StyledIndicatorContainer>\n {sendingMessages && sendingMessages.length > 0 ? (\n <StyledIndicatorContainer isLoading=\"bottom\" linear data-testid=\"ds-chat-loading-indicator\">\n <DSIndeterminateProgressIndicator processing title={sendingText} lineOnly />\n </StyledIndicatorContainer>\n ) : null}\n </div>\n <ChatComposer\n {...composerProps}\n onKeyDown={handleTabs}\n onResize={onResize}\n maxHeight={(containerRef.current?.clientHeight || 0) / 2}\n actionRef={actionRef || listRef}\n />\n </Container>\n );\n};\n\nChatContainer.propTypes = ChatContainerPropTypes as WeakValidationMap<unknown>;\nconst ChatContainerWithSchema = describe(ChatContainer);\nChatContainerWithSchema.propTypes = ChatContainerPropTypes as WeakValidationMap<unknown>;\n\nexport { ChatContainer, ChatContainerWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAyC;AACzC,oBAAqB;AACrB,8BAKO;AAEP,iDAA6C;AAC7C,uBAAuC;AACvC,2BAA6B;AAC7B,0CAA0C;AAC1C,mCAA8D;AAE9D,oBAAuG;AAEvG,MAAM,gBAA6D,CAAC,UAAU;AAC5E,QAAM,mBAAmB,0DAAqD,OAAO;AACrF,8DAAuD,kBAAkB;AACzE,QAAM,mBAAmB,oDAAuB;AAEhD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe,EAAE,UAAU,kBAAkB,WAAW;AAAA,IACxD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE;AACJ,QAAM,YAAY,qBAAM,OAAO,EAAE,gBAAgB,oBAAM,aAAa;AACpE,QAAM,eAAe,qBAAM;AAC3B,QAAM,UAAU,qBAAM,OAAO,EAAE,eAAe;AAE9C,QAAM,WAAW,qBAAM,YACrB,CAAC,WAAmB;AAClB,QAAI;AAAkB,uBAAiB;AAKvC,eAAW,MAAM;AACf,gBAAU,QAAQ,cAAc,kBAAkB,SAAS,SAAS,GAAG;AAAA,QACrE,OAAO;AAAA;AAAA,OAER;AAAA,KAEL,CAAC,kBAAkB,kBAAkB,UAAU;AAEjD,QAAM,YAAY,WAAW,YAAY,2CAA6B;AACtE,Q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AAE,IAAI;AAAA,IACtB,YAAY;AAAA,MACV,OAAO,aAAa,aAAa;AAAA,MACjC,SAAS,aAAa;AAAA;AAAA,IAExB,SAAS,aAAa;AAAA,IACtB,QAAM;AAAA,IACN,MAAM,aAAa,QAAQ,8BAAa;AAAA,IACxC,WAAW;AAAA,OAGd,mBAAmB,gBAAgB,SAAS,IAC3C,mDAAC,wCAAD;AAAA,IAA0B,WAAU;AAAA,IAAS,QAAM;AAAA,IAAC,eAAY;AAAA,KAC9D,mDAAC,oDAAD;AAAA,IAAkC,YAAU;AAAA,IAAC,OAAO;AAAA,IAAa,UAAQ;AAAA,QAEzE,OAEN,mDAAC,mCAAD,iCACM,gBADN;AAAA,IAEE,WAAW;AAAA,IACX;AAAA,IACA,WAAY,cAAa,SAAS,gBAAgB,KAAK;AAAA,IACvD,WAAW,aAAa;AAAA;AAAA;AAMhC,cAAc,YAAY;AAC1B,MAAM,0BAA0B,sCAAS;AACzC,wBAAwB,YAAY;",
4
+ "sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { WeakValidationMap } from 'react';\nimport { noop } from 'lodash';\nimport {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n describe,\n} from '@elliemae/ds-utilities';\n\nimport DSIndeterminateProgressIndicator from '@elliemae/ds-indeterminate-progress-indicator';\nimport DSBanner, { BANNER_TYPES } from '@elliemae/ds-banner';\nimport { ChatComposer } from '../chat-composer';\nimport { ChatContainerMessagesList } from '../chat-container-messages-list';\nimport { DSChatT, defaultProps, ChatContainerPropTypes } from '../../react-desc-prop-types';\n\nimport { StyledChatContainerContent, StyledIndicatorContainer, MobileStyledChatContainerContent } from './styled';\n\nconst ChatContainer: React.ComponentType<DSChatT.ContainerProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatT.ContainerProps>(props, defaultProps);\n useValidateTypescriptPropTypes<DSChatT.ContainerProps>(propsWithDefault, ChatContainerPropTypes);\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n\n const {\n sendingText,\n sendingMessages,\n bannerPosition,\n bannerProps,\n messagesListProps,\n composerProps,\n composerProps: { onResize: onComposerResize, onKeyDown: onComposerKeyDown },\n actionRef,\n device,\n isLoading,\n hasMoreItems,\n getMoreMessages,\n } = propsWithDefault;\n const bannerRef = React.useRef({ focusOnWrapper: noop, focusOnLink: noop });\n const containerRef = React.useRef<HTMLElement>();\n const listRef = React.useRef({ scrollToIndex: noop });\n\n const onResize = React.useCallback(\n (height: number) => {\n if (onComposerResize) onComposerResize(height);\n /*\n setTimeout is used to equal the animation duration from the \n composer text area when increase its size\n */\n setTimeout(() => {\n actionRef.current.scrollToIndex(messagesListProps.messages.length - 1, {\n align: 'start',\n });\n }, 50);\n },\n [onComposerResize, messagesListProps.messages, actionRef],\n );\n const Container = device === 'desktop' ? StyledChatContainerContent : MobileStyledChatContainerContent;\n const handleTabs = React.useCallback(\n (e: React.KeyboardEvent) => {\n if (onComposerKeyDown) onComposerKeyDown(e);\n else {\n const ref = actionRef || listRef;\n if (e.shiftKey && e.key === 'Tab') {\n if (messagesListProps.messages?.length > 0) {\n e.preventDefault();\n if (['top', 'bottom'].includes(bannerPosition)) {\n bannerRef.current.focusOnWrapper();\n } else {\n const last = ref.current.getMessagesInView().pop();\n ref.current?.focusToIndexWithoutScroll(last);\n }\n }\n }\n }\n },\n [actionRef, onComposerKeyDown, bannerPosition, messagesListProps.messages?.length],\n );\n\n // Map actions\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusOnBanner = bannerRef.current.focusOnWrapper;\n actionRef.current.focusOnBannerLink = bannerRef.current.focusOnLink;\n }\n }, [actionRef]);\n return (\n <Container {...globalAttributes} rows={['minmax(0, 1fr)', 'auto']} ref={containerRef} role=\"region\">\n <div style={{ position: 'relative', overflow: 'hidden' }}>\n <ChatContainerMessagesList\n {...messagesListProps}\n actionRef={actionRef || listRef}\n isLoading={isLoading}\n hasMoreItems={hasMoreItems}\n getMoreMessages={getMoreMessages}\n sendingMessages={sendingMessages}\n sendingText={sendingText}\n bannerPosition={bannerPosition}\n bannerRef={bannerRef}\n />\n {isLoading && ['top', 'bottom'].includes(isLoading) ? (\n <StyledIndicatorContainer isLoading={isLoading} data-testid=\"ds-chat-loading-indicator\">\n <DSIndeterminateProgressIndicator processing title=\"Loading\" />\n </StyledIndicatorContainer>\n ) : null}\n <StyledIndicatorContainer linear isLoading={bannerPosition}>\n <DSBanner\n showCloseButton\n label={bannerProps?.label || 'Unread messages'}\n containerProps={{ id: 'ds-chat-banner' }}\n actionLink={{\n label: bannerProps?.viewLabel || 'View',\n onClick: bannerProps?.onView,\n }}\n onClose={bannerProps?.onClose}\n isOpen\n type={bannerProps?.type || BANNER_TYPES.INFO}\n actionRef={bannerRef}\n />\n </StyledIndicatorContainer>\n {sendingMessages && sendingMessages.length > 0 ? (\n <StyledIndicatorContainer isLoading=\"bottom\" linear data-testid=\"ds-chat-loading-indicator\">\n <DSIndeterminateProgressIndicator processing title={sendingText} lineOnly />\n </StyledIndicatorContainer>\n ) : null}\n </div>\n <ChatComposer\n {...composerProps}\n onKeyDown={handleTabs}\n onResize={onResize}\n maxHeight={(containerRef.current?.clientHeight || 0) / 2}\n actionRef={actionRef || listRef}\n />\n </Container>\n );\n};\n\nChatContainer.propTypes = ChatContainerPropTypes as WeakValidationMap<unknown>;\nconst ChatContainerWithSchema = describe(ChatContainer);\nChatContainerWithSchema.propTypes = ChatContainerPropTypes as WeakValidationMap<unknown>;\n\nexport { ChatContainer, ChatContainerWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAyC;AACzC,oBAAqB;AACrB,0BAKO;AAEP,iDAA6C;AAC7C,uBAAuC;AACvC,2BAA6B;AAC7B,0CAA0C;AAC1C,mCAA8D;AAE9D,o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AA,KAC9D,mDAAC;AAAA,IAAiC,YAAU;AAAA,IAAC,OAAO;AAAA,IAAa,UAAQ;AAAA,GAAC,CAC5E,IACE,IACN,GACA,mDAAC,oEACK,gBADL;AAAA,IAEC,WAAW;AAAA,IACX;AAAA,IACA,WAAY,cAAa,SAAS,gBAAgB,KAAK;AAAA,IACvD,WAAW,aAAa;AAAA,IAC1B,CACF;AAEJ;AAEA,cAAc,YAAY;AAC1B,MAAM,0BAA0B,kCAAS,aAAa;AACtD,wBAAwB,YAAY;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/chat-container/styled.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\nimport { StyledTitleRightBubble, StyledTitleLeftBubble, StyleBodyWrapper } from '../../exported-related/bubble/styled';\nimport { StyledComposerInput } from '../chat-composer/styled';\nimport { Wrapper, Title, Time, Message } from '../../exported-related/system-message/style';\nexport const CONTAINER_WIDTH = 300;\n\nexport const StyledChatContainerContent = styled(Grid)`\n height: 100%;\n min-width: ${CONTAINER_WIDTH}px;\n overflow: hidden;\n background: ${(props) => props.theme.colors.neutral['050']};\n position: relative;\n`;\nexport const StyledIndicatorContainer = styled.div<{\n isLoading?: 'top' | 'bottom';\n linear?: boolean;\n}>`\n transition: 0.4s ease-in-out;\n position: absolute;\n visibility: hidden;\n pointer-events: none;\n width: 100%;\n padding: 0 ${(props) => (!props.linear ? props.theme.space.xxs : 0)};\n left: 0;\n right: 0;\n background: ${(props) => props.theme.colors.neutral['000']};\n ${(props) =>\n props.isLoading === 'top'\n ? `\n top: -41px;\n transform: translate(0, 41px);\n visibility: visible;\n pointer-events: auto;\n `\n : ''}\n ${(props) =>\n props.isLoading === 'bottom'\n ? `\n bottom: -41px;\n transform: translate(0, -41px);\n visibility: visible;\n pointer-events: auto;\n `\n : ''}\n\n & div,a {\n font-size: 13px;\n }\n`;\n\nexport const MobileStyledChatContainerContent = styled(StyledChatContainerContent)`\n ${StyledTitleLeftBubble},\n ${StyleBodyWrapper} {\n font-size: 16px;\n }\n\n ${StyledTitleRightBubble} {\n font-size: 13px;\n }\n\n ${Wrapper} {\n background-color: #fff;\n box-shadow: -0 1px 3px rgba(53, 60, 70, 0.8);\n }\n\n ${Title},\n ${Message} {\n font-size: 16px;\n text-align: left;\n }\n\n ${Time} {\n font-size: 13px;\n }\n\n ${StyledComposerInput} {\n font-size: 16px;\n }\n\n ${StyledIndicatorContainer} {\n font-size: 16px;\n }\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAmB;AACnB,qBAAqB;AACrB,oBAAgF;AAChF,qBAAoC;AACpC,mBAA8C;AACvC,MAAM,kBAAkB;AAExB,MAAM,6BAA6B,sCAAO;AAAA;AAAA,eAElC;AAAA;AAAA,gBAEC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAG/C,MAAM,2BAA2B,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAShC,CAAC,UAAW,CAAC,MAAM,SAAS,MAAM,MAAM,MAAM,MAAM;AAAA;AAAA;AAAA,gBAGnD,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA,IAClD,CAAC,UACD,MAAM,cAAc,QAChB;AAAA;AAAA;AAAA;AAAA;AAAA,MAMA;AAAA,IACJ,CAAC,UACD,MAAM,cAAc,WAChB;AAAA;AAAA;AAAA;AAAA;AAAA,MAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOD,MAAM,mCAAmC,sCAAO;AAAA,IACnD;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA;AAAA;AAAA;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAmB;AACnB,qBAAqB;AACrB,oBAAgF;AAChF,qBAAoC;AACpC,mBAA8C;AACvC,MAAM,kBAAkB;AAExB,MAAM,6BAA6B,sCAAO,mBAAI;AAAA;AAAA,eAEtC;AAAA;AAAA,gBAEC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAG/C,MAAM,2BAA2B,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAShC,CAAC,UAAW,CAAC,MAAM,SAAS,MAAM,MAAM,MAAM,MAAM;AAAA;AAAA;AAAA,gBAGnD,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA,IAClD,CAAC,UACD,MAAM,cAAc,QAChB;AAAA;AAAA;AAAA;AAAA;AAAA,MAMA;AAAA,IACJ,CAAC,UACD,MAAM,cAAc,WAChB;AAAA;AAAA;AAAA;AAAA;AAAA,MAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOD,MAAM,mCAAmC,sCAAO,0BAA0B;AAAA,IAC7E;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -49,7 +49,7 @@ __export(ChatContainerMessagesList_exports, {
49
49
  });
50
50
  var React = __toESM(require("react"));
51
51
  var import_react = __toESM(require("react"));
52
- var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
52
+ var import_ds_utilities = require("@elliemae/ds-utilities");
53
53
  var import_react_virtual = require("react-virtual");
54
54
  var import_ds_button = __toESM(require("@elliemae/ds-button"));
55
55
  var import_lodash = require("lodash");
@@ -71,9 +71,9 @@ const getPadding = ({ hasMoreItems, bannerPosition, isLoading }) => {
71
71
  return padding;
72
72
  };
73
73
  const ChatContainerMessagesList = (props) => {
74
- const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultPropsMessagesList);
75
- (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.ChatContainerMessagesListPropTypes);
76
- const globalAttributes = (0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefault);
74
+ const propsWithDefault = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultPropsMessagesList);
75
+ (0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.ChatContainerMessagesListPropTypes);
76
+ const globalAttributes = (0, import_ds_utilities.useGetGlobalAttributes)(propsWithDefault);
77
77
  const {
78
78
  sendingText,
79
79
  bannerPosition,
@@ -316,7 +316,7 @@ const ChatContainerMessagesList = (props) => {
316
316
  }, newMessage.title, " ", newMessage.time, " ", newMessage.body, " ", newMessage.errorMessage, " ", newMessage.helpMessage))));
317
317
  };
318
318
  ChatContainerMessagesList.propTypes = import_react_desc_prop_types.ChatContainerMessagesListPropTypes;
319
- const ChatContainerMessagesListWithSchema = (0, import_ds_props_helpers.describe)(ChatContainerMessagesList);
319
+ const ChatContainerMessagesListWithSchema = (0, import_ds_utilities.describe)(ChatContainerMessagesList);
320
320
  ChatContainerMessagesListWithSchema.propTypes = import_react_desc_prop_types.ChatContainerMessagesListPropTypes;
321
321
  module.exports = __toCommonJS(ChatContainerMessagesList_exports);
322
322
  //# sourceMappingURL=ChatContainerMessagesList.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/chat-container-messages-list/ChatContainerMessagesList.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable jsx-a11y/no-noninteractive-tabindex */\n/* eslint-disable max-lines */\nimport React, { CSSProperties, WeakValidationMap } from 'react';\nimport {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n describe,\n} from '@elliemae/ds-props-helpers';\nimport { useVirtual } from 'react-virtual';\nimport DSButton from '@elliemae/ds-button';\nimport { debounce } from 'lodash';\nimport { ChatBubble, BUBBLE_TYPES } from '../../exported-related/bubble';\nimport { MessageDelimiter } from '../../exported-related/message-delimiter';\nimport { SystemMessage } from '../../exported-related/system-message';\nimport {\n StyledWrapperListItem,\n StyledChatContainerContentList,\n StyledChatContainerContentListScroll,\n StyledWrapper,\n StyledLoadMoreContainer,\n ListItem,\n StyledNewMessagesHiddenContainer,\n} from './styled';\nimport { DSChatT, ChatContainerMessagesListPropTypes, defaultPropsMessagesList } from '../../react-desc-prop-types';\nimport { useGetNewMessages } from './useGetNewMessages';\n\nconst getPadding = ({ hasMoreItems, bannerPosition, isLoading }: DSChatT.GetPaddingT) => {\n const padding = {\n paddingStart: 0,\n paddingEnd: -5,\n };\n if ([hasMoreItems, bannerPosition, isLoading].some((item) => item === 'top')) padding.paddingStart = 42;\n else if ([hasMoreItems, bannerPosition, isLoading].some((item) => item === 'bottom')) padding.paddingEnd = 42;\n return padding;\n};\nconst ChatContainerMessagesList: React.ComponentType<DSChatT.MessagesListProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatT.MessagesListProps>(props, defaultPropsMessagesList);\n useValidateTypescriptPropTypes<DSChatT.MessagesListProps>(propsWithDefault, ChatContainerMessagesListPropTypes);\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n const {\n sendingText,\n bannerPosition,\n sendingMessages,\n messages,\n actionRef,\n onScrollEnds,\n getMoreMessages,\n hasMoreItems,\n isLoading,\n bannerRef,\n } = propsWithDefault;\n const pendingOnScroll = React.useRef(false);\n const loadMoreRef = React.useRef(null);\n const virtualListRef = React.useRef<HTMLDivElement>();\n // estimateSize should not be really required given what was stated on\n // https://github.com/tannerlinsley/react-virtual/issues/23\n const {\n scrollToIndex: vScroll,\n totalSize,\n virtualItems,\n } = useVirtual({\n size: messages?.length,\n parentRef: virtualListRef,\n overscan: 15,\n ...getPadding({ hasMoreItems, bannerPosition, isLoading }),\n estimateSize: React.useCallback(() => 80, []),\n });\n\n const newMessages = useGetNewMessages(messages);\n\n const debouncedScroll = React.useMemo(\n () =>\n debounce((): number[] => {\n if (document.visibilityState === 'hidden') {\n pendingOnScroll.current = true;\n return [];\n }\n if (!virtualListRef.current) return [];\n pendingOnScroll.current = false;\n const { bottom, top } = virtualListRef.current?.getBoundingClientRect();\n\n const list = virtualListRef.current.querySelectorAll(\n '[data-element=\"chat-element-list-item\"]',\n ) as NodeListOf<HTMLDivElement>;\n const indexList = [];\n list.forEach((item: HTMLElement) => {\n const { top: itemTop } = item.getBoundingClientRect();\n\n const itemPadding = 10;\n if (itemTop + itemPadding < bottom && itemTop + itemPadding > top) indexList.push(item.dataset.index);\n });\n if (onScrollEnds) onScrollEnds(indexList);\n return indexList;\n }, 500),\n [onScrollEnds],\n );\n\n const onScrollStop = React.useCallback(debouncedScroll, [debouncedScroll]);\n\n const onlyFocus = React.useCallback((index?: number) => {\n (virtualListRef.current.querySelector(`[data-index=\"${index}\"]`) as HTMLDivElement).focus();\n }, []);\n\n const scrollAndFocus = React.useCallback(\n (index: number, b = { align: 'center' }) => {\n vScroll(index, b);\n onlyFocus(index);\n onScrollStop();\n },\n [onScrollStop, onlyFocus, vScroll],\n );\n\n const checkPendingOnScroll = React.useCallback(() => {\n if (pendingOnScroll.current === true) onScrollStop();\n }, [onScrollStop]);\n\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.scrollToIndex = (a, b = { align: 'center' }) => {\n vScroll(a, b as any);\n onScrollStop();\n };\n actionRef.current.getMessagesInView = onScrollStop;\n onScrollStop(); // init useMemo due to debounce use.\n actionRef.current.focusToIndex = (a, b = { align: 'center' } as ScrollToOptions) => {\n scrollAndFocus(a, b);\n };\n actionRef.current.focusToIndexWithoutScroll = onlyFocus;\n actionRef.current.focusToList = () => {\n virtualListRef.current?.focus();\n };\n }\n }, [actionRef, onScrollStop, onlyFocus, scrollAndFocus, vScroll]);\n\n React.useEffect(() => {\n let handlerCallback = null;\n const localVirtualRef = virtualListRef.current;\n const onScroll = () => {\n if (handlerCallback) clearTimeout(handlerCallback);\n handlerCallback = setTimeout(onScrollStop, 300);\n };\n if (onScrollEnds) {\n virtualListRef.current.addEventListener('scroll', onScroll);\n }\n document.addEventListener('visibilitychange', checkPendingOnScroll);\n return () => {\n if (handlerCallback) clearTimeout(handlerCallback);\n if (onScrollEnds) localVirtualRef.removeEventListener('scroll', onScroll);\n document.removeEventListener('visibilitychange', checkPendingOnScroll);\n };\n }, [onScrollStop, onScrollEnds, checkPendingOnScroll]);\n\n const handleKey = React.useCallback(\n (e: React.KeyboardEvent) => {\n const { key } = e;\n const index = Number(e.currentTarget.dataset.index);\n e.stopPropagation();\n switch (key) {\n case 'ArrowUp':\n e.preventDefault();\n if (index > 0) {\n (virtualListRef.current?.querySelector(`[data-index=\"${index - 1}\"]`) as HTMLDivElement).focus();\n } else if (hasMoreItems === 'top') {\n loadMoreRef.current?.focus();\n }\n break;\n case 'ArrowDown':\n e.preventDefault();\n if (index < messages?.length - 1) {\n (virtualListRef.current?.querySelector(`[data-index=\"${index + 1}\"]`) as HTMLDivElement).focus();\n }\n break;\n case 'Home':\n e.preventDefault();\n scrollAndFocus(0);\n break;\n case 'End':\n e.preventDefault();\n scrollAndFocus(messages?.length - 1);\n break;\n case 'Tab':\n if (hasMoreItems === 'bottom' && !e.shiftKey) {\n e.preventDefault();\n loadMoreRef.current?.focus();\n } else if (hasMoreItems === 'top' && e.shiftKey) {\n e.preventDefault();\n loadMoreRef.current?.focus();\n } else if (!e.shiftKey) {\n if (bannerPosition) {\n e.preventDefault();\n bannerRef?.current?.focusOnWrapper();\n }\n } else {\n e.preventDefault();\n virtualListRef.current?.focus();\n }\n break;\n default:\n break;\n }\n },\n [bannerRef, hasMoreItems, messages?.length, bannerPosition, scrollAndFocus],\n );\n const handleListKey = React.useCallback(\n (e: React.KeyboardEvent) => {\n const { key } = e;\n switch (key) {\n case 'ArrowUp':\n e.preventDefault();\n if (document.activeElement !== loadMoreRef.current) {\n onlyFocus(onScrollStop()?.shift());\n }\n break;\n case 'ArrowDown':\n e.preventDefault();\n if (document.activeElement === loadMoreRef.current) {\n (virtualListRef.current.querySelector(`[data-index=\"0\"]`) as HTMLDivElement).focus();\n } else {\n onlyFocus(onScrollStop()?.pop());\n }\n break;\n case 'Home':\n e.preventDefault();\n scrollAndFocus(0);\n break;\n case 'End':\n e.preventDefault();\n scrollAndFocus(messages?.length - 1);\n break;\n case 'Tab':\n if (document.activeElement !== loadMoreRef.current) {\n if (hasMoreItems === 'bottom' && !e.shiftKey) {\n e.preventDefault();\n loadMoreRef.current?.focus();\n } else if (!e.shiftKey) {\n e.preventDefault();\n actionRef.current.focusToComposer();\n }\n } else if (!e.shiftKey) {\n e.preventDefault();\n actionRef.current.focusToComposer();\n } else {\n e.preventDefault();\n virtualListRef.current?.focus();\n }\n break;\n default:\n break;\n }\n },\n [actionRef, hasMoreItems, messages?.length, onScrollStop, onlyFocus, scrollAndFocus],\n );\n\n const render = React.useMemo(\n () =>\n virtualItems.map((virtualItem) => {\n const { index, measureRef, start } = virtualItem;\n const row = messages[index];\n const isSending = sendingMessages && sendingMessages.find((m) => m === row.dsId);\n const style: CSSProperties = {\n position: 'absolute',\n top: 0,\n left: 0,\n transform: `translateY(${start}px)`,\n width: '100%',\n };\n\n return (\n <ListItem\n data-element=\"chat-element-list-item\"\n data-index={index}\n key={`ds-chat-bubble-${index}-${row.dsId}-${row.type}`}\n style={style}\n ref={measureRef}\n tabIndex={-1}\n onKeyDown={handleKey}\n role=\"listitem\"\n >\n <StyledWrapperListItem type={row.type}>\n {row.type === BUBBLE_TYPES.SENDER || row.type === BUBBLE_TYPES.RECIPIENT ? (\n // eslint-disable-next-line eslint-comments/no-unlimited-disable\n <ChatBubble {...row} helpMessage={isSending ? sendingText : row.helpMessage} />\n ) : null}\n {row.type === BUBBLE_TYPES.DELIMITER ? <MessageDelimiter {...row} /> : null}\n {row.type === BUBBLE_TYPES.SYSTEM ? <SystemMessage {...row} /> : null}\n </StyledWrapperListItem>\n </ListItem>\n );\n }),\n [virtualItems, messages, sendingMessages, handleKey, sendingText],\n );\n\n return (\n <StyledWrapper {...globalAttributes}>\n <StyledChatContainerContentList\n data-testid=\"chat-thread-container\"\n tabIndex={0}\n ref={virtualListRef as React.RefObject<HTMLDivElement>}\n role=\"list\"\n onKeyDown={handleListKey}\n >\n <StyledChatContainerContentListScroll height={`${totalSize}px`}>\n {!isLoading && hasMoreItems ? (\n <StyledLoadMoreContainer hasMoreItems={hasMoreItems}>\n <DSButton\n labelText=\"Load More\"\n buttonType=\"secondary\"\n onClick={getMoreMessages}\n data-testid=\"ds-chat-load-more-btn\"\n innerRef={loadMoreRef}\n />\n </StyledLoadMoreContainer>\n ) : null}\n {render}\n </StyledChatContainerContentListScroll>\n </StyledChatContainerContentList>\n {/* We repeat the render with the new available messages */}\n <StyledNewMessagesHiddenContainer aria-live=\"polite\" aria-hidden=\"false\">\n {newMessages.map((newMessage) => (\n <p key={newMessage.dsId}>\n {newMessage.title} {newMessage.time} {newMessage.body} {newMessage.errorMessage} {newMessage.helpMessage}\n </p>\n ))}\n </StyledNewMessagesHiddenContainer>\n </StyledWrapper>\n );\n};\n\nChatContainerMessagesList.propTypes = ChatContainerMessagesListPropTypes as WeakValidationMap<unknown>;\nconst ChatContainerMessagesListWithSchema = describe(ChatContainerMessagesList);\nChatContainerMessagesListWithSchema.propTypes = ChatContainerMessagesListPropTypes as WeakValidationMap<unknown>;\n\nexport { ChatContainerMessagesList, ChatContainerMessagesListWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAAwD;AACxD,8BAKO;AACP,2BAA2B;AAC3B,uBAAqB;AACrB,oBAAyB;AACzB,oBAAyC;AACzC,+BAAiC;AACjC,4BAA8B;AAC9B,oBAQO;AACP,mCAAsF;AACtF,+BAAkC;AAElC,MAAM,aAAa,CAAC,EAAE,cAAc,gBAAgB,gBAAqC;AACvF,QAAM,UAAU;AAAA,IACd,cAAc;AAAA,IACd,YAAY;AAAA;AAEd,MAAI,CAAC,cAAc,gBAAgB,WAAW,KAAK,CAAC,SAAS,SAAS;AAAQ,YAAQ,eAAe;AAAA,WAC5F,CAAC,cAAc,gBAAgB,WAAW,KAAK,CAAC,SAAS,SAAS;AAAW,YAAQ,aAAa;AAC3G,SAAO;AAAA;AAET,MAAM,4BAA4E,CAAC,UAAU;AAC3F,QAAM,mBAAmB,0DAAwD,OAAO;AACxF,8DAA0D,kBAAkB;AAC5E,QAAM,mBAAmB,oDAAuB;AAChD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE;AACJ,QAAM,kBAAkB,qBAAM,OAAO;AACrC,QAAM,cAAc,qBAAM,OAAO;AACjC,QAAM,iBAAiB,qBAAM;AAG7B,QAAM;AAAA,IACJ,eAAe;AAAA,IACf;AAAA,IACA;AAAA,MACE,qCAAW;AAAA,IACb,MAAM,UAAU;AAAA,IAChB,WAAW;AAAA,IACX,UAAU;AAAA,KACP,WAAW,EAAE,cAAc,gBAAgB,eAJjC;AAAA,IAKb,cAAc,qBAAM,YAAY,MAAM,IAAI;AAAA;AAG5C,QAAM,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;AACrD,oCAAoC,YAAY;",
4
+ "sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable jsx-a11y/no-noninteractive-tabindex */\n/* eslint-disable max-lines */\nimport React, { CSSProperties, WeakValidationMap } from 'react';\nimport {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n describe,\n} from '@elliemae/ds-utilities';\nimport { useVirtual } from 'react-virtual';\nimport DSButton from '@elliemae/ds-button';\nimport { debounce } from 'lodash';\nimport { ChatBubble, BUBBLE_TYPES } from '../../exported-related/bubble';\nimport { MessageDelimiter } from '../../exported-related/message-delimiter';\nimport { SystemMessage } from '../../exported-related/system-message';\nimport {\n StyledWrapperListItem,\n StyledChatContainerContentList,\n StyledChatContainerContentListScroll,\n StyledWrapper,\n StyledLoadMoreContainer,\n ListItem,\n StyledNewMessagesHiddenContainer,\n} from './styled';\nimport { DSChatT, ChatContainerMessagesListPropTypes, defaultPropsMessagesList } from '../../react-desc-prop-types';\nimport { useGetNewMessages } from './useGetNewMessages';\n\nconst getPadding = ({ hasMoreItems, bannerPosition, isLoading }: DSChatT.GetPaddingT) => {\n const padding = {\n paddingStart: 0,\n paddingEnd: -5,\n };\n if ([hasMoreItems, bannerPosition, isLoading].some((item) => item === 'top')) padding.paddingStart = 42;\n else if ([hasMoreItems, bannerPosition, isLoading].some((item) => item === 'bottom')) padding.paddingEnd = 42;\n return padding;\n};\nconst ChatContainerMessagesList: React.ComponentType<DSChatT.MessagesListProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatT.MessagesListProps>(props, defaultPropsMessagesList);\n useValidateTypescriptPropTypes<DSChatT.MessagesListProps>(propsWithDefault, ChatContainerMessagesListPropTypes);\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n const {\n sendingText,\n bannerPosition,\n sendingMessages,\n messages,\n actionRef,\n onScrollEnds,\n getMoreMessages,\n hasMoreItems,\n isLoading,\n bannerRef,\n } = propsWithDefault;\n const pendingOnScroll = React.useRef(false);\n const loadMoreRef = React.useRef(null);\n const virtualListRef = React.useRef<HTMLDivElement>();\n // estimateSize should not be really required given what was stated on\n // https://github.com/tannerlinsley/react-virtual/issues/23\n const {\n scrollToIndex: vScroll,\n totalSize,\n virtualItems,\n } = useVirtual({\n size: messages?.length,\n parentRef: virtualListRef,\n overscan: 15,\n ...getPadding({ hasMoreItems, bannerPosition, isLoading }),\n estimateSize: React.useCallback(() => 80, []),\n });\n\n const newMessages = useGetNewMessages(messages);\n\n const debouncedScroll = React.useMemo(\n () =>\n debounce((): number[] => {\n if (document.visibilityState === 'hidden') {\n pendingOnScroll.current = true;\n return [];\n }\n if (!virtualListRef.current) return [];\n pendingOnScroll.current = false;\n const { bottom, top } = virtualListRef.current?.getBoundingClientRect();\n\n const list = virtualListRef.current.querySelectorAll(\n '[data-element=\"chat-element-list-item\"]',\n ) as NodeListOf<HTMLDivElement>;\n const indexList = [];\n list.forEach((item: HTMLElement) => {\n const { top: itemTop } = item.getBoundingClientRect();\n\n const itemPadding = 10;\n if (itemTop + itemPadding < bottom && itemTop + itemPadding > top) indexList.push(item.dataset.index);\n });\n if (onScrollEnds) onScrollEnds(indexList);\n return indexList;\n }, 500),\n [onScrollEnds],\n );\n\n const onScrollStop = React.useCallback(debouncedScroll, [debouncedScroll]);\n\n const onlyFocus = React.useCallback((index?: number) => {\n (virtualListRef.current.querySelector(`[data-index=\"${index}\"]`) as HTMLDivElement).focus();\n }, []);\n\n const scrollAndFocus = React.useCallback(\n (index: number, b = { align: 'center' }) => {\n vScroll(index, b);\n onlyFocus(index);\n onScrollStop();\n },\n [onScrollStop, onlyFocus, vScroll],\n );\n\n const checkPendingOnScroll = React.useCallback(() => {\n if (pendingOnScroll.current === true) onScrollStop();\n }, [onScrollStop]);\n\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.scrollToIndex = (a, b = { align: 'center' }) => {\n vScroll(a, b as any);\n onScrollStop();\n };\n actionRef.current.getMessagesInView = onScrollStop;\n onScrollStop(); // init useMemo due to debounce use.\n actionRef.current.focusToIndex = (a, b = { align: 'center' } as ScrollToOptions) => {\n scrollAndFocus(a, b);\n };\n actionRef.current.focusToIndexWithoutScroll = onlyFocus;\n actionRef.current.focusToList = () => {\n virtualListRef.current?.focus();\n };\n }\n }, [actionRef, onScrollStop, onlyFocus, scrollAndFocus, vScroll]);\n\n React.useEffect(() => {\n let handlerCallback = null;\n const localVirtualRef = virtualListRef.current;\n const onScroll = () => {\n if (handlerCallback) clearTimeout(handlerCallback);\n handlerCallback = setTimeout(onScrollStop, 300);\n };\n if (onScrollEnds) {\n virtualListRef.current.addEventListener('scroll', onScroll);\n }\n document.addEventListener('visibilitychange', checkPendingOnScroll);\n return () => {\n if (handlerCallback) clearTimeout(handlerCallback);\n if (onScrollEnds) localVirtualRef.removeEventListener('scroll', onScroll);\n document.removeEventListener('visibilitychange', checkPendingOnScroll);\n };\n }, [onScrollStop, onScrollEnds, checkPendingOnScroll]);\n\n const handleKey = React.useCallback(\n (e: React.KeyboardEvent) => {\n const { key } = e;\n const index = Number(e.currentTarget.dataset.index);\n e.stopPropagation();\n switch (key) {\n case 'ArrowUp':\n e.preventDefault();\n if (index > 0) {\n (virtualListRef.current?.querySelector(`[data-index=\"${index - 1}\"]`) as HTMLDivElement).focus();\n } else if (hasMoreItems === 'top') {\n loadMoreRef.current?.focus();\n }\n break;\n case 'ArrowDown':\n e.preventDefault();\n if (index < messages?.length - 1) {\n (virtualListRef.current?.querySelector(`[data-index=\"${index + 1}\"]`) as HTMLDivElement).focus();\n }\n break;\n case 'Home':\n e.preventDefault();\n scrollAndFocus(0);\n break;\n case 'End':\n e.preventDefault();\n scrollAndFocus(messages?.length - 1);\n break;\n case 'Tab':\n if (hasMoreItems === 'bottom' && !e.shiftKey) {\n e.preventDefault();\n loadMoreRef.current?.focus();\n } else if (hasMoreItems === 'top' && e.shiftKey) {\n e.preventDefault();\n loadMoreRef.current?.focus();\n } else if (!e.shiftKey) {\n if (bannerPosition) {\n e.preventDefault();\n bannerRef?.current?.focusOnWrapper();\n }\n } else {\n e.preventDefault();\n virtualListRef.current?.focus();\n }\n break;\n default:\n break;\n }\n },\n [bannerRef, hasMoreItems, messages?.length, bannerPosition, scrollAndFocus],\n );\n const handleListKey = React.useCallback(\n (e: React.KeyboardEvent) => {\n const { key } = e;\n switch (key) {\n case 'ArrowUp':\n e.preventDefault();\n if (document.activeElement !== loadMoreRef.current) {\n onlyFocus(onScrollStop()?.shift());\n }\n break;\n case 'ArrowDown':\n e.preventDefault();\n if (document.activeElement === loadMoreRef.current) {\n (virtualListRef.current.querySelector(`[data-index=\"0\"]`) as HTMLDivElement).focus();\n } else {\n onlyFocus(onScrollStop()?.pop());\n }\n break;\n case 'Home':\n e.preventDefault();\n scrollAndFocus(0);\n break;\n case 'End':\n e.preventDefault();\n scrollAndFocus(messages?.length - 1);\n break;\n case 'Tab':\n if (document.activeElement !== loadMoreRef.current) {\n if (hasMoreItems === 'bottom' && !e.shiftKey) {\n e.preventDefault();\n loadMoreRef.current?.focus();\n } else if (!e.shiftKey) {\n e.preventDefault();\n actionRef.current.focusToComposer();\n }\n } else if (!e.shiftKey) {\n e.preventDefault();\n actionRef.current.focusToComposer();\n } else {\n e.preventDefault();\n virtualListRef.current?.focus();\n }\n break;\n default:\n break;\n }\n },\n [actionRef, hasMoreItems, messages?.length, onScrollStop, onlyFocus, scrollAndFocus],\n );\n\n const render = React.useMemo(\n () =>\n virtualItems.map((virtualItem) => {\n const { index, measureRef, start } = virtualItem;\n const row = messages[index];\n const isSending = sendingMessages && sendingMessages.find((m) => m === row.dsId);\n const style: CSSProperties = {\n position: 'absolute',\n top: 0,\n left: 0,\n transform: `translateY(${start}px)`,\n width: '100%',\n };\n\n return (\n <ListItem\n data-element=\"chat-element-list-item\"\n data-index={index}\n key={`ds-chat-bubble-${index}-${row.dsId}-${row.type}`}\n style={style}\n ref={measureRef}\n tabIndex={-1}\n onKeyDown={handleKey}\n role=\"listitem\"\n >\n <StyledWrapperListItem type={row.type}>\n {row.type === BUBBLE_TYPES.SENDER || row.type === BUBBLE_TYPES.RECIPIENT ? (\n // eslint-disable-next-line eslint-comments/no-unlimited-disable\n <ChatBubble {...row} helpMessage={isSending ? sendingText : row.helpMessage} />\n ) : null}\n {row.type === BUBBLE_TYPES.DELIMITER ? <MessageDelimiter {...row} /> : null}\n {row.type === BUBBLE_TYPES.SYSTEM ? <SystemMessage {...row} /> : null}\n </StyledWrapperListItem>\n </ListItem>\n );\n }),\n [virtualItems, messages, sendingMessages, handleKey, sendingText],\n );\n\n return (\n <StyledWrapper {...globalAttributes}>\n <StyledChatContainerContentList\n data-testid=\"chat-thread-container\"\n tabIndex={0}\n ref={virtualListRef as React.RefObject<HTMLDivElement>}\n role=\"list\"\n onKeyDown={handleListKey}\n >\n <StyledChatContainerContentListScroll height={`${totalSize}px`}>\n {!isLoading && hasMoreItems ? (\n <StyledLoadMoreContainer hasMoreItems={hasMoreItems}>\n <DSButton\n labelText=\"Load More\"\n buttonType=\"secondary\"\n onClick={getMoreMessages}\n data-testid=\"ds-chat-load-more-btn\"\n innerRef={loadMoreRef}\n />\n </StyledLoadMoreContainer>\n ) : null}\n {render}\n </StyledChatContainerContentListScroll>\n </StyledChatContainerContentList>\n {/* We repeat the render with the new available messages */}\n <StyledNewMessagesHiddenContainer aria-live=\"polite\" aria-hidden=\"false\">\n {newMessages.map((newMessage) => (\n <p key={newMessage.dsId}>\n {newMessage.title} {newMessage.time} {newMessage.body} {newMessage.errorMessage} {newMessage.helpMessage}\n </p>\n ))}\n </StyledNewMessagesHiddenContainer>\n </StyledWrapper>\n );\n};\n\nChatContainerMessagesList.propTypes = ChatContainerMessagesListPropTypes as WeakValidationMap<unknown>;\nconst ChatContainerMessagesListWithSchema = describe(ChatContainerMessagesList);\nChatContainerMessagesListWithSchema.propTypes = ChatContainerMessagesListPropTypes as WeakValidationMap<unknown>;\n\nexport { ChatContainerMessagesList, ChatContainerMessagesListWithSchema };\n", "import * as React from 'react';\nexport {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B,IAAK,IAAK,MACtE,IAAI,SAAS,2BAAa,SAAS,mDAAC,wDAAkB,IAAK,IAAK,IACnE,CACF;AAAA,EAEJ,CAAC,GACH,CAAC,cAAc,UAAU,iBAAiB,WAAW,WAAW,CAClE;AAEA,SACE,mDAAC,gDAAkB,mBACjB,mDAAC;AAAA,IACC,eAAY;AAAA,IACZ,UAAU;AAAA,IACV,KAAK;AAAA,IACL,MAAK;AAAA,IACL,WAAW;AAAA,KAEX,mDAAC;AAAA,IAAqC,QAAQ,GAAG;AAAA,KAC9C,CAAC,aAAa,eACb,mDAAC;AAAA,IAAwB;AAAA,KACvB,mDAAC;AAAA,IACC,WAAU;AAAA,IACV,YAAW;AAAA,IACX,SAAS;AAAA,IACT,eAAY;AAAA,IACZ,UAAU;AAAA,GACZ,CACF,IACE,MACH,MACH,CACF,GAEA,mDAAC;AAAA,IAAiC,aAAU;AAAA,IAAS,eAAY;AAAA,KAC9D,YAAY,IAAI,CAAC,eAChB,mDAAC;AAAA,IAAE,KAAK,WAAW;AAAA,KAChB,WAAW,OAAM,KAAE,WAAW,MAAK,KAAE,WAAW,MAAK,KAAE,WAAW,cAAa,KAAE,WAAW,WAC/F,CACD,CACH,CACF;AAEJ;AAEA,0BAA0B,YAAY;AACtC,MAAM,sCAAsC,kCAAS,yBAAyB;AAC9E,oCAAoC,YAAY;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/chat-container-messages-list/useGetNewMessages.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { useMemo, useState } from 'react';\nimport { BubbleProps } from '../bubble/props';\n\nexport const useGetNewMessages = (messages: BubbleProps[]) => {\n const [seenMessages, setSeenMessages] = useState<Record<BubbleProps['dsId'], true>>({});\n const newMessages = useMemo(() => {\n const list: BubbleProps[] = [];\n messages.forEach((message) => {\n if (!(message.dsId in seenMessages)) {\n list.push(message);\n }\n });\n setSeenMessages(Object.fromEntries(messages.map((m) => [m.dsId, true])));\n return list;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [messages]);\n\n return newMessages;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkC;AAG3B,MAAM,oBAAoB,CAAC,aAA4B;AAC5D,QAAM,CAAC,cAAc,mBAAmB,2BAA4C;AACpF,QAAM,cAAc,0BAAQ,MAAM;AAChC,UAAM,OAAsB;AAC5B,aAAS,QAAQ,CAAC,YAAY;AAC5B,UAAI,CAAE,SAAQ,QAAQ,eAAe;AACnC,aAAK,KAAK;AAAA;AAAA;AAGd,oBAAgB,OAAO,YAAY,SAAS,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM;AAChE,WAAO;AAAA,KAEN,CAAC;AAEJ,SAAO;AAAA;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkC;AAG3B,MAAM,oBAAoB,CAAC,aAA4B;AAC5D,QAAM,CAAC,cAAc,mBAAmB,2BAA4C,CAAC,CAAC;AACtF,QAAM,cAAc,0BAAQ,MAAM;AAChC,UAAM,OAAsB,CAAC;AAC7B,aAAS,QAAQ,CAAC,YAAY;AAC5B,UAAI,CAAE,SAAQ,QAAQ,eAAe;AACnC,aAAK,KAAK,OAAO;AAAA,MACnB;AAAA,IACF,CAAC;AACD,oBAAgB,OAAO,YAAY,SAAS,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC;AACvE,WAAO;AAAA,EAET,GAAG,CAAC,QAAQ,CAAC;AAEb,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -53,7 +53,7 @@ __export(react_desc_prop_types_exports, {
53
53
  });
54
54
  var React = __toESM(require("react"));
55
55
  var import_lodash = require("lodash");
56
- var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
56
+ var import_ds_utilities = require("@elliemae/ds-utilities");
57
57
  var import_ds_banner = require("@elliemae/ds-banner");
58
58
  const defaultPropsComposer = {
59
59
  placeholder: "Type your message",
@@ -73,21 +73,21 @@ const defaultPropsComposer = {
73
73
  actionRef: void 0
74
74
  };
75
75
  const ChatComposerPropTypes = {
76
- placeholder: import_ds_props_helpers.PropTypes.string.description("Input Placeholder").defaultValue(defaultPropsComposer.placeholder),
77
- inputValue: import_ds_props_helpers.PropTypes.string.description("Input value").defaultValue(defaultPropsComposer.inputValue),
78
- ariaMaxLengthMessage: import_ds_props_helpers.PropTypes.string.description("Aria message for Max length message when exceeded").defaultValue(defaultPropsComposer.maxLengthMessage),
79
- maxLengthMessage: import_ds_props_helpers.PropTypes.string.description("Max length message").defaultValue(defaultPropsComposer.maxLengthMessage),
80
- onChange: import_ds_props_helpers.PropTypes.func.description("Called when the user types").defaultValue(defaultPropsComposer.onChange),
81
- onResize: import_ds_props_helpers.PropTypes.func.description("Called the input changes his height").defaultValue(defaultPropsComposer.onResize),
82
- onSend: import_ds_props_helpers.PropTypes.func.description("Called when the click send").defaultValue(defaultPropsComposer.onSend),
83
- onFocus: import_ds_props_helpers.PropTypes.func.description("Input focus").defaultValue(defaultPropsComposer.onFocus),
84
- onBlur: import_ds_props_helpers.PropTypes.func.description("Input blur").defaultValue(defaultPropsComposer.onBlur),
85
- onKeyDown: import_ds_props_helpers.PropTypes.func.description("Input on key down").defaultValue(defaultPropsComposer.onKeyDown),
86
- maxHeight: import_ds_props_helpers.PropTypes.number.description("Max height of the composer. Use 0 for no limit").defaultValue(defaultPropsComposer.onBlur),
87
- inputMaxLength: import_ds_props_helpers.PropTypes.number.description("Max length of the composer. `undefined` for no limit").defaultValue(defaultPropsComposer.inputMaxLength),
88
- buttonDisabled: import_ds_props_helpers.PropTypes.bool.description("Control the disabled for the send button").defaultValue(defaultPropsComposer.buttonDisabled),
89
- dataTestid: import_ds_props_helpers.PropTypes.string.description("Data testid").defaultValue(defaultPropsComposer.placeholder),
90
- actionRef: import_ds_props_helpers.PropTypes.object.description(`Reference:
76
+ placeholder: import_ds_utilities.PropTypes.string.description("Input Placeholder").defaultValue(defaultPropsComposer.placeholder),
77
+ inputValue: import_ds_utilities.PropTypes.string.description("Input value").defaultValue(defaultPropsComposer.inputValue),
78
+ ariaMaxLengthMessage: import_ds_utilities.PropTypes.string.description("Aria message for Max length message when exceeded").defaultValue(defaultPropsComposer.maxLengthMessage),
79
+ maxLengthMessage: import_ds_utilities.PropTypes.string.description("Max length message").defaultValue(defaultPropsComposer.maxLengthMessage),
80
+ onChange: import_ds_utilities.PropTypes.func.description("Called when the user types").defaultValue(defaultPropsComposer.onChange),
81
+ onResize: import_ds_utilities.PropTypes.func.description("Called the input changes his height").defaultValue(defaultPropsComposer.onResize),
82
+ onSend: import_ds_utilities.PropTypes.func.description("Called when the click send").defaultValue(defaultPropsComposer.onSend),
83
+ onFocus: import_ds_utilities.PropTypes.func.description("Input focus").defaultValue(defaultPropsComposer.onFocus),
84
+ onBlur: import_ds_utilities.PropTypes.func.description("Input blur").defaultValue(defaultPropsComposer.onBlur),
85
+ onKeyDown: import_ds_utilities.PropTypes.func.description("Input on key down").defaultValue(defaultPropsComposer.onKeyDown),
86
+ maxHeight: import_ds_utilities.PropTypes.number.description("Max height of the composer. Use 0 for no limit").defaultValue(defaultPropsComposer.onBlur),
87
+ inputMaxLength: import_ds_utilities.PropTypes.number.description("Max length of the composer. `undefined` for no limit").defaultValue(defaultPropsComposer.inputMaxLength),
88
+ buttonDisabled: import_ds_utilities.PropTypes.bool.description("Control the disabled for the send button").defaultValue(defaultPropsComposer.buttonDisabled),
89
+ dataTestid: import_ds_utilities.PropTypes.string.description("Data testid").defaultValue(defaultPropsComposer.placeholder),
90
+ actionRef: import_ds_utilities.PropTypes.object.description(`Reference:
91
91
  {
92
92
  scrollToIndex: (n: number) => void,
93
93
  getMessagesInView: () => number[],
@@ -109,9 +109,9 @@ const defaultPropsMessagesList = {
109
109
  bannerPosition: void 0,
110
110
  bannerRef: void 0
111
111
  };
112
- const ChatContainerMessagesListPropTypes = __spreadProps(__spreadValues({}, import_ds_props_helpers.globalAttributesPropTypes), {
113
- messages: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.object).description("The array of out-of-the-box items you want to render inside the ChatMessageList").defaultValue(defaultPropsMessagesList.messages),
114
- actionRef: import_ds_props_helpers.PropTypes.object.description(`Reference:
112
+ const ChatContainerMessagesListPropTypes = __spreadProps(__spreadValues({}, import_ds_utilities.globalAttributesPropTypes), {
113
+ messages: import_ds_utilities.PropTypes.arrayOf(import_ds_utilities.PropTypes.object).description("The array of out-of-the-box items you want to render inside the ChatMessageList").defaultValue(defaultPropsMessagesList.messages),
114
+ actionRef: import_ds_utilities.PropTypes.object.description(`Reference:
115
115
  {
116
116
  scrollToIndex: (n: number) => void,
117
117
  getMessagesInView: () => number[],
@@ -123,12 +123,12 @@ const ChatContainerMessagesListPropTypes = __spreadProps(__spreadValues({}, impo
123
123
  }
124
124
 
125
125
  `).defaultValue(defaultPropsMessagesList.actionRef),
126
- onScrollEnds: import_ds_props_helpers.PropTypes.func.description(`Called when the scroll stops.`),
127
- isLoading: import_ds_props_helpers.PropTypes.oneOf(["top", "bottom", void 0]).description("Keeps the load more space while the loading is in progress"),
128
- hasMoreItems: import_ds_props_helpers.PropTypes.oneOf(["top", "bottom", void 0]).description("Show Load More button at the `top` or `bottom` of the container"),
129
- getMoreMessages: import_ds_props_helpers.PropTypes.func.description("Called when the user clicks on load more").defaultValue(defaultPropsMessagesList.getMoreMessages),
130
- sendingMessages: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.string), import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.number)]).description("Array of ids of sending messages").defaultValue(defaultPropsMessagesList.sendingMessages),
131
- sendingText: import_ds_props_helpers.PropTypes.string.description("Label description for messages in sending status").defaultValue(defaultPropsMessagesList.sendingText)
126
+ onScrollEnds: import_ds_utilities.PropTypes.func.description(`Called when the scroll stops.`),
127
+ isLoading: import_ds_utilities.PropTypes.oneOf(["top", "bottom", void 0]).description("Keeps the load more space while the loading is in progress"),
128
+ hasMoreItems: import_ds_utilities.PropTypes.oneOf(["top", "bottom", void 0]).description("Show Load More button at the `top` or `bottom` of the container"),
129
+ getMoreMessages: import_ds_utilities.PropTypes.func.description("Called when the user clicks on load more").defaultValue(defaultPropsMessagesList.getMoreMessages),
130
+ sendingMessages: import_ds_utilities.PropTypes.oneOfType([import_ds_utilities.PropTypes.arrayOf(import_ds_utilities.PropTypes.string), import_ds_utilities.PropTypes.arrayOf(import_ds_utilities.PropTypes.number)]).description("Array of ids of sending messages").defaultValue(defaultPropsMessagesList.sendingMessages),
131
+ sendingText: import_ds_utilities.PropTypes.string.description("Label description for messages in sending status").defaultValue(defaultPropsMessagesList.sendingText)
132
132
  });
133
133
  const defaultProps = {
134
134
  messagesListProps: defaultPropsMessagesList,
@@ -150,25 +150,25 @@ const defaultProps = {
150
150
  sendingMessages: void 0,
151
151
  sendingText: "Sending"
152
152
  };
153
- const ChatContainerPropTypes = __spreadProps(__spreadValues({}, import_ds_props_helpers.globalAttributesPropTypes), {
154
- messagesListProps: import_ds_props_helpers.PropTypes.object.description('ChatMessageList props "messages" / "onScrollEnds"').defaultValue(defaultProps.messagesListProps),
155
- composerProps: import_ds_props_helpers.PropTypes.object.description("Composer configuration").defaultValue(defaultProps.composerProps),
156
- autoScroll: import_ds_props_helpers.PropTypes.bool.description("Auto scroll to bottom on resize").defaultValue(defaultProps.autoScroll),
157
- device: import_ds_props_helpers.PropTypes.string.description("Option to render mobile or desktop style composer").defaultValue(defaultProps.device),
158
- isLoading: import_ds_props_helpers.PropTypes.oneOf(["top", "bottom", void 0]).description("Show Loading messages indicator at the `top` or `bottom` of the container"),
159
- hasMoreItems: import_ds_props_helpers.PropTypes.oneOf(["top", "bottom", void 0]).description("Show Load More button at the `top` or `bottom` of the container"),
160
- getMoreMessages: import_ds_props_helpers.PropTypes.func.description("Called when the user clicks on load more").defaultValue(defaultProps.getMoreMessages),
161
- bannerPosition: import_ds_props_helpers.PropTypes.oneOf(["top", "bottom", void 0]).description("Show Loading messages indicator at the `top` or `bottom` of the container"),
162
- bannerProps: import_ds_props_helpers.PropTypes.object.description(`Banner configuration:
153
+ const ChatContainerPropTypes = __spreadProps(__spreadValues({}, import_ds_utilities.globalAttributesPropTypes), {
154
+ messagesListProps: import_ds_utilities.PropTypes.object.description('ChatMessageList props "messages" / "onScrollEnds"').defaultValue(defaultProps.messagesListProps),
155
+ composerProps: import_ds_utilities.PropTypes.object.description("Composer configuration").defaultValue(defaultProps.composerProps),
156
+ autoScroll: import_ds_utilities.PropTypes.bool.description("Auto scroll to bottom on resize").defaultValue(defaultProps.autoScroll),
157
+ device: import_ds_utilities.PropTypes.string.description("Option to render mobile or desktop style composer").defaultValue(defaultProps.device),
158
+ isLoading: import_ds_utilities.PropTypes.oneOf(["top", "bottom", void 0]).description("Show Loading messages indicator at the `top` or `bottom` of the container"),
159
+ hasMoreItems: import_ds_utilities.PropTypes.oneOf(["top", "bottom", void 0]).description("Show Load More button at the `top` or `bottom` of the container"),
160
+ getMoreMessages: import_ds_utilities.PropTypes.func.description("Called when the user clicks on load more").defaultValue(defaultProps.getMoreMessages),
161
+ bannerPosition: import_ds_utilities.PropTypes.oneOf(["top", "bottom", void 0]).description("Show Loading messages indicator at the `top` or `bottom` of the container"),
162
+ bannerProps: import_ds_utilities.PropTypes.object.description(`Banner configuration:
163
163
  label: string;
164
164
  viewLabel: string;
165
165
  type: BANNER_TYPES;
166
166
  onView: () => void;
167
167
  onClose: () => void;
168
168
  `).defaultValue(defaultProps.bannerProps),
169
- sendingMessages: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.string), import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.number)]).description("Array of ids of sending messages").defaultValue(defaultProps.sendingMessages),
170
- sendingText: import_ds_props_helpers.PropTypes.string.description("Label description for messages in sending status").defaultValue(defaultProps.sendingText),
171
- actionRef: import_ds_props_helpers.PropTypes.object.description(`Reference:
169
+ sendingMessages: import_ds_utilities.PropTypes.oneOfType([import_ds_utilities.PropTypes.arrayOf(import_ds_utilities.PropTypes.string), import_ds_utilities.PropTypes.arrayOf(import_ds_utilities.PropTypes.number)]).description("Array of ids of sending messages").defaultValue(defaultProps.sendingMessages),
170
+ sendingText: import_ds_utilities.PropTypes.string.description("Label description for messages in sending status").defaultValue(defaultProps.sendingText),
171
+ actionRef: import_ds_utilities.PropTypes.object.description(`Reference:
172
172
  {
173
173
  scrollToIndex: (n: number) => void,
174
174
  getMessagesInView: () => number[],
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/react-desc-prop-types.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\nimport { noop } from 'lodash';\nimport { PropTypes, globalAttributesPropTypes } from '@elliemae/ds-props-helpers';\nimport { BANNER_TYPES } from '@elliemae/ds-banner';\nimport { BubblePropsT } from './exported-related/bubble/props';\n\nexport declare namespace DSChatT {\n export interface ContainerProps {\n messagesListProps: Pick<MessagesListProps, 'messages' | 'onScrollEnds'>;\n composerProps: ComposerProps;\n actionRef?: ActionRef;\n autoScroll: boolean;\n device: 'desktop' | 'mobile';\n isLoading?: 'top' | 'bottom';\n hasMoreItems?: 'top' | 'bottom';\n getMoreMessages: () => void;\n bannerPosition?: 'top' | 'bottom';\n bannerProps?: ChatBannerProps;\n sendingMessages?: string[] | number[];\n sendingText: string;\n }\n\n export interface ComposerProps {\n placeholder?: string;\n inputValue?: string;\n ariaMaxLengthMessage?: string;\n maxLengthMessage?: string;\n onChange: (value: string) => void;\n onResize?: (value: number) => void;\n onSend: (value: string) => void;\n onFocus?: (e: React.ChangeEvent<HTMLTextAreaElement>, value: string) => void;\n onBlur?: (e: React.ChangeEvent<HTMLTextAreaElement>, value: string) => void;\n onKeyDown?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;\n maxHeight?: number;\n inputMaxLength: number | undefined;\n buttonDisabled: boolean;\n dataTestid?: string;\n actionRef?: ActionRef;\n }\n\n export interface MessagesListProps {\n messages: BubblePropsT[];\n actionRef: () => void;\n onScrollEnds: (indexList: number[]) => number[];\n isLoading?: 'top' | 'bottom';\n hasMoreItems?: 'top' | 'bottom';\n getMoreMessages: () => void;\n sendingMessages?: Array<string | number>;\n sendingText: string;\n bannerPosition?: 'top' | 'bottom';\n bannerRef?: React.MutableRefObject<{\n focusOnWrapper: (...args: any[]) => void;\n focusOnLink: (...args: any[]) => void;\n }>;\n }\n\n interface ChatBannerProps {\n label: string;\n viewLabel: string;\n type?: string;\n onView: () => void;\n onClose: () => void;\n }\n\n interface ActionRef {\n scrollToIndex: (n: number, b: { align: 'end' | 'center' | 'start' }) => void;\n getMessagesInView: () => number[];\n }\n\n export interface GetPaddingT {\n hasMoreItems: string | undefined;\n bannerPosition: string | undefined;\n isLoading: string | undefined;\n }\n}\n\nexport interface TextAreaProps {\n height: string | number;\n style: React.CSSProperties;\n}\n\nexport const defaultPropsComposer: DSChatT.ComposerProps = {\n placeholder: 'Type your message',\n inputValue: '',\n ariaMaxLengthMessage: '',\n onChange: noop,\n onResize: noop,\n onSend: noop,\n onFocus: noop,\n onBlur: noop,\n onKeyDown: noop,\n maxHeight: 0,\n inputMaxLength: undefined,\n maxLengthMessage: undefined,\n buttonDisabled: false,\n dataTestid: 'ds-chat-composer',\n actionRef: undefined,\n};\n\nexport const ChatComposerPropTypes = {\n placeholder: PropTypes.string.description('Input Placeholder').defaultValue(defaultPropsComposer.placeholder),\n inputValue: PropTypes.string.description('Input value').defaultValue(defaultPropsComposer.inputValue),\n ariaMaxLengthMessage: PropTypes.string\n .description('Aria message for Max length message when exceeded')\n .defaultValue(defaultPropsComposer.maxLengthMessage),\n maxLengthMessage: PropTypes.string\n .description('Max length message')\n .defaultValue(defaultPropsComposer.maxLengthMessage),\n onChange: PropTypes.func.description('Called when the user types').defaultValue(defaultPropsComposer.onChange),\n onResize: PropTypes.func\n .description('Called the input changes his height')\n .defaultValue(defaultPropsComposer.onResize),\n onSend: PropTypes.func.description('Called when the click send').defaultValue(defaultPropsComposer.onSend),\n onFocus: PropTypes.func.description('Input focus').defaultValue(defaultPropsComposer.onFocus),\n onBlur: PropTypes.func.description('Input blur').defaultValue(defaultPropsComposer.onBlur),\n onKeyDown: PropTypes.func.description('Input on key down').defaultValue(defaultPropsComposer.onKeyDown),\n maxHeight: PropTypes.number\n .description('Max height of the composer. Use 0 for no limit')\n .defaultValue(defaultPropsComposer.onBlur),\n inputMaxLength: PropTypes.number\n .description('Max length of the composer. `undefined` for no limit')\n .defaultValue(defaultPropsComposer.inputMaxLength),\n buttonDisabled: PropTypes.bool\n .description('Control the disabled for the send button')\n .defaultValue(defaultPropsComposer.buttonDisabled),\n dataTestid: PropTypes.string.description('Data testid').defaultValue(defaultPropsComposer.placeholder),\n actionRef: PropTypes.object\n .description(\n `Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n `,\n )\n .defaultValue(defaultPropsComposer.actionRef),\n};\n\nexport const defaultPropsMessagesList: DSChatT.MessagesListProps = {\n messages: [],\n actionRef: noop,\n onScrollEnds: () => [],\n getMoreMessages: noop,\n sendingMessages: undefined,\n sendingText: 'Sending',\n bannerPosition: undefined,\n bannerRef: undefined,\n};\n\nexport const ChatContainerMessagesListPropTypes = {\n ...globalAttributesPropTypes,\n\n messages: PropTypes.arrayOf(PropTypes.object)\n .description('The array of out-of-the-box items you want to render inside the ChatMessageList')\n .defaultValue(defaultPropsMessagesList.messages),\n actionRef: PropTypes.object\n .description(\n `Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToIndexWithoutScroll: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n `,\n )\n .defaultValue(defaultPropsMessagesList.actionRef),\n onScrollEnds: PropTypes.func.description(`Called when the scroll stops.`),\n isLoading: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Keeps the load more space while the loading is in progress',\n ),\n hasMoreItems: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Load More button at the `top` or `bottom` of the container',\n ),\n getMoreMessages: PropTypes.func\n .description('Called when the user clicks on load more')\n .defaultValue(defaultPropsMessagesList.getMoreMessages),\n sendingMessages: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.number)])\n .description('Array of ids of sending messages')\n .defaultValue(defaultPropsMessagesList.sendingMessages),\n sendingText: PropTypes.string\n .description('Label description for messages in sending status')\n .defaultValue(defaultPropsMessagesList.sendingText),\n};\n\nexport const defaultProps: DSChatT.ContainerProps = {\n messagesListProps: defaultPropsMessagesList,\n composerProps: defaultPropsComposer,\n actionRef: undefined,\n autoScroll: false,\n device: 'desktop',\n isLoading: undefined,\n hasMoreItems: undefined,\n getMoreMessages: noop,\n bannerPosition: undefined,\n bannerProps: {\n type: BANNER_TYPES.INFO,\n label: 'Unread Messages',\n viewLabel: 'View',\n onView: noop,\n onClose: noop,\n },\n sendingMessages: undefined,\n sendingText: 'Sending',\n};\n\nexport const ChatContainerPropTypes = {\n ...globalAttributesPropTypes,\n messagesListProps: PropTypes.object\n .description('ChatMessageList props \"messages\" / \"onScrollEnds\"')\n .defaultValue(defaultProps.messagesListProps),\n composerProps: PropTypes.object.description('Composer configuration').defaultValue(defaultProps.composerProps),\n autoScroll: PropTypes.bool.description('Auto scroll to bottom on resize').defaultValue(defaultProps.autoScroll),\n device: PropTypes.string\n .description('Option to render mobile or desktop style composer')\n .defaultValue(defaultProps.device),\n isLoading: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Loading messages indicator at the `top` or `bottom` of the container',\n ),\n hasMoreItems: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Load More button at the `top` or `bottom` of the container',\n ),\n getMoreMessages: PropTypes.func\n .description('Called when the user clicks on load more')\n .defaultValue(defaultProps.getMoreMessages),\n bannerPosition: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Loading messages indicator at the `top` or `bottom` of the container',\n ),\n bannerProps: PropTypes.object\n .description(\n `Banner configuration:\n label: string;\n viewLabel: string;\n type: BANNER_TYPES;\n onView: () => void;\n onClose: () => void;\n `,\n )\n .defaultValue(defaultProps.bannerProps),\n sendingMessages: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.number)])\n .description('Array of ids of sending messages')\n .defaultValue(defaultProps.sendingMessages),\n sendingText: PropTypes.string\n .description('Label description for messages in sending status')\n .defaultValue(defaultProps.sendingText),\n actionRef: PropTypes.object\n .description(\n `Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n `,\n )\n .defaultValue(defaultProps.actionRef),\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,oBAAqB;AACrB,8BAAqD;AACrD,uBAA6B;AA8EtB,MAAM,uBAA8C;AAAA,EACzD,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,sBAAsB;AAAA,EACtB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB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ACZ,aAAa,aAAa;AAAA,EAC7B,WAAW,kCAAU,MAAM,CAAC,OAAO,UAAU,SAAY,YACvD;AAAA,EAEF,cAAc,kCAAU,MAAM,CAAC,OAAO,UAAU,SAAY,YAC1D;AAAA,EAEF,iBAAiB,kCAAU,KACxB,YAAY,4CACZ,aAAa,aAAa;AAAA,EAC7B,gBAAgB,kCAAU,MAAM,CAAC,OAAO,UAAU,SAAY,YAC5D;AAAA,EAEF,aAAa,kCAAU,OACpB,YACC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAQD,aAAa,aAAa;AAAA,EAC7B,iBAAiB,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,SAAS,kCAAU,QAAQ,kCAAU,UACpG,YAAY,oCACZ,aAAa,aAAa;AAAA,EAC7B,aAAa,kCAAU,OACpB,YAAY,oDACZ,aAAa,aAAa;AAAA,EAC7B,WAAW,kCAAU,OAClB,YACC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAYD,aAAa,aAAa;AAAA;",
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport { noop } from 'lodash';\nimport { PropTypes, globalAttributesPropTypes } from '@elliemae/ds-utilities';\nimport { BANNER_TYPES } from '@elliemae/ds-banner';\nimport { BubblePropsT } from './exported-related/bubble/props';\n\nexport declare namespace DSChatT {\n export interface ContainerProps {\n messagesListProps: Pick<MessagesListProps, 'messages' | 'onScrollEnds'>;\n composerProps: ComposerProps;\n actionRef?: ActionRef;\n autoScroll: boolean;\n device: 'desktop' | 'mobile';\n isLoading?: 'top' | 'bottom';\n hasMoreItems?: 'top' | 'bottom';\n getMoreMessages: () => void;\n bannerPosition?: 'top' | 'bottom';\n bannerProps?: ChatBannerProps;\n sendingMessages?: string[] | number[];\n sendingText: string;\n }\n\n export interface ComposerProps {\n placeholder?: string;\n inputValue?: string;\n ariaMaxLengthMessage?: string;\n maxLengthMessage?: string;\n onChange: (value: string) => void;\n onResize?: (value: number) => void;\n onSend: (value: string) => void;\n onFocus?: (e: React.ChangeEvent<HTMLTextAreaElement>, value: string) => void;\n onBlur?: (e: React.ChangeEvent<HTMLTextAreaElement>, value: string) => void;\n onKeyDown?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;\n maxHeight?: number;\n inputMaxLength: number | undefined;\n buttonDisabled: boolean;\n dataTestid?: string;\n actionRef?: ActionRef;\n }\n\n export interface MessagesListProps {\n messages: BubblePropsT[];\n actionRef: () => void;\n onScrollEnds: (indexList: number[]) => number[];\n isLoading?: 'top' | 'bottom';\n hasMoreItems?: 'top' | 'bottom';\n getMoreMessages: () => void;\n sendingMessages?: Array<string | number>;\n sendingText: string;\n bannerPosition?: 'top' | 'bottom';\n bannerRef?: React.MutableRefObject<{\n focusOnWrapper: (...args: any[]) => void;\n focusOnLink: (...args: any[]) => void;\n }>;\n }\n\n interface ChatBannerProps {\n label: string;\n viewLabel: string;\n type?: string;\n onView: () => void;\n onClose: () => void;\n }\n\n interface ActionRef {\n scrollToIndex: (n: number, b: { align: 'end' | 'center' | 'start' }) => void;\n getMessagesInView: () => number[];\n }\n\n export interface GetPaddingT {\n hasMoreItems: string | undefined;\n bannerPosition: string | undefined;\n isLoading: string | undefined;\n }\n}\n\nexport interface TextAreaProps {\n height: string | number;\n style: React.CSSProperties;\n}\n\nexport const defaultPropsComposer: DSChatT.ComposerProps = {\n placeholder: 'Type your message',\n inputValue: '',\n ariaMaxLengthMessage: '',\n onChange: noop,\n onResize: noop,\n onSend: noop,\n onFocus: noop,\n onBlur: noop,\n onKeyDown: noop,\n maxHeight: 0,\n inputMaxLength: undefined,\n maxLengthMessage: undefined,\n buttonDisabled: false,\n dataTestid: 'ds-chat-composer',\n actionRef: undefined,\n};\n\nexport const ChatComposerPropTypes = {\n placeholder: PropTypes.string.description('Input Placeholder').defaultValue(defaultPropsComposer.placeholder),\n inputValue: PropTypes.string.description('Input value').defaultValue(defaultPropsComposer.inputValue),\n ariaMaxLengthMessage: PropTypes.string\n .description('Aria message for Max length message when exceeded')\n .defaultValue(defaultPropsComposer.maxLengthMessage),\n maxLengthMessage: PropTypes.string\n .description('Max length message')\n .defaultValue(defaultPropsComposer.maxLengthMessage),\n onChange: PropTypes.func.description('Called when the user types').defaultValue(defaultPropsComposer.onChange),\n onResize: PropTypes.func\n .description('Called the input changes his height')\n .defaultValue(defaultPropsComposer.onResize),\n onSend: PropTypes.func.description('Called when the click send').defaultValue(defaultPropsComposer.onSend),\n onFocus: PropTypes.func.description('Input focus').defaultValue(defaultPropsComposer.onFocus),\n onBlur: PropTypes.func.description('Input blur').defaultValue(defaultPropsComposer.onBlur),\n onKeyDown: PropTypes.func.description('Input on key down').defaultValue(defaultPropsComposer.onKeyDown),\n maxHeight: PropTypes.number\n .description('Max height of the composer. Use 0 for no limit')\n .defaultValue(defaultPropsComposer.onBlur),\n inputMaxLength: PropTypes.number\n .description('Max length of the composer. `undefined` for no limit')\n .defaultValue(defaultPropsComposer.inputMaxLength),\n buttonDisabled: PropTypes.bool\n .description('Control the disabled for the send button')\n .defaultValue(defaultPropsComposer.buttonDisabled),\n dataTestid: PropTypes.string.description('Data testid').defaultValue(defaultPropsComposer.placeholder),\n actionRef: PropTypes.object\n .description(\n `Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n `,\n )\n .defaultValue(defaultPropsComposer.actionRef),\n};\n\nexport const defaultPropsMessagesList: DSChatT.MessagesListProps = {\n messages: [],\n actionRef: noop,\n onScrollEnds: () => [],\n getMoreMessages: noop,\n sendingMessages: undefined,\n sendingText: 'Sending',\n bannerPosition: undefined,\n bannerRef: undefined,\n};\n\nexport const ChatContainerMessagesListPropTypes = {\n ...globalAttributesPropTypes,\n\n messages: PropTypes.arrayOf(PropTypes.object)\n .description('The array of out-of-the-box items you want to render inside the ChatMessageList')\n .defaultValue(defaultPropsMessagesList.messages),\n actionRef: PropTypes.object\n .description(\n `Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToIndexWithoutScroll: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n `,\n )\n .defaultValue(defaultPropsMessagesList.actionRef),\n onScrollEnds: PropTypes.func.description(`Called when the scroll stops.`),\n isLoading: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Keeps the load more space while the loading is in progress',\n ),\n hasMoreItems: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Load More button at the `top` or `bottom` of the container',\n ),\n getMoreMessages: PropTypes.func\n .description('Called when the user clicks on load more')\n .defaultValue(defaultPropsMessagesList.getMoreMessages),\n sendingMessages: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.number)])\n .description('Array of ids of sending messages')\n .defaultValue(defaultPropsMessagesList.sendingMessages),\n sendingText: PropTypes.string\n .description('Label description for messages in sending status')\n .defaultValue(defaultPropsMessagesList.sendingText),\n};\n\nexport const defaultProps: DSChatT.ContainerProps = {\n messagesListProps: defaultPropsMessagesList,\n composerProps: defaultPropsComposer,\n actionRef: undefined,\n autoScroll: false,\n device: 'desktop',\n isLoading: undefined,\n hasMoreItems: undefined,\n getMoreMessages: noop,\n bannerPosition: undefined,\n bannerProps: {\n type: BANNER_TYPES.INFO,\n label: 'Unread Messages',\n viewLabel: 'View',\n onView: noop,\n onClose: noop,\n },\n sendingMessages: undefined,\n sendingText: 'Sending',\n};\n\nexport const ChatContainerPropTypes = {\n ...globalAttributesPropTypes,\n messagesListProps: PropTypes.object\n .description('ChatMessageList props \"messages\" / \"onScrollEnds\"')\n .defaultValue(defaultProps.messagesListProps),\n composerProps: PropTypes.object.description('Composer configuration').defaultValue(defaultProps.composerProps),\n autoScroll: PropTypes.bool.description('Auto scroll to bottom on resize').defaultValue(defaultProps.autoScroll),\n device: PropTypes.string\n .description('Option to render mobile or desktop style composer')\n .defaultValue(defaultProps.device),\n isLoading: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Loading messages indicator at the `top` or `bottom` of the container',\n ),\n hasMoreItems: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Load More button at the `top` or `bottom` of the container',\n ),\n getMoreMessages: PropTypes.func\n .description('Called when the user clicks on load more')\n .defaultValue(defaultProps.getMoreMessages),\n bannerPosition: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Loading messages indicator at the `top` or `bottom` of the container',\n ),\n bannerProps: PropTypes.object\n .description(\n `Banner configuration:\n label: string;\n viewLabel: string;\n type: BANNER_TYPES;\n onView: () => void;\n onClose: () => void;\n `,\n )\n .defaultValue(defaultProps.bannerProps),\n sendingMessages: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.number)])\n .description('Array of ids of sending messages')\n .defaultValue(defaultProps.sendingMessages),\n sendingText: PropTypes.string\n .description('Label description for messages in sending status')\n .defaultValue(defaultProps.sendingText),\n actionRef: PropTypes.object\n .description(\n `Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n `,\n )\n .defaultValue(defaultProps.actionRef),\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,oBAAqB;AACrB,0BAAqD;AACrD,uBAA6B;AA8EtB,MAAM,uBAA8C;AAAA,EACzD,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,sBAAsB;AAAA,EACtB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,W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,aAAa,aAAa,SAAS;AACxC;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/tests/utils.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { BUBBLE_TYPES } from '../exported-related/bubble';\n\nconst getRandomMessages = (q, key) =>\n Array(q)\n .fill()\n .map((v, i) => {\n if (i > 5 && i % 22 === 0) {\n return {\n dsId: `${i}`,\n body: `This is a system message that notifies the user of some important things`,\n type: BUBBLE_TYPES.SYSTEM,\n title: 'System Message',\n time: '4:50 pm',\n };\n }\n if (i > 5 && i % 16 === 0) {\n return {\n dsId: `${i}`,\n type: BUBBLE_TYPES.DELIMITER,\n title: 'Mon, Apr 25, 12:43 PM',\n extraProps: { 'data-testid': 'custom-data-testid' },\n };\n }\n const isSender = i % 2 === 0;\n const chatBubbleType = isSender ? BUBBLE_TYPES.SENDER : BUBBLE_TYPES.RECIPIENT;\n const chatTitle = isSender ? 'Robert Deniro' : 'Al Pacino';\n return {\n dsId: `${i}`,\n body: `Message text ${key} Message text ${i}`,\n type: chatBubbleType,\n title: chatTitle,\n time: '4:50 pm',\n helpMessage: isSender ? 'Delivered' : null,\n };\n });\n\nexport const loadMsgs = (q: number): unknown => getRandomMessages(q, 'item_key');\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAA6B;AAE7B,MAAM,oBAAoB,CAAC,GAAG,QAC5B,MAAM,GACH,OACA,IAAI,CAAC,GAAG,MAAM;AACb,MAAI,IAAI,KAAK,IAAI,OAAO,GAAG;AACzB,WAAO;AAAA,MACL,MAAM,GAAG;AAAA,MACT,MAAM;AAAA,MACN,MAAM,2BAAa;AAAA,MACnB,OAAO;AAAA,MACP,MAAM;AAAA;AAAA;AAGV,MAAI,IAAI,KAAK,IAAI,OAAO,GAAG;AACzB,WAAO;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c;AAAA,EACxC;AACF,CAAC;AAEE,MAAM,WAAW,CAAC,MAAuB,kBAAkB,GAAG,UAAU;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/ChatDataTestids.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const ChatDataTestIds = {\n COMPOSER_TEXTAREA: 'chat-composer-textarea',\n COMPOSER_SEND_BUTTON: 'chat-composer-send-button',\n CARD_TITLE: 'chat-card-title',\n CARD_WRAPPER: 'chat-card-wrapper',\n CARD_TIME: 'chat-card-time',\n CARD_RIGHT_ADDON: 'chat-right-addon',\n CARD_CONTENT: 'chat-card-content',\n LOADING_INDICATOR: 'ds-chat-loading-indicator',\n HEADER_TITLE: 'chat-header-title',\n HEADER_CHILDREN: 'chat-header-children',\n THREAD_CONTAINER: 'chat-thread-container',\n LOAD_MORE_BUTTON: 'ds-chat-load-more-btn',\n FLOATING_BUTTON: 'chat-floating-button',\n SYSTEM_MSG_TITLE: 'chat-system-message-title',\n SYSTEM_MSG_BODY: 'chat-system-message-body',\n SYSTEM_MSG_TIME: 'chat-system-message-time',\n BUBBLE: 'ds-chat-bubble',\n BUBBLE_TITLE: 'chat-bubble-title',\n BUBBLE_BODY: 'chat-bubble-body',\n BANNER: 'ds-banner-container',\n};\n"],
5
- "mappings": "AAAA;ACAO,MAAM,kBAAkB;AAAA,EAC7B,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,aAAa;AAAA,EACb,QAAQ;AAAA;",
5
+ "mappings": "AAAA;ACAO,MAAM,kBAAkB;AAAA,EAC7B,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,aAAa;AAAA,EACb,QAAQ;AACV;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import React2 from "react";
3
- import { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
3
+ import { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from "@elliemae/ds-utilities";
4
4
  import { WarningCircleFill } from "@elliemae/ds-icons";
5
5
  import {
6
6
  StyledWrapper,