@gradio/uploadbutton 0.1.0-beta.4 → 0.1.0-beta.5

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,43 +1,68 @@
1
1
  # @gradio/uploadbutton
2
2
 
3
- ## 0.1.0-beta.4
3
+ ## 0.1.0-beta.5
4
4
 
5
5
  ### Features
6
6
 
7
- - [#5648](https://github.com/gradio-app/gradio/pull/5648) [`c573e2339`](https://github.com/gradio-app/gradio/commit/c573e2339b86c85b378dc349de5e9223a3c3b04a) - Publish all components to npm. Thanks [@freddyaboulton](https://github.com/freddyaboulton)!
7
+ - [#5960](https://github.com/gradio-app/gradio/pull/5960) [`319c30f3f`](https://github.com/gradio-app/gradio/commit/319c30f3fccf23bfe1da6c9b132a6a99d59652f7) - rererefactor frontend files. Thanks [@pngwn](https://github.com/pngwn)!
8
+ - [#5938](https://github.com/gradio-app/gradio/pull/5938) [`13ed8a485`](https://github.com/gradio-app/gradio/commit/13ed8a485d5e31d7d75af87fe8654b661edcca93) - V4: Use beta release versions for '@gradio' packages. Thanks [@freddyaboulton](https://github.com/freddyaboulton)!
8
9
 
9
- ## 0.1.0-beta.3
10
+ ## 0.0.12
10
11
 
11
12
  ### Patch Changes
12
13
 
13
- - Updated dependencies [[`0b4fd5b6d`](https://github.com/gradio-app/gradio/commit/0b4fd5b6db96fc95a155e5e935e17e1ab11d1161)]:
14
- - @gradio/utils@0.2.0-beta.3
15
- - @gradio/button@0.2.0-beta.3
16
- - @gradio/upload@0.3.0-beta.3
14
+ - Updated dependencies [[`4e62b8493`](https://github.com/gradio-app/gradio/commit/4e62b8493dfce50bafafe49f1a5deb929d822103)]:
15
+ - @gradio/client@0.5.2
16
+ - @gradio/upload@0.3.3
17
+ - @gradio/button@0.2.3
17
18
 
18
- ## 0.1.0-beta.2
19
+ ## 0.0.11
19
20
 
20
21
  ### Patch Changes
21
22
 
22
- - Updated dependencies [[`14fc612d8`](https://github.com/gradio-app/gradio/commit/14fc612d84bf6b1408eccd3a40fab41f25477571)]:
23
- - @gradio/utils@0.2.0-beta.2
24
- - @gradio/button@0.2.0-beta.2
25
- - @gradio/upload@0.3.0-beta.2
23
+ - Updated dependencies [[`796145e2c`](https://github.com/gradio-app/gradio/commit/796145e2c48c4087bec17f8ec0be4ceee47170cb)]:
24
+ - @gradio/client@0.5.1
26
25
 
27
- ## 0.1.0-beta.1
26
+ ## 0.0.10
27
+
28
+ ### Patch Changes
29
+
30
+ - Updated dependencies [[`e4a307ed6`](https://github.com/gradio-app/gradio/commit/e4a307ed6cde3bbdf4ff2f17655739addeec941e), [`caeee8bf7`](https://github.com/gradio-app/gradio/commit/caeee8bf7821fd5fe2f936ed82483bed00f613ec), [`c0fef4454`](https://github.com/gradio-app/gradio/commit/c0fef44541bfa61568bdcfcdfc7d7d79869ab1df)]:
31
+ - @gradio/client@0.5.0
32
+ - @gradio/utils@0.1.2
33
+ - @gradio/button@0.2.2
34
+ - @gradio/upload@0.3.2
35
+
36
+ ## 0.0.9
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [[`6e56a0d9b`](https://github.com/gradio-app/gradio/commit/6e56a0d9b0c863e76c69e1183d9d40196922b4cd)]:
41
+ - @gradio/client@0.4.2
42
+
43
+ ## 0.0.8
28
44
 
29
45
  ### Patch Changes
30
46
 
31
47
  - Updated dependencies []:
32
- - @gradio/utils@0.2.0-beta.1
33
- - @gradio/button@0.2.0-beta.1
34
- - @gradio/upload@0.3.0-beta.1
48
+ - @gradio/upload@0.3.1
49
+ - @gradio/button@0.2.1
35
50
 
36
- ## 0.1.0-beta.0
51
+ ## 0.0.7
37
52
 
38
- ### Features
53
+ ### Patch Changes
54
+
55
+ - Updated dependencies [[`78e7cf516`](https://github.com/gradio-app/gradio/commit/78e7cf5163e8d205e8999428fce4c02dbdece25f)]:
56
+ - @gradio/client@0.4.1
57
+
58
+ ## 0.0.6
59
+
60
+ ### Patch Changes
39
61
 
40
- - [#5507](https://github.com/gradio-app/gradio/pull/5507) [`1385dc688`](https://github.com/gradio-app/gradio/commit/1385dc6881f2d8ae7a41106ec21d33e2ef04d6a9) - Custom components. Thanks [@pngwn](https://github.com/pngwn)!
62
+ - Updated dependencies [[`c57f1b75e`](https://github.com/gradio-app/gradio/commit/c57f1b75e272c76b0af4d6bd0c7f44743ff34f26), [`40de3d217`](https://github.com/gradio-app/gradio/commit/40de3d2178b61ebe424b6f6228f94c0c6f679bea), [`ea0e00b20`](https://github.com/gradio-app/gradio/commit/ea0e00b207b4b90a10e9d054c4202d4e705a29ba), [`75ddeb390`](https://github.com/gradio-app/gradio/commit/75ddeb390d665d4484667390a97442081b49a423)]:
63
+ - @gradio/client@0.4.0
64
+ - @gradio/button@0.2.0
65
+ - @gradio/upload@0.3.0
41
66
 
42
67
  ## 0.0.5
43
68
 
@@ -2,7 +2,7 @@
2
2
  import type { Gradio } from "@gradio/utils";
3
3
  import { tick, getContext } from "svelte";
4
4
  import type { FileData } from "@gradio/upload";
5
- import UploadButton from "../shared";
5
+ import UploadButton from "./shared/UploadButton.svelte";
6
6
  import { upload_files as default_upload_files } from "@gradio/client";
7
7
  import { blobToBase64 } from "@gradio/upload";
8
8
 
@@ -23,6 +23,7 @@
23
23
  upload: FileData;
24
24
  click: never;
25
25
  }>;
26
+ export let mode: "static" | "interactive";
26
27
 
27
28
  const upload_files =
28
29
  getContext<typeof default_upload_files>("upload_files") ??
@@ -71,7 +72,7 @@
71
72
  {size}
72
73
  {scale}
73
74
  {min_width}
74
- disabled
75
+ disabled={mode === "static"}
75
76
  {variant}
76
77
  {label}
77
78
  on:click={() => gradio.dispatch("click")}
package/package.json CHANGED
@@ -1,23 +1,20 @@
1
1
  {
2
2
  "name": "@gradio/uploadbutton",
3
- "version": "0.1.0-beta.4",
3
+ "version": "0.1.0-beta.5",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
- "main": "index.svelte",
7
6
  "author": "",
8
7
  "license": "ISC",
9
8
  "private": false,
10
9
  "main_changeset": true,
11
10
  "exports": {
12
- "./package.json": "./package.json",
13
- "./interactive": "./interactive/index.ts",
14
- "./static": "./static/index.ts",
15
- "./example": "./example/index.ts"
11
+ ".": "./Index.svelte",
12
+ "./package.json": "./package.json"
16
13
  },
17
14
  "dependencies": {
18
- "@gradio/button": "^0.2.0-beta.4",
19
- "@gradio/client": "^0.3.1",
20
- "@gradio/upload": "^0.3.0-beta.3",
21
- "@gradio/utils": "^0.2.0-beta.3"
15
+ "@gradio/button": "^0.2.0-beta.5",
16
+ "@gradio/client": "^0.5.2",
17
+ "@gradio/upload": "^0.3.0-beta.4",
18
+ "@gradio/utils": "^0.2.0-beta.4"
22
19
  }
23
20
  }
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { BaseButton } from "@gradio/button/static";
2
+ import { BaseButton } from "@gradio/button";
3
3
  import { createEventDispatcher } from "svelte";
4
4
  import type { FileData } from "@gradio/upload";
5
5
 
@@ -1,80 +0,0 @@
1
- <script lang="ts">
2
- import type { Gradio } from "@gradio/utils";
3
- import { getContext, tick } from "svelte";
4
- import type { FileData } from "@gradio/upload";
5
- import UploadButton from "../shared";
6
- import { upload_files as default_upload_files } from "@gradio/client";
7
- import { blobToBase64 } from "@gradio/upload";
8
-
9
- export let elem_id = "";
10
- export let elem_classes: string[] = [];
11
- export let visible = true;
12
- export let label: string;
13
- export let value: null | FileData;
14
- export let file_count: string;
15
- export let file_types: string[] = [];
16
- export let root: string;
17
- export let size: "sm" | "lg" = "lg";
18
- export let scale: number | null = null;
19
- export let min_width: number | undefined = undefined;
20
- export let variant: "primary" | "secondary" | "stop" = "secondary";
21
- export let gradio: Gradio<{
22
- change: FileData | null;
23
- upload: FileData;
24
- click: never;
25
- }>;
26
-
27
- const upload_files =
28
- getContext<typeof default_upload_files>("upload_files") ??
29
- default_upload_files;
30
-
31
- async function handle_upload({
32
- detail
33
- }: CustomEvent<FileData>): Promise<void> {
34
- value = detail;
35
- await tick();
36
- let files = (Array.isArray(detail) ? detail : [detail]).map(
37
- (file_data) => file_data.blob!
38
- );
39
-
40
- upload_files(root, files).then(async (response) => {
41
- if (response.error) {
42
- (Array.isArray(detail) ? detail : [detail]).forEach(
43
- async (file_data, i) => {
44
- file_data.data = await blobToBase64(file_data.blob!);
45
- file_data.blob = undefined;
46
- }
47
- );
48
- } else {
49
- (Array.isArray(detail) ? detail : [detail]).forEach((file_data, i) => {
50
- if (response.files) {
51
- file_data.orig_name = file_data.name;
52
- file_data.name = response.files[i];
53
- file_data.is_file = true;
54
- file_data.blob = undefined;
55
- }
56
- });
57
- }
58
-
59
- gradio.dispatch("change", value);
60
- gradio.dispatch("upload", detail);
61
- });
62
- }
63
- </script>
64
-
65
- <UploadButton
66
- {elem_id}
67
- {elem_classes}
68
- {visible}
69
- {file_count}
70
- {file_types}
71
- {size}
72
- {scale}
73
- {min_width}
74
- {variant}
75
- {label}
76
- on:click={() => gradio.dispatch("click")}
77
- on:load={handle_upload}
78
- >
79
- {gradio.i18n(label)}
80
- </UploadButton>
@@ -1 +0,0 @@
1
- export { default } from "./InteractiveUploadButton.svelte";
package/shared/index.ts DELETED
@@ -1 +0,0 @@
1
- export { default } from "./UploadButton.svelte";
package/static/index.ts DELETED
@@ -1 +0,0 @@
1
- export { default } from "./StaticUploadButton.svelte";