Upload folder using huggingface_hub
Browse files- 6.0.2/navbar/Example.svelte +11 -0
- 6.0.2/navbar/Index.svelte +36 -0
- 6.0.2/navbar/package.json +45 -0
- 6.0.2/navbar/types.ts +9 -0
6.0.2/navbar/Example.svelte
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<script>
|
| 2 |
+
export let value = {
|
| 3 |
+
visible: true,
|
| 4 |
+
home_page_title: "Home"
|
| 5 |
+
};
|
| 6 |
+
</script>
|
| 7 |
+
|
| 8 |
+
<!-- Navbar component examples are not displayed as it's a configuration component -->
|
| 9 |
+
<div style="display: none;">
|
| 10 |
+
Navbar config: visible={value.visible}, home_page_title="{value.home_page_title}"
|
| 11 |
+
</div>
|
6.0.2/navbar/Index.svelte
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!-- Configuration-only component that stores navbar props in a global store. The actual navbar UI is in Embed.svelte -->
|
| 2 |
+
<script lang="ts">
|
| 3 |
+
import type { NavbarProps, NavbarEvents } from "./types";
|
| 4 |
+
import { Gradio } from "@gradio/utils";
|
| 5 |
+
import { navbar_config } from "@gradio/core/navbar_store";
|
| 6 |
+
import { onMount } from "svelte";
|
| 7 |
+
import { get } from "svelte/store";
|
| 8 |
+
|
| 9 |
+
const props = $props();
|
| 10 |
+
const gradio = new Gradio<NavbarEvents, NavbarProps>(props);
|
| 11 |
+
|
| 12 |
+
let navbar_props = $derived.by(() => {
|
| 13 |
+
return {
|
| 14 |
+
visible: gradio.shared.visible,
|
| 15 |
+
main_page_name: gradio.props.main_page_name ?? "Home",
|
| 16 |
+
value: gradio.props.value
|
| 17 |
+
};
|
| 18 |
+
});
|
| 19 |
+
|
| 20 |
+
onMount(() => {
|
| 21 |
+
const current_store = get(navbar_config);
|
| 22 |
+
if (!current_store) {
|
| 23 |
+
navbar_config.set(navbar_props);
|
| 24 |
+
}
|
| 25 |
+
});
|
| 26 |
+
|
| 27 |
+
$effect(() => {
|
| 28 |
+
navbar_config.set(navbar_props);
|
| 29 |
+
});
|
| 30 |
+
</script>
|
| 31 |
+
|
| 32 |
+
<div
|
| 33 |
+
style="display: none;"
|
| 34 |
+
id={gradio.shared.elem_id}
|
| 35 |
+
class={gradio.shared.elem_classes.join(" ")}
|
| 36 |
+
></div>
|
6.0.2/navbar/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@gradio/navbar",
|
| 3 |
+
"version": "0.2.2",
|
| 4 |
+
"description": "Gradio UI packages",
|
| 5 |
+
"type": "module",
|
| 6 |
+
"author": "",
|
| 7 |
+
"license": "ISC",
|
| 8 |
+
"private": false,
|
| 9 |
+
"main_changeset": true,
|
| 10 |
+
"dependencies": {
|
| 11 |
+
"@gradio/atoms": "workspace:^",
|
| 12 |
+
"@gradio/core": "workspace:^",
|
| 13 |
+
"@gradio/statustracker": "workspace:^",
|
| 14 |
+
"@gradio/utils": "workspace:^"
|
| 15 |
+
},
|
| 16 |
+
"devDependencies": {
|
| 17 |
+
"@gradio/preview": "workspace:^"
|
| 18 |
+
},
|
| 19 |
+
"exports": {
|
| 20 |
+
"./package.json": "./package.json",
|
| 21 |
+
".": {
|
| 22 |
+
"gradio": "./Index.svelte",
|
| 23 |
+
"svelte": "./dist/Index.svelte",
|
| 24 |
+
"types": "./dist/Index.svelte.d.ts"
|
| 25 |
+
},
|
| 26 |
+
"./example": {
|
| 27 |
+
"gradio": "./Example.svelte",
|
| 28 |
+
"svelte": "./dist/Example.svelte",
|
| 29 |
+
"types": "./dist/Example.svelte.d.ts"
|
| 30 |
+
},
|
| 31 |
+
"./base": {
|
| 32 |
+
"gradio": "./Index.svelte",
|
| 33 |
+
"svelte": "./dist/Index.svelte",
|
| 34 |
+
"types": "./dist/Index.svelte.d.ts"
|
| 35 |
+
}
|
| 36 |
+
},
|
| 37 |
+
"peerDependencies": {
|
| 38 |
+
"svelte": "^5.43.4"
|
| 39 |
+
},
|
| 40 |
+
"repository": {
|
| 41 |
+
"type": "git",
|
| 42 |
+
"url": "git+https://github.com/gradio-app/gradio.git",
|
| 43 |
+
"directory": "js/navbar"
|
| 44 |
+
}
|
| 45 |
+
}
|
6.0.2/navbar/types.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export interface NavbarProps {
|
| 2 |
+
value: [string, string][] | null;
|
| 3 |
+
main_page_name: string | false;
|
| 4 |
+
}
|
| 5 |
+
|
| 6 |
+
export interface NavbarEvents {
|
| 7 |
+
change: never;
|
| 8 |
+
clear_status: never;
|
| 9 |
+
}
|