@gradio/core 1.0.1 → 1.0.2
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 +20 -0
- package/dist/src/Blocks.svelte +53 -35
- package/dist/src/api_docs/Settings.svelte +21 -22
- package/dist/src/api_docs/Settings.svelte.d.ts +6 -21
- package/dist/src/api_docs/SettingsBanner.svelte +2 -4
- package/dist/src/api_docs/SettingsBanner.svelte.d.ts +5 -20
- package/dist/src/dependency.js +8 -0
- package/dist/src/init.svelte.d.ts +6 -2
- package/dist/src/init.svelte.js +156 -22
- package/dist/src/types.d.ts +1 -0
- package/package.json +31 -31
- package/src/Blocks.svelte +53 -35
- package/src/api_docs/Settings.svelte +21 -22
- package/src/api_docs/SettingsBanner.svelte +2 -4
- package/src/dependency.ts +8 -1
- package/src/init.svelte.ts +202 -30
- package/src/init.test.ts +1 -1
- package/src/types.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @gradio/core
|
|
2
2
|
|
|
3
|
+
## 1.0.2
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- [#12515](https://github.com/gradio-app/gradio/pull/12515) [`0892c29`](https://github.com/gradio-app/gradio/commit/0892c297b35742ed5cabf64d0846fd36ae02ecea) - Fix plot Rendering + visibility bug. Thanks @freddyaboulton!
|
|
8
|
+
- [#12493](https://github.com/gradio-app/gradio/pull/12493) [`8a6cff6`](https://github.com/gradio-app/gradio/commit/8a6cff6738d09a6e708fc6351d806967fa82ca91) - Fix bug where cancelling an events shows an error in the UI. Thanks @freddyaboulton!
|
|
9
|
+
- [#12518](https://github.com/gradio-app/gradio/pull/12518) [`e8efab2`](https://github.com/gradio-app/gradio/commit/e8efab2cb19860146cec7946e77b34a599ad6258) - Fix Settings. Thanks @freddyaboulton!
|
|
10
|
+
- [#12491](https://github.com/gradio-app/gradio/pull/12491) [`4f6327b`](https://github.com/gradio-app/gradio/commit/4f6327be6815fc8d574b60272b02915c75359ace) - Load visible components in 6.0. Thanks @freddyaboulton!
|
|
11
|
+
|
|
12
|
+
### Dependency updates
|
|
13
|
+
|
|
14
|
+
- @gradio/button@0.6.0
|
|
15
|
+
- @gradio/dropdown@0.10.7
|
|
16
|
+
- @gradio/textbox@0.12.1
|
|
17
|
+
- @gradio/tabs@0.5.3
|
|
18
|
+
- @gradio/tabitem@0.6.3
|
|
19
|
+
- @gradio/audio@0.21.0
|
|
20
|
+
- @gradio/video@0.18.0
|
|
21
|
+
- @gradio/checkbox@0.5.1
|
|
22
|
+
|
|
3
23
|
## 1.0.1
|
|
4
24
|
|
|
5
25
|
### Fixes
|
package/dist/src/Blocks.svelte
CHANGED
|
@@ -104,27 +104,6 @@
|
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
106
|
|
|
107
|
-
let app_tree = new AppTree(
|
|
108
|
-
components,
|
|
109
|
-
layout,
|
|
110
|
-
dependencies,
|
|
111
|
-
{
|
|
112
|
-
root,
|
|
113
|
-
theme: theme_mode,
|
|
114
|
-
version,
|
|
115
|
-
api_prefix,
|
|
116
|
-
max_file_size,
|
|
117
|
-
autoscroll
|
|
118
|
-
},
|
|
119
|
-
app,
|
|
120
|
-
$reactive_formatter
|
|
121
|
-
);
|
|
122
|
-
|
|
123
|
-
setContext(GRADIO_ROOT, {
|
|
124
|
-
register: app_tree.register_component.bind(app_tree),
|
|
125
|
-
dispatcher: gradio_event_dispatcher
|
|
126
|
-
});
|
|
127
|
-
|
|
128
107
|
let messages: (ToastMessage & { fn_index: number })[] = $state([]);
|
|
129
108
|
|
|
130
109
|
function gradio_event_dispatcher(
|
|
@@ -142,6 +121,12 @@
|
|
|
142
121
|
new_message("Warning", data as string, -1, event, 10, true);
|
|
143
122
|
} else if (event === "info") {
|
|
144
123
|
new_message("Info", data as string, -1, event, 10, true);
|
|
124
|
+
} else if (event === "gradio_expand" || event === "gradio_tab_select") {
|
|
125
|
+
const id_ =
|
|
126
|
+
event === "gradio_expand"
|
|
127
|
+
? id
|
|
128
|
+
: (data as { component_id: number }).component_id;
|
|
129
|
+
app_tree.render_previously_invisible_children(id_);
|
|
145
130
|
} else if (event == "clear_status") {
|
|
146
131
|
app_tree.update_state(
|
|
147
132
|
id,
|
|
@@ -173,6 +158,28 @@
|
|
|
173
158
|
}
|
|
174
159
|
}
|
|
175
160
|
|
|
161
|
+
let app_tree = new AppTree(
|
|
162
|
+
components,
|
|
163
|
+
layout,
|
|
164
|
+
dependencies,
|
|
165
|
+
{
|
|
166
|
+
root,
|
|
167
|
+
theme: theme_mode,
|
|
168
|
+
version,
|
|
169
|
+
api_prefix,
|
|
170
|
+
max_file_size,
|
|
171
|
+
autoscroll
|
|
172
|
+
},
|
|
173
|
+
app,
|
|
174
|
+
$reactive_formatter,
|
|
175
|
+
gradio_event_dispatcher
|
|
176
|
+
);
|
|
177
|
+
|
|
178
|
+
setContext(GRADIO_ROOT, {
|
|
179
|
+
register: app_tree.register_component.bind(app_tree),
|
|
180
|
+
dispatcher: gradio_event_dispatcher
|
|
181
|
+
});
|
|
182
|
+
|
|
176
183
|
let api_calls: Payload[] = $state([]);
|
|
177
184
|
let last_api_call: Payload | null = $state(null);
|
|
178
185
|
// We need a callback to add to api_calls from the DependencyManager
|
|
@@ -322,8 +329,10 @@
|
|
|
322
329
|
|
|
323
330
|
const MESSAGE_QUOTE_RE = /^'([^]+)'$/;
|
|
324
331
|
|
|
325
|
-
const DUPLICATE_MESSAGE = $
|
|
326
|
-
const MOBILE_QUEUE_WARNING = $
|
|
332
|
+
const DUPLICATE_MESSAGE = $reactive_formatter("blocks.long_requests_queue");
|
|
333
|
+
const MOBILE_QUEUE_WARNING = $reactive_formatter(
|
|
334
|
+
"blocks.connection_can_break"
|
|
335
|
+
);
|
|
327
336
|
const LOST_CONNECTION_MESSAGE =
|
|
328
337
|
"Connection to the server was lost. Attempting reconnection...";
|
|
329
338
|
const CHANGED_CONNECTION_MESSAGE =
|
|
@@ -331,7 +340,9 @@
|
|
|
331
340
|
const RECONNECTION_MESSAGE = "Connection re-established.";
|
|
332
341
|
const SESSION_NOT_FOUND_MESSAGE =
|
|
333
342
|
"Session not found - this is likely because the machine you were connected to has changed. <a href=''>Refresh the page</a> to continue.";
|
|
334
|
-
const WAITING_FOR_INPUTS_MESSAGE = $
|
|
343
|
+
const WAITING_FOR_INPUTS_MESSAGE = $reactive_formatter(
|
|
344
|
+
"blocks.waiting_for_inputs"
|
|
345
|
+
);
|
|
335
346
|
const SHOW_DUPLICATE_MESSAGE_ON_ETA = 15;
|
|
336
347
|
const SHOW_MOBILE_QUEUE_WARNING_ON_ETA = 10;
|
|
337
348
|
let is_mobile_device = false;
|
|
@@ -440,11 +451,11 @@
|
|
|
440
451
|
class="show-api"
|
|
441
452
|
>
|
|
442
453
|
{#if app.config?.mcp_server}
|
|
443
|
-
{$
|
|
454
|
+
{$reactive_formatter("errors.use_via_api_or_mcp")}
|
|
444
455
|
{:else}
|
|
445
|
-
{$
|
|
456
|
+
{$reactive_formatter("errors.use_via_api")}
|
|
446
457
|
{/if}
|
|
447
|
-
<img src={api_logo} alt={$
|
|
458
|
+
<img src={api_logo} alt={$reactive_formatter("common.logo")} />
|
|
448
459
|
</button>
|
|
449
460
|
{/if}
|
|
450
461
|
{#if footer_links.includes("gradio")}
|
|
@@ -455,8 +466,8 @@
|
|
|
455
466
|
target="_blank"
|
|
456
467
|
rel="noreferrer"
|
|
457
468
|
>
|
|
458
|
-
{$
|
|
459
|
-
<img src={logo} alt={$
|
|
469
|
+
{$reactive_formatter("common.built_with_gradio")}
|
|
470
|
+
<img src={logo} alt={$reactive_formatter("common.logo")} />
|
|
460
471
|
</a>
|
|
461
472
|
{/if}
|
|
462
473
|
<button
|
|
@@ -466,8 +477,11 @@
|
|
|
466
477
|
}}
|
|
467
478
|
class="record"
|
|
468
479
|
>
|
|
469
|
-
{$
|
|
470
|
-
<img
|
|
480
|
+
{$reactive_formatter("common.stop_recording")}
|
|
481
|
+
<img
|
|
482
|
+
src={record_stop}
|
|
483
|
+
alt={$reactive_formatter("common.stop_recording")}
|
|
484
|
+
/>
|
|
471
485
|
</button>
|
|
472
486
|
<div class="divider">·</div>
|
|
473
487
|
{#if footer_links.includes("settings")}
|
|
@@ -481,8 +495,11 @@
|
|
|
481
495
|
}}
|
|
482
496
|
class="settings"
|
|
483
497
|
>
|
|
484
|
-
{$
|
|
485
|
-
<img
|
|
498
|
+
{$reactive_formatter("common.settings")}
|
|
499
|
+
<img
|
|
500
|
+
src={settings_logo}
|
|
501
|
+
alt={$reactive_formatter("common.settings")}
|
|
502
|
+
/>
|
|
486
503
|
</button>
|
|
487
504
|
{/if}
|
|
488
505
|
</footer>
|
|
@@ -552,15 +569,16 @@
|
|
|
552
569
|
this={Settings}
|
|
553
570
|
bind:allow_zoom
|
|
554
571
|
bind:allow_video_trim
|
|
555
|
-
|
|
572
|
+
onclose={() => {
|
|
556
573
|
set_settings_visible(false);
|
|
557
574
|
}}
|
|
558
|
-
|
|
575
|
+
start_recording={() => {
|
|
559
576
|
screen_recording();
|
|
560
577
|
}}
|
|
561
578
|
pwa_enabled={app.config.pwa}
|
|
562
579
|
{root}
|
|
563
580
|
{space_id}
|
|
581
|
+
i18n={$reactive_formatter}
|
|
564
582
|
/>
|
|
565
583
|
</div>
|
|
566
584
|
</div>
|
|
@@ -7,17 +7,18 @@
|
|
|
7
7
|
import { language_choices, changeLocale } from "../i18n";
|
|
8
8
|
import { locale, _ } from "svelte-i18n";
|
|
9
9
|
import record from "./img/record.svg";
|
|
10
|
-
import { createEventDispatcher } from "svelte";
|
|
11
10
|
|
|
12
11
|
let {
|
|
13
12
|
root,
|
|
14
13
|
space_id,
|
|
15
14
|
pwa_enabled,
|
|
16
15
|
allow_zoom = $bindable(),
|
|
17
|
-
allow_video_trim = $bindable()
|
|
16
|
+
allow_video_trim = $bindable(),
|
|
17
|
+
onclose,
|
|
18
|
+
start_recording,
|
|
19
|
+
i18n
|
|
18
20
|
} = $props();
|
|
19
21
|
|
|
20
|
-
const dispatch = createEventDispatcher();
|
|
21
22
|
if (root === "") {
|
|
22
23
|
root = location.protocol + "//" + location.host + location.pathname;
|
|
23
24
|
}
|
|
@@ -34,6 +35,7 @@
|
|
|
34
35
|
url.searchParams.set("__theme", theme);
|
|
35
36
|
current_theme = theme;
|
|
36
37
|
}
|
|
38
|
+
url.searchParams.delete("view");
|
|
37
39
|
window.location.href = url.toString();
|
|
38
40
|
}
|
|
39
41
|
|
|
@@ -59,8 +61,8 @@
|
|
|
59
61
|
}
|
|
60
62
|
});
|
|
61
63
|
|
|
62
|
-
function handleLanguageChange(
|
|
63
|
-
const new_locale =
|
|
64
|
+
function handleLanguageChange(value: string): void {
|
|
65
|
+
const new_locale = value;
|
|
64
66
|
changeLocale(new_locale);
|
|
65
67
|
}
|
|
66
68
|
|
|
@@ -74,54 +76,51 @@
|
|
|
74
76
|
</script>
|
|
75
77
|
|
|
76
78
|
<div class="banner-wrap">
|
|
77
|
-
<SettingsBanner
|
|
79
|
+
<SettingsBanner onclose={() => onclose()} {root} />
|
|
78
80
|
</div>
|
|
79
81
|
{#if space_id === null}
|
|
80
82
|
<!-- on Spaces, the theme is set in HF settings -->
|
|
81
83
|
<div class="banner-wrap">
|
|
82
|
-
<h2>{
|
|
83
|
-
<
|
|
84
|
+
<h2>{i18n("common.display_theme")}</h2>
|
|
85
|
+
<ul class="padded theme-buttons">
|
|
84
86
|
<li
|
|
85
87
|
class="theme-button {current_theme === 'light'
|
|
86
88
|
? 'current-theme'
|
|
87
89
|
: 'inactive-theme'}"
|
|
88
|
-
on:click={() => setTheme("light")}
|
|
89
90
|
>
|
|
90
|
-
<button>☀︎ Light</button>
|
|
91
|
+
<button on:click={() => setTheme("light")}>☀︎ Light</button>
|
|
91
92
|
</li>
|
|
92
93
|
<li
|
|
93
94
|
class="theme-button {current_theme === 'dark'
|
|
94
95
|
? 'current-theme'
|
|
95
96
|
: 'inactive-theme'}"
|
|
96
|
-
on:click={() => setTheme("dark")}
|
|
97
97
|
>
|
|
98
|
-
<button>⏾ Dark</button>
|
|
98
|
+
<button on:click={() => setTheme("dark")}>⏾ Dark</button>
|
|
99
99
|
</li>
|
|
100
100
|
<li
|
|
101
101
|
class="theme-button {current_theme === 'system'
|
|
102
102
|
? 'current-theme'
|
|
103
103
|
: 'inactive-theme'}"
|
|
104
|
-
on:click={() => setTheme("system")}
|
|
105
104
|
>
|
|
106
|
-
<button>🖥︎ System</button>
|
|
105
|
+
<button on:click={() => setTheme("system")}>🖥︎ System</button>
|
|
107
106
|
</li>
|
|
108
|
-
</
|
|
107
|
+
</ul>
|
|
109
108
|
</div>
|
|
110
109
|
{/if}
|
|
111
110
|
<div class="banner-wrap">
|
|
112
|
-
<h2>{
|
|
111
|
+
<h2>{i18n("common.language")}</h2>
|
|
113
112
|
<p class="padded">
|
|
114
113
|
<Dropdown
|
|
115
114
|
label="Language"
|
|
116
115
|
choices={language_choices}
|
|
117
116
|
show_label={false}
|
|
118
|
-
value={current_locale}
|
|
119
|
-
|
|
117
|
+
bind:value={current_locale}
|
|
118
|
+
on_change={() => handleLanguageChange(current_locale)}
|
|
120
119
|
/>
|
|
121
120
|
</p>
|
|
122
121
|
</div>
|
|
123
122
|
<div class="banner-wrap">
|
|
124
|
-
<h2>{
|
|
123
|
+
<h2>{i18n("common.pwa")}</h2>
|
|
125
124
|
<p class="padded">
|
|
126
125
|
{#if pwa_enabled}
|
|
127
126
|
You can install this app as a Progressive Web App on your device. Visit <a
|
|
@@ -135,7 +134,7 @@
|
|
|
135
134
|
</p>
|
|
136
135
|
</div>
|
|
137
136
|
<div class="banner-wrap">
|
|
138
|
-
<h2>{
|
|
137
|
+
<h2>{i18n("common.screen_studio")} <span class="beta-tag">beta</span></h2>
|
|
139
138
|
<p class="padded">
|
|
140
139
|
Screen Studio allows you to record your screen and generates a video of your
|
|
141
140
|
app with automatically adding zoom in and zoom out effects as well as
|
|
@@ -164,8 +163,8 @@
|
|
|
164
163
|
<button
|
|
165
164
|
class="record-button"
|
|
166
165
|
on:click={() => {
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
onclose?.();
|
|
167
|
+
start_recording?.();
|
|
169
168
|
}}
|
|
170
169
|
>
|
|
171
170
|
<img src={record} alt="Start Recording" />
|
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
|
|
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 Settings: $$__sveltets_2_IsomorphicComponent<{
|
|
1
|
+
declare const Settings: import("svelte").Component<{
|
|
15
2
|
root: any;
|
|
16
3
|
space_id: any;
|
|
17
4
|
pwa_enabled: any;
|
|
18
5
|
allow_zoom?: any;
|
|
19
6
|
allow_video_trim?: any;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
}, {}, {}, "allow_zoom" | "allow_video_trim">;
|
|
26
|
-
type Settings = InstanceType<typeof Settings>;
|
|
7
|
+
onclose: any;
|
|
8
|
+
start_recording: any;
|
|
9
|
+
i18n: any;
|
|
10
|
+
}, {}, "allow_zoom" | "allow_video_trim">;
|
|
11
|
+
type Settings = ReturnType<typeof Settings>;
|
|
27
12
|
export default Settings;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { createEventDispatcher } from "svelte";
|
|
3
2
|
import { _ } from "svelte-i18n";
|
|
4
3
|
import settings_logo from "./img/settings-logo.svg";
|
|
5
4
|
import Clear from "./img/clear.svelte";
|
|
6
5
|
import { setupi18n } from "../i18n";
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
let { root, onclose }: { root: string; onclose?: () => void } = $props();
|
|
9
8
|
|
|
10
|
-
const dispatch = createEventDispatcher();
|
|
11
9
|
setupi18n();
|
|
12
10
|
</script>
|
|
13
11
|
|
|
@@ -21,7 +19,7 @@
|
|
|
21
19
|
</div>
|
|
22
20
|
</h2>
|
|
23
21
|
|
|
24
|
-
<button on:click={() =>
|
|
22
|
+
<button on:click={() => onclose?.()}>
|
|
25
23
|
<Clear />
|
|
26
24
|
</button>
|
|
27
25
|
|
|
@@ -1,22 +1,7 @@
|
|
|
1
|
-
|
|
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 SettingsBanner: $$__sveltets_2_IsomorphicComponent<{
|
|
1
|
+
type $$ComponentProps = {
|
|
15
2
|
root: string;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}, {}, {}, string>;
|
|
21
|
-
type SettingsBanner = InstanceType<typeof SettingsBanner>;
|
|
3
|
+
onclose?: () => void;
|
|
4
|
+
};
|
|
5
|
+
declare const SettingsBanner: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
|
+
type SettingsBanner = ReturnType<typeof SettingsBanner>;
|
|
22
7
|
export default SettingsBanner;
|
package/dist/src/dependency.js
CHANGED
|
@@ -558,6 +558,14 @@ export class DependencyManager {
|
|
|
558
558
|
const submission = this.submissions.get(id);
|
|
559
559
|
if (submission) {
|
|
560
560
|
await submission.cancel();
|
|
561
|
+
this.loading_stati.update({
|
|
562
|
+
status: "complete",
|
|
563
|
+
fn_index: id,
|
|
564
|
+
eta: 0,
|
|
565
|
+
queue: false,
|
|
566
|
+
stream_state: null
|
|
567
|
+
});
|
|
568
|
+
this.update_loading_stati_state();
|
|
561
569
|
this.submissions.delete(id);
|
|
562
570
|
}
|
|
563
571
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentMeta, ProcessedComponentMeta, LayoutNode, Dependency, AppConfig, ServerFunctions } from "./types";
|
|
2
|
-
import type
|
|
2
|
+
import { type SharedProps } from "@gradio/utils";
|
|
3
3
|
import { Client } from "@gradio/client";
|
|
4
4
|
type client_return = Awaited<ReturnType<typeof Client.connect>>;
|
|
5
5
|
type set_data_type = (data: Record<string, unknown>) => void;
|
|
@@ -13,6 +13,7 @@ type Tab = {
|
|
|
13
13
|
elem_id: string | undefined;
|
|
14
14
|
scale: number | null;
|
|
15
15
|
order?: number;
|
|
16
|
+
component_id: number;
|
|
16
17
|
};
|
|
17
18
|
export declare class AppTree {
|
|
18
19
|
#private;
|
|
@@ -21,13 +22,14 @@ export declare class AppTree {
|
|
|
21
22
|
client: client_return;
|
|
22
23
|
/** the root node of the processed layout tree */
|
|
23
24
|
root: ProcessedComponentMeta | undefined;
|
|
25
|
+
root_untracked: ProcessedComponentMeta;
|
|
24
26
|
component_ids: number[];
|
|
25
27
|
initial_tabs: Record<number, Tab[]>;
|
|
26
28
|
components_to_register: Set<number>;
|
|
27
29
|
ready: Promise<void>;
|
|
28
30
|
ready_resolve: () => void;
|
|
29
31
|
resolved: boolean;
|
|
30
|
-
constructor(components: ComponentMeta[], layout: LayoutNode, dependencies: Dependency[], config: Omit<AppConfig, "api_url">, app: client_return, reactive_formatter: (str: string) => string);
|
|
32
|
+
constructor(components: ComponentMeta[], layout: LayoutNode, dependencies: Dependency[], config: Omit<AppConfig, "api_url">, app: client_return, reactive_formatter: (str: string) => string, event_dispatcher: (id: number, event: string, data: unknown) => void);
|
|
31
33
|
reload(components: ComponentMeta[], layout: LayoutNode, dependencies: Dependency[], config: Omit<AppConfig, "api_url">): void;
|
|
32
34
|
/**
|
|
33
35
|
* Registers a component with its ID and data callbacks
|
|
@@ -59,6 +61,7 @@ export declare class AppTree {
|
|
|
59
61
|
*/
|
|
60
62
|
create_node(opts: LayoutNode, component_map: Map<number, ComponentMeta>, root?: boolean, reactive_formatter?: (str: string) => string): ProcessedComponentMeta;
|
|
61
63
|
rerender(components: ComponentMeta[], layout: LayoutNode): void;
|
|
64
|
+
update_visibility(node: ProcessedComponentMeta, new_state: any): Promise<void>;
|
|
62
65
|
update_state(id: number, new_state: Partial<SharedProps> & Record<string, unknown>, check_visibility?: boolean): Promise<void>;
|
|
63
66
|
/**
|
|
64
67
|
* Gets the current state of a component by its ID
|
|
@@ -66,6 +69,7 @@ export declare class AppTree {
|
|
|
66
69
|
* @returns the current state of the component, or null if not found
|
|
67
70
|
*/
|
|
68
71
|
get_state(id: number): Promise<Record<string, unknown> | null>;
|
|
72
|
+
render_previously_invisible_children(id: number): Promise<void>;
|
|
69
73
|
}
|
|
70
74
|
/**
|
|
71
75
|
* Process the server function names and return a dictionary of functions
|