@gradio/model3d 0.8.10 → 0.9.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,59 @@
1
1
  # @gradio/model3d
2
2
 
3
+ ## 0.9.0
4
+
5
+ ### Highlights
6
+
7
+ #### Setting File Upload Limits ([#7909](https://github.com/gradio-app/gradio/pull/7909) [`2afca65`](https://github.com/gradio-app/gradio/commit/2afca6541912b37dc84f447c7ad4af21607d7c72))
8
+
9
+ 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).
10
+
11
+ The following code snippet sets a max file size of 5 megabytes.
12
+
13
+ ```python
14
+ import gradio as gr
15
+
16
+ demo = gr.Interface(lambda x: x, "image", "image")
17
+
18
+ demo.launch(max_file_size="5mb")
19
+ # or
20
+ demo.launch(max_file_size=5 * gr.FileSize.MB)
21
+ ```
22
+
23
+ ![max_file_size_upload](https://github.com/gradio-app/gradio/assets/41651716/7547330c-a082-4901-a291-3f150a197e45)
24
+
25
+
26
+ #### Error states can now be cleared
27
+
28
+ 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.
29
+
30
+ ![error_modal_calculator](https://github.com/gradio-app/gradio/assets/41651716/16cb071c-accd-45a6-9c18-0dea27d4bd98)
31
+
32
+ Thanks @freddyaboulton!
33
+
34
+ ### Fixes
35
+
36
+ - [#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!
37
+
38
+ ### Dependency updates
39
+
40
+ - @gradio/atoms@0.7.1
41
+ - @gradio/client@0.17.0
42
+ - @gradio/statustracker@0.5.0
43
+ - @gradio/upload@0.9.0
44
+ - @gradio/utils@0.4.0
45
+
46
+ ## 0.8.11
47
+
48
+ ### Dependency updates
49
+
50
+ - @gradio/utils@0.3.2
51
+ - @gradio/statustracker@0.4.12
52
+ - @gradio/client@0.16.0
53
+ - @gradio/upload@0.8.5
54
+ - @gradio/atoms@0.7.0
55
+ - @gradio/icons@0.4.0
56
+
3
57
  ## 0.8.10
4
58
 
5
59
  ### 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,13 @@
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}
122
130
  >
123
131
  <UploadText i18n={gradio.i18n} type="file" />
124
132
  </Model3DUpload>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/model3d",
3
- "version": "0.8.10",
3
+ "version": "0.9.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.6.2",
16
- "@gradio/client": "^0.15.1",
17
- "@gradio/icons": "^0.3.4",
18
- "@gradio/statustracker": "^0.4.11",
19
- "@gradio/utils": "^0.3.1",
20
- "@gradio/wasm": "^0.10.0",
21
- "@gradio/upload": "^0.8.4"
15
+ "@gradio/client": "^0.17.0",
16
+ "@gradio/atoms": "^0.7.1",
17
+ "@gradio/upload": "^0.9.0",
18
+ "@gradio/icons": "^0.4.0",
19
+ "@gradio/statustracker": "^0.5.0",
20
+ "@gradio/utils": "^0.4.0",
21
+ "@gradio/wasm": "^0.10.0"
22
+ },
23
+ "devDependencies": {
24
+ "@gradio/preview": "^0.8.0"
22
25
  },
23
26
  "main_changeset": true,
24
27
  "main": "./Index.svelte",
@@ -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] = [
@@ -87,8 +88,10 @@
87
88
  <Upload
88
89
  on:load={handle_upload}
89
90
  {root}
91
+ {max_file_size}
90
92
  filetype={[".stl", ".obj", ".gltf", ".glb", "model/obj", ".splat", ".ply"]}
91
93
  bind:dragging
94
+ on:error
92
95
  >
93
96
  <slot />
94
97
  </Upload>