@streamscloud/kit 0.37.0 → 0.38.1
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/core/files/upload-media-store.svelte.d.ts +10 -2
- package/dist/core/files/upload-media-store.svelte.js +10 -2
- package/dist/ui/table/_table-styles.scss +2 -0
- package/dist/ui/table/cmp.table-draggable.svelte +3 -0
- package/dist/ui/table/cmp.table-draggable.svelte.d.ts +1 -0
- package/dist/ui/table/cmp.table.svelte +3 -0
- package/dist/ui/table/cmp.table.svelte.d.ts +1 -0
- package/package.json +1 -1
|
@@ -9,6 +9,12 @@ export type AddOptions = {
|
|
|
9
9
|
/** Stage an object URL for local preview. @default 'never' */
|
|
10
10
|
preview?: UploadPreviewMode;
|
|
11
11
|
};
|
|
12
|
+
export type UploadOutcome = {
|
|
13
|
+
/** Files whose upload ended in error, at the moment this call settled. */
|
|
14
|
+
failed: FailedUpload[];
|
|
15
|
+
/** Files that reached `success`. */
|
|
16
|
+
succeeded: SuccessfulUpload[];
|
|
17
|
+
};
|
|
12
18
|
export type UploadMediaStoreOptions = {
|
|
13
19
|
/**
|
|
14
20
|
* Auto-resize images before upload. Pass `false` to disable; pass an object to override the
|
|
@@ -47,7 +53,8 @@ export type UploadMediaStoreOptions = {
|
|
|
47
53
|
* on: { blobId: (f, id) => { avatarBlobId = id; } }
|
|
48
54
|
* });
|
|
49
55
|
* store.add(rawFile);
|
|
50
|
-
* await store.upload();
|
|
56
|
+
* const { failed } = await store.upload();
|
|
57
|
+
* if (failed.length > 0) { ... }
|
|
51
58
|
* ```
|
|
52
59
|
*/
|
|
53
60
|
export declare class UploadMediaStore {
|
|
@@ -94,7 +101,8 @@ export declare class UploadMediaStore {
|
|
|
94
101
|
* itself in `AppUploadActivity` for its duration, so a mounted `UploadProgressToaster` picks it up
|
|
95
102
|
* with no extra wiring.
|
|
96
103
|
*/
|
|
97
|
-
upload(): Promise<
|
|
104
|
+
upload(): Promise<UploadOutcome>;
|
|
105
|
+
private outcome;
|
|
98
106
|
private settled;
|
|
99
107
|
private runQueued;
|
|
100
108
|
private maybeResize;
|
|
@@ -29,7 +29,8 @@ const revokePreviewUrl = (file) => {
|
|
|
29
29
|
* on: { blobId: (f, id) => { avatarBlobId = id; } }
|
|
30
30
|
* });
|
|
31
31
|
* store.add(rawFile);
|
|
32
|
-
* await store.upload();
|
|
32
|
+
* const { failed } = await store.upload();
|
|
33
|
+
* if (failed.length > 0) { ... }
|
|
33
34
|
* ```
|
|
34
35
|
*/
|
|
35
36
|
export class UploadMediaStore {
|
|
@@ -89,7 +90,7 @@ export class UploadMediaStore {
|
|
|
89
90
|
const queued = this._files.filter((f) => f.status === 'queued');
|
|
90
91
|
if (queued.length === 0) {
|
|
91
92
|
await this.settled();
|
|
92
|
-
return;
|
|
93
|
+
return this.outcome();
|
|
93
94
|
}
|
|
94
95
|
// Claim before the first await, or a second upload() during the strategy call re-claims the same files.
|
|
95
96
|
for (const entry of queued) {
|
|
@@ -109,6 +110,13 @@ export class UploadMediaStore {
|
|
|
109
110
|
})();
|
|
110
111
|
this._inFlight.set(runId, run);
|
|
111
112
|
await this.settled();
|
|
113
|
+
return this.outcome();
|
|
114
|
+
}
|
|
115
|
+
outcome() {
|
|
116
|
+
return {
|
|
117
|
+
failed: this._files.filter((f) => f.status === 'error'),
|
|
118
|
+
succeeded: this._files.filter((f) => f.status === 'success')
|
|
119
|
+
};
|
|
112
120
|
}
|
|
113
121
|
async settled() {
|
|
114
122
|
while (this._inFlight.size > 0) {
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
--_table--card--background: var(--sc-kit--table--card--background, var(--sc-kit--color--bg--panel));
|
|
32
32
|
--_table--card--border-color: var(--sc-kit--table--card--border-color, var(--sc-kit--color--border));
|
|
33
33
|
--_table--card--border-radius: var(--sc-kit--table--card--border-radius, var(--sc-kit--radius--lg));
|
|
34
|
+
--_table--card--padding-bottom: var(--sc-kit--table--card--padding-bottom, var(--sc-kit--space--4));
|
|
34
35
|
|
|
35
36
|
display: flex;
|
|
36
37
|
overflow-x: auto;
|
|
@@ -56,6 +57,7 @@
|
|
|
56
57
|
background: var(--_table--card--background);
|
|
57
58
|
border: 1px solid var(--_table--card--border-color);
|
|
58
59
|
border-radius: var(--_table--card--border-radius);
|
|
60
|
+
padding-bottom: var(--_table--card--padding-bottom);
|
|
59
61
|
// No overflow here: the radius already clips via the base overflow-x, and `hidden` would kill both scroll axes.
|
|
60
62
|
}
|
|
61
63
|
}
|
|
@@ -176,6 +176,7 @@ preserve the current selection. For non-reorderable tables use `Table` (it ships
|
|
|
176
176
|
| `--sc-kit--table--card--background` | Card variant background | `--sc-kit--color--bg--panel` |
|
|
177
177
|
| `--sc-kit--table--card--border-color` | Card variant border | `--sc-kit--color--border` |
|
|
178
178
|
| `--sc-kit--table--card--border-radius` | Card variant radius | `--sc-kit--radius--lg` |
|
|
179
|
+
| `--sc-kit--table--card--padding-bottom` | Card variant bottom padding | `--sc-kit--space--4` |
|
|
179
180
|
-->
|
|
180
181
|
|
|
181
182
|
<style>.alternative-view__placeholder {
|
|
@@ -203,6 +204,7 @@ preserve the current selection. For non-reorderable tables use `Table` (it ships
|
|
|
203
204
|
--_table--card--background: var(--sc-kit--table--card--background, var(--sc-kit--color--bg--panel));
|
|
204
205
|
--_table--card--border-color: var(--sc-kit--table--card--border-color, var(--sc-kit--color--border));
|
|
205
206
|
--_table--card--border-radius: var(--sc-kit--table--card--border-radius, var(--sc-kit--radius--lg));
|
|
207
|
+
--_table--card--padding-bottom: var(--sc-kit--table--card--padding-bottom, var(--sc-kit--space--4));
|
|
206
208
|
display: flex;
|
|
207
209
|
overflow-x: auto;
|
|
208
210
|
height: 100%;
|
|
@@ -243,6 +245,7 @@ preserve the current selection. For non-reorderable tables use `Table` (it ships
|
|
|
243
245
|
background: var(--_table--card--background);
|
|
244
246
|
border: 1px solid var(--_table--card--border-color);
|
|
245
247
|
border-radius: var(--_table--card--border-radius);
|
|
248
|
+
padding-bottom: var(--_table--card--padding-bottom);
|
|
246
249
|
}
|
|
247
250
|
|
|
248
251
|
.table {
|
|
@@ -71,6 +71,7 @@ interface $$IsomorphicComponent {
|
|
|
71
71
|
* | `--sc-kit--table--card--background` | Card variant background | `--sc-kit--color--bg--panel` |
|
|
72
72
|
* | `--sc-kit--table--card--border-color` | Card variant border | `--sc-kit--color--border` |
|
|
73
73
|
* | `--sc-kit--table--card--border-radius` | Card variant radius | `--sc-kit--radius--lg` |
|
|
74
|
+
* | `--sc-kit--table--card--padding-bottom` | Card variant bottom padding | `--sc-kit--space--4` |
|
|
74
75
|
*/
|
|
75
76
|
declare const Cmp: $$IsomorphicComponent;
|
|
76
77
|
type Cmp<T extends {
|
|
@@ -157,6 +157,7 @@ variant ships no dnd code).
|
|
|
157
157
|
| `--sc-kit--table--card--background` | Card variant background | `--sc-kit--color--bg--panel` |
|
|
158
158
|
| `--sc-kit--table--card--border-color` | Card variant border | `--sc-kit--color--border` |
|
|
159
159
|
| `--sc-kit--table--card--border-radius` | Card variant radius | `--sc-kit--radius--lg` |
|
|
160
|
+
| `--sc-kit--table--card--padding-bottom` | Card variant bottom padding | `--sc-kit--space--4` |
|
|
160
161
|
-->
|
|
161
162
|
|
|
162
163
|
<style>.alternative-view__placeholder {
|
|
@@ -184,6 +185,7 @@ variant ships no dnd code).
|
|
|
184
185
|
--_table--card--background: var(--sc-kit--table--card--background, var(--sc-kit--color--bg--panel));
|
|
185
186
|
--_table--card--border-color: var(--sc-kit--table--card--border-color, var(--sc-kit--color--border));
|
|
186
187
|
--_table--card--border-radius: var(--sc-kit--table--card--border-radius, var(--sc-kit--radius--lg));
|
|
188
|
+
--_table--card--padding-bottom: var(--sc-kit--table--card--padding-bottom, var(--sc-kit--space--4));
|
|
187
189
|
display: flex;
|
|
188
190
|
overflow-x: auto;
|
|
189
191
|
height: 100%;
|
|
@@ -224,6 +226,7 @@ variant ships no dnd code).
|
|
|
224
226
|
background: var(--_table--card--background);
|
|
225
227
|
border: 1px solid var(--_table--card--border-color);
|
|
226
228
|
border-radius: var(--_table--card--border-radius);
|
|
229
|
+
padding-bottom: var(--_table--card--padding-bottom);
|
|
227
230
|
}
|
|
228
231
|
|
|
229
232
|
.table {
|
|
@@ -83,6 +83,7 @@ interface $$IsomorphicComponent {
|
|
|
83
83
|
* | `--sc-kit--table--card--background` | Card variant background | `--sc-kit--color--bg--panel` |
|
|
84
84
|
* | `--sc-kit--table--card--border-color` | Card variant border | `--sc-kit--color--border` |
|
|
85
85
|
* | `--sc-kit--table--card--border-radius` | Card variant radius | `--sc-kit--radius--lg` |
|
|
86
|
+
* | `--sc-kit--table--card--padding-bottom` | Card variant bottom padding | `--sc-kit--space--4` |
|
|
86
87
|
*/
|
|
87
88
|
declare const Cmp: $$IsomorphicComponent;
|
|
88
89
|
type Cmp<T extends {
|