@uploadcare/file-uploader 1.14.0 → 1.15.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 (67) hide show
  1. package/abstract/ActivityBlock.d.ts.map +1 -1
  2. package/abstract/ActivityBlock.js +10 -15
  3. package/abstract/Block.d.ts +6 -0
  4. package/abstract/Block.d.ts.map +1 -1
  5. package/abstract/Block.js +15 -0
  6. package/abstract/CTX.d.ts.map +1 -1
  7. package/abstract/CTX.js +3 -1
  8. package/abstract/ModalManager.d.ts +113 -0
  9. package/abstract/ModalManager.d.ts.map +1 -0
  10. package/abstract/ModalManager.js +220 -0
  11. package/abstract/UploaderBlock.d.ts.map +1 -1
  12. package/abstract/UploaderBlock.js +1 -8
  13. package/abstract/UploaderPublicApi.d.ts.map +1 -1
  14. package/abstract/UploaderPublicApi.js +12 -7
  15. package/blocks/CameraSource/CameraSource.d.ts.map +1 -1
  16. package/blocks/CameraSource/CameraSource.js +1 -0
  17. package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts.map +1 -1
  18. package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.js +2 -0
  19. package/blocks/Config/Config.d.ts +1 -1
  20. package/blocks/Config/Config.d.ts.map +1 -1
  21. package/blocks/Config/initialConfig.d.ts.map +1 -1
  22. package/blocks/Config/initialConfig.js +3 -0
  23. package/blocks/Config/normalizeConfigValue.d.ts.map +1 -1
  24. package/blocks/Config/normalizeConfigValue.js +4 -0
  25. package/blocks/DropArea/DropArea.d.ts.map +1 -1
  26. package/blocks/DropArea/DropArea.js +2 -1
  27. package/blocks/ExternalSource/ExternalSource.d.ts.map +1 -1
  28. package/blocks/ExternalSource/ExternalSource.js +3 -1
  29. package/blocks/FileItem/FileItem.d.ts +2 -0
  30. package/blocks/FileItem/FileItem.d.ts.map +1 -1
  31. package/blocks/FileItem/FileItem.js +18 -3
  32. package/blocks/FileItem/file-item.css +60 -0
  33. package/blocks/Modal/Modal.d.ts.map +1 -1
  34. package/blocks/Modal/Modal.js +28 -17
  35. package/blocks/SourceBtn/SourceBtn.d.ts +4 -1
  36. package/blocks/SourceBtn/SourceBtn.d.ts.map +1 -1
  37. package/blocks/SourceBtn/SourceBtn.js +5 -1
  38. package/blocks/StartFrom/StartFrom.js +1 -1
  39. package/blocks/UploadList/UploadList.d.ts.map +1 -1
  40. package/blocks/UploadList/UploadList.js +14 -1
  41. package/blocks/UploadList/upload-list.css +22 -0
  42. package/blocks/UrlSource/UrlSource.d.ts.map +1 -1
  43. package/blocks/UrlSource/UrlSource.js +1 -0
  44. package/blocks/themes/uc-basic/theme.css +13 -0
  45. package/index.ssr.d.ts.map +1 -1
  46. package/index.ssr.js +16 -3
  47. package/package.json +4 -2
  48. package/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts.map +1 -1
  49. package/solutions/file-uploader/minimal/FileUploaderMinimal.js +23 -0
  50. package/solutions/file-uploader/minimal/index.css +20 -1
  51. package/solutions/file-uploader/minimal/index.d.ts +3 -0
  52. package/solutions/file-uploader/minimal/index.js +5 -0
  53. package/solutions/file-uploader/regular/FileUploaderRegular.d.ts +2 -2
  54. package/solutions/file-uploader/regular/FileUploaderRegular.d.ts.map +1 -1
  55. package/solutions/file-uploader/regular/FileUploaderRegular.js +16 -1
  56. package/types/exported.d.ts +4 -0
  57. package/web/file-uploader.iife.min.js +4 -4
  58. package/web/file-uploader.min.js +4 -4
  59. package/web/uc-basic.min.css +1 -1
  60. package/web/uc-cloud-image-editor.min.css +1 -1
  61. package/web/uc-cloud-image-editor.min.js +4 -4
  62. package/web/uc-file-uploader-inline.min.css +1 -1
  63. package/web/uc-file-uploader-inline.min.js +4 -4
  64. package/web/uc-file-uploader-minimal.min.css +1 -1
  65. package/web/uc-file-uploader-minimal.min.js +4 -3
  66. package/web/uc-file-uploader-regular.min.css +1 -1
  67. package/web/uc-file-uploader-regular.min.js +4 -4
@@ -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,smEAGG"}
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 +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,CAmElD"}
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"}
@@ -74,4 +74,7 @@ export const initialConfig = {
74
74
  enableVideoRecording: null,
75
75
  maxVideoRecordingDuration: null,
76
76
  mediaRecorderOptions: null,
77
+
78
+ displayUploadList: 'grid',
79
+ enableFileName: false,
77
80
  };
@@ -1 +1 @@
1
- {"version":3,"file":"normalizeConfigValue.d.ts","sourceRoot":"","sources":["normalizeConfigValue.js"],"names":[],"mappings":"AAiBO,iCADK,OAAO,WAWlB;AAwKM,sGAHI,OAAO,mDAcjB"}
1
+ {"version":3,"file":"normalizeConfigValue.d.ts","sourceRoot":"","sources":["normalizeConfigValue.js"],"names":[],"mappings":"AAiBO,iCADK,OAAO,WAWlB;AA4KM,sGAHI,OAAO,mDAcjB"}
@@ -185,6 +185,10 @@ const mapping = {
185
185
  mediaRecorderOptions: asObject,
186
186
 
187
187
  maxVideoRecordingDuration: asNumber,
188
+
189
+ displayUploadList: asString,
190
+
191
+ enableFileName: asBoolean,
188
192
  };
189
193
 
190
194
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"DropArea.d.ts","sourceRoot":"","sources":["DropArea.js"],"names":[],"mappings":"AAaA;IAKI;;;;;;;;;;;;;;;;;;;;;;MAUC;IAGH,oBAgBC;IAgDC,eAAe;IACf,yBA2BE;IAIA,yDAWE;IA6BF;;;OAGG;IACH,uBASC;IAOL;;;;;OAKG;IACH,sBAeC;IAED,eAAe;IACf,0BAcC;CAqBF;;;;8BAlP6B,iCAAiC"}
1
+ {"version":3,"file":"DropArea.d.ts","sourceRoot":"","sources":["DropArea.js"],"names":[],"mappings":"AAaA;IAKI;;;;;;;;;;;;;;;;;;;;;;MAUC;IAGH,oBAgBC;IAgDC,eAAe;IACf,yBA4BE;IAIA,yDAWE;IA6BF;;;OAGG;IACH,uBASC;IAOL;;;;;OAKG;IACH,sBAeC;IAED,eAAe;IACf,0BAcC;CAqBF;;;;8BAnP6B,iCAAiC"}
@@ -115,10 +115,11 @@ export class DropArea extends UploaderBlock {
115
115
  }
116
116
  });
117
117
  if (this.uploadCollection.size) {
118
+ this.modalManager.open(ActivityBlock.activities.UPLOAD_LIST);
118
119
  this.set$({
119
120
  '*currentActivity': ActivityBlock.activities.UPLOAD_LIST,
120
121
  });
121
- this.setOrAddState('*modalActive', true);
122
+ // this.setOrAddState('*modalActive', true);
122
123
  }
123
124
  },
124
125
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ExternalSource.d.ts","sourceRoot":"","sources":["ExternalSource.js"],"names":[],"mappings":"AAWA,+DAA+D;AAE/D;IAEE,yBAAiD;IAK/C;;;QAKE,6FAA6F;sBAAlF,OAAO,YAAY,EAAE,eAAe,CAAC,uBAAuB,CAAC,CAAC,eAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;MAiC1F;IAGH,6BAA6B;IAC7B,qCAMC;IAgDD;;;OAGG;IACH,mCAcC;IAED;;;OAGG;IACH,kCAsBC;IAED,eAAe;IACf,yBAIC;IAED,eAAe;IACf,mBAKC;IAED;;;OAGG;IACH,sBAKC;IAED,eAAe;IACf,kBAKC;IAED,eAAe;IACf,kBAeC;IAED,eAAe;IACf,oBA6BC;IALC,eAAe;IACf,uBAA6D;IAM/D,eAAe;IACf,sBAMC;IAED,eAAe;IACf,6BASC;CACF;;;;6BAjQa;IAAE,kBAAkB,EAAE,MAAM,CAAA;CAAE;8BAPd,iCAAiC"}
1
+ {"version":3,"file":"ExternalSource.d.ts","sourceRoot":"","sources":["ExternalSource.js"],"names":[],"mappings":"AAWA,+DAA+D;AAE/D;IAEE,yBAAiD;IAK/C;;;QAKE,6FAA6F;sBAAlF,OAAO,YAAY,EAAE,eAAe,CAAC,uBAAuB,CAAC,CAAC,eAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;MAkC1F;IAGH,6BAA6B;IAC7B,qCAMC;IAiDD;;;OAGG;IACH,mCAcC;IAED;;;OAGG;IACH,kCAsBC;IAED,eAAe;IACf,yBAIC;IAED,eAAe;IACf,mBAKC;IAED;;;OAGG;IACH,sBAKC;IAED,eAAe;IACf,kBAKC;IAED,eAAe;IACf,kBAeC;IAED,eAAe;IACf,oBA6BC;IALC,eAAe;IACf,uBAA6D;IAM/D,eAAe;IACf,sBAMC;IAED,eAAe;IACf,6BASC;CACF;;;;6BAnQa;IAAE,kBAAkB,EAAE,MAAM,CAAA;CAAE;8BAPd,iCAAiC"}
@@ -44,6 +44,7 @@ export class ExternalSource extends UploaderBlock {
44
44
  }
45
45
 
46
46
  this.$['*currentActivity'] = ActivityBlock.activities.UPLOAD_LIST;
47
+ this.modalManager.open(ActivityBlock.activities.UPLOAD_LIST);
47
48
  },
48
49
  onCancel: () => {
49
50
  this.historyBack();
@@ -75,8 +76,9 @@ export class ExternalSource extends UploaderBlock {
75
76
  let { externalSourceType } = /** @type {ActivityParams} */ (this.activityParams);
76
77
 
77
78
  if (!externalSourceType) {
79
+ this.modalManager.close(this.$['*currentActivity']);
78
80
  this.$['*currentActivity'] = null;
79
- this.setOrAddState('*modalActive', false);
81
+ // this.setOrAddState('*modalActive', false);
80
82
  console.error(`Param "externalSourceType" is required for activity "${this.activityType}"`);
81
83
  return;
82
84
  }
@@ -28,6 +28,7 @@ export class FileItem extends UploaderBlock {
28
28
  isUploading: boolean;
29
29
  isFocused: boolean;
30
30
  isEditable: boolean;
31
+ isFileName: boolean;
31
32
  state: symbol;
32
33
  ariaLabelStatusFile: string;
33
34
  onEdit: () => void;
@@ -53,6 +54,7 @@ export class FileItem extends UploaderBlock {
53
54
  * @param {IntersectionObserverEntry[]} entries
54
55
  */
55
56
  private _observerCallback;
57
+ _thumbRect: DOMRectReadOnly | undefined;
56
58
  /** @private */
57
59
  private _calculateState;
58
60
  /** @private */
@@ -1 +1 @@
1
- {"version":3,"file":"FileItem.d.ts","sourceRoot":"","sources":["FileItem.js"],"names":[],"mappings":"AAoBA;IAIE,eAAe;IACf,mBAAuB;IACvB;;;OAGG;IACH,eAAc;IACd,eAAe;IACf,wBAAwB;IACxB,eAAe;IACf,gCAA4E;IAC5E,eAAe;IACf,iCAA0E;IAE1E,eAAe;IACf,sBAAsB;IAKpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA6BC;IAGH,eASC;IAED;;;OAGG;IACH,0BAaC;IAED,eAAe;IACf,wBAgBC;IAED,eAAe;IACf,2BAsCC;IAED;;;;OAIG;IACH,kBAUC;IAED;;MAaQ;IAER;;;OAGG;IACH,uBAmDC;IAsCD,wEAAwE;IACxE,oBADY,CAAC,oBAAoB,CAAC,CAAC,MAAM,oBAAoB,CAAC,QA0B7D;IAaC,eAAe;IACf,kBAEE;IAWJ;;;MAEC;IAED;;;OAGG;IACH,uBAEC;IAED,wBAsFC;CACF;;;;;8BAvb6B,iCAAiC;AAS/D;;;;;GAKG"}
1
+ {"version":3,"file":"FileItem.d.ts","sourceRoot":"","sources":["FileItem.js"],"names":[],"mappings":"AAoBA;IAIE,eAAe;IACf,mBAAuB;IACvB;;;OAGG;IACH,eAAc;IACd,eAAe;IACf,wBAAwB;IACxB,eAAe;IACf,gCAA4E;IAC5E,eAAe;IACf,iCAA0E;IAE1E,eAAe;IACf,sBAAsB;IAKpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+BC;IAGH,eASC;IAED;;;OAGG;IACH,0BAcC;IAXC,wCAA0C;IAa5C,eAAe;IACf,wBAgBC;IAED,eAAe;IACf,2BA2CC;IAED;;;;OAIG;IACH,kBAUC;IAED;;MAaQ;IAER;;;OAGG;IACH,uBAmDC;IA6CD,wEAAwE;IACxE,oBADY,CAAC,oBAAoB,CAAC,CAAC,MAAM,oBAAoB,CAAC,QA0B7D;IAaC,eAAe;IACf,kBAEE;IAWJ;;;MAEC;IAED;;;OAGG;IACH,uBAEC;IAED,wBAsFC;CACF;;;;;8BAtc6B,iCAAiC;AAS/D;;;;;GAKG"}
@@ -57,12 +57,14 @@ export class FileItem extends UploaderBlock {
57
57
  isUploading: false,
58
58
  isFocused: false,
59
59
  isEditable: false,
60
+ isFileName: false,
60
61
  state: FileItemState.IDLE,
61
62
  ariaLabelStatusFile: '',
62
63
  onEdit: () => {
63
64
  this.$['*currentActivityParams'] = {
64
65
  internalId: this._entry.uid,
65
66
  };
67
+ this.modalManager.open(ActivityBlock.activities.CLOUD_IMG_EDIT);
66
68
  this.$['*currentActivity'] = ActivityBlock.activities.CLOUD_IMG_EDIT;
67
69
  },
68
70
  onRemove: () => {
@@ -92,6 +94,7 @@ export class FileItem extends UploaderBlock {
92
94
  _observerCallback(entries) {
93
95
  let [entry] = entries;
94
96
  this._isIntersecting = entry.isIntersecting;
97
+ this._thumbRect = entry.boundingClientRect;
95
98
 
96
99
  if (entry.isIntersecting && !this._renderedOnce) {
97
100
  this.render();
@@ -131,7 +134,12 @@ export class FileItem extends UploaderBlock {
131
134
  let entry = this._entry;
132
135
 
133
136
  if (entry.getValue('fileInfo') && entry.getValue('isImage')) {
134
- let size = this.cfg.thumbSize;
137
+ let size = Math.max(
138
+ parseInt(String(this?._thumbRect?.height || 0)),
139
+ parseInt(String(this?._thumbRect?.width || 0)),
140
+ this.cfg.thumbSize,
141
+ );
142
+
135
143
  let thumbUrl = await this.proxyUrl(
136
144
  createCdnUrl(
137
145
  createOriginalUrl(this.cfg.cdnCname, this._entry.getValue('uuid')),
@@ -265,6 +273,13 @@ export class FileItem extends UploaderBlock {
265
273
  });
266
274
 
267
275
  this.subConfigValue('useCloudImageEditor', () => this._debouncedCalculateState());
276
+ this.subConfigValue('displayUploadList', (mode) => {
277
+ if (mode === 'grid') {
278
+ this.subConfigValue('enableFileName', (value) => (this.$.isFileName = !value));
279
+ }
280
+
281
+ this.setAttribute('mode', mode);
282
+ });
268
283
 
269
284
  this.onclick = () => {
270
285
  FileItem.activeInstances.forEach((inst) => {
@@ -451,8 +466,8 @@ FileItem.template = /* HTML */ `
451
466
  </div>
452
467
  </div>
453
468
  <div aria-atomic="true" aria-live="polite" class="uc-file-name-wrapper" set="@aria-label:ariaLabelStatusFile;">
454
- <span class="uc-file-name">{{itemName}}</span>
455
- <span class="uc-file-error" set="@hidden: !errorText">{{errorText}}</span>
469
+ <span class="uc-file-name" set="@hidden: isFileName">{{itemName}}</span>
470
+ <span class="uc-file-error" set="@hidden: !errorText;">{{errorText}}</span>
456
471
  <span class="uc-file-hint" set="@hidden: !hint">{{hint}}</span>
457
472
  </div>
458
473
  <div class="uc-file-actions">
@@ -45,6 +45,7 @@ uc-file-item .uc-thumb {
45
45
  height: var(--uc-preview-size);
46
46
  background-color: var(--uc-secondary);
47
47
  background-position: center center;
48
+ background-repeat: no-repeat;
48
49
  background-size: cover;
49
50
  border-radius: var(--uc-radius);
50
51
  }
@@ -142,3 +143,62 @@ uc-file-item .uc-file-actions {
142
143
  align-items: center;
143
144
  justify-content: center;
144
145
  }
146
+
147
+ /* File item in the grid */
148
+ uc-file-item[mode='grid'] {
149
+ overflow: visible;
150
+ min-height: initial;
151
+ }
152
+
153
+ uc-file-item[mode='grid'] .uc-inner {
154
+ height: 100%;
155
+ grid-template-columns: 1fr;
156
+ grid-template-rows: 1fr max-content;
157
+ padding: 0;
158
+ background-color: transparent;
159
+ margin-bottom: 0;
160
+ border-radius: 0;
161
+ }
162
+
163
+ uc-file-item[mode='grid'] .uc-inner[failed] .uc-badge {
164
+ display: none;
165
+ }
166
+
167
+ uc-file-item[mode='grid'] .uc-thumb {
168
+ width: 100%;
169
+ height: 100%;
170
+ }
171
+
172
+ uc-file-item[mode='grid'] .uc-badge {
173
+ right: var(--uc-padding);
174
+ bottom: var(--uc-padding);
175
+ }
176
+
177
+ uc-file-item[mode='grid'] .uc-file-name-wrapper {
178
+ padding: 0;
179
+ }
180
+
181
+ uc-file-item[mode='grid'] .uc-file-name:not([hidden]) + .uc-file-error {
182
+ bottom: calc(var(--uc-padding) + var(--uc-font-size));
183
+ }
184
+
185
+ uc-file-item[mode='grid'] .uc-file-error {
186
+ position: absolute;
187
+ background-color: var(--uc-destructive-foreground);
188
+ border-radius: var(--uc-radius);
189
+ color: var(--uc-background);
190
+ bottom: var(--uc-padding);
191
+ left: var(--uc-padding);
192
+ right: var(--uc-padding);
193
+ padding: calc(var(--uc-padding) / 2) var(--uc-padding);
194
+ }
195
+
196
+ uc-file-item[mode='grid'] .uc-file-actions {
197
+ position: absolute;
198
+ top: var(--uc-padding);
199
+ right: var(--uc-padding);
200
+ }
201
+
202
+ uc-file-item[mode='grid'] button {
203
+ background-color: var(--uc-background);
204
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["Modal.js"],"names":[],"mappings":"AAGA;IAEE,kCAAoC;IAIlC;;;;MAKC;IAGH,iCAEE;IAEF,yBAEE;IAEF,+BAEE;IAEF,uBAAuB;IACvB,4BADY,KAAK,UAIf;IAFA,eAAe;IACf,yBAAgC;IAGlC,uBAAuB;IACvB,0BADY,KAAK,UAKf;IAEF,aAMC;IAED,aAMC;CAgDF;;;;sBAvGqB,yBAAyB"}
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,5 +1,6 @@
1
1
  // @ts-check
2
2
  import { Block } from '../../abstract/Block.js';
3
+ import { ModalEvents } from '../../abstract/ModalManager.js';
3
4
 
4
5
  export class Modal extends Block {
5
6
  static styleAttrs = [...super.styleAttrs, 'uc-modal'];
@@ -20,7 +21,13 @@ export class Modal extends Block {
20
21
  };
21
22
 
22
23
  _closeDialog = () => {
23
- this.setOrAddState('*modalActive', false);
24
+ // this.setOrAddState('*modalActive', false);
25
+
26
+ this.modalManager?.close(this.id);
27
+
28
+ if (!this.modalManager.hasActiveModals) {
29
+ document.body.style.overflow = '';
30
+ }
24
31
  };
25
32
 
26
33
  _handleDialogClose = () => {
@@ -42,14 +49,20 @@ export class Modal extends Block {
42
49
 
43
50
  show() {
44
51
  if (this.ref.dialog.showModal) {
52
+ this.setAttribute('aria-modal', 'true');
45
53
  this.ref.dialog.showModal();
46
54
  } else {
47
55
  this.ref.dialog.setAttribute('open', '');
48
56
  }
57
+
58
+ if (this.cfg.modalScrollLock) {
59
+ document.body.style.overflow = 'hidden';
60
+ }
49
61
  }
50
62
 
51
63
  hide() {
52
64
  if (this.ref.dialog.close) {
65
+ this.setAttribute('aria-modal', 'false');
53
66
  this.ref.dialog.close();
54
67
  } else {
55
68
  this.ref.dialog.removeAttribute('open');
@@ -59,22 +72,12 @@ export class Modal extends Block {
59
72
  initCallback() {
60
73
  super.initCallback();
61
74
 
75
+ this.modalManager?.registerModal(this.id, this);
76
+
62
77
  this.ref.dialog.addEventListener('close', this._handleDialogClose);
63
78
  this.ref.dialog.addEventListener('mousedown', this._handleDialogMouseDown);
64
79
  this.ref.dialog.addEventListener('mouseup', this._handleDialogMouseUp);
65
80
 
66
- this.sub('*modalActive', (modalActive) => {
67
- if (this.$.isOpen !== modalActive) {
68
- this.$.isOpen = modalActive;
69
- }
70
-
71
- if (modalActive && this.cfg.modalScrollLock) {
72
- document.body.style.overflow = 'hidden';
73
- } else {
74
- document.body.style.overflow = '';
75
- }
76
- });
77
-
78
81
  this.subConfigValue('modalBackdropStrokes', (val) => {
79
82
  if (val) {
80
83
  this.setAttribute('strokes', '');
@@ -83,15 +86,23 @@ export class Modal extends Block {
83
86
  }
84
87
  });
85
88
 
86
- this.sub('isOpen', (isOpen) => {
87
- if (isOpen) {
89
+ this.modalManager.subscribe(ModalEvents.OPEN, (/** @type {{ id: string }} */ { id }) => {
90
+ if (id === this.id) {
88
91
  this.show();
89
- this.setAttribute('aria-modal', 'true');
90
92
  } else {
91
93
  this.hide();
92
- this.setAttribute('aria-modal', 'false');
93
94
  }
94
95
  });
96
+
97
+ this.modalManager.subscribe(ModalEvents.CLOSE, (/** @type {{ id: string }} */ { id }) => {
98
+ if (id === this.id) {
99
+ this.hide();
100
+ }
101
+ });
102
+
103
+ this.modalManager.subscribe(ModalEvents.CLOSE_ALL, ({}) => {
104
+ this.hide();
105
+ });
95
106
  }
96
107
 
97
108
  destroyCallback() {
@@ -22,7 +22,10 @@ export class SourceBtn extends UploaderBlock {
22
22
  '*commonProgress': number;
23
23
  '*uploadList': never[];
24
24
  '*uploadQueue': import("@uploadcare/upload-client").Queue;
25
- '*collectionErrors': any[];
25
+ '*collectionErrors': any[]; /**
26
+ * @private
27
+ * @type {Record<string, TConfig>}
28
+ */
26
29
  '*collectionState': import("../../index.js").OutputCollectionState<import("../../index.js").OutputCollectionStatus, "maybe-has-group"> | null;
27
30
  '*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
28
31
  '*uploadTrigger': Set<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"SourceBtn.d.ts","sourceRoot":"","sources":["SourceBtn.js"],"names":[],"mappings":"AASA;;;;;;;;;GASG;AAEH;IAEE,iCAAiC;IACjC,MADW,MAAM,GAAG,SAAS,CACZ;IACjB;;;OAGG;IACH,yBAAsB;IAKpB;;;;;;;;;;;;;;;;MAIC;IAGH,kBA2DC;IAkBD,kCAAkC;IAClC,yBADY,OAAO,QAGlB;IAED,2BAA2B;IAC3B,cADY,MAAM,WAGjB;IAED,iBAYC;IAED,2BAA2B;IAC3B,gBADY,MAAM,QAcjB;CACF;;;;sBAlJY;IACZ,IAAQ,EAAE,MAAM,CAAC;IACjB,QAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAY,CAAC,EAAE,MAAM,OAAO,CAAC;IAC7B,cAAkB,CAAC,EAAE,OAAO,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;8BAhB0B,iCAAiC"}
1
+ {"version":3,"file":"SourceBtn.d.ts","sourceRoot":"","sources":["SourceBtn.js"],"names":[],"mappings":"AASA;;;;;;;;;GASG;AAEH;IAEE,iCAAiC;IACjC,MADW,MAAM,GAAG,SAAS,CACZ;IACjB;;;OAGG;IACH,yBAAsB;IAKpB;;;;;;oCATF;;;WAGG;;;;;;;;;;MAUA;IAGH,kBA2DC;IAkBD,kCAAkC;IAClC,yBADY,OAAO,QAGlB;IAED,2BAA2B;IAC3B,cADY,MAAM,WAGjB;IAED,iBAgBC;IAED,2BAA2B;IAC3B,gBADY,MAAM,QAcjB;CACF;;;;sBAtJY;IACZ,IAAQ,EAAE,MAAM,CAAC;IACjB,QAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAY,CAAC,EAAE,MAAM,OAAO,CAAC;IAC7B,cAAkB,CAAC,EAAE,OAAO,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;8BAhB0B,iCAAiC"}
@@ -132,11 +132,15 @@ export class SourceBtn extends UploaderBlock {
132
132
  const configType = this._registeredTypes[this.type];
133
133
  const { activity, activate, activityParams = {} } = configType;
134
134
  const showActivity = activate ? activate() : !!activity;
135
- showActivity &&
135
+
136
+ if (showActivity) {
137
+ this.modalManager.open(/** @type {string} */ (activity));
138
+
136
139
  this.set$({
137
140
  '*currentActivityParams': activityParams,
138
141
  '*currentActivity': activity,
139
142
  });
143
+ }
140
144
  }
141
145
 
142
146
  /** @param {string} type */
@@ -3,7 +3,7 @@ import { ActivityBlock } from '../../abstract/ActivityBlock.js';
3
3
  export class StartFrom extends ActivityBlock {
4
4
  historyTracked = true;
5
5
  /** @type {import('../../abstract/ActivityBlock.js').ActivityType} */
6
- activityType = 'start-from';
6
+ activityType = ActivityBlock.activities.START_FROM;
7
7
 
8
8
  initCallback() {
9
9
  super.initCallback();
@@ -1 +1 @@
1
- {"version":3,"file":"UploadList.d.ts","sourceRoot":"","sources":["UploadList.js"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AAEH;IAKE,4BAAoD;IAKlD;;;;;;;;;;;;;;;;;;;;;;;;;;MA0BC;IAGH,eAAe;IACf,yCASQ;IAER,eAAe;IACf,4BAuCC;IAED;;;OAGG;IACH,uBAmBC;CAoEF;;;;sBAhMY;IACZ,KAAS,EAAE,MAAM,CAAC;IAClB,OAAW,EAAE,MAAM,CAAC;IACpB,SAAa,EAAE,MAAM,CAAC;IACtB,MAAU,EAAE,MAAM,CAAC;CAChB;8BAV0B,iCAAiC"}
1
+ {"version":3,"file":"UploadList.d.ts","sourceRoot":"","sources":["UploadList.js"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AAEH;IAKE,4BAAoD;IAKlD;;;;;;;;;;;;;;;;;;;;;;;;;;MA0BC;IAGH,eAAe;IACf,yCASQ;IAER,eAAe;IACf,4BAuCC;IAED;;;OAGG;IACH,uBAmBC;CAwEF;;;;sBApMY;IACZ,KAAS,EAAE,MAAM,CAAC;IAClB,OAAW,EAAE,MAAM,CAAC;IACpB,SAAa,EAAE,MAAM,CAAC;IACtB,MAAU,EAAE,MAAM,CAAC;CAChB;8BAV0B,iCAAiC"}
@@ -149,6 +149,10 @@ export class UploadList extends UploaderBlock {
149
149
  }
150
150
  });
151
151
 
152
+ this.subConfigValue('displayUploadList', (mode) => {
153
+ this.setAttribute('mode', mode);
154
+ });
155
+
152
156
  this.sub('*currentActivity', (currentActivity) => {
153
157
  if (!this.couldOpenActivity && currentActivity === this.activityType) {
154
158
  this.$['*currentActivity'] = this.initActivity;
@@ -216,7 +220,16 @@ UploadList.template = /* HTML */ `
216
220
  <slot name="empty"><span l10n="no-files"></span></slot>
217
221
  </div>
218
222
 
219
- <div class="uc-files" repeat="*uploadList" repeat-item-tag="uc-file-item"></div>
223
+ <div class="uc-files">
224
+ <div class="uc-files-wrapper" repeat="*uploadList" repeat-item-tag="uc-file-item"></div>
225
+ <button
226
+ type="button"
227
+ class="uc-add-more-btn uc-secondary-btn"
228
+ set="onclick: onAdd; @disabled: !addMoreBtnEnabled; @hidden: !addMoreBtnVisible"
229
+ >
230
+ <uc-icon name="add"></uc-icon><span l10n="add-more"></span>
231
+ </button>
232
+ </div>
220
233
 
221
234
  <div class="uc-common-error" set="@hidden: !commonErrorMessage; textContent: commonErrorMessage;"></div>
222
235
 
@@ -22,6 +22,10 @@ uc-upload-list .uc-files {
22
22
  overflow: auto;
23
23
  }
24
24
 
25
+ uc-upload-list .uc-files-wrapper {
26
+ display: contents;
27
+ }
28
+
25
29
  uc-upload-list .uc-toolbar {
26
30
  display: flex;
27
31
  gap: 4px;
@@ -63,3 +67,21 @@ uc-upload-list .uc-common-error {
63
67
  uc-upload-list .uc-add-more-btn uc-icon {
64
68
  display: none;
65
69
  }
70
+
71
+ /* GRID */
72
+ uc-upload-list[mode='grid'] .uc-files {
73
+ display: flex;
74
+ flex-wrap: wrap;
75
+ gap: var(--uc-grid-gap);
76
+ }
77
+
78
+ uc-upload-list .uc-files .uc-add-more-btn,
79
+ uc-upload-list[mode='grid'] uc-file-item {
80
+ width: calc(100% / var(--uc-grid-col) - var(--uc-padding) / 2);
81
+ height: var(--uc-grid-preview-image-height);
82
+ aspect-ratio: 1;
83
+ }
84
+
85
+ uc-upload-list .uc-files .uc-add-more-btn {
86
+ display: none;
87
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"UrlSource.d.ts","sourceRoot":"","sources":["UrlSource.js"],"names":[],"mappings":"AAIA;IAEE,oBAA4C;IAE5C,WAiBE;CAWH;;;;8BApC6B,iCAAiC"}
1
+ {"version":3,"file":"UrlSource.d.ts","sourceRoot":"","sources":["UrlSource.js"],"names":[],"mappings":"AAIA;IAEE,oBAA4C;IAE5C,WAkBE;CAWH;;;;8BArC6B,iCAAiC"}
@@ -14,6 +14,7 @@ export class UrlSource extends UploaderBlock {
14
14
 
15
15
  let url = this.ref.input['value'];
16
16
  this.api.addFileFromUrl(url, { source: UploadSource.URL });
17
+ this.modalManager.open(ActivityBlock.activities.UPLOAD_LIST);
17
18
  this.$['*currentActivity'] = ActivityBlock.activities.UPLOAD_LIST;
18
19
  },
19
20
  onCancel: () => {
@@ -17,6 +17,12 @@
17
17
  --uc-dialog-max-height: 675px;
18
18
  --uc-simple-btn-padding: 7px 14px;
19
19
 
20
+ --uc-grid-col: 3;
21
+
22
+ /* --uc-grid-preview-image-width: 200px; */
23
+ --uc-grid-preview-image-height: auto;
24
+ --uc-grid-gap: calc(var(--uc-padding) / 2);
25
+
20
26
  /* Default colors, in case of media query failure */
21
27
  --uc-background: var(--uc-background-light);
22
28
  --uc-foreground: var(--uc-foreground-light);
@@ -136,10 +142,17 @@
136
142
  }
137
143
  }
138
144
 
145
+ @media only screen and (max-width: 680px) {
146
+ :where([uc-wgt-common]) {
147
+ --uc-grid-col: 2;
148
+ }
149
+ }
150
+
139
151
  @media only screen and (max-width: 430px) {
140
152
  :where([uc-wgt-common]) {
141
153
  --uc-dialog-max-width: 100vw;
142
154
  --uc-dialog-max-height: var(--uploadcare-blocks-window-height);
155
+ --uc-grid-col: 1;
143
156
  }
144
157
  }
145
158
 
@@ -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;;;;;;;EAsGE;AACF;;;;;;;EAaE;AACF;;;;;;;EAME;AACF;;;;;;;;;;;;;;;;EAeE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkEE;AACF;;;;;;;EAWE;AACF;;;;;;;EAWE;AACF;;;;;;;EASE;AACF;;;;;;EAKE;AACF;;;;;;;EAWE;AACF;;;;;;;EAME;AACF;;;;;;;EAWE;AACF;;;;;;;EA2IE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0EE;;;;;;;;;;;;;AAaF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoFE;AACF;;;;;;EAKE;AACF;;;;;;EAKE;AACF;;;;;;;EAME;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CE;AACF;;;;;;;;EAWE;AACF;;;;;;EAwBE;AACF;;;;;;;EAUE;AACF;;;;;;;;EAWE;AACF,oCAAqC;AACrC,uCAAwC;AACxC;;;;;;;EAME;AACF;;;;;;;EASE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgDE;AACF;;;;;;;EAME;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0DE;AACF;;;;;;;EAeE;AACF;;;;;;EAKE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsDE;AACF;;;;;;EAKE;AACF;;;;;;EAKE;AACF;;;;;;;;;;;;;;;;EAeE;AACF;;;;;;;;;;;;EAWE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmEE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8FE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EE;AACK,yCAAiC;AACjC,qCAA6B;AAC7B,6CAAqC;AACrC,oCAA4B"}
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;AACF;;;;;;;EASE;AACF;;;;;;EAKE;AACF;;;;;;;EAWE;AACF;;;;;;;EAME;AACF;;;;;;;EAWE;AACF;;;;;;;EA2IE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0EE;;;;;;;;;;;;;AAaF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoFE;AACF;;;;;;EAKE;AACF;;;;;;EAKE;AACF;;;;;;;EAME;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CE;AACF;;;;;;;;EAWE;AACF;;;;;;EAwBE;AACF;;;;;;;EAUE;AACF;;;;;;;;EAWE;AACF,oCAAqC;AACrC,uCAAwC;AACxC;;;;;;;EAME;AACF;;;;;;;EASE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgDE;AACF;;;;;;;EAME;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
@@ -377,6 +377,8 @@ export const Config = class {
377
377
  "enable-audio-recording",
378
378
  "enable-video-recording",
379
379
  "max-video-recording-duration",
380
+ "display-upload-list",
381
+ "enable-file-name",
380
382
  "multiplemin",
381
383
  "multiplemax",
382
384
  "confirmupload",
@@ -422,6 +424,8 @@ export const Config = class {
422
424
  "enableaudiorecording",
423
425
  "enablevideorecording",
424
426
  "maxvideorecordingduration",
427
+ "displayuploadlist",
428
+ "enablefilename",
425
429
  ];
426
430
  static reg = () => {};
427
431
  static styleAttrs = [];
@@ -839,8 +843,8 @@ export const FileItem = class {
839
843
  </div>
840
844
  </div>
841
845
  <div aria-atomic="true" aria-live="polite" class="uc-file-name-wrapper" set="@aria-label:ariaLabelStatusFile;">
842
- <span class="uc-file-name">{{itemName}}</span>
843
- <span class="uc-file-error" set="@hidden: !errorText">{{errorText}}</span>
846
+ <span class="uc-file-name" set="@hidden: isFileName">{{itemName}}</span>
847
+ <span class="uc-file-error" set="@hidden: !errorText;">{{errorText}}</span>
844
848
  <span class="uc-file-hint" set="@hidden: !hint">{{hint}}</span>
845
849
  </div>
846
850
  <div class="uc-file-actions">
@@ -1379,7 +1383,16 @@ export const UploadList = class {
1379
1383
  <slot name="empty"><span l10n="no-files"></span></slot>
1380
1384
  </div>
1381
1385
 
1382
- <div class="uc-files" repeat="*uploadList" repeat-item-tag="uc-file-item"></div>
1386
+ <div class="uc-files">
1387
+ <div class="uc-files-wrapper" repeat="*uploadList" repeat-item-tag="uc-file-item"></div>
1388
+ <button
1389
+ type="button"
1390
+ class="uc-add-more-btn uc-secondary-btn"
1391
+ set="onclick: onAdd; @disabled: !addMoreBtnEnabled; @hidden: !addMoreBtnVisible"
1392
+ >
1393
+ <uc-icon name="add"></uc-icon><span l10n="add-more"></span>
1394
+ </button>
1395
+ </div>
1383
1396
 
1384
1397
  <div class="uc-common-error" set="@hidden: !commonErrorMessage; textContent: commonErrorMessage;"></div>
1385
1398
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uploadcare/file-uploader",
3
- "version": "1.14.0",
3
+ "version": "1.15.0-alpha.0",
4
4
  "description": "Building blocks for Uploadcare products integration",
5
5
  "keywords": [
6
6
  "web components",
@@ -35,7 +35,9 @@
35
35
  "MIT"
36
36
  ],
37
37
  "type": "module",
38
- "sideEffects": ["*.css"],
38
+ "sideEffects": [
39
+ "*.css"
40
+ ],
39
41
  "module": "./index.js",
40
42
  "exports": {
41
43
  ".": {
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploaderMinimal.d.ts","sourceRoot":"","sources":["FileUploaderMinimal.js"],"names":[],"mappings":"AAGA;CAkCC;;;;8BApC6B,oCAAoC"}
1
+ {"version":3,"file":"FileUploaderMinimal.d.ts","sourceRoot":"","sources":["FileUploaderMinimal.js"],"names":[],"mappings":"AAIA;CAoDC;;;;8BAvD6B,oCAAoC"}
@@ -1,9 +1,18 @@
1
1
  import { ActivityBlock } from '../../../abstract/ActivityBlock.js';
2
2
  import { SolutionBlock } from '../../../abstract/SolutionBlock.js';
3
+ import { ModalEvents } from '../../../abstract/ModalManager.js';
3
4
 
4
5
  export class FileUploaderMinimal extends SolutionBlock {
5
6
  static styleAttrs = [...super.styleAttrs, 'uc-file-uploader-minimal'];
6
7
 
8
+ constructor() {
9
+ super();
10
+
11
+ this.init$ = {
12
+ ...this.init$,
13
+ };
14
+ }
15
+
7
16
  initCallback() {
8
17
  super.initCallback();
9
18
 
@@ -34,6 +43,16 @@ export class FileUploaderMinimal extends SolutionBlock {
34
43
  this.cfg.confirmUpload = false;
35
44
  }
36
45
  });
46
+
47
+ this.subConfigValue('displayUploadList', (mode) => {
48
+ this.setAttribute('mode', mode);
49
+ });
50
+
51
+ this.modalManager.subscribe(ModalEvents.CLOSE, (e) => {
52
+ if (e.id === ActivityBlock.activities.CLOUD_IMG_EDIT) {
53
+ this.$['*currentActivity'] = ActivityBlock.activities.UPLOAD_LIST;
54
+ }
55
+ });
37
56
  }
38
57
  }
39
58
 
@@ -43,4 +62,8 @@ FileUploaderMinimal.template = /* HTML */ `
43
62
  <uc-copyright></uc-copyright>
44
63
  </uc-start-from>
45
64
  <uc-upload-list ref="uBlock"></uc-upload-list>
65
+
66
+ <uc-modal id="cloud-image-edit" strokes block-body-scrolling>
67
+ <uc-cloud-image-editor-activity></uc-cloud-image-editor-activity>
68
+ </uc-modal>
46
69
  `;