@uploadcare/file-uploader 1.23.0 → 1.24.0-alpha.0

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 (739) hide show
  1. package/dist/abstract/loadFileUploaderFrom.d.ts +14 -0
  2. package/dist/abstract/loadFileUploaderFrom.js +78 -0
  3. package/dist/env.d.ts +4 -0
  4. package/dist/env.js +36 -0
  5. package/dist/index.css +2714 -0
  6. package/dist/index.d.ts +2043 -0
  7. package/dist/index.js +11914 -0
  8. package/{index.ssr.js → dist/index.ssr.js} +1113 -1086
  9. package/{locales → dist/locales}/file-uploader/ar.d.ts +2 -2
  10. package/dist/locales/file-uploader/ar.js +168 -0
  11. package/{locales → dist/locales}/file-uploader/az.d.ts +2 -2
  12. package/dist/locales/file-uploader/az.js +160 -0
  13. package/{locales → dist/locales}/file-uploader/ca.d.ts +2 -2
  14. package/dist/locales/file-uploader/ca.js +162 -0
  15. package/{locales → dist/locales}/file-uploader/cs.d.ts +2 -2
  16. package/dist/locales/file-uploader/cs.js +164 -0
  17. package/{locales → dist/locales}/file-uploader/da.d.ts +2 -2
  18. package/dist/locales/file-uploader/da.js +160 -0
  19. package/{locales → dist/locales}/file-uploader/de.d.ts +2 -2
  20. package/dist/locales/file-uploader/de.js +160 -0
  21. package/{locales → dist/locales}/file-uploader/el.d.ts +2 -2
  22. package/dist/locales/file-uploader/el.js +160 -0
  23. package/{locales → dist/locales}/file-uploader/en.d.ts +2 -2
  24. package/dist/locales/file-uploader/en.js +160 -0
  25. package/{locales → dist/locales}/file-uploader/es.d.ts +2 -2
  26. package/dist/locales/file-uploader/es.js +162 -0
  27. package/{locales → dist/locales}/file-uploader/et.d.ts +2 -2
  28. package/dist/locales/file-uploader/et.js +160 -0
  29. package/{locales → dist/locales}/file-uploader/fi.d.ts +2 -2
  30. package/dist/locales/file-uploader/fi.js +160 -0
  31. package/{locales → dist/locales}/file-uploader/fr.d.ts +2 -2
  32. package/dist/locales/file-uploader/fr.js +162 -0
  33. package/{locales → dist/locales}/file-uploader/he.d.ts +2 -2
  34. package/dist/locales/file-uploader/he.js +162 -0
  35. package/{locales → dist/locales}/file-uploader/hy.d.ts +2 -2
  36. package/dist/locales/file-uploader/hy.js +160 -0
  37. package/{locales → dist/locales}/file-uploader/is.d.ts +2 -2
  38. package/dist/locales/file-uploader/is.js +160 -0
  39. package/{locales → dist/locales}/file-uploader/it.d.ts +2 -2
  40. package/dist/locales/file-uploader/it.js +162 -0
  41. package/{locales → dist/locales}/file-uploader/ja.d.ts +2 -2
  42. package/dist/locales/file-uploader/ja.js +160 -0
  43. package/{locales → dist/locales}/file-uploader/ka.d.ts +2 -2
  44. package/dist/locales/file-uploader/ka.js +160 -0
  45. package/{locales → dist/locales}/file-uploader/kk.d.ts +2 -2
  46. package/dist/locales/file-uploader/kk.js +160 -0
  47. package/{locales → dist/locales}/file-uploader/ko.d.ts +2 -2
  48. package/dist/locales/file-uploader/ko.js +160 -0
  49. package/{locales → dist/locales}/file-uploader/lv.d.ts +2 -2
  50. package/dist/locales/file-uploader/lv.js +162 -0
  51. package/{locales → dist/locales}/file-uploader/nb.d.ts +2 -2
  52. package/dist/locales/file-uploader/nb.js +160 -0
  53. package/{locales → dist/locales}/file-uploader/nl.d.ts +2 -2
  54. package/dist/locales/file-uploader/nl.js +160 -0
  55. package/{locales → dist/locales}/file-uploader/pl.d.ts +2 -2
  56. package/dist/locales/file-uploader/pl.js +164 -0
  57. package/{locales → dist/locales}/file-uploader/pt.d.ts +2 -2
  58. package/dist/locales/file-uploader/pt.js +162 -0
  59. package/{locales → dist/locales}/file-uploader/ro.d.ts +2 -2
  60. package/dist/locales/file-uploader/ro.js +162 -0
  61. package/{locales → dist/locales}/file-uploader/ru.d.ts +2 -2
  62. package/dist/locales/file-uploader/ru.js +164 -0
  63. package/{locales → dist/locales}/file-uploader/sk.d.ts +2 -2
  64. package/dist/locales/file-uploader/sk.js +164 -0
  65. package/{locales → dist/locales}/file-uploader/sr.d.ts +2 -2
  66. package/dist/locales/file-uploader/sr.js +162 -0
  67. package/{locales → dist/locales}/file-uploader/sv.d.ts +2 -2
  68. package/dist/locales/file-uploader/sv.js +160 -0
  69. package/{locales → dist/locales}/file-uploader/tr.d.ts +2 -2
  70. package/dist/locales/file-uploader/tr.js +160 -0
  71. package/{locales → dist/locales}/file-uploader/uk.d.ts +2 -2
  72. package/dist/locales/file-uploader/uk.js +164 -0
  73. package/{locales → dist/locales}/file-uploader/vi.d.ts +2 -2
  74. package/dist/locales/file-uploader/vi.js +160 -0
  75. package/dist/locales/file-uploader/zh-TW.d.ts +132 -0
  76. package/dist/locales/file-uploader/zh-TW.js +160 -0
  77. package/{locales → dist/locales}/file-uploader/zh.d.ts +2 -2
  78. package/dist/locales/file-uploader/zh.js +160 -0
  79. package/package.json +103 -56
  80. package/types/jsx.d.ts +10 -10
  81. package/web/file-uploader.iife.min.d.ts +2057 -0
  82. package/web/file-uploader.iife.min.js +4 -4
  83. package/web/file-uploader.min.d.ts +2057 -0
  84. package/web/file-uploader.min.js +4 -4
  85. package/web/uc-basic.min.css +26 -1
  86. package/web/uc-cloud-image-editor.min.css +26 -1
  87. package/web/uc-cloud-image-editor.min.d.ts +1544 -0
  88. package/web/uc-cloud-image-editor.min.js +4 -4
  89. package/web/uc-file-uploader-inline.min.css +26 -1
  90. package/web/uc-file-uploader-inline.min.d.ts +2057 -0
  91. package/web/uc-file-uploader-inline.min.js +4 -4
  92. package/web/uc-file-uploader-minimal.min.css +26 -1
  93. package/web/uc-file-uploader-minimal.min.d.ts +2057 -0
  94. package/web/uc-file-uploader-minimal.min.js +4 -4
  95. package/web/uc-file-uploader-regular.min.css +26 -1
  96. package/web/uc-file-uploader-regular.min.d.ts +2057 -0
  97. package/web/uc-file-uploader-regular.min.js +4 -4
  98. package/{blocks/Img/ImgBase.d.ts → web/uc-img.min.d.ts} +38 -3
  99. package/web/uc-img.min.js +3 -3
  100. package/abstract/ActivityBlock.d.ts +0 -79
  101. package/abstract/ActivityBlock.d.ts.map +0 -1
  102. package/abstract/ActivityBlock.js +0 -216
  103. package/abstract/Block.d.ts +0 -113
  104. package/abstract/Block.d.ts.map +0 -1
  105. package/abstract/Block.js +0 -410
  106. package/abstract/CTX.d.ts +0 -30
  107. package/abstract/CTX.d.ts.map +0 -1
  108. package/abstract/CTX.js +0 -39
  109. package/abstract/SolutionBlock.d.ts +0 -22
  110. package/abstract/SolutionBlock.d.ts.map +0 -1
  111. package/abstract/SolutionBlock.js +0 -23
  112. package/abstract/TypedCollection.d.ts +0 -127
  113. package/abstract/TypedCollection.d.ts.map +0 -1
  114. package/abstract/TypedCollection.js +0 -265
  115. package/abstract/TypedData.d.ts +0 -93
  116. package/abstract/TypedData.d.ts.map +0 -1
  117. package/abstract/TypedData.js +0 -134
  118. package/abstract/UploaderBlock.d.ts +0 -121
  119. package/abstract/UploaderBlock.d.ts.map +0 -1
  120. package/abstract/UploaderBlock.js +0 -533
  121. package/abstract/UploaderPublicApi.d.ts +0 -100
  122. package/abstract/UploaderPublicApi.d.ts.map +0 -1
  123. package/abstract/UploaderPublicApi.js +0 -407
  124. package/abstract/buildOutputCollectionState.d.ts +0 -8
  125. package/abstract/buildOutputCollectionState.d.ts.map +0 -1
  126. package/abstract/buildOutputCollectionState.js +0 -136
  127. package/abstract/defineComponents.d.ts +0 -5
  128. package/abstract/defineComponents.d.ts.map +0 -1
  129. package/abstract/defineComponents.js +0 -21
  130. package/abstract/l10nProcessor.d.ts +0 -7
  131. package/abstract/l10nProcessor.d.ts.map +0 -1
  132. package/abstract/l10nProcessor.js +0 -93
  133. package/abstract/loadFileUploaderFrom.d.ts +0 -8
  134. package/abstract/loadFileUploaderFrom.d.ts.map +0 -1
  135. package/abstract/loadFileUploaderFrom.js +0 -34
  136. package/abstract/localeRegistry.d.ts +0 -5
  137. package/abstract/localeRegistry.d.ts.map +0 -1
  138. package/abstract/localeRegistry.js +0 -63
  139. package/abstract/managers/LocaleManager.d.ts +0 -38
  140. package/abstract/managers/LocaleManager.d.ts.map +0 -1
  141. package/abstract/managers/LocaleManager.js +0 -130
  142. package/abstract/managers/ModalManager.d.ts +0 -122
  143. package/abstract/managers/ModalManager.d.ts.map +0 -1
  144. package/abstract/managers/ModalManager.js +0 -235
  145. package/abstract/managers/SecureUploadsManager.d.ts +0 -22
  146. package/abstract/managers/SecureUploadsManager.d.ts.map +0 -1
  147. package/abstract/managers/SecureUploadsManager.js +0 -91
  148. package/abstract/managers/TelemetryManager.d.ts +0 -71
  149. package/abstract/managers/TelemetryManager.d.ts.map +0 -1
  150. package/abstract/managers/TelemetryManager.js +0 -218
  151. package/abstract/managers/ValidationManager.d.ts +0 -209
  152. package/abstract/managers/ValidationManager.d.ts.map +0 -1
  153. package/abstract/managers/ValidationManager.js +0 -340
  154. package/abstract/managers/a11y.d.ts +0 -20
  155. package/abstract/managers/a11y.d.ts.map +0 -1
  156. package/abstract/managers/a11y.js +0 -118
  157. package/abstract/sharedConfigKey.d.ts +0 -2
  158. package/abstract/sharedConfigKey.d.ts.map +0 -1
  159. package/abstract/sharedConfigKey.js +0 -8
  160. package/abstract/testModeProcessor.d.ts +0 -7
  161. package/abstract/testModeProcessor.d.ts.map +0 -1
  162. package/abstract/testModeProcessor.js +0 -39
  163. package/abstract/uploadEntrySchema.d.ts +0 -134
  164. package/abstract/uploadEntrySchema.d.ts.map +0 -1
  165. package/abstract/uploadEntrySchema.js +0 -132
  166. package/blocks/ActivityHeader/ActivityHeader.d.ts +0 -4
  167. package/blocks/ActivityHeader/ActivityHeader.d.ts.map +0 -1
  168. package/blocks/ActivityHeader/ActivityHeader.js +0 -3
  169. package/blocks/ActivityHeader/activity-header.css +0 -14
  170. package/blocks/CameraSource/CameraSource.d.ts +0 -176
  171. package/blocks/CameraSource/CameraSource.d.ts.map +0 -1
  172. package/blocks/CameraSource/CameraSource.js +0 -929
  173. package/blocks/CameraSource/calcCameraModes.d.ts +0 -5
  174. package/blocks/CameraSource/calcCameraModes.d.ts.map +0 -1
  175. package/blocks/CameraSource/calcCameraModes.js +0 -11
  176. package/blocks/CameraSource/camera-source.css +0 -183
  177. package/blocks/CameraSource/constants.d.ts +0 -16
  178. package/blocks/CameraSource/constants.d.ts.map +0 -1
  179. package/blocks/CameraSource/constants.js +0 -19
  180. package/blocks/CloudImageEditor/index.css +0 -1
  181. package/blocks/CloudImageEditor/index.d.ts +0 -2
  182. package/blocks/CloudImageEditor/index.d.ts.map +0 -1
  183. package/blocks/CloudImageEditor/index.js +0 -1
  184. package/blocks/CloudImageEditor/src/CloudImageEditorBlock.d.ts +0 -59
  185. package/blocks/CloudImageEditor/src/CloudImageEditorBlock.d.ts.map +0 -1
  186. package/blocks/CloudImageEditor/src/CloudImageEditorBlock.js +0 -243
  187. package/blocks/CloudImageEditor/src/CropFrame.d.ts +0 -158
  188. package/blocks/CloudImageEditor/src/CropFrame.d.ts.map +0 -1
  189. package/blocks/CloudImageEditor/src/CropFrame.js +0 -569
  190. package/blocks/CloudImageEditor/src/EditorAspectRatioButtonControl.d.ts +0 -14
  191. package/blocks/CloudImageEditor/src/EditorAspectRatioButtonControl.d.ts.map +0 -1
  192. package/blocks/CloudImageEditor/src/EditorAspectRatioButtonControl.js +0 -140
  193. package/blocks/CloudImageEditor/src/EditorButtonControl.d.ts +0 -10
  194. package/blocks/CloudImageEditor/src/EditorButtonControl.d.ts.map +0 -1
  195. package/blocks/CloudImageEditor/src/EditorButtonControl.js +0 -45
  196. package/blocks/CloudImageEditor/src/EditorCropButtonControl.d.ts +0 -6
  197. package/blocks/CloudImageEditor/src/EditorCropButtonControl.d.ts.map +0 -1
  198. package/blocks/CloudImageEditor/src/EditorCropButtonControl.js +0 -52
  199. package/blocks/CloudImageEditor/src/EditorFilterControl.d.ts +0 -18
  200. package/blocks/CloudImageEditor/src/EditorFilterControl.d.ts.map +0 -1
  201. package/blocks/CloudImageEditor/src/EditorFilterControl.js +0 -177
  202. package/blocks/CloudImageEditor/src/EditorImageCropper.d.ts +0 -106
  203. package/blocks/CloudImageEditor/src/EditorImageCropper.d.ts.map +0 -1
  204. package/blocks/CloudImageEditor/src/EditorImageCropper.js +0 -551
  205. package/blocks/CloudImageEditor/src/EditorImageFader.d.ts +0 -132
  206. package/blocks/CloudImageEditor/src/EditorImageFader.d.ts.map +0 -1
  207. package/blocks/CloudImageEditor/src/EditorImageFader.js +0 -456
  208. package/blocks/CloudImageEditor/src/EditorOperationControl.d.ts +0 -9
  209. package/blocks/CloudImageEditor/src/EditorOperationControl.d.ts.map +0 -1
  210. package/blocks/CloudImageEditor/src/EditorOperationControl.js +0 -50
  211. package/blocks/CloudImageEditor/src/EditorScroller.d.ts +0 -7
  212. package/blocks/CloudImageEditor/src/EditorScroller.d.ts.map +0 -1
  213. package/blocks/CloudImageEditor/src/EditorScroller.js +0 -33
  214. package/blocks/CloudImageEditor/src/EditorSlider.d.ts +0 -24
  215. package/blocks/CloudImageEditor/src/EditorSlider.d.ts.map +0 -1
  216. package/blocks/CloudImageEditor/src/EditorSlider.js +0 -118
  217. package/blocks/CloudImageEditor/src/EditorToolbar.d.ts +0 -124
  218. package/blocks/CloudImageEditor/src/EditorToolbar.d.ts.map +0 -1
  219. package/blocks/CloudImageEditor/src/EditorToolbar.js +0 -534
  220. package/blocks/CloudImageEditor/src/crop-utils.d.ts +0 -123
  221. package/blocks/CloudImageEditor/src/crop-utils.d.ts.map +0 -1
  222. package/blocks/CloudImageEditor/src/crop-utils.js +0 -729
  223. package/blocks/CloudImageEditor/src/cropper-constants.d.ts +0 -11
  224. package/blocks/CloudImageEditor/src/cropper-constants.d.ts.map +0 -1
  225. package/blocks/CloudImageEditor/src/cropper-constants.js +0 -11
  226. package/blocks/CloudImageEditor/src/css/common.css +0 -1259
  227. package/blocks/CloudImageEditor/src/css/icons.css +0 -12
  228. package/blocks/CloudImageEditor/src/css/index.css +0 -2
  229. package/blocks/CloudImageEditor/src/elements/button/BtnUi.d.ts +0 -21
  230. package/blocks/CloudImageEditor/src/elements/button/BtnUi.d.ts.map +0 -1
  231. package/blocks/CloudImageEditor/src/elements/button/BtnUi.js +0 -99
  232. package/blocks/CloudImageEditor/src/elements/line-loader/LineLoaderUi.d.ts +0 -11
  233. package/blocks/CloudImageEditor/src/elements/line-loader/LineLoaderUi.d.ts.map +0 -1
  234. package/blocks/CloudImageEditor/src/elements/line-loader/LineLoaderUi.js +0 -52
  235. package/blocks/CloudImageEditor/src/elements/presence-toggle/PresenceToggle.d.ts +0 -17
  236. package/blocks/CloudImageEditor/src/elements/presence-toggle/PresenceToggle.d.ts.map +0 -1
  237. package/blocks/CloudImageEditor/src/elements/presence-toggle/PresenceToggle.js +0 -71
  238. package/blocks/CloudImageEditor/src/elements/slider/SliderUi.d.ts +0 -16
  239. package/blocks/CloudImageEditor/src/elements/slider/SliderUi.d.ts.map +0 -1
  240. package/blocks/CloudImageEditor/src/elements/slider/SliderUi.js +0 -179
  241. package/blocks/CloudImageEditor/src/index.d.ts +0 -16
  242. package/blocks/CloudImageEditor/src/index.d.ts.map +0 -1
  243. package/blocks/CloudImageEditor/src/index.js +0 -15
  244. package/blocks/CloudImageEditor/src/lib/FocusVisible.d.ts +0 -15
  245. package/blocks/CloudImageEditor/src/lib/FocusVisible.d.ts.map +0 -1
  246. package/blocks/CloudImageEditor/src/lib/FocusVisible.js +0 -33
  247. package/blocks/CloudImageEditor/src/lib/applyFocusVisiblePolyfill.d.ts +0 -10
  248. package/blocks/CloudImageEditor/src/lib/applyFocusVisiblePolyfill.d.ts.map +0 -1
  249. package/blocks/CloudImageEditor/src/lib/applyFocusVisiblePolyfill.js +0 -256
  250. package/blocks/CloudImageEditor/src/lib/classNames.d.ts +0 -3
  251. package/blocks/CloudImageEditor/src/lib/classNames.d.ts.map +0 -1
  252. package/blocks/CloudImageEditor/src/lib/classNames.js +0 -34
  253. package/blocks/CloudImageEditor/src/lib/linspace.d.ts +0 -8
  254. package/blocks/CloudImageEditor/src/lib/linspace.d.ts.map +0 -1
  255. package/blocks/CloudImageEditor/src/lib/linspace.js +0 -14
  256. package/blocks/CloudImageEditor/src/lib/parseCropPreset.d.ts +0 -3
  257. package/blocks/CloudImageEditor/src/lib/parseCropPreset.d.ts.map +0 -1
  258. package/blocks/CloudImageEditor/src/lib/parseCropPreset.js +0 -80
  259. package/blocks/CloudImageEditor/src/lib/parseCropPreset.test.d.ts +0 -2
  260. package/blocks/CloudImageEditor/src/lib/parseCropPreset.test.d.ts.map +0 -1
  261. package/blocks/CloudImageEditor/src/lib/parseCropPreset.test.js +0 -35
  262. package/blocks/CloudImageEditor/src/lib/parseTabs.d.ts +0 -2
  263. package/blocks/CloudImageEditor/src/lib/parseTabs.d.ts.map +0 -1
  264. package/blocks/CloudImageEditor/src/lib/parseTabs.js +0 -14
  265. package/blocks/CloudImageEditor/src/lib/pick.d.ts +0 -7
  266. package/blocks/CloudImageEditor/src/lib/pick.d.ts.map +0 -1
  267. package/blocks/CloudImageEditor/src/lib/pick.js +0 -15
  268. package/blocks/CloudImageEditor/src/lib/transformationUtils.d.ts +0 -14
  269. package/blocks/CloudImageEditor/src/lib/transformationUtils.d.ts.map +0 -1
  270. package/blocks/CloudImageEditor/src/lib/transformationUtils.js +0 -167
  271. package/blocks/CloudImageEditor/src/state.d.ts +0 -38
  272. package/blocks/CloudImageEditor/src/state.d.ts.map +0 -1
  273. package/blocks/CloudImageEditor/src/state.js +0 -92
  274. package/blocks/CloudImageEditor/src/svg-sprite.d.ts +0 -3
  275. package/blocks/CloudImageEditor/src/svg-sprite.d.ts.map +0 -1
  276. package/blocks/CloudImageEditor/src/svg-sprite.js +0 -1
  277. package/blocks/CloudImageEditor/src/template.d.ts +0 -2
  278. package/blocks/CloudImageEditor/src/template.d.ts.map +0 -1
  279. package/blocks/CloudImageEditor/src/template.js +0 -36
  280. package/blocks/CloudImageEditor/src/toolbar-constants.d.ts +0 -59
  281. package/blocks/CloudImageEditor/src/toolbar-constants.d.ts.map +0 -1
  282. package/blocks/CloudImageEditor/src/toolbar-constants.js +0 -116
  283. package/blocks/CloudImageEditor/src/types.d.ts +0 -66
  284. package/blocks/CloudImageEditor/src/types.d.ts.map +0 -1
  285. package/blocks/CloudImageEditor/src/types.js +0 -80
  286. package/blocks/CloudImageEditor/src/util.d.ts +0 -2
  287. package/blocks/CloudImageEditor/src/util.d.ts.map +0 -1
  288. package/blocks/CloudImageEditor/src/util.js +0 -21
  289. package/blocks/CloudImageEditor/src/utils/parseFilterValue.d.ts +0 -11
  290. package/blocks/CloudImageEditor/src/utils/parseFilterValue.d.ts.map +0 -1
  291. package/blocks/CloudImageEditor/src/utils/parseFilterValue.js +0 -11
  292. package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts +0 -29
  293. package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts.map +0 -1
  294. package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.js +0 -128
  295. package/blocks/CloudImageEditorActivity/index.css +0 -13
  296. package/blocks/CloudImageEditorActivity/test.d.ts +0 -2
  297. package/blocks/CloudImageEditorActivity/test.d.ts.map +0 -1
  298. package/blocks/CloudImageEditorActivity/test.js +0 -9
  299. package/blocks/Config/Config.d.ts +0 -60
  300. package/blocks/Config/Config.d.ts.map +0 -1
  301. package/blocks/Config/Config.js +0 -263
  302. package/blocks/Config/assertions.d.ts +0 -5
  303. package/blocks/Config/assertions.d.ts.map +0 -1
  304. package/blocks/Config/assertions.js +0 -37
  305. package/blocks/Config/config.css +0 -3
  306. package/blocks/Config/initialConfig.d.ts +0 -7
  307. package/blocks/Config/initialConfig.d.ts.map +0 -1
  308. package/blocks/Config/initialConfig.js +0 -93
  309. package/blocks/Config/normalizeConfigValue.d.ts +0 -2
  310. package/blocks/Config/normalizeConfigValue.d.ts.map +0 -1
  311. package/blocks/Config/normalizeConfigValue.js +0 -129
  312. package/blocks/Config/side-effects.d.ts +0 -11
  313. package/blocks/Config/side-effects.d.ts.map +0 -1
  314. package/blocks/Config/side-effects.js +0 -126
  315. package/blocks/Config/validatorsType.d.ts +0 -37
  316. package/blocks/Config/validatorsType.d.ts.map +0 -1
  317. package/blocks/Config/validatorsType.js +0 -134
  318. package/blocks/Copyright/Copyright.d.ts +0 -4
  319. package/blocks/Copyright/Copyright.d.ts.map +0 -1
  320. package/blocks/Copyright/Copyright.js +0 -24
  321. package/blocks/Copyright/copyright.css +0 -32
  322. package/blocks/DropArea/DropArea.d.ts +0 -49
  323. package/blocks/DropArea/DropArea.d.ts.map +0 -1
  324. package/blocks/DropArea/DropArea.js +0 -292
  325. package/blocks/DropArea/addDropzone.d.ts +0 -21
  326. package/blocks/DropArea/addDropzone.d.ts.map +0 -1
  327. package/blocks/DropArea/addDropzone.js +0 -137
  328. package/blocks/DropArea/drop-area.css +0 -201
  329. package/blocks/DropArea/getDropItems.d.ts +0 -16
  330. package/blocks/DropArea/getDropItems.d.ts.map +0 -1
  331. package/blocks/DropArea/getDropItems.js +0 -167
  332. package/blocks/ExternalSource/ExternalSource.d.ts +0 -82
  333. package/blocks/ExternalSource/ExternalSource.d.ts.map +0 -1
  334. package/blocks/ExternalSource/ExternalSource.js +0 -320
  335. package/blocks/ExternalSource/MessageBridge.d.ts +0 -20
  336. package/blocks/ExternalSource/MessageBridge.d.ts.map +0 -1
  337. package/blocks/ExternalSource/MessageBridge.js +0 -73
  338. package/blocks/ExternalSource/buildThemeDefinition.d.ts +0 -3
  339. package/blocks/ExternalSource/buildThemeDefinition.d.ts.map +0 -1
  340. package/blocks/ExternalSource/buildThemeDefinition.js +0 -47
  341. package/blocks/ExternalSource/external-source.css +0 -94
  342. package/blocks/ExternalSource/query-string.d.ts +0 -8
  343. package/blocks/ExternalSource/query-string.d.ts.map +0 -1
  344. package/blocks/ExternalSource/query-string.js +0 -14
  345. package/blocks/ExternalSource/types.d.ts +0 -106
  346. package/blocks/ExternalSource/types.d.ts.map +0 -1
  347. package/blocks/ExternalSource/types.js +0 -133
  348. package/blocks/FileItem/FileItem.d.ts +0 -76
  349. package/blocks/FileItem/FileItem.d.ts.map +0 -1
  350. package/blocks/FileItem/FileItem.js +0 -480
  351. package/blocks/FileItem/FileItemConfig.d.ts +0 -28
  352. package/blocks/FileItem/FileItemConfig.d.ts.map +0 -1
  353. package/blocks/FileItem/FileItemConfig.js +0 -74
  354. package/blocks/FileItem/file-item.css +0 -243
  355. package/blocks/FormInput/FormInput.d.ts +0 -7
  356. package/blocks/FormInput/FormInput.d.ts.map +0 -1
  357. package/blocks/FormInput/FormInput.js +0 -92
  358. package/blocks/Icon/Icon.d.ts +0 -11
  359. package/blocks/Icon/Icon.d.ts.map +0 -1
  360. package/blocks/Icon/Icon.js +0 -43
  361. package/blocks/Icon/icon.css +0 -12
  362. package/blocks/Img/Img.d.ts +0 -4
  363. package/blocks/Img/Img.d.ts.map +0 -1
  364. package/blocks/Img/Img.js +0 -21
  365. package/blocks/Img/ImgBase.d.ts.map +0 -1
  366. package/blocks/Img/ImgBase.js +0 -408
  367. package/blocks/Img/ImgConfig.d.ts +0 -31
  368. package/blocks/Img/ImgConfig.d.ts.map +0 -1
  369. package/blocks/Img/ImgConfig.js +0 -102
  370. package/blocks/Img/configurations.d.ts +0 -12
  371. package/blocks/Img/configurations.d.ts.map +0 -1
  372. package/blocks/Img/configurations.js +0 -14
  373. package/blocks/Img/props-map.d.ts +0 -29
  374. package/blocks/Img/props-map.d.ts.map +0 -1
  375. package/blocks/Img/props-map.js +0 -34
  376. package/blocks/Img/test.css +0 -16
  377. package/blocks/Img/utils/parseObjectToString.d.ts +0 -2
  378. package/blocks/Img/utils/parseObjectToString.d.ts.map +0 -1
  379. package/blocks/Img/utils/parseObjectToString.js +0 -13
  380. package/blocks/Modal/Modal.d.ts +0 -43
  381. package/blocks/Modal/Modal.d.ts.map +0 -1
  382. package/blocks/Modal/Modal.js +0 -158
  383. package/blocks/Modal/modal.css +0 -45
  384. package/blocks/ProgressBar/ProgressBar.d.ts +0 -17
  385. package/blocks/ProgressBar/ProgressBar.d.ts.map +0 -1
  386. package/blocks/ProgressBar/ProgressBar.js +0 -62
  387. package/blocks/ProgressBar/progress-bar.css +0 -62
  388. package/blocks/ProgressBarCommon/ProgressBarCommon.d.ts +0 -8
  389. package/blocks/ProgressBarCommon/ProgressBarCommon.d.ts.map +0 -1
  390. package/blocks/ProgressBarCommon/ProgressBarCommon.js +0 -44
  391. package/blocks/ProgressBarCommon/progress-bar-common.css +0 -16
  392. package/blocks/Range/Range.d.ts +0 -16
  393. package/blocks/Range/Range.d.ts.map +0 -1
  394. package/blocks/Range/Range.js +0 -44
  395. package/blocks/Range/range.css +0 -65
  396. package/blocks/Select/Select.d.ts +0 -9
  397. package/blocks/Select/Select.d.ts.map +0 -1
  398. package/blocks/Select/Select.js +0 -35
  399. package/blocks/Select/select.css +0 -22
  400. package/blocks/SimpleBtn/SimpleBtn.d.ts +0 -25
  401. package/blocks/SimpleBtn/SimpleBtn.d.ts.map +0 -1
  402. package/blocks/SimpleBtn/SimpleBtn.js +0 -54
  403. package/blocks/SimpleBtn/simple-btn.css +0 -64
  404. package/blocks/SourceBtn/SourceBtn.d.ts +0 -57
  405. package/blocks/SourceBtn/SourceBtn.d.ts.map +0 -1
  406. package/blocks/SourceBtn/SourceBtn.js +0 -172
  407. package/blocks/SourceBtn/source-btn.css +0 -53
  408. package/blocks/SourceList/SourceList.d.ts +0 -4
  409. package/blocks/SourceList/SourceList.d.ts.map +0 -1
  410. package/blocks/SourceList/SourceList.js +0 -51
  411. package/blocks/Spinner/Spinner.d.ts +0 -8
  412. package/blocks/Spinner/Spinner.d.ts.map +0 -1
  413. package/blocks/Spinner/Spinner.js +0 -5
  414. package/blocks/Spinner/spinner.css +0 -18
  415. package/blocks/StartFrom/StartFrom.d.ts +0 -7
  416. package/blocks/StartFrom/StartFrom.d.ts.map +0 -1
  417. package/blocks/StartFrom/StartFrom.js +0 -14
  418. package/blocks/StartFrom/start-from.css +0 -28
  419. package/blocks/Thumb/Thumb.d.ts +0 -51
  420. package/blocks/Thumb/Thumb.d.ts.map +0 -1
  421. package/blocks/Thumb/Thumb.js +0 -235
  422. package/blocks/Thumb/thumb.css +0 -4
  423. package/blocks/UploadCtxProvider/EventEmitter.d.ts +0 -125
  424. package/blocks/UploadCtxProvider/EventEmitter.d.ts.map +0 -1
  425. package/blocks/UploadCtxProvider/EventEmitter.js +0 -144
  426. package/blocks/UploadCtxProvider/UploadCtxProvider.d.ts +0 -35
  427. package/blocks/UploadCtxProvider/UploadCtxProvider.d.ts.map +0 -1
  428. package/blocks/UploadCtxProvider/UploadCtxProvider.js +0 -46
  429. package/blocks/UploadList/UploadList.d.ts +0 -62
  430. package/blocks/UploadList/UploadList.d.ts.map +0 -1
  431. package/blocks/UploadList/UploadList.js +0 -261
  432. package/blocks/UploadList/upload-list.css +0 -88
  433. package/blocks/UrlSource/UrlSource.d.ts +0 -9
  434. package/blocks/UrlSource/UrlSource.d.ts.map +0 -1
  435. package/blocks/UrlSource/UrlSource.js +0 -69
  436. package/blocks/UrlSource/url-source.css +0 -16
  437. package/blocks/svg-backgrounds/svg-backgrounds.d.ts +0 -17
  438. package/blocks/svg-backgrounds/svg-backgrounds.d.ts.map +0 -1
  439. package/blocks/svg-backgrounds/svg-backgrounds.js +0 -45
  440. package/blocks/themes/uc-basic/common.css +0 -129
  441. package/blocks/themes/uc-basic/config.css +0 -4
  442. package/blocks/themes/uc-basic/index.css +0 -37
  443. package/blocks/themes/uc-basic/post-reset.css +0 -3
  444. package/blocks/themes/uc-basic/svg-sprite.d.ts +0 -3
  445. package/blocks/themes/uc-basic/svg-sprite.d.ts.map +0 -1
  446. package/blocks/themes/uc-basic/svg-sprite.js +0 -1
  447. package/blocks/themes/uc-basic/theme.css +0 -291
  448. package/blocks/utils/UploadSource.d.ts +0 -39
  449. package/blocks/utils/UploadSource.d.ts.map +0 -1
  450. package/blocks/utils/UploadSource.js +0 -33
  451. package/blocks/utils/abilities.d.ts +0 -2
  452. package/blocks/utils/abilities.d.ts.map +0 -1
  453. package/blocks/utils/abilities.js +0 -3
  454. package/blocks/utils/comma-separated.d.ts +0 -3
  455. package/blocks/utils/comma-separated.d.ts.map +0 -1
  456. package/blocks/utils/comma-separated.js +0 -22
  457. package/blocks/utils/debounce.d.ts +0 -12
  458. package/blocks/utils/debounce.d.ts.map +0 -1
  459. package/blocks/utils/debounce.js +0 -22
  460. package/blocks/utils/preloadImage.d.ts +0 -11
  461. package/blocks/utils/preloadImage.d.ts.map +0 -1
  462. package/blocks/utils/preloadImage.js +0 -38
  463. package/blocks/utils/resizeImage.d.ts +0 -6
  464. package/blocks/utils/resizeImage.d.ts.map +0 -1
  465. package/blocks/utils/resizeImage.js +0 -40
  466. package/blocks/utils/throttle.d.ts +0 -6
  467. package/blocks/utils/throttle.d.ts.map +0 -1
  468. package/blocks/utils/throttle.js +0 -45
  469. package/blocks/utils/userAgent.d.ts +0 -6
  470. package/blocks/utils/userAgent.d.ts.map +0 -1
  471. package/blocks/utils/userAgent.js +0 -14
  472. package/env.d.ts +0 -4
  473. package/env.d.ts.map +0 -1
  474. package/env.js +0 -3
  475. package/index.d.ts +0 -43
  476. package/index.d.ts.map +0 -1
  477. package/index.js +0 -55
  478. package/index.ssr.d.ts +0 -1111
  479. package/index.ssr.d.ts.map +0 -1
  480. package/locales/file-uploader/ar.d.ts.map +0 -1
  481. package/locales/file-uploader/ar.js +0 -139
  482. package/locales/file-uploader/az.d.ts.map +0 -1
  483. package/locales/file-uploader/az.js +0 -133
  484. package/locales/file-uploader/ca.d.ts.map +0 -1
  485. package/locales/file-uploader/ca.js +0 -137
  486. package/locales/file-uploader/cs.d.ts.map +0 -1
  487. package/locales/file-uploader/cs.js +0 -139
  488. package/locales/file-uploader/da.d.ts.map +0 -1
  489. package/locales/file-uploader/da.js +0 -135
  490. package/locales/file-uploader/de.d.ts.map +0 -1
  491. package/locales/file-uploader/de.js +0 -136
  492. package/locales/file-uploader/el.d.ts.map +0 -1
  493. package/locales/file-uploader/el.js +0 -136
  494. package/locales/file-uploader/en.d.ts.map +0 -1
  495. package/locales/file-uploader/en.js +0 -131
  496. package/locales/file-uploader/es.d.ts.map +0 -1
  497. package/locales/file-uploader/es.js +0 -137
  498. package/locales/file-uploader/et.d.ts.map +0 -1
  499. package/locales/file-uploader/et.js +0 -134
  500. package/locales/file-uploader/fi.d.ts.map +0 -1
  501. package/locales/file-uploader/fi.js +0 -135
  502. package/locales/file-uploader/fr.d.ts.map +0 -1
  503. package/locales/file-uploader/fr.js +0 -137
  504. package/locales/file-uploader/he.d.ts.map +0 -1
  505. package/locales/file-uploader/he.js +0 -136
  506. package/locales/file-uploader/hy.d.ts.map +0 -1
  507. package/locales/file-uploader/hy.js +0 -132
  508. package/locales/file-uploader/is.d.ts.map +0 -1
  509. package/locales/file-uploader/is.js +0 -134
  510. package/locales/file-uploader/it.d.ts.map +0 -1
  511. package/locales/file-uploader/it.js +0 -137
  512. package/locales/file-uploader/ja.d.ts.map +0 -1
  513. package/locales/file-uploader/ja.js +0 -134
  514. package/locales/file-uploader/ka.d.ts.map +0 -1
  515. package/locales/file-uploader/ka.js +0 -134
  516. package/locales/file-uploader/kk.d.ts.map +0 -1
  517. package/locales/file-uploader/kk.js +0 -134
  518. package/locales/file-uploader/ko.d.ts.map +0 -1
  519. package/locales/file-uploader/ko.js +0 -133
  520. package/locales/file-uploader/lv.d.ts.map +0 -1
  521. package/locales/file-uploader/lv.js +0 -136
  522. package/locales/file-uploader/nb.d.ts.map +0 -1
  523. package/locales/file-uploader/nb.js +0 -134
  524. package/locales/file-uploader/nl.d.ts.map +0 -1
  525. package/locales/file-uploader/nl.js +0 -135
  526. package/locales/file-uploader/pl.d.ts.map +0 -1
  527. package/locales/file-uploader/pl.js +0 -138
  528. package/locales/file-uploader/pt.d.ts.map +0 -1
  529. package/locales/file-uploader/pt.js +0 -137
  530. package/locales/file-uploader/ro.d.ts.map +0 -1
  531. package/locales/file-uploader/ro.js +0 -137
  532. package/locales/file-uploader/ru.d.ts.map +0 -1
  533. package/locales/file-uploader/ru.js +0 -136
  534. package/locales/file-uploader/sk.d.ts.map +0 -1
  535. package/locales/file-uploader/sk.js +0 -138
  536. package/locales/file-uploader/sr.d.ts.map +0 -1
  537. package/locales/file-uploader/sr.js +0 -136
  538. package/locales/file-uploader/sv.d.ts.map +0 -1
  539. package/locales/file-uploader/sv.js +0 -134
  540. package/locales/file-uploader/tr.d.ts.map +0 -1
  541. package/locales/file-uploader/tr.js +0 -134
  542. package/locales/file-uploader/uk.d.ts.map +0 -1
  543. package/locales/file-uploader/uk.js +0 -138
  544. package/locales/file-uploader/vi.d.ts.map +0 -1
  545. package/locales/file-uploader/vi.js +0 -134
  546. package/locales/file-uploader/zh-TW.d.ts +0 -132
  547. package/locales/file-uploader/zh-TW.d.ts.map +0 -1
  548. package/locales/file-uploader/zh-TW.js +0 -134
  549. package/locales/file-uploader/zh.d.ts.map +0 -1
  550. package/locales/file-uploader/zh.js +0 -132
  551. package/solutions/adaptive-image/index.d.ts +0 -3
  552. package/solutions/adaptive-image/index.d.ts.map +0 -1
  553. package/solutions/adaptive-image/index.js +0 -5
  554. package/solutions/cloud-image-editor/CloudImageEditor.d.ts +0 -39
  555. package/solutions/cloud-image-editor/CloudImageEditor.d.ts.map +0 -1
  556. package/solutions/cloud-image-editor/CloudImageEditor.js +0 -24
  557. package/solutions/cloud-image-editor/index.css +0 -2
  558. package/solutions/cloud-image-editor/index.d.ts +0 -6
  559. package/solutions/cloud-image-editor/index.d.ts.map +0 -1
  560. package/solutions/cloud-image-editor/index.js +0 -11
  561. package/solutions/file-uploader/inline/FileUploaderInline.d.ts +0 -27
  562. package/solutions/file-uploader/inline/FileUploaderInline.d.ts.map +0 -1
  563. package/solutions/file-uploader/inline/FileUploaderInline.js +0 -80
  564. package/solutions/file-uploader/inline/index.css +0 -54
  565. package/solutions/file-uploader/inline/index.d.ts +0 -2
  566. package/solutions/file-uploader/inline/index.d.ts.map +0 -1
  567. package/solutions/file-uploader/inline/index.js +0 -1
  568. package/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts +0 -43
  569. package/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts.map +0 -1
  570. package/solutions/file-uploader/minimal/FileUploaderMinimal.js +0 -163
  571. package/solutions/file-uploader/minimal/index.css +0 -147
  572. package/solutions/file-uploader/minimal/index.d.ts +0 -2
  573. package/solutions/file-uploader/minimal/index.d.ts.map +0 -1
  574. package/solutions/file-uploader/minimal/index.js +0 -1
  575. package/solutions/file-uploader/regular/FileUploaderRegular.d.ts +0 -24
  576. package/solutions/file-uploader/regular/FileUploaderRegular.d.ts.map +0 -1
  577. package/solutions/file-uploader/regular/FileUploaderRegular.js +0 -69
  578. package/solutions/file-uploader/regular/index.css +0 -1
  579. package/solutions/file-uploader/regular/index.d.ts +0 -2
  580. package/solutions/file-uploader/regular/index.d.ts.map +0 -1
  581. package/solutions/file-uploader/regular/index.js +0 -1
  582. package/types/events.d.ts +0 -5
  583. package/types/events.js +0 -1
  584. package/types/exported.d.ts +0 -556
  585. package/types/exported.js +0 -1
  586. package/types/global.d.ts +0 -8
  587. package/types/https.d.ts +0 -1
  588. package/types/index.d.ts +0 -2
  589. package/types/index.js +0 -3
  590. package/utils/WindowHeightTracker.d.ts +0 -24
  591. package/utils/WindowHeightTracker.d.ts.map +0 -1
  592. package/utils/WindowHeightTracker.js +0 -51
  593. package/utils/browser-info.d.ts +0 -13
  594. package/utils/browser-info.d.ts.map +0 -1
  595. package/utils/browser-info.js +0 -22
  596. package/utils/browser-info.test.d.ts +0 -2
  597. package/utils/browser-info.test.d.ts.map +0 -1
  598. package/utils/browser-info.test.js +0 -109
  599. package/utils/cdn-utils.d.ts +0 -59
  600. package/utils/cdn-utils.d.ts.map +0 -1
  601. package/utils/cdn-utils.js +0 -199
  602. package/utils/cdn-utils.test.d.ts +0 -2
  603. package/utils/cdn-utils.test.d.ts.map +0 -1
  604. package/utils/cdn-utils.test.js +0 -227
  605. package/utils/delay.d.ts +0 -2
  606. package/utils/delay.d.ts.map +0 -1
  607. package/utils/delay.js +0 -4
  608. package/utils/fileTypes.d.ts +0 -12
  609. package/utils/fileTypes.d.ts.map +0 -1
  610. package/utils/fileTypes.js +0 -111
  611. package/utils/fileTypes.test.d.ts +0 -2
  612. package/utils/fileTypes.test.d.ts.map +0 -1
  613. package/utils/fileTypes.test.js +0 -89
  614. package/utils/get-top-level-origin.d.ts +0 -2
  615. package/utils/get-top-level-origin.d.ts.map +0 -1
  616. package/utils/get-top-level-origin.js +0 -11
  617. package/utils/getLocaleDirection.d.ts +0 -2
  618. package/utils/getLocaleDirection.d.ts.map +0 -1
  619. package/utils/getLocaleDirection.js +0 -18
  620. package/utils/getPluralForm.d.ts +0 -3
  621. package/utils/getPluralForm.d.ts.map +0 -1
  622. package/utils/getPluralForm.js +0 -13
  623. package/utils/getPluralForm.test.d.ts +0 -2
  624. package/utils/getPluralForm.test.d.ts.map +0 -1
  625. package/utils/getPluralForm.test.js +0 -16
  626. package/utils/ifRef.d.ts +0 -7
  627. package/utils/ifRef.d.ts.map +0 -1
  628. package/utils/ifRef.js +0 -9
  629. package/utils/isPromiseLike.d.ts +0 -2
  630. package/utils/isPromiseLike.d.ts.map +0 -1
  631. package/utils/isPromiseLike.js +0 -12
  632. package/utils/isPromiseLike.test.d.ts +0 -2
  633. package/utils/isPromiseLike.test.d.ts.map +0 -1
  634. package/utils/isPromiseLike.test.js +0 -20
  635. package/utils/isSecureTokenExpired.d.ts +0 -4
  636. package/utils/isSecureTokenExpired.d.ts.map +0 -1
  637. package/utils/isSecureTokenExpired.js +0 -17
  638. package/utils/isSecureTokenExpired.test.d.ts +0 -2
  639. package/utils/isSecureTokenExpired.test.d.ts.map +0 -1
  640. package/utils/isSecureTokenExpired.test.js +0 -33
  641. package/utils/memoize.d.ts +0 -2
  642. package/utils/memoize.d.ts.map +0 -1
  643. package/utils/memoize.js +0 -23
  644. package/utils/memoize.test.d.ts +0 -2
  645. package/utils/memoize.test.d.ts.map +0 -1
  646. package/utils/memoize.test.js +0 -38
  647. package/utils/mixinClass.d.ts +0 -10
  648. package/utils/mixinClass.d.ts.map +0 -1
  649. package/utils/mixinClass.js +0 -18
  650. package/utils/parseCdnUrl.d.ts +0 -9
  651. package/utils/parseCdnUrl.d.ts.map +0 -1
  652. package/utils/parseCdnUrl.js +0 -23
  653. package/utils/parseCdnUrl.test.d.ts +0 -2
  654. package/utils/parseCdnUrl.test.d.ts.map +0 -1
  655. package/utils/parseCdnUrl.test.js +0 -91
  656. package/utils/parseShrink.d.ts +0 -5
  657. package/utils/parseShrink.d.ts.map +0 -1
  658. package/utils/parseShrink.js +0 -34
  659. package/utils/parseShrink.test.d.ts +0 -2
  660. package/utils/parseShrink.test.d.ts.map +0 -1
  661. package/utils/parseShrink.test.js +0 -26
  662. package/utils/prettyBytes.d.ts +0 -11
  663. package/utils/prettyBytes.d.ts.map +0 -1
  664. package/utils/prettyBytes.js +0 -64
  665. package/utils/prettyBytes.test.d.ts +0 -2
  666. package/utils/prettyBytes.test.d.ts.map +0 -1
  667. package/utils/prettyBytes.test.js +0 -99
  668. package/utils/stringToArray.d.ts +0 -2
  669. package/utils/stringToArray.d.ts.map +0 -1
  670. package/utils/stringToArray.js +0 -11
  671. package/utils/stringToArray.test.d.ts +0 -2
  672. package/utils/stringToArray.test.d.ts.map +0 -1
  673. package/utils/stringToArray.test.js +0 -20
  674. package/utils/template-utils.d.ts +0 -40
  675. package/utils/template-utils.d.ts.map +0 -1
  676. package/utils/template-utils.js +0 -50
  677. package/utils/template-utils.test.d.ts +0 -2
  678. package/utils/template-utils.test.d.ts.map +0 -1
  679. package/utils/template-utils.test.js +0 -56
  680. package/utils/toKebabCase.d.ts +0 -3
  681. package/utils/toKebabCase.d.ts.map +0 -1
  682. package/utils/toKebabCase.js +0 -15
  683. package/utils/toKebabCase.test.d.ts +0 -2
  684. package/utils/toKebabCase.test.d.ts.map +0 -1
  685. package/utils/toKebabCase.test.js +0 -11
  686. package/utils/transparentPixelSrc.d.ts +0 -2
  687. package/utils/transparentPixelSrc.d.ts.map +0 -1
  688. package/utils/transparentPixelSrc.js +0 -2
  689. package/utils/uniqueArray.d.ts +0 -2
  690. package/utils/uniqueArray.d.ts.map +0 -1
  691. package/utils/uniqueArray.js +0 -8
  692. package/utils/uniqueArray.test.d.ts +0 -2
  693. package/utils/uniqueArray.test.d.ts.map +0 -1
  694. package/utils/uniqueArray.test.js +0 -8
  695. package/utils/validators/collection/index.d.ts +0 -3
  696. package/utils/validators/collection/index.d.ts.map +0 -1
  697. package/utils/validators/collection/index.js +0 -2
  698. package/utils/validators/collection/validateCollectionUploadError.d.ts +0 -3
  699. package/utils/validators/collection/validateCollectionUploadError.d.ts.map +0 -1
  700. package/utils/validators/collection/validateCollectionUploadError.js +0 -11
  701. package/utils/validators/collection/validateMultiple.d.ts +0 -3
  702. package/utils/validators/collection/validateMultiple.d.ts.map +0 -1
  703. package/utils/validators/collection/validateMultiple.js +0 -43
  704. package/utils/validators/file/index.d.ts +0 -5
  705. package/utils/validators/file/index.d.ts.map +0 -1
  706. package/utils/validators/file/index.js +0 -4
  707. package/utils/validators/file/validateFileType.d.ts +0 -3
  708. package/utils/validators/file/validateFileType.d.ts.map +0 -1
  709. package/utils/validators/file/validateFileType.js +0 -30
  710. package/utils/validators/file/validateIsImage.d.ts +0 -3
  711. package/utils/validators/file/validateIsImage.d.ts.map +0 -1
  712. package/utils/validators/file/validateIsImage.js +0 -25
  713. package/utils/validators/file/validateMaxSizeLimit.d.ts +0 -3
  714. package/utils/validators/file/validateMaxSizeLimit.d.ts.map +0 -1
  715. package/utils/validators/file/validateMaxSizeLimit.js +0 -15
  716. package/utils/validators/file/validateUploadError.d.ts +0 -3
  717. package/utils/validators/file/validateUploadError.d.ts.map +0 -1
  718. package/utils/validators/file/validateUploadError.js +0 -48
  719. package/utils/waitForAttribute.d.ts +0 -8
  720. package/utils/waitForAttribute.d.ts.map +0 -1
  721. package/utils/waitForAttribute.js +0 -43
  722. package/utils/waitForAttribute.test.d.ts +0 -2
  723. package/utils/waitForAttribute.test.d.ts.map +0 -1
  724. package/utils/waitForAttribute.test.js +0 -78
  725. package/utils/warnOnce.d.ts +0 -3
  726. package/utils/warnOnce.d.ts.map +0 -1
  727. package/utils/warnOnce.js +0 -11
  728. package/utils/wildcardRegexp.d.ts +0 -2
  729. package/utils/wildcardRegexp.d.ts.map +0 -1
  730. package/utils/wildcardRegexp.js +0 -17
  731. package/utils/wildcardRegexp.test.d.ts +0 -2
  732. package/utils/wildcardRegexp.test.d.ts.map +0 -1
  733. package/utils/wildcardRegexp.test.js +0 -19
  734. package/utils/withResolvers.d.ts +0 -6
  735. package/utils/withResolvers.d.ts.map +0 -1
  736. package/utils/withResolvers.js +0 -18
  737. package/utils/withResolvers.test.d.ts +0 -2
  738. package/utils/withResolvers.test.d.ts.map +0 -1
  739. package/utils/withResolvers.test.js +0 -36
@@ -1,929 +0,0 @@
1
- //@ts-nocheck
2
- import { ActivityBlock } from '../../abstract/ActivityBlock.js';
3
- import { UploaderBlock } from '../../abstract/UploaderBlock.js';
4
- import { stringToArray } from '../../utils/stringToArray.js';
5
- import { canUsePermissionsApi } from '../utils/abilities.js';
6
- import { deserializeCsv } from '../utils/comma-separated.js';
7
- import { debounce } from '../utils/debounce.js';
8
- import { UploadSource } from '../utils/UploadSource.js';
9
- import { CameraSourceEvents, CameraSourceTypes } from './constants.js';
10
-
11
- const DEFAULT_VIDEO_CONFIG = {
12
- width: {
13
- ideal: 1920,
14
- },
15
- height: {
16
- ideal: 1080,
17
- },
18
- frameRate: {
19
- ideal: 30,
20
- },
21
- };
22
-
23
- const DEFAULT_PERMISSIONS = ['camera', 'microphone'];
24
-
25
- /**
26
- * @param {Number} time
27
- * @returns
28
- */
29
- function formatTime(time) {
30
- const minutes = Math.floor(time / 60)
31
- .toString()
32
- .padStart(2, '0');
33
- const seconds = Math.floor(time % 60)
34
- .toString()
35
- .padStart(2, '0');
36
- return `${minutes}:${seconds}`;
37
- }
38
-
39
- const DEFAULT_PICTURE_FORMAT = 'image/jpeg';
40
- const DEFAULT_VIDEO_FORMAT = 'video/webm';
41
-
42
- /** @typedef {'photo' | 'video'} CameraMode */
43
-
44
- /** @typedef {'shot' | 'retake' | 'accept' | 'play' | 'stop' | 'pause' | 'resume'} CameraStatus */
45
-
46
- export class CameraSource extends UploaderBlock {
47
- couldBeCtxOwner = true;
48
- activityType = ActivityBlock.activities.CAMERA;
49
-
50
- /** @private */
51
- _unsubPermissions = null;
52
-
53
- /** @type {BlobPart[]} */
54
- _chunks = [];
55
-
56
- /** @type {MediaRecorder | null} */
57
- _mediaRecorder = null;
58
-
59
- /** @type {MediaStream | null} */
60
- _stream = null;
61
-
62
- /** @type {string | null} */
63
- _selectedAudioId = null;
64
-
65
- /** @type {string | null} */
66
- _selectedCameraId = null;
67
-
68
- constructor() {
69
- super();
70
-
71
- this.init$ = {
72
- ...this.init$,
73
- video: null,
74
- videoTransformCss: null,
75
-
76
- videoHidden: true,
77
- messageHidden: true,
78
- requestBtnHidden: canUsePermissionsApi(),
79
- cameraSelectOptions: null,
80
- cameraSelectHidden: true,
81
- l10nMessage: '',
82
-
83
- // This is refs
84
- switcher: null,
85
- panels: null,
86
- timer: null,
87
-
88
- timerHidden: true,
89
- cameraHidden: true,
90
- cameraActionsHidden: true,
91
-
92
- audioSelectOptions: null,
93
- audioSelectHidden: true,
94
- audioSelectDisabled: true,
95
- audioToggleMicrophoneHidden: true,
96
-
97
- tabCameraHidden: true,
98
- tabVideoHidden: true,
99
-
100
- currentIcon: 'camera-full',
101
- currentTimelineIcon: 'play',
102
- toggleMicrophoneIcon: 'microphone',
103
-
104
- /** @type {Number} */
105
- _startTime: 0,
106
- /** @type {Number} */
107
- _elapsedTime: 0,
108
- _animationFrameId: null,
109
-
110
- mutableClassButton: 'uc-shot-btn uc-camera-action',
111
-
112
- /** @param {Event} e */
113
- onCameraSelectChange: (e) => {
114
- this._selectedCameraId = e.target.value;
115
- this._capture();
116
- },
117
-
118
- /** @param {Event} e */
119
- onAudioSelectChange: (e) => {
120
- this._selectedAudioId = e.target.value;
121
- this._capture();
122
- },
123
-
124
- onCancel: () => {
125
- this.historyBack();
126
- },
127
-
128
- onShot: () => this._shot(),
129
-
130
- onRequestPermissions: () => this._capture(),
131
-
132
- /** General method for photo and video capture */
133
- onStartCamera: () => this._chooseActionWithCamera(),
134
-
135
- onStartRecording: () => this._startRecording(),
136
-
137
- onStopRecording: () => this._stopRecording(),
138
-
139
- onToggleRecording: () => this._toggleRecording(),
140
-
141
- onToggleAudio: () => this._toggleEnableAudio(),
142
-
143
- onRetake: () => this._retake(),
144
-
145
- onAccept: () => this._accept(),
146
-
147
- /** @param {MouseEvent} e */
148
- onClickTab: (e) => {
149
- const id = /** @type {HTMLElement} */ (e.currentTarget).getAttribute('data-id');
150
- if (id) this._handleActiveTab(/** @type {CameraMode} */ (id));
151
- },
152
- };
153
- }
154
-
155
- _chooseActionWithCamera = () => {
156
- if (this._activeTab === CameraSourceTypes.PHOTO) {
157
- this._shot();
158
- }
159
-
160
- if (this._activeTab === CameraSourceTypes.VIDEO) {
161
- if (this._mediaRecorder?.state === 'recording') {
162
- this._stopRecording();
163
- return;
164
- }
165
-
166
- this._startRecording();
167
- }
168
- };
169
-
170
- _updateTimer = () => {
171
- const currentTime = Math.floor((performance.now() - this.$._startTime + this.$._elapsedTime) / 1000);
172
-
173
- if (typeof this.cfg.maxVideoRecordingDuration === 'number' && this.cfg.maxVideoRecordingDuration > 0) {
174
- const remainingTime = this.cfg.maxVideoRecordingDuration - currentTime;
175
-
176
- if (remainingTime <= 0) {
177
- this.ref.timer.textContent = formatTime(remainingTime);
178
- this._stopRecording();
179
- return;
180
- }
181
-
182
- this.ref.timer.textContent = formatTime(remainingTime);
183
- } else {
184
- this.ref.timer.textContent = formatTime(currentTime);
185
- }
186
-
187
- this._animationFrameId = requestAnimationFrame(this._updateTimer);
188
- };
189
-
190
- _startTimer = () => {
191
- this.$._startTime = performance.now();
192
- this.$._elapsedTime = 0;
193
-
194
- this._updateTimer();
195
- };
196
-
197
- _stopTimer = () => {
198
- if (this._animationFrameId) cancelAnimationFrame(this._animationFrameId);
199
- };
200
-
201
- _startTimeline = () => {
202
- const currentTime = this.ref.video.currentTime;
203
- const duration = this.ref.video.duration;
204
-
205
- this.ref.line.style.transform = `scaleX(${currentTime / duration})`;
206
- this.ref.timer.textContent = formatTime(currentTime);
207
- this._animationFrameId = requestAnimationFrame(this._startTimeline);
208
- };
209
-
210
- _stopTimeline = () => {
211
- if (this._animationFrameId) cancelAnimationFrame(this._animationFrameId);
212
- };
213
-
214
- _startRecording = () => {
215
- try {
216
- this._chunks = [];
217
- this._options = {
218
- ...this.cfg.mediaRecorderOptions,
219
- };
220
-
221
- const { mimeType } = this.cfg.mediaRecorderOptions || {};
222
-
223
- if (mimeType && MediaRecorder.isTypeSupported(mimeType)) {
224
- this._options.mimeType = mimeType;
225
- } else if (MediaRecorder.isTypeSupported(DEFAULT_VIDEO_FORMAT)) {
226
- this._options.mimeType = DEFAULT_VIDEO_FORMAT;
227
- } else {
228
- this._options.mimeType = 'video/mp4';
229
- }
230
-
231
- if (this._stream) {
232
- this._mediaRecorder = new MediaRecorder(this._stream, this._options);
233
- this._mediaRecorder.start();
234
-
235
- this._mediaRecorder.addEventListener('dataavailable', (e) => {
236
- this._chunks.push(e.data);
237
- });
238
-
239
- this._startTimer();
240
-
241
- this.classList.add('uc-recording');
242
- this._setCameraState(CameraSourceEvents.PLAY);
243
- }
244
- } catch (error) {
245
- console.error('Failed to start recording', error);
246
- this.telemetryManager.sendEventError(error, 'camera recording. Failed to start recording');
247
- }
248
- };
249
-
250
- /** @private */
251
- _stopRecording = () => {
252
- this._mediaRecorder?.addEventListener('stop', () => {
253
- this._previewVideo();
254
-
255
- this._stopTimer();
256
-
257
- this._setCameraState(CameraSourceEvents.STOP);
258
- });
259
-
260
- this._mediaRecorder?.stop();
261
- this.classList.remove('uc-recording');
262
- };
263
-
264
- /** This method is used to toggle recording pause/resume */
265
- _toggleRecording = () => {
266
- if (this._mediaRecorder?.state === 'recording') return;
267
-
268
- if (!this.ref.video.paused && !this.ref.video.ended && this.ref.video.readyState > 2) {
269
- this.ref.video.pause();
270
- } else if (this.ref.video.paused) {
271
- this.ref.video.play();
272
- }
273
- };
274
-
275
- _toggleEnableAudio = () => {
276
- this._stream?.getAudioTracks().forEach((track) => {
277
- track.enabled = !track.enabled;
278
-
279
- this.$.toggleMicrophoneIcon = !track.enabled ? 'microphone-mute' : 'microphone';
280
- this.$.audioSelectDisabled = !track.enabled;
281
- });
282
- };
283
-
284
- /**
285
- * Previewing the video that was recorded on the camera
286
- *
287
- * @private
288
- */
289
- _previewVideo = () => {
290
- try {
291
- const blob = new Blob(this._chunks, {
292
- type: this._mediaRecorder?.mimeType,
293
- });
294
-
295
- const videoURL = URL.createObjectURL(blob);
296
-
297
- this.ref.video.muted = false;
298
- this.ref.video.volume = 1;
299
- this.$.video = null;
300
- this.ref.video.src = videoURL;
301
-
302
- this.ref.video.addEventListener('play', () => {
303
- this._startTimeline();
304
- this.set$({
305
- currentTimelineIcon: 'pause',
306
- });
307
- });
308
-
309
- this.ref.video.addEventListener('pause', () => {
310
- this.set$({
311
- currentTimelineIcon: 'play',
312
- });
313
- this._stopTimeline();
314
- });
315
- } catch (error) {
316
- console.error('Failed to preview video', error);
317
- this.telemetryManager.sendEventError(error, 'camera previewing. Failed to preview video');
318
- }
319
- };
320
-
321
- _retake = () => {
322
- this._setCameraState(CameraSourceEvents.RETAKE);
323
-
324
- /** Reset video */
325
- if (this._activeTab === CameraSourceTypes.VIDEO) {
326
- this.$.video = this._stream;
327
- this.ref.video.muted = true;
328
- }
329
-
330
- this.ref.video.play();
331
- };
332
-
333
- _accept = () => {
334
- this._setCameraState(CameraSourceEvents.ACCEPT);
335
-
336
- if (this._activeTab === CameraSourceTypes.PHOTO) {
337
- this._canvas?.toBlob((blob) => {
338
- const file = this._createFile('camera', 'jpeg', DEFAULT_PICTURE_FORMAT, blob);
339
- this._toSend(file);
340
- }, DEFAULT_PICTURE_FORMAT);
341
- return;
342
- }
343
-
344
- const blob = new Blob(this._chunks, {
345
- type: this._mediaRecorder?.mimeType,
346
- });
347
-
348
- const ext = this._guessExtensionByMime(this._mediaRecorder?.mimeType);
349
- const file = this._createFile('video', ext, `video/${ext}`, blob);
350
-
351
- this._toSend(file);
352
- this._chunks = [];
353
- };
354
-
355
- /** @param {CameraStatus} status */
356
- _handlePhoto = (status) => {
357
- if (status === CameraSourceEvents.SHOT) {
358
- this.set$({
359
- tabVideoHidden: true,
360
- cameraHidden: true,
361
- tabCameraHidden: true,
362
- cameraActionsHidden: false,
363
- cameraSelectHidden: true,
364
- });
365
- }
366
-
367
- if (status === CameraSourceEvents.RETAKE || status === CameraSourceEvents.ACCEPT) {
368
- this.set$({
369
- tabVideoHidden: !this._cameraModes.includes(CameraSourceTypes.VIDEO),
370
- tabCameraHidden: !this._cameraModes.includes(CameraSourceTypes.PHOTO),
371
- cameraHidden: false,
372
- cameraActionsHidden: true,
373
- cameraSelectHidden: this._cameraDevices.length <= 1,
374
- });
375
- }
376
- };
377
-
378
- /** @param {CameraStatus} status */
379
- _handleVideo = (status) => {
380
- if (status === CameraSourceEvents.PLAY) {
381
- this.set$({
382
- timerHidden: false,
383
- tabCameraHidden: true,
384
-
385
- cameraSelectHidden: true,
386
- audioSelectHidden: true,
387
-
388
- currentTimelineIcon: 'pause',
389
- currentIcon: 'square',
390
- mutableClassButton: 'uc-shot-btn uc-camera-action uc-stop-record',
391
- });
392
- }
393
-
394
- if (status === CameraSourceEvents.STOP) {
395
- this.set$({
396
- timerHidden: false,
397
- cameraHidden: true,
398
- audioToggleMicrophoneHidden: true,
399
- cameraActionsHidden: false,
400
- });
401
- }
402
-
403
- if (status === CameraSourceEvents.RETAKE || status === CameraSourceEvents.ACCEPT) {
404
- this.set$({
405
- timerHidden: true,
406
- tabVideoHidden: !this._cameraModes.includes(CameraSourceTypes.VIDEO),
407
- tabCameraHidden: !this._cameraModes.includes(CameraSourceTypes.PHOTO),
408
- cameraHidden: false,
409
- cameraActionsHidden: true,
410
- audioToggleMicrophoneHidden: !this.cfg.enableAudioRecording,
411
- currentIcon: 'video-camera-full',
412
- mutableClassButton: 'uc-shot-btn uc-camera-action',
413
-
414
- audioSelectHidden: !this.cfg.enableAudioRecording || this._audioDevices.length <= 1,
415
- cameraSelectHidden: this._cameraDevices.length <= 1,
416
- });
417
- }
418
- };
419
-
420
- /**
421
- * @private
422
- * @param {CameraStatus} status
423
- */
424
- _setCameraState = (status) => {
425
- if (
426
- this._activeTab === CameraSourceTypes.PHOTO &&
427
- (status === 'shot' || status === 'retake' || status === 'accept')
428
- ) {
429
- this._handlePhoto(status);
430
- }
431
-
432
- if (
433
- this._activeTab === CameraSourceTypes.VIDEO &&
434
- (status === 'play' ||
435
- status === 'stop' ||
436
- status === 'retake' ||
437
- status === 'accept' ||
438
- status === 'pause' ||
439
- status === 'resume')
440
- ) {
441
- this._handleVideo(status);
442
- }
443
- };
444
-
445
- /** @private */
446
- _shot() {
447
- this._setCameraState('shot');
448
-
449
- this._canvas = document.createElement('canvas');
450
- this._ctx = this._canvas.getContext('2d');
451
-
452
- if (!this._ctx) {
453
- throw new Error('Failed to get canvas context');
454
- }
455
-
456
- this._canvas.height = this.ref.video['videoHeight'];
457
- this._canvas.width = this.ref.video['videoWidth'];
458
-
459
- if (this.cfg.cameraMirror) {
460
- this._ctx.translate(this._canvas.width, 0);
461
- this._ctx.scale(-1, 1);
462
- }
463
-
464
- this._ctx.drawImage(this.ref.video, 0, 0);
465
- this.ref.video.pause();
466
- }
467
-
468
- /**
469
- * @private
470
- * @param {CameraMode} tabId
471
- */
472
- _handleActiveTab = (tabId) => {
473
- this.ref.switcher.querySelectorAll('button').forEach((/** @type {HTMLElement} */ btn) => {
474
- btn.classList.toggle('uc-active', btn.getAttribute('data-id') === tabId);
475
- });
476
-
477
- if (tabId === CameraSourceTypes.PHOTO) {
478
- this.set$({
479
- currentIcon: 'camera-full',
480
- audioSelectHidden: true,
481
- audioToggleMicrophoneHidden: true,
482
- });
483
- }
484
-
485
- if (tabId === CameraSourceTypes.VIDEO) {
486
- this.set$({
487
- currentTimelineIcon: 'play',
488
- currentIcon: 'video-camera-full',
489
-
490
- audioSelectHidden: !this.cfg.enableAudioRecording || this._audioDevices.length <= 1,
491
- audioToggleMicrophoneHidden: !this.cfg.enableAudioRecording,
492
- });
493
- }
494
-
495
- this._activeTab = tabId;
496
- };
497
-
498
- /**
499
- * @param {'camera' | 'video'} type
500
- * @param {'jpeg' | 'webm'} ext
501
- * @param {String} format
502
- * @param {Blob} blob
503
- */
504
- _createFile = (type, ext, format, blob) => {
505
- const date = Date.now();
506
- const name = `${type}-${date}.${ext}`;
507
-
508
- const file = new File([blob], name, {
509
- lastModified: date,
510
- type: format,
511
- });
512
-
513
- return file;
514
- };
515
-
516
- /** @param {String | undefined} mime */
517
- _guessExtensionByMime(mime) {
518
- const knownContainers = {
519
- mp4: 'mp4',
520
- ogg: 'ogg',
521
- webm: 'webm',
522
- quicktime: 'mov',
523
- 'x-matroska': 'mkv',
524
- };
525
-
526
- // MediaRecorder.mimeType returns empty string in Firefox.
527
- // Firefox record video as WebM now by default.
528
- // @link https://bugzilla.mozilla.org/show_bug.cgi?id=1512175
529
- if (mime === '') {
530
- return 'webm';
531
- }
532
-
533
- // e.g. "video/x-matroska;codecs=avc1,opus"
534
- if (mime) {
535
- // e.g. ["video", "x-matroska;codecs=avc1,opus"]
536
- /** @type {string | string[]} */ (mime) = mime.split('/');
537
- if (mime?.[0] === 'video') {
538
- // e.g. "x-matroska;codecs=avc1,opus"
539
- mime = mime.slice(1).join('/');
540
- // e.g. "x-matroska"
541
- const container = mime?.split(';')[0];
542
- // e.g. "mkv"
543
- if (knownContainers[container]) {
544
- return knownContainers[container];
545
- }
546
- }
547
- }
548
-
549
- // In all other cases just return the base extension for all times
550
- return 'avi';
551
- }
552
-
553
- /**
554
- * The send file to the server
555
- *
556
- * @param {File} file
557
- */
558
- _toSend = (file) => {
559
- this.api.addFileFromObject(file, { source: UploadSource.CAMERA });
560
- this.set$({
561
- '*currentActivity': ActivityBlock.activities.UPLOAD_LIST,
562
- });
563
- this.modalManager.open(ActivityBlock.activities.UPLOAD_LIST);
564
- };
565
-
566
- /** @private */
567
- get _cameraModes() {
568
- return stringToArray(this.cfg.cameraModes);
569
- }
570
-
571
- /**
572
- * @private
573
- * @param {'granted' | 'denied' | 'prompt'} state
574
- */
575
- _setPermissionsState = debounce((state) => {
576
- this.classList.toggle('uc-initialized', state === 'granted');
577
-
578
- const visibleAudio = this._activeTab === CameraSourceTypes.VIDEO && this.cfg.enableAudioRecording;
579
- const currentIcon = this._activeTab === CameraSourceTypes.PHOTO ? 'camera-full' : 'video-camera-full';
580
-
581
- if (state === 'granted') {
582
- this.set$({
583
- videoHidden: false,
584
- cameraHidden: false,
585
- tabCameraHidden: !this._cameraModes.includes(CameraSourceTypes.PHOTO),
586
- tabVideoHidden: !this._cameraModes.includes(CameraSourceTypes.VIDEO),
587
- messageHidden: true,
588
- timerHidden: true,
589
-
590
- currentIcon,
591
- audioToggleMicrophoneHidden: !visibleAudio,
592
- audioSelectHidden: !visibleAudio,
593
- });
594
- } else if (state === 'prompt') {
595
- this.$.l10nMessage = 'camera-permissions-prompt';
596
-
597
- this.set$({
598
- videoHidden: true,
599
- cameraHidden: true,
600
- tabCameraHidden: true,
601
- messageHidden: false,
602
- });
603
-
604
- this._stopCapture();
605
- } else {
606
- this.$.l10nMessage = 'camera-permissions-denied';
607
-
608
- this.set$({
609
- videoHidden: true,
610
- messageHidden: false,
611
-
612
- tabCameraHidden: !this._cameraModes.includes(CameraSourceTypes.PHOTO),
613
- tabVideoHidden: !this._cameraModes.includes(CameraSourceTypes.VIDEO),
614
-
615
- cameraActionsHidden: true,
616
-
617
- mutableClassButton: 'uc-shot-btn uc-camera-action',
618
- });
619
-
620
- this._stopCapture();
621
- }
622
- }, 300);
623
-
624
- _makeStreamInactive = () => {
625
- if (!this._stream) return false;
626
-
627
- const audioTracks = this._stream?.getAudioTracks();
628
- const videoTracks = this._stream?.getVideoTracks();
629
-
630
- /** @type {MediaStreamTrack[]} */ (audioTracks).forEach((track) => track.stop());
631
- /** @type {MediaStreamTrack[]} */ (videoTracks).forEach((track) => track.stop());
632
- };
633
-
634
- _stopCapture = () => {
635
- if (this._capturing) {
636
- this.ref.video.volume = 0;
637
- this.$.video?.getTracks()[0].stop();
638
- this.$.video = null;
639
-
640
- this._makeStreamInactive();
641
- this._stopTimer();
642
-
643
- this._capturing = false;
644
- }
645
- };
646
-
647
- _capture = async () => {
648
- const constraints = {
649
- video: DEFAULT_VIDEO_CONFIG,
650
- audio: this.cfg.enableAudioRecording ? {} : false,
651
- };
652
-
653
- if (this._selectedCameraId) {
654
- constraints.video = {
655
- deviceId: {
656
- exact: this._selectedCameraId,
657
- },
658
- };
659
- }
660
-
661
- if (this._selectedAudioId && this.cfg.enableAudioRecording) {
662
- constraints.audio = {
663
- deviceId: {
664
- exact: this._selectedAudioId,
665
- },
666
- };
667
- }
668
-
669
- // Mute the video to prevent feedback for Firefox
670
- this.ref.video.volume = 0;
671
-
672
- try {
673
- this._setPermissionsState('prompt');
674
- this._stream = await navigator.mediaDevices.getUserMedia(constraints);
675
-
676
- this._stream.addEventListener('inactive', () => {
677
- this._setPermissionsState('denied');
678
- });
679
-
680
- this.$.video = this._stream;
681
- /** @private */
682
- this._capturing = true;
683
- this._setPermissionsState('granted');
684
- } catch (error) {
685
- this._setPermissionsState('denied');
686
- console.log('Failed to capture camera', error);
687
- this.telemetryManager.sendEventError(error, 'camera capturing. Failed to capture camera');
688
- }
689
- };
690
-
691
- _handlePermissionsChange = () => {
692
- this._capture();
693
- };
694
-
695
- _permissionAccess = async () => {
696
- try {
697
- for (const permission of DEFAULT_PERMISSIONS) {
698
- // @ts-ignore https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API
699
- this[`${permission}Response`] = await navigator.permissions.query({ name: permission });
700
-
701
- this[`${permission}Response`].addEventListener('change', this._handlePermissionsChange);
702
- }
703
- } catch (error) {
704
- console.log('Failed to use permissions API. Fallback to manual request mode.', error);
705
- this.telemetryManager.sendEventError(error, 'camera permissions. Failed to use permissions API');
706
- this._capture();
707
- }
708
- };
709
-
710
- _getPermission = () => {};
711
-
712
- _requestDeviceAccess = async () => {
713
- try {
714
- await navigator.mediaDevices.getUserMedia({ video: true, audio: this.cfg.enableAudioRecording });
715
- await this._getDevices();
716
-
717
- navigator.mediaDevices.addEventListener('devicechange', this._getDevices);
718
- } catch (error) {
719
- this.telemetryManager.sendEventError(error, 'camera devices. Failed to get user media');
720
- console.log('Failed to get user media', error);
721
- }
722
- };
723
-
724
- _getDevices = async () => {
725
- try {
726
- const devices = await navigator.mediaDevices.enumerateDevices();
727
-
728
- this._cameraDevices = devices
729
- .filter((device) => device.kind === 'videoinput')
730
- .map((device, index) => ({
731
- text: device.label.trim() || `${this.l10n('caption-camera')} ${index + 1}`,
732
- value: device.deviceId,
733
- }));
734
-
735
- this._audioDevices =
736
- this.cfg.enableAudioRecording &&
737
- devices
738
- .filter((device) => device.kind === 'audioinput')
739
- .map((device) => ({
740
- text: device.label.trim(),
741
- value: device.deviceId,
742
- }));
743
-
744
- if (this._cameraDevices.length > 1) {
745
- this.set$({
746
- cameraSelectOptions: this._cameraDevices,
747
- cameraSelectHidden: false,
748
- });
749
- }
750
- this._selectedCameraId = this._cameraDevices[0]?.value;
751
-
752
- if (this._audioDevices.length > 1) {
753
- this.set$({
754
- audioSelectOptions: this._audioDevices,
755
- audioSelectHidden: false,
756
- });
757
- }
758
- this._selectedAudioId = this._audioDevices[0]?.value;
759
- } catch (error) {
760
- this.telemetryManager.sendEventError(error, 'camera devices. Failed to get devices');
761
- console.log('Failed to get devices', error);
762
- }
763
- };
764
-
765
- _onActivate = async () => {
766
- await this._permissionAccess();
767
- await this._requestDeviceAccess();
768
- await this._capture();
769
-
770
- this._handleCameraModes(this._cameraModes);
771
- };
772
-
773
- _onDeactivate = async () => {
774
- if (this._unsubPermissions) {
775
- this._unsubPermissions();
776
- }
777
-
778
- /** Calling this method here because safari and firefox don't support the inactive event yet */
779
- const isChromium = !!window.chrome;
780
- if (!isChromium) {
781
- this._setPermissionsState('denied');
782
- }
783
-
784
- this._stopCapture();
785
- };
786
-
787
- /** @param {CameraMode[]} cameraModes */
788
- _handleCameraModes = (cameraModes) => {
789
- this.$.tabVideoHidden = !cameraModes.includes(CameraSourceTypes.VIDEO);
790
- this.$.tabCameraHidden = !cameraModes.includes(CameraSourceTypes.PHOTO);
791
-
792
- const defaultTab = cameraModes[0];
793
- if (!this._activeTab || !cameraModes.includes(this._activeTab)) {
794
- this._handleActiveTab(defaultTab);
795
- }
796
- };
797
-
798
- initCallback() {
799
- super.initCallback();
800
- this.registerActivity(this.activityType, {
801
- onActivate: this._onActivate,
802
- onDeactivate: this._onDeactivate,
803
- });
804
-
805
- this.subConfigValue('cameraMirror', (val) => {
806
- this.$.videoTransformCss = val ? 'scaleX(-1)' : null;
807
- });
808
-
809
- this.subConfigValue('enableAudioRecording', (val) => {
810
- this.$.audioToggleMicrophoneHidden = !val;
811
- this.$.audioSelectDisabled = !val;
812
- });
813
-
814
- this.subConfigValue('cameraModes', (val) => {
815
- if (!this.isActivityActive) return;
816
- const cameraModes = deserializeCsv(val);
817
- this._handleCameraModes(cameraModes);
818
- });
819
- }
820
-
821
- _destroy() {
822
- for (const permission of DEFAULT_PERMISSIONS) {
823
- this[`${permission}Response`]?.removeEventListener('change', this._handlePermissionsChange);
824
- }
825
-
826
- navigator.mediaDevices?.removeEventListener('devicechange', this._getDevices);
827
- }
828
-
829
- async destroyCallback() {
830
- super.destroyCallback();
831
-
832
- this._destroy();
833
- }
834
- }
835
-
836
- CameraSource.template = /* HTML */ `
837
- <uc-activity-header>
838
- <button type="button" class="uc-mini-btn" set="onclick: *historyBack" l10n="@title:back">
839
- <uc-icon name="back"></uc-icon>
840
- </button>
841
- <div set="@hidden: !cameraSelectHidden">
842
- <uc-icon name="camera"></uc-icon>
843
- <span l10n="caption-camera"></span>
844
- </div>
845
- <uc-select
846
- class="uc-camera-select"
847
- set="$.options: cameraSelectOptions; @hidden: cameraSelectHidden; onchange: onCameraSelectChange"
848
- >
849
- </uc-select>
850
- <button
851
- type="button"
852
- class="uc-mini-btn uc-close-btn"
853
- set="onclick: *closeModal"
854
- l10n="@title:a11y-activity-header-button-close;@aria-label:a11y-activity-header-button-close"
855
- >
856
- <uc-icon name="close"></uc-icon>
857
- </button>
858
- </uc-activity-header>
859
- <div class="uc-content">
860
- <video
861
- muted
862
- autoplay
863
- playsinline
864
- set="srcObject: video; style.transform: videoTransformCss; @hidden: videoHidden"
865
- ref="video"
866
- ></video>
867
- <div class="uc-message-box" set="@hidden: messageHidden">
868
- <span l10n="l10nMessage"></span>
869
- <button
870
- type="button"
871
- set="onclick: onRequestPermissions; @hidden: requestBtnHidden"
872
- l10n="camera-permissions-request"
873
- ></button>
874
- </div>
875
- </div>
876
-
877
- <div class="uc-controls">
878
- <div ref="switcher" class="uc-switcher" set="@hidden:!timerHidden">
879
- <button
880
- data-id="photo"
881
- type="button"
882
- class="uc-switch uc-mini-btn"
883
- set="onclick: onClickTab; @hidden: tabCameraHidden"
884
- >
885
- <uc-icon name="camera"></uc-icon>
886
- </button>
887
- <button
888
- data-id="video"
889
- type="button"
890
- class="uc-switch uc-mini-btn"
891
- set="onclick: onClickTab; @hidden: tabVideoHidden"
892
- >
893
- <uc-icon name="video-camera"></uc-icon>
894
- </button>
895
- </div>
896
-
897
- <button class="uc-secondary-btn uc-recording-timer" set="@hidden:timerHidden; onclick: onToggleRecording">
898
- <uc-icon set="@name: currentTimelineIcon"></uc-icon>
899
- <span ref="timer"> 00:00 </span>
900
- <span ref="line" class="uc-line"></span>
901
- </button>
902
-
903
- <div class="uc-camera-actions uc-camera-action" set="@hidden: cameraActionsHidden">
904
- <button type="button" class="uc-secondary-btn" set="onclick: onRetake">Retake</button>
905
- <button type="button" class="uc-primary-btn" set="onclick: onAccept" data-testid="accept">Accept</button>
906
- </div>
907
-
908
- <button
909
- type="button"
910
- class="uc-shot-btn uc-camera-action"
911
- data-testid="shot"
912
- set="onclick: onStartCamera; @class: mutableClassButton; @hidden: cameraHidden;"
913
- >
914
- <uc-icon set="@name: currentIcon"></uc-icon>
915
- </button>
916
-
917
- <div class="uc-select">
918
- <button class="uc-mini-btn uc-btn-microphone" set="onclick: onToggleAudio; @hidden: audioToggleMicrophoneHidden;">
919
- <uc-icon set="@name:toggleMicrophoneIcon"></uc-icon>
920
- </button>
921
-
922
- <uc-select
923
- class="uc-audio-select"
924
- set="$.options: audioSelectOptions; onchange: onAudioSelectChange; @hidden: audioSelectHidden; @disabled: audioSelectDisabled"
925
- >
926
- </uc-select>
927
- </div>
928
- </div>
929
- `;