@webspatial/react-sdk 1.1.0 → 1.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.
@@ -1,4 +1,4 @@
1
- import { SpatialSceneCreationOptions, SpatialSceneType, SpatialTapEvent as SpatialTapEvent$1, SpatialDragEvent as SpatialDragEvent$1, SpatialRotateEvent as SpatialRotateEvent$1, SpatialMagnifyEvent as SpatialMagnifyEvent$1, SpatializedElement, Point3D, SpatialObject, SpatialSession, SpatializedDynamic3DElement, Vec3, SpatialEntity, SpatialRotateEndEvent as SpatialRotateEndEvent$1, SpatialMagnifyEndEvent as SpatialMagnifyEndEvent$1, SpatialBoxGeometryOptions, SpatialUnlitMaterialOptions, SpatialSphereGeometryOptions, SpatialConeGeometryOptions, SpatialCylinderGeometryOptions, SpatialPlaneGeometryOptions } from '@webspatial/core-sdk';
1
+ 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, Point3D, SpatialObject, SpatialSession, SpatializedDynamic3DElement, Vec3, SpatialEntity, SpatialBoxGeometryOptions, SpatialUnlitMaterialOptions, SpatialSphereGeometryOptions, SpatialConeGeometryOptions, SpatialCylinderGeometryOptions, SpatialPlaneGeometryOptions } from '@webspatial/core-sdk';
2
2
  export { Point3D, Vec3 } from '@webspatial/core-sdk';
3
3
  import * as React$1 from 'react';
4
4
  import React__default, { ElementType, ForwardedRef } from 'react';
@@ -17,10 +17,8 @@ type SpatialEventProps<T extends SpatializedElementRef> = {
17
17
  onSpatialDragStart?: (event: SpatialDragStartEvent<T>) => void;
18
18
  onSpatialDrag?: (event: SpatialDragEvent<T>) => void;
19
19
  onSpatialDragEnd?: (event: SpatialDragEndEvent<T>) => void;
20
- onSpatialRotateStart?: (event: SpatialRotateStartEvent<T>) => void;
21
20
  onSpatialRotate?: (event: SpatialRotateEvent<T>) => void;
22
21
  onSpatialRotateEnd?: (event: SpatialRotateEndEvent<T>) => void;
23
- onSpatialMagnifyStart?: (event: SpatialMagnifyStartEvent<T>) => void;
24
22
  onSpatialMagnify?: (event: SpatialMagnifyEvent<T>) => void;
25
23
  onSpatialMagnifyEnd?: (event: SpatialMagnifyEndEvent<T>) => void;
26
24
  };
@@ -29,7 +27,17 @@ interface StandardSpatializedContainerProps extends React__default.ComponentProp
29
27
  inStandardSpatializedContainer?: boolean;
30
28
  [SpatialID]: string;
31
29
  }
32
- type RealityProps = SpatialEventProps<SpatializedElementRef> & React__default.ComponentPropsWithRef<'div'>;
30
+ type RealityForbiddenSpatialEventProps = {
31
+ onSpatialTap?: never;
32
+ onSpatialDragStart?: never;
33
+ onSpatialDrag?: never;
34
+ onSpatialDragEnd?: never;
35
+ onSpatialRotate?: never;
36
+ onSpatialRotateEnd?: never;
37
+ onSpatialMagnify?: never;
38
+ onSpatialMagnifyEnd?: never;
39
+ };
40
+ type RealityProps = React__default.ComponentPropsWithRef<'div'> & RealityForbiddenSpatialEventProps;
33
41
  type PortalSpatializedContainerProps<T extends SpatializedElementRef> = SpatialEventProps<T> & React__default.ComponentPropsWithoutRef<'div'> & {
34
42
  component: ElementType;
35
43
  spatializedContent: ElementType;
@@ -38,7 +46,7 @@ type PortalSpatializedContainerProps<T extends SpatializedElementRef> = SpatialE
38
46
  [SpatialID]: string;
39
47
  };
40
48
  type SpatializedContainerProps<T extends SpatializedElementRef> = Omit<StandardSpatializedContainerProps & PortalSpatializedContainerProps<T>, typeof SpatialID | 'onLoad' | 'onError'> & {
41
- extraRefProps?: (domProxy: T) => Record<string, () => any>;
49
+ extraRefProps?: (domProxy: T) => Record<string, unknown>;
42
50
  };
43
51
  type Spatialized2DElementContainerProps<P extends ElementType> = SpatialEventProps<SpatializedElementRef> & React__default.ComponentPropsWithRef<'div'> & {
44
52
  component: P;
@@ -53,26 +61,31 @@ type SpatializedDivElementRef = SpatializedElementRef<HTMLDivElement>;
53
61
  type SpatializedStatic3DElementRef = SpatializedDivElementRef & {
54
62
  currentSrc: string;
55
63
  ready: Promise<ModelLoadEvent>;
56
- entityTransform: DOMMatrix;
64
+ entityTransform: DOMMatrixReadOnly;
57
65
  };
58
66
  type CurrentTarget<T extends SpatializedElementRef> = {
59
67
  currentTarget: T;
60
68
  };
61
- type SpatialTapEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialTapEvent$1 & CurrentTarget<T>;
62
- type SpatialDragStartEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialDragEvent$1 & CurrentTarget<T>;
69
+ type SpatialTapEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialTapEvent$1 & CurrentTarget<T> & {
70
+ readonly offsetX: number;
71
+ readonly offsetY: number;
72
+ readonly offsetZ: number;
73
+ };
74
+ type SpatialDragStartEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialDragStartEvent$1 & CurrentTarget<T> & {
75
+ readonly offsetX: number;
76
+ readonly offsetY: number;
77
+ readonly offsetZ: number;
78
+ };
63
79
  type SpatialDragEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialDragEvent$1 & CurrentTarget<T>;
64
- type SpatialDragEndEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialDragEvent$1 & CurrentTarget<T>;
65
- type SpatialRotateStartEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialRotateEvent$1 & CurrentTarget<T>;
80
+ type SpatialDragEndEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialDragEndEvent$1 & CurrentTarget<T>;
66
81
  type SpatialRotateEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialRotateEvent$1 & CurrentTarget<T>;
67
- type SpatialRotateEndEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialRotateEvent$1 & CurrentTarget<T>;
68
- type SpatialMagnifyStartEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialMagnifyEvent$1 & CurrentTarget<T>;
82
+ type SpatialRotateEndEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialRotateEndEvent$1 & CurrentTarget<T>;
69
83
  type SpatialMagnifyEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialMagnifyEvent$1 & CurrentTarget<T>;
70
- type SpatialMagnifyEndEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialMagnifyEvent$1 & CurrentTarget<T>;
84
+ type SpatialMagnifyEndEvent<T extends SpatializedElementRef = SpatializedElementRef> = SpatialMagnifyEndEvent$1 & CurrentTarget<T>;
71
85
  type ModelSpatialTapEvent = SpatialTapEvent<SpatializedStatic3DElementRef>;
72
86
  type ModelSpatialDragStartEvent = SpatialDragStartEvent<SpatializedStatic3DElementRef>;
73
87
  type ModelSpatialDragEvent = SpatialDragEvent<SpatializedStatic3DElementRef>;
74
88
  type ModelSpatialDragEndEvent = SpatialDragEndEvent<SpatializedStatic3DElementRef>;
75
- type ModelSpatialRotateStartEvent = SpatialRotateStartEvent<SpatializedStatic3DElementRef>;
76
89
  type ModelSpatialRotateEvent = SpatialRotateEvent<SpatializedStatic3DElementRef>;
77
90
  type ModelSpatialRotateEndEvent = SpatialRotateEndEvent<SpatializedStatic3DElementRef>;
78
91
  type ModelSpatialMagnifyEvent = SpatialMagnifyEvent<SpatializedStatic3DElementRef>;
@@ -94,10 +107,8 @@ declare const SpatializedStatic3DElementContainer: React$1.ForwardRefExoticCompo
94
107
  onSpatialDragStart?: ((event: SpatialDragStartEvent<SpatializedStatic3DElementRef>) => void) | undefined;
95
108
  onSpatialDrag?: ((event: SpatialDragEvent<SpatializedStatic3DElementRef>) => void) | undefined;
96
109
  onSpatialDragEnd?: ((event: SpatialDragEndEvent<SpatializedStatic3DElementRef>) => void) | undefined;
97
- onSpatialRotateStart?: ((event: SpatialRotateStartEvent<SpatializedStatic3DElementRef>) => void) | undefined;
98
110
  onSpatialRotate?: ((event: SpatialRotateEvent<SpatializedStatic3DElementRef>) => void) | undefined;
99
111
  onSpatialRotateEnd?: ((event: SpatialRotateEndEvent<SpatializedStatic3DElementRef>) => void) | undefined;
100
- onSpatialMagnifyStart?: ((event: SpatialMagnifyStartEvent<SpatializedStatic3DElementRef>) => void) | undefined;
101
112
  onSpatialMagnify?: ((event: SpatialMagnifyEvent<SpatializedStatic3DElementRef>) => void) | undefined;
102
113
  onSpatialMagnifyEnd?: ((event: SpatialMagnifyEndEvent<SpatializedStatic3DElementRef>) => void) | undefined;
103
114
  } & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "onLoad" | "onError"> & {
@@ -169,21 +180,29 @@ type allTarget<T extends EntityRefShape> = {
169
180
  target: T;
170
181
  currentTarget: T;
171
182
  };
172
- type SpatialTapEntityEvent<T extends EntityRefShape = EntityRefShape> = SpatialTapEvent$1 & allTarget<T>;
183
+ type SpatialTapEntityEvent<T extends EntityRefShape = EntityRefShape> = SpatialTapEvent$1 & allTarget<T> & {
184
+ readonly offsetX: number;
185
+ readonly offsetY: number;
186
+ readonly offsetZ: number;
187
+ };
188
+ type SpatialDragStartEntityEvent<T extends EntityRefShape = EntityRefShape> = SpatialDragStartEvent$1 & allTarget<T> & {
189
+ readonly offsetX: number;
190
+ readonly offsetY: number;
191
+ readonly offsetZ: number;
192
+ };
173
193
  type SpatialDragEntityEvent<T extends EntityRefShape = EntityRefShape> = SpatialDragEvent$1 & allTarget<T>;
194
+ type SpatialDragEndEntityEvent<T extends EntityRefShape = EntityRefShape> = SpatialDragEndEvent$1 & allTarget<T>;
174
195
  type SpatialRotateEntityEvent<T extends EntityRefShape = EntityRefShape> = SpatialRotateEvent$1 & allTarget<T>;
175
196
  type SpatialRotateEndEntityEvent<T extends EntityRefShape = EntityRefShape> = SpatialRotateEndEvent$1 & allTarget<T>;
176
197
  type SpatialMagnifyEntityEvent<T extends EntityRefShape = EntityRefShape> = SpatialMagnifyEvent$1 & allTarget<T>;
177
198
  type SpatialMagnifyEndEntityEvent<T extends EntityRefShape = EntityRefShape> = SpatialMagnifyEndEvent$1 & allTarget<T>;
178
199
  type EntityEventHandler = {
179
200
  onSpatialTap?: (event: SpatialTapEntityEvent) => void;
180
- onSpatialDragStart?: (event: SpatialDragEntityEvent) => void;
201
+ onSpatialDragStart?: (event: SpatialDragStartEntityEvent) => void;
181
202
  onSpatialDrag?: (event: SpatialDragEntityEvent) => void;
182
- onSpatialDragEnd?: (event: SpatialDragEntityEvent) => void;
183
- onSpatialRotateStart?: (event: SpatialRotateEntityEvent) => void;
203
+ onSpatialDragEnd?: (event: SpatialDragEndEntityEvent) => void;
184
204
  onSpatialRotate?: (event: SpatialRotateEntityEvent) => void;
185
205
  onSpatialRotateEnd?: (event: SpatialRotateEndEntityEvent) => void;
186
- onSpatialMagnifyStart?: (event: SpatialMagnifyEntityEvent) => void;
187
206
  onSpatialMagnify?: (event: SpatialMagnifyEntityEvent) => void;
188
207
  onSpatialMagnifyEnd?: (event: SpatialMagnifyEndEntityEvent) => void;
189
208
  };
@@ -266,10 +285,8 @@ declare const Model: React$1.ForwardRefExoticComponent<Omit<{
266
285
  onSpatialDragStart?: ((event: SpatialDragStartEvent<SpatializedStatic3DElementRef>) => void) | undefined;
267
286
  onSpatialDrag?: ((event: SpatialDragEvent<SpatializedStatic3DElementRef>) => void) | undefined;
268
287
  onSpatialDragEnd?: ((event: SpatialDragEndEvent<SpatializedStatic3DElementRef>) => void) | undefined;
269
- onSpatialRotateStart?: ((event: SpatialRotateStartEvent<SpatializedStatic3DElementRef>) => void) | undefined;
270
288
  onSpatialRotate?: ((event: SpatialRotateEvent<SpatializedStatic3DElementRef>) => void) | undefined;
271
289
  onSpatialRotateEnd?: ((event: SpatialRotateEndEvent<SpatializedStatic3DElementRef>) => void) | undefined;
272
- onSpatialMagnifyStart?: ((event: SpatialMagnifyStartEvent<SpatializedStatic3DElementRef>) => void) | undefined;
273
290
  onSpatialMagnify?: ((event: SpatialMagnifyEvent<SpatializedStatic3DElementRef>) => void) | undefined;
274
291
  onSpatialMagnifyEnd?: ((event: SpatialMagnifyEndEvent<SpatializedStatic3DElementRef>) => void) | undefined;
275
292
  } & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "onLoad" | "onError"> & {
@@ -287,4 +304,4 @@ declare const SSRProvider: ({ isSSR: initialIsSSR, children, }: {
287
304
 
288
305
  declare const version: string;
289
306
 
290
- export { BoxEntity, ConeEntity, CylinderEntity, Entity, type EntityEventHandler, type EntityProps, EntityRef, Model, ModelAsset, ModelEntity, type ModelLoadEvent, type ModelProps, type ModelRef, type ModelSpatialDragEndEvent, type ModelSpatialDragEvent, type ModelSpatialDragStartEvent, type ModelSpatialMagnifyEndEvent, type ModelSpatialMagnifyEvent, type ModelSpatialRotateEndEvent, type ModelSpatialRotateEvent, type ModelSpatialRotateStartEvent, type ModelSpatialTapEvent, PlaneEntity, Reality, SSRProvider, SceneGraph, type SpatialDragEndEvent, type SpatialDragEntityEvent, type SpatialDragEvent, type SpatialDragStartEvent, type SpatialMagnifyEndEntityEvent, type SpatialMagnifyEndEvent, type SpatialMagnifyEntityEvent, type SpatialMagnifyEvent, type SpatialMagnifyStartEvent, SpatialMonitor, type SpatialRotateEndEntityEvent, type SpatialRotateEndEvent, type SpatialRotateEntityEvent, type SpatialRotateEvent, type SpatialRotateStartEvent, type SpatialTapEntityEvent, type SpatialTapEvent, Spatialized2DElementContainer, type Spatialized2DElementContainerProps, SpatializedContainer, type SpatializedElementRef, type SpatializedStatic3DContainerProps, SpatializedStatic3DElementContainer, type SpatializedStatic3DElementRef, SphereEntity, UnlitMaterial, enableDebugTool, eventMap, initPolyfill, initScene, toLocalSpace, toSceneSpatial, version, withSpatialMonitor, withSpatialized2DElementContainer };
307
+ export { BoxEntity, ConeEntity, CylinderEntity, Entity, type EntityEventHandler, type EntityProps, EntityRef, 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, Reality, SSRProvider, SceneGraph, type SpatialDragEndEntityEvent, type SpatialDragEndEvent, type SpatialDragEntityEvent, type SpatialDragEvent, type SpatialDragStartEntityEvent, type SpatialDragStartEvent, 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, UnlitMaterial, enableDebugTool, eventMap, initPolyfill, initScene, toLocalSpace, toSceneSpatial, version, withSpatialMonitor, withSpatialized2DElementContainer };