@realsee/dnalogel 3.49.4 → 3.49.6

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/dist/Sculpt/Objects/Base/index.d.ts +4 -0
  3. package/dist/Sculpt/index.d.ts +3 -1
  4. package/dist/Sculpt/typings/index.d.ts +10 -11
  5. package/dist/Sculpt/utils/Modules/Cursor.d.ts +8 -0
  6. package/dist/index.cjs.js +153 -153
  7. package/dist/index.js +3258 -3232
  8. package/dist/index.umd.js +161 -161
  9. package/dist/shared-utils/five/FiveDomEvents.d.ts +2 -0
  10. package/libs/CruisePlugin/Move.js +3 -2
  11. package/libs/CruisePlugin/Work.js +3 -2
  12. package/libs/CruisePlugin/index.js +7 -6
  13. package/libs/GuideLinePlugin/Controller.js +5 -4
  14. package/libs/GuideLinePlugin/GuideLineItem.js +3 -2
  15. package/libs/GuideLinePlugin/GuideLineModeItem.js +3 -2
  16. package/libs/GuideLinePlugin/index.js +7 -6
  17. package/libs/ModelMakerPlugin/Controller.js +3 -2
  18. package/libs/ModelMakerPlugin/index.js +3 -2
  19. package/libs/ModelMakerPlugin/item/baseItem.js +6 -5
  20. package/libs/ModelMakerPlugin/item/boxItem.js +3 -2
  21. package/libs/ModelMakerPlugin/item/polygonItem.js +3 -2
  22. package/libs/ModelMakerPlugin/item/prismItem.js +3 -2
  23. package/libs/ModelMakerPlugin/utils/getFiveDomEvent.js +3 -2
  24. package/libs/PanoTagPlugin/controller/TagRender.js +3 -2
  25. package/libs/PanoTagPlugin/controller/TagUtil.js +3 -2
  26. package/libs/PanoTagPlugin/controller/index.js +6 -5
  27. package/libs/PanoTagPlugin/index.js +12 -11
  28. package/libs/Sculpt/Objects/Base/index.d.ts +4 -0
  29. package/libs/Sculpt/Objects/Base/index.js +28 -20
  30. package/libs/Sculpt/index.d.ts +3 -1
  31. package/libs/Sculpt/index.js +74 -74
  32. package/libs/Sculpt/typings/index.d.ts +10 -11
  33. package/libs/Sculpt/utils/Modules/Cursor.d.ts +8 -0
  34. package/libs/Sculpt/utils/Modules/Cursor.js +24 -13
  35. package/libs/base/BasePlugin.js +1 -1
  36. package/libs/shared-utils/five/FiveDomEvents.d.ts +2 -0
  37. package/libs/shared-utils/five/FiveDomEvents.js +73 -65
  38. package/libs/shared-utils/logger.js +1 -1
  39. package/package.json +1 -1
@@ -1,41 +1,46 @@
1
- var H = Object.defineProperty;
1
+ var x = Object.defineProperty;
2
2
  var D = Object.getOwnPropertySymbols;
3
- var x = Object.prototype.hasOwnProperty, I = Object.prototype.propertyIsEnumerable;
4
- var M = (u, e, t) => e in u ? H(u, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[e] = t, w = (u, e) => {
3
+ var S = Object.prototype.hasOwnProperty, I = Object.prototype.propertyIsEnumerable;
4
+ var M = (u, e, t) => e in u ? x(u, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[e] = t, L = (u, e) => {
5
5
  for (var t in e || (e = {}))
6
- x.call(e, t) && M(u, t, e[t]);
6
+ S.call(e, t) && M(u, t, e[t]);
7
7
  if (D)
8
8
  for (var t of D(e))
9
9
  I.call(e, t) && M(u, t, e[t]);
10
10
  return u;
11
11
  };
12
- var o = (u, e, t) => (M(u, typeof e != "symbol" ? e + "" : e, t), t);
12
+ var r = (u, e, t) => (M(u, typeof e != "symbol" ? e + "" : e, t), t);
13
13
  import { getObjectVisible as $ } from "../three/getObjectVisible.js";
14
- import { calculateThreeMouse as W } from "./calculateThreeMouse.js";
15
- import { getFiveModel as j } from "./getFiveModel.js";
16
- import { THREERaycaster as L } from "../three/core/Raycaster.js";
17
- class B {
14
+ import { calculateThreeMouse as T } from "./calculateThreeMouse.js";
15
+ import { getFiveModel as W } from "./getFiveModel.js";
16
+ import { THREERaycaster as w } from "../three/core/Raycaster.js";
17
+ import { isTouchDevice as H } from "../isTouchDevice.js";
18
+ class G {
18
19
  // 事件由five触发时,用来补充 originEvent 属性
19
20
  constructor(e, t) {
20
- o(this, "five");
21
+ r(this, "five");
21
22
  /**
22
23
  * @description: 拖动中
23
24
  */
24
- o(this, "dragging", !1);
25
- o(this, "boundObject", {});
26
- o(this, "config");
27
- o(this, "lastMouseDownEvent");
28
- o(this, "handleWantsGesture", (e, t) => {
25
+ r(this, "dragging", !1);
26
+ r(this, "boundObject", {});
27
+ r(this, "config");
28
+ r(this, "lastMouseDownEvent");
29
+ // 事件由five触发时,用来补充 originEvent 属性
30
+ r(this, "lastTouchEvent");
31
+ r(this, "handleWantsGesture", (e, t) => {
29
32
  if (t.length !== 1)
30
33
  return;
31
34
  const n = t[0];
32
35
  if (n.raycaster) {
33
- const i = new L();
36
+ const i = new w();
34
37
  i.ray = n.raycaster.ray, i.near = n.raycaster.near, i.far = n.raycaster.far, i.camera = n.raycaster.camera, i.layers = n.raycaster.layers, i.params = n.raycaster.params, n.raycaster = i;
35
38
  }
36
39
  if (n) {
37
40
  if (e === "mouseMove" && this.onDomEvent("hover", n), e === "tap") {
38
- const i = this.lastMouseDownEvent, a = this.onDomEvent("click", n, i), d = this.onDomEvent("wantDblclick", n, i, this.boundObject.dblclick);
41
+ let i;
42
+ !i && !H && (i = this.lastMouseDownEvent), !i && H && (i = this.lastTouchEvent), i || (i = new MouseEvent("click", { clientX: n.x, clientY: n.y }));
43
+ const a = this.onDomEvent("click", n, i), d = this.onDomEvent("wantDblclick", n, i, this.boundObject.dblclick);
39
44
  if (a === !1 || d === !1)
40
45
  return !1;
41
46
  }
@@ -43,17 +48,20 @@ class B {
43
48
  return !1;
44
49
  }
45
50
  });
46
- o(this, "handleDomEvent", (e, t, n) => {
51
+ r(this, "handleDomEvent", (e, t, n) => {
47
52
  const i = { x: t.clientX, y: t.clientY };
48
53
  this.onDomEvent(e, i, t, n);
49
54
  });
50
- o(this, "handleMouseEvent", (e) => {
55
+ r(this, "handleMouseEvent", (e) => {
51
56
  this.handleDomEvent(e.type, e);
52
57
  });
53
- o(this, "handleMousedown", (e) => {
58
+ r(this, "handleMousedown", (e) => {
54
59
  this.lastMouseDownEvent = e, this.handleDomEvent("mousedown", e), this.handleDomEvent("dragstart", e, this.haveDragEventObject);
55
60
  });
56
- o(this, "handleMouseup", (e) => {
61
+ r(this, "handleTouchStart", (e) => {
62
+ this.lastTouchEvent = e;
63
+ });
64
+ r(this, "handleMouseup", (e) => {
57
65
  var t;
58
66
  this.dragging = !1, (t = this.haveDragEventObject) == null || t.forEach((n) => {
59
67
  n._dragging && (n._dragging = !1, this.notify({
@@ -64,7 +72,7 @@ class B {
64
72
  }));
65
73
  }), this.handleDomEvent("mouseup", e);
66
74
  });
67
- o(this, "handleMousemove", (e) => {
75
+ r(this, "handleMousemove", (e) => {
68
76
  var t;
69
77
  this.dragging && ((t = this.boundObject.drag) == null || t.forEach((n) => {
70
78
  n._dragging && this.notify({
@@ -76,95 +84,95 @@ class B {
76
84
  }));
77
85
  });
78
86
  // eslint-disable-next-line complexity
79
- o(this, "onDomEvent", (e, t, n, i = this.boundObject[e]) => {
80
- var m, g, p, r, b;
87
+ r(this, "onDomEvent", (e, t, n, i = this.boundObject[e]) => {
88
+ var m, g, p, o, y;
81
89
  if (!t || !i || (i == null ? void 0 : i.length) === 0)
82
90
  return;
83
91
  const a = [];
84
92
  ((m = this.config) == null ? void 0 : m.fiveModels) !== null && ((g = this.config) != null && g.fiveModels ? a.push(...this.config.fiveModels) : a.push(this.model));
85
- const d = a.filter((v) => v.loaded), f = (p = t.raycaster) != null ? p : this.getRaycaster(t);
86
- f.params.Points.threshold = 0.02;
87
- const s = f.intersectObjects(i, !0), h = [];
93
+ const d = a.filter((v) => v.loaded), l = (p = t.raycaster) != null ? p : this.getRaycaster(t);
94
+ l.params.Points.threshold = 0.02;
95
+ const s = l.intersectObjects(i, !0), h = [];
88
96
  d.forEach((v) => {
89
- const _ = v.intersectRaycaster(f);
97
+ const _ = v.intersectRaycaster(l);
90
98
  h.push(..._);
91
99
  });
92
- const l = 0.01;
93
- if (h.length > 0 && s.length > 0 && h[0].distance + l < s[0].distance)
100
+ const f = 0.01;
101
+ if (h.length > 0 && s.length > 0 && h[0].distance + f < s[0].distance)
94
102
  return;
95
- const c = (r = s == null ? void 0 : s[0]) == null ? void 0 : r.object;
103
+ const c = (o = s == null ? void 0 : s[0]) == null ? void 0 : o.object;
96
104
  if (e === "wantDblclick")
97
105
  return !1;
98
106
  if ((!c || !this.objectIsBound(c)) && e === "hover")
99
- for (const v of (b = this.boundObject.hover) != null ? b : [])
107
+ for (const v of (y = this.boundObject.hover) != null ? y : [])
100
108
  v._hovered && this.notify({ eventName: "unHover", object: v });
101
- if (c && c && this.notify({ eventName: e, object: c, originEvent: n, raycaster: f, intersects: s }))
109
+ if (c && c && this.notify({ eventName: e, object: c, originEvent: n, raycaster: l, intersects: s }))
102
110
  return !1;
103
111
  });
104
- o(this, "objectIsBound", (e) => {
112
+ r(this, "objectIsBound", (e) => {
105
113
  let t = e._domEvent, n = e.parent;
106
114
  for (; typeof t == "undefined" && n; )
107
115
  t = n._domEvent, n = n.parent;
108
116
  return !!t;
109
117
  });
110
- o(this, "notify", (e) => {
118
+ r(this, "notify", (e) => {
111
119
  var m, g, p;
112
120
  const { eventName: t, object: n, originEvent: i, raycaster: a, intersects: d } = e;
113
- let f = !1, s = [];
121
+ let l = !1, s = [];
114
122
  const h = [];
115
- let l = n;
116
- for (h.push(l); l.parent; )
117
- l = l.parent, h.push(l);
123
+ let f = n;
124
+ for (h.push(f); f.parent; )
125
+ f = f.parent, h.push(f);
118
126
  const c = h.at(-1);
119
127
  if (!((m = this.config) != null && m.noEmitWhenNotInScene && c.type !== "Scene")) {
120
- for (const r of h) {
121
- if (f)
128
+ for (const o of h) {
129
+ if (l)
122
130
  break;
123
- r.draggable && (t === "dragstart" && (r._dragging = !0, this.dragging = !0), t === "dragend" && (r._dragging = !1, this.dragging = !1));
124
- const b = r._domEvent;
125
- if (!b)
131
+ o.draggable && (t === "dragstart" && (o._dragging = !0, this.dragging = !0), t === "dragend" && (o._dragging = !1, this.dragging = !1));
132
+ const y = o._domEvent;
133
+ if (!y)
126
134
  continue;
127
- const v = b[`${t}Handler`];
135
+ const v = y[`${t}Handler`];
128
136
  if (v)
129
137
  for (const [_, E] of v) {
130
- if (E != null && E.noEmitWhenNotInScene && c.type !== "Scene" || ((g = this.config) != null && g.noEmitWhenHide || E != null && E.noEmitWhenHide) && !$(r))
138
+ if (E != null && E.noEmitWhenNotInScene && c.type !== "Scene" || ((g = this.config) != null && g.noEmitWhenHide || E != null && E.noEmitWhenHide) && !$(o))
131
139
  continue;
132
140
  if (t === "hover") {
133
- if (r._hovered)
141
+ if (o._hovered)
134
142
  continue;
135
- r._hovered = !0;
136
- for (const y of (p = this.boundObject.hover) != null ? p : [])
137
- y !== r && y._hovered && this.notify({ eventName: "unHover", object: y });
143
+ o._hovered = !0;
144
+ for (const b of (p = this.boundObject.hover) != null ? p : [])
145
+ b !== o && b._hovered && this.notify({ eventName: "unHover", object: b });
138
146
  }
139
147
  if (t === "unHover") {
140
- if (!r._hovered)
148
+ if (!o._hovered)
141
149
  continue;
142
- r._hovered = !1;
150
+ o._hovered = !1;
143
151
  }
144
152
  const O = _({
145
153
  type: t,
146
- target: r,
154
+ target: o,
147
155
  origDomEvent: i,
148
156
  raycaster: a,
149
157
  intersects: d,
150
158
  stopPropagation: () => {
151
- f = !0;
159
+ l = !0;
152
160
  }
153
161
  });
154
162
  s.push(O != null ? O : !0);
155
163
  }
156
164
  }
157
165
  if (t === "click" || t === "wantDblclick")
158
- return s.some((r) => r === !0);
166
+ return s.some((o) => o === !0);
159
167
  }
160
168
  });
161
- this.five = e, this.config = t, e.on("wantsGesture", this.handleWantsGesture), document.addEventListener("mousedown", this.handleMousedown), document.addEventListener("dblclick", this.handleMouseEvent), document.addEventListener("mouseup", this.handleMouseup), document.addEventListener("mousemove", this.handleMousemove);
169
+ this.five = e, this.config = t, e.on("wantsGesture", this.handleWantsGesture), document.addEventListener("mousedown", this.handleMousedown), document.addEventListener("touchstart", this.handleTouchStart), document.addEventListener("dblclick", this.handleMouseEvent), document.addEventListener("mouseup", this.handleMouseup), document.addEventListener("mousemove", this.handleMousemove);
162
170
  }
163
171
  get haveDragEventObject() {
164
172
  return [...new Set([this.boundObject.dragend, this.boundObject.drag, this.boundObject.dragstart].flat())].filter(Boolean);
165
173
  }
166
174
  get model() {
167
- return j(this.five);
175
+ return W(this.five);
168
176
  }
169
177
  /**
170
178
  * @description: added 时自动绑定事件,removed时自动解绑事件,也就是说只有物体在场景中的时候才会触发事件
@@ -185,13 +193,13 @@ class B {
185
193
  * @return {void}
186
194
  */
187
195
  addEventListener(e, t, n, i) {
188
- e._domEvent || (e._domEvent = {}), e._domEvent[`${t}Handler`] || (e._domEvent[`${t}Handler`] = []), this.boundObject[t] || (this.boundObject[t] = []), this.boundObject[t].includes(e) || this.boundObject[t].push(e), e._domEvent[`${t}Handler`].push([n, w({ noEmitWhenHide: !1, noEmitWhenNotInScene: !1 }, i)]);
196
+ e._domEvent || (e._domEvent = {}), e._domEvent[`${t}Handler`] || (e._domEvent[`${t}Handler`] = []), this.boundObject[t] || (this.boundObject[t] = []), this.boundObject[t].includes(e) || this.boundObject[t].push(e), e._domEvent[`${t}Handler`].push([n, L({ noEmitWhenHide: !1, noEmitWhenNotInScene: !1 }, i)]);
189
197
  }
190
198
  removeEventListener(e, t, n, ...i) {
191
- var d, f;
199
+ var d, l;
192
200
  if (!e._domEvent || (t === void 0 && (Object.keys(this.boundObject).forEach((s) => {
193
- var l, c;
194
- const h = (l = this.boundObject[s]) == null ? void 0 : l.findIndex((m) => m === e);
201
+ var f, c;
202
+ const h = (f = this.boundObject[s]) == null ? void 0 : f.findIndex((m) => m === e);
195
203
  h !== -1 && ((c = this.boundObject[s]) == null || c.splice(h, 1));
196
204
  }), e._domEvent = {}), !e._domEvent[`${t}Handler`]))
197
205
  return;
@@ -202,7 +210,7 @@ class B {
202
210
  const a = e._domEvent[`${t}Handler`].findIndex((s) => s[0] === n);
203
211
  if (a !== -1 && (e._domEvent[`${t}Handler`].splice(a, 1), e._domEvent[`${t}Handler`].length === 0 && delete e._domEvent[`${t}Handler`], e._domEvent && Object.keys(e._domEvent).length === 0 && delete e._domEvent, !e._domEvent)) {
204
212
  const s = (d = this.boundObject[t]) == null ? void 0 : d.findIndex((h) => h === e);
205
- s !== -1 && ((f = this.boundObject[t]) == null || f.splice(s, 1));
213
+ s !== -1 && ((l = this.boundObject[t]) == null || l.splice(s, 1));
206
214
  }
207
215
  }
208
216
  clear() {
@@ -210,7 +218,7 @@ class B {
210
218
  }
211
219
  dispose() {
212
220
  var e;
213
- (e = this.five) == null || e.off("wantsGesture", this.handleWantsGesture), document.removeEventListener("mousedown", this.handleMousedown), document.removeEventListener("mouseup", this.handleMouseup), document.removeEventListener("mousemove", this.handleMousemove), this.boundObject = {};
221
+ (e = this.five) == null || e.off("wantsGesture", this.handleWantsGesture), document.removeEventListener("mousedown", this.handleMousedown), document.removeEventListener("touchstart", this.handleTouchStart), document.removeEventListener("mouseup", this.handleMouseup), document.removeEventListener("mousemove", this.handleMousemove), this.boundObject = {};
214
222
  }
215
223
  toJSON() {
216
224
  return {
@@ -221,10 +229,10 @@ class B {
221
229
  const t = this.five.getElement();
222
230
  if (!t)
223
231
  return;
224
- const n = W(e, t), i = new L();
232
+ const n = T(e, t), i = new w();
225
233
  return i.setFromCamera(n, this.five.camera), i;
226
234
  }
227
235
  }
228
236
  export {
229
- B as FiveDomEvents
237
+ G as FiveDomEvents
230
238
  };
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.49.4",
3
+ "%c %c@realsee/dnalogel %cv3.49.6",
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.49.4",
3
+ "version": "3.49.6",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",