@gradio/core 0.1.0-beta.2 → 0.1.0-beta.4

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 CHANGED
@@ -1,5 +1,45 @@
1
1
  # @gradio/core
2
2
 
3
+ ## 0.1.0-beta.4
4
+
5
+ ### Features
6
+
7
+ - [#9464](https://github.com/gradio-app/gradio/pull/9464) [`3ac5d9c`](https://github.com/gradio-app/gradio/commit/3ac5d9c972576d82bc365a6532e6e12f55441a30) - Fix plots. Thanks @pngwn!
8
+
9
+ ### Dependency updates
10
+
11
+ - @gradio/statustracker@0.8.0-beta.2
12
+ - @gradio/upload@0.13.0-beta.4
13
+ - @gradio/button@0.3.0-beta.4
14
+ - @gradio/markdown@0.10.0-beta.2
15
+ - @gradio/textbox@0.7.0-beta.2
16
+ - @gradio/checkbox@0.4.0-beta.2
17
+ - @gradio/file@0.10.0-beta.4
18
+ - @gradio/image@0.16.0-beta.4
19
+ - @gradio/video@0.11.0-beta.4
20
+ - @gradio/code@0.10.0-beta.4
21
+ - @gradio/paramviewer@0.4.22-beta.2
22
+ - @gradio/wasm@0.14.0-beta.3
23
+ - @gradio/plot@0.7.0-beta.3
24
+ - @gradio/gallery@0.13.0-beta.4
25
+
26
+ ## 0.1.0-beta.3
27
+
28
+ ### Features
29
+
30
+ - [#9412](https://github.com/gradio-app/gradio/pull/9412) [`c2c2fd9`](https://github.com/gradio-app/gradio/commit/c2c2fd989348f826566773c07c0e0bda200199ff) - fix SSR apps on spaces. Thanks @pngwn!
31
+
32
+ ### Dependency updates
33
+
34
+ - @gradio/upload@0.13.0-beta.3
35
+ - @gradio/video@0.11.0-beta.3
36
+ - @gradio/code@0.10.0-beta.3
37
+ - @gradio/client@1.6.0-beta.3
38
+ - @gradio/button@0.3.0-beta.3
39
+ - @gradio/gallery@0.13.0-beta.3
40
+ - @gradio/file@0.10.0-beta.3
41
+ - @gradio/image@0.16.0-beta.3
42
+
3
43
  ## 0.1.0-beta.2
4
44
 
5
45
  ### Features
@@ -28,8 +28,8 @@ export let js;
28
28
  export let fill_height = false;
29
29
  export let ready;
30
30
  export let username;
31
- export let api_prefix;
32
- export let max_file_size;
31
+ export let api_prefix = "";
32
+ export let max_file_size = void 0;
33
33
  export let initial_layout = void 0;
34
34
  let {
35
35
  layout: _layout,
@@ -230,8 +230,6 @@ async function trigger_api_call(dep_index, trigger_id = null, event_data = null)
230
230
  }
231
231
  }
232
232
  }
233
- $:
234
- console.log({ app });
235
233
  async function make_prediction(payload2, streaming = false) {
236
234
  if (api_recorder_visible) {
237
235
  api_calls = [...api_calls, JSON.parse(JSON.stringify(payload2))];
@@ -24,8 +24,8 @@ declare const __propDef: {
24
24
  fill_height?: boolean | undefined;
25
25
  ready: boolean;
26
26
  username: string | null;
27
- api_prefix: string;
28
- max_file_size: number;
27
+ api_prefix?: string | undefined;
28
+ max_file_size?: number | undefined;
29
29
  initial_layout?: LayoutNode | undefined;
30
30
  search_params: URLSearchParams;
31
31
  render_complete?: boolean | undefined;
package/package.json CHANGED
@@ -1,64 +1,64 @@
1
1
  {
2
2
  "name": "@gradio/core",
3
- "version": "0.1.0-beta.2",
3
+ "version": "0.1.0-beta.4",
4
4
  "type": "module",
5
5
  "devDependencies": {
6
6
  "@gradio/accordion": "^0.3.23-beta.2",
7
+ "@gradio/annotatedimage": "^0.8.0-beta.4",
7
8
  "@gradio/atoms": "^0.9.0-beta.2",
8
- "@gradio/annotatedimage": "^0.8.0-beta.2",
9
- "@gradio/audio": "^0.14.0-beta.2",
9
+ "@gradio/audio": "^0.14.0-beta.5",
10
+ "@gradio/button": "^0.3.0-beta.4",
10
11
  "@gradio/box": "^0.2.0-beta.0",
11
- "@gradio/button": "^0.3.0-beta.2",
12
+ "@gradio/chatbot": "^0.14.0-beta.5",
12
13
  "@gradio/checkbox": "^0.4.0-beta.2",
13
- "@gradio/chatbot": "^0.14.0-beta.2",
14
14
  "@gradio/checkboxgroup": "^0.6.0-beta.2",
15
- "@gradio/client": "^1.6.0-beta.2",
16
- "@gradio/code": "^0.10.0-beta.2",
17
- "@gradio/dataframe": "^0.11.0-beta.2",
18
- "@gradio/colorpicker": "^0.3.13-beta.2",
15
+ "@gradio/code": "^0.10.0-beta.4",
19
16
  "@gradio/column": "^0.2.0-beta.0",
20
- "@gradio/dataset": "^0.2.5-beta.2",
21
- "@gradio/downloadbutton": "^0.1.28-beta.2",
17
+ "@gradio/colorpicker": "^0.3.13-beta.2",
18
+ "@gradio/dataframe": "^0.11.0-beta.5",
19
+ "@gradio/client": "^1.6.0-beta.3",
20
+ "@gradio/dataset": "^0.2.5-beta.4",
21
+ "@gradio/datetime": "^0.1.4-beta.2",
22
+ "@gradio/downloadbutton": "^0.1.28-beta.4",
22
23
  "@gradio/dropdown": "^0.7.13-beta.2",
23
24
  "@gradio/fallback": "^0.3.13-beta.2",
24
- "@gradio/datetime": "^0.1.4-beta.2",
25
- "@gradio/fileexplorer": "^0.5.0-beta.2",
26
- "@gradio/file": "^0.10.0-beta.2",
25
+ "@gradio/file": "^0.10.0-beta.4",
26
+ "@gradio/fileexplorer": "^0.5.0-beta.4",
27
27
  "@gradio/form": "^0.1.25-beta.2",
28
- "@gradio/gallery": "^0.13.0-beta.2",
29
28
  "@gradio/group": "^0.2.0-beta.1",
29
+ "@gradio/gallery": "^0.13.0-beta.4",
30
30
  "@gradio/highlightedtext": "^0.7.7-beta.2",
31
- "@gradio/html": "^0.4.0-beta.2",
32
31
  "@gradio/icons": "^0.8.0-beta.2",
33
- "@gradio/image": "^0.16.0-beta.2",
34
- "@gradio/json": "^0.5.0-beta.2",
35
- "@gradio/imageeditor": "^0.11.0-beta.2",
36
- "@gradio/model3d": "^0.13.0-beta.2",
32
+ "@gradio/image": "^0.16.0-beta.4",
33
+ "@gradio/html": "^0.4.0-beta.2",
34
+ "@gradio/imageeditor": "^0.11.0-beta.4",
37
35
  "@gradio/label": "^0.3.13-beta.2",
38
- "@gradio/multimodaltextbox": "^0.6.0-beta.2",
36
+ "@gradio/json": "^0.5.0-beta.2",
37
+ "@gradio/multimodaltextbox": "^0.6.0-beta.4",
38
+ "@gradio/model3d": "^0.13.0-beta.4",
39
39
  "@gradio/markdown": "^0.10.0-beta.2",
40
- "@gradio/nativeplot": "^0.4.0-beta.2",
41
- "@gradio/paramviewer": "^0.4.22-beta.2",
42
- "@gradio/plot": "^0.6.5-beta.2",
40
+ "@gradio/nativeplot": "^0.4.0-beta.3",
43
41
  "@gradio/number": "^0.4.13-beta.2",
44
- "@gradio/row": "^0.2.0-beta.1",
42
+ "@gradio/paramviewer": "^0.4.22-beta.2",
43
+ "@gradio/plot": "^0.7.0-beta.3",
45
44
  "@gradio/radio": "^0.6.0-beta.2",
45
+ "@gradio/row": "^0.2.0-beta.1",
46
46
  "@gradio/simpledropdown": "^0.2.13-beta.2",
47
- "@gradio/simpleimage": "^0.8.0-beta.2",
47
+ "@gradio/simpleimage": "^0.8.0-beta.4",
48
48
  "@gradio/simpletextbox": "^0.2.13-beta.2",
49
- "@gradio/slider": "^0.5.0-beta.2",
49
+ "@gradio/state": "^0.1.2",
50
50
  "@gradio/statustracker": "^0.8.0-beta.2",
51
+ "@gradio/slider": "^0.5.0-beta.2",
51
52
  "@gradio/tabitem": "^0.3.0-beta.2",
52
- "@gradio/state": "^0.1.2",
53
53
  "@gradio/tabs": "^0.3.0-beta.2",
54
54
  "@gradio/textbox": "^0.7.0-beta.2",
55
- "@gradio/timer": "^0.3.3-beta.2",
56
55
  "@gradio/theme": "^0.3.0-beta.1",
57
- "@gradio/upload": "^0.13.0-beta.2",
58
- "@gradio/uploadbutton": "^0.7.0-beta.2",
56
+ "@gradio/upload": "^0.13.0-beta.4",
57
+ "@gradio/timer": "^0.3.3-beta.2",
58
+ "@gradio/uploadbutton": "^0.7.0-beta.4",
59
59
  "@gradio/utils": "^0.7.0-beta.2",
60
- "@gradio/video": "^0.11.0-beta.2",
61
- "@gradio/wasm": "^0.14.0-beta.2"
60
+ "@gradio/video": "^0.11.0-beta.4",
61
+ "@gradio/wasm": "^0.14.0-beta.3"
62
62
  },
63
63
  "msw": {
64
64
  "workerDirectory": "public"
package/src/Blocks.svelte CHANGED
@@ -21,7 +21,7 @@
21
21
  import type {
22
22
  LogMessage,
23
23
  RenderMessage,
24
- StatusMessage,
24
+ StatusMessage
25
25
  } from "@gradio/client";
26
26
 
27
27
  setupi18n();
@@ -45,8 +45,8 @@
45
45
  export let fill_height = false;
46
46
  export let ready: boolean;
47
47
  export let username: string | null;
48
- export let api_prefix: string;
49
- export let max_file_size: number;
48
+ export let api_prefix = "";
49
+ export let max_file_size: number | undefined = undefined;
50
50
  export let initial_layout: LayoutNode | undefined = undefined;
51
51
 
52
52
  let {
@@ -60,7 +60,7 @@
60
60
  loading_status,
61
61
  scheduled_updates,
62
62
  create_layout,
63
- rerender_layout,
63
+ rerender_layout
64
64
  } = create_components();
65
65
 
66
66
  // @ts-ignore
@@ -80,8 +80,8 @@
80
80
  root: root + api_prefix,
81
81
  app,
82
82
  options: {
83
- fill_height,
84
- },
83
+ fill_height
84
+ }
85
85
  });
86
86
  }
87
87
 
@@ -110,7 +110,7 @@
110
110
  return {
111
111
  id: outputs[i],
112
112
  prop: "value_is_output",
113
- value: true,
113
+ value: true
114
114
  };
115
115
  });
116
116
 
@@ -133,7 +133,7 @@
133
133
  updates.push({
134
134
  id: outputs[i],
135
135
  prop: update_key,
136
- value: update_value,
136
+ value: update_value
137
137
  });
138
138
  }
139
139
  }
@@ -141,7 +141,7 @@
141
141
  updates.push({
142
142
  id: outputs[i],
143
143
  prop: "value",
144
- value,
144
+ value
145
145
  });
146
146
  }
147
147
  });
@@ -158,7 +158,7 @@
158
158
  fn_index: number,
159
159
  type: ToastMessage["type"],
160
160
  duration: number | null = 10,
161
- visible = true,
161
+ visible = true
162
162
  ): ToastMessage & { fn_index: number } {
163
163
  return {
164
164
  message,
@@ -166,13 +166,13 @@
166
166
  type,
167
167
  id: ++_error_id,
168
168
  duration,
169
- visible,
169
+ visible
170
170
  };
171
171
  }
172
172
 
173
173
  export function add_new_message(
174
174
  message: string,
175
- type: ToastMessage["type"],
175
+ type: ToastMessage["type"]
176
176
  ): void {
177
177
  messages = [new_message(message, -1, type), ...messages];
178
178
  }
@@ -198,7 +198,7 @@
198
198
  function wait_then_trigger_api_call(
199
199
  dep_index: number,
200
200
  trigger_id: number | null = null,
201
- event_data: unknown = null,
201
+ event_data: unknown = null
202
202
  ): void {
203
203
  let _unsub = (): void => {};
204
204
  function unsub(): void {
@@ -219,7 +219,7 @@
219
219
  async function get_component_value_or_event_data(
220
220
  component_id: number,
221
221
  trigger_id: number | null,
222
- event_data: unknown,
222
+ event_data: unknown
223
223
  ): Promise<any> {
224
224
  if (
225
225
  component_id === trigger_id &&
@@ -235,7 +235,7 @@
235
235
  async function trigger_api_call(
236
236
  dep_index: number,
237
237
  trigger_id: number | null = null,
238
- event_data: unknown = null,
238
+ event_data: unknown = null
239
239
  ): Promise<void> {
240
240
  let dep = dependencies.find((dep) => dep.id === dep_index)!;
241
241
  if (inputs_waiting.length > 0) {
@@ -256,19 +256,19 @@
256
256
  fn_index: dep_index,
257
257
  data: await Promise.all(
258
258
  dep.inputs.map((id) =>
259
- get_component_value_or_event_data(id, trigger_id, event_data),
260
- ),
259
+ get_component_value_or_event_data(id, trigger_id, event_data)
260
+ )
261
261
  ),
262
262
  event_data: dep.collects_event_data ? event_data : null,
263
- trigger_id: trigger_id,
263
+ trigger_id: trigger_id
264
264
  };
265
265
 
266
266
  if (dep.frontend_fn) {
267
267
  dep
268
268
  .frontend_fn(
269
269
  payload.data.concat(
270
- await Promise.all(dep.outputs.map((id) => get_data(id))),
271
- ),
270
+ await Promise.all(dep.outputs.map((id) => get_data(id)))
271
+ )
272
272
  )
273
273
  .then((v: unknown[]) => {
274
274
  if (dep.backend_fn) {
@@ -284,7 +284,7 @@
284
284
  const submission = submit_map.get(fn_index);
285
285
  submission?.cancel();
286
286
  return submission;
287
- }),
287
+ })
288
288
  );
289
289
  } else {
290
290
  if (dep.backend_fn) {
@@ -306,10 +306,10 @@
306
306
  }
307
307
  }
308
308
  }
309
- $: console.log({ app });
309
+
310
310
  async function make_prediction(
311
311
  payload: Payload,
312
- streaming = false,
312
+ streaming = false
313
313
  ): Promise<void> {
314
314
  if (api_recorder_visible) {
315
315
  api_calls = [...api_calls, JSON.parse(JSON.stringify(payload))];
@@ -332,7 +332,7 @@
332
332
  await app.post_data(
333
333
  // @ts-ignore
334
334
  `${app.config.root + app.config.api_prefix}/stream/${submit_map.get(dep_index).event_id()}`,
335
- { ...payload, session_hash: app.session_hash },
335
+ { ...payload, session_hash: app.session_hash }
336
336
  );
337
337
  return;
338
338
  }
@@ -342,7 +342,7 @@
342
342
  payload.fn_index,
343
343
  payload.data as unknown[],
344
344
  payload.event_data,
345
- payload.trigger_id,
345
+ payload.trigger_id
346
346
  );
347
347
  } catch (e) {
348
348
  const fn_index = 0; // Mock value for fn_index
@@ -352,7 +352,7 @@
352
352
  fn_index,
353
353
  eta: 0,
354
354
  queue: false,
355
- queue_position: null,
355
+ queue_position: null
356
356
  });
357
357
  set_status($loading_status);
358
358
  return;
@@ -408,7 +408,7 @@
408
408
  layout: render_layout,
409
409
  root: root,
410
410
  dependencies: dependencies,
411
- render_id: render_id,
411
+ render_id: render_id
412
412
  });
413
413
  }
414
414
 
@@ -416,14 +416,14 @@
416
416
  const { log, fn_index, level, duration, visible } = msg;
417
417
  messages = [
418
418
  new_message(log, fn_index, level, duration, visible),
419
- ...messages,
419
+ ...messages
420
420
  ];
421
421
  }
422
422
 
423
423
  function open_stream_events(
424
424
  status: StatusMessage,
425
425
  id: number,
426
- dep: Dependency,
426
+ dep: Dependency
427
427
  ): void {
428
428
  if (
429
429
  status.original_msg === "process_starts" &&
@@ -450,7 +450,7 @@
450
450
  time_limit: status.time_limit,
451
451
  status: status.stage,
452
452
  progress: status.progress_data,
453
- fn_index,
453
+ fn_index
454
454
  });
455
455
  set_status($loading_status);
456
456
  if (
@@ -464,7 +464,7 @@
464
464
  showed_duplicate_message = true;
465
465
  messages = [
466
466
  new_message(DUPLICATE_MESSAGE, fn_index, "warning"),
467
- ...messages,
467
+ ...messages
468
468
  ];
469
469
  }
470
470
  if (
@@ -476,7 +476,7 @@
476
476
  showed_mobile_warning = true;
477
477
  messages = [
478
478
  new_message(MOBILE_QUEUE_WARNING, fn_index, "warning"),
479
- ...messages,
479
+ ...messages
480
480
  ];
481
481
  }
482
482
 
@@ -504,7 +504,7 @@
504
504
  window.setTimeout(() => {
505
505
  messages = [
506
506
  new_message(MOBILE_RECONNECT_MESSAGE, fn_index, "error"),
507
- ...messages,
507
+ ...messages
508
508
  ];
509
509
  }, 0);
510
510
  wait_then_trigger_api_call(dep.id, payload.trigger_id, event_data);
@@ -513,7 +513,7 @@
513
513
  if (status.message) {
514
514
  const _message = status.message.replace(
515
515
  MESSAGE_QUOTE_RE,
516
- (_, b) => b,
516
+ (_, b) => b
517
517
  );
518
518
  messages = [
519
519
  new_message(
@@ -521,9 +521,9 @@
521
521
  fn_index,
522
522
  "error",
523
523
  status.duration,
524
- status.visible,
524
+ status.visible
525
525
  ),
526
- ...messages,
526
+ ...messages
527
527
  ];
528
528
  }
529
529
  dependencies.map(async (dep) => {
@@ -545,7 +545,7 @@
545
545
  return;
546
546
  }
547
547
  const discussion_url = new URL(
548
- `https://huggingface.co/spaces/${space_id}/discussions/new`,
548
+ `https://huggingface.co/spaces/${space_id}/discussions/new`
549
549
  );
550
550
  if (title !== undefined && title.length > 0) {
551
551
  discussion_url.searchParams.set("title", title);
@@ -566,7 +566,7 @@
566
566
  if (js) {
567
567
  let blocks_frontend_fn = new AsyncFunction(
568
568
  `let result = await (${js})();
569
- return (!Array.isArray(result)) ? [result] : result;`,
569
+ return (!Array.isArray(result)) ? [result] : result;`
570
570
  );
571
571
  await blocks_frontend_fn();
572
572
  }
@@ -623,7 +623,7 @@
623
623
  app.post_data(
624
624
  // @ts-ignore
625
625
  `${app.config.root + app.config.api_prefix}/stream/${submit_map.get(dep_id).event_id()}/close`,
626
- {},
626
+ {}
627
627
  );
628
628
  }
629
629
  });
@@ -646,15 +646,15 @@
646
646
  function update_status(
647
647
  id: number,
648
648
  status: "error" | "complete" | "pending",
649
- data: LoadingStatus,
649
+ data: LoadingStatus
650
650
  ): void {
651
651
  data.status = status;
652
652
  update_value([
653
653
  {
654
654
  id,
655
655
  prop: "loading_status",
656
- value: data,
657
- },
656
+ value: data
657
+ }
658
658
  ]);
659
659
  }
660
660
 
@@ -666,7 +666,7 @@
666
666
  }[] = [];
667
667
  Object.entries(statuses).forEach(([id, loading_status]) => {
668
668
  let dependency = dependencies.find(
669
- (dep) => dep.id == loading_status.fn_index,
669
+ (dep) => dep.id == loading_status.fn_index
670
670
  );
671
671
  if (dependency === undefined) {
672
672
  return;
@@ -676,7 +676,7 @@
676
676
  updates.push({
677
677
  id: parseInt(id),
678
678
  prop: "loading_status",
679
- value: loading_status,
679
+ value: loading_status
680
680
  });
681
681
  });
682
682
 
@@ -686,9 +686,9 @@
686
686
  return {
687
687
  id,
688
688
  prop: "pending",
689
- value: pending_status === "pending",
689
+ value: pending_status === "pending"
690
690
  };
691
- },
691
+ }
692
692
  );
693
693
 
694
694
  update_value([...updates, ...additional_updates]);
@@ -707,7 +707,7 @@
707
707
 
708
708
  is_mobile_device =
709
709
  /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
710
- navigator.userAgent,
710
+ navigator.userAgent
711
711
  );
712
712
  });
713
713
  </script>