@zohoim/chat-components 1.1.0 → 1.1.1-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 +4 -0
- package/assets/Appearance/dark/mode/General_DarkMode.module.css +93 -0
- package/assets/Appearance/dark/themes/blue/blue_General_DarkTheme.module.css +40 -0
- package/assets/Appearance/dark/themes/green/green_General_DarkTheme.module.css +40 -0
- package/assets/Appearance/dark/themes/orange/orange_General_DarkTheme.module.css +40 -0
- package/assets/Appearance/dark/themes/red/red_General_DarkTheme.module.css +40 -0
- package/assets/Appearance/dark/themes/yellow/yellow_General_DarkTheme.module.css +40 -0
- package/assets/Appearance/light/mode/General_LightMode.module.css +93 -0
- package/assets/Appearance/light/themes/blue/blue_General_LightTheme.module.css +40 -0
- package/assets/Appearance/light/themes/green/green_General_LightTheme.module.css +40 -0
- package/assets/Appearance/light/themes/orange/orange_General_LightTheme.module.css +40 -0
- package/assets/Appearance/light/themes/red/red_General_LightTheme.module.css +40 -0
- package/assets/Appearance/light/themes/yellow/yellow_General_LightTheme.module.css +40 -0
- package/assets/Appearance/pureDark/mode/General_PureDarkMode.module.css +93 -0
- package/assets/Appearance/pureDark/themes/blue/blue_General_PureDarkTheme.module.css +40 -0
- package/assets/Appearance/pureDark/themes/green/green_General_PureDarkTheme.module.css +40 -0
- package/assets/Appearance/pureDark/themes/orange/orange_General_PureDarkTheme.module.css +40 -0
- package/assets/Appearance/pureDark/themes/red/red_General_PureDarkTheme.module.css +40 -0
- package/assets/Appearance/pureDark/themes/yellow/yellow_General_PureDarkTheme.module.css +40 -0
- package/es/ActionIconWrapper/ActionIconWrapper.js +4 -1
- package/es/AttachmentHandler/AttachmentHandler.js +3 -0
- package/es/AttachmentHandler/css/AttachmentHandler.module.css +2 -2
- package/es/AttachmentPreviewBody/css/AttachmentPreviewBody.module.css +4 -8
- package/es/AttachmentPreviewHeader/css/AttachmentPreviewHeader.module.css +4 -4
- package/es/Emoji/Emoji.js +4 -1
- package/es/EmojiPopup/EmojiPopup.js +4 -1
- package/es/EmojiPopup/css/EmojiPopup.module.css +2 -2
- package/es/EmojisFooter/css/EmojisFooter.module.css +2 -2
- package/es/EmojisHeader/css/EmojisHeader.module.css +3 -3
- package/es/MessageBubble/MessageBubble.js +20 -4
- package/es/Theme/ThemeAssets.js +18 -0
- package/es/Theme/ThemeWrapper.js +7 -5
- package/es/Theme/utils/getThemeConfigurations.js +1 -55
- package/es/im/IMIntegrationIcon/css/IMIntegrationIcon.module.css +2 -2
- package/es/im/ReplyEditor/css/ReplyEditor.module.css +4 -4
- package/lib/index.js +538 -0
- package/package.json +18 -11
- package/es/Theme/themeVariables/commonThemeColorVariable.js +0 -17
- package/es/Theme/themeVariables/dark/blueTheme.js +0 -133
- package/es/Theme/themeVariables/dark/commonColorVariable.js +0 -35
- package/es/Theme/themeVariables/dark/greenTheme.js +0 -132
- package/es/Theme/themeVariables/dark/orangeTheme.js +0 -132
- package/es/Theme/themeVariables/dark/redTheme.js +0 -132
- package/es/Theme/themeVariables/dark/yellowTheme.js +0 -132
- package/es/Theme/themeVariables/light/blueTheme.js +0 -135
- package/es/Theme/themeVariables/light/commonColorVariable.js +0 -54
- package/es/Theme/themeVariables/light/greenTheme.js +0 -131
- package/es/Theme/themeVariables/light/orangeTheme.js +0 -131
- package/es/Theme/themeVariables/light/redTheme.js +0 -131
- package/es/Theme/themeVariables/light/yellowTheme.js +0 -131
- package/es/Theme/themeVariables/pureDark/blueTheme.js +0 -132
- package/es/Theme/themeVariables/pureDark/commonColorVariable.js +0 -37
- package/es/Theme/themeVariables/pureDark/greenTheme.js +0 -132
- package/es/Theme/themeVariables/pureDark/orangeTheme.js +0 -132
- package/es/Theme/themeVariables/pureDark/redTheme.js +0 -132
- package/es/Theme/themeVariables/pureDark/yellowTheme.js +0 -132
package/es/Theme/ThemeAssets.js
CHANGED
|
@@ -67,6 +67,24 @@ import '@zohodesk/variables/assets/fontsizeVariables.module.css';
|
|
|
67
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";
|
|
70
88
|
export default function DeskAssets(props) {
|
|
71
89
|
const {
|
|
72
90
|
children
|
package/es/Theme/ThemeWrapper.js
CHANGED
|
@@ -42,20 +42,22 @@ export default function ThemeWrapper(props) {
|
|
|
42
42
|
/** ** ThemeConfigurations Handling *** */
|
|
43
43
|
|
|
44
44
|
const {
|
|
45
|
-
themeConfigurations,
|
|
46
45
|
mode,
|
|
47
46
|
theme
|
|
48
47
|
} = getThemeConfigurations({
|
|
49
48
|
mode: propMode,
|
|
50
49
|
theme: propTheme
|
|
51
50
|
});
|
|
52
|
-
const configurations = propThemeConfigurations
|
|
51
|
+
const configurations = propThemeConfigurations;
|
|
53
52
|
/** ** Style Handling *** */
|
|
54
53
|
|
|
55
54
|
const selector = `#${styleTagId}`;
|
|
56
55
|
const prefix = '--imlib_';
|
|
57
56
|
const configuration = useMemo(() => [configurations], [configurations]);
|
|
58
|
-
const customizedVariables = useMemo(() =>
|
|
57
|
+
const customizedVariables = useMemo(() => {
|
|
58
|
+
const cssVariables = propThemeConfigurations ? getCustomizedCssVariables(configuration, prefix) : null;
|
|
59
|
+
return cssVariables;
|
|
60
|
+
}, [configuration, prefix, propThemeConfigurations]);
|
|
59
61
|
const wrapperDivProps = getWrapperDivProps({
|
|
60
62
|
modeKey,
|
|
61
63
|
themeKey,
|
|
@@ -71,9 +73,9 @@ export default function ThemeWrapper(props) {
|
|
|
71
73
|
}), /*#__PURE__*/React.createElement("div", {
|
|
72
74
|
"data-portal": EDITOR_POPUP_TARGET_PORTAL
|
|
73
75
|
})), []);
|
|
74
|
-
const renderStyle = useCallback(() => /*#__PURE__*/React.createElement("style", {
|
|
76
|
+
const renderStyle = useCallback(() => customizedVariables ? /*#__PURE__*/React.createElement("style", {
|
|
75
77
|
id: "zoho-im-variables"
|
|
76
|
-
}, `${selector}{${customizedVariables}}`), [selector, customizedVariables]);
|
|
78
|
+
}, `${selector}{${customizedVariables}}`) : null, [selector, customizedVariables]);
|
|
77
79
|
const renderAssets = useCallback(() => /*#__PURE__*/React.createElement(React.Fragment, null, needThemeAssets ? /*#__PURE__*/React.createElement(ThemeAssets, null) : null, needTooltip ? /*#__PURE__*/React.createElement(TooltipWrapper, {
|
|
78
80
|
containerRef: containerRef.current,
|
|
79
81
|
customStyle: tooltipCustomStyle,
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
import { modeConstants, themeConstants } from '@zohoim/chat-components-utils/es/constants/themeConstants';
|
|
2
|
-
import lightBlue from "../themeVariables/light/blueTheme";
|
|
3
|
-
import lightGreen from "../themeVariables/light/greenTheme";
|
|
4
|
-
import lightOrange from "../themeVariables/light/orangeTheme";
|
|
5
|
-
import lightRed from "../themeVariables/light/redTheme";
|
|
6
|
-
import lightYellow from "../themeVariables/light/yellowTheme";
|
|
7
|
-
import darkBlue from "../themeVariables/dark/blueTheme";
|
|
8
|
-
import darkGreen from "../themeVariables/dark/greenTheme";
|
|
9
|
-
import darkOrange from "../themeVariables/dark/orangeTheme";
|
|
10
|
-
import darkRed from "../themeVariables/dark/redTheme";
|
|
11
|
-
import darkYellow from "../themeVariables/dark/yellowTheme";
|
|
12
|
-
import pureDarkBlue from "../themeVariables/pureDark/blueTheme";
|
|
13
|
-
import pureDarkGreen from "../themeVariables/pureDark/greenTheme";
|
|
14
|
-
import pureDarkOrange from "../themeVariables/pureDark/orangeTheme";
|
|
15
|
-
import pureDarkRed from "../themeVariables/pureDark/redTheme";
|
|
16
|
-
import pureDarkYellow from "../themeVariables/pureDark/yellowTheme";
|
|
17
2
|
const modeMapping = {
|
|
18
3
|
[modeConstants.LIGHT]: 'light',
|
|
19
4
|
[modeConstants.DARK]: 'dark',
|
|
@@ -26,56 +11,17 @@ const themeMapping = {
|
|
|
26
11
|
[themeConstants.RED]: 'red',
|
|
27
12
|
[themeConstants.YELLOW]: 'yellow'
|
|
28
13
|
};
|
|
29
|
-
const concatString = '_';
|
|
30
14
|
const defaultTheme = themeMapping[themeConstants.BLUE];
|
|
31
15
|
const defaultMode = modeMapping[modeConstants.LIGHT];
|
|
32
|
-
const defaultThemeConfiguration = lightBlue;
|
|
33
|
-
const themeConfigMapping = {
|
|
34
|
-
[`${modeConstants.LIGHT}${concatString}${themeConstants.BLUE}`]: lightBlue,
|
|
35
|
-
[`${modeConstants.LIGHT}${concatString}${themeConstants.GREEN}`]: lightGreen,
|
|
36
|
-
[`${modeConstants.LIGHT}${concatString}${themeConstants.ORANGE}`]: lightOrange,
|
|
37
|
-
[`${modeConstants.LIGHT}${concatString}${themeConstants.RED}`]: lightRed,
|
|
38
|
-
[`${modeConstants.LIGHT}${concatString}${themeConstants.YELLOW}`]: lightYellow,
|
|
39
|
-
[`${modeConstants.DARK}${concatString}${themeConstants.BLUE}`]: darkBlue,
|
|
40
|
-
[`${modeConstants.DARK}${concatString}${themeConstants.GREEN}`]: darkGreen,
|
|
41
|
-
[`${modeConstants.DARK}${concatString}${themeConstants.ORANGE}`]: darkOrange,
|
|
42
|
-
[`${modeConstants.DARK}${concatString}${themeConstants.RED}`]: darkRed,
|
|
43
|
-
[`${modeConstants.DARK}${concatString}${themeConstants.YELLOW}`]: darkYellow,
|
|
44
|
-
[`${modeConstants.PURE_DARK}${concatString}${themeConstants.BLUE}`]: pureDarkBlue,
|
|
45
|
-
[`${modeConstants.PURE_DARK}${concatString}${themeConstants.GREEN}`]: pureDarkGreen,
|
|
46
|
-
[`${modeConstants.PURE_DARK}${concatString}${themeConstants.ORANGE}`]: pureDarkOrange,
|
|
47
|
-
[`${modeConstants.PURE_DARK}${concatString}${themeConstants.RED}`]: pureDarkRed,
|
|
48
|
-
[`${modeConstants.PURE_DARK}${concatString}${themeConstants.YELLOW}`]: pureDarkYellow
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
function getThemeName() {
|
|
52
|
-
let {
|
|
53
|
-
mode = modeConstants.LIGHT,
|
|
54
|
-
theme = themeConstants.BLUE
|
|
55
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
56
|
-
const themeName = `${mode}${concatString}${theme}`;
|
|
57
|
-
return {
|
|
58
|
-
themeName
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
16
|
export default function getThemeConfigurations(_ref) {
|
|
63
17
|
let {
|
|
64
18
|
mode: propMode,
|
|
65
19
|
theme: propTheme
|
|
66
20
|
} = _ref;
|
|
67
|
-
const {
|
|
68
|
-
themeName
|
|
69
|
-
} = getThemeName({
|
|
70
|
-
mode: propMode,
|
|
71
|
-
theme: propTheme
|
|
72
|
-
});
|
|
73
21
|
const mode = propMode ? modeMapping[propMode] || propMode : defaultMode;
|
|
74
22
|
const theme = propTheme ? themeMapping[propTheme] || propTheme : defaultTheme;
|
|
75
|
-
const themeConfigurations = themeConfigMapping[themeName] || defaultThemeConfiguration;
|
|
76
23
|
return {
|
|
77
24
|
mode,
|
|
78
|
-
theme
|
|
79
|
-
themeConfigurations
|
|
25
|
+
theme
|
|
80
26
|
};
|
|
81
27
|
}
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
.fontIcon :global .path1::before {
|
|
67
|
-
color: var(--imlib_chat_components_imIntegrationIcon_path0_color);
|
|
67
|
+
color: var(--imlib_chat_components_imIntegrationIcon_path0_color) !important;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
.fontIcon :global .path2::before {
|
|
71
|
-
color: var(--imlib_chat_components_imIntegrationIcon_path1_color);
|
|
71
|
+
color: var(--imlib_chat_components_imIntegrationIcon_path1_color) !important;
|
|
72
72
|
}
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
font-family: var(--zd_regular) !important;
|
|
25
25
|
line-height: 22px !important;
|
|
26
26
|
|
|
27
|
-
--rte-text-color: var(--
|
|
28
|
-
--rte-bg-color: var(--
|
|
27
|
+
--rte-text-color: var(--imlib_chat_components_reply_editor_color) !important;
|
|
28
|
+
--rte-bg-color: var(--imlib_chat_components_reply_editor_bg) !important;
|
|
29
29
|
--rte-placeholder-color: var(
|
|
30
|
-
--
|
|
30
|
+
--imlib_chat_components_reply_editor_placeholder_color
|
|
31
31
|
) !important;
|
|
32
32
|
--rte-link-text-color: var(
|
|
33
33
|
--imlib_chat_components_replyEditor_color
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
|
|
36
36
|
padding: var(--zd_size16) !important;
|
|
37
37
|
cursor: text !important;
|
|
38
|
-
}
|
|
38
|
+
}
|
|
39
39
|
|
|
40
40
|
.editorWrapper {
|
|
41
41
|
/** ** Use this class for css customisations *** */
|