From 4e5410574002ea24067cf4e82b99a6a39f67632c Mon Sep 17 00:00:00 2001 From: "Yuichiro Tachibana (Tsuchiya)" Date: Fri, 27 Sep 2024 07:13:24 +0900 Subject: [PATCH] Refactoring playground (#9426) * Use @gradio/code.BaseCode instead of its default export like https://github.com/gradio-app/gradio/pull/8804 * Delete unused code * add changeset * Fix * Rename a variable to be descriptive * Mount single instance instead of creating one for each demo * Fix the initial value passed to createGradioApp * Use const instead of let * Rename variable * Update * Fix layout * Restore the preset requirements * Delete unused variable * Add type hint * Attach the keydown handler directly to the input element instead of the window object * Add code editor widget --------- Co-authored-by: gradio-pr-bot --- .changeset/silly-chefs-marry.md | 5 ++ .../src/lib/components/DemosLite.svelte | 88 +++++++------------ .../src/routes/playground/+page.svelte | 29 +----- 3 files changed, 41 insertions(+), 81 deletions(-) create mode 100644 .changeset/silly-chefs-marry.md diff --git a/.changeset/silly-chefs-marry.md b/.changeset/silly-chefs-marry.md new file mode 100644 index 000000000000..dcfe46568601 --- /dev/null +++ b/.changeset/silly-chefs-marry.md @@ -0,0 +1,5 @@ +--- +"website": minor +--- + +feat:Refactoring playground diff --git a/js/_website/src/lib/components/DemosLite.svelte b/js/_website/src/lib/components/DemosLite.svelte index f77f6f5ed1b4..722cbd311bc5 100644 --- a/js/_website/src/lib/components/DemosLite.svelte +++ b/js/_website/src/lib/components/DemosLite.svelte @@ -1,5 +1,5 @@ @@ -253,12 +246,10 @@ {#if !show_preview} {:else} @@ -295,9 +286,6 @@ {/if}