@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
package/es/Message/Message.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
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); }
|
|
1
2
|
/* eslint-disable react/jsx-no-bind */
|
|
2
3
|
/* eslint-disable max-len */
|
|
3
4
|
|
|
@@ -8,128 +9,92 @@ import React from 'react';
|
|
|
8
9
|
import messageDefaultProps from './props/defaultProps';
|
|
9
10
|
import messagePropTypes from './props/propTypes';
|
|
10
11
|
import { direction as directionConstants } from '@zohoim/chat-components-utils/es/constants/messageConstants';
|
|
12
|
+
import { dummyObject } from '@zohoim/chat-components-utils/es/constants';
|
|
13
|
+
import messageStatusConstants from '@zohoim/chat-components-utils/es/constants/messageStatusConstants';
|
|
11
14
|
|
|
12
15
|
/** ** Components *** */
|
|
13
16
|
import MessageBubble from '../MessageBubble/MessageBubble';
|
|
14
17
|
import MessageBox from '../MessageBox/MessageBox';
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
+
import MessageAvatar from '../MessageAvatar/MessageAvatar';
|
|
19
|
+
import MessageActions from '../MessageActions/MessageActions';
|
|
20
|
+
import MessageStatus from '../MessageStatus/MessageStatus';
|
|
21
|
+
const {
|
|
22
|
+
FAILED
|
|
23
|
+
} = messageStatusConstants;
|
|
18
24
|
export default function Message(props) {
|
|
19
25
|
const {
|
|
20
|
-
customStyle,
|
|
21
26
|
direction,
|
|
22
27
|
isActive,
|
|
23
|
-
needMessageActions,
|
|
24
|
-
renderMessageBoxFooter,
|
|
25
|
-
/* Avatar Related Props Start */
|
|
26
|
-
needSender,
|
|
27
28
|
isShowSender,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
avatarCustomStyle,
|
|
34
|
-
senderIntegrationIcon,
|
|
35
|
-
senderIntegrationIconSize,
|
|
36
|
-
senderIntegrationIconCustomStyle,
|
|
37
|
-
isCustomIntegrationIcon,
|
|
38
|
-
isCustomSenderAvatar,
|
|
39
|
-
renderCustomIntegrationIcon,
|
|
40
|
-
renderCustomSenderAvatar,
|
|
41
|
-
/*Avatar Related Props End*/
|
|
42
|
-
|
|
43
|
-
/* MessageBox Props Start */
|
|
44
|
-
isFailedMessage,
|
|
45
|
-
needMessageBox,
|
|
46
|
-
renderMessage,
|
|
47
|
-
renderMessageFooter,
|
|
48
|
-
renderMessageHeader,
|
|
49
|
-
messageBoxCustomStyle,
|
|
50
|
-
/*MessageBox Props End */
|
|
51
|
-
|
|
52
|
-
/* MessageAction Props Start */
|
|
53
|
-
messageActions,
|
|
54
|
-
actionsDefaultShowCount,
|
|
55
|
-
actionIconCustomStyle,
|
|
56
|
-
moreActionItemCustomStyle,
|
|
57
|
-
onSelectAction,
|
|
58
|
-
messageActionCustomStyle,
|
|
59
|
-
moreActionPopupCustomStyle,
|
|
29
|
+
ownerDetails,
|
|
30
|
+
renderOwnerOverlay,
|
|
31
|
+
status,
|
|
32
|
+
statusTooltip,
|
|
33
|
+
actions,
|
|
60
34
|
renderSecondaryActions,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
messageStatus,
|
|
65
|
-
messageStatusCustomStyle,
|
|
66
|
-
statusTitle
|
|
67
|
-
/*MessageStatus Props End */
|
|
35
|
+
onSelectAction,
|
|
36
|
+
renderContent,
|
|
37
|
+
customProps
|
|
68
38
|
} = props;
|
|
69
|
-
|
|
39
|
+
const {
|
|
40
|
+
messageBubbleProps = dummyObject,
|
|
41
|
+
messageOwnerProps = dummyObject,
|
|
42
|
+
messageBoxProps = dummyObject,
|
|
43
|
+
messageStatusProps = dummyObject,
|
|
44
|
+
messageActionsProps = dummyObject
|
|
45
|
+
} = customProps;
|
|
46
|
+
const isIncoming = direction === directionConstants.IN;
|
|
47
|
+
const isOutgoing = direction === directionConstants.OUT;
|
|
48
|
+
const isFailed = status === FAILED;
|
|
49
|
+
function handleRenderMessageOwner() {
|
|
50
|
+
const {
|
|
51
|
+
src,
|
|
52
|
+
alternateSrc,
|
|
53
|
+
name
|
|
54
|
+
} = ownerDetails || dummyObject;
|
|
70
55
|
const props = {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
title:
|
|
56
|
+
src,
|
|
57
|
+
alternateSrc,
|
|
58
|
+
title: name,
|
|
59
|
+
renderIcon: renderOwnerOverlay
|
|
74
60
|
};
|
|
75
|
-
return
|
|
61
|
+
return ownerDetails ? /*#__PURE__*/React.createElement(MessageAvatar, _extends({}, props, messageOwnerProps)) : null;
|
|
76
62
|
}
|
|
77
|
-
function
|
|
63
|
+
function handleRenderMessageStatus() {
|
|
78
64
|
const props = {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
renderMessageStatus: handleRenderMessageStatus,
|
|
82
|
-
renderMessage,
|
|
83
|
-
customStyle: messageBoxCustomStyle,
|
|
84
|
-
isFailed: isFailedMessage,
|
|
85
|
-
isIncoming: direction === directionConstants.IN,
|
|
86
|
-
isOutgoing: direction === directionConstants.OUT
|
|
65
|
+
messageStatus: status,
|
|
66
|
+
title: statusTooltip
|
|
87
67
|
};
|
|
88
|
-
return /*#__PURE__*/React.createElement(
|
|
68
|
+
return status ? /*#__PURE__*/React.createElement(MessageStatus, _extends({}, props, messageStatusProps)) : null;
|
|
89
69
|
}
|
|
90
|
-
function
|
|
70
|
+
function handleRenderMessageBox() {
|
|
91
71
|
const props = {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
customStyle: avatarCustomStyle,
|
|
98
|
-
integrationName: senderIntegrationIcon,
|
|
99
|
-
iconSize: senderIntegrationIconSize,
|
|
100
|
-
iconCustomStyle: senderIntegrationIconCustomStyle,
|
|
101
|
-
isCustomIcon: isCustomIntegrationIcon,
|
|
102
|
-
renderCustomIcon: renderCustomIntegrationIcon,
|
|
103
|
-
isCustomAvatar: isCustomSenderAvatar,
|
|
104
|
-
renderCustomAvatar: renderCustomSenderAvatar
|
|
72
|
+
renderMessageStatus: handleRenderMessageStatus,
|
|
73
|
+
renderMessage: renderContent,
|
|
74
|
+
isFailed,
|
|
75
|
+
isIncoming,
|
|
76
|
+
isOutgoing
|
|
105
77
|
};
|
|
106
|
-
return
|
|
78
|
+
return /*#__PURE__*/React.createElement(MessageBox, _extends({}, props, messageBoxProps));
|
|
107
79
|
}
|
|
108
80
|
function handleRenderMessageActions() {
|
|
109
81
|
const props = {
|
|
110
|
-
actions
|
|
111
|
-
renderSecondaryActions: renderSecondaryActions,
|
|
112
|
-
defaultShowCount: actionsDefaultShowCount,
|
|
113
|
-
actionIconCustomStyle: actionIconCustomStyle,
|
|
114
|
-
moreItemCustomStyle: moreActionItemCustomStyle,
|
|
82
|
+
actions,
|
|
115
83
|
onSelect: onSelectAction,
|
|
116
|
-
|
|
117
|
-
morePopupCustomStyle: moreActionPopupCustomStyle
|
|
84
|
+
renderSecondaryActions
|
|
118
85
|
};
|
|
119
|
-
return /*#__PURE__*/React.createElement(
|
|
86
|
+
return /*#__PURE__*/React.createElement(MessageActions, _extends({}, props, messageActionsProps));
|
|
120
87
|
}
|
|
121
|
-
|
|
88
|
+
const needMessageActions = !!actions;
|
|
89
|
+
return /*#__PURE__*/React.createElement(MessageBubble, _extends({
|
|
122
90
|
direction: direction,
|
|
123
91
|
isActive: isActive,
|
|
124
92
|
needMessageActions: needMessageActions,
|
|
125
|
-
|
|
126
|
-
renderMessageBoxFooter: renderMessageBoxFooter,
|
|
127
|
-
renderMessageOwner: handleRenderMessageOwner,
|
|
93
|
+
needSender: isShowSender,
|
|
128
94
|
renderMessageActions: handleRenderMessageActions,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
});
|
|
95
|
+
renderMessageBox: handleRenderMessageBox,
|
|
96
|
+
renderMessageOwner: handleRenderMessageOwner
|
|
97
|
+
}, messageBubbleProps));
|
|
133
98
|
}
|
|
134
99
|
Message.propTypes = messagePropTypes;
|
|
135
100
|
Message.defaultProps = messageDefaultProps;
|
|
@@ -1,43 +1,11 @@
|
|
|
1
1
|
/** ** Constants *** */
|
|
2
|
-
import { dummyObject, dummyArray } from '@zohoim/chat-components-utils/es/constants';
|
|
3
2
|
import { direction } from '@zohoim/chat-components-utils/es/constants/messageConstants';
|
|
4
|
-
import sizes from '@zohoim/chat-components-utils/es/constants/sizes';
|
|
5
|
-
import { actionsDefaultShowCount } from '@zohoim/chat-components-utils/es/constants/messageActionConstants';
|
|
6
3
|
const messageDefaultProps = {
|
|
7
|
-
customStyle: dummyObject,
|
|
8
4
|
direction: direction.IN,
|
|
9
5
|
isActive: false,
|
|
10
|
-
needMessageActions: true,
|
|
11
|
-
needSender: true,
|
|
12
6
|
isShowSender: true,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
senderTitle: '',
|
|
16
|
-
//'RAVI KUMAR',
|
|
17
|
-
senderAvatarSize: 'medium',
|
|
18
|
-
senderName: '',
|
|
19
|
-
//'Ravi kumar',
|
|
20
|
-
avatarCustomStyle: dummyObject,
|
|
21
|
-
senderIntegrationIcon: '',
|
|
22
|
-
//WHATSAPP
|
|
23
|
-
senderIntegrationIconSize: sizes.SMALL,
|
|
24
|
-
senderIntegrationIconCustomStyle: dummyObject,
|
|
25
|
-
isCustomIntegrationIcon: false,
|
|
26
|
-
isCustomSenderAvatar: false,
|
|
27
|
-
needMessageBox: true,
|
|
28
|
-
isFailedMessage: false,
|
|
29
|
-
messageBoxCustomStyle: dummyObject,
|
|
30
|
-
messageActions: dummyArray,
|
|
31
|
-
actionsDefaultShowCount: actionsDefaultShowCount,
|
|
32
|
-
actionIconCustomStyle: dummyObject,
|
|
33
|
-
moreActionItemCustomStyle: dummyObject,
|
|
34
|
-
messageActionCustomStyle: dummyObject,
|
|
35
|
-
moreActionPopupCustomStyle: dummyObject,
|
|
36
|
-
messageStatus: '',
|
|
37
|
-
// READ,
|
|
38
|
-
messageStatusCustomStyle: dummyObject,
|
|
39
|
-
statusTitle: '' // READ,
|
|
40
|
-
// renderMessage: () => <div>Test</div>
|
|
7
|
+
customProps: {}
|
|
8
|
+
// renderContent: () => <div>Test</div>
|
|
41
9
|
};
|
|
42
10
|
|
|
43
11
|
export default messageDefaultProps;
|
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
4
|
/** ** Constants *** */
|
|
5
|
-
import integrationConstants from '@zohoim/chat-components-utils/es/constants/integrationConstants';
|
|
6
5
|
import { defaultMessageActions } from '@zohoim/chat-components-utils/es/constants/messageActionConstants';
|
|
7
6
|
import messageStatusConstants from '@zohoim/chat-components-utils/es/constants/messageStatusConstants';
|
|
8
7
|
import { direction } from '@zohoim/chat-components-utils/es/constants/messageConstants';
|
|
9
|
-
import sizes from '@zohoim/chat-components-utils/es/constants/sizes';
|
|
10
8
|
const {
|
|
11
9
|
REPLY,
|
|
12
10
|
COPY,
|
|
@@ -16,15 +14,6 @@ const {
|
|
|
16
14
|
DELETE,
|
|
17
15
|
FORWARD
|
|
18
16
|
} = defaultMessageActions;
|
|
19
|
-
const {
|
|
20
|
-
WHATSAPP,
|
|
21
|
-
TELEGRAM,
|
|
22
|
-
INSTAGRAM,
|
|
23
|
-
ASAP,
|
|
24
|
-
WECHAT,
|
|
25
|
-
TWILLIO,
|
|
26
|
-
LINE
|
|
27
|
-
} = integrationConstants;
|
|
28
17
|
const {
|
|
29
18
|
SENT,
|
|
30
19
|
SAVED,
|
|
@@ -40,59 +29,32 @@ const {
|
|
|
40
29
|
OUT
|
|
41
30
|
} = direction;
|
|
42
31
|
const messagePropTypes = {
|
|
43
|
-
|
|
44
|
-
direction: PropTypes.oneOf([IN, OUT]),
|
|
32
|
+
direction: PropTypes.oneOf([IN, OUT]).isRequired,
|
|
45
33
|
isActive: PropTypes.bool,
|
|
46
|
-
needMessageActions: PropTypes.bool,
|
|
47
|
-
renderMessageBoxFooter: PropTypes.func,
|
|
48
|
-
/* Avatar Related Props Start */
|
|
49
|
-
needSender: PropTypes.bool,
|
|
50
34
|
isShowSender: PropTypes.bool,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
isCustomIntegrationIcon: PropTypes.bool,
|
|
61
|
-
isCustomSenderAvatar: PropTypes.bool,
|
|
62
|
-
renderCustomIntegrationIcon: PropTypes.func,
|
|
63
|
-
renderCustomSenderAvatar: PropTypes.func,
|
|
64
|
-
/*Avatar Related Props End*/
|
|
65
|
-
|
|
66
|
-
/* MessageBox Props Start */
|
|
67
|
-
needMessageBox: PropTypes.bool,
|
|
68
|
-
renderMessage: PropTypes.func.isRequired,
|
|
69
|
-
renderMessageFooter: PropTypes.func,
|
|
70
|
-
renderMessageHeader: PropTypes.func,
|
|
71
|
-
messageBoxCustomStyle: PropTypes.object,
|
|
72
|
-
isFailedMessage: PropTypes.bool,
|
|
73
|
-
/*MessageBox Props End */
|
|
74
|
-
|
|
75
|
-
/* MessageAction Props Start */
|
|
76
|
-
messageActions: PropTypes.arrayOf(PropTypes.shape({
|
|
35
|
+
ownerDetails: PropTypes.shape({
|
|
36
|
+
src: PropTypes.string,
|
|
37
|
+
alternateSrc: PropTypes.string,
|
|
38
|
+
name: PropTypes.string
|
|
39
|
+
}),
|
|
40
|
+
renderOwnerOverlay: PropTypes.func,
|
|
41
|
+
status: PropTypes.oneOf([SENT, SAVED, QUEUED, DELIVERED, READ, UNSENT, FAILED, OUTGOING]),
|
|
42
|
+
statusTooltip: PropTypes.string,
|
|
43
|
+
actions: PropTypes.arrayOf(PropTypes.shape({
|
|
77
44
|
id: PropTypes.oneOfType([PropTypes.string, PropTypes.oneOf([REPLY, COPY, DOWNLOAD, CREATE_TICKET, RESEND, DELETE, FORWARD])]).isRequired,
|
|
78
45
|
displayText: PropTypes.string,
|
|
79
46
|
renderFunction: PropTypes.func,
|
|
80
47
|
iconTitle: PropTypes.string
|
|
81
48
|
})),
|
|
82
|
-
renderSecondaryActions: PropTypes.func,
|
|
83
|
-
actionsDefaultShowCount: PropTypes.number,
|
|
84
|
-
actionIconCustomStyle: PropTypes.object,
|
|
85
|
-
moreActionItemCustomStyle: PropTypes.object,
|
|
86
49
|
onSelectAction: PropTypes.func,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
50
|
+
renderSecondaryActions: PropTypes.func,
|
|
51
|
+
renderContent: PropTypes.func.isRequired,
|
|
52
|
+
customProps: PropTypes.shape({
|
|
53
|
+
messageBubbleProps: PropTypes.object,
|
|
54
|
+
messageOwnerProps: PropTypes.object,
|
|
55
|
+
messageBoxProps: PropTypes.object,
|
|
56
|
+
messageStatusProps: PropTypes.object,
|
|
57
|
+
messageActionsProps: PropTypes.object
|
|
58
|
+
})
|
|
96
59
|
};
|
|
97
|
-
|
|
98
60
|
export default messagePropTypes;
|
|
@@ -24,19 +24,19 @@ export default function MessageAction(props) {
|
|
|
24
24
|
closePopup
|
|
25
25
|
} = props;
|
|
26
26
|
return /*#__PURE__*/React.createElement(React.Fragment, null, isShowInMore ? /*#__PURE__*/React.createElement(MoreActionItem, {
|
|
27
|
+
closePopup: closePopup,
|
|
28
|
+
customStyle: moreItemCustomStyle,
|
|
27
29
|
displayText: displayText,
|
|
28
30
|
iconTitle: iconTitle,
|
|
29
31
|
id: id,
|
|
30
32
|
index: index,
|
|
31
|
-
customStyle: moreItemCustomStyle,
|
|
32
33
|
onClick: onClick,
|
|
33
|
-
renderIcon: renderIcon
|
|
34
|
-
closePopup: closePopup
|
|
34
|
+
renderIcon: renderIcon
|
|
35
35
|
}) : /*#__PURE__*/React.createElement(ActionIcon, {
|
|
36
|
-
renderIcon: renderIcon,
|
|
37
36
|
customStyle: actionIconCustomStyle,
|
|
38
|
-
onClick: onClick,
|
|
39
37
|
id: id,
|
|
38
|
+
onClick: onClick,
|
|
39
|
+
renderIcon: renderIcon,
|
|
40
40
|
title: iconTitle
|
|
41
41
|
}));
|
|
42
42
|
}
|
|
@@ -1,75 +1,150 @@
|
|
|
1
|
+
/* eslint-disable no-use-before-define */
|
|
2
|
+
/* eslint-disable react/jsx-no-bind */
|
|
1
3
|
/* eslint-disable max-len */
|
|
4
|
+
/* eslint-disable arrow-parens */
|
|
2
5
|
|
|
3
6
|
/** ** Libraries *** */
|
|
4
7
|
import React from 'react';
|
|
5
8
|
|
|
6
9
|
/** ** Components *** */
|
|
7
|
-
import
|
|
8
|
-
import
|
|
10
|
+
import ActionIcon from '../ActionIcon/ActionIcon';
|
|
11
|
+
import MessageActionsWrapper from '../MessageActionsWrapper/MessageActionsWrapper';
|
|
12
|
+
import MessageAction from '../MessageAction/MessageAction';
|
|
9
13
|
|
|
10
|
-
/** **
|
|
11
|
-
import
|
|
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';
|
|
12
23
|
|
|
13
|
-
/** **
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import constantProps from './props/propConstants';
|
|
24
|
+
/** ** Hooks *** */
|
|
25
|
+
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
26
|
+
import useMessageActions from '@zohoim/chat-components-hooks/es/MessageActions/useMessageActions';
|
|
17
27
|
|
|
18
28
|
/** ** Methods *** */
|
|
19
29
|
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
20
|
-
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
21
30
|
import cssJSLogic from './css/cssJSLogic';
|
|
22
31
|
|
|
23
|
-
/** **
|
|
32
|
+
/** ** Constants *** */
|
|
33
|
+
import messageActionsDefaultProps from './props/defaultProps';
|
|
34
|
+
import messageActionsPropTypes 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 *** */
|
|
24
39
|
import style from './css/MessageActions.module.css';
|
|
25
|
-
|
|
40
|
+
const {
|
|
41
|
+
REPLY,
|
|
42
|
+
COPY,
|
|
43
|
+
DOWNLOAD,
|
|
44
|
+
CREATE_TICKET,
|
|
45
|
+
RESEND,
|
|
46
|
+
DELETE,
|
|
47
|
+
FORWARD
|
|
48
|
+
} = defaultMessageActions;
|
|
49
|
+
export default function MessageActions(props) {
|
|
26
50
|
const {
|
|
27
51
|
actions,
|
|
28
|
-
renderMoreIcon,
|
|
29
52
|
defaultShowCount,
|
|
53
|
+
actionIconCustomStyle,
|
|
54
|
+
moreItemCustomStyle,
|
|
55
|
+
onSelect,
|
|
30
56
|
customStyle,
|
|
31
|
-
morePopupCustomStyle
|
|
57
|
+
morePopupCustomStyle,
|
|
58
|
+
renderSecondaryActions
|
|
32
59
|
} = props;
|
|
33
60
|
|
|
34
61
|
/* external customization */
|
|
35
62
|
const newStyle = useMergeStyle(style, customStyle);
|
|
36
63
|
/* css classnames added based on logic */
|
|
37
64
|
const {
|
|
38
|
-
|
|
65
|
+
moreIconClass,
|
|
66
|
+
secondaryActionsClass,
|
|
67
|
+
iconStyle
|
|
39
68
|
} = cssJSLogic(props, newStyle);
|
|
40
69
|
const {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
70
|
+
actionDetails
|
|
71
|
+
} = useMessageActions({
|
|
72
|
+
actions,
|
|
73
|
+
defaultRenderFunction: renderAction
|
|
74
|
+
});
|
|
44
75
|
const {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
+
actionIconCustomStyle: actionIconCustomStyle,
|
|
119
|
+
closePopup: closePopup,
|
|
120
|
+
displayText: displayText,
|
|
121
|
+
iconTitle: iconTitle,
|
|
122
|
+
id: id,
|
|
123
|
+
index: id,
|
|
124
|
+
isShowInMore: isShowInMore,
|
|
125
|
+
key: id,
|
|
126
|
+
moreItemCustomStyle: moreItemCustomStyle,
|
|
127
|
+
onClick: handleClickAction,
|
|
128
|
+
renderIcon: renderIcon
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
function renderMoreIcon() {
|
|
132
|
+
return /*#__PURE__*/React.createElement(ActionIcon, {
|
|
133
|
+
customStyle: actionIconCustomStyle,
|
|
134
|
+
renderIcon: () => /*#__PURE__*/React.createElement("div", {
|
|
135
|
+
className: moreIconClass
|
|
136
|
+
}, /*#__PURE__*/React.createElement(MoreIcon, null))
|
|
137
|
+
});
|
|
66
138
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
139
|
+
const secondaryActions = renderHandler(renderSecondaryActions)();
|
|
140
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(MessageActionsWrapper, {
|
|
141
|
+
actions: allActions,
|
|
142
|
+
defaultShowCount: defaultShowCount,
|
|
143
|
+
morePopupCustomStyle: morePopupCustomStyle,
|
|
144
|
+
renderMoreIcon: renderMoreIcon
|
|
145
|
+
}), secondaryActions ? /*#__PURE__*/React.createElement("div", {
|
|
146
|
+
className: secondaryActionsClass
|
|
147
|
+
}, secondaryActions) : null);
|
|
70
148
|
}
|
|
71
|
-
MessageActions.defaultProps = messageActionsDefaultProps;
|
|
72
149
|
MessageActions.propTypes = messageActionsPropTypes;
|
|
73
|
-
MessageActions.
|
|
74
|
-
MessageActions.displayName = 'MessageActions';
|
|
75
|
-
export default MessageActions;
|
|
150
|
+
MessageActions.defaultProps = messageActionsDefaultProps;
|
|
@@ -1,3 +1,31 @@
|
|
|
1
|
-
.
|
|
2
|
-
/*
|
|
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);
|
|
3
31
|
}
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
/** ** Methods *** */
|
|
2
2
|
import { compileClassNames } from '@zohodesk/utils';
|
|
3
3
|
export default function cssJSLogic(props, style) {
|
|
4
|
-
const
|
|
5
|
-
[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
|
|
6
12
|
});
|
|
7
13
|
return {
|
|
8
|
-
|
|
14
|
+
moreIconClass,
|
|
15
|
+
secondaryActionsClass,
|
|
16
|
+
iconStyle: {
|
|
17
|
+
base: iconClass
|
|
18
|
+
}
|
|
9
19
|
};
|
|
10
20
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/** ** Constants *** */
|
|
2
2
|
import { dummyObject, dummyArray } from '@zohoim/chat-components-utils/es/constants';
|
|
3
|
-
import
|
|
3
|
+
import { actionsDefaultShowCount } from '@zohoim/chat-components-utils/es/constants/messageActionConstants';
|
|
4
4
|
const messageActionsDefaultProps = {
|
|
5
|
-
actions: dummyArray,
|
|
6
5
|
customStyle: dummyObject,
|
|
6
|
+
actionIconCustomStyle: dummyObject,
|
|
7
7
|
morePopupCustomStyle: dummyObject,
|
|
8
|
-
|
|
8
|
+
moreItemCustomStyle: dummyObject,
|
|
9
|
+
defaultShowCount: actionsDefaultShowCount,
|
|
10
|
+
actions: dummyArray
|
|
9
11
|
};
|
|
10
12
|
export default messageActionsDefaultProps;
|
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
/** ** Libraries *** */
|
|
2
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;
|
|
3
15
|
const messageActionsPropTypes = {
|
|
4
|
-
renderMoreIcon: PropTypes.func,
|
|
5
16
|
actions: PropTypes.arrayOf(PropTypes.shape({
|
|
6
|
-
id: PropTypes.string.isRequired,
|
|
7
|
-
|
|
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
|
|
8
21
|
})).isRequired,
|
|
9
22
|
defaultShowCount: PropTypes.number,
|
|
10
|
-
|
|
23
|
+
actionIconCustomStyle: PropTypes.object,
|
|
24
|
+
morePopupCustomStyle: PropTypes.object,
|
|
25
|
+
moreItemCustomStyle: PropTypes.object,
|
|
26
|
+
onSelect: PropTypes.func,
|
|
27
|
+
customStyle: PropTypes.object,
|
|
28
|
+
renderSecondaryActions: PropTypes.func
|
|
11
29
|
};
|
|
12
30
|
export default messageActionsPropTypes;
|