@realsee/dnalogel 3.48.0 → 3.48.1
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/CHANGELOG.md +3 -0
- package/dist/Sculpt/Objects/Base/index.d.ts +16 -0
- package/dist/Sculpt/Objects/Line/index.d.ts +12 -1
- package/dist/Sculpt/index.d.ts +5 -2
- package/dist/index.cjs.js +32 -32
- package/dist/index.js +2038 -1973
- package/dist/index.umd.js +31 -31
- package/dist/shared-utils/promise/withResolvers.d.ts +10 -0
- package/dist/shared-utils/three/Magnifier.d.ts +1 -1
- package/dist/shared-utils/three/PointSelector/utils/PointSelectorHelper.d.ts +4 -1
- package/libs/Sculpt/Meshes/Line.js +15 -15
- package/libs/Sculpt/Objects/Base/index.d.ts +16 -0
- package/libs/Sculpt/Objects/Base/index.js +58 -32
- package/libs/Sculpt/Objects/Box/index.js +31 -34
- package/libs/Sculpt/Objects/Circle/index.js +36 -39
- package/libs/Sculpt/Objects/Line/index.d.ts +12 -1
- package/libs/Sculpt/Objects/Line/index.js +104 -75
- package/libs/Sculpt/Objects/Point/index.js +13 -16
- package/libs/Sculpt/Objects/Polygon/index.js +18 -21
- package/libs/Sculpt/Objects/Polyline/index.js +27 -30
- package/libs/Sculpt/Objects/Prism/index.js +16 -19
- package/libs/Sculpt/Objects/Rectangle/index.js +36 -39
- package/libs/Sculpt/index.d.ts +5 -2
- package/libs/Sculpt/index.js +80 -65
- package/libs/base/BasePlugin.js +1 -1
- package/libs/index.js +127 -126
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/promise/withResolvers.d.ts +10 -0
- package/libs/shared-utils/promise/withResolvers.js +13 -0
- package/libs/shared-utils/tag.js +9 -9
- package/libs/shared-utils/three/Magnifier.d.ts +1 -1
- package/libs/shared-utils/three/Magnifier.js +12 -12
- package/libs/shared-utils/three/PointSelector/utils/PointSelectorHelper.d.ts +4 -1
- package/libs/shared-utils/three/PointSelector/utils/PointSelectorHelper.js +9 -9
- package/package.json +1 -1
|
@@ -1,47 +1,44 @@
|
|
|
1
|
-
var U = Object.defineProperty,
|
|
2
|
-
var
|
|
1
|
+
var U = Object.defineProperty, B = Object.defineProperties;
|
|
2
|
+
var I = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var A = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
4
|
+
var _ = Object.prototype.hasOwnProperty, j = Object.prototype.propertyIsEnumerable;
|
|
5
5
|
var E = (s, t, e) => t in s ? U(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, d = (s, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
|
-
|
|
7
|
+
_.call(t, e) && E(s, e, t[e]);
|
|
8
8
|
if (A)
|
|
9
9
|
for (var e of A(t))
|
|
10
|
-
|
|
10
|
+
j.call(t, e) && E(s, e, t[e]);
|
|
11
11
|
return s;
|
|
12
|
-
}, u = (s, t) =>
|
|
12
|
+
}, u = (s, t) => B(s, I(t));
|
|
13
13
|
var L = (s, t, e) => (E(s, typeof t != "symbol" ? t + "" : t, e), e);
|
|
14
14
|
var D = (s, t, e) => new Promise((c, p) => {
|
|
15
15
|
var a = (l) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
17
|
+
m(e.next(l));
|
|
18
18
|
} catch (h) {
|
|
19
19
|
p(h);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, g = (l) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
23
|
+
m(e.throw(l));
|
|
24
24
|
} catch (h) {
|
|
25
25
|
p(h);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, m = (l) => l.done ? c(l.value) : Promise.resolve(l.value).then(a, g);
|
|
28
|
+
m((e = e.apply(s, t)).next());
|
|
29
29
|
});
|
|
30
|
-
import {
|
|
31
|
-
import { BaseObject as q } from "../Base/index.js";
|
|
30
|
+
import { BaseObject as k } from "../Base/index.js";
|
|
32
31
|
import * as o from "three";
|
|
33
32
|
import { PolylineWithDotsMesh as M } from "../../Meshes/Polyline.js";
|
|
34
|
-
import { RectangleEditor as
|
|
33
|
+
import { RectangleEditor as q } from "./Editor.js";
|
|
35
34
|
import { RectangleWithEdgeMesh as H } from "../../Meshes/RectangleWithEdge.js";
|
|
36
35
|
const P = new o.Vector3();
|
|
37
|
-
class
|
|
36
|
+
class Z extends k {
|
|
38
37
|
constructor(e, c) {
|
|
39
38
|
super(e, c);
|
|
40
39
|
L(this, "type", "Rectangle");
|
|
41
40
|
L(this, "rectangleMesh");
|
|
42
|
-
this.config.canEdit && (this.editor = new
|
|
43
|
-
this.stopCreating();
|
|
44
|
-
});
|
|
41
|
+
this.config.canEdit && (this.editor = new q(this)), e && (this.rectangleMesh = new H(d(d({}, e.style), e)), this.add(this.rectangleMesh));
|
|
45
42
|
}
|
|
46
43
|
get data() {
|
|
47
44
|
return u(d({}, this.baseData), {
|
|
@@ -65,23 +62,23 @@ class S extends q {
|
|
|
65
62
|
return D(this, null, function* () {
|
|
66
63
|
this.removeChildren();
|
|
67
64
|
const c = new H(e);
|
|
68
|
-
this.rectangleMesh = c, this.add(this.rectangleMesh), yield
|
|
65
|
+
this.rectangleMesh = c, this.add(this.rectangleMesh), yield G(this.rectangleMesh, this.pointSelector, e);
|
|
69
66
|
});
|
|
70
67
|
}
|
|
71
68
|
}
|
|
72
|
-
function
|
|
69
|
+
function G(s, t, e) {
|
|
73
70
|
return new Promise((c, p) => {
|
|
74
71
|
var N, T;
|
|
75
72
|
const a = s.parent;
|
|
76
73
|
if (!a)
|
|
77
74
|
return p(new Error("No container"));
|
|
78
|
-
const
|
|
75
|
+
const g = (N = e == null ? void 0 : e.limit) != null ? N : "none", m = (T = e == null ? void 0 : e.drawMethod) != null ? T : "diagonal", l = new M(u(d({}, s.style), { dashed: !0, lengthEnable: !0 })), h = new M(u(d({}, s.style), { dashed: !0, lengthEnable: !1 })), y = new M(u(d({}, s.style), { dashed: !1, lengthEnable: !1 }));
|
|
79
76
|
a.add(l, y, h), t.enable();
|
|
80
77
|
const n = [];
|
|
81
78
|
let i = new o.Vector3(), v = new o.Vector3();
|
|
82
|
-
const
|
|
83
|
-
n.push(i.clone()), n.length === 1 ? (
|
|
84
|
-
},
|
|
79
|
+
const w = new o.Plane(), x = () => {
|
|
80
|
+
n.push(i.clone()), n.length === 1 ? (g === "xoz" && w.setFromNormalAndCoplanarPoint(new o.Vector3(0, 1, 0), n[0]), g === "none" && w.setFromNormalAndCoplanarPoint(v, n[0])) : n.length === 2 ? g === "y" ? (V(), c()) : y.setPoints([n[0], n[1]]) : n.length === 3 && (V(), c());
|
|
81
|
+
}, C = (r) => {
|
|
85
82
|
var W;
|
|
86
83
|
if (!(r != null && r.raycaster))
|
|
87
84
|
return;
|
|
@@ -90,36 +87,36 @@ function J(s, t, e) {
|
|
|
90
87
|
i = r.point.clone(), v = r.face.normal;
|
|
91
88
|
return;
|
|
92
89
|
}
|
|
93
|
-
if (n.length === 1 &&
|
|
94
|
-
const
|
|
95
|
-
s.setPoints([n[0],
|
|
90
|
+
if (n.length === 1 && g === "y") {
|
|
91
|
+
const f = new o.Line3(new o.Vector3(0, 1, 0).add(n[0]), new o.Vector3(0, -1, 0).add(n[0])).closestPointToPoint(r.point, !1, new o.Vector3());
|
|
92
|
+
s.setPoints([n[0], f, r.point]);
|
|
96
93
|
return;
|
|
97
94
|
}
|
|
98
95
|
if (n.length === 1) {
|
|
99
|
-
|
|
96
|
+
w ? (i = r.raycaster.ray.intersectPlane(w, P), h.setPoints([i, r.point])) : i = r.point.clone(), l.setPoints([O, i]);
|
|
100
97
|
return;
|
|
101
98
|
}
|
|
102
99
|
if (n.length === 2) {
|
|
103
100
|
a.remove(l);
|
|
104
|
-
const z = r.raycaster.ray.intersectPlane(
|
|
105
|
-
if (
|
|
106
|
-
const
|
|
107
|
-
i = new o.Vector3().addVectors(b, F.multiplyScalar(
|
|
108
|
-
} else if (
|
|
109
|
-
const
|
|
110
|
-
i = new o.Line3(n[1].clone().add(
|
|
101
|
+
const z = r.raycaster.ray.intersectPlane(w, P);
|
|
102
|
+
if (m === "diagonal") {
|
|
103
|
+
const f = n[0].distanceTo(n[1]) / 2, b = new o.Vector3().lerpVectors(n[0], n[1], 0.5), F = new o.Vector3().subVectors(z, b).normalize();
|
|
104
|
+
i = new o.Vector3().addVectors(b, F.multiplyScalar(f)), s.setPoints([n[0], i, n[1]]);
|
|
105
|
+
} else if (m === "vertex") {
|
|
106
|
+
const f = P.crossVectors(n[0].clone().sub(n[1]), w.normal).normalize();
|
|
107
|
+
i = new o.Line3(n[1].clone().add(f), n[1].clone().sub(f)).closestPointToPoint(r.point, !1, P), s.setPoints([n[0], n[1], i]);
|
|
111
108
|
}
|
|
112
109
|
return;
|
|
113
110
|
}
|
|
114
111
|
}, V = () => {
|
|
115
|
-
t.off("select",
|
|
112
|
+
t.off("select", x), t.off("intersectionUpdate", C), t.off("disable", R), t.disable(), a == null || a.remove(l, y, h);
|
|
116
113
|
}, R = () => {
|
|
117
114
|
V(), a == null || a.remove(s), p(new Error("Cancelled"));
|
|
118
115
|
};
|
|
119
|
-
t.on("select",
|
|
116
|
+
t.on("select", x), t.on("intersectionUpdate", C), t.on("disable", R);
|
|
120
117
|
});
|
|
121
118
|
}
|
|
122
119
|
export {
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
Z as Rectangle,
|
|
121
|
+
G as createRectangle
|
|
125
122
|
};
|
package/libs/Sculpt/index.d.ts
CHANGED
|
@@ -109,6 +109,7 @@ export declare class Sculpt extends Subscribe<Event> {
|
|
|
109
109
|
get items(): BuiltInItem[];
|
|
110
110
|
private five;
|
|
111
111
|
private theme;
|
|
112
|
+
private creatingItem;
|
|
112
113
|
constructor(five: Five, theme?: Theme);
|
|
113
114
|
/**
|
|
114
115
|
* @description: 加载数据 展示
|
|
@@ -158,14 +159,16 @@ export declare class Sculpt extends Subscribe<Event> {
|
|
|
158
159
|
* @description: 开始绘制 Box
|
|
159
160
|
*/
|
|
160
161
|
createBox(params?: Parameters<Box['create']>[0]): Promise<Box>;
|
|
162
|
+
canUndo(): false | void;
|
|
163
|
+
canRedo(): false | void;
|
|
161
164
|
/**
|
|
162
165
|
* @description: 撤销
|
|
163
166
|
*/
|
|
164
|
-
undo()
|
|
167
|
+
undo: () => void;
|
|
165
168
|
/**
|
|
166
169
|
* @description: 重做
|
|
167
170
|
*/
|
|
168
|
-
redo()
|
|
171
|
+
redo: () => void;
|
|
169
172
|
/**
|
|
170
173
|
* @description: 清空数据
|
|
171
174
|
*/
|
package/libs/Sculpt/index.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var U = Object.defineProperty, _ = Object.defineProperties;
|
|
2
|
+
var x = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var g = Object.getOwnPropertySymbols;
|
|
4
|
+
var E = Object.prototype.hasOwnProperty, L = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var f = (m, i, e) => i in m ? U(m, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m[i] = e, r = (m, i) => {
|
|
6
6
|
for (var e in i || (i = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
|
|
7
|
+
E.call(i, e) && f(m, e, i[e]);
|
|
8
|
+
if (g)
|
|
9
|
+
for (var e of g(i))
|
|
10
|
+
L.call(i, e) && f(m, e, i[e]);
|
|
11
11
|
return m;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var c = (m, i, e) => new Promise((t,
|
|
12
|
+
}, I = (m, i) => _(m, x(i));
|
|
13
|
+
var h = (m, i, e) => (f(m, typeof i != "symbol" ? i + "" : i, e), e);
|
|
14
|
+
var c = (m, i, e) => new Promise((t, n) => {
|
|
15
15
|
var l = (u) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
17
|
+
o(e.next(u));
|
|
18
18
|
} catch (y) {
|
|
19
|
-
|
|
19
|
+
n(y);
|
|
20
20
|
}
|
|
21
21
|
}, s = (u) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
23
|
+
o(e.throw(u));
|
|
24
24
|
} catch (y) {
|
|
25
|
-
|
|
25
|
+
n(y);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, o = (u) => u.done ? t(u.value) : Promise.resolve(u.value).then(l, s);
|
|
28
|
+
o((e = e.apply(m, i)).next());
|
|
29
29
|
});
|
|
30
|
-
import { globalModules as
|
|
30
|
+
import { globalModules as O } from "./utils/Modules/Global.js";
|
|
31
31
|
import { Subscribe as S } from "../shared-utils/Subscribe.js";
|
|
32
|
-
import { IObject3D as
|
|
32
|
+
import { IObject3D as z } from "../shared-utils/three/IObject3D.js";
|
|
33
33
|
import "three";
|
|
34
34
|
import "hammerjs";
|
|
35
35
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
@@ -37,30 +37,46 @@ import "@realsee/five/line";
|
|
|
37
37
|
import "../shared-utils/tag.js";
|
|
38
38
|
import "../shared-utils/three/THREESphere.js";
|
|
39
39
|
import "animejs";
|
|
40
|
-
import { notNil as
|
|
40
|
+
import { notNil as k } from "../shared-utils/isNil.js";
|
|
41
41
|
import "../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
42
|
-
import { recurveFindObject as
|
|
43
|
-
import { Polyline as
|
|
42
|
+
import { recurveFindObject as H } from "../shared-utils/three/recurveFindObject.js";
|
|
43
|
+
import { Polyline as w } from "./Objects/Polyline/index.js";
|
|
44
44
|
import { Point as P } from "./Objects/Point/index.js";
|
|
45
|
-
import { Polygon as
|
|
46
|
-
import { Prism as
|
|
47
|
-
import { Rectangle as
|
|
48
|
-
import { Circle as
|
|
45
|
+
import { Polygon as b } from "./Objects/Polygon/index.js";
|
|
46
|
+
import { Prism as v } from "./Objects/Prism/index.js";
|
|
47
|
+
import { Rectangle as C } from "./Objects/Rectangle/index.js";
|
|
48
|
+
import { Circle as R } from "./Objects/Circle/index.js";
|
|
49
49
|
import { Cylinder as D } from "./Objects/Cylinder/index.js";
|
|
50
50
|
import { Box as j } from "./Objects/Box/index.js";
|
|
51
|
-
import { forReverseEach as
|
|
51
|
+
import { forReverseEach as M } from "../shared-utils/forReverseEach.js";
|
|
52
52
|
import { Line as B } from "./Objects/Line/index.js";
|
|
53
|
-
|
|
53
|
+
import { hotkeys as p } from "../vendor/hotkeys-js/dist/hotkeys.esm.js";
|
|
54
|
+
const a = class extends S {
|
|
54
55
|
constructor(e, t) {
|
|
55
56
|
super();
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
h(this, "group");
|
|
58
|
+
h(this, "five");
|
|
59
|
+
h(this, "theme");
|
|
60
|
+
h(this, "creatingItem", null);
|
|
61
|
+
/**
|
|
62
|
+
* @description: 撤销
|
|
63
|
+
*/
|
|
64
|
+
h(this, "undo", () => {
|
|
65
|
+
var e;
|
|
66
|
+
(e = this.creatingItem) == null || e.undo(), this.five.needsRender = !0;
|
|
67
|
+
});
|
|
68
|
+
/**
|
|
69
|
+
* @description: 重做
|
|
70
|
+
*/
|
|
71
|
+
h(this, "redo", () => {
|
|
72
|
+
var e;
|
|
73
|
+
(e = this.creatingItem) == null || e.redo(), this.five.needsRender = !0;
|
|
74
|
+
});
|
|
75
|
+
this.five = e, this.theme = t, this.group = new z(), this.group.name = "Sculpt", e.scene.add(this.group), a.modules.init(e), p.unbind("ctrl+z", this.undo), p.unbind("ctrl+shift+z", this.redo), p("ctrl+z", this.undo), p("ctrl+shift+z", this.redo), a.modules.fiveDomEvents.addEventListener(this.group, "click", ({ intersects: n }) => {
|
|
60
76
|
var s;
|
|
61
|
-
const l =
|
|
77
|
+
const l = H((s = n == null ? void 0 : n[0]) == null ? void 0 : s.object, (o) => o.isSculptObject);
|
|
62
78
|
return l ? this.emit("click", l) : !1;
|
|
63
|
-
}), window.__SCLUPT_DEBUG__ = this, window.__SCLUPT_MODULES_DEBUG__ =
|
|
79
|
+
}), window.__SCLUPT_DEBUG__ = this, window.__SCLUPT_MODULES_DEBUG__ = a.modules;
|
|
64
80
|
}
|
|
65
81
|
get data() {
|
|
66
82
|
return {
|
|
@@ -70,7 +86,7 @@ const p = class extends S {
|
|
|
70
86
|
} catch (t) {
|
|
71
87
|
return console.error(t), null;
|
|
72
88
|
}
|
|
73
|
-
}).filter(
|
|
89
|
+
}).filter(k)
|
|
74
90
|
};
|
|
75
91
|
}
|
|
76
92
|
get items() {
|
|
@@ -82,14 +98,14 @@ const p = class extends S {
|
|
|
82
98
|
load(e, t) {
|
|
83
99
|
var l;
|
|
84
100
|
this.clear();
|
|
85
|
-
const
|
|
101
|
+
const n = (l = e == null ? void 0 : e.items) == null ? void 0 : l.map((s) => {
|
|
86
102
|
var u;
|
|
87
|
-
const
|
|
103
|
+
const o = I(r({}, s), {
|
|
88
104
|
style: r(r({}, (u = this.theme) == null ? void 0 : u[s.type.toLowerCase()]), s.style)
|
|
89
105
|
});
|
|
90
|
-
return s.type === "Point" ? new P(
|
|
106
|
+
return s.type === "Point" ? new P(o, t) : s.type === "line" ? new B(o, t) : s.type === "Polyline" ? new w(o, t) : s.type === "Polygon" ? new b(o, t) : s.type === "Prism" ? new v(o, t) : s.type === "Rectangle" ? new C(o, t) : s.type === "Circle" ? new R(o, t) : s.type === "Cylinder" ? new D(o, t) : s.type === "Box" ? new j(o, t) : null;
|
|
91
107
|
});
|
|
92
|
-
this.group.add(...
|
|
108
|
+
this.group.add(...n), this.five.needsRender = !0;
|
|
93
109
|
}
|
|
94
110
|
/**
|
|
95
111
|
* @description: 获取物体实例
|
|
@@ -103,8 +119,8 @@ const p = class extends S {
|
|
|
103
119
|
putObject(e) {
|
|
104
120
|
var l;
|
|
105
121
|
this.group.add(e);
|
|
106
|
-
const t =
|
|
107
|
-
return (l =
|
|
122
|
+
const t = a.modules.object3DHelper, n = t.addObject3DHelper(e);
|
|
123
|
+
return (l = n == null ? void 0 : n.moveController) == null || l.moveByMouse(), t;
|
|
108
124
|
}
|
|
109
125
|
/**
|
|
110
126
|
* @description: 开始绘制点
|
|
@@ -130,7 +146,7 @@ const p = class extends S {
|
|
|
130
146
|
createPolyline(e) {
|
|
131
147
|
return c(this, null, function* () {
|
|
132
148
|
var t;
|
|
133
|
-
return this.createItem(
|
|
149
|
+
return this.createItem(w, r(r({}, (t = this.theme) == null ? void 0 : t.polyline), e));
|
|
134
150
|
});
|
|
135
151
|
}
|
|
136
152
|
/**
|
|
@@ -139,7 +155,7 @@ const p = class extends S {
|
|
|
139
155
|
createPolygon(e) {
|
|
140
156
|
return c(this, null, function* () {
|
|
141
157
|
var t;
|
|
142
|
-
return this.createItem(
|
|
158
|
+
return this.createItem(b, r(r({}, (t = this.theme) == null ? void 0 : t.polygon), e));
|
|
143
159
|
});
|
|
144
160
|
}
|
|
145
161
|
/**
|
|
@@ -148,7 +164,7 @@ const p = class extends S {
|
|
|
148
164
|
createPrism(e) {
|
|
149
165
|
return c(this, null, function* () {
|
|
150
166
|
var t;
|
|
151
|
-
return this.createItem(
|
|
167
|
+
return this.createItem(v, r(r({}, (t = this.theme) == null ? void 0 : t.prism), e));
|
|
152
168
|
});
|
|
153
169
|
}
|
|
154
170
|
/**
|
|
@@ -157,7 +173,7 @@ const p = class extends S {
|
|
|
157
173
|
createRectangle(e) {
|
|
158
174
|
return c(this, null, function* () {
|
|
159
175
|
var t;
|
|
160
|
-
return this.createItem(
|
|
176
|
+
return this.createItem(C, r(r({}, (t = this.theme) == null ? void 0 : t.rectangle), e));
|
|
161
177
|
});
|
|
162
178
|
}
|
|
163
179
|
/**
|
|
@@ -166,7 +182,7 @@ const p = class extends S {
|
|
|
166
182
|
createCircle(e) {
|
|
167
183
|
return c(this, null, function* () {
|
|
168
184
|
var t;
|
|
169
|
-
return this.createItem(
|
|
185
|
+
return this.createItem(R, r(r({}, (t = this.theme) == null ? void 0 : t.circle), e));
|
|
170
186
|
});
|
|
171
187
|
}
|
|
172
188
|
/**
|
|
@@ -187,35 +203,34 @@ const p = class extends S {
|
|
|
187
203
|
return this.createItem(j, r(r({}, (t = this.theme) == null ? void 0 : t.box), e));
|
|
188
204
|
});
|
|
189
205
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
undo() {
|
|
206
|
+
canUndo() {
|
|
207
|
+
var e;
|
|
208
|
+
return this.creatingItem ? (e = this.creatingItem) == null ? void 0 : e.canUndo() : !1;
|
|
194
209
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
redo() {
|
|
210
|
+
canRedo() {
|
|
211
|
+
var e;
|
|
212
|
+
return this.creatingItem ? (e = this.creatingItem) == null ? void 0 : e.canRedo() : !1;
|
|
199
213
|
}
|
|
200
214
|
/**
|
|
201
215
|
* @description: 清空数据
|
|
202
216
|
*/
|
|
203
217
|
clear() {
|
|
204
|
-
|
|
218
|
+
M(this.items, (e) => e.delete()), this.five.needsRender = !0;
|
|
205
219
|
}
|
|
206
220
|
createItem(e, ...t) {
|
|
207
221
|
return c(this, null, function* () {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
222
|
+
this.creatingItem && (this.creatingItem.stopCreating(), this.creatingItem = null);
|
|
223
|
+
const n = new e();
|
|
224
|
+
return this.creatingItem = n, this.group.add(n), yield n.create(...t).then((...l) => (this.creatingItem = null, l)).catch((l) => {
|
|
225
|
+
console.error(l), this.group.remove(n);
|
|
226
|
+
}), n;
|
|
212
227
|
});
|
|
213
228
|
}
|
|
214
229
|
};
|
|
215
|
-
let
|
|
216
|
-
|
|
217
|
-
const
|
|
230
|
+
let d = a;
|
|
231
|
+
h(d, "modules", O);
|
|
232
|
+
const ue = (m) => new d(m);
|
|
218
233
|
export {
|
|
219
|
-
|
|
220
|
-
|
|
234
|
+
d as Sculpt,
|
|
235
|
+
ue as SculptPlugin
|
|
221
236
|
};
|