@gradio/imageslider 0.2.14 → 0.3.1-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 CHANGED
@@ -1,5 +1,42 @@
1
1
  # @gradio/imageslider
2
2
 
3
+ ## 0.3.1-dev.0
4
+
5
+ ### Dependency updates
6
+
7
+ - @gradio/upload@0.17.2-dev.0
8
+ - @gradio/client@2.0.0-dev.0
9
+
10
+ ## 0.3.0
11
+
12
+ ### Dependency updates
13
+
14
+ - @gradio/client@1.19.1
15
+
16
+ ## 0.3.0
17
+
18
+ ### Dependency updates
19
+
20
+ - @gradio/upload@0.17.1
21
+ - @gradio/atoms@0.18.1
22
+
23
+ ## 0.3.0
24
+
25
+ ### Features
26
+
27
+ - [#11858](https://github.com/gradio-app/gradio/pull/11858) [`3f8ea13`](https://github.com/gradio-app/gradio/commit/3f8ea13a8ca92abf0ad34392e403a449fda3c6c2) - remove lite. Thanks @pngwn!
28
+
29
+ ### Fixes
30
+
31
+ - [#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!
32
+
33
+ ### Dependency updates
34
+
35
+ - @gradio/statustracker@0.11.1
36
+ - @gradio/atoms@0.18.0
37
+ - @gradio/client@1.19.0
38
+ - @gradio/upload@0.17.0
39
+
3
40
  ## 0.2.14
4
41
 
5
42
  ### Dependency updates
package/Index.svelte CHANGED
@@ -17,12 +17,12 @@
17
17
  export let value_is_output = false;
18
18
  export let elem_id = "";
19
19
  export let elem_classes: string[] = [];
20
- export let visible = true;
20
+ export let visible: boolean | "hidden" = true;
21
21
  export let value: [FileData | null, FileData | null] = [null, null];
22
22
  let old_value: [FileData | null, FileData | null] = [null, null];
23
23
  export let label: string;
24
24
  export let show_label: boolean;
25
- export let show_download_button: boolean;
25
+ export let buttons: string[] | null = null;
26
26
  export let root: string;
27
27
  export let height: number | undefined;
28
28
  export let width: number | undefined;
@@ -32,7 +32,6 @@
32
32
  export let loading_status: LoadingStatus;
33
33
  export let interactive: boolean;
34
34
  export let placeholder: string | undefined = undefined;
35
- export let show_fullscreen_button: boolean;
36
35
  let fullscreen = false;
37
36
  export let input_ready: boolean;
38
37
  export let slider_position: number;
@@ -138,9 +137,9 @@
138
137
  bind:value
139
138
  {label}
140
139
  {show_label}
141
- {show_download_button}
140
+ show_download_button={buttons?.includes("download") ?? true}
142
141
  i18n={gradio.i18n}
143
- {show_fullscreen_button}
142
+ show_fullscreen_button={buttons?.includes("fullscreen") ?? true}
144
143
  position={normalised_slider_position}
145
144
  {slider_color}
146
145
  {max_height}
package/dist/Index.svelte CHANGED
@@ -15,7 +15,7 @@ export let value = [null, null];
15
15
  let old_value = [null, null];
16
16
  export let label;
17
17
  export let show_label;
18
- export let show_download_button;
18
+ export let buttons = null;
19
19
  export let root;
20
20
  export let height;
21
21
  export let width;
@@ -25,7 +25,6 @@ export let min_width = void 0;
25
25
  export let loading_status;
26
26
  export let interactive;
27
27
  export let placeholder = void 0;
28
- export let show_fullscreen_button;
29
28
  let fullscreen = false;
30
29
  export let input_ready;
31
30
  export let slider_position;
@@ -108,9 +107,9 @@ const handle_drop = (event) => {
108
107
  bind:value
109
108
  {label}
110
109
  {show_label}
111
- {show_download_button}
110
+ show_download_button={buttons?.includes("download") ?? true}
112
111
  i18n={gradio.i18n}
113
- {show_fullscreen_button}
112
+ show_fullscreen_button={buttons?.includes("fullscreen") ?? true}
114
113
  position={normalised_slider_position}
115
114
  {slider_color}
116
115
  {max_height}
@@ -7,11 +7,11 @@ declare const __propDef: {
7
7
  value_is_output?: boolean;
8
8
  elem_id?: string;
9
9
  elem_classes?: string[];
10
- visible?: boolean;
10
+ visible?: boolean | "hidden";
11
11
  value?: [FileData | null, FileData | null];
12
12
  label: string;
13
13
  show_label: boolean;
14
- show_download_button: boolean;
14
+ buttons?: string[] | null;
15
15
  root: string;
16
16
  height: number | undefined;
17
17
  width: number | undefined;
@@ -21,7 +21,6 @@ declare const __propDef: {
21
21
  loading_status: LoadingStatus;
22
22
  interactive: boolean;
23
23
  placeholder?: string | undefined;
24
- show_fullscreen_button: boolean;
25
24
  input_ready: boolean;
26
25
  slider_position: number;
27
26
  upload_count?: number;
@@ -62,21 +61,21 @@ export default class Index extends SvelteComponent<IndexProps, IndexEvents, Inde
62
61
  get elem_classes(): string[] | undefined;
63
62
  /**accessor*/
64
63
  set elem_classes(_: string[] | undefined);
65
- get visible(): boolean | undefined;
64
+ get visible(): boolean | "hidden" | undefined;
66
65
  /**accessor*/
67
- set visible(_: boolean | undefined);
68
- get value(): [FileData | null, FileData | null] | undefined;
66
+ set visible(_: boolean | "hidden" | undefined);
67
+ get value(): [any, any] | undefined;
69
68
  /**accessor*/
70
- set value(_: [FileData | null, FileData | null] | undefined);
69
+ set value(_: [any, any] | undefined);
71
70
  get label(): string;
72
71
  /**accessor*/
73
72
  set label(_: string);
74
73
  get show_label(): boolean;
75
74
  /**accessor*/
76
75
  set show_label(_: boolean);
77
- get show_download_button(): boolean;
76
+ get buttons(): string[] | null | undefined;
78
77
  /**accessor*/
79
- set show_download_button(_: boolean);
78
+ set buttons(_: string[] | null | undefined);
80
79
  get root(): string;
81
80
  /**accessor*/
82
81
  set root(_: string);
@@ -104,9 +103,6 @@ export default class Index extends SvelteComponent<IndexProps, IndexEvents, Inde
104
103
  get placeholder(): string | undefined;
105
104
  /**accessor*/
106
105
  set placeholder(_: string | undefined);
107
- get show_fullscreen_button(): boolean;
108
- /**accessor*/
109
- set show_fullscreen_button(_: boolean);
110
106
  get input_ready(): boolean;
111
107
  /**accessor*/
112
108
  set input_ready(_: boolean);
@@ -1,13 +1,12 @@
1
1
  <script>import Slider from "./Slider.svelte";
2
2
  import { createEventDispatcher, tick } from "svelte";
3
- import { BlockLabel, Empty, IconButton } from "@gradio/atoms";
3
+ import { BlockLabel, Empty, IconButton, DownloadLink } from "@gradio/atoms";
4
4
  import { Download } from "@gradio/icons";
5
5
  import { Image } from "@gradio/icons";
6
6
  import {} from "@gradio/utils";
7
7
  import ClearImage from "./ClearImage.svelte";
8
8
  import ImageEl from "./ImageEl.svelte";
9
9
  import { Upload } from "@gradio/upload";
10
- import { DownloadLink } from "@gradio/wasm/svelte";
11
10
  import {} from "@gradio/client";
12
11
  export let value;
13
12
  export let label = void 0;
@@ -24,7 +24,7 @@ declare const __propDef: {
24
24
  edit: CustomEvent<undefined>;
25
25
  clear: CustomEvent<undefined>;
26
26
  drag: CustomEvent<boolean>;
27
- upload: CustomEvent<[FileData | null, FileData | null]>;
27
+ upload: CustomEvent<[any, any]>;
28
28
  select: CustomEvent<SelectData>;
29
29
  } & {
30
30
  [evt: string]: CustomEvent<any>;
@@ -1,25 +1,12 @@
1
1
  <script>import { createEventDispatcher, onMount, tick } from "svelte";
2
- import { resolve_wasm_src } from "@gradio/wasm/svelte";
3
2
  export let src = void 0;
4
3
  export let fullscreen = false;
5
- let resolved_src;
6
4
  export let fixed = false;
7
5
  export let transform = "translate(0px, 0px) scale(1)";
8
6
  export let img_el = null;
9
7
  export let hidden = false;
10
8
  export let variant = "upload";
11
9
  export let max_height = 500;
12
- let latest_src;
13
- $: {
14
- resolved_src = src;
15
- latest_src = src;
16
- const resolving_src = src;
17
- resolve_wasm_src(resolving_src).then((s) => {
18
- if (latest_src === resolving_src) {
19
- resolved_src = s;
20
- }
21
- });
22
- }
23
10
  const dispatch = createEventDispatcher();
24
11
  function get_image_size(img) {
25
12
  if (!img) return { top: 0, left: 0, width: 0, height: 0 };
@@ -60,7 +47,7 @@ onMount(() => {
60
47
 
61
48
  <!-- svelte-ignore a11y-missing-attribute -->
62
49
  <img
63
- src={resolved_src}
50
+ {src}
64
51
  {...$$restProps}
65
52
  class:fixed
66
53
  style:transform
@@ -5,11 +5,11 @@ import {
5
5
  Empty,
6
6
  IconButton,
7
7
  IconButtonWrapper,
8
- FullscreenButton
8
+ FullscreenButton,
9
+ DownloadLink
9
10
  } from "@gradio/atoms";
10
11
  import { Image, Download, Undo, Clear } from "@gradio/icons";
11
12
  import {} from "@gradio/client";
12
- import { DownloadLink } from "@gradio/wasm/svelte";
13
13
  import { ZoomableImage } from "./zoom";
14
14
  import { onMount } from "svelte";
15
15
  import { tweened } from "svelte/motion";
@@ -20,7 +20,7 @@ declare const __propDef: {
20
20
  edit: CustomEvent<undefined>;
21
21
  clear: CustomEvent<undefined>;
22
22
  stream: CustomEvent<string | null>;
23
- upload: CustomEvent<[FileData | null, FileData | null]>;
23
+ upload: CustomEvent<[any, any]>;
24
24
  select: CustomEvent<import("@gradio/utils").SelectData>;
25
25
  share: CustomEvent<any>;
26
26
  } & {
@@ -36,15 +36,15 @@ export type SliderUploadProps = typeof __propDef.props;
36
36
  export type SliderUploadEvents = typeof __propDef.events;
37
37
  export type SliderUploadSlots = typeof __propDef.slots;
38
38
  export default class SliderUpload extends SvelteComponent<SliderUploadProps, SliderUploadEvents, SliderUploadSlots> {
39
- get value(): [FileData | null, FileData | null] | undefined;
39
+ get value(): [any, any] | undefined;
40
40
  /**accessor*/
41
- set value(_: [FileData | null, FileData | null] | undefined);
42
- get upload(): (file_data: FileData[], root_url: string, upload_id?: string, max_file_size?: number) => Promise<(FileData | null)[] | null>;
41
+ set value(_: [any, any] | undefined);
42
+ get upload(): Client;
43
43
  /**accessor*/
44
- set upload(_: (file_data: FileData[], root_url: string, upload_id?: string, max_file_size?: number) => Promise<(FileData | null)[] | null>);
45
- get stream_handler(): (url: URL) => EventSource;
44
+ set upload(_: Client);
45
+ get stream_handler(): Client;
46
46
  /**accessor*/
47
- set stream_handler(_: (url: URL) => EventSource);
47
+ set stream_handler(_: Client);
48
48
  get label(): string;
49
49
  /**accessor*/
50
50
  set label(_: string);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/imageslider",
3
- "version": "0.2.14",
3
+ "version": "0.3.1-dev.0",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -11,13 +11,12 @@
11
11
  "@types/d3-selection": "^3.0.11",
12
12
  "d3-drag": "^3.0.0",
13
13
  "d3-selection": "^3.0.0",
14
- "@gradio/atoms": "^0.17.0",
15
- "@gradio/client": "^1.18.0",
14
+ "@gradio/atoms": "^0.18.1",
15
+ "@gradio/client": "^2.0.0-dev.0",
16
16
  "@gradio/icons": "^0.14.0",
17
- "@gradio/statustracker": "^0.11.0",
18
- "@gradio/utils": "^0.10.2",
19
- "@gradio/upload": "^0.16.17",
20
- "@gradio/wasm": "^0.18.1"
17
+ "@gradio/statustracker": "^0.11.1",
18
+ "@gradio/upload": "^0.17.2-dev.0",
19
+ "@gradio/utils": "^0.10.2"
21
20
  },
22
21
  "exports": {
23
22
  ".": {
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import Slider from "./Slider.svelte";
3
3
  import { createEventDispatcher, tick } from "svelte";
4
- import { BlockLabel, Empty, IconButton } from "@gradio/atoms";
4
+ import { BlockLabel, Empty, IconButton, DownloadLink } from "@gradio/atoms";
5
5
  import { Download } from "@gradio/icons";
6
6
  import { Image } from "@gradio/icons";
7
7
  import { type SelectData, type I18nFormatter } from "@gradio/utils";
@@ -9,7 +9,6 @@
9
9
  import ImageEl from "./ImageEl.svelte";
10
10
 
11
11
  import { Upload } from "@gradio/upload";
12
- import { DownloadLink } from "@gradio/wasm/svelte";
13
12
 
14
13
  import { type FileData, type Client } from "@gradio/client";
15
14
 
@@ -13,39 +13,15 @@
13
13
  }
14
14
  type $$Props = Props;
15
15
 
16
- import { resolve_wasm_src } from "@gradio/wasm/svelte";
17
-
18
16
  export let src: HTMLImgAttributes["src"] = undefined;
19
17
  export let fullscreen = false;
20
18
 
21
- let resolved_src: typeof src;
22
-
23
19
  export let fixed = false;
24
20
  export let transform = "translate(0px, 0px) scale(1)";
25
21
  export let img_el: HTMLImageElement | null = null;
26
22
  export let hidden = false;
27
23
  export let variant = "upload";
28
24
  export let max_height = 500;
29
- // The `src` prop can be updated before the Promise from `resolve_wasm_src` is resolved.
30
- // In such a case, the resolved value for the old `src` has to be discarded,
31
- // This variable `latest_src` is used to pick up only the value resolved for the latest `src` prop.
32
- let latest_src: typeof src;
33
- $: {
34
- // In normal (non-Wasm) Gradio, the `<img>` element should be rendered with the passed `src` props immediately
35
- // without waiting for `resolve_wasm_src()` to resolve.
36
- // If it waits, a blank image is displayed until the async task finishes
37
- // and it leads to undesirable flickering.
38
- // So set `src` to `resolved_src` here.
39
- resolved_src = src;
40
-
41
- latest_src = src;
42
- const resolving_src = src;
43
- resolve_wasm_src(resolving_src).then((s) => {
44
- if (latest_src === resolving_src) {
45
- resolved_src = s;
46
- }
47
- });
48
- }
49
25
 
50
26
  const dispatch = createEventDispatcher<{
51
27
  load: {
@@ -108,7 +84,7 @@
108
84
 
109
85
  <!-- svelte-ignore a11y-missing-attribute -->
110
86
  <img
111
- src={resolved_src}
87
+ {src}
112
88
  {...$$restProps}
113
89
  class:fixed
114
90
  style:transform
@@ -6,12 +6,12 @@
6
6
  Empty,
7
7
  IconButton,
8
8
  IconButtonWrapper,
9
- FullscreenButton
9
+ FullscreenButton,
10
+ DownloadLink
10
11
  } from "@gradio/atoms";
11
12
  import { Image, Download, Undo, Clear } from "@gradio/icons";
12
13
  import { type FileData } from "@gradio/client";
13
14
  import type { I18nFormatter } from "@gradio/utils";
14
- import { DownloadLink } from "@gradio/wasm/svelte";
15
15
  import { ZoomableImage } from "./zoom";
16
16
  import { onMount } from "svelte";
17
17
  import { tweened, type Tweened } from "svelte/motion";