@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.
Files changed (32) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/dist/declarations/src/core/events.d.ts +63 -59
  3. package/dist/declarations/src/core/hooks.d.ts +21 -29
  4. package/dist/declarations/src/core/loop.d.ts +12 -12
  5. package/dist/declarations/src/core/renderer.d.ts +50 -52
  6. package/dist/declarations/src/core/store.d.ts +111 -106
  7. package/dist/declarations/src/core/utils.d.ts +43 -0
  8. package/dist/declarations/src/index.d.ts +7 -7
  9. package/dist/declarations/src/native/Canvas.d.ts +16 -0
  10. package/dist/declarations/src/native/events.d.ts +6 -0
  11. package/dist/declarations/src/native/hooks.d.ts +9 -0
  12. package/dist/declarations/src/native/index.d.ts +37 -0
  13. package/dist/declarations/src/native.d.ts +7 -0
  14. package/dist/declarations/src/three-types.d.ts +320 -320
  15. package/dist/declarations/src/web/Canvas.d.ts +13 -13
  16. package/dist/declarations/src/web/events.d.ts +5 -4
  17. package/dist/declarations/src/web/index.d.ts +34 -30
  18. package/dist/hooks-c89a6f88.esm.js +1455 -0
  19. package/dist/hooks-dd693347.cjs.dev.js +1501 -0
  20. package/dist/hooks-e01f12ec.cjs.prod.js +1501 -0
  21. package/dist/react-three-fiber.cjs.dev.js +142 -1551
  22. package/dist/react-three-fiber.cjs.prod.js +142 -1551
  23. package/dist/react-three-fiber.esm.js +123 -1529
  24. package/native/dist/react-three-fiber-native.cjs.d.ts +1 -0
  25. package/native/dist/react-three-fiber-native.cjs.dev.js +590 -0
  26. package/native/dist/react-three-fiber-native.cjs.js +7 -0
  27. package/native/dist/react-three-fiber-native.cjs.prod.js +590 -0
  28. package/native/dist/react-three-fiber-native.esm.js +538 -0
  29. package/native/package.json +5 -0
  30. package/package.json +16 -6
  31. package/__mocks__/react-use-measure/index.ts +0 -22
  32. 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 { RenderProps } from './index';
4
- import { UseStore } from 'zustand';
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 type { EventManager } from '../core/events';
4
- export declare function createPointerEvents(store: UseStore<RootState>): EventManager<HTMLElement>;
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 { StoreProps, context, RootState, Size } from '../core/store';
6
- import { extend, Root } from '../core/renderer';
7
- import { addEffect, addAfterEffect, addTail } from '../core/loop';
8
- import { createPointerEvents as events } from './events';
9
- import { Canvas } from './Canvas';
10
- import { EventManager } from '../core/events';
11
- declare const roots: Map<Element, Root>;
12
- declare const invalidate: (state?: RootState | undefined) => void, advance: (timestamp: number, runGlobalEffects?: boolean, state?: RootState | undefined) => void;
13
- declare const reconciler: import("react-reconciler").Reconciler<unknown, unknown, unknown, unknown, unknown>, applyProps: (instance: import("../core/renderer").Instance, newProps: import("../core/renderer").InstanceProps, oldProps?: import("../core/renderer").InstanceProps, accumulative?: boolean) => void;
14
- export declare type RenderProps<TCanvas extends Element> = Omit<StoreProps, 'gl' | 'events' | 'size'> & {
15
- gl?: THREE.WebGLRenderer | THREE.WebGLRendererParameters;
16
- events?: (store: UseStore<RootState>) => EventManager<TCanvas>;
17
- size?: Size;
18
- onCreated?: (state: RootState) => void;
19
- };
20
- declare function render<TCanvas extends Element>(element: React.ReactNode, canvas: TCanvas, { gl, size, events, onCreated, ...props }?: RenderProps<TCanvas>): UseStore<RootState>;
21
- declare function unmountComponentAtNode<TElement extends Element>(canvas: TElement, callback?: (canvas: TElement) => void): void;
22
- declare function dispose<TObj extends {
23
- dispose?: () => void;
24
- type?: string;
25
- [key: string]: any;
26
- }>(obj: TObj): void;
27
- declare const act: (callback: () => import("react-reconciler").Thenable<unknown>) => import("react-reconciler").Thenable<void>;
28
- declare function createPortal(children: React.ReactNode, container: THREE.Object3D, implementation?: any, key?: any): React.ReactNode;
29
- export * from '../core/hooks';
30
- export { context, render, unmountComponentAtNode, createPortal, events, reconciler, applyProps, dispose, invalidate, advance, extend, addEffect, addAfterEffect, addTail, Canvas, act, roots as _roots, };
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, };