Upload folder using huggingface_hub
Browse files- 6.0.2/simpleimage/Example.svelte +48 -0
- 6.0.2/simpleimage/Index.svelte +99 -0
- 6.0.2/simpleimage/package.json +51 -0
- 6.0.2/simpleimage/shared/ClearImage.svelte +18 -0
- 6.0.2/simpleimage/shared/ImagePreview.svelte +61 -0
- 6.0.2/simpleimage/shared/ImageUploader.svelte +99 -0
- 6.0.2/simpleimage/types.ts +15 -0
6.0.2/simpleimage/Example.svelte
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<script lang="ts">
|
| 2 |
+
import type { FileData } from "@gradio/client";
|
| 3 |
+
|
| 4 |
+
export let value: null | FileData;
|
| 5 |
+
export let type: "gallery" | "table";
|
| 6 |
+
export let selected = false;
|
| 7 |
+
</script>
|
| 8 |
+
|
| 9 |
+
{#if value}
|
| 10 |
+
<div
|
| 11 |
+
class="container"
|
| 12 |
+
class:table={type === "table"}
|
| 13 |
+
class:gallery={type === "gallery"}
|
| 14 |
+
class:selected
|
| 15 |
+
>
|
| 16 |
+
<img src={value.url} alt="" />
|
| 17 |
+
</div>
|
| 18 |
+
{/if}
|
| 19 |
+
|
| 20 |
+
<style>
|
| 21 |
+
.container :global(img) {
|
| 22 |
+
width: 100%;
|
| 23 |
+
height: 100%;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
.container.selected {
|
| 27 |
+
border-color: var(--border-color-accent);
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
.container.table {
|
| 31 |
+
margin: 0 auto;
|
| 32 |
+
border: 2px solid var(--border-color-primary);
|
| 33 |
+
border-radius: var(--radius-lg);
|
| 34 |
+
overflow: hidden;
|
| 35 |
+
width: var(--size-20);
|
| 36 |
+
height: var(--size-20);
|
| 37 |
+
object-fit: cover;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
.container.gallery {
|
| 41 |
+
height: var(--size-20);
|
| 42 |
+
max-height: var(--size-20);
|
| 43 |
+
object-fit: cover;
|
| 44 |
+
}
|
| 45 |
+
.container img {
|
| 46 |
+
object-fit: cover;
|
| 47 |
+
}
|
| 48 |
+
</style>
|
6.0.2/simpleimage/Index.svelte
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<svelte:options accessors={true} />
|
| 2 |
+
|
| 3 |
+
<script context="module" lang="ts">
|
| 4 |
+
export { default as BaseImageUploader } from "./shared/ImageUploader.svelte";
|
| 5 |
+
export { default as BaseStaticImage } from "./shared/ImagePreview.svelte";
|
| 6 |
+
export { default as BaseExample } from "./Example.svelte";
|
| 7 |
+
</script>
|
| 8 |
+
|
| 9 |
+
<script lang="ts">
|
| 10 |
+
import type { SimpleImageProps, SimpleImageEvents } from "./types";
|
| 11 |
+
import { Gradio } from "@gradio/utils";
|
| 12 |
+
import ImagePreview from "./shared/ImagePreview.svelte";
|
| 13 |
+
import ImageUploader from "./shared/ImageUploader.svelte";
|
| 14 |
+
|
| 15 |
+
import { Block, UploadText } from "@gradio/atoms";
|
| 16 |
+
import { StatusTracker } from "@gradio/statustracker";
|
| 17 |
+
|
| 18 |
+
const props = $props();
|
| 19 |
+
const gradio = new Gradio<SimpleImageEvents, SimpleImageProps>(props);
|
| 20 |
+
|
| 21 |
+
let dragging = $state(false);
|
| 22 |
+
let old_value = $state(gradio.props.value);
|
| 23 |
+
|
| 24 |
+
$effect(() => {
|
| 25 |
+
if (old_value != gradio.props.value) {
|
| 26 |
+
old_value = gradio.props.value;
|
| 27 |
+
gradio.dispatch("change");
|
| 28 |
+
}
|
| 29 |
+
});
|
| 30 |
+
</script>
|
| 31 |
+
|
| 32 |
+
{#if !gradio.shared.interactive}
|
| 33 |
+
<Block
|
| 34 |
+
visible={gradio.shared.visible}
|
| 35 |
+
variant={"solid"}
|
| 36 |
+
border_mode={dragging ? "focus" : "base"}
|
| 37 |
+
padding={false}
|
| 38 |
+
elem_id={gradio.shared.elem_id}
|
| 39 |
+
elem_classes={gradio.shared.elem_classes}
|
| 40 |
+
allow_overflow={false}
|
| 41 |
+
container={gradio.shared.container}
|
| 42 |
+
scale={gradio.shared.scale}
|
| 43 |
+
min_width={gradio.shared.min_width}
|
| 44 |
+
>
|
| 45 |
+
<StatusTracker
|
| 46 |
+
autoscroll={gradio.shared.autoscroll}
|
| 47 |
+
i18n={gradio.i18n}
|
| 48 |
+
{...gradio.shared.loading_status}
|
| 49 |
+
on_clear_status={() =>
|
| 50 |
+
gradio.dispatch("clear_status", gradio.shared.loading_status)}
|
| 51 |
+
/>
|
| 52 |
+
<ImagePreview
|
| 53 |
+
value={gradio.props.value}
|
| 54 |
+
label={gradio.shared.label}
|
| 55 |
+
show_label={gradio.shared.show_label}
|
| 56 |
+
show_download_button={gradio.props.show_download_button}
|
| 57 |
+
i18n={gradio.i18n}
|
| 58 |
+
/>
|
| 59 |
+
</Block>
|
| 60 |
+
{:else}
|
| 61 |
+
<Block
|
| 62 |
+
visible={gradio.shared.visible}
|
| 63 |
+
variant={gradio.props.value === null ? "dashed" : "solid"}
|
| 64 |
+
border_mode={dragging ? "focus" : "base"}
|
| 65 |
+
padding={false}
|
| 66 |
+
elem_id={gradio.shared.elem_id}
|
| 67 |
+
elem_classes={gradio.shared.elem_classes}
|
| 68 |
+
allow_overflow={false}
|
| 69 |
+
container={gradio.shared.container}
|
| 70 |
+
scale={gradio.shared.scale}
|
| 71 |
+
min_width={gradio.shared.min_width}
|
| 72 |
+
>
|
| 73 |
+
<StatusTracker
|
| 74 |
+
autoscroll={gradio.shared.autoscroll}
|
| 75 |
+
i18n={gradio.i18n}
|
| 76 |
+
{...gradio.shared.loading_status}
|
| 77 |
+
on_clear_status={() =>
|
| 78 |
+
gradio.dispatch("clear_status", gradio.shared.loading_status)}
|
| 79 |
+
/>
|
| 80 |
+
|
| 81 |
+
<ImageUploader
|
| 82 |
+
upload={(...args) => gradio.shared.client.upload(...args)}
|
| 83 |
+
stream_handler={(...args) => gradio.shared.client.stream(...args)}
|
| 84 |
+
bind:value={gradio.props.value}
|
| 85 |
+
root={gradio.root}
|
| 86 |
+
on:clear={() => gradio.dispatch("clear")}
|
| 87 |
+
on:drag={({ detail }) => (dragging = detail)}
|
| 88 |
+
on:upload={() => gradio.dispatch("upload")}
|
| 89 |
+
label={gradio.shared.label}
|
| 90 |
+
show_label={gradio.shared.show_label}
|
| 91 |
+
>
|
| 92 |
+
<UploadText
|
| 93 |
+
i18n={gradio.i18n}
|
| 94 |
+
type="image"
|
| 95 |
+
placeholder={gradio.props.placeholder}
|
| 96 |
+
/>
|
| 97 |
+
</ImageUploader>
|
| 98 |
+
</Block>
|
| 99 |
+
{/if}
|
6.0.2/simpleimage/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@gradio/simpleimage",
|
| 3 |
+
"version": "0.9.1",
|
| 4 |
+
"description": "Gradio UI packages",
|
| 5 |
+
"type": "module",
|
| 6 |
+
"author": "",
|
| 7 |
+
"license": "ISC",
|
| 8 |
+
"private": false,
|
| 9 |
+
"dependencies": {
|
| 10 |
+
"@gradio/atoms": "workspace:^",
|
| 11 |
+
"@gradio/client": "workspace:^",
|
| 12 |
+
"@gradio/icons": "workspace:^",
|
| 13 |
+
"@gradio/statustracker": "workspace:^",
|
| 14 |
+
"@gradio/upload": "workspace:^",
|
| 15 |
+
"@gradio/utils": "workspace:^",
|
| 16 |
+
"cropperjs": "^2.0.1",
|
| 17 |
+
"lazy-brush": "^2.0.2",
|
| 18 |
+
"resize-observer-polyfill": "^1.5.1"
|
| 19 |
+
},
|
| 20 |
+
"devDependencies": {
|
| 21 |
+
"@gradio/preview": "workspace:^"
|
| 22 |
+
},
|
| 23 |
+
"main_changeset": true,
|
| 24 |
+
"main": "./Index.svelte",
|
| 25 |
+
"exports": {
|
| 26 |
+
"./package.json": "./package.json",
|
| 27 |
+
".": {
|
| 28 |
+
"gradio": "./Index.svelte",
|
| 29 |
+
"svelte": "./dist/Index.svelte",
|
| 30 |
+
"types": "./dist/Index.svelte.d.ts"
|
| 31 |
+
},
|
| 32 |
+
"./example": {
|
| 33 |
+
"gradio": "./Example.svelte",
|
| 34 |
+
"svelte": "./dist/Example.svelte",
|
| 35 |
+
"types": "./dist/Example.svelte.d.ts"
|
| 36 |
+
},
|
| 37 |
+
"./base": {
|
| 38 |
+
"gradio": "./shared/ImagePreview.svelte",
|
| 39 |
+
"svelte": "./dist/shared/ImagePreview.svelte",
|
| 40 |
+
"types": "./dist/shared/ImagePreview.svelte.d.ts"
|
| 41 |
+
}
|
| 42 |
+
},
|
| 43 |
+
"peerDependencies": {
|
| 44 |
+
"svelte": "^5.43.4"
|
| 45 |
+
},
|
| 46 |
+
"repository": {
|
| 47 |
+
"type": "git",
|
| 48 |
+
"url": "git+https://github.com/gradio-app/gradio.git",
|
| 49 |
+
"directory": "js/simpleimage"
|
| 50 |
+
}
|
| 51 |
+
}
|
6.0.2/simpleimage/shared/ClearImage.svelte
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<script lang="ts">
|
| 2 |
+
import { createEventDispatcher } from "svelte";
|
| 3 |
+
import { IconButton, IconButtonWrapper } from "@gradio/atoms";
|
| 4 |
+
import { Clear } from "@gradio/icons";
|
| 5 |
+
|
| 6 |
+
const dispatch = createEventDispatcher();
|
| 7 |
+
</script>
|
| 8 |
+
|
| 9 |
+
<IconButtonWrapper>
|
| 10 |
+
<IconButton
|
| 11 |
+
Icon={Clear}
|
| 12 |
+
label="Remove Image"
|
| 13 |
+
on:click={(event) => {
|
| 14 |
+
dispatch("remove_image");
|
| 15 |
+
event.stopPropagation();
|
| 16 |
+
}}
|
| 17 |
+
/>
|
| 18 |
+
</IconButtonWrapper>
|
6.0.2/simpleimage/shared/ImagePreview.svelte
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<script lang="ts">
|
| 2 |
+
import {
|
| 3 |
+
BlockLabel,
|
| 4 |
+
Empty,
|
| 5 |
+
IconButton,
|
| 6 |
+
IconButtonWrapper,
|
| 7 |
+
DownloadLink
|
| 8 |
+
} from "@gradio/atoms";
|
| 9 |
+
import { Download } from "@gradio/icons";
|
| 10 |
+
|
| 11 |
+
import { Image as ImageIcon } from "@gradio/icons";
|
| 12 |
+
import { type FileData } from "@gradio/client";
|
| 13 |
+
import type { I18nFormatter } from "@gradio/utils";
|
| 14 |
+
|
| 15 |
+
export let value: null | FileData;
|
| 16 |
+
export let label: string | undefined = undefined;
|
| 17 |
+
export let show_label: boolean;
|
| 18 |
+
export let show_download_button = true;
|
| 19 |
+
export let selectable = false;
|
| 20 |
+
export let i18n: I18nFormatter;
|
| 21 |
+
</script>
|
| 22 |
+
|
| 23 |
+
<BlockLabel
|
| 24 |
+
{show_label}
|
| 25 |
+
Icon={ImageIcon}
|
| 26 |
+
label={label || i18n("image.image")}
|
| 27 |
+
/>
|
| 28 |
+
{#if value === null || !value.url}
|
| 29 |
+
<Empty unpadded_box={true} size="large"><ImageIcon /></Empty>
|
| 30 |
+
{:else}
|
| 31 |
+
<IconButtonWrapper>
|
| 32 |
+
{#if show_download_button}
|
| 33 |
+
<DownloadLink href={value.url} download={value.orig_name || "image"}>
|
| 34 |
+
<IconButton Icon={Download} label={i18n("common.download")} />
|
| 35 |
+
</DownloadLink>
|
| 36 |
+
{/if}
|
| 37 |
+
</IconButtonWrapper>
|
| 38 |
+
<button>
|
| 39 |
+
<div class:selectable class="image-container">
|
| 40 |
+
<img src={value.url} alt="" loading="lazy" />
|
| 41 |
+
</div>
|
| 42 |
+
</button>
|
| 43 |
+
{/if}
|
| 44 |
+
|
| 45 |
+
<style>
|
| 46 |
+
.image-container {
|
| 47 |
+
height: 100%;
|
| 48 |
+
}
|
| 49 |
+
.image-container :global(img),
|
| 50 |
+
button {
|
| 51 |
+
width: var(--size-full);
|
| 52 |
+
height: var(--size-full);
|
| 53 |
+
object-fit: scale-down;
|
| 54 |
+
display: block;
|
| 55 |
+
border-radius: var(--radius-lg);
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
.selectable {
|
| 59 |
+
cursor: crosshair;
|
| 60 |
+
}
|
| 61 |
+
</style>
|
6.0.2/simpleimage/shared/ImageUploader.svelte
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<script lang="ts">
|
| 2 |
+
import { createEventDispatcher } from "svelte";
|
| 3 |
+
import { BlockLabel } from "@gradio/atoms";
|
| 4 |
+
import { Image as ImageIcon } from "@gradio/icons";
|
| 5 |
+
|
| 6 |
+
import { Upload } from "@gradio/upload";
|
| 7 |
+
import type { FileData, Client } from "@gradio/client";
|
| 8 |
+
import ClearImage from "./ClearImage.svelte";
|
| 9 |
+
|
| 10 |
+
export let value: null | FileData;
|
| 11 |
+
export let label: string | undefined = undefined;
|
| 12 |
+
export let show_label: boolean;
|
| 13 |
+
export let root: string;
|
| 14 |
+
export let upload: Client["upload"];
|
| 15 |
+
export let stream_handler: Client["stream"];
|
| 16 |
+
|
| 17 |
+
let upload_component: Upload;
|
| 18 |
+
let uploading = false;
|
| 19 |
+
|
| 20 |
+
function handle_upload({ detail }: CustomEvent<FileData>): void {
|
| 21 |
+
value = detail;
|
| 22 |
+
dispatch("upload");
|
| 23 |
+
}
|
| 24 |
+
$: if (uploading) value = null;
|
| 25 |
+
|
| 26 |
+
const dispatch = createEventDispatcher<{
|
| 27 |
+
change?: never;
|
| 28 |
+
clear?: never;
|
| 29 |
+
drag: boolean;
|
| 30 |
+
upload?: never;
|
| 31 |
+
}>();
|
| 32 |
+
|
| 33 |
+
let dragging = false;
|
| 34 |
+
$: dispatch("drag", dragging);
|
| 35 |
+
</script>
|
| 36 |
+
|
| 37 |
+
<BlockLabel {show_label} Icon={ImageIcon} label={label || "Image"} />
|
| 38 |
+
|
| 39 |
+
<div data-testid="image" class="image-container">
|
| 40 |
+
{#if value?.url}
|
| 41 |
+
<ClearImage
|
| 42 |
+
on:remove_image={() => {
|
| 43 |
+
value = null;
|
| 44 |
+
dispatch("clear");
|
| 45 |
+
}}
|
| 46 |
+
/>
|
| 47 |
+
{/if}
|
| 48 |
+
<div class="upload-container">
|
| 49 |
+
<Upload
|
| 50 |
+
{upload}
|
| 51 |
+
{stream_handler}
|
| 52 |
+
hidden={value !== null}
|
| 53 |
+
bind:this={upload_component}
|
| 54 |
+
bind:uploading
|
| 55 |
+
bind:dragging
|
| 56 |
+
filetype="image/*"
|
| 57 |
+
on:load={handle_upload}
|
| 58 |
+
on:error
|
| 59 |
+
{root}
|
| 60 |
+
>
|
| 61 |
+
{#if value === null}
|
| 62 |
+
<slot />
|
| 63 |
+
{/if}
|
| 64 |
+
</Upload>
|
| 65 |
+
{#if value !== null}
|
| 66 |
+
<div class="image-frame">
|
| 67 |
+
<img src={value.url} alt={value.alt_text} />
|
| 68 |
+
</div>
|
| 69 |
+
{/if}
|
| 70 |
+
</div>
|
| 71 |
+
</div>
|
| 72 |
+
|
| 73 |
+
<style>
|
| 74 |
+
.image-frame :global(img) {
|
| 75 |
+
width: var(--size-full);
|
| 76 |
+
height: var(--size-full);
|
| 77 |
+
object-fit: scale-down;
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
.image-frame {
|
| 81 |
+
width: 100%;
|
| 82 |
+
height: 100%;
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
.upload-container {
|
| 86 |
+
height: 100%;
|
| 87 |
+
flex-shrink: 1;
|
| 88 |
+
max-height: 100%;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
.image-container {
|
| 92 |
+
display: flex;
|
| 93 |
+
height: 100%;
|
| 94 |
+
flex-direction: column;
|
| 95 |
+
justify-content: center;
|
| 96 |
+
align-items: center;
|
| 97 |
+
max-height: 100%;
|
| 98 |
+
}
|
| 99 |
+
</style>
|
6.0.2/simpleimage/types.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type { FileData } from "@gradio/client";
|
| 2 |
+
import type { LoadingStatus } from "@gradio/statustracker";
|
| 3 |
+
|
| 4 |
+
export interface SimpleImageProps {
|
| 5 |
+
value: null | FileData;
|
| 6 |
+
show_download_button: boolean;
|
| 7 |
+
placeholder: string | undefined;
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
export interface SimpleImageEvents {
|
| 11 |
+
change: never;
|
| 12 |
+
upload: never;
|
| 13 |
+
clear: never;
|
| 14 |
+
clear_status: LoadingStatus;
|
| 15 |
+
}
|