@gradio/annotatedimage 0.9.30 → 0.10.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 +17 -0
- package/Index.svelte +2 -40
- package/dist/Index.svelte +2 -34
- package/dist/Index.svelte.d.ts +1 -1
- package/package.json +5 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @gradio/annotatedimage
|
|
2
2
|
|
|
3
|
+
## 0.10.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- [#11858](https://github.com/gradio-app/gradio/pull/11858) [`3f8ea13`](https://github.com/gradio-app/gradio/commit/3f8ea13a8ca92abf0ad34392e403a449fda3c6c2) - remove lite. Thanks @pngwn!
|
|
8
|
+
|
|
9
|
+
### Fixes
|
|
10
|
+
|
|
11
|
+
- [#11784](https://github.com/gradio-app/gradio/pull/11784) [`d9dd3f5`](https://github.com/gradio-app/gradio/commit/d9dd3f54b7fb34cf7118e549d39fc63937ca3489) - Add "hidden" option to component's `visible` kwarg to render but visually hide the component. Thanks @pngwn!
|
|
12
|
+
|
|
13
|
+
### Dependency updates
|
|
14
|
+
|
|
15
|
+
- @gradio/statustracker@0.11.1
|
|
16
|
+
- @gradio/atoms@0.18.0
|
|
17
|
+
- @gradio/client@1.19.0
|
|
18
|
+
- @gradio/upload@0.17.0
|
|
19
|
+
|
|
3
20
|
## 0.9.30
|
|
4
21
|
|
|
5
22
|
### Dependency updates
|
package/Index.svelte
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Gradio, SelectData } from "@gradio/utils";
|
|
3
3
|
|
|
4
|
-
import { onMount } from "svelte";
|
|
5
4
|
import {
|
|
6
5
|
Block,
|
|
7
6
|
BlockLabel,
|
|
@@ -9,15 +8,14 @@
|
|
|
9
8
|
IconButtonWrapper,
|
|
10
9
|
FullscreenButton
|
|
11
10
|
} from "@gradio/atoms";
|
|
12
|
-
import { Image
|
|
11
|
+
import { Image } from "@gradio/icons";
|
|
13
12
|
import { StatusTracker } from "@gradio/statustracker";
|
|
14
13
|
import type { LoadingStatus } from "@gradio/statustracker";
|
|
15
14
|
import { type FileData } from "@gradio/client";
|
|
16
|
-
import { resolve_wasm_src } from "@gradio/wasm/svelte";
|
|
17
15
|
|
|
18
16
|
export let elem_id = "";
|
|
19
17
|
export let elem_classes: string[] = [];
|
|
20
|
-
export let visible = true;
|
|
18
|
+
export let visible: boolean | "hidden" = true;
|
|
21
19
|
export let value: {
|
|
22
20
|
image: FileData;
|
|
23
21
|
annotations: { image: FileData; label: string }[] | [];
|
|
@@ -68,42 +66,6 @@
|
|
|
68
66
|
}))
|
|
69
67
|
};
|
|
70
68
|
_value = normalized_value;
|
|
71
|
-
|
|
72
|
-
// In normal (non-Wasm) Gradio, the `<img>` element should be rendered with the passed values immediately
|
|
73
|
-
// without waiting for `resolve_wasm_src()` to resolve.
|
|
74
|
-
// If it waits, a blank image is displayed until the async task finishes
|
|
75
|
-
// and it leads to undesirable flickering.
|
|
76
|
-
// So set `_value` immediately above, and update it with the resolved values below later.
|
|
77
|
-
const image_url_promise = resolve_wasm_src(normalized_value.image.url);
|
|
78
|
-
const annotation_urls_promise = Promise.all(
|
|
79
|
-
normalized_value.annotations.map((ann) =>
|
|
80
|
-
resolve_wasm_src(ann.image.url)
|
|
81
|
-
)
|
|
82
|
-
);
|
|
83
|
-
const current_promise = Promise.all([
|
|
84
|
-
image_url_promise,
|
|
85
|
-
annotation_urls_promise
|
|
86
|
-
]);
|
|
87
|
-
latest_promise = current_promise;
|
|
88
|
-
current_promise.then(([image_url, annotation_urls]) => {
|
|
89
|
-
if (latest_promise !== current_promise) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
const async_resolved_value: typeof _value = {
|
|
93
|
-
image: {
|
|
94
|
-
...normalized_value.image,
|
|
95
|
-
url: image_url ?? undefined
|
|
96
|
-
},
|
|
97
|
-
annotations: normalized_value.annotations.map((ann, i) => ({
|
|
98
|
-
...ann,
|
|
99
|
-
image: {
|
|
100
|
-
...ann.image,
|
|
101
|
-
url: annotation_urls[i] ?? undefined
|
|
102
|
-
}
|
|
103
|
-
}))
|
|
104
|
-
};
|
|
105
|
-
_value = async_resolved_value;
|
|
106
|
-
});
|
|
107
69
|
} else {
|
|
108
70
|
_value = null;
|
|
109
71
|
}
|
package/dist/Index.svelte
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
import {
|
|
1
|
+
<script>import {
|
|
3
2
|
Block,
|
|
4
3
|
BlockLabel,
|
|
5
4
|
Empty,
|
|
6
5
|
IconButtonWrapper,
|
|
7
6
|
FullscreenButton
|
|
8
7
|
} from "@gradio/atoms";
|
|
9
|
-
import { Image
|
|
8
|
+
import { Image } from "@gradio/icons";
|
|
10
9
|
import { StatusTracker } from "@gradio/statustracker";
|
|
11
10
|
import {} from "@gradio/client";
|
|
12
|
-
import { resolve_wasm_src } from "@gradio/wasm/svelte";
|
|
13
11
|
export let elem_id = "";
|
|
14
12
|
export let elem_classes = [];
|
|
15
13
|
export let visible = true;
|
|
@@ -46,36 +44,6 @@ $: {
|
|
|
46
44
|
}))
|
|
47
45
|
};
|
|
48
46
|
_value = normalized_value;
|
|
49
|
-
const image_url_promise = resolve_wasm_src(normalized_value.image.url);
|
|
50
|
-
const annotation_urls_promise = Promise.all(
|
|
51
|
-
normalized_value.annotations.map(
|
|
52
|
-
(ann) => resolve_wasm_src(ann.image.url)
|
|
53
|
-
)
|
|
54
|
-
);
|
|
55
|
-
const current_promise = Promise.all([
|
|
56
|
-
image_url_promise,
|
|
57
|
-
annotation_urls_promise
|
|
58
|
-
]);
|
|
59
|
-
latest_promise = current_promise;
|
|
60
|
-
current_promise.then(([image_url, annotation_urls]) => {
|
|
61
|
-
if (latest_promise !== current_promise) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
const async_resolved_value = {
|
|
65
|
-
image: {
|
|
66
|
-
...normalized_value.image,
|
|
67
|
-
url: image_url ?? void 0
|
|
68
|
-
},
|
|
69
|
-
annotations: normalized_value.annotations.map((ann, i) => ({
|
|
70
|
-
...ann,
|
|
71
|
-
image: {
|
|
72
|
-
...ann.image,
|
|
73
|
-
url: annotation_urls[i] ?? void 0
|
|
74
|
-
}
|
|
75
|
-
}))
|
|
76
|
-
};
|
|
77
|
-
_value = async_resolved_value;
|
|
78
|
-
});
|
|
79
47
|
} else {
|
|
80
48
|
_value = null;
|
|
81
49
|
}
|
package/dist/Index.svelte.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/annotatedimage",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Gradio UI packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
@@ -22,13 +22,12 @@
|
|
|
22
22
|
"svelte": "^4.0.0"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@gradio/atoms": "^0.
|
|
25
|
+
"@gradio/atoms": "^0.18.0",
|
|
26
26
|
"@gradio/icons": "^0.14.0",
|
|
27
|
-
"@gradio/
|
|
27
|
+
"@gradio/statustracker": "^0.11.1",
|
|
28
|
+
"@gradio/upload": "^0.17.0",
|
|
28
29
|
"@gradio/utils": "^0.10.2",
|
|
29
|
-
"@gradio/
|
|
30
|
-
"@gradio/client": "^1.18.0",
|
|
31
|
-
"@gradio/wasm": "^0.18.1"
|
|
30
|
+
"@gradio/client": "^1.19.0"
|
|
32
31
|
},
|
|
33
32
|
"repository": {
|
|
34
33
|
"type": "git",
|