@react-three/fiber 9.0.0-alpha.5 → 9.0.0-alpha.6
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/renderer.d.ts +1 -1
- package/dist/declarations/src/three-types.d.ts +12 -0
- package/dist/{loop-1fad3b6f.cjs.prod.js → loop-6e8a6208.cjs.prod.js} +21 -19
- package/dist/{loop-02cefb27.cjs.dev.js → loop-c991cb05.cjs.dev.js} +21 -19
- package/dist/{loop-d73c6316.esm.js → loop-ef070875.esm.js} +21 -19
- package/dist/react-three-fiber.cjs.dev.js +36 -25
- package/dist/react-three-fiber.cjs.prod.js +36 -25
- package/dist/react-three-fiber.esm.js +37 -26
- package/native/dist/react-three-fiber-native.cjs.dev.js +29 -19
- package/native/dist/react-three-fiber-native.cjs.prod.js +29 -19
- package/native/dist/react-three-fiber-native.esm.js +30 -20
- package/package.json +3 -3
- package/readme.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @react-three/fiber
|
|
2
2
|
|
|
3
|
+
## 8.16.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- cb913e01: fix: use fast JSX, future JSX types
|
|
8
|
+
|
|
9
|
+
## 8.16.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 1270d24c: fix: missing dependency on inject function
|
|
14
|
+
|
|
3
15
|
## 8.16.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -80,5 +80,5 @@ export type InjectState = Partial<Omit<RootState, 'events'> & {
|
|
|
80
80
|
connected?: any;
|
|
81
81
|
};
|
|
82
82
|
}>;
|
|
83
|
-
export declare function createPortal(children: React.ReactNode, container: THREE.Object3D, state?: InjectState): JSX.Element;
|
|
83
|
+
export declare function createPortal(children: React.ReactNode, container: THREE.Object3D, state?: InjectState): React.JSX.Element;
|
|
84
84
|
export {};
|
|
@@ -53,4 +53,16 @@ declare module 'react' {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
+
declare module 'react/jsx-runtime' {
|
|
57
|
+
namespace JSX {
|
|
58
|
+
interface IntrinsicElements extends ThreeElements {
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
declare module 'react/jsx-dev-runtime' {
|
|
63
|
+
namespace JSX {
|
|
64
|
+
interface IntrinsicElements extends ThreeElements {
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
56
68
|
export {};
|
|
@@ -5,9 +5,9 @@ var React = require('react');
|
|
|
5
5
|
var constants = require('react-reconciler/constants');
|
|
6
6
|
var traditional = require('zustand/traditional');
|
|
7
7
|
var itsFine = require('its-fine');
|
|
8
|
-
var _extends = require('@babel/runtime/helpers/extends');
|
|
9
8
|
var Reconciler = require('react-reconciler');
|
|
10
9
|
var scheduler = require('scheduler');
|
|
10
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
11
11
|
var suspendReact = require('suspend-react');
|
|
12
12
|
|
|
13
13
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -38,10 +38,6 @@ var threeTypes = /*#__PURE__*/Object.freeze({
|
|
|
38
38
|
__proto__: null
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
// TODO: handle constructor overloads
|
|
42
|
-
// https://github.com/pmndrs/react-three-fiber/pull/2931
|
|
43
|
-
// https://github.com/microsoft/TypeScript/issues/37079
|
|
44
|
-
|
|
45
41
|
const catalogue = {};
|
|
46
42
|
let i = 0;
|
|
47
43
|
const extend = objects => {
|
|
@@ -52,9 +48,10 @@ const extend = objects => {
|
|
|
52
48
|
// Returns a component whose name will be inferred in devtools
|
|
53
49
|
// @ts-expect-error
|
|
54
50
|
return /*#__PURE__*/React__namespace.forwardRef({
|
|
55
|
-
[objects.name]: (props, ref) => /*#__PURE__*/
|
|
51
|
+
[objects.name]: (props, ref) => /*#__PURE__*/jsxRuntime.jsx(Component, {
|
|
52
|
+
...props,
|
|
56
53
|
ref: ref
|
|
57
|
-
})
|
|
54
|
+
})
|
|
58
55
|
}[objects.name]);
|
|
59
56
|
} else {
|
|
60
57
|
return void Object.assign(catalogue, objects);
|
|
@@ -474,7 +471,11 @@ function useBridge() {
|
|
|
474
471
|
}) => {
|
|
475
472
|
const strict = !!itsFine.traverseFiber(fiber, true, node => node.type === React__namespace.StrictMode);
|
|
476
473
|
const Root = strict ? React__namespace.StrictMode : React__namespace.Fragment;
|
|
477
|
-
return /*#__PURE__*/
|
|
474
|
+
return /*#__PURE__*/jsxRuntime.jsx(Root, {
|
|
475
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ContextBridge, {
|
|
476
|
+
children: children
|
|
477
|
+
})
|
|
478
|
+
});
|
|
478
479
|
}, [fiber, ContextBridge]);
|
|
479
480
|
}
|
|
480
481
|
function Block({
|
|
@@ -1815,9 +1816,6 @@ useLoader.clear = function (loader, input) {
|
|
|
1815
1816
|
return suspendReact.clear([loader, ...keys]);
|
|
1816
1817
|
};
|
|
1817
1818
|
|
|
1818
|
-
// Shim for OffscreenCanvas since it was removed from DOM types
|
|
1819
|
-
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/54988
|
|
1820
|
-
|
|
1821
1819
|
const _roots = new Map();
|
|
1822
1820
|
const shallowLoose = {
|
|
1823
1821
|
objects: 'shallow',
|
|
@@ -2169,7 +2167,7 @@ function createRoot(canvas) {
|
|
|
2169
2167
|
render(children) {
|
|
2170
2168
|
// The root has to be configured before it can be rendered
|
|
2171
2169
|
if (!configured) this.configure();
|
|
2172
|
-
reconciler.updateContainer( /*#__PURE__*/
|
|
2170
|
+
reconciler.updateContainer( /*#__PURE__*/jsxRuntime.jsx(Provider, {
|
|
2173
2171
|
store: store,
|
|
2174
2172
|
children: children,
|
|
2175
2173
|
onCreated: onCreated,
|
|
@@ -2210,9 +2208,10 @@ function Provider({
|
|
|
2210
2208
|
if (!store.getState().events.connected) state.events.connect == null ? void 0 : state.events.connect(rootElement);
|
|
2211
2209
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2212
2210
|
}, []);
|
|
2213
|
-
return /*#__PURE__*/
|
|
2214
|
-
value: store
|
|
2215
|
-
|
|
2211
|
+
return /*#__PURE__*/jsxRuntime.jsx(context.Provider, {
|
|
2212
|
+
value: store,
|
|
2213
|
+
children: children
|
|
2214
|
+
});
|
|
2216
2215
|
}
|
|
2217
2216
|
function unmountComponentAtNode(canvas, callback) {
|
|
2218
2217
|
const root = _roots.get(canvas);
|
|
@@ -2241,7 +2240,7 @@ function unmountComponentAtNode(canvas, callback) {
|
|
|
2241
2240
|
}
|
|
2242
2241
|
}
|
|
2243
2242
|
function createPortal(children, container, state) {
|
|
2244
|
-
return /*#__PURE__*/
|
|
2243
|
+
return /*#__PURE__*/jsxRuntime.jsx(Portal, {
|
|
2245
2244
|
children: children,
|
|
2246
2245
|
container: container,
|
|
2247
2246
|
state: state
|
|
@@ -2324,9 +2323,12 @@ function Portal({
|
|
|
2324
2323
|
return store;
|
|
2325
2324
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2326
2325
|
}, [previousRoot, container]);
|
|
2327
|
-
return /*#__PURE__*/
|
|
2328
|
-
|
|
2329
|
-
|
|
2326
|
+
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
2327
|
+
children: reconciler.createPortal( /*#__PURE__*/jsxRuntime.jsx(context.Provider, {
|
|
2328
|
+
value: usePortalStore,
|
|
2329
|
+
children: children
|
|
2330
|
+
}), usePortalStore, null)
|
|
2331
|
+
});
|
|
2330
2332
|
}
|
|
2331
2333
|
reconciler.injectIntoDevTools({
|
|
2332
2334
|
bundleType: 0 ,
|
|
@@ -5,9 +5,9 @@ var React = require('react');
|
|
|
5
5
|
var constants = require('react-reconciler/constants');
|
|
6
6
|
var traditional = require('zustand/traditional');
|
|
7
7
|
var itsFine = require('its-fine');
|
|
8
|
-
var _extends = require('@babel/runtime/helpers/extends');
|
|
9
8
|
var Reconciler = require('react-reconciler');
|
|
10
9
|
var scheduler = require('scheduler');
|
|
10
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
11
11
|
var suspendReact = require('suspend-react');
|
|
12
12
|
|
|
13
13
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -38,10 +38,6 @@ var threeTypes = /*#__PURE__*/Object.freeze({
|
|
|
38
38
|
__proto__: null
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
// TODO: handle constructor overloads
|
|
42
|
-
// https://github.com/pmndrs/react-three-fiber/pull/2931
|
|
43
|
-
// https://github.com/microsoft/TypeScript/issues/37079
|
|
44
|
-
|
|
45
41
|
const catalogue = {};
|
|
46
42
|
let i = 0;
|
|
47
43
|
const extend = objects => {
|
|
@@ -52,9 +48,10 @@ const extend = objects => {
|
|
|
52
48
|
// Returns a component whose name will be inferred in devtools
|
|
53
49
|
// @ts-expect-error
|
|
54
50
|
return /*#__PURE__*/React__namespace.forwardRef({
|
|
55
|
-
[objects.name]: (props, ref) => /*#__PURE__*/
|
|
51
|
+
[objects.name]: (props, ref) => /*#__PURE__*/jsxRuntime.jsx(Component, {
|
|
52
|
+
...props,
|
|
56
53
|
ref: ref
|
|
57
|
-
})
|
|
54
|
+
})
|
|
58
55
|
}[objects.name]);
|
|
59
56
|
} else {
|
|
60
57
|
return void Object.assign(catalogue, objects);
|
|
@@ -474,7 +471,11 @@ function useBridge() {
|
|
|
474
471
|
}) => {
|
|
475
472
|
const strict = !!itsFine.traverseFiber(fiber, true, node => node.type === React__namespace.StrictMode);
|
|
476
473
|
const Root = strict ? React__namespace.StrictMode : React__namespace.Fragment;
|
|
477
|
-
return /*#__PURE__*/
|
|
474
|
+
return /*#__PURE__*/jsxRuntime.jsx(Root, {
|
|
475
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ContextBridge, {
|
|
476
|
+
children: children
|
|
477
|
+
})
|
|
478
|
+
});
|
|
478
479
|
}, [fiber, ContextBridge]);
|
|
479
480
|
}
|
|
480
481
|
function Block({
|
|
@@ -1815,9 +1816,6 @@ useLoader.clear = function (loader, input) {
|
|
|
1815
1816
|
return suspendReact.clear([loader, ...keys]);
|
|
1816
1817
|
};
|
|
1817
1818
|
|
|
1818
|
-
// Shim for OffscreenCanvas since it was removed from DOM types
|
|
1819
|
-
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/54988
|
|
1820
|
-
|
|
1821
1819
|
const _roots = new Map();
|
|
1822
1820
|
const shallowLoose = {
|
|
1823
1821
|
objects: 'shallow',
|
|
@@ -2169,7 +2167,7 @@ function createRoot(canvas) {
|
|
|
2169
2167
|
render(children) {
|
|
2170
2168
|
// The root has to be configured before it can be rendered
|
|
2171
2169
|
if (!configured) this.configure();
|
|
2172
|
-
reconciler.updateContainer( /*#__PURE__*/
|
|
2170
|
+
reconciler.updateContainer( /*#__PURE__*/jsxRuntime.jsx(Provider, {
|
|
2173
2171
|
store: store,
|
|
2174
2172
|
children: children,
|
|
2175
2173
|
onCreated: onCreated,
|
|
@@ -2210,9 +2208,10 @@ function Provider({
|
|
|
2210
2208
|
if (!store.getState().events.connected) state.events.connect == null ? void 0 : state.events.connect(rootElement);
|
|
2211
2209
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2212
2210
|
}, []);
|
|
2213
|
-
return /*#__PURE__*/
|
|
2214
|
-
value: store
|
|
2215
|
-
|
|
2211
|
+
return /*#__PURE__*/jsxRuntime.jsx(context.Provider, {
|
|
2212
|
+
value: store,
|
|
2213
|
+
children: children
|
|
2214
|
+
});
|
|
2216
2215
|
}
|
|
2217
2216
|
function unmountComponentAtNode(canvas, callback) {
|
|
2218
2217
|
const root = _roots.get(canvas);
|
|
@@ -2241,7 +2240,7 @@ function unmountComponentAtNode(canvas, callback) {
|
|
|
2241
2240
|
}
|
|
2242
2241
|
}
|
|
2243
2242
|
function createPortal(children, container, state) {
|
|
2244
|
-
return /*#__PURE__*/
|
|
2243
|
+
return /*#__PURE__*/jsxRuntime.jsx(Portal, {
|
|
2245
2244
|
children: children,
|
|
2246
2245
|
container: container,
|
|
2247
2246
|
state: state
|
|
@@ -2324,9 +2323,12 @@ function Portal({
|
|
|
2324
2323
|
return store;
|
|
2325
2324
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2326
2325
|
}, [previousRoot, container]);
|
|
2327
|
-
return /*#__PURE__*/
|
|
2328
|
-
|
|
2329
|
-
|
|
2326
|
+
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
2327
|
+
children: reconciler.createPortal( /*#__PURE__*/jsxRuntime.jsx(context.Provider, {
|
|
2328
|
+
value: usePortalStore,
|
|
2329
|
+
children: children
|
|
2330
|
+
}), usePortalStore, null)
|
|
2331
|
+
});
|
|
2330
2332
|
}
|
|
2331
2333
|
reconciler.injectIntoDevTools({
|
|
2332
2334
|
bundleType: process.env.NODE_ENV === 'production' ? 0 : 1,
|
|
@@ -3,19 +3,15 @@ import * as React from 'react';
|
|
|
3
3
|
import { NoEventPriority, DefaultEventPriority, ContinuousEventPriority, DiscreteEventPriority, ConcurrentRoot } from 'react-reconciler/constants';
|
|
4
4
|
import { createWithEqualityFn } from 'zustand/traditional';
|
|
5
5
|
import { useFiber, useContextBridge, traverseFiber } from 'its-fine';
|
|
6
|
-
import _extends from '@babel/runtime/helpers/esm/extends';
|
|
7
6
|
import Reconciler from 'react-reconciler';
|
|
8
7
|
import { unstable_scheduleCallback, unstable_IdlePriority } from 'scheduler';
|
|
8
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
9
9
|
import { suspend, preload, clear } from 'suspend-react';
|
|
10
10
|
|
|
11
11
|
var threeTypes = /*#__PURE__*/Object.freeze({
|
|
12
12
|
__proto__: null
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
// TODO: handle constructor overloads
|
|
16
|
-
// https://github.com/pmndrs/react-three-fiber/pull/2931
|
|
17
|
-
// https://github.com/microsoft/TypeScript/issues/37079
|
|
18
|
-
|
|
19
15
|
const catalogue = {};
|
|
20
16
|
let i = 0;
|
|
21
17
|
const extend = objects => {
|
|
@@ -26,9 +22,10 @@ const extend = objects => {
|
|
|
26
22
|
// Returns a component whose name will be inferred in devtools
|
|
27
23
|
// @ts-expect-error
|
|
28
24
|
return /*#__PURE__*/React.forwardRef({
|
|
29
|
-
[objects.name]: (props, ref) => /*#__PURE__*/
|
|
25
|
+
[objects.name]: (props, ref) => /*#__PURE__*/jsx(Component, {
|
|
26
|
+
...props,
|
|
30
27
|
ref: ref
|
|
31
|
-
})
|
|
28
|
+
})
|
|
32
29
|
}[objects.name]);
|
|
33
30
|
} else {
|
|
34
31
|
return void Object.assign(catalogue, objects);
|
|
@@ -448,7 +445,11 @@ function useBridge() {
|
|
|
448
445
|
}) => {
|
|
449
446
|
const strict = !!traverseFiber(fiber, true, node => node.type === React.StrictMode);
|
|
450
447
|
const Root = strict ? React.StrictMode : React.Fragment;
|
|
451
|
-
return /*#__PURE__*/
|
|
448
|
+
return /*#__PURE__*/jsx(Root, {
|
|
449
|
+
children: /*#__PURE__*/jsx(ContextBridge, {
|
|
450
|
+
children: children
|
|
451
|
+
})
|
|
452
|
+
});
|
|
452
453
|
}, [fiber, ContextBridge]);
|
|
453
454
|
}
|
|
454
455
|
function Block({
|
|
@@ -1789,9 +1790,6 @@ useLoader.clear = function (loader, input) {
|
|
|
1789
1790
|
return clear([loader, ...keys]);
|
|
1790
1791
|
};
|
|
1791
1792
|
|
|
1792
|
-
// Shim for OffscreenCanvas since it was removed from DOM types
|
|
1793
|
-
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/54988
|
|
1794
|
-
|
|
1795
1793
|
const _roots = new Map();
|
|
1796
1794
|
const shallowLoose = {
|
|
1797
1795
|
objects: 'shallow',
|
|
@@ -2143,7 +2141,7 @@ function createRoot(canvas) {
|
|
|
2143
2141
|
render(children) {
|
|
2144
2142
|
// The root has to be configured before it can be rendered
|
|
2145
2143
|
if (!configured) this.configure();
|
|
2146
|
-
reconciler.updateContainer( /*#__PURE__*/
|
|
2144
|
+
reconciler.updateContainer( /*#__PURE__*/jsx(Provider, {
|
|
2147
2145
|
store: store,
|
|
2148
2146
|
children: children,
|
|
2149
2147
|
onCreated: onCreated,
|
|
@@ -2184,9 +2182,10 @@ function Provider({
|
|
|
2184
2182
|
if (!store.getState().events.connected) state.events.connect == null ? void 0 : state.events.connect(rootElement);
|
|
2185
2183
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2186
2184
|
}, []);
|
|
2187
|
-
return /*#__PURE__*/
|
|
2188
|
-
value: store
|
|
2189
|
-
|
|
2185
|
+
return /*#__PURE__*/jsx(context.Provider, {
|
|
2186
|
+
value: store,
|
|
2187
|
+
children: children
|
|
2188
|
+
});
|
|
2190
2189
|
}
|
|
2191
2190
|
function unmountComponentAtNode(canvas, callback) {
|
|
2192
2191
|
const root = _roots.get(canvas);
|
|
@@ -2215,7 +2214,7 @@ function unmountComponentAtNode(canvas, callback) {
|
|
|
2215
2214
|
}
|
|
2216
2215
|
}
|
|
2217
2216
|
function createPortal(children, container, state) {
|
|
2218
|
-
return /*#__PURE__*/
|
|
2217
|
+
return /*#__PURE__*/jsx(Portal, {
|
|
2219
2218
|
children: children,
|
|
2220
2219
|
container: container,
|
|
2221
2220
|
state: state
|
|
@@ -2298,9 +2297,12 @@ function Portal({
|
|
|
2298
2297
|
return store;
|
|
2299
2298
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2300
2299
|
}, [previousRoot, container]);
|
|
2301
|
-
return /*#__PURE__*/
|
|
2302
|
-
|
|
2303
|
-
|
|
2300
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
2301
|
+
children: reconciler.createPortal( /*#__PURE__*/jsx(context.Provider, {
|
|
2302
|
+
value: usePortalStore,
|
|
2303
|
+
children: children
|
|
2304
|
+
}), usePortalStore, null)
|
|
2305
|
+
});
|
|
2304
2306
|
}
|
|
2305
2307
|
reconciler.injectIntoDevTools({
|
|
2306
2308
|
bundleType: process.env.NODE_ENV === 'production' ? 0 : 1,
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var loop = require('./loop-
|
|
6
|
-
var _extends = require('@babel/runtime/helpers/extends');
|
|
5
|
+
var loop = require('./loop-c991cb05.cjs.dev.js');
|
|
7
6
|
var React = require('react');
|
|
8
7
|
var THREE = require('three');
|
|
9
8
|
var useMeasure = require('react-use-measure');
|
|
10
9
|
var itsFine = require('its-fine');
|
|
10
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
11
11
|
require('react-reconciler/constants');
|
|
12
12
|
require('zustand/traditional');
|
|
13
13
|
require('react-reconciler');
|
|
@@ -213,13 +213,17 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
213
213
|
onCreated == null ? void 0 : onCreated(state);
|
|
214
214
|
}
|
|
215
215
|
});
|
|
216
|
-
root.current.render( /*#__PURE__*/
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
216
|
+
root.current.render( /*#__PURE__*/jsxRuntime.jsx(Bridge, {
|
|
217
|
+
children: /*#__PURE__*/jsxRuntime.jsx(loop.ErrorBoundary, {
|
|
218
|
+
set: setError,
|
|
219
|
+
children: /*#__PURE__*/jsxRuntime.jsx(React__namespace.Suspense, {
|
|
220
|
+
fallback: /*#__PURE__*/jsxRuntime.jsx(loop.Block, {
|
|
221
|
+
set: setBlock
|
|
222
|
+
}),
|
|
223
|
+
children: children
|
|
224
|
+
})
|
|
221
225
|
})
|
|
222
|
-
}
|
|
226
|
+
}));
|
|
223
227
|
}
|
|
224
228
|
});
|
|
225
229
|
React__namespace.useEffect(() => {
|
|
@@ -230,7 +234,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
230
234
|
// When the event source is not this div, we need to set pointer-events to none
|
|
231
235
|
// Or else the canvas will block events from reaching the event source
|
|
232
236
|
const pointerEvents = eventSource ? 'none' : 'auto';
|
|
233
|
-
return /*#__PURE__*/
|
|
237
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
234
238
|
ref: divRef,
|
|
235
239
|
style: {
|
|
236
240
|
position: 'relative',
|
|
@@ -239,19 +243,23 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
239
243
|
overflow: 'hidden',
|
|
240
244
|
pointerEvents,
|
|
241
245
|
...style
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
246
|
+
},
|
|
247
|
+
...props,
|
|
248
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
249
|
+
ref: containerRef,
|
|
250
|
+
style: {
|
|
251
|
+
width: '100%',
|
|
252
|
+
height: '100%'
|
|
253
|
+
},
|
|
254
|
+
children: /*#__PURE__*/jsxRuntime.jsx("canvas", {
|
|
255
|
+
ref: canvasRef,
|
|
256
|
+
style: {
|
|
257
|
+
display: 'block'
|
|
258
|
+
},
|
|
259
|
+
children: fallback
|
|
260
|
+
})
|
|
261
|
+
})
|
|
262
|
+
});
|
|
255
263
|
});
|
|
256
264
|
|
|
257
265
|
/**
|
|
@@ -259,9 +267,12 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
259
267
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
260
268
|
*/
|
|
261
269
|
const Canvas = /*#__PURE__*/React__namespace.forwardRef(function CanvasWrapper(props, ref) {
|
|
262
|
-
return /*#__PURE__*/
|
|
263
|
-
|
|
264
|
-
|
|
270
|
+
return /*#__PURE__*/jsxRuntime.jsx(itsFine.FiberProvider, {
|
|
271
|
+
children: /*#__PURE__*/jsxRuntime.jsx(CanvasImpl, {
|
|
272
|
+
...props,
|
|
273
|
+
ref: ref
|
|
274
|
+
})
|
|
275
|
+
});
|
|
265
276
|
});
|
|
266
277
|
|
|
267
278
|
exports.FixedStage = loop.FixedStage;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var loop = require('./loop-
|
|
6
|
-
var _extends = require('@babel/runtime/helpers/extends');
|
|
5
|
+
var loop = require('./loop-6e8a6208.cjs.prod.js');
|
|
7
6
|
var React = require('react');
|
|
8
7
|
var THREE = require('three');
|
|
9
8
|
var useMeasure = require('react-use-measure');
|
|
10
9
|
var itsFine = require('its-fine');
|
|
10
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
11
11
|
require('react-reconciler/constants');
|
|
12
12
|
require('zustand/traditional');
|
|
13
13
|
require('react-reconciler');
|
|
@@ -213,13 +213,17 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
213
213
|
onCreated == null ? void 0 : onCreated(state);
|
|
214
214
|
}
|
|
215
215
|
});
|
|
216
|
-
root.current.render( /*#__PURE__*/
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
216
|
+
root.current.render( /*#__PURE__*/jsxRuntime.jsx(Bridge, {
|
|
217
|
+
children: /*#__PURE__*/jsxRuntime.jsx(loop.ErrorBoundary, {
|
|
218
|
+
set: setError,
|
|
219
|
+
children: /*#__PURE__*/jsxRuntime.jsx(React__namespace.Suspense, {
|
|
220
|
+
fallback: /*#__PURE__*/jsxRuntime.jsx(loop.Block, {
|
|
221
|
+
set: setBlock
|
|
222
|
+
}),
|
|
223
|
+
children: children
|
|
224
|
+
})
|
|
221
225
|
})
|
|
222
|
-
}
|
|
226
|
+
}));
|
|
223
227
|
}
|
|
224
228
|
});
|
|
225
229
|
React__namespace.useEffect(() => {
|
|
@@ -230,7 +234,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
230
234
|
// When the event source is not this div, we need to set pointer-events to none
|
|
231
235
|
// Or else the canvas will block events from reaching the event source
|
|
232
236
|
const pointerEvents = eventSource ? 'none' : 'auto';
|
|
233
|
-
return /*#__PURE__*/
|
|
237
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
234
238
|
ref: divRef,
|
|
235
239
|
style: {
|
|
236
240
|
position: 'relative',
|
|
@@ -239,19 +243,23 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
239
243
|
overflow: 'hidden',
|
|
240
244
|
pointerEvents,
|
|
241
245
|
...style
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
246
|
+
},
|
|
247
|
+
...props,
|
|
248
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
249
|
+
ref: containerRef,
|
|
250
|
+
style: {
|
|
251
|
+
width: '100%',
|
|
252
|
+
height: '100%'
|
|
253
|
+
},
|
|
254
|
+
children: /*#__PURE__*/jsxRuntime.jsx("canvas", {
|
|
255
|
+
ref: canvasRef,
|
|
256
|
+
style: {
|
|
257
|
+
display: 'block'
|
|
258
|
+
},
|
|
259
|
+
children: fallback
|
|
260
|
+
})
|
|
261
|
+
})
|
|
262
|
+
});
|
|
255
263
|
});
|
|
256
264
|
|
|
257
265
|
/**
|
|
@@ -259,9 +267,12 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
259
267
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
260
268
|
*/
|
|
261
269
|
const Canvas = /*#__PURE__*/React__namespace.forwardRef(function CanvasWrapper(props, ref) {
|
|
262
|
-
return /*#__PURE__*/
|
|
263
|
-
|
|
264
|
-
|
|
270
|
+
return /*#__PURE__*/jsxRuntime.jsx(itsFine.FiberProvider, {
|
|
271
|
+
children: /*#__PURE__*/jsxRuntime.jsx(CanvasImpl, {
|
|
272
|
+
...props,
|
|
273
|
+
ref: ref
|
|
274
|
+
})
|
|
275
|
+
});
|
|
265
276
|
});
|
|
266
277
|
|
|
267
278
|
exports.FixedStage = loop.FixedStage;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { c as createEvents, e as extend, u as useBridge, a as useMutableCallback, b as useIsomorphicLayoutEffect, d as createRoot, i as isRef, E as ErrorBoundary, B as Block, f as unmountComponentAtNode } from './loop-
|
|
2
|
-
export { F as FixedStage, t as ReactThreeFiber, S as Stage, p as Stages, _ as _roots, x as act, j as addAfterEffect, h as addEffect, k as addTail, m as advance, s as applyProps, y as buildGraph, q as context, c as createEvents, o as createPortal, d as createRoot, w as dispose, e as extend, g as flushGlobalEffects, v as getRootState, l as invalidate, r as reconciler, n as render, f as unmountComponentAtNode, D as useFrame, H as useGraph, z as useInstanceHandle, I as useLoader, A as useStore, C as useThree, G as useUpdate } from './loop-
|
|
3
|
-
import _extends from '@babel/runtime/helpers/esm/extends';
|
|
1
|
+
import { c as createEvents, e as extend, u as useBridge, a as useMutableCallback, b as useIsomorphicLayoutEffect, d as createRoot, i as isRef, E as ErrorBoundary, B as Block, f as unmountComponentAtNode } from './loop-ef070875.esm.js';
|
|
2
|
+
export { F as FixedStage, t as ReactThreeFiber, S as Stage, p as Stages, _ as _roots, x as act, j as addAfterEffect, h as addEffect, k as addTail, m as advance, s as applyProps, y as buildGraph, q as context, c as createEvents, o as createPortal, d as createRoot, w as dispose, e as extend, g as flushGlobalEffects, v as getRootState, l as invalidate, r as reconciler, n as render, f as unmountComponentAtNode, D as useFrame, H as useGraph, z as useInstanceHandle, I as useLoader, A as useStore, C as useThree, G as useUpdate } from './loop-ef070875.esm.js';
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
import * as THREE from 'three';
|
|
6
5
|
import useMeasure from 'react-use-measure';
|
|
7
6
|
import { FiberProvider } from 'its-fine';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
8
|
import 'react-reconciler/constants';
|
|
9
9
|
import 'zustand/traditional';
|
|
10
10
|
import 'react-reconciler';
|
|
@@ -186,13 +186,17 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(function Canvas({
|
|
|
186
186
|
onCreated == null ? void 0 : onCreated(state);
|
|
187
187
|
}
|
|
188
188
|
});
|
|
189
|
-
root.current.render( /*#__PURE__*/
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
189
|
+
root.current.render( /*#__PURE__*/jsx(Bridge, {
|
|
190
|
+
children: /*#__PURE__*/jsx(ErrorBoundary, {
|
|
191
|
+
set: setError,
|
|
192
|
+
children: /*#__PURE__*/jsx(React.Suspense, {
|
|
193
|
+
fallback: /*#__PURE__*/jsx(Block, {
|
|
194
|
+
set: setBlock
|
|
195
|
+
}),
|
|
196
|
+
children: children
|
|
197
|
+
})
|
|
194
198
|
})
|
|
195
|
-
}
|
|
199
|
+
}));
|
|
196
200
|
}
|
|
197
201
|
});
|
|
198
202
|
React.useEffect(() => {
|
|
@@ -203,7 +207,7 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(function Canvas({
|
|
|
203
207
|
// When the event source is not this div, we need to set pointer-events to none
|
|
204
208
|
// Or else the canvas will block events from reaching the event source
|
|
205
209
|
const pointerEvents = eventSource ? 'none' : 'auto';
|
|
206
|
-
return /*#__PURE__*/
|
|
210
|
+
return /*#__PURE__*/jsx("div", {
|
|
207
211
|
ref: divRef,
|
|
208
212
|
style: {
|
|
209
213
|
position: 'relative',
|
|
@@ -212,19 +216,23 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(function Canvas({
|
|
|
212
216
|
overflow: 'hidden',
|
|
213
217
|
pointerEvents,
|
|
214
218
|
...style
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
219
|
+
},
|
|
220
|
+
...props,
|
|
221
|
+
children: /*#__PURE__*/jsx("div", {
|
|
222
|
+
ref: containerRef,
|
|
223
|
+
style: {
|
|
224
|
+
width: '100%',
|
|
225
|
+
height: '100%'
|
|
226
|
+
},
|
|
227
|
+
children: /*#__PURE__*/jsx("canvas", {
|
|
228
|
+
ref: canvasRef,
|
|
229
|
+
style: {
|
|
230
|
+
display: 'block'
|
|
231
|
+
},
|
|
232
|
+
children: fallback
|
|
233
|
+
})
|
|
234
|
+
})
|
|
235
|
+
});
|
|
228
236
|
});
|
|
229
237
|
|
|
230
238
|
/**
|
|
@@ -232,9 +240,12 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(function Canvas({
|
|
|
232
240
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
233
241
|
*/
|
|
234
242
|
const Canvas = /*#__PURE__*/React.forwardRef(function CanvasWrapper(props, ref) {
|
|
235
|
-
return /*#__PURE__*/
|
|
236
|
-
|
|
237
|
-
|
|
243
|
+
return /*#__PURE__*/jsx(FiberProvider, {
|
|
244
|
+
children: /*#__PURE__*/jsx(CanvasImpl, {
|
|
245
|
+
...props,
|
|
246
|
+
ref: ref
|
|
247
|
+
})
|
|
248
|
+
});
|
|
238
249
|
});
|
|
239
250
|
|
|
240
251
|
export { Canvas, createPointerEvents as events };
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var loop = require('../../dist/loop-
|
|
6
|
-
var _extends = require('@babel/runtime/helpers/extends');
|
|
5
|
+
var loop = require('../../dist/loop-c991cb05.cjs.dev.js');
|
|
7
6
|
var React = require('react');
|
|
8
7
|
var THREE = require('three');
|
|
9
8
|
var reactNative = require('react-native');
|
|
10
9
|
var expoGl = require('expo-gl');
|
|
11
10
|
var itsFine = require('its-fine');
|
|
11
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
12
12
|
var expoAsset = require('expo-asset');
|
|
13
13
|
var fs = require('expo-file-system');
|
|
14
14
|
var base64Js = require('base64-js');
|
|
@@ -255,31 +255,38 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
255
255
|
return onCreated == null ? void 0 : onCreated(state);
|
|
256
256
|
}
|
|
257
257
|
});
|
|
258
|
-
root.current.render( /*#__PURE__*/
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
258
|
+
root.current.render( /*#__PURE__*/jsxRuntime.jsx(Bridge, {
|
|
259
|
+
children: /*#__PURE__*/jsxRuntime.jsx(loop.ErrorBoundary, {
|
|
260
|
+
set: setError,
|
|
261
|
+
children: /*#__PURE__*/jsxRuntime.jsx(React__namespace.Suspense, {
|
|
262
|
+
fallback: /*#__PURE__*/jsxRuntime.jsx(loop.Block, {
|
|
263
|
+
set: setBlock
|
|
264
|
+
}),
|
|
265
|
+
children: children
|
|
266
|
+
})
|
|
263
267
|
})
|
|
264
|
-
}
|
|
268
|
+
}));
|
|
265
269
|
}
|
|
266
270
|
React__namespace.useEffect(() => {
|
|
267
271
|
if (canvas) {
|
|
268
272
|
return () => loop.unmountComponentAtNode(canvas);
|
|
269
273
|
}
|
|
270
274
|
}, [canvas]);
|
|
271
|
-
return /*#__PURE__*/
|
|
275
|
+
return /*#__PURE__*/jsxRuntime.jsx(_View, {
|
|
276
|
+
...props,
|
|
272
277
|
ref: viewRef,
|
|
273
278
|
onLayout: onLayout,
|
|
274
279
|
style: {
|
|
275
280
|
flex: 1,
|
|
276
281
|
...style
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
282
|
+
},
|
|
283
|
+
...bind,
|
|
284
|
+
children: width > 0 && /*#__PURE__*/jsxRuntime.jsx(expoGl.GLView, {
|
|
285
|
+
msaaSamples: antialias ? 4 : 0,
|
|
286
|
+
onContextCreate: onContextCreate,
|
|
287
|
+
style: reactNative.StyleSheet.absoluteFill
|
|
288
|
+
})
|
|
289
|
+
});
|
|
283
290
|
});
|
|
284
291
|
|
|
285
292
|
/**
|
|
@@ -287,9 +294,12 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
287
294
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
288
295
|
*/
|
|
289
296
|
const Canvas = /*#__PURE__*/React__namespace.forwardRef(function CanvasWrapper(props, ref) {
|
|
290
|
-
return /*#__PURE__*/
|
|
291
|
-
|
|
292
|
-
|
|
297
|
+
return /*#__PURE__*/jsxRuntime.jsx(itsFine.FiberProvider, {
|
|
298
|
+
children: /*#__PURE__*/jsxRuntime.jsx(CanvasImpl, {
|
|
299
|
+
...props,
|
|
300
|
+
ref: ref
|
|
301
|
+
})
|
|
302
|
+
});
|
|
293
303
|
});
|
|
294
304
|
|
|
295
305
|
// http://stackoverflow.com/questions/105034
|
|
@@ -425,7 +435,7 @@ function polyfills() {
|
|
|
425
435
|
texture.needsUpdate = true;
|
|
426
436
|
|
|
427
437
|
// Force non-DOM upload for EXGL texImage2D
|
|
428
|
-
// @ts-
|
|
438
|
+
// @ts-expect-error
|
|
429
439
|
texture.isDataTexture = true;
|
|
430
440
|
onLoad == null ? void 0 : onLoad(texture);
|
|
431
441
|
}).catch(onError);
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var loop = require('../../dist/loop-
|
|
6
|
-
var _extends = require('@babel/runtime/helpers/extends');
|
|
5
|
+
var loop = require('../../dist/loop-6e8a6208.cjs.prod.js');
|
|
7
6
|
var React = require('react');
|
|
8
7
|
var THREE = require('three');
|
|
9
8
|
var reactNative = require('react-native');
|
|
10
9
|
var expoGl = require('expo-gl');
|
|
11
10
|
var itsFine = require('its-fine');
|
|
11
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
12
12
|
var expoAsset = require('expo-asset');
|
|
13
13
|
var fs = require('expo-file-system');
|
|
14
14
|
var base64Js = require('base64-js');
|
|
@@ -255,31 +255,38 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
255
255
|
return onCreated == null ? void 0 : onCreated(state);
|
|
256
256
|
}
|
|
257
257
|
});
|
|
258
|
-
root.current.render( /*#__PURE__*/
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
258
|
+
root.current.render( /*#__PURE__*/jsxRuntime.jsx(Bridge, {
|
|
259
|
+
children: /*#__PURE__*/jsxRuntime.jsx(loop.ErrorBoundary, {
|
|
260
|
+
set: setError,
|
|
261
|
+
children: /*#__PURE__*/jsxRuntime.jsx(React__namespace.Suspense, {
|
|
262
|
+
fallback: /*#__PURE__*/jsxRuntime.jsx(loop.Block, {
|
|
263
|
+
set: setBlock
|
|
264
|
+
}),
|
|
265
|
+
children: children
|
|
266
|
+
})
|
|
263
267
|
})
|
|
264
|
-
}
|
|
268
|
+
}));
|
|
265
269
|
}
|
|
266
270
|
React__namespace.useEffect(() => {
|
|
267
271
|
if (canvas) {
|
|
268
272
|
return () => loop.unmountComponentAtNode(canvas);
|
|
269
273
|
}
|
|
270
274
|
}, [canvas]);
|
|
271
|
-
return /*#__PURE__*/
|
|
275
|
+
return /*#__PURE__*/jsxRuntime.jsx(_View, {
|
|
276
|
+
...props,
|
|
272
277
|
ref: viewRef,
|
|
273
278
|
onLayout: onLayout,
|
|
274
279
|
style: {
|
|
275
280
|
flex: 1,
|
|
276
281
|
...style
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
282
|
+
},
|
|
283
|
+
...bind,
|
|
284
|
+
children: width > 0 && /*#__PURE__*/jsxRuntime.jsx(expoGl.GLView, {
|
|
285
|
+
msaaSamples: antialias ? 4 : 0,
|
|
286
|
+
onContextCreate: onContextCreate,
|
|
287
|
+
style: reactNative.StyleSheet.absoluteFill
|
|
288
|
+
})
|
|
289
|
+
});
|
|
283
290
|
});
|
|
284
291
|
|
|
285
292
|
/**
|
|
@@ -287,9 +294,12 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
287
294
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
288
295
|
*/
|
|
289
296
|
const Canvas = /*#__PURE__*/React__namespace.forwardRef(function CanvasWrapper(props, ref) {
|
|
290
|
-
return /*#__PURE__*/
|
|
291
|
-
|
|
292
|
-
|
|
297
|
+
return /*#__PURE__*/jsxRuntime.jsx(itsFine.FiberProvider, {
|
|
298
|
+
children: /*#__PURE__*/jsxRuntime.jsx(CanvasImpl, {
|
|
299
|
+
...props,
|
|
300
|
+
ref: ref
|
|
301
|
+
})
|
|
302
|
+
});
|
|
293
303
|
});
|
|
294
304
|
|
|
295
305
|
// http://stackoverflow.com/questions/105034
|
|
@@ -425,7 +435,7 @@ function polyfills() {
|
|
|
425
435
|
texture.needsUpdate = true;
|
|
426
436
|
|
|
427
437
|
// Force non-DOM upload for EXGL texImage2D
|
|
428
|
-
// @ts-
|
|
438
|
+
// @ts-expect-error
|
|
429
439
|
texture.isDataTexture = true;
|
|
430
440
|
onLoad == null ? void 0 : onLoad(texture);
|
|
431
441
|
}).catch(onError);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { c as createEvents, e as extend, u as useBridge, a as useMutableCallback, d as createRoot, E as ErrorBoundary, B as Block, f as unmountComponentAtNode } from '../../dist/loop-
|
|
2
|
-
export { F as FixedStage, t as ReactThreeFiber, S as Stage, p as Stages, _ as _roots, x as act, j as addAfterEffect, h as addEffect, k as addTail, m as advance, s as applyProps, y as buildGraph, q as context, c as createEvents, o as createPortal, d as createRoot, w as dispose, e as extend, g as flushGlobalEffects, v as getRootState, l as invalidate, r as reconciler, n as render, f as unmountComponentAtNode, D as useFrame, H as useGraph, z as useInstanceHandle, I as useLoader, A as useStore, C as useThree, G as useUpdate } from '../../dist/loop-
|
|
3
|
-
import _extends from '@babel/runtime/helpers/esm/extends';
|
|
1
|
+
import { c as createEvents, e as extend, u as useBridge, a as useMutableCallback, d as createRoot, E as ErrorBoundary, B as Block, f as unmountComponentAtNode } from '../../dist/loop-ef070875.esm.js';
|
|
2
|
+
export { F as FixedStage, t as ReactThreeFiber, S as Stage, p as Stages, _ as _roots, x as act, j as addAfterEffect, h as addEffect, k as addTail, m as advance, s as applyProps, y as buildGraph, q as context, c as createEvents, o as createPortal, d as createRoot, w as dispose, e as extend, g as flushGlobalEffects, v as getRootState, l as invalidate, r as reconciler, n as render, f as unmountComponentAtNode, D as useFrame, H as useGraph, z as useInstanceHandle, I as useLoader, A as useStore, C as useThree, G as useUpdate } from '../../dist/loop-ef070875.esm.js';
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
import * as THREE from 'three';
|
|
6
5
|
import { PanResponder, PixelRatio, StyleSheet, View, Platform, Image, NativeModules } from 'react-native';
|
|
7
6
|
import { GLView } from 'expo-gl';
|
|
8
7
|
import { FiberProvider } from 'its-fine';
|
|
8
|
+
import { jsx } from 'react/jsx-runtime';
|
|
9
9
|
import { Asset } from 'expo-asset';
|
|
10
10
|
import * as fs from 'expo-file-system';
|
|
11
11
|
import { fromByteArray } from 'base64-js';
|
|
@@ -230,31 +230,38 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(({
|
|
|
230
230
|
return onCreated == null ? void 0 : onCreated(state);
|
|
231
231
|
}
|
|
232
232
|
});
|
|
233
|
-
root.current.render( /*#__PURE__*/
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
233
|
+
root.current.render( /*#__PURE__*/jsx(Bridge, {
|
|
234
|
+
children: /*#__PURE__*/jsx(ErrorBoundary, {
|
|
235
|
+
set: setError,
|
|
236
|
+
children: /*#__PURE__*/jsx(React.Suspense, {
|
|
237
|
+
fallback: /*#__PURE__*/jsx(Block, {
|
|
238
|
+
set: setBlock
|
|
239
|
+
}),
|
|
240
|
+
children: children
|
|
241
|
+
})
|
|
238
242
|
})
|
|
239
|
-
}
|
|
243
|
+
}));
|
|
240
244
|
}
|
|
241
245
|
React.useEffect(() => {
|
|
242
246
|
if (canvas) {
|
|
243
247
|
return () => unmountComponentAtNode(canvas);
|
|
244
248
|
}
|
|
245
249
|
}, [canvas]);
|
|
246
|
-
return /*#__PURE__*/
|
|
250
|
+
return /*#__PURE__*/jsx(_View, {
|
|
251
|
+
...props,
|
|
247
252
|
ref: viewRef,
|
|
248
253
|
onLayout: onLayout,
|
|
249
254
|
style: {
|
|
250
255
|
flex: 1,
|
|
251
256
|
...style
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
257
|
+
},
|
|
258
|
+
...bind,
|
|
259
|
+
children: width > 0 && /*#__PURE__*/jsx(GLView, {
|
|
260
|
+
msaaSamples: antialias ? 4 : 0,
|
|
261
|
+
onContextCreate: onContextCreate,
|
|
262
|
+
style: StyleSheet.absoluteFill
|
|
263
|
+
})
|
|
264
|
+
});
|
|
258
265
|
});
|
|
259
266
|
|
|
260
267
|
/**
|
|
@@ -262,9 +269,12 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(({
|
|
|
262
269
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
263
270
|
*/
|
|
264
271
|
const Canvas = /*#__PURE__*/React.forwardRef(function CanvasWrapper(props, ref) {
|
|
265
|
-
return /*#__PURE__*/
|
|
266
|
-
|
|
267
|
-
|
|
272
|
+
return /*#__PURE__*/jsx(FiberProvider, {
|
|
273
|
+
children: /*#__PURE__*/jsx(CanvasImpl, {
|
|
274
|
+
...props,
|
|
275
|
+
ref: ref
|
|
276
|
+
})
|
|
277
|
+
});
|
|
268
278
|
});
|
|
269
279
|
|
|
270
280
|
// http://stackoverflow.com/questions/105034
|
|
@@ -400,7 +410,7 @@ function polyfills() {
|
|
|
400
410
|
texture.needsUpdate = true;
|
|
401
411
|
|
|
402
412
|
// Force non-DOM upload for EXGL texImage2D
|
|
403
|
-
// @ts-
|
|
413
|
+
// @ts-expect-error
|
|
404
414
|
texture.isDataTexture = true;
|
|
405
415
|
onLoad == null ? void 0 : onLoad(texture);
|
|
406
416
|
}).catch(onError);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-three/fiber",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.6",
|
|
4
4
|
"description": "A React renderer for Threejs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"base64-js": "^1.5.1",
|
|
48
48
|
"buffer": "^6.0.3",
|
|
49
49
|
"its-fine": "^1.2.5",
|
|
50
|
-
"react-reconciler": "0.31.0-beta-
|
|
50
|
+
"react-reconciler": "0.31.0-beta-6946ebe620-20240508",
|
|
51
51
|
"react-use-measure": "^2.1.1",
|
|
52
|
-
"scheduler": "0.25.0-beta-
|
|
52
|
+
"scheduler": "0.25.0-beta-6946ebe620-20240508",
|
|
53
53
|
"suspend-react": "^0.1.3",
|
|
54
54
|
"zustand": "^4.1.2"
|
|
55
55
|
},
|
package/readme.md
CHANGED
|
@@ -22,7 +22,7 @@ None. Everything that works in Threejs will work here without exception.
|
|
|
22
22
|
|
|
23
23
|
#### Is it slower than plain Threejs?
|
|
24
24
|
|
|
25
|
-
No. There is no overhead. Components render outside of React. It outperforms Threejs in scale due to
|
|
25
|
+
No. There is no overhead. Components render outside of React. It outperforms Threejs in scale due to React's scheduling abilities.
|
|
26
26
|
|
|
27
27
|
#### Can it keep up with frequent feature updates to Threejs?
|
|
28
28
|
|