Upload folder using huggingface_hub
Browse files- 6.0.1/row/Index.svelte +120 -0
- 6.0.1/row/package.json +31 -0
6.0.1/row/Index.svelte
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<script lang="ts">
|
| 2 |
+
import { StatusTracker } from "@gradio/statustracker";
|
| 3 |
+
import type { LoadingStatus } from "@gradio/statustracker";
|
| 4 |
+
import { Gradio } from "@gradio/utils";
|
| 5 |
+
|
| 6 |
+
// export let equal_height = true;
|
| 7 |
+
// export let elem_id: string;
|
| 8 |
+
// export let elem_classes: string[] = [];
|
| 9 |
+
// export let visible: boolean | "hidden" = true;
|
| 10 |
+
// export let variant: "default" | "panel" | "compact" = "default";
|
| 11 |
+
// export let loading_status: LoadingStatus | undefined = undefined;
|
| 12 |
+
// export let gradio: Gradio | undefined = undefined;
|
| 13 |
+
// export let show_progress = false;
|
| 14 |
+
// export let height: number | string | undefined;
|
| 15 |
+
// export let min_height: number | string | undefined;
|
| 16 |
+
// export let max_height: number | string | undefined;
|
| 17 |
+
// export let scale: number | null = null;
|
| 18 |
+
|
| 19 |
+
const get_dimension = (
|
| 20 |
+
dimension_value: string | number | undefined
|
| 21 |
+
): string | undefined => {
|
| 22 |
+
if (dimension_value === undefined) {
|
| 23 |
+
return undefined;
|
| 24 |
+
}
|
| 25 |
+
if (typeof dimension_value === "number") {
|
| 26 |
+
return dimension_value + "px";
|
| 27 |
+
} else if (typeof dimension_value === "string") {
|
| 28 |
+
return dimension_value;
|
| 29 |
+
}
|
| 30 |
+
};
|
| 31 |
+
|
| 32 |
+
let props = $props();
|
| 33 |
+
let gradio = new Gradio<
|
| 34 |
+
{},
|
| 35 |
+
{
|
| 36 |
+
equal_height: boolean | null;
|
| 37 |
+
variant: "default" | "panel" | "compact";
|
| 38 |
+
height: number | string | undefined;
|
| 39 |
+
min_height: number | string | undefined;
|
| 40 |
+
max_height: number | string | undefined;
|
| 41 |
+
}
|
| 42 |
+
>(props);
|
| 43 |
+
</script>
|
| 44 |
+
|
| 45 |
+
<div
|
| 46 |
+
class:compact={gradio.props.variant === "compact"}
|
| 47 |
+
class:panel={gradio.props.variant === "panel"}
|
| 48 |
+
class:unequal-height={gradio.props.equal_height === false}
|
| 49 |
+
class:stretch={gradio.props.equal_height}
|
| 50 |
+
class:hide={!gradio.shared.visible}
|
| 51 |
+
class:grow-children={gradio.shared.scale && gradio.shared.scale >= 1}
|
| 52 |
+
style:height={get_dimension(gradio.props.height)}
|
| 53 |
+
style:max-height={get_dimension(gradio.props.max_height)}
|
| 54 |
+
style:min-height={get_dimension(gradio.props.min_height)}
|
| 55 |
+
style:flex-grow={gradio.shared.scale}
|
| 56 |
+
id={gradio.shared.elem_id}
|
| 57 |
+
class="row {gradio.shared.elem_classes?.join(' ')}"
|
| 58 |
+
>
|
| 59 |
+
{#if gradio.shared.loading_status && gradio.shared.loading_status.show_progress && gradio}
|
| 60 |
+
<StatusTracker
|
| 61 |
+
autoscroll={gradio.shared.autoscroll}
|
| 62 |
+
i18n={gradio.i18n}
|
| 63 |
+
{...gradio.shared.loading_status}
|
| 64 |
+
status={gradio.shared.loading_status
|
| 65 |
+
? gradio.shared.loading_status.status == "pending"
|
| 66 |
+
? "generating"
|
| 67 |
+
: gradio.shared.loading_status.status
|
| 68 |
+
: null}
|
| 69 |
+
/>
|
| 70 |
+
{/if}
|
| 71 |
+
<slot />
|
| 72 |
+
</div>
|
| 73 |
+
|
| 74 |
+
<style>
|
| 75 |
+
div {
|
| 76 |
+
display: flex;
|
| 77 |
+
flex-wrap: wrap;
|
| 78 |
+
gap: var(--layout-gap);
|
| 79 |
+
width: var(--size-full);
|
| 80 |
+
position: relative;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
.hide {
|
| 84 |
+
display: none;
|
| 85 |
+
}
|
| 86 |
+
.compact > :global(*),
|
| 87 |
+
.compact :global(.box) {
|
| 88 |
+
border-radius: 0;
|
| 89 |
+
}
|
| 90 |
+
.compact,
|
| 91 |
+
.panel {
|
| 92 |
+
border-radius: var(--container-radius);
|
| 93 |
+
background: var(--background-fill-secondary);
|
| 94 |
+
padding: var(--size-2);
|
| 95 |
+
}
|
| 96 |
+
.unequal-height {
|
| 97 |
+
align-items: flex-start;
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
.stretch {
|
| 101 |
+
align-items: stretch;
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
.stretch > :global(.column > *),
|
| 105 |
+
.stretch > :global(.column > .form > *) {
|
| 106 |
+
flex-grow: 1;
|
| 107 |
+
flex-shrink: 0;
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
div > :global(*),
|
| 111 |
+
div > :global(.form > *) {
|
| 112 |
+
flex: 1 1 0%;
|
| 113 |
+
flex-wrap: wrap;
|
| 114 |
+
min-width: min(160px, 100%);
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
.grow-children > :global(.column) {
|
| 118 |
+
align-self: stretch;
|
| 119 |
+
}
|
| 120 |
+
</style>
|
6.0.1/row/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@gradio/row",
|
| 3 |
+
"version": "0.3.0",
|
| 4 |
+
"description": "Gradio UI packages",
|
| 5 |
+
"type": "module",
|
| 6 |
+
"author": "",
|
| 7 |
+
"license": "ISC",
|
| 8 |
+
"private": false,
|
| 9 |
+
"main_changeset": true,
|
| 10 |
+
"devDependencies": {
|
| 11 |
+
"@gradio/preview": "workspace:^",
|
| 12 |
+
"@gradio/statustracker": "workspace:^",
|
| 13 |
+
"@gradio/utils": "workspace:^"
|
| 14 |
+
},
|
| 15 |
+
"exports": {
|
| 16 |
+
".": {
|
| 17 |
+
"gradio": "./Index.svelte",
|
| 18 |
+
"svelte": "./dist/Index.svelte",
|
| 19 |
+
"types": "./dist/Index.svelte.d.ts"
|
| 20 |
+
},
|
| 21 |
+
"./package.json": "./package.json"
|
| 22 |
+
},
|
| 23 |
+
"peerDependencies": {
|
| 24 |
+
"svelte": "^5.43.4"
|
| 25 |
+
},
|
| 26 |
+
"repository": {
|
| 27 |
+
"type": "git",
|
| 28 |
+
"url": "git+https://github.com/gradio-app/gradio.git",
|
| 29 |
+
"directory": "js/row"
|
| 30 |
+
}
|
| 31 |
+
}
|