@vincentt-xr/sdk 2.0.0-alpha.22 → 2.0.0-alpha.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/GROUNDING.md +138 -2
  2. package/components.json +61 -1
  3. package/dist/{CanonicalHeadFrame-S3Jk9F1P.js → CanonicalHeadFrame-ZSfpHH_w.js} +15 -15
  4. package/dist/{DebuggerUI-B8bheFk-.js → DebuggerUI-C_c1B-2p.js} +1 -1
  5. package/dist/{FaceRetouch-DW_9g5EA.js → FaceRetouch-4tV3RYa-.js} +4 -4
  6. package/dist/{TextLabel-C-AibH5A.cjs → TextLabel-DWBSNwRA.cjs} +2 -2
  7. package/dist/{TextLabel-fEF1o3wE.js → TextLabel-XSfkeWDJ.js} +172 -172
  8. package/dist/{bodyMaskMaterial-CUlzyXnJ.js → bodyMaskMaterial-BF6Gm6hz.js} +1 -1
  9. package/dist/cache-CbX-0Rgn.js +212 -0
  10. package/dist/cache-DFqZYsHC.cjs +1 -0
  11. package/dist/components/CaptureShareScreen/index.d.ts +27 -0
  12. package/dist/components/HtmlRegion/index.d.ts +1 -1
  13. package/dist/components/IntroScreen/index.d.ts +31 -0
  14. package/dist/components/ScreenShape/index.d.ts +8 -0
  15. package/dist/components/SplashScreen/index.d.ts +38 -0
  16. package/dist/components/TextLabel/TextLabel.d.ts +3 -0
  17. package/dist/components/index.d.ts +3 -0
  18. package/dist/contexts-awO81p6d.cjs +1 -0
  19. package/dist/contexts-hhxufDg2.js +714 -0
  20. package/dist/debug-ui/media-source.js +1 -1
  21. package/dist/debug-ui.cjs +1 -1
  22. package/dist/debug-ui.js +11 -11
  23. package/dist/{drawNormalizedCrop-D48Layv4.js → drawNormalizedCrop-8RzfrVNS.js} +14 -14
  24. package/dist/editor-defs/live.d.ts +10 -0
  25. package/dist/editor-defs/types.d.ts +1 -1
  26. package/dist/editor-scenes.cjs +1 -1
  27. package/dist/editor-scenes.js +419 -40
  28. package/dist/entries/core.d.ts +10 -0
  29. package/dist/entries/editor-scenes.d.ts +1 -6
  30. package/dist/face-effects.cjs +78 -78
  31. package/dist/face-effects.js +277 -276
  32. package/dist/{getFaceInfo-e9XzHPLC.js → getFaceInfo-B1pPvyh9.js} +1 -1
  33. package/dist/hooks/captureStore.d.ts +25 -0
  34. package/dist/hooks/useCapture.d.ts +28 -0
  35. package/dist/hooks/useShare.d.ts +37 -0
  36. package/dist/{index-Dk1UOe-H.js → index-BTVIMj8H.js} +10 -10
  37. package/dist/{index-MzlPbe9t.js → index-BmeB_V6I.js} +57 -57
  38. package/dist/{index-B9ph9k5I.js → index-CW4yk2jC.js} +272 -263
  39. package/dist/{index-em1AaMkI.js → index-Cw6HeUjE.js} +1 -1
  40. package/dist/{index-BKZPBg1D.js → index-DSrRFuRp.js} +1 -1
  41. package/dist/{index-DCjFgbB8.js → index-DTkbQ5OA.js} +24 -24
  42. package/dist/{index-B34w-TyW.js → index-Dmhh2RjM.js} +1 -1
  43. package/dist/index-hEANh5cP.cjs +21 -0
  44. package/dist/{index-DSMv6GWI.cjs → index-rCxTueDx.cjs} +1 -1
  45. package/dist/instructions.cjs +1 -1
  46. package/dist/instructions.js +8 -8
  47. package/dist/{internal-kwJxojDs.js → internal-DDcTDvPS.js} +3 -3
  48. package/dist/internal.js +2 -2
  49. package/dist/{landmarks-BgLF-yfd.js → landmarks-BB8jyfJA.js} +6 -6
  50. package/dist/live.generated-Do4jgrUN.js +116 -0
  51. package/dist/live.generated-n5ZV_2Gt.cjs +1 -0
  52. package/dist/low-level.cjs +1 -1
  53. package/dist/low-level.js +17 -17
  54. package/dist/main.cjs +1 -1
  55. package/dist/main.js +1074 -878
  56. package/dist/overlay/consumer.d.ts +36 -0
  57. package/dist/overlay/grammar.d.ts +74 -0
  58. package/dist/overlay/region.d.ts +23 -0
  59. package/dist/particles.js +5 -5
  60. package/dist/product.js +2 -2
  61. package/dist/{providers-Bo1gfoXg.js → providers-Q4H0Ii-y.js} +3 -3
  62. package/dist/{renderGroups-Cul4eOG8.js → renderGroups-LVQ0Af0t.js} +1 -1
  63. package/dist/{renderPasses-CLOTeP38.js → renderPasses-DYc2-EBT.js} +43 -43
  64. package/dist/scene-object.cjs +1 -1
  65. package/dist/scene-object.js +2 -2
  66. package/dist/{segmentation-Q1eXSt_x.js → segmentation-BWHRt2hE.js} +1 -1
  67. package/dist/{selectors-CiawE6Ox.js → selectors-kj5g3uv2.js} +6 -6
  68. package/dist/{session-CmpigDxI.js → session-CMz1ao3i.js} +9 -9
  69. package/dist/tracking.js +127 -127
  70. package/dist/{trigger-BHKfnvtB.js → trigger-8fpI9g9S.js} +7 -7
  71. package/dist/{useBodies-DzRzQg88.js → useBodies-CH4ZUECn.js} +7 -7
  72. package/dist/useEditOverrides-BmvpLYPU.js +85 -0
  73. package/dist/useEditOverrides-DMAMGzlF.cjs +1 -0
  74. package/dist/{useFaceInfo-DUxqnPek.js → useFaceInfo-BV77B-r4.js} +10 -10
  75. package/dist/{useFaceResultReader-DSnUjQcw.js → useFaceResultReader-DgOPK1Z6.js} +1 -1
  76. package/dist/{useIrisTracking-Bfp1Fv66.js → useIrisTracking-D6mv7coz.js} +10 -10
  77. package/dist/useLiveProps-Bz9wifGN.cjs +1 -0
  78. package/dist/useLiveProps-CMkyV6Dt.js +28 -0
  79. package/dist/{useXRCapabilities-BhN_CKwJ.js → useXRCapabilities-FAY2ve86.js} +1 -1
  80. package/dist/utils/useEditOverlay.d.ts +33 -0
  81. package/dist/utils/useEditOverrides.d.ts +6 -0
  82. package/package.json +1 -1
  83. package/settings.json +1 -1
  84. package/dist/cache-CsH3zPDX.js +0 -307
  85. package/dist/cache-DrEDi7qn.cjs +0 -1
  86. package/dist/contexts-CSz9stBV.cjs +0 -1
  87. package/dist/contexts-C_l5hzI8.js +0 -667
  88. package/dist/index-BkjRuUdW.cjs +0 -21
  89. package/dist/useEditOverrides-BBkK8cN2.js +0 -41
  90. package/dist/useEditOverrides-CgapHJzA.cjs +0 -1
@@ -1,4 +1,4 @@
1
- import { F as f } from "./landmarks-BgLF-yfd.js";
1
+ import { F as f } from "./landmarks-BB8jyfJA.js";
2
2
  const x = (s, e = {
3
3
  minX: 0,
4
4
  minY: 0,
@@ -0,0 +1,25 @@
1
+ export interface CapturedMedia {
2
+ kind: "photo" | "video";
3
+ /** Raw bytes: upload it, or hand it to `useShare`. */
4
+ blob: Blob;
5
+ /** Object URL for `<img src>` / `<video src>`; revoked when the capture is replaced or cleared. */
6
+ url: string;
7
+ }
8
+ type Listener = () => void;
9
+ /**
10
+ * The most recent capture of this page, shared by every `useCapture()` so a Button's "take photo"
11
+ * handler and a `CaptureShareScreen` see the same photo. Runtime only: never an editor value.
12
+ */
13
+ export declare const captureStore: {
14
+ get: () => CapturedMedia | null;
15
+ subscribe(listener: Listener): () => void;
16
+ set(kind: CapturedMedia["kind"], blob: Blob): CapturedMedia;
17
+ clear(): void;
18
+ };
19
+ /**
20
+ * Whether the page has a live user gesture (a tap or click in the last few seconds). Browsers
21
+ * without the User Activation API return true: the browser itself still enforces the gesture
22
+ * for `navigator.share`.
23
+ */
24
+ export declare function hasUserGesture(nav?: Navigator): boolean;
25
+ export {};
@@ -0,0 +1,28 @@
1
+ import { CapturedMedia } from './captureStore';
2
+ export type { CapturedMedia } from './captureStore';
3
+ export interface UseCaptureOptions {
4
+ /** Add the microphone to video. Default: silent, so no permission prompt. */
5
+ audio?: boolean;
6
+ /** Override the frame grab (custom renderers, tests). Default: `session.captureFrame`. */
7
+ captureFrame?: () => string;
8
+ /** Override the canvas stream used for video. Default: `session.captureStream`. */
9
+ captureStream?: (fps?: number) => MediaStream;
10
+ onError?: (error: Error) => void;
11
+ }
12
+ /**
13
+ * Photo and video capture of the live canvas. Call `takePhoto` / `startVideo` from a tap or click
14
+ * handler (a Button's `onTap` works): a call with no live user gesture does nothing and returns
15
+ * `null`. The newest capture is shared page-wide as `latest`, which `CaptureShareScreen` shows.
16
+ * Nothing here is an editor value.
17
+ */
18
+ export declare function useCapture(options?: UseCaptureOptions): {
19
+ takePhoto: () => Promise<CapturedMedia | null>;
20
+ startVideo: () => Promise<void>;
21
+ stopVideo: () => void;
22
+ isRecording: boolean;
23
+ /** The newest capture on the page, or null. */
24
+ latest: CapturedMedia | null;
25
+ /** Drops the capture (the viewer's retake). */
26
+ clear: () => void;
27
+ error: Error | null;
28
+ };
@@ -0,0 +1,37 @@
1
+ import { CapturedMedia } from './captureStore';
2
+ /**
3
+ * How a share went: `shared` the native sheet took it, `dismissed` the viewer closed the sheet
4
+ * (nothing else happens), `downloaded` the browser cannot share files so the file was saved
5
+ * instead, `blocked` there was no user gesture so nothing ran.
6
+ */
7
+ export type ShareOutcome = "shared" | "dismissed" | "downloaded" | "blocked";
8
+ export interface ShareOptions {
9
+ /** Caption in the share sheet. */
10
+ text?: string;
11
+ /** Appended to the share; only an `https://` link is used. */
12
+ url?: string;
13
+ title?: string;
14
+ /** Defaults to `capture.<ext>` from the blob's type. */
15
+ filename?: string;
16
+ }
17
+ export declare function httpsOnly(url: unknown): string | undefined;
18
+ type ShareNavigator = Navigator & {
19
+ share?: (data: ShareData) => Promise<void>;
20
+ canShare?: (data: ShareData) => boolean;
21
+ };
22
+ /** Whether this browser can share `file` through the native sheet (secure context + canShare). */
23
+ export declare function canShareFile(file: File, nav?: ShareNavigator): boolean;
24
+ export declare function downloadFile(file: File): void;
25
+ /**
26
+ * Share a capture. Call it from a tap or click handler: the Web Share API needs a user gesture,
27
+ * and file sharing also needs a secure context and `navigator.canShare({ files })`. Where that is
28
+ * missing the file is downloaded instead. Safe to call from a Button's `onTap`.
29
+ */
30
+ export declare function shareCapture(media: Pick<CapturedMedia, "blob">, options?: ShareOptions): Promise<ShareOutcome>;
31
+ /** `{ share, save }` for a capture; both are callable from a tap or click handler. */
32
+ export declare function useShare(): {
33
+ share: (media: Pick<CapturedMedia, "blob">, options?: ShareOptions) => Promise<ShareOutcome>;
34
+ save: (media: Pick<CapturedMedia, "blob">, filename?: string) => boolean;
35
+ canShareFile: typeof canShareFile;
36
+ };
37
+ export {};
@@ -2,9 +2,9 @@ import { jsx as v, jsxs as D } from "react/jsx-runtime";
2
2
  import { useThree as U, useFrame as P } from "@react-three/fiber";
3
3
  import L, { useRef as m, useMemo as g, useEffect as K, useContext as W, createContext as X, useCallback as I } from "react";
4
4
  import * as R from "three";
5
- import { o as Y, f as O, n as G } from "./index-MzlPbe9t.js";
5
+ import { o as Y, j as O, n as G } from "./index-BmeB_V6I.js";
6
6
  import { a as Q, F as J, R as $ } from "./uv-DJU_XfmN.js";
7
- import { u as H, r as ee } from "./landmarks-BgLF-yfd.js";
7
+ import { u as j, r as ee } from "./landmarks-BB8jyfJA.js";
8
8
  const te = ({ materialProps: e, settings: t }) => t.type === "basic" ? /* @__PURE__ */ v("meshBasicMaterial", { ...e }) : /* @__PURE__ */ v(
9
9
  "meshStandardMaterial",
10
10
  {
@@ -30,21 +30,21 @@ const te = ({ materialProps: e, settings: t }) => t.type === "basic" ? /* @__PUR
30
30
  r[o] = d.x, r[o + 1] = d.y, r[o + 2] = d.z;
31
31
  }
32
32
  return M;
33
- }, V = 468, se = V * 3, ae = {
33
+ }, H = 468, se = H * 3, ae = {
34
34
  type: "standard",
35
35
  color: "#ffffff",
36
36
  opacity: 1,
37
37
  wireframe: !1,
38
38
  roughness: 1,
39
39
  metalness: 0
40
- }, j = ({
40
+ }, V = ({
41
41
  material: e,
42
42
  faceIndex: t = 0,
43
43
  numFaces: r,
44
44
  visible: a = !0,
45
45
  children: s
46
46
  }) => {
47
- const { ready: d, node: M } = H(
47
+ const { ready: d, node: M } = j(
48
48
  O.FACE_TRACKER,
49
49
  r === void 0 ? void 0 : { numFaces: r }
50
50
  ), { camera: h } = U(), o = m(null), b = m(null), x = m(null), p = m(null), C = m(null), E = m(new R.Vector3()), u = g(() => {
@@ -76,7 +76,7 @@ const te = ({ materialProps: e, settings: t }) => t.type === "basic" ? /* @__PUR
76
76
  }
77
77
  c.getAttribute("position") !== n && (c.setAttribute("position", n), c.setAttribute("uv", C.current), c.setIndex(p.current)), c.drawRange.count === 0 && c.setDrawRange(0, 1 / 0), oe(
78
78
  f,
79
- V,
79
+ H,
80
80
  y,
81
81
  h,
82
82
  ne,
@@ -102,7 +102,7 @@ const te = ({ materialProps: e, settings: t }) => t.type === "basic" ? /* @__PUR
102
102
  !e && _ ? s : null
103
103
  ] });
104
104
  };
105
- j.displayName = "FaceMesh";
105
+ V.displayName = "FaceMesh";
106
106
  const Z = X(null), ye = () => W(Z), N = new R.Euler(), ce = ({
107
107
  faceIndex: e = 0,
108
108
  numFaces: t,
@@ -118,7 +118,7 @@ const Z = X(null), ye = () => W(Z), N = new R.Euler(), ce = ({
118
118
  ...t === void 0 ? {} : { numFaces: t },
119
119
  ...s === void 0 ? {} : { targetFps: s }
120
120
  };
121
- }, [t, s]), { ready: x, node: p } = H(
121
+ }, [t, s]), { ready: x, node: p } = j(
122
122
  O.FACE_TRACKER,
123
123
  b,
124
124
  d
@@ -173,7 +173,7 @@ const Z = X(null), ye = () => W(Z), N = new R.Euler(), ce = ({
173
173
  /* @__PURE__ */ v("group", { ref: o, renderOrder: $.TRACKED, children: y }),
174
174
  c
175
175
  ] });
176
- }, q = (e) => /* @__PURE__ */ v(j, { ...e });
176
+ }, q = (e) => /* @__PURE__ */ v(V, { ...e });
177
177
  q.displayName = "FaceTracker.Mesh";
178
178
  const B = ce;
179
179
  B.Mesh = q;
@@ -183,7 +183,7 @@ export {
183
183
  Ee as H,
184
184
  te as M,
185
185
  Z as T,
186
- j as a,
186
+ V as a,
187
187
  he as p,
188
188
  Ae as t,
189
189
  ye as u
@@ -3681,7 +3681,7 @@ export {
3681
3681
  ye as B,
3682
3682
  me as C,
3683
3683
  ta as D,
3684
- Nn as E,
3684
+ ts as E,
3685
3685
  na as F,
3686
3686
  Ti as G,
3687
3687
  fi as H,
@@ -3704,8 +3704,8 @@ export {
3704
3704
  sn as Y,
3705
3705
  Ln as Z,
3706
3706
  Xr as _,
3707
- ea as a,
3708
- On as a$,
3707
+ oa as a,
3708
+ yr as a$,
3709
3709
  Bn as a0,
3710
3710
  $s as a1,
3711
3711
  $e as a2,
@@ -3716,33 +3716,33 @@ export {
3716
3716
  Vi as a7,
3717
3717
  mn as a8,
3718
3718
  ss as a9,
3719
- Rr as aA,
3720
- Or as aB,
3721
- Yt as aC,
3722
- Fr as aD,
3723
- Ir as aE,
3724
- Pr as aF,
3725
- _r as aG,
3726
- kr as aH,
3727
- Ar as aI,
3728
- Lr as aJ,
3729
- Dn as aK,
3730
- Tr as aL,
3731
- Br as aM,
3732
- Er as aN,
3733
- Cr as aO,
3734
- Dr as aP,
3735
- Nr as aQ,
3736
- Wr as aR,
3737
- xn as aS,
3738
- Hr as aT,
3739
- Ur as aU,
3740
- wr as aV,
3741
- vr as aW,
3742
- xr as aX,
3743
- Sr as aY,
3744
- qr as aZ,
3745
- yr as a_,
3719
+ ha as aA,
3720
+ Pn as aB,
3721
+ Rr as aC,
3722
+ Or as aD,
3723
+ Yt as aE,
3724
+ Ir as aF,
3725
+ Pr as aG,
3726
+ _r as aH,
3727
+ kr as aI,
3728
+ Ar as aJ,
3729
+ Lr as aK,
3730
+ Dn as aL,
3731
+ Tr as aM,
3732
+ Br as aN,
3733
+ Er as aO,
3734
+ Cr as aP,
3735
+ Dr as aQ,
3736
+ Nr as aR,
3737
+ Wr as aS,
3738
+ xn as aT,
3739
+ Hr as aU,
3740
+ Ur as aV,
3741
+ wr as aW,
3742
+ vr as aX,
3743
+ xr as aY,
3744
+ Sr as aZ,
3745
+ qr as a_,
3746
3746
  Ji as aa,
3747
3747
  tr as ab,
3748
3748
  Qi as ac,
@@ -3761,27 +3761,27 @@ export {
3761
3761
  bn as ap,
3762
3762
  Cn as aq,
3763
3763
  kn as ar,
3764
- tt as as,
3765
- Kt as at,
3766
- mr as au,
3767
- fr as av,
3768
- gr as aw,
3769
- pr as ax,
3770
- ha as ay,
3771
- Pn as az,
3772
- Vr as b,
3773
- zr as b0,
3774
- Yr as b1,
3775
- Qr as b2,
3776
- li as b3,
3777
- mi as b4,
3778
- zt as b5,
3779
- cn as b6,
3780
- Wt as b7,
3781
- Z as b8,
3782
- Gi as b9,
3783
- nr as ba,
3784
- ia as bb,
3764
+ ia as as,
3765
+ Fr as at,
3766
+ tt as au,
3767
+ Kt as av,
3768
+ mr as aw,
3769
+ fr as ax,
3770
+ gr as ay,
3771
+ pr as az,
3772
+ la as b,
3773
+ On as b0,
3774
+ zr as b1,
3775
+ Yr as b2,
3776
+ Qr as b3,
3777
+ li as b4,
3778
+ mi as b5,
3779
+ zt as b6,
3780
+ cn as b7,
3781
+ Wt as b8,
3782
+ Z as b9,
3783
+ Gi as ba,
3784
+ nr as bb,
3785
3785
  Jr as bc,
3786
3786
  Vn as bd,
3787
3787
  Zn as be,
@@ -3789,13 +3789,13 @@ export {
3789
3789
  te as bg,
3790
3790
  vn as c,
3791
3791
  dr as d,
3792
- Gr as e,
3793
- P as f,
3794
- Zr as g,
3795
- oa as h,
3792
+ ea as e,
3793
+ Nn as f,
3794
+ Vr as g,
3795
+ Gr as h,
3796
3796
  Se as i,
3797
- la as j,
3798
- ts as k,
3797
+ P as j,
3798
+ Zr as k,
3799
3799
  ca as l,
3800
3800
  ur as m,
3801
3801
  Hn as n,