@gradio/uploadbutton 0.3.4 → 0.4.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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @gradio/uploadbutton
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Features
6
+
7
+ - [#6897](https://github.com/gradio-app/gradio/pull/6897) [`fb9c6ca`](https://github.com/gradio-app/gradio/commit/fb9c6cacd7ca4598c000f1f97d7d39a8c4463519) - Lite: Chatbot. Thanks [@whitphx](https://github.com/whitphx)!
8
+
9
+ ## 0.3.5
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [[`d406855`](https://github.com/gradio-app/gradio/commit/d4068557953746662235d595ec435c42ceb24414)]:
14
+ - @gradio/client@0.9.4
15
+ - @gradio/button@0.2.14
16
+ - @gradio/upload@0.5.7
17
+
3
18
  ## 0.3.4
4
19
 
5
20
  ### Patch Changes
@@ -243,4 +258,4 @@ Thanks [@pngwn](https://github.com/pngwn)!
243
258
  - Updated dependencies [[`61129052`](https://github.com/gradio-app/gradio/commit/61129052ed1391a75c825c891d57fa0ad6c09fc8), [`667875b2`](https://github.com/gradio-app/gradio/commit/667875b2441753e74d25bd9d3c8adedd8ede11cd), [`67265a58`](https://github.com/gradio-app/gradio/commit/67265a58027ef1f9e4c0eb849a532f72eaebde48), [`8b4eb8ca`](https://github.com/gradio-app/gradio/commit/8b4eb8cac9ea07bde31b44e2006ca2b7b5f4de36), [`37caa2e0`](https://github.com/gradio-app/gradio/commit/37caa2e0fe95d6cab8beb174580fb557904f137f)]:
244
259
  - @gradio/client@0.2.0
245
260
  - @gradio/upload@0.0.3
246
- - @gradio/button@0.1.0
261
+ - @gradio/button@0.1.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/uploadbutton",
3
- "version": "0.3.4",
3
+ "version": "0.4.0",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -13,9 +13,9 @@
13
13
  },
14
14
  "main": "./Index.svelte",
15
15
  "dependencies": {
16
- "@gradio/button": "^0.2.13",
17
- "@gradio/client": "^0.9.3",
18
- "@gradio/utils": "^0.2.0",
19
- "@gradio/upload": "^0.5.6"
16
+ "@gradio/button": "^0.2.15",
17
+ "@gradio/client": "^0.10.0",
18
+ "@gradio/upload": "^0.5.8",
19
+ "@gradio/utils": "^0.2.0"
20
20
  }
21
21
  }
@@ -1,11 +1,12 @@
1
1
  <script lang="ts">
2
- import { tick, createEventDispatcher } from "svelte";
2
+ import { tick, createEventDispatcher, getContext } from "svelte";
3
3
  import { BaseButton } from "@gradio/button";
4
4
  import {
5
5
  upload,
6
6
  prepare_files,
7
7
  type FileData,
8
- get_fetchable_url_or_file
8
+ get_fetchable_url_or_file,
9
+ type upload_files
9
10
  } from "@gradio/client";
10
11
 
11
12
  export let elem_id = "";
@@ -27,6 +28,9 @@
27
28
 
28
29
  const dispatch = createEventDispatcher();
29
30
 
31
+ // Needed for wasm support
32
+ const upload_fn = getContext<typeof upload_files>("upload_files");
33
+
30
34
  let hidden_upload: HTMLInputElement;
31
35
  let accept_file_types: string | null;
32
36
 
@@ -58,9 +62,9 @@
58
62
  let all_file_data = await prepare_files(_files);
59
63
  await tick();
60
64
 
61
- all_file_data = (await upload(all_file_data, root))?.filter(
62
- (x) => x !== null
63
- ) as FileData[];
65
+ all_file_data = (
66
+ await upload(all_file_data, root, undefined, upload_fn)
67
+ )?.filter((x) => x !== null) as FileData[];
64
68
  value = file_count === "single" ? all_file_data?.[0] : all_file_data;
65
69
  dispatch("change", value);
66
70
  dispatch("upload", value);