@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
|
@@ -13,7 +13,7 @@ import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler
|
|
|
13
13
|
import cssJSLogic from './css/cssJSLogic';
|
|
14
14
|
/** ** Components *** */
|
|
15
15
|
|
|
16
|
-
import {
|
|
16
|
+
import { Box } from '@zohodesk/components/es/Layout';
|
|
17
17
|
/** ** Styles *** */
|
|
18
18
|
|
|
19
19
|
import style from './css/MessageBox.module.css';
|
|
@@ -46,7 +46,7 @@ export default function MessageBox(props) {
|
|
|
46
46
|
const messageConent = renderHandler(renderMessageContent)();
|
|
47
47
|
const messageFooter = renderHandler(renderMessageFooter)();
|
|
48
48
|
const messageStatus = renderHandler(renderMessageStatus)();
|
|
49
|
-
return /*#__PURE__*/React.createElement(
|
|
49
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
50
50
|
className: messageBoxClass
|
|
51
51
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
52
52
|
className: newStyle.messageBoxInner,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
/* eslint-disable no-confusing-arrow */
|
|
2
|
+
|
|
1
3
|
/** ** Libraries *** */
|
|
2
|
-
import React, { useCallback } from 'react';
|
|
4
|
+
import React, { useCallback, useMemo } from 'react';
|
|
3
5
|
/** ** Hooks *** */
|
|
4
6
|
|
|
5
7
|
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
@@ -14,7 +16,7 @@ import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler
|
|
|
14
16
|
import cssJSLogic from './css/cssJSLogic';
|
|
15
17
|
/** ** Components *** */
|
|
16
18
|
|
|
17
|
-
import {
|
|
19
|
+
import { Box } from '@zohodesk/components/es/Layout';
|
|
18
20
|
/** ** Styles *** */
|
|
19
21
|
|
|
20
22
|
import style from './css/MessageBubble.module.css';
|
|
@@ -75,13 +77,11 @@ export default function MessageBubble(props) {
|
|
|
75
77
|
}, [renderMessageBox, newStyle.messageBoxWrapper]);
|
|
76
78
|
/* Message BoxWithActions Render */
|
|
77
79
|
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}, messageBox, messageActions) : null;
|
|
84
|
-
}, [messageBoxRenderer, messageActionsRenderer, newStyle.messageContainer]);
|
|
80
|
+
const messageBox = useMemo(() => messageBoxRenderer(), [messageBoxRenderer]);
|
|
81
|
+
const messageActions = useMemo(() => messageActionsRenderer(), [messageActionsRenderer]);
|
|
82
|
+
const messageBoxWithActionsRenderer = useCallback(() => messageBox || messageActions ? /*#__PURE__*/React.createElement(Box, {
|
|
83
|
+
className: newStyle.messageContainer
|
|
84
|
+
}, messageBox, messageActions) : null, [messageBox, messageActions, newStyle.messageContainer]);
|
|
85
85
|
/* Message Footer Render */
|
|
86
86
|
|
|
87
87
|
const messageFooterRenderer = useCallback(() => {
|
|
@@ -90,13 +90,18 @@ export default function MessageBubble(props) {
|
|
|
90
90
|
className: newStyle.messageBoxFooterWrapper
|
|
91
91
|
}, messageBoxFooter) : null;
|
|
92
92
|
}, [renderMessageBoxFooter, newStyle.messageBoxFooterWrapper]);
|
|
93
|
+
/* Get the components */
|
|
94
|
+
|
|
95
|
+
const messageSender = useMemo(() => messageSenderRenderer(), [messageSenderRenderer]);
|
|
96
|
+
const messageBoxWithActions = useMemo(() => messageBoxWithActionsRenderer(), [messageBoxWithActionsRenderer]);
|
|
97
|
+
const messageFooter = useMemo(() => messageFooterRenderer(), [messageFooterRenderer]);
|
|
93
98
|
/* Construct Layout */
|
|
94
99
|
|
|
95
|
-
const messageLayout = /*#__PURE__*/React.createElement(
|
|
100
|
+
const messageLayout = /*#__PURE__*/React.createElement("div", {
|
|
96
101
|
className: bubbleClass,
|
|
97
102
|
onMouseEnter: onMouseEnter,
|
|
98
103
|
onMouseLeave: onMouseLeave
|
|
99
|
-
},
|
|
104
|
+
}, messageSender, messageBoxWithActions, messageFooter);
|
|
100
105
|
return messageLayout;
|
|
101
106
|
}
|
|
102
107
|
MessageBubble.propTypes = messageBubblePropTypes;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
.messageStatus {
|
|
2
2
|
/* USe this class name status customization */
|
|
3
|
-
/* color: #61667a; */
|
|
4
3
|
color: var(--imlib_chat_components_messageStatus_send_color);
|
|
5
4
|
}
|
|
6
5
|
|
|
7
6
|
.readStatus{
|
|
8
|
-
/* color: #0a73eb; */
|
|
9
7
|
color: var(--imlib_chat_components_messageStatus_read_color);
|
|
10
8
|
}
|
|
11
9
|
|
|
12
10
|
.failedStatus{
|
|
13
|
-
/* color: #de3535 */
|
|
14
11
|
color: var(--imlib_chat_components_messageStatus_failed_color);
|
|
15
12
|
}
|
|
@@ -26,6 +26,7 @@ export default function MoreActionItem(props) {
|
|
|
26
26
|
renderIcon,
|
|
27
27
|
needIcon,
|
|
28
28
|
onClick,
|
|
29
|
+
onMouseEnter,
|
|
29
30
|
closePopup,
|
|
30
31
|
isDisabled
|
|
31
32
|
} = props;
|
|
@@ -36,6 +37,12 @@ export default function MoreActionItem(props) {
|
|
|
36
37
|
id
|
|
37
38
|
});
|
|
38
39
|
}, [closePopup, onClick, id, isDisabled]);
|
|
40
|
+
const handleMouseEnter = useCallback(e => {
|
|
41
|
+
!isDisabled && onMouseEnter && onMouseEnter({
|
|
42
|
+
e,
|
|
43
|
+
id
|
|
44
|
+
});
|
|
45
|
+
}, [onMouseEnter, id, isDisabled]);
|
|
39
46
|
/* External CSS Customization */
|
|
40
47
|
|
|
41
48
|
const newStyle = useMergeStyle(style, customStyle);
|
|
@@ -49,6 +56,7 @@ export default function MoreActionItem(props) {
|
|
|
49
56
|
id: id,
|
|
50
57
|
isDisabled: isDisabled,
|
|
51
58
|
onClick: handleClick,
|
|
59
|
+
onMouseEnter: handleMouseEnter,
|
|
52
60
|
title: title
|
|
53
61
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
54
62
|
align: "vertical",
|
|
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
const moreActionItemPropTypes = {
|
|
4
4
|
displayText: PropTypes.string.isRequired,
|
|
5
5
|
onClick: PropTypes.func.isRequired,
|
|
6
|
+
onMouseEnter: PropTypes.func,
|
|
6
7
|
closePopup: PropTypes.func,
|
|
7
8
|
customStyle: PropTypes.object,
|
|
8
9
|
id: PropTypes.string,
|
|
@@ -18,16 +18,19 @@ import style from './css/ReplyBubble.module.css';
|
|
|
18
18
|
import ReplyBubbleHeader from '../ReplyBubbleHeader/ReplyBubbleHeader';
|
|
19
19
|
import ReplyBubbleContent from '../ReplyBubbleContent/ReplyBubbleContent';
|
|
20
20
|
import AttachmentIcon from '../AttachmentIcon/AttachmentIcon';
|
|
21
|
+
import LocationBubble from '../LocationBubble/LocationBubble';
|
|
21
22
|
export default function ReplyBubble(props) {
|
|
22
23
|
const {
|
|
23
24
|
customStyle,
|
|
24
25
|
senderName,
|
|
25
|
-
|
|
26
|
+
dateTimeDetails,
|
|
26
27
|
replyText,
|
|
27
28
|
message,
|
|
28
29
|
attachmentDetails,
|
|
30
|
+
locationUrl,
|
|
29
31
|
onClick,
|
|
30
|
-
customProps
|
|
32
|
+
customProps,
|
|
33
|
+
isFailed
|
|
31
34
|
} = props;
|
|
32
35
|
const {
|
|
33
36
|
headerProps = dummyObject,
|
|
@@ -37,7 +40,8 @@ export default function ReplyBubble(props) {
|
|
|
37
40
|
const {
|
|
38
41
|
fileName,
|
|
39
42
|
fileURL,
|
|
40
|
-
fileFormat
|
|
43
|
+
fileFormat,
|
|
44
|
+
mediaType
|
|
41
45
|
} = attachmentDetails || dummyObject;
|
|
42
46
|
/* External CSS Customization */
|
|
43
47
|
|
|
@@ -45,13 +49,25 @@ export default function ReplyBubble(props) {
|
|
|
45
49
|
const iconStyle = useMemo(() => ({
|
|
46
50
|
$icon: newStyle.attachmentIcon
|
|
47
51
|
}), [newStyle.attachmentIcon]);
|
|
48
|
-
const renderMessage = useCallback(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
const renderMessage = useCallback(() => {
|
|
53
|
+
if (locationUrl) {
|
|
54
|
+
return /*#__PURE__*/React.createElement(LocationBubble, {
|
|
55
|
+
isFailed: isFailed,
|
|
56
|
+
locationUrl: locationUrl
|
|
57
|
+
});
|
|
53
58
|
}
|
|
54
|
-
|
|
59
|
+
|
|
60
|
+
if (message) {
|
|
61
|
+
// eslint-disable-next-line @zohodesk/zsecurity/no-unsecure-html, react/no-danger
|
|
62
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
63
|
+
dangerouslySetInnerHTML: {
|
|
64
|
+
__html: message
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return null;
|
|
70
|
+
}, [message, locationUrl, isFailed]);
|
|
55
71
|
const renderIcon = useCallback(() => {
|
|
56
72
|
if (fileURL) {
|
|
57
73
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -66,18 +82,21 @@ export default function ReplyBubble(props) {
|
|
|
66
82
|
if (fileFormat) {
|
|
67
83
|
return /*#__PURE__*/React.createElement(AttachmentIcon, _extends({
|
|
68
84
|
customStyle: iconStyle,
|
|
69
|
-
fileFormat: fileFormat
|
|
85
|
+
fileFormat: fileFormat,
|
|
86
|
+
mediaType: mediaType
|
|
70
87
|
}, iconProps));
|
|
71
88
|
}
|
|
72
89
|
|
|
73
90
|
return null;
|
|
74
|
-
}, [fileURL, fileName, fileFormat, iconStyle, iconProps, newStyle.imageWrapper, newStyle.image]);
|
|
91
|
+
}, [fileURL, fileName, fileFormat, mediaType, iconStyle, iconProps, newStyle.imageWrapper, newStyle.image]);
|
|
75
92
|
return /*#__PURE__*/React.createElement("div", {
|
|
76
93
|
onClick: onClick
|
|
77
94
|
}, /*#__PURE__*/React.createElement(ReplyBubbleHeader, _extends({
|
|
78
|
-
|
|
79
|
-
|
|
95
|
+
dateTimeDetails: dateTimeDetails,
|
|
96
|
+
isFailed: isFailed,
|
|
97
|
+
replyText: replyText
|
|
80
98
|
}, headerProps)), /*#__PURE__*/React.createElement(ReplyBubbleContent, _extends({
|
|
99
|
+
isFailed: isFailed,
|
|
81
100
|
renderIcon: renderIcon,
|
|
82
101
|
renderMessage: renderMessage,
|
|
83
102
|
senderName: senderName
|
|
@@ -8,14 +8,20 @@ const replyBubblePropTypes = {
|
|
|
8
8
|
attachmentDetails: PropTypes.shape({
|
|
9
9
|
fileFormat: PropTypes.string,
|
|
10
10
|
fileName: PropTypes.string,
|
|
11
|
-
fileURL: PropTypes.string
|
|
11
|
+
fileURL: PropTypes.string,
|
|
12
|
+
mediaType: PropTypes.string
|
|
12
13
|
}),
|
|
14
|
+
locationUrl: PropTypes.string,
|
|
13
15
|
customProps: PropTypes.shape({
|
|
14
16
|
contentProps: PropTypes.object,
|
|
15
17
|
headerProps: PropTypes.object,
|
|
16
18
|
iconProps: PropTypes.object
|
|
17
19
|
}),
|
|
18
20
|
customStyle: PropTypes.object,
|
|
19
|
-
|
|
21
|
+
dateTimeDetails: PropTypes.shape({
|
|
22
|
+
displayDateTime: PropTypes.string,
|
|
23
|
+
tooltip: PropTypes.string
|
|
24
|
+
}),
|
|
25
|
+
isFailed: PropTypes.bool
|
|
20
26
|
};
|
|
21
27
|
export default replyBubblePropTypes;
|
|
@@ -10,6 +10,7 @@ import replyBubbleContentPropTypes from './props/propTypes';
|
|
|
10
10
|
/** ** Methods *** */
|
|
11
11
|
|
|
12
12
|
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
13
|
+
import cssJSLogic from './css/cssJSLogic';
|
|
13
14
|
/** ** Styles *** */
|
|
14
15
|
|
|
15
16
|
import style from './css/ReplyBubbleContent.module.css';
|
|
@@ -21,17 +22,25 @@ export default function ReplyBubbleContent(props) {
|
|
|
21
22
|
customStyle,
|
|
22
23
|
senderName,
|
|
23
24
|
renderIcon,
|
|
24
|
-
renderMessage
|
|
25
|
+
renderMessage,
|
|
26
|
+
isFailed
|
|
25
27
|
} = props;
|
|
26
28
|
/* External CSS Customization */
|
|
27
29
|
|
|
28
30
|
const newStyle = useMergeStyle(style, customStyle);
|
|
31
|
+
/* css classnames added based on logic */
|
|
32
|
+
|
|
33
|
+
const {
|
|
34
|
+
replyBubbleContentClass
|
|
35
|
+
} = cssJSLogic({
|
|
36
|
+
isFailed
|
|
37
|
+
}, newStyle);
|
|
29
38
|
const icon = renderHandler(renderIcon)();
|
|
30
39
|
const messageContent = renderHandler(renderMessage)();
|
|
31
40
|
return /*#__PURE__*/React.createElement(Container, {
|
|
32
41
|
align: "vertical",
|
|
33
42
|
alignBox: "row",
|
|
34
|
-
className:
|
|
43
|
+
className: replyBubbleContentClass,
|
|
35
44
|
isCover: false
|
|
36
45
|
}, icon ? /*#__PURE__*/React.createElement(Box, {
|
|
37
46
|
className: newStyle.iconWrapper
|
|
@@ -4,12 +4,18 @@
|
|
|
4
4
|
border: 1px solid var(--imlib_chat_components_replyBubbleContent_border_color);
|
|
5
5
|
border-radius: 3px;
|
|
6
6
|
margin: var(--zd_size5) 0 ;
|
|
7
|
+
cursor: pointer;
|
|
7
8
|
}[dir=ltr] .replyBubbleContent {
|
|
8
9
|
padding: var(--zd_size10) var(--zd_size10) var(--zd_size10) var(--zd_size20) ;
|
|
9
10
|
}[dir=rtl] .replyBubbleContent {
|
|
10
11
|
padding: var(--zd_size10) var(--zd_size20) var(--zd_size10) var(--zd_size10) ;
|
|
11
12
|
}
|
|
12
13
|
|
|
14
|
+
.failedReplyBubbleContent{
|
|
15
|
+
background-color: var(--imlib_chat_components_replyBubbleContent_bg_color_failed);
|
|
16
|
+
border-color: var(--imlib_chat_components_replyBubbleContent_border_color_failed);
|
|
17
|
+
}
|
|
18
|
+
|
|
13
19
|
.replyBubbleContent::after {
|
|
14
20
|
content: '';
|
|
15
21
|
width: var(--zd_size2) ;
|
|
@@ -29,11 +35,20 @@
|
|
|
29
35
|
right: var(--zd_size10) ;
|
|
30
36
|
}
|
|
31
37
|
|
|
38
|
+
.failedReplyBubbleContent::after{
|
|
39
|
+
background-color: var(--imlib_chat_components_replyBubbleContent_line_color_failed);
|
|
40
|
+
}
|
|
41
|
+
|
|
32
42
|
.name {
|
|
33
|
-
color: var(--
|
|
43
|
+
color: var(--imlib_chat_components_replyBubbleContent_sender_color);
|
|
34
44
|
font-size: var(--zd_font_size15) ;
|
|
35
45
|
line-height: 1.5;
|
|
36
46
|
composes: dotted from "../../css/common.module.css";
|
|
47
|
+
font-family: var(--zd_semibold);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.failedReplyBubbleContent .name{
|
|
51
|
+
color: var(--imlib_chat_components_replyBubbleContent_sender_color_failed);
|
|
37
52
|
}
|
|
38
53
|
|
|
39
54
|
[dir=ltr] .iconWrapper {
|
|
@@ -45,13 +60,16 @@
|
|
|
45
60
|
}
|
|
46
61
|
|
|
47
62
|
.messageWrapper {
|
|
48
|
-
color: var(--
|
|
63
|
+
color: var(--imlib_chat_components_replyBubbleContent_content_color);
|
|
49
64
|
font-size: var(--zd_font_size13) ;
|
|
50
65
|
line-height: 1.5;
|
|
51
|
-
max-height: var(--zd_size40) ;
|
|
52
66
|
-webkit-line-clamp: 2;
|
|
53
67
|
display: -webkit-box;
|
|
54
68
|
-webkit-box-orient: vertical;
|
|
55
69
|
word-break: break-word;
|
|
56
70
|
overflow: hidden;
|
|
57
71
|
}
|
|
72
|
+
|
|
73
|
+
.failedReplyBubbleContent .messageWrapper{
|
|
74
|
+
color: var(--imlib_chat_components_replyBubbleContent_content_color_failed);
|
|
75
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { compileClassNames } from '@zohodesk/utils';
|
|
2
|
+
export default function cssJSLogic(props, style) {
|
|
3
|
+
const {
|
|
4
|
+
isFailed
|
|
5
|
+
} = props;
|
|
6
|
+
const replyBubbleContentClass = compileClassNames({
|
|
7
|
+
[style.replyBubbleContent]: true,
|
|
8
|
+
[style.failedReplyBubbleContent]: isFailed
|
|
9
|
+
});
|
|
10
|
+
return {
|
|
11
|
+
replyBubbleContentClass
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -4,6 +4,7 @@ const replyBubbleContentPropTypes = {
|
|
|
4
4
|
renderIcon: PropTypes.func.isRequired,
|
|
5
5
|
renderMessage: PropTypes.func.isRequired,
|
|
6
6
|
senderName: PropTypes.string.isRequired,
|
|
7
|
-
customStyle: PropTypes.object
|
|
7
|
+
customStyle: PropTypes.object,
|
|
8
|
+
isFailed: PropTypes.bool
|
|
8
9
|
};
|
|
9
10
|
export default replyBubbleContentPropTypes;
|
|
@@ -19,19 +19,32 @@ import ReplyIcon from '@zohodesk/icon/es/general/Reply';
|
|
|
19
19
|
/** ** Methods *** */
|
|
20
20
|
|
|
21
21
|
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
22
|
+
import cssJSLogic from './css/cssJSLogic';
|
|
22
23
|
export default function ReplyBubbleHeader(props) {
|
|
23
24
|
const {
|
|
24
25
|
customStyle,
|
|
25
26
|
replyText,
|
|
26
|
-
|
|
27
|
-
renderCustomReplyIcon
|
|
27
|
+
dateTimeDetails,
|
|
28
|
+
renderCustomReplyIcon,
|
|
29
|
+
isFailed
|
|
28
30
|
} = props;
|
|
31
|
+
const {
|
|
32
|
+
displayDateTime,
|
|
33
|
+
tooltip
|
|
34
|
+
} = dateTimeDetails;
|
|
29
35
|
/* External CSS Customization */
|
|
30
36
|
|
|
31
37
|
const newStyle = useMergeStyle(style, customStyle);
|
|
32
38
|
const iconStyle = useMemo(() => ({
|
|
33
39
|
base: newStyle.replyIcon
|
|
34
40
|
}), [newStyle.replyIcon]);
|
|
41
|
+
/* css classnames added based on logic */
|
|
42
|
+
|
|
43
|
+
const {
|
|
44
|
+
replyBubbleHeaderClass
|
|
45
|
+
} = cssJSLogic({
|
|
46
|
+
isFailed
|
|
47
|
+
}, newStyle);
|
|
35
48
|
const renderIcon = useCallback(() => {
|
|
36
49
|
const customIcon = renderHandler(renderCustomReplyIcon)();
|
|
37
50
|
return customIcon || /*#__PURE__*/React.createElement(ReplyIcon, {
|
|
@@ -40,13 +53,15 @@ export default function ReplyBubbleHeader(props) {
|
|
|
40
53
|
}, [iconStyle, renderCustomReplyIcon]);
|
|
41
54
|
return /*#__PURE__*/React.createElement(Container, {
|
|
42
55
|
align: "vertical",
|
|
43
|
-
alignBox: "row"
|
|
56
|
+
alignBox: "row",
|
|
57
|
+
className: replyBubbleHeaderClass
|
|
44
58
|
}, renderIcon(), /*#__PURE__*/React.createElement(Box, {
|
|
45
59
|
className: newStyle.replyText,
|
|
46
60
|
flexible: true
|
|
47
61
|
}, replyText), /*#__PURE__*/React.createElement(Box, {
|
|
48
|
-
className: newStyle.time
|
|
49
|
-
|
|
62
|
+
className: newStyle.time,
|
|
63
|
+
"data-title": tooltip
|
|
64
|
+
}, displayDateTime));
|
|
50
65
|
}
|
|
51
66
|
ReplyBubbleHeader.propTypes = replyBubbleHeaderPropTypes;
|
|
52
67
|
ReplyBubbleHeader.defaultProps = replyBubbleHeaderDefaultProps;
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
.replyText {
|
|
13
13
|
font-size: var(--zd_font_size14) ;
|
|
14
|
+
color: var(--imlib_chat_components_replyBubbleHeader_text_color);
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
[dir=ltr] .replyText {
|
|
@@ -21,6 +22,10 @@
|
|
|
21
22
|
margin-left: var(--zd_size5) ;
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
.failedReplyBubbleHeader .replyText{
|
|
26
|
+
color: var(--imlib_chat_components_replyBubbleHeader_text_color_failed);
|
|
27
|
+
}
|
|
28
|
+
|
|
24
29
|
.replyText,
|
|
25
30
|
.time{
|
|
26
31
|
composes: dotted from "../../css/common.module.css";
|
|
@@ -28,4 +33,11 @@
|
|
|
28
33
|
|
|
29
34
|
.time{
|
|
30
35
|
max-width: 40% ;
|
|
36
|
+
font-size: var(--zd_font_size11) ;
|
|
37
|
+
letter-spacing: .4px;
|
|
38
|
+
color: var(--imlib_chat_components_replyBubbleHeader_time_color);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.failedReplyBubbleHeader .time{
|
|
42
|
+
color: var(--imlib_chat_components_replyBubbleHeader_time_color_failed);
|
|
31
43
|
}
|
|
@@ -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 replyBubbleHeaderClass = compileClassNames({
|
|
7
|
+
[style.failedReplyBubbleHeader]: isFailed
|
|
8
|
+
});
|
|
9
|
+
return {
|
|
10
|
+
replyBubbleHeaderClass
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** ** Constants *** */
|
|
2
2
|
import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
|
|
3
3
|
const replyBubbleHeaderDefaultProps = {
|
|
4
|
-
customStyle: dummyObject
|
|
4
|
+
customStyle: dummyObject,
|
|
5
|
+
dateTimeDetails: dummyObject
|
|
5
6
|
};
|
|
6
7
|
export default replyBubbleHeaderDefaultProps;
|
|
@@ -3,7 +3,11 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
const replyBubbleHeaderPropTypes = {
|
|
4
4
|
replyText: PropTypes.string.isRequired,
|
|
5
5
|
customStyle: PropTypes.object,
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
dateTimeDetails: PropTypes.shape({
|
|
7
|
+
displayDateTime: PropTypes.string,
|
|
8
|
+
tooltip: PropTypes.string
|
|
9
|
+
}),
|
|
10
|
+
renderCustomReplyIcon: PropTypes.func,
|
|
11
|
+
isFailed: PropTypes.bool
|
|
8
12
|
};
|
|
9
13
|
export default replyBubbleHeaderPropTypes;
|
|
@@ -10,25 +10,37 @@ import textBubblePropTypes from './props/propTypes';
|
|
|
10
10
|
/** ** Styles *** */
|
|
11
11
|
|
|
12
12
|
import style from './css/TextBubble.module.css';
|
|
13
|
+
/** ** Methods *** */
|
|
14
|
+
|
|
15
|
+
import cssJSLogic from './css/cssJSLogic';
|
|
13
16
|
export default function TextBubble(props) {
|
|
14
17
|
const {
|
|
15
18
|
customStyle,
|
|
16
19
|
moreText,
|
|
17
20
|
message,
|
|
18
|
-
onClickMore
|
|
21
|
+
onClickMore,
|
|
22
|
+
isFailed
|
|
19
23
|
} = props;
|
|
20
24
|
/* External CSS Customization */
|
|
21
25
|
|
|
22
26
|
const newStyle = useMergeStyle(style, customStyle);
|
|
27
|
+
/* css classnames added based on logic */
|
|
28
|
+
|
|
29
|
+
const {
|
|
30
|
+
textBubbleClass,
|
|
31
|
+
moreTextClass
|
|
32
|
+
} = cssJSLogic({
|
|
33
|
+
isFailed
|
|
34
|
+
}, newStyle);
|
|
23
35
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
24
|
-
className:
|
|
36
|
+
className: textBubbleClass // eslint-disable-next-line react/no-danger, @zohodesk/zsecurity/no-unsecure-html
|
|
25
37
|
,
|
|
26
38
|
dangerouslySetInnerHTML: {
|
|
27
39
|
// __html: HTMLPurifier.sanitize(message)
|
|
28
40
|
__html: message
|
|
29
41
|
}
|
|
30
42
|
}), moreText ? /*#__PURE__*/React.createElement("div", {
|
|
31
|
-
className:
|
|
43
|
+
className: moreTextClass,
|
|
32
44
|
onClick: onClickMore
|
|
33
45
|
}, moreText) : null);
|
|
34
46
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
.textBubble {
|
|
2
2
|
/* Use this class name for css customisation */
|
|
3
|
+
color: var(--imlib_chat_components_textBubble_text_color);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.failedTextBubble{
|
|
7
|
+
color: var(--imlib_chat_components_textBubble_text_color_failed);
|
|
3
8
|
}
|
|
4
9
|
|
|
5
10
|
.moreText {
|
|
@@ -9,6 +14,10 @@
|
|
|
9
14
|
cursor: pointer;
|
|
10
15
|
}
|
|
11
16
|
|
|
17
|
+
.failedMoreText{
|
|
18
|
+
color: var(--imlib_chat_components_textBubble_see_more_color_failed);
|
|
19
|
+
}
|
|
20
|
+
|
|
12
21
|
.textBubble a {
|
|
13
22
|
color: var(--imlib_chat_components_textBubble_url_color);
|
|
14
23
|
word-break: break-word;
|
|
@@ -18,3 +27,7 @@
|
|
|
18
27
|
text-decoration: underline !important;
|
|
19
28
|
/* !important for Desk css overwrite */
|
|
20
29
|
}
|
|
30
|
+
|
|
31
|
+
.failedTextBubble a{
|
|
32
|
+
color: var(--imlib_chat_components_textBubble_url_color_failed);
|
|
33
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { compileClassNames } from '@zohodesk/utils';
|
|
2
|
+
export default function cssJSLogic(props, style) {
|
|
3
|
+
const {
|
|
4
|
+
isFailed
|
|
5
|
+
} = props;
|
|
6
|
+
const textBubbleClass = compileClassNames({
|
|
7
|
+
[style.textBubble]: true,
|
|
8
|
+
[style.failedTextBubble]: isFailed
|
|
9
|
+
});
|
|
10
|
+
const moreTextClass = compileClassNames({
|
|
11
|
+
[style.moreText]: true,
|
|
12
|
+
[style.failedMoreText]: isFailed
|
|
13
|
+
});
|
|
14
|
+
return {
|
|
15
|
+
textBubbleClass,
|
|
16
|
+
moreTextClass
|
|
17
|
+
};
|
|
18
|
+
}
|