@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,13 +1,13 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Options as ResizeOptions } from 'react-use-measure';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { RootState } from '../core/store';
|
|
6
|
-
import { EventManager } from '../core/events';
|
|
7
|
-
export interface Props extends Omit<RenderProps<HTMLCanvasElement>, 'size' | 'events'>, React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
fallback?: React.ReactNode;
|
|
10
|
-
resize?: ResizeOptions;
|
|
11
|
-
events?: (store: UseStore<RootState>) => EventManager<any>;
|
|
12
|
-
}
|
|
13
|
-
export declare const Canvas: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLCanvasElement>>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Options as ResizeOptions } from 'react-use-measure';
|
|
3
|
+
import { UseStore } from 'zustand';
|
|
4
|
+
import { RenderProps } from './index';
|
|
5
|
+
import { RootState } from '../core/store';
|
|
6
|
+
import { EventManager } from '../core/events';
|
|
7
|
+
export interface Props extends Omit<RenderProps<HTMLCanvasElement>, 'size' | 'events'>, React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
fallback?: React.ReactNode;
|
|
10
|
+
resize?: ResizeOptions;
|
|
11
|
+
events?: (store: UseStore<RootState>) => EventManager<any>;
|
|
12
|
+
}
|
|
13
|
+
export declare const Canvas: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLCanvasElement>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { UseStore } from 'zustand';
|
|
2
|
-
import { RootState } from '../core/store';
|
|
3
|
-
import
|
|
4
|
-
export declare function
|
|
1
|
+
import { UseStore } from 'zustand';
|
|
2
|
+
import { RootState } from '../core/store';
|
|
3
|
+
import { EventManager } from '../core/events';
|
|
4
|
+
export declare function getEventPriority(): any;
|
|
5
|
+
export declare function createPointerEvents(store: UseStore<RootState>): EventManager<HTMLElement>;
|
|
@@ -1,30 +1,34 @@
|
|
|
1
|
-
/// <reference types="react-reconciler" />
|
|
2
|
-
import * as THREE from 'three';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { UseStore } from 'zustand';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
declare const
|
|
13
|
-
declare const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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 { createPointerEvents as events } from './events';
|
|
10
|
+
import { Canvas } from './Canvas';
|
|
11
|
+
import { EventManager } from '../core/events';
|
|
12
|
+
declare const roots: Map<Element, Root>;
|
|
13
|
+
declare const invalidate: (state?: RootState | undefined) => void, advance: (timestamp: number, runGlobalEffects?: boolean, state?: RootState | undefined) => void;
|
|
14
|
+
declare const reconciler: import("react-reconciler").Reconciler<unknown, unknown, unknown, unknown, unknown>, applyProps: typeof import("../core/utils").applyProps;
|
|
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) => Renderer) | Partial<Properties<THREE.WebGLRenderer> | THREE.WebGLRendererParameters> | undefined;
|
|
19
|
+
export declare type RenderProps<TCanvas extends Element> = Omit<StoreProps, 'gl' | 'events' | 'size'> & {
|
|
20
|
+
gl?: GLProps;
|
|
21
|
+
events?: (store: UseStore<RootState>) => EventManager<TCanvas>;
|
|
22
|
+
size?: Size;
|
|
23
|
+
onCreated?: (state: RootState) => void;
|
|
24
|
+
};
|
|
25
|
+
declare function createRoot<TCanvas extends Element>(canvas: TCanvas, config?: RenderProps<TCanvas>): {
|
|
26
|
+
render: (element: React.ReactNode) => UseStore<RootState>;
|
|
27
|
+
unmount: () => void;
|
|
28
|
+
};
|
|
29
|
+
declare function render<TCanvas extends Element>(element: React.ReactNode, canvas: TCanvas, { gl, size, events, onCreated, ...props }?: RenderProps<TCanvas>): UseStore<RootState>;
|
|
30
|
+
declare function unmountComponentAtNode<TElement extends Element>(canvas: TElement, callback?: (canvas: TElement) => void): void;
|
|
31
|
+
declare const act: (callback: () => import("react-reconciler").Thenable<unknown>) => import("react-reconciler").Thenable<void>;
|
|
32
|
+
declare function createPortal(children: React.ReactNode, container: THREE.Object3D): React.ReactNode;
|
|
33
|
+
export * from '../core/hooks';
|
|
34
|
+
export { context, render, createRoot, unmountComponentAtNode, createPortal, events, reconciler, applyProps, dispose, invalidate, advance, extend, addEffect, addAfterEffect, addTail, Canvas, act, roots as _roots, };
|