Merge branch 'update-demos' of github.com:gradio-app/gradio into update-demos

This commit is contained in:
Abubakar Abid 2022-03-22 15:49:07 -07:00
commit 6003122e0e

View File

@ -2,6 +2,7 @@
import { deepCopy } from "./components/utils/helpers"; import { deepCopy } from "./components/utils/helpers";
import ExampleSet from "./ExampleSet.svelte"; import ExampleSet from "./ExampleSet.svelte";
import { _ } from "svelte-i18n"; import { _ } from "svelte-i18n";
import { component_map } from "./components/directory";
interface Component { interface Component {
name: string; name: string;
@ -58,7 +59,7 @@
const setExampleId = async (example_id: number) => { const setExampleId = async (example_id: number) => {
input_components.forEach(async (input_component, i) => { input_components.forEach(async (input_component, i) => {
const process_example = const process_example =
input_component_map[input_component.name].process_example; component_map[input_component.name].process_example;
if (process_example !== undefined) { if (process_example !== undefined) {
input_values[i] = await process_example( input_values[i] = await process_example(
examples[example_id][i], examples[example_id][i],
@ -212,7 +213,7 @@
&nbsp;<em>(optional)</em>{/if} &nbsp;<em>(optional)</em>{/if}
</div> </div>
<svelte:component <svelte:component
this={input_component_map[input_component.name][ this={component_map[input_component.name][
interpret_mode ? "interpretation" : "component" interpret_mode ? "interpretation" : "component"
]} ]}
{...input_component} {...input_component}
@ -287,7 +288,7 @@
<div class="component"> <div class="component">
<div class="panel-header mb-1.5">{output_component.label}</div> <div class="panel-header mb-1.5">{output_component.label}</div>
<svelte:component <svelte:component
this={output_component_map[output_component.name].component} this={component_map[output_component.name].component}
{...output_component} {...output_component}
{theme} {theme}
{static_src} {static_src}