@uploadcare/file-uploader 1.24.0-alpha.1 → 1.24.0

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/dist/env.js CHANGED
@@ -25,7 +25,7 @@
25
25
  */
26
26
 
27
27
  // package.json
28
- var version = "1.24.0-alpha.1";
28
+ var version = "1.24.0";
29
29
 
30
30
  // src/env.ts
31
31
  var PACKAGE_NAME = "blocks";
package/dist/index.css CHANGED
@@ -23,10 +23,10 @@
23
23
  * SOFTWARE.
24
24
  *
25
25
  */
26
- @layer uc-base, uc-components, uc-rules, uc-solutions, uc-reset, uc-base, uc-rules, uc-reset;
26
+ @layer uc, uc.base, uc.components, uc.rules, uc.solutions, uc.post-reset, uc.base, uc.rules, uc.post-reset;
27
27
 
28
28
  /* src/blocks/ActivityHeader/activity-header.css */
29
- @layer uc-components {
29
+ @layer uc.components {
30
30
  uc-activity-header {
31
31
  display: flex;
32
32
  justify-content: space-between;
@@ -43,7 +43,7 @@
43
43
  }
44
44
 
45
45
  /* src/blocks/CameraSource/camera-source.css */
46
- @layer uc-components {
46
+ @layer uc.components {
47
47
  uc-camera-source {
48
48
  position: relative;
49
49
  display: flex;
@@ -204,7 +204,7 @@
204
204
  }
205
205
 
206
206
  /* src/blocks/CloudImageEditor/src/css/common.css */
207
- @layer uc-solutions {
207
+ @layer uc.solutions {
208
208
  [uc-cloud-image-editor] {
209
209
  --color-primary-accent: var(--uc-primary);
210
210
  --color-text-base: var(--uc-foreground);
@@ -1207,7 +1207,7 @@
1207
1207
  }
1208
1208
 
1209
1209
  /* src/blocks/CloudImageEditor/src/css/icons.css */
1210
- @layer uc-solutions {
1210
+ @layer uc.solutions {
1211
1211
  :where([uc-cloud-image-editor]) uc-icon {
1212
1212
  display: flex;
1213
1213
  justify-content: center;
@@ -1225,7 +1225,7 @@
1225
1225
  /* src/blocks/CloudImageEditor/index.css */
1226
1226
 
1227
1227
  /* src/blocks/CloudImageEditorActivity/cloud-image-editor-activity.css */
1228
- @layer uc-components {
1228
+ @layer uc.components {
1229
1229
  uc-cloud-image-editor-activity {
1230
1230
  position: relative;
1231
1231
  display: flex;
@@ -1241,14 +1241,14 @@
1241
1241
  }
1242
1242
 
1243
1243
  /* src/blocks/Config/config.css */
1244
- @layer uc-components {
1244
+ @layer uc.components {
1245
1245
  uc-config {
1246
1246
  display: none;
1247
1247
  }
1248
1248
  }
1249
1249
 
1250
1250
  /* src/blocks/Copyright/copyright.css */
1251
- @layer uc-components {
1251
+ @layer uc.components {
1252
1252
  uc-copyright {
1253
1253
  display: flex;
1254
1254
  width: 100%;
@@ -1279,7 +1279,7 @@
1279
1279
  }
1280
1280
 
1281
1281
  /* src/blocks/DropArea/drop-area.css */
1282
- @layer uc-components {
1282
+ @layer uc.components {
1283
1283
  :where([uc-drop-area]) {
1284
1284
  padding: 2px;
1285
1285
  overflow: hidden;
@@ -1438,7 +1438,7 @@
1438
1438
  }
1439
1439
 
1440
1440
  /* src/blocks/ExternalSource/external-source.css */
1441
- @layer uc-components {
1441
+ @layer uc.components {
1442
1442
  uc-external-source {
1443
1443
  display: flex;
1444
1444
  flex-direction: column;
@@ -1523,7 +1523,7 @@
1523
1523
  }
1524
1524
 
1525
1525
  /* src/blocks/FileItem/file-item.css */
1526
- @layer uc-components {
1526
+ @layer uc.components {
1527
1527
  uc-file-item {
1528
1528
  --uc-file-item-gap: 4px;
1529
1529
  --uc-file-item-height: calc(var(--uc-preview-size) + var(--uc-padding) * 2 + var(--uc-file-item-gap));
@@ -1729,7 +1729,7 @@
1729
1729
  }
1730
1730
 
1731
1731
  /* src/blocks/Icon/icon.css */
1732
- @layer uc-components {
1732
+ @layer uc.components {
1733
1733
  uc-icon {
1734
1734
  display: inline-flex;
1735
1735
  align-items: center;
@@ -1740,11 +1740,12 @@
1740
1740
  uc-icon svg {
1741
1741
  width: calc(var(--uc-button-size) / 2);
1742
1742
  height: calc(var(--uc-button-size) / 2);
1743
+ overflow: visible;
1743
1744
  }
1744
1745
  }
1745
1746
 
1746
1747
  /* src/blocks/Modal/modal.css */
1747
- @layer uc-components {
1748
+ @layer uc.components {
1748
1749
  @supports selector(dialog::backdrop) {
1749
1750
  :where([uc-modal]) > dialog::backdrop {
1750
1751
  background-color: oklch(0 0 0 / 0.1);
@@ -1785,7 +1786,7 @@
1785
1786
  }
1786
1787
 
1787
1788
  /* src/blocks/ProgressBar/progress-bar.css */
1788
- @layer uc-components {
1789
+ @layer uc.components {
1789
1790
  uc-progress-bar {
1790
1791
  --l-progress-value: 0;
1791
1792
  position: absolute;
@@ -1840,7 +1841,7 @@
1840
1841
  }
1841
1842
 
1842
1843
  /* src/blocks/ProgressBarCommon/progress-bar-common.css */
1843
- @layer uc-components {
1844
+ @layer uc.components {
1844
1845
  uc-progress-bar-common {
1845
1846
  position: fixed;
1846
1847
  right: 0;
@@ -1859,7 +1860,7 @@
1859
1860
  }
1860
1861
 
1861
1862
  /* src/blocks/Select/select.css */
1862
- @layer uc-components {
1863
+ @layer uc.components {
1863
1864
  uc-select {
1864
1865
  display: inline-flex;
1865
1866
  }
@@ -1884,7 +1885,7 @@
1884
1885
  }
1885
1886
 
1886
1887
  /* src/blocks/SimpleBtn/simple-btn.css */
1887
- @layer uc-components {
1888
+ @layer uc.components {
1888
1889
  :where([uc-simple-btn]) {
1889
1890
  position: relative;
1890
1891
  display: inline-flex;
@@ -1945,7 +1946,7 @@
1945
1946
  }
1946
1947
 
1947
1948
  /* src/blocks/SourceBtn/source-btn.css */
1948
- @layer uc-components {
1949
+ @layer uc.components {
1949
1950
  uc-source-btn > button {
1950
1951
  display: flex;
1951
1952
  align-items: center;
@@ -1994,7 +1995,7 @@
1994
1995
  }
1995
1996
 
1996
1997
  /* src/blocks/Spinner/spinner.css */
1997
- @layer uc-components {
1998
+ @layer uc.components {
1998
1999
  @keyframes uc-spinner-keyframes {
1999
2000
  from {
2000
2001
  transform: rotate(0deg);
@@ -2015,7 +2016,7 @@
2015
2016
  }
2016
2017
 
2017
2018
  /* src/blocks/StartFrom/start-from.css */
2018
- @layer uc-components {
2019
+ @layer uc.components {
2019
2020
  uc-start-from {
2020
2021
  display: block;
2021
2022
  overflow-y: auto;
@@ -2043,7 +2044,7 @@
2043
2044
  }
2044
2045
 
2045
2046
  /* src/blocks/Thumb/thumb.css */
2046
- @layer uc-components {
2047
+ @layer uc.components {
2047
2048
  uc-thumb {
2048
2049
  width: 100%;
2049
2050
  height: 100%;
@@ -2051,7 +2052,7 @@
2051
2052
  }
2052
2053
 
2053
2054
  /* src/blocks/UploadList/upload-list.css */
2054
- @layer uc-components {
2055
+ @layer uc.components {
2055
2056
  uc-upload-list {
2056
2057
  position: relative;
2057
2058
  display: flex;
@@ -2130,7 +2131,7 @@
2130
2131
  }
2131
2132
 
2132
2133
  /* src/blocks/UrlSource/url-source.css */
2133
- @layer uc-components {
2134
+ @layer uc.components {
2134
2135
  uc-url-source {
2135
2136
  display: block;
2136
2137
  background-color: var(--uc-background);
@@ -2148,7 +2149,7 @@
2148
2149
  }
2149
2150
 
2150
2151
  /* src/solutions/file-uploader/inline/index.css */
2151
- @layer uc-solutions {
2152
+ @layer uc.solutions {
2152
2153
  [uc-file-uploader-inline] uc-start-from {
2153
2154
  height: 100%;
2154
2155
  container-type: inline-size;
@@ -2193,7 +2194,7 @@
2193
2194
  }
2194
2195
 
2195
2196
  /* src/solutions/file-uploader/minimal/index.css */
2196
- @layer uc-solutions {
2197
+ @layer uc.solutions {
2197
2198
  :where([uc-file-uploader-minimal]) {
2198
2199
  --cfg-init-activity: "start-from";
2199
2200
  --cfg-done-activity: "upload-list";
@@ -2314,10 +2315,10 @@
2314
2315
  }
2315
2316
 
2316
2317
  /* src/blocks/themes/uc-basic/layers.css */
2317
- @layer uc-base, uc-components, uc-rules, uc-solutions, uc-reset;
2318
+ @layer uc, uc.base, uc.components, uc.rules, uc.solutions, uc.post-reset;
2318
2319
 
2319
2320
  /* src/blocks/themes/uc-basic/config.css */
2320
- @layer uc-base {
2321
+ @layer uc.base {
2321
2322
  :where([uc-wgt-common]) {
2322
2323
  --cfg-init-activity: "start-from";
2323
2324
  --cfg-done-activity: "";
@@ -2325,7 +2326,7 @@
2325
2326
  }
2326
2327
 
2327
2328
  /* src/blocks/themes/uc-basic/theme.css */
2328
- @layer uc-base {
2329
+ @layer uc.base {
2329
2330
  :where([uc-wgt-common]) {
2330
2331
  --uc-font-family: system-ui;
2331
2332
  --uc-font-size: 14px;
@@ -2588,7 +2589,7 @@
2588
2589
  }
2589
2590
 
2590
2591
  /* src/blocks/themes/uc-basic/common.css */
2591
- @layer uc-base {
2592
+ @layer uc.base {
2592
2593
  :where([uc-wgt-common]) {
2593
2594
  color: var(--uc-foreground);
2594
2595
  font-size: var(--uc-font-size);
@@ -2688,7 +2689,7 @@
2688
2689
  }
2689
2690
 
2690
2691
  /* src/blocks/themes/uc-basic/rules.css */
2691
- @layer uc-rules {
2692
+ @layer uc.rules {
2692
2693
  :where([uc-wgt-common]) [hidden] {
2693
2694
  display: none;
2694
2695
  }
@@ -2701,7 +2702,7 @@
2701
2702
  }
2702
2703
 
2703
2704
  /* src/blocks/themes/uc-basic/post-reset.css */
2704
- @layer uc-reset {
2705
+ @layer uc.post-reset {
2705
2706
  :where([uc-wgt-common]) uc-source-btn[type] {
2706
2707
  all: unset;
2707
2708
  }
@@ -2710,5 +2711,5 @@
2710
2711
  /* src/blocks/themes/uc-basic/index.css */
2711
2712
 
2712
2713
  /* src/solutions/file-uploader/regular/index.css */
2713
- @layer uc-solutions {
2714
+ @layer uc.solutions {
2714
2715
  }
package/dist/index.d.ts CHANGED
@@ -7,41 +7,6 @@ export { loadFileUploaderFrom } from './abstract/loadFileUploaderFrom.js';
7
7
  import { TelemetryRequest } from '@uploadcare/quality-insights';
8
8
  export { PACKAGE_NAME, PACKAGE_VERSION } from './env.js';
9
9
 
10
- declare const ExternalUploadSource: Readonly<{
11
- readonly FACEBOOK: "facebook";
12
- readonly DROPBOX: "dropbox";
13
- readonly GDRIVE: "gdrive";
14
- readonly GPHOTOS: "gphotos";
15
- readonly FLICKR: "flickr";
16
- readonly VK: "vk";
17
- readonly EVERNOTE: "evernote";
18
- readonly BOX: "box";
19
- readonly ONEDRIVE: "onedrive";
20
- readonly HUDDLE: "huddle";
21
- }>;
22
- declare const UploadSource: Readonly<{
23
- readonly FACEBOOK: "facebook";
24
- readonly DROPBOX: "dropbox";
25
- readonly GDRIVE: "gdrive";
26
- readonly GPHOTOS: "gphotos";
27
- readonly FLICKR: "flickr";
28
- readonly VK: "vk";
29
- readonly EVERNOTE: "evernote";
30
- readonly BOX: "box";
31
- readonly ONEDRIVE: "onedrive";
32
- readonly HUDDLE: "huddle";
33
- readonly MOBILE_VIDEO_CAMERA: "mobile-video-camera";
34
- readonly MOBILE_PHOTO_CAMERA: "mobile-photo-camera";
35
- readonly LOCAL: "local";
36
- readonly DROP_AREA: "drop-area";
37
- readonly CAMERA: "camera";
38
- readonly EXTERNAL: "external";
39
- readonly API: "js-api";
40
- readonly URL: "url";
41
- readonly DRAW: "draw";
42
- }>;
43
- type SourceTypes = (typeof UploadSource)[keyof typeof UploadSource];
44
-
45
10
  declare class A11y {
46
11
  private _destroyKeyUX;
47
12
  private readonly _scopedWindow;
@@ -182,7 +147,7 @@ declare class Block extends BaseComponent<any> {
182
147
  static StateConsumerScope: string | null;
183
148
  static styleAttrs: string[];
184
149
  protected requireCtxName: boolean;
185
- activityType: any;
150
+ activityType: ActivityType;
186
151
  init$: {};
187
152
  l10n(str: string, variables?: Record<string, string | number>): string;
188
153
  private pluralize;
@@ -479,8 +444,8 @@ declare class ValidationManager {
479
444
  private _getValidatorDescriptorsForEntry;
480
445
  }
481
446
 
482
- type CameraMode = "photo" | "video";
483
- type CameraStatus = "shot" | "retake" | "accept" | "play" | "stop" | "pause" | "resume";
447
+ type CameraMode = 'photo' | 'video';
448
+ type CameraStatus = 'shot' | 'retake' | 'accept' | 'play' | 'stop' | 'pause' | 'resume';
484
449
  declare class CameraSource extends UploaderBlock {
485
450
  couldBeCtxOwner: boolean;
486
451
  activityType: "camera";
@@ -580,12 +545,52 @@ declare class UploadList extends UploaderBlock {
580
545
  destroyCallback(): void;
581
546
  }
582
547
 
548
+ declare const ExternalUploadSource: Readonly<{
549
+ readonly FACEBOOK: "facebook";
550
+ readonly DROPBOX: "dropbox";
551
+ readonly GDRIVE: "gdrive";
552
+ readonly GPHOTOS: "gphotos";
553
+ readonly FLICKR: "flickr";
554
+ readonly VK: "vk";
555
+ readonly EVERNOTE: "evernote";
556
+ readonly BOX: "box";
557
+ readonly ONEDRIVE: "onedrive";
558
+ readonly HUDDLE: "huddle";
559
+ }>;
560
+ declare const UploadSource: Readonly<{
561
+ readonly FACEBOOK: "facebook";
562
+ readonly DROPBOX: "dropbox";
563
+ readonly GDRIVE: "gdrive";
564
+ readonly GPHOTOS: "gphotos";
565
+ readonly FLICKR: "flickr";
566
+ readonly VK: "vk";
567
+ readonly EVERNOTE: "evernote";
568
+ readonly BOX: "box";
569
+ readonly ONEDRIVE: "onedrive";
570
+ readonly HUDDLE: "huddle";
571
+ readonly MOBILE_VIDEO_CAMERA: "mobile-video-camera";
572
+ readonly MOBILE_PHOTO_CAMERA: "mobile-photo-camera";
573
+ readonly LOCAL: "local";
574
+ readonly DROP_AREA: "drop-area";
575
+ readonly CAMERA: "camera";
576
+ readonly EXTERNAL: "external";
577
+ readonly API: "js-api";
578
+ readonly URL: "url";
579
+ readonly DRAW: "draw";
580
+ }>;
581
+ type SourceTypes = (typeof UploadSource)[keyof typeof UploadSource];
582
+
583
583
  declare const CameraSourceTypes: Readonly<{
584
584
  PHOTO: "photo";
585
585
  VIDEO: "video";
586
586
  }>;
587
587
  type ModeCameraType = (typeof CameraSourceTypes)[keyof typeof CameraSourceTypes];
588
588
 
589
+ type ApiAddFileCommonOptions = {
590
+ silent?: boolean;
591
+ fileName?: string;
592
+ source?: string;
593
+ };
589
594
  declare class UploaderPublicApi {
590
595
  private _ctx;
591
596
  constructor(ctx: UploaderBlock);
@@ -595,25 +600,10 @@ declare class UploaderPublicApi {
595
600
  /**
596
601
  * TODO: Probably we should not allow user to override `source` property
597
602
  */
598
- addFileFromUrl: (url: string, { silent, fileName, source, }?: {
599
- silent?: boolean;
600
- fileName?: string;
601
- source?: string;
602
- }) => OutputFileEntry<"idle">;
603
- addFileFromUuid: (uuid: string, { silent, fileName, source, }?: {
604
- silent?: boolean;
605
- fileName?: string;
606
- source?: string;
607
- }) => OutputFileEntry<"idle">;
608
- addFileFromCdnUrl: (cdnUrl: string, { silent, fileName, source, }?: {
609
- silent?: boolean;
610
- fileName?: string;
611
- source?: string;
612
- }) => OutputFileEntry<"idle">;
613
- addFileFromObject: (file: File, { silent, fileName, source, fullPath, }?: {
614
- silent?: boolean;
615
- fileName?: string;
616
- source?: string;
603
+ addFileFromUrl: (url: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
604
+ addFileFromUuid: (uuid: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
605
+ addFileFromCdnUrl: (cdnUrl: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
606
+ addFileFromObject: (file: File, { silent, fileName, source, fullPath, }?: ApiAddFileCommonOptions & {
617
607
  fullPath?: string;
618
608
  }) => OutputFileEntry<"idle">;
619
609
  removeFileByInternalId: (internalId: string) => void;
@@ -2040,4 +2030,4 @@ declare class FileUploaderRegular extends SolutionBlock {
2040
2030
  type KebabCase<T extends string> = T extends `${infer Head} ${infer Tail}` ? `${Lowercase<Head>}-${KebabCase<Tail>}` : Lowercase<T>;
2041
2031
  declare const toKebabCase: <T extends string>(str: T) => KebabCase<T>;
2042
2032
 
2043
- export { ActivityBlock, ActivityHeader, Block, BtnUi, CameraSource, CloudImageEditor, CloudImageEditorActivity, CloudImageEditorBlock, type CollectionValidators, Config, type ConfigAttributesType, type ConfigComplexType, type ConfigPlainType, type ConfigType, Copyright, CropFrame, DropArea, EditorAspectRatioButtonControl, EditorCropButtonControl, EditorFilterControl, EditorFreeformButtonControl, EditorImageCropper, EditorImageFader, EditorOperationControl, EditorScroller, EditorSlider, EditorToolbar, type EventMap, type EventPayload, EventType, ExternalSource, ExternalUploadSource, FileItem, FileUploaderInline, FileUploaderMinimal, FileUploaderRegular, type FileValidator, type FileValidatorDescriptor, type FileValidators, FormInput, type FuncCollectionValidator, type FuncFileValidator, type GroupFlag, Icon, type IconHrefResolver, Img, type KebabCase$1 as KebabCase, type KebabCaseKeys, LineLoaderUi, type LocaleDefinitionOverride, type LowerCase, type LowerCaseKeys, type MetadataCallback, Modal, ModalEvents, type ModalId, type OutputCollectionErrorType, type OutputCollectionState, type OutputCollectionStatus, type OutputCustomErrorType, type OutputError, type OutputErrorCollection, type OutputErrorFile, type OutputErrorTypePayload, type OutputFileEntry, type OutputFileErrorPayload, type OutputFileErrorType, type OutputFileStatus, PresenceToggle, ProgressBar, ProgressBarCommon, type SecureDeliveryProxyUrlResolver, type SecureUploadsSignatureAndExpire, type SecureUploadsSignatureResolver, Select, SimpleBtn, SliderUi, SolutionBlock, SourceBtn, SourceList, type SourceTypes, Spinner, StartFrom, Thumb, UploadCtxProvider, UploadList, UploadSource, UploaderBlock, UploaderPublicApi, UrlSource, defineComponents, defineLocale, toKebabCase };
2033
+ export { ActivityBlock, ActivityHeader, type ApiAddFileCommonOptions, Block, BtnUi, CameraSource, CloudImageEditor, CloudImageEditorActivity, CloudImageEditorBlock, type CollectionValidators, Config, type ConfigAttributesType, type ConfigComplexType, type ConfigPlainType, type ConfigType, Copyright, CropFrame, DropArea, EditorAspectRatioButtonControl, EditorCropButtonControl, EditorFilterControl, EditorFreeformButtonControl, EditorImageCropper, EditorImageFader, EditorOperationControl, EditorScroller, EditorSlider, EditorToolbar, type EventMap, type EventPayload, EventType, ExternalSource, ExternalUploadSource, FileItem, FileUploaderInline, FileUploaderMinimal, FileUploaderRegular, type FileValidator, type FileValidatorDescriptor, type FileValidators, FormInput, type FuncCollectionValidator, type FuncFileValidator, type GroupFlag, Icon, type IconHrefResolver, Img, type KebabCase$1 as KebabCase, type KebabCaseKeys, LineLoaderUi, type LocaleDefinitionOverride, type LowerCase, type LowerCaseKeys, type MetadataCallback, Modal, ModalEvents, type ModalId, type OutputCollectionErrorType, type OutputCollectionState, type OutputCollectionStatus, type OutputCustomErrorType, type OutputError, type OutputErrorCollection, type OutputErrorFile, type OutputErrorTypePayload, type OutputFileEntry, type OutputFileErrorPayload, type OutputFileErrorType, type OutputFileStatus, PresenceToggle, ProgressBar, ProgressBarCommon, type SecureDeliveryProxyUrlResolver, type SecureUploadsSignatureAndExpire, type SecureUploadsSignatureResolver, Select, SimpleBtn, SliderUi, SolutionBlock, SourceBtn, SourceList, type SourceTypes, Spinner, StartFrom, Thumb, UploadCtxProvider, UploadList, UploadSource, UploaderBlock, UploaderPublicApi, UrlSource, defineComponents, defineLocale, toKebabCase };