@realsee/dnalogel 3.76.0-alpha.1 → 3.77.0-alpha.0

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.
@@ -2,34 +2,34 @@ var q = Object.defineProperty, G = Object.defineProperties;
2
2
  var J = Object.getOwnPropertyDescriptors;
3
3
  var W = Object.getOwnPropertySymbols;
4
4
  var K = Object.prototype.hasOwnProperty, Q = Object.prototype.propertyIsEnumerable;
5
- var T = (s, e, n) => e in s ? q(s, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : s[e] = n, p = (s, e) => {
6
- for (var n in e || (e = {}))
7
- K.call(e, n) && T(s, n, e[n]);
5
+ var T = (s, t, e) => t in s ? q(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, f = (s, t) => {
6
+ for (var e in t || (t = {}))
7
+ K.call(t, e) && T(s, e, t[e]);
8
8
  if (W)
9
- for (var n of W(e))
10
- Q.call(e, n) && T(s, n, e[n]);
9
+ for (var e of W(t))
10
+ Q.call(t, e) && T(s, e, t[e]);
11
11
  return s;
12
- }, P = (s, e) => G(s, J(e));
13
- var N = (s, e, n) => (T(s, typeof e != "symbol" ? e + "" : e, n), n);
14
- var D = (s, e, n) => new Promise((a, f) => {
15
- var u = (c) => {
12
+ }, u = (s, t) => G(s, J(t));
13
+ var z = (s, t, e) => (T(s, typeof t != "symbol" ? t + "" : t, e), e);
14
+ var D = (s, t, e) => new Promise((i, m) => {
15
+ var w = (d) => {
16
16
  try {
17
- i(n.next(c));
18
- } catch (m) {
19
- f(m);
17
+ a(e.next(d));
18
+ } catch (P) {
19
+ m(P);
20
20
  }
21
- }, l = (c) => {
21
+ }, l = (d) => {
22
22
  try {
23
- i(n.throw(c));
24
- } catch (m) {
25
- f(m);
23
+ a(e.throw(d));
24
+ } catch (P) {
25
+ m(P);
26
26
  }
27
- }, i = (c) => c.done ? a(c.value) : Promise.resolve(c.value).then(u, l);
28
- i((n = n.apply(s, e)).next());
27
+ }, a = (d) => d.done ? i(d.value) : Promise.resolve(d.value).then(w, l);
28
+ a((e = e.apply(s, t)).next());
29
29
  });
30
30
  import { BaseObject as X } from "../Base/index.js";
31
31
  import * as r from "three";
32
- import { PolylineWithDotsMesh as L } from "../../Meshes/Polyline.js";
32
+ import { PolylineWithDotsMesh as M } from "../../Meshes/Polyline.js";
33
33
  import { RectangleMeshEditor as Y } from "../../Editors/RectangleMeshEditor.js";
34
34
  import { RectangleMesh as Z } from "../../Meshes/Rectangle.js";
35
35
  import { RectangleWithEdgeMesh as B } from "../../Meshes/RectangleWithEdge.js";
@@ -40,19 +40,19 @@ import { anyPositionToVector3 as j } from "../../../shared-utils/positionToVecto
40
40
  import { withResolvers as U } from "../../../shared-utils/promise/withResolvers.js";
41
41
  import { PolygonMesh as S } from "../../Meshes/Polygon.js";
42
42
  import { getNormal as ee } from "../../../shared-utils/three/getNormal.js";
43
- class ge extends X {
44
- constructor(n, a) {
45
- super(n, a);
46
- N(this, "type", "Rectangle");
47
- N(this, "rectangleMesh");
48
- N(this, "_editor");
49
- n && (this.rectangleMesh = new B(p(p({}, n.style), n)), this.add(this.rectangleMesh));
43
+ class ye extends X {
44
+ constructor(e, i) {
45
+ super(e, i);
46
+ z(this, "type", "Rectangle");
47
+ z(this, "rectangleMesh");
48
+ z(this, "_editor");
49
+ e && (this.rectangleMesh = new B(f(f({}, e.style), e)), this.add(this.rectangleMesh));
50
50
  }
51
51
  get editor() {
52
52
  return this._editor || (this._editor = new Y(this.rectangleMesh)), this._editor;
53
53
  }
54
54
  get data() {
55
- return P(p({}, this.baseData), {
55
+ return u(f({}, this.baseData), {
56
56
  points: $(this.applyObjectMatrixWorld(this.rectangleMesh.points, this.rectangleMesh)),
57
57
  style: {
58
58
  color: this.rectangleMesh.color.getHex(),
@@ -62,142 +62,144 @@ class ge extends X {
62
62
  }
63
63
  });
64
64
  }
65
- setData(n) {
66
- n.points && this.rectangleMesh.setPoints(this.applyObjectReversalMatrixWorld(n.points.map(j), this.rectangleMesh)), this.rectangleMesh.setStyle(n.style), this._editor && this._editor.initialHelperMatrix();
65
+ setData(e) {
66
+ e.points && this.rectangleMesh.setPoints(this.applyObjectReversalMatrixWorld(e.points.map(j), this.rectangleMesh)), this.rectangleMesh.setStyle(e.style), this._editor && this._editor.initialHelperMatrix();
67
67
  }
68
68
  highlight() {
69
- var n;
70
- (n = this.rectangleMesh) == null || n.highlight();
69
+ var e;
70
+ (e = this.rectangleMesh) == null || e.highlight();
71
71
  }
72
72
  unhighlight() {
73
- var n;
74
- (n = this.rectangleMesh) == null || n.unhighlight();
73
+ var e;
74
+ (e = this.rectangleMesh) == null || e.unhighlight();
75
75
  }
76
- create(n) {
76
+ create(e) {
77
77
  return D(this, null, function* () {
78
78
  this.removeChildren();
79
- const a = new B(n);
80
- this.rectangleMesh = a, this.add(this.rectangleMesh), yield te(this.rectangleMesh, this.pointSelector, n), this.config.defaultAction && this.editor.enable();
79
+ const i = new B(e);
80
+ this.rectangleMesh = i, this.add(this.rectangleMesh), yield te(this.rectangleMesh, this.pointSelector, e), this.config.defaultAction && this.editor.enable();
81
81
  });
82
82
  }
83
83
  }
84
- function te(s, e, n) {
85
- var f;
86
- return ((f = n == null ? void 0 : n.drawMethod) != null ? f : "diagonal") === "diagonal" ? se(s, e, n) : oe(s, e, n);
84
+ function te(s, t, e) {
85
+ var m;
86
+ return ((m = e == null ? void 0 : e.drawMethod) != null ? m : "diagonal") === "diagonal" ? se(s, t, e) : oe(s, t, e);
87
87
  }
88
- function ne(s, e) {
89
- const n = [];
90
- return s.scene.traverse((a) => {
91
- var f;
92
- if (a.visible && !((f = e == null ? void 0 : e.excludes) != null && f.includes(a)) && (a instanceof Z || a instanceof S)) {
93
- const u = a.points.map((l) => {
94
- const i = new r.Face3(l.x, l.y, l.z, a.normal);
95
- return a.style.occlusionVisibility && (i.IsAlwaysVisible = !0), i;
88
+ function ne(s, t) {
89
+ const e = [];
90
+ return s.scene.traverse((i) => {
91
+ var m;
92
+ if (i.visible && !((m = t == null ? void 0 : t.excludes) != null && m.includes(i)) && (i instanceof Z || i instanceof S)) {
93
+ const w = i.points.map((l) => {
94
+ const a = new r.Face3(l.x, l.y, l.z, i.normal);
95
+ return i.style.occlusionVisibility && (a.IsAlwaysVisible = !0), a;
96
96
  });
97
- n.push(...u);
97
+ e.push(...w);
98
98
  }
99
- }), n;
99
+ }), e;
100
100
  }
101
- function se(s, e, n) {
102
- var C;
103
- const { promise: a, reject: f, resolve: u } = U(), l = s.parent;
101
+ function se(s, t, e) {
102
+ var A;
103
+ const { promise: i, reject: m, resolve: w } = U(), l = s.parent;
104
104
  if (!l)
105
- return f(new Error("No container"));
106
- const i = (C = n == null ? void 0 : n.limit) != null ? C : "none", c = new L(P(p({}, s.style), { dashed: !0 })), m = new L(P(p({}, s.style), { dashed: !0, lengthEnable: !1 })), g = new L(P(p({}, s.style), { dashed: !1, lengthEnable: !1 }));
107
- l.add(c, g, m), e.enable();
108
- const t = [];
109
- let d = new r.Vector3(), M = new r.Vector3();
110
- const h = new r.Plane(), b = () => {
111
- t.push(d.clone()), t.length === 1 ? (i === "xoz" && h.setFromNormalAndCoplanarPoint(new r.Vector3(0, 1, 0), t[0]), i === "none" && h.setFromNormalAndCoplanarPoint(M, t[0])) : t.length === 2 ? i === "y" || i === "xoz" ? (v(), u()) : g.setPoints([t[0], t[1]]) : t.length === 3 && (v(), u());
112
- }, x = (o) => {
113
- var A, R;
105
+ return m(new Error("No container"));
106
+ const a = (A = e == null ? void 0 : e.limit) != null ? A : "none", d = new M(u(f({}, s.style), { dashed: !0 })), P = new M(u(f({}, s.style), { dashed: !0, lengthEnable: !1 })), y = new M(u(f({}, s.style), { dashed: !1, lengthEnable: !1 }));
107
+ l.add(d, y, P), t.enable();
108
+ const n = [];
109
+ let h = new r.Vector3(), b = new r.Vector3();
110
+ const c = new r.Plane(), x = () => {
111
+ var o;
112
+ n.push(h.clone()), (o = e == null ? void 0 : e.onPointPlaced) == null || o.call(e), n.length === 1 ? (a === "xoz" && c.setFromNormalAndCoplanarPoint(new r.Vector3(0, 1, 0), n[0]), a === "none" && c.setFromNormalAndCoplanarPoint(b, n[0])) : n.length === 2 ? a === "y" || a === "xoz" ? (v(), w()) : y.setPoints([n[0], n[1]]) : n.length === 3 && (v(), w());
113
+ }, E = (o) => {
114
+ var R, N;
114
115
  if (!(o != null && o.raycaster))
115
116
  return;
116
- const z = (A = t.at(-1)) == null ? void 0 : A.clone();
117
- if (t.length === 0) {
118
- d = o.point.clone(), M = (R = o.face) == null ? void 0 : R.normal;
117
+ const L = (R = n.at(-1)) == null ? void 0 : R.clone();
118
+ if (n.length === 0) {
119
+ h = o.point.clone(), b = (N = o.face) == null ? void 0 : N.normal;
119
120
  return;
120
121
  }
121
- if (t.length === 1 && i === "y") {
122
- const w = new r.Line3(new r.Vector3(0, 1, 0).add(t[0]), new r.Vector3(0, -1, 0).add(t[0])).closestPointToPoint(o.point, !1, new r.Vector3());
123
- s.setPoints([t[0], w, o.point]);
122
+ if (n.length === 1 && a === "y") {
123
+ const p = new r.Line3(new r.Vector3(0, 1, 0).add(n[0]), new r.Vector3(0, -1, 0).add(n[0])).closestPointToPoint(o.point, !1, new r.Vector3());
124
+ s.setPoints([n[0], p, o.point]);
124
125
  return;
125
126
  }
126
- if (t.length === 1 && i === "xoz") {
127
- const y = new r.Line3(new r.Vector3(1, 0, 0).add(t[0]), new r.Vector3(-1, 0, 0).add(t[0])), w = o.raycaster.ray.intersectPlane(h, new r.Vector3()), V = y.closestPointToPoint(w, !1, new r.Vector3());
128
- s.setPoints([t[0], V, w]);
127
+ if (n.length === 1 && a === "xoz") {
128
+ const V = new r.Line3(new r.Vector3(1, 0, 0).add(n[0]), new r.Vector3(-1, 0, 0).add(n[0])), p = o.raycaster.ray.intersectPlane(c, new r.Vector3()), g = V.closestPointToPoint(p, !1, new r.Vector3());
129
+ s.setPoints([n[0], g, p]);
129
130
  return;
130
131
  }
131
- if (t.length === 1 && i === "none") {
132
- h ? (d = o.raycaster.ray.intersectPlane(h, new r.Vector3()), m.setPoints([d, o.point])) : d = o.point.clone(), c.setPoints([z, d]);
132
+ if (n.length === 1 && a === "none") {
133
+ c ? (h = o.raycaster.ray.intersectPlane(c, new r.Vector3()), P.setPoints([h, o.point])) : h = o.point.clone(), d.setPoints([L, h]);
133
134
  return;
134
135
  }
135
- if (t.length === 2 && i === "none") {
136
- l.remove(c);
137
- const y = o.raycaster.ray.intersectPlane(h, new r.Vector3()), w = t[0].distanceTo(t[1]) / 2, V = new r.Vector3().lerpVectors(t[0], t[1], 0.5), _ = new r.Vector3().subVectors(y, V).normalize();
138
- d = new r.Vector3().addVectors(V, _.multiplyScalar(w));
139
- const F = [t[0], d, t[1]], O = H(F, I.modules.five.camera.position);
136
+ if (n.length === 2 && a === "none") {
137
+ l.remove(d);
138
+ const V = o.raycaster.ray.intersectPlane(c, new r.Vector3()), p = n[0].distanceTo(n[1]) / 2, g = new r.Vector3().lerpVectors(n[0], n[1], 0.5), _ = new r.Vector3().subVectors(V, g).normalize();
139
+ h = new r.Vector3().addVectors(g, _.multiplyScalar(p));
140
+ const F = [n[0], h, n[1]], O = H(F, I.modules.five.camera.position);
140
141
  s.setPoints(O);
141
142
  return;
142
143
  }
143
144
  }, v = () => {
144
- e.off("select", b), e.off("intersectionUpdate", x), e.off("disable", E), e.disable(), l == null || l.remove(c, g, m);
145
- }, E = () => {
146
- v(), l == null || l.remove(s), f(new Error("Cancelled"));
145
+ t.off("select", x), t.off("intersectionUpdate", E), t.off("disable", C), t.disable(), l == null || l.remove(d, y, P);
146
+ }, C = () => {
147
+ v(), l == null || l.remove(s), m(new Error("Cancelled"));
147
148
  };
148
- return e.on("select", b), e.on("intersectionUpdate", x), e.on("disable", E), a;
149
+ return t.on("select", x), t.on("intersectionUpdate", E), t.on("disable", C), i;
149
150
  }
150
- function oe(s, e, n) {
151
- var C;
152
- const { promise: a, reject: f, resolve: u } = U(), l = s.parent;
151
+ function oe(s, t, e) {
152
+ var A;
153
+ const { promise: i, reject: m, resolve: w } = U(), l = s.parent;
153
154
  if (!l)
154
- return f(new Error("No container"));
155
- const i = (C = n == null ? void 0 : n.limit) != null ? C : "none", c = new L(P(p({}, s.style), { dashed: !0 })), m = new L(P(p({}, s.style), { dashed: !0, lengthEnable: !1 })), g = new L(P(p({}, s.style), { dashed: !1, lengthEnable: !1 }));
156
- l.add(c, g, m), e.enable(), e.setAdherePoints(ne(e.five, { excludes: [s] }));
157
- const t = [];
158
- let d = new r.Vector3(), M = new r.Vector3();
159
- const h = new r.Plane(), b = () => {
160
- if (t.push(d.clone()), t.length === 1)
161
- e.planeMode = "onlyPlane", i === "y" && (e.adhereLine = [new r.Line3(t[0], new r.Vector3(0, 1, 0).add(t[0]))]), i === "xoz" && (h.setFromNormalAndCoplanarPoint(new r.Vector3(0, 1, 0), t[0]), e.plane = h), i === "none" && (h.setFromNormalAndCoplanarPoint(M, t[0]), e.plane = h);
162
- else if (t.length === 2) {
163
- e.planeMode = "vertical", i === "y" && (e.adhereLine = []);
164
- let o = !1;
165
- t[0].x === t[1].x && t[0].z === t[1].z && (o = !0), i === "y" && !o && (h.setFromCoplanarPoints(t[0], t[1], new r.Vector3(0, 1, 0).add(t[0])), e.plane = h), g.setPoints([t[0], t[1]]);
155
+ return m(new Error("No container"));
156
+ const a = (A = e == null ? void 0 : e.limit) != null ? A : "none", d = new M(u(f({}, s.style), { dashed: !0 })), P = new M(u(f({}, s.style), { dashed: !0, lengthEnable: !1 })), y = new M(u(f({}, s.style), { dashed: !1, lengthEnable: !1 }));
157
+ l.add(d, y, P), t.enable(), t.setAdherePoints(ne(t.five, { excludes: [s] }));
158
+ const n = [];
159
+ let h = new r.Vector3(), b = new r.Vector3();
160
+ const c = new r.Plane(), x = () => {
161
+ var o;
162
+ if (n.push(h.clone()), (o = e == null ? void 0 : e.onPointPlaced) == null || o.call(e), n.length === 1)
163
+ t.planeMode = "onlyPlane", a === "y" && (t.adhereLine = [new r.Line3(n[0], new r.Vector3(0, 1, 0).add(n[0]))]), a === "xoz" && (c.setFromNormalAndCoplanarPoint(new r.Vector3(0, 1, 0), n[0]), t.plane = c), a === "none" && (c.setFromNormalAndCoplanarPoint(b, n[0]), t.plane = c);
164
+ else if (n.length === 2) {
165
+ t.planeMode = "vertical", a === "y" && (t.adhereLine = []);
166
+ let L = !1;
167
+ n[0].x === n[1].x && n[0].z === n[1].z && (L = !0), a === "y" && !L && (c.setFromCoplanarPoints(n[0], n[1], new r.Vector3(0, 1, 0).add(n[0])), t.plane = c), y.setPoints([n[0], n[1]]);
166
168
  } else
167
- t.length === 3 && (v(), u());
168
- }, x = (o) => {
169
- var A, R, y, w;
169
+ n.length === 3 && (v(), w());
170
+ }, E = (o) => {
171
+ var R, N, V, p;
170
172
  if (!o || !(o != null && o.raycaster))
171
173
  return;
172
- const z = (A = t.at(-1)) == null ? void 0 : A.clone();
173
- if (t.length === 0) {
174
- d = o.point.clone(), M = (R = o.face) == null ? void 0 : R.normal;
174
+ const L = (R = n.at(-1)) == null ? void 0 : R.clone();
175
+ if (n.length === 0) {
176
+ h = o.point.clone(), b = (N = o.face) == null ? void 0 : N.normal;
175
177
  return;
176
178
  }
177
- if (t.length === 1) {
178
- d = o.point, m.setPoints([(y = o.originalPoint) != null ? y : o.point, o.point]), c.setPoints([z, d]);
179
+ if (n.length === 1) {
180
+ h = o.point, P.setPoints([(V = o.originalPoint) != null ? V : o.point, o.point]), d.setPoints([L, h]);
179
181
  return;
180
182
  }
181
- if (t.length === 2) {
182
- if (!e.plane) {
183
- const k = ee([t[0], t[1], o.point]);
184
- h.setFromNormalAndCoplanarPoint(k, t[0]);
183
+ if (n.length === 2) {
184
+ if (!t.plane) {
185
+ const k = ee([n[0], n[1], o.point]);
186
+ c.setFromNormalAndCoplanarPoint(k, n[0]);
185
187
  }
186
- m.setPoints([(w = o.originalPoint) != null ? w : o.point, o.point]);
187
- const V = new r.Vector3().crossVectors(t[0].clone().sub(t[1]), h.normal).normalize();
188
- d = new r.Line3(t[1].clone().add(V), t[1].clone().sub(V)).closestPointToPoint(o.point, !1, new r.Vector3());
189
- const F = [t[0], t[1], d], O = H(F, I.modules.five.camera.position);
188
+ P.setPoints([(p = o.originalPoint) != null ? p : o.point, o.point]);
189
+ const g = new r.Vector3().crossVectors(n[0].clone().sub(n[1]), c.normal).normalize();
190
+ h = new r.Line3(n[1].clone().add(g), n[1].clone().sub(g)).closestPointToPoint(o.point, !1, new r.Vector3());
191
+ const F = [n[0], n[1], h], O = H(F, I.modules.five.camera.position);
190
192
  s.setPoints(O);
191
193
  return;
192
194
  }
193
195
  }, v = () => {
194
- e.setAdherePoints([]), e.adhereLine = [], e.adherePlane = [], e.plane = void 0, e.off("select", b), e.off("intersectionUpdate", x), e.off("disable", E), e.disable(), l == null || l.remove(c, g, m);
195
- }, E = () => {
196
- v(), l == null || l.remove(s), f(new Error("Cancelled"));
196
+ t.setAdherePoints([]), t.adhereLine = [], t.adherePlane = [], t.plane = void 0, t.off("select", x), t.off("intersectionUpdate", E), t.off("disable", C), t.disable(), l == null || l.remove(d, y, P);
197
+ }, C = () => {
198
+ v(), l == null || l.remove(s), m(new Error("Cancelled"));
197
199
  };
198
- return e.on("select", b), e.on("intersectionUpdate", x), e.on("disable", E), a;
200
+ return t.on("select", x), t.on("intersectionUpdate", E), t.on("disable", C), i;
199
201
  }
200
202
  export {
201
- ge as Rectangle,
203
+ ye as Rectangle,
202
204
  te as createRectangle
203
205
  };
@@ -23,7 +23,7 @@ let I = class {
23
23
  /**
24
24
  * @realsee/dnalogel 版本号
25
25
  */
26
- r(this, "VERSION", "3.76.0-alpha.1");
26
+ r(this, "VERSION", "3.77.0-alpha.0");
27
27
  r(this, "NAME");
28
28
  r(this, "five");
29
29
  r(this, "workUtil");
@@ -68,7 +68,7 @@ class z extends B {
68
68
  }
69
69
  }
70
70
  const m = o === "plane" ? [] : [o];
71
- this.helperObject3D.showDraggingHelper(m), this.hooks.emit("moveStart"), this.isDragging = !0;
71
+ this.helperObject3D.showDraggingHelper(m), this.hooks.emit("moveStart", o), this.isDragging = !0;
72
72
  });
73
73
  h(this, "dragging", (e) => {
74
74
  if (!this.isDragging || !this.startInfo)
@@ -31,31 +31,31 @@ class _ extends Y {
31
31
  this.helperObject3D.applyHelperScaleMatrix4(t.matrix, t.origin);
32
32
  }
33
33
  getDragPlane() {
34
- const t = new D.Plane(), s = this.helperObject3D.cornerPositions;
35
- if (s.length !== 0)
36
- return s.length < 3 ? t.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new o()), s[0]) : t.setFromCoplanarPoints(s[0], s[1], s[2]), t;
34
+ const t = new D.Plane(), e = this.helperObject3D.cornerPositions;
35
+ if (e.length !== 0)
36
+ return e.length < 3 ? t.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new o()), e[0]) : t.setFromCoplanarPoints(e[0], e[1], e[2]), t;
37
37
  }
38
- dragStart(t, s) {
38
+ dragStart(t, e) {
39
39
  var p, n;
40
40
  (n = (p = this.helperObject3D).updatePoints) == null || n.call(p);
41
41
  const f = this.getDragPlane();
42
42
  if (!f)
43
43
  return this.dragEnd();
44
- this.startInfo = { startPoint: { position: s.position.clone(), direction: s.direction }, plane: f }, this.hooks.emit("scaleStart"), this.render(), this.isDragging = !0;
44
+ this.startInfo = { startPoint: { position: e.position.clone(), direction: e.direction }, plane: f }, this.hooks.emit("scaleStart", e.direction), this.render(), this.isDragging = !0;
45
45
  }
46
46
  dragging(t) {
47
47
  if (!this.isDragging)
48
48
  return;
49
- const s = T(this.camera, t, this.container);
50
- if (!s)
49
+ const e = T(this.camera, t, this.container);
50
+ if (!e)
51
51
  return this.dragEnd();
52
- this.scale(s);
52
+ this.scale(e);
53
53
  }
54
54
  scale(t) {
55
55
  var C, E;
56
56
  if (!this.startInfo)
57
57
  return;
58
- const s = this.originObject3D, { startPoint: f, plane: p } = this.startInfo, n = this.helperObject3D.cornerPositions;
58
+ const e = this.originObject3D, { startPoint: f, plane: p } = this.startInfo, n = this.helperObject3D.cornerPositions;
59
59
  if (n.length < 4)
60
60
  return this.dragEnd();
61
61
  const g = t.ray.intersectPlane(p, new o());
@@ -65,30 +65,30 @@ class _ extends Y {
65
65
  const i = new o(0, 0, 0);
66
66
  if (!this.startInfo)
67
67
  return i;
68
- const e = (r === "ew" ? I : y).clone(), c = k.clone().projectOnVector(e), b = g.clone().projectOnVector(e), M = m.clone().projectOnVector(e);
68
+ const s = (r === "ew" ? I : y).clone(), c = k.clone().projectOnVector(s), b = g.clone().projectOnVector(s), M = m.clone().projectOnVector(s);
69
69
  if (b.equals(c))
70
70
  return i;
71
71
  if (r === "ns" && typeof this.startInfo.dragPointInCenterBottom != "boolean") {
72
- const l = new o().subVectors(b, M), O = l.x < 0 && e.x >= 0, P = l.y < 0 && e.y >= 0, j = l.z < 0 && e.z >= 0;
72
+ const l = new o().subVectors(b, M), O = l.x < 0 && s.x >= 0, P = l.y < 0 && s.y >= 0, j = l.z < 0 && s.z >= 0;
73
73
  this.startInfo.dragPointInCenterBottom = O || P || j;
74
74
  }
75
75
  if (r === "ew" && typeof this.startInfo.dragPointInCenterLeft != "boolean") {
76
- const l = new o().subVectors(b, M), O = l.x < 0 && e.x >= 0, P = l.y < 0 && e.y >= 0, j = l.z < 0 && e.z >= 0;
76
+ const l = new o().subVectors(b, M), O = l.x < 0 && s.x >= 0, P = l.y < 0 && s.y >= 0, j = l.z < 0 && s.z >= 0;
77
77
  this.startInfo.dragPointInCenterLeft = O || P || j;
78
78
  }
79
79
  const v = new o().subVectors(b, c), N = v.length();
80
80
  return N > 0.3 ? (console.warn("offset.length() > 0.3, skipped", N), i) : v;
81
81
  }, A = S("ew"), B = S("ns"), V = () => {
82
82
  const r = A;
83
- this.helperObject3D.cornerPositions.forEach((i, e) => {
83
+ this.helperObject3D.cornerPositions.forEach((i, s) => {
84
84
  var c;
85
- (c = this.startInfo) != null && c.dragPointInCenterLeft ? (e === 0 || e === 3) && i.add(r) : (e === 1 || e === 2) && i.add(r);
85
+ (c = this.startInfo) != null && c.dragPointInCenterLeft ? (s === 0 || s === 3) && i.add(r) : (s === 1 || s === 2) && i.add(r);
86
86
  });
87
87
  }, x = () => {
88
88
  const r = B;
89
- this.helperObject3D.cornerPositions.forEach((i, e) => {
89
+ this.helperObject3D.cornerPositions.forEach((i, s) => {
90
90
  var c;
91
- (c = this.startInfo) != null && c.dragPointInCenterBottom ? (e === 0 || e === 1) && i.add(r) : (e === 2 || e === 3) && i.add(r);
91
+ (c = this.startInfo) != null && c.dragPointInCenterBottom ? (s === 0 || s === 1) && i.add(r) : (s === 2 || s === 3) && i.add(r);
92
92
  });
93
93
  };
94
94
  switch (z) {
@@ -103,9 +103,9 @@ class _ extends Y {
103
103
  V(), x();
104
104
  }
105
105
  const H = new o().subVectors(n[1], n[0]).length() / I.length(), L = new o().subVectors(n[3], n[0]).length() / y.length(), R = new o(H, L, 1), u = new D.Matrix4().scale(R);
106
- s.isCSS3DObjectPlus && s.applyScaleMatrix4 ? s.applyScaleMatrix4(u) : s.scale.applyMatrix4(u), f.position.copy(g);
106
+ e.isCSS3DObjectPlus && e.applyScaleMatrix4 ? e.applyScaleMatrix4(u) : e.scale.applyMatrix4(u), f.position.copy(g);
107
107
  const q = new o().addVectors(n[0], n[2]).divideScalar(2), F = new o().subVectors(q, m), d = new D.Matrix4().setPosition(F);
108
- s.applyMatrix4(d), (C = this.helperObject3D.css3DInstance) == null || C.css3DObject.applyMatrix4(d), (E = this.helperObject3D.plane) == null || E.applyMatrix4(d), this.internalHooks.emit("applyObjectScale", { matrix: u }), this.internalHooks.emit("applyObjectPosition", { matrix: d }), this.render();
108
+ e.applyMatrix4(d), (C = this.helperObject3D.css3DInstance) == null || C.css3DObject.applyMatrix4(d), (E = this.helperObject3D.plane) == null || E.applyMatrix4(d), this.internalHooks.emit("applyObjectScale", { matrix: u }), this.internalHooks.emit("applyObjectPosition", { matrix: d }), this.render();
109
109
  }
110
110
  dragEnd() {
111
111
  this.isDragging && (this.startInfo = void 0, this.isDragging = !1, "onScaleEnd" in this.helperObject3D && typeof this.helperObject3D.onScaleEnd == "function" && this.helperObject3D.onScaleEnd(), this.hooks.emit("scaleEnd"), this.render());
@@ -92,7 +92,7 @@ class I extends Q {
92
92
  angleHelper: s,
93
93
  angle: 0,
94
94
  helperQuaternion: a.clone()
95
- }, w = new o.Quaternion(), this.helperObject3D.showDraggingHelper([n]), this.hooks.emit("rotateStart"), this.isDragging = !0;
95
+ }, w = new o.Quaternion(), this.helperObject3D.showDraggingHelper([n]), this.hooks.emit("rotateStart", n), this.isDragging = !0;
96
96
  }
97
97
  getMatrix() {
98
98
  var e, n;
@@ -1,4 +1,5 @@
1
1
  import type * as THREE from 'three';
2
+ import type { Direction, Direction4 } from './Direction';
2
3
  export type HelperEventMap = {
3
4
  wantToMove: (position: THREE.Vector3) => void;
4
5
  moveBefore: (position: THREE.Vector3) => THREE.Vector3 | null | undefined;
@@ -7,9 +8,9 @@ export type HelperEventMap = {
7
8
  move: (position: THREE.Vector3) => void;
8
9
  rotate: (quaternion: THREE.Quaternion) => void;
9
10
  scale: (scale: THREE.Vector3) => void;
10
- moveStart: () => void;
11
- rotateStart: () => void;
12
- scaleStart: () => void;
11
+ moveStart: (direction?: Direction) => void;
12
+ rotateStart: (direction?: Direction) => void;
13
+ scaleStart: (direction?: Direction | Direction4) => void;
13
14
  moveEnd: () => void;
14
15
  rotateEnd: () => void;
15
16
  scaleEnd: () => void;
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.76.0-alpha.1",
3
+ "%c %c@realsee/dnalogel %cv3.77.0-alpha.0",
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.76.0-alpha.1",
3
+ "version": "3.77.0-alpha.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",