@uploadcare/file-uploader 1.11.0-alpha.2 → 1.11.0-alpha.4

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/blocks/CameraSource/CameraSource.d.ts.map +1 -1
  2. package/blocks/CameraSource/CameraSource.js +9 -20
  3. package/blocks/CameraSource/camera-source.css +4 -16
  4. package/blocks/CloudImageEditorActivity/index.css +3 -3
  5. package/blocks/Config/Config.d.ts +3 -3
  6. package/blocks/Config/Config.d.ts.map +1 -1
  7. package/blocks/Config/Config.js +2 -2
  8. package/blocks/Config/initialConfig.js +3 -3
  9. package/blocks/Config/normalizeConfigValue.js +3 -3
  10. package/blocks/ExternalSource/ExternalSource.d.ts +20 -50
  11. package/blocks/ExternalSource/ExternalSource.d.ts.map +1 -1
  12. package/blocks/ExternalSource/ExternalSource.js +96 -99
  13. package/blocks/ExternalSource/MessageBridge.d.ts +20 -0
  14. package/blocks/ExternalSource/MessageBridge.d.ts.map +1 -0
  15. package/blocks/ExternalSource/MessageBridge.js +71 -0
  16. package/blocks/ExternalSource/buildThemeDefinition.d.ts +3 -0
  17. package/blocks/ExternalSource/buildThemeDefinition.d.ts.map +1 -0
  18. package/blocks/ExternalSource/buildThemeDefinition.js +47 -0
  19. package/blocks/ExternalSource/external-source.css +37 -22
  20. package/blocks/ExternalSource/types.d.ts +113 -0
  21. package/blocks/ExternalSource/types.d.ts.map +1 -0
  22. package/blocks/ExternalSource/types.js +143 -0
  23. package/blocks/Modal/Modal.d.ts.map +1 -1
  24. package/blocks/Modal/Modal.js +4 -11
  25. package/blocks/Modal/modal.css +3 -54
  26. package/blocks/StartFrom/start-from.css +2 -6
  27. package/blocks/UploadList/upload-list.css +1 -11
  28. package/blocks/UrlSource/url-source.css +0 -8
  29. package/blocks/themes/uc-basic/theme.css +2 -3
  30. package/index.ssr.d.ts.map +1 -1
  31. package/index.ssr.js +10 -14
  32. package/locales/file-uploader/ar.d.ts +2 -0
  33. package/locales/file-uploader/ar.js +3 -1
  34. package/locales/file-uploader/az.d.ts +2 -0
  35. package/locales/file-uploader/az.js +3 -1
  36. package/locales/file-uploader/ca.d.ts +2 -0
  37. package/locales/file-uploader/ca.js +3 -1
  38. package/locales/file-uploader/cs.d.ts +2 -0
  39. package/locales/file-uploader/cs.js +3 -1
  40. package/locales/file-uploader/da.d.ts +2 -0
  41. package/locales/file-uploader/da.js +3 -1
  42. package/locales/file-uploader/de.d.ts +2 -0
  43. package/locales/file-uploader/de.js +2 -0
  44. package/locales/file-uploader/el.d.ts +2 -0
  45. package/locales/file-uploader/el.js +3 -1
  46. package/locales/file-uploader/en.d.ts +2 -0
  47. package/locales/file-uploader/en.js +3 -1
  48. package/locales/file-uploader/es.d.ts +2 -0
  49. package/locales/file-uploader/es.js +2 -0
  50. package/locales/file-uploader/et.d.ts +2 -0
  51. package/locales/file-uploader/et.js +3 -1
  52. package/locales/file-uploader/fi.d.ts +2 -0
  53. package/locales/file-uploader/fi.js +120 -118
  54. package/locales/file-uploader/fr.d.ts +2 -0
  55. package/locales/file-uploader/fr.js +2 -0
  56. package/locales/file-uploader/he.d.ts +2 -0
  57. package/locales/file-uploader/he.js +2 -0
  58. package/locales/file-uploader/hy.d.ts +2 -0
  59. package/locales/file-uploader/hy.js +3 -1
  60. package/locales/file-uploader/is.d.ts +2 -0
  61. package/locales/file-uploader/is.js +3 -1
  62. package/locales/file-uploader/it.d.ts +2 -0
  63. package/locales/file-uploader/it.js +2 -0
  64. package/locales/file-uploader/ja.d.ts +2 -0
  65. package/locales/file-uploader/ja.js +3 -1
  66. package/locales/file-uploader/ka.d.ts +2 -0
  67. package/locales/file-uploader/ka.js +3 -1
  68. package/locales/file-uploader/kk.d.ts +2 -0
  69. package/locales/file-uploader/kk.js +3 -1
  70. package/locales/file-uploader/ko.d.ts +2 -0
  71. package/locales/file-uploader/ko.js +3 -1
  72. package/locales/file-uploader/lv.d.ts +2 -0
  73. package/locales/file-uploader/lv.js +3 -1
  74. package/locales/file-uploader/nb.d.ts +2 -0
  75. package/locales/file-uploader/nb.js +3 -1
  76. package/locales/file-uploader/nl.d.ts +2 -0
  77. package/locales/file-uploader/nl.js +3 -1
  78. package/locales/file-uploader/pl.d.ts +2 -0
  79. package/locales/file-uploader/pl.js +3 -1
  80. package/locales/file-uploader/pt.d.ts +2 -0
  81. package/locales/file-uploader/pt.js +3 -1
  82. package/locales/file-uploader/ro.d.ts +2 -0
  83. package/locales/file-uploader/ro.js +3 -1
  84. package/locales/file-uploader/ru.d.ts +2 -0
  85. package/locales/file-uploader/ru.js +2 -0
  86. package/locales/file-uploader/sk.d.ts +2 -0
  87. package/locales/file-uploader/sk.js +3 -1
  88. package/locales/file-uploader/sr.d.ts +2 -0
  89. package/locales/file-uploader/sr.js +3 -1
  90. package/locales/file-uploader/sv.d.ts +2 -0
  91. package/locales/file-uploader/sv.js +3 -1
  92. package/locales/file-uploader/tr.d.ts +2 -0
  93. package/locales/file-uploader/tr.js +2 -0
  94. package/locales/file-uploader/uk.d.ts +2 -0
  95. package/locales/file-uploader/uk.js +2 -0
  96. package/locales/file-uploader/vi.d.ts +2 -0
  97. package/locales/file-uploader/vi.js +3 -1
  98. package/locales/file-uploader/zh-TW.d.ts +2 -0
  99. package/locales/file-uploader/zh-TW.js +2 -0
  100. package/locales/file-uploader/zh.d.ts +2 -0
  101. package/locales/file-uploader/zh.js +2 -0
  102. package/package.json +2 -4
  103. package/types/exported.d.ts +3 -3
  104. package/web/file-uploader.iife.min.js +4 -4
  105. package/web/file-uploader.min.js +4 -4
  106. package/web/uc-basic.min.css +1 -1
  107. package/web/uc-cloud-image-editor.min.css +1 -1
  108. package/web/uc-cloud-image-editor.min.js +4 -4
  109. package/web/uc-file-uploader-inline.min.css +1 -1
  110. package/web/uc-file-uploader-inline.min.js +4 -4
  111. package/web/uc-file-uploader-minimal.min.css +1 -1
  112. package/web/uc-file-uploader-minimal.min.js +2 -2
  113. package/web/uc-file-uploader-regular.min.css +1 -1
  114. package/web/uc-file-uploader-regular.min.js +4 -4
  115. package/web/uc-img.min.js +1 -1
  116. package/blocks/ExternalSource/buildStyles.d.ts +0 -27
  117. package/blocks/ExternalSource/buildStyles.d.ts.map +0 -1
  118. package/blocks/ExternalSource/buildStyles.js +0 -133
  119. package/blocks/ExternalSource/messages.d.ts +0 -3
  120. package/blocks/ExternalSource/messages.d.ts.map +0 -1
  121. package/blocks/ExternalSource/messages.js +0 -35
  122. package/blocks/LocalEditorImage/LocalEditorImage.d.ts +0 -22
  123. package/blocks/LocalEditorImage/LocalEditorImage.d.ts.map +0 -1
  124. package/blocks/LocalEditorImage/LocalEditorImage.js +0 -139
  125. package/blocks/LocalEditorImage/localEditorImage.css +0 -19
@@ -1 +1 @@
1
- {"version":3,"file":"CameraSource.d.ts","sourceRoot":"","sources":["CameraSource.js"],"names":[],"mappings":"AAsCA,+CAA+C;AAE/C,kGAAkG;AAElG;IAEE,uBAA+C;IAE/C,eAAe;IACf,0BAAyB;IAEzB,yBAAyB;IACzB,SADW,QAAQ,EAAE,CACR;IAEb,mCAAmC;IACnC,gBADW,aAAa,GAAG,IAAI,CACT;IAEtB,iCAAiC;IACjC,SADW,WAAW,GAAG,IAAI,CACd;IAEf,4BAA4B;IAC5B,kBADW,MAAM,GAAG,IAAI,CACA;IAExB,4BAA4B;IAC5B,mBADW,MAAM,GAAG,IAAI,CACC;IAKvB;;;;;;;;;;;;;;;;;;;;;;;;QAiCE,qBAAqB;;QAErB,qBAAqB;;;;QAMrB,uBAAuB;kCAAX,KAAK;QAMjB,uBAAuB;iCAAX,KAAK;;;;QAcjB,iDAAiD;;;;;;;;QAejD,4BAA4B;wBAAhB,UAAU;;;;;;;;;;;;;;MAKvB;IAGH,oCAaE;IAEF,yBAkBE;IADA,sCAAiE;IAGnE,wBAKE;IAEF,uBAEE;IAEF,2BAOE;IAEF,0BAEE;IAEF,4BA4CE;IAzCE;;;;;kBAEC;IAyCL,eAAe;IACf,uBAWE;IAEF,2DAA2D;IAC3D,6BAQE;IAEF,+BAOE;IAEF;;;;OAIG;IACH,sBA6BE;IAEF,oBAUE;IAEF,oBAoBE;IAEF,mCAAmC;IACnC,uBADY,YAAY,UAqBtB;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,yBAUE;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;;;;;;;;;;;;;;;;;;0BA9wBa,OAAO,GAAG,OAAO;2BAEjB,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ;8BAtCnD,iCAAiC"}
1
+ {"version":3,"file":"CameraSource.d.ts","sourceRoot":"","sources":["CameraSource.js"],"names":[],"mappings":"AAsCA,+CAA+C;AAE/C,kGAAkG;AAElG;IAEE,uBAA+C;IAE/C,eAAe;IACf,0BAAyB;IAEzB,yBAAyB;IACzB,SADW,QAAQ,EAAE,CACR;IAEb,mCAAmC;IACnC,gBADW,aAAa,GAAG,IAAI,CACT;IAEtB,iCAAiC;IACjC,SADW,WAAW,GAAG,IAAI,CACd;IAEf,4BAA4B;IAC5B,kBADW,MAAM,GAAG,IAAI,CACA;IAExB,4BAA4B;IAC5B,mBADW,MAAM,GAAG,IAAI,CACC;IAKvB;;;;;;;;;;;;;;;;;;;;;;;;QAiCE,qBAAqB;;QAErB,qBAAqB;;;;QAMrB,uBAAuB;kCAAX,KAAK;QAMjB,uBAAuB;iCAAX,KAAK;;;;QAcjB,iDAAiD;;;;;;;;QAejD,4BAA4B;wBAAhB,UAAU;;;;;;;;;;;;;;MAKvB;IAGH,oCAaE;IAEF,yBAkBE;IADA,sCAAiE;IAGnE,wBAKE;IAEF,uBAEE;IAEF,2BAOE;IAEF,0BAEE;IAEF,4BAgCE;IA7BE;;;;;kBAEC;IA6BL,eAAe;IACf,uBAWE;IAEF,2DAA2D;IAC3D,6BAQE;IAEF,+BAOE;IAEF;;;;OAIG;IACH,sBA6BE;IAEF,oBAUE;IAEF,oBAoBE;IAEF,mCAAmC;IACnC,uBADY,YAAY,UAqBtB;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;;;;;;;;;;;;;;;;;;0BAnwBa,OAAO,GAAG,OAAO;2BAEjB,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ;8BAtCnD,iCAAiC"}
@@ -167,8 +167,8 @@ export class CameraSource extends UploaderBlock {
167
167
  _updateTimer = () => {
168
168
  const currentTime = Math.floor((performance.now() - this.$._startTime + this.$._elapsedTime) / 1000);
169
169
 
170
- if (typeof this.cfg.maxDurationVideoRecord === 'number' && this.cfg.maxDurationVideoRecord > 0) {
171
- const remainingTime = this.cfg.maxDurationVideoRecord - currentTime;
170
+ if (typeof this.cfg.maxVideoRecordingDuration === 'number' && this.cfg.maxVideoRecordingDuration > 0) {
171
+ const remainingTime = this.cfg.maxVideoRecordingDuration - currentTime;
172
172
 
173
173
  if (remainingTime <= 0) {
174
174
  this.ref.timer.textContent = formatTime(remainingTime);
@@ -212,27 +212,15 @@ export class CameraSource extends UploaderBlock {
212
212
  try {
213
213
  this._chunks = [];
214
214
  this._options = {
215
- ...this.cfg.optionsMediaRecorder,
215
+ ...this.cfg.mediaRecorerOptions,
216
216
  };
217
217
 
218
- const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
219
-
220
218
  if (
221
- this.cfg.optionsMediaRecorder?.mimeType &&
222
- MediaRecorder.isTypeSupported(this.cfg.optionsMediaRecorder.mimeType)
223
- ) {
224
- this._options.mimeType = this.cfg.optionsMediaRecorder.mimeType;
225
- } else if (
226
- isFirefox &&
227
- this.cfg.optionsMediaRecorder?.mimeType &&
228
- MediaRecorder.isTypeSupported(this.cfg.optionsMediaRecorder.mimeType)
219
+ this.cfg.mediaRecorerOptions?.mimeType &&
220
+ MediaRecorder.isTypeSupported(this.cfg.mediaRecorerOptions.mimeType)
229
221
  ) {
230
- const mimeType = this.cfg.optionsMediaRecorder?.mimeType;
231
-
232
- if (mimeType && !MediaRecorder.isTypeSupported(mimeType)) {
233
- throw new Error(`MIME type ${mimeType} is not supported`);
234
- }
235
-
222
+ this._options.mimeType = this.cfg.mediaRecorerOptions.mimeType;
223
+ } else {
236
224
  this._options.mimeType = DEFAULT_VIDEO_FORMAT;
237
225
  }
238
226
 
@@ -636,6 +624,7 @@ export class CameraSource extends UploaderBlock {
636
624
  this.$.video = null;
637
625
 
638
626
  this._makeStreamInactive();
627
+ this._stopTimer();
639
628
 
640
629
  this._capturing = false;
641
630
  }
@@ -795,7 +784,7 @@ export class CameraSource extends UploaderBlock {
795
784
  this.$.tabVideoHidden = !val;
796
785
  });
797
786
 
798
- this.subConfigValue('defaultCameraTab', (val) => {
787
+ this.subConfigValue('defaultCameraMode', (val) => {
799
788
  if (this.cfg.enableVideoRecording) {
800
789
  this._handleActiveTab(val);
801
790
  return;
@@ -10,27 +10,15 @@ uc-camera-source {
10
10
  border-radius: var(--uc-radius);
11
11
  }
12
12
 
13
- [uc-modal] uc-camera-source {
14
- width: min(calc(var(--uc-dialog-max-width) - var(--uc-padding) * 2), calc(100vw - var(--uc-padding) * 2));
15
- height: 100vh;
16
- max-height: var(--modal-max-content-height);
17
- }
18
-
19
- uc-camera-source.uc-initialized {
20
- height: max-content;
13
+ [uc-modal] > dialog:has(uc-camera-source[active]) {
14
+ width: 100%;
15
+ height: 100%;
21
16
  }
22
17
 
23
18
  uc-camera-source:not(.uc-initialized) .uc-controls {
24
19
  display: none;
25
20
  }
26
21
 
27
- @media only screen and (max-width: 430px) {
28
- uc-camera-source {
29
- width: calc(100vw - var(--uc-padding) * 2);
30
- height: var(--modal-content-height-fill, 100%);
31
- }
32
- }
33
-
34
22
  uc-camera-source video {
35
23
  display: block;
36
24
  width: 100%;
@@ -52,11 +40,11 @@ uc-camera-source .uc-toolbar {
52
40
  }
53
41
 
54
42
  uc-camera-source .uc-content {
55
- position: relative;
56
43
  display: flex;
57
44
  flex: 1;
58
45
  justify-content: center;
59
46
  width: 100%;
47
+ height: 100%;
60
48
  padding: var(--uc-padding);
61
49
  padding-top: 0;
62
50
  overflow: hidden;
@@ -7,7 +7,7 @@ uc-cloud-image-editor-activity {
7
7
  background-color: var(--uc-background);
8
8
  }
9
9
 
10
- [uc-modal] uc-cloud-image-editor-activity {
11
- width: min(calc(var(--uc-dialog-max-width) - var(--uc-padding) * 2), calc(100vw - var(--uc-padding) * 2));
12
- height: var(--modal-content-height-fill, 100%);
10
+ [uc-modal] > dialog:has(uc-cloud-image-editor-activity[active]) {
11
+ width: 100%;
12
+ height: 100%;
13
13
  }
@@ -9,7 +9,7 @@
9
9
  * 'iconHrefResolver',
10
10
  * 'fileValidators',
11
11
  * 'collectionValidators',
12
- * 'optionsMediaRecorder',
12
+ * 'mediaRecorerOptions',
13
13
  * ]}
14
14
  */
15
15
  export const complexConfigKeys: [
@@ -20,7 +20,7 @@ export const complexConfigKeys: [
20
20
  'iconHrefResolver',
21
21
  'fileValidators',
22
22
  'collectionValidators',
23
- 'optionsMediaRecorder'
23
+ 'mediaRecorerOptions'
24
24
  ];
25
25
  export type Config = import('../../utils/mixinClass.js').MixinClass<typeof ConfigClass, import('../../types').ConfigType>;
26
26
  /** @typedef {import('../../utils/mixinClass.js').MixinClass<typeof ConfigClass, import('../../types').ConfigType>} Config */
@@ -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-tab" | "enable-audio-recording" | "enable-video-recording" | "max-duration-video-record" | "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" | "defaultcameratab" | "enableaudiorecording" | "enablevideorecording" | "maxdurationvideorecord", 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" | "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>;
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,sBAA0B;CACvB,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,kgEAGG"}
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"}
@@ -21,7 +21,7 @@ const allConfigKeys = /** @type {(keyof import('../../types').ConfigType)[]} */
21
21
  * 'iconHrefResolver',
22
22
  * 'fileValidators',
23
23
  * 'collectionValidators',
24
- * 'optionsMediaRecorder',
24
+ * 'mediaRecorerOptions',
25
25
  * ]}
26
26
  */
27
27
  export const complexConfigKeys = [
@@ -32,7 +32,7 @@ export const complexConfigKeys = [
32
32
  'iconHrefResolver',
33
33
  'fileValidators',
34
34
  'collectionValidators',
35
- 'optionsMediaRecorder',
35
+ 'mediaRecorerOptions',
36
36
  ];
37
37
 
38
38
  /** @type {(key: keyof import('../../types').ConfigType) => key is keyof import('../../types').ConfigComplexType} */
@@ -67,9 +67,9 @@ export const initialConfig = {
67
67
  fileValidators: [],
68
68
  collectionValidators: [],
69
69
 
70
- defaultCameraTab: 'photo',
70
+ defaultCameraMode: 'photo',
71
71
  enableAudioRecording: true,
72
72
  enableVideoRecording: true,
73
- maxDurationVideoRecord: null,
74
- optionsMediaRecorder: null,
73
+ maxVideoRecordingDuration: null,
74
+ mediaRecorerOptions: null,
75
75
  };
@@ -165,12 +165,12 @@ const mapping = {
165
165
  fileValidators: /** @type {typeof asArray<import('../../types').FileValidators>} */ (asArray),
166
166
  collectionValidators: /** @type {typeof asArray<import('../../types').CollectionValidators>} */ (asArray),
167
167
 
168
- defaultCameraTab: asCameraTab,
168
+ defaultCameraMode: asCameraTab,
169
169
  enableAudioRecording: asBoolean,
170
170
  enableVideoRecording: asBoolean,
171
- optionsMediaRecorder: asObject,
171
+ mediaRecorerOptions: asObject,
172
172
 
173
- maxDurationVideoRecord: asNumber,
173
+ maxVideoRecordingDuration: asNumber,
174
174
  };
175
175
 
176
176
  /**
@@ -1,30 +1,21 @@
1
1
  /** @typedef {{ externalSourceType: string }} ActivityParams */
2
- /**
3
- * @typedef {{
4
- * type: 'file-selected';
5
- * obj_type: 'selected_file';
6
- * filename: string;
7
- * url: string;
8
- * alternatives?: Record<string, string>;
9
- * }} SelectedFileMessage
10
- */
11
- /**
12
- * @typedef {{
13
- * type: 'embed-css';
14
- * style: string;
15
- * }} EmbedCssMessage
16
- */
17
- /** @typedef {SelectedFileMessage | EmbedCssMessage} Message */
18
2
  export class ExternalSource extends UploaderBlock {
19
3
  activityType: "external";
20
4
  init$: {
21
5
  activityIcon: string;
22
6
  activityCaption: string;
23
- selectedList: never[];
24
- counter: number;
25
- multiple: boolean;
7
+ /** @type {import('./types.js').InputMessageMap['selected-files-change']['selectedFiles']} */
8
+ selectedList: import('./types.js').InputMessageMap['selected-files-change']['selectedFiles'];
9
+ total: number;
10
+ isSelectionReady: boolean;
11
+ couldSelectAll: boolean;
12
+ couldDeselectAll: boolean;
13
+ showSelectionStatus: boolean;
14
+ counterText: string;
26
15
  onDone: () => void;
27
16
  onCancel: () => void;
17
+ onSelectAll: () => void;
18
+ onDeselectAll: () => void;
28
19
  '*commonProgress': number;
29
20
  '*uploadList': never[];
30
21
  '*uploadQueue': import("@uploadcare/upload-client").Queue;
@@ -43,39 +34,30 @@ export class ExternalSource extends UploaderBlock {
43
34
  get activityParams(): ActivityParams;
44
35
  /**
45
36
  * @private
46
- * @type {HTMLIFrameElement | null}
37
+ * @param {NonNullable<import('./types.js').InputMessageMap['selected-files-change']['selectedFiles']>[number]} selectedFile
47
38
  */
48
- private _iframe;
39
+ private extractUrlFromSelectedFile;
49
40
  /**
50
41
  * @private
51
- * @param {SelectedFileMessage} message
42
+ * @param {import('./types.js').InputMessageMap['selected-files-change']} message
52
43
  */
53
- private extractUrlFromMessage;
54
- /**
55
- * @private
56
- * @param {Message} message
57
- */
58
- private sendMessage;
59
- /**
60
- * @private
61
- * @param {SelectedFileMessage} message
62
- */
63
- private handleFileSelected;
44
+ private handleSelectedFilesChange;
64
45
  /** @private */
65
46
  private handleIframeLoad;
66
- /**
67
- * @private
68
- * @param {string} propName
69
- */
70
- private getCssValue;
71
47
  /** @private */
72
48
  private applyStyles;
73
49
  /** @private */
50
+ private setupL10n;
51
+ /** @private */
74
52
  private remoteUrl;
75
53
  /** @private */
76
54
  private mountIframe;
77
55
  /** @private */
56
+ private _messageBridge;
57
+ /** @private */
78
58
  private unmountIframe;
59
+ /** @private */
60
+ private resetSelectionStatus;
79
61
  }
80
62
  export namespace ExternalSource {
81
63
  let template: string;
@@ -83,17 +65,5 @@ export namespace ExternalSource {
83
65
  export type ActivityParams = {
84
66
  externalSourceType: string;
85
67
  };
86
- export type SelectedFileMessage = {
87
- type: 'file-selected';
88
- obj_type: 'selected_file';
89
- filename: string;
90
- url: string;
91
- alternatives?: Record<string, string>;
92
- };
93
- export type EmbedCssMessage = {
94
- type: 'embed-css';
95
- style: string;
96
- };
97
- export type Message = SelectedFileMessage | EmbedCssMessage;
98
68
  import { UploaderBlock } from '../../abstract/UploaderBlock.js';
99
69
  //# sourceMappingURL=ExternalSource.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExternalSource.d.ts","sourceRoot":"","sources":["ExternalSource.js"],"names":[],"mappings":"AAWA,+DAA+D;AAE/D;;;;;;;;GAQG;AAEH;;;;;GAKG;AAEH,+DAA+D;AAE/D;IAEE,yBAAiD;IAK/C;;;;;;;;;;;;;;;;;;;;;MAoBC;IAGH,6BAA6B;IAC7B,qCAMC;IAED;;;OAGG;IACH,gBAAe;IA2Cf;;;OAGG;IACH,8BAcC;IAED;;;OAGG;IACH,oBAEC;IAED;;;OAGG;IACH,2BAUC;IAED,eAAe;IACf,yBAEC;IAED;;;OAGG;IACH,oBAGC;IAED,eAAe;IACf,oBAkBC;IAED,eAAe;IACf,kBAcC;IAED,eAAe;IACf,oBAsBC;IAED,eAAe;IACf,sBAMC;CACF;;;;6BA5Oa;IAAE,kBAAkB,EAAE,MAAM,CAAA;CAAE;kCAG/B;IACZ,IAAQ,EAAE,eAAe,CAAC;IAC1B,QAAY,EAAE,eAAe,CAAC;IAC9B,QAAY,EAAE,MAAM,CAAC;IACrB,GAAO,EAAE,MAAM,CAAC;IAChB,YAAgB,CAAC,EAAE,OAAO,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;8BAIS;IACZ,IAAQ,EAAE,WAAW,CAAC;IACtB,KAAS,EAAE,MAAM,CAAC;CACf;sBAGU,mBAAmB,GAAG,eAAe;8BA1BrB,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;;;;;;;;;;;;;;;;;;;;;;;;MA+B1F;IAGH,6BAA6B;IAC7B,qCAMC;IA4CD;;;OAGG;IACH,mCAcC;IAED;;;OAGG;IACH,kCAoBC;IAED,eAAe;IACf,yBAGC;IAED,eAAe;IACf,oBAKC;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;;;;6BA7Oa;IAAE,kBAAkB,EAAE,MAAM,CAAA;CAAE;8BAPd,iCAAiC"}
@@ -5,31 +5,12 @@ import { ActivityBlock } from '../../abstract/ActivityBlock.js';
5
5
  import { UploaderBlock } from '../../abstract/UploaderBlock.js';
6
6
  import { stringToArray } from '../../utils/stringToArray.js';
7
7
  import { wildcardRegexp } from '../../utils/wildcardRegexp.js';
8
- import { buildStyles } from './buildStyles.js';
9
- import { registerMessage, unregisterMessage } from './messages.js';
8
+ import { buildThemeDefinition } from './buildThemeDefinition.js';
9
+ import { MessageBridge } from './MessageBridge.js';
10
10
  import { queryString } from './query-string.js';
11
11
 
12
12
  /** @typedef {{ externalSourceType: string }} ActivityParams */
13
13
 
14
- /**
15
- * @typedef {{
16
- * type: 'file-selected';
17
- * obj_type: 'selected_file';
18
- * filename: string;
19
- * url: string;
20
- * alternatives?: Record<string, string>;
21
- * }} SelectedFileMessage
22
- */
23
-
24
- /**
25
- * @typedef {{
26
- * type: 'embed-css';
27
- * style: string;
28
- * }} EmbedCssMessage
29
- */
30
-
31
- /** @typedef {SelectedFileMessage | EmbedCssMessage} Message */
32
-
33
14
  export class ExternalSource extends UploaderBlock {
34
15
  couldBeCtxOwner = true;
35
16
  activityType = ActivityBlock.activities.EXTERNAL;
@@ -41,12 +22,20 @@ export class ExternalSource extends UploaderBlock {
41
22
  ...this.init$,
42
23
  activityIcon: '',
43
24
  activityCaption: '',
25
+
26
+ /** @type {import('./types.js').InputMessageMap['selected-files-change']['selectedFiles']} */
44
27
  selectedList: [],
45
- counter: 0,
46
- multiple: false,
28
+ total: 0,
29
+
30
+ isSelectionReady: false,
31
+ couldSelectAll: false,
32
+ couldDeselectAll: false,
33
+ showSelectionStatus: false,
34
+ counterText: '',
35
+
47
36
  onDone: () => {
48
37
  for (const message of this.$.selectedList) {
49
- const url = this.extractUrlFromMessage(message);
38
+ const url = this.extractUrlFromSelectedFile(message);
50
39
  const { filename } = message;
51
40
  const { externalSourceType } = this.activityParams;
52
41
  this.api.addFileFromUrl(url, { fileName: filename, source: externalSourceType });
@@ -57,6 +46,14 @@ export class ExternalSource extends UploaderBlock {
57
46
  onCancel: () => {
58
47
  this.historyBack();
59
48
  },
49
+
50
+ onSelectAll: () => {
51
+ this._messageBridge?.send({ type: 'select-all' });
52
+ },
53
+
54
+ onDeselectAll: () => {
55
+ this._messageBridge?.send({ type: 'deselect-all' });
56
+ },
60
57
  };
61
58
  }
62
59
 
@@ -69,12 +66,6 @@ export class ExternalSource extends UploaderBlock {
69
66
  throw new Error(`External Source activity params not found`);
70
67
  }
71
68
 
72
- /**
73
- * @private
74
- * @type {HTMLIFrameElement | null}
75
- */
76
- _iframe = null;
77
-
78
69
  initCallback() {
79
70
  super.initCallback();
80
71
  this.registerActivity(this.activityType, {
@@ -108,24 +99,25 @@ export class ExternalSource extends UploaderBlock {
108
99
  this.unmountIframe();
109
100
  }
110
101
  });
111
- this.sub('selectedList', (list) => {
112
- this.$.counter = list.length;
113
- });
114
102
  this.subConfigValue('multiple', (multiple) => {
115
- this.$.multiple = multiple;
103
+ this.$.showSelectionStatus = multiple;
104
+ });
105
+
106
+ this.subConfigValue('localeName', (val) => {
107
+ this.setupL10n();
116
108
  });
117
109
  }
118
110
 
119
111
  /**
120
112
  * @private
121
- * @param {SelectedFileMessage} message
113
+ * @param {NonNullable<import('./types.js').InputMessageMap['selected-files-change']['selectedFiles']>[number]} selectedFile
122
114
  */
123
- extractUrlFromMessage(message) {
124
- if (message.alternatives) {
115
+ extractUrlFromSelectedFile(selectedFile) {
116
+ if (selectedFile.alternatives) {
125
117
  const preferredTypes = stringToArray(this.cfg.externalSourcesPreferredTypes);
126
118
  for (const preferredType of preferredTypes) {
127
119
  const regexp = wildcardRegexp(preferredType);
128
- for (const [type, typeUrl] of Object.entries(message.alternatives)) {
120
+ for (const [type, typeUrl] of Object.entries(selectedFile.alternatives)) {
129
121
  if (regexp.test(type)) {
130
122
  return typeUrl;
131
123
  }
@@ -133,81 +125,71 @@ export class ExternalSource extends UploaderBlock {
133
125
  }
134
126
  }
135
127
 
136
- return message.url;
128
+ return selectedFile.url;
137
129
  }
138
130
 
139
131
  /**
140
132
  * @private
141
- * @param {Message} message
133
+ * @param {import('./types.js').InputMessageMap['selected-files-change']} message
142
134
  */
143
- sendMessage(message) {
144
- this._iframe?.contentWindow?.postMessage(JSON.stringify(message), '*');
145
- }
146
-
147
- /**
148
- * @private
149
- * @param {SelectedFileMessage} message
150
- */
151
- async handleFileSelected(message) {
152
- if (!this.$.multiple && this.$.selectedList.length) {
135
+ async handleSelectedFilesChange(message) {
136
+ if (this.cfg.multiple !== message.isMultipleMode) {
137
+ console.error('Multiple mode mismatch');
153
138
  return;
154
139
  }
155
140
 
156
- this.$.selectedList = [...this.$.selectedList, message];
157
-
158
- if (!this.$.multiple) {
159
- this.$.onDone();
160
- }
141
+ this.bindL10n('counterText', () =>
142
+ this.l10n('selected-count', {
143
+ count: message.selectedCount,
144
+ total: message.total,
145
+ }),
146
+ );
147
+
148
+ this.set$({
149
+ isSelectionReady: message.isReady,
150
+ showSelectionStatus: message.isMultipleMode && message.total > 0,
151
+ couldSelectAll: message.selectedCount < message.total,
152
+ couldDeselectAll: message.selectedCount === message.total,
153
+ selectedList: message.selectedFiles,
154
+ });
161
155
  }
162
156
 
163
157
  /** @private */
164
158
  handleIframeLoad() {
165
159
  this.applyStyles();
166
- }
167
-
168
- /**
169
- * @private
170
- * @param {string} propName
171
- */
172
- getCssValue(propName) {
173
- let style = window.getComputedStyle(this);
174
- return style.getPropertyValue(propName).trim();
160
+ this.setupL10n();
175
161
  }
176
162
 
177
163
  /** @private */
178
164
  applyStyles() {
179
- let colors = {
180
- radius: this.getCssValue('--uc-radius'),
181
- backgroundColor: this.getCssValue('--uc-background'),
182
- textColor: this.getCssValue('--uc-foreground'),
183
- secondaryColor: this.getCssValue('--uc-secondary'),
184
- secondaryForegroundColor: this.getCssValue('--uc-secondary-foreground'),
185
- secondaryHover: this.getCssValue('--uc-secondary-hover'),
186
- linkColor: this.getCssValue('--uc-primary'),
187
- linkColorHover: this.getCssValue('--uc-primary-hover'),
188
- fontFamily: this.getCssValue('--uc-font-family'),
189
- fontSize: this.getCssValue('--uc-font-size'),
190
- };
165
+ this._messageBridge?.send({
166
+ type: 'set-theme-definition',
167
+ theme: buildThemeDefinition(this),
168
+ });
169
+ }
191
170
 
192
- this.sendMessage({
193
- type: 'embed-css',
194
- style: buildStyles(colors),
171
+ /** @private */
172
+ setupL10n() {
173
+ this._messageBridge?.send({
174
+ type: 'set-locale-definition',
175
+ localeDefinition: this.cfg.localeName,
195
176
  });
196
177
  }
197
178
 
198
179
  /** @private */
199
180
  remoteUrl() {
200
- const { pubkey, remoteTabSessionKey, socialBaseUrl } = this.cfg;
181
+ const { pubkey, remoteTabSessionKey, socialBaseUrl, multiple } = this.cfg;
201
182
  const { externalSourceType } = this.activityParams;
202
183
  const lang = this.l10n('social-source-lang')?.split('-')?.[0] || 'en';
203
184
  const params = {
204
185
  lang,
205
186
  public_key: pubkey,
206
187
  images_only: false.toString(),
207
- pass_window_open: false,
208
188
  session_key: remoteTabSessionKey,
189
+ wait_for_theme: true,
190
+ multiple: multiple.toString(),
209
191
  };
210
- const url = new URL(`/window3/${externalSourceType}`, socialBaseUrl);
192
+ const url = new URL(`/window4/${externalSourceType}`, socialBaseUrl);
211
193
  url.search = queryString(params);
212
194
  return url.toString();
213
195
  }
@@ -231,31 +213,43 @@ export class ExternalSource extends UploaderBlock {
231
213
  this.ref.iframeWrapper.innerHTML = '';
232
214
  this.ref.iframeWrapper.appendChild(iframe);
233
215
 
234
- registerMessage('file-selected', iframe.contentWindow, this.handleFileSelected.bind(this));
216
+ if (!iframe.contentWindow) {
217
+ return;
218
+ }
219
+
220
+ this._messageBridge?.destroy();
221
+
222
+ /** @private */
223
+ this._messageBridge = new MessageBridge(iframe.contentWindow);
224
+ this._messageBridge.on('selected-files-change', this.handleSelectedFilesChange.bind(this));
235
225
 
236
- this._iframe = iframe;
237
- this.$.selectedList = [];
226
+ this.resetSelectionStatus();
238
227
  }
239
228
 
240
229
  /** @private */
241
230
  unmountIframe() {
242
- this._iframe && unregisterMessage('file-selected', this._iframe.contentWindow);
231
+ this._messageBridge?.destroy();
232
+ this._messageBridge = undefined;
243
233
  this.ref.iframeWrapper.innerHTML = '';
244
- this._iframe = null;
245
- this.$.selectedList = [];
246
- this.$.counter = 0;
234
+
235
+ this.resetSelectionStatus();
236
+ }
237
+
238
+ /** @private */
239
+ resetSelectionStatus() {
240
+ this.set$({
241
+ selectedList: [],
242
+ total: 0,
243
+ isSelectionReady: false,
244
+ couldSelectAll: false,
245
+ couldDeselectAll: false,
246
+ showSelectionStatus: false,
247
+ });
247
248
  }
248
249
  }
249
250
 
250
251
  ExternalSource.template = /* HTML */ `
251
252
  <uc-activity-header>
252
- <button type="button" class="uc-mini-btn" set="onclick: *historyBack" l10n="@title:back">
253
- <uc-icon name="back"></uc-icon>
254
- </button>
255
- <div>
256
- <uc-icon set="@name: activityIcon"></uc-icon>
257
- <span>{{activityCaption}}</span>
258
- </div>
259
253
  <button
260
254
  type="button"
261
255
  class="uc-mini-btn uc-close-btn"
@@ -269,12 +263,15 @@ ExternalSource.template = /* HTML */ `
269
263
  <div ref="iframeWrapper" class="uc-iframe-wrapper"></div>
270
264
  <div class="uc-toolbar">
271
265
  <button type="button" class="uc-cancel-btn uc-secondary-btn" set="onclick: onCancel" l10n="cancel"></button>
272
- <div></div>
273
- <div set="@hidden: !multiple" class="uc-selected-counter"><span l10n="selected-count"></span>{{counter}}</div>
266
+ <div set="@hidden: !showSelectionStatus" class="uc-selection-status-box">
267
+ <span>{{counterText}}</span>
268
+ <button type="button" set="onclick: onSelectAll; @hidden: !couldSelectAll" l10n="select-all"></button>
269
+ <button type="button" set="onclick: onDeselectAll; @hidden: !couldDeselectAll" l10n="deselect-all"></button>
270
+ </div>
274
271
  <button
275
272
  type="button"
276
273
  class="uc-done-btn uc-primary-btn"
277
- set="onclick: onDone; @disabled: !counter"
274
+ set="onclick: onDone; @disabled: !isSelectionReady"
278
275
  l10n="done"
279
276
  ></button>
280
277
  </div>
@@ -0,0 +1,20 @@
1
+ export class MessageBridge {
2
+ /** @param {Window} context */
3
+ constructor(context: Window);
4
+ /** @type {Map<string, Set<import('./types').InputMessageHandler<import('./types').InputMessageType>>>} */
5
+ _handlerMap: Map<string, Set<import('./types').InputMessageHandler<import('./types').InputMessageType>>>;
6
+ /** @type {Window} */
7
+ _context: Window;
8
+ /** @param {MessageEvent} e */
9
+ _handleMessage: (e: MessageEvent) => void;
10
+ /**
11
+ * @template {import('./types').InputMessageType} T
12
+ * @param {T} type
13
+ * @param {import('./types').InputMessageHandler<T>} handler
14
+ */
15
+ on<T extends "selected-files-change">(type: T, handler: import("./types").InputMessageHandler<T>): void;
16
+ /** @param {import('./types').OutputMessage} message */
17
+ send(message: import('./types').OutputMessage): void;
18
+ destroy(): void;
19
+ }
20
+ //# sourceMappingURL=MessageBridge.d.ts.map