@zohoim/chat-components 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/ActionIcon/ActionIcon.js +2 -0
- package/es/ActionIconWrapper/ActionIconWrapper.js +15 -3
- package/es/ActionIconWrapper/css/ActionIconWrapper.module.css +5 -0
- package/es/ActionIconWrapper/css/cssJSLogic.js +14 -0
- package/es/ActionIconWrapper/props/propTypes.js +1 -0
- package/es/AttachmentBubble/AttachmentBubble.js +26 -9
- package/es/AttachmentBubble/css/AttachmentBubble.module.css +16 -1
- package/es/AttachmentBubble/css/cssJSLogic.js +15 -0
- package/es/AttachmentBubble/props/propTypes.js +2 -1
- package/es/AttachmentBubbleInfo/AttachmentBubbleInfo.js +20 -5
- package/es/AttachmentBubbleInfo/css/AttachmentBubbleInfo.module.css +11 -3
- 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 +12 -5
- package/es/AudioBubble/AudioBubble.js +21 -5
- package/es/AudioBubble/css/AudioBubble.module.css +4 -0
- package/es/AudioBubble/props/defaultProps.js +1 -0
- 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 +15 -3
- package/es/LocationBubble/css/LocationBubble.module.css +17 -5
- package/es/LocationBubble/css/cssJSLogic.js +13 -0
- package/es/LocationBubble/props/propTypes.js +2 -1
- package/es/MediaBubbleWrapper/MediaBubbleWrapper.js +7 -4
- package/es/MediaBubbleWrapper/css/MediaBubbleWrapper.module.css +4 -0
- 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 +18 -4
- package/es/MessageActions/props/propTypes.js +1 -0
- package/es/MessageBox/MessageBox.js +10 -6
- package/es/MessageBox/css/MessageBox.module.css +1 -6
- package/es/MessageBubble/MessageBubble.js +21 -13
- package/es/MessageStatus/css/MessageStatus.module.css +0 -3
- package/es/MoreActionItem/MoreActionItem.js +8 -0
- package/es/MoreActionItem/css/MoreActionItem.module.css +1 -3
- package/es/MoreActionItem/props/propTypes.js +1 -0
- package/es/ReplyBubble/ReplyBubble.js +32 -14
- package/es/ReplyBubble/css/ReplyBubble.module.css +3 -3
- package/es/ReplyBubble/props/propTypes.js +8 -2
- package/es/ReplyBubbleContent/ReplyBubbleContent.js +15 -5
- package/es/ReplyBubbleContent/css/ReplyBubbleContent.module.css +22 -7
- package/es/ReplyBubbleContent/css/cssJSLogic.js +13 -0
- package/es/ReplyBubbleContent/props/propTypes.js +2 -1
- package/es/ReplyBubbleHeader/ReplyBubbleHeader.js +24 -9
- package/es/ReplyBubbleHeader/css/ReplyBubbleHeader.module.css +37 -6
- 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 +17 -5
- package/es/TextBubble/css/TextBubble.module.css +16 -1
- package/es/TextBubble/css/cssJSLogic.js +18 -0
- package/es/TextBubble/props/propTypes.js +2 -1
- package/es/Theme/ThemeWrapper.js +2 -2
- 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 +7 -3
- package/es/VideoBubble/props/propTypes.js +2 -1
- package/es/css/common.module.css +6 -0
- package/es/icons/factory/common/article.svg +4 -4
- package/es/icons/factory/integrations/chInstagram.svg +2 -2
- package/es/icons/factory/integrations/chWhatsApp.svg +2 -2
- package/es/icons/factory/integrations/ttASAP.svg +6 -1
- package/es/icons/factory/integrations/ttLine.svg +8 -0
- package/es/icons/factory/integrations/ttTelegram.svg +4 -1
- package/es/icons/factory/integrations/ttTwillio.svg +8 -1
- package/es/icons/factory/integrations/ttWechat.svg +9 -1
- package/es/icons/iconSrc/attachments/Text.js +47 -0
- package/es/icons/iconSrc/attachments/index.js +1 -1
- package/es/icons/iconSrc/common/Article.js +2 -3
- package/es/icons/iconSrc/integrations/ChInstagram.js +2 -3
- package/es/icons/iconSrc/integrations/ChWhatsApp.js +2 -3
- package/es/icons/iconSrc/integrations/TtASAP.js +11 -15
- package/es/icons/iconSrc/integrations/{TtTwitter.js → TtLine.js} +14 -18
- package/es/icons/iconSrc/integrations/TtTelegram.js +8 -12
- package/es/icons/iconSrc/integrations/TtTwillio.js +15 -19
- package/es/icons/iconSrc/integrations/TtWechat.js +19 -20
- package/es/icons/iconSrc/integrations/index.js +1 -1
- package/es/im/ArticleBubble/ArticleBubble.js +22 -8
- package/es/im/ArticleBubble/css/ArticleBubble.module.css +40 -15
- 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/IMIntegrationIcon.js +1 -1
- package/es/im/IMIntegrationIcon/css/IMIntegrationIcon.module.css +1 -6
- package/es/im/IMMessage/IMMessage.js +57 -11
- package/es/im/{IMTicketLink/css/IMTicketLink.module.css → IMMessage/css/IMMessage.module.css} +21 -11
- package/es/im/IMMessage/css/cssJSLogic.js +23 -0
- package/es/im/IMMessage/props/defaultProps.js +2 -1
- package/es/im/IMMessage/props/propTypes.js +28 -2
- package/es/im/IMMessageContent/IMMessageContent.js +41 -42
- package/es/im/IMMessageContent/css/IMMessageContent.module.css +6 -2
- package/es/im/IMMessageContent/props/propTypes.js +8 -2
- package/es/im/IMMessageMeta/IMMessageMeta.js +8 -8
- package/es/im/IMMessageMeta/css/IMMessageMeta.module.css +2 -4
- package/es/im/IMMessageMeta/props/defaultProps.js +1 -1
- package/es/im/IMPermaLink/IMPermaLink.js +48 -0
- package/es/im/IMPermaLink/css/IMPermaLink.module.css +14 -0
- package/es/im/{IMTicketLink → IMPermaLink}/css/cssJSLogic.js +3 -3
- package/es/im/IMPermaLink/index.js +1 -0
- package/es/{InfoBubble → im/IMPermaLink}/props/defaultProps.js +2 -2
- package/es/im/IMPermaLink/props/propTypes.js +11 -0
- 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 +6 -0
- package/es/im/index.js +1 -2
- 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/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/icons/factory/integrations/ttTwitter.svg +0 -1
- 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/im/IMTicketLink/IMTicketLink.js +0 -48
- package/es/im/IMTicketLink/index.js +0 -1
- package/es/im/IMTicketLink/props/defaultProps.js +0 -6
- package/es/im/IMTicketLink/props/propTypes.js +0 -11
- /package/es/icons/factory/attachments/{txt.svg → text.svg} +0 -0
|
@@ -6,10 +6,16 @@
|
|
|
6
6
|
.locationBubble {
|
|
7
7
|
white-space: nowrap;
|
|
8
8
|
width: 100% ;
|
|
9
|
+
box-sizing: border-box;
|
|
9
10
|
background-color: var(--imlib_chat_components_locationBubble_bg_color);
|
|
10
11
|
border: 1px solid var(--imlib_chat_components_locationBubble_border_color);
|
|
11
12
|
padding: var(--zd_size10) ;
|
|
12
|
-
border-radius: 3px;
|
|
13
|
+
border-radius: 3px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.failedLocationBubble{
|
|
17
|
+
background-color: var(--imlib_chat_components_locationBubble_bg_color_failed);
|
|
18
|
+
border-color: var(--imlib_chat_components_locationBubble_border_color_failed);
|
|
13
19
|
}
|
|
14
20
|
|
|
15
21
|
.image {
|
|
@@ -31,8 +37,14 @@
|
|
|
31
37
|
|
|
32
38
|
.textLink {
|
|
33
39
|
display: block;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
text-overflow: ellipsis;
|
|
37
|
-
color: var(--imlib_chat_components_locationBubble_color);
|
|
40
|
+
composes: dotted from "../../css/common.module.css";
|
|
41
|
+
color: var(--imlib_chat_components_locationBubble_url_color);
|
|
38
42
|
}
|
|
43
|
+
|
|
44
|
+
.failedLocationBubble .textLink{
|
|
45
|
+
color: var(--imlib_chat_components_locationBubble_url_color_failed);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.textLink:hover{
|
|
49
|
+
text-decoration: underline !important;
|
|
50
|
+
}
|
|
@@ -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 locationBubbleClass = compileClassNames({
|
|
7
|
+
[style.locationBubble]: true,
|
|
8
|
+
[style.failedLocationBubble]: isFailed
|
|
9
|
+
});
|
|
10
|
+
return {
|
|
11
|
+
locationBubbleClass
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
/** ** Libraries *** */
|
|
4
|
-
import React, { useMemo } from 'react';
|
|
4
|
+
import React, { useMemo, Fragment } from 'react';
|
|
5
5
|
/** ** Hooks *** */
|
|
6
6
|
|
|
7
7
|
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
@@ -25,7 +25,8 @@ export default function MediaBubbleWrapper(props) {
|
|
|
25
25
|
customStyle,
|
|
26
26
|
mediaDetails,
|
|
27
27
|
customProps,
|
|
28
|
-
renderMedia
|
|
28
|
+
renderMedia,
|
|
29
|
+
isFailed
|
|
29
30
|
} = props;
|
|
30
31
|
const {
|
|
31
32
|
attachmentBubbleInfoProps = dummyObject
|
|
@@ -48,11 +49,13 @@ export default function MediaBubbleWrapper(props) {
|
|
|
48
49
|
fileURL,
|
|
49
50
|
fileType
|
|
50
51
|
});
|
|
51
|
-
return /*#__PURE__*/React.createElement(
|
|
52
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(AttachmentBubbleInfo, _extends({
|
|
52
53
|
customStyle: bubbleInfoCustomStyle,
|
|
53
54
|
fileName: fileName,
|
|
54
55
|
fileSize: fileSize
|
|
55
|
-
}, attachmentBubbleInfoProps
|
|
56
|
+
}, attachmentBubbleInfoProps, {
|
|
57
|
+
isFailed: isFailed
|
|
58
|
+
})), mediaComponent);
|
|
56
59
|
}
|
|
57
60
|
MediaBubbleWrapper.propTypes = mediaBubbleWrapperPropTypes;
|
|
58
61
|
MediaBubbleWrapper.defaultProps = mediaBubbleWrapperDefaultProps;
|
|
@@ -11,6 +11,7 @@ const mediaBubbleWrapperPropTypes = {
|
|
|
11
11
|
customProps: PropTypes.shape({
|
|
12
12
|
attachmentBubbleInfoProps: PropTypes.object
|
|
13
13
|
}),
|
|
14
|
-
customStyle: PropTypes.object
|
|
14
|
+
customStyle: PropTypes.object,
|
|
15
|
+
isFailed: PropTypes.bool
|
|
15
16
|
};
|
|
16
17
|
export default mediaBubbleWrapperPropTypes;
|
package/es/Message/Message.js
CHANGED
|
@@ -31,6 +31,7 @@ export default function Message(props) {
|
|
|
31
31
|
actions,
|
|
32
32
|
renderSecondaryActions,
|
|
33
33
|
onSelectAction,
|
|
34
|
+
onMouseEnterAction,
|
|
34
35
|
renderContent,
|
|
35
36
|
customProps
|
|
36
37
|
} = props;
|
|
@@ -103,10 +104,11 @@ export default function Message(props) {
|
|
|
103
104
|
const props = {
|
|
104
105
|
actions,
|
|
105
106
|
onSelect: onSelectAction,
|
|
106
|
-
renderSecondaryActions
|
|
107
|
+
renderSecondaryActions,
|
|
108
|
+
onMouseEnter: onMouseEnterAction
|
|
107
109
|
};
|
|
108
110
|
return /*#__PURE__*/React.createElement(MessageActions, _extends({}, props, messageActionsProps));
|
|
109
|
-
}, [actions, onSelectAction, renderSecondaryActions, messageActionsProps]);
|
|
111
|
+
}, [actions, onSelectAction, onMouseEnterAction, renderSecondaryActions, messageActionsProps]);
|
|
110
112
|
const needMessageActions = !!actions.length;
|
|
111
113
|
return /*#__PURE__*/React.createElement(MessageBubble, _extends({
|
|
112
114
|
direction: direction,
|
|
@@ -16,6 +16,7 @@ export default function MessageAction(props) {
|
|
|
16
16
|
displayText,
|
|
17
17
|
id,
|
|
18
18
|
onClick,
|
|
19
|
+
onMouseEnter,
|
|
19
20
|
isShowInMore,
|
|
20
21
|
iconTitle,
|
|
21
22
|
customProps,
|
|
@@ -44,12 +45,14 @@ export default function MessageAction(props) {
|
|
|
44
45
|
isDisabled: isDisabled,
|
|
45
46
|
needIcon: needMoreActionItemIcon,
|
|
46
47
|
onClick: onClick,
|
|
48
|
+
onMouseEnter: onMouseEnter,
|
|
47
49
|
renderIcon: renderIcon,
|
|
48
50
|
title: iconTitle
|
|
49
51
|
}, moreActionItemProps)) : /*#__PURE__*/React.createElement(ActionIcon, _extends({
|
|
50
52
|
id: id,
|
|
51
53
|
isDisabled: isDisabled,
|
|
52
54
|
onClick: onClick,
|
|
55
|
+
onMouseEnter: onMouseEnter,
|
|
53
56
|
title: iconTitle
|
|
54
57
|
}, actionIconProps));
|
|
55
58
|
}
|
|
@@ -4,6 +4,7 @@ const messageActionPropTypes = {
|
|
|
4
4
|
displayText: PropTypes.string.isRequired,
|
|
5
5
|
id: PropTypes.string.isRequired,
|
|
6
6
|
onClick: PropTypes.func.isRequired,
|
|
7
|
+
onMouseEnter: PropTypes.func,
|
|
7
8
|
closePopup: PropTypes.func,
|
|
8
9
|
customProps: PropTypes.shape({
|
|
9
10
|
actionIconProps: PropTypes.object,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
/** ** Libraries *** */
|
|
4
|
-
import React, { useCallback } from 'react';
|
|
4
|
+
import React, { useCallback, Fragment } from 'react';
|
|
5
5
|
/** ** Components *** */
|
|
6
6
|
|
|
7
7
|
import ActionIconWrapper from '../ActionIconWrapper/ActionIconWrapper';
|
|
@@ -30,6 +30,7 @@ export default function MessageActions(props) {
|
|
|
30
30
|
actions,
|
|
31
31
|
defaultShowCount,
|
|
32
32
|
onSelect,
|
|
33
|
+
onMouseEnter,
|
|
33
34
|
renderSecondaryActions,
|
|
34
35
|
customStyle,
|
|
35
36
|
customProps
|
|
@@ -52,6 +53,18 @@ export default function MessageActions(props) {
|
|
|
52
53
|
e
|
|
53
54
|
});
|
|
54
55
|
}, [onSelect]);
|
|
56
|
+
const handleMouseEnterAction = useCallback(_ref2 => {
|
|
57
|
+
let {
|
|
58
|
+
id,
|
|
59
|
+
e
|
|
60
|
+
} = _ref2;
|
|
61
|
+
onMouseEnter && onMouseEnter({
|
|
62
|
+
id,
|
|
63
|
+
e
|
|
64
|
+
});
|
|
65
|
+
}, [onMouseEnter]);
|
|
66
|
+
/* External Action Icon */
|
|
67
|
+
|
|
55
68
|
const renderAction = useCallback(function () {
|
|
56
69
|
let {
|
|
57
70
|
id,
|
|
@@ -72,9 +85,10 @@ export default function MessageActions(props) {
|
|
|
72
85
|
id: id,
|
|
73
86
|
isDisabled: isDisabled,
|
|
74
87
|
isShowInMore: isShowInMore,
|
|
75
|
-
onClick: handleClickAction
|
|
88
|
+
onClick: handleClickAction,
|
|
89
|
+
onMouseEnter: handleMouseEnterAction
|
|
76
90
|
}, messageActionProps));
|
|
77
|
-
}, [handleClickAction, messageActionProps]);
|
|
91
|
+
}, [handleClickAction, handleMouseEnterAction, messageActionProps]);
|
|
78
92
|
/* Hooks handling */
|
|
79
93
|
|
|
80
94
|
const {
|
|
@@ -95,7 +109,7 @@ export default function MessageActions(props) {
|
|
|
95
109
|
renderIcon: renderMoreIcon
|
|
96
110
|
}, actionIconWrapperProps)), [actionIconWrapperProps, renderMoreIcon]);
|
|
97
111
|
const secondaryActions = renderHandler(renderSecondaryActions)();
|
|
98
|
-
return /*#__PURE__*/React.createElement(
|
|
112
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(MessageActionsWrapper, _extends({
|
|
99
113
|
actions: allActions,
|
|
100
114
|
defaultShowCount: defaultShowCount,
|
|
101
115
|
renderMoreIcon: renderMore
|
|
@@ -12,6 +12,7 @@ const messageActionsPropTypes = {
|
|
|
12
12
|
renderFunction: PropTypes.func
|
|
13
13
|
})).isRequired,
|
|
14
14
|
onSelect: PropTypes.func.isRequired,
|
|
15
|
+
onMouseEnter: PropTypes.func,
|
|
15
16
|
customProps: PropTypes.shape({
|
|
16
17
|
actionIconWrapperProps: PropTypes.object,
|
|
17
18
|
messageActionProps: PropTypes.object,
|
|
@@ -11,6 +11,9 @@ import messageBoxPropTypes from './props/propTypes';
|
|
|
11
11
|
|
|
12
12
|
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
13
13
|
import cssJSLogic from './css/cssJSLogic';
|
|
14
|
+
/** ** Components *** */
|
|
15
|
+
|
|
16
|
+
import { Box } from '@zohodesk/components/es/Layout';
|
|
14
17
|
/** ** Styles *** */
|
|
15
18
|
|
|
16
19
|
import style from './css/MessageBox.module.css';
|
|
@@ -45,15 +48,16 @@ export default function MessageBox(props) {
|
|
|
45
48
|
const messageStatus = renderHandler(renderMessageStatus)();
|
|
46
49
|
return /*#__PURE__*/React.createElement("div", {
|
|
47
50
|
className: messageBoxClass
|
|
48
|
-
}, /*#__PURE__*/React.createElement(
|
|
49
|
-
className: newStyle.messageBoxInner
|
|
50
|
-
|
|
51
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
52
|
+
className: newStyle.messageBoxInner,
|
|
53
|
+
flexible: true
|
|
54
|
+
}, messageHeader ? /*#__PURE__*/React.createElement(Box, {
|
|
51
55
|
className: newStyle.messageHeaderWrapper
|
|
52
|
-
}, messageHeader) : null, messageConent ? /*#__PURE__*/React.createElement(
|
|
56
|
+
}, messageHeader) : null, messageConent ? /*#__PURE__*/React.createElement(Box, {
|
|
53
57
|
className: newStyle.messageContentWrapper
|
|
54
|
-
}, messageConent) : null, messageFooter ? /*#__PURE__*/React.createElement(
|
|
58
|
+
}, messageConent) : null, messageFooter ? /*#__PURE__*/React.createElement(Box, {
|
|
55
59
|
className: newStyle.messageFooterWrapper
|
|
56
|
-
}, messageFooter) : null), messageStatus ? /*#__PURE__*/React.createElement(
|
|
60
|
+
}, messageFooter) : null), messageStatus ? /*#__PURE__*/React.createElement(Box, {
|
|
57
61
|
className: newStyle.messageStatusWrapper
|
|
58
62
|
}, messageStatus) : null);
|
|
59
63
|
}
|
|
@@ -18,17 +18,12 @@
|
|
|
18
18
|
/* max-width: var(--messageBox-max_width); */
|
|
19
19
|
word-wrap: break-word;
|
|
20
20
|
font-size: var(--messageBox-content_size);
|
|
21
|
+
box-sizing: border-box;
|
|
21
22
|
background-color: var(--imlib_chat_components_messageBox_bg_color);
|
|
22
23
|
padding: var(--messageBox-content_padding);
|
|
23
24
|
border-radius: var(--messageBox-border_radius);
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
.messageBoxInner {
|
|
27
|
-
flex: 1 ;
|
|
28
|
-
min-width: 0 ;
|
|
29
|
-
min-height: 0 ;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
27
|
.messageContentWrapper {
|
|
33
28
|
/* Use this class for message content customization */
|
|
34
29
|
line-height: 150%;
|
|
@@ -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';
|
|
@@ -12,6 +14,9 @@ import messageBubblePropTypes from './props/propTypes';
|
|
|
12
14
|
|
|
13
15
|
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
14
16
|
import cssJSLogic from './css/cssJSLogic';
|
|
17
|
+
/** ** Components *** */
|
|
18
|
+
|
|
19
|
+
import { Box } from '@zohodesk/components/es/Layout';
|
|
15
20
|
/** ** Styles *** */
|
|
16
21
|
|
|
17
22
|
import style from './css/MessageBubble.module.css';
|
|
@@ -50,7 +55,7 @@ export default function MessageBubble(props) {
|
|
|
50
55
|
|
|
51
56
|
const messageSenderRenderer = useCallback(() => {
|
|
52
57
|
const messageOwner = renderHandler(renderMessageOwner)();
|
|
53
|
-
return needSender ? /*#__PURE__*/React.createElement(
|
|
58
|
+
return needSender ? /*#__PURE__*/React.createElement(Box, {
|
|
54
59
|
className: newStyle.messageOwnerWrapper
|
|
55
60
|
}, messageOwner) : null;
|
|
56
61
|
}, [renderMessageOwner, needSender, newStyle.messageOwnerWrapper]);
|
|
@@ -58,7 +63,7 @@ export default function MessageBubble(props) {
|
|
|
58
63
|
|
|
59
64
|
const messageActionsRenderer = useCallback(() => {
|
|
60
65
|
const messageActions = isRenderMessageActions ? renderHandler(renderMessageActions)() : null;
|
|
61
|
-
return messageActions ? /*#__PURE__*/React.createElement(
|
|
66
|
+
return messageActions ? /*#__PURE__*/React.createElement(Box, {
|
|
62
67
|
className: newStyle.messageActionWrapper
|
|
63
68
|
}, messageActions) : null;
|
|
64
69
|
}, [isRenderMessageActions, renderMessageActions, newStyle.messageActionWrapper]);
|
|
@@ -66,34 +71,37 @@ export default function MessageBubble(props) {
|
|
|
66
71
|
|
|
67
72
|
const messageBoxRenderer = useCallback(() => {
|
|
68
73
|
const messageBox = renderHandler(renderMessageBox)();
|
|
69
|
-
return messageBox ? /*#__PURE__*/React.createElement(
|
|
74
|
+
return messageBox ? /*#__PURE__*/React.createElement(Box, {
|
|
70
75
|
className: newStyle.messageBoxWrapper
|
|
71
76
|
}, messageBox) : null;
|
|
72
77
|
}, [renderMessageBox, newStyle.messageBoxWrapper]);
|
|
73
78
|
/* Message BoxWithActions Render */
|
|
74
79
|
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}, messageBox, messageActions) : null;
|
|
81
|
-
}, [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]);
|
|
82
85
|
/* Message Footer Render */
|
|
83
86
|
|
|
84
87
|
const messageFooterRenderer = useCallback(() => {
|
|
85
88
|
const messageBoxFooter = renderHandler(renderMessageBoxFooter)();
|
|
86
|
-
return messageBoxFooter ? /*#__PURE__*/React.createElement(
|
|
89
|
+
return messageBoxFooter ? /*#__PURE__*/React.createElement(Box, {
|
|
87
90
|
className: newStyle.messageBoxFooterWrapper
|
|
88
91
|
}, messageBoxFooter) : null;
|
|
89
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]);
|
|
90
98
|
/* Construct Layout */
|
|
91
99
|
|
|
92
100
|
const messageLayout = /*#__PURE__*/React.createElement("div", {
|
|
93
101
|
className: bubbleClass,
|
|
94
102
|
onMouseEnter: onMouseEnter,
|
|
95
103
|
onMouseLeave: onMouseLeave
|
|
96
|
-
},
|
|
104
|
+
}, messageSender, messageBoxWithActions, messageFooter);
|
|
97
105
|
return messageLayout;
|
|
98
106
|
}
|
|
99
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,14 +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
|
-
|
|
53
|
-
|
|
52
|
+
const renderMessage = useCallback(() => {
|
|
53
|
+
if (locationUrl) {
|
|
54
|
+
return /*#__PURE__*/React.createElement(LocationBubble, {
|
|
55
|
+
isFailed: isFailed,
|
|
56
|
+
locationUrl: locationUrl
|
|
57
|
+
});
|
|
54
58
|
}
|
|
55
|
-
|
|
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]);
|
|
56
71
|
const renderIcon = useCallback(() => {
|
|
57
72
|
if (fileURL) {
|
|
58
73
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -67,18 +82,21 @@ export default function ReplyBubble(props) {
|
|
|
67
82
|
if (fileFormat) {
|
|
68
83
|
return /*#__PURE__*/React.createElement(AttachmentIcon, _extends({
|
|
69
84
|
customStyle: iconStyle,
|
|
70
|
-
fileFormat: fileFormat
|
|
85
|
+
fileFormat: fileFormat,
|
|
86
|
+
mediaType: mediaType
|
|
71
87
|
}, iconProps));
|
|
72
88
|
}
|
|
73
89
|
|
|
74
90
|
return null;
|
|
75
|
-
}, [fileURL, fileName, fileFormat, iconStyle, iconProps, newStyle.imageWrapper, newStyle.image]);
|
|
91
|
+
}, [fileURL, fileName, fileFormat, mediaType, iconStyle, iconProps, newStyle.imageWrapper, newStyle.image]);
|
|
76
92
|
return /*#__PURE__*/React.createElement("div", {
|
|
77
93
|
onClick: onClick
|
|
78
94
|
}, /*#__PURE__*/React.createElement(ReplyBubbleHeader, _extends({
|
|
79
|
-
|
|
80
|
-
|
|
95
|
+
dateTimeDetails: dateTimeDetails,
|
|
96
|
+
isFailed: isFailed,
|
|
97
|
+
replyText: replyText
|
|
81
98
|
}, headerProps)), /*#__PURE__*/React.createElement(ReplyBubbleContent, _extends({
|
|
99
|
+
isFailed: isFailed,
|
|
82
100
|
renderIcon: renderIcon,
|
|
83
101
|
renderMessage: renderMessage,
|
|
84
102
|
senderName: senderName
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.attachmentIcon {
|
|
2
|
-
height: var(--zd_size40)
|
|
3
|
-
width: var(--zd_size40)
|
|
2
|
+
height: var(--zd_size40) !important;
|
|
3
|
+
width: var(--zd_size40) !important;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.imageWrapper {
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
height: 100% ;
|
|
15
15
|
object-fit: cover;
|
|
16
16
|
border-radius: 3px;
|
|
17
|
-
}
|
|
17
|
+
}
|
|
@@ -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,28 +22,37 @@ 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,
|
|
44
|
+
isCover: false
|
|
35
45
|
}, icon ? /*#__PURE__*/React.createElement(Box, {
|
|
36
46
|
className: newStyle.iconWrapper
|
|
37
47
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
38
48
|
align: "both"
|
|
39
49
|
}, icon)) : null, /*#__PURE__*/React.createElement(Box, {
|
|
40
50
|
flexible: true
|
|
41
|
-
}, /*#__PURE__*/React.createElement(
|
|
51
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
42
52
|
className: newStyle.name
|
|
43
|
-
}, senderName), /*#__PURE__*/React.createElement(
|
|
53
|
+
}, senderName), messageContent ? /*#__PURE__*/React.createElement(Box, {
|
|
44
54
|
className: newStyle.messageWrapper
|
|
45
|
-
}, messageContent)));
|
|
55
|
+
}, messageContent) : null));
|
|
46
56
|
}
|
|
47
57
|
ReplyBubbleContent.propTypes = replyBubbleContentPropTypes;
|
|
48
58
|
ReplyBubbleContent.defaultProps = replyBubbleContentDefaultProps;
|