@realsee/dnalogel 3.47.1 → 3.47.3

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.
@@ -3,8 +3,9 @@ import { PointSelectorHelper, type PointIntersection, type PointSelectorHelperCo
3
3
  import { type Vector3 } from 'three';
4
4
  import * as THREE from 'three';
5
5
  import { Subscribe } from '../../Subscribe';
6
+ import type { LiteralString } from '../../../typings/utils.type';
6
7
  export type { PointIntersection };
7
- type ActionIfNoModelUnderMouse = 'virtualPoint' | 'lastPoint' | 'disable';
8
+ export type ActionIfNoModelUnderMouse = LiteralString<'virtualPoint' | 'lastPoint' | 'disable'>;
8
9
  interface Config {
9
10
  /**
10
11
  * @description: 选点的两种模式, 'fixed' 为固定选点为屏幕中心点,拖动five画布来更新点,'cursor' 为跟随鼠标移动来更新点, 'auto' 则根据设备类型自动选择
@@ -1,31 +1,31 @@
1
1
  var _ = Object.defineProperty;
2
- var L = Object.getOwnPropertySymbols;
2
+ var b = Object.getOwnPropertySymbols;
3
3
  var S = Object.prototype.hasOwnProperty, k = Object.prototype.propertyIsEnumerable;
4
- var f = (l, o, e) => o in l ? _(l, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[o] = e, y = (l, o) => {
4
+ var f = (s, o, e) => o in s ? _(s, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[o] = e, y = (s, o) => {
5
5
  for (var e in o || (o = {}))
6
- S.call(o, e) && f(l, e, o[e]);
7
- if (L)
8
- for (var e of L(o))
9
- k.call(o, e) && f(l, e, o[e]);
10
- return l;
6
+ S.call(o, e) && f(s, e, o[e]);
7
+ if (b)
8
+ for (var e of b(o))
9
+ k.call(o, e) && f(s, e, o[e]);
10
+ return s;
11
11
  };
12
- var h = (l, o, e) => (f(l, typeof o != "symbol" ? o + "" : o, e), e);
12
+ var h = (s, o, e) => (f(s, typeof o != "symbol" ? o + "" : o, e), e);
13
13
  import * as a from "three";
14
- import { DEFAULT_LINE_COLOR as b, DEFAULT_LINE_WIDTH as M, DEFAULT_HIGHLIGHT_OPACITY as m } from "../typings/style.js";
15
- import { LineGeometry as D, LineMaterial as w, THREE_Line2 as H } from "../../shared-utils/five/FiveLine.js";
14
+ import { DEFAULT_LINE_COLOR as m, DEFAULT_LINE_WIDTH as M, DEFAULT_HIGHLIGHT_OPACITY as D } from "../typings/style.js";
15
+ import { LineGeometry as L, LineMaterial as w, THREE_Line2 as H } from "../../shared-utils/five/FiveLine.js";
16
16
  import { anyPositionToVector3 as C } from "../../shared-utils/positionToVector3.js";
17
17
  import { IObject3D as I } from "../../shared-utils/three/IObject3D.js";
18
18
  import "hammerjs";
19
19
  import "three/examples/jsm/renderers/CSS3DRenderer";
20
- import { centerPoint as R } from "../../shared-utils/three/centerPoint.js";
21
- import { LightTag as x } from "../../shared-utils/tag.js";
22
- import { globalModules as p } from "../utils/Modules/Global.js";
20
+ import { centerPoint as p } from "../../shared-utils/three/centerPoint.js";
21
+ import { LightTag as R } from "../../shared-utils/tag.js";
22
+ import { globalModules as x } from "../utils/Modules/Global.js";
23
23
  import { removeAllTag as v } from "../utils/removeAllTag.js";
24
24
  import "../../shared-utils/three/THREESphere.js";
25
25
  import "animejs";
26
26
  import { notNil as c } from "../../shared-utils/isNil.js";
27
27
  import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
28
- class T extends w {
28
+ class E extends w {
29
29
  constructor(e) {
30
30
  var n, t;
31
31
  super(e);
@@ -44,7 +44,7 @@ class T extends w {
44
44
  this.dashed = e, e ? this.defines.USE_DASH = "" : delete this.defines.USE_DASH, this.needsUpdate = !0;
45
45
  }
46
46
  }
47
- class E extends H {
47
+ class T extends H {
48
48
  constructor(e, n) {
49
49
  super(e, n);
50
50
  h(this, "name", "Line3");
@@ -52,7 +52,7 @@ class E extends H {
52
52
  }
53
53
  class J extends I {
54
54
  constructor(e) {
55
- var s, r, u, g, d;
55
+ var l, r, g, u, d;
56
56
  super();
57
57
  h(this, "name", "LineMesh");
58
58
  h(this, "points");
@@ -63,15 +63,15 @@ class J extends I {
63
63
  h(this, "opacityBeforeHighlight");
64
64
  h(this, "paramsStyle", {});
65
65
  this.paramsStyle = e != null ? e : {};
66
- const n = new D(), t = new T({
67
- color: new a.Color((s = e == null ? void 0 : e.lineColor) != null ? s : b),
66
+ const n = new L(), t = new E({
67
+ color: new a.Color((l = e == null ? void 0 : e.lineColor) != null ? l : m),
68
68
  linewidth: (r = e == null ? void 0 : e.lineWidth) != null ? r : M,
69
69
  dashScale: 40,
70
- opacity: (u = e == null ? void 0 : e.opacity) != null ? u : 1,
70
+ opacity: (g = e == null ? void 0 : e.opacity) != null ? g : 1,
71
71
  transparent: !0,
72
- dashed: (g = e == null ? void 0 : e.dashed) != null ? g : !1
73
- }), i = new T({
74
- color: new a.Color((d = e == null ? void 0 : e.lineColor) != null ? d : b),
72
+ dashed: (u = e == null ? void 0 : e.dashed) != null ? u : !1
73
+ }), i = new E({
74
+ color: new a.Color((d = e == null ? void 0 : e.lineColor) != null ? d : m),
75
75
  linewidth: t.linewidth * 0.9,
76
76
  dashScale: t.dashScale,
77
77
  opacity: t.opacity * 0.8,
@@ -80,7 +80,7 @@ class J extends I {
80
80
  transparent: !0,
81
81
  resolution: t.resolution
82
82
  });
83
- this.line = new E(n, t), this.backLine = new E(n, i), this.line.renderOrder = 1, this.backLine.renderOrder = 0, this.line.name = "lineFrontMaterial", this.backLine.name = "lineBackMaterial", e && this.setStyle(e), e != null && e.points && this.setPoints(e.points), this.addEventListener("removed", () => {
83
+ this.line = new T(n, t), this.backLine = new T(n, i), this.line.renderOrder = 1, this.backLine.renderOrder = 0, this.line.name = "lineFrontMaterial", this.backLine.name = "lineBackMaterial", e && this.setStyle(e), e != null && e.points && this.setPoints(e.points), this.addEventListener("removed", () => {
84
84
  v(this);
85
85
  });
86
86
  }
@@ -111,11 +111,13 @@ class J extends I {
111
111
  }
112
112
  setPoints(e) {
113
113
  const n = e.map(C).filter(c);
114
- if (this.points = n, n.length < 2)
114
+ if (this.points = n, n.length < 2) {
115
+ this.line.geometry = new L(), this.backLine.geometry = this.line.geometry, this.updateLengthItems();
115
116
  return;
117
+ }
116
118
  this.addIfNotExists(this.line, this.backLine);
117
119
  const t = n.flatMap((i) => [i.x, i.y, i.z]);
118
- t.length > 2 && (this.line.geometry.dispose(), this.line.geometry = new D(), this.backLine.geometry = this.line.geometry), this.line.geometry.setPositions(t), this.line.computeLineDistances(), this.updateLengthItems(), this.needsRender = !0;
120
+ t.length > 2 && (this.line.geometry.dispose(), this.line.geometry = new L(), this.backLine.geometry = this.line.geometry), this.line.geometry.setPositions(t), this.line.computeLineDistances(), this.updateLengthItems(), this.needsRender = !0;
119
121
  }
120
122
  setResolution(e, n) {
121
123
  const t = this.line.material.resolution;
@@ -124,28 +126,28 @@ class J extends I {
124
126
  (i.x !== e || i.y !== n) && (i.set(e, n), this.needsRender = !0);
125
127
  }
126
128
  setStyle(e) {
127
- var i, s, r;
129
+ var i, l, r;
128
130
  this.paramsStyle = y(y({}, this.paramsStyle), e), c(e.lineColor) && (this.line.material.three_color = new a.Color(e.lineColor), this.backLine.material.three_color = new a.Color(e.lineColor)), c(e.lineWidth) && (this.line.material.linewidth = e.lineWidth), c(e.dashed) && this.line.material.setDashed(e.dashed), c(e.opacity) && (this.line.material.opacity = e.opacity, this.backLine.material.opacity = this.line.material.opacity * 0.2), this.updateLengthItems();
129
- const n = (i = e.occlusionVisibility) != null ? i : this.paramsStyle.occlusionVisibility, t = (r = (s = e.occlusionMode) != null ? s : this.paramsStyle.occlusionMode) != null ? r : "translucence";
131
+ const n = (i = e.occlusionVisibility) != null ? i : this.paramsStyle.occlusionVisibility, t = (r = (l = e.occlusionMode) != null ? l : this.paramsStyle.occlusionMode) != null ? r : "translucence";
130
132
  n ? t === "depthTest" ? (this.line.material.depthTest = !1, this.backLine.visible = !1) : t === "translucence" && (this.line.material.depthTest = !0, this.backLine.visible = !0, this.line.material.opacity === 1 ? this.backLine.material.setDashed(!0) : this.backLine.material.setDashed(this.line.material.dashed)) : (this.line.material.depthTest = !0, this.backLine.visible = !1), this.needsRender = !0;
131
133
  }
132
134
  highlight() {
133
- this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.line.material.opacity, this.line.material.opacity = this.opacityBeforeHighlight * m, this.backLine.material.opacity = this.backLine.material.opacity * m, this.needsRender = !0);
135
+ this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.line.material.opacity, this.line.material.opacity = this.opacityBeforeHighlight * D, this.backLine.material.opacity = this.backLine.material.opacity * D, this.needsRender = !0);
134
136
  }
135
137
  unhighlight() {
136
138
  this.highlighted && (this.highlighted = !1, this.line.material.opacity = this.opacityBeforeHighlight, this.backLine.material.opacity = 0.2, this.needsRender = !0);
137
139
  }
138
140
  updateLengthItems() {
139
141
  var e, n;
140
- if (this.paramsStyle.lengthEnable) {
141
- const t = (n = (e = this.points) == null ? void 0 : e.map((i, s) => {
142
- if (s !== 0)
143
- return [this.points[s - 1], i];
142
+ if (this.points.length < 2 && (this.lengthDoms.forEach((t) => t.destroy()), this.lengthDoms = []), this.paramsStyle.lengthEnable) {
143
+ const t = (n = (e = this.points) == null ? void 0 : e.map((i, l) => {
144
+ if (l !== 0)
145
+ return [this.points[l - 1], i];
144
146
  }).filter(c)) != null ? n : [];
145
- t.forEach(([i, s], r) => {
147
+ t.forEach(([i, l], r) => {
146
148
  var d;
147
- const u = R(i, s), g = i.distanceTo(s).toFixed(2) + "m";
148
- this.lengthDoms[r] = (d = this.lengthDoms[r]) != null ? d : new x(p.five), this.lengthDoms[r].setPosition(u), this.lengthDoms[r].container.innerHTML = `<div style="pointer-events:none;color:white;">${g}</div>`;
149
+ const g = p(i, l), u = i.distanceTo(l).toFixed(2) + "m";
150
+ this.lengthDoms[r] = (d = this.lengthDoms[r]) != null ? d : new R(x.five), this.lengthDoms[r].setPosition(g), this.lengthDoms[r].container.innerHTML = `<div style="pointer-events:none;color:white;">${u}</div>`;
149
151
  }), this.lengthDoms.length > t.length && (this.lengthDoms.slice(t.length).forEach((i) => i.destroy()), this.lengthDoms.length = t.length);
150
152
  } else
151
153
  this.lengthDoms.forEach((t) => t.destroy()), this.lengthDoms = [];
@@ -1,55 +1,55 @@
1
- var j = Object.defineProperty, O = Object.defineProperties;
2
- var T = Object.getOwnPropertyDescriptors;
3
- var b = Object.getOwnPropertySymbols;
4
- var V = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
5
- var y = (i, t, e) => t in i ? j(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, u = (i, t) => {
1
+ var W = Object.defineProperty, j = Object.defineProperties;
2
+ var O = Object.getOwnPropertyDescriptors;
3
+ var C = Object.getOwnPropertySymbols;
4
+ var A = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
5
+ var u = (i, t, e) => t in i ? W(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, P = (i, t) => {
6
6
  for (var e in t || (t = {}))
7
- V.call(t, e) && y(i, e, t[e]);
8
- if (b)
9
- for (var e of b(t))
10
- A.call(t, e) && y(i, e, t[e]);
7
+ A.call(t, e) && u(i, e, t[e]);
8
+ if (C)
9
+ for (var e of C(t))
10
+ D.call(t, e) && u(i, e, t[e]);
11
11
  return i;
12
- }, C = (i, t) => O(i, T(t));
13
- var P = (i, t, e) => (y(i, typeof t != "symbol" ? t + "" : t, e), e);
14
- var W = (i, t, e) => new Promise((n, a) => {
15
- var h = (o) => {
12
+ }, y = (i, t) => j(i, O(t));
13
+ var L = (i, t, e) => (u(i, typeof t != "symbol" ? t + "" : t, e), e);
14
+ var x = (i, t, e) => new Promise((s, c) => {
15
+ var a = (h) => {
16
16
  try {
17
- d(e.next(o));
17
+ m(e.next(h));
18
18
  } catch (p) {
19
- a(p);
19
+ c(p);
20
20
  }
21
- }, f = (o) => {
21
+ }, d = (h) => {
22
22
  try {
23
- d(e.throw(o));
23
+ m(e.throw(h));
24
24
  } catch (p) {
25
- a(p);
25
+ c(p);
26
26
  }
27
- }, d = (o) => o.done ? n(o.value) : Promise.resolve(o.value).then(h, f);
28
- d((e = e.apply(i, t)).next());
27
+ }, m = (h) => h.done ? s(h.value) : Promise.resolve(h.value).then(a, d);
28
+ m((e = e.apply(i, t)).next());
29
29
  });
30
- import { hotkeys as D } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
31
- import { LineMesh as x } from "../../Meshes/Line.js";
32
- import { BaseObject as U } from "../Base/index.js";
33
- import * as m from "three";
34
- import { LineEditor as k } from "./Editor.js";
35
- import { vector3ToArray as z } from "../../../shared-utils/three/vector3ToArray.js";
36
- import { LineWithDotsMesh as E } from "../../Meshes/LineWithDots.js";
37
- import { rayOnLine as B } from "../../utils/three/rayOnLine.js";
38
- const F = new m.Vector3();
39
- class Q extends U {
40
- constructor(e, n) {
41
- super(e, n);
42
- P(this, "type", "Line");
43
- P(this, "lineMesh");
44
- e && (this.lineMesh = new E(u(u({}, e.style), e)), this.add(this.lineMesh)), this.editor = new k(this), D("esc", () => {
30
+ import { hotkeys as U } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
31
+ import { LineMesh as E } from "../../Meshes/Line.js";
32
+ import { BaseObject as k } from "../Base/index.js";
33
+ import * as r from "three";
34
+ import { LineEditor as z } from "./Editor.js";
35
+ import { vector3ToArray as B } from "../../../shared-utils/three/vector3ToArray.js";
36
+ import { LineWithDotsMesh as V } from "../../Meshes/LineWithDots.js";
37
+ import { rayOnLine as F } from "../../utils/three/rayOnLine.js";
38
+ const T = new r.Vector3();
39
+ class X extends k {
40
+ constructor(e, s) {
41
+ super(e, s);
42
+ L(this, "type", "Line");
43
+ L(this, "lineMesh");
44
+ e && (this.lineMesh = new V(P(P({}, e.style), e)), this.add(this.lineMesh)), this.editor = new z(this), U("esc", () => {
45
45
  this.stopCreating();
46
46
  });
47
47
  }
48
48
  get data() {
49
- return C(u({}, this.baseData), {
50
- points: z(this.applyObjectMatrixWorld(this.lineMesh.points)),
49
+ return y(P({}, this.baseData), {
50
+ points: B(this.applyObjectMatrixWorld(this.lineMesh.points)),
51
51
  style: {
52
- lineColor: new m.Color(this.lineMesh.color).getHex(),
52
+ lineColor: new r.Color(this.lineMesh.color).getHex(),
53
53
  lineWidth: this.lineMesh.lineWidth,
54
54
  dashed: this.lineMesh.dashed
55
55
  }
@@ -64,44 +64,44 @@ class Q extends U {
64
64
  (e = this.lineMesh) == null || e.unhighlight();
65
65
  }
66
66
  create(e) {
67
- return W(this, null, function* () {
67
+ return x(this, null, function* () {
68
68
  this.removeChildren();
69
- const n = new E(e);
70
- this.lineMesh = n, this.add(this.lineMesh), yield H(n, this.pointSelector, e), this.editor.enable();
69
+ const s = new V(e);
70
+ this.lineMesh = s, this.add(this.lineMesh), yield H(s, this.pointSelector, e), this.editor.enable();
71
71
  });
72
72
  }
73
73
  }
74
74
  function H(i, t, e) {
75
- var d;
76
- const n = i.parent;
77
- if (!n)
75
+ var m;
76
+ const s = i.parent;
77
+ if (!s)
78
78
  return;
79
- const a = (d = e == null ? void 0 : e.limit) != null ? d : "none", h = new x(i.style);
80
- n.add(h);
81
- const f = new x({ dashed: !0, lineColor: i.color, lineWidth: i.lineWidth });
82
- return n.add(f), t.enable(), new Promise((o, p) => {
83
- const s = [];
84
- let r, c;
79
+ const c = (m = e == null ? void 0 : e.limit) != null ? m : "none", a = new E(i.style);
80
+ s.add(a);
81
+ const d = new E(y(P({}, i.style), { dashed: !0 }));
82
+ return s.add(d), t.enable(), new Promise((h, p) => {
83
+ const n = [];
84
+ let o, f;
85
85
  const g = (l) => {
86
- const w = s.length === 0 ? l.point : r.clone();
87
- s.push(w), i.setPoints(s), s.length === 2 && (M(), o());
88
- }, L = (l) => {
89
- if (!(s != null && s.length) || !l)
86
+ const w = n.length === 0 ? l.point : o.clone();
87
+ n.push(w), i.setPoints(n), n.length === 2 && (v(), h());
88
+ }, M = (l) => {
89
+ if (!(n != null && n.length) || !l)
90
90
  return;
91
- const w = s.at(-1).clone();
92
- a === "none" ? (r = l.point, h.setPoints([w, r])) : a === "xoz" ? (t.plane = c, c = c != null ? c : new m.Plane().setFromNormalAndCoplanarPoint(new m.Vector3(0, 1, 0), s[0]), r = c.projectPoint(l.point, F), h.setPoints([w, r]), f.setPoints([r, l.point])) : a === "y" && (r = B({
91
+ const w = n.at(-1).clone();
92
+ c === "none" ? (o = l.point, a.setPoints([w, o])) : c === "xoz" ? (t.plane = f, f = f != null ? f : new r.Plane().setFromNormalAndCoplanarPoint(new r.Vector3(0, 1, 0), n[0]), o = f.projectPoint(l.point, T), a.setPoints([w, o]), d.setPoints([o, l.point])) : c === "y" && (l.isVirtual ? (o = F({
93
93
  raycaster: l.raycaster,
94
- line: new m.Line3(s[0].clone(), new m.Vector3(0, 1, 0).add(s[0])),
94
+ line: new r.Line3(n[0].clone(), new r.Vector3(0, 1, 0).add(n[0])),
95
95
  clampToLine: !1
96
- }), h.setPoints([w, r]));
97
- }, M = () => {
98
- t.off("select", g), t.off("intersectionUpdate", L), t.off("disable", v), t.plane = null, t.disable(), n == null || n.remove(h, f);
96
+ }), d.setPoints([])) : (o = new r.Line3(n[0].clone(), new r.Vector3(0, 1, 0).add(n[0])).closestPointToPoint(l.point, !1, T), d.setPoints([o, l.point])), a.setPoints([w, o]));
99
97
  }, v = () => {
100
- M(), s.length !== 2 && (n == null || n.remove(i)), p(new Error("Cancelled"));
98
+ t.off("select", g), t.off("intersectionUpdate", M), t.off("disable", b), t.plane = null, t.disable(), s == null || s.remove(a, d);
99
+ }, b = () => {
100
+ v(), n.length !== 2 && (s == null || s.remove(i)), p(new Error("Cancelled"));
101
101
  };
102
- t.on("select", g), t.on("intersectionUpdate", L), t.on("disable", v);
102
+ t.on("select", g), t.on("intersectionUpdate", M), t.on("disable", b);
103
103
  });
104
104
  }
105
105
  export {
106
- Q as Line
106
+ X as Line
107
107
  };
@@ -17,7 +17,7 @@ let x = class {
17
17
  /**
18
18
  * @realsee/dnalogel 版本号
19
19
  */
20
- i(this, "VERSION", "3.47.1");
20
+ i(this, "VERSION", "3.47.3");
21
21
  i(this, "NAME");
22
22
  i(this, "five");
23
23
  i(this, "workUtil");
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.47.1",
3
+ "%c %c@realsee/dnalogel %cv3.47.3",
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",
@@ -3,8 +3,9 @@ import { PointSelectorHelper, type PointIntersection, type PointSelectorHelperCo
3
3
  import { type Vector3 } from 'three';
4
4
  import * as THREE from 'three';
5
5
  import { Subscribe } from '../../Subscribe';
6
+ import type { LiteralString } from '../../../typings/utils.type';
6
7
  export type { PointIntersection };
7
- type ActionIfNoModelUnderMouse = 'virtualPoint' | 'lastPoint' | 'disable';
8
+ export type ActionIfNoModelUnderMouse = LiteralString<'virtualPoint' | 'lastPoint' | 'disable'>;
8
9
  interface Config {
9
10
  /**
10
11
  * @description: 选点的两种模式, 'fixed' 为固定选点为屏幕中心点,拖动five画布来更新点,'cursor' 为跟随鼠标移动来更新点, 'auto' 则根据设备类型自动选择
@@ -2,15 +2,15 @@ var v = Object.defineProperty, E = Object.defineProperties;
2
2
  var w = Object.getOwnPropertyDescriptors;
3
3
  var f = Object.getOwnPropertySymbols;
4
4
  var S = Object.prototype.hasOwnProperty, y = Object.prototype.propertyIsEnumerable;
5
- var p = (n, s, e) => s in n ? v(n, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[s] = e, l = (n, s) => {
5
+ var p = (o, s, e) => s in o ? v(o, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[s] = e, l = (o, s) => {
6
6
  for (var e in s || (s = {}))
7
- S.call(s, e) && p(n, e, s[e]);
7
+ S.call(s, e) && p(o, e, s[e]);
8
8
  if (f)
9
9
  for (var e of f(s))
10
- y.call(s, e) && p(n, e, s[e]);
11
- return n;
12
- }, m = (n, s) => E(n, w(s));
13
- var i = (n, s, e) => (p(n, typeof s != "symbol" ? s + "" : s, e), e);
10
+ y.call(s, e) && p(o, e, s[e]);
11
+ return o;
12
+ }, m = (o, s) => E(o, w(s));
13
+ var i = (o, s, e) => (p(o, typeof s != "symbol" ? s + "" : s, e), e);
14
14
  import { PointSelectorHelper as I } from "./utils/PointSelectorHelper.js";
15
15
  import { isTouchDevice as b } from "../../isTouchDevice.js";
16
16
  import C from "hammerjs";
@@ -19,9 +19,9 @@ import { Subscribe as H } from "../../Subscribe.js";
19
19
  import { getIntersectByRaycaster as F, getVirtualIntersectByRaycaster as M } from "../../five/getPosition.js";
20
20
  import { getRaycasterByNdcPosition as N } from "../../five/getRaycasterByNdcPosition.js";
21
21
  const x = new u.Vector3(), d = () => !1;
22
- class V extends H {
22
+ class R extends H {
23
23
  constructor(e, t) {
24
- var a, o, c;
24
+ var h, n, c;
25
25
  super();
26
26
  /**
27
27
  * @description: 不在 five canvas 上时为 true
@@ -108,16 +108,16 @@ class V extends H {
108
108
  * @description: 根据鼠标位置计算焦点位置并更新
109
109
  */
110
110
  i(this, "updateByNdcPosition", (e) => {
111
- var h, a;
111
+ var a, h;
112
112
  const t = N(this.five, e), r = F(this.five, t);
113
113
  if (r)
114
114
  return this.updatePointSelectorHelperIntersect(r), this.lastIntersection = r, !0;
115
115
  if (this.plane) {
116
- const o = t.ray.intersectPlane(this.plane, x);
117
- if (o) {
116
+ const n = t.ray.intersectPlane(this.plane, x);
117
+ if (n) {
118
118
  const c = {
119
- distance: this.five.camera.position.distanceTo(o),
120
- point: o.clone(),
119
+ distance: this.five.camera.position.distanceTo(n),
120
+ point: n.clone(),
121
121
  object: new u.Object3D(),
122
122
  face: new u.Face3(0, 0, 0, this.plane.normal.clone()),
123
123
  raycaster: t,
@@ -129,8 +129,8 @@ class V extends H {
129
129
  if (this.actionIfNoModelUnderMouse === "lastPoint")
130
130
  return this.updatePointSelectorHelperIntersect(this.lastIntersection), !0;
131
131
  if (this.actionIfNoModelUnderMouse === "virtualPoint") {
132
- const o = M(t, (h = this.lastIntersection) == null ? void 0 : h.distance);
133
- return o.face = new u.Face3(0, 0, 0, (a = this.lastIntersection) == null ? void 0 : a.face.normal), this.lastIntersection = o, this.updatePointSelectorHelperIntersect(o), !0;
132
+ const n = M(t, (a = this.lastIntersection) == null ? void 0 : a.distance);
133
+ return n.face = new u.Face3(0, 0, 0, (h = this.lastIntersection) == null ? void 0 : h.face.normal), n.isVirtual = !0, this.lastIntersection = n, this.updatePointSelectorHelperIntersect(n), !0;
134
134
  } else if (this.actionIfNoModelUnderMouse === "disable")
135
135
  return this.updatePointSelectorHelperIntersect(null), !1;
136
136
  });
@@ -146,9 +146,9 @@ class V extends H {
146
146
  const t = l({}, e);
147
147
  let r = !1;
148
148
  if (typeof this.adherePoints == "function" && typeof this.adherePointsRadius == "number") {
149
- for (const h of this.adherePoints({ intersection: e, pointSelectorInstance: this }))
150
- if (h.distanceTo(e.point) < this.adherePointsRadius) {
151
- t.point = h.clone(), r = !0;
149
+ for (const a of this.adherePoints({ intersection: e, pointSelectorInstance: this }))
150
+ if (a.distanceTo(e.point) < this.adherePointsRadius) {
151
+ t.point = a.clone(), r = !0;
152
152
  break;
153
153
  }
154
154
  }
@@ -158,10 +158,10 @@ class V extends H {
158
158
  const t = this.five.getElement();
159
159
  if (!t)
160
160
  return null;
161
- const { top: r, left: h, width: a, height: o } = t.getBoundingClientRect(), { clientX: c, clientY: P } = e;
161
+ const { top: r, left: a, width: h, height: n } = t.getBoundingClientRect(), { clientX: c, clientY: P } = e;
162
162
  return {
163
- x: (c - h) / a,
164
- y: 1 - (P - r) / o
163
+ x: (c - a) / h,
164
+ y: 1 - (P - r) / n
165
165
  };
166
166
  });
167
167
  i(this, "onFiveWantsPanGesture", () => {
@@ -174,15 +174,15 @@ class V extends H {
174
174
  i(this, "emitIntersectionUpdate", (e) => {
175
175
  this.emit("intersectionUpdate", e);
176
176
  });
177
- this.five = e, this.config = l(l({}, this.config), t), this.actionIfNoModelUnderMouse = (a = t == null ? void 0 : t.actionIfNoModelUnderMouse) != null ? a : "virtualPoint";
178
- const r = (o = t == null ? void 0 : t.mode) != null ? o : "auto";
177
+ this.five = e, this.config = l(l({}, this.config), t), this.actionIfNoModelUnderMouse = (h = t == null ? void 0 : t.actionIfNoModelUnderMouse) != null ? h : "virtualPoint";
178
+ const r = (n = t == null ? void 0 : t.mode) != null ? n : "auto";
179
179
  r === "auto" ? this.mode = b ? "fixed" : "cursor" : this.mode = r;
180
- const h = {
180
+ const a = {
181
181
  autoFixPCPosition: this.mode === "cursor",
182
182
  initialPosition: this.mode === "fixed" ? { left: "35%", top: "20%" } : void 0
183
183
  };
184
184
  this.pointSelectorHelper = new I(this.five, m(l({}, t == null ? void 0 : t.helper), {
185
- magnifierParams: l(l({}, h), (c = t == null ? void 0 : t.helper) == null ? void 0 : c.magnifierParams)
185
+ magnifierParams: l(l({}, a), (c = t == null ? void 0 : t.helper) == null ? void 0 : c.magnifierParams)
186
186
  })), this.pointSelectorHelper.hide();
187
187
  }
188
188
  get position() {
@@ -215,5 +215,5 @@ class V extends H {
215
215
  }
216
216
  }
217
217
  export {
218
- V as PointSelector
218
+ R as PointSelector
219
219
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/dnalogel",
3
- "version": "3.47.1",
3
+ "version": "3.47.3",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "devDependencies": {
44
44
  "@babel/core": "^7.22.9",
45
- "@realsee/five": "6.1.2",
45
+ "@realsee/five": "6.1.3",
46
46
  "@sveltejs/vite-plugin-svelte": "^2.4.2",
47
47
  "@tsconfig/svelte": "^4.0.1",
48
48
  "@tweenjs/tween.js": "^23.1.1",