@webspatial/react-sdk 1.6.1 → 2.0.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/README.md +270 -0
- package/dist/Model-DO5ps8NA.d.ts +35 -0
- package/dist/Reality-BDyKL6th.d.ts +256 -0
- package/dist/Reality-DO-itiWW.d.ts +33 -0
- package/dist/SceneGraph-DxH74y6-.d.ts +214 -0
- package/dist/chunk-6JSRUX7P.js +2 -0
- package/dist/chunk-6JSRUX7P.js.map +1 -0
- package/dist/chunk-BTLTBCA7.js +2 -0
- package/dist/chunk-BTLTBCA7.js.map +1 -0
- package/dist/chunk-GG2QK5MA.js +2 -0
- package/dist/chunk-GG2QK5MA.js.map +1 -0
- package/dist/chunk-IOLNY4GP.js +2 -0
- package/dist/chunk-IOLNY4GP.js.map +1 -0
- package/dist/chunk-NWVQY6CN.js +2 -0
- package/dist/chunk-NWVQY6CN.js.map +1 -0
- package/dist/chunk-NXEOIP4Z.js +2 -0
- package/dist/chunk-NXEOIP4Z.js.map +1 -0
- package/dist/chunk-PDUEHFTO.js +2 -0
- package/dist/chunk-PDUEHFTO.js.map +1 -0
- package/dist/chunk-QHUROD77.js +2 -0
- package/dist/chunk-QHUROD77.js.map +1 -0
- package/dist/chunk-UHEO47WY.js +2 -0
- package/dist/chunk-UHEO47WY.js.map +1 -0
- package/dist/chunk-WDOPCAA3.js +19 -0
- package/dist/chunk-WDOPCAA3.js.map +1 -0
- package/dist/eager.d.ts +46 -0
- package/dist/eager.js +8 -0
- package/dist/eager.js.map +1 -0
- package/dist/experimental.d.ts +24 -0
- package/dist/experimental.js +8 -0
- package/dist/experimental.js.map +1 -0
- package/dist/index.d.ts +70 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/facades-client.d.ts +50 -0
- package/dist/internal/facades-client.js +3 -0
- package/dist/internal/facades-client.js.map +1 -0
- package/dist/jsx/jsx-dev-runtime.d.ts +7 -79
- package/dist/jsx/jsx-dev-runtime.js +1 -66
- package/dist/jsx/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx/jsx-runtime.d.ts +81 -2
- package/dist/jsx/jsx-runtime.js +1 -66
- package/dist/jsx/jsx-runtime.js.map +1 -1
- package/dist/jsx-shared-CFDVUVpc.d.ts +16 -0
- package/dist/motionBindingTypes-CjxIC5bP.d.ts +25 -0
- package/dist/runtime/registerEagerEntry.d.ts +8 -0
- package/dist/runtime/registerEagerEntry.js +2 -0
- package/dist/runtime/registerEagerEntry.js.map +1 -0
- package/dist/spatial.d.ts +25 -0
- package/dist/spatial.js +7 -0
- package/dist/spatial.js.map +1 -0
- package/dist/useAnimation-C1LXt-xO.d.ts +28 -0
- package/dist/useMetrics-Bm_Urbtp.d.ts +96 -0
- package/package.json +53 -33
- package/dist/default/index.d.ts +0 -408
- package/dist/default/index.js +0 -3852
- package/dist/default/index.js.map +0 -1
- package/dist/jsx/jsx-dev-runtime.web.d.ts +0 -2
- package/dist/jsx/jsx-dev-runtime.web.js +0 -18
- package/dist/jsx/jsx-dev-runtime.web.js.map +0 -1
- package/dist/jsx/jsx-runtime.web.d.ts +0 -1
- package/dist/jsx/jsx-runtime.web.js +0 -18
- package/dist/jsx/jsx-runtime.web.js.map +0 -1
- package/dist/web/index.d.ts +0 -408
- package/dist/web/index.js +0 -3905
- package/dist/web/index.js.map +0 -1
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
(function(){
|
|
3
|
-
if(typeof window === 'undefined') return;
|
|
4
|
-
if(!window.__webspatialsdk__) window.__webspatialsdk__ = {}
|
|
5
|
-
window.__webspatialsdk__['react-sdk-version'] = "1.6.1"
|
|
6
|
-
window.__webspatialsdk__['XR_ENV'] = "web"
|
|
7
|
-
})()
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
// src/jsx/jsx-dev-runtime.web.ts
|
|
11
|
-
import { Fragment } from "react/jsx-runtime";
|
|
12
|
-
import { jsxDEV, jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
13
|
-
export {
|
|
14
|
-
Fragment,
|
|
15
|
-
jsxDEV2 as jsx,
|
|
16
|
-
jsxDEV
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=jsx-dev-runtime.web.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/jsx/jsx-dev-runtime.web.ts"],"sourcesContent":["export { Fragment } from 'react/jsx-runtime'\nexport { jsxDEV, jsxDEV as jsx } from 'react/jsx-dev-runtime'\n"],"mappings":";;;;;;;;;;AAAA,SAAS,gBAAgB;AACzB,SAAS,QAAkB,UAAVA,eAAqB;","names":["jsxDEV"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Fragment, jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
(function(){
|
|
3
|
-
if(typeof window === 'undefined') return;
|
|
4
|
-
if(!window.__webspatialsdk__) window.__webspatialsdk__ = {}
|
|
5
|
-
window.__webspatialsdk__['react-sdk-version'] = "1.6.1"
|
|
6
|
-
window.__webspatialsdk__['XR_ENV'] = "web"
|
|
7
|
-
})()
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
// src/jsx/jsx-runtime.web.ts
|
|
11
|
-
import { Fragment } from "react/jsx-runtime";
|
|
12
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
export {
|
|
14
|
-
Fragment,
|
|
15
|
-
jsx,
|
|
16
|
-
jsxs
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=jsx-runtime.web.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/jsx/jsx-runtime.web.ts"],"sourcesContent":["export { Fragment } from 'react/jsx-runtime'\nexport { jsx, jsxs } from 'react/jsx-runtime'\n"],"mappings":";;;;;;;;;;AAAA,SAAS,gBAAgB;AACzB,SAAS,KAAK,YAAY;","names":[]}
|
package/dist/web/index.d.ts
DELETED
|
@@ -1,408 +0,0 @@
|
|
|
1
|
-
import * as _webspatial_core_sdk from '@webspatial/core-sdk';
|
|
2
|
-
import { SpatialSceneCreationOptions, SpatialSceneType, SpatialTapEvent as SpatialTapEvent$1, SpatialDragStartEvent as SpatialDragStartEvent$1, SpatialDragEvent as SpatialDragEvent$1, SpatialDragEndEvent as SpatialDragEndEvent$1, SpatialRotateEvent as SpatialRotateEvent$1, SpatialRotateEndEvent as SpatialRotateEndEvent$1, SpatialMagnifyEvent as SpatialMagnifyEvent$1, SpatialMagnifyEndEvent as SpatialMagnifyEndEvent$1, SpatializedElement, Vec3, SpatialObject, SpatialSession, SpatializedDynamic3DElement, SpatialEntity, Quaternion, SpatialBoxGeometryOptions, SpatialUnlitMaterialOptions, SpatialSphereGeometryOptions, SpatialConeGeometryOptions, SpatialCylinderGeometryOptions, SpatialPlaneGeometryOptions, PhysicalMetrics } from '@webspatial/core-sdk';
|
|
3
|
-
export { Point3D, Vec3 } from '@webspatial/core-sdk';
|
|
4
|
-
import * as React$1 from 'react';
|
|
5
|
-
import React__default, { ElementType, ForwardedRef, createElement as createElement$1 } from 'react';
|
|
6
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
declare function enableDebugTool(): void;
|
|
9
|
-
|
|
10
|
-
declare function initScene(name: string, callback: (pre: SpatialSceneCreationOptions) => SpatialSceneCreationOptions, options?: {
|
|
11
|
-
type: SpatialSceneType;
|
|
12
|
-
}): void | undefined;
|
|
13
|
-
|
|
14
|
-
declare const SpatialID = "data-spatial-id";
|
|
15
|
-
|
|
16
|
-
/** Options for spatial pointer/gesture behavior (not DOM attributes). */
|
|
17
|
-
type SpatialEventOptions = {
|
|
18
|
-
/**
|
|
19
|
-
* Direction vector for rotate gesture constraint. `[0, 0, 0]` or omit = unconstrained.
|
|
20
|
-
*/
|
|
21
|
-
constrainedToAxis?: Vec3 | readonly [number, number, number];
|
|
22
|
-
};
|
|
23
|
-
type SpatialEventProps<T extends SpatializedElementRef> = {
|
|
24
|
-
onSpatialTap?: (event: SpatialTapEvent<T>) => void;
|
|
25
|
-
onSpatialDragStart?: (event: SpatialDragStartEvent<T>) => void;
|
|
26
|
-
onSpatialDrag?: (event: SpatialDragEvent<T>) => void;
|
|
27
|
-
onSpatialDragEnd?: (event: SpatialDragEndEvent<T>) => void;
|
|
28
|
-
onSpatialRotate?: (event: SpatialRotateEvent<T>) => void;
|
|
29
|
-
onSpatialRotateEnd?: (event: SpatialRotateEndEvent<T>) => void;
|
|
30
|
-
onSpatialMagnify?: (event: SpatialMagnifyEvent<T>) => void;
|
|
31
|
-
onSpatialMagnifyEnd?: (event: SpatialMagnifyEndEvent<T>) => void;
|
|
32
|
-
};
|
|
33
|
-
interface StandardSpatializedContainerProps extends React__default.ComponentPropsWithoutRef<'div'> {
|
|
34
|
-
component: ElementType;
|
|
35
|
-
inStandardSpatializedContainer?: boolean;
|
|
36
|
-
[SpatialID]: string;
|
|
37
|
-
}
|
|
38
|
-
type PortalSpatializedContainerProps<T extends SpatializedElementRef> = SpatialEventProps<T> & React__default.ComponentPropsWithoutRef<'div'> & {
|
|
39
|
-
component: ElementType;
|
|
40
|
-
spatializedContent: ElementType;
|
|
41
|
-
createSpatializedElement: () => Promise<SpatializedElement>;
|
|
42
|
-
getExtraSpatializedElementProperties?: (computedStyle: CSSStyleDeclaration) => Record<string, any>;
|
|
43
|
-
spatialEventOptions?: SpatialEventOptions;
|
|
44
|
-
[SpatialID]: string;
|
|
45
|
-
};
|
|
46
|
-
type SpatializedContainerProps<T extends SpatializedElementRef> = Omit<StandardSpatializedContainerProps & PortalSpatializedContainerProps<T>, typeof SpatialID | 'onLoad' | 'onError'> & {
|
|
47
|
-
extraRefProps?: (domProxy: T) => Record<string, unknown>;
|
|
48
|
-
};
|
|
49
|
-
type Spatialized2DElementContainerProps<P extends ElementType> = SpatialEventProps<SpatializedElementRef> & React__default.ComponentPropsWithRef<'div'> & {
|
|
50
|
-
component: P;
|
|
51
|
-
spatialEventOptions?: SpatialEventOptions;
|
|
52
|
-
};
|
|
53
|
-
type SpatializedStatic3DContainerProps = SpatialEventProps<SpatializedStatic3DElementRef> & Omit<React__default.ComponentPropsWithoutRef<'div'>, 'onLoad' | 'onError'> & {
|
|
54
|
-
src?: string;
|
|
55
|
-
autoPlay?: boolean;
|
|
56
|
-
loop?: boolean;
|
|
57
|
-
children?: React__default.ReactNode;
|
|
58
|
-
onLoad?: (event: ModelLoadEvent) => void;
|
|
59
|
-
onError?: (event: ModelLoadEvent) => void;
|
|
60
|
-
spatialEventOptions?: SpatialEventOptions;
|
|
61
|
-
};
|
|
62
|
-
type SpatializedElementRef<T extends HTMLElement = HTMLElement> = T;
|
|
63
|
-
type SpatializedDivElementRef = SpatializedElementRef<HTMLDivElement>;
|
|
64
|
-
type SpatializedStatic3DElementRef = SpatializedDivElementRef & {
|
|
65
|
-
currentSrc: string;
|
|
66
|
-
ready: Promise<ModelLoadEvent>;
|
|
67
|
-
entityTransform: DOMMatrixReadOnly;
|
|
68
|
-
play(): Promise<void>;
|
|
69
|
-
pause(): Promise<void>;
|
|
70
|
-
readonly paused: boolean;
|
|
71
|
-
readonly duration: number;
|
|
72
|
-
playbackRate: number;
|
|
73
|
-
};
|
|
74
|
-
type CurrentTarget<T extends SpatializedElementRef> = {
|
|
75
|
-
currentTarget: T;
|
|
76
|
-
};
|
|
77
|
-
type SpatialTapEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialTapEvent$1 & CurrentTarget<T> & {
|
|
78
|
-
readonly offsetX: number;
|
|
79
|
-
readonly offsetY: number;
|
|
80
|
-
readonly offsetZ: number;
|
|
81
|
-
readonly clientX: number;
|
|
82
|
-
readonly clientY: number;
|
|
83
|
-
readonly clientZ: number;
|
|
84
|
-
};
|
|
85
|
-
type SpatialDragStartEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialDragStartEvent$1 & CurrentTarget<T> & {
|
|
86
|
-
readonly offsetX: number;
|
|
87
|
-
readonly offsetY: number;
|
|
88
|
-
readonly offsetZ: number;
|
|
89
|
-
readonly clientX: number;
|
|
90
|
-
readonly clientY: number;
|
|
91
|
-
readonly clientZ: number;
|
|
92
|
-
};
|
|
93
|
-
type SpatialDragEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialDragEvent$1 & CurrentTarget<T> & {
|
|
94
|
-
readonly translationX: number;
|
|
95
|
-
readonly translationY: number;
|
|
96
|
-
readonly translationZ: number;
|
|
97
|
-
};
|
|
98
|
-
type SpatialDragEndEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialDragEndEvent$1 & CurrentTarget<T>;
|
|
99
|
-
type SpatialRotateEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialRotateEvent$1 & CurrentTarget<T> & {
|
|
100
|
-
readonly quaternion: _webspatial_core_sdk.Quaternion;
|
|
101
|
-
};
|
|
102
|
-
type SpatialRotateEndEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialRotateEndEvent$1 & CurrentTarget<T>;
|
|
103
|
-
type SpatialMagnifyEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialMagnifyEvent$1 & CurrentTarget<T> & {
|
|
104
|
-
readonly magnification: number;
|
|
105
|
-
};
|
|
106
|
-
type SpatialMagnifyEndEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialMagnifyEndEvent$1 & CurrentTarget<T>;
|
|
107
|
-
type ModelSpatialTapEvent = SpatialTapEvent<SpatializedStatic3DElementRef>;
|
|
108
|
-
type ModelSpatialDragStartEvent = SpatialDragStartEvent<SpatializedStatic3DElementRef>;
|
|
109
|
-
type ModelSpatialDragEvent = SpatialDragEvent<SpatializedStatic3DElementRef>;
|
|
110
|
-
type ModelSpatialDragEndEvent = SpatialDragEndEvent<SpatializedStatic3DElementRef>;
|
|
111
|
-
type ModelSpatialRotateEvent = SpatialRotateEvent<SpatializedStatic3DElementRef>;
|
|
112
|
-
type ModelSpatialRotateEndEvent = SpatialRotateEndEvent<SpatializedStatic3DElementRef>;
|
|
113
|
-
type ModelSpatialMagnifyEvent = SpatialMagnifyEvent<SpatializedStatic3DElementRef>;
|
|
114
|
-
type ModelSpatialMagnifyEndEvent = SpatialMagnifyEndEvent<SpatializedStatic3DElementRef>;
|
|
115
|
-
type ModelLoadEvent = CustomEvent & {
|
|
116
|
-
target: SpatializedStatic3DElementRef;
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
declare const SpatializedContainer: <T extends SpatializedElementRef>(props: SpatializedContainerProps<T> & {
|
|
120
|
-
ref?: ForwardedRef<SpatializedElementRef<T>>;
|
|
121
|
-
}) => React.ReactElement | null;
|
|
122
|
-
|
|
123
|
-
declare const Spatialized2DElementContainer: <P extends ElementType>(props: Spatialized2DElementContainerProps<P> & {
|
|
124
|
-
ref: ForwardedRef<SpatializedElementRef>;
|
|
125
|
-
}) => React__default.ReactElement | null;
|
|
126
|
-
|
|
127
|
-
declare const SpatializedStatic3DElementContainer: React$1.ForwardRefExoticComponent<{
|
|
128
|
-
onSpatialTap?: ((event: SpatialTapEvent<SpatializedStatic3DElementRef>) => void) | undefined;
|
|
129
|
-
onSpatialDragStart?: ((event: SpatialDragStartEvent<SpatializedStatic3DElementRef>) => void) | undefined;
|
|
130
|
-
onSpatialDrag?: ((event: SpatialDragEvent<SpatializedStatic3DElementRef>) => void) | undefined;
|
|
131
|
-
onSpatialDragEnd?: ((event: SpatialDragEndEvent<SpatializedStatic3DElementRef>) => void) | undefined;
|
|
132
|
-
onSpatialRotate?: ((event: SpatialRotateEvent<SpatializedStatic3DElementRef>) => void) | undefined;
|
|
133
|
-
onSpatialRotateEnd?: ((event: SpatialRotateEndEvent<SpatializedStatic3DElementRef>) => void) | undefined;
|
|
134
|
-
onSpatialMagnify?: ((event: SpatialMagnifyEvent<SpatializedStatic3DElementRef>) => void) | undefined;
|
|
135
|
-
onSpatialMagnifyEnd?: ((event: SpatialMagnifyEndEvent<SpatializedStatic3DElementRef>) => void) | undefined;
|
|
136
|
-
} & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "onLoad" | "onError"> & {
|
|
137
|
-
src?: string;
|
|
138
|
-
autoPlay?: boolean;
|
|
139
|
-
loop?: boolean;
|
|
140
|
-
children?: React.ReactNode;
|
|
141
|
-
onLoad?: (event: ModelLoadEvent) => void;
|
|
142
|
-
onError?: (event: ModelLoadEvent) => void;
|
|
143
|
-
spatialEventOptions?: SpatialEventOptions;
|
|
144
|
-
} & React$1.RefAttributes<SpatializedStatic3DElementRef>>;
|
|
145
|
-
|
|
146
|
-
declare function withSpatialized2DElementContainer<P extends ElementType>(Component: P): P | React$1.ForwardRefExoticComponent<Omit<Spatialized2DElementContainerProps<P>, "ref"> & React$1.RefAttributes<HTMLElement>>;
|
|
147
|
-
|
|
148
|
-
declare function initPolyfill(): void;
|
|
149
|
-
|
|
150
|
-
declare function withSpatialMonitor(El: React__default.ElementType): any;
|
|
151
|
-
|
|
152
|
-
type SpatialMonitorProps = {
|
|
153
|
-
El?: ElementType;
|
|
154
|
-
};
|
|
155
|
-
declare const SpatialMonitor: React$1.ForwardRefExoticComponent<SpatialMonitorProps & React$1.RefAttributes<HTMLElement>>;
|
|
156
|
-
|
|
157
|
-
declare class ResourceRegistry {
|
|
158
|
-
private resources;
|
|
159
|
-
add<T extends SpatialObject>(id: string, resource: Promise<T>): void;
|
|
160
|
-
remove(id: string): void;
|
|
161
|
-
removeAndDestroy(id: string): void;
|
|
162
|
-
get<T extends SpatialObject>(id: string): Promise<T>;
|
|
163
|
-
destroy(): void;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
type ContainerEntry = {
|
|
167
|
-
instanceId: string;
|
|
168
|
-
container: HTMLElement;
|
|
169
|
-
};
|
|
170
|
-
type ContainersChangeCallback = (containers: ContainerEntry[]) => void;
|
|
171
|
-
declare class AttachmentRegistry {
|
|
172
|
-
private containers;
|
|
173
|
-
private listeners;
|
|
174
|
-
addContainer(name: string, instanceId: string, container: HTMLElement): void;
|
|
175
|
-
removeContainer(name: string, instanceId: string): void;
|
|
176
|
-
getContainers(name: string): ContainerEntry[];
|
|
177
|
-
onContainersChange(name: string, cb: ContainersChangeCallback): () => void;
|
|
178
|
-
private notifyListeners;
|
|
179
|
-
destroy(): void;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
type RealityContextValue = {
|
|
183
|
-
session: SpatialSession;
|
|
184
|
-
reality: SpatializedDynamic3DElement;
|
|
185
|
-
resourceRegistry: ResourceRegistry;
|
|
186
|
-
attachmentRegistry: AttachmentRegistry;
|
|
187
|
-
} | null;
|
|
188
|
-
|
|
189
|
-
interface EntityRefShape {
|
|
190
|
-
convertFromEntityToEntity: (fromEntityId: string, toEntityId: string, position: Vec3) => Promise<Vec3>;
|
|
191
|
-
convertFromEntityToReality: (entityId: string, position: Vec3) => Promise<Vec3>;
|
|
192
|
-
convertFromRealityToEntity: (entityId: string, position: Vec3) => Promise<Vec3>;
|
|
193
|
-
id: string | undefined;
|
|
194
|
-
name: string | undefined;
|
|
195
|
-
entity: SpatialEntity | null;
|
|
196
|
-
}
|
|
197
|
-
declare class EntityRef implements EntityRefShape {
|
|
198
|
-
private _entity;
|
|
199
|
-
private _ctx;
|
|
200
|
-
constructor(entity?: SpatialEntity | null, ctx?: RealityContextValue | null);
|
|
201
|
-
updateEntity(entity?: SpatialEntity | null): void;
|
|
202
|
-
updateCtx(ctx?: RealityContextValue | null): void;
|
|
203
|
-
destroy(): void;
|
|
204
|
-
get entity(): SpatialEntity | null;
|
|
205
|
-
get id(): string | undefined;
|
|
206
|
-
get name(): string | undefined;
|
|
207
|
-
convertFromEntityToEntity(fromEntityId: string, toEntityId: string, position: Vec3): Promise<Vec3>;
|
|
208
|
-
convertFromEntityToReality(entityId: string, position: Vec3): Promise<Vec3>;
|
|
209
|
-
convertFromRealityToEntity(entityId: string, position: Vec3): Promise<Vec3>;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
type EntityProps = {
|
|
213
|
-
id?: string;
|
|
214
|
-
name?: string;
|
|
215
|
-
position?: Vec3;
|
|
216
|
-
rotation?: Vec3;
|
|
217
|
-
scale?: Vec3;
|
|
218
|
-
enableInput?: boolean;
|
|
219
|
-
};
|
|
220
|
-
type allTarget<T extends EntityRefShape> = {
|
|
221
|
-
target: T;
|
|
222
|
-
currentTarget: T;
|
|
223
|
-
};
|
|
224
|
-
type SpatialTapEntityEvent<T extends EntityRefShape = EntityRefShape> = SpatialTapEvent$1 & allTarget<T> & {
|
|
225
|
-
readonly offsetX: number;
|
|
226
|
-
readonly offsetY: number;
|
|
227
|
-
readonly offsetZ: number;
|
|
228
|
-
readonly clientX: number;
|
|
229
|
-
readonly clientY: number;
|
|
230
|
-
readonly clientZ: number;
|
|
231
|
-
};
|
|
232
|
-
type SpatialDragStartEntityEvent<T extends EntityRefShape = EntityRefShape> = SpatialDragStartEvent$1 & allTarget<T> & {
|
|
233
|
-
readonly offsetX: number;
|
|
234
|
-
readonly offsetY: number;
|
|
235
|
-
readonly offsetZ: number;
|
|
236
|
-
readonly clientX: number;
|
|
237
|
-
readonly clientY: number;
|
|
238
|
-
readonly clientZ: number;
|
|
239
|
-
};
|
|
240
|
-
type SpatialDragEntityEvent<T extends EntityRefShape = EntityRefShape> = SpatialDragEvent$1 & allTarget<T> & {
|
|
241
|
-
readonly translationX: number;
|
|
242
|
-
readonly translationY: number;
|
|
243
|
-
readonly translationZ: number;
|
|
244
|
-
};
|
|
245
|
-
type SpatialDragEndEntityEvent<T extends EntityRefShape = EntityRefShape> = SpatialDragEndEvent$1 & allTarget<T>;
|
|
246
|
-
type SpatialRotateEntityEvent<T extends EntityRefShape = EntityRefShape> = SpatialRotateEvent$1 & allTarget<T> & {
|
|
247
|
-
readonly quaternion: Quaternion;
|
|
248
|
-
};
|
|
249
|
-
type SpatialRotateEndEntityEvent<T extends EntityRefShape = EntityRefShape> = SpatialRotateEndEvent$1 & allTarget<T>;
|
|
250
|
-
type SpatialMagnifyEntityEvent<T extends EntityRefShape = EntityRefShape> = SpatialMagnifyEvent$1 & allTarget<T> & {
|
|
251
|
-
readonly magnification: number;
|
|
252
|
-
};
|
|
253
|
-
type SpatialMagnifyEndEntityEvent<T extends EntityRefShape = EntityRefShape> = SpatialMagnifyEndEvent$1 & allTarget<T>;
|
|
254
|
-
type EntityEventHandler = {
|
|
255
|
-
onSpatialTap?: (event: SpatialTapEntityEvent) => void;
|
|
256
|
-
onSpatialDragStart?: (event: SpatialDragStartEntityEvent) => void;
|
|
257
|
-
onSpatialDrag?: (event: SpatialDragEntityEvent) => void;
|
|
258
|
-
onSpatialDragEnd?: (event: SpatialDragEndEntityEvent) => void;
|
|
259
|
-
spatialEventOptions?: SpatialEventOptions;
|
|
260
|
-
onSpatialRotate?: (event: SpatialRotateEntityEvent) => void;
|
|
261
|
-
onSpatialRotateEnd?: (event: SpatialRotateEndEntityEvent) => void;
|
|
262
|
-
onSpatialMagnify?: (event: SpatialMagnifyEntityEvent) => void;
|
|
263
|
-
onSpatialMagnifyEnd?: (event: SpatialMagnifyEndEntityEvent) => void;
|
|
264
|
-
};
|
|
265
|
-
declare const eventMap: {
|
|
266
|
-
readonly onSpatialTap: "spatialtap";
|
|
267
|
-
readonly onSpatialDragStart: "spatialdragstart";
|
|
268
|
-
readonly onSpatialDrag: "spatialdrag";
|
|
269
|
-
readonly onSpatialDragEnd: "spatialdragend";
|
|
270
|
-
readonly onSpatialRotate: "spatialrotate";
|
|
271
|
-
readonly onSpatialRotateEnd: "spatialrotateend";
|
|
272
|
-
readonly onSpatialMagnify: "spatialmagnify";
|
|
273
|
-
readonly onSpatialMagnifyEnd: "spatialmagnifyend";
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
declare const Entity: React__default.ForwardRefExoticComponent<EntityProps & {
|
|
277
|
-
children?: React__default.ReactNode;
|
|
278
|
-
} & React__default.RefAttributes<EntityRefShape>>;
|
|
279
|
-
|
|
280
|
-
declare const BoxEntity: React__default.ForwardRefExoticComponent<EntityProps & {
|
|
281
|
-
children?: React__default.ReactNode;
|
|
282
|
-
materials?: string[];
|
|
283
|
-
} & SpatialBoxGeometryOptions & React__default.RefAttributes<EntityRefShape>>;
|
|
284
|
-
|
|
285
|
-
type UnlitMaterialProps = {
|
|
286
|
-
children?: React__default.ReactNode;
|
|
287
|
-
id: string;
|
|
288
|
-
} & SpatialUnlitMaterialOptions;
|
|
289
|
-
declare const UnlitMaterial: React__default.FC<UnlitMaterialProps>;
|
|
290
|
-
|
|
291
|
-
declare const SphereEntity: React__default.ForwardRefExoticComponent<EntityProps & {
|
|
292
|
-
children?: React__default.ReactNode;
|
|
293
|
-
materials?: string[];
|
|
294
|
-
} & SpatialSphereGeometryOptions & React__default.RefAttributes<EntityRefShape>>;
|
|
295
|
-
|
|
296
|
-
declare const ConeEntity: React__default.ForwardRefExoticComponent<EntityProps & {
|
|
297
|
-
children?: React__default.ReactNode;
|
|
298
|
-
materials?: string[];
|
|
299
|
-
} & SpatialConeGeometryOptions & React__default.RefAttributes<EntityRefShape>>;
|
|
300
|
-
|
|
301
|
-
declare const CylinderEntity: React__default.ForwardRefExoticComponent<EntityProps & {
|
|
302
|
-
children?: React__default.ReactNode;
|
|
303
|
-
materials?: string[];
|
|
304
|
-
} & SpatialCylinderGeometryOptions & React__default.RefAttributes<EntityRefShape>>;
|
|
305
|
-
|
|
306
|
-
declare const PlaneEntity: React__default.ForwardRefExoticComponent<EntityProps & {
|
|
307
|
-
children?: React__default.ReactNode;
|
|
308
|
-
materials?: string[];
|
|
309
|
-
} & SpatialPlaneGeometryOptions & React__default.RefAttributes<EntityRefShape>>;
|
|
310
|
-
|
|
311
|
-
type Props$1 = {
|
|
312
|
-
children?: React__default.ReactNode;
|
|
313
|
-
};
|
|
314
|
-
declare const SceneGraph: React__default.FC<Props$1>;
|
|
315
|
-
|
|
316
|
-
type Props = {
|
|
317
|
-
children?: React__default.ReactNode;
|
|
318
|
-
id: string;
|
|
319
|
-
src: string;
|
|
320
|
-
onLoad?: () => void;
|
|
321
|
-
onError?: (error: any) => void;
|
|
322
|
-
};
|
|
323
|
-
declare const ModelAsset: React__default.FC<Props>;
|
|
324
|
-
|
|
325
|
-
declare const ModelEntity: React__default.ForwardRefExoticComponent<EntityProps & {
|
|
326
|
-
model: string;
|
|
327
|
-
materials?: string[];
|
|
328
|
-
} & EntityEventHandler & {
|
|
329
|
-
children?: React__default.ReactNode;
|
|
330
|
-
} & React__default.RefAttributes<EntityRefShape>>;
|
|
331
|
-
|
|
332
|
-
type RealityProps = React__default.ComponentPropsWithRef<'div'> & EntityEventHandler;
|
|
333
|
-
declare const Reality: React__default.ForwardRefExoticComponent<Omit<RealityProps, "ref"> & React__default.RefAttributes<HTMLElement>>;
|
|
334
|
-
|
|
335
|
-
type AttachmentAssetProps = {
|
|
336
|
-
name: string;
|
|
337
|
-
children?: React__default.ReactNode;
|
|
338
|
-
};
|
|
339
|
-
declare const AttachmentAsset: React__default.FC<AttachmentAssetProps>;
|
|
340
|
-
|
|
341
|
-
type AttachmentEntityProps = {
|
|
342
|
-
attachment: string;
|
|
343
|
-
position?: [number, number, number];
|
|
344
|
-
size: {
|
|
345
|
-
width: number;
|
|
346
|
-
height: number;
|
|
347
|
-
};
|
|
348
|
-
};
|
|
349
|
-
declare const AttachmentEntity: React__default.FC<AttachmentEntityProps>;
|
|
350
|
-
|
|
351
|
-
type MaterialProps = {
|
|
352
|
-
type: 'unlit';
|
|
353
|
-
} & UnlitMaterialProps;
|
|
354
|
-
declare const Material: React__default.FC<MaterialProps>;
|
|
355
|
-
|
|
356
|
-
type ModelProps = SpatializedStatic3DContainerProps & {
|
|
357
|
-
'enable-xr'?: boolean;
|
|
358
|
-
};
|
|
359
|
-
type ModelRef = SpatializedStatic3DElementRef;
|
|
360
|
-
declare const Model: React$1.ForwardRefExoticComponent<Omit<{
|
|
361
|
-
onSpatialTap?: ((event: SpatialTapEvent<SpatializedStatic3DElementRef>) => void) | undefined;
|
|
362
|
-
onSpatialDragStart?: ((event: SpatialDragStartEvent<SpatializedStatic3DElementRef>) => void) | undefined;
|
|
363
|
-
onSpatialDrag?: ((event: SpatialDragEvent<SpatializedStatic3DElementRef>) => void) | undefined;
|
|
364
|
-
onSpatialDragEnd?: ((event: SpatialDragEndEvent<SpatializedStatic3DElementRef>) => void) | undefined;
|
|
365
|
-
onSpatialRotate?: ((event: SpatialRotateEvent<SpatializedStatic3DElementRef>) => void) | undefined;
|
|
366
|
-
onSpatialRotateEnd?: ((event: SpatialRotateEndEvent<SpatializedStatic3DElementRef>) => void) | undefined;
|
|
367
|
-
onSpatialMagnify?: ((event: SpatialMagnifyEvent<SpatializedStatic3DElementRef>) => void) | undefined;
|
|
368
|
-
onSpatialMagnifyEnd?: ((event: SpatialMagnifyEndEvent<SpatializedStatic3DElementRef>) => void) | undefined;
|
|
369
|
-
} & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "onLoad" | "onError"> & {
|
|
370
|
-
src?: string;
|
|
371
|
-
autoPlay?: boolean;
|
|
372
|
-
loop?: boolean;
|
|
373
|
-
children?: React.ReactNode;
|
|
374
|
-
onLoad?: (event: ModelLoadEvent) => void;
|
|
375
|
-
onError?: (event: ModelLoadEvent) => void;
|
|
376
|
-
spatialEventOptions?: SpatialEventOptions;
|
|
377
|
-
} & {
|
|
378
|
-
'enable-xr'?: boolean;
|
|
379
|
-
} & React$1.RefAttributes<SpatializedStatic3DElementRef>, "ref"> & React$1.RefAttributes<any>>;
|
|
380
|
-
|
|
381
|
-
declare const SSRProvider: ({ isSSR: initialIsSSR, children, }: {
|
|
382
|
-
isSSR?: boolean;
|
|
383
|
-
children: React__default.ReactNode;
|
|
384
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
385
|
-
|
|
386
|
-
declare function useMetrics(): {
|
|
387
|
-
pointToPhysical: typeof PhysicalMetrics.pointToPhysical;
|
|
388
|
-
physicalToPoint: typeof PhysicalMetrics.physicalToPoint;
|
|
389
|
-
};
|
|
390
|
-
|
|
391
|
-
declare function createElement(...args: Parameters<typeof createElement$1>): React$1.DetailedReactHTMLElement<React$1.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
392
|
-
|
|
393
|
-
/**
|
|
394
|
-
* const e2e = await convertCoordinate(position, { from: elementOrEntity, to: elementOrEntity })
|
|
395
|
-
const e2w = await convertCoordinate(position, { from: elementOrEntity, to: window })
|
|
396
|
-
const w2e = await convertCoordinate(position, { from: window, to: elementOrEntity })
|
|
397
|
-
*
|
|
398
|
-
*/
|
|
399
|
-
|
|
400
|
-
type CoordinateConvertible = Window | SpatializedElementRef<any> | EntityRef | ModelRef;
|
|
401
|
-
declare function convertCoordinate(position: Vec3, { from, to }: {
|
|
402
|
-
from: CoordinateConvertible;
|
|
403
|
-
to: CoordinateConvertible;
|
|
404
|
-
}): Promise<Vec3>;
|
|
405
|
-
|
|
406
|
-
declare const version: string;
|
|
407
|
-
|
|
408
|
-
export { AttachmentAsset, AttachmentEntity, BoxEntity as Box, BoxEntity, ConeEntity as Cone, ConeEntity, CylinderEntity as Cylinder, CylinderEntity, Entity, type EntityEventHandler, type EntityProps, EntityRef, Material, type MaterialProps, Model, ModelAsset, ModelEntity, type ModelLoadEvent, type ModelProps, type ModelRef, type ModelSpatialDragEndEvent, type ModelSpatialDragEvent, type ModelSpatialDragStartEvent, type ModelSpatialMagnifyEndEvent, type ModelSpatialMagnifyEvent, type ModelSpatialRotateEndEvent, type ModelSpatialRotateEvent, type ModelSpatialTapEvent, PlaneEntity as Plane, PlaneEntity, Reality, type RealityProps, SSRProvider, SceneGraph, type SpatialDragEndEntityEvent, type SpatialDragEndEvent, type SpatialDragEntityEvent, type SpatialDragEvent, type SpatialDragStartEntityEvent, type SpatialDragStartEvent, type SpatialEventOptions, type SpatialMagnifyEndEntityEvent, type SpatialMagnifyEndEvent, type SpatialMagnifyEntityEvent, type SpatialMagnifyEvent, SpatialMonitor, type SpatialRotateEndEntityEvent, type SpatialRotateEndEvent, type SpatialRotateEntityEvent, type SpatialRotateEvent, type SpatialTapEntityEvent, type SpatialTapEvent, Spatialized2DElementContainer, type Spatialized2DElementContainerProps, SpatializedContainer, type SpatializedElementRef, type SpatializedStatic3DContainerProps, SpatializedStatic3DElementContainer, type SpatializedStatic3DElementRef, SphereEntity as Sphere, SphereEntity, UnlitMaterial, type UnlitMaterialProps, SceneGraph as World, convertCoordinate, createElement, enableDebugTool, eventMap, initPolyfill, initScene, useMetrics, version, withSpatialMonitor, withSpatialized2DElementContainer };
|