@react-three/fiber 8.16.4 → 8.16.5
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 +6 -0
- package/dist/declarations/src/core/index.d.ts +1 -1
- package/dist/declarations/src/three-types.d.ts +18 -0
- package/dist/{index-67aff14f.cjs.prod.js → index-81568a48.cjs.prod.js} +17 -13
- package/dist/{index-20975705.cjs.dev.js → index-b1a4ae91.cjs.dev.js} +17 -13
- package/dist/{index-d449885c.esm.js → index-b552952e.esm.js} +17 -13
- 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 +1 -1
- package/readme.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -81,7 +81,7 @@ export declare type InjectState = Partial<Omit<RootState, PrivateKeys> & {
|
|
|
81
81
|
};
|
|
82
82
|
size?: Size;
|
|
83
83
|
}>;
|
|
84
|
-
declare function createPortal(children: React.ReactNode, container: THREE.Object3D, state?: InjectState): JSX.Element;
|
|
84
|
+
declare function createPortal(children: React.ReactNode, container: THREE.Object3D, state?: InjectState): React.JSX.Element;
|
|
85
85
|
declare const act: any;
|
|
86
86
|
export * from './hooks';
|
|
87
87
|
export { context, render, createRoot, unmountComponentAtNode, createPortal, reconciler, applyProps, dispose, invalidate, advance, extend, addEffect, addAfterEffect, addTail, flushGlobalEffects, getRootState, act, buildGraph, roots as _roots, };
|
|
@@ -390,4 +390,22 @@ declare global {
|
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
|
+
declare module 'react' {
|
|
394
|
+
namespace JSX {
|
|
395
|
+
interface IntrinsicElements extends ThreeElements {
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
declare module 'react/jsx-runtime' {
|
|
400
|
+
namespace JSX {
|
|
401
|
+
interface IntrinsicElements extends ThreeElements {
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
declare module 'react/jsx-dev-runtime' {
|
|
406
|
+
namespace JSX {
|
|
407
|
+
interface IntrinsicElements extends ThreeElements {
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
393
411
|
export {};
|
|
@@ -7,6 +7,7 @@ var create = require('zustand');
|
|
|
7
7
|
var Reconciler = require('react-reconciler');
|
|
8
8
|
var scheduler = require('scheduler');
|
|
9
9
|
var suspendReact = require('suspend-react');
|
|
10
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
10
11
|
|
|
11
12
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
12
13
|
|
|
@@ -154,7 +155,7 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
154
155
|
} else if (child.isObject3D && parentInstance.isObject3D) {
|
|
155
156
|
var _child$__r3f4;
|
|
156
157
|
parentInstance.remove(child);
|
|
157
|
-
// @ts-
|
|
158
|
+
// @ts-expect-error
|
|
158
159
|
// Remove interactivity on the initial root
|
|
159
160
|
if ((_child$__r3f4 = child.__r3f) != null && _child$__r3f4.root) {
|
|
160
161
|
removeInteractivity(findInitialRoot(child), child);
|
|
@@ -369,7 +370,7 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
369
370
|
hideTextInstance: handleTextInstance,
|
|
370
371
|
unhideTextInstance: handleTextInstance,
|
|
371
372
|
// https://github.com/pmndrs/react-three-fiber/pull/2360#discussion_r916356874
|
|
372
|
-
// @ts-
|
|
373
|
+
// @ts-expect-error
|
|
373
374
|
getCurrentEventPriority: () => _getEventPriority ? _getEventPriority() : constants.DefaultEventPriority,
|
|
374
375
|
beforeActiveInstanceBlur: () => {},
|
|
375
376
|
afterActiveInstanceBlur: () => {},
|
|
@@ -724,7 +725,7 @@ function applyProps$1(instance, data) {
|
|
|
724
725
|
// create a blank slate of the instance and copy the particular parameter.
|
|
725
726
|
let ctor = DEFAULTS.get(currentInstance.constructor);
|
|
726
727
|
if (!ctor) {
|
|
727
|
-
// @ts-
|
|
728
|
+
// @ts-expect-error
|
|
728
729
|
ctor = new currentInstance.constructor();
|
|
729
730
|
DEFAULTS.set(currentInstance.constructor, ctor);
|
|
730
731
|
}
|
|
@@ -2059,7 +2060,7 @@ function createRoot(canvas) {
|
|
|
2059
2060
|
render(children) {
|
|
2060
2061
|
// The root has to be configured before it can be rendered
|
|
2061
2062
|
if (!configured) this.configure();
|
|
2062
|
-
reconciler.updateContainer( /*#__PURE__*/
|
|
2063
|
+
reconciler.updateContainer( /*#__PURE__*/jsxRuntime.jsx(Provider, {
|
|
2063
2064
|
store: store,
|
|
2064
2065
|
children: children,
|
|
2065
2066
|
onCreated: onCreated,
|
|
@@ -2100,9 +2101,10 @@ function Provider({
|
|
|
2100
2101
|
if (!store.getState().events.connected) state.events.connect == null ? void 0 : state.events.connect(rootElement);
|
|
2101
2102
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2102
2103
|
}, []);
|
|
2103
|
-
return /*#__PURE__*/
|
|
2104
|
-
value: store
|
|
2105
|
-
|
|
2104
|
+
return /*#__PURE__*/jsxRuntime.jsx(context.Provider, {
|
|
2105
|
+
value: store,
|
|
2106
|
+
children: children
|
|
2107
|
+
});
|
|
2106
2108
|
}
|
|
2107
2109
|
function unmountComponentAtNode(canvas, callback) {
|
|
2108
2110
|
const root = roots.get(canvas);
|
|
@@ -2131,12 +2133,11 @@ function unmountComponentAtNode(canvas, callback) {
|
|
|
2131
2133
|
}
|
|
2132
2134
|
}
|
|
2133
2135
|
function createPortal(children, container, state) {
|
|
2134
|
-
return /*#__PURE__*/
|
|
2135
|
-
key: container.uuid,
|
|
2136
|
+
return /*#__PURE__*/jsxRuntime.jsx(Portal, {
|
|
2136
2137
|
children: children,
|
|
2137
2138
|
container: container,
|
|
2138
2139
|
state: state
|
|
2139
|
-
});
|
|
2140
|
+
}, container.uuid);
|
|
2140
2141
|
}
|
|
2141
2142
|
function Portal({
|
|
2142
2143
|
state = {},
|
|
@@ -2262,9 +2263,12 @@ function Portal({
|
|
|
2262
2263
|
};
|
|
2263
2264
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2264
2265
|
}, []);
|
|
2265
|
-
return /*#__PURE__*/
|
|
2266
|
-
|
|
2267
|
-
|
|
2266
|
+
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
2267
|
+
children: reconciler.createPortal( /*#__PURE__*/jsxRuntime.jsx(context.Provider, {
|
|
2268
|
+
value: usePortalStore,
|
|
2269
|
+
children: children
|
|
2270
|
+
}), usePortalStore, null)
|
|
2271
|
+
});
|
|
2268
2272
|
}
|
|
2269
2273
|
reconciler.injectIntoDevTools({
|
|
2270
2274
|
bundleType: 0 ,
|
|
@@ -7,6 +7,7 @@ var create = require('zustand');
|
|
|
7
7
|
var Reconciler = require('react-reconciler');
|
|
8
8
|
var scheduler = require('scheduler');
|
|
9
9
|
var suspendReact = require('suspend-react');
|
|
10
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
10
11
|
|
|
11
12
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
12
13
|
|
|
@@ -154,7 +155,7 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
154
155
|
} else if (child.isObject3D && parentInstance.isObject3D) {
|
|
155
156
|
var _child$__r3f4;
|
|
156
157
|
parentInstance.remove(child);
|
|
157
|
-
// @ts-
|
|
158
|
+
// @ts-expect-error
|
|
158
159
|
// Remove interactivity on the initial root
|
|
159
160
|
if ((_child$__r3f4 = child.__r3f) != null && _child$__r3f4.root) {
|
|
160
161
|
removeInteractivity(findInitialRoot(child), child);
|
|
@@ -369,7 +370,7 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
369
370
|
hideTextInstance: handleTextInstance,
|
|
370
371
|
unhideTextInstance: handleTextInstance,
|
|
371
372
|
// https://github.com/pmndrs/react-three-fiber/pull/2360#discussion_r916356874
|
|
372
|
-
// @ts-
|
|
373
|
+
// @ts-expect-error
|
|
373
374
|
getCurrentEventPriority: () => _getEventPriority ? _getEventPriority() : constants.DefaultEventPriority,
|
|
374
375
|
beforeActiveInstanceBlur: () => {},
|
|
375
376
|
afterActiveInstanceBlur: () => {},
|
|
@@ -724,7 +725,7 @@ function applyProps$1(instance, data) {
|
|
|
724
725
|
// create a blank slate of the instance and copy the particular parameter.
|
|
725
726
|
let ctor = DEFAULTS.get(currentInstance.constructor);
|
|
726
727
|
if (!ctor) {
|
|
727
|
-
// @ts-
|
|
728
|
+
// @ts-expect-error
|
|
728
729
|
ctor = new currentInstance.constructor();
|
|
729
730
|
DEFAULTS.set(currentInstance.constructor, ctor);
|
|
730
731
|
}
|
|
@@ -2059,7 +2060,7 @@ function createRoot(canvas) {
|
|
|
2059
2060
|
render(children) {
|
|
2060
2061
|
// The root has to be configured before it can be rendered
|
|
2061
2062
|
if (!configured) this.configure();
|
|
2062
|
-
reconciler.updateContainer( /*#__PURE__*/
|
|
2063
|
+
reconciler.updateContainer( /*#__PURE__*/jsxRuntime.jsx(Provider, {
|
|
2063
2064
|
store: store,
|
|
2064
2065
|
children: children,
|
|
2065
2066
|
onCreated: onCreated,
|
|
@@ -2100,9 +2101,10 @@ function Provider({
|
|
|
2100
2101
|
if (!store.getState().events.connected) state.events.connect == null ? void 0 : state.events.connect(rootElement);
|
|
2101
2102
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2102
2103
|
}, []);
|
|
2103
|
-
return /*#__PURE__*/
|
|
2104
|
-
value: store
|
|
2105
|
-
|
|
2104
|
+
return /*#__PURE__*/jsxRuntime.jsx(context.Provider, {
|
|
2105
|
+
value: store,
|
|
2106
|
+
children: children
|
|
2107
|
+
});
|
|
2106
2108
|
}
|
|
2107
2109
|
function unmountComponentAtNode(canvas, callback) {
|
|
2108
2110
|
const root = roots.get(canvas);
|
|
@@ -2131,12 +2133,11 @@ function unmountComponentAtNode(canvas, callback) {
|
|
|
2131
2133
|
}
|
|
2132
2134
|
}
|
|
2133
2135
|
function createPortal(children, container, state) {
|
|
2134
|
-
return /*#__PURE__*/
|
|
2135
|
-
key: container.uuid,
|
|
2136
|
+
return /*#__PURE__*/jsxRuntime.jsx(Portal, {
|
|
2136
2137
|
children: children,
|
|
2137
2138
|
container: container,
|
|
2138
2139
|
state: state
|
|
2139
|
-
});
|
|
2140
|
+
}, container.uuid);
|
|
2140
2141
|
}
|
|
2141
2142
|
function Portal({
|
|
2142
2143
|
state = {},
|
|
@@ -2262,9 +2263,12 @@ function Portal({
|
|
|
2262
2263
|
};
|
|
2263
2264
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2264
2265
|
}, []);
|
|
2265
|
-
return /*#__PURE__*/
|
|
2266
|
-
|
|
2267
|
-
|
|
2266
|
+
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
2267
|
+
children: reconciler.createPortal( /*#__PURE__*/jsxRuntime.jsx(context.Provider, {
|
|
2268
|
+
value: usePortalStore,
|
|
2269
|
+
children: children
|
|
2270
|
+
}), usePortalStore, null)
|
|
2271
|
+
});
|
|
2268
2272
|
}
|
|
2269
2273
|
reconciler.injectIntoDevTools({
|
|
2270
2274
|
bundleType: process.env.NODE_ENV === 'production' ? 0 : 1,
|
|
@@ -5,6 +5,7 @@ import create from 'zustand';
|
|
|
5
5
|
import Reconciler from 'react-reconciler';
|
|
6
6
|
import { unstable_scheduleCallback, unstable_IdlePriority } from 'scheduler';
|
|
7
7
|
import { suspend, preload, clear } from 'suspend-react';
|
|
8
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
8
9
|
|
|
9
10
|
var threeTypes = /*#__PURE__*/Object.freeze({
|
|
10
11
|
__proto__: null
|
|
@@ -127,7 +128,7 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
127
128
|
} else if (child.isObject3D && parentInstance.isObject3D) {
|
|
128
129
|
var _child$__r3f4;
|
|
129
130
|
parentInstance.remove(child);
|
|
130
|
-
// @ts-
|
|
131
|
+
// @ts-expect-error
|
|
131
132
|
// Remove interactivity on the initial root
|
|
132
133
|
if ((_child$__r3f4 = child.__r3f) != null && _child$__r3f4.root) {
|
|
133
134
|
removeInteractivity(findInitialRoot(child), child);
|
|
@@ -342,7 +343,7 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
342
343
|
hideTextInstance: handleTextInstance,
|
|
343
344
|
unhideTextInstance: handleTextInstance,
|
|
344
345
|
// https://github.com/pmndrs/react-three-fiber/pull/2360#discussion_r916356874
|
|
345
|
-
// @ts-
|
|
346
|
+
// @ts-expect-error
|
|
346
347
|
getCurrentEventPriority: () => _getEventPriority ? _getEventPriority() : DefaultEventPriority,
|
|
347
348
|
beforeActiveInstanceBlur: () => {},
|
|
348
349
|
afterActiveInstanceBlur: () => {},
|
|
@@ -697,7 +698,7 @@ function applyProps$1(instance, data) {
|
|
|
697
698
|
// create a blank slate of the instance and copy the particular parameter.
|
|
698
699
|
let ctor = DEFAULTS.get(currentInstance.constructor);
|
|
699
700
|
if (!ctor) {
|
|
700
|
-
// @ts-
|
|
701
|
+
// @ts-expect-error
|
|
701
702
|
ctor = new currentInstance.constructor();
|
|
702
703
|
DEFAULTS.set(currentInstance.constructor, ctor);
|
|
703
704
|
}
|
|
@@ -2032,7 +2033,7 @@ function createRoot(canvas) {
|
|
|
2032
2033
|
render(children) {
|
|
2033
2034
|
// The root has to be configured before it can be rendered
|
|
2034
2035
|
if (!configured) this.configure();
|
|
2035
|
-
reconciler.updateContainer( /*#__PURE__*/
|
|
2036
|
+
reconciler.updateContainer( /*#__PURE__*/jsx(Provider, {
|
|
2036
2037
|
store: store,
|
|
2037
2038
|
children: children,
|
|
2038
2039
|
onCreated: onCreated,
|
|
@@ -2073,9 +2074,10 @@ function Provider({
|
|
|
2073
2074
|
if (!store.getState().events.connected) state.events.connect == null ? void 0 : state.events.connect(rootElement);
|
|
2074
2075
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2075
2076
|
}, []);
|
|
2076
|
-
return /*#__PURE__*/
|
|
2077
|
-
value: store
|
|
2078
|
-
|
|
2077
|
+
return /*#__PURE__*/jsx(context.Provider, {
|
|
2078
|
+
value: store,
|
|
2079
|
+
children: children
|
|
2080
|
+
});
|
|
2079
2081
|
}
|
|
2080
2082
|
function unmountComponentAtNode(canvas, callback) {
|
|
2081
2083
|
const root = roots.get(canvas);
|
|
@@ -2104,12 +2106,11 @@ function unmountComponentAtNode(canvas, callback) {
|
|
|
2104
2106
|
}
|
|
2105
2107
|
}
|
|
2106
2108
|
function createPortal(children, container, state) {
|
|
2107
|
-
return /*#__PURE__*/
|
|
2108
|
-
key: container.uuid,
|
|
2109
|
+
return /*#__PURE__*/jsx(Portal, {
|
|
2109
2110
|
children: children,
|
|
2110
2111
|
container: container,
|
|
2111
2112
|
state: state
|
|
2112
|
-
});
|
|
2113
|
+
}, container.uuid);
|
|
2113
2114
|
}
|
|
2114
2115
|
function Portal({
|
|
2115
2116
|
state = {},
|
|
@@ -2235,9 +2236,12 @@ function Portal({
|
|
|
2235
2236
|
};
|
|
2236
2237
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2237
2238
|
}, []);
|
|
2238
|
-
return /*#__PURE__*/
|
|
2239
|
-
|
|
2240
|
-
|
|
2239
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
2240
|
+
children: reconciler.createPortal( /*#__PURE__*/jsx(context.Provider, {
|
|
2241
|
+
value: usePortalStore,
|
|
2242
|
+
children: children
|
|
2243
|
+
}), usePortalStore, null)
|
|
2244
|
+
});
|
|
2241
2245
|
}
|
|
2242
2246
|
reconciler.injectIntoDevTools({
|
|
2243
2247
|
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 index = require('./index-
|
|
6
|
-
var _extends = require('@babel/runtime/helpers/extends');
|
|
5
|
+
var index = require('./index-b1a4ae91.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');
|
|
13
13
|
require('react-reconciler');
|
|
@@ -210,13 +210,17 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
210
210
|
onCreated == null ? void 0 : onCreated(state);
|
|
211
211
|
}
|
|
212
212
|
});
|
|
213
|
-
root.current.render( /*#__PURE__*/
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
213
|
+
root.current.render( /*#__PURE__*/jsxRuntime.jsx(Bridge, {
|
|
214
|
+
children: /*#__PURE__*/jsxRuntime.jsx(index.ErrorBoundary, {
|
|
215
|
+
set: setError,
|
|
216
|
+
children: /*#__PURE__*/jsxRuntime.jsx(React__namespace.Suspense, {
|
|
217
|
+
fallback: /*#__PURE__*/jsxRuntime.jsx(index.Block, {
|
|
218
|
+
set: setBlock
|
|
219
|
+
}),
|
|
220
|
+
children: children
|
|
221
|
+
})
|
|
218
222
|
})
|
|
219
|
-
}
|
|
223
|
+
}));
|
|
220
224
|
}
|
|
221
225
|
});
|
|
222
226
|
React__namespace.useEffect(() => {
|
|
@@ -227,7 +231,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
227
231
|
// When the event source is not this div, we need to set pointer-events to none
|
|
228
232
|
// Or else the canvas will block events from reaching the event source
|
|
229
233
|
const pointerEvents = eventSource ? 'none' : 'auto';
|
|
230
|
-
return /*#__PURE__*/
|
|
234
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
231
235
|
ref: divRef,
|
|
232
236
|
style: {
|
|
233
237
|
position: 'relative',
|
|
@@ -236,19 +240,23 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
236
240
|
overflow: 'hidden',
|
|
237
241
|
pointerEvents,
|
|
238
242
|
...style
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
243
|
+
},
|
|
244
|
+
...props,
|
|
245
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
246
|
+
ref: containerRef,
|
|
247
|
+
style: {
|
|
248
|
+
width: '100%',
|
|
249
|
+
height: '100%'
|
|
250
|
+
},
|
|
251
|
+
children: /*#__PURE__*/jsxRuntime.jsx("canvas", {
|
|
252
|
+
ref: canvasRef,
|
|
253
|
+
style: {
|
|
254
|
+
display: 'block'
|
|
255
|
+
},
|
|
256
|
+
children: fallback
|
|
257
|
+
})
|
|
258
|
+
})
|
|
259
|
+
});
|
|
252
260
|
});
|
|
253
261
|
|
|
254
262
|
/**
|
|
@@ -256,9 +264,12 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
256
264
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
257
265
|
*/
|
|
258
266
|
const Canvas = /*#__PURE__*/React__namespace.forwardRef(function CanvasWrapper(props, ref) {
|
|
259
|
-
return /*#__PURE__*/
|
|
260
|
-
|
|
261
|
-
|
|
267
|
+
return /*#__PURE__*/jsxRuntime.jsx(itsFine.FiberProvider, {
|
|
268
|
+
children: /*#__PURE__*/jsxRuntime.jsx(CanvasImpl, {
|
|
269
|
+
...props,
|
|
270
|
+
ref: ref
|
|
271
|
+
})
|
|
272
|
+
});
|
|
262
273
|
});
|
|
263
274
|
|
|
264
275
|
exports.ReactThreeFiber = index.threeTypes;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
6
|
-
var _extends = require('@babel/runtime/helpers/extends');
|
|
5
|
+
var index = require('./index-81568a48.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');
|
|
13
13
|
require('react-reconciler');
|
|
@@ -210,13 +210,17 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
210
210
|
onCreated == null ? void 0 : onCreated(state);
|
|
211
211
|
}
|
|
212
212
|
});
|
|
213
|
-
root.current.render( /*#__PURE__*/
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
213
|
+
root.current.render( /*#__PURE__*/jsxRuntime.jsx(Bridge, {
|
|
214
|
+
children: /*#__PURE__*/jsxRuntime.jsx(index.ErrorBoundary, {
|
|
215
|
+
set: setError,
|
|
216
|
+
children: /*#__PURE__*/jsxRuntime.jsx(React__namespace.Suspense, {
|
|
217
|
+
fallback: /*#__PURE__*/jsxRuntime.jsx(index.Block, {
|
|
218
|
+
set: setBlock
|
|
219
|
+
}),
|
|
220
|
+
children: children
|
|
221
|
+
})
|
|
218
222
|
})
|
|
219
|
-
}
|
|
223
|
+
}));
|
|
220
224
|
}
|
|
221
225
|
});
|
|
222
226
|
React__namespace.useEffect(() => {
|
|
@@ -227,7 +231,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
227
231
|
// When the event source is not this div, we need to set pointer-events to none
|
|
228
232
|
// Or else the canvas will block events from reaching the event source
|
|
229
233
|
const pointerEvents = eventSource ? 'none' : 'auto';
|
|
230
|
-
return /*#__PURE__*/
|
|
234
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
231
235
|
ref: divRef,
|
|
232
236
|
style: {
|
|
233
237
|
position: 'relative',
|
|
@@ -236,19 +240,23 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
236
240
|
overflow: 'hidden',
|
|
237
241
|
pointerEvents,
|
|
238
242
|
...style
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
243
|
+
},
|
|
244
|
+
...props,
|
|
245
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
246
|
+
ref: containerRef,
|
|
247
|
+
style: {
|
|
248
|
+
width: '100%',
|
|
249
|
+
height: '100%'
|
|
250
|
+
},
|
|
251
|
+
children: /*#__PURE__*/jsxRuntime.jsx("canvas", {
|
|
252
|
+
ref: canvasRef,
|
|
253
|
+
style: {
|
|
254
|
+
display: 'block'
|
|
255
|
+
},
|
|
256
|
+
children: fallback
|
|
257
|
+
})
|
|
258
|
+
})
|
|
259
|
+
});
|
|
252
260
|
});
|
|
253
261
|
|
|
254
262
|
/**
|
|
@@ -256,9 +264,12 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
256
264
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
257
265
|
*/
|
|
258
266
|
const Canvas = /*#__PURE__*/React__namespace.forwardRef(function CanvasWrapper(props, ref) {
|
|
259
|
-
return /*#__PURE__*/
|
|
260
|
-
|
|
261
|
-
|
|
267
|
+
return /*#__PURE__*/jsxRuntime.jsx(itsFine.FiberProvider, {
|
|
268
|
+
children: /*#__PURE__*/jsxRuntime.jsx(CanvasImpl, {
|
|
269
|
+
...props,
|
|
270
|
+
ref: ref
|
|
271
|
+
})
|
|
272
|
+
});
|
|
262
273
|
});
|
|
263
274
|
|
|
264
275
|
exports.ReactThreeFiber = index.threeTypes;
|
|
@@ -1,10 +1,10 @@
|
|
|
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-
|
|
3
|
-
import _extends from '@babel/runtime/helpers/esm/extends';
|
|
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-b552952e.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-b552952e.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, useContextBridge } from 'its-fine';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
8
|
import 'react-reconciler/constants';
|
|
9
9
|
import 'zustand';
|
|
10
10
|
import 'react-reconciler';
|
|
@@ -183,13 +183,17 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(function Canvas({
|
|
|
183
183
|
onCreated == null ? void 0 : onCreated(state);
|
|
184
184
|
}
|
|
185
185
|
});
|
|
186
|
-
root.current.render( /*#__PURE__*/
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
186
|
+
root.current.render( /*#__PURE__*/jsx(Bridge, {
|
|
187
|
+
children: /*#__PURE__*/jsx(ErrorBoundary, {
|
|
188
|
+
set: setError,
|
|
189
|
+
children: /*#__PURE__*/jsx(React.Suspense, {
|
|
190
|
+
fallback: /*#__PURE__*/jsx(Block, {
|
|
191
|
+
set: setBlock
|
|
192
|
+
}),
|
|
193
|
+
children: children
|
|
194
|
+
})
|
|
191
195
|
})
|
|
192
|
-
}
|
|
196
|
+
}));
|
|
193
197
|
}
|
|
194
198
|
});
|
|
195
199
|
React.useEffect(() => {
|
|
@@ -200,7 +204,7 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(function Canvas({
|
|
|
200
204
|
// When the event source is not this div, we need to set pointer-events to none
|
|
201
205
|
// Or else the canvas will block events from reaching the event source
|
|
202
206
|
const pointerEvents = eventSource ? 'none' : 'auto';
|
|
203
|
-
return /*#__PURE__*/
|
|
207
|
+
return /*#__PURE__*/jsx("div", {
|
|
204
208
|
ref: divRef,
|
|
205
209
|
style: {
|
|
206
210
|
position: 'relative',
|
|
@@ -209,19 +213,23 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(function Canvas({
|
|
|
209
213
|
overflow: 'hidden',
|
|
210
214
|
pointerEvents,
|
|
211
215
|
...style
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
216
|
+
},
|
|
217
|
+
...props,
|
|
218
|
+
children: /*#__PURE__*/jsx("div", {
|
|
219
|
+
ref: containerRef,
|
|
220
|
+
style: {
|
|
221
|
+
width: '100%',
|
|
222
|
+
height: '100%'
|
|
223
|
+
},
|
|
224
|
+
children: /*#__PURE__*/jsx("canvas", {
|
|
225
|
+
ref: canvasRef,
|
|
226
|
+
style: {
|
|
227
|
+
display: 'block'
|
|
228
|
+
},
|
|
229
|
+
children: fallback
|
|
230
|
+
})
|
|
231
|
+
})
|
|
232
|
+
});
|
|
225
233
|
});
|
|
226
234
|
|
|
227
235
|
/**
|
|
@@ -229,9 +237,12 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(function Canvas({
|
|
|
229
237
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
230
238
|
*/
|
|
231
239
|
const Canvas = /*#__PURE__*/React.forwardRef(function CanvasWrapper(props, ref) {
|
|
232
|
-
return /*#__PURE__*/
|
|
233
|
-
|
|
234
|
-
|
|
240
|
+
return /*#__PURE__*/jsx(FiberProvider, {
|
|
241
|
+
children: /*#__PURE__*/jsx(CanvasImpl, {
|
|
242
|
+
...props,
|
|
243
|
+
ref: ref
|
|
244
|
+
})
|
|
245
|
+
});
|
|
235
246
|
});
|
|
236
247
|
|
|
237
248
|
export { Canvas, createPointerEvents as events };
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('../../dist/index-
|
|
6
|
-
var _extends = require('@babel/runtime/helpers/extends');
|
|
5
|
+
var index = require('../../dist/index-b1a4ae91.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');
|
|
@@ -251,31 +251,38 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
251
251
|
return onCreated == null ? void 0 : onCreated(state);
|
|
252
252
|
}
|
|
253
253
|
});
|
|
254
|
-
root.current.render( /*#__PURE__*/
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
254
|
+
root.current.render( /*#__PURE__*/jsxRuntime.jsx(Bridge, {
|
|
255
|
+
children: /*#__PURE__*/jsxRuntime.jsx(index.ErrorBoundary, {
|
|
256
|
+
set: setError,
|
|
257
|
+
children: /*#__PURE__*/jsxRuntime.jsx(React__namespace.Suspense, {
|
|
258
|
+
fallback: /*#__PURE__*/jsxRuntime.jsx(index.Block, {
|
|
259
|
+
set: setBlock
|
|
260
|
+
}),
|
|
261
|
+
children: children
|
|
262
|
+
})
|
|
259
263
|
})
|
|
260
|
-
}
|
|
264
|
+
}));
|
|
261
265
|
}
|
|
262
266
|
React__namespace.useEffect(() => {
|
|
263
267
|
if (canvas) {
|
|
264
268
|
return () => index.unmountComponentAtNode(canvas);
|
|
265
269
|
}
|
|
266
270
|
}, [canvas]);
|
|
267
|
-
return /*#__PURE__*/
|
|
271
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {
|
|
272
|
+
...props,
|
|
268
273
|
ref: viewRef,
|
|
269
274
|
onLayout: onLayout,
|
|
270
275
|
style: {
|
|
271
276
|
flex: 1,
|
|
272
277
|
...style
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
278
|
+
},
|
|
279
|
+
...bind,
|
|
280
|
+
children: width > 0 && /*#__PURE__*/jsxRuntime.jsx(expoGl.GLView, {
|
|
281
|
+
msaaSamples: antialias ? 4 : 0,
|
|
282
|
+
onContextCreate: onContextCreate,
|
|
283
|
+
style: reactNative.StyleSheet.absoluteFill
|
|
284
|
+
})
|
|
285
|
+
});
|
|
279
286
|
});
|
|
280
287
|
|
|
281
288
|
/**
|
|
@@ -283,9 +290,12 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
283
290
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
284
291
|
*/
|
|
285
292
|
const Canvas = /*#__PURE__*/React__namespace.forwardRef(function CanvasWrapper(props, ref) {
|
|
286
|
-
return /*#__PURE__*/
|
|
287
|
-
|
|
288
|
-
|
|
293
|
+
return /*#__PURE__*/jsxRuntime.jsx(itsFine.FiberProvider, {
|
|
294
|
+
children: /*#__PURE__*/jsxRuntime.jsx(CanvasImpl, {
|
|
295
|
+
...props,
|
|
296
|
+
ref: ref
|
|
297
|
+
})
|
|
298
|
+
});
|
|
289
299
|
});
|
|
290
300
|
|
|
291
301
|
// http://stackoverflow.com/questions/105034
|
|
@@ -421,7 +431,7 @@ function polyfills() {
|
|
|
421
431
|
texture.needsUpdate = true;
|
|
422
432
|
|
|
423
433
|
// Force non-DOM upload for EXGL texImage2D
|
|
424
|
-
// @ts-
|
|
434
|
+
// @ts-expect-error
|
|
425
435
|
texture.isDataTexture = true;
|
|
426
436
|
onLoad == null ? void 0 : onLoad(texture);
|
|
427
437
|
}).catch(onError);
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('../../dist/index-
|
|
6
|
-
var _extends = require('@babel/runtime/helpers/extends');
|
|
5
|
+
var index = require('../../dist/index-81568a48.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');
|
|
@@ -251,31 +251,38 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
251
251
|
return onCreated == null ? void 0 : onCreated(state);
|
|
252
252
|
}
|
|
253
253
|
});
|
|
254
|
-
root.current.render( /*#__PURE__*/
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
254
|
+
root.current.render( /*#__PURE__*/jsxRuntime.jsx(Bridge, {
|
|
255
|
+
children: /*#__PURE__*/jsxRuntime.jsx(index.ErrorBoundary, {
|
|
256
|
+
set: setError,
|
|
257
|
+
children: /*#__PURE__*/jsxRuntime.jsx(React__namespace.Suspense, {
|
|
258
|
+
fallback: /*#__PURE__*/jsxRuntime.jsx(index.Block, {
|
|
259
|
+
set: setBlock
|
|
260
|
+
}),
|
|
261
|
+
children: children
|
|
262
|
+
})
|
|
259
263
|
})
|
|
260
|
-
}
|
|
264
|
+
}));
|
|
261
265
|
}
|
|
262
266
|
React__namespace.useEffect(() => {
|
|
263
267
|
if (canvas) {
|
|
264
268
|
return () => index.unmountComponentAtNode(canvas);
|
|
265
269
|
}
|
|
266
270
|
}, [canvas]);
|
|
267
|
-
return /*#__PURE__*/
|
|
271
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {
|
|
272
|
+
...props,
|
|
268
273
|
ref: viewRef,
|
|
269
274
|
onLayout: onLayout,
|
|
270
275
|
style: {
|
|
271
276
|
flex: 1,
|
|
272
277
|
...style
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
278
|
+
},
|
|
279
|
+
...bind,
|
|
280
|
+
children: width > 0 && /*#__PURE__*/jsxRuntime.jsx(expoGl.GLView, {
|
|
281
|
+
msaaSamples: antialias ? 4 : 0,
|
|
282
|
+
onContextCreate: onContextCreate,
|
|
283
|
+
style: reactNative.StyleSheet.absoluteFill
|
|
284
|
+
})
|
|
285
|
+
});
|
|
279
286
|
});
|
|
280
287
|
|
|
281
288
|
/**
|
|
@@ -283,9 +290,12 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
283
290
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
284
291
|
*/
|
|
285
292
|
const Canvas = /*#__PURE__*/React__namespace.forwardRef(function CanvasWrapper(props, ref) {
|
|
286
|
-
return /*#__PURE__*/
|
|
287
|
-
|
|
288
|
-
|
|
293
|
+
return /*#__PURE__*/jsxRuntime.jsx(itsFine.FiberProvider, {
|
|
294
|
+
children: /*#__PURE__*/jsxRuntime.jsx(CanvasImpl, {
|
|
295
|
+
...props,
|
|
296
|
+
ref: ref
|
|
297
|
+
})
|
|
298
|
+
});
|
|
289
299
|
});
|
|
290
300
|
|
|
291
301
|
// http://stackoverflow.com/questions/105034
|
|
@@ -421,7 +431,7 @@ function polyfills() {
|
|
|
421
431
|
texture.needsUpdate = true;
|
|
422
432
|
|
|
423
433
|
// Force non-DOM upload for EXGL texImage2D
|
|
424
|
-
// @ts-
|
|
434
|
+
// @ts-expect-error
|
|
425
435
|
texture.isDataTexture = true;
|
|
426
436
|
onLoad == null ? void 0 : onLoad(texture);
|
|
427
437
|
}).catch(onError);
|
|
@@ -1,11 +1,11 @@
|
|
|
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-
|
|
3
|
-
import _extends from '@babel/runtime/helpers/esm/extends';
|
|
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-b552952e.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-b552952e.esm.js';
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
import * as THREE from 'three';
|
|
6
5
|
import { PanResponder, PixelRatio, View, StyleSheet, Platform, Image, NativeModules } from 'react-native';
|
|
7
6
|
import { GLView } from 'expo-gl';
|
|
8
7
|
import { FiberProvider, useContextBridge } 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';
|
|
@@ -226,31 +226,38 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(({
|
|
|
226
226
|
return onCreated == null ? void 0 : onCreated(state);
|
|
227
227
|
}
|
|
228
228
|
});
|
|
229
|
-
root.current.render( /*#__PURE__*/
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
229
|
+
root.current.render( /*#__PURE__*/jsx(Bridge, {
|
|
230
|
+
children: /*#__PURE__*/jsx(ErrorBoundary, {
|
|
231
|
+
set: setError,
|
|
232
|
+
children: /*#__PURE__*/jsx(React.Suspense, {
|
|
233
|
+
fallback: /*#__PURE__*/jsx(Block, {
|
|
234
|
+
set: setBlock
|
|
235
|
+
}),
|
|
236
|
+
children: children
|
|
237
|
+
})
|
|
234
238
|
})
|
|
235
|
-
}
|
|
239
|
+
}));
|
|
236
240
|
}
|
|
237
241
|
React.useEffect(() => {
|
|
238
242
|
if (canvas) {
|
|
239
243
|
return () => unmountComponentAtNode(canvas);
|
|
240
244
|
}
|
|
241
245
|
}, [canvas]);
|
|
242
|
-
return /*#__PURE__*/
|
|
246
|
+
return /*#__PURE__*/jsx(View, {
|
|
247
|
+
...props,
|
|
243
248
|
ref: viewRef,
|
|
244
249
|
onLayout: onLayout,
|
|
245
250
|
style: {
|
|
246
251
|
flex: 1,
|
|
247
252
|
...style
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
253
|
+
},
|
|
254
|
+
...bind,
|
|
255
|
+
children: width > 0 && /*#__PURE__*/jsx(GLView, {
|
|
256
|
+
msaaSamples: antialias ? 4 : 0,
|
|
257
|
+
onContextCreate: onContextCreate,
|
|
258
|
+
style: StyleSheet.absoluteFill
|
|
259
|
+
})
|
|
260
|
+
});
|
|
254
261
|
});
|
|
255
262
|
|
|
256
263
|
/**
|
|
@@ -258,9 +265,12 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(({
|
|
|
258
265
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
259
266
|
*/
|
|
260
267
|
const Canvas = /*#__PURE__*/React.forwardRef(function CanvasWrapper(props, ref) {
|
|
261
|
-
return /*#__PURE__*/
|
|
262
|
-
|
|
263
|
-
|
|
268
|
+
return /*#__PURE__*/jsx(FiberProvider, {
|
|
269
|
+
children: /*#__PURE__*/jsx(CanvasImpl, {
|
|
270
|
+
...props,
|
|
271
|
+
ref: ref
|
|
272
|
+
})
|
|
273
|
+
});
|
|
264
274
|
});
|
|
265
275
|
|
|
266
276
|
// http://stackoverflow.com/questions/105034
|
|
@@ -396,7 +406,7 @@ function polyfills() {
|
|
|
396
406
|
texture.needsUpdate = true;
|
|
397
407
|
|
|
398
408
|
// Force non-DOM upload for EXGL texImage2D
|
|
399
|
-
// @ts-
|
|
409
|
+
// @ts-expect-error
|
|
400
410
|
texture.isDataTexture = true;
|
|
401
411
|
onLoad == null ? void 0 : onLoad(texture);
|
|
402
412
|
}).catch(onError);
|
package/package.json
CHANGED
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
|
|