@react-three/fiber 10.0.0-canary.0706a92 → 10.0.0-canary.0f7fc9b
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/dist/index.cjs +1747 -1575
- package/dist/index.d.cts +82 -27
- package/dist/index.d.mts +82 -27
- package/dist/index.d.ts +82 -27
- package/dist/index.mjs +1750 -1578
- package/dist/legacy.cjs +2207 -2040
- package/dist/legacy.d.cts +81 -29
- package/dist/legacy.d.mts +81 -29
- package/dist/legacy.d.ts +81 -29
- package/dist/legacy.mjs +2209 -2042
- package/dist/webgpu/index.cjs +2195 -2246
- package/dist/webgpu/index.d.cts +120 -80
- package/dist/webgpu/index.d.mts +120 -80
- package/dist/webgpu/index.d.ts +120 -80
- package/dist/webgpu/index.mjs +2462 -2513
- package/package.json +5 -5
- package/readme.md +1 -2
- package/react-reconciler/constants.d.ts +0 -7
- package/react-reconciler/constants.js +0 -1
- package/react-reconciler/index.d.ts +0 -1044
- package/react-reconciler/index.js +0 -208
package/dist/legacy.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as THREE$1 from 'three';
|
|
2
|
-
import { WebGLRenderTarget, Color as Color$1, ColorRepresentation, Euler as Euler$1, Loader, RenderTargetOptions as RenderTargetOptions$1, Layers as Layers$1, Raycaster, Intersection as Intersection$1, BufferGeometry, Matrix4 as Matrix4$1, Quaternion as Quaternion$1, Node as Node$1, Vector2 as Vector2$1, Vector3 as Vector3$1, Vector4 as Vector4$1, Matrix3 as Matrix3$1, ColorSpace, Texture as Texture$1, CubeTexture, Scene, Object3D, Frustum, OrthographicCamera } from 'three';
|
|
2
|
+
import { WebGLCubeRenderTarget, WebGLRenderTarget, Color as Color$1, ColorRepresentation, Euler as Euler$1, Loader, RenderTargetOptions as RenderTargetOptions$1, Layers as Layers$1, Raycaster, Intersection as Intersection$1, BufferGeometry, Matrix4 as Matrix4$1, Quaternion as Quaternion$1, Node as Node$1, Vector2 as Vector2$1, Vector3 as Vector3$1, Vector4 as Vector4$1, Matrix3 as Matrix3$1, ColorSpace, Texture as Texture$1, CubeTexture, Scene, Object3D, Frustum, OrthographicCamera } from 'three';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import { ReactNode, Component, RefObject, JSX } from 'react';
|
|
5
5
|
import * as three_webgpu from 'three/webgpu';
|
|
@@ -10,7 +10,6 @@ import { FrameTimingState, FrameCallback as FrameCallback$1, SchedulerApi, UseFr
|
|
|
10
10
|
export { AddPhaseOptions, FrameControls, FrameNextControls, FrameTimingState, RootOptions, Scheduler, SchedulerApi, UseFrameNextOptions, UseFrameOptions, getScheduler } from '@pmndrs/scheduler';
|
|
11
11
|
import { Options } from 'react-use-measure';
|
|
12
12
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
13
|
-
import { ThreeElement as ThreeElement$1, Euler as Euler$2 } from '@react-three/fiber';
|
|
14
13
|
import { GroundedSkybox } from 'three/examples/jsm/objects/GroundedSkybox.js';
|
|
15
14
|
|
|
16
15
|
function _mergeNamespaces(n, m) {
|
|
@@ -39,23 +38,28 @@ function _mergeNamespaces(n, m) {
|
|
|
39
38
|
declare const R3F_BUILD_LEGACY = true;
|
|
40
39
|
declare const R3F_BUILD_WEBGPU = false;
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
type Inspector = never;
|
|
42
|
+
/** Not available on the legacy (WebGL-only) entry. */
|
|
43
|
+
declare function loadInspector(): Promise<never>;
|
|
45
44
|
declare const WebGPURenderer: {
|
|
46
45
|
new (): {};
|
|
47
46
|
};
|
|
48
47
|
|
|
49
48
|
declare const RenderTarget: any;
|
|
50
49
|
|
|
50
|
+
declare const CubeRenderTarget: any;
|
|
51
|
+
|
|
51
52
|
var THREE = /*#__PURE__*/_mergeNamespaces({
|
|
52
53
|
__proto__: null,
|
|
54
|
+
CubeRenderTarget: CubeRenderTarget,
|
|
55
|
+
CubeRenderTargetCompat: WebGLCubeRenderTarget,
|
|
53
56
|
Inspector: Inspector,
|
|
54
57
|
R3F_BUILD_LEGACY: R3F_BUILD_LEGACY,
|
|
55
58
|
R3F_BUILD_WEBGPU: R3F_BUILD_WEBGPU,
|
|
56
59
|
RenderTarget: RenderTarget,
|
|
57
60
|
RenderTargetCompat: WebGLRenderTarget,
|
|
58
|
-
WebGPURenderer: WebGPURenderer
|
|
61
|
+
WebGPURenderer: WebGPURenderer,
|
|
62
|
+
loadInspector: loadInspector
|
|
59
63
|
}, [THREE$1]);
|
|
60
64
|
|
|
61
65
|
//* Utility Types ==============================
|
|
@@ -493,6 +497,18 @@ interface InternalState {
|
|
|
493
497
|
* @see https://threejs.org/docs/#api/en/renderers/common/CanvasTarget
|
|
494
498
|
*/
|
|
495
499
|
canvasTarget?: CanvasTarget
|
|
500
|
+
/**
|
|
501
|
+
* Set when this root's canvas target has been resized and the backend's cached render pass
|
|
502
|
+
* descriptor (which holds a depth-stencil view built once per canvas) is therefore stale.
|
|
503
|
+
*
|
|
504
|
+
* Flushed by the canvas-target job in the `start` phase, which is the only place this root's
|
|
505
|
+
* target is guaranteed to be the renderer's active one — `backend.updateSize()` operates on
|
|
506
|
+
* whatever `getCanvasTarget()` returns, so calling it from the resize subscription would
|
|
507
|
+
* invalidate some other canvas's descriptor instead.
|
|
508
|
+
*
|
|
509
|
+
* @see https://github.com/pmndrs/react-three-fiber/issues/3847
|
|
510
|
+
*/
|
|
511
|
+
canvasTargetSizeDirty?: boolean
|
|
496
512
|
/**
|
|
497
513
|
* Whether multi-canvas rendering is active.
|
|
498
514
|
* True when any canvas uses `renderer={{ primaryCanvas: 'id' }}` to share a renderer.
|
|
@@ -612,7 +628,7 @@ interface RootState {
|
|
|
612
628
|
/** Internal: refcount per texture key, driven by mounted useTexture consumers (registry enrollment is on by default) */
|
|
613
629
|
_textureRefs: Map<string, number>
|
|
614
630
|
/** WebGPU RenderPipeline instance - use useRenderPipeline() hook */
|
|
615
|
-
renderPipeline:
|
|
631
|
+
renderPipeline: ThreeRenderPipeline | null
|
|
616
632
|
/** Global TSL pass nodes for render pipeline - use useRenderPipeline() hook */
|
|
617
633
|
passes: Record<string, any>
|
|
618
634
|
/** Internal version counter for HMR - incremented by rebuildNodes/rebuildUniforms to bust memoization */
|
|
@@ -1141,10 +1157,21 @@ type RenderTargetOptions = RenderTargetOptions$1
|
|
|
1141
1157
|
//* Global Types ==============================
|
|
1142
1158
|
|
|
1143
1159
|
declare global {
|
|
1144
|
-
/**
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1160
|
+
/**
|
|
1161
|
+
* Uniform node type.
|
|
1162
|
+
*
|
|
1163
|
+
* This is three's own `UniformNode`, not a re-declaration of it. It previously was a
|
|
1164
|
+
* hand-rolled `interface UniformNode<T> extends Node { value: T }`, which shadowed the real
|
|
1165
|
+
* exported type globally — so R3F's ~58 references resolved to an approximation that was
|
|
1166
|
+
* missing members three actually ships (`setName` among them) and had drifted to the wrong
|
|
1167
|
+
* arity when three made `UniformNode` two-parameter.
|
|
1168
|
+
*
|
|
1169
|
+
* three's signature is `UniformNode<TNodeType, TValue>`. R3F only ever varies the value type,
|
|
1170
|
+
* so the node type is fixed to `unknown` and the single parameter is kept for call-site
|
|
1171
|
+
* ergonomics. The result is three's structural type, so members stay in sync with the
|
|
1172
|
+
* installed three instead of needing to be mirrored by hand.
|
|
1173
|
+
*/
|
|
1174
|
+
type UniformNode<T = unknown> = three_webgpu.UniformNode<unknown, T>
|
|
1148
1175
|
|
|
1149
1176
|
/**
|
|
1150
1177
|
* ShaderCallable - the return type of Fn()
|
|
@@ -1289,13 +1316,14 @@ declare module 'three/tsl' {
|
|
|
1289
1316
|
): ShaderCallable<R>
|
|
1290
1317
|
}
|
|
1291
1318
|
|
|
1292
|
-
/**
|
|
1293
|
-
* RenderPipeline Types for useRenderPipeline hook (WebGPU only)
|
|
1294
|
-
*/
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
1319
|
declare global {
|
|
1320
|
+
/**
|
|
1321
|
+
* three's own render pipeline type. Named here so the rest of R3F refers to three's shape
|
|
1322
|
+
* rather than `any`. three r183 renamed `PostProcessing` to `RenderPipeline`; our peer floor
|
|
1323
|
+
* is r185, so the new name is the only one.
|
|
1324
|
+
*/
|
|
1325
|
+
type ThreeRenderPipeline = three_webgpu.RenderPipeline
|
|
1326
|
+
|
|
1299
1327
|
/** Pass record - stores TSL pass nodes for render pipeline */
|
|
1300
1328
|
type PassRecord = Record<string, any>
|
|
1301
1329
|
|
|
@@ -1310,7 +1338,7 @@ declare global {
|
|
|
1310
1338
|
/** Current passes from state */
|
|
1311
1339
|
passes: PassRecord
|
|
1312
1340
|
/** RenderPipeline instance (null if not initialized) */
|
|
1313
|
-
renderPipeline:
|
|
1341
|
+
renderPipeline: ThreeRenderPipeline | null
|
|
1314
1342
|
/** Clear all passes from state */
|
|
1315
1343
|
clearPasses: () => void
|
|
1316
1344
|
/** Reset RenderPipeline entirely (clears PP + passes) */
|
|
@@ -1559,12 +1587,23 @@ type EnvironmentLoaderProps = {
|
|
|
1559
1587
|
* const texture = useEnvironment({ preset: 'sunset' })
|
|
1560
1588
|
* ```
|
|
1561
1589
|
*/
|
|
1562
|
-
declare function useEnvironment({ files, path, preset, colorSpace, extensions, }?: Partial<EnvironmentLoaderProps>): Texture$1<unknown> | CubeTexture
|
|
1590
|
+
declare function useEnvironment({ files, path, preset, colorSpace, extensions, }?: Partial<EnvironmentLoaderProps>): Texture$1<unknown, THREE$1.TextureEventMap> | CubeTexture<unknown>;
|
|
1563
1591
|
declare namespace useEnvironment {
|
|
1564
1592
|
var preload: (preloadOptions?: EnvironmentLoaderPreloadOptions) => void;
|
|
1565
1593
|
var clear: (clearOptions?: EnvironmentLoaderClearOptions) => void;
|
|
1566
1594
|
}
|
|
1567
|
-
|
|
1595
|
+
/**
|
|
1596
|
+
* Options accepted by `useEnvironment.preload`.
|
|
1597
|
+
*
|
|
1598
|
+
* `colorSpace` is deliberately omitted: preload only warms the loader cache, and colorSpace is
|
|
1599
|
+
* applied to the texture by `useEnvironment()` at use time, per consumer. Accepting it here would
|
|
1600
|
+
* advertise an option this function silently ignores.
|
|
1601
|
+
*
|
|
1602
|
+
* This previously read `Omit<…, 'encoding'>` — omitting a key that does not exist on
|
|
1603
|
+
* `EnvironmentLoaderProps`, a leftover from three's pre-`colorSpace` `encoding` API. That made the
|
|
1604
|
+
* type equivalent to the full props, so `colorSpace` was accepted and then dropped on the floor.
|
|
1605
|
+
*/
|
|
1606
|
+
type EnvironmentLoaderPreloadOptions = Omit<EnvironmentLoaderProps, 'colorSpace'>;
|
|
1568
1607
|
type EnvironmentLoaderClearOptions = Pick<EnvironmentLoaderProps, 'files' | 'preset'>;
|
|
1569
1608
|
|
|
1570
1609
|
/**
|
|
@@ -1608,9 +1647,9 @@ type EnvironmentProps = {
|
|
|
1608
1647
|
blur?: number;
|
|
1609
1648
|
backgroundBlurriness?: number;
|
|
1610
1649
|
backgroundIntensity?: number;
|
|
1611
|
-
backgroundRotation?: Euler
|
|
1650
|
+
backgroundRotation?: Euler;
|
|
1612
1651
|
environmentIntensity?: number;
|
|
1613
|
-
environmentRotation?: Euler
|
|
1652
|
+
environmentRotation?: Euler;
|
|
1614
1653
|
map?: Texture$1;
|
|
1615
1654
|
preset?: PresetsType;
|
|
1616
1655
|
scene?: Scene | React$1.RefObject<Scene>;
|
|
@@ -1694,7 +1733,7 @@ declare function EnvironmentCube({ background, scene, blur, backgroundBlurriness
|
|
|
1694
1733
|
declare function EnvironmentPortal({ children, near, far, resolution, frames, map, background, blur, backgroundBlurriness, backgroundIntensity, backgroundRotation, environmentIntensity, environmentRotation, scene, files, path, preset, extensions, }: EnvironmentProps): react_jsx_runtime.JSX.Element;
|
|
1695
1734
|
declare module '@react-three/fiber' {
|
|
1696
1735
|
interface ThreeElements {
|
|
1697
|
-
groundProjectedEnvImpl: ThreeElement
|
|
1736
|
+
groundProjectedEnvImpl: ThreeElement<typeof GroundedSkybox>;
|
|
1698
1737
|
}
|
|
1699
1738
|
}
|
|
1700
1739
|
/**
|
|
@@ -1794,6 +1833,24 @@ declare module '@react-three/fiber' {
|
|
|
1794
1833
|
*/
|
|
1795
1834
|
declare function Environment(props: EnvironmentProps): react_jsx_runtime.JSX.Element;
|
|
1796
1835
|
|
|
1836
|
+
/**
|
|
1837
|
+
* Moves every trace of interactivity from one object to its replacement, for reconstruction.
|
|
1838
|
+
*
|
|
1839
|
+
* When `args` or a `primitive`'s `object` changes, R3F builds a new three object and keeps the same
|
|
1840
|
+
* instance. Removing the old object from the interaction state and registering the new one from
|
|
1841
|
+
* scratch makes events *work* again (#3778), but it forgets what was in flight: a pointer resting on
|
|
1842
|
+
* the object fires a second `onPointerEnter` without ever having left, and an active pointer capture
|
|
1843
|
+
* is dropped mid-drag. Rewriting the references instead keeps the interaction continuous across a
|
|
1844
|
+
* swap the user never asked to see (#3744).
|
|
1845
|
+
*
|
|
1846
|
+
* Captures are re-keyed rather than released, so the DOM-level capture on `captureData.target` is
|
|
1847
|
+
* left alone — releasing and re-acquiring it is precisely the glitch being avoided.
|
|
1848
|
+
*
|
|
1849
|
+
* Visibility handlers are deliberately not transferred: that registry is keyed by `object.uuid`, so
|
|
1850
|
+
* the replacement re-registers itself through `applyProps`. The old entry is dropped here so it
|
|
1851
|
+
* cannot outlive the object it described.
|
|
1852
|
+
*/
|
|
1853
|
+
declare function swapInteractivity(store: RootStore, object: Object3D, newObject: Object3D): void;
|
|
1797
1854
|
declare function removeInteractivity(store: RootStore, object: Object3D): void;
|
|
1798
1855
|
declare function createEvents(store: RootStore): {
|
|
1799
1856
|
handlePointer: (name: string) => (event: DomEvent) => void;
|
|
@@ -3219,11 +3276,6 @@ declare function flushSync<R>(fn: () => R): R;
|
|
|
3219
3276
|
declare const context: React$1.Context<RootStore>;
|
|
3220
3277
|
declare const createStore: (invalidate: (state?: RootState, frames?: number, stackFrames?: boolean) => void, advance: (timestamp: number, runGlobalEffects?: boolean, state?: RootState, frame?: XRFrame) => void) => RootStore;
|
|
3221
3278
|
|
|
3222
|
-
/**
|
|
3223
|
-
* Safely flush async effects when testing, simulating a legacy root.
|
|
3224
|
-
* @deprecated Import from React instead. import { act } from 'react'
|
|
3225
|
-
*/
|
|
3226
|
-
declare const act: typeof React$1.act;
|
|
3227
3279
|
/**
|
|
3228
3280
|
* An SSR-friendly useLayoutEffect.
|
|
3229
3281
|
*
|
|
@@ -3707,5 +3759,5 @@ declare function isOnce(value: unknown): value is {
|
|
|
3707
3759
|
*/
|
|
3708
3760
|
declare function Canvas(props: CanvasProps): react_jsx_runtime.JSX.Element;
|
|
3709
3761
|
|
|
3710
|
-
export { Block, Canvas, Environment, EnvironmentCube, EnvironmentMap, EnvironmentPortal, ErrorBoundary, FROM_REF, IsObject, ONCE, Portal, R3F_BUILD_LEGACY, R3F_BUILD_WEBGPU, REACT_INTERNAL_PROPS, RESERVED_PROPS, three_d as ReactThreeFiber, Texture, _roots,
|
|
3762
|
+
export { Block, Canvas, Environment, EnvironmentCube, EnvironmentMap, EnvironmentPortal, ErrorBoundary, FROM_REF, IsObject, ONCE, Portal, R3F_BUILD_LEGACY, R3F_BUILD_WEBGPU, REACT_INTERNAL_PROPS, RESERVED_PROPS, three_d as ReactThreeFiber, Texture, _roots, addAfterEffect, addEffect, addTail, advance, applyProps, attach, buildGraph, calculateDpr, context, createEvents, createPointerEvents, createPortal, createRoot, createStore, detach, diffProps, dispose, createPointerEvents as events, extend, findInitialRoot, flushSync, fromRef, getInstanceProps, getPrimary, getPrimaryIds, getRootState, getUuidPrefix, hasConstructor, hasPrimary, invalidate, invalidateInstance, is, isColorRepresentation, isCopyable, isFromRef, isObject3D, isOnce, isOrthographicCamera, isRef, isRenderer, isTexture, isVectorLike, once, prepare, presetsObj, reconciler, registerPrimary, removeInteractivity, resolve, swapInteractivity, unmountComponentAtNode, unregisterPrimary, updateCamera, updateFrustum, useBridge, useEnvironment, useFrame, useGraph, useInstanceHandle, useIsomorphicLayoutEffect, useLoader, useMutableCallback, useRenderTarget, useStore, useTexture, useTextures, useThree, waitForPrimary };
|
|
3711
3763
|
export type { Act, Args, ArgsProp, AttachFnType, AttachType, BackgroundConfig, BackgroundProp, BaseRendererProps, Bridge, BufferLike, BufferRecord, BufferStore, Camera, CameraProps, CanvasProps, CanvasSchedulerConfig, Catalogue, Color, ColorManagementConfig, ComputeFunction, ConstructorRepresentation, DefaultGLProps, DefaultRendererProps, Disposable, DisposeOptions, DomEvent, Dpr, ElementProps, EnvironmentLoaderProps, EnvironmentProps, EquConfig, Euler, EventHandlers, EventManager, EventProps, Events, Extensions, FiberRoot, FilterFunction, FrameCallback, FrameNextCallback, FrameNextState, FrameState, Frameloop, GLProps, GLTFLike, GeometryProps, GeometryTransformProps, GlobalEffectType, GlobalRenderCallback, HostConfig, InferLoadResult, InjectState, InputLike, Instance, InstanceProps, LegacyInternalState as InternalState, Intersection, IntersectionEvent, IsAllOptional, IsOptional, Layers, LegacyInternalState, LegacyRenderer, LegacyRootState, LoaderInstance, LoaderLike, LoaderResult, MappedTextureType, MathProps, MathRepresentation, MathType, MathTypes, Matrix3, Matrix4, Mutable, MutableOrReadonlyParameters, NodeProps, NonFunctionKeys, ObjectMap, OffscreenCanvas$1 as OffscreenCanvas, Overwrite, Performance, PointerCaptureTarget, PointerState, PresetsType, PrimaryCanvasEntry, Properties, Quaternion, LegacyRenderer as R3FRenderer, RaycastableRepresentation, ReactProps, ReconcilerRoot, RenderCallback, RenderProps, RenderTargetOptions, Renderer, RendererConfigExtended, RendererFactory, RendererProps, Root, LegacyRootState as RootState, RootStore, SetBlock, Size, StorageLike, StorageRecord, StorageStore, Subscription, TSLNodeInput, TextureInput, TextureResult, ThreeCamera, ThreeElement, ThreeElements, ThreeElementsImpl, ThreeEvent, ThreeExports, ThreeToJSXElements, UnblockProps, UseTextureOptions, UseTexturesReturn, Vector2, Vector3, Vector4, VectorRepresentation, Viewport, VisibilityEntry, WebGLDefaultProps, WebGLProps, WebGLShadowConfig, XRManager, XRPointerConfig };
|
package/dist/legacy.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as THREE$1 from 'three';
|
|
2
|
-
import { WebGLRenderTarget, Color as Color$1, ColorRepresentation, Euler as Euler$1, Loader, RenderTargetOptions as RenderTargetOptions$1, Layers as Layers$1, Raycaster, Intersection as Intersection$1, BufferGeometry, Matrix4 as Matrix4$1, Quaternion as Quaternion$1, Node as Node$1, Vector2 as Vector2$1, Vector3 as Vector3$1, Vector4 as Vector4$1, Matrix3 as Matrix3$1, ColorSpace, Texture as Texture$1, CubeTexture, Scene, Object3D, Frustum, OrthographicCamera } from 'three';
|
|
2
|
+
import { WebGLCubeRenderTarget, WebGLRenderTarget, Color as Color$1, ColorRepresentation, Euler as Euler$1, Loader, RenderTargetOptions as RenderTargetOptions$1, Layers as Layers$1, Raycaster, Intersection as Intersection$1, BufferGeometry, Matrix4 as Matrix4$1, Quaternion as Quaternion$1, Node as Node$1, Vector2 as Vector2$1, Vector3 as Vector3$1, Vector4 as Vector4$1, Matrix3 as Matrix3$1, ColorSpace, Texture as Texture$1, CubeTexture, Scene, Object3D, Frustum, OrthographicCamera } from 'three';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import { ReactNode, Component, RefObject, JSX } from 'react';
|
|
5
5
|
import * as three_webgpu from 'three/webgpu';
|
|
@@ -10,7 +10,6 @@ import { FrameTimingState, FrameCallback as FrameCallback$1, SchedulerApi, UseFr
|
|
|
10
10
|
export { AddPhaseOptions, FrameControls, FrameNextControls, FrameTimingState, RootOptions, Scheduler, SchedulerApi, UseFrameNextOptions, UseFrameOptions, getScheduler } from '@pmndrs/scheduler';
|
|
11
11
|
import { Options } from 'react-use-measure';
|
|
12
12
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
13
|
-
import { ThreeElement as ThreeElement$1, Euler as Euler$2 } from '@react-three/fiber';
|
|
14
13
|
import { GroundedSkybox } from 'three/examples/jsm/objects/GroundedSkybox.js';
|
|
15
14
|
|
|
16
15
|
function _mergeNamespaces(n, m) {
|
|
@@ -39,23 +38,28 @@ function _mergeNamespaces(n, m) {
|
|
|
39
38
|
declare const R3F_BUILD_LEGACY = true;
|
|
40
39
|
declare const R3F_BUILD_WEBGPU = false;
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
type Inspector = never;
|
|
42
|
+
/** Not available on the legacy (WebGL-only) entry. */
|
|
43
|
+
declare function loadInspector(): Promise<never>;
|
|
45
44
|
declare const WebGPURenderer: {
|
|
46
45
|
new (): {};
|
|
47
46
|
};
|
|
48
47
|
|
|
49
48
|
declare const RenderTarget: any;
|
|
50
49
|
|
|
50
|
+
declare const CubeRenderTarget: any;
|
|
51
|
+
|
|
51
52
|
var THREE = /*#__PURE__*/_mergeNamespaces({
|
|
52
53
|
__proto__: null,
|
|
54
|
+
CubeRenderTarget: CubeRenderTarget,
|
|
55
|
+
CubeRenderTargetCompat: WebGLCubeRenderTarget,
|
|
53
56
|
Inspector: Inspector,
|
|
54
57
|
R3F_BUILD_LEGACY: R3F_BUILD_LEGACY,
|
|
55
58
|
R3F_BUILD_WEBGPU: R3F_BUILD_WEBGPU,
|
|
56
59
|
RenderTarget: RenderTarget,
|
|
57
60
|
RenderTargetCompat: WebGLRenderTarget,
|
|
58
|
-
WebGPURenderer: WebGPURenderer
|
|
61
|
+
WebGPURenderer: WebGPURenderer,
|
|
62
|
+
loadInspector: loadInspector
|
|
59
63
|
}, [THREE$1]);
|
|
60
64
|
|
|
61
65
|
//* Utility Types ==============================
|
|
@@ -493,6 +497,18 @@ interface InternalState {
|
|
|
493
497
|
* @see https://threejs.org/docs/#api/en/renderers/common/CanvasTarget
|
|
494
498
|
*/
|
|
495
499
|
canvasTarget?: CanvasTarget
|
|
500
|
+
/**
|
|
501
|
+
* Set when this root's canvas target has been resized and the backend's cached render pass
|
|
502
|
+
* descriptor (which holds a depth-stencil view built once per canvas) is therefore stale.
|
|
503
|
+
*
|
|
504
|
+
* Flushed by the canvas-target job in the `start` phase, which is the only place this root's
|
|
505
|
+
* target is guaranteed to be the renderer's active one — `backend.updateSize()` operates on
|
|
506
|
+
* whatever `getCanvasTarget()` returns, so calling it from the resize subscription would
|
|
507
|
+
* invalidate some other canvas's descriptor instead.
|
|
508
|
+
*
|
|
509
|
+
* @see https://github.com/pmndrs/react-three-fiber/issues/3847
|
|
510
|
+
*/
|
|
511
|
+
canvasTargetSizeDirty?: boolean
|
|
496
512
|
/**
|
|
497
513
|
* Whether multi-canvas rendering is active.
|
|
498
514
|
* True when any canvas uses `renderer={{ primaryCanvas: 'id' }}` to share a renderer.
|
|
@@ -612,7 +628,7 @@ interface RootState {
|
|
|
612
628
|
/** Internal: refcount per texture key, driven by mounted useTexture consumers (registry enrollment is on by default) */
|
|
613
629
|
_textureRefs: Map<string, number>
|
|
614
630
|
/** WebGPU RenderPipeline instance - use useRenderPipeline() hook */
|
|
615
|
-
renderPipeline:
|
|
631
|
+
renderPipeline: ThreeRenderPipeline | null
|
|
616
632
|
/** Global TSL pass nodes for render pipeline - use useRenderPipeline() hook */
|
|
617
633
|
passes: Record<string, any>
|
|
618
634
|
/** Internal version counter for HMR - incremented by rebuildNodes/rebuildUniforms to bust memoization */
|
|
@@ -1141,10 +1157,21 @@ type RenderTargetOptions = RenderTargetOptions$1
|
|
|
1141
1157
|
//* Global Types ==============================
|
|
1142
1158
|
|
|
1143
1159
|
declare global {
|
|
1144
|
-
/**
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1160
|
+
/**
|
|
1161
|
+
* Uniform node type.
|
|
1162
|
+
*
|
|
1163
|
+
* This is three's own `UniformNode`, not a re-declaration of it. It previously was a
|
|
1164
|
+
* hand-rolled `interface UniformNode<T> extends Node { value: T }`, which shadowed the real
|
|
1165
|
+
* exported type globally — so R3F's ~58 references resolved to an approximation that was
|
|
1166
|
+
* missing members three actually ships (`setName` among them) and had drifted to the wrong
|
|
1167
|
+
* arity when three made `UniformNode` two-parameter.
|
|
1168
|
+
*
|
|
1169
|
+
* three's signature is `UniformNode<TNodeType, TValue>`. R3F only ever varies the value type,
|
|
1170
|
+
* so the node type is fixed to `unknown` and the single parameter is kept for call-site
|
|
1171
|
+
* ergonomics. The result is three's structural type, so members stay in sync with the
|
|
1172
|
+
* installed three instead of needing to be mirrored by hand.
|
|
1173
|
+
*/
|
|
1174
|
+
type UniformNode<T = unknown> = three_webgpu.UniformNode<unknown, T>
|
|
1148
1175
|
|
|
1149
1176
|
/**
|
|
1150
1177
|
* ShaderCallable - the return type of Fn()
|
|
@@ -1289,13 +1316,14 @@ declare module 'three/tsl' {
|
|
|
1289
1316
|
): ShaderCallable<R>
|
|
1290
1317
|
}
|
|
1291
1318
|
|
|
1292
|
-
/**
|
|
1293
|
-
* RenderPipeline Types for useRenderPipeline hook (WebGPU only)
|
|
1294
|
-
*/
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
1319
|
declare global {
|
|
1320
|
+
/**
|
|
1321
|
+
* three's own render pipeline type. Named here so the rest of R3F refers to three's shape
|
|
1322
|
+
* rather than `any`. three r183 renamed `PostProcessing` to `RenderPipeline`; our peer floor
|
|
1323
|
+
* is r185, so the new name is the only one.
|
|
1324
|
+
*/
|
|
1325
|
+
type ThreeRenderPipeline = three_webgpu.RenderPipeline
|
|
1326
|
+
|
|
1299
1327
|
/** Pass record - stores TSL pass nodes for render pipeline */
|
|
1300
1328
|
type PassRecord = Record<string, any>
|
|
1301
1329
|
|
|
@@ -1310,7 +1338,7 @@ declare global {
|
|
|
1310
1338
|
/** Current passes from state */
|
|
1311
1339
|
passes: PassRecord
|
|
1312
1340
|
/** RenderPipeline instance (null if not initialized) */
|
|
1313
|
-
renderPipeline:
|
|
1341
|
+
renderPipeline: ThreeRenderPipeline | null
|
|
1314
1342
|
/** Clear all passes from state */
|
|
1315
1343
|
clearPasses: () => void
|
|
1316
1344
|
/** Reset RenderPipeline entirely (clears PP + passes) */
|
|
@@ -1559,12 +1587,23 @@ type EnvironmentLoaderProps = {
|
|
|
1559
1587
|
* const texture = useEnvironment({ preset: 'sunset' })
|
|
1560
1588
|
* ```
|
|
1561
1589
|
*/
|
|
1562
|
-
declare function useEnvironment({ files, path, preset, colorSpace, extensions, }?: Partial<EnvironmentLoaderProps>): Texture$1<unknown> | CubeTexture
|
|
1590
|
+
declare function useEnvironment({ files, path, preset, colorSpace, extensions, }?: Partial<EnvironmentLoaderProps>): Texture$1<unknown, THREE$1.TextureEventMap> | CubeTexture<unknown>;
|
|
1563
1591
|
declare namespace useEnvironment {
|
|
1564
1592
|
var preload: (preloadOptions?: EnvironmentLoaderPreloadOptions) => void;
|
|
1565
1593
|
var clear: (clearOptions?: EnvironmentLoaderClearOptions) => void;
|
|
1566
1594
|
}
|
|
1567
|
-
|
|
1595
|
+
/**
|
|
1596
|
+
* Options accepted by `useEnvironment.preload`.
|
|
1597
|
+
*
|
|
1598
|
+
* `colorSpace` is deliberately omitted: preload only warms the loader cache, and colorSpace is
|
|
1599
|
+
* applied to the texture by `useEnvironment()` at use time, per consumer. Accepting it here would
|
|
1600
|
+
* advertise an option this function silently ignores.
|
|
1601
|
+
*
|
|
1602
|
+
* This previously read `Omit<…, 'encoding'>` — omitting a key that does not exist on
|
|
1603
|
+
* `EnvironmentLoaderProps`, a leftover from three's pre-`colorSpace` `encoding` API. That made the
|
|
1604
|
+
* type equivalent to the full props, so `colorSpace` was accepted and then dropped on the floor.
|
|
1605
|
+
*/
|
|
1606
|
+
type EnvironmentLoaderPreloadOptions = Omit<EnvironmentLoaderProps, 'colorSpace'>;
|
|
1568
1607
|
type EnvironmentLoaderClearOptions = Pick<EnvironmentLoaderProps, 'files' | 'preset'>;
|
|
1569
1608
|
|
|
1570
1609
|
/**
|
|
@@ -1608,9 +1647,9 @@ type EnvironmentProps = {
|
|
|
1608
1647
|
blur?: number;
|
|
1609
1648
|
backgroundBlurriness?: number;
|
|
1610
1649
|
backgroundIntensity?: number;
|
|
1611
|
-
backgroundRotation?: Euler
|
|
1650
|
+
backgroundRotation?: Euler;
|
|
1612
1651
|
environmentIntensity?: number;
|
|
1613
|
-
environmentRotation?: Euler
|
|
1652
|
+
environmentRotation?: Euler;
|
|
1614
1653
|
map?: Texture$1;
|
|
1615
1654
|
preset?: PresetsType;
|
|
1616
1655
|
scene?: Scene | React$1.RefObject<Scene>;
|
|
@@ -1694,7 +1733,7 @@ declare function EnvironmentCube({ background, scene, blur, backgroundBlurriness
|
|
|
1694
1733
|
declare function EnvironmentPortal({ children, near, far, resolution, frames, map, background, blur, backgroundBlurriness, backgroundIntensity, backgroundRotation, environmentIntensity, environmentRotation, scene, files, path, preset, extensions, }: EnvironmentProps): react_jsx_runtime.JSX.Element;
|
|
1695
1734
|
declare module '@react-three/fiber' {
|
|
1696
1735
|
interface ThreeElements {
|
|
1697
|
-
groundProjectedEnvImpl: ThreeElement
|
|
1736
|
+
groundProjectedEnvImpl: ThreeElement<typeof GroundedSkybox>;
|
|
1698
1737
|
}
|
|
1699
1738
|
}
|
|
1700
1739
|
/**
|
|
@@ -1794,6 +1833,24 @@ declare module '@react-three/fiber' {
|
|
|
1794
1833
|
*/
|
|
1795
1834
|
declare function Environment(props: EnvironmentProps): react_jsx_runtime.JSX.Element;
|
|
1796
1835
|
|
|
1836
|
+
/**
|
|
1837
|
+
* Moves every trace of interactivity from one object to its replacement, for reconstruction.
|
|
1838
|
+
*
|
|
1839
|
+
* When `args` or a `primitive`'s `object` changes, R3F builds a new three object and keeps the same
|
|
1840
|
+
* instance. Removing the old object from the interaction state and registering the new one from
|
|
1841
|
+
* scratch makes events *work* again (#3778), but it forgets what was in flight: a pointer resting on
|
|
1842
|
+
* the object fires a second `onPointerEnter` without ever having left, and an active pointer capture
|
|
1843
|
+
* is dropped mid-drag. Rewriting the references instead keeps the interaction continuous across a
|
|
1844
|
+
* swap the user never asked to see (#3744).
|
|
1845
|
+
*
|
|
1846
|
+
* Captures are re-keyed rather than released, so the DOM-level capture on `captureData.target` is
|
|
1847
|
+
* left alone — releasing and re-acquiring it is precisely the glitch being avoided.
|
|
1848
|
+
*
|
|
1849
|
+
* Visibility handlers are deliberately not transferred: that registry is keyed by `object.uuid`, so
|
|
1850
|
+
* the replacement re-registers itself through `applyProps`. The old entry is dropped here so it
|
|
1851
|
+
* cannot outlive the object it described.
|
|
1852
|
+
*/
|
|
1853
|
+
declare function swapInteractivity(store: RootStore, object: Object3D, newObject: Object3D): void;
|
|
1797
1854
|
declare function removeInteractivity(store: RootStore, object: Object3D): void;
|
|
1798
1855
|
declare function createEvents(store: RootStore): {
|
|
1799
1856
|
handlePointer: (name: string) => (event: DomEvent) => void;
|
|
@@ -3219,11 +3276,6 @@ declare function flushSync<R>(fn: () => R): R;
|
|
|
3219
3276
|
declare const context: React$1.Context<RootStore>;
|
|
3220
3277
|
declare const createStore: (invalidate: (state?: RootState, frames?: number, stackFrames?: boolean) => void, advance: (timestamp: number, runGlobalEffects?: boolean, state?: RootState, frame?: XRFrame) => void) => RootStore;
|
|
3221
3278
|
|
|
3222
|
-
/**
|
|
3223
|
-
* Safely flush async effects when testing, simulating a legacy root.
|
|
3224
|
-
* @deprecated Import from React instead. import { act } from 'react'
|
|
3225
|
-
*/
|
|
3226
|
-
declare const act: typeof React$1.act;
|
|
3227
3279
|
/**
|
|
3228
3280
|
* An SSR-friendly useLayoutEffect.
|
|
3229
3281
|
*
|
|
@@ -3707,5 +3759,5 @@ declare function isOnce(value: unknown): value is {
|
|
|
3707
3759
|
*/
|
|
3708
3760
|
declare function Canvas(props: CanvasProps): react_jsx_runtime.JSX.Element;
|
|
3709
3761
|
|
|
3710
|
-
export { Block, Canvas, Environment, EnvironmentCube, EnvironmentMap, EnvironmentPortal, ErrorBoundary, FROM_REF, IsObject, ONCE, Portal, R3F_BUILD_LEGACY, R3F_BUILD_WEBGPU, REACT_INTERNAL_PROPS, RESERVED_PROPS, three_d as ReactThreeFiber, Texture, _roots,
|
|
3762
|
+
export { Block, Canvas, Environment, EnvironmentCube, EnvironmentMap, EnvironmentPortal, ErrorBoundary, FROM_REF, IsObject, ONCE, Portal, R3F_BUILD_LEGACY, R3F_BUILD_WEBGPU, REACT_INTERNAL_PROPS, RESERVED_PROPS, three_d as ReactThreeFiber, Texture, _roots, addAfterEffect, addEffect, addTail, advance, applyProps, attach, buildGraph, calculateDpr, context, createEvents, createPointerEvents, createPortal, createRoot, createStore, detach, diffProps, dispose, createPointerEvents as events, extend, findInitialRoot, flushSync, fromRef, getInstanceProps, getPrimary, getPrimaryIds, getRootState, getUuidPrefix, hasConstructor, hasPrimary, invalidate, invalidateInstance, is, isColorRepresentation, isCopyable, isFromRef, isObject3D, isOnce, isOrthographicCamera, isRef, isRenderer, isTexture, isVectorLike, once, prepare, presetsObj, reconciler, registerPrimary, removeInteractivity, resolve, swapInteractivity, unmountComponentAtNode, unregisterPrimary, updateCamera, updateFrustum, useBridge, useEnvironment, useFrame, useGraph, useInstanceHandle, useIsomorphicLayoutEffect, useLoader, useMutableCallback, useRenderTarget, useStore, useTexture, useTextures, useThree, waitForPrimary };
|
|
3711
3763
|
export type { Act, Args, ArgsProp, AttachFnType, AttachType, BackgroundConfig, BackgroundProp, BaseRendererProps, Bridge, BufferLike, BufferRecord, BufferStore, Camera, CameraProps, CanvasProps, CanvasSchedulerConfig, Catalogue, Color, ColorManagementConfig, ComputeFunction, ConstructorRepresentation, DefaultGLProps, DefaultRendererProps, Disposable, DisposeOptions, DomEvent, Dpr, ElementProps, EnvironmentLoaderProps, EnvironmentProps, EquConfig, Euler, EventHandlers, EventManager, EventProps, Events, Extensions, FiberRoot, FilterFunction, FrameCallback, FrameNextCallback, FrameNextState, FrameState, Frameloop, GLProps, GLTFLike, GeometryProps, GeometryTransformProps, GlobalEffectType, GlobalRenderCallback, HostConfig, InferLoadResult, InjectState, InputLike, Instance, InstanceProps, LegacyInternalState as InternalState, Intersection, IntersectionEvent, IsAllOptional, IsOptional, Layers, LegacyInternalState, LegacyRenderer, LegacyRootState, LoaderInstance, LoaderLike, LoaderResult, MappedTextureType, MathProps, MathRepresentation, MathType, MathTypes, Matrix3, Matrix4, Mutable, MutableOrReadonlyParameters, NodeProps, NonFunctionKeys, ObjectMap, OffscreenCanvas$1 as OffscreenCanvas, Overwrite, Performance, PointerCaptureTarget, PointerState, PresetsType, PrimaryCanvasEntry, Properties, Quaternion, LegacyRenderer as R3FRenderer, RaycastableRepresentation, ReactProps, ReconcilerRoot, RenderCallback, RenderProps, RenderTargetOptions, Renderer, RendererConfigExtended, RendererFactory, RendererProps, Root, LegacyRootState as RootState, RootStore, SetBlock, Size, StorageLike, StorageRecord, StorageStore, Subscription, TSLNodeInput, TextureInput, TextureResult, ThreeCamera, ThreeElement, ThreeElements, ThreeElementsImpl, ThreeEvent, ThreeExports, ThreeToJSXElements, UnblockProps, UseTextureOptions, UseTexturesReturn, Vector2, Vector3, Vector4, VectorRepresentation, Viewport, VisibilityEntry, WebGLDefaultProps, WebGLProps, WebGLShadowConfig, XRManager, XRPointerConfig };
|