@gradio/file 0.14.8 → 0.15.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 +27 -0
- package/File.stories.svelte +0 -5
- package/FileUpload.stories.svelte +0 -5
- package/Index.svelte +3 -3
- package/dist/Index.svelte +3 -3
- package/dist/shared/File.svelte +16 -3
- package/dist/shared/File.svelte.d.ts +16 -12
- package/dist/types.d.ts +2 -2
- package/package.json +6 -6
- package/shared/File.svelte +16 -3
- package/types.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @gradio/file
|
|
2
2
|
|
|
3
|
+
## 0.15.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- [#13526](https://github.com/gradio-app/gradio/pull/13526) [`53cb4ca`](https://github.com/gradio-app/gradio/commit/53cb4cae1ec3521e9170d12867253516413ba37a) - Run `pnpm lint` and `pnpm ts:check` on CI. Thanks @abidlabs!
|
|
8
|
+
|
|
9
|
+
### Dependency updates
|
|
10
|
+
|
|
11
|
+
- @gradio/atoms@0.25.0
|
|
12
|
+
- @gradio/statustracker@0.15.0
|
|
13
|
+
- @gradio/utils@0.13.0
|
|
14
|
+
- @gradio/client@2.3.0
|
|
15
|
+
- @gradio/upload@0.18.0
|
|
16
|
+
|
|
17
|
+
## 0.14.8
|
|
18
|
+
|
|
19
|
+
### Dependency updates
|
|
20
|
+
|
|
21
|
+
- @gradio/client@2.2.2
|
|
22
|
+
|
|
23
|
+
## 0.14.8
|
|
24
|
+
|
|
25
|
+
### Dependency updates
|
|
26
|
+
|
|
27
|
+
- @gradio/client@2.2.1
|
|
28
|
+
- @gradio/upload@0.17.10
|
|
29
|
+
|
|
3
30
|
## 0.14.8
|
|
4
31
|
|
|
5
32
|
### Dependency updates
|
package/File.stories.svelte
CHANGED
package/Index.svelte
CHANGED
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
/>
|
|
72
72
|
{#if !gradio.shared.interactive}
|
|
73
73
|
<File
|
|
74
|
-
on_select={(
|
|
75
|
-
on_download={(
|
|
74
|
+
on_select={(detail) => gradio.dispatch("select", detail)}
|
|
75
|
+
on_download={(file) => gradio.dispatch("download", file)}
|
|
76
76
|
selectable={gradio.props._selectable}
|
|
77
77
|
value={gradio.props.value}
|
|
78
78
|
label={gradio.shared.label}
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
height={gradio.props.height}
|
|
81
81
|
i18n={gradio.i18n}
|
|
82
82
|
buttons={gradio.props.buttons}
|
|
83
|
-
on_custom_button_click={(id) => {
|
|
83
|
+
on_custom_button_click={(id: number) => {
|
|
84
84
|
gradio.dispatch("custom_button_click", { id });
|
|
85
85
|
}}
|
|
86
86
|
/>
|
package/dist/Index.svelte
CHANGED
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
/>
|
|
72
72
|
{#if !gradio.shared.interactive}
|
|
73
73
|
<File
|
|
74
|
-
on_select={(
|
|
75
|
-
on_download={(
|
|
74
|
+
on_select={(detail) => gradio.dispatch("select", detail)}
|
|
75
|
+
on_download={(file) => gradio.dispatch("download", file)}
|
|
76
76
|
selectable={gradio.props._selectable}
|
|
77
77
|
value={gradio.props.value}
|
|
78
78
|
label={gradio.shared.label}
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
height={gradio.props.height}
|
|
81
81
|
i18n={gradio.i18n}
|
|
82
82
|
buttons={gradio.props.buttons}
|
|
83
|
-
on_custom_button_click={(id) => {
|
|
83
|
+
on_custom_button_click={(id: number) => {
|
|
84
84
|
gradio.dispatch("custom_button_click", { id });
|
|
85
85
|
}}
|
|
86
86
|
/>
|
package/dist/shared/File.svelte
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
import { File } from "@gradio/icons";
|
|
4
4
|
import FilePreview from "./FilePreview.svelte";
|
|
5
5
|
import type { CustomButton as CustomButtonType } from "@gradio/utils";
|
|
6
|
+
import type { FileData } from "@gradio/client";
|
|
7
|
+
import type { I18nFormatter, SelectData } from "@gradio/utils";
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
value,
|
|
@@ -15,6 +17,17 @@
|
|
|
15
17
|
on_custom_button_click = null,
|
|
16
18
|
on_select,
|
|
17
19
|
on_download
|
|
20
|
+
}: {
|
|
21
|
+
value: FileData | FileData[] | null;
|
|
22
|
+
label?: string | null;
|
|
23
|
+
show_label?: boolean;
|
|
24
|
+
selectable?: boolean;
|
|
25
|
+
i18n: I18nFormatter;
|
|
26
|
+
height?: number | string | null;
|
|
27
|
+
buttons?: (string | CustomButtonType)[] | null;
|
|
28
|
+
on_custom_button_click?: ((id: number) => void) | null;
|
|
29
|
+
on_select?: (event_data: SelectData) => void;
|
|
30
|
+
on_download?: (event_data: FileData) => void;
|
|
18
31
|
} = $props();
|
|
19
32
|
</script>
|
|
20
33
|
|
|
@@ -32,10 +45,10 @@
|
|
|
32
45
|
<FilePreview
|
|
33
46
|
{i18n}
|
|
34
47
|
{selectable}
|
|
35
|
-
|
|
36
|
-
|
|
48
|
+
onselect={on_select}
|
|
49
|
+
ondownload={on_download}
|
|
37
50
|
{value}
|
|
38
|
-
{height}
|
|
51
|
+
height={height ?? undefined}
|
|
39
52
|
/>
|
|
40
53
|
{:else}
|
|
41
54
|
<Empty unpadded_box={true} size="large"><File /></Empty>
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { File } from "@gradio/icons";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
import type { CustomButton as CustomButtonType } from "@gradio/utils";
|
|
3
|
+
import type { FileData } from "@gradio/client";
|
|
4
|
+
import type { I18nFormatter, SelectData } from "@gradio/utils";
|
|
5
|
+
type $$ComponentProps = {
|
|
6
|
+
value: FileData | FileData[] | null;
|
|
7
|
+
label?: string | null;
|
|
8
|
+
show_label?: boolean;
|
|
9
|
+
selectable?: boolean;
|
|
10
|
+
i18n: I18nFormatter;
|
|
11
|
+
height?: number | string | null;
|
|
12
|
+
buttons?: (string | CustomButtonType)[] | null;
|
|
13
|
+
on_custom_button_click?: ((id: number) => void) | null;
|
|
14
|
+
on_select?: (event_data: SelectData) => void;
|
|
15
|
+
on_download?: (event_data: FileData) => void;
|
|
16
|
+
};
|
|
17
|
+
declare const File: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
14
18
|
type File = ReturnType<typeof File>;
|
|
15
19
|
export default File;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FileData } from "@gradio/client";
|
|
2
|
-
import type { LoadingStatus } from "js/statustracker";
|
|
2
|
+
import type { ILoadingStatus as LoadingStatus } from "js/statustracker";
|
|
3
3
|
import type { SelectData, CustomButton } from "@gradio/utils";
|
|
4
4
|
export interface FileProps {
|
|
5
5
|
value: FileData | FileData[] | null;
|
|
@@ -13,7 +13,7 @@ export interface FileProps {
|
|
|
13
13
|
}
|
|
14
14
|
export interface FileEvents {
|
|
15
15
|
upload: FileData | FileData[];
|
|
16
|
-
download:
|
|
16
|
+
download: FileData;
|
|
17
17
|
error: string;
|
|
18
18
|
clear_status: LoadingStatus;
|
|
19
19
|
clear: void;
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/file",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Gradio UI packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "ISC",
|
|
8
8
|
"private": false,
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@gradio/atoms": "^0.
|
|
11
|
-
"@gradio/client": "^2.
|
|
10
|
+
"@gradio/atoms": "^0.25.0",
|
|
11
|
+
"@gradio/client": "^2.3.0",
|
|
12
|
+
"@gradio/upload": "^0.18.0",
|
|
13
|
+
"@gradio/statustracker": "^0.15.0",
|
|
12
14
|
"@gradio/icons": "^0.15.1",
|
|
13
|
-
"@gradio/
|
|
14
|
-
"@gradio/statustracker": "^0.14.1",
|
|
15
|
-
"@gradio/utils": "^0.12.2"
|
|
15
|
+
"@gradio/utils": "^0.13.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@gradio/preview": "^0.16.2"
|
package/shared/File.svelte
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
import { File } from "@gradio/icons";
|
|
4
4
|
import FilePreview from "./FilePreview.svelte";
|
|
5
5
|
import type { CustomButton as CustomButtonType } from "@gradio/utils";
|
|
6
|
+
import type { FileData } from "@gradio/client";
|
|
7
|
+
import type { I18nFormatter, SelectData } from "@gradio/utils";
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
value,
|
|
@@ -15,6 +17,17 @@
|
|
|
15
17
|
on_custom_button_click = null,
|
|
16
18
|
on_select,
|
|
17
19
|
on_download
|
|
20
|
+
}: {
|
|
21
|
+
value: FileData | FileData[] | null;
|
|
22
|
+
label?: string | null;
|
|
23
|
+
show_label?: boolean;
|
|
24
|
+
selectable?: boolean;
|
|
25
|
+
i18n: I18nFormatter;
|
|
26
|
+
height?: number | string | null;
|
|
27
|
+
buttons?: (string | CustomButtonType)[] | null;
|
|
28
|
+
on_custom_button_click?: ((id: number) => void) | null;
|
|
29
|
+
on_select?: (event_data: SelectData) => void;
|
|
30
|
+
on_download?: (event_data: FileData) => void;
|
|
18
31
|
} = $props();
|
|
19
32
|
</script>
|
|
20
33
|
|
|
@@ -32,10 +45,10 @@
|
|
|
32
45
|
<FilePreview
|
|
33
46
|
{i18n}
|
|
34
47
|
{selectable}
|
|
35
|
-
|
|
36
|
-
|
|
48
|
+
onselect={on_select}
|
|
49
|
+
ondownload={on_download}
|
|
37
50
|
{value}
|
|
38
|
-
{height}
|
|
51
|
+
height={height ?? undefined}
|
|
39
52
|
/>
|
|
40
53
|
{:else}
|
|
41
54
|
<Empty unpadded_box={true} size="large"><File /></Empty>
|
package/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FileData } from "@gradio/client";
|
|
2
|
-
import type { LoadingStatus } from "js/statustracker";
|
|
2
|
+
import type { ILoadingStatus as LoadingStatus } from "js/statustracker";
|
|
3
3
|
import type { SelectData, CustomButton } from "@gradio/utils";
|
|
4
4
|
|
|
5
5
|
export interface FileProps {
|
|
@@ -15,7 +15,7 @@ export interface FileProps {
|
|
|
15
15
|
|
|
16
16
|
export interface FileEvents {
|
|
17
17
|
upload: FileData | FileData[];
|
|
18
|
-
download:
|
|
18
|
+
download: FileData;
|
|
19
19
|
error: string;
|
|
20
20
|
clear_status: LoadingStatus;
|
|
21
21
|
clear: void;
|