@react-three/fiber 8.6.1 → 8.7.1
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 +18 -0
- package/dist/declarations/src/core/events.d.ts +69 -69
- package/dist/declarations/src/core/hooks.d.ts +25 -22
- package/dist/declarations/src/core/index.d.ts +57 -57
- package/dist/declarations/src/core/loop.d.ts +15 -13
- package/dist/declarations/src/core/renderer.d.ts +51 -51
- package/dist/declarations/src/core/store.d.ts +95 -95
- package/dist/declarations/src/core/utils.d.ts +83 -82
- package/dist/declarations/src/index.d.ts +11 -11
- package/dist/declarations/src/native/Canvas.d.ts +8 -8
- package/dist/declarations/src/native/events.d.ts +4 -4
- package/dist/declarations/src/native/polyfills.d.ts +1 -1
- package/dist/declarations/src/native.d.ts +10 -10
- package/dist/declarations/src/three-types.d.ts +332 -332
- package/dist/declarations/src/web/Canvas.d.ts +11 -11
- package/dist/declarations/src/web/events.d.ts +4 -4
- package/dist/{index-cecf55e8.esm.js → index-44001bdc.esm.js} +31 -6
- package/dist/{index-f368ca4a.cjs.prod.js → index-af0d582a.cjs.prod.js} +32 -5
- package/dist/{index-9a338808.cjs.dev.js → index-f9709241.cjs.dev.js} +32 -5
- package/dist/react-three-fiber.cjs.dev.js +3 -2
- package/dist/react-three-fiber.cjs.prod.js +3 -2
- package/dist/react-three-fiber.esm.js +3 -3
- package/native/dist/react-three-fiber-native.cjs.dev.js +2 -1
- package/native/dist/react-three-fiber-native.cjs.prod.js +2 -1
- package/native/dist/react-three-fiber-native.esm.js +2 -2
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { Options as ResizeOptions } from 'react-use-measure';
|
|
3
|
-
import { RenderProps } from '../core';
|
|
4
|
-
export interface Props extends Omit<RenderProps<HTMLCanvasElement>, 'size'>, React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
fallback?: React.ReactNode;
|
|
7
|
-
resize?: ResizeOptions;
|
|
8
|
-
eventSource?: HTMLElement
|
|
9
|
-
eventPrefix?: 'offset' | 'client' | 'page' | 'layer' | 'screen';
|
|
10
|
-
}
|
|
11
|
-
export declare const Canvas: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLCanvasElement>>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Options as ResizeOptions } from 'react-use-measure';
|
|
3
|
+
import { RenderProps } from '../core';
|
|
4
|
+
export interface Props extends Omit<RenderProps<HTMLCanvasElement>, 'size'>, React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
fallback?: React.ReactNode;
|
|
7
|
+
resize?: ResizeOptions;
|
|
8
|
+
eventSource?: HTMLElement | React.MutableRefObject<HTMLElement>;
|
|
9
|
+
eventPrefix?: 'offset' | 'client' | 'page' | 'layer' | 'screen';
|
|
10
|
+
}
|
|
11
|
+
export declare const Canvas: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLCanvasElement>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UseBoundStore } from 'zustand';
|
|
2
|
-
import { RootState } from '../core/store';
|
|
3
|
-
import { EventManager } from '../core/events';
|
|
4
|
-
export declare function createPointerEvents(store: UseBoundStore<RootState>): EventManager<HTMLElement>;
|
|
1
|
+
import { UseBoundStore } from 'zustand';
|
|
2
|
+
import { RootState } from '../core/store';
|
|
3
|
+
import { EventManager } from '../core/events';
|
|
4
|
+
export declare function createPointerEvents(store: UseBoundStore<RootState>): EventManager<HTMLElement>;
|
|
@@ -12,6 +12,7 @@ var threeTypes = /*#__PURE__*/Object.freeze({
|
|
|
12
12
|
|
|
13
13
|
var _window$document, _window$navigator;
|
|
14
14
|
const isOrthographicCamera = def => def && def.isOrthographicCamera;
|
|
15
|
+
const isRef = obj => obj && obj.hasOwnProperty('current');
|
|
15
16
|
/**
|
|
16
17
|
* An SSR-friendly useLayoutEffect.
|
|
17
18
|
*
|
|
@@ -1468,11 +1469,24 @@ const addAfterEffect = callback => createSubs(callback, globalAfterEffects);
|
|
|
1468
1469
|
const addTail = callback => createSubs(callback, globalTailEffects);
|
|
1469
1470
|
|
|
1470
1471
|
function run(effects, timestamp) {
|
|
1472
|
+
if (!effects.size) return;
|
|
1471
1473
|
effects.forEach(({
|
|
1472
1474
|
callback
|
|
1473
1475
|
}) => callback(timestamp));
|
|
1474
1476
|
}
|
|
1475
1477
|
|
|
1478
|
+
function flushGlobalEffects(type, timestamp) {
|
|
1479
|
+
switch (type) {
|
|
1480
|
+
case 'before':
|
|
1481
|
+
return run(globalEffects, timestamp);
|
|
1482
|
+
|
|
1483
|
+
case 'after':
|
|
1484
|
+
return run(globalAfterEffects, timestamp);
|
|
1485
|
+
|
|
1486
|
+
case 'tail':
|
|
1487
|
+
return run(globalTailEffects, timestamp);
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1476
1490
|
let subscribers;
|
|
1477
1491
|
let subscription;
|
|
1478
1492
|
|
|
@@ -1512,7 +1526,7 @@ function createLoop(roots) {
|
|
|
1512
1526
|
running = true;
|
|
1513
1527
|
repeat = 0; // Run effects
|
|
1514
1528
|
|
|
1515
|
-
|
|
1529
|
+
flushGlobalEffects('before', timestamp); // Render all roots
|
|
1516
1530
|
|
|
1517
1531
|
roots.forEach(root => {
|
|
1518
1532
|
var _state$gl$xr;
|
|
@@ -1524,11 +1538,11 @@ function createLoop(roots) {
|
|
|
1524
1538
|
}
|
|
1525
1539
|
}); // Run after-effects
|
|
1526
1540
|
|
|
1527
|
-
|
|
1541
|
+
flushGlobalEffects('after', timestamp); // Stop the loop if nothing invalidates it
|
|
1528
1542
|
|
|
1529
1543
|
if (repeat === 0) {
|
|
1530
1544
|
// Tail call effects, they are called when rendering stops
|
|
1531
|
-
|
|
1545
|
+
flushGlobalEffects('tail', timestamp); // Flag end of operation
|
|
1532
1546
|
|
|
1533
1547
|
running = false;
|
|
1534
1548
|
return cancelAnimationFrame(frame);
|
|
@@ -1550,9 +1564,9 @@ function createLoop(roots) {
|
|
|
1550
1564
|
}
|
|
1551
1565
|
|
|
1552
1566
|
function advance(timestamp, runGlobalEffects = true, state, frame) {
|
|
1553
|
-
if (runGlobalEffects)
|
|
1567
|
+
if (runGlobalEffects) flushGlobalEffects('before', timestamp);
|
|
1554
1568
|
if (!state) roots.forEach(root => render$1(timestamp, root.store.getState()));else render$1(timestamp, state, frame);
|
|
1555
|
-
if (runGlobalEffects)
|
|
1569
|
+
if (runGlobalEffects) flushGlobalEffects('after', timestamp);
|
|
1556
1570
|
}
|
|
1557
1571
|
|
|
1558
1572
|
return {
|
|
@@ -1572,6 +1586,17 @@ function createLoop(roots) {
|
|
|
1572
1586
|
};
|
|
1573
1587
|
}
|
|
1574
1588
|
|
|
1589
|
+
/**
|
|
1590
|
+
* Exposes an object's {@link LocalState}.
|
|
1591
|
+
* @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#useInstanceHandle
|
|
1592
|
+
*
|
|
1593
|
+
* **Note**: this is an escape hatch to react-internal fields. Expect this to change significantly between versions.
|
|
1594
|
+
*/
|
|
1595
|
+
function useInstanceHandle(ref) {
|
|
1596
|
+
const instance = React.useRef(null);
|
|
1597
|
+
useIsomorphicLayoutEffect(() => void (instance.current = ref.current.__r3f), [ref]);
|
|
1598
|
+
return instance;
|
|
1599
|
+
}
|
|
1575
1600
|
function useStore() {
|
|
1576
1601
|
const store = React.useContext(context);
|
|
1577
1602
|
if (!store) throw new Error('R3F: Hooks can only be used within the Canvas component!');
|
|
@@ -2105,4 +2130,4 @@ reconciler.injectIntoDevTools({
|
|
|
2105
2130
|
});
|
|
2106
2131
|
const act = React.unstable_act;
|
|
2107
2132
|
|
|
2108
|
-
export { Block as B, ErrorBoundary as E, createRoot as a, useIsomorphicLayoutEffect as b, createEvents as c, unmountComponentAtNode as d, extend as e, context as f, createPortal as g, reconciler as h,
|
|
2133
|
+
export { useGraph as A, Block as B, useLoader as C, ErrorBoundary as E, createRoot as a, useIsomorphicLayoutEffect as b, createEvents as c, unmountComponentAtNode as d, extend as e, context as f, createPortal as g, reconciler as h, isRef as i, applyProps as j, dispose as k, invalidate as l, advance as m, addEffect as n, addAfterEffect as o, addTail as p, getRootState as q, render as r, act as s, threeTypes as t, useMutableCallback as u, roots as v, useInstanceHandle as w, useStore as x, useThree as y, useFrame as z };
|
|
@@ -39,6 +39,7 @@ var threeTypes = /*#__PURE__*/Object.freeze({
|
|
|
39
39
|
|
|
40
40
|
var _window$document, _window$navigator;
|
|
41
41
|
const isOrthographicCamera = def => def && def.isOrthographicCamera;
|
|
42
|
+
const isRef = obj => obj && obj.hasOwnProperty('current');
|
|
42
43
|
/**
|
|
43
44
|
* An SSR-friendly useLayoutEffect.
|
|
44
45
|
*
|
|
@@ -1495,11 +1496,24 @@ const addAfterEffect = callback => createSubs(callback, globalAfterEffects);
|
|
|
1495
1496
|
const addTail = callback => createSubs(callback, globalTailEffects);
|
|
1496
1497
|
|
|
1497
1498
|
function run(effects, timestamp) {
|
|
1499
|
+
if (!effects.size) return;
|
|
1498
1500
|
effects.forEach(({
|
|
1499
1501
|
callback
|
|
1500
1502
|
}) => callback(timestamp));
|
|
1501
1503
|
}
|
|
1502
1504
|
|
|
1505
|
+
function flushGlobalEffects(type, timestamp) {
|
|
1506
|
+
switch (type) {
|
|
1507
|
+
case 'before':
|
|
1508
|
+
return run(globalEffects, timestamp);
|
|
1509
|
+
|
|
1510
|
+
case 'after':
|
|
1511
|
+
return run(globalAfterEffects, timestamp);
|
|
1512
|
+
|
|
1513
|
+
case 'tail':
|
|
1514
|
+
return run(globalTailEffects, timestamp);
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1503
1517
|
let subscribers;
|
|
1504
1518
|
let subscription;
|
|
1505
1519
|
|
|
@@ -1539,7 +1553,7 @@ function createLoop(roots) {
|
|
|
1539
1553
|
running = true;
|
|
1540
1554
|
repeat = 0; // Run effects
|
|
1541
1555
|
|
|
1542
|
-
|
|
1556
|
+
flushGlobalEffects('before', timestamp); // Render all roots
|
|
1543
1557
|
|
|
1544
1558
|
roots.forEach(root => {
|
|
1545
1559
|
var _state$gl$xr;
|
|
@@ -1551,11 +1565,11 @@ function createLoop(roots) {
|
|
|
1551
1565
|
}
|
|
1552
1566
|
}); // Run after-effects
|
|
1553
1567
|
|
|
1554
|
-
|
|
1568
|
+
flushGlobalEffects('after', timestamp); // Stop the loop if nothing invalidates it
|
|
1555
1569
|
|
|
1556
1570
|
if (repeat === 0) {
|
|
1557
1571
|
// Tail call effects, they are called when rendering stops
|
|
1558
|
-
|
|
1572
|
+
flushGlobalEffects('tail', timestamp); // Flag end of operation
|
|
1559
1573
|
|
|
1560
1574
|
running = false;
|
|
1561
1575
|
return cancelAnimationFrame(frame);
|
|
@@ -1577,9 +1591,9 @@ function createLoop(roots) {
|
|
|
1577
1591
|
}
|
|
1578
1592
|
|
|
1579
1593
|
function advance(timestamp, runGlobalEffects = true, state, frame) {
|
|
1580
|
-
if (runGlobalEffects)
|
|
1594
|
+
if (runGlobalEffects) flushGlobalEffects('before', timestamp);
|
|
1581
1595
|
if (!state) roots.forEach(root => render$1(timestamp, root.store.getState()));else render$1(timestamp, state, frame);
|
|
1582
|
-
if (runGlobalEffects)
|
|
1596
|
+
if (runGlobalEffects) flushGlobalEffects('after', timestamp);
|
|
1583
1597
|
}
|
|
1584
1598
|
|
|
1585
1599
|
return {
|
|
@@ -1599,6 +1613,17 @@ function createLoop(roots) {
|
|
|
1599
1613
|
};
|
|
1600
1614
|
}
|
|
1601
1615
|
|
|
1616
|
+
/**
|
|
1617
|
+
* Exposes an object's {@link LocalState}.
|
|
1618
|
+
* @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#useInstanceHandle
|
|
1619
|
+
*
|
|
1620
|
+
* **Note**: this is an escape hatch to react-internal fields. Expect this to change significantly between versions.
|
|
1621
|
+
*/
|
|
1622
|
+
function useInstanceHandle(ref) {
|
|
1623
|
+
const instance = React__namespace.useRef(null);
|
|
1624
|
+
useIsomorphicLayoutEffect(() => void (instance.current = ref.current.__r3f), [ref]);
|
|
1625
|
+
return instance;
|
|
1626
|
+
}
|
|
1602
1627
|
function useStore() {
|
|
1603
1628
|
const store = React__namespace.useContext(context);
|
|
1604
1629
|
if (!store) throw new Error('R3F: Hooks can only be used within the Canvas component!');
|
|
@@ -2148,6 +2173,7 @@ exports.dispose = dispose;
|
|
|
2148
2173
|
exports.extend = extend;
|
|
2149
2174
|
exports.getRootState = getRootState;
|
|
2150
2175
|
exports.invalidate = invalidate;
|
|
2176
|
+
exports.isRef = isRef;
|
|
2151
2177
|
exports.reconciler = reconciler;
|
|
2152
2178
|
exports.render = render;
|
|
2153
2179
|
exports.roots = roots;
|
|
@@ -2155,6 +2181,7 @@ exports.threeTypes = threeTypes;
|
|
|
2155
2181
|
exports.unmountComponentAtNode = unmountComponentAtNode;
|
|
2156
2182
|
exports.useFrame = useFrame;
|
|
2157
2183
|
exports.useGraph = useGraph;
|
|
2184
|
+
exports.useInstanceHandle = useInstanceHandle;
|
|
2158
2185
|
exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;
|
|
2159
2186
|
exports.useLoader = useLoader;
|
|
2160
2187
|
exports.useMutableCallback = useMutableCallback;
|
|
@@ -39,6 +39,7 @@ var threeTypes = /*#__PURE__*/Object.freeze({
|
|
|
39
39
|
|
|
40
40
|
var _window$document, _window$navigator;
|
|
41
41
|
const isOrthographicCamera = def => def && def.isOrthographicCamera;
|
|
42
|
+
const isRef = obj => obj && obj.hasOwnProperty('current');
|
|
42
43
|
/**
|
|
43
44
|
* An SSR-friendly useLayoutEffect.
|
|
44
45
|
*
|
|
@@ -1495,11 +1496,24 @@ const addAfterEffect = callback => createSubs(callback, globalAfterEffects);
|
|
|
1495
1496
|
const addTail = callback => createSubs(callback, globalTailEffects);
|
|
1496
1497
|
|
|
1497
1498
|
function run(effects, timestamp) {
|
|
1499
|
+
if (!effects.size) return;
|
|
1498
1500
|
effects.forEach(({
|
|
1499
1501
|
callback
|
|
1500
1502
|
}) => callback(timestamp));
|
|
1501
1503
|
}
|
|
1502
1504
|
|
|
1505
|
+
function flushGlobalEffects(type, timestamp) {
|
|
1506
|
+
switch (type) {
|
|
1507
|
+
case 'before':
|
|
1508
|
+
return run(globalEffects, timestamp);
|
|
1509
|
+
|
|
1510
|
+
case 'after':
|
|
1511
|
+
return run(globalAfterEffects, timestamp);
|
|
1512
|
+
|
|
1513
|
+
case 'tail':
|
|
1514
|
+
return run(globalTailEffects, timestamp);
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1503
1517
|
let subscribers;
|
|
1504
1518
|
let subscription;
|
|
1505
1519
|
|
|
@@ -1539,7 +1553,7 @@ function createLoop(roots) {
|
|
|
1539
1553
|
running = true;
|
|
1540
1554
|
repeat = 0; // Run effects
|
|
1541
1555
|
|
|
1542
|
-
|
|
1556
|
+
flushGlobalEffects('before', timestamp); // Render all roots
|
|
1543
1557
|
|
|
1544
1558
|
roots.forEach(root => {
|
|
1545
1559
|
var _state$gl$xr;
|
|
@@ -1551,11 +1565,11 @@ function createLoop(roots) {
|
|
|
1551
1565
|
}
|
|
1552
1566
|
}); // Run after-effects
|
|
1553
1567
|
|
|
1554
|
-
|
|
1568
|
+
flushGlobalEffects('after', timestamp); // Stop the loop if nothing invalidates it
|
|
1555
1569
|
|
|
1556
1570
|
if (repeat === 0) {
|
|
1557
1571
|
// Tail call effects, they are called when rendering stops
|
|
1558
|
-
|
|
1572
|
+
flushGlobalEffects('tail', timestamp); // Flag end of operation
|
|
1559
1573
|
|
|
1560
1574
|
running = false;
|
|
1561
1575
|
return cancelAnimationFrame(frame);
|
|
@@ -1577,9 +1591,9 @@ function createLoop(roots) {
|
|
|
1577
1591
|
}
|
|
1578
1592
|
|
|
1579
1593
|
function advance(timestamp, runGlobalEffects = true, state, frame) {
|
|
1580
|
-
if (runGlobalEffects)
|
|
1594
|
+
if (runGlobalEffects) flushGlobalEffects('before', timestamp);
|
|
1581
1595
|
if (!state) roots.forEach(root => render$1(timestamp, root.store.getState()));else render$1(timestamp, state, frame);
|
|
1582
|
-
if (runGlobalEffects)
|
|
1596
|
+
if (runGlobalEffects) flushGlobalEffects('after', timestamp);
|
|
1583
1597
|
}
|
|
1584
1598
|
|
|
1585
1599
|
return {
|
|
@@ -1599,6 +1613,17 @@ function createLoop(roots) {
|
|
|
1599
1613
|
};
|
|
1600
1614
|
}
|
|
1601
1615
|
|
|
1616
|
+
/**
|
|
1617
|
+
* Exposes an object's {@link LocalState}.
|
|
1618
|
+
* @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#useInstanceHandle
|
|
1619
|
+
*
|
|
1620
|
+
* **Note**: this is an escape hatch to react-internal fields. Expect this to change significantly between versions.
|
|
1621
|
+
*/
|
|
1622
|
+
function useInstanceHandle(ref) {
|
|
1623
|
+
const instance = React__namespace.useRef(null);
|
|
1624
|
+
useIsomorphicLayoutEffect(() => void (instance.current = ref.current.__r3f), [ref]);
|
|
1625
|
+
return instance;
|
|
1626
|
+
}
|
|
1602
1627
|
function useStore() {
|
|
1603
1628
|
const store = React__namespace.useContext(context);
|
|
1604
1629
|
if (!store) throw new Error('R3F: Hooks can only be used within the Canvas component!');
|
|
@@ -2148,6 +2173,7 @@ exports.dispose = dispose;
|
|
|
2148
2173
|
exports.extend = extend;
|
|
2149
2174
|
exports.getRootState = getRootState;
|
|
2150
2175
|
exports.invalidate = invalidate;
|
|
2176
|
+
exports.isRef = isRef;
|
|
2151
2177
|
exports.reconciler = reconciler;
|
|
2152
2178
|
exports.render = render;
|
|
2153
2179
|
exports.roots = roots;
|
|
@@ -2155,6 +2181,7 @@ exports.threeTypes = threeTypes;
|
|
|
2155
2181
|
exports.unmountComponentAtNode = unmountComponentAtNode;
|
|
2156
2182
|
exports.useFrame = useFrame;
|
|
2157
2183
|
exports.useGraph = useGraph;
|
|
2184
|
+
exports.useInstanceHandle = useInstanceHandle;
|
|
2158
2185
|
exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;
|
|
2159
2186
|
exports.useLoader = useLoader;
|
|
2160
2187
|
exports.useMutableCallback = useMutableCallback;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-f9709241.cjs.dev.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -187,7 +187,7 @@ const Canvas = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
187
187
|
onPointerMissed: (...args) => handlePointerMissed.current == null ? void 0 : handlePointerMissed.current(...args),
|
|
188
188
|
onCreated: state => {
|
|
189
189
|
// Connect to event source
|
|
190
|
-
state.events.connect == null ? void 0 : state.events.connect(eventSource ? eventSource : divRef.current); // Set up compute function
|
|
190
|
+
state.events.connect == null ? void 0 : state.events.connect(eventSource ? index.isRef(eventSource) ? eventSource.current : eventSource : divRef.current); // Set up compute function
|
|
191
191
|
|
|
192
192
|
if (eventPrefix) {
|
|
193
193
|
state.setEvents({
|
|
@@ -263,6 +263,7 @@ exports.render = index.render;
|
|
|
263
263
|
exports.unmountComponentAtNode = index.unmountComponentAtNode;
|
|
264
264
|
exports.useFrame = index.useFrame;
|
|
265
265
|
exports.useGraph = index.useGraph;
|
|
266
|
+
exports.useInstanceHandle = index.useInstanceHandle;
|
|
266
267
|
exports.useLoader = index.useLoader;
|
|
267
268
|
exports.useStore = index.useStore;
|
|
268
269
|
exports.useThree = index.useThree;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-af0d582a.cjs.prod.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -187,7 +187,7 @@ const Canvas = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
|
|
|
187
187
|
onPointerMissed: (...args) => handlePointerMissed.current == null ? void 0 : handlePointerMissed.current(...args),
|
|
188
188
|
onCreated: state => {
|
|
189
189
|
// Connect to event source
|
|
190
|
-
state.events.connect == null ? void 0 : state.events.connect(eventSource ? eventSource : divRef.current); // Set up compute function
|
|
190
|
+
state.events.connect == null ? void 0 : state.events.connect(eventSource ? index.isRef(eventSource) ? eventSource.current : eventSource : divRef.current); // Set up compute function
|
|
191
191
|
|
|
192
192
|
if (eventPrefix) {
|
|
193
193
|
state.setEvents({
|
|
@@ -263,6 +263,7 @@ exports.render = index.render;
|
|
|
263
263
|
exports.unmountComponentAtNode = index.unmountComponentAtNode;
|
|
264
264
|
exports.useFrame = index.useFrame;
|
|
265
265
|
exports.useGraph = index.useGraph;
|
|
266
|
+
exports.useInstanceHandle = index.useInstanceHandle;
|
|
266
267
|
exports.useLoader = index.useLoader;
|
|
267
268
|
exports.useStore = index.useStore;
|
|
268
269
|
exports.useThree = index.useThree;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as createEvents, e as extend, u as useMutableCallback, a as createRoot, E as ErrorBoundary, B as Block, b as useIsomorphicLayoutEffect, d as unmountComponentAtNode } from './index-
|
|
2
|
-
export { t as ReactThreeFiber,
|
|
1
|
+
import { c as createEvents, e as extend, u as useMutableCallback, a as createRoot, i as isRef, E as ErrorBoundary, B as Block, b as useIsomorphicLayoutEffect, d as unmountComponentAtNode } from './index-44001bdc.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, v as _roots, s as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, f as context, c as createEvents, g as createPortal, a as createRoot, k as dispose, e as extend, q as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, z as useFrame, A as useGraph, w as useInstanceHandle, C as useLoader, x as useStore, y as useThree } from './index-44001bdc.esm.js';
|
|
3
3
|
import _extends from '@babel/runtime/helpers/esm/extends';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import * as THREE from 'three';
|
|
@@ -160,7 +160,7 @@ const Canvas = /*#__PURE__*/React.forwardRef(function Canvas({
|
|
|
160
160
|
onPointerMissed: (...args) => handlePointerMissed.current == null ? void 0 : handlePointerMissed.current(...args),
|
|
161
161
|
onCreated: state => {
|
|
162
162
|
// Connect to event source
|
|
163
|
-
state.events.connect == null ? void 0 : state.events.connect(eventSource ? eventSource : divRef.current); // Set up compute function
|
|
163
|
+
state.events.connect == null ? void 0 : state.events.connect(eventSource ? isRef(eventSource) ? eventSource.current : eventSource : divRef.current); // Set up compute function
|
|
164
164
|
|
|
165
165
|
if (eventPrefix) {
|
|
166
166
|
state.setEvents({
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('../../dist/index-
|
|
5
|
+
var index = require('../../dist/index-f9709241.cjs.dev.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -401,6 +401,7 @@ exports.render = index.render;
|
|
|
401
401
|
exports.unmountComponentAtNode = index.unmountComponentAtNode;
|
|
402
402
|
exports.useFrame = index.useFrame;
|
|
403
403
|
exports.useGraph = index.useGraph;
|
|
404
|
+
exports.useInstanceHandle = index.useInstanceHandle;
|
|
404
405
|
exports.useLoader = index.useLoader;
|
|
405
406
|
exports.useStore = index.useStore;
|
|
406
407
|
exports.useThree = index.useThree;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('../../dist/index-
|
|
5
|
+
var index = require('../../dist/index-af0d582a.cjs.prod.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -401,6 +401,7 @@ exports.render = index.render;
|
|
|
401
401
|
exports.unmountComponentAtNode = index.unmountComponentAtNode;
|
|
402
402
|
exports.useFrame = index.useFrame;
|
|
403
403
|
exports.useGraph = index.useGraph;
|
|
404
|
+
exports.useInstanceHandle = index.useInstanceHandle;
|
|
404
405
|
exports.useLoader = index.useLoader;
|
|
405
406
|
exports.useStore = index.useStore;
|
|
406
407
|
exports.useThree = index.useThree;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as createEvents, e as extend, u as useMutableCallback, a as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from '../../dist/index-
|
|
2
|
-
export { t as ReactThreeFiber,
|
|
1
|
+
import { c as createEvents, e as extend, u as useMutableCallback, a as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from '../../dist/index-44001bdc.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, v as _roots, s as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, f as context, g as createPortal, a as createRoot, k as dispose, e as extend, q as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, z as useFrame, A as useGraph, w as useInstanceHandle, C as useLoader, x as useStore, y as useThree } from '../../dist/index-44001bdc.esm.js';
|
|
3
3
|
import _extends from '@babel/runtime/helpers/esm/extends';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import * as THREE from 'three';
|