@zohoim/chat-components 1.0.11-beta.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/es/AttachmentHandler/AttachmentHandler.js +84 -0
- package/es/AttachmentHandler/css/AttachmentHandler.module.css +27 -0
- package/es/AttachmentHandler/index.js +1 -0
- package/es/AttachmentHandler/props/defaultProps.js +10 -0
- package/es/AttachmentHandler/props/propTypes.js +17 -0
- package/es/AttachmentPreview/AttachmentPreview.js +121 -0
- package/es/AttachmentPreview/css/AttachmentPreview.module.css +39 -0
- package/es/AttachmentPreview/index.js +1 -0
- package/es/AttachmentPreview/props/defaultProps.js +9 -0
- package/es/AttachmentPreview/props/propTypes.js +33 -0
- package/es/AttachmentPreviewBody/AttachmentPreviewBody.js +97 -0
- package/es/AttachmentPreviewBody/css/AttachmentPreviewBody.module.css +75 -0
- package/es/AttachmentPreviewBody/index.js +1 -0
- package/es/AttachmentPreviewBody/props/defaultProps.js +7 -0
- package/es/AttachmentPreviewBody/props/propTypes.js +20 -0
- package/es/AttachmentPreviewHeader/AttachmentPreviewHeader.js +84 -0
- package/es/AttachmentPreviewHeader/css/AttachmentPreviewHeader.module.css +47 -0
- package/es/AttachmentPreviewHeader/index.js +1 -0
- package/es/AttachmentPreviewHeader/props/defaultProps.js +7 -0
- package/es/AttachmentPreviewHeader/props/propTypes.js +16 -0
- package/es/Emoji/Emoji.js +72 -0
- package/es/Emoji/css/Emoji.module.css +48 -0
- package/es/Emoji/css/cssJSLogic.js +18 -0
- package/es/Emoji/index.js +1 -0
- package/es/Emoji/props/defaultProps.js +8 -0
- package/es/Emoji/props/propTypes.js +16 -0
- package/es/EmojiPopup/EmojiPopup.js +115 -0
- package/es/EmojiPopup/css/EmojiPopup.module.css +55 -0
- package/es/EmojiPopup/index.js +1 -0
- package/es/EmojiPopup/props/defaultProps.js +11 -0
- package/es/EmojiPopup/props/propTypes.js +21 -0
- package/es/Emojis/Emojis.js +81 -0
- package/es/Emojis/index.js +1 -0
- package/es/Emojis/props/defaultProps.js +10 -0
- package/es/Emojis/props/propTypes.js +20 -0
- package/es/EmojisEmptyState/EmojisEmptyState.js +50 -0
- package/es/EmojisEmptyState/css/EmojisEmptyState.module.css +18 -0
- package/es/EmojisEmptyState/index.js +1 -0
- package/es/EmojisEmptyState/props/defaultProps.js +9 -0
- package/es/EmojisEmptyState/props/propTypes.js +8 -0
- package/es/EmojisFooter/EmojisFooter.js +71 -0
- package/es/EmojisFooter/css/EmojisFooter.module.css +40 -0
- package/es/EmojisFooter/index.js +1 -0
- package/es/EmojisFooter/props/defaultProps.js +7 -0
- package/es/EmojisFooter/props/propTypes.js +12 -0
- package/es/EmojisHeader/EmojisHeader.js +65 -0
- package/es/EmojisHeader/css/EmojisHeader.module.css +36 -0
- package/es/EmojisHeader/index.js +1 -0
- package/es/EmojisHeader/props/defaultProps.js +8 -0
- package/es/EmojisHeader/props/propTypes.js +13 -0
- package/es/EmojisList/EmojisList.js +130 -0
- package/es/EmojisList/css/EmojisList.module.css +50 -0
- package/es/EmojisList/css/cssJSLogic.js +25 -0
- package/es/EmojisList/index.js +1 -0
- package/es/EmojisList/props/defaultProps.js +10 -0
- package/es/EmojisList/props/propTypes.js +20 -0
- package/es/MessageActionsMore/MessageActionsMore.js +2 -2
- package/es/MessageActionsMore/props/propTypes.js +5 -2
- package/es/MessageActionsWrapper/MessageActionsWrapper.js +1 -1
- package/es/Theme/ThemeAssets.js +2 -20
- package/es/Theme/ThemeWrapper.js +25 -14
- package/es/Theme/TooltipWrapper.js +1 -1
- package/es/Theme/props/defaultProps.js +2 -1
- package/es/Theme/props/propTypes.js +2 -1
- package/es/Theme/themeVariables/commonThemeColorVariable.js +17 -0
- package/es/Theme/themeVariables/dark/blueTheme.js +133 -0
- package/es/Theme/themeVariables/dark/commonColorVariable.js +35 -0
- package/es/Theme/themeVariables/dark/greenTheme.js +132 -0
- package/es/Theme/themeVariables/dark/orangeTheme.js +132 -0
- package/es/Theme/themeVariables/dark/redTheme.js +132 -0
- package/es/Theme/themeVariables/dark/yellowTheme.js +132 -0
- package/es/Theme/themeVariables/light/blueTheme.js +135 -0
- package/es/Theme/themeVariables/light/commonColorVariable.js +54 -0
- package/es/Theme/themeVariables/light/greenTheme.js +131 -0
- package/es/Theme/themeVariables/light/orangeTheme.js +131 -0
- package/es/Theme/themeVariables/light/redTheme.js +131 -0
- package/es/Theme/themeVariables/light/yellowTheme.js +131 -0
- package/es/Theme/themeVariables/pureDark/blueTheme.js +132 -0
- package/es/Theme/themeVariables/pureDark/commonColorVariable.js +37 -0
- package/es/Theme/themeVariables/pureDark/greenTheme.js +132 -0
- package/es/Theme/themeVariables/pureDark/orangeTheme.js +132 -0
- package/es/Theme/themeVariables/pureDark/redTheme.js +132 -0
- package/es/Theme/themeVariables/pureDark/yellowTheme.js +132 -0
- package/es/Theme/utils/getThemeConfigurations.js +56 -2
- package/es/constants/index.js +8 -1
- package/es/constants/propConstants/editorPropConstants.js +3 -0
- package/es/constants/propConstants/popupPropConstants.js +2 -0
- package/es/im/IMAttachmentHandler/IMAttachmentHandler.js +50 -0
- package/es/im/IMAttachmentHandler/index.js +1 -0
- package/es/im/IMAttachmentHandler/props/defaultProps.js +10 -0
- package/es/im/IMAttachmentHandler/props/propTypes.js +28 -0
- package/es/im/IMIntegrationIcon/css/IMIntegrationIcon.module.css +2 -2
- package/es/im/ReplyComposer/ReplyComposer.js +153 -0
- package/es/im/ReplyComposer/css/ReplyComposer.module.css +10 -0
- package/es/im/ReplyComposer/css/cssJSLogic.js +13 -0
- package/es/im/ReplyComposer/index.js +1 -0
- package/es/im/ReplyComposer/props/defaultProps.js +7 -0
- package/es/im/ReplyComposer/props/propTypes.js +60 -0
- package/es/im/ReplyComposerFooter/ReplyComposerFooter.js +41 -0
- package/es/im/ReplyComposerFooter/css/ReplyComposerFooter.module.css +10 -0
- package/es/im/ReplyComposerFooter/index.js +1 -0
- package/es/im/ReplyComposerFooter/props/defaultProps.js +8 -0
- package/es/im/ReplyComposerFooter/props/propTypes.js +17 -0
- package/es/im/ReplyEditor/ReplyEditor.js +103 -0
- package/es/im/ReplyEditor/css/ReplyEditor.module.css +50 -0
- package/es/im/ReplyEditor/css/cssJSLogic.js +10 -0
- package/es/im/ReplyEditor/index.js +1 -0
- package/es/im/ReplyEditor/props/defaultProps.js +8 -0
- package/es/im/ReplyEditor/props/propTypes.js +27 -0
- package/es/im/ReplyEditorExtensions/ReplyEditorExtensions.js +149 -0
- package/es/im/ReplyEditorExtensions/css/ReplyEditorExtensions.module.css +5 -0
- package/es/im/ReplyEditorExtensions/index.js +1 -0
- package/es/im/ReplyEditorExtensions/props/defaultProps.js +6 -0
- package/es/im/ReplyEditorExtensions/props/propTypes.js +16 -0
- package/es/im/ReplyEditorSuggestions/ReplyEditorSuggestions.js +95 -0
- package/es/im/ReplyEditorSuggestions/css/ReplyEditorSuggestions.module.css +8 -0
- package/es/im/ReplyEditorSuggestions/index.js +1 -0
- package/es/im/ReplyEditorSuggestions/props/defaultProps.js +6 -0
- package/es/im/ReplyEditorSuggestions/props/propTypes.js +21 -0
- package/es/im/ReplyEditorSuggestionsPopup/ReplyEditorSuggestionsPopup.js +93 -0
- package/es/im/ReplyEditorSuggestionsPopup/css/ReplyEditorSuggestionsPopup.module.css +7 -0
- package/es/im/ReplyEditorSuggestionsPopup/index.js +1 -0
- package/es/im/ReplyEditorSuggestionsPopup/props/defaultProps.js +10 -0
- package/es/im/ReplyEditorSuggestionsPopup/props/propTypes.js +21 -0
- package/es/im/index.js +8 -1
- package/es/index.js +13 -2
- package/es/rte/Editor/Editor.js +80 -0
- package/es/rte/Editor/css/Editor.module.css +17 -0
- package/es/rte/Editor/index.js +1 -0
- package/es/rte/Editor/props/defaultProps.js +21 -0
- package/es/rte/Editor/props/propTypes.js +52 -0
- package/es/rte/index.js +1 -0
- package/package.json +14 -21
- package/assets/Appearance/dark/mode/General_DarkMode.module.css +0 -71
- package/assets/Appearance/dark/themes/blue/blue_General_DarkTheme.module.css +0 -35
- package/assets/Appearance/dark/themes/green/green_General_DarkTheme.module.css +0 -35
- package/assets/Appearance/dark/themes/orange/orange_General_DarkTheme.module.css +0 -35
- package/assets/Appearance/dark/themes/red/red_General_DarkTheme.module.css +0 -35
- package/assets/Appearance/dark/themes/yellow/yellow_General_DarkTheme.module.css +0 -35
- package/assets/Appearance/light/mode/General_LightMode.module.css +0 -71
- package/assets/Appearance/light/themes/blue/blue_General_LightTheme.module.css +0 -35
- package/assets/Appearance/light/themes/green/green_General_LightTheme.module.css +0 -35
- package/assets/Appearance/light/themes/orange/orange_General_LightTheme.module.css +0 -35
- package/assets/Appearance/light/themes/red/red_General_LightTheme.module.css +0 -35
- package/assets/Appearance/light/themes/yellow/yellow_General_LightTheme.module.css +0 -35
- package/assets/Appearance/pureDark/mode/General_PureDarkMode.module.css +0 -71
- package/assets/Appearance/pureDark/themes/blue/blue_General_PureDarkTheme.module.css +0 -35
- package/assets/Appearance/pureDark/themes/green/green_General_PureDarkTheme.module.css +0 -35
- package/assets/Appearance/pureDark/themes/orange/orange_General_PureDarkTheme.module.css +0 -35
- package/assets/Appearance/pureDark/themes/red/red_General_PureDarkTheme.module.css +0 -35
- package/assets/Appearance/pureDark/themes/yellow/yellow_General_PureDarkTheme.module.css +0 -35
- package/es/Theme/constants/index.js +0 -41
- package/lib/index.js +0 -382
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** ** Styles *** */
|
|
2
|
+
.imgPreviewerheader {
|
|
3
|
+
position: relative;
|
|
4
|
+
background-color: var(
|
|
5
|
+
--imlib_chat_components_attachmentPreviewHeader_bg_color
|
|
6
|
+
);
|
|
7
|
+
padding: var(--zd_size15) var(--zd_size40);
|
|
8
|
+
border-bottom: var(--zd_size1) solid var(--zd_im_common_border);
|
|
9
|
+
}
|
|
10
|
+
[dir=ltr] .imgPreviewerheader {
|
|
11
|
+
border-top-left-radius: var(--zd_size5);
|
|
12
|
+
border-top-right-radius: var(--zd_size5);
|
|
13
|
+
}
|
|
14
|
+
[dir=rtl] .imgPreviewerheader {
|
|
15
|
+
border-top-right-radius: var(--zd_size5);
|
|
16
|
+
border-top-left-radius: var(--zd_size5);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.imgName {
|
|
20
|
+
color: var(--imlib_chat_components_attachmentPreviewHeader_name_color);
|
|
21
|
+
font-size: var(--zd_font_size17);
|
|
22
|
+
font-family: var(--zd_semibold);
|
|
23
|
+
composes: dotted from '../../css/common.module.css';
|
|
24
|
+
max-width: 100% ;
|
|
25
|
+
margin-bottom: var(--zd_size5);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.imgSize {
|
|
29
|
+
font-size: var(--zd_font_size13);
|
|
30
|
+
color: var(--imlib_chat_components_attachmentPreviewHeader_size_color);
|
|
31
|
+
composes: dotted from '../../css/common.module.css';
|
|
32
|
+
max-width: var(--zd_size150);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.navIcon {
|
|
36
|
+
-webkit-box-pack: flex-end;
|
|
37
|
+
-ms-flex-pack: flex-end;
|
|
38
|
+
justify-content: flex-end;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
[dir=ltr] .attachBtn {
|
|
42
|
+
margin-right: var(--zd_size10);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
[dir=rtl] .attachBtn {
|
|
46
|
+
margin-left: var(--zd_size10);
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as AttachmentPreviewHeader } from "./AttachmentPreviewHeader";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
const attachmentPreviewHeaderPropTypes = {
|
|
4
|
+
customStyle: PropTypes.object,
|
|
5
|
+
fileName: PropTypes.string.isRequired,
|
|
6
|
+
fileSize: PropTypes.string.isRequired,
|
|
7
|
+
submitText: PropTypes.string.isRequired,
|
|
8
|
+
cancelText: PropTypes.string.isRequired,
|
|
9
|
+
onSubmit: PropTypes.func,
|
|
10
|
+
onCancel: PropTypes.func,
|
|
11
|
+
customProps: PropTypes.shape({
|
|
12
|
+
cancelButtonProps: PropTypes.object,
|
|
13
|
+
submitButtonProps: PropTypes.object
|
|
14
|
+
})
|
|
15
|
+
};
|
|
16
|
+
export default attachmentPreviewHeaderPropTypes;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/* eslint-disable max-len */
|
|
2
|
+
|
|
3
|
+
/** ** Libraries *** */
|
|
4
|
+
import React from 'react';
|
|
5
|
+
/** ** Hooks *** */
|
|
6
|
+
|
|
7
|
+
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
8
|
+
import useEmoji from '@zohoim/chat-components-hooks/es/Emoji/useEmoji';
|
|
9
|
+
/** ** Constants *** */
|
|
10
|
+
|
|
11
|
+
import emojiDefaultProps from "./props/defaultProps";
|
|
12
|
+
import emojiPropTypes from "./props/propTypes";
|
|
13
|
+
/** ** Methods *** */
|
|
14
|
+
|
|
15
|
+
import cssJSLogic from "./css/cssJSLogic";
|
|
16
|
+
/** ** Styles *** */
|
|
17
|
+
|
|
18
|
+
import style from "./css/Emoji.module.css";
|
|
19
|
+
export default function Emoji(props) {
|
|
20
|
+
const {
|
|
21
|
+
customStyle,
|
|
22
|
+
id,
|
|
23
|
+
emoji,
|
|
24
|
+
emojiName,
|
|
25
|
+
isActive,
|
|
26
|
+
isHighlight,
|
|
27
|
+
onSelect: propOnSelect,
|
|
28
|
+
autoHover,
|
|
29
|
+
eleRef: propEleRef,
|
|
30
|
+
needTitle,
|
|
31
|
+
customTitle
|
|
32
|
+
} = props;
|
|
33
|
+
/* External customization */
|
|
34
|
+
|
|
35
|
+
const newStyle = useMergeStyle(style, customStyle);
|
|
36
|
+
/* CSS classnames added based on logic */
|
|
37
|
+
|
|
38
|
+
const {
|
|
39
|
+
emojiClass
|
|
40
|
+
} = cssJSLogic({
|
|
41
|
+
isActive,
|
|
42
|
+
isHighlight,
|
|
43
|
+
autoHover
|
|
44
|
+
}, newStyle);
|
|
45
|
+
const {
|
|
46
|
+
onSelect,
|
|
47
|
+
unicode,
|
|
48
|
+
title,
|
|
49
|
+
eleRef
|
|
50
|
+
} = useEmoji({
|
|
51
|
+
onSelect: propOnSelect,
|
|
52
|
+
emoji,
|
|
53
|
+
emojiName,
|
|
54
|
+
eleRef: propEleRef,
|
|
55
|
+
id,
|
|
56
|
+
needTitle,
|
|
57
|
+
customTitle
|
|
58
|
+
});
|
|
59
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
60
|
+
ref: eleRef,
|
|
61
|
+
className: emojiClass,
|
|
62
|
+
onClick: onSelect
|
|
63
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
64
|
+
className: newStyle.emojiContent,
|
|
65
|
+
"data-smiley": emojiName,
|
|
66
|
+
"data-title": title,
|
|
67
|
+
"data-unicode": emoji
|
|
68
|
+
}, unicode));
|
|
69
|
+
}
|
|
70
|
+
Emoji.propTypes = emojiPropTypes;
|
|
71
|
+
Emoji.defaultProps = emojiDefaultProps;
|
|
72
|
+
Emoji.displayName = 'Emoji';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
.varClass {
|
|
2
|
+
--emoji-height: var(--zd_size32);
|
|
3
|
+
--emoji-width: var(--zd_size32);
|
|
4
|
+
--emoji-font_size: var(--zd_font_size20);
|
|
5
|
+
--emoji-margin: var(--zd_size5);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.emoji {
|
|
9
|
+
composes: varClass;
|
|
10
|
+
width: var(--emoji-height);
|
|
11
|
+
height: var(--emoji-width);
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
font-size: 0 ;
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
margin: 0 var(--emoji-margin);
|
|
19
|
+
text-align: center;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.emojiContent {
|
|
23
|
+
font-size: var(--emoji-font_size);
|
|
24
|
+
display: block;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.emojiHighlight .emojiContent,
|
|
28
|
+
.emojiHover:hover .emojiContent {
|
|
29
|
+
transition: transform 60ms ease-out 60ms;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.emojiHighlight .emojiContent, .emojiHover:hover .emojiContent {
|
|
33
|
+
transform: scale(1.2);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.emojiHighlight {
|
|
37
|
+
background-color: var(--imlib_chat_components_emoji_hover_bg_color);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* .emojiHover:hover */
|
|
41
|
+
|
|
42
|
+
.emojiActive {
|
|
43
|
+
transform: scale(1.2);
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
/* background-color: var(--imlib_chat_components_emoji_active_bg_color); */
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** ** Methods *** */
|
|
2
|
+
import { compileClassNames } from '@zohodesk/utils';
|
|
3
|
+
export default function cssJSLogic(props, style) {
|
|
4
|
+
const {
|
|
5
|
+
isActive,
|
|
6
|
+
isHighlight,
|
|
7
|
+
autoHover
|
|
8
|
+
} = props;
|
|
9
|
+
const emojiClass = compileClassNames({
|
|
10
|
+
[style.emoji]: true,
|
|
11
|
+
[style.emojiHover]: autoHover,
|
|
12
|
+
[style.emojiHighlight]: isHighlight,
|
|
13
|
+
[style.emojiActive]: isActive
|
|
14
|
+
});
|
|
15
|
+
return {
|
|
16
|
+
emojiClass
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Emoji } from "./Emoji";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
const emojiPropTypes = {
|
|
4
|
+
customStyle: PropTypes.object,
|
|
5
|
+
emoji: PropTypes.string.isRequired,
|
|
6
|
+
emojiName: PropTypes.string.isRequired,
|
|
7
|
+
isActive: PropTypes.bool,
|
|
8
|
+
isHighlight: PropTypes.bool,
|
|
9
|
+
onSelect: PropTypes.func,
|
|
10
|
+
autoHover: PropTypes.bool,
|
|
11
|
+
id: PropTypes.string,
|
|
12
|
+
eleRef: PropTypes.func,
|
|
13
|
+
needTitle: PropTypes.bool,
|
|
14
|
+
customTitle: PropTypes.string
|
|
15
|
+
};
|
|
16
|
+
export default emojiPropTypes;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
/** ** Components *** */
|
|
4
|
+
|
|
5
|
+
import Popup from '@zohodesk/components/es/Popup/Popup';
|
|
6
|
+
import DropBox from '@zohodesk/components/es/DropBox/DropBox';
|
|
7
|
+
import IconButton from '@zohodesk/dot/es/IconButton/IconButton';
|
|
8
|
+
import { Container } from '@zohodesk/components/es/Layout';
|
|
9
|
+
import Emojis from "../Emojis/Emojis";
|
|
10
|
+
/** ** Hooks *** */
|
|
11
|
+
|
|
12
|
+
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
13
|
+
import useEmojiPopup from '@zohoim/chat-components-hooks/es/EmojiPopup/useEmojiPopup';
|
|
14
|
+
/** ** Constants *** */
|
|
15
|
+
|
|
16
|
+
import emojiPopupDefaultProps from "./props/defaultProps";
|
|
17
|
+
import emojiPopupPropTypes from "./props/propTypes";
|
|
18
|
+
import { EDITOR_POPUP_PORTAL } from "../constants";
|
|
19
|
+
import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
|
|
20
|
+
/** ** Styles *** */
|
|
21
|
+
|
|
22
|
+
import style from "./css/EmojiPopup.module.css";
|
|
23
|
+
|
|
24
|
+
function EmojiPopupComp(props) {
|
|
25
|
+
const {
|
|
26
|
+
customStyle,
|
|
27
|
+
customProps,
|
|
28
|
+
popupSize,
|
|
29
|
+
defaultPopupPosition,
|
|
30
|
+
tooltip,
|
|
31
|
+
onSelect: propOnSelect,
|
|
32
|
+
needCloseOnSelect,
|
|
33
|
+
onPopupOpen,
|
|
34
|
+
onPopupClose,
|
|
35
|
+
|
|
36
|
+
/** ** Popup Props *** */
|
|
37
|
+
getTargetRef,
|
|
38
|
+
getContainerRef,
|
|
39
|
+
position,
|
|
40
|
+
togglePopup,
|
|
41
|
+
isPopupReady,
|
|
42
|
+
isPopupOpen,
|
|
43
|
+
removeClose,
|
|
44
|
+
closePopupOnly,
|
|
45
|
+
isAbsolutePositioningNeeded,
|
|
46
|
+
positionsOffset
|
|
47
|
+
} = props;
|
|
48
|
+
const {
|
|
49
|
+
iconProps = dummyObject,
|
|
50
|
+
dropBoxProps = dummyObject,
|
|
51
|
+
emojisProps = dummyObject
|
|
52
|
+
} = customProps || dummyObject;
|
|
53
|
+
const {
|
|
54
|
+
onSelect,
|
|
55
|
+
onTogglePopup
|
|
56
|
+
} = useEmojiPopup({
|
|
57
|
+
togglePopup,
|
|
58
|
+
defaultPopupPosition,
|
|
59
|
+
needCloseOnSelect,
|
|
60
|
+
closePopupOnly,
|
|
61
|
+
onSelect: propOnSelect,
|
|
62
|
+
isPopupOpen,
|
|
63
|
+
onPopupOpen,
|
|
64
|
+
onPopupClose
|
|
65
|
+
});
|
|
66
|
+
/* External customization */
|
|
67
|
+
|
|
68
|
+
const newStyle = useMergeStyle(style, customStyle);
|
|
69
|
+
const popupClass = useMemo(() => ({
|
|
70
|
+
customDropBox: newStyle.popup,
|
|
71
|
+
customMobileDropBox: newStyle.mobilePopup,
|
|
72
|
+
customDropBoxWrap: newStyle.popupWrapper,
|
|
73
|
+
customMobileDropBoxWrap: newStyle.mobilePopupWrapper
|
|
74
|
+
}), [newStyle.popup, newStyle.mobilePopup, newStyle.popupWrapper, newStyle.mobilePopupWrapper]);
|
|
75
|
+
return /*#__PURE__*/React.createElement(Container, {
|
|
76
|
+
alignBox: "column"
|
|
77
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
78
|
+
className: newStyle.iconWrapper,
|
|
79
|
+
eleRef: getTargetRef,
|
|
80
|
+
iconClass: newStyle.icon,
|
|
81
|
+
iconName: "ZD-TT-happiness",
|
|
82
|
+
iconSize: "14",
|
|
83
|
+
isActive: isPopupOpen,
|
|
84
|
+
onClick: onTogglePopup,
|
|
85
|
+
title: tooltip,
|
|
86
|
+
...iconProps
|
|
87
|
+
}), isPopupOpen ? /*#__PURE__*/React.createElement(DropBox, {
|
|
88
|
+
boxPosition: position,
|
|
89
|
+
customClass: popupClass,
|
|
90
|
+
customStyle: dummyObject,
|
|
91
|
+
getRef: getContainerRef,
|
|
92
|
+
isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
|
|
93
|
+
isActive: isPopupReady,
|
|
94
|
+
isAnimate: true,
|
|
95
|
+
isArrow: false,
|
|
96
|
+
onClick: removeClose,
|
|
97
|
+
portalId: EDITOR_POPUP_PORTAL,
|
|
98
|
+
positionsOffset: positionsOffset,
|
|
99
|
+
size: popupSize,
|
|
100
|
+
...dropBoxProps
|
|
101
|
+
}, /*#__PURE__*/React.createElement(Emojis, {
|
|
102
|
+
onSelect: onSelect,
|
|
103
|
+
...emojisProps
|
|
104
|
+
})) : null);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const EmojiPopup = Popup(EmojiPopupComp, undefined, undefined, {
|
|
108
|
+
isAbsolutePositioningNeeded: false
|
|
109
|
+
});
|
|
110
|
+
EmojiPopupComp.defaultProps = emojiPopupDefaultProps;
|
|
111
|
+
EmojiPopupComp.propTypes = emojiPopupPropTypes;
|
|
112
|
+
EmojiPopup.defaultProps = emojiPopupDefaultProps;
|
|
113
|
+
EmojiPopup.propTypes = emojiPopupPropTypes;
|
|
114
|
+
EmojiPopup.displayName = 'EmojiPopup';
|
|
115
|
+
export default EmojiPopup;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** ** Styles *** */
|
|
2
|
+
|
|
3
|
+
.emojiPopup {
|
|
4
|
+
/** ** Use this class for css customisation *** */
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.container {
|
|
8
|
+
display: inline-block;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.popup {
|
|
12
|
+
/** ** Use this class for css customisation *** */
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.popupWrapper {
|
|
16
|
+
composes: container;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.mobilePopup {
|
|
20
|
+
composes: container;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.mobilePopupWrapper {
|
|
24
|
+
composes: container;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.icon {
|
|
28
|
+
/* margin-right: 5px; */
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.iconWrapper {
|
|
32
|
+
color: initial;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[dir=ltr] .iconWrapper {
|
|
36
|
+
margin-right: var(--zd_size5) ;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[dir=rtl] .iconWrapper {
|
|
40
|
+
margin-left: var(--zd_size5) ;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.icon :global .path1:before {
|
|
44
|
+
color: var(--imlib_chat_components_emojiPopup_ttIcon_path1_color) !important;
|
|
45
|
+
opacity: 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.icon :global .path2:before {
|
|
49
|
+
color: var(--imlib_chat_components_emojiPopup_ttIcon_path2_color) !important;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.icon :global .path2{
|
|
53
|
+
position: relative;
|
|
54
|
+
z-index: 1;
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as EmojiPopup } from "./EmojiPopup";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** ** Constants *** */
|
|
2
|
+
import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
|
|
3
|
+
const emojiPopupDefaultProps = {
|
|
4
|
+
customStyle: dummyObject,
|
|
5
|
+
customProps: dummyObject,
|
|
6
|
+
popupSize: 'large',
|
|
7
|
+
defaultPopupPosition: 'topCenter',
|
|
8
|
+
tooltip: 'Add Emoji',
|
|
9
|
+
needCloseOnSelect: true
|
|
10
|
+
};
|
|
11
|
+
export default emojiPopupDefaultProps;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
/** ** Constants *** */
|
|
4
|
+
|
|
5
|
+
import { popupSize, popupPosition } from "../../constants/propConstants/popupPropConstants";
|
|
6
|
+
const emojiPopupPropTypes = {
|
|
7
|
+
customStyle: PropTypes.object,
|
|
8
|
+
customProps: PropTypes.shape({
|
|
9
|
+
dropBoxProps: PropTypes.object,
|
|
10
|
+
emojisProps: PropTypes.object,
|
|
11
|
+
iconProps: PropTypes.object
|
|
12
|
+
}),
|
|
13
|
+
popupSize: PropTypes.oneOf(popupSize),
|
|
14
|
+
defaultPopupPosition: PropTypes.oneOf(popupPosition),
|
|
15
|
+
tooltip: PropTypes.string,
|
|
16
|
+
onSelect: PropTypes.func,
|
|
17
|
+
needCloseOnSelect: PropTypes.bool,
|
|
18
|
+
onPopupOpen: PropTypes.func,
|
|
19
|
+
onPopupClose: PropTypes.func
|
|
20
|
+
};
|
|
21
|
+
export default emojiPopupPropTypes;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/* eslint-disable max-len */
|
|
2
|
+
|
|
3
|
+
/** ** Libraries *** */
|
|
4
|
+
import React from 'react';
|
|
5
|
+
/** ** Components *** */
|
|
6
|
+
|
|
7
|
+
import EmojisList from "../EmojisList/EmojisList";
|
|
8
|
+
import EmojisHeader from "../EmojisHeader/EmojisHeader";
|
|
9
|
+
import EmojisFooter from "../EmojisFooter/EmojisFooter";
|
|
10
|
+
/** ** Hooks *** */
|
|
11
|
+
|
|
12
|
+
import useEmojis from '@zohoim/chat-components-hooks/es/Emojis/useEmojis';
|
|
13
|
+
/** ** Constants *** */
|
|
14
|
+
|
|
15
|
+
import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
|
|
16
|
+
import emojisList from '@zohoim/chat-components-utils/es/constants/emojisList';
|
|
17
|
+
import emojisDefaultProps from "./props/defaultProps";
|
|
18
|
+
import emojisPropTypes from "./props/propTypes";
|
|
19
|
+
export default function Emojis(props) {
|
|
20
|
+
const {
|
|
21
|
+
searchString,
|
|
22
|
+
isShowGroupBasedList,
|
|
23
|
+
isShowSearchBox,
|
|
24
|
+
emojisRowType,
|
|
25
|
+
onSelect: propOnSelect,
|
|
26
|
+
needAutoFocus,
|
|
27
|
+
customProps,
|
|
28
|
+
isShowOnlyContent,
|
|
29
|
+
searchPlaceHolder,
|
|
30
|
+
getMethods
|
|
31
|
+
} = props;
|
|
32
|
+
const {
|
|
33
|
+
emojisListProps = dummyObject,
|
|
34
|
+
emojisHeaderProps = dummyObject,
|
|
35
|
+
emojisFooterProps = dummyObject
|
|
36
|
+
} = customProps || dummyObject;
|
|
37
|
+
const {
|
|
38
|
+
searchValue,
|
|
39
|
+
onSearch,
|
|
40
|
+
getSearchRef,
|
|
41
|
+
onChangeGroup,
|
|
42
|
+
selectedGroup,
|
|
43
|
+
getEmojisListMethods,
|
|
44
|
+
onSelect,
|
|
45
|
+
onSelectTab
|
|
46
|
+
} = useEmojis({
|
|
47
|
+
searchString,
|
|
48
|
+
isShowSearchBox,
|
|
49
|
+
needAutoFocus,
|
|
50
|
+
onSelect: propOnSelect,
|
|
51
|
+
emojisList,
|
|
52
|
+
isShowGroupBasedList,
|
|
53
|
+
getMethods
|
|
54
|
+
});
|
|
55
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, isShowSearchBox ? /*#__PURE__*/React.createElement(EmojisHeader, {
|
|
56
|
+
getRef: getSearchRef,
|
|
57
|
+
onChange: onSearch,
|
|
58
|
+
searchPlaceHolder: searchPlaceHolder,
|
|
59
|
+
searchString: searchValue,
|
|
60
|
+
...emojisHeaderProps
|
|
61
|
+
}) : null, /*#__PURE__*/React.createElement(EmojisList, {
|
|
62
|
+
emojisList: emojisList,
|
|
63
|
+
getMethods: getEmojisListMethods,
|
|
64
|
+
isShowGroupBasedList: searchValue ? false : isShowGroupBasedList,
|
|
65
|
+
isShowOnlyContent: isShowOnlyContent,
|
|
66
|
+
onChangeGroup: onChangeGroup,
|
|
67
|
+
onSelect: onSelect,
|
|
68
|
+
rowType: emojisRowType,
|
|
69
|
+
searchString: searchValue,
|
|
70
|
+
selectedGroup: selectedGroup,
|
|
71
|
+
...emojisListProps
|
|
72
|
+
}), isShowGroupBasedList ? /*#__PURE__*/React.createElement(EmojisFooter, {
|
|
73
|
+
emojisList: emojisList,
|
|
74
|
+
onSelect: onSelectTab,
|
|
75
|
+
selectedTab: selectedGroup,
|
|
76
|
+
...emojisFooterProps
|
|
77
|
+
}) : null);
|
|
78
|
+
}
|
|
79
|
+
Emojis.propTypes = emojisPropTypes;
|
|
80
|
+
Emojis.defaultProps = emojisDefaultProps;
|
|
81
|
+
Emojis.displayName = 'Emojis';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Emojis } from "./Emojis";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** ** Constants *** */
|
|
2
|
+
import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
|
|
3
|
+
const emojisDefaultProps = {
|
|
4
|
+
customStyle: dummyObject,
|
|
5
|
+
isShowGroupBasedList: true,
|
|
6
|
+
emojisRowType: 'multiple',
|
|
7
|
+
needAutoFocus: true,
|
|
8
|
+
isShowSearchBox: true
|
|
9
|
+
};
|
|
10
|
+
export default emojisDefaultProps;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
const emojisPropTypes = {
|
|
4
|
+
customStyle: PropTypes.object,
|
|
5
|
+
searchString: PropTypes.string,
|
|
6
|
+
isShowGroupBasedList: PropTypes.bool,
|
|
7
|
+
isShowSearchBox: PropTypes.bool,
|
|
8
|
+
emojisRowType: PropTypes.oneOf(['single', 'multiple']),
|
|
9
|
+
onSelect: PropTypes.func,
|
|
10
|
+
needAutoFocus: PropTypes.bool,
|
|
11
|
+
customProps: PropTypes.shape({
|
|
12
|
+
emojisFooterProps: PropTypes.object,
|
|
13
|
+
emojisHeaderProps: PropTypes.object,
|
|
14
|
+
emojisListProps: PropTypes.object
|
|
15
|
+
}),
|
|
16
|
+
isShowOnlyContent: PropTypes.bool,
|
|
17
|
+
searchPlaceHolder: PropTypes.string,
|
|
18
|
+
getMethods: PropTypes.func
|
|
19
|
+
};
|
|
20
|
+
export default emojisPropTypes;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
/** ** Components *** */
|
|
4
|
+
|
|
5
|
+
import { Container, Box } from '@zohodesk/components/es/Layout';
|
|
6
|
+
import Emoji from "../Emoji/Emoji";
|
|
7
|
+
/** ** Hooks *** */
|
|
8
|
+
|
|
9
|
+
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
10
|
+
/** ** Constants *** */
|
|
11
|
+
|
|
12
|
+
import emojisEmptyStateDefaultProps from "./props/defaultProps";
|
|
13
|
+
import emojisEmptyStatePropTypes from "./props/propTypes";
|
|
14
|
+
/** ** Styles *** */
|
|
15
|
+
|
|
16
|
+
import style from "./css/EmojisEmptyState.module.css";
|
|
17
|
+
export default function EmojisEmptyState(props) {
|
|
18
|
+
const {
|
|
19
|
+
customStyle,
|
|
20
|
+
title,
|
|
21
|
+
description
|
|
22
|
+
} = props;
|
|
23
|
+
/* External customization */
|
|
24
|
+
|
|
25
|
+
const newStyle = useMergeStyle(style, customStyle);
|
|
26
|
+
const {
|
|
27
|
+
emoji,
|
|
28
|
+
name
|
|
29
|
+
} = useMemo(() => ({
|
|
30
|
+
emoji: ['#x1f622'],
|
|
31
|
+
name: ':cry:'
|
|
32
|
+
}), []);
|
|
33
|
+
return /*#__PURE__*/React.createElement(Container, {
|
|
34
|
+
align: "both"
|
|
35
|
+
}, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Emoji, {
|
|
36
|
+
autoHover: false,
|
|
37
|
+
emoji: emoji,
|
|
38
|
+
emojiName: name,
|
|
39
|
+
needTitle: false
|
|
40
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
41
|
+
className: newStyle.title,
|
|
42
|
+
"data-title": title
|
|
43
|
+
}, title), /*#__PURE__*/React.createElement(Box, {
|
|
44
|
+
className: newStyle.description,
|
|
45
|
+
"data-title": description
|
|
46
|
+
}, description));
|
|
47
|
+
}
|
|
48
|
+
EmojisEmptyState.propTypes = emojisEmptyStatePropTypes;
|
|
49
|
+
EmojisEmptyState.defaultProps = emojisEmptyStateDefaultProps;
|
|
50
|
+
EmojisEmptyState.displayName = 'EmojisEmptyState';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.title {
|
|
2
|
+
color: var(--zd_im_primary_text);
|
|
3
|
+
font-size: var(--zd_font_size16);
|
|
4
|
+
font-family: var(--zd_semibold);
|
|
5
|
+
max-width: 100% ;
|
|
6
|
+
composes: dotted from '../../css/common.module.css';
|
|
7
|
+
margin-bottom: var(--zd_size7);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.description {
|
|
11
|
+
font-size: var(--zd_font_size14);
|
|
12
|
+
color: var(--zd_im_secondary_text);
|
|
13
|
+
display: -webkit-box;
|
|
14
|
+
-webkit-line-clamp: 2;
|
|
15
|
+
-webkit-box-orient: vertical;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
text-align: center;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as EmojisEmptyState } from "./EmojisEmptyState";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** ** Constants *** */
|
|
2
|
+
import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
|
|
3
|
+
const emojisEmptyStateDefaultProps = {
|
|
4
|
+
customStyle: dummyObject,
|
|
5
|
+
title: 'No Emoji(s) found!',
|
|
6
|
+
// eslint-disable-next-line quotes
|
|
7
|
+
description: "Sorry, we couldn't find any emojis."
|
|
8
|
+
};
|
|
9
|
+
export default emojisEmptyStateDefaultProps;
|