@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,59 +1,438 @@
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-icIQpHtV.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
- }
11
- const F = (e) => typeof e == "string" && e.length <= 200;
12
- class B extends E {
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
- m(this, "state", { failed: !1 });
393
+ F(this, "state", { failed: !1 });
16
394
  }
17
395
  static getDerivedStateFromError() {
18
396
  return { failed: !0 };
19
397
  }
20
398
  componentDidCatch() {
21
- var n, s;
22
- (s = (n = h()) == null ? void 0 : n.sceneError) == null || s.call(n, this.props.owner, this.props.id);
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 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(() => {
41
- var r, d;
42
- (d = (r = h()) == null ? void 0 : r.sceneState) == null || d.call(r, e, {
43
- current: i,
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: c === "" ? [] : c.split("\0")
423
+ ids: s === "" ? [] : s.split("\0")
46
424
  });
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,
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: C(r.element.props.sample) ?? {}, direct: d },
53
- children: r.element
430
+ value: { values: ae(i.element.props.sample) ?? {}, direct: g },
431
+ children: i.element
54
432
  }
55
- ) }, r.id)) });
433
+ ) }, i.id)) });
56
434
  }
435
+ Ie();
57
436
  export {
58
- q as Scenes
437
+ Ze as Scenes
59
438
  };
@@ -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';