@vincentt-xr/sdk 2.0.0-alpha.21 → 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 (96) hide show
  1. package/GROUNDING.md +138 -2
  2. package/components.json +61 -1
  3. package/dist/{CanonicalHeadFrame-CQe2YX9a.js → CanonicalHeadFrame-ZSfpHH_w.js} +3 -3
  4. package/dist/{DebuggerUI-CKYrYmod.js → DebuggerUI-C_c1B-2p.js} +1 -1
  5. package/dist/{FaceRetouch-l7y4oZBu.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-BOdSJUEM.js → bodyMaskMaterial-BF6Gm6hz.js} +1 -1
  9. package/dist/{cache-Mu-VO_6E.js → cache-CbX-0Rgn.js} +2 -2
  10. package/dist/components/Button/index.d.ts +1 -1
  11. package/dist/components/CaptureShareScreen/index.d.ts +27 -0
  12. package/dist/components/FaceSwap/settings.d.ts +1 -1
  13. package/dist/components/HtmlRegion/index.d.ts +1 -1
  14. package/dist/components/IntroScreen/index.d.ts +31 -0
  15. package/dist/components/Light/index.d.ts +1 -1
  16. package/dist/components/Model/index.d.ts +1 -1
  17. package/dist/components/Object3D/index.d.ts +1 -1
  18. package/dist/components/PaintedFace/index.d.ts +1 -1
  19. package/dist/components/ScreenShape/index.d.ts +8 -0
  20. package/dist/components/ScreenText/liveEditable.d.ts +1 -1
  21. package/dist/components/SplashScreen/index.d.ts +38 -0
  22. package/dist/components/TextLabel/TextLabel.d.ts +3 -0
  23. package/dist/components/index.d.ts +3 -0
  24. package/dist/contexts-awO81p6d.cjs +1 -0
  25. package/dist/contexts-hhxufDg2.js +714 -0
  26. package/dist/debug-ui/media-source.js +1 -1
  27. package/dist/debug-ui.cjs +1 -1
  28. package/dist/debug-ui.js +11 -11
  29. package/dist/{drawNormalizedCrop-D606u5-F.js → drawNormalizedCrop-8RzfrVNS.js} +5 -5
  30. package/dist/editor-defs/live.d.ts +28 -0
  31. package/dist/editor-defs/live.generated.d.ts +2 -0
  32. package/dist/editor-defs/types.d.ts +1 -1
  33. package/dist/editor-scenes.cjs +1 -1
  34. package/dist/editor-scenes.js +419 -40
  35. package/dist/entries/core.d.ts +10 -0
  36. package/dist/entries/editor-scenes.d.ts +1 -6
  37. package/dist/face-effects.cjs +67 -67
  38. package/dist/face-effects.js +1276 -1275
  39. package/dist/{getFaceInfo-Mt44zlej.js → getFaceInfo-B1pPvyh9.js} +1 -1
  40. package/dist/hooks/captureStore.d.ts +25 -0
  41. package/dist/hooks/useCapture.d.ts +28 -0
  42. package/dist/hooks/useShare.d.ts +37 -0
  43. package/dist/{index-CbBCl2ZU.js → index-BTVIMj8H.js} +2 -2
  44. package/dist/{index-BDxJWWyy.js → index-BmeB_V6I.js} +48 -48
  45. package/dist/{index-D5NbXaCn.js → index-CW4yk2jC.js} +272 -263
  46. package/dist/{index-B0EYdofX.js → index-Cw6HeUjE.js} +1 -1
  47. package/dist/{index-Bn72laBn.js → index-DSrRFuRp.js} +1 -1
  48. package/dist/{index-CM3jkleV.js → index-DTkbQ5OA.js} +27 -25
  49. package/dist/{index-CicO_Tnw.js → index-Dmhh2RjM.js} +1 -1
  50. package/dist/index-hEANh5cP.cjs +21 -0
  51. package/dist/{index-fDwL47CM.cjs → index-rCxTueDx.cjs} +2 -2
  52. package/dist/instructions.cjs +1 -1
  53. package/dist/instructions.js +8 -8
  54. package/dist/{internal-BoFDq5hC.js → internal-DDcTDvPS.js} +3 -3
  55. package/dist/internal.js +2 -2
  56. package/dist/{landmarks-C3LvDhMt.js → landmarks-BB8jyfJA.js} +1 -1
  57. package/dist/live.generated-Do4jgrUN.js +116 -0
  58. package/dist/live.generated-n5ZV_2Gt.cjs +1 -0
  59. package/dist/low-level.cjs +1 -1
  60. package/dist/low-level.js +17 -17
  61. package/dist/main.cjs +1 -1
  62. package/dist/main.js +1081 -884
  63. package/dist/overlay/consumer.d.ts +36 -0
  64. package/dist/overlay/grammar.d.ts +74 -0
  65. package/dist/overlay/region.d.ts +23 -0
  66. package/dist/particles.js +5 -5
  67. package/dist/product.js +2 -2
  68. package/dist/{providers-Bxt_MfPK.js → providers-Q4H0Ii-y.js} +3 -3
  69. package/dist/{renderGroups-uYPzUa66.js → renderGroups-LVQ0Af0t.js} +1 -1
  70. package/dist/{renderPasses-C0wu5Cwg.js → renderPasses-DYc2-EBT.js} +7 -7
  71. package/dist/scene-object.cjs +1 -1
  72. package/dist/scene-object.js +2 -2
  73. package/dist/{segmentation-DccvYBBO.js → segmentation-BWHRt2hE.js} +1 -1
  74. package/dist/{selectors-J06V0eDb.js → selectors-kj5g3uv2.js} +3 -3
  75. package/dist/{session-CYiWfcvz.js → session-CMz1ao3i.js} +1 -1
  76. package/dist/tracking.js +25 -25
  77. package/dist/{trigger-CQviD4xp.js → trigger-8fpI9g9S.js} +7 -7
  78. package/dist/{useBodies-DOuwRuew.js → useBodies-CH4ZUECn.js} +2 -2
  79. package/dist/useEditOverrides-BmvpLYPU.js +85 -0
  80. package/dist/useEditOverrides-DMAMGzlF.cjs +1 -0
  81. package/dist/{useFaceInfo-XUGYTdfN.js → useFaceInfo-BV77B-r4.js} +4 -4
  82. package/dist/{useFaceResultReader-D8wXbF1L.js → useFaceResultReader-DgOPK1Z6.js} +1 -1
  83. package/dist/{useIrisTracking-B0uLWgNE.js → useIrisTracking-D6mv7coz.js} +10 -10
  84. package/dist/useLiveProps-Bz9wifGN.cjs +1 -0
  85. package/dist/useLiveProps-CMkyV6Dt.js +28 -0
  86. package/dist/{useXRCapabilities-DPUOvpdf.js → useXRCapabilities-FAY2ve86.js} +1 -1
  87. package/dist/utils/useEditOverlay.d.ts +33 -0
  88. package/dist/utils/useEditOverrides.d.ts +10 -0
  89. package/dist/utils/useLiveProps.d.ts +8 -0
  90. package/package.json +1 -1
  91. package/settings.json +1 -1
  92. package/dist/contexts-CSz9stBV.cjs +0 -1
  93. package/dist/contexts-Cl-4dUOI.js +0 -667
  94. package/dist/index-BkjRuUdW.cjs +0 -21
  95. package/dist/useEditOverrides-BBkK8cN2.js +0 -41
  96. package/dist/useEditOverrides-CgapHJzA.cjs +0 -1
@@ -1,4 +1,4 @@
1
- import { F as f } from "./landmarks-C3LvDhMt.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, j as O, n as G } from "./index-BDxJWWyy.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 j, r as ee } from "./landmarks-C3LvDhMt.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
  {
@@ -3705,7 +3705,7 @@ export {
3705
3705
  Ln as Z,
3706
3706
  Xr as _,
3707
3707
  oa as a,
3708
- On 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,
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
3772
  la 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,
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,