@uploadcare/file-uploader 1.20.0-rc.2 → 1.20.1-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 (224) hide show
  1. package/abstract/Block.d.ts +2 -11
  2. package/abstract/Block.d.ts.map +1 -1
  3. package/abstract/Block.js +3 -29
  4. package/abstract/CTX.d.ts +2 -2
  5. package/abstract/CTX.d.ts.map +1 -1
  6. package/abstract/CTX.js +1 -1
  7. package/abstract/{managers/LocaleManager.d.ts → LocaleManager.d.ts} +8 -8
  8. package/abstract/{managers/LocaleManager.d.ts.map → LocaleManager.d.ts.map} +1 -1
  9. package/abstract/{managers/LocaleManager.js → LocaleManager.js} +8 -8
  10. package/abstract/{managers/ModalManager.d.ts → ModalManager.d.ts} +7 -7
  11. package/abstract/{managers/ModalManager.d.ts.map → ModalManager.d.ts.map} +1 -1
  12. package/abstract/{managers/ModalManager.js → ModalManager.js} +3 -3
  13. package/abstract/SecureUploadsManager.d.ts +22 -0
  14. package/abstract/{managers/SecureUploadsManager.d.ts.map → SecureUploadsManager.d.ts.map} +1 -1
  15. package/abstract/{managers/SecureUploadsManager.js → SecureUploadsManager.js} +5 -5
  16. package/abstract/SolutionBlock.d.ts +1 -1
  17. package/abstract/UploaderBlock.d.ts +8 -4
  18. package/abstract/UploaderBlock.d.ts.map +1 -1
  19. package/abstract/UploaderBlock.js +50 -13
  20. package/abstract/{managers/ValidationManager.d.ts → ValidationManager.d.ts} +7 -7
  21. package/abstract/{managers/ValidationManager.d.ts.map → ValidationManager.d.ts.map} +1 -1
  22. package/abstract/{managers/ValidationManager.js → ValidationManager.js} +14 -14
  23. package/abstract/{managers/a11y.d.ts → a11y.d.ts} +2 -2
  24. package/abstract/a11y.d.ts.map +1 -0
  25. package/abstract/{managers/a11y.js → a11y.js} +1 -1
  26. package/abstract/l10nProcessor.js +1 -1
  27. package/blocks/CameraSource/CameraSource.d.ts +1 -1
  28. package/blocks/CloudImageEditor/src/CloudImageEditorBlock.d.ts +1 -0
  29. package/blocks/CloudImageEditor/src/CloudImageEditorBlock.d.ts.map +1 -1
  30. package/blocks/CloudImageEditor/src/CloudImageEditorBlock.js +19 -5
  31. package/blocks/CloudImageEditor/src/CropFrame.js +3 -3
  32. package/blocks/CloudImageEditor/src/EditorAspectRatioButtonControl.d.ts +11 -0
  33. package/blocks/CloudImageEditor/src/EditorAspectRatioButtonControl.d.ts.map +1 -0
  34. package/blocks/CloudImageEditor/src/EditorAspectRatioButtonControl.js +130 -0
  35. package/blocks/CloudImageEditor/src/EditorButtonControl.js +1 -1
  36. package/blocks/CloudImageEditor/src/EditorCropButtonControl.d.ts.map +1 -1
  37. package/blocks/CloudImageEditor/src/EditorCropButtonControl.js +2 -8
  38. package/blocks/CloudImageEditor/src/EditorFilterControl.d.ts.map +1 -1
  39. package/blocks/CloudImageEditor/src/EditorFilterControl.js +1 -7
  40. package/blocks/CloudImageEditor/src/EditorImageCropper.d.ts.map +1 -1
  41. package/blocks/CloudImageEditor/src/EditorImageCropper.js +2 -3
  42. package/blocks/CloudImageEditor/src/EditorOperationControl.d.ts +1 -1
  43. package/blocks/CloudImageEditor/src/EditorOperationControl.d.ts.map +1 -1
  44. package/blocks/CloudImageEditor/src/EditorOperationControl.js +3 -9
  45. package/blocks/CloudImageEditor/src/EditorToolbar.d.ts +15 -8
  46. package/blocks/CloudImageEditor/src/EditorToolbar.d.ts.map +1 -1
  47. package/blocks/CloudImageEditor/src/EditorToolbar.js +68 -25
  48. package/blocks/CloudImageEditor/src/css/common.css +39 -7
  49. package/blocks/CloudImageEditor/src/index.d.ts +1 -0
  50. package/blocks/CloudImageEditor/src/index.js +1 -0
  51. package/blocks/CloudImageEditor/src/lib/parseCropPreset.d.ts +2 -1
  52. package/blocks/CloudImageEditor/src/lib/parseCropPreset.d.ts.map +1 -1
  53. package/blocks/CloudImageEditor/src/lib/parseCropPreset.js +74 -8
  54. package/blocks/CloudImageEditor/src/lib/parseCropPreset.test.d.ts +2 -0
  55. package/blocks/CloudImageEditor/src/lib/parseCropPreset.test.d.ts.map +1 -0
  56. package/blocks/CloudImageEditor/src/lib/parseCropPreset.test.js +35 -0
  57. package/blocks/CloudImageEditor/src/state.d.ts +1 -1
  58. package/blocks/CloudImageEditor/src/state.d.ts.map +1 -1
  59. package/blocks/CloudImageEditor/src/state.js +2 -2
  60. package/blocks/CloudImageEditor/src/svg-sprite.d.ts +1 -1
  61. package/blocks/CloudImageEditor/src/svg-sprite.d.ts.map +1 -1
  62. package/blocks/CloudImageEditor/src/svg-sprite.js +1 -1
  63. package/blocks/CloudImageEditor/src/toolbar-constants.d.ts +0 -1
  64. package/blocks/CloudImageEditor/src/toolbar-constants.d.ts.map +1 -1
  65. package/blocks/CloudImageEditor/src/toolbar-constants.js +0 -2
  66. package/blocks/CloudImageEditor/src/types.d.ts +2 -0
  67. package/blocks/CloudImageEditor/src/types.d.ts.map +1 -1
  68. package/blocks/CloudImageEditor/src/types.js +9 -1
  69. package/blocks/Config/initialConfig.d.ts.map +1 -1
  70. package/blocks/Config/initialConfig.js +0 -2
  71. package/blocks/Config/normalizeConfigValue.d.ts.map +1 -1
  72. package/blocks/Config/normalizeConfigValue.js +0 -2
  73. package/blocks/DropArea/DropArea.d.ts +1 -1
  74. package/blocks/ExternalSource/ExternalSource.d.ts +1 -1
  75. package/blocks/FileItem/FileItem.d.ts +1 -1
  76. package/blocks/FileItem/FileItem.d.ts.map +1 -1
  77. package/blocks/FileItem/FileItem.js +0 -16
  78. package/blocks/Modal/Modal.d.ts +6 -6
  79. package/blocks/Modal/Modal.d.ts.map +1 -1
  80. package/blocks/Modal/Modal.js +12 -10
  81. package/blocks/SimpleBtn/SimpleBtn.d.ts +1 -1
  82. package/blocks/SourceBtn/SourceBtn.d.ts +1 -1
  83. package/blocks/Thumb/Thumb.d.ts +1 -1
  84. package/blocks/UploadCtxProvider/EventEmitter.d.ts +4 -17
  85. package/blocks/UploadCtxProvider/EventEmitter.d.ts.map +1 -1
  86. package/blocks/UploadCtxProvider/EventEmitter.js +2 -14
  87. package/blocks/UploadList/UploadList.d.ts +1 -1
  88. package/blocks/themes/uc-basic/svg-sprite.d.ts +1 -1
  89. package/blocks/themes/uc-basic/svg-sprite.d.ts.map +1 -1
  90. package/blocks/themes/uc-basic/svg-sprite.js +1 -1
  91. package/env.d.ts +1 -1
  92. package/env.js +1 -1
  93. package/index.d.ts +1 -1
  94. package/index.js +1 -1
  95. package/index.ssr.d.ts +17 -3
  96. package/index.ssr.d.ts.map +1 -1
  97. package/index.ssr.js +35 -11
  98. package/locales/file-uploader/ar.d.ts +4 -0
  99. package/locales/file-uploader/ar.js +5 -0
  100. package/locales/file-uploader/az.d.ts +4 -0
  101. package/locales/file-uploader/az.js +5 -0
  102. package/locales/file-uploader/ca.d.ts +4 -0
  103. package/locales/file-uploader/ca.js +6 -0
  104. package/locales/file-uploader/cs.d.ts +4 -0
  105. package/locales/file-uploader/cs.js +6 -0
  106. package/locales/file-uploader/da.d.ts +4 -0
  107. package/locales/file-uploader/da.js +6 -0
  108. package/locales/file-uploader/de.d.ts +4 -0
  109. package/locales/file-uploader/de.js +6 -0
  110. package/locales/file-uploader/el.d.ts +4 -0
  111. package/locales/file-uploader/el.js +6 -0
  112. package/locales/file-uploader/en.d.ts +4 -0
  113. package/locales/file-uploader/en.js +5 -0
  114. package/locales/file-uploader/es.d.ts +4 -0
  115. package/locales/file-uploader/es.js +6 -0
  116. package/locales/file-uploader/et.d.ts +4 -0
  117. package/locales/file-uploader/et.js +6 -0
  118. package/locales/file-uploader/fi.d.ts +4 -0
  119. package/locales/file-uploader/fi.js +6 -0
  120. package/locales/file-uploader/fr.d.ts +4 -0
  121. package/locales/file-uploader/fr.js +6 -0
  122. package/locales/file-uploader/he.d.ts +4 -0
  123. package/locales/file-uploader/he.js +6 -0
  124. package/locales/file-uploader/hy.d.ts +4 -0
  125. package/locales/file-uploader/hy.js +5 -0
  126. package/locales/file-uploader/is.d.ts +4 -0
  127. package/locales/file-uploader/is.js +6 -0
  128. package/locales/file-uploader/it.d.ts +4 -0
  129. package/locales/file-uploader/it.js +6 -0
  130. package/locales/file-uploader/ja.d.ts +4 -0
  131. package/locales/file-uploader/ja.js +6 -0
  132. package/locales/file-uploader/ka.d.ts +4 -0
  133. package/locales/file-uploader/ka.js +6 -0
  134. package/locales/file-uploader/kk.d.ts +4 -0
  135. package/locales/file-uploader/kk.js +6 -0
  136. package/locales/file-uploader/ko.d.ts +4 -0
  137. package/locales/file-uploader/ko.js +6 -0
  138. package/locales/file-uploader/lv.d.ts +4 -0
  139. package/locales/file-uploader/lv.js +6 -0
  140. package/locales/file-uploader/nb.d.ts +4 -0
  141. package/locales/file-uploader/nb.js +6 -0
  142. package/locales/file-uploader/nl.d.ts +4 -0
  143. package/locales/file-uploader/nl.js +6 -0
  144. package/locales/file-uploader/pl.d.ts +4 -0
  145. package/locales/file-uploader/pl.js +6 -0
  146. package/locales/file-uploader/pt.d.ts +4 -0
  147. package/locales/file-uploader/pt.js +6 -0
  148. package/locales/file-uploader/ro.d.ts +4 -0
  149. package/locales/file-uploader/ro.js +6 -0
  150. package/locales/file-uploader/ru.d.ts +4 -0
  151. package/locales/file-uploader/ru.js +6 -0
  152. package/locales/file-uploader/sk.d.ts +4 -0
  153. package/locales/file-uploader/sk.js +6 -0
  154. package/locales/file-uploader/sr.d.ts +4 -0
  155. package/locales/file-uploader/sr.js +6 -0
  156. package/locales/file-uploader/sv.d.ts +4 -0
  157. package/locales/file-uploader/sv.js +6 -0
  158. package/locales/file-uploader/tr.d.ts +4 -0
  159. package/locales/file-uploader/tr.js +6 -0
  160. package/locales/file-uploader/uk.d.ts +4 -0
  161. package/locales/file-uploader/uk.js +6 -0
  162. package/locales/file-uploader/vi.d.ts +4 -0
  163. package/locales/file-uploader/vi.js +6 -0
  164. package/locales/file-uploader/zh-TW.d.ts +4 -0
  165. package/locales/file-uploader/zh-TW.js +6 -0
  166. package/locales/file-uploader/zh.d.ts +4 -0
  167. package/locales/file-uploader/zh.js +6 -0
  168. package/package.json +3 -6
  169. package/solutions/cloud-image-editor/CloudImageEditor.d.ts +0 -34
  170. package/solutions/cloud-image-editor/CloudImageEditor.d.ts.map +1 -1
  171. package/solutions/cloud-image-editor/CloudImageEditor.js +0 -12
  172. package/solutions/file-uploader/inline/FileUploaderInline.d.ts +1 -2
  173. package/solutions/file-uploader/inline/FileUploaderInline.d.ts.map +1 -1
  174. package/solutions/file-uploader/inline/FileUploaderInline.js +0 -4
  175. package/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts +9 -10
  176. package/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts.map +1 -1
  177. package/solutions/file-uploader/minimal/FileUploaderMinimal.js +3 -7
  178. package/solutions/file-uploader/regular/FileUploaderRegular.d.ts +1 -2
  179. package/solutions/file-uploader/regular/FileUploaderRegular.d.ts.map +1 -1
  180. package/solutions/file-uploader/regular/FileUploaderRegular.js +0 -4
  181. package/types/events.d.ts +1 -1
  182. package/types/exported.d.ts +52 -54
  183. package/types/jsx.d.ts +2 -0
  184. package/utils/parseCdnUrl.d.ts.map +1 -1
  185. package/utils/parseCdnUrl.js +4 -1
  186. package/utils/parseCdnUrl.test.js +13 -0
  187. package/utils/validators/collection/validateCollectionUploadError.d.ts +2 -2
  188. package/utils/validators/collection/validateCollectionUploadError.d.ts.map +1 -1
  189. package/utils/validators/collection/validateCollectionUploadError.js +1 -1
  190. package/utils/validators/collection/validateMultiple.d.ts +2 -2
  191. package/utils/validators/collection/validateMultiple.d.ts.map +1 -1
  192. package/utils/validators/collection/validateMultiple.js +1 -1
  193. package/utils/validators/file/validateFileType.d.ts +2 -2
  194. package/utils/validators/file/validateFileType.d.ts.map +1 -1
  195. package/utils/validators/file/validateFileType.js +1 -1
  196. package/utils/validators/file/validateIsImage.d.ts +2 -2
  197. package/utils/validators/file/validateIsImage.d.ts.map +1 -1
  198. package/utils/validators/file/validateIsImage.js +1 -1
  199. package/utils/validators/file/validateMaxSizeLimit.d.ts +2 -2
  200. package/utils/validators/file/validateMaxSizeLimit.d.ts.map +1 -1
  201. package/utils/validators/file/validateMaxSizeLimit.js +1 -1
  202. package/utils/validators/file/validateUploadError.d.ts +2 -2
  203. package/utils/validators/file/validateUploadError.d.ts.map +1 -1
  204. package/utils/validators/file/validateUploadError.js +1 -1
  205. package/web/file-uploader.iife.min.js +4 -4
  206. package/web/file-uploader.min.js +4 -4
  207. package/web/uc-basic.min.css +1 -1
  208. package/web/uc-cloud-image-editor.min.css +1 -1
  209. package/web/uc-cloud-image-editor.min.js +4 -4
  210. package/web/uc-file-uploader-inline.min.css +1 -1
  211. package/web/uc-file-uploader-inline.min.js +4 -4
  212. package/web/uc-file-uploader-minimal.min.css +1 -1
  213. package/web/uc-file-uploader-minimal.min.js +4 -4
  214. package/web/uc-file-uploader-regular.min.css +1 -1
  215. package/web/uc-file-uploader-regular.min.js +4 -4
  216. package/web/uc-img.min.js +1 -1
  217. package/abstract/managers/SecureUploadsManager.d.ts +0 -22
  218. package/abstract/managers/TelemetryManager.d.ts +0 -66
  219. package/abstract/managers/TelemetryManager.d.ts.map +0 -1
  220. package/abstract/managers/TelemetryManager.js +0 -202
  221. package/abstract/managers/a11y.d.ts.map +0 -1
  222. package/blocks/CloudImageEditor/src/utils/parseFilterValue.d.ts +0 -11
  223. package/blocks/CloudImageEditor/src/utils/parseFilterValue.d.ts.map +0 -1
  224. package/blocks/CloudImageEditor/src/utils/parseFilterValue.js +0 -11
@@ -125,6 +125,10 @@ declare const _default: {
125
125
  'select-all': string;
126
126
  'deselect-all': string;
127
127
  'waiting-for': string;
128
+ 'a11y-cloud-editor-apply-aspect-ratio': string;
129
+ 'aspect-ratio': string;
130
+ 'crop-to-shape': string;
131
+ custom: string;
128
132
  };
129
133
  export default _default;
130
134
  //# sourceMappingURL=uk.d.ts.map
@@ -126,4 +126,10 @@ export default {
126
126
  'select-all': 'Вибрати всі',
127
127
  'deselect-all': 'Скасувати вибір всіх',
128
128
  'waiting-for': 'Очікування {{source}}',
129
+ 'a11y-cloud-editor-apply-aspect-ratio': 'Застосувати операцію {{name}} {{value}}',
130
+ 'aspect-ratio': 'Співвідношення сторін',
131
+
132
+ 'crop-to-shape': 'Обрізати до {{value}}',
133
+
134
+ custom: 'Користувацький',
129
135
  };
@@ -121,6 +121,10 @@ declare const _default: {
121
121
  'select-all': string;
122
122
  'deselect-all': string;
123
123
  'waiting-for': string;
124
+ 'a11y-cloud-editor-apply-aspect-ratio': string;
125
+ 'aspect-ratio': string;
126
+ 'crop-to-shape': string;
127
+ custom: string;
124
128
  };
125
129
  export default _default;
126
130
  //# sourceMappingURL=vi.d.ts.map
@@ -122,4 +122,10 @@ export default {
122
122
  'select-all': 'Chọn tất cả',
123
123
  'deselect-all': 'Bỏ chọn tất cả',
124
124
  'waiting-for': 'Đang chờ {{source}}',
125
+ 'a11y-cloud-editor-apply-aspect-ratio': 'Áp dụng thao tác {{name}} {{value}}',
126
+ 'aspect-ratio': 'Tỷ lệ khung hình',
127
+
128
+ 'crop-to-shape': 'Cắt theo {{value}}',
129
+
130
+ custom: 'Tùy chỉnh',
125
131
  };
@@ -121,6 +121,10 @@ declare const _default: {
121
121
  'select-all': string;
122
122
  'deselect-all': string;
123
123
  'waiting-for': string;
124
+ 'a11y-cloud-editor-apply-aspect-ratio': string;
125
+ 'aspect-ratio': string;
126
+ 'crop-to-shape': string;
127
+ custom: string;
124
128
  };
125
129
  export default _default;
126
130
  //# sourceMappingURL=zh-TW.d.ts.map
@@ -122,4 +122,10 @@ export default {
122
122
  'select-all': '全選',
123
123
  'deselect-all': '取消全選',
124
124
  'waiting-for': '等待 {{source}}',
125
+ 'a11y-cloud-editor-apply-aspect-ratio': '套用操作 {{name}} {{value}}',
126
+ 'aspect-ratio': '寬高比',
127
+
128
+ 'crop-to-shape': '裁剪為 {{value}}',
129
+
130
+ custom: '自訂',
125
131
  };
@@ -121,6 +121,10 @@ declare const _default: {
121
121
  'select-all': string;
122
122
  'deselect-all': string;
123
123
  'waiting-for': string;
124
+ 'a11y-cloud-editor-apply-aspect-ratio': string;
125
+ 'aspect-ratio': string;
126
+ 'crop-to-shape': string;
127
+ custom: string;
124
128
  };
125
129
  export default _default;
126
130
  //# sourceMappingURL=zh.d.ts.map
@@ -122,4 +122,10 @@ export default {
122
122
  'select-all': '全选',
123
123
  'deselect-all': '取消全选',
124
124
  'waiting-for': '等待 {{source}}',
125
+ 'a11y-cloud-editor-apply-aspect-ratio': '应用操作 {{name}} {{value}}',
126
+ 'aspect-ratio': '宽高比',
127
+
128
+ 'crop-to-shape': '裁剪为 {{value}}',
129
+
130
+ custom: '自定义',
125
131
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uploadcare/file-uploader",
3
- "version": "1.20.0-rc.2",
3
+ "version": "1.20.1-alpha.0",
4
4
  "description": "Building blocks for Uploadcare products integration",
5
5
  "keywords": [
6
6
  "web components",
@@ -35,9 +35,7 @@
35
35
  "MIT"
36
36
  ],
37
37
  "type": "module",
38
- "sideEffects": [
39
- "*.css"
40
- ],
38
+ "sideEffects": ["*.css"],
41
39
  "module": "./index.js",
42
40
  "exports": {
43
41
  ".": {
@@ -121,7 +119,7 @@
121
119
  "nano-jsx": "^0.1.0",
122
120
  "node-watch": "^0.7.3",
123
121
  "npm-run-all": "^4.1.5",
124
- "playwright": "^1.51.1",
122
+ "playwright": "^1.55.0",
125
123
  "postcss": "^8.4.21",
126
124
  "prettier": "^3.2.4",
127
125
  "prettier-plugin-jsdoc": "1.3.0",
@@ -145,7 +143,6 @@
145
143
  "@symbiotejs/symbiote": "^1.11.7",
146
144
  "@uploadcare/cname-prefix": "^6.17.0",
147
145
  "@uploadcare/image-shrink": "^6.17.0",
148
- "@uploadcare/quality-insights": "^6.17.0",
149
146
  "@uploadcare/upload-client": "^6.17.0",
150
147
  "keyux": "^0.7.1"
151
148
  }
@@ -1,38 +1,4 @@
1
1
  export class CloudImageEditor extends CloudImageEditorBlock {
2
- init$: {
3
- '*solution': string;
4
- '*originalUrl': null;
5
- '*faderEl': null;
6
- '*cropperEl': null;
7
- '*imgEl': null;
8
- '*imgContainerEl': null;
9
- '*networkProblems': boolean;
10
- '*imageSize': null;
11
- '*editorTransformations': import("../../blocks/CloudImageEditor/src/types.js").Transformations;
12
- '*cropPresetList': import("../../blocks/CloudImageEditor/src/types.js").CropPresetList;
13
- '*tabList': ("crop" | "tuning" | "filters")[];
14
- '*tabId': "crop";
15
- entry: null;
16
- extension: null;
17
- editorMode: boolean;
18
- modalCaption: string;
19
- isImage: boolean;
20
- msg: string;
21
- src: string;
22
- fileType: string;
23
- showLoader: boolean;
24
- uuid: null;
25
- cdnUrl: null;
26
- cropPreset: string;
27
- tabs: string;
28
- 'presence.networkProblems': boolean;
29
- 'presence.modalCaption': boolean;
30
- 'presence.editorToolbar': boolean;
31
- 'presence.viewerToolbar': boolean;
32
- '*on.retryNetwork': () => void;
33
- '*on.apply': (transformations: import("../../blocks/CloudImageEditor/src/types.js").Transformations) => void;
34
- '*on.cancel': () => void;
35
- };
36
2
  }
37
3
  import { CloudImageEditorBlock } from '../../blocks/CloudImageEditor/src/CloudImageEditorBlock.js';
38
4
  //# sourceMappingURL=CloudImageEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CloudImageEditor.d.ts","sourceRoot":"","sources":["CloudImageEditor.js"],"names":[],"mappings":"AAIA;IAMI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAGC;CAUJ;sCArBqC,4DAA4D"}
1
+ {"version":3,"file":"CloudImageEditor.d.ts","sourceRoot":"","sources":["CloudImageEditor.js"],"names":[],"mappings":"AAGA;CAQC;sCAVqC,4DAA4D"}
@@ -1,24 +1,12 @@
1
1
  // @ts-check
2
- import { InternalEventType } from '../../blocks/UploadCtxProvider/EventEmitter.js';
3
2
  import { CloudImageEditorBlock } from '../../blocks/CloudImageEditor/src/CloudImageEditorBlock.js';
4
3
 
5
4
  export class CloudImageEditor extends CloudImageEditorBlock {
6
5
  static styleAttrs = [...super.styleAttrs, 'uc-wgt-common'];
7
6
 
8
- constructor() {
9
- super();
10
-
11
- this.init$ = {
12
- ...this.init$,
13
- '*solution': this.tagName,
14
- };
15
- }
16
-
17
7
  initCallback() {
18
8
  super.initCallback();
19
9
 
20
- this.emit(InternalEventType.INIT_SOLUTION, undefined);
21
-
22
10
  this.a11y?.registerBlock(this);
23
11
  }
24
12
  }
@@ -1,7 +1,6 @@
1
1
  export class FileUploaderInline extends SolutionBlock {
2
2
  init$: {
3
3
  couldCancel: boolean;
4
- '*solution': string;
5
4
  cancel: () => void;
6
5
  '*commonProgress': number;
7
6
  '*uploadList': never[];
@@ -10,7 +9,7 @@ export class FileUploaderInline extends SolutionBlock {
10
9
  '*collectionState': import("./index.js").OutputCollectionState | null;
11
10
  '*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
12
11
  '*uploadTrigger': Set<string>;
13
- '*secureUploadsManager': import("../../../abstract/managers/SecureUploadsManager.js").SecureUploadsManager | null;
12
+ '*secureUploadsManager': import("../../../abstract/SecureUploadsManager.js").SecureUploadsManager | null;
14
13
  '*currentActivity': null;
15
14
  '*currentActivityParams': {};
16
15
  '*history': never[];
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploaderInline.d.ts","sourceRoot":"","sources":["FileUploaderInline.js"],"names":[],"mappings":"AAKA;IAMI;;;;;;;;;;;;;;;;;MAWC;IAGH,gCAGC;IAED,6BAEC;CA4BF;;;;8BAzD6B,oCAAoC"}
1
+ {"version":3,"file":"FileUploaderInline.d.ts","sourceRoot":"","sources":["FileUploaderInline.js"],"names":[],"mappings":"AAIA;IAMI;;;;;;;;;;;;;;;;MAUC;IAGH,gCAGC;IAED,6BAEC;CA0BF;;;;8BAtD6B,oCAAoC"}
@@ -1,5 +1,4 @@
1
1
  // @ts-check
2
- import { InternalEventType } from '../../../blocks/UploadCtxProvider/EventEmitter.js';
3
2
  import { ActivityBlock } from '../../../abstract/ActivityBlock.js';
4
3
  import { SolutionBlock } from '../../../abstract/SolutionBlock.js';
5
4
 
@@ -12,7 +11,6 @@ export class FileUploaderInline extends SolutionBlock {
12
11
  this.init$ = {
13
12
  ...this.init$,
14
13
  couldCancel: false,
15
- '*solution': this.tagName,
16
14
  cancel: () => {
17
15
  if (this.couldHistoryBack) {
18
16
  this.$['*historyBack']();
@@ -35,8 +33,6 @@ export class FileUploaderInline extends SolutionBlock {
35
33
  initCallback() {
36
34
  super.initCallback();
37
35
 
38
- this.emit(InternalEventType.INIT_SOLUTION, undefined);
39
-
40
36
  /** @type {import('../../../abstract/UploaderBlock.js').UploaderBlock} */
41
37
  const uBlock = this.ref.uBlock;
42
38
  this.sub('*currentActivity', (val) => {
@@ -4,7 +4,6 @@ export class FileUploaderMinimal extends SolutionBlock {
4
4
  isHiddenStartFrom: boolean;
5
5
  classUploadList: string;
6
6
  classStartFrom: string;
7
- '*solution': string;
8
7
  '*commonProgress': number;
9
8
  '*uploadList': never[];
10
9
  '*uploadQueue': import("@uploadcare/upload-client").Queue;
@@ -12,7 +11,7 @@ export class FileUploaderMinimal extends SolutionBlock {
12
11
  '*collectionState': import("./index.js").OutputCollectionState | null;
13
12
  '*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
14
13
  '*uploadTrigger': Set<string>;
15
- '*secureUploadsManager': import("../../../abstract/managers/SecureUploadsManager.js").SecureUploadsManager | null;
14
+ '*secureUploadsManager': import("../../../abstract/SecureUploadsManager.js").SecureUploadsManager | null;
16
15
  '*currentActivity': null;
17
16
  '*currentActivityParams': {};
18
17
  '*history': never[];
@@ -20,20 +19,20 @@ export class FileUploaderMinimal extends SolutionBlock {
20
19
  '*closeModal': () => void;
21
20
  };
22
21
  _handleModalOpen(data: {
23
- id: import("../../../abstract/managers/ModalManager.js").ModalId;
24
- modal: import("../../../abstract/managers/ModalManager.js").ModalNode;
22
+ id: import("../../../abstract/ModalManager.js").ModalId;
23
+ modal: import("../../../abstract/ModalManager.js").ModalNode;
25
24
  }): void;
26
25
  _handleModalClose(data: {
27
- id: import("../../../abstract/managers/ModalManager.js").ModalId;
28
- modal: import("../../../abstract/managers/ModalManager.js").ModalNode;
26
+ id: import("../../../abstract/ModalManager.js").ModalId;
27
+ modal: import("../../../abstract/ModalManager.js").ModalNode;
29
28
  }): void;
30
29
  handleModalOpen: ((data: {
31
- id: import("../../../abstract/managers/ModalManager.js").ModalId;
32
- modal: import("../../../abstract/managers/ModalManager.js").ModalNode;
30
+ id: import("../../../abstract/ModalManager.js").ModalId;
31
+ modal: import("../../../abstract/ModalManager.js").ModalNode;
33
32
  }) => void) | undefined;
34
33
  handleModalClose: ((data: {
35
- id: import("../../../abstract/managers/ModalManager.js").ModalId;
36
- modal: import("../../../abstract/managers/ModalManager.js").ModalNode;
34
+ id: import("../../../abstract/ModalManager.js").ModalId;
35
+ modal: import("../../../abstract/ModalManager.js").ModalNode;
37
36
  }) => void) | undefined;
38
37
  }
39
38
  export namespace FileUploaderMinimal {
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploaderMinimal.d.ts","sourceRoot":"","sources":["FileUploaderMinimal.js"],"names":[],"mappings":"AASA;IAMI;;;;;;;;;;;;;;;;;;;MAOC;;;;;;;;;IAgGD;;;4BAAuD;IACvD;;;4BAAyD;CAW5D;;;;8BAhI6B,oCAAoC"}
1
+ {"version":3,"file":"FileUploaderMinimal.d.ts","sourceRoot":"","sources":["FileUploaderMinimal.js"],"names":[],"mappings":"AAQA;IAMI;;;;;;;;;;;;;;;;;;MAMC;;;;;;;;;IA8FD;;;4BAAuD;IACvD;;;4BAAyD;CAW5D;;;;8BA5H6B,oCAAoC"}
@@ -1,8 +1,7 @@
1
1
  //@ts-check
2
2
  import { ActivityBlock } from '../../../abstract/ActivityBlock.js';
3
3
  import { SolutionBlock } from '../../../abstract/SolutionBlock.js';
4
- import { ModalEvents } from '../../../abstract/managers/ModalManager.js';
5
- import { InternalEventType } from '../../../blocks/UploadCtxProvider/EventEmitter.js';
4
+ import { ModalEvents } from '../../../abstract/ModalManager.js';
6
5
 
7
6
  const ACTIVE_CLASS = 'active';
8
7
  const EMPTY_CLASS = '';
@@ -19,11 +18,10 @@ export class FileUploaderMinimal extends SolutionBlock {
19
18
  isHiddenStartFrom: false,
20
19
  classUploadList: EMPTY_CLASS,
21
20
  classStartFrom: EMPTY_CLASS,
22
- '*solution': this.tagName,
23
21
  };
24
22
  }
25
23
 
26
- /** @type {import('../../../abstract/managers/ModalManager.js').ModalCb} */
24
+ /** @type {import('../../../abstract/ModalManager.js').ModalCb} */
27
25
  _handleModalOpen(e) {
28
26
  if (e.id === ActivityBlock.activities.CLOUD_IMG_EDIT) {
29
27
  this.set$({
@@ -45,7 +43,7 @@ export class FileUploaderMinimal extends SolutionBlock {
45
43
  }
46
44
  }
47
45
 
48
- /** @type {import('../../../abstract/managers/ModalManager.js').ModalCb} */
46
+ /** @type {import('../../../abstract/ModalManager.js').ModalCb} */
49
47
  _handleModalClose(e) {
50
48
  if (e.id === this.$['*currentActivity']) {
51
49
  this.$['*currentActivity'] = ActivityBlock.activities.UPLOAD_LIST;
@@ -62,8 +60,6 @@ export class FileUploaderMinimal extends SolutionBlock {
62
60
  initCallback() {
63
61
  super.initCallback();
64
62
 
65
- this.emit(InternalEventType.INIT_SOLUTION, undefined);
66
-
67
63
  /** @type {import('../../../abstract/UploaderBlock.js').UploaderBlock} */
68
64
  const uBlock = this.ref.uBlock;
69
65
  this.sub('*currentActivity', (val) => {
@@ -1,7 +1,6 @@
1
1
  export class FileUploaderRegular extends SolutionBlock {
2
2
  init$: {
3
3
  isHidden: boolean;
4
- '*solution': string;
5
4
  '*commonProgress': number;
6
5
  '*uploadList': never[];
7
6
  '*uploadQueue': import("@uploadcare/upload-client").Queue;
@@ -9,7 +8,7 @@ export class FileUploaderRegular extends SolutionBlock {
9
8
  '*collectionState': import("./index.js").OutputCollectionState | null;
10
9
  '*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
11
10
  '*uploadTrigger': Set<string>;
12
- '*secureUploadsManager': import("../../../abstract/managers/SecureUploadsManager.js").SecureUploadsManager | null;
11
+ '*secureUploadsManager': import("../../../abstract/SecureUploadsManager.js").SecureUploadsManager | null;
13
12
  '*currentActivity': null;
14
13
  '*currentActivityParams': {};
15
14
  '*history': never[];
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploaderRegular.d.ts","sourceRoot":"","sources":["FileUploaderRegular.js"],"names":[],"mappings":"AAKA;IAMI;;;;;;;;;;;;;;;;MAIC;CAeJ;;;;8BA7B6B,oCAAoC"}
1
+ {"version":3,"file":"FileUploaderRegular.d.ts","sourceRoot":"","sources":["FileUploaderRegular.js"],"names":[],"mappings":"AAIA;IAMI;;;;;;;;;;;;;;;MAGC;CAaJ;;;;8BAzB6B,oCAAoC"}
@@ -1,7 +1,6 @@
1
1
  // @ts-check
2
2
  import { SolutionBlock } from '../../../abstract/SolutionBlock.js';
3
3
  import { asBoolean } from '../../../blocks/Config/validatorsType.js';
4
- import { InternalEventType } from '../../../blocks/UploadCtxProvider/EventEmitter.js';
5
4
 
6
5
  export class FileUploaderRegular extends SolutionBlock {
7
6
  static styleAttrs = [...super.styleAttrs, 'uc-file-uploader-regular'];
@@ -12,15 +11,12 @@ export class FileUploaderRegular extends SolutionBlock {
12
11
  this.init$ = {
13
12
  ...this.init$,
14
13
  isHidden: false,
15
- '*solution': this.tagName,
16
14
  };
17
15
  }
18
16
 
19
17
  initCallback() {
20
18
  super.initCallback();
21
19
 
22
- this.emit(InternalEventType.INIT_SOLUTION, undefined);
23
-
24
20
  this.defineAccessor(
25
21
  'headless',
26
22
  /** @param {unknown} value */ (value) => {
package/types/events.d.ts CHANGED
@@ -2,4 +2,4 @@ import type { EventPayload } from '../blocks/UploadCtxProvider/EventEmitter';
2
2
 
3
3
  export type EventMap = {
4
4
  [T in keyof EventPayload]: CustomEvent<EventPayload[T]>;
5
- };
5
+ };
@@ -1,10 +1,10 @@
1
1
  import type { LocaleDefinition } from '../abstract/localeRegistry';
2
2
  import type { complexConfigKeys } from '../blocks/Config/Config';
3
- import type { FuncFileValidator, FuncCollectionValidator } from '../abstract/managers/ValidationManager';
3
+ import type { FuncFileValidator, FuncCollectionValidator } from '../abstract/ValidationManager';
4
4
  import type { CameraMode } from '../blocks/CameraSource/CameraSource';
5
5
  import type { FilesViewMode } from '../blocks/UploadList/UploadList';
6
6
 
7
- export type { FuncFileValidator, FuncCollectionValidator } from '../abstract/managers/ValidationManager';
7
+ export type { FuncFileValidator, FuncCollectionValidator } from '../abstract/ValidationManager';
8
8
  export type { UploaderPublicApi } from '../abstract/UploaderPublicApi';
9
9
 
10
10
  export type UploadError = import('@uploadcare/upload-client').UploadError;
@@ -300,11 +300,9 @@ export type ConfigType = {
300
300
 
301
301
  cloudImageEditorAutoOpen: boolean;
302
302
 
303
- qualityInsights: boolean;
304
-
305
303
  cloudImageEditorMaskHref: string | null;
306
304
 
307
- /**
305
+ /**
308
306
  * Adds data-testid attributes to the each block. Needed for testing purposes.
309
307
  * @default false
310
308
  */
@@ -316,8 +314,8 @@ export type ConfigAttributesType = KebabCaseKeys<ConfigPlainType> & LowerCaseKey
316
314
 
317
315
  export type KebabCase<S extends string> = S extends `${infer C}${infer T}`
318
316
  ? T extends Uncapitalize<T>
319
- ? `${Uncapitalize<C>}${KebabCase<T>}`
320
- : `${Uncapitalize<C>}-${KebabCase<T>}`
317
+ ? `${Uncapitalize<C>}${KebabCase<T>}`
318
+ : `${Uncapitalize<C>}-${KebabCase<T>}`
321
319
  : S;
322
320
  export type KebabCaseKeys<T extends Record<string, unknown>> = { [Key in keyof T as KebabCase<Key & string>]: T[Key] };
323
321
  export type LowerCase<S extends string> = Lowercase<S>;
@@ -376,17 +374,17 @@ export type OutputErrorTypePayload = {
376
374
 
377
375
  export type OutputError<T extends OutputFileErrorType | OutputCollectionErrorType> = T extends OutputCustomErrorType
378
376
  ? {
379
- type?: T;
380
- message: string;
381
- payload?: OutputErrorTypePayload[T];
382
- }
377
+ type?: T;
378
+ message: string;
379
+ payload?: OutputErrorTypePayload[T];
380
+ }
383
381
  : T extends keyof OutputErrorTypePayload
384
- ? {
385
- type: T;
386
- message: string;
387
- payload?: OutputErrorTypePayload[T];
388
- }
389
- : never;
382
+ ? {
383
+ type: T;
384
+ message: string;
385
+ payload?: OutputErrorTypePayload[T];
386
+ }
387
+ : never;
390
388
 
391
389
  export type OutputErrorFile = OutputError<OutputFileErrorType>;
392
390
 
@@ -408,7 +406,7 @@ export type OutputFileEntry<TStatus extends OutputFileStatus = OutputFileStatus>
408
406
  fullPath: string | null;
409
407
  source: SourceTypes | null;
410
408
  } & (
411
- | {
409
+ | {
412
410
  status: 'success';
413
411
  fileInfo: UploadcareFile;
414
412
  uuid: string;
@@ -420,7 +418,7 @@ export type OutputFileEntry<TStatus extends OutputFileStatus = OutputFileStatus>
420
418
  isRemoved: false;
421
419
  errors: [];
422
420
  }
423
- | {
421
+ | {
424
422
  status: 'failed';
425
423
  fileInfo: UploadcareFile | null;
426
424
  uuid: string | null;
@@ -432,7 +430,7 @@ export type OutputFileEntry<TStatus extends OutputFileStatus = OutputFileStatus>
432
430
  isRemoved: false;
433
431
  errors: OutputError<OutputFileErrorType>[];
434
432
  }
435
- | {
433
+ | {
436
434
  status: 'uploading';
437
435
  fileInfo: null;
438
436
  uuid: null;
@@ -444,7 +442,7 @@ export type OutputFileEntry<TStatus extends OutputFileStatus = OutputFileStatus>
444
442
  isRemoved: false;
445
443
  errors: [];
446
444
  }
447
- | {
445
+ | {
448
446
  status: 'removed';
449
447
  fileInfo: UploadcareFile | null;
450
448
  uuid: string | null;
@@ -456,7 +454,7 @@ export type OutputFileEntry<TStatus extends OutputFileStatus = OutputFileStatus>
456
454
  isRemoved: true;
457
455
  errors: OutputError<OutputFileErrorType>[];
458
456
  }
459
- | {
457
+ | {
460
458
  status: 'idle';
461
459
  fileInfo: null;
462
460
  uuid: null;
@@ -468,7 +466,7 @@ export type OutputFileEntry<TStatus extends OutputFileStatus = OutputFileStatus>
468
466
  isRemoved: false;
469
467
  errors: [];
470
468
  }
471
- );
469
+ );
472
470
 
473
471
  export type OutputCollectionStatus = 'idle' | 'uploading' | 'success' | 'failed';
474
472
 
@@ -492,43 +490,43 @@ export type OutputCollectionState<
492
490
  } & (TGroupFlag extends 'has-group'
493
491
  ? { group: UploadcareGroup }
494
492
  : TGroupFlag extends 'maybe-has-group'
495
- ? { group: UploadcareGroup | null }
496
- : never) &
493
+ ? { group: UploadcareGroup | null }
494
+ : never) &
497
495
  (
498
496
  | {
499
- status: 'idle';
500
- isFailed: false;
501
- isUploading: false;
502
- isSuccess: false;
503
- errors: [];
504
- allEntries: OutputFileEntry<'idle' | 'success'>[];
505
- }
497
+ status: 'idle';
498
+ isFailed: false;
499
+ isUploading: false;
500
+ isSuccess: false;
501
+ errors: [];
502
+ allEntries: OutputFileEntry<'idle' | 'success'>[];
503
+ }
506
504
  | {
507
- status: 'uploading';
508
- isFailed: false;
509
- isUploading: true;
510
- isSuccess: false;
511
- errors: [];
512
- allEntries: OutputFileEntry[];
513
- }
505
+ status: 'uploading';
506
+ isFailed: false;
507
+ isUploading: true;
508
+ isSuccess: false;
509
+ errors: [];
510
+ allEntries: OutputFileEntry[];
511
+ }
514
512
  | {
515
- status: 'success';
516
- isFailed: false;
517
- isUploading: false;
518
- isSuccess: true;
519
- errors: [];
520
- allEntries: OutputFileEntry<'success'>[];
521
- }
513
+ status: 'success';
514
+ isFailed: false;
515
+ isUploading: false;
516
+ isSuccess: true;
517
+ errors: [];
518
+ allEntries: OutputFileEntry<'success'>[];
519
+ }
522
520
  | {
523
- status: 'failed';
524
- isFailed: true;
525
- isUploading: false;
526
- isSuccess: false;
527
- errors: OutputError<OutputCollectionErrorType>[];
528
- allEntries: OutputFileEntry[];
529
- }
521
+ status: 'failed';
522
+ isFailed: true;
523
+ isUploading: false;
524
+ isSuccess: false;
525
+ errors: OutputError<OutputCollectionErrorType>[];
526
+ allEntries: OutputFileEntry[];
527
+ }
530
528
  );
531
529
 
532
530
  export { EventType, EventPayload } from '../blocks/UploadCtxProvider/EventEmitter';
533
531
 
534
- export {};
532
+ export { };
package/types/jsx.d.ts CHANGED
@@ -22,6 +22,8 @@ declare namespace JSX {
22
22
  interface IntrinsicElements {
23
23
  'uc-crop-frame': any;
24
24
  'uc-editor-crop-button-control': any;
25
+ 'uc-editor-aspect-ratio-button-control': any;
26
+ 'uc-editor-freeform-button-control': any;
25
27
  'uc-editor-filter-control': any;
26
28
  'uc-editor-operation-control': any;
27
29
  'uc-editor-image-cropper': any;
@@ -1 +1 @@
1
- {"version":3,"file":"parseCdnUrl.d.ts","sourceRoot":"","sources":["parseCdnUrl.js"],"names":[],"mappings":"AAIO,8CADK;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE;;;;SAgB3C"}
1
+ {"version":3,"file":"parseCdnUrl.d.ts","sourceRoot":"","sources":["parseCdnUrl.js"],"names":[],"mappings":"AAMO,8CADK;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE;;;;SAiB3C"}
@@ -1,12 +1,15 @@
1
+ import { DEFAULT_CDN_CNAME } from '../blocks/Config/initialConfig.js';
2
+
1
3
  const uuidRegex = /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/i;
2
4
  const cdnUrlRegex = new RegExp(`^/?(${uuidRegex.source})(?:/(-/(?:[^/]+/)+)?([^/]*))?$`, 'i');
3
5
 
4
6
  /** @param {{ url: string; cdnBase: string }} options */
5
7
  export const parseCdnUrl = ({ url, cdnBase }) => {
6
8
  const cdnBaseUrlObj = new URL(cdnBase);
9
+ const fallbackCdnBaseUrlObj = new URL(DEFAULT_CDN_CNAME);
7
10
  const urlObj = new URL(url);
8
11
 
9
- if (cdnBaseUrlObj.host !== urlObj.host) {
12
+ if (cdnBaseUrlObj.host !== urlObj.host && fallbackCdnBaseUrlObj.host !== urlObj.host) {
10
13
  return null;
11
14
  }
12
15
 
@@ -75,4 +75,17 @@ describe('parseCdnUrl', () => {
75
75
  filename: null,
76
76
  });
77
77
  });
78
+
79
+ it('should fallback to ucarecdn.com if cdnBase is not matched', () => {
80
+ expect(
81
+ parseCdnUrl({
82
+ url: 'https://ucarecdn.com/12345678-1234-5678-1234-567812345678/',
83
+ cdnBase: 'https://cdn.example.com',
84
+ }),
85
+ ).to.deep.equal({
86
+ uuid: '12345678-1234-5678-1234-567812345678',
87
+ cdnUrlModifiers: '',
88
+ filename: null,
89
+ });
90
+ });
78
91
  });
@@ -1,3 +1,3 @@
1
- /** @type {import('../../../abstract/managers/ValidationManager.js').FuncCollectionValidator} */
2
- export const validateCollectionUploadError: import("../../../abstract/managers/ValidationManager.js").FuncCollectionValidator;
1
+ /** @type {import('../../../abstract/ValidationManager.js').FuncCollectionValidator} */
2
+ export const validateCollectionUploadError: import("../../../abstract/ValidationManager.js").FuncCollectionValidator;
3
3
  //# sourceMappingURL=validateCollectionUploadError.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validateCollectionUploadError.d.ts","sourceRoot":"","sources":["validateCollectionUploadError.js"],"names":[],"mappings":"AAEA,gGAAgG;AAChG,4CADW,OAAO,iDAAiD,EAAE,uBAAuB,CAQ1F"}
1
+ {"version":3,"file":"validateCollectionUploadError.d.ts","sourceRoot":"","sources":["validateCollectionUploadError.js"],"names":[],"mappings":"AAEA,uFAAuF;AACvF,4CADW,OAAO,wCAAwC,EAAE,uBAAuB,CAQjF"}