@zohodesk/dot 1.0.0-temp-198.3.3 → 1.0.0-temp-187.1

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 (229) hide show
  1. package/.cli/UnValidatedFiles.html +1 -1
  2. package/.cli/propValidation_report.html +1 -1
  3. package/README.md +28 -0
  4. package/assets/Appearance/dark/mode/Dot_DarkMode.module.css +1 -0
  5. package/assets/Appearance/light/mode/Dot_LightMode.module.css +1 -0
  6. package/assets/Appearance/pureDark/mode/Dot_PureDarkMode.module.css +1 -0
  7. package/es/ActionButton/ActionButton.module.css +192 -192
  8. package/es/AlphabeticList/AlphabeticList.module.css +57 -57
  9. package/es/AttachmentViewer/AttachmentImage.js +68 -32
  10. package/es/AttachmentViewer/AttachmentViewer.js +120 -41
  11. package/es/AttachmentViewer/AttachmentViewer.module.css +364 -352
  12. package/es/AttachmentViewer/__tests__/AttachmentImage.spec.js +63 -13
  13. package/es/AttachmentViewer/__tests__/__snapshots__/AttachmentImage.spec.js.snap +9 -5
  14. package/es/AttachmentViewer/__tests__/__snapshots__/AttachmentViewer.spec.js.snap +16 -117
  15. package/es/AttachmentViewer/props/defaultProps.js +5 -1
  16. package/es/AttachmentViewer/props/propTypes.js +7 -3
  17. package/es/AttachmentViewer/utils.js +49 -0
  18. package/es/ChannelIcon/ChannelIcon.module.css +225 -225
  19. package/es/FormAction/FormAction.module.css +100 -100
  20. package/es/IconButton/IconButton.module.css +22 -22
  21. package/es/Image/Image.js +6 -2
  22. package/es/Image/props/propTypes.js +3 -1
  23. package/es/TagWithIcon/TagWithIcon.module.css +66 -66
  24. package/es/avatar/AvatarIcon/AvatarIcon.module.css +58 -58
  25. package/es/common/dot_boxShadow.module.css +2 -0
  26. package/es/emptystate/CommonEmptyState/CommonEmptyState.module.css +92 -92
  27. package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +4 -2
  28. package/es/form/fields/TextEditor/TextEditor.js +64 -64
  29. package/es/form/fields/TextEditor/TextEditor.module.css +73 -61
  30. package/es/form/fields/TextEditor/__tests__/__snapshots__/TextEditor.spec.js.snap +1 -1
  31. package/es/form/fields/TextEditor/props/defaultProps.js +4 -1
  32. package/es/form/fields/TextEditor/props/propTypes.js +10 -3
  33. package/es/form/fields/ValidationMessage/ValidationMessage.module.css +27 -27
  34. package/es/layout/SubtabLayout/SubtabLayout.module.css +164 -164
  35. package/es/list/Comment/Comment.module.css +29 -29
  36. package/es/list/DepartmentDropDown/DepartmentDropDown.js +7 -2
  37. package/es/list/DepartmentDropDown/props/defaultProps.js +2 -1
  38. package/es/list/DepartmentDropDown/props/propTypes.js +2 -1
  39. package/es/list/Dot/Dot.module.css +15 -15
  40. package/es/list/ListLayout/ListLayout.module.css +79 -79
  41. package/es/list/Subject/Subject.module.css +34 -34
  42. package/es/list/Thread/Thread.module.css +42 -42
  43. package/es/list/status/StatusListItem/StatusListItem.module.css +35 -5
  44. package/es/utils/editorUtils.js +6 -6
  45. package/es/v1/AttachmentViewer/AttachmentImage.js +44 -23
  46. package/es/v1/AttachmentViewer/AttachmentViewer.js +120 -41
  47. package/es/v1/AttachmentViewer/props/propTypes.js +7 -3
  48. package/es/v1/Image/Image.js +6 -2
  49. package/es/v1/Image/props/propTypes.js +3 -1
  50. package/es/v1/form/fields/TextEditor/TextEditor.js +63 -64
  51. package/es/v1/form/fields/TextEditor/props/defaultProps.js +4 -1
  52. package/es/v1/form/fields/TextEditor/props/propTypes.js +10 -3
  53. package/es/v1/utils/editorUtils.js +6 -6
  54. package/es/version2/GlobalNotification/GlobalNotification.module.css +177 -177
  55. package/es/version2/lookup/AlertHeader/css/AlertHeaderNew.module.css +87 -87
  56. package/es/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css +132 -132
  57. package/lib/ActionButton/ActionButton.module.css +192 -192
  58. package/lib/AlphabeticList/AlphabeticList.module.css +57 -57
  59. package/lib/AttachmentViewer/AttachmentImage.js +74 -36
  60. package/lib/AttachmentViewer/AttachmentViewer.js +151 -70
  61. package/lib/AttachmentViewer/AttachmentViewer.module.css +364 -352
  62. package/lib/AttachmentViewer/__tests__/AttachmentImage.spec.js +64 -13
  63. package/lib/AttachmentViewer/__tests__/__snapshots__/AttachmentImage.spec.js.snap +9 -5
  64. package/lib/AttachmentViewer/__tests__/__snapshots__/AttachmentViewer.spec.js.snap +16 -117
  65. package/lib/AttachmentViewer/props/defaultProps.js +5 -1
  66. package/lib/AttachmentViewer/props/propTypes.js +7 -3
  67. package/lib/AttachmentViewer/utils.js +60 -1
  68. package/lib/ChannelIcon/ChannelIcon.module.css +225 -225
  69. package/lib/FormAction/FormAction.module.css +100 -100
  70. package/lib/IconButton/IconButton.module.css +22 -22
  71. package/lib/Image/Image.js +6 -2
  72. package/lib/Image/props/propTypes.js +3 -1
  73. package/lib/TagWithIcon/TagWithIcon.module.css +66 -66
  74. package/lib/avatar/AvatarIcon/AvatarIcon.module.css +58 -58
  75. package/lib/common/dot_boxShadow.module.css +2 -0
  76. package/lib/emptystate/CommonEmptyState/CommonEmptyState.module.css +92 -92
  77. package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.js +5 -3
  78. package/lib/form/fields/TextEditor/TextEditor.js +74 -74
  79. package/lib/form/fields/TextEditor/TextEditor.module.css +73 -61
  80. package/lib/form/fields/TextEditor/__tests__/__snapshots__/TextEditor.spec.js.snap +1 -1
  81. package/lib/form/fields/TextEditor/props/defaultProps.js +4 -1
  82. package/lib/form/fields/TextEditor/props/propTypes.js +10 -3
  83. package/lib/form/fields/ValidationMessage/ValidationMessage.module.css +27 -27
  84. package/lib/layout/SubtabLayout/SubtabLayout.module.css +164 -164
  85. package/lib/list/Comment/Comment.module.css +29 -29
  86. package/lib/list/DepartmentDropDown/DepartmentDropDown.js +8 -3
  87. package/lib/list/DepartmentDropDown/props/defaultProps.js +2 -1
  88. package/lib/list/DepartmentDropDown/props/propTypes.js +1 -1
  89. package/lib/list/Dot/Dot.module.css +15 -15
  90. package/lib/list/ListLayout/ListLayout.module.css +79 -79
  91. package/lib/list/Subject/Subject.module.css +34 -34
  92. package/lib/list/Thread/Thread.module.css +42 -42
  93. package/lib/list/status/StatusListItem/StatusListItem.module.css +35 -5
  94. package/lib/utils/editorUtils.js +6 -5
  95. package/lib/v1/AttachmentViewer/AttachmentImage.js +52 -24
  96. package/lib/v1/AttachmentViewer/AttachmentViewer.js +151 -70
  97. package/lib/v1/AttachmentViewer/props/propTypes.js +7 -3
  98. package/lib/v1/Image/Image.js +6 -2
  99. package/lib/v1/Image/props/propTypes.js +3 -1
  100. package/lib/v1/form/fields/TextEditor/TextEditor.js +73 -74
  101. package/lib/v1/form/fields/TextEditor/props/defaultProps.js +4 -1
  102. package/lib/v1/form/fields/TextEditor/props/propTypes.js +10 -3
  103. package/lib/v1/utils/editorUtils.js +6 -5
  104. package/lib/version2/GlobalNotification/GlobalNotification.module.css +177 -177
  105. package/lib/version2/lookup/AlertHeader/css/AlertHeaderNew.module.css +87 -87
  106. package/lib/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css +132 -132
  107. package/package.json +3 -3
  108. package/result.json +1 -1
  109. package/unittest/index.html +1 -1
  110. package/es/DotProvider/DotProvider.js +0 -60
  111. package/es/DotProvider/hooks/useDotProvider.js +0 -55
  112. package/es/DotProvider/hooks/useDownloadAssetsAndSetAttr.js +0 -97
  113. package/es/DotProvider/libraryChunks/themes/component/blue/Blue_Dark_Component.js +0 -3
  114. package/es/DotProvider/libraryChunks/themes/component/blue/Blue_Light_Component.js +0 -3
  115. package/es/DotProvider/libraryChunks/themes/component/blue/Blue_PureDark_Component.js +0 -3
  116. package/es/DotProvider/libraryChunks/themes/component/green/Green_Dark_Component.js +0 -3
  117. package/es/DotProvider/libraryChunks/themes/component/green/Green_Light_Component.js +0 -3
  118. package/es/DotProvider/libraryChunks/themes/component/green/Green_PureDark_Component.js +0 -3
  119. package/es/DotProvider/libraryChunks/themes/component/orange/Orange_Dark_Component.js +0 -3
  120. package/es/DotProvider/libraryChunks/themes/component/orange/Orange_Light_Component.js +0 -3
  121. package/es/DotProvider/libraryChunks/themes/component/orange/Orange_PureDark_Component.js +0 -3
  122. package/es/DotProvider/libraryChunks/themes/component/red/Red_Dark_Component.js +0 -3
  123. package/es/DotProvider/libraryChunks/themes/component/red/Red_Light_Component.js +0 -3
  124. package/es/DotProvider/libraryChunks/themes/component/red/Red_PureDark_Component.js +0 -3
  125. package/es/DotProvider/libraryChunks/themes/component/yellow/Yellow_Dark_Component.js +0 -3
  126. package/es/DotProvider/libraryChunks/themes/component/yellow/Yellow_Light_Component.js +0 -3
  127. package/es/DotProvider/libraryChunks/themes/component/yellow/Yellow_PureDark_Component.js +0 -3
  128. package/es/DotProvider/libraryChunks/themes/dot/blue/Blue_Dark_Dot.js +0 -1
  129. package/es/DotProvider/libraryChunks/themes/dot/blue/Blue_Light_Dot.js +0 -1
  130. package/es/DotProvider/libraryChunks/themes/dot/blue/Blue_PureDark_Dot.js +0 -1
  131. package/es/DotProvider/libraryChunks/themes/dot/green/Green_Dark_Dot.js +0 -1
  132. package/es/DotProvider/libraryChunks/themes/dot/green/Green_Light_Dot.js +0 -1
  133. package/es/DotProvider/libraryChunks/themes/dot/green/Green_PureDark_Dot.js +0 -1
  134. package/es/DotProvider/libraryChunks/themes/dot/orange/Orange_Dark_Dot.js +0 -1
  135. package/es/DotProvider/libraryChunks/themes/dot/orange/Orange_Light_Dot.js +0 -1
  136. package/es/DotProvider/libraryChunks/themes/dot/orange/Orange_PureDark_Dot.js +0 -1
  137. package/es/DotProvider/libraryChunks/themes/dot/red/Red_Dark_Dot.js +0 -1
  138. package/es/DotProvider/libraryChunks/themes/dot/red/Red_Light_Dot.js +0 -1
  139. package/es/DotProvider/libraryChunks/themes/dot/red/Red_PureDark_Dot.js +0 -1
  140. package/es/DotProvider/libraryChunks/themes/dot/yellow/Yellow_Dark_Dot.js +0 -1
  141. package/es/DotProvider/libraryChunks/themes/dot/yellow/Yellow_Light_Dot.js +0 -1
  142. package/es/DotProvider/libraryChunks/themes/dot/yellow/Yellow_PureDark_Dot.js +0 -1
  143. package/es/DotProvider/libraryChunks/themes/svg/blue/Blue_Dark_SVG.js +0 -1
  144. package/es/DotProvider/libraryChunks/themes/svg/blue/Blue_Light_SVG.js +0 -1
  145. package/es/DotProvider/libraryChunks/themes/svg/blue/Blue_PureDark_SVG.js +0 -1
  146. package/es/DotProvider/libraryChunks/themes/svg/green/Green_Dark_SVG.js +0 -1
  147. package/es/DotProvider/libraryChunks/themes/svg/green/Green_Light_SVG.js +0 -1
  148. package/es/DotProvider/libraryChunks/themes/svg/green/Green_PureDark_SVG.js +0 -1
  149. package/es/DotProvider/libraryChunks/themes/svg/orange/Orange_Dark_SVG.js +0 -1
  150. package/es/DotProvider/libraryChunks/themes/svg/orange/Orange_Light_SVG.js +0 -1
  151. package/es/DotProvider/libraryChunks/themes/svg/orange/Orange_PureDark_SVG.js +0 -1
  152. package/es/DotProvider/libraryChunks/themes/svg/red/Red_Dark_SVG.js +0 -1
  153. package/es/DotProvider/libraryChunks/themes/svg/red/Red_Light_SVG.js +0 -1
  154. package/es/DotProvider/libraryChunks/themes/svg/red/Red_PureDark_SVG.js +0 -1
  155. package/es/DotProvider/libraryChunks/themes/svg/yellow/Yellow_Dark_SVG.js +0 -1
  156. package/es/DotProvider/libraryChunks/themes/svg/yellow/Yellow_Light_SVG.js +0 -1
  157. package/es/DotProvider/libraryChunks/themes/svg/yellow/Yellow_PureDark_SVG.js +0 -1
  158. package/es/DotProvider/props/defaultProps.js +0 -11
  159. package/es/DotProvider/props/propTypes.js +0 -16
  160. package/es/DotProvider/utils/assetPromiseHandlers/fontSizeAssetPromise.js +0 -4
  161. package/es/DotProvider/utils/assetPromiseHandlers/themeAppearanceAssetPromise.js +0 -28
  162. package/es/DotProvider/utils/assetPromiseHandlers/themeColorAssetPromise.js +0 -29
  163. package/es/DotProvider/utils/assetPromiseHandlers/zoomSizeAssetPromise.js +0 -4
  164. package/es/DotProvider/utils/constants.js +0 -14
  165. package/es/DotProvider/utils/errorValidation.js +0 -17
  166. package/es/DotProvider/utils/getAssetsImportPromises.js +0 -17
  167. package/es/DotProvider/utils/sizeAssetsConfig.js +0 -12
  168. package/es/DotProvider/utils/themeAppearanceAssetsConfig.js +0 -47
  169. package/es/DotProvider/utils/themeColorAssetsConfig.js +0 -221
  170. package/lib/DotProvider/DotProvider.js +0 -88
  171. package/lib/DotProvider/hooks/useDotProvider.js +0 -83
  172. package/lib/DotProvider/hooks/useDownloadAssetsAndSetAttr.js +0 -119
  173. package/lib/DotProvider/libraryChunks/themes/component/blue/Blue_Dark_Component.js +0 -7
  174. package/lib/DotProvider/libraryChunks/themes/component/blue/Blue_Light_Component.js +0 -7
  175. package/lib/DotProvider/libraryChunks/themes/component/blue/Blue_PureDark_Component.js +0 -7
  176. package/lib/DotProvider/libraryChunks/themes/component/green/Green_Dark_Component.js +0 -7
  177. package/lib/DotProvider/libraryChunks/themes/component/green/Green_Light_Component.js +0 -7
  178. package/lib/DotProvider/libraryChunks/themes/component/green/Green_PureDark_Component.js +0 -7
  179. package/lib/DotProvider/libraryChunks/themes/component/orange/Orange_Dark_Component.js +0 -7
  180. package/lib/DotProvider/libraryChunks/themes/component/orange/Orange_Light_Component.js +0 -7
  181. package/lib/DotProvider/libraryChunks/themes/component/orange/Orange_PureDark_Component.js +0 -7
  182. package/lib/DotProvider/libraryChunks/themes/component/red/Red_Dark_Component.js +0 -7
  183. package/lib/DotProvider/libraryChunks/themes/component/red/Red_Light_Component.js +0 -7
  184. package/lib/DotProvider/libraryChunks/themes/component/red/Red_PureDark_Component.js +0 -7
  185. package/lib/DotProvider/libraryChunks/themes/component/yellow/Yellow_Dark_Component.js +0 -7
  186. package/lib/DotProvider/libraryChunks/themes/component/yellow/Yellow_Light_Component.js +0 -7
  187. package/lib/DotProvider/libraryChunks/themes/component/yellow/Yellow_PureDark_Component.js +0 -7
  188. package/lib/DotProvider/libraryChunks/themes/dot/blue/Blue_Dark_Dot.js +0 -3
  189. package/lib/DotProvider/libraryChunks/themes/dot/blue/Blue_Light_Dot.js +0 -3
  190. package/lib/DotProvider/libraryChunks/themes/dot/blue/Blue_PureDark_Dot.js +0 -3
  191. package/lib/DotProvider/libraryChunks/themes/dot/green/Green_Dark_Dot.js +0 -3
  192. package/lib/DotProvider/libraryChunks/themes/dot/green/Green_Light_Dot.js +0 -3
  193. package/lib/DotProvider/libraryChunks/themes/dot/green/Green_PureDark_Dot.js +0 -3
  194. package/lib/DotProvider/libraryChunks/themes/dot/orange/Orange_Dark_Dot.js +0 -3
  195. package/lib/DotProvider/libraryChunks/themes/dot/orange/Orange_Light_Dot.js +0 -3
  196. package/lib/DotProvider/libraryChunks/themes/dot/orange/Orange_PureDark_Dot.js +0 -3
  197. package/lib/DotProvider/libraryChunks/themes/dot/red/Red_Dark_Dot.js +0 -3
  198. package/lib/DotProvider/libraryChunks/themes/dot/red/Red_Light_Dot.js +0 -3
  199. package/lib/DotProvider/libraryChunks/themes/dot/red/Red_PureDark_Dot.js +0 -3
  200. package/lib/DotProvider/libraryChunks/themes/dot/yellow/Yellow_Dark_Dot.js +0 -3
  201. package/lib/DotProvider/libraryChunks/themes/dot/yellow/Yellow_Light_Dot.js +0 -3
  202. package/lib/DotProvider/libraryChunks/themes/dot/yellow/Yellow_PureDark_Dot.js +0 -3
  203. package/lib/DotProvider/libraryChunks/themes/svg/blue/Blue_Dark_SVG.js +0 -3
  204. package/lib/DotProvider/libraryChunks/themes/svg/blue/Blue_Light_SVG.js +0 -3
  205. package/lib/DotProvider/libraryChunks/themes/svg/blue/Blue_PureDark_SVG.js +0 -3
  206. package/lib/DotProvider/libraryChunks/themes/svg/green/Green_Dark_SVG.js +0 -3
  207. package/lib/DotProvider/libraryChunks/themes/svg/green/Green_Light_SVG.js +0 -3
  208. package/lib/DotProvider/libraryChunks/themes/svg/green/Green_PureDark_SVG.js +0 -3
  209. package/lib/DotProvider/libraryChunks/themes/svg/orange/Orange_Dark_SVG.js +0 -3
  210. package/lib/DotProvider/libraryChunks/themes/svg/orange/Orange_Light_SVG.js +0 -3
  211. package/lib/DotProvider/libraryChunks/themes/svg/orange/Orange_PureDark_SVG.js +0 -3
  212. package/lib/DotProvider/libraryChunks/themes/svg/red/Red_Dark_SVG.js +0 -3
  213. package/lib/DotProvider/libraryChunks/themes/svg/red/Red_Light_SVG.js +0 -3
  214. package/lib/DotProvider/libraryChunks/themes/svg/red/Red_PureDark_SVG.js +0 -3
  215. package/lib/DotProvider/libraryChunks/themes/svg/yellow/Yellow_Dark_SVG.js +0 -3
  216. package/lib/DotProvider/libraryChunks/themes/svg/yellow/Yellow_Light_SVG.js +0 -3
  217. package/lib/DotProvider/libraryChunks/themes/svg/yellow/Yellow_PureDark_SVG.js +0 -3
  218. package/lib/DotProvider/props/defaultProps.js +0 -20
  219. package/lib/DotProvider/props/propTypes.js +0 -28
  220. package/lib/DotProvider/utils/assetPromiseHandlers/fontSizeAssetPromise.js +0 -12
  221. package/lib/DotProvider/utils/assetPromiseHandlers/themeAppearanceAssetPromise.js +0 -39
  222. package/lib/DotProvider/utils/assetPromiseHandlers/themeColorAssetPromise.js +0 -40
  223. package/lib/DotProvider/utils/assetPromiseHandlers/zoomSizeAssetPromise.js +0 -12
  224. package/lib/DotProvider/utils/constants.js +0 -34
  225. package/lib/DotProvider/utils/errorValidation.js +0 -25
  226. package/lib/DotProvider/utils/getAssetsImportPromises.js +0 -22
  227. package/lib/DotProvider/utils/sizeAssetsConfig.js +0 -31
  228. package/lib/DotProvider/utils/themeAppearanceAssetsConfig.js +0 -69
  229. package/lib/DotProvider/utils/themeColorAssetsConfig.js +0 -249
@@ -1,11 +1,16 @@
1
1
  import React from 'react';
2
2
  import { render } from '@testing-library/react';
3
3
  import AttachmentImage from "../AttachmentImage";
4
+ import Avatar from '@zohodesk/components/es/Avatar/Avatar';
4
5
  describe('AttachmentImage', () => {
5
6
  test('rendering the defult props', () => {
6
7
  const {
7
8
  asFragment
8
9
  } = render( /*#__PURE__*/React.createElement(AttachmentImage, {
10
+ customClass: {
11
+ customImageClass: 'customImageClass',
12
+ customChildrenClass: 'customChildrenClass'
13
+ },
9
14
  previewObj: {
10
15
  previewData: [{
11
16
  id: '1',
@@ -13,49 +18,94 @@ describe('AttachmentImage', () => {
13
18
  size: '100412',
14
19
  href: 'https://2.bp.blogspot.com/_H-PCzW2K720/SlXXLLMOzsI/AAAAAAAAAFE/efv7GBth9cQ/s280/Elva+Hill+04.JPG',
15
20
  viewUrl: 'https://2.bp.blogspot.com/_H-PCzW2K720/SlXXLLMOzsI/AAAAAAAAAFE/efv7GBth9cQ/s280/Elva+Hill+04.JPG',
16
- downloadUrl: 'https://2.bp.blogspot.com/_H-PCzW2K720/SlXXLLMOzsI/AAAAAAAAAFE/efv7GBth9cQ/s280/Elva+Hill+04.JPG'
21
+ downloadUrl: 'https://2.bp.blogspot.com/_H-PCzW2K720/SlXXLLMOzsI/AAAAAAAAAFE/efv7GBth9cQ/s280/Elva+Hill+04.JPG',
22
+ children: /*#__PURE__*/React.createElement(Avatar, {
23
+ name: "User Image"
24
+ })
17
25
  }, {
18
26
  id: '2',
19
27
  name: 'slack1.jpg',
20
28
  size: '100412',
21
29
  href: 'https://p.bigstockphoto.com/GeFvQkBbSLaMdpKXF1Zv_bigstock-Aerial-View-Of-Blue-Lakes-And--227291596.jpg',
22
30
  viewUrl: 'https://p.bigstockphoto.com/GeFvQkBbSLaMdpKXF1Zv_bigstock-Aerial-View-Of-Blue-Lakes-And--227291596.jpg',
23
- downloadUrl: 'https://p.bigstockphoto.com/GeFvQkBbSLaMdpKXF1Zv_bigstock-Aerial-View-Of-Blue-Lakes-And--227291596.jpg'
31
+ downloadUrl: 'https://p.bigstockphoto.com/GeFvQkBbSLaMdpKXF1Zv_bigstock-Aerial-View-Of-Blue-Lakes-And--227291596.jpg',
32
+ children: /*#__PURE__*/React.createElement(Avatar, {
33
+ name: "User Image"
34
+ })
24
35
  }, {
25
36
  id: '3',
26
37
  name: 'slack2.jpg',
27
38
  size: '100412',
28
39
  href: 'https://wallpapercave.com/wp/wp3913900.jpg',
29
40
  viewUrl: 'https://wallpapercave.com/wp/wp3913900.jpg',
30
- downloadUrl: 'https://wallpapercave.com/wp/wp3913900.jpg'
41
+ downloadUrl: 'https://wallpapercave.com/wp/wp3913900.jpg',
42
+ children: /*#__PURE__*/React.createElement(Avatar, {
43
+ name: "User Image"
44
+ })
31
45
  }, {
32
46
  id: '4',
33
47
  name: 'slack3.jpg',
34
48
  size: '100412',
35
- href: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Giraffe_2019-07-28.jpg/682px-Giraffe_2019-07-28.jpg',
36
- viewUrl: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Giraffe_2019-07-28.jpg/682px-Giraffe_2019-07-28.jpg',
37
- downloadUrl: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Giraffe_2019-07-28.jpg/682px-Giraffe_2019-07-28.jpg'
49
+ href: '',
50
+ viewUrl: '',
51
+ downloadUrl: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Giraffe_2019-07-28.jpg/682px-Giraffe_2019-07-28.jpg',
52
+ thumbnail: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Giraffe_2019-07-28.jpg/682px-Giraffe_2019-07-28.jpg' // children: <Avatar name='User Image' />
53
+
38
54
  }, {
39
55
  id: '5',
56
+ name: 'slack3.jpg',
57
+ size: '100412',
58
+ href: '',
59
+ viewUrl: '',
60
+ downloadUrl: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Giraffe_2019-07-28.jpg/682px-Giraffe_2019-07-28.jpg',
61
+ children: /*#__PURE__*/React.createElement(Avatar, {
62
+ name: "User Image"
63
+ })
64
+ }, {
65
+ id: '6',
40
66
  name: 'slack4.jpg',
41
67
  size: '100412',
42
68
  href: 'https://wallpapercave.com/wp/wp3913900.jpg',
43
69
  viewUrl: 'https://wallpapercave.com/wp/wp3913900.jpg',
44
- downloadUrl: 'https://wallpapercave.com/wp/wp3913900.jpg'
70
+ downloadUrl: 'https://wallpapercave.com/wp/wp3913900.jpg',
71
+ children: /*#__PURE__*/React.createElement(Avatar, {
72
+ name: "User Image"
73
+ })
45
74
  }, {
46
- id: '6',
75
+ id: '7',
47
76
  name: 'slack5.jpg',
48
77
  size: '100412',
49
78
  href: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Giraffe_2019-07-28.jpg/682px-Giraffe_2019-07-28.jpg',
50
79
  viewUrl: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Giraffe_2019-07-28.jpg/682px-Giraffe_2019-07-28.jpg',
51
- downloadUrl: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Giraffe_2019-07-28.jpg/682px-Giraffe_2019-07-28.jpg'
80
+ downloadUrl: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Giraffe_2019-07-28.jpg/682px-Giraffe_2019-07-28.jpg',
81
+ children: /*#__PURE__*/React.createElement(Avatar, {
82
+ name: "User Image"
83
+ })
52
84
  }, {
53
- id: '6',
85
+ id: '8',
86
+ name: 'slack5.mp3',
87
+ size: '100412',
88
+ href: 'https://samplelib.com/lib/preview/mp3/sample-3s.mp3',
89
+ viewUrl: 'https://samplelib.com/lib/preview/mp3/sample-3s.mp3',
90
+ downloadUrl: 'https://samplelib.com/lib/preview/mp3/sample-3s.mp3',
91
+ thumbnail: 'https://images.sftcdn.net/images/t_app-icon-m/p/7c80bdc6-a206-40b2-91fd-951c244f3672/3180901960/mp3-tag-editor-edit-music-tags-cover-art-changer-icon.png',
92
+ children: 'MP3'
93
+ }, {
94
+ id: '9',
54
95
  name: 'slack5.mp3',
55
96
  size: '100412',
56
- href: 'https://www.w3schools.com/html/horse.mp3',
57
- viewUrl: 'https://www.w3schools.com/html/horse.mp3',
58
- downloadUrl: 'https://www.w3schools.com/html/horse.mp3'
97
+ href: 'https://samplelib.com/lib/preview/mp3/sample-3s.mp3',
98
+ viewUrl: 'https://samplelib.com/lib/preview/mp3/sample-3s.mp3',
99
+ downloadUrl: 'https://samplelib.com/lib/preview/mp3/sample-3s.mp3',
100
+ children: 'MP3'
101
+ }, {
102
+ id: '10',
103
+ children: 'custom Text'
104
+ }, {
105
+ id: '11',
106
+ children: /*#__PURE__*/React.createElement(Avatar, {
107
+ name: "custom children"
108
+ })
59
109
  }],
60
110
  selectedIndex: 0
61
111
  }
@@ -2,10 +2,14 @@
2
2
 
3
3
  exports[`AttachmentImage rendering the defult props 1`] = `
4
4
  <DocumentFragment>
5
- <img
6
- class=" undefined imgMaxFullSize "
7
- data-id="AttachmentImage"
8
- data-test-id="AttachmentImage"
9
- />
5
+ <div
6
+ class="spinLoad"
7
+ data-id="AttachmentImage_loader"
8
+ data-test-id="AttachmentImage_loader"
9
+ >
10
+ <div
11
+ class="loader"
12
+ />
13
+ </div>
10
14
  </DocumentFragment>
11
15
  `;
@@ -65,59 +65,6 @@ exports[`AttachmentViewer rendering the when isActive is true 1`] = `
65
65
  data-selector-id="container"
66
66
  data-test-id="containerComponent"
67
67
  >
68
- <div
69
- class="menu"
70
- data-id="zoomIn"
71
- data-test-id="zoomIn"
72
- >
73
- <button
74
- aria-pressed="false"
75
- class="buttonReset wrapper menuIcon undefined effect default border borderHover hoverEffect inflex coldir both"
76
- data-id="iconContainer"
77
- data-ishtml="false"
78
- data-selector-id="iconButton"
79
- data-test-id="iconContainer"
80
- >
81
- <i
82
- aria-hidden="true"
83
- class="zd_font_icons basic icon-zoomIn "
84
- data-id="fontIcon"
85
- data-selector-id="fontIcon"
86
- data-test-id="fontIcon"
87
- style="--zd-iconfont-size: var(--zd_font_size16);"
88
- />
89
- </button>
90
- </div>
91
- <div
92
- class="menu"
93
- >
94
- <a
95
- class="container "
96
- data-id="newTabAttach"
97
- data-test-id="newTabAttach"
98
- href="https://2.bp.blogspot.com/_H-PCzW2K720/SlXXLLMOzsI/AAAAAAAAAFE/efv7GBth9cQ/s280/Elva+Hill+04.JPG"
99
- rel="noopener noreferrer"
100
- target="_blank"
101
- >
102
- <div
103
- aria-pressed="false"
104
- class="false wrapper menuIcon undefined effect default border borderHover hoverEffect inflex coldir both"
105
- data-id="iconContainer"
106
- data-ishtml="false"
107
- data-selector-id="iconButton"
108
- data-test-id="iconContainer"
109
- >
110
- <i
111
- aria-hidden="true"
112
- class="zd_font_icons basic icon-newLink "
113
- data-id="fontIcon"
114
- data-selector-id="fontIcon"
115
- data-test-id="fontIcon"
116
- style="--zd-iconfont-size: var(--zd_font_size16);"
117
- />
118
- </div>
119
- </a>
120
- </div>
121
68
  <div
122
69
  class="menu"
123
70
  >
@@ -241,14 +188,6 @@ exports[`AttachmentViewer rendering the when isActive is true 1`] = `
241
188
  class="loader"
242
189
  />
243
190
  </div>
244
- <img
245
- alt="Preview"
246
- class=" hide img imgMaxFullSize "
247
- data-id="attachViewer"
248
- data-test-id="attachViewer"
249
- id="img0"
250
- src="https://2.bp.blogspot.com/_H-PCzW2K720/SlXXLLMOzsI/AAAAAAAAAFE/efv7GBth9cQ/s280/Elva+Hill+04.JPG"
251
- />
252
191
  </div>
253
192
  </div>
254
193
  </div>
@@ -298,7 +237,7 @@ exports[`AttachmentViewer rendering the when isActive is true 1`] = `
298
237
  data-test-id="containerComponent"
299
238
  >
300
239
  <div
301
- class="imgItem selected shrinkOff"
240
+ class="imgItem selected shrinkOff"
302
241
  data-id="attachPreviewList"
303
242
  data-selector-id="box"
304
243
  data-test-id="attachPreviewList"
@@ -313,16 +252,9 @@ exports[`AttachmentViewer rendering the when isActive is true 1`] = `
313
252
  class="loader"
314
253
  />
315
254
  </div>
316
- <img
317
- alt="slack0.jpg"
318
- class=" hide image imgMaxFullSize "
319
- data-id="AttachmentImage"
320
- data-test-id="AttachmentImage"
321
- src="https://2.bp.blogspot.com/_H-PCzW2K720/SlXXLLMOzsI/AAAAAAAAAFE/efv7GBth9cQ/s280/Elva+Hill+04.JPG"
322
- />
323
255
  </div>
324
256
  <div
325
- class="imgItem shrinkOff"
257
+ class="imgItem shrinkOff"
326
258
  data-id="attachPreviewList"
327
259
  data-selector-id="box"
328
260
  data-test-id="attachPreviewList"
@@ -337,16 +269,9 @@ exports[`AttachmentViewer rendering the when isActive is true 1`] = `
337
269
  class="loader"
338
270
  />
339
271
  </div>
340
- <img
341
- alt="slack1.jpg"
342
- class=" hide image imgMaxFullSize "
343
- data-id="AttachmentImage"
344
- data-test-id="AttachmentImage"
345
- src="https://p.bigstockphoto.com/GeFvQkBbSLaMdpKXF1Zv_bigstock-Aerial-View-Of-Blue-Lakes-And--227291596.jpg"
346
- />
347
272
  </div>
348
273
  <div
349
- class="imgItem shrinkOff"
274
+ class="imgItem shrinkOff"
350
275
  data-id="attachPreviewList"
351
276
  data-selector-id="box"
352
277
  data-test-id="attachPreviewList"
@@ -361,16 +286,9 @@ exports[`AttachmentViewer rendering the when isActive is true 1`] = `
361
286
  class="loader"
362
287
  />
363
288
  </div>
364
- <img
365
- alt="slack2.jpg"
366
- class=" hide image imgMaxFullSize "
367
- data-id="AttachmentImage"
368
- data-test-id="AttachmentImage"
369
- src="https://wallpapercave.com/wp/wp3913900.jpg"
370
- />
371
289
  </div>
372
290
  <div
373
- class="imgItem shrinkOff"
291
+ class="imgItem shrinkOff"
374
292
  data-id="attachPreviewList"
375
293
  data-selector-id="box"
376
294
  data-test-id="attachPreviewList"
@@ -385,16 +303,9 @@ exports[`AttachmentViewer rendering the when isActive is true 1`] = `
385
303
  class="loader"
386
304
  />
387
305
  </div>
388
- <img
389
- alt="slack3.jpg"
390
- class=" hide image imgMaxFullSize "
391
- data-id="AttachmentImage"
392
- data-test-id="AttachmentImage"
393
- src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Giraffe_2019-07-28.jpg/682px-Giraffe_2019-07-28.jpg"
394
- />
395
306
  </div>
396
307
  <div
397
- class="imgItem shrinkOff"
308
+ class="imgItem shrinkOff"
398
309
  data-id="attachPreviewList"
399
310
  data-selector-id="box"
400
311
  data-test-id="attachPreviewList"
@@ -409,16 +320,9 @@ exports[`AttachmentViewer rendering the when isActive is true 1`] = `
409
320
  class="loader"
410
321
  />
411
322
  </div>
412
- <img
413
- alt="slack4.jpg"
414
- class=" hide image imgMaxFullSize "
415
- data-id="AttachmentImage"
416
- data-test-id="AttachmentImage"
417
- src="https://wallpapercave.com/wp/wp3913900.jpg"
418
- />
419
323
  </div>
420
324
  <div
421
- class="imgItem shrinkOff"
325
+ class="imgItem shrinkOff"
422
326
  data-id="attachPreviewList"
423
327
  data-selector-id="box"
424
328
  data-test-id="attachPreviewList"
@@ -433,28 +337,23 @@ exports[`AttachmentViewer rendering the when isActive is true 1`] = `
433
337
  class="loader"
434
338
  />
435
339
  </div>
436
- <img
437
- alt="slack5.jpg"
438
- class=" hide image imgMaxFullSize "
439
- data-id="AttachmentImage"
440
- data-test-id="AttachmentImage"
441
- src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Giraffe_2019-07-28.jpg/682px-Giraffe_2019-07-28.jpg"
442
- />
443
340
  </div>
444
341
  <div
445
- class="imgItem isAudio shrinkOff"
342
+ class="imgItem shrinkOff"
446
343
  data-id="attachPreviewList"
447
344
  data-selector-id="box"
448
345
  data-test-id="attachPreviewList"
449
346
  data-title="slack5.mp3"
450
347
  >
451
- <img
452
- alt="slack5.mp3"
453
- class=" image imgMaxFullSize "
454
- data-id="AttachmentImage"
455
- data-test-id="AttachmentImage"
456
- src="https://www.w3schools.com/html/horse.mp3"
457
- />
348
+ <div
349
+ class="spinLoad"
350
+ data-id="AttachmentImage_loader"
351
+ data-test-id="AttachmentImage_loader"
352
+ >
353
+ <div
354
+ class="loader"
355
+ />
356
+ </div>
458
357
  </div>
459
358
  </div>
460
359
  </div>
@@ -1,5 +1,9 @@
1
1
  export const AttachmentImage_defaultProps = {
2
- dataId: 'AttachmentImage'
2
+ dataId: 'AttachmentImage',
3
+ customClass: {
4
+ customImageClass: '',
5
+ customChildrenClass: ''
6
+ }
3
7
  };
4
8
  export const AttachmentViewer_defaultProps = {
5
9
  responsiveId: "Helmet",
@@ -1,14 +1,18 @@
1
1
  import PropTypes from 'prop-types';
2
2
  export const AttachmentImage_propTypes = {
3
3
  alt: PropTypes.string,
4
- className: PropTypes.string,
4
+ customClass: PropTypes.shape({
5
+ customImageClass: PropTypes.string,
6
+ customChildrenClass: PropTypes.string
7
+ }),
5
8
  dataId: PropTypes.string,
6
9
  id: PropTypes.string,
7
10
  isCover: PropTypes.bool,
8
- isImage: PropTypes.string,
9
11
  onClick: PropTypes.func,
10
12
  onLoad: PropTypes.func,
11
- src: PropTypes.string
13
+ onError: PropTypes.func,
14
+ src: PropTypes.string,
15
+ children: PropTypes.node
12
16
  };
13
17
  export const AttachmentViewer_propTypes = {
14
18
  hideAttachmentViewer: PropTypes.func,
@@ -1,3 +1,4 @@
1
+ import { isAudioFile } from "./Attachment";
1
2
  export class Zoom {
2
3
  constructor() {
3
4
  const matrix = [1, 0, 0, 1, 0, 0]; // current view transform
@@ -104,4 +105,52 @@ export class ZoomEvent {
104
105
  event.preventDefault();
105
106
  }
106
107
 
108
+ }
109
+ export function checkImageValidity(src) {
110
+ return new Promise(resolve => {
111
+ const img = new Image();
112
+ img.src = src;
113
+
114
+ img.onload = () => {
115
+ resolve(true);
116
+ };
117
+
118
+ img.onerror = () => {
119
+ resolve(false);
120
+ };
121
+ });
122
+ }
123
+ export function checkAudioUrlValidity(url) {
124
+ return new Promise(resolve => {
125
+ const audio = new Audio(url);
126
+
127
+ audio.oncanplaythrough = () => {
128
+ resolve(true);
129
+ };
130
+
131
+ audio.onerror = () => {
132
+ resolve(false);
133
+ };
134
+ });
135
+ }
136
+ ;
137
+ export function checkFileSourcesValidation(_ref) {
138
+ let {
139
+ fileName,
140
+ viewURL
141
+ } = _ref;
142
+
143
+ if (isAudioFile(fileName)) {
144
+ const audioValidityPromise = checkAudioUrlValidity(viewURL);
145
+ return audioValidityPromise.then(isURLValid => ({
146
+ isViewURLValid: isURLValid,
147
+ canZoom: false
148
+ }));
149
+ } else {
150
+ const imageValidityPromise = checkImageValidity(viewURL);
151
+ return imageValidityPromise.then(isURLValid => ({
152
+ isViewURLValid: isURLValid,
153
+ canZoom: isURLValid
154
+ }));
155
+ }
107
156
  }