@uploadcare/file-uploader 1.15.0-alpha.0 → 1.15.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,6 +56,7 @@ export class UploaderBlock extends ActivityBlock {
56
56
  private _handleCollectionPropertiesUpdate;
57
57
  /** @private */
58
58
  private _flushCommonUploadProgress;
59
+ openCloudImageEditor(): void;
59
60
  /** @private */
60
61
  private setInitialCrop;
61
62
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"UploaderBlock.d.ts","sourceRoot":"","sources":["UploaderBlock.js"],"names":[],"mappings":"AAmBA;IACE,iBAAiB;IACjB,mCAAwB;IAExB,eAAe;IACf,mBAAmB;IAEnB;;;;;;;;;;;;;;MAA+B;IAE/B,eAAe;IACf,0BAOC;IA2BD;;;OAGG;IACH,qDAKC;IAED,mCAAmC;IACnC,6BAKC;IAED,4BAEC;IAED,iCAAiC;IACjC,wCAKC;IAYD,eAAe;IACf,qBAkBC;IAfC,eAAe;IACf,6BAAiG;IAEjG,eAAe;IACf,uCAEC;IAWH;;;OAGG;IACH,qBAkBC;IAED,eAAe;IACf,0BAYQ;IAER;;;;OAIG;IACH,gCAiCE;IAEF;;;OAGG;IACH,0CAyFE;IAEF,eAAe;IACf,mCAoBE;IAEF,eAAe;IACf,uBAwCC;IAED;;;OAGG;IACH,kCAHW,MAAM,qEAWhB;IAED;;;OAGG;IACH,oCAHa,QAAQ,OAAO,2BAA2B,EAAE,eAAe,CAAC,CA2BxE;IAED,kEAAkE;IAClE,iBADc,OAAO,sBAAsB,EAAE,eAAe,EAAE,CAK7D;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BA9Z6B,oBAAoB;qCAWb,2BAA2B;kCAG9B,wBAAwB;kCADxB,wBAAwB;gCAD1B,sBAAsB"}
1
+ {"version":3,"file":"UploaderBlock.d.ts","sourceRoot":"","sources":["UploaderBlock.js"],"names":[],"mappings":"AAmBA;IACE,iBAAiB;IACjB,mCAAwB;IAExB,eAAe;IACf,mBAAmB;IAEnB;;;;;;;;;;;;;;MAA+B;IAE/B,eAAe;IACf,0BAOC;IA2BD;;;OAGG;IACH,qDAKC;IAED,mCAAmC;IACnC,6BAKC;IAED,4BAEC;IAED,iCAAiC;IACjC,wCAKC;IAYD,eAAe;IACf,qBAkBC;IAfC,eAAe;IACf,6BAAiG;IAEjG,eAAe;IACf,uCAEC;IAWH;;;OAGG;IACH,qBAkBC;IAED,eAAe;IACf,0BAYQ;IAER;;;;OAIG;IACH,gCAiCE;IAEF;;;OAGG;IACH,0CA6FE;IAEF,eAAe;IACf,mCAoBE;IAEF,6BAiBC;IAED,eAAe;IACf,uBAwCC;IAED;;;OAGG;IACH,kCAHW,MAAM,qEAWhB;IAED;;;OAGG;IACH,oCAHa,QAAQ,OAAO,2BAA2B,EAAE,eAAe,CAAC,CA2BxE;IAED,kEAAkE;IAClE,iBADc,OAAO,sBAAsB,EAAE,eAAe,EAAE,CAK7D;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BArb6B,oBAAoB;qCAWb,2BAA2B;kCAG9B,wBAAwB;kCADxB,wBAAwB;gCAD1B,sBAAsB"}
@@ -253,6 +253,10 @@ export class UploaderBlock extends ActivityBlock {
253
253
  if (this.cfg.cropPreset) {
254
254
  this.setInitialCrop();
255
255
  }
256
+
257
+ if (this.cfg.usePreviewImage) {
258
+ this.openCloudImageEditor();
259
+ }
256
260
  }
257
261
  if (changeMap.errors) {
258
262
  for (const entryId of changeMap.errors) {
@@ -320,6 +324,25 @@ export class UploaderBlock extends ActivityBlock {
320
324
  );
321
325
  };
322
326
 
327
+ openCloudImageEditor() {
328
+ const [entry] = this.uploadCollection
329
+ .findItems((entry) => entry.getValue('fileInfo') && entry.getValue('isImage'))
330
+ .map((id) => this.uploadCollection.read(id));
331
+
332
+ if (
333
+ entry &&
334
+ this.uploadCollection.size === 1 &&
335
+ this.cfg.useCloudImageEditor &&
336
+ this.hasBlockInCtx((block) => block.activityType === ActivityBlock.activities.CLOUD_IMG_EDIT)
337
+ ) {
338
+ this.$['*currentActivityParams'] = {
339
+ internalId: entry.uid,
340
+ };
341
+ this.$['*currentActivity'] = ActivityBlock.activities.CLOUD_IMG_EDIT;
342
+ this.modalManager.open(ActivityBlock.activities.CLOUD_IMG_EDIT);
343
+ }
344
+ }
345
+
323
346
  /** @private */
324
347
  setInitialCrop() {
325
348
  const cropPreset = parseCropPreset(this.cfg.cropPreset);
@@ -356,8 +379,8 @@ export class UploaderBlock extends ActivityBlock {
356
379
  this.$['*currentActivityParams'] = {
357
380
  internalId: entry.uid,
358
381
  };
359
- this.modalManager.open(ActivityBlock.activities.CLOUD_IMG_EDIT);
360
382
  this.$['*currentActivity'] = ActivityBlock.activities.CLOUD_IMG_EDIT;
383
+ this.modalManager.open(ActivityBlock.activities.CLOUD_IMG_EDIT);
361
384
  }
362
385
  }
363
386
  }
@@ -64,6 +64,6 @@ declare class ConfigClass extends Block {
64
64
  }
65
65
  import { Block } from '../../abstract/Block.js';
66
66
  /** Mapping of attribute names to state */
67
- declare const attrStateMapping: Record<"accept" | "pubkey" | "multiple" | "store" | "debug" | "crop-preset" | "secure-expire" | "max-local-file-size-bytes" | "multiple-min" | "multiple-max" | "confirm-upload" | "img-only" | "external-sources-preferred-types" | "external-sources-embed-css" | "camera-mirror" | "camera-capture" | "source-list" | "thumb-size" | "show-empty-list" | "use-local-image-editor" | "use-cloud-image-editor" | "cloud-image-editor-tabs" | "remove-copyright" | "image-shrink" | "modal-scroll-lock" | "modal-backdrop-strokes" | "source-list-wrap" | "remote-tab-session-key" | "cdn-cname" | "base-url" | "social-base-url" | "secure-signature" | "secure-delivery-proxy" | "retry-throttled-request-max-times" | "multipart-min-file-size" | "multipart-chunk-size" | "max-concurrent-requests" | "multipart-max-concurrent-requests" | "multipart-max-attempts" | "check-for-url-duplicates" | "save-url-for-recurrent-uploads" | "group-output" | "user-agent-integration" | "locale-name" | "secure-uploads-expire-threshold" | "camera-modes" | "default-camera-mode" | "enable-audio-recording" | "enable-video-recording" | "max-video-recording-duration" | "display-upload-list" | "enable-file-name" | "secureexpire" | "croppreset" | "maxlocalfilesizebytes" | "multiplemin" | "multiplemax" | "confirmupload" | "imgonly" | "externalsourcespreferredtypes" | "externalsourcesembedcss" | "cameramirror" | "cameracapture" | "sourcelist" | "thumbsize" | "showemptylist" | "uselocalimageeditor" | "usecloudimageeditor" | "cloudimageeditortabs" | "removecopyright" | "imageshrink" | "modalscrolllock" | "modalbackdropstrokes" | "sourcelistwrap" | "remotetabsessionkey" | "cdncname" | "baseurl" | "socialbaseurl" | "securesignature" | "securedeliveryproxy" | "retrythrottledrequestmaxtimes" | "multipartminfilesize" | "multipartchunksize" | "maxconcurrentrequests" | "multipartmaxconcurrentrequests" | "multipartmaxattempts" | "checkforurlduplicates" | "saveurlforrecurrentuploads" | "groupoutput" | "useragentintegration" | "localename" | "secureuploadsexpirethreshold" | "cameramodes" | "defaultcameramode" | "enableaudiorecording" | "enablevideorecording" | "maxvideorecordingduration" | "displayuploadlist" | "enablefilename", string>;
67
+ declare const attrStateMapping: Record<"accept" | "pubkey" | "multiple" | "store" | "debug" | "crop-preset" | "secure-expire" | "max-local-file-size-bytes" | "multiple-min" | "multiple-max" | "confirm-upload" | "img-only" | "external-sources-preferred-types" | "external-sources-embed-css" | "camera-mirror" | "camera-capture" | "source-list" | "thumb-size" | "show-empty-list" | "use-local-image-editor" | "use-cloud-image-editor" | "cloud-image-editor-tabs" | "remove-copyright" | "image-shrink" | "modal-scroll-lock" | "modal-backdrop-strokes" | "source-list-wrap" | "remote-tab-session-key" | "cdn-cname" | "base-url" | "social-base-url" | "secure-signature" | "secure-delivery-proxy" | "retry-throttled-request-max-times" | "multipart-min-file-size" | "multipart-chunk-size" | "max-concurrent-requests" | "multipart-max-concurrent-requests" | "multipart-max-attempts" | "check-for-url-duplicates" | "save-url-for-recurrent-uploads" | "group-output" | "user-agent-integration" | "locale-name" | "secure-uploads-expire-threshold" | "camera-modes" | "default-camera-mode" | "enable-audio-recording" | "enable-video-recording" | "max-video-recording-duration" | "display-upload-list" | "enable-file-name" | "use-preview-image" | "secureexpire" | "croppreset" | "maxlocalfilesizebytes" | "multiplemin" | "multiplemax" | "confirmupload" | "imgonly" | "externalsourcespreferredtypes" | "externalsourcesembedcss" | "cameramirror" | "cameracapture" | "sourcelist" | "thumbsize" | "showemptylist" | "uselocalimageeditor" | "usecloudimageeditor" | "cloudimageeditortabs" | "removecopyright" | "imageshrink" | "modalscrolllock" | "modalbackdropstrokes" | "sourcelistwrap" | "remotetabsessionkey" | "cdncname" | "baseurl" | "socialbaseurl" | "securesignature" | "securedeliveryproxy" | "retrythrottledrequestmaxtimes" | "multipartminfilesize" | "multipartchunksize" | "maxconcurrentrequests" | "multipartmaxconcurrentrequests" | "multipartmaxattempts" | "checkforurlduplicates" | "saveurlforrecurrentuploads" | "groupoutput" | "useragentintegration" | "localename" | "secureuploadsexpirethreshold" | "cameramodes" | "defaultcameramode" | "enableaudiorecording" | "enablevideorecording" | "maxvideorecordingduration" | "displayuploadlist" | "enablefilename" | "usepreviewimage", string>;
68
68
  export {};
69
69
  //# sourceMappingURL=Config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["Config.js"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;GAaG;AACH,gCAXU;IACT,UAAc;IACd,0BAA8B;IAC9B,gCAAoC;IACpC,gCAAoC;IACpC,kBAAsB;IACtB,gBAAoB;IACpB,sBAA0B;IAC1B,sBAA0B;CACvB,CAWF;qBAyNY,OAAO,2BAA2B,EAAE,UAAU,CAAC,kBAAkB,EAAE,OAAO,aAAa,EAAE,UAAU,CAAC;AAAlH,6HAA6H;AAG7H,4BAAmF;AA/LnF;IAkBE;;;;OAIG;IACH,+BAYC;IAED;;;;OAIG;IACH,2BAQC;IAED;;;;OAIG;IACH,kBAyBC;IAED;;;OAGG;IACH,kBAIC;IAED;;;;OAIG;IACH,wCAJW,MAAM,iBACN,OAAO,aACP,OAAO,QAoBjB;IA0CD;;;;OAIG;IACH,+BAJW,MAAM,uBAAuB,UAC7B,MAAM,UACN,MAAM,QAahB;CACF;sBAjPqB,yBAAyB;AAwD/C,0CAA0C;AAC1C,4rEAGG"}
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["Config.js"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;GAaG;AACH,gCAXU;IACT,UAAc;IACd,0BAA8B;IAC9B,gCAAoC;IACpC,gCAAoC;IACpC,kBAAsB;IACtB,gBAAoB;IACpB,sBAA0B;IAC1B,sBAA0B;CACvB,CAWF;qBAyNY,OAAO,2BAA2B,EAAE,UAAU,CAAC,kBAAkB,EAAE,OAAO,aAAa,EAAE,UAAU,CAAC;AAAlH,6HAA6H;AAG7H,4BAAmF;AA/LnF;IAkBE;;;;OAIG;IACH,+BAYC;IAED;;;;OAIG;IACH,2BAQC;IAED;;;;OAIG;IACH,kBAyBC;IAED;;;OAGG;IACH,kBAIC;IAED;;;;OAIG;IACH,wCAJW,MAAM,iBACN,OAAO,aACP,OAAO,QAoBjB;IA0CD;;;;OAIG;IACH,+BAJW,MAAM,uBAAuB,UAC7B,MAAM,UACN,MAAM,QAahB;CACF;sBAjPqB,yBAAyB;AAwD/C,0CAA0C;AAC1C,suEAGG"}
@@ -1 +1 @@
1
- {"version":3,"file":"initialConfig.d.ts","sourceRoot":"","sources":["initialConfig.js"],"names":[],"mappings":"AAKA,uDAAwD;AACxD,+DAAgE;AAChE,sEAAuE;AAEvE,wDAAwD;AACxD,4BADW,OAAO,sBAAsB,EAAE,UAAU,CAsElD"}
1
+ {"version":3,"file":"initialConfig.d.ts","sourceRoot":"","sources":["initialConfig.js"],"names":[],"mappings":"AAKA,uDAAwD;AACxD,+DAAgE;AAChE,sEAAuE;AAEvE,wDAAwD;AACxD,4BADW,OAAO,sBAAsB,EAAE,UAAU,CAuElD"}
@@ -77,4 +77,5 @@ export const initialConfig = {
77
77
 
78
78
  displayUploadList: 'grid',
79
79
  enableFileName: false,
80
+ usePreviewImage: false,
80
81
  };
@@ -187,8 +187,8 @@ const mapping = {
187
187
  maxVideoRecordingDuration: asNumber,
188
188
 
189
189
  displayUploadList: asString,
190
-
191
190
  enableFileName: asBoolean,
191
+ usePreviewImage: asBoolean,
192
192
  };
193
193
 
194
194
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["Modal.js"],"names":[],"mappings":"AAIA;IAEE,kCAAoC;IAIlC;;;;MAKC;IAGH,iCAEE;IAEF,yBAQE;IAEF,+BAEE;IAEF,uBAAuB;IACvB,4BADY,KAAK,UAIf;IAFA,eAAe;IACf,yBAAgC;IAGlC,uBAAuB;IACvB,0BADY,KAAK,UAKf;IAEF,aAWC;IAED,aAOC;CA8CF;;;;sBAlHqB,yBAAyB"}
1
+ {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["Modal.js"],"names":[],"mappings":"AAIA;IAEE,kCAAoC;IAIlC;;;;MAKC;IAGH,iCAEE;IAEF,yBAME;IAEF,+BAEE;IAEF,uBAAuB;IACvB,4BADY,KAAK,UAIf;IAFA,eAAe;IACf,yBAAgC;IAGlC,uBAAuB;IACvB,0BADY,KAAK,UAKf;IAEF,aAWC;IAED,aAOC;CA8CF;;;;sBAhHqB,yBAAyB"}
@@ -21,8 +21,6 @@ export class Modal extends Block {
21
21
  };
22
22
 
23
23
  _closeDialog = () => {
24
- // this.setOrAddState('*modalActive', false);
25
-
26
24
  this.modalManager?.close(this.id);
27
25
 
28
26
  if (!this.modalManager.hasActiveModals) {
@@ -100,7 +98,7 @@ export class Modal extends Block {
100
98
  }
101
99
  });
102
100
 
103
- this.modalManager.subscribe(ModalEvents.CLOSE_ALL, ({}) => {
101
+ this.modalManager.subscribe(ModalEvents.CLOSE_ALL, () => {
104
102
  this.hide();
105
103
  });
106
104
  }
@@ -77,9 +77,10 @@ uc-upload-list[mode='grid'] .uc-files {
77
77
 
78
78
  uc-upload-list .uc-files .uc-add-more-btn,
79
79
  uc-upload-list[mode='grid'] uc-file-item {
80
- width: calc(100% / var(--uc-grid-col) - var(--uc-padding) / 2);
80
+ flex: 0 0 calc((100% - (var(--uc-grid-gap) * (var(--uc-grid-col) - 1))) / var(--uc-grid-col));
81
+ max-width: calc((100% - (var(--uc-grid-gap) * (var(--uc-grid-col) - 1))) / var(--uc-grid-col));
81
82
  height: var(--uc-grid-preview-image-height);
82
- aspect-ratio: 1;
83
+ aspect-ratio: var(--uc-grid-aspect-ratio);
83
84
  }
84
85
 
85
86
  uc-upload-list .uc-files .uc-add-more-btn {
@@ -18,10 +18,9 @@
18
18
  --uc-simple-btn-padding: 7px 14px;
19
19
 
20
20
  --uc-grid-col: 3;
21
-
22
- /* --uc-grid-preview-image-width: 200px; */
23
21
  --uc-grid-preview-image-height: auto;
24
22
  --uc-grid-gap: calc(var(--uc-padding) / 2);
23
+ --uc-grid-aspect-ratio: 1 / 1;
25
24
 
26
25
  /* Default colors, in case of media query failure */
27
26
  --uc-background: var(--uc-background-light);
@@ -1 +1 @@
1
- {"version":3,"file":"index.ssr.d.ts","sourceRoot":"","sources":["index.ssr.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;EAcE;AACF;;;;;;;;;;;;;;;EAcE;AACF;;;;;EAIE;AACF;;;;;;EAKE;AACF;;;;;;;;EAgBE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4IE;AACF;;;;;;;;EAuCE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CE;AACF;;;;;;;;EAuCE;AACF;;;;;;;EA0GE;AACF;;;;;;;EAaE;AACF;;;;;;;EAME;AACF;;;;;;;;;;;;;;;;EAeE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkEE;AACF;;;;;;;EAWE;AACF;;;;;;;EAWE;A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;;;;;;;;;;;;;;;;;;EA0DE;AACF;;;;;;;EAeE;AACF;;;;;;EAKE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsDE;AACF;;;;;;EAKE;AACF;;;;;;EAKE;AACF;;;;;;;;;;;;;;;;EAeE;AACF;;;;;;;;;;;;EAWE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmEE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuGE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EE;AACK,yCAAiC;AACjC,qCAA6B;AAC7B,6CAAqC;AACrC,oCAA4B"}
package/index.ssr.js CHANGED
@@ -379,6 +379,7 @@ export const Config = class {
379
379
  "max-video-recording-duration",
380
380
  "display-upload-list",
381
381
  "enable-file-name",
382
+ "use-preview-image",
382
383
  "multiplemin",
383
384
  "multiplemax",
384
385
  "confirmupload",
@@ -426,6 +427,7 @@ export const Config = class {
426
427
  "maxvideorecordingduration",
427
428
  "displayuploadlist",
428
429
  "enablefilename",
430
+ "usepreviewimage",
429
431
  ];
430
432
  static reg = () => {};
431
433
  static styleAttrs = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uploadcare/file-uploader",
3
- "version": "1.15.0-alpha.0",
3
+ "version": "1.15.0-alpha.1",
4
4
  "description": "Building blocks for Uploadcare products integration",
5
5
  "keywords": [
6
6
  "web components",
@@ -1,4 +1,20 @@
1
1
  export class FileUploaderMinimal extends SolutionBlock {
2
+ init$: {
3
+ singleUpload: boolean;
4
+ '*commonProgress': number;
5
+ '*uploadList': never[];
6
+ '*uploadQueue': import("@uploadcare/upload-client").Queue;
7
+ '*collectionErrors': any[];
8
+ '*collectionState': import("../inline/index.js").OutputCollectionState<import("../inline/index.js").OutputCollectionStatus, "maybe-has-group"> | null;
9
+ '*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
10
+ '*uploadTrigger': Set<string>;
11
+ '*secureUploadsManager': import("../../../abstract/SecureUploadsManager.js").SecureUploadsManager | null;
12
+ '*currentActivity': null;
13
+ '*currentActivityParams': {};
14
+ '*history': never[];
15
+ '*historyBack': null;
16
+ '*closeModal': () => void;
17
+ };
2
18
  }
3
19
  export namespace FileUploaderMinimal {
4
20
  let template: string;
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploaderMinimal.d.ts","sourceRoot":"","sources":["FileUploaderMinimal.js"],"names":[],"mappings":"AAIA;CAoDC;;;;8BAvD6B,oCAAoC"}
1
+ {"version":3,"file":"FileUploaderMinimal.d.ts","sourceRoot":"","sources":["FileUploaderMinimal.js"],"names":[],"mappings":"AAIA;IAMI;;;;;;;;;;;;;;;MAGC;CAsDJ;;;;8BAlE6B,oCAAoC"}
@@ -10,6 +10,7 @@ export class FileUploaderMinimal extends SolutionBlock {
10
10
 
11
11
  this.init$ = {
12
12
  ...this.init$,
13
+ singleUpload: false,
13
14
  };
14
15
  }
15
16
 
@@ -48,6 +49,16 @@ export class FileUploaderMinimal extends SolutionBlock {
48
49
  this.setAttribute('mode', mode);
49
50
  });
50
51
 
52
+ this.subConfigValue('multiple', (multiple) => {
53
+ if (multiple) {
54
+ this.style.removeProperty('--uc-grid-col');
55
+ } else {
56
+ this.style.setProperty('--uc-grid-col', '1');
57
+ }
58
+
59
+ this.$.singleUpload = !multiple;
60
+ });
61
+
51
62
  this.modalManager.subscribe(ModalEvents.CLOSE, (e) => {
52
63
  if (e.id === ActivityBlock.activities.CLOUD_IMG_EDIT) {
53
64
  this.$['*currentActivity'] = ActivityBlock.activities.UPLOAD_LIST;
@@ -58,7 +69,7 @@ export class FileUploaderMinimal extends SolutionBlock {
58
69
 
59
70
  FileUploaderMinimal.template = /* HTML */ `
60
71
  <uc-start-from>
61
- <uc-drop-area tabindex="0" clickable l10n="choose-file"></uc-drop-area>
72
+ <uc-drop-area set="@single:singleUpload" tabindex="0" clickable l10n="choose-file"></uc-drop-area>
62
73
  <uc-copyright></uc-copyright>
63
74
  </uc-start-from>
64
75
  <uc-upload-list ref="uBlock"></uc-upload-list>
@@ -64,6 +64,10 @@
64
64
  background-color: var(--uc-background);
65
65
  }
66
66
 
67
+ :where([uc-file-uploader-minimal]:has([single]) uc-drop-area) {
68
+ aspect-ratio: var(--uc-grid-aspect-ratio);
69
+ }
70
+
67
71
  [uc-file-uploader-minimal] uc-upload-list uc-activity-header {
68
72
  display: none;
69
73
  }
@@ -282,6 +282,8 @@ export type ConfigType = {
282
282
  displayUploadList: string;
283
283
 
284
284
  enableFileName: boolean;
285
+
286
+ usePreviewImage: boolean;
285
287
  };
286
288
  export type ConfigComplexType = Pick<ConfigType, (typeof complexConfigKeys)[number]>;
287
289
  export type ConfigPlainType = Omit<ConfigType, keyof ConfigComplexType>;