@zohoim/chat-components 0.0.11 → 0.0.13
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 -2
- package/es/ArticleBubble/ArticleBubble.js +17 -15
- package/es/ArticleBubble/css/ArticleBubble.module.css +37 -29
- package/es/AttachmentBubble/AttachmentBubble.js +14 -12
- package/es/AttachmentBubble/css/AttachmentBubble.module.css +4 -4
- package/es/AttachmentBubble/css/cssJSLogic.js +1 -1
- package/es/AttachmentBubbleInfo/AttachmentBubbleInfo.js +0 -1
- package/es/AttachmentBubbleInfo/css/AttachmentBubbleInfo.module.css +1 -0
- package/es/AttachmentBubbleInfo/css/cssJSLogic.js +1 -1
- package/es/Audio/Audio.js +23 -23
- package/es/AudioBubble/AudioBubble.js +2 -3
- package/es/AudioBubble/css/cssJSLogic.js +2 -2
- package/es/ImageBubble/ImageBubble.js +7 -6
- package/es/InfoBubble/InfoBubble.js +0 -1
- package/es/LazyLoadImage/LazyLoadImage.js +5 -6
- package/es/LocationBubble/LocationBubble.js +20 -21
- package/es/LocationBubble/css/LocationBubble.module.css +9 -7
- package/es/MediaControls/MediaControls.js +0 -1
- package/es/Message/Message.js +58 -93
- package/es/Message/props/defaultProps.js +2 -34
- package/es/Message/props/propTypes.js +19 -57
- package/es/MessageAction/MessageAction.js +5 -5
- package/es/MessageActions/MessageActions.js +120 -45
- package/es/MessageActions/css/MessageActions.module.css +30 -2
- package/es/MessageActions/css/cssJSLogic.js +13 -3
- package/es/MessageActions/props/defaultProps.js +5 -3
- package/es/MessageActions/props/propTypes.js +22 -4
- package/es/MessageActionsMore/MessageActionsMore.js +5 -5
- package/es/MessageActionsWrapper/MessageActionsWrapper.js +75 -0
- package/es/MessageActionsWrapper/css/MessageActionsWrapper.module.css +3 -0
- package/es/MessageActionsWrapper/css/cssJSLogic.js +10 -0
- package/es/MessageActionsWrapper/index.js +1 -0
- package/es/MessageActionsWrapper/props/defaultProps.js +10 -0
- package/es/MessageActionsWrapper/props/propTypes.js +12 -0
- package/es/MessageAvatar/MessageAvatar.js +7 -6
- package/es/MessageAvatar/props/defaultProps.js +3 -3
- package/es/MessageBubble/MessageBubble.js +1 -1
- package/es/MessageBubble/props/defaultProps.js +2 -2
- package/es/MessageBubble/props/propConstants.js +1 -1
- package/es/MessageBubble/props/propTypes.js +2 -2
- package/es/{im/IMMessageStatus/IMMessageStatus.js → MessageStatus/MessageStatus.js} +18 -15
- package/es/{im/IMMessageStatus → MessageStatus}/css/cssJSLogic.js +3 -3
- package/es/MessageStatus/index.js +1 -0
- package/es/{im/IMMessageStatus → MessageStatus}/props/defaultProps.js +2 -2
- package/es/{im/IMMessageStatus → MessageStatus}/props/propTypes.js +4 -3
- package/es/MoreActionItem/MoreActionItem.js +7 -7
- package/es/MoreActionItem/css/cssJSLogic.js +1 -1
- package/es/ReplyBubble/ReplyBubble.js +4 -3
- package/es/ReplyBubbleContent/ReplyBubbleContent.js +16 -12
- package/es/ReplyBubbleContent/css/ReplyBubbleContent.module.css +26 -16
- package/es/ReplyBubbleHeader/ReplyBubbleHeader.js +11 -9
- package/es/ReplyBubbleHeader/css/ReplyBubbleHeader.module.css +15 -4
- package/es/ReplyBubbleHeader/css/cssJSLogic.js +9 -1
- package/es/ReplyBubbleHeader/props/defaultProps.js +1 -2
- package/es/ReplyBubbleHeader/props/propTypes.js +1 -2
- package/es/TextBubble/TextBubble.js +8 -9
- package/es/TextBubble/css/TextBubble.module.css +11 -2
- package/es/Theme/ThemeWrapper.js +32 -29
- package/es/Theme/crm/dark/blueFanTheme.js +1 -1
- package/es/Theme/crm/dark/blueTheme.js +1 -1
- package/es/Theme/crm/dark/darkBlueTheme.js +1 -1
- package/es/Theme/crm/dark/darkGreyTheme.js +1 -1
- package/es/Theme/crm/dark/greenTheme.js +1 -1
- package/es/Theme/crm/dark/orangeTheme.js +1 -1
- package/es/Theme/crm/dark/pinkTheme.js +1 -1
- package/es/Theme/crm/dark/tealTheme.js +1 -1
- package/es/Theme/crm/dark/whiteTheme.js +1 -1
- package/es/Theme/crm/light/blueFanTheme.js +1 -1
- package/es/Theme/crm/light/blueTheme.js +1 -1
- package/es/Theme/crm/light/darkBlueTheme.js +1 -1
- package/es/Theme/crm/light/darkGreyTheme.js +1 -1
- package/es/Theme/crm/light/greenTheme.js +1 -1
- package/es/Theme/crm/light/orangeTheme.js +1 -1
- package/es/Theme/crm/light/pinkTheme.js +1 -1
- package/es/Theme/crm/light/tealTheme.js +1 -1
- package/es/Theme/crm/light/whiteTheme.js +1 -1
- package/es/Theme/crm/pureDark/blueFanTheme.js +1 -1
- package/es/Theme/crm/pureDark/blueTheme.js +1 -1
- package/es/Theme/crm/pureDark/darkBlueTheme.js +1 -1
- package/es/Theme/crm/pureDark/darkGreyTheme.js +1 -1
- package/es/Theme/crm/pureDark/greenTheme.js +1 -1
- package/es/Theme/crm/pureDark/orangeTheme.js +1 -1
- package/es/Theme/crm/pureDark/pinkTheme.js +1 -1
- package/es/Theme/crm/pureDark/tealTheme.js +1 -1
- package/es/Theme/crm/pureDark/whiteTheme.js +1 -1
- package/es/Theme/desk/commonDeskColorVariable.js +10 -10
- package/es/Theme/desk/dark/blueTheme.js +42 -16
- package/es/Theme/desk/dark/commonColorVariable.js +10 -5
- package/es/Theme/desk/dark/greenTheme.js +41 -15
- package/es/Theme/desk/dark/orangeTheme.js +34 -8
- package/es/Theme/desk/dark/redTheme.js +50 -15
- package/es/Theme/desk/dark/yellowTheme.js +41 -15
- package/es/Theme/desk/light/blueTheme.js +35 -18
- package/es/Theme/desk/light/commonColorVariable.js +7 -1
- package/es/Theme/desk/light/greenTheme.js +39 -13
- package/es/Theme/desk/light/orangeTheme.js +38 -13
- package/es/Theme/desk/light/redTheme.js +38 -13
- package/es/Theme/desk/light/yellowTheme.js +39 -13
- package/es/Theme/desk/pureDark/blueTheme.js +41 -14
- package/es/Theme/desk/pureDark/commonColorVariable.js +6 -1
- package/es/Theme/desk/pureDark/greenTheme.js +40 -14
- package/es/Theme/desk/pureDark/orangeTheme.js +40 -14
- package/es/Theme/desk/pureDark/redTheme.js +40 -14
- package/es/Theme/desk/pureDark/yellowTheme.js +40 -14
- package/es/Theme/utils/getThemeConfigurations.js +5 -5
- package/es/Video/Video.js +13 -12
- package/es/VideoBubble/VideoBubble.js +2 -3
- package/es/icons/create-icon-components.js +1 -0
- package/es/icons/icon.template.js +2 -2
- package/es/icons/iconSrc/actions/ConvertTicket.js +1 -0
- package/es/icons/iconSrc/actions/index.js +1 -1
- package/es/icons/iconSrc/attachments/Audio.js +1 -0
- package/es/icons/iconSrc/attachments/Code.js +1 -0
- package/es/icons/iconSrc/attachments/Image.js +1 -0
- package/es/icons/iconSrc/attachments/Pdf.js +1 -0
- package/es/icons/iconSrc/attachments/Txt.js +1 -0
- package/es/icons/iconSrc/attachments/Unknown.js +1 -0
- package/es/icons/iconSrc/attachments/Video.js +1 -0
- package/es/icons/iconSrc/attachments/Zip.js +1 -0
- package/es/icons/iconSrc/attachments/index.js +8 -8
- package/es/icons/iconSrc/common/Article.js +1 -0
- package/es/icons/iconSrc/common/Quote.js +1 -0
- package/es/icons/iconSrc/common/index.js +2 -2
- package/es/icons/iconSrc/integrations/ChInstagram.js +1 -0
- package/es/icons/iconSrc/integrations/ChWhatsApp.js +1 -0
- package/es/icons/iconSrc/integrations/TtASAP.js +1 -0
- package/es/icons/iconSrc/integrations/TtTelegram.js +1 -0
- package/es/icons/iconSrc/integrations/TtTwillio.js +1 -0
- package/es/icons/iconSrc/integrations/TtTwitter.js +1 -0
- package/es/icons/iconSrc/integrations/TtWechat.js +1 -0
- package/es/icons/iconSrc/integrations/index.js +7 -7
- package/es/icons/iconSrc/messageStatus/Clock.js +1 -0
- package/es/icons/iconSrc/messageStatus/DoubleTick.js +1 -0
- package/es/icons/iconSrc/messageStatus/Failed.js +1 -0
- package/es/icons/iconSrc/messageStatus/Tick.js +1 -0
- package/es/icons/iconSrc/messageStatus/index.js +4 -4
- package/es/im/IMArticleBubble/IMArticleBubble.js +3 -4
- package/es/im/IMAttachmentBubble/IMAttachmentBubble.js +4 -5
- package/es/im/IMAttachmentIcon/IMAttachmentIcon.js +8 -9
- package/es/im/IMAudioBubble/IMAudioBubble.js +3 -4
- package/es/im/IMAudioBubble/css/cssJSLogic.js +2 -2
- package/es/im/IMAutoMessageInfo/IMAutoMessageInfo.js +0 -1
- package/es/im/IMDateTime/IMDateTime.js +0 -1
- package/es/im/IMDateTime/css/IMDateTime.module.css +6 -1
- package/es/im/IMImageBubble/IMImageBubble.js +6 -5
- package/es/im/IMInfoBubble/IMInfoBubble.js +0 -1
- package/es/im/IMLocationBubble/IMLocationBubble.js +6 -5
- package/es/im/IMMessage/IMMessage.js +57 -103
- package/es/im/IMMessage/props/defaultProps.js +1 -19
- package/es/im/IMMessage/props/propTypes.js +17 -30
- package/es/im/IMMessageAvatar/IMMessageAvatar.js +7 -7
- package/es/im/IMMessageAvatar/props/defaultProps.js +4 -4
- package/es/im/IMMessageAvatar/props/propTypes.js +25 -0
- package/es/im/IMMessageContent/IMMessageContent.js +44 -28
- package/es/im/IMMessageContent/css/IMMessageContent.module.css +3 -0
- package/es/im/IMMessageMeta/IMMessageMeta.js +3 -4
- package/es/im/IMReplyBubble/IMReplyBubble.js +9 -10
- package/es/im/IMReplyBubble/css/IMReplyBubble.module.css +7 -13
- package/es/im/IMTextBubble/IMTextBubble.js +3 -4
- package/es/im/IMTicketLink/IMTicketLink.js +1 -3
- package/es/im/IMVideoBubble/IMVideoBubble.js +3 -4
- package/es/im/index.js +0 -2
- package/es/index.js +28 -30
- package/es/{MessageWrapper → unused/MessageWrapper}/MessageWrapper.js +0 -1
- package/es/{TextMessage → unused/TextMessage}/DefaultActions.js +4 -4
- package/es/{TextMessage → unused/TextMessage}/TextMessage.js +14 -14
- package/es/{TextMessage → unused/TextMessage}/TextMessage1.js +18 -21
- package/package.json +4 -4
- package/es/im/IMMessage/renderChild/renderMessage.js +0 -8
- package/es/im/IMMessage/renderChild/renderMessageActions.js +0 -8
- package/es/im/IMMessage/renderChild/renderMessageBox.js +0 -15
- package/es/im/IMMessage/renderChild/renderMessageBoxFooter.js +0 -8
- package/es/im/IMMessage/renderChild/renderMessageFooter.js +0 -8
- package/es/im/IMMessage/renderChild/renderMessageHeader.js +0 -8
- package/es/im/IMMessage/renderChild/renderMessageOwner.js +0 -8
- package/es/im/IMMessage/renderChild/renderMessageStatus.js +0 -8
- package/es/im/IMMessageActions/IMMessageActions.js +0 -150
- package/es/im/IMMessageActions/css/IMMessageActions.module.css +0 -31
- package/es/im/IMMessageActions/css/cssJSLogic.js +0 -20
- package/es/im/IMMessageActions/index.js +0 -1
- package/es/im/IMMessageActions/props/defaultProps.js +0 -12
- package/es/im/IMMessageActions/props/propTypes.js +0 -30
- package/es/im/IMMessageStatus/index.js +0 -1
- /package/es/{MessageActions → MessageActionsWrapper}/props/propConstants.js +0 -0
- /package/es/{im/IMMessageStatus/css/IMMessageStatus.module.css → MessageStatus/css/MessageStatus.module.css} +0 -0
- /package/es/{MessageBoxFooter → unused/MessageBoxFooter}/MessageBoxFooter.js +0 -0
- /package/es/{MessageBoxFooter → unused/MessageBoxFooter}/css/MessageBoxFooter.module.css +0 -0
- /package/es/{MessageBoxFooter → unused/MessageBoxFooter}/css/cssJSLogic.js +0 -0
- /package/es/{MessageBoxFooter → unused/MessageBoxFooter}/index.js +0 -0
- /package/es/{MessageBoxFooter → unused/MessageBoxFooter}/props/defaultProps.js +0 -0
- /package/es/{MessageBoxFooter → unused/MessageBoxFooter}/props/propTypes.js +0 -0
- /package/es/{MessageBoxHeader → unused/MessageBoxHeader}/MessageBoxHeader.js +0 -0
- /package/es/{MessageBoxHeader → unused/MessageBoxHeader}/css/MessageBoxHeader.module.css +0 -0
- /package/es/{MessageBoxHeader → unused/MessageBoxHeader}/css/cssJsLogic.js +0 -0
- /package/es/{MessageBoxHeader → unused/MessageBoxHeader}/index.js +0 -0
- /package/es/{MessageBoxHeader → unused/MessageBoxHeader}/props/defaultProps.js +0 -0
- /package/es/{MessageBoxHeader → unused/MessageBoxHeader}/props/propTypes.js +0 -0
- /package/es/{MessageWrapper → unused/MessageWrapper}/css/MessageWrapper.module.css +0 -0
- /package/es/{MessageWrapper → unused/MessageWrapper}/css/cssJSLogic.js +0 -0
- /package/es/{MessageWrapper → unused/MessageWrapper}/index.js +0 -0
- /package/es/{MessageWrapper → unused/MessageWrapper}/props/defaultProps.js +0 -0
- /package/es/{MessageWrapper → unused/MessageWrapper}/props/propTypes.js +0 -0
- /package/es/{TextMessage → unused/TextMessage}/css/TextMessage.module.css +0 -0
- /package/es/{TextMessage → unused/TextMessage}/css/cssJSLogic.js +0 -0
- /package/es/{TextMessage → unused/TextMessage}/index.js +0 -0
- /package/es/{TextMessage → unused/TextMessage}/props/defaultProps.js +0 -0
- /package/es/{TextMessage → unused/TextMessage}/props/propConstants.js +0 -0
- /package/es/{TextMessage → unused/TextMessage}/props/propTypes.js +0 -0
- /package/es/{Theme → unused}/darkTheme.js +0 -0
- /package/es/{Theme → unused}/defaultTheme.js +0 -0
|
@@ -3,31 +3,31 @@
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
5
|
/** ** Components *** */
|
|
6
|
-
import
|
|
7
|
-
import { MessageBubble, AvatarSpace, MessageBox, MessageActions } from '..';
|
|
6
|
+
import { MessageBubble, MessageBox, MessageActionsWrapper } from '../..';
|
|
8
7
|
|
|
9
8
|
/** ** Constants *** */
|
|
10
9
|
import textMessageDefaultProps from './props/defaultProps';
|
|
11
10
|
import textMessagePropTypes from './props/propTypes';
|
|
12
11
|
|
|
13
12
|
/** ** Styles *** */
|
|
14
|
-
import style from './css/TextMessage.module.css';
|
|
13
|
+
// import style from './css/TextMessage.module.css';
|
|
14
|
+
|
|
15
15
|
export default function TextMessage(props) {
|
|
16
16
|
const {
|
|
17
17
|
direction,
|
|
18
18
|
isActive,
|
|
19
19
|
needMessageActions,
|
|
20
20
|
message,
|
|
21
|
-
renderMessage,
|
|
21
|
+
// renderMessage,
|
|
22
22
|
renderMessageHeader,
|
|
23
23
|
renderMessageFooter,
|
|
24
24
|
renderMessageBoxFooter,
|
|
25
|
-
needAvatar,
|
|
26
|
-
avatarProps,
|
|
25
|
+
// needAvatar,
|
|
26
|
+
// avatarProps,
|
|
27
27
|
messageActions,
|
|
28
28
|
renderMoreIcon,
|
|
29
|
-
actionsCount
|
|
30
|
-
customStyle
|
|
29
|
+
actionsCount
|
|
30
|
+
// customStyle
|
|
31
31
|
} = props;
|
|
32
32
|
function renderMessageText() {
|
|
33
33
|
/*#__PURE__*/React.createElement("div", null, message);
|
|
@@ -35,33 +35,30 @@ export default function TextMessage(props) {
|
|
|
35
35
|
function renderMessageBox() {
|
|
36
36
|
return /*#__PURE__*/React.createElement(MessageBox, {
|
|
37
37
|
renderMessage: renderMessageText,
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
renderMessageFooter: renderMessageFooter,
|
|
39
|
+
renderMessageHeader: renderMessageHeader
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
function renderAvatarSpace() {
|
|
43
|
-
return
|
|
44
|
-
needAvatar: needAvatar,
|
|
45
|
-
avatarProps: avatarProps
|
|
46
|
-
});
|
|
43
|
+
return null;
|
|
47
44
|
}
|
|
48
45
|
function renderMessageActions() {
|
|
49
|
-
return /*#__PURE__*/React.createElement(
|
|
46
|
+
return /*#__PURE__*/React.createElement(MessageActionsWrapper, {
|
|
50
47
|
actions: messageActions,
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
moreCount: actionsCount,
|
|
49
|
+
renderMoreIcon: renderMoreIcon
|
|
53
50
|
});
|
|
54
51
|
}
|
|
55
52
|
return /*#__PURE__*/React.createElement(MessageBubble, {
|
|
56
53
|
direction: direction,
|
|
57
54
|
isActive: isActive,
|
|
58
55
|
needMessageActions: needMessageActions,
|
|
59
|
-
|
|
56
|
+
renderAvatarSpace: renderAvatarSpace
|
|
60
57
|
// renderMessageBoxHeader={() => null}
|
|
61
58
|
,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
renderMessageActions: renderMessageActions,
|
|
60
|
+
renderMessageBox: renderMessageBox,
|
|
61
|
+
renderMessageBoxFooter: renderMessageBoxFooter
|
|
65
62
|
});
|
|
66
63
|
}
|
|
67
64
|
TextMessage.propTypes = textMessageDefaultProps;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohoim/chat-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "Chat Components",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"@zohodesk/utils": "1.3.9",
|
|
37
37
|
"@zohodesk/variables": "1.0.0-beta.30",
|
|
38
38
|
"@zohodesk/virtualizer": "1.0.13",
|
|
39
|
-
"@zohoim/chat-components-hooks": "^0.0.
|
|
40
|
-
"@zohoim/chat-components-utils": "^0.0.
|
|
39
|
+
"@zohoim/chat-components-hooks": "^0.0.11",
|
|
40
|
+
"@zohoim/chat-components-utils": "^0.0.10"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"html-to-react": "^1.4.8",
|
|
44
44
|
"react-to-jsx": "^1.3.2"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "a17ea9881b19b8533d05d1ea4334b47d6aa86797"
|
|
47
47
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** ** Libraries *** */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
/** ** Components *** */
|
|
5
|
-
import IMMessageStatus from '../../IMMessageStatus/IMMessageStatus';
|
|
6
|
-
export default function renderMessageBoxFooter(props) {
|
|
7
|
-
return /*#__PURE__*/React.createElement(IMMessageStatus, null);
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** ** Libraries *** */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
/** ** Components *** */
|
|
5
|
-
import IMMessageActions from '../../IMMessageActions/IMMessageActions';
|
|
6
|
-
export default function renderMessageBoxFooter(props) {
|
|
7
|
-
return /*#__PURE__*/React.createElement(IMMessageActions, null);
|
|
8
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/** ** Libraries *** */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
/** ** Components *** */
|
|
5
|
-
import MessageBox from '../../MessageBox/MessageBox';
|
|
6
|
-
export default function renderMessageBox(props) {
|
|
7
|
-
const {
|
|
8
|
-
renderMessageFooter,
|
|
9
|
-
renderMessageHeader,
|
|
10
|
-
renderMessageStatus,
|
|
11
|
-
renderMessage,
|
|
12
|
-
customStyle
|
|
13
|
-
} = props;
|
|
14
|
-
return /*#__PURE__*/React.createElement(MessageBox, props);
|
|
15
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** ** Libraries *** */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
/** ** Components *** */
|
|
5
|
-
import MessageBoxFooter from '../../MessageBoxFooter/MessageBoxFooter';
|
|
6
|
-
export default function renderMessageBoxFooter(props) {
|
|
7
|
-
return /*#__PURE__*/React.createElement(MessageBoxFooter, null);
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** ** Libraries *** */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
/** ** Components *** */
|
|
5
|
-
import IMMessageStatus from '../../IMMessageStatus/IMMessageStatus';
|
|
6
|
-
export default function renderMessageBoxFooter(props) {
|
|
7
|
-
return /*#__PURE__*/React.createElement(IMMessageStatus, null);
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** ** Libraries *** */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
/** ** Components *** */
|
|
5
|
-
import IMMessageStatus from '../../IMMessageStatus/IMMessageStatus';
|
|
6
|
-
export default function renderMessageBoxFooter(props) {
|
|
7
|
-
return /*#__PURE__*/React.createElement(IMMessageStatus, null);
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** ** Libraries *** */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
/** ** Components *** */
|
|
5
|
-
import IMMessageAvatar from '../../IMMessageAvatar/IMMessageAvatar';
|
|
6
|
-
export default function renderMessageBoxFooter(props) {
|
|
7
|
-
return /*#__PURE__*/React.createElement(IMMessageAvatar, null);
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** ** Libraries *** */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
/** ** Components *** */
|
|
5
|
-
import IMMessageStatus from '../../IMMessageStatus/IMMessageStatus';
|
|
6
|
-
export default function renderMessageBoxFooter(props) {
|
|
7
|
-
return /*#__PURE__*/React.createElement(IMMessageStatus, props);
|
|
8
|
-
}
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-use-before-define */
|
|
2
|
-
/* eslint-disable react/jsx-no-bind */
|
|
3
|
-
/* eslint-disable max-len */
|
|
4
|
-
/* eslint-disable arrow-parens */
|
|
5
|
-
|
|
6
|
-
/** ** Libraries *** */
|
|
7
|
-
import React from 'react';
|
|
8
|
-
|
|
9
|
-
/** ** Components *** */
|
|
10
|
-
import ActionIcon from '../../ActionIcon/ActionIcon';
|
|
11
|
-
import MessageActions from '../../MessageActions/MessageActions';
|
|
12
|
-
import MessageAction from '../../MessageAction/MessageAction';
|
|
13
|
-
|
|
14
|
-
/** ** Icons *** */
|
|
15
|
-
import ReplyIcon from '@zohodesk/icon/es/general/Reply';
|
|
16
|
-
import ReloadIcon from '@zohodesk/icon/es/general/Reload';
|
|
17
|
-
import CopyIcon from '@zohodesk/icon/es/general/Copy';
|
|
18
|
-
import DownloadIcon from '@zohodesk/icon/es/general/Cloud';
|
|
19
|
-
import DeleteIcon from '@zohodesk/icon/es/general/Delete';
|
|
20
|
-
import ForwardIcon from '@zohodesk/icon/es/channels/EmailForward';
|
|
21
|
-
import MoreIcon from '@zohodesk/icon/es/general/More';
|
|
22
|
-
import ConvertTicket from '../../icons/iconSrc/actions/ConvertTicket';
|
|
23
|
-
|
|
24
|
-
/** ** Hooks *** */
|
|
25
|
-
import useIMMessageActions from '@zohoim/chat-components-hooks/es/im/IMMessageActions/useIMMessageActions';
|
|
26
|
-
|
|
27
|
-
/** ** Methods *** */
|
|
28
|
-
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
29
|
-
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
30
|
-
import cssJSLogic from './css/cssJSLogic';
|
|
31
|
-
|
|
32
|
-
/** ** Constants *** */
|
|
33
|
-
import imMessageActionsDefaultProps from './props/defaultProps';
|
|
34
|
-
import imMessageActionsPropTypes from './props/propTypes';
|
|
35
|
-
import { dummyObject } from '@zohoim/chat-components-utils/es/constants';
|
|
36
|
-
import { defaultMessageActions } from '@zohoim/chat-components-utils/es/constants/messageActionConstants';
|
|
37
|
-
|
|
38
|
-
/** ** CSS *** */
|
|
39
|
-
import style from './css/IMMessageActions.module.css';
|
|
40
|
-
const {
|
|
41
|
-
REPLY,
|
|
42
|
-
COPY,
|
|
43
|
-
DOWNLOAD,
|
|
44
|
-
CREATE_TICKET,
|
|
45
|
-
RESEND,
|
|
46
|
-
DELETE,
|
|
47
|
-
FORWARD
|
|
48
|
-
} = defaultMessageActions;
|
|
49
|
-
export default function IMMessageActions(props) {
|
|
50
|
-
const {
|
|
51
|
-
actions,
|
|
52
|
-
defaultShowCount,
|
|
53
|
-
actionIconCustomStyle,
|
|
54
|
-
moreItemCustomStyle,
|
|
55
|
-
onSelect,
|
|
56
|
-
customStyle,
|
|
57
|
-
morePopupCustomStyle,
|
|
58
|
-
renderSecondaryActions
|
|
59
|
-
} = props;
|
|
60
|
-
|
|
61
|
-
/* external customization */
|
|
62
|
-
const newStyle = useMergeStyle(style, customStyle);
|
|
63
|
-
/* css classnames added based on logic */
|
|
64
|
-
const {
|
|
65
|
-
moreIconClass,
|
|
66
|
-
secondaryActionsClass,
|
|
67
|
-
iconStyle
|
|
68
|
-
} = cssJSLogic(props, newStyle);
|
|
69
|
-
const {
|
|
70
|
-
actionDetails
|
|
71
|
-
} = useIMMessageActions({
|
|
72
|
-
actions,
|
|
73
|
-
defaultRenderFunction: renderAction
|
|
74
|
-
});
|
|
75
|
-
const {
|
|
76
|
-
allActions
|
|
77
|
-
} = actionDetails;
|
|
78
|
-
function handleClickAction(_ref) {
|
|
79
|
-
let {
|
|
80
|
-
id,
|
|
81
|
-
e
|
|
82
|
-
} = _ref;
|
|
83
|
-
onSelect && onSelect({
|
|
84
|
-
id,
|
|
85
|
-
e
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
function renderIcon(_ref2) {
|
|
89
|
-
let {
|
|
90
|
-
id
|
|
91
|
-
} = _ref2;
|
|
92
|
-
const iconMapping = {
|
|
93
|
-
[REPLY]: ReplyIcon,
|
|
94
|
-
[COPY]: CopyIcon,
|
|
95
|
-
[DOWNLOAD]: DownloadIcon,
|
|
96
|
-
[CREATE_TICKET]: ConvertTicket,
|
|
97
|
-
[RESEND]: ReloadIcon,
|
|
98
|
-
[DELETE]: DeleteIcon,
|
|
99
|
-
[FORWARD]: ForwardIcon
|
|
100
|
-
};
|
|
101
|
-
const IconComponent = iconMapping[id];
|
|
102
|
-
return IconComponent ? /*#__PURE__*/React.createElement(IconComponent, {
|
|
103
|
-
customStyle: iconStyle
|
|
104
|
-
}) : null;
|
|
105
|
-
}
|
|
106
|
-
function renderAction() {
|
|
107
|
-
let {
|
|
108
|
-
id,
|
|
109
|
-
isShowInMore,
|
|
110
|
-
action,
|
|
111
|
-
closePopup
|
|
112
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
113
|
-
const {
|
|
114
|
-
displayText,
|
|
115
|
-
iconTitle
|
|
116
|
-
} = action || dummyObject;
|
|
117
|
-
return /*#__PURE__*/React.createElement(MessageAction, {
|
|
118
|
-
displayText: displayText,
|
|
119
|
-
id: id,
|
|
120
|
-
index: id,
|
|
121
|
-
key: id,
|
|
122
|
-
renderIcon: renderIcon,
|
|
123
|
-
onClick: handleClickAction,
|
|
124
|
-
isShowInMore: isShowInMore,
|
|
125
|
-
iconTitle: iconTitle,
|
|
126
|
-
actionIconCustomStyle: actionIconCustomStyle,
|
|
127
|
-
moreItemCustomStyle: moreItemCustomStyle,
|
|
128
|
-
closePopup: closePopup
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
function renderMoreIcon() {
|
|
132
|
-
return /*#__PURE__*/React.createElement(ActionIcon, {
|
|
133
|
-
renderIcon: () => /*#__PURE__*/React.createElement("div", {
|
|
134
|
-
className: moreIconClass
|
|
135
|
-
}, /*#__PURE__*/React.createElement(MoreIcon, null)),
|
|
136
|
-
customStyle: actionIconCustomStyle
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
const secondaryActions = renderHandler(renderSecondaryActions)();
|
|
140
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(MessageActions, {
|
|
141
|
-
actions: allActions,
|
|
142
|
-
renderMoreIcon: renderMoreIcon,
|
|
143
|
-
defaultShowCount: defaultShowCount,
|
|
144
|
-
morePopupCustomStyle: morePopupCustomStyle
|
|
145
|
-
}), secondaryActions ? /*#__PURE__*/React.createElement("div", {
|
|
146
|
-
className: secondaryActionsClass
|
|
147
|
-
}, secondaryActions) : null);
|
|
148
|
-
}
|
|
149
|
-
IMMessageActions.propTypes = imMessageActionsPropTypes;
|
|
150
|
-
IMMessageActions.defaultProps = imMessageActionsDefaultProps;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
.varClass {
|
|
2
|
-
/* --imMessageActions-secondaryActions_margin: var(--imlib_size_5); */
|
|
3
|
-
--imMessageActions-action_icon_size: var(--imlib_size_15);
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
[dir=ltr] .moreIcon svg {
|
|
7
|
-
transform: rotate(90deg);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
[dir=rtl] .moreIcon svg {
|
|
11
|
-
transform: rotate(-90deg);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.secondaryActions {
|
|
15
|
-
composes: varClass;
|
|
16
|
-
/* margin-top: var(--imMessageActions-secondaryActions_margin); */
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
[dir=ltr] .secondaryActions {
|
|
20
|
-
text-align: left;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
[dir=rtl] .secondaryActions {
|
|
24
|
-
text-align: right;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.icon {
|
|
28
|
-
composes: varClass;
|
|
29
|
-
width: var(--imMessageActions-action_icon_size);
|
|
30
|
-
height: var(--imMessageActions-action_icon_size);
|
|
31
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/** ** Methods *** */
|
|
2
|
-
import { compileClassNames } from '@zohodesk/utils';
|
|
3
|
-
export default function cssJSLogic(props, style) {
|
|
4
|
-
const moreIconClass = compileClassNames({
|
|
5
|
-
[style.moreIcon]: true
|
|
6
|
-
});
|
|
7
|
-
const secondaryActionsClass = compileClassNames({
|
|
8
|
-
[style.secondaryActions]: true
|
|
9
|
-
});
|
|
10
|
-
const iconClass = compileClassNames({
|
|
11
|
-
[style.icon]: true
|
|
12
|
-
});
|
|
13
|
-
return {
|
|
14
|
-
moreIconClass,
|
|
15
|
-
secondaryActionsClass,
|
|
16
|
-
iconStyle: {
|
|
17
|
-
base: iconClass
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as IMMessageActions } from './IMMessageActions';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** ** Constants *** */
|
|
2
|
-
import { dummyObject, dummyArray } from '@zohoim/chat-components-utils/es/constants';
|
|
3
|
-
import { actionsDefaultShowCount } from '@zohoim/chat-components-utils/es/constants/messageActionConstants';
|
|
4
|
-
const imMessageActionsDefaultProps = {
|
|
5
|
-
customStyle: dummyObject,
|
|
6
|
-
actionIconCustomStyle: dummyObject,
|
|
7
|
-
morePopupCustomStyle: dummyObject,
|
|
8
|
-
moreItemCustomStyle: dummyObject,
|
|
9
|
-
defaultShowCount: actionsDefaultShowCount,
|
|
10
|
-
actions: dummyArray
|
|
11
|
-
};
|
|
12
|
-
export default imMessageActionsDefaultProps;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/** ** Libraries *** */
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
|
-
|
|
4
|
-
/** ** Constants *** */
|
|
5
|
-
import { defaultMessageActions } from "@zohoim/chat-components-utils/es/constants/messageActionConstants";
|
|
6
|
-
const {
|
|
7
|
-
REPLY,
|
|
8
|
-
COPY,
|
|
9
|
-
DOWNLOAD,
|
|
10
|
-
CREATE_TICKET,
|
|
11
|
-
RESEND,
|
|
12
|
-
DELETE,
|
|
13
|
-
FORWARD
|
|
14
|
-
} = defaultMessageActions;
|
|
15
|
-
const imMessageActionsPropTypes = {
|
|
16
|
-
actions: PropTypes.arrayOf(PropTypes.shape({
|
|
17
|
-
id: PropTypes.oneOfType([PropTypes.string, PropTypes.oneOf([REPLY, COPY, DOWNLOAD, CREATE_TICKET, RESEND, DELETE, FORWARD])]).isRequired,
|
|
18
|
-
displayText: PropTypes.string,
|
|
19
|
-
renderFunction: PropTypes.func,
|
|
20
|
-
iconTitle: PropTypes.string
|
|
21
|
-
})).isRequired,
|
|
22
|
-
defaultShowCount: PropTypes.number,
|
|
23
|
-
actionIconCustomStyle: PropTypes.object,
|
|
24
|
-
morePopupCustomStyle: PropTypes.object,
|
|
25
|
-
moreItemCustomStyle: PropTypes.object,
|
|
26
|
-
onSelect: PropTypes.func,
|
|
27
|
-
customStyle: PropTypes.object,
|
|
28
|
-
renderSecondaryActions: PropTypes.func
|
|
29
|
-
};
|
|
30
|
-
export default imMessageActionsPropTypes;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as IMMessageStatus } from './IMMessageStatus';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|