Upload folder using huggingface_hub
Browse files
6.3.1/paramviewer/ParamViewer.svelte
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
import "prismjs/components/prism-python";
|
| 6 |
import "prismjs/components/prism-typescript";
|
| 7 |
|
| 8 |
-
import { onMount } from "svelte";
|
| 9 |
|
| 10 |
interface Param {
|
| 11 |
type: string | null;
|
|
@@ -14,18 +14,25 @@
|
|
| 14 |
name?: string;
|
| 15 |
}
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
let component_root: HTMLElement;
|
| 25 |
-
let
|
| 26 |
-
let
|
| 27 |
|
| 28 |
-
|
| 29 |
|
| 30 |
function create_slug(name: string, anchor_links: string | boolean): string {
|
| 31 |
let prefix = "param-";
|
|
@@ -135,18 +142,18 @@
|
|
| 135 |
bind:this={component_root}
|
| 136 |
style:max-height={get_dimension(max_height)}
|
| 137 |
>
|
| 138 |
-
|
| 139 |
-
|
| 140 |
<span class="title">{header}</span>
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
</
|
| 149 |
-
|
| 150 |
{#if _docs}
|
| 151 |
<div class="param-content">
|
| 152 |
{#each _docs as { type, description, default: _default, name } (name)}
|
|
|
|
| 5 |
import "prismjs/components/prism-python";
|
| 6 |
import "prismjs/components/prism-typescript";
|
| 7 |
|
| 8 |
+
import { onMount, tick } from "svelte";
|
| 9 |
|
| 10 |
interface Param {
|
| 11 |
type: string | null;
|
|
|
|
| 14 |
name?: string;
|
| 15 |
}
|
| 16 |
|
| 17 |
+
let {
|
| 18 |
+
docs,
|
| 19 |
+
linkify = [],
|
| 20 |
+
header,
|
| 21 |
+
anchor_links,
|
| 22 |
+
max_height
|
| 23 |
+
}: {
|
| 24 |
+
docs: Record<string, Param>;
|
| 25 |
+
linkify: string[];
|
| 26 |
+
header: string | null;
|
| 27 |
+
anchor_links: string | boolean;
|
| 28 |
+
max_height: number | string | undefined;
|
| 29 |
+
} = $props();
|
| 30 |
|
| 31 |
let component_root: HTMLElement;
|
| 32 |
+
let all_open = $state(false);
|
| 33 |
+
let lang: string = "python";
|
| 34 |
|
| 35 |
+
let _docs = $derived(highlight_code(docs, lang));
|
| 36 |
|
| 37 |
function create_slug(name: string, anchor_links: string | boolean): string {
|
| 38 |
let prefix = "param-";
|
|
|
|
| 142 |
bind:this={component_root}
|
| 143 |
style:max-height={get_dimension(max_height)}
|
| 144 |
>
|
| 145 |
+
<div class="header">
|
| 146 |
+
{#if header !== null}
|
| 147 |
<span class="title">{header}</span>
|
| 148 |
+
{/if}
|
| 149 |
+
<button
|
| 150 |
+
class="toggle-all"
|
| 151 |
+
on:click={toggle_all}
|
| 152 |
+
title={all_open ? "Close All" : "Open All"}
|
| 153 |
+
>
|
| 154 |
+
{all_open ? "▲" : "▼"}
|
| 155 |
+
</button>
|
| 156 |
+
</div>
|
| 157 |
{#if _docs}
|
| 158 |
<div class="param-content">
|
| 159 |
{#each _docs as { type, description, default: _default, name } (name)}
|
6.3.1/paramviewer/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "@gradio/paramviewer",
|
| 3 |
-
"version": "0.9.
|
| 4 |
"description": "Gradio UI packages",
|
| 5 |
"type": "module",
|
| 6 |
"author": "",
|
|
|
|
| 1 |
{
|
| 2 |
"name": "@gradio/paramviewer",
|
| 3 |
+
"version": "0.9.2",
|
| 4 |
"description": "Gradio UI packages",
|
| 5 |
"type": "module",
|
| 6 |
"author": "",
|