@gradio/model3d 0.15.1 → 0.16.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 +21 -0
- package/Index.svelte +15 -1
- package/dist/Index.svelte +15 -1
- package/dist/types.d.ts +5 -0
- package/package.json +7 -7
- package/types.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
# @gradio/model3d
|
|
2
|
+
|
|
3
|
+
## 0.16.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- [#12539](https://github.com/gradio-app/gradio/pull/12539) [`f1d83fa`](https://github.com/gradio-app/gradio/commit/f1d83fac3d6e4bad60cf896a026fa2d572f26073) - Add ability to add custom buttons to components. Thanks @abidlabs!
|
|
8
|
+
|
|
9
|
+
### Dependency updates
|
|
10
|
+
|
|
11
|
+
- @gradio/atoms@0.20.0
|
|
12
|
+
- @gradio/utils@0.11.0
|
|
13
|
+
- @gradio/client@2.0.1
|
|
14
|
+
- @gradio/statustracker@0.12.1
|
|
15
|
+
- @gradio/upload@0.17.3
|
|
16
|
+
|
|
17
|
+
## 0.15.1
|
|
18
|
+
|
|
19
|
+
### Dependency updates
|
|
20
|
+
|
|
21
|
+
- @gradio/utils@0.10.4
|
|
22
|
+
|
|
2
23
|
## 0.15.1
|
|
3
24
|
|
|
4
25
|
### Features
|
package/Index.svelte
CHANGED
|
@@ -11,7 +11,13 @@
|
|
|
11
11
|
import { Gradio } from "@gradio/utils";
|
|
12
12
|
import Model3D from "./shared/Model3D.svelte";
|
|
13
13
|
import Model3DUpload from "./shared/Model3DUpload.svelte";
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
BlockLabel,
|
|
16
|
+
Block,
|
|
17
|
+
Empty,
|
|
18
|
+
UploadText,
|
|
19
|
+
IconButtonWrapper
|
|
20
|
+
} from "@gradio/atoms";
|
|
15
21
|
import { File } from "@gradio/icons";
|
|
16
22
|
import { StatusTracker } from "@gradio/statustracker";
|
|
17
23
|
|
|
@@ -106,6 +112,14 @@
|
|
|
106
112
|
{has_change_history}
|
|
107
113
|
/>
|
|
108
114
|
{:else}
|
|
115
|
+
{#if gradio.shared.show_label && gradio.props.buttons && gradio.props.buttons.length > 0}
|
|
116
|
+
<IconButtonWrapper
|
|
117
|
+
buttons={gradio.props.buttons}
|
|
118
|
+
on_custom_button_click={(id) => {
|
|
119
|
+
gradio.dispatch("custom_button_click", { id });
|
|
120
|
+
}}
|
|
121
|
+
/>
|
|
122
|
+
{/if}
|
|
109
123
|
<BlockLabel
|
|
110
124
|
show_label={gradio.shared.show_label}
|
|
111
125
|
Icon={File}
|
package/dist/Index.svelte
CHANGED
|
@@ -11,7 +11,13 @@
|
|
|
11
11
|
import { Gradio } from "@gradio/utils";
|
|
12
12
|
import Model3D from "./shared/Model3D.svelte";
|
|
13
13
|
import Model3DUpload from "./shared/Model3DUpload.svelte";
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
BlockLabel,
|
|
16
|
+
Block,
|
|
17
|
+
Empty,
|
|
18
|
+
UploadText,
|
|
19
|
+
IconButtonWrapper
|
|
20
|
+
} from "@gradio/atoms";
|
|
15
21
|
import { File } from "@gradio/icons";
|
|
16
22
|
import { StatusTracker } from "@gradio/statustracker";
|
|
17
23
|
|
|
@@ -106,6 +112,14 @@
|
|
|
106
112
|
{has_change_history}
|
|
107
113
|
/>
|
|
108
114
|
{:else}
|
|
115
|
+
{#if gradio.shared.show_label && gradio.props.buttons && gradio.props.buttons.length > 0}
|
|
116
|
+
<IconButtonWrapper
|
|
117
|
+
buttons={gradio.props.buttons}
|
|
118
|
+
on_custom_button_click={(id) => {
|
|
119
|
+
gradio.dispatch("custom_button_click", { id });
|
|
120
|
+
}}
|
|
121
|
+
/>
|
|
122
|
+
{/if}
|
|
109
123
|
<BlockLabel
|
|
110
124
|
show_label={gradio.shared.show_label}
|
|
111
125
|
Icon={File}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FileData } from "@gradio/client";
|
|
2
2
|
import type { LoadingStatus } from "js/statustracker";
|
|
3
|
+
import type { CustomButton } from "@gradio/utils";
|
|
3
4
|
export interface Model3DProps {
|
|
4
5
|
value: null | FileData;
|
|
5
6
|
display_mode: "solid" | "point_cloud" | "wireframe";
|
|
@@ -8,6 +9,7 @@ export interface Model3DProps {
|
|
|
8
9
|
zoom_speed: number;
|
|
9
10
|
has_change_history: boolean;
|
|
10
11
|
camera_position: [number | null, number | null, number | null];
|
|
12
|
+
buttons: (string | CustomButton)[] | null;
|
|
11
13
|
}
|
|
12
14
|
export interface Model3DEvents {
|
|
13
15
|
change: FileData | null;
|
|
@@ -16,4 +18,7 @@ export interface Model3DEvents {
|
|
|
16
18
|
clear: never;
|
|
17
19
|
clear_status: LoadingStatus;
|
|
18
20
|
error: string;
|
|
21
|
+
custom_button_click: {
|
|
22
|
+
id: number;
|
|
23
|
+
};
|
|
19
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/model3d",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Gradio UI packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
"@types/babylon": "^6.16.9",
|
|
14
14
|
"dequal": "^2.0.3",
|
|
15
15
|
"gsplat": "^1.2.9",
|
|
16
|
-
"@gradio/atoms": "^0.
|
|
17
|
-
"@gradio/client": "^2.0.0",
|
|
18
|
-
"@gradio/statustracker": "^0.12.0",
|
|
16
|
+
"@gradio/atoms": "^0.20.0",
|
|
19
17
|
"@gradio/icons": "^0.15.0",
|
|
20
|
-
"@gradio/
|
|
21
|
-
"@gradio/
|
|
18
|
+
"@gradio/statustracker": "^0.12.1",
|
|
19
|
+
"@gradio/upload": "^0.17.3",
|
|
20
|
+
"@gradio/client": "^2.0.1",
|
|
21
|
+
"@gradio/utils": "^0.11.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@gradio/preview": "^0.15.
|
|
24
|
+
"@gradio/preview": "^0.15.1"
|
|
25
25
|
},
|
|
26
26
|
"main_changeset": true,
|
|
27
27
|
"main": "./Index.svelte",
|
package/types.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FileData } from "@gradio/client";
|
|
2
2
|
import type { LoadingStatus } from "js/statustracker";
|
|
3
|
+
import type { CustomButton } from "@gradio/utils";
|
|
3
4
|
|
|
4
5
|
export interface Model3DProps {
|
|
5
6
|
value: null | FileData;
|
|
@@ -9,6 +10,7 @@ export interface Model3DProps {
|
|
|
9
10
|
zoom_speed: number;
|
|
10
11
|
has_change_history: boolean;
|
|
11
12
|
camera_position: [number | null, number | null, number | null];
|
|
13
|
+
buttons: (string | CustomButton)[] | null;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
export interface Model3DEvents {
|
|
@@ -18,4 +20,5 @@ export interface Model3DEvents {
|
|
|
18
20
|
clear: never;
|
|
19
21
|
clear_status: LoadingStatus;
|
|
20
22
|
error: string;
|
|
23
|
+
custom_button_click: { id: number };
|
|
21
24
|
}
|