@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
package/dist/editor-scenes.js
CHANGED
|
@@ -1,59 +1,438 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { s as
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
var $ = Object.defineProperty;
|
|
2
|
+
var z = (e, r, t) => r in e ? $(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
3
|
+
var F = (e, r, t) => z(e, typeof r != "symbol" ? r + "" : r, t);
|
|
4
|
+
import { flushSync as W } from "react-dom";
|
|
5
|
+
import { i as B, l as H, L as G } from "./live.generated-Do4jgrUN.js";
|
|
6
|
+
import { s as q, a as J, u as Z, b as Q, e as x, r as U } from "./useEditOverrides-BmvpLYPU.js";
|
|
7
|
+
import { Children as I, isValidElement as X, createElement as L, Fragment as ee, cloneElement as Y, useRef as te, useEffect as ne, Component as re } from "react";
|
|
8
|
+
import { jsx as T, Fragment as se } from "react/jsx-runtime";
|
|
9
|
+
import { s as oe, S as ie, r as ae } from "./Scenes-icIQpHtV.js";
|
|
10
|
+
const le = 400, R = 16384, N = 512, ce = 200, ue = 8, fe = 1e3, de = /* @__PURE__ */ new Set(["prop", "text", "asset", "hide", "clone", "insert", "move", "region"]), pe = /* @__PURE__ */ new Set([
|
|
11
|
+
"__proto__",
|
|
12
|
+
"constructor",
|
|
13
|
+
"prototype",
|
|
14
|
+
"ref",
|
|
15
|
+
"key",
|
|
16
|
+
"dangerouslySetInnerHTML"
|
|
17
|
+
]), me = /^on[A-Z]/, E = (e, r) => Object.prototype.hasOwnProperty.call(e, r) ? e[r] : void 0, w = (e) => {
|
|
18
|
+
if (typeof e != "object" || e === null || Array.isArray(e)) return !1;
|
|
19
|
+
const r = Object.getPrototypeOf(e);
|
|
20
|
+
return r === Object.prototype || r === null;
|
|
21
|
+
};
|
|
22
|
+
function P(e) {
|
|
23
|
+
return pe.has(e) || me.test(e);
|
|
24
|
+
}
|
|
25
|
+
function ge(e) {
|
|
26
|
+
return typeof e != "string" || e.length === 0 || e.length > ce ? !1 : e.split(".").every((r) => r.length > 0 && !P(r));
|
|
27
|
+
}
|
|
28
|
+
function he(e) {
|
|
29
|
+
let r = 0;
|
|
30
|
+
const t = (n, a) => {
|
|
31
|
+
if (a > ue || ++r > fe) return "cap";
|
|
32
|
+
if (n === null || typeof n == "boolean") return "ok";
|
|
33
|
+
if (typeof n == "number") return Number.isFinite(n) ? "ok" : "grammar";
|
|
34
|
+
if (typeof n == "string") return n.length > R ? "cap" : "ok";
|
|
35
|
+
if (Array.isArray(n)) {
|
|
36
|
+
for (const l of n) {
|
|
37
|
+
const d = t(l, a + 1);
|
|
38
|
+
if (d !== "ok") return d;
|
|
39
|
+
}
|
|
40
|
+
return "ok";
|
|
41
|
+
}
|
|
42
|
+
if (!w(n)) return "grammar";
|
|
43
|
+
for (const l of Object.keys(n)) {
|
|
44
|
+
if (P(l)) return "grammar";
|
|
45
|
+
const d = t(n[l], a + 1);
|
|
46
|
+
if (d !== "ok") return d;
|
|
47
|
+
}
|
|
48
|
+
return "ok";
|
|
49
|
+
};
|
|
50
|
+
return t(e, 0);
|
|
51
|
+
}
|
|
52
|
+
const V = [
|
|
53
|
+
"p",
|
|
54
|
+
"h1",
|
|
55
|
+
"h2",
|
|
56
|
+
"h3",
|
|
57
|
+
"h4",
|
|
58
|
+
"h5",
|
|
59
|
+
"h6",
|
|
60
|
+
"span",
|
|
61
|
+
"strong",
|
|
62
|
+
"em",
|
|
63
|
+
"b",
|
|
64
|
+
"i",
|
|
65
|
+
"u",
|
|
66
|
+
"br",
|
|
67
|
+
"ul",
|
|
68
|
+
"ol",
|
|
69
|
+
"li",
|
|
70
|
+
"a",
|
|
71
|
+
"img",
|
|
72
|
+
"div",
|
|
73
|
+
"section",
|
|
74
|
+
"small",
|
|
75
|
+
"blockquote"
|
|
76
|
+
], ye = 12, ke = 1e3, be = 2e3, Se = 1e5, Ae = 2048, Ee = 16, Oe = 512, _e = ["tag", "attrs", "children"], M = /[\u0000-\u001f\u007f\\\s]/, ve = /[\u0000-\u001f\u007f-\u009f]/;
|
|
77
|
+
function we(e, r, t) {
|
|
78
|
+
switch (r) {
|
|
79
|
+
case "className":
|
|
80
|
+
case "title":
|
|
81
|
+
return !0;
|
|
82
|
+
case "alt":
|
|
83
|
+
case "width":
|
|
84
|
+
case "height":
|
|
85
|
+
return e === "img" && (r === "alt" || /^[0-9]{1,5}%?$/.test(t));
|
|
86
|
+
case "href": {
|
|
87
|
+
const n = t.toLowerCase();
|
|
88
|
+
return e === "a" && (n.startsWith("https://") || n.startsWith("mailto:")) && !M.test(t);
|
|
89
|
+
}
|
|
90
|
+
case "src":
|
|
91
|
+
return e === "img" && t.length <= Oe && (t.startsWith("/") && !t.startsWith("//") && !M.test(t) && !t.split("/").includes("..") || /^a:[0-9a-f]{32}$/.test(t));
|
|
92
|
+
default:
|
|
93
|
+
return /^aria-[a-z]+(-[a-z]+)*$/.test(r);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function Ne(e) {
|
|
97
|
+
let r = 1, t = !1;
|
|
98
|
+
const n = /* @__PURE__ */ new Set(), a = (s, o, p) => {
|
|
99
|
+
if (!w(s)) return null;
|
|
100
|
+
for (const _ of Object.keys(s)) if (!_e.includes(_)) return null;
|
|
101
|
+
const i = E(s, "tag");
|
|
102
|
+
if (typeof i != "string" || !(V.includes(i) || p && i === "fragment"))
|
|
103
|
+
return null;
|
|
104
|
+
const g = { tag: i, children: [] }, m = E(s, "attrs");
|
|
105
|
+
if (m !== void 0) {
|
|
106
|
+
if (!w(m) || i === "fragment") return null;
|
|
107
|
+
const _ = {};
|
|
108
|
+
Object.keys(m).length > Ee && (t = !0);
|
|
109
|
+
for (const c of Object.keys(m)) {
|
|
110
|
+
const f = m[c];
|
|
111
|
+
if (typeof f != "string" || P(c) || !we(i, c, f))
|
|
112
|
+
return null;
|
|
113
|
+
f.length > Ae ? t = !0 : _[c] = f;
|
|
114
|
+
}
|
|
115
|
+
g.attrs = _;
|
|
116
|
+
}
|
|
117
|
+
return { src: s, out: g, depth: o };
|
|
118
|
+
}, l = a(e, 0, !0);
|
|
119
|
+
if (!l) return { fault: "grammar" };
|
|
120
|
+
const d = [l];
|
|
121
|
+
for (; d.length; ) {
|
|
122
|
+
const { src: s, out: o, depth: p } = d.pop();
|
|
123
|
+
if (p > ye) {
|
|
124
|
+
t = !0;
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
const i = E(s, "children");
|
|
128
|
+
if (!Array.isArray(i)) return { fault: "grammar" };
|
|
129
|
+
for (const g of i) {
|
|
130
|
+
if (++r > ke) {
|
|
131
|
+
t = !0;
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
if (typeof g == "string")
|
|
135
|
+
g.length > R && (t = !0), o.children.push(g);
|
|
136
|
+
else if (w(g) && Object.keys(g).length === 1 && E(g, "slot") !== void 0) {
|
|
137
|
+
const m = g.slot;
|
|
138
|
+
if (o.tag !== "fragment" || p !== 0 || typeof m != "string" || m.length === 0 || m.length > N || ve.test(m) || P(m) || n.has(m))
|
|
139
|
+
return { fault: "grammar" };
|
|
140
|
+
n.add(m), o.children.push({ slot: m });
|
|
141
|
+
} else {
|
|
142
|
+
const m = a(g, p + 1, !1);
|
|
143
|
+
if (!m) return { fault: "grammar" };
|
|
144
|
+
o.children.push(m.out), d.push(m);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return t ? { fault: "cap" } : { plan: l.out };
|
|
149
|
+
}
|
|
150
|
+
function Pe(e) {
|
|
151
|
+
if (!w(e)) return { ok: !1, reason: "grammar" };
|
|
152
|
+
const r = E(e, "k");
|
|
153
|
+
if (typeof r != "string" || !de.has(r)) return { ok: !1, reason: "grammar" };
|
|
154
|
+
const t = E(e, "s"), n = typeof t == "string" && t.length > 0 && t.length <= N ? t : void 0;
|
|
155
|
+
if (typeof t == "string" && t.length > N)
|
|
156
|
+
return { ok: !1, reason: "grammar", s: t.slice(0, N) };
|
|
157
|
+
if (r === "insert") return { ok: !0, entry: { k: "later", s: void 0 } };
|
|
158
|
+
if (n === void 0) return { ok: !1, reason: "grammar" };
|
|
159
|
+
if (r === "prop") {
|
|
160
|
+
const a = E(e, "key");
|
|
161
|
+
if (!ge(a)) return { ok: !1, reason: "grammar", s: n };
|
|
162
|
+
const l = E(e, "value"), d = he(l);
|
|
163
|
+
return d !== "ok" ? { ok: !1, reason: d, s: n } : { ok: !0, entry: { k: "prop", s: n, key: a, value: l } };
|
|
164
|
+
}
|
|
165
|
+
if (r === "text") {
|
|
166
|
+
const a = E(e, "text");
|
|
167
|
+
if (typeof a != "string") return { ok: !1, reason: "grammar", s: n };
|
|
168
|
+
if (a.length > R) return { ok: !1, reason: "cap", s: n };
|
|
169
|
+
const l = E(e, "piece");
|
|
170
|
+
if (l !== void 0) {
|
|
171
|
+
if (!w(l) || Object.keys(l).some((o) => o !== "from" && o !== "nth"))
|
|
172
|
+
return { ok: !1, reason: "grammar", s: n };
|
|
173
|
+
const d = E(l, "from"), s = E(l, "nth");
|
|
174
|
+
return typeof d != "string" || d.length === 0 || d.length > be ? { ok: !1, reason: "grammar", s: n } : typeof s != "number" || !Number.isInteger(s) || s < 0 || s > Se ? { ok: !1, reason: "grammar", s: n } : { ok: !0, entry: { k: "piece", s: n, text: a, from: d, nth: s } };
|
|
175
|
+
}
|
|
176
|
+
return { ok: !0, entry: { k: "text", s: n, text: a } };
|
|
177
|
+
}
|
|
178
|
+
if (r === "region") {
|
|
179
|
+
const a = Ne(E(e, "plan"));
|
|
180
|
+
return "fault" in a ? { ok: !1, reason: a.fault, s: n } : { ok: !0, entry: { k: "region", s: n, plan: a.plan } };
|
|
181
|
+
}
|
|
182
|
+
return { ok: !0, entry: { k: "later", s: n } };
|
|
183
|
+
}
|
|
184
|
+
const Te = /* @__PURE__ */ new Set(["className", "title", "alt", "width", "height", "href", "src"]);
|
|
185
|
+
function Re(e, r, t) {
|
|
186
|
+
const n = /* @__PURE__ */ new Map();
|
|
187
|
+
for (const s of I.toArray(r)) {
|
|
188
|
+
if (!X(s)) continue;
|
|
189
|
+
const o = t(s.props);
|
|
190
|
+
o !== void 0 && n.set(o, [...n.get(o) ?? [], s]);
|
|
191
|
+
}
|
|
192
|
+
let a = !1;
|
|
193
|
+
const l = (s, o) => {
|
|
194
|
+
if (typeof s == "string") return s;
|
|
195
|
+
if ("slot" in s) {
|
|
196
|
+
const i = n.get(s.slot);
|
|
197
|
+
return (i == null ? void 0 : i.length) !== 1 ? (a = !0, null) : i[0];
|
|
198
|
+
}
|
|
199
|
+
if (!V.includes(s.tag))
|
|
200
|
+
return a = !0, null;
|
|
201
|
+
const p = { key: o };
|
|
202
|
+
for (const [i, g] of Object.entries(s.attrs ?? {}))
|
|
203
|
+
(Te.has(i) || i.startsWith("aria-")) && (p[i] = g);
|
|
204
|
+
return L(s.tag, p, ...s.children.map(l));
|
|
205
|
+
}, d = e.tag === "fragment" ? L(ee, null, ...e.children.map(l)) : l(e, 0);
|
|
206
|
+
return a ? { fault: "not-representable" } : { node: d };
|
|
207
|
+
}
|
|
208
|
+
const C = (e) => e.replace(/\s+/g, " ").trim();
|
|
209
|
+
function Fe(e, r) {
|
|
210
|
+
const t = /* @__PURE__ */ new Map();
|
|
211
|
+
let n = !1;
|
|
212
|
+
const a = /* @__PURE__ */ new Set(), l = (s) => I.toArray(s).map((o) => {
|
|
213
|
+
if (typeof o == "string") {
|
|
214
|
+
const i = C(o);
|
|
215
|
+
if (i === "") return o;
|
|
216
|
+
const g = t.get(i) ?? 0;
|
|
217
|
+
t.set(i, g + 1);
|
|
218
|
+
const m = r.find((_) => C(_.from) === i && _.nth === g);
|
|
219
|
+
return m ? (a.add(m), `${/^\s*/.exec(o)[0]}${m.text}${/\s*$/.exec(o)[0]}`) : o;
|
|
220
|
+
}
|
|
221
|
+
if (!X(o) || typeof o.type != "string") return o;
|
|
222
|
+
const p = o.props;
|
|
223
|
+
return p["data-locked"] !== void 0 && p["data-locked"] !== !1 || p.children === void 0 ? o : Y(o, void 0, ...l(p.children));
|
|
224
|
+
}), d = l(e);
|
|
225
|
+
for (const s of r) a.has(s) || (n = !0);
|
|
226
|
+
return { node: d, missed: n };
|
|
227
|
+
}
|
|
228
|
+
const Le = "__VCT_EDIT_OVERLAY__", Me = [
|
|
229
|
+
"grammar",
|
|
230
|
+
"cap",
|
|
231
|
+
"not-representable",
|
|
232
|
+
"unknown-stamp",
|
|
233
|
+
"id-collision",
|
|
234
|
+
"base-mismatch"
|
|
235
|
+
], Ce = ["text", "label"], je = (e) => {
|
|
236
|
+
const r = new Set(e);
|
|
237
|
+
return Me.find((t) => r.has(t));
|
|
238
|
+
};
|
|
239
|
+
function xe(e, r) {
|
|
240
|
+
let t = 0, n = /* @__PURE__ */ new Map();
|
|
241
|
+
const a = /* @__PURE__ */ new Set(), l = (c) => {
|
|
242
|
+
let f;
|
|
243
|
+
try {
|
|
244
|
+
f = e(c);
|
|
245
|
+
} catch {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
return typeof f == "string" ? f : void 0;
|
|
249
|
+
}, d = () => {
|
|
250
|
+
t += 1;
|
|
251
|
+
for (const c of [...a]) c();
|
|
252
|
+
}, s = () => {
|
|
253
|
+
const c = [];
|
|
254
|
+
for (const f of n.values()) {
|
|
255
|
+
const S = /* @__PURE__ */ new Set([...f.parseFailures, ...f.applyFailures]);
|
|
256
|
+
!f.seen && f.entries.length > 0 && S.add("unknown-stamp");
|
|
257
|
+
const h = je(S);
|
|
258
|
+
f.unknownReported = h === "unknown-stamp", h && c.push({ s: f.s, reason: h });
|
|
259
|
+
}
|
|
260
|
+
return c;
|
|
261
|
+
}, o = (c) => {
|
|
262
|
+
const f = c == null ? void 0 : c.entries, S = /* @__PURE__ */ new Map();
|
|
263
|
+
if (Array.isArray(f) && f.length <= le) {
|
|
264
|
+
const b = /* @__PURE__ */ new Map(), A = (y) => {
|
|
265
|
+
let u = b.get(y);
|
|
266
|
+
return u || b.set(y, u = { entries: [], faults: /* @__PURE__ */ new Set() }), u;
|
|
267
|
+
};
|
|
268
|
+
for (const y of f) {
|
|
269
|
+
const u = Pe(y);
|
|
270
|
+
if (!u.ok)
|
|
271
|
+
u.s !== void 0 && A(u.s).faults.add(u.reason);
|
|
272
|
+
else if (u.entry.s !== void 0) {
|
|
273
|
+
const k = A(u.entry.s);
|
|
274
|
+
u.entry.k === "later" ? k.faults.add("not-representable") : k.entries.push(u.entry);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
for (const [y, u] of b) {
|
|
278
|
+
const k = JSON.stringify([u.entries, [...u.faults].sort()]), O = n.get(y);
|
|
279
|
+
S.set(
|
|
280
|
+
y,
|
|
281
|
+
O && O.sig === k ? O : {
|
|
282
|
+
s: y,
|
|
283
|
+
entries: u.entries,
|
|
284
|
+
parseFailures: u.faults,
|
|
285
|
+
sig: k,
|
|
286
|
+
seen: !1,
|
|
287
|
+
unknownReported: !1,
|
|
288
|
+
applyFailures: /* @__PURE__ */ new Set()
|
|
289
|
+
}
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
let h = S.size !== n.size;
|
|
294
|
+
if (!h)
|
|
295
|
+
for (const [b, A] of S) n.get(b) !== A && (h = !0);
|
|
296
|
+
if (n = S, h)
|
|
297
|
+
try {
|
|
298
|
+
W(d);
|
|
299
|
+
} catch {
|
|
300
|
+
d();
|
|
301
|
+
}
|
|
302
|
+
return { failed: s() };
|
|
303
|
+
}, p = (c) => {
|
|
304
|
+
const f = !c.seen && c.unknownReported;
|
|
305
|
+
c.seen = !0, f && r && (c.unknownReported = !1, queueMicrotask(() => r({ failed: s() })));
|
|
306
|
+
}, m = {
|
|
307
|
+
subscribe(c) {
|
|
308
|
+
return a.add(c), () => void a.delete(c);
|
|
309
|
+
},
|
|
310
|
+
slice: (c) => {
|
|
311
|
+
const f = l(c);
|
|
312
|
+
return f === void 0 ? void 0 : n.get(f);
|
|
313
|
+
},
|
|
314
|
+
version: () => t,
|
|
315
|
+
resolve: (c, f, S) => {
|
|
316
|
+
const h = l(c), b = h === void 0 ? void 0 : n.get(h);
|
|
317
|
+
if (!b) return;
|
|
318
|
+
p(b);
|
|
319
|
+
const A = /* @__PURE__ */ new Set(), y = /* @__PURE__ */ Object.create(null), u = (k, O) => {
|
|
320
|
+
if (!f.includes(k)) return void A.add("grammar");
|
|
321
|
+
const v = S == null ? void 0 : S[k];
|
|
322
|
+
if (v && !v(O) || v != null && v.fileRef && !B(O) || !q({ ...c }, k.split("."), O))
|
|
323
|
+
return void A.add("not-representable");
|
|
324
|
+
y[k] = O;
|
|
325
|
+
};
|
|
326
|
+
for (const k of b.entries)
|
|
327
|
+
if (k.k === "prop") u(k.key, k.value);
|
|
328
|
+
else if (k.k === "text") {
|
|
329
|
+
const O = Ce.find((v) => f.includes(v));
|
|
330
|
+
O === void 0 ? A.add("not-representable") : u(O, k.text);
|
|
331
|
+
}
|
|
332
|
+
return b.applyFailures = A, Object.keys(y).length > 0 ? y : void 0;
|
|
333
|
+
},
|
|
334
|
+
region: (c, f) => {
|
|
335
|
+
const S = l(c), h = S === void 0 ? void 0 : n.get(S);
|
|
336
|
+
if (!h) return;
|
|
337
|
+
p(h);
|
|
338
|
+
let b;
|
|
339
|
+
for (const u of h.entries) u.k === "region" && (b = u);
|
|
340
|
+
h.applyFailures = /* @__PURE__ */ new Set();
|
|
341
|
+
const A = h.entries.flatMap(
|
|
342
|
+
(u) => u.k === "piece" ? [{ from: u.from, nth: u.nth, text: u.text }] : []
|
|
343
|
+
);
|
|
344
|
+
if (!b && A.length === 0) return;
|
|
345
|
+
if (c.locked === !0) {
|
|
346
|
+
h.applyFailures = /* @__PURE__ */ new Set(["not-representable"]);
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
if (!b) {
|
|
350
|
+
const u = Fe(f, A);
|
|
351
|
+
if (u.missed) {
|
|
352
|
+
h.applyFailures = /* @__PURE__ */ new Set(["not-representable"]);
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
return u.node;
|
|
356
|
+
}
|
|
357
|
+
const y = Re(b.plan, f, l);
|
|
358
|
+
if ("fault" in y) {
|
|
359
|
+
h.applyFailures = /* @__PURE__ */ new Set([y.fault]);
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
return y.node;
|
|
363
|
+
}
|
|
364
|
+
}, _ = Object.freeze({ apply: o });
|
|
365
|
+
return { slot: m, consumer: _ };
|
|
366
|
+
}
|
|
367
|
+
let j = !1;
|
|
368
|
+
function Ie() {
|
|
369
|
+
if (j) return !0;
|
|
370
|
+
const e = globalThis[Le];
|
|
371
|
+
if (!e || typeof e.register != "function" || typeof e.stampOf != "function")
|
|
372
|
+
return !1;
|
|
373
|
+
const r = e.stampOf.bind(e), { slot: t, consumer: n } = xe(
|
|
374
|
+
r,
|
|
375
|
+
typeof e.reportFailures == "function" ? e.reportFailures.bind(e) : void 0
|
|
376
|
+
);
|
|
377
|
+
return e.register(n) ? (J(t), j = !0, !0) : !1;
|
|
378
|
+
}
|
|
379
|
+
function Xe(e, r, t) {
|
|
380
|
+
return r === void 0 ? { shown: e, hold: null } : t === null || t.value !== r ? { shown: r, hold: { app: e, value: r } } : { shown: t.app === e ? r : e, hold: t };
|
|
381
|
+
}
|
|
382
|
+
const K = G.Scene ?? {}, D = Object.keys(K), Ye = Object.fromEntries(
|
|
383
|
+
D.map((e) => [e, (r) => H(K[e], r)])
|
|
384
|
+
);
|
|
385
|
+
function Ve(e) {
|
|
386
|
+
const r = U(e.element.props, D, Ye);
|
|
387
|
+
return r ? { ...e, element: Y(e.element, { ...r }) } : e;
|
|
388
|
+
}
|
|
389
|
+
const Ke = (e) => typeof e == "string" && e.length <= 200;
|
|
390
|
+
class De extends re {
|
|
13
391
|
constructor() {
|
|
14
392
|
super(...arguments);
|
|
15
|
-
|
|
393
|
+
F(this, "state", { failed: !1 });
|
|
16
394
|
}
|
|
17
395
|
static getDerivedStateFromError() {
|
|
18
396
|
return { failed: !0 };
|
|
19
397
|
}
|
|
20
398
|
componentDidCatch() {
|
|
21
|
-
var
|
|
22
|
-
(
|
|
399
|
+
var t, n;
|
|
400
|
+
(n = (t = x()) == null ? void 0 : t.sceneError) == null || n.call(t, this.props.owner, this.props.id);
|
|
23
401
|
}
|
|
24
402
|
render() {
|
|
25
403
|
return this.state.failed ? null : this.props.children;
|
|
26
404
|
}
|
|
27
405
|
}
|
|
28
|
-
function
|
|
29
|
-
const
|
|
30
|
-
if (!
|
|
31
|
-
const { overlay:
|
|
32
|
-
if (
|
|
33
|
-
const
|
|
34
|
-
return l === !1 && !
|
|
35
|
-
}
|
|
36
|
-
function
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
const l =
|
|
40
|
-
|
|
41
|
-
var
|
|
42
|
-
(
|
|
43
|
-
current:
|
|
406
|
+
function $e(e, r, t) {
|
|
407
|
+
const n = e.find((p) => p.id === r);
|
|
408
|
+
if (!n) return [];
|
|
409
|
+
const { overlay: a, open: l, over: d } = n.element.props;
|
|
410
|
+
if (a !== !0) return [{ entry: n, direct: t }];
|
|
411
|
+
const s = typeof d == "string" ? e.find((p) => p.id === d && p !== n) : void 0, o = s ? [{ entry: s, direct: t }] : [];
|
|
412
|
+
return l === !1 && !t ? o : [...o, { entry: n, direct: t }];
|
|
413
|
+
}
|
|
414
|
+
function Ze(e) {
|
|
415
|
+
const r = Z(e, ["current"], { current: Ke }), t = te(null), n = r === e ? void 0 : r.current, a = Xe(e.current, n, t.current);
|
|
416
|
+
t.current = a.hold, Q();
|
|
417
|
+
const l = oe(e.children).map(Ve), s = l.map((i) => i.id).join("\0"), { shown: o } = a;
|
|
418
|
+
ne(() => {
|
|
419
|
+
var i, g;
|
|
420
|
+
(g = (i = x()) == null ? void 0 : i.sceneState) == null || g.call(i, e, {
|
|
421
|
+
current: o,
|
|
44
422
|
app: e.current,
|
|
45
|
-
ids:
|
|
423
|
+
ids: s === "" ? [] : s.split("\0")
|
|
46
424
|
});
|
|
47
|
-
}, [
|
|
48
|
-
const
|
|
49
|
-
return
|
|
50
|
-
|
|
425
|
+
}, [o, e.current, s]);
|
|
426
|
+
const p = $e(l, o, o !== e.current);
|
|
427
|
+
return p.length === 0 ? null : /* @__PURE__ */ T(se, { children: p.map(({ entry: i, direct: g }) => /* @__PURE__ */ T(De, { id: i.id, owner: e, children: /* @__PURE__ */ T(
|
|
428
|
+
ie.Provider,
|
|
51
429
|
{
|
|
52
|
-
value: { values:
|
|
53
|
-
children:
|
|
430
|
+
value: { values: ae(i.element.props.sample) ?? {}, direct: g },
|
|
431
|
+
children: i.element
|
|
54
432
|
}
|
|
55
|
-
) },
|
|
433
|
+
) }, i.id)) });
|
|
56
434
|
}
|
|
435
|
+
Ie();
|
|
57
436
|
export {
|
|
58
|
-
|
|
437
|
+
Ze as Scenes
|
|
59
438
|
};
|
package/dist/entries/core.d.ts
CHANGED
|
@@ -40,6 +40,12 @@ export { HtmlRegion } from '../components/HtmlRegion';
|
|
|
40
40
|
export type { HtmlRegionProps } from '../components/HtmlRegion';
|
|
41
41
|
export { Button } from '../components/Button';
|
|
42
42
|
export type { ButtonProps } from '../components/Button';
|
|
43
|
+
export { CaptureShareScreen } from '../components/CaptureShareScreen';
|
|
44
|
+
export type { CaptureShareScreenProps } from '../components/CaptureShareScreen';
|
|
45
|
+
export { SplashScreen } from '../components/SplashScreen';
|
|
46
|
+
export type { SplashScreenProps } from '../components/SplashScreen';
|
|
47
|
+
export { IntroScreen } from '../components/IntroScreen';
|
|
48
|
+
export type { IntroScreenProps } from '../components/IntroScreen';
|
|
43
49
|
export { LightObject } from '../components/LightObject';
|
|
44
50
|
export { Light } from '../components/Light';
|
|
45
51
|
export type { LightProps } from '../components/Light';
|
|
@@ -79,6 +85,10 @@ export { useMediaRecorder } from '../hooks/useMediaRecorder';
|
|
|
79
85
|
export type { RecordingStatus, UseMediaRecorderOptions } from '../hooks/useMediaRecorder';
|
|
80
86
|
export { useFrameCapture } from '../hooks/useFrameCapture';
|
|
81
87
|
export type { CaptureStatus, FrameCaptureEvents, UseFrameCaptureOptions, } from '../hooks/useFrameCapture';
|
|
88
|
+
export { useCapture } from '../hooks/useCapture';
|
|
89
|
+
export type { CapturedMedia, UseCaptureOptions } from '../hooks/useCapture';
|
|
90
|
+
export { useShare } from '../hooks/useShare';
|
|
91
|
+
export type { ShareOptions, ShareOutcome } from '../hooks/useShare';
|
|
82
92
|
export { dataURLtoFile } from '../utils/dataURL';
|
|
83
93
|
export { drawNormalizedCrop, resolveNormalizedCrop } from '../utils/drawNormalizedCrop';
|
|
84
94
|
export { computeFeedCrop, computeFitLayout, feedToScreenPixels, feedToSource, feedToTracker, feedToViewport, feedToWorld, isFeedPointInSource, isMirroredSourceKind, mirrorFeedX, orientSourcePoint, orientedSize, screenPixelsToFeed, sourceToFeed, trackerToFeed, trackerToWorld, viewportToFeed, worldToFeed, worldToTracker, } from '../coordinates';
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `@vincentt-xr/sdk/editor-scenes` - not for app authors.
|
|
3
|
-
*
|
|
4
|
-
* The visual editor's build swaps this `Scenes` in for the core one. The core `Scenes` carries
|
|
5
|
-
* no editor code; nothing in the core entry imports this file.
|
|
6
|
-
*/
|
|
7
1
|
export { Scenes } from '../scenes/edit';
|
|
8
2
|
export type { SceneReports, SceneState } from '../scenes/edit';
|
|
3
|
+
export type { OverlayApplyResult, OverlayConsumer, OverlayHost, OverlaySnapshot, } from '../overlay/consumer';
|