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

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 (131) hide show
  1. package/abstract/UploaderPublicApi.js +1 -1
  2. package/blocks/CameraSource/CameraSource.d.ts +22 -169
  3. package/blocks/CameraSource/CameraSource.d.ts.map +1 -1
  4. package/blocks/CameraSource/CameraSource.js +126 -803
  5. package/blocks/CameraSource/camera-source.css +7 -105
  6. package/blocks/CloudImageEditorActivity/index.css +3 -3
  7. package/blocks/Config/Config.d.ts +2 -4
  8. package/blocks/Config/Config.d.ts.map +1 -1
  9. package/blocks/Config/Config.js +0 -2
  10. package/blocks/Config/initialConfig.d.ts.map +1 -1
  11. package/blocks/Config/initialConfig.js +0 -6
  12. package/blocks/Config/normalizeConfigValue.d.ts.map +1 -1
  13. package/blocks/Config/normalizeConfigValue.js +1 -17
  14. package/blocks/ExternalSource/ExternalSource.d.ts +20 -50
  15. package/blocks/ExternalSource/ExternalSource.d.ts.map +1 -1
  16. package/blocks/ExternalSource/ExternalSource.js +96 -99
  17. package/blocks/ExternalSource/MessageBridge.d.ts +20 -0
  18. package/blocks/ExternalSource/MessageBridge.d.ts.map +1 -0
  19. package/blocks/ExternalSource/MessageBridge.js +71 -0
  20. package/blocks/ExternalSource/buildThemeDefinition.d.ts +3 -0
  21. package/blocks/ExternalSource/buildThemeDefinition.d.ts.map +1 -0
  22. package/blocks/ExternalSource/buildThemeDefinition.js +47 -0
  23. package/blocks/ExternalSource/external-source.css +37 -22
  24. package/blocks/ExternalSource/types.d.ts +113 -0
  25. package/blocks/ExternalSource/types.d.ts.map +1 -0
  26. package/blocks/ExternalSource/types.js +143 -0
  27. package/blocks/Modal/Modal.d.ts.map +1 -1
  28. package/blocks/Modal/Modal.js +4 -11
  29. package/blocks/Modal/modal.css +3 -54
  30. package/blocks/StartFrom/start-from.css +2 -6
  31. package/blocks/UploadList/upload-list.css +1 -11
  32. package/blocks/UrlSource/url-source.css +0 -8
  33. package/blocks/themes/uc-basic/common.css +0 -5
  34. package/blocks/themes/uc-basic/svg-sprite.d.ts +1 -1
  35. package/blocks/themes/uc-basic/svg-sprite.js +1 -1
  36. package/blocks/themes/uc-basic/theme.css +2 -3
  37. package/index.ssr.d.ts +0 -14
  38. package/index.ssr.d.ts.map +1 -1
  39. package/index.ssr.js +8 -81
  40. package/locales/file-uploader/ar.d.ts +2 -0
  41. package/locales/file-uploader/ar.js +2 -0
  42. package/locales/file-uploader/az.d.ts +2 -0
  43. package/locales/file-uploader/az.js +2 -0
  44. package/locales/file-uploader/ca.d.ts +2 -0
  45. package/locales/file-uploader/ca.js +2 -0
  46. package/locales/file-uploader/cs.d.ts +2 -0
  47. package/locales/file-uploader/cs.js +2 -0
  48. package/locales/file-uploader/da.d.ts +2 -0
  49. package/locales/file-uploader/da.js +2 -0
  50. package/locales/file-uploader/de.d.ts +2 -0
  51. package/locales/file-uploader/de.js +2 -0
  52. package/locales/file-uploader/el.d.ts +2 -0
  53. package/locales/file-uploader/el.js +2 -0
  54. package/locales/file-uploader/en.d.ts +2 -0
  55. package/locales/file-uploader/en.js +3 -1
  56. package/locales/file-uploader/es.d.ts +2 -0
  57. package/locales/file-uploader/es.js +2 -0
  58. package/locales/file-uploader/et.d.ts +2 -0
  59. package/locales/file-uploader/et.js +2 -0
  60. package/locales/file-uploader/fr.d.ts +2 -0
  61. package/locales/file-uploader/fr.js +2 -0
  62. package/locales/file-uploader/he.d.ts +2 -0
  63. package/locales/file-uploader/he.js +2 -0
  64. package/locales/file-uploader/hy.d.ts +2 -0
  65. package/locales/file-uploader/hy.js +2 -0
  66. package/locales/file-uploader/is.d.ts +2 -0
  67. package/locales/file-uploader/is.js +2 -0
  68. package/locales/file-uploader/it.d.ts +2 -0
  69. package/locales/file-uploader/it.js +2 -0
  70. package/locales/file-uploader/ja.d.ts +2 -0
  71. package/locales/file-uploader/ja.js +2 -0
  72. package/locales/file-uploader/ka.d.ts +2 -0
  73. package/locales/file-uploader/ka.js +2 -0
  74. package/locales/file-uploader/kk.d.ts +2 -0
  75. package/locales/file-uploader/kk.js +2 -0
  76. package/locales/file-uploader/ko.d.ts +2 -0
  77. package/locales/file-uploader/ko.js +2 -0
  78. package/locales/file-uploader/lv.d.ts +2 -0
  79. package/locales/file-uploader/lv.js +2 -0
  80. package/locales/file-uploader/nb.d.ts +2 -0
  81. package/locales/file-uploader/nb.js +2 -0
  82. package/locales/file-uploader/nl.d.ts +2 -0
  83. package/locales/file-uploader/nl.js +2 -0
  84. package/locales/file-uploader/pl.d.ts +2 -0
  85. package/locales/file-uploader/pl.js +2 -0
  86. package/locales/file-uploader/pt.d.ts +2 -0
  87. package/locales/file-uploader/pt.js +2 -0
  88. package/locales/file-uploader/ro.d.ts +2 -0
  89. package/locales/file-uploader/ro.js +2 -0
  90. package/locales/file-uploader/ru.d.ts +2 -0
  91. package/locales/file-uploader/ru.js +2 -0
  92. package/locales/file-uploader/sk.d.ts +2 -0
  93. package/locales/file-uploader/sk.js +2 -0
  94. package/locales/file-uploader/sr.d.ts +2 -0
  95. package/locales/file-uploader/sr.js +2 -0
  96. package/locales/file-uploader/sv.d.ts +2 -0
  97. package/locales/file-uploader/sv.js +2 -0
  98. package/locales/file-uploader/tr.d.ts +2 -0
  99. package/locales/file-uploader/tr.js +2 -0
  100. package/locales/file-uploader/uk.d.ts +2 -0
  101. package/locales/file-uploader/uk.js +2 -0
  102. package/locales/file-uploader/vi.d.ts +2 -0
  103. package/locales/file-uploader/vi.js +2 -0
  104. package/locales/file-uploader/zh-TW.d.ts +2 -0
  105. package/locales/file-uploader/zh-TW.js +2 -0
  106. package/locales/file-uploader/zh.d.ts +2 -0
  107. package/locales/file-uploader/zh.js +2 -0
  108. package/package.json +2 -4
  109. package/types/exported.d.ts +0 -21
  110. package/web/file-uploader.iife.min.js +4 -4
  111. package/web/file-uploader.min.js +4 -4
  112. package/web/uc-basic.min.css +1 -1
  113. package/web/uc-cloud-image-editor.min.css +1 -1
  114. package/web/uc-cloud-image-editor.min.js +4 -4
  115. package/web/uc-file-uploader-inline.min.css +1 -1
  116. package/web/uc-file-uploader-inline.min.js +4 -4
  117. package/web/uc-file-uploader-minimal.min.css +1 -1
  118. package/web/uc-file-uploader-minimal.min.js +3 -3
  119. package/web/uc-file-uploader-regular.min.css +1 -1
  120. package/web/uc-file-uploader-regular.min.js +4 -4
  121. package/web/uc-img.min.js +1 -1
  122. package/blocks/ExternalSource/buildStyles.d.ts +0 -27
  123. package/blocks/ExternalSource/buildStyles.d.ts.map +0 -1
  124. package/blocks/ExternalSource/buildStyles.js +0 -133
  125. package/blocks/ExternalSource/messages.d.ts +0 -3
  126. package/blocks/ExternalSource/messages.d.ts.map +0 -1
  127. package/blocks/ExternalSource/messages.js +0 -35
  128. package/blocks/LocalEditorImage/LocalEditorImage.d.ts +0 -22
  129. package/blocks/LocalEditorImage/LocalEditorImage.d.ts.map +0 -1
  130. package/blocks/LocalEditorImage/LocalEditorImage.js +0 -139
  131. package/blocks/LocalEditorImage/localEditorImage.css +0 -19
@@ -10,25 +10,9 @@ 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;
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
- }
13
+ [uc-modal] > dialog:has(uc-camera-source[active]) {
14
+ width: 100%;
15
+ height: 100%;
32
16
  }
33
17
 
34
18
  uc-camera-source video {
@@ -52,11 +36,11 @@ uc-camera-source .uc-toolbar {
52
36
  }
53
37
 
54
38
  uc-camera-source .uc-content {
55
- position: relative;
56
39
  display: flex;
57
40
  flex: 1;
58
41
  justify-content: center;
59
42
  width: 100%;
43
+ height: 100%;
60
44
  padding: var(--uc-padding);
61
45
  padding-top: 0;
62
46
  overflow: hidden;
@@ -78,10 +62,12 @@ uc-camera-source .uc-message-box button {
78
62
  }
79
63
 
80
64
  uc-camera-source .uc-shot-btn {
65
+ position: absolute;
66
+ bottom: 20px;
81
67
  width: 58px;
82
68
  height: 58px;
83
69
  color: var(--uc-background);
84
- background-color: var(--uc-primary-light);
70
+ background-color: var(--uc-foreground);
85
71
  border-radius: 50%;
86
72
  opacity: 0.85;
87
73
  transition:
@@ -108,87 +94,3 @@ uc-camera-source .uc-shot-btn uc-icon svg {
108
94
  width: 20px;
109
95
  height: 20px;
110
96
  }
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] 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,6 @@
9
9
  * 'iconHrefResolver',
10
10
  * 'fileValidators',
11
11
  * 'collectionValidators',
12
- * 'optionsMediaRecorder',
13
12
  * ]}
14
13
  */
15
14
  export const complexConfigKeys: [
@@ -19,8 +18,7 @@ export const complexConfigKeys: [
19
18
  'secureDeliveryProxyUrlResolver',
20
19
  'iconHrefResolver',
21
20
  'fileValidators',
22
- 'collectionValidators',
23
- 'optionsMediaRecorder'
21
+ 'collectionValidators'
24
22
  ];
25
23
  export type Config = import('../../utils/mixinClass.js').MixinClass<typeof ConfigClass, import('../../types').ConfigType>;
26
24
  /** @typedef {import('../../utils/mixinClass.js').MixinClass<typeof ConfigClass, import('../../types').ConfigType>} Config */
@@ -64,6 +62,6 @@ declare class ConfigClass extends Block {
64
62
  }
65
63
  import { Block } from '../../abstract/Block.js';
66
64
  /** 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>;
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>;
68
66
  export {};
69
67
  //# 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;;;;;;;;;;;;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"}
@@ -21,7 +21,6 @@ const allConfigKeys = /** @type {(keyof import('../../types').ConfigType)[]} */
21
21
  * 'iconHrefResolver',
22
22
  * 'fileValidators',
23
23
  * 'collectionValidators',
24
- * 'optionsMediaRecorder',
25
24
  * ]}
26
25
  */
27
26
  export const complexConfigKeys = [
@@ -32,7 +31,6 @@ export const complexConfigKeys = [
32
31
  'iconHrefResolver',
33
32
  'fileValidators',
34
33
  'collectionValidators',
35
- 'optionsMediaRecorder',
36
34
  ];
37
35
 
38
36
  /** @type {(key: keyof import('../../types').ConfigType) => key is keyof import('../../types').ConfigComplexType} */
@@ -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,CA2DlD"}
@@ -66,10 +66,4 @@ 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,
75
69
  };
@@ -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;AA4IM,sGAHI,OAAO,mDAcjB"}
@@ -36,15 +36,6 @@ 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
-
48
39
  /** @param {unknown} value */
49
40
  const asMetadata = (value) => {
50
41
  if (typeof value === 'object' && !Array.isArray(value)) {
@@ -84,7 +75,7 @@ const asFunction = (value) => {
84
75
  };
85
76
 
86
77
  /**
87
- * @template {Function[] | string | {}} T
78
+ * @template {Function[]} T
88
79
  * @param {unknown} value
89
80
  * @returns {T}
90
81
  */
@@ -164,13 +155,6 @@ const mapping = {
164
155
  iconHrefResolver: /** @type {typeof asFunction<import('../../types').IconHrefResolver>} */ (asFunction),
165
156
  fileValidators: /** @type {typeof asArray<import('../../types').FileValidators>} */ (asArray),
166
157
  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,
174
158
  };
175
159
 
176
160
  /**
@@ -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"}