@uploadcare/file-uploader 1.11.0-alpha.1 → 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.
- package/blocks/CameraSource/CameraSource.d.ts +22 -169
- package/blocks/CameraSource/CameraSource.d.ts.map +1 -1
- package/blocks/CameraSource/CameraSource.js +126 -805
- package/blocks/CameraSource/camera-source.css +7 -105
- package/blocks/CloudImageEditorActivity/index.css +3 -3
- package/blocks/Config/Config.d.ts +2 -4
- package/blocks/Config/Config.d.ts.map +1 -1
- package/blocks/Config/Config.js +0 -2
- package/blocks/Config/initialConfig.d.ts.map +1 -1
- package/blocks/Config/initialConfig.js +0 -6
- package/blocks/Config/normalizeConfigValue.d.ts.map +1 -1
- package/blocks/Config/normalizeConfigValue.js +1 -17
- package/blocks/ExternalSource/ExternalSource.d.ts +20 -50
- package/blocks/ExternalSource/ExternalSource.d.ts.map +1 -1
- package/blocks/ExternalSource/ExternalSource.js +96 -99
- package/blocks/ExternalSource/MessageBridge.d.ts +20 -0
- package/blocks/ExternalSource/MessageBridge.d.ts.map +1 -0
- package/blocks/ExternalSource/MessageBridge.js +71 -0
- package/blocks/ExternalSource/buildThemeDefinition.d.ts +3 -0
- package/blocks/ExternalSource/buildThemeDefinition.d.ts.map +1 -0
- package/blocks/ExternalSource/buildThemeDefinition.js +47 -0
- package/blocks/ExternalSource/external-source.css +37 -22
- package/blocks/ExternalSource/types.d.ts +113 -0
- package/blocks/ExternalSource/types.d.ts.map +1 -0
- package/blocks/ExternalSource/types.js +143 -0
- package/blocks/Modal/Modal.d.ts.map +1 -1
- package/blocks/Modal/Modal.js +4 -11
- package/blocks/Modal/modal.css +3 -54
- package/blocks/StartFrom/start-from.css +2 -6
- package/blocks/UploadList/upload-list.css +1 -11
- package/blocks/UrlSource/url-source.css +0 -8
- package/blocks/themes/uc-basic/common.css +0 -5
- package/blocks/themes/uc-basic/svg-sprite.d.ts +1 -1
- package/blocks/themes/uc-basic/svg-sprite.js +1 -1
- package/blocks/themes/uc-basic/theme.css +2 -3
- package/index.ssr.d.ts +0 -14
- package/index.ssr.d.ts.map +1 -1
- package/index.ssr.js +8 -81
- package/locales/file-uploader/ar.d.ts +2 -0
- package/locales/file-uploader/ar.js +2 -0
- package/locales/file-uploader/az.d.ts +2 -0
- package/locales/file-uploader/az.js +2 -0
- package/locales/file-uploader/ca.d.ts +2 -0
- package/locales/file-uploader/ca.js +2 -0
- package/locales/file-uploader/cs.d.ts +2 -0
- package/locales/file-uploader/cs.js +2 -0
- package/locales/file-uploader/da.d.ts +2 -0
- package/locales/file-uploader/da.js +2 -0
- package/locales/file-uploader/de.d.ts +2 -0
- package/locales/file-uploader/de.js +2 -0
- package/locales/file-uploader/el.d.ts +2 -0
- package/locales/file-uploader/el.js +2 -0
- package/locales/file-uploader/en.d.ts +2 -0
- package/locales/file-uploader/en.js +3 -1
- package/locales/file-uploader/es.d.ts +2 -0
- package/locales/file-uploader/es.js +2 -0
- package/locales/file-uploader/et.d.ts +2 -0
- package/locales/file-uploader/et.js +2 -0
- package/locales/file-uploader/fr.d.ts +2 -0
- package/locales/file-uploader/fr.js +2 -0
- package/locales/file-uploader/he.d.ts +2 -0
- package/locales/file-uploader/he.js +2 -0
- package/locales/file-uploader/hy.d.ts +2 -0
- package/locales/file-uploader/hy.js +2 -0
- package/locales/file-uploader/is.d.ts +2 -0
- package/locales/file-uploader/is.js +2 -0
- package/locales/file-uploader/it.d.ts +2 -0
- package/locales/file-uploader/it.js +2 -0
- package/locales/file-uploader/ja.d.ts +2 -0
- package/locales/file-uploader/ja.js +2 -0
- package/locales/file-uploader/ka.d.ts +2 -0
- package/locales/file-uploader/ka.js +2 -0
- package/locales/file-uploader/kk.d.ts +2 -0
- package/locales/file-uploader/kk.js +2 -0
- package/locales/file-uploader/ko.d.ts +2 -0
- package/locales/file-uploader/ko.js +2 -0
- package/locales/file-uploader/lv.d.ts +2 -0
- package/locales/file-uploader/lv.js +2 -0
- package/locales/file-uploader/nb.d.ts +2 -0
- package/locales/file-uploader/nb.js +2 -0
- package/locales/file-uploader/nl.d.ts +2 -0
- package/locales/file-uploader/nl.js +2 -0
- package/locales/file-uploader/pl.d.ts +2 -0
- package/locales/file-uploader/pl.js +2 -0
- package/locales/file-uploader/pt.d.ts +2 -0
- package/locales/file-uploader/pt.js +2 -0
- package/locales/file-uploader/ro.d.ts +2 -0
- package/locales/file-uploader/ro.js +2 -0
- package/locales/file-uploader/ru.d.ts +2 -0
- package/locales/file-uploader/ru.js +2 -0
- package/locales/file-uploader/sk.d.ts +2 -0
- package/locales/file-uploader/sk.js +2 -0
- package/locales/file-uploader/sr.d.ts +2 -0
- package/locales/file-uploader/sr.js +2 -0
- package/locales/file-uploader/sv.d.ts +2 -0
- package/locales/file-uploader/sv.js +2 -0
- package/locales/file-uploader/tr.d.ts +2 -0
- package/locales/file-uploader/tr.js +2 -0
- package/locales/file-uploader/uk.d.ts +2 -0
- package/locales/file-uploader/uk.js +2 -0
- package/locales/file-uploader/vi.d.ts +2 -0
- package/locales/file-uploader/vi.js +2 -0
- package/locales/file-uploader/zh-TW.d.ts +2 -0
- package/locales/file-uploader/zh-TW.js +2 -0
- package/locales/file-uploader/zh.d.ts +2 -0
- package/locales/file-uploader/zh.js +2 -0
- package/package.json +2 -4
- package/types/exported.d.ts +0 -21
- package/web/file-uploader.iife.min.js +4 -4
- package/web/file-uploader.min.js +4 -4
- package/web/uc-basic.min.css +1 -1
- package/web/uc-cloud-image-editor.min.css +1 -1
- package/web/uc-cloud-image-editor.min.js +4 -4
- package/web/uc-file-uploader-inline.min.css +1 -1
- package/web/uc-file-uploader-inline.min.js +4 -4
- package/web/uc-file-uploader-minimal.min.css +1 -1
- package/web/uc-file-uploader-minimal.min.js +3 -3
- package/web/uc-file-uploader-regular.min.css +1 -1
- package/web/uc-file-uploader-regular.min.js +4 -4
- package/web/uc-img.min.js +1 -1
- package/blocks/ExternalSource/buildStyles.d.ts +0 -27
- package/blocks/ExternalSource/buildStyles.d.ts.map +0 -1
- package/blocks/ExternalSource/buildStyles.js +0 -133
- package/blocks/ExternalSource/messages.d.ts +0 -3
- package/blocks/ExternalSource/messages.d.ts.map +0 -1
- package/blocks/ExternalSource/messages.js +0 -35
- package/blocks/LocalEditorImage/LocalEditorImage.d.ts +0 -22
- package/blocks/LocalEditorImage/LocalEditorImage.d.ts.map +0 -1
- package/blocks/LocalEditorImage/LocalEditorImage.js +0 -139
- 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:
|
|
15
|
-
height:
|
|
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-
|
|
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:
|
|
12
|
-
height:
|
|
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" | "
|
|
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
|
|
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"}
|
package/blocks/Config/Config.js
CHANGED
|
@@ -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,
|
|
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;
|
|
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[]
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
* @
|
|
37
|
+
* @param {NonNullable<import('./types.js').InputMessageMap['selected-files-change']['selectedFiles']>[number]} selectedFile
|
|
47
38
|
*/
|
|
48
|
-
private
|
|
39
|
+
private extractUrlFromSelectedFile;
|
|
49
40
|
/**
|
|
50
41
|
* @private
|
|
51
|
-
* @param {
|
|
42
|
+
* @param {import('./types.js').InputMessageMap['selected-files-change']} message
|
|
52
43
|
*/
|
|
53
|
-
private
|
|
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
|
|
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"}
|