diff --git a/demo/kitchen_sink/run.py b/demo/kitchen_sink/run.py index 3f3ce3f34a..bc9a599175 100755 --- a/demo/kitchen_sink/run.py +++ b/demo/kitchen_sink/run.py @@ -61,7 +61,7 @@ iface = gr.Interface( gr.outputs.Audio(label="Audio"), gr.outputs.Image(label="Image"), gr.outputs.Video(label="Video"), - gr.outputs.HighlightedText(label="HighlightedText"), + gr.outputs.HighlightedText(label="HighlightedText", color_map={"punc": "pink", "test 0": "blue"}), gr.outputs.HighlightedText(label="HighlightedText", show_legend=True), gr.outputs.JSON(label="JSON"), gr.outputs.HTML(label="HTML"), diff --git a/frontend-svelte/package-lock.json b/frontend-svelte/package-lock.json index 01dc1fc6cb..9a5e45f270 100644 --- a/frontend-svelte/package-lock.json +++ b/frontend-svelte/package-lock.json @@ -20,6 +20,7 @@ "@rollup/plugin-commonjs": "^17.0.0", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^11.0.0", + "mime-types": "^2.1.34", "postcss": "^8.4.5", "postcss-nested": "^5.0.6", "rollup": "^2.3.4", diff --git a/frontend-svelte/src/components/directory.js b/frontend-svelte/src/components/directory.js index d2a79455d5..6f602c3111 100644 --- a/frontend-svelte/src/components/directory.js +++ b/frontend-svelte/src/components/directory.js @@ -1,5 +1,9 @@ +import InputTextbox from "./input/Textbox.svelte"; import InputNumber from "./input/Number.svelte"; import InputRadio from "./input/Radio.svelte"; +import InputSlider from "./input/Slider.svelte"; +import InputCheckbox from "./input/Checkbox.svelte"; +import InputCheckboxGroup from "./input/CheckboxGroup.svelte"; import InputAudio from "./input/Audio.svelte"; import InputFile from "./input/File.svelte"; import InputImage from "./input/Image.svelte"; @@ -11,6 +15,8 @@ import OutputCarousel from "./output/Carousel.svelte"; import OutputImage from "./output/Image.svelte"; import OutputVideo from "./output/Video.svelte"; import OutputAudio from "./output/Audio.svelte"; +import OutputLabel from "./output/Label.svelte"; +import OutputHighlightedText from "./output/HighlightedText.svelte"; import OutputFile from "./output/File.svelte"; import OutputJson from "./output/Json.svelte"; import OutputHtml from "./output/Html.svelte"; @@ -20,16 +26,16 @@ import Dummy from "./Dummy.svelte" export const inputComponentMap = { "audio": InputAudio, - "checkbox": Dummy, - "checkboxgroup": Dummy, + "checkbox": InputCheckbox, + "checkboxgroup": InputCheckboxGroup, "dataframe": Dummy, "dropdown": InputDropdown, "file": InputFile, "image": InputImage, "number": InputNumber, "radio": InputRadio, - "slider": Dummy, - "textbox": Dummy, + "slider": InputSlider, + "textbox": InputTextbox, "timeseries": Dummy, "video": InputVideo, } @@ -39,11 +45,11 @@ export const outputComponentMap = { "carousel": OutputCarousel, "dataframe": OutputDataframe, "file": OutputFile, - "highlightedtext": Dummy, + "highlightedtext": OutputHighlightedText, "html": OutputHtml, "image": OutputImage, "json": OutputJson, - "label": Dummy, + "label": OutputLabel, "textbox": OutputTextbox, "timeseries": Dummy, "video": OutputVideo, diff --git a/frontend-svelte/src/components/input/Checkbox.svelte b/frontend-svelte/src/components/input/Checkbox.svelte new file mode 100644 index 0000000000..dc2b54b6b6 --- /dev/null +++ b/frontend-svelte/src/components/input/Checkbox.svelte @@ -0,0 +1,54 @@ + + +