@react-three/fiber 9.4.2 → 10.0.0-alpha.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/LICENSE +21 -0
- package/dist/index.cjs +14832 -0
- package/dist/index.d.cts +3350 -0
- package/dist/index.d.mts +3350 -0
- package/dist/index.d.ts +3350 -0
- package/dist/index.mjs +14747 -0
- package/dist/legacy.cjs +14820 -0
- package/dist/legacy.d.cts +3347 -0
- package/dist/legacy.d.mts +3347 -0
- package/dist/legacy.d.ts +3347 -0
- package/dist/legacy.mjs +14735 -0
- package/dist/webgpu/index.cjs +15274 -0
- package/dist/webgpu/index.d.cts +3470 -0
- package/dist/webgpu/index.d.mts +3470 -0
- package/dist/webgpu/index.d.ts +3470 -0
- package/dist/webgpu/index.mjs +15177 -0
- package/package.json +44 -44
- package/react-reconciler/constants.d.ts +7 -0
- package/react-reconciler/constants.js +9 -0
- package/react-reconciler/index.d.ts +1044 -0
- package/react-reconciler/index.js +224 -0
- package/readme.md +98 -33
- package/CHANGELOG.md +0 -1186
- package/dist/declarations/src/core/events.d.ts +0 -92
- package/dist/declarations/src/core/hooks.d.ts +0 -53
- package/dist/declarations/src/core/index.d.ts +0 -13
- package/dist/declarations/src/core/loop.d.ts +0 -31
- package/dist/declarations/src/core/reconciler.d.ts +0 -50
- package/dist/declarations/src/core/renderer.d.ts +0 -89
- package/dist/declarations/src/core/store.d.ts +0 -130
- package/dist/declarations/src/core/utils.d.ts +0 -191
- package/dist/declarations/src/index.d.ts +0 -6
- package/dist/declarations/src/native/Canvas.d.ts +0 -13
- package/dist/declarations/src/native/events.d.ts +0 -4
- package/dist/declarations/src/native.d.ts +0 -6
- package/dist/declarations/src/three-types.d.ts +0 -68
- package/dist/declarations/src/web/Canvas.d.ts +0 -23
- package/dist/declarations/src/web/events.d.ts +0 -4
- package/dist/events-1eccaf1c.esm.js +0 -2510
- package/dist/events-5c8d1731.cjs.prod.js +0 -2569
- package/dist/events-c80effae.cjs.dev.js +0 -2569
- package/dist/react-three-fiber.cjs.d.ts +0 -2
- package/dist/react-three-fiber.cjs.dev.js +0 -222
- package/dist/react-three-fiber.cjs.js +0 -7
- package/dist/react-three-fiber.cjs.prod.js +0 -222
- package/dist/react-three-fiber.esm.js +0 -167
- package/native/dist/react-three-fiber-native.cjs.d.ts +0 -2
- package/native/dist/react-three-fiber-native.cjs.dev.js +0 -569
- package/native/dist/react-three-fiber-native.cjs.js +0 -7
- package/native/dist/react-three-fiber-native.cjs.prod.js +0 -569
- package/native/dist/react-three-fiber-native.esm.js +0 -517
- package/native/package.json +0 -5
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { View, type ViewProps, type ViewStyle } from 'react-native';
|
|
3
|
-
import { RenderProps } from "../core/index.js";
|
|
4
|
-
export interface CanvasProps extends Omit<RenderProps<HTMLCanvasElement>, 'size' | 'dpr'>, Omit<ViewProps, 'children'> {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
style?: ViewStyle;
|
|
7
|
-
ref?: React.Ref<View>;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* A native canvas which accepts threejs elements as children.
|
|
11
|
-
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
12
|
-
*/
|
|
13
|
-
export declare function Canvas(props: CanvasProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type * as THREE from 'three';
|
|
2
|
-
import type { Args, EventHandlers, InstanceProps, ConstructorRepresentation } from "./core/index.js";
|
|
3
|
-
import type { Overwrite, Mutable } from "./core/utils.js";
|
|
4
|
-
type MutableOrReadonlyParameters<T extends (...args: any) => any> = Parameters<T> | Readonly<Parameters<T>>;
|
|
5
|
-
export interface MathRepresentation {
|
|
6
|
-
set(...args: number[]): any;
|
|
7
|
-
}
|
|
8
|
-
export interface VectorRepresentation extends MathRepresentation {
|
|
9
|
-
setScalar(value: number): any;
|
|
10
|
-
}
|
|
11
|
-
export type MathTypes = MathRepresentation | THREE.Euler | THREE.Color;
|
|
12
|
-
export type MathType<T extends MathTypes> = T extends THREE.Color ? Args<typeof THREE.Color> | THREE.ColorRepresentation : T extends VectorRepresentation | THREE.Layers | THREE.Euler ? T | MutableOrReadonlyParameters<T['set']> | number : T | MutableOrReadonlyParameters<T['set']>;
|
|
13
|
-
export type MathProps<P> = {
|
|
14
|
-
[K in keyof P as P[K] extends MathTypes ? K : never]: P[K] extends MathTypes ? MathType<P[K]> : never;
|
|
15
|
-
};
|
|
16
|
-
export type Vector2 = MathType<THREE.Vector2>;
|
|
17
|
-
export type Vector3 = MathType<THREE.Vector3>;
|
|
18
|
-
export type Vector4 = MathType<THREE.Vector4>;
|
|
19
|
-
export type Color = MathType<THREE.Color>;
|
|
20
|
-
export type Layers = MathType<THREE.Layers>;
|
|
21
|
-
export type Quaternion = MathType<THREE.Quaternion>;
|
|
22
|
-
export type Euler = MathType<THREE.Euler>;
|
|
23
|
-
export type Matrix3 = MathType<THREE.Matrix3>;
|
|
24
|
-
export type Matrix4 = MathType<THREE.Matrix4>;
|
|
25
|
-
export interface RaycastableRepresentation {
|
|
26
|
-
raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[]): void;
|
|
27
|
-
}
|
|
28
|
-
export type EventProps<P> = P extends RaycastableRepresentation ? Partial<EventHandlers> : {};
|
|
29
|
-
export interface ReactProps<P> {
|
|
30
|
-
children?: React.ReactNode;
|
|
31
|
-
ref?: React.Ref<P>;
|
|
32
|
-
key?: React.Key;
|
|
33
|
-
}
|
|
34
|
-
export type ElementProps<T extends ConstructorRepresentation, P = InstanceType<T>> = Partial<Overwrite<P, MathProps<P> & ReactProps<P> & EventProps<P>>>;
|
|
35
|
-
export type ThreeElement<T extends ConstructorRepresentation> = Mutable<Overwrite<ElementProps<T>, Omit<InstanceProps<InstanceType<T>, T>, 'object'>>>;
|
|
36
|
-
export type ThreeToJSXElements<T extends Record<string, any>> = {
|
|
37
|
-
[K in keyof T & string as Uncapitalize<K>]: T[K] extends ConstructorRepresentation ? ThreeElement<T[K]> : never;
|
|
38
|
-
};
|
|
39
|
-
type ThreeExports = typeof THREE;
|
|
40
|
-
type ThreeElementsImpl = ThreeToJSXElements<ThreeExports>;
|
|
41
|
-
export interface ThreeElements extends Omit<ThreeElementsImpl, 'audio' | 'source' | 'line' | 'path'> {
|
|
42
|
-
primitive: Omit<ThreeElement<any>, 'args'> & {
|
|
43
|
-
object: object;
|
|
44
|
-
};
|
|
45
|
-
threeAudio: ThreeElementsImpl['audio'];
|
|
46
|
-
threeSource: ThreeElementsImpl['source'];
|
|
47
|
-
threeLine: ThreeElementsImpl['line'];
|
|
48
|
-
threePath: ThreeElementsImpl['path'];
|
|
49
|
-
}
|
|
50
|
-
declare module 'react' {
|
|
51
|
-
namespace JSX {
|
|
52
|
-
interface IntrinsicElements extends ThreeElements {
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
declare module 'react/jsx-runtime' {
|
|
57
|
-
namespace JSX {
|
|
58
|
-
interface IntrinsicElements extends ThreeElements {
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
declare module 'react/jsx-dev-runtime' {
|
|
63
|
-
namespace JSX {
|
|
64
|
-
interface IntrinsicElements extends ThreeElements {
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Options as ResizeOptions } from 'react-use-measure';
|
|
3
|
-
import { RenderProps } from "../core/index.js";
|
|
4
|
-
export interface CanvasProps extends Omit<RenderProps<HTMLCanvasElement>, 'size'>, React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
ref?: React.Ref<HTMLCanvasElement>;
|
|
7
|
-
/** Canvas fallback content, similar to img's alt prop */
|
|
8
|
-
fallback?: React.ReactNode;
|
|
9
|
-
/**
|
|
10
|
-
* Options to pass to useMeasure.
|
|
11
|
-
* @see https://github.com/pmndrs/react-use-measure#api
|
|
12
|
-
*/
|
|
13
|
-
resize?: ResizeOptions;
|
|
14
|
-
/** The target where events are being subscribed to, default: the div that wraps canvas */
|
|
15
|
-
eventSource?: HTMLElement | React.RefObject<HTMLElement>;
|
|
16
|
-
/** The event prefix that is cast into canvas pointer x/y events, default: "offset" */
|
|
17
|
-
eventPrefix?: 'offset' | 'client' | 'page' | 'layer' | 'screen';
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* A DOM canvas which accepts threejs elements as children.
|
|
21
|
-
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
22
|
-
*/
|
|
23
|
-
export declare function Canvas(props: CanvasProps): import("react/jsx-runtime").JSX.Element;
|