@gradio/model3d 0.8.11 → 0.10.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/CHANGELOG.md CHANGED
@@ -1,5 +1,67 @@
1
1
  # @gradio/model3d
2
2
 
3
+ ## 0.10.0
4
+
5
+ ### Features
6
+
7
+ - [#8209](https://github.com/gradio-app/gradio/pull/8209) [`b9afe93`](https://github.com/gradio-app/gradio/commit/b9afe93915401df5bd6737c89395c2477acfa585) - Rename `eventSource_Factory` and `fetch_implementation`. Thanks @hannahblair!
8
+
9
+ ### Fixes
10
+
11
+ - [#8179](https://github.com/gradio-app/gradio/pull/8179) [`6a218b4`](https://github.com/gradio-app/gradio/commit/6a218b4148095aaa0c58d8c20973ba01c8764fc2) - rework upload to be a class method + pass client into each component. Thanks @pngwn!
12
+
13
+ ### Dependency updates
14
+
15
+ - @gradio/atoms@0.7.2
16
+ - @gradio/client@0.18.0
17
+ - @gradio/upload@0.10.0
18
+ - @gradio/utils@0.4.1
19
+ - @gradio/wasm@0.10.1
20
+ - @gradio/statustracker@0.5.1
21
+
22
+ ## 0.9.0
23
+
24
+ ### Highlights
25
+
26
+ #### Setting File Upload Limits ([#7909](https://github.com/gradio-app/gradio/pull/7909) [`2afca65`](https://github.com/gradio-app/gradio/commit/2afca6541912b37dc84f447c7ad4af21607d7c72))
27
+
28
+ We have added a `max_file_size` size parameter to `launch()` that limits to size of files uploaded to the server. This limit applies to each individual file. This parameter can be specified as a string or an integer (corresponding to the size in bytes).
29
+
30
+ The following code snippet sets a max file size of 5 megabytes.
31
+
32
+ ```python
33
+ import gradio as gr
34
+
35
+ demo = gr.Interface(lambda x: x, "image", "image")
36
+
37
+ demo.launch(max_file_size="5mb")
38
+ # or
39
+ demo.launch(max_file_size=5 * gr.FileSize.MB)
40
+ ```
41
+
42
+ ![max_file_size_upload](https://github.com/gradio-app/gradio/assets/41651716/7547330c-a082-4901-a291-3f150a197e45)
43
+
44
+
45
+ #### Error states can now be cleared
46
+
47
+ When a component encounters an error, the error state shown in the UI can now be cleared by clicking on the `x` icon in the top right of the component. This applies to all types of errors, whether it's raised in the UI or the server.
48
+
49
+ ![error_modal_calculator](https://github.com/gradio-app/gradio/assets/41651716/16cb071c-accd-45a6-9c18-0dea27d4bd98)
50
+
51
+ Thanks @freddyaboulton!
52
+
53
+ ### Fixes
54
+
55
+ - [#8066](https://github.com/gradio-app/gradio/pull/8066) [`624f9b9`](https://github.com/gradio-app/gradio/commit/624f9b9477f74a581a6c14119234f9efdfcda398) - make gradio dev tools a local dependency rather than bundling. Thanks @pngwn!
56
+
57
+ ### Dependency updates
58
+
59
+ - @gradio/atoms@0.7.1
60
+ - @gradio/client@0.17.0
61
+ - @gradio/statustracker@0.5.0
62
+ - @gradio/upload@0.9.0
63
+ - @gradio/utils@0.4.0
64
+
3
65
  ## 0.8.11
4
66
 
5
67
  ### Dependency updates
package/Index.svelte CHANGED
@@ -59,6 +59,7 @@
59
59
  autoscroll={gradio.autoscroll}
60
60
  i18n={gradio.i18n}
61
61
  {...loading_status}
62
+ on:clear_status={() => gradio.dispatch("clear_status", loading_status)}
62
63
  />
63
64
 
64
65
  {#if value}
@@ -97,6 +98,7 @@
97
98
  autoscroll={gradio.autoscroll}
98
99
  i18n={gradio.i18n}
99
100
  {...loading_status}
101
+ on:clear_status={() => gradio.dispatch("clear_status", loading_status)}
100
102
  />
101
103
 
102
104
  <Model3DUpload
@@ -118,7 +120,15 @@
118
120
  value = detail;
119
121
  gradio.dispatch("upload");
120
122
  }}
123
+ on:error={({ detail }) => {
124
+ loading_status = loading_status || {};
125
+ loading_status.status = "error";
126
+ gradio.dispatch("error", detail);
127
+ }}
121
128
  i18n={gradio.i18n}
129
+ max_file_size={gradio.max_file_size}
130
+ upload={gradio.client.upload}
131
+ stream_handler={gradio.client.stream_factory}
122
132
  >
123
133
  <UploadText i18n={gradio.i18n} type="file" />
124
134
  </Model3DUpload>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/model3d",
3
- "version": "0.8.11",
3
+ "version": "0.10.0",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -12,13 +12,16 @@
12
12
  "babylonjs-loaders": "^4.2.1",
13
13
  "dequal": "^2.0.2",
14
14
  "gsplat": "^1.0.5",
15
- "@gradio/atoms": "^0.7.0",
16
- "@gradio/client": "^0.16.0",
17
- "@gradio/upload": "^0.8.5",
18
- "@gradio/utils": "^0.3.2",
15
+ "@gradio/atoms": "^0.7.2",
16
+ "@gradio/client": "^0.18.0",
19
17
  "@gradio/icons": "^0.4.0",
20
- "@gradio/statustracker": "^0.4.12",
21
- "@gradio/wasm": "^0.10.0"
18
+ "@gradio/statustracker": "^0.5.1",
19
+ "@gradio/utils": "^0.4.1",
20
+ "@gradio/wasm": "^0.10.1",
21
+ "@gradio/upload": "^0.10.0"
22
+ },
23
+ "devDependencies": {
24
+ "@gradio/preview": "^0.9.0"
22
25
  },
23
26
  "main_changeset": true,
24
27
  "main": "./Index.svelte",
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import { createEventDispatcher, tick } from "svelte";
3
3
  import { Upload, ModifyUpload } from "@gradio/upload";
4
- import type { FileData } from "@gradio/client";
4
+ import type { FileData, Client } from "@gradio/client";
5
5
  import { BlockLabel } from "@gradio/atoms";
6
6
  import { File } from "@gradio/icons";
7
7
  import type { I18nFormatter } from "@gradio/utils";
@@ -16,6 +16,7 @@
16
16
  export let i18n: I18nFormatter;
17
17
  export let zoom_speed = 1;
18
18
  export let pan_speed = 1;
19
+ export let max_file_size: number | null = null;
19
20
 
20
21
  // alpha, beta, radius
21
22
  export let camera_position: [number | null, number | null, number | null] = [
@@ -23,6 +24,8 @@
23
24
  null,
24
25
  null
25
26
  ];
27
+ export let upload: Client["upload"];
28
+ export let stream_handler: Client["stream_factory"];
26
29
 
27
30
  async function handle_upload({
28
31
  detail
@@ -85,10 +88,14 @@
85
88
 
86
89
  {#if value === null}
87
90
  <Upload
91
+ {upload}
92
+ {stream_handler}
88
93
  on:load={handle_upload}
89
94
  {root}
95
+ {max_file_size}
90
96
  filetype={[".stl", ".obj", ".gltf", ".glb", "model/obj", ".splat", ".ply"]}
91
97
  bind:dragging
98
+ on:error
92
99
  >
93
100
  <slot />
94
101
  </Upload>