@zohoim/chat-components 1.0.11 → 1.1.0-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.
Files changed (154) hide show
  1. package/README.md +8 -0
  2. package/assets/Appearance/dark/mode/General_DarkMode.module.css +93 -0
  3. package/assets/Appearance/dark/themes/blue/blue_General_DarkTheme.module.css +40 -0
  4. package/assets/Appearance/dark/themes/green/green_General_DarkTheme.module.css +40 -0
  5. package/assets/Appearance/dark/themes/orange/orange_General_DarkTheme.module.css +40 -0
  6. package/assets/Appearance/dark/themes/red/red_General_DarkTheme.module.css +40 -0
  7. package/assets/Appearance/dark/themes/yellow/yellow_General_DarkTheme.module.css +40 -0
  8. package/assets/Appearance/light/mode/General_LightMode.module.css +93 -0
  9. package/assets/Appearance/light/themes/blue/blue_General_LightTheme.module.css +40 -0
  10. package/assets/Appearance/light/themes/green/green_General_LightTheme.module.css +40 -0
  11. package/assets/Appearance/light/themes/orange/orange_General_LightTheme.module.css +40 -0
  12. package/assets/Appearance/light/themes/red/red_General_LightTheme.module.css +40 -0
  13. package/assets/Appearance/light/themes/yellow/yellow_General_LightTheme.module.css +40 -0
  14. package/assets/Appearance/pureDark/mode/General_PureDarkMode.module.css +93 -0
  15. package/assets/Appearance/pureDark/themes/blue/blue_General_PureDarkTheme.module.css +40 -0
  16. package/assets/Appearance/pureDark/themes/green/green_General_PureDarkTheme.module.css +40 -0
  17. package/assets/Appearance/pureDark/themes/orange/orange_General_PureDarkTheme.module.css +40 -0
  18. package/assets/Appearance/pureDark/themes/red/red_General_PureDarkTheme.module.css +40 -0
  19. package/assets/Appearance/pureDark/themes/yellow/yellow_General_PureDarkTheme.module.css +40 -0
  20. package/es/AttachmentHandler/AttachmentHandler.js +84 -0
  21. package/es/AttachmentHandler/css/AttachmentHandler.module.css +27 -0
  22. package/es/AttachmentHandler/index.js +1 -0
  23. package/es/AttachmentHandler/props/defaultProps.js +10 -0
  24. package/es/AttachmentHandler/props/propTypes.js +17 -0
  25. package/es/AttachmentPreview/AttachmentPreview.js +121 -0
  26. package/es/AttachmentPreview/css/AttachmentPreview.module.css +39 -0
  27. package/es/AttachmentPreview/index.js +1 -0
  28. package/es/AttachmentPreview/props/defaultProps.js +9 -0
  29. package/es/AttachmentPreview/props/propTypes.js +33 -0
  30. package/es/AttachmentPreviewBody/AttachmentPreviewBody.js +97 -0
  31. package/es/AttachmentPreviewBody/css/AttachmentPreviewBody.module.css +71 -0
  32. package/es/AttachmentPreviewBody/index.js +1 -0
  33. package/es/AttachmentPreviewBody/props/defaultProps.js +7 -0
  34. package/es/AttachmentPreviewBody/props/propTypes.js +20 -0
  35. package/es/AttachmentPreviewHeader/AttachmentPreviewHeader.js +84 -0
  36. package/es/AttachmentPreviewHeader/css/AttachmentPreviewHeader.module.css +47 -0
  37. package/es/AttachmentPreviewHeader/index.js +1 -0
  38. package/es/AttachmentPreviewHeader/props/defaultProps.js +7 -0
  39. package/es/AttachmentPreviewHeader/props/propTypes.js +16 -0
  40. package/es/Emoji/Emoji.js +72 -0
  41. package/es/Emoji/css/Emoji.module.css +48 -0
  42. package/es/Emoji/css/cssJSLogic.js +18 -0
  43. package/es/Emoji/index.js +1 -0
  44. package/es/Emoji/props/defaultProps.js +8 -0
  45. package/es/Emoji/props/propTypes.js +16 -0
  46. package/es/EmojiPopup/EmojiPopup.js +115 -0
  47. package/es/EmojiPopup/css/EmojiPopup.module.css +55 -0
  48. package/es/EmojiPopup/index.js +1 -0
  49. package/es/EmojiPopup/props/defaultProps.js +11 -0
  50. package/es/EmojiPopup/props/propTypes.js +21 -0
  51. package/es/Emojis/Emojis.js +81 -0
  52. package/es/Emojis/index.js +1 -0
  53. package/es/Emojis/props/defaultProps.js +10 -0
  54. package/es/Emojis/props/propTypes.js +20 -0
  55. package/es/EmojisEmptyState/EmojisEmptyState.js +50 -0
  56. package/es/EmojisEmptyState/css/EmojisEmptyState.module.css +18 -0
  57. package/es/EmojisEmptyState/index.js +1 -0
  58. package/es/EmojisEmptyState/props/defaultProps.js +9 -0
  59. package/es/EmojisEmptyState/props/propTypes.js +8 -0
  60. package/es/EmojisFooter/EmojisFooter.js +71 -0
  61. package/es/EmojisFooter/css/EmojisFooter.module.css +40 -0
  62. package/es/EmojisFooter/index.js +1 -0
  63. package/es/EmojisFooter/props/defaultProps.js +7 -0
  64. package/es/EmojisFooter/props/propTypes.js +12 -0
  65. package/es/EmojisHeader/EmojisHeader.js +65 -0
  66. package/es/EmojisHeader/css/EmojisHeader.module.css +36 -0
  67. package/es/EmojisHeader/index.js +1 -0
  68. package/es/EmojisHeader/props/defaultProps.js +8 -0
  69. package/es/EmojisHeader/props/propTypes.js +13 -0
  70. package/es/EmojisList/EmojisList.js +130 -0
  71. package/es/EmojisList/css/EmojisList.module.css +50 -0
  72. package/es/EmojisList/css/cssJSLogic.js +25 -0
  73. package/es/EmojisList/index.js +1 -0
  74. package/es/EmojisList/props/defaultProps.js +10 -0
  75. package/es/EmojisList/props/propTypes.js +20 -0
  76. package/es/MessageActionsMore/MessageActionsMore.js +2 -2
  77. package/es/MessageActionsMore/props/propTypes.js +5 -2
  78. package/es/MessageActionsWrapper/MessageActionsWrapper.js +1 -1
  79. package/es/Theme/ThemeAssets.js +20 -2
  80. package/es/Theme/ThemeWrapper.js +27 -12
  81. package/es/Theme/TooltipWrapper.js +1 -1
  82. package/es/Theme/props/defaultProps.js +2 -1
  83. package/es/Theme/props/propTypes.js +2 -1
  84. package/es/Theme/utils/getThemeConfigurations.js +2 -56
  85. package/es/constants/index.js +8 -1
  86. package/es/constants/propConstants/editorPropConstants.js +3 -0
  87. package/es/constants/propConstants/popupPropConstants.js +2 -0
  88. package/es/im/IMAttachmentHandler/IMAttachmentHandler.js +50 -0
  89. package/es/im/IMAttachmentHandler/index.js +1 -0
  90. package/es/im/IMAttachmentHandler/props/defaultProps.js +10 -0
  91. package/es/im/IMAttachmentHandler/props/propTypes.js +28 -0
  92. package/es/im/IMIntegrationIcon/css/IMIntegrationIcon.module.css +2 -2
  93. package/es/im/ReplyComposer/ReplyComposer.js +153 -0
  94. package/es/im/ReplyComposer/css/ReplyComposer.module.css +10 -0
  95. package/es/im/ReplyComposer/css/cssJSLogic.js +13 -0
  96. package/es/im/ReplyComposer/index.js +1 -0
  97. package/es/im/ReplyComposer/props/defaultProps.js +7 -0
  98. package/es/im/ReplyComposer/props/propTypes.js +60 -0
  99. package/es/im/ReplyComposerFooter/ReplyComposerFooter.js +41 -0
  100. package/es/im/ReplyComposerFooter/css/ReplyComposerFooter.module.css +10 -0
  101. package/es/im/ReplyComposerFooter/index.js +1 -0
  102. package/es/im/ReplyComposerFooter/props/defaultProps.js +8 -0
  103. package/es/im/ReplyComposerFooter/props/propTypes.js +17 -0
  104. package/es/im/ReplyEditor/ReplyEditor.js +103 -0
  105. package/es/im/ReplyEditor/css/ReplyEditor.module.css +50 -0
  106. package/es/im/ReplyEditor/css/cssJSLogic.js +10 -0
  107. package/es/im/ReplyEditor/index.js +1 -0
  108. package/es/im/ReplyEditor/props/defaultProps.js +8 -0
  109. package/es/im/ReplyEditor/props/propTypes.js +27 -0
  110. package/es/im/ReplyEditorExtensions/ReplyEditorExtensions.js +149 -0
  111. package/es/im/ReplyEditorExtensions/css/ReplyEditorExtensions.module.css +5 -0
  112. package/es/im/ReplyEditorExtensions/index.js +1 -0
  113. package/es/im/ReplyEditorExtensions/props/defaultProps.js +6 -0
  114. package/es/im/ReplyEditorExtensions/props/propTypes.js +16 -0
  115. package/es/im/ReplyEditorSuggestions/ReplyEditorSuggestions.js +95 -0
  116. package/es/im/ReplyEditorSuggestions/css/ReplyEditorSuggestions.module.css +8 -0
  117. package/es/im/ReplyEditorSuggestions/index.js +1 -0
  118. package/es/im/ReplyEditorSuggestions/props/defaultProps.js +6 -0
  119. package/es/im/ReplyEditorSuggestions/props/propTypes.js +21 -0
  120. package/es/im/ReplyEditorSuggestionsPopup/ReplyEditorSuggestionsPopup.js +93 -0
  121. package/es/im/ReplyEditorSuggestionsPopup/css/ReplyEditorSuggestionsPopup.module.css +7 -0
  122. package/es/im/ReplyEditorSuggestionsPopup/index.js +1 -0
  123. package/es/im/ReplyEditorSuggestionsPopup/props/defaultProps.js +10 -0
  124. package/es/im/ReplyEditorSuggestionsPopup/props/propTypes.js +21 -0
  125. package/es/im/index.js +8 -1
  126. package/es/index.js +13 -2
  127. package/es/rte/Editor/Editor.js +80 -0
  128. package/es/rte/Editor/css/Editor.module.css +17 -0
  129. package/es/rte/Editor/index.js +1 -0
  130. package/es/rte/Editor/props/defaultProps.js +21 -0
  131. package/es/rte/Editor/props/propTypes.js +52 -0
  132. package/es/rte/index.js +1 -0
  133. package/lib/index.js +538 -0
  134. package/package.json +21 -14
  135. package/es/Theme/constants/index.js +0 -41
  136. package/es/Theme/themeVariables/commonThemeColorVariable.js +0 -17
  137. package/es/Theme/themeVariables/dark/blueTheme.js +0 -116
  138. package/es/Theme/themeVariables/dark/commonColorVariable.js +0 -16
  139. package/es/Theme/themeVariables/dark/greenTheme.js +0 -115
  140. package/es/Theme/themeVariables/dark/orangeTheme.js +0 -115
  141. package/es/Theme/themeVariables/dark/redTheme.js +0 -115
  142. package/es/Theme/themeVariables/dark/yellowTheme.js +0 -115
  143. package/es/Theme/themeVariables/light/blueTheme.js +0 -114
  144. package/es/Theme/themeVariables/light/commonColorVariable.js +0 -35
  145. package/es/Theme/themeVariables/light/greenTheme.js +0 -114
  146. package/es/Theme/themeVariables/light/orangeTheme.js +0 -114
  147. package/es/Theme/themeVariables/light/redTheme.js +0 -114
  148. package/es/Theme/themeVariables/light/yellowTheme.js +0 -114
  149. package/es/Theme/themeVariables/pureDark/blueTheme.js +0 -115
  150. package/es/Theme/themeVariables/pureDark/commonColorVariable.js +0 -18
  151. package/es/Theme/themeVariables/pureDark/greenTheme.js +0 -115
  152. package/es/Theme/themeVariables/pureDark/orangeTheme.js +0 -115
  153. package/es/Theme/themeVariables/pureDark/redTheme.js +0 -115
  154. package/es/Theme/themeVariables/pureDark/yellowTheme.js +0 -115
@@ -0,0 +1,130 @@
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
+ isAllEmpty,
49
+ isGroupEmpty,
50
+ isRenderEmptyState,
51
+ isRenderElement
52
+ } = useEmojisList({
53
+ emojisList: propsEmojisList,
54
+ searchString,
55
+ isShowGroupBasedList,
56
+ onChangeGroup,
57
+ getMethods,
58
+ selectedGroup,
59
+ isShowOnlyContent
60
+ });
61
+ /* External customization */
62
+
63
+ const newStyle = useMergeStyle(style, customStyle);
64
+ /* CSS classnames added based on logic */
65
+
66
+ const {
67
+ emojisListClass,
68
+ groupClass
69
+ } = cssJSLogic({
70
+ rowType,
71
+ isShowGroupBasedList,
72
+ isShowOnlyContent,
73
+ isEmpty: isAllEmpty
74
+ }, newStyle);
75
+ const renderGroup = useCallback(_ref => {
76
+ let {
77
+ groupName,
78
+ emojis
79
+ } = _ref;
80
+ const isEmptyGroup = isGroupEmpty[groupName];
81
+ return !isEmptyGroup ? /*#__PURE__*/React.createElement("div", {
82
+ key: groupName,
83
+ ref: el => {
84
+ setGroupRefs(el, groupName);
85
+ },
86
+ className: groupClass
87
+ }, isShowGroupBasedList ? /*#__PURE__*/React.createElement("div", {
88
+ className: newStyle.groupName
89
+ }, groupName) : null, Object.keys(emojis).map(emojiName => {
90
+ const emoji = emojis[emojiName];
91
+ const id = `emoji_${emojiName}`;
92
+ return /*#__PURE__*/React.createElement(Emoji, {
93
+ key: id,
94
+ emoji: emoji,
95
+ emojiName: emojiName,
96
+ onSelect: onSelect,
97
+ ...emojiProps
98
+ });
99
+ })) : null;
100
+ }, [emojiProps, isGroupEmpty, groupClass, isShowGroupBasedList, newStyle.groupName, onSelect, setGroupRefs]);
101
+ const renderDefaultEmptyState = useCallback(() => /*#__PURE__*/React.createElement(EmojisEmptyState, { ...emojisEmptyStateProps
102
+ }), [emojisEmptyStateProps]);
103
+ const renderEmptyState = useCallback(() => {
104
+ /* Render EmptyState */
105
+ if (isRenderEmptyState) {
106
+ const emptyState = renderHandler(renderEmpty || renderDefaultEmptyState)();
107
+
108
+ if (emptyState) {
109
+ return emptyState;
110
+ }
111
+
112
+ return null;
113
+ }
114
+
115
+ return null;
116
+ }, [renderEmpty, renderDefaultEmptyState, isRenderEmptyState]);
117
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isRenderElement ? /*#__PURE__*/React.createElement("div", {
118
+ ref: listContainerRef,
119
+ className: emojisListClass
120
+ }, !isAllEmpty ? Object.keys(emojisList).map(groupName => {
121
+ const emojis = emojisList[groupName];
122
+ return renderGroup({
123
+ groupName,
124
+ emojis
125
+ });
126
+ }) : renderEmptyState()) : null);
127
+ }
128
+ EmojisList.propTypes = emojisListPropTypes;
129
+ EmojisList.defaultProps = emojisListDefaultProps;
130
+ 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/lib/Popup/Popup';
6
- import DropBox from '@zohodesk/components/lib/DropBox/DropBox';
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,
@@ -8,7 +11,7 @@ const messageActionsMorePropTypes = {
8
11
  renderMoreIcon: PropTypes.func.isRequired,
9
12
  setRetainMessageActions: PropTypes.func,
10
13
  customStyle: PropTypes.object,
11
- popupSize: PropTypes.oneOf(['mini', 'xmini', 'xsmall', 'small', 'medium', 'large', 'mlarge', 'xlarge', 'xxlarge', 'default']),
12
- defaultPopupPosition: PropTypes.oneOf([['bottomCenter', 'bottomLeftToRight', 'bottomCenterToRight', 'bottomRightToLeft', 'bottomCenterToLeft', 'topCenter', 'topLeftToRight', 'topCenterToRight', 'topRightToLeft', 'topCenterToLeft', 'rightTopToBottom', 'rightCenterToBottom', 'rightCenter', 'rightBottomToTop', 'rightCenterToTop', 'leftTopToBottom', 'leftCenterToBottom', 'leftCenter', 'leftBottomToTop', 'leftCenterToTop', 'bottomRight', 'bottomLeft', 'topRight', 'topLeft', 'rightBottom', 'rightTop', 'leftBottom', 'leftTop']])
14
+ popupSize: PropTypes.oneOf(popupSize),
15
+ defaultPopupPosition: PropTypes.oneOf(popupPosition)
13
16
  };
14
17
  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/lib/Layout';
5
+ import { Container } from '@zohodesk/components/es/Layout';
6
6
  import MessageActionsMore from "../MessageActionsMore/MessageActionsMore";
7
7
  /** ** Hooks *** */
8
8
 
@@ -1,6 +1,6 @@
1
1
  /** ** Libraries *** */
2
2
  import PropTypes from 'prop-types';
3
- import '@zohodesk/components/lib/common/boxShadow.module.css';
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,9 +64,27 @@ 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/lib/fontFamilyVariables.module.css';
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
@@ -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 "./constants";
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, EDITOR_POPUP_TARGET_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,20 +42,22 @@ export default function ThemeWrapper(props) {
38
42
  /** ** ThemeConfigurations Handling *** */
39
43
 
40
44
  const {
41
- themeConfigurations,
42
45
  mode,
43
46
  theme
44
47
  } = getThemeConfigurations({
45
48
  mode: propMode,
46
49
  theme: propTheme
47
50
  });
48
- const configurations = propThemeConfigurations || themeConfigurations;
51
+ const configurations = propThemeConfigurations;
49
52
  /** ** Style Handling *** */
50
53
 
51
54
  const selector = `#${styleTagId}`;
52
55
  const prefix = '--imlib_';
53
56
  const configuration = useMemo(() => [configurations], [configurations]);
54
- const customizedVariables = useMemo(() => getCustomizedCssVariables(configuration, prefix), [configuration, prefix]);
57
+ const customizedVariables = useMemo(() => {
58
+ const cssVariables = propThemeConfigurations ? getCustomizedCssVariables(configuration, prefix) : null;
59
+ return cssVariables;
60
+ }, [configuration, prefix, propThemeConfigurations]);
55
61
  const wrapperDivProps = getWrapperDivProps({
56
62
  modeKey,
57
63
  themeKey,
@@ -60,18 +66,27 @@ export default function ThemeWrapper(props) {
60
66
  });
61
67
  /** ** Children Render Functions *** */
62
68
 
63
- const renderPortal = useCallback(() => /*#__PURE__*/React.createElement("div", {
69
+ const renderPortal = useCallback(() => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
64
70
  "data-portal": MSG_ACTION_POPUP_PORTAL
65
- }), []);
66
- const renderStyle = useCallback(() => /*#__PURE__*/React.createElement("style", {
71
+ }), /*#__PURE__*/React.createElement("div", {
72
+ "data-portal": EDITOR_POPUP_PORTAL
73
+ }), /*#__PURE__*/React.createElement("div", {
74
+ "data-portal": EDITOR_POPUP_TARGET_PORTAL
75
+ })), []);
76
+ const renderStyle = useCallback(() => customizedVariables ? /*#__PURE__*/React.createElement("style", {
67
77
  id: "zoho-im-variables"
68
- }, `${selector}{${customizedVariables}}`), [selector, customizedVariables]);
78
+ }, `${selector}{${customizedVariables}}`) : null, [selector, customizedVariables]);
69
79
  const renderAssets = useCallback(() => /*#__PURE__*/React.createElement(React.Fragment, null, needThemeAssets ? /*#__PURE__*/React.createElement(ThemeAssets, null) : null, needTooltip ? /*#__PURE__*/React.createElement(TooltipWrapper, {
70
80
  containerRef: containerRef.current,
71
81
  customStyle: tooltipCustomStyle,
72
82
  getContainerRef: getContainerRef
73
83
  }) : null), [getContainerRef, needTooltip, needThemeAssets, tooltipCustomStyle]);
74
- return /*#__PURE__*/React.createElement("div", {
84
+ return /*#__PURE__*/React.createElement(ThemeContext.Provider, {
85
+ value: {
86
+ mode: propMode,
87
+ direction
88
+ }
89
+ }, /*#__PURE__*/React.createElement("div", {
75
90
  id: styleTagId,
76
91
  ...wrapperDivProps,
77
92
  style: {
@@ -80,7 +95,7 @@ export default function ThemeWrapper(props) {
80
95
  }
81
96
  }, renderStyle(), /*#__PURE__*/React.createElement(Container, {
82
97
  eleRef: containerRef
83
- }, children), renderPortal(), renderAssets());
98
+ }, children), renderPortal(), renderAssets()));
84
99
  }
85
100
  ThemeWrapper.propTypes = themeWrapperPropTypes;
86
101
  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/lib/Provider/Config';
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';
@@ -5,6 +5,7 @@ const themeWrapperDefaultProps = {
5
5
  mode: 'LIGHT',
6
6
  theme: 'BLUE',
7
7
  needTooltip: true,
8
- tooltipCustomStyle: dummyObject
8
+ tooltipCustomStyle: dummyObject,
9
+ direction: 'ltr'
9
10
  };
10
11
  export default themeWrapperDefaultProps;
@@ -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;
@@ -1,19 +1,4 @@
1
- import { modeConstants, themeConstants } from "../constants";
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";
1
+ import { modeConstants, themeConstants } from '@zohoim/chat-components-utils/es/constants/themeConstants';
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
  }
@@ -1 +1,8 @@
1
- export const MSG_ACTION_POPUP_PORTAL = 'MSG_ACTION_POPUP_PORTAL';
1
+ export const MSG_ACTION_POPUP_PORTAL = 'MSG_ACTION_POPUP_PORTAL';
2
+ export const EDITOR_POPUP_PORTAL = 'EDITOR_POPUP_PORTAL';
3
+ export const EDITOR_POPUP_TARGET_PORTAL = 'EDITOR_POPUP_TARGET_PORTAL';
4
+ const version = '1.4.9';
5
+ export const defaultEditorURL = // `https://static.localzohocdn.com/rtelibrary/${version}/js/rte.js`;
6
+ // `https://static.zohocdn.com/rtelibrary/${version}/js/rte.js`;
7
+ // `https://static.localzohocdn.com/rtelibrary/${version}/js/rte.min.js`;
8
+ `https://static.zohocdn.com/rtelibrary/${version}/js/rte.min.js`;
@@ -0,0 +1,3 @@
1
+ export const formats = ['strong', 'em', 'underline', 'link', 'strikeThrough', 'align', 'fontSize', 'fontFamily', 'fontColor', 'highlight', 'script', 'lineHeight', 'direction', 'headings', 'clearFormatting', 'inlineQuote', 'indent', 'formatPainter'];
2
+ export const features = ['hr', 'images', 'tables', 'list', 'code_block', 'video', 'blockquote', 'embed', 'html'];
3
+ export const langCode = ['en_US', 'ar', 'as', 'bg', 'bn', 'brx', 'ca', 'cs', 'da', 'de', 'doi', 'el', 'es', 'et', 'fi', 'fr', 'ga', 'gu', 'hi', 'hr', 'hu', 'id', 'in', 'it', 'iw', 'ja', 'kn', 'ko', 'kok', 'ks', 'lt', 'mai', 'ml', 'mni', 'mr', 'ms', 'my', 'ne', 'nl', 'no', 'or', 'pa', 'pl', 'pt_BR', 'pt', 'ro', 'ru', 'sa', 'sat', 'sd', 'si', 'sk', 'sv', 'ta', 'te', 'th', 'tr', 'uk', 'ur', 'vi', 'zh_CN', 'zh_HK', 'zh_TW', 'zh'];
@@ -0,0 +1,2 @@
1
+ export const popupSize = ['mini', 'xmini', 'xsmall', 'small', 'medium', 'large', 'mlarge', 'xlarge', 'xxlarge', 'default'];
2
+ export const popupPosition = ['bottomCenter', 'bottomLeftToRight', 'bottomCenterToRight', 'bottomRightToLeft', 'bottomCenterToLeft', 'topCenter', 'topLeftToRight', 'topCenterToRight', 'topRightToLeft', 'topCenterToLeft', 'rightTopToBottom', 'rightCenterToBottom', 'rightCenter', 'rightBottomToTop', 'rightCenterToTop', 'leftTopToBottom', 'leftCenterToBottom', 'leftCenter', 'leftBottomToTop', 'leftCenterToTop', 'bottomRight', 'bottomLeft', 'topRight', 'topLeft', 'rightBottom', 'rightTop', 'leftBottom', 'leftTop'];
@@ -0,0 +1,50 @@
1
+ /** ** Libraries *** */
2
+ import React from 'react';
3
+ /** ** Components *** */
4
+
5
+ import AttachmentHandler from "../../AttachmentHandler/AttachmentHandler";
6
+ /** ** Hooks *** */
7
+
8
+ import useIMAttachmentHandler from '@zohoim/chat-components-hooks/es/im/IMAttachmentHandler/useIMAttachmentHandler';
9
+ /** ** Constants *** */
10
+
11
+ import imAttachmentHandlerDefaultProps from "./props/defaultProps";
12
+ import imAttachmentHandlerPropTypes from "./props/propTypes";
13
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
14
+ export default function IMAttachmentHandler(props) {
15
+ const {
16
+ customProps = dummyObject,
17
+ iconName,
18
+ iconSize,
19
+ iconTitle,
20
+ renderCustomIcon,
21
+ isMultiAttachment,
22
+ onAttach: propOnAttach,
23
+ attachmentType,
24
+ integrationService
25
+ } = props;
26
+ const {
27
+ attachmentHandlerProps = dummyObject
28
+ } = customProps;
29
+ const {
30
+ onAttach,
31
+ supportedTypes
32
+ } = useIMAttachmentHandler({
33
+ onAttach: propOnAttach,
34
+ attachmentType,
35
+ integrationService
36
+ });
37
+ return /*#__PURE__*/React.createElement(AttachmentHandler, {
38
+ iconName: iconName,
39
+ iconSize: iconSize,
40
+ iconTitle: iconTitle,
41
+ isMultiAttachment: isMultiAttachment,
42
+ onAttach: onAttach,
43
+ renderCustomIcon: renderCustomIcon,
44
+ supportedFileTypes: supportedTypes,
45
+ ...attachmentHandlerProps
46
+ });
47
+ }
48
+ IMAttachmentHandler.propTypes = imAttachmentHandlerPropTypes;
49
+ IMAttachmentHandler.defaultProps = imAttachmentHandlerDefaultProps;
50
+ IMAttachmentHandler.displayName = 'IMAttachmentHandler';
@@ -0,0 +1 @@
1
+ export { default as IMAttachmentHandler } from "./IMAttachmentHandler";
@@ -0,0 +1,10 @@
1
+ /** ** Constants *** */
2
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
3
+ const imAttachmentHandlerDefaultProps = {
4
+ customStyle: dummyObject,
5
+ iconName: 'ZD-TT-image',
6
+ iconSize: '14',
7
+ iconTitle: 'Upload',
8
+ isMultiAttachment: false
9
+ };
10
+ export default imAttachmentHandlerDefaultProps;
@@ -0,0 +1,28 @@
1
+ /** ** Libraries *** */
2
+ import PropTypes from 'prop-types';
3
+ /** ** Constants *** */
4
+
5
+ import integrationConstants from '@zohoim/chat-components-utils/es/imUtils/constants/integrationConstants';
6
+ const {
7
+ WHATSAPP,
8
+ TELEGRAM,
9
+ INSTAGRAM,
10
+ WECHAT,
11
+ TWILLIO,
12
+ LINE,
13
+ IM_TALK,
14
+ FACEBOOKMESSENGER
15
+ } = integrationConstants;
16
+ const imAttachmentHandlerPropTypes = {
17
+ customStyle: PropTypes.object,
18
+ iconName: PropTypes.string.isRequired,
19
+ iconSize: PropTypes.string,
20
+ iconTitle: PropTypes.string,
21
+ renderCustomIcon: PropTypes.func,
22
+ isMultiAttachment: PropTypes.bool,
23
+ onAttach: PropTypes.func,
24
+ customProps: PropTypes.object,
25
+ attachmentType: PropTypes.oneOf(['image', 'document', 'documentAndImage']),
26
+ integrationService: PropTypes.oneOf([WHATSAPP, TELEGRAM, INSTAGRAM, WECHAT, TWILLIO, LINE, IM_TALK, FACEBOOKMESSENGER])
27
+ };
28
+ export default imAttachmentHandlerPropTypes;
@@ -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
  }