@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.
- package/CHANGELOG.md +7 -1
- package/dist/Sculpt/Objects/Base/index.d.ts +4 -0
- package/dist/Sculpt/index.d.ts +3 -1
- package/dist/Sculpt/typings/index.d.ts +10 -11
- package/dist/Sculpt/utils/Modules/Cursor.d.ts +8 -0
- package/dist/index.cjs.js +153 -153
- package/dist/index.js +3258 -3232
- package/dist/index.umd.js +161 -161
- package/dist/shared-utils/five/FiveDomEvents.d.ts +2 -0
- package/libs/CruisePlugin/Move.js +3 -2
- package/libs/CruisePlugin/Work.js +3 -2
- package/libs/CruisePlugin/index.js +7 -6
- package/libs/GuideLinePlugin/Controller.js +5 -4
- package/libs/GuideLinePlugin/GuideLineItem.js +3 -2
- package/libs/GuideLinePlugin/GuideLineModeItem.js +3 -2
- package/libs/GuideLinePlugin/index.js +7 -6
- package/libs/ModelMakerPlugin/Controller.js +3 -2
- package/libs/ModelMakerPlugin/index.js +3 -2
- package/libs/ModelMakerPlugin/item/baseItem.js +6 -5
- package/libs/ModelMakerPlugin/item/boxItem.js +3 -2
- package/libs/ModelMakerPlugin/item/polygonItem.js +3 -2
- package/libs/ModelMakerPlugin/item/prismItem.js +3 -2
- package/libs/ModelMakerPlugin/utils/getFiveDomEvent.js +3 -2
- package/libs/PanoTagPlugin/controller/TagRender.js +3 -2
- package/libs/PanoTagPlugin/controller/TagUtil.js +3 -2
- package/libs/PanoTagPlugin/controller/index.js +6 -5
- package/libs/PanoTagPlugin/index.js +12 -11
- package/libs/Sculpt/Objects/Base/index.d.ts +4 -0
- package/libs/Sculpt/Objects/Base/index.js +28 -20
- package/libs/Sculpt/index.d.ts +3 -1
- package/libs/Sculpt/index.js +74 -74
- package/libs/Sculpt/typings/index.d.ts +10 -11
- package/libs/Sculpt/utils/Modules/Cursor.d.ts +8 -0
- package/libs/Sculpt/utils/Modules/Cursor.js +24 -13
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/five/FiveDomEvents.d.ts +2 -0
- package/libs/shared-utils/five/FiveDomEvents.js +73 -65
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -1,41 +1,46 @@
|
|
|
1
|
-
var
|
|
1
|
+
var x = Object.defineProperty;
|
|
2
2
|
var D = Object.getOwnPropertySymbols;
|
|
3
|
-
var
|
|
4
|
-
var M = (u, e, t) => e in u ?
|
|
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
|
-
|
|
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
|
|
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
|
|
15
|
-
import { getFiveModel as
|
|
16
|
-
import { THREERaycaster as
|
|
17
|
-
|
|
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
|
-
|
|
21
|
+
r(this, "five");
|
|
21
22
|
/**
|
|
22
23
|
* @description: 拖动中
|
|
23
24
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
55
|
+
r(this, "handleMouseEvent", (e) => {
|
|
51
56
|
this.handleDomEvent(e.type, e);
|
|
52
57
|
});
|
|
53
|
-
|
|
58
|
+
r(this, "handleMousedown", (e) => {
|
|
54
59
|
this.lastMouseDownEvent = e, this.handleDomEvent("mousedown", e), this.handleDomEvent("dragstart", e, this.haveDragEventObject);
|
|
55
60
|
});
|
|
56
|
-
|
|
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
|
-
|
|
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
|
-
|
|
80
|
-
var m, g, p,
|
|
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),
|
|
86
|
-
|
|
87
|
-
const s =
|
|
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(
|
|
97
|
+
const _ = v.intersectRaycaster(l);
|
|
90
98
|
h.push(..._);
|
|
91
99
|
});
|
|
92
|
-
const
|
|
93
|
-
if (h.length > 0 && s.length > 0 && h[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 = (
|
|
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 (
|
|
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:
|
|
109
|
+
if (c && c && this.notify({ eventName: e, object: c, originEvent: n, raycaster: l, intersects: s }))
|
|
102
110
|
return !1;
|
|
103
111
|
});
|
|
104
|
-
|
|
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
|
-
|
|
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
|
|
121
|
+
let l = !1, s = [];
|
|
114
122
|
const h = [];
|
|
115
|
-
let
|
|
116
|
-
for (h.push(
|
|
117
|
-
|
|
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
|
|
121
|
-
if (
|
|
128
|
+
for (const o of h) {
|
|
129
|
+
if (l)
|
|
122
130
|
break;
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
if (!
|
|
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 =
|
|
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) && !$(
|
|
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 (
|
|
141
|
+
if (o._hovered)
|
|
134
142
|
continue;
|
|
135
|
-
|
|
136
|
-
for (const
|
|
137
|
-
|
|
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 (!
|
|
148
|
+
if (!o._hovered)
|
|
141
149
|
continue;
|
|
142
|
-
|
|
150
|
+
o._hovered = !1;
|
|
143
151
|
}
|
|
144
152
|
const O = _({
|
|
145
153
|
type: t,
|
|
146
|
-
target:
|
|
154
|
+
target: o,
|
|
147
155
|
origDomEvent: i,
|
|
148
156
|
raycaster: a,
|
|
149
157
|
intersects: d,
|
|
150
158
|
stopPropagation: () => {
|
|
151
|
-
|
|
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((
|
|
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
|
|
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,
|
|
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,
|
|
199
|
+
var d, l;
|
|
192
200
|
if (!e._domEvent || (t === void 0 && (Object.keys(this.boundObject).forEach((s) => {
|
|
193
|
-
var
|
|
194
|
-
const h = (
|
|
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 && ((
|
|
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 =
|
|
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
|
-
|
|
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.
|
|
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",
|