@react-three/fiber 8.0.3 → 8.0.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 +18 -0
- package/dist/declarations/src/core/store.d.ts +4 -2
- package/dist/{index-77a5f42b.cjs.dev.js → index-0076cbd6.cjs.dev.js} +64 -21
- package/dist/{index-4557e6e6.cjs.prod.js → index-0e758026.cjs.prod.js} +64 -21
- package/dist/{index-1155e5bd.esm.js → index-91900b41.esm.js} +64 -21
- package/dist/react-three-fiber.cjs.dev.js +2 -2
- package/dist/react-three-fiber.cjs.prod.js +2 -2
- package/dist/react-three-fiber.esm.js +3 -3
- package/native/dist/react-three-fiber-native.cjs.dev.js +2 -2
- package/native/dist/react-three-fiber-native.cjs.prod.js +2 -2
- package/native/dist/react-three-fiber-native.esm.js +3 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @react-three/fiber
|
|
2
2
|
|
|
3
|
+
## 8.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d4bafb9: fix re-parenting, useframe not working properly in portals, attach crash
|
|
8
|
+
|
|
9
|
+
## 8.0.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 227c328: fix pointer for root and portals
|
|
14
|
+
|
|
15
|
+
## 8.0.4
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- e981a72: fix: mock three color management, loosen peer dep
|
|
20
|
+
|
|
3
21
|
## 8.0.3
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -9,6 +9,7 @@ export interface Intersection extends THREE.Intersection {
|
|
|
9
9
|
export declare type Subscription = {
|
|
10
10
|
ref: React.MutableRefObject<RenderCallback>;
|
|
11
11
|
priority: number;
|
|
12
|
+
store: UseBoundStore<RootState, StoreApi<RootState>>;
|
|
12
13
|
};
|
|
13
14
|
export declare type Dpr = number | [min: number, max: number];
|
|
14
15
|
export declare type Size = {
|
|
@@ -47,7 +48,7 @@ export declare type InternalState = {
|
|
|
47
48
|
capturedMap: Map<number, Map<THREE.Object3D, PointerCaptureTarget>>;
|
|
48
49
|
initialClick: [x: number, y: number];
|
|
49
50
|
initialHits: THREE.Object3D[];
|
|
50
|
-
subscribe: (callback: React.MutableRefObject<RenderCallback>, priority
|
|
51
|
+
subscribe: (callback: React.MutableRefObject<RenderCallback>, priority: number, store: UseBoundStore<RootState, StoreApi<RootState>>) => () => void;
|
|
51
52
|
};
|
|
52
53
|
export declare type RootState = {
|
|
53
54
|
set: SetState<RootState>;
|
|
@@ -67,6 +68,7 @@ export declare type RootState = {
|
|
|
67
68
|
controls: THREE.EventDispatcher | null;
|
|
68
69
|
pointer: THREE.Vector2;
|
|
69
70
|
mouse: THREE.Vector2;
|
|
71
|
+
legacy: boolean;
|
|
70
72
|
linear: boolean;
|
|
71
73
|
flat: boolean;
|
|
72
74
|
frameloop: 'always' | 'demand' | 'never';
|
|
@@ -89,9 +91,9 @@ export declare type StoreProps = {
|
|
|
89
91
|
gl: THREE.WebGLRenderer;
|
|
90
92
|
size: Size;
|
|
91
93
|
shadows?: boolean | Partial<THREE.WebGLShadowMap>;
|
|
94
|
+
legacy?: boolean;
|
|
92
95
|
linear?: boolean;
|
|
93
96
|
flat?: boolean;
|
|
94
|
-
legacy?: boolean;
|
|
95
97
|
orthographic?: boolean;
|
|
96
98
|
frameloop?: 'always' | 'demand' | 'never';
|
|
97
99
|
performance?: Partial<Omit<Performance, 'regress'>>;
|
|
@@ -334,10 +334,22 @@ function applyProps$1(instance, data) {
|
|
|
334
334
|
|
|
335
335
|
if (!isColor && targetProp.setScalar) targetProp.setScalar(value); // Layers have no copy function, we must therefore copy the mask property
|
|
336
336
|
else if (targetProp instanceof THREE__namespace.Layers && value instanceof THREE__namespace.Layers) targetProp.mask = value.mask; // Otherwise just set ...
|
|
337
|
-
else targetProp.set(value);
|
|
337
|
+
else targetProp.set(value); // For versions of three which don't support THREE.ColorManagement,
|
|
338
|
+
// Auto-convert sRGB colors
|
|
339
|
+
// https://github.com/pmndrs/react-three-fiber/issues/344
|
|
340
|
+
|
|
341
|
+
const supportsColorManagement = THREE__namespace.ColorManagement;
|
|
342
|
+
if (!supportsColorManagement && !rootState.linear && isColor) targetProp.convertSRGBToLinear();
|
|
338
343
|
} // Else, just overwrite the value
|
|
339
344
|
|
|
340
|
-
} else
|
|
345
|
+
} else {
|
|
346
|
+
currentInstance[key] = value; // Auto-convert sRGB textures, for now ...
|
|
347
|
+
// https://github.com/pmndrs/react-three-fiber/issues/344
|
|
348
|
+
|
|
349
|
+
if (!rootState.linear && currentInstance[key] instanceof THREE__namespace.Texture) {
|
|
350
|
+
currentInstance[key].encoding = THREE__namespace.sRGBEncoding;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
341
353
|
|
|
342
354
|
invalidateInstance(instance);
|
|
343
355
|
});
|
|
@@ -468,7 +480,13 @@ function createEvents(store) {
|
|
|
468
480
|
if (state) {
|
|
469
481
|
state.raycaster.camera = undefined;
|
|
470
482
|
}
|
|
471
|
-
});
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
if (!state.previousRoot) {
|
|
486
|
+
// Make sure root-level pointer and ray are set up
|
|
487
|
+
state.events.compute == null ? void 0 : state.events.compute(event, state);
|
|
488
|
+
} // Collect events
|
|
489
|
+
|
|
472
490
|
|
|
473
491
|
let hits = eventsObjects // Intersect objects
|
|
474
492
|
.flatMap(obj => {
|
|
@@ -842,8 +860,10 @@ function createRenderer(roots, getEventPriority) {
|
|
|
842
860
|
let added = false;
|
|
843
861
|
|
|
844
862
|
if (child) {
|
|
863
|
+
var _child$__r3f, _parentInstance$__r3f;
|
|
864
|
+
|
|
845
865
|
// The attach attribute implies that the object attaches itself on the parent
|
|
846
|
-
if (child.__r3f.attach) {
|
|
866
|
+
if ((_child$__r3f = child.__r3f) != null && _child$__r3f.attach) {
|
|
847
867
|
attach(parentInstance, child, child.__r3f.attach);
|
|
848
868
|
} else if (child.isObject3D && parentInstance.isObject3D) {
|
|
849
869
|
// add in the usual parent-child way
|
|
@@ -853,7 +873,7 @@ function createRenderer(roots, getEventPriority) {
|
|
|
853
873
|
// that is, anything that's a child in React but not a child in the scenegraph.
|
|
854
874
|
|
|
855
875
|
|
|
856
|
-
if (!added) parentInstance.__r3f.objects.push(child);
|
|
876
|
+
if (!added) (_parentInstance$__r3f = parentInstance.__r3f) == null ? void 0 : _parentInstance$__r3f.objects.push(child);
|
|
857
877
|
if (!child.__r3f) prepare(child, {});
|
|
858
878
|
child.__r3f.parent = parentInstance;
|
|
859
879
|
updateInstance(child);
|
|
@@ -865,7 +885,9 @@ function createRenderer(roots, getEventPriority) {
|
|
|
865
885
|
let added = false;
|
|
866
886
|
|
|
867
887
|
if (child) {
|
|
868
|
-
|
|
888
|
+
var _child$__r3f2, _parentInstance$__r3f2;
|
|
889
|
+
|
|
890
|
+
if ((_child$__r3f2 = child.__r3f) != null && _child$__r3f2.attach) {
|
|
869
891
|
attach(parentInstance, child, child.__r3f.attach);
|
|
870
892
|
} else if (child.isObject3D && parentInstance.isObject3D) {
|
|
871
893
|
child.parent = parentInstance;
|
|
@@ -878,7 +900,7 @@ function createRenderer(roots, getEventPriority) {
|
|
|
878
900
|
added = true;
|
|
879
901
|
}
|
|
880
902
|
|
|
881
|
-
if (!added) parentInstance.__r3f.objects.push(child);
|
|
903
|
+
if (!added) (_parentInstance$__r3f2 = parentInstance.__r3f) == null ? void 0 : _parentInstance$__r3f2.objects.push(child);
|
|
882
904
|
if (!child.__r3f) prepare(child, {});
|
|
883
905
|
child.__r3f.parent = parentInstance;
|
|
884
906
|
updateInstance(child);
|
|
@@ -892,21 +914,21 @@ function createRenderer(roots, getEventPriority) {
|
|
|
892
914
|
|
|
893
915
|
function removeChild(parentInstance, child, dispose) {
|
|
894
916
|
if (child) {
|
|
895
|
-
var _parentInstance$
|
|
917
|
+
var _parentInstance$__r3f3, _child$__r3f3, _child$__r3f5;
|
|
896
918
|
|
|
897
919
|
// Clear the parent reference
|
|
898
920
|
if (child.__r3f) child.__r3f.parent = null; // Remove child from the parents objects
|
|
899
921
|
|
|
900
|
-
if ((_parentInstance$
|
|
922
|
+
if ((_parentInstance$__r3f3 = parentInstance.__r3f) != null && _parentInstance$__r3f3.objects) parentInstance.__r3f.objects = parentInstance.__r3f.objects.filter(x => x !== child); // Remove attachment
|
|
901
923
|
|
|
902
|
-
if (child.__r3f.attach) {
|
|
924
|
+
if ((_child$__r3f3 = child.__r3f) != null && _child$__r3f3.attach) {
|
|
903
925
|
detach(parentInstance, child, child.__r3f.attach);
|
|
904
926
|
} else if (child.isObject3D && parentInstance.isObject3D) {
|
|
905
|
-
var _child$
|
|
927
|
+
var _child$__r3f4;
|
|
906
928
|
|
|
907
929
|
parentInstance.remove(child); // Remove interactivity
|
|
908
930
|
|
|
909
|
-
if ((_child$
|
|
931
|
+
if ((_child$__r3f4 = child.__r3f) != null && _child$__r3f4.root) {
|
|
910
932
|
removeInteractivity(child.__r3f.root, child);
|
|
911
933
|
}
|
|
912
934
|
} // Allow objects to bail out of recursive dispose alltogether by passing dispose={null}
|
|
@@ -920,14 +942,14 @@ function createRenderer(roots, getEventPriority) {
|
|
|
920
942
|
// when the reconciler calls it, but then carry our own check recursively
|
|
921
943
|
|
|
922
944
|
|
|
923
|
-
const isPrimitive = (_child$
|
|
945
|
+
const isPrimitive = (_child$__r3f5 = child.__r3f) == null ? void 0 : _child$__r3f5.primitive;
|
|
924
946
|
const shouldDispose = dispose === undefined ? child.dispose !== null && !isPrimitive : dispose; // Remove nested child objects. Primitives should not have objects and children that are
|
|
925
947
|
// attached to them declaratively ...
|
|
926
948
|
|
|
927
949
|
if (!isPrimitive) {
|
|
928
|
-
var _child$
|
|
950
|
+
var _child$__r3f6;
|
|
929
951
|
|
|
930
|
-
removeRecursive((_child$
|
|
952
|
+
removeRecursive((_child$__r3f6 = child.__r3f) == null ? void 0 : _child$__r3f6.objects, child, shouldDispose);
|
|
931
953
|
removeRecursive(child.children, child, shouldDispose);
|
|
932
954
|
} // Remove references
|
|
933
955
|
|
|
@@ -1192,6 +1214,7 @@ const createStore = (invalidate, advance) => {
|
|
|
1192
1214
|
xr: null,
|
|
1193
1215
|
invalidate: () => invalidate(get()),
|
|
1194
1216
|
advance: (timestamp, runGlobalEffects) => advance(timestamp, runGlobalEffects, get()),
|
|
1217
|
+
legacy: false,
|
|
1195
1218
|
linear: false,
|
|
1196
1219
|
flat: false,
|
|
1197
1220
|
scene: prepare(new THREE__namespace.Scene()),
|
|
@@ -1284,7 +1307,7 @@ const createStore = (invalidate, advance) => {
|
|
|
1284
1307
|
initialClick: [0, 0],
|
|
1285
1308
|
initialHits: [],
|
|
1286
1309
|
capturedMap: new Map(),
|
|
1287
|
-
subscribe: (ref, priority
|
|
1310
|
+
subscribe: (ref, priority, store) => {
|
|
1288
1311
|
set(({
|
|
1289
1312
|
internal
|
|
1290
1313
|
}) => ({
|
|
@@ -1298,7 +1321,8 @@ const createStore = (invalidate, advance) => {
|
|
|
1298
1321
|
// highest priority renders last (on top of the other frames)
|
|
1299
1322
|
subscribers: [...internal.subscribers, {
|
|
1300
1323
|
ref,
|
|
1301
|
-
priority
|
|
1324
|
+
priority,
|
|
1325
|
+
store
|
|
1302
1326
|
}].sort((a, b) => a.priority - b.priority)
|
|
1303
1327
|
}
|
|
1304
1328
|
}));
|
|
@@ -1381,6 +1405,7 @@ function run(effects, timestamp) {
|
|
|
1381
1405
|
}
|
|
1382
1406
|
|
|
1383
1407
|
let subscribers;
|
|
1408
|
+
let subscription;
|
|
1384
1409
|
|
|
1385
1410
|
function render$1(timestamp, state, frame) {
|
|
1386
1411
|
// Run local effects
|
|
@@ -1395,7 +1420,10 @@ function render$1(timestamp, state, frame) {
|
|
|
1395
1420
|
|
|
1396
1421
|
subscribers = state.internal.subscribers;
|
|
1397
1422
|
|
|
1398
|
-
for (i = 0; i < subscribers.length; i++)
|
|
1423
|
+
for (i = 0; i < subscribers.length; i++) {
|
|
1424
|
+
subscription = subscribers[i];
|
|
1425
|
+
subscription.ref.current(subscription.store.getState(), delta, frame);
|
|
1426
|
+
} // Render content
|
|
1399
1427
|
|
|
1400
1428
|
|
|
1401
1429
|
if (!state.internal.priority && state.gl.render) state.gl.render(state.scene, state.camera); // Decrease frame count
|
|
@@ -1474,12 +1502,13 @@ function useThree(selector = state => state, equalityFn) {
|
|
|
1474
1502
|
return useStore()(selector, equalityFn);
|
|
1475
1503
|
}
|
|
1476
1504
|
function useFrame(callback, renderPriority = 0) {
|
|
1477
|
-
const
|
|
1505
|
+
const store = useStore();
|
|
1506
|
+
const subscribe = store.getState().internal.subscribe; // Update ref
|
|
1478
1507
|
|
|
1479
1508
|
const ref = React__namespace.useRef(callback);
|
|
1480
1509
|
React__namespace.useLayoutEffect(() => void (ref.current = callback), [callback]); // Subscribe on mount, unsubscribe on unmount
|
|
1481
1510
|
|
|
1482
|
-
React__namespace.useLayoutEffect(() => subscribe(ref, renderPriority), [renderPriority, subscribe]);
|
|
1511
|
+
React__namespace.useLayoutEffect(() => subscribe(ref, renderPriority, store), [renderPriority, subscribe, store]);
|
|
1483
1512
|
return null;
|
|
1484
1513
|
}
|
|
1485
1514
|
function useGraph(object) {
|
|
@@ -1689,7 +1718,17 @@ function createRoot(canvas) {
|
|
|
1689
1718
|
const outputEncoding = linear ? THREE__namespace.LinearEncoding : THREE__namespace.sRGBEncoding;
|
|
1690
1719
|
const toneMapping = flat ? THREE__namespace.NoToneMapping : THREE__namespace.ACESFilmicToneMapping;
|
|
1691
1720
|
if (gl.outputEncoding !== outputEncoding) gl.outputEncoding = outputEncoding;
|
|
1692
|
-
if (gl.toneMapping !== toneMapping) gl.toneMapping = toneMapping; //
|
|
1721
|
+
if (gl.toneMapping !== toneMapping) gl.toneMapping = toneMapping; // Update color management state
|
|
1722
|
+
|
|
1723
|
+
if (state.legacy !== legacy) state.set(() => ({
|
|
1724
|
+
legacy
|
|
1725
|
+
}));
|
|
1726
|
+
if (state.linear !== linear) state.set(() => ({
|
|
1727
|
+
linear
|
|
1728
|
+
}));
|
|
1729
|
+
if (state.flat !== flat) state.set(() => ({
|
|
1730
|
+
flat
|
|
1731
|
+
})); // Set gl props
|
|
1693
1732
|
|
|
1694
1733
|
if (glConfig && !is.fun(glConfig) && !isRenderer(glConfig) && !is.equ(glConfig, gl, shallowLoose)) applyProps(gl, glConfig); // Store events internally
|
|
1695
1734
|
|
|
@@ -1804,6 +1843,7 @@ function unmountComponentAtNode(canvas, callback) {
|
|
|
1804
1843
|
|
|
1805
1844
|
function createPortal(children, container, state) {
|
|
1806
1845
|
return /*#__PURE__*/React__namespace.createElement(Portal, {
|
|
1846
|
+
key: container.uuid,
|
|
1807
1847
|
children: children,
|
|
1808
1848
|
container: container,
|
|
1809
1849
|
state: state
|
|
@@ -1826,6 +1866,7 @@ function Portal({
|
|
|
1826
1866
|
} = state;
|
|
1827
1867
|
const previousRoot = useStore();
|
|
1828
1868
|
const [raycaster] = React__namespace.useState(() => new THREE__namespace.Raycaster());
|
|
1869
|
+
const [pointer] = React__namespace.useState(() => new THREE__namespace.Vector2());
|
|
1829
1870
|
const inject = React__namespace.useCallback((state, injectState) => {
|
|
1830
1871
|
const intersect = { ...state
|
|
1831
1872
|
};
|
|
@@ -1845,6 +1886,8 @@ function Portal({
|
|
|
1845
1886
|
raycaster,
|
|
1846
1887
|
events: { ...state.events,
|
|
1847
1888
|
...(injectState == null ? void 0 : injectState.events),
|
|
1889
|
+
pointer,
|
|
1890
|
+
mouse: pointer,
|
|
1848
1891
|
...events
|
|
1849
1892
|
},
|
|
1850
1893
|
...rest
|
|
@@ -334,10 +334,22 @@ function applyProps$1(instance, data) {
|
|
|
334
334
|
|
|
335
335
|
if (!isColor && targetProp.setScalar) targetProp.setScalar(value); // Layers have no copy function, we must therefore copy the mask property
|
|
336
336
|
else if (targetProp instanceof THREE__namespace.Layers && value instanceof THREE__namespace.Layers) targetProp.mask = value.mask; // Otherwise just set ...
|
|
337
|
-
else targetProp.set(value);
|
|
337
|
+
else targetProp.set(value); // For versions of three which don't support THREE.ColorManagement,
|
|
338
|
+
// Auto-convert sRGB colors
|
|
339
|
+
// https://github.com/pmndrs/react-three-fiber/issues/344
|
|
340
|
+
|
|
341
|
+
const supportsColorManagement = THREE__namespace.ColorManagement;
|
|
342
|
+
if (!supportsColorManagement && !rootState.linear && isColor) targetProp.convertSRGBToLinear();
|
|
338
343
|
} // Else, just overwrite the value
|
|
339
344
|
|
|
340
|
-
} else
|
|
345
|
+
} else {
|
|
346
|
+
currentInstance[key] = value; // Auto-convert sRGB textures, for now ...
|
|
347
|
+
// https://github.com/pmndrs/react-three-fiber/issues/344
|
|
348
|
+
|
|
349
|
+
if (!rootState.linear && currentInstance[key] instanceof THREE__namespace.Texture) {
|
|
350
|
+
currentInstance[key].encoding = THREE__namespace.sRGBEncoding;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
341
353
|
|
|
342
354
|
invalidateInstance(instance);
|
|
343
355
|
});
|
|
@@ -468,7 +480,13 @@ function createEvents(store) {
|
|
|
468
480
|
if (state) {
|
|
469
481
|
state.raycaster.camera = undefined;
|
|
470
482
|
}
|
|
471
|
-
});
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
if (!state.previousRoot) {
|
|
486
|
+
// Make sure root-level pointer and ray are set up
|
|
487
|
+
state.events.compute == null ? void 0 : state.events.compute(event, state);
|
|
488
|
+
} // Collect events
|
|
489
|
+
|
|
472
490
|
|
|
473
491
|
let hits = eventsObjects // Intersect objects
|
|
474
492
|
.flatMap(obj => {
|
|
@@ -842,8 +860,10 @@ function createRenderer(roots, getEventPriority) {
|
|
|
842
860
|
let added = false;
|
|
843
861
|
|
|
844
862
|
if (child) {
|
|
863
|
+
var _child$__r3f, _parentInstance$__r3f;
|
|
864
|
+
|
|
845
865
|
// The attach attribute implies that the object attaches itself on the parent
|
|
846
|
-
if (child.__r3f.attach) {
|
|
866
|
+
if ((_child$__r3f = child.__r3f) != null && _child$__r3f.attach) {
|
|
847
867
|
attach(parentInstance, child, child.__r3f.attach);
|
|
848
868
|
} else if (child.isObject3D && parentInstance.isObject3D) {
|
|
849
869
|
// add in the usual parent-child way
|
|
@@ -853,7 +873,7 @@ function createRenderer(roots, getEventPriority) {
|
|
|
853
873
|
// that is, anything that's a child in React but not a child in the scenegraph.
|
|
854
874
|
|
|
855
875
|
|
|
856
|
-
if (!added) parentInstance.__r3f.objects.push(child);
|
|
876
|
+
if (!added) (_parentInstance$__r3f = parentInstance.__r3f) == null ? void 0 : _parentInstance$__r3f.objects.push(child);
|
|
857
877
|
if (!child.__r3f) prepare(child, {});
|
|
858
878
|
child.__r3f.parent = parentInstance;
|
|
859
879
|
updateInstance(child);
|
|
@@ -865,7 +885,9 @@ function createRenderer(roots, getEventPriority) {
|
|
|
865
885
|
let added = false;
|
|
866
886
|
|
|
867
887
|
if (child) {
|
|
868
|
-
|
|
888
|
+
var _child$__r3f2, _parentInstance$__r3f2;
|
|
889
|
+
|
|
890
|
+
if ((_child$__r3f2 = child.__r3f) != null && _child$__r3f2.attach) {
|
|
869
891
|
attach(parentInstance, child, child.__r3f.attach);
|
|
870
892
|
} else if (child.isObject3D && parentInstance.isObject3D) {
|
|
871
893
|
child.parent = parentInstance;
|
|
@@ -878,7 +900,7 @@ function createRenderer(roots, getEventPriority) {
|
|
|
878
900
|
added = true;
|
|
879
901
|
}
|
|
880
902
|
|
|
881
|
-
if (!added) parentInstance.__r3f.objects.push(child);
|
|
903
|
+
if (!added) (_parentInstance$__r3f2 = parentInstance.__r3f) == null ? void 0 : _parentInstance$__r3f2.objects.push(child);
|
|
882
904
|
if (!child.__r3f) prepare(child, {});
|
|
883
905
|
child.__r3f.parent = parentInstance;
|
|
884
906
|
updateInstance(child);
|
|
@@ -892,21 +914,21 @@ function createRenderer(roots, getEventPriority) {
|
|
|
892
914
|
|
|
893
915
|
function removeChild(parentInstance, child, dispose) {
|
|
894
916
|
if (child) {
|
|
895
|
-
var _parentInstance$
|
|
917
|
+
var _parentInstance$__r3f3, _child$__r3f3, _child$__r3f5;
|
|
896
918
|
|
|
897
919
|
// Clear the parent reference
|
|
898
920
|
if (child.__r3f) child.__r3f.parent = null; // Remove child from the parents objects
|
|
899
921
|
|
|
900
|
-
if ((_parentInstance$
|
|
922
|
+
if ((_parentInstance$__r3f3 = parentInstance.__r3f) != null && _parentInstance$__r3f3.objects) parentInstance.__r3f.objects = parentInstance.__r3f.objects.filter(x => x !== child); // Remove attachment
|
|
901
923
|
|
|
902
|
-
if (child.__r3f.attach) {
|
|
924
|
+
if ((_child$__r3f3 = child.__r3f) != null && _child$__r3f3.attach) {
|
|
903
925
|
detach(parentInstance, child, child.__r3f.attach);
|
|
904
926
|
} else if (child.isObject3D && parentInstance.isObject3D) {
|
|
905
|
-
var _child$
|
|
927
|
+
var _child$__r3f4;
|
|
906
928
|
|
|
907
929
|
parentInstance.remove(child); // Remove interactivity
|
|
908
930
|
|
|
909
|
-
if ((_child$
|
|
931
|
+
if ((_child$__r3f4 = child.__r3f) != null && _child$__r3f4.root) {
|
|
910
932
|
removeInteractivity(child.__r3f.root, child);
|
|
911
933
|
}
|
|
912
934
|
} // Allow objects to bail out of recursive dispose alltogether by passing dispose={null}
|
|
@@ -920,14 +942,14 @@ function createRenderer(roots, getEventPriority) {
|
|
|
920
942
|
// when the reconciler calls it, but then carry our own check recursively
|
|
921
943
|
|
|
922
944
|
|
|
923
|
-
const isPrimitive = (_child$
|
|
945
|
+
const isPrimitive = (_child$__r3f5 = child.__r3f) == null ? void 0 : _child$__r3f5.primitive;
|
|
924
946
|
const shouldDispose = dispose === undefined ? child.dispose !== null && !isPrimitive : dispose; // Remove nested child objects. Primitives should not have objects and children that are
|
|
925
947
|
// attached to them declaratively ...
|
|
926
948
|
|
|
927
949
|
if (!isPrimitive) {
|
|
928
|
-
var _child$
|
|
950
|
+
var _child$__r3f6;
|
|
929
951
|
|
|
930
|
-
removeRecursive((_child$
|
|
952
|
+
removeRecursive((_child$__r3f6 = child.__r3f) == null ? void 0 : _child$__r3f6.objects, child, shouldDispose);
|
|
931
953
|
removeRecursive(child.children, child, shouldDispose);
|
|
932
954
|
} // Remove references
|
|
933
955
|
|
|
@@ -1192,6 +1214,7 @@ const createStore = (invalidate, advance) => {
|
|
|
1192
1214
|
xr: null,
|
|
1193
1215
|
invalidate: () => invalidate(get()),
|
|
1194
1216
|
advance: (timestamp, runGlobalEffects) => advance(timestamp, runGlobalEffects, get()),
|
|
1217
|
+
legacy: false,
|
|
1195
1218
|
linear: false,
|
|
1196
1219
|
flat: false,
|
|
1197
1220
|
scene: prepare(new THREE__namespace.Scene()),
|
|
@@ -1284,7 +1307,7 @@ const createStore = (invalidate, advance) => {
|
|
|
1284
1307
|
initialClick: [0, 0],
|
|
1285
1308
|
initialHits: [],
|
|
1286
1309
|
capturedMap: new Map(),
|
|
1287
|
-
subscribe: (ref, priority
|
|
1310
|
+
subscribe: (ref, priority, store) => {
|
|
1288
1311
|
set(({
|
|
1289
1312
|
internal
|
|
1290
1313
|
}) => ({
|
|
@@ -1298,7 +1321,8 @@ const createStore = (invalidate, advance) => {
|
|
|
1298
1321
|
// highest priority renders last (on top of the other frames)
|
|
1299
1322
|
subscribers: [...internal.subscribers, {
|
|
1300
1323
|
ref,
|
|
1301
|
-
priority
|
|
1324
|
+
priority,
|
|
1325
|
+
store
|
|
1302
1326
|
}].sort((a, b) => a.priority - b.priority)
|
|
1303
1327
|
}
|
|
1304
1328
|
}));
|
|
@@ -1381,6 +1405,7 @@ function run(effects, timestamp) {
|
|
|
1381
1405
|
}
|
|
1382
1406
|
|
|
1383
1407
|
let subscribers;
|
|
1408
|
+
let subscription;
|
|
1384
1409
|
|
|
1385
1410
|
function render$1(timestamp, state, frame) {
|
|
1386
1411
|
// Run local effects
|
|
@@ -1395,7 +1420,10 @@ function render$1(timestamp, state, frame) {
|
|
|
1395
1420
|
|
|
1396
1421
|
subscribers = state.internal.subscribers;
|
|
1397
1422
|
|
|
1398
|
-
for (i = 0; i < subscribers.length; i++)
|
|
1423
|
+
for (i = 0; i < subscribers.length; i++) {
|
|
1424
|
+
subscription = subscribers[i];
|
|
1425
|
+
subscription.ref.current(subscription.store.getState(), delta, frame);
|
|
1426
|
+
} // Render content
|
|
1399
1427
|
|
|
1400
1428
|
|
|
1401
1429
|
if (!state.internal.priority && state.gl.render) state.gl.render(state.scene, state.camera); // Decrease frame count
|
|
@@ -1474,12 +1502,13 @@ function useThree(selector = state => state, equalityFn) {
|
|
|
1474
1502
|
return useStore()(selector, equalityFn);
|
|
1475
1503
|
}
|
|
1476
1504
|
function useFrame(callback, renderPriority = 0) {
|
|
1477
|
-
const
|
|
1505
|
+
const store = useStore();
|
|
1506
|
+
const subscribe = store.getState().internal.subscribe; // Update ref
|
|
1478
1507
|
|
|
1479
1508
|
const ref = React__namespace.useRef(callback);
|
|
1480
1509
|
React__namespace.useLayoutEffect(() => void (ref.current = callback), [callback]); // Subscribe on mount, unsubscribe on unmount
|
|
1481
1510
|
|
|
1482
|
-
React__namespace.useLayoutEffect(() => subscribe(ref, renderPriority), [renderPriority, subscribe]);
|
|
1511
|
+
React__namespace.useLayoutEffect(() => subscribe(ref, renderPriority, store), [renderPriority, subscribe, store]);
|
|
1483
1512
|
return null;
|
|
1484
1513
|
}
|
|
1485
1514
|
function useGraph(object) {
|
|
@@ -1689,7 +1718,17 @@ function createRoot(canvas) {
|
|
|
1689
1718
|
const outputEncoding = linear ? THREE__namespace.LinearEncoding : THREE__namespace.sRGBEncoding;
|
|
1690
1719
|
const toneMapping = flat ? THREE__namespace.NoToneMapping : THREE__namespace.ACESFilmicToneMapping;
|
|
1691
1720
|
if (gl.outputEncoding !== outputEncoding) gl.outputEncoding = outputEncoding;
|
|
1692
|
-
if (gl.toneMapping !== toneMapping) gl.toneMapping = toneMapping; //
|
|
1721
|
+
if (gl.toneMapping !== toneMapping) gl.toneMapping = toneMapping; // Update color management state
|
|
1722
|
+
|
|
1723
|
+
if (state.legacy !== legacy) state.set(() => ({
|
|
1724
|
+
legacy
|
|
1725
|
+
}));
|
|
1726
|
+
if (state.linear !== linear) state.set(() => ({
|
|
1727
|
+
linear
|
|
1728
|
+
}));
|
|
1729
|
+
if (state.flat !== flat) state.set(() => ({
|
|
1730
|
+
flat
|
|
1731
|
+
})); // Set gl props
|
|
1693
1732
|
|
|
1694
1733
|
if (glConfig && !is.fun(glConfig) && !isRenderer(glConfig) && !is.equ(glConfig, gl, shallowLoose)) applyProps(gl, glConfig); // Store events internally
|
|
1695
1734
|
|
|
@@ -1804,6 +1843,7 @@ function unmountComponentAtNode(canvas, callback) {
|
|
|
1804
1843
|
|
|
1805
1844
|
function createPortal(children, container, state) {
|
|
1806
1845
|
return /*#__PURE__*/React__namespace.createElement(Portal, {
|
|
1846
|
+
key: container.uuid,
|
|
1807
1847
|
children: children,
|
|
1808
1848
|
container: container,
|
|
1809
1849
|
state: state
|
|
@@ -1826,6 +1866,7 @@ function Portal({
|
|
|
1826
1866
|
} = state;
|
|
1827
1867
|
const previousRoot = useStore();
|
|
1828
1868
|
const [raycaster] = React__namespace.useState(() => new THREE__namespace.Raycaster());
|
|
1869
|
+
const [pointer] = React__namespace.useState(() => new THREE__namespace.Vector2());
|
|
1829
1870
|
const inject = React__namespace.useCallback((state, injectState) => {
|
|
1830
1871
|
const intersect = { ...state
|
|
1831
1872
|
};
|
|
@@ -1845,6 +1886,8 @@ function Portal({
|
|
|
1845
1886
|
raycaster,
|
|
1846
1887
|
events: { ...state.events,
|
|
1847
1888
|
...(injectState == null ? void 0 : injectState.events),
|
|
1889
|
+
pointer,
|
|
1890
|
+
mouse: pointer,
|
|
1848
1891
|
...events
|
|
1849
1892
|
},
|
|
1850
1893
|
...rest
|
|
@@ -305,10 +305,22 @@ function applyProps$1(instance, data) {
|
|
|
305
305
|
|
|
306
306
|
if (!isColor && targetProp.setScalar) targetProp.setScalar(value); // Layers have no copy function, we must therefore copy the mask property
|
|
307
307
|
else if (targetProp instanceof THREE.Layers && value instanceof THREE.Layers) targetProp.mask = value.mask; // Otherwise just set ...
|
|
308
|
-
else targetProp.set(value);
|
|
308
|
+
else targetProp.set(value); // For versions of three which don't support THREE.ColorManagement,
|
|
309
|
+
// Auto-convert sRGB colors
|
|
310
|
+
// https://github.com/pmndrs/react-three-fiber/issues/344
|
|
311
|
+
|
|
312
|
+
const supportsColorManagement = THREE.ColorManagement;
|
|
313
|
+
if (!supportsColorManagement && !rootState.linear && isColor) targetProp.convertSRGBToLinear();
|
|
309
314
|
} // Else, just overwrite the value
|
|
310
315
|
|
|
311
|
-
} else
|
|
316
|
+
} else {
|
|
317
|
+
currentInstance[key] = value; // Auto-convert sRGB textures, for now ...
|
|
318
|
+
// https://github.com/pmndrs/react-three-fiber/issues/344
|
|
319
|
+
|
|
320
|
+
if (!rootState.linear && currentInstance[key] instanceof THREE.Texture) {
|
|
321
|
+
currentInstance[key].encoding = THREE.sRGBEncoding;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
312
324
|
|
|
313
325
|
invalidateInstance(instance);
|
|
314
326
|
});
|
|
@@ -439,7 +451,13 @@ function createEvents(store) {
|
|
|
439
451
|
if (state) {
|
|
440
452
|
state.raycaster.camera = undefined;
|
|
441
453
|
}
|
|
442
|
-
});
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
if (!state.previousRoot) {
|
|
457
|
+
// Make sure root-level pointer and ray are set up
|
|
458
|
+
state.events.compute == null ? void 0 : state.events.compute(event, state);
|
|
459
|
+
} // Collect events
|
|
460
|
+
|
|
443
461
|
|
|
444
462
|
let hits = eventsObjects // Intersect objects
|
|
445
463
|
.flatMap(obj => {
|
|
@@ -813,8 +831,10 @@ function createRenderer(roots, getEventPriority) {
|
|
|
813
831
|
let added = false;
|
|
814
832
|
|
|
815
833
|
if (child) {
|
|
834
|
+
var _child$__r3f, _parentInstance$__r3f;
|
|
835
|
+
|
|
816
836
|
// The attach attribute implies that the object attaches itself on the parent
|
|
817
|
-
if (child.__r3f.attach) {
|
|
837
|
+
if ((_child$__r3f = child.__r3f) != null && _child$__r3f.attach) {
|
|
818
838
|
attach(parentInstance, child, child.__r3f.attach);
|
|
819
839
|
} else if (child.isObject3D && parentInstance.isObject3D) {
|
|
820
840
|
// add in the usual parent-child way
|
|
@@ -824,7 +844,7 @@ function createRenderer(roots, getEventPriority) {
|
|
|
824
844
|
// that is, anything that's a child in React but not a child in the scenegraph.
|
|
825
845
|
|
|
826
846
|
|
|
827
|
-
if (!added) parentInstance.__r3f.objects.push(child);
|
|
847
|
+
if (!added) (_parentInstance$__r3f = parentInstance.__r3f) == null ? void 0 : _parentInstance$__r3f.objects.push(child);
|
|
828
848
|
if (!child.__r3f) prepare(child, {});
|
|
829
849
|
child.__r3f.parent = parentInstance;
|
|
830
850
|
updateInstance(child);
|
|
@@ -836,7 +856,9 @@ function createRenderer(roots, getEventPriority) {
|
|
|
836
856
|
let added = false;
|
|
837
857
|
|
|
838
858
|
if (child) {
|
|
839
|
-
|
|
859
|
+
var _child$__r3f2, _parentInstance$__r3f2;
|
|
860
|
+
|
|
861
|
+
if ((_child$__r3f2 = child.__r3f) != null && _child$__r3f2.attach) {
|
|
840
862
|
attach(parentInstance, child, child.__r3f.attach);
|
|
841
863
|
} else if (child.isObject3D && parentInstance.isObject3D) {
|
|
842
864
|
child.parent = parentInstance;
|
|
@@ -849,7 +871,7 @@ function createRenderer(roots, getEventPriority) {
|
|
|
849
871
|
added = true;
|
|
850
872
|
}
|
|
851
873
|
|
|
852
|
-
if (!added) parentInstance.__r3f.objects.push(child);
|
|
874
|
+
if (!added) (_parentInstance$__r3f2 = parentInstance.__r3f) == null ? void 0 : _parentInstance$__r3f2.objects.push(child);
|
|
853
875
|
if (!child.__r3f) prepare(child, {});
|
|
854
876
|
child.__r3f.parent = parentInstance;
|
|
855
877
|
updateInstance(child);
|
|
@@ -863,21 +885,21 @@ function createRenderer(roots, getEventPriority) {
|
|
|
863
885
|
|
|
864
886
|
function removeChild(parentInstance, child, dispose) {
|
|
865
887
|
if (child) {
|
|
866
|
-
var _parentInstance$
|
|
888
|
+
var _parentInstance$__r3f3, _child$__r3f3, _child$__r3f5;
|
|
867
889
|
|
|
868
890
|
// Clear the parent reference
|
|
869
891
|
if (child.__r3f) child.__r3f.parent = null; // Remove child from the parents objects
|
|
870
892
|
|
|
871
|
-
if ((_parentInstance$
|
|
893
|
+
if ((_parentInstance$__r3f3 = parentInstance.__r3f) != null && _parentInstance$__r3f3.objects) parentInstance.__r3f.objects = parentInstance.__r3f.objects.filter(x => x !== child); // Remove attachment
|
|
872
894
|
|
|
873
|
-
if (child.__r3f.attach) {
|
|
895
|
+
if ((_child$__r3f3 = child.__r3f) != null && _child$__r3f3.attach) {
|
|
874
896
|
detach(parentInstance, child, child.__r3f.attach);
|
|
875
897
|
} else if (child.isObject3D && parentInstance.isObject3D) {
|
|
876
|
-
var _child$
|
|
898
|
+
var _child$__r3f4;
|
|
877
899
|
|
|
878
900
|
parentInstance.remove(child); // Remove interactivity
|
|
879
901
|
|
|
880
|
-
if ((_child$
|
|
902
|
+
if ((_child$__r3f4 = child.__r3f) != null && _child$__r3f4.root) {
|
|
881
903
|
removeInteractivity(child.__r3f.root, child);
|
|
882
904
|
}
|
|
883
905
|
} // Allow objects to bail out of recursive dispose alltogether by passing dispose={null}
|
|
@@ -891,14 +913,14 @@ function createRenderer(roots, getEventPriority) {
|
|
|
891
913
|
// when the reconciler calls it, but then carry our own check recursively
|
|
892
914
|
|
|
893
915
|
|
|
894
|
-
const isPrimitive = (_child$
|
|
916
|
+
const isPrimitive = (_child$__r3f5 = child.__r3f) == null ? void 0 : _child$__r3f5.primitive;
|
|
895
917
|
const shouldDispose = dispose === undefined ? child.dispose !== null && !isPrimitive : dispose; // Remove nested child objects. Primitives should not have objects and children that are
|
|
896
918
|
// attached to them declaratively ...
|
|
897
919
|
|
|
898
920
|
if (!isPrimitive) {
|
|
899
|
-
var _child$
|
|
921
|
+
var _child$__r3f6;
|
|
900
922
|
|
|
901
|
-
removeRecursive((_child$
|
|
923
|
+
removeRecursive((_child$__r3f6 = child.__r3f) == null ? void 0 : _child$__r3f6.objects, child, shouldDispose);
|
|
902
924
|
removeRecursive(child.children, child, shouldDispose);
|
|
903
925
|
} // Remove references
|
|
904
926
|
|
|
@@ -1163,6 +1185,7 @@ const createStore = (invalidate, advance) => {
|
|
|
1163
1185
|
xr: null,
|
|
1164
1186
|
invalidate: () => invalidate(get()),
|
|
1165
1187
|
advance: (timestamp, runGlobalEffects) => advance(timestamp, runGlobalEffects, get()),
|
|
1188
|
+
legacy: false,
|
|
1166
1189
|
linear: false,
|
|
1167
1190
|
flat: false,
|
|
1168
1191
|
scene: prepare(new THREE.Scene()),
|
|
@@ -1255,7 +1278,7 @@ const createStore = (invalidate, advance) => {
|
|
|
1255
1278
|
initialClick: [0, 0],
|
|
1256
1279
|
initialHits: [],
|
|
1257
1280
|
capturedMap: new Map(),
|
|
1258
|
-
subscribe: (ref, priority
|
|
1281
|
+
subscribe: (ref, priority, store) => {
|
|
1259
1282
|
set(({
|
|
1260
1283
|
internal
|
|
1261
1284
|
}) => ({
|
|
@@ -1269,7 +1292,8 @@ const createStore = (invalidate, advance) => {
|
|
|
1269
1292
|
// highest priority renders last (on top of the other frames)
|
|
1270
1293
|
subscribers: [...internal.subscribers, {
|
|
1271
1294
|
ref,
|
|
1272
|
-
priority
|
|
1295
|
+
priority,
|
|
1296
|
+
store
|
|
1273
1297
|
}].sort((a, b) => a.priority - b.priority)
|
|
1274
1298
|
}
|
|
1275
1299
|
}));
|
|
@@ -1352,6 +1376,7 @@ function run(effects, timestamp) {
|
|
|
1352
1376
|
}
|
|
1353
1377
|
|
|
1354
1378
|
let subscribers;
|
|
1379
|
+
let subscription;
|
|
1355
1380
|
|
|
1356
1381
|
function render$1(timestamp, state, frame) {
|
|
1357
1382
|
// Run local effects
|
|
@@ -1366,7 +1391,10 @@ function render$1(timestamp, state, frame) {
|
|
|
1366
1391
|
|
|
1367
1392
|
subscribers = state.internal.subscribers;
|
|
1368
1393
|
|
|
1369
|
-
for (i = 0; i < subscribers.length; i++)
|
|
1394
|
+
for (i = 0; i < subscribers.length; i++) {
|
|
1395
|
+
subscription = subscribers[i];
|
|
1396
|
+
subscription.ref.current(subscription.store.getState(), delta, frame);
|
|
1397
|
+
} // Render content
|
|
1370
1398
|
|
|
1371
1399
|
|
|
1372
1400
|
if (!state.internal.priority && state.gl.render) state.gl.render(state.scene, state.camera); // Decrease frame count
|
|
@@ -1445,12 +1473,13 @@ function useThree(selector = state => state, equalityFn) {
|
|
|
1445
1473
|
return useStore()(selector, equalityFn);
|
|
1446
1474
|
}
|
|
1447
1475
|
function useFrame(callback, renderPriority = 0) {
|
|
1448
|
-
const
|
|
1476
|
+
const store = useStore();
|
|
1477
|
+
const subscribe = store.getState().internal.subscribe; // Update ref
|
|
1449
1478
|
|
|
1450
1479
|
const ref = React.useRef(callback);
|
|
1451
1480
|
React.useLayoutEffect(() => void (ref.current = callback), [callback]); // Subscribe on mount, unsubscribe on unmount
|
|
1452
1481
|
|
|
1453
|
-
React.useLayoutEffect(() => subscribe(ref, renderPriority), [renderPriority, subscribe]);
|
|
1482
|
+
React.useLayoutEffect(() => subscribe(ref, renderPriority, store), [renderPriority, subscribe, store]);
|
|
1454
1483
|
return null;
|
|
1455
1484
|
}
|
|
1456
1485
|
function useGraph(object) {
|
|
@@ -1660,7 +1689,17 @@ function createRoot(canvas) {
|
|
|
1660
1689
|
const outputEncoding = linear ? THREE.LinearEncoding : THREE.sRGBEncoding;
|
|
1661
1690
|
const toneMapping = flat ? THREE.NoToneMapping : THREE.ACESFilmicToneMapping;
|
|
1662
1691
|
if (gl.outputEncoding !== outputEncoding) gl.outputEncoding = outputEncoding;
|
|
1663
|
-
if (gl.toneMapping !== toneMapping) gl.toneMapping = toneMapping; //
|
|
1692
|
+
if (gl.toneMapping !== toneMapping) gl.toneMapping = toneMapping; // Update color management state
|
|
1693
|
+
|
|
1694
|
+
if (state.legacy !== legacy) state.set(() => ({
|
|
1695
|
+
legacy
|
|
1696
|
+
}));
|
|
1697
|
+
if (state.linear !== linear) state.set(() => ({
|
|
1698
|
+
linear
|
|
1699
|
+
}));
|
|
1700
|
+
if (state.flat !== flat) state.set(() => ({
|
|
1701
|
+
flat
|
|
1702
|
+
})); // Set gl props
|
|
1664
1703
|
|
|
1665
1704
|
if (glConfig && !is.fun(glConfig) && !isRenderer(glConfig) && !is.equ(glConfig, gl, shallowLoose)) applyProps(gl, glConfig); // Store events internally
|
|
1666
1705
|
|
|
@@ -1775,6 +1814,7 @@ function unmountComponentAtNode(canvas, callback) {
|
|
|
1775
1814
|
|
|
1776
1815
|
function createPortal(children, container, state) {
|
|
1777
1816
|
return /*#__PURE__*/React.createElement(Portal, {
|
|
1817
|
+
key: container.uuid,
|
|
1778
1818
|
children: children,
|
|
1779
1819
|
container: container,
|
|
1780
1820
|
state: state
|
|
@@ -1797,6 +1837,7 @@ function Portal({
|
|
|
1797
1837
|
} = state;
|
|
1798
1838
|
const previousRoot = useStore();
|
|
1799
1839
|
const [raycaster] = React.useState(() => new THREE.Raycaster());
|
|
1840
|
+
const [pointer] = React.useState(() => new THREE.Vector2());
|
|
1800
1841
|
const inject = React.useCallback((state, injectState) => {
|
|
1801
1842
|
const intersect = { ...state
|
|
1802
1843
|
};
|
|
@@ -1816,6 +1857,8 @@ function Portal({
|
|
|
1816
1857
|
raycaster,
|
|
1817
1858
|
events: { ...state.events,
|
|
1818
1859
|
...(injectState == null ? void 0 : injectState.events),
|
|
1860
|
+
pointer,
|
|
1861
|
+
mouse: pointer,
|
|
1819
1862
|
...events
|
|
1820
1863
|
},
|
|
1821
1864
|
...rest
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-0076cbd6.cjs.dev.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -117,7 +117,7 @@ function createPointerEvents(store) {
|
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
const CANVAS_PROPS = ['gl', 'events', 'shadows', 'linear', 'flat', 'orthographic', 'frameloop', 'dpr', 'performance', 'raycaster', 'camera', 'onPointerMissed', 'onCreated'];
|
|
120
|
+
const CANVAS_PROPS = ['gl', 'events', 'shadows', 'linear', 'flat', 'legacy', 'orthographic', 'frameloop', 'dpr', 'performance', 'raycaster', 'camera', 'onPointerMissed', 'onCreated'];
|
|
121
121
|
|
|
122
122
|
function Block({
|
|
123
123
|
set
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-0e758026.cjs.prod.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -117,7 +117,7 @@ function createPointerEvents(store) {
|
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
const CANVAS_PROPS = ['gl', 'events', 'shadows', 'linear', 'flat', 'orthographic', 'frameloop', 'dpr', 'performance', 'raycaster', 'camera', 'onPointerMissed', 'onCreated'];
|
|
120
|
+
const CANVAS_PROPS = ['gl', 'events', 'shadows', 'linear', 'flat', 'legacy', 'orthographic', 'frameloop', 'dpr', 'performance', 'raycaster', 'camera', 'onPointerMissed', 'onCreated'];
|
|
121
121
|
|
|
122
122
|
function Block({
|
|
123
123
|
set
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as createEvents, e as extend, u as useMemoizedFn, p as pick, o as omit, a as createRoot, b as unmountComponentAtNode } from './index-
|
|
2
|
-
export { t as ReactThreeFiber, v as _roots, s as act, m as addAfterEffect, l as addEffect, n as addTail, k as advance, h as applyProps, d as context, f as createPortal, a as createRoot, i as dispose, e as extend, q as getRootState, j as invalidate, g as reconciler, r as render, b as unmountComponentAtNode, y as useFrame, z as useGraph, A as useLoader, u as useMemoizedFn, w as useStore, x as useThree } from './index-
|
|
1
|
+
import { c as createEvents, e as extend, u as useMemoizedFn, p as pick, o as omit, a as createRoot, b as unmountComponentAtNode } from './index-91900b41.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, v as _roots, s as act, m as addAfterEffect, l as addEffect, n as addTail, k as advance, h as applyProps, d as context, f as createPortal, a as createRoot, i as dispose, e as extend, q as getRootState, j as invalidate, g as reconciler, r as render, b as unmountComponentAtNode, y as useFrame, z as useGraph, A as useLoader, u as useMemoizedFn, w as useStore, x as useThree } from './index-91900b41.esm.js';
|
|
3
3
|
import _extends from '@babel/runtime/helpers/esm/extends';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import * as THREE from 'three';
|
|
@@ -87,7 +87,7 @@ function createPointerEvents(store) {
|
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
const CANVAS_PROPS = ['gl', 'events', 'shadows', 'linear', 'flat', 'orthographic', 'frameloop', 'dpr', 'performance', 'raycaster', 'camera', 'onPointerMissed', 'onCreated'];
|
|
90
|
+
const CANVAS_PROPS = ['gl', 'events', 'shadows', 'linear', 'flat', 'legacy', 'orthographic', 'frameloop', 'dpr', 'performance', 'raycaster', 'camera', 'onPointerMissed', 'onCreated'];
|
|
91
91
|
|
|
92
92
|
function Block({
|
|
93
93
|
set
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var THREE = require('three');
|
|
6
6
|
var expoAsset = require('expo-asset');
|
|
7
|
-
var index = require('../../dist/index-
|
|
7
|
+
var index = require('../../dist/index-0076cbd6.cjs.dev.js');
|
|
8
8
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
9
9
|
var React = require('react');
|
|
10
10
|
var mergeRefs = require('react-merge-refs');
|
|
@@ -125,7 +125,7 @@ function createTouchEvents(store) {
|
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
const CANVAS_PROPS = ['gl', 'events', 'shadows', 'linear', 'flat', 'orthographic', 'frameloop', 'performance', 'raycaster', 'camera', 'onPointerMissed', 'onCreated'];
|
|
128
|
+
const CANVAS_PROPS = ['gl', 'events', 'shadows', 'linear', 'flat', 'legacy', 'orthographic', 'frameloop', 'performance', 'raycaster', 'camera', 'onPointerMissed', 'onCreated'];
|
|
129
129
|
|
|
130
130
|
function Block({
|
|
131
131
|
set
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var THREE = require('three');
|
|
6
6
|
var expoAsset = require('expo-asset');
|
|
7
|
-
var index = require('../../dist/index-
|
|
7
|
+
var index = require('../../dist/index-0e758026.cjs.prod.js');
|
|
8
8
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
9
9
|
var React = require('react');
|
|
10
10
|
var mergeRefs = require('react-merge-refs');
|
|
@@ -125,7 +125,7 @@ function createTouchEvents(store) {
|
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
const CANVAS_PROPS = ['gl', 'events', 'shadows', 'linear', 'flat', 'orthographic', 'frameloop', 'performance', 'raycaster', 'camera', 'onPointerMissed', 'onCreated'];
|
|
128
|
+
const CANVAS_PROPS = ['gl', 'events', 'shadows', 'linear', 'flat', 'legacy', 'orthographic', 'frameloop', 'performance', 'raycaster', 'camera', 'onPointerMissed', 'onCreated'];
|
|
129
129
|
|
|
130
130
|
function Block({
|
|
131
131
|
set
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import { Asset } from 'expo-asset';
|
|
3
|
-
import { c as createEvents, e as extend, u as useMemoizedFn, p as pick, o as omit, a as createRoot, b as unmountComponentAtNode } from '../../dist/index-
|
|
4
|
-
export { t as ReactThreeFiber, v as _roots, s as act, m as addAfterEffect, l as addEffect, n as addTail, k as advance, h as applyProps, d as context, f as createPortal, a as createRoot, i as dispose, e as extend, q as getRootState, j as invalidate, g as reconciler, r as render, b as unmountComponentAtNode, y as useFrame, z as useGraph, A as useLoader, u as useMemoizedFn, w as useStore, x as useThree } from '../../dist/index-
|
|
3
|
+
import { c as createEvents, e as extend, u as useMemoizedFn, p as pick, o as omit, a as createRoot, b as unmountComponentAtNode } from '../../dist/index-91900b41.esm.js';
|
|
4
|
+
export { t as ReactThreeFiber, v as _roots, s as act, m as addAfterEffect, l as addEffect, n as addTail, k as advance, h as applyProps, d as context, f as createPortal, a as createRoot, i as dispose, e as extend, q as getRootState, j as invalidate, g as reconciler, r as render, b as unmountComponentAtNode, y as useFrame, z as useGraph, A as useLoader, u as useMemoizedFn, w as useStore, x as useThree } from '../../dist/index-91900b41.esm.js';
|
|
5
5
|
import _extends from '@babel/runtime/helpers/esm/extends';
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import mergeRefs from 'react-merge-refs';
|
|
@@ -95,7 +95,7 @@ function createTouchEvents(store) {
|
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
const CANVAS_PROPS = ['gl', 'events', 'shadows', 'linear', 'flat', 'orthographic', 'frameloop', 'performance', 'raycaster', 'camera', 'onPointerMissed', 'onCreated'];
|
|
98
|
+
const CANVAS_PROPS = ['gl', 'events', 'shadows', 'linear', 'flat', 'legacy', 'orthographic', 'frameloop', 'performance', 'raycaster', 'camera', 'onPointerMissed', 'onCreated'];
|
|
99
99
|
|
|
100
100
|
function Block({
|
|
101
101
|
set
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-three/fiber",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.6",
|
|
4
4
|
"description": "A React renderer for Threejs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"react": ">=18.0",
|
|
59
59
|
"react-dom": ">=18.0",
|
|
60
60
|
"react-native": ">=0.64",
|
|
61
|
-
"three": ">=0.
|
|
61
|
+
"three": ">=0.133"
|
|
62
62
|
},
|
|
63
63
|
"peerDependenciesMeta": {
|
|
64
64
|
"react-dom": {
|