@react-three/fiber 8.0.24 → 8.0.25
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/events.d.ts +69 -69
- package/dist/declarations/src/core/hooks.d.ts +21 -21
- package/dist/declarations/src/core/index.d.ts +60 -60
- package/dist/declarations/src/core/loop.d.ts +13 -13
- package/dist/declarations/src/core/renderer.d.ts +51 -51
- package/dist/declarations/src/core/store.d.ts +93 -93
- package/dist/declarations/src/core/utils.d.ts +82 -82
- package/dist/declarations/src/index.d.ts +10 -10
- 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 +329 -329
- package/dist/declarations/src/web/Canvas.d.ts +9 -9
- package/dist/declarations/src/web/events.d.ts +4 -4
- package/dist/{index-cc1b2b8b.cjs.dev.js → index-63f47889.cjs.dev.js} +17 -0
- package/dist/{index-d1db558e.esm.js → index-8d5cf4a3.esm.js} +17 -0
- package/dist/{index-fbc2ae01.cjs.prod.js → index-cd0062f1.cjs.prod.js} +17 -0
- package/dist/react-three-fiber.cjs.dev.js +1 -1
- package/dist/react-three-fiber.cjs.prod.js +1 -1
- package/dist/react-three-fiber.esm.js +2 -2
- package/native/dist/react-three-fiber-native.cjs.dev.js +1 -1
- package/native/dist/react-three-fiber-native.cjs.prod.js +1 -1
- package/native/dist/react-three-fiber-native.esm.js +2 -2
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
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
|
-
}
|
|
9
|
-
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
|
+
}
|
|
9
|
+
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>;
|
|
@@ -1409,6 +1409,23 @@ const createStore = (invalidate, advance) => {
|
|
|
1409
1409
|
oldSize = size;
|
|
1410
1410
|
oldDpr = viewport.dpr;
|
|
1411
1411
|
}
|
|
1412
|
+
}); // Update viewport once the camera changes
|
|
1413
|
+
|
|
1414
|
+
let oldCamera = state.camera;
|
|
1415
|
+
rootState.subscribe(() => {
|
|
1416
|
+
const {
|
|
1417
|
+
camera,
|
|
1418
|
+
set
|
|
1419
|
+
} = rootState.getState();
|
|
1420
|
+
|
|
1421
|
+
if (camera !== oldCamera) {
|
|
1422
|
+
set(state => ({
|
|
1423
|
+
viewport: { ...state.viewport,
|
|
1424
|
+
...state.viewport.getCurrentViewport(camera)
|
|
1425
|
+
}
|
|
1426
|
+
}));
|
|
1427
|
+
oldCamera = camera;
|
|
1428
|
+
}
|
|
1412
1429
|
}); // Invalidate on any change
|
|
1413
1430
|
|
|
1414
1431
|
rootState.subscribe(state => invalidate(state)); // Return root state
|
|
@@ -1382,6 +1382,23 @@ const createStore = (invalidate, advance) => {
|
|
|
1382
1382
|
oldSize = size;
|
|
1383
1383
|
oldDpr = viewport.dpr;
|
|
1384
1384
|
}
|
|
1385
|
+
}); // Update viewport once the camera changes
|
|
1386
|
+
|
|
1387
|
+
let oldCamera = state.camera;
|
|
1388
|
+
rootState.subscribe(() => {
|
|
1389
|
+
const {
|
|
1390
|
+
camera,
|
|
1391
|
+
set
|
|
1392
|
+
} = rootState.getState();
|
|
1393
|
+
|
|
1394
|
+
if (camera !== oldCamera) {
|
|
1395
|
+
set(state => ({
|
|
1396
|
+
viewport: { ...state.viewport,
|
|
1397
|
+
...state.viewport.getCurrentViewport(camera)
|
|
1398
|
+
}
|
|
1399
|
+
}));
|
|
1400
|
+
oldCamera = camera;
|
|
1401
|
+
}
|
|
1385
1402
|
}); // Invalidate on any change
|
|
1386
1403
|
|
|
1387
1404
|
rootState.subscribe(state => invalidate(state)); // Return root state
|
|
@@ -1409,6 +1409,23 @@ const createStore = (invalidate, advance) => {
|
|
|
1409
1409
|
oldSize = size;
|
|
1410
1410
|
oldDpr = viewport.dpr;
|
|
1411
1411
|
}
|
|
1412
|
+
}); // Update viewport once the camera changes
|
|
1413
|
+
|
|
1414
|
+
let oldCamera = state.camera;
|
|
1415
|
+
rootState.subscribe(() => {
|
|
1416
|
+
const {
|
|
1417
|
+
camera,
|
|
1418
|
+
set
|
|
1419
|
+
} = rootState.getState();
|
|
1420
|
+
|
|
1421
|
+
if (camera !== oldCamera) {
|
|
1422
|
+
set(state => ({
|
|
1423
|
+
viewport: { ...state.viewport,
|
|
1424
|
+
...state.viewport.getCurrentViewport(camera)
|
|
1425
|
+
}
|
|
1426
|
+
}));
|
|
1427
|
+
oldCamera = camera;
|
|
1428
|
+
}
|
|
1412
1429
|
}); // Invalidate on any change
|
|
1413
1430
|
|
|
1414
1431
|
rootState.subscribe(state => invalidate(state)); // Return root state
|
|
@@ -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-63f47889.cjs.dev.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -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-cd0062f1.cjs.prod.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -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, s as _roots, q as act, n as addAfterEffect, m as addEffect, o as addTail, l as advance, i as applyProps, f as context, g as createPortal, a as createRoot, j as dispose, e as extend, p as getRootState, k as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, x as useFrame, y as useGraph, z as useLoader, v as useStore, w as useThree } from './index-
|
|
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-8d5cf4a3.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, s as _roots, q as act, n as addAfterEffect, m as addEffect, o as addTail, l as advance, i as applyProps, f as context, g as createPortal, a as createRoot, j as dispose, e as extend, p as getRootState, k as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, x as useFrame, y as useGraph, z as useLoader, v as useStore, w as useThree } from './index-8d5cf4a3.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';
|
|
@@ -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-63f47889.cjs.dev.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -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-cd0062f1.cjs.prod.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -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, s as _roots, q as act, n as addAfterEffect, m as addEffect, o as addTail, l as advance, i as applyProps, f as context, g as createPortal, a as createRoot, j as dispose, e as extend, p as getRootState, k as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, x as useFrame, y as useGraph, z as useLoader, v as useStore, w as useThree } from '../../dist/index-
|
|
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-8d5cf4a3.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, s as _roots, q as act, n as addAfterEffect, m as addEffect, o as addTail, l as advance, i as applyProps, f as context, g as createPortal, a as createRoot, j as dispose, e as extend, p as getRootState, k as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, x as useFrame, y as useGraph, z as useLoader, v as useStore, w as useThree } from '../../dist/index-8d5cf4a3.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';
|