@uploadcare/file-uploader 1.13.3-alpha.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 (155) 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 +2 -1
  12. package/abstract/UploaderBlock.d.ts.map +1 -1
  13. package/abstract/UploaderBlock.js +1 -8
  14. package/abstract/UploaderPublicApi.d.ts.map +1 -1
  15. package/abstract/UploaderPublicApi.js +38 -9
  16. package/blocks/CameraSource/CameraSource.d.ts.map +1 -1
  17. package/blocks/CameraSource/CameraSource.js +1 -0
  18. package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts.map +1 -1
  19. package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.js +2 -0
  20. package/blocks/Config/Config.d.ts +1 -1
  21. package/blocks/Config/Config.d.ts.map +1 -1
  22. package/blocks/Config/initialConfig.d.ts.map +1 -1
  23. package/blocks/Config/initialConfig.js +3 -0
  24. package/blocks/Config/normalizeConfigValue.d.ts.map +1 -1
  25. package/blocks/Config/normalizeConfigValue.js +4 -0
  26. package/blocks/DropArea/DropArea.d.ts.map +1 -1
  27. package/blocks/DropArea/DropArea.js +2 -1
  28. package/blocks/ExternalSource/ExternalSource.d.ts.map +1 -1
  29. package/blocks/ExternalSource/ExternalSource.js +3 -1
  30. package/blocks/FileItem/FileItem.d.ts +2 -0
  31. package/blocks/FileItem/FileItem.d.ts.map +1 -1
  32. package/blocks/FileItem/FileItem.js +18 -3
  33. package/blocks/FileItem/file-item.css +60 -0
  34. package/blocks/Modal/Modal.d.ts.map +1 -1
  35. package/blocks/Modal/Modal.js +28 -17
  36. package/blocks/SourceBtn/SourceBtn.d.ts +5 -2
  37. package/blocks/SourceBtn/SourceBtn.d.ts.map +1 -1
  38. package/blocks/SourceBtn/SourceBtn.js +29 -15
  39. package/blocks/SourceList/SourceList.d.ts.map +1 -1
  40. package/blocks/SourceList/SourceList.js +17 -11
  41. package/blocks/StartFrom/StartFrom.js +1 -1
  42. package/blocks/UploadList/UploadList.d.ts.map +1 -1
  43. package/blocks/UploadList/UploadList.js +14 -1
  44. package/blocks/UploadList/upload-list.css +22 -0
  45. package/blocks/UrlSource/UrlSource.d.ts.map +1 -1
  46. package/blocks/UrlSource/UrlSource.js +1 -0
  47. package/blocks/themes/uc-basic/svg-sprite.d.ts +1 -1
  48. package/blocks/themes/uc-basic/svg-sprite.js +1 -1
  49. package/blocks/themes/uc-basic/theme.css +13 -0
  50. package/blocks/utils/UploadSource.d.ts +6 -1
  51. package/blocks/utils/UploadSource.d.ts.map +1 -1
  52. package/blocks/utils/UploadSource.js +7 -1
  53. package/blocks/utils/supportCapture.d.ts +2 -0
  54. package/blocks/utils/supportCapture.d.ts.map +1 -0
  55. package/blocks/utils/supportCapture.js +3 -0
  56. package/env.d.ts +1 -1
  57. package/env.js +1 -1
  58. package/index.ssr.d.ts +29 -15
  59. package/index.ssr.d.ts.map +1 -1
  60. package/index.ssr.js +45 -18
  61. package/locales/file-uploader/ar.d.ts +2 -0
  62. package/locales/file-uploader/ar.js +2 -0
  63. package/locales/file-uploader/az.d.ts +2 -0
  64. package/locales/file-uploader/az.js +2 -0
  65. package/locales/file-uploader/ca.d.ts +2 -0
  66. package/locales/file-uploader/ca.js +2 -0
  67. package/locales/file-uploader/cs.d.ts +2 -0
  68. package/locales/file-uploader/cs.js +2 -0
  69. package/locales/file-uploader/da.d.ts +2 -0
  70. package/locales/file-uploader/da.js +2 -0
  71. package/locales/file-uploader/de.d.ts +2 -0
  72. package/locales/file-uploader/de.js +2 -0
  73. package/locales/file-uploader/el.d.ts +2 -0
  74. package/locales/file-uploader/el.js +2 -0
  75. package/locales/file-uploader/en.d.ts +2 -1
  76. package/locales/file-uploader/en.js +2 -1
  77. package/locales/file-uploader/es.d.ts +2 -0
  78. package/locales/file-uploader/es.js +2 -0
  79. package/locales/file-uploader/et.d.ts +2 -0
  80. package/locales/file-uploader/et.js +2 -0
  81. package/locales/file-uploader/fi.d.ts +2 -0
  82. package/locales/file-uploader/fi.js +2 -0
  83. package/locales/file-uploader/fr.d.ts +2 -0
  84. package/locales/file-uploader/fr.js +2 -0
  85. package/locales/file-uploader/he.d.ts +2 -0
  86. package/locales/file-uploader/he.js +2 -0
  87. package/locales/file-uploader/hy.d.ts +2 -0
  88. package/locales/file-uploader/hy.js +2 -0
  89. package/locales/file-uploader/is.d.ts +2 -0
  90. package/locales/file-uploader/is.js +2 -0
  91. package/locales/file-uploader/it.d.ts +2 -0
  92. package/locales/file-uploader/it.js +2 -0
  93. package/locales/file-uploader/ja.d.ts +2 -0
  94. package/locales/file-uploader/ja.js +2 -0
  95. package/locales/file-uploader/ka.d.ts +2 -0
  96. package/locales/file-uploader/ka.js +2 -0
  97. package/locales/file-uploader/kk.d.ts +2 -0
  98. package/locales/file-uploader/kk.js +2 -0
  99. package/locales/file-uploader/ko.d.ts +2 -0
  100. package/locales/file-uploader/ko.js +2 -0
  101. package/locales/file-uploader/lv.d.ts +2 -0
  102. package/locales/file-uploader/lv.js +2 -0
  103. package/locales/file-uploader/nb.d.ts +2 -0
  104. package/locales/file-uploader/nb.js +2 -0
  105. package/locales/file-uploader/nl.d.ts +2 -0
  106. package/locales/file-uploader/nl.js +2 -0
  107. package/locales/file-uploader/pl.d.ts +2 -0
  108. package/locales/file-uploader/pl.js +2 -0
  109. package/locales/file-uploader/pt.d.ts +2 -0
  110. package/locales/file-uploader/pt.js +2 -0
  111. package/locales/file-uploader/ro.d.ts +2 -0
  112. package/locales/file-uploader/ro.js +2 -0
  113. package/locales/file-uploader/ru.d.ts +2 -0
  114. package/locales/file-uploader/ru.js +2 -0
  115. package/locales/file-uploader/sk.d.ts +2 -0
  116. package/locales/file-uploader/sk.js +2 -0
  117. package/locales/file-uploader/sr.d.ts +2 -0
  118. package/locales/file-uploader/sr.js +2 -0
  119. package/locales/file-uploader/sv.d.ts +2 -0
  120. package/locales/file-uploader/sv.js +2 -0
  121. package/locales/file-uploader/tr.d.ts +2 -0
  122. package/locales/file-uploader/tr.js +2 -0
  123. package/locales/file-uploader/uk.d.ts +2 -0
  124. package/locales/file-uploader/uk.js +2 -0
  125. package/locales/file-uploader/vi.d.ts +2 -0
  126. package/locales/file-uploader/vi.js +2 -0
  127. package/locales/file-uploader/zh-TW.d.ts +2 -0
  128. package/locales/file-uploader/zh-TW.js +2 -0
  129. package/locales/file-uploader/zh.d.ts +2 -0
  130. package/locales/file-uploader/zh.js +2 -0
  131. package/package.json +4 -2
  132. package/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts.map +1 -1
  133. package/solutions/file-uploader/minimal/FileUploaderMinimal.js +23 -0
  134. package/solutions/file-uploader/minimal/index.css +20 -1
  135. package/solutions/file-uploader/minimal/index.d.ts +3 -0
  136. package/solutions/file-uploader/minimal/index.js +5 -0
  137. package/solutions/file-uploader/regular/FileUploaderRegular.d.ts +2 -2
  138. package/solutions/file-uploader/regular/FileUploaderRegular.d.ts.map +1 -1
  139. package/solutions/file-uploader/regular/FileUploaderRegular.js +16 -1
  140. package/types/exported.d.ts +4 -0
  141. package/web/file-uploader.iife.min.js +4 -4
  142. package/web/file-uploader.min.js +4 -4
  143. package/web/uc-basic.min.css +1 -1
  144. package/web/uc-cloud-image-editor.min.css +1 -1
  145. package/web/uc-cloud-image-editor.min.js +4 -4
  146. package/web/uc-file-uploader-inline.min.css +1 -1
  147. package/web/uc-file-uploader-inline.min.js +4 -4
  148. package/web/uc-file-uploader-minimal.min.css +1 -1
  149. package/web/uc-file-uploader-minimal.min.js +4 -3
  150. package/web/uc-file-uploader-regular.min.css +1 -1
  151. package/web/uc-file-uploader-regular.min.js +4 -4
  152. package/web/uc-img.min.js +1 -1
  153. package/blocks/utils/checkDevice.d.ts +0 -9
  154. package/blocks/utils/checkDevice.d.ts.map +0 -1
  155. package/blocks/utils/checkDevice.js +0 -34
@@ -558,6 +558,7 @@ export class CameraSource extends UploaderBlock {
558
558
  this.set$({
559
559
  '*currentActivity': ActivityBlock.activities.UPLOAD_LIST,
560
560
  });
561
+ this.modalManager.open(ActivityBlock.activities.UPLOAD_LIST);
561
562
  };
562
563
 
563
564
  /** @private */
@@ -1 +1 @@
1
- {"version":3,"file":"CloudImageEditorActivity.d.ts","sourceRoot":"","sources":["CloudImageEditorActivity.js"],"names":[],"mappings":"AAKA,uDAAuD;AAEvD;IAEE,iCAAuD;IAEvD;;;OAGG;IACH,eAAO;IAEP;;;OAGG;IACH,kBAAU;IAEV,6BAA6B;IAC7B,qCAMC;IAuBD,qFAAqF;IACrF,eADY,YAAY,OAAO,kCAAkC,EAAE,WAAW,CAAC,QAW9E;IAED,qBAEC;IAED,oBA4CC;IAED,sBAIC;CACF;6BApHa;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE;8BAHN,iCAAiC"}
1
+ {"version":3,"file":"CloudImageEditorActivity.d.ts","sourceRoot":"","sources":["CloudImageEditorActivity.js"],"names":[],"mappings":"AAKA,uDAAuD;AAEvD;IAEE,iCAAuD;IAEvD;;;OAGG;IACH,eAAO;IAEP;;;OAGG;IACH,kBAAU;IAEV,6BAA6B;IAC7B,qCAMC;IAuBD,qFAAqF;IACrF,eADY,YAAY,OAAO,kCAAkC,EAAE,WAAW,CAAC,QAY9E;IAED,qBAGC;IAED,oBA4CC;IAED,sBAIC;CACF;6BAtHa;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE;8BAHN,iCAAiC"}
@@ -61,10 +61,12 @@ export class CloudImageEditorActivity extends UploaderBlock {
61
61
  cdnUrl: result.cdnUrl,
62
62
  cdnUrlModifiers: result.cdnUrlModifiers,
63
63
  });
64
+ this.modalManager.close(ActivityBlock.activities.CLOUD_IMG_EDIT);
64
65
  this.historyBack();
65
66
  }
66
67
 
67
68
  handleCancel() {
69
+ this.modalManager.close(ActivityBlock.activities.CLOUD_IMG_EDIT);
68
70
  this.historyBack();
69
71
  }
70
72
 
@@ -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" | "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", 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" | "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>;
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,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() {
@@ -20,9 +20,12 @@ export class SourceBtn extends UploaderBlock {
20
20
  iconName: string;
21
21
  'src-type': string;
22
22
  '*commonProgress': number;
23
- '*uploadList': never[]; /** @type {string | undefined} */
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":"AAQA;;;;;;;;;GASG;AAEH;IAEE,iCAAiC;IACjC,MADW,MAAM,GAAG,SAAS,CACZ;IACjB;;;OAGG;IACH,yBAAsB;IAKpB;;;;gCAXF,iCAAiC;;;;;;;;;;;;MAe9B;IAGH,kBAkDC;IAkBD,kCAAkC;IAClC,yBADY,OAAO,QAGlB;IAED,2BAA2B;IAC3B,cADY,MAAM,WAGjB;IAED,iBAYC;IAED,2BAA2B;IAC3B,gBADY,MAAM,QAcjB;CACF;;;;sBAzIY;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;8BAf0B,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"}
@@ -1,8 +1,9 @@
1
1
  // @ts-check
2
2
  import { UploaderBlock } from '../../abstract/UploaderBlock.js';
3
3
  import { ActivityBlock } from '../../abstract/ActivityBlock.js';
4
- import { ExternalUploadSource, UploadSource } from '../utils/UploadSource.js';
4
+ import { ExternalUploadSource, UploadSource, UploadSourceMobile } from '../utils/UploadSource.js';
5
5
  import { CameraSourceTypes } from '../CameraSource/constants.js';
6
+ import { isSupportCapture } from '../utils/supportCapture.js';
6
7
 
7
8
  const L10N_PREFIX = 'src-type-';
8
9
 
@@ -54,30 +55,39 @@ export class SourceBtn extends UploaderBlock {
54
55
  type: UploadSource.CAMERA,
55
56
  activity: ActivityBlock.activities.CAMERA,
56
57
  activate: () => {
57
- const supportsCapture = 'capture' in document.createElement('input');
58
- if (supportsCapture) {
59
- this.api.openSystemDialog({ captureCamera: true, modeCamera: CameraSourceTypes.PHOTO });
60
- }
61
- return !supportsCapture;
62
- },
63
- });
64
- this.registerType({
65
- type: UploadSource.VIDEO_CAMERA,
66
- activity: ActivityBlock.activities.CAMERA,
67
- activate: () => {
68
- const supportsCapture = 'capture' in document.createElement('input');
58
+ const supportsCapture = isSupportCapture();
59
+
69
60
  if (supportsCapture) {
70
- this.api.openSystemDialog({ captureCamera: true, modeCamera: CameraSourceTypes.VIDEO });
61
+ this.api.openSystemDialog({ captureCamera: true });
71
62
  }
72
63
  return !supportsCapture;
73
64
  },
74
65
  });
66
+
75
67
  this.registerType({
76
68
  type: 'draw',
77
69
  activity: ActivityBlock.activities.DRAW,
78
70
  icon: 'edit-draw',
79
71
  });
80
72
 
73
+ for (let mobileSourceType of Object.values(UploadSourceMobile)) {
74
+ this.registerType({
75
+ type: mobileSourceType,
76
+ activity: ActivityBlock.activities.CAMERA,
77
+ activate: () => {
78
+ const supportsCapture = isSupportCapture();
79
+ if (supportsCapture) {
80
+ this.api.openSystemDialog({
81
+ captureCamera: true,
82
+ modeCamera:
83
+ mobileSourceType === 'mobile-photo-camera' ? CameraSourceTypes.PHOTO : CameraSourceTypes.VIDEO,
84
+ });
85
+ }
86
+ return !supportsCapture;
87
+ },
88
+ });
89
+ }
90
+
81
91
  for (let externalSourceType of Object.values(ExternalUploadSource)) {
82
92
  this.registerType({
83
93
  type: externalSourceType,
@@ -122,11 +132,15 @@ export class SourceBtn extends UploaderBlock {
122
132
  const configType = this._registeredTypes[this.type];
123
133
  const { activity, activate, activityParams = {} } = configType;
124
134
  const showActivity = activate ? activate() : !!activity;
125
- showActivity &&
135
+
136
+ if (showActivity) {
137
+ this.modalManager.open(/** @type {string} */ (activity));
138
+
126
139
  this.set$({
127
140
  '*currentActivityParams': activityParams,
128
141
  '*currentActivity': activity,
129
142
  });
143
+ }
130
144
  }
131
145
 
132
146
  /** @param {string} type */
@@ -1 +1 @@
1
- {"version":3,"file":"SourceList.d.ts","sourceRoot":"","sources":["SourceList.js"],"names":[],"mappings":"AAOA;CAqCC;sBA1CqB,yBAAyB"}
1
+ {"version":3,"file":"SourceList.d.ts","sourceRoot":"","sources":["SourceList.js"],"names":[],"mappings":"AAMA;CA4CC;sBAjDqB,yBAAyB"}
@@ -1,14 +1,12 @@
1
1
  // @ts-check
2
- import { ActivityBlock } from '../../abstract/ActivityBlock.js';
3
2
  import { Block } from '../../abstract/Block.js';
4
3
  import { stringToArray } from '../../utils/stringToArray.js';
5
- import { calcCameraModes } from '../CameraSource/calcCameraModes.js';
6
- import { isMobileDevice } from '../utils/checkDevice.js';
4
+ import { deserializeCsv } from '../utils/comma-separated.js';
5
+ import { isSupportCapture } from '../utils/supportCapture.js';
7
6
 
8
7
  export class SourceList extends Block {
9
8
  initCallback() {
10
9
  super.initCallback();
11
- const isMobile = isMobileDevice();
12
10
 
13
11
  this.subConfigValue('sourceList', (/** @type {String} */ val) => {
14
12
  let list = stringToArray(val);
@@ -24,15 +22,23 @@ export class SourceList extends Block {
24
22
  return;
25
23
  }
26
24
 
27
- html += /* HTML */ `<uc-source-btn role="listitem" type="${srcName}"></uc-source-btn>`;
25
+ if (srcName === 'camera' && isSupportCapture()) {
26
+ this.subConfigValue('cameraModes', (/** @type {String} */ val) => {
27
+ const cameraModes = deserializeCsv(val);
28
+
29
+ cameraModes.forEach((mode) => {
30
+ html += /* HTML */ `<uc-source-btn role="listitem" type="mobile-${mode}-camera"></uc-source-btn>`;
31
+ });
32
+
33
+ if (cameraModes.length === 0) {
34
+ html += /* HTML */ `<uc-source-btn role="listitem" type="mobile-photo-camera"></uc-source-btn>`;
35
+ }
36
+ });
28
37
 
29
- if (
30
- srcName === ActivityBlock.activities.CAMERA &&
31
- isMobile &&
32
- calcCameraModes(this.cfg).isVideoRecordingEnabled
33
- ) {
34
- html += /* HTML */ `<uc-source-btn role="listitem" type="video-camera"></uc-source-btn>`;
38
+ return;
35
39
  }
40
+
41
+ html += /* HTML */ `<uc-source-btn role="listitem" type="${srcName}"></uc-source-btn>`;
36
42
  });
37
43
 
38
44
  if (this.cfg.sourceListWrap) {
@@ -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: () => {