@react-three/fiber 8.15.12 → 8.15.14
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 +919 -907
- package/dist/declarations/src/core/events.d.ts +93 -93
- package/dist/declarations/src/core/hooks.d.ts +57 -57
- package/dist/declarations/src/core/index.d.ts +87 -87
- package/dist/declarations/src/core/loop.d.ts +33 -33
- package/dist/declarations/src/core/renderer.d.ts +58 -58
- package/dist/declarations/src/core/store.d.ts +137 -137
- package/dist/declarations/src/core/utils.d.ts +130 -125
- package/dist/declarations/src/index.d.ts +12 -12
- package/dist/declarations/src/native/Canvas.d.ts +14 -14
- package/dist/declarations/src/native/events.d.ts +5 -5
- package/dist/declarations/src/native/polyfills.d.ts +1 -1
- package/dist/declarations/src/native.d.ts +12 -12
- package/dist/declarations/src/three-types.d.ts +392 -392
- package/dist/declarations/src/web/Canvas.d.ts +24 -24
- package/dist/declarations/src/web/events.d.ts +5 -5
- package/dist/{index-5bde93f1.esm.js → index-29b7121b.esm.js} +97 -85
- package/dist/{index-e9909912.cjs.dev.js → index-54c0bb16.cjs.dev.js} +97 -85
- package/dist/{index-710e63a4.cjs.prod.js → index-8eb7ac4a.cjs.prod.js} +97 -85
- package/dist/react-three-fiber.cjs.dev.js +4 -4
- package/dist/react-three-fiber.cjs.prod.js +4 -4
- package/dist/react-three-fiber.esm.js +5 -5
- package/native/dist/react-three-fiber-native.cjs.dev.js +15 -9
- package/native/dist/react-three-fiber-native.cjs.prod.js +15 -9
- package/native/dist/react-three-fiber-native.esm.js +16 -10
- package/native/package.json +5 -5
- package/package.json +1 -1
- package/readme.md +253 -253
|
@@ -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-54c0bb16.cjs.dev.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -251,9 +251,9 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
251
251
|
}, fallback)));
|
|
252
252
|
});
|
|
253
253
|
|
|
254
|
-
/**
|
|
255
|
-
* A DOM canvas which accepts threejs elements as children.
|
|
256
|
-
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
254
|
+
/**
|
|
255
|
+
* A DOM canvas which accepts threejs elements as children.
|
|
256
|
+
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
257
257
|
*/
|
|
258
258
|
const Canvas = /*#__PURE__*/React__namespace.forwardRef(function CanvasWrapper(props, ref) {
|
|
259
259
|
return /*#__PURE__*/React__namespace.createElement(itsFine.FiberProvider, null, /*#__PURE__*/React__namespace.createElement(CanvasImpl, _extends({}, props, {
|
|
@@ -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-8eb7ac4a.cjs.prod.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -251,9 +251,9 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
251
251
|
}, fallback)));
|
|
252
252
|
});
|
|
253
253
|
|
|
254
|
-
/**
|
|
255
|
-
* A DOM canvas which accepts threejs elements as children.
|
|
256
|
-
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
254
|
+
/**
|
|
255
|
+
* A DOM canvas which accepts threejs elements as children.
|
|
256
|
+
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
257
257
|
*/
|
|
258
258
|
const Canvas = /*#__PURE__*/React__namespace.forwardRef(function CanvasWrapper(props, ref) {
|
|
259
259
|
return /*#__PURE__*/React__namespace.createElement(itsFine.FiberProvider, null, /*#__PURE__*/React__namespace.createElement(CanvasImpl, _extends({}, props, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as createEvents, e as extend, u as useMutableCallback, a as useIsomorphicLayoutEffect, b as createRoot, i as isRef, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from './index-
|
|
2
|
-
export { t as ReactThreeFiber, x as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, w as buildGraph, f as context, c as createEvents, g as createPortal, b as createRoot, k as dispose, e as extend, q as flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, C as useFrame, D as useGraph, y as useInstanceHandle, F as useLoader, z as useStore, A as useThree } from './index-
|
|
1
|
+
import { c as createEvents, e as extend, u as useMutableCallback, a as useIsomorphicLayoutEffect, b as createRoot, i as isRef, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from './index-29b7121b.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, x as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, w as buildGraph, f as context, c as createEvents, g as createPortal, b as createRoot, k as dispose, e as extend, q as flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, C as useFrame, D as useGraph, y as useInstanceHandle, F as useLoader, z as useStore, A as useThree } from './index-29b7121b.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';
|
|
@@ -224,9 +224,9 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(function Canvas({
|
|
|
224
224
|
}, fallback)));
|
|
225
225
|
});
|
|
226
226
|
|
|
227
|
-
/**
|
|
228
|
-
* A DOM canvas which accepts threejs elements as children.
|
|
229
|
-
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
227
|
+
/**
|
|
228
|
+
* A DOM canvas which accepts threejs elements as children.
|
|
229
|
+
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
230
230
|
*/
|
|
231
231
|
const Canvas = /*#__PURE__*/React.forwardRef(function CanvasWrapper(props, ref) {
|
|
232
232
|
return /*#__PURE__*/React.createElement(FiberProvider, null, /*#__PURE__*/React.createElement(CanvasImpl, _extends({}, props, {
|
|
@@ -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-54c0bb16.cjs.dev.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -123,9 +123,9 @@ function createTouchEvents(store) {
|
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
/**
|
|
127
|
-
* A native canvas which accepts threejs elements as children.
|
|
128
|
-
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
126
|
+
/**
|
|
127
|
+
* A native canvas which accepts threejs elements as children.
|
|
128
|
+
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
129
129
|
*/
|
|
130
130
|
const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
131
131
|
children,
|
|
@@ -175,6 +175,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
175
175
|
if (error) throw error;
|
|
176
176
|
const viewRef = React__namespace.useRef(null);
|
|
177
177
|
const root = React__namespace.useRef(null);
|
|
178
|
+
const [antialias, setAntialias] = React__namespace.useState(true);
|
|
178
179
|
const onLayout = React__namespace.useCallback(e => {
|
|
179
180
|
const {
|
|
180
181
|
width,
|
|
@@ -200,7 +201,12 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
200
201
|
addEventListener: () => {},
|
|
201
202
|
removeEventListener: () => {},
|
|
202
203
|
clientHeight: context.drawingBufferHeight,
|
|
203
|
-
getContext: (
|
|
204
|
+
getContext: (_, {
|
|
205
|
+
antialias = false
|
|
206
|
+
}) => {
|
|
207
|
+
setAntialias(antialias);
|
|
208
|
+
return context;
|
|
209
|
+
}
|
|
204
210
|
};
|
|
205
211
|
root.current = index.createRoot(canvasShim);
|
|
206
212
|
setCanvas(canvasShim);
|
|
@@ -266,15 +272,15 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
266
272
|
...style
|
|
267
273
|
}
|
|
268
274
|
}, bind), width > 0 && /*#__PURE__*/React__namespace.createElement(expoGl.GLView, {
|
|
269
|
-
msaaSamples: 0,
|
|
275
|
+
msaaSamples: antialias ? 4 : 0,
|
|
270
276
|
onContextCreate: onContextCreate,
|
|
271
277
|
style: reactNative.StyleSheet.absoluteFill
|
|
272
278
|
}));
|
|
273
279
|
});
|
|
274
280
|
|
|
275
|
-
/**
|
|
276
|
-
* A native canvas which accepts threejs elements as children.
|
|
277
|
-
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
281
|
+
/**
|
|
282
|
+
* A native canvas which accepts threejs elements as children.
|
|
283
|
+
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
278
284
|
*/
|
|
279
285
|
const Canvas = /*#__PURE__*/React__namespace.forwardRef(function CanvasWrapper(props, ref) {
|
|
280
286
|
return /*#__PURE__*/React__namespace.createElement(itsFine.FiberProvider, null, /*#__PURE__*/React__namespace.createElement(CanvasImpl, _extends({}, props, {
|
|
@@ -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-8eb7ac4a.cjs.prod.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -123,9 +123,9 @@ function createTouchEvents(store) {
|
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
/**
|
|
127
|
-
* A native canvas which accepts threejs elements as children.
|
|
128
|
-
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
126
|
+
/**
|
|
127
|
+
* A native canvas which accepts threejs elements as children.
|
|
128
|
+
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
129
129
|
*/
|
|
130
130
|
const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
131
131
|
children,
|
|
@@ -175,6 +175,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
175
175
|
if (error) throw error;
|
|
176
176
|
const viewRef = React__namespace.useRef(null);
|
|
177
177
|
const root = React__namespace.useRef(null);
|
|
178
|
+
const [antialias, setAntialias] = React__namespace.useState(true);
|
|
178
179
|
const onLayout = React__namespace.useCallback(e => {
|
|
179
180
|
const {
|
|
180
181
|
width,
|
|
@@ -200,7 +201,12 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
200
201
|
addEventListener: () => {},
|
|
201
202
|
removeEventListener: () => {},
|
|
202
203
|
clientHeight: context.drawingBufferHeight,
|
|
203
|
-
getContext: (
|
|
204
|
+
getContext: (_, {
|
|
205
|
+
antialias = false
|
|
206
|
+
}) => {
|
|
207
|
+
setAntialias(antialias);
|
|
208
|
+
return context;
|
|
209
|
+
}
|
|
204
210
|
};
|
|
205
211
|
root.current = index.createRoot(canvasShim);
|
|
206
212
|
setCanvas(canvasShim);
|
|
@@ -266,15 +272,15 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
266
272
|
...style
|
|
267
273
|
}
|
|
268
274
|
}, bind), width > 0 && /*#__PURE__*/React__namespace.createElement(expoGl.GLView, {
|
|
269
|
-
msaaSamples: 0,
|
|
275
|
+
msaaSamples: antialias ? 4 : 0,
|
|
270
276
|
onContextCreate: onContextCreate,
|
|
271
277
|
style: reactNative.StyleSheet.absoluteFill
|
|
272
278
|
}));
|
|
273
279
|
});
|
|
274
280
|
|
|
275
|
-
/**
|
|
276
|
-
* A native canvas which accepts threejs elements as children.
|
|
277
|
-
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
281
|
+
/**
|
|
282
|
+
* A native canvas which accepts threejs elements as children.
|
|
283
|
+
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
278
284
|
*/
|
|
279
285
|
const Canvas = /*#__PURE__*/React__namespace.forwardRef(function CanvasWrapper(props, ref) {
|
|
280
286
|
return /*#__PURE__*/React__namespace.createElement(itsFine.FiberProvider, null, /*#__PURE__*/React__namespace.createElement(CanvasImpl, _extends({}, props, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as createEvents, e as extend, u as useMutableCallback, b as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from '../../dist/index-
|
|
2
|
-
export { t as ReactThreeFiber, x as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, w as buildGraph, f as context, c as createEvents, g as createPortal, b as createRoot, k as dispose, e as extend, q as flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, C as useFrame, D as useGraph, y as useInstanceHandle, F as useLoader, z as useStore, A as useThree } from '../../dist/index-
|
|
1
|
+
import { c as createEvents, e as extend, u as useMutableCallback, b as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from '../../dist/index-29b7121b.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, x as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, w as buildGraph, f as context, c as createEvents, g as createPortal, b as createRoot, k as dispose, e as extend, q as flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, C as useFrame, D as useGraph, y as useInstanceHandle, F as useLoader, z as useStore, A as useThree } from '../../dist/index-29b7121b.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';
|
|
@@ -98,9 +98,9 @@ function createTouchEvents(store) {
|
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
/**
|
|
102
|
-
* A native canvas which accepts threejs elements as children.
|
|
103
|
-
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
101
|
+
/**
|
|
102
|
+
* A native canvas which accepts threejs elements as children.
|
|
103
|
+
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
104
104
|
*/
|
|
105
105
|
const CanvasImpl = /*#__PURE__*/React.forwardRef(({
|
|
106
106
|
children,
|
|
@@ -150,6 +150,7 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(({
|
|
|
150
150
|
if (error) throw error;
|
|
151
151
|
const viewRef = React.useRef(null);
|
|
152
152
|
const root = React.useRef(null);
|
|
153
|
+
const [antialias, setAntialias] = React.useState(true);
|
|
153
154
|
const onLayout = React.useCallback(e => {
|
|
154
155
|
const {
|
|
155
156
|
width,
|
|
@@ -175,7 +176,12 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(({
|
|
|
175
176
|
addEventListener: () => {},
|
|
176
177
|
removeEventListener: () => {},
|
|
177
178
|
clientHeight: context.drawingBufferHeight,
|
|
178
|
-
getContext: (
|
|
179
|
+
getContext: (_, {
|
|
180
|
+
antialias = false
|
|
181
|
+
}) => {
|
|
182
|
+
setAntialias(antialias);
|
|
183
|
+
return context;
|
|
184
|
+
}
|
|
179
185
|
};
|
|
180
186
|
root.current = createRoot(canvasShim);
|
|
181
187
|
setCanvas(canvasShim);
|
|
@@ -241,15 +247,15 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(({
|
|
|
241
247
|
...style
|
|
242
248
|
}
|
|
243
249
|
}, bind), width > 0 && /*#__PURE__*/React.createElement(GLView, {
|
|
244
|
-
msaaSamples: 0,
|
|
250
|
+
msaaSamples: antialias ? 4 : 0,
|
|
245
251
|
onContextCreate: onContextCreate,
|
|
246
252
|
style: StyleSheet.absoluteFill
|
|
247
253
|
}));
|
|
248
254
|
});
|
|
249
255
|
|
|
250
|
-
/**
|
|
251
|
-
* A native canvas which accepts threejs elements as children.
|
|
252
|
-
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
256
|
+
/**
|
|
257
|
+
* A native canvas which accepts threejs elements as children.
|
|
258
|
+
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
253
259
|
*/
|
|
254
260
|
const Canvas = /*#__PURE__*/React.forwardRef(function CanvasWrapper(props, ref) {
|
|
255
261
|
return /*#__PURE__*/React.createElement(FiberProvider, null, /*#__PURE__*/React.createElement(CanvasImpl, _extends({}, props, {
|
package/native/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"main": "dist/react-three-fiber-native.cjs.js",
|
|
3
|
-
"module": "dist/react-three-fiber-native.esm.js",
|
|
4
|
-
"types": "dist/react-three-fiber-native.cjs.d.ts"
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"main": "dist/react-three-fiber-native.cjs.js",
|
|
3
|
+
"module": "dist/react-three-fiber-native.esm.js",
|
|
4
|
+
"types": "dist/react-three-fiber-native.cjs.d.ts"
|
|
5
|
+
}
|