@realsee/dnalogel 3.49.9 → 3.49.11

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.
@@ -1,46 +1,46 @@
1
- var y = Object.defineProperty, b = Object.defineProperties;
2
- var u = Object.getOwnPropertyDescriptors;
1
+ var g = Object.defineProperty, u = Object.defineProperties;
2
+ var y = Object.getOwnPropertyDescriptors;
3
3
  var d = Object.getOwnPropertySymbols;
4
- var w = Object.prototype.hasOwnProperty, P = Object.prototype.propertyIsEnumerable;
5
- var a = (e, i, t) => i in e ? y(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, n = (e, i) => {
4
+ var P = Object.prototype.hasOwnProperty, w = Object.prototype.propertyIsEnumerable;
5
+ var p = (e, i, t) => i in e ? g(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, a = (e, i) => {
6
6
  for (var t in i || (i = {}))
7
- w.call(i, t) && a(e, t, i[t]);
7
+ P.call(i, t) && p(e, t, i[t]);
8
8
  if (d)
9
9
  for (var t of d(i))
10
- P.call(i, t) && a(e, t, i[t]);
10
+ w.call(i, t) && p(e, t, i[t]);
11
11
  return e;
12
- }, g = (e, i) => b(e, u(i));
13
- var M = (e, i, t) => (a(e, typeof i != "symbol" ? i + "" : i, t), t);
14
- var m = (e, i, t) => new Promise((o, h) => {
12
+ }, m = (e, i) => u(e, y(i));
13
+ var c = (e, i, t) => (p(e, typeof i != "symbol" ? i + "" : i, t), t);
14
+ var b = (e, i, t) => new Promise((h, n) => {
15
15
  var r = (s) => {
16
16
  try {
17
- l(t.next(s));
18
- } catch (c) {
19
- h(c);
17
+ o(t.next(s));
18
+ } catch (l) {
19
+ n(l);
20
20
  }
21
- }, p = (s) => {
21
+ }, f = (s) => {
22
22
  try {
23
- l(t.throw(s));
24
- } catch (c) {
25
- h(c);
23
+ o(t.throw(s));
24
+ } catch (l) {
25
+ n(l);
26
26
  }
27
- }, l = (s) => s.done ? o(s.value) : Promise.resolve(s.value).then(r, p);
28
- l((t = t.apply(e, i)).next());
27
+ }, o = (s) => s.done ? h(s.value) : Promise.resolve(s.value).then(r, f);
28
+ o((t = t.apply(e, i)).next());
29
29
  });
30
- import { PointMesh as f } from "../../Meshes/Point.js";
31
- import { BaseObject as x } from "../Base/index.js";
32
- import { PointEditor as j } from "./Editor.js";
33
- import { vector3ToArray as v } from "../../../shared-utils/three/vector3ToArray.js";
34
- class D extends x {
35
- constructor(t, o) {
36
- super(t, o);
37
- M(this, "type", "Point");
38
- M(this, "pointMesh");
39
- this.editor = new j(this), t && (this.pointMesh = new f(n(n({}, t.style), t)), this.add(this.pointMesh));
30
+ import { PointMesh as M } from "../../Meshes/Point.js";
31
+ import { BaseObject as v } from "../Base/index.js";
32
+ import { PointEditor as x } from "./Editor.js";
33
+ import { vector3ToArray as E } from "../../../shared-utils/three/vector3ToArray.js";
34
+ class C extends v {
35
+ constructor(t, h) {
36
+ super(t, h);
37
+ c(this, "type", "Point");
38
+ c(this, "pointMesh");
39
+ this.editor = new x(this), t && (this.pointMesh = new M(a(a({}, t.style), t)), this.add(this.pointMesh));
40
40
  }
41
41
  get data() {
42
- return g(n({}, this.baseData), {
43
- point: v(this.applyObjectMatrixWorld(this.pointMesh.position)),
42
+ return m(a({}, this.baseData), {
43
+ point: E(this.applyObjectMatrixWorld(this.pointMesh.position)),
44
44
  style: {
45
45
  color: this.pointMesh.color.getHex(),
46
46
  size: this.pointMesh.size
@@ -67,24 +67,27 @@ class D extends x {
67
67
  * @description: 创建点
68
68
  */
69
69
  create(t) {
70
- return m(this, null, function* () {
71
- this.pointMesh && this.remove(this.pointMesh), this.add(this.pointMesh = new f(t)), yield z(this.pointMesh, this.pointSelector), this.editor.enable();
70
+ return b(this, null, function* () {
71
+ this.pointMesh && this.remove(this.pointMesh), this.add(this.pointMesh = new M(t)), yield U(this.pointMesh, this.pointSelector), this.editor.enable();
72
72
  });
73
73
  }
74
74
  }
75
- function z(e, i) {
76
- return new Promise((t, o) => {
77
- i.enable();
78
- const h = (r) => {
79
- const { point: p } = r;
80
- e.position.copy(p), t(), i.disable();
75
+ function U(e, i) {
76
+ return new Promise((t, h) => {
77
+ i.enable(), e.visible = !1;
78
+ const n = (s) => {
79
+ s && (e.visible = !0, e.position.copy(s.point));
80
+ }, r = (s) => {
81
+ s && (e.position.copy(s.point), f());
82
+ }, f = () => {
83
+ i.off("select", r), i.off("disable", o), i.off("intersectionUpdate", n), i.disable(), t();
84
+ }, o = () => {
85
+ i.off("select", r), i.off("disable", o), i.off("intersectionUpdate", n), e.removeFromParent(), h(new Error("Cancelled"));
81
86
  };
82
- i.on("disable", () => {
83
- i.off("select", h), o(new Error("Cancelled"));
84
- }), i.once("select", h);
87
+ i.on("intersectionUpdate", n), i.on("disable", o), i.once("select", r);
85
88
  });
86
89
  }
87
90
  export {
88
- D as Point,
89
- z as createPoint
91
+ C as Point,
92
+ U as createPoint
90
93
  };
@@ -76,7 +76,7 @@ const h = class extends S {
76
76
  this.five = e, this.theme = t, this.group = new k(), this.group.name = "Sculpt", e.scene.add(this.group), h.modules.init(e), B("ctrl+z", this.undo), B("ctrl+shift+z", this.redo), h.modules.fiveDomEvents.addEventListener(this.group, "click", ({ intersects: n, origDomEvent: l }) => {
77
77
  var s;
78
78
  const o = M((s = n == null ? void 0 : n[0]) == null ? void 0 : s.object, (c) => c.isSculptObject);
79
- return o ? this.emit("click", l, o) : !1;
79
+ return o && !o.editing ? this.emit("click", l, o) : !1;
80
80
  }), window.__SCULPT_DEBUG__ = this, window.__SCULPT_MODULES_DEBUG__ = h.modules;
81
81
  }
82
82
  get data() {
@@ -57,4 +57,10 @@ export type OcclusionStyle = {
57
57
  */
58
58
  occlusionMode: 'translucence' | 'depthTest';
59
59
  };
60
+ export type lengthConfig = {
61
+ lengthEnable: boolean;
62
+ };
63
+ export type DisplayInfoConfig = {
64
+ tip: string;
65
+ };
60
66
  export type LineStyle = LineColorStyle & LineWidthStyle & OpacityStyle;
@@ -18,7 +18,7 @@ let P = class {
18
18
  /**
19
19
  * @realsee/dnalogel 版本号
20
20
  */
21
- i(this, "VERSION", "3.49.9");
21
+ i(this, "VERSION", "3.49.11");
22
22
  i(this, "NAME");
23
23
  i(this, "five");
24
24
  i(this, "workUtil");
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.49.9",
3
+ "%c %c@realsee/dnalogel %cv3.49.11",
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",
@@ -107,7 +107,7 @@ export declare class PointSelector extends Subscribe<EventMap> {
107
107
  * @description: 鼠标离开five canvas时
108
108
  */
109
109
  private onLeave;
110
- private onTap;
110
+ private onClick;
111
111
  /**
112
112
  * 1. 如果之前没有长按行为「即没有长按点时」-> 滑动全景
113
113
  * 2. 如果有长按点,把长按点位置更新为当前位置
@@ -16,11 +16,11 @@ import { isTouchDevice as v } from "../../isTouchDevice.js";
16
16
  import M from "hammerjs";
17
17
  import * as d from "three";
18
18
  import { Subscribe as N } from "../../Subscribe.js";
19
- import { getIntersectByRaycaster as F, getVirtualIntersectByRaycaster as U } from "../../five/getPosition.js";
20
- import { getRaycasterByNdcPosition as T } from "../../five/getRaycasterByNdcPosition.js";
19
+ import { getIntersectByRaycaster as F, getVirtualIntersectByRaycaster as L } from "../../five/getPosition.js";
20
+ import { getRaycasterByNdcPosition as U } from "../../five/getRaycasterByNdcPosition.js";
21
21
  import { CURSOR_NOT_ALLOW_URL as P } from "./utils/contents.js";
22
- const L = new d.Vector3(), u = () => !1;
23
- class G extends N {
22
+ const C = new d.Vector3(), u = () => !1;
23
+ class k extends N {
24
24
  constructor(e, t) {
25
25
  var a, o, c;
26
26
  super();
@@ -73,11 +73,8 @@ class G extends N {
73
73
  i(this, "onLeave", () => {
74
74
  this.pointSelectorHelper.hide(), this.outOfFive = !0, this.emit("intersectionUpdate", null);
75
75
  });
76
- i(this, "onTap", (e) => {
77
- e != null && e.center && (this.mousePosition = {
78
- clientX: e.center.x,
79
- clientY: e.center.y
80
- }), this.select();
76
+ i(this, "onClick", () => {
77
+ this.select();
81
78
  });
82
79
  /**
83
80
  * 1. 如果之前没有长按行为「即没有长按点时」-> 滑动全景
@@ -117,11 +114,11 @@ class G extends N {
117
114
  */
118
115
  i(this, "updateByNdcPosition", (e) => {
119
116
  var h, a;
120
- const t = T(this.five, e), r = F(this.five, t);
117
+ const t = U(this.five, e), r = F(this.five, t);
121
118
  if (r)
122
119
  return this.updatePointSelectorHelperIntersect(r), this.lastIntersection = r, !0;
123
120
  if (this.plane) {
124
- const o = t.ray.intersectPlane(this.plane, L);
121
+ const o = t.ray.intersectPlane(this.plane, C);
125
122
  if (o) {
126
123
  const c = {
127
124
  distance: this.five.camera.position.distanceTo(o),
@@ -137,7 +134,7 @@ class G extends N {
137
134
  if (this.actionIfNoModelUnderMouse === "lastPoint")
138
135
  return this.updatePointSelectorHelperIntersect(this.lastIntersection), !0;
139
136
  if (this.actionIfNoModelUnderMouse === "virtualPoint") {
140
- const o = U(t, (h = this.lastIntersection) == null ? void 0 : h.distance);
137
+ const o = L(t, (h = this.lastIntersection) == null ? void 0 : h.distance);
141
138
  return o.face = new d.Face3(0, 0, 0, (a = this.lastIntersection) == null ? void 0 : a.face.normal), o.isVirtual = !0, this.lastIntersection = o, this.updatePointSelectorHelperIntersect(o), !0;
142
139
  } else if (this.actionIfNoModelUnderMouse === "disable")
143
140
  return this.updatePointSelectorHelperIntersect(null), !1;
@@ -227,14 +224,14 @@ class G extends N {
227
224
  const e = this.five.getElement();
228
225
  if (!e)
229
226
  throw new Error("five element not found");
230
- this.hammer || (this.hammer = new M(e)), this.mode === "cursor" ? (this.five.on("wantsMoveToPano", u), this.five.on("wantsChangeMode", u), this.five.on("wantsTapGesture", u), e.addEventListener("mousemove", this.updateByMousePosition), v || e.addEventListener("wheel", this.onMouseWheel), e.addEventListener("mouseenter", this.onEnter), e.addEventListener("mouseout", this.onLeave), this.five.on("wantsPanGesture", this.onFiveWantsPanGesture), this.hammer.on("tap", this.onTap), this.hammer.on("pan", this.onPan), this.hammer.on("press", this.onPress), this.hammer.on("panend", this.onPanEnd)) : this.mode === "fixed" && (this.five.on("panoArrived", this.renderScreenCenter), this.five.on("panGesture", this.renderScreenCenter), this.five.on("interiaPan", this.renderScreenCenter), this.renderScreenCenter(), this.pointSelectorHelper.show()), this.pointSelectorHelper.hooks.on("intersectionUpdate", this.emitIntersectionUpdate), this.lastFiveHelperVisible = this.five.helperVisible, this.five.helperVisible = !1, this.emit("enable");
227
+ this.hammer || (this.hammer = new M(e)), this.mode === "cursor" ? (this.five.on("wantsMoveToPano", u), this.five.on("wantsChangeMode", u), this.five.on("wantsTapGesture", u), e.addEventListener("mousemove", this.updateByMousePosition), v || e.addEventListener("wheel", this.onMouseWheel), e.addEventListener("click", this.onClick), e.addEventListener("mouseenter", this.onEnter), e.addEventListener("mouseout", this.onLeave), this.five.on("wantsPanGesture", this.onFiveWantsPanGesture), this.hammer.on("pan", this.onPan), this.hammer.on("press", this.onPress), this.hammer.on("panend", this.onPanEnd)) : this.mode === "fixed" && (this.five.on("panoArrived", this.renderScreenCenter), this.five.on("panGesture", this.renderScreenCenter), this.five.on("interiaPan", this.renderScreenCenter), this.renderScreenCenter(), this.pointSelectorHelper.show()), this.pointSelectorHelper.hooks.on("intersectionUpdate", this.emitIntersectionUpdate), this.lastFiveHelperVisible = this.five.helperVisible, this.five.helperVisible = !1, this.emit("enable");
231
228
  }
232
229
  disable() {
233
230
  if (!this.enabled)
234
231
  return;
235
232
  this.enabled = !1, this.pointSelectorHelper.disable(), this.five.getElement().style.cursor = "";
236
233
  const e = this.five.getElement();
237
- this.five.off("wantsPanGesture", this.onFiveWantsPanGesture), this.five.off("wantsMoveToPano", u), this.five.off("wantsChangeMode", u), this.five.off("wantsTapGesture", u), this.five.helperVisible = this.lastFiveHelperVisible, e == null || e.removeEventListener("mousemove", this.updateByMousePosition), e == null || e.removeEventListener("wheel", this.onMouseWheel), e == null || e.removeEventListener("mouseenter", this.onEnter), e == null || e.removeEventListener("mouseout", this.onLeave), this.hammer.off("tap", this.onTap), this.hammer.off("pan", this.onPan), this.hammer.off("press", this.onPress), this.hammer.off("panend", this.onPanEnd), this.five.off("panoArrived", this.renderScreenCenter), this.five.off("panGesture", this.renderScreenCenter), this.five.off("interiaPan", this.renderScreenCenter), this.pointSelectorHelper.hooks.off("intersectionUpdate", this.emitIntersectionUpdate), this.emit("disable");
234
+ this.five.off("wantsPanGesture", this.onFiveWantsPanGesture), this.five.off("wantsMoveToPano", u), this.five.off("wantsChangeMode", u), this.five.off("wantsTapGesture", u), this.five.helperVisible = this.lastFiveHelperVisible, e == null || e.removeEventListener("mousemove", this.updateByMousePosition), e == null || e.removeEventListener("wheel", this.onMouseWheel), e == null || e.removeEventListener("mouseenter", this.onEnter), e == null || e.removeEventListener("mouseout", this.onLeave), e == null || e.removeEventListener("click", this.onClick), this.hammer.off("pan", this.onPan), this.hammer.off("press", this.onPress), this.hammer.off("panend", this.onPanEnd), this.five.off("panoArrived", this.renderScreenCenter), this.five.off("panGesture", this.renderScreenCenter), this.five.off("interiaPan", this.renderScreenCenter), this.pointSelectorHelper.hooks.off("intersectionUpdate", this.emitIntersectionUpdate), this.emit("disable");
238
235
  }
239
236
  dispose() {
240
237
  this.disable(), this.pointSelectorHelper.dispose();
@@ -244,5 +241,5 @@ class G extends N {
244
241
  }
245
242
  }
246
243
  export {
247
- G as PointSelector
244
+ k as PointSelector
248
245
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/dnalogel",
3
- "version": "3.49.9",
3
+ "version": "3.49.11",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",