@zohoim/chat-components 0.0.18 → 0.0.20

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 (64) hide show
  1. package/es/ActionIcon/css/ActionIcon.module.css +3 -4
  2. package/es/AttachmentBubble/AttachmentBubble.js +9 -6
  3. package/es/AttachmentBubble/css/cssJSLogic.js +2 -3
  4. package/es/AttachmentBubble/props/propTypes.js +2 -1
  5. package/es/AttachmentBubbleInfo/AttachmentBubbleInfo.js +2 -1
  6. package/es/AttachmentBubbleInfo/css/AttachmentBubbleInfo.module.css +1 -0
  7. package/es/ImageBubble/ImageBubble.js +11 -5
  8. package/es/ImageBubble/css/ImageBubble.module.css +8 -1
  9. package/es/ImageBubble/css/cssJSLogic.js +4 -2
  10. package/es/ImageBubble/props/propTypes.js +3 -1
  11. package/es/LocationBubble/LocationBubble.js +13 -13
  12. package/es/LocationBubble/css/LocationBubble.module.css +11 -10
  13. package/es/Message/Message.js +3 -2
  14. package/es/Message/props/propTypes.js +1 -0
  15. package/es/MessageActions/MessageActions.js +4 -6
  16. package/es/MessageActionsMore/MessageActionsMore.js +1 -1
  17. package/es/MessageActionsWrapper/MessageActionsWrapper.js +2 -1
  18. package/es/MessageBox/css/MessageBox.module.css +0 -3
  19. package/es/MessageBubble/MessageBubble.js +14 -8
  20. package/es/MessageBubble/css/MessageBubble.module.css +33 -23
  21. package/es/MessageBubble/css/cssJSLogic.js +7 -1
  22. package/es/MessageStatus/MessageStatus.js +7 -2
  23. package/es/MessageStatus/css/MessageStatus.module.css +8 -3
  24. package/es/ReplyBubble/ReplyBubble.js +14 -5
  25. package/es/ReplyBubble/css/ReplyBubble.module.css +6 -0
  26. package/es/ReplyBubble/css/cssJSLogic.js +14 -0
  27. package/es/ReplyBubbleContent/ReplyBubbleContent.js +4 -2
  28. package/es/ReplyBubbleContent/props/propTypes.js +2 -1
  29. package/es/ReplyBubbleHeader/ReplyBubbleHeader.js +8 -2
  30. package/es/ReplyBubbleHeader/css/ReplyBubbleHeader.module.css +1 -1
  31. package/es/TextBubble/css/TextBubble.module.css +8 -6
  32. package/es/Theme/themeVariables/commonThemeColorVariable.js +4 -0
  33. package/es/Theme/themeVariables/dark/blueTheme.js +19 -8
  34. package/es/Theme/themeVariables/dark/greenTheme.js +19 -8
  35. package/es/Theme/themeVariables/dark/orangeTheme.js +19 -8
  36. package/es/Theme/themeVariables/dark/redTheme.js +19 -8
  37. package/es/Theme/themeVariables/dark/yellowTheme.js +19 -8
  38. package/es/Theme/themeVariables/light/blueTheme.js +19 -8
  39. package/es/Theme/themeVariables/light/commonColorVariable.js +6 -2
  40. package/es/Theme/themeVariables/light/greenTheme.js +19 -8
  41. package/es/Theme/themeVariables/light/orangeTheme.js +19 -8
  42. package/es/Theme/themeVariables/light/redTheme.js +19 -8
  43. package/es/Theme/themeVariables/light/yellowTheme.js +19 -8
  44. package/es/Theme/themeVariables/pureDark/blueTheme.js +19 -8
  45. package/es/Theme/themeVariables/pureDark/greenTheme.js +19 -8
  46. package/es/Theme/themeVariables/pureDark/orangeTheme.js +19 -8
  47. package/es/Theme/themeVariables/pureDark/redTheme.js +19 -8
  48. package/es/Theme/themeVariables/pureDark/yellowTheme.js +19 -8
  49. package/es/Video/css/Video.module.css +1 -0
  50. package/es/VideoBubble/VideoBubble.js +12 -2
  51. package/es/VideoBubble/css/VideoBubble.module.css +9 -1
  52. package/es/VideoBubble/css/cssJSLogic.js +14 -0
  53. package/es/im/ArticleBubble/css/ArticleBubble.module.css +2 -2
  54. package/es/im/IMIntegrationIcon/IMIntegrationIcon.js +17 -31
  55. package/es/im/IMIntegrationIcon/css/IMIntegrationIcon.module.css +10 -2
  56. package/es/im/IMMessage/IMMessage.js +24 -13
  57. package/es/im/IMMessage/css/cssJSLogic.js +4 -12
  58. package/es/im/IMMessage/props/defaultProps.js +3 -1
  59. package/es/im/IMMessage/props/propTypes.js +2 -1
  60. package/es/im/IMMessageContent/IMMessageContent.js +14 -7
  61. package/es/im/IMMessageContent/css/IMMessageContent.module.css +1 -0
  62. package/es/im/IMMessageContent/props/defaultProps.js +2 -1
  63. package/es/im/IMMessageContent/props/propTypes.js +3 -1
  64. package/package.json +5 -4
@@ -42,7 +42,7 @@ export default function IMMessage(props) {
42
42
  onLoadFullMessage,
43
43
  onClickReply,
44
44
  onTicketClick,
45
- onMessageContentClick,
45
+ messageContentClickMapping,
46
46
  customStyle,
47
47
  customProps
48
48
  } = props;
@@ -57,11 +57,14 @@ export default function IMMessage(props) {
57
57
  isHighlightMessage,
58
58
  needSender,
59
59
  isShowSender,
60
- isShowMessageTime
60
+ isShowMessageTime,
61
+ isShowMessageStatus
61
62
  } = messageDisplayProps;
62
63
  const newStyle = useMergeStyle(style, customStyle);
63
64
  const {
64
65
  direction,
66
+ isIncoming,
67
+ isOutgoing,
65
68
  // isBot,
66
69
  senderSrc,
67
70
  senderAlternateSrc,
@@ -72,6 +75,7 @@ export default function IMMessage(props) {
72
75
  // messageType,
73
76
  messageStatus,
74
77
  isFailedMessage,
78
+ isSendingMessage,
75
79
  isAgentMessage,
76
80
  messageStatusTitle,
77
81
  dateTimeDetails,
@@ -107,21 +111,23 @@ export default function IMMessage(props) {
107
111
  const handleRenderMessage = useCallback(() => /*#__PURE__*/React.createElement(IMMessageContent, _extends({
108
112
  deleteMessageText: deleteMessageText,
109
113
  isFailed: isFailedMessage,
114
+ isSending: isSendingMessage,
115
+ messageContentClickMapping: messageContentClickMapping,
110
116
  messageDetails: messageDetails,
111
- onClick: onMessageContentClick,
112
117
  onClickReply: onClickReply,
113
118
  onLoadFullMessage: onLoadFullMessage,
114
119
  replyText: replyText,
115
120
  seeMoreText: seeMoreText,
116
121
  sessionDetails: sessionDetails
117
- }, imMessageContentProps)), [seeMoreText, replyText, deleteMessageText, messageDetails, sessionDetails, onMessageContentClick, onLoadFullMessage, onClickReply, isFailedMessage, imMessageContentProps]);
122
+ }, imMessageContentProps)), [seeMoreText, replyText, deleteMessageText, messageDetails, sessionDetails, messageContentClickMapping, onLoadFullMessage, onClickReply, isFailedMessage, isSendingMessage, imMessageContentProps]);
118
123
  /** ** Render Secondary Actions - TicketId *** */
119
124
 
120
125
  const handleRenderSecondaryActions = useCallback(() => {
121
126
  const {
122
127
  imTicketLinkClass
123
128
  } = cssJSLogic({
124
- messageDetails
129
+ isIncoming,
130
+ isOutgoing
125
131
  }, newStyle);
126
132
  const customStyle = {
127
133
  text: imTicketLinkClass
@@ -133,7 +139,7 @@ export default function IMMessage(props) {
133
139
  onClick: onTicketClick,
134
140
  text: ticketNumber ? `#${ticketNumber}` : ''
135
141
  }, imTicketLinkProps));
136
- }, [ticketNumber, ticketUrl, ticketId, onTicketClick, imTicketLinkProps, messageDetails, newStyle]);
142
+ }, [ticketNumber, ticketUrl, ticketId, onTicketClick, imTicketLinkProps, newStyle, isIncoming, isOutgoing]);
137
143
  /** ** Render Owner Status Icon *** */
138
144
 
139
145
  const handleRenderIntegIcon = useCallback(() => /*#__PURE__*/React.createElement(IMIntegrationIcon, _extends({
@@ -150,20 +156,25 @@ export default function IMMessage(props) {
150
156
 
151
157
  const messageCustomProps = useMemo(() => {
152
158
  const {
153
- messageBubbleProps
159
+ customProps
154
160
  } = messageProps;
161
+ const {
162
+ messageBubbleProps
163
+ } = customProps;
155
164
  return { ...messageProps,
156
- messageBubbleProps: {
157
- renderMessageBoxFooter: handleRenderMessageBoxFooter,
158
- ...messageBubbleProps
165
+ customProps: { ...customProps,
166
+ messageBubbleProps: {
167
+ renderMessageBoxFooter: handleRenderMessageBoxFooter,
168
+ ...messageBubbleProps
169
+ }
159
170
  }
160
171
  };
161
172
  }, [messageProps, handleRenderMessageBoxFooter]);
162
- return /*#__PURE__*/React.createElement(Message, {
173
+ return /*#__PURE__*/React.createElement(Message, _extends({
163
174
  actions: actions,
164
- customProps: messageCustomProps,
165
175
  direction: direction,
166
176
  isActive: isHighlightMessage,
177
+ isShowMessageStatus: isShowMessageStatus,
167
178
  isShowSender: isShowSender,
168
179
  needSender: needSender,
169
180
  onMouseEnterAction: onMouseEnterAction,
@@ -174,7 +185,7 @@ export default function IMMessage(props) {
174
185
  renderSecondaryActions: handleRenderSecondaryActions,
175
186
  status: isAgentMessage ? messageStatus : '',
176
187
  statusTooltip: messageStatusTitle
177
- });
188
+ }, messageCustomProps));
178
189
  }
179
190
  IMMessage.propTypes = imMessagePropTypes;
180
191
  IMMessage.defaultProps = imMessageDefaultProps;
@@ -1,21 +1,13 @@
1
1
  /** ** Methods *** */
2
2
  import { compileClassNames } from '@zohodesk/utils';
3
- import getMessageDirectionType from '@zohoim/chat-components-utils/es/imUtils/getMessageDirection';
4
- /** ** Constants *** */
5
-
6
- import { direction as directionConstants } from '@zohoim/chat-components-utils/es/constants/messageConstants';
7
3
  export default function cssJSLogic(props, style) {
8
4
  const {
9
- messageDetails
5
+ isIncoming,
6
+ isOutgoing
10
7
  } = props;
11
- const {
12
- direction
13
- } = getMessageDirectionType({
14
- messageDetails
15
- });
16
8
  const imTicketLinkClass = compileClassNames({
17
- [style.ticketLinkLeft]: directionConstants.OUT === direction,
18
- [style.ticketLinkRight]: directionConstants.IN === direction
9
+ [style.ticketLinkLeft]: isOutgoing,
10
+ [style.ticketLinkRight]: isIncoming
19
11
  });
20
12
  return {
21
13
  imTicketLinkClass
@@ -7,6 +7,8 @@ const imMessageDefaultProps = {
7
7
  sessionDetails: dummyObject,
8
8
  messageStatusI18N: dummyObject,
9
9
  customProps: dummyObject,
10
- customStyle: dummyObject
10
+ customStyle: dummyObject,
11
+ messageDisplayProps: dummyObject,
12
+ messageContentClickMapping: dummyObject
11
13
  };
12
14
  export default imMessageDefaultProps;
@@ -61,6 +61,7 @@ const imMessagePropTypes = {
61
61
  }),
62
62
  messageDisplayProps: PropTypes.shape({
63
63
  isHighlightMessage: PropTypes.bool,
64
+ isShowMessageStatus: PropTypes.bool,
64
65
  isShowMessageTime: PropTypes.bool,
65
66
  isShowSender: PropTypes.bool,
66
67
  needSender: PropTypes.bool
@@ -102,7 +103,7 @@ const imMessagePropTypes = {
102
103
  onLoadFullMessage: PropTypes.func,
103
104
  onClickReply: PropTypes.func,
104
105
  onTicketClick: PropTypes.func,
105
- onMessageContentClick: PropTypes.func,
106
+ messageContentClickMapping: PropTypes.object,
106
107
  customStyle: PropTypes.object,
107
108
  customProps: PropTypes.shape({
108
109
  imIntegrationIconProps: PropTypes.object,
@@ -38,7 +38,9 @@ export default function IMMessageContent(props) {
38
38
  customProps,
39
39
  renderCustomMessage,
40
40
  onClick: propOnClick,
41
- isFailed
41
+ isFailed,
42
+ isSending,
43
+ messageContentClickMapping
42
44
  } = props;
43
45
  const {
44
46
  imReplyBubbleProps = dummyObject,
@@ -49,6 +51,10 @@ export default function IMMessageContent(props) {
49
51
  audioBubbleProps = dummyObject,
50
52
  attachmentBubbleProps = dummyObject
51
53
  } = customProps;
54
+ const {
55
+ onImageBubbleClick,
56
+ onAttachmentBubbleClick
57
+ } = messageContentClickMapping;
52
58
  const {
53
59
  isShowLayoutBubble,
54
60
  isShowReplyBubble,
@@ -62,8 +68,7 @@ export default function IMMessageContent(props) {
62
68
  isShowDeleteBubble,
63
69
  replyToMessageDetails: replyToMessage,
64
70
  attachmentDetails,
65
- locationUrl,
66
- onClick
71
+ locationUrl
67
72
  } = useIMMessageContent({
68
73
  messageDetails,
69
74
  onClick: propOnClick
@@ -72,8 +77,7 @@ export default function IMMessageContent(props) {
72
77
 
73
78
  const newStyle = useMergeStyle(style, customStyle);
74
79
  const wrapperDivProps = {
75
- className: newStyle.messageContentRow,
76
- onClick
80
+ className: newStyle.messageContentRow
77
81
  };
78
82
  return /*#__PURE__*/React.createElement(Fragment, null, isShowLayoutBubble ? null : null, isShowDeleteBubble ? /*#__PURE__*/React.createElement("div", {
79
83
  className: newStyle.deleteBubble
@@ -87,7 +91,9 @@ export default function IMMessageContent(props) {
87
91
  isFailed
88
92
  }) : null, isShowImageBubble ? /*#__PURE__*/React.createElement("div", wrapperDivProps, /*#__PURE__*/React.createElement(ImageBubble, _extends({
89
93
  imageDetails: attachmentDetails,
90
- isFailed: isFailed
94
+ isFailed: isFailed,
95
+ isSending: isSending,
96
+ onClick: onImageBubbleClick
91
97
  }, imageBubbleProps))) : null, isShowVideoBubble ? /*#__PURE__*/React.createElement("div", wrapperDivProps, /*#__PURE__*/React.createElement(VideoBubble, _extends({
92
98
  isFailed: isFailed,
93
99
  videoDetails: attachmentDetails
@@ -96,7 +102,8 @@ export default function IMMessageContent(props) {
96
102
  isFailed: isFailed
97
103
  }, audioBubbleProps))) : null, isShowAttachmentBubble ? /*#__PURE__*/React.createElement("div", wrapperDivProps, /*#__PURE__*/React.createElement(AttachmentBubble, _extends({
98
104
  attachmentDetails: attachmentDetails,
99
- isFailed: isFailed
105
+ isFailed: isFailed,
106
+ onClick: onAttachmentBubbleClick
100
107
  }, attachmentBubbleProps))) : null, isShowLocationBubble ? /*#__PURE__*/React.createElement("div", wrapperDivProps, /*#__PURE__*/React.createElement(LocationBubble, _extends({
101
108
  isFailed: isFailed,
102
109
  locationUrl: locationUrl
@@ -4,4 +4,5 @@
4
4
 
5
5
  .deleteBubble {
6
6
  font-style: italic;
7
+ color: var(--imlib_chat_components_imMessageContent_text_color);
7
8
  }
@@ -2,6 +2,7 @@
2
2
  import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
3
3
  const imMessageContentDefaultProps = {
4
4
  customStyle: dummyObject,
5
- customProps: dummyObject
5
+ customProps: dummyObject,
6
+ messageContentClickMapping: dummyObject
6
7
  };
7
8
  export default imMessageContentDefaultProps;
@@ -27,6 +27,7 @@ const imMessageContentPropTypes = {
27
27
  id: PropTypes.string
28
28
  }),
29
29
  onClick: PropTypes.func,
30
+ messageContentClickMapping: PropTypes.object,
30
31
  onLoadFullMessage: PropTypes.func,
31
32
  onClickReply: PropTypes.func,
32
33
  seeMoreText: PropTypes.string,
@@ -43,6 +44,7 @@ const imMessageContentPropTypes = {
43
44
  locationBubbleProps: PropTypes.object,
44
45
  videoBubbleProps: PropTypes.object
45
46
  }),
46
- isFailed: PropTypes.bool
47
+ isFailed: PropTypes.bool,
48
+ isSending: PropTypes.bool
47
49
  };
48
50
  export default imMessageContentPropTypes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohoim/chat-components",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "description": "Chat Components",
5
5
  "main": "es/index.js",
6
6
  "module": "es/index.js",
@@ -32,11 +32,12 @@
32
32
  "@zohodesk/components": "1.0.0-alpha-259",
33
33
  "@zohodesk/hooks": "1.3.12",
34
34
  "@zohodesk/icon": "1.3.12",
35
+ "@zohodesk/icons": "1.0.7",
35
36
  "@zohodesk/utils": "1.3.9",
36
37
  "@zohodesk/variables": "1.0.0-beta.30",
37
38
  "@zohodesk/virtualizer": "1.0.13",
38
- "@zohoim/chat-components-hooks": "^0.0.16",
39
- "@zohoim/chat-components-utils": "^0.0.15"
39
+ "@zohoim/chat-components-hooks": "^0.0.18",
40
+ "@zohoim/chat-components-utils": "^0.0.17"
40
41
  },
41
42
  "devDependencies": {
42
43
  "@zohodesk-private/css-variable-migrator": "1.0.1",
@@ -44,5 +45,5 @@
44
45
  "jsdom": "22.1.0",
45
46
  "react-to-jsx": "1.3.2"
46
47
  },
47
- "gitHead": "d7839c59d5c147bf2c24c2af7d2aa75a994f05b4"
48
+ "gitHead": "8ddb3ec73ad57fdb8e9b3eb909d348936f6f2077"
48
49
  }