@gradio/annotatedimage 0.9.29 → 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 CHANGED
@@ -1,5 +1,45 @@
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
+
20
+ ## 0.9.30
21
+
22
+ ### Dependency updates
23
+
24
+ - @gradio/client@1.18.0
25
+ - @gradio/icons@0.14.0
26
+ - @gradio/atoms@0.17.0
27
+ - @gradio/statustracker@0.11.0
28
+ - @gradio/upload@0.16.17
29
+
30
+ ## 0.9.29
31
+
32
+ ### Dependency updates
33
+
34
+ - @gradio/statustracker@0.10.18
35
+
36
+ ## 0.9.29
37
+
38
+ ### Dependency updates
39
+
40
+ - @gradio/icons@0.13.1
41
+ - @gradio/upload@0.16.16
42
+
3
43
  ## 0.9.29
4
44
 
5
45
  ### 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, Maximize, Minimize } from "@gradio/icons";
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 { onMount } from "svelte";
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, Maximize, Minimize } from "@gradio/icons";
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
  }
@@ -4,36 +4,38 @@ import type { LoadingStatus } from "@gradio/statustracker";
4
4
  import { type FileData } from "@gradio/client";
5
5
  declare const __propDef: {
6
6
  props: {
7
- elem_id?: string | undefined;
8
- elem_classes?: string[] | undefined;
9
- visible?: boolean | undefined;
10
- value?: ({
7
+ elem_id?: string;
8
+ elem_classes?: string[];
9
+ visible?: boolean | "hidden";
10
+ value?: {
11
11
  image: FileData;
12
12
  annotations: {
13
13
  image: FileData;
14
14
  label: string;
15
15
  }[] | [];
16
- } | null) | undefined;
16
+ } | null;
17
17
  gradio: Gradio<{
18
18
  change: undefined;
19
19
  select: SelectData;
20
20
  }>;
21
21
  label?: any;
22
- show_label?: boolean | undefined;
23
- show_legend?: boolean | undefined;
22
+ show_label?: boolean;
23
+ show_legend?: boolean;
24
24
  height: number | undefined;
25
25
  width: number | undefined;
26
26
  color_map: Record<string, string>;
27
- container?: boolean | undefined;
28
- scale?: (number | null) | undefined;
27
+ container?: boolean;
28
+ scale?: number | null;
29
29
  min_width?: number | undefined;
30
30
  loading_status: LoadingStatus;
31
- show_fullscreen_button?: boolean | undefined;
31
+ show_fullscreen_button?: boolean;
32
32
  };
33
33
  events: {
34
34
  [evt: string]: CustomEvent<any>;
35
35
  };
36
36
  slots: {};
37
+ exports?: {} | undefined;
38
+ bindings?: string | undefined;
37
39
  };
38
40
  export type IndexProps = typeof __propDef.props;
39
41
  export type IndexEvents = typeof __propDef.events;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/annotatedimage",
3
- "version": "0.9.29",
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.16.5",
26
- "@gradio/icons": "^0.13.0",
27
- "@gradio/statustracker": "^0.10.17",
25
+ "@gradio/atoms": "^0.18.0",
26
+ "@gradio/icons": "^0.14.0",
27
+ "@gradio/statustracker": "^0.11.1",
28
+ "@gradio/upload": "^0.17.0",
28
29
  "@gradio/utils": "^0.10.2",
29
- "@gradio/client": "^1.17.1",
30
- "@gradio/wasm": "^0.18.1",
31
- "@gradio/upload": "^0.16.15"
30
+ "@gradio/client": "^1.19.0"
32
31
  },
33
32
  "repository": {
34
33
  "type": "git",