@tomorrowevening/hermes 0.0.5 → 0.0.7
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/dist/hermes.js +314 -303
- package/dist/hermes.umd.cjs +12 -12
- package/package.json +6 -3
- package/src/editor/sceneHierarchy/ChildObject.tsx +1 -1
- package/src/editor/sceneHierarchy/inspector/Inspector.tsx +51 -38
- package/src/example/CustomEditor.tsx +0 -40
- package/src/example/components/App.css +0 -6
- package/src/example/components/App.tsx +0 -164
- package/src/example/constants.ts +0 -44
- package/src/example/index.scss +0 -37
- package/src/example/main.tsx +0 -35
- package/src/example/three/CustomMaterial.ts +0 -58
- package/src/example/three/ExampleScene.ts +0 -176
- package/src/example/three/FBXAnimation.ts +0 -39
- package/src/vite-env.d.ts +0 -1
- package/types/example/CustomEditor.d.ts +0 -1
- package/types/example/components/App.d.ts +0 -3
- package/types/example/constants.d.ts +0 -15
- package/types/example/main.d.ts +0 -1
- package/types/example/three/CustomMaterial.d.ts +0 -5
- package/types/example/three/ExampleScene.d.ts +0 -18
- package/types/example/three/FBXAnimation.d.ts +0 -6
package/dist/hermes.js
CHANGED
@@ -22,11 +22,11 @@ function Dn(t) {
|
|
22
22
|
return t.r !== void 0 && t.g !== void 0 && t.b !== void 0;
|
23
23
|
}
|
24
24
|
function _n(t) {
|
25
|
-
const n = Math.round(t.r * 255), r = Math.round(t.g * 255), e = Math.round(t.b * 255), i = (
|
26
|
-
const h =
|
25
|
+
const n = Math.round(t.r * 255), r = Math.round(t.g * 255), e = Math.round(t.b * 255), i = (l) => {
|
26
|
+
const h = l.toString(16);
|
27
27
|
return h.length === 1 ? "0" + h : h;
|
28
|
-
},
|
29
|
-
return "#" +
|
28
|
+
}, d = i(n), c = i(r), s = i(e);
|
29
|
+
return "#" + d + c + s;
|
30
30
|
}
|
31
31
|
let Dt = 0;
|
32
32
|
const Kt = (t) => {
|
@@ -141,7 +141,7 @@ class Ca extends ut {
|
|
141
141
|
let e = this.sheets.get(r);
|
142
142
|
return e !== void 0 || (e = (i = this.project) == null ? void 0 : i.sheet(r), this.sheets.set(r, e)), e;
|
143
143
|
}
|
144
|
-
sheetObject(r, e, i,
|
144
|
+
sheetObject(r, e, i, d) {
|
145
145
|
if (this.project === void 0) {
|
146
146
|
console.error("Theatre Project hasn't been created yet.");
|
147
147
|
return;
|
@@ -150,11 +150,11 @@ class Ca extends ut {
|
|
150
150
|
if (c === void 0)
|
151
151
|
return;
|
152
152
|
const s = `${r}_${e}`;
|
153
|
-
let
|
154
|
-
if (
|
155
|
-
return
|
156
|
-
|
157
|
-
const h =
|
153
|
+
let l = this.sheetObjects.get(s);
|
154
|
+
if (l !== void 0)
|
155
|
+
return l = c.object(e, { ...i, ...l.value }, { reconfigure: !0 }), l;
|
156
|
+
l = c.object(e, i), this.sheetObjects.set(s, l), this.sheetObjectCBs.set(s, d !== void 0 ? d : Xt);
|
157
|
+
const h = l.onValuesChange((m) => {
|
158
158
|
if (this.app.editor) {
|
159
159
|
for (const g in m) {
|
160
160
|
const E = m[g];
|
@@ -178,7 +178,7 @@ class Ca extends ut {
|
|
178
178
|
g !== void 0 && g(m);
|
179
179
|
}
|
180
180
|
});
|
181
|
-
return this.sheetObjectUnsubscribe.set(s, h),
|
181
|
+
return this.sheetObjectUnsubscribe.set(s, h), l;
|
182
182
|
}
|
183
183
|
unsubscribe(r) {
|
184
184
|
if (this.project === void 0) {
|
@@ -250,8 +250,8 @@ function _t(t) {
|
|
250
250
|
if (i !== null)
|
251
251
|
if (n[r] = i, i.isTexture)
|
252
252
|
if (i instanceof zt) {
|
253
|
-
const
|
254
|
-
n[r] = { src:
|
253
|
+
const d = i.source.toJSON();
|
254
|
+
n[r] = { src: d.url };
|
255
255
|
} else
|
256
256
|
i instanceof dn && (console.log("env map"), console.log(i.source.data), console.log(i.source.toJSON()), n[r] = { src: "" });
|
257
257
|
else
|
@@ -446,9 +446,9 @@ class Oa extends ut {
|
|
446
446
|
return `debug_${Math.max(this.appCallbacks, this.editorCallbacks)}`;
|
447
447
|
}
|
448
448
|
// Binding
|
449
|
-
bind(r, e, i,
|
449
|
+
bind(r, e, i, d = void 0) {
|
450
450
|
const c = this.bindID, s = i.onChange !== void 0 ? i.onChange : Xt;
|
451
|
-
this.bindCBs.set(c, s), this.app.editor ? (this.pane === void 0 && this.createGUI(), (
|
451
|
+
this.bindCBs.set(c, s), this.app.editor ? (this.pane === void 0 && this.createGUI(), (d !== void 0 ? d : this.pane).addBinding(r, e, i).on("change", (h) => {
|
452
452
|
this.app.send({
|
453
453
|
event: "updateBind",
|
454
454
|
target: "app",
|
@@ -464,7 +464,7 @@ class Oa extends ut {
|
|
464
464
|
id: c,
|
465
465
|
name: e,
|
466
466
|
params: i,
|
467
|
-
parent:
|
467
|
+
parent: d
|
468
468
|
}
|
469
469
|
}), this.appCallbacks++);
|
470
470
|
}
|
@@ -474,20 +474,20 @@ class Oa extends ut {
|
|
474
474
|
}
|
475
475
|
// Buttons
|
476
476
|
button(r, e, i = void 0) {
|
477
|
-
const
|
478
|
-
this.buttonCBs.set(
|
477
|
+
const d = this.bindID;
|
478
|
+
this.buttonCBs.set(d, e), this.app.editor ? (this.pane === void 0 && this.createGUI(), (i !== void 0 ? i : this.pane).addButton({ title: r }).on("click", () => {
|
479
479
|
this.app.send({
|
480
480
|
event: "clickButton",
|
481
481
|
target: "app",
|
482
482
|
data: {
|
483
|
-
id:
|
483
|
+
id: d
|
484
484
|
}
|
485
485
|
});
|
486
486
|
}), this.editorCallbacks++) : (this.app.send({
|
487
487
|
event: "addButton",
|
488
488
|
target: "app",
|
489
489
|
data: {
|
490
|
-
id:
|
490
|
+
id: d,
|
491
491
|
name: r,
|
492
492
|
callback: e,
|
493
493
|
parent: i
|
@@ -523,15 +523,15 @@ function Fn() {
|
|
523
523
|
if (At)
|
524
524
|
return He;
|
525
525
|
At = 1;
|
526
|
-
var t = Wt, n = Symbol.for("react.element"), r = Symbol.for("react.fragment"), e = Object.prototype.hasOwnProperty, i = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,
|
527
|
-
function c(s,
|
526
|
+
var t = Wt, n = Symbol.for("react.element"), r = Symbol.for("react.fragment"), e = Object.prototype.hasOwnProperty, i = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
|
527
|
+
function c(s, l, h) {
|
528
528
|
var m, g = {}, E = null, C = null;
|
529
|
-
h !== void 0 && (E = "" + h),
|
530
|
-
for (m in
|
531
|
-
e.call(
|
529
|
+
h !== void 0 && (E = "" + h), l.key !== void 0 && (E = "" + l.key), l.ref !== void 0 && (C = l.ref);
|
530
|
+
for (m in l)
|
531
|
+
e.call(l, m) && !d.hasOwnProperty(m) && (g[m] = l[m]);
|
532
532
|
if (s && s.defaultProps)
|
533
|
-
for (m in
|
534
|
-
g[m] === void 0 && (g[m] =
|
533
|
+
for (m in l = s.defaultProps, l)
|
534
|
+
g[m] === void 0 && (g[m] = l[m]);
|
535
535
|
return { $$typeof: n, type: s, key: E, ref: C, props: g, _owner: i.current };
|
536
536
|
}
|
537
537
|
return He.Fragment = r, He.jsx = c, He.jsxs = c, He;
|
@@ -549,7 +549,7 @@ var Ke = {};
|
|
549
549
|
var It;
|
550
550
|
function Un() {
|
551
551
|
return It || (It = 1, process.env.NODE_ENV !== "production" && function() {
|
552
|
-
var t = Wt, n = Symbol.for("react.element"), r = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"),
|
552
|
+
var t = Wt, n = Symbol.for("react.element"), r = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), s = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), C = Symbol.for("react.offscreen"), R = Symbol.iterator, D = "@@iterator";
|
553
553
|
function y(a) {
|
554
554
|
if (a === null || typeof a != "object")
|
555
555
|
return null;
|
@@ -577,7 +577,7 @@ function Un() {
|
|
577
577
|
var j = !1, z = !1, ee = !1, T = !1, le = !1, Te;
|
578
578
|
Te = Symbol.for("react.module.reference");
|
579
579
|
function oe(a) {
|
580
|
-
return !!(typeof a == "string" || typeof a == "function" || a === e || a ===
|
580
|
+
return !!(typeof a == "string" || typeof a == "function" || a === e || a === d || le || a === i || a === h || a === m || T || a === C || j || z || ee || typeof a == "object" && a !== null && (a.$$typeof === E || a.$$typeof === g || a.$$typeof === c || a.$$typeof === s || a.$$typeof === l || // This needs to include all possible module reference object
|
581
581
|
// types supported by any Flight configuration anywhere since
|
582
582
|
// we don't know which Flight build this will end up being used
|
583
583
|
// with.
|
@@ -605,7 +605,7 @@ function Un() {
|
|
605
605
|
return "Fragment";
|
606
606
|
case r:
|
607
607
|
return "Portal";
|
608
|
-
case
|
608
|
+
case d:
|
609
609
|
return "Profiler";
|
610
610
|
case i:
|
611
611
|
return "StrictMode";
|
@@ -622,7 +622,7 @@ function Un() {
|
|
622
622
|
case c:
|
623
623
|
var p = a;
|
624
624
|
return A(p._context) + ".Provider";
|
625
|
-
case
|
625
|
+
case l:
|
626
626
|
return M(a, a.render, "ForwardRef");
|
627
627
|
case g:
|
628
628
|
var x = a.displayName || null;
|
@@ -812,7 +812,7 @@ function Un() {
|
|
812
812
|
}
|
813
813
|
if (typeof a == "object")
|
814
814
|
switch (a.$$typeof) {
|
815
|
-
case
|
815
|
+
case l:
|
816
816
|
return et(a.render);
|
817
817
|
case g:
|
818
818
|
return ve(a.type, f, p);
|
@@ -1064,7 +1064,7 @@ Check the top-level render call using <` + p + ">.");
|
|
1064
1064
|
var p;
|
1065
1065
|
if (typeof f == "function")
|
1066
1066
|
p = f.propTypes;
|
1067
|
-
else if (typeof f == "object" && (f.$$typeof ===
|
1067
|
+
else if (typeof f == "object" && (f.$$typeof === l || // Note: Memo only checks outer props here.
|
1068
1068
|
// Inner props are checked in the reconciler.
|
1069
1069
|
f.$$typeof === g))
|
1070
1070
|
p = f.propTypes;
|
@@ -1134,15 +1134,15 @@ Check the top-level render call using <` + p + ">.");
|
|
1134
1134
|
}()), Ke;
|
1135
1135
|
}
|
1136
1136
|
process.env.NODE_ENV === "production" ? Et.exports = Fn() : Et.exports = Un();
|
1137
|
-
var
|
1137
|
+
var u = Et.exports;
|
1138
1138
|
function Zt(t) {
|
1139
|
-
return t.title.search("<") > -1 ? /* @__PURE__ */
|
1139
|
+
return t.title.search("<") > -1 ? /* @__PURE__ */ u.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: t.title } }) : /* @__PURE__ */ u.jsx("button", { children: t.title });
|
1140
1140
|
}
|
1141
|
-
const Bn = /* @__PURE__ */
|
1142
|
-
/* @__PURE__ */
|
1143
|
-
/* @__PURE__ */
|
1144
|
-
/* @__PURE__ */
|
1145
|
-
] }), $n = /* @__PURE__ */
|
1141
|
+
const Bn = /* @__PURE__ */ u.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
|
1142
|
+
/* @__PURE__ */ u.jsx("circle", { cx: "7", cy: "7", r: "6" }),
|
1143
|
+
/* @__PURE__ */ u.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
|
1144
|
+
/* @__PURE__ */ u.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
|
1145
|
+
] }), $n = /* @__PURE__ */ u.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ u.jsx(
|
1146
1146
|
"path",
|
1147
1147
|
{
|
1148
1148
|
d: `M10.43,4H3.57C3.26,4,3,4.22,3,4.5v1C3,5.78,3.26,6,3.57,6h6.86C10.74,6,11,5.78,11,5.5v-1
|
@@ -1151,45 +1151,45 @@ C11,8.22,10.74,8,10.43,8z`
|
|
1151
1151
|
}
|
1152
1152
|
) });
|
1153
1153
|
function Gn(t) {
|
1154
|
-
return /* @__PURE__ */
|
1154
|
+
return /* @__PURE__ */ u.jsx(Ht.Item, { value: t.title, children: /* @__PURE__ */ u.jsxs("div", { children: [
|
1155
1155
|
$n,
|
1156
|
-
/* @__PURE__ */
|
1157
|
-
/* @__PURE__ */
|
1156
|
+
/* @__PURE__ */ u.jsx("span", { children: t.title }),
|
1157
|
+
/* @__PURE__ */ u.jsx("button", { className: "closeIcon", onClick: () => {
|
1158
1158
|
t.onDelete(t.index);
|
1159
1159
|
}, children: Bn })
|
1160
1160
|
] }) }, t.title);
|
1161
1161
|
}
|
1162
1162
|
function Yn(t) {
|
1163
|
-
const [n, r] = re(!1), [e, i] = re(t.options),
|
1163
|
+
const [n, r] = re(!1), [e, i] = re(t.options), d = (h) => {
|
1164
1164
|
t.onDragComplete(h), i(h);
|
1165
1165
|
}, c = (h) => {
|
1166
1166
|
const m = [...e];
|
1167
|
-
m.splice(h, 1),
|
1167
|
+
m.splice(h, 1), d(m);
|
1168
1168
|
}, s = [];
|
1169
1169
|
e.forEach((h, m) => {
|
1170
|
-
s.push(/* @__PURE__ */
|
1170
|
+
s.push(/* @__PURE__ */ u.jsx(Gn, { index: m, title: h, onDelete: c }, h));
|
1171
1171
|
});
|
1172
|
-
let
|
1173
|
-
return t.subdropdown && (
|
1174
|
-
/* @__PURE__ */
|
1175
|
-
/* @__PURE__ */
|
1172
|
+
let l = "dropdown draggable";
|
1173
|
+
return t.subdropdown && (l += " subdropdown"), /* @__PURE__ */ u.jsxs("div", { className: l, onMouseEnter: () => r(!0), onMouseLeave: () => r(!1), children: [
|
1174
|
+
/* @__PURE__ */ u.jsx(Zt, { title: t.title }),
|
1175
|
+
/* @__PURE__ */ u.jsx(Ht.Group, { axis: "y", values: e, onReorder: d, style: { visibility: n ? "visible" : "hidden" }, children: s })
|
1176
1176
|
] });
|
1177
1177
|
}
|
1178
1178
|
function Vn(t) {
|
1179
1179
|
const [n, r] = re(!1), e = [];
|
1180
|
-
t.options.map((
|
1181
|
-
t.onSelect !== void 0 && (
|
1180
|
+
t.options.map((d, c) => {
|
1181
|
+
t.onSelect !== void 0 && (d.onSelect = t.onSelect), e.push(/* @__PURE__ */ u.jsx(zn, { option: d }, c));
|
1182
1182
|
});
|
1183
1183
|
let i = "dropdown";
|
1184
|
-
return t.subdropdown && (i += " subdropdown"), /* @__PURE__ */
|
1184
|
+
return t.subdropdown && (i += " subdropdown"), /* @__PURE__ */ u.jsxs(
|
1185
1185
|
"div",
|
1186
1186
|
{
|
1187
1187
|
className: i,
|
1188
1188
|
onMouseEnter: () => r(!0),
|
1189
1189
|
onMouseLeave: () => r(!1),
|
1190
1190
|
children: [
|
1191
|
-
/* @__PURE__ */
|
1192
|
-
/* @__PURE__ */
|
1191
|
+
/* @__PURE__ */ u.jsx(Zt, { title: t.title }),
|
1192
|
+
/* @__PURE__ */ u.jsx(
|
1193
1193
|
"ul",
|
1194
1194
|
{
|
1195
1195
|
style: { visibility: n ? "visible" : "hidden" },
|
@@ -1205,20 +1205,20 @@ function zn(t) {
|
|
1205
1205
|
let i;
|
1206
1206
|
switch (n.type) {
|
1207
1207
|
case "draggable":
|
1208
|
-
i = /* @__PURE__ */
|
1208
|
+
i = /* @__PURE__ */ u.jsx(
|
1209
1209
|
Yn,
|
1210
1210
|
{
|
1211
1211
|
title: n.title,
|
1212
1212
|
options: n.value,
|
1213
|
-
onDragComplete: (
|
1214
|
-
n.onDragComplete !== void 0 && n.onDragComplete(
|
1213
|
+
onDragComplete: (d) => {
|
1214
|
+
n.onDragComplete !== void 0 && n.onDragComplete(d);
|
1215
1215
|
},
|
1216
1216
|
subdropdown: !0
|
1217
1217
|
}
|
1218
1218
|
);
|
1219
1219
|
break;
|
1220
1220
|
case "dropdown":
|
1221
|
-
i = /* @__PURE__ */
|
1221
|
+
i = /* @__PURE__ */ u.jsx(
|
1222
1222
|
Vn,
|
1223
1223
|
{
|
1224
1224
|
title: n.title,
|
@@ -1229,7 +1229,7 @@ function zn(t) {
|
|
1229
1229
|
);
|
1230
1230
|
break;
|
1231
1231
|
case "option":
|
1232
|
-
i = /* @__PURE__ */
|
1232
|
+
i = /* @__PURE__ */ u.jsx(
|
1233
1233
|
"button",
|
1234
1234
|
{
|
1235
1235
|
onClick: () => {
|
@@ -1240,12 +1240,12 @@ function zn(t) {
|
|
1240
1240
|
);
|
1241
1241
|
break;
|
1242
1242
|
}
|
1243
|
-
return /* @__PURE__ */
|
1243
|
+
return /* @__PURE__ */ u.jsx("li", { className: r === n.title ? "selected" : "", children: i }, kn());
|
1244
1244
|
}
|
1245
1245
|
function Ta(t) {
|
1246
1246
|
let n;
|
1247
1247
|
function r(c) {
|
1248
|
-
var
|
1248
|
+
var l, h, m, g, E, C, R, D, y;
|
1249
1249
|
let s;
|
1250
1250
|
switch (c.event) {
|
1251
1251
|
case "custom":
|
@@ -1258,7 +1258,7 @@ function Ta(t) {
|
|
1258
1258
|
I.dispatchEvent({ type: N.DRAG_UPDATE, value: c.data });
|
1259
1259
|
break;
|
1260
1260
|
case "addFolder":
|
1261
|
-
(
|
1261
|
+
(l = t.components.get("debug")) == null || l.addFolder(c.data.name, c.data.params, c.data.parent);
|
1262
1262
|
break;
|
1263
1263
|
case "bindObject":
|
1264
1264
|
(h = t.components.get("debug")) == null || h.bind(c.data.name, c.data.params, c.data.parent);
|
@@ -1317,7 +1317,7 @@ function Ta(t) {
|
|
1317
1317
|
function i() {
|
1318
1318
|
We.ui.hide();
|
1319
1319
|
}
|
1320
|
-
function
|
1320
|
+
function d() {
|
1321
1321
|
We.ui.restore(), We.onSelectionChange((h) => {
|
1322
1322
|
h.length < 1 || h.forEach((m) => {
|
1323
1323
|
var R;
|
@@ -1353,19 +1353,19 @@ function Ta(t) {
|
|
1353
1353
|
}
|
1354
1354
|
});
|
1355
1355
|
}
|
1356
|
-
},
|
1357
|
-
s(), requestAnimationFrame(
|
1356
|
+
}, l = () => {
|
1357
|
+
s(), requestAnimationFrame(l);
|
1358
1358
|
};
|
1359
|
-
s(),
|
1359
|
+
s(), l();
|
1360
1360
|
}
|
1361
1361
|
t.listen((c) => {
|
1362
1362
|
t.editor ? e(c) : r(c);
|
1363
|
-
}), t.editor ?
|
1363
|
+
}), t.editor ? d() : i();
|
1364
1364
|
}
|
1365
1365
|
function wt(t) {
|
1366
1366
|
const [n, r] = re(t.open !== void 0 ? t.open : !0), e = !n || t.children === void 0;
|
1367
|
-
return /* @__PURE__ */
|
1368
|
-
/* @__PURE__ */
|
1367
|
+
return /* @__PURE__ */ u.jsxs("div", { className: `accordion ${e ? "hide" : ""}`, children: [
|
1368
|
+
/* @__PURE__ */ u.jsxs(
|
1369
1369
|
"button",
|
1370
1370
|
{
|
1371
1371
|
className: "toggle",
|
@@ -1374,28 +1374,28 @@ function wt(t) {
|
|
1374
1374
|
t.onToggle !== void 0 && t.onToggle(i), r(i);
|
1375
1375
|
},
|
1376
1376
|
children: [
|
1377
|
-
/* @__PURE__ */
|
1377
|
+
/* @__PURE__ */ u.jsx(
|
1378
1378
|
"p",
|
1379
1379
|
{
|
1380
1380
|
className: `status ${n ? "open" : ""}`,
|
1381
1381
|
children: "Toggle"
|
1382
1382
|
}
|
1383
1383
|
),
|
1384
|
-
/* @__PURE__ */
|
1384
|
+
/* @__PURE__ */ u.jsx("p", { className: "label", children: t.label })
|
1385
1385
|
]
|
1386
1386
|
}
|
1387
1387
|
),
|
1388
1388
|
t.button,
|
1389
|
-
/* @__PURE__ */
|
1389
|
+
/* @__PURE__ */ u.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ u.jsx("div", { children: t.children }) })
|
1390
1390
|
] });
|
1391
1391
|
}
|
1392
1392
|
function Jt(t) {
|
1393
|
-
const [n, r] = re(
|
1394
|
-
return t.child.children.length > 0 && t.child.children.map((
|
1395
|
-
i.push(/* @__PURE__ */
|
1396
|
-
}), /* @__PURE__ */
|
1397
|
-
/* @__PURE__ */
|
1398
|
-
e ? /* @__PURE__ */
|
1393
|
+
const [n, r] = re(!1), e = t.child.children.length > 0, i = [];
|
1394
|
+
return t.child.children.length > 0 && t.child.children.map((d) => {
|
1395
|
+
i.push(/* @__PURE__ */ u.jsx(Jt, { child: d, three: t.three }, Math.random()));
|
1396
|
+
}), /* @__PURE__ */ u.jsxs("div", { className: "childObject", children: [
|
1397
|
+
/* @__PURE__ */ u.jsxs("div", { className: "child", children: [
|
1398
|
+
e ? /* @__PURE__ */ u.jsx(
|
1399
1399
|
"button",
|
1400
1400
|
{
|
1401
1401
|
className: "status",
|
@@ -1407,7 +1407,7 @@ function Jt(t) {
|
|
1407
1407
|
}
|
1408
1408
|
}
|
1409
1409
|
) : null,
|
1410
|
-
/* @__PURE__ */
|
1410
|
+
/* @__PURE__ */ u.jsx(
|
1411
1411
|
"button",
|
1412
1412
|
{
|
1413
1413
|
className: "name",
|
@@ -1420,16 +1420,16 @@ function Jt(t) {
|
|
1420
1420
|
children: t.child.name.length > 0 ? `${t.child.name} (${t.child.type})` : `${t.child.type}::${t.child.uuid}`
|
1421
1421
|
}
|
1422
1422
|
),
|
1423
|
-
/* @__PURE__ */
|
1423
|
+
/* @__PURE__ */ u.jsx("div", { className: `icon ${An(t.child)}` })
|
1424
1424
|
] }),
|
1425
|
-
/* @__PURE__ */
|
1425
|
+
/* @__PURE__ */ u.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ u.jsx("div", { className: "container", children: i }) })
|
1426
1426
|
] }, Math.random());
|
1427
1427
|
}
|
1428
1428
|
function Wn(t) {
|
1429
1429
|
const n = [];
|
1430
1430
|
return t.child.children.map((r) => {
|
1431
|
-
n.push(/* @__PURE__ */
|
1432
|
-
}), /* @__PURE__ */
|
1431
|
+
n.push(/* @__PURE__ */ u.jsx(Jt, { child: r, three: t.three }, Math.random()));
|
1432
|
+
}), /* @__PURE__ */ u.jsx("div", { className: `scene ${t.class !== void 0 ? t.class : ""}`, children: n });
|
1433
1433
|
}
|
1434
1434
|
const Hn = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
|
1435
1435
|
function Kn(t) {
|
@@ -1442,9 +1442,9 @@ function Ae(t) {
|
|
1442
1442
|
const r = [];
|
1443
1443
|
return t.items.forEach((e) => {
|
1444
1444
|
Kn(e) ? r.push(
|
1445
|
-
/* @__PURE__ */
|
1445
|
+
/* @__PURE__ */ u.jsx(Ae, { title: e.title, items: e.items }, Math.random())
|
1446
1446
|
) : r.push(
|
1447
|
-
/* @__PURE__ */
|
1447
|
+
/* @__PURE__ */ u.jsx(
|
1448
1448
|
Xe,
|
1449
1449
|
{
|
1450
1450
|
title: e.title,
|
@@ -1455,14 +1455,14 @@ function Ae(t) {
|
|
1455
1455
|
max: e.max,
|
1456
1456
|
step: e.step,
|
1457
1457
|
disabled: e.disabled,
|
1458
|
-
onChange: (i,
|
1459
|
-
e.onChange !== void 0 ? e.onChange(i,
|
1458
|
+
onChange: (i, d) => {
|
1459
|
+
e.onChange !== void 0 ? e.onChange(i, d) : n(i, d);
|
1460
1460
|
}
|
1461
1461
|
},
|
1462
1462
|
Math.random()
|
1463
1463
|
)
|
1464
1464
|
);
|
1465
|
-
}), /* @__PURE__ */
|
1465
|
+
}), /* @__PURE__ */ u.jsx(wt, { label: t.title, open: !1, children: r });
|
1466
1466
|
}
|
1467
1467
|
function Xn(t) {
|
1468
1468
|
return !(t === "alphaHash" || t === "alphaToCoverage" || t === "attenuationDistance" || t === "colorWrite" || t === "combine" || t === "defaultAttributeValues" || t === "depthFunc" || t === "forceSinglePass" || t === "glslVersion" || t === "linewidth" || t === "normalMapType" || t === "precision" || t === "premultipliedAlpha" || t === "shadowSide" || t === "side" || t === "toneMapped" || t === "uniformsGroups" || t === "uniformsNeedUpdate" || t === "userData" || t === "vertexColors" || t === "version" || t === "wireframeLinecap" || t === "wireframeLinejoin" || t === "wireframeLinewidth" || t.slice(0, 5) === "blend" || t.slice(0, 4) === "clip" || t.slice(0, 7) === "polygon" || t.slice(0, 7) === "stencil" || t.slice(0, 2) === "is");
|
@@ -1595,8 +1595,8 @@ function Zn() {
|
|
1595
1595
|
r();
|
1596
1596
|
else {
|
1597
1597
|
const e = t.files[0], i = new FileReader();
|
1598
|
-
i.onload = function(
|
1599
|
-
n(
|
1598
|
+
i.onload = function(d) {
|
1599
|
+
n(d.target.result);
|
1600
1600
|
}, i.readAsDataURL(e);
|
1601
1601
|
}
|
1602
1602
|
}), t.click();
|
@@ -1607,33 +1607,33 @@ function Nt(t, n, r) {
|
|
1607
1607
|
for (const i in t) {
|
1608
1608
|
if (!Xn(i))
|
1609
1609
|
continue;
|
1610
|
-
const
|
1611
|
-
if (
|
1610
|
+
const d = typeof t[i], c = t[i];
|
1611
|
+
if (d === "boolean" || d === "number" || d === "string") {
|
1612
1612
|
const s = {
|
1613
1613
|
title: xe(i),
|
1614
1614
|
prop: i,
|
1615
|
-
type:
|
1615
|
+
type: d,
|
1616
1616
|
value: c,
|
1617
1617
|
min: void 0,
|
1618
1618
|
max: void 0,
|
1619
|
-
onChange: (
|
1619
|
+
onChange: (l, h) => {
|
1620
1620
|
var g;
|
1621
|
-
r.updateObject(n.uuid, `material.${
|
1621
|
+
r.updateObject(n.uuid, `material.${l}`, h), d === "boolean" && r.updateObject(n.uuid, "material.needsUpdate", !0);
|
1622
1622
|
const m = (g = r.scene) == null ? void 0 : g.getObjectByProperty("uuid", n.uuid);
|
1623
|
-
m !== void 0 && Z(m, `material.${
|
1623
|
+
m !== void 0 && Z(m, `material.${l}`, h);
|
1624
1624
|
}
|
1625
1625
|
};
|
1626
1626
|
qn(i) && (s.value = Number(c), s.type = "range", s.min = 0, s.max = 1, s.step = 0.01), e.push(s);
|
1627
|
-
} else if (
|
1627
|
+
} else if (d === "object")
|
1628
1628
|
if (c.isColor)
|
1629
1629
|
e.push({
|
1630
1630
|
title: xe(i),
|
1631
1631
|
prop: i,
|
1632
1632
|
type: "color",
|
1633
1633
|
value: c,
|
1634
|
-
onChange: (s,
|
1634
|
+
onChange: (s, l) => {
|
1635
1635
|
var g;
|
1636
|
-
const h = new St(
|
1636
|
+
const h = new St(l);
|
1637
1637
|
r.updateObject(n.uuid, `material.${s}`, h);
|
1638
1638
|
const m = (g = r.scene) == null ? void 0 : g.getObjectByProperty("uuid", n.uuid);
|
1639
1639
|
m !== void 0 && Z(m, `material.${s}`, h);
|
@@ -1641,11 +1641,11 @@ function Nt(t, n, r) {
|
|
1641
1641
|
});
|
1642
1642
|
else if (Array.isArray(c)) {
|
1643
1643
|
const s = [];
|
1644
|
-
for (const
|
1644
|
+
for (const l in c)
|
1645
1645
|
s.push({
|
1646
|
-
title: `${
|
1647
|
-
type: `${typeof c[
|
1648
|
-
value: c[
|
1646
|
+
title: `${l}`,
|
1647
|
+
type: `${typeof c[l]}`,
|
1648
|
+
value: c[l],
|
1649
1649
|
onChange: (h, m) => {
|
1650
1650
|
var E;
|
1651
1651
|
r.updateObject(n.uuid, `material.${i}`, m);
|
@@ -1659,13 +1659,13 @@ function Nt(t, n, r) {
|
|
1659
1659
|
});
|
1660
1660
|
} else {
|
1661
1661
|
const s = [];
|
1662
|
-
for (const
|
1663
|
-
const h = c[
|
1662
|
+
for (const l in c) {
|
1663
|
+
const h = c[l];
|
1664
1664
|
switch (typeof h) {
|
1665
1665
|
case "boolean":
|
1666
1666
|
case "number":
|
1667
1667
|
case "string":
|
1668
|
-
|
1668
|
+
l === "src" ? e.push({
|
1669
1669
|
title: xe(i),
|
1670
1670
|
type: "image",
|
1671
1671
|
value: h,
|
@@ -1678,40 +1678,40 @@ function Nt(t, n, r) {
|
|
1678
1678
|
});
|
1679
1679
|
}
|
1680
1680
|
}) : s.push({
|
1681
|
-
title: `${xe(
|
1682
|
-
prop: `material.${i}.${
|
1683
|
-
type: `${typeof t[i][
|
1684
|
-
value: c[
|
1681
|
+
title: `${xe(l)}`,
|
1682
|
+
prop: `material.${i}.${l}`,
|
1683
|
+
type: `${typeof t[i][l]}`,
|
1684
|
+
value: c[l],
|
1685
1685
|
onChange: (g, E) => {
|
1686
1686
|
var R;
|
1687
|
-
r.updateObject(n.uuid, `material.${i}.${
|
1687
|
+
r.updateObject(n.uuid, `material.${i}.${l}`, E);
|
1688
1688
|
const C = (R = r.scene) == null ? void 0 : R.getObjectByProperty("uuid", n.uuid);
|
1689
|
-
C !== void 0 && Z(C, `material.${i}.${
|
1689
|
+
C !== void 0 && Z(C, `material.${i}.${l}`, E);
|
1690
1690
|
}
|
1691
1691
|
});
|
1692
1692
|
break;
|
1693
1693
|
case "object":
|
1694
1694
|
h.value !== void 0 && h.value.src !== void 0 ? s.push({
|
1695
|
-
title: xe(
|
1695
|
+
title: xe(l),
|
1696
1696
|
type: "image",
|
1697
1697
|
value: h.value.src,
|
1698
1698
|
onChange: (g, E) => {
|
1699
1699
|
var R;
|
1700
|
-
r.createTexture(n.uuid, `material.${i}.${
|
1700
|
+
r.createTexture(n.uuid, `material.${i}.${l}.value`, E);
|
1701
1701
|
const C = (R = r.scene) == null ? void 0 : R.getObjectByProperty("uuid", n.uuid);
|
1702
1702
|
C !== void 0 && yt(E).then((D) => {
|
1703
|
-
Z(C, `material.${i}.${
|
1703
|
+
Z(C, `material.${i}.${l}.value`, D);
|
1704
1704
|
});
|
1705
1705
|
}
|
1706
1706
|
}) : s.push({
|
1707
|
-
title:
|
1707
|
+
title: l,
|
1708
1708
|
type: `${typeof h.value}`,
|
1709
1709
|
value: h.value,
|
1710
1710
|
onChange: (g, E) => {
|
1711
1711
|
var R;
|
1712
|
-
r.updateObject(n.uuid, `material.${i}.${
|
1712
|
+
r.updateObject(n.uuid, `material.${i}.${l}.value`, E);
|
1713
1713
|
const C = (R = r.scene) == null ? void 0 : R.getObjectByProperty("uuid", n.uuid);
|
1714
|
-
C !== void 0 && Z(C, `material.${i}.${
|
1714
|
+
C !== void 0 && Z(C, `material.${i}.${l}.value`, E);
|
1715
1715
|
}
|
1716
1716
|
});
|
1717
1717
|
break;
|
@@ -1723,9 +1723,9 @@ function Nt(t, n, r) {
|
|
1723
1723
|
});
|
1724
1724
|
}
|
1725
1725
|
else
|
1726
|
-
c !== void 0 && console.log("other:", i,
|
1726
|
+
c !== void 0 && console.log("other:", i, d, c);
|
1727
1727
|
}
|
1728
|
-
return e.sort((i,
|
1728
|
+
return e.sort((i, d) => i.title < d.title ? -1 : i.title > d.title ? 1 : 0), e.push({
|
1729
1729
|
title: "Update Material",
|
1730
1730
|
type: "button",
|
1731
1731
|
onChange: () => {
|
@@ -1737,19 +1737,19 @@ function Jn(t, n) {
|
|
1737
1737
|
const r = t.material;
|
1738
1738
|
if (Array.isArray(r)) {
|
1739
1739
|
const e = [], i = r.length;
|
1740
|
-
for (let
|
1740
|
+
for (let d = 0; d < i; d++)
|
1741
1741
|
e.push(
|
1742
|
-
/* @__PURE__ */
|
1742
|
+
/* @__PURE__ */ u.jsx(
|
1743
1743
|
Ae,
|
1744
1744
|
{
|
1745
|
-
title: `Material ${
|
1746
|
-
items: Nt(r[
|
1745
|
+
title: `Material ${d}`,
|
1746
|
+
items: Nt(r[d], t, n)
|
1747
1747
|
}
|
1748
1748
|
)
|
1749
1749
|
);
|
1750
|
-
return /* @__PURE__ */
|
1750
|
+
return /* @__PURE__ */ u.jsx(u.Fragment, { children: e });
|
1751
1751
|
} else
|
1752
|
-
return /* @__PURE__ */
|
1752
|
+
return /* @__PURE__ */ u.jsx(
|
1753
1753
|
Ae,
|
1754
1754
|
{
|
1755
1755
|
title: "Material",
|
@@ -1760,7 +1760,7 @@ function Jn(t, n) {
|
|
1760
1760
|
function Xe(t) {
|
1761
1761
|
let n = t.value;
|
1762
1762
|
n !== void 0 && n.isColor !== void 0 && (n = _n(t.value));
|
1763
|
-
const [r, e] = re(n), i = Se(null),
|
1763
|
+
const [r, e] = re(n), i = Se(null), d = Se(null), c = Se(null);
|
1764
1764
|
qe(() => {
|
1765
1765
|
var O;
|
1766
1766
|
let m = !1, g = -1, E = 0, C = Number(r);
|
@@ -1770,7 +1770,7 @@ function Xe(t) {
|
|
1770
1770
|
if (!m)
|
1771
1771
|
return;
|
1772
1772
|
const z = t.step !== void 0 ? t.step : 1, ee = (j.clientX - g) * z;
|
1773
|
-
C = Number((E + ee).toFixed(4)),
|
1773
|
+
C = Number((E + ee).toFixed(4)), d.current !== null && (d.current.value = C.toString()), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, C);
|
1774
1774
|
}, y = () => {
|
1775
1775
|
m = !1;
|
1776
1776
|
}, b = () => {
|
@@ -1782,13 +1782,13 @@ function Xe(t) {
|
|
1782
1782
|
};
|
1783
1783
|
}, [r]);
|
1784
1784
|
const s = t.type === "string" && (r.length > 100 || r.search(`
|
1785
|
-
`) > -1),
|
1785
|
+
`) > -1), l = s || t.type === "image", h = (m) => {
|
1786
1786
|
let g = m.target.value;
|
1787
1787
|
t.type === "boolean" && (g = m.target.checked), e(g), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, g);
|
1788
1788
|
};
|
1789
|
-
return /* @__PURE__ */
|
1790
|
-
t.type !== "button" && /* @__PURE__ */
|
1791
|
-
t.type === "string" && !s && /* @__PURE__ */
|
1789
|
+
return /* @__PURE__ */ u.jsxs("div", { className: `field ${l ? "block" : ""}`, children: [
|
1790
|
+
t.type !== "button" && /* @__PURE__ */ u.jsx("label", { ref: i, children: t.title }, "fieldLabel"),
|
1791
|
+
t.type === "string" && !s && /* @__PURE__ */ u.jsx(
|
1792
1792
|
"input",
|
1793
1793
|
{
|
1794
1794
|
type: "text",
|
@@ -1797,7 +1797,7 @@ function Xe(t) {
|
|
1797
1797
|
value: r
|
1798
1798
|
}
|
1799
1799
|
),
|
1800
|
-
t.type === "string" && s && /* @__PURE__ */
|
1800
|
+
t.type === "string" && s && /* @__PURE__ */ u.jsx(
|
1801
1801
|
"textarea",
|
1802
1802
|
{
|
1803
1803
|
cols: 50,
|
@@ -1807,7 +1807,7 @@ function Xe(t) {
|
|
1807
1807
|
value: r
|
1808
1808
|
}
|
1809
1809
|
),
|
1810
|
-
t.type === "boolean" && /* @__PURE__ */
|
1810
|
+
t.type === "boolean" && /* @__PURE__ */ u.jsx(
|
1811
1811
|
"input",
|
1812
1812
|
{
|
1813
1813
|
type: "checkbox",
|
@@ -1816,10 +1816,10 @@ function Xe(t) {
|
|
1816
1816
|
checked: r
|
1817
1817
|
}
|
1818
1818
|
),
|
1819
|
-
t.type === "number" && /* @__PURE__ */
|
1819
|
+
t.type === "number" && /* @__PURE__ */ u.jsx(
|
1820
1820
|
"input",
|
1821
1821
|
{
|
1822
|
-
ref:
|
1822
|
+
ref: d,
|
1823
1823
|
type: "number",
|
1824
1824
|
value: r,
|
1825
1825
|
min: t.min,
|
@@ -1828,9 +1828,9 @@ function Xe(t) {
|
|
1828
1828
|
onChange: h
|
1829
1829
|
}
|
1830
1830
|
),
|
1831
|
-
t.type === "range" && /* @__PURE__ */
|
1832
|
-
/* @__PURE__ */
|
1833
|
-
/* @__PURE__ */
|
1831
|
+
t.type === "range" && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
1832
|
+
/* @__PURE__ */ u.jsx("input", { type: "text", value: r.toString(), onChange: h, className: "min" }),
|
1833
|
+
/* @__PURE__ */ u.jsx(
|
1834
1834
|
"input",
|
1835
1835
|
{
|
1836
1836
|
disabled: t.disabled,
|
@@ -1843,11 +1843,11 @@ function Xe(t) {
|
|
1843
1843
|
}
|
1844
1844
|
)
|
1845
1845
|
] }),
|
1846
|
-
t.type === "color" && /* @__PURE__ */
|
1847
|
-
/* @__PURE__ */
|
1848
|
-
/* @__PURE__ */
|
1846
|
+
t.type === "color" && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
1847
|
+
/* @__PURE__ */ u.jsx("input", { type: "text", value: r.toString(), onChange: h, className: "color" }),
|
1848
|
+
/* @__PURE__ */ u.jsx("input", { type: "color", value: r, onChange: h })
|
1849
1849
|
] }),
|
1850
|
-
t.type === "button" && /* @__PURE__ */
|
1850
|
+
t.type === "button" && /* @__PURE__ */ u.jsx(
|
1851
1851
|
"button",
|
1852
1852
|
{
|
1853
1853
|
onClick: () => {
|
@@ -1856,7 +1856,7 @@ function Xe(t) {
|
|
1856
1856
|
children: t.title
|
1857
1857
|
}
|
1858
1858
|
),
|
1859
|
-
t.type === "image" && /* @__PURE__ */
|
1859
|
+
t.type === "image" && /* @__PURE__ */ u.jsx("img", { ref: c, onClick: () => {
|
1860
1860
|
Zn().then((m) => {
|
1861
1861
|
c.current.src = m, t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, m);
|
1862
1862
|
});
|
@@ -1902,11 +1902,11 @@ function Qn(t, n) {
|
|
1902
1902
|
type: "number",
|
1903
1903
|
step: 0.01,
|
1904
1904
|
value: t.perspectiveCameraInfo[e],
|
1905
|
-
onChange: (i,
|
1905
|
+
onChange: (i, d) => {
|
1906
1906
|
var s;
|
1907
|
-
n.updateObject(t.uuid, i,
|
1907
|
+
n.updateObject(t.uuid, i, d), n.requestMethod(t.uuid, "updateProjectionMatrix");
|
1908
1908
|
const c = (s = n.scene) == null ? void 0 : s.getObjectByProperty("uuid", t.uuid);
|
1909
|
-
c !== void 0 && (Z(c, i,
|
1909
|
+
c !== void 0 && (Z(c, i, d), c.updateProjectionMatrix());
|
1910
1910
|
}
|
1911
1911
|
});
|
1912
1912
|
else if (t.orthographicCameraInfo !== void 0)
|
@@ -1917,14 +1917,14 @@ function Qn(t, n) {
|
|
1917
1917
|
type: "number",
|
1918
1918
|
step: 0.01,
|
1919
1919
|
value: t.perspectiveCameraInfo[e],
|
1920
|
-
onChange: (i,
|
1920
|
+
onChange: (i, d) => {
|
1921
1921
|
var s;
|
1922
|
-
n.updateObject(t.uuid, i,
|
1922
|
+
n.updateObject(t.uuid, i, d), n.requestMethod(t.uuid, "updateProjectionMatrix");
|
1923
1923
|
const c = (s = n.scene) == null ? void 0 : s.getObjectByProperty("uuid", t.uuid);
|
1924
|
-
c !== void 0 && (Z(c, i,
|
1924
|
+
c !== void 0 && (Z(c, i, d), c.updateProjectionMatrix());
|
1925
1925
|
}
|
1926
1926
|
});
|
1927
|
-
return /* @__PURE__ */
|
1927
|
+
return /* @__PURE__ */ u.jsx(
|
1928
1928
|
Ae,
|
1929
1929
|
{
|
1930
1930
|
title: "Camera",
|
@@ -1935,13 +1935,13 @@ function Qn(t, n) {
|
|
1935
1935
|
function ea(t, n) {
|
1936
1936
|
const r = new fn();
|
1937
1937
|
r.elements = t.matrix;
|
1938
|
-
const e = new G(), i = new hn(),
|
1939
|
-
t.uuid.length > 0 && (e.setFromMatrixPosition(r), i.setFromRotationMatrix(r),
|
1940
|
-
const c = (
|
1938
|
+
const e = new G(), i = new hn(), d = new G();
|
1939
|
+
t.uuid.length > 0 && (e.setFromMatrixPosition(r), i.setFromRotationMatrix(r), d.setFromMatrixScale(r));
|
1940
|
+
const c = (l, h) => {
|
1941
1941
|
var g;
|
1942
|
-
n.updateObject(t.uuid,
|
1942
|
+
n.updateObject(t.uuid, l, h);
|
1943
1943
|
const m = (g = n.scene) == null ? void 0 : g.getObjectByProperty("uuid", t.uuid);
|
1944
|
-
m !== void 0 && Z(m,
|
1944
|
+
m !== void 0 && Z(m, l, h);
|
1945
1945
|
}, s = [
|
1946
1946
|
{
|
1947
1947
|
title: "Position",
|
@@ -2011,7 +2011,7 @@ function ea(t, n) {
|
|
2011
2011
|
title: "X",
|
2012
2012
|
prop: "scale.x",
|
2013
2013
|
type: "number",
|
2014
|
-
value:
|
2014
|
+
value: d.x,
|
2015
2015
|
step: 0.01,
|
2016
2016
|
onChange: c
|
2017
2017
|
},
|
@@ -2019,7 +2019,7 @@ function ea(t, n) {
|
|
2019
2019
|
title: "Y",
|
2020
2020
|
prop: "scale.y",
|
2021
2021
|
type: "number",
|
2022
|
-
value:
|
2022
|
+
value: d.y,
|
2023
2023
|
step: 0.01,
|
2024
2024
|
onChange: c
|
2025
2025
|
},
|
@@ -2027,14 +2027,14 @@ function ea(t, n) {
|
|
2027
2027
|
title: "Z",
|
2028
2028
|
prop: "scale.z",
|
2029
2029
|
type: "number",
|
2030
|
-
value:
|
2030
|
+
value: d.z,
|
2031
2031
|
step: 0.01,
|
2032
2032
|
onChange: c
|
2033
2033
|
}
|
2034
2034
|
]
|
2035
2035
|
}
|
2036
2036
|
];
|
2037
|
-
return /* @__PURE__ */
|
2037
|
+
return /* @__PURE__ */ u.jsx(
|
2038
2038
|
Ae,
|
2039
2039
|
{
|
2040
2040
|
title: "Transform",
|
@@ -2071,12 +2071,12 @@ function ta(t, n) {
|
|
2071
2071
|
prop: e,
|
2072
2072
|
type: "color",
|
2073
2073
|
value: i,
|
2074
|
-
onChange: (
|
2074
|
+
onChange: (d, c) => {
|
2075
2075
|
var h;
|
2076
2076
|
const s = new St(c);
|
2077
|
-
n.updateObject(t.uuid,
|
2078
|
-
const
|
2079
|
-
|
2077
|
+
n.updateObject(t.uuid, d, s);
|
2078
|
+
const l = (h = n.scene) == null ? void 0 : h.getObjectByProperty("uuid", t.uuid);
|
2079
|
+
l !== void 0 && Z(l, d, s);
|
2080
2080
|
}
|
2081
2081
|
}) : r.push({
|
2082
2082
|
title: Ft(e),
|
@@ -2084,15 +2084,15 @@ function ta(t, n) {
|
|
2084
2084
|
type: typeof i,
|
2085
2085
|
value: i,
|
2086
2086
|
step: typeof i == "number" ? 0.01 : void 0,
|
2087
|
-
onChange: (
|
2088
|
-
var
|
2089
|
-
n.updateObject(t.uuid,
|
2090
|
-
const s = (
|
2091
|
-
s !== void 0 && Z(s,
|
2087
|
+
onChange: (d, c) => {
|
2088
|
+
var l;
|
2089
|
+
n.updateObject(t.uuid, d, c);
|
2090
|
+
const s = (l = n.scene) == null ? void 0 : l.getObjectByProperty("uuid", t.uuid);
|
2091
|
+
s !== void 0 && Z(s, d, c);
|
2092
2092
|
}
|
2093
2093
|
}));
|
2094
2094
|
}
|
2095
|
-
return /* @__PURE__ */
|
2095
|
+
return /* @__PURE__ */ u.jsx(
|
2096
2096
|
Ae,
|
2097
2097
|
{
|
2098
2098
|
title: "Light",
|
@@ -2106,63 +2106,74 @@ function na(t) {
|
|
2106
2106
|
uuid: "",
|
2107
2107
|
type: "",
|
2108
2108
|
visible: !1,
|
2109
|
-
matrix: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
|
2109
|
+
matrix: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1],
|
2110
|
+
material: void 0,
|
2111
|
+
perspectiveCameraInfo: void 0,
|
2112
|
+
orthographicCameraInfo: void 0,
|
2113
|
+
lightInfo: void 0
|
2110
2114
|
});
|
2111
2115
|
return qe(() => {
|
2112
|
-
function
|
2116
|
+
function d(c) {
|
2113
2117
|
const s = c.value;
|
2114
2118
|
i(s), r(Date.now());
|
2115
2119
|
}
|
2116
|
-
return I.addEventListener(N.SET_OBJECT,
|
2117
|
-
I.removeEventListener(N.SET_OBJECT,
|
2120
|
+
return I.addEventListener(N.SET_OBJECT, d), () => {
|
2121
|
+
I.removeEventListener(N.SET_OBJECT, d);
|
2118
2122
|
};
|
2119
|
-
}, []), /* @__PURE__ */
|
2120
|
-
/* @__PURE__ */
|
2121
|
-
|
2122
|
-
|
2123
|
-
|
2124
|
-
|
2125
|
-
|
2126
|
-
|
2127
|
-
|
2128
|
-
|
2129
|
-
),
|
2130
|
-
/* @__PURE__ */ d.jsx(
|
2131
|
-
Xe,
|
2132
|
-
{
|
2133
|
-
type: "string",
|
2134
|
-
title: "Type",
|
2135
|
-
prop: "type",
|
2136
|
-
value: e.type,
|
2137
|
-
disabled: !0
|
2138
|
-
}
|
2139
|
-
),
|
2140
|
-
/* @__PURE__ */ d.jsx(
|
2141
|
-
Xe,
|
2142
|
-
{
|
2143
|
-
type: "string",
|
2144
|
-
title: "UUID",
|
2145
|
-
prop: "uuid",
|
2146
|
-
value: e.uuid,
|
2147
|
-
disabled: !0
|
2148
|
-
}
|
2149
|
-
),
|
2150
|
-
/* @__PURE__ */ d.jsx(
|
2151
|
-
Xe,
|
2152
|
-
{
|
2153
|
-
type: "boolean",
|
2154
|
-
title: "Visible",
|
2155
|
-
prop: "visible",
|
2156
|
-
value: e.visible,
|
2157
|
-
onChange: (l, c) => {
|
2158
|
-
t.three.updateObject(e.uuid, l, c);
|
2123
|
+
}, []), /* @__PURE__ */ u.jsx("div", { id: "Inspector", className: t.class, children: e.uuid.length > 0 && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
2124
|
+
/* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
2125
|
+
/* @__PURE__ */ u.jsx(
|
2126
|
+
Xe,
|
2127
|
+
{
|
2128
|
+
type: "string",
|
2129
|
+
title: "Name",
|
2130
|
+
prop: "name",
|
2131
|
+
value: e.name,
|
2132
|
+
disabled: !0
|
2159
2133
|
}
|
2160
|
-
|
2161
|
-
|
2162
|
-
|
2163
|
-
|
2164
|
-
|
2165
|
-
|
2134
|
+
),
|
2135
|
+
/* @__PURE__ */ u.jsx(
|
2136
|
+
Xe,
|
2137
|
+
{
|
2138
|
+
type: "string",
|
2139
|
+
title: "Type",
|
2140
|
+
prop: "type",
|
2141
|
+
value: e.type,
|
2142
|
+
disabled: !0
|
2143
|
+
}
|
2144
|
+
),
|
2145
|
+
/* @__PURE__ */ u.jsx(
|
2146
|
+
Xe,
|
2147
|
+
{
|
2148
|
+
type: "string",
|
2149
|
+
title: "UUID",
|
2150
|
+
prop: "uuid",
|
2151
|
+
value: e.uuid,
|
2152
|
+
disabled: !0
|
2153
|
+
}
|
2154
|
+
),
|
2155
|
+
/* @__PURE__ */ u.jsx(
|
2156
|
+
Xe,
|
2157
|
+
{
|
2158
|
+
type: "boolean",
|
2159
|
+
title: "Visible",
|
2160
|
+
prop: "visible",
|
2161
|
+
value: e.visible,
|
2162
|
+
onChange: (d, c) => {
|
2163
|
+
var l;
|
2164
|
+
t.three.updateObject(e.uuid, d, c);
|
2165
|
+
const s = (l = t.three.scene) == null ? void 0 : l.getObjectByProperty("uuid", e.uuid);
|
2166
|
+
s !== void 0 && Z(s, d, c);
|
2167
|
+
}
|
2168
|
+
}
|
2169
|
+
)
|
2170
|
+
] }),
|
2171
|
+
/* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
2172
|
+
ea(e, t.three),
|
2173
|
+
e.orthographicCameraInfo !== void 0 || e.perspectiveCameraInfo !== void 0 ? Qn(e, t.three) : null,
|
2174
|
+
e.lightInfo !== void 0 ? ta(e, t.three) : null,
|
2175
|
+
e.material !== void 0 ? Jn(e, t.three) : null
|
2176
|
+
] })
|
2166
2177
|
] }) }, n);
|
2167
2178
|
}
|
2168
2179
|
class Pa extends jn {
|
@@ -2191,17 +2202,17 @@ class Pa extends jn {
|
|
2191
2202
|
render() {
|
2192
2203
|
var i;
|
2193
2204
|
const r = this.componentState.scene !== null, e = "Hierarchy" + (r ? `: ${(i = this.componentState.scene) == null ? void 0 : i.name}` : "");
|
2194
|
-
return /* @__PURE__ */
|
2195
|
-
r && /* @__PURE__ */
|
2205
|
+
return /* @__PURE__ */ u.jsx("div", { id: "SceneHierarchy", children: /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
2206
|
+
r && /* @__PURE__ */ u.jsx(
|
2196
2207
|
wt,
|
2197
2208
|
{
|
2198
2209
|
label: e,
|
2199
|
-
button: /* @__PURE__ */
|
2210
|
+
button: /* @__PURE__ */ u.jsx("button", { className: "icon refresh hideText", onClick: this.onRefresh, children: "Refresh" }),
|
2200
2211
|
open: !0,
|
2201
|
-
children: /* @__PURE__ */
|
2212
|
+
children: /* @__PURE__ */ u.jsx(Wn, { child: this.componentState.scene, three: this.three })
|
2202
2213
|
}
|
2203
2214
|
),
|
2204
|
-
/* @__PURE__ */
|
2215
|
+
/* @__PURE__ */ u.jsx(wt, { label: "Inspector", children: /* @__PURE__ */ u.jsx(na, { three: this.three }, "Inspector") })
|
2205
2216
|
] }) }, "SceneHierarchy");
|
2206
2217
|
}
|
2207
2218
|
// Getters / Setters
|
@@ -2211,32 +2222,32 @@ class Pa extends jn {
|
|
2211
2222
|
}
|
2212
2223
|
function Ra(t) {
|
2213
2224
|
const n = (s) => {
|
2214
|
-
const
|
2215
|
-
|
2216
|
-
}, r = (s,
|
2225
|
+
const l = t.scene.getObjectByProperty("uuid", s.value);
|
2226
|
+
l !== void 0 && t.three.setObject(l);
|
2227
|
+
}, r = (s, l, h) => {
|
2217
2228
|
const m = t.scene.getObjectByProperty("uuid", s);
|
2218
|
-
m !== void 0 && Z(m,
|
2229
|
+
m !== void 0 && Z(m, l, h);
|
2219
2230
|
}, e = (s) => {
|
2220
|
-
const
|
2231
|
+
const l = s.value, { key: h, value: m, uuid: g } = l;
|
2221
2232
|
r(g, h, m);
|
2222
2233
|
}, i = (s) => {
|
2223
|
-
const
|
2224
|
-
yt(
|
2225
|
-
r(
|
2234
|
+
const l = s.value;
|
2235
|
+
yt(l.value).then((h) => {
|
2236
|
+
r(l.uuid, l.key, h), r(l.uuid, "material.needsUpdate", !0);
|
2226
2237
|
});
|
2227
|
-
},
|
2238
|
+
}, d = () => {
|
2228
2239
|
t.three.setScene(t.scene);
|
2229
2240
|
}, c = (s) => {
|
2230
|
-
const { key:
|
2241
|
+
const { key: l, uuid: h, value: m } = s.value, g = t.scene.getObjectByProperty("uuid", h);
|
2231
2242
|
if (g !== void 0)
|
2232
2243
|
try {
|
2233
|
-
g[
|
2244
|
+
g[l](m);
|
2234
2245
|
} catch (E) {
|
2235
|
-
console.log("Error requesting method:"), console.log(E), console.log(
|
2246
|
+
console.log("Error requesting method:"), console.log(E), console.log(l), console.log(m);
|
2236
2247
|
}
|
2237
2248
|
};
|
2238
|
-
return qe(() => (I.addEventListener(N.GET_OBJECT, n), I.addEventListener(N.GET_SCENE,
|
2239
|
-
I.removeEventListener(N.GET_OBJECT, n), I.removeEventListener(N.GET_SCENE,
|
2249
|
+
return qe(() => (I.addEventListener(N.GET_OBJECT, n), I.addEventListener(N.GET_SCENE, d), I.addEventListener(N.UPDATE_OBJECT, e), I.addEventListener(N.CREATE_TEXTURE, i), I.addEventListener(N.REQUEST_METHOD, c), () => {
|
2250
|
+
I.removeEventListener(N.GET_OBJECT, n), I.removeEventListener(N.GET_SCENE, d), I.removeEventListener(N.UPDATE_OBJECT, e), I.removeEventListener(N.CREATE_TEXTURE, i), I.removeEventListener(N.REQUEST_METHOD, c);
|
2240
2251
|
}), []), null;
|
2241
2252
|
}
|
2242
2253
|
const Ut = { type: "change" }, vt = { type: "start" }, Bt = { type: "end" }, ct = new mn(), $t = new pn(), aa = Math.cos(70 * gn.DEG2RAD);
|
@@ -2255,14 +2266,14 @@ class ra extends Yt {
|
|
2255
2266
|
}, this.saveState = function() {
|
2256
2267
|
e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
|
2257
2268
|
}, this.reset = function() {
|
2258
|
-
e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(Ut), e.update(),
|
2269
|
+
e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(Ut), e.update(), d = i.NONE;
|
2259
2270
|
}, this.update = function() {
|
2260
2271
|
const o = new G(), w = new Mt().setFromUnitVectors(n.up, new G(0, 1, 0)), F = w.clone().invert(), U = new G(), K = new Mt(), fe = new G(), ie = 2 * Math.PI;
|
2261
2272
|
return function() {
|
2262
2273
|
const ze = e.object.position;
|
2263
|
-
o.copy(ze).sub(e.target), o.applyQuaternion(w), s.setFromVector3(o), e.autoRotate &&
|
2274
|
+
o.copy(ze).sub(e.target), o.applyQuaternion(w), s.setFromVector3(o), e.autoRotate && d === i.NONE && M(Te()), e.enableDamping ? (s.theta += l.theta * e.dampingFactor, s.phi += l.phi * e.dampingFactor) : (s.theta += l.theta, s.phi += l.phi);
|
2264
2275
|
let W = e.minAzimuthAngle, Q = e.maxAzimuthAngle;
|
2265
|
-
isFinite(W) && isFinite(Q) && (W < -Math.PI ? W += ie : W > Math.PI && (W -= ie), Q < -Math.PI ? Q += ie : Q > Math.PI && (Q -= ie), W <= Q ? s.theta = Math.max(W, Math.min(Q, s.theta)) : s.theta = s.theta > (W + Q) / 2 ? Math.max(W, s.theta) : Math.min(Q, s.theta)), s.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, s.phi)), s.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(m, e.dampingFactor) : e.target.add(m), e.zoomToCursor && ee || e.object.isOrthographicCamera ? s.radius = Re(s.radius) : s.radius = Re(s.radius * h), o.setFromSpherical(s), o.applyQuaternion(F), ze.copy(e.target).add(o), e.object.lookAt(e.target), e.enableDamping === !0 ? (
|
2276
|
+
isFinite(W) && isFinite(Q) && (W < -Math.PI ? W += ie : W > Math.PI && (W -= ie), Q < -Math.PI ? Q += ie : Q > Math.PI && (Q -= ie), W <= Q ? s.theta = Math.max(W, Math.min(Q, s.theta)) : s.theta = s.theta > (W + Q) / 2 ? Math.max(W, s.theta) : Math.min(Q, s.theta)), s.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, s.phi)), s.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(m, e.dampingFactor) : e.target.add(m), e.zoomToCursor && ee || e.object.isOrthographicCamera ? s.radius = Re(s.radius) : s.radius = Re(s.radius * h), o.setFromSpherical(s), o.applyQuaternion(F), ze.copy(e.target).add(o), e.object.lookAt(e.target), e.enableDamping === !0 ? (l.theta *= 1 - e.dampingFactor, l.phi *= 1 - e.dampingFactor, m.multiplyScalar(1 - e.dampingFactor)) : (l.set(0, 0, 0), m.set(0, 0, 0));
|
2266
2277
|
let he = !1;
|
2267
2278
|
if (e.zoomToCursor && ee) {
|
2268
2279
|
let me = null;
|
@@ -2296,8 +2307,8 @@ class ra extends Yt {
|
|
2296
2307
|
TOUCH_DOLLY_PAN: 5,
|
2297
2308
|
TOUCH_DOLLY_ROTATE: 6
|
2298
2309
|
};
|
2299
|
-
let
|
2300
|
-
const c = 1e-6, s = new kt(),
|
2310
|
+
let d = i.NONE;
|
2311
|
+
const c = 1e-6, s = new kt(), l = new kt();
|
2301
2312
|
let h = 1;
|
2302
2313
|
const m = new G(), g = new ae(), E = new ae(), C = new ae(), R = new ae(), D = new ae(), y = new ae(), b = new ae(), v = new ae(), O = new ae(), j = new G(), z = new ae();
|
2303
2314
|
let ee = !1;
|
@@ -2309,10 +2320,10 @@ class ra extends Yt {
|
|
2309
2320
|
return Math.pow(0.95, e.zoomSpeed);
|
2310
2321
|
}
|
2311
2322
|
function M(o) {
|
2312
|
-
|
2323
|
+
l.theta -= o;
|
2313
2324
|
}
|
2314
2325
|
function A(o) {
|
2315
|
-
|
2326
|
+
l.phi -= o;
|
2316
2327
|
}
|
2317
2328
|
const L = function() {
|
2318
2329
|
const o = new G();
|
@@ -2457,7 +2468,7 @@ class ra extends Yt {
|
|
2457
2468
|
e.enabled !== !1 && (o.pointerType === "touch" ? it(o) : Ge(o));
|
2458
2469
|
}
|
2459
2470
|
function be(o) {
|
2460
|
-
ot(o), T.length === 0 && (e.domElement.releasePointerCapture(o.pointerId), e.domElement.removeEventListener("pointermove", ue), e.domElement.removeEventListener("pointerup", be)), e.dispatchEvent(Bt),
|
2471
|
+
ot(o), T.length === 0 && (e.domElement.releasePointerCapture(o.pointerId), e.domElement.removeEventListener("pointermove", ue), e.domElement.removeEventListener("pointerup", be)), e.dispatchEvent(Bt), d = i.NONE;
|
2461
2472
|
}
|
2462
2473
|
function pt(o) {
|
2463
2474
|
let w;
|
@@ -2478,37 +2489,37 @@ class ra extends Yt {
|
|
2478
2489
|
case De.DOLLY:
|
2479
2490
|
if (e.enableZoom === !1)
|
2480
2491
|
return;
|
2481
|
-
Ze(o),
|
2492
|
+
Ze(o), d = i.DOLLY;
|
2482
2493
|
break;
|
2483
2494
|
case De.ROTATE:
|
2484
2495
|
if (o.ctrlKey || o.metaKey || o.shiftKey) {
|
2485
2496
|
if (e.enablePan === !1)
|
2486
2497
|
return;
|
2487
|
-
Fe(o),
|
2498
|
+
Fe(o), d = i.PAN;
|
2488
2499
|
} else {
|
2489
2500
|
if (e.enableRotate === !1)
|
2490
2501
|
return;
|
2491
|
-
Le(o),
|
2502
|
+
Le(o), d = i.ROTATE;
|
2492
2503
|
}
|
2493
2504
|
break;
|
2494
2505
|
case De.PAN:
|
2495
2506
|
if (o.ctrlKey || o.metaKey || o.shiftKey) {
|
2496
2507
|
if (e.enableRotate === !1)
|
2497
2508
|
return;
|
2498
|
-
Le(o),
|
2509
|
+
Le(o), d = i.ROTATE;
|
2499
2510
|
} else {
|
2500
2511
|
if (e.enablePan === !1)
|
2501
2512
|
return;
|
2502
|
-
Fe(o),
|
2513
|
+
Fe(o), d = i.PAN;
|
2503
2514
|
}
|
2504
2515
|
break;
|
2505
2516
|
default:
|
2506
|
-
|
2517
|
+
d = i.NONE;
|
2507
2518
|
}
|
2508
|
-
|
2519
|
+
d !== i.NONE && e.dispatchEvent(vt);
|
2509
2520
|
}
|
2510
2521
|
function Ge(o) {
|
2511
|
-
switch (
|
2522
|
+
switch (d) {
|
2512
2523
|
case i.ROTATE:
|
2513
2524
|
if (e.enableRotate === !1)
|
2514
2525
|
return;
|
@@ -2527,7 +2538,7 @@ class ra extends Yt {
|
|
2527
2538
|
}
|
2528
2539
|
}
|
2529
2540
|
function at(o) {
|
2530
|
-
e.enabled === !1 || e.enableZoom === !1 ||
|
2541
|
+
e.enabled === !1 || e.enableZoom === !1 || d !== i.NONE || (o.preventDefault(), e.dispatchEvent(vt), Ue(o), e.dispatchEvent(Bt));
|
2531
2542
|
}
|
2532
2543
|
function Ye(o) {
|
2533
2544
|
e.enabled === !1 || e.enablePan === !1 || Be(o);
|
@@ -2539,15 +2550,15 @@ class ra extends Yt {
|
|
2539
2550
|
case _e.ROTATE:
|
2540
2551
|
if (e.enableRotate === !1)
|
2541
2552
|
return;
|
2542
|
-
pe(),
|
2553
|
+
pe(), d = i.TOUCH_ROTATE;
|
2543
2554
|
break;
|
2544
2555
|
case _e.PAN:
|
2545
2556
|
if (e.enablePan === !1)
|
2546
2557
|
return;
|
2547
|
-
je(),
|
2558
|
+
je(), d = i.TOUCH_PAN;
|
2548
2559
|
break;
|
2549
2560
|
default:
|
2550
|
-
|
2561
|
+
d = i.NONE;
|
2551
2562
|
}
|
2552
2563
|
break;
|
2553
2564
|
case 2:
|
@@ -2555,24 +2566,24 @@ class ra extends Yt {
|
|
2555
2566
|
case _e.DOLLY_PAN:
|
2556
2567
|
if (e.enableZoom === !1 && e.enablePan === !1)
|
2557
2568
|
return;
|
2558
|
-
mt(),
|
2569
|
+
mt(), d = i.TOUCH_DOLLY_PAN;
|
2559
2570
|
break;
|
2560
2571
|
case _e.DOLLY_ROTATE:
|
2561
2572
|
if (e.enableZoom === !1 && e.enableRotate === !1)
|
2562
2573
|
return;
|
2563
|
-
Qe(),
|
2574
|
+
Qe(), d = i.TOUCH_DOLLY_ROTATE;
|
2564
2575
|
break;
|
2565
2576
|
default:
|
2566
|
-
|
2577
|
+
d = i.NONE;
|
2567
2578
|
}
|
2568
2579
|
break;
|
2569
2580
|
default:
|
2570
|
-
|
2581
|
+
d = i.NONE;
|
2571
2582
|
}
|
2572
|
-
|
2583
|
+
d !== i.NONE && e.dispatchEvent(vt);
|
2573
2584
|
}
|
2574
2585
|
function it(o) {
|
2575
|
-
switch (Ve(o),
|
2586
|
+
switch (Ve(o), d) {
|
2576
2587
|
case i.TOUCH_ROTATE:
|
2577
2588
|
if (e.enableRotate === !1)
|
2578
2589
|
return;
|
@@ -2594,7 +2605,7 @@ class ra extends Yt {
|
|
2594
2605
|
nt(o), e.update();
|
2595
2606
|
break;
|
2596
2607
|
default:
|
2597
|
-
|
2608
|
+
d = i.NONE;
|
2598
2609
|
}
|
2599
2610
|
}
|
2600
2611
|
function de(o) {
|
@@ -2623,20 +2634,20 @@ class ra extends Yt {
|
|
2623
2634
|
}
|
2624
2635
|
}
|
2625
2636
|
const xt = (t) => {
|
2626
|
-
const [n, r] = re(!1), [e, i] = re(t.options[t.index]),
|
2637
|
+
const [n, r] = re(!1), [e, i] = re(t.options[t.index]), d = () => {
|
2627
2638
|
r(!n);
|
2628
2639
|
}, c = (s) => {
|
2629
2640
|
s !== e && (t.onSelect(s), i(s)), r(!1);
|
2630
2641
|
};
|
2631
|
-
return /* @__PURE__ */
|
2632
|
-
/* @__PURE__ */
|
2633
|
-
n && /* @__PURE__ */
|
2642
|
+
return /* @__PURE__ */ u.jsxs("div", { className: `dropdown ${t.up === !0 ? "up" : ""}`, children: [
|
2643
|
+
/* @__PURE__ */ u.jsx("div", { className: "dropdown-toggle", onClick: d, children: e }),
|
2644
|
+
n && /* @__PURE__ */ u.jsx("ul", { className: "dropdown-menu", children: t.options.map((s) => /* @__PURE__ */ u.jsx("li", { onClick: () => c(s), children: s }, s)) })
|
2634
2645
|
] });
|
2635
2646
|
}, Ce = Mn(function(n, r) {
|
2636
2647
|
const e = n.options.indexOf(n.camera.name);
|
2637
|
-
return /* @__PURE__ */
|
2638
|
-
/* @__PURE__ */
|
2639
|
-
/* @__PURE__ */
|
2648
|
+
return /* @__PURE__ */ u.jsxs("div", { className: "CameraWindow", children: [
|
2649
|
+
/* @__PURE__ */ u.jsx("div", { ref: r, className: "clickable" }),
|
2650
|
+
/* @__PURE__ */ u.jsx(xt, { index: e, options: n.options, onSelect: n.onSelect, up: !0 })
|
2640
2651
|
] });
|
2641
2652
|
}), ia = `out vec3 worldPosition;
|
2642
2653
|
uniform float uDistance;
|
@@ -2795,8 +2806,8 @@ const la = [
|
|
2795
2806
|
wireframe: !0
|
2796
2807
|
}), V = new Cn();
|
2797
2808
|
function ja(t) {
|
2798
|
-
const [n, r] = re(t.mode !== void 0 ? t.mode : "Quad"), e = Se(null), i = Se(null),
|
2799
|
-
let s = q.get("Debug"),
|
2809
|
+
const [n, r] = re(t.mode !== void 0 ? t.mode : "Quad"), e = Se(null), i = Se(null), d = Se(null), c = Se(null);
|
2810
|
+
let s = q.get("Debug"), l = q.get("Orthographic"), h = q.get("Front"), m = q.get("Top");
|
2800
2811
|
const g = (y, b) => {
|
2801
2812
|
const v = H.get(y.name);
|
2802
2813
|
v !== void 0 && v.dispose(), H.delete(y.name);
|
@@ -2835,10 +2846,10 @@ function ja(t) {
|
|
2835
2846
|
break;
|
2836
2847
|
case "Side by Side":
|
2837
2848
|
case "Stacked":
|
2838
|
-
g(s, e.current), g(
|
2849
|
+
g(s, e.current), g(l, i.current);
|
2839
2850
|
break;
|
2840
2851
|
case "Quad":
|
2841
|
-
g(s, e.current), g(
|
2852
|
+
g(s, e.current), g(l, i.current), g(h, d.current), g(m, c.current);
|
2842
2853
|
break;
|
2843
2854
|
}
|
2844
2855
|
};
|
@@ -2873,14 +2884,14 @@ function ja(t) {
|
|
2873
2884
|
t.renderer.setViewport(0, 0, b, v), t.renderer.setScissor(0, 0, b, v), t.renderer.render(V, s);
|
2874
2885
|
}, le = () => {
|
2875
2886
|
if (n === "Side by Side")
|
2876
|
-
t.renderer.setViewport(0, 0, O, v), t.renderer.setScissor(0, 0, O, v), t.renderer.render(V, s), t.renderer.setViewport(O, 0, O, v), t.renderer.setScissor(O, 0, O, v), t.renderer.render(V,
|
2887
|
+
t.renderer.setViewport(0, 0, O, v), t.renderer.setScissor(0, 0, O, v), t.renderer.render(V, s), t.renderer.setViewport(O, 0, O, v), t.renderer.setScissor(O, 0, O, v), t.renderer.render(V, l);
|
2877
2888
|
else {
|
2878
2889
|
const M = v - j;
|
2879
|
-
t.renderer.setViewport(0, M, b, j), t.renderer.setScissor(0, M, b, j), t.renderer.render(V, s), t.renderer.setViewport(0, 0, b, j), t.renderer.setScissor(0, 0, b, j), t.renderer.render(V,
|
2890
|
+
t.renderer.setViewport(0, M, b, j), t.renderer.setScissor(0, M, b, j), t.renderer.render(V, s), t.renderer.setViewport(0, 0, b, j), t.renderer.setScissor(0, 0, b, j), t.renderer.render(V, l);
|
2880
2891
|
}
|
2881
2892
|
}, Te = () => {
|
2882
2893
|
let M = 0, A = 0;
|
2883
|
-
A = v - j, M = 0, t.renderer.setViewport(M, A, O, j), t.renderer.setScissor(M, A, O, j), t.renderer.render(V, s), M = O, t.renderer.setViewport(M, A, O, j), t.renderer.setScissor(M, A, O, j), t.renderer.render(V,
|
2894
|
+
A = v - j, M = 0, t.renderer.setViewport(M, A, O, j), t.renderer.setScissor(M, A, O, j), t.renderer.render(V, s), M = O, t.renderer.setViewport(M, A, O, j), t.renderer.setScissor(M, A, O, j), t.renderer.render(V, l), A = 0, M = 0, t.renderer.setViewport(M, A, O, j), t.renderer.setScissor(M, A, O, j), t.renderer.render(V, h), M = O, t.renderer.setViewport(M, A, O, j), t.renderer.setScissor(M, A, O, j), t.renderer.render(V, m);
|
2884
2895
|
}, oe = () => {
|
2885
2896
|
switch (H.forEach((M) => {
|
2886
2897
|
M.update();
|
@@ -2914,48 +2925,48 @@ function ja(t) {
|
|
2914
2925
|
];
|
2915
2926
|
return t.cameras.forEach((y) => {
|
2916
2927
|
q.set(y.name, y), D.push(y.name);
|
2917
|
-
}), /* @__PURE__ */
|
2918
|
-
/* @__PURE__ */
|
2919
|
-
n === "Single" && /* @__PURE__ */
|
2928
|
+
}), /* @__PURE__ */ u.jsxs("div", { className: "multiview", children: [
|
2929
|
+
/* @__PURE__ */ u.jsxs("div", { className: `cameras ${n === "Single" || n === "Stacked" ? "single" : ""}`, children: [
|
2930
|
+
n === "Single" && /* @__PURE__ */ u.jsx(u.Fragment, { children: /* @__PURE__ */ u.jsx(Ce, { camera: s, options: D, ref: e, onSelect: (y) => {
|
2920
2931
|
var v;
|
2921
2932
|
(v = H.get(s.name)) == null || v.dispose();
|
2922
2933
|
const b = q.get(y);
|
2923
2934
|
b !== void 0 && (E(s), s = b, g(b, e.current));
|
2924
2935
|
} }) }),
|
2925
|
-
(n === "Side by Side" || n === "Stacked") && /* @__PURE__ */
|
2926
|
-
/* @__PURE__ */
|
2936
|
+
(n === "Side by Side" || n === "Stacked") && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
2937
|
+
/* @__PURE__ */ u.jsx(Ce, { camera: s, options: D, ref: e, onSelect: (y) => {
|
2927
2938
|
var v;
|
2928
2939
|
(v = H.get(s.name)) == null || v.dispose();
|
2929
2940
|
const b = q.get(y);
|
2930
2941
|
b !== void 0 && (E(s), s = b, g(b, e.current));
|
2931
2942
|
} }),
|
2932
|
-
/* @__PURE__ */
|
2943
|
+
/* @__PURE__ */ u.jsx(Ce, { camera: l, options: D, ref: i, onSelect: (y) => {
|
2933
2944
|
var v;
|
2934
|
-
(v = H.get(
|
2945
|
+
(v = H.get(l.name)) == null || v.dispose();
|
2935
2946
|
const b = q.get(y);
|
2936
|
-
b !== void 0 && (E(
|
2947
|
+
b !== void 0 && (E(l), l = b, g(b, i.current));
|
2937
2948
|
} })
|
2938
2949
|
] }),
|
2939
|
-
n === "Quad" && /* @__PURE__ */
|
2940
|
-
/* @__PURE__ */
|
2950
|
+
n === "Quad" && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
2951
|
+
/* @__PURE__ */ u.jsx(Ce, { camera: s, options: D, ref: e, onSelect: (y) => {
|
2941
2952
|
var v;
|
2942
2953
|
(v = H.get(s.name)) == null || v.dispose();
|
2943
2954
|
const b = q.get(y);
|
2944
2955
|
b !== void 0 && (E(s), s = b, g(b, e.current));
|
2945
2956
|
} }),
|
2946
|
-
/* @__PURE__ */
|
2957
|
+
/* @__PURE__ */ u.jsx(Ce, { camera: l, options: D, ref: i, onSelect: (y) => {
|
2947
2958
|
var v;
|
2948
|
-
(v = H.get(
|
2959
|
+
(v = H.get(l.name)) == null || v.dispose();
|
2949
2960
|
const b = q.get(y);
|
2950
|
-
b !== void 0 && (E(
|
2961
|
+
b !== void 0 && (E(l), l = b, g(b, i.current));
|
2951
2962
|
} }),
|
2952
|
-
/* @__PURE__ */
|
2963
|
+
/* @__PURE__ */ u.jsx(Ce, { camera: h, options: D, ref: d, onSelect: (y) => {
|
2953
2964
|
var v;
|
2954
2965
|
(v = H.get(h.name)) == null || v.dispose();
|
2955
2966
|
const b = q.get(y);
|
2956
|
-
b !== void 0 && (E(h), h = b, g(b,
|
2967
|
+
b !== void 0 && (E(h), h = b, g(b, d.current));
|
2957
2968
|
} }),
|
2958
|
-
/* @__PURE__ */
|
2969
|
+
/* @__PURE__ */ u.jsx(Ce, { camera: m, options: D, ref: c, onSelect: (y) => {
|
2959
2970
|
var v;
|
2960
2971
|
(v = H.get(m.name)) == null || v.dispose();
|
2961
2972
|
const b = q.get(y);
|
@@ -2963,8 +2974,8 @@ function ja(t) {
|
|
2963
2974
|
} })
|
2964
2975
|
] })
|
2965
2976
|
] }),
|
2966
|
-
/* @__PURE__ */
|
2967
|
-
/* @__PURE__ */
|
2977
|
+
/* @__PURE__ */ u.jsxs("div", { className: "settings", children: [
|
2978
|
+
/* @__PURE__ */ u.jsx(
|
2968
2979
|
xt,
|
2969
2980
|
{
|
2970
2981
|
index: Gt.indexOf(n),
|
@@ -2974,7 +2985,7 @@ function ja(t) {
|
|
2974
2985
|
}
|
2975
2986
|
}
|
2976
2987
|
),
|
2977
|
-
/* @__PURE__ */
|
2988
|
+
/* @__PURE__ */ u.jsx(
|
2978
2989
|
xt,
|
2979
2990
|
{
|
2980
2991
|
index: 0,
|
@@ -2999,10 +3010,10 @@ function ja(t) {
|
|
2999
3010
|
] });
|
3000
3011
|
}
|
3001
3012
|
function Ma(t) {
|
3002
|
-
return /* @__PURE__ */
|
3003
|
-
/* @__PURE__ */
|
3013
|
+
return /* @__PURE__ */ u.jsxs("div", { className: "editor", ref: t.ref, style: t.style, children: [
|
3014
|
+
/* @__PURE__ */ u.jsx("header", { children: t.header }),
|
3004
3015
|
t.children,
|
3005
|
-
/* @__PURE__ */
|
3016
|
+
/* @__PURE__ */ u.jsx("footer", { children: t.footer })
|
3006
3017
|
] });
|
3007
3018
|
}
|
3008
3019
|
export {
|