gradio-pr-bot commited on
Commit
84fcf01
·
verified ·
1 Parent(s): cf36f01

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
- export let docs: Record<string, Param>;
18
- export let lang: "python" | "typescript" = "python";
19
- export let linkify: string[] = [];
20
- export let header: string | null;
21
- export let anchor_links: string | boolean = false;
22
- export let max_height: number | string | undefined = undefined;
 
 
 
 
 
 
 
23
 
24
  let component_root: HTMLElement;
25
- let _docs: Param[];
26
- let all_open = false;
27
 
28
- $: _docs = highlight_code(docs, lang);
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
- {#if header !== null}
139
- <div class="header">
140
  <span class="title">{header}</span>
141
- <button
142
- class="toggle-all"
143
- on:click={toggle_all}
144
- title={all_open ? "Close All" : "Open All"}
145
- >
146
-
147
- </button>
148
- </div>
149
- {/if}
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.1",
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": "",