@zohoim/chat-components 0.0.14 → 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 (181) hide show
  1. package/es/ActionIcon/ActionIcon.js +2 -0
  2. package/es/ActionIconWrapper/ActionIconWrapper.js +15 -3
  3. package/es/ActionIconWrapper/css/ActionIconWrapper.module.css +5 -0
  4. package/es/ActionIconWrapper/css/cssJSLogic.js +14 -0
  5. package/es/ActionIconWrapper/props/propTypes.js +1 -0
  6. package/es/AttachmentBubble/AttachmentBubble.js +26 -9
  7. package/es/AttachmentBubble/css/AttachmentBubble.module.css +16 -1
  8. package/es/AttachmentBubble/css/cssJSLogic.js +15 -0
  9. package/es/AttachmentBubble/props/propTypes.js +2 -1
  10. package/es/AttachmentBubbleInfo/AttachmentBubbleInfo.js +20 -5
  11. package/es/AttachmentBubbleInfo/css/AttachmentBubbleInfo.module.css +11 -3
  12. package/es/AttachmentBubbleInfo/css/cssJSLogic.js +13 -0
  13. package/es/AttachmentBubbleInfo/props/propTypes.js +2 -1
  14. package/es/AttachmentIcon/AttachmentIcon.js +3 -1
  15. package/es/AttachmentIcon/css/AttachmentIcon.module.css +2 -2
  16. package/es/AttachmentIcon/props/propTypes.js +6 -0
  17. package/es/AttachmentIcon/utils/getAttachmentIconComponent.js +12 -5
  18. package/es/AudioBubble/AudioBubble.js +21 -5
  19. package/es/AudioBubble/css/AudioBubble.module.css +4 -0
  20. package/es/AudioBubble/props/defaultProps.js +1 -0
  21. package/es/AudioBubble/props/propTypes.js +2 -1
  22. package/es/ImageBubble/ImageBubble.js +13 -2
  23. package/es/ImageBubble/css/ImageBubble.module.css +8 -2
  24. package/es/ImageBubble/css/cssJSLogic.js +13 -0
  25. package/es/ImageBubble/props/propTypes.js +2 -1
  26. package/es/LocationBubble/LocationBubble.js +15 -3
  27. package/es/LocationBubble/css/LocationBubble.module.css +17 -5
  28. package/es/LocationBubble/css/cssJSLogic.js +13 -0
  29. package/es/LocationBubble/props/propTypes.js +2 -1
  30. package/es/MediaBubbleWrapper/MediaBubbleWrapper.js +7 -4
  31. package/es/MediaBubbleWrapper/css/MediaBubbleWrapper.module.css +4 -0
  32. package/es/MediaBubbleWrapper/props/propTypes.js +2 -1
  33. package/es/Message/Message.js +4 -2
  34. package/es/MessageAction/MessageAction.js +3 -0
  35. package/es/MessageAction/props/propTypes.js +1 -0
  36. package/es/MessageActions/MessageActions.js +18 -4
  37. package/es/MessageActions/props/propTypes.js +1 -0
  38. package/es/MessageBox/MessageBox.js +10 -6
  39. package/es/MessageBox/css/MessageBox.module.css +1 -6
  40. package/es/MessageBubble/MessageBubble.js +21 -13
  41. package/es/MessageStatus/css/MessageStatus.module.css +0 -3
  42. package/es/MoreActionItem/MoreActionItem.js +8 -0
  43. package/es/MoreActionItem/css/MoreActionItem.module.css +1 -3
  44. package/es/MoreActionItem/props/propTypes.js +1 -0
  45. package/es/ReplyBubble/ReplyBubble.js +32 -14
  46. package/es/ReplyBubble/css/ReplyBubble.module.css +3 -3
  47. package/es/ReplyBubble/props/propTypes.js +8 -2
  48. package/es/ReplyBubbleContent/ReplyBubbleContent.js +15 -5
  49. package/es/ReplyBubbleContent/css/ReplyBubbleContent.module.css +22 -7
  50. package/es/ReplyBubbleContent/css/cssJSLogic.js +13 -0
  51. package/es/ReplyBubbleContent/props/propTypes.js +2 -1
  52. package/es/ReplyBubbleHeader/ReplyBubbleHeader.js +24 -9
  53. package/es/ReplyBubbleHeader/css/ReplyBubbleHeader.module.css +37 -6
  54. package/es/ReplyBubbleHeader/css/cssJSLogic.js +12 -0
  55. package/es/ReplyBubbleHeader/props/defaultProps.js +2 -1
  56. package/es/ReplyBubbleHeader/props/propTypes.js +6 -2
  57. package/es/TextBubble/TextBubble.js +17 -5
  58. package/es/TextBubble/css/TextBubble.module.css +16 -1
  59. package/es/TextBubble/css/cssJSLogic.js +18 -0
  60. package/es/TextBubble/props/propTypes.js +2 -1
  61. package/es/Theme/ThemeWrapper.js +2 -2
  62. package/es/Theme/themeVariables/commonThemeColorVariable.js +1 -2
  63. package/es/Theme/themeVariables/dark/blueTheme.js +97 -40
  64. package/es/Theme/themeVariables/dark/commonColorVariable.js +7 -1
  65. package/es/Theme/themeVariables/dark/greenTheme.js +95 -38
  66. package/es/Theme/themeVariables/dark/orangeTheme.js +94 -37
  67. package/es/Theme/themeVariables/dark/redTheme.js +94 -46
  68. package/es/Theme/themeVariables/dark/yellowTheme.js +94 -37
  69. package/es/Theme/themeVariables/light/blueTheme.js +96 -35
  70. package/es/Theme/themeVariables/light/commonColorVariable.js +8 -1
  71. package/es/Theme/themeVariables/light/greenTheme.js +96 -35
  72. package/es/Theme/themeVariables/light/orangeTheme.js +97 -34
  73. package/es/Theme/themeVariables/light/redTheme.js +97 -34
  74. package/es/Theme/themeVariables/light/yellowTheme.js +96 -35
  75. package/es/Theme/themeVariables/pureDark/blueTheme.js +93 -37
  76. package/es/Theme/themeVariables/pureDark/commonColorVariable.js +7 -1
  77. package/es/Theme/themeVariables/pureDark/greenTheme.js +94 -37
  78. package/es/Theme/themeVariables/pureDark/orangeTheme.js +94 -37
  79. package/es/Theme/themeVariables/pureDark/redTheme.js +94 -37
  80. package/es/Theme/themeVariables/pureDark/yellowTheme.js +94 -37
  81. package/es/VideoBubble/VideoBubble.js +7 -3
  82. package/es/VideoBubble/props/propTypes.js +2 -1
  83. package/es/css/common.module.css +6 -0
  84. package/es/icons/factory/common/article.svg +4 -4
  85. package/es/icons/factory/integrations/chInstagram.svg +2 -2
  86. package/es/icons/factory/integrations/chWhatsApp.svg +2 -2
  87. package/es/icons/factory/integrations/ttASAP.svg +6 -1
  88. package/es/icons/factory/integrations/ttLine.svg +8 -0
  89. package/es/icons/factory/integrations/ttTelegram.svg +4 -1
  90. package/es/icons/factory/integrations/ttTwillio.svg +8 -1
  91. package/es/icons/factory/integrations/ttWechat.svg +9 -1
  92. package/es/icons/iconSrc/attachments/Text.js +47 -0
  93. package/es/icons/iconSrc/attachments/index.js +1 -1
  94. package/es/icons/iconSrc/common/Article.js +2 -3
  95. package/es/icons/iconSrc/integrations/ChInstagram.js +2 -3
  96. package/es/icons/iconSrc/integrations/ChWhatsApp.js +2 -3
  97. package/es/icons/iconSrc/integrations/TtASAP.js +11 -15
  98. package/es/icons/iconSrc/integrations/{TtTwitter.js → TtLine.js} +14 -18
  99. package/es/icons/iconSrc/integrations/TtTelegram.js +8 -12
  100. package/es/icons/iconSrc/integrations/TtTwillio.js +15 -19
  101. package/es/icons/iconSrc/integrations/TtWechat.js +19 -20
  102. package/es/icons/iconSrc/integrations/index.js +1 -1
  103. package/es/im/ArticleBubble/ArticleBubble.js +22 -8
  104. package/es/im/ArticleBubble/css/ArticleBubble.module.css +40 -15
  105. package/es/im/ArticleBubble/css/cssJSLogic.js +12 -0
  106. package/es/im/ArticleBubble/props/propTypes.js +2 -1
  107. package/es/im/IMAutoMessageInfo/css/IMAutoMessageInfo.module.css +1 -0
  108. package/es/im/IMIntegrationIcon/IMIntegrationIcon.js +1 -1
  109. package/es/im/IMIntegrationIcon/css/IMIntegrationIcon.module.css +1 -6
  110. package/es/im/IMMessage/IMMessage.js +57 -11
  111. package/es/im/{IMTicketLink/css/IMTicketLink.module.css → IMMessage/css/IMMessage.module.css} +21 -11
  112. package/es/im/IMMessage/css/cssJSLogic.js +23 -0
  113. package/es/im/IMMessage/props/defaultProps.js +2 -1
  114. package/es/im/IMMessage/props/propTypes.js +28 -2
  115. package/es/im/IMMessageContent/IMMessageContent.js +41 -42
  116. package/es/im/IMMessageContent/css/IMMessageContent.module.css +6 -2
  117. package/es/im/IMMessageContent/props/propTypes.js +8 -2
  118. package/es/im/IMMessageMeta/IMMessageMeta.js +8 -8
  119. package/es/im/IMMessageMeta/css/IMMessageMeta.module.css +2 -4
  120. package/es/im/IMMessageMeta/props/defaultProps.js +1 -1
  121. package/es/im/IMPermaLink/IMPermaLink.js +48 -0
  122. package/es/im/IMPermaLink/css/IMPermaLink.module.css +14 -0
  123. package/es/im/{IMTicketLink → IMPermaLink}/css/cssJSLogic.js +3 -3
  124. package/es/im/IMPermaLink/index.js +1 -0
  125. package/es/{InfoBubble → im/IMPermaLink}/props/defaultProps.js +2 -2
  126. package/es/im/IMPermaLink/props/propTypes.js +11 -0
  127. package/es/im/IMReplyBubble/IMReplyBubble.js +10 -5
  128. package/es/im/IMReplyBubble/props/propTypes.js +7 -2
  129. package/es/im/IMTextBubble/IMTextBubble.js +5 -2
  130. package/es/im/IMTextBubble/props/propTypes.js +2 -1
  131. package/es/im/css/common.module.css +6 -0
  132. package/es/im/index.js +1 -2
  133. package/es/index.js +0 -1
  134. package/package.json +4 -21
  135. package/es/InfoBubble/InfoBubble.js +0 -34
  136. package/es/InfoBubble/css/InfoBubble.module.css +0 -0
  137. package/es/InfoBubble/css/cssJSLogic.js +0 -10
  138. package/es/InfoBubble/index.js +0 -1
  139. package/es/InfoBubble/props/propTypes.js +0 -6
  140. package/es/Theme/crm/dark/blueFanTheme.js +0 -28
  141. package/es/Theme/crm/dark/blueTheme.js +0 -28
  142. package/es/Theme/crm/dark/commonColorVariable.js +0 -11
  143. package/es/Theme/crm/dark/darkBlueTheme.js +0 -28
  144. package/es/Theme/crm/dark/darkGreyTheme.js +0 -28
  145. package/es/Theme/crm/dark/greenTheme.js +0 -28
  146. package/es/Theme/crm/dark/orangeTheme.js +0 -28
  147. package/es/Theme/crm/dark/pinkTheme.js +0 -28
  148. package/es/Theme/crm/dark/tealTheme.js +0 -28
  149. package/es/Theme/crm/dark/whiteTheme.js +0 -28
  150. package/es/Theme/crm/light/blueFanTheme.js +0 -28
  151. package/es/Theme/crm/light/blueTheme.js +0 -31
  152. package/es/Theme/crm/light/commonColorVariable.js +0 -9
  153. package/es/Theme/crm/light/darkBlueTheme.js +0 -28
  154. package/es/Theme/crm/light/darkGreyTheme.js +0 -28
  155. package/es/Theme/crm/light/greenTheme.js +0 -28
  156. package/es/Theme/crm/light/orangeTheme.js +0 -28
  157. package/es/Theme/crm/light/pinkTheme.js +0 -28
  158. package/es/Theme/crm/light/tealTheme.js +0 -28
  159. package/es/Theme/crm/light/whiteTheme.js +0 -28
  160. package/es/Theme/crm/pureDark/blueFanTheme.js +0 -28
  161. package/es/Theme/crm/pureDark/blueTheme.js +0 -28
  162. package/es/Theme/crm/pureDark/commonColorVariable.js +0 -9
  163. package/es/Theme/crm/pureDark/darkBlueTheme.js +0 -28
  164. package/es/Theme/crm/pureDark/darkGreyTheme.js +0 -28
  165. package/es/Theme/crm/pureDark/greenTheme.js +0 -28
  166. package/es/Theme/crm/pureDark/orangeTheme.js +0 -28
  167. package/es/Theme/crm/pureDark/pinkTheme.js +0 -28
  168. package/es/Theme/crm/pureDark/tealTheme.js +0 -28
  169. package/es/Theme/crm/pureDark/whiteTheme.js +0 -28
  170. package/es/icons/factory/integrations/ttTwitter.svg +0 -1
  171. package/es/im/IMInfoBubble/IMInfoBubble.js +0 -34
  172. package/es/im/IMInfoBubble/css/IMInfoBubble.module.css +0 -0
  173. package/es/im/IMInfoBubble/css/cssJSLogic.js +0 -10
  174. package/es/im/IMInfoBubble/index.js +0 -1
  175. package/es/im/IMInfoBubble/props/defaultProps.js +0 -6
  176. package/es/im/IMInfoBubble/props/propTypes.js +0 -6
  177. package/es/im/IMTicketLink/IMTicketLink.js +0 -48
  178. package/es/im/IMTicketLink/index.js +0 -1
  179. package/es/im/IMTicketLink/props/defaultProps.js +0 -6
  180. package/es/im/IMTicketLink/props/propTypes.js +0 -11
  181. /package/es/icons/factory/attachments/{txt.svg → text.svg} +0 -0
@@ -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,14 +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
- overflow: hidden;
37
- white-space: nowrap;
38
- word-wrap: normal;
39
- text-overflow: ellipsis;
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);
40
52
  }
41
53
 
42
54
  [dir=ltr] .iconWrapper {
@@ -48,13 +60,16 @@
48
60
  }
49
61
 
50
62
  .messageWrapper {
51
- color: var(--imlib_chat_components_replyBubbleContent_color);
63
+ color: var(--imlib_chat_components_replyBubbleContent_content_color);
52
64
  font-size: var(--zd_font_size13) ;
53
65
  line-height: 1.5;
54
- max-height: var(--zd_size40) ;
55
66
  -webkit-line-clamp: 2;
56
67
  display: -webkit-box;
57
68
  -webkit-box-orient: vertical;
58
69
  word-break: break-word;
59
70
  overflow: hidden;
60
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, {
@@ -39,14 +52,16 @@ export default function ReplyBubbleHeader(props) {
39
52
  });
40
53
  }, [iconStyle, renderCustomReplyIcon]);
41
54
  return /*#__PURE__*/React.createElement(Container, {
42
- alignBox: "row"
43
- }, /*#__PURE__*/React.createElement(Box, {
44
- flexible: true
45
- }, /*#__PURE__*/React.createElement(Container, {
46
- alignBox: "row"
55
+ align: "vertical",
56
+ alignBox: "row",
57
+ className: replyBubbleHeaderClass
47
58
  }, renderIcon(), /*#__PURE__*/React.createElement(Box, {
48
- className: newStyle.replyText
49
- }, replyText))), /*#__PURE__*/React.createElement("div", null, time));
59
+ className: newStyle.replyText,
60
+ flexible: true
61
+ }, replyText), /*#__PURE__*/React.createElement(Box, {
62
+ className: newStyle.time,
63
+ "data-title": tooltip
64
+ }, displayDateTime));
50
65
  }
51
66
  ReplyBubbleHeader.propTypes = replyBubbleHeaderPropTypes;
52
67
  ReplyBubbleHeader.defaultProps = replyBubbleHeaderDefaultProps;
@@ -1,12 +1,43 @@
1
1
  .replyIcon {
2
- width: var(--zd_size20) ;
3
- height: var(--zd_size20) ;
2
+ display: flex;
3
+ flex-shrink: 0;
4
+ width: var(--zd_size20) !important;
5
+ height: var(--zd_size20) !important;
6
+ }[dir=ltr] .replyIcon {
7
+ margin-right: var(--zd_size5) ;
8
+ }[dir=rtl] .replyIcon {
9
+ margin-left: var(--zd_size5) ;
4
10
  }
5
11
 
6
12
  .replyText {
7
- max-width: var(--zd_size100) ;
8
- white-space: nowrap;
9
- overflow: hidden;
10
- text-overflow: ellipsis;
11
13
  font-size: var(--zd_font_size14) ;
14
+ color: var(--imlib_chat_components_replyBubbleHeader_text_color);
12
15
  }
16
+
17
+ [dir=ltr] .replyText {
18
+ margin-right: var(--zd_size5) ;
19
+ }
20
+
21
+ [dir=rtl] .replyText {
22
+ margin-left: var(--zd_size5) ;
23
+ }
24
+
25
+ .failedReplyBubbleHeader .replyText{
26
+ color: var(--imlib_chat_components_replyBubbleHeader_text_color_failed);
27
+ }
28
+
29
+ .replyText,
30
+ .time{
31
+ composes: dotted from "../../css/common.module.css";
32
+ }
33
+
34
+ .time{
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);
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;
@@ -1,5 +1,5 @@
1
1
  /** ** Libraries *** */
2
- import React from 'react';
2
+ import React, { Fragment } from 'react';
3
3
  /** ** Hooks *** */
4
4
 
5
5
  import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
@@ -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);
23
- return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", {
24
- className: newStyle.textBubble // eslint-disable-next-line react/no-danger, @zohodesk/zsecurity/no-unsecure-html
27
+ /* css classnames added based on logic */
28
+
29
+ const {
30
+ textBubbleClass,
31
+ moreTextClass
32
+ } = cssJSLogic({
33
+ isFailed
34
+ }, newStyle);
35
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("span", {
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,10 +14,20 @@
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);
23
+ word-break: break-word;
14
24
  }
15
25
 
16
26
  .textBubble a:hover {
17
- text-decoration: underline;
27
+ text-decoration: underline !important;
28
+ /* !important for Desk css overwrite */
18
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;
@@ -68,11 +68,11 @@ export default function ThemeWrapper(props) {
68
68
  const renderStyle = useCallback(() => /*#__PURE__*/React.createElement("style", {
69
69
  id: "zoho-im-variables"
70
70
  }, `${selector}{${customizedVariables}}`), [selector, customizedVariables]);
71
- const renderAssets = useCallback(() => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(React.Fragment, null, needThemeAssets ? /*#__PURE__*/React.createElement(ThemeAssets, null) : null), /*#__PURE__*/React.createElement(React.Fragment, null, needTooltip ? /*#__PURE__*/React.createElement(TooltipWrapper, {
71
+ const renderAssets = useCallback(() => /*#__PURE__*/React.createElement(React.Fragment, null, needThemeAssets ? /*#__PURE__*/React.createElement(ThemeAssets, null) : null, needTooltip ? /*#__PURE__*/React.createElement(TooltipWrapper, {
72
72
  containerRef: containerRef.current,
73
73
  customStyle: tooltipCustomStyle,
74
74
  getContainerRef: getContainerRef
75
- }) : null)), [getContainerRef, needTooltip, needThemeAssets, tooltipCustomStyle]);
75
+ }) : null), [getContainerRef, needTooltip, needThemeAssets, tooltipCustomStyle]);
76
76
  return /*#__PURE__*/React.createElement("div", _extends({
77
77
  id: styleTagId
78
78
  }, wrapperDivProps, {
@@ -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';
@@ -1,68 +1,125 @@
1
1
  /* eslint-disable camelcase */
2
- import { incomingBubbleBgColor, bubbleActiveBgColor, actionIconWrapperColor, messageStatusSendColor, messageStatusFailedColor, primaryBlue } from './commonColorVariable';
2
+ import { incomingBubbleBgColor, bubbleActiveBgColor, actionIconWrapperColor, messageStatusSendColor, messageStatusFailedColor, primaryBlue, failedBgWrapper, failedBg, failedBdr, failedLine, failedColor, failedUrlColor } from './commonColorVariable';
3
3
  import { imIntegrationIcon, messagetextColor } from '../commonThemeColorVariable';
4
4
  export default {
5
5
  library: 'chat_components',
6
6
  variables: {
7
- messageBubble: {
8
- active_bg_color: bubbleActiveBgColor,
9
- messageBox_footer_text_color: '#5a616f'
10
- },
11
- messageBox: {
12
- incoming_bg_color: incomingBubbleBgColor,
13
- outgoing_bg_color: '#2c3b4d',
14
- bg_color: '#f1f7fe',
15
- failed_bg_color: '#362734',
16
- text_color: messagetextColor,
17
- failed_text_color: '#000'
18
- },
7
+ // ActionIcon: {},
19
8
  actionIconWrapper: {
20
9
  color: actionIconWrapperColor,
21
10
  bg_color: '#2c3b4d',
22
11
  border_color: '#3f536b'
23
12
  },
24
- imIntegrationIcon,
25
- messageStatus: {
26
- send_color: messageStatusSendColor,
27
- read_color: '#479dff',
28
- failed_color: messageStatusFailedColor
13
+ attachmentBubble: {
14
+ bg_color: '#232b38',
15
+ bg_color_failed: failedBg,
16
+ border_color: '#2d3748',
17
+ border_color_failed: failedBdr
29
18
  },
30
19
  attachmentBubbleInfo: {
31
20
  fileName_color: '#e2e4e6',
32
- fileSize_color: '#788190'
21
+ fileName_color_failed: failedColor,
22
+ fileSize_color: '#788190',
23
+ fileSize_color_failed: failedColor
33
24
  },
34
- attachmentBubble: {
35
- bg_color: '#232b38',
36
- border_color: '#2d3748'
37
- },
38
- replyBubbleContent: {
25
+ // AttachmentIcon: {},
26
+ // Audio: {},
27
+ // AudioBubble: {},
28
+ articleBubble: {
39
29
  bg_color: '#232b38',
40
- color: '#e2e4e6',
30
+ bg_color_failed: failedBg,
41
31
  border_color: '#2d3748',
42
- line_color: '#cddbf2'
32
+ border_color_failed: failedBdr,
33
+ title_color: '#e2e4e6',
34
+ title_color_failed: failedColor,
35
+ summary_color: '#e2e4e6',
36
+ summary_color_failed: failedColor
37
+ },
38
+ imAutoMessageInfo: {
39
+ text_color: '#828994'
40
+ },
41
+ // IMInfoBubble: {},
42
+ imIntegrationIcon,
43
+ // IMMessage: {},
44
+ // IMMessageContent: {},
45
+ imMessageMeta: {
46
+ time_color: '#a8b0bd'
47
+ },
48
+ imPermaLink: {
49
+ url_color: '#479dff'
43
50
  },
51
+ // IMReplyBubble: {},
52
+ // IMTextBubble: {},
44
53
  imageBubble: {
45
- bg_color: '#232b38'
54
+ bg_color: '#232b38',
55
+ bg_color_failed: failedBg,
56
+ alt_text_color: '#e2e4e6',
57
+ alt_text_color_failed: failedColor
46
58
  },
59
+ // IMReplyBubble: {},
60
+ // InfoBubble: {},
61
+ // LazyLoadImage: {},
47
62
  locationBubble: {
48
63
  bg_color: '#232b38',
49
- color: primaryBlue,
50
- border_color: '#2d3748'
64
+ bg_color_failed: failedBg,
65
+ border_color: '#2d3748',
66
+ border_color_failed: failedBdr,
67
+ url_color: primaryBlue,
68
+ url_color_failed: failedUrlColor
51
69
  },
52
- articleBubble: {
70
+ // MediaBubbleWrapper: {},
71
+ // Message: {},
72
+ // MessageAction: {},
73
+ // MessageActions: {},
74
+ // MessageActionsMore: {},
75
+ // MessageActionsWrapper: {},
76
+ // MessageAvatar: {},
77
+ messageBox: {
78
+ incoming_bg_color: incomingBubbleBgColor,
79
+ outgoing_bg_color: '#2c3b4d',
80
+ bg_color: '#f1f7fe',
81
+ failed_bg_color: failedBgWrapper,
82
+ text_color: messagetextColor,
83
+ failed_text_color: '#000'
84
+ },
85
+ messageBubble: {
86
+ active_bg_color: bubbleActiveBgColor,
87
+ messageBox_footer_text_color: '#5a616f'
88
+ },
89
+ messageStatus: {
90
+ send_color: messageStatusSendColor,
91
+ read_color: '#479dff',
92
+ failed_color: messageStatusFailedColor
93
+ },
94
+ // MoreActionItem: {},
95
+ // ReplyBubble: {},
96
+ replyBubbleContent: {
53
97
  bg_color: '#232b38',
54
- color: '#e2e4e6',
55
- border_color: '#2d3748'
98
+ bg_color_failed: failedBg,
99
+ border_color: '#2d3748',
100
+ border_color_failed: failedBdr,
101
+ line_color: '#cddbf2',
102
+ line_color_failed: failedLine,
103
+ sender_color: '#e2e4e6',
104
+ sender_color_failed: failedColor,
105
+ content_color: '#e2e4e6',
106
+ content_color_failed: failedColor
107
+ },
108
+ replyBubbleHeader: {
109
+ text_color: '#e2e4e6',
110
+ text_color_failed: failedColor,
111
+ time_color: '#828994',
112
+ time_color_failed: failedColor
56
113
  },
57
114
  textBubble: {
115
+ text_color: '#e2e4e6',
116
+ text_color_failed: failedColor,
58
117
  see_more_color: primaryBlue,
59
- url_color: primaryBlue
60
- },
61
- imTicketLink: {
62
- color: '#479dff'
63
- },
64
- imMessageMeta: {
65
- timeColor: '#a8b0bd'
66
- }
118
+ see_more_color_failed: failedUrlColor,
119
+ url_color: primaryBlue,
120
+ url_color_failed: failedUrlColor
121
+ } // Video: {},
122
+ // VideoBubble: {}
123
+
67
124
  }
68
125
  };
@@ -7,4 +7,10 @@ export const primaryBlue = '#479dff';
7
7
  export const primaryGreen = '#45a159';
8
8
  export const primaryOrange = '#ff801f';
9
9
  export const primaryRed = '#e94f4f';
10
- export const primaryYellow = '#d79835';
10
+ export const primaryYellow = '#d79835';
11
+ export const failedBgWrapper = '#f4b5bc';
12
+ export const failedBg = '#f6dcdf';
13
+ export const failedBdr = '#eb9ea7';
14
+ export const failedLine = '#eb9ea7';
15
+ export const failedColor = '#000';
16
+ export const failedUrlColor = '#0a73eb';