@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,101 @@
1
+ .varClass {
2
+ --messageBubble-bubble_footer_gap: var(--zd_size5);
3
+ --messageBubble-message_owner_gap: 13px;
4
+ --messageBox-max_width: 410px;
5
+ --messageBox-footer_fontSize: var(--zd_font_size11);
6
+ --messageBox-owner_width: var(--zd_size32);
7
+ }
8
+
9
+ .messageBubble {
10
+ composes: varClass;
11
+ width: 100% ;
12
+ display: grid;
13
+ grid-column-gap: var(--messageBubble-message_owner_gap);
14
+ }
15
+
16
+ .messageOwnerWrapper {
17
+ grid-area: messageOwner;
18
+ align-self: end;
19
+ width: var(--messageBox-owner_width);
20
+ display: flex;
21
+ }
22
+
23
+ .messageContainer {
24
+ grid-area: messageContainer;
25
+ display: inline-block;
26
+ max-width: 70% ;
27
+ }
28
+
29
+ .messageBoxWrapper {
30
+ grid-area: messageBox;
31
+ display: inline-block;
32
+ position: relative;
33
+ }
34
+
35
+ .messageActionWrapper {
36
+ grid-area: messageAction;
37
+ width: var(--zd_size78) ;
38
+ display: flex;
39
+ flex-direction: column;
40
+ position: absolute;
41
+ top:0 ;
42
+ visibility: hidden;
43
+ opacity: 0;
44
+ }
45
+
46
+ .messageBubble:hover .messageActionWrapper{
47
+ visibility: visible;
48
+ opacity: 1;
49
+ }
50
+
51
+ .messageActionWrapperEnd {
52
+ align-items: flex-end;
53
+ }
54
+
55
+ [dir=ltr] .messageActionWrapperEnd {
56
+ right: calc(100% + (var(--zd_size12)));
57
+ }
58
+
59
+ [dir=rtl] .messageActionWrapperEnd {
60
+ left: calc(100% + (var(--zd_size12)));
61
+ }
62
+
63
+ .messageActionWrapperStart {
64
+ align-items: flex-start;
65
+ }
66
+
67
+ [dir=ltr] .messageActionWrapperStart {
68
+ left: calc(100% + (var(--zd_size12)));
69
+ }
70
+
71
+ [dir=rtl] .messageActionWrapperStart {
72
+ right: calc(100% + (var(--zd_size12)));
73
+ }
74
+ .messageBoxFooterWrapper {
75
+ grid-area: messageBoxFooter;
76
+ font-size: var(--messageBox-footer_fontSize);
77
+ color: var(
78
+ --imlib_chat_components_messageBubble_messageBox_footer_text_color
79
+ );
80
+ margin-top: var(--messageBubble-bubble_footer_gap);
81
+ }
82
+
83
+ .active {
84
+ background-color: var(--imlib_chat_components_messageBubble_active_bg_color);
85
+ }
86
+
87
+ .directionIn {
88
+ grid-template-columns: auto 1fr;
89
+ grid-template-areas:
90
+ 'messageOwner messageContainer'
91
+ '. messageBoxFooter';
92
+ }
93
+
94
+ .directionOut {
95
+ grid-template-columns: 1fr auto;
96
+ grid-template-areas:
97
+ 'messageContainer messageOwner'
98
+ 'messageBoxFooter .';
99
+ justify-items: end;
100
+ }
101
+
@@ -0,0 +1,34 @@
1
+ /** ** Methods *** */
2
+ import { compileClassNames } from '@zohodesk/utils';
3
+ import getMessageDirectionType from '@zohoim/chat-components-utils/es/getMessageDirectionType';
4
+ export default function cssJSLogic(props, style) {
5
+ const {
6
+ isActive,
7
+ direction,
8
+ isRenderMessageActions
9
+ } = props;
10
+ const {
11
+ isIncoming,
12
+ isOutgoing
13
+ } = getMessageDirectionType({
14
+ messageDetails: {
15
+ direction
16
+ }
17
+ });
18
+ const bubbleClass = compileClassNames({
19
+ [style.messageBubble]: true,
20
+ [style.directionIn]: isIncoming,
21
+ [style.directionOut]: isOutgoing,
22
+ [style.active]: isActive,
23
+ [style.isHovered]: isRenderMessageActions
24
+ });
25
+ const messageActionWrapperClass = compileClassNames({
26
+ [style.messageActionWrapper]: true,
27
+ [style.messageActionWrapperEnd]: isOutgoing,
28
+ [style.messageActionWrapperStart]: isIncoming
29
+ });
30
+ return {
31
+ bubbleClass,
32
+ messageActionWrapperClass
33
+ };
34
+ }
@@ -0,0 +1 @@
1
+ export { default as MessageBubble } from './MessageBubble';
@@ -0,0 +1,11 @@
1
+ /** ** Constants *** */
2
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
3
+ import { direction } from '@zohoim/chat-components-utils/es/constants/messageConstants';
4
+ const messageBubbleDefaultProps = {
5
+ direction: direction.IN,
6
+ isActive: false,
7
+ needMessageActions: true,
8
+ customStyle: dummyObject,
9
+ needSender: true
10
+ };
11
+ export default messageBubbleDefaultProps;
@@ -0,0 +1,17 @@
1
+ /** ** Libraries *** */
2
+ import PropTypes from 'prop-types';
3
+ /** ** Constants *** */
4
+
5
+ import { direction } from '@zohoim/chat-components-utils/es/constants/messageConstants';
6
+ const messageBubblePropTypes = {
7
+ direction: PropTypes.oneOf(Object.values(direction)).isRequired,
8
+ renderMessageBox: PropTypes.func.isRequired,
9
+ customStyle: PropTypes.object,
10
+ isActive: PropTypes.bool,
11
+ needMessageActions: PropTypes.bool,
12
+ needSender: PropTypes.bool,
13
+ renderMessageActions: PropTypes.func,
14
+ renderMessageBoxFooter: PropTypes.func,
15
+ renderMessageOwner: PropTypes.func
16
+ };
17
+ export default messageBubblePropTypes;
@@ -0,0 +1,77 @@
1
+ /** ** Libraries *** */
2
+ import React, { useMemo } from 'react';
3
+ /** ** Hooks *** */
4
+
5
+ import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
6
+ /** ** Constants *** */
7
+
8
+ import messageStatusDefaultProps from './props/defaultProps';
9
+ import messageStatusPropTypes from './props/propTypes';
10
+ import messageStatusConstants from '@zohoim/chat-components-utils/es/constants/messageStatusConstants';
11
+ /** ** Methods *** */
12
+
13
+ import cssJSLogic from './css/cssJSLogic';
14
+ import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
15
+ /** ** Styles *** */
16
+
17
+ import style from './css/MessageStatus.module.css';
18
+ /** ** Icons *** */
19
+
20
+ import DoubleTickIcon from '../icons/iconSrc/messageStatus/DoubleTick';
21
+ import TickIcon from '../icons/iconSrc/messageStatus/Tick';
22
+ import ClockIcon from '../icons/iconSrc/messageStatus/Clock';
23
+ import FailedIcon from '../icons/iconSrc/messageStatus/Failed';
24
+ const {
25
+ SENT,
26
+ SAVED,
27
+ QUEUED,
28
+ DELIVERED,
29
+ READ,
30
+ UNSENT,
31
+ FAILED,
32
+ OUTGOING
33
+ } = messageStatusConstants;
34
+ const messageStatusIconMapping = {
35
+ [OUTGOING]: ClockIcon,
36
+ [SAVED]: TickIcon,
37
+ [QUEUED]: TickIcon,
38
+ [SENT]: DoubleTickIcon,
39
+ [DELIVERED]: DoubleTickIcon,
40
+ [READ]: DoubleTickIcon,
41
+ [UNSENT]: FailedIcon,
42
+ [FAILED]: FailedIcon
43
+ };
44
+ export default function MessageStatus(props) {
45
+ const {
46
+ messageStatus,
47
+ customStyle,
48
+ title,
49
+ renderCustomIcon
50
+ } = props;
51
+ /* External CSS Customization */
52
+
53
+ const newStyle = useMergeStyle(style, customStyle);
54
+ const iconStyle = useMemo(() => ({
55
+ base: newStyle.icon
56
+ }), [newStyle.icon]);
57
+ /* CSS classnames added based on logic */
58
+
59
+ const {
60
+ statusClass
61
+ } = cssJSLogic({
62
+ messageStatus
63
+ }, newStyle);
64
+ /* Custom Icon */
65
+
66
+ const customIcon = renderHandler(renderCustomIcon)();
67
+ const IconComponent = messageStatusIconMapping[messageStatus];
68
+ return IconComponent || customIcon ? /*#__PURE__*/React.createElement("div", {
69
+ className: statusClass,
70
+ "data-title": title
71
+ }, customIcon || /*#__PURE__*/React.createElement(IconComponent, {
72
+ customStyle: iconStyle
73
+ })) : null;
74
+ }
75
+ MessageStatus.propTypes = messageStatusPropTypes;
76
+ MessageStatus.defaultProps = messageStatusDefaultProps;
77
+ MessageStatus.displayName = 'MessageStatus';
@@ -0,0 +1,17 @@
1
+ .messageStatus {
2
+ /* USe this class name status customization */
3
+ color: var(--imlib_chat_components_messageStatus_send_color);
4
+ }
5
+
6
+ .readStatus {
7
+ color: var(--imlib_chat_components_messageStatus_read_color);
8
+ }
9
+
10
+ .failedStatus {
11
+ color: var(--imlib_chat_components_messageStatus_failed_color);
12
+ }
13
+
14
+ .icon {
15
+ width: var(--zd_size14) ;
16
+ height: var(--zd_size14) ;
17
+ }
@@ -0,0 +1,26 @@
1
+ /** ** Methods *** */
2
+ import { compileClassNames } from '@zohodesk/utils';
3
+ /** ** Constants *** */
4
+
5
+ import getMessageStatus from '@zohoim/chat-components-utils/es/getMessageStatus';
6
+ export default function cssJSLogic(props, style) {
7
+ const {
8
+ messageStatus
9
+ } = props;
10
+ const {
11
+ isFailedMessage: isFailed,
12
+ isRead
13
+ } = getMessageStatus({
14
+ messageDetails: {
15
+ status: messageStatus
16
+ }
17
+ });
18
+ const statusClass = compileClassNames({
19
+ [style.messageStatus]: !(isRead || isFailed),
20
+ [style.readStatus]: isRead,
21
+ [style.failedStatus]: isFailed
22
+ });
23
+ return {
24
+ statusClass
25
+ };
26
+ }
@@ -0,0 +1 @@
1
+ export { default as MessageStatus } from './MessageStatus';
@@ -0,0 +1,6 @@
1
+ /** ** Constants *** */
2
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
3
+ const messageStatusDefaultProps = {
4
+ customStyle: dummyObject
5
+ };
6
+ export default messageStatusDefaultProps;
@@ -0,0 +1,12 @@
1
+ /** ** Libraries *** */
2
+ import PropTypes from 'prop-types';
3
+ /** ** Constants *** */
4
+
5
+ import messageStatusConstants from '@zohoim/chat-components-utils/es/constants/messageStatusConstants';
6
+ const messageStatusPropTypes = {
7
+ messageStatus: PropTypes.oneOf(Object.values(messageStatusConstants)).isRequired,
8
+ customStyle: PropTypes.object,
9
+ renderCustomIcon: PropTypes.func,
10
+ title: PropTypes.string
11
+ };
12
+ export default messageStatusPropTypes;
@@ -0,0 +1,72 @@
1
+ /** ** Libraries *** */
2
+ import React, { useCallback } from 'react';
3
+ /** ** Hooks *** */
4
+
5
+ import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
6
+ /** ** Constants *** */
7
+
8
+ import moreActionItemDefaultProps from './props/defaultProps';
9
+ import moreActionItemPropTypes from './props/propTypes';
10
+ /** ** Styles *** */
11
+
12
+ import style from './css/MoreActionItem.module.css';
13
+ /** ** Components *** */
14
+
15
+ import { Container, Box } from '@zohodesk/components/es/Layout';
16
+ import ListContainer from '@zohodesk/components/es/ListItem/ListContainer';
17
+ /** ** Methods *** */
18
+
19
+ import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
20
+ export default function MoreActionItem(props) {
21
+ const {
22
+ displayText,
23
+ title,
24
+ id,
25
+ customStyle,
26
+ renderIcon,
27
+ needIcon,
28
+ onClick,
29
+ onMouseEnter,
30
+ closePopup,
31
+ isDisabled
32
+ } = props;
33
+ const handleClick = useCallback(e => {
34
+ closePopup && closePopup(e);
35
+ !isDisabled && onClick && onClick({
36
+ e,
37
+ id
38
+ });
39
+ }, [closePopup, onClick, id, isDisabled]);
40
+ const handleMouseEnter = useCallback(e => {
41
+ !isDisabled && onMouseEnter && onMouseEnter({
42
+ e,
43
+ id
44
+ });
45
+ }, [onMouseEnter, id, isDisabled]);
46
+ /* External CSS Customization */
47
+
48
+ const newStyle = useMergeStyle(style, customStyle);
49
+ const icon = renderHandler(renderIcon)({
50
+ id
51
+ });
52
+ return /*#__PURE__*/React.createElement(ListContainer, {
53
+ autoHover: true,
54
+ customClass: newStyle.listItem,
55
+ disableTitle: title,
56
+ id: id,
57
+ isDisabled: isDisabled,
58
+ onClick: handleClick,
59
+ onMouseEnter: handleMouseEnter,
60
+ title: title
61
+ }, /*#__PURE__*/React.createElement(Container, {
62
+ align: "vertical",
63
+ alignBox: "row"
64
+ }, needIcon ? /*#__PURE__*/React.createElement(Box, {
65
+ className: newStyle.iconWrapper
66
+ }, icon) : null, /*#__PURE__*/React.createElement(Box, {
67
+ className: newStyle.text,
68
+ flexible: true
69
+ }, displayText)));
70
+ }
71
+ MoreActionItem.propTypes = moreActionItemPropTypes;
72
+ MoreActionItem.defaultProps = moreActionItemDefaultProps;
@@ -0,0 +1,27 @@
1
+ .varClass {
2
+ --moreActionItem-content_padding: var(--zd_size10);
3
+ --moreActionItem-content_size: var(--zd_font_size14);
4
+ }
5
+
6
+ .listItem {
7
+ /* Use this class name for list item customization */
8
+ }
9
+
10
+ .iconWrapper {
11
+ /* Use this class name for list item icon customization */
12
+ display: flex;
13
+ }
14
+
15
+ .text {
16
+ composes: varClass;
17
+ font-size: var(--moreActionItem-content_size);
18
+ composes: dotted from "../../css/common.module.css";
19
+ }
20
+
21
+ [dir=ltr] .text {
22
+ padding-left: var(--moreActionItem-content_padding);
23
+ }
24
+
25
+ [dir=rtl] .text {
26
+ padding-right: var(--moreActionItem-content_padding);
27
+ }
@@ -0,0 +1 @@
1
+ export { default as MoreActionItem } from './MoreActionItem';
@@ -0,0 +1,7 @@
1
+ /** ** Constants *** */
2
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
3
+ const moreActionItemDefaultProps = {
4
+ customStyle: dummyObject,
5
+ needIcon: true
6
+ };
7
+ export default moreActionItemDefaultProps;
@@ -0,0 +1,14 @@
1
+ /** ** Libraries *** */
2
+ import PropTypes from 'prop-types';
3
+ const moreActionItemPropTypes = {
4
+ displayText: PropTypes.string.isRequired,
5
+ onClick: PropTypes.func.isRequired,
6
+ onMouseEnter: PropTypes.func,
7
+ closePopup: PropTypes.func,
8
+ customStyle: PropTypes.object,
9
+ id: PropTypes.string,
10
+ needIcon: PropTypes.bool,
11
+ renderIcon: PropTypes.func,
12
+ title: PropTypes.string
13
+ };
14
+ export default moreActionItemPropTypes;
@@ -0,0 +1,118 @@
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, useCallback } from 'react';
5
+ /** ** Hooks *** */
6
+
7
+ import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
8
+ /** ** Constants *** */
9
+
10
+ import replyBubbleDefaultProps from './props/defaultProps';
11
+ import replyBubblePropTypes from './props/propTypes';
12
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
13
+ /** ** Styles *** */
14
+
15
+ import style from './css/ReplyBubble.module.css';
16
+ /** ** Methods *** */
17
+
18
+ import cssJSLogic from './css/cssJSLogic';
19
+ /** ** Components *** */
20
+
21
+ import ReplyBubbleHeader from '../ReplyBubbleHeader/ReplyBubbleHeader';
22
+ import ReplyBubbleContent from '../ReplyBubbleContent/ReplyBubbleContent';
23
+ import AttachmentIcon from '../AttachmentIcon/AttachmentIcon';
24
+ import LocationBubble from '../LocationBubble/LocationBubble';
25
+ export default function ReplyBubble(props) {
26
+ const {
27
+ customStyle,
28
+ senderName,
29
+ dateTimeDetails,
30
+ replyText,
31
+ message,
32
+ attachmentDetails,
33
+ locationUrl,
34
+ onClick,
35
+ customProps,
36
+ isFailed
37
+ } = props;
38
+ const {
39
+ headerProps = dummyObject,
40
+ contentProps = dummyObject,
41
+ iconProps = dummyObject
42
+ } = customProps;
43
+ const {
44
+ fileName,
45
+ fileURL,
46
+ fileFormat,
47
+ mediaType,
48
+ isValidAttachment
49
+ } = attachmentDetails || dummyObject;
50
+ /* External CSS Customization */
51
+
52
+ const newStyle = useMergeStyle(style, customStyle);
53
+ /* css classnames added based on logic */
54
+
55
+ const {
56
+ imageWrapperClass
57
+ } = cssJSLogic({
58
+ isFailed
59
+ }, newStyle);
60
+ const iconStyle = useMemo(() => ({
61
+ $icon: newStyle.attachmentIcon
62
+ }), [newStyle.attachmentIcon]);
63
+ const renderMessage = useCallback(() => {
64
+ if (locationUrl) {
65
+ return /*#__PURE__*/React.createElement(LocationBubble, {
66
+ isFailed: isFailed,
67
+ locationUrl: locationUrl
68
+ });
69
+ }
70
+
71
+ if (message) {
72
+ // eslint-disable-next-line @zohodesk/zsecurity/no-unsecure-html, react/no-danger
73
+ return /*#__PURE__*/React.createElement("span", {
74
+ dangerouslySetInnerHTML: {
75
+ __html: message
76
+ }
77
+ });
78
+ }
79
+
80
+ return null;
81
+ }, [message, locationUrl, isFailed]);
82
+ const renderIcon = useCallback(() => {
83
+ if (fileURL) {
84
+ return /*#__PURE__*/React.createElement("div", {
85
+ className: imageWrapperClass
86
+ }, /*#__PURE__*/React.createElement("img", {
87
+ alt: fileName,
88
+ className: newStyle.image,
89
+ src: fileURL
90
+ }));
91
+ }
92
+
93
+ if (fileFormat) {
94
+ return /*#__PURE__*/React.createElement(AttachmentIcon, _extends({
95
+ customStyle: iconStyle,
96
+ fileFormat: fileFormat,
97
+ isValidAttachment: isValidAttachment,
98
+ mediaType: mediaType
99
+ }, iconProps));
100
+ }
101
+
102
+ return null;
103
+ }, [fileURL, fileName, fileFormat, isValidAttachment, mediaType, iconStyle, iconProps, newStyle.image, imageWrapperClass]);
104
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ReplyBubbleHeader, _extends({
105
+ dateTimeDetails: dateTimeDetails,
106
+ isFailed: isFailed,
107
+ replyText: replyText
108
+ }, headerProps)), /*#__PURE__*/React.createElement(ReplyBubbleContent, _extends({
109
+ isFailed: isFailed,
110
+ onClick: onClick,
111
+ renderIcon: renderIcon,
112
+ renderMessage: renderMessage,
113
+ senderName: senderName
114
+ }, contentProps)));
115
+ }
116
+ ReplyBubble.propTypes = replyBubblePropTypes;
117
+ ReplyBubble.defaultProps = replyBubbleDefaultProps;
118
+ ReplyBubble.displayName = 'ReplyBubble';
@@ -0,0 +1,23 @@
1
+ .attachmentIcon {
2
+ height: var(--zd_size40) !important;
3
+ width: var(--zd_size40) !important;
4
+ }
5
+
6
+ .imageWrapper {
7
+ height: var(--zd_size60) ;
8
+ width: var(--zd_size60) ;
9
+ overflow: hidden;
10
+ border-radius: 3px;
11
+ border: 1px solid var(--imlib_chat_components_replyBubble_border_color);
12
+ }
13
+
14
+ .imageWrapperFailed{
15
+ border-color: var(--imlib_chat_components_replyBubble_border_color_failed);
16
+ }
17
+
18
+ .image {
19
+ width: 100% ;
20
+ height: 100% ;
21
+ object-fit: cover;
22
+ border-radius: 3px;
23
+ }
@@ -0,0 +1,14 @@
1
+ /** ** Methods *** */
2
+ import { compileClassNames } from '@zohodesk/utils';
3
+ export default function cssJSLogic(props, style) {
4
+ const {
5
+ isFailed
6
+ } = props;
7
+ const imageWrapperClass = compileClassNames({
8
+ [style.imageWrapper]: true,
9
+ [style.imageWrapperFailed]: isFailed
10
+ });
11
+ return {
12
+ imageWrapperClass
13
+ };
14
+ }
@@ -0,0 +1 @@
1
+ export { default as ReplyBubble } from './ReplyBubble';
@@ -0,0 +1,8 @@
1
+ /** ** Constants *** */
2
+ import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
3
+ const replyBubbleDefaultProps = {
4
+ customStyle: dummyObject,
5
+ customProps: dummyObject,
6
+ attachmentDetails: dummyObject
7
+ };
8
+ export default replyBubbleDefaultProps;
@@ -0,0 +1,28 @@
1
+ /** ** Libraries *** */
2
+ import PropTypes from 'prop-types';
3
+ const replyBubblePropTypes = {
4
+ message: PropTypes.string.isRequired,
5
+ onClick: PropTypes.func.isRequired,
6
+ replyText: PropTypes.string.isRequired,
7
+ senderName: PropTypes.string.isRequired,
8
+ attachmentDetails: PropTypes.shape({
9
+ fileFormat: PropTypes.string,
10
+ fileName: PropTypes.string,
11
+ fileURL: PropTypes.string,
12
+ isValidAttachment: PropTypes.bool,
13
+ mediaType: PropTypes.string
14
+ }),
15
+ locationUrl: PropTypes.string,
16
+ customProps: PropTypes.shape({
17
+ contentProps: PropTypes.object,
18
+ headerProps: PropTypes.object,
19
+ iconProps: PropTypes.object
20
+ }),
21
+ customStyle: PropTypes.object,
22
+ dateTimeDetails: PropTypes.shape({
23
+ displayDateTime: PropTypes.string,
24
+ tooltip: PropTypes.string
25
+ }),
26
+ isFailed: PropTypes.bool
27
+ };
28
+ export default replyBubblePropTypes;