@vincentt-xr/sdk 2.0.0-alpha.17 → 2.0.0-alpha.19
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 +225 -0
- package/components.json +221 -0
- package/dist/{CanonicalHeadFrame-vn-jM9fG.js → CanonicalHeadFrame-CQe2YX9a.js} +3 -3
- package/dist/{DebuggerUI-DDpU-nBF.js → DebuggerUI-CKYrYmod.js} +1 -1
- package/dist/{FaceRetouch-D2xH5OpW.js → FaceRetouch-l7y4oZBu.js} +4 -4
- package/dist/Scenes-BX0bR1j4.js +44 -0
- package/dist/Scenes-Dtt8UGE8.cjs +1 -0
- package/dist/audio/AudioPlayer.d.ts +2 -1
- package/dist/{bodyMaskMaterial-C3aXItLo.js → bodyMaskMaterial-BOdSJUEM.js} +1 -1
- package/dist/{cache-C85JjyZA.js → cache-Mu-VO_6E.js} +2 -2
- package/dist/components/Button/index.d.ts +23 -0
- package/dist/components/Button/safeLink.d.ts +6 -0
- package/dist/components/HtmlRegion/index.d.ts +8 -0
- package/dist/components/Light/index.d.ts +26 -0
- package/dist/components/Model/index.d.ts +16 -0
- package/dist/components/Object3D/index.d.ts +13 -0
- package/dist/components/PaintedFace/index.d.ts +24 -0
- package/dist/components/ScreenImage/types.d.ts +2 -2
- package/dist/components/ScreenText/types.d.ts +2 -1
- package/dist/components/ThemeProvider/index.d.ts +24 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/{contexts-B5GODwuV.js → contexts-Cl-4dUOI.js} +2 -2
- 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-BLfB484W.js → drawNormalizedCrop-D606u5-F.js} +5 -5
- package/dist/editor-defs/definitions.d.ts +2 -0
- package/dist/editor-defs/index.d.ts +3 -0
- package/dist/editor-defs/types.d.ts +54 -0
- package/dist/editor-sample/sample.d.ts +15 -0
- package/dist/editor-scenes.cjs +1 -1
- package/dist/editor-scenes.js +39 -25
- package/dist/entries/core.d.ts +13 -1
- package/dist/entries/face-effects.d.ts +2 -0
- package/dist/face-effects.cjs +68 -68
- package/dist/face-effects.js +1353 -1333
- package/dist/{getFaceInfo-D_tCSQC7.js → getFaceInfo-Mt44zlej.js} +1 -1
- package/dist/{index-B9DdHE4u.js → index-B0EYdofX.js} +1 -1
- package/dist/{index-CTqQJj5p.js → index-BDxJWWyy.js} +85 -85
- package/dist/{index-DlP4xxaT.js → index-Bn72laBn.js} +4 -4
- package/dist/{index-Otoo-rph.js → index-CM3jkleV.js} +240 -223
- package/dist/{index-D10O6vqR.js → index-CbBCl2ZU.js} +2 -2
- package/dist/{index-CNt8esFO.js → index-CicO_Tnw.js} +1 -1
- package/dist/{index-Z5eKEUdE.js → index-D5NbXaCn.js} +4 -4
- package/dist/{index-D_pgrgJg.cjs → index-fDwL47CM.cjs} +3 -3
- package/dist/instructions.js +7 -7
- package/dist/{internal-TD4QhIry.js → internal-BoFDq5hC.js} +3 -3
- package/dist/internal.js +2 -2
- package/dist/{landmarks-vLy5QKt6.js → landmarks-C3LvDhMt.js} +1 -1
- package/dist/low-level.js +17 -17
- package/dist/main.cjs +1 -1
- package/dist/main.js +1046 -814
- package/dist/particles.js +5 -5
- package/dist/product.js +2 -2
- package/dist/{providers-DmJlgrDD.js → providers-Bxt_MfPK.js} +3 -3
- package/dist/{renderGroups-BcQYy_J2.js → renderGroups-uYPzUa66.js} +1 -1
- package/dist/{renderPasses-DIPTIU_x.js → renderPasses-C0wu5Cwg.js} +4 -4
- package/dist/scene-object.js +2 -2
- package/dist/scenes/Scenes.d.ts +17 -0
- package/dist/scenes/edit.d.ts +9 -1
- package/dist/{segmentation-CZs5aVvY.js → segmentation-DccvYBBO.js} +9 -9
- package/dist/{selectors-K5JKCWxw.js → selectors-J06V0eDb.js} +1 -1
- package/dist/{session-DHBNTyJJ.js → session-CYiWfcvz.js} +1 -1
- package/dist/tracking.js +25 -25
- package/dist/{trigger-BwZ81ENx.js → trigger-CQviD4xp.js} +155 -155
- package/dist/{useBodies-BMKHXAOL.js → useBodies-DOuwRuew.js} +2 -2
- package/dist/{useFaceInfo-BNVdnprN.js → useFaceInfo-XUGYTdfN.js} +4 -4
- package/dist/{useFaceResultReader-B15wn6RB.js → useFaceResultReader-D8wXbF1L.js} +1 -1
- package/dist/{useIrisTracking-CYm-KDIZ.js → useIrisTracking-B0uLWgNE.js} +10 -10
- package/dist/{useXRCapabilities-ClWlG5_Y.js → useXRCapabilities-DPUOvpdf.js} +1 -1
- package/package.json +6 -2
- package/settings.json +1 -1
- package/dist/Scenes-B30XZfTq.js +0 -29
- package/dist/Scenes-BLL7YvLw.cjs +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useFrame as V } from "@react-three/fiber";
|
|
2
2
|
import { useState as b, useMemo as Z, useEffect as $, useRef as k } from "react";
|
|
3
3
|
import * as x from "three";
|
|
4
|
-
import { c as v, p as W, a as tt, b as et, s as rt } from "./bodyMaskMaterial-
|
|
5
|
-
import { j as C, X as st } from "./index-
|
|
6
|
-
import { b as j } from "./selectors-
|
|
7
|
-
import { u as it } from "./useBodies-
|
|
8
|
-
import { u as nt } from "./landmarks-
|
|
4
|
+
import { c as v, p as W, a as tt, b as et, s as rt } from "./bodyMaskMaterial-BOdSJUEM.js";
|
|
5
|
+
import { j as C, X as st } from "./index-BDxJWWyy.js";
|
|
6
|
+
import { b as j } from "./selectors-J06V0eDb.js";
|
|
7
|
+
import { u as it } from "./useBodies-DOuwRuew.js";
|
|
8
|
+
import { u as nt } from "./landmarks-C3LvDhMt.js";
|
|
9
9
|
const wt = { left: -1, right: 1, top: 1, bottom: -1 }, at = ({
|
|
10
10
|
ready: t,
|
|
11
11
|
error: e,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** Schema id of the components definitions file the SDK emits (`components.json`). */
|
|
2
|
+
export declare const COMPONENTS_SCHEMA = "vincentt.components/1";
|
|
3
|
+
export type ComponentKind = "text" | "image" | "button" | "model" | "light" | "object3d" | "facetexture" | "sound" | "region" | "scene";
|
|
4
|
+
export type Control = "shortText" | "longText" | "file" | "colour" | "number" | "switch" | "choice" | "link" | "date" | "code" | "markup";
|
|
5
|
+
export type AssetAccept = "image" | "model" | "audio" | "video" | "font";
|
|
6
|
+
export interface PropDef {
|
|
7
|
+
control: Control;
|
|
8
|
+
label: string;
|
|
9
|
+
group?: string;
|
|
10
|
+
showWhenAbsent?: boolean;
|
|
11
|
+
min?: number;
|
|
12
|
+
max?: number;
|
|
13
|
+
step?: number;
|
|
14
|
+
unit?: string;
|
|
15
|
+
options?: string[];
|
|
16
|
+
maxLength?: number;
|
|
17
|
+
accept?: AssetAccept;
|
|
18
|
+
}
|
|
19
|
+
export interface ComponentDef {
|
|
20
|
+
kind: ComponentKind;
|
|
21
|
+
label: string;
|
|
22
|
+
tree: "3d" | "html" | "both";
|
|
23
|
+
/** Import path the component is exported from. */
|
|
24
|
+
from: string;
|
|
25
|
+
nameFrom: "text" | "label" | "file" | "fixed";
|
|
26
|
+
props: Record<string, PropDef>;
|
|
27
|
+
/** Text carried in JSX children. */
|
|
28
|
+
children?: {
|
|
29
|
+
control: "shortText" | "longText";
|
|
30
|
+
};
|
|
31
|
+
place?: "position3" | "screenTransform" | "transform";
|
|
32
|
+
/** Literal-only template the editor inserts. */
|
|
33
|
+
insert?: {
|
|
34
|
+
jsx: string;
|
|
35
|
+
asset?: "image" | "model" | "audio";
|
|
36
|
+
};
|
|
37
|
+
/** 3D object exposed by presence in the tree. */
|
|
38
|
+
exposeByPresence?: true;
|
|
39
|
+
/** One line for the agent cheat sheet. */
|
|
40
|
+
hint?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface ComponentsFile {
|
|
43
|
+
schema: typeof COMPONENTS_SCHEMA;
|
|
44
|
+
package: "@vincentt-xr/sdk";
|
|
45
|
+
version: string;
|
|
46
|
+
components: Record<string, ComponentDef>;
|
|
47
|
+
}
|
|
48
|
+
/** Props every known component accepts for the editor; neither changes rendering. */
|
|
49
|
+
export interface KnownComponentProps {
|
|
50
|
+
/** Name shown in the editor's parts list. */
|
|
51
|
+
name?: string;
|
|
52
|
+
/** Marks the part as not editable in the editor. */
|
|
53
|
+
locked?: boolean;
|
|
54
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sample values for a part the editor can open on its own. Only the edit build ever provides a
|
|
3
|
+
* scope, so in a published build every read returns the real value. Kept apart from `Scene`
|
|
4
|
+
* so other kinds (a screen's pin-visible data) can reuse it.
|
|
5
|
+
*/
|
|
6
|
+
export interface SampleScope {
|
|
7
|
+
values: Readonly<Record<string, unknown>>;
|
|
8
|
+
/** True when the editor opened this part directly instead of the app reaching it. */
|
|
9
|
+
direct: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const SampleContext: import('react').Context<SampleScope | null>;
|
|
12
|
+
/** Own literal-object `sample` prop, or undefined for anything else (a computed value is not a sample). */
|
|
13
|
+
export declare function readSample(value: unknown): Readonly<Record<string, unknown>> | undefined;
|
|
14
|
+
/** The sample for `key` when the editor opened the enclosing part directly and has one; else `real`. */
|
|
15
|
+
export declare function useSample<T>(key: string, real: T): T;
|
package/dist/editor-scenes.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var g=Object.defineProperty;var w=(e,n,t)=>n in e?g(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var v=(e,n,t)=>w(e,typeof n!="symbol"?n+"":n,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),m=require("react"),h=require("./Scenes-Dtt8UGE8.cjs"),S=require("./useEditOverrides-CgapHJzA.cjs");function j(e,n,t){return n===void 0?{shown:e,hold:null}:t===null||t.value!==n?{shown:n,hold:{app:e,value:n}}:{shown:t.app===e?n:e,hold:t}}const x=e=>typeof e=="string"&&e.length<=200;class E extends m.Component{constructor(){super(...arguments);v(this,"state",{failed:!1})}static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(){var t,s;(s=(t=S.editStore())==null?void 0:t.sceneError)==null||s.call(t,this.props.owner,this.props.id)}render(){return this.state.failed?null:this.props.children}}function y(e,n,t){const s=e.find(c=>c.id===n);if(!s)return[];const{overlay:o,open:d,over:f}=s.element.props;if(o!==!0)return[{entry:s,direct:t}];const u=typeof f=="string"?e.find(c=>c.id===f&&c!==s):void 0,i=u?[{entry:u,direct:t}]:[];return d===!1&&!t?i:[...i,{entry:s,direct:t}]}function b(e){const n=S.useEditOverrides(e,["current"],{current:x}),t=m.useRef(null),s=n===e?void 0:n.current,o=j(e.current,s,t.current);t.current=o.hold;const d=h.sceneEntries(e.children),u=d.map(r=>r.id).join("\0"),{shown:i}=o;m.useEffect(()=>{var r,l;(l=(r=S.editStore())==null?void 0:r.sceneState)==null||l.call(r,e,{current:i,app:e.current,ids:u===""?[]:u.split("\0")})},[i,e.current,u]);const c=y(d,i,i!==e.current);return c.length===0?null:a.jsx(a.Fragment,{children:c.map(({entry:r,direct:l})=>a.jsx(E,{id:r.id,owner:e,children:a.jsx(h.SampleContext.Provider,{value:{values:h.readSample(r.element.props.sample)??{},direct:l},children:r.element})},r.id))})}exports.Scenes=b;
|
package/dist/editor-scenes.js
CHANGED
|
@@ -1,45 +1,59 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { useRef as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
function
|
|
9
|
-
return
|
|
1
|
+
var v = Object.defineProperty;
|
|
2
|
+
var S = (e, t, n) => t in e ? v(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var m = (e, t, n) => S(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { jsx as f, Fragment as w } from "react/jsx-runtime";
|
|
5
|
+
import { useRef as g, useEffect as p, Component as E } from "react";
|
|
6
|
+
import { s as x, S as y, r as C } from "./Scenes-BX0bR1j4.js";
|
|
7
|
+
import { u as b, e as h } from "./useEditOverrides-BBkK8cN2.js";
|
|
8
|
+
function j(e, t, n) {
|
|
9
|
+
return t === void 0 ? { shown: e, hold: null } : n === null || n.value !== t ? { shown: t, hold: { app: e, value: t } } : { shown: n.app === e ? t : e, hold: n };
|
|
10
10
|
}
|
|
11
|
-
const
|
|
12
|
-
class
|
|
11
|
+
const F = (e) => typeof e == "string" && e.length <= 200;
|
|
12
|
+
class B extends E {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
|
-
|
|
15
|
+
m(this, "state", { failed: !1 });
|
|
16
16
|
}
|
|
17
17
|
static getDerivedStateFromError() {
|
|
18
18
|
return { failed: !0 };
|
|
19
19
|
}
|
|
20
20
|
componentDidCatch() {
|
|
21
|
-
var
|
|
22
|
-
(
|
|
21
|
+
var n, s;
|
|
22
|
+
(s = (n = h()) == null ? void 0 : n.sceneError) == null || s.call(n, this.props.owner, this.props.id);
|
|
23
23
|
}
|
|
24
24
|
render() {
|
|
25
25
|
return this.state.failed ? null : this.props.children;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
28
|
+
function I(e, t, n) {
|
|
29
|
+
const s = e.find((o) => o.id === t);
|
|
30
|
+
if (!s) return [];
|
|
31
|
+
const { overlay: u, open: l, over: a } = s.element.props;
|
|
32
|
+
if (u !== !0) return [{ entry: s, direct: n }];
|
|
33
|
+
const c = typeof a == "string" ? e.find((o) => o.id === a && o !== s) : void 0, i = c ? [{ entry: c, direct: n }] : [];
|
|
34
|
+
return l === !1 && !n ? i : [...i, { entry: s, direct: n }];
|
|
35
|
+
}
|
|
36
|
+
function q(e) {
|
|
37
|
+
const t = b(e, ["current"], { current: F }), n = g(null), s = t === e ? void 0 : t.current, u = j(e.current, s, n.current);
|
|
38
|
+
n.current = u.hold;
|
|
39
|
+
const l = x(e.children), c = l.map((r) => r.id).join("\0"), { shown: i } = u;
|
|
40
|
+
p(() => {
|
|
33
41
|
var r, d;
|
|
34
|
-
(d = (r =
|
|
35
|
-
current:
|
|
42
|
+
(d = (r = h()) == null ? void 0 : r.sceneState) == null || d.call(r, e, {
|
|
43
|
+
current: i,
|
|
36
44
|
app: e.current,
|
|
37
45
|
ids: c === "" ? [] : c.split("\0")
|
|
38
46
|
});
|
|
39
|
-
}, [
|
|
40
|
-
const
|
|
41
|
-
return
|
|
47
|
+
}, [i, e.current, c]);
|
|
48
|
+
const o = I(l, i, i !== e.current);
|
|
49
|
+
return o.length === 0 ? null : /* @__PURE__ */ f(w, { children: o.map(({ entry: r, direct: d }) => /* @__PURE__ */ f(B, { id: r.id, owner: e, children: /* @__PURE__ */ f(
|
|
50
|
+
y.Provider,
|
|
51
|
+
{
|
|
52
|
+
value: { values: C(r.element.props.sample) ?? {}, direct: d },
|
|
53
|
+
children: r.element
|
|
54
|
+
}
|
|
55
|
+
) }, r.id)) });
|
|
42
56
|
}
|
|
43
57
|
export {
|
|
44
|
-
|
|
58
|
+
q as Scenes
|
|
45
59
|
};
|
package/dist/entries/core.d.ts
CHANGED
|
@@ -14,11 +14,13 @@ export { PinToMesh } from '../components/PinToMesh';
|
|
|
14
14
|
export { VideoBackground } from '../components/VideoBackground';
|
|
15
15
|
export { PersonCutout, FULL_SCREEN_ANCHORS, resolvePersonCutoutStatus, shouldDrawFallback, usePersonMaskTexture, } from '../components/PersonCutout';
|
|
16
16
|
export type { PersonCutoutFallback, PersonCutoutProps, PersonCutoutStatus, PersonMaskTextureResult, } from '../components/PersonCutout';
|
|
17
|
-
export { Scene, Scenes } from '../scenes/Scenes';
|
|
17
|
+
export { Scene, Scenes, useSceneSample } from '../scenes/Scenes';
|
|
18
18
|
export type { SceneProps, ScenesProps } from '../scenes/Scenes';
|
|
19
19
|
export { AspectRatioContainer } from '../components/AspectRatioContainer';
|
|
20
20
|
export { Axes } from '../components/Axes';
|
|
21
21
|
export { SpriteAnimation } from '../components/SpriteAnimation';
|
|
22
|
+
export { ThemeProvider } from '../components/ThemeProvider';
|
|
23
|
+
export type { ThemeProviderProps } from '../components/ThemeProvider';
|
|
22
24
|
export { ScreenImage } from '../components/ScreenImage';
|
|
23
25
|
export { SCREEN_IMAGE_MASK_CHANNELS } from '../components/ScreenImage';
|
|
24
26
|
export type { ScreenImageMaskChannel } from '../components/ScreenImage';
|
|
@@ -29,7 +31,17 @@ export type { ScreenGlassMaterialProps, ScreenGlassSettings } from '../component
|
|
|
29
31
|
export { ScreenShape, DEFAULT_SCREEN_SHAPE_SETTINGS, mergeScreenShapeSettings, } from '../components/ScreenShape';
|
|
30
32
|
export { ScreenText } from '../components/ScreenText';
|
|
31
33
|
export { MeshRenderer } from '../components/MeshRenderer';
|
|
34
|
+
export { Model } from '../components/Model';
|
|
35
|
+
export type { ModelProps } from '../components/Model';
|
|
36
|
+
export { Object3D } from '../components/Object3D';
|
|
37
|
+
export type { Object3DProps } from '../components/Object3D';
|
|
38
|
+
export { HtmlRegion } from '../components/HtmlRegion';
|
|
39
|
+
export type { HtmlRegionProps } from '../components/HtmlRegion';
|
|
40
|
+
export { Button } from '../components/Button';
|
|
41
|
+
export type { ButtonProps } from '../components/Button';
|
|
32
42
|
export { LightObject } from '../components/LightObject';
|
|
43
|
+
export { Light } from '../components/Light';
|
|
44
|
+
export type { LightProps } from '../components/Light';
|
|
33
45
|
export { LookAt } from '../components/LookAt';
|
|
34
46
|
export { SceneObjectRenderer } from '../components/SceneObjectRenderer';
|
|
35
47
|
export { SequentialRenderPasses } from '../components/SequentialRenderPasses';
|
|
@@ -106,6 +106,8 @@ export type { ClosestPoint, FaceImageLandmark, FaceOpening, FaceReprojectionBind
|
|
|
106
106
|
export { FaceReprojector } from '../face-character/faceReprojector';
|
|
107
107
|
export type { FaceReprojectionTarget, FaceReprojectorOptions, } from '../face-character/faceReprojector';
|
|
108
108
|
export { DEFAULT_FACE_MIRROR_SETTINGS, DEFAULT_FACE_SWAP_SETTINGS, FACE_MIRROR_SETTINGS_FIELDS, FACE_MIRROR_VARIANTS, FACE_MIRROR_VARIANT_LABELS, FACE_SWAP_EACH_OTHER, FACE_SWAP_PAINTED_FEATURE_SOFTNESS, FACE_SWAP_PRESETS, FACE_SWAP_PRESET_KEYS, FACE_SWAP_SETTINGS_FIELDS, FACE_SWAP_SETTINGS_RANGES, FACE_SWAP_SOURCE_KINDS, FaceMirror, FaceSwap, FaceTextureLayer, defaultFaceSwapPreset, faceMirrorTransferSettings, isFaceMirrorVariant, isFaceSwapPresetKey, patchFaceMirrorSettings, patchFaceSwapSettings, resolveFaceMirrorSettings, resolveFaceSwapSettings, useFaceTexture, useLiveFaceTexture, } from '../components/FaceSwap';
|
|
109
|
+
export { PaintedFace } from '../components/PaintedFace';
|
|
110
|
+
export type { PaintedFaceProps } from '../components/PaintedFace';
|
|
109
111
|
export type { FaceMirrorProps, FaceMirrorSettings, FaceMirrorVariant, FaceSwapPreset, FaceSwapPresetKey, FaceSwapProps, FaceSwapSettings, FaceSwapSource, FaceSwapSourceKind, FaceSwapSourceLike, FaceSwapSourceStatus, FaceSwapStatus, FaceTextureLayerProps, FaceTextureStatus, ResolveFaceSwapSettingsOptions, UseFaceTextureOptions, UseFaceTextureResult, UseLiveFaceTextureOptions, } from '../components/FaceSwap';
|
|
110
112
|
export { FACE_UNWRAP_MIRROR, mirrorFaceLandmarks, resolveFaceSourceMirror, } from '../face-character/faceTexture';
|
|
111
113
|
export type { FaceTexture, FaceTextureKind, FaceTextureSource, FaceTextureStatistics, } from '../face-character/faceTexture';
|