@react-three/fiber 8.0.0-alpha.0 → 8.0.0-beta-01
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 +67 -0
- package/dist/declarations/src/core/events.d.ts +63 -59
- package/dist/declarations/src/core/hooks.d.ts +21 -29
- package/dist/declarations/src/core/loop.d.ts +12 -12
- package/dist/declarations/src/core/renderer.d.ts +50 -52
- package/dist/declarations/src/core/store.d.ts +111 -106
- package/dist/declarations/src/core/utils.d.ts +43 -0
- package/dist/declarations/src/index.d.ts +7 -7
- package/dist/declarations/src/native/Canvas.d.ts +16 -0
- package/dist/declarations/src/native/events.d.ts +6 -0
- package/dist/declarations/src/native/hooks.d.ts +9 -0
- package/dist/declarations/src/native/index.d.ts +37 -0
- package/dist/declarations/src/native.d.ts +7 -0
- package/dist/declarations/src/three-types.d.ts +320 -320
- package/dist/declarations/src/web/Canvas.d.ts +13 -13
- package/dist/declarations/src/web/events.d.ts +5 -4
- package/dist/declarations/src/web/index.d.ts +34 -30
- package/dist/hooks-c89a6f88.esm.js +1455 -0
- package/dist/hooks-dd693347.cjs.dev.js +1501 -0
- package/dist/hooks-e01f12ec.cjs.prod.js +1501 -0
- package/dist/react-three-fiber.cjs.dev.js +142 -1551
- package/dist/react-three-fiber.cjs.prod.js +142 -1551
- package/dist/react-three-fiber.esm.js +123 -1529
- package/native/dist/react-three-fiber-native.cjs.d.ts +1 -0
- package/native/dist/react-three-fiber-native.cjs.dev.js +590 -0
- package/native/dist/react-three-fiber-native.cjs.js +7 -0
- package/native/dist/react-three-fiber-native.cjs.prod.js +590 -0
- package/native/dist/react-three-fiber-native.esm.js +538 -0
- package/native/package.json +5 -0
- package/package.json +16 -6
- package/__mocks__/react-use-measure/index.ts +0 -22
- package/dist/declarations/src/core/is.d.ts +0 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from './three-types';
|
|
2
|
-
import * as ReactThreeFiber from './three-types';
|
|
3
|
-
export { ReactThreeFiber };
|
|
4
|
-
export type { Intersection, Subscription, Dpr, Size, Viewport, Camera, RenderCallback, Performance, RootState, } from './core/store';
|
|
5
|
-
export type { ThreeEvent, Events, EventManager } from './core/events';
|
|
6
|
-
export type { Props } from './web/Canvas';
|
|
7
|
-
export * from './web';
|
|
1
|
+
export * from './three-types';
|
|
2
|
+
import * as ReactThreeFiber from './three-types';
|
|
3
|
+
export { ReactThreeFiber };
|
|
4
|
+
export type { Intersection, Subscription, Dpr, Size, Viewport, Camera, RenderCallback, Performance, RootState, } from './core/store';
|
|
5
|
+
export type { ThreeEvent, Events, EventManager } from './core/events';
|
|
6
|
+
export type { Props } from './web/Canvas';
|
|
7
|
+
export * from './web';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { View, ViewProps, ViewStyle } from 'react-native';
|
|
3
|
+
import { ExpoWebGLRenderingContext } from 'expo-gl';
|
|
4
|
+
import { UseStore } from 'zustand';
|
|
5
|
+
import { RenderProps } from './index';
|
|
6
|
+
import { RootState } from '../core/store';
|
|
7
|
+
import { EventManager } from '../core/events';
|
|
8
|
+
export interface Props extends Omit<RenderProps<View>, 'size' | 'events'>, ViewProps {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
fallback?: React.ReactNode;
|
|
11
|
+
style?: ViewStyle;
|
|
12
|
+
events?: (store: UseStore<RootState>) => EventManager<any>;
|
|
13
|
+
nativeRef_EXPERIMENTAL?: React.MutableRefObject<any>;
|
|
14
|
+
onContextCreate?: (gl: ExpoWebGLRenderingContext) => Promise<any> | void;
|
|
15
|
+
}
|
|
16
|
+
export declare const Canvas: React.ForwardRefExoticComponent<Props & React.RefAttributes<View>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UseStore } from 'zustand';
|
|
2
|
+
import { RootState } from '../core/store';
|
|
3
|
+
import { EventManager } from '../core/events';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
export declare function getEventPriority(): any;
|
|
6
|
+
export declare function createTouchEvents(store: UseStore<RootState>): EventManager<View>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
|
|
2
|
+
import { ObjectMap } from '../core/utils';
|
|
3
|
+
import { Extensions, LoaderResult, BranchingReturn, useStore, useThree, useFrame, useGraph } from '../core/hooks';
|
|
4
|
+
declare function useLoader<T, U extends string | string[]>(Proto: new () => LoaderResult<T>, input: U, extensions?: Extensions, onProgress?: (event: ProgressEvent<EventTarget>) => void): U extends any[] ? BranchingReturn<T, GLTF, GLTF & ObjectMap>[] : BranchingReturn<T, GLTF, GLTF & ObjectMap>;
|
|
5
|
+
declare namespace useLoader {
|
|
6
|
+
var preload: <T, U extends string | string[]>(Proto: new () => LoaderResult<T>, input: U, extensions?: Extensions | undefined) => undefined;
|
|
7
|
+
var clear: <T, U extends string | string[]>(Proto: new () => LoaderResult<T>, input: U) => void;
|
|
8
|
+
}
|
|
9
|
+
export { useStore, useThree, useFrame, useGraph, useLoader };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference types="react-reconciler" />
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { UseStore } from 'zustand';
|
|
5
|
+
import { dispose } from '../core/utils';
|
|
6
|
+
import { Renderer, StoreProps, context, RootState, Size } from '../core/store';
|
|
7
|
+
import { extend, Root } from '../core/renderer';
|
|
8
|
+
import { addEffect, addAfterEffect, addTail } from '../core/loop';
|
|
9
|
+
import { createTouchEvents as events } from './events';
|
|
10
|
+
import { Canvas } from './Canvas';
|
|
11
|
+
import { EventManager } from '../core/events';
|
|
12
|
+
import { View } from 'react-native';
|
|
13
|
+
import { ExpoWebGLRenderingContext } from 'expo-gl';
|
|
14
|
+
export declare type GLContext = ExpoWebGLRenderingContext | WebGLRenderingContext;
|
|
15
|
+
declare type Properties<T> = Pick<T, {
|
|
16
|
+
[K in keyof T]: T[K] extends (_: any) => any ? never : K;
|
|
17
|
+
}[keyof T]>;
|
|
18
|
+
declare type GLProps = Renderer | ((canvas: HTMLCanvasElement, context: GLContext) => Renderer) | Partial<Properties<THREE.WebGLRenderer> | THREE.WebGLRendererParameters> | undefined;
|
|
19
|
+
declare const roots: Map<GLContext, Root>;
|
|
20
|
+
declare const invalidate: (state?: RootState | undefined) => void, advance: (timestamp: number, runGlobalEffects?: boolean, state?: RootState | undefined) => void;
|
|
21
|
+
declare const reconciler: import("react-reconciler").Reconciler<unknown, unknown, unknown, unknown, unknown>, applyProps: typeof import("../core/utils").applyProps;
|
|
22
|
+
export declare type RenderProps<TView extends View> = Omit<StoreProps, 'gl' | 'events' | 'size' | 'dpr'> & {
|
|
23
|
+
gl?: GLProps;
|
|
24
|
+
events?: (store: UseStore<RootState>) => EventManager<TView>;
|
|
25
|
+
size?: Size;
|
|
26
|
+
onCreated?: (state: RootState) => void;
|
|
27
|
+
};
|
|
28
|
+
declare function createRoot<TView extends View>(context: GLContext, config?: RenderProps<TView>): {
|
|
29
|
+
render: (element: React.ReactNode) => UseStore<RootState>;
|
|
30
|
+
unmount: () => void;
|
|
31
|
+
};
|
|
32
|
+
declare function render<TView extends View>(element: React.ReactNode, context: GLContext, { gl, size, events, onCreated, ...props }?: RenderProps<TView>): UseStore<RootState>;
|
|
33
|
+
declare function unmountComponentAtNode(context: GLContext, callback?: (context: GLContext) => void): void;
|
|
34
|
+
declare const act: (callback: () => import("react-reconciler").Thenable<unknown>) => import("react-reconciler").Thenable<void>;
|
|
35
|
+
declare function createPortal(children: React.ReactNode, container: THREE.Object3D): React.ReactNode;
|
|
36
|
+
export * from './hooks';
|
|
37
|
+
export { context, render, createRoot, unmountComponentAtNode, createPortal, events, reconciler, applyProps, dispose, invalidate, advance, extend, addEffect, addAfterEffect, addTail, Canvas, act, roots as _roots, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './three-types';
|
|
2
|
+
import * as ReactThreeFiber from './three-types';
|
|
3
|
+
export { ReactThreeFiber };
|
|
4
|
+
export type { Intersection, Subscription, Dpr, Size, Viewport, Camera, RenderCallback, Performance, RootState, } from './core/store';
|
|
5
|
+
export type { ThreeEvent, Events, EventManager } from './core/events';
|
|
6
|
+
export type { Props } from './native/Canvas';
|
|
7
|
+
export * from './native/index';
|