@zohoim/chat-components 0.0.1-cx

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 (277) hide show
  1. package/README.md +9 -0
  2. package/es/ActionIcon/ActionIcon.js +82 -0
  3. package/es/ActionIcon/css/ActionIcon.module.css +8 -0
  4. package/es/ActionIcon/index.js +1 -0
  5. package/es/ActionIcon/props/defaultProps.js +8 -0
  6. package/es/ActionIcon/props/propTypes.js +17 -0
  7. package/es/ActionIconWrapper/ActionIconWrapper.js +61 -0
  8. package/es/ActionIconWrapper/css/ActionIconWrapper.module.css +32 -0
  9. package/es/ActionIconWrapper/css/cssJSLogic.js +14 -0
  10. package/es/ActionIconWrapper/index.js +1 -0
  11. package/es/ActionIconWrapper/props/defaultProps.js +6 -0
  12. package/es/ActionIconWrapper/props/propTypes.js +12 -0
  13. package/es/AttachmentBubble/AttachmentBubble.js +87 -0
  14. package/es/AttachmentBubble/css/AttachmentBubble.module.css +55 -0
  15. package/es/AttachmentBubble/css/cssJSLogic.js +18 -0
  16. package/es/AttachmentBubble/index.js +1 -0
  17. package/es/AttachmentBubble/props/defaultProps.js +8 -0
  18. package/es/AttachmentBubble/props/propTypes.js +19 -0
  19. package/es/AttachmentBubbleInfo/AttachmentBubbleInfo.js +48 -0
  20. package/es/AttachmentBubbleInfo/css/AttachmentBubbleInfo.module.css +39 -0
  21. package/es/AttachmentBubbleInfo/css/cssJSLogic.js +13 -0
  22. package/es/AttachmentBubbleInfo/index.js +1 -0
  23. package/es/AttachmentBubbleInfo/props/defaultProps.js +6 -0
  24. package/es/AttachmentBubbleInfo/props/propTypes.js +9 -0
  25. package/es/AttachmentIcon/AttachmentIcon.js +60 -0
  26. package/es/AttachmentIcon/css/AttachmentIcon.module.css +8 -0
  27. package/es/AttachmentIcon/css/cssJSLogic.js +13 -0
  28. package/es/AttachmentIcon/index.js +1 -0
  29. package/es/AttachmentIcon/props/defaultProps.js +8 -0
  30. package/es/AttachmentIcon/props/propTypes.js +21 -0
  31. package/es/AttachmentIcon/utils/getAttachmentIconComponent.js +81 -0
  32. package/es/Audio/Audio.js +38 -0
  33. package/es/Audio/css/Audio.module.css +7 -0
  34. package/es/Audio/index.js +1 -0
  35. package/es/Audio/props/defaultProps.js +6 -0
  36. package/es/Audio/props/propTypes.js +8 -0
  37. package/es/AudioBubble/AudioBubble.js +56 -0
  38. package/es/AudioBubble/css/AudioBubble.module.css +4 -0
  39. package/es/AudioBubble/index.js +1 -0
  40. package/es/AudioBubble/props/defaultProps.js +7 -0
  41. package/es/AudioBubble/props/propTypes.js +16 -0
  42. package/es/Fonts/puviFont.module.css +62 -0
  43. package/es/ImageBubble/ImageBubble.js +70 -0
  44. package/es/ImageBubble/css/ImageBubble.module.css +63 -0
  45. package/es/ImageBubble/css/cssJSLogic.js +15 -0
  46. package/es/ImageBubble/index.js +1 -0
  47. package/es/ImageBubble/props/defaultProps.js +6 -0
  48. package/es/ImageBubble/props/propTypes.js +13 -0
  49. package/es/LazyLoadImage/LazyLoadImage.js +37 -0
  50. package/es/LazyLoadImage/css/LazyLoadImage.module.css +5 -0
  51. package/es/LazyLoadImage/index.js +1 -0
  52. package/es/LazyLoadImage/props/defaultProps.js +6 -0
  53. package/es/LazyLoadImage/props/propTypes.js +8 -0
  54. package/es/LocationBubble/LocationBubble.js +62 -0
  55. package/es/LocationBubble/css/LocationBubble.module.css +57 -0
  56. package/es/LocationBubble/css/cssJSLogic.js +13 -0
  57. package/es/LocationBubble/images/location.png +0 -0
  58. package/es/LocationBubble/index.js +1 -0
  59. package/es/LocationBubble/props/defaultProps.js +6 -0
  60. package/es/LocationBubble/props/propTypes.js +8 -0
  61. package/es/MediaBubbleWrapper/MediaBubbleWrapper.js +62 -0
  62. package/es/MediaBubbleWrapper/css/MediaBubbleWrapper.module.css +7 -0
  63. package/es/MediaBubbleWrapper/index.js +1 -0
  64. package/es/MediaBubbleWrapper/props/defaultProps.js +7 -0
  65. package/es/MediaBubbleWrapper/props/propTypes.js +17 -0
  66. package/es/Message/Message.js +126 -0
  67. package/es/Message/index.js +1 -0
  68. package/es/Message/props/defaultProps.js +12 -0
  69. package/es/Message/props/propTypes.js +41 -0
  70. package/es/MessageAction/MessageAction.js +60 -0
  71. package/es/MessageAction/index.js +1 -0
  72. package/es/MessageAction/props/defaultProps.js +8 -0
  73. package/es/MessageAction/props/propTypes.js +21 -0
  74. package/es/MessageActions/MessageActions.js +120 -0
  75. package/es/MessageActions/css/MessageActions.module.css +24 -0
  76. package/es/MessageActions/index.js +1 -0
  77. package/es/MessageActions/props/defaultProps.js +10 -0
  78. package/es/MessageActions/props/propTypes.js +25 -0
  79. package/es/MessageActionsMore/MessageActionsMore.js +101 -0
  80. package/es/MessageActionsMore/css/MessageActionsMore.module.css +23 -0
  81. package/es/MessageActionsMore/index.js +1 -0
  82. package/es/MessageActionsMore/props/defaultProps.js +9 -0
  83. package/es/MessageActionsMore/props/propTypes.js +13 -0
  84. package/es/MessageActionsWrapper/MessageActionsWrapper.js +68 -0
  85. package/es/MessageActionsWrapper/css/MessageActionsWrapper.module.css +3 -0
  86. package/es/MessageActionsWrapper/index.js +1 -0
  87. package/es/MessageActionsWrapper/props/defaultProps.js +9 -0
  88. package/es/MessageActionsWrapper/props/propTypes.js +15 -0
  89. package/es/MessageAvatar/MessageAvatar.js +49 -0
  90. package/es/MessageAvatar/css/MessageAvatar.module.css +23 -0
  91. package/es/MessageAvatar/index.js +1 -0
  92. package/es/MessageAvatar/props/defaultProps.js +7 -0
  93. package/es/MessageAvatar/props/propTypes.js +13 -0
  94. package/es/MessageBox/MessageBox.js +66 -0
  95. package/es/MessageBox/css/MessageBox.module.css +56 -0
  96. package/es/MessageBox/css/cssJSLogic.js +18 -0
  97. package/es/MessageBox/index.js +1 -0
  98. package/es/MessageBox/props/defaultProps.js +6 -0
  99. package/es/MessageBox/props/propTypes.js +13 -0
  100. package/es/MessageBubble/MessageBubble.js +116 -0
  101. package/es/MessageBubble/css/MessageBubble.module.css +101 -0
  102. package/es/MessageBubble/css/cssJSLogic.js +34 -0
  103. package/es/MessageBubble/index.js +1 -0
  104. package/es/MessageBubble/props/defaultProps.js +11 -0
  105. package/es/MessageBubble/props/propTypes.js +17 -0
  106. package/es/MessageStatus/MessageStatus.js +77 -0
  107. package/es/MessageStatus/css/MessageStatus.module.css +17 -0
  108. package/es/MessageStatus/css/cssJSLogic.js +26 -0
  109. package/es/MessageStatus/index.js +1 -0
  110. package/es/MessageStatus/props/defaultProps.js +6 -0
  111. package/es/MessageStatus/props/propTypes.js +12 -0
  112. package/es/MoreActionItem/MoreActionItem.js +72 -0
  113. package/es/MoreActionItem/css/MoreActionItem.module.css +27 -0
  114. package/es/MoreActionItem/index.js +1 -0
  115. package/es/MoreActionItem/props/defaultProps.js +7 -0
  116. package/es/MoreActionItem/props/propTypes.js +14 -0
  117. package/es/ReplyBubble/ReplyBubble.js +118 -0
  118. package/es/ReplyBubble/css/ReplyBubble.module.css +23 -0
  119. package/es/ReplyBubble/css/cssJSLogic.js +14 -0
  120. package/es/ReplyBubble/index.js +1 -0
  121. package/es/ReplyBubble/props/defaultProps.js +8 -0
  122. package/es/ReplyBubble/props/propTypes.js +28 -0
  123. package/es/ReplyBubbleContent/ReplyBubbleContent.js +61 -0
  124. package/es/ReplyBubbleContent/css/ReplyBubbleContent.module.css +75 -0
  125. package/es/ReplyBubbleContent/css/cssJSLogic.js +13 -0
  126. package/es/ReplyBubbleContent/index.js +1 -0
  127. package/es/ReplyBubbleContent/props/defaultProps.js +6 -0
  128. package/es/ReplyBubbleContent/props/propTypes.js +11 -0
  129. package/es/ReplyBubbleHeader/ReplyBubbleHeader.js +74 -0
  130. package/es/ReplyBubbleHeader/css/ReplyBubbleHeader.module.css +44 -0
  131. package/es/ReplyBubbleHeader/css/cssJSLogic.js +12 -0
  132. package/es/ReplyBubbleHeader/index.js +1 -0
  133. package/es/ReplyBubbleHeader/props/defaultProps.js +7 -0
  134. package/es/ReplyBubbleHeader/props/propTypes.js +13 -0
  135. package/es/TextBubble/TextBubble.js +49 -0
  136. package/es/TextBubble/css/TextBubble.module.css +35 -0
  137. package/es/TextBubble/css/cssJSLogic.js +18 -0
  138. package/es/TextBubble/index.js +1 -0
  139. package/es/TextBubble/props/defaultProps.js +6 -0
  140. package/es/TextBubble/props/propTypes.js +10 -0
  141. package/es/Theme/ThemeAssets.js +78 -0
  142. package/es/Theme/ThemeWrapper.js +88 -0
  143. package/es/Theme/TooltipWrapper.js +85 -0
  144. package/es/Theme/constants/index.js +41 -0
  145. package/es/Theme/css/TooltipWrapper.module.css +10 -0
  146. package/es/Theme/index.js +1 -0
  147. package/es/Theme/props/defaultProps.js +10 -0
  148. package/es/Theme/props/propTypes.js +14 -0
  149. package/es/Theme/themeVariables/commonThemeColorVariable.js +17 -0
  150. package/es/Theme/themeVariables/dark/blueTheme.js +116 -0
  151. package/es/Theme/themeVariables/dark/commonColorVariable.js +16 -0
  152. package/es/Theme/themeVariables/dark/greenTheme.js +115 -0
  153. package/es/Theme/themeVariables/dark/orangeTheme.js +115 -0
  154. package/es/Theme/themeVariables/dark/redTheme.js +115 -0
  155. package/es/Theme/themeVariables/dark/yellowTheme.js +115 -0
  156. package/es/Theme/themeVariables/light/blueTheme.js +114 -0
  157. package/es/Theme/themeVariables/light/commonColorVariable.js +35 -0
  158. package/es/Theme/themeVariables/light/greenTheme.js +114 -0
  159. package/es/Theme/themeVariables/light/orangeTheme.js +114 -0
  160. package/es/Theme/themeVariables/light/redTheme.js +114 -0
  161. package/es/Theme/themeVariables/light/yellowTheme.js +114 -0
  162. package/es/Theme/themeVariables/pureDark/blueTheme.js +115 -0
  163. package/es/Theme/themeVariables/pureDark/commonColorVariable.js +18 -0
  164. package/es/Theme/themeVariables/pureDark/greenTheme.js +115 -0
  165. package/es/Theme/themeVariables/pureDark/orangeTheme.js +115 -0
  166. package/es/Theme/themeVariables/pureDark/redTheme.js +115 -0
  167. package/es/Theme/themeVariables/pureDark/yellowTheme.js +115 -0
  168. package/es/Theme/utils/combineConfigurations.js +17 -0
  169. package/es/Theme/utils/flatVariables.js +12 -0
  170. package/es/Theme/utils/getCustomizedCssVariables.js +19 -0
  171. package/es/Theme/utils/getThemeConfigurations.js +81 -0
  172. package/es/Theme/utils/getWrapperDivProps.js +16 -0
  173. package/es/Video/Video.js +38 -0
  174. package/es/Video/css/Video.module.css +5 -0
  175. package/es/Video/index.js +1 -0
  176. package/es/Video/props/defaultProps.js +6 -0
  177. package/es/Video/props/propTypes.js +8 -0
  178. package/es/VideoBubble/VideoBubble.js +66 -0
  179. package/es/VideoBubble/css/VideoBubble.module.css +12 -0
  180. package/es/VideoBubble/css/cssJSLogic.js +14 -0
  181. package/es/VideoBubble/index.js +1 -0
  182. package/es/VideoBubble/props/defaultProps.js +7 -0
  183. package/es/VideoBubble/props/propTypes.js +17 -0
  184. package/es/constants/index.js +1 -0
  185. package/es/css/common.module.css +6 -0
  186. package/es/icons/create-icon-components.js +172 -0
  187. package/es/icons/factory/attachments/audio.svg +19 -0
  188. package/es/icons/factory/attachments/code.svg +21 -0
  189. package/es/icons/factory/attachments/image.svg +20 -0
  190. package/es/icons/factory/attachments/pdf.svg +19 -0
  191. package/es/icons/factory/attachments/ppt.svg +1 -0
  192. package/es/icons/factory/attachments/text.svg +22 -0
  193. package/es/icons/factory/attachments/unknown.svg +21 -0
  194. package/es/icons/factory/attachments/video.svg +19 -0
  195. package/es/icons/factory/attachments/xls.svg +1 -0
  196. package/es/icons/factory/attachments/zip.svg +27 -0
  197. package/es/icons/factory/common/alertTriangle.svg +5 -0
  198. package/es/icons/factory/common/article.svg +4 -0
  199. package/es/icons/factory/common/reply.svg +6 -0
  200. package/es/icons/factory/messageStatus/clock.svg +7 -0
  201. package/es/icons/factory/messageStatus/doubleTick.svg +1 -0
  202. package/es/icons/factory/messageStatus/failed.svg +7 -0
  203. package/es/icons/factory/messageStatus/tick.svg +1 -0
  204. package/es/icons/icon.template.js +28 -0
  205. package/es/icons/iconSrc/attachments/Audio.js +38 -0
  206. package/es/icons/iconSrc/attachments/Code.js +44 -0
  207. package/es/icons/iconSrc/attachments/Image.js +43 -0
  208. package/es/icons/iconSrc/attachments/Pdf.js +38 -0
  209. package/es/icons/iconSrc/attachments/Ppt.js +26 -0
  210. package/es/icons/iconSrc/attachments/Text.js +47 -0
  211. package/es/icons/iconSrc/attachments/Txt.js +47 -0
  212. package/es/icons/iconSrc/attachments/Unknown.js +42 -0
  213. package/es/icons/iconSrc/attachments/Video.js +38 -0
  214. package/es/icons/iconSrc/attachments/Xls.js +26 -0
  215. package/es/icons/iconSrc/attachments/Zip.js +86 -0
  216. package/es/icons/iconSrc/attachments/index.js +10 -0
  217. package/es/icons/iconSrc/common/AlertTriangle.js +23 -0
  218. package/es/icons/iconSrc/common/Article.js +17 -0
  219. package/es/icons/iconSrc/common/Reply.js +13 -0
  220. package/es/icons/iconSrc/common/index.js +3 -0
  221. package/es/icons/iconSrc/messageStatus/Clock.js +14 -0
  222. package/es/icons/iconSrc/messageStatus/DoubleTick.js +16 -0
  223. package/es/icons/iconSrc/messageStatus/Failed.js +14 -0
  224. package/es/icons/iconSrc/messageStatus/Tick.js +13 -0
  225. package/es/icons/iconSrc/messageStatus/index.js +4 -0
  226. package/es/im/ArticleBubble/ArticleBubble.js +80 -0
  227. package/es/im/ArticleBubble/css/ArticleBubble.module.css +75 -0
  228. package/es/im/ArticleBubble/css/cssJSLogic.js +12 -0
  229. package/es/im/ArticleBubble/index.js +1 -0
  230. package/es/im/ArticleBubble/props/defaultProps.js +6 -0
  231. package/es/im/ArticleBubble/props/propTypes.js +14 -0
  232. package/es/im/IMIntegrationIcon/IMIntegrationIcon.js +73 -0
  233. package/es/im/IMIntegrationIcon/css/IMIntegrationIcon.module.css +72 -0
  234. package/es/im/IMIntegrationIcon/css/cssJSLogic.js +53 -0
  235. package/es/im/IMIntegrationIcon/index.js +1 -0
  236. package/es/im/IMIntegrationIcon/props/defaultProps.js +11 -0
  237. package/es/im/IMIntegrationIcon/props/propTypes.js +14 -0
  238. package/es/im/IMMessage/IMMessage.js +197 -0
  239. package/es/im/IMMessage/css/IMMessage.module.css +36 -0
  240. package/es/im/IMMessage/css/cssJSLogic.js +15 -0
  241. package/es/im/IMMessage/index.js +1 -0
  242. package/es/im/IMMessage/props/defaultProps.js +16 -0
  243. package/es/im/IMMessage/props/propTypes.js +126 -0
  244. package/es/im/IMMessageContent/IMMessageContent.js +128 -0
  245. package/es/im/IMMessageContent/css/IMMessageContent.module.css +8 -0
  246. package/es/im/IMMessageContent/index.js +1 -0
  247. package/es/im/IMMessageContent/props/defaultProps.js +9 -0
  248. package/es/im/IMMessageContent/props/propTypes.js +54 -0
  249. package/es/im/IMMessageMeta/IMMessageMeta.js +72 -0
  250. package/es/im/IMMessageMeta/css/IMMessageMeta.module.css +46 -0
  251. package/es/im/IMMessageMeta/css/cssJSLogic.js +29 -0
  252. package/es/im/IMMessageMeta/index.js +1 -0
  253. package/es/im/IMMessageMeta/props/defaultProps.js +11 -0
  254. package/es/im/IMMessageMeta/props/propTypes.js +42 -0
  255. package/es/im/IMMessageMetaInfo/IMMessageMetaInfo.js +29 -0
  256. package/es/im/IMMessageMetaInfo/css/IMMessageMetaInfo.module.css +14 -0
  257. package/es/im/IMMessageMetaInfo/index.js +1 -0
  258. package/es/im/IMMessageMetaInfo/props/defaultProps.js +8 -0
  259. package/es/im/IMMessageMetaInfo/props/propTypes.js +8 -0
  260. package/es/im/IMPermaLink/IMPermaLink.js +48 -0
  261. package/es/im/IMPermaLink/css/IMPermaLink.module.css +14 -0
  262. package/es/im/IMPermaLink/css/cssJSLogic.js +14 -0
  263. package/es/im/IMPermaLink/index.js +1 -0
  264. package/es/im/IMPermaLink/props/defaultProps.js +6 -0
  265. package/es/im/IMPermaLink/props/propTypes.js +11 -0
  266. package/es/im/IMReplyBubble/IMReplyBubble.js +52 -0
  267. package/es/im/IMReplyBubble/index.js +1 -0
  268. package/es/im/IMReplyBubble/props/defaultProps.js +7 -0
  269. package/es/im/IMReplyBubble/props/propTypes.js +29 -0
  270. package/es/im/IMTextBubble/IMTextBubble.js +40 -0
  271. package/es/im/IMTextBubble/index.js +1 -0
  272. package/es/im/IMTextBubble/props/defaultProps.js +8 -0
  273. package/es/im/IMTextBubble/props/propTypes.js +31 -0
  274. package/es/im/css/common.module.css +6 -0
  275. package/es/im/index.js +9 -0
  276. package/es/index.js +32 -0
  277. package/package.json +49 -0
@@ -0,0 +1,57 @@
1
+ .imageWrapper {
2
+ width: var(--zd_size60) ;
3
+ height: var(--zd_size60) ;
4
+ background-image: url('../images/location.png');
5
+ background-repeat: no-repeat;
6
+ background-size: cover;
7
+ border-radius: 3px;
8
+ }
9
+
10
+ .locationBubble {
11
+ white-space: nowrap;
12
+ width: 100% ;
13
+ box-sizing: border-box;
14
+ background-color: var(--imlib_chat_components_locationBubble_bg_color);
15
+ border: 1px solid var(--imlib_chat_components_locationBubble_border_color);
16
+ padding: var(--zd_size10) ;
17
+ border-radius: 3px;
18
+ }
19
+
20
+ .failedLocationBubble{
21
+ background-color: var(--imlib_chat_components_locationBubble_bg_color_failed);
22
+ border-color: var(--imlib_chat_components_locationBubble_border_color_failed);
23
+ }
24
+
25
+ [dir=ltr] .textWrapper {
26
+ margin: 0 0 0 var(--zd_size8) ;
27
+ }
28
+
29
+ [dir=rtl] .textWrapper {
30
+ margin: 0 var(--zd_size8) 0 0 ;
31
+ }
32
+
33
+ .textLink {
34
+ display: block;
35
+ color: var(--imlib_chat_components_locationBubble_url_color);
36
+ word-break: break-word;
37
+ word-wrap: break-word;
38
+ display: -webkit-box;
39
+ -webkit-line-clamp: 2;
40
+ -webkit-box-orient: vertical;
41
+ overflow: hidden;
42
+ line-height: 1.4;
43
+ white-space: normal;
44
+ }
45
+
46
+ .failedLocationBubble .textLink{
47
+ color: var(--imlib_chat_components_locationBubble_url_color_failed);
48
+ }
49
+
50
+ .container{
51
+ display: flex;
52
+ cursor: pointer;
53
+ }
54
+
55
+ .container:hover .textLink{
56
+ text-decoration: underline !important;
57
+ }
@@ -0,0 +1,13 @@
1
+ import { compileClassNames } from '@zohodesk/utils';
2
+ export default function cssJSLogic(props, style) {
3
+ const {
4
+ isFailed
5
+ } = props;
6
+ const locationBubbleClass = compileClassNames({
7
+ [style.locationBubble]: true,
8
+ [style.failedLocationBubble]: isFailed
9
+ });
10
+ return {
11
+ locationBubbleClass
12
+ };
13
+ }
@@ -0,0 +1 @@
1
+ export { default as LocationBubble } from './LocationBubble';
@@ -0,0 +1,6 @@
1
+ /** ** Constants *** */
2
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
3
+ const locationBubbleDefaultProps = {
4
+ customStyle: dummyObject
5
+ };
6
+ export default locationBubbleDefaultProps;
@@ -0,0 +1,8 @@
1
+ /** ** Libraries *** */
2
+ import PropTypes from 'prop-types';
3
+ const locationBubblePropTypes = {
4
+ locationUrl: PropTypes.string.isRequired,
5
+ customStyle: PropTypes.object,
6
+ isFailed: PropTypes.bool
7
+ };
8
+ export default locationBubblePropTypes;
@@ -0,0 +1,62 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ /** ** Libraries *** */
4
+ import React, { useMemo, Fragment } from 'react';
5
+ /** ** Hooks *** */
6
+
7
+ import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
8
+ import useAttachmentBubble from '@zohoim/chat-components-hooks/es/AttachmentBubble/useAttachmentBubble';
9
+ /** ** Constants *** */
10
+
11
+ import mediaBubbleWrapperDefaultProps from './props/defaultProps';
12
+ import mediaBubbleWrapperPropTypes from './props/propTypes';
13
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
14
+ /** ** Styles *** */
15
+
16
+ import style from './css/MediaBubbleWrapper.module.css';
17
+ /** ** Methods *** */
18
+
19
+ import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
20
+ /** ** Components *** */
21
+
22
+ import AttachmentBubbleInfo from '../AttachmentBubbleInfo/AttachmentBubbleInfo';
23
+ export default function MediaBubbleWrapper(props) {
24
+ const {
25
+ customStyle,
26
+ mediaDetails,
27
+ customProps,
28
+ renderMedia,
29
+ isFailed
30
+ } = props;
31
+ const {
32
+ attachmentBubbleInfoProps = dummyObject
33
+ } = customProps;
34
+ /* External css customization */
35
+
36
+ const newStyle = useMergeStyle(style, customStyle);
37
+ const bubbleInfoCustomStyle = useMemo(() => ({
38
+ attachmentBubbleInfo: newStyle.header
39
+ }), [newStyle.header]);
40
+ const {
41
+ attachmentURL: fileURL,
42
+ formattedFileSize: fileSize,
43
+ fileName,
44
+ attachmentType: fileType
45
+ } = useAttachmentBubble({
46
+ attachmentDetails: mediaDetails
47
+ });
48
+ const mediaComponent = renderHandler(renderMedia)({
49
+ fileURL,
50
+ fileType
51
+ });
52
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(AttachmentBubbleInfo, _extends({
53
+ customStyle: bubbleInfoCustomStyle,
54
+ fileName: fileName,
55
+ fileSize: fileSize
56
+ }, attachmentBubbleInfoProps, {
57
+ isFailed: isFailed
58
+ })), mediaComponent);
59
+ }
60
+ MediaBubbleWrapper.propTypes = mediaBubbleWrapperPropTypes;
61
+ MediaBubbleWrapper.defaultProps = mediaBubbleWrapperDefaultProps;
62
+ MediaBubbleWrapper.displayName = 'MediaBubbleWrapper';
@@ -0,0 +1,7 @@
1
+ .header {
2
+ margin-bottom: var(--zd_size5) ;
3
+ }
4
+
5
+ .audioCont{
6
+ min-width: var(--zd_size300) ;
7
+ }
@@ -0,0 +1 @@
1
+ export { default as MediaBubbleWrapper } from './MediaBubbleWrapper';
@@ -0,0 +1,7 @@
1
+ /** ** Constants *** */
2
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
3
+ const mediaBubbleWrapperDefaultProps = {
4
+ customStyle: dummyObject,
5
+ customProps: dummyObject
6
+ };
7
+ export default mediaBubbleWrapperDefaultProps;
@@ -0,0 +1,17 @@
1
+ /** ** Libraries *** */
2
+ import PropTypes from 'prop-types';
3
+ const mediaBubbleWrapperPropTypes = {
4
+ mediaDetails: PropTypes.shape({
5
+ name: PropTypes.string.isRequired,
6
+ size: PropTypes.string.isRequired,
7
+ type: PropTypes.string.isRequired,
8
+ url: PropTypes.string.isRequired
9
+ }).isRequired,
10
+ renderMedia: PropTypes.func.isRequired,
11
+ customProps: PropTypes.shape({
12
+ attachmentBubbleInfoProps: PropTypes.object
13
+ }),
14
+ customStyle: PropTypes.object,
15
+ isFailed: PropTypes.bool
16
+ };
17
+ export default mediaBubbleWrapperPropTypes;
@@ -0,0 +1,126 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ /** ** Libraries *** */
4
+ import React, { useCallback } from 'react';
5
+ /** ** Constants *** */
6
+
7
+ import messageDefaultProps from './props/defaultProps';
8
+ import messagePropTypes from './props/propTypes';
9
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
10
+ /** ** Components *** */
11
+
12
+ import MessageBubble from '../MessageBubble/MessageBubble';
13
+ import MessageBox from '../MessageBox/MessageBox';
14
+ import MessageAvatar from '../MessageAvatar/MessageAvatar';
15
+ import MessageActions from '../MessageActions/MessageActions';
16
+ import MessageStatus from '../MessageStatus/MessageStatus';
17
+ /** ** Methods *** */
18
+
19
+ import getMessageStatus from '@zohoim/chat-components-utils/es/getMessageStatus';
20
+ import getMessageDirectionType from '@zohoim/chat-components-utils/es/getMessageDirectionType';
21
+ export default function Message(props) {
22
+ const {
23
+ direction,
24
+ isActive,
25
+ isShowSender,
26
+ needSender,
27
+ ownerDetails,
28
+ renderOwnerStatusIcon,
29
+ status,
30
+ statusTooltip,
31
+ isShowMessageStatus,
32
+ actions,
33
+ renderSecondaryActions,
34
+ onSelectAction,
35
+ onMouseEnterAction,
36
+ needMessageActions,
37
+ renderContent,
38
+ customProps
39
+ } = props;
40
+ const {
41
+ messageBubbleProps = dummyObject,
42
+ messageOwnerProps = dummyObject,
43
+ messageBoxProps = dummyObject,
44
+ messageStatusProps = dummyObject,
45
+ messageActionsProps = dummyObject
46
+ } = customProps;
47
+ const {
48
+ isIncoming,
49
+ isOutgoing
50
+ } = getMessageDirectionType({
51
+ messageDetails: {
52
+ direction
53
+ }
54
+ });
55
+ const {
56
+ isFailedMessage: isFailed
57
+ } = getMessageStatus({
58
+ messageDetails: {
59
+ status
60
+ }
61
+ });
62
+ /** ** Render Message Owner *** */
63
+
64
+ const handleRenderMessageOwner = useCallback(() => {
65
+ if (isShowSender) {
66
+ const {
67
+ src,
68
+ alternateSrc,
69
+ name
70
+ } = ownerDetails || dummyObject;
71
+ const props = {
72
+ src,
73
+ alternateSrc,
74
+ title: name,
75
+ renderIcon: renderOwnerStatusIcon
76
+ };
77
+ return /*#__PURE__*/React.createElement(MessageAvatar, _extends({}, props, messageOwnerProps));
78
+ }
79
+
80
+ return null;
81
+ }, [ownerDetails, messageOwnerProps, renderOwnerStatusIcon, isShowSender]);
82
+ /** ** Render Message Status *** */
83
+
84
+ const handleRenderMessageStatus = useCallback(() => {
85
+ const props = {
86
+ messageStatus: status,
87
+ title: statusTooltip
88
+ };
89
+ return isShowMessageStatus && status ? /*#__PURE__*/React.createElement(MessageStatus, _extends({}, props, messageStatusProps)) : null;
90
+ }, [status, statusTooltip, isShowMessageStatus, messageStatusProps]);
91
+ /** ** Render MessageBox *** */
92
+
93
+ const handleRenderMessageBox = useCallback(() => {
94
+ const props = {
95
+ renderMessageStatus: handleRenderMessageStatus,
96
+ renderMessage: renderContent,
97
+ isFailed,
98
+ isIncoming,
99
+ isOutgoing
100
+ };
101
+ return /*#__PURE__*/React.createElement(MessageBox, _extends({}, props, messageBoxProps));
102
+ }, [handleRenderMessageStatus, renderContent, messageBoxProps, isFailed, isIncoming, isOutgoing]);
103
+ /** ** Render Message Actions *** */
104
+
105
+ const handleRenderMessageActions = useCallback(() => {
106
+ const props = {
107
+ actions,
108
+ onSelect: onSelectAction,
109
+ renderSecondaryActions,
110
+ onMouseEnter: onMouseEnterAction
111
+ };
112
+ return /*#__PURE__*/React.createElement(MessageActions, _extends({}, props, messageActionsProps));
113
+ }, [actions, onSelectAction, onMouseEnterAction, renderSecondaryActions, messageActionsProps]);
114
+ return /*#__PURE__*/React.createElement(MessageBubble, _extends({
115
+ direction: direction,
116
+ isActive: isActive,
117
+ needMessageActions: needMessageActions,
118
+ needSender: needSender,
119
+ renderMessageActions: handleRenderMessageActions,
120
+ renderMessageBox: handleRenderMessageBox,
121
+ renderMessageOwner: handleRenderMessageOwner
122
+ }, messageBubbleProps));
123
+ }
124
+ Message.propTypes = messagePropTypes;
125
+ Message.defaultProps = messageDefaultProps;
126
+ Message.displayName = 'Message';
@@ -0,0 +1 @@
1
+ export { default as Message } from './Message';
@@ -0,0 +1,12 @@
1
+ /** ** Constants *** */
2
+ import { direction } from '@zohoim/chat-components-utils/es/constants/messageConstants';
3
+ import { dummyArray, dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
4
+ const messageDefaultProps = {
5
+ direction: direction.IN,
6
+ isActive: false,
7
+ isShowSender: true,
8
+ customProps: dummyObject,
9
+ actions: dummyArray,
10
+ needMessageActions: true
11
+ };
12
+ export default messageDefaultProps;
@@ -0,0 +1,41 @@
1
+ /** ** Libraries *** */
2
+ import PropTypes from 'prop-types';
3
+ /** ** Constants *** */
4
+
5
+ import { defaultMessageActions } from '@zohoim/chat-components-utils/es/constants/messageActionConstants';
6
+ import messageStatusConstants from '@zohoim/chat-components-utils/es/constants/messageStatusConstants';
7
+ import { direction } from '@zohoim/chat-components-utils/es/constants/messageConstants';
8
+ const messagePropTypes = {
9
+ direction: PropTypes.oneOf(Object.values(direction)).isRequired,
10
+ renderContent: PropTypes.func.isRequired,
11
+ isActive: PropTypes.bool,
12
+ isShowSender: PropTypes.bool,
13
+ needSender: PropTypes.bool,
14
+ ownerDetails: PropTypes.shape({
15
+ alternateSrc: PropTypes.string,
16
+ name: PropTypes.string,
17
+ src: PropTypes.string
18
+ }),
19
+ renderOwnerStatusIcon: PropTypes.func,
20
+ status: PropTypes.oneOf(Object.values(messageStatusConstants)),
21
+ statusTooltip: PropTypes.string,
22
+ isShowMessageStatus: PropTypes.bool,
23
+ actions: PropTypes.arrayOf(PropTypes.shape({
24
+ displayText: PropTypes.string.isRequired,
25
+ id: PropTypes.oneOfType([PropTypes.string, PropTypes.oneOf(Object.values(defaultMessageActions))]).isRequired,
26
+ iconTitle: PropTypes.string,
27
+ isDisabled: PropTypes.bool,
28
+ renderFunction: PropTypes.func
29
+ })),
30
+ onSelectAction: PropTypes.func.isRequired,
31
+ renderSecondaryActions: PropTypes.func,
32
+ needMessageActions: PropTypes.bool,
33
+ customProps: PropTypes.shape({
34
+ messageActionsProps: PropTypes.object,
35
+ messageBoxProps: PropTypes.object,
36
+ messageBubbleProps: PropTypes.object,
37
+ messageOwnerProps: PropTypes.object,
38
+ messageStatusProps: PropTypes.object
39
+ })
40
+ };
41
+ export default messagePropTypes;
@@ -0,0 +1,60 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ /** ** Libraries *** */
4
+ import React, { useCallback } from 'react';
5
+ /** ** Components *** */
6
+
7
+ import MoreActionItem from '../MoreActionItem/MoreActionItem';
8
+ import ActionIcon from '../ActionIcon/ActionIcon';
9
+ /** ** Constants *** */
10
+
11
+ import messageActionsDefaultProps from './props/defaultProps';
12
+ import messageActionsPropTypes from './props/propTypes';
13
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
14
+ export default function MessageAction(props) {
15
+ const {
16
+ displayText,
17
+ id,
18
+ onClick,
19
+ onMouseEnter,
20
+ isShowInMore,
21
+ iconTitle,
22
+ customProps,
23
+ closePopup,
24
+ isDisabled,
25
+ needMoreActionItemIcon
26
+ } = props;
27
+ const {
28
+ moreActionItemProps = dummyObject,
29
+ actionIconProps = dummyObject
30
+ } = customProps;
31
+ const renderIcon = useCallback( // eslint-disable-next-line no-confusing-arrow
32
+ function () {
33
+ let {
34
+ id
35
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
36
+ return needMoreActionItemIcon ? /*#__PURE__*/React.createElement(ActionIcon, _extends({
37
+ id: id,
38
+ needIconOnly: true
39
+ }, actionIconProps)) : null;
40
+ }, [actionIconProps, needMoreActionItemIcon]);
41
+ return isShowInMore ? /*#__PURE__*/React.createElement(MoreActionItem, _extends({
42
+ closePopup: closePopup,
43
+ displayText: displayText,
44
+ id: id,
45
+ isDisabled: isDisabled,
46
+ needIcon: needMoreActionItemIcon,
47
+ onClick: onClick,
48
+ onMouseEnter: onMouseEnter,
49
+ renderIcon: renderIcon,
50
+ title: iconTitle
51
+ }, moreActionItemProps)) : /*#__PURE__*/React.createElement(ActionIcon, _extends({
52
+ id: id,
53
+ isDisabled: isDisabled,
54
+ onClick: onClick,
55
+ onMouseEnter: onMouseEnter,
56
+ title: iconTitle
57
+ }, actionIconProps));
58
+ }
59
+ MessageAction.propTypes = messageActionsPropTypes;
60
+ MessageAction.defaultProps = messageActionsDefaultProps;
@@ -0,0 +1 @@
1
+ export { default as MessageAction } from './MessageAction';
@@ -0,0 +1,8 @@
1
+ /** ** Constants *** */
2
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
3
+ const messageActionDefaultProps = {
4
+ customProps: dummyObject,
5
+ isShowInMore: false,
6
+ needMoreActionItemIcon: true
7
+ };
8
+ export default messageActionDefaultProps;
@@ -0,0 +1,21 @@
1
+ /** ** Libraries *** */
2
+ import PropTypes from 'prop-types';
3
+ /** ** Constants *** */
4
+
5
+ import { defaultMessageActions } from '@zohoim/chat-components-utils/es/constants/messageActionConstants';
6
+ const messageActionPropTypes = {
7
+ displayText: PropTypes.string.isRequired,
8
+ id: PropTypes.oneOf(Object.values(defaultMessageActions)).isRequired,
9
+ onClick: PropTypes.func.isRequired,
10
+ onMouseEnter: PropTypes.func,
11
+ closePopup: PropTypes.func,
12
+ customProps: PropTypes.shape({
13
+ actionIconProps: PropTypes.object,
14
+ moreActionItemProps: PropTypes.object
15
+ }),
16
+ iconTitle: PropTypes.string,
17
+ isDisabled: PropTypes.bool,
18
+ isShowInMore: PropTypes.bool,
19
+ needMoreActionItemIcon: PropTypes.bool
20
+ };
21
+ export default messageActionPropTypes;
@@ -0,0 +1,120 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ /** ** Libraries *** */
4
+ import React, { useCallback, Fragment } from 'react';
5
+ /** ** Components *** */
6
+
7
+ import ActionIconWrapper from '../ActionIconWrapper/ActionIconWrapper';
8
+ import MessageActionsWrapper from '../MessageActionsWrapper/MessageActionsWrapper';
9
+ import MessageAction from '../MessageAction/MessageAction';
10
+ /** ** Icons *** */
11
+
12
+ import MoreIcon from '@zohodesk/icon/es/general/More';
13
+ /** ** Hooks *** */
14
+
15
+ import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
16
+ import useMessageActions from '@zohoim/chat-components-hooks/es/MessageActions/useMessageActions';
17
+ /** ** Constants *** */
18
+
19
+ import messageActionsDefaultProps from './props/defaultProps';
20
+ import messageActionsPropTypes from './props/propTypes';
21
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
22
+ /** ** CSS *** */
23
+
24
+ import style from './css/MessageActions.module.css';
25
+ export default function MessageActions(props) {
26
+ const {
27
+ actions,
28
+ defaultShowCount,
29
+ onSelect,
30
+ onMouseEnter,
31
+ renderSecondaryActions,
32
+ customStyle,
33
+ customProps
34
+ } = props;
35
+ const {
36
+ messageActionProps = dummyObject,
37
+ actionIconWrapperProps = dummyObject,
38
+ messageActionsWrapperProps = dummyObject
39
+ } = customProps;
40
+ /* External CSS Customization */
41
+
42
+ const newStyle = useMergeStyle(style, customStyle);
43
+ const handleClickAction = useCallback(_ref => {
44
+ let {
45
+ id,
46
+ e
47
+ } = _ref;
48
+ onSelect && onSelect({
49
+ id,
50
+ e
51
+ });
52
+ }, [onSelect]);
53
+ const handleMouseEnterAction = useCallback(_ref2 => {
54
+ let {
55
+ id,
56
+ e
57
+ } = _ref2;
58
+ onMouseEnter && onMouseEnter({
59
+ id,
60
+ e
61
+ });
62
+ }, [onMouseEnter]);
63
+ /* External Action Icon */
64
+
65
+ const renderAction = useCallback(function () {
66
+ let {
67
+ id,
68
+ isShowInMore,
69
+ action,
70
+ closePopup
71
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
72
+ const {
73
+ displayText,
74
+ iconTitle,
75
+ isDisabled
76
+ } = action || dummyObject;
77
+ return /*#__PURE__*/React.createElement(MessageAction, _extends({
78
+ key: id,
79
+ closePopup: closePopup,
80
+ displayText: displayText,
81
+ iconTitle: iconTitle,
82
+ id: id,
83
+ isDisabled: isDisabled,
84
+ isShowInMore: isShowInMore,
85
+ onClick: handleClickAction,
86
+ onMouseEnter: handleMouseEnterAction
87
+ }, messageActionProps));
88
+ }, [handleClickAction, handleMouseEnterAction, messageActionProps]);
89
+ /* Hooks handling */
90
+
91
+ const {
92
+ actionDetails,
93
+ secondaryActions
94
+ } = useMessageActions({
95
+ actions,
96
+ defaultRenderFunction: renderAction,
97
+ renderSecondaryActions
98
+ });
99
+ const {
100
+ allActions
101
+ } = actionDetails;
102
+ /* Render More Icon */
103
+
104
+ const renderMoreIcon = useCallback(() => /*#__PURE__*/React.createElement("div", {
105
+ className: newStyle.moreIcon
106
+ }, /*#__PURE__*/React.createElement(MoreIcon, null)), [newStyle.moreIcon]);
107
+ const renderMore = useCallback(() => /*#__PURE__*/React.createElement(ActionIconWrapper, _extends({
108
+ renderIcon: renderMoreIcon
109
+ }, actionIconWrapperProps)), [actionIconWrapperProps, renderMoreIcon]);
110
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(MessageActionsWrapper, _extends({
111
+ actions: allActions,
112
+ defaultShowCount: defaultShowCount,
113
+ renderMoreIcon: renderMore
114
+ }, messageActionsWrapperProps)), secondaryActions ? /*#__PURE__*/React.createElement("div", {
115
+ className: newStyle.secondaryActions
116
+ }, secondaryActions) : null);
117
+ }
118
+ MessageActions.propTypes = messageActionsPropTypes;
119
+ MessageActions.defaultProps = messageActionsDefaultProps;
120
+ MessageActions.displayName = 'MessageActions';
@@ -0,0 +1,24 @@
1
+ .varClass {
2
+ /* --messageActions-secondaryActions_margin: 5px; */
3
+ }
4
+
5
+ [dir=ltr] .moreIcon svg {
6
+ transform: rotate(90deg);
7
+ }
8
+
9
+ [dir=rtl] .moreIcon svg {
10
+ transform: rotate(-90deg);
11
+ }
12
+
13
+ .secondaryActions {
14
+ composes: varClass;
15
+ /* margin-top: var(--messageActions-secondaryActions_margin); */
16
+ }
17
+
18
+ [dir=ltr] .secondaryActions {
19
+ text-align: left;
20
+ }
21
+
22
+ [dir=rtl] .secondaryActions {
23
+ text-align: right;
24
+ }
@@ -0,0 +1 @@
1
+ export { default as MessageActions } from './MessageActions';
@@ -0,0 +1,10 @@
1
+ /** ** Constants *** */
2
+ import { dummyObject, dummyArray } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
3
+ import { actionsDefaultShowCount } from '@zohoim/chat-components-utils/es/constants/messageActionConstants';
4
+ const messageActionsDefaultProps = {
5
+ customStyle: dummyObject,
6
+ customProps: dummyObject,
7
+ defaultShowCount: actionsDefaultShowCount,
8
+ actions: dummyArray
9
+ };
10
+ export default messageActionsDefaultProps;
@@ -0,0 +1,25 @@
1
+ /** ** Libraries *** */
2
+ import PropTypes from 'prop-types';
3
+ /** ** Constants *** */
4
+
5
+ import { defaultMessageActions } from '@zohoim/chat-components-utils/es/constants/messageActionConstants';
6
+ const messageActionsPropTypes = {
7
+ actions: PropTypes.arrayOf(PropTypes.shape({
8
+ displayText: PropTypes.string.isRequired,
9
+ id: PropTypes.oneOfType([PropTypes.string, PropTypes.oneOf(Object.values(defaultMessageActions))]).isRequired,
10
+ iconTitle: PropTypes.string,
11
+ isDisabled: PropTypes.bool,
12
+ renderFunction: PropTypes.func
13
+ })).isRequired,
14
+ onSelect: PropTypes.func.isRequired,
15
+ onMouseEnter: PropTypes.func,
16
+ customProps: PropTypes.shape({
17
+ actionIconWrapperProps: PropTypes.object,
18
+ messageActionProps: PropTypes.object,
19
+ messageActionsWrapperProps: PropTypes.object
20
+ }),
21
+ customStyle: PropTypes.object,
22
+ defaultShowCount: PropTypes.number,
23
+ renderSecondaryActions: PropTypes.func
24
+ };
25
+ export default messageActionsPropTypes;