@uploadcare/file-uploader 1.19.4-alpha.2 → 1.19.4-alpha.3

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.
package/abstract/CTX.d.ts CHANGED
@@ -10,7 +10,8 @@ export function uploaderBlockCtx(fnCtx: import("./Block").Block): {
10
10
  '*commonProgress': number;
11
11
  '*uploadList': never[];
12
12
  '*uploadQueue': Queue;
13
- '*collectionErrors': import("../types").OutputErrorCollection[];
13
+ /** @type {ReturnType<() => import('../types').OutputErrorCollection>[]} */
14
+ '*collectionErrors': ReturnType<() => import("../types").OutputErrorCollection>[];
14
15
  /** @type {import('../types').OutputCollectionState | null} */
15
16
  '*collectionState': import("../types").OutputCollectionState | null;
16
17
  /** @type {import('@uploadcare/upload-client').UploadcareGroup | null} */
@@ -1 +1 @@
1
- {"version":3,"file":"CTX.d.ts","sourceRoot":"","sources":["CTX.js"],"names":[],"mappings":"AAGO,+BAA2B;AAG3B,wCADK,OAAO,SAAS,EAAE,KAAK;;;;;;EAejC;AAGK,wCADK,OAAO,SAAS,EAAE,KAAK;;;;yBAMD,OAAO,UAAU,EAAE,qBAAqB,EAAE;IAC1E,8DAA8D;wBAAnD,OAAO,UAAU,EAAE,qBAAqB,GAAG,IAAI;IAE1D,yEAAyE;kBAA9D,OAAO,2BAA2B,EAAE,eAAe,GAAG,IAAI;IAErE,0BAA0B;sBAAf,GAAG,CAAC,MAAM,CAAC;IAEtB,8EAA8E;6BAAnE,OAAO,2BAA2B,EAAE,oBAAoB,GAAG,IAAI;;;;;;EAE1E;sBApCoB,2BAA2B"}
1
+ {"version":3,"file":"CTX.d.ts","sourceRoot":"","sources":["CTX.js"],"names":[],"mappings":"AAGO,+BAA2B;AAG3B,wCADK,OAAO,SAAS,EAAE,KAAK;;;;;;EAejC;AAGK,wCADK,OAAO,SAAS,EAAE,KAAK;;;;IAMjC,2EAA2E;yBAAhE,UAAU,CAAC,MAAM,OAAO,UAAU,EAAE,qBAAqB,CAAC,EAAE;IAEvE,8DAA8D;wBAAnD,OAAO,UAAU,EAAE,qBAAqB,GAAG,IAAI;IAE1D,yEAAyE;kBAA9D,OAAO,2BAA2B,EAAE,eAAe,GAAG,IAAI;IAErE,0BAA0B;sBAAf,GAAG,CAAC,MAAM,CAAC;IAEtB,8EAA8E;6BAAnE,OAAO,2BAA2B,EAAE,oBAAoB,GAAG,IAAI;;;;;;EAE1E;sBArCoB,2BAA2B"}
package/abstract/CTX.js CHANGED
@@ -26,7 +26,8 @@ export const uploaderBlockCtx = (fnCtx) => ({
26
26
  '*commonProgress': 0,
27
27
  '*uploadList': [],
28
28
  '*uploadQueue': new Queue(1),
29
- '*collectionErrors': /** @type {import('../types').OutputErrorCollection[]} */ ([]),
29
+ /** @type {ReturnType<() => import('../types').OutputErrorCollection>[]} */
30
+ '*collectionErrors': [],
30
31
  /** @type {import('../types').OutputCollectionState | null} */
31
32
  '*collectionState': null,
32
33
  /** @type {import('@uploadcare/upload-client').UploadcareGroup | null} */
@@ -5,7 +5,7 @@ export class SolutionBlock extends Block {
5
5
  '*commonProgress': number;
6
6
  '*uploadList': never[];
7
7
  '*uploadQueue': import("@uploadcare/upload-client").Queue;
8
- '*collectionErrors': import("../index.js").OutputErrorCollection[];
8
+ '*collectionErrors': ReturnType<() => import("../index.js").OutputErrorCollection>[];
9
9
  '*collectionState': import("../index.js").OutputCollectionState | null;
10
10
  '*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
11
11
  '*uploadTrigger': Set<string>;
@@ -7,7 +7,7 @@ export class UploaderBlock extends ActivityBlock {
7
7
  '*commonProgress': number;
8
8
  '*uploadList': never[];
9
9
  '*uploadQueue': import("@uploadcare/upload-client").Queue;
10
- '*collectionErrors': import("../types").OutputErrorCollection[];
10
+ '*collectionErrors': ReturnType<() => import("../types").OutputErrorCollection>[];
11
11
  '*collectionState': import("../types").OutputCollectionState | null;
12
12
  '*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
13
13
  '*uploadTrigger': Set<string>;
@@ -43,7 +43,7 @@ export function buildOutputCollectionState(uploaderBlock) {
43
43
  progress: () => {
44
44
  return uploaderBlock.$['*commonProgress'];
45
45
  },
46
- /** @returns {ReturnType<import('../types').OutputErrorFile>[]} */
46
+ /** @returns {ReturnType<() => import('../types').OutputErrorFile>[]} */
47
47
  errors: () => {
48
48
  return uploaderBlock.$['*collectionErrors'];
49
49
  },
@@ -64,7 +64,7 @@ export class CameraSource extends UploaderBlock {
64
64
  '*commonProgress': number;
65
65
  '*uploadList': never[];
66
66
  '*uploadQueue': import("@uploadcare/upload-client").Queue;
67
- '*collectionErrors': import("../../index.js").OutputErrorCollection[];
67
+ '*collectionErrors': ReturnType<() => import("../../index.js").OutputErrorCollection>[];
68
68
  '*collectionState': import("../../index.js").OutputCollectionState | null;
69
69
  '*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
70
70
  '*uploadTrigger': Set<string>;
@@ -12,7 +12,7 @@ export class DropArea extends UploaderBlock {
12
12
  '*commonProgress': number;
13
13
  '*uploadList': never[];
14
14
  '*uploadQueue': import("@uploadcare/upload-client").Queue;
15
- '*collectionErrors': import("../../index.js").OutputErrorCollection[];
15
+ '*collectionErrors': ReturnType<() => import("../../index.js").OutputErrorCollection>[];
16
16
  '*collectionState': import("../../index.js").OutputCollectionState | null;
17
17
  '*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
18
18
  '*uploadTrigger': Set<string>;
@@ -22,7 +22,7 @@ export class ExternalSource extends UploaderBlock {
22
22
  '*commonProgress': number;
23
23
  '*uploadList': never[];
24
24
  '*uploadQueue': import("@uploadcare/upload-client").Queue;
25
- '*collectionErrors': import("../../index.js").OutputErrorCollection[];
25
+ '*collectionErrors': ReturnType<() => import("../../index.js").OutputErrorCollection>[];
26
26
  '*collectionState': import("../../index.js").OutputCollectionState | null;
27
27
  '*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
28
28
  '*uploadTrigger': Set<string>;
@@ -24,7 +24,7 @@ export class FileItem extends FileItemConfig {
24
24
  '*commonProgress': number;
25
25
  '*uploadList': never[];
26
26
  '*uploadQueue': import("@uploadcare/upload-client").Queue;
27
- '*collectionErrors': import("../../index.js").OutputErrorCollection[];
27
+ '*collectionErrors': ReturnType<() => import("../../index.js").OutputErrorCollection>[];
28
28
  '*collectionState': import("../../index.js").OutputCollectionState | null;
29
29
  '*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
30
30
  '*uploadTrigger': Set<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"ImgBase.d.ts","sourceRoot":"","sources":["ImgBase.js"],"names":[],"mappings":"AAgBA;IACE,uBAAmB;IACnB,8BAA0B;IAE1B;;;OAGG;IACH,gBAMC;IAED;;;;;OAKG;IACH,8BAFa,eAAe,CAoB3B;IAED;;;;;OAKG;IACH,uDAWC;IAED;;;;;OAKG;IACH,oBA+DC;IAED;;;;OAIG;IACH,kBAUC;IAED;;;;OAIG;IACH,eAJW,WAAW,8CAcrB;IAED,oCAAoC;IACpC,sBADY,gBAAgB,QAY3B;IAED,+BAA+B;IAC/B,WADW,gBAAgB,CAO1B;IAED;;;;;;MAUC;IAED,2BAEC;IAED,sBAEC;IAED,mCAOC;IAED,4BAEC;IAED,8BAA8B;IAC9B,aADY,WAAW,QAgBtB;IAED,oBAsBC;IAED,cAEC;IAED,yBAEC;IAED,yBAUC;IAED;;;;aAQC;IAED;;aAGC;IAED;;;;qBAqBC;IAED,6BA8DC;IAED,aAMC;CACF;0BApZyB,gBAAgB"}
1
+ {"version":3,"file":"ImgBase.d.ts","sourceRoot":"","sources":["ImgBase.js"],"names":[],"mappings":"AAgBA;IACE,uBAAmB;IACnB,8BAA0B;IAE1B;;;OAGG;IACH,gBAMC;IAED;;;;;OAKG;IACH,8BAFa,eAAe,CAoB3B;IAED;;;;;OAKG;IACH,uDAWC;IAED;;;;;OAKG;IACH,oBA6DC;IAED;;;;OAIG;IACH,kBAUC;IAED;;;;OAIG;IACH,eAJW,WAAW,8CAcrB;IAED,oCAAoC;IACpC,sBADY,gBAAgB,QAY3B;IAED,+BAA+B;IAC/B,WADW,gBAAgB,CAO1B;IAED;;;;;;MAUC;IAED,2BAEC;IAED,sBAEC;IAED,mCAOC;IAED,4BAEC;IAED,8BAA8B;IAC9B,aADY,WAAW,QAgBtB;IAED,oBAsBC;IAED,cAEC;IAED,yBAEC;IAED,yBAUC;IAED;;;;aAQC;IAED;;aAGC;IAED;;;;qBAqBC;IAED,6BA8DC;IAED,aAMC;CACF;0BAlZyB,gBAAgB"}
@@ -87,11 +87,9 @@ export class ImgBase extends ImgConfig {
87
87
  }
88
88
 
89
89
  // Localhost + relative image path (DO NOTHING):
90
- // if (DEV_MODE && this.$$('src') && !this.$$('src').includes('//')) {
91
- // return this._proxyUrl(this.$$('src'));
92
- // }
93
-
94
- console.log({ self: this });
90
+ if (DEV_MODE && this.$$('src') && !this.$$('src').includes('//')) {
91
+ return this._proxyUrl(this.$$('src'));
92
+ }
95
93
 
96
94
  let cdnModifiers = this._getCdnModifiers(size, blur);
97
95
 
@@ -6,7 +6,7 @@ export class SimpleBtn extends UploaderBlock {
6
6
  '*commonProgress': number;
7
7
  '*uploadList': never[];
8
8
  '*uploadQueue': import("@uploadcare/upload-client").Queue;
9
- '*collectionErrors': import("../../index.js").OutputErrorCollection[];
9
+ '*collectionErrors': ReturnType<() => import("../../index.js").OutputErrorCollection>[];
10
10
  '*collectionState': import("../../index.js").OutputCollectionState | null;
11
11
  '*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
12
12
  '*uploadTrigger': Set<string>;
@@ -22,7 +22,7 @@ export class SourceBtn extends UploaderBlock {
22
22
  '*commonProgress': number;
23
23
  '*uploadList': never[];
24
24
  '*uploadQueue': import("@uploadcare/upload-client").Queue;
25
- '*collectionErrors': import("../../index.js").OutputErrorCollection[];
25
+ '*collectionErrors': ReturnType<() => import("../../index.js").OutputErrorCollection>[];
26
26
  '*collectionState': import("../../index.js").OutputCollectionState | null;
27
27
  '*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
28
28
  '*uploadTrigger': Set<string>;
@@ -15,7 +15,7 @@ export class Thumb extends FileItemConfig {
15
15
  '*commonProgress': number;
16
16
  '*uploadList': never[];
17
17
  '*uploadQueue': import("@uploadcare/upload-client").Queue;
18
- '*collectionErrors': import("../../index.js").OutputErrorCollection[];
18
+ '*collectionErrors': ReturnType<() => import("../../index.js").OutputErrorCollection>[];
19
19
  '*collectionState': import("../../index.js").OutputCollectionState | null;
20
20
  '*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
21
21
  '*uploadTrigger': Set<string>;
@@ -25,7 +25,7 @@ export class UploadList extends UploaderBlock {
25
25
  '*commonProgress': number;
26
26
  '*uploadList': never[];
27
27
  '*uploadQueue': import("@uploadcare/upload-client").Queue;
28
- '*collectionErrors': import("../../types").OutputErrorCollection[];
28
+ '*collectionErrors': ReturnType<() => import("../../types").OutputErrorCollection>[];
29
29
  '*collectionState': import("../../types").OutputCollectionState | null;
30
30
  '*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
31
31
  '*uploadTrigger': Set<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uploadcare/file-uploader",
3
- "version": "1.19.4-alpha.2",
3
+ "version": "1.19.4-alpha.3",
4
4
  "description": "Building blocks for Uploadcare products integration",
5
5
  "keywords": [
6
6
  "web components",
@@ -5,7 +5,7 @@ export class FileUploaderInline extends SolutionBlock {
5
5
  '*commonProgress': number;
6
6
  '*uploadList': never[];
7
7
  '*uploadQueue': import("@uploadcare/upload-client").Queue;
8
- '*collectionErrors': import("./index.js").OutputErrorCollection[];
8
+ '*collectionErrors': ReturnType<() => import("./index.js").OutputErrorCollection>[];
9
9
  '*collectionState': import("./index.js").OutputCollectionState | null;
10
10
  '*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
11
11
  '*uploadTrigger': Set<string>;
@@ -7,7 +7,7 @@ export class FileUploaderMinimal extends SolutionBlock {
7
7
  '*commonProgress': number;
8
8
  '*uploadList': never[];
9
9
  '*uploadQueue': import("@uploadcare/upload-client").Queue;
10
- '*collectionErrors': import("./index.js").OutputErrorCollection[];
10
+ '*collectionErrors': ReturnType<() => import("./index.js").OutputErrorCollection>[];
11
11
  '*collectionState': import("./index.js").OutputCollectionState | null;
12
12
  '*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
13
13
  '*uploadTrigger': Set<string>;
@@ -62,14 +62,9 @@
62
62
  width: 100%;
63
63
  height: unset;
64
64
  padding: 4px;
65
-
66
- background-color: transparent;
67
- /* border: 1px dashed var(--uc-border); */
68
- /* border-radius: calc(var(--uc-radius) * 1.75); */
69
- }
70
-
71
- [uc-file-uploader-minimal] uc-upload-list uc-file-item {
72
65
  background-color: var(--uc-background);
66
+ border: 1px dashed var(--uc-border);
67
+ border-radius: calc(var(--uc-radius) * 1.75);
73
68
  }
74
69
 
75
70
  [uc-file-uploader-minimal] uc-upload-list .uc-files {
@@ -150,10 +145,3 @@
150
145
  [uc-file-uploader-minimal][mode='grid'] uc-upload-list .uc-files .uc-add-more-btn > uc-icon {
151
146
  display: flex;
152
147
  }
153
-
154
- /*
155
- https://86beff04885a8328d3b0.ucr.io/-/resize/100x/-/blur/100/-/@clib/blocks/1.19.3/uc-img/https://cdn.skyledge.com/7c2e222b-1857-4363-b531-408f4a650c99/?token=exp=1753085298~acl=/7c2e222b-1857-4363-b531-408f4a650c99/*~hmac=redacted
156
- */
157
-
158
- /* https://aadfab151dfea016a1b0.ucr.io/https://files.buildwithfern.com/uploadcare.docs.buildwithfern.com/docs/2025-07-18T10:45:26.503Z/assets/logo-light.svg
159
- https://8ffef950a74ff210dafb.ucr.io/https://files.buildwithfern.com/uploadcare.docs.buildwithfern.com/docs/2025-07-18T10:45:26.503Z/assets/logo-light.svg */
@@ -4,7 +4,7 @@ export class FileUploaderRegular extends SolutionBlock {
4
4
  '*commonProgress': number;
5
5
  '*uploadList': never[];
6
6
  '*uploadQueue': import("@uploadcare/upload-client").Queue;
7
- '*collectionErrors': import("./index.js").OutputErrorCollection[];
7
+ '*collectionErrors': ReturnType<() => import("./index.js").OutputErrorCollection>[];
8
8
  '*collectionState': import("./index.js").OutputCollectionState | null;
9
9
  '*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
10
10
  '*uploadTrigger': Set<string>;
@@ -323,8 +323,10 @@ export type LowerCaseKeys<T extends Record<string, unknown>> = { [Key in keyof T
323
323
 
324
324
  export type OutputFileStatus = 'idle' | 'uploading' | 'success' | 'failed' | 'removed';
325
325
 
326
+ export type OutputCustomErrorType = 'CUSTOM_ERROR';
327
+
326
328
  export type OutputFileErrorType =
327
- | 'CUSTOM_ERROR'
329
+ | OutputCustomErrorType
328
330
  | 'NOT_AN_IMAGE'
329
331
  | 'FORBIDDEN_FILE_TYPE'
330
332
  | 'FILE_SIZE_EXCEEDED'
@@ -332,7 +334,11 @@ export type OutputFileErrorType =
332
334
  | 'NETWORK_ERROR'
333
335
  | 'UNKNOWN_ERROR';
334
336
 
335
- export type OutputCollectionErrorType = 'CUSTOM_ERROR' | 'SOME_FILES_HAS_ERRORS' | 'TOO_MANY_FILES' | 'TOO_FEW_FILES';
337
+ export type OutputCollectionErrorType =
338
+ | OutputCustomErrorType
339
+ | 'SOME_FILES_HAS_ERRORS'
340
+ | 'TOO_MANY_FILES'
341
+ | 'TOO_FEW_FILES';
336
342
 
337
343
  export type OutputFileErrorPayload = {
338
344
  entry: OutputFileEntry;
@@ -366,7 +372,7 @@ export type OutputErrorTypePayload = {
366
372
  CUSTOM_ERROR: Record<string, unknown>;
367
373
  };
368
374
 
369
- export type OutputError<T extends OutputFileErrorType | OutputCollectionErrorType> = T extends 'CUSTOM_ERROR'
375
+ export type OutputError<T extends OutputFileErrorType | OutputCollectionErrorType> = T extends OutputCustomErrorType
370
376
  ? {
371
377
  type: T;
372
378
  message: string;