@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,8 @@
1
+ /** ** Constants *** */
2
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
3
+ const attachmentIconDefaultProps = {
4
+ isDisabled: false,
5
+ isValidAttachment: true,
6
+ customStyle: dummyObject
7
+ };
8
+ export default attachmentIconDefaultProps;
@@ -0,0 +1,21 @@
1
+ /** ** Libraries *** */
2
+ import PropTypes from 'prop-types';
3
+ /** ** Constants *** */
4
+
5
+ import attachmentFileTypes from '@zohoim/chat-components-utils/es/constants/attachmentFileTypes';
6
+ const {
7
+ AUDIO,
8
+ VIDEO,
9
+ IMAGE
10
+ } = attachmentFileTypes; // Docs - Playground Component Render Issue Fix
11
+
12
+ const fileFormats = JSON.parse(JSON.stringify(Object.values(attachmentFileTypes)));
13
+ const attachmentIconPropTypes = {
14
+ fileFormat: PropTypes.oneOf(fileFormats).isRequired,
15
+ mediaType: PropTypes.oneOf([AUDIO, VIDEO, IMAGE]).isRequired,
16
+ isDisabled: PropTypes.bool,
17
+ customStyle: PropTypes.object,
18
+ renderCustomIcon: PropTypes.func,
19
+ isValidAttachment: PropTypes.bool
20
+ };
21
+ export default attachmentIconPropTypes;
@@ -0,0 +1,81 @@
1
+ /** ** Icons *** */
2
+ import AudioIcon from '../../icons/iconSrc/attachments/Audio';
3
+ import CodeIcon from '../../icons/iconSrc/attachments/Code';
4
+ import ImageIcon from '../../icons/iconSrc/attachments/Image';
5
+ import PdfIcon from '../../icons/iconSrc/attachments/Pdf';
6
+ import TextIcon from '../../icons/iconSrc/attachments/Text';
7
+ import UnknownIcon from '../../icons/iconSrc/attachments/Unknown';
8
+ import VideoIcon from '../../icons/iconSrc/attachments/Video';
9
+ import ZipIcon from '../../icons/iconSrc/attachments/Zip';
10
+ import AlertIcon from '../../icons/iconSrc/common/AlertTriangle';
11
+ import XlsIcon from '../../icons/iconSrc/attachments/Xls';
12
+ import PptIcon from '../../icons/iconSrc/attachments/Ppt';
13
+ /** ** Constants *** */
14
+
15
+ import attachmentFileTypes from '@zohoim/chat-components-utils/es/constants/attachmentFileTypes';
16
+ const {
17
+ SVG,
18
+ IMAGE,
19
+ PDF,
20
+ AUDIO,
21
+ VIDEO,
22
+ MP3,
23
+ MPEG,
24
+ VORBIS,
25
+ OGG,
26
+ M4A,
27
+ MP4,
28
+ HTML,
29
+ PSD,
30
+ CSS,
31
+ TEXT,
32
+ PLAIN,
33
+ XLS,
34
+ PPT,
35
+ ZIP,
36
+ UNDEFINED,
37
+ INVALID
38
+ } = attachmentFileTypes;
39
+ export default function getAttachmentIconComponent(_ref) {
40
+ let {
41
+ fileFormat,
42
+ mediaType,
43
+ isValidAttachment
44
+ } = _ref;
45
+ const iconMapping = {
46
+ [SVG]: CodeIcon,
47
+ [IMAGE]: ImageIcon,
48
+ [PDF]: PdfIcon,
49
+ [AUDIO]: AudioIcon,
50
+ [VIDEO]: VideoIcon,
51
+ [MP3]: AudioIcon,
52
+ [MPEG]: AudioIcon,
53
+ [VORBIS]: AudioIcon,
54
+ [OGG]: AudioIcon,
55
+ [M4A]: AudioIcon,
56
+ [MP4]: VideoIcon,
57
+ [HTML]: CodeIcon,
58
+ [PSD]: UnknownIcon,
59
+ [CSS]: CodeIcon,
60
+ [TEXT]: TextIcon,
61
+ [PLAIN]: TextIcon,
62
+ [XLS]: XlsIcon,
63
+ [PPT]: PptIcon,
64
+ [ZIP]: ZipIcon,
65
+ [UNDEFINED]: UnknownIcon,
66
+ [INVALID]: AlertIcon
67
+ };
68
+ let IconComponent;
69
+
70
+ if (!isValidAttachment) {
71
+ IconComponent = iconMapping[INVALID];
72
+ } else if (attachmentFileTypes[mediaType]) {
73
+ IconComponent = iconMapping[attachmentFileTypes[mediaType]];
74
+ } else {
75
+ IconComponent = iconMapping[fileFormat] || iconMapping[UNDEFINED];
76
+ }
77
+
78
+ return {
79
+ IconComponent
80
+ };
81
+ }
@@ -0,0 +1,38 @@
1
+ /** ** Libraries *** */
2
+ import React from 'react';
3
+ /** ** Hooks *** */
4
+
5
+ import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
6
+ import useMedia from '@zohoim/chat-components-hooks/es/Media/useMedia';
7
+ /** ** Constants *** */
8
+
9
+ import audioDefaultProps from './props/defaultProps';
10
+ import audioPropTypes from './props/propTypes';
11
+ /** ** Styles *** */
12
+
13
+ import style from './css/Audio.module.css';
14
+ export default function Audio(props) {
15
+ const {
16
+ customStyle,
17
+ fileType,
18
+ fileURL
19
+ } = props;
20
+ const {
21
+ mediaElementRef
22
+ } = useMedia(props);
23
+ /* External CSS Customization */
24
+
25
+ const newStyle = useMergeStyle(style, customStyle);
26
+ return /*#__PURE__*/React.createElement("audio", {
27
+ ref: mediaElementRef,
28
+ className: newStyle.audio,
29
+ controls: true,
30
+ preload: "metadata"
31
+ }, /*#__PURE__*/React.createElement("source", {
32
+ "data-src": fileURL,
33
+ type: fileType
34
+ }));
35
+ }
36
+ Audio.propTypes = audioPropTypes;
37
+ Audio.defaultProps = audioDefaultProps;
38
+ Audio.displayName = 'Audio';
@@ -0,0 +1,7 @@
1
+ .audio {
2
+ width: 100% ;
3
+ }
4
+
5
+ .audio::-webkit-media-controls-panel {
6
+ background-color: var(--dot_white);
7
+ }
@@ -0,0 +1 @@
1
+ export { default as Audio } from './Audio';
@@ -0,0 +1,6 @@
1
+ /** ** Constants *** */
2
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
3
+ const audioDefaultProps = {
4
+ customStyle: dummyObject
5
+ };
6
+ export default audioDefaultProps;
@@ -0,0 +1,8 @@
1
+ /** ** Libraries *** */
2
+ import PropTypes from 'prop-types';
3
+ const audioPropTypes = {
4
+ fileType: PropTypes.string.isRequired,
5
+ fileURL: PropTypes.string.isRequired,
6
+ customStyle: PropTypes.object
7
+ };
8
+ export default audioPropTypes;
@@ -0,0 +1,56 @@
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
+ /** ** Hooks *** */
6
+
7
+ import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
8
+ /** ** Constants *** */
9
+
10
+ import audioBubbleDefaultProps from './props/defaultProps';
11
+ import audioBubblePropTypes from './props/propTypes';
12
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
13
+ /** ** Styles *** */
14
+
15
+ import style from './css/AudioBubble.module.css';
16
+ /** ** Components *** */
17
+
18
+ import { Box } from '@zohodesk/components/es/Layout';
19
+ import MediaBubbleWrapper from '../MediaBubbleWrapper/MediaBubbleWrapper';
20
+ import Audio from '../Audio/Audio';
21
+ export default function AudioBubble(props) {
22
+ const {
23
+ customStyle,
24
+ audioDetails,
25
+ customProps,
26
+ isFailed
27
+ } = props;
28
+ const {
29
+ audioProps = dummyObject,
30
+ mediaBubbleWrapperProps = dummyObject
31
+ } = customProps;
32
+ /* External CSS Customization */
33
+
34
+ const newStyle = useMergeStyle(style, customStyle);
35
+ const renderMedia = useCallback(_ref => {
36
+ let {
37
+ fileURL,
38
+ fileType
39
+ } = _ref;
40
+ return /*#__PURE__*/React.createElement(Box, {
41
+ className: newStyle.audioBubble
42
+ }, /*#__PURE__*/React.createElement(Audio, _extends({
43
+ fileType: fileType,
44
+ fileURL: fileURL
45
+ }, audioProps)));
46
+ }, [audioProps, newStyle.audioBubble]);
47
+ return /*#__PURE__*/React.createElement(MediaBubbleWrapper, _extends({
48
+ mediaDetails: audioDetails,
49
+ renderMedia: renderMedia
50
+ }, mediaBubbleWrapperProps, {
51
+ isFailed: isFailed
52
+ }));
53
+ }
54
+ AudioBubble.propTypes = audioBubblePropTypes;
55
+ AudioBubble.defaultProps = audioBubbleDefaultProps;
56
+ AudioBubble.displayName = 'AudioBubble';
@@ -0,0 +1,4 @@
1
+ .audioBubble{
2
+ width: var(--zd_size360) ;
3
+ max-width: 100% ;
4
+ }
@@ -0,0 +1 @@
1
+ export { default as AudioBubble } from './AudioBubble';
@@ -0,0 +1,7 @@
1
+ /** ** Constants *** */
2
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
3
+ const audioBubbleDefaultProps = {
4
+ customStyle: dummyObject,
5
+ customProps: dummyObject
6
+ };
7
+ export default audioBubbleDefaultProps;
@@ -0,0 +1,16 @@
1
+ /** ** Libraries *** */
2
+ import PropTypes from 'prop-types';
3
+ const audioBubblePropTypes = {
4
+ audioDetails: 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
+ customProps: PropTypes.shape({
11
+ audioProps: PropTypes.object,
12
+ mediaBubbleWrapperProps: PropTypes.object
13
+ }),
14
+ isFailed: PropTypes.bool
15
+ };
16
+ export default audioBubblePropTypes;
@@ -0,0 +1,62 @@
1
+ /* $Id$ */
2
+
3
+ @font-face {
4
+ font-family: 'ZohoPuviLight';
5
+ src: url('https://static.zohocdn.com/zohofonts/zohopuvi/4.0/Zoho_Puvi_Light.woff2')
6
+ format('woff2');
7
+ font-style: normal;
8
+ font-weight: normal;
9
+ text-rendering: optimizeLegibility;
10
+ font-display: swap;
11
+ }
12
+
13
+ @font-face {
14
+ font-family: 'ZohoPuviRegular';
15
+ src: url('https://static.zohocdn.com/zohofonts/zohopuvi/4.0/Zoho_Puvi_Regular.woff2')
16
+ format('woff2');
17
+ font-style: normal;
18
+ font-weight: normal;
19
+ text-rendering: optimizeLegibility;
20
+ font-display: swap;
21
+ }
22
+
23
+ @font-face {
24
+ font-family: 'ZohoPuviSemiBold';
25
+ src: url('https://static.zohocdn.com/zohofonts/zohopuvi/4.0/Zoho_Puvi_Semibold.woff2')
26
+ format('woff2');
27
+ font-style: normal;
28
+ font-weight: normal;
29
+ text-rendering: optimizeLegibility;
30
+ font-display: swap;
31
+ }
32
+
33
+ @font-face {
34
+ font-family: 'ZohoPuviBold';
35
+ src: url('https://static.zohocdn.com/zohofonts/zohopuvi/4.0/Zoho_Puvi_Bold.woff2')
36
+ format('woff2');
37
+ font-style: normal;
38
+ font-weight: bold;
39
+ text-rendering: optimizeLegibility;
40
+ font-display: swap;
41
+ }
42
+
43
+ @font-face {
44
+ font-family: 'ZohoPuviExtBd';
45
+ src: url('https://static.zohocdn.com/zohofonts/zohopuvi/4.0/Zoho_Puvi_Extrabold.woff2')
46
+ format('woff2');
47
+ font-style: normal;
48
+ font-weight: normal;
49
+ text-rendering: optimizeLegibility;
50
+ font-display: swap;
51
+ }
52
+
53
+ @font-face {
54
+ font-family: 'ZohoPuviMedium';
55
+ src: url('https://static.zohocdn.com/zohofonts/zohopuvi/4.0/Zoho_Puvi_Medium.woff2')
56
+ format('woff2');
57
+ font-style: normal;
58
+ font-weight: normal;
59
+ text-rendering: optimizeLegibility;
60
+ font-display: swap;
61
+ }
62
+
@@ -0,0 +1,70 @@
1
+ /** ** Libraries *** */
2
+ import React, { useMemo } from 'react';
3
+ /** ** Hooks *** */
4
+
5
+ import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
6
+ import useAttachmentBubble from '@zohoim/chat-components-hooks/es/AttachmentBubble/useAttachmentBubble';
7
+ /** ** Constants *** */
8
+
9
+ import imageBubbleDefaultProps from './props/defaultProps';
10
+ import imageBubblePropTypes from './props/propTypes';
11
+ /** ** Styles *** */
12
+
13
+ import style from './css/ImageBubble.module.css';
14
+ /** ** Components *** */
15
+
16
+ import { Container } from '@zohodesk/components/es/Layout';
17
+ import LazyLoadImage from '../LazyLoadImage/LazyLoadImage';
18
+ /** ** Methods *** */
19
+
20
+ import cssJSLogic from './css/cssJSLogic';
21
+ export default function ImageBubble(props) {
22
+ const {
23
+ customStyle,
24
+ imageDetails,
25
+ isFailed,
26
+ isSending,
27
+ onClick: propOnClick
28
+ } = props;
29
+ /* External CSS Customization */
30
+
31
+ const newStyle = useMergeStyle(style, customStyle);
32
+ /* css classnames added based on logic */
33
+
34
+ const {
35
+ imageBubbleClass
36
+ } = cssJSLogic({
37
+ isFailed,
38
+ isSending
39
+ }, newStyle);
40
+ const imageStyle = useMemo(() => ({
41
+ lazyLoadImage: newStyle.image
42
+ }), [newStyle.image]);
43
+ const blurImageStyle = useMemo(() => ({
44
+ lazyLoadImage: newStyle.blurImage
45
+ }), [newStyle.blurImage]);
46
+ const {
47
+ attachmentURL: src,
48
+ fileName: alternate,
49
+ onClick
50
+ } = useAttachmentBubble({
51
+ attachmentDetails: imageDetails,
52
+ onClick: propOnClick
53
+ });
54
+ return /*#__PURE__*/React.createElement(Container, {
55
+ align: "both",
56
+ className: imageBubbleClass,
57
+ onClick: onClick
58
+ }, /*#__PURE__*/React.createElement(LazyLoadImage, {
59
+ alternate: alternate,
60
+ customStyle: blurImageStyle,
61
+ src: src
62
+ }), /*#__PURE__*/React.createElement(LazyLoadImage, {
63
+ alternate: alternate,
64
+ customStyle: imageStyle,
65
+ src: src
66
+ }));
67
+ }
68
+ ImageBubble.propTypes = imageBubblePropTypes;
69
+ ImageBubble.defaultProps = imageBubbleDefaultProps;
70
+ ImageBubble.displayName = 'ImageBubble';
@@ -0,0 +1,63 @@
1
+ .varClass {
2
+ --imageBubble-wrapper_height: var(--zd_size200);
3
+ --imageBubble-wrapper_width: 23.75rem;
4
+ --imageBubble-wrapper_max_width: 100%;
5
+ --imageBubble-blur_img_width: 100%;
6
+ --imageBubble-blur_img_height: 100%;
7
+ /* --imageBubble-blur_img_blurpx: 90px; */
8
+ --imageBubble-img_max_width: 100%;
9
+ --imageBubble-img_max_height: 100%;
10
+ }
11
+
12
+ .imageBubbleWrapper {
13
+ composes: varClass;
14
+ width: var(--imageBubble-wrapper_width) !important;
15
+ max-width: var(--imageBubble-wrapper_max_width);
16
+ height: var(--imageBubble-wrapper_height) !important;
17
+ color: var(--imlib_chat_components_imageBubble_alt_text_color);
18
+ overflow: hidden;
19
+ position: relative;
20
+ cursor: pointer;
21
+ background-color: var(--imlib_chat_components_imageBubble_bg_color);
22
+ border-radius: 3px;
23
+ border: 1px solid var(--imlib_chat_components_imageBubble_border_color);
24
+ }
25
+
26
+ .failedImageBubble {
27
+ color: var(--imlib_chat_components_imageBubble_alt_text_color_failed);
28
+ background-color: var(--imlib_chat_components_imageBubble_bg_color_failed);
29
+ border-color: var(--imlib_chat_components_imageBubble_border_color_failed);
30
+ }
31
+
32
+ .blurImage {
33
+ object-fit: cover;
34
+ -webkit-filter: blur(90px);
35
+ filter: blur(90px);
36
+ position: absolute;
37
+ top: 0 ;
38
+ bottom: 0 ;
39
+ width: var(--imageBubble-blur_img_width);
40
+ height: var(--imageBubble-blur_img_height);
41
+ }
42
+
43
+ [dir=ltr] .blurImage {
44
+ right: 0 ;
45
+ left: 0 ;
46
+ }
47
+
48
+ [dir=rtl] .blurImage {
49
+ left: 0 ;
50
+ right: 0 ;
51
+ }
52
+
53
+ .image {
54
+ max-width: var(--imageBubble-img_max_width);
55
+ max-height: var(--imageBubble-img_max_height);
56
+ object-fit: contain;
57
+ position: relative;
58
+ }
59
+
60
+ .sendingImageBubble {
61
+ opacity: 0.1;
62
+ cursor: default;
63
+ }
@@ -0,0 +1,15 @@
1
+ import { compileClassNames } from '@zohodesk/utils';
2
+ export default function cssJSLogic(props, style) {
3
+ const {
4
+ isFailed,
5
+ isSending
6
+ } = props;
7
+ const imageBubbleClass = compileClassNames({
8
+ [style.imageBubbleWrapper]: true,
9
+ [style.failedImageBubble]: isFailed,
10
+ [style.sendingImageBubble]: isSending
11
+ });
12
+ return {
13
+ imageBubbleClass
14
+ };
15
+ }
@@ -0,0 +1 @@
1
+ export { default as ImageBubble } from './ImageBubble';
@@ -0,0 +1,6 @@
1
+ /** ** Constants *** */
2
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
3
+ const imageBubbleDefaultProps = {
4
+ customStyle: dummyObject
5
+ };
6
+ export default imageBubbleDefaultProps;
@@ -0,0 +1,13 @@
1
+ /** ** Libraries *** */
2
+ import PropTypes from 'prop-types';
3
+ const imageBubblePropTypes = {
4
+ imageDetails: PropTypes.shape({
5
+ url: PropTypes.string.isRequired,
6
+ name: PropTypes.string
7
+ }).isRequired,
8
+ customStyle: PropTypes.object,
9
+ isFailed: PropTypes.bool,
10
+ isSending: PropTypes.bool,
11
+ onClick: PropTypes.func
12
+ };
13
+ export default imageBubblePropTypes;
@@ -0,0 +1,37 @@
1
+ /** ** Libraries *** */
2
+ import React from 'react';
3
+ /** ** Hooks *** */
4
+
5
+ import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
6
+ import useLazyLoadImage from '@zohoim/chat-components-hooks/es/ImageBubble/useLazyLoadImage';
7
+ /** ** Constants *** */
8
+
9
+ import lazyLoadImageDefaultProps from './props/defaultProps';
10
+ import lazyLoadImagePropTypes from './props/propTypes';
11
+ /** ** Styles *** */
12
+
13
+ import style from './css/LazyLoadImage.module.css';
14
+ export default function LazyLoadImage(props) {
15
+ const {
16
+ customStyle,
17
+ src,
18
+ alternate
19
+ } = props;
20
+ const {
21
+ imageElementRef
22
+ } = useLazyLoadImage();
23
+ /* External CSS Customization */
24
+
25
+ const newStyle = useMergeStyle(style, customStyle);
26
+ return /*#__PURE__*/React.createElement("img", {
27
+ ref: imageElementRef,
28
+ alt: alternate,
29
+ className: `lazy ${newStyle.lazyLoadImage || ''}`,
30
+ "data-src": src,
31
+ "data-srcset": src,
32
+ src: ""
33
+ });
34
+ }
35
+ LazyLoadImage.propTypes = lazyLoadImagePropTypes;
36
+ LazyLoadImage.defaultProps = lazyLoadImageDefaultProps;
37
+ LazyLoadImage.displayName = 'LazyLoadImage';
@@ -0,0 +1,5 @@
1
+ .lazyLoadImage {
2
+ /* height: 100%;
3
+ width: 100%; */
4
+ /* Use this class name for css customisation */
5
+ }
@@ -0,0 +1 @@
1
+ export { default as LazyLoadImage } from './LazyLoadImage';
@@ -0,0 +1,6 @@
1
+ /** ** Constants *** */
2
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
3
+ const lazyLoadImageDefaultProps = {
4
+ customStyle: dummyObject
5
+ };
6
+ export default lazyLoadImageDefaultProps;
@@ -0,0 +1,8 @@
1
+ /** ** Libraries *** */
2
+ import PropTypes from 'prop-types';
3
+ const lazyLoadImagePropTypes = {
4
+ src: PropTypes.string.isRequired,
5
+ alternate: PropTypes.string,
6
+ customStyle: PropTypes.object
7
+ };
8
+ export default lazyLoadImagePropTypes;
@@ -0,0 +1,62 @@
1
+ /* eslint-disable jsx-a11y/anchor-is-valid */
2
+
3
+ /* eslint-disable @zohodesk/zsecurity/no-protocol-check */
4
+
5
+ /** ** Libraries *** */
6
+ import React from 'react';
7
+ /** ** Hooks *** */
8
+
9
+ import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
10
+ /** ** Constants *** */
11
+
12
+ import locationBubbleDefaultProps from './props/defaultProps';
13
+ import locationBubblePropTypes from './props/propTypes';
14
+ /** ** Components *** */
15
+
16
+ import { Container, Box } from '@zohodesk/components/es/Layout';
17
+ /** ** Styles *** */
18
+
19
+ import style from './css/LocationBubble.module.css';
20
+ /** ** Methods *** */
21
+
22
+ import cssJSLogic from './css/cssJSLogic';
23
+ export default function LocationBubble(props) {
24
+ const {
25
+ customStyle,
26
+ locationUrl,
27
+ isFailed
28
+ } = props;
29
+ /* External CSS Customization */
30
+
31
+ const newStyle = useMergeStyle(style, customStyle);
32
+ /* css classnames added based on logic */
33
+
34
+ const {
35
+ locationBubbleClass
36
+ } = cssJSLogic({
37
+ isFailed
38
+ }, newStyle);
39
+ return /*#__PURE__*/React.createElement("a", {
40
+ className: newStyle.container,
41
+ href: locationUrl,
42
+ rel: "noreferrer noopener",
43
+ target: "_blank"
44
+ }, /*#__PURE__*/React.createElement(Container, {
45
+ align: "vertical",
46
+ alignBox: "row",
47
+ className: locationBubbleClass,
48
+ isCover: false
49
+ }, /*#__PURE__*/React.createElement(Box, {
50
+ className: newStyle.imageWrapper,
51
+ shrink: true
52
+ }), /*#__PURE__*/React.createElement(Box, {
53
+ className: newStyle.textWrapper,
54
+ flexible: true
55
+ }, /*#__PURE__*/React.createElement("a", {
56
+ className: newStyle.textLink,
57
+ "data-title": locationUrl
58
+ }, locationUrl))));
59
+ }
60
+ LocationBubble.propTypes = locationBubblePropTypes;
61
+ LocationBubble.defaultProps = locationBubbleDefaultProps;
62
+ LocationBubble.displayName = 'LocationBubble';