Upload folder using huggingface_hub
Browse files
6.2.0/highlightedtext/Index.svelte
CHANGED
|
@@ -6,7 +6,7 @@
|
|
| 6 |
<script lang="ts">
|
| 7 |
import StaticHighlightedText from "./shared/StaticHighlightedtext.svelte";
|
| 8 |
import InteractiveHighlightedText from "./shared/InteractiveHighlightedtext.svelte";
|
| 9 |
-
import { Block, BlockLabel, Empty } from "@gradio/atoms";
|
| 10 |
import { TextHighlight } from "@gradio/icons";
|
| 11 |
import { StatusTracker } from "@gradio/statustracker";
|
| 12 |
import { Gradio } from "@gradio/utils";
|
|
@@ -98,6 +98,14 @@
|
|
| 98 |
on_clear_status={() =>
|
| 99 |
gradio.dispatch("clear_status", gradio.shared.loading_status)}
|
| 100 |
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
{#if gradio.shared.label && gradio.shared.show_label}
|
| 102 |
<BlockLabel
|
| 103 |
Icon={TextHighlight}
|
|
|
|
| 6 |
<script lang="ts">
|
| 7 |
import StaticHighlightedText from "./shared/StaticHighlightedtext.svelte";
|
| 8 |
import InteractiveHighlightedText from "./shared/InteractiveHighlightedtext.svelte";
|
| 9 |
+
import { Block, BlockLabel, Empty, IconButtonWrapper } from "@gradio/atoms";
|
| 10 |
import { TextHighlight } from "@gradio/icons";
|
| 11 |
import { StatusTracker } from "@gradio/statustracker";
|
| 12 |
import { Gradio } from "@gradio/utils";
|
|
|
|
| 98 |
on_clear_status={() =>
|
| 99 |
gradio.dispatch("clear_status", gradio.shared.loading_status)}
|
| 100 |
/>
|
| 101 |
+
{#if gradio.shared.label && gradio.shared.show_label && gradio.props.buttons && gradio.props.buttons.length > 0}
|
| 102 |
+
<IconButtonWrapper
|
| 103 |
+
buttons={gradio.props.buttons}
|
| 104 |
+
on_custom_button_click={(id) => {
|
| 105 |
+
gradio.dispatch("custom_button_click", { id });
|
| 106 |
+
}}
|
| 107 |
+
/>
|
| 108 |
+
{/if}
|
| 109 |
{#if gradio.shared.label && gradio.shared.show_label}
|
| 110 |
<BlockLabel
|
| 111 |
Icon={TextHighlight}
|
6.2.0/highlightedtext/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "@gradio/highlightedtext",
|
| 3 |
-
"version": "0.
|
| 4 |
"description": "Gradio UI packages",
|
| 5 |
"type": "module",
|
| 6 |
"author": "",
|
|
|
|
| 1 |
{
|
| 2 |
"name": "@gradio/highlightedtext",
|
| 3 |
+
"version": "0.10.0",
|
| 4 |
"description": "Gradio UI packages",
|
| 5 |
"type": "module",
|
| 6 |
"author": "",
|
6.2.0/highlightedtext/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import type { SelectData } from "@gradio/utils";
|
| 2 |
import type { LoadingStatus } from "js/statustracker";
|
| 3 |
|
| 4 |
export interface HighlightedToken {
|
|
@@ -13,10 +13,12 @@ export interface HighlightedTextProps {
|
|
| 13 |
color_map: Record<string, string>;
|
| 14 |
combine_adjacent: boolean;
|
| 15 |
rtl: boolean;
|
|
|
|
| 16 |
}
|
| 17 |
|
| 18 |
export interface HighlightedTextEvents {
|
| 19 |
change: never;
|
| 20 |
select: SelectData;
|
| 21 |
clear_status: LoadingStatus;
|
|
|
|
| 22 |
}
|
|
|
|
| 1 |
+
import type { SelectData, CustomButton } from "@gradio/utils";
|
| 2 |
import type { LoadingStatus } from "js/statustracker";
|
| 3 |
|
| 4 |
export interface HighlightedToken {
|
|
|
|
| 13 |
color_map: Record<string, string>;
|
| 14 |
combine_adjacent: boolean;
|
| 15 |
rtl: boolean;
|
| 16 |
+
buttons: (string | CustomButton)[] | null;
|
| 17 |
}
|
| 18 |
|
| 19 |
export interface HighlightedTextEvents {
|
| 20 |
change: never;
|
| 21 |
select: SelectData;
|
| 22 |
clear_status: LoadingStatus;
|
| 23 |
+
custom_button_click: { id: number };
|
| 24 |
}
|