@elliemae/ds-chat 1.57.0-rc.1 → 1.57.0-rc.2

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.
@@ -29,6 +29,9 @@ var ChatBubble = function ChatBubble(props) {
29
29
  body = props.body,
30
30
  errorMessage = props.errorMessage,
31
31
  helpMessage = props.helpMessage;
32
+ var bodyParts = React__default['default'].useMemo(function () {
33
+ return body.split('\n');
34
+ }, [body]);
32
35
  return /*#__PURE__*/React__default['default'].createElement(parts_bubble_styled.StyledWrapper, {
33
36
  "data-testid": "ds-chat-bubble-".concat(dsId),
34
37
  type: type
@@ -48,7 +51,11 @@ var ChatBubble = function ChatBubble(props) {
48
51
  "data-testid": "chat-bubble-time-".concat(dsId)
49
52
  }, time)), /*#__PURE__*/React__default['default'].createElement(parts_bubble_styled.StyleBodyWrapper, {
50
53
  "data-testid": "chat-bubble-body-".concat(dsId)
51
- }, body), /*#__PURE__*/React__default['default'].createElement(parts_bubble_ChatBubbleArrow.ChatBubbleArrow, {
54
+ }, bodyParts.map(function (item, index) {
55
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, {
56
+ key: item
57
+ }, item, index < bodyParts.length - 1 ? /*#__PURE__*/React__default['default'].createElement("br", null) : null);
58
+ })), /*#__PURE__*/React__default['default'].createElement(parts_bubble_ChatBubbleArrow.ChatBubbleArrow, {
52
59
  type: type
53
60
  })), errorMessage ? /*#__PURE__*/React__default['default'].createElement(parts_bubble_styled.StyleErrorMessage, {
54
61
  "data-testid": "chat-bubble-error-message-".concat(dsId),
@@ -1 +1 @@
1
- {"version":3,"file":"ChatBubble.js","sources":["../../../../src/parts/bubble/ChatBubble.tsx"],"sourcesContent":["import React from 'react';\nimport { describe } from 'react-desc';\nimport Warning from '@elliemae/ds-icons/WarningCircleFill';\nimport {\n StyledWrapper,\n StyledColoredBubble,\n StyledTitleBubble,\n StyledTitleLeftBubble,\n StyledTitleRightBubble,\n StyleBodyWrapper,\n StyleErrorMessage,\n StyleHelpMessage,\n} from './styled';\nimport { propsBubbles, BubbleProps } from './props';\nimport { useValidateProps } from './config/useValidateProps';\nimport { ChatBubbleArrow } from './ChatBubbleArrow';\n\nconst ChatBubble = (props: BubbleProps): JSX.Element => {\n useValidateProps(props, ChatBubbleWithSchema.toJSON());\n\n const { dsId, type, title, time, body, errorMessage, helpMessage } = props;\n return (\n <StyledWrapper data-testid={`ds-chat-bubble-${dsId}`} type={type}>\n <StyledColoredBubble type={type}>\n <StyledTitleBubble cols={[1, 'auto']} gutter=\"xs\" alignItems=\"flex-end\" className=\"sr-only\">\n <StyledTitleLeftBubble alignItems=\"center\" data-testid={`chat-bubble-title-${dsId}`}>\n {title}\n </StyledTitleLeftBubble>\n <StyledTitleRightBubble alignItems=\"center\" type={type} data-testid={`chat-bubble-time-${dsId}`}>\n {time}\n </StyledTitleRightBubble>\n </StyledTitleBubble>\n <StyleBodyWrapper data-testid={`chat-bubble-body-${dsId}`}>{body}</StyleBodyWrapper>\n <ChatBubbleArrow type={type} />\n </StyledColoredBubble>\n {errorMessage ? (\n <StyleErrorMessage data-testid={`chat-bubble-error-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{errorMessage}</span>\n <Warning />\n </StyleErrorMessage>\n ) : null}\n {helpMessage ? (\n <StyleHelpMessage data-testid={`chat-bubble-help-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{helpMessage}</span>\n </StyleHelpMessage>\n ) : null}\n </StyledWrapper>\n );\n};\nChatBubble.propTypes = propsBubbles;\n\nconst ChatBubbleWithSchema = describe(ChatBubble);\nChatBubbleWithSchema.propTypes = propsBubbles;\n\nexport { ChatBubble, ChatBubbleWithSchema };\n"],"names":["ChatBubble","props","useValidateProps","ChatBubbleWithSchema","toJSON","dsId","type","title","time","body","errorMessage","helpMessage","React","StyledWrapper","StyledColoredBubble","StyledTitleBubble","StyledTitleLeftBubble","StyledTitleRightBubble","StyleBodyWrapper","ChatBubbleArrow","StyleErrorMessage","Warning","StyleHelpMessage","propTypes","propsBubbles","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IAiBMA,UAAU,GAAG,SAAbA,UAAa,CAACC,KAAD,EAAqC;AACtDC,EAAAA,qDAAgB,CAACD,KAAD,EAAQE,oBAAoB,CAACC,MAArB,EAAR,CAAhB;AAEA,MAAQC,IAAR,GAAqEJ,KAArE,CAAQI,IAAR;AAAA,MAAcC,IAAd,GAAqEL,KAArE,CAAcK,IAAd;AAAA,MAAoBC,KAApB,GAAqEN,KAArE,CAAoBM,KAApB;AAAA,MAA2BC,IAA3B,GAAqEP,KAArE,CAA2BO,IAA3B;AAAA,MAAiCC,IAAjC,GAAqER,KAArE,CAAiCQ,IAAjC;AAAA,MAAuCC,YAAvC,GAAqET,KAArE,CAAuCS,YAAvC;AAAA,MAAqDC,WAArD,GAAqEV,KAArE,CAAqDU,WAArD;AACA,sBACEC,wCAACC,iCAAD;AAAe,4CAA+BR,IAA/B,CAAf;AAAsD,IAAA,IAAI,EAAEC;AAA5D,kBACEM,wCAACE,uCAAD;AAAqB,IAAA,IAAI,EAAER;AAA3B,kBACEM,wCAACG,qCAAD;AAAmB,IAAA,IAAI,EAAE,CAAC,CAAD,EAAI,MAAJ,CAAzB;AAAsC,IAAA,MAAM,EAAC,IAA7C;AAAkD,IAAA,UAAU,EAAC,UAA7D;AAAwE,IAAA,SAAS,EAAC;AAAlF,kBACEH,wCAACI,yCAAD;AAAuB,IAAA,UAAU,EAAC,QAAlC;AAA2C,+CAAkCX,IAAlC;AAA3C,KACGE,KADH,CADF,eAIEK,wCAACK,0CAAD;AAAwB,IAAA,UAAU,EAAC,QAAnC;AAA4C,IAAA,IAAI,EAAEX,IAAlD;AAAwD,8CAAiCD,IAAjC;AAAxD,KACGG,IADH,CAJF,CADF,eASEI,wCAACM,oCAAD;AAAkB,8CAAiCb,IAAjC;AAAlB,KAA4DI,IAA5D,CATF,eAUEG,wCAACO,4CAAD;AAAiB,IAAA,IAAI,EAAEb;AAAvB,IAVF,CADF,EAaGI,YAAY,gBACXE,wCAACQ,qCAAD;AAAmB,uDAA0Cf,IAA1C,CAAnB;AAAqE,IAAA,CAAC,EAAC,KAAvE;AAA6E,IAAA,MAAM,EAAC,KAApF;AAA0F,IAAA,IAAI,EAAE,CAAC,CAAD,EAAI,MAAJ;AAAhG,kBACEO,sDAAOF,YAAP,CADF,eAEEE,wCAACS,2BAAD,OAFF,CADW,GAKT,IAlBN,EAmBGV,WAAW,gBACVC,wCAACU,oCAAD;AAAkB,sDAAyCjB,IAAzC,CAAlB;AAAmE,IAAA,CAAC,EAAC,KAArE;AAA2E,IAAA,MAAM,EAAC,KAAlF;AAAwF,IAAA,IAAI,EAAE,CAAC,CAAD,EAAI,MAAJ;AAA9F,kBACEO,sDAAOD,WAAP,CADF,CADU,GAIR,IAvBN,CADF;AA2BD;;AACDX,UAAU,CAACuB,SAAX,GAAuBC,+BAAvB;IAEMrB,oBAAoB,GAAGsB,kBAAQ,CAACzB,UAAD;AACrCG,oBAAoB,CAACoB,SAArB,GAAiCC,+BAAjC;;;;;"}
1
+ {"version":3,"file":"ChatBubble.js","sources":["../../../../src/parts/bubble/ChatBubble.tsx"],"sourcesContent":["import React from 'react';\nimport { describe } from 'react-desc';\nimport Warning from '@elliemae/ds-icons/WarningCircleFill';\nimport {\n StyledWrapper,\n StyledColoredBubble,\n StyledTitleBubble,\n StyledTitleLeftBubble,\n StyledTitleRightBubble,\n StyleBodyWrapper,\n StyleErrorMessage,\n StyleHelpMessage,\n} from './styled';\nimport { propsBubbles, BubbleProps } from './props';\nimport { useValidateProps } from './config/useValidateProps';\nimport { ChatBubbleArrow } from './ChatBubbleArrow';\n\nconst ChatBubble = (props: BubbleProps): JSX.Element => {\n useValidateProps(props, ChatBubbleWithSchema.toJSON());\n\n const { dsId, type, title, time, body, errorMessage, helpMessage } = props;\n const bodyParts = React.useMemo(() => body.split('\\n'), [body]);\n\n return (\n <StyledWrapper data-testid={`ds-chat-bubble-${dsId}`} type={type}>\n <StyledColoredBubble type={type}>\n <StyledTitleBubble cols={[1, 'auto']} gutter=\"xs\" alignItems=\"flex-end\" className=\"sr-only\">\n <StyledTitleLeftBubble alignItems=\"center\" data-testid={`chat-bubble-title-${dsId}`}>\n {title}\n </StyledTitleLeftBubble>\n <StyledTitleRightBubble alignItems=\"center\" type={type} data-testid={`chat-bubble-time-${dsId}`}>\n {time}\n </StyledTitleRightBubble>\n </StyledTitleBubble>\n <StyleBodyWrapper data-testid={`chat-bubble-body-${dsId}`}>\n {bodyParts.map((item, index) => (\n <React.Fragment key={item}>\n {item}\n {index < bodyParts.length - 1 ? <br /> : null}\n </React.Fragment>\n ))}\n </StyleBodyWrapper>\n <ChatBubbleArrow type={type} />\n </StyledColoredBubble>\n {errorMessage ? (\n <StyleErrorMessage data-testid={`chat-bubble-error-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{errorMessage}</span>\n <Warning />\n </StyleErrorMessage>\n ) : null}\n {helpMessage ? (\n <StyleHelpMessage data-testid={`chat-bubble-help-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{helpMessage}</span>\n </StyleHelpMessage>\n ) : null}\n </StyledWrapper>\n );\n};\nChatBubble.propTypes = propsBubbles;\n\nconst ChatBubbleWithSchema = describe(ChatBubble);\nChatBubbleWithSchema.propTypes = propsBubbles;\n\nexport { ChatBubble, ChatBubbleWithSchema };\n"],"names":["ChatBubble","props","useValidateProps","ChatBubbleWithSchema","toJSON","dsId","type","title","time","body","errorMessage","helpMessage","bodyParts","React","useMemo","split","StyledWrapper","StyledColoredBubble","StyledTitleBubble","StyledTitleLeftBubble","StyledTitleRightBubble","StyleBodyWrapper","map","item","index","length","ChatBubbleArrow","StyleErrorMessage","Warning","StyleHelpMessage","propTypes","propsBubbles","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IAiBMA,UAAU,GAAG,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ACU,GAAV,CAAc,UAACC,IAAD,EAAOC,KAAP;AAAA,wBACbX,wCAACA,yBAAD,CAAO,QAAP;AAAgB,MAAA,GAAG,EAAEU;AAArB,OACGA,IADH,EAEGC,KAAK,GAAGZ,SAAS,CAACa,MAAV,GAAmB,CAA3B,gBAA+BZ,mDAA/B,GAAwC,IAF3C,CADa;AAAA,GAAd,CADH,CATF,eAiBEA,wCAACa,4CAAD;AAAiB,IAAA,IAAI,EAAEpB;AAAvB,IAjBF,CADF,EAoBGI,YAAY,gBACXG,wCAACc,qCAAD;AAAmB,uDAA0CtB,IAA1C,CAAnB;AAAqE,IAAA,CAAC,EAAC,KAAvE;AAA6E,IAAA,MAAM,EAAC,KAApF;AAA0F,IAAA,IAAI,EAAE,CAAC,CAAD,EAAI,MAAJ;AAAhG,kBACEQ,sDAAOH,YAAP,CADF,eAEEG,wCAACe,2BAAD,OAFF,CADW,GAKT,IAzBN,EA0BGjB,WAAW,gBACVE,wCAACgB,oCAAD;AAAkB,sDAAyCxB,IAAzC,CAAlB;AAAmE,IAAA,CAAC,EAAC,KAArE;AAA2E,IAAA,MAAM,EAAC,KAAlF;AAAwF,IAAA,IAAI,EAAE,CAAC,CAAD,EAAI,MAAJ;AAA9F,kBACEQ,sDAAOF,WAAP,CADF,CADU,GAIR,IA9BN,CADF;AAkCD;;AACDX,UAAU,CAAC8B,SAAX,GAAuBC,+BAAvB;IAEM5B,oBAAoB,GAAG6B,kBAAQ,CAAChC,UAAD;AACrCG,oBAAoB,CAAC2B,SAArB,GAAiCC,+BAAjC;;;;;"}
@@ -20,6 +20,9 @@ var ChatBubble = function ChatBubble(props) {
20
20
  body = props.body,
21
21
  errorMessage = props.errorMessage,
22
22
  helpMessage = props.helpMessage;
23
+ var bodyParts = React.useMemo(function () {
24
+ return body.split('\n');
25
+ }, [body]);
23
26
  return /*#__PURE__*/React.createElement(StyledWrapper, {
24
27
  "data-testid": "ds-chat-bubble-".concat(dsId),
25
28
  type: type
@@ -39,7 +42,11 @@ var ChatBubble = function ChatBubble(props) {
39
42
  "data-testid": "chat-bubble-time-".concat(dsId)
40
43
  }, time)), /*#__PURE__*/React.createElement(StyleBodyWrapper, {
41
44
  "data-testid": "chat-bubble-body-".concat(dsId)
42
- }, body), /*#__PURE__*/React.createElement(ChatBubbleArrow, {
45
+ }, bodyParts.map(function (item, index) {
46
+ return /*#__PURE__*/React.createElement(React.Fragment, {
47
+ key: item
48
+ }, item, index < bodyParts.length - 1 ? /*#__PURE__*/React.createElement("br", null) : null);
49
+ })), /*#__PURE__*/React.createElement(ChatBubbleArrow, {
43
50
  type: type
44
51
  })), errorMessage ? /*#__PURE__*/React.createElement(StyleErrorMessage, {
45
52
  "data-testid": "chat-bubble-error-message-".concat(dsId),
@@ -1 +1 @@
1
- {"version":3,"file":"ChatBubble.js","sources":["../../../../src/parts/bubble/ChatBubble.tsx"],"sourcesContent":["import React from 'react';\nimport { describe } from 'react-desc';\nimport Warning from '@elliemae/ds-icons/WarningCircleFill';\nimport {\n StyledWrapper,\n StyledColoredBubble,\n StyledTitleBubble,\n StyledTitleLeftBubble,\n StyledTitleRightBubble,\n StyleBodyWrapper,\n StyleErrorMessage,\n StyleHelpMessage,\n} from './styled';\nimport { propsBubbles, BubbleProps } from './props';\nimport { useValidateProps } from './config/useValidateProps';\nimport { ChatBubbleArrow } from './ChatBubbleArrow';\n\nconst ChatBubble = (props: BubbleProps): JSX.Element => {\n useValidateProps(props, ChatBubbleWithSchema.toJSON());\n\n const { dsId, type, title, time, body, errorMessage, helpMessage } = props;\n return (\n <StyledWrapper data-testid={`ds-chat-bubble-${dsId}`} type={type}>\n <StyledColoredBubble type={type}>\n <StyledTitleBubble cols={[1, 'auto']} gutter=\"xs\" alignItems=\"flex-end\" className=\"sr-only\">\n <StyledTitleLeftBubble alignItems=\"center\" data-testid={`chat-bubble-title-${dsId}`}>\n {title}\n </StyledTitleLeftBubble>\n <StyledTitleRightBubble alignItems=\"center\" type={type} data-testid={`chat-bubble-time-${dsId}`}>\n {time}\n </StyledTitleRightBubble>\n </StyledTitleBubble>\n <StyleBodyWrapper data-testid={`chat-bubble-body-${dsId}`}>{body}</StyleBodyWrapper>\n <ChatBubbleArrow type={type} />\n </StyledColoredBubble>\n {errorMessage ? (\n <StyleErrorMessage data-testid={`chat-bubble-error-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{errorMessage}</span>\n <Warning />\n </StyleErrorMessage>\n ) : null}\n {helpMessage ? (\n <StyleHelpMessage data-testid={`chat-bubble-help-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{helpMessage}</span>\n </StyleHelpMessage>\n ) : null}\n </StyledWrapper>\n );\n};\nChatBubble.propTypes = propsBubbles;\n\nconst ChatBubbleWithSchema = describe(ChatBubble);\nChatBubbleWithSchema.propTypes = propsBubbles;\n\nexport { ChatBubble, ChatBubbleWithSchema };\n"],"names":["ChatBubble","props","useValidateProps","ChatBubbleWithSchema","toJSON","dsId","type","title","time","body","errorMessage","helpMessage","propTypes","propsBubbles","describe"],"mappings":";;;;;;;;;;;;;IAiBMA,UAAU,GAAG,SAAbA,UAAa,CAACC,KAAD,EAAqC;AACtDC,EAAAA,gBAAgB,CAACD,KAAD,EAAQE,oBAAoB,CAACC,MAArB,EAAR,CAAhB;AAEA,MAAQC,IAAR,GAAqEJ,KAArE,CAAQI,IAAR;AAAA,MAAcC,IAAd,GAAqEL,KAArE,CAAcK,IAAd;AAAA,MAAoBC,KAApB,GAAqEN,KAArE,CAAoBM,KAApB;AAAA,MAA2BC,IAA3B,GAAqEP,KAArE,CAA2BO,IAA3B;AAAA,MAAiCC,IAAjC,GAAqER,KAArE,CAAiCQ,IAAjC;AAAA,MAAuCC,YAAvC,GAAqET,KAArE,CAAuCS,YAAvC;AAAA,MAAqDC,WAArD,GAAqEV,KAArE,CAAqDU,WAArD;AACA,sBACE,oBAAC,aAAD;AAAe,4CAA+BN,IAA/B,CAAf;AAAsD,IAAA,I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AAiCC,YAAjC;;;;"}
1
+ {"version":3,"file":"ChatBubble.js","sources":["../../../../src/parts/bubble/ChatBubble.tsx"],"sourcesContent":["import React from 'react';\nimport { describe } from 'react-desc';\nimport Warning from '@elliemae/ds-icons/WarningCircleFill';\nimport {\n StyledWrapper,\n StyledColoredBubble,\n StyledTitleBubble,\n StyledTitleLeftBubble,\n StyledTitleRightBubble,\n StyleBodyWrapper,\n StyleErrorMessage,\n StyleHelpMessage,\n} from './styled';\nimport { propsBubbles, BubbleProps } from './props';\nimport { useValidateProps } from './config/useValidateProps';\nimport { ChatBubbleArrow } from './ChatBubbleArrow';\n\nconst ChatBubble = (props: BubbleProps): JSX.Element => {\n useValidateProps(props, ChatBubbleWithSchema.toJSON());\n\n const { dsId, type, title, time, body, errorMessage, helpMessage } = props;\n const bodyParts = React.useMemo(() => body.split('\\n'), [body]);\n\n return (\n <StyledWrapper data-testid={`ds-chat-bubble-${dsId}`} type={type}>\n <StyledColoredBubble type={type}>\n <StyledTitleBubble cols={[1, 'auto']} gutter=\"xs\" alignItems=\"flex-end\" className=\"sr-only\">\n <StyledTitleLeftBubble alignItems=\"center\" data-testid={`chat-bubble-title-${dsId}`}>\n {title}\n </StyledTitleLeftBubble>\n <StyledTitleRightBubble alignItems=\"center\" type={type} data-testid={`chat-bubble-time-${dsId}`}>\n {time}\n </StyledTitleRightBubble>\n </StyledTitleBubble>\n <StyleBodyWrapper data-testid={`chat-bubble-body-${dsId}`}>\n {bodyParts.map((item, index) => (\n <React.Fragment key={item}>\n {item}\n {index < bodyParts.length - 1 ? <br /> : null}\n </React.Fragment>\n ))}\n </StyleBodyWrapper>\n <ChatBubbleArrow type={type} />\n </StyledColoredBubble>\n {errorMessage ? (\n <StyleErrorMessage data-testid={`chat-bubble-error-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{errorMessage}</span>\n <Warning />\n </StyleErrorMessage>\n ) : null}\n {helpMessage ? (\n <StyleHelpMessage data-testid={`chat-bubble-help-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{helpMessage}</span>\n </StyleHelpMessage>\n ) : null}\n </StyledWrapper>\n );\n};\nChatBubble.propTypes = propsBubbles;\n\nconst ChatBubbleWithSchema = describe(ChatBubble);\nChatBubbleWithSchema.propTypes = propsBubbles;\n\nexport { ChatBubble, ChatBubbleWithSchema };\n"],"names":["ChatBubble","props","useValidateProps","ChatBubbleWithSchema","toJSON","dsId","type","title","time","body","errorMessage","helpMessage","bodyParts","React","useMemo","split","map","item","index","length","propTypes","propsBubbles","describe"],"mappings":";;;;;;;;;;;;;IAiBMA,UAAU,GAAG,SAAbA,UAAa,CAACC,KAAD,EAAqC;AACtDC,EAAAA,gBAAgB,CAACD,KAAD,EAAQE,oBAAoB,CAACC,MAArB,EAAR,CAAhB;AAEA,MAAQC,IAAR,GAAqEJ,KAArE,CAAQI,IAAR;AAAA,MAAcC,IAAd,GAAqEL,KAArE,CAAcK,IAAd;AAAA,MAAoBC,KAApB,GAAqEN,KAArE,CAAoBM,KAApB;AAAA,MAA2BC,IAA3B,GAAqEP,KAArE,CAA2BO,IAA3B;AAAA,MAAiCC,IAAjC,GAAqER,KAArE,CAAiCQ,IAAjC;AAAA,MAAuCC,YAAvC,GAAqET,KAArE,CAAuCS,YAAvC;AAAA,MAAqDC,WAArD,GAAqEV,KAArE,CAAqDU,WAArD;AACA,MAAMC,SAAS,GAAGC,KAAK,CAACC,OAAN,CAAc;AAAA,WAAML,IAAI,CAACM,KAAL,CAAW,IAAX,CAAN;AAAA,GAAd,EAAsC,CAACN,IAAD,CAAtC,CAAlB;AAEA,sBACE,oBAAC,aAAD;AAAe,4CAA+BJ,IAA/B,CAAf;AAAsD,IAAA,IAAI,EAAEC;AAA5D,kBACE,oBAAC,mBAAD;AAAqB,IAAA,IAAI,EAAEA;AAA3B,kBACE,oBAAC,iBAAD;AAAmB,IAAA,IAAI,EAAE,CAAC,CAAD,EAAI,MAAJ,CAAz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C,YAAvB;IAEMlB,oBAAoB,GAAGmB,QAAQ,CAACtB,UAAD;AACrCG,oBAAoB,CAACiB,SAArB,GAAiCC,YAAjC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-chat",
3
- "version": "1.57.0-rc.1",
3
+ "version": "1.57.0-rc.2",
4
4
  "license": "MIT",
5
5
  "description": "Ellie Mae - Dim Sum - Chat",
6
6
  "main": "cjs/index.js",
@@ -16,14 +16,14 @@
16
16
  "directory": "dist"
17
17
  },
18
18
  "dependencies": {
19
- "@elliemae/ds-banner": "1.57.0-rc.1",
20
- "@elliemae/ds-basic": "1.57.0-rc.1",
21
- "@elliemae/ds-button": "1.57.0-rc.1",
22
- "@elliemae/ds-grid": "1.57.0-rc.1",
23
- "@elliemae/ds-icons": "1.57.0-rc.1",
24
- "@elliemae/ds-props-helpers": "1.57.0-rc.1",
25
- "@elliemae/ds-tooltip": "1.57.0-rc.1",
26
- "@elliemae/ds-truncated-tooltip-text": "1.57.0-rc.1",
19
+ "@elliemae/ds-banner": "1.57.0-rc.2",
20
+ "@elliemae/ds-basic": "1.57.0-rc.2",
21
+ "@elliemae/ds-button": "1.57.0-rc.2",
22
+ "@elliemae/ds-grid": "1.57.0-rc.2",
23
+ "@elliemae/ds-icons": "1.57.0-rc.2",
24
+ "@elliemae/ds-props-helpers": "1.57.0-rc.2",
25
+ "@elliemae/ds-tooltip": "1.57.0-rc.2",
26
+ "@elliemae/ds-truncated-tooltip-text": "1.57.0-rc.2",
27
27
  "prop-types": "~15.7.2",
28
28
  "react-desc": "^4.1.2",
29
29
  "react-virtual": "^2.3.2"