@zohoim/chat-components 0.0.15 → 0.0.16

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 (142) hide show
  1. package/es/ActionIcon/ActionIcon.js +2 -0
  2. package/es/ActionIconWrapper/ActionIconWrapper.js +6 -2
  3. package/es/ActionIconWrapper/props/propTypes.js +1 -0
  4. package/es/AttachmentBubble/AttachmentBubble.js +24 -8
  5. package/es/AttachmentBubble/css/AttachmentBubble.module.css +15 -1
  6. package/es/AttachmentBubble/css/cssJSLogic.js +15 -0
  7. package/es/AttachmentBubble/props/propTypes.js +2 -1
  8. package/es/AttachmentBubbleInfo/AttachmentBubbleInfo.js +13 -2
  9. package/es/AttachmentBubbleInfo/css/AttachmentBubbleInfo.module.css +9 -0
  10. package/es/AttachmentBubbleInfo/css/cssJSLogic.js +13 -0
  11. package/es/AttachmentBubbleInfo/props/propTypes.js +2 -1
  12. package/es/AttachmentIcon/AttachmentIcon.js +3 -1
  13. package/es/AttachmentIcon/css/AttachmentIcon.module.css +2 -2
  14. package/es/AttachmentIcon/props/propTypes.js +6 -0
  15. package/es/AttachmentIcon/utils/getAttachmentIconComponent.js +4 -3
  16. package/es/AudioBubble/AudioBubble.js +5 -2
  17. package/es/AudioBubble/props/propTypes.js +2 -1
  18. package/es/ImageBubble/ImageBubble.js +13 -2
  19. package/es/ImageBubble/css/ImageBubble.module.css +8 -2
  20. package/es/ImageBubble/css/cssJSLogic.js +13 -0
  21. package/es/ImageBubble/props/propTypes.js +2 -1
  22. package/es/LocationBubble/LocationBubble.js +13 -2
  23. package/es/LocationBubble/css/LocationBubble.module.css +14 -1
  24. package/es/LocationBubble/css/cssJSLogic.js +13 -0
  25. package/es/LocationBubble/props/propTypes.js +2 -1
  26. package/es/MediaBubbleWrapper/MediaBubbleWrapper.js +5 -2
  27. package/es/MediaBubbleWrapper/props/propTypes.js +2 -1
  28. package/es/Message/Message.js +4 -2
  29. package/es/MessageAction/MessageAction.js +3 -0
  30. package/es/MessageAction/props/propTypes.js +1 -0
  31. package/es/MessageActions/MessageActions.js +14 -2
  32. package/es/MessageActions/props/propTypes.js +1 -0
  33. package/es/MessageBox/MessageBox.js +2 -2
  34. package/es/MessageBubble/MessageBubble.js +16 -11
  35. package/es/MessageStatus/css/MessageStatus.module.css +0 -3
  36. package/es/MoreActionItem/MoreActionItem.js +8 -0
  37. package/es/MoreActionItem/props/propTypes.js +1 -0
  38. package/es/ReplyBubble/ReplyBubble.js +32 -13
  39. package/es/ReplyBubble/css/ReplyBubble.module.css +1 -1
  40. package/es/ReplyBubble/props/propTypes.js +8 -2
  41. package/es/ReplyBubbleContent/ReplyBubbleContent.js +11 -2
  42. package/es/ReplyBubbleContent/css/ReplyBubbleContent.module.css +21 -3
  43. package/es/ReplyBubbleContent/css/cssJSLogic.js +13 -0
  44. package/es/ReplyBubbleContent/props/propTypes.js +2 -1
  45. package/es/ReplyBubbleHeader/ReplyBubbleHeader.js +20 -5
  46. package/es/ReplyBubbleHeader/css/ReplyBubbleHeader.module.css +12 -0
  47. package/es/ReplyBubbleHeader/css/cssJSLogic.js +12 -0
  48. package/es/ReplyBubbleHeader/props/defaultProps.js +2 -1
  49. package/es/ReplyBubbleHeader/props/propTypes.js +6 -2
  50. package/es/TextBubble/TextBubble.js +15 -3
  51. package/es/TextBubble/css/TextBubble.module.css +13 -0
  52. package/es/TextBubble/css/cssJSLogic.js +18 -0
  53. package/es/TextBubble/props/propTypes.js +2 -1
  54. package/es/Theme/themeVariables/commonThemeColorVariable.js +1 -2
  55. package/es/Theme/themeVariables/dark/blueTheme.js +97 -40
  56. package/es/Theme/themeVariables/dark/commonColorVariable.js +7 -1
  57. package/es/Theme/themeVariables/dark/greenTheme.js +95 -38
  58. package/es/Theme/themeVariables/dark/orangeTheme.js +94 -37
  59. package/es/Theme/themeVariables/dark/redTheme.js +94 -46
  60. package/es/Theme/themeVariables/dark/yellowTheme.js +94 -37
  61. package/es/Theme/themeVariables/light/blueTheme.js +96 -35
  62. package/es/Theme/themeVariables/light/commonColorVariable.js +8 -1
  63. package/es/Theme/themeVariables/light/greenTheme.js +96 -35
  64. package/es/Theme/themeVariables/light/orangeTheme.js +97 -34
  65. package/es/Theme/themeVariables/light/redTheme.js +97 -34
  66. package/es/Theme/themeVariables/light/yellowTheme.js +96 -35
  67. package/es/Theme/themeVariables/pureDark/blueTheme.js +93 -37
  68. package/es/Theme/themeVariables/pureDark/commonColorVariable.js +7 -1
  69. package/es/Theme/themeVariables/pureDark/greenTheme.js +94 -37
  70. package/es/Theme/themeVariables/pureDark/orangeTheme.js +94 -37
  71. package/es/Theme/themeVariables/pureDark/redTheme.js +94 -37
  72. package/es/Theme/themeVariables/pureDark/yellowTheme.js +94 -37
  73. package/es/VideoBubble/VideoBubble.js +5 -2
  74. package/es/VideoBubble/props/propTypes.js +2 -1
  75. package/es/icons/iconSrc/attachments/Text.js +47 -0
  76. package/es/icons/iconSrc/attachments/index.js +1 -1
  77. package/es/im/ArticleBubble/ArticleBubble.js +16 -3
  78. package/es/im/ArticleBubble/css/ArticleBubble.module.css +18 -3
  79. package/es/im/ArticleBubble/css/cssJSLogic.js +12 -0
  80. package/es/im/ArticleBubble/props/propTypes.js +2 -1
  81. package/es/im/IMAutoMessageInfo/css/IMAutoMessageInfo.module.css +1 -0
  82. package/es/im/IMIntegrationIcon/css/IMIntegrationIcon.module.css +1 -6
  83. package/es/im/IMMessage/IMMessage.js +28 -4
  84. package/es/im/IMMessage/props/propTypes.js +25 -1
  85. package/es/im/IMMessageContent/IMMessageContent.js +39 -42
  86. package/es/im/IMMessageContent/css/IMMessageContent.module.css +6 -2
  87. package/es/im/IMMessageContent/props/propTypes.js +7 -2
  88. package/es/im/IMMessageMeta/IMMessageMeta.js +8 -8
  89. package/es/im/IMMessageMeta/css/IMMessageMeta.module.css +1 -1
  90. package/es/im/IMMessageMeta/props/defaultProps.js +1 -1
  91. package/es/im/IMPermaLink/css/IMPermaLink.module.css +1 -1
  92. package/es/im/IMReplyBubble/IMReplyBubble.js +10 -5
  93. package/es/im/IMReplyBubble/props/propTypes.js +7 -2
  94. package/es/im/IMTextBubble/IMTextBubble.js +5 -2
  95. package/es/im/IMTextBubble/props/propTypes.js +2 -1
  96. package/es/im/css/common.module.css +2 -2
  97. package/es/im/index.js +0 -1
  98. package/es/index.js +0 -1
  99. package/package.json +4 -21
  100. package/es/InfoBubble/InfoBubble.js +0 -34
  101. package/es/InfoBubble/css/InfoBubble.module.css +0 -0
  102. package/es/InfoBubble/css/cssJSLogic.js +0 -10
  103. package/es/InfoBubble/index.js +0 -1
  104. package/es/InfoBubble/props/defaultProps.js +0 -6
  105. package/es/InfoBubble/props/propTypes.js +0 -6
  106. package/es/Theme/crm/dark/blueFanTheme.js +0 -28
  107. package/es/Theme/crm/dark/blueTheme.js +0 -28
  108. package/es/Theme/crm/dark/commonColorVariable.js +0 -11
  109. package/es/Theme/crm/dark/darkBlueTheme.js +0 -28
  110. package/es/Theme/crm/dark/darkGreyTheme.js +0 -28
  111. package/es/Theme/crm/dark/greenTheme.js +0 -28
  112. package/es/Theme/crm/dark/orangeTheme.js +0 -28
  113. package/es/Theme/crm/dark/pinkTheme.js +0 -28
  114. package/es/Theme/crm/dark/tealTheme.js +0 -28
  115. package/es/Theme/crm/dark/whiteTheme.js +0 -28
  116. package/es/Theme/crm/light/blueFanTheme.js +0 -28
  117. package/es/Theme/crm/light/blueTheme.js +0 -31
  118. package/es/Theme/crm/light/commonColorVariable.js +0 -9
  119. package/es/Theme/crm/light/darkBlueTheme.js +0 -28
  120. package/es/Theme/crm/light/darkGreyTheme.js +0 -28
  121. package/es/Theme/crm/light/greenTheme.js +0 -28
  122. package/es/Theme/crm/light/orangeTheme.js +0 -28
  123. package/es/Theme/crm/light/pinkTheme.js +0 -28
  124. package/es/Theme/crm/light/tealTheme.js +0 -28
  125. package/es/Theme/crm/light/whiteTheme.js +0 -28
  126. package/es/Theme/crm/pureDark/blueFanTheme.js +0 -28
  127. package/es/Theme/crm/pureDark/blueTheme.js +0 -28
  128. package/es/Theme/crm/pureDark/commonColorVariable.js +0 -9
  129. package/es/Theme/crm/pureDark/darkBlueTheme.js +0 -28
  130. package/es/Theme/crm/pureDark/darkGreyTheme.js +0 -28
  131. package/es/Theme/crm/pureDark/greenTheme.js +0 -28
  132. package/es/Theme/crm/pureDark/orangeTheme.js +0 -28
  133. package/es/Theme/crm/pureDark/pinkTheme.js +0 -28
  134. package/es/Theme/crm/pureDark/tealTheme.js +0 -28
  135. package/es/Theme/crm/pureDark/whiteTheme.js +0 -28
  136. package/es/im/IMInfoBubble/IMInfoBubble.js +0 -34
  137. package/es/im/IMInfoBubble/css/IMInfoBubble.module.css +0 -0
  138. package/es/im/IMInfoBubble/css/cssJSLogic.js +0 -10
  139. package/es/im/IMInfoBubble/index.js +0 -1
  140. package/es/im/IMInfoBubble/props/defaultProps.js +0 -6
  141. package/es/im/IMInfoBubble/props/propTypes.js +0 -6
  142. /package/es/icons/factory/attachments/{txt.svg → text.svg} +0 -0
@@ -13,7 +13,7 @@ import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler
13
13
  import cssJSLogic from './css/cssJSLogic';
14
14
  /** ** Components *** */
15
15
 
16
- import { Container, Box } from '@zohodesk/components/es/Layout';
16
+ import { Box } from '@zohodesk/components/es/Layout';
17
17
  /** ** Styles *** */
18
18
 
19
19
  import style from './css/MessageBox.module.css';
@@ -46,7 +46,7 @@ export default function MessageBox(props) {
46
46
  const messageConent = renderHandler(renderMessageContent)();
47
47
  const messageFooter = renderHandler(renderMessageFooter)();
48
48
  const messageStatus = renderHandler(renderMessageStatus)();
49
- return /*#__PURE__*/React.createElement(Container, {
49
+ return /*#__PURE__*/React.createElement("div", {
50
50
  className: messageBoxClass
51
51
  }, /*#__PURE__*/React.createElement(Box, {
52
52
  className: newStyle.messageBoxInner,
@@ -1,5 +1,7 @@
1
+ /* eslint-disable no-confusing-arrow */
2
+
1
3
  /** ** Libraries *** */
2
- import React, { useCallback } from 'react';
4
+ import React, { useCallback, useMemo } from 'react';
3
5
  /** ** Hooks *** */
4
6
 
5
7
  import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
@@ -14,7 +16,7 @@ import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler
14
16
  import cssJSLogic from './css/cssJSLogic';
15
17
  /** ** Components *** */
16
18
 
17
- import { Container, Box } from '@zohodesk/components/es/Layout';
19
+ import { Box } from '@zohodesk/components/es/Layout';
18
20
  /** ** Styles *** */
19
21
 
20
22
  import style from './css/MessageBubble.module.css';
@@ -75,13 +77,11 @@ export default function MessageBubble(props) {
75
77
  }, [renderMessageBox, newStyle.messageBoxWrapper]);
76
78
  /* Message BoxWithActions Render */
77
79
 
78
- const messageBoxWithActionsRenderer = useCallback(() => {
79
- const messageBox = messageBoxRenderer();
80
- const messageActions = messageActionsRenderer();
81
- return messageBox || messageActions ? /*#__PURE__*/React.createElement(Box, {
82
- className: newStyle.messageContainer
83
- }, messageBox, messageActions) : null;
84
- }, [messageBoxRenderer, messageActionsRenderer, newStyle.messageContainer]);
80
+ const messageBox = useMemo(() => messageBoxRenderer(), [messageBoxRenderer]);
81
+ const messageActions = useMemo(() => messageActionsRenderer(), [messageActionsRenderer]);
82
+ const messageBoxWithActionsRenderer = useCallback(() => messageBox || messageActions ? /*#__PURE__*/React.createElement(Box, {
83
+ className: newStyle.messageContainer
84
+ }, messageBox, messageActions) : null, [messageBox, messageActions, newStyle.messageContainer]);
85
85
  /* Message Footer Render */
86
86
 
87
87
  const messageFooterRenderer = useCallback(() => {
@@ -90,13 +90,18 @@ export default function MessageBubble(props) {
90
90
  className: newStyle.messageBoxFooterWrapper
91
91
  }, messageBoxFooter) : null;
92
92
  }, [renderMessageBoxFooter, newStyle.messageBoxFooterWrapper]);
93
+ /* Get the components */
94
+
95
+ const messageSender = useMemo(() => messageSenderRenderer(), [messageSenderRenderer]);
96
+ const messageBoxWithActions = useMemo(() => messageBoxWithActionsRenderer(), [messageBoxWithActionsRenderer]);
97
+ const messageFooter = useMemo(() => messageFooterRenderer(), [messageFooterRenderer]);
93
98
  /* Construct Layout */
94
99
 
95
- const messageLayout = /*#__PURE__*/React.createElement(Container, {
100
+ const messageLayout = /*#__PURE__*/React.createElement("div", {
96
101
  className: bubbleClass,
97
102
  onMouseEnter: onMouseEnter,
98
103
  onMouseLeave: onMouseLeave
99
- }, messageSenderRenderer(), messageBoxWithActionsRenderer(), messageFooterRenderer());
104
+ }, messageSender, messageBoxWithActions, messageFooter);
100
105
  return messageLayout;
101
106
  }
102
107
  MessageBubble.propTypes = messageBubblePropTypes;
@@ -1,15 +1,12 @@
1
1
  .messageStatus {
2
2
  /* USe this class name status customization */
3
- /* color: #61667a; */
4
3
  color: var(--imlib_chat_components_messageStatus_send_color);
5
4
  }
6
5
 
7
6
  .readStatus{
8
- /* color: #0a73eb; */
9
7
  color: var(--imlib_chat_components_messageStatus_read_color);
10
8
  }
11
9
 
12
10
  .failedStatus{
13
- /* color: #de3535 */
14
11
  color: var(--imlib_chat_components_messageStatus_failed_color);
15
12
  }
@@ -26,6 +26,7 @@ export default function MoreActionItem(props) {
26
26
  renderIcon,
27
27
  needIcon,
28
28
  onClick,
29
+ onMouseEnter,
29
30
  closePopup,
30
31
  isDisabled
31
32
  } = props;
@@ -36,6 +37,12 @@ export default function MoreActionItem(props) {
36
37
  id
37
38
  });
38
39
  }, [closePopup, onClick, id, isDisabled]);
40
+ const handleMouseEnter = useCallback(e => {
41
+ !isDisabled && onMouseEnter && onMouseEnter({
42
+ e,
43
+ id
44
+ });
45
+ }, [onMouseEnter, id, isDisabled]);
39
46
  /* External CSS Customization */
40
47
 
41
48
  const newStyle = useMergeStyle(style, customStyle);
@@ -49,6 +56,7 @@ export default function MoreActionItem(props) {
49
56
  id: id,
50
57
  isDisabled: isDisabled,
51
58
  onClick: handleClick,
59
+ onMouseEnter: handleMouseEnter,
52
60
  title: title
53
61
  }, /*#__PURE__*/React.createElement(Container, {
54
62
  align: "vertical",
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
3
3
  const moreActionItemPropTypes = {
4
4
  displayText: PropTypes.string.isRequired,
5
5
  onClick: PropTypes.func.isRequired,
6
+ onMouseEnter: PropTypes.func,
6
7
  closePopup: PropTypes.func,
7
8
  customStyle: PropTypes.object,
8
9
  id: PropTypes.string,
@@ -18,16 +18,19 @@ import style from './css/ReplyBubble.module.css';
18
18
  import ReplyBubbleHeader from '../ReplyBubbleHeader/ReplyBubbleHeader';
19
19
  import ReplyBubbleContent from '../ReplyBubbleContent/ReplyBubbleContent';
20
20
  import AttachmentIcon from '../AttachmentIcon/AttachmentIcon';
21
+ import LocationBubble from '../LocationBubble/LocationBubble';
21
22
  export default function ReplyBubble(props) {
22
23
  const {
23
24
  customStyle,
24
25
  senderName,
25
- time,
26
+ dateTimeDetails,
26
27
  replyText,
27
28
  message,
28
29
  attachmentDetails,
30
+ locationUrl,
29
31
  onClick,
30
- customProps
32
+ customProps,
33
+ isFailed
31
34
  } = props;
32
35
  const {
33
36
  headerProps = dummyObject,
@@ -37,7 +40,8 @@ export default function ReplyBubble(props) {
37
40
  const {
38
41
  fileName,
39
42
  fileURL,
40
- fileFormat
43
+ fileFormat,
44
+ mediaType
41
45
  } = attachmentDetails || dummyObject;
42
46
  /* External CSS Customization */
43
47
 
@@ -45,13 +49,25 @@ export default function ReplyBubble(props) {
45
49
  const iconStyle = useMemo(() => ({
46
50
  $icon: newStyle.attachmentIcon
47
51
  }), [newStyle.attachmentIcon]);
48
- const renderMessage = useCallback( // eslint-disable-next-line no-confusing-arrow
49
- () => // eslint-disable-next-line react/no-danger, @zohodesk/zsecurity/no-unsecure-html
50
- message ? /*#__PURE__*/React.createElement("span", {
51
- dangerouslySetInnerHTML: {
52
- __html: message
52
+ const renderMessage = useCallback(() => {
53
+ if (locationUrl) {
54
+ return /*#__PURE__*/React.createElement(LocationBubble, {
55
+ isFailed: isFailed,
56
+ locationUrl: locationUrl
57
+ });
53
58
  }
54
- }) : null, [message]);
59
+
60
+ if (message) {
61
+ // eslint-disable-next-line @zohodesk/zsecurity/no-unsecure-html, react/no-danger
62
+ return /*#__PURE__*/React.createElement("span", {
63
+ dangerouslySetInnerHTML: {
64
+ __html: message
65
+ }
66
+ });
67
+ }
68
+
69
+ return null;
70
+ }, [message, locationUrl, isFailed]);
55
71
  const renderIcon = useCallback(() => {
56
72
  if (fileURL) {
57
73
  return /*#__PURE__*/React.createElement("div", {
@@ -66,18 +82,21 @@ export default function ReplyBubble(props) {
66
82
  if (fileFormat) {
67
83
  return /*#__PURE__*/React.createElement(AttachmentIcon, _extends({
68
84
  customStyle: iconStyle,
69
- fileFormat: fileFormat
85
+ fileFormat: fileFormat,
86
+ mediaType: mediaType
70
87
  }, iconProps));
71
88
  }
72
89
 
73
90
  return null;
74
- }, [fileURL, fileName, fileFormat, iconStyle, iconProps, newStyle.imageWrapper, newStyle.image]);
91
+ }, [fileURL, fileName, fileFormat, mediaType, iconStyle, iconProps, newStyle.imageWrapper, newStyle.image]);
75
92
  return /*#__PURE__*/React.createElement("div", {
76
93
  onClick: onClick
77
94
  }, /*#__PURE__*/React.createElement(ReplyBubbleHeader, _extends({
78
- replyText: replyText,
79
- time: time
95
+ dateTimeDetails: dateTimeDetails,
96
+ isFailed: isFailed,
97
+ replyText: replyText
80
98
  }, headerProps)), /*#__PURE__*/React.createElement(ReplyBubbleContent, _extends({
99
+ isFailed: isFailed,
81
100
  renderIcon: renderIcon,
82
101
  renderMessage: renderMessage,
83
102
  senderName: senderName
@@ -14,4 +14,4 @@
14
14
  height: 100% ;
15
15
  object-fit: cover;
16
16
  border-radius: 3px;
17
- }
17
+ }
@@ -8,14 +8,20 @@ const replyBubblePropTypes = {
8
8
  attachmentDetails: PropTypes.shape({
9
9
  fileFormat: PropTypes.string,
10
10
  fileName: PropTypes.string,
11
- fileURL: PropTypes.string
11
+ fileURL: PropTypes.string,
12
+ mediaType: PropTypes.string
12
13
  }),
14
+ locationUrl: PropTypes.string,
13
15
  customProps: PropTypes.shape({
14
16
  contentProps: PropTypes.object,
15
17
  headerProps: PropTypes.object,
16
18
  iconProps: PropTypes.object
17
19
  }),
18
20
  customStyle: PropTypes.object,
19
- time: PropTypes.string
21
+ dateTimeDetails: PropTypes.shape({
22
+ displayDateTime: PropTypes.string,
23
+ tooltip: PropTypes.string
24
+ }),
25
+ isFailed: PropTypes.bool
20
26
  };
21
27
  export default replyBubblePropTypes;
@@ -10,6 +10,7 @@ import replyBubbleContentPropTypes from './props/propTypes';
10
10
  /** ** Methods *** */
11
11
 
12
12
  import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
13
+ import cssJSLogic from './css/cssJSLogic';
13
14
  /** ** Styles *** */
14
15
 
15
16
  import style from './css/ReplyBubbleContent.module.css';
@@ -21,17 +22,25 @@ export default function ReplyBubbleContent(props) {
21
22
  customStyle,
22
23
  senderName,
23
24
  renderIcon,
24
- renderMessage
25
+ renderMessage,
26
+ isFailed
25
27
  } = props;
26
28
  /* External CSS Customization */
27
29
 
28
30
  const newStyle = useMergeStyle(style, customStyle);
31
+ /* css classnames added based on logic */
32
+
33
+ const {
34
+ replyBubbleContentClass
35
+ } = cssJSLogic({
36
+ isFailed
37
+ }, newStyle);
29
38
  const icon = renderHandler(renderIcon)();
30
39
  const messageContent = renderHandler(renderMessage)();
31
40
  return /*#__PURE__*/React.createElement(Container, {
32
41
  align: "vertical",
33
42
  alignBox: "row",
34
- className: newStyle.replyBubbleContent,
43
+ className: replyBubbleContentClass,
35
44
  isCover: false
36
45
  }, icon ? /*#__PURE__*/React.createElement(Box, {
37
46
  className: newStyle.iconWrapper
@@ -4,12 +4,18 @@
4
4
  border: 1px solid var(--imlib_chat_components_replyBubbleContent_border_color);
5
5
  border-radius: 3px;
6
6
  margin: var(--zd_size5) 0 ;
7
+ cursor: pointer;
7
8
  }[dir=ltr] .replyBubbleContent {
8
9
  padding: var(--zd_size10) var(--zd_size10) var(--zd_size10) var(--zd_size20) ;
9
10
  }[dir=rtl] .replyBubbleContent {
10
11
  padding: var(--zd_size10) var(--zd_size20) var(--zd_size10) var(--zd_size10) ;
11
12
  }
12
13
 
14
+ .failedReplyBubbleContent{
15
+ background-color: var(--imlib_chat_components_replyBubbleContent_bg_color_failed);
16
+ border-color: var(--imlib_chat_components_replyBubbleContent_border_color_failed);
17
+ }
18
+
13
19
  .replyBubbleContent::after {
14
20
  content: '';
15
21
  width: var(--zd_size2) ;
@@ -29,11 +35,20 @@
29
35
  right: var(--zd_size10) ;
30
36
  }
31
37
 
38
+ .failedReplyBubbleContent::after{
39
+ background-color: var(--imlib_chat_components_replyBubbleContent_line_color_failed);
40
+ }
41
+
32
42
  .name {
33
- color: var(--imlib_chat_components_replyBubbleContent_color);
43
+ color: var(--imlib_chat_components_replyBubbleContent_sender_color);
34
44
  font-size: var(--zd_font_size15) ;
35
45
  line-height: 1.5;
36
46
  composes: dotted from "../../css/common.module.css";
47
+ font-family: var(--zd_semibold);
48
+ }
49
+
50
+ .failedReplyBubbleContent .name{
51
+ color: var(--imlib_chat_components_replyBubbleContent_sender_color_failed);
37
52
  }
38
53
 
39
54
  [dir=ltr] .iconWrapper {
@@ -45,13 +60,16 @@
45
60
  }
46
61
 
47
62
  .messageWrapper {
48
- color: var(--imlib_chat_components_replyBubbleContent_color);
63
+ color: var(--imlib_chat_components_replyBubbleContent_content_color);
49
64
  font-size: var(--zd_font_size13) ;
50
65
  line-height: 1.5;
51
- max-height: var(--zd_size40) ;
52
66
  -webkit-line-clamp: 2;
53
67
  display: -webkit-box;
54
68
  -webkit-box-orient: vertical;
55
69
  word-break: break-word;
56
70
  overflow: hidden;
57
71
  }
72
+
73
+ .failedReplyBubbleContent .messageWrapper{
74
+ color: var(--imlib_chat_components_replyBubbleContent_content_color_failed);
75
+ }
@@ -0,0 +1,13 @@
1
+ import { compileClassNames } from '@zohodesk/utils';
2
+ export default function cssJSLogic(props, style) {
3
+ const {
4
+ isFailed
5
+ } = props;
6
+ const replyBubbleContentClass = compileClassNames({
7
+ [style.replyBubbleContent]: true,
8
+ [style.failedReplyBubbleContent]: isFailed
9
+ });
10
+ return {
11
+ replyBubbleContentClass
12
+ };
13
+ }
@@ -4,6 +4,7 @@ const replyBubbleContentPropTypes = {
4
4
  renderIcon: PropTypes.func.isRequired,
5
5
  renderMessage: PropTypes.func.isRequired,
6
6
  senderName: PropTypes.string.isRequired,
7
- customStyle: PropTypes.object
7
+ customStyle: PropTypes.object,
8
+ isFailed: PropTypes.bool
8
9
  };
9
10
  export default replyBubbleContentPropTypes;
@@ -19,19 +19,32 @@ import ReplyIcon from '@zohodesk/icon/es/general/Reply';
19
19
  /** ** Methods *** */
20
20
 
21
21
  import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
22
+ import cssJSLogic from './css/cssJSLogic';
22
23
  export default function ReplyBubbleHeader(props) {
23
24
  const {
24
25
  customStyle,
25
26
  replyText,
26
- time,
27
- renderCustomReplyIcon
27
+ dateTimeDetails,
28
+ renderCustomReplyIcon,
29
+ isFailed
28
30
  } = props;
31
+ const {
32
+ displayDateTime,
33
+ tooltip
34
+ } = dateTimeDetails;
29
35
  /* External CSS Customization */
30
36
 
31
37
  const newStyle = useMergeStyle(style, customStyle);
32
38
  const iconStyle = useMemo(() => ({
33
39
  base: newStyle.replyIcon
34
40
  }), [newStyle.replyIcon]);
41
+ /* css classnames added based on logic */
42
+
43
+ const {
44
+ replyBubbleHeaderClass
45
+ } = cssJSLogic({
46
+ isFailed
47
+ }, newStyle);
35
48
  const renderIcon = useCallback(() => {
36
49
  const customIcon = renderHandler(renderCustomReplyIcon)();
37
50
  return customIcon || /*#__PURE__*/React.createElement(ReplyIcon, {
@@ -40,13 +53,15 @@ export default function ReplyBubbleHeader(props) {
40
53
  }, [iconStyle, renderCustomReplyIcon]);
41
54
  return /*#__PURE__*/React.createElement(Container, {
42
55
  align: "vertical",
43
- alignBox: "row"
56
+ alignBox: "row",
57
+ className: replyBubbleHeaderClass
44
58
  }, renderIcon(), /*#__PURE__*/React.createElement(Box, {
45
59
  className: newStyle.replyText,
46
60
  flexible: true
47
61
  }, replyText), /*#__PURE__*/React.createElement(Box, {
48
- className: newStyle.time
49
- }, time));
62
+ className: newStyle.time,
63
+ "data-title": tooltip
64
+ }, displayDateTime));
50
65
  }
51
66
  ReplyBubbleHeader.propTypes = replyBubbleHeaderPropTypes;
52
67
  ReplyBubbleHeader.defaultProps = replyBubbleHeaderDefaultProps;
@@ -11,6 +11,7 @@
11
11
 
12
12
  .replyText {
13
13
  font-size: var(--zd_font_size14) ;
14
+ color: var(--imlib_chat_components_replyBubbleHeader_text_color);
14
15
  }
15
16
 
16
17
  [dir=ltr] .replyText {
@@ -21,6 +22,10 @@
21
22
  margin-left: var(--zd_size5) ;
22
23
  }
23
24
 
25
+ .failedReplyBubbleHeader .replyText{
26
+ color: var(--imlib_chat_components_replyBubbleHeader_text_color_failed);
27
+ }
28
+
24
29
  .replyText,
25
30
  .time{
26
31
  composes: dotted from "../../css/common.module.css";
@@ -28,4 +33,11 @@
28
33
 
29
34
  .time{
30
35
  max-width: 40% ;
36
+ font-size: var(--zd_font_size11) ;
37
+ letter-spacing: .4px;
38
+ color: var(--imlib_chat_components_replyBubbleHeader_time_color);
39
+ }
40
+
41
+ .failedReplyBubbleHeader .time{
42
+ color: var(--imlib_chat_components_replyBubbleHeader_time_color_failed);
31
43
  }
@@ -0,0 +1,12 @@
1
+ import { compileClassNames } from '@zohodesk/utils';
2
+ export default function cssJSLogic(props, style) {
3
+ const {
4
+ isFailed
5
+ } = props;
6
+ const replyBubbleHeaderClass = compileClassNames({
7
+ [style.failedReplyBubbleHeader]: isFailed
8
+ });
9
+ return {
10
+ replyBubbleHeaderClass
11
+ };
12
+ }
@@ -1,6 +1,7 @@
1
1
  /** ** Constants *** */
2
2
  import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
3
3
  const replyBubbleHeaderDefaultProps = {
4
- customStyle: dummyObject
4
+ customStyle: dummyObject,
5
+ dateTimeDetails: dummyObject
5
6
  };
6
7
  export default replyBubbleHeaderDefaultProps;
@@ -3,7 +3,11 @@ import PropTypes from 'prop-types';
3
3
  const replyBubbleHeaderPropTypes = {
4
4
  replyText: PropTypes.string.isRequired,
5
5
  customStyle: PropTypes.object,
6
- time: PropTypes.string,
7
- renderCustomReplyIcon: PropTypes.func
6
+ dateTimeDetails: PropTypes.shape({
7
+ displayDateTime: PropTypes.string,
8
+ tooltip: PropTypes.string
9
+ }),
10
+ renderCustomReplyIcon: PropTypes.func,
11
+ isFailed: PropTypes.bool
8
12
  };
9
13
  export default replyBubbleHeaderPropTypes;
@@ -10,25 +10,37 @@ import textBubblePropTypes from './props/propTypes';
10
10
  /** ** Styles *** */
11
11
 
12
12
  import style from './css/TextBubble.module.css';
13
+ /** ** Methods *** */
14
+
15
+ import cssJSLogic from './css/cssJSLogic';
13
16
  export default function TextBubble(props) {
14
17
  const {
15
18
  customStyle,
16
19
  moreText,
17
20
  message,
18
- onClickMore
21
+ onClickMore,
22
+ isFailed
19
23
  } = props;
20
24
  /* External CSS Customization */
21
25
 
22
26
  const newStyle = useMergeStyle(style, customStyle);
27
+ /* css classnames added based on logic */
28
+
29
+ const {
30
+ textBubbleClass,
31
+ moreTextClass
32
+ } = cssJSLogic({
33
+ isFailed
34
+ }, newStyle);
23
35
  return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("span", {
24
- className: newStyle.textBubble // eslint-disable-next-line react/no-danger, @zohodesk/zsecurity/no-unsecure-html
36
+ className: textBubbleClass // eslint-disable-next-line react/no-danger, @zohodesk/zsecurity/no-unsecure-html
25
37
  ,
26
38
  dangerouslySetInnerHTML: {
27
39
  // __html: HTMLPurifier.sanitize(message)
28
40
  __html: message
29
41
  }
30
42
  }), moreText ? /*#__PURE__*/React.createElement("div", {
31
- className: newStyle.moreText,
43
+ className: moreTextClass,
32
44
  onClick: onClickMore
33
45
  }, moreText) : null);
34
46
  }
@@ -1,5 +1,10 @@
1
1
  .textBubble {
2
2
  /* Use this class name for css customisation */
3
+ color: var(--imlib_chat_components_textBubble_text_color);
4
+ }
5
+
6
+ .failedTextBubble{
7
+ color: var(--imlib_chat_components_textBubble_text_color_failed);
3
8
  }
4
9
 
5
10
  .moreText {
@@ -9,6 +14,10 @@
9
14
  cursor: pointer;
10
15
  }
11
16
 
17
+ .failedMoreText{
18
+ color: var(--imlib_chat_components_textBubble_see_more_color_failed);
19
+ }
20
+
12
21
  .textBubble a {
13
22
  color: var(--imlib_chat_components_textBubble_url_color);
14
23
  word-break: break-word;
@@ -18,3 +27,7 @@
18
27
  text-decoration: underline !important;
19
28
  /* !important for Desk css overwrite */
20
29
  }
30
+
31
+ .failedTextBubble a{
32
+ color: var(--imlib_chat_components_textBubble_url_color_failed);
33
+ }
@@ -0,0 +1,18 @@
1
+ import { compileClassNames } from '@zohodesk/utils';
2
+ export default function cssJSLogic(props, style) {
3
+ const {
4
+ isFailed
5
+ } = props;
6
+ const textBubbleClass = compileClassNames({
7
+ [style.textBubble]: true,
8
+ [style.failedTextBubble]: isFailed
9
+ });
10
+ const moreTextClass = compileClassNames({
11
+ [style.moreText]: true,
12
+ [style.failedMoreText]: isFailed
13
+ });
14
+ return {
15
+ textBubbleClass,
16
+ moreTextClass
17
+ };
18
+ }
@@ -4,6 +4,7 @@ const textBubblePropTypes = {
4
4
  message: PropTypes.string.isRequired,
5
5
  customStyle: PropTypes.object,
6
6
  moreText: PropTypes.string,
7
- onClickMore: PropTypes.func
7
+ onClickMore: PropTypes.func,
8
+ isFailed: PropTypes.bool
8
9
  };
9
10
  export default textBubblePropTypes;
@@ -7,7 +7,6 @@ export const imIntegrationIcon = {
7
7
  line_color: '#01b901',
8
8
  twillio_color: '#f22f46',
9
9
  instagram_color: 'red',
10
- asap_color: '#0a73eb' // twitter_color: 'red'
11
-
10
+ asap_color: '#0a73eb'
12
11
  };
13
12
  export const messagetextColor = '#e2e4e6';