@realsee/dnalogel 3.49.13 → 3.49.14-alpha.1
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/README.md +116 -0
- package/dist/Sculpt/utils/Modules/Cursor.d.ts +2 -2
- package/dist/index.cjs.js +31 -31
- package/dist/index.js +690 -689
- package/dist/index.umd.js +31 -31
- package/dist/shared-utils/three/PointSelector/index.d.ts +5 -14
- package/libs/Sculpt/Objects/Point/index.js +5 -5
- package/libs/Sculpt/utils/Modules/Cursor.d.ts +2 -2
- package/libs/Sculpt/utils/Modules/Cursor.js +6 -6
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/PointSelector/index.d.ts +5 -14
- package/libs/shared-utils/three/PointSelector/index.js +48 -48
- package/package.json +1 -1
|
@@ -72,7 +72,6 @@ export declare class PointSelector extends Subscribe<EventMap> {
|
|
|
72
72
|
private _outOfFive;
|
|
73
73
|
private set enabled(value);
|
|
74
74
|
private _enabled;
|
|
75
|
-
private hammer?;
|
|
76
75
|
private mode;
|
|
77
76
|
/** 长按屏幕的动作触发后为true,手指抬起后为false */
|
|
78
77
|
private pressDown;
|
|
@@ -80,6 +79,8 @@ export declare class PointSelector extends Subscribe<EventMap> {
|
|
|
80
79
|
private adherePoints;
|
|
81
80
|
/** 吸附点的半径 */
|
|
82
81
|
private adherePointsRadius;
|
|
82
|
+
/** 有值时表明处于按压检查阶段 */
|
|
83
|
+
private setPressDown?;
|
|
83
84
|
private lastFiveHelperVisible?;
|
|
84
85
|
private lastIntersection?;
|
|
85
86
|
private mousePosition;
|
|
@@ -108,19 +109,9 @@ export declare class PointSelector extends Subscribe<EventMap> {
|
|
|
108
109
|
*/
|
|
109
110
|
private onLeave;
|
|
110
111
|
private onClick;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
*/
|
|
115
|
-
private onPan;
|
|
116
|
-
/**
|
|
117
|
-
* @description: 长按屏幕后,更新长按点的位置
|
|
118
|
-
*/
|
|
119
|
-
private onPress;
|
|
120
|
-
/**
|
|
121
|
-
* @description: 手指抬起后,重置pressDown状态
|
|
122
|
-
*/
|
|
123
|
-
private onPanEnd;
|
|
112
|
+
private onTouchStart;
|
|
113
|
+
private onTouchMove;
|
|
114
|
+
private onTouchEnd;
|
|
124
115
|
private updateByMousePosition;
|
|
125
116
|
/**
|
|
126
117
|
* @description: 根据鼠标位置计算焦点位置并更新
|
|
@@ -11,7 +11,7 @@ var p = (e, i, t) => i in e ? g(e, i, { enumerable: !0, configurable: !0, writab
|
|
|
11
11
|
return e;
|
|
12
12
|
}, m = (e, i) => u(e, y(i));
|
|
13
13
|
var c = (e, i, t) => (p(e, typeof i != "symbol" ? i + "" : i, t), t);
|
|
14
|
-
var
|
|
14
|
+
var M = (e, i, t) => new Promise((h, n) => {
|
|
15
15
|
var r = (s) => {
|
|
16
16
|
try {
|
|
17
17
|
o(t.next(s));
|
|
@@ -27,7 +27,7 @@ var b = (e, i, t) => new Promise((h, n) => {
|
|
|
27
27
|
}, o = (s) => s.done ? h(s.value) : Promise.resolve(s.value).then(r, f);
|
|
28
28
|
o((t = t.apply(e, i)).next());
|
|
29
29
|
});
|
|
30
|
-
import { PointMesh as
|
|
30
|
+
import { PointMesh as b } from "../../Meshes/Point.js";
|
|
31
31
|
import { BaseObject as v } from "../Base/index.js";
|
|
32
32
|
import { PointEditor as x } from "./Editor.js";
|
|
33
33
|
import { vector3ToArray as E } from "../../../shared-utils/three/vector3ToArray.js";
|
|
@@ -36,7 +36,7 @@ class C extends v {
|
|
|
36
36
|
super(t, h);
|
|
37
37
|
c(this, "type", "Point");
|
|
38
38
|
c(this, "pointMesh");
|
|
39
|
-
this.editor = new x(this), t && (this.pointMesh = new
|
|
39
|
+
this.editor = new x(this), t && (this.pointMesh = new b(a(a({}, t.style), t)), this.add(this.pointMesh));
|
|
40
40
|
}
|
|
41
41
|
get data() {
|
|
42
42
|
return m(a({}, this.baseData), {
|
|
@@ -67,8 +67,8 @@ class C extends v {
|
|
|
67
67
|
* @description: 创建点
|
|
68
68
|
*/
|
|
69
69
|
create(t) {
|
|
70
|
-
return
|
|
71
|
-
this.pointMesh && this.remove(this.pointMesh), this.add(this.pointMesh = new
|
|
70
|
+
return M(this, null, function* () {
|
|
71
|
+
this.pointMesh && this.remove(this.pointMesh), this.add(this.pointMesh = new b(t)), yield U(this.pointMesh, this.pointSelector);
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -2,7 +2,7 @@ type CursorType = 'auto' | 'pen' | 'pen-forbidden' | 'pen-crosshair' | 'pne-poly
|
|
|
2
2
|
export declare class Cursor {
|
|
3
3
|
private container;
|
|
4
4
|
private deleteButton?;
|
|
5
|
-
constructor(container
|
|
5
|
+
constructor(container?: HTMLElement);
|
|
6
6
|
/**
|
|
7
7
|
* @param type - The type of the cursor.
|
|
8
8
|
*/
|
|
@@ -10,7 +10,7 @@ export declare class Cursor {
|
|
|
10
10
|
showDeleteButton(params: {
|
|
11
11
|
clientX: number;
|
|
12
12
|
clientY: number;
|
|
13
|
-
container
|
|
13
|
+
container?: HTMLElement;
|
|
14
14
|
onClick: () => void;
|
|
15
15
|
}): HTMLElement;
|
|
16
16
|
removeDeleteButton(): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var c = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var s = (l, t, i) => (
|
|
4
|
-
const
|
|
2
|
+
var d = (l, t, i) => t in l ? c(l, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : l[t] = i;
|
|
3
|
+
var s = (l, t, i) => (d(l, typeof t != "symbol" ? t + "" : t, i), i);
|
|
4
|
+
const I = {
|
|
5
5
|
auto: "",
|
|
6
6
|
pen: "",
|
|
7
7
|
"pen-forbidden": "",
|
|
@@ -15,17 +15,17 @@ class p {
|
|
|
15
15
|
constructor(t) {
|
|
16
16
|
s(this, "container");
|
|
17
17
|
s(this, "deleteButton");
|
|
18
|
-
this.container = t;
|
|
18
|
+
this.container = t != null ? t : document.documentElement;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* @param type - The type of the cursor.
|
|
22
22
|
*/
|
|
23
23
|
setType(t) {
|
|
24
|
-
const i =
|
|
24
|
+
const i = I[t];
|
|
25
25
|
i ? this.container.style.cursor = `url(${i}), auto` : this.container.style.cursor = t;
|
|
26
26
|
}
|
|
27
27
|
showDeleteButton(t) {
|
|
28
|
-
const { clientX: i, clientY: n, container: o, onClick: r } = t;
|
|
28
|
+
const { clientX: i, clientY: n, container: o = this.container, onClick: r } = t;
|
|
29
29
|
let e = this.deleteButton;
|
|
30
30
|
return e || (e = document.createElement("div"), e.style.position = "absolute", e.style.width = "20px", e.style.height = "20px", e.style.transform = "translate(-50%, -40px)", e.style.borderRadius = "50%", e.style.cursor = "pointer", e.style.zIndex = "9999", e.style.cursor = "pointer", e.style.userSelect = "none", e.style.display = "flex", e.style.alignItems = "center", e.style.justifyContent = "center", e.style.backgroundImage = "url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTciIGhlaWdodD0iMjUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IHgxPSIxMC43MDYlIiB5MT0iNDIuNzQ0JSIgeDI9Ijg5LjA2NCUiIHkyPSI1Ny4yMDglIiBpZD0icHJlZml4X19hIj48c3RvcCBzdG9wLWNvbG9yPSIjRkZGIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iMCUiLz48c3RvcCBzdG9wLWNvbG9yPSIjRkZGIiBzdG9wLW9wYWNpdHk9Ii4zMDgiIG9mZnNldD0iNDkuNTY5JSIvPjxzdG9wIHN0b3AtY29sb3I9IiNGRkYiIHN0b3Atb3BhY2l0eT0iMCIgb2Zmc2V0PSIxMDAlIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PHJlY3QgeD0iLS4yNSIgeT0iLS4yNSIgd2lkdGg9IjU3LjUiIGhlaWdodD0iMjMuNSIgcng9IjExLjI1IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDEpIiBmaWxsPSIjMkMyQzJDIiBzdHJva2U9InVybCgjcHJlZml4X19hKSIgc3Ryb2tlLXdpZHRoPSIuNSIgZmlsbC1ydWxlPSJldmVub2RkIiBmaWxsLW9wYWNpdHk9Ii4zMDMiLz48L3N2Zz4=)", e.innerHTML = '<svg width="16px" height="17px" viewBox="0 0 16 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><linearGradient x1="22.185491%" y1="100%" x2="66.8316686%" y2="6.67239121%" id="1"><stop stop-color="#FFFCFC" stop-opacity="0.6"></stop><stop stop-color="#FFFFFF" offset="100%"></stop></linearGradient></defs> <path fill="url(#1)" fill-rule="nonzero" transform="translate(2.16 2.16)" d="M11.2979686,2.71818182 C11.611378,2.71818182 11.8654465,2.97561809 11.8654465,3.29318182 C11.8654465,3.58428191 11.6519584,3.82485822 11.374972,3.86293275 L11.2979686,3.86818182 L10.464,3.868 L9.7236795,10.6246222 C9.64153248,11.3737453 9.04854423,11.9512142 8.32013277,12.0165596 L8.18206028,12.0227273 L3.68338622,12.0227273 C2.89302127,12.0227273 2.22904821,11.4205655 2.141767,10.6246222 L2.141767,10.6246222 L1.4,3.868 L0.567477876,3.86818182 C0.254068499,3.86818182 0,3.61074555 0,3.29318182 C0,3.00208173 0.213488114,2.76150541 0.49047449,2.72343089 L0.567477876,2.71818182 L11.2979686,2.71818182 Z M9.322,3.868 L2.542,3.868 L3.26978106,10.4976259 C3.28762252,10.6603274 3.39528004,10.7928487 3.53932022,10.8467307 L3.61412483,10.866894 L3.68338622,10.8727273 L8.18206028,10.8727273 C8.39410941,10.8727273 8.57224853,10.7111717 8.59566544,10.4976259 L8.59566544,10.4976259 L9.322,3.868 Z M8.16824216,0 C8.48165153,0 8.73572003,0.257436269 8.73572003,0.575 C8.73572003,0.866100087 8.52223192,1.1066764 8.24524554,1.14475093 L8.16824216,1.15 L3.69720434,1.15 C3.38379497,1.15 3.12972647,0.892563731 3.12972647,0.575 C3.12972647,0.283899913 3.34321458,0.0433235966 3.62020096,0.00524907226 L3.69720434,0 L8.16824216,0 Z"></path></svg>'), this.deleteButton = e, o.appendChild(e), e.style.left = `${i}px`, e.style.top = `${n}px`, e.onclick = () => {
|
|
31
31
|
o.removeChild(e), r();
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -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.14-alpha.1",
|
|
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",
|
|
@@ -72,7 +72,6 @@ export declare class PointSelector extends Subscribe<EventMap> {
|
|
|
72
72
|
private _outOfFive;
|
|
73
73
|
private set enabled(value);
|
|
74
74
|
private _enabled;
|
|
75
|
-
private hammer?;
|
|
76
75
|
private mode;
|
|
77
76
|
/** 长按屏幕的动作触发后为true,手指抬起后为false */
|
|
78
77
|
private pressDown;
|
|
@@ -80,6 +79,8 @@ export declare class PointSelector extends Subscribe<EventMap> {
|
|
|
80
79
|
private adherePoints;
|
|
81
80
|
/** 吸附点的半径 */
|
|
82
81
|
private adherePointsRadius;
|
|
82
|
+
/** 有值时表明处于按压检查阶段 */
|
|
83
|
+
private setPressDown?;
|
|
83
84
|
private lastFiveHelperVisible?;
|
|
84
85
|
private lastIntersection?;
|
|
85
86
|
private mousePosition;
|
|
@@ -108,19 +109,9 @@ export declare class PointSelector extends Subscribe<EventMap> {
|
|
|
108
109
|
*/
|
|
109
110
|
private onLeave;
|
|
110
111
|
private onClick;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
*/
|
|
115
|
-
private onPan;
|
|
116
|
-
/**
|
|
117
|
-
* @description: 长按屏幕后,更新长按点的位置
|
|
118
|
-
*/
|
|
119
|
-
private onPress;
|
|
120
|
-
/**
|
|
121
|
-
* @description: 手指抬起后,重置pressDown状态
|
|
122
|
-
*/
|
|
123
|
-
private onPanEnd;
|
|
112
|
+
private onTouchStart;
|
|
113
|
+
private onTouchMove;
|
|
114
|
+
private onTouchEnd;
|
|
124
115
|
private updateByMousePosition;
|
|
125
116
|
/**
|
|
126
117
|
* @description: 根据鼠标位置计算焦点位置并更新
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
var
|
|
1
|
+
var w = Object.defineProperty, b = Object.defineProperties;
|
|
2
2
|
var E = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
4
|
-
var I = Object.prototype.hasOwnProperty,
|
|
5
|
-
var
|
|
3
|
+
var f = Object.getOwnPropertySymbols;
|
|
4
|
+
var I = Object.prototype.hasOwnProperty, y = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var p = (n, s, e) => s in n ? w(n, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[s] = e, l = (n, s) => {
|
|
6
6
|
for (var e in s || (s = {}))
|
|
7
|
-
I.call(s, e) &&
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
|
|
7
|
+
I.call(s, e) && p(n, e, s[e]);
|
|
8
|
+
if (f)
|
|
9
|
+
for (var e of f(s))
|
|
10
|
+
y.call(s, e) && p(n, e, s[e]);
|
|
11
11
|
return n;
|
|
12
|
-
},
|
|
13
|
-
var i = (n, s, e) => (
|
|
12
|
+
}, v = (n, s) => b(n, E(s));
|
|
13
|
+
var i = (n, s, e) => (p(n, typeof s != "symbol" ? s + "" : s, e), e);
|
|
14
14
|
import { PointSelectorHelper as H } from "./utils/PointSelectorHelper.js";
|
|
15
|
-
import { isTouchDevice as
|
|
16
|
-
import M from "hammerjs";
|
|
15
|
+
import { isTouchDevice as m } from "../../isTouchDevice.js";
|
|
17
16
|
import * as d from "three";
|
|
18
|
-
import { Subscribe as
|
|
19
|
-
import { getIntersectByRaycaster as
|
|
20
|
-
import { getRaycasterByNdcPosition as
|
|
17
|
+
import { Subscribe as M } from "../../Subscribe.js";
|
|
18
|
+
import { getIntersectByRaycaster as T, getVirtualIntersectByRaycaster as L } from "../../five/getPosition.js";
|
|
19
|
+
import { getRaycasterByNdcPosition as N } from "../../five/getRaycasterByNdcPosition.js";
|
|
21
20
|
import { CURSOR_NOT_ALLOW_URL as P } from "./utils/contents.js";
|
|
22
|
-
const
|
|
23
|
-
class
|
|
21
|
+
const F = new d.Vector3(), u = () => !1;
|
|
22
|
+
class g extends M {
|
|
24
23
|
constructor(e, t) {
|
|
25
24
|
var a, o, c;
|
|
26
25
|
super();
|
|
@@ -33,7 +32,6 @@ class k extends N {
|
|
|
33
32
|
i(this, "five");
|
|
34
33
|
i(this, "_outOfFive", !1);
|
|
35
34
|
i(this, "_enabled", !1);
|
|
36
|
-
i(this, "hammer");
|
|
37
35
|
i(this, "mode");
|
|
38
36
|
/** 长按屏幕的动作触发后为true,手指抬起后为false */
|
|
39
37
|
i(this, "pressDown", !1);
|
|
@@ -41,6 +39,8 @@ class k extends N {
|
|
|
41
39
|
i(this, "adherePoints");
|
|
42
40
|
/** 吸附点的半径 */
|
|
43
41
|
i(this, "adherePointsRadius", 0.1);
|
|
42
|
+
/** 有值时表明处于按压检查阶段 */
|
|
43
|
+
i(this, "setPressDown");
|
|
44
44
|
i(this, "lastFiveHelperVisible");
|
|
45
45
|
i(this, "lastIntersection");
|
|
46
46
|
i(this, "mousePosition");
|
|
@@ -76,32 +76,32 @@ class k extends N {
|
|
|
76
76
|
i(this, "onClick", () => {
|
|
77
77
|
this.select();
|
|
78
78
|
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
79
|
+
i(this, "onTouchStart", (e) => {
|
|
80
|
+
console.log("touchstart"), this.setPressDown = setTimeout(() => {
|
|
81
|
+
if (this.setPressDown = void 0, this.mousePosition = {
|
|
82
|
+
clientX: e.touches[0].clientX,
|
|
83
|
+
clientY: e.touches[0].clientY
|
|
84
|
+
}, !this.mouseNdcPosition)
|
|
85
|
+
return;
|
|
86
|
+
const t = this.updateByNdcPosition(this.mouseNdcPosition);
|
|
87
|
+
this.pressDown = t;
|
|
88
|
+
}, 300);
|
|
88
89
|
});
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
i(this, "onPress", (e) => {
|
|
93
|
-
if (e != null && e.center && (this.mousePosition = {
|
|
94
|
-
clientX: e.center.x,
|
|
95
|
-
clientY: e.center.y
|
|
96
|
-
}), !this.mouseNdcPosition)
|
|
90
|
+
i(this, "onTouchMove", (e) => {
|
|
91
|
+
if (console.log("touchmove"), this.setPressDown) {
|
|
92
|
+
clearTimeout(this.setPressDown), this.setPressDown = void 0;
|
|
97
93
|
return;
|
|
98
|
-
|
|
99
|
-
this.pressDown
|
|
94
|
+
}
|
|
95
|
+
if (this.pressDown) {
|
|
96
|
+
if (this.mousePosition = {
|
|
97
|
+
clientX: e.touches[0].clientX,
|
|
98
|
+
clientY: e.touches[0].clientY
|
|
99
|
+
}, !this.mouseNdcPosition)
|
|
100
|
+
return;
|
|
101
|
+
this.updateByNdcPosition(this.mouseNdcPosition);
|
|
102
|
+
}
|
|
100
103
|
});
|
|
101
|
-
|
|
102
|
-
* @description: 手指抬起后,重置pressDown状态
|
|
103
|
-
*/
|
|
104
|
-
i(this, "onPanEnd", () => {
|
|
104
|
+
i(this, "onTouchEnd", (e) => {
|
|
105
105
|
this.pressDown && (setTimeout(() => {
|
|
106
106
|
this.pressDown = !1;
|
|
107
107
|
}, 100), this.select());
|
|
@@ -114,11 +114,11 @@ class k extends N {
|
|
|
114
114
|
*/
|
|
115
115
|
i(this, "updateByNdcPosition", (e) => {
|
|
116
116
|
var h, a;
|
|
117
|
-
const t =
|
|
117
|
+
const t = N(this.five, e), r = T(this.five, t);
|
|
118
118
|
if (r)
|
|
119
119
|
return this.updatePointSelectorHelperIntersect(r), this.lastIntersection = r, !0;
|
|
120
120
|
if (this.plane) {
|
|
121
|
-
const o = t.ray.intersectPlane(this.plane,
|
|
121
|
+
const o = t.ray.intersectPlane(this.plane, F);
|
|
122
122
|
if (o) {
|
|
123
123
|
const c = {
|
|
124
124
|
distance: this.five.camera.position.distanceTo(o),
|
|
@@ -181,12 +181,12 @@ class k extends N {
|
|
|
181
181
|
});
|
|
182
182
|
this.five = e, this.config = l(l({}, this.config), t), this.actionIfNoModelUnderMouse = (a = t == null ? void 0 : t.actionIfNoModelUnderMouse) != null ? a : "virtualPoint";
|
|
183
183
|
const r = (o = t == null ? void 0 : t.mode) != null ? o : "auto";
|
|
184
|
-
r === "auto" ? this.mode =
|
|
184
|
+
r === "auto" ? this.mode = m ? "fixed" : "cursor" : this.mode = r;
|
|
185
185
|
const h = {
|
|
186
186
|
autoFixPCPosition: this.mode === "cursor",
|
|
187
187
|
initialPosition: this.mode === "fixed" ? { left: "35%", top: "20%" } : void 0
|
|
188
188
|
};
|
|
189
|
-
this.pointSelectorHelper = new H(this.five,
|
|
189
|
+
this.pointSelectorHelper = new H(this.five, v(l({}, t == null ? void 0 : t.helper), {
|
|
190
190
|
magnifierParams: l(l({}, h), (c = t == null ? void 0 : t.helper) == null ? void 0 : c.magnifierParams)
|
|
191
191
|
})), this.pointSelectorHelper.hide();
|
|
192
192
|
}
|
|
@@ -224,14 +224,14 @@ class k extends N {
|
|
|
224
224
|
const e = this.five.getElement();
|
|
225
225
|
if (!e)
|
|
226
226
|
throw new Error("five element not found");
|
|
227
|
-
this.
|
|
227
|
+
this.mode === "cursor" ? (this.five.on("wantsMoveToPano", u), this.five.on("wantsChangeMode", u), this.five.on("wantsTapGesture", u), m ? (e.addEventListener("touchstart", this.onTouchStart, { passive: !0 }), e.addEventListener("touchmove", this.onTouchMove), e.addEventListener("touchend", this.onTouchEnd)) : (e.addEventListener("click", this.onClick), e.addEventListener("mousemove", this.updateByMousePosition), e.addEventListener("wheel", this.onMouseWheel), e.addEventListener("mouseenter", this.onEnter), e.addEventListener("mouseout", this.onLeave)), this.five.on("wantsPanGesture", this.onFiveWantsPanGesture)) : 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");
|
|
228
228
|
}
|
|
229
229
|
disable() {
|
|
230
230
|
if (!this.enabled)
|
|
231
231
|
return;
|
|
232
232
|
this.enabled = !1, this.pointSelectorHelper.disable(), this.five.getElement().style.cursor = "";
|
|
233
233
|
const e = this.five.getElement();
|
|
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("
|
|
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("touchstart", this.onTouchStart), e == null || e.removeEventListener("touchmove", this.onTouchMove), e == null || e.removeEventListener("touchend", this.onTouchEnd), e == null || e.removeEventListener("click", this.onClick), 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.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");
|
|
235
235
|
}
|
|
236
236
|
dispose() {
|
|
237
237
|
this.disable(), this.pointSelectorHelper.dispose();
|
|
@@ -241,5 +241,5 @@ class k extends N {
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
export {
|
|
244
|
-
|
|
244
|
+
g as PointSelector
|
|
245
245
|
};
|