@gradio/model3d 0.3.0-beta.5 → 0.3.0-beta.6

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,52 +1,47 @@
1
1
  # @gradio/model3d
2
2
 
3
- ## 0.3.0-beta.5
3
+ ## 0.3.0-beta.6
4
4
 
5
5
  ### Features
6
6
 
7
- - [#5648](https://github.com/gradio-app/gradio/pull/5648) [`c573e2339`](https://github.com/gradio-app/gradio/commit/c573e2339b86c85b378dc349de5e9223a3c3b04a) - Publish all components to npm. Thanks [@freddyaboulton](https://github.com/freddyaboulton)!
7
+ - [#5960](https://github.com/gradio-app/gradio/pull/5960) [`319c30f3f`](https://github.com/gradio-app/gradio/commit/319c30f3fccf23bfe1da6c9b132a6a99d59652f7) - rererefactor frontend files. Thanks [@pngwn](https://github.com/pngwn)!
8
+ - [#5938](https://github.com/gradio-app/gradio/pull/5938) [`13ed8a485`](https://github.com/gradio-app/gradio/commit/13ed8a485d5e31d7d75af87fe8654b661edcca93) - V4: Use beta release versions for '@gradio' packages. Thanks [@freddyaboulton](https://github.com/freddyaboulton)!
8
9
 
9
- ## 0.3.0-beta.4
10
+ ## 0.2.5
10
11
 
11
12
  ### Patch Changes
12
13
 
13
- - Updated dependencies [[`0b4fd5b6d`](https://github.com/gradio-app/gradio/commit/0b4fd5b6db96fc95a155e5e935e17e1ab11d1161)]:
14
- - @gradio/utils@0.2.0-beta.3
15
- - @gradio/atoms@0.2.0-beta.3
16
- - @gradio/statustracker@0.3.0-beta.4
17
- - @gradio/upload@0.3.0-beta.3
14
+ - Updated dependencies [[`e70805d54`](https://github.com/gradio-app/gradio/commit/e70805d54cc792452545f5d8eccc1aa0212a4695)]:
15
+ - @gradio/atoms@0.2.0
16
+ - @gradio/statustracker@0.2.3
17
+ - @gradio/upload@0.3.3
18
18
 
19
- ## 0.3.0-beta.3
19
+ ## 0.2.4
20
20
 
21
21
  ### Patch Changes
22
22
 
23
- - Updated dependencies [[`14fc612d8`](https://github.com/gradio-app/gradio/commit/14fc612d84bf6b1408eccd3a40fab41f25477571)]:
24
- - @gradio/utils@0.2.0-beta.2
25
- - @gradio/atoms@0.2.0-beta.2
26
- - @gradio/statustracker@0.3.0-beta.3
27
- - @gradio/upload@0.3.0-beta.2
28
-
29
- ## 0.3.0-beta.2
30
-
31
- ### Features
32
-
33
- - [#5620](https://github.com/gradio-app/gradio/pull/5620) [`c4c25ecdf`](https://github.com/gradio-app/gradio/commit/c4c25ecdf8c2fab5e3c41b519564e3b6a9ebfce3) - fix build and broken imports. Thanks [@pngwn](https://github.com/pngwn)!
23
+ - Updated dependencies []:
24
+ - @gradio/utils@0.1.2
25
+ - @gradio/atoms@0.1.4
26
+ - @gradio/statustracker@0.2.2
27
+ - @gradio/upload@0.3.2
34
28
 
35
- ## 0.3.0-beta.1
29
+ ## 0.2.3
36
30
 
37
31
  ### Patch Changes
38
32
 
39
- - Updated dependencies []:
40
- - @gradio/utils@0.2.0-beta.1
41
- - @gradio/atoms@0.2.0-beta.1
42
- - @gradio/statustracker@0.3.0-beta.1
43
- - @gradio/upload@0.3.0-beta.1
33
+ - Updated dependencies [[`8f0fed857`](https://github.com/gradio-app/gradio/commit/8f0fed857d156830626eb48b469d54d211a582d2)]:
34
+ - @gradio/icons@0.2.0
35
+ - @gradio/atoms@0.1.3
36
+ - @gradio/statustracker@0.2.1
37
+ - @gradio/upload@0.3.1
44
38
 
45
- ## 0.3.0-beta.0
39
+ ## 0.2.2
46
40
 
47
- ### Features
41
+ ### Patch Changes
48
42
 
49
- - [#5507](https://github.com/gradio-app/gradio/pull/5507) [`1385dc688`](https://github.com/gradio-app/gradio/commit/1385dc6881f2d8ae7a41106ec21d33e2ef04d6a9) - Custom components. Thanks [@pngwn](https://github.com/pngwn)!
43
+ - Updated dependencies [[`75ddeb390`](https://github.com/gradio-app/gradio/commit/75ddeb390d665d4484667390a97442081b49a423)]:
44
+ - @gradio/upload@0.3.0
50
45
 
51
46
  ## 0.2.1
52
47
 
package/Index.svelte ADDED
@@ -0,0 +1,118 @@
1
+ <script lang="ts">
2
+ import type { FileData } from "@gradio/upload";
3
+ import { normalise_file } from "@gradio/upload";
4
+ import Model3D from "./shared/Model3D.svelte";
5
+ import Model3DUpload from "./shared/Model3DUpload.svelte";
6
+ import { BlockLabel, Block, Empty, UploadText } from "@gradio/atoms";
7
+ import { File } from "@gradio/icons";
8
+
9
+ import { StatusTracker } from "@gradio/statustracker";
10
+ import type { LoadingStatus } from "@gradio/statustracker";
11
+ import type { Gradio } from "@gradio/utils";
12
+
13
+ export let elem_id = "";
14
+ export let elem_classes: string[] = [];
15
+ export let visible = true;
16
+ export let value: null | FileData = null;
17
+ export let root: string;
18
+ export let root_url: null | string;
19
+ export let clear_color: [number, number, number, number];
20
+ export let loading_status: LoadingStatus;
21
+ export let label: string;
22
+ export let show_label: boolean;
23
+ export let container = true;
24
+ export let scale: number | null = null;
25
+ export let min_width: number | undefined = undefined;
26
+ export let gradio: Gradio;
27
+ export let height: number | undefined = undefined;
28
+ export let zoom_speed = 1;
29
+
30
+ // alpha, beta, radius
31
+ export let camera_position: [number | null, number | null, number | null] = [
32
+ null,
33
+ null,
34
+ null
35
+ ];
36
+ export let mode: "static" | "interactive";
37
+
38
+ let _value: null | FileData;
39
+ $: _value = normalise_file(value, root, root_url);
40
+
41
+ let dragging = false;
42
+ </script>
43
+
44
+ {#if mode === "static"}
45
+ <Block
46
+ {visible}
47
+ variant={value === null ? "dashed" : "solid"}
48
+ border_mode={dragging ? "focus" : "base"}
49
+ padding={false}
50
+ {elem_id}
51
+ {elem_classes}
52
+ {container}
53
+ {scale}
54
+ {min_width}
55
+ {height}
56
+ >
57
+ <StatusTracker
58
+ autoscroll={gradio.autoscroll}
59
+ i18n={gradio.i18n}
60
+ {...loading_status}
61
+ />
62
+
63
+ {#if value}
64
+ <Model3D
65
+ value={_value}
66
+ i18n={gradio.i18n}
67
+ {clear_color}
68
+ {label}
69
+ {show_label}
70
+ {camera_position}
71
+ {zoom_speed}
72
+ />
73
+ {:else}
74
+ <!-- Not ideal but some bugs to work out before we can
75
+ make this consistent with other components -->
76
+
77
+ <BlockLabel {show_label} Icon={File} label={label || "3D Model"} />
78
+
79
+ <Empty unpadded_box={true} size="large"><File /></Empty>
80
+ {/if}
81
+ </Block>
82
+ {:else}
83
+ <Block
84
+ {visible}
85
+ variant={value === null ? "dashed" : "solid"}
86
+ border_mode={dragging ? "focus" : "base"}
87
+ padding={false}
88
+ {elem_id}
89
+ {elem_classes}
90
+ {container}
91
+ {scale}
92
+ {min_width}
93
+ {height}
94
+ >
95
+ <StatusTracker
96
+ autoscroll={gradio.autoscroll}
97
+ i18n={gradio.i18n}
98
+ {...loading_status}
99
+ />
100
+
101
+ <Model3DUpload
102
+ {label}
103
+ {show_label}
104
+ {root}
105
+ {clear_color}
106
+ value={_value}
107
+ {camera_position}
108
+ {zoom_speed}
109
+ on:change={({ detail }) => (value = detail)}
110
+ on:drag={({ detail }) => (dragging = detail)}
111
+ on:change={({ detail }) => gradio.dispatch("change", detail)}
112
+ on:clear={() => gradio.dispatch("clear")}
113
+ i18n={gradio.i18n}
114
+ >
115
+ <UploadText i18n={gradio.i18n} type="file" />
116
+ </Model3DUpload>
117
+ </Block>
118
+ {/if}
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@gradio/model3d",
3
- "version": "0.3.0-beta.5",
3
+ "version": "0.3.0-beta.6",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
- "main": "./index.svelte",
7
6
  "author": "",
8
7
  "license": "ISC",
9
8
  "private": false,
@@ -11,17 +10,16 @@
11
10
  "@types/babylon": "^6.16.6",
12
11
  "babylonjs": "^4.2.1",
13
12
  "babylonjs-loaders": "^4.2.1",
14
- "@gradio/atoms": "^0.2.0-beta.3",
15
- "@gradio/icons": "^0.2.0-beta.0",
16
- "@gradio/statustracker": "^0.3.0-beta.5",
17
- "@gradio/upload": "^0.3.0-beta.3",
18
- "@gradio/utils": "^0.2.0-beta.3"
13
+ "@gradio/atoms": "^0.2.0-beta.4",
14
+ "@gradio/icons": "^0.2.0-beta.1",
15
+ "@gradio/statustracker": "^0.3.0-beta.6",
16
+ "@gradio/upload": "^0.3.0-beta.4",
17
+ "@gradio/utils": "^0.2.0-beta.4"
19
18
  },
20
19
  "main_changeset": true,
21
20
  "exports": {
22
- "./package.json": "./package.json",
23
- "./interactive": "./interactive/index.ts",
24
- "./static": "./static/index.ts",
25
- "./example": "./example/index.ts"
21
+ ".": "./Index.svelte",
22
+ "./example": "./Example.svelte",
23
+ "./package.json": "./package.json"
26
24
  }
27
25
  }
@@ -2,7 +2,7 @@
2
2
  import type { FileData } from "@gradio/upload";
3
3
  import { BlockLabel, IconButton } from "@gradio/atoms";
4
4
  import { File, Download, Undo } from "@gradio/icons";
5
- import { add_new_model, reset_camera_position } from "../shared/utils";
5
+ import { add_new_model, reset_camera_position } from "./utils";
6
6
  import { onMount } from "svelte";
7
7
  import * as BABYLON from "babylonjs";
8
8
  import * as BABYLON_LOADERS from "babylonjs-loaders";
@@ -4,7 +4,7 @@
4
4
  import type { FileData } from "@gradio/upload";
5
5
  import { BlockLabel } from "@gradio/atoms";
6
6
  import { File } from "@gradio/icons";
7
- import { add_new_model, reset_camera_position } from "../shared/utils";
7
+ import { add_new_model, reset_camera_position } from "./utils";
8
8
 
9
9
  export let value: null | FileData;
10
10
  export let clear_color: [number, number, number, number] = [0, 0, 0, 0];
package/example/index.ts DELETED
@@ -1 +0,0 @@
1
- export { default } from "./Model3d.svelte";
@@ -1,78 +0,0 @@
1
- <script lang="ts">
2
- import type { Gradio } from "@gradio/utils";
3
- import type { FileData } from "@gradio/upload";
4
- import { normalise_file } from "@gradio/upload";
5
- import Model3DUpload from "./Model3DUpload.svelte";
6
- import { Block, UploadText } from "@gradio/atoms";
7
-
8
- import { StatusTracker } from "@gradio/statustracker";
9
- import type { LoadingStatus } from "@gradio/statustracker";
10
-
11
- export let elem_id = "";
12
- export let elem_classes: string[] = [];
13
- export let visible = true;
14
- export let value: null | FileData = null;
15
- export let root: string;
16
- export let root_url: null | string;
17
- export let clear_color: [number, number, number, number];
18
- export let loading_status: LoadingStatus;
19
- export let label: string;
20
- export let show_label: boolean;
21
- export let container = true;
22
- export let scale: number | null = null;
23
- export let min_width: number | undefined = undefined;
24
- export let gradio: Gradio<{
25
- change: typeof value;
26
- clear: never;
27
- }>;
28
- export let zoom_speed = 1;
29
- export let height: number | undefined = undefined;
30
-
31
- // alpha, beta, radius
32
- export let camera_position: [number | null, number | null, number | null] = [
33
- null,
34
- null,
35
- null
36
- ];
37
-
38
- let _value: null | FileData;
39
- $: _value = normalise_file(value, root, root_url);
40
-
41
- let dragging = false;
42
- </script>
43
-
44
- <Block
45
- {visible}
46
- variant={value === null ? "dashed" : "solid"}
47
- border_mode={dragging ? "focus" : "base"}
48
- padding={false}
49
- {elem_id}
50
- {elem_classes}
51
- {container}
52
- {scale}
53
- {min_width}
54
- {height}
55
- >
56
- <StatusTracker
57
- autoscroll={gradio.autoscroll}
58
- i18n={gradio.i18n}
59
- {...loading_status}
60
- />
61
-
62
- <Model3DUpload
63
- {label}
64
- {show_label}
65
- {root}
66
- {clear_color}
67
- value={_value}
68
- {camera_position}
69
- {zoom_speed}
70
- on:change={({ detail }) => (value = detail)}
71
- on:drag={({ detail }) => (dragging = detail)}
72
- on:change={({ detail }) => gradio.dispatch("change", detail)}
73
- on:clear={() => gradio.dispatch("clear")}
74
- i18n={gradio.i18n}
75
- >
76
- <UploadText i18n={gradio.i18n} type="file" />
77
- </Model3DUpload>
78
- </Block>
@@ -1 +0,0 @@
1
- export { default } from "./InteractiveModel3d.svelte";
@@ -1,78 +0,0 @@
1
- <script lang="ts">
2
- import type { FileData } from "@gradio/upload";
3
- import { normalise_file } from "@gradio/upload";
4
- import Model3D from "./Model3D.svelte";
5
- import { BlockLabel, Block, Empty } from "@gradio/atoms";
6
- import { File } from "@gradio/icons";
7
-
8
- import { StatusTracker } from "@gradio/statustracker";
9
- import type { LoadingStatus } from "@gradio/statustracker";
10
- import type { Gradio } from "@gradio/utils";
11
-
12
- export let elem_id = "";
13
- export let elem_classes: string[] = [];
14
- export let visible = true;
15
- export let value: null | FileData = null;
16
- export let root: string;
17
- export let root_url: null | string;
18
- export let clear_color: [number, number, number, number];
19
- export let loading_status: LoadingStatus;
20
- export let label: string;
21
- export let show_label: boolean;
22
- export let container = true;
23
- export let scale: number | null = null;
24
- export let min_width: number | undefined = undefined;
25
- export let gradio: Gradio;
26
- export let height: number | undefined = undefined;
27
- export let zoom_speed = 1;
28
-
29
- // alpha, beta, radius
30
- export let camera_position: [number | null, number | null, number | null] = [
31
- null,
32
- null,
33
- null
34
- ];
35
-
36
- let _value: null | FileData;
37
- $: _value = normalise_file(value, root, root_url);
38
-
39
- let dragging = false;
40
- </script>
41
-
42
- <Block
43
- {visible}
44
- variant={value === null ? "dashed" : "solid"}
45
- border_mode={dragging ? "focus" : "base"}
46
- padding={false}
47
- {elem_id}
48
- {elem_classes}
49
- {container}
50
- {scale}
51
- {min_width}
52
- {height}
53
- >
54
- <StatusTracker
55
- autoscroll={gradio.autoscroll}
56
- i18n={gradio.i18n}
57
- {...loading_status}
58
- />
59
-
60
- {#if value}
61
- <Model3D
62
- value={_value}
63
- i18n={gradio.i18n}
64
- {clear_color}
65
- {label}
66
- {show_label}
67
- {camera_position}
68
- {zoom_speed}
69
- />
70
- {:else}
71
- <!-- Not ideal but some bugs to work out before we can
72
- make this consistent with other components -->
73
-
74
- <BlockLabel {show_label} Icon={File} label={label || "3D Model"} />
75
-
76
- <Empty unpadded_box={true} size="large"><File /></Empty>
77
- {/if}
78
- </Block>
package/static/index.ts DELETED
@@ -1 +0,0 @@
1
- export { default } from "./StaticModel3d.svelte";
File without changes