Upload folder using huggingface_hub
Browse files
6.3.1/markdown/Index.svelte
CHANGED
|
@@ -45,8 +45,8 @@
|
|
| 45 |
elem_classes={gradio.shared.elem_classes}
|
| 46 |
visible={gradio.shared.visible}
|
| 47 |
rtl={gradio.props.rtl}
|
| 48 |
-
|
| 49 |
-
|
| 50 |
latex_delimiters={gradio.props.latex_delimiters}
|
| 51 |
sanitize_html={gradio.props.sanitize_html}
|
| 52 |
line_breaks={gradio.props.line_breaks}
|
|
|
|
| 45 |
elem_classes={gradio.shared.elem_classes}
|
| 46 |
visible={gradio.shared.visible}
|
| 47 |
rtl={gradio.props.rtl}
|
| 48 |
+
onchange={() => gradio.dispatch("change")}
|
| 49 |
+
oncopy={(e) => gradio.dispatch("copy", e.detail)}
|
| 50 |
latex_delimiters={gradio.props.latex_delimiters}
|
| 51 |
sanitize_html={gradio.props.sanitize_html}
|
| 52 |
line_breaks={gradio.props.line_breaks}
|
6.3.1/markdown/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "@gradio/markdown",
|
| 3 |
-
"version": "0.13.
|
| 4 |
"description": "Gradio UI packages",
|
| 5 |
"type": "module",
|
| 6 |
"author": "",
|
|
|
|
| 1 |
{
|
| 2 |
"name": "@gradio/markdown",
|
| 3 |
+
"version": "0.13.26",
|
| 4 |
"description": "Gradio UI packages",
|
| 5 |
"type": "module",
|
| 6 |
"author": "",
|
6.3.1/markdown/shared/Markdown.svelte
CHANGED
|
@@ -1,7 +1,5 @@
|
|
| 1 |
<script lang="ts">
|
| 2 |
-
import { createEventDispatcher } from "svelte";
|
| 3 |
import { copy, css_units } from "@gradio/utils";
|
| 4 |
-
import type { CopyData } from "@gradio/utils";
|
| 5 |
import { Copy, Check } from "@gradio/icons";
|
| 6 |
import type { LoadingStatus } from "@gradio/statustracker";
|
| 7 |
import { IconButton, IconButtonWrapper } from "@gradio/atoms";
|
|
@@ -9,37 +7,57 @@
|
|
| 9 |
|
| 10 |
import { MarkdownCode } from "@gradio/markdown-code";
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
copy: CopyData;
|
| 35 |
-
}>();
|
| 36 |
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
async function handle_copy(): Promise<void> {
|
| 40 |
if ("clipboard" in navigator) {
|
| 41 |
await navigator.clipboard.writeText(value);
|
| 42 |
-
|
| 43 |
copy_feedback();
|
| 44 |
}
|
| 45 |
}
|
|
|
|
| 1 |
<script lang="ts">
|
|
|
|
| 2 |
import { copy, css_units } from "@gradio/utils";
|
|
|
|
| 3 |
import { Copy, Check } from "@gradio/icons";
|
| 4 |
import type { LoadingStatus } from "@gradio/statustracker";
|
| 5 |
import { IconButton, IconButtonWrapper } from "@gradio/atoms";
|
|
|
|
| 7 |
|
| 8 |
import { MarkdownCode } from "@gradio/markdown-code";
|
| 9 |
|
| 10 |
+
let {
|
| 11 |
+
elem_classes = [],
|
| 12 |
+
visible = true,
|
| 13 |
+
value,
|
| 14 |
+
min_height = undefined,
|
| 15 |
+
rtl = false,
|
| 16 |
+
sanitize_html = true,
|
| 17 |
+
line_breaks = false,
|
| 18 |
+
latex_delimiters = [],
|
| 19 |
+
header_links = false,
|
| 20 |
+
height = undefined,
|
| 21 |
+
show_copy_button = false,
|
| 22 |
+
loading_status = undefined,
|
| 23 |
+
theme_mode,
|
| 24 |
+
onchange = () => {},
|
| 25 |
+
oncopy = (val) => {}
|
| 26 |
+
}: {
|
| 27 |
+
elem_classes: string[];
|
| 28 |
+
visible: boolean | "hidden";
|
| 29 |
+
value: string;
|
| 30 |
+
min_height: number | string | undefined;
|
| 31 |
+
rtl: boolean;
|
| 32 |
+
sanitize_html: boolean;
|
| 33 |
+
line_breaks: boolean;
|
| 34 |
+
latex_delimiters: {
|
| 35 |
+
left: string;
|
| 36 |
+
right: string;
|
| 37 |
+
display: boolean;
|
| 38 |
+
}[];
|
| 39 |
+
header_links: boolean;
|
| 40 |
+
height: number | string | undefined;
|
| 41 |
+
show_copy_button: boolean | undefined;
|
| 42 |
+
loading_status: LoadingStatus | undefined;
|
| 43 |
+
theme_mode: ThemeMode;
|
| 44 |
+
onchange: () => void;
|
| 45 |
+
oncopy: (val: any) => void;
|
| 46 |
+
} = $props();
|
| 47 |
|
| 48 |
+
let copied = $state(false);
|
| 49 |
+
let timer: NodeJS.Timeout;
|
|
|
|
|
|
|
| 50 |
|
| 51 |
+
$effect(() => {
|
| 52 |
+
if (value) {
|
| 53 |
+
onchange();
|
| 54 |
+
}
|
| 55 |
+
});
|
| 56 |
|
| 57 |
async function handle_copy(): Promise<void> {
|
| 58 |
if ("clipboard" in navigator) {
|
| 59 |
await navigator.clipboard.writeText(value);
|
| 60 |
+
oncopy({ value: value });
|
| 61 |
copy_feedback();
|
| 62 |
}
|
| 63 |
}
|