@gradio/upload 0.3.1 → 0.3.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/CHANGELOG.md +13 -1
- package/package.json +4 -4
- package/src/Upload.svelte +3 -4
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @gradio/upload
|
2
2
|
|
3
|
+
## 0.3.3
|
4
|
+
|
5
|
+
### Fixes
|
6
|
+
|
7
|
+
- [#6279](https://github.com/gradio-app/gradio/pull/6279) [`3cdeabc68`](https://github.com/gradio-app/gradio/commit/3cdeabc6843000310e1a9e1d17190ecbf3bbc780) - Ensure source selection does not get hidden in overflow. Thanks [@hannahblair](https://github.com/hannahblair)!
|
8
|
+
|
9
|
+
## 0.3.2
|
10
|
+
|
11
|
+
### Fixes
|
12
|
+
|
13
|
+
- [#6234](https://github.com/gradio-app/gradio/pull/6234) [`aaa55ce85`](https://github.com/gradio-app/gradio/commit/aaa55ce85e12f95aba9299445e9c5e59824da18e) - Video/Audio fixes. Thanks [@freddyaboulton](https://github.com/freddyaboulton)!
|
14
|
+
|
3
15
|
## 0.3.1
|
4
16
|
|
5
17
|
### Patch Changes
|
@@ -155,4 +167,4 @@ From the backend, streamed outputs are served from the `/stream/` endpoint inste
|
|
155
167
|
### Patch Changes
|
156
168
|
|
157
169
|
- Updated dependencies []:
|
158
|
-
- @gradio/atoms@0.0.2
|
170
|
+
- @gradio/atoms@0.0.2
|
package/package.json
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
{
|
2
2
|
"name": "@gradio/upload",
|
3
|
-
"version": "0.3.
|
3
|
+
"version": "0.3.3",
|
4
4
|
"description": "Gradio UI packages",
|
5
5
|
"type": "module",
|
6
6
|
"main": "src/index.ts",
|
7
7
|
"author": "",
|
8
8
|
"license": "ISC",
|
9
9
|
"dependencies": {
|
10
|
-
"@gradio/atoms": "^0.2.
|
10
|
+
"@gradio/atoms": "^0.2.1",
|
11
11
|
"@gradio/icons": "^0.2.0",
|
12
|
-
"@gradio/client": "^0.7.
|
13
|
-
"@gradio/upload": "^0.3.
|
12
|
+
"@gradio/client": "^0.7.2",
|
13
|
+
"@gradio/upload": "^0.3.3",
|
14
14
|
"@gradio/utils": "^0.2.0"
|
15
15
|
},
|
16
16
|
"main_changeset": true,
|
package/src/Upload.svelte
CHANGED
@@ -13,6 +13,7 @@
|
|
13
13
|
export let disable_click = false;
|
14
14
|
export let root: string;
|
15
15
|
export let hidden = false;
|
16
|
+
export let include_sources = false;
|
16
17
|
|
17
18
|
// Needed for wasm support
|
18
19
|
const upload_fn = getContext<typeof upload_files>("upload_files");
|
@@ -46,9 +47,7 @@
|
|
46
47
|
if (!files.length) {
|
47
48
|
return;
|
48
49
|
}
|
49
|
-
|
50
50
|
let _files: File[] = files.map((f) => new File([f], f.name));
|
51
|
-
|
52
51
|
let file_data = await prepare_files(_files);
|
53
52
|
return await handle_upload(file_data);
|
54
53
|
}
|
@@ -80,7 +79,7 @@
|
|
80
79
|
if (!e.dataTransfer?.files) return;
|
81
80
|
|
82
81
|
const files_to_load = Array.from(e.dataTransfer.files).filter((f) => {
|
83
|
-
if (is_valid_mimetype(
|
82
|
+
if (filetype?.split(",").some((m) => is_valid_mimetype(m, f.type))) {
|
84
83
|
return true;
|
85
84
|
}
|
86
85
|
dispatch("error", `Invalid file type only ${filetype} allowed.`);
|
@@ -96,6 +95,7 @@
|
|
96
95
|
class:center
|
97
96
|
class:boundedheight
|
98
97
|
class:flex
|
98
|
+
style:height={include_sources ? "calc(100% - 40px" : "100%"}
|
99
99
|
on:drag|preventDefault|stopPropagation
|
100
100
|
on:dragstart|preventDefault|stopPropagation
|
101
101
|
on:dragend|preventDefault|stopPropagation
|
@@ -124,7 +124,6 @@
|
|
124
124
|
button {
|
125
125
|
cursor: pointer;
|
126
126
|
width: var(--size-full);
|
127
|
-
height: var(--size-full);
|
128
127
|
}
|
129
128
|
|
130
129
|
.hidden {
|