@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.
@@ -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: ObjectUpdateType;
9
+ type?: ObjectUpdateType;
10
10
  /** 开始时间戳 */
11
- start_timestamp: number;
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 d = Object.defineProperty;
2
- var l = Object.getOwnPropertySymbols;
3
- var j = Object.prototype.hasOwnProperty, m = Object.prototype.propertyIsEnumerable;
4
- var s = (r, e, t) => e in r ? d(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, b = (r, e) => {
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
- j.call(e, t) && s(r, t, e[t]);
7
- if (l)
8
- for (var t of l(e))
9
- m.call(e, t) && s(r, t, e[t]);
10
- return r;
11
- };
12
- var o = (r, e, t) => (s(r, typeof e != "symbol" ? e + "" : e, t), t);
13
- import { Sculpt as n } from "../../index.js";
14
- import { IObject3D as u } from "../../../shared-utils/three/IObject3D.js";
15
- import { Subscribe as O } from "../../../shared-utils/Subscribe.js";
16
- class f extends u {
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
- o(this, "hooks", new O());
20
- o(this, "originObject");
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 k extends f {
37
- constructor(t, i) {
37
+ class U extends H {
38
+ constructor(t, o) {
38
39
  super(t);
39
- o(this, "objectHelperConfig");
40
+ r(this, "objectHelperConfig");
40
41
  // 记录当前操作的类型、开始时间和轴向
41
- o(this, "currentOperation", null);
42
+ r(this, "currentOperation", null);
42
43
  // 记录移动操作开始
43
- o(this, "onMoveStart", (t) => {
44
+ r(this, "onMoveStart", (t) => {
44
45
  this.currentOperation = {
45
46
  type: "move",
46
- startTime: Date.now(),
47
+ start_timestamp: Date.now(),
47
48
  axis: t
48
49
  };
49
50
  });
50
51
  // 记录旋转操作开始
51
- o(this, "onRotateStart", (t) => {
52
+ r(this, "onRotateStart", (t) => {
52
53
  this.currentOperation = {
53
54
  type: "rotate",
54
- startTime: Date.now(),
55
+ start_timestamp: Date.now(),
55
56
  axis: t
56
57
  };
57
58
  });
58
59
  // 记录缩放操作开始
59
- o(this, "onScaleStart", (t) => {
60
+ r(this, "onScaleStart", (t) => {
60
61
  this.currentOperation = {
61
62
  type: "scale",
62
- startTime: Date.now(),
63
+ start_timestamp: Date.now(),
63
64
  axis: t
64
65
  };
65
66
  });
66
- // 移动中的处理(可选),可以在这里做一些实时处理,暂时不触发 objectUpdate
67
- // private onMove = () => {
68
- // }
69
- // // 旋转中的处理
70
- // private onRotate = () => {
71
- // }
72
- // // 缩放中的处理
73
- // private onScale = () => {
74
- // }
75
- // 移动结束,触发 objectUpdate
76
- o(this, "onMoveEnd", () => {
77
- this.onObjectUpdate();
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
- // 旋转结束,触发 objectUpdate
80
- o(this, "onRotateEnd", () => {
81
- this.onObjectUpdate();
85
+ r(this, "onMoveEnd", () => {
86
+ this.onObjectUpdate(!0);
82
87
  });
83
- // 缩放结束,触发 objectUpdate
84
- o(this, "onScaleEnd", () => {
85
- this.onObjectUpdate();
88
+ r(this, "onRotateEnd", () => {
89
+ this.onObjectUpdate(!0);
90
+ });
91
+ r(this, "onScaleEnd", () => {
92
+ this.onObjectUpdate(!0);
86
93
  });
87
94
  // 统一的触发 objectUpdate 方法
88
- o(this, "onObjectUpdate", () => {
89
- if (!this.currentOperation)
95
+ // @param isHandleEnd 是否为操作结束,true 表示松手,false 表示拖动中
96
+ r(this, "onObjectUpdate", (t = !0) => {
97
+ if (!this.currentOperation) {
98
+ this.hooks.emit("objectUpdate");
90
99
  return;
91
- const t = {
92
- type: this.currentOperation.type,
93
- start_timestamp: this.currentOperation.startTime,
94
- end_timestamp: Date.now(),
95
- axis: this.currentOperation.axis
96
- };
97
- this.hooks.emit("objectUpdate", t), this.currentOperation = null;
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 = i;
108
+ this.objectHelperConfig = o;
100
109
  }
101
110
  get helper() {
102
111
  var t;
103
- return (t = n.modules.object3DHelper.getObject3DHelper(this.originObject)) == null ? void 0 : t.helper;
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
- n.modules.object3DHelper.addObject3DHelper(this.originObject, b({ positionFrom: "boundingBox" }, t));
109
- const i = n.modules.object3DHelper.getObject3DHelper(this.originObject).helper;
110
- i.hooks.on("moveStart", this.onMoveStart), i.hooks.on("rotateStart", this.onRotateStart), i.hooks.on("scaleStart", this.onScaleStart), i.hooks.on("moveEnd", this.onMoveEnd), i.hooks.on("rotateEnd", this.onRotateEnd), i.hooks.on("scaleEnd", this.onScaleEnd);
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, i, a, h, c, p;
114
- super.disable(), (t = this.helper) == null || t.hooks.off("moveStart", this.onMoveStart), (i = this.helper) == null || i.hooks.off("rotateStart", this.onRotateStart), (a = this.helper) == null || a.hooks.off("scaleStart", this.onScaleStart), (h = this.helper) == null || h.hooks.off("moveEnd", this.onMoveEnd), (c = this.helper) == null || c.hooks.off("rotateEnd", this.onRotateEnd), (p = this.helper) == null || p.hooks.off("scaleEnd", this.onScaleEnd), n.modules.object3DHelper.removeObject3DHelper(this.originObject);
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
- f as BaseEditor,
123
- k as BaseEditorWithObjectHelper
131
+ H as BaseEditor,
132
+ U as BaseEditorWithObjectHelper
124
133
  };
@@ -23,7 +23,7 @@ let I = class {
23
23
  /**
24
24
  * @realsee/dnalogel 版本号
25
25
  */
26
- r(this, "VERSION", "3.77.3");
26
+ r(this, "VERSION", "3.77.4");
27
27
  r(this, "NAME");
28
28
  r(this, "five");
29
29
  r(this, "workUtil");
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.77.3",
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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/dnalogel",
3
- "version": "3.77.3",
3
+ "version": "3.77.4",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",