gradio-pr-bot commited on
Commit
e345c8e
·
verified ·
1 Parent(s): 40a2ca6

Upload folder using huggingface_hub

Browse files
6.2.0/html/Index.svelte CHANGED
@@ -7,7 +7,7 @@
7
  import { Gradio } from "@gradio/utils";
8
  import HTML from "./shared/HTML.svelte";
9
  import { StatusTracker } from "@gradio/statustracker";
10
- import { Block, BlockLabel } from "@gradio/atoms";
11
  import { Code as CodeIcon } from "@gradio/icons";
12
  import { css_units } from "@gradio/utils";
13
  import type { HTMLProps, HTMLEvents } from "./types.ts";
@@ -39,6 +39,14 @@
39
  padding={true}
40
  overflow_behavior="visible"
41
  >
 
 
 
 
 
 
 
 
42
  {#if gradio.shared.show_label}
43
  <BlockLabel
44
  Icon={CodeIcon}
 
7
  import { Gradio } from "@gradio/utils";
8
  import HTML from "./shared/HTML.svelte";
9
  import { StatusTracker } from "@gradio/statustracker";
10
+ import { Block, BlockLabel, IconButtonWrapper } from "@gradio/atoms";
11
  import { Code as CodeIcon } from "@gradio/icons";
12
  import { css_units } from "@gradio/utils";
13
  import type { HTMLProps, HTMLEvents } from "./types.ts";
 
39
  padding={true}
40
  overflow_behavior="visible"
41
  >
42
+ {#if gradio.shared.show_label && gradio.props.buttons && gradio.props.buttons.length > 0}
43
+ <IconButtonWrapper
44
+ buttons={gradio.props.buttons}
45
+ on_custom_button_click={(id) => {
46
+ gradio.dispatch("custom_button_click", { id });
47
+ }}
48
+ />
49
+ {/if}
50
  {#if gradio.shared.show_label}
51
  <BlockLabel
52
  Icon={CodeIcon}
6.2.0/html/package.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "@gradio/html",
3
- "version": "0.8.1",
4
  "description": "Gradio UI packages",
5
  "type": "module",
6
  "author": "",
 
1
  {
2
  "name": "@gradio/html",
3
+ "version": "0.9.0",
4
  "description": "Gradio UI packages",
5
  "type": "module",
6
  "author": "",
6.2.0/html/types.ts CHANGED
@@ -1,3 +1,5 @@
 
 
1
  export interface HTMLProps {
2
  value: string;
3
  html_template: string;
@@ -9,10 +11,12 @@ export interface HTMLProps {
9
  max_height: number | undefined;
10
  props: Record<string, any>;
11
  component_class_name: string;
 
12
  }
13
 
14
  export interface HTMLEvents {
15
  change: never;
16
  click: never;
17
  submit: never;
 
18
  }
 
1
+ import type { CustomButton } from "@gradio/utils";
2
+
3
  export interface HTMLProps {
4
  value: string;
5
  html_template: string;
 
11
  max_height: number | undefined;
12
  props: Record<string, any>;
13
  component_class_name: string;
14
+ buttons: (string | CustomButton)[] | null;
15
  }
16
 
17
  export interface HTMLEvents {
18
  change: never;
19
  click: never;
20
  submit: never;
21
+ custom_button_click: { id: number };
22
  }