@gradio/core 1.0.0-dev.0 → 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.
Files changed (106) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/src/Blocks.svelte +518 -1001
  5. package/dist/src/Blocks.svelte.d.ts +31 -45
  6. package/dist/src/Embed.svelte +82 -55
  7. package/dist/src/Embed.svelte.d.ts +39 -30
  8. package/dist/src/Login.svelte +33 -29
  9. package/dist/src/Login.svelte.d.ts +21 -19
  10. package/dist/src/MountComponents.svelte +19 -25
  11. package/dist/src/MountComponents.svelte.d.ts +5 -28
  12. package/dist/src/{init.d.ts → _init.d.ts} +5 -4
  13. package/dist/src/{init.js → _init.js} +31 -108
  14. package/dist/src/api_docs/ApiBanner.svelte +12 -8
  15. package/dist/src/api_docs/ApiBanner.svelte.d.ts +22 -20
  16. package/dist/src/api_docs/ApiDocs.svelte +337 -245
  17. package/dist/src/api_docs/ApiDocs.svelte.d.ts +26 -24
  18. package/dist/src/api_docs/ApiRecorder.svelte +9 -3
  19. package/dist/src/api_docs/ApiRecorder.svelte.d.ts +19 -17
  20. package/dist/src/api_docs/CodeSnippet.svelte +60 -30
  21. package/dist/src/api_docs/CodeSnippet.svelte.d.ts +27 -24
  22. package/dist/src/api_docs/CopyButton.svelte +69 -13
  23. package/dist/src/api_docs/CopyButton.svelte.d.ts +18 -16
  24. package/dist/src/api_docs/CopyMarkdown.svelte +734 -0
  25. package/dist/src/api_docs/CopyMarkdown.svelte.d.ts +37 -0
  26. package/dist/src/api_docs/EndpointDetail.svelte +8 -6
  27. package/dist/src/api_docs/EndpointDetail.svelte.d.ts +20 -18
  28. package/dist/src/api_docs/IconArrowUpRight.svelte +34 -0
  29. package/dist/src/api_docs/IconArrowUpRight.svelte.d.ts +20 -0
  30. package/dist/src/api_docs/IconCaret.svelte +39 -0
  31. package/dist/src/api_docs/IconCaret.svelte.d.ts +20 -0
  32. package/dist/src/api_docs/IconHuggingChat.svelte +62 -0
  33. package/dist/src/api_docs/IconHuggingChat.svelte.d.ts +20 -0
  34. package/dist/src/api_docs/InputPayload.svelte +17 -11
  35. package/dist/src/api_docs/InputPayload.svelte.d.ts +25 -23
  36. package/dist/src/api_docs/InstallSnippet.svelte +9 -6
  37. package/dist/src/api_docs/InstallSnippet.svelte.d.ts +18 -16
  38. package/dist/src/api_docs/MCPSnippet.svelte +119 -99
  39. package/dist/src/api_docs/MCPSnippet.svelte.d.ts +59 -58
  40. package/dist/src/api_docs/NoApi.svelte +7 -4
  41. package/dist/src/api_docs/NoApi.svelte.d.ts +20 -18
  42. package/dist/src/api_docs/ParametersSnippet.svelte +8 -6
  43. package/dist/src/api_docs/ParametersSnippet.svelte.d.ts +21 -19
  44. package/dist/src/api_docs/RecordingSnippet.svelte +124 -110
  45. package/dist/src/api_docs/RecordingSnippet.svelte.d.ts +24 -22
  46. package/dist/src/api_docs/ResponseSnippet.svelte +7 -5
  47. package/dist/src/api_docs/ResponseSnippet.svelte.d.ts +21 -19
  48. package/dist/src/api_docs/Settings.svelte +73 -62
  49. package/dist/src/api_docs/Settings.svelte.d.ts +25 -23
  50. package/dist/src/api_docs/SettingsBanner.svelte +11 -8
  51. package/dist/src/api_docs/SettingsBanner.svelte.d.ts +20 -18
  52. package/dist/src/api_docs/TryButton.svelte +5 -3
  53. package/dist/src/api_docs/TryButton.svelte.d.ts +19 -17
  54. package/dist/src/api_docs/img/IconCheck.svelte +33 -0
  55. package/dist/src/api_docs/img/IconCheck.svelte.d.ts +26 -0
  56. package/dist/src/api_docs/img/IconCopy.svelte +40 -0
  57. package/dist/src/api_docs/img/IconCopy.svelte.d.ts +26 -0
  58. package/dist/src/api_docs/img/clear.svelte.d.ts +22 -21
  59. package/dist/src/dependency.d.ts +142 -0
  60. package/dist/src/dependency.js +653 -0
  61. package/dist/src/init.svelte.d.ts +78 -0
  62. package/dist/src/init.svelte.js +469 -0
  63. package/dist/src/init_utils.d.ts +32 -0
  64. package/dist/src/init_utils.js +73 -0
  65. package/dist/src/lang/en.json +10 -1
  66. package/dist/src/lang/get_lang_names.js +0 -3
  67. package/dist/src/lang/ru.json +10 -1
  68. package/dist/src/stores.d.ts +0 -21
  69. package/dist/src/stories/I18nMultiLanguageTestComponent.svelte +5 -3
  70. package/dist/src/stories/I18nMultiLanguageTestComponent.svelte.d.ts +16 -14
  71. package/dist/src/stories/I18nTestSetup.svelte +14 -10
  72. package/dist/src/stories/I18nTestSetup.svelte.d.ts +18 -16
  73. package/dist/src/types.d.ts +30 -26
  74. package/index.ts +1 -1
  75. package/package.json +59 -59
  76. package/src/Blocks.svelte +344 -1063
  77. package/src/MountComponents.svelte +17 -27
  78. package/src/{init.ts → _init.ts} +49 -126
  79. package/src/api_docs/ApiDocs.svelte +65 -60
  80. package/src/api_docs/ApiRecorder.svelte +3 -0
  81. package/src/api_docs/CodeSnippet.svelte +20 -5
  82. package/src/api_docs/CopyButton.svelte +61 -7
  83. package/src/api_docs/CopyMarkdown.svelte +734 -0
  84. package/src/api_docs/IconArrowUpRight.svelte +34 -0
  85. package/src/api_docs/IconCaret.svelte +39 -0
  86. package/src/api_docs/IconHuggingChat.svelte +62 -0
  87. package/src/api_docs/MCPSnippet.svelte +24 -46
  88. package/src/api_docs/ParametersSnippet.svelte +1 -1
  89. package/src/api_docs/ResponseSnippet.svelte +1 -1
  90. package/src/api_docs/Settings.svelte +11 -11
  91. package/src/api_docs/img/IconCheck.svelte +33 -0
  92. package/src/api_docs/img/IconCopy.svelte +40 -0
  93. package/src/dependency.ts +880 -0
  94. package/src/init.svelte.ts +717 -0
  95. package/src/init_utils.ts +99 -0
  96. package/src/lang/en.json +10 -1
  97. package/src/lang/get_lang_names.js +0 -3
  98. package/src/lang/ru.json +10 -1
  99. package/src/stores.ts +22 -22
  100. package/src/types.ts +54 -43
  101. package/dist/src/Render.svelte +0 -105
  102. package/dist/src/Render.svelte.d.ts +0 -31
  103. package/dist/src/RenderComponent.svelte +0 -72
  104. package/dist/src/RenderComponent.svelte.d.ts +0 -33
  105. package/src/Render.svelte +0 -126
  106. package/src/RenderComponent.svelte +0 -91
@@ -1,113 +1,127 @@
1
- <script>import CopyButton from "./CopyButton.svelte";
2
- import { Block } from "@gradio/atoms";
3
- import { represent_value } from "./utils";
4
- import { onMount, tick } from "svelte";
5
- export let dependencies;
6
- export let short_root;
7
- export let root;
8
- export let api_prefix = "";
9
- export let current_language;
10
- export let username;
11
- let python_code;
12
- let python_code_text;
13
- let js_code;
14
- let bash_code;
15
- export let api_calls = [];
16
- async function get_info() {
17
- let response = await fetch(
18
- root.replace(/\/$/, "") + api_prefix + "/info/?all_endpoints=true"
19
- );
20
- let data = await response.json();
21
- return data;
22
- }
23
- let endpoints_info;
24
- let py_zipped = [];
25
- let js_zipped = [];
26
- let bash_zipped = [];
27
- function format_api_call(call, lang) {
28
- const api_name = `/${dependencies[call.fn_index].api_name}`;
29
- let call_data_excluding_state = call.data.filter(
30
- (d) => typeof d !== "undefined"
31
- );
32
- const params = call_data_excluding_state.map((param, index) => {
33
- if (endpoints_info[api_name]) {
34
- const param_info = endpoints_info[api_name].parameters[index];
35
- if (!param_info) {
36
- return void 0;
37
- }
38
- const param_name = param_info.parameter_name;
39
- const python_type = param_info.python_type.type;
40
- if (lang === "py") {
41
- return ` ${param_name}=${represent_value(
42
- param,
43
- python_type,
44
- "py"
45
- )}`;
46
- } else if (lang === "js") {
47
- return ` ${param_name}: ${represent_value(
48
- param,
49
- python_type,
50
- "js"
51
- )}`;
52
- } else if (lang === "bash") {
53
- return ` ${represent_value(
54
- param,
55
- python_type,
56
- "bash"
57
- )}`;
58
- }
59
- }
60
- return ` ${represent_value(param, void 0, lang)}`;
61
- }).filter((d) => typeof d !== "undefined").join(",\n");
62
- if (params) {
63
- if (lang === "py") {
64
- return `${params},
65
- `;
66
- } else if (lang === "js") {
67
- return `{
68
- ${params},
69
- }`;
70
- } else if (lang === "bash") {
71
- return `
72
- ${params}
73
- `;
74
- }
75
- }
76
- if (lang === "py") {
77
- return "";
78
- }
79
- return "\n";
80
- }
81
- onMount(async () => {
82
- const data = await get_info();
83
- endpoints_info = data["named_endpoints"];
84
- let py_api_calls = api_calls.map(
85
- (call) => format_api_call(call, "py")
86
- );
87
- let js_api_calls = api_calls.map(
88
- (call) => format_api_call(call, "js")
89
- );
90
- let bash_api_calls = api_calls.map(
91
- (call) => format_api_call(call, "bash")
92
- );
93
- let api_names = api_calls.map(
94
- (call) => dependencies[call.fn_index].api_name || ""
95
- );
96
- py_zipped = py_api_calls.map((call, index) => ({
97
- call,
98
- api_name: api_names[index]
99
- }));
100
- js_zipped = js_api_calls.map((call, index) => ({
101
- call,
102
- api_name: api_names[index]
103
- }));
104
- bash_zipped = bash_api_calls.map((call, index) => ({
105
- call,
106
- api_name: api_names[index]
107
- }));
108
- await tick();
109
- python_code_text = python_code.innerText;
110
- });
1
+ <script lang="ts">
2
+ import type { Dependency, Payload } from "../types";
3
+ import CopyButton from "./CopyButton.svelte";
4
+ import { Block } from "@gradio/atoms";
5
+ import { represent_value } from "./utils";
6
+ import { onMount, tick } from "svelte";
7
+
8
+ export let dependencies: Dependency[];
9
+ export let short_root: string;
10
+ export let root: string;
11
+ export let api_prefix = "";
12
+ export let current_language: "python" | "javascript" | "bash" | "mcp";
13
+ export let username: string | null;
14
+
15
+ let python_code: HTMLElement;
16
+ let python_code_text: string;
17
+ let js_code: HTMLElement;
18
+ let bash_code: HTMLElement;
19
+
20
+ export let api_calls: Payload[] = [];
21
+
22
+ async function get_info(): Promise<{
23
+ named_endpoints: any;
24
+ unnamed_endpoints: any;
25
+ }> {
26
+ let response = await fetch(
27
+ root.replace(/\/$/, "") + api_prefix + "/info/?all_endpoints=true"
28
+ );
29
+ let data = await response.json();
30
+ return data;
31
+ }
32
+
33
+ let endpoints_info: any;
34
+ let py_zipped: { call: string; api_name: string }[] = [];
35
+ let js_zipped: { call: string; api_name: string }[] = [];
36
+ let bash_zipped: { call: string; api_name: string }[] = [];
37
+
38
+ function format_api_call(call: Payload, lang: "py" | "js" | "bash"): string {
39
+ const api_name = `/${dependencies[call.fn_index].api_name}`;
40
+ // If an input is undefined (distinct from null) then it corresponds to a State component.
41
+ let call_data_excluding_state = call.data.filter(
42
+ (d) => typeof d !== "undefined"
43
+ );
44
+
45
+ const params = call_data_excluding_state
46
+ .map((param, index) => {
47
+ if (endpoints_info[api_name]) {
48
+ const param_info = endpoints_info[api_name].parameters[index];
49
+ if (!param_info) {
50
+ return undefined;
51
+ }
52
+ const param_name = param_info.parameter_name;
53
+ const python_type = param_info.python_type.type;
54
+ if (lang === "py") {
55
+ return ` ${param_name}=${represent_value(
56
+ param as string,
57
+ python_type,
58
+ "py"
59
+ )}`;
60
+ } else if (lang === "js") {
61
+ return ` ${param_name}: ${represent_value(
62
+ param as string,
63
+ python_type,
64
+ "js"
65
+ )}`;
66
+ } else if (lang === "bash") {
67
+ return ` ${represent_value(
68
+ param as string,
69
+ python_type,
70
+ "bash"
71
+ )}`;
72
+ }
73
+ }
74
+ return ` ${represent_value(param as string, undefined, lang)}`;
75
+ })
76
+ .filter((d) => typeof d !== "undefined")
77
+ .join(",\n");
78
+ if (params) {
79
+ if (lang === "py") {
80
+ return `${params},\n`;
81
+ } else if (lang === "js") {
82
+ return `{\n${params},\n}`;
83
+ } else if (lang === "bash") {
84
+ return `\n${params}\n`;
85
+ }
86
+ }
87
+ if (lang === "py") {
88
+ return "";
89
+ }
90
+ return "\n";
91
+ }
92
+
93
+ onMount(async () => {
94
+ const data = await get_info();
95
+ endpoints_info = data["named_endpoints"];
96
+ let py_api_calls: string[] = api_calls.map((call) =>
97
+ format_api_call(call, "py")
98
+ );
99
+ let js_api_calls: string[] = api_calls.map((call) =>
100
+ format_api_call(call, "js")
101
+ );
102
+ let bash_api_calls: string[] = api_calls.map((call) =>
103
+ format_api_call(call, "bash")
104
+ );
105
+ let api_names: string[] = api_calls.map(
106
+ (call) => dependencies[call.fn_index].api_name || ""
107
+ );
108
+ py_zipped = py_api_calls.map((call, index) => ({
109
+ call,
110
+ api_name: api_names[index]
111
+ }));
112
+ js_zipped = js_api_calls.map((call, index) => ({
113
+ call,
114
+ api_name: api_names[index]
115
+ }));
116
+ bash_zipped = bash_api_calls.map((call, index) => ({
117
+ call,
118
+ api_name: api_names[index]
119
+ }));
120
+
121
+ await tick();
122
+
123
+ python_code_text = python_code.innerText;
124
+ });
111
125
  </script>
112
126
 
113
127
  <div class="container">
@@ -1,25 +1,27 @@
1
- import { SvelteComponent } from "svelte";
2
1
  import type { Dependency, Payload } from "../types";
3
- declare const __propDef: {
4
- props: {
5
- dependencies: Dependency[];
6
- short_root: string;
7
- root: string;
8
- api_prefix?: string;
9
- current_language: "python" | "javascript" | "bash" | "mcp";
10
- username: string | null;
11
- api_calls?: Payload[];
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
12
  };
13
- events: {
14
- [evt: string]: CustomEvent<any>;
15
- };
16
- slots: {};
17
- exports?: {} | undefined;
18
- bindings?: string | undefined;
19
- };
20
- export type RecordingSnippetProps = typeof __propDef.props;
21
- export type RecordingSnippetEvents = typeof __propDef.events;
22
- export type RecordingSnippetSlots = typeof __propDef.slots;
23
- export default class RecordingSnippet extends SvelteComponent<RecordingSnippetProps, RecordingSnippetEvents, RecordingSnippetSlots> {
13
+ z_$$bindings?: Bindings;
24
14
  }
25
- export {};
15
+ declare const RecordingSnippet: $$__sveltets_2_IsomorphicComponent<{
16
+ dependencies: Dependency[];
17
+ short_root: string;
18
+ root: string;
19
+ api_prefix?: string;
20
+ current_language: "python" | "javascript" | "bash" | "mcp";
21
+ username: string | null;
22
+ api_calls?: Payload[];
23
+ }, {
24
+ [evt: string]: CustomEvent<any>;
25
+ }, {}, {}, string>;
26
+ type RecordingSnippet = InstanceType<typeof RecordingSnippet>;
27
+ export default RecordingSnippet;
@@ -1,8 +1,10 @@
1
- <script>import { Loader } from "@gradio/statustracker";
2
- export let is_running;
3
- export let endpoint_returns;
4
- export let js_returns;
5
- export let current_language;
1
+ <script lang="ts">
2
+ import { Loader } from "@gradio/statustracker";
3
+
4
+ export let is_running: boolean;
5
+ export let endpoint_returns: any;
6
+ export let js_returns: any;
7
+ export let current_language: "python" | "javascript" | "bash" | "mcp";
6
8
  </script>
7
9
 
8
10
  <h4>
@@ -1,21 +1,23 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- is_running: boolean;
5
- endpoint_returns: any;
6
- js_returns: any;
7
- current_language: "python" | "javascript" | "bash";
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
- events: {
10
- [evt: string]: CustomEvent<any>;
11
- };
12
- slots: {};
13
- exports?: {} | undefined;
14
- bindings?: string | undefined;
15
- };
16
- export type ResponseSnippetProps = typeof __propDef.props;
17
- export type ResponseSnippetEvents = typeof __propDef.events;
18
- export type ResponseSnippetSlots = typeof __propDef.slots;
19
- export default class ResponseSnippet extends SvelteComponent<ResponseSnippetProps, ResponseSnippetEvents, ResponseSnippetSlots> {
12
+ z_$$bindings?: Bindings;
20
13
  }
21
- export {};
14
+ declare const ResponseSnippet: $$__sveltets_2_IsomorphicComponent<{
15
+ is_running: boolean;
16
+ endpoint_returns: any;
17
+ js_returns: any;
18
+ current_language: "python" | "javascript" | "bash" | "mcp";
19
+ }, {
20
+ [evt: string]: CustomEvent<any>;
21
+ }, {}, {}, string>;
22
+ type ResponseSnippet = InstanceType<typeof ResponseSnippet>;
23
+ export default ResponseSnippet;
@@ -1,65 +1,76 @@
1
- <script>import { onMount } from "svelte";
2
- import SettingsBanner from "./SettingsBanner.svelte";
3
- export let root;
4
- export let space_id;
5
- export let pwa_enabled;
6
- import { BaseDropdown as Dropdown } from "@gradio/dropdown";
7
- import { BaseCheckbox as Checkbox } from "@gradio/checkbox";
8
- import { language_choices, changeLocale } from "../i18n";
9
- import { locale, _ } from "svelte-i18n";
10
- import { setupi18n } from "../i18n";
11
- import record from "./img/record.svg";
12
- import { createEventDispatcher } from "svelte";
13
- const dispatch = createEventDispatcher();
14
- if (root === "") {
15
- root = location.protocol + "//" + location.host + location.pathname;
16
- }
17
- if (!root.endsWith("/")) {
18
- root += "/";
19
- }
20
- function setTheme(theme) {
21
- const url = new URL(window.location.href);
22
- if (theme === "system") {
23
- url.searchParams.delete("__theme");
24
- current_theme = "system";
25
- } else {
26
- url.searchParams.set("__theme", theme);
27
- current_theme = theme;
28
- }
29
- window.location.href = url.toString();
30
- }
31
- onMount(() => {
32
- document.body.style.overflow = "hidden";
33
- if ("parentIFrame" in window) {
34
- window.parentIFrame?.scrollTo(0, 0);
35
- }
36
- const url = new URL(window.location.href);
37
- const theme = url.searchParams.get("__theme");
38
- current_theme = theme || "system";
39
- return () => {
40
- document.body.style.overflow = "auto";
41
- };
42
- });
43
- let current_locale;
44
- let current_theme = "system";
45
- export let allow_zoom = true;
46
- export let allow_video_trim = true;
47
- locale.subscribe((value) => {
48
- if (value) {
49
- current_locale = value;
50
- }
51
- });
52
- function handleLanguageChange(e) {
53
- const new_locale = e.detail;
54
- changeLocale(new_locale);
55
- }
56
- function handleZoomChange(e) {
57
- allow_zoom = e.detail;
58
- }
59
- function handleVideoTrimChange(e) {
60
- allow_video_trim = e.detail;
61
- }
62
- setupi18n();
1
+ <script lang="ts">
2
+ /* eslint-disable */
3
+ import { onMount } from "svelte";
4
+ import SettingsBanner from "./SettingsBanner.svelte";
5
+ import { BaseDropdown as Dropdown } from "@gradio/dropdown";
6
+ import { BaseCheckbox as Checkbox } from "@gradio/checkbox";
7
+ import { language_choices, changeLocale } from "../i18n";
8
+ import { locale, _ } from "svelte-i18n";
9
+ import record from "./img/record.svg";
10
+ import { createEventDispatcher } from "svelte";
11
+
12
+ let {
13
+ root,
14
+ space_id,
15
+ pwa_enabled,
16
+ allow_zoom = $bindable(),
17
+ allow_video_trim = $bindable()
18
+ } = $props();
19
+
20
+ const dispatch = createEventDispatcher();
21
+ if (root === "") {
22
+ root = location.protocol + "//" + location.host + location.pathname;
23
+ }
24
+ if (!root.endsWith("/")) {
25
+ root += "/";
26
+ }
27
+
28
+ function setTheme(theme: "light" | "dark" | "system") {
29
+ const url = new URL(window.location.href);
30
+ if (theme === "system") {
31
+ url.searchParams.delete("__theme");
32
+ current_theme = "system";
33
+ } else {
34
+ url.searchParams.set("__theme", theme);
35
+ current_theme = theme;
36
+ }
37
+ window.location.href = url.toString();
38
+ }
39
+
40
+ onMount(() => {
41
+ // document.body.style.overflow = "hidden";
42
+ if ("parentIFrame" in window) {
43
+ window.parentIFrame?.scrollTo(0, 0);
44
+ }
45
+ const url = new URL(window.location.href);
46
+ const theme = url.searchParams.get("__theme");
47
+ current_theme = (theme as "light" | "dark" | "system") || "system";
48
+ return () => {
49
+ document.body.style.overflow = "auto";
50
+ };
51
+ });
52
+
53
+ let current_locale: string = $state("en");
54
+ let current_theme: "light" | "dark" | "system" = $state("system");
55
+
56
+ locale.subscribe((value) => {
57
+ if (value) {
58
+ current_locale = value;
59
+ }
60
+ });
61
+
62
+ function handleLanguageChange(e: CustomEvent): void {
63
+ const new_locale = e.detail;
64
+ changeLocale(new_locale);
65
+ }
66
+
67
+ function handleZoomChange(e: CustomEvent): void {
68
+ allow_zoom = e.detail;
69
+ }
70
+
71
+ function handleVideoTrimChange(e: CustomEvent): void {
72
+ allow_video_trim = e.detail;
73
+ }
63
74
  </script>
64
75
 
65
76
  <div class="banner-wrap">
@@ -1,25 +1,27 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- root: string;
5
- space_id: string | null;
6
- pwa_enabled: boolean | undefined;
7
- allow_zoom?: boolean;
8
- allow_video_trim?: boolean;
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;
9
11
  };
10
- events: {
11
- close: CustomEvent<any>;
12
- start_recording: CustomEvent<any>;
13
- } & {
14
- [evt: string]: CustomEvent<any>;
15
- };
16
- slots: {};
17
- exports?: {} | undefined;
18
- bindings?: string | undefined;
19
- };
20
- export type SettingsProps = typeof __propDef.props;
21
- export type SettingsEvents = typeof __propDef.events;
22
- export type SettingsSlots = typeof __propDef.slots;
23
- export default class Settings extends SvelteComponent<SettingsProps, SettingsEvents, SettingsSlots> {
12
+ z_$$bindings?: Bindings;
24
13
  }
25
- export {};
14
+ declare const Settings: $$__sveltets_2_IsomorphicComponent<{
15
+ root: any;
16
+ space_id: any;
17
+ pwa_enabled: any;
18
+ allow_zoom?: any;
19
+ allow_video_trim?: any;
20
+ }, {
21
+ close: CustomEvent<any>;
22
+ start_recording: CustomEvent<any>;
23
+ } & {
24
+ [evt: string]: CustomEvent<any>;
25
+ }, {}, {}, "allow_zoom" | "allow_video_trim">;
26
+ type Settings = InstanceType<typeof Settings>;
27
+ export default Settings;
@@ -1,11 +1,14 @@
1
- <script>import { createEventDispatcher } from "svelte";
2
- import { _ } from "svelte-i18n";
3
- import settings_logo from "./img/settings-logo.svg";
4
- import Clear from "./img/clear.svelte";
5
- import { setupi18n } from "../i18n";
6
- export let root;
7
- const dispatch = createEventDispatcher();
8
- setupi18n();
1
+ <script lang="ts">
2
+ import { createEventDispatcher } from "svelte";
3
+ import { _ } from "svelte-i18n";
4
+ import settings_logo from "./img/settings-logo.svg";
5
+ import Clear from "./img/clear.svelte";
6
+ import { setupi18n } from "../i18n";
7
+
8
+ export let root: string;
9
+
10
+ const dispatch = createEventDispatcher();
11
+ setupi18n();
9
12
  </script>
10
13
 
11
14
  <h2>
@@ -1,20 +1,22 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- root: string;
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
- events: {
7
- close: CustomEvent<any>;
8
- } & {
9
- [evt: string]: CustomEvent<any>;
10
- };
11
- slots: {};
12
- exports?: {} | undefined;
13
- bindings?: string | undefined;
14
- };
15
- export type SettingsBannerProps = typeof __propDef.props;
16
- export type SettingsBannerEvents = typeof __propDef.events;
17
- export type SettingsBannerSlots = typeof __propDef.slots;
18
- export default class SettingsBanner extends SvelteComponent<SettingsBannerProps, SettingsBannerEvents, SettingsBannerSlots> {
12
+ z_$$bindings?: Bindings;
19
13
  }
20
- export {};
14
+ declare const SettingsBanner: $$__sveltets_2_IsomorphicComponent<{
15
+ root: string;
16
+ }, {
17
+ close: CustomEvent<any>;
18
+ } & {
19
+ [evt: string]: CustomEvent<any>;
20
+ }, {}, {}, string>;
21
+ type SettingsBanner = InstanceType<typeof SettingsBanner>;
22
+ export default SettingsBanner;
@@ -1,6 +1,8 @@
1
- <script>import { BaseButton } from "@gradio/button";
2
- export let dependency_index;
3
- export let run;
1
+ <script lang="ts">
2
+ import { BaseButton } from "@gradio/button";
3
+
4
+ export let dependency_index: number;
5
+ export let run: (id: number) => Promise<void>;
4
6
  </script>
5
7
 
6
8
  <span class="space" />