@nebula-spatial/studio 0.1.0 → 0.1.2
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/README.md +2 -0
- package/dist/assets/openusd_three_loader-DLiqJWUM.js +13769 -0
- package/dist/assets/usd-export-worker-BRxTLqer.js +182 -0
- package/dist/assets/usd-worker-DekqMsQv.js +1392 -0
- package/dist/{builders-BAXRR5o5.js → builders-lydx4-Rh.js} +1 -1
- package/dist/core/session-persistence-controller.d.ts +55 -0
- package/dist/doc/placement-policy.d.ts +4 -0
- package/dist/editor/editor.d.ts +3 -1
- package/dist/editor/index.d.ts +2 -0
- package/dist/editor/session-persistence.d.ts +54 -0
- package/dist/editor.js +727 -490
- package/dist/export-evidence-z2Ne7Trf.js +2387 -0
- package/dist/generalization.js +2 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +314 -306
- package/dist/mjcf-visual-IOy-ucto.js +72 -0
- package/dist/mujoco-runtime-BYZnrvbR.js +467 -0
- package/dist/persist/indexeddb-store.d.ts +22 -2
- package/dist/persist/session.d.ts +22 -0
- package/dist/persist/snapshot.d.ts +24 -0
- package/dist/{physics-facts-tfQYyNTD.js → physics-facts-D-URIBrt.js} +8 -7
- package/dist/{placement-policy-DY_FNRDu.js → placement-policy-C6dV6Tf-.js} +161 -141
- package/dist/ports/persistence.d.ts +45 -1
- package/dist/project/contracts.d.ts +3 -0
- package/dist/remote-asset-resolver-D-UeyDMD.js +311 -0
- package/dist/{scene-graph-DBLKAhxa.js → scene-graph-DVOXjMmp.js} +2 -2
- package/dist/scene-session-PhoFXFCY.js +22006 -0
- package/dist/scene.js +2 -2
- package/dist/session-2bp8YOA4.js +963 -0
- package/dist/session-B3WbC7Y2.js +296 -0
- package/dist/session-B9kEf4xN.js +915 -0
- package/dist/session-DYThdzLZ.js +825 -0
- package/dist/studio/index.d.ts +5 -0
- package/dist/studio/indexeddb-persistence.d.ts +2 -0
- package/dist/studio/indexeddb-session-persistence.d.ts +11 -0
- package/dist/studio/scene-package-asset-sources.d.ts +14 -0
- package/dist/studio.js +1423 -1220
- package/dist/urdf-session-CRXL4bHf.js +1230 -0
- package/dist/usd-session-CTzInpNy.js +7385 -0
- package/dist/version.d.ts +1 -1
- package/dist/view/scene-session.d.ts +5 -1
- package/dist/wasm-module-DZn2AM1W.js +13 -0
- package/dist/xacro-IpPHTMYs.js +76 -0
- package/package.json +1 -1
- package/dist/asset-source-BExlEcRt.js +0 -444
- package/dist/assets/usd-export-worker-BsGubtAE.js +0 -1
- package/dist/editorial-BkAFWfbg.js +0 -83
- package/dist/export-evidence-B_0zRmb8.js +0 -5027
- package/dist/remote-asset-resolver-Cb8cfNmw.js +0 -136
- package/dist/scene-session-BV1HnxNh.js +0 -3506
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
var T = Object.defineProperty;
|
|
2
|
-
var w = (r, e, t) => e in r ? T(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
-
var a = (r, e, t) => w(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { h as b, e as _, a as n, c as p, r as A, D as v, w as M } from "./asset-source-BExlEcRt.js";
|
|
5
|
-
import { s as U, k as D } from "./builders-BAXRR5o5.js";
|
|
6
|
-
const l = /* @__PURE__ */ new WeakMap();
|
|
7
|
-
let I = 0;
|
|
8
|
-
function $(r, e) {
|
|
9
|
-
const t = Symbol(`studio-write-policy-${I++}`), o = l.get(r) ?? /* @__PURE__ */ new Map();
|
|
10
|
-
return o.set(t, { policy: e }), l.set(r, o), () => {
|
|
11
|
-
const s = l.get(r);
|
|
12
|
-
s && (s.delete(t), s.size === 0 && l.delete(r));
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
function k(r, e) {
|
|
16
|
-
const t = l.get(r);
|
|
17
|
-
if (!t) return { allowed: !0 };
|
|
18
|
-
for (const { policy: o } of t.values()) {
|
|
19
|
-
const s = o.check(e);
|
|
20
|
-
if (!s.allowed) return s;
|
|
21
|
-
}
|
|
22
|
-
return { allowed: !0 };
|
|
23
|
-
}
|
|
24
|
-
const h = {
|
|
25
|
-
scopeDenied: "ASSET_REMOTE_SCOPE_DENIED",
|
|
26
|
-
redirectDenied: "ASSET_REMOTE_REDIRECT_DENIED",
|
|
27
|
-
requestFailed: "ASSET_REMOTE_REQUEST_FAILED",
|
|
28
|
-
responseUrlMismatch: "ASSET_REMOTE_RESPONSE_URL_MISMATCH"
|
|
29
|
-
};
|
|
30
|
-
class B {
|
|
31
|
-
constructor(e, t) {
|
|
32
|
-
a(this, "source");
|
|
33
|
-
a(this, "entryUrl");
|
|
34
|
-
a(this, "blobs", /* @__PURE__ */ new Map());
|
|
35
|
-
a(this, "factsByKey", /* @__PURE__ */ new Map());
|
|
36
|
-
this.revision = t, this.source = b(e), this.entryUrl = new URL(this.source.entryUrl);
|
|
37
|
-
}
|
|
38
|
-
get entryLocator() {
|
|
39
|
-
return { kind: "remote-url", url: _(this.source) };
|
|
40
|
-
}
|
|
41
|
-
async entryBlob(e) {
|
|
42
|
-
return this.fetch(this.entryUrl, e);
|
|
43
|
-
}
|
|
44
|
-
async resolve(e, t = {}) {
|
|
45
|
-
const o = t.url ? new URL(t.url) : this.entryUrl, s = new URL(e, o);
|
|
46
|
-
return this.fetch(s, t.signal);
|
|
47
|
-
}
|
|
48
|
-
facts() {
|
|
49
|
-
return [...this.factsByKey.values()].sort((e, t) => n(e.locator).localeCompare(n(t.locator)));
|
|
50
|
-
}
|
|
51
|
-
blob(e) {
|
|
52
|
-
return this.blobs.get(n(e)) ?? null;
|
|
53
|
-
}
|
|
54
|
-
async fetch(e, t) {
|
|
55
|
-
t == null || t.throwIfAborted();
|
|
56
|
-
const o = p(e.href), s = { kind: "remote-url", url: o }, S = n(s);
|
|
57
|
-
this.assertScope(e);
|
|
58
|
-
const E = this.blobs.get(S);
|
|
59
|
-
if (E) return E;
|
|
60
|
-
const f = {
|
|
61
|
-
signal: t,
|
|
62
|
-
redirect: "error"
|
|
63
|
-
}, i = await (this.source.request ? this.source.request(e.href, f) : fetch(e.href, f));
|
|
64
|
-
if (t == null || t.throwIfAborted(), i.redirected)
|
|
65
|
-
throw c(
|
|
66
|
-
h.redirectDenied,
|
|
67
|
-
`Remote USD resource redirects are not allowed: ${e.href}.`
|
|
68
|
-
);
|
|
69
|
-
if (!i.ok)
|
|
70
|
-
throw c(
|
|
71
|
-
h.requestFailed,
|
|
72
|
-
`Remote USD resource request failed (${i.status}): ${e.href}.`
|
|
73
|
-
);
|
|
74
|
-
if (i.url) {
|
|
75
|
-
const m = new URL(i.url);
|
|
76
|
-
if (this.assertScope(m), p(m.href) !== o)
|
|
77
|
-
throw c(
|
|
78
|
-
h.responseUrlMismatch,
|
|
79
|
-
`Remote USD response URL does not match the requested canonical resource: ${i.url}.`
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
const u = await i.blob(), d = new Uint8Array(await u.arrayBuffer()), y = {
|
|
83
|
-
locator: s,
|
|
84
|
-
sha256: U(d),
|
|
85
|
-
byteSize: d.byteLength,
|
|
86
|
-
mediaType: A(
|
|
87
|
-
e.pathname,
|
|
88
|
-
u.type,
|
|
89
|
-
i.headers.get("content-type") ?? void 0
|
|
90
|
-
) ?? v
|
|
91
|
-
};
|
|
92
|
-
this.assertRevisionFact(y);
|
|
93
|
-
const R = u.type ? u : new Blob([d], { type: y.mediaType });
|
|
94
|
-
return this.blobs.set(S, R), this.factsByKey.set(S, y), R;
|
|
95
|
-
}
|
|
96
|
-
assertScope(e) {
|
|
97
|
-
if (!M(this.source, e))
|
|
98
|
-
throw c(
|
|
99
|
-
h.scopeDenied,
|
|
100
|
-
`Remote USD resource is outside the allowed scopes: ${e.href}.`
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
assertRevisionFact(e) {
|
|
104
|
-
const t = this.factsByKey.get(n(e.locator));
|
|
105
|
-
if (t && (t.sha256 !== e.sha256 || t.byteSize !== e.byteSize))
|
|
106
|
-
throw c(
|
|
107
|
-
"ASSET_SOURCE_FACTS_MISMATCH",
|
|
108
|
-
`Remote resource bytes changed within one load: ${e.locator.kind === "remote-url" ? e.locator.url : e.locator.path}.`
|
|
109
|
-
);
|
|
110
|
-
if (!this.revision) return;
|
|
111
|
-
const o = this.revision.resources.find((s) => n(s.locator) === n(e.locator));
|
|
112
|
-
if (!o) {
|
|
113
|
-
const s = "visualRevisionId" in this.revision ? this.revision.visualRevisionId : this.revision.revisionId;
|
|
114
|
-
throw c(
|
|
115
|
-
"ASSET_SOURCE_FACTS_MISMATCH",
|
|
116
|
-
`Remote resource is not declared by revision ${s}.`
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
C(e, o);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
function C(r, e) {
|
|
123
|
-
if (r.sha256 !== e.sha256 || r.byteSize !== e.byteSize || r.mediaType !== e.mediaType)
|
|
124
|
-
throw c(
|
|
125
|
-
"ASSET_SOURCE_FACTS_MISMATCH",
|
|
126
|
-
`Remote resource facts do not match revision resource ${n(e.locator)}.`
|
|
127
|
-
);
|
|
128
|
-
}
|
|
129
|
-
function c(r, e) {
|
|
130
|
-
return new D(r, e);
|
|
131
|
-
}
|
|
132
|
-
export {
|
|
133
|
-
B as S,
|
|
134
|
-
k as e,
|
|
135
|
-
$ as i
|
|
136
|
-
};
|