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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/blocks/CameraSource/CameraSource.d.ts +169 -22
  2. package/blocks/CameraSource/CameraSource.d.ts.map +1 -1
  3. package/blocks/CameraSource/CameraSource.js +805 -126
  4. package/blocks/CameraSource/camera-source.css +105 -7
  5. package/blocks/CloudImageEditorActivity/index.css +3 -3
  6. package/blocks/Config/Config.d.ts +4 -2
  7. package/blocks/Config/Config.d.ts.map +1 -1
  8. package/blocks/Config/Config.js +2 -0
  9. package/blocks/Config/initialConfig.d.ts +1 -1
  10. package/blocks/Config/initialConfig.d.ts.map +1 -1
  11. package/blocks/Config/initialConfig.js +7 -1
  12. package/blocks/Config/normalizeConfigValue.d.ts.map +1 -1
  13. package/blocks/Config/normalizeConfigValue.js +17 -1
  14. package/blocks/ExternalSource/ExternalSource.d.ts +50 -20
  15. package/blocks/ExternalSource/ExternalSource.d.ts.map +1 -1
  16. package/blocks/ExternalSource/ExternalSource.js +99 -96
  17. package/blocks/ExternalSource/buildStyles.d.ts +27 -0
  18. package/blocks/ExternalSource/buildStyles.d.ts.map +1 -0
  19. package/blocks/ExternalSource/buildStyles.js +133 -0
  20. package/blocks/ExternalSource/external-source.css +22 -37
  21. package/blocks/ExternalSource/messages.d.ts +3 -0
  22. package/blocks/ExternalSource/messages.d.ts.map +1 -0
  23. package/blocks/ExternalSource/messages.js +35 -0
  24. package/blocks/LocalEditorImage/LocalEditorImage.d.ts +22 -0
  25. package/blocks/LocalEditorImage/LocalEditorImage.d.ts.map +1 -0
  26. package/blocks/LocalEditorImage/LocalEditorImage.js +139 -0
  27. package/blocks/LocalEditorImage/localEditorImage.css +19 -0
  28. package/blocks/Modal/Modal.d.ts.map +1 -1
  29. package/blocks/Modal/Modal.js +11 -4
  30. package/blocks/Modal/modal.css +54 -3
  31. package/blocks/StartFrom/start-from.css +6 -2
  32. package/blocks/UploadList/upload-list.css +11 -1
  33. package/blocks/UrlSource/url-source.css +8 -0
  34. package/blocks/themes/uc-basic/common.css +5 -0
  35. package/blocks/themes/uc-basic/svg-sprite.d.ts +1 -1
  36. package/blocks/themes/uc-basic/svg-sprite.js +1 -1
  37. package/blocks/themes/uc-basic/theme.css +3 -2
  38. package/env.d.ts +1 -1
  39. package/env.d.ts.map +1 -1
  40. package/env.js +1 -1
  41. package/index.ssr.d.ts +15 -1
  42. package/index.ssr.d.ts.map +1 -1
  43. package/index.ssr.js +82 -9
  44. package/locales/file-uploader/en.d.ts +0 -2
  45. package/locales/file-uploader/en.js +1 -3
  46. package/locales/file-uploader/fi.d.ts +120 -0
  47. package/locales/file-uploader/fi.d.ts.map +1 -0
  48. package/locales/file-uploader/fi.js +120 -0
  49. package/package.json +1 -1
  50. package/types/exported.d.ts +21 -0
  51. package/web/file-uploader.iife.min.js +4 -4
  52. package/web/file-uploader.min.js +4 -4
  53. package/web/uc-basic.min.css +1 -1
  54. package/web/uc-cloud-image-editor.min.css +1 -1
  55. package/web/uc-cloud-image-editor.min.js +4 -4
  56. package/web/uc-file-uploader-inline.min.css +1 -1
  57. package/web/uc-file-uploader-inline.min.js +4 -4
  58. package/web/uc-file-uploader-minimal.min.css +1 -1
  59. package/web/uc-file-uploader-minimal.min.js +3 -3
  60. package/web/uc-file-uploader-regular.min.css +1 -1
  61. package/web/uc-file-uploader-regular.min.js +4 -4
  62. package/web/uc-img.min.js +1 -1
  63. package/blocks/ExternalSource/MessageBridge.d.ts +0 -20
  64. package/blocks/ExternalSource/MessageBridge.d.ts.map +0 -1
  65. package/blocks/ExternalSource/MessageBridge.js +0 -71
  66. package/blocks/ExternalSource/buildThemeDefinition.d.ts +0 -3
  67. package/blocks/ExternalSource/buildThemeDefinition.d.ts.map +0 -1
  68. package/blocks/ExternalSource/buildThemeDefinition.js +0 -47
  69. package/blocks/ExternalSource/types.d.ts +0 -113
  70. package/blocks/ExternalSource/types.d.ts.map +0 -1
  71. package/blocks/ExternalSource/types.js +0 -143
@@ -10,9 +10,25 @@ uc-camera-source {
10
10
  border-radius: var(--uc-radius);
11
11
  }
12
12
 
13
- [uc-modal] > dialog:has(uc-camera-source[active]) {
14
- width: 100%;
15
- height: 100%;
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;
21
+ }
22
+
23
+ uc-camera-source:not(.uc-initialized) .uc-controls {
24
+ display: none;
25
+ }
26
+
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
+ }
16
32
  }
17
33
 
18
34
  uc-camera-source video {
@@ -36,11 +52,11 @@ uc-camera-source .uc-toolbar {
36
52
  }
37
53
 
38
54
  uc-camera-source .uc-content {
55
+ position: relative;
39
56
  display: flex;
40
57
  flex: 1;
41
58
  justify-content: center;
42
59
  width: 100%;
43
- height: 100%;
44
60
  padding: var(--uc-padding);
45
61
  padding-top: 0;
46
62
  overflow: hidden;
@@ -62,12 +78,10 @@ uc-camera-source .uc-message-box button {
62
78
  }
63
79
 
64
80
  uc-camera-source .uc-shot-btn {
65
- position: absolute;
66
- bottom: 20px;
67
81
  width: 58px;
68
82
  height: 58px;
69
83
  color: var(--uc-background);
70
- background-color: var(--uc-foreground);
84
+ background-color: var(--uc-primary-light);
71
85
  border-radius: 50%;
72
86
  opacity: 0.85;
73
87
  transition:
@@ -94,3 +108,87 @@ uc-camera-source .uc-shot-btn uc-icon svg {
94
108
  width: 20px;
95
109
  height: 20px;
96
110
  }
111
+
112
+ uc-camera-source .uc-controls {
113
+ position: relative;
114
+ display: flex;
115
+ align-items: center;
116
+ flex-wrap: wrap;
117
+ justify-content: space-between;
118
+ padding: 0 var(--uc-padding) var(--uc-padding);
119
+ min-height: 74px;
120
+ }
121
+
122
+ uc-camera-source .uc-switcher {
123
+ display: flex;
124
+ }
125
+ uc-camera-source .uc-switch.uc-active {
126
+ background-color: var(--uc-secondary);
127
+ }
128
+
129
+ uc-camera-source .uc-camera-actions {
130
+ display: flex;
131
+ justify-content: center;
132
+ align-items: center;
133
+ gap: 5px;
134
+ }
135
+
136
+ uc-camera-source .uc-stop-record {
137
+ background-color: var(--uc-destructive-foreground-light);
138
+ opacity: 1;
139
+ }
140
+
141
+ :where(uc-camera-source:is(.uc-recording)) .uc-recording-timer uc-icon {
142
+ display: none;
143
+ }
144
+
145
+ :where(uc-camera-source:is(.uc-recording)) .uc-recording-timer {
146
+ pointer-events: none;
147
+ }
148
+
149
+ uc-camera-source .uc-recording-timer {
150
+ z-index: 1;
151
+ position: relative;
152
+ overflow: hidden;
153
+ }
154
+
155
+ :where(uc-camera-source) .uc-recording-timer uc-icon {
156
+ width: 10px;
157
+ height: 10px;
158
+ margin-right: 10px;
159
+ }
160
+
161
+ uc-camera-source .uc-recording-timer .uc-line {
162
+ position: absolute;
163
+ content: '';
164
+ bottom: 0;
165
+ left: 0;
166
+ right: 0;
167
+ height: 2px;
168
+ background-color: var(--uc-foreground-light);
169
+ transform: scaleX(0);
170
+ transform-origin: left;
171
+ transition: transform var(--uc-transition);
172
+ }
173
+
174
+ uc-camera-source .uc-btn-microphone {
175
+ z-index: 1;
176
+ }
177
+
178
+ uc-camera-source .uc-select {
179
+ display: flex;
180
+ }
181
+
182
+ uc-camera-source .uc-audio-select {
183
+ width: 98px;
184
+ }
185
+
186
+ uc-camera-source .uc-audio-select select {
187
+ width: 100%;
188
+ }
189
+
190
+ uc-camera-source .uc-camera-action {
191
+ position: absolute;
192
+ inset: 0 var(--uc-padding) var(--uc-padding);
193
+ margin: 0 auto;
194
+ }
@@ -7,7 +7,7 @@ uc-cloud-image-editor-activity {
7
7
  background-color: var(--uc-background);
8
8
  }
9
9
 
10
- [uc-modal] > dialog:has(uc-cloud-image-editor-activity[active]) {
11
- width: 100%;
12
- height: 100%;
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%);
13
13
  }
@@ -9,6 +9,7 @@
9
9
  * 'iconHrefResolver',
10
10
  * 'fileValidators',
11
11
  * 'collectionValidators',
12
+ * 'optionsMediaRecorder',
12
13
  * ]}
13
14
  */
14
15
  export const complexConfigKeys: [
@@ -18,7 +19,8 @@ export const complexConfigKeys: [
18
19
  'secureDeliveryProxyUrlResolver',
19
20
  'iconHrefResolver',
20
21
  'fileValidators',
21
- 'collectionValidators'
22
+ 'collectionValidators',
23
+ 'optionsMediaRecorder'
22
24
  ];
23
25
  export type Config = import('../../utils/mixinClass.js').MixinClass<typeof ConfigClass, import('../../types').ConfigType>;
24
26
  /** @typedef {import('../../utils/mixinClass.js').MixinClass<typeof ConfigClass, import('../../types').ConfigType>} Config */
@@ -62,6 +64,6 @@ declare class ConfigClass extends Block {
62
64
  }
63
65
  import { Block } from '../../abstract/Block.js';
64
66
  /** Mapping of attribute names to state */
65
- 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" | "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", 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-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>;
66
68
  export {};
67
69
  //# sourceMappingURL=Config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["Config.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;GAYG;AACH,gCAVU;IACT,UAAc;IACd,0BAA8B;IAC9B,gCAAoC;IACpC,gCAAoC;IACpC,kBAAsB;IACtB,gBAAoB;IACpB,sBAA0B;CACvB,CAUF;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;sBArOqB,yBAAyB;AAoD/C,0CAA0C;AAC1C,qzDAGG"}
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"}
@@ -21,6 +21,7 @@ const allConfigKeys = /** @type {(keyof import('../../types').ConfigType)[]} */
21
21
  * 'iconHrefResolver',
22
22
  * 'fileValidators',
23
23
  * 'collectionValidators',
24
+ * 'optionsMediaRecorder',
24
25
  * ]}
25
26
  */
26
27
  export const complexConfigKeys = [
@@ -31,6 +32,7 @@ export const complexConfigKeys = [
31
32
  'iconHrefResolver',
32
33
  'fileValidators',
33
34
  'collectionValidators',
35
+ 'optionsMediaRecorder',
34
36
  ];
35
37
 
36
38
  /** @type {(key: keyof import('../../types').ConfigType) => key is keyof import('../../types').ConfigComplexType} */
@@ -1,6 +1,6 @@
1
1
  export const DEFAULT_CDN_CNAME: "https://ucarecdn.com";
2
2
  export const DEFAULT_BASE_URL: "https://upload.uploadcare.com";
3
- export const DEFAULT_SOCIAL_BASE_URL: "https://social.staging0.uploadcare.com";
3
+ export const DEFAULT_SOCIAL_BASE_URL: "https://social.uploadcare.com";
4
4
  /** @type {import('../../types/exported').ConfigType} */
5
5
  export const initialConfig: import('../../types/exported').ConfigType;
6
6
  //# sourceMappingURL=initialConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"initialConfig.d.ts","sourceRoot":"","sources":["initialConfig.js"],"names":[],"mappings":"AAKA,uDAAwD;AACxD,+DAAgE;AAChE,+EAAgF;AAEhF,wDAAwD;AACxD,4BADW,OAAO,sBAAsB,EAAE,UAAU,CA2DlD"}
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"}
@@ -5,7 +5,7 @@ import { serializeCsv } from '../utils/comma-separated.js';
5
5
 
6
6
  export const DEFAULT_CDN_CNAME = 'https://ucarecdn.com';
7
7
  export const DEFAULT_BASE_URL = 'https://upload.uploadcare.com';
8
- export const DEFAULT_SOCIAL_BASE_URL = 'https://social.staging0.uploadcare.com';
8
+ export const DEFAULT_SOCIAL_BASE_URL = 'https://social.uploadcare.com';
9
9
 
10
10
  /** @type {import('../../types/exported').ConfigType} */
11
11
  export const initialConfig = {
@@ -66,4 +66,10 @@ export const initialConfig = {
66
66
  iconHrefResolver: null,
67
67
  fileValidators: [],
68
68
  collectionValidators: [],
69
+
70
+ defaultCameraTab: 'photo',
71
+ enableAudioRecording: true,
72
+ enableVideoRecording: true,
73
+ maxDurationVideoRecord: null,
74
+ optionsMediaRecorder: null,
69
75
  };
@@ -1 +1 @@
1
- {"version":3,"file":"normalizeConfigValue.d.ts","sourceRoot":"","sources":["normalizeConfigValue.js"],"names":[],"mappings":"AAeO,iCADK,OAAO,WAWlB;AA4IM,sGAHI,OAAO,mDAcjB"}
1
+ {"version":3,"file":"normalizeConfigValue.d.ts","sourceRoot":"","sources":["normalizeConfigValue.js"],"names":[],"mappings":"AAeO,iCADK,OAAO,WAWlB;AA4JM,sGAHI,OAAO,mDAcjB"}
@@ -36,6 +36,15 @@ const asCameraCapture = (value) => {
36
36
  return strValue;
37
37
  };
38
38
 
39
+ /** @param {unknown} value */
40
+ const asCameraTab = (value) => {
41
+ const strValue = asString(value);
42
+ if (strValue !== 'photo' && strValue !== 'video') {
43
+ throw new Error(`Invalid "CameraTab" value: "${strValue}"`);
44
+ }
45
+ return strValue;
46
+ };
47
+
39
48
  /** @param {unknown} value */
40
49
  const asMetadata = (value) => {
41
50
  if (typeof value === 'object' && !Array.isArray(value)) {
@@ -75,7 +84,7 @@ const asFunction = (value) => {
75
84
  };
76
85
 
77
86
  /**
78
- * @template {Function[]} T
87
+ * @template {Function[] | string | {}} T
79
88
  * @param {unknown} value
80
89
  * @returns {T}
81
90
  */
@@ -155,6 +164,13 @@ const mapping = {
155
164
  iconHrefResolver: /** @type {typeof asFunction<import('../../types').IconHrefResolver>} */ (asFunction),
156
165
  fileValidators: /** @type {typeof asArray<import('../../types').FileValidators>} */ (asArray),
157
166
  collectionValidators: /** @type {typeof asArray<import('../../types').CollectionValidators>} */ (asArray),
167
+
168
+ defaultCameraTab: asCameraTab,
169
+ enableAudioRecording: asBoolean,
170
+ enableVideoRecording: asBoolean,
171
+ optionsMediaRecorder: asObject,
172
+
173
+ maxDurationVideoRecord: asNumber,
158
174
  };
159
175
 
160
176
  /**
@@ -1,21 +1,30 @@
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 */
2
18
  export class ExternalSource extends UploaderBlock {
3
19
  activityType: "external";
4
20
  init$: {
5
21
  activityIcon: string;
6
22
  activityCaption: string;
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;
23
+ selectedList: never[];
24
+ counter: number;
25
+ multiple: boolean;
15
26
  onDone: () => void;
16
27
  onCancel: () => void;
17
- onSelectAll: () => void;
18
- onDeselectAll: () => void;
19
28
  '*commonProgress': number;
20
29
  '*uploadList': never[];
21
30
  '*uploadQueue': import("@uploadcare/upload-client").Queue;
@@ -34,30 +43,39 @@ export class ExternalSource extends UploaderBlock {
34
43
  get activityParams(): ActivityParams;
35
44
  /**
36
45
  * @private
37
- * @param {NonNullable<import('./types.js').InputMessageMap['selected-files-change']['selectedFiles']>[number]} selectedFile
46
+ * @type {HTMLIFrameElement | null}
38
47
  */
39
- private extractUrlFromSelectedFile;
48
+ private _iframe;
40
49
  /**
41
50
  * @private
42
- * @param {import('./types.js').InputMessageMap['selected-files-change']} message
51
+ * @param {SelectedFileMessage} message
43
52
  */
44
- private handleSelectedFilesChange;
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;
45
64
  /** @private */
46
65
  private handleIframeLoad;
66
+ /**
67
+ * @private
68
+ * @param {string} propName
69
+ */
70
+ private getCssValue;
47
71
  /** @private */
48
72
  private applyStyles;
49
73
  /** @private */
50
- private setupL10n;
51
- /** @private */
52
74
  private remoteUrl;
53
75
  /** @private */
54
76
  private mountIframe;
55
77
  /** @private */
56
- private _messageBridge;
57
- /** @private */
58
78
  private unmountIframe;
59
- /** @private */
60
- private resetSelectionStatus;
61
79
  }
62
80
  export namespace ExternalSource {
63
81
  let template: string;
@@ -65,5 +83,17 @@ export namespace ExternalSource {
65
83
  export type ActivityParams = {
66
84
  externalSourceType: string;
67
85
  };
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;
68
98
  import { UploaderBlock } from '../../abstract/UploaderBlock.js';
69
99
  //# 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;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"}
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"}