@react-three/fiber 8.0.10 → 8.0.13
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/events.d.ts +1 -1
- package/dist/declarations/src/core/index.d.ts +2 -2
- package/dist/declarations/src/core/store.d.ts +2 -0
- package/dist/declarations/src/core/utils.d.ts +1 -5
- package/dist/declarations/src/native/Canvas.d.ts +1 -1
- package/dist/declarations/src/three-types.d.ts +3 -1
- package/dist/{index-c8c0474b.cjs.prod.js → index-46325a70.cjs.prod.js} +75 -84
- package/dist/{index-018d2d45.cjs.dev.js → index-9ced08b3.cjs.dev.js} +75 -84
- package/dist/{index-91152509.esm.js → index-ec95272c.esm.js} +72 -77
- package/dist/react-three-fiber.cjs.dev.js +39 -22
- package/dist/react-three-fiber.cjs.prod.js +39 -22
- package/dist/react-three-fiber.esm.js +35 -16
- package/native/dist/react-three-fiber-native.cjs.dev.js +49 -36
- package/native/dist/react-three-fiber-native.cjs.prod.js +49 -36
- package/native/dist/react-three-fiber-native.esm.js +46 -31
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @react-three/fiber
|
|
2
2
|
|
|
3
|
+
## 8.0.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9d77d8e2: fix: detach attribute removal
|
|
8
|
+
|
|
9
|
+
## 8.0.12
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 3d10413f: fix portal layers
|
|
14
|
+
|
|
15
|
+
## 8.0.11
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 5167b1e4: memoized.args can be undefined
|
|
20
|
+
|
|
3
21
|
## 8.0.10
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -62,7 +62,7 @@ export interface PointerCaptureTarget {
|
|
|
62
62
|
intersection: Intersection;
|
|
63
63
|
target: Element;
|
|
64
64
|
}
|
|
65
|
-
export declare function getEventPriority():
|
|
65
|
+
export declare function getEventPriority(): 1 | 4 | 16;
|
|
66
66
|
export declare function removeInteractivity(store: UseBoundStore<RootState>, object: THREE.Object3D): void;
|
|
67
67
|
export declare function createEvents(store: UseBoundStore<RootState>): {
|
|
68
68
|
handlePointer: (name: string) => (event: DomEvent) => void;
|
|
@@ -3,7 +3,7 @@ import * as THREE from 'three';
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { UseBoundStore } from 'zustand';
|
|
5
5
|
import * as ReactThreeFiber from '../three-types';
|
|
6
|
-
import { Renderer, context, RootState, Size, Dpr, Performance } from './store';
|
|
6
|
+
import { Renderer, context, RootState, Size, Dpr, Performance, PrivateKeys } from './store';
|
|
7
7
|
import { extend, Root } from './renderer';
|
|
8
8
|
import { addEffect, addAfterEffect, addTail } from './loop';
|
|
9
9
|
import { EventManager, ComputeFunction } from './events';
|
|
@@ -42,7 +42,7 @@ export declare type ReconcilerRoot<TCanvas extends Element> = {
|
|
|
42
42
|
declare function createRoot<TCanvas extends Element>(canvas: TCanvas): ReconcilerRoot<TCanvas>;
|
|
43
43
|
declare function render<TCanvas extends Element>(children: React.ReactNode, canvas: TCanvas, config: RenderProps<TCanvas>): UseBoundStore<RootState>;
|
|
44
44
|
declare function unmountComponentAtNode<TElement extends Element>(canvas: TElement, callback?: (canvas: TElement) => void): void;
|
|
45
|
-
export declare type InjectState = Partial<Omit<RootState,
|
|
45
|
+
export declare type InjectState = Partial<Omit<RootState, PrivateKeys> & {
|
|
46
46
|
events?: {
|
|
47
47
|
enabled?: boolean;
|
|
48
48
|
priority?: number;
|
|
@@ -3,6 +3,8 @@ import * as React from 'react';
|
|
|
3
3
|
import { GetState, SetState, StoreApi, UseBoundStore } from 'zustand';
|
|
4
4
|
import { DomEvent, EventManager, PointerCaptureTarget, ThreeEvent } from './events';
|
|
5
5
|
import { Camera } from './utils';
|
|
6
|
+
export declare const privateKeys: readonly ["set", "get", "setSize", "setFrameloop", "setDpr", "events", "invalidate", "advance", "size", "viewport"];
|
|
7
|
+
export declare type PrivateKeys = typeof privateKeys[number];
|
|
6
8
|
export interface Intersection extends THREE.Intersection {
|
|
7
9
|
eventObject: THREE.Object3D;
|
|
8
10
|
}
|
|
@@ -14,6 +14,7 @@ export declare type UnblockProps = {
|
|
|
14
14
|
export declare function Block({ set }: Omit<UnblockProps, 'children'>): null;
|
|
15
15
|
export declare class ErrorBoundary extends React.Component<{
|
|
16
16
|
set: React.Dispatch<any>;
|
|
17
|
+
children: React.ReactNode;
|
|
17
18
|
}, {
|
|
18
19
|
error: boolean;
|
|
19
20
|
}> {
|
|
@@ -47,11 +48,6 @@ export declare type ObjectMap = {
|
|
|
47
48
|
};
|
|
48
49
|
export declare function calculateDpr(dpr: Dpr): number;
|
|
49
50
|
export declare const getRootState: (obj: THREE.Object3D) => RootState | undefined;
|
|
50
|
-
export declare function filterKeys<TObj extends {
|
|
51
|
-
[key: string]: any;
|
|
52
|
-
}, TOmit extends boolean, TKey extends keyof TObj>(obj: TObj, omit: TOmit, ...keys: TKey[]): TOmit extends true ? Omit<TObj, TKey> : Pick<TObj, TKey>;
|
|
53
|
-
export declare const pick: <TObj>(obj: Partial<TObj>, keys: (keyof TObj)[]) => Pick<Partial<TObj>, keyof TObj>;
|
|
54
|
-
export declare const omit: <TObj>(obj: Partial<TObj>, keys: (keyof TObj)[]) => Omit<Partial<TObj>, keyof TObj>;
|
|
55
51
|
export declare type EquConfig = {
|
|
56
52
|
arrays?: 'reference' | 'shallow';
|
|
57
53
|
objects?: 'reference' | 'shallow';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { View, ViewProps, ViewStyle } from 'react-native';
|
|
3
3
|
import { RenderProps } from '../core';
|
|
4
|
-
export interface Props extends Omit<RenderProps<HTMLCanvasElement>, 'size'>, ViewProps {
|
|
4
|
+
export interface Props extends Omit<RenderProps<HTMLCanvasElement>, 'size' | 'dpr'>, ViewProps {
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
style?: ViewStyle;
|
|
7
7
|
}
|
|
@@ -21,7 +21,7 @@ export interface NodeProps<T, P> {
|
|
|
21
21
|
attach?: AttachType;
|
|
22
22
|
args?: Args<P>;
|
|
23
23
|
children?: React.ReactNode;
|
|
24
|
-
ref?: React.
|
|
24
|
+
ref?: React.Ref<T>;
|
|
25
25
|
key?: React.Key;
|
|
26
26
|
onUpdate?: (self: T) => void;
|
|
27
27
|
}
|
|
@@ -102,6 +102,7 @@ export declare type ConeGeometryProps = BufferGeometryNode<THREE.ConeGeometry, t
|
|
|
102
102
|
export declare type CylinderGeometryProps = BufferGeometryNode<THREE.CylinderGeometry, typeof THREE.CylinderGeometry>;
|
|
103
103
|
export declare type CircleGeometryProps = BufferGeometryNode<THREE.CircleGeometry, typeof THREE.CircleGeometry>;
|
|
104
104
|
export declare type BoxGeometryProps = BufferGeometryNode<THREE.BoxGeometry, typeof THREE.BoxGeometry>;
|
|
105
|
+
export declare type CapsuleGeometryProps = BufferGeometryNode<THREE.CapsuleBufferGeometry, typeof THREE.CapsuleBufferGeometry>;
|
|
105
106
|
export declare type MaterialProps = MaterialNode<THREE.Material, [THREE.MaterialParameters]>;
|
|
106
107
|
export declare type ShadowMaterialProps = MaterialNode<THREE.ShadowMaterial, [THREE.ShaderMaterialParameters]>;
|
|
107
108
|
export declare type SpriteMaterialProps = MaterialNode<THREE.SpriteMaterial, [THREE.SpriteMaterialParameters]>;
|
|
@@ -245,6 +246,7 @@ declare global {
|
|
|
245
246
|
cylinderGeometry: CylinderGeometryProps;
|
|
246
247
|
circleGeometry: CircleGeometryProps;
|
|
247
248
|
boxGeometry: BoxGeometryProps;
|
|
249
|
+
capsuleGeometry: CapsuleGeometryProps;
|
|
248
250
|
material: MaterialProps;
|
|
249
251
|
shadowMaterial: ShadowMaterialProps;
|
|
250
252
|
spriteMaterial: SpriteMaterialProps;
|
|
@@ -19,14 +19,12 @@ function _interopNamespace(e) {
|
|
|
19
19
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
20
20
|
Object.defineProperty(n, k, d.get ? d : {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () {
|
|
23
|
-
return e[k];
|
|
24
|
-
}
|
|
22
|
+
get: function () { return e[k]; }
|
|
25
23
|
});
|
|
26
24
|
}
|
|
27
25
|
});
|
|
28
26
|
}
|
|
29
|
-
n[
|
|
27
|
+
n["default"] = e;
|
|
30
28
|
return Object.freeze(n);
|
|
31
29
|
}
|
|
32
30
|
|
|
@@ -95,29 +93,6 @@ const getRootState = obj => {
|
|
|
95
93
|
|
|
96
94
|
return (_r3f = obj.__r3f) == null ? void 0 : _r3f.root.getState();
|
|
97
95
|
};
|
|
98
|
-
/**
|
|
99
|
-
* Picks or omits keys from an object
|
|
100
|
-
* `omit` will filter out keys, and otherwise cherry-pick them.
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
|
-
function filterKeys(obj, omit, ...keys) {
|
|
104
|
-
const keysToSelect = new Set(keys);
|
|
105
|
-
return Object.entries(obj).reduce((acc, [key, value]) => {
|
|
106
|
-
const shouldInclude = !omit;
|
|
107
|
-
if (keysToSelect.has(key) === shouldInclude) acc[key] = value;
|
|
108
|
-
return acc;
|
|
109
|
-
}, {});
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Clones an object and cherry-picks keys.
|
|
113
|
-
*/
|
|
114
|
-
|
|
115
|
-
const pick = (obj, keys) => filterKeys(obj, false, ...keys);
|
|
116
|
-
/**
|
|
117
|
-
* Clones an object and prunes or omits keys.
|
|
118
|
-
*/
|
|
119
|
-
|
|
120
|
-
const omit = (obj, keys) => filterKeys(obj, true, ...keys);
|
|
121
96
|
// A collection of compare functions
|
|
122
97
|
const is = {
|
|
123
98
|
obj: a => a === Object(a) && !is.arr(a) && typeof a !== 'function',
|
|
@@ -253,7 +228,10 @@ function detach(parent, child, type) {
|
|
|
253
228
|
target,
|
|
254
229
|
key
|
|
255
230
|
} = resolve(parent, type);
|
|
256
|
-
|
|
231
|
+
const previous = child.__r3f.previousAttach; // When the previous value was undefined, it means the value was never set to begin with
|
|
232
|
+
|
|
233
|
+
if (previous === undefined) delete target[key]; // Otherwise set the previous value
|
|
234
|
+
else target[key] = previous;
|
|
257
235
|
} else (_child$__r3f = child.__r3f) == null ? void 0 : _child$__r3f.previousAttach == null ? void 0 : _child$__r3f.previousAttach(parent, child);
|
|
258
236
|
|
|
259
237
|
(_child$__r3f2 = child.__r3f) == null ? true : delete _child$__r3f2.previousAttach;
|
|
@@ -343,12 +321,16 @@ function applyProps$1(instance, data) {
|
|
|
343
321
|
|
|
344
322
|
if (value === DEFAULT + 'remove') {
|
|
345
323
|
if (targetProp && targetProp.constructor) {
|
|
324
|
+
var _memoized$args;
|
|
325
|
+
|
|
346
326
|
// use the prop constructor to find the default it should be
|
|
347
|
-
value = new targetProp.constructor(...memoized.args);
|
|
327
|
+
value = new targetProp.constructor(...((_memoized$args = memoized.args) != null ? _memoized$args : []));
|
|
348
328
|
} else if (currentInstance.constructor) {
|
|
329
|
+
var _currentInstance$__r;
|
|
330
|
+
|
|
349
331
|
// create a blank slate of the instance and copy the particular parameter.
|
|
350
332
|
// @ts-ignore
|
|
351
|
-
const defaultClassCall = new currentInstance.constructor(...currentInstance.__r3f.memoizedProps.args);
|
|
333
|
+
const defaultClassCall = new currentInstance.constructor(...((_currentInstance$__r = currentInstance.__r3f.memoizedProps.args) != null ? _currentInstance$__r : []));
|
|
352
334
|
value = defaultClassCall[targetProp]; // destory the instance
|
|
353
335
|
|
|
354
336
|
if (defaultClassCall.dispose) defaultClassCall.dispose(); // instance does not have constructor, just set it to 0
|
|
@@ -363,35 +345,35 @@ function applyProps$1(instance, data) {
|
|
|
363
345
|
localState.eventCount = Object.keys(localState.handlers).length;
|
|
364
346
|
} // Special treatment for objects with support for set/copy, and layers
|
|
365
347
|
else if (targetProp && targetProp.set && (targetProp.copy || targetProp instanceof THREE__namespace.Layers)) {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
// https://github.com/pmndrs/react-three-fiber/issues/344
|
|
382
|
-
|
|
383
|
-
const supportsColorManagement = THREE__namespace.ColorManagement;
|
|
384
|
-
if (!supportsColorManagement && !rootState.linear && isColor) targetProp.convertSRGBToLinear();
|
|
385
|
-
} // Else, just overwrite the value
|
|
386
|
-
|
|
387
|
-
} else {
|
|
388
|
-
currentInstance[key] = value; // Auto-convert sRGB textures, for now ...
|
|
348
|
+
// If value is an array
|
|
349
|
+
if (Array.isArray(value)) {
|
|
350
|
+
if (targetProp.fromArray) targetProp.fromArray(value);else targetProp.set(...value);
|
|
351
|
+
} // Test again target.copy(class) next ...
|
|
352
|
+
else if (targetProp.copy && value && value.constructor && targetProp.constructor.name === value.constructor.name) {
|
|
353
|
+
targetProp.copy(value);
|
|
354
|
+
} // If nothing else fits, just set the single value, ignore undefined
|
|
355
|
+
// https://github.com/pmndrs/react-three-fiber/issues/274
|
|
356
|
+
else if (value !== undefined) {
|
|
357
|
+
const isColor = targetProp instanceof THREE__namespace.Color; // Allow setting array scalars
|
|
358
|
+
|
|
359
|
+
if (!isColor && targetProp.setScalar) targetProp.setScalar(value); // Layers have no copy function, we must therefore copy the mask property
|
|
360
|
+
else if (targetProp instanceof THREE__namespace.Layers && value instanceof THREE__namespace.Layers) targetProp.mask = value.mask; // Otherwise just set ...
|
|
361
|
+
else targetProp.set(value); // For versions of three which don't support THREE.ColorManagement,
|
|
362
|
+
// Auto-convert sRGB colors
|
|
389
363
|
// https://github.com/pmndrs/react-three-fiber/issues/344
|
|
390
364
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
365
|
+
const supportsColorManagement = THREE__namespace.ColorManagement;
|
|
366
|
+
if (!supportsColorManagement && !rootState.linear && isColor) targetProp.convertSRGBToLinear();
|
|
367
|
+
} // Else, just overwrite the value
|
|
368
|
+
|
|
369
|
+
} else {
|
|
370
|
+
currentInstance[key] = value; // Auto-convert sRGB textures, for now ...
|
|
371
|
+
// https://github.com/pmndrs/react-three-fiber/issues/344
|
|
372
|
+
|
|
373
|
+
if (!rootState.linear && currentInstance[key] instanceof THREE__namespace.Texture) {
|
|
374
|
+
currentInstance[key].encoding = THREE__namespace.sRGBEncoding;
|
|
394
375
|
}
|
|
376
|
+
}
|
|
395
377
|
|
|
396
378
|
invalidateInstance(instance);
|
|
397
379
|
});
|
|
@@ -1075,7 +1057,7 @@ function createRenderer(roots, getEventPriority) {
|
|
|
1075
1057
|
});
|
|
1076
1058
|
}
|
|
1077
1059
|
|
|
1078
|
-
const reconciler = Reconciler__default[
|
|
1060
|
+
const reconciler = Reconciler__default["default"]({
|
|
1079
1061
|
createInstance,
|
|
1080
1062
|
removeChild,
|
|
1081
1063
|
appendChild,
|
|
@@ -1160,7 +1142,6 @@ function createRenderer(roots, getEventPriority) {
|
|
|
1160
1142
|
shouldSetTextContent: () => false,
|
|
1161
1143
|
clearContainer: () => false,
|
|
1162
1144
|
detachDeletedInstance: () => {},
|
|
1163
|
-
createTextInstance: () => {},
|
|
1164
1145
|
|
|
1165
1146
|
hideInstance(instance) {
|
|
1166
1147
|
var _instance$__r3f5;
|
|
@@ -1188,10 +1169,11 @@ function createRenderer(roots, getEventPriority) {
|
|
|
1188
1169
|
invalidateInstance(instance);
|
|
1189
1170
|
},
|
|
1190
1171
|
|
|
1172
|
+
createTextInstance: () => {},
|
|
1191
1173
|
hideTextInstance: () => {
|
|
1192
1174
|
throw new Error('Text is not allowed in the R3F tree.');
|
|
1193
1175
|
},
|
|
1194
|
-
|
|
1176
|
+
unhideTextInstance: () => {},
|
|
1195
1177
|
getCurrentEventPriority: () => getEventPriority ? getEventPriority() : constants.DefaultEventPriority,
|
|
1196
1178
|
// @ts-ignore
|
|
1197
1179
|
now: typeof performance !== 'undefined' && is.fun(performance.now) ? performance.now : is.fun(Date.now) ? Date.now : undefined,
|
|
@@ -1208,11 +1190,12 @@ function createRenderer(roots, getEventPriority) {
|
|
|
1208
1190
|
};
|
|
1209
1191
|
}
|
|
1210
1192
|
|
|
1193
|
+
const privateKeys = ['set', 'get', 'setSize', 'setFrameloop', 'setDpr', 'events', 'invalidate', 'advance', 'size', 'viewport'];
|
|
1211
1194
|
const isRenderer = def => !!(def != null && def.render);
|
|
1212
1195
|
const context = /*#__PURE__*/React__namespace.createContext(null);
|
|
1213
1196
|
|
|
1214
1197
|
const createStore = (invalidate, advance) => {
|
|
1215
|
-
const rootState = create__default[
|
|
1198
|
+
const rootState = create__default["default"]((set, get) => {
|
|
1216
1199
|
const position = new THREE__namespace.Vector3();
|
|
1217
1200
|
const defaultTarget = new THREE__namespace.Vector3();
|
|
1218
1201
|
const tempTarget = new THREE__namespace.Vector3();
|
|
@@ -1960,29 +1943,28 @@ function Portal({
|
|
|
1960
1943
|
const previousRoot = useStore();
|
|
1961
1944
|
const [raycaster] = React__namespace.useState(() => new THREE__namespace.Raycaster());
|
|
1962
1945
|
const [pointer] = React__namespace.useState(() => new THREE__namespace.Vector2());
|
|
1963
|
-
const inject = React__namespace.useCallback((
|
|
1964
|
-
const intersect = { ...
|
|
1965
|
-
};
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
}
|
|
1976
|
-
}
|
|
1977
|
-
|
|
1946
|
+
const inject = React__namespace.useCallback((rootState, injectState) => {
|
|
1947
|
+
const intersect = { ...rootState
|
|
1948
|
+
}; // all prev state props
|
|
1949
|
+
// Only the fields of "rootState" that do not differ from injectState
|
|
1950
|
+
// Some props should be off-limits
|
|
1951
|
+
// Otherwise filter out the props that are different and let the inject layer take precedence
|
|
1952
|
+
|
|
1953
|
+
Object.keys(rootState).forEach(key => {
|
|
1954
|
+
if ( // Some props should be off-limits
|
|
1955
|
+
privateKeys.includes(key) || // Otherwise filter out the props that are different and let the inject layer take precedence
|
|
1956
|
+
rootState[key] !== injectState[key]) {
|
|
1957
|
+
delete intersect[key];
|
|
1958
|
+
}
|
|
1959
|
+
});
|
|
1978
1960
|
let viewport = undefined;
|
|
1979
1961
|
|
|
1980
1962
|
if (injectState && size) {
|
|
1981
1963
|
const camera = injectState.camera; // Calculate the override viewport, if present
|
|
1982
1964
|
|
|
1983
|
-
viewport =
|
|
1965
|
+
viewport = rootState.viewport.getCurrentViewport(camera, new THREE__namespace.Vector3(), size); // Update the portal camera, if it differs from the previous layer
|
|
1984
1966
|
|
|
1985
|
-
if (camera !==
|
|
1967
|
+
if (camera !== rootState.camera) updateCamera(camera, size);
|
|
1986
1968
|
}
|
|
1987
1969
|
|
|
1988
1970
|
return { // The intersect consists of the previous root state
|
|
@@ -1995,14 +1977,14 @@ function Portal({
|
|
|
1995
1977
|
// Their previous root is the layer before it
|
|
1996
1978
|
previousRoot,
|
|
1997
1979
|
// Events, size and viewport can be overridden by the inject layer
|
|
1998
|
-
events: { ...
|
|
1980
|
+
events: { ...rootState.events,
|
|
1999
1981
|
...(injectState == null ? void 0 : injectState.events),
|
|
2000
1982
|
...events
|
|
2001
1983
|
},
|
|
2002
|
-
size: { ...
|
|
1984
|
+
size: { ...rootState.size,
|
|
2003
1985
|
...size
|
|
2004
1986
|
},
|
|
2005
|
-
viewport: { ...
|
|
1987
|
+
viewport: { ...rootState.viewport,
|
|
2006
1988
|
...viewport
|
|
2007
1989
|
},
|
|
2008
1990
|
...rest
|
|
@@ -2010,9 +1992,20 @@ function Portal({
|
|
|
2010
1992
|
}, [state]);
|
|
2011
1993
|
const [usePortalStore] = React__namespace.useState(() => {
|
|
2012
1994
|
// Create a mirrored store, based on the previous root with a few overrides ...
|
|
2013
|
-
new THREE__namespace.Vector3();
|
|
2014
1995
|
const previousState = previousRoot.getState();
|
|
2015
|
-
const store = create__default[
|
|
1996
|
+
const store = create__default["default"]((set, get) => ({ ...previousState,
|
|
1997
|
+
scene: container,
|
|
1998
|
+
raycaster,
|
|
1999
|
+
pointer,
|
|
2000
|
+
mouse: pointer,
|
|
2001
|
+
previousRoot,
|
|
2002
|
+
events: { ...previousState.events,
|
|
2003
|
+
...events
|
|
2004
|
+
},
|
|
2005
|
+
size: { ...previousState.size,
|
|
2006
|
+
...size
|
|
2007
|
+
},
|
|
2008
|
+
...rest,
|
|
2016
2009
|
// Set and get refer to this root-state
|
|
2017
2010
|
set,
|
|
2018
2011
|
get,
|
|
@@ -2064,8 +2057,6 @@ exports.dispose = dispose;
|
|
|
2064
2057
|
exports.extend = extend;
|
|
2065
2058
|
exports.getRootState = getRootState;
|
|
2066
2059
|
exports.invalidate = invalidate;
|
|
2067
|
-
exports.omit = omit;
|
|
2068
|
-
exports.pick = pick;
|
|
2069
2060
|
exports.reconciler = reconciler;
|
|
2070
2061
|
exports.render = render;
|
|
2071
2062
|
exports.roots = roots;
|