@gradio/core 0.1.1 → 0.2.1
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 +97 -0
- package/dist/src/Blocks.svelte +20 -12
- package/dist/src/Blocks.svelte.d.ts +2 -2
- package/dist/src/init.d.ts +0 -4
- package/dist/src/init.js +24 -1
- package/dist/src/lang/fi.json +124 -0
- package/package.json +50 -50
- package/src/Blocks.svelte +20 -10
- package/src/init.ts +30 -1
- package/src/lang/fi.json +124 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,102 @@
|
|
|
1
1
|
# @gradio/core
|
|
2
2
|
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- [#9653](https://github.com/gradio-app/gradio/pull/9653) [`61cd768`](https://github.com/gradio-app/gradio/commit/61cd768490a12f5d63101d5434092bcd1cfc43a8) - Ensures tabs with visible set to false are not visible. Thanks @hannahblair!
|
|
8
|
+
|
|
9
|
+
### Dependency updates
|
|
10
|
+
|
|
11
|
+
- @gradio/button@0.3.4
|
|
12
|
+
- @gradio/video@0.11.5
|
|
13
|
+
- @gradio/statustracker@0.9.2
|
|
14
|
+
- @gradio/atoms@0.10.0
|
|
15
|
+
- @gradio/icons@0.8.1
|
|
16
|
+
- @gradio/upload@0.13.4
|
|
17
|
+
- @gradio/plot@0.8.0
|
|
18
|
+
- @gradio/gallery@0.13.5
|
|
19
|
+
- @gradio/tabs@0.3.2
|
|
20
|
+
- @gradio/column@0.2.0
|
|
21
|
+
- @gradio/tabitem@0.3.2
|
|
22
|
+
- @gradio/code@0.10.5
|
|
23
|
+
- @gradio/paramviewer@0.5.4
|
|
24
|
+
- @gradio/textbox@0.8.3
|
|
25
|
+
- @gradio/file@0.10.5
|
|
26
|
+
- @gradio/checkbox@0.4.4
|
|
27
|
+
- @gradio/image@0.16.5
|
|
28
|
+
|
|
29
|
+
## 0.2.0
|
|
30
|
+
|
|
31
|
+
### Dependency updates
|
|
32
|
+
|
|
33
|
+
- @gradio/markdown@0.10.3
|
|
34
|
+
- @gradio/code@0.10.4
|
|
35
|
+
- @gradio/paramviewer@0.5.3
|
|
36
|
+
- @gradio/statustracker@0.9.1
|
|
37
|
+
- @gradio/upload@0.13.3
|
|
38
|
+
- @gradio/button@0.3.3
|
|
39
|
+
- @gradio/video@0.11.4
|
|
40
|
+
- @gradio/atoms@0.9.2
|
|
41
|
+
- @gradio/gallery@0.13.4
|
|
42
|
+
- @gradio/plot@0.7.3
|
|
43
|
+
- @gradio/column@0.2.0
|
|
44
|
+
- @gradio/textbox@0.8.2
|
|
45
|
+
- @gradio/checkbox@0.4.3
|
|
46
|
+
- @gradio/file@0.10.4
|
|
47
|
+
- @gradio/image@0.16.4
|
|
48
|
+
|
|
49
|
+
## 0.2.0
|
|
50
|
+
|
|
51
|
+
### Features
|
|
52
|
+
|
|
53
|
+
- [#9681](https://github.com/gradio-app/gradio/pull/9681) [`2ed2361`](https://github.com/gradio-app/gradio/commit/2ed236187a9aab18e17fc4a8079eddef7dd195a5) - Allow setting title in gr.Info/Warning/Error. Thanks @ABucket!
|
|
54
|
+
|
|
55
|
+
### Fixes
|
|
56
|
+
|
|
57
|
+
- [#9728](https://github.com/gradio-app/gradio/pull/9728) [`d0b2ce8`](https://github.com/gradio-app/gradio/commit/d0b2ce8c0f150f0b636ad7d2226f7c8c61401996) - Ensure tabs render in SSR mode and reduce time it takes for them to render. Thanks @pngwn!
|
|
58
|
+
|
|
59
|
+
### Dependency updates
|
|
60
|
+
|
|
61
|
+
- @gradio/video@0.11.3
|
|
62
|
+
- @gradio/markdown@0.10.2
|
|
63
|
+
- @gradio/atoms@0.9.1
|
|
64
|
+
- @gradio/statustracker@0.9.0
|
|
65
|
+
- @gradio/client@1.7.0
|
|
66
|
+
- @gradio/upload@0.13.2
|
|
67
|
+
- @gradio/button@0.3.2
|
|
68
|
+
- @gradio/wasm@0.14.2
|
|
69
|
+
- @gradio/gallery@0.13.3
|
|
70
|
+
- @gradio/plot@0.7.2
|
|
71
|
+
- @gradio/image@0.16.3
|
|
72
|
+
- @gradio/column@0.2.0
|
|
73
|
+
- @gradio/textbox@0.8.1
|
|
74
|
+
- @gradio/file@0.10.3
|
|
75
|
+
- @gradio/checkbox@0.4.2
|
|
76
|
+
- @gradio/tabs@0.3.1
|
|
77
|
+
- @gradio/code@0.10.3
|
|
78
|
+
- @gradio/paramviewer@0.5.2
|
|
79
|
+
- @gradio/tabitem@0.3.1
|
|
80
|
+
|
|
81
|
+
## 0.1.1
|
|
82
|
+
|
|
83
|
+
### Dependency updates
|
|
84
|
+
|
|
85
|
+
- @gradio/textbox@0.8.0
|
|
86
|
+
|
|
87
|
+
## 0.1.1
|
|
88
|
+
|
|
89
|
+
### Dependency updates
|
|
90
|
+
|
|
91
|
+
- @gradio/code@0.10.2
|
|
92
|
+
- @gradio/file@0.10.2
|
|
93
|
+
- @gradio/upload@0.13.1
|
|
94
|
+
- @gradio/image@0.16.2
|
|
95
|
+
- @gradio/video@0.11.2
|
|
96
|
+
- @gradio/button@0.3.1
|
|
97
|
+
- @gradio/wasm@0.14.1
|
|
98
|
+
- @gradio/gallery@0.13.2
|
|
99
|
+
|
|
3
100
|
## 0.1.1
|
|
4
101
|
|
|
5
102
|
### Features
|
package/dist/src/Blocks.svelte
CHANGED
|
@@ -117,8 +117,9 @@ async function handle_update(data, fn_index) {
|
|
|
117
117
|
}
|
|
118
118
|
let submit_map = /* @__PURE__ */ new Map();
|
|
119
119
|
let messages = [];
|
|
120
|
-
function new_message(message, fn_index, type, duration = 10, visible = true) {
|
|
120
|
+
function new_message(title2, message, fn_index, type, duration = 10, visible = true) {
|
|
121
121
|
return {
|
|
122
|
+
title: title2,
|
|
122
123
|
message,
|
|
123
124
|
fn_index,
|
|
124
125
|
type,
|
|
@@ -127,8 +128,8 @@ function new_message(message, fn_index, type, duration = 10, visible = true) {
|
|
|
127
128
|
visible
|
|
128
129
|
};
|
|
129
130
|
}
|
|
130
|
-
export function add_new_message(message, type) {
|
|
131
|
-
messages = [new_message(message, -1, type), ...messages];
|
|
131
|
+
export function add_new_message(title2, message, type) {
|
|
132
|
+
messages = [new_message(title2, message, -1, type), ...messages];
|
|
132
133
|
}
|
|
133
134
|
let _error_id = -1;
|
|
134
135
|
let user_left_page = false;
|
|
@@ -173,7 +174,7 @@ async function trigger_api_call(dep_index, trigger_id = null, event_data = null)
|
|
|
173
174
|
if (inputs_waiting.length > 0) {
|
|
174
175
|
for (const input of inputs_waiting) {
|
|
175
176
|
if (dep.inputs.includes(input)) {
|
|
176
|
-
add_new_message(WAITING_FOR_INPUTS_MESSAGE, "warning");
|
|
177
|
+
add_new_message("Warning", WAITING_FOR_INPUTS_MESSAGE, "warning");
|
|
177
178
|
return;
|
|
178
179
|
}
|
|
179
180
|
}
|
|
@@ -262,7 +263,10 @@ async function trigger_api_call(dep_index, trigger_id = null, event_data = null)
|
|
|
262
263
|
);
|
|
263
264
|
} catch (e) {
|
|
264
265
|
const fn_index = 0;
|
|
265
|
-
messages = [
|
|
266
|
+
messages = [
|
|
267
|
+
new_message("Error", String(e), fn_index, "error"),
|
|
268
|
+
...messages
|
|
269
|
+
];
|
|
266
270
|
loading_status.update({
|
|
267
271
|
status: "error",
|
|
268
272
|
fn_index,
|
|
@@ -322,9 +326,9 @@ async function trigger_api_call(dep_index, trigger_id = null, event_data = null)
|
|
|
322
326
|
});
|
|
323
327
|
}
|
|
324
328
|
function handle_log(msg) {
|
|
325
|
-
const { log, fn_index, level, duration, visible } = msg;
|
|
329
|
+
const { title: title2, log, fn_index, level, duration, visible } = msg;
|
|
326
330
|
messages = [
|
|
327
|
-
new_message(log, fn_index, level, duration, visible),
|
|
331
|
+
new_message(title2, log, fn_index, level, duration, visible),
|
|
328
332
|
...messages
|
|
329
333
|
];
|
|
330
334
|
}
|
|
@@ -354,14 +358,14 @@ async function trigger_api_call(dep_index, trigger_id = null, event_data = null)
|
|
|
354
358
|
if (!showed_duplicate_message && space_id !== null && status.position !== void 0 && status.position >= 2 && status.eta !== void 0 && status.eta > SHOW_DUPLICATE_MESSAGE_ON_ETA) {
|
|
355
359
|
showed_duplicate_message = true;
|
|
356
360
|
messages = [
|
|
357
|
-
new_message(DUPLICATE_MESSAGE, fn_index, "warning"),
|
|
361
|
+
new_message("Warning", DUPLICATE_MESSAGE, fn_index, "warning"),
|
|
358
362
|
...messages
|
|
359
363
|
];
|
|
360
364
|
}
|
|
361
365
|
if (!showed_mobile_warning && is_mobile_device && status.eta !== void 0 && status.eta > SHOW_MOBILE_QUEUE_WARNING_ON_ETA) {
|
|
362
366
|
showed_mobile_warning = true;
|
|
363
367
|
messages = [
|
|
364
|
-
new_message(MOBILE_QUEUE_WARNING, fn_index, "warning"),
|
|
368
|
+
new_message("Warning", MOBILE_QUEUE_WARNING, fn_index, "warning"),
|
|
365
369
|
...messages
|
|
366
370
|
];
|
|
367
371
|
}
|
|
@@ -386,7 +390,7 @@ async function trigger_api_call(dep_index, trigger_id = null, event_data = null)
|
|
|
386
390
|
if (status.broken && is_mobile_device && user_left_page) {
|
|
387
391
|
window.setTimeout(() => {
|
|
388
392
|
messages = [
|
|
389
|
-
new_message(MOBILE_RECONNECT_MESSAGE, fn_index, "error"),
|
|
393
|
+
new_message("Error", MOBILE_RECONNECT_MESSAGE, fn_index, "error"),
|
|
390
394
|
...messages
|
|
391
395
|
];
|
|
392
396
|
}, 0);
|
|
@@ -398,8 +402,10 @@ async function trigger_api_call(dep_index, trigger_id = null, event_data = null)
|
|
|
398
402
|
MESSAGE_QUOTE_RE,
|
|
399
403
|
(_2, b) => b
|
|
400
404
|
);
|
|
405
|
+
const _title = status.title ?? "Error";
|
|
401
406
|
messages = [
|
|
402
407
|
new_message(
|
|
408
|
+
_title,
|
|
403
409
|
_message,
|
|
404
410
|
fn_index,
|
|
405
411
|
"error",
|
|
@@ -478,8 +484,10 @@ async function handle_mount() {
|
|
|
478
484
|
if (event === "share") {
|
|
479
485
|
const { title: title2, description } = data;
|
|
480
486
|
trigger_share(title2, description);
|
|
481
|
-
} else if (event === "error"
|
|
482
|
-
messages = [new_message(data, -1, event), ...messages];
|
|
487
|
+
} else if (event === "error") {
|
|
488
|
+
messages = [new_message("Error", data, -1, event), ...messages];
|
|
489
|
+
} else if (event === "warning") {
|
|
490
|
+
messages = [new_message("Warning", data, -1, event), ...messages];
|
|
483
491
|
} else if (event == "clear_status") {
|
|
484
492
|
update_status(id, "complete", data);
|
|
485
493
|
} else if (event == "close_stream") {
|
|
@@ -30,7 +30,7 @@ declare const __propDef: {
|
|
|
30
30
|
css?: string | null | undefined;
|
|
31
31
|
search_params: URLSearchParams;
|
|
32
32
|
render_complete?: boolean | undefined;
|
|
33
|
-
add_new_message?: ((message: string, type: ToastMessage["type"]) => void) | undefined;
|
|
33
|
+
add_new_message?: ((title: string, message: string, type: ToastMessage["type"]) => void) | undefined;
|
|
34
34
|
};
|
|
35
35
|
events: {
|
|
36
36
|
[evt: string]: CustomEvent<any>;
|
|
@@ -41,6 +41,6 @@ export type BlocksProps = typeof __propDef.props;
|
|
|
41
41
|
export type BlocksEvents = typeof __propDef.events;
|
|
42
42
|
export type BlocksSlots = typeof __propDef.slots;
|
|
43
43
|
export default class Blocks extends SvelteComponent<BlocksProps, BlocksEvents, BlocksSlots> {
|
|
44
|
-
get add_new_message(): (message: string, type: ToastMessage["type"]) => void;
|
|
44
|
+
get add_new_message(): (title: string, message: string, type: ToastMessage["type"]) => void;
|
|
45
45
|
}
|
|
46
46
|
export {};
|
package/dist/src/init.d.ts
CHANGED
|
@@ -7,10 +7,6 @@ export interface UpdateTransaction {
|
|
|
7
7
|
value: any;
|
|
8
8
|
prop: string;
|
|
9
9
|
}
|
|
10
|
-
/**
|
|
11
|
-
* Create a store with the layout and a map of targets
|
|
12
|
-
* @returns A store with the layout and a map of targets
|
|
13
|
-
*/
|
|
14
10
|
export declare function create_components(initial_layout: ComponentMeta | undefined): {
|
|
15
11
|
layout: Writable<ComponentMeta>;
|
|
16
12
|
targets: Writable<TargetMap>;
|
package/dist/src/init.js
CHANGED
|
@@ -11,6 +11,7 @@ const raf = is_browser
|
|
|
11
11
|
* Create a store with the layout and a map of targets
|
|
12
12
|
* @returns A store with the layout and a map of targets
|
|
13
13
|
*/
|
|
14
|
+
let has_run = new Set();
|
|
14
15
|
export function create_components(initial_layout) {
|
|
15
16
|
let _component_map;
|
|
16
17
|
let target_map = writable({});
|
|
@@ -145,6 +146,28 @@ export function create_components(initial_layout) {
|
|
|
145
146
|
if (node.children) {
|
|
146
147
|
instance.children = await Promise.all(node.children.map((v) => walk_layout(v, root, instance)));
|
|
147
148
|
}
|
|
149
|
+
if (instance.type === "tabs" && !instance.props.initial_tabs) {
|
|
150
|
+
const tab_items_props = node.children?.map((c) => {
|
|
151
|
+
var _a;
|
|
152
|
+
const instance = instance_map[c.id];
|
|
153
|
+
// console.log("tabs", JSON.stringify(instance.props, null, 2));
|
|
154
|
+
(_a = instance.props).id ?? (_a.id = c.id);
|
|
155
|
+
return {
|
|
156
|
+
type: instance.type,
|
|
157
|
+
props: {
|
|
158
|
+
...instance.props,
|
|
159
|
+
id: instance.props.id
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
}) || [];
|
|
163
|
+
const child_tab_items = tab_items_props.filter((child) => child.type === "tabitem");
|
|
164
|
+
instance.props.initial_tabs = child_tab_items?.map((child) => ({
|
|
165
|
+
label: child.props.label,
|
|
166
|
+
id: child.props.id,
|
|
167
|
+
visible: child.props.visible,
|
|
168
|
+
interactive: child.props.interactive
|
|
169
|
+
}));
|
|
170
|
+
}
|
|
148
171
|
return instance;
|
|
149
172
|
}
|
|
150
173
|
let update_scheduled = false;
|
|
@@ -173,7 +196,7 @@ export function create_components(initial_layout) {
|
|
|
173
196
|
new_value = new Set(update.value);
|
|
174
197
|
else if (Array.isArray(update.value))
|
|
175
198
|
new_value = [...update.value];
|
|
176
|
-
else if (update.value
|
|
199
|
+
else if (update.value == null)
|
|
177
200
|
new_value = null;
|
|
178
201
|
else if (typeof update.value === "object")
|
|
179
202
|
new_value = { ...update.value };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
{
|
|
2
|
+
"3D_model": {
|
|
3
|
+
"3d_model": "3D-malli"
|
|
4
|
+
},
|
|
5
|
+
"annotated_image": {
|
|
6
|
+
"annotated_image": "Annotoitu kuva"
|
|
7
|
+
},
|
|
8
|
+
"audio": {
|
|
9
|
+
"allow_recording_access": "Ole hyvä ja anna selaimelle ja sivustolle pääsy mikrofoniin.",
|
|
10
|
+
"audio": "Audio",
|
|
11
|
+
"record_from_microphone": "Äänitä mikrofonia",
|
|
12
|
+
"stop_recording": "Lopeta äänitys",
|
|
13
|
+
"no_device_support": "Medialaitteita ei voitu käyttää. Tarkista, että yhteys on salattu (https), paikallinen (localhost), tai ssl_verify on saanut voimassa olevan SSL-sertifikaatin. Tarkista, että olet antanut selaimelle pääsyn medialaitteeseen.",
|
|
14
|
+
"stop": "Stop",
|
|
15
|
+
"resume": "Jatka",
|
|
16
|
+
"record": "Äänitä",
|
|
17
|
+
"no_microphone": "Ei mikrofonia käytössä",
|
|
18
|
+
"pause": "Pause",
|
|
19
|
+
"play": "Play",
|
|
20
|
+
"waiting": "Odotetaan"
|
|
21
|
+
},
|
|
22
|
+
"blocks": {
|
|
23
|
+
"connection_can_break": "Mobiililaitteella yhteys voi katketa, jos vaihdat välilehteä tai laite menee lepotilaa. Tällöin menetät paikkasi jonossa.",
|
|
24
|
+
"long_requests_queue": "Spacessa on ruuhkaa ja jono on pitkä. Kopioi tämä Space hypätäksesi jonon ohi.",
|
|
25
|
+
"lost_connection": "Yhteys katkesi sivulta poistumisen seurauksena. Liitytään takaisin jonoon...",
|
|
26
|
+
"waiting_for_inputs": "Odotetaan latauksen valmistumista, ole hyvä ja yritä uudelleen."
|
|
27
|
+
},
|
|
28
|
+
"checkbox": {
|
|
29
|
+
"checkbox": "Valintaruutu",
|
|
30
|
+
"checkbox_group": "Valintaruuturyhmä"
|
|
31
|
+
},
|
|
32
|
+
"code": {
|
|
33
|
+
"code": "Koodi"
|
|
34
|
+
},
|
|
35
|
+
"color_picker": {
|
|
36
|
+
"color_picker": "Värivalitsin"
|
|
37
|
+
},
|
|
38
|
+
"common": {
|
|
39
|
+
"built_with": "tehty",
|
|
40
|
+
"built_with_gradio": "tehty Gradiolla",
|
|
41
|
+
"clear": "Poista",
|
|
42
|
+
"download": "Lataa",
|
|
43
|
+
"edit": "Muokkaa",
|
|
44
|
+
"empty": "Tyhjennä",
|
|
45
|
+
"error": "Virhe",
|
|
46
|
+
"hosted_on": "Hostattu",
|
|
47
|
+
"loading": "Ladataan",
|
|
48
|
+
"logo": "logo",
|
|
49
|
+
"or": "tai",
|
|
50
|
+
"remove": "Poista",
|
|
51
|
+
"share": "Jaa",
|
|
52
|
+
"submit": "Suorita",
|
|
53
|
+
"undo": "Kumoa",
|
|
54
|
+
"no_devices": "Laitetta ei löytynyt"
|
|
55
|
+
},
|
|
56
|
+
"dataframe": {
|
|
57
|
+
"incorrect_format": "Yhteensopimaton tiedostomuoto, vain CSV- ja TSV-tiedostoja tuetaan.",
|
|
58
|
+
"new_column": "Lisää sarake",
|
|
59
|
+
"new_row": "Lisää rivi",
|
|
60
|
+
"add_row_above": "Lisää rivi yläpuolelle",
|
|
61
|
+
"add_row_below": "Lisää rivi alle",
|
|
62
|
+
"add_column_left": "Lisää sarake vasemmalle",
|
|
63
|
+
"add_column_right": "Lisää sarake oikealle"
|
|
64
|
+
},
|
|
65
|
+
"dropdown": {
|
|
66
|
+
"dropdown": "Pudotusvalikko"
|
|
67
|
+
},
|
|
68
|
+
"errors": {
|
|
69
|
+
"build_error": "tapahtui virhe",
|
|
70
|
+
"config_error": "virhe asetuksissa",
|
|
71
|
+
"contact_page_author": "Kerro ylläpitäjälle virheestä.",
|
|
72
|
+
"no_app_file": "sovellustiedosto puuttuu",
|
|
73
|
+
"runtime_error": "ohjelman suorituksen aikana tapahtui virhe",
|
|
74
|
+
"space_not_working": "\"Space ei toimi, koska\" {0}",
|
|
75
|
+
"space_paused": "tila on tauolla",
|
|
76
|
+
"use_via_api": "Käytä rajapinnan kautta"
|
|
77
|
+
},
|
|
78
|
+
"file": {
|
|
79
|
+
"uploading": "Ladataan..."
|
|
80
|
+
},
|
|
81
|
+
"highlighted_text": {
|
|
82
|
+
"highlighted_text": "Korostettu teksti"
|
|
83
|
+
},
|
|
84
|
+
"image": {
|
|
85
|
+
"allow_webcam_access": "Ole hyvä ja anna lupa web-kameran käyttöön.",
|
|
86
|
+
"brush_color": "Siveltimen väri",
|
|
87
|
+
"brush_radius": "Siveltimen koko",
|
|
88
|
+
"image": "Kuva",
|
|
89
|
+
"remove_image": "Poista kuva",
|
|
90
|
+
"select_brush_color": "Valitse siveltimen väri",
|
|
91
|
+
"start_drawing": "Aloita piirtäminen",
|
|
92
|
+
"use_brush": "Käytä sivellintä"
|
|
93
|
+
},
|
|
94
|
+
"label": {
|
|
95
|
+
"label": "Tunniste"
|
|
96
|
+
},
|
|
97
|
+
"login": {
|
|
98
|
+
"enable_cookies": "Jos käytät Hugging Face Spacea Incognito-tilassa, sinun on otettava käyttöön kolmansien osapuolten evästeet..",
|
|
99
|
+
"incorrect_credentials": "Käyttäjätietoja ei löytynyt",
|
|
100
|
+
"login": "Kirjaudu sisään"
|
|
101
|
+
},
|
|
102
|
+
"number": {
|
|
103
|
+
"number": "Numero"
|
|
104
|
+
},
|
|
105
|
+
"plot": {
|
|
106
|
+
"plot": "Kuvaaja"
|
|
107
|
+
},
|
|
108
|
+
"radio": {
|
|
109
|
+
"radio": "Radio"
|
|
110
|
+
},
|
|
111
|
+
"slider": {
|
|
112
|
+
"slider": "Säädin"
|
|
113
|
+
},
|
|
114
|
+
"upload_text": {
|
|
115
|
+
"click_to_upload": "Lataa palvelimelle",
|
|
116
|
+
"drop_audio": "Vedä audiotiedosto tähän",
|
|
117
|
+
"drop_csv": "Vedä CSV tähän",
|
|
118
|
+
"drop_file": "Vedä tiedosto tähän",
|
|
119
|
+
"drop_image": "Vedä kuva tähän",
|
|
120
|
+
"drop_video": "Vedä video tähän",
|
|
121
|
+
"drop_gallery": "Vedä media tähän",
|
|
122
|
+
"paste_clipboard": "Liitä leikepöydältä"
|
|
123
|
+
}
|
|
124
|
+
}
|
package/package.json
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"devDependencies": {
|
|
6
|
-
"@gradio/accordion": "^0.4.
|
|
7
|
-
"@gradio/
|
|
8
|
-
"@gradio/
|
|
9
|
-
"@gradio/
|
|
10
|
-
"@gradio/box": "^0.2.
|
|
11
|
-
"@gradio/
|
|
12
|
-
"@gradio/chatbot": "^0.
|
|
13
|
-
"@gradio/
|
|
14
|
-
"@gradio/
|
|
15
|
-
"@gradio/client": "^1.
|
|
16
|
-
"@gradio/code": "^0.10.1",
|
|
17
|
-
"@gradio/colorpicker": "^0.4.1",
|
|
6
|
+
"@gradio/accordion": "^0.4.4",
|
|
7
|
+
"@gradio/annotatedimage": "^0.8.5",
|
|
8
|
+
"@gradio/audio": "^0.14.5",
|
|
9
|
+
"@gradio/button": "^0.3.4",
|
|
10
|
+
"@gradio/box": "^0.2.3",
|
|
11
|
+
"@gradio/atoms": "^0.10.0",
|
|
12
|
+
"@gradio/chatbot": "^0.16.0",
|
|
13
|
+
"@gradio/checkboxgroup": "^0.6.4",
|
|
14
|
+
"@gradio/checkbox": "^0.4.4",
|
|
15
|
+
"@gradio/client": "^1.7.0",
|
|
18
16
|
"@gradio/column": "^0.2.0",
|
|
19
|
-
"@gradio/
|
|
20
|
-
"@gradio/
|
|
21
|
-
"@gradio/
|
|
22
|
-
"@gradio/
|
|
23
|
-
"@gradio/
|
|
24
|
-
"@gradio/
|
|
25
|
-
"@gradio/
|
|
26
|
-
"@gradio/
|
|
27
|
-
"@gradio/
|
|
28
|
-
"@gradio/
|
|
17
|
+
"@gradio/colorpicker": "^0.4.4",
|
|
18
|
+
"@gradio/code": "^0.10.5",
|
|
19
|
+
"@gradio/dataframe": "^0.12.0",
|
|
20
|
+
"@gradio/dataset": "^0.3.6",
|
|
21
|
+
"@gradio/datetime": "^0.2.4",
|
|
22
|
+
"@gradio/downloadbutton": "^0.2.4",
|
|
23
|
+
"@gradio/dropdown": "^0.9.2",
|
|
24
|
+
"@gradio/fallback": "^0.4.4",
|
|
25
|
+
"@gradio/fileexplorer": "^0.5.5",
|
|
26
|
+
"@gradio/file": "^0.10.5",
|
|
27
|
+
"@gradio/form": "^0.2.3",
|
|
28
|
+
"@gradio/gallery": "^0.13.5",
|
|
29
29
|
"@gradio/group": "^0.2.0",
|
|
30
|
-
"@gradio/
|
|
31
|
-
"@gradio/
|
|
32
|
-
"@gradio/image": "^0.16.
|
|
33
|
-
"@gradio/icons": "^0.8.
|
|
34
|
-
"@gradio/
|
|
35
|
-
"@gradio/
|
|
36
|
-
"@gradio/label": "^0.4.
|
|
37
|
-
"@gradio/
|
|
38
|
-
"@gradio/
|
|
39
|
-
"@gradio/
|
|
40
|
-
"@gradio/
|
|
41
|
-
"@gradio/
|
|
42
|
-
"@gradio/
|
|
43
|
-
"@gradio/number": "^0.5.1",
|
|
44
|
-
"@gradio/radio": "^0.6.1",
|
|
30
|
+
"@gradio/highlightedtext": "^0.8.4",
|
|
31
|
+
"@gradio/html": "^0.4.4",
|
|
32
|
+
"@gradio/image": "^0.16.5",
|
|
33
|
+
"@gradio/icons": "^0.8.1",
|
|
34
|
+
"@gradio/json": "^0.5.4",
|
|
35
|
+
"@gradio/imageeditor": "^0.11.5",
|
|
36
|
+
"@gradio/label": "^0.4.4",
|
|
37
|
+
"@gradio/model3d": "^0.13.5",
|
|
38
|
+
"@gradio/multimodaltextbox": "^0.7.3",
|
|
39
|
+
"@gradio/nativeplot": "^0.4.4",
|
|
40
|
+
"@gradio/number": "^0.5.4",
|
|
41
|
+
"@gradio/markdown": "^0.11.0",
|
|
42
|
+
"@gradio/paramviewer": "^0.5.4",
|
|
45
43
|
"@gradio/row": "^0.2.0",
|
|
46
|
-
"@gradio/
|
|
47
|
-
"@gradio/
|
|
48
|
-
"@gradio/
|
|
49
|
-
"@gradio/
|
|
44
|
+
"@gradio/radio": "^0.6.4",
|
|
45
|
+
"@gradio/plot": "^0.8.0",
|
|
46
|
+
"@gradio/simpledropdown": "^0.3.4",
|
|
47
|
+
"@gradio/simpleimage": "^0.8.5",
|
|
48
|
+
"@gradio/simpletextbox": "^0.3.4",
|
|
49
|
+
"@gradio/slider": "^0.5.4",
|
|
50
50
|
"@gradio/state": "^0.1.2",
|
|
51
|
-
"@gradio/
|
|
52
|
-
"@gradio/
|
|
53
|
-
"@gradio/
|
|
54
|
-
"@gradio/textbox": "^0.7.1",
|
|
51
|
+
"@gradio/tabitem": "^0.3.2",
|
|
52
|
+
"@gradio/tabs": "^0.3.2",
|
|
53
|
+
"@gradio/textbox": "^0.8.3",
|
|
55
54
|
"@gradio/theme": "^0.3.0",
|
|
56
55
|
"@gradio/timer": "^0.4.0",
|
|
57
|
-
"@gradio/
|
|
56
|
+
"@gradio/uploadbutton": "^0.7.4",
|
|
57
|
+
"@gradio/statustracker": "^0.9.2",
|
|
58
|
+
"@gradio/upload": "^0.13.4",
|
|
58
59
|
"@gradio/utils": "^0.7.0",
|
|
59
|
-
"@gradio/
|
|
60
|
-
"@gradio/wasm": "^0.14.
|
|
61
|
-
"@gradio/video": "^0.11.1"
|
|
60
|
+
"@gradio/video": "^0.11.5",
|
|
61
|
+
"@gradio/wasm": "^0.14.2"
|
|
62
62
|
},
|
|
63
63
|
"msw": {
|
|
64
64
|
"workerDirectory": "public"
|
package/src/Blocks.svelte
CHANGED
|
@@ -152,6 +152,7 @@
|
|
|
152
152
|
|
|
153
153
|
let messages: (ToastMessage & { fn_index: number })[] = [];
|
|
154
154
|
function new_message(
|
|
155
|
+
title: string,
|
|
155
156
|
message: string,
|
|
156
157
|
fn_index: number,
|
|
157
158
|
type: ToastMessage["type"],
|
|
@@ -159,6 +160,7 @@
|
|
|
159
160
|
visible = true
|
|
160
161
|
): ToastMessage & { fn_index: number } {
|
|
161
162
|
return {
|
|
163
|
+
title,
|
|
162
164
|
message,
|
|
163
165
|
fn_index,
|
|
164
166
|
type,
|
|
@@ -169,10 +171,11 @@
|
|
|
169
171
|
}
|
|
170
172
|
|
|
171
173
|
export function add_new_message(
|
|
174
|
+
title: string,
|
|
172
175
|
message: string,
|
|
173
176
|
type: ToastMessage["type"]
|
|
174
177
|
): void {
|
|
175
|
-
messages = [new_message(message, -1, type), ...messages];
|
|
178
|
+
messages = [new_message(title, message, -1, type), ...messages];
|
|
176
179
|
}
|
|
177
180
|
|
|
178
181
|
let _error_id = -1;
|
|
@@ -241,7 +244,7 @@
|
|
|
241
244
|
if (inputs_waiting.length > 0) {
|
|
242
245
|
for (const input of inputs_waiting) {
|
|
243
246
|
if (dep.inputs.includes(input)) {
|
|
244
|
-
add_new_message(WAITING_FOR_INPUTS_MESSAGE, "warning");
|
|
247
|
+
add_new_message("Warning", WAITING_FOR_INPUTS_MESSAGE, "warning");
|
|
245
248
|
return;
|
|
246
249
|
}
|
|
247
250
|
}
|
|
@@ -346,7 +349,10 @@
|
|
|
346
349
|
);
|
|
347
350
|
} catch (e) {
|
|
348
351
|
const fn_index = 0; // Mock value for fn_index
|
|
349
|
-
messages = [
|
|
352
|
+
messages = [
|
|
353
|
+
new_message("Error", String(e), fn_index, "error"),
|
|
354
|
+
...messages
|
|
355
|
+
];
|
|
350
356
|
loading_status.update({
|
|
351
357
|
status: "error",
|
|
352
358
|
fn_index,
|
|
@@ -413,9 +419,9 @@
|
|
|
413
419
|
}
|
|
414
420
|
|
|
415
421
|
function handle_log(msg: LogMessage): void {
|
|
416
|
-
const { log, fn_index, level, duration, visible } = msg;
|
|
422
|
+
const { title, log, fn_index, level, duration, visible } = msg;
|
|
417
423
|
messages = [
|
|
418
|
-
new_message(log, fn_index, level, duration, visible),
|
|
424
|
+
new_message(title, log, fn_index, level, duration, visible),
|
|
419
425
|
...messages
|
|
420
426
|
];
|
|
421
427
|
}
|
|
@@ -463,7 +469,7 @@
|
|
|
463
469
|
) {
|
|
464
470
|
showed_duplicate_message = true;
|
|
465
471
|
messages = [
|
|
466
|
-
new_message(DUPLICATE_MESSAGE, fn_index, "warning"),
|
|
472
|
+
new_message("Warning", DUPLICATE_MESSAGE, fn_index, "warning"),
|
|
467
473
|
...messages
|
|
468
474
|
];
|
|
469
475
|
}
|
|
@@ -475,7 +481,7 @@
|
|
|
475
481
|
) {
|
|
476
482
|
showed_mobile_warning = true;
|
|
477
483
|
messages = [
|
|
478
|
-
new_message(MOBILE_QUEUE_WARNING, fn_index, "warning"),
|
|
484
|
+
new_message("Warning", MOBILE_QUEUE_WARNING, fn_index, "warning"),
|
|
479
485
|
...messages
|
|
480
486
|
];
|
|
481
487
|
}
|
|
@@ -503,7 +509,7 @@
|
|
|
503
509
|
if (status.broken && is_mobile_device && user_left_page) {
|
|
504
510
|
window.setTimeout(() => {
|
|
505
511
|
messages = [
|
|
506
|
-
new_message(MOBILE_RECONNECT_MESSAGE, fn_index, "error"),
|
|
512
|
+
new_message("Error", MOBILE_RECONNECT_MESSAGE, fn_index, "error"),
|
|
507
513
|
...messages
|
|
508
514
|
];
|
|
509
515
|
}, 0);
|
|
@@ -515,8 +521,10 @@
|
|
|
515
521
|
MESSAGE_QUOTE_RE,
|
|
516
522
|
(_, b) => b
|
|
517
523
|
);
|
|
524
|
+
const _title = status.title ?? "Error";
|
|
518
525
|
messages = [
|
|
519
526
|
new_message(
|
|
527
|
+
_title,
|
|
520
528
|
_message,
|
|
521
529
|
fn_index,
|
|
522
530
|
"error",
|
|
@@ -612,8 +620,10 @@
|
|
|
612
620
|
if (event === "share") {
|
|
613
621
|
const { title, description } = data as ShareData;
|
|
614
622
|
trigger_share(title, description);
|
|
615
|
-
} else if (event === "error"
|
|
616
|
-
messages = [new_message(data, -1, event), ...messages];
|
|
623
|
+
} else if (event === "error") {
|
|
624
|
+
messages = [new_message("Error", data, -1, event), ...messages];
|
|
625
|
+
} else if (event === "warning") {
|
|
626
|
+
messages = [new_message("Warning", data, -1, event), ...messages];
|
|
617
627
|
} else if (event == "clear_status") {
|
|
618
628
|
update_status(id, "complete", data);
|
|
619
629
|
} else if (event == "close_stream") {
|
package/src/init.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { writable, type Writable, get } from "svelte/store";
|
|
2
|
+
|
|
2
3
|
import type {
|
|
3
4
|
ComponentMeta,
|
|
4
5
|
Dependency,
|
|
@@ -27,6 +28,7 @@ const raf = is_browser
|
|
|
27
28
|
* Create a store with the layout and a map of targets
|
|
28
29
|
* @returns A store with the layout and a map of targets
|
|
29
30
|
*/
|
|
31
|
+
let has_run = new Set<number>();
|
|
30
32
|
export function create_components(initial_layout: ComponentMeta | undefined): {
|
|
31
33
|
layout: Writable<ComponentMeta>;
|
|
32
34
|
targets: Writable<TargetMap>;
|
|
@@ -290,6 +292,33 @@ export function create_components(initial_layout: ComponentMeta | undefined): {
|
|
|
290
292
|
);
|
|
291
293
|
}
|
|
292
294
|
|
|
295
|
+
if (instance.type === "tabs" && !instance.props.initial_tabs) {
|
|
296
|
+
const tab_items_props =
|
|
297
|
+
node.children?.map((c) => {
|
|
298
|
+
const instance = instance_map[c.id];
|
|
299
|
+
// console.log("tabs", JSON.stringify(instance.props, null, 2));
|
|
300
|
+
instance.props.id ??= c.id;
|
|
301
|
+
return {
|
|
302
|
+
type: instance.type,
|
|
303
|
+
props: {
|
|
304
|
+
...(instance.props as any),
|
|
305
|
+
id: instance.props.id
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
}) || [];
|
|
309
|
+
|
|
310
|
+
const child_tab_items = tab_items_props.filter(
|
|
311
|
+
(child) => child.type === "tabitem"
|
|
312
|
+
);
|
|
313
|
+
|
|
314
|
+
instance.props.initial_tabs = child_tab_items?.map((child) => ({
|
|
315
|
+
label: child.props.label,
|
|
316
|
+
id: child.props.id,
|
|
317
|
+
visible: child.props.visible,
|
|
318
|
+
interactive: child.props.interactive
|
|
319
|
+
}));
|
|
320
|
+
}
|
|
321
|
+
|
|
293
322
|
return instance;
|
|
294
323
|
}
|
|
295
324
|
|
|
@@ -317,7 +346,7 @@ export function create_components(initial_layout: ComponentMeta | undefined): {
|
|
|
317
346
|
else if (update.value instanceof Set)
|
|
318
347
|
new_value = new Set(update.value);
|
|
319
348
|
else if (Array.isArray(update.value)) new_value = [...update.value];
|
|
320
|
-
else if (update.value
|
|
349
|
+
else if (update.value == null) new_value = null;
|
|
321
350
|
else if (typeof update.value === "object")
|
|
322
351
|
new_value = { ...update.value };
|
|
323
352
|
else new_value = update.value;
|
package/src/lang/fi.json
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
{
|
|
2
|
+
"3D_model": {
|
|
3
|
+
"3d_model": "3D-malli"
|
|
4
|
+
},
|
|
5
|
+
"annotated_image": {
|
|
6
|
+
"annotated_image": "Annotoitu kuva"
|
|
7
|
+
},
|
|
8
|
+
"audio": {
|
|
9
|
+
"allow_recording_access": "Ole hyvä ja anna selaimelle ja sivustolle pääsy mikrofoniin.",
|
|
10
|
+
"audio": "Audio",
|
|
11
|
+
"record_from_microphone": "Äänitä mikrofonia",
|
|
12
|
+
"stop_recording": "Lopeta äänitys",
|
|
13
|
+
"no_device_support": "Medialaitteita ei voitu käyttää. Tarkista, että yhteys on salattu (https), paikallinen (localhost), tai ssl_verify on saanut voimassa olevan SSL-sertifikaatin. Tarkista, että olet antanut selaimelle pääsyn medialaitteeseen.",
|
|
14
|
+
"stop": "Stop",
|
|
15
|
+
"resume": "Jatka",
|
|
16
|
+
"record": "Äänitä",
|
|
17
|
+
"no_microphone": "Ei mikrofonia käytössä",
|
|
18
|
+
"pause": "Pause",
|
|
19
|
+
"play": "Play",
|
|
20
|
+
"waiting": "Odotetaan"
|
|
21
|
+
},
|
|
22
|
+
"blocks": {
|
|
23
|
+
"connection_can_break": "Mobiililaitteella yhteys voi katketa, jos vaihdat välilehteä tai laite menee lepotilaa. Tällöin menetät paikkasi jonossa.",
|
|
24
|
+
"long_requests_queue": "Spacessa on ruuhkaa ja jono on pitkä. Kopioi tämä Space hypätäksesi jonon ohi.",
|
|
25
|
+
"lost_connection": "Yhteys katkesi sivulta poistumisen seurauksena. Liitytään takaisin jonoon...",
|
|
26
|
+
"waiting_for_inputs": "Odotetaan latauksen valmistumista, ole hyvä ja yritä uudelleen."
|
|
27
|
+
},
|
|
28
|
+
"checkbox": {
|
|
29
|
+
"checkbox": "Valintaruutu",
|
|
30
|
+
"checkbox_group": "Valintaruuturyhmä"
|
|
31
|
+
},
|
|
32
|
+
"code": {
|
|
33
|
+
"code": "Koodi"
|
|
34
|
+
},
|
|
35
|
+
"color_picker": {
|
|
36
|
+
"color_picker": "Värivalitsin"
|
|
37
|
+
},
|
|
38
|
+
"common": {
|
|
39
|
+
"built_with": "tehty",
|
|
40
|
+
"built_with_gradio": "tehty Gradiolla",
|
|
41
|
+
"clear": "Poista",
|
|
42
|
+
"download": "Lataa",
|
|
43
|
+
"edit": "Muokkaa",
|
|
44
|
+
"empty": "Tyhjennä",
|
|
45
|
+
"error": "Virhe",
|
|
46
|
+
"hosted_on": "Hostattu",
|
|
47
|
+
"loading": "Ladataan",
|
|
48
|
+
"logo": "logo",
|
|
49
|
+
"or": "tai",
|
|
50
|
+
"remove": "Poista",
|
|
51
|
+
"share": "Jaa",
|
|
52
|
+
"submit": "Suorita",
|
|
53
|
+
"undo": "Kumoa",
|
|
54
|
+
"no_devices": "Laitetta ei löytynyt"
|
|
55
|
+
},
|
|
56
|
+
"dataframe": {
|
|
57
|
+
"incorrect_format": "Yhteensopimaton tiedostomuoto, vain CSV- ja TSV-tiedostoja tuetaan.",
|
|
58
|
+
"new_column": "Lisää sarake",
|
|
59
|
+
"new_row": "Lisää rivi",
|
|
60
|
+
"add_row_above": "Lisää rivi yläpuolelle",
|
|
61
|
+
"add_row_below": "Lisää rivi alle",
|
|
62
|
+
"add_column_left": "Lisää sarake vasemmalle",
|
|
63
|
+
"add_column_right": "Lisää sarake oikealle"
|
|
64
|
+
},
|
|
65
|
+
"dropdown": {
|
|
66
|
+
"dropdown": "Pudotusvalikko"
|
|
67
|
+
},
|
|
68
|
+
"errors": {
|
|
69
|
+
"build_error": "tapahtui virhe",
|
|
70
|
+
"config_error": "virhe asetuksissa",
|
|
71
|
+
"contact_page_author": "Kerro ylläpitäjälle virheestä.",
|
|
72
|
+
"no_app_file": "sovellustiedosto puuttuu",
|
|
73
|
+
"runtime_error": "ohjelman suorituksen aikana tapahtui virhe",
|
|
74
|
+
"space_not_working": "\"Space ei toimi, koska\" {0}",
|
|
75
|
+
"space_paused": "tila on tauolla",
|
|
76
|
+
"use_via_api": "Käytä rajapinnan kautta"
|
|
77
|
+
},
|
|
78
|
+
"file": {
|
|
79
|
+
"uploading": "Ladataan..."
|
|
80
|
+
},
|
|
81
|
+
"highlighted_text": {
|
|
82
|
+
"highlighted_text": "Korostettu teksti"
|
|
83
|
+
},
|
|
84
|
+
"image": {
|
|
85
|
+
"allow_webcam_access": "Ole hyvä ja anna lupa web-kameran käyttöön.",
|
|
86
|
+
"brush_color": "Siveltimen väri",
|
|
87
|
+
"brush_radius": "Siveltimen koko",
|
|
88
|
+
"image": "Kuva",
|
|
89
|
+
"remove_image": "Poista kuva",
|
|
90
|
+
"select_brush_color": "Valitse siveltimen väri",
|
|
91
|
+
"start_drawing": "Aloita piirtäminen",
|
|
92
|
+
"use_brush": "Käytä sivellintä"
|
|
93
|
+
},
|
|
94
|
+
"label": {
|
|
95
|
+
"label": "Tunniste"
|
|
96
|
+
},
|
|
97
|
+
"login": {
|
|
98
|
+
"enable_cookies": "Jos käytät Hugging Face Spacea Incognito-tilassa, sinun on otettava käyttöön kolmansien osapuolten evästeet..",
|
|
99
|
+
"incorrect_credentials": "Käyttäjätietoja ei löytynyt",
|
|
100
|
+
"login": "Kirjaudu sisään"
|
|
101
|
+
},
|
|
102
|
+
"number": {
|
|
103
|
+
"number": "Numero"
|
|
104
|
+
},
|
|
105
|
+
"plot": {
|
|
106
|
+
"plot": "Kuvaaja"
|
|
107
|
+
},
|
|
108
|
+
"radio": {
|
|
109
|
+
"radio": "Radio"
|
|
110
|
+
},
|
|
111
|
+
"slider": {
|
|
112
|
+
"slider": "Säädin"
|
|
113
|
+
},
|
|
114
|
+
"upload_text": {
|
|
115
|
+
"click_to_upload": "Lataa palvelimelle",
|
|
116
|
+
"drop_audio": "Vedä audiotiedosto tähän",
|
|
117
|
+
"drop_csv": "Vedä CSV tähän",
|
|
118
|
+
"drop_file": "Vedä tiedosto tähän",
|
|
119
|
+
"drop_image": "Vedä kuva tähän",
|
|
120
|
+
"drop_video": "Vedä video tähän",
|
|
121
|
+
"drop_gallery": "Vedä media tähän",
|
|
122
|
+
"paste_clipboard": "Liitä leikepöydältä"
|
|
123
|
+
}
|
|
124
|
+
}
|