@gradio/image 0.8.0 → 0.9.1
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 +22 -5
- package/Index.svelte +9 -7
- package/package.json +7 -7
- package/shared/ImagePreview.svelte +1 -1
- package/shared/ImageUploader.svelte +2 -4
package/CHANGELOG.md
CHANGED
@@ -1,16 +1,33 @@
|
|
1
1
|
# @gradio/image
|
2
2
|
|
3
|
+
## 0.9.1
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- Updated dependencies [[`065c5b1`](https://github.com/gradio-app/gradio/commit/065c5b163c4badb9d9cbd06d627fb4ba086003e7), [`32b317f`](https://github.com/gradio-app/gradio/commit/32b317f24e3d43f26684bb9f3964f31efd0ea556)]:
|
8
|
+
- @gradio/utils@0.3.0
|
9
|
+
- @gradio/client@0.12.1
|
10
|
+
- @gradio/atoms@0.5.2
|
11
|
+
- @gradio/statustracker@0.4.6
|
12
|
+
- @gradio/upload@0.7.3
|
13
|
+
|
14
|
+
## 0.9.0
|
15
|
+
|
16
|
+
### Features
|
17
|
+
|
18
|
+
- [#7183](https://github.com/gradio-app/gradio/pull/7183) [`49d9c48`](https://github.com/gradio-app/gradio/commit/49d9c48537aa706bf72628e3640389470138bdc6) - [WIP] Refactor file normalization to be in the backend and remove it from the frontend of each component. Thanks [@abidlabs](https://github.com/abidlabs)!
|
19
|
+
|
3
20
|
## 0.8.0
|
4
21
|
|
5
22
|
### Features
|
6
23
|
|
7
|
-
- [#7228](https://github.com/gradio-app/gradio/pull/7228) [`2e6672c`](https://github.com/gradio-app/gradio/commit/2e6672c815e39fd6af78353e66661100b9102cd4) - Allow start/pause of streaming image input. Only access the webcam while it's needed.
|
8
|
-
- [#7309](https://github.com/gradio-app/gradio/pull/7309) [`200e251`](https://github.com/gradio-app/gradio/commit/200e2518e4d449aa82819a8d119e912bd1d95c15) - Add `gr.Image` interaction test + `gr.ImageEditor` interaction test improvement.
|
24
|
+
- [#7228](https://github.com/gradio-app/gradio/pull/7228) [`2e6672c`](https://github.com/gradio-app/gradio/commit/2e6672c815e39fd6af78353e66661100b9102cd4) - Allow start/pause of streaming image input. Only access the webcam while it's needed. Thanks [@freddyaboulton](https://github.com/freddyaboulton)!
|
25
|
+
- [#7309](https://github.com/gradio-app/gradio/pull/7309) [`200e251`](https://github.com/gradio-app/gradio/commit/200e2518e4d449aa82819a8d119e912bd1d95c15) - Add `gr.Image` interaction test + `gr.ImageEditor` interaction test improvement. Thanks [@hannahblair](https://github.com/hannahblair)!
|
9
26
|
|
10
27
|
### Fixes
|
11
28
|
|
12
|
-
- [#7192](https://github.com/gradio-app/gradio/pull/7192) [`8dd6f4b`](https://github.com/gradio-app/gradio/commit/8dd6f4bc1901792f05cd59e86df7b1dbab692739) - Handle the case where examples is `null` for all components.
|
13
|
-
- [#7325](https://github.com/gradio-app/gradio/pull/7325) [`733ca26`](https://github.com/gradio-app/gradio/commit/733ca266bb1ba9049ed7309b8f0614199682e173) - Ensure examples Images displays as expected.
|
29
|
+
- [#7192](https://github.com/gradio-app/gradio/pull/7192) [`8dd6f4b`](https://github.com/gradio-app/gradio/commit/8dd6f4bc1901792f05cd59e86df7b1dbab692739) - Handle the case where examples is `null` for all components. Thanks [@abidlabs](https://github.com/abidlabs)!
|
30
|
+
- [#7325](https://github.com/gradio-app/gradio/pull/7325) [`733ca26`](https://github.com/gradio-app/gradio/commit/733ca266bb1ba9049ed7309b8f0614199682e173) - Ensure examples Images displays as expected. Thanks [@hannahblair](https://github.com/hannahblair)!
|
14
31
|
|
15
32
|
## 0.7.1
|
16
33
|
|
@@ -354,4 +371,4 @@ Thanks [@pngwn](https://github.com/pngwn)!
|
|
354
371
|
|
355
372
|
### Features
|
356
373
|
|
357
|
-
- [#4979](https://github.com/gradio-app/gradio/pull/4979) [`44ac8ad0`](https://github.com/gradio-app/gradio/commit/44ac8ad08d82ea12c503dde5c78f999eb0452de2) - Allow setting sketch color default. Thanks [@aliabid94](https://github.com/aliabid94)!
|
374
|
+
- [#4979](https://github.com/gradio-app/gradio/pull/4979) [`44ac8ad0`](https://github.com/gradio-app/gradio/commit/44ac8ad08d82ea12c503dde5c78f999eb0452de2) - Allow setting sketch color default. Thanks [@aliabid94](https://github.com/aliabid94)!
|
package/Index.svelte
CHANGED
@@ -18,7 +18,6 @@
|
|
18
18
|
import { StatusTracker } from "@gradio/statustracker";
|
19
19
|
import type { FileData } from "@gradio/client";
|
20
20
|
import type { LoadingStatus } from "@gradio/statustracker";
|
21
|
-
import { normalise_file } from "@gradio/client";
|
22
21
|
|
23
22
|
type sources = "upload" | "webcam" | "clipboard" | null;
|
24
23
|
|
@@ -26,12 +25,11 @@
|
|
26
25
|
export let elem_classes: string[] = [];
|
27
26
|
export let visible = true;
|
28
27
|
export let value: null | FileData = null;
|
29
|
-
|
28
|
+
let old_value: null | FileData = null;
|
30
29
|
export let label: string;
|
31
30
|
export let show_label: boolean;
|
32
31
|
export let show_download_button: boolean;
|
33
32
|
export let root: string;
|
34
|
-
export let proxy_url: null | string;
|
35
33
|
|
36
34
|
export let height: number | undefined;
|
37
35
|
export let width: number | undefined;
|
@@ -64,8 +62,12 @@
|
|
64
62
|
share: ShareData;
|
65
63
|
}>;
|
66
64
|
|
67
|
-
$:
|
68
|
-
|
65
|
+
$: {
|
66
|
+
if (JSON.stringify(value) !== JSON.stringify(old_value)) {
|
67
|
+
old_value = value;
|
68
|
+
gradio.dispatch("change");
|
69
|
+
}
|
70
|
+
}
|
69
71
|
|
70
72
|
let dragging: boolean;
|
71
73
|
let active_source: sources = null;
|
@@ -95,7 +97,7 @@
|
|
95
97
|
on:select={({ detail }) => gradio.dispatch("select", detail)}
|
96
98
|
on:share={({ detail }) => gradio.dispatch("share", detail)}
|
97
99
|
on:error={({ detail }) => gradio.dispatch("error", detail)}
|
98
|
-
value
|
100
|
+
{value}
|
99
101
|
{label}
|
100
102
|
{show_label}
|
101
103
|
{show_download_button}
|
@@ -107,7 +109,7 @@
|
|
107
109
|
{:else}
|
108
110
|
<Block
|
109
111
|
{visible}
|
110
|
-
variant={
|
112
|
+
variant={value === null ? "dashed" : "solid"}
|
111
113
|
border_mode={dragging ? "focus" : "base"}
|
112
114
|
padding={false}
|
113
115
|
{elem_id}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@gradio/image",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.9.1",
|
4
4
|
"description": "Gradio UI packages",
|
5
5
|
"type": "module",
|
6
6
|
"author": "",
|
@@ -10,13 +10,13 @@
|
|
10
10
|
"cropperjs": "^1.5.12",
|
11
11
|
"lazy-brush": "^1.0.1",
|
12
12
|
"resize-observer-polyfill": "^1.5.1",
|
13
|
-
"@gradio/atoms": "^0.5.
|
14
|
-
"@gradio/client": "^0.
|
13
|
+
"@gradio/atoms": "^0.5.2",
|
14
|
+
"@gradio/client": "^0.12.1",
|
15
15
|
"@gradio/icons": "^0.3.2",
|
16
|
-
"@gradio/statustracker": "^0.4.
|
17
|
-
"@gradio/
|
18
|
-
"@gradio/
|
19
|
-
"@gradio/
|
16
|
+
"@gradio/statustracker": "^0.4.6",
|
17
|
+
"@gradio/upload": "^0.7.3",
|
18
|
+
"@gradio/utils": "^0.3.0",
|
19
|
+
"@gradio/wasm": "^0.6.0"
|
20
20
|
},
|
21
21
|
"main_changeset": true,
|
22
22
|
"main": "./Index.svelte",
|
@@ -9,7 +9,7 @@
|
|
9
9
|
import { DownloadLink } from "@gradio/wasm/svelte";
|
10
10
|
|
11
11
|
import { Image as ImageIcon } from "@gradio/icons";
|
12
|
-
import { type FileData
|
12
|
+
import { type FileData } from "@gradio/client";
|
13
13
|
import type { I18nFormatter } from "@gradio/utils";
|
14
14
|
|
15
15
|
export let value: null | FileData;
|
@@ -7,7 +7,7 @@
|
|
7
7
|
import Webcam from "./Webcam.svelte";
|
8
8
|
|
9
9
|
import { Upload } from "@gradio/upload";
|
10
|
-
import {
|
10
|
+
import type { FileData } from "@gradio/client";
|
11
11
|
import ClearImage from "./ClearImage.svelte";
|
12
12
|
import { SelectSource } from "@gradio/atoms";
|
13
13
|
import Image from "./Image.svelte";
|
@@ -31,7 +31,7 @@
|
|
31
31
|
export let active_source: source_type = null;
|
32
32
|
|
33
33
|
function handle_upload({ detail }: CustomEvent<FileData>): void {
|
34
|
-
value =
|
34
|
+
value = detail;
|
35
35
|
dispatch("upload");
|
36
36
|
}
|
37
37
|
|
@@ -56,8 +56,6 @@
|
|
56
56
|
$: active_streaming = streaming && active_source === "webcam";
|
57
57
|
$: if (uploading && !active_streaming) value = null;
|
58
58
|
|
59
|
-
$: value && !value.url && (value = normalise_file(value, root, null));
|
60
|
-
|
61
59
|
const dispatch = createEventDispatcher<{
|
62
60
|
change?: never;
|
63
61
|
stream?: never;
|