@lukekaalim/act-three 5.12.1 → 5.12.3

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/entry.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './renderer.js';
2
2
  export * from './props.js';
3
3
  export * from './components.js';
4
- export * from './hooks.js';
4
+ export * from './hooks.js';
5
+ export * from './reconciler.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lukekaalim/act-three",
3
- "version": "5.12.1",
3
+ "version": "5.12.3",
4
4
  "description": "Render threejs content using act",
5
5
  "main": "entry.js",
6
6
  "types": "entry.d.ts",
package/props.js CHANGED
@@ -11,6 +11,7 @@ import { setHTMLProp } from "@lukekaalim/act-web";
11
11
  import {
12
12
  BufferGeometry,
13
13
  Camera,
14
+ Color,
14
15
  DirectionalLight,
15
16
  Euler,
16
17
  Group,
@@ -78,6 +79,15 @@ export const setMeshProp = (object/*: { [string]: mixed }*/, name/*: string*/, d
78
79
  }
79
80
  return false;
80
81
  }
82
+ export const setInstanceProp = (object/*: { [string]: mixed }*/, name/*: string*/, diff/*: PropDiff*/)/*: boolean*/ => {
83
+ if (object[name] instanceof Color) {
84
+ if (diff.next instanceof Color || typeof diff.next === 'string' || typeof diff.next === 'number') {
85
+ object[name].set(diff.next)
86
+ return true;
87
+ }
88
+ }
89
+ return false;
90
+ }
81
91
 
82
92
  export const setLightShadowProps = (
83
93
  diffs/*: PropDiffRegistry*/,
@@ -119,6 +129,9 @@ export const setObjectProps2 = (
119
129
  setLightShadowProps(propRegistry, target)
120
130
  continue;
121
131
  }
132
+ if (setInstanceProp((object/*: any*/), key, propDiff))
133
+ continue;
134
+
122
135
  if (setMeshProp((object/*: any*/), key, propDiff)) {
123
136
  continue;
124
137
  }
@@ -0,0 +1,3 @@
1
+ import { Element } from "@lukekaalim/act";
2
+
3
+ export function render(element: Element, node: HTMLElement): void;