@gradio/button 0.2.22 → 0.2.23

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.
@@ -65,7 +65,10 @@
65
65
  <Story
66
66
  name="Button with external image icon"
67
67
  args={{
68
- icon: "https://huggingface.co/front/assets/huggingface_logo-noborder.svg"
68
+ icon: {
69
+ url: "https://huggingface.co/front/assets/huggingface_logo-noborder.svg",
70
+ path: "https://huggingface.co/front/assets/huggingface_logo-noborder.svg"
71
+ }
69
72
  }}
70
73
  />
71
74
  <Story
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @gradio/button
2
2
 
3
+ ## 0.2.23
4
+
5
+ ### Features
6
+
7
+ - [#7528](https://github.com/gradio-app/gradio/pull/7528) [`eda33b3`](https://github.com/gradio-app/gradio/commit/eda33b3763897a542acf298e523fa493dc655aee) - Refactors `get_fetchable_url_or_file()` to remove it from the frontend. Thanks [@abidlabs](https://github.com/abidlabs)!
8
+
3
9
  ## 0.2.22
4
10
 
5
11
  ### Patch Changes
@@ -280,4 +286,4 @@ Thanks [@pngwn](https://github.com/pngwn)!
280
286
  ### Patch Changes
281
287
 
282
288
  - Updated dependencies []:
283
- - @gradio/utils@0.0.2
289
+ - @gradio/utils@0.0.2
package/Index.svelte CHANGED
@@ -3,7 +3,8 @@
3
3
  </script>
4
4
 
5
5
  <script lang="ts">
6
- import type { Gradio, ShareData } from "@gradio/utils";
6
+ import type { Gradio } from "@gradio/utils";
7
+ import { type FileData } from "@gradio/client";
7
8
 
8
9
  import Button from "./shared/Button.svelte";
9
10
 
@@ -15,14 +16,12 @@
15
16
  export let interactive: boolean;
16
17
  export let size: "sm" | "lg" = "lg";
17
18
  export let scale: number | null = null;
18
- export let icon: string | null = null;
19
+ export let icon: FileData | null = null;
19
20
  export let link: string | null = null;
20
21
  export let min_width: number | undefined = undefined;
21
22
  export let gradio: Gradio<{
22
23
  click: never;
23
24
  }>;
24
- export let root = "";
25
- export let proxy_url: null | string = null;
26
25
  </script>
27
26
 
28
27
  <Button
@@ -36,8 +35,6 @@
36
35
  {icon}
37
36
  {min_width}
38
37
  {visible}
39
- {root}
40
- {proxy_url}
41
38
  disabled={!interactive}
42
39
  on:click={() => gradio.dispatch("click")}
43
40
  >
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@gradio/button",
3
- "version": "0.2.22",
3
+ "version": "0.2.23",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
7
7
  "license": "ISC",
8
8
  "private": false,
9
9
  "dependencies": {
10
- "@gradio/client": "^0.12.1",
10
+ "@gradio/client": "^0.12.2",
11
11
  "@gradio/utils": "^0.3.0",
12
- "@gradio/upload": "^0.7.4"
12
+ "@gradio/upload": "^0.7.5"
13
13
  },
14
14
  "main": "./Index.svelte",
15
15
  "main_changeset": true,
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { get_fetchable_url_or_file } from "@gradio/client";
2
+ import { type FileData } from "@gradio/client";
3
3
 
4
4
  export let elem_id = "";
5
5
  export let elem_classes: string[] = [];
@@ -8,13 +8,10 @@
8
8
  export let size: "sm" | "lg" = "lg";
9
9
  export let value: string | null = null;
10
10
  export let link: string | null = null;
11
- export let icon: string | null = null;
11
+ export let icon: FileData | null = null;
12
12
  export let disabled = false;
13
13
  export let scale: number | null = null;
14
14
  export let min_width: number | undefined = undefined;
15
- export let root = "";
16
- export let proxy_url: string | null = null;
17
- $: icon_path = get_fetchable_url_or_file(icon, root, proxy_url);
18
15
  </script>
19
16
 
20
17
  {#if link && link.length > 0}
@@ -34,7 +31,7 @@
34
31
  id={elem_id}
35
32
  >
36
33
  {#if icon}
37
- <img class="button-icon" src={icon_path} alt={`${value} icon`} />
34
+ <img class="button-icon" src={icon.url} alt={`${value} icon`} />
38
35
  {/if}
39
36
  <slot />
40
37
  </a>
@@ -52,7 +49,7 @@
52
49
  {disabled}
53
50
  >
54
51
  {#if icon}
55
- <img class="button-icon" src={icon_path} alt={`${value} icon`} />
52
+ <img class="button-icon" src={icon.url} alt={`${value} icon`} />
56
53
  {/if}
57
54
  <slot />
58
55
  </button>