@zohoim/chat-components 0.0.14 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/es/ActionIcon/ActionIcon.js +2 -0
  2. package/es/ActionIconWrapper/ActionIconWrapper.js +15 -3
  3. package/es/ActionIconWrapper/css/ActionIconWrapper.module.css +5 -0
  4. package/es/ActionIconWrapper/css/cssJSLogic.js +14 -0
  5. package/es/ActionIconWrapper/props/propTypes.js +1 -0
  6. package/es/AttachmentBubble/AttachmentBubble.js +26 -9
  7. package/es/AttachmentBubble/css/AttachmentBubble.module.css +16 -1
  8. package/es/AttachmentBubble/css/cssJSLogic.js +15 -0
  9. package/es/AttachmentBubble/props/propTypes.js +2 -1
  10. package/es/AttachmentBubbleInfo/AttachmentBubbleInfo.js +20 -5
  11. package/es/AttachmentBubbleInfo/css/AttachmentBubbleInfo.module.css +11 -3
  12. package/es/AttachmentBubbleInfo/css/cssJSLogic.js +13 -0
  13. package/es/AttachmentBubbleInfo/props/propTypes.js +2 -1
  14. package/es/AttachmentIcon/AttachmentIcon.js +3 -1
  15. package/es/AttachmentIcon/css/AttachmentIcon.module.css +2 -2
  16. package/es/AttachmentIcon/props/propTypes.js +6 -0
  17. package/es/AttachmentIcon/utils/getAttachmentIconComponent.js +12 -5
  18. package/es/AudioBubble/AudioBubble.js +21 -5
  19. package/es/AudioBubble/css/AudioBubble.module.css +4 -0
  20. package/es/AudioBubble/props/defaultProps.js +1 -0
  21. package/es/AudioBubble/props/propTypes.js +2 -1
  22. package/es/ImageBubble/ImageBubble.js +13 -2
  23. package/es/ImageBubble/css/ImageBubble.module.css +8 -2
  24. package/es/ImageBubble/css/cssJSLogic.js +13 -0
  25. package/es/ImageBubble/props/propTypes.js +2 -1
  26. package/es/LocationBubble/LocationBubble.js +15 -3
  27. package/es/LocationBubble/css/LocationBubble.module.css +17 -5
  28. package/es/LocationBubble/css/cssJSLogic.js +13 -0
  29. package/es/LocationBubble/props/propTypes.js +2 -1
  30. package/es/MediaBubbleWrapper/MediaBubbleWrapper.js +7 -4
  31. package/es/MediaBubbleWrapper/css/MediaBubbleWrapper.module.css +4 -0
  32. package/es/MediaBubbleWrapper/props/propTypes.js +2 -1
  33. package/es/Message/Message.js +4 -2
  34. package/es/MessageAction/MessageAction.js +3 -0
  35. package/es/MessageAction/props/propTypes.js +1 -0
  36. package/es/MessageActions/MessageActions.js +18 -4
  37. package/es/MessageActions/props/propTypes.js +1 -0
  38. package/es/MessageBox/MessageBox.js +10 -6
  39. package/es/MessageBox/css/MessageBox.module.css +1 -6
  40. package/es/MessageBubble/MessageBubble.js +21 -13
  41. package/es/MessageStatus/css/MessageStatus.module.css +0 -3
  42. package/es/MoreActionItem/MoreActionItem.js +8 -0
  43. package/es/MoreActionItem/css/MoreActionItem.module.css +1 -3
  44. package/es/MoreActionItem/props/propTypes.js +1 -0
  45. package/es/ReplyBubble/ReplyBubble.js +32 -14
  46. package/es/ReplyBubble/css/ReplyBubble.module.css +3 -3
  47. package/es/ReplyBubble/props/propTypes.js +8 -2
  48. package/es/ReplyBubbleContent/ReplyBubbleContent.js +15 -5
  49. package/es/ReplyBubbleContent/css/ReplyBubbleContent.module.css +22 -7
  50. package/es/ReplyBubbleContent/css/cssJSLogic.js +13 -0
  51. package/es/ReplyBubbleContent/props/propTypes.js +2 -1
  52. package/es/ReplyBubbleHeader/ReplyBubbleHeader.js +24 -9
  53. package/es/ReplyBubbleHeader/css/ReplyBubbleHeader.module.css +37 -6
  54. package/es/ReplyBubbleHeader/css/cssJSLogic.js +12 -0
  55. package/es/ReplyBubbleHeader/props/defaultProps.js +2 -1
  56. package/es/ReplyBubbleHeader/props/propTypes.js +6 -2
  57. package/es/TextBubble/TextBubble.js +17 -5
  58. package/es/TextBubble/css/TextBubble.module.css +16 -1
  59. package/es/TextBubble/css/cssJSLogic.js +18 -0
  60. package/es/TextBubble/props/propTypes.js +2 -1
  61. package/es/Theme/ThemeWrapper.js +2 -2
  62. package/es/Theme/themeVariables/commonThemeColorVariable.js +1 -2
  63. package/es/Theme/themeVariables/dark/blueTheme.js +97 -40
  64. package/es/Theme/themeVariables/dark/commonColorVariable.js +7 -1
  65. package/es/Theme/themeVariables/dark/greenTheme.js +95 -38
  66. package/es/Theme/themeVariables/dark/orangeTheme.js +94 -37
  67. package/es/Theme/themeVariables/dark/redTheme.js +94 -46
  68. package/es/Theme/themeVariables/dark/yellowTheme.js +94 -37
  69. package/es/Theme/themeVariables/light/blueTheme.js +96 -35
  70. package/es/Theme/themeVariables/light/commonColorVariable.js +8 -1
  71. package/es/Theme/themeVariables/light/greenTheme.js +96 -35
  72. package/es/Theme/themeVariables/light/orangeTheme.js +97 -34
  73. package/es/Theme/themeVariables/light/redTheme.js +97 -34
  74. package/es/Theme/themeVariables/light/yellowTheme.js +96 -35
  75. package/es/Theme/themeVariables/pureDark/blueTheme.js +93 -37
  76. package/es/Theme/themeVariables/pureDark/commonColorVariable.js +7 -1
  77. package/es/Theme/themeVariables/pureDark/greenTheme.js +94 -37
  78. package/es/Theme/themeVariables/pureDark/orangeTheme.js +94 -37
  79. package/es/Theme/themeVariables/pureDark/redTheme.js +94 -37
  80. package/es/Theme/themeVariables/pureDark/yellowTheme.js +94 -37
  81. package/es/VideoBubble/VideoBubble.js +7 -3
  82. package/es/VideoBubble/props/propTypes.js +2 -1
  83. package/es/css/common.module.css +6 -0
  84. package/es/icons/factory/common/article.svg +4 -4
  85. package/es/icons/factory/integrations/chInstagram.svg +2 -2
  86. package/es/icons/factory/integrations/chWhatsApp.svg +2 -2
  87. package/es/icons/factory/integrations/ttASAP.svg +6 -1
  88. package/es/icons/factory/integrations/ttLine.svg +8 -0
  89. package/es/icons/factory/integrations/ttTelegram.svg +4 -1
  90. package/es/icons/factory/integrations/ttTwillio.svg +8 -1
  91. package/es/icons/factory/integrations/ttWechat.svg +9 -1
  92. package/es/icons/iconSrc/attachments/Text.js +47 -0
  93. package/es/icons/iconSrc/attachments/index.js +1 -1
  94. package/es/icons/iconSrc/common/Article.js +2 -3
  95. package/es/icons/iconSrc/integrations/ChInstagram.js +2 -3
  96. package/es/icons/iconSrc/integrations/ChWhatsApp.js +2 -3
  97. package/es/icons/iconSrc/integrations/TtASAP.js +11 -15
  98. package/es/icons/iconSrc/integrations/{TtTwitter.js → TtLine.js} +14 -18
  99. package/es/icons/iconSrc/integrations/TtTelegram.js +8 -12
  100. package/es/icons/iconSrc/integrations/TtTwillio.js +15 -19
  101. package/es/icons/iconSrc/integrations/TtWechat.js +19 -20
  102. package/es/icons/iconSrc/integrations/index.js +1 -1
  103. package/es/im/ArticleBubble/ArticleBubble.js +22 -8
  104. package/es/im/ArticleBubble/css/ArticleBubble.module.css +40 -15
  105. package/es/im/ArticleBubble/css/cssJSLogic.js +12 -0
  106. package/es/im/ArticleBubble/props/propTypes.js +2 -1
  107. package/es/im/IMAutoMessageInfo/css/IMAutoMessageInfo.module.css +1 -0
  108. package/es/im/IMIntegrationIcon/IMIntegrationIcon.js +1 -1
  109. package/es/im/IMIntegrationIcon/css/IMIntegrationIcon.module.css +1 -6
  110. package/es/im/IMMessage/IMMessage.js +57 -11
  111. package/es/im/{IMTicketLink/css/IMTicketLink.module.css → IMMessage/css/IMMessage.module.css} +21 -11
  112. package/es/im/IMMessage/css/cssJSLogic.js +23 -0
  113. package/es/im/IMMessage/props/defaultProps.js +2 -1
  114. package/es/im/IMMessage/props/propTypes.js +28 -2
  115. package/es/im/IMMessageContent/IMMessageContent.js +41 -42
  116. package/es/im/IMMessageContent/css/IMMessageContent.module.css +6 -2
  117. package/es/im/IMMessageContent/props/propTypes.js +8 -2
  118. package/es/im/IMMessageMeta/IMMessageMeta.js +8 -8
  119. package/es/im/IMMessageMeta/css/IMMessageMeta.module.css +2 -4
  120. package/es/im/IMMessageMeta/props/defaultProps.js +1 -1
  121. package/es/im/IMPermaLink/IMPermaLink.js +48 -0
  122. package/es/im/IMPermaLink/css/IMPermaLink.module.css +14 -0
  123. package/es/im/{IMTicketLink → IMPermaLink}/css/cssJSLogic.js +3 -3
  124. package/es/im/IMPermaLink/index.js +1 -0
  125. package/es/{InfoBubble → im/IMPermaLink}/props/defaultProps.js +2 -2
  126. package/es/im/IMPermaLink/props/propTypes.js +11 -0
  127. package/es/im/IMReplyBubble/IMReplyBubble.js +10 -5
  128. package/es/im/IMReplyBubble/props/propTypes.js +7 -2
  129. package/es/im/IMTextBubble/IMTextBubble.js +5 -2
  130. package/es/im/IMTextBubble/props/propTypes.js +2 -1
  131. package/es/im/css/common.module.css +6 -0
  132. package/es/im/index.js +1 -2
  133. package/es/index.js +0 -1
  134. package/package.json +4 -21
  135. package/es/InfoBubble/InfoBubble.js +0 -34
  136. package/es/InfoBubble/css/InfoBubble.module.css +0 -0
  137. package/es/InfoBubble/css/cssJSLogic.js +0 -10
  138. package/es/InfoBubble/index.js +0 -1
  139. package/es/InfoBubble/props/propTypes.js +0 -6
  140. package/es/Theme/crm/dark/blueFanTheme.js +0 -28
  141. package/es/Theme/crm/dark/blueTheme.js +0 -28
  142. package/es/Theme/crm/dark/commonColorVariable.js +0 -11
  143. package/es/Theme/crm/dark/darkBlueTheme.js +0 -28
  144. package/es/Theme/crm/dark/darkGreyTheme.js +0 -28
  145. package/es/Theme/crm/dark/greenTheme.js +0 -28
  146. package/es/Theme/crm/dark/orangeTheme.js +0 -28
  147. package/es/Theme/crm/dark/pinkTheme.js +0 -28
  148. package/es/Theme/crm/dark/tealTheme.js +0 -28
  149. package/es/Theme/crm/dark/whiteTheme.js +0 -28
  150. package/es/Theme/crm/light/blueFanTheme.js +0 -28
  151. package/es/Theme/crm/light/blueTheme.js +0 -31
  152. package/es/Theme/crm/light/commonColorVariable.js +0 -9
  153. package/es/Theme/crm/light/darkBlueTheme.js +0 -28
  154. package/es/Theme/crm/light/darkGreyTheme.js +0 -28
  155. package/es/Theme/crm/light/greenTheme.js +0 -28
  156. package/es/Theme/crm/light/orangeTheme.js +0 -28
  157. package/es/Theme/crm/light/pinkTheme.js +0 -28
  158. package/es/Theme/crm/light/tealTheme.js +0 -28
  159. package/es/Theme/crm/light/whiteTheme.js +0 -28
  160. package/es/Theme/crm/pureDark/blueFanTheme.js +0 -28
  161. package/es/Theme/crm/pureDark/blueTheme.js +0 -28
  162. package/es/Theme/crm/pureDark/commonColorVariable.js +0 -9
  163. package/es/Theme/crm/pureDark/darkBlueTheme.js +0 -28
  164. package/es/Theme/crm/pureDark/darkGreyTheme.js +0 -28
  165. package/es/Theme/crm/pureDark/greenTheme.js +0 -28
  166. package/es/Theme/crm/pureDark/orangeTheme.js +0 -28
  167. package/es/Theme/crm/pureDark/pinkTheme.js +0 -28
  168. package/es/Theme/crm/pureDark/tealTheme.js +0 -28
  169. package/es/Theme/crm/pureDark/whiteTheme.js +0 -28
  170. package/es/icons/factory/integrations/ttTwitter.svg +0 -1
  171. package/es/im/IMInfoBubble/IMInfoBubble.js +0 -34
  172. package/es/im/IMInfoBubble/css/IMInfoBubble.module.css +0 -0
  173. package/es/im/IMInfoBubble/css/cssJSLogic.js +0 -10
  174. package/es/im/IMInfoBubble/index.js +0 -1
  175. package/es/im/IMInfoBubble/props/defaultProps.js +0 -6
  176. package/es/im/IMInfoBubble/props/propTypes.js +0 -6
  177. package/es/im/IMTicketLink/IMTicketLink.js +0 -48
  178. package/es/im/IMTicketLink/index.js +0 -1
  179. package/es/im/IMTicketLink/props/defaultProps.js +0 -6
  180. package/es/im/IMTicketLink/props/propTypes.js +0 -11
  181. /package/es/icons/factory/attachments/{txt.svg → text.svg} +0 -0
@@ -4,6 +4,13 @@ import PropTypes from 'prop-types';
4
4
 
5
5
  import { defaultMessageActions } from '@zohoim/chat-components-utils/es/constants/messageActionConstants';
6
6
  import messageStatusConstants from '@zohoim/chat-components-utils/es/constants/messageStatusConstants';
7
+ import autoMessageTypes from '@zohoim/chat-components-utils/es/imUtils/constants/autoMessageTypes';
8
+ const {
9
+ WELCOMEMSG,
10
+ WORKFLOW_MESSAGE,
11
+ WORKFLOW_NOTIFICATION,
12
+ UN_SUPPORTED_FILE
13
+ } = autoMessageTypes;
7
14
  const {
8
15
  SENT,
9
16
  SAVED,
@@ -26,7 +33,10 @@ const imMessagePropTypes = {
26
33
  }),
27
34
  attachment: PropTypes.string,
28
35
  contentType: PropTypes.string,
29
- createdTime: PropTypes.string,
36
+ dateTimeDetails: PropTypes.shape({
37
+ displayDateTime: PropTypes.string,
38
+ tooltip: PropTypes.string
39
+ }),
30
40
  direction: PropTypes.string,
31
41
  id: PropTypes.string,
32
42
  isCustomMessage: PropTypes.bool,
@@ -65,6 +75,18 @@ const imMessagePropTypes = {
65
75
  [SENT]: PropTypes.string,
66
76
  [UNSENT]: PropTypes.string
67
77
  }),
78
+ autoMessagesI18N: PropTypes.shape({
79
+ [UN_SUPPORTED_FILE]: PropTypes.string,
80
+ [WELCOMEMSG]: PropTypes.string,
81
+ [WORKFLOW_MESSAGE]: PropTypes.string,
82
+ [WORKFLOW_NOTIFICATION]: PropTypes.string
83
+ }),
84
+ autoMessagesTitleI18N: PropTypes.shape({
85
+ [UN_SUPPORTED_FILE]: PropTypes.string,
86
+ [WELCOMEMSG]: PropTypes.string,
87
+ [WORKFLOW_MESSAGE]: PropTypes.string,
88
+ [WORKFLOW_NOTIFICATION]: PropTypes.string
89
+ }),
68
90
  actions: PropTypes.arrayOf(PropTypes.shape({
69
91
  displayText: PropTypes.string.isRequired,
70
92
  id: PropTypes.oneOfType([PropTypes.string, PropTypes.oneOf(Object.values(defaultMessageActions))]).isRequired,
@@ -73,15 +95,19 @@ const imMessagePropTypes = {
73
95
  renderFunction: PropTypes.func
74
96
  })),
75
97
  onSelectAction: PropTypes.func,
98
+ onMouseEnterAction: PropTypes.func,
76
99
  replyText: PropTypes.string,
77
100
  seeMoreText: PropTypes.string,
101
+ deleteMessageText: PropTypes.string,
78
102
  onLoadFullMessage: PropTypes.func,
79
103
  onClickReply: PropTypes.func,
80
104
  onTicketClick: PropTypes.func,
105
+ onMessageContentClick: PropTypes.func,
106
+ customStyle: PropTypes.object,
81
107
  customProps: PropTypes.shape({
82
108
  imIntegrationIconProps: PropTypes.object,
83
109
  imMessageContentProps: PropTypes.object,
84
- imTicketLinkProps: PropTypes.object,
110
+ imPermaLinkProps: PropTypes.object,
85
111
  messageProps: PropTypes.object
86
112
  })
87
113
  };
@@ -3,19 +3,16 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
3
3
  /* eslint-disable react/jsx-indent */
4
4
 
5
5
  /** ** Libraries *** */
6
- import React, { useMemo } from 'react';
6
+ import React, { Fragment } from 'react';
7
7
  /** ** Hooks *** */
8
8
 
9
9
  import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
10
+ import useIMMessageContent from '@zohoim/chat-components-hooks/es/im/IMMessageContent/useIMMessageContent';
10
11
  /** ** Constants *** */
11
12
 
12
13
  import imMessageContentDefaultProps from './props/defaultProps';
13
14
  import imMessageContentPropTypes from './props/propTypes';
14
15
  import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
15
- /** ** Methods *** */
16
-
17
- import getIsShowBubble from '@zohoim/chat-components-utils/es/imUtils/getIsShowBubble';
18
- import getMessageBubbleDetails from '@zohoim/chat-components-utils/es/imUtils/getMessageBubbleDetails';
19
16
  /** ** Styles *** */
20
17
 
21
18
  import style from './css/IMMessageContent.module.css';
@@ -36,9 +33,12 @@ export default function IMMessageContent(props) {
36
33
  onClickReply,
37
34
  seeMoreText,
38
35
  replyText,
36
+ deleteMessageText,
39
37
  customStyle,
40
38
  customProps,
41
- renderCustomMessage
39
+ renderCustomMessage,
40
+ onClick: propOnClick,
41
+ isFailed
42
42
  } = props;
43
43
  const {
44
44
  imReplyBubbleProps = dummyObject,
@@ -58,51 +58,50 @@ export default function IMMessageContent(props) {
58
58
  isShowAttachmentBubble,
59
59
  isShowLocationBubble,
60
60
  isShowTextBubble,
61
- isShowCustomBubble
62
- } = useMemo(() => getIsShowBubble({
63
- messageDetails
64
- }), [messageDetails]);
61
+ isShowCustomBubble,
62
+ isShowDeleteBubble,
63
+ replyToMessageDetails: replyToMessage,
64
+ attachmentDetails,
65
+ locationUrl,
66
+ onClick
67
+ } = useIMMessageContent({
68
+ messageDetails,
69
+ onClick: propOnClick
70
+ });
65
71
  /* External CSS Customization */
66
72
 
67
73
  const newStyle = useMergeStyle(style, customStyle);
68
- const {
69
- replyToMessageDetails: replyToMessage,
70
- attachmentDetails,
71
- locationUrl
72
- } = useMemo(() => getMessageBubbleDetails({
73
- messageDetails
74
- }), [messageDetails]);
75
- return /*#__PURE__*/React.createElement("div", null, isShowLayoutBubble ? null : null, isShowReplyBubble ? /*#__PURE__*/React.createElement("div", {
76
- className: newStyle.messageContentRow
77
- }, /*#__PURE__*/React.createElement(IMReplyBubble, _extends({
74
+ const wrapperDivProps = {
75
+ className: newStyle.messageContentRow,
76
+ onClick
77
+ };
78
+ return /*#__PURE__*/React.createElement(Fragment, null, isShowLayoutBubble ? null : null, isShowDeleteBubble ? /*#__PURE__*/React.createElement("div", {
79
+ className: newStyle.deleteBubble
80
+ }, deleteMessageText) : null, isShowReplyBubble ? /*#__PURE__*/React.createElement("div", wrapperDivProps, /*#__PURE__*/React.createElement(IMReplyBubble, _extends({
81
+ isFailed: isFailed,
78
82
  messageDetails: replyToMessage,
79
83
  onClick: onClickReply,
80
84
  replyText: replyText
81
85
  }, imReplyBubbleProps))) : null, isShowCustomBubble ? renderCustomMessage({
82
- messageDetails
83
- }) : null, isShowImageBubble ? /*#__PURE__*/React.createElement("div", {
84
- className: newStyle.messageContentRow
85
- }, /*#__PURE__*/React.createElement(ImageBubble, _extends({
86
- imageDetails: attachmentDetails
87
- }, imageBubbleProps))) : null, isShowVideoBubble ? /*#__PURE__*/React.createElement("div", {
88
- className: newStyle.messageContentRow
89
- }, /*#__PURE__*/React.createElement(VideoBubble, _extends({
86
+ messageDetails,
87
+ isFailed
88
+ }) : null, isShowImageBubble ? /*#__PURE__*/React.createElement("div", wrapperDivProps, /*#__PURE__*/React.createElement(ImageBubble, _extends({
89
+ imageDetails: attachmentDetails,
90
+ isFailed: isFailed
91
+ }, imageBubbleProps))) : null, isShowVideoBubble ? /*#__PURE__*/React.createElement("div", wrapperDivProps, /*#__PURE__*/React.createElement(VideoBubble, _extends({
92
+ isFailed: isFailed,
90
93
  videoDetails: attachmentDetails
91
- }, videoBubbleProps))) : null, isShowAudioBubble ? /*#__PURE__*/React.createElement("div", {
92
- className: newStyle.messageContentRow
93
- }, /*#__PURE__*/React.createElement(AudioBubble, _extends({
94
- audioDetails: attachmentDetails
95
- }, audioBubbleProps))) : null, isShowAttachmentBubble ? /*#__PURE__*/React.createElement("div", {
96
- className: newStyle.messageContentRow
97
- }, /*#__PURE__*/React.createElement(AttachmentBubble, _extends({
98
- attachmentDetails: attachmentDetails
99
- }, attachmentBubbleProps))) : null, isShowLocationBubble ? /*#__PURE__*/React.createElement("div", {
100
- className: newStyle.messageContentRow
101
- }, /*#__PURE__*/React.createElement(LocationBubble, _extends({
94
+ }, videoBubbleProps))) : null, isShowAudioBubble ? /*#__PURE__*/React.createElement("div", wrapperDivProps, /*#__PURE__*/React.createElement(AudioBubble, _extends({
95
+ audioDetails: attachmentDetails,
96
+ isFailed: isFailed
97
+ }, audioBubbleProps))) : null, isShowAttachmentBubble ? /*#__PURE__*/React.createElement("div", wrapperDivProps, /*#__PURE__*/React.createElement(AttachmentBubble, _extends({
98
+ attachmentDetails: attachmentDetails,
99
+ isFailed: isFailed
100
+ }, attachmentBubbleProps))) : null, isShowLocationBubble ? /*#__PURE__*/React.createElement("div", wrapperDivProps, /*#__PURE__*/React.createElement(LocationBubble, _extends({
101
+ isFailed: isFailed,
102
102
  locationUrl: locationUrl
103
- }, locationBubbleProps))) : null, isShowTextBubble ? /*#__PURE__*/React.createElement("div", {
104
- className: newStyle.messageContentRow
105
- }, /*#__PURE__*/React.createElement(IMTextBubble, _extends({
103
+ }, locationBubbleProps))) : null, isShowTextBubble ? /*#__PURE__*/React.createElement("div", wrapperDivProps, /*#__PURE__*/React.createElement(IMTextBubble, _extends({
104
+ isFailed: isFailed,
106
105
  messageDetails: messageDetails,
107
106
  moreText: seeMoreText,
108
107
  onLoadFullMessage: onLoadFullMessage,
@@ -1,3 +1,7 @@
1
- .messageContentRow + .messageContentRow{
1
+ .messageContentRow + .messageContentRow {
2
2
  margin-top: var(--zd_size5) ;
3
- }
3
+ }
4
+
5
+ .deleteBubble {
6
+ font-style: italic;
7
+ }
@@ -5,7 +5,10 @@ const imMessageContentPropTypes = {
5
5
  displayMessage: PropTypes.string.isRequired,
6
6
  attachment: PropTypes.string,
7
7
  contentType: PropTypes.string,
8
- createdTime: PropTypes.string,
8
+ dateTimeDetails: PropTypes.shape({
9
+ displayDateTime: PropTypes.string,
10
+ tooltip: PropTypes.string
11
+ }),
9
12
  direction: PropTypes.string,
10
13
  fullMessage: PropTypes.string,
11
14
  id: PropTypes.string,
@@ -23,9 +26,11 @@ const imMessageContentPropTypes = {
23
26
  sessionDetails: PropTypes.shape({
24
27
  id: PropTypes.string
25
28
  }),
29
+ onClick: PropTypes.func,
26
30
  onLoadFullMessage: PropTypes.func,
27
31
  onClickReply: PropTypes.func,
28
32
  seeMoreText: PropTypes.string,
33
+ deleteMessageText: PropTypes.string,
29
34
  replyText: PropTypes.string,
30
35
  renderCustomMessage: PropTypes.func,
31
36
  customStyle: PropTypes.object,
@@ -37,6 +42,7 @@ const imMessageContentPropTypes = {
37
42
  imageBubbleProps: PropTypes.object,
38
43
  locationBubbleProps: PropTypes.object,
39
44
  videoBubbleProps: PropTypes.object
40
- })
45
+ }),
46
+ isFailed: PropTypes.bool
41
47
  };
42
48
  export default imMessageContentPropTypes;
@@ -45,19 +45,19 @@ export default function IMMessageMeta(props) {
45
45
  } = cssJSLogic({
46
46
  direction
47
47
  }, newStyle);
48
- return /*#__PURE__*/React.createElement(Container, {
48
+ return /*#__PURE__*/React.createElement(React.Fragment, null, autoMessageType || time ? /*#__PURE__*/React.createElement(Container, {
49
49
  alignBox: "row",
50
50
  className: imMessageMetaClass
51
- }, /*#__PURE__*/React.createElement("div", {
52
- className: newStyle.dateTime,
53
- "data-title": timeTooltip
54
- }, time), autoMessageType ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
55
- className: dotClass
56
- }, "\u22C5"), /*#__PURE__*/React.createElement(IMAutoMessageInfo, _extends({
51
+ }, autoMessageType ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IMAutoMessageInfo, _extends({
57
52
  autoMessagesI18N: autoMessagesI18N,
58
53
  autoMessagesTitleI18N: autoMessagesTitleI18N,
59
54
  autoMessageType: autoMessageType
60
- }, imAutoMessageInfoProps))) : null);
55
+ }, imAutoMessageInfoProps))) : null, time ? /*#__PURE__*/React.createElement(React.Fragment, null, autoMessageType ? /*#__PURE__*/React.createElement("div", {
56
+ className: dotClass
57
+ }, "\u22C5") : null, /*#__PURE__*/React.createElement("div", {
58
+ className: newStyle.dateTime,
59
+ "data-title": timeTooltip
60
+ }, time)) : null) : null);
61
61
  }
62
62
  IMMessageMeta.propTypes = imMessageMetaPropTypes;
63
63
  IMMessageMeta.defaultProps = imMessageMetaDefaultProps;
@@ -36,8 +36,6 @@
36
36
  /* max-width: 100px; */
37
37
  /* display: flex; */
38
38
  max-width: var(--zd_size100) ;
39
- white-space: nowrap;
40
- overflow: hidden;
41
- text-overflow: ellipsis;
42
- color: var(--imlib_chat_components_imMessageMeta_timeColor);
39
+ composes: dotted from "../../css/common.module.css";
40
+ color: var(--imlib_chat_components_imMessageMeta_time_color);
43
41
  }
@@ -3,8 +3,8 @@ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyCon
3
3
  import { direction as directionConstants } from '@zohoim/chat-components-utils/es/constants/messageConstants';
4
4
  const imMessageMetaDefaultProps = {
5
5
  customStyle: dummyObject,
6
+ customProps: dummyObject,
6
7
  autoMessageCustomStyle: dummyObject,
7
- timeCustomStyle: dummyObject,
8
8
  direction: directionConstants.IN
9
9
  };
10
10
  export default imMessageMetaDefaultProps;
@@ -0,0 +1,48 @@
1
+ /* eslint-disable @zohodesk/zsecurity/no-protocol-check */
2
+
3
+ /** ** Libraries *** */
4
+ import React from 'react';
5
+ /** ** Hooks *** */
6
+
7
+ import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
8
+ import useIMPermaLink from '@zohoim/chat-components-hooks/es/im/IMPermaLink/useIMPermaLink';
9
+ /** ** Constants *** */
10
+
11
+ import imPermaLinkDefaultProps from './props/defaultProps';
12
+ import imPermaLinkPropTypes from './props/propTypes';
13
+ /** ** Methods *** */
14
+
15
+ import cssJSLogic from './css/cssJSLogic';
16
+ /** ** Styles *** */
17
+
18
+ import style from './css/IMPermaLink.module.css';
19
+ export default function IMPermaLink(props) {
20
+ const {
21
+ customStyle,
22
+ isDisabled
23
+ } = props;
24
+ const {
25
+ href,
26
+ onClick,
27
+ text
28
+ } = useIMPermaLink(props);
29
+ /* External CSS Customization */
30
+
31
+ const newStyle = useMergeStyle(style, customStyle);
32
+ /* CSS classnames added based on logic */
33
+
34
+ const {
35
+ imPermaLinkClass
36
+ } = cssJSLogic({
37
+ isDisabled
38
+ }, newStyle);
39
+ return text ? /*#__PURE__*/React.createElement("a", {
40
+ className: imPermaLinkClass,
41
+ href: href,
42
+ onClick: onClick,
43
+ rel: "noopener noreferrer"
44
+ }, text) : null;
45
+ }
46
+ IMPermaLink.propTypes = imPermaLinkPropTypes;
47
+ IMPermaLink.defaultProps = imPermaLinkDefaultProps;
48
+ IMPermaLink.displayName = 'IMPermaLink';
@@ -0,0 +1,14 @@
1
+ .text {
2
+ color: var(--imlib_chat_components_imPermaLink_url_color);
3
+ display: block;
4
+ composes: dotted from '../../css/common.module.css';
5
+ cursor: pointer;
6
+ }
7
+
8
+ .disabled {
9
+ pointer-events: none;
10
+ }
11
+
12
+ a.text:hover {
13
+ text-decoration: underline;
14
+ }
@@ -4,11 +4,11 @@ export default function cssJSLogic(props, style) {
4
4
  const {
5
5
  isDisabled
6
6
  } = props;
7
- const imTicketLinkClass = compileClassNames({
8
- [style.ticketNumber]: true,
7
+ const imPermaLinkClass = compileClassNames({
8
+ [style.text]: true,
9
9
  [style.disabled]: isDisabled === true
10
10
  });
11
11
  return {
12
- imTicketLinkClass
12
+ imPermaLinkClass
13
13
  };
14
14
  }
@@ -0,0 +1 @@
1
+ export { default as IMPermaLink } from './IMPermaLink';
@@ -1,6 +1,6 @@
1
1
  /** ** Constants *** */
2
2
  import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
3
- const infoBubbleDefaultProps = {
3
+ const imPermaLinkDefaultProps = {
4
4
  customStyle: dummyObject
5
5
  };
6
- export default infoBubbleDefaultProps;
6
+ export default imPermaLinkDefaultProps;
@@ -0,0 +1,11 @@
1
+ /** ** Libraries *** */
2
+ import PropTypes from 'prop-types';
3
+ const imPermaLinkPropTypes = {
4
+ text: PropTypes.string.isRequired,
5
+ customStyle: PropTypes.object,
6
+ isDisabled: PropTypes.bool,
7
+ onClick: PropTypes.func,
8
+ id: PropTypes.string,
9
+ href: PropTypes.string
10
+ };
11
+ export default imPermaLinkPropTypes;
@@ -18,7 +18,8 @@ export default function IMReplyBubble(props) {
18
18
  replyText,
19
19
  messageDetails,
20
20
  customProps,
21
- onClick: propOnClick
21
+ onClick: propOnClick,
22
+ isFailed
22
23
  } = props;
23
24
  const {
24
25
  replyBubbleProps = dummyObject
@@ -26,8 +27,9 @@ export default function IMReplyBubble(props) {
26
27
  const {
27
28
  message,
28
29
  senderName,
29
- time,
30
+ dateTimeDetails,
30
31
  attachmentDetails,
32
+ locationUrl,
31
33
  onClick
32
34
  } = useIMReplyBubble({
33
35
  messageDetails,
@@ -35,12 +37,15 @@ export default function IMReplyBubble(props) {
35
37
  });
36
38
  return /*#__PURE__*/React.createElement(ReplyBubble, _extends({
37
39
  attachmentDetails: attachmentDetails,
40
+ dateTimeDetails: dateTimeDetails,
41
+ locationUrl: locationUrl,
38
42
  message: message,
39
43
  onClick: onClick,
40
44
  replyText: replyText,
41
- senderName: senderName,
42
- time: time
43
- }, replyBubbleProps));
45
+ senderName: senderName
46
+ }, replyBubbleProps, {
47
+ isFailed: isFailed
48
+ }));
44
49
  }
45
50
  IMReplyBubble.propTypes = imReplyBubblePropTypes;
46
51
  IMReplyBubble.defaultProps = imReplyBubbleDefaultProps;
@@ -13,12 +13,17 @@ const imReplyBubblePropTypes = {
13
13
  type: PropTypes.string,
14
14
  url: PropTypes.string
15
15
  }),
16
- createdTime: PropTypes.string
16
+ dateTimeDetails: PropTypes.shape({
17
+ displayDateTime: PropTypes.string,
18
+ tooltip: PropTypes.string
19
+ }),
20
+ locationUrl: PropTypes.string
17
21
  }).isRequired,
18
22
  onClick: PropTypes.func.isRequired,
19
23
  replyText: PropTypes.string.isRequired,
20
24
  customProps: PropTypes.shape({
21
25
  replyBubbleProps: PropTypes.object
22
- })
26
+ }),
27
+ isFailed: PropTypes.bool
23
28
  };
24
29
  export default imReplyBubblePropTypes;
@@ -16,7 +16,8 @@ import useIMTextBubble from '@zohoim/chat-components-hooks/es/im/IMTextBubble/us
16
16
  export default function IMTextBubble(props) {
17
17
  const {
18
18
  moreText,
19
- customProps
19
+ customProps,
20
+ isFailed
20
21
  } = props;
21
22
  const {
22
23
  textBubbleProps = dummyObject
@@ -30,7 +31,9 @@ export default function IMTextBubble(props) {
30
31
  message: sanitizedDisplayMessage,
31
32
  moreText: isShowSeeMore ? moreText : '',
32
33
  onClickMore: onLoadFullMessage
33
- }, textBubbleProps));
34
+ }, textBubbleProps, {
35
+ isFailed: isFailed
36
+ }));
34
37
  }
35
38
  IMTextBubble.propTypes = imTextBubblePropTypes;
36
39
  IMTextBubble.defaultProps = imTextBubbleDefaultProps;
@@ -24,6 +24,7 @@ const imTextBubblePropTypes = {
24
24
  onLoadFullMessage: PropTypes.func,
25
25
  sessionDetails: PropTypes.shape({
26
26
  id: PropTypes.string
27
- })
27
+ }),
28
+ isFailed: PropTypes.bool
28
29
  };
29
30
  export default imTextBubblePropTypes;
@@ -0,0 +1,6 @@
1
+ .dotted {
2
+ /* overflow: hidden;
3
+ white-space: nowrap;
4
+ word-wrap: normal;
5
+ text-overflow: ellipsis; */
6
+ }
package/es/im/index.js CHANGED
@@ -1,10 +1,9 @@
1
1
  export * from './IMIntegrationIcon';
2
2
  export * from './IMMessage';
3
- export * from './IMTicketLink';
3
+ export * from './IMPermaLink';
4
4
  export * from './IMMessageMeta';
5
5
  export * from './IMAutoMessageInfo';
6
6
  export * from './IMMessageContent';
7
7
  export * from './IMTextBubble';
8
- export * from './IMInfoBubble';
9
8
  export * from './IMReplyBubble';
10
9
  export * from './ArticleBubble';
package/es/index.js CHANGED
@@ -17,7 +17,6 @@ export * from './VideoBubble';
17
17
  export * from './ImageBubble';
18
18
  export * from './TextBubble';
19
19
  export * from './LocationBubble';
20
- export * from './InfoBubble';
21
20
  export * from './AttachmentBubbleInfo';
22
21
  export * from './Audio';
23
22
  export * from './Video';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohoim/chat-components",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "Chat Components",
5
5
  "main": "es/index.js",
6
6
  "module": "es/index.js",
@@ -35,8 +35,8 @@
35
35
  "@zohodesk/utils": "1.3.9",
36
36
  "@zohodesk/variables": "1.0.0-beta.30",
37
37
  "@zohodesk/virtualizer": "1.0.13",
38
- "@zohoim/chat-components-hooks": "^0.0.12",
39
- "@zohoim/chat-components-utils": "^0.0.11"
38
+ "@zohoim/chat-components-hooks": "^0.0.14",
39
+ "@zohoim/chat-components-utils": "^0.0.13"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@zohodesk-private/css-variable-migrator": "1.0.1",
@@ -44,22 +44,5 @@
44
44
  "jsdom": "22.1.0",
45
45
  "react-to-jsx": "1.3.2"
46
46
  },
47
- "react-cli": {
48
- "css": {
49
- "plugins": {
50
- "hasRTL": true,
51
- "cssVariableReplacement": true
52
- },
53
- "patterns": {
54
- "cssVariableReplacement": [
55
- "**/src/**",
56
- "**/lib/**",
57
- "**/es/**",
58
- "!**/node_modules/**"
59
- ]
60
- },
61
- "cssVariableReplacementConfig": "../../node_modules/@zohodesk-private/css-variable-migrator/es/config/cssVariableReplacementOptions.json"
62
- }
63
- },
64
- "gitHead": "de72d83a0b40cde9b34b122654601ec5c23c8e55"
47
+ "gitHead": "1b5aa92b8b410ebbe44f5a85b6b3fca89a81805e"
65
48
  }
@@ -1,34 +0,0 @@
1
- /** ** Libraries *** */
2
- import React from 'react';
3
- /** ** Hooks *** */
4
-
5
- import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
6
- /** ** Constants *** */
7
-
8
- import infoBubbleDefaultProps from './props/defaultProps';
9
- import infoBubblePropTypes from './props/propTypes';
10
- /** ** Methods *** */
11
-
12
- import cssJSLogic from './css/cssJSLogic';
13
- /** ** Styles *** */
14
-
15
- import style from './css/InfoBubble.module.css';
16
- export default function InfoBubble(props) {
17
- const {
18
- customStyle
19
- } = props;
20
- /* External CSS Customization */
21
-
22
- const newStyle = useMergeStyle(style, customStyle);
23
- /* CSS classnames added based on logic */
24
-
25
- const {
26
- infoBubbleClass
27
- } = cssJSLogic(props, newStyle);
28
- return /*#__PURE__*/React.createElement("div", {
29
- className: infoBubbleClass
30
- }, "Working On this...");
31
- }
32
- InfoBubble.propTypes = infoBubblePropTypes;
33
- InfoBubble.defaultProps = infoBubbleDefaultProps;
34
- InfoBubble.displayName = 'InfoBubble';
File without changes
@@ -1,10 +0,0 @@
1
- /** ** Methods *** */
2
- import { compileClassNames } from '@zohodesk/utils';
3
- export default function cssJSLogic(props, style) {
4
- const infoBubbleClass = compileClassNames({
5
- [style.infoBubble]: true
6
- });
7
- return {
8
- infoBubbleClass
9
- };
10
- }
@@ -1 +0,0 @@
1
- export { default as InfoBubble } from './InfoBubble';
@@ -1,6 +0,0 @@
1
- /** ** Libraries *** */
2
- import PropTypes from 'prop-types';
3
- const infoBubblePropTypes = {
4
- customStyle: PropTypes.object
5
- };
6
- export default infoBubblePropTypes;
@@ -1,28 +0,0 @@
1
- /* eslint-disable camelcase */
2
- import { incomingBubbleBgColor, outgoingBubbleBgColor, actionIconWrapperBgColor, actionIconWrapperBorderColor, bubbleActiveBgColor, actionIconWrapperColor, messageStatusSendColor, messageStatusFailedColor, messageStatusReadColor } from './commonColorVariable';
3
- export default {
4
- library: 'chat_components',
5
- variables: {
6
- messageBubble: {
7
- active_bg_color: bubbleActiveBgColor,
8
- messageBox_footer_text_color: '#5a616f'
9
- },
10
- messageBox: {
11
- incoming_bg_color: incomingBubbleBgColor,
12
- outgoing_bg_color: outgoingBubbleBgColor,
13
- bg_color: '#f1f7fe',
14
- failed_bg_color: '#fcebeb',
15
- text_color: '#000'
16
- },
17
- actionIconWrapper: {
18
- color: actionIconWrapperColor,
19
- bg_color: actionIconWrapperBgColor,
20
- border_color: actionIconWrapperBorderColor
21
- },
22
- messageStatus: {
23
- send_color: messageStatusSendColor,
24
- read_color: messageStatusReadColor,
25
- failed_color: messageStatusFailedColor
26
- }
27
- }
28
- };