@lukekaalim/act-three 8.0.2 → 8.1.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 +24 -0
- package/elements.ts +2 -3
- package/package.json +5 -5
- package/props.ts +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @lukekaalim/act-three
|
|
2
2
|
|
|
3
|
+
## 8.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 2ed02cf: Breaking! Change how useRef works, no longer compatible with React-style.
|
|
8
|
+
|
|
9
|
+
New API has `.get` and `.set` properties in order to better type ReadOnlyRef and WriteOnlyRef.
|
|
10
|
+
|
|
11
|
+
Add primitive registry to web, remove old element API and replace with "html" and "svg" element maps
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [2ed02cf]
|
|
16
|
+
- @lukekaalim/act-web@6.0.0
|
|
17
|
+
- @lukekaalim/act@5.0.0
|
|
18
|
+
- @lukekaalim/act-recon@4.0.1
|
|
19
|
+
- @lukekaalim/act-backstage@3.2.1
|
|
20
|
+
|
|
21
|
+
## 8.0.3
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 0378003: Fix issue with act-three always settings geometry and materials to props, even if left to undefined (resulting in geo/mats being set to undefined even if they exist)
|
|
26
|
+
|
|
3
27
|
## 8.0.2
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/elements.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as three from "three";
|
|
2
|
-
import {
|
|
2
|
+
import { WriteOnlyRef } from "@lukekaalim/act";
|
|
3
3
|
import { createPrimitiveRegistry } from "@lukekaalim/act-backstage";
|
|
4
4
|
import { setProps } from "./props";
|
|
5
5
|
|
|
@@ -31,7 +31,7 @@ export type PropsFromClass<T extends three.Object3D> = {
|
|
|
31
31
|
//onAdded?: (self: T) => void,
|
|
32
32
|
//onRemoved?: (self: T) => void,
|
|
33
33
|
|
|
34
|
-
ref?:
|
|
34
|
+
ref?: T extends three.Points<any, any, any> ? WriteOnlyRef<three.Points<any, any, any>> : WriteOnlyRef<T>,
|
|
35
35
|
}
|
|
36
36
|
& (T extends three.Mesh | three.Points | three.Line ? DrawableProps : {})
|
|
37
37
|
& (T extends three.Sprite ? SpriteProps : {})
|
|
@@ -156,7 +156,6 @@ registry
|
|
|
156
156
|
setProps(object, props as PropsFromClass<three.Object3D>);
|
|
157
157
|
return object;
|
|
158
158
|
}
|
|
159
|
-
console.warn(`I WONT MAKE ${type}`)
|
|
160
159
|
return null;
|
|
161
160
|
})
|
|
162
161
|
.addGlobalUpdateHandler((type, object, next, prev) => {
|
package/package.json
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
"name": "@lukekaalim/act-three",
|
|
3
3
|
"main": "index.ts",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "8.0
|
|
5
|
+
"version": "8.1.0",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@lukekaalim/act": "^
|
|
8
|
-
"@lukekaalim/act-backstage": "^3.2.
|
|
9
|
-
"@lukekaalim/act-recon": "^4.0.
|
|
10
|
-
"@lukekaalim/act-web": "^
|
|
7
|
+
"@lukekaalim/act": "^5.0.0",
|
|
8
|
+
"@lukekaalim/act-backstage": "^3.2.1",
|
|
9
|
+
"@lukekaalim/act-recon": "^4.0.1",
|
|
10
|
+
"@lukekaalim/act-web": "^6.0.0",
|
|
11
11
|
"@types/three": ">= 0.185.0"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
package/props.ts
CHANGED
|
@@ -37,12 +37,14 @@ export const setProps = (object: three.Object3D, props: PropsFromClass<three.Obj
|
|
|
37
37
|
object.userData = props.userData;
|
|
38
38
|
|
|
39
39
|
if (props.ref)
|
|
40
|
-
props.ref.
|
|
40
|
+
props.ref.set(object);
|
|
41
41
|
|
|
42
42
|
if (object instanceof three.Mesh || object instanceof three.Points || object instanceof three.Line) {
|
|
43
43
|
const meshProps = props as PropsFromClass<three.Mesh | three.Points | three.Line>;
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
if (meshProps.geometry)
|
|
45
|
+
object.geometry = meshProps.geometry;
|
|
46
|
+
if (meshProps.material)
|
|
47
|
+
object.material = meshProps.material;
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
if (object instanceof three.PerspectiveCamera) {
|