@uploadcare/file-uploader 1.12.0-alpha.0 → 1.12.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/abstract/UploaderBlock.d.ts +0 -2
  2. package/abstract/UploaderBlock.d.ts.map +1 -1
  3. package/blocks/CameraSource/CameraSource.d.ts.map +1 -1
  4. package/blocks/CameraSource/CameraSource.js +11 -10
  5. package/blocks/Config/Config.d.ts +1 -1
  6. package/blocks/Config/Config.d.ts.map +1 -1
  7. package/blocks/Config/initialConfig.d.ts.map +1 -1
  8. package/blocks/Config/initialConfig.js +1 -0
  9. package/blocks/Config/normalizeConfigValue.d.ts.map +1 -1
  10. package/blocks/Config/normalizeConfigValue.js +1 -0
  11. package/blocks/ExternalSource/ExternalSource.d.ts +8 -2
  12. package/blocks/ExternalSource/ExternalSource.d.ts.map +1 -1
  13. package/blocks/ExternalSource/ExternalSource.js +27 -16
  14. package/blocks/ExternalSource/external-source.css +14 -0
  15. package/blocks/ExternalSource/types.d.ts +1 -12
  16. package/blocks/ExternalSource/types.d.ts.map +1 -1
  17. package/blocks/ExternalSource/types.js +1 -15
  18. package/blocks/FileItem/FileItem.d.ts +4 -0
  19. package/blocks/FileItem/FileItem.d.ts.map +1 -1
  20. package/blocks/FileItem/FileItem.js +22 -2
  21. package/blocks/ProgressBar/ProgressBar.d.ts.map +1 -1
  22. package/blocks/ProgressBar/ProgressBar.js +30 -6
  23. package/blocks/ProgressBar/progress-bar.css +35 -1
  24. package/blocks/SourceList/SourceList.d.ts.map +1 -1
  25. package/blocks/SourceList/SourceList.js +11 -0
  26. package/blocks/Spinner/Spinner.d.ts +8 -0
  27. package/blocks/Spinner/Spinner.d.ts.map +1 -0
  28. package/blocks/Spinner/Spinner.js +5 -0
  29. package/blocks/Spinner/spinner.css +18 -0
  30. package/blocks/themes/uc-basic/index.css +1 -0
  31. package/blocks/themes/uc-basic/svg-sprite.d.ts +1 -1
  32. package/blocks/themes/uc-basic/svg-sprite.js +1 -1
  33. package/blocks/utils/UploadSource.d.ts +0 -2
  34. package/blocks/utils/UploadSource.d.ts.map +1 -1
  35. package/blocks/utils/UploadSource.js +0 -1
  36. package/env.d.ts +1 -1
  37. package/env.js +1 -1
  38. package/index.d.ts +1 -0
  39. package/index.js +1 -0
  40. package/index.ssr.d.ts +8 -30
  41. package/index.ssr.d.ts.map +1 -1
  42. package/index.ssr.js +18 -36
  43. package/locales/file-uploader/ar.d.ts +1 -1
  44. package/locales/file-uploader/ar.js +1 -1
  45. package/locales/file-uploader/az.d.ts +1 -1
  46. package/locales/file-uploader/az.js +1 -1
  47. package/locales/file-uploader/ca.d.ts +1 -1
  48. package/locales/file-uploader/ca.js +1 -1
  49. package/locales/file-uploader/cs.d.ts +1 -1
  50. package/locales/file-uploader/cs.js +1 -1
  51. package/locales/file-uploader/da.d.ts +1 -1
  52. package/locales/file-uploader/da.js +1 -1
  53. package/locales/file-uploader/de.d.ts +1 -1
  54. package/locales/file-uploader/de.js +1 -1
  55. package/locales/file-uploader/el.d.ts +1 -1
  56. package/locales/file-uploader/el.js +1 -1
  57. package/locales/file-uploader/en.d.ts +1 -1
  58. package/locales/file-uploader/en.js +2 -2
  59. package/locales/file-uploader/es.d.ts +1 -1
  60. package/locales/file-uploader/es.js +1 -1
  61. package/locales/file-uploader/et.d.ts +1 -1
  62. package/locales/file-uploader/et.js +1 -1
  63. package/locales/file-uploader/fi.d.ts +1 -1
  64. package/locales/file-uploader/fi.js +1 -1
  65. package/locales/file-uploader/fr.d.ts +1 -1
  66. package/locales/file-uploader/fr.js +1 -1
  67. package/locales/file-uploader/he.d.ts +1 -1
  68. package/locales/file-uploader/he.js +1 -1
  69. package/locales/file-uploader/hy.d.ts +1 -1
  70. package/locales/file-uploader/hy.js +1 -1
  71. package/locales/file-uploader/is.d.ts +1 -1
  72. package/locales/file-uploader/is.js +1 -1
  73. package/locales/file-uploader/it.d.ts +1 -1
  74. package/locales/file-uploader/it.js +1 -1
  75. package/locales/file-uploader/ja.d.ts +1 -1
  76. package/locales/file-uploader/ja.js +1 -1
  77. package/locales/file-uploader/ka.d.ts +1 -1
  78. package/locales/file-uploader/ka.js +1 -1
  79. package/locales/file-uploader/kk.d.ts +1 -1
  80. package/locales/file-uploader/kk.js +1 -1
  81. package/locales/file-uploader/ko.d.ts +1 -1
  82. package/locales/file-uploader/ko.js +1 -1
  83. package/locales/file-uploader/lv.d.ts +1 -1
  84. package/locales/file-uploader/lv.js +1 -1
  85. package/locales/file-uploader/nb.d.ts +1 -1
  86. package/locales/file-uploader/nb.js +1 -1
  87. package/locales/file-uploader/nl.d.ts +1 -1
  88. package/locales/file-uploader/nl.js +1 -1
  89. package/locales/file-uploader/pl.d.ts +1 -1
  90. package/locales/file-uploader/pl.js +1 -1
  91. package/locales/file-uploader/pt.d.ts +1 -1
  92. package/locales/file-uploader/pt.js +1 -1
  93. package/locales/file-uploader/ro.d.ts +1 -1
  94. package/locales/file-uploader/ro.js +1 -1
  95. package/locales/file-uploader/ru.d.ts +1 -1
  96. package/locales/file-uploader/ru.js +1 -1
  97. package/locales/file-uploader/sk.d.ts +1 -1
  98. package/locales/file-uploader/sk.js +1 -1
  99. package/locales/file-uploader/sr.d.ts +1 -1
  100. package/locales/file-uploader/sr.js +1 -1
  101. package/locales/file-uploader/sv.d.ts +1 -1
  102. package/locales/file-uploader/sv.js +1 -1
  103. package/locales/file-uploader/tr.d.ts +1 -1
  104. package/locales/file-uploader/tr.js +1 -1
  105. package/locales/file-uploader/uk.d.ts +1 -1
  106. package/locales/file-uploader/uk.js +1 -1
  107. package/locales/file-uploader/vi.d.ts +1 -1
  108. package/locales/file-uploader/vi.js +1 -1
  109. package/locales/file-uploader/zh-TW.d.ts +1 -1
  110. package/locales/file-uploader/zh-TW.js +1 -1
  111. package/locales/file-uploader/zh.d.ts +1 -1
  112. package/locales/file-uploader/zh.js +1 -1
  113. package/package.json +2 -4
  114. package/types/exported.d.ts +168 -0
  115. package/web/file-uploader.iife.min.js +4 -4
  116. package/web/file-uploader.min.js +4 -4
  117. package/web/uc-basic.min.css +1 -1
  118. package/web/uc-cloud-image-editor.min.js +1 -1
  119. package/web/uc-file-uploader-inline.min.css +1 -1
  120. package/web/uc-file-uploader-inline.min.js +4 -4
  121. package/web/uc-file-uploader-minimal.min.css +1 -1
  122. package/web/uc-file-uploader-minimal.min.js +3 -3
  123. package/web/uc-file-uploader-regular.min.css +1 -1
  124. package/web/uc-file-uploader-regular.min.js +4 -4
  125. package/web/uc-img.min.js +1 -1
@@ -78,7 +78,6 @@ export namespace UploaderBlock {
78
78
  DROPBOX: "dropbox";
79
79
  GDRIVE: "gdrive";
80
80
  GPHOTOS: "gphotos";
81
- INSTAGRAM: "instagram";
82
81
  FLICKR: "flickr";
83
82
  VK: "vk";
84
83
  EVERNOTE: "evernote";
@@ -92,7 +91,6 @@ export namespace UploaderBlock {
92
91
  DROPBOX: "dropbox";
93
92
  GDRIVE: "gdrive";
94
93
  GPHOTOS: "gphotos";
95
- INSTAGRAM: "instagram";
96
94
  FLICKR: "flickr";
97
95
  VK: "vk";
98
96
  EVERNOTE: "evernote";
@@ -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,qBA0BC;IAvBC,eAAe;IACf,6BAAiG;IAEjG,eAAe;IACf,uCAEC;IAmBH;;;OAGG;IACH,qBAkBC;IAED,eAAe;IACf,0BAYQ;IAER;;;;OAIG;IACH,gCAiCE;IAEF;;;OAGG;IACH,0CAyFE;IAEF,eAAe;IACf,mCAoBE;IAEF,eAAe;IACf,uBAuCC;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAra6B,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,qBA0BC;IAvBC,eAAe;IACf,6BAAiG;IAEjG,eAAe;IACf,uCAEC;IAmBH;;;OAGG;IACH,qBAkBC;IAED,eAAe;IACf,0BAYQ;IAER;;;;OAIG;IACH,gCAiCE;IAEF;;;OAGG;IACH,0CAyFE;IAEF,eAAe;IACf,mCAoBE;IAEF,eAAe;IACf,uBAuCC;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAra6B,oBAAoB;qCAWb,2BAA2B;kCAG9B,wBAAwB;kCADxB,wBAAwB;gCAD1B,sBAAsB"}
@@ -1 +1 @@
1
- {"version":3,"file":"CameraSource.d.ts","sourceRoot":"","sources":["CameraSource.js"],"names":[],"mappings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;IAEF,mCAAmC;IACnC,uBADY,YAAY,UAuCtB;IAEF;;;OAGG;IACH,wBAmBE;IAEF,eAAe;IACf,cAoBC;IAjBC,uCAA+C;IAC/C,kDAAyC;IAkB3C;;;OAGG;IACH,yBAwBE;IADA,oCAAuB;IAGzB;;;;;OAKG;IACH,oBALW,QAAQ,GAAG,OAAO,OAClB,MAAM,GAAG,MAAM,wBAEf,IAAI,UAYb;IAEF,uCAAuC;IACvC,4BADY,SAAS,SAAS,OAmC7B;IAED;;;;OAIG;IACH,gBAFW,IAAI,UAOb;IAEF;;;OAGG;IACH,6BA8CQ;IAER,6CAQE;IAEF,yBAWE;IAFE,gCAAuB;IAI3B,8BAyCE;IAEF,qCAEE;IAEF,uCAYE;IAEF,2BAA0B;IAE1B,0CASE;IAEF,iCAsCE;IAlCE;;;oBAKK;IAEL;;;oBAOO;IAsBX,iCAIE;IAEF,mCAYE;IAgCF,iBAMC;IAED,iCAIC;CACF;;;;;;;;;;;;;;;;;;0BApwBa,OAAO,GAAG,OAAO;2BAEjB,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ;8BAtCnD,iCAAiC"}
@@ -215,13 +215,14 @@ export class CameraSource extends UploaderBlock {
215
215
  ...this.cfg.mediaRecorerOptions,
216
216
  };
217
217
 
218
- if (
219
- this.cfg.mediaRecorerOptions?.mimeType &&
220
- MediaRecorder.isTypeSupported(this.cfg.mediaRecorerOptions.mimeType)
221
- ) {
222
- this._options.mimeType = this.cfg.mediaRecorerOptions.mimeType;
223
- } else {
218
+ const { mimeType } = this.cfg.mediaRecorerOptions || {};
219
+
220
+ if (mimeType && MediaRecorder.isTypeSupported(mimeType)) {
221
+ this._options.mimeType = mimeType;
222
+ } else if (MediaRecorder.isTypeSupported(DEFAULT_VIDEO_FORMAT)) {
224
223
  this._options.mimeType = DEFAULT_VIDEO_FORMAT;
224
+ } else {
225
+ this._options.mimeType = 'video/mp4';
225
226
  }
226
227
 
227
228
  if (this._stream) {
@@ -404,7 +405,7 @@ export class CameraSource extends UploaderBlock {
404
405
  currentIcon: 'video-camera-full',
405
406
  mutableClassButton: 'uc-shot-btn uc-camera-action',
406
407
 
407
- audioSelectHidden: !this.cfg.enableAudioRecording,
408
+ audioSelectHidden: !this.cfg.enableAudioRecording || this.audioDevices.length <= 1,
408
409
  cameraSelectHidden: this.cameraDevices.length <= 1,
409
410
  });
410
411
  }
@@ -480,7 +481,7 @@ export class CameraSource extends UploaderBlock {
480
481
  currentTimelineIcon: 'play',
481
482
  currentIcon: 'video-camera-full',
482
483
 
483
- audioSelectHidden: !this.cfg.enableAudioRecording,
484
+ audioSelectHidden: !this.cfg.enableAudioRecording || this.audioDevices.length <= 1,
484
485
  audioToggleMicorphoneHidden: !this.cfg.enableAudioRecording,
485
486
  });
486
487
  }
@@ -796,10 +797,10 @@ export class CameraSource extends UploaderBlock {
796
797
 
797
798
  _destroy() {
798
799
  for (const permission of DEFAULT_PERMISSIONS) {
799
- this[`${permission}Response`].removeEventListener('change', this._handlePermissionsChange);
800
+ this[`${permission}Response`]?.removeEventListener('change', this._handlePermissionsChange);
800
801
  }
801
802
 
802
- navigator.mediaDevices.removeEventListener('devicechange', this._getDevices);
803
+ navigator.mediaDevices?.removeEventListener('devicechange', this._getDevices);
803
804
  }
804
805
 
805
806
  async destroyCallback() {
@@ -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<"pubkey" | "multiple" | "accept" | "store" | "debug" | "crop-preset" | "secure-expire" | "max-local-file-size-bytes" | "multiple-min" | "multiple-max" | "confirm-upload" | "img-only" | "external-sources-preferred-types" | "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" | "default-camera-mode" | "enable-audio-recording" | "enable-video-recording" | "max-video-recording-duration" | "secureexpire" | "croppreset" | "maxlocalfilesizebytes" | "multiplemin" | "multiplemax" | "confirmupload" | "imgonly" | "externalsourcespreferredtypes" | "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" | "defaultcameramode" | "enableaudiorecording" | "enablevideorecording" | "maxvideorecordingduration", string>;
67
+ declare const attrStateMapping: Record<"pubkey" | "multiple" | "accept" | "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" | "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" | "defaultcameramode" | "enableaudiorecording" | "enablevideorecording" | "maxvideorecordingduration", 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":"AAYA;;;;;;;;;;;;;GAaG;AACH,gCAXU;IACT,UAAc;IACd,0BAA8B;IAC9B,gCAAoC;IACpC,gCAAoC;IACpC,kBAAsB;IACtB,gBAAoB;IACpB,sBAA0B;IAC1B,qBAAyB;CACtB,CAWF;qBAiNY,OAAO,2BAA2B,EAAE,UAAU,CAAC,kBAAkB,EAAE,OAAO,aAAa,EAAE,UAAU,CAAC;AAAlH,6HAA6H;AAG7H,4BAAmF;AAvLnF;IAkBE;;;;OAIG;IACH,+BAYC;IAED;;;;OAIG;IACH,2BAQC;IAED;;;;OAIG;IACH,kBAiBC;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;sBAvOqB,yBAAyB;AAsD/C,0CAA0C;AAC1C,0gEAGG"}
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["Config.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;GAaG;AACH,gCAXU;IACT,UAAc;IACd,0BAA8B;IAC9B,gCAAoC;IACpC,gCAAoC;IACpC,kBAAsB;IACtB,gBAAoB;IACpB,sBAA0B;IAC1B,qBAAyB;CACtB,CAWF;qBAiNY,OAAO,2BAA2B,EAAE,UAAU,CAAC,kBAAkB,EAAE,OAAO,aAAa,EAAE,UAAU,CAAC;AAAlH,6HAA6H;AAG7H,4BAAmF;AAvLnF;IAkBE;;;;OAIG;IACH,+BAYC;IAED;;;;OAIG;IACH,2BAQC;IAED;;;;OAIG;IACH,kBAiBC;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;sBAvOqB,yBAAyB;AAsD/C,0CAA0C;AAC1C,qkEAGG"}
@@ -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,CAiElD"}
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,CAkElD"}
@@ -18,6 +18,7 @@ export const initialConfig = {
18
18
  imgOnly: false,
19
19
  accept: '',
20
20
  externalSourcesPreferredTypes: '',
21
+ externalSourcesEmbedCss: '',
21
22
  store: 'auto',
22
23
  cameraMirror: false,
23
24
  cameraCapture: '',
@@ -1 +1 @@
1
- {"version":3,"file":"normalizeConfigValue.d.ts","sourceRoot":"","sources":["normalizeConfigValue.js"],"names":[],"mappings":"AAeO,iCADK,OAAO,WAWlB;AA4JM,sGAHI,OAAO,mDAcjB"}
1
+ {"version":3,"file":"normalizeConfigValue.d.ts","sourceRoot":"","sources":["normalizeConfigValue.js"],"names":[],"mappings":"AAeO,iCADK,OAAO,WAWlB;AA6JM,sGAHI,OAAO,mDAcjB"}
@@ -113,6 +113,7 @@ const mapping = {
113
113
  imgOnly: asBoolean,
114
114
  accept: asString,
115
115
  externalSourcesPreferredTypes: asString,
116
+ externalSourcesEmbedCss: asString,
116
117
  store: asStore,
117
118
  cameraMirror: asBoolean,
118
119
  cameraCapture: asCameraCapture,
@@ -7,12 +7,13 @@ export class ExternalSource extends UploaderBlock {
7
7
  /** @type {import('./types.js').InputMessageMap['selected-files-change']['selectedFiles']} */
8
8
  selectedList: import('./types.js').InputMessageMap['selected-files-change']['selectedFiles'];
9
9
  total: number;
10
- iframe: null;
11
10
  isSelectionReady: boolean;
11
+ isDoneBtnEnabled: boolean;
12
12
  couldSelectAll: boolean;
13
13
  couldDeselectAll: boolean;
14
14
  showSelectionStatus: boolean;
15
15
  counterText: string;
16
+ doneBtnTextClass: string;
16
17
  onDone: () => void;
17
18
  onCancel: () => void;
18
19
  onSelectAll: () => void;
@@ -46,7 +47,12 @@ export class ExternalSource extends UploaderBlock {
46
47
  /** @private */
47
48
  private handleIframeLoad;
48
49
  /** @private */
49
- private applyStyles;
50
+ private applyTheme;
51
+ /**
52
+ * @private
53
+ * @param {string} css
54
+ */
55
+ private applyEmbedCss;
50
56
  /** @private */
51
57
  private setupL10n;
52
58
  /** @private */
@@ -1 +1 @@
1
- {"version":3,"file":"ExternalSource.d.ts","sourceRoot":"","sources":["ExternalSource.js"],"names":[],"mappings":"AAYA,+DAA+D;AAE/D;IAEE,yBAAiD;IAK/C;;;QAKE,6FAA6F;sBAAlF,OAAO,YAAY,EAAE,eAAe,CAAC,uBAAuB,CAAC,CAAC,eAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;MAgC1F;IAGH,6BAA6B;IAC7B,qCAMC;IA4CD;;;OAGG;IACH,mCAcC;IAED;;;OAGG;IACH,kCAoBC;IAED,eAAe;IACf,yBAOC;IAED,eAAe;IACf,oBAKC;IAED,eAAe;IACf,kBAKC;IAED,eAAe;IACf,kBAeC;IAED,eAAe;IACf,oBA8BC;IALC,eAAe;IACf,uBAA6D;IAM/D,eAAe;IACf,sBAMC;IAED,eAAe;IACf,6BASC;CACF;;;;6BAnPa;IAAE,kBAAkB,EAAE,MAAM,CAAA;CAAE;8BARd,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;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
@@ -8,7 +8,6 @@ import { wildcardRegexp } from '../../utils/wildcardRegexp.js';
8
8
  import { buildThemeDefinition } from './buildThemeDefinition.js';
9
9
  import { MessageBridge } from './MessageBridge.js';
10
10
  import { queryString } from './query-string.js';
11
- import { A11y } from '../../abstract/a11y.js';
12
11
 
13
12
  /** @typedef {{ externalSourceType: string }} ActivityParams */
14
13
 
@@ -27,13 +26,14 @@ export class ExternalSource extends UploaderBlock {
27
26
  /** @type {import('./types.js').InputMessageMap['selected-files-change']['selectedFiles']} */
28
27
  selectedList: [],
29
28
  total: 0,
30
- iframe: null,
31
29
 
32
30
  isSelectionReady: false,
31
+ isDoneBtnEnabled: false,
33
32
  couldSelectAll: false,
34
33
  couldDeselectAll: false,
35
34
  showSelectionStatus: false,
36
35
  counterText: '',
36
+ doneBtnTextClass: 'uc-hidden',
37
37
 
38
38
  onDone: () => {
39
39
  for (const message of this.$.selectedList) {
@@ -108,6 +108,10 @@ export class ExternalSource extends UploaderBlock {
108
108
  this.subConfigValue('localeName', (val) => {
109
109
  this.setupL10n();
110
110
  });
111
+
112
+ this.subConfigValue('externalSourcesEmbedCss', (embedCss) => {
113
+ this.applyEmbedCss(embedCss);
114
+ });
111
115
  }
112
116
 
113
117
  /**
@@ -148,7 +152,9 @@ export class ExternalSource extends UploaderBlock {
148
152
  );
149
153
 
150
154
  this.set$({
155
+ doneBtnTextClass: message.isReady ? '' : 'uc-hidden',
151
156
  isSelectionReady: message.isReady,
157
+ isDoneBtnEnabled: message.isReady && message.selectedFiles.length > 0,
152
158
  showSelectionStatus: message.isMultipleMode && message.total > 0,
153
159
  couldSelectAll: message.selectedCount < message.total,
154
160
  couldDeselectAll: message.selectedCount === message.total,
@@ -158,22 +164,30 @@ export class ExternalSource extends UploaderBlock {
158
164
 
159
165
  /** @private */
160
166
  handleIframeLoad() {
161
- this.applyStyles();
167
+ this.applyEmbedCss(this.cfg.externalSourcesEmbedCss);
168
+ this.applyTheme();
162
169
  this.setupL10n();
163
-
164
- this.$.iframe.contentWindow?.focus();
165
-
166
- this.a11y?.registerBlock(this);
167
170
  }
168
171
 
169
172
  /** @private */
170
- applyStyles() {
173
+ applyTheme() {
171
174
  this._messageBridge?.send({
172
175
  type: 'set-theme-definition',
173
176
  theme: buildThemeDefinition(this),
174
177
  });
175
178
  }
176
179
 
180
+ /**
181
+ * @private
182
+ * @param {string} css
183
+ */
184
+ applyEmbedCss(css) {
185
+ this._messageBridge?.send({
186
+ type: 'set-embed-css',
187
+ css,
188
+ });
189
+ }
190
+
177
191
  /** @private */
178
192
  setupL10n() {
179
193
  this._messageBridge?.send({
@@ -216,7 +230,6 @@ export class ExternalSource extends UploaderBlock {
216
230
  });
217
231
  iframe.addEventListener('load', this.handleIframeLoad.bind(this));
218
232
 
219
- this.$['iframe'] = iframe;
220
233
  this.ref.iframeWrapper.innerHTML = '';
221
234
  this.ref.iframeWrapper.appendChild(iframe);
222
235
 
@@ -247,7 +260,7 @@ export class ExternalSource extends UploaderBlock {
247
260
  this.set$({
248
261
  selectedList: [],
249
262
  total: 0,
250
- isSelectionReady: false,
263
+ isDoneBtnEnabled: false,
251
264
  couldSelectAll: false,
252
265
  couldDeselectAll: false,
253
266
  showSelectionStatus: false,
@@ -275,12 +288,10 @@ ExternalSource.template = /* HTML */ `
275
288
  <button type="button" set="onclick: onSelectAll; @hidden: !couldSelectAll" l10n="select-all"></button>
276
289
  <button type="button" set="onclick: onDeselectAll; @hidden: !couldDeselectAll" l10n="deselect-all"></button>
277
290
  </div>
278
- <button
279
- type="button"
280
- class="uc-done-btn uc-primary-btn"
281
- set="onclick: onDone; @disabled: !isSelectionReady"
282
- l10n="done"
283
- ></button>
291
+ <button type="button" class="uc-done-btn uc-primary-btn" set="onclick: onDone; @disabled: !isDoneBtnEnabled;">
292
+ <uc-spinner set="@hidden: isSelectionReady"></uc-spinner>
293
+ <span l10n="done" set="@class: doneBtnTextClass"></span>
294
+ </button>
284
295
  </div>
285
296
  </div>
286
297
  `;
@@ -78,3 +78,17 @@ uc-external-source uc-activity-header {
78
78
  uc-external-source uc-activity-header .uc-close-btn {
79
79
  pointer-events: auto;
80
80
  }
81
+
82
+ uc-external-source .uc-done-btn > span.uc-hidden {
83
+ visibility: hidden;
84
+ pointer-events: none;
85
+ }
86
+
87
+ uc-external-source .uc-done-btn > uc-spinner {
88
+ position: absolute;
89
+ width: 100%;
90
+ height: 100%;
91
+ display: flex;
92
+ align-items: center;
93
+ justify-content: center;
94
+ }
@@ -1,16 +1,5 @@
1
- export type InstagramInfo = {
2
- caption?: string | null;
3
- created: number;
4
- id: string;
5
- public_page?: string;
6
- username: string;
7
- size?: number;
8
- name?: string;
9
- modified?: number;
10
- };
11
1
  export type DoneSuccessResponse = {
12
2
  error?: undefined;
13
- info?: InstagramInfo;
14
3
  alternatives?: Record<string, string>;
15
4
  is_image?: boolean | null;
16
5
  filename?: string;
@@ -108,6 +97,6 @@ export type OutputMessage = {
108
97
  localeDefinition: string;
109
98
  } | {
110
99
  type: 'set-embed-css';
111
- css: Partial<ThemeDefinition>;
100
+ css: string;
112
101
  };
113
102
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":"4BAGa;IACZ,OAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAW,EAAE,MAAM,CAAC;IACpB,EAAM,EAAE,MAAM,CAAC;IACf,WAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAY,EAAE,MAAM,CAAC;IACrB,IAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAY,CAAC,EAAE,MAAM,CAAC;CACnB;kCAIS;IACZ,KAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,YAAgB,CAAC,EAAE,OAAO,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,Q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ACzC,iCAAqC,EAAE,MAAM,CAAC;IAC9C,kBAAsB,EAAE,MAAM,CAAC;IAC/B,6BAAiC,EAAE,MAAM,CAAC;IAC1C,wBAA4B,EAAE,MAAM,CAAC;IACrC,mCAAuC,EAAE,MAAM,CAAC;IAChD,mBAAuB,EAAE,MAAM,CAAC;IAChC,uBAA2B,EAAE,MAAM,CAAC;IACpC,mBAAuB,EAAE,MAAM,CAAC;IAChC,yBAA6B,EAAE,MAAM,CAAC;IACtC,+BAAmC,EAAE,MAAM,CAAC;IAC5C,sBAA0B,EAAE,MAAM,CAAC;IACnC,sBAA0B,EAAE,MAAM,CAAC;IACnC,8BAAkC,EAAE,MAAM,CAAC;IAC3C,qBAAyB,EAAE,MAAM,CAAC;IAClC,2BAA+B,EAAE,MAAM,CAAC;IACxC,gCAAoC,EAAE,MAAM,CAAC;IAC7C,iBAAqB,EAAE,MAAM,CAAC;IAC9B,4BAAgC,EAAE,MAAM,CAAC;IACzC,uBAA2B,EAAE,MAAM,CAAC;IACpC,kCAAsC,EAAE,MAAM,CAAC;IAC/C,kBAAsB,EAAE,MAAM,CAAC;IAC/B,0BAA8B,EAAE,MAAM,CAAC;IACvC,yBAA6B,EAAE,MAAM,CAAC;CACnC;4BAIS;IACZ,IAAY,EAAE,YAAY,CAAC;CACpB,GACD;IACN,IAAY,EAAE,cAAc,CAAC;CACtB,GACD;IACN,IAAY,EAAE,sBAAsB,CAAC;IACrC,KAAa,EAAE,OAAO,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,GACD;IACN,IAAY,EAAE,uBAAuB,CAAC;IACtC,gBAAwB,EAAE,MAAM,CAAC;CAC1B,GACD;IACN,IAAY,EAAE,eAAe,CAAC;IAC9B,GAAW,EAAE,MAAM,CAAC;CACb"}
@@ -1,22 +1,8 @@
1
1
  // @ts-check
2
2
 
3
- /**
4
- * @typedef {{
5
- * caption?: string | null;
6
- * created: number;
7
- * id: string;
8
- * public_page?: string;
9
- * username: string;
10
- * size?: number;
11
- * name?: string;
12
- * modified?: number;
13
- * }} InstagramInfo
14
- */
15
-
16
3
  /**
17
4
  * @typedef {{
18
5
  * error?: undefined;
19
- * info?: InstagramInfo;
20
6
  * alternatives?: Record<string, string>;
21
7
  * is_image?: boolean | null;
22
8
  * filename?: string;
@@ -136,7 +122,7 @@
136
122
  * }
137
123
  * | {
138
124
  * type: 'set-embed-css';
139
- * css: Partial<ThemeDefinition>;
125
+ * css: string;
140
126
  * }} OutputMessage
141
127
  */
142
128
 
@@ -18,6 +18,7 @@ export class FileItem extends UploaderBlock {
18
18
  uid: string;
19
19
  itemName: string;
20
20
  errorText: string;
21
+ hint: string;
21
22
  thumbUrl: string;
22
23
  progressValue: number;
23
24
  progressVisible: boolean;
@@ -62,6 +63,9 @@ export class FileItem extends UploaderBlock {
62
63
  * @param {(value: any) => void} handler
63
64
  */
64
65
  private _subEntry;
66
+ _updateHint: (() => void) & {
67
+ readonly cancel: () => void;
68
+ };
65
69
  /**
66
70
  * @private
67
71
  * @param {String} id
@@ -1 +1 @@
1
- {"version":3,"file":"FileItem.d.ts","sourceRoot":"","sources":["FileItem.js"],"names":[],"mappings":"AAkBA;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA4BC;IAGH,eASC;IAED;;;OAGG;IACH,0BAaC;IAED,eAAe;IACf,wBAgBC;IAED,eAAe;IACf,2BAsCC;IAED;;;;OAIG;IACH,kBAUC;IAED;;;OAGG;IACH,uBAkDC;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;;;;;8BApa6B,iCAAiC;AAO/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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
@@ -8,6 +8,8 @@ import { fileCssBg } from '../svg-backgrounds/svg-backgrounds.js';
8
8
  import { debounce } from '../utils/debounce.js';
9
9
  import { generateThumb } from '../utils/resizeImage.js';
10
10
  import { parseShrink } from '../../utils/parseShrink.js';
11
+ import { UploadSource } from '../utils/UploadSource.js';
12
+ import { throttle } from '../utils/throttle.js';
11
13
 
12
14
  const FileItemState = Object.freeze({
13
15
  FINISHED: Symbol('FINISHED'),
@@ -45,6 +47,7 @@ export class FileItem extends UploaderBlock {
45
47
  uid: '',
46
48
  itemName: '',
47
49
  errorText: '',
50
+ hint: '',
48
51
  thumbUrl: '',
49
52
  progressValue: 0,
50
53
  progressVisible: false,
@@ -178,6 +181,21 @@ export class FileItem extends UploaderBlock {
178
181
  this._entrySubs.add(sub);
179
182
  }
180
183
 
184
+ _updateHint = throttle(() => {
185
+ const showHint =
186
+ this.$.state === FileItemState.UPLOADING &&
187
+ this._entry.getValue('externalUrl') &&
188
+ this._entry.getValue('source') !== UploadSource.URL &&
189
+ this._entry.getValue('errors').length === 0 &&
190
+ this.$.progressValue === 0;
191
+
192
+ const hint = showHint
193
+ ? this.l10n('waiting-for', { source: this.l10n(`src-type-${this._entry.getValue('source')}`) })
194
+ : '';
195
+
196
+ this.$.hint = hint;
197
+ }, 100);
198
+
181
199
  /**
182
200
  * @private
183
201
  * @param {String} id
@@ -195,6 +213,7 @@ export class FileItem extends UploaderBlock {
195
213
 
196
214
  this._subEntry('uploadProgress', (uploadProgress) => {
197
215
  this.$.progressValue = uploadProgress;
216
+ this._updateHint();
198
217
  });
199
218
 
200
219
  this._subEntry('fileName', (name) => {
@@ -280,8 +299,6 @@ export class FileItem extends UploaderBlock {
280
299
 
281
300
  if (state === FileItemState.UPLOADING) {
282
301
  this.$.isFocused = false;
283
- } else {
284
- this.$.progressValue = 0;
285
302
  }
286
303
 
287
304
  this.set$({
@@ -296,6 +313,8 @@ export class FileItem extends UploaderBlock {
296
313
  status: this.l10n(state?.description?.toLocaleLowerCase() ?? '').toLocaleLowerCase(),
297
314
  }),
298
315
  });
316
+
317
+ this._updateHint();
299
318
  }
300
319
 
301
320
  destroyCallback() {
@@ -434,6 +453,7 @@ FileItem.template = /* HTML */ `
434
453
  <div aria-live="polite" class="uc-file-name-wrapper" set="@aria-label:ariaLabelStatusFile;">
435
454
  <span class="uc-file-name" set="@title: itemName">{{itemName}}</span>
436
455
  <span class="uc-file-error" set="@hidden: !errorText">{{errorText}}</span>
456
+ <span class="uc-file-hint" set="@hidden: !hint">{{hint}}</span>
437
457
  </div>
438
458
  <div class="uc-file-actions">
439
459
  <button
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["ProgressBar.js"],"names":[],"mappings":"AAEA;IACE,qBAAqB;IACrB,eAAW;IAEX,WAIE;CAyBH;;;;sBAnCqB,yBAAyB"}
1
+ {"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["ProgressBar.js"],"names":[],"mappings":"AAEA;IACE,qBAAqB;IACrB,eAAW;IAEX,WAIE;CA8CH;;;;sBAxDqB,yBAAyB"}
@@ -19,20 +19,44 @@ export class ProgressBar extends Block {
19
19
  const prevValue = this._value;
20
20
  this._value = value;
21
21
 
22
+ if (value === 100) {
23
+ this.ref.realProgressLine.addEventListener(
24
+ 'transitionend',
25
+ () => {
26
+ this.ref.realProgressLine.classList.toggle('uc-progress--hidden', true);
27
+ },
28
+ {
29
+ once: true,
30
+ },
31
+ );
32
+ }
33
+
34
+ this.ref.fakeProgressLine.classList.toggle('uc-fake-progress--hidden', value !== 0);
35
+
22
36
  if (value === 0 && prevValue > 0) {
23
- this.ref.line.addEventListener('transitionend', () => {
24
- this.style.setProperty('--l-width', this._value.toString());
25
- });
37
+ this.ref.realProgressLine.addEventListener(
38
+ 'transitionend',
39
+ () => {
40
+ this.style.setProperty('--l-progress-value', this._value.toString());
41
+ },
42
+ {
43
+ once: true,
44
+ },
45
+ );
26
46
  return;
27
47
  }
28
48
 
29
- this.style.setProperty('--l-width', this._value.toString());
49
+ this.style.setProperty('--l-progress-value', this._value.toString());
30
50
  });
31
51
 
32
52
  this.defineAccessor('visible', (visible) => {
33
- this.ref.line.classList.toggle('uc-progress--hidden', !visible);
53
+ this.ref.realProgressLine.classList.toggle('uc-progress--hidden', !visible);
54
+ this.ref.fakeProgressLine.classList.toggle('uc-fake-progress--hidden', !visible);
34
55
  });
35
56
  }
36
57
  }
37
58
 
38
- ProgressBar.template = /* HTML */ ` <div ref="line" class="uc-progress"></div> `;
59
+ ProgressBar.template = /* HTML */ `
60
+ <div ref="fakeProgressLine" class="uc-fake-progress"></div>
61
+ <div ref="realProgressLine" class="uc-progress"></div>
62
+ `;
@@ -1,4 +1,6 @@
1
1
  uc-progress-bar {
2
+ --l-progress-value: 0;
3
+
2
4
  position: absolute;
3
5
  top: 0;
4
6
  bottom: 0;
@@ -10,7 +12,8 @@ uc-progress-bar {
10
12
  }
11
13
 
12
14
  uc-progress-bar .uc-progress {
13
- width: calc(var(--l-width) * 1%);
15
+ position: absolute;
16
+ width: calc(var(--l-progress-value) * 1%);
14
17
  height: 100%;
15
18
  background-color: var(--uc-primary);
16
19
  transform: translateX(0);
@@ -23,3 +26,34 @@ uc-progress-bar .uc-progress {
23
26
  uc-progress-bar .uc-progress--hidden {
24
27
  opacity: 0;
25
28
  }
29
+
30
+ uc-progress-bar .uc-fake-progress {
31
+ --l-fake-progress-width: 30;
32
+
33
+ position: absolute;
34
+ width: calc(var(--l-fake-progress-width) * 1%);
35
+ height: 100%;
36
+ background-color: var(--uc-primary);
37
+ animation: fake-progress-animation 1s ease-in-out infinite;
38
+ opacity: 1;
39
+ transition:
40
+ opacity 0.3s,
41
+ display 1s;
42
+ /* stylelint-disable-next-line property-no-unknown */
43
+ transition-behavior: allow-discrete;
44
+ }
45
+
46
+ uc-progress-bar .uc-fake-progress--hidden {
47
+ opacity: 0;
48
+ display: none;
49
+ }
50
+
51
+ @keyframes fake-progress-animation {
52
+ from {
53
+ transform: translateX(-100%);
54
+ }
55
+
56
+ to {
57
+ transform: translateX(calc(100 / var(--l-fake-progress-width) * 100 * 1%));
58
+ }
59
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"SourceList.d.ts","sourceRoot":"","sources":["SourceList.js"],"names":[],"mappings":"AAGA;CAgBC;sBAnBqB,yBAAyB"}
1
+ {"version":3,"file":"SourceList.d.ts","sourceRoot":"","sources":["SourceList.js"],"names":[],"mappings":"AAGA;CA2BC;sBA9BqB,yBAAyB"}
@@ -7,9 +7,20 @@ export class SourceList extends Block {
7
7
  this.subConfigValue('sourceList', (/** @type {String} */ val) => {
8
8
  let list = stringToArray(val);
9
9
  let html = '';
10
+
10
11
  list.forEach((srcName) => {
12
+ if (srcName === 'instagram') {
13
+ console.error(
14
+ "Instagram source was removed because the Instagram Basic Display API hasn't been available since December 4, 2024. " +
15
+ 'Official statement, see here:' +
16
+ 'https://developers.facebook.com/blog/post/2024/09/04/update-on-instagram-basic-display-api/?locale=en_US',
17
+ );
18
+ return;
19
+ }
20
+
11
21
  html += /* HTML */ `<uc-source-btn type="${srcName}"></uc-source-btn>`;
12
22
  });
23
+
13
24
  if (this.cfg.sourceListWrap) {
14
25
  this.innerHTML = html;
15
26
  } else {
@@ -0,0 +1,8 @@
1
+ export class Spinner extends BaseComponent<any> {
2
+ constructor();
3
+ }
4
+ export namespace Spinner {
5
+ let template: string;
6
+ }
7
+ import { BaseComponent } from '@symbiotejs/symbiote';
8
+ //# sourceMappingURL=Spinner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["Spinner.js"],"names":[],"mappings":"AAEA;IAGq5B,cAAgB;CAHx3B;;;;8BAFf,sBAAsB"}
@@ -0,0 +1,5 @@
1
+ import { BaseComponent } from '@symbiotejs/symbiote';
2
+
3
+ export class Spinner extends BaseComponent {}
4
+
5
+ Spinner.template = /* HTML */ ` <div class="uc-spinner"></div> `;
@@ -0,0 +1,18 @@
1
+ @keyframes uc-spinner-keyframes {
2
+ from {
3
+ transform: rotate(0deg);
4
+ }
5
+ to {
6
+ transform: rotate(360deg);
7
+ }
8
+ }
9
+
10
+ .uc-spinner {
11
+ width: 1em;
12
+ height: 1em;
13
+ border: solid 2px transparent;
14
+ border-top-color: currentColor;
15
+ border-left-color: currentColor;
16
+ border-radius: 50%;
17
+ animation: uc-spinner-keyframes 400ms linear infinite;
18
+ }