@zohodesk/dot 1.7.19 → 1.7.20-exp.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/README.md +28 -0
  2. package/assets/Appearance/dark/mode/Dot_DarkMode.module.css +11 -1
  3. package/assets/Appearance/light/mode/Dot_LightMode.module.css +11 -1
  4. package/assets/Appearance/pureDark/mode/Dot_PureDarkMode.module.css +11 -1
  5. package/es/ActionButton/ActionButton.js +6 -6
  6. package/es/ActionButton/ActionButton.module.css +1 -1
  7. package/es/AlphabeticList/AlphabeticList.js +1 -1
  8. package/es/AlphabeticList/AlphabeticList.module.css +1 -1
  9. package/es/Attachment/Attachment.js +7 -4
  10. package/es/Attachment/__tests__/Attachment.spec.js +24 -0
  11. package/es/Attachment/__tests__/__snapshots__/Attachment.spec.js.snap +105 -0
  12. package/es/AttachmentViewer/AttachmentViewer.js +5 -5
  13. package/es/AttachmentViewer/AttachmentViewer.module.css +1 -1
  14. package/es/AudioPlayer/AudioPlayer.js +580 -0
  15. package/es/AudioPlayer/AudioPlayer.module.css +146 -0
  16. package/es/AudioPlayer/Timer/Timer.js +67 -0
  17. package/es/AudioPlayer/Timer/Timer.module.css +5 -0
  18. package/es/AudioPlayer/Timer/__tests__/Timer.spec.js +20 -0
  19. package/es/AudioPlayer/Timer/__tests__/__snapshots__/Timer.spec.js.snap +14 -0
  20. package/es/AudioPlayer/Timer/propTypes/defaultProps.js +4 -0
  21. package/es/AudioPlayer/Timer/propTypes/propTypes.js +11 -0
  22. package/es/AudioPlayer/__tests__/AudioPlayer.spec.js +192 -0
  23. package/es/AudioPlayer/__tests__/__snapshots__/AudioPlayer.spec.js.snap +1995 -0
  24. package/es/AudioPlayer/propTypes/defaultProps.js +14 -0
  25. package/es/AudioPlayer/propTypes/propTypes.js +33 -0
  26. package/es/AudioPlayer/utils/utils.js +24 -0
  27. package/es/ChannelIcon/ChannelIcon.js +1 -1
  28. package/es/DotProvider/hooks/useDotProvider.js +1 -0
  29. package/es/Drawer/Drawer.js +6 -6
  30. package/es/Drawer/Drawer.module.css +1 -1
  31. package/es/FlipCard/FlipCard.js +3 -3
  32. package/es/FormAction/FormAction.js +1 -1
  33. package/es/FreezeLayer/FreezeLayer.js +3 -3
  34. package/es/Hooks/Dragger/useDragger.js +52 -33
  35. package/es/IconButton/IconButton.js +3 -3
  36. package/es/ImportantNotes/ImportantNotes.js +1 -1
  37. package/es/Loader/Loader.js +1 -1
  38. package/es/MessageBanner/MessageBanner.js +1 -1
  39. package/es/NewStar/NewStar.js +1 -1
  40. package/es/Onboarding/Onboarding.js +3 -3
  41. package/es/Separator/Separator.js +1 -1
  42. package/es/ToastMessage/ToastMessage.js +4 -4
  43. package/es/Upload/Upload.js +1 -1
  44. package/es/VideoLookup/VideoLookup.js +1 -1
  45. package/es/alert/AlertHeader/AlertHeader.js +1 -1
  46. package/es/alert/AlertLookup/AlertLookup.js +1 -1
  47. package/es/avatar/AvatarClose/AvatarClose.js +1 -1
  48. package/es/avatar/AvatarCollision/AvatarCollision.js +1 -1
  49. package/es/avatar/AvatarIcon/AvatarIcon.js +2 -2
  50. package/es/avatar/AvatarStatus/AvatarStatus.js +1 -1
  51. package/es/avatar/AvatarThread/AvatarThread.js +1 -1
  52. package/es/avatar/AvatarUser/AvatarUser.js +1 -1
  53. package/es/avatar/AvatarWithTeam/AvatarWithTeam.js +2 -2
  54. package/es/deprecated/FreezeLayer/FreezeLayer.js +3 -3
  55. package/es/deprecated/SelectDropdown/SelectDropdown.js +7 -7
  56. package/es/dot_layer.module.css +1 -0
  57. package/es/dropdown/ToggleDropDown/ToggleDropDown.js +14 -14
  58. package/es/emptystate/CommonEmptyState/CommonEmptyState.module.css +1 -1
  59. package/es/emptystate/EditionPage/EditionPage.css +2 -2
  60. package/es/emptystate/EditionPage/EditionPage.js +1 -1
  61. package/es/errorstate/Inconvenience/Inconvenience.js +3 -3
  62. package/es/errorstate/NoRequestFound/NoRequestFound.js +3 -3
  63. package/es/errorstate/PermissionPlay/PermissionPlay.js +3 -3
  64. package/es/errorstate/PermissionPlay/PermissionPlay.module.css +1 -1
  65. package/es/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +3 -3
  66. package/es/errorstate/UnableToProcess/UnableToProcess.js +3 -3
  67. package/es/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +3 -3
  68. package/es/errorstate/WillBack/WillBack.js +3 -3
  69. package/es/form/fields/CheckBoxField/CheckBoxField.js +3 -3
  70. package/es/form/fields/CurrencyField/CurrencyField.js +3 -3
  71. package/es/form/fields/DateField/DateField.js +3 -3
  72. package/es/form/fields/FieldContainer/FieldContainer.js +1 -1
  73. package/es/form/fields/Fields.module.css +4 -0
  74. package/es/form/fields/MultiSelectField/MultiSelectField.js +3 -3
  75. package/es/form/fields/PhoneField/PhoneField.js +3 -2
  76. package/es/form/fields/PhoneField/__tests__/__snapshots__/PhoneField.spec.js.snap +1 -1
  77. package/es/form/fields/RadioField/RadioField.js +2 -2
  78. package/es/form/fields/SelectField/SelectField.js +3 -3
  79. package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +11 -11
  80. package/es/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +3 -3
  81. package/es/form/fields/TextBoxField/TextBoxField.js +3 -3
  82. package/es/form/fields/TextEditor/TextEditor.js +3 -2
  83. package/es/form/fields/TextEditor/TextEditor.module.css +2 -2
  84. package/es/form/fields/TextEditorField/TextEditorField.js +1 -1
  85. package/es/form/fields/TextEditorWrapper/TextEditorWrapper.js +2 -2
  86. package/es/form/fields/TextareaField/TextareaField.js +3 -3
  87. package/es/form/fields/ValidationMessage/ValidationMessage.js +2 -2
  88. package/es/form/fields/ValidationMessage/ValidationMessage.module.css +1 -0
  89. package/es/layout/SetupDetailLayout/SetupDetailLayout.js +1 -1
  90. package/es/layout/SetupDetailLayout/SetupDetailLayout.module.css +1 -1
  91. package/es/layout/SubtabLayout/SubtabLayout.js +2 -2
  92. package/es/list/Comment/Comment.js +1 -1
  93. package/es/list/Icons/AddNewIcon.js +1 -1
  94. package/es/list/Icons/CompleteIcon.js +1 -1
  95. package/es/list/Icons/DeleteIcon.js +1 -1
  96. package/es/list/Icons/EditIcon.js +1 -1
  97. package/es/list/Icons/ReadUnreadIcon.js +1 -1
  98. package/es/list/Icons/SmartIcon.js +1 -1
  99. package/es/list/ListLayout/ListLayout.js +1 -1
  100. package/es/list/ListStencils/ListStencils.js +1 -1
  101. package/es/list/SecondaryText/AccountName.js +1 -1
  102. package/es/list/SecondaryText/ContactName.js +1 -1
  103. package/es/list/SecondaryText/SecondaryText.module.css +8 -8
  104. package/es/list/SecondryPanel/SecondryPanel.js +2 -2
  105. package/es/list/Subject/Subject.module.css +3 -3
  106. package/es/list/Thread/Thread.js +1 -1
  107. package/es/list/status/StatusDropdown/StatusDropdown.js +10 -10
  108. package/es/list/status/StatusListItem/StatusListItem.js +2 -2
  109. package/es/lookup/EmptyPage/EmptyPage.js +4 -4
  110. package/es/lookup/EmptyPage/LookupEmptyPage.module.css +4 -2
  111. package/es/lookup/Lookup/Lookup.js +1 -1
  112. package/es/lookup/Section/Section.js +1 -1
  113. package/es/lookup/header/ModuleHeader/ModuleHeader.js +1 -1
  114. package/es/lookup/header/Search/Search.js +3 -3
  115. package/es/lookup/header/TicketHeader/TicketHeader.js +1 -1
  116. package/es/lookup/header/Title/LookupTitle.module.css +7 -3
  117. package/es/lookup/header/ViewDropDown/ViewDropDown.js +9 -9
  118. package/es/lookup/header/ViewDropDown/ViewDropDown.module.css +13 -2
  119. package/es/setup/header/Button/Button.js +1 -1
  120. package/es/setup/header/Link/Link.js +1 -1
  121. package/es/setup/header/Search/Search.js +1 -1
  122. package/es/setup/header/Search/Search.module.css +1 -1
  123. package/es/setup/table/Table/Table.js +1 -1
  124. package/es/setup/table/TableBody/TableBody.js +1 -1
  125. package/es/setup/table/TableData/TableData.js +1 -1
  126. package/es/setup/table/TableHead/TableHead.js +1 -1
  127. package/es/setup/table/TableRow/TableRow.js +1 -1
  128. package/es/svg/PlusIcon.js +1 -1
  129. package/es/svg/SnippetIcon.js +1 -1
  130. package/es/svg/TemplateIcon.js +1 -1
  131. package/es/v1/dropdown/ToggleDropDown/ToggleDropDown.js +2 -2
  132. package/es/v1/emptystate/EditionPage/EditionPage.js +1 -1
  133. package/es/v1/errorstate/Inconvenience/Inconvenience.js +1 -1
  134. package/es/v1/errorstate/OopsSomethingMiss/OopsSomethingMiss.js +1 -1
  135. package/es/v1/errorstate/UnableToProcessRequest/UnableToProcessRequest.js +1 -1
  136. package/es/v1/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +1 -1
  137. package/es/v1/errorstate/UrlNotFound/UrlNotFound.js +1 -1
  138. package/es/v1/errorstate/WillBeRightBack/WillBeRightBack.js +1 -1
  139. package/es/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +2 -2
  140. package/es/v1/form/fields/TextEditor/TextEditor.js +2 -1
  141. package/es/v1/list/status/StatusDropdown/StatusDropdown.js +2 -2
  142. package/es/v1/lookup/EmptyPage/EmptyPage.js +4 -4
  143. package/es/v1/lookup/header/ViewDropDown/ViewDropDown.js +1 -1
  144. package/es/v1/notification/DesktopNotification/DesktopNotification.js +1 -1
  145. package/es/v1/notification/DesktopNotificationHeader/DesktopNotificationHeader.js +1 -1
  146. package/es/v1/svg/PlusIcon.js +1 -1
  147. package/es/v1/svg/SnippetIcon.js +1 -1
  148. package/es/v1/svg/TemplateIcon.js +1 -1
  149. package/es/version2/AlertClose/AlertClose.js +1 -1
  150. package/es/version2/GlobalNotification/GlobalNotification.js +1 -1
  151. package/es/version2/GlobalNotification/GlobalNotification.module.css +3 -2
  152. package/es/version2/errorstate/Inconvenience/Inconvenience.js +3 -3
  153. package/es/version2/errorstate/OopsSomethingMiss/OopsSomethingMiss.js +3 -3
  154. package/es/version2/errorstate/UnableToProcessRequest/UnableToProcessRequest.js +3 -3
  155. package/es/version2/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +3 -3
  156. package/es/version2/errorstate/UrlNotFound/UrlNotFound.js +3 -3
  157. package/es/version2/errorstate/V2_ErrorStates.module.css +1 -1
  158. package/es/version2/errorstate/WillBeRightBack/WillBeRightBack.js +3 -3
  159. package/es/version2/lookup/AlertHeader/AlertHeader.js +1 -1
  160. package/es/version2/lookup/AlertHeader/css/AlertHeaderNew.module.css +9 -3
  161. package/es/version2/lookup/AlertLookup/AlertLookup.js +3 -3
  162. package/es/version2/lookup/alertLookupCommonNew.module.css +1 -1
  163. package/es/version2/notification/DesktopNotification/DesktopNotification.js +4 -4
  164. package/es/version2/notification/DesktopNotification/DesktopNotification.module.css +4 -3
  165. package/es/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.js +2 -2
  166. package/es/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css +1 -0
  167. package/lib/ActionButton/ActionButton.js +6 -6
  168. package/lib/ActionButton/ActionButton.module.css +1 -1
  169. package/lib/AlphabeticList/AlphabeticList.js +1 -1
  170. package/lib/AlphabeticList/AlphabeticList.module.css +1 -1
  171. package/lib/Attachment/Attachment.js +7 -4
  172. package/lib/Attachment/__tests__/Attachment.spec.js +24 -0
  173. package/lib/Attachment/__tests__/__snapshots__/Attachment.spec.js.snap +105 -0
  174. package/lib/AttachmentViewer/AttachmentViewer.js +5 -5
  175. package/lib/AttachmentViewer/AttachmentViewer.module.css +1 -1
  176. package/lib/AudioPlayer/AudioPlayer.js +662 -0
  177. package/lib/AudioPlayer/AudioPlayer.module.css +146 -0
  178. package/lib/AudioPlayer/Timer/Timer.js +117 -0
  179. package/lib/AudioPlayer/Timer/Timer.module.css +5 -0
  180. package/lib/AudioPlayer/Timer/__tests__/Timer.spec.js +26 -0
  181. package/lib/AudioPlayer/Timer/__tests__/__snapshots__/Timer.spec.js.snap +14 -0
  182. package/lib/AudioPlayer/Timer/propTypes/defaultProps.js +11 -0
  183. package/lib/AudioPlayer/Timer/propTypes/propTypes.js +22 -0
  184. package/lib/AudioPlayer/__tests__/AudioPlayer.spec.js +210 -0
  185. package/lib/AudioPlayer/__tests__/__snapshots__/AudioPlayer.spec.js.snap +1995 -0
  186. package/lib/AudioPlayer/propTypes/defaultProps.js +24 -0
  187. package/lib/AudioPlayer/propTypes/propTypes.js +44 -0
  188. package/lib/AudioPlayer/utils/utils.js +33 -0
  189. package/lib/ChannelIcon/ChannelIcon.js +1 -1
  190. package/lib/DotProvider/hooks/useDotProvider.js +2 -0
  191. package/lib/Drawer/Drawer.js +6 -6
  192. package/lib/Drawer/Drawer.module.css +1 -1
  193. package/lib/FlipCard/FlipCard.js +3 -3
  194. package/lib/FormAction/FormAction.js +1 -1
  195. package/lib/FreezeLayer/FreezeLayer.js +3 -3
  196. package/lib/Hooks/Dragger/useDragger.js +51 -28
  197. package/lib/IconButton/IconButton.js +3 -3
  198. package/lib/ImportantNotes/ImportantNotes.js +1 -1
  199. package/lib/Loader/Loader.js +1 -1
  200. package/lib/MessageBanner/MessageBanner.js +1 -1
  201. package/lib/NewStar/NewStar.js +1 -1
  202. package/lib/Onboarding/Onboarding.js +3 -3
  203. package/lib/Separator/Separator.js +1 -1
  204. package/lib/ToastMessage/ToastMessage.js +4 -4
  205. package/lib/Upload/Upload.js +1 -1
  206. package/lib/VideoLookup/VideoLookup.js +1 -1
  207. package/lib/alert/AlertHeader/AlertHeader.js +1 -1
  208. package/lib/alert/AlertLookup/AlertLookup.js +1 -1
  209. package/lib/avatar/AvatarClose/AvatarClose.js +1 -1
  210. package/lib/avatar/AvatarCollision/AvatarCollision.js +1 -1
  211. package/lib/avatar/AvatarIcon/AvatarIcon.js +2 -2
  212. package/lib/avatar/AvatarStatus/AvatarStatus.js +1 -1
  213. package/lib/avatar/AvatarThread/AvatarThread.js +1 -1
  214. package/lib/avatar/AvatarUser/AvatarUser.js +1 -1
  215. package/lib/avatar/AvatarWithTeam/AvatarWithTeam.js +2 -2
  216. package/lib/deprecated/FreezeLayer/FreezeLayer.js +3 -3
  217. package/lib/deprecated/SelectDropdown/SelectDropdown.js +7 -7
  218. package/lib/dot_layer.module.css +1 -0
  219. package/lib/dropdown/ToggleDropDown/ToggleDropDown.js +14 -14
  220. package/lib/emptystate/CommonEmptyState/CommonEmptyState.module.css +1 -1
  221. package/lib/emptystate/EditionPage/EditionPage.css +2 -2
  222. package/lib/emptystate/EditionPage/EditionPage.js +1 -1
  223. package/lib/errorstate/Inconvenience/Inconvenience.js +3 -3
  224. package/lib/errorstate/NoRequestFound/NoRequestFound.js +3 -3
  225. package/lib/errorstate/PermissionPlay/PermissionPlay.js +3 -3
  226. package/lib/errorstate/PermissionPlay/PermissionPlay.module.css +1 -1
  227. package/lib/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +3 -3
  228. package/lib/errorstate/UnableToProcess/UnableToProcess.js +3 -3
  229. package/lib/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +3 -3
  230. package/lib/errorstate/WillBack/WillBack.js +3 -3
  231. package/lib/form/fields/CheckBoxField/CheckBoxField.js +3 -3
  232. package/lib/form/fields/CurrencyField/CurrencyField.js +3 -3
  233. package/lib/form/fields/DateField/DateField.js +3 -3
  234. package/lib/form/fields/FieldContainer/FieldContainer.js +1 -1
  235. package/lib/form/fields/Fields.module.css +4 -0
  236. package/lib/form/fields/MultiSelectField/MultiSelectField.js +3 -3
  237. package/lib/form/fields/PhoneField/PhoneField.js +3 -2
  238. package/lib/form/fields/PhoneField/__tests__/__snapshots__/PhoneField.spec.js.snap +1 -1
  239. package/lib/form/fields/RadioField/RadioField.js +2 -2
  240. package/lib/form/fields/SelectField/SelectField.js +3 -3
  241. package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.js +11 -11
  242. package/lib/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +3 -3
  243. package/lib/form/fields/TextBoxField/TextBoxField.js +3 -3
  244. package/lib/form/fields/TextEditor/TextEditor.js +2 -2
  245. package/lib/form/fields/TextEditor/TextEditor.module.css +2 -2
  246. package/lib/form/fields/TextEditorField/TextEditorField.js +1 -1
  247. package/lib/form/fields/TextEditorWrapper/TextEditorWrapper.js +2 -2
  248. package/lib/form/fields/TextareaField/TextareaField.js +3 -3
  249. package/lib/form/fields/ValidationMessage/ValidationMessage.js +2 -2
  250. package/lib/form/fields/ValidationMessage/ValidationMessage.module.css +1 -0
  251. package/lib/layout/SetupDetailLayout/SetupDetailLayout.js +1 -1
  252. package/lib/layout/SetupDetailLayout/SetupDetailLayout.module.css +1 -1
  253. package/lib/layout/SubtabLayout/SubtabLayout.js +2 -2
  254. package/lib/list/Comment/Comment.js +1 -1
  255. package/lib/list/Icons/AddNewIcon.js +1 -1
  256. package/lib/list/Icons/CompleteIcon.js +1 -1
  257. package/lib/list/Icons/DeleteIcon.js +1 -1
  258. package/lib/list/Icons/EditIcon.js +1 -1
  259. package/lib/list/Icons/ReadUnreadIcon.js +1 -1
  260. package/lib/list/Icons/SmartIcon.js +1 -1
  261. package/lib/list/ListLayout/ListLayout.js +1 -1
  262. package/lib/list/ListStencils/ListStencils.js +1 -1
  263. package/lib/list/SecondaryText/AccountName.js +1 -1
  264. package/lib/list/SecondaryText/ContactName.js +1 -1
  265. package/lib/list/SecondaryText/SecondaryText.module.css +8 -8
  266. package/lib/list/SecondryPanel/SecondryPanel.js +2 -2
  267. package/lib/list/Subject/Subject.module.css +3 -3
  268. package/lib/list/Thread/Thread.js +1 -1
  269. package/lib/list/status/StatusDropdown/StatusDropdown.js +10 -10
  270. package/lib/list/status/StatusListItem/StatusListItem.js +2 -2
  271. package/lib/lookup/EmptyPage/EmptyPage.js +4 -4
  272. package/lib/lookup/EmptyPage/LookupEmptyPage.module.css +4 -2
  273. package/lib/lookup/Lookup/Lookup.js +1 -1
  274. package/lib/lookup/Section/Section.js +1 -1
  275. package/lib/lookup/header/ModuleHeader/ModuleHeader.js +1 -1
  276. package/lib/lookup/header/Search/Search.js +3 -3
  277. package/lib/lookup/header/TicketHeader/TicketHeader.js +1 -1
  278. package/lib/lookup/header/Title/LookupTitle.module.css +7 -3
  279. package/lib/lookup/header/ViewDropDown/ViewDropDown.js +9 -9
  280. package/lib/lookup/header/ViewDropDown/ViewDropDown.module.css +13 -2
  281. package/lib/setup/header/Button/Button.js +1 -1
  282. package/lib/setup/header/Link/Link.js +1 -1
  283. package/lib/setup/header/Search/Search.js +1 -1
  284. package/lib/setup/header/Search/Search.module.css +1 -1
  285. package/lib/setup/table/Table/Table.js +1 -1
  286. package/lib/setup/table/TableBody/TableBody.js +1 -1
  287. package/lib/setup/table/TableData/TableData.js +1 -1
  288. package/lib/setup/table/TableHead/TableHead.js +1 -1
  289. package/lib/setup/table/TableRow/TableRow.js +1 -1
  290. package/lib/svg/PlusIcon.js +1 -1
  291. package/lib/svg/SnippetIcon.js +1 -1
  292. package/lib/svg/TemplateIcon.js +1 -1
  293. package/lib/v1/dropdown/ToggleDropDown/ToggleDropDown.js +2 -2
  294. package/lib/v1/emptystate/EditionPage/EditionPage.js +1 -1
  295. package/lib/v1/errorstate/Inconvenience/Inconvenience.js +1 -1
  296. package/lib/v1/errorstate/OopsSomethingMiss/OopsSomethingMiss.js +1 -1
  297. package/lib/v1/errorstate/UnableToProcessRequest/UnableToProcessRequest.js +1 -1
  298. package/lib/v1/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +1 -1
  299. package/lib/v1/errorstate/UrlNotFound/UrlNotFound.js +1 -1
  300. package/lib/v1/errorstate/WillBeRightBack/WillBeRightBack.js +1 -1
  301. package/lib/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +2 -2
  302. package/lib/v1/form/fields/TextEditor/TextEditor.js +1 -1
  303. package/lib/v1/list/status/StatusDropdown/StatusDropdown.js +2 -2
  304. package/lib/v1/lookup/EmptyPage/EmptyPage.js +4 -4
  305. package/lib/v1/lookup/header/ViewDropDown/ViewDropDown.js +1 -1
  306. package/lib/v1/notification/DesktopNotification/DesktopNotification.js +1 -1
  307. package/lib/v1/notification/DesktopNotificationHeader/DesktopNotificationHeader.js +1 -1
  308. package/lib/v1/svg/PlusIcon.js +1 -1
  309. package/lib/v1/svg/SnippetIcon.js +1 -1
  310. package/lib/v1/svg/TemplateIcon.js +1 -1
  311. package/lib/version2/AlertClose/AlertClose.js +1 -1
  312. package/lib/version2/GlobalNotification/GlobalNotification.js +1 -1
  313. package/lib/version2/GlobalNotification/GlobalNotification.module.css +3 -2
  314. package/lib/version2/errorstate/Inconvenience/Inconvenience.js +3 -3
  315. package/lib/version2/errorstate/OopsSomethingMiss/OopsSomethingMiss.js +3 -3
  316. package/lib/version2/errorstate/UnableToProcessRequest/UnableToProcessRequest.js +3 -3
  317. package/lib/version2/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +3 -3
  318. package/lib/version2/errorstate/UrlNotFound/UrlNotFound.js +3 -3
  319. package/lib/version2/errorstate/V2_ErrorStates.module.css +1 -1
  320. package/lib/version2/errorstate/WillBeRightBack/WillBeRightBack.js +3 -3
  321. package/lib/version2/lookup/AlertHeader/AlertHeader.js +1 -1
  322. package/lib/version2/lookup/AlertHeader/css/AlertHeaderNew.module.css +9 -3
  323. package/lib/version2/lookup/AlertLookup/AlertLookup.js +3 -3
  324. package/lib/version2/lookup/alertLookupCommonNew.module.css +1 -1
  325. package/lib/version2/notification/DesktopNotification/DesktopNotification.js +4 -4
  326. package/lib/version2/notification/DesktopNotification/DesktopNotification.module.css +4 -3
  327. package/lib/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.js +2 -2
  328. package/lib/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css +1 -0
  329. package/package.json +23 -14
  330. package/.cli/MissedPropType_Keys.html +0 -101
  331. package/.cli/PropLessFiles.html +0 -101
  332. package/.cli/PropUnificationExcludeFilesArray.js +0 -345
  333. package/.cli/PropValidationExcludeFilesArray.js +0 -8
  334. package/.cli/ThemeValidationExcludeFiles.js +0 -1
  335. package/.cli/UnValidatedFiles.html +0 -101
  336. package/.cli/propValidation_report.html +0 -182
  337. package/.cli/stringContains.js +0 -1
  338. package/css_error.log +0 -1
  339. package/images/audio_thumbnail.png +0 -0
  340. package/install.md +0 -12
  341. package/postPublish.js +0 -8
  342. package/prePublish.js +0 -70
  343. package/propValidationArg.json +0 -12
  344. package/react-cli.config.js +0 -24
  345. package/result.json +0 -1
  346. package/unittest/index.html +0 -37
@@ -0,0 +1,662 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _Layout = require("@zohodesk/components/lib/Layout");
13
+
14
+ var _Timer = _interopRequireDefault(require("./Timer/Timer"));
15
+
16
+ var _Icon = _interopRequireDefault(require("@zohodesk/icons/lib/Icon"));
17
+
18
+ var _propTypes = require("./propTypes/propTypes");
19
+
20
+ var _defaultProps = require("./propTypes/defaultProps");
21
+
22
+ var _utils = require("./utils/utils");
23
+
24
+ var _Attachment = require("./../AttachmentViewer/Attachment");
25
+
26
+ var _AudioPlayerModule = _interopRequireDefault(require("./AudioPlayer.module.css"));
27
+
28
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
29
+
30
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
31
+
32
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
33
+
34
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
35
+
36
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
37
+
38
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
39
+
40
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
41
+
42
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
43
+
44
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
45
+
46
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
47
+
48
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
49
+
50
+ var AudioPlayer = /*#__PURE__*/function (_React$Component) {
51
+ _inherits(AudioPlayer, _React$Component);
52
+
53
+ var _super = _createSuper(AudioPlayer);
54
+
55
+ function AudioPlayer(props) {
56
+ var _this;
57
+
58
+ _classCallCheck(this, AudioPlayer);
59
+
60
+ _this = _super.call(this, props);
61
+ _this.audioPlayer = null;
62
+ _this.removeEventListeners = _this.removeEventListeners.bind(_assertThisInitialized(_this));
63
+ _this.setAudioPlayerRef = _this.setAudioPlayerRef.bind(_assertThisInitialized(_this));
64
+ return _this;
65
+ }
66
+
67
+ _createClass(AudioPlayer, [{
68
+ key: "componentDidMount",
69
+ value: function componentDidMount() {
70
+ var AudioPlayerChild = this.refs.AudioPlayerChild;
71
+ this.audioPlayer.addEventListener('keydown', AudioPlayerChild.handleKeyDown);
72
+ }
73
+ }, {
74
+ key: "componentWillUnmount",
75
+ value: function componentWillUnmount() {
76
+ this.removeEventListeners();
77
+ }
78
+ }, {
79
+ key: "removeEventListeners",
80
+ value: function removeEventListeners() {
81
+ var AudioPlayerChild = this.refs.AudioPlayerChild;
82
+ this.audioPlayer.removeEventListener('keydown', AudioPlayerChild.handleKeyDown);
83
+ }
84
+ }, {
85
+ key: "setAudioPlayerRef",
86
+ value: function setAudioPlayerRef(ele) {
87
+ this.audioPlayer = ele;
88
+ }
89
+ }, {
90
+ key: "render",
91
+ value: function render() {
92
+ var _this$props = this.props,
93
+ id = _this$props.id,
94
+ isPlay = _this$props.isPlay,
95
+ onClose = _this$props.onClose,
96
+ src = _this$props.src,
97
+ timerFormat = _this$props.timerFormat,
98
+ forwardStepInSec = _this$props.forwardStepInSec,
99
+ backwardStepInSec = _this$props.backwardStepInSec,
100
+ getAudioDuration = _this$props.getAudioDuration,
101
+ needClose = _this$props.needClose,
102
+ needDownload = _this$props.needDownload,
103
+ needMuteIcon = _this$props.needMuteIcon,
104
+ onPlay = _this$props.onPlay,
105
+ onPause = _this$props.onPause,
106
+ onDownloading = _this$props.onDownloading,
107
+ onAudioSeeking = _this$props.onAudioSeeking,
108
+ onAudioLoading = _this$props.onAudioLoading,
109
+ onError = _this$props.onError,
110
+ onMuteUnmute = _this$props.onMuteUnmute,
111
+ duration = _this$props.duration,
112
+ i18nKeys = _this$props.i18nKeys,
113
+ dataId = _this$props.dataId,
114
+ customClass = _this$props.customClass,
115
+ range = _this$props.range;
116
+ return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
117
+ dataId: dataId,
118
+ eleRef: this.setAudioPlayerRef,
119
+ tabIndex: 0,
120
+ isCover: false,
121
+ className: "".concat(customClass)
122
+ }, /*#__PURE__*/_react["default"].createElement(AudioPlayerChild, {
123
+ ref: "AudioPlayerChild",
124
+ id: id,
125
+ src: src,
126
+ isPlay: isPlay,
127
+ onClose: onClose,
128
+ timerFormat: timerFormat,
129
+ duration: duration,
130
+ forwardStepInSec: forwardStepInSec,
131
+ backwardStepInSec: backwardStepInSec,
132
+ getAudioDuration: getAudioDuration,
133
+ needClose: needClose,
134
+ needDownload: needDownload,
135
+ needMuteIcon: needMuteIcon,
136
+ onPlay: onPlay,
137
+ onPause: onPause,
138
+ onDownloading: onDownloading,
139
+ onAudioSeeking: onAudioSeeking,
140
+ onAudioLoading: onAudioLoading,
141
+ onError: onError,
142
+ onMuteUnmute: onMuteUnmute,
143
+ i18nKeys: i18nKeys,
144
+ dataId: dataId,
145
+ range: range
146
+ }));
147
+ }
148
+ }]);
149
+
150
+ return AudioPlayer;
151
+ }(_react["default"].Component);
152
+
153
+ exports["default"] = AudioPlayer;
154
+ AudioPlayer.defaultProps = _defaultProps.AudioPlayer_defaultProps;
155
+ AudioPlayer.propTypes = _propTypes.AudioPlayer_propTypes;
156
+
157
+ var AudioPlayerChild = /*#__PURE__*/function (_React$Component2) {
158
+ _inherits(AudioPlayerChild, _React$Component2);
159
+
160
+ var _super2 = _createSuper(AudioPlayerChild);
161
+
162
+ function AudioPlayerChild(props) {
163
+ var _this2;
164
+
165
+ _classCallCheck(this, AudioPlayerChild);
166
+
167
+ _this2 = _super2.call(this, props);
168
+ _this2.audio = null;
169
+ _this2.intervalId = props.intervalId || '';
170
+ _this2.state = {
171
+ isPlay: props.isPlay,
172
+ currentHour: '00',
173
+ currentMinute: '00',
174
+ currentSecond: '00',
175
+ sliderRangeValue: 0,
176
+ audioHours: '00',
177
+ audioMinutes: '00',
178
+ audioSeconds: '00',
179
+ overallSeconds: 0,
180
+ minValue: 0,
181
+ step: '1',
182
+ audioType: 'audio/mpeg',
183
+ isMuted: false,
184
+ disableControlIcons: true,
185
+ isShowDuration: false,
186
+ disableRangeSlider: false,
187
+ loadingRange: props.range || 0
188
+ }; // Bind all methods
189
+
190
+ _this2.getAudioDetails = _this2.getAudioDetails.bind(_assertThisInitialized(_this2));
191
+ _this2.onPlayAudio = _this2.onPlayAudio.bind(_assertThisInitialized(_this2));
192
+ _this2.onPauseAudio = _this2.onPauseAudio.bind(_assertThisInitialized(_this2));
193
+ _this2.togglePlayPause = _this2.togglePlayPause.bind(_assertThisInitialized(_this2));
194
+ _this2.updatePlayer = _this2.updatePlayer.bind(_assertThisInitialized(_this2));
195
+ _this2.updateRangeValue = _this2.updateRangeValue.bind(_assertThisInitialized(_this2));
196
+ _this2.updateTimerValues = _this2.updateTimerValues.bind(_assertThisInitialized(_this2));
197
+ _this2.togglePlayer = _this2.togglePlayer.bind(_assertThisInitialized(_this2));
198
+ _this2.getAudioDurationDetails = _this2.getAudioDurationDetails.bind(_assertThisInitialized(_this2));
199
+ _this2.browserCompatible = _this2.browserCompatible.bind(_assertThisInitialized(_this2));
200
+ _this2.onMuteUnmute = _this2.onMuteUnmute.bind(_assertThisInitialized(_this2));
201
+ _this2.handleAudioSeeking = _this2.handleAudioSeeking.bind(_assertThisInitialized(_this2));
202
+ _this2.handleError = _this2.handleError.bind(_assertThisInitialized(_this2));
203
+ _this2.handleAudioLoading = _this2.handleAudioLoading.bind(_assertThisInitialized(_this2));
204
+ _this2.removeEventListeners = _this2.removeEventListeners.bind(_assertThisInitialized(_this2));
205
+ _this2.downloadFile = _this2.downloadFile.bind(_assertThisInitialized(_this2));
206
+ _this2.handleKeyDown = _this2.handleKeyDown.bind(_assertThisInitialized(_this2));
207
+ _this2.handleClosePlayer = _this2.handleClosePlayer.bind(_assertThisInitialized(_this2));
208
+ _this2.updateRange = _this2.updateRange.bind(_assertThisInitialized(_this2));
209
+ _this2.setInputRangeRef = _this2.setInputRangeRef.bind(_assertThisInitialized(_this2));
210
+ _this2.removeEvent = _this2.removeEvent.bind(_assertThisInitialized(_this2));
211
+ return _this2;
212
+ }
213
+
214
+ _createClass(AudioPlayerChild, [{
215
+ key: "componentDidMount",
216
+ value: function componentDidMount() {
217
+ this.audio.addEventListener('loadedmetadata', this.getAudioDetails);
218
+ this.audio.addEventListener('canplay', this.browserCompatible);
219
+ this.audio.addEventListener('seeking', this.handleAudioSeeking);
220
+ this.audio.addEventListener('waiting', this.handleAudioLoading);
221
+ this.audio.addEventListener('error', this.handleError);
222
+ this.audio.addEventListener('ended', this.removeEvent);
223
+ }
224
+ }, {
225
+ key: "componentDidUpdate",
226
+ value: function componentDidUpdate(prevProps) {
227
+ if (prevProps.isPlay !== this.props.isPlay && this.props.isPlay === false) {
228
+ this.onPauseAudio();
229
+ }
230
+ }
231
+ }, {
232
+ key: "componentWillUnmount",
233
+ value: function componentWillUnmount() {
234
+ this.audio.pause();
235
+ clearInterval(this.intervalId);
236
+ this.removeEventListeners();
237
+ }
238
+ }, {
239
+ key: "removeEventListeners",
240
+ value: function removeEventListeners() {
241
+ this.audio.removeEventListener('loadedmetadata', this.getAudioDetails);
242
+ this.audio.removeEventListener('canplay', this.browserCompatible);
243
+ this.audio.removeEventListener('seeking', this.handleAudioSeeking);
244
+ this.audio.removeEventListener('waiting', this.handleAudioLoading);
245
+ this.audio.removeEventListener('error', this.handleError);
246
+ this.audio.removeEventListener('ended', this.removeEvent);
247
+ }
248
+ }, {
249
+ key: "removeEvent",
250
+ value: function removeEvent() {
251
+ setTimeout(this.onPauseAudio, 1000);
252
+ }
253
+ }, {
254
+ key: "getAudioDetails",
255
+ value: function getAudioDetails(event) {
256
+ var _this$props2 = this.props,
257
+ getAudioDuration = _this$props2.getAudioDuration,
258
+ src = _this$props2.src,
259
+ fallbackDuration = _this$props2.duration;
260
+ var audioType = (0, _Attachment.getExtensionFromFileName)(src);
261
+ var durationCalc = Math.ceil(event.target.duration);
262
+ var isDurationValid = Number.isFinite(durationCalc) && !Number.isNaN(durationCalc);
263
+ durationCalc = isDurationValid ? durationCalc : fallbackDuration ? fallbackDuration : 0;
264
+
265
+ var _this$getAudioDuratio = this.getAudioDurationDetails(durationCalc),
266
+ hours = _this$getAudioDuratio.hours,
267
+ minutes = _this$getAudioDuratio.minutes,
268
+ seconds = _this$getAudioDuratio.seconds;
269
+
270
+ var isShowDuration = isDurationValid || fallbackDuration !== undefined;
271
+ this.setState({
272
+ overallSeconds: durationCalc,
273
+ audioHours: hours,
274
+ audioMinutes: minutes,
275
+ audioSeconds: seconds,
276
+ audioType: audioType,
277
+ disableControlIcons: false,
278
+ isShowDuration: isShowDuration,
279
+ disableRangeSlider: !isDurationValid
280
+ });
281
+ getAudioDuration && getAudioDuration(hours, minutes, seconds);
282
+ }
283
+ }, {
284
+ key: "getAudioDurationDetails",
285
+ value: function getAudioDurationDetails(valueInSec) {
286
+ var hours = 0,
287
+ minutes = 0,
288
+ seconds = 0;
289
+
290
+ if (valueInSec > 0) {
291
+ hours = Math.floor(valueInSec / 3600);
292
+ valueInSec %= 3600;
293
+ minutes = Math.floor(valueInSec / 60);
294
+ seconds = Math.floor(valueInSec % 60);
295
+ }
296
+
297
+ return {
298
+ hours: hours <= 9 ? "0".concat(hours) : "".concat(hours),
299
+ minutes: minutes <= 9 ? "0".concat(minutes) : "".concat(minutes),
300
+ seconds: seconds <= 9 ? "0".concat(seconds) : "".concat(seconds)
301
+ };
302
+ }
303
+ }, {
304
+ key: "togglePlayPause",
305
+ value: function togglePlayPause() {
306
+ this.state.isPlay ? this.onPauseAudio() : this.onPlayAudio();
307
+ }
308
+ }, {
309
+ key: "onPlayAudio",
310
+ value: function onPlayAudio() {
311
+ var _this$props3 = this.props,
312
+ onPlay = _this$props3.onPlay,
313
+ id = _this$props3.id;
314
+ var _this$state = this.state,
315
+ sliderRangeValue = _this$state.sliderRangeValue,
316
+ overallSeconds = _this$state.overallSeconds;
317
+ var isRestart = sliderRangeValue === overallSeconds;
318
+ this.audio.play();
319
+ this.intervalId = setInterval(this.updatePlayer, 1000);
320
+ this.setState({
321
+ isPlay: true,
322
+ isRestart: isRestart
323
+ });
324
+ onPlay && onPlay(id, 'playing');
325
+ }
326
+ }, {
327
+ key: "onPauseAudio",
328
+ value: function onPauseAudio() {
329
+ var _this$props4 = this.props,
330
+ onPause = _this$props4.onPause,
331
+ id = _this$props4.id;
332
+ this.audio.pause();
333
+ clearInterval(this.intervalId);
334
+ this.setState({
335
+ isPlay: false
336
+ });
337
+ onPause && onPause(id, 'paused');
338
+ }
339
+ }, {
340
+ key: "handleClosePlayer",
341
+ value: function handleClosePlayer() {
342
+ var _this$props5 = this.props,
343
+ onClose = _this$props5.onClose,
344
+ id = _this$props5.id;
345
+ this.togglePlayer();
346
+ this.onPauseAudio();
347
+ onClose && onClose(id, 'closed');
348
+ }
349
+ }, {
350
+ key: "handleAudioSeeking",
351
+ value: function handleAudioSeeking() {
352
+ var onAudioSeeking = this.props.onAudioSeeking;
353
+ onAudioSeeking && onAudioSeeking(this.audio.seeking);
354
+ }
355
+ }, {
356
+ key: "handleAudioLoading",
357
+ value: function handleAudioLoading() {
358
+ var onAudioLoading = this.props.onAudioLoading;
359
+ onAudioLoading && onAudioLoading();
360
+ }
361
+ }, {
362
+ key: "handleError",
363
+ value: function handleError() {
364
+ var onError = this.props.onError;
365
+ onError && onError(this.audio.error.code);
366
+ }
367
+ }, {
368
+ key: "browserCompatible",
369
+ value: function browserCompatible(playable) {
370
+ if (playable === '') alert('Your browser is unable to play the audio');
371
+ }
372
+ }, {
373
+ key: "onMuteUnmute",
374
+ value: function onMuteUnmute(e) {
375
+ e && e.preventDefault();
376
+ var isMuted = this.state.isMuted;
377
+ this.audio.muted = !isMuted;
378
+ var onMuteUnmute = this.props.onMuteUnmute;
379
+ this.setState({
380
+ isMuted: !isMuted
381
+ });
382
+ onMuteUnmute && onMuteUnmute(!isMuted);
383
+ }
384
+ }, {
385
+ key: "setInputRangeRef",
386
+ value: function setInputRangeRef(ele) {
387
+ var getRef = this.props.getRef;
388
+ this.inputRange = ele;
389
+ getRef && getRef(ele);
390
+ }
391
+ }, {
392
+ key: "updateRange",
393
+ value: function updateRange(e) {
394
+ this.props.updateRange(e.target.value);
395
+ }
396
+ }, {
397
+ key: "updatePlayer",
398
+ value: function updatePlayer(e) {
399
+ var _e$target;
400
+
401
+ this.updateRangeValue(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value, this.updateTimerValues);
402
+ }
403
+ }, {
404
+ key: "updateRangeValue",
405
+ value: function updateRangeValue(value, afterUpdateCallback) {
406
+ var _this$state2 = this.state,
407
+ isPlay = _this$state2.isPlay,
408
+ sliderRangeValue = _this$state2.sliderRangeValue,
409
+ overallSeconds = _this$state2.overallSeconds,
410
+ isRestart = _this$state2.isRestart;
411
+ sliderRangeValue = Math.max(0, sliderRangeValue);
412
+ var rangeValue = value || ++sliderRangeValue;
413
+
414
+ if (rangeValue > overallSeconds && !isRestart) {
415
+ if (isPlay) {
416
+ this.audio.pause();
417
+ this.setState({
418
+ isPlay: false
419
+ });
420
+ }
421
+
422
+ this.audio.currentTime = overallSeconds;
423
+ clearInterval(this.intervalId);
424
+ rangeValue = overallSeconds;
425
+ }
426
+
427
+ if (isRestart) {
428
+ this.audio.currentTime = 0;
429
+ rangeValue = 0;
430
+ this.setState({
431
+ sliderRangeValue: rangeValue,
432
+ isRestart: false,
433
+ isPlay: true
434
+ });
435
+ }
436
+
437
+ if (rangeValue <= overallSeconds) {
438
+ value && (this.audio.currentTime = value);
439
+ this.setState({
440
+ sliderRangeValue: rangeValue
441
+ }, function () {
442
+ return afterUpdateCallback(rangeValue);
443
+ });
444
+ }
445
+ }
446
+ }, {
447
+ key: "updateTimerValues",
448
+ value: function updateTimerValues(sliderRangeValue) {
449
+ var _this$getAudioDuratio2 = this.getAudioDurationDetails(Number(sliderRangeValue)),
450
+ hours = _this$getAudioDuratio2.hours,
451
+ minutes = _this$getAudioDuratio2.minutes,
452
+ seconds = _this$getAudioDuratio2.seconds;
453
+
454
+ this.setState({
455
+ currentHour: hours,
456
+ currentMinute: minutes,
457
+ currentSecond: seconds
458
+ });
459
+ }
460
+ }, {
461
+ key: "togglePlayer",
462
+ value: function togglePlayer() {
463
+ this.audio.pause();
464
+ this.setState({
465
+ isPlay: false
466
+ });
467
+ }
468
+ }, {
469
+ key: "handleKeyDown",
470
+ value: function handleKeyDown(e) {
471
+ var keyCode = e.keyCode;
472
+ var sliderRangeValue = this.state.sliderRangeValue;
473
+ var _this$props6 = this.props,
474
+ forwardStepInSec = _this$props6.forwardStepInSec,
475
+ backwardStepInSec = _this$props6.backwardStepInSec;
476
+ if (keyCode === 32) this.togglePlayPause();else if (keyCode === 39) this.updatePlayer(sliderRangeValue + forwardStepInSec);else if (keyCode === 37) this.updatePlayer(sliderRangeValue - backwardStepInSec);else if (keyCode === 27) this.togglePlayer();
477
+ }
478
+ }, {
479
+ key: "downloadFile",
480
+ value: function downloadFile() {
481
+ var _this$props7 = this.props,
482
+ onDownloading = _this$props7.onDownloading,
483
+ src = _this$props7.src,
484
+ requestOptions = _this$props7.requestOptions;
485
+
486
+ var getFileName = function getFileName(url, ext) {
487
+ var parts = url.split('/');
488
+ var name = parts[parts.length - 1].split('?')[0];
489
+ return name.includes('.') ? name : "".concat(name, ".").concat(ext);
490
+ };
491
+
492
+ var reqOptions = requestOptions || {
493
+ credentials: 'include'
494
+ };
495
+ fetch(src, reqOptions).then(function (resp) {
496
+ return resp.blob();
497
+ }).then(function (blob) {
498
+ var url = window.URL.createObjectURL(blob);
499
+ var extnsn = blob.type.split('-')[1] || blob.type.split('/')[1];
500
+ var fileName = getFileName(src, extnsn);
501
+ var a = document.createElement('a');
502
+ a.style.display = 'none';
503
+ a.href = url;
504
+ a.download = fileName;
505
+ document.body.appendChild(a);
506
+ a.click();
507
+ window.URL.revokeObjectURL(url);
508
+ })["catch"](function () {
509
+ return (0, _utils.openInNewTabWithNoopener)(src);
510
+ });
511
+ onDownloading && onDownloading();
512
+ }
513
+ }, {
514
+ key: "render",
515
+ value: function render() {
516
+ var _this3 = this;
517
+
518
+ var _this$state3 = this.state,
519
+ isPlay = _this$state3.isPlay,
520
+ currentHour = _this$state3.currentHour,
521
+ currentMinute = _this$state3.currentMinute,
522
+ currentSecond = _this$state3.currentSecond,
523
+ audioHours = _this$state3.audioHours,
524
+ audioMinutes = _this$state3.audioMinutes,
525
+ audioSeconds = _this$state3.audioSeconds,
526
+ isMuted = _this$state3.isMuted,
527
+ disableControlIcons = _this$state3.disableControlIcons,
528
+ isShowDuration = _this$state3.isShowDuration,
529
+ disableRangeSlider = _this$state3.disableRangeSlider,
530
+ sliderRangeValue = _this$state3.sliderRangeValue,
531
+ overallSeconds = _this$state3.overallSeconds,
532
+ minValue = _this$state3.minValue,
533
+ step = _this$state3.step;
534
+ var _this$props8 = this.props,
535
+ src = _this$props8.src,
536
+ needDownload = _this$props8.needDownload,
537
+ needClose = _this$props8.needClose,
538
+ needMuteIcon = _this$props8.needMuteIcon,
539
+ id = _this$props8.id,
540
+ i18nKeys = _this$props8.i18nKeys,
541
+ dataId = _this$props8.dataId;
542
+ var timerFormat = audioHours ? 'hh:mm:ss' : 'mm:ss';
543
+ var loadingRange = (sliderRangeValue - minValue) * 100 / (overallSeconds - minValue);
544
+ var _i18nKeys$playTitle = i18nKeys.playTitle,
545
+ playTitle = _i18nKeys$playTitle === void 0 ? 'Play' : _i18nKeys$playTitle,
546
+ _i18nKeys$pauseTitle = i18nKeys.pauseTitle,
547
+ pauseTitle = _i18nKeys$pauseTitle === void 0 ? 'Pause' : _i18nKeys$pauseTitle,
548
+ _i18nKeys$downloadTit = i18nKeys.downloadTitle,
549
+ downloadTitle = _i18nKeys$downloadTit === void 0 ? 'Download' : _i18nKeys$downloadTit,
550
+ _i18nKeys$closeTitle = i18nKeys.closeTitle,
551
+ closeTitle = _i18nKeys$closeTitle === void 0 ? 'Close' : _i18nKeys$closeTitle,
552
+ _i18nKeys$muteTitle = i18nKeys.muteTitle,
553
+ muteTitle = _i18nKeys$muteTitle === void 0 ? 'Mute' : _i18nKeys$muteTitle,
554
+ _i18nKeys$unmuteTitle = i18nKeys.unmuteTitle,
555
+ unmuteTitle = _i18nKeys$unmuteTitle === void 0 ? 'Unmute' : _i18nKeys$unmuteTitle;
556
+ return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
557
+ align: "vertical",
558
+ alignBox: "row",
559
+ className: _AudioPlayerModule["default"].container,
560
+ isCover: false
561
+ }, /*#__PURE__*/_react["default"].createElement("audio", {
562
+ id: id,
563
+ controls: true,
564
+ preload: "auto",
565
+ className: _AudioPlayerModule["default"].audioHid,
566
+ ref: function ref(ele) {
567
+ return _this3.audio = ele;
568
+ }
569
+ }, /*#__PURE__*/_react["default"].createElement("source", {
570
+ src: src,
571
+ type: this.state.audioType
572
+ })), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
573
+ className: "".concat(_AudioPlayerModule["default"].rightBox, " ").concat(_AudioPlayerModule["default"].downloadBox, " ").concat(_AudioPlayerModule["default"].boxLeftRadius)
574
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
575
+ className: disableControlIcons ? _AudioPlayerModule["default"].disable : '',
576
+ align: "both",
577
+ onClick: this.togglePlayPause,
578
+ "data-title": isPlay ? pauseTitle : playTitle,
579
+ dataId: "".concat(dataId, "_playpause")
580
+ }, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
581
+ name: isPlay ? 'ZD-commentTimerPause' : 'ZD-bcarr',
582
+ iconClass: "".concat(_AudioPlayerModule["default"].downloadIcon, " ").concat(_AudioPlayerModule["default"].iconColor)
583
+ }))), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
584
+ className: _AudioPlayerModule["default"].timerBox
585
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
586
+ align: "vertical",
587
+ alignBox: "row"
588
+ }, /*#__PURE__*/_react["default"].createElement(_Timer["default"], {
589
+ timerFormat: timerFormat,
590
+ hour: currentHour,
591
+ minute: currentMinute,
592
+ second: currentSecond,
593
+ separator: "colon",
594
+ className: _AudioPlayerModule["default"].iconColor
595
+ }), isShowDuration && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
596
+ className: _AudioPlayerModule["default"].line
597
+ }, /*#__PURE__*/_react["default"].createElement("span", null, "\xA0"), "/", /*#__PURE__*/_react["default"].createElement("span", null, "\xA0")), /*#__PURE__*/_react["default"].createElement(_Timer["default"], {
598
+ timerFormat: timerFormat,
599
+ hour: audioHours,
600
+ minute: audioMinutes,
601
+ second: audioSeconds,
602
+ separator: "colon",
603
+ className: _AudioPlayerModule["default"].iconColor
604
+ })))), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
605
+ className: "".concat(_AudioPlayerModule["default"].dragtag, " ").concat(disableControlIcons || disableRangeSlider ? _AudioPlayerModule["default"].disable : _AudioPlayerModule["default"].cursor),
606
+ flexible: true
607
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
608
+ className: _AudioPlayerModule["default"].audioRangeContainer
609
+ }, /*#__PURE__*/_react["default"].createElement("span", {
610
+ className: _AudioPlayerModule["default"].loading,
611
+ style: {
612
+ width: "".concat(loadingRange, "%")
613
+ }
614
+ }), /*#__PURE__*/_react["default"].createElement("input", {
615
+ "data-id": dataId,
616
+ ref: this.setInputRangeRef,
617
+ className: _AudioPlayerModule["default"].input,
618
+ type: "range",
619
+ value: sliderRangeValue,
620
+ min: minValue,
621
+ max: overallSeconds,
622
+ step: step,
623
+ onChange: this.updatePlayer
624
+ }))), needDownload && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
625
+ className: "".concat(_AudioPlayerModule["default"].rightBox, " ").concat(_AudioPlayerModule["default"].downloadBox, " ").concat(!needClose && !needMuteIcon ? _AudioPlayerModule["default"].boxRightRadius : '')
626
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
627
+ className: disableControlIcons ? _AudioPlayerModule["default"].disable : '',
628
+ align: "both",
629
+ onClick: this.downloadFile,
630
+ "data-title": downloadTitle,
631
+ dataId: "".concat(dataId, "_download")
632
+ }, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
633
+ name: "ZD-downloadNew",
634
+ iconClass: "".concat(_AudioPlayerModule["default"].downloadIcon, " ").concat(_AudioPlayerModule["default"].iconColor)
635
+ }))), needMuteIcon && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
636
+ className: "".concat(_AudioPlayerModule["default"].rightBox, " ").concat(_AudioPlayerModule["default"].downloadBox, " ").concat(!needClose ? _AudioPlayerModule["default"].boxRightRadius : '')
637
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
638
+ className: disableControlIcons ? _AudioPlayerModule["default"].disable : '',
639
+ align: "both",
640
+ onClick: this.onMuteUnmute,
641
+ "data-title": isMuted ? unmuteTitle : muteTitle,
642
+ dataId: "".concat(dataId, "_muteUnmute")
643
+ }, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
644
+ name: isMuted ? 'ZD-mute1New' : 'ZD-kbcatlogovolume',
645
+ iconClass: "".concat(_AudioPlayerModule["default"].downloadIcon, " ").concat(_AudioPlayerModule["default"].iconColor)
646
+ }))), needClose && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
647
+ className: "".concat(_AudioPlayerModule["default"].closeBox, " ").concat(_AudioPlayerModule["default"].boxRightRadius)
648
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
649
+ className: disableControlIcons ? _AudioPlayerModule["default"].disable : '',
650
+ align: "both",
651
+ onClick: this.handleClosePlayer,
652
+ "data-title": closeTitle,
653
+ dataId: "".concat(dataId, "_close")
654
+ }, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
655
+ name: "ZD-cross",
656
+ iconClass: "".concat(_AudioPlayerModule["default"].pauseIcon, " ").concat(_AudioPlayerModule["default"].iconColor)
657
+ }))));
658
+ }
659
+ }]);
660
+
661
+ return AudioPlayerChild;
662
+ }(_react["default"].Component);