@react-three/fiber 8.0.5 → 8.0.8
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 +69 -69
- package/dist/declarations/src/core/hooks.d.ts +21 -25
- package/dist/declarations/src/core/index.d.ts +56 -42
- package/dist/declarations/src/core/loop.d.ts +13 -13
- package/dist/declarations/src/core/renderer.d.ts +51 -51
- package/dist/declarations/src/core/store.d.ts +91 -108
- package/dist/declarations/src/core/utils.d.ts +83 -57
- package/dist/declarations/src/index.d.ts +10 -10
- package/dist/declarations/src/native/Canvas.d.ts +8 -13
- package/dist/declarations/src/native/events.d.ts +4 -5
- package/dist/declarations/src/native.d.ts +10 -10
- package/dist/declarations/src/three-types.d.ts +327 -327
- package/dist/declarations/src/web/Canvas.d.ts +9 -13
- package/dist/declarations/src/web/events.d.ts +4 -4
- package/dist/{index-635ddfb2.esm.js → index-548cf96a.esm.js} +126 -24
- package/dist/{index-28a77253.cjs.dev.js → index-b8ee55f0.cjs.dev.js} +128 -23
- package/dist/{index-1ff856c3.cjs.prod.js → index-c4e0ac66.cjs.prod.js} +128 -23
- package/dist/react-three-fiber.cjs.dev.js +13 -41
- package/dist/react-three-fiber.cjs.prod.js +13 -41
- package/dist/react-three-fiber.esm.js +12 -39
- package/native/dist/react-three-fiber-native.cjs.dev.js +9 -37
- package/native/dist/react-three-fiber-native.cjs.prod.js +9 -37
- package/native/dist/react-three-fiber-native.esm.js +8 -35
- package/package.json +1 -1
|
@@ -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-c4e0ac66.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');
|
|
@@ -62,6 +62,8 @@ const DOM_EVENTS = {
|
|
|
62
62
|
[EVENTS.HOVEROUT]: 'onPointerOut',
|
|
63
63
|
[EVENTS.PRESSMOVE]: 'onPointerMove'
|
|
64
64
|
};
|
|
65
|
+
/** Default R3F event manager for react-native */
|
|
66
|
+
|
|
65
67
|
function createTouchEvents(store) {
|
|
66
68
|
const {
|
|
67
69
|
handlePointer
|
|
@@ -126,42 +128,13 @@ function createTouchEvents(store) {
|
|
|
126
128
|
}
|
|
127
129
|
|
|
128
130
|
const CANVAS_PROPS = ['gl', 'events', 'shadows', 'linear', 'flat', 'legacy', 'orthographic', 'frameloop', 'performance', 'raycaster', 'camera', 'onPointerMissed', 'onCreated'];
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
React__namespace.useLayoutEffect(() => {
|
|
134
|
-
set(new Promise(() => null));
|
|
135
|
-
return () => set(false);
|
|
136
|
-
}, [set]);
|
|
137
|
-
return null;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
class ErrorBoundary extends React__namespace.Component {
|
|
141
|
-
constructor(...args) {
|
|
142
|
-
super(...args);
|
|
143
|
-
this.state = {
|
|
144
|
-
error: false
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
componentDidCatch(error) {
|
|
149
|
-
this.props.set(error);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
render() {
|
|
153
|
-
return this.state.error ? null : this.props.children;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
ErrorBoundary.getDerivedStateFromError = () => ({
|
|
159
|
-
error: true
|
|
160
|
-
});
|
|
131
|
+
/**
|
|
132
|
+
* A native canvas which accepts threejs elements as children.
|
|
133
|
+
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
134
|
+
*/
|
|
161
135
|
|
|
162
136
|
const Canvas = /*#__PURE__*/React__namespace.forwardRef(({
|
|
163
137
|
children,
|
|
164
|
-
fallback,
|
|
165
138
|
style,
|
|
166
139
|
events,
|
|
167
140
|
...props
|
|
@@ -247,10 +220,10 @@ const Canvas = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
247
220
|
events: events || createTouchEvents,
|
|
248
221
|
onCreated
|
|
249
222
|
});
|
|
250
|
-
root.current.render( /*#__PURE__*/React__namespace.createElement(ErrorBoundary, {
|
|
223
|
+
root.current.render( /*#__PURE__*/React__namespace.createElement(index.ErrorBoundary, {
|
|
251
224
|
set: setError
|
|
252
225
|
}, /*#__PURE__*/React__namespace.createElement(React__namespace.Suspense, {
|
|
253
|
-
fallback: /*#__PURE__*/React__namespace.createElement(Block, {
|
|
226
|
+
fallback: /*#__PURE__*/React__namespace.createElement(index.Block, {
|
|
254
227
|
set: setBlock
|
|
255
228
|
})
|
|
256
229
|
}, children)));
|
|
@@ -376,7 +349,6 @@ exports.unmountComponentAtNode = index.unmountComponentAtNode;
|
|
|
376
349
|
exports.useFrame = index.useFrame;
|
|
377
350
|
exports.useGraph = index.useGraph;
|
|
378
351
|
exports.useLoader = index.useLoader;
|
|
379
|
-
exports.useMemoizedFn = index.useMemoizedFn;
|
|
380
352
|
exports.useStore = index.useStore;
|
|
381
353
|
exports.useThree = index.useThree;
|
|
382
354
|
exports.Canvas = Canvas;
|
|
@@ -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,
|
|
4
|
-
export { t as ReactThreeFiber,
|
|
3
|
+
import { c as createEvents, e as extend, u as useMemoizedFn, p as pick, o as omit, a as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from '../../dist/index-548cf96a.esm.js';
|
|
4
|
+
export { t as ReactThreeFiber, w as _roots, v as act, n as addAfterEffect, m as addEffect, q as addTail, l as advance, i as applyProps, f as context, g as createPortal, a as createRoot, j as dispose, e as extend, s as getRootState, k as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, z as useFrame, A as useGraph, C as useLoader, x as useStore, y as useThree } from '../../dist/index-548cf96a.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';
|
|
@@ -32,6 +32,8 @@ const DOM_EVENTS = {
|
|
|
32
32
|
[EVENTS.HOVEROUT]: 'onPointerOut',
|
|
33
33
|
[EVENTS.PRESSMOVE]: 'onPointerMove'
|
|
34
34
|
};
|
|
35
|
+
/** Default R3F event manager for react-native */
|
|
36
|
+
|
|
35
37
|
function createTouchEvents(store) {
|
|
36
38
|
const {
|
|
37
39
|
handlePointer
|
|
@@ -96,42 +98,13 @@ function createTouchEvents(store) {
|
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
const CANVAS_PROPS = ['gl', 'events', 'shadows', 'linear', 'flat', 'legacy', 'orthographic', 'frameloop', 'performance', 'raycaster', 'camera', 'onPointerMissed', 'onCreated'];
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
React.useLayoutEffect(() => {
|
|
104
|
-
set(new Promise(() => null));
|
|
105
|
-
return () => set(false);
|
|
106
|
-
}, [set]);
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
class ErrorBoundary extends React.Component {
|
|
111
|
-
constructor(...args) {
|
|
112
|
-
super(...args);
|
|
113
|
-
this.state = {
|
|
114
|
-
error: false
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
componentDidCatch(error) {
|
|
119
|
-
this.props.set(error);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
render() {
|
|
123
|
-
return this.state.error ? null : this.props.children;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
ErrorBoundary.getDerivedStateFromError = () => ({
|
|
129
|
-
error: true
|
|
130
|
-
});
|
|
101
|
+
/**
|
|
102
|
+
* A native canvas which accepts threejs elements as children.
|
|
103
|
+
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
104
|
+
*/
|
|
131
105
|
|
|
132
106
|
const Canvas = /*#__PURE__*/React.forwardRef(({
|
|
133
107
|
children,
|
|
134
|
-
fallback,
|
|
135
108
|
style,
|
|
136
109
|
events,
|
|
137
110
|
...props
|