@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
@@ -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,8 +33,7 @@ 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,
@@ -56,12 +54,13 @@ export default function IMReplyBubble(props) {
56
54
  });
57
55
  }
58
56
  function renderIcon() {
57
+ // eslint-disable-next-line no-nested-ternary
59
58
  return isShowImage ? /*#__PURE__*/React.createElement("div", {
60
59
  className: newStyle.imageWrapper
61
60
  }, /*#__PURE__*/React.createElement("img", {
61
+ alt: fileName,
62
62
  className: newStyle.image,
63
- src: attachmentURL,
64
- alt: fileName
63
+ src: attachmentURL
65
64
  })) : fileFormat ? /*#__PURE__*/React.createElement(IMAttachmentIcon, {
66
65
  customStyle: {
67
66
  $icon: newStyle.attachmentIcon
@@ -72,14 +71,14 @@ export default function IMReplyBubble(props) {
72
71
  return /*#__PURE__*/React.createElement("div", {
73
72
  className: imReplyBubbleClass
74
73
  }, /*#__PURE__*/React.createElement(ReplyBubble, {
75
- headerCustomStyle: headerCustomStyle,
76
- timeCustomStyle: timeCustomStyle,
77
74
  contentCustomStyle: contentCustomStyle,
75
+ headerCustomStyle: headerCustomStyle,
76
+ renderIcon: renderIcon,
77
+ renderMessage: renderMessage,
78
+ replyText: replyText,
78
79
  senderName: senderName,
79
80
  time: time,
80
- replyText: replyText,
81
- renderMessage: renderMessage,
82
- renderIcon: renderIcon
81
+ timeCustomStyle: timeCustomStyle
83
82
  }));
84
83
  }
85
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
  }
@@ -12,7 +12,6 @@ import imTextBubbleDefaultProps from './props/defaultProps';
12
12
  import imTextBubblePropTypes 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 *** */
@@ -43,10 +42,10 @@ export default function IMTextBubble(props) {
43
42
  className: imTextBubbleWrapperClass
44
43
  }, isShowQuote ? /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(QuoteIcon, null)) : null, /*#__PURE__*/React.createElement(TextBubble, {
45
44
  customStyle: textBubbleCustomStyle,
46
- message: sanitizedDisplayMessage,
47
45
  isShowMoreText: isShowSeeMore,
48
- onClickMore: onLoadFullMessage,
49
- moreText: moreText
46
+ message: sanitizedDisplayMessage,
47
+ moreText: moreText,
48
+ onClickMore: onLoadFullMessage
50
49
  }));
51
50
  }
52
51
  IMTextBubble.propTypes = imTextBubblePropTypes;
@@ -14,9 +14,7 @@ import imTicketLinkDefaultProps from './props/defaultProps';
14
14
  import imTicketLinkPropTypes from './props/propTypes';
15
15
 
16
16
  /** ** Methods *** */
17
- import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
18
17
  import cssJSLogic from './css/cssJSLogic';
19
- import { URLValidator } from '@zohoim/chat-components-utils/es/imUtils/security';
20
18
 
21
19
  /** ** Styles *** */
22
20
  import style from './css/IMTicketLink.module.css';
@@ -38,8 +36,8 @@ export default function IMTicketLink(props) {
38
36
  } = cssJSLogic(props, newStyle);
39
37
  return ticketNumber ? /*#__PURE__*/React.createElement("a", {
40
38
  className: imTicketLinkClass,
41
- onClick: onClick,
42
39
  href: ticketURL,
40
+ onClick: onClick,
43
41
  rel: "noopener noreferrer"
44
42
  }, ticketNumber) : null;
45
43
  }
@@ -12,7 +12,6 @@ import imVideoBubbleDefaultProps from './props/defaultProps';
12
12
  import imVideoBubblePropTypes 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 *** */
@@ -47,14 +46,14 @@ export default function IMVideoBubble(props) {
47
46
  return isShow ? /*#__PURE__*/React.createElement("div", {
48
47
  className: imVideoBubbleClass
49
48
  }, /*#__PURE__*/React.createElement(VideoBubble, {
50
- customStyle: videoBubbleCustomStyle,
51
- headerCustomStyle: headerCustomStyle,
52
49
  audioCustomStyle: videoCustomStyle,
53
50
  controlsCustomStyle: controlsCustomStyle,
51
+ customStyle: videoBubbleCustomStyle,
54
52
  fileName: fileName,
55
53
  fileSize: fileSize,
54
+ fileType: fileType,
56
55
  fileURL: fileURL,
57
- fileType: fileType
56
+ headerCustomStyle: headerCustomStyle
58
57
  })) : null;
59
58
  }
60
59
  IMVideoBubble.propTypes = imVideoBubblePropTypes;
package/es/im/index.js CHANGED
@@ -1,7 +1,5 @@
1
1
  export * from './IMIntegrationIcon';
2
- export * from './IMMessageActions';
3
2
  export * from './IMMessageAvatar';
4
- export * from './IMMessageStatus';
5
3
  export * from './IMMessage';
6
4
  export * from './IMDateTime';
7
5
  export * from './IMTicketLink';
package/es/index.js CHANGED
@@ -1,37 +1,35 @@
1
- export * from "./MessageBubble";
1
+ export * from './MessageBubble';
2
2
 
3
3
  // export * from './AvatarSpace';
4
- export * from "./MessageActions";
5
- export * from "./MessageBox";
6
- export * from "./MessageBoxHeader";
7
- export * from "./MessageBoxFooter";
8
- export * from "./ActionIcon";
9
- export * from "./MessageActionsMore";
10
- export * from "./TextMessage";
11
- export * from "./MessageAvatar";
12
- export * from "./MoreActionItem";
13
- export * from "./MessageAction";
14
- export * from "./Theme";
15
- export * from "./MessageWrapper";
16
- export * from "./Message";
17
- export * from "./AudioBubble";
18
- export * from "./AttachmentBubble";
19
- export * from "./VideoBubble";
20
- export * from "./ImageBubble";
21
- export * from "./TextBubble";
22
- export * from "./ArticleBubble";
23
- export * from "./LocationBubble";
24
- export * from "./InfoBubble";
25
- export * from "./AttachmentBubbleInfo";
26
- export * from "./Audio";
27
- export * from "./Video";
28
- export * from "./ReplyBubble";
29
- export * from "./ReplyBubbleHeader";
30
- export * from "./LazyLoadImage";
4
+ export * from './MessageActionsWrapper';
5
+ export * from './MessageActions';
6
+ export * from './MessageBox';
7
+ export * from './ActionIcon';
8
+ export * from './MessageActionsMore';
9
+ export * from './MessageAvatar';
10
+ export * from './MoreActionItem';
11
+ export * from './MessageAction';
12
+ export * from './Theme';
13
+ export * from './Message';
14
+ export * from './AudioBubble';
15
+ export * from './AttachmentBubble';
16
+ export * from './VideoBubble';
17
+ export * from './ImageBubble';
18
+ export * from './TextBubble';
19
+ export * from './ArticleBubble';
20
+ export * from './LocationBubble';
21
+ export * from './InfoBubble';
22
+ export * from './AttachmentBubbleInfo';
23
+ export * from './Audio';
24
+ export * from './Video';
25
+ export * from './ReplyBubble';
26
+ export * from './ReplyBubbleHeader';
27
+ export * from './LazyLoadImage';
31
28
  export * from './ReplyBubbleContent';
29
+ export * from './MessageStatus';
32
30
  export * from './im';
33
31
 
34
32
  // ... export other components
35
33
 
36
- /*** CONSTANTS ***/
37
- export * from "./constants";
34
+ /** * CONSTANTS ** */
35
+ export * from './constants';
@@ -12,7 +12,6 @@ import messageWrapperDefaultProps from './props/defaultProps';
12
12
  import messageWrapperPropTypes 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 *** */
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable react/jsx-no-bind */
2
2
  /* eslint-disable max-len */
3
3
  import React from 'react';
4
- import { ActionIcon, MessageActions } from '..';
4
+ import { ActionIcon, MessageActionsWrapper } from '../..';
5
5
  import ReplyIcon from '@zohodesk/icon/es/general/Reply';
6
6
  import CopyIcon from '@zohodesk/icon/es/general/Copy';
7
7
  import DownloadIcon from '@zohodesk/icon/es/general/Cloud';
@@ -40,7 +40,7 @@ function DefaultActions(props) {
40
40
  renderIcon: () => /*#__PURE__*/React.createElement(DownloadIcon, null)
41
41
  });
42
42
  }
43
- return /*#__PURE__*/React.createElement(MessageActions, {
43
+ return /*#__PURE__*/React.createElement(MessageActionsWrapper, {
44
44
  actions: [{
45
45
  id: 'Reply',
46
46
  renderFunction: renderReply
@@ -53,8 +53,8 @@ function DefaultActions(props) {
53
53
  }, ...customActions]
54
54
  // actions={actions}
55
55
  ,
56
- renderMoreIcon: renderMoreIcon,
57
- moreCount: moreCount
56
+ moreCount: moreCount,
57
+ renderMoreIcon: renderMoreIcon
58
58
  });
59
59
  }
60
60
  export default DefaultActions;
@@ -3,17 +3,17 @@
3
3
  import React from 'react';
4
4
 
5
5
  /** ** Components *** */
6
- import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
7
- import MessageBubble from '../MessageBubble/MessageBubble';
8
- import MessageBox from '../MessageBox/MessageBox';
9
- import MessageActions from '../MessageActions/MessageActions';
6
+ import MessageBubble from '../../MessageBubble/MessageBubble';
7
+ import MessageBox from '../../MessageBox/MessageBox';
8
+ import MessageActionsWrapper from '../../MessageActionsWrapper/MessageActionsWrapper';
10
9
 
11
10
  /** ** Constants *** */
12
11
  import textMessageDefaultProps from './props/defaultProps';
13
12
  import textMessagePropTypes from './props/propTypes';
14
13
 
15
14
  /** ** Styles *** */
16
- import style from './css/TextMessage.module.css';
15
+ // import style from './css/TextMessage.module.css';
16
+
17
17
  export default function TextMessage(props) {
18
18
  const {
19
19
  direction,
@@ -23,8 +23,8 @@ export default function TextMessage(props) {
23
23
  renderMessageHeader,
24
24
  renderMessageFooter,
25
25
  renderMessageBoxFooter,
26
- needAvatar,
27
- avatarProps,
26
+ // needAvatar,
27
+ // avatarProps,
28
28
  messageActions,
29
29
  renderMoreIcon,
30
30
  actionsCount,
@@ -33,8 +33,8 @@ export default function TextMessage(props) {
33
33
  function renderMessageBox() {
34
34
  return /*#__PURE__*/React.createElement(MessageBox, {
35
35
  renderMessage: renderMessage,
36
- renderMessageHeader: renderMessageHeader,
37
36
  renderMessageFooter: renderMessageFooter,
37
+ renderMessageHeader: renderMessageHeader,
38
38
  renderMessageStatus: renderStatus
39
39
  });
40
40
  }
@@ -43,22 +43,22 @@ export default function TextMessage(props) {
43
43
  }
44
44
 
45
45
  function renderMessageActions() {
46
- return /*#__PURE__*/React.createElement(MessageActions, {
46
+ return /*#__PURE__*/React.createElement(MessageActionsWrapper, {
47
47
  actions: messageActions,
48
- renderMoreIcon: renderMoreIcon,
49
- moreCount: actionsCount
48
+ moreCount: actionsCount,
49
+ renderMoreIcon: renderMoreIcon
50
50
  });
51
51
  }
52
52
  return /*#__PURE__*/React.createElement(MessageBubble, {
53
53
  direction: direction,
54
54
  isActive: isActive,
55
55
  needMessageActions: needMessageActions,
56
- renderMessageBox: renderMessageBox
56
+ renderMessageActions: renderMessageActions
57
57
  // renderMessageBoxHeader={() => null}
58
58
  ,
59
+ renderMessageBox: renderMessageBox,
59
60
  renderMessageBoxFooter: renderMessageBoxFooter,
60
- renderMessageOwner: renderMessageOwner,
61
- renderMessageActions: renderMessageActions
61
+ renderMessageOwner: renderMessageOwner
62
62
  });
63
63
  }
64
64
  TextMessage.displayName = 'TextMessage';