@react-three/fiber 8.2.1 → 8.2.2
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 +6 -0
- package/dist/declarations/src/core/index.d.ts +1 -1
- package/dist/declarations/src/core/renderer.d.ts +1 -1
- package/dist/{index-6716e497.cjs.dev.js → index-2a5b06d3.cjs.dev.js} +16 -10
- package/dist/{index-8296e46a.cjs.prod.js → index-876a6569.cjs.prod.js} +16 -10
- package/dist/{index-2e68c2a1.esm.js → index-af244448.esm.js} +16 -10
- package/dist/react-three-fiber.cjs.dev.js +1 -1
- package/dist/react-three-fiber.cjs.prod.js +1 -1
- package/dist/react-three-fiber.esm.js +2 -2
- package/native/dist/react-three-fiber-native.cjs.dev.js +1 -1
- package/native/dist/react-three-fiber-native.cjs.prod.js +1 -1
- package/native/dist/react-three-fiber-native.esm.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,7 +10,7 @@ import { EventManager, ComputeFunction } from './events';
|
|
|
10
10
|
import { dispose, getRootState, Camera } from './utils';
|
|
11
11
|
declare const roots: Map<Element, Root>;
|
|
12
12
|
declare const invalidate: (state?: RootState | undefined, frames?: number) => void, advance: (timestamp: number, runGlobalEffects?: boolean, state?: RootState | undefined, frame?: THREE.XRFrame | undefined) => void;
|
|
13
|
-
declare const reconciler: import("react-reconciler").Reconciler<UseBoundStore<RootState, import("zustand").StoreApi<RootState>>, import("./renderer").Instance,
|
|
13
|
+
declare const reconciler: import("react-reconciler").Reconciler<UseBoundStore<RootState, import("zustand").StoreApi<RootState>>, import("./renderer").Instance, void, import("./renderer").Instance, import("./renderer").Instance>, applyProps: typeof import("./utils").applyProps;
|
|
14
14
|
declare type Properties<T> = Pick<T, {
|
|
15
15
|
[K in keyof T]: T[K] extends (_: any) => any ? never : K;
|
|
16
16
|
}[keyof T]>;
|
|
@@ -45,7 +45,7 @@ export declare type InstanceProps = {
|
|
|
45
45
|
};
|
|
46
46
|
declare let extend: (objects: object) => void;
|
|
47
47
|
declare function createRenderer<TCanvas>(_roots: Map<TCanvas, Root>, _getEventPriority?: () => any): {
|
|
48
|
-
reconciler: Reconciler.Reconciler<UseBoundStore<RootState, import("zustand").StoreApi<RootState>>, Instance,
|
|
48
|
+
reconciler: Reconciler.Reconciler<UseBoundStore<RootState, import("zustand").StoreApi<RootState>>, Instance, void, Instance, Instance>;
|
|
49
49
|
applyProps: typeof applyProps;
|
|
50
50
|
};
|
|
51
51
|
export { prepare, createRenderer, extend };
|
|
@@ -1070,7 +1070,10 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
1070
1070
|
}
|
|
1071
1071
|
}
|
|
1072
1072
|
});
|
|
1073
|
-
}
|
|
1073
|
+
} // Don't handle text instances, warn on undefined behavior
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
const handleTextInstance = () => console.warn('Text is not allowed in the R3F tree! This could be stray whitespace or characters.');
|
|
1074
1077
|
|
|
1075
1078
|
const reconciler = Reconciler__default["default"]({
|
|
1076
1079
|
createInstance,
|
|
@@ -1084,13 +1087,20 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
1084
1087
|
supportsHydration: false,
|
|
1085
1088
|
noTimeout: -1,
|
|
1086
1089
|
appendChildToContainer: (container, child) => {
|
|
1090
|
+
if (!child) return;
|
|
1087
1091
|
const scene = container.getState().scene; // Link current root to the default scene
|
|
1088
1092
|
|
|
1089
1093
|
scene.__r3f.root = container;
|
|
1090
1094
|
appendChild(scene, child);
|
|
1091
1095
|
},
|
|
1092
|
-
removeChildFromContainer: (container, child) =>
|
|
1093
|
-
|
|
1096
|
+
removeChildFromContainer: (container, child) => {
|
|
1097
|
+
if (!child) return;
|
|
1098
|
+
removeChild(container.getState().scene, child);
|
|
1099
|
+
},
|
|
1100
|
+
insertInContainerBefore: (container, child, beforeChild) => {
|
|
1101
|
+
if (!child || !beforeChild) return;
|
|
1102
|
+
insertBefore(container.getState().scene, child, beforeChild);
|
|
1103
|
+
},
|
|
1094
1104
|
getRootHostContext: () => null,
|
|
1095
1105
|
getChildHostContext: parentHostContext => parentHostContext,
|
|
1096
1106
|
|
|
@@ -1182,13 +1192,9 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
1182
1192
|
invalidateInstance(instance);
|
|
1183
1193
|
},
|
|
1184
1194
|
|
|
1185
|
-
createTextInstance:
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
hideTextInstance: () => {
|
|
1189
|
-
throw new Error('Text is not allowed in the R3F tree! This could be stray whitespace or characters.');
|
|
1190
|
-
},
|
|
1191
|
-
unhideTextInstance: () => {},
|
|
1195
|
+
createTextInstance: handleTextInstance,
|
|
1196
|
+
hideTextInstance: handleTextInstance,
|
|
1197
|
+
unhideTextInstance: handleTextInstance,
|
|
1192
1198
|
// https://github.com/pmndrs/react-three-fiber/pull/2360#discussion_r916356874
|
|
1193
1199
|
// @ts-ignore
|
|
1194
1200
|
getCurrentEventPriority: () => _getEventPriority ? _getEventPriority() : constants.DefaultEventPriority,
|
|
@@ -1070,7 +1070,10 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
1070
1070
|
}
|
|
1071
1071
|
}
|
|
1072
1072
|
});
|
|
1073
|
-
}
|
|
1073
|
+
} // Don't handle text instances, warn on undefined behavior
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
const handleTextInstance = () => console.warn('Text is not allowed in the R3F tree! This could be stray whitespace or characters.');
|
|
1074
1077
|
|
|
1075
1078
|
const reconciler = Reconciler__default["default"]({
|
|
1076
1079
|
createInstance,
|
|
@@ -1084,13 +1087,20 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
1084
1087
|
supportsHydration: false,
|
|
1085
1088
|
noTimeout: -1,
|
|
1086
1089
|
appendChildToContainer: (container, child) => {
|
|
1090
|
+
if (!child) return;
|
|
1087
1091
|
const scene = container.getState().scene; // Link current root to the default scene
|
|
1088
1092
|
|
|
1089
1093
|
scene.__r3f.root = container;
|
|
1090
1094
|
appendChild(scene, child);
|
|
1091
1095
|
},
|
|
1092
|
-
removeChildFromContainer: (container, child) =>
|
|
1093
|
-
|
|
1096
|
+
removeChildFromContainer: (container, child) => {
|
|
1097
|
+
if (!child) return;
|
|
1098
|
+
removeChild(container.getState().scene, child);
|
|
1099
|
+
},
|
|
1100
|
+
insertInContainerBefore: (container, child, beforeChild) => {
|
|
1101
|
+
if (!child || !beforeChild) return;
|
|
1102
|
+
insertBefore(container.getState().scene, child, beforeChild);
|
|
1103
|
+
},
|
|
1094
1104
|
getRootHostContext: () => null,
|
|
1095
1105
|
getChildHostContext: parentHostContext => parentHostContext,
|
|
1096
1106
|
|
|
@@ -1182,13 +1192,9 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
1182
1192
|
invalidateInstance(instance);
|
|
1183
1193
|
},
|
|
1184
1194
|
|
|
1185
|
-
createTextInstance:
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
hideTextInstance: () => {
|
|
1189
|
-
throw new Error('Text is not allowed in the R3F tree! This could be stray whitespace or characters.');
|
|
1190
|
-
},
|
|
1191
|
-
unhideTextInstance: () => {},
|
|
1195
|
+
createTextInstance: handleTextInstance,
|
|
1196
|
+
hideTextInstance: handleTextInstance,
|
|
1197
|
+
unhideTextInstance: handleTextInstance,
|
|
1192
1198
|
// https://github.com/pmndrs/react-three-fiber/pull/2360#discussion_r916356874
|
|
1193
1199
|
// @ts-ignore
|
|
1194
1200
|
getCurrentEventPriority: () => _getEventPriority ? _getEventPriority() : constants.DefaultEventPriority,
|
|
@@ -1043,7 +1043,10 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
1043
1043
|
}
|
|
1044
1044
|
}
|
|
1045
1045
|
});
|
|
1046
|
-
}
|
|
1046
|
+
} // Don't handle text instances, warn on undefined behavior
|
|
1047
|
+
|
|
1048
|
+
|
|
1049
|
+
const handleTextInstance = () => console.warn('Text is not allowed in the R3F tree! This could be stray whitespace or characters.');
|
|
1047
1050
|
|
|
1048
1051
|
const reconciler = Reconciler({
|
|
1049
1052
|
createInstance,
|
|
@@ -1057,13 +1060,20 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
1057
1060
|
supportsHydration: false,
|
|
1058
1061
|
noTimeout: -1,
|
|
1059
1062
|
appendChildToContainer: (container, child) => {
|
|
1063
|
+
if (!child) return;
|
|
1060
1064
|
const scene = container.getState().scene; // Link current root to the default scene
|
|
1061
1065
|
|
|
1062
1066
|
scene.__r3f.root = container;
|
|
1063
1067
|
appendChild(scene, child);
|
|
1064
1068
|
},
|
|
1065
|
-
removeChildFromContainer: (container, child) =>
|
|
1066
|
-
|
|
1069
|
+
removeChildFromContainer: (container, child) => {
|
|
1070
|
+
if (!child) return;
|
|
1071
|
+
removeChild(container.getState().scene, child);
|
|
1072
|
+
},
|
|
1073
|
+
insertInContainerBefore: (container, child, beforeChild) => {
|
|
1074
|
+
if (!child || !beforeChild) return;
|
|
1075
|
+
insertBefore(container.getState().scene, child, beforeChild);
|
|
1076
|
+
},
|
|
1067
1077
|
getRootHostContext: () => null,
|
|
1068
1078
|
getChildHostContext: parentHostContext => parentHostContext,
|
|
1069
1079
|
|
|
@@ -1155,13 +1165,9 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
1155
1165
|
invalidateInstance(instance);
|
|
1156
1166
|
},
|
|
1157
1167
|
|
|
1158
|
-
createTextInstance:
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
hideTextInstance: () => {
|
|
1162
|
-
throw new Error('Text is not allowed in the R3F tree! This could be stray whitespace or characters.');
|
|
1163
|
-
},
|
|
1164
|
-
unhideTextInstance: () => {},
|
|
1168
|
+
createTextInstance: handleTextInstance,
|
|
1169
|
+
hideTextInstance: handleTextInstance,
|
|
1170
|
+
unhideTextInstance: handleTextInstance,
|
|
1165
1171
|
// https://github.com/pmndrs/react-three-fiber/pull/2360#discussion_r916356874
|
|
1166
1172
|
// @ts-ignore
|
|
1167
1173
|
getCurrentEventPriority: () => _getEventPriority ? _getEventPriority() : DefaultEventPriority,
|
|
@@ -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-2a5b06d3.cjs.dev.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -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-876a6569.cjs.prod.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as createEvents, e as extend, u as useMutableCallback, a as createRoot, E as ErrorBoundary, B as Block, b as useIsomorphicLayoutEffect, d as unmountComponentAtNode } from './index-
|
|
2
|
-
export { t as ReactThreeFiber, s as _roots, q as act, n as addAfterEffect, m as addEffect, o as addTail, l as advance, i as applyProps, f as context, c as createEvents, g as createPortal, a as createRoot, j as dispose, e as extend, p as getRootState, k as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, x as useFrame, y as useGraph, z as useLoader, v as useStore, w as useThree } from './index-
|
|
1
|
+
import { c as createEvents, e as extend, u as useMutableCallback, a as createRoot, E as ErrorBoundary, B as Block, b as useIsomorphicLayoutEffect, d as unmountComponentAtNode } from './index-af244448.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, s as _roots, q as act, n as addAfterEffect, m as addEffect, o as addTail, l as advance, i as applyProps, f as context, c as createEvents, g as createPortal, a as createRoot, j as dispose, e as extend, p as getRootState, k as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, x as useFrame, y as useGraph, z as useLoader, v as useStore, w as useThree } from './index-af244448.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';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('../../dist/index-
|
|
5
|
+
var index = require('../../dist/index-2a5b06d3.cjs.dev.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('../../dist/index-
|
|
5
|
+
var index = require('../../dist/index-876a6569.cjs.prod.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as createEvents, e as extend, u as useMutableCallback, a as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from '../../dist/index-
|
|
2
|
-
export { t as ReactThreeFiber, s as _roots, q as act, n as addAfterEffect, m as addEffect, o as addTail, l as advance, i as applyProps, f as context, g as createPortal, a as createRoot, j as dispose, e as extend, p as getRootState, k as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, x as useFrame, y as useGraph, z as useLoader, v as useStore, w as useThree } from '../../dist/index-
|
|
1
|
+
import { c as createEvents, e as extend, u as useMutableCallback, a as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from '../../dist/index-af244448.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, s as _roots, q as act, n as addAfterEffect, m as addEffect, o as addTail, l as advance, i as applyProps, f as context, g as createPortal, a as createRoot, j as dispose, e as extend, p as getRootState, k as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, x as useFrame, y as useGraph, z as useLoader, v as useStore, w as useThree } from '../../dist/index-af244448.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';
|