@react-three/test-renderer 8.2.0 → 8.2.1
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 +6 -0
- package/dist/declarations/src/WebGL2RenderingContext.d.ts +16 -16
- package/dist/declarations/src/createTestCanvas.d.ts +2 -2
- package/dist/declarations/src/createTestInstance.d.ts +20 -20
- package/dist/declarations/src/fireEvent.d.ts +4 -4
- package/dist/declarations/src/helpers/graph.d.ts +3 -3
- package/dist/declarations/src/helpers/is.d.ts +9 -9
- package/dist/declarations/src/helpers/strings.d.ts +2 -2
- package/dist/declarations/src/helpers/testInstance.d.ts +5 -5
- package/dist/declarations/src/helpers/tree.d.ts +3 -3
- package/dist/declarations/src/helpers/waitFor.d.ts +5 -5
- package/dist/declarations/src/index.d.ts +14 -14
- package/dist/declarations/src/types/index.d.ts +1 -1
- package/dist/declarations/src/types/internal.d.ts +37 -31
- package/dist/declarations/src/types/public.d.ts +38 -38
- package/dist/react-three-test-renderer.cjs.dev.js +9 -0
- package/dist/react-three-test-renderer.cjs.prod.js +9 -0
- package/dist/react-three-test-renderer.esm.js +9 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export declare class WebGL2RenderingContext {
|
|
2
|
-
[key: string]: any;
|
|
3
|
-
constructor(canvas: HTMLCanvasElement);
|
|
4
|
-
getShaderPrecisionFormat: () => {
|
|
5
|
-
rangeMin: number;
|
|
6
|
-
rangeMax: number;
|
|
7
|
-
precision: number;
|
|
8
|
-
};
|
|
9
|
-
private GL_VERSION;
|
|
10
|
-
private SCISSOR_BOX;
|
|
11
|
-
private VIEWPORT;
|
|
12
|
-
getParameter(paramId: number): string[] | number[] | undefined;
|
|
13
|
-
getExtension(ext: string): any;
|
|
14
|
-
getProgramInfoLog: () => string;
|
|
15
|
-
getShaderInfoLog: () => string;
|
|
16
|
-
}
|
|
1
|
+
export declare class WebGL2RenderingContext {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
constructor(canvas: HTMLCanvasElement);
|
|
4
|
+
getShaderPrecisionFormat: () => {
|
|
5
|
+
rangeMin: number;
|
|
6
|
+
rangeMax: number;
|
|
7
|
+
precision: number;
|
|
8
|
+
};
|
|
9
|
+
private GL_VERSION;
|
|
10
|
+
private SCISSOR_BOX;
|
|
11
|
+
private VIEWPORT;
|
|
12
|
+
getParameter(paramId: number): string[] | number[] | undefined;
|
|
13
|
+
getExtension(ext: string): any;
|
|
14
|
+
getProgramInfoLog: () => string;
|
|
15
|
+
getShaderInfoLog: () => string;
|
|
16
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CreateCanvasParameters } from './types/internal';
|
|
2
|
-
export declare const createCanvas: ({ beforeReturn, width, height }?: CreateCanvasParameters) => HTMLCanvasElement;
|
|
1
|
+
import type { CreateCanvasParameters } from './types/internal';
|
|
2
|
+
export declare const createCanvas: ({ beforeReturn, width, height }?: CreateCanvasParameters) => HTMLCanvasElement;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { Object3D } from 'three';
|
|
2
|
-
import type { MockInstance, MockScene, Obj } from './types/internal';
|
|
3
|
-
export declare class ReactThreeTestInstance<TInstance extends Object3D = Object3D> {
|
|
4
|
-
_fiber: MockInstance;
|
|
5
|
-
constructor(fiber: MockInstance | MockScene);
|
|
6
|
-
get instance(): Object3D;
|
|
7
|
-
get type(): string;
|
|
8
|
-
get props(): Obj;
|
|
9
|
-
get parent(): ReactThreeTestInstance | null;
|
|
10
|
-
get children(): ReactThreeTestInstance[];
|
|
11
|
-
get allChildren(): ReactThreeTestInstance[];
|
|
12
|
-
private getChildren;
|
|
13
|
-
find: (decider: (node: ReactThreeTestInstance) => boolean) => ReactThreeTestInstance;
|
|
14
|
-
findAll: (decider: (node: ReactThreeTestInstance) => boolean) => ReactThreeTestInstance[];
|
|
15
|
-
findByType: (type: string) => ReactThreeTestInstance;
|
|
16
|
-
findAllByType: (type: string) => ReactThreeTestInstance[];
|
|
17
|
-
findByProps: (props: Obj) => ReactThreeTestInstance;
|
|
18
|
-
findAllByProps: (props: Obj) => ReactThreeTestInstance[];
|
|
19
|
-
}
|
|
20
|
-
export declare const wrapFiber: (fiber: MockInstance | MockScene) => ReactThreeTestInstance;
|
|
1
|
+
import { Object3D } from 'three';
|
|
2
|
+
import type { MockInstance, MockScene, Obj } from './types/internal';
|
|
3
|
+
export declare class ReactThreeTestInstance<TInstance extends Object3D = Object3D> {
|
|
4
|
+
_fiber: MockInstance;
|
|
5
|
+
constructor(fiber: MockInstance | MockScene);
|
|
6
|
+
get instance(): Object3D;
|
|
7
|
+
get type(): string;
|
|
8
|
+
get props(): Obj;
|
|
9
|
+
get parent(): ReactThreeTestInstance | null;
|
|
10
|
+
get children(): ReactThreeTestInstance[];
|
|
11
|
+
get allChildren(): ReactThreeTestInstance[];
|
|
12
|
+
private getChildren;
|
|
13
|
+
find: (decider: (node: ReactThreeTestInstance) => boolean) => ReactThreeTestInstance;
|
|
14
|
+
findAll: (decider: (node: ReactThreeTestInstance) => boolean) => ReactThreeTestInstance[];
|
|
15
|
+
findByType: (type: string) => ReactThreeTestInstance;
|
|
16
|
+
findAllByType: (type: string) => ReactThreeTestInstance[];
|
|
17
|
+
findByProps: (props: Obj) => ReactThreeTestInstance;
|
|
18
|
+
findAllByProps: (props: Obj) => ReactThreeTestInstance[];
|
|
19
|
+
}
|
|
20
|
+
export declare const wrapFiber: (fiber: MockInstance | MockScene) => ReactThreeTestInstance;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ReactReconciler from 'react-reconciler';
|
|
2
|
-
import { ReactThreeTestInstance } from './createTestInstance';
|
|
3
|
-
import type { MockUseStoreState, MockEventData } from './types/internal';
|
|
4
|
-
export declare const createEventFirer: (act: ReactReconciler.Reconciler<unknown, unknown, unknown, unknown, unknown>['act'], store: MockUseStoreState) => (element: ReactThreeTestInstance, eventName: string, data?: MockEventData) => Promise<any>;
|
|
1
|
+
import ReactReconciler from 'react-reconciler';
|
|
2
|
+
import { ReactThreeTestInstance } from './createTestInstance';
|
|
3
|
+
import type { MockUseStoreState, MockEventData } from './types/internal';
|
|
4
|
+
export declare const createEventFirer: (act: ReactReconciler.Reconciler<unknown, unknown, unknown, unknown, unknown>['act'], store: MockUseStoreState) => (element: ReactThreeTestInstance, eventName: string, data?: MockEventData) => Promise<any>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { MockScene, MockSceneChild } from '../types/internal';
|
|
2
|
-
import type { SceneGraphItem } from '../types/public';
|
|
3
|
-
export declare const toGraph: (object: MockScene | MockSceneChild) => SceneGraphItem[];
|
|
1
|
+
import type { MockScene, MockSceneChild } from '../types/internal';
|
|
2
|
+
import type { SceneGraphItem } from '../types/public';
|
|
3
|
+
export declare const toGraph: (object: MockScene | MockSceneChild) => SceneGraphItem[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare const is: {
|
|
2
|
-
obj: (a: any) => boolean;
|
|
3
|
-
fun: (a: any) => boolean;
|
|
4
|
-
str: (a: any) => boolean;
|
|
5
|
-
num: (a: any) => boolean;
|
|
6
|
-
und: (a: any) => boolean;
|
|
7
|
-
arr: (a: any) => boolean;
|
|
8
|
-
equ(a: any, b: any): boolean;
|
|
9
|
-
};
|
|
1
|
+
export declare const is: {
|
|
2
|
+
obj: (a: any) => boolean;
|
|
3
|
+
fun: (a: any) => boolean;
|
|
4
|
+
str: (a: any) => boolean;
|
|
5
|
+
num: (a: any) => boolean;
|
|
6
|
+
und: (a: any) => boolean;
|
|
7
|
+
arr: (a: any) => boolean;
|
|
8
|
+
equ(a: any, b: any): boolean;
|
|
9
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const lowerCaseFirstLetter: (str: string) => string;
|
|
2
|
-
export declare const toEventHandlerName: (eventName: string) => string;
|
|
1
|
+
export declare const lowerCaseFirstLetter: (str: string) => string;
|
|
2
|
+
export declare const toEventHandlerName: (eventName: string) => string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactThreeTestInstance } from '../createTestInstance';
|
|
2
|
-
import type { Obj } from '../types/internal';
|
|
3
|
-
export declare const expectOne: <TItem>(items: TItem[], msg: string) => TItem;
|
|
4
|
-
export declare const matchProps: (props: Obj, filter: Obj) => boolean;
|
|
5
|
-
export declare const findAll: (root: ReactThreeTestInstance, decider: (node: ReactThreeTestInstance) => boolean) => ReactThreeTestInstance<import("three").Object3D<import("three").Event>>[];
|
|
1
|
+
import { ReactThreeTestInstance } from '../createTestInstance';
|
|
2
|
+
import type { Obj } from '../types/internal';
|
|
3
|
+
export declare const expectOne: <TItem>(items: TItem[], msg: string) => TItem;
|
|
4
|
+
export declare const matchProps: (props: Obj, filter: Obj) => boolean;
|
|
5
|
+
export declare const findAll: (root: ReactThreeTestInstance, decider: (node: ReactThreeTestInstance) => boolean) => ReactThreeTestInstance<import("three").Object3D<import("three").Event>>[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { Tree } from '../types/public';
|
|
2
|
-
import type { MockScene } from '../types/internal';
|
|
3
|
-
export declare const toTree: (root: MockScene) => Tree;
|
|
1
|
+
import type { Tree } from '../types/public';
|
|
2
|
+
import type { MockScene } from '../types/internal';
|
|
3
|
+
export declare const toTree: (root: MockScene) => Tree;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export interface WaitOptions {
|
|
2
|
-
interval?: number;
|
|
3
|
-
timeout?: number;
|
|
4
|
-
}
|
|
5
|
-
export declare function waitFor(callback: () => boolean | void, { interval, timeout }?: WaitOptions): Promise<void>;
|
|
1
|
+
export interface WaitOptions {
|
|
2
|
+
interval?: number;
|
|
3
|
+
timeout?: number;
|
|
4
|
+
}
|
|
5
|
+
export declare function waitFor(callback: () => boolean | void, { interval, timeout }?: WaitOptions): Promise<void>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { CreateOptions, Renderer, Act } from './types/public';
|
|
3
|
-
import { waitFor, WaitOptions } from './helpers/waitFor';
|
|
4
|
-
declare const act: Act;
|
|
5
|
-
declare const create: (element: React.ReactNode, options?: Partial<CreateOptions> | undefined) => Promise<Renderer>;
|
|
6
|
-
export { create, act, waitFor };
|
|
7
|
-
export type { WaitOptions };
|
|
8
|
-
export * as ReactThreeTest from './types';
|
|
9
|
-
declare const _default: {
|
|
10
|
-
create: (element: React.ReactNode, options?: Partial<CreateOptions> | undefined) => Promise<Renderer>;
|
|
11
|
-
act: Act;
|
|
12
|
-
waitFor: typeof waitFor;
|
|
13
|
-
};
|
|
14
|
-
export default _default;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { CreateOptions, Renderer, Act } from './types/public';
|
|
3
|
+
import { waitFor, WaitOptions } from './helpers/waitFor';
|
|
4
|
+
declare const act: Act;
|
|
5
|
+
declare const create: (element: React.ReactNode, options?: Partial<CreateOptions> | undefined) => Promise<Renderer>;
|
|
6
|
+
export { create, act, waitFor };
|
|
7
|
+
export type { WaitOptions };
|
|
8
|
+
export * as ReactThreeTest from './types';
|
|
9
|
+
declare const _default: {
|
|
10
|
+
create: (element: React.ReactNode, options?: Partial<CreateOptions> | undefined) => Promise<Renderer>;
|
|
11
|
+
act: Act;
|
|
12
|
+
waitFor: typeof waitFor;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public';
|
|
1
|
+
export * from './public';
|
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { UseBoundStore } from 'zustand';
|
|
3
|
-
import type { BaseInstance, LocalState, RootState } from '@react-three/fiber';
|
|
4
|
-
export declare type MockUseStoreState = UseBoundStore<RootState>;
|
|
5
|
-
export interface MockInstance extends Omit<BaseInstance, '__r3f'> {
|
|
6
|
-
__r3f: Omit<LocalState, 'root' | 'objects' | 'parent'> & {
|
|
7
|
-
root: MockUseStoreState;
|
|
8
|
-
objects: MockSceneChild[];
|
|
9
|
-
parent: MockInstance;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export interface MockSceneChild extends Omit<MockInstance, 'children'> {
|
|
13
|
-
children: MockSceneChild[];
|
|
14
|
-
}
|
|
15
|
-
export interface MockScene extends Omit<THREE.Scene, 'children'>, Pick<MockInstance, '__r3f'> {
|
|
16
|
-
children: MockSceneChild[];
|
|
17
|
-
}
|
|
18
|
-
export declare type CreateCanvasParameters = {
|
|
19
|
-
beforeReturn?: (canvas: HTMLCanvasElement) => void;
|
|
20
|
-
width?: number;
|
|
21
|
-
height?: number;
|
|
22
|
-
};
|
|
23
|
-
export interface Obj {
|
|
24
|
-
[key: string]: any;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { UseBoundStore } from 'zustand';
|
|
3
|
+
import type { BaseInstance, LocalState, RootState } from '@react-three/fiber';
|
|
4
|
+
export declare type MockUseStoreState = UseBoundStore<RootState>;
|
|
5
|
+
export interface MockInstance extends Omit<BaseInstance, '__r3f'> {
|
|
6
|
+
__r3f: Omit<LocalState, 'root' | 'objects' | 'parent'> & {
|
|
7
|
+
root: MockUseStoreState;
|
|
8
|
+
objects: MockSceneChild[];
|
|
9
|
+
parent: MockInstance;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface MockSceneChild extends Omit<MockInstance, 'children'> {
|
|
13
|
+
children: MockSceneChild[];
|
|
14
|
+
}
|
|
15
|
+
export interface MockScene extends Omit<THREE.Scene, 'children'>, Pick<MockInstance, '__r3f'> {
|
|
16
|
+
children: MockSceneChild[];
|
|
17
|
+
}
|
|
18
|
+
export declare type CreateCanvasParameters = {
|
|
19
|
+
beforeReturn?: (canvas: HTMLCanvasElement) => void;
|
|
20
|
+
width?: number;
|
|
21
|
+
height?: number;
|
|
22
|
+
};
|
|
23
|
+
export interface Obj {
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* this is an empty object of any,
|
|
28
|
+
* the data is passed to a new event
|
|
29
|
+
* and subsequently passed to the
|
|
30
|
+
* event handler you're calling
|
|
31
|
+
*/
|
|
32
|
+
export declare type MockEventData = {
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
};
|
|
35
|
+
export interface TestInstanceChildOpts {
|
|
36
|
+
exhaustive: boolean;
|
|
37
|
+
}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import type { Camera, RenderProps } from '@react-three/fiber';
|
|
2
|
-
import { ReactThreeTestInstance } from '../createTestInstance';
|
|
3
|
-
import type { MockEventData, CreateCanvasParameters } from './internal';
|
|
4
|
-
export { ReactThreeTestInstance };
|
|
5
|
-
export declare type MockSyntheticEvent = {
|
|
6
|
-
camera: Camera;
|
|
7
|
-
stopPropagation: () => void;
|
|
8
|
-
target: ReactThreeTestInstance;
|
|
9
|
-
currentTarget: ReactThreeTestInstance;
|
|
10
|
-
sourceEvent: MockEventData;
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
};
|
|
13
|
-
export declare type CreateOptions = CreateCanvasParameters & RenderProps<HTMLCanvasElement>;
|
|
14
|
-
export declare type Act = (cb: () => Promise<any>) => Promise<any>;
|
|
15
|
-
export declare type Renderer = {
|
|
16
|
-
scene: ReactThreeTestInstance;
|
|
17
|
-
unmount: () => Promise<void>;
|
|
18
|
-
getInstance: () => null | unknown;
|
|
19
|
-
update: (el: React.ReactNode) => Promise<void>;
|
|
20
|
-
toTree: () => Tree | undefined;
|
|
21
|
-
toGraph: () => SceneGraph | undefined;
|
|
22
|
-
fireEvent: (element: ReactThreeTestInstance, handler: string, data?: MockEventData) => Promise<any>;
|
|
23
|
-
advanceFrames: (frames: number, delta: number | number[]) => Promise<void>;
|
|
24
|
-
};
|
|
25
|
-
export interface SceneGraphItem {
|
|
26
|
-
type: string;
|
|
27
|
-
name: string;
|
|
28
|
-
children: SceneGraphItem[] | null;
|
|
29
|
-
}
|
|
30
|
-
export declare type SceneGraph = SceneGraphItem[];
|
|
31
|
-
export interface TreeNode {
|
|
32
|
-
type: string;
|
|
33
|
-
props: {
|
|
34
|
-
[key: string]: any;
|
|
35
|
-
};
|
|
36
|
-
children: TreeNode[];
|
|
37
|
-
}
|
|
38
|
-
export declare type Tree = TreeNode[];
|
|
1
|
+
import type { Camera, RenderProps } from '@react-three/fiber';
|
|
2
|
+
import { ReactThreeTestInstance } from '../createTestInstance';
|
|
3
|
+
import type { MockEventData, CreateCanvasParameters } from './internal';
|
|
4
|
+
export { ReactThreeTestInstance };
|
|
5
|
+
export declare type MockSyntheticEvent = {
|
|
6
|
+
camera: Camera;
|
|
7
|
+
stopPropagation: () => void;
|
|
8
|
+
target: ReactThreeTestInstance;
|
|
9
|
+
currentTarget: ReactThreeTestInstance;
|
|
10
|
+
sourceEvent: MockEventData;
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
};
|
|
13
|
+
export declare type CreateOptions = CreateCanvasParameters & RenderProps<HTMLCanvasElement>;
|
|
14
|
+
export declare type Act = (cb: () => Promise<any>) => Promise<any>;
|
|
15
|
+
export declare type Renderer = {
|
|
16
|
+
scene: ReactThreeTestInstance;
|
|
17
|
+
unmount: () => Promise<void>;
|
|
18
|
+
getInstance: () => null | unknown;
|
|
19
|
+
update: (el: React.ReactNode) => Promise<void>;
|
|
20
|
+
toTree: () => Tree | undefined;
|
|
21
|
+
toGraph: () => SceneGraph | undefined;
|
|
22
|
+
fireEvent: (element: ReactThreeTestInstance, handler: string, data?: MockEventData) => Promise<any>;
|
|
23
|
+
advanceFrames: (frames: number, delta: number | number[]) => Promise<void>;
|
|
24
|
+
};
|
|
25
|
+
export interface SceneGraphItem {
|
|
26
|
+
type: string;
|
|
27
|
+
name: string;
|
|
28
|
+
children: SceneGraphItem[] | null;
|
|
29
|
+
}
|
|
30
|
+
export declare type SceneGraph = SceneGraphItem[];
|
|
31
|
+
export interface TreeNode {
|
|
32
|
+
type: string;
|
|
33
|
+
props: {
|
|
34
|
+
[key: string]: any;
|
|
35
|
+
};
|
|
36
|
+
children: TreeNode[];
|
|
37
|
+
}
|
|
38
|
+
export declare type Tree = TreeNode[];
|
|
@@ -790,9 +790,18 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
790
790
|
fiber.extend(THREE__namespace);
|
|
791
791
|
const act = fiber.act;
|
|
792
792
|
const create = async (element, options) => {
|
|
793
|
+
var _options$width, _options$height;
|
|
793
794
|
const canvas = createCanvas(options);
|
|
794
795
|
const _root = fiber.createRoot(canvas).configure({
|
|
795
796
|
frameloop: 'never',
|
|
797
|
+
// TODO: remove and use default behavior
|
|
798
|
+
size: {
|
|
799
|
+
width: (_options$width = options == null ? void 0 : options.width) != null ? _options$width : 1280,
|
|
800
|
+
height: (_options$height = options == null ? void 0 : options.height) != null ? _options$height : 800,
|
|
801
|
+
top: 0,
|
|
802
|
+
left: 0,
|
|
803
|
+
updateStyle: typeof HTMLCanvasElement !== 'undefined' && canvas instanceof HTMLCanvasElement
|
|
804
|
+
},
|
|
796
805
|
...options,
|
|
797
806
|
events: undefined
|
|
798
807
|
});
|
|
@@ -790,9 +790,18 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
790
790
|
fiber.extend(THREE__namespace);
|
|
791
791
|
const act = fiber.act;
|
|
792
792
|
const create = async (element, options) => {
|
|
793
|
+
var _options$width, _options$height;
|
|
793
794
|
const canvas = createCanvas(options);
|
|
794
795
|
const _root = fiber.createRoot(canvas).configure({
|
|
795
796
|
frameloop: 'never',
|
|
797
|
+
// TODO: remove and use default behavior
|
|
798
|
+
size: {
|
|
799
|
+
width: (_options$width = options == null ? void 0 : options.width) != null ? _options$width : 1280,
|
|
800
|
+
height: (_options$height = options == null ? void 0 : options.height) != null ? _options$height : 800,
|
|
801
|
+
top: 0,
|
|
802
|
+
left: 0,
|
|
803
|
+
updateStyle: typeof HTMLCanvasElement !== 'undefined' && canvas instanceof HTMLCanvasElement
|
|
804
|
+
},
|
|
796
805
|
...options,
|
|
797
806
|
events: undefined
|
|
798
807
|
});
|
|
@@ -765,9 +765,18 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
765
765
|
extend(THREE);
|
|
766
766
|
const act = act$2;
|
|
767
767
|
const create = async (element, options) => {
|
|
768
|
+
var _options$width, _options$height;
|
|
768
769
|
const canvas = createCanvas(options);
|
|
769
770
|
const _root = createRoot(canvas).configure({
|
|
770
771
|
frameloop: 'never',
|
|
772
|
+
// TODO: remove and use default behavior
|
|
773
|
+
size: {
|
|
774
|
+
width: (_options$width = options == null ? void 0 : options.width) != null ? _options$width : 1280,
|
|
775
|
+
height: (_options$height = options == null ? void 0 : options.height) != null ? _options$height : 800,
|
|
776
|
+
top: 0,
|
|
777
|
+
left: 0,
|
|
778
|
+
updateStyle: typeof HTMLCanvasElement !== 'undefined' && canvas instanceof HTMLCanvasElement
|
|
779
|
+
},
|
|
771
780
|
...options,
|
|
772
781
|
events: undefined
|
|
773
782
|
});
|