@zohoim/chat-components 0.0.6 → 0.0.8
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 +13 -11
- package/es/ArticleBubble/ArticleBubble.js +60 -0
- package/es/ArticleBubble/css/ArticleBubble.module.css +1 -0
- package/es/ArticleBubble/css/cssJSLogic.js +34 -0
- package/es/ArticleBubble/index.js +1 -0
- package/es/ArticleBubble/props/defaultProps.js +6 -0
- package/es/ArticleBubble/props/propTypes.js +10 -0
- package/es/AttachmentBubble/AttachmentBubble.js +55 -0
- package/es/AttachmentBubble/css/AttachmentBubble.module.css +17 -0
- package/es/AttachmentBubble/css/cssJSLogic.js +18 -0
- package/es/AttachmentBubble/index.js +1 -0
- package/es/AttachmentBubble/props/defaultProps.js +7 -0
- package/es/AttachmentBubble/props/propTypes.js +10 -0
- package/es/AttachmentBubbleInfo/AttachmentBubbleInfo.js +45 -0
- package/es/AttachmentBubbleInfo/css/AttachmentBubbleInfo.module.css +18 -0
- package/es/AttachmentBubbleInfo/css/cssJSLogic.js +18 -0
- package/es/AttachmentBubbleInfo/index.js +1 -0
- package/es/AttachmentBubbleInfo/props/defaultProps.js +6 -0
- package/es/AttachmentBubbleInfo/props/propTypes.js +8 -0
- package/es/Audio/Audio.js +60 -0
- package/es/Audio/css/Audio.module.css +3 -0
- package/es/Audio/css/cssJSLogic.js +14 -0
- package/es/Audio/index.js +1 -0
- package/es/Audio/props/defaultProps.js +7 -0
- package/es/Audio/props/propTypes.js +9 -0
- package/es/AudioBubble/AudioBubble.js +58 -0
- package/es/AudioBubble/css/AudioBubble.module.css +3 -0
- package/es/AudioBubble/css/cssJSLogic.js +20 -0
- package/es/AudioBubble/index.js +1 -0
- package/es/AudioBubble/props/defaultProps.js +8 -0
- package/es/AudioBubble/props/propTypes.js +12 -0
- package/es/IMArticleBubble/IMArticleBubble.js +55 -0
- package/es/IMArticleBubble/css/IMArticleBubble.module.css +0 -0
- package/es/IMArticleBubble/css/cssJSLogic.js +10 -0
- package/es/IMArticleBubble/index.js +1 -0
- package/es/IMArticleBubble/props/defaultProps.js +8 -0
- package/es/IMArticleBubble/props/propTypes.js +14 -0
- package/es/IMAttachmentBubble/IMAttachmentBubble.js +63 -0
- package/es/IMAttachmentBubble/css/IMAttachmentBubble.module.css +1 -0
- package/es/IMAttachmentBubble/css/cssJSLogic.js +10 -0
- package/es/IMAttachmentBubble/index.js +1 -0
- package/es/IMAttachmentBubble/props/defaultProps.js +10 -0
- package/es/IMAttachmentBubble/props/propTypes.js +16 -0
- package/es/IMAttachmentIcon/IMAttachmentIcon.js +86 -0
- package/es/IMAttachmentIcon/css/IMAttachmentIcon.module.css +4 -0
- package/es/IMAttachmentIcon/css/cssJSLogic.js +16 -0
- package/es/IMAttachmentIcon/index.js +1 -0
- package/es/IMAttachmentIcon/props/defaultProps.js +6 -0
- package/es/IMAttachmentIcon/props/propTypes.js +26 -0
- package/es/IMAudioBubble/IMAudioBubble.js +63 -0
- package/es/IMAudioBubble/css/IMAudioBubble.module.css +8 -0
- package/es/IMAudioBubble/css/cssJSLogic.js +20 -0
- package/es/IMAudioBubble/index.js +1 -0
- package/es/IMAudioBubble/props/defaultProps.js +11 -0
- package/es/IMAudioBubble/props/propTypes.js +17 -0
- package/es/IMAutoMessageInfo/IMAutoMessageInfo.js +43 -0
- package/es/IMAutoMessageInfo/css/IMAutoMessageInfo.module.css +13 -0
- package/es/IMAutoMessageInfo/css/cssJSLogic.js +10 -0
- package/es/IMAutoMessageInfo/index.js +1 -0
- package/es/IMAutoMessageInfo/props/defaultProps.js +6 -0
- package/es/IMAutoMessageInfo/props/propTypes.js +26 -0
- package/es/IMDateTime/IMDateTime.js +41 -0
- package/es/IMDateTime/css/IMDateTime.module.css +5 -0
- package/es/IMDateTime/css/cssJSLogic.js +10 -0
- package/es/IMDateTime/index.js +1 -0
- package/es/IMDateTime/props/defaultProps.js +6 -0
- package/es/IMDateTime/props/propTypes.js +6 -0
- package/es/IMImageBubble/IMImageBubble.js +49 -0
- package/es/IMImageBubble/css/IMImageBubble.module.css +0 -0
- package/es/IMImageBubble/css/cssJSLogic.js +10 -0
- package/es/IMImageBubble/index.js +1 -0
- package/es/IMImageBubble/props/defaultProps.js +7 -0
- package/es/IMImageBubble/props/propTypes.js +13 -0
- package/es/IMInfoBubble/IMInfoBubble.js +37 -0
- package/es/IMInfoBubble/css/IMInfoBubble.module.css +0 -0
- package/es/IMInfoBubble/css/cssJSLogic.js +10 -0
- package/es/IMInfoBubble/index.js +1 -0
- package/es/IMInfoBubble/props/defaultProps.js +6 -0
- package/es/IMInfoBubble/props/propTypes.js +6 -0
- package/es/IMLocationBubble/IMLocationBubble.js +49 -0
- package/es/IMLocationBubble/css/IMLocationBubble.module.css +0 -0
- package/es/IMLocationBubble/css/cssJSLogic.js +10 -0
- package/es/IMLocationBubble/index.js +1 -0
- package/es/IMLocationBubble/props/defaultProps.js +8 -0
- package/es/IMLocationBubble/props/propTypes.js +11 -0
- package/es/IMMessage/IMMessage.js +156 -109
- package/es/IMMessage/props/defaultProps.js +22 -35
- package/es/IMMessage/props/propTypes.js +95 -48
- package/es/IMMessageActions/IMMessageActions.js +9 -5
- package/es/IMMessageActions/css/IMMessageActions.module.css +2 -2
- package/es/IMMessageAvatar/props/defaultProps.js +4 -2
- package/es/IMMessageContent/IMMessageContent.js +84 -0
- package/es/IMMessageContent/css/IMMessageContent.module.css +0 -0
- package/es/IMMessageContent/css/cssJSLogic.js +10 -0
- package/es/IMMessageContent/index.js +1 -0
- package/es/IMMessageContent/props/defaultProps.js +8 -0
- package/es/IMMessageContent/props/propTypes.js +35 -0
- package/es/IMMessageMeta/IMMessageMeta.js +60 -0
- package/es/IMMessageMeta/css/IMMessageMeta.module.css +32 -0
- package/es/IMMessageMeta/css/cssJSLogic.js +20 -0
- package/es/IMMessageMeta/index.js +1 -0
- package/es/IMMessageMeta/props/defaultProps.js +10 -0
- package/es/IMMessageMeta/props/propTypes.js +30 -0
- package/es/IMMessageStatus/css/IMMessageStatus.module.css +6 -3
- package/es/IMReplyBubble/IMReplyBubble.js +37 -0
- package/es/IMReplyBubble/css/IMReplyBubble.module.css +0 -0
- package/es/IMReplyBubble/css/cssJSLogic.js +10 -0
- package/es/IMReplyBubble/index.js +1 -0
- package/es/IMReplyBubble/props/defaultProps.js +6 -0
- package/es/IMReplyBubble/props/propTypes.js +6 -0
- package/es/IMTextBubble/IMTextBubble.js +53 -0
- package/es/IMTextBubble/css/IMTextBubble.module.css +1 -0
- package/es/IMTextBubble/css/cssJSLogic.js +10 -0
- package/es/IMTextBubble/index.js +1 -0
- package/es/IMTextBubble/props/defaultProps.js +14 -0
- package/es/IMTextBubble/props/propTypes.js +15 -0
- package/es/IMTicketLink/IMTicketLink.js +48 -0
- package/es/IMTicketLink/css/IMTicketLink.module.css +24 -0
- package/es/IMTicketLink/css/cssJSLogic.js +14 -0
- package/es/IMTicketLink/index.js +1 -0
- package/es/IMTicketLink/props/defaultProps.js +6 -0
- package/es/IMTicketLink/props/propTypes.js +10 -0
- package/es/IMVideoBubble/IMVideoBubble.js +62 -0
- package/es/IMVideoBubble/css/IMVideoBubble.module.css +1 -0
- package/es/IMVideoBubble/css/cssJSLogic.js +10 -0
- package/es/IMVideoBubble/index.js +1 -0
- package/es/IMVideoBubble/props/defaultProps.js +11 -0
- package/es/IMVideoBubble/props/propTypes.js +17 -0
- package/es/ImageBubble/ImageBubble.js +52 -0
- package/es/ImageBubble/css/ImageBubble.module.css +53 -0
- package/es/ImageBubble/css/cssJSLogic.js +22 -0
- package/es/ImageBubble/index.js +1 -0
- package/es/ImageBubble/props/defaultProps.js +6 -0
- package/es/ImageBubble/props/propTypes.js +8 -0
- package/es/InfoBubble/InfoBubble.js +37 -0
- package/es/InfoBubble/css/InfoBubble.module.css +0 -0
- package/es/InfoBubble/css/cssJSLogic.js +10 -0
- package/es/InfoBubble/index.js +1 -0
- package/es/InfoBubble/props/defaultProps.js +6 -0
- package/es/InfoBubble/props/propTypes.js +6 -0
- package/es/LazyLoadImage/LazyLoadImage.js +48 -0
- package/es/LazyLoadImage/css/LazyLoadImage.module.css +4 -0
- package/es/LazyLoadImage/css/cssJSLogic.js +10 -0
- package/es/LazyLoadImage/index.js +1 -0
- package/es/LazyLoadImage/props/defaultProps.js +6 -0
- package/es/LazyLoadImage/props/propTypes.js +8 -0
- package/es/LocationBubble/LocationBubble.js +63 -0
- package/es/LocationBubble/css/LocationBubble.module.css +3 -0
- package/es/LocationBubble/css/cssJSLogic.js +30 -0
- package/es/LocationBubble/images/location.png +0 -0
- package/es/LocationBubble/index.js +1 -0
- package/es/LocationBubble/props/defaultProps.js +6 -0
- package/es/LocationBubble/props/propTypes.js +7 -0
- package/es/MediaControls/MediaControls.js +60 -0
- package/es/MediaControls/css/MediaControls.module.css +1 -0
- package/es/MediaControls/css/cssJSLogic.js +22 -0
- package/es/MediaControls/index.js +1 -0
- package/es/MediaControls/props/defaultProps.js +6 -0
- package/es/MediaControls/props/propTypes.js +11 -0
- package/es/Message/Message.js +136 -0
- package/es/Message/css/Message.module.css +0 -0
- package/es/Message/css/cssJSLogic.js +10 -0
- package/es/Message/index.js +1 -0
- package/es/Message/props/defaultProps.js +43 -0
- package/es/Message/props/propTypes.js +98 -0
- package/es/MessageAction/MessageAction.js +4 -2
- package/es/MessageActions/MessageActions.js +1 -1
- package/es/MessageActionsMore/MessageActionsMore.js +5 -3
- package/es/MessageAvatar/MessageAvatar.js +9 -9
- package/es/MessageAvatar/props/defaultProps.js +4 -2
- package/es/MessageBox/MessageBox.js +5 -2
- package/es/MessageBox/css/MessageBox.module.css +14 -0
- package/es/MessageBox/css/cssJSLogic.js +12 -1
- package/es/MessageBox/props/defaultProps.js +3 -1
- package/es/MessageBox/props/propTypes.js +3 -1
- package/es/MessageBoxFooter/MessageBoxFooter.js +1 -1
- package/es/MessageBubble/MessageBubble.js +10 -10
- package/es/MessageWrapper/MessageWrapper.js +37 -0
- package/es/MessageWrapper/css/MessageWrapper.module.css +0 -0
- package/es/MessageWrapper/css/cssJSLogic.js +10 -0
- package/es/MessageWrapper/index.js +1 -0
- package/es/MessageWrapper/props/defaultProps.js +6 -0
- package/es/MessageWrapper/props/propTypes.js +6 -0
- package/es/MoreActionItem/MoreActionItem.js +9 -9
- package/es/MoreActionItem/props/defaultProps.js +1 -1
- package/es/MoreActionItem/props/propTypes.js +1 -1
- package/es/ReplyBubble/ReplyBubble.js +41 -0
- package/es/ReplyBubble/css/ReplyBubble.module.css +0 -0
- package/es/ReplyBubble/css/cssJSLogic.js +10 -0
- package/es/ReplyBubble/index.js +1 -0
- package/es/ReplyBubble/props/defaultProps.js +6 -0
- package/es/ReplyBubble/props/propTypes.js +6 -0
- package/es/ReplyBubbleHeader/ReplyBubbleHeader.js +53 -0
- package/es/ReplyBubbleHeader/css/ReplyBubbleHeader.module.css +0 -0
- package/es/ReplyBubbleHeader/css/cssJSLogic.js +10 -0
- package/es/ReplyBubbleHeader/index.js +1 -0
- package/es/ReplyBubbleHeader/props/defaultProps.js +9 -0
- package/es/ReplyBubbleHeader/props/propTypes.js +9 -0
- package/es/TextBubble/TextBubble.js +56 -0
- package/es/TextBubble/css/TextBubble.module.css +1 -0
- package/es/TextBubble/css/cssJSLogic.js +18 -0
- package/es/TextBubble/index.js +1 -0
- package/es/TextBubble/props/defaultProps.js +9 -0
- package/es/TextBubble/props/propTypes.js +10 -0
- package/es/Theme/DeskAssets.js +53 -0
- package/es/Theme/ThemeWrapper.js +82 -0
- package/es/Theme/ToolttipWrapper.js +81 -0
- package/es/Theme/constants/index.js +44 -0
- package/es/Theme/crm/dark/blueFanTheme.js +28 -0
- package/es/Theme/crm/dark/blueTheme.js +28 -0
- package/es/Theme/crm/dark/commonColorVariable.js +11 -0
- package/es/Theme/crm/dark/darkBlueTheme.js +28 -0
- package/es/Theme/crm/dark/darkGreyTheme.js +28 -0
- package/es/Theme/crm/dark/greenTheme.js +28 -0
- package/es/Theme/crm/dark/orangeTheme.js +28 -0
- package/es/Theme/crm/dark/pinkTheme.js +28 -0
- package/es/Theme/crm/dark/tealTheme.js +28 -0
- package/es/Theme/crm/dark/whiteTheme.js +28 -0
- package/es/Theme/crm/light/blueFanTheme.js +28 -0
- package/es/Theme/crm/light/blueTheme.js +31 -0
- package/es/Theme/crm/light/commonColorVariable.js +9 -0
- package/es/Theme/crm/light/darkBlueTheme.js +28 -0
- package/es/Theme/crm/light/darkGreyTheme.js +28 -0
- package/es/Theme/crm/light/greenTheme.js +28 -0
- package/es/Theme/crm/light/orangeTheme.js +28 -0
- package/es/Theme/crm/light/pinkTheme.js +28 -0
- package/es/Theme/crm/light/tealTheme.js +28 -0
- package/es/Theme/crm/light/whiteTheme.js +28 -0
- package/es/Theme/crm/pureDark/blueFanTheme.js +28 -0
- package/es/Theme/crm/pureDark/blueTheme.js +28 -0
- package/es/Theme/crm/pureDark/commonColorVariable.js +9 -0
- package/es/Theme/crm/pureDark/darkBlueTheme.js +28 -0
- package/es/Theme/crm/pureDark/darkGreyTheme.js +28 -0
- package/es/Theme/crm/pureDark/greenTheme.js +28 -0
- package/es/Theme/crm/pureDark/orangeTheme.js +28 -0
- package/es/Theme/crm/pureDark/pinkTheme.js +28 -0
- package/es/Theme/crm/pureDark/tealTheme.js +28 -0
- package/es/Theme/crm/pureDark/whiteTheme.js +28 -0
- package/es/Theme/css/TooltipWrapper.module.css +10 -0
- package/es/Theme/css/cssJSLogic.js +14 -0
- package/es/Theme/desk/commonDeskColorVariable.js +12 -0
- package/es/Theme/desk/dark/blueTheme.js +30 -0
- package/es/Theme/desk/dark/commonColorVariable.js +5 -0
- package/es/Theme/desk/dark/greenTheme.js +30 -0
- package/es/Theme/desk/dark/orangeTheme.js +30 -0
- package/es/Theme/desk/dark/redTheme.js +30 -0
- package/es/Theme/desk/dark/yellowTheme.js +30 -0
- package/es/Theme/desk/light/blueTheme.js +33 -0
- package/es/Theme/desk/light/commonColorVariable.js +5 -0
- package/es/Theme/desk/light/greenTheme.js +30 -0
- package/es/Theme/desk/light/orangeTheme.js +29 -0
- package/es/Theme/desk/light/redTheme.js +29 -0
- package/es/Theme/desk/light/yellowTheme.js +30 -0
- package/es/Theme/desk/pureDark/blueTheme.js +30 -0
- package/es/Theme/desk/pureDark/commonColorVariable.js +6 -0
- package/es/Theme/desk/pureDark/greenTheme.js +30 -0
- package/es/Theme/desk/pureDark/orangeTheme.js +30 -0
- package/es/Theme/desk/pureDark/redTheme.js +30 -0
- package/es/Theme/desk/pureDark/yellowTheme.js +30 -0
- package/es/Theme/index.js +1 -0
- package/es/Theme/props/defaultProps.js +13 -0
- package/es/Theme/props/propTypes.js +15 -0
- package/es/Theme/utils/getThemeConfigurations.js +209 -0
- package/es/Video/Video.js +69 -0
- package/es/Video/css/Video.module.css +9 -0
- package/es/Video/css/cssJSLogic.js +14 -0
- package/es/Video/index.js +1 -0
- package/es/Video/props/defaultProps.js +7 -0
- package/es/Video/props/propTypes.js +9 -0
- package/es/VideoBubble/VideoBubble.js +57 -0
- package/es/VideoBubble/css/VideoBubble.module.css +4 -0
- package/es/VideoBubble/css/cssJSLogic.js +10 -0
- package/es/VideoBubble/index.js +1 -0
- package/es/VideoBubble/props/defaultProps.js +8 -0
- package/es/VideoBubble/props/propTypes.js +12 -0
- package/es/icons/create-icon-components.js +1 -1
- package/es/icons/factory/attachments/audio.svg +19 -0
- package/es/icons/factory/attachments/code.svg +21 -0
- package/es/icons/factory/attachments/image.svg +20 -0
- package/es/icons/factory/attachments/pdf.svg +19 -0
- package/es/icons/factory/attachments/txt.svg +22 -0
- package/es/icons/factory/attachments/unknown.svg +21 -0
- package/es/icons/factory/attachments/video.svg +19 -0
- package/es/icons/factory/attachments/zip.svg +27 -0
- package/es/icons/iconSrc/actions/ConvertTicket.js +1 -1
- package/es/icons/iconSrc/attachments/Audio.js +37 -0
- package/es/icons/iconSrc/attachments/Code.js +43 -0
- package/es/icons/iconSrc/attachments/Image.js +42 -0
- package/es/icons/iconSrc/attachments/Pdf.js +37 -0
- package/es/icons/iconSrc/attachments/Txt.js +46 -0
- package/es/icons/iconSrc/attachments/Unknown.js +41 -0
- package/es/icons/iconSrc/attachments/Video.js +37 -0
- package/es/icons/iconSrc/attachments/Zip.js +85 -0
- package/es/icons/iconSrc/attachments/index.js +8 -0
- package/es/icons/iconSrc/integrations/TtASAP.js +1 -1
- package/es/icons/iconSrc/integrations/TtTelegram.js +1 -1
- package/es/icons/iconSrc/integrations/TtTwillio.js +1 -1
- package/es/icons/iconSrc/integrations/TtTwitter.js +1 -1
- package/es/icons/iconSrc/integrations/TtWechat.js +1 -1
- package/es/index.js +33 -0
- package/package.json +8 -4
- /package/es/MessageActionsMore/css/{cssJsLogic.js → cssJSLogic.js} +0 -0
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** ** Methods *** */
|
|
2
|
+
import { compileClassNames } from '@zohodesk/utils';
|
|
3
|
+
export default function cssJSLogic(props, style) {
|
|
4
|
+
const imArticleBubbleClass = compileClassNames({
|
|
5
|
+
[style.imArticleBubble]: true
|
|
6
|
+
});
|
|
7
|
+
return {
|
|
8
|
+
imArticleBubbleClass
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as IMArticleBubble } from './IMArticleBubble';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** ** Constants *** */
|
|
2
|
+
import { dummyObject } from '@zohoim/chat-components-utils/es/constants';
|
|
3
|
+
const imArticleBubbleDefaultProps = {
|
|
4
|
+
customStyle: dummyObject,
|
|
5
|
+
articleCustomStyle: dummyObject,
|
|
6
|
+
articleDetails: dummyObject
|
|
7
|
+
};
|
|
8
|
+
export default imArticleBubbleDefaultProps;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
const imArticleBubblePropTypes = {
|
|
4
|
+
customStyle: PropTypes.object,
|
|
5
|
+
articleCustomStyle: PropTypes.object,
|
|
6
|
+
articleDetails: PropTypes.shape({
|
|
7
|
+
createdTime: PropTypes.string,
|
|
8
|
+
id: PropTypes.string,
|
|
9
|
+
summary: PropTypes.string,
|
|
10
|
+
title: PropTypes.string,
|
|
11
|
+
webUrl: PropTypes.string
|
|
12
|
+
})
|
|
13
|
+
};
|
|
14
|
+
export default imArticleBubblePropTypes;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-no-bind */
|
|
2
|
+
/* eslint-disable max-len */
|
|
3
|
+
|
|
4
|
+
/** ** Libraries *** */
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
/** ** Hooks *** */
|
|
8
|
+
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
9
|
+
|
|
10
|
+
/** ** Constants *** */
|
|
11
|
+
import imAttachmentBubbleDefaultProps from './props/defaultProps';
|
|
12
|
+
import imAttachmentBubblePropTypes from './props/propTypes';
|
|
13
|
+
|
|
14
|
+
/** ** Methods *** */
|
|
15
|
+
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
16
|
+
import cssJSLogic from './css/cssJSLogic';
|
|
17
|
+
|
|
18
|
+
/** ** Styles *** */
|
|
19
|
+
import style from './css/IMAttachmentBubble.module.css';
|
|
20
|
+
import AttachmentBubble from '../AttachmentBubble/AttachmentBubble';
|
|
21
|
+
import IMAttachmentIcon from '../IMAttachmentIcon/IMAttachmentIcon';
|
|
22
|
+
import useIMAttachmentBubble from '@zohoim/chat-components-hooks/es/IMAttachmentBubble/useIMAttachmentBubble';
|
|
23
|
+
export default function IMAttachmentBubble(props) {
|
|
24
|
+
const {
|
|
25
|
+
customStyle,
|
|
26
|
+
iconCustomStyle,
|
|
27
|
+
bubbleCustomStyle,
|
|
28
|
+
bubbleInfoCustomStyle,
|
|
29
|
+
attachmentDetails
|
|
30
|
+
} = props;
|
|
31
|
+
|
|
32
|
+
/* External customization */
|
|
33
|
+
const newStyle = useMergeStyle(style, customStyle);
|
|
34
|
+
/* CSS classnames added based on logic */
|
|
35
|
+
const {
|
|
36
|
+
imAttachmentBubbleClass
|
|
37
|
+
} = cssJSLogic(props, newStyle);
|
|
38
|
+
const {
|
|
39
|
+
formattedFileSize: fileSize,
|
|
40
|
+
fileName,
|
|
41
|
+
fileFormat
|
|
42
|
+
} = useIMAttachmentBubble({
|
|
43
|
+
attachmentDetails
|
|
44
|
+
});
|
|
45
|
+
function renderFileTypeIcon() {
|
|
46
|
+
return /*#__PURE__*/React.createElement(IMAttachmentIcon, {
|
|
47
|
+
customStyle: iconCustomStyle,
|
|
48
|
+
fileFormat: fileFormat
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
className: imAttachmentBubbleClass
|
|
53
|
+
}, /*#__PURE__*/React.createElement(AttachmentBubble, {
|
|
54
|
+
customStyle: bubbleCustomStyle,
|
|
55
|
+
renderFileTypeIcon: renderFileTypeIcon,
|
|
56
|
+
fileName: fileName,
|
|
57
|
+
fileSize: fileSize,
|
|
58
|
+
bubbleInfoCustomStyle: bubbleInfoCustomStyle
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
IMAttachmentBubble.propTypes = imAttachmentBubblePropTypes;
|
|
62
|
+
IMAttachmentBubble.defaultProps = imAttachmentBubbleDefaultProps;
|
|
63
|
+
IMAttachmentBubble.displayName = 'IMAttachmentBubble';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** ** Methods *** */
|
|
2
|
+
import { compileClassNames } from '@zohodesk/utils';
|
|
3
|
+
export default function cssJSLogic(props, style) {
|
|
4
|
+
const imAttachmentBubbleClass = compileClassNames({
|
|
5
|
+
[style.imAttachmentBubble]: true
|
|
6
|
+
});
|
|
7
|
+
return {
|
|
8
|
+
imAttachmentBubbleClass
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as IMAttachmentBubble } from './IMAttachmentBubble';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** ** Constants *** */
|
|
2
|
+
import { dummyObject } from '@zohoim/chat-components-utils/es/constants';
|
|
3
|
+
const imAttachmentBubbleDefaultProps = {
|
|
4
|
+
customStyle: dummyObject,
|
|
5
|
+
bubbleCustomStyle: dummyObject,
|
|
6
|
+
bubbleInfoCustomStyle: dummyObject,
|
|
7
|
+
iconCustomStyle: dummyObject,
|
|
8
|
+
attachmentDetails: dummyObject
|
|
9
|
+
};
|
|
10
|
+
export default imAttachmentBubbleDefaultProps;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
const imAttachmentBubblePropTypes = {
|
|
4
|
+
customStyle: PropTypes.object,
|
|
5
|
+
iconCustomStyle: PropTypes.object,
|
|
6
|
+
bubbleCustomStyle: PropTypes.object,
|
|
7
|
+
bubbleInfoCustomStyle: PropTypes.object,
|
|
8
|
+
attachmentDetails: PropTypes.shape({
|
|
9
|
+
name: PropTypes.string,
|
|
10
|
+
size: PropTypes.string,
|
|
11
|
+
type: PropTypes.string,
|
|
12
|
+
url: PropTypes.string,
|
|
13
|
+
id: PropTypes.string
|
|
14
|
+
})
|
|
15
|
+
};
|
|
16
|
+
export default imAttachmentBubblePropTypes;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-no-bind */
|
|
2
|
+
/* eslint-disable max-len */
|
|
3
|
+
|
|
4
|
+
/** ** Libraries *** */
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
/** ** Hooks *** */
|
|
8
|
+
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
9
|
+
|
|
10
|
+
/** ** Constants *** */
|
|
11
|
+
import imAttachmentIconDefaultProps from './props/defaultProps';
|
|
12
|
+
import imAttachmentIconPropTypes from './props/propTypes';
|
|
13
|
+
|
|
14
|
+
/** ** Methods *** */
|
|
15
|
+
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
16
|
+
import cssJSLogic from './css/cssJSLogic';
|
|
17
|
+
|
|
18
|
+
/** ** Styles *** */
|
|
19
|
+
import style from './css/IMAttachmentIcon.module.css';
|
|
20
|
+
import attachmentFileTypes from '@zohoim/chat-components-utils/es/constants/attachmentFileTypes';
|
|
21
|
+
|
|
22
|
+
/** ** Icons *** */
|
|
23
|
+
import AudioIcon from '../icons/iconSrc/attachments/Audio';
|
|
24
|
+
import CodeIcon from '../icons/iconSrc/attachments/Code';
|
|
25
|
+
import ImageIcon from '../icons/iconSrc/attachments/Image';
|
|
26
|
+
import PdfIcon from '../icons/iconSrc/attachments/Pdf';
|
|
27
|
+
import TextIcon from '../icons/iconSrc/attachments/Txt';
|
|
28
|
+
import UnknownIcon from '../icons/iconSrc/attachments/Unknown';
|
|
29
|
+
import VideoIcon from '../icons/iconSrc/attachments/Video';
|
|
30
|
+
import ZipIcon from '../icons/iconSrc/attachments/Zip';
|
|
31
|
+
const {
|
|
32
|
+
SVG,
|
|
33
|
+
IMAGE,
|
|
34
|
+
PDF,
|
|
35
|
+
AUDIO,
|
|
36
|
+
VIDEO,
|
|
37
|
+
MP3,
|
|
38
|
+
M4A,
|
|
39
|
+
MP4,
|
|
40
|
+
// LOCATION,
|
|
41
|
+
HTML,
|
|
42
|
+
PSD,
|
|
43
|
+
CSS,
|
|
44
|
+
TEXT,
|
|
45
|
+
PLAIN,
|
|
46
|
+
ZIP,
|
|
47
|
+
UNDEFINED
|
|
48
|
+
} = attachmentFileTypes;
|
|
49
|
+
export default function IMAttachmentIcon(props) {
|
|
50
|
+
const {
|
|
51
|
+
customStyle,
|
|
52
|
+
fileFormat
|
|
53
|
+
} = props;
|
|
54
|
+
|
|
55
|
+
/* External customization */
|
|
56
|
+
const newStyle = useMergeStyle(style, customStyle);
|
|
57
|
+
/* CSS classnames added based on logic */
|
|
58
|
+
const {
|
|
59
|
+
iconStyle
|
|
60
|
+
} = cssJSLogic(props, newStyle);
|
|
61
|
+
const iconMapping = {
|
|
62
|
+
[SVG]: UnknownIcon,
|
|
63
|
+
[IMAGE]: ImageIcon,
|
|
64
|
+
[PDF]: PdfIcon,
|
|
65
|
+
[AUDIO]: AudioIcon,
|
|
66
|
+
[VIDEO]: VideoIcon,
|
|
67
|
+
[MP3]: AudioIcon,
|
|
68
|
+
[M4A]: AudioIcon,
|
|
69
|
+
[MP4]: VideoIcon,
|
|
70
|
+
// [LOCATION]: ReplyIcon,
|
|
71
|
+
[HTML]: CodeIcon,
|
|
72
|
+
[PSD]: UnknownIcon,
|
|
73
|
+
[CSS]: CodeIcon,
|
|
74
|
+
[TEXT]: TextIcon,
|
|
75
|
+
[PLAIN]: UnknownIcon,
|
|
76
|
+
[ZIP]: ZipIcon,
|
|
77
|
+
[UNDEFINED]: UnknownIcon
|
|
78
|
+
};
|
|
79
|
+
const IconComponent = iconMapping[fileFormat];
|
|
80
|
+
return IconComponent ? /*#__PURE__*/React.createElement(IconComponent, {
|
|
81
|
+
customStyle: iconStyle
|
|
82
|
+
}) : null;
|
|
83
|
+
}
|
|
84
|
+
IMAttachmentIcon.propTypes = imAttachmentIconPropTypes;
|
|
85
|
+
IMAttachmentIcon.defaultProps = imAttachmentIconDefaultProps;
|
|
86
|
+
IMAttachmentIcon.displayName = 'IMAttachmentIcon';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** ** Methods *** */
|
|
2
|
+
import { compileClassNames } from '@zohodesk/utils';
|
|
3
|
+
export default function cssJSLogic(props, style) {
|
|
4
|
+
const imAttachmentIconClass = compileClassNames({
|
|
5
|
+
[style.imAttachmentIcon]: true
|
|
6
|
+
});
|
|
7
|
+
const iconClass = compileClassNames({
|
|
8
|
+
[style.icon]: true
|
|
9
|
+
});
|
|
10
|
+
return {
|
|
11
|
+
imAttachmentIconClass,
|
|
12
|
+
iconStyle: {
|
|
13
|
+
base: iconClass
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as IMAttachmentIcon } from './IMAttachmentIcon';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import attachmentFileTypes from '@zohoim/chat-components-utils/es/constants/attachmentFileTypes';
|
|
4
|
+
const {
|
|
5
|
+
SVG,
|
|
6
|
+
IMAGE,
|
|
7
|
+
PDF,
|
|
8
|
+
AUDIO,
|
|
9
|
+
VIDEO,
|
|
10
|
+
MP3,
|
|
11
|
+
M4A,
|
|
12
|
+
MP4,
|
|
13
|
+
LOCATION,
|
|
14
|
+
HTML,
|
|
15
|
+
PSD,
|
|
16
|
+
CSS,
|
|
17
|
+
TEXT,
|
|
18
|
+
PLAIN,
|
|
19
|
+
ZIP,
|
|
20
|
+
UNDEFINED
|
|
21
|
+
} = attachmentFileTypes;
|
|
22
|
+
const imAttachmentIconPropTypes = {
|
|
23
|
+
customStyle: PropTypes.object,
|
|
24
|
+
fileFormat: PropTypes.oneOf([SVG, IMAGE, PDF, AUDIO, VIDEO, MP3, M4A, MP4, LOCATION, HTML, PSD, CSS, TEXT, PLAIN, ZIP, UNDEFINED])
|
|
25
|
+
};
|
|
26
|
+
export default imAttachmentIconPropTypes;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-no-bind */
|
|
2
|
+
/* eslint-disable max-len */
|
|
3
|
+
|
|
4
|
+
/** ** Libraries *** */
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
/** ** Hooks *** */
|
|
8
|
+
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
9
|
+
|
|
10
|
+
/** ** Constants *** */
|
|
11
|
+
import imAudioBubbleDefaultProps from './props/defaultProps';
|
|
12
|
+
import imAudioBubblePropTypes from './props/propTypes';
|
|
13
|
+
|
|
14
|
+
/** ** Methods *** */
|
|
15
|
+
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
16
|
+
import cssJSLogic from './css/cssJSLogic';
|
|
17
|
+
|
|
18
|
+
/** ** Styles *** */
|
|
19
|
+
import style from './css/IMAudioBubble.module.css';
|
|
20
|
+
import AudioBubble from '../AudioBubble/AudioBubble';
|
|
21
|
+
import useIMAudioBubble from '@zohoim/chat-components-hooks/es/IMAudioBubble/useIMAudioBubble';
|
|
22
|
+
export default function IMAudioBubble(props) {
|
|
23
|
+
const {
|
|
24
|
+
attachmentDetails,
|
|
25
|
+
customStyle,
|
|
26
|
+
audioBubbleCustomStyle,
|
|
27
|
+
// headerCustomStyle,
|
|
28
|
+
audioCustomStyle,
|
|
29
|
+
controlsCustomStyle
|
|
30
|
+
} = props;
|
|
31
|
+
const {
|
|
32
|
+
isShow,
|
|
33
|
+
fileName,
|
|
34
|
+
formattedFileSize: fileSize,
|
|
35
|
+
attachmentURL: fileURL,
|
|
36
|
+
attachmentType: fileType
|
|
37
|
+
} = useIMAudioBubble({
|
|
38
|
+
attachmentDetails
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
/* External customization */
|
|
42
|
+
const newStyle = useMergeStyle(style, customStyle);
|
|
43
|
+
/* CSS classnames added based on logic */
|
|
44
|
+
const {
|
|
45
|
+
imAudioBubbleClass,
|
|
46
|
+
headerCustomStyle
|
|
47
|
+
} = cssJSLogic(props, newStyle);
|
|
48
|
+
return isShow ? /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
className: imAudioBubbleClass
|
|
50
|
+
}, /*#__PURE__*/React.createElement(AudioBubble, {
|
|
51
|
+
customStyle: audioBubbleCustomStyle,
|
|
52
|
+
headerCustomStyle: headerCustomStyle,
|
|
53
|
+
audioCustomStyle: audioCustomStyle,
|
|
54
|
+
controlsCustomStyle: controlsCustomStyle,
|
|
55
|
+
fileName: fileName,
|
|
56
|
+
fileSize: fileSize,
|
|
57
|
+
fileURL: fileURL,
|
|
58
|
+
fileType: fileType
|
|
59
|
+
})) : null;
|
|
60
|
+
}
|
|
61
|
+
IMAudioBubble.propTypes = imAudioBubblePropTypes;
|
|
62
|
+
IMAudioBubble.defaultProps = imAudioBubbleDefaultProps;
|
|
63
|
+
IMAudioBubble.displayName = 'IMAudioBubble';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** ** Methods *** */
|
|
2
|
+
import { compileClassNames } from "@zohodesk/utils";
|
|
3
|
+
export default function cssJSLogic(props, style) {
|
|
4
|
+
let {
|
|
5
|
+
headerCustomStyle: propHeaderCustomStyle
|
|
6
|
+
} = props;
|
|
7
|
+
const imAudioBubbleClass = compileClassNames({
|
|
8
|
+
[style.imAudioBubble]: true
|
|
9
|
+
});
|
|
10
|
+
const headerCustomStyle = compileClassNames({
|
|
11
|
+
[style.box]: true
|
|
12
|
+
});
|
|
13
|
+
return {
|
|
14
|
+
imAudioBubbleClass,
|
|
15
|
+
headerCustomStyle: {
|
|
16
|
+
attachmentBubbleInfo: headerCustomStyle,
|
|
17
|
+
...propHeaderCustomStyle
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as IMAudioBubble } from './IMAudioBubble';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** ** Constants *** */
|
|
2
|
+
import { dummyObject } from '@zohoim/chat-components-utils/es/constants';
|
|
3
|
+
const imAudioBubbleDefaultProps = {
|
|
4
|
+
customStyle: dummyObject,
|
|
5
|
+
audioBubbleCustomStyle: dummyObject,
|
|
6
|
+
headerCustomStyle: dummyObject,
|
|
7
|
+
audioCustomStyle: dummyObject,
|
|
8
|
+
controlsCustomStyle: dummyObject,
|
|
9
|
+
attachmentDetails: dummyObject
|
|
10
|
+
};
|
|
11
|
+
export default imAudioBubbleDefaultProps;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
const imAudioBubblePropTypes = {
|
|
4
|
+
attachmentDetails: PropTypes.shape({
|
|
5
|
+
name: PropTypes.string,
|
|
6
|
+
size: PropTypes.string,
|
|
7
|
+
type: PropTypes.string,
|
|
8
|
+
url: PropTypes.string,
|
|
9
|
+
id: PropTypes.string
|
|
10
|
+
}),
|
|
11
|
+
customStyle: PropTypes.object,
|
|
12
|
+
audioBubbleCustomStyle: PropTypes.object,
|
|
13
|
+
headerCustomStyle: PropTypes.object,
|
|
14
|
+
audioCustomStyle: PropTypes.object,
|
|
15
|
+
controlsCustomStyle: PropTypes.object
|
|
16
|
+
};
|
|
17
|
+
export default imAudioBubblePropTypes;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-no-bind */
|
|
2
|
+
/* eslint-disable max-len */
|
|
3
|
+
|
|
4
|
+
/** ** Libraries *** */
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
/** ** Hooks *** */
|
|
8
|
+
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
9
|
+
import useIMAutoMessageInfo from '@zohoim/chat-components-hooks/es/IMAutoMessageInfo/useIMAutoMessageInfo';
|
|
10
|
+
|
|
11
|
+
/** ** Constants *** */
|
|
12
|
+
import imAutoMessageInfoDefaultProps from './props/defaultProps';
|
|
13
|
+
import imAutoMessageInfoPropTypes from './props/propTypes';
|
|
14
|
+
|
|
15
|
+
/** ** Methods *** */
|
|
16
|
+
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
17
|
+
import cssJSLogic from './css/cssJSLogic';
|
|
18
|
+
|
|
19
|
+
/** ** Styles *** */
|
|
20
|
+
import style from './css/IMAutoMessageInfo.module.css';
|
|
21
|
+
export default function IMAutoMessageInfo(props) {
|
|
22
|
+
const {
|
|
23
|
+
autoMessageContent,
|
|
24
|
+
autoMessageTitle
|
|
25
|
+
} = useIMAutoMessageInfo(props);
|
|
26
|
+
const {
|
|
27
|
+
customStyle
|
|
28
|
+
} = props;
|
|
29
|
+
|
|
30
|
+
/* External customization */
|
|
31
|
+
const newStyle = useMergeStyle(style, customStyle);
|
|
32
|
+
/* CSS classnames added based on logic */
|
|
33
|
+
const {
|
|
34
|
+
imAutoMessageInfoClass
|
|
35
|
+
} = cssJSLogic(props, newStyle);
|
|
36
|
+
return autoMessageContent ? /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
className: imAutoMessageInfoClass,
|
|
38
|
+
"data-title": autoMessageTitle
|
|
39
|
+
}, autoMessageContent) : null;
|
|
40
|
+
}
|
|
41
|
+
IMAutoMessageInfo.propTypes = imAutoMessageInfoPropTypes;
|
|
42
|
+
IMAutoMessageInfo.defaultProps = imAutoMessageInfoDefaultProps;
|
|
43
|
+
IMAutoMessageInfo.displayName = 'IMAutoMessageInfo';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.varClass {
|
|
2
|
+
--imAutoMessageInfo-font_size: var(--imlib_size_13);
|
|
3
|
+
--imAutoMessageInfo-max_width: var(--imlib_size_100);
|
|
4
|
+
--imAutoMessageInfo-letter_spacing: 0.2px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.imAutoMessageInfo {
|
|
8
|
+
composes: varClass;
|
|
9
|
+
|
|
10
|
+
font-size: var(--imAutoMessageInfo-font_size);
|
|
11
|
+
letter-spacing: var(--imAutoMessageInfo-letter_spacing);
|
|
12
|
+
max-width: var(--imAutoMessageInfo-max_width);
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** ** Methods *** */
|
|
2
|
+
import { compileClassNames } from '@zohodesk/utils';
|
|
3
|
+
export default function cssJSLogic(props, style) {
|
|
4
|
+
const imAutoMessageInfoClass = compileClassNames({
|
|
5
|
+
[style.imAutoMessageInfo]: true
|
|
6
|
+
});
|
|
7
|
+
return {
|
|
8
|
+
imAutoMessageInfoClass
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as IMAutoMessageInfo } from './IMAutoMessageInfo';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { autoMessageTypes } from '@zohoim/chat-components-utils/es/constants/messageConstants';
|
|
4
|
+
const {
|
|
5
|
+
WELCOMEMSG,
|
|
6
|
+
WORKFLOW_MESSAGE,
|
|
7
|
+
WORKFLOW_NOTIFICATION,
|
|
8
|
+
UN_SUPPORTED_FILE
|
|
9
|
+
} = autoMessageTypes;
|
|
10
|
+
const imAutoMessageInfoPropTypes = {
|
|
11
|
+
customStyle: PropTypes.object,
|
|
12
|
+
autoMessageType: PropTypes.oneOf([WELCOMEMSG, WORKFLOW_MESSAGE, WORKFLOW_NOTIFICATION, UN_SUPPORTED_FILE]),
|
|
13
|
+
autoMessagesI18N: PropTypes.shape({
|
|
14
|
+
[WELCOMEMSG]: PropTypes.string,
|
|
15
|
+
[WORKFLOW_MESSAGE]: PropTypes.string,
|
|
16
|
+
[WORKFLOW_NOTIFICATION]: PropTypes.string,
|
|
17
|
+
[UN_SUPPORTED_FILE]: PropTypes.string
|
|
18
|
+
}),
|
|
19
|
+
autoMessagesTitleI18N: PropTypes.shape({
|
|
20
|
+
[WELCOMEMSG]: PropTypes.string,
|
|
21
|
+
[WORKFLOW_MESSAGE]: PropTypes.string,
|
|
22
|
+
[WORKFLOW_NOTIFICATION]: PropTypes.string,
|
|
23
|
+
[UN_SUPPORTED_FILE]: PropTypes.string
|
|
24
|
+
})
|
|
25
|
+
};
|
|
26
|
+
export default imAutoMessageInfoPropTypes;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-no-bind */
|
|
2
|
+
/* eslint-disable max-len */
|
|
3
|
+
|
|
4
|
+
/** ** Libraries *** */
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
/** ** Hooks *** */
|
|
8
|
+
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
9
|
+
import useIMDateTime from '@zohoim/chat-components-hooks/es/IMDateTime/useIMDateTime';
|
|
10
|
+
|
|
11
|
+
/** ** Constants *** */
|
|
12
|
+
import imDateTimeDefaultProps from './props/defaultProps';
|
|
13
|
+
import imDateTimePropTypes from './props/propTypes';
|
|
14
|
+
|
|
15
|
+
/** ** Methods *** */
|
|
16
|
+
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
17
|
+
import cssJSLogic from './css/cssJSLogic';
|
|
18
|
+
|
|
19
|
+
/** ** Styles *** */
|
|
20
|
+
import style from './css/IMDateTime.module.css';
|
|
21
|
+
export default function IMDateTime(props) {
|
|
22
|
+
const {
|
|
23
|
+
customStyle
|
|
24
|
+
} = props;
|
|
25
|
+
const {
|
|
26
|
+
time
|
|
27
|
+
} = useIMDateTime(props);
|
|
28
|
+
|
|
29
|
+
/* External customization */
|
|
30
|
+
const newStyle = useMergeStyle(style, customStyle);
|
|
31
|
+
/* CSS classnames added based on logic */
|
|
32
|
+
const {
|
|
33
|
+
imDateTimeClass
|
|
34
|
+
} = cssJSLogic(props, newStyle);
|
|
35
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: imDateTimeClass
|
|
37
|
+
}, time);
|
|
38
|
+
}
|
|
39
|
+
IMDateTime.propTypes = imDateTimePropTypes;
|
|
40
|
+
IMDateTime.defaultProps = imDateTimeDefaultProps;
|
|
41
|
+
IMDateTime.displayName = 'IMDateTime';
|
package/es/IMDateTime/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as IMDateTime } from './IMDateTime';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-no-bind */
|
|
2
|
+
/* eslint-disable max-len */
|
|
3
|
+
|
|
4
|
+
/** ** Libraries *** */
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
/** ** Hooks *** */
|
|
8
|
+
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
9
|
+
|
|
10
|
+
/** ** Constants *** */
|
|
11
|
+
import imImageBubbleDefaultProps from './props/defaultProps';
|
|
12
|
+
import imImageBubblePropTypes from './props/propTypes';
|
|
13
|
+
|
|
14
|
+
/** ** Methods *** */
|
|
15
|
+
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
16
|
+
import cssJSLogic from './css/cssJSLogic';
|
|
17
|
+
|
|
18
|
+
/** ** Styles *** */
|
|
19
|
+
import style from './css/IMImageBubble.module.css';
|
|
20
|
+
import ImageBubble from '../ImageBubble/ImageBubble';
|
|
21
|
+
import useIMImageBubble from '@zohoim/chat-components-hooks/es/IMImageBubble/useIMImageBubble';
|
|
22
|
+
export default function IMImageBubble(props) {
|
|
23
|
+
const {
|
|
24
|
+
customStyle,
|
|
25
|
+
attachmentDetails
|
|
26
|
+
} = props;
|
|
27
|
+
|
|
28
|
+
/* External customization */
|
|
29
|
+
const newStyle = useMergeStyle(style, customStyle);
|
|
30
|
+
/* CSS classnames added based on logic */
|
|
31
|
+
const {
|
|
32
|
+
imImageBubbleClass
|
|
33
|
+
} = cssJSLogic(props, newStyle);
|
|
34
|
+
const {
|
|
35
|
+
attachmentURL,
|
|
36
|
+
fileName
|
|
37
|
+
} = useIMImageBubble({
|
|
38
|
+
attachmentDetails
|
|
39
|
+
});
|
|
40
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
className: imImageBubbleClass
|
|
42
|
+
}, /*#__PURE__*/React.createElement(ImageBubble, {
|
|
43
|
+
src: attachmentURL,
|
|
44
|
+
alternate: fileName
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
IMImageBubble.propTypes = imImageBubblePropTypes;
|
|
48
|
+
IMImageBubble.defaultProps = imImageBubbleDefaultProps;
|
|
49
|
+
IMImageBubble.displayName = 'IMImageBubble';
|