@gradio/core 0.29.2 → 1.0.0-dev.3
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 +103 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/src/Blocks.svelte +518 -999
- package/dist/src/Blocks.svelte.d.ts +31 -46
- 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 +338 -246
- package/dist/src/api_docs/ApiDocs.svelte.d.ts +26 -24
- package/dist/src/api_docs/ApiRecorder.svelte +9 -3
- package/dist/src/api_docs/ApiRecorder.svelte.d.ts +19 -17
- package/dist/src/api_docs/CodeSnippet.svelte +60 -30
- package/dist/src/api_docs/CodeSnippet.svelte.d.ts +27 -24
- 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 +8 -6
- package/dist/src/api_docs/EndpointDetail.svelte.d.ts +20 -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 +119 -99
- package/dist/src/api_docs/MCPSnippet.svelte.d.ts +59 -58
- package/dist/src/api_docs/NoApi.svelte +8 -5
- 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/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 +142 -0
- package/dist/src/dependency.js +653 -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 +29 -25
- package/index.ts +1 -1
- package/package.json +59 -59
- package/src/Blocks.svelte +344 -1059
- package/src/MountComponents.svelte +17 -27
- package/src/{init.ts → _init.ts} +49 -126
- package/src/api_docs/ApiDocs.svelte +67 -62
- package/src/api_docs/ApiRecorder.svelte +3 -0
- package/src/api_docs/CodeSnippet.svelte +20 -5
- package/src/api_docs/CopyButton.svelte +61 -7
- package/src/api_docs/CopyMarkdown.svelte +734 -0
- 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 +24 -46
- package/src/api_docs/NoApi.svelte +1 -1
- package/src/api_docs/ParametersSnippet.svelte +1 -1
- 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 +880 -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 +54 -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
|
@@ -1,49 +1,34 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import { Client } from "@gradio/client";
|
|
3
|
-
import type { ComponentMeta, Dependency, LayoutNode } from "./types";
|
|
2
|
+
import type { ComponentMeta, Dependency as IDependency, LayoutNode } from "./types";
|
|
4
3
|
import type { ThemeMode } from "./types";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
search_params: URLSearchParams;
|
|
33
|
-
render_complete?: boolean;
|
|
34
|
-
add_new_message?: (title: string, message: string, type: ToastMessage["type"]) => void;
|
|
35
|
-
};
|
|
36
|
-
events: {
|
|
37
|
-
[evt: string]: CustomEvent<any>;
|
|
38
|
-
};
|
|
39
|
-
slots: {};
|
|
40
|
-
exports?: {} | undefined;
|
|
41
|
-
bindings?: string | undefined;
|
|
4
|
+
type $$ComponentProps = {
|
|
5
|
+
root: string;
|
|
6
|
+
components: ComponentMeta[];
|
|
7
|
+
layout: LayoutNode;
|
|
8
|
+
dependencies: IDependency[];
|
|
9
|
+
title: string;
|
|
10
|
+
target: HTMLElement;
|
|
11
|
+
autoscroll: boolean;
|
|
12
|
+
footer_links: string[];
|
|
13
|
+
control_page_title: boolean;
|
|
14
|
+
app_mode: boolean;
|
|
15
|
+
theme_mode: ThemeMode;
|
|
16
|
+
app: Awaited<ReturnType<typeof Client.connect>>;
|
|
17
|
+
space_id: string | null;
|
|
18
|
+
version: string;
|
|
19
|
+
js: string | null;
|
|
20
|
+
fill_height: boolean;
|
|
21
|
+
username: string | null;
|
|
22
|
+
api_prefix: string;
|
|
23
|
+
max_file_size: number | undefined;
|
|
24
|
+
initial_layout: ComponentMeta | undefined;
|
|
25
|
+
css: string | null | undefined;
|
|
26
|
+
vibe_mode: boolean;
|
|
27
|
+
search_params: URLSearchParams;
|
|
28
|
+
render_complete: boolean;
|
|
29
|
+
ready: boolean;
|
|
30
|
+
reload_count: number;
|
|
42
31
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
export
|
|
46
|
-
export default class Blocks extends SvelteComponent<BlocksProps, BlocksEvents, BlocksSlots> {
|
|
47
|
-
get add_new_message(): (title: string, message: string, type: ToastMessage["type"]) => void;
|
|
48
|
-
}
|
|
49
|
-
export {};
|
|
32
|
+
declare const Blocks: import("svelte").Component<$$ComponentProps, {}, "ready" | "reload_count">;
|
|
33
|
+
type Blocks = ReturnType<typeof Blocks>;
|
|
34
|
+
export default Blocks;
|
package/dist/src/Embed.svelte
CHANGED
|
@@ -1,58 +1,85 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export let
|
|
8
|
-
export let
|
|
9
|
-
export let
|
|
10
|
-
export let
|
|
11
|
-
export let
|
|
12
|
-
|
|
13
|
-
export let
|
|
14
|
-
export let
|
|
15
|
-
export let
|
|
16
|
-
export let
|
|
17
|
-
export let
|
|
18
|
-
let
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getContext, onMount } from "svelte";
|
|
3
|
+
import space_logo from "./images/spaces.svg";
|
|
4
|
+
import { _ } from "svelte-i18n";
|
|
5
|
+
import { navbar_config } from "./navbar_store";
|
|
6
|
+
|
|
7
|
+
export let wrapper: HTMLDivElement;
|
|
8
|
+
export let version: string;
|
|
9
|
+
export let initial_height: string;
|
|
10
|
+
export let fill_width: boolean;
|
|
11
|
+
export let is_embed: boolean;
|
|
12
|
+
|
|
13
|
+
export let space: string | null;
|
|
14
|
+
export let display: boolean;
|
|
15
|
+
export let info: boolean;
|
|
16
|
+
export let loaded: boolean;
|
|
17
|
+
export let pages: [string, string, boolean][] = [];
|
|
18
|
+
export let current_page = "";
|
|
19
|
+
export let root: string;
|
|
20
|
+
export let components: any[] = [];
|
|
21
|
+
|
|
22
|
+
let navbar_component = components.find((c) => c.type === "navbar");
|
|
23
|
+
let navbar: {
|
|
24
|
+
visible: boolean;
|
|
25
|
+
main_page_name: string | false;
|
|
26
|
+
value: [string, string][] | null;
|
|
27
|
+
} | null = navbar_component
|
|
28
|
+
? {
|
|
29
|
+
visible: navbar_component.props.visible,
|
|
30
|
+
main_page_name: navbar_component.props.main_page_name,
|
|
31
|
+
value: navbar_component.props.value
|
|
32
|
+
}
|
|
33
|
+
: null;
|
|
34
|
+
|
|
35
|
+
if (navbar) {
|
|
36
|
+
navbar_config.set(navbar);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
$: if ($navbar_config) {
|
|
40
|
+
navbar = {
|
|
41
|
+
visible: $navbar_config.visible ?? true,
|
|
42
|
+
main_page_name: $navbar_config.main_page_name ?? "Home",
|
|
43
|
+
value: $navbar_config.value ?? null
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
$: show_navbar =
|
|
48
|
+
pages.length > 1 && (navbar === null || navbar.visible !== false);
|
|
49
|
+
|
|
50
|
+
$: effective_pages = (() => {
|
|
51
|
+
let visible_pages = pages.filter(([route, label, show], index) => {
|
|
52
|
+
if (index === 0 && route === "") {
|
|
53
|
+
return navbar?.main_page_name !== false;
|
|
54
|
+
}
|
|
55
|
+
return show !== false;
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
let base_pages =
|
|
59
|
+
navbar &&
|
|
60
|
+
navbar.main_page_name !== false &&
|
|
61
|
+
navbar.main_page_name !== "Home"
|
|
62
|
+
? visible_pages.map(([route, label, show], index) =>
|
|
63
|
+
index === 0 && route === "" && label === "Home"
|
|
64
|
+
? ([route, navbar!.main_page_name] as [string, string])
|
|
65
|
+
: ([route, label] as [string, string])
|
|
66
|
+
)
|
|
67
|
+
: visible_pages.map(
|
|
68
|
+
([route, label]) => [route, label] as [string, string]
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
if (navbar?.value && navbar.value.length > 0) {
|
|
72
|
+
const existing_routes = new Set(base_pages.map(([route]) => route));
|
|
73
|
+
const additional_pages = navbar.value
|
|
74
|
+
.map(
|
|
75
|
+
([page_name, page_path]) => [page_path, page_name] as [string, string]
|
|
76
|
+
)
|
|
77
|
+
.filter(([route]) => !existing_routes.has(route));
|
|
78
|
+
return [...base_pages, ...additional_pages];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return base_pages;
|
|
82
|
+
})();
|
|
56
83
|
</script>
|
|
57
84
|
|
|
58
85
|
<div
|
|
@@ -1,32 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
info: boolean;
|
|
12
|
-
loaded: boolean;
|
|
13
|
-
pages?: [string, string, boolean][];
|
|
14
|
-
current_page?: string;
|
|
15
|
-
root: string;
|
|
16
|
-
components?: any[];
|
|
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;
|
|
17
11
|
};
|
|
18
|
-
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
};
|
|
21
|
-
slots: {
|
|
22
|
-
default: {};
|
|
23
|
-
};
|
|
24
|
-
exports?: {} | undefined;
|
|
25
|
-
bindings?: string | undefined;
|
|
26
|
-
};
|
|
27
|
-
export type EmbedProps = typeof __propDef.props;
|
|
28
|
-
export type EmbedEvents = typeof __propDef.events;
|
|
29
|
-
export type EmbedSlots = typeof __propDef.slots;
|
|
30
|
-
export default class Embed extends SvelteComponent<EmbedProps, EmbedEvents, EmbedSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
31
13
|
}
|
|
32
|
-
|
|
14
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
+
default: any;
|
|
16
|
+
} ? Props extends Record<string, never> ? any : {
|
|
17
|
+
children?: any;
|
|
18
|
+
} : {});
|
|
19
|
+
declare const Embed: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
+
wrapper: HTMLDivElement;
|
|
21
|
+
version: string;
|
|
22
|
+
initial_height: string;
|
|
23
|
+
fill_width: boolean;
|
|
24
|
+
is_embed: boolean;
|
|
25
|
+
space: string | null;
|
|
26
|
+
display: boolean;
|
|
27
|
+
info: boolean;
|
|
28
|
+
loaded: boolean;
|
|
29
|
+
pages?: [string, string, boolean][];
|
|
30
|
+
current_page?: string;
|
|
31
|
+
root: string;
|
|
32
|
+
components?: any[];
|
|
33
|
+
}, {
|
|
34
|
+
default: {};
|
|
35
|
+
}>, {
|
|
36
|
+
[evt: string]: CustomEvent<any>;
|
|
37
|
+
}, {
|
|
38
|
+
default: {};
|
|
39
|
+
}, {}, string>;
|
|
40
|
+
type Embed = InstanceType<typeof Embed>;
|
|
41
|
+
export default Embed;
|
package/dist/src/Login.svelte
CHANGED
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
export let
|
|
9
|
-
export let
|
|
10
|
-
export let
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Form from "@gradio/form";
|
|
3
|
+
import { BaseTextbox as Textbox } from "@gradio/textbox";
|
|
4
|
+
import { BaseButton } from "@gradio/button";
|
|
5
|
+
import Column from "@gradio/column";
|
|
6
|
+
import { Block } from "@gradio/atoms";
|
|
7
|
+
import { _ } from "svelte-i18n";
|
|
8
|
+
export let root: string;
|
|
9
|
+
export let auth_message: string | null;
|
|
10
|
+
export let app_mode: boolean;
|
|
11
|
+
export let space_id: string | null;
|
|
12
|
+
|
|
13
|
+
let username = "";
|
|
14
|
+
let password = "";
|
|
15
|
+
let incorrect_credentials = false;
|
|
16
|
+
|
|
17
|
+
const submit = async (): Promise<void> => {
|
|
18
|
+
const formData = new FormData();
|
|
19
|
+
formData.append("username", username);
|
|
20
|
+
formData.append("password", password);
|
|
21
|
+
|
|
22
|
+
let response = await fetch(root + "/login", {
|
|
23
|
+
method: "POST",
|
|
24
|
+
body: formData
|
|
25
|
+
});
|
|
26
|
+
if (response.status === 400) {
|
|
27
|
+
incorrect_credentials = true;
|
|
28
|
+
username = "";
|
|
29
|
+
password = "";
|
|
30
|
+
} else if (response.status == 200) {
|
|
31
|
+
location.reload();
|
|
32
|
+
}
|
|
33
|
+
};
|
|
30
34
|
</script>
|
|
31
35
|
|
|
32
36
|
<div class="wrap" class:min-h-screen={app_mode}>
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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;
|
|
8
11
|
};
|
|
9
|
-
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {};
|
|
13
|
-
exports?: {} | undefined;
|
|
14
|
-
bindings?: string | undefined;
|
|
15
|
-
};
|
|
16
|
-
export type LoginProps = typeof __propDef.props;
|
|
17
|
-
export type LoginEvents = typeof __propDef.events;
|
|
18
|
-
export type LoginSlots = typeof __propDef.slots;
|
|
19
|
-
export default class Login extends SvelteComponent<LoginProps, LoginEvents, LoginSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
20
13
|
}
|
|
21
|
-
|
|
14
|
+
declare const Login: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
root: string;
|
|
16
|
+
auth_message: string | null;
|
|
17
|
+
app_mode: boolean;
|
|
18
|
+
space_id: string | null;
|
|
19
|
+
}, {
|
|
20
|
+
[evt: string]: CustomEvent<any>;
|
|
21
|
+
}, {}, {}, string>;
|
|
22
|
+
type Login = InstanceType<typeof Login>;
|
|
23
|
+
export default Login;
|
|
@@ -1,28 +1,22 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export let theme_mode;
|
|
7
|
-
export let version;
|
|
8
|
-
export let autoscroll;
|
|
9
|
-
export let max_file_size = null;
|
|
10
|
-
export let client;
|
|
11
|
-
const dispatch = createEventDispatcher();
|
|
12
|
-
onMount(() => {
|
|
13
|
-
dispatch("mount");
|
|
14
|
-
});
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Self from "./MountComponents.svelte";
|
|
3
|
+
let { node } = $props();
|
|
4
|
+
|
|
5
|
+
let component = $derived(await node.component);
|
|
15
6
|
</script>
|
|
16
7
|
|
|
17
|
-
{#if
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
8
|
+
{#if node && component}
|
|
9
|
+
{#if node.props.shared_props.visible}
|
|
10
|
+
<svelte:component
|
|
11
|
+
this={component.default}
|
|
12
|
+
shared_props={node.props.shared_props}
|
|
13
|
+
props={node.props.props}
|
|
14
|
+
>
|
|
15
|
+
{#if node.children && node.children.length}
|
|
16
|
+
{#each node.children as _node}
|
|
17
|
+
<Self node={_node} />
|
|
18
|
+
{/each}
|
|
19
|
+
{/if}
|
|
20
|
+
</svelte:component>
|
|
21
|
+
{/if}
|
|
28
22
|
{/if}
|
|
@@ -1,28 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
root: any;
|
|
7
|
-
target: any;
|
|
8
|
-
theme_mode: any;
|
|
9
|
-
version: any;
|
|
10
|
-
autoscroll: boolean;
|
|
11
|
-
max_file_size?: number | null;
|
|
12
|
-
client: Client;
|
|
13
|
-
};
|
|
14
|
-
events: {
|
|
15
|
-
mount?: CustomEvent<undefined> | undefined;
|
|
16
|
-
} & {
|
|
17
|
-
[evt: string]: CustomEvent<any>;
|
|
18
|
-
};
|
|
19
|
-
slots: {};
|
|
20
|
-
exports?: {} | undefined;
|
|
21
|
-
bindings?: string | undefined;
|
|
22
|
-
};
|
|
23
|
-
export type MountComponentsProps = typeof __propDef.props;
|
|
24
|
-
export type MountComponentsEvents = typeof __propDef.events;
|
|
25
|
-
export type MountComponentsSlots = typeof __propDef.slots;
|
|
26
|
-
export default class MountComponents extends SvelteComponent<MountComponentsProps, MountComponentsEvents, MountComponentsSlots> {
|
|
27
|
-
}
|
|
28
|
-
export {};
|
|
1
|
+
declare const MountComponents: import("svelte").Component<{
|
|
2
|
+
node: any;
|
|
3
|
+
}, {}, "">;
|
|
4
|
+
type MountComponents = ReturnType<typeof MountComponents>;
|
|
5
|
+
export default MountComponents;
|
|
@@ -7,6 +7,8 @@ export interface UpdateTransaction {
|
|
|
7
7
|
value: any;
|
|
8
8
|
prop: string;
|
|
9
9
|
}
|
|
10
|
+
type set_data_type = (data: Record<string, unknown>) => void;
|
|
11
|
+
type get_data_type = () => Promise<Record<string, unknown>>;
|
|
10
12
|
/**
|
|
11
13
|
* Create a store with the layout and a map of targets
|
|
12
14
|
* @returns A store with the layout and a map of targets
|
|
@@ -16,13 +18,12 @@ export declare function create_components({ initial_layout }?: {
|
|
|
16
18
|
}): {
|
|
17
19
|
layout: Writable<ComponentMeta>;
|
|
18
20
|
targets: Writable<TargetMap>;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
get_data: (id: number) => Promise<unknown> | void;
|
|
22
|
+
set_data: (id: number, data: Record<string, unknown>) => void;
|
|
21
23
|
modify_stream: (id: number, state: "open" | "waiting" | "closed") => void;
|
|
22
24
|
get_stream_state: (id: number) => "open" | "waiting" | "closed" | "not_set";
|
|
23
25
|
set_time_limit: (id: number, time_limit: number | undefined) => void;
|
|
24
26
|
loading_status: ReturnType<typeof create_loading_status_store>;
|
|
25
|
-
scheduled_updates: Writable<boolean>;
|
|
26
27
|
create_layout: (args: {
|
|
27
28
|
app: client_return;
|
|
28
29
|
components: ComponentMeta[];
|
|
@@ -40,7 +41,7 @@ export declare function create_components({ initial_layout }?: {
|
|
|
40
41
|
root: string;
|
|
41
42
|
dependencies: Dependency[];
|
|
42
43
|
}) => void;
|
|
43
|
-
|
|
44
|
+
register_component: (id: number, set: set_data_type, get: get_data_type) => void;
|
|
44
45
|
};
|
|
45
46
|
/** An async version of 'new Function' */
|
|
46
47
|
export declare const AsyncFunction: new (...args: string[]) => (...args: any[]) => Promise<any>;
|