@gradio/core 1.0.0-dev.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +110 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/src/Blocks.svelte +534 -1001
- package/dist/src/Blocks.svelte.d.ts +32 -45
- package/dist/src/Embed.svelte +82 -55
- package/dist/src/Embed.svelte.d.ts +39 -30
- package/dist/src/Login.svelte +33 -29
- package/dist/src/Login.svelte.d.ts +21 -19
- package/dist/src/MountComponents.svelte +19 -25
- package/dist/src/MountComponents.svelte.d.ts +5 -28
- package/dist/src/{init.d.ts → _init.d.ts} +5 -4
- package/dist/src/{init.js → _init.js} +31 -108
- package/dist/src/api_docs/ApiBanner.svelte +12 -8
- package/dist/src/api_docs/ApiBanner.svelte.d.ts +22 -20
- package/dist/src/api_docs/ApiDocs.svelte +356 -247
- package/dist/src/api_docs/ApiDocs.svelte.d.ts +27 -24
- package/dist/src/api_docs/ApiRecorder.svelte +6 -3
- package/dist/src/api_docs/ApiRecorder.svelte.d.ts +19 -17
- package/dist/src/api_docs/CodeSnippet.svelte +122 -48
- package/dist/src/api_docs/CodeSnippet.svelte.d.ts +29 -25
- package/dist/src/api_docs/CopyButton.svelte +69 -13
- package/dist/src/api_docs/CopyButton.svelte.d.ts +18 -16
- package/dist/src/api_docs/CopyMarkdown.svelte +734 -0
- package/dist/src/api_docs/CopyMarkdown.svelte.d.ts +37 -0
- package/dist/src/api_docs/EndpointDetail.svelte +81 -23
- package/dist/src/api_docs/EndpointDetail.svelte.d.ts +23 -18
- package/dist/src/api_docs/IconArrowUpRight.svelte +34 -0
- package/dist/src/api_docs/IconArrowUpRight.svelte.d.ts +20 -0
- package/dist/src/api_docs/IconCaret.svelte +39 -0
- package/dist/src/api_docs/IconCaret.svelte.d.ts +20 -0
- package/dist/src/api_docs/IconHuggingChat.svelte +62 -0
- package/dist/src/api_docs/IconHuggingChat.svelte.d.ts +20 -0
- package/dist/src/api_docs/InputPayload.svelte +17 -11
- package/dist/src/api_docs/InputPayload.svelte.d.ts +25 -23
- package/dist/src/api_docs/InstallSnippet.svelte +9 -6
- package/dist/src/api_docs/InstallSnippet.svelte.d.ts +18 -16
- package/dist/src/api_docs/MCPSnippet.svelte +139 -126
- package/dist/src/api_docs/MCPSnippet.svelte.d.ts +60 -58
- package/dist/src/api_docs/NoApi.svelte +7 -4
- package/dist/src/api_docs/NoApi.svelte.d.ts +20 -18
- package/dist/src/api_docs/ParametersSnippet.svelte +8 -6
- package/dist/src/api_docs/ParametersSnippet.svelte.d.ts +21 -19
- package/dist/src/api_docs/PercentileChart.svelte +125 -0
- package/dist/src/api_docs/PercentileChart.svelte.d.ts +22 -0
- package/dist/src/api_docs/RecordingSnippet.svelte +124 -110
- package/dist/src/api_docs/RecordingSnippet.svelte.d.ts +24 -22
- package/dist/src/api_docs/ResponseSnippet.svelte +7 -5
- package/dist/src/api_docs/ResponseSnippet.svelte.d.ts +21 -19
- package/dist/src/api_docs/Settings.svelte +73 -62
- package/dist/src/api_docs/Settings.svelte.d.ts +25 -23
- package/dist/src/api_docs/SettingsBanner.svelte +11 -8
- package/dist/src/api_docs/SettingsBanner.svelte.d.ts +20 -18
- package/dist/src/api_docs/TryButton.svelte +5 -3
- package/dist/src/api_docs/TryButton.svelte.d.ts +19 -17
- package/dist/src/api_docs/img/IconCheck.svelte +33 -0
- package/dist/src/api_docs/img/IconCheck.svelte.d.ts +26 -0
- package/dist/src/api_docs/img/IconCopy.svelte +40 -0
- package/dist/src/api_docs/img/IconCopy.svelte.d.ts +26 -0
- package/dist/src/api_docs/img/clear.svelte.d.ts +22 -21
- package/dist/src/dependency.d.ts +145 -0
- package/dist/src/dependency.js +668 -0
- package/dist/src/init.svelte.d.ts +78 -0
- package/dist/src/init.svelte.js +469 -0
- package/dist/src/init_utils.d.ts +32 -0
- package/dist/src/init_utils.js +73 -0
- package/dist/src/lang/en.json +10 -1
- package/dist/src/lang/get_lang_names.js +0 -3
- package/dist/src/lang/ru.json +10 -1
- package/dist/src/stores.d.ts +0 -21
- package/dist/src/stories/I18nMultiLanguageTestComponent.svelte +5 -3
- package/dist/src/stories/I18nMultiLanguageTestComponent.svelte.d.ts +16 -14
- package/dist/src/stories/I18nTestSetup.svelte +14 -10
- package/dist/src/stories/I18nTestSetup.svelte.d.ts +18 -16
- package/dist/src/types.d.ts +31 -26
- package/index.ts +1 -1
- package/package.json +62 -63
- package/src/Blocks.svelte +360 -1063
- package/src/MountComponents.svelte +17 -27
- package/src/{init.ts → _init.ts} +49 -126
- package/src/api_docs/ApiDocs.svelte +84 -62
- package/src/api_docs/CodeSnippet.svelte +83 -24
- package/src/api_docs/CopyButton.svelte +61 -7
- package/src/api_docs/CopyMarkdown.svelte +734 -0
- package/src/api_docs/EndpointDetail.svelte +73 -17
- package/src/api_docs/IconArrowUpRight.svelte +34 -0
- package/src/api_docs/IconCaret.svelte +39 -0
- package/src/api_docs/IconHuggingChat.svelte +62 -0
- package/src/api_docs/MCPSnippet.svelte +44 -73
- package/src/api_docs/ParametersSnippet.svelte +1 -1
- package/src/api_docs/PercentileChart.svelte +125 -0
- package/src/api_docs/ResponseSnippet.svelte +1 -1
- package/src/api_docs/Settings.svelte +11 -11
- package/src/api_docs/img/IconCheck.svelte +33 -0
- package/src/api_docs/img/IconCopy.svelte +40 -0
- package/src/dependency.ts +909 -0
- package/src/init.svelte.ts +717 -0
- package/src/init_utils.ts +99 -0
- package/src/lang/en.json +10 -1
- package/src/lang/get_lang_names.js +0 -3
- package/src/lang/ru.json +10 -1
- package/src/stores.ts +22 -22
- package/src/types.ts +55 -43
- package/dist/src/Render.svelte +0 -105
- package/dist/src/Render.svelte.d.ts +0 -31
- package/dist/src/RenderComponent.svelte +0 -72
- package/dist/src/RenderComponent.svelte.d.ts +0 -33
- package/src/Render.svelte +0 -126
- package/src/RenderComponent.svelte +0 -91
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Dependency } from "../types";
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const CopyMarkdown: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
current_language: "python" | "javascript" | "bash" | "mcp";
|
|
17
|
+
space_id: string | null;
|
|
18
|
+
root: string;
|
|
19
|
+
api_count: number;
|
|
20
|
+
tools: any[];
|
|
21
|
+
py_docs: string;
|
|
22
|
+
js_docs: string;
|
|
23
|
+
bash_docs: string;
|
|
24
|
+
mcp_docs: string;
|
|
25
|
+
spaces_docs_suffix: string;
|
|
26
|
+
mcp_server_active: boolean;
|
|
27
|
+
mcp_server_url_streamable: string;
|
|
28
|
+
config_snippets: Record<string, string>;
|
|
29
|
+
markdown_code_snippets: Record<string, Record<string, string>>;
|
|
30
|
+
dependencies: Dependency[];
|
|
31
|
+
info: any;
|
|
32
|
+
js_info: any;
|
|
33
|
+
}, {
|
|
34
|
+
[evt: string]: CustomEvent<any>;
|
|
35
|
+
}, {}, {}, string>;
|
|
36
|
+
type CopyMarkdown = InstanceType<typeof CopyMarkdown>;
|
|
37
|
+
export default CopyMarkdown;
|
|
@@ -1,28 +1,45 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
export let
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Payload } from "../types";
|
|
3
|
+
export let api_name: string | null = null;
|
|
4
|
+
export let description: string | null = null;
|
|
5
|
+
export let analytics: Record<string, any>;
|
|
6
|
+
export let last_api_call: Payload | null = null;
|
|
7
|
+
export let dependency_id: number | null = null;
|
|
8
|
+
import { format_latency, get_color_from_success_rate } from "./utils";
|
|
9
|
+
import PercentileChart from "./PercentileChart.svelte";
|
|
10
|
+
|
|
11
|
+
const success_rate = api_name ? analytics[api_name]?.success_rate : 0;
|
|
12
|
+
const color = get_color_from_success_rate(success_rate);
|
|
13
|
+
$: is_most_recently_used = last_api_call?.fn_index === dependency_id;
|
|
7
14
|
</script>
|
|
8
15
|
|
|
9
16
|
<h3>
|
|
10
17
|
API name:
|
|
11
18
|
<span class="post">{"/" + api_name}</span>
|
|
12
|
-
<span class="desc">
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
<span class="desc">
|
|
20
|
+
{description}
|
|
21
|
+
{#if analytics && api_name && analytics[api_name]}
|
|
22
|
+
{@const endpoint_analytics = analytics[api_name]}
|
|
23
|
+
{@const p50 = endpoint_analytics.process_time_percentiles["50th"]}
|
|
24
|
+
{@const p90 = endpoint_analytics.process_time_percentiles["90th"]}
|
|
25
|
+
{@const p99 = endpoint_analytics.process_time_percentiles["99th"]}
|
|
26
|
+
<span class="analytics-inline">
|
|
27
|
+
<span class="analytics-content">
|
|
28
|
+
<span class="analytics-text-wrapper">
|
|
29
|
+
{endpoint_analytics.total_requests} requests ({Math.round(
|
|
30
|
+
success_rate * 100
|
|
31
|
+
)}% successful, p50: {format_latency(p50)})
|
|
32
|
+
</span>
|
|
33
|
+
<div class="analytics-tooltip">
|
|
34
|
+
<PercentileChart {p50} {p90} {p99} />
|
|
35
|
+
</div>
|
|
36
|
+
</span>
|
|
37
|
+
{#if is_most_recently_used}
|
|
38
|
+
<span class="most-recently-used">Most recently used</span>
|
|
39
|
+
{/if}
|
|
40
|
+
</span>
|
|
41
|
+
{/if}
|
|
42
|
+
</span>
|
|
26
43
|
</h3>
|
|
27
44
|
|
|
28
45
|
<style>
|
|
@@ -44,14 +61,55 @@ const color = get_color_from_success_rate(success_rate);
|
|
|
44
61
|
font-weight: var(--weight-semibold);
|
|
45
62
|
}
|
|
46
63
|
|
|
47
|
-
.analytics {
|
|
64
|
+
.analytics-inline {
|
|
65
|
+
display: inline-flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
gap: var(--size-2);
|
|
68
|
+
margin-left: var(--size-2);
|
|
48
69
|
color: var(--body-text-color-subdued);
|
|
49
|
-
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.analytics-content {
|
|
73
|
+
position: relative;
|
|
74
|
+
display: inline-block;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.analytics-text-wrapper {
|
|
78
|
+
cursor: help;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.analytics-tooltip {
|
|
82
|
+
position: absolute;
|
|
83
|
+
bottom: 100%;
|
|
84
|
+
left: 50%;
|
|
85
|
+
transform: translateX(-50%);
|
|
86
|
+
margin-bottom: var(--size-2);
|
|
87
|
+
opacity: 0;
|
|
88
|
+
pointer-events: none;
|
|
89
|
+
transition: opacity 0.2s ease;
|
|
90
|
+
z-index: 1000;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.analytics-content:hover .analytics-tooltip {
|
|
94
|
+
opacity: 1;
|
|
95
|
+
pointer-events: auto;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.most-recently-used {
|
|
99
|
+
display: inline-block;
|
|
100
|
+
color: #fd7b00;
|
|
101
|
+
background: #fff4e6;
|
|
102
|
+
border: 1px solid #ffd9b3;
|
|
103
|
+
border-radius: var(--radius-sm);
|
|
104
|
+
padding: var(--size-1) var(--size-2);
|
|
105
|
+
font-size: var(--text-sm);
|
|
106
|
+
font-weight: var(--weight-medium);
|
|
107
|
+
white-space: nowrap;
|
|
50
108
|
}
|
|
51
109
|
|
|
52
110
|
.desc {
|
|
53
111
|
color: var(--body-text-color);
|
|
54
112
|
font-size: var(--text-lg);
|
|
55
|
-
margin-
|
|
113
|
+
margin-left: var(--size-2);
|
|
56
114
|
}
|
|
57
115
|
</style>
|
|
@@ -1,20 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import type { Payload } from "../types";
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
7
12
|
};
|
|
8
|
-
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {};
|
|
12
|
-
exports?: {} | undefined;
|
|
13
|
-
bindings?: string | undefined;
|
|
14
|
-
};
|
|
15
|
-
export type EndpointDetailProps = typeof __propDef.props;
|
|
16
|
-
export type EndpointDetailEvents = typeof __propDef.events;
|
|
17
|
-
export type EndpointDetailSlots = typeof __propDef.slots;
|
|
18
|
-
export default class EndpointDetail extends SvelteComponent<EndpointDetailProps, EndpointDetailEvents, EndpointDetailSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
19
14
|
}
|
|
20
|
-
|
|
15
|
+
declare const EndpointDetail: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
api_name?: string | null;
|
|
17
|
+
description?: string | null;
|
|
18
|
+
analytics: Record<string, any>;
|
|
19
|
+
last_api_call?: Payload | null;
|
|
20
|
+
dependency_id?: number | null;
|
|
21
|
+
}, {
|
|
22
|
+
[evt: string]: CustomEvent<any>;
|
|
23
|
+
}, {}, {}, string>;
|
|
24
|
+
type EndpointDetail = InstanceType<typeof EndpointDetail>;
|
|
25
|
+
export default EndpointDetail;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export let classNames = "";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
class={classNames || "menu-icon-arrow"}
|
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
+
width="24"
|
|
9
|
+
height="24"
|
|
10
|
+
viewBox="0 0 24 24"
|
|
11
|
+
fill="none"
|
|
12
|
+
stroke="currentColor"
|
|
13
|
+
stroke-width="1.75"
|
|
14
|
+
stroke-linecap="round"
|
|
15
|
+
stroke-linejoin="round"
|
|
16
|
+
>
|
|
17
|
+
<path d="M7 7h10v10"></path>
|
|
18
|
+
<path d="M7 17 17 7"></path>
|
|
19
|
+
</svg>
|
|
20
|
+
|
|
21
|
+
<style>
|
|
22
|
+
.menu-icon-arrow {
|
|
23
|
+
width: 1rem;
|
|
24
|
+
height: 1rem;
|
|
25
|
+
color: rgb(107, 114, 128);
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@media (prefers-color-scheme: dark) {
|
|
30
|
+
.menu-icon-arrow {
|
|
31
|
+
color: rgb(209, 213, 219);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const IconArrowUpRight: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
classNames?: string;
|
|
16
|
+
}, {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
}, {}, {}, string>;
|
|
19
|
+
type IconArrowUpRight = InstanceType<typeof IconArrowUpRight>;
|
|
20
|
+
export default IconArrowUpRight;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export let classNames = "";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
class={classNames}
|
|
7
|
+
width="1em"
|
|
8
|
+
height="1em"
|
|
9
|
+
viewBox="0 0 12 7"
|
|
10
|
+
fill="none"
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
>
|
|
13
|
+
<path d="M1 1L6 6L11 1" stroke="currentColor" />
|
|
14
|
+
</svg>
|
|
15
|
+
|
|
16
|
+
<style>
|
|
17
|
+
.caret-icon {
|
|
18
|
+
transition: transform 0.2s ease-in-out;
|
|
19
|
+
color: rgb(156, 163, 175);
|
|
20
|
+
overflow: visible;
|
|
21
|
+
width: 0.75rem;
|
|
22
|
+
height: 0.75rem;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@media (max-width: 640px) {
|
|
26
|
+
.caret-icon {
|
|
27
|
+
width: 0.625rem;
|
|
28
|
+
height: 0.625rem;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.rotate-180 {
|
|
33
|
+
transform: rotate(180deg);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.rotate-0 {
|
|
37
|
+
transform: rotate(0deg);
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const IconCaret: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
classNames?: string;
|
|
16
|
+
}, {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
}, {}, {}, string>;
|
|
19
|
+
type IconCaret = InstanceType<typeof IconCaret>;
|
|
20
|
+
export default IconCaret;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export let classNames = "";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
class={classNames || "icon-size"}
|
|
7
|
+
width="1em"
|
|
8
|
+
height="1em"
|
|
9
|
+
viewBox="5 5 22 22"
|
|
10
|
+
fill="none"
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
>
|
|
13
|
+
<title>HuggingChat</title>
|
|
14
|
+
<path
|
|
15
|
+
d="M16.0006 25.9992C13.8266 25.999 11.7118 25.2901 9.97686 23.9799C8.2419 22.6698 6.98127 20.8298 6.38599 18.7388C5.79071 16.6478 5.89323 14.4198 6.678 12.3923C7.46278 10.3648 8.88705 8.64837 10.735 7.50308C12.5829 6.35779 14.7538 5.84606 16.9187 6.04544C19.0837 6.24481 21.1246 7.14442 22.7323 8.60795C24.34 10.0715 25.4268 12.0192 25.8281 14.1559C26.2293 16.2926 25.9232 18.5019 24.9561 20.449C24.7703 20.8042 24.7223 21.2155 24.8211 21.604L25.4211 23.8316C25.4803 24.0518 25.4805 24.2837 25.4216 24.5039C25.3627 24.7242 25.2468 24.925 25.0856 25.0862C24.9244 25.2474 24.7235 25.3633 24.5033 25.4222C24.283 25.4811 24.0512 25.4809 23.831 25.4217L21.6034 24.8217C21.2172 24.7248 20.809 24.7729 20.4558 24.9567C19.0683 25.6467 17.5457 26.0068 16.0006 26.0068V25.9992Z"
|
|
16
|
+
fill="black"
|
|
17
|
+
class="block dark:hidden"
|
|
18
|
+
/>
|
|
19
|
+
<path
|
|
20
|
+
d="M9.62598 16.0013C9.62598 15.3799 10.1294 14.8765 10.7508 14.8765C11.3721 14.8765 11.8756 15.3799 11.8756 16.0013C11.8756 17.0953 12.3102 18.1448 13.0838 18.9184C13.8574 19.692 14.9069 20.1266 16.001 20.1267C17.095 20.1267 18.1445 19.692 18.9181 18.9184C19.6918 18.1448 20.1264 17.0953 20.1264 16.0013C20.1264 15.3799 20.6299 14.8765 21.2512 14.8765C21.8725 14.8765 22.3759 15.3799 22.3759 16.0013C22.3759 17.6921 21.7046 19.3137 20.509 20.5093C19.3134 21.7049 17.6918 22.3762 16.001 22.3762C14.3102 22.3762 12.6885 21.7049 11.4929 20.5093C10.2974 19.3137 9.62598 17.6921 9.62598 16.0013Z"
|
|
21
|
+
fill="white"
|
|
22
|
+
class="block dark:hidden"
|
|
23
|
+
/>
|
|
24
|
+
<path
|
|
25
|
+
d="M16.0006 25.9992C13.8266 25.999 11.7118 25.2901 9.97686 23.9799C8.2419 22.6698 6.98127 20.8298 6.38599 18.7388C5.79071 16.6478 5.89323 14.4198 6.678 12.3923C7.46278 10.3648 8.88705 8.64837 10.735 7.50308C12.5829 6.35779 14.7538 5.84606 16.9187 6.04544C19.0837 6.24481 21.1246 7.14442 22.7323 8.60795C24.34 10.0715 25.4268 12.0192 25.8281 14.1559C26.2293 16.2926 25.9232 18.5019 24.9561 20.449C24.7703 20.8042 24.7223 21.2155 24.8211 21.604L25.4211 23.8316C25.4803 24.0518 25.4805 24.2837 25.4216 24.5039C25.3627 24.7242 25.2468 24.925 25.0856 25.0862C24.9244 25.2474 24.7235 25.3633 24.5033 25.4222C24.283 25.4811 24.0512 25.4809 23.831 25.4217L21.6034 24.8217C21.2172 24.7248 20.809 24.7729 20.4558 24.9567C19.0683 25.6467 17.5457 26.0068 16.0006 26.0068V25.9992Z"
|
|
26
|
+
fill="white"
|
|
27
|
+
class="hidden dark:block"
|
|
28
|
+
/>
|
|
29
|
+
<path
|
|
30
|
+
d="M9.62598 16.0013C9.62598 15.3799 10.1294 14.8765 10.7508 14.8765C11.3721 14.8765 11.8756 15.3799 11.8756 16.0013C11.8756 17.0953 12.3102 18.1448 13.0838 18.9184C13.8574 19.692 14.9069 20.1266 16.001 20.1267C17.095 20.1267 18.1445 19.692 18.9181 18.9184C19.6918 18.1448 20.1264 17.0953 20.1264 16.0013C20.1264 15.3799 20.6299 14.8765 21.2512 14.8765C21.8725 14.8765 22.3759 15.3799 22.3759 16.0013C22.3759 17.6921 21.7046 19.3137 20.509 20.5093C19.3134 21.7049 17.6918 22.3762 16.001 22.3762C14.3102 22.3762 12.6885 21.7049 11.4929 20.5093C10.2974 19.3137 9.62598 17.6921 9.62598 16.0013Z"
|
|
31
|
+
fill="black"
|
|
32
|
+
class="hidden dark:block"
|
|
33
|
+
/>
|
|
34
|
+
</svg>
|
|
35
|
+
|
|
36
|
+
<style>
|
|
37
|
+
.icon-size {
|
|
38
|
+
width: 0.75rem;
|
|
39
|
+
height: 0.75rem;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@media (max-width: 640px) {
|
|
43
|
+
.icon-size {
|
|
44
|
+
width: 0.625rem;
|
|
45
|
+
height: 0.625rem;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.menu-icon {
|
|
50
|
+
width: 1rem;
|
|
51
|
+
height: 1rem;
|
|
52
|
+
flex-shrink: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.hidden {
|
|
56
|
+
display: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.block {
|
|
60
|
+
display: block;
|
|
61
|
+
}
|
|
62
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const IconHuggingChat: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
classNames?: string;
|
|
16
|
+
}, {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
}, {}, {}, string>;
|
|
19
|
+
type IconHuggingChat = InstanceType<typeof IconHuggingChat>;
|
|
20
|
+
export default IconHuggingChat;
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export let
|
|
7
|
-
export let
|
|
8
|
-
export let
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { ComponentMeta, Dependency } from "../types";
|
|
3
|
+
import { BaseButton } from "@gradio/button";
|
|
4
|
+
import { Block } from "@gradio/atoms";
|
|
5
|
+
|
|
6
|
+
export let dependency: Dependency;
|
|
7
|
+
export let dependency_failures: boolean[][];
|
|
8
|
+
export let dependency_index: number;
|
|
9
|
+
export let instance_map: {
|
|
10
|
+
[id: number]: ComponentMeta;
|
|
11
|
+
};
|
|
12
|
+
export let run: (id: number) => Promise<void>;
|
|
13
|
+
export let dependency_inputs: string[][];
|
|
14
|
+
|
|
15
|
+
function format_label(label: unknown): string {
|
|
16
|
+
return label ? "'" + label + "'" : "the";
|
|
17
|
+
}
|
|
12
18
|
</script>
|
|
13
19
|
|
|
14
20
|
<h4>
|
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { ComponentMeta, Dependency } from "../types";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
13
12
|
};
|
|
14
|
-
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
};
|
|
17
|
-
slots: {};
|
|
18
|
-
exports?: {} | undefined;
|
|
19
|
-
bindings?: string | undefined;
|
|
20
|
-
};
|
|
21
|
-
export type InputPayloadProps = typeof __propDef.props;
|
|
22
|
-
export type InputPayloadEvents = typeof __propDef.events;
|
|
23
|
-
export type InputPayloadSlots = typeof __propDef.slots;
|
|
24
|
-
export default class InputPayload extends SvelteComponent<InputPayloadProps, InputPayloadEvents, InputPayloadSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
25
14
|
}
|
|
26
|
-
|
|
15
|
+
declare const InputPayload: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
dependency: Dependency;
|
|
17
|
+
dependency_failures: boolean[][];
|
|
18
|
+
dependency_index: number;
|
|
19
|
+
instance_map: {
|
|
20
|
+
[id: number]: ComponentMeta;
|
|
21
|
+
};
|
|
22
|
+
run: (id: number) => Promise<void>;
|
|
23
|
+
dependency_inputs: string[][];
|
|
24
|
+
}, {
|
|
25
|
+
[evt: string]: CustomEvent<any>;
|
|
26
|
+
}, {}, {}, string>;
|
|
27
|
+
type InputPayload = InstanceType<typeof InputPayload>;
|
|
28
|
+
export default InputPayload;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
let
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import CopyButton from "./CopyButton.svelte";
|
|
3
|
+
import { Block } from "@gradio/atoms";
|
|
4
|
+
|
|
5
|
+
export let current_language: "python" | "javascript" | "bash" | "mcp";
|
|
6
|
+
|
|
7
|
+
let py_install = "pip install gradio_client";
|
|
8
|
+
let js_install = "npm i -D @gradio/client";
|
|
9
|
+
let bash_install = "curl --version";
|
|
7
10
|
</script>
|
|
8
11
|
|
|
9
12
|
<Block>
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
5
11
|
};
|
|
6
|
-
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {};
|
|
10
|
-
exports?: {} | undefined;
|
|
11
|
-
bindings?: string | undefined;
|
|
12
|
-
};
|
|
13
|
-
export type InstallSnippetProps = typeof __propDef.props;
|
|
14
|
-
export type InstallSnippetEvents = typeof __propDef.events;
|
|
15
|
-
export type InstallSnippetSlots = typeof __propDef.slots;
|
|
16
|
-
export default class InstallSnippet extends SvelteComponent<InstallSnippetProps, InstallSnippetEvents, InstallSnippetSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
17
13
|
}
|
|
18
|
-
|
|
14
|
+
declare const InstallSnippet: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
current_language: "python" | "javascript" | "bash" | "mcp";
|
|
16
|
+
}, {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
}, {}, {}, string>;
|
|
19
|
+
type InstallSnippet = InstanceType<typeof InstallSnippet>;
|
|
20
|
+
export default InstallSnippet;
|