@gradio/image 0.23.1 → 0.23.2-dev.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 +13 -0
- package/Image.test.ts +3 -3
- package/Index.svelte +5 -6
- package/dist/Index.svelte +5 -6
- package/dist/Index.svelte.d.ts +3 -11
- package/dist/shared/ImagePreview.svelte +4 -6
- package/dist/shared/ImagePreview.svelte.d.ts +1 -3
- package/package.json +4 -4
- package/shared/ImagePreview.svelte +4 -6
package/CHANGELOG.md
CHANGED
package/Image.test.ts
CHANGED
|
@@ -56,9 +56,9 @@ describe("Image", () => {
|
|
|
56
56
|
const mock = listen("change");
|
|
57
57
|
|
|
58
58
|
component.value = {
|
|
59
|
-
url: "https://github.com/gradio-app/gradio/blob/main/
|
|
60
|
-
orig_name: "
|
|
61
|
-
path: "https://github.com/gradio-app/gradio/blob/main/
|
|
59
|
+
url: "https://github.com/gradio-app/gradio/blob/main/gradio/media_assets/images/cheetah1.jpg",
|
|
60
|
+
orig_name: "cheetah1.jpg",
|
|
61
|
+
path: "https://github.com/gradio-app/gradio/blob/main/gradio/media_assets/images/cheetah1.jpg"
|
|
62
62
|
};
|
|
63
63
|
assert.equal(mock.callCount, 1);
|
|
64
64
|
});
|
package/Index.svelte
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
let old_value: null | FileData = null;
|
|
42
42
|
export let label: string;
|
|
43
43
|
export let show_label: boolean;
|
|
44
|
-
export let
|
|
44
|
+
export let buttons: string[] | null = null;
|
|
45
45
|
export let root: string;
|
|
46
46
|
|
|
47
47
|
export let height: number | undefined;
|
|
@@ -53,7 +53,6 @@
|
|
|
53
53
|
export let scale: number | null = null;
|
|
54
54
|
export let min_width: number | undefined = undefined;
|
|
55
55
|
export let loading_status: LoadingStatus;
|
|
56
|
-
export let show_share_button = false;
|
|
57
56
|
export let sources: ("clipboard" | "webcam" | "upload")[] = [
|
|
58
57
|
"upload",
|
|
59
58
|
"clipboard",
|
|
@@ -63,7 +62,6 @@
|
|
|
63
62
|
export let streaming: boolean;
|
|
64
63
|
export let pending: boolean;
|
|
65
64
|
export let placeholder: string | undefined = undefined;
|
|
66
|
-
export let show_fullscreen_button: boolean;
|
|
67
65
|
export let input_ready: boolean;
|
|
68
66
|
export let webcam_options: WebcamOptions;
|
|
69
67
|
let fullscreen = false;
|
|
@@ -159,11 +157,9 @@
|
|
|
159
157
|
{value}
|
|
160
158
|
{label}
|
|
161
159
|
{show_label}
|
|
162
|
-
{
|
|
160
|
+
{buttons}
|
|
163
161
|
selectable={_selectable}
|
|
164
|
-
{show_share_button}
|
|
165
162
|
i18n={gradio.i18n}
|
|
166
|
-
{show_fullscreen_button}
|
|
167
163
|
/>
|
|
168
164
|
</Block>
|
|
169
165
|
{:else}
|
|
@@ -203,6 +199,9 @@
|
|
|
203
199
|
{root}
|
|
204
200
|
{sources}
|
|
205
201
|
{fullscreen}
|
|
202
|
+
show_fullscreen_button={buttons === null
|
|
203
|
+
? true
|
|
204
|
+
: buttons.includes("fullscreen")}
|
|
206
205
|
on:edit={() => gradio.dispatch("edit")}
|
|
207
206
|
on:clear={() => {
|
|
208
207
|
fullscreen = false;
|
package/dist/Index.svelte
CHANGED
|
@@ -31,7 +31,7 @@ export let value = null;
|
|
|
31
31
|
let old_value = null;
|
|
32
32
|
export let label;
|
|
33
33
|
export let show_label;
|
|
34
|
-
export let
|
|
34
|
+
export let buttons = null;
|
|
35
35
|
export let root;
|
|
36
36
|
export let height;
|
|
37
37
|
export let width;
|
|
@@ -41,7 +41,6 @@ export let container = true;
|
|
|
41
41
|
export let scale = null;
|
|
42
42
|
export let min_width = void 0;
|
|
43
43
|
export let loading_status;
|
|
44
|
-
export let show_share_button = false;
|
|
45
44
|
export let sources = [
|
|
46
45
|
"upload",
|
|
47
46
|
"clipboard",
|
|
@@ -51,7 +50,6 @@ export let interactive;
|
|
|
51
50
|
export let streaming;
|
|
52
51
|
export let pending;
|
|
53
52
|
export let placeholder = void 0;
|
|
54
|
-
export let show_fullscreen_button;
|
|
55
53
|
export let input_ready;
|
|
56
54
|
export let webcam_options;
|
|
57
55
|
let fullscreen = false;
|
|
@@ -128,11 +126,9 @@ const handle_drop = (event) => {
|
|
|
128
126
|
{value}
|
|
129
127
|
{label}
|
|
130
128
|
{show_label}
|
|
131
|
-
{
|
|
129
|
+
{buttons}
|
|
132
130
|
selectable={_selectable}
|
|
133
|
-
{show_share_button}
|
|
134
131
|
i18n={gradio.i18n}
|
|
135
|
-
{show_fullscreen_button}
|
|
136
132
|
/>
|
|
137
133
|
</Block>
|
|
138
134
|
{:else}
|
|
@@ -172,6 +168,9 @@ const handle_drop = (event) => {
|
|
|
172
168
|
{root}
|
|
173
169
|
{sources}
|
|
174
170
|
{fullscreen}
|
|
171
|
+
show_fullscreen_button={buttons === null
|
|
172
|
+
? true
|
|
173
|
+
: buttons.includes("fullscreen")}
|
|
175
174
|
on:edit={() => gradio.dispatch("edit")}
|
|
176
175
|
on:clear={() => {
|
|
177
176
|
fullscreen = false;
|
package/dist/Index.svelte.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ declare const __propDef: {
|
|
|
20
20
|
value?: null | FileData;
|
|
21
21
|
label: string;
|
|
22
22
|
show_label: boolean;
|
|
23
|
-
|
|
23
|
+
buttons?: string[] | null;
|
|
24
24
|
root: string;
|
|
25
25
|
height: number | undefined;
|
|
26
26
|
width: number | undefined;
|
|
@@ -30,13 +30,11 @@ declare const __propDef: {
|
|
|
30
30
|
scale?: number | null;
|
|
31
31
|
min_width?: number | undefined;
|
|
32
32
|
loading_status: LoadingStatus;
|
|
33
|
-
show_share_button?: boolean;
|
|
34
33
|
sources?: ("clipboard" | "webcam" | "upload")[];
|
|
35
34
|
interactive: boolean;
|
|
36
35
|
streaming: boolean;
|
|
37
36
|
pending: boolean;
|
|
38
37
|
placeholder?: string | undefined;
|
|
39
|
-
show_fullscreen_button: boolean;
|
|
40
38
|
input_ready: boolean;
|
|
41
39
|
webcam_options: WebcamOptions;
|
|
42
40
|
gradio: Gradio<{
|
|
@@ -94,9 +92,9 @@ export default class Index extends SvelteComponent<IndexProps, IndexEvents, Inde
|
|
|
94
92
|
get show_label(): boolean;
|
|
95
93
|
/**accessor*/
|
|
96
94
|
set show_label(_: boolean);
|
|
97
|
-
get
|
|
95
|
+
get buttons(): string[] | null | undefined;
|
|
98
96
|
/**accessor*/
|
|
99
|
-
set
|
|
97
|
+
set buttons(_: string[] | null | undefined);
|
|
100
98
|
get root(): string;
|
|
101
99
|
/**accessor*/
|
|
102
100
|
set root(_: string);
|
|
@@ -124,9 +122,6 @@ export default class Index extends SvelteComponent<IndexProps, IndexEvents, Inde
|
|
|
124
122
|
get loading_status(): LoadingStatus;
|
|
125
123
|
/**accessor*/
|
|
126
124
|
set loading_status(_: LoadingStatus);
|
|
127
|
-
get show_share_button(): boolean | undefined;
|
|
128
|
-
/**accessor*/
|
|
129
|
-
set show_share_button(_: boolean | undefined);
|
|
130
125
|
get sources(): ("clipboard" | "upload" | "webcam")[] | undefined;
|
|
131
126
|
/**accessor*/
|
|
132
127
|
set sources(_: ("clipboard" | "upload" | "webcam")[] | undefined);
|
|
@@ -142,9 +137,6 @@ export default class Index extends SvelteComponent<IndexProps, IndexEvents, Inde
|
|
|
142
137
|
get placeholder(): string | undefined;
|
|
143
138
|
/**accessor*/
|
|
144
139
|
set placeholder(_: string | undefined);
|
|
145
|
-
get show_fullscreen_button(): boolean;
|
|
146
|
-
/**accessor*/
|
|
147
|
-
set show_fullscreen_button(_: boolean);
|
|
148
140
|
get input_ready(): boolean;
|
|
149
141
|
/**accessor*/
|
|
150
142
|
set input_ready(_: boolean);
|
|
@@ -15,11 +15,9 @@ import Image from "./Image.svelte";
|
|
|
15
15
|
export let value;
|
|
16
16
|
export let label = void 0;
|
|
17
17
|
export let show_label;
|
|
18
|
-
export let
|
|
18
|
+
export let buttons = null;
|
|
19
19
|
export let selectable = false;
|
|
20
|
-
export let show_share_button = false;
|
|
21
20
|
export let i18n;
|
|
22
|
-
export let show_fullscreen_button = true;
|
|
23
21
|
export let display_icon_button_wrapper_top_corner = false;
|
|
24
22
|
export let fullscreen = false;
|
|
25
23
|
const dispatch = createEventDispatcher();
|
|
@@ -44,16 +42,16 @@ let image_container;
|
|
|
44
42
|
<IconButtonWrapper
|
|
45
43
|
display_top_corner={display_icon_button_wrapper_top_corner}
|
|
46
44
|
>
|
|
47
|
-
{#if
|
|
45
|
+
{#if buttons === null ? true : buttons.includes("fullscreen")}
|
|
48
46
|
<FullscreenButton {fullscreen} on:fullscreen />
|
|
49
47
|
{/if}
|
|
50
48
|
|
|
51
|
-
{#if
|
|
49
|
+
{#if buttons === null ? true : buttons.includes("download")}
|
|
52
50
|
<DownloadLink href={value.url} download={value.orig_name || "image"}>
|
|
53
51
|
<IconButton Icon={Download} label={i18n("common.download")} />
|
|
54
52
|
</DownloadLink>
|
|
55
53
|
{/if}
|
|
56
|
-
{#if
|
|
54
|
+
{#if buttons === null ? true : buttons.includes("share")}
|
|
57
55
|
<ShareButton
|
|
58
56
|
{i18n}
|
|
59
57
|
on:share
|
|
@@ -7,11 +7,9 @@ declare const __propDef: {
|
|
|
7
7
|
value: null | FileData;
|
|
8
8
|
label?: string | undefined;
|
|
9
9
|
show_label: boolean;
|
|
10
|
-
|
|
10
|
+
buttons?: string[] | null;
|
|
11
11
|
selectable?: boolean;
|
|
12
|
-
show_share_button?: boolean;
|
|
13
12
|
i18n: I18nFormatter;
|
|
14
|
-
show_fullscreen_button?: boolean;
|
|
15
13
|
display_icon_button_wrapper_top_corner?: boolean;
|
|
16
14
|
fullscreen?: boolean;
|
|
17
15
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/image",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.2-dev.0",
|
|
4
4
|
"description": "Gradio UI packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"lazy-brush": "^1.0.1",
|
|
12
12
|
"resize-observer-polyfill": "^1.5.1",
|
|
13
13
|
"@gradio/atoms": "^0.18.1",
|
|
14
|
-
"@gradio/client": "^1.19.0",
|
|
15
14
|
"@gradio/statustracker": "^0.11.1",
|
|
16
15
|
"@gradio/icons": "^0.14.0",
|
|
17
|
-
"@gradio/
|
|
18
|
-
"@gradio/utils": "^0.10.2"
|
|
16
|
+
"@gradio/client": "^2.0.0-dev.0",
|
|
17
|
+
"@gradio/utils": "^0.10.2",
|
|
18
|
+
"@gradio/upload": "^0.17.2-dev.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@gradio/preview": "^0.14.0"
|
|
@@ -21,11 +21,9 @@
|
|
|
21
21
|
export let value: null | FileData;
|
|
22
22
|
export let label: string | undefined = undefined;
|
|
23
23
|
export let show_label: boolean;
|
|
24
|
-
export let
|
|
24
|
+
export let buttons: string[] | null = null;
|
|
25
25
|
export let selectable = false;
|
|
26
|
-
export let show_share_button = false;
|
|
27
26
|
export let i18n: I18nFormatter;
|
|
28
|
-
export let show_fullscreen_button = true;
|
|
29
27
|
export let display_icon_button_wrapper_top_corner = false;
|
|
30
28
|
export let fullscreen = false;
|
|
31
29
|
|
|
@@ -57,16 +55,16 @@
|
|
|
57
55
|
<IconButtonWrapper
|
|
58
56
|
display_top_corner={display_icon_button_wrapper_top_corner}
|
|
59
57
|
>
|
|
60
|
-
{#if
|
|
58
|
+
{#if buttons === null ? true : buttons.includes("fullscreen")}
|
|
61
59
|
<FullscreenButton {fullscreen} on:fullscreen />
|
|
62
60
|
{/if}
|
|
63
61
|
|
|
64
|
-
{#if
|
|
62
|
+
{#if buttons === null ? true : buttons.includes("download")}
|
|
65
63
|
<DownloadLink href={value.url} download={value.orig_name || "image"}>
|
|
66
64
|
<IconButton Icon={Download} label={i18n("common.download")} />
|
|
67
65
|
</DownloadLink>
|
|
68
66
|
{/if}
|
|
69
|
-
{#if
|
|
67
|
+
{#if buttons === null ? true : buttons.includes("share")}
|
|
70
68
|
<ShareButton
|
|
71
69
|
{i18n}
|
|
72
70
|
on:share
|