@webspatial/react-sdk 1.3.0 → 1.4.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.
@@ -1,7 +1,7 @@
1
1
  export { Fragment } from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
3
  import { JSXSource } from 'react/jsx-dev-runtime';
4
- import { SpatialTapEvent, SpatialDragStartEvent, SpatialDragEvent, SpatialDragEndEvent, SpatialRotateEvent, SpatialRotateEndEvent, SpatialMagnifyEvent, SpatialMagnifyEndEvent } from '@webspatial/react-sdk';
4
+ import { SpatialTapEvent, SpatialDragStartEvent, SpatialDragEvent, SpatialDragEndEvent, SpatialRotateEvent, SpatialRotateEndEvent, SpatialMagnifyEvent, SpatialMagnifyEndEvent, SpatialEventOptions } from '@webspatial/react-sdk';
5
5
 
6
6
  declare function jsxs(type: React.ElementType, props: unknown, key?: React.Key): react.ReactElement<any, string | react.JSXElementConstructor<any>>;
7
7
  declare function jsx(type: React.ElementType, props: unknown, key?: React.Key): react.ReactElement<any, string | react.JSXElementConstructor<any>>;
@@ -53,6 +53,7 @@ declare namespace WebSpatialJSX {
53
53
  onSpatialRotateEnd?: (e: SpatialRotateEndEvent) => void;
54
54
  onSpatialMagnify?: (e: SpatialMagnifyEvent) => void;
55
55
  onSpatialMagnifyEnd?: (e: SpatialMagnifyEndEvent) => void;
56
+ spatialEventOptions?: SpatialEventOptions;
56
57
  };
57
58
  };
58
59
  }
@@ -2,7 +2,7 @@
2
2
  (function(){
3
3
  if(typeof window === 'undefined') return;
4
4
  if(!window.__webspatialsdk__) window.__webspatialsdk__ = {}
5
- window.__webspatialsdk__['react-sdk-version'] = "1.3.0"
5
+ window.__webspatialsdk__['react-sdk-version'] = "1.4.0"
6
6
  window.__webspatialsdk__['XR_ENV'] = "avp"
7
7
  })()
8
8
 
@@ -13,6 +13,7 @@ import { Fragment } from "react/jsx-runtime";
13
13
  // src/jsx/jsx-shared.ts
14
14
  import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
15
15
  import reactJSXRuntime from "react/jsx-runtime";
16
+ import { createElement as reactCreateElement } from "react";
16
17
  import {
17
18
  withSpatialMonitor,
18
19
  withSpatialized2DElementContainer,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/jsx/jsx-dev-runtime.ts","../../src/jsx/jsx-shared.ts"],"sourcesContent":["export { Fragment } from 'react/jsx-runtime'\nexport { jsxDEV, jsx } from './jsx-shared'\n\nexport type { WebSpatialJSX as JSX } from './jsx-namespace'\nexport * from './xr-css-extension'\n","import { jsxDEV as _jsxDEV, JSXSource } from 'react/jsx-dev-runtime'\nimport reactJSXRuntime from 'react/jsx-runtime'\nimport {\n withSpatialMonitor,\n withSpatialized2DElementContainer,\n Model,\n //@ts-ignore bypass ts check for external\n} from '@webspatial/react-sdk'\nconst attributeFlag = 'enable-xr'\nconst styleFlag = 'enableXr'\nconst classFlag = '__enableXr__'\nconst xrMonitorFlag = 'enable-xr-monitor'\n\nexport function replaceToSpatialPrimitiveType(\n type: React.ElementType,\n props: unknown,\n) {\n if (type === Model) {\n return type\n }\n\n const propsObject = props as Record<string, any>\n if (attributeFlag in propsObject) {\n delete propsObject[attributeFlag]\n return withSpatialized2DElementContainer(type)\n }\n\n if (xrMonitorFlag in propsObject) {\n delete propsObject[xrMonitorFlag]\n return withSpatialMonitor(type)\n }\n\n if (propsObject && propsObject.style && styleFlag in propsObject.style) {\n delete propsObject.style[styleFlag]\n return withSpatialized2DElementContainer(type)\n }\n\n if (propsObject && typeof propsObject.className === 'string') {\n const originalClassNames = propsObject.className.split(' ')\n const idx = originalClassNames.indexOf(classFlag)\n if (idx !== -1) {\n originalClassNames.splice(idx, 1)\n propsObject.className = originalClassNames.join(' ')\n return withSpatialized2DElementContainer(type)\n }\n }\n\n return type\n}\n\nexport function jsxs(type: React.ElementType, props: unknown, key?: React.Key) {\n type = replaceToSpatialPrimitiveType(type, props)\n return reactJSXRuntime.jsxs(type, props, key)\n}\n\nexport function jsx(type: React.ElementType, props: unknown, key?: React.Key) {\n type = replaceToSpatialPrimitiveType(type, props)\n return reactJSXRuntime.jsx(type, props, key)\n}\n\nexport function jsxDEV(\n type: React.ElementType,\n props: unknown,\n key: React.Key,\n isStatic: boolean,\n source?: JSXSource,\n self?: unknown,\n) {\n type = replaceToSpatialPrimitiveType(type, props)\n return _jsxDEV(type, props, key, isStatic, source, self)\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAS,gBAAgB;;;ACAzB,SAAS,UAAU,eAA0B;AAC7C,OAAO,qBAAqB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,IAAM,gBAAgB;AACtB,IAAM,YAAY;AAClB,IAAM,YAAY;AAClB,IAAM,gBAAgB;AAEf,SAAS,8BACd,MACA,OACA;AACA,MAAI,SAAS,OAAO;AAClB,WAAO;AAAA,EACT;AAEA,QAAM,cAAc;AACpB,MAAI,iBAAiB,aAAa;AAChC,WAAO,YAAY,aAAa;AAChC,WAAO,kCAAkC,IAAI;AAAA,EAC/C;AAEA,MAAI,iBAAiB,aAAa;AAChC,WAAO,YAAY,aAAa;AAChC,WAAO,mBAAmB,IAAI;AAAA,EAChC;AAEA,MAAI,eAAe,YAAY,SAAS,aAAa,YAAY,OAAO;AACtE,WAAO,YAAY,MAAM,SAAS;AAClC,WAAO,kCAAkC,IAAI;AAAA,EAC/C;AAEA,MAAI,eAAe,OAAO,YAAY,cAAc,UAAU;AAC5D,UAAM,qBAAqB,YAAY,UAAU,MAAM,GAAG;AAC1D,UAAM,MAAM,mBAAmB,QAAQ,SAAS;AAChD,QAAI,QAAQ,IAAI;AACd,yBAAmB,OAAO,KAAK,CAAC;AAChC,kBAAY,YAAY,mBAAmB,KAAK,GAAG;AACnD,aAAO,kCAAkC,IAAI;AAAA,IAC/C;AAAA,EACF;AAEA,SAAO;AACT;AAOO,SAAS,IAAI,MAAyB,OAAgB,KAAiB;AAC5E,SAAO,8BAA8B,MAAM,KAAK;AAChD,SAAO,gBAAgB,IAAI,MAAM,OAAO,GAAG;AAC7C;AAEO,SAAS,OACd,MACA,OACA,KACA,UACA,QACA,MACA;AACA,SAAO,8BAA8B,MAAM,KAAK;AAChD,SAAO,QAAQ,MAAM,OAAO,KAAK,UAAU,QAAQ,IAAI;AACzD;","names":[]}
1
+ {"version":3,"sources":["../../src/jsx/jsx-dev-runtime.ts","../../src/jsx/jsx-shared.ts"],"sourcesContent":["export { Fragment } from 'react/jsx-runtime'\nexport { jsxDEV, jsx } from './jsx-shared'\n\nexport type { WebSpatialJSX as JSX } from './jsx-namespace'\nexport * from './xr-css-extension'\n","import { jsxDEV as _jsxDEV, JSXSource } from 'react/jsx-dev-runtime'\nimport reactJSXRuntime from 'react/jsx-runtime'\nimport { createElement as reactCreateElement } from 'react'\nimport {\n withSpatialMonitor,\n withSpatialized2DElementContainer,\n Model,\n //@ts-ignore bypass ts check for external\n} from '@webspatial/react-sdk'\nconst attributeFlag = 'enable-xr'\nconst styleFlag = 'enableXr'\nconst classFlag = '__enableXr__'\nconst xrMonitorFlag = 'enable-xr-monitor'\n\nexport function replaceToSpatialPrimitiveType(\n type: React.ElementType,\n props: unknown,\n) {\n if (type === Model) {\n return type\n }\n\n const propsObject = props as Record<string, any>\n if (attributeFlag in propsObject) {\n delete propsObject[attributeFlag]\n return withSpatialized2DElementContainer(type)\n }\n\n if (xrMonitorFlag in propsObject) {\n delete propsObject[xrMonitorFlag]\n return withSpatialMonitor(type)\n }\n\n if (propsObject && propsObject.style && styleFlag in propsObject.style) {\n delete propsObject.style[styleFlag]\n return withSpatialized2DElementContainer(type)\n }\n\n if (propsObject && typeof propsObject.className === 'string') {\n const originalClassNames = propsObject.className.split(' ')\n const idx = originalClassNames.indexOf(classFlag)\n if (idx !== -1) {\n originalClassNames.splice(idx, 1)\n propsObject.className = originalClassNames.join(' ')\n return withSpatialized2DElementContainer(type)\n }\n }\n\n return type\n}\n\nexport function jsxs(type: React.ElementType, props: unknown, key?: React.Key) {\n type = replaceToSpatialPrimitiveType(type, props)\n return reactJSXRuntime.jsxs(type, props, key)\n}\n\nexport function jsx(type: React.ElementType, props: unknown, key?: React.Key) {\n type = replaceToSpatialPrimitiveType(type, props)\n return reactJSXRuntime.jsx(type, props, key)\n}\n\nexport function jsxDEV(\n type: React.ElementType,\n props: unknown,\n key: React.Key,\n isStatic: boolean,\n source?: JSXSource,\n self?: unknown,\n) {\n type = replaceToSpatialPrimitiveType(type, props)\n return _jsxDEV(type, props, key, isStatic, source, self)\n}\n\nexport function createElement(...args: Parameters<typeof reactCreateElement>) {\n const [type, props, ...rest] = args\n const newType = replaceToSpatialPrimitiveType(type as any, props)\n return reactCreateElement(newType, props, ...rest)\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAS,gBAAgB;;;ACAzB,SAAS,UAAU,eAA0B;AAC7C,OAAO,qBAAqB;AAC5B,SAAS,iBAAiB,0BAA0B;AACpD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,IAAM,gBAAgB;AACtB,IAAM,YAAY;AAClB,IAAM,YAAY;AAClB,IAAM,gBAAgB;AAEf,SAAS,8BACd,MACA,OACA;AACA,MAAI,SAAS,OAAO;AAClB,WAAO;AAAA,EACT;AAEA,QAAM,cAAc;AACpB,MAAI,iBAAiB,aAAa;AAChC,WAAO,YAAY,aAAa;AAChC,WAAO,kCAAkC,IAAI;AAAA,EAC/C;AAEA,MAAI,iBAAiB,aAAa;AAChC,WAAO,YAAY,aAAa;AAChC,WAAO,mBAAmB,IAAI;AAAA,EAChC;AAEA,MAAI,eAAe,YAAY,SAAS,aAAa,YAAY,OAAO;AACtE,WAAO,YAAY,MAAM,SAAS;AAClC,WAAO,kCAAkC,IAAI;AAAA,EAC/C;AAEA,MAAI,eAAe,OAAO,YAAY,cAAc,UAAU;AAC5D,UAAM,qBAAqB,YAAY,UAAU,MAAM,GAAG;AAC1D,UAAM,MAAM,mBAAmB,QAAQ,SAAS;AAChD,QAAI,QAAQ,IAAI;AACd,yBAAmB,OAAO,KAAK,CAAC;AAChC,kBAAY,YAAY,mBAAmB,KAAK,GAAG;AACnD,aAAO,kCAAkC,IAAI;AAAA,IAC/C;AAAA,EACF;AAEA,SAAO;AACT;AAOO,SAAS,IAAI,MAAyB,OAAgB,KAAiB;AAC5E,SAAO,8BAA8B,MAAM,KAAK;AAChD,SAAO,gBAAgB,IAAI,MAAM,OAAO,GAAG;AAC7C;AAEO,SAAS,OACd,MACA,OACA,KACA,UACA,QACA,MACA;AACA,SAAO,8BAA8B,MAAM,KAAK;AAChD,SAAO,QAAQ,MAAM,OAAO,KAAK,UAAU,QAAQ,IAAI;AACzD;","names":[]}
@@ -2,7 +2,7 @@
2
2
  (function(){
3
3
  if(typeof window === 'undefined') return;
4
4
  if(!window.__webspatialsdk__) window.__webspatialsdk__ = {}
5
- window.__webspatialsdk__['react-sdk-version'] = "1.3.0"
5
+ window.__webspatialsdk__['react-sdk-version'] = "1.4.0"
6
6
  window.__webspatialsdk__['XR_ENV'] = "web"
7
7
  })()
8
8
 
@@ -2,7 +2,7 @@
2
2
  (function(){
3
3
  if(typeof window === 'undefined') return;
4
4
  if(!window.__webspatialsdk__) window.__webspatialsdk__ = {}
5
- window.__webspatialsdk__['react-sdk-version'] = "1.3.0"
5
+ window.__webspatialsdk__['react-sdk-version'] = "1.4.0"
6
6
  window.__webspatialsdk__['XR_ENV'] = "avp"
7
7
  })()
8
8
 
@@ -13,6 +13,7 @@ import { Fragment } from "react/jsx-runtime";
13
13
  // src/jsx/jsx-shared.ts
14
14
  import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
15
15
  import reactJSXRuntime from "react/jsx-runtime";
16
+ import { createElement as reactCreateElement } from "react";
16
17
  import {
17
18
  withSpatialMonitor,
18
19
  withSpatialized2DElementContainer,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/jsx/jsx-runtime.ts","../../src/jsx/jsx-shared.ts"],"sourcesContent":["export { Fragment } from 'react/jsx-runtime'\nexport { jsx, jsxs } from './jsx-shared'\n\nexport type { WebSpatialJSX as JSX } from './jsx-namespace'\nexport * from './xr-css-extension'\n","import { jsxDEV as _jsxDEV, JSXSource } from 'react/jsx-dev-runtime'\nimport reactJSXRuntime from 'react/jsx-runtime'\nimport {\n withSpatialMonitor,\n withSpatialized2DElementContainer,\n Model,\n //@ts-ignore bypass ts check for external\n} from '@webspatial/react-sdk'\nconst attributeFlag = 'enable-xr'\nconst styleFlag = 'enableXr'\nconst classFlag = '__enableXr__'\nconst xrMonitorFlag = 'enable-xr-monitor'\n\nexport function replaceToSpatialPrimitiveType(\n type: React.ElementType,\n props: unknown,\n) {\n if (type === Model) {\n return type\n }\n\n const propsObject = props as Record<string, any>\n if (attributeFlag in propsObject) {\n delete propsObject[attributeFlag]\n return withSpatialized2DElementContainer(type)\n }\n\n if (xrMonitorFlag in propsObject) {\n delete propsObject[xrMonitorFlag]\n return withSpatialMonitor(type)\n }\n\n if (propsObject && propsObject.style && styleFlag in propsObject.style) {\n delete propsObject.style[styleFlag]\n return withSpatialized2DElementContainer(type)\n }\n\n if (propsObject && typeof propsObject.className === 'string') {\n const originalClassNames = propsObject.className.split(' ')\n const idx = originalClassNames.indexOf(classFlag)\n if (idx !== -1) {\n originalClassNames.splice(idx, 1)\n propsObject.className = originalClassNames.join(' ')\n return withSpatialized2DElementContainer(type)\n }\n }\n\n return type\n}\n\nexport function jsxs(type: React.ElementType, props: unknown, key?: React.Key) {\n type = replaceToSpatialPrimitiveType(type, props)\n return reactJSXRuntime.jsxs(type, props, key)\n}\n\nexport function jsx(type: React.ElementType, props: unknown, key?: React.Key) {\n type = replaceToSpatialPrimitiveType(type, props)\n return reactJSXRuntime.jsx(type, props, key)\n}\n\nexport function jsxDEV(\n type: React.ElementType,\n props: unknown,\n key: React.Key,\n isStatic: boolean,\n source?: JSXSource,\n self?: unknown,\n) {\n type = replaceToSpatialPrimitiveType(type, props)\n return _jsxDEV(type, props, key, isStatic, source, self)\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAS,gBAAgB;;;ACAzB,SAAS,UAAU,eAA0B;AAC7C,OAAO,qBAAqB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,IAAM,gBAAgB;AACtB,IAAM,YAAY;AAClB,IAAM,YAAY;AAClB,IAAM,gBAAgB;AAEf,SAAS,8BACd,MACA,OACA;AACA,MAAI,SAAS,OAAO;AAClB,WAAO;AAAA,EACT;AAEA,QAAM,cAAc;AACpB,MAAI,iBAAiB,aAAa;AAChC,WAAO,YAAY,aAAa;AAChC,WAAO,kCAAkC,IAAI;AAAA,EAC/C;AAEA,MAAI,iBAAiB,aAAa;AAChC,WAAO,YAAY,aAAa;AAChC,WAAO,mBAAmB,IAAI;AAAA,EAChC;AAEA,MAAI,eAAe,YAAY,SAAS,aAAa,YAAY,OAAO;AACtE,WAAO,YAAY,MAAM,SAAS;AAClC,WAAO,kCAAkC,IAAI;AAAA,EAC/C;AAEA,MAAI,eAAe,OAAO,YAAY,cAAc,UAAU;AAC5D,UAAM,qBAAqB,YAAY,UAAU,MAAM,GAAG;AAC1D,UAAM,MAAM,mBAAmB,QAAQ,SAAS;AAChD,QAAI,QAAQ,IAAI;AACd,yBAAmB,OAAO,KAAK,CAAC;AAChC,kBAAY,YAAY,mBAAmB,KAAK,GAAG;AACnD,aAAO,kCAAkC,IAAI;AAAA,IAC/C;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,KAAK,MAAyB,OAAgB,KAAiB;AAC7E,SAAO,8BAA8B,MAAM,KAAK;AAChD,SAAO,gBAAgB,KAAK,MAAM,OAAO,GAAG;AAC9C;AAEO,SAAS,IAAI,MAAyB,OAAgB,KAAiB;AAC5E,SAAO,8BAA8B,MAAM,KAAK;AAChD,SAAO,gBAAgB,IAAI,MAAM,OAAO,GAAG;AAC7C;","names":[]}
1
+ {"version":3,"sources":["../../src/jsx/jsx-runtime.ts","../../src/jsx/jsx-shared.ts"],"sourcesContent":["export { Fragment } from 'react/jsx-runtime'\nexport { jsx, jsxs } from './jsx-shared'\n\nexport type { WebSpatialJSX as JSX } from './jsx-namespace'\nexport * from './xr-css-extension'\n","import { jsxDEV as _jsxDEV, JSXSource } from 'react/jsx-dev-runtime'\nimport reactJSXRuntime from 'react/jsx-runtime'\nimport { createElement as reactCreateElement } from 'react'\nimport {\n withSpatialMonitor,\n withSpatialized2DElementContainer,\n Model,\n //@ts-ignore bypass ts check for external\n} from '@webspatial/react-sdk'\nconst attributeFlag = 'enable-xr'\nconst styleFlag = 'enableXr'\nconst classFlag = '__enableXr__'\nconst xrMonitorFlag = 'enable-xr-monitor'\n\nexport function replaceToSpatialPrimitiveType(\n type: React.ElementType,\n props: unknown,\n) {\n if (type === Model) {\n return type\n }\n\n const propsObject = props as Record<string, any>\n if (attributeFlag in propsObject) {\n delete propsObject[attributeFlag]\n return withSpatialized2DElementContainer(type)\n }\n\n if (xrMonitorFlag in propsObject) {\n delete propsObject[xrMonitorFlag]\n return withSpatialMonitor(type)\n }\n\n if (propsObject && propsObject.style && styleFlag in propsObject.style) {\n delete propsObject.style[styleFlag]\n return withSpatialized2DElementContainer(type)\n }\n\n if (propsObject && typeof propsObject.className === 'string') {\n const originalClassNames = propsObject.className.split(' ')\n const idx = originalClassNames.indexOf(classFlag)\n if (idx !== -1) {\n originalClassNames.splice(idx, 1)\n propsObject.className = originalClassNames.join(' ')\n return withSpatialized2DElementContainer(type)\n }\n }\n\n return type\n}\n\nexport function jsxs(type: React.ElementType, props: unknown, key?: React.Key) {\n type = replaceToSpatialPrimitiveType(type, props)\n return reactJSXRuntime.jsxs(type, props, key)\n}\n\nexport function jsx(type: React.ElementType, props: unknown, key?: React.Key) {\n type = replaceToSpatialPrimitiveType(type, props)\n return reactJSXRuntime.jsx(type, props, key)\n}\n\nexport function jsxDEV(\n type: React.ElementType,\n props: unknown,\n key: React.Key,\n isStatic: boolean,\n source?: JSXSource,\n self?: unknown,\n) {\n type = replaceToSpatialPrimitiveType(type, props)\n return _jsxDEV(type, props, key, isStatic, source, self)\n}\n\nexport function createElement(...args: Parameters<typeof reactCreateElement>) {\n const [type, props, ...rest] = args\n const newType = replaceToSpatialPrimitiveType(type as any, props)\n return reactCreateElement(newType, props, ...rest)\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAS,gBAAgB;;;ACAzB,SAAS,UAAU,eAA0B;AAC7C,OAAO,qBAAqB;AAC5B,SAAS,iBAAiB,0BAA0B;AACpD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,IAAM,gBAAgB;AACtB,IAAM,YAAY;AAClB,IAAM,YAAY;AAClB,IAAM,gBAAgB;AAEf,SAAS,8BACd,MACA,OACA;AACA,MAAI,SAAS,OAAO;AAClB,WAAO;AAAA,EACT;AAEA,QAAM,cAAc;AACpB,MAAI,iBAAiB,aAAa;AAChC,WAAO,YAAY,aAAa;AAChC,WAAO,kCAAkC,IAAI;AAAA,EAC/C;AAEA,MAAI,iBAAiB,aAAa;AAChC,WAAO,YAAY,aAAa;AAChC,WAAO,mBAAmB,IAAI;AAAA,EAChC;AAEA,MAAI,eAAe,YAAY,SAAS,aAAa,YAAY,OAAO;AACtE,WAAO,YAAY,MAAM,SAAS;AAClC,WAAO,kCAAkC,IAAI;AAAA,EAC/C;AAEA,MAAI,eAAe,OAAO,YAAY,cAAc,UAAU;AAC5D,UAAM,qBAAqB,YAAY,UAAU,MAAM,GAAG;AAC1D,UAAM,MAAM,mBAAmB,QAAQ,SAAS;AAChD,QAAI,QAAQ,IAAI;AACd,yBAAmB,OAAO,KAAK,CAAC;AAChC,kBAAY,YAAY,mBAAmB,KAAK,GAAG;AACnD,aAAO,kCAAkC,IAAI;AAAA,IAC/C;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,KAAK,MAAyB,OAAgB,KAAiB;AAC7E,SAAO,8BAA8B,MAAM,KAAK;AAChD,SAAO,gBAAgB,KAAK,MAAM,OAAO,GAAG;AAC9C;AAEO,SAAS,IAAI,MAAyB,OAAgB,KAAiB;AAC5E,SAAO,8BAA8B,MAAM,KAAK;AAChD,SAAO,gBAAgB,IAAI,MAAM,OAAO,GAAG;AAC7C;","names":[]}
@@ -2,7 +2,7 @@
2
2
  (function(){
3
3
  if(typeof window === 'undefined') return;
4
4
  if(!window.__webspatialsdk__) window.__webspatialsdk__ = {}
5
- window.__webspatialsdk__['react-sdk-version'] = "1.3.0"
5
+ window.__webspatialsdk__['react-sdk-version'] = "1.4.0"
6
6
  window.__webspatialsdk__['XR_ENV'] = "web"
7
7
  })()
8
8
 
@@ -1,8 +1,8 @@
1
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, Point3D, SpatialObject, SpatialSession, SpatializedDynamic3DElement, Vec3, SpatialEntity, Quaternion, SpatialBoxGeometryOptions, SpatialUnlitMaterialOptions, SpatialSphereGeometryOptions, SpatialConeGeometryOptions, SpatialCylinderGeometryOptions, SpatialPlaneGeometryOptions } 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
3
  export { Point3D, Vec3 } from '@webspatial/core-sdk';
4
4
  import * as React$1 from 'react';
5
- import React__default, { ElementType, ForwardedRef } from 'react';
5
+ import React__default, { ElementType, ForwardedRef, createElement as createElement$1 } from 'react';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
 
8
8
  declare function enableDebugTool(): void;
@@ -13,6 +13,13 @@ declare function initScene(name: string, callback: (pre: SpatialSceneCreationOpt
13
13
 
14
14
  declare const SpatialID = "data-spatial-id";
15
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
+ };
16
23
  type SpatialEventProps<T extends SpatializedElementRef> = {
17
24
  onSpatialTap?: (event: SpatialTapEvent<T>) => void;
18
25
  onSpatialDragStart?: (event: SpatialDragStartEvent<T>) => void;
@@ -28,22 +35,12 @@ interface StandardSpatializedContainerProps extends React__default.ComponentProp
28
35
  inStandardSpatializedContainer?: boolean;
29
36
  [SpatialID]: string;
30
37
  }
31
- type RealityForbiddenSpatialEventProps = {
32
- onSpatialTap?: never;
33
- onSpatialDragStart?: never;
34
- onSpatialDrag?: never;
35
- onSpatialDragEnd?: never;
36
- onSpatialRotate?: never;
37
- onSpatialRotateEnd?: never;
38
- onSpatialMagnify?: never;
39
- onSpatialMagnifyEnd?: never;
40
- };
41
- type RealityProps = React__default.ComponentPropsWithRef<'div'> & RealityForbiddenSpatialEventProps;
42
38
  type PortalSpatializedContainerProps<T extends SpatializedElementRef> = SpatialEventProps<T> & React__default.ComponentPropsWithoutRef<'div'> & {
43
39
  component: ElementType;
44
40
  spatializedContent: ElementType;
45
41
  createSpatializedElement: () => Promise<SpatializedElement>;
46
42
  getExtraSpatializedElementProperties?: (computedStyle: CSSStyleDeclaration) => Record<string, any>;
43
+ spatialEventOptions?: SpatialEventOptions;
47
44
  [SpatialID]: string;
48
45
  };
49
46
  type SpatializedContainerProps<T extends SpatializedElementRef> = Omit<StandardSpatializedContainerProps & PortalSpatializedContainerProps<T>, typeof SpatialID | 'onLoad' | 'onError'> & {
@@ -51,11 +48,13 @@ type SpatializedContainerProps<T extends SpatializedElementRef> = Omit<StandardS
51
48
  };
52
49
  type Spatialized2DElementContainerProps<P extends ElementType> = SpatialEventProps<SpatializedElementRef> & React__default.ComponentPropsWithRef<'div'> & {
53
50
  component: P;
51
+ spatialEventOptions?: SpatialEventOptions;
54
52
  };
55
53
  type SpatializedStatic3DContainerProps = SpatialEventProps<SpatializedStatic3DElementRef> & Omit<React__default.ComponentPropsWithoutRef<'div'>, 'onLoad' | 'onError'> & {
56
54
  src?: string;
57
55
  onLoad?: (event: ModelLoadEvent) => void;
58
56
  onError?: (event: ModelLoadEvent) => void;
57
+ spatialEventOptions?: SpatialEventOptions;
59
58
  };
60
59
  type SpatializedElementRef<T extends HTMLElement = HTMLElement> = T;
61
60
  type SpatializedDivElementRef = SpatializedElementRef<HTMLDivElement>;
@@ -130,13 +129,11 @@ declare const SpatializedStatic3DElementContainer: React$1.ForwardRefExoticCompo
130
129
  src?: string;
131
130
  onLoad?: (event: ModelLoadEvent) => void;
132
131
  onError?: (event: ModelLoadEvent) => void;
132
+ spatialEventOptions?: SpatialEventOptions;
133
133
  } & React$1.RefAttributes<SpatializedStatic3DElementRef>>;
134
134
 
135
135
  declare function withSpatialized2DElementContainer<P extends ElementType>(Component: P): P | React$1.ForwardRefExoticComponent<Omit<Spatialized2DElementContainerProps<P>, "ref"> & React$1.RefAttributes<HTMLElement>>;
136
136
 
137
- declare function toSceneSpatial(point: Point3D, spatializedElement: SpatializedElementRef): DOMPoint;
138
- declare function toLocalSpace(point: Point3D, spatializedElement: SpatializedElementRef): DOMPoint;
139
-
140
137
  declare function initPolyfill(): void;
141
138
 
142
139
  declare function withSpatialMonitor(El: React__default.ElementType): any;
@@ -155,13 +152,17 @@ declare class ResourceRegistry {
155
152
  destroy(): void;
156
153
  }
157
154
 
158
- type ContainersChangeCallback = (containers: HTMLElement[]) => void;
155
+ type ContainerEntry = {
156
+ instanceId: string;
157
+ container: HTMLElement;
158
+ };
159
+ type ContainersChangeCallback = (containers: ContainerEntry[]) => void;
159
160
  declare class AttachmentRegistry {
160
161
  private containers;
161
162
  private listeners;
162
163
  addContainer(name: string, instanceId: string, container: HTMLElement): void;
163
164
  removeContainer(name: string, instanceId: string): void;
164
- getContainers(name: string): HTMLElement[];
165
+ getContainers(name: string): ContainerEntry[];
165
166
  onContainersChange(name: string, cb: ContainersChangeCallback): () => void;
166
167
  private notifyListeners;
167
168
  destroy(): void;
@@ -203,6 +204,7 @@ type EntityProps = {
203
204
  position?: Vec3;
204
205
  rotation?: Vec3;
205
206
  scale?: Vec3;
207
+ enableInput?: boolean;
206
208
  };
207
209
  type allTarget<T extends EntityRefShape> = {
208
210
  target: T;
@@ -243,6 +245,7 @@ type EntityEventHandler = {
243
245
  onSpatialDragStart?: (event: SpatialDragStartEntityEvent) => void;
244
246
  onSpatialDrag?: (event: SpatialDragEntityEvent) => void;
245
247
  onSpatialDragEnd?: (event: SpatialDragEndEntityEvent) => void;
248
+ spatialEventOptions?: SpatialEventOptions;
246
249
  onSpatialRotate?: (event: SpatialRotateEntityEvent) => void;
247
250
  onSpatialRotateEnd?: (event: SpatialRotateEndEntityEvent) => void;
248
251
  onSpatialMagnify?: (event: SpatialMagnifyEntityEvent) => void;
@@ -253,45 +256,43 @@ declare const eventMap: {
253
256
  readonly onSpatialDragStart: "spatialdragstart";
254
257
  readonly onSpatialDrag: "spatialdrag";
255
258
  readonly onSpatialDragEnd: "spatialdragend";
256
- readonly onSpatialRotateStart: "spatialrotatestart";
257
259
  readonly onSpatialRotate: "spatialrotate";
258
260
  readonly onSpatialRotateEnd: "spatialrotateend";
259
- readonly onSpatialMagnifyStart: "spatialmagnifystart";
260
261
  readonly onSpatialMagnify: "spatialmagnify";
261
262
  readonly onSpatialMagnifyEnd: "spatialmagnifyend";
262
263
  };
263
264
 
264
- declare const Entity: React__default.ForwardRefExoticComponent<EntityProps & EntityEventHandler & {
265
+ declare const Entity: React__default.ForwardRefExoticComponent<EntityProps & {
265
266
  children?: React__default.ReactNode;
266
267
  } & React__default.RefAttributes<EntityRefShape>>;
267
268
 
268
- declare const BoxEntity: React__default.ForwardRefExoticComponent<EntityProps & EntityEventHandler & {
269
+ declare const BoxEntity: React__default.ForwardRefExoticComponent<EntityProps & {
269
270
  children?: React__default.ReactNode;
270
271
  materials?: string[];
271
272
  } & SpatialBoxGeometryOptions & React__default.RefAttributes<EntityRefShape>>;
272
273
 
273
- type Props$2 = {
274
+ type UnlitMaterialProps = {
274
275
  children?: React__default.ReactNode;
275
276
  id: string;
276
277
  } & SpatialUnlitMaterialOptions;
277
- declare const UnlitMaterial: React__default.FC<Props$2>;
278
+ declare const UnlitMaterial: React__default.FC<UnlitMaterialProps>;
278
279
 
279
- declare const SphereEntity: React__default.ForwardRefExoticComponent<EntityProps & EntityEventHandler & {
280
+ declare const SphereEntity: React__default.ForwardRefExoticComponent<EntityProps & {
280
281
  children?: React__default.ReactNode;
281
282
  materials?: string[];
282
283
  } & SpatialSphereGeometryOptions & React__default.RefAttributes<EntityRefShape>>;
283
284
 
284
- declare const ConeEntity: React__default.ForwardRefExoticComponent<EntityProps & EntityEventHandler & {
285
+ declare const ConeEntity: React__default.ForwardRefExoticComponent<EntityProps & {
285
286
  children?: React__default.ReactNode;
286
287
  materials?: string[];
287
288
  } & SpatialConeGeometryOptions & React__default.RefAttributes<EntityRefShape>>;
288
289
 
289
- declare const CylinderEntity: React__default.ForwardRefExoticComponent<EntityProps & EntityEventHandler & {
290
+ declare const CylinderEntity: React__default.ForwardRefExoticComponent<EntityProps & {
290
291
  children?: React__default.ReactNode;
291
292
  materials?: string[];
292
293
  } & SpatialCylinderGeometryOptions & React__default.RefAttributes<EntityRefShape>>;
293
294
 
294
- declare const PlaneEntity: React__default.ForwardRefExoticComponent<EntityProps & EntityEventHandler & {
295
+ declare const PlaneEntity: React__default.ForwardRefExoticComponent<EntityProps & {
295
296
  children?: React__default.ReactNode;
296
297
  materials?: string[];
297
298
  } & SpatialPlaneGeometryOptions & React__default.RefAttributes<EntityRefShape>>;
@@ -312,10 +313,11 @@ declare const ModelAsset: React__default.FC<Props>;
312
313
 
313
314
  declare const ModelEntity: React__default.ForwardRefExoticComponent<EntityProps & {
314
315
  model: string;
315
- } & EntityEventHandler & {
316
+ } & {
316
317
  children?: React__default.ReactNode;
317
318
  } & React__default.RefAttributes<EntityRefShape>>;
318
319
 
320
+ type RealityProps = React__default.ComponentPropsWithRef<'div'> & EntityEventHandler;
319
321
  declare const Reality: React__default.ForwardRefExoticComponent<Omit<RealityProps, "ref"> & React__default.RefAttributes<HTMLElement>>;
320
322
 
321
323
  type AttachmentAssetProps = {
@@ -324,16 +326,21 @@ type AttachmentAssetProps = {
324
326
  };
325
327
  declare const AttachmentAsset: React__default.FC<AttachmentAssetProps>;
326
328
 
327
- interface AttachmentEntityProps {
329
+ type AttachmentEntityProps = {
328
330
  attachment: string;
329
331
  position?: [number, number, number];
330
332
  size: {
331
333
  width: number;
332
334
  height: number;
333
335
  };
334
- }
336
+ };
335
337
  declare const AttachmentEntity: React__default.FC<AttachmentEntityProps>;
336
338
 
339
+ type MaterialProps = {
340
+ type: 'unlit';
341
+ } & UnlitMaterialProps;
342
+ declare const Material: React__default.FC<MaterialProps>;
343
+
337
344
  type ModelProps = SpatializedStatic3DContainerProps & {
338
345
  'enable-xr'?: boolean;
339
346
  };
@@ -351,6 +358,7 @@ declare const Model: React$1.ForwardRefExoticComponent<Omit<{
351
358
  src?: string;
352
359
  onLoad?: (event: ModelLoadEvent) => void;
353
360
  onError?: (event: ModelLoadEvent) => void;
361
+ spatialEventOptions?: SpatialEventOptions;
354
362
  } & {
355
363
  'enable-xr'?: boolean;
356
364
  } & React$1.RefAttributes<SpatializedStatic3DElementRef>, "ref"> & React$1.RefAttributes<any>>;
@@ -360,6 +368,26 @@ declare const SSRProvider: ({ isSSR: initialIsSSR, children, }: {
360
368
  children: React__default.ReactNode;
361
369
  }) => react_jsx_runtime.JSX.Element;
362
370
 
371
+ declare function useMetrics(): {
372
+ pointToPhysical: typeof PhysicalMetrics.pointToPhysical;
373
+ physicalToPoint: typeof PhysicalMetrics.physicalToPoint;
374
+ };
375
+
376
+ declare function createElement(...args: Parameters<typeof createElement$1>): React$1.DetailedReactHTMLElement<React$1.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
377
+
378
+ /**
379
+ * const e2e = await convertCoordinate(position, { from: elementOrEntity, to: elementOrEntity })
380
+ const e2w = await convertCoordinate(position, { from: elementOrEntity, to: window })
381
+ const w2e = await convertCoordinate(position, { from: window, to: elementOrEntity })
382
+ *
383
+ */
384
+
385
+ type CoordinateConvertible = Window | SpatializedElementRef<any> | EntityRef | ModelRef;
386
+ declare function convertCoordinate(position: Vec3, { from, to }: {
387
+ from: CoordinateConvertible;
388
+ to: CoordinateConvertible;
389
+ }): Promise<Vec3>;
390
+
363
391
  declare const version: string;
364
392
 
365
- export { AttachmentAsset, AttachmentEntity, 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 };
393
+ 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 };