@zohoim/chat-components 0.0.19 → 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.
- package/es/ActionIcon/css/ActionIcon.module.css +3 -4
- package/es/AttachmentBubble/AttachmentBubble.js +9 -6
- package/es/AttachmentBubble/css/cssJSLogic.js +2 -3
- package/es/AttachmentBubble/props/propTypes.js +2 -1
- package/es/AttachmentBubbleInfo/AttachmentBubbleInfo.js +2 -1
- package/es/AttachmentBubbleInfo/css/AttachmentBubbleInfo.module.css +1 -0
- package/es/ImageBubble/ImageBubble.js +11 -5
- package/es/ImageBubble/css/ImageBubble.module.css +8 -1
- package/es/ImageBubble/css/cssJSLogic.js +4 -2
- package/es/ImageBubble/props/propTypes.js +3 -1
- package/es/LocationBubble/LocationBubble.js +13 -13
- package/es/LocationBubble/css/LocationBubble.module.css +11 -10
- package/es/Message/Message.js +3 -2
- package/es/Message/props/propTypes.js +1 -0
- package/es/MessageActions/MessageActions.js +4 -6
- package/es/MessageActionsMore/MessageActionsMore.js +1 -1
- package/es/MessageBox/css/MessageBox.module.css +0 -3
- package/es/MessageBubble/MessageBubble.js +10 -5
- package/es/MessageBubble/css/MessageBubble.module.css +24 -23
- package/es/MessageStatus/MessageStatus.js +7 -2
- package/es/MessageStatus/css/MessageStatus.module.css +8 -3
- package/es/ReplyBubble/ReplyBubble.js +14 -5
- package/es/ReplyBubble/css/ReplyBubble.module.css +6 -0
- package/es/ReplyBubble/css/cssJSLogic.js +14 -0
- package/es/ReplyBubbleContent/ReplyBubbleContent.js +4 -2
- package/es/ReplyBubbleContent/props/propTypes.js +2 -1
- package/es/ReplyBubbleHeader/ReplyBubbleHeader.js +8 -2
- package/es/ReplyBubbleHeader/css/ReplyBubbleHeader.module.css +1 -1
- package/es/TextBubble/css/TextBubble.module.css +0 -2
- package/es/Theme/themeVariables/dark/blueTheme.js +17 -7
- package/es/Theme/themeVariables/dark/greenTheme.js +17 -7
- package/es/Theme/themeVariables/dark/orangeTheme.js +17 -7
- package/es/Theme/themeVariables/dark/redTheme.js +17 -7
- package/es/Theme/themeVariables/dark/yellowTheme.js +17 -7
- package/es/Theme/themeVariables/light/blueTheme.js +17 -7
- package/es/Theme/themeVariables/light/greenTheme.js +17 -7
- package/es/Theme/themeVariables/light/orangeTheme.js +17 -7
- package/es/Theme/themeVariables/light/redTheme.js +17 -7
- package/es/Theme/themeVariables/light/yellowTheme.js +17 -7
- package/es/Theme/themeVariables/pureDark/blueTheme.js +17 -7
- package/es/Theme/themeVariables/pureDark/greenTheme.js +17 -7
- package/es/Theme/themeVariables/pureDark/orangeTheme.js +17 -7
- package/es/Theme/themeVariables/pureDark/redTheme.js +17 -7
- package/es/Theme/themeVariables/pureDark/yellowTheme.js +17 -7
- package/es/Video/css/Video.module.css +1 -0
- package/es/VideoBubble/VideoBubble.js +12 -2
- package/es/VideoBubble/css/VideoBubble.module.css +9 -1
- package/es/VideoBubble/css/cssJSLogic.js +14 -0
- package/es/im/IMIntegrationIcon/IMIntegrationIcon.js +17 -31
- package/es/im/IMIntegrationIcon/css/IMIntegrationIcon.module.css +8 -0
- package/es/im/IMMessage/IMMessage.js +13 -6
- package/es/im/IMMessage/css/cssJSLogic.js +4 -12
- package/es/im/IMMessage/props/defaultProps.js +3 -1
- package/es/im/IMMessage/props/propTypes.js +2 -1
- package/es/im/IMMessageContent/IMMessageContent.js +14 -7
- package/es/im/IMMessageContent/css/IMMessageContent.module.css +1 -0
- package/es/im/IMMessageContent/props/defaultProps.js +2 -1
- package/es/im/IMMessageContent/props/propTypes.js +3 -1
- package/package.json +5 -4
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
.varClass {
|
|
2
|
-
--actionIcon_icon_size:
|
|
2
|
+
--actionIcon_icon_size: 15px;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.icon {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
height: var(--actionIcon_icon_size);
|
|
6
|
+
width: var(--zd_size15) ;
|
|
7
|
+
height: var(--zd_size15) ;
|
|
9
8
|
}
|
|
@@ -26,7 +26,8 @@ export default function AttachmentBubble(props) {
|
|
|
26
26
|
customStyle,
|
|
27
27
|
customProps,
|
|
28
28
|
attachmentDetails,
|
|
29
|
-
isFailed
|
|
29
|
+
isFailed,
|
|
30
|
+
onClick: propOnClick
|
|
30
31
|
} = props;
|
|
31
32
|
const {
|
|
32
33
|
attachmentBubbleInfoProps,
|
|
@@ -36,9 +37,11 @@ export default function AttachmentBubble(props) {
|
|
|
36
37
|
formattedFileSize: fileSize,
|
|
37
38
|
fileName,
|
|
38
39
|
fileFormat,
|
|
39
|
-
mediaType
|
|
40
|
+
mediaType,
|
|
41
|
+
onClick
|
|
40
42
|
} = useAttachmentBubble({
|
|
41
|
-
attachmentDetails
|
|
43
|
+
attachmentDetails,
|
|
44
|
+
onClick: propOnClick
|
|
42
45
|
});
|
|
43
46
|
/* External CSS Customization */
|
|
44
47
|
|
|
@@ -48,13 +51,13 @@ export default function AttachmentBubble(props) {
|
|
|
48
51
|
const {
|
|
49
52
|
attachmentBubbleClass
|
|
50
53
|
} = cssJSLogic({
|
|
51
|
-
isFailed
|
|
52
|
-
fileFormat
|
|
54
|
+
isFailed
|
|
53
55
|
}, newStyle);
|
|
54
56
|
return /*#__PURE__*/React.createElement(Container, {
|
|
55
57
|
alignBox: "row",
|
|
56
58
|
className: attachmentBubbleClass,
|
|
57
|
-
isCover: false
|
|
59
|
+
isCover: false,
|
|
60
|
+
onClick: onClick
|
|
58
61
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
59
62
|
className: newStyle.attachmentBubbleIcon
|
|
60
63
|
}, /*#__PURE__*/React.createElement(AttachmentIcon, _extends({
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { compileClassNames } from '@zohodesk/utils';
|
|
2
2
|
export default function cssJSLogic(props, style) {
|
|
3
3
|
const {
|
|
4
|
-
isFailed
|
|
5
|
-
fileFormat
|
|
4
|
+
isFailed
|
|
6
5
|
} = props;
|
|
7
6
|
const attachmentBubbleClass = compileClassNames({
|
|
8
7
|
[style.attachmentBubble]: true,
|
|
9
8
|
[style.failedAttachmentBubble]: isFailed,
|
|
10
|
-
[style.attachmentBubbleCursor]:
|
|
9
|
+
[style.attachmentBubbleCursor]: true
|
|
11
10
|
});
|
|
12
11
|
return {
|
|
13
12
|
attachmentBubbleClass
|
|
@@ -37,7 +37,8 @@ export default function AttachmentBubbleInfo(props) {
|
|
|
37
37
|
className: attachmentBubbleInfoClass,
|
|
38
38
|
isCover: false
|
|
39
39
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
40
|
-
className: newStyle.fileName
|
|
40
|
+
className: newStyle.fileName,
|
|
41
|
+
"data-title": fileName
|
|
41
42
|
}, fileName), /*#__PURE__*/React.createElement(Box, {
|
|
42
43
|
className: newStyle.fileSize
|
|
43
44
|
}, fileSize));
|
|
@@ -22,7 +22,9 @@ export default function ImageBubble(props) {
|
|
|
22
22
|
const {
|
|
23
23
|
customStyle,
|
|
24
24
|
imageDetails,
|
|
25
|
-
isFailed
|
|
25
|
+
isFailed,
|
|
26
|
+
isSending,
|
|
27
|
+
onClick: propOnClick
|
|
26
28
|
} = props;
|
|
27
29
|
/* External CSS Customization */
|
|
28
30
|
|
|
@@ -32,7 +34,8 @@ export default function ImageBubble(props) {
|
|
|
32
34
|
const {
|
|
33
35
|
imageBubbleClass
|
|
34
36
|
} = cssJSLogic({
|
|
35
|
-
isFailed
|
|
37
|
+
isFailed,
|
|
38
|
+
isSending
|
|
36
39
|
}, newStyle);
|
|
37
40
|
const imageStyle = useMemo(() => ({
|
|
38
41
|
lazyLoadImage: newStyle.image
|
|
@@ -42,13 +45,16 @@ export default function ImageBubble(props) {
|
|
|
42
45
|
}), [newStyle.blurImage]);
|
|
43
46
|
const {
|
|
44
47
|
attachmentURL: src,
|
|
45
|
-
fileName: alternate
|
|
48
|
+
fileName: alternate,
|
|
49
|
+
onClick
|
|
46
50
|
} = useAttachmentBubble({
|
|
47
|
-
attachmentDetails: imageDetails
|
|
51
|
+
attachmentDetails: imageDetails,
|
|
52
|
+
onClick: propOnClick
|
|
48
53
|
});
|
|
49
54
|
return /*#__PURE__*/React.createElement(Container, {
|
|
50
55
|
align: "both",
|
|
51
|
-
className: imageBubbleClass
|
|
56
|
+
className: imageBubbleClass,
|
|
57
|
+
onClick: onClick
|
|
52
58
|
}, /*#__PURE__*/React.createElement(LazyLoadImage, {
|
|
53
59
|
alternate: alternate,
|
|
54
60
|
customStyle: blurImageStyle,
|
|
@@ -20,11 +20,13 @@
|
|
|
20
20
|
cursor: pointer;
|
|
21
21
|
background-color: var(--imlib_chat_components_imageBubble_bg_color);
|
|
22
22
|
border-radius: 3px;
|
|
23
|
+
border: 1px solid var(--imlib_chat_components_imageBubble_border_color);
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
.failedImageBubble{
|
|
26
|
+
.failedImageBubble {
|
|
26
27
|
color: var(--imlib_chat_components_imageBubble_alt_text_color_failed);
|
|
27
28
|
background-color: var(--imlib_chat_components_imageBubble_bg_color_failed);
|
|
29
|
+
border-color: var(--imlib_chat_components_imageBubble_border_color_failed);
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
.blurImage {
|
|
@@ -54,3 +56,8 @@
|
|
|
54
56
|
object-fit: contain;
|
|
55
57
|
position: relative;
|
|
56
58
|
}
|
|
59
|
+
|
|
60
|
+
.sendingImageBubble {
|
|
61
|
+
opacity: 0.1;
|
|
62
|
+
cursor: default;
|
|
63
|
+
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { compileClassNames } from '@zohodesk/utils';
|
|
2
2
|
export default function cssJSLogic(props, style) {
|
|
3
3
|
const {
|
|
4
|
-
isFailed
|
|
4
|
+
isFailed,
|
|
5
|
+
isSending
|
|
5
6
|
} = props;
|
|
6
7
|
const imageBubbleClass = compileClassNames({
|
|
7
8
|
[style.imageBubbleWrapper]: true,
|
|
8
|
-
[style.failedImageBubble]: isFailed
|
|
9
|
+
[style.failedImageBubble]: isFailed,
|
|
10
|
+
[style.sendingImageBubble]: isSending
|
|
9
11
|
});
|
|
10
12
|
return {
|
|
11
13
|
imageBubbleClass
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @zohodesk/zsecurity/no-protocol-check */
|
|
4
|
+
|
|
1
5
|
/** ** Libraries *** */
|
|
2
6
|
import React from 'react';
|
|
3
7
|
/** ** Hooks *** */
|
|
@@ -32,7 +36,12 @@ export default function LocationBubble(props) {
|
|
|
32
36
|
} = cssJSLogic({
|
|
33
37
|
isFailed
|
|
34
38
|
}, newStyle);
|
|
35
|
-
return /*#__PURE__*/React.createElement(
|
|
39
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
40
|
+
className: newStyle.container,
|
|
41
|
+
href: locationUrl,
|
|
42
|
+
rel: "noreferrer noopener",
|
|
43
|
+
target: "_blank"
|
|
44
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
36
45
|
align: "vertical",
|
|
37
46
|
alignBox: "row",
|
|
38
47
|
className: locationBubbleClass,
|
|
@@ -40,21 +49,12 @@ export default function LocationBubble(props) {
|
|
|
40
49
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
41
50
|
className: newStyle.imageWrapper,
|
|
42
51
|
shrink: true
|
|
43
|
-
}, /*#__PURE__*/React.createElement(
|
|
44
|
-
href: locationUrl,
|
|
45
|
-
rel: "noreferrer noopener",
|
|
46
|
-
target: "_blank"
|
|
47
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
48
|
-
className: newStyle.image
|
|
49
|
-
}))), /*#__PURE__*/React.createElement(Box, {
|
|
52
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
50
53
|
className: newStyle.textWrapper,
|
|
51
54
|
flexible: true
|
|
52
55
|
}, /*#__PURE__*/React.createElement("a", {
|
|
53
|
-
className: newStyle.textLink
|
|
54
|
-
|
|
55
|
-
rel: "noreferrer noopener",
|
|
56
|
-
target: "_blank"
|
|
57
|
-
}, locationUrl)));
|
|
56
|
+
className: newStyle.textLink
|
|
57
|
+
}, locationUrl))));
|
|
58
58
|
}
|
|
59
59
|
LocationBubble.propTypes = locationBubblePropTypes;
|
|
60
60
|
LocationBubble.defaultProps = locationBubbleDefaultProps;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
.imageWrapper {
|
|
2
2
|
width: var(--zd_size60) ;
|
|
3
3
|
height: var(--zd_size60) ;
|
|
4
|
+
background-image: url('../images/location.png');
|
|
5
|
+
background-repeat: no-repeat;
|
|
6
|
+
background-size: cover;
|
|
7
|
+
border-radius: 3px;
|
|
4
8
|
}
|
|
5
9
|
|
|
6
10
|
.locationBubble {
|
|
@@ -18,15 +22,6 @@
|
|
|
18
22
|
border-color: var(--imlib_chat_components_locationBubble_border_color_failed);
|
|
19
23
|
}
|
|
20
24
|
|
|
21
|
-
.image {
|
|
22
|
-
width: 100% ;
|
|
23
|
-
height: 100% ;
|
|
24
|
-
background-image: url('../images/location.png');
|
|
25
|
-
background-repeat: no-repeat;
|
|
26
|
-
background-size: cover;
|
|
27
|
-
border-radius: 3px;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
25
|
[dir=ltr] .textWrapper {
|
|
31
26
|
margin: 0 0 0 var(--zd_size8) ;
|
|
32
27
|
}
|
|
@@ -39,12 +34,18 @@
|
|
|
39
34
|
display: block;
|
|
40
35
|
composes: dotted from "../../css/common.module.css";
|
|
41
36
|
color: var(--imlib_chat_components_locationBubble_url_color);
|
|
37
|
+
font-family: var(--zd_semibold);
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
.failedLocationBubble .textLink{
|
|
45
41
|
color: var(--imlib_chat_components_locationBubble_url_color_failed);
|
|
46
42
|
}
|
|
47
43
|
|
|
48
|
-
.
|
|
44
|
+
.container{
|
|
45
|
+
display: flex;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.container:hover .textLink{
|
|
49
50
|
text-decoration: underline !important;
|
|
50
51
|
}
|
package/es/Message/Message.js
CHANGED
|
@@ -28,6 +28,7 @@ export default function Message(props) {
|
|
|
28
28
|
renderOwnerStatusIcon,
|
|
29
29
|
status,
|
|
30
30
|
statusTooltip,
|
|
31
|
+
isShowMessageStatus,
|
|
31
32
|
actions,
|
|
32
33
|
renderSecondaryActions,
|
|
33
34
|
onSelectAction,
|
|
@@ -84,8 +85,8 @@ export default function Message(props) {
|
|
|
84
85
|
messageStatus: status,
|
|
85
86
|
title: statusTooltip
|
|
86
87
|
};
|
|
87
|
-
return status ? /*#__PURE__*/React.createElement(MessageStatus, _extends({}, props, messageStatusProps)) : null;
|
|
88
|
-
}, [status, statusTooltip, messageStatusProps]);
|
|
88
|
+
return isShowMessageStatus && status ? /*#__PURE__*/React.createElement(MessageStatus, _extends({}, props, messageStatusProps)) : null;
|
|
89
|
+
}, [status, statusTooltip, isShowMessageStatus, messageStatusProps]);
|
|
89
90
|
/** ** Render MessageBox *** */
|
|
90
91
|
|
|
91
92
|
const handleRenderMessageBox = useCallback(() => {
|
|
@@ -19,6 +19,7 @@ const messagePropTypes = {
|
|
|
19
19
|
renderOwnerStatusIcon: PropTypes.func,
|
|
20
20
|
status: PropTypes.oneOf(Object.values(messageStatusConstants)),
|
|
21
21
|
statusTooltip: PropTypes.string,
|
|
22
|
+
isShowMessageStatus: PropTypes.bool,
|
|
22
23
|
actions: PropTypes.arrayOf(PropTypes.shape({
|
|
23
24
|
displayText: PropTypes.string.isRequired,
|
|
24
25
|
id: PropTypes.oneOfType([PropTypes.string, PropTypes.oneOf(Object.values(defaultMessageActions))]).isRequired,
|
|
@@ -14,9 +14,6 @@ import MoreIcon from '@zohodesk/icon/es/general/More';
|
|
|
14
14
|
|
|
15
15
|
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
16
16
|
import useMessageActions from '@zohoim/chat-components-hooks/es/MessageActions/useMessageActions';
|
|
17
|
-
/** ** Methods *** */
|
|
18
|
-
|
|
19
|
-
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
20
17
|
/** ** Constants *** */
|
|
21
18
|
|
|
22
19
|
import messageActionsDefaultProps from './props/defaultProps';
|
|
@@ -92,10 +89,12 @@ export default function MessageActions(props) {
|
|
|
92
89
|
/* Hooks handling */
|
|
93
90
|
|
|
94
91
|
const {
|
|
95
|
-
actionDetails
|
|
92
|
+
actionDetails,
|
|
93
|
+
secondaryActions
|
|
96
94
|
} = useMessageActions({
|
|
97
95
|
actions,
|
|
98
|
-
defaultRenderFunction: renderAction
|
|
96
|
+
defaultRenderFunction: renderAction,
|
|
97
|
+
renderSecondaryActions
|
|
99
98
|
});
|
|
100
99
|
const {
|
|
101
100
|
allActions
|
|
@@ -108,7 +107,6 @@ export default function MessageActions(props) {
|
|
|
108
107
|
const renderMore = useCallback(() => /*#__PURE__*/React.createElement(ActionIconWrapper, _extends({
|
|
109
108
|
renderIcon: renderMoreIcon
|
|
110
109
|
}, actionIconWrapperProps)), [actionIconWrapperProps, renderMoreIcon]);
|
|
111
|
-
const secondaryActions = renderHandler(renderSecondaryActions)();
|
|
112
110
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(MessageActionsWrapper, _extends({
|
|
113
111
|
actions: allActions,
|
|
114
112
|
defaultShowCount: defaultShowCount,
|
|
@@ -88,7 +88,7 @@ function MessageActionsMoreComp(props) {
|
|
|
88
88
|
}, renderActions()) : null);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
const MessageActionsMore = Popup(MessageActionsMoreComp,
|
|
91
|
+
const MessageActionsMore = Popup(MessageActionsMoreComp, undefined, undefined, {
|
|
92
92
|
isAbsolutePositioningNeeded: false
|
|
93
93
|
});
|
|
94
94
|
MessageActionsMoreComp.defaultProps = messageActionsMoreDefaultProps;
|
|
@@ -5,17 +5,14 @@
|
|
|
5
5
|
--messageBox-message_status_gap: var(--zd_size12);
|
|
6
6
|
--messageBox-message_header_gap: var(--zd_size1);
|
|
7
7
|
--messageBox-message_footer_gap: var(--zd_size1);
|
|
8
|
-
/* --messageBox-max_width: 410px; */
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
.messageBoxContainer {
|
|
12
11
|
composes: varClass;
|
|
13
12
|
display: grid;
|
|
14
|
-
/* flex-direction: row; */
|
|
15
13
|
grid-template-columns: 1fr auto;
|
|
16
14
|
align-items: flex-end;
|
|
17
15
|
color: var(--imlib_chat_components_messageBox_text_color);
|
|
18
|
-
/* max-width: var(--messageBox-max_width); */
|
|
19
16
|
word-wrap: break-word;
|
|
20
17
|
font-size: var(--messageBox-content_size);
|
|
21
18
|
box-sizing: border-box;
|
|
@@ -73,17 +73,22 @@ export default function MessageBubble(props) {
|
|
|
73
73
|
|
|
74
74
|
const messageBoxRenderer = useCallback(() => {
|
|
75
75
|
const messageBox = renderHandler(renderMessageBox)();
|
|
76
|
-
return messageBox ?
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
76
|
+
return messageBox; // return messageBox ? (
|
|
77
|
+
// <Box flexible className={newStyle.messageBoxWrapper}>
|
|
78
|
+
// {messageBox}
|
|
79
|
+
// </Box>
|
|
80
|
+
// ) : null;
|
|
81
|
+
}, [renderMessageBox]);
|
|
80
82
|
/* Message BoxWithActions Render */
|
|
81
83
|
|
|
82
84
|
const messageBox = useMemo(() => messageBoxRenderer(), [messageBoxRenderer]);
|
|
83
85
|
const messageActions = useMemo(() => messageActionsRenderer(), [messageActionsRenderer]);
|
|
84
86
|
const messageBoxWithActionsRenderer = useCallback(() => messageBox || messageActions ? /*#__PURE__*/React.createElement(Box, {
|
|
85
87
|
className: newStyle.messageContainer
|
|
86
|
-
},
|
|
88
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
89
|
+
className: newStyle.messageBoxWrapper,
|
|
90
|
+
flexible: true
|
|
91
|
+
}, messageBox, messageActions)) : null, [messageBox, messageActions, newStyle.messageContainer, newStyle.messageBoxWrapper]);
|
|
87
92
|
/* Message Footer Render */
|
|
88
93
|
|
|
89
94
|
const messageFooterRenderer = useCallback(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.varClass {
|
|
2
2
|
--messageBubble-bubble_footer_gap: var(--zd_size5);
|
|
3
3
|
--messageBubble-message_owner_gap: 13px;
|
|
4
|
-
--messageBox-max_width:
|
|
4
|
+
--messageBox-max_width: 410px;
|
|
5
5
|
--messageBox-footer_fontSize: var(--zd_font_size11);
|
|
6
6
|
--messageBox-owner_width: var(--zd_size34);
|
|
7
7
|
}
|
|
@@ -17,17 +17,19 @@
|
|
|
17
17
|
grid-area: messageOwner;
|
|
18
18
|
align-self: end;
|
|
19
19
|
width: var(--messageBox-owner_width);
|
|
20
|
+
display: flex;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
.messageContainer {
|
|
23
24
|
grid-area: messageContainer;
|
|
24
|
-
display:
|
|
25
|
-
|
|
25
|
+
display: inline-block;
|
|
26
|
+
max-width: 70% ;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
.messageBoxWrapper {
|
|
29
30
|
grid-area: messageBox;
|
|
30
|
-
|
|
31
|
+
display: inline-block;
|
|
32
|
+
position: relative;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
.messageActionWrapper {
|
|
@@ -35,15 +37,33 @@
|
|
|
35
37
|
width: var(--zd_size78) ;
|
|
36
38
|
display: flex;
|
|
37
39
|
flex-direction: column;
|
|
40
|
+
position: absolute;
|
|
41
|
+
top:0 ;
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
.messageActionWrapperEnd {
|
|
41
45
|
align-items: flex-end;
|
|
42
46
|
}
|
|
43
47
|
|
|
48
|
+
[dir=ltr] .messageActionWrapperEnd {
|
|
49
|
+
right: calc(100% + (var(--zd_size12)));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
[dir=rtl] .messageActionWrapperEnd {
|
|
53
|
+
left: calc(100% + (var(--zd_size12)));
|
|
54
|
+
}
|
|
55
|
+
|
|
44
56
|
.messageActionWrapperStart {
|
|
45
57
|
align-items: flex-start;
|
|
46
58
|
}
|
|
59
|
+
|
|
60
|
+
[dir=ltr] .messageActionWrapperStart {
|
|
61
|
+
left: calc(100% + (var(--zd_size12)));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
[dir=rtl] .messageActionWrapperStart {
|
|
65
|
+
right: calc(100% + (var(--zd_size12)));
|
|
66
|
+
}
|
|
47
67
|
.messageBoxFooterWrapper {
|
|
48
68
|
grid-area: messageBoxFooter;
|
|
49
69
|
font-size: var(--messageBox-footer_fontSize);
|
|
@@ -72,22 +92,3 @@
|
|
|
72
92
|
justify-items: end;
|
|
73
93
|
}
|
|
74
94
|
|
|
75
|
-
.directionIn .messageContainer {
|
|
76
|
-
grid-template-columns: auto 1fr;
|
|
77
|
-
grid-template-areas: 'messageBox messageAction';
|
|
78
|
-
margin-inline-end: 78px;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.isHovered.directionIn .messageContainer {
|
|
82
|
-
margin-inline-end: 0;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.directionOut .messageContainer {
|
|
86
|
-
grid-template-columns: 1fr auto;
|
|
87
|
-
grid-template-areas: 'messageAction messageBox';
|
|
88
|
-
margin-inline-start: 78px;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.isHovered.directionOut .messageContainer {
|
|
92
|
-
margin-inline-start: 0;
|
|
93
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** ** Libraries *** */
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
3
|
/** ** Hooks *** */
|
|
4
4
|
|
|
5
5
|
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
@@ -51,6 +51,9 @@ export default function MessageStatus(props) {
|
|
|
51
51
|
/* External CSS Customization */
|
|
52
52
|
|
|
53
53
|
const newStyle = useMergeStyle(style, customStyle);
|
|
54
|
+
const iconStyle = useMemo(() => ({
|
|
55
|
+
base: newStyle.icon
|
|
56
|
+
}), [newStyle.icon]);
|
|
54
57
|
/* CSS classnames added based on logic */
|
|
55
58
|
|
|
56
59
|
const {
|
|
@@ -65,7 +68,9 @@ export default function MessageStatus(props) {
|
|
|
65
68
|
return IconComponent || customIcon ? /*#__PURE__*/React.createElement("div", {
|
|
66
69
|
className: statusClass,
|
|
67
70
|
"data-title": title
|
|
68
|
-
}, customIcon || /*#__PURE__*/React.createElement(IconComponent,
|
|
71
|
+
}, customIcon || /*#__PURE__*/React.createElement(IconComponent, {
|
|
72
|
+
customStyle: iconStyle
|
|
73
|
+
})) : null;
|
|
69
74
|
}
|
|
70
75
|
MessageStatus.propTypes = messageStatusPropTypes;
|
|
71
76
|
MessageStatus.defaultProps = messageStatusDefaultProps;
|
|
@@ -3,10 +3,15 @@
|
|
|
3
3
|
color: var(--imlib_chat_components_messageStatus_send_color);
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.readStatus{
|
|
6
|
+
.readStatus {
|
|
7
7
|
color: var(--imlib_chat_components_messageStatus_read_color);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
.failedStatus{
|
|
10
|
+
.failedStatus {
|
|
11
11
|
color: var(--imlib_chat_components_messageStatus_failed_color);
|
|
12
|
-
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.icon {
|
|
15
|
+
width: var(--zd_size14) ;
|
|
16
|
+
height: var(--zd_size14) ;
|
|
17
|
+
}
|
|
@@ -13,6 +13,9 @@ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyCon
|
|
|
13
13
|
/** ** Styles *** */
|
|
14
14
|
|
|
15
15
|
import style from './css/ReplyBubble.module.css';
|
|
16
|
+
/** ** Methods *** */
|
|
17
|
+
|
|
18
|
+
import cssJSLogic from './css/cssJSLogic';
|
|
16
19
|
/** ** Components *** */
|
|
17
20
|
|
|
18
21
|
import ReplyBubbleHeader from '../ReplyBubbleHeader/ReplyBubbleHeader';
|
|
@@ -46,6 +49,13 @@ export default function ReplyBubble(props) {
|
|
|
46
49
|
/* External CSS Customization */
|
|
47
50
|
|
|
48
51
|
const newStyle = useMergeStyle(style, customStyle);
|
|
52
|
+
/* css classnames added based on logic */
|
|
53
|
+
|
|
54
|
+
const {
|
|
55
|
+
imageWrapperClass
|
|
56
|
+
} = cssJSLogic({
|
|
57
|
+
isFailed
|
|
58
|
+
}, newStyle);
|
|
49
59
|
const iconStyle = useMemo(() => ({
|
|
50
60
|
$icon: newStyle.attachmentIcon
|
|
51
61
|
}), [newStyle.attachmentIcon]);
|
|
@@ -71,7 +81,7 @@ export default function ReplyBubble(props) {
|
|
|
71
81
|
const renderIcon = useCallback(() => {
|
|
72
82
|
if (fileURL) {
|
|
73
83
|
return /*#__PURE__*/React.createElement("div", {
|
|
74
|
-
className:
|
|
84
|
+
className: imageWrapperClass
|
|
75
85
|
}, /*#__PURE__*/React.createElement("img", {
|
|
76
86
|
alt: fileName,
|
|
77
87
|
className: newStyle.image,
|
|
@@ -88,15 +98,14 @@ export default function ReplyBubble(props) {
|
|
|
88
98
|
}
|
|
89
99
|
|
|
90
100
|
return null;
|
|
91
|
-
}, [fileURL, fileName, fileFormat, mediaType, iconStyle, iconProps, newStyle.
|
|
92
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
93
|
-
onClick: onClick
|
|
94
|
-
}, /*#__PURE__*/React.createElement(ReplyBubbleHeader, _extends({
|
|
101
|
+
}, [fileURL, fileName, fileFormat, mediaType, iconStyle, iconProps, newStyle.image, imageWrapperClass]);
|
|
102
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ReplyBubbleHeader, _extends({
|
|
95
103
|
dateTimeDetails: dateTimeDetails,
|
|
96
104
|
isFailed: isFailed,
|
|
97
105
|
replyText: replyText
|
|
98
106
|
}, headerProps)), /*#__PURE__*/React.createElement(ReplyBubbleContent, _extends({
|
|
99
107
|
isFailed: isFailed,
|
|
108
|
+
onClick: onClick,
|
|
100
109
|
renderIcon: renderIcon,
|
|
101
110
|
renderMessage: renderMessage,
|
|
102
111
|
senderName: senderName
|
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
height: var(--zd_size60) ;
|
|
8
8
|
width: var(--zd_size60) ;
|
|
9
9
|
overflow: hidden;
|
|
10
|
+
border-radius: 3px;
|
|
11
|
+
border: 1px solid var(--imlib_chat_components_replyBubble_border_color);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.imageWrapperFailed{
|
|
15
|
+
border-color: var(--imlib_chat_components_replyBubble_border_color_failed);
|
|
10
16
|
}
|
|
11
17
|
|
|
12
18
|
.image {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** ** Methods *** */
|
|
2
|
+
import { compileClassNames } from '@zohodesk/utils';
|
|
3
|
+
export default function cssJSLogic(props, style) {
|
|
4
|
+
const {
|
|
5
|
+
isFailed
|
|
6
|
+
} = props;
|
|
7
|
+
const imageWrapperClass = compileClassNames({
|
|
8
|
+
[style.imageWrapper]: true,
|
|
9
|
+
[style.imageWrapperFailed]: isFailed
|
|
10
|
+
});
|
|
11
|
+
return {
|
|
12
|
+
imageWrapperClass
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -23,7 +23,8 @@ export default function ReplyBubbleContent(props) {
|
|
|
23
23
|
senderName,
|
|
24
24
|
renderIcon,
|
|
25
25
|
renderMessage,
|
|
26
|
-
isFailed
|
|
26
|
+
isFailed,
|
|
27
|
+
onClick
|
|
27
28
|
} = props;
|
|
28
29
|
/* External CSS Customization */
|
|
29
30
|
|
|
@@ -41,7 +42,8 @@ export default function ReplyBubbleContent(props) {
|
|
|
41
42
|
align: "vertical",
|
|
42
43
|
alignBox: "row",
|
|
43
44
|
className: replyBubbleContentClass,
|
|
44
|
-
isCover: false
|
|
45
|
+
isCover: false,
|
|
46
|
+
onClick: onClick
|
|
45
47
|
}, icon ? /*#__PURE__*/React.createElement(Box, {
|
|
46
48
|
className: newStyle.iconWrapper
|
|
47
49
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
@@ -5,6 +5,7 @@ const replyBubbleContentPropTypes = {
|
|
|
5
5
|
renderMessage: PropTypes.func.isRequired,
|
|
6
6
|
senderName: PropTypes.string.isRequired,
|
|
7
7
|
customStyle: PropTypes.object,
|
|
8
|
-
isFailed: PropTypes.bool
|
|
8
|
+
isFailed: PropTypes.bool,
|
|
9
|
+
onClick: PropTypes.func
|
|
9
10
|
};
|
|
10
11
|
export default replyBubbleContentPropTypes;
|