@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
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
fileName_color: '#e2e4e6',
|
|
21
21
|
fileName_color_failed: failedColor,
|
|
22
22
|
fileSize_color: '#999',
|
|
23
|
-
fileSize_color_failed:
|
|
23
|
+
fileSize_color_failed: '#788190'
|
|
24
24
|
},
|
|
25
25
|
// AttachmentIcon: {},
|
|
26
26
|
// Audio: {},
|
|
@@ -42,7 +42,9 @@ export default {
|
|
|
42
42
|
imIntegrationIcon,
|
|
43
43
|
imTtIcon,
|
|
44
44
|
// IMMessage: {},
|
|
45
|
-
|
|
45
|
+
imMessageContent: {
|
|
46
|
+
text_color: '#a8b0bd'
|
|
47
|
+
},
|
|
46
48
|
imMessageMeta: {
|
|
47
49
|
time_color: '#999'
|
|
48
50
|
},
|
|
@@ -55,7 +57,9 @@ export default {
|
|
|
55
57
|
bg_color: '#212121',
|
|
56
58
|
bg_color_failed: failedBg,
|
|
57
59
|
alt_text_color: '#e2e4e6',
|
|
58
|
-
alt_text_color_failed: failedColor
|
|
60
|
+
alt_text_color_failed: failedColor,
|
|
61
|
+
border_color: '#161515',
|
|
62
|
+
border_color_failed: failedBdr
|
|
59
63
|
},
|
|
60
64
|
// IMReplyBubble: {},
|
|
61
65
|
// InfoBubble: {},
|
|
@@ -92,7 +96,10 @@ export default {
|
|
|
92
96
|
failed_color: messageStatusFailedColor
|
|
93
97
|
},
|
|
94
98
|
// MoreActionItem: {},
|
|
95
|
-
|
|
99
|
+
replyBubble: {
|
|
100
|
+
border_color: '#161515',
|
|
101
|
+
border_color_failed: failedBdr
|
|
102
|
+
},
|
|
96
103
|
replyBubbleContent: {
|
|
97
104
|
bg_color: '#212121',
|
|
98
105
|
bg_color_failed: failedBg,
|
|
@@ -118,8 +125,11 @@ export default {
|
|
|
118
125
|
see_more_color_failed: failedUrlColor,
|
|
119
126
|
url_color: primaryGreen,
|
|
120
127
|
url_color_failed: failedUrlColor
|
|
121
|
-
}
|
|
122
|
-
//
|
|
123
|
-
|
|
128
|
+
},
|
|
129
|
+
// Video: {},
|
|
130
|
+
videoBubble: {
|
|
131
|
+
border_color: '#161515',
|
|
132
|
+
border_color_failed: failedBdr
|
|
133
|
+
}
|
|
124
134
|
}
|
|
125
135
|
};
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
fileName_color: '#e2e4e6',
|
|
21
21
|
fileName_color_failed: failedColor,
|
|
22
22
|
fileSize_color: '#999',
|
|
23
|
-
fileSize_color_failed:
|
|
23
|
+
fileSize_color_failed: '#788190'
|
|
24
24
|
},
|
|
25
25
|
// AttachmentIcon: {},
|
|
26
26
|
// Audio: {},
|
|
@@ -42,7 +42,9 @@ export default {
|
|
|
42
42
|
imIntegrationIcon,
|
|
43
43
|
imTtIcon,
|
|
44
44
|
// IMMessage: {},
|
|
45
|
-
|
|
45
|
+
imMessageContent: {
|
|
46
|
+
text_color: '#a8b0bd'
|
|
47
|
+
},
|
|
46
48
|
imMessageMeta: {
|
|
47
49
|
time_color: '#999'
|
|
48
50
|
},
|
|
@@ -55,7 +57,9 @@ export default {
|
|
|
55
57
|
bg_color: '#212121',
|
|
56
58
|
bg_color_failed: failedBg,
|
|
57
59
|
alt_text_color: '#e2e4e6',
|
|
58
|
-
alt_text_color_failed: failedColor
|
|
60
|
+
alt_text_color_failed: failedColor,
|
|
61
|
+
border_color: '#161515',
|
|
62
|
+
border_color_failed: failedBdr
|
|
59
63
|
},
|
|
60
64
|
// IMReplyBubble: {},
|
|
61
65
|
// InfoBubble: {},
|
|
@@ -92,7 +96,10 @@ export default {
|
|
|
92
96
|
failed_color: messageStatusFailedColor
|
|
93
97
|
},
|
|
94
98
|
// MoreActionItem: {},
|
|
95
|
-
|
|
99
|
+
replyBubble: {
|
|
100
|
+
border_color: '#161515',
|
|
101
|
+
border_color_failed: failedBdr
|
|
102
|
+
},
|
|
96
103
|
replyBubbleContent: {
|
|
97
104
|
bg_color: '#212121',
|
|
98
105
|
bg_color_failed: failedBg,
|
|
@@ -118,8 +125,11 @@ export default {
|
|
|
118
125
|
see_more_color_failed: failedUrlColor,
|
|
119
126
|
url_color: primaryOrange,
|
|
120
127
|
url_color_failed: failedUrlColor
|
|
121
|
-
}
|
|
122
|
-
//
|
|
123
|
-
|
|
128
|
+
},
|
|
129
|
+
// Video: {},
|
|
130
|
+
videoBubble: {
|
|
131
|
+
border_color: '#161515',
|
|
132
|
+
border_color_failed: failedBdr
|
|
133
|
+
}
|
|
124
134
|
}
|
|
125
135
|
};
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
fileName_color: '#e2e4e6',
|
|
21
21
|
fileName_color_failed: failedColor,
|
|
22
22
|
fileSize_color: '#999',
|
|
23
|
-
fileSize_color_failed:
|
|
23
|
+
fileSize_color_failed: '#788190'
|
|
24
24
|
},
|
|
25
25
|
// AttachmentIcon: {},
|
|
26
26
|
// Audio: {},
|
|
@@ -42,7 +42,9 @@ export default {
|
|
|
42
42
|
imIntegrationIcon,
|
|
43
43
|
imTtIcon,
|
|
44
44
|
// IMMessage: {},
|
|
45
|
-
|
|
45
|
+
imMessageContent: {
|
|
46
|
+
text_color: '#a8b0bd'
|
|
47
|
+
},
|
|
46
48
|
imMessageMeta: {
|
|
47
49
|
time_color: '#999'
|
|
48
50
|
},
|
|
@@ -55,7 +57,9 @@ export default {
|
|
|
55
57
|
bg_color: '#212121',
|
|
56
58
|
bg_color_failed: failedBg,
|
|
57
59
|
alt_text_color: '#e2e4e6',
|
|
58
|
-
alt_text_color_failed: failedColor
|
|
60
|
+
alt_text_color_failed: failedColor,
|
|
61
|
+
border_color: '#161515',
|
|
62
|
+
border_color_failed: failedBdr
|
|
59
63
|
},
|
|
60
64
|
// IMReplyBubble: {},
|
|
61
65
|
// InfoBubble: {},
|
|
@@ -92,7 +96,10 @@ export default {
|
|
|
92
96
|
failed_color: messageStatusFailedColor
|
|
93
97
|
},
|
|
94
98
|
// MoreActionItem: {},
|
|
95
|
-
|
|
99
|
+
replyBubble: {
|
|
100
|
+
border_color: '#161515',
|
|
101
|
+
border_color_failed: failedBdr
|
|
102
|
+
},
|
|
96
103
|
replyBubbleContent: {
|
|
97
104
|
bg_color: '#212121',
|
|
98
105
|
bg_color_failed: failedBg,
|
|
@@ -118,8 +125,11 @@ export default {
|
|
|
118
125
|
see_more_color_failed: failedUrlColor,
|
|
119
126
|
url_color: primaryRed,
|
|
120
127
|
url_color_failed: failedUrlColor
|
|
121
|
-
}
|
|
122
|
-
//
|
|
123
|
-
|
|
128
|
+
},
|
|
129
|
+
// Video: {},
|
|
130
|
+
videoBubble: {
|
|
131
|
+
border_color: '#161515',
|
|
132
|
+
border_color_failed: failedBdr
|
|
133
|
+
}
|
|
124
134
|
}
|
|
125
135
|
};
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
fileName_color: '#e2e4e6',
|
|
21
21
|
fileName_color_failed: failedColor,
|
|
22
22
|
fileSize_color: '#999',
|
|
23
|
-
fileSize_color_failed:
|
|
23
|
+
fileSize_color_failed: '#788190'
|
|
24
24
|
},
|
|
25
25
|
// AttachmentIcon: {},
|
|
26
26
|
// Audio: {},
|
|
@@ -42,7 +42,9 @@ export default {
|
|
|
42
42
|
imIntegrationIcon,
|
|
43
43
|
imTtIcon,
|
|
44
44
|
// IMMessage: {},
|
|
45
|
-
|
|
45
|
+
imMessageContent: {
|
|
46
|
+
text_color: '#a8b0bd'
|
|
47
|
+
},
|
|
46
48
|
imMessageMeta: {
|
|
47
49
|
time_color: '#999'
|
|
48
50
|
},
|
|
@@ -55,7 +57,9 @@ export default {
|
|
|
55
57
|
bg_color: '#212121',
|
|
56
58
|
bg_color_failed: failedBg,
|
|
57
59
|
alt_text_color: '#e2e4e6',
|
|
58
|
-
alt_text_color_failed: failedColor
|
|
60
|
+
alt_text_color_failed: failedColor,
|
|
61
|
+
border_color: '#161515',
|
|
62
|
+
border_color_failed: failedBdr
|
|
59
63
|
},
|
|
60
64
|
// IMReplyBubble: {},
|
|
61
65
|
// InfoBubble: {},
|
|
@@ -92,7 +96,10 @@ export default {
|
|
|
92
96
|
failed_color: messageStatusFailedColor
|
|
93
97
|
},
|
|
94
98
|
// MoreActionItem: {},
|
|
95
|
-
|
|
99
|
+
replyBubble: {
|
|
100
|
+
border_color: '#161515',
|
|
101
|
+
border_color_failed: failedBdr
|
|
102
|
+
},
|
|
96
103
|
replyBubbleContent: {
|
|
97
104
|
bg_color: '#212121',
|
|
98
105
|
bg_color_failed: failedBg,
|
|
@@ -118,8 +125,11 @@ export default {
|
|
|
118
125
|
see_more_color_failed: failedUrlColor,
|
|
119
126
|
url_color: primaryYellow,
|
|
120
127
|
url_color_failed: failedUrlColor
|
|
121
|
-
}
|
|
122
|
-
//
|
|
123
|
-
|
|
128
|
+
},
|
|
129
|
+
// Video: {},
|
|
130
|
+
videoBubble: {
|
|
131
|
+
border_color: '#161515',
|
|
132
|
+
border_color_failed: failedBdr
|
|
133
|
+
}
|
|
124
134
|
}
|
|
125
135
|
};
|
|
@@ -18,6 +18,9 @@ import style from './css/VideoBubble.module.css';
|
|
|
18
18
|
import { Box } from '@zohodesk/components/es/Layout';
|
|
19
19
|
import MediaBubbleWrapper from '../MediaBubbleWrapper/MediaBubbleWrapper';
|
|
20
20
|
import Video from '../Video/Video';
|
|
21
|
+
/** ** Methods *** */
|
|
22
|
+
|
|
23
|
+
import cssJSLogic from './css/cssJSLogic';
|
|
21
24
|
export default function VideoBubble(props) {
|
|
22
25
|
const {
|
|
23
26
|
customStyle,
|
|
@@ -32,18 +35,25 @@ export default function VideoBubble(props) {
|
|
|
32
35
|
/* External CSS Customization */
|
|
33
36
|
|
|
34
37
|
const newStyle = useMergeStyle(style, customStyle);
|
|
38
|
+
/* css classnames added based on logic */
|
|
39
|
+
|
|
40
|
+
const {
|
|
41
|
+
videoBubbleClass
|
|
42
|
+
} = cssJSLogic({
|
|
43
|
+
isFailed
|
|
44
|
+
}, newStyle);
|
|
35
45
|
const renderMedia = useCallback(_ref => {
|
|
36
46
|
let {
|
|
37
47
|
fileURL,
|
|
38
48
|
fileType
|
|
39
49
|
} = _ref;
|
|
40
50
|
return /*#__PURE__*/React.createElement(Box, {
|
|
41
|
-
className:
|
|
51
|
+
className: videoBubbleClass
|
|
42
52
|
}, /*#__PURE__*/React.createElement(Video, _extends({
|
|
43
53
|
fileType: fileType,
|
|
44
54
|
fileURL: fileURL
|
|
45
55
|
}, videoProps)));
|
|
46
|
-
}, [videoProps,
|
|
56
|
+
}, [videoProps, videoBubbleClass]);
|
|
47
57
|
return /*#__PURE__*/React.createElement(MediaBubbleWrapper, _extends({
|
|
48
58
|
mediaDetails: videoDetails,
|
|
49
59
|
renderMedia: renderMedia
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
.
|
|
1
|
+
.videoWrapper {
|
|
2
2
|
width: var(--zd_size360) ;
|
|
3
3
|
max-width: 100% ;
|
|
4
|
+
height: var(--zd_size193) ;
|
|
5
|
+
background-color: #000;
|
|
6
|
+
border-radius: 3px;
|
|
7
|
+
border: 1px solid var(--imlib_chat_components_videoBubble_border_color);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.videoWrapperFailed{
|
|
11
|
+
border-color: var(--imlib_chat_components_videoBubble_border_color_failed);
|
|
4
12
|
}
|
|
@@ -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 videoBubbleClass = compileClassNames({
|
|
8
|
+
[style.videoWrapper]: true,
|
|
9
|
+
[style.videoWrapperFailed]: isFailed
|
|
10
|
+
});
|
|
11
|
+
return {
|
|
12
|
+
videoBubbleClass
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
/** ** Libraries *** */
|
|
2
|
-
import React, { useCallback
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import WhatsappIcon from '../../icons/iconSrc/integrations/ChWhatsApp';
|
|
6
|
-
import TelegramIcon from '../../icons/iconSrc/integrations/TtTelegram';
|
|
7
|
-
import InstagramIcon from '../../icons/iconSrc/integrations/ChInstagram';
|
|
8
|
-
import ASAPIcon from '../../icons/iconSrc/integrations/TtASAP';
|
|
9
|
-
import WeChatIcon from '../../icons/iconSrc/integrations/TtWechat';
|
|
10
|
-
import TwillioIcon from '../../icons/iconSrc/integrations/TtTwillio';
|
|
11
|
-
import LineIcon from '../../icons/iconSrc/integrations/TtLine'; // import TwitterIcon from '../icons/iconSrc/integrations/TtTwitter';
|
|
12
|
-
|
|
2
|
+
import React, { useCallback } from 'react';
|
|
3
|
+
import Icon from '@zohodesk/icons/es/Icon';
|
|
13
4
|
/** ** CSS *** */
|
|
14
5
|
|
|
15
6
|
import style from './css/IMIntegrationIcon.module.css';
|
|
@@ -25,21 +16,18 @@ import integrationConstants from '@zohoim/chat-components-utils/es/imUtils/const
|
|
|
25
16
|
const {
|
|
26
17
|
WHATSAPP,
|
|
27
18
|
TELEGRAM,
|
|
28
|
-
INSTAGRAM,
|
|
29
19
|
ASAP,
|
|
30
20
|
WECHAT,
|
|
31
21
|
TWILLIO,
|
|
32
22
|
LINE
|
|
33
23
|
} = integrationConstants;
|
|
34
|
-
const
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[LINE]: LineIcon // [TWITTER]: TwitterIcon
|
|
42
|
-
|
|
24
|
+
const fontIconMap = {
|
|
25
|
+
[TWILLIO]: 'ZD-TT-imtwillio',
|
|
26
|
+
[WHATSAPP]: 'ZD-TT-whatsApp',
|
|
27
|
+
[TELEGRAM]: 'ZD-TT-imTelegram',
|
|
28
|
+
[WECHAT]: 'ZD-TT-imWeChat',
|
|
29
|
+
[LINE]: 'ZD-TT-imLine',
|
|
30
|
+
[ASAP]: 'ZD-TT-imASAP'
|
|
43
31
|
};
|
|
44
32
|
export default function IMIntegrationIcon(props) {
|
|
45
33
|
const {
|
|
@@ -56,25 +44,23 @@ export default function IMIntegrationIcon(props) {
|
|
|
56
44
|
/* css classnames added based on logic */
|
|
57
45
|
|
|
58
46
|
const {
|
|
59
|
-
iconWrapperClass
|
|
60
|
-
iconClass
|
|
47
|
+
iconWrapperClass
|
|
61
48
|
} = cssJSLogic({
|
|
62
49
|
integrationName,
|
|
63
50
|
size
|
|
64
51
|
}, newStyle);
|
|
65
|
-
const iconStyle = useMemo(() => ({
|
|
66
|
-
base: iconClass
|
|
67
|
-
}), [iconClass]);
|
|
68
52
|
const renderDefaultIcon = useCallback(() => {
|
|
69
|
-
const
|
|
70
|
-
return
|
|
53
|
+
const iconName = fontIconMap[integrationName];
|
|
54
|
+
return iconName ? /*#__PURE__*/React.createElement("div", {
|
|
71
55
|
className: iconWrapperClass,
|
|
72
56
|
"data-title": title,
|
|
73
57
|
onClick: onClick
|
|
74
|
-
}, /*#__PURE__*/React.createElement(
|
|
75
|
-
|
|
58
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
59
|
+
iconClass: newStyle.fontIcon,
|
|
60
|
+
name: iconName,
|
|
61
|
+
size: "12"
|
|
76
62
|
})) : null;
|
|
77
|
-
}, [integrationName, title, onClick, iconWrapperClass,
|
|
63
|
+
}, [integrationName, title, onClick, iconWrapperClass, newStyle.fontIcon]);
|
|
78
64
|
return renderCustomIcon ? renderCustomIcon({
|
|
79
65
|
integrationName
|
|
80
66
|
}) : renderDefaultIcon();
|
|
@@ -88,3 +88,11 @@
|
|
|
88
88
|
.asapIcon {
|
|
89
89
|
background-color: var(--imlib_chat_components_imIntegrationIcon_asap_color);
|
|
90
90
|
}
|
|
91
|
+
|
|
92
|
+
.fontIcon :global .path1::before {
|
|
93
|
+
color: var(--imlib_chat_components_imIntegrationIcon_path0_color);;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.fontIcon :global .path2::before {
|
|
97
|
+
color:var(--imlib_chat_components_imIntegrationIcon_path1_color);
|
|
98
|
+
}
|
|
@@ -42,7 +42,7 @@ export default function IMMessage(props) {
|
|
|
42
42
|
onLoadFullMessage,
|
|
43
43
|
onClickReply,
|
|
44
44
|
onTicketClick,
|
|
45
|
-
|
|
45
|
+
messageContentClickMapping,
|
|
46
46
|
customStyle,
|
|
47
47
|
customProps
|
|
48
48
|
} = props;
|
|
@@ -57,11 +57,14 @@ export default function IMMessage(props) {
|
|
|
57
57
|
isHighlightMessage,
|
|
58
58
|
needSender,
|
|
59
59
|
isShowSender,
|
|
60
|
-
isShowMessageTime
|
|
60
|
+
isShowMessageTime,
|
|
61
|
+
isShowMessageStatus
|
|
61
62
|
} = messageDisplayProps;
|
|
62
63
|
const newStyle = useMergeStyle(style, customStyle);
|
|
63
64
|
const {
|
|
64
65
|
direction,
|
|
66
|
+
isIncoming,
|
|
67
|
+
isOutgoing,
|
|
65
68
|
// isBot,
|
|
66
69
|
senderSrc,
|
|
67
70
|
senderAlternateSrc,
|
|
@@ -72,6 +75,7 @@ export default function IMMessage(props) {
|
|
|
72
75
|
// messageType,
|
|
73
76
|
messageStatus,
|
|
74
77
|
isFailedMessage,
|
|
78
|
+
isSendingMessage,
|
|
75
79
|
isAgentMessage,
|
|
76
80
|
messageStatusTitle,
|
|
77
81
|
dateTimeDetails,
|
|
@@ -107,21 +111,23 @@ export default function IMMessage(props) {
|
|
|
107
111
|
const handleRenderMessage = useCallback(() => /*#__PURE__*/React.createElement(IMMessageContent, _extends({
|
|
108
112
|
deleteMessageText: deleteMessageText,
|
|
109
113
|
isFailed: isFailedMessage,
|
|
114
|
+
isSending: isSendingMessage,
|
|
115
|
+
messageContentClickMapping: messageContentClickMapping,
|
|
110
116
|
messageDetails: messageDetails,
|
|
111
|
-
onClick: onMessageContentClick,
|
|
112
117
|
onClickReply: onClickReply,
|
|
113
118
|
onLoadFullMessage: onLoadFullMessage,
|
|
114
119
|
replyText: replyText,
|
|
115
120
|
seeMoreText: seeMoreText,
|
|
116
121
|
sessionDetails: sessionDetails
|
|
117
|
-
}, imMessageContentProps)), [seeMoreText, replyText, deleteMessageText, messageDetails, sessionDetails,
|
|
122
|
+
}, imMessageContentProps)), [seeMoreText, replyText, deleteMessageText, messageDetails, sessionDetails, messageContentClickMapping, onLoadFullMessage, onClickReply, isFailedMessage, isSendingMessage, imMessageContentProps]);
|
|
118
123
|
/** ** Render Secondary Actions - TicketId *** */
|
|
119
124
|
|
|
120
125
|
const handleRenderSecondaryActions = useCallback(() => {
|
|
121
126
|
const {
|
|
122
127
|
imTicketLinkClass
|
|
123
128
|
} = cssJSLogic({
|
|
124
|
-
|
|
129
|
+
isIncoming,
|
|
130
|
+
isOutgoing
|
|
125
131
|
}, newStyle);
|
|
126
132
|
const customStyle = {
|
|
127
133
|
text: imTicketLinkClass
|
|
@@ -133,7 +139,7 @@ export default function IMMessage(props) {
|
|
|
133
139
|
onClick: onTicketClick,
|
|
134
140
|
text: ticketNumber ? `#${ticketNumber}` : ''
|
|
135
141
|
}, imTicketLinkProps));
|
|
136
|
-
}, [ticketNumber, ticketUrl, ticketId, onTicketClick, imTicketLinkProps,
|
|
142
|
+
}, [ticketNumber, ticketUrl, ticketId, onTicketClick, imTicketLinkProps, newStyle, isIncoming, isOutgoing]);
|
|
137
143
|
/** ** Render Owner Status Icon *** */
|
|
138
144
|
|
|
139
145
|
const handleRenderIntegIcon = useCallback(() => /*#__PURE__*/React.createElement(IMIntegrationIcon, _extends({
|
|
@@ -168,6 +174,7 @@ export default function IMMessage(props) {
|
|
|
168
174
|
actions: actions,
|
|
169
175
|
direction: direction,
|
|
170
176
|
isActive: isHighlightMessage,
|
|
177
|
+
isShowMessageStatus: isShowMessageStatus,
|
|
171
178
|
isShowSender: isShowSender,
|
|
172
179
|
needSender: needSender,
|
|
173
180
|
onMouseEnterAction: onMouseEnterAction,
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
/** ** Methods *** */
|
|
2
2
|
import { compileClassNames } from '@zohodesk/utils';
|
|
3
|
-
import getMessageDirectionType from '@zohoim/chat-components-utils/es/imUtils/getMessageDirection';
|
|
4
|
-
/** ** Constants *** */
|
|
5
|
-
|
|
6
|
-
import { direction as directionConstants } from '@zohoim/chat-components-utils/es/constants/messageConstants';
|
|
7
3
|
export default function cssJSLogic(props, style) {
|
|
8
4
|
const {
|
|
9
|
-
|
|
5
|
+
isIncoming,
|
|
6
|
+
isOutgoing
|
|
10
7
|
} = props;
|
|
11
|
-
const {
|
|
12
|
-
direction
|
|
13
|
-
} = getMessageDirectionType({
|
|
14
|
-
messageDetails
|
|
15
|
-
});
|
|
16
8
|
const imTicketLinkClass = compileClassNames({
|
|
17
|
-
[style.ticketLinkLeft]:
|
|
18
|
-
[style.ticketLinkRight]:
|
|
9
|
+
[style.ticketLinkLeft]: isOutgoing,
|
|
10
|
+
[style.ticketLinkRight]: isIncoming
|
|
19
11
|
});
|
|
20
12
|
return {
|
|
21
13
|
imTicketLinkClass
|
|
@@ -7,6 +7,8 @@ const imMessageDefaultProps = {
|
|
|
7
7
|
sessionDetails: dummyObject,
|
|
8
8
|
messageStatusI18N: dummyObject,
|
|
9
9
|
customProps: dummyObject,
|
|
10
|
-
customStyle: dummyObject
|
|
10
|
+
customStyle: dummyObject,
|
|
11
|
+
messageDisplayProps: dummyObject,
|
|
12
|
+
messageContentClickMapping: dummyObject
|
|
11
13
|
};
|
|
12
14
|
export default imMessageDefaultProps;
|
|
@@ -61,6 +61,7 @@ const imMessagePropTypes = {
|
|
|
61
61
|
}),
|
|
62
62
|
messageDisplayProps: PropTypes.shape({
|
|
63
63
|
isHighlightMessage: PropTypes.bool,
|
|
64
|
+
isShowMessageStatus: PropTypes.bool,
|
|
64
65
|
isShowMessageTime: PropTypes.bool,
|
|
65
66
|
isShowSender: PropTypes.bool,
|
|
66
67
|
needSender: PropTypes.bool
|
|
@@ -102,7 +103,7 @@ const imMessagePropTypes = {
|
|
|
102
103
|
onLoadFullMessage: PropTypes.func,
|
|
103
104
|
onClickReply: PropTypes.func,
|
|
104
105
|
onTicketClick: PropTypes.func,
|
|
105
|
-
|
|
106
|
+
messageContentClickMapping: PropTypes.object,
|
|
106
107
|
customStyle: PropTypes.object,
|
|
107
108
|
customProps: PropTypes.shape({
|
|
108
109
|
imIntegrationIconProps: PropTypes.object,
|
|
@@ -38,7 +38,9 @@ export default function IMMessageContent(props) {
|
|
|
38
38
|
customProps,
|
|
39
39
|
renderCustomMessage,
|
|
40
40
|
onClick: propOnClick,
|
|
41
|
-
isFailed
|
|
41
|
+
isFailed,
|
|
42
|
+
isSending,
|
|
43
|
+
messageContentClickMapping
|
|
42
44
|
} = props;
|
|
43
45
|
const {
|
|
44
46
|
imReplyBubbleProps = dummyObject,
|
|
@@ -49,6 +51,10 @@ export default function IMMessageContent(props) {
|
|
|
49
51
|
audioBubbleProps = dummyObject,
|
|
50
52
|
attachmentBubbleProps = dummyObject
|
|
51
53
|
} = customProps;
|
|
54
|
+
const {
|
|
55
|
+
onImageBubbleClick,
|
|
56
|
+
onAttachmentBubbleClick
|
|
57
|
+
} = messageContentClickMapping;
|
|
52
58
|
const {
|
|
53
59
|
isShowLayoutBubble,
|
|
54
60
|
isShowReplyBubble,
|
|
@@ -62,8 +68,7 @@ export default function IMMessageContent(props) {
|
|
|
62
68
|
isShowDeleteBubble,
|
|
63
69
|
replyToMessageDetails: replyToMessage,
|
|
64
70
|
attachmentDetails,
|
|
65
|
-
locationUrl
|
|
66
|
-
onClick
|
|
71
|
+
locationUrl
|
|
67
72
|
} = useIMMessageContent({
|
|
68
73
|
messageDetails,
|
|
69
74
|
onClick: propOnClick
|
|
@@ -72,8 +77,7 @@ export default function IMMessageContent(props) {
|
|
|
72
77
|
|
|
73
78
|
const newStyle = useMergeStyle(style, customStyle);
|
|
74
79
|
const wrapperDivProps = {
|
|
75
|
-
className: newStyle.messageContentRow
|
|
76
|
-
onClick
|
|
80
|
+
className: newStyle.messageContentRow
|
|
77
81
|
};
|
|
78
82
|
return /*#__PURE__*/React.createElement(Fragment, null, isShowLayoutBubble ? null : null, isShowDeleteBubble ? /*#__PURE__*/React.createElement("div", {
|
|
79
83
|
className: newStyle.deleteBubble
|
|
@@ -87,7 +91,9 @@ export default function IMMessageContent(props) {
|
|
|
87
91
|
isFailed
|
|
88
92
|
}) : null, isShowImageBubble ? /*#__PURE__*/React.createElement("div", wrapperDivProps, /*#__PURE__*/React.createElement(ImageBubble, _extends({
|
|
89
93
|
imageDetails: attachmentDetails,
|
|
90
|
-
isFailed: isFailed
|
|
94
|
+
isFailed: isFailed,
|
|
95
|
+
isSending: isSending,
|
|
96
|
+
onClick: onImageBubbleClick
|
|
91
97
|
}, imageBubbleProps))) : null, isShowVideoBubble ? /*#__PURE__*/React.createElement("div", wrapperDivProps, /*#__PURE__*/React.createElement(VideoBubble, _extends({
|
|
92
98
|
isFailed: isFailed,
|
|
93
99
|
videoDetails: attachmentDetails
|
|
@@ -96,7 +102,8 @@ export default function IMMessageContent(props) {
|
|
|
96
102
|
isFailed: isFailed
|
|
97
103
|
}, audioBubbleProps))) : null, isShowAttachmentBubble ? /*#__PURE__*/React.createElement("div", wrapperDivProps, /*#__PURE__*/React.createElement(AttachmentBubble, _extends({
|
|
98
104
|
attachmentDetails: attachmentDetails,
|
|
99
|
-
isFailed: isFailed
|
|
105
|
+
isFailed: isFailed,
|
|
106
|
+
onClick: onAttachmentBubbleClick
|
|
100
107
|
}, attachmentBubbleProps))) : null, isShowLocationBubble ? /*#__PURE__*/React.createElement("div", wrapperDivProps, /*#__PURE__*/React.createElement(LocationBubble, _extends({
|
|
101
108
|
isFailed: isFailed,
|
|
102
109
|
locationUrl: locationUrl
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
|
|
3
3
|
const imMessageContentDefaultProps = {
|
|
4
4
|
customStyle: dummyObject,
|
|
5
|
-
customProps: dummyObject
|
|
5
|
+
customProps: dummyObject,
|
|
6
|
+
messageContentClickMapping: dummyObject
|
|
6
7
|
};
|
|
7
8
|
export default imMessageContentDefaultProps;
|
|
@@ -27,6 +27,7 @@ const imMessageContentPropTypes = {
|
|
|
27
27
|
id: PropTypes.string
|
|
28
28
|
}),
|
|
29
29
|
onClick: PropTypes.func,
|
|
30
|
+
messageContentClickMapping: PropTypes.object,
|
|
30
31
|
onLoadFullMessage: PropTypes.func,
|
|
31
32
|
onClickReply: PropTypes.func,
|
|
32
33
|
seeMoreText: PropTypes.string,
|
|
@@ -43,6 +44,7 @@ const imMessageContentPropTypes = {
|
|
|
43
44
|
locationBubbleProps: PropTypes.object,
|
|
44
45
|
videoBubbleProps: PropTypes.object
|
|
45
46
|
}),
|
|
46
|
-
isFailed: PropTypes.bool
|
|
47
|
+
isFailed: PropTypes.bool,
|
|
48
|
+
isSending: PropTypes.bool
|
|
47
49
|
};
|
|
48
50
|
export default imMessageContentPropTypes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohoim/chat-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
4
4
|
"description": "Chat Components",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -32,11 +32,12 @@
|
|
|
32
32
|
"@zohodesk/components": "1.0.0-alpha-259",
|
|
33
33
|
"@zohodesk/hooks": "1.3.12",
|
|
34
34
|
"@zohodesk/icon": "1.3.12",
|
|
35
|
+
"@zohodesk/icons": "1.0.7",
|
|
35
36
|
"@zohodesk/utils": "1.3.9",
|
|
36
37
|
"@zohodesk/variables": "1.0.0-beta.30",
|
|
37
38
|
"@zohodesk/virtualizer": "1.0.13",
|
|
38
|
-
"@zohoim/chat-components-hooks": "^0.0.
|
|
39
|
-
"@zohoim/chat-components-utils": "^0.0.
|
|
39
|
+
"@zohoim/chat-components-hooks": "^0.0.18",
|
|
40
|
+
"@zohoim/chat-components-utils": "^0.0.17"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
43
|
"@zohodesk-private/css-variable-migrator": "1.0.1",
|
|
@@ -44,5 +45,5 @@
|
|
|
44
45
|
"jsdom": "22.1.0",
|
|
45
46
|
"react-to-jsx": "1.3.2"
|
|
46
47
|
},
|
|
47
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "8ddb3ec73ad57fdb8e9b3eb909d348936f6f2077"
|
|
48
49
|
}
|