@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.
- package/GROUNDING.md +138 -2
- package/components.json +61 -1
- package/dist/{CanonicalHeadFrame-CQe2YX9a.js → CanonicalHeadFrame-ZSfpHH_w.js} +3 -3
- package/dist/{DebuggerUI-CKYrYmod.js → DebuggerUI-C_c1B-2p.js} +1 -1
- package/dist/{FaceRetouch-l7y4oZBu.js → FaceRetouch-4tV3RYa-.js} +4 -4
- package/dist/{TextLabel-C-AibH5A.cjs → TextLabel-DWBSNwRA.cjs} +2 -2
- package/dist/{TextLabel-fEF1o3wE.js → TextLabel-XSfkeWDJ.js} +172 -172
- package/dist/{bodyMaskMaterial-BOdSJUEM.js → bodyMaskMaterial-BF6Gm6hz.js} +1 -1
- package/dist/{cache-Mu-VO_6E.js → cache-CbX-0Rgn.js} +2 -2
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/CaptureShareScreen/index.d.ts +27 -0
- package/dist/components/FaceSwap/settings.d.ts +1 -1
- package/dist/components/HtmlRegion/index.d.ts +1 -1
- package/dist/components/IntroScreen/index.d.ts +31 -0
- package/dist/components/Light/index.d.ts +1 -1
- package/dist/components/Model/index.d.ts +1 -1
- package/dist/components/Object3D/index.d.ts +1 -1
- package/dist/components/PaintedFace/index.d.ts +1 -1
- package/dist/components/ScreenShape/index.d.ts +8 -0
- package/dist/components/ScreenText/liveEditable.d.ts +1 -1
- package/dist/components/SplashScreen/index.d.ts +38 -0
- package/dist/components/TextLabel/TextLabel.d.ts +3 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/contexts-awO81p6d.cjs +1 -0
- package/dist/contexts-hhxufDg2.js +714 -0
- package/dist/debug-ui/media-source.js +1 -1
- package/dist/debug-ui.cjs +1 -1
- package/dist/debug-ui.js +11 -11
- package/dist/{drawNormalizedCrop-D606u5-F.js → drawNormalizedCrop-8RzfrVNS.js} +5 -5
- package/dist/editor-defs/live.d.ts +28 -0
- package/dist/editor-defs/live.generated.d.ts +2 -0
- package/dist/editor-defs/types.d.ts +1 -1
- package/dist/editor-scenes.cjs +1 -1
- package/dist/editor-scenes.js +419 -40
- package/dist/entries/core.d.ts +10 -0
- package/dist/entries/editor-scenes.d.ts +1 -6
- package/dist/face-effects.cjs +67 -67
- package/dist/face-effects.js +1276 -1275
- package/dist/{getFaceInfo-Mt44zlej.js → getFaceInfo-B1pPvyh9.js} +1 -1
- package/dist/hooks/captureStore.d.ts +25 -0
- package/dist/hooks/useCapture.d.ts +28 -0
- package/dist/hooks/useShare.d.ts +37 -0
- package/dist/{index-CbBCl2ZU.js → index-BTVIMj8H.js} +2 -2
- package/dist/{index-BDxJWWyy.js → index-BmeB_V6I.js} +48 -48
- package/dist/{index-D5NbXaCn.js → index-CW4yk2jC.js} +272 -263
- package/dist/{index-B0EYdofX.js → index-Cw6HeUjE.js} +1 -1
- package/dist/{index-Bn72laBn.js → index-DSrRFuRp.js} +1 -1
- package/dist/{index-CM3jkleV.js → index-DTkbQ5OA.js} +27 -25
- package/dist/{index-CicO_Tnw.js → index-Dmhh2RjM.js} +1 -1
- package/dist/index-hEANh5cP.cjs +21 -0
- package/dist/{index-fDwL47CM.cjs → index-rCxTueDx.cjs} +2 -2
- package/dist/instructions.cjs +1 -1
- package/dist/instructions.js +8 -8
- package/dist/{internal-BoFDq5hC.js → internal-DDcTDvPS.js} +3 -3
- package/dist/internal.js +2 -2
- package/dist/{landmarks-C3LvDhMt.js → landmarks-BB8jyfJA.js} +1 -1
- package/dist/live.generated-Do4jgrUN.js +116 -0
- package/dist/live.generated-n5ZV_2Gt.cjs +1 -0
- package/dist/low-level.cjs +1 -1
- package/dist/low-level.js +17 -17
- package/dist/main.cjs +1 -1
- package/dist/main.js +1081 -884
- package/dist/overlay/consumer.d.ts +36 -0
- package/dist/overlay/grammar.d.ts +74 -0
- package/dist/overlay/region.d.ts +23 -0
- package/dist/particles.js +5 -5
- package/dist/product.js +2 -2
- package/dist/{providers-Bxt_MfPK.js → providers-Q4H0Ii-y.js} +3 -3
- package/dist/{renderGroups-uYPzUa66.js → renderGroups-LVQ0Af0t.js} +1 -1
- package/dist/{renderPasses-C0wu5Cwg.js → renderPasses-DYc2-EBT.js} +7 -7
- package/dist/scene-object.cjs +1 -1
- package/dist/scene-object.js +2 -2
- package/dist/{segmentation-DccvYBBO.js → segmentation-BWHRt2hE.js} +1 -1
- package/dist/{selectors-J06V0eDb.js → selectors-kj5g3uv2.js} +3 -3
- package/dist/{session-CYiWfcvz.js → session-CMz1ao3i.js} +1 -1
- package/dist/tracking.js +25 -25
- package/dist/{trigger-CQviD4xp.js → trigger-8fpI9g9S.js} +7 -7
- package/dist/{useBodies-DOuwRuew.js → useBodies-CH4ZUECn.js} +2 -2
- package/dist/useEditOverrides-BmvpLYPU.js +85 -0
- package/dist/useEditOverrides-DMAMGzlF.cjs +1 -0
- package/dist/{useFaceInfo-XUGYTdfN.js → useFaceInfo-BV77B-r4.js} +4 -4
- package/dist/{useFaceResultReader-D8wXbF1L.js → useFaceResultReader-DgOPK1Z6.js} +1 -1
- package/dist/{useIrisTracking-B0uLWgNE.js → useIrisTracking-D6mv7coz.js} +10 -10
- package/dist/useLiveProps-Bz9wifGN.cjs +1 -0
- package/dist/useLiveProps-CMkyV6Dt.js +28 -0
- package/dist/{useXRCapabilities-DPUOvpdf.js → useXRCapabilities-FAY2ve86.js} +1 -1
- package/dist/utils/useEditOverlay.d.ts +33 -0
- package/dist/utils/useEditOverrides.d.ts +10 -0
- package/dist/utils/useLiveProps.d.ts +8 -0
- package/package.json +1 -1
- package/settings.json +1 -1
- package/dist/contexts-CSz9stBV.cjs +0 -1
- package/dist/contexts-Cl-4dUOI.js +0 -667
- package/dist/index-BkjRuUdW.cjs +0 -21
- package/dist/useEditOverrides-BBkK8cN2.js +0 -41
- package/dist/useEditOverrides-CgapHJzA.cjs +0 -1
|
@@ -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-
|
|
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-
|
|
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
|
-
|
|
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
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
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
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
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
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
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,
|