@react-three/fiber 9.4.1 → 9.5.0
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/react-reconciler/index.d.ts +1044 -0
- package/dist/declarations/src/core/reconciler.d.ts +1 -1
- package/dist/declarations/src/core/utils.d.ts +78 -7
- package/dist/events-238e0986.cjs.prod.js +8048 -0
- package/dist/events-358c3764.cjs.dev.js +16245 -0
- package/dist/events-5a94e5eb.esm.js +16187 -0
- package/dist/react-three-fiber.cjs.dev.js +1 -3
- package/dist/react-three-fiber.cjs.prod.js +1 -3
- package/dist/react-three-fiber.esm.js +2 -4
- package/native/dist/react-three-fiber-native.cjs.dev.js +18 -12
- package/native/dist/react-three-fiber-native.cjs.prod.js +18 -12
- package/native/dist/react-three-fiber-native.esm.js +12 -5
- package/package.json +8 -6
- package/react-reconciler/constants.d.ts +7 -0
- package/react-reconciler/constants.js +9 -0
- package/react-reconciler/index.d.ts +1044 -0
- package/react-reconciler/index.js +224 -0
- package/dist/events-1d578043.cjs.dev.js +0 -2569
- package/dist/events-2487ec62.esm.js +0 -2510
- package/dist/events-af6d715d.cjs.prod.js +0 -2569
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var events = require('./events-
|
|
5
|
+
var events = require('./events-358c3764.cjs.dev.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var THREE = require('three');
|
|
8
8
|
var useMeasure = require('react-use-measure');
|
|
9
9
|
var itsFine = require('its-fine');
|
|
10
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
|
-
require('react-reconciler/constants');
|
|
12
11
|
require('zustand/traditional');
|
|
13
12
|
require('suspend-react');
|
|
14
|
-
require('react-reconciler');
|
|
15
13
|
require('scheduler');
|
|
16
14
|
|
|
17
15
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var events = require('./events-
|
|
5
|
+
var events = require('./events-238e0986.cjs.prod.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var THREE = require('three');
|
|
8
8
|
var useMeasure = require('react-use-measure');
|
|
9
9
|
var itsFine = require('its-fine');
|
|
10
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
|
-
require('react-reconciler/constants');
|
|
12
11
|
require('zustand/traditional');
|
|
13
12
|
require('suspend-react');
|
|
14
|
-
require('react-reconciler');
|
|
15
13
|
require('scheduler');
|
|
16
14
|
|
|
17
15
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -1,14 +1,12 @@
|
|
|
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, o as createPortal, c as createRoot, w as dispose, f as events, e as extend, h as flushGlobalEffects, p as flushSync, v as getRootState, m as invalidate, r as reconciler, 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-5a94e5eb.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, o as createPortal, c as createRoot, w as dispose, f as events, e as extend, h as flushGlobalEffects, p as flushSync, v as getRootState, m as invalidate, r as reconciler, d as unmountComponentAtNode, D as useFrame, F as useGraph, z as useInstanceHandle, G as useLoader, A as useStore, C as useThree } from './events-5a94e5eb.esm.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import useMeasure from 'react-use-measure';
|
|
6
6
|
import { FiberProvider } from 'its-fine';
|
|
7
7
|
import { jsx } from 'react/jsx-runtime';
|
|
8
|
-
import 'react-reconciler/constants';
|
|
9
8
|
import 'zustand/traditional';
|
|
10
9
|
import 'suspend-react';
|
|
11
|
-
import 'react-reconciler';
|
|
12
10
|
import 'scheduler';
|
|
13
11
|
|
|
14
12
|
function CanvasImpl({
|
|
@@ -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-358c3764.cjs.dev.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var THREE = require('three');
|
|
8
8
|
var reactNative = require('react-native');
|
|
@@ -10,13 +10,10 @@ var expoGl = require('expo-gl');
|
|
|
10
10
|
var itsFine = require('its-fine');
|
|
11
11
|
var jsxRuntime = require('react/jsx-runtime');
|
|
12
12
|
var expoAsset = require('expo-asset');
|
|
13
|
-
var fs = require('expo-file-system');
|
|
14
13
|
var base64Js = require('base64-js');
|
|
15
14
|
var buffer = require('buffer');
|
|
16
|
-
require('react-reconciler/constants');
|
|
17
15
|
require('zustand/traditional');
|
|
18
16
|
require('suspend-react');
|
|
19
|
-
require('react-reconciler');
|
|
20
17
|
require('scheduler');
|
|
21
18
|
|
|
22
19
|
function _interopNamespace(e) {
|
|
@@ -39,7 +36,6 @@ function _interopNamespace(e) {
|
|
|
39
36
|
|
|
40
37
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
41
38
|
var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
|
|
42
|
-
var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
|
|
43
39
|
|
|
44
40
|
// TODO: React 19 needs support from react-native
|
|
45
41
|
const _View = reactNative.View;
|
|
@@ -367,6 +363,16 @@ function createTouchEvents(store) {
|
|
|
367
363
|
};
|
|
368
364
|
}
|
|
369
365
|
|
|
366
|
+
// Conditionally import expo-file-system/legacy to support Expo 54
|
|
367
|
+
const getFileSystem = () => {
|
|
368
|
+
try {
|
|
369
|
+
return require('expo-file-system/legacy');
|
|
370
|
+
} catch {
|
|
371
|
+
return require('expo-file-system');
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
const fs = getFileSystem();
|
|
375
|
+
|
|
370
376
|
// http://stackoverflow.com/questions/105034
|
|
371
377
|
function uuidv4() {
|
|
372
378
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
|
|
@@ -405,9 +411,9 @@ async function getAsset(input) {
|
|
|
405
411
|
if (input.startsWith('data:')) {
|
|
406
412
|
const [header, data] = input.split(';base64,');
|
|
407
413
|
const [, type] = header.split('/');
|
|
408
|
-
const uri =
|
|
409
|
-
await
|
|
410
|
-
encoding:
|
|
414
|
+
const uri = fs.cacheDirectory + uuidv4() + `.${type}`;
|
|
415
|
+
await fs.writeAsStringAsync(uri, data, {
|
|
416
|
+
encoding: fs.EncodingType.Base64
|
|
411
417
|
});
|
|
412
418
|
return uri;
|
|
413
419
|
}
|
|
@@ -419,8 +425,8 @@ async function getAsset(input) {
|
|
|
419
425
|
|
|
420
426
|
// Unpack assets in Android Release Mode
|
|
421
427
|
if (!uri.includes(':')) {
|
|
422
|
-
const file = `${
|
|
423
|
-
await
|
|
428
|
+
const file = `${fs.cacheDirectory}ExponentAsset-${asset.hash}.${asset.type}`;
|
|
429
|
+
await fs.copyAsync({
|
|
424
430
|
from: uri,
|
|
425
431
|
to: file
|
|
426
432
|
});
|
|
@@ -514,8 +520,8 @@ function polyfills() {
|
|
|
514
520
|
if (this.path && typeof url === 'string') url = this.path + url;
|
|
515
521
|
this.manager.itemStart(url);
|
|
516
522
|
getAsset(url).then(async uri => {
|
|
517
|
-
const base64 = await
|
|
518
|
-
encoding:
|
|
523
|
+
const base64 = await fs.readAsStringAsync(uri, {
|
|
524
|
+
encoding: fs.EncodingType.Base64
|
|
519
525
|
});
|
|
520
526
|
const data = buffer.Buffer.from(base64, 'base64');
|
|
521
527
|
onLoad == null ? void 0 : onLoad(data.buffer);
|
|
@@ -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-238e0986.cjs.prod.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var THREE = require('three');
|
|
8
8
|
var reactNative = require('react-native');
|
|
@@ -10,13 +10,10 @@ var expoGl = require('expo-gl');
|
|
|
10
10
|
var itsFine = require('its-fine');
|
|
11
11
|
var jsxRuntime = require('react/jsx-runtime');
|
|
12
12
|
var expoAsset = require('expo-asset');
|
|
13
|
-
var fs = require('expo-file-system');
|
|
14
13
|
var base64Js = require('base64-js');
|
|
15
14
|
var buffer = require('buffer');
|
|
16
|
-
require('react-reconciler/constants');
|
|
17
15
|
require('zustand/traditional');
|
|
18
16
|
require('suspend-react');
|
|
19
|
-
require('react-reconciler');
|
|
20
17
|
require('scheduler');
|
|
21
18
|
|
|
22
19
|
function _interopNamespace(e) {
|
|
@@ -39,7 +36,6 @@ function _interopNamespace(e) {
|
|
|
39
36
|
|
|
40
37
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
41
38
|
var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
|
|
42
|
-
var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
|
|
43
39
|
|
|
44
40
|
// TODO: React 19 needs support from react-native
|
|
45
41
|
const _View = reactNative.View;
|
|
@@ -367,6 +363,16 @@ function createTouchEvents(store) {
|
|
|
367
363
|
};
|
|
368
364
|
}
|
|
369
365
|
|
|
366
|
+
// Conditionally import expo-file-system/legacy to support Expo 54
|
|
367
|
+
const getFileSystem = () => {
|
|
368
|
+
try {
|
|
369
|
+
return require('expo-file-system/legacy');
|
|
370
|
+
} catch {
|
|
371
|
+
return require('expo-file-system');
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
const fs = getFileSystem();
|
|
375
|
+
|
|
370
376
|
// http://stackoverflow.com/questions/105034
|
|
371
377
|
function uuidv4() {
|
|
372
378
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
|
|
@@ -405,9 +411,9 @@ async function getAsset(input) {
|
|
|
405
411
|
if (input.startsWith('data:')) {
|
|
406
412
|
const [header, data] = input.split(';base64,');
|
|
407
413
|
const [, type] = header.split('/');
|
|
408
|
-
const uri =
|
|
409
|
-
await
|
|
410
|
-
encoding:
|
|
414
|
+
const uri = fs.cacheDirectory + uuidv4() + `.${type}`;
|
|
415
|
+
await fs.writeAsStringAsync(uri, data, {
|
|
416
|
+
encoding: fs.EncodingType.Base64
|
|
411
417
|
});
|
|
412
418
|
return uri;
|
|
413
419
|
}
|
|
@@ -419,8 +425,8 @@ async function getAsset(input) {
|
|
|
419
425
|
|
|
420
426
|
// Unpack assets in Android Release Mode
|
|
421
427
|
if (!uri.includes(':')) {
|
|
422
|
-
const file = `${
|
|
423
|
-
await
|
|
428
|
+
const file = `${fs.cacheDirectory}ExponentAsset-${asset.hash}.${asset.type}`;
|
|
429
|
+
await fs.copyAsync({
|
|
424
430
|
from: uri,
|
|
425
431
|
to: file
|
|
426
432
|
});
|
|
@@ -514,8 +520,8 @@ function polyfills() {
|
|
|
514
520
|
if (this.path && typeof url === 'string') url = this.path + url;
|
|
515
521
|
this.manager.itemStart(url);
|
|
516
522
|
getAsset(url).then(async uri => {
|
|
517
|
-
const base64 = await
|
|
518
|
-
encoding:
|
|
523
|
+
const base64 = await fs.readAsStringAsync(uri, {
|
|
524
|
+
encoding: fs.EncodingType.Base64
|
|
519
525
|
});
|
|
520
526
|
const data = buffer.Buffer.from(base64, 'base64');
|
|
521
527
|
onLoad == null ? void 0 : onLoad(data.buffer);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { e as extend, u as useBridge, a as useMutableCallback, c as createRoot, b as useIsomorphicLayoutEffect, 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, o as createPortal, c as createRoot, w as dispose, e as extend, h as flushGlobalEffects, p as flushSync, v as getRootState, m as invalidate, r as reconciler, 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, b as useIsomorphicLayoutEffect, E as ErrorBoundary, B as Block, d as unmountComponentAtNode, f as createPointerEvents, g as createEvents } from '../../dist/events-5a94e5eb.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, o as createPortal, c as createRoot, w as dispose, e as extend, h as flushGlobalEffects, p as flushSync, v as getRootState, m as invalidate, r as reconciler, d as unmountComponentAtNode, D as useFrame, F as useGraph, z as useInstanceHandle, G as useLoader, A as useStore, C as useThree } from '../../dist/events-5a94e5eb.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';
|
|
@@ -7,13 +7,10 @@ import { GLView } from 'expo-gl';
|
|
|
7
7
|
import { FiberProvider } from 'its-fine';
|
|
8
8
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
9
|
import { Asset } from 'expo-asset';
|
|
10
|
-
import * as fs from 'expo-file-system';
|
|
11
10
|
import { fromByteArray } from 'base64-js';
|
|
12
11
|
import { Buffer } from 'buffer';
|
|
13
|
-
import 'react-reconciler/constants';
|
|
14
12
|
import 'zustand/traditional';
|
|
15
13
|
import 'suspend-react';
|
|
16
|
-
import 'react-reconciler';
|
|
17
14
|
import 'scheduler';
|
|
18
15
|
|
|
19
16
|
// TODO: React 19 needs support from react-native
|
|
@@ -342,6 +339,16 @@ function createTouchEvents(store) {
|
|
|
342
339
|
};
|
|
343
340
|
}
|
|
344
341
|
|
|
342
|
+
// Conditionally import expo-file-system/legacy to support Expo 54
|
|
343
|
+
const getFileSystem = () => {
|
|
344
|
+
try {
|
|
345
|
+
return require('expo-file-system/legacy');
|
|
346
|
+
} catch {
|
|
347
|
+
return require('expo-file-system');
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
const fs = getFileSystem();
|
|
351
|
+
|
|
345
352
|
// http://stackoverflow.com/questions/105034
|
|
346
353
|
function uuidv4() {
|
|
347
354
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-three/fiber",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.5.0",
|
|
4
4
|
"description": "A React renderer for Threejs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -42,16 +42,18 @@
|
|
|
42
42
|
"scripts": {
|
|
43
43
|
"prebuild": "cp ../../readme.md readme.md"
|
|
44
44
|
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/react-reconciler": "^0.32.3",
|
|
47
|
+
"react-reconciler": "^0.33.0"
|
|
48
|
+
},
|
|
45
49
|
"dependencies": {
|
|
46
50
|
"@babel/runtime": "^7.17.8",
|
|
47
|
-
"@types/react-reconciler": "^0.32.0",
|
|
48
51
|
"@types/webxr": "*",
|
|
49
52
|
"base64-js": "^1.5.1",
|
|
50
53
|
"buffer": "^6.0.3",
|
|
51
54
|
"its-fine": "^2.0.0",
|
|
52
|
-
"react-reconciler": "^0.31.0",
|
|
53
55
|
"react-use-measure": "^2.1.7",
|
|
54
|
-
"scheduler": "^0.
|
|
56
|
+
"scheduler": "^0.27.0",
|
|
55
57
|
"suspend-react": "^0.1.3",
|
|
56
58
|
"use-sync-external-store": "^1.4.0",
|
|
57
59
|
"zustand": "^5.0.3"
|
|
@@ -61,8 +63,8 @@
|
|
|
61
63
|
"expo-asset": ">=8.4",
|
|
62
64
|
"expo-file-system": ">=11.0",
|
|
63
65
|
"expo-gl": ">=11.0",
|
|
64
|
-
"react": "
|
|
65
|
-
"react-dom": "
|
|
66
|
+
"react": ">=19 <19.3",
|
|
67
|
+
"react-dom": ">=19 <19.3",
|
|
66
68
|
"react-native": ">=0.78",
|
|
67
69
|
"three": ">=0.156"
|
|
68
70
|
},
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const DiscreteEventPriority = 0b0000000000000000000000000000001;
|
|
2
|
+
export const ContinuousEventPriority = 0b0000000000000000000000000000100;
|
|
3
|
+
export const DefaultEventPriority = 0b0000000000000000000000000010000;
|
|
4
|
+
export const IdleEventPriority = 0b0100000000000000000000000000000;
|
|
5
|
+
export const LegacyRoot = 0;
|
|
6
|
+
export const ConcurrentRoot = 1;
|
|
7
|
+
export const NoEventPriority = 0;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-reconciler-constants.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/const t=1,o=8,r=32,e=2,i=268435456,n=0,s=0;export{t as ConcurrentRoot,o as ContinuousEventPriority,r as DefaultEventPriority,e as DiscreteEventPriority,i as IdleEventPriority,n as LegacyRoot,s as NoEventPriority};
|