@uploadcare/file-uploader 1.9.0 → 1.11.0-alpha.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.
Files changed (49) hide show
  1. package/blocks/CameraSource/CameraSource.d.ts.map +1 -1
  2. package/blocks/CameraSource/CameraSource.js +0 -2
  3. package/blocks/CameraSource/camera-source.css +4 -15
  4. package/blocks/CloudImageEditorActivity/index.css +3 -3
  5. package/blocks/Config/initialConfig.d.ts +1 -1
  6. package/blocks/Config/initialConfig.d.ts.map +1 -1
  7. package/blocks/Config/initialConfig.js +1 -1
  8. package/blocks/ExternalSource/ExternalSource.d.ts +20 -50
  9. package/blocks/ExternalSource/ExternalSource.d.ts.map +1 -1
  10. package/blocks/ExternalSource/ExternalSource.js +96 -99
  11. package/blocks/ExternalSource/MessageBridge.d.ts +20 -0
  12. package/blocks/ExternalSource/MessageBridge.d.ts.map +1 -0
  13. package/blocks/ExternalSource/MessageBridge.js +71 -0
  14. package/blocks/ExternalSource/buildThemeDefinition.d.ts +3 -0
  15. package/blocks/ExternalSource/buildThemeDefinition.d.ts.map +1 -0
  16. package/blocks/ExternalSource/buildThemeDefinition.js +47 -0
  17. package/blocks/ExternalSource/external-source.css +37 -22
  18. package/blocks/ExternalSource/types.d.ts +113 -0
  19. package/blocks/ExternalSource/types.d.ts.map +1 -0
  20. package/blocks/ExternalSource/types.js +143 -0
  21. package/blocks/Modal/Modal.d.ts.map +1 -1
  22. package/blocks/Modal/Modal.js +4 -11
  23. package/blocks/Modal/modal.css +3 -54
  24. package/blocks/StartFrom/start-from.css +2 -6
  25. package/blocks/UploadList/upload-list.css +1 -11
  26. package/blocks/UrlSource/url-source.css +0 -8
  27. package/blocks/themes/uc-basic/theme.css +3 -3
  28. package/index.ssr.d.ts.map +1 -1
  29. package/index.ssr.js +6 -10
  30. package/locales/file-uploader/en.d.ts +2 -0
  31. package/locales/file-uploader/en.js +3 -1
  32. package/package.json +4 -2
  33. package/web/file-uploader.iife.min.js +4 -4
  34. package/web/file-uploader.min.js +4 -4
  35. package/web/uc-basic.min.css +1 -1
  36. package/web/uc-cloud-image-editor.min.css +1 -1
  37. package/web/uc-cloud-image-editor.min.js +1 -1
  38. package/web/uc-file-uploader-inline.min.css +1 -1
  39. package/web/uc-file-uploader-inline.min.js +4 -4
  40. package/web/uc-file-uploader-minimal.min.css +1 -1
  41. package/web/uc-file-uploader-minimal.min.js +2 -2
  42. package/web/uc-file-uploader-regular.min.css +1 -1
  43. package/web/uc-file-uploader-regular.min.js +4 -4
  44. package/blocks/ExternalSource/buildStyles.d.ts +0 -27
  45. package/blocks/ExternalSource/buildStyles.d.ts.map +0 -1
  46. package/blocks/ExternalSource/buildStyles.js +0 -133
  47. package/blocks/ExternalSource/messages.d.ts +0 -3
  48. package/blocks/ExternalSource/messages.d.ts.map +0 -1
  49. package/blocks/ExternalSource/messages.js +0 -35
@@ -5,15 +5,12 @@ uc-external-source {
5
5
  height: 100%;
6
6
  background-color: var(--uc-background);
7
7
  overflow: hidden;
8
+ position: relative;
8
9
  }
9
10
 
10
- [uc-modal] uc-external-source {
11
- width: min(
12
- calc(var(--uc-dialog-max-width) - var(--uc-padding) * 2),
13
- calc(var(--uc-dialog-max-width) - var(--uc-padding) * 2)
14
- );
15
- height: var(--modal-content-height-fill, 100%);
16
- max-height: var(--modal-max-content-height);
11
+ [uc-modal] > dialog:has(uc-external-source[active]) {
12
+ width: 100%;
13
+ height: 100%;
17
14
  }
18
15
 
19
16
  uc-external-source > .uc-content {
@@ -23,13 +20,6 @@ uc-external-source > .uc-content {
23
20
  grid-template-rows: 1fr min-content;
24
21
  }
25
22
 
26
- @media only screen and (max-width: 430px) {
27
- uc-external-source {
28
- width: calc(100vw - var(--uc-padding) * 2);
29
- height: var(--modal-content-height-fill, 100%);
30
- }
31
- }
32
-
33
23
  uc-external-source iframe {
34
24
  display: block;
35
25
  width: 100%;
@@ -42,11 +32,11 @@ uc-external-source .uc-iframe-wrapper {
42
32
  }
43
33
 
44
34
  uc-external-source .uc-toolbar {
45
- display: grid;
35
+ display: flex;
36
+ width: 100%;
46
37
  grid-gap: var(--uc-padding);
47
- grid-template-columns: max-content 1fr max-content max-content;
48
38
  align-items: center;
49
- width: 100%;
39
+ justify-content: space-between;
50
40
  padding: var(--uc-padding);
51
41
  border-top: 1px solid var(--uc-border);
52
42
  }
@@ -55,11 +45,36 @@ uc-external-source .uc-back-btn {
55
45
  padding-left: 0;
56
46
  }
57
47
 
58
- uc-external-source .uc-selected-counter {
48
+ uc-external-source .uc-selection-status-box {
49
+ color: var(--uc-foreground);
59
50
  display: flex;
60
- grid-gap: var(--uc-padding);
51
+ flex-direction: column;
61
52
  align-items: center;
62
- justify-content: space-between;
63
- padding: var(--uc-padding);
64
- color: var(--uc-muted-foreground);
53
+ justify-content: center;
54
+ }
55
+
56
+ uc-external-source .uc-selection-status-box button {
57
+ color: var(--uc-primary);
58
+ height: auto;
59
+ padding: 0;
60
+ background: none;
61
+ }
62
+
63
+ uc-external-source .uc-selection-status-box button:hover {
64
+ text-decoration: underline;
65
+ }
66
+
67
+ uc-external-source uc-activity-header {
68
+ position: absolute;
69
+ width: 100%;
70
+ justify-content: flex-end;
71
+ z-index: 1;
72
+ left: 0;
73
+ top: 0;
74
+ right: 0;
75
+ pointer-events: none;
76
+ }
77
+
78
+ uc-external-source uc-activity-header .uc-close-btn {
79
+ pointer-events: auto;
65
80
  }
@@ -0,0 +1,113 @@
1
+ export type InstagramInfo = {
2
+ caption?: string | null;
3
+ created: number;
4
+ id: string;
5
+ public_page?: string;
6
+ username: string;
7
+ size?: number;
8
+ name?: string;
9
+ modified?: number;
10
+ };
11
+ export type DoneSuccessResponse = {
12
+ error?: undefined;
13
+ info?: InstagramInfo;
14
+ alternatives?: Record<string, string>;
15
+ is_image?: boolean | null;
16
+ filename?: string;
17
+ obj_type: 'selected_file';
18
+ url: string;
19
+ };
20
+ export type InputMessageMap = {
21
+ 'selected-files-change': {
22
+ type: 'selected-files-change';
23
+ total: number;
24
+ selectedCount: number;
25
+ } & ({
26
+ isReady: false;
27
+ isMultipleMode: boolean;
28
+ selectedFiles: undefined;
29
+ } | {
30
+ isReady: true;
31
+ isMultipleMode: true;
32
+ selectedFiles: DoneSuccessResponse[];
33
+ } | {
34
+ isReady: true;
35
+ isMultipleMode: false;
36
+ selectedFiles: [DoneSuccessResponse] | [];
37
+ });
38
+ };
39
+ export type InputMessageType = keyof InputMessageMap;
40
+ export type InputMessage = InputMessageMap[InputMessageType];
41
+ export type InputMessageHandler<T extends "selected-files-change"> = (message: import('./types').InputMessageMap[T]) => void;
42
+ export type ThemeDefinition = {
43
+ '--uc-font-family': string;
44
+ '--uc-font-size': string;
45
+ '--uc-line-height': string;
46
+ '--uc-button-size': string;
47
+ '--uc-preview-size': string;
48
+ '--uc-input-size': string;
49
+ '--uc-padding': string;
50
+ '--uc-radius': string;
51
+ '--uc-transition': string;
52
+ '--uc-background': string;
53
+ '--uc-foreground': string;
54
+ '--uc-primary': string;
55
+ '--uc-primary-hover': string;
56
+ '--uc-primary-transparent': string;
57
+ '--uc-primary-foreground': string;
58
+ '--uc-secondary': string;
59
+ '--uc-secondary-hover': string;
60
+ '--uc-secondary-foreground': string;
61
+ '--uc-muted': string;
62
+ '--uc-muted-foreground': string;
63
+ '--uc-destructive': string;
64
+ '--uc-destructive-foreground': string;
65
+ '--uc-border': string;
66
+ '--uc-primary-rgb-light': string;
67
+ '--uc-primary-light': string;
68
+ '--uc-primary-hover-light': string;
69
+ '--uc-primary-transparent-light': string;
70
+ '--uc-background-light': string;
71
+ '--uc-foreground-light': string;
72
+ '--uc-primary-foreground-light': string;
73
+ '--uc-secondary-light': string;
74
+ '--uc-secondary-hover-light': string;
75
+ '--uc-secondary-foreground-light': string;
76
+ '--uc-muted-light': string;
77
+ '--uc-muted-foreground-light': string;
78
+ '--uc-destructive-light': string;
79
+ '--uc-destructive-foreground-light': string;
80
+ '--uc-border-light': string;
81
+ '--uc-primary-rgb-dark': string;
82
+ '--uc-primary-dark': string;
83
+ '--uc-primary-hover-dark': string;
84
+ '--uc-primary-transparent-dark': string;
85
+ '--uc-background-dark': string;
86
+ '--uc-foreground-dark': string;
87
+ '--uc-primary-foreground-dark': string;
88
+ '--uc-secondary-dark': string;
89
+ '--uc-secondary-hover-dark': string;
90
+ '--uc-secondary-foreground-dark': string;
91
+ '--uc-muted-dark': string;
92
+ '--uc-muted-foreground-dark': string;
93
+ '--uc-destructive-dark': string;
94
+ '--uc-destructive-foreground-dark': string;
95
+ '--uc-border-dark': string;
96
+ '--uc-primary-oklch-light': string;
97
+ '--uc-primary-oklch-dark': string;
98
+ };
99
+ export type OutputMessage = {
100
+ type: 'select-all';
101
+ } | {
102
+ type: 'deselect-all';
103
+ } | {
104
+ type: 'set-theme-definition';
105
+ theme: Record<string, string>;
106
+ } | {
107
+ type: 'set-locale-definition';
108
+ localeDefinition: string;
109
+ } | {
110
+ type: 'set-embed-css';
111
+ css: Partial<ThemeDefinition>;
112
+ };
113
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":"4BAGa;IACZ,OAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAW,EAAE,MAAM,CAAC;IACpB,EAAM,EAAE,MAAM,CAAC;IACf,WAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAY,EAAE,MAAM,CAAC;IACrB,IAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAY,CAAC,EAAE,MAAM,CAAC;CACnB;kCAIS;IACZ,KAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,YAAgB,CAAC,EAAE,OAAO,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,QAAY,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,QAAY,CAAC,EAAE,M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AAE,MAAM,CAAC;IACvC,yBAA6B,EAAE,MAAM,CAAC;CACnC;4BAIS;IACZ,IAAY,EAAE,YAAY,CAAC;CACpB,GACD;IACN,IAAY,EAAE,cAAc,CAAC;CACtB,GACD;IACN,IAAY,EAAE,sBAAsB,CAAC;IACrC,KAAa,EAAE,OAAO,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,GACD;IACN,IAAY,EAAE,uBAAuB,CAAC;IACtC,gBAAwB,EAAE,MAAM,CAAC;CAC1B,GACD;IACN,IAAY,EAAE,eAAe,CAAC;IAC9B,GAAW,EAAE,QAAQ,eAAe,CAAC,CAAC;CAC/B"}
@@ -0,0 +1,143 @@
1
+ // @ts-check
2
+
3
+ /**
4
+ * @typedef {{
5
+ * caption?: string | null;
6
+ * created: number;
7
+ * id: string;
8
+ * public_page?: string;
9
+ * username: string;
10
+ * size?: number;
11
+ * name?: string;
12
+ * modified?: number;
13
+ * }} InstagramInfo
14
+ */
15
+
16
+ /**
17
+ * @typedef {{
18
+ * error?: undefined;
19
+ * info?: InstagramInfo;
20
+ * alternatives?: Record<string, string>;
21
+ * is_image?: boolean | null;
22
+ * filename?: string;
23
+ * obj_type: 'selected_file';
24
+ * url: string;
25
+ * }} DoneSuccessResponse
26
+ */
27
+
28
+ /**
29
+ * @typedef {{
30
+ * 'selected-files-change': {
31
+ * type: 'selected-files-change';
32
+ * total: number;
33
+ * selectedCount: number;
34
+ * } & (
35
+ * | {
36
+ * isReady: false;
37
+ * isMultipleMode: boolean;
38
+ * selectedFiles: undefined;
39
+ * }
40
+ * | {
41
+ * isReady: true;
42
+ * isMultipleMode: true;
43
+ * selectedFiles: DoneSuccessResponse[];
44
+ * }
45
+ * | {
46
+ * isReady: true;
47
+ * isMultipleMode: false;
48
+ * selectedFiles: [DoneSuccessResponse] | [];
49
+ * }
50
+ * );
51
+ * }} InputMessageMap
52
+ */
53
+
54
+ /** @typedef {keyof InputMessageMap} InputMessageType */
55
+ /** @typedef {InputMessageMap[InputMessageType]} InputMessage */
56
+
57
+ /**
58
+ * @template {import('./types').InputMessageType} T
59
+ * @typedef {(message: import('./types').InputMessageMap[T]) => void} InputMessageHandler
60
+ */
61
+
62
+ /**
63
+ * @typedef {{
64
+ * '--uc-font-family': string;
65
+ * '--uc-font-size': string;
66
+ * '--uc-line-height': string;
67
+ * '--uc-button-size': string;
68
+ * '--uc-preview-size': string;
69
+ * '--uc-input-size': string;
70
+ * '--uc-padding': string;
71
+ * '--uc-radius': string;
72
+ * '--uc-transition': string;
73
+ * '--uc-background': string;
74
+ * '--uc-foreground': string;
75
+ * '--uc-primary': string;
76
+ * '--uc-primary-hover': string;
77
+ * '--uc-primary-transparent': string;
78
+ * '--uc-primary-foreground': string;
79
+ * '--uc-secondary': string;
80
+ * '--uc-secondary-hover': string;
81
+ * '--uc-secondary-foreground': string;
82
+ * '--uc-muted': string;
83
+ * '--uc-muted-foreground': string;
84
+ * '--uc-destructive': string;
85
+ * '--uc-destructive-foreground': string;
86
+ * '--uc-border': string;
87
+ * '--uc-primary-rgb-light': string;
88
+ * '--uc-primary-light': string;
89
+ * '--uc-primary-hover-light': string;
90
+ * '--uc-primary-transparent-light': string;
91
+ * '--uc-background-light': string;
92
+ * '--uc-foreground-light': string;
93
+ * '--uc-primary-foreground-light': string;
94
+ * '--uc-secondary-light': string;
95
+ * '--uc-secondary-hover-light': string;
96
+ * '--uc-secondary-foreground-light': string;
97
+ * '--uc-muted-light': string;
98
+ * '--uc-muted-foreground-light': string;
99
+ * '--uc-destructive-light': string;
100
+ * '--uc-destructive-foreground-light': string;
101
+ * '--uc-border-light': string;
102
+ * '--uc-primary-rgb-dark': string;
103
+ * '--uc-primary-dark': string;
104
+ * '--uc-primary-hover-dark': string;
105
+ * '--uc-primary-transparent-dark': string;
106
+ * '--uc-background-dark': string;
107
+ * '--uc-foreground-dark': string;
108
+ * '--uc-primary-foreground-dark': string;
109
+ * '--uc-secondary-dark': string;
110
+ * '--uc-secondary-hover-dark': string;
111
+ * '--uc-secondary-foreground-dark': string;
112
+ * '--uc-muted-dark': string;
113
+ * '--uc-muted-foreground-dark': string;
114
+ * '--uc-destructive-dark': string;
115
+ * '--uc-destructive-foreground-dark': string;
116
+ * '--uc-border-dark': string;
117
+ * '--uc-primary-oklch-light': string;
118
+ * '--uc-primary-oklch-dark': string;
119
+ * }} ThemeDefinition
120
+ */
121
+
122
+ /**
123
+ * @typedef {{
124
+ * type: 'select-all';
125
+ * }
126
+ * | {
127
+ * type: 'deselect-all';
128
+ * }
129
+ * | {
130
+ * type: 'set-theme-definition';
131
+ * theme: Record<string, string>;
132
+ * }
133
+ * | {
134
+ * type: 'set-locale-definition';
135
+ * localeDefinition: string;
136
+ * }
137
+ * | {
138
+ * type: 'set-embed-css';
139
+ * css: Partial<ThemeDefinition>;
140
+ * }} OutputMessage
141
+ */
142
+
143
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["Modal.js"],"names":[],"mappings":"AAGA;IAEE,kCAAoC;IAIlC;;;;MAKC;IAGH,iCAEE;IAEF,yBAEE;IAEF,+BAEE;IAEF,uBAAuB;IACvB,4BADY,KAAK,UAIf;IAFA,eAAe;IACf,yBAAgC;IAGlC,uBAAuB;IACvB,0BADY,KAAK,UAKf;IAEF,aAMC;IAED,aAMC;CAuDF;;;;sBA9GqB,yBAAyB"}
1
+ {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["Modal.js"],"names":[],"mappings":"AAGA;IAEE,kCAAoC;IAIlC;;;;MAKC;IAGH,iCAEE;IAEF,yBAEE;IAEF,+BAEE;IAEF,uBAAuB;IACvB,4BADY,KAAK,UAIf;IAFA,eAAe;IACf,yBAAgC;IAGlC,uBAAuB;IACvB,0BADY,KAAK,UAKf;IAEF,aAMC;IAED,aAMC;CAgDF;;;;sBAvGqB,yBAAyB"}
@@ -58,17 +58,10 @@ export class Modal extends Block {
58
58
 
59
59
  initCallback() {
60
60
  super.initCallback();
61
- if (typeof HTMLDialogElement === 'function') {
62
- this.ref.dialog.addEventListener('close', this._handleDialogClose);
63
- this.ref.dialog.addEventListener('mousedown', this._handleDialogMouseDown);
64
- this.ref.dialog.addEventListener('mouseup', this._handleDialogMouseUp);
65
- } else {
66
- this.setAttribute('dialog-fallback', '');
67
- let backdrop = document.createElement('div');
68
- backdrop.className = 'uc-backdrop';
69
- this.appendChild(backdrop);
70
- backdrop.addEventListener('click', this._handleBackdropClick);
71
- }
61
+
62
+ this.ref.dialog.addEventListener('close', this._handleDialogClose);
63
+ this.ref.dialog.addEventListener('mousedown', this._handleDialogMouseDown);
64
+ this.ref.dialog.addEventListener('mouseup', this._handleDialogMouseUp);
72
65
 
73
66
  this.sub('*modalActive', (modalActive) => {
74
67
  if (this.$.isOpen !== modalActive) {
@@ -1,46 +1,3 @@
1
- :where([uc-modal]) {
2
- --modal-max-content-height: calc(
3
- var(--uploadcare-blocks-window-height, 100vh) - 4 * var(--uc-padding) - var(--uc-button-size)
4
- );
5
- --modal-content-height-fill: var(--uploadcare-blocks-window-height, 100vh);
6
- }
7
-
8
- :where([uc-modal])[dialog-fallback] {
9
- --uc-z-max: 2147483647;
10
-
11
- position: fixed;
12
- z-index: var(--uc-z-max);
13
- display: flex;
14
- align-items: center;
15
- justify-content: center;
16
- width: 100vw;
17
- height: 100vh;
18
- pointer-events: none;
19
- inset: 0;
20
- }
21
-
22
- :where([uc-modal])[dialog-fallback] dialog[open] {
23
- z-index: var(--uc-z-max);
24
- pointer-events: auto;
25
- }
26
-
27
- :where([uc-modal])[dialog-fallback] dialog[open] + .uc-backdrop {
28
- position: fixed;
29
- top: 0px;
30
- left: 0px;
31
- z-index: calc(var(--uc-z-max) - 1);
32
- align-items: center;
33
- justify-content: center;
34
- width: 100vw;
35
- height: 100vh;
36
- background-color: oklch(0 0 0 / 0.1);
37
- pointer-events: auto;
38
- }
39
-
40
- :where([uc-modal])[strokes][dialog-fallback] dialog[open] + .uc-backdrop {
41
- background-image: var(--modal-backdrop-background-image);
42
- }
43
-
44
1
  @supports selector(dialog::backdrop) {
45
2
  :where([uc-modal]) > dialog::backdrop {
46
3
  /* backdrop don't inherit theme properties */
@@ -67,12 +24,10 @@
67
24
  :where([uc-modal]) > dialog {
68
25
  display: flex;
69
26
  flex-direction: column;
70
-
71
- /* there was `fit-content` but it doesn't reduce width after activity change */
72
- width: max-content;
73
- max-width: min(calc(100% - var(--uc-padding) * 2), calc(var(--uc-dialog-max-width) - var(--uc-padding) * 2));
27
+ width: min(var(--uc-dialog-width), 100%);
28
+ max-width: min(calc(100% - var(--uc-padding) * 2), var(--uc-dialog-max-width));
74
29
  min-height: var(--uc-button-size);
75
- max-height: calc(var(--uc-dialog-max-height) - var(--uc-padding) * 2);
30
+ max-height: min(calc(100% - var(--uc-padding) * 2), var(--uc-dialog-max-height));
76
31
  margin: auto;
77
32
  padding: 0;
78
33
  overflow: hidden;
@@ -88,9 +43,3 @@
88
43
  :where(.uc-contrast) :where([uc-modal]) > dialog {
89
44
  outline: 1px solid var(--uc-border);
90
45
  }
91
-
92
- @media only screen and (max-width: 430px), only screen and (max-height: 600px) {
93
- :where([uc-modal]) > dialog > .uc-content {
94
- height: var(--modal-max-content-height);
95
- }
96
- }
@@ -13,12 +13,8 @@ uc-start-from .uc-content {
13
13
  background-color: var(--uc-background);
14
14
  }
15
15
 
16
- [uc-modal] uc-start-from {
17
- width: min(
18
- calc(var(--uc-dialog-width) - var(--uc-padding) * 2),
19
- calc(var(--uc-dialog-max-width) - var(--uc-padding) * 2),
20
- calc(100vw - var(--uc-padding) * 2)
21
- );
16
+ [uc-modal] > dialog:has(uc-start-from[active]) {
17
+ width: var(--uc-dialog-width);
22
18
  }
23
19
 
24
20
  [uc-modal] uc-start-from uc-drop-area {
@@ -2,22 +2,12 @@ uc-upload-list {
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: 100%;
5
- height: 100%;
5
+ height: max-content;
6
6
  overflow: hidden;
7
7
  background-color: var(--uc-background);
8
8
  transition: opacity var(--uc-transition);
9
9
  }
10
10
 
11
- [uc-modal] uc-upload-list {
12
- width: min(
13
- calc(var(--uc-dialog-width) - var(--uc-padding) * 2),
14
- calc(var(--uc-dialog-max-width) - var(--uc-padding) * 2),
15
- calc(100vw - var(--uc-padding) * 2)
16
- );
17
- height: max-content;
18
- max-height: var(--modal-max-content-height);
19
- }
20
-
21
11
  uc-upload-list .uc-no-files {
22
12
  height: 32px;
23
13
  padding: 20px;
@@ -3,14 +3,6 @@ uc-url-source {
3
3
  background-color: var(--uc-background);
4
4
  }
5
5
 
6
- [uc-modal] uc-url-source {
7
- width: min(
8
- calc(var(--uc-dialog-width) - var(--uc-padding) * 2),
9
- calc(var(--uc-dialog-max-width) - var(--uc-padding) * 2),
10
- calc(100vw - var(--uc-padding) * 2)
11
- );
12
- }
13
-
14
6
  uc-url-source > .uc-content {
15
7
  display: grid;
16
8
  grid-gap: 4px;
@@ -13,8 +13,8 @@
13
13
  --uc-radius: 8px;
14
14
  --uc-transition: 0.2s ease;
15
15
  --uc-dialog-width: 430px;
16
- --uc-dialog-max-width: 800px;
17
- --uc-dialog-max-height: 600px;
16
+ --uc-dialog-max-width: 920px;
17
+ --uc-dialog-max-height: 675px;
18
18
  --uc-simple-btn-padding: 7px 14px;
19
19
 
20
20
  /* Default colors, in case of media query failure */
@@ -276,4 +276,4 @@
276
276
 
277
277
  --uc-background-dark: oklch(10% 0 0);
278
278
  --uc-foreground-dark: oklch(100% 0 0);
279
- }
279
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"index.ssr.d.ts","sourceRoot":"","sources":["index.ssr.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;EAcE;AACF;;;;;;;;;;;;;;;EAcE;AACF;;;;;EAIE;AACF;;;;;;EAKE;AACF;;;;;;;;EAYE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0FE;AACF;;;;;;;;EAuCE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;AACF;;;;;;;;EAWE;AACF,oCAAqC;AACrC,sCAAuC;AACvC;;;;;;;EAME;AACF;;;;;;;EAME;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgDE;AACF;;;;;;;EAME;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0DE;AACF;;;;;;;EAeE;AACF;;;;;;EAKE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsDE;AACF;;;;;;EAKE;AACF;;;;;;;;;;;;;;;;EAeE;AACF;;;;;;;;;;;;EAWE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmEE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8FE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EE;AACK,yCAAiC;AACjC,qCAA6B;AAC7B,6CAAqC;AACrC,oCAA4B"}
package/index.ssr.js CHANGED
@@ -680,13 +680,6 @@ export const EditorToolbar = class {
680
680
  export const ExternalSource = class {
681
681
  static template = `
682
682
  <uc-activity-header>
683
- <button type="button" class="uc-mini-btn" set="onclick: *historyBack" l10n="@title:back">
684
- <uc-icon name="back"></uc-icon>
685
- </button>
686
- <div>
687
- <uc-icon set="@name: activityIcon"></uc-icon>
688
- <span>{{activityCaption}}</span>
689
- </div>
690
683
  <button
691
684
  type="button"
692
685
  class="uc-mini-btn uc-close-btn"
@@ -700,12 +693,15 @@ export const ExternalSource = class {
700
693
  <div ref="iframeWrapper" class="uc-iframe-wrapper"></div>
701
694
  <div class="uc-toolbar">
702
695
  <button type="button" class="uc-cancel-btn uc-secondary-btn" set="onclick: onCancel" l10n="cancel"></button>
703
- <div></div>
704
- <div set="@hidden: !multiple" class="uc-selected-counter"><span l10n="selected-count"></span>{{counter}}</div>
696
+ <div set="@hidden: !showSelectionStatus" class="uc-selection-status-box">
697
+ <span>{{counterText}}</span>
698
+ <button type="button" set="onclick: onSelectAll; @hidden: !couldSelectAll" l10n="select-all"></button>
699
+ <button type="button" set="onclick: onDeselectAll; @hidden: !couldDeselectAll" l10n="deselect-all"></button>
700
+ </div>
705
701
  <button
706
702
  type="button"
707
703
  class="uc-done-btn uc-primary-btn"
708
- set="onclick: onDone; @disabled: !counter"
704
+ set="onclick: onDone; @disabled: !isSelectionReady"
709
705
  l10n="done"
710
706
  ></button>
711
707
  </div>
@@ -27,6 +27,8 @@ declare const _default: {
27
27
  'confirm-your-action': string;
28
28
  'are-you-sure': string;
29
29
  'selected-count': string;
30
+ 'select-all': string;
31
+ 'deselect-all': string;
30
32
  'upload-error': string;
31
33
  'validation-error': string;
32
34
  'no-files': string;
@@ -26,7 +26,9 @@ export default {
26
26
  yes: 'Yes',
27
27
  'confirm-your-action': 'Confirm your action',
28
28
  'are-you-sure': 'Are you sure?',
29
- 'selected-count': 'Selected:',
29
+ 'selected-count': '{{count}} of {{total}} selected',
30
+ 'select-all': 'Select all',
31
+ 'deselect-all': 'Deselect all',
30
32
  'upload-error': 'Upload error',
31
33
  'validation-error': 'Validation error',
32
34
  'no-files': 'No files selected',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uploadcare/file-uploader",
3
- "version": "1.9.0",
3
+ "version": "1.11.0-alpha.0",
4
4
  "description": "Building blocks for Uploadcare products integration",
5
5
  "keywords": [
6
6
  "web components",
@@ -35,7 +35,9 @@
35
35
  "MIT"
36
36
  ],
37
37
  "type": "module",
38
- "sideEffects": ["*.css"],
38
+ "sideEffects": [
39
+ "*.css"
40
+ ],
39
41
  "module": "./index.js",
40
42
  "exports": {
41
43
  ".": {