@uploadcare/file-uploader 1.17.0-alpha.6 → 1.17.0-alpha.9

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.
@@ -76,7 +76,7 @@ export namespace UploaderBlock {
76
76
  let extSrcList: Readonly<{
77
77
  FACEBOOK: "facebook";
78
78
  DROPBOX: "dropbox";
79
- GDRIVE: "ngdrive";
79
+ GDRIVE: "gdrive";
80
80
  GPHOTOS: "gphotos";
81
81
  FLICKR: "flickr";
82
82
  VK: "vk";
@@ -89,7 +89,7 @@ export namespace UploaderBlock {
89
89
  let sourceTypes: Readonly<{
90
90
  FACEBOOK: "facebook";
91
91
  DROPBOX: "dropbox";
92
- GDRIVE: "ngdrive";
92
+ GDRIVE: "gdrive";
93
93
  GPHOTOS: "gphotos";
94
94
  FLICKR: "flickr";
95
95
  VK: "vk";
@@ -1 +1 @@
1
- {"version":3,"file":"ExternalSource.d.ts","sourceRoot":"","sources":["ExternalSource.js"],"names":[],"mappings":"AAYA,+DAA+D;AAE/D;IAEE,yBAAiD;IAK/C;;;QAKE,6FAA6F;sBAAlF,OAAO,YAAY,EAAE,eAAe,CAAC,uBAAuB,CAAC,CAAC,eAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;MAkC1F;IAGH,6BAA6B;IAC7B,sBADW,cAAc,CAOxB;IAgDD;;;OAGG;IACH,mCAcC;IAED;;;OAGG;IACH,kCAsBC;IAED,eAAe;IACf,yBAKC;IAED,eAAe;IACf,4BAKC;IAED,eAAe;IACf,mBAKC;IAED;;;OAGG;IACH,sBAKC;IAED,eAAe;IACf,kBAKC;IAED,eAAe;IACf,kBAeC;IAED,eAAe;IACf,oBA6BC;IALC,eAAe;IACf,uBAA6D;IAM/D,eAAe;IACf,sBAMC;IAED,eAAe;IACf,6BASC;CACF;;;;6BA3Qa;IAAE,kBAAkB,EAAE,MAAM,CAAA;CAAE;8BARd,iCAAiC"}
1
+ {"version":3,"file":"ExternalSource.d.ts","sourceRoot":"","sources":["ExternalSource.js"],"names":[],"mappings":"AAkBA,+DAA+D;AAE/D;IAEE,yBAAiD;IAK/C;;;QAKE,6FAA6F;sBAAlF,OAAO,YAAY,EAAE,eAAe,CAAC,uBAAuB,CAAC,CAAC,eAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;MAkC1F;IAGH,6BAA6B;IAC7B,sBADW,cAAc,CAOxB;IAgDD;;;OAGG;IACH,mCAcC;IAED;;;OAGG;IACH,kCAsBC;IAED,eAAe;IACf,yBAKC;IAED,eAAe;IACf,4BAKC;IAED,eAAe;IACf,mBAKC;IAED;;;OAGG;IACH,sBAKC;IAED,eAAe;IACf,kBAKC;IAED,eAAe;IACf,kBAgBC;IAED,eAAe;IACf,oBA6BC;IALC,eAAe;IACf,uBAA6D;IAM/D,eAAe;IACf,sBAMC;IAED,eAAe;IACf,6BASC;CACF;;;;6BA5Qa;IAAE,kBAAkB,EAAE,MAAM,CAAA;CAAE;8BAdd,iCAAiC"}
@@ -9,6 +9,12 @@ import { buildThemeDefinition } from './buildThemeDefinition.js';
9
9
  import { MessageBridge } from './MessageBridge.js';
10
10
  import { queryString } from './query-string.js';
11
11
  import { getTopLevelOrigin } from '../../utils/get-top-level-origin.js';
12
+ import { ExternalUploadSource } from '../utils/UploadSource.js';
13
+
14
+ /** @type {Record<string, string>} */
15
+ const SOCIAL_SOURCE_MAPPING = {
16
+ [ExternalUploadSource.GDRIVE]: 'ngdrive',
17
+ };
12
18
 
13
19
  /** @typedef {{ externalSourceType: string }} ActivityParams */
14
20
 
@@ -211,6 +217,7 @@ export class ExternalSource extends UploaderBlock {
211
217
  remoteUrl() {
212
218
  const { pubkey, remoteTabSessionKey, socialBaseUrl, multiple } = this.cfg;
213
219
  const { externalSourceType } = this.activityParams;
220
+ const sourceName = SOCIAL_SOURCE_MAPPING[externalSourceType] ?? externalSourceType;
214
221
  const lang = this.l10n('social-source-lang')?.split('-')?.[0] || 'en';
215
222
  const params = {
216
223
  lang,
@@ -220,7 +227,7 @@ export class ExternalSource extends UploaderBlock {
220
227
  wait_for_theme: true,
221
228
  multiple: multiple.toString(),
222
229
  };
223
- const url = new URL(`/window4/${externalSourceType}`, socialBaseUrl);
230
+ const url = new URL(`/window4/${sourceName}`, socialBaseUrl);
224
231
  url.search = queryString(params);
225
232
  return url.toString();
226
233
  }
@@ -1,7 +1,7 @@
1
1
  export const ExternalUploadSource: Readonly<{
2
2
  FACEBOOK: "facebook";
3
3
  DROPBOX: "dropbox";
4
- GDRIVE: "ngdrive";
4
+ GDRIVE: "gdrive";
5
5
  GPHOTOS: "gphotos";
6
6
  FLICKR: "flickr";
7
7
  VK: "vk";
@@ -17,7 +17,7 @@ export const UploadSourceMobile: Readonly<{
17
17
  export const UploadSource: Readonly<{
18
18
  FACEBOOK: "facebook";
19
19
  DROPBOX: "dropbox";
20
- GDRIVE: "ngdrive";
20
+ GDRIVE: "gdrive";
21
21
  GPHOTOS: "gphotos";
22
22
  FLICKR: "flickr";
23
23
  VK: "vk";
@@ -2,7 +2,7 @@
2
2
  export const ExternalUploadSource = Object.freeze({
3
3
  FACEBOOK: 'facebook',
4
4
  DROPBOX: 'dropbox',
5
- GDRIVE: 'ngdrive',
5
+ GDRIVE: 'gdrive',
6
6
  GPHOTOS: 'gphotos',
7
7
  FLICKR: 'flickr',
8
8
  VK: 'vk',
package/index.ssr.js CHANGED
@@ -154,7 +154,7 @@ export const CameraSource = class {
154
154
  static extSrcList = {
155
155
  FACEBOOK: "facebook",
156
156
  DROPBOX: "dropbox",
157
- GDRIVE: "ngdrive",
157
+ GDRIVE: "gdrive",
158
158
  GPHOTOS: "gphotos",
159
159
  FLICKR: "flickr",
160
160
  VK: "vk",
@@ -175,7 +175,7 @@ export const CameraSource = class {
175
175
  MOBILE_PHOTO_CAMERA: "mobile-photo-camera",
176
176
  FACEBOOK: "facebook",
177
177
  DROPBOX: "dropbox",
178
- GDRIVE: "ngdrive",
178
+ GDRIVE: "gdrive",
179
179
  GPHOTOS: "gphotos",
180
180
  FLICKR: "flickr",
181
181
  VK: "vk",
@@ -242,7 +242,7 @@ export const CloudImageEditorActivity = class {
242
242
  static extSrcList = {
243
243
  FACEBOOK: "facebook",
244
244
  DROPBOX: "dropbox",
245
- GDRIVE: "ngdrive",
245
+ GDRIVE: "gdrive",
246
246
  GPHOTOS: "gphotos",
247
247
  FLICKR: "flickr",
248
248
  VK: "vk",
@@ -263,7 +263,7 @@ export const CloudImageEditorActivity = class {
263
263
  MOBILE_PHOTO_CAMERA: "mobile-photo-camera",
264
264
  FACEBOOK: "facebook",
265
265
  DROPBOX: "dropbox",
266
- GDRIVE: "ngdrive",
266
+ GDRIVE: "gdrive",
267
267
  GPHOTOS: "gphotos",
268
268
  FLICKR: "flickr",
269
269
  VK: "vk",
@@ -501,7 +501,7 @@ export const DropArea = class {
501
501
  static extSrcList = {
502
502
  FACEBOOK: "facebook",
503
503
  DROPBOX: "dropbox",
504
- GDRIVE: "ngdrive",
504
+ GDRIVE: "gdrive",
505
505
  GPHOTOS: "gphotos",
506
506
  FLICKR: "flickr",
507
507
  VK: "vk",
@@ -522,7 +522,7 @@ export const DropArea = class {
522
522
  MOBILE_PHOTO_CAMERA: "mobile-photo-camera",
523
523
  FACEBOOK: "facebook",
524
524
  DROPBOX: "dropbox",
525
- GDRIVE: "ngdrive",
525
+ GDRIVE: "gdrive",
526
526
  GPHOTOS: "gphotos",
527
527
  FLICKR: "flickr",
528
528
  VK: "vk",
@@ -786,7 +786,7 @@ export const ExternalSource = class {
786
786
  static extSrcList = {
787
787
  FACEBOOK: "facebook",
788
788
  DROPBOX: "dropbox",
789
- GDRIVE: "ngdrive",
789
+ GDRIVE: "gdrive",
790
790
  GPHOTOS: "gphotos",
791
791
  FLICKR: "flickr",
792
792
  VK: "vk",
@@ -807,7 +807,7 @@ export const ExternalSource = class {
807
807
  MOBILE_PHOTO_CAMERA: "mobile-photo-camera",
808
808
  FACEBOOK: "facebook",
809
809
  DROPBOX: "dropbox",
810
- GDRIVE: "ngdrive",
810
+ GDRIVE: "gdrive",
811
811
  GPHOTOS: "gphotos",
812
812
  FLICKR: "flickr",
813
813
  VK: "vk",
@@ -833,7 +833,7 @@ export const ExternalSource = class {
833
833
  export const ExternalUploadSource = {
834
834
  FACEBOOK: "facebook",
835
835
  DROPBOX: "dropbox",
836
- GDRIVE: "ngdrive",
836
+ GDRIVE: "gdrive",
837
837
  GPHOTOS: "gphotos",
838
838
  FLICKR: "flickr",
839
839
  VK: "vk",
@@ -884,7 +884,7 @@ export const FileItem = class {
884
884
  static extSrcList = {
885
885
  FACEBOOK: "facebook",
886
886
  DROPBOX: "dropbox",
887
- GDRIVE: "ngdrive",
887
+ GDRIVE: "gdrive",
888
888
  GPHOTOS: "gphotos",
889
889
  FLICKR: "flickr",
890
890
  VK: "vk",
@@ -905,7 +905,7 @@ export const FileItem = class {
905
905
  MOBILE_PHOTO_CAMERA: "mobile-photo-camera",
906
906
  FACEBOOK: "facebook",
907
907
  DROPBOX: "dropbox",
908
- GDRIVE: "ngdrive",
908
+ GDRIVE: "gdrive",
909
909
  GPHOTOS: "gphotos",
910
910
  FLICKR: "flickr",
911
911
  VK: "vk",
@@ -951,7 +951,7 @@ export const FormInput = class {
951
951
  static extSrcList = {
952
952
  FACEBOOK: "facebook",
953
953
  DROPBOX: "dropbox",
954
- GDRIVE: "ngdrive",
954
+ GDRIVE: "gdrive",
955
955
  GPHOTOS: "gphotos",
956
956
  FLICKR: "flickr",
957
957
  VK: "vk",
@@ -972,7 +972,7 @@ export const FormInput = class {
972
972
  MOBILE_PHOTO_CAMERA: "mobile-photo-camera",
973
973
  FACEBOOK: "facebook",
974
974
  DROPBOX: "dropbox",
975
- GDRIVE: "ngdrive",
975
+ GDRIVE: "gdrive",
976
976
  GPHOTOS: "gphotos",
977
977
  FLICKR: "flickr",
978
978
  VK: "vk",
@@ -1087,7 +1087,7 @@ export const ProgressBarCommon = class {
1087
1087
  static extSrcList = {
1088
1088
  FACEBOOK: "facebook",
1089
1089
  DROPBOX: "dropbox",
1090
- GDRIVE: "ngdrive",
1090
+ GDRIVE: "gdrive",
1091
1091
  GPHOTOS: "gphotos",
1092
1092
  FLICKR: "flickr",
1093
1093
  VK: "vk",
@@ -1108,7 +1108,7 @@ export const ProgressBarCommon = class {
1108
1108
  MOBILE_PHOTO_CAMERA: "mobile-photo-camera",
1109
1109
  FACEBOOK: "facebook",
1110
1110
  DROPBOX: "dropbox",
1111
- GDRIVE: "ngdrive",
1111
+ GDRIVE: "gdrive",
1112
1112
  GPHOTOS: "gphotos",
1113
1113
  FLICKR: "flickr",
1114
1114
  VK: "vk",
@@ -1154,7 +1154,7 @@ export const SimpleBtn = class {
1154
1154
  static extSrcList = {
1155
1155
  FACEBOOK: "facebook",
1156
1156
  DROPBOX: "dropbox",
1157
- GDRIVE: "ngdrive",
1157
+ GDRIVE: "gdrive",
1158
1158
  GPHOTOS: "gphotos",
1159
1159
  FLICKR: "flickr",
1160
1160
  VK: "vk",
@@ -1175,7 +1175,7 @@ export const SimpleBtn = class {
1175
1175
  MOBILE_PHOTO_CAMERA: "mobile-photo-camera",
1176
1176
  FACEBOOK: "facebook",
1177
1177
  DROPBOX: "dropbox",
1178
- GDRIVE: "ngdrive",
1178
+ GDRIVE: "gdrive",
1179
1179
  GPHOTOS: "gphotos",
1180
1180
  FLICKR: "flickr",
1181
1181
  VK: "vk",
@@ -1230,7 +1230,7 @@ export const SourceBtn = class {
1230
1230
  static extSrcList = {
1231
1231
  FACEBOOK: "facebook",
1232
1232
  DROPBOX: "dropbox",
1233
- GDRIVE: "ngdrive",
1233
+ GDRIVE: "gdrive",
1234
1234
  GPHOTOS: "gphotos",
1235
1235
  FLICKR: "flickr",
1236
1236
  VK: "vk",
@@ -1251,7 +1251,7 @@ export const SourceBtn = class {
1251
1251
  MOBILE_PHOTO_CAMERA: "mobile-photo-camera",
1252
1252
  FACEBOOK: "facebook",
1253
1253
  DROPBOX: "dropbox",
1254
- GDRIVE: "ngdrive",
1254
+ GDRIVE: "gdrive",
1255
1255
  GPHOTOS: "gphotos",
1256
1256
  FLICKR: "flickr",
1257
1257
  VK: "vk",
@@ -1314,7 +1314,7 @@ export const Thumb = class {
1314
1314
  static extSrcList = {
1315
1315
  FACEBOOK: "facebook",
1316
1316
  DROPBOX: "dropbox",
1317
- GDRIVE: "ngdrive",
1317
+ GDRIVE: "gdrive",
1318
1318
  GPHOTOS: "gphotos",
1319
1319
  FLICKR: "flickr",
1320
1320
  VK: "vk",
@@ -1335,7 +1335,7 @@ export const Thumb = class {
1335
1335
  MOBILE_PHOTO_CAMERA: "mobile-photo-camera",
1336
1336
  FACEBOOK: "facebook",
1337
1337
  DROPBOX: "dropbox",
1338
- GDRIVE: "ngdrive",
1338
+ GDRIVE: "gdrive",
1339
1339
  GPHOTOS: "gphotos",
1340
1340
  FLICKR: "flickr",
1341
1341
  VK: "vk",
@@ -1394,7 +1394,7 @@ export const UploadCtxProvider = class {
1394
1394
  static extSrcList = {
1395
1395
  FACEBOOK: "facebook",
1396
1396
  DROPBOX: "dropbox",
1397
- GDRIVE: "ngdrive",
1397
+ GDRIVE: "gdrive",
1398
1398
  GPHOTOS: "gphotos",
1399
1399
  FLICKR: "flickr",
1400
1400
  VK: "vk",
@@ -1415,7 +1415,7 @@ export const UploadCtxProvider = class {
1415
1415
  MOBILE_PHOTO_CAMERA: "mobile-photo-camera",
1416
1416
  FACEBOOK: "facebook",
1417
1417
  DROPBOX: "dropbox",
1418
- GDRIVE: "ngdrive",
1418
+ GDRIVE: "gdrive",
1419
1419
  GPHOTOS: "gphotos",
1420
1420
  FLICKR: "flickr",
1421
1421
  VK: "vk",
@@ -1498,7 +1498,7 @@ export const UploadList = class {
1498
1498
  static extSrcList = {
1499
1499
  FACEBOOK: "facebook",
1500
1500
  DROPBOX: "dropbox",
1501
- GDRIVE: "ngdrive",
1501
+ GDRIVE: "gdrive",
1502
1502
  GPHOTOS: "gphotos",
1503
1503
  FLICKR: "flickr",
1504
1504
  VK: "vk",
@@ -1519,7 +1519,7 @@ export const UploadList = class {
1519
1519
  MOBILE_PHOTO_CAMERA: "mobile-photo-camera",
1520
1520
  FACEBOOK: "facebook",
1521
1521
  DROPBOX: "dropbox",
1522
- GDRIVE: "ngdrive",
1522
+ GDRIVE: "gdrive",
1523
1523
  GPHOTOS: "gphotos",
1524
1524
  FLICKR: "flickr",
1525
1525
  VK: "vk",
@@ -1554,7 +1554,7 @@ export const UploadSource = {
1554
1554
  MOBILE_PHOTO_CAMERA: "mobile-photo-camera",
1555
1555
  FACEBOOK: "facebook",
1556
1556
  DROPBOX: "dropbox",
1557
- GDRIVE: "ngdrive",
1557
+ GDRIVE: "gdrive",
1558
1558
  GPHOTOS: "gphotos",
1559
1559
  FLICKR: "flickr",
1560
1560
  VK: "vk",
@@ -1567,7 +1567,7 @@ export const UploaderBlock = class {
1567
1567
  static extSrcList = {
1568
1568
  FACEBOOK: "facebook",
1569
1569
  DROPBOX: "dropbox",
1570
- GDRIVE: "ngdrive",
1570
+ GDRIVE: "gdrive",
1571
1571
  GPHOTOS: "gphotos",
1572
1572
  FLICKR: "flickr",
1573
1573
  VK: "vk",
@@ -1588,7 +1588,7 @@ export const UploaderBlock = class {
1588
1588
  MOBILE_PHOTO_CAMERA: "mobile-photo-camera",
1589
1589
  FACEBOOK: "facebook",
1590
1590
  DROPBOX: "dropbox",
1591
- GDRIVE: "ngdrive",
1591
+ GDRIVE: "gdrive",
1592
1592
  GPHOTOS: "gphotos",
1593
1593
  FLICKR: "flickr",
1594
1594
  VK: "vk",
@@ -1643,7 +1643,7 @@ export const UrlSource = class {
1643
1643
  static extSrcList = {
1644
1644
  FACEBOOK: "facebook",
1645
1645
  DROPBOX: "dropbox",
1646
- GDRIVE: "ngdrive",
1646
+ GDRIVE: "gdrive",
1647
1647
  GPHOTOS: "gphotos",
1648
1648
  FLICKR: "flickr",
1649
1649
  VK: "vk",
@@ -1664,7 +1664,7 @@ export const UrlSource = class {
1664
1664
  MOBILE_PHOTO_CAMERA: "mobile-photo-camera",
1665
1665
  FACEBOOK: "facebook",
1666
1666
  DROPBOX: "dropbox",
1667
- GDRIVE: "ngdrive",
1667
+ GDRIVE: "gdrive",
1668
1668
  GPHOTOS: "gphotos",
1669
1669
  FLICKR: "flickr",
1670
1670
  VK: "vk",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uploadcare/file-uploader",
3
- "version": "1.17.0-alpha.6",
3
+ "version": "1.17.0-alpha.9",
4
4
  "description": "Building blocks for Uploadcare products integration",
5
5
  "keywords": [
6
6
  "web components",