@react-three/fiber 9.0.0-rc.1 → 9.0.0-rc.3
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 +12 -0
- package/dist/declarations/src/core/hooks.d.ts +10 -12
- package/dist/declarations/src/core/reconciler.d.ts +0 -3
- package/dist/declarations/src/core/utils.d.ts +78 -31
- package/dist/declarations/src/native/Canvas.d.ts +2 -3
- package/dist/declarations/src/web/Canvas.d.ts +2 -3
- package/dist/{events-cb1a9ea0.cjs.prod.js → events-484fb9c5.cjs.prod.js} +1488 -1523
- package/dist/{events-26d2636c.esm.js → events-64d1e225.esm.js} +1343 -1379
- package/dist/{events-df578889.cjs.dev.js → events-c2452172.cjs.dev.js} +1488 -1524
- package/dist/react-three-fiber.cjs.dev.js +10 -10
- package/dist/react-three-fiber.cjs.prod.js +10 -10
- package/dist/react-three-fiber.esm.js +11 -11
- package/native/dist/react-three-fiber-native.cjs.dev.js +10 -14
- package/native/dist/react-three-fiber-native.cjs.prod.js +10 -14
- package/native/dist/react-three-fiber-native.esm.js +11 -15
- package/package.json +6 -6
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var events = require('./events-
|
|
5
|
+
var events = require('./events-c2452172.cjs.dev.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var THREE = require('three');
|
|
8
8
|
var createDebounce = require('debounce');
|
|
@@ -10,9 +10,9 @@ var itsFine = require('its-fine');
|
|
|
10
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
11
|
require('react-reconciler/constants');
|
|
12
12
|
require('zustand/traditional');
|
|
13
|
-
require('suspend-react');
|
|
14
13
|
require('react-reconciler');
|
|
15
14
|
require('scheduler');
|
|
15
|
+
require('suspend-react');
|
|
16
16
|
|
|
17
17
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
18
18
|
|
|
@@ -232,7 +232,8 @@ function findScrollContainers(element) {
|
|
|
232
232
|
const keys = ['x', 'y', 'top', 'bottom', 'left', 'right', 'width', 'height'];
|
|
233
233
|
const areBoundsEqual = (a, b) => keys.every(key => a[key] === b[key]);
|
|
234
234
|
|
|
235
|
-
|
|
235
|
+
function CanvasImpl({
|
|
236
|
+
ref,
|
|
236
237
|
children,
|
|
237
238
|
fallback,
|
|
238
239
|
resize,
|
|
@@ -255,7 +256,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
255
256
|
onPointerMissed,
|
|
256
257
|
onCreated,
|
|
257
258
|
...props
|
|
258
|
-
}
|
|
259
|
+
}) {
|
|
259
260
|
// Create a known catalogue of Threejs-native elements
|
|
260
261
|
// This will include the entire THREE namespace by default, users can extend
|
|
261
262
|
// their own elements by using the createRoot API instead
|
|
@@ -271,7 +272,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
271
272
|
});
|
|
272
273
|
const canvasRef = React__namespace.useRef(null);
|
|
273
274
|
const divRef = React__namespace.useRef(null);
|
|
274
|
-
React__namespace.useImperativeHandle(
|
|
275
|
+
React__namespace.useImperativeHandle(ref, () => canvasRef.current);
|
|
275
276
|
const handlePointerMissed = events.useMutableCallback(onPointerMissed);
|
|
276
277
|
const [block, setBlock] = React__namespace.useState(false);
|
|
277
278
|
const [error, setError] = React__namespace.useState(false);
|
|
@@ -367,20 +368,19 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
367
368
|
})
|
|
368
369
|
})
|
|
369
370
|
});
|
|
370
|
-
}
|
|
371
|
+
}
|
|
371
372
|
|
|
372
373
|
/**
|
|
373
374
|
* A DOM canvas which accepts threejs elements as children.
|
|
374
375
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
375
376
|
*/
|
|
376
|
-
|
|
377
|
+
function Canvas(props) {
|
|
377
378
|
return /*#__PURE__*/jsxRuntime.jsx(itsFine.FiberProvider, {
|
|
378
379
|
children: /*#__PURE__*/jsxRuntime.jsx(CanvasImpl, {
|
|
379
|
-
...props
|
|
380
|
-
ref: ref
|
|
380
|
+
...props
|
|
381
381
|
})
|
|
382
382
|
});
|
|
383
|
-
}
|
|
383
|
+
}
|
|
384
384
|
|
|
385
385
|
exports.ReactThreeFiber = events.threeTypes;
|
|
386
386
|
exports._roots = events._roots;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var events = require('./events-
|
|
5
|
+
var events = require('./events-484fb9c5.cjs.prod.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var THREE = require('three');
|
|
8
8
|
var createDebounce = require('debounce');
|
|
@@ -10,9 +10,9 @@ var itsFine = require('its-fine');
|
|
|
10
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
11
|
require('react-reconciler/constants');
|
|
12
12
|
require('zustand/traditional');
|
|
13
|
-
require('suspend-react');
|
|
14
13
|
require('react-reconciler');
|
|
15
14
|
require('scheduler');
|
|
15
|
+
require('suspend-react');
|
|
16
16
|
|
|
17
17
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
18
18
|
|
|
@@ -232,7 +232,8 @@ function findScrollContainers(element) {
|
|
|
232
232
|
const keys = ['x', 'y', 'top', 'bottom', 'left', 'right', 'width', 'height'];
|
|
233
233
|
const areBoundsEqual = (a, b) => keys.every(key => a[key] === b[key]);
|
|
234
234
|
|
|
235
|
-
|
|
235
|
+
function CanvasImpl({
|
|
236
|
+
ref,
|
|
236
237
|
children,
|
|
237
238
|
fallback,
|
|
238
239
|
resize,
|
|
@@ -255,7 +256,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
255
256
|
onPointerMissed,
|
|
256
257
|
onCreated,
|
|
257
258
|
...props
|
|
258
|
-
}
|
|
259
|
+
}) {
|
|
259
260
|
// Create a known catalogue of Threejs-native elements
|
|
260
261
|
// This will include the entire THREE namespace by default, users can extend
|
|
261
262
|
// their own elements by using the createRoot API instead
|
|
@@ -271,7 +272,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
271
272
|
});
|
|
272
273
|
const canvasRef = React__namespace.useRef(null);
|
|
273
274
|
const divRef = React__namespace.useRef(null);
|
|
274
|
-
React__namespace.useImperativeHandle(
|
|
275
|
+
React__namespace.useImperativeHandle(ref, () => canvasRef.current);
|
|
275
276
|
const handlePointerMissed = events.useMutableCallback(onPointerMissed);
|
|
276
277
|
const [block, setBlock] = React__namespace.useState(false);
|
|
277
278
|
const [error, setError] = React__namespace.useState(false);
|
|
@@ -367,20 +368,19 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
367
368
|
})
|
|
368
369
|
})
|
|
369
370
|
});
|
|
370
|
-
}
|
|
371
|
+
}
|
|
371
372
|
|
|
372
373
|
/**
|
|
373
374
|
* A DOM canvas which accepts threejs elements as children.
|
|
374
375
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
375
376
|
*/
|
|
376
|
-
|
|
377
|
+
function Canvas(props) {
|
|
377
378
|
return /*#__PURE__*/jsxRuntime.jsx(itsFine.FiberProvider, {
|
|
378
379
|
children: /*#__PURE__*/jsxRuntime.jsx(CanvasImpl, {
|
|
379
|
-
...props
|
|
380
|
-
ref: ref
|
|
380
|
+
...props
|
|
381
381
|
})
|
|
382
382
|
});
|
|
383
|
-
}
|
|
383
|
+
}
|
|
384
384
|
|
|
385
385
|
exports.ReactThreeFiber = events.threeTypes;
|
|
386
386
|
exports._roots = events._roots;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { e as extend, u as useBridge, a as useMutableCallback, b as useIsomorphicLayoutEffect, c as createRoot, i as isRef, E as ErrorBoundary, B as Block, d as unmountComponentAtNode, f as createPointerEvents } from './events-
|
|
2
|
-
export { t as ReactThreeFiber, _ as _roots, x as act, k as addAfterEffect, j as addEffect, l as addTail, n as advance, s as applyProps, y as buildGraph, q as context, g as createEvents, p as createPortal, c as createRoot, w as dispose, f as events, e as extend, h as flushGlobalEffects, v as getRootState, m as invalidate, r as reconciler, o as render, d as unmountComponentAtNode, D as useFrame, F as useGraph, z as useInstanceHandle, G as useLoader, A as useStore, C as useThree } from './events-
|
|
1
|
+
import { e as extend, u as useBridge, a as useMutableCallback, b as useIsomorphicLayoutEffect, c as createRoot, i as isRef, E as ErrorBoundary, B as Block, d as unmountComponentAtNode, f as createPointerEvents } from './events-64d1e225.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, _ as _roots, x as act, k as addAfterEffect, j as addEffect, l as addTail, n as advance, s as applyProps, y as buildGraph, q as context, g as createEvents, p as createPortal, c as createRoot, w as dispose, f as events, e as extend, h as flushGlobalEffects, v as getRootState, m as invalidate, r as reconciler, o as render, d as unmountComponentAtNode, D as useFrame, F as useGraph, z as useInstanceHandle, G as useLoader, A as useStore, C as useThree } from './events-64d1e225.esm.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useState, useRef, useEffect, useMemo } from 'react';
|
|
5
5
|
import * as THREE from 'three';
|
|
@@ -8,9 +8,9 @@ import { FiberProvider } from 'its-fine';
|
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
|
9
9
|
import 'react-reconciler/constants';
|
|
10
10
|
import 'zustand/traditional';
|
|
11
|
-
import 'suspend-react';
|
|
12
11
|
import 'react-reconciler';
|
|
13
12
|
import 'scheduler';
|
|
13
|
+
import 'suspend-react';
|
|
14
14
|
|
|
15
15
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
16
16
|
function useMeasure({
|
|
@@ -206,7 +206,8 @@ function findScrollContainers(element) {
|
|
|
206
206
|
const keys = ['x', 'y', 'top', 'bottom', 'left', 'right', 'width', 'height'];
|
|
207
207
|
const areBoundsEqual = (a, b) => keys.every(key => a[key] === b[key]);
|
|
208
208
|
|
|
209
|
-
|
|
209
|
+
function CanvasImpl({
|
|
210
|
+
ref,
|
|
210
211
|
children,
|
|
211
212
|
fallback,
|
|
212
213
|
resize,
|
|
@@ -229,7 +230,7 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(function Canvas({
|
|
|
229
230
|
onPointerMissed,
|
|
230
231
|
onCreated,
|
|
231
232
|
...props
|
|
232
|
-
}
|
|
233
|
+
}) {
|
|
233
234
|
// Create a known catalogue of Threejs-native elements
|
|
234
235
|
// This will include the entire THREE namespace by default, users can extend
|
|
235
236
|
// their own elements by using the createRoot API instead
|
|
@@ -245,7 +246,7 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(function Canvas({
|
|
|
245
246
|
});
|
|
246
247
|
const canvasRef = React.useRef(null);
|
|
247
248
|
const divRef = React.useRef(null);
|
|
248
|
-
React.useImperativeHandle(
|
|
249
|
+
React.useImperativeHandle(ref, () => canvasRef.current);
|
|
249
250
|
const handlePointerMissed = useMutableCallback(onPointerMissed);
|
|
250
251
|
const [block, setBlock] = React.useState(false);
|
|
251
252
|
const [error, setError] = React.useState(false);
|
|
@@ -341,19 +342,18 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(function Canvas({
|
|
|
341
342
|
})
|
|
342
343
|
})
|
|
343
344
|
});
|
|
344
|
-
}
|
|
345
|
+
}
|
|
345
346
|
|
|
346
347
|
/**
|
|
347
348
|
* A DOM canvas which accepts threejs elements as children.
|
|
348
349
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
349
350
|
*/
|
|
350
|
-
|
|
351
|
+
function Canvas(props) {
|
|
351
352
|
return /*#__PURE__*/jsx(FiberProvider, {
|
|
352
353
|
children: /*#__PURE__*/jsx(CanvasImpl, {
|
|
353
|
-
...props
|
|
354
|
-
ref: ref
|
|
354
|
+
...props
|
|
355
355
|
})
|
|
356
356
|
});
|
|
357
|
-
}
|
|
357
|
+
}
|
|
358
358
|
|
|
359
359
|
export { Canvas };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var events = require('../../dist/events-
|
|
5
|
+
var events = require('../../dist/events-c2452172.cjs.dev.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var THREE = require('three');
|
|
8
8
|
var reactNative = require('react-native');
|
|
@@ -15,9 +15,9 @@ var base64Js = require('base64-js');
|
|
|
15
15
|
var buffer = require('buffer');
|
|
16
16
|
require('react-reconciler/constants');
|
|
17
17
|
require('zustand/traditional');
|
|
18
|
-
require('suspend-react');
|
|
19
18
|
require('react-reconciler');
|
|
20
19
|
require('scheduler');
|
|
20
|
+
require('suspend-react');
|
|
21
21
|
|
|
22
22
|
function _interopNamespace(e) {
|
|
23
23
|
if (e && e.__esModule) return e;
|
|
@@ -43,11 +43,7 @@ var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
|
|
|
43
43
|
|
|
44
44
|
// TODO: React 19 needs support from react-native
|
|
45
45
|
const _View = reactNative.View;
|
|
46
|
-
|
|
47
|
-
* A native canvas which accepts threejs elements as children.
|
|
48
|
-
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
49
|
-
*/
|
|
50
|
-
const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
46
|
+
function CanvasImpl({
|
|
51
47
|
children,
|
|
52
48
|
style,
|
|
53
49
|
gl,
|
|
@@ -64,8 +60,9 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
64
60
|
scene,
|
|
65
61
|
onPointerMissed,
|
|
66
62
|
onCreated,
|
|
63
|
+
ref,
|
|
67
64
|
...props
|
|
68
|
-
}
|
|
65
|
+
}) {
|
|
69
66
|
// Create a known catalogue of Threejs-native elements
|
|
70
67
|
// This will include the entire THREE namespace by default, users can extend
|
|
71
68
|
// their own elements by using the createRoot API instead
|
|
@@ -84,7 +81,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
84
81
|
});
|
|
85
82
|
const [canvas, setCanvas] = React__namespace.useState(null);
|
|
86
83
|
const [bind, setBind] = React__namespace.useState();
|
|
87
|
-
React__namespace.useImperativeHandle(
|
|
84
|
+
React__namespace.useImperativeHandle(ref, () => viewRef.current);
|
|
88
85
|
const handlePointerMissed = events.useMutableCallback(onPointerMissed);
|
|
89
86
|
const [block, setBlock] = React__namespace.useState(false);
|
|
90
87
|
const [error, setError] = React__namespace.useState(undefined);
|
|
@@ -265,20 +262,19 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
265
262
|
style: reactNative.StyleSheet.absoluteFill
|
|
266
263
|
})
|
|
267
264
|
});
|
|
268
|
-
}
|
|
265
|
+
}
|
|
269
266
|
|
|
270
267
|
/**
|
|
271
268
|
* A native canvas which accepts threejs elements as children.
|
|
272
269
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
273
270
|
*/
|
|
274
|
-
|
|
271
|
+
function Canvas(props) {
|
|
275
272
|
return /*#__PURE__*/jsxRuntime.jsx(itsFine.FiberProvider, {
|
|
276
273
|
children: /*#__PURE__*/jsxRuntime.jsx(CanvasImpl, {
|
|
277
|
-
...props
|
|
278
|
-
ref: ref
|
|
274
|
+
...props
|
|
279
275
|
})
|
|
280
276
|
});
|
|
281
|
-
}
|
|
277
|
+
}
|
|
282
278
|
|
|
283
279
|
/** Default R3F event manager for react-native */
|
|
284
280
|
function createTouchEvents(store) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var events = require('../../dist/events-
|
|
5
|
+
var events = require('../../dist/events-484fb9c5.cjs.prod.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var THREE = require('three');
|
|
8
8
|
var reactNative = require('react-native');
|
|
@@ -15,9 +15,9 @@ var base64Js = require('base64-js');
|
|
|
15
15
|
var buffer = require('buffer');
|
|
16
16
|
require('react-reconciler/constants');
|
|
17
17
|
require('zustand/traditional');
|
|
18
|
-
require('suspend-react');
|
|
19
18
|
require('react-reconciler');
|
|
20
19
|
require('scheduler');
|
|
20
|
+
require('suspend-react');
|
|
21
21
|
|
|
22
22
|
function _interopNamespace(e) {
|
|
23
23
|
if (e && e.__esModule) return e;
|
|
@@ -43,11 +43,7 @@ var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
|
|
|
43
43
|
|
|
44
44
|
// TODO: React 19 needs support from react-native
|
|
45
45
|
const _View = reactNative.View;
|
|
46
|
-
|
|
47
|
-
* A native canvas which accepts threejs elements as children.
|
|
48
|
-
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
49
|
-
*/
|
|
50
|
-
const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
46
|
+
function CanvasImpl({
|
|
51
47
|
children,
|
|
52
48
|
style,
|
|
53
49
|
gl,
|
|
@@ -64,8 +60,9 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
64
60
|
scene,
|
|
65
61
|
onPointerMissed,
|
|
66
62
|
onCreated,
|
|
63
|
+
ref,
|
|
67
64
|
...props
|
|
68
|
-
}
|
|
65
|
+
}) {
|
|
69
66
|
// Create a known catalogue of Threejs-native elements
|
|
70
67
|
// This will include the entire THREE namespace by default, users can extend
|
|
71
68
|
// their own elements by using the createRoot API instead
|
|
@@ -84,7 +81,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
84
81
|
});
|
|
85
82
|
const [canvas, setCanvas] = React__namespace.useState(null);
|
|
86
83
|
const [bind, setBind] = React__namespace.useState();
|
|
87
|
-
React__namespace.useImperativeHandle(
|
|
84
|
+
React__namespace.useImperativeHandle(ref, () => viewRef.current);
|
|
88
85
|
const handlePointerMissed = events.useMutableCallback(onPointerMissed);
|
|
89
86
|
const [block, setBlock] = React__namespace.useState(false);
|
|
90
87
|
const [error, setError] = React__namespace.useState(undefined);
|
|
@@ -265,20 +262,19 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
265
262
|
style: reactNative.StyleSheet.absoluteFill
|
|
266
263
|
})
|
|
267
264
|
});
|
|
268
|
-
}
|
|
265
|
+
}
|
|
269
266
|
|
|
270
267
|
/**
|
|
271
268
|
* A native canvas which accepts threejs elements as children.
|
|
272
269
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
273
270
|
*/
|
|
274
|
-
|
|
271
|
+
function Canvas(props) {
|
|
275
272
|
return /*#__PURE__*/jsxRuntime.jsx(itsFine.FiberProvider, {
|
|
276
273
|
children: /*#__PURE__*/jsxRuntime.jsx(CanvasImpl, {
|
|
277
|
-
...props
|
|
278
|
-
ref: ref
|
|
274
|
+
...props
|
|
279
275
|
})
|
|
280
276
|
});
|
|
281
|
-
}
|
|
277
|
+
}
|
|
282
278
|
|
|
283
279
|
/** Default R3F event manager for react-native */
|
|
284
280
|
function createTouchEvents(store) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { e as extend, u as useBridge, a as useMutableCallback, c as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode, f as createPointerEvents, g as createEvents } from '../../dist/events-
|
|
2
|
-
export { t as ReactThreeFiber, _ as _roots, x as act, k as addAfterEffect, j as addEffect, l as addTail, n as advance, s as applyProps, y as buildGraph, q as context, g as createEvents, p as createPortal, c as createRoot, w as dispose, e as extend, h as flushGlobalEffects, v as getRootState, m as invalidate, r as reconciler, o as render, d as unmountComponentAtNode, D as useFrame, F as useGraph, z as useInstanceHandle, G as useLoader, A as useStore, C as useThree } from '../../dist/events-
|
|
1
|
+
import { e as extend, u as useBridge, a as useMutableCallback, c as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode, f as createPointerEvents, g as createEvents } from '../../dist/events-64d1e225.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, _ as _roots, x as act, k as addAfterEffect, j as addEffect, l as addTail, n as advance, s as applyProps, y as buildGraph, q as context, g as createEvents, p as createPortal, c as createRoot, w as dispose, e as extend, h as flushGlobalEffects, v as getRootState, m as invalidate, r as reconciler, o as render, d as unmountComponentAtNode, D as useFrame, F as useGraph, z as useInstanceHandle, G as useLoader, A as useStore, C as useThree } from '../../dist/events-64d1e225.esm.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { PanResponder, PixelRatio, StyleSheet, View, Platform, Image, NativeModules } from 'react-native';
|
|
@@ -12,17 +12,13 @@ import { fromByteArray } from 'base64-js';
|
|
|
12
12
|
import { Buffer } from 'buffer';
|
|
13
13
|
import 'react-reconciler/constants';
|
|
14
14
|
import 'zustand/traditional';
|
|
15
|
-
import 'suspend-react';
|
|
16
15
|
import 'react-reconciler';
|
|
17
16
|
import 'scheduler';
|
|
17
|
+
import 'suspend-react';
|
|
18
18
|
|
|
19
19
|
// TODO: React 19 needs support from react-native
|
|
20
20
|
const _View = View;
|
|
21
|
-
|
|
22
|
-
* A native canvas which accepts threejs elements as children.
|
|
23
|
-
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
24
|
-
*/
|
|
25
|
-
const CanvasImpl = /*#__PURE__*/React.forwardRef(({
|
|
21
|
+
function CanvasImpl({
|
|
26
22
|
children,
|
|
27
23
|
style,
|
|
28
24
|
gl,
|
|
@@ -39,8 +35,9 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(({
|
|
|
39
35
|
scene,
|
|
40
36
|
onPointerMissed,
|
|
41
37
|
onCreated,
|
|
38
|
+
ref,
|
|
42
39
|
...props
|
|
43
|
-
}
|
|
40
|
+
}) {
|
|
44
41
|
// Create a known catalogue of Threejs-native elements
|
|
45
42
|
// This will include the entire THREE namespace by default, users can extend
|
|
46
43
|
// their own elements by using the createRoot API instead
|
|
@@ -59,7 +56,7 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(({
|
|
|
59
56
|
});
|
|
60
57
|
const [canvas, setCanvas] = React.useState(null);
|
|
61
58
|
const [bind, setBind] = React.useState();
|
|
62
|
-
React.useImperativeHandle(
|
|
59
|
+
React.useImperativeHandle(ref, () => viewRef.current);
|
|
63
60
|
const handlePointerMissed = useMutableCallback(onPointerMissed);
|
|
64
61
|
const [block, setBlock] = React.useState(false);
|
|
65
62
|
const [error, setError] = React.useState(undefined);
|
|
@@ -240,20 +237,19 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(({
|
|
|
240
237
|
style: StyleSheet.absoluteFill
|
|
241
238
|
})
|
|
242
239
|
});
|
|
243
|
-
}
|
|
240
|
+
}
|
|
244
241
|
|
|
245
242
|
/**
|
|
246
243
|
* A native canvas which accepts threejs elements as children.
|
|
247
244
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
248
245
|
*/
|
|
249
|
-
|
|
246
|
+
function Canvas(props) {
|
|
250
247
|
return /*#__PURE__*/jsx(FiberProvider, {
|
|
251
248
|
children: /*#__PURE__*/jsx(CanvasImpl, {
|
|
252
|
-
...props
|
|
253
|
-
ref: ref
|
|
249
|
+
...props
|
|
254
250
|
})
|
|
255
251
|
});
|
|
256
|
-
}
|
|
252
|
+
}
|
|
257
253
|
|
|
258
254
|
/** Default R3F event manager for react-native */
|
|
259
255
|
function createTouchEvents(store) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-three/fiber",
|
|
3
|
-
"version": "9.0.0-rc.
|
|
3
|
+
"version": "9.0.0-rc.3",
|
|
4
4
|
"description": "A React renderer for Threejs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"buffer": "^6.0.3",
|
|
51
51
|
"debounce": "^1.2.1",
|
|
52
52
|
"its-fine": "^1.2.5",
|
|
53
|
-
"react-reconciler": "0.31.0
|
|
54
|
-
"scheduler": "0.25.0
|
|
53
|
+
"react-reconciler": "0.31.0",
|
|
54
|
+
"scheduler": "0.25.0",
|
|
55
55
|
"suspend-react": "^0.1.3",
|
|
56
56
|
"zustand": "^4.1.2"
|
|
57
57
|
},
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"expo-asset": ">=8.4",
|
|
61
61
|
"expo-gl": ">=11.0",
|
|
62
62
|
"expo-file-system": ">=11.0",
|
|
63
|
-
"react": "
|
|
64
|
-
"react-dom": "
|
|
63
|
+
"react": "^19.0.0",
|
|
64
|
+
"react-dom": "^19.0.0",
|
|
65
65
|
"react-native": ">=0.69",
|
|
66
|
-
"three": ">=0.
|
|
66
|
+
"three": ">=0.156"
|
|
67
67
|
},
|
|
68
68
|
"peerDependenciesMeta": {
|
|
69
69
|
"react-dom": {
|