@zohoim/chat-components 1.0.8 → 1.0.9-beta.1
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 +2 -2
- package/es/AttachmentHandler/AttachmentHandler.js +84 -0
- package/es/AttachmentHandler/css/AttachmentHandler.module.css +17 -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 +113 -0
- package/es/AttachmentPreview/css/AttachmentPreview.module.css +31 -0
- package/es/AttachmentPreview/index.js +1 -0
- package/es/AttachmentPreview/props/defaultProps.js +7 -0
- package/es/AttachmentPreview/props/propTypes.js +31 -0
- package/es/AttachmentPreviewBody/AttachmentPreviewBody.js +76 -0
- package/es/AttachmentPreviewBody/css/AttachmentPreviewBody.module.css +63 -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 +45 -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 +47 -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 +116 -0
- package/es/EmojiPopup/css/EmojiPopup.module.css +50 -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 +19 -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 +38 -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 +133 -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 +23 -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 +121 -0
- package/es/Theme/themeVariables/dark/commonColorVariable.js +27 -0
- package/es/Theme/themeVariables/dark/greenTheme.js +119 -0
- package/es/Theme/themeVariables/dark/orangeTheme.js +119 -0
- package/es/Theme/themeVariables/dark/redTheme.js +119 -0
- package/es/Theme/themeVariables/dark/yellowTheme.js +119 -0
- package/es/Theme/themeVariables/light/blueTheme.js +123 -0
- package/es/Theme/themeVariables/light/commonColorVariable.js +46 -0
- package/es/Theme/themeVariables/light/greenTheme.js +117 -0
- package/es/Theme/themeVariables/light/orangeTheme.js +117 -0
- package/es/Theme/themeVariables/light/redTheme.js +117 -0
- package/es/Theme/themeVariables/light/yellowTheme.js +117 -0
- package/es/Theme/themeVariables/pureDark/blueTheme.js +120 -0
- package/es/Theme/themeVariables/pureDark/commonColorVariable.js +29 -0
- package/es/Theme/themeVariables/pureDark/greenTheme.js +119 -0
- package/es/Theme/themeVariables/pureDark/orangeTheme.js +119 -0
- package/es/Theme/themeVariables/pureDark/redTheme.js +119 -0
- package/es/Theme/themeVariables/pureDark/yellowTheme.js +119 -0
- package/es/Theme/utils/getThemeConfigurations.js +56 -2
- package/es/constants/index.js +7 -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 +137 -0
- package/es/im/ReplyComposer/css/ReplyComposer.module.css +5 -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 +5 -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 +30 -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 +87 -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 +20 -0
- package/es/im/ReplyEditorSuggestionsPopup/ReplyEditorSuggestionsPopup.js +90 -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 +19 -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 +13 -20
- 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,40 @@
|
|
|
1
|
+
.footerTab {
|
|
2
|
+
position: relative;
|
|
3
|
+
border-top: 1px solid rgb(238, 242, 239);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.tabIcon {
|
|
7
|
+
/* padding: var(--zd_size10) var(--zd_size16); */
|
|
8
|
+
position: relative;
|
|
9
|
+
height: var(--zd_size35) ;
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
text-align: center;
|
|
14
|
+
padding: 1% ;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.tabLine {
|
|
18
|
+
display: inline-block;
|
|
19
|
+
position: absolute;
|
|
20
|
+
top: 0 ;
|
|
21
|
+
height: var(--zd_size2) ;
|
|
22
|
+
transition: 0.3s ease;
|
|
23
|
+
width: 100% ;
|
|
24
|
+
background-color: var(--imlib_chat_components_emojiFooter_tabLine);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[dir=ltr] .tabLine {
|
|
28
|
+
left: 0 ;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
[dir=rtl] .tabLine {
|
|
32
|
+
right: 0 ;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.emoji{
|
|
36
|
+
width: auto ;
|
|
37
|
+
height: auto ;
|
|
38
|
+
margin: 0 ;
|
|
39
|
+
padding: 8% ;
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as EmojisFooter } from "./EmojisFooter";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
const emojisFooterPropTypes = {
|
|
4
|
+
customStyle: PropTypes.object,
|
|
5
|
+
customProps: PropTypes.shape({
|
|
6
|
+
emojiProps: PropTypes.object
|
|
7
|
+
}),
|
|
8
|
+
emojisList: PropTypes.object.isRequired,
|
|
9
|
+
onSelect: PropTypes.func,
|
|
10
|
+
selectedTab: PropTypes.string
|
|
11
|
+
};
|
|
12
|
+
export default emojisFooterPropTypes;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
/** ** Components *** */
|
|
4
|
+
|
|
5
|
+
import { Container, Box } from '@zohodesk/components/es/Layout';
|
|
6
|
+
import Icon from '@zohodesk/icons/es/Icon';
|
|
7
|
+
import TextBox from '@zohodesk/components/es/TextBox/TextBox';
|
|
8
|
+
/** ** Hooks *** */
|
|
9
|
+
|
|
10
|
+
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
11
|
+
/** ** Constants *** */
|
|
12
|
+
|
|
13
|
+
import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
|
|
14
|
+
import emojisHeaderDefaultProps from "./props/defaultProps";
|
|
15
|
+
import emojisHeaderPropTypes from "./props/propTypes";
|
|
16
|
+
/** ** Styles *** */
|
|
17
|
+
|
|
18
|
+
import style from "./css/EmojisHeader.module.css";
|
|
19
|
+
export default function EmojisHeader(props) {
|
|
20
|
+
const {
|
|
21
|
+
customStyle,
|
|
22
|
+
customProps = dummyObject,
|
|
23
|
+
searchString,
|
|
24
|
+
getRef,
|
|
25
|
+
onChange,
|
|
26
|
+
searchPlaceHolder
|
|
27
|
+
} = props;
|
|
28
|
+
const {
|
|
29
|
+
textBoxProps = dummyObject
|
|
30
|
+
} = customProps;
|
|
31
|
+
/* External customization */
|
|
32
|
+
|
|
33
|
+
const newStyle = useMergeStyle(style, customStyle);
|
|
34
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
35
|
+
className: newStyle.container
|
|
36
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
37
|
+
align: "vertical",
|
|
38
|
+
alignBox: "row",
|
|
39
|
+
className: newStyle.emojisSearch
|
|
40
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
41
|
+
className: newStyle.searchIcon
|
|
42
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
43
|
+
name: "ZD-search",
|
|
44
|
+
size: "13"
|
|
45
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
46
|
+
flexible: true
|
|
47
|
+
}, /*#__PURE__*/React.createElement(TextBox, {
|
|
48
|
+
customClass: newStyle.searchInput,
|
|
49
|
+
inputRef: getRef,
|
|
50
|
+
isDisabled: false,
|
|
51
|
+
isReadOnly: false,
|
|
52
|
+
name: "emojiSearch",
|
|
53
|
+
needBorder: false,
|
|
54
|
+
onChange: onChange,
|
|
55
|
+
placeHolder: searchPlaceHolder,
|
|
56
|
+
size: "medium",
|
|
57
|
+
type: "text",
|
|
58
|
+
value: searchString,
|
|
59
|
+
variant: "default",
|
|
60
|
+
...textBoxProps
|
|
61
|
+
}))));
|
|
62
|
+
}
|
|
63
|
+
EmojisHeader.propTypes = emojisHeaderPropTypes;
|
|
64
|
+
EmojisHeader.defaultProps = emojisHeaderDefaultProps;
|
|
65
|
+
EmojisHeader.displayName = 'EmojisHeader';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.container{
|
|
2
|
+
padding: var(--zd_size10) ;
|
|
3
|
+
border-bottom: 1px solid #e4e5e6;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.emojisSearch {
|
|
7
|
+
position: relative;
|
|
8
|
+
background-color: var(--imlib_chat_components_emojisHeader_bg_color);
|
|
9
|
+
background-color: #fafafa;
|
|
10
|
+
|
|
11
|
+
background-color: var(--imlib_chat_components_emojiPopup_bg);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.searchInput {
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
min-height: var(--zd_size38) ;
|
|
17
|
+
outline: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
[dir=ltr] .searchInput {
|
|
21
|
+
padding-left: var(--zd_size31) ;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
[dir=rtl] .searchInput {
|
|
25
|
+
padding-right: var(--zd_size31) ;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.searchIcon {
|
|
29
|
+
position: absolute;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
[dir=ltr] .searchIcon {
|
|
33
|
+
left: var(--zd_size10) ;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
[dir=rtl] .searchIcon {
|
|
37
|
+
right: var(--zd_size10) ;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as EmojisHeader } from "./EmojisHeader";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** ** Constants *** */
|
|
2
|
+
import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
|
|
3
|
+
const emojisHeaderDefaultProps = {
|
|
4
|
+
customStyle: dummyObject,
|
|
5
|
+
customProps: dummyObject,
|
|
6
|
+
searchPlaceHolder: 'Search...'
|
|
7
|
+
};
|
|
8
|
+
export default emojisHeaderDefaultProps;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
const emojisHeaderPropTypes = {
|
|
4
|
+
customStyle: PropTypes.object,
|
|
5
|
+
customProps: PropTypes.shape({
|
|
6
|
+
textBoxProps: PropTypes.object
|
|
7
|
+
}),
|
|
8
|
+
searchString: PropTypes.string,
|
|
9
|
+
getRef: PropTypes.func,
|
|
10
|
+
onChange: PropTypes.func,
|
|
11
|
+
searchPlaceHolder: PropTypes.string
|
|
12
|
+
};
|
|
13
|
+
export default emojisHeaderPropTypes;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/* eslint-disable max-len */
|
|
2
|
+
|
|
3
|
+
/** ** Libraries *** */
|
|
4
|
+
import React, { useCallback } from 'react';
|
|
5
|
+
/** ** Components *** */
|
|
6
|
+
|
|
7
|
+
import Emoji from "../Emoji/Emoji";
|
|
8
|
+
import EmojisEmptyState from "../EmojisEmptyState/EmojisEmptyState";
|
|
9
|
+
/** ** Hooks *** */
|
|
10
|
+
|
|
11
|
+
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
12
|
+
import useEmojisList from '@zohoim/chat-components-hooks/es/EmojisList/useEmojisList';
|
|
13
|
+
/** ** Constants *** */
|
|
14
|
+
|
|
15
|
+
import emojisListDefaultProps from "./props/defaultProps";
|
|
16
|
+
import emojisListPropTypes from "./props/propTypes";
|
|
17
|
+
import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
|
|
18
|
+
/** ** Methods *** */
|
|
19
|
+
|
|
20
|
+
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
21
|
+
import cssJSLogic from "./css/cssJSLogic";
|
|
22
|
+
/** ** Styles *** */
|
|
23
|
+
|
|
24
|
+
import style from "./css/EmojisList.module.css";
|
|
25
|
+
export default function EmojisList(props) {
|
|
26
|
+
const {
|
|
27
|
+
customStyle,
|
|
28
|
+
customProps,
|
|
29
|
+
searchString,
|
|
30
|
+
isShowGroupBasedList,
|
|
31
|
+
onChangeGroup,
|
|
32
|
+
getMethods,
|
|
33
|
+
onSelect,
|
|
34
|
+
selectedGroup,
|
|
35
|
+
rowType,
|
|
36
|
+
emojisList: propsEmojisList,
|
|
37
|
+
renderEmpty,
|
|
38
|
+
isShowOnlyContent
|
|
39
|
+
} = props;
|
|
40
|
+
const {
|
|
41
|
+
emojiProps = dummyObject,
|
|
42
|
+
emojisEmptyStateProps = dummyObject
|
|
43
|
+
} = customProps;
|
|
44
|
+
const {
|
|
45
|
+
emojisList,
|
|
46
|
+
setGroupRefs,
|
|
47
|
+
setContainerRef: listContainerRef,
|
|
48
|
+
emptyState,
|
|
49
|
+
isRenderEmptyState,
|
|
50
|
+
isRenderElement
|
|
51
|
+
} = useEmojisList({
|
|
52
|
+
emojisList: propsEmojisList,
|
|
53
|
+
searchString,
|
|
54
|
+
isShowGroupBasedList,
|
|
55
|
+
onChangeGroup,
|
|
56
|
+
getMethods,
|
|
57
|
+
selectedGroup,
|
|
58
|
+
isShowOnlyContent
|
|
59
|
+
});
|
|
60
|
+
const {
|
|
61
|
+
isEmpty,
|
|
62
|
+
isGroupEmpty
|
|
63
|
+
} = emptyState;
|
|
64
|
+
/* External customization */
|
|
65
|
+
|
|
66
|
+
const newStyle = useMergeStyle(style, customStyle);
|
|
67
|
+
/* CSS classnames added based on logic */
|
|
68
|
+
|
|
69
|
+
const {
|
|
70
|
+
emojisListClass,
|
|
71
|
+
groupClass
|
|
72
|
+
} = cssJSLogic({
|
|
73
|
+
rowType,
|
|
74
|
+
isShowGroupBasedList,
|
|
75
|
+
isShowOnlyContent,
|
|
76
|
+
isEmpty
|
|
77
|
+
}, newStyle);
|
|
78
|
+
const renderGroup = useCallback(_ref => {
|
|
79
|
+
let {
|
|
80
|
+
groupName,
|
|
81
|
+
emojis
|
|
82
|
+
} = _ref;
|
|
83
|
+
const isEmptyGroup = isGroupEmpty[groupName];
|
|
84
|
+
return !isEmptyGroup ? /*#__PURE__*/React.createElement("div", {
|
|
85
|
+
key: groupName,
|
|
86
|
+
ref: el => {
|
|
87
|
+
setGroupRefs(el, groupName);
|
|
88
|
+
},
|
|
89
|
+
className: groupClass
|
|
90
|
+
}, isShowGroupBasedList ? /*#__PURE__*/React.createElement("div", {
|
|
91
|
+
className: newStyle.groupName
|
|
92
|
+
}, groupName) : null, Object.keys(emojis).map(emojiName => {
|
|
93
|
+
const emoji = emojis[emojiName];
|
|
94
|
+
const id = `emoji_${emojiName}`;
|
|
95
|
+
return /*#__PURE__*/React.createElement(Emoji, {
|
|
96
|
+
key: id,
|
|
97
|
+
emoji: emoji,
|
|
98
|
+
emojiName: emojiName,
|
|
99
|
+
onSelect: onSelect,
|
|
100
|
+
...emojiProps
|
|
101
|
+
});
|
|
102
|
+
})) : null;
|
|
103
|
+
}, [emojiProps, isGroupEmpty, groupClass, isShowGroupBasedList, newStyle.groupName, onSelect, setGroupRefs]);
|
|
104
|
+
const renderDefaultEmptyState = useCallback(() => /*#__PURE__*/React.createElement(EmojisEmptyState, { ...emojisEmptyStateProps
|
|
105
|
+
}), [emojisEmptyStateProps]);
|
|
106
|
+
const renderEmptyState = useCallback(() => {
|
|
107
|
+
/* Render EmptyState */
|
|
108
|
+
if (isRenderEmptyState) {
|
|
109
|
+
const emptyState = renderHandler(renderEmpty || renderDefaultEmptyState)();
|
|
110
|
+
|
|
111
|
+
if (emptyState) {
|
|
112
|
+
return emptyState;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return null;
|
|
119
|
+
}, [renderEmpty, renderDefaultEmptyState, isRenderEmptyState]);
|
|
120
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, isRenderElement ? /*#__PURE__*/React.createElement("div", {
|
|
121
|
+
ref: listContainerRef,
|
|
122
|
+
className: emojisListClass
|
|
123
|
+
}, !isEmpty ? Object.keys(emojisList).map(groupName => {
|
|
124
|
+
const emojis = emojisList[groupName];
|
|
125
|
+
return renderGroup({
|
|
126
|
+
groupName,
|
|
127
|
+
emojis
|
|
128
|
+
});
|
|
129
|
+
}) : renderEmptyState()) : null);
|
|
130
|
+
}
|
|
131
|
+
EmojisList.propTypes = emojisListPropTypes;
|
|
132
|
+
EmojisList.defaultProps = emojisListDefaultProps;
|
|
133
|
+
EmojisList.displayName = 'EmojisList';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.varClass {
|
|
2
|
+
--emoji-groupName-size: var(--zd_font_size13);
|
|
3
|
+
--emoji-singleList-size: var(--zd_size32);
|
|
4
|
+
--emoji-multipleList-size: var(--zd_size300);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.emojisList {
|
|
8
|
+
composes: varClass;
|
|
9
|
+
transition: 0.2s ease;
|
|
10
|
+
flex-direction: row;
|
|
11
|
+
flex-shrink: 0;
|
|
12
|
+
width: 100% ;
|
|
13
|
+
word-wrap: break-word;
|
|
14
|
+
font-size: 0 ;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.emojisListHide {
|
|
18
|
+
display: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.emojisListSingle {
|
|
22
|
+
height: var(--emoji-singleList-size);
|
|
23
|
+
white-space: nowrap;
|
|
24
|
+
overflow-x: auto;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.emojisListMultiple {
|
|
28
|
+
height: var(--emoji-multipleList-size);
|
|
29
|
+
overflow-y: auto;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.groupName {
|
|
33
|
+
width: 100% ;
|
|
34
|
+
font-size: var(--emoji-groupName-size);
|
|
35
|
+
text-transform: capitalize;
|
|
36
|
+
color: var(--imlib_chat_components_emojiPopup_titleColor);
|
|
37
|
+
padding: var(--zd_size8) var(--zd_size10) ;
|
|
38
|
+
margin-bottom: var(--zd_size5) ;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.groupContainer {
|
|
42
|
+
font-size: 0 ;
|
|
43
|
+
}
|
|
44
|
+
.groupSeperate {
|
|
45
|
+
display: inline-block;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.groupAll {
|
|
49
|
+
display: inline;
|
|
50
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** ** Methods *** */
|
|
2
|
+
import compileClassNames from '@zohodesk/utils/es/compileClassNames';
|
|
3
|
+
export default function cssJSLogic(props, style) {
|
|
4
|
+
const {
|
|
5
|
+
rowType,
|
|
6
|
+
isShowGroupBasedList,
|
|
7
|
+
isShowOnlyContent,
|
|
8
|
+
isEmpty
|
|
9
|
+
} = props;
|
|
10
|
+
const emojisListClass = compileClassNames({
|
|
11
|
+
[style.emojisList]: true,
|
|
12
|
+
[style.emojisListSingle]: rowType === 'single',
|
|
13
|
+
[style.emojisListMultiple]: rowType === 'multiple',
|
|
14
|
+
[style.emojisListHide]: isShowOnlyContent ? isEmpty : false
|
|
15
|
+
});
|
|
16
|
+
const groupClass = compileClassNames({
|
|
17
|
+
[style.groupContainer]: true,
|
|
18
|
+
[style.groupSeperate]: !!isShowGroupBasedList,
|
|
19
|
+
[style.groupAll]: !isShowGroupBasedList
|
|
20
|
+
});
|
|
21
|
+
return {
|
|
22
|
+
emojisListClass,
|
|
23
|
+
groupClass
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as EmojisList } from "./EmojisList";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** ** Constants *** */
|
|
2
|
+
import { dummyObject } from '@zohoim/chat-components-utils/es/constants';
|
|
3
|
+
const emojisListDefaultProps = {
|
|
4
|
+
customStyle: dummyObject,
|
|
5
|
+
customProps: dummyObject,
|
|
6
|
+
rowType: 'multiple',
|
|
7
|
+
isShowGroupBasedList: true,
|
|
8
|
+
isShowOnlyContent: false
|
|
9
|
+
};
|
|
10
|
+
export default emojisListDefaultProps;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
const emojisListPropTypes = {
|
|
4
|
+
emojisList: PropTypes.object.isRequired,
|
|
5
|
+
customProps: PropTypes.shape({
|
|
6
|
+
emojiProps: PropTypes.object,
|
|
7
|
+
emojisEmptyStateProps: PropTypes.object
|
|
8
|
+
}),
|
|
9
|
+
customStyle: PropTypes.object,
|
|
10
|
+
getMethods: PropTypes.func,
|
|
11
|
+
isShowGroupBasedList: PropTypes.bool,
|
|
12
|
+
isShowOnlyContent: PropTypes.bool,
|
|
13
|
+
onChangeGroup: PropTypes.func,
|
|
14
|
+
onSelect: PropTypes.func,
|
|
15
|
+
renderEmpty: PropTypes.func,
|
|
16
|
+
rowType: PropTypes.oneOf(['single', 'multiple']),
|
|
17
|
+
searchString: PropTypes.string,
|
|
18
|
+
selectedGroup: PropTypes.string
|
|
19
|
+
};
|
|
20
|
+
export default emojisListPropTypes;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import React, { useCallback, useMemo } from 'react';
|
|
3
3
|
/** ** Components *** */
|
|
4
4
|
|
|
5
|
-
import Popup from '@zohodesk/components/
|
|
6
|
-
import DropBox from '@zohodesk/components/
|
|
5
|
+
import Popup from '@zohodesk/components/es/Popup/Popup';
|
|
6
|
+
import DropBox from '@zohodesk/components/es/DropBox/DropBox';
|
|
7
7
|
/** ** Constants *** */
|
|
8
8
|
|
|
9
9
|
import messageActionsMoreDefaultProps from "./props/defaultProps";
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/** ** Libraries *** */
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
/** ** Constants *** */
|
|
4
|
+
|
|
5
|
+
import { popupPosition, popupSize } from "../../constants/propConstants/popupPropConstants";
|
|
3
6
|
const messageActionsMorePropTypes = {
|
|
4
7
|
actions: PropTypes.arrayOf(PropTypes.shape({
|
|
5
8
|
id: PropTypes.string.isRequired,
|
|
@@ -7,7 +10,7 @@ const messageActionsMorePropTypes = {
|
|
|
7
10
|
})).isRequired,
|
|
8
11
|
renderMoreIcon: PropTypes.func.isRequired,
|
|
9
12
|
customStyle: PropTypes.object,
|
|
10
|
-
popupSize: PropTypes.oneOf(
|
|
11
|
-
defaultPopupPosition: PropTypes.oneOf(
|
|
13
|
+
popupSize: PropTypes.oneOf(popupSize),
|
|
14
|
+
defaultPopupPosition: PropTypes.oneOf(popupPosition)
|
|
12
15
|
};
|
|
13
16
|
export default messageActionsMorePropTypes;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React, { useCallback } from 'react';
|
|
3
3
|
/** ** Components *** */
|
|
4
4
|
|
|
5
|
-
import { Container } from '@zohodesk/components/
|
|
5
|
+
import { Container } from '@zohodesk/components/es/Layout';
|
|
6
6
|
import MessageActionsMore from "../MessageActionsMore/MessageActionsMore";
|
|
7
7
|
/** ** Hooks *** */
|
|
8
8
|
|
package/es/Theme/ThemeAssets.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** ** Libraries *** */
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import '@zohodesk/components/
|
|
3
|
+
import '@zohodesk/components/es/common/boxShadow.module.css';
|
|
4
4
|
/* component pkg - default mode, themes */
|
|
5
5
|
|
|
6
6
|
import '@zohodesk/components/assets/Appearance/light/themes/blue/blue_CTA_LightTheme.module.css';
|
|
@@ -64,27 +64,9 @@ import '@zohodesk/variables/assets/colorVariables.module.css';
|
|
|
64
64
|
import '@zohodesk/variables/assets/dotVariables.module.css';
|
|
65
65
|
import '@zohodesk/variables/assets/sizeVariables.module.css';
|
|
66
66
|
import '@zohodesk/variables/assets/fontsizeVariables.module.css';
|
|
67
|
-
import '@zohodesk/variables/
|
|
67
|
+
import '@zohodesk/variables/es/fontFamilyVariables.module.css';
|
|
68
68
|
import '@zohodesk/variables/assets/transitionVariables.module.css';
|
|
69
69
|
import '@zohodesk/variables/assets/no_transitionVariables.module.css';
|
|
70
|
-
import "../../assets/Appearance/dark/mode/General_DarkMode.module.css";
|
|
71
|
-
import "../../assets/Appearance/dark/themes/blue/blue_General_DarkTheme.module.css";
|
|
72
|
-
import "../../assets/Appearance/dark/themes/green/green_General_DarkTheme.module.css";
|
|
73
|
-
import "../../assets/Appearance/dark/themes/orange/orange_General_DarkTheme.module.css";
|
|
74
|
-
import "../../assets/Appearance/dark/themes/red/red_General_DarkTheme.module.css";
|
|
75
|
-
import "../../assets/Appearance/dark/themes/yellow/yellow_General_DarkTheme.module.css";
|
|
76
|
-
import "../../assets/Appearance/light/mode/General_LightMode.module.css";
|
|
77
|
-
import "../../assets/Appearance/light/themes/blue/blue_General_LightTheme.module.css";
|
|
78
|
-
import "../../assets/Appearance/light/themes/green/green_General_LightTheme.module.css";
|
|
79
|
-
import "../../assets/Appearance/light/themes/orange/orange_General_LightTheme.module.css";
|
|
80
|
-
import "../../assets/Appearance/light/themes/red/red_General_LightTheme.module.css";
|
|
81
|
-
import "../../assets/Appearance/light/themes/yellow/yellow_General_LightTheme.module.css";
|
|
82
|
-
import "../../assets/Appearance/pureDark/mode/General_PureDarkMode.module.css";
|
|
83
|
-
import "../../assets/Appearance/pureDark/themes/blue/blue_General_PureDarkTheme.module.css";
|
|
84
|
-
import "../../assets/Appearance/pureDark/themes/green/green_General_PureDarkTheme.module.css";
|
|
85
|
-
import "../../assets/Appearance/pureDark/themes/orange/orange_General_PureDarkTheme.module.css";
|
|
86
|
-
import "../../assets/Appearance/pureDark/themes/red/red_General_PureDarkTheme.module.css";
|
|
87
|
-
import "../../assets/Appearance/pureDark/themes/yellow/yellow_General_PureDarkTheme.module.css";
|
|
88
70
|
export default function DeskAssets(props) {
|
|
89
71
|
const {
|
|
90
72
|
children
|
package/es/Theme/ThemeWrapper.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/** ** Libraries *** */
|
|
2
2
|
import React, { useMemo, useCallback } from 'react';
|
|
3
|
+
/** ** Providers *** */
|
|
4
|
+
|
|
5
|
+
import ThemeContext from '@zohoim/chat-components-hooks/es/Theme/ThemeContext';
|
|
3
6
|
/** ** Constants *** */
|
|
4
7
|
|
|
5
8
|
import themeWrapperPropTypes from "./props/propTypes";
|
|
6
9
|
import themeWrapperDefaultProps from "./props/defaultProps";
|
|
7
|
-
import { styleTagId } from
|
|
8
|
-
import { MSG_ACTION_POPUP_PORTAL } from "../constants";
|
|
10
|
+
import { styleTagId } from '@zohoim/chat-components-utils/es/constants/themeConstants';
|
|
11
|
+
import { MSG_ACTION_POPUP_PORTAL, EDITOR_POPUP_PORTAL } from "../constants";
|
|
9
12
|
/** ** Components *** */
|
|
10
13
|
|
|
11
14
|
import ThemeAssets from "./ThemeAssets";
|
|
@@ -29,7 +32,8 @@ export default function ThemeWrapper(props) {
|
|
|
29
32
|
theme: propTheme,
|
|
30
33
|
modeKey,
|
|
31
34
|
themeKey,
|
|
32
|
-
tooltipCustomStyle
|
|
35
|
+
tooltipCustomStyle,
|
|
36
|
+
direction
|
|
33
37
|
} = props;
|
|
34
38
|
/** ** containerRef for Tooltip *** */
|
|
35
39
|
|
|
@@ -38,22 +42,20 @@ export default function ThemeWrapper(props) {
|
|
|
38
42
|
/** ** ThemeConfigurations Handling *** */
|
|
39
43
|
|
|
40
44
|
const {
|
|
45
|
+
themeConfigurations,
|
|
41
46
|
mode,
|
|
42
47
|
theme
|
|
43
48
|
} = getThemeConfigurations({
|
|
44
49
|
mode: propMode,
|
|
45
50
|
theme: propTheme
|
|
46
51
|
});
|
|
47
|
-
const configurations = propThemeConfigurations;
|
|
52
|
+
const configurations = propThemeConfigurations || themeConfigurations;
|
|
48
53
|
/** ** Style Handling *** */
|
|
49
54
|
|
|
50
55
|
const selector = `#${styleTagId}`;
|
|
51
56
|
const prefix = '--imlib_';
|
|
52
57
|
const configuration = useMemo(() => [configurations], [configurations]);
|
|
53
|
-
const customizedVariables = useMemo(() =>
|
|
54
|
-
const cssVariables = propThemeConfigurations ? getCustomizedCssVariables(configuration, prefix) : null;
|
|
55
|
-
return cssVariables;
|
|
56
|
-
}, [configuration, prefix, propThemeConfigurations]);
|
|
58
|
+
const customizedVariables = useMemo(() => getCustomizedCssVariables(configuration, prefix), [configuration, prefix]);
|
|
57
59
|
const wrapperDivProps = getWrapperDivProps({
|
|
58
60
|
modeKey,
|
|
59
61
|
themeKey,
|
|
@@ -62,18 +64,25 @@ export default function ThemeWrapper(props) {
|
|
|
62
64
|
});
|
|
63
65
|
/** ** Children Render Functions *** */
|
|
64
66
|
|
|
65
|
-
const renderPortal = useCallback(() => /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
const renderPortal = useCallback(() => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
66
68
|
"data-portal": MSG_ACTION_POPUP_PORTAL
|
|
67
|
-
}),
|
|
68
|
-
|
|
69
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
70
|
+
"data-portal": EDITOR_POPUP_PORTAL
|
|
71
|
+
})), []);
|
|
72
|
+
const renderStyle = useCallback(() => /*#__PURE__*/React.createElement("style", {
|
|
69
73
|
id: "zoho-im-variables"
|
|
70
|
-
}, `${selector}{${customizedVariables}}`)
|
|
74
|
+
}, `${selector}{${customizedVariables}}`), [selector, customizedVariables]);
|
|
71
75
|
const renderAssets = useCallback(() => /*#__PURE__*/React.createElement(React.Fragment, null, needThemeAssets ? /*#__PURE__*/React.createElement(ThemeAssets, null) : null, needTooltip ? /*#__PURE__*/React.createElement(TooltipWrapper, {
|
|
72
76
|
containerRef: containerRef.current,
|
|
73
77
|
customStyle: tooltipCustomStyle,
|
|
74
78
|
getContainerRef: getContainerRef
|
|
75
79
|
}) : null), [getContainerRef, needTooltip, needThemeAssets, tooltipCustomStyle]);
|
|
76
|
-
return /*#__PURE__*/React.createElement(
|
|
80
|
+
return /*#__PURE__*/React.createElement(ThemeContext.Provider, {
|
|
81
|
+
value: {
|
|
82
|
+
mode: propMode,
|
|
83
|
+
direction
|
|
84
|
+
}
|
|
85
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
77
86
|
id: styleTagId,
|
|
78
87
|
...wrapperDivProps,
|
|
79
88
|
style: {
|
|
@@ -82,7 +91,7 @@ export default function ThemeWrapper(props) {
|
|
|
82
91
|
}
|
|
83
92
|
}, renderStyle(), /*#__PURE__*/React.createElement(Container, {
|
|
84
93
|
eleRef: containerRef
|
|
85
|
-
}, children), renderPortal(), renderAssets());
|
|
94
|
+
}, children), renderPortal(), renderAssets()));
|
|
86
95
|
}
|
|
87
96
|
ThemeWrapper.propTypes = themeWrapperPropTypes;
|
|
88
97
|
ThemeWrapper.defaultProps = themeWrapperDefaultProps;
|
|
@@ -9,7 +9,7 @@ import Tooltip from '@zohodesk/components/es/Tooltip/Tooltip';
|
|
|
9
9
|
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
10
10
|
/** ** Methods *** */
|
|
11
11
|
|
|
12
|
-
import { setLibraryConfig, getLibraryConfig } from '@zohodesk/components/
|
|
12
|
+
import { setLibraryConfig, getLibraryConfig } from '@zohodesk/components/es/Provider/Config';
|
|
13
13
|
/** ** Constants *** */
|
|
14
14
|
|
|
15
15
|
import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
|
|
@@ -9,6 +9,7 @@ const themeWrapperPropTypes = {
|
|
|
9
9
|
needTooltip: PropTypes.bool,
|
|
10
10
|
themeConfigurations: PropTypes.object,
|
|
11
11
|
themeKey: PropTypes.string,
|
|
12
|
-
tooltipCustomStyle: PropTypes.object
|
|
12
|
+
tooltipCustomStyle: PropTypes.object,
|
|
13
|
+
direction: PropTypes.oneOf(['ltr', 'rtl'])
|
|
13
14
|
};
|
|
14
15
|
export default themeWrapperPropTypes;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const imIntegrationIcon = {
|
|
2
|
+
path0_color: '#ffffff40',
|
|
3
|
+
path1_color: '#fff',
|
|
4
|
+
whatsapp_color: '#24d366',
|
|
5
|
+
telegram_color: '#4fa7d8',
|
|
6
|
+
wechat_color: '#2dc100',
|
|
7
|
+
line_color: '#01b901',
|
|
8
|
+
twillio_color: '#f22f46',
|
|
9
|
+
instagram_color: 'linear-gradient(221.05deg,#933ab9 11.59%,#d12f8c 50.45%,#fdbb59 85.46%)',
|
|
10
|
+
asap_color: 'linear-gradient(180deg, #A375FF 0%, #7732FF 100%)',
|
|
11
|
+
fb_color: '#006aff'
|
|
12
|
+
};
|
|
13
|
+
export const imTtIcon = {
|
|
14
|
+
path0_color: '#ffffff40',
|
|
15
|
+
path1_color: '#fff'
|
|
16
|
+
};
|
|
17
|
+
export const messagetextColor = '#e2e4e6';
|