@vincentt-xr/sdk 2.0.0-alpha.19 → 2.0.0-alpha.20
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 +3 -1
- package/components.json +3 -1
- package/dist/Scenes--qAbN6iP.cjs +1 -0
- package/dist/Scenes-icIQpHtV.js +58 -0
- package/dist/components/Button/index.d.ts +5 -1
- package/dist/editor-defs/types.d.ts +4 -1
- package/dist/editor-scenes.cjs +1 -1
- package/dist/editor-scenes.js +1 -1
- package/dist/entries/core.d.ts +1 -0
- package/dist/main.cjs +1 -1
- package/dist/main.js +498 -494
- package/dist/scenes/Scenes.d.ts +4 -1
- package/dist/scenes/navigate.d.ts +5 -0
- package/package.json +1 -1
- package/settings.json +1 -1
- package/dist/Scenes-BX0bR1j4.js +0 -44
- package/dist/Scenes-Dtt8UGE8.cjs +0 -1
package/dist/scenes/Scenes.d.ts
CHANGED
|
@@ -40,5 +40,8 @@ export interface SceneEntry {
|
|
|
40
40
|
}
|
|
41
41
|
/** The `<Scene>` children of `children` (looking through fragments), in order; anything else is ignored. */
|
|
42
42
|
export declare function sceneEntries(children: ReactNode): SceneEntry[];
|
|
43
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* Renders the child `<Scene>` whose `id` is `current`, or nothing. A `goToScene(id)` for another
|
|
45
|
+
* scene here wins until `current` changes, then the app's own scene wins again.
|
|
46
|
+
*/
|
|
44
47
|
export declare function Scenes({ current, children }: ScenesProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Asks every `<Scenes>` to show the scene `id`. An unknown id is ignored by `<Scenes>`. */
|
|
2
|
+
export declare function goToScene(id: string): void;
|
|
3
|
+
export declare const subscribeScene: (l: () => void) => (() => void);
|
|
4
|
+
export declare const sceneRequestSeq: () => number;
|
|
5
|
+
export declare const requestedScene: () => string | undefined;
|
package/package.json
CHANGED
package/settings.json
CHANGED
package/dist/Scenes-BX0bR1j4.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx as s, Fragment as c } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as u, useContext as p, Children as a, isValidElement as f, Fragment as l } from "react";
|
|
3
|
-
const m = u(null);
|
|
4
|
-
function g(t) {
|
|
5
|
-
if (!(typeof t != "object" || t === null || Array.isArray(t)))
|
|
6
|
-
return t;
|
|
7
|
-
}
|
|
8
|
-
function d(t, n) {
|
|
9
|
-
const e = p(m);
|
|
10
|
-
return e === null || !e.direct ? n : Object.prototype.hasOwnProperty.call(e.values, t) ? e.values[t] : n;
|
|
11
|
-
}
|
|
12
|
-
function x(t, n) {
|
|
13
|
-
return d(t, n);
|
|
14
|
-
}
|
|
15
|
-
const o = "vctScene";
|
|
16
|
-
function y({ children: t }) {
|
|
17
|
-
return /* @__PURE__ */ s(c, { children: t });
|
|
18
|
-
}
|
|
19
|
-
y[o] = !0;
|
|
20
|
-
function i(t) {
|
|
21
|
-
const n = [];
|
|
22
|
-
for (const e of a.toArray(t)) {
|
|
23
|
-
if (!f(e)) continue;
|
|
24
|
-
if (e.type === l) {
|
|
25
|
-
n.push(...i(e.props.children));
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
const r = e.type;
|
|
29
|
-
typeof r == "string" || r[o] !== !0 || typeof e.props.id == "string" && n.push({ id: e.props.id, element: e });
|
|
30
|
-
}
|
|
31
|
-
return n;
|
|
32
|
-
}
|
|
33
|
-
function C({ current: t, children: n }) {
|
|
34
|
-
const e = i(n).find((r) => r.id === t);
|
|
35
|
-
return e ? e.element : null;
|
|
36
|
-
}
|
|
37
|
-
export {
|
|
38
|
-
m as S,
|
|
39
|
-
y as a,
|
|
40
|
-
C as b,
|
|
41
|
-
g as r,
|
|
42
|
-
i as s,
|
|
43
|
-
x as u
|
|
44
|
-
};
|
package/dist/Scenes-Dtt8UGE8.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("react/jsx-runtime"),r=require("react"),s=r.createContext(null);function l(e){if(!(typeof e!="object"||e===null||Array.isArray(e)))return e}function f(e,t){const n=r.useContext(s);return n===null||!n.direct?t:Object.prototype.hasOwnProperty.call(n.values,e)?n.values[e]:t}function a(e,t){return f(e,t)}const u="vctScene";function p({children:e}){return i.jsx(i.Fragment,{children:e})}p[u]=!0;function o(e){const t=[];for(const n of r.Children.toArray(e)){if(!r.isValidElement(n))continue;if(n.type===r.Fragment){t.push(...o(n.props.children));continue}const c=n.type;typeof c=="string"||c[u]!==!0||typeof n.props.id=="string"&&t.push({id:n.props.id,element:n})}return t}function S({current:e,children:t}){const n=o(t).find(c=>c.id===e);return n?n.element:null}exports.SampleContext=s;exports.Scene=p;exports.Scenes=S;exports.readSample=l;exports.sceneEntries=o;exports.useSceneSample=a;
|