@react-three/fiber 8.9.2 → 8.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/declarations/src/core/events.d.ts +70 -70
- package/dist/declarations/src/core/hooks.d.ts +28 -28
- package/dist/declarations/src/core/index.d.ts +55 -55
- package/dist/declarations/src/core/loop.d.ts +14 -14
- package/dist/declarations/src/core/renderer.d.ts +52 -52
- package/dist/declarations/src/core/store.d.ts +95 -95
- package/dist/declarations/src/core/utils.d.ts +83 -83
- package/dist/declarations/src/index.d.ts +12 -12
- 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 +12 -12
- package/dist/declarations/src/three-types.d.ts +335 -335
- package/dist/declarations/src/web/Canvas.d.ts +11 -11
- package/dist/declarations/src/web/events.d.ts +4 -4
- package/dist/{index-79f9c7e9.esm.js → index-27a1523b.esm.js} +20 -7
- package/dist/{index-efc69a1d.cjs.dev.js → index-4ea38fa1.cjs.dev.js} +20 -7
- package/dist/{index-25dfa84d.cjs.prod.js → index-d957aeb6.cjs.prod.js} +20 -7
- 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,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 | React.MutableRefObject<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>;
|
|
@@ -1894,14 +1894,27 @@ function createRoot(canvas) {
|
|
|
1894
1894
|
|
|
1895
1895
|
|
|
1896
1896
|
if (gl.shadowMap) {
|
|
1897
|
-
const
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1897
|
+
const oldEnabled = gl.shadowMap.enabled;
|
|
1898
|
+
const oldType = gl.shadowMap.type;
|
|
1899
|
+
gl.shadowMap.enabled = !!shadows;
|
|
1900
|
+
|
|
1901
|
+
if (is.boo(shadows)) {
|
|
1902
|
+
gl.shadowMap.type = THREE.PCFSoftShadowMap;
|
|
1903
|
+
} else if (is.str(shadows)) {
|
|
1904
|
+
var _types$shadows;
|
|
1905
|
+
|
|
1906
|
+
const types = {
|
|
1907
|
+
basic: THREE.BasicShadowMap,
|
|
1908
|
+
percentage: THREE.PCFShadowMap,
|
|
1909
|
+
soft: THREE.PCFSoftShadowMap,
|
|
1910
|
+
variance: THREE.VSMShadowMap
|
|
1911
|
+
};
|
|
1912
|
+
gl.shadowMap.type = (_types$shadows = types[shadows]) != null ? _types$shadows : THREE.PCFSoftShadowMap;
|
|
1913
|
+
} else if (is.obj(shadows)) {
|
|
1914
|
+
Object.assign(gl.shadowMap, shadows);
|
|
1904
1915
|
}
|
|
1916
|
+
|
|
1917
|
+
if (oldEnabled !== gl.shadowMap.enabled || oldType !== gl.shadowMap.type) gl.shadowMap.needsUpdate = true;
|
|
1905
1918
|
} // Safely set color management if available.
|
|
1906
1919
|
// Avoid accessing THREE.ColorManagement to play nice with older versions
|
|
1907
1920
|
|
|
@@ -1921,14 +1921,27 @@ function createRoot(canvas) {
|
|
|
1921
1921
|
|
|
1922
1922
|
|
|
1923
1923
|
if (gl.shadowMap) {
|
|
1924
|
-
const
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1924
|
+
const oldEnabled = gl.shadowMap.enabled;
|
|
1925
|
+
const oldType = gl.shadowMap.type;
|
|
1926
|
+
gl.shadowMap.enabled = !!shadows;
|
|
1927
|
+
|
|
1928
|
+
if (is.boo(shadows)) {
|
|
1929
|
+
gl.shadowMap.type = THREE__namespace.PCFSoftShadowMap;
|
|
1930
|
+
} else if (is.str(shadows)) {
|
|
1931
|
+
var _types$shadows;
|
|
1932
|
+
|
|
1933
|
+
const types = {
|
|
1934
|
+
basic: THREE__namespace.BasicShadowMap,
|
|
1935
|
+
percentage: THREE__namespace.PCFShadowMap,
|
|
1936
|
+
soft: THREE__namespace.PCFSoftShadowMap,
|
|
1937
|
+
variance: THREE__namespace.VSMShadowMap
|
|
1938
|
+
};
|
|
1939
|
+
gl.shadowMap.type = (_types$shadows = types[shadows]) != null ? _types$shadows : THREE__namespace.PCFSoftShadowMap;
|
|
1940
|
+
} else if (is.obj(shadows)) {
|
|
1941
|
+
Object.assign(gl.shadowMap, shadows);
|
|
1931
1942
|
}
|
|
1943
|
+
|
|
1944
|
+
if (oldEnabled !== gl.shadowMap.enabled || oldType !== gl.shadowMap.type) gl.shadowMap.needsUpdate = true;
|
|
1932
1945
|
} // Safely set color management if available.
|
|
1933
1946
|
// Avoid accessing THREE.ColorManagement to play nice with older versions
|
|
1934
1947
|
|
|
@@ -1921,14 +1921,27 @@ function createRoot(canvas) {
|
|
|
1921
1921
|
|
|
1922
1922
|
|
|
1923
1923
|
if (gl.shadowMap) {
|
|
1924
|
-
const
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1924
|
+
const oldEnabled = gl.shadowMap.enabled;
|
|
1925
|
+
const oldType = gl.shadowMap.type;
|
|
1926
|
+
gl.shadowMap.enabled = !!shadows;
|
|
1927
|
+
|
|
1928
|
+
if (is.boo(shadows)) {
|
|
1929
|
+
gl.shadowMap.type = THREE__namespace.PCFSoftShadowMap;
|
|
1930
|
+
} else if (is.str(shadows)) {
|
|
1931
|
+
var _types$shadows;
|
|
1932
|
+
|
|
1933
|
+
const types = {
|
|
1934
|
+
basic: THREE__namespace.BasicShadowMap,
|
|
1935
|
+
percentage: THREE__namespace.PCFShadowMap,
|
|
1936
|
+
soft: THREE__namespace.PCFSoftShadowMap,
|
|
1937
|
+
variance: THREE__namespace.VSMShadowMap
|
|
1938
|
+
};
|
|
1939
|
+
gl.shadowMap.type = (_types$shadows = types[shadows]) != null ? _types$shadows : THREE__namespace.PCFSoftShadowMap;
|
|
1940
|
+
} else if (is.obj(shadows)) {
|
|
1941
|
+
Object.assign(gl.shadowMap, shadows);
|
|
1931
1942
|
}
|
|
1943
|
+
|
|
1944
|
+
if (oldEnabled !== gl.shadowMap.enabled || oldType !== gl.shadowMap.type) gl.shadowMap.needsUpdate = true;
|
|
1932
1945
|
} // Safely set color management if available.
|
|
1933
1946
|
// Avoid accessing THREE.ColorManagement to play nice with older versions
|
|
1934
1947
|
|
|
@@ -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-4ea38fa1.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-d957aeb6.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, i as isRef, E as ErrorBoundary, B as Block, b as useIsomorphicLayoutEffect, d as unmountComponentAtNode } from './index-
|
|
2
|
-
export { t as ReactThreeFiber, w as _roots, v 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 flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, A as useFrame, C as useGraph, x as useInstanceHandle, D as useLoader, y as useStore, z as useThree } from './index-
|
|
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-27a1523b.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, w as _roots, v 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 flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, A as useFrame, C as useGraph, x as useInstanceHandle, D as useLoader, y as useStore, z as useThree } from './index-27a1523b.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-4ea38fa1.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-d957aeb6.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, w as _roots, v 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 flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, A as useFrame, C as useGraph, x as useInstanceHandle, D as useLoader, y as useStore, z 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-27a1523b.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, w as _roots, v 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 flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, A as useFrame, C as useGraph, x as useInstanceHandle, D as useLoader, y as useStore, z as useThree } from '../../dist/index-27a1523b.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';
|