@gradio/image 0.22.18 → 0.23.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,22 @@
1
1
  # @gradio/image
2
2
 
3
+ ## 0.23.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.22.18
4
21
 
5
22
  ### Dependency updates
package/Index.svelte CHANGED
@@ -36,7 +36,7 @@
36
36
  export let value_is_output = false;
37
37
  export let elem_id = "";
38
38
  export let elem_classes: string[] = [];
39
- export let visible = true;
39
+ export let visible: boolean | "hidden" = true;
40
40
  export let value: null | FileData = null;
41
41
  let old_value: null | FileData = null;
42
42
  export let label: string;
@@ -16,7 +16,7 @@ declare const __propDef: {
16
16
  value_is_output?: boolean;
17
17
  elem_id?: string;
18
18
  elem_classes?: string[];
19
- visible?: boolean;
19
+ visible?: boolean | "hidden";
20
20
  value?: null | FileData;
21
21
  label: string;
22
22
  show_label: boolean;
@@ -82,12 +82,12 @@ export default class Index extends SvelteComponent<IndexProps, IndexEvents, Inde
82
82
  get elem_classes(): string[] | undefined;
83
83
  /**accessor*/
84
84
  set elem_classes(_: string[] | undefined);
85
- get visible(): boolean | undefined;
85
+ get visible(): boolean | "hidden" | undefined;
86
86
  /**accessor*/
87
- set visible(_: boolean | undefined);
88
- get value(): FileData | null | undefined;
87
+ set visible(_: boolean | "hidden" | undefined);
88
+ get value(): any;
89
89
  /**accessor*/
90
- set value(_: FileData | null | undefined);
90
+ set value(_: any);
91
91
  get label(): string;
92
92
  /**accessor*/
93
93
  set label(_: string);
@@ -1,21 +1,8 @@
1
- <script>import { resolve_wasm_src } from "@gradio/wasm/svelte";
2
- export let src = void 0;
3
- let resolved_src;
4
- let latest_src;
5
- $: {
6
- resolved_src = src;
7
- latest_src = src;
8
- const resolving_src = src;
9
- resolve_wasm_src(resolving_src).then((s) => {
10
- if (latest_src === resolving_src) {
11
- resolved_src = s;
12
- }
13
- });
14
- }
1
+ <script>export let src = void 0;
15
2
  </script>
16
3
 
17
4
  <!-- svelte-ignore a11y-missing-attribute -->
18
- <img src={resolved_src} {...$$restProps} on:load />
5
+ <img {src} {...$$restProps} on:load />
19
6
 
20
7
  <style>
21
8
  img {
@@ -6,12 +6,12 @@ import {
6
6
  IconButton,
7
7
  ShareButton,
8
8
  IconButtonWrapper,
9
- FullscreenButton
9
+ FullscreenButton,
10
+ DownloadLink
10
11
  } from "@gradio/atoms";
11
12
  import { Download, Image as ImageIcon } from "@gradio/icons";
12
13
  import { get_coordinates_of_clicked_image } from "./utils";
13
14
  import Image from "./Image.svelte";
14
- import { DownloadLink } from "@gradio/wasm/svelte";
15
15
  export let value;
16
16
  export let label = void 0;
17
17
  export let show_label;
@@ -28,7 +28,7 @@ declare const __propDef: {
28
28
  };
29
29
  events: {
30
30
  fullscreen: CustomEvent<boolean>;
31
- error: CustomEvent<string> | CustomEvent<any>;
31
+ error: CustomEvent<any> | CustomEvent<string>;
32
32
  drag: CustomEvent<any>;
33
33
  close_stream: CustomEvent<undefined>;
34
34
  change?: CustomEvent<undefined> | undefined;
@@ -23,7 +23,7 @@ declare const __propDef: {
23
23
  };
24
24
  events: {
25
25
  stream: CustomEvent<string | Blob>;
26
- capture: CustomEvent<Blob | FileData | null>;
26
+ capture: CustomEvent<any>;
27
27
  error: CustomEvent<string>;
28
28
  start_recording: CustomEvent<undefined>;
29
29
  stop_recording: CustomEvent<undefined>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/image",
3
- "version": "0.22.18",
3
+ "version": "0.23.0",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -10,13 +10,12 @@
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.18.0",
13
14
  "@gradio/icons": "^0.14.0",
14
- "@gradio/atoms": "^0.17.0",
15
- "@gradio/statustracker": "^0.11.0",
16
- "@gradio/client": "^1.18.0",
17
- "@gradio/utils": "^0.10.2",
18
- "@gradio/upload": "^0.16.17",
19
- "@gradio/wasm": "^0.18.1"
15
+ "@gradio/statustracker": "^0.11.1",
16
+ "@gradio/client": "^1.19.0",
17
+ "@gradio/upload": "^0.17.0",
18
+ "@gradio/utils": "^0.10.2"
20
19
  },
21
20
  "devDependencies": {
22
21
  "@gradio/preview": "^0.14.0"
@@ -6,36 +6,11 @@
6
6
  }
7
7
  type $$Props = Props;
8
8
 
9
- import { resolve_wasm_src } from "@gradio/wasm/svelte";
10
-
11
9
  export let src: HTMLImgAttributes["src"] = undefined;
12
-
13
- let resolved_src: typeof src;
14
-
15
- // The `src` prop can be updated before the Promise from `resolve_wasm_src` is resolved.
16
- // In such a case, the resolved value for the old `src` has to be discarded,
17
- // This variable `latest_src` is used to pick up only the value resolved for the latest `src` prop.
18
- let latest_src: typeof src;
19
- $: {
20
- // In normal (non-Wasm) Gradio, the `<img>` element should be rendered with the passed `src` props immediately
21
- // without waiting for `resolve_wasm_src()` to resolve.
22
- // If it waits, a blank image is displayed until the async task finishes
23
- // and it leads to undesirable flickering.
24
- // So set `src` to `resolved_src` here.
25
- resolved_src = src;
26
-
27
- latest_src = src;
28
- const resolving_src = src;
29
- resolve_wasm_src(resolving_src).then((s) => {
30
- if (latest_src === resolving_src) {
31
- resolved_src = s;
32
- }
33
- });
34
- }
35
10
  </script>
36
11
 
37
12
  <!-- svelte-ignore a11y-missing-attribute -->
38
- <img src={resolved_src} {...$$restProps} on:load />
13
+ <img {src} {...$$restProps} on:load />
39
14
 
40
15
  <style>
41
16
  img {
@@ -8,12 +8,12 @@
8
8
  IconButton,
9
9
  ShareButton,
10
10
  IconButtonWrapper,
11
- FullscreenButton
11
+ FullscreenButton,
12
+ DownloadLink
12
13
  } from "@gradio/atoms";
13
14
  import { Download, Image as ImageIcon } from "@gradio/icons";
14
15
  import { get_coordinates_of_clicked_image } from "./utils";
15
16
  import Image from "./Image.svelte";
16
- import { DownloadLink } from "@gradio/wasm/svelte";
17
17
 
18
18
  import type { I18nFormatter } from "@gradio/utils";
19
19
  import type { FileData } from "@gradio/client";