@zohoim/chat-components 0.0.14 → 0.0.15
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/ActionIconWrapper/ActionIconWrapper.js +9 -1
- package/es/ActionIconWrapper/css/ActionIconWrapper.module.css +5 -0
- package/es/ActionIconWrapper/css/cssJSLogic.js +14 -0
- package/es/AttachmentBubble/AttachmentBubble.js +3 -2
- package/es/AttachmentBubble/css/AttachmentBubble.module.css +1 -0
- package/es/AttachmentBubbleInfo/AttachmentBubbleInfo.js +8 -4
- package/es/AttachmentBubbleInfo/css/AttachmentBubbleInfo.module.css +2 -3
- package/es/AttachmentIcon/utils/getAttachmentIconComponent.js +9 -3
- package/es/AudioBubble/AudioBubble.js +16 -3
- package/es/AudioBubble/css/AudioBubble.module.css +4 -0
- package/es/AudioBubble/props/defaultProps.js +1 -0
- package/es/LocationBubble/LocationBubble.js +3 -2
- package/es/LocationBubble/css/LocationBubble.module.css +3 -4
- package/es/MediaBubbleWrapper/MediaBubbleWrapper.js +2 -2
- package/es/MediaBubbleWrapper/css/MediaBubbleWrapper.module.css +4 -0
- package/es/MessageActions/MessageActions.js +4 -2
- package/es/MessageBox/MessageBox.js +11 -7
- package/es/MessageBox/css/MessageBox.module.css +1 -6
- package/es/MessageBubble/MessageBubble.js +9 -6
- package/es/MoreActionItem/css/MoreActionItem.module.css +1 -3
- package/es/ReplyBubble/ReplyBubble.js +4 -5
- package/es/ReplyBubble/css/ReplyBubble.module.css +2 -2
- package/es/ReplyBubbleContent/ReplyBubbleContent.js +5 -4
- package/es/ReplyBubbleContent/css/ReplyBubbleContent.module.css +1 -4
- package/es/ReplyBubbleHeader/ReplyBubbleHeader.js +6 -6
- package/es/ReplyBubbleHeader/css/ReplyBubbleHeader.module.css +25 -6
- package/es/TextBubble/TextBubble.js +2 -2
- package/es/TextBubble/css/TextBubble.module.css +3 -1
- package/es/Theme/ThemeWrapper.js +2 -2
- package/es/Theme/themeVariables/dark/blueTheme.js +1 -1
- package/es/Theme/themeVariables/dark/greenTheme.js +1 -1
- package/es/Theme/themeVariables/dark/orangeTheme.js +1 -1
- package/es/Theme/themeVariables/dark/redTheme.js +1 -1
- package/es/Theme/themeVariables/dark/yellowTheme.js +1 -1
- package/es/Theme/themeVariables/light/blueTheme.js +1 -1
- package/es/Theme/themeVariables/light/greenTheme.js +1 -1
- package/es/Theme/themeVariables/light/orangeTheme.js +1 -1
- package/es/Theme/themeVariables/light/redTheme.js +1 -1
- package/es/Theme/themeVariables/light/yellowTheme.js +1 -1
- package/es/Theme/themeVariables/pureDark/blueTheme.js +1 -1
- package/es/Theme/themeVariables/pureDark/greenTheme.js +1 -1
- package/es/Theme/themeVariables/pureDark/orangeTheme.js +1 -1
- package/es/Theme/themeVariables/pureDark/redTheme.js +1 -1
- package/es/Theme/themeVariables/pureDark/yellowTheme.js +1 -1
- package/es/VideoBubble/VideoBubble.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/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 +9 -8
- package/es/im/ArticleBubble/css/ArticleBubble.module.css +23 -13
- package/es/im/IMIntegrationIcon/IMIntegrationIcon.js +1 -1
- package/es/im/IMMessage/IMMessage.js +30 -8
- 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 +3 -1
- package/es/im/IMMessageContent/IMMessageContent.js +5 -3
- package/es/im/IMMessageContent/props/propTypes.js +1 -0
- package/es/im/IMMessageMeta/css/IMMessageMeta.module.css +1 -3
- 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/im/{IMTicketLink → IMPermaLink}/props/defaultProps.js +2 -2
- package/es/im/IMPermaLink/props/propTypes.js +11 -0
- package/es/im/css/common.module.css +6 -0
- package/es/im/index.js +1 -1
- package/package.json +4 -4
- package/es/icons/factory/integrations/ttTwitter.svg +0 -1
- package/es/im/IMTicketLink/IMTicketLink.js +0 -48
- package/es/im/IMTicketLink/index.js +0 -1
- package/es/im/IMTicketLink/props/propTypes.js +0 -11
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
.icon {
|
|
2
|
-
display: flex;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
1
|
.articleWrapper {
|
|
2
|
+
display: block;
|
|
3
|
+
/* margin: 4px 0 2px; */
|
|
6
4
|
padding: var(--zd_size8) var(--zd_size10) ;
|
|
7
5
|
background-color: var(--imlib_chat_components_articleBubble_bg_color);
|
|
8
6
|
border-radius: 3px;
|
|
9
7
|
cursor: pointer;
|
|
10
8
|
border: 1px solid var(--imlib_chat_components_articleBubble_border_color);
|
|
11
|
-
margin: var(--zd_size4) 0 var(--zd_size2) ;
|
|
12
9
|
}
|
|
13
10
|
|
|
14
11
|
.title {
|
|
15
12
|
color: var(--imlib_chat_components_articleBubble_color);
|
|
16
13
|
font-size: var(--zd_font_size15) ;
|
|
17
14
|
line-height: 1.5;
|
|
18
|
-
|
|
19
|
-
white-space: nowrap;
|
|
20
|
-
word-wrap: normal;
|
|
21
|
-
text-overflow: ellipsis;
|
|
15
|
+
composes: dotted from "../../css/common.module.css";
|
|
22
16
|
}
|
|
23
17
|
|
|
24
18
|
.summary {
|
|
@@ -34,14 +28,30 @@
|
|
|
34
28
|
}
|
|
35
29
|
|
|
36
30
|
.articleIcon {
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-shrink: 0;
|
|
33
|
+
width: var(--zd_size21) !important;
|
|
34
|
+
height: var(--zd_size21) !important;
|
|
39
35
|
}
|
|
40
36
|
|
|
41
37
|
.articleIcon :global(.path-0) {
|
|
42
|
-
fill: var(--imlib_chat_components_imIntegrationIcon_path0_color);
|
|
38
|
+
/* fill: var(--imlib_chat_components_imIntegrationIcon_path0_color); */
|
|
39
|
+
fill: rgba(200,203,220,0.7);
|
|
43
40
|
}
|
|
44
41
|
|
|
45
42
|
.articleIcon :global(.path-1) {
|
|
46
|
-
fill: var(--imlib_chat_components_imIntegrationIcon_path1_color);
|
|
43
|
+
/* fill: var(--imlib_chat_components_imIntegrationIcon_path1_color); */
|
|
44
|
+
fill: #000;
|
|
47
45
|
}
|
|
46
|
+
|
|
47
|
+
.content{
|
|
48
|
+
composes: dotted from "../../css/common.module.css";
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[dir=ltr] .content{
|
|
52
|
+
margin-left: var(--zd_size8);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
[dir=rtl] .content{
|
|
56
|
+
margin-right: var(--zd_size8);
|
|
57
|
+
}
|
|
@@ -8,7 +8,7 @@ import InstagramIcon from '../../icons/iconSrc/integrations/ChInstagram';
|
|
|
8
8
|
import ASAPIcon from '../../icons/iconSrc/integrations/TtASAP';
|
|
9
9
|
import WeChatIcon from '../../icons/iconSrc/integrations/TtWechat';
|
|
10
10
|
import TwillioIcon from '../../icons/iconSrc/integrations/TtTwillio';
|
|
11
|
-
import LineIcon from '../../icons/iconSrc/integrations/
|
|
11
|
+
import LineIcon from '../../icons/iconSrc/integrations/TtLine'; // import TwitterIcon from '../icons/iconSrc/integrations/TtTwitter';
|
|
12
12
|
|
|
13
13
|
/** ** CSS *** */
|
|
14
14
|
|
|
@@ -4,7 +4,11 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
4
4
|
import React, { useCallback, useMemo } from 'react';
|
|
5
5
|
/** ** Hooks *** */
|
|
6
6
|
|
|
7
|
+
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
7
8
|
import useIMMessage from '@zohoim/chat-components-hooks/es/im/IMMessage/useIMMessage';
|
|
9
|
+
/** ** Methods *** */
|
|
10
|
+
|
|
11
|
+
import cssJSLogic from './css/cssJSLogic';
|
|
8
12
|
/** ** Constants *** */
|
|
9
13
|
|
|
10
14
|
import imMessageDefaultProps from './props/defaultProps';
|
|
@@ -14,8 +18,11 @@ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyCon
|
|
|
14
18
|
|
|
15
19
|
import Message from '../../Message/Message';
|
|
16
20
|
import IMMessageContent from '../IMMessageContent/IMMessageContent';
|
|
17
|
-
import
|
|
21
|
+
import IMPermaLink from '../IMPermaLink/IMPermaLink';
|
|
18
22
|
import IMIntegrationIcon from '../IMIntegrationIcon/IMIntegrationIcon';
|
|
23
|
+
/** ** Styles *** */
|
|
24
|
+
|
|
25
|
+
import style from './css/IMMessage.module.css';
|
|
19
26
|
export default function IMMessage(props) {
|
|
20
27
|
const {
|
|
21
28
|
defaultAvatarUrls,
|
|
@@ -26,10 +33,12 @@ export default function IMMessage(props) {
|
|
|
26
33
|
onSelectAction,
|
|
27
34
|
replyText,
|
|
28
35
|
seeMoreText,
|
|
36
|
+
deleteMessageText,
|
|
29
37
|
messageStatusI18N,
|
|
30
38
|
onLoadFullMessage,
|
|
31
39
|
onClickReply,
|
|
32
40
|
onTicketClick,
|
|
41
|
+
customStyle,
|
|
33
42
|
customProps
|
|
34
43
|
} = props;
|
|
35
44
|
const {
|
|
@@ -44,6 +53,7 @@ export default function IMMessage(props) {
|
|
|
44
53
|
isShowSender,
|
|
45
54
|
isShowMessageTime
|
|
46
55
|
} = messageDisplayProps;
|
|
56
|
+
const newStyle = useMergeStyle(style, customStyle);
|
|
47
57
|
const {
|
|
48
58
|
direction,
|
|
49
59
|
// isBot,
|
|
@@ -74,21 +84,33 @@ export default function IMMessage(props) {
|
|
|
74
84
|
/** ** Render Message Content *** */
|
|
75
85
|
|
|
76
86
|
const handleRenderMessage = useCallback(() => /*#__PURE__*/React.createElement(IMMessageContent, _extends({
|
|
87
|
+
deleteMessageText: deleteMessageText,
|
|
77
88
|
messageDetails: messageDetails,
|
|
78
89
|
onClickReply: onClickReply,
|
|
79
90
|
onLoadFullMessage: onLoadFullMessage,
|
|
80
91
|
replyText: replyText,
|
|
81
92
|
seeMoreText: seeMoreText,
|
|
82
93
|
sessionDetails: sessionDetails
|
|
83
|
-
}, imMessageContentProps)), [seeMoreText, replyText, messageDetails, sessionDetails, onLoadFullMessage, onClickReply, imMessageContentProps]);
|
|
94
|
+
}, imMessageContentProps)), [seeMoreText, replyText, deleteMessageText, messageDetails, sessionDetails, onLoadFullMessage, onClickReply, imMessageContentProps]);
|
|
84
95
|
/** ** Render Secondary Actions - TicketId *** */
|
|
85
96
|
|
|
86
|
-
const handleRenderSecondaryActions = useCallback(() =>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
97
|
+
const handleRenderSecondaryActions = useCallback(() => {
|
|
98
|
+
const {
|
|
99
|
+
imTicketLinkClass
|
|
100
|
+
} = cssJSLogic({
|
|
101
|
+
messageDetails
|
|
102
|
+
}, newStyle);
|
|
103
|
+
const customStyle = {
|
|
104
|
+
text: imTicketLinkClass
|
|
105
|
+
};
|
|
106
|
+
return /*#__PURE__*/React.createElement(IMPermaLink, _extends({
|
|
107
|
+
customStyle: customStyle,
|
|
108
|
+
href: ticketUrl,
|
|
109
|
+
id: ticketId,
|
|
110
|
+
onClick: onTicketClick,
|
|
111
|
+
text: ticketNumber ? `#${ticketNumber}` : ''
|
|
112
|
+
}, imTicketLinkProps));
|
|
113
|
+
}, [ticketNumber, ticketUrl, ticketId, onTicketClick, imTicketLinkProps, messageDetails, newStyle]);
|
|
92
114
|
/** ** Render Owner Status Icon *** */
|
|
93
115
|
|
|
94
116
|
const handleRenderIntegIcon = useCallback(() => /*#__PURE__*/React.createElement(IMIntegrationIcon, _extends({
|
package/es/im/{IMTicketLink/css/IMTicketLink.module.css → IMMessage/css/IMMessage.module.css}
RENAMED
|
@@ -4,23 +4,33 @@
|
|
|
4
4
|
--imTicketLink-max_width: var(--zd_size150);
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.
|
|
7
|
+
.ticketLink {
|
|
8
8
|
composes: varClass;
|
|
9
9
|
font-size: var(--imTicketLink-font_size);
|
|
10
10
|
max-width: var(--imTicketLink-max_width);
|
|
11
|
-
color: var(--imlib_chat_components_imTicketLink_color);
|
|
12
|
-
display: block;
|
|
13
|
-
white-space: nowrap;
|
|
14
|
-
overflow: hidden;
|
|
15
|
-
text-overflow: ellipsis;
|
|
16
11
|
margin-top: var(--imTicketLink-top_gap);
|
|
17
|
-
cursor: pointer;
|
|
18
12
|
}
|
|
19
13
|
|
|
20
|
-
.
|
|
21
|
-
|
|
14
|
+
.ticketLinkRight {
|
|
15
|
+
composes: ticketLink;
|
|
22
16
|
}
|
|
23
17
|
|
|
24
|
-
|
|
25
|
-
text-
|
|
18
|
+
[dir=ltr] .ticketLinkRight {
|
|
19
|
+
text-align: left;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
[dir=rtl] .ticketLinkRight {
|
|
23
|
+
text-align: right;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ticketLinkLeft {
|
|
27
|
+
composes: ticketLink;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
[dir=ltr] .ticketLinkLeft {
|
|
31
|
+
text-align: right;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[dir=rtl] .ticketLinkLeft {
|
|
35
|
+
text-align: left;
|
|
26
36
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** ** Methods *** */
|
|
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
|
+
export default function cssJSLogic(props, style) {
|
|
8
|
+
const {
|
|
9
|
+
messageDetails
|
|
10
|
+
} = props;
|
|
11
|
+
const {
|
|
12
|
+
direction
|
|
13
|
+
} = getMessageDirectionType({
|
|
14
|
+
messageDetails
|
|
15
|
+
});
|
|
16
|
+
const imTicketLinkClass = compileClassNames({
|
|
17
|
+
[style.ticketLinkLeft]: directionConstants.OUT === direction,
|
|
18
|
+
[style.ticketLinkRight]: directionConstants.IN === direction
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
imTicketLinkClass
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -75,13 +75,15 @@ const imMessagePropTypes = {
|
|
|
75
75
|
onSelectAction: PropTypes.func,
|
|
76
76
|
replyText: PropTypes.string,
|
|
77
77
|
seeMoreText: PropTypes.string,
|
|
78
|
+
deleteMessageText: PropTypes.string,
|
|
78
79
|
onLoadFullMessage: PropTypes.func,
|
|
79
80
|
onClickReply: PropTypes.func,
|
|
80
81
|
onTicketClick: PropTypes.func,
|
|
82
|
+
customStyle: PropTypes.object,
|
|
81
83
|
customProps: PropTypes.shape({
|
|
82
84
|
imIntegrationIconProps: PropTypes.object,
|
|
83
85
|
imMessageContentProps: PropTypes.object,
|
|
84
|
-
|
|
86
|
+
imPermaLinkProps: PropTypes.object,
|
|
85
87
|
messageProps: PropTypes.object
|
|
86
88
|
})
|
|
87
89
|
};
|
|
@@ -3,7 +3,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
3
3
|
/* eslint-disable react/jsx-indent */
|
|
4
4
|
|
|
5
5
|
/** ** Libraries *** */
|
|
6
|
-
import React, { useMemo } from 'react';
|
|
6
|
+
import React, { useMemo, Fragment } from 'react';
|
|
7
7
|
/** ** Hooks *** */
|
|
8
8
|
|
|
9
9
|
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
@@ -36,6 +36,7 @@ export default function IMMessageContent(props) {
|
|
|
36
36
|
onClickReply,
|
|
37
37
|
seeMoreText,
|
|
38
38
|
replyText,
|
|
39
|
+
deleteMessageText,
|
|
39
40
|
customStyle,
|
|
40
41
|
customProps,
|
|
41
42
|
renderCustomMessage
|
|
@@ -58,7 +59,8 @@ export default function IMMessageContent(props) {
|
|
|
58
59
|
isShowAttachmentBubble,
|
|
59
60
|
isShowLocationBubble,
|
|
60
61
|
isShowTextBubble,
|
|
61
|
-
isShowCustomBubble
|
|
62
|
+
isShowCustomBubble,
|
|
63
|
+
isShowDeleteBubble
|
|
62
64
|
} = useMemo(() => getIsShowBubble({
|
|
63
65
|
messageDetails
|
|
64
66
|
}), [messageDetails]);
|
|
@@ -72,7 +74,7 @@ export default function IMMessageContent(props) {
|
|
|
72
74
|
} = useMemo(() => getMessageBubbleDetails({
|
|
73
75
|
messageDetails
|
|
74
76
|
}), [messageDetails]);
|
|
75
|
-
return /*#__PURE__*/React.createElement(
|
|
77
|
+
return /*#__PURE__*/React.createElement(Fragment, null, isShowLayoutBubble ? null : null, isShowDeleteBubble ? /*#__PURE__*/React.createElement("div", null, deleteMessageText) : null, isShowReplyBubble ? /*#__PURE__*/React.createElement("div", {
|
|
76
78
|
className: newStyle.messageContentRow
|
|
77
79
|
}, /*#__PURE__*/React.createElement(IMReplyBubble, _extends({
|
|
78
80
|
messageDetails: replyToMessage,
|
|
@@ -26,6 +26,7 @@ const imMessageContentPropTypes = {
|
|
|
26
26
|
onLoadFullMessage: PropTypes.func,
|
|
27
27
|
onClickReply: PropTypes.func,
|
|
28
28
|
seeMoreText: PropTypes.string,
|
|
29
|
+
deleteMessageText: PropTypes.string,
|
|
29
30
|
replyText: PropTypes.string,
|
|
30
31
|
renderCustomMessage: PropTypes.func,
|
|
31
32
|
customStyle: PropTypes.object,
|
|
@@ -36,8 +36,6 @@
|
|
|
36
36
|
/* max-width: 100px; */
|
|
37
37
|
/* display: flex; */
|
|
38
38
|
max-width: var(--zd_size100) ;
|
|
39
|
-
|
|
40
|
-
overflow: hidden;
|
|
41
|
-
text-overflow: ellipsis;
|
|
39
|
+
composes: dotted from "../../css/common.module.css";
|
|
42
40
|
color: var(--imlib_chat_components_imMessageMeta_timeColor);
|
|
43
41
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* eslint-disable @zohodesk/zsecurity/no-protocol-check */
|
|
2
|
+
|
|
3
|
+
/** ** Libraries *** */
|
|
4
|
+
import React from 'react';
|
|
5
|
+
/** ** Hooks *** */
|
|
6
|
+
|
|
7
|
+
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
8
|
+
import useIMPermaLink from '@zohoim/chat-components-hooks/es/im/IMPermaLink/useIMPermaLink';
|
|
9
|
+
/** ** Constants *** */
|
|
10
|
+
|
|
11
|
+
import imPermaLinkDefaultProps from './props/defaultProps';
|
|
12
|
+
import imPermaLinkPropTypes from './props/propTypes';
|
|
13
|
+
/** ** Methods *** */
|
|
14
|
+
|
|
15
|
+
import cssJSLogic from './css/cssJSLogic';
|
|
16
|
+
/** ** Styles *** */
|
|
17
|
+
|
|
18
|
+
import style from './css/IMPermaLink.module.css';
|
|
19
|
+
export default function IMPermaLink(props) {
|
|
20
|
+
const {
|
|
21
|
+
customStyle,
|
|
22
|
+
isDisabled
|
|
23
|
+
} = props;
|
|
24
|
+
const {
|
|
25
|
+
href,
|
|
26
|
+
onClick,
|
|
27
|
+
text
|
|
28
|
+
} = useIMPermaLink(props);
|
|
29
|
+
/* External CSS Customization */
|
|
30
|
+
|
|
31
|
+
const newStyle = useMergeStyle(style, customStyle);
|
|
32
|
+
/* CSS classnames added based on logic */
|
|
33
|
+
|
|
34
|
+
const {
|
|
35
|
+
imPermaLinkClass
|
|
36
|
+
} = cssJSLogic({
|
|
37
|
+
isDisabled
|
|
38
|
+
}, newStyle);
|
|
39
|
+
return text ? /*#__PURE__*/React.createElement("a", {
|
|
40
|
+
className: imPermaLinkClass,
|
|
41
|
+
href: href,
|
|
42
|
+
onClick: onClick,
|
|
43
|
+
rel: "noopener noreferrer"
|
|
44
|
+
}, text) : null;
|
|
45
|
+
}
|
|
46
|
+
IMPermaLink.propTypes = imPermaLinkPropTypes;
|
|
47
|
+
IMPermaLink.defaultProps = imPermaLinkDefaultProps;
|
|
48
|
+
IMPermaLink.displayName = 'IMPermaLink';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
.text {
|
|
2
|
+
color: var(--imlib_chat_components_imPermaLink_color);
|
|
3
|
+
display: block;
|
|
4
|
+
composes: dotted from '../../css/common.module.css';
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.disabled {
|
|
9
|
+
pointer-events: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
a.text:hover {
|
|
13
|
+
text-decoration: underline;
|
|
14
|
+
}
|
|
@@ -4,11 +4,11 @@ export default function cssJSLogic(props, style) {
|
|
|
4
4
|
const {
|
|
5
5
|
isDisabled
|
|
6
6
|
} = props;
|
|
7
|
-
const
|
|
8
|
-
[style.
|
|
7
|
+
const imPermaLinkClass = compileClassNames({
|
|
8
|
+
[style.text]: true,
|
|
9
9
|
[style.disabled]: isDisabled === true
|
|
10
10
|
});
|
|
11
11
|
return {
|
|
12
|
-
|
|
12
|
+
imPermaLinkClass
|
|
13
13
|
};
|
|
14
14
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as IMPermaLink } from './IMPermaLink';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** ** Constants *** */
|
|
2
2
|
import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
|
|
3
|
-
const
|
|
3
|
+
const imPermaLinkDefaultProps = {
|
|
4
4
|
customStyle: dummyObject
|
|
5
5
|
};
|
|
6
|
-
export default
|
|
6
|
+
export default imPermaLinkDefaultProps;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
const imPermaLinkPropTypes = {
|
|
4
|
+
text: PropTypes.string.isRequired,
|
|
5
|
+
customStyle: PropTypes.object,
|
|
6
|
+
isDisabled: PropTypes.bool,
|
|
7
|
+
onClick: PropTypes.func,
|
|
8
|
+
id: PropTypes.string,
|
|
9
|
+
href: PropTypes.string
|
|
10
|
+
};
|
|
11
|
+
export default imPermaLinkPropTypes;
|
package/es/im/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohoim/chat-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "Chat Components",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@zohodesk/utils": "1.3.9",
|
|
36
36
|
"@zohodesk/variables": "1.0.0-beta.30",
|
|
37
37
|
"@zohodesk/virtualizer": "1.0.13",
|
|
38
|
-
"@zohoim/chat-components-hooks": "^0.0.
|
|
39
|
-
"@zohoim/chat-components-utils": "^0.0.
|
|
38
|
+
"@zohoim/chat-components-hooks": "^0.0.13",
|
|
39
|
+
"@zohoim/chat-components-utils": "^0.0.12"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@zohodesk-private/css-variable-migrator": "1.0.1",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"cssVariableReplacementConfig": "../../node_modules/@zohodesk-private/css-variable-migrator/es/config/cssVariableReplacementOptions.json"
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "0b3fa05803c74cad58e84613fc54c979493192c0"
|
|
65
65
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><defs><style>.cls-1{fill:#c8cadb;isolation:isolate;opacity:0.5;}.cls-2{fill:#010101;}</style></defs><ellipse class="cls-1" cx="23.38" cy="21.39" rx="14.03" ry="11.35"/><path class="cls-2" d="M28.79,15.92H24.94a.26.26,0,0,0-.26.26v6a.26.26,0,0,0,.26.26h3.85a.25.25,0,0,0,.26-.26v-1a.26.26,0,0,0-.26-.26H26.17v-1h2.62a.26.26,0,0,0,.26-.26v-1a.26.26,0,0,0-.26-.27H26.17v-1h2.62a.25.25,0,0,0,.26-.26v-1A.26.26,0,0,0,28.79,15.92Z"/><path class="cls-2" d="M14.55,20.93H11.93V16.18a.26.26,0,0,0-.26-.26h-1a.27.27,0,0,0-.27.26v6a.27.27,0,0,0,.27.26h3.85a.26.26,0,0,0,.26-.26v-1A.26.26,0,0,0,14.55,20.93Z"/><rect class="cls-2" x="15.63" y="15.92" width="1.5" height="6.51" rx="0.26"/><path class="cls-2" d="M23.48,15.92h-1a.26.26,0,0,0-.26.26v3.55L19.5,16s0,0,0,0v0H18.32a.27.27,0,0,0-.26.27v6a.26.26,0,0,0,.26.26h1a.27.27,0,0,0,.27-.26V18.61l2.74,3.71s0,.05.06.06h.07a.06.06,0,0,0,.06,0h1a.25.25,0,0,0,.26-.25h0V16.18A.25.25,0,0,0,23.48,15.92Z"/><path class="cls-2" d="M19.89,6.17c-8.56,0-15.53,5.72-15.53,12.77,0,6.31,5.47,11.61,12.94,12.59a2.06,2.06,0,0,1,.63.22,2.42,2.42,0,0,1,0,.76l-.22,1.27a1.74,1.74,0,0,0,.47,1.75,1.45,1.45,0,0,0,.92.3,3.14,3.14,0,0,0,1.17-.28C22,34.83,28.94,30.42,32,26.84a11.45,11.45,0,0,0,3.37-7.91C35.41,11.89,28.44,6.17,19.89,6.17ZM30.65,25.61h0c-2.86,3.29-9.4,7.46-11.07,8.2l.17-1a3.7,3.7,0,0,0-.1-1.79,2.51,2.51,0,0,0-2-1.29c-6.6-.88-11.4-5.4-11.4-10.77,0-6,6.13-10.9,13.67-10.9s13.66,4.89,13.66,10.9A9.61,9.61,0,0,1,30.65,25.61Z"/></svg>
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @zohodesk/zsecurity/no-protocol-check */
|
|
2
|
-
|
|
3
|
-
/** ** Libraries *** */
|
|
4
|
-
import React from 'react';
|
|
5
|
-
/** ** Hooks *** */
|
|
6
|
-
|
|
7
|
-
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
8
|
-
import useIMTicketLink from '@zohoim/chat-components-hooks/es/im/IMTicketLink/useIMTicketLink';
|
|
9
|
-
/** ** Constants *** */
|
|
10
|
-
|
|
11
|
-
import imTicketLinkDefaultProps from './props/defaultProps';
|
|
12
|
-
import imTicketLinkPropTypes from './props/propTypes';
|
|
13
|
-
/** ** Methods *** */
|
|
14
|
-
|
|
15
|
-
import cssJSLogic from './css/cssJSLogic';
|
|
16
|
-
/** ** Styles *** */
|
|
17
|
-
|
|
18
|
-
import style from './css/IMTicketLink.module.css';
|
|
19
|
-
export default function IMTicketLink(props) {
|
|
20
|
-
const {
|
|
21
|
-
customStyle,
|
|
22
|
-
isDisabled
|
|
23
|
-
} = props;
|
|
24
|
-
const {
|
|
25
|
-
ticketUrl,
|
|
26
|
-
onClick,
|
|
27
|
-
ticketNumber
|
|
28
|
-
} = useIMTicketLink(props);
|
|
29
|
-
/* External CSS Customization */
|
|
30
|
-
|
|
31
|
-
const newStyle = useMergeStyle(style, customStyle);
|
|
32
|
-
/* CSS classnames added based on logic */
|
|
33
|
-
|
|
34
|
-
const {
|
|
35
|
-
imTicketLinkClass
|
|
36
|
-
} = cssJSLogic({
|
|
37
|
-
isDisabled
|
|
38
|
-
}, newStyle);
|
|
39
|
-
return ticketNumber ? /*#__PURE__*/React.createElement("a", {
|
|
40
|
-
className: imTicketLinkClass,
|
|
41
|
-
href: ticketUrl,
|
|
42
|
-
onClick: onClick,
|
|
43
|
-
rel: "noopener noreferrer"
|
|
44
|
-
}, ticketNumber) : null;
|
|
45
|
-
}
|
|
46
|
-
IMTicketLink.propTypes = imTicketLinkPropTypes;
|
|
47
|
-
IMTicketLink.defaultProps = imTicketLinkDefaultProps;
|
|
48
|
-
IMTicketLink.displayName = 'IMTicketLink';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as IMTicketLink } from './IMTicketLink';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/** ** Libraries *** */
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
const imTicketLinkPropTypes = {
|
|
4
|
-
ticketNumber: PropTypes.string.isRequired,
|
|
5
|
-
customStyle: PropTypes.object,
|
|
6
|
-
isDisabled: PropTypes.bool,
|
|
7
|
-
onClick: PropTypes.func,
|
|
8
|
-
ticketId: PropTypes.string,
|
|
9
|
-
ticketUrl: PropTypes.string
|
|
10
|
-
};
|
|
11
|
-
export default imTicketLinkPropTypes;
|