@realsee/dnalogel 3.44.2 → 3.44.4
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 -0
- package/dist/index.cjs.js +25 -25
- package/dist/index.js +2357 -2372
- package/dist/index.umd.js +25 -25
- package/libs/CSS3DRenderPlugin/utils/three/THREEJS_CSS3DRenderer.js +39 -58
- package/libs/CurrentPanoImagePlugin/Controller.js +43 -39
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/PointSelector/index.js +19 -19
- package/libs/shared-utils/three/PointSelector/utils/PointHelper.js +17 -17
- package/package.json +2 -2
|
@@ -1,83 +1,64 @@
|
|
|
1
|
-
import { Matrix4 as
|
|
1
|
+
import { Matrix4 as M } from "three";
|
|
2
2
|
let k = function() {
|
|
3
|
-
let
|
|
3
|
+
let x = this, f, m, S, y, n = new M(), p = {
|
|
4
4
|
camera: { fov: 0, style: "" },
|
|
5
5
|
objects: /* @__PURE__ */ new WeakMap()
|
|
6
|
-
},
|
|
7
|
-
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
let u = /Trident/i.test(navigator.userAgent);
|
|
11
|
-
this.getSize = function() {
|
|
6
|
+
}, a = document.createElement("div");
|
|
7
|
+
a.style.overflow = "hidden", this.domElement = a;
|
|
8
|
+
let s = document.createElement("div");
|
|
9
|
+
s.style.WebkitTransformStyle = "preserve-3d", s.style.transformStyle = "preserve-3d", s.style.pointerEvents = "none", a.appendChild(s), this.getSize = function() {
|
|
12
10
|
return {
|
|
13
|
-
width:
|
|
14
|
-
height:
|
|
11
|
+
width: f,
|
|
12
|
+
height: m
|
|
15
13
|
};
|
|
16
14
|
}, this.setSize = function(t, e) {
|
|
17
|
-
|
|
15
|
+
f = t, m = e, S = f / 2, y = m / 2, a.style.width = t + "px", a.style.height = e + "px", s.style.width = t + "px", s.style.height = e + "px";
|
|
18
16
|
};
|
|
19
|
-
function
|
|
17
|
+
function l(t) {
|
|
20
18
|
return Math.abs(t) < 1e-10 ? 0 : t;
|
|
21
19
|
}
|
|
22
|
-
function
|
|
20
|
+
function u(t) {
|
|
23
21
|
let e = t.elements;
|
|
24
|
-
return "matrix3d(" +
|
|
22
|
+
return "matrix3d(" + l(e[0]) + "," + l(-e[1]) + "," + l(e[2]) + "," + l(e[3]) + "," + l(e[4]) + "," + l(-e[5]) + "," + l(e[6]) + "," + l(e[7]) + "," + l(e[8]) + "," + l(-e[9]) + "," + l(e[10]) + "," + l(e[11]) + "," + l(e[12]) + "," + l(-e[13]) + "," + l(e[14]) + "," + l(e[15]) + ")";
|
|
25
23
|
}
|
|
26
|
-
function
|
|
27
|
-
let
|
|
28
|
-
return
|
|
24
|
+
function v(t, e) {
|
|
25
|
+
let i = t.elements;
|
|
26
|
+
return "translate(-50%,-50%)" + ("matrix3d(" + l(i[0]) + "," + l(i[1]) + "," + l(i[2]) + "," + l(i[3]) + "," + l(-i[4]) + "," + l(-i[5]) + "," + l(-i[6]) + "," + l(-i[7]) + "," + l(i[8]) + "," + l(i[9]) + "," + l(i[10]) + "," + l(i[11]) + "," + l(i[12]) + "," + l(i[13]) + "," + l(i[14]) + "," + l(i[15]) + ")");
|
|
29
27
|
}
|
|
30
|
-
function
|
|
28
|
+
function c(t) {
|
|
31
29
|
t.isCSS3DObject && (t.element.style.display = "none");
|
|
32
|
-
for (let e = 0,
|
|
33
|
-
|
|
30
|
+
for (let e = 0, i = t.children.length; e < i; e++)
|
|
31
|
+
c(t.children[e]);
|
|
34
32
|
}
|
|
35
|
-
function C(t, e,
|
|
33
|
+
function C(t, e, i, h) {
|
|
36
34
|
if (t.visible === !1) {
|
|
37
|
-
|
|
35
|
+
c(t);
|
|
38
36
|
return;
|
|
39
37
|
}
|
|
40
38
|
if (t.isCSS3DObject) {
|
|
41
|
-
t.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
const o = t.layers.test(i.layers) === !0, d = t.element;
|
|
40
|
+
if (d.style.display = o === !0 ? "" : "none", o) {
|
|
41
|
+
t.onBeforeRender(x, e, i);
|
|
42
|
+
let r;
|
|
43
|
+
t.isCSS3DSprite ? (n.copy(i.matrixWorldInverse), n.transpose(), n.copyPosition(t.matrixWorld), n.scale(t.scale), n.elements[3] = 0, n.elements[7] = 0, n.elements[11] = 0, n.elements[15] = 1, r = v(n)) : r = v(t.matrixWorld);
|
|
44
|
+
let W = p.objects.get(t);
|
|
45
|
+
if (W === void 0 || W.style !== r) {
|
|
46
|
+
d.style.WebkitTransform = r, d.style.transform = r;
|
|
47
|
+
let g = { style: r };
|
|
48
|
+
p.objects.set(t, g);
|
|
49
|
+
}
|
|
50
|
+
d.style.display = t.visible ? "" : "none", d.parentNode !== s && s.appendChild(d), t.onAfterRender(x, e, i);
|
|
49
51
|
}
|
|
50
|
-
s.style.display = t.visible ? "" : "none", s.parentNode !== a && a.appendChild(s), t.onAfterRender(c, e, r);
|
|
51
52
|
}
|
|
52
|
-
for (let
|
|
53
|
-
C(t.children[
|
|
54
|
-
}
|
|
55
|
-
var O = function() {
|
|
56
|
-
let t = new M(), e = new M();
|
|
57
|
-
return function(r, l) {
|
|
58
|
-
return t.setFromMatrixPosition(r.matrixWorld), e.setFromMatrixPosition(l.matrixWorld), t.distanceToSquared(e);
|
|
59
|
-
};
|
|
60
|
-
}();
|
|
61
|
-
function T(t) {
|
|
62
|
-
let e = [];
|
|
63
|
-
return t.traverse(function(r) {
|
|
64
|
-
r.isCSS3DObject && e.push(r);
|
|
65
|
-
}), e;
|
|
66
|
-
}
|
|
67
|
-
function w(t) {
|
|
68
|
-
let e = T(t).sort(function(l, n) {
|
|
69
|
-
let s = p.objects.get(l).distanceToCameraSquared, f = p.objects.get(n).distanceToCameraSquared;
|
|
70
|
-
return s - f;
|
|
71
|
-
}), r = e.length;
|
|
72
|
-
for (let l = 0, n = e.length; l < n; l++)
|
|
73
|
-
e[l].element.style.zIndex = r - l;
|
|
53
|
+
for (let o = 0, d = t.children.length; o < d; o++)
|
|
54
|
+
C(t.children[o], e, i);
|
|
74
55
|
}
|
|
75
56
|
this.render = function(t, e) {
|
|
76
|
-
let
|
|
77
|
-
if (p.camera.fov !==
|
|
78
|
-
var
|
|
79
|
-
let
|
|
80
|
-
p.camera.style !==
|
|
57
|
+
let i = e.projectionMatrix.elements[5] * y;
|
|
58
|
+
if (p.camera.fov !== i && (e.isPerspectiveCamera ? (a.style.WebkitPerspective = i + "px", a.style.perspective = i + "px") : (a.style.WebkitPerspective = "", a.style.perspective = ""), p.camera.fov = i), t.autoUpdate === !0 && t.updateMatrixWorld(), e.parent === null && e.updateMatrixWorld(), e.isOrthographicCamera)
|
|
59
|
+
var h = -(e.right + e.left) / 2, o = (e.top + e.bottom) / 2;
|
|
60
|
+
let r = (e.isOrthographicCamera ? "scale(" + i + ")translate(" + l(h) + "px," + l(o) + "px)" + u(e.matrixWorldInverse) : "translateZ(" + i + "px)" + u(e.matrixWorldInverse)) + "translate(" + S + "px," + y + "px)";
|
|
61
|
+
p.camera.style !== r && (s.style.WebkitTransform = r, s.style.transform = r, p.camera.style = r), C(t, t, e);
|
|
81
62
|
};
|
|
82
63
|
};
|
|
83
64
|
export {
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
var m = Object.defineProperty;
|
|
2
2
|
var p = Object.getOwnPropertySymbols;
|
|
3
3
|
var v = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var g = (
|
|
4
|
+
var g = (r, o, e) => o in r ? m(r, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[o] = e, a = (r, o) => {
|
|
5
5
|
for (var e in o || (o = {}))
|
|
6
|
-
v.call(o, e) && g(
|
|
6
|
+
v.call(o, e) && g(r, e, o[e]);
|
|
7
7
|
if (p)
|
|
8
8
|
for (var e of p(o))
|
|
9
|
-
b.call(o, e) && g(
|
|
10
|
-
return
|
|
9
|
+
b.call(o, e) && g(r, e, o[e]);
|
|
10
|
+
return r;
|
|
11
11
|
};
|
|
12
|
-
var n = (
|
|
13
|
-
var
|
|
12
|
+
var n = (r, o, e) => (g(r, typeof o != "symbol" ? o + "" : o, e), e);
|
|
13
|
+
var u = (r, o, e) => new Promise((i, t) => {
|
|
14
14
|
var s = (d) => {
|
|
15
15
|
try {
|
|
16
|
-
|
|
16
|
+
f(e.next(d));
|
|
17
17
|
} catch (c) {
|
|
18
18
|
t(c);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, l = (d) => {
|
|
21
21
|
try {
|
|
22
|
-
|
|
22
|
+
f(e.throw(d));
|
|
23
23
|
} catch (c) {
|
|
24
24
|
t(c);
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
26
|
+
}, f = (d) => d.done ? i(d.value) : Promise.resolve(d.value).then(s, l);
|
|
27
|
+
f((e = e.apply(r, o)).next());
|
|
28
28
|
});
|
|
29
|
-
import * as
|
|
29
|
+
import * as h from "three";
|
|
30
30
|
import { Controller as M } from "../base/BasePlugin.js";
|
|
31
31
|
import { tweenProgress as A } from "../shared-utils/animationFrame/BetterTween.js";
|
|
32
32
|
import "hammerjs";
|
|
@@ -34,8 +34,8 @@ import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
|
34
34
|
import "@realsee/five/line";
|
|
35
35
|
import "../shared-utils/three/THREESphere.js";
|
|
36
36
|
import "animejs";
|
|
37
|
-
import { equal as
|
|
38
|
-
import { loadTexture as
|
|
37
|
+
import { equal as P } from "../shared-utils/equal.js";
|
|
38
|
+
import { loadTexture as w } from "../shared-utils/three/loadTexture.js";
|
|
39
39
|
import "../shared-utils/Subscribe.js";
|
|
40
40
|
import "../shared-utils/Utils/FiveUtil.js";
|
|
41
41
|
import "../shared-utils/Utils/BaseUtil.js";
|
|
@@ -62,7 +62,7 @@ class E extends M {
|
|
|
62
62
|
pluginHidden: ""
|
|
63
63
|
});
|
|
64
64
|
// ==================== private properties ====================
|
|
65
|
-
n(this, "group", new
|
|
65
|
+
n(this, "group", new h.Group());
|
|
66
66
|
n(this, "mesh");
|
|
67
67
|
n(this, "textureLoadingPromise");
|
|
68
68
|
n(this, "opacityAnimeTween");
|
|
@@ -120,20 +120,20 @@ class E extends M {
|
|
|
120
120
|
visible: !0
|
|
121
121
|
};
|
|
122
122
|
this.state = Object.assign(t, i == null ? void 0 : i.initialState);
|
|
123
|
-
const s =
|
|
123
|
+
const s = a({
|
|
124
124
|
width: 1.4,
|
|
125
125
|
yOffset: 0.01,
|
|
126
126
|
yRotate: 0,
|
|
127
127
|
imageURL: this.absoluteUrl("/release/web/logo.7febb17f.png")
|
|
128
128
|
}, i == null ? void 0 : i.config);
|
|
129
|
-
this._config = s, this.group.name = "current-pano-image-plugin-group", this.mesh = new
|
|
130
|
-
new
|
|
131
|
-
new
|
|
129
|
+
this._config = s, this.group.name = "current-pano-image-plugin-group", this.mesh = new h.Mesh(
|
|
130
|
+
new h.PlaneBufferGeometry(this.config.width, this.config.width),
|
|
131
|
+
new h.MeshBasicMaterial({ transparent: !0, opacity: 0, depthTest: !1 })
|
|
132
132
|
), this.mesh.visible = !1, this.group.add(this.mesh), this.updateMeshQuaternion(this.config.yRotate), this.state.visible || (this.checkMsg.pluginHidden = "初始值设置为隐藏"), this.state.enabled || (this.checkMsg.pluginDisabled = "初始值设置为禁用"), this.state.enabled && this._enable({ userAction: !1 }), this.five.once("dispose", this.dispose);
|
|
133
133
|
}
|
|
134
134
|
/** 插件配置项 */
|
|
135
135
|
get config() {
|
|
136
|
-
return
|
|
136
|
+
return a({}, this._config);
|
|
137
137
|
}
|
|
138
138
|
/** 是否已经被销毁 */
|
|
139
139
|
get disposed() {
|
|
@@ -166,12 +166,12 @@ class E extends M {
|
|
|
166
166
|
* @param `options.userAction` `<boolean> | <undefined>` 是否是用户操作。默认是 true。
|
|
167
167
|
*/
|
|
168
168
|
show(e) {
|
|
169
|
-
return
|
|
169
|
+
return u(this, null, function* () {
|
|
170
170
|
if (this.state.visible)
|
|
171
171
|
return Promise.resolve();
|
|
172
172
|
if (this.disposed)
|
|
173
173
|
return Promise.reject(new Error("不能在已销毁的插件上调用 show"));
|
|
174
|
-
const i =
|
|
174
|
+
const i = a({ userAction: !0 }, e);
|
|
175
175
|
this.updateState({ visible: !0 }, i.userAction), this.checkMsg.pluginHidden = "", this._show(i);
|
|
176
176
|
});
|
|
177
177
|
}
|
|
@@ -180,10 +180,10 @@ class E extends M {
|
|
|
180
180
|
* @param `options.userAction` `<boolean> | <undefined>` 是否是用户操作。默认是 true。
|
|
181
181
|
*/
|
|
182
182
|
hide(e) {
|
|
183
|
-
return
|
|
183
|
+
return u(this, null, function* () {
|
|
184
184
|
if (this.state.visible === !1)
|
|
185
185
|
return;
|
|
186
|
-
const i =
|
|
186
|
+
const i = a({ userAction: !0 }, e);
|
|
187
187
|
this.updateState({ visible: !1 }, i.userAction), this.checkMsg.pluginDisabled = "调用 hide 隐藏", this._hide(i);
|
|
188
188
|
});
|
|
189
189
|
}
|
|
@@ -194,12 +194,12 @@ class E extends M {
|
|
|
194
194
|
*/
|
|
195
195
|
setState(e, i = {}) {
|
|
196
196
|
const t = this.state;
|
|
197
|
-
if (
|
|
197
|
+
if (P(e, t, { deep: !0 }))
|
|
198
198
|
return;
|
|
199
199
|
const s = i.userAction !== void 0 ? i.userAction : !0;
|
|
200
200
|
if (this.updateState(e, s), e.enabled !== void 0 && t.enabled !== e.enabled && (e.enabled ? this.checkMsg.pluginDisabled = "" : this.checkMsg.pluginDisabled = "调用 setState 禁用", e.enabled ? this._enable({ userAction: s }) : this._disable({ userAction: s })), e.visible !== void 0 && t.visible !== e.visible) {
|
|
201
|
-
const
|
|
202
|
-
e.visible ? this.checkMsg.pluginHidden = "" : this.checkMsg.pluginHidden = "调用 setState 隐藏", e.visible ? this._show(
|
|
201
|
+
const l = { userAction: s, anime: { duration: 500 } };
|
|
202
|
+
e.visible ? this.checkMsg.pluginHidden = "" : this.checkMsg.pluginHidden = "调用 setState 隐藏", e.visible ? this._show(l) : this._hide(l);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
/** 更改插件 Config
|
|
@@ -207,9 +207,9 @@ class E extends M {
|
|
|
207
207
|
* @param `options` `<Option> | <undefined>`
|
|
208
208
|
*/
|
|
209
209
|
updateConfig(e, i = {}) {
|
|
210
|
-
var
|
|
211
|
-
const t = this.config, s =
|
|
212
|
-
this._config = s, t.imageURL !== s.imageURL && this.reloadTexture(s.imageURL), t.yOffset !== s.yOffset && this.updateMeshPosition(this.five.getCurrentState().panoIndex), t.yRotate !== s.yRotate && this.updateMeshQuaternion(s.yRotate), t.width !== s.width && (this.mesh.geometry = new
|
|
210
|
+
var l;
|
|
211
|
+
const t = this.config, s = a(a({}, t), e);
|
|
212
|
+
this._config = s, t.imageURL !== s.imageURL && this.reloadTexture(s.imageURL), t.yOffset !== s.yOffset && this.updateMeshPosition(this.five.getCurrentState().panoIndex), t.yRotate !== s.yRotate && this.updateMeshQuaternion(s.yRotate), t.width !== s.width && (this.mesh.geometry = new h.PlaneBufferGeometry(s.width, s.width)), this.hooks.emit("configChange", { prevConfig: t, config: s, userAction: (l = i.userAction) != null ? l : !0 });
|
|
213
213
|
}
|
|
214
214
|
/** 问什么看不到模型 */
|
|
215
215
|
__whyCantSeeMesh() {
|
|
@@ -224,7 +224,7 @@ class E extends M {
|
|
|
224
224
|
}
|
|
225
225
|
updateState(e, i) {
|
|
226
226
|
const t = this.state;
|
|
227
|
-
this.state =
|
|
227
|
+
this.state = a(a({}, this.state), e), this.hooks.emit("stateChange", { state: this.state, prevState: t, userAction: i });
|
|
228
228
|
}
|
|
229
229
|
/** 根据各种条件更新 Mesh 的可见性 */
|
|
230
230
|
updateMeshVisible() {
|
|
@@ -233,30 +233,34 @@ class E extends M {
|
|
|
233
233
|
}
|
|
234
234
|
/** 根据点位更新 Mesh 坐标 */
|
|
235
235
|
updateMeshPosition(e) {
|
|
236
|
-
|
|
237
|
-
|
|
236
|
+
const i = this.workUtil.getObserverStandingPosition(e);
|
|
237
|
+
if (!i) {
|
|
238
|
+
console.warn("CurrentPanoImagePlugin: 无法获取到当前点位的 standingPosition");
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
const t = i.clone().setY(i.y + this.config.yOffset);
|
|
238
242
|
t && this.mesh.position.copy(t);
|
|
239
243
|
}
|
|
240
244
|
/** 重新加载贴图,调用时会先清除已有的贴图 */
|
|
241
245
|
reloadTexture(e) {
|
|
242
|
-
return
|
|
246
|
+
return u(this, null, function* () {
|
|
243
247
|
if (this.mesh.material.map = null, e !== "") {
|
|
244
|
-
const i =
|
|
248
|
+
const i = w(e);
|
|
245
249
|
this.textureLoadingPromise = i;
|
|
246
250
|
const t = yield i;
|
|
247
|
-
t.minFilter =
|
|
251
|
+
t.minFilter = h.LinearFilter, this.textureLoadingPromise === i && (this.onTextureLoaded(t), this.textureLoadingPromise = null);
|
|
248
252
|
}
|
|
249
253
|
this.updateMeshVisible();
|
|
250
254
|
});
|
|
251
255
|
}
|
|
252
256
|
/** north_rad 变化时,需要更新模型的旋转角度 */
|
|
253
257
|
updateMeshQuaternion(e) {
|
|
254
|
-
const i = new
|
|
258
|
+
const i = new h.Quaternion();
|
|
255
259
|
i.multiplyQuaternions(
|
|
256
260
|
// 沿着自身 X 轴旋转 -90 度
|
|
257
|
-
new
|
|
261
|
+
new h.Quaternion().setFromAxisAngle(new h.Vector3(1, 0, 0), -Math.PI / 2),
|
|
258
262
|
// 沿着自身 Z 轴旋转 rad 弧度
|
|
259
|
-
new
|
|
263
|
+
new h.Quaternion().setFromAxisAngle(new h.Vector3(0, 0, 1), e)
|
|
260
264
|
), this.mesh.quaternion.copy(i);
|
|
261
265
|
}
|
|
262
266
|
_enable(e) {
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.44.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.44.4",
|
|
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",
|
|
@@ -2,22 +2,22 @@ var P = Object.defineProperty, E = Object.defineProperties;
|
|
|
2
2
|
var S = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var p = Object.getOwnPropertySymbols;
|
|
4
4
|
var w = Object.prototype.hasOwnProperty, C = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var f = (
|
|
5
|
+
var f = (o, s, e) => s in o ? P(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
|
-
w.call(s, e) && f(
|
|
7
|
+
w.call(s, e) && f(o, e, s[e]);
|
|
8
8
|
if (p)
|
|
9
9
|
for (var e of p(s))
|
|
10
|
-
C.call(s, e) && f(
|
|
11
|
-
return
|
|
12
|
-
}, c = (
|
|
13
|
-
var i = (
|
|
14
|
-
import { PointSelectorHelper as
|
|
15
|
-
import { isTouchDevice as
|
|
10
|
+
C.call(s, e) && f(o, e, s[e]);
|
|
11
|
+
return o;
|
|
12
|
+
}, c = (o, s) => E(o, S(s));
|
|
13
|
+
var i = (o, s, e) => (f(o, typeof s != "symbol" ? s + "" : s, e), e);
|
|
14
|
+
import { PointSelectorHelper as y } from "./utils/PointSelectorHelper.js";
|
|
15
|
+
import { isTouchDevice as b } from "../../isTouchDevice.js";
|
|
16
16
|
import H from "hammerjs";
|
|
17
17
|
import { Subscribe as F } from "../../Subscribe.js";
|
|
18
18
|
import { getIntersectByNdcPosition as d } from "../../five/getPosition.js";
|
|
19
19
|
const h = () => !1;
|
|
20
|
-
class
|
|
20
|
+
class M extends F {
|
|
21
21
|
constructor(e, t) {
|
|
22
22
|
var a, u;
|
|
23
23
|
super();
|
|
@@ -122,24 +122,24 @@ class B extends F {
|
|
|
122
122
|
}
|
|
123
123
|
this.onEnter(), this.five.getElement().style.cursor = "";
|
|
124
124
|
const t = l({}, e);
|
|
125
|
-
let
|
|
125
|
+
let n = !1;
|
|
126
126
|
if (typeof this.adherePoints == "function" && typeof this.adherePointsRadius == "number") {
|
|
127
127
|
for (const r of this.adherePoints({ intersection: e, pointSelectorInstance: this }))
|
|
128
128
|
if (r.distanceTo(e.point) < this.adherePointsRadius) {
|
|
129
|
-
t.point = r.clone(),
|
|
129
|
+
t.point = r.clone(), n = !0;
|
|
130
130
|
break;
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
this.pointSelectorHelper.updateWithIntersect(t, { emitEvent: !1 }), this.emit("intersectionUpdate", t,
|
|
133
|
+
this.pointSelectorHelper.updateWithIntersect(t, { emitEvent: !1 }), this.emit("intersectionUpdate", t, n);
|
|
134
134
|
});
|
|
135
135
|
i(this, "mousePositionToNdcPosition", (e) => {
|
|
136
136
|
const t = this.five.getElement();
|
|
137
137
|
if (!t)
|
|
138
138
|
return null;
|
|
139
|
-
const { top:
|
|
139
|
+
const { top: n, left: r, width: a, height: u } = t.getBoundingClientRect(), { clientX: m, clientY: v } = e;
|
|
140
140
|
return {
|
|
141
141
|
x: (m - r) / a,
|
|
142
|
-
y: 1 - (v -
|
|
142
|
+
y: 1 - (v - n) / u
|
|
143
143
|
};
|
|
144
144
|
});
|
|
145
145
|
i(this, "onFiveWantsPanGesture", () => {
|
|
@@ -153,13 +153,13 @@ class B extends F {
|
|
|
153
153
|
this.emit("intersectionUpdate", e);
|
|
154
154
|
});
|
|
155
155
|
this.five = e, this.config = t != null ? t : {};
|
|
156
|
-
const
|
|
157
|
-
|
|
156
|
+
const n = (a = t == null ? void 0 : t.mode) != null ? a : "auto";
|
|
157
|
+
n === "auto" ? this.mode = b ? "fixed" : "cursor" : this.mode = n;
|
|
158
158
|
const r = {
|
|
159
159
|
autoFixPCPosition: this.mode === "cursor",
|
|
160
160
|
initialPosition: this.mode === "fixed" ? { left: "35%", top: "20%" } : void 0
|
|
161
161
|
};
|
|
162
|
-
this.pointSelectorHelper = new
|
|
162
|
+
this.pointSelectorHelper = new y(e, c(l({}, t == null ? void 0 : t.helper), {
|
|
163
163
|
magnifierParams: l(l({}, r), (u = t == null ? void 0 : t.helper) == null ? void 0 : u.magnifierParams)
|
|
164
164
|
})), this.pointSelectorHelper.hide();
|
|
165
165
|
}
|
|
@@ -188,7 +188,7 @@ class B extends F {
|
|
|
188
188
|
return;
|
|
189
189
|
this.enabled = !1, this.pointSelectorHelper.disable(), this.five.getElement().style.cursor = "";
|
|
190
190
|
const e = this.five.getElement();
|
|
191
|
-
this.five.off("wantsPanGesture", this.onFiveWantsPanGesture), this.five.off("wantsMoveToPano", h), this.five.off("wantsChangeMode", h), this.five.off("wantsTapGesture", h), this.five.helperVisible = this.lastFiveHelperVisible, e == null || e.removeEventListener("mousemove", this.updateByMousePosition), 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");
|
|
191
|
+
this.five.off("wantsPanGesture", this.onFiveWantsPanGesture), this.five.off("wantsMoveToPano", h), this.five.off("wantsChangeMode", h), this.five.off("wantsTapGesture", h), this.five.helperVisible = this.lastFiveHelperVisible, e == null || e.removeEventListener("mousemove", this.updateByMousePosition), e == null || e.removeEventListener("wheel", this.updateByMousePosition), 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");
|
|
192
192
|
}
|
|
193
193
|
dispose() {
|
|
194
194
|
this.disable(), this.pointSelectorHelper.dispose();
|
|
@@ -198,5 +198,5 @@ class B extends F {
|
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
export {
|
|
201
|
-
|
|
201
|
+
M as PointSelector
|
|
202
202
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var s = (
|
|
1
|
+
var i = Object.defineProperty;
|
|
2
|
+
var a = (n, r, e) => r in n ? i(n, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[r] = e;
|
|
3
|
+
var s = (n, r, e) => (a(n, typeof r != "symbol" ? r + "" : r, e), e);
|
|
4
4
|
import * as t from "three";
|
|
5
5
|
import { POINT_HELPER_TEXTURE_URL as l } from "../../Assets/index.js";
|
|
6
|
-
import { CSS3DObjectPlus as
|
|
7
|
-
import { rangePieceImg as
|
|
6
|
+
import { CSS3DObjectPlus as h } from "../../../../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
|
|
7
|
+
import { rangePieceImg as c } from "./html.js";
|
|
8
8
|
import { initialCSS3DRender as d } from "../../../five/initialCSS3DRender.js";
|
|
9
9
|
const p = `
|
|
10
10
|
varying vec2 vUv;
|
|
@@ -23,37 +23,37 @@ void main() {
|
|
|
23
23
|
}
|
|
24
24
|
`;
|
|
25
25
|
function M() {
|
|
26
|
-
const
|
|
26
|
+
const n = new t.PlaneGeometry(0.4, 0.4), r = l, e = new t.TextureLoader().load(r);
|
|
27
27
|
e.encoding = t.sRGBEncoding, e.minFilter = t.LinearFilter;
|
|
28
28
|
const o = new t.MeshBasicMaterial({
|
|
29
29
|
map: e,
|
|
30
30
|
transparent: !0,
|
|
31
31
|
depthTest: !1
|
|
32
32
|
});
|
|
33
|
-
return new t.Mesh(
|
|
33
|
+
return new t.Mesh(n, o);
|
|
34
34
|
}
|
|
35
35
|
function m() {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const
|
|
36
|
+
const n = new t.CurvePath();
|
|
37
|
+
n.add(new t.LineCurve3(new t.Vector3(0, 0, 0), new t.Vector3(0, 0, 0.1)));
|
|
38
|
+
const r = new t.TubeGeometry(n, 8, 3e-3), e = new t.ShaderMaterial({
|
|
39
39
|
vertexShader: p,
|
|
40
40
|
fragmentShader: u,
|
|
41
41
|
depthTest: !1,
|
|
42
42
|
transparent: !0
|
|
43
43
|
});
|
|
44
|
-
return new t.Mesh(
|
|
44
|
+
return new t.Mesh(r, e);
|
|
45
45
|
}
|
|
46
46
|
function v() {
|
|
47
|
-
const
|
|
47
|
+
const n = new t.SphereGeometry(0.01, 20, 20), r = new t.MeshBasicMaterial({
|
|
48
48
|
color: 10349931,
|
|
49
49
|
depthTest: !1,
|
|
50
50
|
transparent: !0,
|
|
51
51
|
side: t.DoubleSide
|
|
52
|
-
}), e = new t.Mesh(
|
|
52
|
+
}), e = new t.Mesh(n, r);
|
|
53
53
|
return e.position.set(0, 0, 0.1), e;
|
|
54
54
|
}
|
|
55
55
|
function w() {
|
|
56
|
-
const
|
|
56
|
+
const r = new h({
|
|
57
57
|
pointerEvents: "none",
|
|
58
58
|
cornerPoints: [
|
|
59
59
|
new t.Vector3(-0.2, 0.2, 0),
|
|
@@ -62,7 +62,7 @@ function w() {
|
|
|
62
62
|
new t.Vector3(0.2, 0.2, 0)
|
|
63
63
|
]
|
|
64
64
|
}), e = document.createElement("div");
|
|
65
|
-
return e.style.width = "100%", e.style.height = "100%", e.style.backgroundImage = `url(${
|
|
65
|
+
return e.style.width = "100%", e.style.height = "100%", e.style.backgroundImage = `url(${c})`, e.style.backgroundSize = "100%", e.style.backgroundRepeat = "no-repeat", r.container.appendChild(e), r;
|
|
66
66
|
}
|
|
67
67
|
class x extends t.Object3D {
|
|
68
68
|
constructor(e) {
|
|
@@ -80,10 +80,10 @@ class x extends t.Object3D {
|
|
|
80
80
|
this.position.copy(e.point), this.lookAt(o);
|
|
81
81
|
}
|
|
82
82
|
show() {
|
|
83
|
-
this.visible = !0;
|
|
83
|
+
this.visible = !0, this.borderMesh.parent || this.add(this.borderMesh);
|
|
84
84
|
}
|
|
85
85
|
hide() {
|
|
86
|
-
this.visible = !1;
|
|
86
|
+
this.visible = !1, this.remove(this.borderMesh);
|
|
87
87
|
}
|
|
88
88
|
dispose() {
|
|
89
89
|
var e;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@realsee/dnalogel",
|
|
3
|
-
"version": "3.44.
|
|
3
|
+
"version": "3.44.4",
|
|
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.2
|
|
45
|
+
"@realsee/five": "6.1.2",
|
|
46
46
|
"@sveltejs/vite-plugin-svelte": "^2.4.2",
|
|
47
47
|
"@tsconfig/svelte": "^4.0.1",
|
|
48
48
|
"@tweenjs/tween.js": "^23.1.1",
|