@realsee/dnalogel 3.77.3 → 3.77.4
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 +5 -0
- package/dist/Sculpt/Objects/Base/Editor.d.ts +9 -2
- package/dist/index.cjs.js +34 -34
- package/dist/index.js +602 -594
- package/dist/index.umd.js +34 -34
- package/libs/Sculpt/Objects/Base/Editor.d.ts +9 -2
- package/libs/Sculpt/Objects/Base/Editor.js +72 -63
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -6,13 +6,17 @@ import type { Direction, Direction4 } from '../../../shared-utils/Object3DHelper
|
|
|
6
6
|
export type ObjectUpdateType = 'move' | 'rotate' | 'scale';
|
|
7
7
|
export interface ObjectUpdateParams {
|
|
8
8
|
/** 操作类型:移动、旋转、缩放 */
|
|
9
|
-
type
|
|
9
|
+
type?: ObjectUpdateType;
|
|
10
10
|
/** 开始时间戳 */
|
|
11
|
-
start_timestamp
|
|
11
|
+
start_timestamp?: number;
|
|
12
12
|
/** 结束时间戳 */
|
|
13
13
|
end_timestamp?: number;
|
|
14
14
|
/** 轴向 */
|
|
15
15
|
axis?: Direction | Direction4;
|
|
16
|
+
/** 进行中的状态 */
|
|
17
|
+
status?: 'moving' | 'rotating' | 'scaling';
|
|
18
|
+
/** 是否为操作结束,true 表示松手,false 表示拖动中 */
|
|
19
|
+
is_handle_end?: boolean;
|
|
16
20
|
}
|
|
17
21
|
export declare class BaseEditor<OriginObject extends THREE.Object3D = THREE.Object3D> extends IObject3D {
|
|
18
22
|
hooks: Subscribe<{
|
|
@@ -40,6 +44,9 @@ export declare class BaseEditorWithObjectHelper<OriginObject extends THREE.Objec
|
|
|
40
44
|
private onMoveStart;
|
|
41
45
|
private onRotateStart;
|
|
42
46
|
private onScaleStart;
|
|
47
|
+
private onMove;
|
|
48
|
+
private onRotate;
|
|
49
|
+
private onScale;
|
|
43
50
|
private onMoveEnd;
|
|
44
51
|
private onRotateEnd;
|
|
45
52
|
private onScaleEnd;
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
1
|
+
var j = Object.defineProperty, m = Object.defineProperties;
|
|
2
|
+
var S = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var O = Object.getOwnPropertySymbols;
|
|
4
|
+
var g = Object.prototype.hasOwnProperty, k = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var h = (i, e, t) => e in i ? j(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, s = (i, e) => {
|
|
5
6
|
for (var t in e || (e = {}))
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
for (var t of
|
|
9
|
-
|
|
10
|
-
return
|
|
11
|
-
};
|
|
12
|
-
var
|
|
13
|
-
import { Sculpt as
|
|
14
|
-
import { IObject3D as
|
|
15
|
-
import { Subscribe as
|
|
16
|
-
class
|
|
7
|
+
g.call(e, t) && h(i, t, e[t]);
|
|
8
|
+
if (O)
|
|
9
|
+
for (var t of O(e))
|
|
10
|
+
k.call(e, t) && h(i, t, e[t]);
|
|
11
|
+
return i;
|
|
12
|
+
}, n = (i, e) => m(i, S(e));
|
|
13
|
+
var r = (i, e, t) => (h(i, typeof e != "symbol" ? e + "" : e, t), t);
|
|
14
|
+
import { Sculpt as a } from "../../index.js";
|
|
15
|
+
import { IObject3D as v } from "../../../shared-utils/three/IObject3D.js";
|
|
16
|
+
import { Subscribe as E } from "../../../shared-utils/Subscribe.js";
|
|
17
|
+
class H extends v {
|
|
17
18
|
constructor(t) {
|
|
18
19
|
super();
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
r(this, "hooks", new E());
|
|
21
|
+
r(this, "originObject");
|
|
21
22
|
this.originObject = t;
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
@@ -33,85 +34,93 @@ class f extends u {
|
|
|
33
34
|
this.originObject.remove(this);
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
|
-
class
|
|
37
|
-
constructor(t,
|
|
37
|
+
class U extends H {
|
|
38
|
+
constructor(t, o) {
|
|
38
39
|
super(t);
|
|
39
|
-
|
|
40
|
+
r(this, "objectHelperConfig");
|
|
40
41
|
// 记录当前操作的类型、开始时间和轴向
|
|
41
|
-
|
|
42
|
+
r(this, "currentOperation", null);
|
|
42
43
|
// 记录移动操作开始
|
|
43
|
-
|
|
44
|
+
r(this, "onMoveStart", (t) => {
|
|
44
45
|
this.currentOperation = {
|
|
45
46
|
type: "move",
|
|
46
|
-
|
|
47
|
+
start_timestamp: Date.now(),
|
|
47
48
|
axis: t
|
|
48
49
|
};
|
|
49
50
|
});
|
|
50
51
|
// 记录旋转操作开始
|
|
51
|
-
|
|
52
|
+
r(this, "onRotateStart", (t) => {
|
|
52
53
|
this.currentOperation = {
|
|
53
54
|
type: "rotate",
|
|
54
|
-
|
|
55
|
+
start_timestamp: Date.now(),
|
|
55
56
|
axis: t
|
|
56
57
|
};
|
|
57
58
|
});
|
|
58
59
|
// 记录缩放操作开始
|
|
59
|
-
|
|
60
|
+
r(this, "onScaleStart", (t) => {
|
|
60
61
|
this.currentOperation = {
|
|
61
62
|
type: "scale",
|
|
62
|
-
|
|
63
|
+
start_timestamp: Date.now(),
|
|
63
64
|
axis: t
|
|
64
65
|
};
|
|
65
66
|
});
|
|
66
|
-
//
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
//
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
67
|
+
// 移动中的处理
|
|
68
|
+
r(this, "onMove", () => {
|
|
69
|
+
this.currentOperation && (this.currentOperation = n(s({}, this.currentOperation), {
|
|
70
|
+
status: "moving"
|
|
71
|
+
}), this.onObjectUpdate(!1));
|
|
72
|
+
});
|
|
73
|
+
// 旋转中的处理
|
|
74
|
+
r(this, "onRotate", () => {
|
|
75
|
+
this.currentOperation && (this.currentOperation = n(s({}, this.currentOperation), {
|
|
76
|
+
status: "rotating"
|
|
77
|
+
}), this.onObjectUpdate(!1));
|
|
78
|
+
});
|
|
79
|
+
// 缩放中的处理
|
|
80
|
+
r(this, "onScale", () => {
|
|
81
|
+
this.currentOperation && (this.currentOperation = n(s({}, this.currentOperation), {
|
|
82
|
+
status: "scaling"
|
|
83
|
+
}), this.onObjectUpdate(!1));
|
|
78
84
|
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
this.onObjectUpdate();
|
|
85
|
+
r(this, "onMoveEnd", () => {
|
|
86
|
+
this.onObjectUpdate(!0);
|
|
82
87
|
});
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
88
|
+
r(this, "onRotateEnd", () => {
|
|
89
|
+
this.onObjectUpdate(!0);
|
|
90
|
+
});
|
|
91
|
+
r(this, "onScaleEnd", () => {
|
|
92
|
+
this.onObjectUpdate(!0);
|
|
86
93
|
});
|
|
87
94
|
// 统一的触发 objectUpdate 方法
|
|
88
|
-
|
|
89
|
-
|
|
95
|
+
// @param isHandleEnd 是否为操作结束,true 表示松手,false 表示拖动中
|
|
96
|
+
r(this, "onObjectUpdate", (t = !0) => {
|
|
97
|
+
if (!this.currentOperation) {
|
|
98
|
+
this.hooks.emit("objectUpdate");
|
|
90
99
|
return;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
};
|
|
97
|
-
this.hooks.emit("objectUpdate",
|
|
100
|
+
}
|
|
101
|
+
const o = n(s({}, this.currentOperation), {
|
|
102
|
+
end_timestamp: t ? Date.now() : void 0,
|
|
103
|
+
// 只在松手时设置结束时间
|
|
104
|
+
is_handle_end: t
|
|
105
|
+
});
|
|
106
|
+
this.hooks.emit("objectUpdate", o), t && (this.currentOperation = null);
|
|
98
107
|
});
|
|
99
|
-
this.objectHelperConfig =
|
|
108
|
+
this.objectHelperConfig = o;
|
|
100
109
|
}
|
|
101
110
|
get helper() {
|
|
102
111
|
var t;
|
|
103
|
-
return (t =
|
|
112
|
+
return (t = a.modules.object3DHelper.getObject3DHelper(this.originObject)) == null ? void 0 : t.helper;
|
|
104
113
|
}
|
|
105
114
|
enable() {
|
|
106
115
|
super.enable();
|
|
107
116
|
const t = typeof this.objectHelperConfig == "function" ? this.objectHelperConfig() : this.objectHelperConfig;
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
|
|
117
|
+
a.modules.object3DHelper.addObject3DHelper(this.originObject, s({ positionFrom: "boundingBox" }, t));
|
|
118
|
+
const o = a.modules.object3DHelper.getObject3DHelper(this.originObject).helper;
|
|
119
|
+
o.hooks.on("moveStart", this.onMoveStart), o.hooks.on("rotateStart", this.onRotateStart), o.hooks.on("scaleStart", this.onScaleStart), o.hooks.on("move", this.onMove), o.hooks.on("rotate", this.onRotate), o.hooks.on("scale", this.onScale), o.hooks.on("moveEnd", this.onMoveEnd), o.hooks.on("rotateEnd", this.onRotateEnd), o.hooks.on("scaleEnd", this.onScaleEnd);
|
|
111
120
|
}
|
|
112
121
|
disable() {
|
|
113
|
-
var t,
|
|
114
|
-
super.disable(), (t = this.helper) == null || t.hooks.off("moveStart", this.onMoveStart), (
|
|
122
|
+
var t, o, c, p, l, b, u, d, f;
|
|
123
|
+
super.disable(), (t = this.helper) == null || t.hooks.off("moveStart", this.onMoveStart), (o = this.helper) == null || o.hooks.off("rotateStart", this.onRotateStart), (c = this.helper) == null || c.hooks.off("scaleStart", this.onScaleStart), (p = this.helper) == null || p.hooks.off("move", this.onMove), (l = this.helper) == null || l.hooks.off("rotate", this.onRotate), (b = this.helper) == null || b.hooks.off("scale", this.onScale), (u = this.helper) == null || u.hooks.off("moveEnd", this.onMoveEnd), (d = this.helper) == null || d.hooks.off("rotateEnd", this.onRotateEnd), (f = this.helper) == null || f.hooks.off("scaleEnd", this.onScaleEnd), a.modules.object3DHelper.removeObject3DHelper(this.originObject);
|
|
115
124
|
}
|
|
116
125
|
initialHelperMatrix() {
|
|
117
126
|
var t;
|
|
@@ -119,6 +128,6 @@ class k extends f {
|
|
|
119
128
|
}
|
|
120
129
|
}
|
|
121
130
|
export {
|
|
122
|
-
|
|
123
|
-
|
|
131
|
+
H as BaseEditor,
|
|
132
|
+
U as BaseEditorWithObjectHelper
|
|
124
133
|
};
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.77.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.77.4",
|
|
4
4
|
[
|
|
5
5
|
"background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')",
|
|
6
6
|
"background-repeat: no-repeat",
|