@zohoim/chat-components 1.2.1 → 1.2.3-beta-3
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/README.md +4 -0
- package/assets/Appearance/dark/mode/General_DarkMode.module.css +1 -0
- package/assets/Appearance/light/mode/General_LightMode.module.css +1 -0
- package/assets/Appearance/pureDark/mode/General_PureDarkMode.module.css +1 -0
- package/es/icons/factory/common/mobile.svg +3 -0
- package/es/icons/iconSrc/common/Mobile.js +13 -0
- package/es/icons/iconSrc/common/index.js +2 -1
- package/es/im/IMIntegrationIcon/IMIntegrationIcon.js +4 -2
- package/es/im/IMIntegrationIcon/css/IMIntegrationIcon.module.css +6 -0
- package/es/im/IMIntegrationIcon/css/cssJSLogic.js +5 -2
- package/es/im/IMMessage/IMMessage.js +3 -1
- package/es/im/IMMessageMeta/IMMessageMeta.js +21 -4
- package/es/im/IMMessageMeta/css/IMMessageMeta.module.css +13 -2
- package/lib/icons/factory/common/mobile.svg +3 -0
- package/lib/icons/iconSrc/common/Mobile.js +25 -0
- package/lib/icons/iconSrc/common/index.js +8 -0
- package/lib/im/IMIntegrationIcon/IMIntegrationIcon.js +3 -2
- package/lib/im/IMIntegrationIcon/css/IMIntegrationIcon.module.css +6 -0
- package/lib/im/IMIntegrationIcon/css/cssJSLogic.js +4 -2
- package/lib/im/IMMessage/IMMessage.js +3 -1
- package/lib/im/IMMessageMeta/IMMessageMeta.js +32 -5
- package/lib/im/IMMessageMeta/css/IMMessageMeta.module.css +13 -2
- package/package.json +6 -7
package/README.md
CHANGED
|
@@ -10,6 +10,10 @@ In this Library, We Provide Some Basic Message Components to Build Your Chat App
|
|
|
10
10
|
|
|
11
11
|
> import MessageBubble from '@zohoim/chat-components/es/MessageBubble/MessageBubble’;
|
|
12
12
|
|
|
13
|
+
# 1.2.3
|
|
14
|
+
|
|
15
|
+
- The IMMessageMeta component has been updated to improve icon handling and display capabilities.
|
|
16
|
+
|
|
13
17
|
# 1.2.1
|
|
14
18
|
|
|
15
19
|
- The direction constant has been updated from "IN/OUT" to "in/out".
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
--imlib_chat_components_imIntegrationIcon_instagram_color: linear-gradient(221.05deg,#933ab9 11.59%,#d12f8c 50.45%,#fdbb59 85.46%);
|
|
13
13
|
--imlib_chat_components_imIntegrationIcon_asap_color: linear-gradient(180deg, #A375FF 0%, #7732FF 100%);
|
|
14
14
|
--imlib_chat_components_imIntegrationIcon_fb_color: hsla(215, 100.00%, calc(50.00% + var(--zdc_darker_lower)), calc(1 + var(--zdc_alpha_low)));
|
|
15
|
+
--imlib_chat_components_imIntegrationIcon_weCom_color: hsla(215, 48.12%, calc(53.14% + var(--zdc_darker_lower)), calc(1 + var(--zdc_alpha_low)));
|
|
15
16
|
|
|
16
17
|
/* two tone icon colors */
|
|
17
18
|
--imlib_chat_components_imTtIcon_path0_color: rgba(255, 255, 255, 0.25);
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
--imlib_chat_components_imIntegrationIcon_instagram_color: linear-gradient(221.05deg,#933ab9 11.59%,#d12f8c 50.45%,#fdbb59 85.46%);
|
|
13
13
|
--imlib_chat_components_imIntegrationIcon_asap_color: linear-gradient(180deg, #A375FF 0%, #7732FF 100%);
|
|
14
14
|
--imlib_chat_components_imIntegrationIcon_fb_color: hsla(215, 100.00%, calc(50.00% + var(--zdc_darker_lower)), calc(1 + var(--zdc_alpha_low)));
|
|
15
|
+
--imlib_chat_components_imIntegrationIcon_weCom_color: hsla(215, 48.12%, calc(53.14% + var(--zdc_darker_lower)), calc(1 + var(--zdc_alpha_low)));
|
|
15
16
|
|
|
16
17
|
/* two tone icon colors */
|
|
17
18
|
--imlib_chat_components_imTtIcon_path0_color: rgba(200,203,220,0.7);
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
--imlib_chat_components_imIntegrationIcon_instagram_color: linear-gradient(221.05deg,#933ab9 11.59%,#d12f8c 50.45%,#fdbb59 85.46%);
|
|
13
13
|
--imlib_chat_components_imIntegrationIcon_asap_color: linear-gradient(180deg, #A375FF 0%, #7732FF 100%);
|
|
14
14
|
--imlib_chat_components_imIntegrationIcon_fb_color: hsla(215, 100.00%, calc(50.00% + var(--zdc_darker_lower)), calc(1 + var(--zdc_alpha_low)));
|
|
15
|
+
--imlib_chat_components_imIntegrationIcon_weCom_color: hsla(215, 48.12%, calc(53.14% + var(--zdc_darker_lower)), calc(1 + var(--zdc_alpha_low)));
|
|
15
16
|
|
|
16
17
|
/* two tone icon colors */
|
|
17
18
|
--imlib_chat_components_imTtIcon_path0_color: rgba(255, 255, 255, 0.25);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M8.082 1.35645H3.726C3.40774 1.35645 3.10252 1.48287 2.87747 1.70792C2.65243 1.93296 2.526 2.23819 2.526 2.55645V9.60045C2.526 9.91871 2.65243 10.2239 2.87747 10.449C3.10252 10.674 3.40774 10.8004 3.726 10.8004H8.082C8.40026 10.8004 8.70549 10.674 8.93053 10.449C9.15557 10.2239 9.282 9.91871 9.282 9.60045V2.55645C9.282 2.23819 9.15557 1.93296 8.93053 1.70792C8.70549 1.48287 8.40026 1.35645 8.082 1.35645ZM8.682 9.60645C8.682 9.76558 8.61879 9.91819 8.50627 10.0307C8.39374 10.1432 8.24113 10.2064 8.082 10.2064H3.726C3.56687 10.2064 3.41426 10.1432 3.30174 10.0307C3.18922 9.91819 3.126 9.76558 3.126 9.60645V2.55645C3.126 2.39732 3.18922 2.2447 3.30174 2.13218C3.41426 2.01966 3.56687 1.95645 3.726 1.95645H8.082C8.24113 1.95645 8.39374 2.01966 8.50627 2.13218C8.61879 2.2447 8.682 2.39732 8.682 2.55645V9.60645ZM6.333 9.06045C6.33241 9.14516 6.30675 9.22781 6.25925 9.29796C6.21175 9.36812 6.14454 9.42263 6.0661 9.45464C5.98766 9.48665 5.9015 9.49472 5.81848 9.47783C5.73546 9.46094 5.6593 9.41985 5.59961 9.35974C5.53991 9.29962 5.49935 9.22318 5.48304 9.14004C5.46673 9.05691 5.4754 8.9708 5.50795 8.89259C5.54051 8.81437 5.59549 8.74755 5.66598 8.70054C5.73646 8.65353 5.81928 8.62845 5.904 8.62845C5.96059 8.62844 6.01662 8.63964 6.06887 8.66139C6.12111 8.68313 6.16854 8.715 6.20842 8.75516C6.24829 8.79531 6.27983 8.84296 6.30121 8.89535C6.32259 8.94775 6.3334 9.00386 6.333 9.06045V9.06045ZM6.861 3.15945C6.861 3.23901 6.82939 3.31532 6.77313 3.37158C6.71687 3.42784 6.64057 3.45945 6.561 3.45945H5.247C5.16744 3.45945 5.09113 3.42784 5.03487 3.37158C4.97861 3.31532 4.947 3.23901 4.947 3.15945C4.947 3.07988 4.97861 3.00357 5.03487 2.94731C5.09113 2.89105 5.16744 2.85945 5.247 2.85945H6.561C6.6004 2.85945 6.63941 2.86721 6.67581 2.88228C6.7122 2.89736 6.74528 2.91946 6.77313 2.94731C6.80099 2.97517 6.82309 3.00824 6.83817 3.04464C6.85324 3.08104 6.861 3.12005 6.861 3.15945V3.15945Z" fill="#9C9FAB"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Icon from '@zohodesk/icon/es/Icon/Icon';
|
|
4
|
+
export default function IconComponent(props) {
|
|
5
|
+
return /*#__PURE__*/React.createElement(Icon, props, /*#__PURE__*/React.createElement("svg", {
|
|
6
|
+
id: "mobile",
|
|
7
|
+
viewBox: "0 0 12 12",
|
|
8
|
+
fill: "none"
|
|
9
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
10
|
+
d: "M8.082 1.35645H3.726C3.40774 1.35645 3.10252 1.48287 2.87747 1.70792C2.65243 1.93296 2.526 2.23819 2.526 2.55645V9.60045C2.526 9.91871 2.65243 10.2239 2.87747 10.449C3.10252 10.674 3.40774 10.8004 3.726 10.8004H8.082C8.40026 10.8004 8.70549 10.674 8.93053 10.449C9.15557 10.2239 9.282 9.91871 9.282 9.60045V2.55645C9.282 2.23819 9.15557 1.93296 8.93053 1.70792C8.70549 1.48287 8.40026 1.35645 8.082 1.35645ZM8.682 9.60645C8.682 9.76558 8.61879 9.91819 8.50627 10.0307C8.39374 10.1432 8.24113 10.2064 8.082 10.2064H3.726C3.56687 10.2064 3.41426 10.1432 3.30174 10.0307C3.18922 9.91819 3.126 9.76558 3.126 9.60645V2.55645C3.126 2.39732 3.18922 2.2447 3.30174 2.13218C3.41426 2.01966 3.56687 1.95645 3.726 1.95645H8.082C8.24113 1.95645 8.39374 2.01966 8.50627 2.13218C8.61879 2.2447 8.682 2.39732 8.682 2.55645V9.60645ZM6.333 9.06045C6.33241 9.14516 6.30675 9.22781 6.25925 9.29796C6.21175 9.36812 6.14454 9.42263 6.0661 9.45464C5.98766 9.48665 5.9015 9.49472 5.81848 9.47783C5.73546 9.46094 5.6593 9.41985 5.59961 9.35974C5.53991 9.29962 5.49935 9.22318 5.48304 9.14004C5.46673 9.05691 5.4754 8.9708 5.50795 8.89259C5.54051 8.81437 5.59549 8.74755 5.66598 8.70054C5.73646 8.65353 5.81928 8.62845 5.904 8.62845C5.96059 8.62844 6.01662 8.63964 6.06887 8.66139C6.12111 8.68313 6.16854 8.715 6.20842 8.75516C6.24829 8.79531 6.27983 8.84296 6.30121 8.89535C6.32259 8.94775 6.3334 9.00386 6.333 9.06045V9.06045ZM6.861 3.15945C6.861 3.23901 6.82939 3.31532 6.77313 3.37158C6.71687 3.42784 6.64057 3.45945 6.561 3.45945H5.247C5.16744 3.45945 5.09113 3.42784 5.03487 3.37158C4.97861 3.31532 4.947 3.23901 4.947 3.15945C4.947 3.07988 4.97861 3.00357 5.03487 2.94731C5.09113 2.89105 5.16744 2.85945 5.247 2.85945H6.561C6.6004 2.85945 6.63941 2.86721 6.67581 2.88228C6.7122 2.89736 6.74528 2.91946 6.77313 2.94731C6.80099 2.97517 6.82309 3.00824 6.83817 3.04464C6.85324 3.08104 6.861 3.12005 6.861 3.15945V3.15945Z"
|
|
11
|
+
})));
|
|
12
|
+
}
|
|
13
|
+
IconComponent.propTypes = Icon.propTypes;
|
|
@@ -21,7 +21,8 @@ const {
|
|
|
21
21
|
TWILLIO,
|
|
22
22
|
LINE,
|
|
23
23
|
FACEBOOKMESSENGER,
|
|
24
|
-
INSTAGRAM
|
|
24
|
+
INSTAGRAM,
|
|
25
|
+
WECOM
|
|
25
26
|
} = integrationConstants;
|
|
26
27
|
const fontIconMap = {
|
|
27
28
|
[TWILLIO]: 'ZD-TT-imtwillio',
|
|
@@ -31,7 +32,8 @@ const fontIconMap = {
|
|
|
31
32
|
[LINE]: 'ZD-TT-imLine',
|
|
32
33
|
[IM_TALK]: 'ZD-TT-imASAP',
|
|
33
34
|
[FACEBOOKMESSENGER]: 'ZD-TT-fbMessanger',
|
|
34
|
-
[INSTAGRAM]: 'ZD-TT-instagram'
|
|
35
|
+
[INSTAGRAM]: 'ZD-TT-instagram',
|
|
36
|
+
[WECOM]: 'ZD-TT-weCom'
|
|
35
37
|
};
|
|
36
38
|
export default function IMIntegrationIcon(props) {
|
|
37
39
|
const {
|
|
@@ -12,7 +12,8 @@ const {
|
|
|
12
12
|
WECHAT,
|
|
13
13
|
TWILLIO,
|
|
14
14
|
LINE,
|
|
15
|
-
FACEBOOKMESSENGER
|
|
15
|
+
FACEBOOKMESSENGER,
|
|
16
|
+
WECOM
|
|
16
17
|
} = integrationConstants;
|
|
17
18
|
export default function cssJSLogic(props, style) {
|
|
18
19
|
const {
|
|
@@ -27,6 +28,7 @@ export default function cssJSLogic(props, style) {
|
|
|
27
28
|
const isTwillioIcon = integrationName === TWILLIO;
|
|
28
29
|
const isLineIcon = integrationName === LINE;
|
|
29
30
|
const isFbIcon = integrationName === FACEBOOKMESSENGER;
|
|
31
|
+
const isWeComIcon = integrationName === WECOM;
|
|
30
32
|
const isSmall = size === sizes.SMALL;
|
|
31
33
|
const isMedium = size === sizes.MEDIUM;
|
|
32
34
|
const iconWrapperClass = compileClassNames({
|
|
@@ -40,7 +42,8 @@ export default function cssJSLogic(props, style) {
|
|
|
40
42
|
[style.weChatIcon]: isWeChatIcon,
|
|
41
43
|
[style.twillioIcon]: isTwillioIcon,
|
|
42
44
|
[style.lineIcon]: isLineIcon,
|
|
43
|
-
[style.fbIcon]: isFbIcon
|
|
45
|
+
[style.fbIcon]: isFbIcon,
|
|
46
|
+
[style.weComIcon]: isWeComIcon
|
|
44
47
|
});
|
|
45
48
|
const iconClass = compileClassNames({
|
|
46
49
|
[style.small]: isSmall,
|
|
@@ -78,6 +78,7 @@ export default function IMMessage(props) {
|
|
|
78
78
|
messageStatus,
|
|
79
79
|
isFailedMessage,
|
|
80
80
|
isSendingMessage,
|
|
81
|
+
isSentViaMobile,
|
|
81
82
|
messageStatusTitle,
|
|
82
83
|
isValidAttachment,
|
|
83
84
|
dateTimeDetails,
|
|
@@ -102,12 +103,13 @@ export default function IMMessage(props) {
|
|
|
102
103
|
return /*#__PURE__*/React.createElement(IMMessageMeta, _extends({
|
|
103
104
|
autoMessageType: autoMessageType,
|
|
104
105
|
direction: direction,
|
|
106
|
+
isSentViaMobile: isSentViaMobile,
|
|
105
107
|
isValidAttachment: isValidAttachment,
|
|
106
108
|
messageMetaInfoI18N: messageMetaInfoI18N,
|
|
107
109
|
time: isShowMessageTime ? displayDateTime : '',
|
|
108
110
|
timeTooltip: tooltip
|
|
109
111
|
}, imMessageMetaProps));
|
|
110
|
-
}, [isShowMessageTime, dateTimeDetails, direction, autoMessageType, imMessageMetaProps, isValidAttachment, messageMetaInfoI18N]);
|
|
112
|
+
}, [isShowMessageTime, dateTimeDetails, direction, autoMessageType, imMessageMetaProps, isValidAttachment, messageMetaInfoI18N, isSentViaMobile]);
|
|
111
113
|
/** ** Render Message Content *** */
|
|
112
114
|
|
|
113
115
|
const handleRenderMessage = useCallback(() => /*#__PURE__*/React.createElement(IMMessageContent, _extends({
|
|
@@ -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 from 'react';
|
|
4
|
+
import React, { useMemo } from 'react';
|
|
5
5
|
/** ** Hooks *** */
|
|
6
6
|
|
|
7
7
|
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
@@ -21,8 +21,13 @@ import style from './css/IMMessageMeta.module.css';
|
|
|
21
21
|
|
|
22
22
|
import { Container } from '@zohodesk/components/es/Layout';
|
|
23
23
|
import IMMessageMetaInfo from '../IMMessageMetaInfo/IMMessageMetaInfo';
|
|
24
|
+
import Mobile from '../../icons/iconSrc/common/Mobile';
|
|
25
|
+
const iconMapping = {
|
|
26
|
+
mobile: Mobile
|
|
27
|
+
};
|
|
24
28
|
export default function IMMessageMeta(props) {
|
|
25
29
|
const {
|
|
30
|
+
isSentViaMobile,
|
|
26
31
|
direction,
|
|
27
32
|
customStyle,
|
|
28
33
|
time,
|
|
@@ -37,11 +42,14 @@ export default function IMMessageMeta(props) {
|
|
|
37
42
|
} = customProps;
|
|
38
43
|
const {
|
|
39
44
|
imMessageMetaInfoTitle,
|
|
40
|
-
imMessageMetaInfoContent
|
|
45
|
+
imMessageMetaInfoContent,
|
|
46
|
+
imMessageMetaInfoIcon,
|
|
47
|
+
imMessageMetaInfoIconTitle
|
|
41
48
|
} = useIMMessageMeta({
|
|
42
49
|
messageMetaInfoI18N,
|
|
43
50
|
autoMessageType,
|
|
44
|
-
isValidAttachment
|
|
51
|
+
isValidAttachment,
|
|
52
|
+
isSentViaMobile
|
|
45
53
|
});
|
|
46
54
|
/* External CSS Customization */
|
|
47
55
|
|
|
@@ -54,10 +62,19 @@ export default function IMMessageMeta(props) {
|
|
|
54
62
|
} = cssJSLogic({
|
|
55
63
|
direction
|
|
56
64
|
}, newStyle);
|
|
65
|
+
const iconStyle = useMemo(() => ({
|
|
66
|
+
base: newStyle.icon
|
|
67
|
+
}), [newStyle.icon]);
|
|
68
|
+
const IconComponent = imMessageMetaInfoIcon ? iconMapping[imMessageMetaInfoIcon] : null;
|
|
57
69
|
return /*#__PURE__*/React.createElement(React.Fragment, null, imMessageMetaInfoContent || time ? /*#__PURE__*/React.createElement(Container, {
|
|
58
70
|
alignBox: "row",
|
|
59
71
|
className: imMessageMetaClass
|
|
60
|
-
},
|
|
72
|
+
}, IconComponent ? /*#__PURE__*/React.createElement("div", {
|
|
73
|
+
className: newStyle.iconWrapper,
|
|
74
|
+
"data-title": imMessageMetaInfoIconTitle
|
|
75
|
+
}, /*#__PURE__*/React.createElement(IconComponent, {
|
|
76
|
+
customStyle: iconStyle
|
|
77
|
+
})) : null, imMessageMetaInfoContent ? /*#__PURE__*/React.createElement(IMMessageMetaInfo, _extends({
|
|
61
78
|
imMessageMetaInfoContent: imMessageMetaInfoContent,
|
|
62
79
|
imMessageMetaInfoTitle: imMessageMetaInfoTitle
|
|
63
80
|
}, imMessageMetaInfoProps)) : null, imMessageMetaInfoContent && time ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -38,9 +38,20 @@
|
|
|
38
38
|
|
|
39
39
|
.dateTime {
|
|
40
40
|
font-size: var(--zd_font_size11) ;
|
|
41
|
-
/* max-width: 100px; */
|
|
42
|
-
/* display: flex; */
|
|
43
41
|
max-width: var(--zd_size100) ;
|
|
44
42
|
composes: dotted from '../../css/common.module.css';
|
|
45
43
|
color: var(--imlib_chat_components_imMessageMeta_time_color);
|
|
46
44
|
}
|
|
45
|
+
|
|
46
|
+
.icon {
|
|
47
|
+
width: var(--zd_size14) ;
|
|
48
|
+
height: var(--zd_size14) ;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[dir=ltr] .iconWrapper{
|
|
52
|
+
margin-right: var(--zd_size4) ;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
[dir=rtl] .iconWrapper{
|
|
56
|
+
margin-left: var(--zd_size4) ;
|
|
57
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M8.082 1.35645H3.726C3.40774 1.35645 3.10252 1.48287 2.87747 1.70792C2.65243 1.93296 2.526 2.23819 2.526 2.55645V9.60045C2.526 9.91871 2.65243 10.2239 2.87747 10.449C3.10252 10.674 3.40774 10.8004 3.726 10.8004H8.082C8.40026 10.8004 8.70549 10.674 8.93053 10.449C9.15557 10.2239 9.282 9.91871 9.282 9.60045V2.55645C9.282 2.23819 9.15557 1.93296 8.93053 1.70792C8.70549 1.48287 8.40026 1.35645 8.082 1.35645ZM8.682 9.60645C8.682 9.76558 8.61879 9.91819 8.50627 10.0307C8.39374 10.1432 8.24113 10.2064 8.082 10.2064H3.726C3.56687 10.2064 3.41426 10.1432 3.30174 10.0307C3.18922 9.91819 3.126 9.76558 3.126 9.60645V2.55645C3.126 2.39732 3.18922 2.2447 3.30174 2.13218C3.41426 2.01966 3.56687 1.95645 3.726 1.95645H8.082C8.24113 1.95645 8.39374 2.01966 8.50627 2.13218C8.61879 2.2447 8.682 2.39732 8.682 2.55645V9.60645ZM6.333 9.06045C6.33241 9.14516 6.30675 9.22781 6.25925 9.29796C6.21175 9.36812 6.14454 9.42263 6.0661 9.45464C5.98766 9.48665 5.9015 9.49472 5.81848 9.47783C5.73546 9.46094 5.6593 9.41985 5.59961 9.35974C5.53991 9.29962 5.49935 9.22318 5.48304 9.14004C5.46673 9.05691 5.4754 8.9708 5.50795 8.89259C5.54051 8.81437 5.59549 8.74755 5.66598 8.70054C5.73646 8.65353 5.81928 8.62845 5.904 8.62845C5.96059 8.62844 6.01662 8.63964 6.06887 8.66139C6.12111 8.68313 6.16854 8.715 6.20842 8.75516C6.24829 8.79531 6.27983 8.84296 6.30121 8.89535C6.32259 8.94775 6.3334 9.00386 6.333 9.06045V9.06045ZM6.861 3.15945C6.861 3.23901 6.82939 3.31532 6.77313 3.37158C6.71687 3.42784 6.64057 3.45945 6.561 3.45945H5.247C5.16744 3.45945 5.09113 3.42784 5.03487 3.37158C4.97861 3.31532 4.947 3.23901 4.947 3.15945C4.947 3.07988 4.97861 3.00357 5.03487 2.94731C5.09113 2.89105 5.16744 2.85945 5.247 2.85945H6.561C6.6004 2.85945 6.63941 2.86721 6.67581 2.88228C6.7122 2.89736 6.74528 2.91946 6.77313 2.94731C6.80099 2.97517 6.82309 3.00824 6.83817 3.04464C6.85324 3.08104 6.861 3.12005 6.861 3.15945V3.15945Z" fill="#9C9FAB"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = IconComponent;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _Icon = _interopRequireDefault(require("@zohodesk/icon/es/Icon/Icon"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
|
|
14
|
+
/* eslint-disable */
|
|
15
|
+
function IconComponent(props) {
|
|
16
|
+
return /*#__PURE__*/_react["default"].createElement(_Icon["default"], props, /*#__PURE__*/_react["default"].createElement("svg", {
|
|
17
|
+
id: "mobile",
|
|
18
|
+
viewBox: "0 0 12 12",
|
|
19
|
+
fill: "none"
|
|
20
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
21
|
+
d: "M8.082 1.35645H3.726C3.40774 1.35645 3.10252 1.48287 2.87747 1.70792C2.65243 1.93296 2.526 2.23819 2.526 2.55645V9.60045C2.526 9.91871 2.65243 10.2239 2.87747 10.449C3.10252 10.674 3.40774 10.8004 3.726 10.8004H8.082C8.40026 10.8004 8.70549 10.674 8.93053 10.449C9.15557 10.2239 9.282 9.91871 9.282 9.60045V2.55645C9.282 2.23819 9.15557 1.93296 8.93053 1.70792C8.70549 1.48287 8.40026 1.35645 8.082 1.35645ZM8.682 9.60645C8.682 9.76558 8.61879 9.91819 8.50627 10.0307C8.39374 10.1432 8.24113 10.2064 8.082 10.2064H3.726C3.56687 10.2064 3.41426 10.1432 3.30174 10.0307C3.18922 9.91819 3.126 9.76558 3.126 9.60645V2.55645C3.126 2.39732 3.18922 2.2447 3.30174 2.13218C3.41426 2.01966 3.56687 1.95645 3.726 1.95645H8.082C8.24113 1.95645 8.39374 2.01966 8.50627 2.13218C8.61879 2.2447 8.682 2.39732 8.682 2.55645V9.60645ZM6.333 9.06045C6.33241 9.14516 6.30675 9.22781 6.25925 9.29796C6.21175 9.36812 6.14454 9.42263 6.0661 9.45464C5.98766 9.48665 5.9015 9.49472 5.81848 9.47783C5.73546 9.46094 5.6593 9.41985 5.59961 9.35974C5.53991 9.29962 5.49935 9.22318 5.48304 9.14004C5.46673 9.05691 5.4754 8.9708 5.50795 8.89259C5.54051 8.81437 5.59549 8.74755 5.66598 8.70054C5.73646 8.65353 5.81928 8.62845 5.904 8.62845C5.96059 8.62844 6.01662 8.63964 6.06887 8.66139C6.12111 8.68313 6.16854 8.715 6.20842 8.75516C6.24829 8.79531 6.27983 8.84296 6.30121 8.89535C6.32259 8.94775 6.3334 9.00386 6.333 9.06045V9.06045ZM6.861 3.15945C6.861 3.23901 6.82939 3.31532 6.77313 3.37158C6.71687 3.42784 6.64057 3.45945 6.561 3.45945H5.247C5.16744 3.45945 5.09113 3.42784 5.03487 3.37158C4.97861 3.31532 4.947 3.23901 4.947 3.15945C4.947 3.07988 4.97861 3.00357 5.03487 2.94731C5.09113 2.89105 5.16744 2.85945 5.247 2.85945H6.561C6.6004 2.85945 6.63941 2.86721 6.67581 2.88228C6.7122 2.89736 6.74528 2.91946 6.77313 2.94731C6.80099 2.97517 6.82309 3.00824 6.83817 3.04464C6.85324 3.08104 6.861 3.12005 6.861 3.15945V3.15945Z"
|
|
22
|
+
})));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
IconComponent.propTypes = _Icon["default"].propTypes;
|
|
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "Article", {
|
|
|
15
15
|
return _Article["default"];
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "Mobile", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _Mobile["default"];
|
|
22
|
+
}
|
|
23
|
+
});
|
|
18
24
|
Object.defineProperty(exports, "Reply", {
|
|
19
25
|
enumerable: true,
|
|
20
26
|
get: function get() {
|
|
@@ -28,4 +34,6 @@ var _Article = _interopRequireDefault(require("./Article"));
|
|
|
28
34
|
|
|
29
35
|
var _Reply = _interopRequireDefault(require("./Reply"));
|
|
30
36
|
|
|
37
|
+
var _Mobile = _interopRequireDefault(require("./Mobile"));
|
|
38
|
+
|
|
31
39
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -40,8 +40,9 @@ var WHATSAPP = _integrationConstants["default"].WHATSAPP,
|
|
|
40
40
|
TWILLIO = _integrationConstants["default"].TWILLIO,
|
|
41
41
|
LINE = _integrationConstants["default"].LINE,
|
|
42
42
|
FACEBOOKMESSENGER = _integrationConstants["default"].FACEBOOKMESSENGER,
|
|
43
|
-
INSTAGRAM = _integrationConstants["default"].INSTAGRAM
|
|
44
|
-
|
|
43
|
+
INSTAGRAM = _integrationConstants["default"].INSTAGRAM,
|
|
44
|
+
WECOM = _integrationConstants["default"].WECOM;
|
|
45
|
+
var fontIconMap = (_fontIconMap = {}, _defineProperty(_fontIconMap, TWILLIO, 'ZD-TT-imtwillio'), _defineProperty(_fontIconMap, WHATSAPP, 'ZD-TT-whatsApp'), _defineProperty(_fontIconMap, TELEGRAM, 'ZD-TT-imTelegram'), _defineProperty(_fontIconMap, WECHAT, 'ZD-TT-imWeChat'), _defineProperty(_fontIconMap, LINE, 'ZD-TT-imLine'), _defineProperty(_fontIconMap, IM_TALK, 'ZD-TT-imASAP'), _defineProperty(_fontIconMap, FACEBOOKMESSENGER, 'ZD-TT-fbMessanger'), _defineProperty(_fontIconMap, INSTAGRAM, 'ZD-TT-instagram'), _defineProperty(_fontIconMap, WECOM, 'ZD-TT-weCom'), _fontIconMap);
|
|
45
46
|
|
|
46
47
|
function IMIntegrationIcon(props) {
|
|
47
48
|
var customStyle = props.customStyle,
|
|
@@ -22,7 +22,8 @@ var WHATSAPP = _integrationConstants["default"].WHATSAPP,
|
|
|
22
22
|
WECHAT = _integrationConstants["default"].WECHAT,
|
|
23
23
|
TWILLIO = _integrationConstants["default"].TWILLIO,
|
|
24
24
|
LINE = _integrationConstants["default"].LINE,
|
|
25
|
-
FACEBOOKMESSENGER = _integrationConstants["default"].FACEBOOKMESSENGER
|
|
25
|
+
FACEBOOKMESSENGER = _integrationConstants["default"].FACEBOOKMESSENGER,
|
|
26
|
+
WECOM = _integrationConstants["default"].WECOM;
|
|
26
27
|
|
|
27
28
|
function cssJSLogic(props, style) {
|
|
28
29
|
var _compileClassNames, _compileClassNames2;
|
|
@@ -37,9 +38,10 @@ function cssJSLogic(props, style) {
|
|
|
37
38
|
var isTwillioIcon = integrationName === TWILLIO;
|
|
38
39
|
var isLineIcon = integrationName === LINE;
|
|
39
40
|
var isFbIcon = integrationName === FACEBOOKMESSENGER;
|
|
41
|
+
var isWeComIcon = integrationName === WECOM;
|
|
40
42
|
var isSmall = size === _sizes["default"].SMALL;
|
|
41
43
|
var isMedium = size === _sizes["default"].MEDIUM;
|
|
42
|
-
var iconWrapperClass = (0, _utils.compileClassNames)((_compileClassNames = {}, _defineProperty(_compileClassNames, style.integrationIcon, true), _defineProperty(_compileClassNames, style.small, isSmall), _defineProperty(_compileClassNames, style.medium, isMedium), _defineProperty(_compileClassNames, style.whatsappIcon, isWhatsAppIcon), _defineProperty(_compileClassNames, style.telegramIcon, isTelegramIcon), _defineProperty(_compileClassNames, style.instagramIcon, isInstagramIcon), _defineProperty(_compileClassNames, style.asapIcon, isIMTalkIcon), _defineProperty(_compileClassNames, style.weChatIcon, isWeChatIcon), _defineProperty(_compileClassNames, style.twillioIcon, isTwillioIcon), _defineProperty(_compileClassNames, style.lineIcon, isLineIcon), _defineProperty(_compileClassNames, style.fbIcon, isFbIcon), _compileClassNames));
|
|
44
|
+
var iconWrapperClass = (0, _utils.compileClassNames)((_compileClassNames = {}, _defineProperty(_compileClassNames, style.integrationIcon, true), _defineProperty(_compileClassNames, style.small, isSmall), _defineProperty(_compileClassNames, style.medium, isMedium), _defineProperty(_compileClassNames, style.whatsappIcon, isWhatsAppIcon), _defineProperty(_compileClassNames, style.telegramIcon, isTelegramIcon), _defineProperty(_compileClassNames, style.instagramIcon, isInstagramIcon), _defineProperty(_compileClassNames, style.asapIcon, isIMTalkIcon), _defineProperty(_compileClassNames, style.weChatIcon, isWeChatIcon), _defineProperty(_compileClassNames, style.twillioIcon, isTwillioIcon), _defineProperty(_compileClassNames, style.lineIcon, isLineIcon), _defineProperty(_compileClassNames, style.fbIcon, isFbIcon), _defineProperty(_compileClassNames, style.weComIcon, isWeComIcon), _compileClassNames));
|
|
43
45
|
var iconClass = (0, _utils.compileClassNames)((_compileClassNames2 = {}, _defineProperty(_compileClassNames2, style.small, isSmall), _defineProperty(_compileClassNames2, style.medium, isMedium), _compileClassNames2));
|
|
44
46
|
return {
|
|
45
47
|
iconWrapperClass: iconWrapperClass,
|
|
@@ -103,6 +103,7 @@ function IMMessage(props) {
|
|
|
103
103
|
messageStatus = _useIMMessage.messageStatus,
|
|
104
104
|
isFailedMessage = _useIMMessage.isFailedMessage,
|
|
105
105
|
isSendingMessage = _useIMMessage.isSendingMessage,
|
|
106
|
+
isSentViaMobile = _useIMMessage.isSentViaMobile,
|
|
106
107
|
messageStatusTitle = _useIMMessage.messageStatusTitle,
|
|
107
108
|
isValidAttachment = _useIMMessage.isValidAttachment,
|
|
108
109
|
dateTimeDetails = _useIMMessage.dateTimeDetails,
|
|
@@ -121,12 +122,13 @@ function IMMessage(props) {
|
|
|
121
122
|
return /*#__PURE__*/_react["default"].createElement(_IMMessageMeta["default"], _extends({
|
|
122
123
|
autoMessageType: autoMessageType,
|
|
123
124
|
direction: direction,
|
|
125
|
+
isSentViaMobile: isSentViaMobile,
|
|
124
126
|
isValidAttachment: isValidAttachment,
|
|
125
127
|
messageMetaInfoI18N: messageMetaInfoI18N,
|
|
126
128
|
time: isShowMessageTime ? displayDateTime : '',
|
|
127
129
|
timeTooltip: tooltip
|
|
128
130
|
}, imMessageMetaProps));
|
|
129
|
-
}, [isShowMessageTime, dateTimeDetails, direction, autoMessageType, imMessageMetaProps, isValidAttachment, messageMetaInfoI18N]);
|
|
131
|
+
}, [isShowMessageTime, dateTimeDetails, direction, autoMessageType, imMessageMetaProps, isValidAttachment, messageMetaInfoI18N, isSentViaMobile]);
|
|
130
132
|
/** ** Render Message Content *** */
|
|
131
133
|
|
|
132
134
|
var handleRenderMessage = (0, _react.useCallback)(function () {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports["default"] = IMMessageMeta;
|
|
7
9
|
|
|
8
|
-
var _react =
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
11
|
|
|
10
12
|
var _useMergeStyle = _interopRequireDefault(require("@zohodesk/hooks/es/utils/useMergeStyle"));
|
|
11
13
|
|
|
@@ -25,12 +27,23 @@ var _Layout = require("@zohodesk/components/es/Layout");
|
|
|
25
27
|
|
|
26
28
|
var _IMMessageMetaInfo = _interopRequireDefault(require("../IMMessageMetaInfo/IMMessageMetaInfo"));
|
|
27
29
|
|
|
30
|
+
var _Mobile = _interopRequireDefault(require("../../icons/iconSrc/common/Mobile"));
|
|
31
|
+
|
|
28
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
33
|
|
|
34
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
+
|
|
36
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
|
+
|
|
30
38
|
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); }
|
|
31
39
|
|
|
40
|
+
var iconMapping = {
|
|
41
|
+
mobile: _Mobile["default"]
|
|
42
|
+
};
|
|
43
|
+
|
|
32
44
|
function IMMessageMeta(props) {
|
|
33
|
-
var
|
|
45
|
+
var isSentViaMobile = props.isSentViaMobile,
|
|
46
|
+
direction = props.direction,
|
|
34
47
|
customStyle = props.customStyle,
|
|
35
48
|
time = props.time,
|
|
36
49
|
timeTooltip = props.timeTooltip,
|
|
@@ -44,10 +57,13 @@ function IMMessageMeta(props) {
|
|
|
44
57
|
var _useIMMessageMeta = (0, _useIMMessageMeta2["default"])({
|
|
45
58
|
messageMetaInfoI18N: messageMetaInfoI18N,
|
|
46
59
|
autoMessageType: autoMessageType,
|
|
47
|
-
isValidAttachment: isValidAttachment
|
|
60
|
+
isValidAttachment: isValidAttachment,
|
|
61
|
+
isSentViaMobile: isSentViaMobile
|
|
48
62
|
}),
|
|
49
63
|
imMessageMetaInfoTitle = _useIMMessageMeta.imMessageMetaInfoTitle,
|
|
50
|
-
imMessageMetaInfoContent = _useIMMessageMeta.imMessageMetaInfoContent
|
|
64
|
+
imMessageMetaInfoContent = _useIMMessageMeta.imMessageMetaInfoContent,
|
|
65
|
+
imMessageMetaInfoIcon = _useIMMessageMeta.imMessageMetaInfoIcon,
|
|
66
|
+
imMessageMetaInfoIconTitle = _useIMMessageMeta.imMessageMetaInfoIconTitle;
|
|
51
67
|
/* External CSS Customization */
|
|
52
68
|
|
|
53
69
|
|
|
@@ -60,10 +76,21 @@ function IMMessageMeta(props) {
|
|
|
60
76
|
imMessageMetaClass = _cssJSLogic.imMessageMetaClass,
|
|
61
77
|
dotClass = _cssJSLogic.dotClass;
|
|
62
78
|
|
|
79
|
+
var iconStyle = (0, _react.useMemo)(function () {
|
|
80
|
+
return {
|
|
81
|
+
base: newStyle.icon
|
|
82
|
+
};
|
|
83
|
+
}, [newStyle.icon]);
|
|
84
|
+
var IconComponent = imMessageMetaInfoIcon ? iconMapping[imMessageMetaInfoIcon] : null;
|
|
63
85
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, imMessageMetaInfoContent || time ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
64
86
|
alignBox: "row",
|
|
65
87
|
className: imMessageMetaClass
|
|
66
|
-
},
|
|
88
|
+
}, IconComponent ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
89
|
+
className: newStyle.iconWrapper,
|
|
90
|
+
"data-title": imMessageMetaInfoIconTitle
|
|
91
|
+
}, /*#__PURE__*/_react["default"].createElement(IconComponent, {
|
|
92
|
+
customStyle: iconStyle
|
|
93
|
+
})) : null, imMessageMetaInfoContent ? /*#__PURE__*/_react["default"].createElement(_IMMessageMetaInfo["default"], _extends({
|
|
67
94
|
imMessageMetaInfoContent: imMessageMetaInfoContent,
|
|
68
95
|
imMessageMetaInfoTitle: imMessageMetaInfoTitle
|
|
69
96
|
}, imMessageMetaInfoProps)) : null, imMessageMetaInfoContent && time ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -38,9 +38,20 @@
|
|
|
38
38
|
|
|
39
39
|
.dateTime {
|
|
40
40
|
font-size: var(--zd_font_size11) ;
|
|
41
|
-
/* max-width: 100px; */
|
|
42
|
-
/* display: flex; */
|
|
43
41
|
max-width: var(--zd_size100) ;
|
|
44
42
|
composes: dotted from '../../css/common.module.css';
|
|
45
43
|
color: var(--imlib_chat_components_imMessageMeta_time_color);
|
|
46
44
|
}
|
|
45
|
+
|
|
46
|
+
.icon {
|
|
47
|
+
width: var(--zd_size14) ;
|
|
48
|
+
height: var(--zd_size14) ;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[dir=ltr] .iconWrapper{
|
|
52
|
+
margin-right: var(--zd_size4) ;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
[dir=rtl] .iconWrapper{
|
|
56
|
+
margin-left: var(--zd_size4) ;
|
|
57
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohoim/chat-components",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3-beta-3",
|
|
4
4
|
"description": "Chat Components",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"@zohodesk/utils": "1.3.14",
|
|
46
46
|
"@zohodesk/variables": "1.0.0",
|
|
47
47
|
"@zohodesk/virtualizer": "1.0.13",
|
|
48
|
-
"@zohoim/chat-components-hooks": "1.2.
|
|
49
|
-
"@zohoim/chat-components-utils": "1.2.
|
|
48
|
+
"@zohoim/chat-components-hooks": "1.2.3-beta-3",
|
|
49
|
+
"@zohoim/chat-components-utils": "1.2.3-beta-3",
|
|
50
50
|
"html-to-react": "1.7.0 ",
|
|
51
51
|
"jsdom": "23.0.0",
|
|
52
52
|
"react-sortable-hoc": "1.11.0",
|
|
@@ -65,10 +65,9 @@
|
|
|
65
65
|
"@zohodesk/utils": "1.3.14",
|
|
66
66
|
"@zohodesk/variables": "1.0.0",
|
|
67
67
|
"@zohodesk/virtualizer": "1.0.13",
|
|
68
|
-
"@zohoim/chat-components-hooks": "1.2.
|
|
69
|
-
"@zohoim/chat-components-utils": "1.2.
|
|
68
|
+
"@zohoim/chat-components-hooks": "1.2.3-beta-3",
|
|
69
|
+
"@zohoim/chat-components-utils": "1.2.3-beta-3",
|
|
70
70
|
"react-sortable-hoc": "1.11.0",
|
|
71
71
|
"velocity-react": "1.4.3"
|
|
72
|
-
}
|
|
73
|
-
"gitHead": "8402c45f22c981df49cfcc6c5febddfb63cc7493"
|
|
72
|
+
}
|
|
74
73
|
}
|