@zohoim/chat-components 0.0.15 → 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.
- package/es/ActionIcon/ActionIcon.js +2 -0
- package/es/ActionIconWrapper/ActionIconWrapper.js +6 -2
- package/es/ActionIconWrapper/props/propTypes.js +1 -0
- package/es/AttachmentBubble/AttachmentBubble.js +24 -8
- package/es/AttachmentBubble/css/AttachmentBubble.module.css +15 -1
- package/es/AttachmentBubble/css/cssJSLogic.js +15 -0
- package/es/AttachmentBubble/props/propTypes.js +2 -1
- package/es/AttachmentBubbleInfo/AttachmentBubbleInfo.js +13 -2
- package/es/AttachmentBubbleInfo/css/AttachmentBubbleInfo.module.css +9 -0
- package/es/AttachmentBubbleInfo/css/cssJSLogic.js +13 -0
- package/es/AttachmentBubbleInfo/props/propTypes.js +2 -1
- package/es/AttachmentIcon/AttachmentIcon.js +3 -1
- package/es/AttachmentIcon/css/AttachmentIcon.module.css +2 -2
- package/es/AttachmentIcon/props/propTypes.js +6 -0
- package/es/AttachmentIcon/utils/getAttachmentIconComponent.js +4 -3
- package/es/AudioBubble/AudioBubble.js +5 -2
- package/es/AudioBubble/props/propTypes.js +2 -1
- package/es/ImageBubble/ImageBubble.js +13 -2
- package/es/ImageBubble/css/ImageBubble.module.css +8 -2
- package/es/ImageBubble/css/cssJSLogic.js +13 -0
- package/es/ImageBubble/props/propTypes.js +2 -1
- package/es/LocationBubble/LocationBubble.js +13 -2
- package/es/LocationBubble/css/LocationBubble.module.css +14 -1
- package/es/LocationBubble/css/cssJSLogic.js +13 -0
- package/es/LocationBubble/props/propTypes.js +2 -1
- package/es/MediaBubbleWrapper/MediaBubbleWrapper.js +5 -2
- package/es/MediaBubbleWrapper/props/propTypes.js +2 -1
- package/es/Message/Message.js +4 -2
- package/es/MessageAction/MessageAction.js +3 -0
- package/es/MessageAction/props/propTypes.js +1 -0
- package/es/MessageActions/MessageActions.js +14 -2
- package/es/MessageActions/props/propTypes.js +1 -0
- package/es/MessageBox/MessageBox.js +2 -2
- package/es/MessageBubble/MessageBubble.js +16 -11
- package/es/MessageStatus/css/MessageStatus.module.css +0 -3
- package/es/MoreActionItem/MoreActionItem.js +8 -0
- package/es/MoreActionItem/props/propTypes.js +1 -0
- package/es/ReplyBubble/ReplyBubble.js +32 -13
- package/es/ReplyBubble/css/ReplyBubble.module.css +1 -1
- package/es/ReplyBubble/props/propTypes.js +8 -2
- package/es/ReplyBubbleContent/ReplyBubbleContent.js +11 -2
- package/es/ReplyBubbleContent/css/ReplyBubbleContent.module.css +21 -3
- package/es/ReplyBubbleContent/css/cssJSLogic.js +13 -0
- package/es/ReplyBubbleContent/props/propTypes.js +2 -1
- package/es/ReplyBubbleHeader/ReplyBubbleHeader.js +20 -5
- package/es/ReplyBubbleHeader/css/ReplyBubbleHeader.module.css +12 -0
- package/es/ReplyBubbleHeader/css/cssJSLogic.js +12 -0
- package/es/ReplyBubbleHeader/props/defaultProps.js +2 -1
- package/es/ReplyBubbleHeader/props/propTypes.js +6 -2
- package/es/TextBubble/TextBubble.js +15 -3
- package/es/TextBubble/css/TextBubble.module.css +13 -0
- package/es/TextBubble/css/cssJSLogic.js +18 -0
- package/es/TextBubble/props/propTypes.js +2 -1
- package/es/Theme/themeVariables/commonThemeColorVariable.js +1 -2
- package/es/Theme/themeVariables/dark/blueTheme.js +97 -40
- package/es/Theme/themeVariables/dark/commonColorVariable.js +7 -1
- package/es/Theme/themeVariables/dark/greenTheme.js +95 -38
- package/es/Theme/themeVariables/dark/orangeTheme.js +94 -37
- package/es/Theme/themeVariables/dark/redTheme.js +94 -46
- package/es/Theme/themeVariables/dark/yellowTheme.js +94 -37
- package/es/Theme/themeVariables/light/blueTheme.js +96 -35
- package/es/Theme/themeVariables/light/commonColorVariable.js +8 -1
- package/es/Theme/themeVariables/light/greenTheme.js +96 -35
- package/es/Theme/themeVariables/light/orangeTheme.js +97 -34
- package/es/Theme/themeVariables/light/redTheme.js +97 -34
- package/es/Theme/themeVariables/light/yellowTheme.js +96 -35
- package/es/Theme/themeVariables/pureDark/blueTheme.js +93 -37
- package/es/Theme/themeVariables/pureDark/commonColorVariable.js +7 -1
- package/es/Theme/themeVariables/pureDark/greenTheme.js +94 -37
- package/es/Theme/themeVariables/pureDark/orangeTheme.js +94 -37
- package/es/Theme/themeVariables/pureDark/redTheme.js +94 -37
- package/es/Theme/themeVariables/pureDark/yellowTheme.js +94 -37
- package/es/VideoBubble/VideoBubble.js +5 -2
- package/es/VideoBubble/props/propTypes.js +2 -1
- package/es/icons/iconSrc/attachments/Text.js +47 -0
- package/es/icons/iconSrc/attachments/index.js +1 -1
- package/es/im/ArticleBubble/ArticleBubble.js +16 -3
- package/es/im/ArticleBubble/css/ArticleBubble.module.css +18 -3
- package/es/im/ArticleBubble/css/cssJSLogic.js +12 -0
- package/es/im/ArticleBubble/props/propTypes.js +2 -1
- package/es/im/IMAutoMessageInfo/css/IMAutoMessageInfo.module.css +1 -0
- package/es/im/IMIntegrationIcon/css/IMIntegrationIcon.module.css +1 -6
- package/es/im/IMMessage/IMMessage.js +28 -4
- package/es/im/IMMessage/props/propTypes.js +25 -1
- package/es/im/IMMessageContent/IMMessageContent.js +39 -42
- package/es/im/IMMessageContent/css/IMMessageContent.module.css +6 -2
- package/es/im/IMMessageContent/props/propTypes.js +7 -2
- package/es/im/IMMessageMeta/IMMessageMeta.js +8 -8
- package/es/im/IMMessageMeta/css/IMMessageMeta.module.css +1 -1
- package/es/im/IMMessageMeta/props/defaultProps.js +1 -1
- package/es/im/IMPermaLink/css/IMPermaLink.module.css +1 -1
- package/es/im/IMReplyBubble/IMReplyBubble.js +10 -5
- package/es/im/IMReplyBubble/props/propTypes.js +7 -2
- package/es/im/IMTextBubble/IMTextBubble.js +5 -2
- package/es/im/IMTextBubble/props/propTypes.js +2 -1
- package/es/im/css/common.module.css +2 -2
- package/es/im/index.js +0 -1
- package/es/index.js +0 -1
- package/package.json +4 -21
- package/es/InfoBubble/InfoBubble.js +0 -34
- package/es/InfoBubble/css/InfoBubble.module.css +0 -0
- package/es/InfoBubble/css/cssJSLogic.js +0 -10
- package/es/InfoBubble/index.js +0 -1
- package/es/InfoBubble/props/defaultProps.js +0 -6
- package/es/InfoBubble/props/propTypes.js +0 -6
- package/es/Theme/crm/dark/blueFanTheme.js +0 -28
- package/es/Theme/crm/dark/blueTheme.js +0 -28
- package/es/Theme/crm/dark/commonColorVariable.js +0 -11
- package/es/Theme/crm/dark/darkBlueTheme.js +0 -28
- package/es/Theme/crm/dark/darkGreyTheme.js +0 -28
- package/es/Theme/crm/dark/greenTheme.js +0 -28
- package/es/Theme/crm/dark/orangeTheme.js +0 -28
- package/es/Theme/crm/dark/pinkTheme.js +0 -28
- package/es/Theme/crm/dark/tealTheme.js +0 -28
- package/es/Theme/crm/dark/whiteTheme.js +0 -28
- package/es/Theme/crm/light/blueFanTheme.js +0 -28
- package/es/Theme/crm/light/blueTheme.js +0 -31
- package/es/Theme/crm/light/commonColorVariable.js +0 -9
- package/es/Theme/crm/light/darkBlueTheme.js +0 -28
- package/es/Theme/crm/light/darkGreyTheme.js +0 -28
- package/es/Theme/crm/light/greenTheme.js +0 -28
- package/es/Theme/crm/light/orangeTheme.js +0 -28
- package/es/Theme/crm/light/pinkTheme.js +0 -28
- package/es/Theme/crm/light/tealTheme.js +0 -28
- package/es/Theme/crm/light/whiteTheme.js +0 -28
- package/es/Theme/crm/pureDark/blueFanTheme.js +0 -28
- package/es/Theme/crm/pureDark/blueTheme.js +0 -28
- package/es/Theme/crm/pureDark/commonColorVariable.js +0 -9
- package/es/Theme/crm/pureDark/darkBlueTheme.js +0 -28
- package/es/Theme/crm/pureDark/darkGreyTheme.js +0 -28
- package/es/Theme/crm/pureDark/greenTheme.js +0 -28
- package/es/Theme/crm/pureDark/orangeTheme.js +0 -28
- package/es/Theme/crm/pureDark/pinkTheme.js +0 -28
- package/es/Theme/crm/pureDark/tealTheme.js +0 -28
- package/es/Theme/crm/pureDark/whiteTheme.js +0 -28
- package/es/im/IMInfoBubble/IMInfoBubble.js +0 -34
- package/es/im/IMInfoBubble/css/IMInfoBubble.module.css +0 -0
- package/es/im/IMInfoBubble/css/cssJSLogic.js +0 -10
- package/es/im/IMInfoBubble/index.js +0 -1
- package/es/im/IMInfoBubble/props/defaultProps.js +0 -6
- package/es/im/IMInfoBubble/props/propTypes.js +0 -6
- /package/es/icons/factory/attachments/{txt.svg → text.svg} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { compileClassNames } from '@zohodesk/utils';
|
|
2
|
+
export default function cssJSLogic(props, style) {
|
|
3
|
+
const {
|
|
4
|
+
isFailed
|
|
5
|
+
} = props;
|
|
6
|
+
const articleBubbleClass = compileClassNames({
|
|
7
|
+
[style.failedArticleBubbleClass]: isFailed
|
|
8
|
+
});
|
|
9
|
+
return {
|
|
10
|
+
articleBubbleClass
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -20,6 +20,7 @@ import Message from '../../Message/Message';
|
|
|
20
20
|
import IMMessageContent from '../IMMessageContent/IMMessageContent';
|
|
21
21
|
import IMPermaLink from '../IMPermaLink/IMPermaLink';
|
|
22
22
|
import IMIntegrationIcon from '../IMIntegrationIcon/IMIntegrationIcon';
|
|
23
|
+
import IMMessageMeta from '../IMMessageMeta/IMMessageMeta';
|
|
23
24
|
/** ** Styles *** */
|
|
24
25
|
|
|
25
26
|
import style from './css/IMMessage.module.css';
|
|
@@ -31,13 +32,17 @@ export default function IMMessage(props) {
|
|
|
31
32
|
messageDisplayProps,
|
|
32
33
|
actions,
|
|
33
34
|
onSelectAction,
|
|
35
|
+
onMouseEnterAction,
|
|
34
36
|
replyText,
|
|
35
37
|
seeMoreText,
|
|
36
38
|
deleteMessageText,
|
|
39
|
+
autoMessagesI18N,
|
|
40
|
+
autoMessagesTitleI18N,
|
|
37
41
|
messageStatusI18N,
|
|
38
42
|
onLoadFullMessage,
|
|
39
43
|
onClickReply,
|
|
40
44
|
onTicketClick,
|
|
45
|
+
onMessageContentClick,
|
|
41
46
|
customStyle,
|
|
42
47
|
customProps
|
|
43
48
|
} = props;
|
|
@@ -45,7 +50,8 @@ export default function IMMessage(props) {
|
|
|
45
50
|
messageProps = dummyObject,
|
|
46
51
|
imMessageContentProps = dummyObject,
|
|
47
52
|
imTicketLinkProps = dummyObject,
|
|
48
|
-
imIntegrationIconProps = dummyObject
|
|
53
|
+
imIntegrationIconProps = dummyObject,
|
|
54
|
+
imMessageMetaProps = dummyObject
|
|
49
55
|
} = customProps;
|
|
50
56
|
const {
|
|
51
57
|
isHighlightMessage,
|
|
@@ -65,9 +71,11 @@ export default function IMMessage(props) {
|
|
|
65
71
|
// messageMetaType,
|
|
66
72
|
// messageType,
|
|
67
73
|
messageStatus,
|
|
74
|
+
isFailedMessage,
|
|
68
75
|
isAgentMessage,
|
|
69
76
|
messageStatusTitle,
|
|
70
|
-
|
|
77
|
+
dateTimeDetails,
|
|
78
|
+
autoMessageType,
|
|
71
79
|
// messageId,
|
|
72
80
|
ticketId,
|
|
73
81
|
ticketNumber,
|
|
@@ -80,18 +88,33 @@ export default function IMMessage(props) {
|
|
|
80
88
|
});
|
|
81
89
|
/** ** Render Footer *** */
|
|
82
90
|
|
|
83
|
-
const handleRenderMessageBoxFooter = useCallback(() =>
|
|
91
|
+
const handleRenderMessageBoxFooter = useCallback(() => {
|
|
92
|
+
const {
|
|
93
|
+
displayDateTime,
|
|
94
|
+
tooltip
|
|
95
|
+
} = dateTimeDetails || {};
|
|
96
|
+
return /*#__PURE__*/React.createElement(IMMessageMeta, _extends({
|
|
97
|
+
autoMessagesI18N: autoMessagesI18N,
|
|
98
|
+
autoMessagesTitleI18N: autoMessagesTitleI18N,
|
|
99
|
+
autoMessageType: autoMessageType,
|
|
100
|
+
direction: direction,
|
|
101
|
+
time: isShowMessageTime ? displayDateTime : '',
|
|
102
|
+
timeTooltip: tooltip
|
|
103
|
+
}, imMessageMetaProps));
|
|
104
|
+
}, [isShowMessageTime, dateTimeDetails, direction, autoMessageType, imMessageMetaProps, autoMessagesI18N, autoMessagesTitleI18N]);
|
|
84
105
|
/** ** Render Message Content *** */
|
|
85
106
|
|
|
86
107
|
const handleRenderMessage = useCallback(() => /*#__PURE__*/React.createElement(IMMessageContent, _extends({
|
|
87
108
|
deleteMessageText: deleteMessageText,
|
|
109
|
+
isFailed: isFailedMessage,
|
|
88
110
|
messageDetails: messageDetails,
|
|
111
|
+
onClick: onMessageContentClick,
|
|
89
112
|
onClickReply: onClickReply,
|
|
90
113
|
onLoadFullMessage: onLoadFullMessage,
|
|
91
114
|
replyText: replyText,
|
|
92
115
|
seeMoreText: seeMoreText,
|
|
93
116
|
sessionDetails: sessionDetails
|
|
94
|
-
}, imMessageContentProps)), [seeMoreText, replyText, deleteMessageText, messageDetails, sessionDetails, onLoadFullMessage, onClickReply, imMessageContentProps]);
|
|
117
|
+
}, imMessageContentProps)), [seeMoreText, replyText, deleteMessageText, messageDetails, sessionDetails, onMessageContentClick, onLoadFullMessage, onClickReply, isFailedMessage, imMessageContentProps]);
|
|
95
118
|
/** ** Render Secondary Actions - TicketId *** */
|
|
96
119
|
|
|
97
120
|
const handleRenderSecondaryActions = useCallback(() => {
|
|
@@ -143,6 +166,7 @@ export default function IMMessage(props) {
|
|
|
143
166
|
isActive: isHighlightMessage,
|
|
144
167
|
isShowSender: isShowSender,
|
|
145
168
|
needSender: needSender,
|
|
169
|
+
onMouseEnterAction: onMouseEnterAction,
|
|
146
170
|
onSelectAction: onSelectAction,
|
|
147
171
|
ownerDetails: ownerDetails,
|
|
148
172
|
renderContent: handleRenderMessage,
|
|
@@ -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
|
-
|
|
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,12 +95,14 @@ 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,
|
|
78
101
|
deleteMessageText: PropTypes.string,
|
|
79
102
|
onLoadFullMessage: PropTypes.func,
|
|
80
103
|
onClickReply: PropTypes.func,
|
|
81
104
|
onTicketClick: PropTypes.func,
|
|
105
|
+
onMessageContentClick: PropTypes.func,
|
|
82
106
|
customStyle: PropTypes.object,
|
|
83
107
|
customProps: PropTypes.shape({
|
|
84
108
|
imIntegrationIconProps: PropTypes.object,
|
|
@@ -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, {
|
|
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';
|
|
@@ -39,7 +36,9 @@ export default function IMMessageContent(props) {
|
|
|
39
36
|
deleteMessageText,
|
|
40
37
|
customStyle,
|
|
41
38
|
customProps,
|
|
42
|
-
renderCustomMessage
|
|
39
|
+
renderCustomMessage,
|
|
40
|
+
onClick: propOnClick,
|
|
41
|
+
isFailed
|
|
43
42
|
} = props;
|
|
44
43
|
const {
|
|
45
44
|
imReplyBubbleProps = dummyObject,
|
|
@@ -60,51 +59,49 @@ export default function IMMessageContent(props) {
|
|
|
60
59
|
isShowLocationBubble,
|
|
61
60
|
isShowTextBubble,
|
|
62
61
|
isShowCustomBubble,
|
|
63
|
-
isShowDeleteBubble
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
isShowDeleteBubble,
|
|
63
|
+
replyToMessageDetails: replyToMessage,
|
|
64
|
+
attachmentDetails,
|
|
65
|
+
locationUrl,
|
|
66
|
+
onClick
|
|
67
|
+
} = useIMMessageContent({
|
|
68
|
+
messageDetails,
|
|
69
|
+
onClick: propOnClick
|
|
70
|
+
});
|
|
67
71
|
/* External CSS Customization */
|
|
68
72
|
|
|
69
73
|
const newStyle = useMergeStyle(style, customStyle);
|
|
70
|
-
const {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}),
|
|
77
|
-
|
|
78
|
-
className: newStyle.messageContentRow
|
|
79
|
-
}, /*#__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,
|
|
80
82
|
messageDetails: replyToMessage,
|
|
81
83
|
onClick: onClickReply,
|
|
82
84
|
replyText: replyText
|
|
83
85
|
}, imReplyBubbleProps))) : null, isShowCustomBubble ? renderCustomMessage({
|
|
84
|
-
messageDetails
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}, imageBubbleProps))) : null, isShowVideoBubble ? /*#__PURE__*/React.createElement("div", {
|
|
90
|
-
|
|
91
|
-
}, /*#__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,
|
|
92
93
|
videoDetails: attachmentDetails
|
|
93
|
-
}, videoBubbleProps))) : null, isShowAudioBubble ? /*#__PURE__*/React.createElement("div", {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}, /*#__PURE__*/React.createElement(
|
|
100
|
-
|
|
101
|
-
}, attachmentBubbleProps))) : null, isShowLocationBubble ? /*#__PURE__*/React.createElement("div", {
|
|
102
|
-
className: newStyle.messageContentRow
|
|
103
|
-
}, /*#__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,
|
|
104
102
|
locationUrl: locationUrl
|
|
105
|
-
}, locationBubbleProps))) : null, isShowTextBubble ? /*#__PURE__*/React.createElement("div", {
|
|
106
|
-
|
|
107
|
-
}, /*#__PURE__*/React.createElement(IMTextBubble, _extends({
|
|
103
|
+
}, locationBubbleProps))) : null, isShowTextBubble ? /*#__PURE__*/React.createElement("div", wrapperDivProps, /*#__PURE__*/React.createElement(IMTextBubble, _extends({
|
|
104
|
+
isFailed: isFailed,
|
|
108
105
|
messageDetails: messageDetails,
|
|
109
106
|
moreText: seeMoreText,
|
|
110
107
|
onLoadFullMessage: onLoadFullMessage,
|
|
@@ -5,7 +5,10 @@ const imMessageContentPropTypes = {
|
|
|
5
5
|
displayMessage: PropTypes.string.isRequired,
|
|
6
6
|
attachment: PropTypes.string,
|
|
7
7
|
contentType: PropTypes.string,
|
|
8
|
-
|
|
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,6 +26,7 @@ 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,
|
|
@@ -38,6 +42,7 @@ const imMessageContentPropTypes = {
|
|
|
38
42
|
imageBubbleProps: PropTypes.object,
|
|
39
43
|
locationBubbleProps: PropTypes.object,
|
|
40
44
|
videoBubbleProps: PropTypes.object
|
|
41
|
-
})
|
|
45
|
+
}),
|
|
46
|
+
isFailed: PropTypes.bool
|
|
42
47
|
};
|
|
43
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(
|
|
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;
|
|
@@ -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;
|
|
@@ -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
|
-
|
|
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
|
-
|
|
43
|
-
|
|
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
|
-
|
|
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;
|
package/es/im/index.js
CHANGED
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.
|
|
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.
|
|
39
|
-
"@zohoim/chat-components-utils": "^0.0.
|
|
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
|
-
"
|
|
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": "0b3fa05803c74cad58e84613fc54c979493192c0"
|
|
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
|
package/es/InfoBubble/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as InfoBubble } from './InfoBubble';
|