@zohoim/chat-components 1.0.9-alpha.0 → 1.0.9-beta.2

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 (164) hide show
  1. package/README.md +2 -2
  2. package/es/ActionIcon/ActionIcon.js +3 -1
  3. package/es/ActionIcon/props/propTypes.js +2 -1
  4. package/es/ActionIconWrapper/ActionIconWrapper.js +6 -3
  5. package/es/ActionIconWrapper/css/ActionIconWrapper.module.css +1 -1
  6. package/es/ActionIconWrapper/css/cssJSLogic.js +4 -2
  7. package/es/ActionIconWrapper/props/propTypes.js +2 -1
  8. package/es/AttachmentHandler/AttachmentHandler.js +84 -0
  9. package/es/AttachmentHandler/css/AttachmentHandler.module.css +17 -0
  10. package/es/AttachmentHandler/index.js +1 -0
  11. package/es/AttachmentHandler/props/defaultProps.js +10 -0
  12. package/es/AttachmentHandler/props/propTypes.js +17 -0
  13. package/es/AttachmentPreview/AttachmentPreview.js +113 -0
  14. package/es/AttachmentPreview/css/AttachmentPreview.module.css +30 -0
  15. package/es/AttachmentPreview/index.js +1 -0
  16. package/es/AttachmentPreview/props/defaultProps.js +7 -0
  17. package/es/AttachmentPreview/props/propTypes.js +31 -0
  18. package/es/AttachmentPreviewBody/AttachmentPreviewBody.js +81 -0
  19. package/es/AttachmentPreviewBody/css/AttachmentPreviewBody.module.css +68 -0
  20. package/es/AttachmentPreviewBody/index.js +1 -0
  21. package/es/AttachmentPreviewBody/props/defaultProps.js +7 -0
  22. package/es/AttachmentPreviewBody/props/propTypes.js +20 -0
  23. package/es/AttachmentPreviewHeader/AttachmentPreviewHeader.js +84 -0
  24. package/es/AttachmentPreviewHeader/css/AttachmentPreviewHeader.module.css +47 -0
  25. package/es/AttachmentPreviewHeader/index.js +1 -0
  26. package/es/AttachmentPreviewHeader/props/defaultProps.js +7 -0
  27. package/es/AttachmentPreviewHeader/props/propTypes.js +16 -0
  28. package/es/Emoji/Emoji.js +72 -0
  29. package/es/Emoji/css/Emoji.module.css +47 -0
  30. package/es/Emoji/css/cssJSLogic.js +18 -0
  31. package/es/Emoji/index.js +1 -0
  32. package/es/Emoji/props/defaultProps.js +8 -0
  33. package/es/Emoji/props/propTypes.js +16 -0
  34. package/es/EmojiPopup/EmojiPopup.js +116 -0
  35. package/es/EmojiPopup/css/EmojiPopup.module.css +50 -0
  36. package/es/EmojiPopup/index.js +1 -0
  37. package/es/EmojiPopup/props/defaultProps.js +11 -0
  38. package/es/EmojiPopup/props/propTypes.js +21 -0
  39. package/es/Emojis/Emojis.js +81 -0
  40. package/es/Emojis/index.js +1 -0
  41. package/es/Emojis/props/defaultProps.js +10 -0
  42. package/es/Emojis/props/propTypes.js +19 -0
  43. package/es/EmojisEmptyState/EmojisEmptyState.js +50 -0
  44. package/es/EmojisEmptyState/css/EmojisEmptyState.module.css +18 -0
  45. package/es/EmojisEmptyState/index.js +1 -0
  46. package/es/EmojisEmptyState/props/defaultProps.js +9 -0
  47. package/es/EmojisEmptyState/props/propTypes.js +8 -0
  48. package/es/EmojisFooter/EmojisFooter.js +71 -0
  49. package/es/EmojisFooter/css/EmojisFooter.module.css +40 -0
  50. package/es/EmojisFooter/index.js +1 -0
  51. package/es/EmojisFooter/props/defaultProps.js +7 -0
  52. package/es/EmojisFooter/props/propTypes.js +12 -0
  53. package/es/EmojisHeader/EmojisHeader.js +65 -0
  54. package/es/EmojisHeader/css/EmojisHeader.module.css +36 -0
  55. package/es/EmojisHeader/index.js +1 -0
  56. package/es/EmojisHeader/props/defaultProps.js +8 -0
  57. package/es/EmojisHeader/props/propTypes.js +13 -0
  58. package/es/EmojisList/EmojisList.js +133 -0
  59. package/es/EmojisList/css/EmojisList.module.css +50 -0
  60. package/es/EmojisList/css/cssJSLogic.js +25 -0
  61. package/es/EmojisList/index.js +1 -0
  62. package/es/EmojisList/props/defaultProps.js +10 -0
  63. package/es/EmojisList/props/propTypes.js +20 -0
  64. package/es/MessageAction/MessageAction.js +2 -0
  65. package/es/MessageAction/props/propTypes.js +2 -1
  66. package/es/MessageActions/MessageActions.js +2 -1
  67. package/es/MessageActionsMore/MessageActionsMore.js +6 -4
  68. package/es/MessageActionsMore/css/MessageActionsMore.module.css +1 -0
  69. package/es/MessageActionsMore/props/propTypes.js +5 -2
  70. package/es/MessageActionsWrapper/MessageActionsWrapper.js +2 -1
  71. package/es/MessageActionsWrapper/css/MessageActionsWrapper.module.css +4 -0
  72. package/es/Theme/ThemeAssets.js +2 -20
  73. package/es/Theme/ThemeWrapper.js +23 -14
  74. package/es/Theme/TooltipWrapper.js +1 -1
  75. package/es/Theme/props/defaultProps.js +2 -1
  76. package/es/Theme/props/propTypes.js +2 -1
  77. package/es/Theme/themeVariables/commonThemeColorVariable.js +17 -0
  78. package/es/Theme/themeVariables/dark/blueTheme.js +130 -0
  79. package/es/Theme/themeVariables/dark/commonColorVariable.js +35 -0
  80. package/es/Theme/themeVariables/dark/greenTheme.js +129 -0
  81. package/es/Theme/themeVariables/dark/orangeTheme.js +129 -0
  82. package/es/Theme/themeVariables/dark/redTheme.js +129 -0
  83. package/es/Theme/themeVariables/dark/yellowTheme.js +129 -0
  84. package/es/Theme/themeVariables/light/blueTheme.js +132 -0
  85. package/es/Theme/themeVariables/light/commonColorVariable.js +54 -0
  86. package/es/Theme/themeVariables/light/greenTheme.js +127 -0
  87. package/es/Theme/themeVariables/light/orangeTheme.js +127 -0
  88. package/es/Theme/themeVariables/light/redTheme.js +127 -0
  89. package/es/Theme/themeVariables/light/yellowTheme.js +127 -0
  90. package/es/Theme/themeVariables/pureDark/blueTheme.js +129 -0
  91. package/es/Theme/themeVariables/pureDark/commonColorVariable.js +37 -0
  92. package/es/Theme/themeVariables/pureDark/greenTheme.js +129 -0
  93. package/es/Theme/themeVariables/pureDark/orangeTheme.js +129 -0
  94. package/es/Theme/themeVariables/pureDark/redTheme.js +129 -0
  95. package/es/Theme/themeVariables/pureDark/yellowTheme.js +129 -0
  96. package/es/Theme/utils/getThemeConfigurations.js +56 -2
  97. package/es/constants/index.js +7 -1
  98. package/es/constants/propConstants/editorPropConstants.js +3 -0
  99. package/es/constants/propConstants/popupPropConstants.js +2 -0
  100. package/es/im/IMAttachmentHandler/IMAttachmentHandler.js +50 -0
  101. package/es/im/IMAttachmentHandler/index.js +1 -0
  102. package/es/im/IMAttachmentHandler/props/defaultProps.js +10 -0
  103. package/es/im/IMAttachmentHandler/props/propTypes.js +28 -0
  104. package/es/im/IMIntegrationIcon/css/IMIntegrationIcon.module.css +2 -2
  105. package/es/im/ReplyComposer/ReplyComposer.js +137 -0
  106. package/es/im/ReplyComposer/css/ReplyComposer.module.css +5 -0
  107. package/es/im/ReplyComposer/index.js +1 -0
  108. package/es/im/ReplyComposer/props/defaultProps.js +7 -0
  109. package/es/im/ReplyComposer/props/propTypes.js +60 -0
  110. package/es/im/ReplyComposerFooter/ReplyComposerFooter.js +41 -0
  111. package/es/im/ReplyComposerFooter/css/ReplyComposerFooter.module.css +5 -0
  112. package/es/im/ReplyComposerFooter/index.js +1 -0
  113. package/es/im/ReplyComposerFooter/props/defaultProps.js +8 -0
  114. package/es/im/ReplyComposerFooter/props/propTypes.js +17 -0
  115. package/es/im/ReplyEditor/ReplyEditor.js +103 -0
  116. package/es/im/ReplyEditor/css/ReplyEditor.module.css +38 -0
  117. package/es/im/ReplyEditor/css/cssJSLogic.js +10 -0
  118. package/es/im/ReplyEditor/index.js +1 -0
  119. package/es/im/ReplyEditor/props/defaultProps.js +8 -0
  120. package/es/im/ReplyEditor/props/propTypes.js +27 -0
  121. package/es/im/ReplyEditorExtensions/ReplyEditorExtensions.js +149 -0
  122. package/es/im/ReplyEditorExtensions/css/ReplyEditorExtensions.module.css +5 -0
  123. package/es/im/ReplyEditorExtensions/index.js +1 -0
  124. package/es/im/ReplyEditorExtensions/props/defaultProps.js +6 -0
  125. package/es/im/ReplyEditorExtensions/props/propTypes.js +16 -0
  126. package/es/im/ReplyEditorSuggestions/ReplyEditorSuggestions.js +87 -0
  127. package/es/im/ReplyEditorSuggestions/css/ReplyEditorSuggestions.module.css +8 -0
  128. package/es/im/ReplyEditorSuggestions/index.js +1 -0
  129. package/es/im/ReplyEditorSuggestions/props/defaultProps.js +6 -0
  130. package/es/im/ReplyEditorSuggestions/props/propTypes.js +20 -0
  131. package/es/im/ReplyEditorSuggestionsPopup/ReplyEditorSuggestionsPopup.js +90 -0
  132. package/es/im/ReplyEditorSuggestionsPopup/css/ReplyEditorSuggestionsPopup.module.css +7 -0
  133. package/es/im/ReplyEditorSuggestionsPopup/index.js +1 -0
  134. package/es/im/ReplyEditorSuggestionsPopup/props/defaultProps.js +10 -0
  135. package/es/im/ReplyEditorSuggestionsPopup/props/propTypes.js +21 -0
  136. package/es/im/index.js +8 -1
  137. package/es/index.js +13 -2
  138. package/es/rte/Editor/Editor.js +80 -0
  139. package/es/rte/Editor/css/Editor.module.css +19 -0
  140. package/es/rte/Editor/index.js +1 -0
  141. package/es/rte/Editor/props/defaultProps.js +21 -0
  142. package/es/rte/Editor/props/propTypes.js +52 -0
  143. package/es/rte/index.js +1 -0
  144. package/package.json +13 -20
  145. package/assets/Appearance/dark/mode/General_DarkMode.module.css +0 -71
  146. package/assets/Appearance/dark/themes/blue/blue_General_DarkTheme.module.css +0 -35
  147. package/assets/Appearance/dark/themes/green/green_General_DarkTheme.module.css +0 -35
  148. package/assets/Appearance/dark/themes/orange/orange_General_DarkTheme.module.css +0 -35
  149. package/assets/Appearance/dark/themes/red/red_General_DarkTheme.module.css +0 -35
  150. package/assets/Appearance/dark/themes/yellow/yellow_General_DarkTheme.module.css +0 -35
  151. package/assets/Appearance/light/mode/General_LightMode.module.css +0 -71
  152. package/assets/Appearance/light/themes/blue/blue_General_LightTheme.module.css +0 -35
  153. package/assets/Appearance/light/themes/green/green_General_LightTheme.module.css +0 -35
  154. package/assets/Appearance/light/themes/orange/orange_General_LightTheme.module.css +0 -35
  155. package/assets/Appearance/light/themes/red/red_General_LightTheme.module.css +0 -35
  156. package/assets/Appearance/light/themes/yellow/yellow_General_LightTheme.module.css +0 -35
  157. package/assets/Appearance/pureDark/mode/General_PureDarkMode.module.css +0 -71
  158. package/assets/Appearance/pureDark/themes/blue/blue_General_PureDarkTheme.module.css +0 -35
  159. package/assets/Appearance/pureDark/themes/green/green_General_PureDarkTheme.module.css +0 -35
  160. package/assets/Appearance/pureDark/themes/orange/orange_General_PureDarkTheme.module.css +0 -35
  161. package/assets/Appearance/pureDark/themes/red/red_General_PureDarkTheme.module.css +0 -35
  162. package/assets/Appearance/pureDark/themes/yellow/yellow_General_PureDarkTheme.module.css +0 -35
  163. package/es/Theme/constants/index.js +0 -41
  164. package/lib/index.js +0 -382
@@ -0,0 +1,129 @@
1
+ /* eslint-disable camelcase */
2
+ import { incomingBubbleBgColor, outgoingBubbleBgColor, bubbleActiveBgColor, actionIconWrapperColor, messageStatusSendColor, messageStatusFailedColor, primaryRed, failedBgWrapper, failedBg, failedBdr, failedLine, failedColor, failedUrlColor, emojiPopup, replyEditor, emojisHeader, attachmentPreviewHeader } from "./commonColorVariable";
3
+ import { imIntegrationIcon, imTtIcon, messagetextColor } from "../commonThemeColorVariable";
4
+ export default {
5
+ library: 'chat_components',
6
+ variables: {
7
+ actionIconWrapper: {
8
+ color: actionIconWrapperColor,
9
+ bg_color: '#2f2424',
10
+ border_color: '#492A29'
11
+ },
12
+ attachmentBubble: {
13
+ bg_color: '#212121',
14
+ bg_color_failed: failedBg,
15
+ border_color: '#161515',
16
+ border_color_failed: failedBdr
17
+ },
18
+ attachmentBubbleInfo: {
19
+ fileName_color: '#e2e4e6',
20
+ fileName_color_failed: failedColor,
21
+ fileSize_color: '#999',
22
+ fileSize_color_failed: '#788190'
23
+ },
24
+ articleBubble: {
25
+ bg_color: '#212121',
26
+ bg_color_failed: failedBg,
27
+ border_color: '#161515',
28
+ border_color_failed: failedBdr,
29
+ title_color: '#e2e4e6',
30
+ title_color_failed: failedColor,
31
+ summary_color: '#e2e4e6',
32
+ summary_color_failed: failedColor
33
+ },
34
+ imAutoMessageInfo: {
35
+ text_color: '#999'
36
+ },
37
+ imIntegrationIcon,
38
+ imTtIcon,
39
+ imMessageContent: {
40
+ text_color: '#a8b0bd'
41
+ },
42
+ imMessageMeta: {
43
+ time_color: '#999'
44
+ },
45
+ imPermaLink: {
46
+ url_color: '#e94f4f'
47
+ },
48
+ imageBubble: {
49
+ bg_color: '#212121',
50
+ bg_color_failed: failedBg,
51
+ alt_text_color: '#e2e4e6',
52
+ alt_text_color_failed: failedColor,
53
+ border_color: '#161515',
54
+ border_color_failed: failedBdr
55
+ },
56
+ locationBubble: {
57
+ bg_color: '#212121',
58
+ bg_color_failed: failedBg,
59
+ border_color: '#161515',
60
+ border_color_failed: failedBdr,
61
+ url_color: primaryRed,
62
+ url_color_failed: failedUrlColor
63
+ },
64
+ messageBox: {
65
+ incoming_bg_color: incomingBubbleBgColor,
66
+ outgoing_bg_color: outgoingBubbleBgColor,
67
+ bg_color: '#f1f7fe',
68
+ failed_bg_color: failedBgWrapper,
69
+ text_color: messagetextColor
70
+ },
71
+ messageBubble: {
72
+ active_bg_color: bubbleActiveBgColor,
73
+ messageBox_footer_text_color: '#5a616f'
74
+ },
75
+ messageStatus: {
76
+ send_color: messageStatusSendColor,
77
+ read_color: '#e94f4f',
78
+ failed_color: messageStatusFailedColor
79
+ },
80
+ replyBubble: {
81
+ border_color: '#161515',
82
+ border_color_failed: failedBdr
83
+ },
84
+ replyBubbleContent: {
85
+ bg_color: '#212121',
86
+ bg_color_failed: failedBg,
87
+ border_color: '#161515',
88
+ border_color_failed: failedBdr,
89
+ line_color: '#cddbf2',
90
+ line_color_failed: failedLine,
91
+ sender_color: '#e2e4e6',
92
+ sender_color_failed: failedColor,
93
+ content_color: '#e2e4e6',
94
+ content_color_failed: failedColor
95
+ },
96
+ replyBubbleHeader: {
97
+ text_color: '#e2e4e6',
98
+ text_color_failed: failedColor,
99
+ time_color: '#828994',
100
+ time_color_failed: failedColor
101
+ },
102
+ textBubble: {
103
+ text_color: '#e2e4e6',
104
+ text_color_failed: failedColor,
105
+ see_more_color: primaryRed,
106
+ see_more_color_failed: failedUrlColor,
107
+ url_color: primaryRed,
108
+ url_color_failed: failedUrlColor
109
+ },
110
+ videoBubble: {
111
+ border_color: '#161515',
112
+ border_color_failed: failedBdr
113
+ },
114
+ emojiFooter: {
115
+ tabLine: primaryRed,
116
+ border_color: '#161515'
117
+ },
118
+ emojiPopup,
119
+ replyEditor,
120
+ emojisHeader,
121
+ attachmentPreviewHeader,
122
+ attachmentPreviewBody: {
123
+ bg_color: '#262626',
124
+ editor_border_color: '#585858',
125
+ editor_border_hover_color: '#828994',
126
+ editor_border_active_color: '#e94f4f'
127
+ }
128
+ }
129
+ };
@@ -0,0 +1,129 @@
1
+ /* eslint-disable camelcase */
2
+ import { incomingBubbleBgColor, outgoingBubbleBgColor, bubbleActiveBgColor, messageStatusSendColor, messageStatusFailedColor, actionIconWrapperColor, primaryYellow, failedBgWrapper, failedBg, failedBdr, failedLine, failedColor, failedUrlColor, emojiPopup, replyEditor, emojisHeader, attachmentPreviewHeader } from "./commonColorVariable";
3
+ import { imIntegrationIcon, imTtIcon, messagetextColor } from "../commonThemeColorVariable";
4
+ export default {
5
+ library: 'chat_components',
6
+ variables: {
7
+ actionIconWrapper: {
8
+ color: actionIconWrapperColor,
9
+ bg_color: '#2e2922',
10
+ border_color: '#453925'
11
+ },
12
+ attachmentBubble: {
13
+ bg_color: '#212121',
14
+ bg_color_failed: failedBg,
15
+ border_color: '#161515',
16
+ border_color_failed: failedBdr
17
+ },
18
+ attachmentBubbleInfo: {
19
+ fileName_color: '#e2e4e6',
20
+ fileName_color_failed: failedColor,
21
+ fileSize_color: '#999',
22
+ fileSize_color_failed: '#788190'
23
+ },
24
+ articleBubble: {
25
+ bg_color: '#212121',
26
+ bg_color_failed: failedBg,
27
+ border_color: '#161515',
28
+ border_color_failed: failedBdr,
29
+ title_color: '#e2e4e6',
30
+ title_color_failed: failedColor,
31
+ summary_color: '#e2e4e6',
32
+ summary_color_failed: failedColor
33
+ },
34
+ imAutoMessageInfo: {
35
+ text_color: '#999'
36
+ },
37
+ imIntegrationIcon,
38
+ imTtIcon,
39
+ imMessageContent: {
40
+ text_color: '#a8b0bd'
41
+ },
42
+ imMessageMeta: {
43
+ time_color: '#999'
44
+ },
45
+ imPermaLink: {
46
+ url_color: '#d79835'
47
+ },
48
+ imageBubble: {
49
+ bg_color: '#212121',
50
+ bg_color_failed: failedBg,
51
+ alt_text_color: '#e2e4e6',
52
+ alt_text_color_failed: failedColor,
53
+ border_color: '#161515',
54
+ border_color_failed: failedBdr
55
+ },
56
+ locationBubble: {
57
+ bg_color: '#212121',
58
+ bg_color_failed: failedBg,
59
+ border_color: '#161515',
60
+ border_color_failed: failedBdr,
61
+ url_color: primaryYellow,
62
+ url_color_failed: failedUrlColor
63
+ },
64
+ messageBox: {
65
+ incoming_bg_color: incomingBubbleBgColor,
66
+ outgoing_bg_color: outgoingBubbleBgColor,
67
+ bg_color: '#f1f7fe',
68
+ failed_bg_color: failedBgWrapper,
69
+ text_color: messagetextColor
70
+ },
71
+ messageBubble: {
72
+ active_bg_color: bubbleActiveBgColor,
73
+ messageBox_footer_text_color: '#5a616f'
74
+ },
75
+ messageStatus: {
76
+ send_color: messageStatusSendColor,
77
+ read_color: '#d79835',
78
+ failed_color: messageStatusFailedColor
79
+ },
80
+ replyBubble: {
81
+ border_color: '#161515',
82
+ border_color_failed: failedBdr
83
+ },
84
+ replyBubbleContent: {
85
+ bg_color: '#212121',
86
+ bg_color_failed: failedBg,
87
+ border_color: '#161515',
88
+ border_color_failed: failedBdr,
89
+ line_color: '#cddbf2',
90
+ line_color_failed: failedLine,
91
+ sender_color: '#e2e4e6',
92
+ sender_color_failed: failedColor,
93
+ content_color: '#e2e4e6',
94
+ content_color_failed: failedColor
95
+ },
96
+ replyBubbleHeader: {
97
+ text_color: '#e2e4e6',
98
+ text_color_failed: failedColor,
99
+ time_color: '#828994',
100
+ time_color_failed: failedColor
101
+ },
102
+ textBubble: {
103
+ text_color: '#e2e4e6',
104
+ text_color_failed: failedColor,
105
+ see_more_color: primaryYellow,
106
+ see_more_color_failed: failedUrlColor,
107
+ url_color: primaryYellow,
108
+ url_color_failed: failedUrlColor
109
+ },
110
+ videoBubble: {
111
+ border_color: '#161515',
112
+ border_color_failed: failedBdr
113
+ },
114
+ emojiFooter: {
115
+ tabLine: primaryYellow,
116
+ border_color: '#161515'
117
+ },
118
+ emojiPopup,
119
+ replyEditor,
120
+ emojisHeader,
121
+ attachmentPreviewHeader,
122
+ attachmentPreviewBody: {
123
+ bg_color: '#262626',
124
+ editor_border_color: '#585858',
125
+ editor_border_hover_color: '#828994',
126
+ editor_border_active_color: '#d79835'
127
+ }
128
+ }
129
+ };
@@ -1,4 +1,19 @@
1
- import { modeConstants, themeConstants } from "../constants";
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";
2
17
  const modeMapping = {
3
18
  [modeConstants.LIGHT]: 'light',
4
19
  [modeConstants.DARK]: 'dark',
@@ -11,17 +26,56 @@ const themeMapping = {
11
26
  [themeConstants.RED]: 'red',
12
27
  [themeConstants.YELLOW]: 'yellow'
13
28
  };
29
+ const concatString = '_';
14
30
  const defaultTheme = themeMapping[themeConstants.BLUE];
15
31
  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
+
16
62
  export default function getThemeConfigurations(_ref) {
17
63
  let {
18
64
  mode: propMode,
19
65
  theme: propTheme
20
66
  } = _ref;
67
+ const {
68
+ themeName
69
+ } = getThemeName({
70
+ mode: propMode,
71
+ theme: propTheme
72
+ });
21
73
  const mode = propMode ? modeMapping[propMode] || propMode : defaultMode;
22
74
  const theme = propTheme ? themeMapping[propTheme] || propTheme : defaultTheme;
75
+ const themeConfigurations = themeConfigMapping[themeName] || defaultThemeConfiguration;
23
76
  return {
24
77
  mode,
25
- theme
78
+ theme,
79
+ themeConfigurations
26
80
  };
27
81
  }
@@ -1 +1,7 @@
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
+ const version = '1.4.9';
4
+ export const defaultEditorURL = // `https://static.localzohocdn.com/rtelibrary/${version}/js/rte.js`;
5
+ // `https://static.zohocdn.com/rtelibrary/${version}/js/rte.js`;
6
+ // `https://static.localzohocdn.com/rtelibrary/${version}/js/rte.min.js`;
7
+ `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) !important;
67
+ color: var(--imlib_chat_components_imIntegrationIcon_path0_color);
68
68
  }
69
69
 
70
70
  .fontIcon :global .path2::before {
71
- color: var(--imlib_chat_components_imIntegrationIcon_path1_color) !important;
71
+ color: var(--imlib_chat_components_imIntegrationIcon_path1_color);
72
72
  }
@@ -0,0 +1,137 @@
1
+ /** ** Libraries *** */
2
+ import React, { useMemo } from 'react';
3
+ /** ** Components *** */
4
+
5
+ import { Container } from '@zohodesk/components/es/Layout';
6
+ import ReplyEditor from "../ReplyEditor/ReplyEditor";
7
+ import ReplyComposerFooter from "../ReplyComposerFooter/ReplyComposerFooter";
8
+ import ReplyEditorSuggestions from "../ReplyEditorSuggestions/ReplyEditorSuggestions";
9
+ import AttachmentPreview from "../../AttachmentPreview/AttachmentPreview";
10
+ /** ** Hooks *** */
11
+
12
+ import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
13
+ import useReplyComposer from '@zohoim/chat-components-hooks/es/im/ReplyComposer/useReplyComposer';
14
+ import useReplyComposerSuggestions from '@zohoim/chat-components-hooks/es/im/ReplyComposer/useReplyComposerSuggestions';
15
+ /** ** Constants *** */
16
+
17
+ import { dummyArray, dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
18
+ import replyComposerDefaultProps from "./props/defaultProps";
19
+ import replyComposerPropTypes from "./props/propTypes";
20
+ /** ** Methods *** */
21
+
22
+ import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
23
+ /** ** Styles *** */
24
+
25
+ import style from "./css/ReplyComposer.module.css";
26
+ export default function ReplyComposer(props) {
27
+ const {
28
+ customStyle,
29
+ id,
30
+ content,
31
+ EDITORURL,
32
+ placeHolder,
33
+ features,
34
+ formats,
35
+ suggestions,
36
+ isHTMLContent,
37
+ onChange,
38
+ onKeyDown: propOnKeyDown,
39
+ onPaste,
40
+ customProps = dummyObject,
41
+ extensions,
42
+ files = dummyArray,
43
+ filesDescription,
44
+ onChangeFileDescription,
45
+ onFileCancel: propOnFileCancel,
46
+ onFileSubmit: propOnFileSubmit,
47
+ attachmentPreviewTexts,
48
+ renderHeader,
49
+ renderFooter,
50
+ getEditorState: propGetEditorState,
51
+ needFooter
52
+ } = props;
53
+ const {
54
+ replyEditorProps = dummyObject,
55
+ replyEditorSuggestionsProps = dummyObject,
56
+ replyComposerFooterProps = dummyObject
57
+ } = customProps;
58
+ const {
59
+ features: allFeatures,
60
+ suggestionsMapping,
61
+ suggestionDetails,
62
+ isShowSuggestion,
63
+ getSuggetPopupMethods,
64
+ onHideSuggestions,
65
+ onSuggestPopupKeyDown,
66
+ onSelectSuggestion
67
+ } = useReplyComposerSuggestions({
68
+ features,
69
+ suggestions,
70
+ isHTMLContent
71
+ });
72
+ const {
73
+ getEditorState,
74
+ editor,
75
+ onKeyDown,
76
+ attachmentPreviewCustomProps,
77
+ onFileCancel,
78
+ onFileSubmit
79
+ } = useReplyComposer({
80
+ onKeyDown: propOnKeyDown,
81
+ isShowSuggestion,
82
+ onSuggestPopupKeyDown,
83
+ EDITORURL,
84
+ onPaste,
85
+ customProps,
86
+ onFileCancel: propOnFileCancel,
87
+ onFileSubmit: propOnFileSubmit,
88
+ getEditorState: propGetEditorState
89
+ });
90
+ /* External customization */
91
+
92
+ const newStyle = useMergeStyle(style, customStyle);
93
+ const headerElement = useMemo(() => renderHandler(renderHeader)(), [renderHeader]);
94
+ return /*#__PURE__*/React.createElement(Container, {
95
+ className: newStyle.replyComposer,
96
+ isCover: false
97
+ }, isShowSuggestion ? /*#__PURE__*/React.createElement(ReplyEditorSuggestions, {
98
+ getMethods: getSuggetPopupMethods,
99
+ onClose: onHideSuggestions,
100
+ onSelect: onSelectSuggestion,
101
+ suggestionDetails: suggestionDetails,
102
+ suggestionsMapping: suggestionsMapping,
103
+ ...replyEditorSuggestionsProps
104
+ }) : null, files.length > 0 ? /*#__PURE__*/React.createElement(AttachmentPreview, {
105
+ descriptionDetails: filesDescription,
106
+ files: files,
107
+ isDescriptionNeeded: true,
108
+ needEditImage: false,
109
+ onCancel: onFileCancel,
110
+ onDescriptionChange: onChangeFileDescription,
111
+ onSubmit: onFileSubmit,
112
+ texts: attachmentPreviewTexts,
113
+ ...attachmentPreviewCustomProps
114
+ }) : null, headerElement || null, /*#__PURE__*/React.createElement(ReplyEditor, {
115
+ content: content,
116
+ EDITORURL: EDITORURL,
117
+ features: allFeatures,
118
+ formats: formats,
119
+ getEditorState: getEditorState,
120
+ id: id,
121
+ isHTMLContent: isHTMLContent,
122
+ onChange: onChange,
123
+ onKeyDown: onKeyDown,
124
+ onPaste: onPaste,
125
+ placeHolder: placeHolder,
126
+ ...replyEditorProps
127
+ }), needFooter ? /*#__PURE__*/React.createElement(ReplyComposerFooter, {
128
+ editor: editor,
129
+ extensions: extensions,
130
+ isHTMLContent: isHTMLContent,
131
+ renderButtons: renderFooter,
132
+ ...replyComposerFooterProps
133
+ }) : null);
134
+ }
135
+ ReplyComposer.propTypes = replyComposerPropTypes;
136
+ ReplyComposer.defaultProps = replyComposerDefaultProps;
137
+ ReplyComposer.displayName = 'ReplyComposer';
@@ -0,0 +1,5 @@
1
+ /** ** Styles *** */
2
+
3
+ .replyComposer {
4
+ /** ** Use this class for css customisation *** */
5
+ }
@@ -0,0 +1 @@
1
+ export { default as ReplyComposer } from "./ReplyComposer";
@@ -0,0 +1,7 @@
1
+ /** ** Constants *** */
2
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
3
+ const replyComposerDefaultProps = {
4
+ customStyle: dummyObject,
5
+ needFooter: true
6
+ };
7
+ export default replyComposerDefaultProps;
@@ -0,0 +1,60 @@
1
+ /** ** Libraries *** */
2
+ import PropTypes from 'prop-types';
3
+ /** ** Constants *** */
4
+
5
+ import { features, formats } from "../../../constants/propConstants/editorPropConstants";
6
+ const replyComposerPropTypes = {
7
+ customStyle: PropTypes.object,
8
+ id: PropTypes.string,
9
+ content: PropTypes.string.isRequired,
10
+ EDITORURL: PropTypes.string,
11
+ placeHolder: PropTypes.string,
12
+ features: PropTypes.arrayOf(PropTypes.oneOf(features)),
13
+ formats: PropTypes.arrayOf(PropTypes.oneOf(formats)),
14
+ suggestions: PropTypes.arrayOf(PropTypes.shape({
15
+ allowSpace: PropTypes.bool,
16
+ componentProps: PropTypes.object,
17
+ popupProps: PropTypes.object,
18
+ renderItem: PropTypes.func,
19
+ trigger: PropTypes.string
20
+ })),
21
+ isHTMLContent: PropTypes.bool,
22
+ onChange: PropTypes.func.isRequired,
23
+ onKeyDown: PropTypes.func,
24
+ onPaste: PropTypes.func,
25
+ customProps: PropTypes.shape({
26
+ attachmentPreviewProps: PropTypes.object,
27
+ replyComposerFooterProps: PropTypes.object,
28
+ replyEditorProps: PropTypes.object,
29
+ replyEditorSuggestionsProps: PropTypes.object
30
+ }),
31
+ extensions: PropTypes.shape({
32
+ details: PropTypes.objectOf(PropTypes.shape({
33
+ componentProps: PropTypes.object,
34
+ id: PropTypes.string,
35
+ renderItem: PropTypes.func
36
+ })),
37
+ order: PropTypes.array
38
+ }),
39
+ files: PropTypes.arrayOf(PropTypes.shape({
40
+ id: PropTypes.string,
41
+ name: PropTypes.string,
42
+ size: PropTypes.string,
43
+ type: PropTypes.string,
44
+ url: PropTypes.string
45
+ })),
46
+ filesDescription: PropTypes.object,
47
+ onChangeFileDescription: PropTypes.func,
48
+ onFileCancel: PropTypes.func,
49
+ onFileSubmit: PropTypes.func,
50
+ attachmentPreviewTexts: PropTypes.shape({
51
+ cancelText: PropTypes.string,
52
+ editText: PropTypes.string,
53
+ placeHolder: PropTypes.string,
54
+ submitText: PropTypes.string
55
+ }),
56
+ renderHeader: PropTypes.func,
57
+ renderFooter: PropTypes.func,
58
+ getEditorState: PropTypes.func
59
+ };
60
+ export default replyComposerPropTypes;