@zohoim/chat-components 1.0.9-beta.3 → 1.0.9-beta.4

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 (138) hide show
  1. package/es/Message/Message.js +8 -2
  2. package/es/MessageActions/MessageActions.js +2 -0
  3. package/es/MessageActions/props/propTypes.js +2 -1
  4. package/es/MessageActionsMore/MessageActionsMore.js +5 -3
  5. package/es/MessageActionsMore/props/propTypes.js +3 -5
  6. package/es/MessageActionsWrapper/MessageActionsWrapper.js +7 -4
  7. package/es/MessageActionsWrapper/props/propTypes.js +2 -1
  8. package/es/MessageBubble/css/MessageBubble.module.css +0 -7
  9. package/es/MessageBubble/props/defaultProps.js +2 -1
  10. package/es/MessageBubble/props/propTypes.js +2 -1
  11. package/es/Theme/ThemeAssets.js +2 -2
  12. package/es/Theme/ThemeWrapper.js +7 -18
  13. package/es/Theme/TooltipWrapper.js +1 -1
  14. package/es/Theme/constants/index.js +41 -0
  15. package/es/Theme/props/defaultProps.js +1 -2
  16. package/es/Theme/props/propTypes.js +1 -2
  17. package/es/Theme/themeVariables/dark/blueTheme.js +1 -18
  18. package/es/Theme/themeVariables/dark/commonColorVariable.js +1 -20
  19. package/es/Theme/themeVariables/dark/greenTheme.js +1 -18
  20. package/es/Theme/themeVariables/dark/orangeTheme.js +1 -18
  21. package/es/Theme/themeVariables/dark/redTheme.js +1 -18
  22. package/es/Theme/themeVariables/dark/yellowTheme.js +1 -18
  23. package/es/Theme/themeVariables/light/blueTheme.js +1 -22
  24. package/es/Theme/themeVariables/light/commonColorVariable.js +0 -19
  25. package/es/Theme/themeVariables/light/greenTheme.js +1 -18
  26. package/es/Theme/themeVariables/light/orangeTheme.js +1 -18
  27. package/es/Theme/themeVariables/light/redTheme.js +1 -18
  28. package/es/Theme/themeVariables/light/yellowTheme.js +1 -18
  29. package/es/Theme/themeVariables/pureDark/blueTheme.js +1 -18
  30. package/es/Theme/themeVariables/pureDark/commonColorVariable.js +1 -20
  31. package/es/Theme/themeVariables/pureDark/greenTheme.js +1 -18
  32. package/es/Theme/themeVariables/pureDark/orangeTheme.js +1 -18
  33. package/es/Theme/themeVariables/pureDark/redTheme.js +1 -18
  34. package/es/Theme/themeVariables/pureDark/yellowTheme.js +1 -18
  35. package/es/Theme/utils/getThemeConfigurations.js +1 -1
  36. package/es/constants/index.js +1 -7
  37. package/es/im/index.js +1 -8
  38. package/es/index.js +2 -13
  39. package/package.json +7 -7
  40. package/es/AttachmentHandler/AttachmentHandler.js +0 -84
  41. package/es/AttachmentHandler/css/AttachmentHandler.module.css +0 -27
  42. package/es/AttachmentHandler/index.js +0 -1
  43. package/es/AttachmentHandler/props/defaultProps.js +0 -10
  44. package/es/AttachmentHandler/props/propTypes.js +0 -17
  45. package/es/AttachmentPreview/AttachmentPreview.js +0 -112
  46. package/es/AttachmentPreview/css/AttachmentPreview.module.css +0 -39
  47. package/es/AttachmentPreview/index.js +0 -1
  48. package/es/AttachmentPreview/props/defaultProps.js +0 -7
  49. package/es/AttachmentPreview/props/propTypes.js +0 -31
  50. package/es/AttachmentPreviewBody/AttachmentPreviewBody.js +0 -81
  51. package/es/AttachmentPreviewBody/css/AttachmentPreviewBody.module.css +0 -70
  52. package/es/AttachmentPreviewBody/index.js +0 -1
  53. package/es/AttachmentPreviewBody/props/defaultProps.js +0 -7
  54. package/es/AttachmentPreviewBody/props/propTypes.js +0 -20
  55. package/es/AttachmentPreviewHeader/AttachmentPreviewHeader.js +0 -84
  56. package/es/AttachmentPreviewHeader/css/AttachmentPreviewHeader.module.css +0 -47
  57. package/es/AttachmentPreviewHeader/index.js +0 -1
  58. package/es/AttachmentPreviewHeader/props/defaultProps.js +0 -7
  59. package/es/AttachmentPreviewHeader/props/propTypes.js +0 -16
  60. package/es/Emoji/Emoji.js +0 -72
  61. package/es/Emoji/css/Emoji.module.css +0 -48
  62. package/es/Emoji/css/cssJSLogic.js +0 -18
  63. package/es/Emoji/index.js +0 -1
  64. package/es/Emoji/props/defaultProps.js +0 -8
  65. package/es/Emoji/props/propTypes.js +0 -16
  66. package/es/EmojiPopup/EmojiPopup.js +0 -116
  67. package/es/EmojiPopup/css/EmojiPopup.module.css +0 -55
  68. package/es/EmojiPopup/index.js +0 -1
  69. package/es/EmojiPopup/props/defaultProps.js +0 -11
  70. package/es/EmojiPopup/props/propTypes.js +0 -21
  71. package/es/Emojis/Emojis.js +0 -81
  72. package/es/Emojis/index.js +0 -1
  73. package/es/Emojis/props/defaultProps.js +0 -10
  74. package/es/Emojis/props/propTypes.js +0 -19
  75. package/es/EmojisEmptyState/EmojisEmptyState.js +0 -50
  76. package/es/EmojisEmptyState/css/EmojisEmptyState.module.css +0 -18
  77. package/es/EmojisEmptyState/index.js +0 -1
  78. package/es/EmojisEmptyState/props/defaultProps.js +0 -9
  79. package/es/EmojisEmptyState/props/propTypes.js +0 -8
  80. package/es/EmojisFooter/EmojisFooter.js +0 -71
  81. package/es/EmojisFooter/css/EmojisFooter.module.css +0 -40
  82. package/es/EmojisFooter/index.js +0 -1
  83. package/es/EmojisFooter/props/defaultProps.js +0 -7
  84. package/es/EmojisFooter/props/propTypes.js +0 -12
  85. package/es/EmojisHeader/EmojisHeader.js +0 -65
  86. package/es/EmojisHeader/css/EmojisHeader.module.css +0 -36
  87. package/es/EmojisHeader/index.js +0 -1
  88. package/es/EmojisHeader/props/defaultProps.js +0 -8
  89. package/es/EmojisHeader/props/propTypes.js +0 -13
  90. package/es/EmojisList/EmojisList.js +0 -133
  91. package/es/EmojisList/css/EmojisList.module.css +0 -50
  92. package/es/EmojisList/css/cssJSLogic.js +0 -25
  93. package/es/EmojisList/index.js +0 -1
  94. package/es/EmojisList/props/defaultProps.js +0 -10
  95. package/es/EmojisList/props/propTypes.js +0 -20
  96. package/es/constants/propConstants/editorPropConstants.js +0 -3
  97. package/es/constants/propConstants/popupPropConstants.js +0 -2
  98. package/es/im/IMAttachmentHandler/IMAttachmentHandler.js +0 -50
  99. package/es/im/IMAttachmentHandler/index.js +0 -1
  100. package/es/im/IMAttachmentHandler/props/defaultProps.js +0 -10
  101. package/es/im/IMAttachmentHandler/props/propTypes.js +0 -28
  102. package/es/im/ReplyComposer/ReplyComposer.js +0 -137
  103. package/es/im/ReplyComposer/css/ReplyComposer.module.css +0 -5
  104. package/es/im/ReplyComposer/index.js +0 -1
  105. package/es/im/ReplyComposer/props/defaultProps.js +0 -7
  106. package/es/im/ReplyComposer/props/propTypes.js +0 -60
  107. package/es/im/ReplyComposerFooter/ReplyComposerFooter.js +0 -41
  108. package/es/im/ReplyComposerFooter/css/ReplyComposerFooter.module.css +0 -10
  109. package/es/im/ReplyComposerFooter/index.js +0 -1
  110. package/es/im/ReplyComposerFooter/props/defaultProps.js +0 -8
  111. package/es/im/ReplyComposerFooter/props/propTypes.js +0 -17
  112. package/es/im/ReplyEditor/ReplyEditor.js +0 -103
  113. package/es/im/ReplyEditor/css/ReplyEditor.module.css +0 -42
  114. package/es/im/ReplyEditor/css/cssJSLogic.js +0 -10
  115. package/es/im/ReplyEditor/index.js +0 -1
  116. package/es/im/ReplyEditor/props/defaultProps.js +0 -8
  117. package/es/im/ReplyEditor/props/propTypes.js +0 -27
  118. package/es/im/ReplyEditorExtensions/ReplyEditorExtensions.js +0 -149
  119. package/es/im/ReplyEditorExtensions/css/ReplyEditorExtensions.module.css +0 -5
  120. package/es/im/ReplyEditorExtensions/index.js +0 -1
  121. package/es/im/ReplyEditorExtensions/props/defaultProps.js +0 -6
  122. package/es/im/ReplyEditorExtensions/props/propTypes.js +0 -16
  123. package/es/im/ReplyEditorSuggestions/ReplyEditorSuggestions.js +0 -87
  124. package/es/im/ReplyEditorSuggestions/css/ReplyEditorSuggestions.module.css +0 -8
  125. package/es/im/ReplyEditorSuggestions/index.js +0 -1
  126. package/es/im/ReplyEditorSuggestions/props/defaultProps.js +0 -6
  127. package/es/im/ReplyEditorSuggestions/props/propTypes.js +0 -20
  128. package/es/im/ReplyEditorSuggestionsPopup/ReplyEditorSuggestionsPopup.js +0 -91
  129. package/es/im/ReplyEditorSuggestionsPopup/css/ReplyEditorSuggestionsPopup.module.css +0 -7
  130. package/es/im/ReplyEditorSuggestionsPopup/index.js +0 -1
  131. package/es/im/ReplyEditorSuggestionsPopup/props/defaultProps.js +0 -10
  132. package/es/im/ReplyEditorSuggestionsPopup/props/propTypes.js +0 -21
  133. package/es/rte/Editor/Editor.js +0 -80
  134. package/es/rte/Editor/css/Editor.module.css +0 -19
  135. package/es/rte/Editor/index.js +0 -1
  136. package/es/rte/Editor/props/defaultProps.js +0 -21
  137. package/es/rte/Editor/props/propTypes.js +0 -52
  138. package/es/rte/index.js +0 -1
@@ -1,31 +0,0 @@
1
- /** ** Libraries *** */
2
- import PropTypes from 'prop-types';
3
- const attachmentPreviewPropTypes = {
4
- customStyle: PropTypes.object,
5
- isDescriptionNeeded: PropTypes.bool,
6
- files: PropTypes.arrayOf(PropTypes.shape({
7
- id: PropTypes.string,
8
- name: PropTypes.string,
9
- size: PropTypes.string,
10
- type: PropTypes.string,
11
- url: PropTypes.string
12
- })).isRequired,
13
- customProps: PropTypes.shape({
14
- attachmentIconProps: PropTypes.object,
15
- cancelButtonProps: PropTypes.object,
16
- editorProps: PropTypes.object,
17
- submitButtonProps: PropTypes.object
18
- }),
19
- onSubmit: PropTypes.func,
20
- onCancel: PropTypes.func,
21
- texts: PropTypes.shape({
22
- cancelText: PropTypes.string,
23
- editText: PropTypes.string,
24
- placeHolder: PropTypes.string,
25
- submitText: PropTypes.string
26
- }).isRequired,
27
- descriptionDetails: PropTypes.object,
28
- onDescriptionChange: PropTypes.func,
29
- needCloseOnEscape: PropTypes.bool
30
- };
31
- export default attachmentPreviewPropTypes;
@@ -1,81 +0,0 @@
1
- /** ** Libraries *** */
2
- import React, { useMemo } from 'react';
3
- /** ** Components *** */
4
-
5
- import { Container } from '@zohodesk/components/es/Layout';
6
- import ReplyEditor from "../im/ReplyEditor/ReplyEditor";
7
- import AttachmentIcon from "../AttachmentIcon/AttachmentIcon";
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 attachmentPreviewBodyDefaultProps from "./props/defaultProps";
15
- import attachmentPreviewBodyPropTypes from "./props/propTypes";
16
- /** ** Styles *** */
17
-
18
- import style from "./css/AttachmentPreviewBody.module.css";
19
- export default function AttachmentPreviewBody(props) {
20
- const {
21
- customStyle,
22
- customProps,
23
- isImageFile,
24
- attachmentURL,
25
- fileFormat,
26
- mediaType,
27
- isDescriptionNeeded,
28
- description,
29
- attachmentId,
30
- onDescriptionChange,
31
- onEditorKeyDown,
32
- placeHolder,
33
- editorProps
34
- } = props;
35
- const {
36
- attachmentIconProps = dummyObject
37
- } = customProps || {};
38
- /* External customization */
39
-
40
- const newStyle = useMergeStyle(style, customStyle);
41
- const iconCustomStyle = useMemo(() => ({
42
- icon: newStyle.attachmentIcon
43
- }), [newStyle.attachmentIcon]);
44
- const editorCustomStyle = useMemo(() => ({
45
- editorWrapper: newStyle.editorWrapper,
46
- editableDiv: newStyle.editableDiv
47
- }), [newStyle.editorWrapper, newStyle.editableDiv]);
48
- const editorCustomProps = useMemo(() => ({
49
- editorProps: {
50
- needAutoFocus: true,
51
- ...editorProps
52
- }
53
- }), [editorProps]);
54
- return /*#__PURE__*/React.createElement(Container, {
55
- align: "both",
56
- alignBox: "column",
57
- className: `${newStyle.zoomContent} ${newStyle.imgContent}`
58
- }, /*#__PURE__*/React.createElement("div", {
59
- className: newStyle.fileContainer
60
- }, isImageFile ? /*#__PURE__*/React.createElement("img", {
61
- alt: "",
62
- className: newStyle.imgZoomOut,
63
- src: attachmentURL
64
- }) : /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(AttachmentIcon, {
65
- customStyle: iconCustomStyle,
66
- fileFormat: fileFormat,
67
- mediaType: mediaType,
68
- ...attachmentIconProps
69
- }))), isDescriptionNeeded ? /*#__PURE__*/React.createElement(ReplyEditor, {
70
- content: description,
71
- customProps: editorCustomProps,
72
- customStyle: editorCustomStyle,
73
- id: `${attachmentId}_Attach_Editor`,
74
- onChange: onDescriptionChange,
75
- onKeyDown: onEditorKeyDown,
76
- placeHolder: placeHolder
77
- }) : null);
78
- }
79
- AttachmentPreviewBody.propTypes = attachmentPreviewBodyPropTypes;
80
- AttachmentPreviewBody.defaultProps = attachmentPreviewBodyDefaultProps;
81
- AttachmentPreviewBody.displayName = 'AttachmentPreviewBody';
@@ -1,70 +0,0 @@
1
- /** ** Styles *** */
2
- .attachmentIcon {
3
- width: var(--zd_size60) !important;
4
- height: var(--zd_size60) !important;
5
- }
6
-
7
- .editorWrapper {
8
- display: flex;
9
- flex-direction: column;
10
- height: 100% ;
11
- width: 100% ;
12
- padding: 0 ;
13
- margin-top: var(--zd_size40) ;
14
- }
15
-
16
- .editableDiv {
17
- min-height: var(--zd_size48) !important;
18
- max-height: var(--zd_size48) !important;
19
- background-color: transparent !important;
20
- border: 0 !important;
21
- border-bottom: 1px solid
22
- var(--imlib_chat_components_attachmentPreviewBody_editor_border_color) !important;
23
- }
24
-
25
- .editableDiv:hover {
26
- border-color: var(
27
- --imlib_chat_components_attachmentPreviewBody_editor_border_hover_color
28
- ) !important;
29
- }
30
-
31
- .editableDiv:focus {
32
- border-color: var(
33
- --imlib_chat_components_attachmentPreviewBody_editor_border_active_color
34
- ) !important;
35
- }
36
-
37
- .imgContent,
38
- .zoomContent {
39
- overflow: auto;
40
- position: relative;
41
- box-sizing: border-box;
42
- }
43
-
44
- .imgContent, .zoomContent {
45
- background-color: var(--imlib_chat_components_attachmentPreviewBody_bg_color);
46
- padding: var(--zd_size40);
47
- }
48
-
49
- [dir=ltr] .imgContent, [dir=ltr] .zoomContent {
50
- border-bottom-left-radius: var(--zd_size5);
51
- border-bottom-right-radius: var(--zd_size5);
52
- }
53
-
54
- [dir=rtl] .imgContent, [dir=rtl] .zoomContent {
55
- border-bottom-right-radius: var(--zd_size5);
56
- border-bottom-left-radius: var(--zd_size5);
57
- }
58
-
59
- .fileContainer {
60
- height: var(--zd_size225);
61
- composes: dflex from '~@zohodesk/components/es/common/common.module.css';
62
- composes: alignVertical from '~@zohodesk/components/es/common/common.module.css';
63
- composes: alignHorizontal from '~@zohodesk/components/es/common/common.module.css';
64
- }
65
-
66
- .imgZoomOut {
67
- width: auto ;
68
- max-width: 100% ;
69
- max-height: 100% ;
70
- }
@@ -1 +0,0 @@
1
- export { default as AttachmentPreviewBody } from "./AttachmentPreviewBody";
@@ -1,7 +0,0 @@
1
- /** ** Constants *** */
2
- import { dummyObject } from '@zohoim/chat-components-utils/es/constants';
3
- const attachmentPreviewBodyDefaultProps = {
4
- customStyle: dummyObject,
5
- customProps: dummyObject
6
- };
7
- export default attachmentPreviewBodyDefaultProps;
@@ -1,20 +0,0 @@
1
- /** ** Libraries *** */
2
- import PropTypes from 'prop-types';
3
- const attachmentPreviewBodyPropTypes = {
4
- customStyle: PropTypes.object,
5
- customProps: PropTypes.shape({
6
- attachmentIconProps: PropTypes.object
7
- }),
8
- isImageFile: PropTypes.bool,
9
- attachmentURL: PropTypes.string,
10
- fileFormat: PropTypes.string,
11
- mediaType: PropTypes.string,
12
- isDescriptionNeeded: PropTypes.bool,
13
- description: PropTypes.string,
14
- attachmentId: PropTypes.string,
15
- onDescriptionChange: PropTypes.func,
16
- onEditorKeyDown: PropTypes.func,
17
- placeHolder: PropTypes.string,
18
- editorProps: PropTypes.object
19
- };
20
- export default attachmentPreviewBodyPropTypes;
@@ -1,84 +0,0 @@
1
- /** ** Libraries *** */
2
- import React from 'react';
3
- /** ** Components *** */
4
-
5
- import { Container, Box } from '@zohodesk/components/es/Layout';
6
- import Button from '@zohodesk/components/es/Button/Button';
7
- /** ** Hooks *** */
8
-
9
- import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
10
- /** ** Constants *** */
11
-
12
- import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
13
- import attachmentPreviewHeaderDefaultProps from "./props/defaultProps";
14
- import attachmentPreviewHeaderPropTypes from "./props/propTypes";
15
- /** ** Styles *** */
16
-
17
- import style from "./css/AttachmentPreviewHeader.module.css";
18
- export default function AttachmentPreviewHeader(props) {
19
- const {
20
- customStyle,
21
- fileName,
22
- fileSize,
23
- submitText,
24
- cancelText,
25
- onSubmit,
26
- onCancel,
27
- customProps
28
- } = props;
29
- const {
30
- submitButtonProps = dummyObject,
31
- cancelButtonProps = dummyObject
32
- } = customProps || {};
33
- /* External customization */
34
-
35
- const newStyle = useMergeStyle(style, customStyle);
36
- return /*#__PURE__*/React.createElement(Container, {
37
- align: "vertical",
38
- alignBox: "row",
39
- className: newStyle.imgPreviewerheader,
40
- isCover: false
41
- }, /*#__PURE__*/React.createElement(Box, {
42
- flexible: true
43
- }, /*#__PURE__*/React.createElement(Container, {
44
- align: "vertical",
45
- alignBox: "row"
46
- }, /*#__PURE__*/React.createElement(Box, {
47
- flexible: true
48
- }, /*#__PURE__*/React.createElement("div", {
49
- className: newStyle.imgName,
50
- title: fileName
51
- }, fileName), /*#__PURE__*/React.createElement("div", {
52
- className: newStyle.imgSize
53
- }, fileSize)))), /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Container, {
54
- align: "vertical",
55
- alignBox: "row",
56
- className: newStyle.navIcon,
57
- isCover: false
58
- }, /*#__PURE__*/React.createElement("span", {
59
- className: newStyle.attachBtn
60
- }, /*#__PURE__*/React.createElement(Button, {
61
- disabled: false,
62
- isBold: true,
63
- onClick: onSubmit,
64
- palette: "primaryFilled",
65
- rounded: false,
66
- size: "medium",
67
- status: "none",
68
- text: submitText,
69
- ...submitButtonProps
70
- })), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Button, {
71
- disabled: false,
72
- isBold: true,
73
- onClick: onCancel,
74
- palette: "secondary",
75
- rounded: false,
76
- size: "medium",
77
- status: "none",
78
- text: cancelText,
79
- ...cancelButtonProps
80
- })))));
81
- }
82
- AttachmentPreviewHeader.propTypes = attachmentPreviewHeaderPropTypes;
83
- AttachmentPreviewHeader.defaultProps = attachmentPreviewHeaderDefaultProps;
84
- AttachmentPreviewHeader.displayName = 'AttachmentPreviewHeader';
@@ -1,47 +0,0 @@
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
- }
@@ -1 +0,0 @@
1
- export { default as AttachmentPreviewHeader } from "./AttachmentPreviewHeader";
@@ -1,7 +0,0 @@
1
- /** ** Constants *** */
2
- import { dummyObject } from '@zohoim/chat-components-utils/es/constants';
3
- const attachmentPreviewHeaderDefaultProps = {
4
- customStyle: dummyObject,
5
- customProps: dummyObject
6
- };
7
- export default attachmentPreviewHeaderDefaultProps;
@@ -1,16 +0,0 @@
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;
package/es/Emoji/Emoji.js DELETED
@@ -1,72 +0,0 @@
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';
@@ -1,48 +0,0 @@
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); */
@@ -1,18 +0,0 @@
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
- }
package/es/Emoji/index.js DELETED
@@ -1 +0,0 @@
1
- export { default as Emoji } from "./Emoji";
@@ -1,8 +0,0 @@
1
- /** ** Constants *** */
2
- import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
3
- const emojiDefaultProps = {
4
- customStyle: dummyObject,
5
- autoHover: true,
6
- needTitle: true
7
- };
8
- export default emojiDefaultProps;
@@ -1,16 +0,0 @@
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;
@@ -1,116 +0,0 @@
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
- isRestrictScroll: true,
97
- onClick: removeClose,
98
- portalId: EDITOR_POPUP_PORTAL,
99
- positionsOffset: positionsOffset,
100
- size: popupSize,
101
- ...dropBoxProps
102
- }, /*#__PURE__*/React.createElement(Emojis, {
103
- onSelect: onSelect,
104
- ...emojisProps
105
- })) : null);
106
- }
107
-
108
- const EmojiPopup = Popup(EmojiPopupComp, undefined, undefined, {
109
- isAbsolutePositioningNeeded: false
110
- });
111
- EmojiPopupComp.defaultProps = emojiPopupDefaultProps;
112
- EmojiPopupComp.propTypes = emojiPopupPropTypes;
113
- EmojiPopup.defaultProps = emojiPopupDefaultProps;
114
- EmojiPopup.propTypes = emojiPopupPropTypes;
115
- EmojiPopup.displayName = 'EmojiPopup';
116
- export default EmojiPopup;