@gradio/core 0.27.2 → 0.29.0

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/src/init.ts CHANGED
@@ -12,6 +12,7 @@ import { load_component } from "virtual:component-loader";
12
12
  import type { client_return } from "@gradio/client";
13
13
  import { create_loading_status_store } from "./stores";
14
14
  import { _ } from "svelte-i18n";
15
+ import { i18n_marker } from "./i18n";
15
16
 
16
17
  export interface UpdateTransaction {
17
18
  id: number;
@@ -88,14 +89,13 @@ export function create_components(
88
89
  value_change_cb = cb;
89
90
  }
90
91
 
91
- // Store current layout and root for dynamic visibility recalculation
92
92
  let current_layout: LayoutNode;
93
93
  let current_root: string;
94
94
 
95
95
  function set_event_specific_args(dependencies: Dependency[]): void {
96
96
  dependencies.forEach((dep) => {
97
97
  dep.targets.forEach((target) => {
98
- const instance = instance_map[target[0]];
98
+ const instance = instance_map?.[target[0]];
99
99
  if (instance && dep.event_specific_args?.length > 0) {
100
100
  dep.event_specific_args?.forEach((arg: string) => {
101
101
  instance.props[arg] = dep[arg as keyof Dependency];
@@ -122,15 +122,12 @@ export function create_components(
122
122
  fill_height: boolean;
123
123
  };
124
124
  }): Promise<void> {
125
- // make sure the state is settled before proceeding
126
125
  flush();
127
126
  app = _app;
128
127
 
129
128
  if (instance_map) {
130
- // re-render in reload mode
131
129
  components.forEach((c) => {
132
130
  if (c.props.value == null && c.key) {
133
- // If the component has a key, we preserve its value by finding a matching instance with the same key
134
131
  const matching_instance = Object.values(instance_map).find(
135
132
  (instance) => instance.key === c.key
136
133
  );
@@ -149,14 +146,17 @@ export function create_components(
149
146
  _component_map = new Map();
150
147
  instance_map = {};
151
148
 
152
- // Store current layout and root for dynamic visibility recalculation
153
149
  current_layout = layout;
154
150
  current_root = root;
155
151
 
156
152
  _rootNode = {
157
153
  id: layout.id,
158
154
  type: "column",
159
- props: { interactive: false, scale: options.fill_height ? 1 : null },
155
+ props: {
156
+ interactive: false,
157
+ scale: options.fill_height ? 1 : null,
158
+ visible: true
159
+ },
160
160
  has_modes: false,
161
161
  instance: null as unknown as ComponentMeta["instance"],
162
162
  component: null as unknown as ComponentMeta["component"],
@@ -257,7 +257,7 @@ export function create_components(
257
257
 
258
258
  target_map.set(_target_map);
259
259
 
260
- let current_element = instance_map[layout.id];
260
+ let current_element = instance_map?.[layout.id];
261
261
  let all_current_children: ComponentMeta[] = [];
262
262
  const add_to_current_children = (component: ComponentMeta): void => {
263
263
  all_current_children.push(component);
@@ -276,7 +276,7 @@ export function create_components(
276
276
  (c) => c.key === component.key
277
277
  );
278
278
  if (component.key != null && replacement_component !== undefined) {
279
- const instance = instance_map[component.id];
279
+ const instance = instance_map?.[component.id];
280
280
  for (const prop in replacement_component.props) {
281
281
  if (
282
282
  !(
@@ -289,7 +289,7 @@ export function create_components(
289
289
  }
290
290
  }
291
291
  } else {
292
- delete instance_map[_id];
292
+ if (instance_map) delete instance_map[_id];
293
293
  if (_component_map.has(_id)) {
294
294
  _component_map.delete(_id);
295
295
  }
@@ -298,17 +298,18 @@ export function create_components(
298
298
  });
299
299
 
300
300
  const components_to_add = new_components.concat(
301
- replacement_components.filter((c) => !instance_map[c.id])
301
+ replacement_components.filter((c) => !instance_map?.[c.id])
302
302
  );
303
303
 
304
304
  components_to_add.forEach((c) => {
305
305
  instance_map[c.id] = c;
306
+
306
307
  _component_map.set(c.id, c);
307
308
  });
308
309
  if (current_element.parent) {
309
310
  current_element.parent.children![
310
311
  current_element.parent.children!.indexOf(current_element)
311
- ] = instance_map[layout.id];
312
+ ] = instance_map?.[layout.id];
312
313
  }
313
314
 
314
315
  walk_layout(
@@ -332,7 +333,7 @@ export function create_components(
332
333
  components: ComponentMeta[],
333
334
  parent?: ComponentMeta
334
335
  ): Promise<ComponentMeta> {
335
- const instance = instance_map[node.id];
336
+ const instance = instance_map?.[node.id];
336
337
  if (!instance.component) {
337
338
  const constructor_key = instance.component_class_id || instance.type;
338
339
  let component_constructor = constructor_map.get(constructor_key);
@@ -379,10 +380,13 @@ export function create_components(
379
380
  );
380
381
  }
381
382
 
382
- if (instance.type === "tabs" && !instance.props.initial_tabs) {
383
+ if (
384
+ (instance.type === "tabs" && !instance.props.initial_tabs) ||
385
+ (instance.type === "walkthrough" && !instance.props.initial_tabs)
386
+ ) {
383
387
  const tab_items_props =
384
388
  node.children?.map((c, i) => {
385
- const instance = instance_map[c.id];
389
+ const instance = instance_map?.[c.id];
386
390
  instance.props.id ??= c.id;
387
391
  return {
388
392
  type: instance.type,
@@ -394,23 +398,29 @@ export function create_components(
394
398
  };
395
399
  }) || [];
396
400
 
401
+ const _type =
402
+ instance.type === "walkthrough" ? "walkthroughstep" : "tabitem";
403
+
397
404
  const child_tab_items = tab_items_props.filter(
398
- (child) => child.type === "tabitem"
405
+ (child) => child.type === _type
399
406
  );
400
407
 
401
408
  instance.props.initial_tabs = child_tab_items?.map((child) => ({
402
- label: child.props.label,
409
+ label: child.props.label.includes(i18n_marker) ? "" : child.props.label,
403
410
  id: child.props.id,
404
411
  visible:
405
- typeof child.props.visible === "boolean" ? child.props.visible : true,
412
+ typeof child.props.visible === "boolean" ||
413
+ child.props.visible === "hidden"
414
+ ? child.props.visible
415
+ : true,
406
416
  interactive: child.props.interactive,
407
417
  order: child.props.order
408
418
  }));
409
419
  }
410
420
 
411
- if (instance.type === "tabs") {
421
+ if (instance.type === "tabs" || instance.type === "walkthrough") {
412
422
  node.children?.forEach((c, i) => {
413
- const child = instance_map[c.id];
423
+ const child = instance_map?.[c.id];
414
424
  child.props.order = i;
415
425
  });
416
426
  }
@@ -438,7 +448,6 @@ export function create_components(
438
448
  for (const component of components_to_load) {
439
449
  const constructor_key = component.component_class_id || component.type;
440
450
 
441
- // Only load if not already loaded
442
451
  if (!constructor_map.has(constructor_key)) {
443
452
  const { component: loadable_component, example_components } =
444
453
  get_component(
@@ -456,7 +465,6 @@ export function create_components(
456
465
  }
457
466
  }
458
467
 
459
- // Load the component if it doesn't exist yet
460
468
  if (!component.component) {
461
469
  component.component = (await loadable_component)?.default;
462
470
  }
@@ -476,13 +484,11 @@ export function create_components(
476
484
  function has_visibility_changes(updates: UpdateTransaction[][]): boolean {
477
485
  return updates.some((update_batch) =>
478
486
  update_batch.some((update) => {
479
- const instance = instance_map[update.id];
487
+ const instance = instance_map?.[update.id];
480
488
  if (!instance) return false;
481
489
 
482
- // Check for visibility property changes
483
490
  if (update.prop === "visible") return true;
484
491
 
485
- // Check for selected tab changes in tabs components
486
492
  if (update.prop === "selected" && instance.type === "tabs") return true;
487
493
 
488
494
  return false;
@@ -497,7 +503,6 @@ export function create_components(
497
503
  ? [..._component_map.values()]
498
504
  : _components;
499
505
 
500
- // Capture current visibility state before applying updates
501
506
  if (had_visibility_changes && current_layout) {
502
507
  previous_visible_ids = determine_visible_components(
503
508
  current_layout,
@@ -510,7 +515,7 @@ export function create_components(
510
515
  for (let j = 0; j < pending_updates[i].length; j++) {
511
516
  const update = pending_updates[i][j];
512
517
  if (!update) continue;
513
- const instance = instance_map[update.id];
518
+ const instance = instance_map?.[update.id];
514
519
  if (!instance) continue;
515
520
  let new_value;
516
521
  const old_value = instance.props[update.prop];
@@ -533,10 +538,10 @@ export function create_components(
533
538
  }
534
539
  }
535
540
  }
541
+
536
542
  return layout;
537
543
  });
538
544
 
539
- // After applying updates, check if we need to load new components
540
545
  if (had_visibility_changes && current_layout && previous_visible_ids) {
541
546
  raf(async () => {
542
547
  const new_visible_ids = determine_visible_components(
@@ -545,17 +550,14 @@ export function create_components(
545
550
  );
546
551
  const newly_visible_ids = new Set<number>();
547
552
 
548
- // Find components that are now visible but weren't before
549
553
  for (const id of new_visible_ids) {
550
554
  if (!previous_visible_ids!.has(id)) {
551
555
  newly_visible_ids.add(id);
552
556
  }
553
557
  }
554
558
 
555
- // Load the newly visible components
556
559
  await load_newly_visible_components(newly_visible_ids, all_components);
557
560
 
558
- // Trigger a layout update to render the newly loaded components
559
561
  if (newly_visible_ids.size > 0) {
560
562
  layout_store.update((layout) => layout);
561
563
  }
@@ -898,13 +900,11 @@ function get_selected_tab_id(
898
900
  layout: LayoutNode,
899
901
  components: ComponentMeta[]
900
902
  ): string | number | undefined {
901
- // Check if selected prop is a string or number
902
903
  const selected = component.props.selected;
903
904
  if (typeof selected === "string" || typeof selected === "number") {
904
905
  return selected;
905
906
  }
906
907
 
907
- // If no tab is explicitly selected, find the first visible and interactive tab
908
908
  if (layout.children) {
909
909
  for (const child of layout.children) {
910
910
  const child_component = components.find((c) => c.id === child.id);
@@ -967,27 +967,42 @@ function determine_visible_components(
967
967
  parent_tabs_context?: { selected_tab_id?: string | number }
968
968
  ): Set<number> {
969
969
  const visible_components: Set<number> = new Set();
970
+
970
971
  const component = components.find((c) => c.id === layout.id);
971
972
 
972
973
  if (!component) {
973
974
  return visible_components;
974
975
  }
975
976
 
976
- // Check if the component itself is visible
977
977
  const component_visible =
978
- parent_visible &&
979
- (typeof component.props.visible === "boolean"
980
- ? component.props.visible
981
- : true);
978
+ component.props.visible !== false &&
979
+ component.props.visible !== "hidden" &&
980
+ parent_visible;
981
+
982
+ const should_load = component.props.visible === "hidden" || component_visible;
983
+
984
+ if (!should_load) {
985
+ return visible_components;
986
+ }
987
+
988
+ if (component.type === "tabs") {
989
+ const selected_tab_id = get_selected_tab_id(component, layout, components);
990
+ const tabs_context = { selected_tab_id };
991
+
992
+ visible_components.add(layout.id);
982
993
 
983
- // Handle tab_item special case
984
- if (component.type === "tabitem") {
994
+ const child_visible = process_children_visibility(
995
+ layout,
996
+ components,
997
+ tabs_context
998
+ );
999
+ child_visible.forEach((id) => visible_components.add(id));
1000
+ } else if (component.type === "tabitem") {
985
1001
  if (
986
1002
  is_tab_item_visible(component, component_visible, parent_tabs_context)
987
1003
  ) {
988
- visible_components.add(component.id);
1004
+ visible_components.add(layout.id);
989
1005
 
990
- // Process children if this tab item is visible
991
1006
  const child_visible = process_children_visibility(
992
1007
  layout,
993
1008
  components,
@@ -995,36 +1010,9 @@ function determine_visible_components(
995
1010
  );
996
1011
  child_visible.forEach((id) => visible_components.add(id));
997
1012
  }
998
- // If tab item is not visible, none of its children should be loaded
999
- return visible_components;
1000
- }
1001
-
1002
- // Handle tabs component
1003
- if (component.type === "tabs") {
1004
- if (component_visible) {
1005
- visible_components.add(component.id);
1006
-
1007
- // Determine which tab should be selected
1008
- const selected_tab_id = get_selected_tab_id(
1009
- component,
1010
- layout,
1011
- components
1012
- );
1013
-
1014
- // Process children with tabs context
1015
- const child_visible = process_children_visibility(layout, components, {
1016
- selected_tab_id
1017
- });
1018
- child_visible.forEach((id) => visible_components.add(id));
1019
- }
1020
- return visible_components;
1021
- }
1022
-
1023
- // For regular components
1024
- if (component_visible) {
1025
- visible_components.add(component.id);
1013
+ } else {
1014
+ visible_components.add(layout.id);
1026
1015
 
1027
- // Process children if this component is visible
1028
1016
  const child_visible = process_children_visibility(
1029
1017
  layout,
1030
1018
  components,
@@ -1032,7 +1020,6 @@ function determine_visible_components(
1032
1020
  );
1033
1021
  child_visible.forEach((id) => visible_components.add(id));
1034
1022
  }
1035
- // If component is not visible, don't process children
1036
1023
 
1037
1024
  return visible_components;
1038
1025
  }
@@ -1051,13 +1038,11 @@ export function preload_visible_components(
1051
1038
  ): Map<ComponentMeta["type"], LoadingComponent> {
1052
1039
  let constructor_map: Map<ComponentMeta["type"], LoadingComponent> = new Map();
1053
1040
 
1054
- // Determine which components should be visible
1055
1041
  const visible_component_ids = determine_visible_components(
1056
1042
  layout,
1057
1043
  components
1058
1044
  );
1059
1045
 
1060
- // Only preload visible components
1061
1046
  components.forEach((c) => {
1062
1047
  if (visible_component_ids.has(c.id)) {
1063
1048
  const { component, example_components } = get_component(
@@ -1113,6 +1098,9 @@ export function preload_all_components(
1113
1098
  }
1114
1099
 
1115
1100
  function is_visible(component: ComponentMeta): boolean {
1101
+ if (component.props.visible === "hidden") {
1102
+ return true;
1103
+ }
1116
1104
  if (
1117
1105
  typeof component.props.visible === "boolean" &&
1118
1106
  component.props.visible === false
package/src/lang/ar.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "_name": "العربية",
3
3
  "3D_model": {
4
4
  "3d_model": "نموذج ثلاثي الأبعاد",
5
- "drop_to_upload": "اسقط ملف نموذج 3D (.obj، .glb، .stl، .gltf، .splat، أو .ply) هنا للتحميل"
5
+ "drop_to_upload": "اسقط ملف نموذج ثلاثي الأبعاد 3D (.obj، .glb، .stl، .gltf، .splat، أو .ply) هنا للتحميل"
6
6
  },
7
7
  "annotated_image": {
8
8
  "annotated_image": "صورة مشروحة"
@@ -23,10 +23,10 @@
23
23
  "drop_to_upload": "اسقط ملف صوت هنا للتحميل"
24
24
  },
25
25
  "blocks": {
26
- "connection_can_break": "على الهاتف المحمول، يمكن أن ينقطع الاتصال إذا تم تغيير التبويب أو دخل الجهاز في وضع السكون، مما يؤدي إلى فقدان موقعك في قائمة الانتظار.",
27
- "long_requests_queue": "هناك قائمة انتظار طويلة من الطلبات المعلقة. قم بتكرار هذا الفضاء للتخطي.",
28
- "lost_connection": "فقد الاتصال بسبب مغادرة الصفحة. إعادة الانضمام إلى قائمة الانتظار...",
29
- "waiting_for_inputs": "انتظار انتهاء تحميل الملف(ات)، يرجى إعادة المحاولة."
26
+ "connection_can_break": "على الهاتف المحمول، يمكن أن ينقطع الاتصال إذا تم تغيير التبويب لهذه الصفحةة أو دخل الجهاز في وضع السكون، مما يؤدي إلى فقدان موقعك في قائمة الانتظار.",
27
+ "long_requests_queue": "هناك قائمة انتظار طويلة من الطلبات المعلقة. قم بنسخ هذه المساحة للتخطي.",
28
+ "lost_connection": "تم فقدان الاتصال بسبب مغادرة الصفحة. جارٍ إعادة الانضمام إلى قائمة الانتظار...",
29
+ "waiting_for_inputs": "إنتظر انتهاء رفع الملف(ات)، يرجى إعادة المحاولة."
30
30
  },
31
31
  "checkbox": {
32
32
  "checkbox": "خانة اختيار",
@@ -40,9 +40,9 @@
40
40
  },
41
41
  "common": {
42
42
  "built_with": "بُني باستخدام",
43
- "built_with_gradio": "تم الإنشاء بإستخدام Gradio",
43
+ "built_with_gradio": "بني بإستخدام Gradio",
44
44
  "clear": "أمسح",
45
- "download": "تحميل",
45
+ "download": "تنزيل",
46
46
  "edit": "تعديل",
47
47
  "empty": "فارغ",
48
48
  "error": "خطأ",
@@ -58,7 +58,12 @@
58
58
  "no_devices": "لم يتم العثور على أجهزة",
59
59
  "language": "اللغة",
60
60
  "display_theme": "مظهر العرض",
61
- "pwa": "تطبيق ويب تقدمي"
61
+ "pwa": "تطبيق ويب تقدمي",
62
+ "record": "تسجيل",
63
+ "stop_recording": "إيقاف التسجيل",
64
+ "screen_studio": "شاشة الأستوديو",
65
+ "share_gradio_tab": "مشاركة تبويبة صفحة Gradio",
66
+ "run": "تشغيل"
62
67
  },
63
68
  "dataframe": {
64
69
  "incorrect_format": "تنسيق غير صحيح، يتم دعم ملفات CSV و TSV فقط",
@@ -73,8 +78,10 @@
73
78
  "sort_column": "فرز العمود",
74
79
  "sort_ascending": "فرز تصاعدي",
75
80
  "sort_descending": "فرز تنازلي",
76
- "drop_to_upload": "اسقط ملفات CSV أو TSV هنا لاستيراد البيانات إلى الإطار الجدولية",
77
- "clear_sort": "مسح الترتيب"
81
+ "drop_to_upload": "اسقط ملفات CSV أو TSV هنا لاستيراد البيانات إلى الإطر الجدولية",
82
+ "clear_sort": "مسح الترتيب",
83
+ "filter": "مرشح",
84
+ "clear_filter": "مسح المرشحات"
78
85
  },
79
86
  "dropdown": {
80
87
  "dropdown": "قائمة منسدلة"
@@ -82,18 +89,19 @@
82
89
  "errors": {
83
90
  "build_error": "هناك خطأ في البناء",
84
91
  "config_error": "هناك خطأ في التكوين",
85
- "contact_page_author": "يرجى الاتصال بمؤلف الصفحة",
92
+ "contact_page_author": "يرجى التواصل مع مبرمج الصفحة",
86
93
  "no_app_file": "لا يوجد ملف تطبيق",
87
- "runtime_error": "هناك خطأ في وقت التشغيل",
94
+ "runtime_error": "هناك خطأ أثناء التشغيل",
88
95
  "space_not_working": "المساحة لا تعمل لأن {0}",
89
96
  "space_paused": "المساحة متوقفة مؤقتًا",
90
- "use_via_api": "استخدم عبر API"
97
+ "use_via_api": "إستخدام عبر API",
98
+ "use_via_api_or_mcp": "إستخدام عبر واجهة برمجة التطبيقات API أو خادم MCP"
91
99
  },
92
100
  "file": {
93
101
  "uploading": "جاري الرفع..."
94
102
  },
95
103
  "highlighted_text": {
96
- "highlighted_text": "نص مميز"
104
+ "highlighted_text": "نص محدد"
97
105
  },
98
106
  "image": {
99
107
  "allow_webcam_access": "يرجى السماح بالوصول إلى كاميرا الويب للتسجيل.",
@@ -0,0 +1,154 @@
1
+ {
2
+ "_name": "Bahasa Indonesia",
3
+ "3D_model": {
4
+ "3d_model": "Model 3D",
5
+ "drop_to_upload": "Letakkan file model 3D (.obj, .glb, .stl, .gltf, .splat, atau .ply) di sini untuk mengunggah"
6
+ },
7
+ "annotated_image": {
8
+ "annotated_image": "Gambar Beranotasi"
9
+ },
10
+ "audio": {
11
+ "allow_recording_access": "Mohon izinkan akses ke mikrofon untuk merekam.",
12
+ "audio": "Audio",
13
+ "record_from_microphone": "Rekam dari mikrofon",
14
+ "stop_recording": "Hentikan rekaman",
15
+ "no_device_support": "Perangkat media tidak dapat diakses. Pastikan Anda menjalankan dari sumber yang aman (https) atau localhost (atau Anda telah meneruskan sertifikat SSL yang valid ke ssl_verify), dan Anda telah mengizinkan akses browser ke perangkat Anda.",
16
+ "stop": "Berhenti",
17
+ "resume": "Lanjutkan",
18
+ "record": "Rekam",
19
+ "no_microphone": "Tidak ada mikrofon yang ditemukan",
20
+ "pause": "Jeda",
21
+ "play": "Putar",
22
+ "waiting": "Menunggu",
23
+ "drop_to_upload": "Letakkan file audio di sini untuk mengunggah"
24
+ },
25
+ "blocks": {
26
+ "connection_can_break": "Di perangkat seluler, koneksi dapat terputus jika tab ini tidak dalam fokus atau perangkat dalam mode tidur, sehingga Anda kehilangan posisi dalam antrian.",
27
+ "long_requests_queue": "Ada antrian panjang dari permintaan yang tertunda. Gandakan Ruang ini untuk melompati antrian.",
28
+ "lost_connection": "Koneksi terputus karena meninggalkan halaman. Bergabung kembali ke antrian...",
29
+ "waiting_for_inputs": "Menunggu file selesai diunggah, mohon coba lagi."
30
+ },
31
+ "checkbox": {
32
+ "checkbox": "Kotak centang",
33
+ "checkbox_group": "Grup kotak centang"
34
+ },
35
+ "code": {
36
+ "code": "Kode"
37
+ },
38
+ "color_picker": {
39
+ "color_picker": "Pemilih Warna"
40
+ },
41
+ "common": {
42
+ "built_with": "dibuat dengan",
43
+ "built_with_gradio": "Dibuat dengan Gradio",
44
+ "clear": "Bersihkan",
45
+ "download": "Unduh",
46
+ "edit": "Edit",
47
+ "empty": "Kosong",
48
+ "error": "Error",
49
+ "hosted_on": "Di-hosting di",
50
+ "loading": "Memuat",
51
+ "logo": "logo",
52
+ "or": "atau",
53
+ "remove": "Hapus",
54
+ "settings": "Pengaturan",
55
+ "share": "Bagikan",
56
+ "submit": "Kirim",
57
+ "undo": "Urungkan",
58
+ "no_devices": "Tidak ada perangkat yang ditemukan",
59
+ "language": "Bahasa",
60
+ "display_theme": "Tema Tampilan",
61
+ "pwa": "Aplikasi Web Progresif"
62
+ },
63
+ "dataframe": {
64
+ "incorrect_format": "Format salah, hanya file CSV dan TSV yang didukung",
65
+ "new_column": "Tambah kolom",
66
+ "new_row": "Baris baru",
67
+ "add_row_above": "Tambah baris di atas",
68
+ "add_row_below": "Tambah baris di bawah",
69
+ "add_column_left": "Tambah kolom ke kiri",
70
+ "add_column_right": "Tambah kolom ke kanan",
71
+ "delete_row": "Hapus baris",
72
+ "delete_column": "Hapus kolom",
73
+ "sort_column": "Urutkan kolom",
74
+ "sort_ascending": "Urutkan menaik",
75
+ "sort_descending": "Urutkan menurun",
76
+ "drop_to_upload": "Letakkan file CSV atau TSV di sini untuk mengimpor data ke dataframe",
77
+ "clear_sort": "Bersihkan pengurutan"
78
+ },
79
+ "dropdown": {
80
+ "dropdown": "Dropdown"
81
+ },
82
+ "errors": {
83
+ "build_error": "ada error saat membangun",
84
+ "config_error": "ada error konfigurasi",
85
+ "contact_page_author": "Mohon hubungi penulis halaman untuk memberitahu mereka.",
86
+ "no_app_file": "tidak ada file aplikasi",
87
+ "runtime_error": "ada error runtime",
88
+ "space_not_working": "\"Ruang tidak berfungsi karena\" {0}",
89
+ "space_paused": "ruang sedang dijeda",
90
+ "use_via_api": "Gunakan melalui API"
91
+ },
92
+ "file": {
93
+ "uploading": "Mengunggah..."
94
+ },
95
+ "highlighted_text": {
96
+ "highlighted_text": "Teks yang Disorot"
97
+ },
98
+ "image": {
99
+ "allow_webcam_access": "Mohon izinkan akses ke webcam untuk merekam.",
100
+ "brush_color": "Warna kuas",
101
+ "brush_radius": "Radius kuas",
102
+ "image": "Gambar",
103
+ "remove_image": "Hapus Gambar",
104
+ "select_brush_color": "Pilih warna kuas",
105
+ "start_drawing": "Mulai menggambar",
106
+ "use_brush": "Gunakan kuas",
107
+ "drop_to_upload": "Letakkan file gambar di sini untuk mengunggah"
108
+ },
109
+ "label": {
110
+ "label": "Label"
111
+ },
112
+ "login": {
113
+ "enable_cookies": "Jika Anda mengunjungi Ruang HuggingFace dalam mode Penyamaran, Anda harus mengaktifkan cookie pihak ketiga.",
114
+ "incorrect_credentials": "Kredensial salah",
115
+ "username": "nama pengguna",
116
+ "password": "kata sandi",
117
+ "login": "Masuk"
118
+ },
119
+ "number": {
120
+ "number": "Nomor"
121
+ },
122
+ "plot": {
123
+ "plot": "Plot"
124
+ },
125
+ "radio": {
126
+ "radio": "Tombol Radio"
127
+ },
128
+ "slider": {
129
+ "slider": "Penggeser"
130
+ },
131
+ "upload_text": {
132
+ "click_to_upload": "Klik untuk Mengunggah",
133
+ "drop_audio": "Letakkan Audio di Sini",
134
+ "drop_csv": "Letakkan CSV di Sini",
135
+ "drop_file": "Letakkan File di Sini",
136
+ "drop_image": "Letakkan Gambar di Sini",
137
+ "drop_video": "Letakkan Video di Sini",
138
+ "drop_gallery": "Letakkan Media di Sini",
139
+ "paste_clipboard": "Tempel dari Papan Klip"
140
+ },
141
+ "video": {
142
+ "drop_to_upload": "Letakkan file video di sini untuk mengunggah"
143
+ },
144
+ "chatbot": {
145
+ "edit": "Edit",
146
+ "retry": "Coba lagi",
147
+ "undo": "Urungkan",
148
+ "submit": "Kirim",
149
+ "cancel": "Batal",
150
+ "like": "Suka",
151
+ "dislike": "Tidak Suka",
152
+ "clear": "Bersihkan obrolan"
153
+ }
154
+ }
@@ -0,0 +1,9 @@
1
+ import { writable } from "svelte/store";
2
+
3
+ export interface NavbarConfig {
4
+ visible?: boolean;
5
+ main_page_name?: string | false;
6
+ value?: [string, string][] | null;
7
+ }
8
+
9
+ export const navbar_config = writable<NavbarConfig | null>(null);
package/src/stores.ts CHANGED
@@ -18,6 +18,7 @@ export interface LoadingStatus {
18
18
  unit: string | null;
19
19
  desc: string | null;
20
20
  }[];
21
+ validation_error?: string | null;
21
22
  }
22
23
 
23
24
  export type LoadingStatusCollection = Record<number, LoadingStatus>;
@@ -28,6 +29,10 @@ interface LoadingStatusStore {
28
29
  register: (index: number, inputs: number[], outputs: number[]) => void;
29
30
  get_status_for_fn: (i: number) => LoadingStatus["status"];
30
31
  get_inputs_to_update: () => Map<number, string>;
32
+ update_component_status: (
33
+ index: number,
34
+ status: Partial<LoadingStatus>
35
+ ) => void;
31
36
  }
32
37
 
33
38
  export function create_loading_status_store(): LoadingStatusStore {
@@ -152,8 +157,22 @@ export function create_loading_status_store(): LoadingStatusStore {
152
157
  fn_outputs[index] = outputs;
153
158
  }
154
159
 
160
+ function update_component_status(
161
+ index: number,
162
+ status: Partial<LoadingStatus>
163
+ ): void {
164
+ store.update((outputs: LoadingStatusCollection) => {
165
+ outputs[index] = {
166
+ ...outputs[index],
167
+ ...status
168
+ };
169
+ return outputs;
170
+ });
171
+ }
172
+
155
173
  return {
156
174
  update,
175
+ update_component_status,
157
176
  register,
158
177
  subscribe: store.subscribe,
159
178
  get_status_for_fn(i: number) {
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/svelte";
2
2
  import I18nMultiLanguageTestComponent from "./I18nMultiLanguageTestComponent.svelte";
3
3
 
4
4
  const meta = {
5
- title: "Core/I18n Multi-Language Test",
5
+ // title: "Core/I18n Multi-Language Test",
6
6
  component: I18nMultiLanguageTestComponent,
7
7
  parameters: {
8
8
  layout: "centered"
package/src/types.ts CHANGED
@@ -8,6 +8,7 @@ interface SharedProps {
8
8
  components?: string[];
9
9
  server_fns?: string[];
10
10
  interactive: boolean;
11
+ visible: boolean | "hidden";
11
12
  [key: string]: unknown;
12
13
  }
13
14