@zohoim/chat-components 0.0.10 → 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 +20 -18
  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 +14 -12
  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
@@ -1,19 +1,22 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  /* eslint-disable react/jsx-no-bind */
2
3
 
3
4
  /** ** Libraries *** */
4
- import React from "react";
5
+ import React from 'react';
5
6
 
6
7
  /** ** Hooks *** */
7
8
  import useIMMessage from '@zohoim/chat-components-hooks/es/im/IMMessage/useIMMessage';
8
9
 
9
10
  /** ** Constants *** */
10
- import imMessageDefaultProps from "./props/defaultProps";
11
- import imMessagePropTypes from "./props/propTypes";
11
+ import imMessageDefaultProps from './props/defaultProps';
12
+ import imMessagePropTypes from './props/propTypes';
13
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants';
12
14
 
13
15
  /** ** Components *** */
14
16
  import Message from '../../Message/Message';
15
- import IMMessageContent from "../IMMessageContent/IMMessageContent";
16
- import IMTicketLink from "../IMTicketLink/IMTicketLink";
17
+ import IMMessageContent from '../IMMessageContent/IMMessageContent';
18
+ import IMTicketLink from '../IMTicketLink/IMTicketLink';
19
+ import IMIntegrationIcon from '../IMIntegrationIcon/IMIntegrationIcon';
17
20
  export default function IMMessage(props) {
18
21
  const {
19
22
  defaultAgentAvatar,
@@ -29,55 +32,39 @@ export default function IMMessage(props) {
29
32
  isSameTimeMessage,
30
33
  messageActionDetails,
31
34
  canReply,
32
- /*Customization Props*/
33
- messageBubbleCustomStyle,
34
- avatarCustomStyle,
35
- senderIntegrationIconCustomStyle,
36
- messageBoxCustomStyle,
37
- actionIconCustomStyle,
38
- moreActionItemCustomStyle,
39
- messageActionCustomStyle,
40
- moreActionPopupCustomStyle,
41
- messageStatusCustomStyle,
42
- needMessageActions,
43
- needSender,
44
- needMessageBox,
45
- isCustomIntegrationIcon,
46
- isCustomSenderAvatar,
47
- senderAvatarSize,
48
- senderIntegrationIconSize,
49
- actionsDefaultShowCount,
50
- renderCustomIntegrationIcon,
51
- renderCustomSenderAvatar,
52
- renderMessageFooter,
53
- renderMessageHeader,
54
35
  replyText,
55
36
  articleShareText,
56
- moreText
37
+ moreText,
38
+ customProps
57
39
  } = props;
40
+ const {
41
+ messageBubbleProps = dummyObject,
42
+ messageOwnerProps = dummyObject,
43
+ messageBoxProps = dummyObject,
44
+ messageStatusProps = dummyObject,
45
+ messageActionsProps = dummyObject,
46
+ imMessageContentProps = dummyObject,
47
+ imTicketLinkProps = dummyObject,
48
+ imIntegrationIconProps = dummyObject
49
+ } = customProps;
58
50
  const {
59
51
  direction,
60
- isDeletedMessage,
61
- isFailedMessage,
62
52
  isActive,
63
53
  isShowSender,
64
- isBot,
54
+ // isBot,
65
55
  senderSrc,
66
56
  senderAlternateSrc,
67
- senderTitle,
68
57
  senderName,
69
58
  isShowIntegrationIcon,
70
59
  integrationName,
71
- messageMetaType,
72
- messageType,
60
+ // messageMetaType,
61
+ // messageType,
73
62
  messageStatus,
74
63
  isAgentMessage,
75
64
  messageStatusTitle,
76
- displayMessage,
77
65
  createdTime,
78
66
  messageId,
79
67
  ticketNumber,
80
- ticketId,
81
68
  messageActions
82
69
  } = useIMMessage({
83
70
  defaultAgentAvatar,
@@ -94,28 +81,16 @@ export default function IMMessage(props) {
94
81
  canReply
95
82
  });
96
83
  function handleRenderMessageBoxFooter() {
97
- return !isSameTimeMessage ?
98
- /*#__PURE__*/
99
- // <CommonDateWithTime
100
- // to={createdTime}
101
- // isNeedTime
102
- // prefix=''
103
- // isTimeOnly
104
- // hideTitle
105
- // />
106
- // ) :
107
- React.createElement("div", null, createdTime) : null;
84
+ return !isSameTimeMessage ? /*#__PURE__*/React.createElement("div", null, createdTime) : null;
108
85
  }
109
86
  function handleRenderMessage() {
110
- return /*#__PURE__*/React.createElement(IMMessageContent, {
111
- messageDetails: messageDetails,
112
- replyText: replyText,
87
+ return /*#__PURE__*/React.createElement(IMMessageContent, _extends({
113
88
  articleShareText: articleShareText,
114
- moreText: moreText
115
- });
116
- // return <div>{displayMessage}</div>;
89
+ messageDetails: messageDetails,
90
+ moreText: moreText,
91
+ replyText: replyText
92
+ }, imMessageContentProps));
117
93
  }
118
-
119
94
  function handleSelectAction(_ref) {
120
95
  let {
121
96
  id,
@@ -133,64 +108,43 @@ export default function IMMessage(props) {
133
108
  });
134
109
  }
135
110
  function handleRenderSecondaryActions() {
136
- // return null;
137
- return /*#__PURE__*/React.createElement(IMTicketLink, {
111
+ return /*#__PURE__*/React.createElement(IMTicketLink, _extends({
138
112
  ticketNumber: ticketNumber
139
- });
140
-
141
- /*
142
- <a
143
- data-id={`ticketLink_${ticketNumber}`}
144
- // className={style.ticketId}
145
- // href='javascript:;'
146
- target='_blank'
147
- rel='noopener noreferrer'
148
- >
149
- {`#${ticketNumber}`}
150
- </a>
151
- */
113
+ }, imTicketLinkProps));
114
+ }
115
+ function handleRenderIntegIcon() {
116
+ /*#__PURE__*/React.createElement(IMIntegrationIcon, _extends({
117
+ integrationName: isShowIntegrationIcon ? integrationName : ''
118
+ }, imIntegrationIconProps));
152
119
  }
153
-
154
120
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Message, {
121
+ actions: messageActions,
122
+ customProps: {
123
+ messageOwnerProps,
124
+ messageBoxProps,
125
+ messageStatusProps,
126
+ messageActionsProps,
127
+ messageBubbleProps: {
128
+ renderMessageBoxFooter: handleRenderMessageBoxFooter,
129
+ ...messageBubbleProps
130
+ }
131
+ },
155
132
  direction: direction,
156
133
  isActive: isActive,
157
134
  isShowSender: isShowSender,
158
- senderName: senderName,
159
- senderSrc: senderSrc,
160
- senderAlternateSrc: senderAlternateSrc,
161
- senderTitle: senderTitle,
162
- senderIntegrationIcon: isShowIntegrationIcon ? integrationName : "",
163
- isFailedMessage: isFailedMessage,
164
- messageActions: messageActions,
165
- needMessageActions: needMessageActions ? messageActions.length >= 0 : false,
166
135
  onSelectAction: handleSelectAction,
167
- messageStatus: isAgentMessage ? messageStatus : "",
168
- statusTitle: messageStatusTitle,
169
- customStyle: messageBubbleCustomStyle,
170
- avatarCustomStyle: avatarCustomStyle,
171
- senderIntegrationIconCustomStyle: senderIntegrationIconCustomStyle,
172
- messageBoxCustomStyle: messageBoxCustomStyle,
173
- actionIconCustomStyle: actionIconCustomStyle,
174
- moreActionItemCustomStyle: moreActionItemCustomStyle,
175
- messageActionCustomStyle: messageActionCustomStyle,
176
- moreActionPopupCustomStyle: moreActionPopupCustomStyle,
177
- messageStatusCustomStyle: messageStatusCustomStyle,
178
- needSender: needSender,
179
- needMessageBox: needMessageBox,
180
- isCustomIntegrationIcon: isCustomIntegrationIcon,
181
- isCustomSenderAvatar: isCustomSenderAvatar,
182
- senderAvatarSize: senderAvatarSize,
183
- senderIntegrationIconSize: senderIntegrationIconSize,
184
- actionsDefaultShowCount: actionsDefaultShowCount,
185
- renderCustomIntegrationIcon: renderCustomIntegrationIcon,
186
- renderCustomSenderAvatar: renderCustomSenderAvatar,
136
+ ownerDetails: {
137
+ src: senderSrc,
138
+ alternateSrc: senderAlternateSrc,
139
+ name: senderName
140
+ },
141
+ renderContent: handleRenderMessage,
142
+ renderOwnerOverlay: handleRenderIntegIcon,
187
143
  renderSecondaryActions: handleRenderSecondaryActions,
188
- renderMessage: handleRenderMessage,
189
- renderMessageFooter: renderMessageFooter,
190
- renderMessageHeader: renderMessageHeader,
191
- renderMessageBoxFooter: handleRenderMessageBoxFooter
144
+ status: isAgentMessage ? messageStatus : '',
145
+ statusTooltip: messageStatusTitle
192
146
  }));
193
147
  }
194
148
  IMMessage.propTypes = imMessagePropTypes;
195
149
  IMMessage.defaultProps = imMessageDefaultProps;
196
- IMMessage.displayName = "IMMessage";
150
+ IMMessage.displayName = 'IMMessage';
@@ -2,8 +2,6 @@
2
2
 
3
3
  /** ** Constants *** */
4
4
  import { dummyObject } from '@zohoim/chat-components-utils/es/constants';
5
- import sizes from '@zohoim/chat-components-utils/es/constants/sizes';
6
- import { actionsDefaultShowCount } from '@zohoim/chat-components-utils/es/constants/messageActionConstants';
7
5
  const imMessageDefaultProps = {
8
6
  messageDetails: dummyObject,
9
7
  sessionDetails: dummyObject,
@@ -17,22 +15,6 @@ const imMessageDefaultProps = {
17
15
  messageActionDetails: dummyObject,
18
16
  isCurrentAgent: false,
19
17
  canReply: false,
20
- messageBubbleCustomStyle: dummyObject,
21
- avatarCustomStyle: dummyObject,
22
- senderIntegrationIconCustomStyle: dummyObject,
23
- messageBoxCustomStyle: dummyObject,
24
- actionIconCustomStyle: dummyObject,
25
- moreActionItemCustomStyle: dummyObject,
26
- messageActionCustomStyle: dummyObject,
27
- moreActionPopupCustomStyle: dummyObject,
28
- messageStatusCustomStyle: dummyObject,
29
- needMessageActions: true,
30
- needSender: true,
31
- needMessageBox: true,
32
- isCustomIntegrationIcon: false,
33
- isCustomSenderAvatar: false,
34
- senderAvatarSize: 'medium',
35
- senderIntegrationIconSize: sizes.SMALL,
36
- actionsDefaultShowCount: actionsDefaultShowCount
18
+ customProps: dummyObject
37
19
  };
38
20
  export default imMessageDefaultProps;
@@ -1,10 +1,10 @@
1
+ /* eslint-disable no-undef */
1
2
  /** ** Libraries *** */
2
- import PropTypes from "prop-types";
3
+ import PropTypes from 'prop-types';
3
4
 
4
5
  /** ** Constants *** */
5
- import { defaultMessageActions } from "@zohoim/chat-components-utils/es/constants/messageActionConstants";
6
- import messageStatusConstants from "@zohoim/chat-components-utils/es/constants/messageStatusConstants";
7
- import sizes from "@zohoim/chat-components-utils/es/constants/sizes";
6
+ import { defaultMessageActions } from '@zohoim/chat-components-utils/es/constants/messageActionConstants';
7
+ import messageStatusConstants from '@zohoim/chat-components-utils/es/constants/messageStatusConstants';
8
8
  const {
9
9
  REPLY,
10
10
  COPY,
@@ -51,7 +51,7 @@ const imMessagePropTypes = {
51
51
  displayMessage: PropTypes.string,
52
52
  createdTime: PropTypes.string,
53
53
  id: PropTypes.string
54
- }),
54
+ }).isRequired,
55
55
  sessionDetails: PropTypes.shape({
56
56
  integrationService: PropTypes.string
57
57
  }),
@@ -116,33 +116,20 @@ const imMessagePropTypes = {
116
116
  iconTitle: PropTypes.string,
117
117
  onClick: PropTypes.func
118
118
  })
119
- }),
119
+ }).isRequired,
120
120
  canReply: PropTypes.bool.isRequired,
121
- messageBubbleCustomStyle: PropTypes.object,
122
- needMessageActions: PropTypes.bool,
123
- needSender: PropTypes.bool,
124
- senderAvatarSize: PropTypes.oneOf(["xxsmall", "small", "xsmall", "medium", "xmedium", "large", "xlarge"]),
125
- avatarCustomStyle: PropTypes.object,
126
- senderIntegrationIconSize: PropTypes.oneOf([sizes.SMALL, sizes.MEDIUM]),
127
- senderIntegrationIconCustomStyle: PropTypes.object,
128
- isCustomIntegrationIcon: PropTypes.bool,
129
- isCustomSenderAvatar: PropTypes.bool,
130
- renderCustomIntegrationIcon: PropTypes.func,
131
- renderCustomSenderAvatar: PropTypes.func,
132
- needMessageBox: PropTypes.bool,
133
- renderMessage: PropTypes.func.isRequired,
134
- renderMessageFooter: PropTypes.func,
135
- renderMessageHeader: PropTypes.func,
136
- messageBoxCustomStyle: PropTypes.object,
137
- renderSecondaryActions: PropTypes.func,
138
- actionsDefaultShowCount: PropTypes.number,
139
- actionIconCustomStyle: PropTypes.object,
140
- moreActionItemCustomStyle: PropTypes.object,
141
- messageActionCustomStyle: PropTypes.object,
142
- moreActionPopupCustomStyle: PropTypes.object,
143
- messageStatusCustomStyle: PropTypes.object,
144
121
  replyText: PropTypes.string,
145
122
  articleShareText: PropTypes.string,
146
- moreText: PropTypes.string
123
+ moreText: PropTypes.string,
124
+ customProps: PropTypes.shape({
125
+ messageBubbleProps: PropTypes.object,
126
+ messageOwnerProps: PropTypes.object,
127
+ messageBoxProps: PropTypes.object,
128
+ messageStatusProps: PropTypes.object,
129
+ messageActionsProps: PropTypes.object,
130
+ imMessageContentProps: PropTypes.object,
131
+ imTicketLinkProps: PropTypes.object,
132
+ imIntegrationIconProps: PropTypes.object
133
+ })
147
134
  };
148
135
  export default imMessagePropTypes;
@@ -24,21 +24,21 @@ export default function IMMessageAvatar(props) {
24
24
  } = props;
25
25
  function renderIcon() {
26
26
  return /*#__PURE__*/React.createElement(IMIntegrationIcon, {
27
- integrationName: integrationName,
28
- size: iconSize,
29
27
  customStyle: iconCustomStyle,
28
+ integrationName: integrationName,
30
29
  isCustom: isCustomIcon,
31
- renderIcon: renderCustomIcon
30
+ renderIcon: renderCustomIcon,
31
+ size: iconSize
32
32
  });
33
33
  }
34
34
  return /*#__PURE__*/React.createElement(MessageAvatar, {
35
- src: src,
36
35
  alternateSrc: alternateSrc,
37
- title: title,
38
- size: avatarSize,
36
+ customStyle: customStyle,
39
37
  name: name,
40
38
  renderIcon: renderIcon,
41
- customStyle: customStyle
39
+ size: avatarSize,
40
+ src: src,
41
+ title: title
42
42
  });
43
43
  }
44
44
  IMMessageAvatar.defaultProps = imMessageAvatarDefaultProps;
@@ -1,12 +1,12 @@
1
1
  /** ** Constants *** */
2
2
  import { dummyObject } from '@zohoim/chat-components-utils/es/constants';
3
- const imMessageActionsDefaultProps = {
3
+ const imMessageAvatarDefaultProps = {
4
4
  customStyle: dummyObject,
5
5
  iconCustomStyle: dummyObject,
6
6
  isCustomIcon: false,
7
7
  title: '',
8
- //'RAVI KUMAR',
9
- name: '' //'RAVI KUMAR',
8
+ // 'RAVI KUMAR',
9
+ name: '' // 'RAVI KUMAR',
10
10
  };
11
11
 
12
- export default imMessageActionsDefaultProps;
12
+ export default imMessageAvatarDefaultProps;
@@ -25,4 +25,29 @@ const imMessageAvatarPropTypes = {
25
25
  isCustomIcon: PropTypes.bool,
26
26
  renderCustomIcon: PropTypes.string
27
27
  };
28
+
29
+ // const props = {
30
+ // src: PropTypes.string,
31
+ // alternateSrc: PropTypes.string,
32
+ // title: PropTypes.string,
33
+ // avatarSize: PropTypes.string,
34
+ // name: PropTypes.string,
35
+ // customStyle: PropTypes.object,
36
+ // iconProps: PropTypes.shape({
37
+ // integrationName: PropTypes.oneOf([
38
+ // WHATSAPP,
39
+ // TELEGRAM,
40
+ // INSTAGRAM,
41
+ // ASAP,
42
+ // WECHAT,
43
+ // TWILLIO,
44
+ // LINE
45
+ // ]),
46
+ // size: PropTypes.string,
47
+ // customStyle: PropTypes.object,
48
+ // isCustom: PropTypes.bool,
49
+ // renderIcon: PropTypes.string
50
+ // })
51
+ // };
52
+
28
53
  export default imMessageAvatarPropTypes;
@@ -2,31 +2,31 @@
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 imMessageContentDefaultProps from "./props/defaultProps";
12
- import imMessageContentPropTypes from "./props/propTypes";
11
+ import imMessageContentDefaultProps from './props/defaultProps';
12
+ import imMessageContentPropTypes 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 getIsShowBubble from '@zohoim/chat-components-utils/es/imUtils/getIsShowBubble';
16
+ import cssJSLogic from './css/cssJSLogic';
17
17
 
18
18
  /** ** Styles *** */
19
- import style from "./css/IMMessageContent.module.css";
20
- import useIMMessageContent from '@zohoim/chat-components-hooks/es/im/IMMessageContent/useIMMessageContent';
21
- import { messageTypes, mediaTypes as mediaTypeConstants } from "@zohoim/chat-components-utils/es/constants/messageConstants";
22
- import IMReplyBubble from "../IMReplyBubble/IMReplyBubble";
23
- import IMLocationBubble from "../IMLocationBubble/IMLocationBubble";
24
- import IMTextBubble from "../IMTextBubble/IMTextBubble";
25
- import IMImageBubble from "../IMImageBubble/IMImageBubble";
26
- import IMVideoBubble from "../IMVideoBubble/IMVideoBubble";
27
- import IMAudioBubble from "../IMAudioBubble/IMAudioBubble";
28
- import IMAttachmentBubble from "../IMAttachmentBubble/IMAttachmentBubble";
29
- import IMArticleBubble from "../IMArticleBubble/IMArticleBubble";
19
+ import style from './css/IMMessageContent.module.css';
20
+
21
+ /** ** Components *** */
22
+ import IMReplyBubble from '../IMReplyBubble/IMReplyBubble';
23
+ import IMLocationBubble from '../IMLocationBubble/IMLocationBubble';
24
+ import IMTextBubble from '../IMTextBubble/IMTextBubble';
25
+ import IMImageBubble from '../IMImageBubble/IMImageBubble';
26
+ import IMVideoBubble from '../IMVideoBubble/IMVideoBubble';
27
+ import IMAudioBubble from '../IMAudioBubble/IMAudioBubble';
28
+ import IMAttachmentBubble from '../IMAttachmentBubble/IMAttachmentBubble';
29
+ import IMArticleBubble from '../IMArticleBubble/IMArticleBubble';
30
30
  export default function IMMessageContent(props) {
31
31
  const {
32
32
  customStyle,
@@ -45,7 +45,7 @@ export default function IMMessageContent(props) {
45
45
  isShowLocationBubble,
46
46
  isShowArticleBubble,
47
47
  isShowTextBubble
48
- } = useIMMessageContent({
48
+ } = getIsShowBubble({
49
49
  messageDetails
50
50
  });
51
51
 
@@ -63,27 +63,43 @@ export default function IMMessageContent(props) {
63
63
  } = messageDetails || {};
64
64
  return /*#__PURE__*/React.createElement("div", {
65
65
  className: imMessageContentClass
66
- }, isShowLayoutBubble ? null : null, isShowReplyBubble ? /*#__PURE__*/React.createElement(IMReplyBubble, {
66
+ }, isShowLayoutBubble ? null : null, isShowReplyBubble ? /*#__PURE__*/React.createElement("div", {
67
+ className: style.messageContentRow
68
+ }, /*#__PURE__*/React.createElement(IMReplyBubble, {
67
69
  messageDetails: replyToMessage,
68
70
  replyText: replyText
69
- }) : null, isShowImageBubble ? /*#__PURE__*/React.createElement(IMImageBubble, {
71
+ })) : null, isShowImageBubble ? /*#__PURE__*/React.createElement("div", {
72
+ className: style.messageContentRow
73
+ }, /*#__PURE__*/React.createElement(IMImageBubble, {
70
74
  attachmentDetails: attachmentDetails
71
- }) : null, isShowVideoBubble ? /*#__PURE__*/React.createElement(IMVideoBubble, {
75
+ })) : null, isShowVideoBubble ? /*#__PURE__*/React.createElement("div", {
76
+ className: style.messageContentRow
77
+ }, /*#__PURE__*/React.createElement(IMVideoBubble, {
72
78
  attachmentDetails: attachmentDetails
73
- }) : null, isShowAudioBubble ? /*#__PURE__*/React.createElement(IMAudioBubble, {
79
+ })) : null, isShowAudioBubble ? /*#__PURE__*/React.createElement("div", {
80
+ className: style.messageContentRow
81
+ }, /*#__PURE__*/React.createElement(IMAudioBubble, {
74
82
  attachmentDetails: attachmentDetails
75
- }) : null, isShowAttachmentBubble ? /*#__PURE__*/React.createElement(IMAttachmentBubble, {
83
+ })) : null, isShowAttachmentBubble ? /*#__PURE__*/React.createElement("div", {
84
+ className: style.messageContentRow
85
+ }, /*#__PURE__*/React.createElement(IMAttachmentBubble, {
76
86
  attachmentDetails: attachmentDetails
77
- }) : null, isShowLocationBubble ? /*#__PURE__*/React.createElement(IMLocationBubble, {
87
+ })) : null, isShowLocationBubble ? /*#__PURE__*/React.createElement("div", {
88
+ className: style.messageContentRow
89
+ }, /*#__PURE__*/React.createElement(IMLocationBubble, {
78
90
  locationDetails: locationDetails
79
- }) : null, isShowArticleBubble ? /*#__PURE__*/React.createElement(IMArticleBubble, {
91
+ })) : null, isShowArticleBubble ? /*#__PURE__*/React.createElement("div", {
92
+ className: style.messageContentRow
93
+ }, /*#__PURE__*/React.createElement(IMArticleBubble, {
80
94
  articleDetails: articleDetails,
81
95
  articleShareI18N: articleShareText
82
- }) : null, isShowTextBubble ? /*#__PURE__*/React.createElement(IMTextBubble, {
96
+ })) : null, isShowTextBubble ? /*#__PURE__*/React.createElement("div", {
97
+ className: style.messageContentRow
98
+ }, /*#__PURE__*/React.createElement(IMTextBubble, {
83
99
  messageDetails: messageDetails,
84
100
  moreText: seeMoreText
85
- }) : null);
101
+ })) : null);
86
102
  }
87
103
  IMMessageContent.propTypes = imMessageContentPropTypes;
88
104
  IMMessageContent.defaultProps = imMessageContentDefaultProps;
89
- IMMessageContent.displayName = "IMMessageContent";
105
+ IMMessageContent.displayName = 'IMMessageContent';
@@ -0,0 +1,3 @@
1
+ .messageContentRow + .messageContentRow{
2
+ margin-top: 5px;
3
+ }
@@ -12,14 +12,13 @@ import imMessageMetaDefaultProps from './props/defaultProps';
12
12
  import imMessageMetaPropTypes 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/IMMessageMeta.module.css';
20
19
 
21
20
  /** ** Components *** */
22
- import { Container, Box } from '@zohodesk/components/es/Layout';
21
+ import { Container } from '@zohodesk/components/es/Layout';
23
22
  import IMDateTime from '../IMDateTime/IMDateTime';
24
23
  import IMAutoMessageInfo from '../IMAutoMessageInfo/IMAutoMessageInfo';
25
24
  export default function IMMessageMeta(props) {
@@ -49,10 +48,10 @@ export default function IMMessageMeta(props) {
49
48
  }), /*#__PURE__*/React.createElement("div", {
50
49
  className: dotClass
51
50
  }, "\u22C5"), /*#__PURE__*/React.createElement(IMAutoMessageInfo, {
52
- customStyle: autoMessageCustomStyle,
53
51
  autoMessageType: autoMessageType,
54
52
  autoMessagesI18N: autoMessagesI18N,
55
- autoMessagesTitleI18N: autoMessagesTitleI18N
53
+ autoMessagesTitleI18N: autoMessagesTitleI18N,
54
+ customStyle: autoMessageCustomStyle
56
55
  }));
57
56
  }
58
57
  IMMessageMeta.propTypes = imMessageMetaPropTypes;
@@ -12,7 +12,6 @@ import imReplyBubbleDefaultProps from './props/defaultProps';
12
12
  import imReplyBubblePropTypes 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 *** */
@@ -34,15 +33,16 @@ export default function IMReplyBubble(props) {
34
33
  const newStyle = useMergeStyle(style, customStyle);
35
34
  /* CSS classnames added based on logic */
36
35
  const {
37
- imReplyBubbleClass,
38
- attachmentIconStyle
36
+ imReplyBubbleClass
39
37
  } = cssJSLogic(props, newStyle);
40
38
  const {
41
39
  fileFormat,
42
- fileURL,
43
40
  message,
44
41
  senderName,
45
- time
42
+ time,
43
+ isShowImage,
44
+ fileName,
45
+ attachmentURL
46
46
  } = useIMReplyBubble({
47
47
  messageDetails
48
48
  });
@@ -54,11 +54,13 @@ export default function IMReplyBubble(props) {
54
54
  });
55
55
  }
56
56
  function renderIcon() {
57
- return fileFormat ? /*#__PURE__*/React.createElement("div", {
57
+ // eslint-disable-next-line no-nested-ternary
58
+ return isShowImage ? /*#__PURE__*/React.createElement("div", {
58
59
  className: newStyle.imageWrapper
59
60
  }, /*#__PURE__*/React.createElement("img", {
61
+ alt: fileName,
60
62
  className: newStyle.image,
61
- src: "https://contacts.zoho.com/file"
63
+ src: attachmentURL
62
64
  })) : fileFormat ? /*#__PURE__*/React.createElement(IMAttachmentIcon, {
63
65
  customStyle: {
64
66
  $icon: newStyle.attachmentIcon
@@ -69,14 +71,14 @@ export default function IMReplyBubble(props) {
69
71
  return /*#__PURE__*/React.createElement("div", {
70
72
  className: imReplyBubbleClass
71
73
  }, /*#__PURE__*/React.createElement(ReplyBubble, {
72
- headerCustomStyle: headerCustomStyle,
73
- timeCustomStyle: timeCustomStyle,
74
74
  contentCustomStyle: contentCustomStyle,
75
+ headerCustomStyle: headerCustomStyle,
76
+ renderIcon: renderIcon,
77
+ renderMessage: renderMessage,
78
+ replyText: replyText,
75
79
  senderName: senderName,
76
80
  time: time,
77
- replyText: replyText,
78
- renderMessage: renderMessage,
79
- renderIcon: renderIcon
81
+ timeCustomStyle: timeCustomStyle
80
82
  }));
81
83
  }
82
84
  IMReplyBubble.propTypes = imReplyBubblePropTypes;
@@ -1,24 +1,18 @@
1
1
  .attachmentIcon {
2
- height: 40px;
3
- width: 40px;
2
+ height: var(--imlib_size_40);
3
+ width: var(--imlib_size_40);
4
4
  }
5
5
 
6
6
  .imageWrapper {
7
- height: 60px;
8
- width: 60px;
7
+ height: var(--imlib_size_60);
8
+ width: var(--imlib_size_60);
9
9
  overflow: hidden;
10
- }
11
-
12
- [dir=ltr] .imageWrapper {
13
- margin-right: 10px;
14
- }
15
-
16
- [dir=rtl] .imageWrapper {
17
- margin-left: 10px;
10
+ /* margin-right: var(--imlib_size_10); */
18
11
  }
19
12
 
20
13
  .image {
21
14
  width: 100%;
22
15
  height: 100%;
23
- border-radius: 3px;
16
+ object-fit: cover;
17
+ border-radius: var(--imlib_size_3);
24
18
  }