@zohoim/chat-components 0.0.11 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/es/ActionIcon/ActionIcon.js +2 -2
  2. package/es/ArticleBubble/ArticleBubble.js +17 -15
  3. package/es/ArticleBubble/css/ArticleBubble.module.css +37 -29
  4. package/es/AttachmentBubble/AttachmentBubble.js +14 -12
  5. package/es/AttachmentBubble/css/AttachmentBubble.module.css +4 -4
  6. package/es/AttachmentBubble/css/cssJSLogic.js +1 -1
  7. package/es/AttachmentBubbleInfo/AttachmentBubbleInfo.js +0 -1
  8. package/es/AttachmentBubbleInfo/css/AttachmentBubbleInfo.module.css +1 -0
  9. package/es/AttachmentBubbleInfo/css/cssJSLogic.js +1 -1
  10. package/es/Audio/Audio.js +23 -23
  11. package/es/AudioBubble/AudioBubble.js +2 -3
  12. package/es/AudioBubble/css/cssJSLogic.js +2 -2
  13. package/es/ImageBubble/ImageBubble.js +7 -6
  14. package/es/InfoBubble/InfoBubble.js +0 -1
  15. package/es/LazyLoadImage/LazyLoadImage.js +5 -6
  16. package/es/LocationBubble/LocationBubble.js +20 -21
  17. package/es/LocationBubble/css/LocationBubble.module.css +9 -7
  18. package/es/MediaControls/MediaControls.js +0 -1
  19. package/es/Message/Message.js +58 -93
  20. package/es/Message/props/defaultProps.js +2 -34
  21. package/es/Message/props/propTypes.js +19 -57
  22. package/es/MessageAction/MessageAction.js +5 -5
  23. package/es/MessageActions/MessageActions.js +120 -45
  24. package/es/MessageActions/css/MessageActions.module.css +30 -2
  25. package/es/MessageActions/css/cssJSLogic.js +13 -3
  26. package/es/MessageActions/props/defaultProps.js +5 -3
  27. package/es/MessageActions/props/propTypes.js +22 -4
  28. package/es/MessageActionsMore/MessageActionsMore.js +5 -5
  29. package/es/MessageActionsWrapper/MessageActionsWrapper.js +75 -0
  30. package/es/MessageActionsWrapper/css/MessageActionsWrapper.module.css +3 -0
  31. package/es/MessageActionsWrapper/css/cssJSLogic.js +10 -0
  32. package/es/MessageActionsWrapper/index.js +1 -0
  33. package/es/MessageActionsWrapper/props/defaultProps.js +10 -0
  34. package/es/MessageActionsWrapper/props/propTypes.js +12 -0
  35. package/es/MessageAvatar/MessageAvatar.js +7 -6
  36. package/es/MessageAvatar/props/defaultProps.js +3 -3
  37. package/es/MessageBubble/MessageBubble.js +1 -1
  38. package/es/MessageBubble/props/defaultProps.js +2 -2
  39. package/es/MessageBubble/props/propConstants.js +1 -1
  40. package/es/MessageBubble/props/propTypes.js +2 -2
  41. package/es/{im/IMMessageStatus/IMMessageStatus.js → MessageStatus/MessageStatus.js} +18 -15
  42. package/es/{im/IMMessageStatus → MessageStatus}/css/cssJSLogic.js +3 -3
  43. package/es/MessageStatus/index.js +1 -0
  44. package/es/{im/IMMessageStatus → MessageStatus}/props/defaultProps.js +2 -2
  45. package/es/{im/IMMessageStatus → MessageStatus}/props/propTypes.js +4 -3
  46. package/es/MoreActionItem/MoreActionItem.js +7 -7
  47. package/es/MoreActionItem/css/cssJSLogic.js +1 -1
  48. package/es/ReplyBubble/ReplyBubble.js +4 -3
  49. package/es/ReplyBubbleContent/ReplyBubbleContent.js +16 -12
  50. package/es/ReplyBubbleContent/css/ReplyBubbleContent.module.css +26 -16
  51. package/es/ReplyBubbleHeader/ReplyBubbleHeader.js +11 -9
  52. package/es/ReplyBubbleHeader/css/ReplyBubbleHeader.module.css +15 -4
  53. package/es/ReplyBubbleHeader/css/cssJSLogic.js +9 -1
  54. package/es/ReplyBubbleHeader/props/defaultProps.js +1 -2
  55. package/es/ReplyBubbleHeader/props/propTypes.js +1 -2
  56. package/es/TextBubble/TextBubble.js +8 -9
  57. package/es/TextBubble/css/TextBubble.module.css +11 -2
  58. package/es/Theme/ThemeWrapper.js +32 -29
  59. package/es/Theme/crm/dark/blueFanTheme.js +1 -1
  60. package/es/Theme/crm/dark/blueTheme.js +1 -1
  61. package/es/Theme/crm/dark/darkBlueTheme.js +1 -1
  62. package/es/Theme/crm/dark/darkGreyTheme.js +1 -1
  63. package/es/Theme/crm/dark/greenTheme.js +1 -1
  64. package/es/Theme/crm/dark/orangeTheme.js +1 -1
  65. package/es/Theme/crm/dark/pinkTheme.js +1 -1
  66. package/es/Theme/crm/dark/tealTheme.js +1 -1
  67. package/es/Theme/crm/dark/whiteTheme.js +1 -1
  68. package/es/Theme/crm/light/blueFanTheme.js +1 -1
  69. package/es/Theme/crm/light/blueTheme.js +1 -1
  70. package/es/Theme/crm/light/darkBlueTheme.js +1 -1
  71. package/es/Theme/crm/light/darkGreyTheme.js +1 -1
  72. package/es/Theme/crm/light/greenTheme.js +1 -1
  73. package/es/Theme/crm/light/orangeTheme.js +1 -1
  74. package/es/Theme/crm/light/pinkTheme.js +1 -1
  75. package/es/Theme/crm/light/tealTheme.js +1 -1
  76. package/es/Theme/crm/light/whiteTheme.js +1 -1
  77. package/es/Theme/crm/pureDark/blueFanTheme.js +1 -1
  78. package/es/Theme/crm/pureDark/blueTheme.js +1 -1
  79. package/es/Theme/crm/pureDark/darkBlueTheme.js +1 -1
  80. package/es/Theme/crm/pureDark/darkGreyTheme.js +1 -1
  81. package/es/Theme/crm/pureDark/greenTheme.js +1 -1
  82. package/es/Theme/crm/pureDark/orangeTheme.js +1 -1
  83. package/es/Theme/crm/pureDark/pinkTheme.js +1 -1
  84. package/es/Theme/crm/pureDark/tealTheme.js +1 -1
  85. package/es/Theme/crm/pureDark/whiteTheme.js +1 -1
  86. package/es/Theme/desk/commonDeskColorVariable.js +10 -10
  87. package/es/Theme/desk/dark/blueTheme.js +42 -16
  88. package/es/Theme/desk/dark/commonColorVariable.js +10 -5
  89. package/es/Theme/desk/dark/greenTheme.js +41 -15
  90. package/es/Theme/desk/dark/orangeTheme.js +34 -8
  91. package/es/Theme/desk/dark/redTheme.js +50 -15
  92. package/es/Theme/desk/dark/yellowTheme.js +41 -15
  93. package/es/Theme/desk/light/blueTheme.js +35 -18
  94. package/es/Theme/desk/light/commonColorVariable.js +7 -1
  95. package/es/Theme/desk/light/greenTheme.js +39 -13
  96. package/es/Theme/desk/light/orangeTheme.js +38 -13
  97. package/es/Theme/desk/light/redTheme.js +38 -13
  98. package/es/Theme/desk/light/yellowTheme.js +39 -13
  99. package/es/Theme/desk/pureDark/blueTheme.js +41 -14
  100. package/es/Theme/desk/pureDark/commonColorVariable.js +6 -1
  101. package/es/Theme/desk/pureDark/greenTheme.js +40 -14
  102. package/es/Theme/desk/pureDark/orangeTheme.js +40 -14
  103. package/es/Theme/desk/pureDark/redTheme.js +40 -14
  104. package/es/Theme/desk/pureDark/yellowTheme.js +40 -14
  105. package/es/Theme/utils/getThemeConfigurations.js +5 -5
  106. package/es/Video/Video.js +13 -12
  107. package/es/VideoBubble/VideoBubble.js +2 -3
  108. package/es/icons/create-icon-components.js +1 -0
  109. package/es/icons/icon.template.js +2 -2
  110. package/es/icons/iconSrc/actions/ConvertTicket.js +1 -0
  111. package/es/icons/iconSrc/actions/index.js +1 -1
  112. package/es/icons/iconSrc/attachments/Audio.js +1 -0
  113. package/es/icons/iconSrc/attachments/Code.js +1 -0
  114. package/es/icons/iconSrc/attachments/Image.js +1 -0
  115. package/es/icons/iconSrc/attachments/Pdf.js +1 -0
  116. package/es/icons/iconSrc/attachments/Txt.js +1 -0
  117. package/es/icons/iconSrc/attachments/Unknown.js +1 -0
  118. package/es/icons/iconSrc/attachments/Video.js +1 -0
  119. package/es/icons/iconSrc/attachments/Zip.js +1 -0
  120. package/es/icons/iconSrc/attachments/index.js +8 -8
  121. package/es/icons/iconSrc/common/Article.js +1 -0
  122. package/es/icons/iconSrc/common/Quote.js +1 -0
  123. package/es/icons/iconSrc/common/index.js +2 -2
  124. package/es/icons/iconSrc/integrations/ChInstagram.js +1 -0
  125. package/es/icons/iconSrc/integrations/ChWhatsApp.js +1 -0
  126. package/es/icons/iconSrc/integrations/TtASAP.js +1 -0
  127. package/es/icons/iconSrc/integrations/TtTelegram.js +1 -0
  128. package/es/icons/iconSrc/integrations/TtTwillio.js +1 -0
  129. package/es/icons/iconSrc/integrations/TtTwitter.js +1 -0
  130. package/es/icons/iconSrc/integrations/TtWechat.js +1 -0
  131. package/es/icons/iconSrc/integrations/index.js +7 -7
  132. package/es/icons/iconSrc/messageStatus/Clock.js +1 -0
  133. package/es/icons/iconSrc/messageStatus/DoubleTick.js +1 -0
  134. package/es/icons/iconSrc/messageStatus/Failed.js +1 -0
  135. package/es/icons/iconSrc/messageStatus/Tick.js +1 -0
  136. package/es/icons/iconSrc/messageStatus/index.js +4 -4
  137. package/es/im/IMArticleBubble/IMArticleBubble.js +3 -4
  138. package/es/im/IMAttachmentBubble/IMAttachmentBubble.js +4 -5
  139. package/es/im/IMAttachmentIcon/IMAttachmentIcon.js +8 -9
  140. package/es/im/IMAudioBubble/IMAudioBubble.js +3 -4
  141. package/es/im/IMAudioBubble/css/cssJSLogic.js +2 -2
  142. package/es/im/IMAutoMessageInfo/IMAutoMessageInfo.js +0 -1
  143. package/es/im/IMDateTime/IMDateTime.js +0 -1
  144. package/es/im/IMDateTime/css/IMDateTime.module.css +6 -1
  145. package/es/im/IMImageBubble/IMImageBubble.js +6 -5
  146. package/es/im/IMInfoBubble/IMInfoBubble.js +0 -1
  147. package/es/im/IMLocationBubble/IMLocationBubble.js +6 -5
  148. package/es/im/IMMessage/IMMessage.js +57 -103
  149. package/es/im/IMMessage/props/defaultProps.js +1 -19
  150. package/es/im/IMMessage/props/propTypes.js +17 -30
  151. package/es/im/IMMessageAvatar/IMMessageAvatar.js +7 -7
  152. package/es/im/IMMessageAvatar/props/defaultProps.js +4 -4
  153. package/es/im/IMMessageAvatar/props/propTypes.js +25 -0
  154. package/es/im/IMMessageContent/IMMessageContent.js +44 -28
  155. package/es/im/IMMessageContent/css/IMMessageContent.module.css +3 -0
  156. package/es/im/IMMessageMeta/IMMessageMeta.js +3 -4
  157. package/es/im/IMReplyBubble/IMReplyBubble.js +9 -10
  158. package/es/im/IMReplyBubble/css/IMReplyBubble.module.css +7 -13
  159. package/es/im/IMTextBubble/IMTextBubble.js +3 -4
  160. package/es/im/IMTicketLink/IMTicketLink.js +1 -3
  161. package/es/im/IMVideoBubble/IMVideoBubble.js +3 -4
  162. package/es/im/index.js +0 -2
  163. package/es/index.js +28 -30
  164. package/es/{MessageWrapper → unused/MessageWrapper}/MessageWrapper.js +0 -1
  165. package/es/{TextMessage → unused/TextMessage}/DefaultActions.js +4 -4
  166. package/es/{TextMessage → unused/TextMessage}/TextMessage.js +14 -14
  167. package/es/{TextMessage → unused/TextMessage}/TextMessage1.js +18 -21
  168. package/package.json +4 -4
  169. package/es/im/IMMessage/renderChild/renderMessage.js +0 -8
  170. package/es/im/IMMessage/renderChild/renderMessageActions.js +0 -8
  171. package/es/im/IMMessage/renderChild/renderMessageBox.js +0 -15
  172. package/es/im/IMMessage/renderChild/renderMessageBoxFooter.js +0 -8
  173. package/es/im/IMMessage/renderChild/renderMessageFooter.js +0 -8
  174. package/es/im/IMMessage/renderChild/renderMessageHeader.js +0 -8
  175. package/es/im/IMMessage/renderChild/renderMessageOwner.js +0 -8
  176. package/es/im/IMMessage/renderChild/renderMessageStatus.js +0 -8
  177. package/es/im/IMMessageActions/IMMessageActions.js +0 -150
  178. package/es/im/IMMessageActions/css/IMMessageActions.module.css +0 -31
  179. package/es/im/IMMessageActions/css/cssJSLogic.js +0 -20
  180. package/es/im/IMMessageActions/index.js +0 -1
  181. package/es/im/IMMessageActions/props/defaultProps.js +0 -12
  182. package/es/im/IMMessageActions/props/propTypes.js +0 -30
  183. package/es/im/IMMessageStatus/index.js +0 -1
  184. /package/es/{MessageActions → MessageActionsWrapper}/props/propConstants.js +0 -0
  185. /package/es/{im/IMMessageStatus/css/IMMessageStatus.module.css → MessageStatus/css/MessageStatus.module.css} +0 -0
  186. /package/es/{MessageBoxFooter → unused/MessageBoxFooter}/MessageBoxFooter.js +0 -0
  187. /package/es/{MessageBoxFooter → unused/MessageBoxFooter}/css/MessageBoxFooter.module.css +0 -0
  188. /package/es/{MessageBoxFooter → unused/MessageBoxFooter}/css/cssJSLogic.js +0 -0
  189. /package/es/{MessageBoxFooter → unused/MessageBoxFooter}/index.js +0 -0
  190. /package/es/{MessageBoxFooter → unused/MessageBoxFooter}/props/defaultProps.js +0 -0
  191. /package/es/{MessageBoxFooter → unused/MessageBoxFooter}/props/propTypes.js +0 -0
  192. /package/es/{MessageBoxHeader → unused/MessageBoxHeader}/MessageBoxHeader.js +0 -0
  193. /package/es/{MessageBoxHeader → unused/MessageBoxHeader}/css/MessageBoxHeader.module.css +0 -0
  194. /package/es/{MessageBoxHeader → unused/MessageBoxHeader}/css/cssJsLogic.js +0 -0
  195. /package/es/{MessageBoxHeader → unused/MessageBoxHeader}/index.js +0 -0
  196. /package/es/{MessageBoxHeader → unused/MessageBoxHeader}/props/defaultProps.js +0 -0
  197. /package/es/{MessageBoxHeader → unused/MessageBoxHeader}/props/propTypes.js +0 -0
  198. /package/es/{MessageWrapper → unused/MessageWrapper}/css/MessageWrapper.module.css +0 -0
  199. /package/es/{MessageWrapper → unused/MessageWrapper}/css/cssJSLogic.js +0 -0
  200. /package/es/{MessageWrapper → unused/MessageWrapper}/index.js +0 -0
  201. /package/es/{MessageWrapper → unused/MessageWrapper}/props/defaultProps.js +0 -0
  202. /package/es/{MessageWrapper → unused/MessageWrapper}/props/propTypes.js +0 -0
  203. /package/es/{TextMessage → unused/TextMessage}/css/TextMessage.module.css +0 -0
  204. /package/es/{TextMessage → unused/TextMessage}/css/cssJSLogic.js +0 -0
  205. /package/es/{TextMessage → unused/TextMessage}/index.js +0 -0
  206. /package/es/{TextMessage → unused/TextMessage}/props/defaultProps.js +0 -0
  207. /package/es/{TextMessage → unused/TextMessage}/props/propConstants.js +0 -0
  208. /package/es/{TextMessage → unused/TextMessage}/props/propTypes.js +0 -0
  209. /package/es/{Theme → unused}/darkTheme.js +0 -0
  210. /package/es/{Theme → unused}/defaultTheme.js +0 -0
@@ -27,7 +27,7 @@ function MessageActionsMoreComp(props) {
27
27
  renderMoreIcon,
28
28
  customStyle,
29
29
  popupSize,
30
- /**** Popup Props ****/
30
+ /** ** Popup Props *** */
31
31
  getTargetRef,
32
32
  getContainerRef,
33
33
  position,
@@ -55,17 +55,17 @@ function MessageActionsMoreComp(props) {
55
55
  ref: getTargetRef
56
56
  }, moreIcon) : null, isPopupOpen ? /*#__PURE__*/React.createElement(DropBox, {
57
57
  boxPosition: position,
58
+ customClass: popupClass,
58
59
  getRef: getContainerRef,
60
+ isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
59
61
  isActive: isPopupReady,
60
62
  isAnimate: true,
61
63
  isArrow: false,
62
64
  onClick: removeClose,
63
- isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
65
+ portalId: MSG_ACTION_POPUP_PORTAL,
64
66
  positionMapping: positionsOffset,
65
67
  positionsOffset: positionsOffset,
66
- portalId: MSG_ACTION_POPUP_PORTAL,
67
- size: popupSize,
68
- customClass: popupClass
68
+ size: popupSize
69
69
  // isModel
70
70
  }, actions.map(action => {
71
71
  const {
@@ -0,0 +1,75 @@
1
+ /* eslint-disable max-len */
2
+
3
+ /** ** Libraries *** */
4
+ import React from 'react';
5
+
6
+ /** ** Components *** */
7
+ import { Container } from '@zohodesk/components/lib/Layout';
8
+ import MessageActionsMore from '../MessageActionsMore/MessageActionsMore';
9
+
10
+ /** ** Hooks *** */
11
+ import { useMessageActionsWrapper } from '@zohoim/chat-components-hooks';
12
+
13
+ /** ** Constants *** */
14
+ import messageActionsWrapperDefaultProps from './props/defaultProps';
15
+ import messageActionsWrapperPropTypes from './props/propTypes';
16
+ import constantProps from './props/propConstants';
17
+
18
+ /** ** Methods *** */
19
+ import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
20
+ import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
21
+ import cssJSLogic from './css/cssJSLogic';
22
+
23
+ /** ** Style *** */
24
+ import style from './css/MessageActionsWrapper.module.css';
25
+ function MessageActionsWrapper(props) {
26
+ const {
27
+ actions,
28
+ renderMoreIcon,
29
+ defaultShowCount,
30
+ customStyle,
31
+ morePopupCustomStyle
32
+ } = props;
33
+
34
+ /* external customization */
35
+ const newStyle = useMergeStyle(style, customStyle);
36
+ /* css classnames added based on logic */
37
+ const {
38
+ actionsClass
39
+ } = cssJSLogic(props, newStyle);
40
+ const {
41
+ isShowMore: isShowMoreIcon,
42
+ revampedActions = []
43
+ } = useMessageActionsWrapper(actions, defaultShowCount);
44
+ const {
45
+ defaultActions = [],
46
+ moreActions
47
+ } = revampedActions;
48
+ function renderRow(defaultActions, isShowMore) {
49
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Container, {
50
+ alignBox: "row"
51
+ }, defaultActions.map(action => {
52
+ const {
53
+ id,
54
+ renderFunction
55
+ } = action;
56
+ return renderHandler(renderFunction)({
57
+ id,
58
+ isShowInMore: false,
59
+ action
60
+ }); // id, isRenderInMorePopup
61
+ }), isShowMore ? /*#__PURE__*/React.createElement(MessageActionsMore, {
62
+ actions: moreActions,
63
+ customStyle: morePopupCustomStyle,
64
+ renderMoreIcon: renderMoreIcon
65
+ }) : null));
66
+ }
67
+ return /*#__PURE__*/React.createElement("div", {
68
+ className: actionsClass
69
+ }, renderRow(defaultActions, isShowMoreIcon));
70
+ }
71
+ MessageActionsWrapper.defaultProps = messageActionsWrapperDefaultProps;
72
+ MessageActionsWrapper.propTypes = messageActionsWrapperPropTypes;
73
+ MessageActionsWrapper.constantProps = constantProps;
74
+ MessageActionsWrapper.displayName = 'MessageActionsWrapper';
75
+ export default MessageActionsWrapper;
@@ -0,0 +1,3 @@
1
+ .messageActionsWrapper {
2
+ /*Use this class for message actions customization*/
3
+ }
@@ -0,0 +1,10 @@
1
+ /** ** Methods *** */
2
+ import { compileClassNames } from '@zohodesk/utils';
3
+ export default function cssJSLogic(props, style) {
4
+ const actionsClass = compileClassNames({
5
+ [style.messageActionsWrapper]: true
6
+ });
7
+ return {
8
+ actionsClass
9
+ };
10
+ }
@@ -0,0 +1 @@
1
+ export { default as MessageActionsWrapper } from './MessageActionsWrapper';
@@ -0,0 +1,10 @@
1
+ /** ** Constants *** */
2
+ import { dummyObject, dummyArray } from '@zohoim/chat-components-utils/es/constants';
3
+ import propConstants from './propConstants';
4
+ const messageActionsWrapperDefaultProps = {
5
+ actions: dummyArray,
6
+ customStyle: dummyObject,
7
+ morePopupCustomStyle: dummyObject,
8
+ defaultShowCount: propConstants.actions.defaultShowCount
9
+ };
10
+ export default messageActionsWrapperDefaultProps;
@@ -0,0 +1,12 @@
1
+ /** ** Libraries *** */
2
+ import PropTypes from 'prop-types';
3
+ const messageActionsPropTypes = {
4
+ renderMoreIcon: PropTypes.func,
5
+ actions: PropTypes.arrayOf(PropTypes.shape({
6
+ id: PropTypes.string.isRequired,
7
+ renderFunction: PropTypes.func
8
+ })).isRequired,
9
+ defaultShowCount: PropTypes.number,
10
+ customStyle: PropTypes.object
11
+ };
12
+ export default messageActionsPropTypes;
@@ -3,13 +3,14 @@ import React from 'react';
3
3
 
4
4
  /** ** Components *** */
5
5
  import Avatar from '@zohodesk/components/es/Avatar/Avatar';
6
- import { Container, Box } from '@zohodesk/components/es/Layout';
7
6
 
8
7
  /** ** CSS *** */
9
8
  import style from './css/MessageAvatar.module.css';
10
9
 
11
- /** ** Methods *** */
10
+ /** ** Hooks *** */
12
11
  import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
12
+
13
+ /** ** Methods *** */
13
14
  import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
14
15
  import cssJSLogic from './css/cssJSLogic';
15
16
 
@@ -41,12 +42,12 @@ export default function MessageAvatar(props) {
41
42
  return /*#__PURE__*/React.createElement("div", {
42
43
  className: avatarWrapperClass
43
44
  }, /*#__PURE__*/React.createElement(Avatar, {
44
- src: src,
45
45
  alternateSrc: alternateSrc,
46
- title: title,
47
- size: size,
46
+ customClass: avatarClass,
48
47
  name: name,
49
- customClass: avatarClass
48
+ size: size,
49
+ src: src,
50
+ title: title
50
51
  }), /*#__PURE__*/React.createElement("span", {
51
52
  className: iconClass,
52
53
  "data-title": iconTitle
@@ -3,9 +3,9 @@ import { dummyObject } from '@zohoim/chat-components-utils/es/constants';
3
3
  const messageAvatarDefaultProps = {
4
4
  customStyle: dummyObject,
5
5
  name: '',
6
- //'RAVI KUMAR',
7
- size: 'small',
8
- iconTitle: '' //'RAVI KUMAR',
6
+ // 'RAVI KUMAR',
7
+ size: 'medium',
8
+ iconTitle: '' // 'RAVI KUMAR',
9
9
  };
10
10
 
11
11
  export default messageAvatarDefaultProps;
@@ -5,6 +5,7 @@
5
5
  import React from 'react';
6
6
 
7
7
  /** ** Hooks *** */
8
+ import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
8
9
  import { useMessageBubbleAction } from '@zohoim/chat-components-hooks/es/MessageBubble';
9
10
 
10
11
  /** ** Constants *** */
@@ -13,7 +14,6 @@ import messageBubblePropTypes from './props/propTypes';
13
14
  import constantProps from './props/propConstants';
14
15
 
15
16
  /** ** Methods *** */
16
- import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
17
17
  import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
18
18
  import cssJSLogic from './css/cssJSLogic';
19
19
 
@@ -1,6 +1,6 @@
1
1
  /** ** Constants *** */
2
- import { dummyObject } from "@zohoim/chat-components-utils/es/constants";
3
- import { direction } from "@zohoim/chat-components-utils/es/constants/messageConstants";
2
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants';
3
+ import { direction } from '@zohoim/chat-components-utils/es/constants/messageConstants';
4
4
  const messageBubbleDefaultProps = {
5
5
  direction: direction.IN,
6
6
  isActive: false,
@@ -1,6 +1,6 @@
1
1
  /** ** Constants *** */
2
2
  import { direction } from '@zohoim/chat-components-utils/es/constants/messageConstants';
3
3
  const messageBubbleConstants = {
4
- direction: direction
4
+ direction
5
5
  };
6
6
  export default messageBubbleConstants;
@@ -1,8 +1,8 @@
1
1
  /** ** Libraries *** */
2
- import PropTypes from "prop-types";
2
+ import PropTypes from 'prop-types';
3
3
 
4
4
  /** ** Constants *** */
5
- import { direction } from "@zohoim/chat-components-utils/es/constants/messageConstants";
5
+ import { direction } from '@zohoim/chat-components-utils/es/constants/messageConstants';
6
6
  const messageBubblePropTypes = {
7
7
  direction: PropTypes.oneOf([direction.IN, direction.OUT]),
8
8
  isActive: PropTypes.bool,
@@ -8,21 +8,22 @@ import React from 'react';
8
8
  import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
9
9
 
10
10
  /** ** Constants *** */
11
- import imMessageStatusDefaultProps from './props/defaultProps';
12
- import imMessageStatusPropTypes from './props/propTypes';
11
+ import messageStatusDefaultProps from './props/defaultProps';
12
+ import messageStatusPropTypes from './props/propTypes';
13
13
  import messageStatusConstants from '@zohoim/chat-components-utils/es/constants/messageStatusConstants';
14
14
 
15
15
  /** ** Methods *** */
16
16
  import cssJSLogic from './css/cssJSLogic';
17
+ import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
17
18
 
18
19
  /** ** Styles *** */
19
- import style from './css/IMMessageStatus.module.css';
20
+ import style from './css/MessageStatus.module.css';
20
21
 
21
22
  /** ** Icons *** */
22
- import DoubleTickIcon from '../../icons/iconSrc/messageStatus/DoubleTick';
23
- import TickIcon from '../../icons/iconSrc/messageStatus/Tick';
24
- import ClockIcon from '../../icons/iconSrc/messageStatus/Clock';
25
- import FailedIcon from '../../icons/iconSrc/messageStatus/Failed';
23
+ import DoubleTickIcon from '../icons/iconSrc/messageStatus/DoubleTick';
24
+ import TickIcon from '../icons/iconSrc/messageStatus/Tick';
25
+ import ClockIcon from '../icons/iconSrc/messageStatus/Clock';
26
+ import FailedIcon from '../icons/iconSrc/messageStatus/Failed';
26
27
  const {
27
28
  SENT,
28
29
  SAVED,
@@ -43,11 +44,12 @@ const messageStatusIconMapping = {
43
44
  [UNSENT]: FailedIcon,
44
45
  [FAILED]: FailedIcon
45
46
  };
46
- export default function IMMessageStatus(props) {
47
+ export default function MessageStatus(props) {
47
48
  const {
48
49
  messageStatus,
49
50
  customStyle,
50
- title
51
+ title,
52
+ renderCustomIcon
51
53
  } = props;
52
54
 
53
55
  /* External customization */
@@ -57,13 +59,14 @@ export default function IMMessageStatus(props) {
57
59
  statusClass
58
60
  } = cssJSLogic(props, newStyle);
59
61
 
60
- /* Render Icon */
62
+ /* Custom Icon */
63
+ const customIcon = renderHandler(renderCustomIcon)();
61
64
  const IconComponent = messageStatusIconMapping[messageStatus];
62
- return IconComponent ? /*#__PURE__*/React.createElement("div", {
65
+ return IconComponent || customIcon ? /*#__PURE__*/React.createElement("div", {
63
66
  className: statusClass,
64
67
  "data-title": title
65
- }, /*#__PURE__*/React.createElement(IconComponent, null)) : null;
68
+ }, customIcon || /*#__PURE__*/React.createElement(IconComponent, null)) : null;
66
69
  }
67
- IMMessageStatus.propTypes = imMessageStatusPropTypes;
68
- IMMessageStatus.defaultProps = imMessageStatusDefaultProps;
69
- IMMessageStatus.displayName = 'IMMessageStatus';
70
+ MessageStatus.propTypes = messageStatusPropTypes;
71
+ MessageStatus.defaultProps = messageStatusDefaultProps;
72
+ MessageStatus.displayName = 'MessageStatus';
@@ -1,8 +1,8 @@
1
1
  /** ** Methods *** */
2
- import { compileClassNames } from "@zohodesk/utils";
2
+ import { compileClassNames } from '@zohodesk/utils';
3
3
 
4
4
  /** ** Constants *** */
5
- import messageStatusConstants from "@zohoim/chat-components-utils/es/constants/messageStatusConstants";
5
+ import messageStatusConstants from '@zohoim/chat-components-utils/es/constants/messageStatusConstants';
6
6
  const {
7
7
  READ,
8
8
  UNSENT,
@@ -12,7 +12,7 @@ export default function cssJSLogic(props, style) {
12
12
  const isRead = props.messageStatus === READ;
13
13
  const isFailed = props.messageStatus === FAILED || props.messageStatus === UNSENT;
14
14
  const statusClass = compileClassNames({
15
- [style.messageStatus]: isRead || isFailed ? false : true,
15
+ [style.messageStatus]: !(isRead || isFailed),
16
16
  [style.readStatus]: isRead,
17
17
  [style.failedStatus]: isFailed
18
18
  });
@@ -0,0 +1 @@
1
+ export { default as MessageStatus } from './MessageStatus';
@@ -1,6 +1,6 @@
1
1
  /** ** Constants *** */
2
2
  import { dummyObject } from '@zohoim/chat-components-utils/es/constants';
3
- const imMessageStatusDefaultProps = {
3
+ const messageStatusDefaultProps = {
4
4
  customStyle: dummyObject
5
5
  };
6
- export default imMessageStatusDefaultProps;
6
+ export default messageStatusDefaultProps;
@@ -13,9 +13,10 @@ const {
13
13
  FAILED,
14
14
  OUTGOING
15
15
  } = messageStatusConstants;
16
- const imMessageStatusPropTypes = {
16
+ const messageStatusPropTypes = {
17
17
  messageStatus: PropTypes.oneOf([SENT, SAVED, QUEUED, DELIVERED, READ, UNSENT, FAILED, OUTGOING]).isRequired,
18
18
  customStyle: PropTypes.object,
19
- title: PropTypes.string
19
+ title: PropTypes.string,
20
+ renderCustomIcon: PropTypes.func
20
21
  };
21
- export default imMessageStatusPropTypes;
22
+ export default messageStatusPropTypes;
@@ -56,20 +56,20 @@ export default function MoreActionItem(props) {
56
56
  id
57
57
  });
58
58
  return /*#__PURE__*/React.createElement(ListContainer, {
59
+ autoHover: true,
60
+ customClass: customListItemClass,
59
61
  id: id,
60
62
  index: index,
61
- title: iconTitle,
62
- autoHover: true,
63
63
  onClick: handleClick,
64
- customClass: customListItemClass
64
+ title: iconTitle
65
65
  }, /*#__PURE__*/React.createElement(Container, {
66
- alignBox: "row",
67
- align: "vertical"
66
+ align: "vertical",
67
+ alignBox: "row"
68
68
  }, needIcon ? /*#__PURE__*/React.createElement(Box, {
69
69
  className: iconClass
70
70
  }, icon) : null, /*#__PURE__*/React.createElement(Box, {
71
- flexible: true,
72
- className: textClass
71
+ className: textClass,
72
+ flexible: true
73
73
  }, displayText)));
74
74
  }
75
75
  MoreActionItem.propTypes = moreActionItemPropTypes;
@@ -21,7 +21,7 @@ export default function cssJSLogic(props, style) {
21
21
  // customTickIcon: tickIconClass
22
22
  // }
23
23
  customListItemClass: listItemClass,
24
- iconClass: iconClass,
24
+ iconClass,
25
25
  textClass
26
26
  };
27
27
  }
@@ -12,11 +12,12 @@ import replyBubbleDefaultProps from './props/defaultProps';
12
12
  import replyBubblePropTypes from './props/propTypes';
13
13
 
14
14
  /** ** Methods *** */
15
- import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
16
15
  import cssJSLogic from './css/cssJSLogic';
17
16
 
18
17
  /** ** Styles *** */
19
18
  import style from './css/ReplyBubble.module.css';
19
+
20
+ /** ** Components *** */
20
21
  import ReplyBubbleHeader from '../ReplyBubbleHeader/ReplyBubbleHeader';
21
22
  import ReplyBubbleContent from '../ReplyBubbleContent/ReplyBubbleContent';
22
23
  export default function ReplyBubble(props) {
@@ -47,9 +48,9 @@ export default function ReplyBubble(props) {
47
48
  timeCustomStyle: timeCustomStyle
48
49
  }), /*#__PURE__*/React.createElement(ReplyBubbleContent, {
49
50
  customStyle: contentCustomStyle,
50
- senderName: senderName,
51
51
  renderIcon: renderIcon,
52
- renderMessage: renderMessage
52
+ renderMessage: renderMessage,
53
+ senderName: senderName
53
54
  }));
54
55
  }
55
56
  ReplyBubble.propTypes = replyBubblePropTypes;
@@ -2,22 +2,24 @@
2
2
  /* eslint-disable max-len */
3
3
 
4
4
  /** ** Libraries *** */
5
- import React from "react";
5
+ import React from 'react';
6
6
 
7
7
  /** ** Hooks *** */
8
- import useMergeStyle from "@zohodesk/hooks/es/utils/useMergeStyle";
8
+ import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
9
9
 
10
10
  /** ** Constants *** */
11
- import replyBubbleContentDefaultProps from "./props/defaultProps";
12
- import replyBubbleContentPropTypes from "./props/propTypes";
11
+ import replyBubbleContentDefaultProps from './props/defaultProps';
12
+ import replyBubbleContentPropTypes from './props/propTypes';
13
13
 
14
14
  /** ** Methods *** */
15
- import renderHandler from "@zohoim/chat-components-utils/es/common/renderHandler";
16
- import cssJSLogic from "./css/cssJSLogic";
15
+ import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
16
+ import cssJSLogic from './css/cssJSLogic';
17
17
 
18
18
  /** ** Styles *** */
19
- import style from "./css/ReplyBubbleContent.module.css";
20
- import { Container, Box } from "@zohodesk/components/es/Layout";
19
+ import style from './css/ReplyBubbleContent.module.css';
20
+
21
+ /** ** Components *** */
22
+ import { Container, Box } from '@zohodesk/components/es/Layout';
21
23
  export default function ReplyBubbleContent(props) {
22
24
  const {
23
25
  customStyle,
@@ -38,12 +40,14 @@ export default function ReplyBubbleContent(props) {
38
40
  const icon = renderHandler(renderIcon)();
39
41
  const messageContent = renderHandler(renderMessage)();
40
42
  return /*#__PURE__*/React.createElement(Container, {
41
- alignBox: "row",
42
43
  align: "vertical",
44
+ alignBox: "row",
43
45
  className: replyBubbleContentClass
44
- }, icon ? /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement("div", {
46
+ }, icon ? /*#__PURE__*/React.createElement(Box, {
45
47
  className: iconWrapperClass
46
- }, icon)) : "", /*#__PURE__*/React.createElement(Box, {
48
+ }, /*#__PURE__*/React.createElement(Container, {
49
+ align: "both"
50
+ }, icon)) : '', /*#__PURE__*/React.createElement(Box, {
47
51
  flexible: true
48
52
  }, /*#__PURE__*/React.createElement("div", {
49
53
  className: nameClass
@@ -53,4 +57,4 @@ export default function ReplyBubbleContent(props) {
53
57
  }
54
58
  ReplyBubbleContent.propTypes = replyBubbleContentPropTypes;
55
59
  ReplyBubbleContent.defaultProps = replyBubbleContentDefaultProps;
56
- ReplyBubbleContent.displayName = "ReplyBubbleContent";
60
+ ReplyBubbleContent.displayName = 'ReplyBubbleContent';
@@ -1,35 +1,37 @@
1
1
  .replyBubbleContent {
2
2
  position: relative;
3
- background-color: #fff;
4
- border-radius: 3px;
3
+ background-color: var(--imlib_chat_components_ReplyBubbleContent_bg_color);
4
+ border: var(--imlib_size_1) solid var(--imlib_chat_components_ReplyBubbleContent_border_color);
5
+ border-radius: var(--imlib_size_3);
6
+ margin: var(--imlib_size_5) 0;
5
7
  }[dir=ltr] .replyBubbleContent {
6
- padding: 10px 10px 10px 20px;
8
+ padding: var(--imlib_size_10) var(--imlib_size_10) var(--imlib_size_10) var(--imlib_size_20);
7
9
  }[dir=rtl] .replyBubbleContent {
8
- padding: 10px 20px 10px 10px;
10
+ padding: var(--imlib_size_10) var(--imlib_size_20) var(--imlib_size_10) var(--imlib_size_10);
9
11
  }
10
12
 
11
13
  .replyBubbleContent::after{
12
14
  content: "";
13
- width: 2px;
15
+ width: var(--imlib_size_2);
14
16
  display: block;
15
17
  position: absolute;
16
- top: 10px;
17
- bottom: 10px;
18
- background-color: #cddbf2;
19
- border-radius: 30px;
18
+ top: var(--imlib_size_10);
19
+ bottom: var(--imlib_size_10);
20
+ background-color: var(--imlib_chat_components_ReplyBubbleContent_line_color);
21
+ border-radius: var(--imlib_size_30);
20
22
  }
21
23
 
22
24
  [dir=ltr] .replyBubbleContent::after{
23
- left: 10px;
25
+ left: var(--imlib_size_10);
24
26
  }
25
27
 
26
28
  [dir=rtl] .replyBubbleContent::after{
27
- right: 10px;
29
+ right: var(--imlib_size_10);
28
30
  }
29
31
 
30
32
  .name {
31
- color: #000;
32
- font-size: 15px;
33
+ color: var(--imlib_chat_components_ReplyBubbleContent_color);
34
+ font-size: var(--imlib_size_15);
33
35
  line-height: 1.5;
34
36
  overflow: hidden;
35
37
  white-space: nowrap;
@@ -37,11 +39,19 @@
37
39
  text-overflow: ellipsis;
38
40
  }
39
41
 
42
+ [dir=ltr] .iconWrapper {
43
+ margin-right: var(--imlib_size_10);
44
+ }
45
+
46
+ [dir=rtl] .iconWrapper {
47
+ margin-left: var(--imlib_size_10);
48
+ }
49
+
40
50
  .messageWrapper {
41
- color: #000;
42
- font-size: 13px;
51
+ color: var(--imlib_chat_components_ReplyBubbleContent_color);
52
+ font-size: var(--imlib_size_13);
43
53
  line-height: 1.5;
44
- max-height: 40px;
54
+ max-height: var(--imlib_size_40);
45
55
  -webkit-line-clamp: 2;
46
56
  display: -webkit-box;
47
57
  -webkit-box-orient: vertical;
@@ -12,7 +12,6 @@ import replyBubbleHeaderDefaultProps from './props/defaultProps';
12
12
  import replyBubbleHeaderPropTypes from './props/propTypes';
13
13
 
14
14
  /** ** Methods *** */
15
- import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
16
15
  import cssJSLogic from './css/cssJSLogic';
17
16
 
18
17
  /** ** Styles *** */
@@ -20,21 +19,23 @@ import style from './css/ReplyBubbleHeader.module.css';
20
19
 
21
20
  /** ** Components *** */
22
21
  import { Container, Box } from '@zohodesk/components/es/Layout';
22
+
23
+ /** ** Icons *** */
23
24
  import ReplyIcon from '@zohodesk/icon/es/general/Reply';
24
- import IMDateTime from '../im/IMDateTime/IMDateTime';
25
25
  export default function ReplyBubbleHeader(props) {
26
26
  const {
27
27
  customStyle,
28
28
  replyText,
29
- time,
30
- timeCustomStyle
29
+ time
31
30
  } = props;
32
31
 
33
32
  /* External customization */
34
33
  const newStyle = useMergeStyle(style, customStyle);
35
34
  /* CSS classnames added based on logic */
36
35
  const {
37
- replyBubbleHeaderClass
36
+ replyBubbleHeaderClass,
37
+ replyTextClass,
38
+ timeClass
38
39
  } = cssJSLogic(props, newStyle);
39
40
  return /*#__PURE__*/React.createElement(Container, {
40
41
  alignBox: "row",
@@ -47,10 +48,11 @@ export default function ReplyBubbleHeader(props) {
47
48
  customStyle: {
48
49
  base: newStyle.replyIcon
49
50
  }
50
- }), /*#__PURE__*/React.createElement(Box, null, replyText))), /*#__PURE__*/React.createElement(IMDateTime, {
51
- customStyle: timeCustomStyle,
52
- value: time
53
- }));
51
+ }), /*#__PURE__*/React.createElement(Box, {
52
+ className: replyTextClass
53
+ }, replyText))), /*#__PURE__*/React.createElement("div", {
54
+ className: timeClass
55
+ }, time));
54
56
  }
55
57
  ReplyBubbleHeader.propTypes = replyBubbleHeaderPropTypes;
56
58
  ReplyBubbleHeader.defaultProps = replyBubbleHeaderDefaultProps;
@@ -1,4 +1,15 @@
1
- .replyIcon{
2
- width: 20px;
3
- height: 20px;
4
- }
1
+ .replyIcon {
2
+ width: var(--imlib_size_20);
3
+ height: var(--imlib_size_20);
4
+ }
5
+
6
+ .replyText {
7
+ max-width: var(--zd_size100);
8
+ white-space: nowrap;
9
+ overflow: hidden;
10
+ text-overflow: ellipsis;
11
+ font-size: var(--zd_size14);
12
+ }
13
+ .time {
14
+ /*time class*/
15
+ }
@@ -4,7 +4,15 @@ export default function cssJSLogic(props, style) {
4
4
  const replyBubbleHeaderClass = compileClassNames({
5
5
  [style.replyBubbleHeader]: true
6
6
  });
7
+ const replyTextClass = compileClassNames({
8
+ [style.replyText]: true
9
+ });
10
+ const timeClass = compileClassNames({
11
+ [style.time]: true
12
+ });
7
13
  return {
8
- replyBubbleHeaderClass
14
+ replyBubbleHeaderClass,
15
+ replyTextClass,
16
+ timeClass
9
17
  };
10
18
  }