@gradio/core 0.19.0 → 0.19.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 +32 -0
- package/dist/src/Blocks.svelte +9 -1
- package/dist/src/init.js +2 -1
- package/package.json +36 -36
- package/src/Blocks.svelte +14 -2
- package/src/init.ts +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @gradio/core
|
|
2
2
|
|
|
3
|
+
## 0.19.2
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- [#11364](https://github.com/gradio-app/gradio/pull/11364) [`467de5d`](https://github.com/gradio-app/gradio/commit/467de5d865f8b841cb0d065031d5458f52ee2d29) - Call load events on @gr.render. Thanks @freddyaboulton!
|
|
8
|
+
|
|
9
|
+
### Dependency updates
|
|
10
|
+
|
|
11
|
+
- @gradio/gallery@0.15.23
|
|
12
|
+
- @gradio/code@0.14.7
|
|
13
|
+
- @gradio/textbox@0.10.14
|
|
14
|
+
|
|
15
|
+
## 0.19.1
|
|
16
|
+
|
|
17
|
+
### Fixes
|
|
18
|
+
|
|
19
|
+
- [#11338](https://github.com/gradio-app/gradio/pull/11338) [`b31c3ed`](https://github.com/gradio-app/gradio/commit/b31c3edef97373b96f188072d5bb16db9d690261) - Fix Reload Mode when using gr.render. Thanks @freddyaboulton!
|
|
20
|
+
|
|
21
|
+
### Dependency updates
|
|
22
|
+
|
|
23
|
+
- @gradio/upload@0.16.7
|
|
24
|
+
- @gradio/video@0.14.17
|
|
25
|
+
- @gradio/checkbox@0.4.23
|
|
26
|
+
- @gradio/client@1.15.2
|
|
27
|
+
- @gradio/button@0.5.3
|
|
28
|
+
- @gradio/tabs@0.4.5
|
|
29
|
+
- @gradio/tabitem@0.4.5
|
|
30
|
+
- @gradio/code@0.14.6
|
|
31
|
+
- @gradio/file@0.12.20
|
|
32
|
+
- @gradio/image@0.22.9
|
|
33
|
+
- @gradio/gallery@0.15.22
|
|
34
|
+
|
|
3
35
|
## 0.19.0
|
|
4
36
|
|
|
5
37
|
### Features
|
package/dist/src/Blocks.svelte
CHANGED
|
@@ -56,11 +56,12 @@ $: {
|
|
|
56
56
|
}
|
|
57
57
|
let old_dependencies = dependencies;
|
|
58
58
|
$:
|
|
59
|
-
if (dependencies !== old_dependencies && render_complete) {
|
|
59
|
+
if (dependencies !== old_dependencies && render_complete && !layout_creating) {
|
|
60
60
|
handle_load_triggers();
|
|
61
61
|
old_dependencies = dependencies;
|
|
62
62
|
}
|
|
63
63
|
async function run() {
|
|
64
|
+
layout_creating = true;
|
|
64
65
|
await create_layout({
|
|
65
66
|
components,
|
|
66
67
|
layout,
|
|
@@ -71,6 +72,7 @@ async function run() {
|
|
|
71
72
|
fill_height
|
|
72
73
|
}
|
|
73
74
|
});
|
|
75
|
+
layout_creating = false;
|
|
74
76
|
}
|
|
75
77
|
export let search_params;
|
|
76
78
|
let api_docs_visible = search_params.get("view") === "api" && show_api;
|
|
@@ -100,6 +102,7 @@ function set_settings_visible(visible) {
|
|
|
100
102
|
settings_visible = !settings_visible;
|
|
101
103
|
}
|
|
102
104
|
let api_calls = [];
|
|
105
|
+
let layout_creating = false;
|
|
103
106
|
export let render_complete = false;
|
|
104
107
|
async function handle_update(data, fn_index) {
|
|
105
108
|
const dep = dependencies.find((dep2) => dep2.id === fn_index);
|
|
@@ -386,6 +389,11 @@ async function trigger_api_call(dep_index, trigger_id = null, event_data = null)
|
|
|
386
389
|
dependencies,
|
|
387
390
|
render_id
|
|
388
391
|
});
|
|
392
|
+
_dependencies.forEach((dep2) => {
|
|
393
|
+
if (dep2.targets.some((dep3) => dep3[1] === "load")) {
|
|
394
|
+
wait_then_trigger_api_call(dep2.id);
|
|
395
|
+
}
|
|
396
|
+
});
|
|
389
397
|
}
|
|
390
398
|
function handle_log(msg) {
|
|
391
399
|
const { title: title2, log, fn_index, level, duration, visible } = msg;
|
package/dist/src/init.js
CHANGED
|
@@ -140,7 +140,8 @@ export function create_components(initial_layout) {
|
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
});
|
|
143
|
-
new_components.
|
|
143
|
+
const components_to_add = new_components.concat(replacement_components.filter((c) => !instance_map[c.id]));
|
|
144
|
+
components_to_add.forEach((c) => {
|
|
144
145
|
instance_map[c.id] = c;
|
|
145
146
|
_component_map.set(c.id, c);
|
|
146
147
|
});
|
package/package.json
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/core",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@gradio/accordion": "^0.5.16",
|
|
7
|
-
"@gradio/annotatedimage": "^0.9.
|
|
7
|
+
"@gradio/annotatedimage": "^0.9.21",
|
|
8
8
|
"@gradio/atoms": "^0.16.1",
|
|
9
|
-
"@gradio/audio": "^0.17.
|
|
9
|
+
"@gradio/audio": "^0.17.17",
|
|
10
|
+
"@gradio/button": "^0.5.3",
|
|
11
|
+
"@gradio/chatbot": "^0.26.13",
|
|
10
12
|
"@gradio/box": "^0.2.19",
|
|
11
|
-
"@gradio/
|
|
13
|
+
"@gradio/checkbox": "^0.4.23",
|
|
12
14
|
"@gradio/checkboxgroup": "^0.6.22",
|
|
13
|
-
"@gradio/
|
|
14
|
-
"@gradio/
|
|
15
|
-
"@gradio/client": "^1.15.1",
|
|
16
|
-
"@gradio/code": "^0.14.5",
|
|
15
|
+
"@gradio/client": "^1.15.2",
|
|
16
|
+
"@gradio/code": "^0.14.7",
|
|
17
17
|
"@gradio/colorpicker": "^0.4.22",
|
|
18
18
|
"@gradio/column": "^0.2.0",
|
|
19
|
-
"@gradio/dataframe": "^0.17.
|
|
20
|
-
"@gradio/datetime": "^0.3.
|
|
21
|
-
"@gradio/downloadbutton": "^0.4.
|
|
22
|
-
"@gradio/dataset": "^0.4.21",
|
|
19
|
+
"@gradio/dataframe": "^0.17.15",
|
|
20
|
+
"@gradio/datetime": "^0.3.15",
|
|
21
|
+
"@gradio/downloadbutton": "^0.4.3",
|
|
23
22
|
"@gradio/dropdown": "^0.9.22",
|
|
24
23
|
"@gradio/fallback": "^0.4.22",
|
|
25
|
-
"@gradio/
|
|
26
|
-
"@gradio/
|
|
24
|
+
"@gradio/dataset": "^0.4.23",
|
|
25
|
+
"@gradio/fileexplorer": "^0.5.31",
|
|
27
26
|
"@gradio/form": "^0.2.19",
|
|
28
|
-
"@gradio/file": "^0.12.
|
|
27
|
+
"@gradio/file": "^0.12.20",
|
|
28
|
+
"@gradio/gallery": "^0.15.23",
|
|
29
29
|
"@gradio/group": "^0.2.0",
|
|
30
|
-
"@gradio/html": "^0.6.14",
|
|
31
|
-
"@gradio/icons": "^0.12.0",
|
|
32
30
|
"@gradio/highlightedtext": "^0.9.5",
|
|
33
|
-
"@gradio/
|
|
34
|
-
"@gradio/
|
|
31
|
+
"@gradio/icons": "^0.12.0",
|
|
32
|
+
"@gradio/html": "^0.6.14",
|
|
33
|
+
"@gradio/imageeditor": "^0.15.3",
|
|
34
|
+
"@gradio/image": "^0.22.9",
|
|
35
35
|
"@gradio/json": "^0.5.24",
|
|
36
|
-
"@gradio/imageslider": "^0.2.3",
|
|
37
|
-
"@gradio/browserstate": "^0.3.2",
|
|
38
|
-
"@gradio/markdown": "^0.13.14",
|
|
39
36
|
"@gradio/label": "^0.5.14",
|
|
40
|
-
"@gradio/
|
|
41
|
-
"@gradio/
|
|
37
|
+
"@gradio/imageslider": "^0.2.4",
|
|
38
|
+
"@gradio/markdown": "^0.13.15",
|
|
39
|
+
"@gradio/model3d": "^0.14.16",
|
|
40
|
+
"@gradio/browserstate": "^0.3.2",
|
|
41
|
+
"@gradio/multimodaltextbox": "^0.10.9",
|
|
42
|
+
"@gradio/nativeplot": "^0.6.1",
|
|
43
|
+
"@gradio/paramviewer": "^0.7.10",
|
|
42
44
|
"@gradio/number": "^0.5.22",
|
|
43
|
-
"@gradio/nativeplot": "^0.6.0",
|
|
44
45
|
"@gradio/plot": "^0.9.17",
|
|
45
|
-
"@gradio/
|
|
46
|
+
"@gradio/radio": "^0.7.5",
|
|
46
47
|
"@gradio/sidebar": "^0.1.14",
|
|
47
48
|
"@gradio/row": "^0.2.1",
|
|
48
|
-
"@gradio/radio": "^0.7.5",
|
|
49
49
|
"@gradio/simpledropdown": "^0.3.22",
|
|
50
|
-
"@gradio/simpleimage": "^0.8.
|
|
50
|
+
"@gradio/simpleimage": "^0.8.31",
|
|
51
|
+
"@gradio/simpletextbox": "^0.3.23",
|
|
51
52
|
"@gradio/sketchbox": "^0.6.9",
|
|
52
53
|
"@gradio/slider": "^0.6.11",
|
|
53
|
-
"@gradio/simpletextbox": "^0.3.22",
|
|
54
54
|
"@gradio/state": "^0.1.2",
|
|
55
|
-
"@gradio/tabitem": "^0.4.
|
|
56
|
-
"@gradio/tabs": "^0.4.
|
|
55
|
+
"@gradio/tabitem": "^0.4.5",
|
|
56
|
+
"@gradio/tabs": "^0.4.5",
|
|
57
|
+
"@gradio/textbox": "^0.10.14",
|
|
57
58
|
"@gradio/statustracker": "^0.10.12",
|
|
58
|
-
"@gradio/textbox": "^0.10.13",
|
|
59
59
|
"@gradio/theme": "^0.4.0",
|
|
60
|
-
"@gradio/
|
|
61
|
-
"@gradio/
|
|
62
|
-
"@gradio/uploadbutton": "^0.9.2",
|
|
60
|
+
"@gradio/upload": "^0.16.7",
|
|
61
|
+
"@gradio/uploadbutton": "^0.9.3",
|
|
63
62
|
"@gradio/utils": "^0.10.2",
|
|
64
|
-
"@gradio/video": "^0.14.
|
|
63
|
+
"@gradio/video": "^0.14.17",
|
|
64
|
+
"@gradio/timer": "^0.4.5",
|
|
65
65
|
"@gradio/wasm": "^0.18.1"
|
|
66
66
|
},
|
|
67
67
|
"msw": {
|
package/src/Blocks.svelte
CHANGED
|
@@ -74,13 +74,18 @@
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
let old_dependencies = dependencies;
|
|
77
|
-
$: if (
|
|
77
|
+
$: if (
|
|
78
|
+
dependencies !== old_dependencies &&
|
|
79
|
+
render_complete &&
|
|
80
|
+
!layout_creating
|
|
81
|
+
) {
|
|
78
82
|
// re-run load triggers in SSR mode when page changes
|
|
79
83
|
handle_load_triggers();
|
|
80
84
|
old_dependencies = dependencies;
|
|
81
85
|
}
|
|
82
86
|
|
|
83
87
|
async function run(): Promise<void> {
|
|
88
|
+
layout_creating = true;
|
|
84
89
|
await create_layout({
|
|
85
90
|
components,
|
|
86
91
|
layout,
|
|
@@ -91,6 +96,7 @@
|
|
|
91
96
|
fill_height
|
|
92
97
|
}
|
|
93
98
|
});
|
|
99
|
+
layout_creating = false;
|
|
94
100
|
}
|
|
95
101
|
|
|
96
102
|
export let search_params: URLSearchParams;
|
|
@@ -126,7 +132,9 @@
|
|
|
126
132
|
|
|
127
133
|
let api_calls: Payload[] = [];
|
|
128
134
|
|
|
135
|
+
let layout_creating = false;
|
|
129
136
|
export let render_complete = false;
|
|
137
|
+
|
|
130
138
|
async function handle_update(data: any, fn_index: number): Promise<void> {
|
|
131
139
|
const dep = dependencies.find((dep) => dep.id === fn_index);
|
|
132
140
|
const input_type = components.find(
|
|
@@ -489,6 +497,11 @@
|
|
|
489
497
|
dependencies: dependencies,
|
|
490
498
|
render_id: render_id
|
|
491
499
|
});
|
|
500
|
+
_dependencies.forEach((dep) => {
|
|
501
|
+
if (dep.targets.some((dep) => dep[1] === "load")) {
|
|
502
|
+
wait_then_trigger_api_call(dep.id);
|
|
503
|
+
}
|
|
504
|
+
});
|
|
492
505
|
}
|
|
493
506
|
|
|
494
507
|
function handle_log(msg: LogMessage): void {
|
|
@@ -671,7 +684,6 @@
|
|
|
671
684
|
if (is_external_url(_link) && _target !== "_blank")
|
|
672
685
|
a[i].setAttribute("target", "_blank");
|
|
673
686
|
}
|
|
674
|
-
|
|
675
687
|
handle_load_triggers();
|
|
676
688
|
|
|
677
689
|
if (!target || render_complete) return;
|
package/src/init.ts
CHANGED
|
@@ -256,7 +256,11 @@ export function create_components(initial_layout: ComponentMeta | undefined): {
|
|
|
256
256
|
}
|
|
257
257
|
});
|
|
258
258
|
|
|
259
|
-
new_components.
|
|
259
|
+
const components_to_add = new_components.concat(
|
|
260
|
+
replacement_components.filter((c) => !instance_map[c.id])
|
|
261
|
+
);
|
|
262
|
+
|
|
263
|
+
components_to_add.forEach((c) => {
|
|
260
264
|
instance_map[c.id] = c;
|
|
261
265
|
_component_map.set(c.id, c);
|
|
262
266
|
});
|
|
@@ -288,7 +292,6 @@ export function create_components(initial_layout: ComponentMeta | undefined): {
|
|
|
288
292
|
parent?: ComponentMeta
|
|
289
293
|
): Promise<ComponentMeta> {
|
|
290
294
|
const instance = instance_map[node.id];
|
|
291
|
-
|
|
292
295
|
if (!instance.component) {
|
|
293
296
|
instance.component = (await constructor_map.get(
|
|
294
297
|
instance.component_class_id || instance.type
|