@realsee/dnalogel 3.44.0 → 3.44.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/CHANGELOG.md +3 -0
- package/dist/index.cjs.js +17 -17
- package/dist/index.js +140 -138
- package/dist/index.umd.js +15 -15
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +34 -32
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -2,14 +2,14 @@ var Z = Object.defineProperty, _ = Object.defineProperties;
|
|
|
2
2
|
var G = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var y = Object.getOwnPropertySymbols;
|
|
4
4
|
var D = Object.prototype.hasOwnProperty, j = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
5
|
+
var M = (u, i, e) => i in u ? Z(u, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : u[i] = e, p = (u, i) => {
|
|
6
6
|
for (var e in i || (i = {}))
|
|
7
|
-
D.call(i, e) &&
|
|
7
|
+
D.call(i, e) && M(u, e, i[e]);
|
|
8
8
|
if (y)
|
|
9
9
|
for (var e of y(i))
|
|
10
|
-
j.call(i, e) &&
|
|
10
|
+
j.call(i, e) && M(u, e, i[e]);
|
|
11
11
|
return u;
|
|
12
|
-
},
|
|
12
|
+
}, I = (u, i) => _(u, G(i));
|
|
13
13
|
var B = (u, i) => {
|
|
14
14
|
var e = {};
|
|
15
15
|
for (var t in u)
|
|
@@ -19,8 +19,8 @@ var B = (u, i) => {
|
|
|
19
19
|
i.indexOf(t) < 0 && j.call(u, t) && (e[t] = u[t]);
|
|
20
20
|
return e;
|
|
21
21
|
};
|
|
22
|
-
var f = (u, i, e) => (
|
|
23
|
-
var
|
|
22
|
+
var f = (u, i, e) => (M(u, typeof i != "symbol" ? i + "" : i, e), e);
|
|
23
|
+
var U = (u, i, e) => new Promise((t, r) => {
|
|
24
24
|
var n = (s) => {
|
|
25
25
|
try {
|
|
26
26
|
o(e.next(s));
|
|
@@ -37,9 +37,9 @@ var I = (u, i, e) => new Promise((t, r) => {
|
|
|
37
37
|
o((e = e.apply(u, i)).next());
|
|
38
38
|
});
|
|
39
39
|
import { Subscribe as K } from "../../../shared-utils/Subscribe.js";
|
|
40
|
-
import { calculateTagConfig as
|
|
40
|
+
import { calculateTagConfig as w } from "../../utils/tag/calculateTagConfig.js";
|
|
41
41
|
import { getTagStickType as Y } from "../../utils/tag/format.js";
|
|
42
|
-
import { isPanoramaLike as
|
|
42
|
+
import { isPanoramaLike as T, isModelLike as P } from "../../../shared-utils/five/mode.js";
|
|
43
43
|
import * as S from "three";
|
|
44
44
|
import "hammerjs";
|
|
45
45
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
@@ -56,7 +56,7 @@ import { uuid as oe } from "../../../shared-utils/uuid.js";
|
|
|
56
56
|
import "../../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
57
57
|
import { objectAssignDeepExports as b } from "../../../vendor/object-assign-deep/objectAssignDeep.js";
|
|
58
58
|
import { getTagPosition as L, getTagCenterPosition as $ } from "../../utils/tagPosition.js";
|
|
59
|
-
import { checkRange as
|
|
59
|
+
import { checkRange as C } from "../../utils/checkRange.js";
|
|
60
60
|
import { isMediaPlaneTag as re, isMediaModelTag as V } from "../../utils/tag/tagCheck.js";
|
|
61
61
|
import { getUrlExt as N } from "../../../shared-utils/url/getUrl.js";
|
|
62
62
|
import { getFloorIndex as le } from "../../../shared-utils/five/getFloorIndex.js";
|
|
@@ -74,8 +74,8 @@ import "../../../shared-utils/Utils/FiveUtil.js";
|
|
|
74
74
|
import "../../../shared-utils/Utils/BaseUtil.js";
|
|
75
75
|
import "../../../shared-utils/Utils/WorkUtil.js";
|
|
76
76
|
import "../../../shared-utils/five/getFiveModel.js";
|
|
77
|
-
const
|
|
78
|
-
|
|
77
|
+
const k = new S.Raycaster();
|
|
78
|
+
k.params.Points.threshold = 0.1;
|
|
79
79
|
class _e {
|
|
80
80
|
constructor(i, e) {
|
|
81
81
|
f(this, "plugin");
|
|
@@ -112,7 +112,7 @@ class _e {
|
|
|
112
112
|
e.stickType = t;
|
|
113
113
|
const r = JSON.parse(JSON.stringify(e.data)), n = (s = e.initialConfig) != null ? s : e.config ? JSON.parse(JSON.stringify(e.config)) : {};
|
|
114
114
|
e.initialConfig = n;
|
|
115
|
-
const l =
|
|
115
|
+
const l = w(e, i.config), o = this.getConfig(e);
|
|
116
116
|
e.config = o, this.id = (a = e.id) != null ? a : oe(), this.enabled = (c = e.enabled) != null ? c : !0, this.contentType = e.contentType, this.data = (g = o.initialData) != null && g.important ? b(e.data, r, o.initialData) : b(e.data, o.initialData, r), this.state = p({
|
|
117
117
|
visible: void 0,
|
|
118
118
|
unfolded: !this.can("fold")
|
|
@@ -144,7 +144,7 @@ class _e {
|
|
|
144
144
|
}
|
|
145
145
|
get currentConfig() {
|
|
146
146
|
var r, n;
|
|
147
|
-
const i =
|
|
147
|
+
const i = w(this, this.plugin.config, { useCache: !0 }), e = this.five.getCurrentState().mode, t = (r = i.configWithFiveMode) == null ? void 0 : r[e];
|
|
148
148
|
return (n = t != null ? t : i) != null ? n : {};
|
|
149
149
|
}
|
|
150
150
|
get currentVisible() {
|
|
@@ -163,7 +163,7 @@ class _e {
|
|
|
163
163
|
* @description 找到标签
|
|
164
164
|
*/
|
|
165
165
|
find(i) {
|
|
166
|
-
return
|
|
166
|
+
return U(this, null, function* () {
|
|
167
167
|
var r;
|
|
168
168
|
const e = this.fiveState;
|
|
169
169
|
if (!this.fiveState)
|
|
@@ -187,7 +187,7 @@ class _e {
|
|
|
187
187
|
* @description 闪烁
|
|
188
188
|
*/
|
|
189
189
|
blink(i) {
|
|
190
|
-
return
|
|
190
|
+
return U(this, null, function* () {
|
|
191
191
|
var o, s;
|
|
192
192
|
const e = (o = this.enabled) != null ? o : !0, t = (s = this.state) == null ? void 0 : s.visible, r = e && t;
|
|
193
193
|
r === !1 && (this.state.visible = !0, this.enabled = !0, this.applyVisible(), this.plugin.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] }), this.plugin.render(), yield de(0), this.dom && (this.dom.style.visibility = "hidden"), this.contentDom && (this.contentDom.style.visibility = "hidden"));
|
|
@@ -287,7 +287,7 @@ class _e {
|
|
|
287
287
|
}
|
|
288
288
|
getConfig(i, e) {
|
|
289
289
|
var l, o, s;
|
|
290
|
-
const t =
|
|
290
|
+
const t = w(i != null ? i : this, this.plugin.config, { useCache: e == null ? void 0 : e.useCache }), r = (l = e == null ? void 0 : e.fiveMode) != null ? l : this.five.getCurrentState().mode, n = (o = t.configWithFiveMode) == null ? void 0 : o[r];
|
|
291
291
|
return (s = n != null ? n : t) != null ? s : {};
|
|
292
292
|
}
|
|
293
293
|
getDistance(i, e = 3) {
|
|
@@ -376,7 +376,7 @@ class _e {
|
|
|
376
376
|
if (h === !1)
|
|
377
377
|
return p({ value: !1, checkedList: n, reason: "followModelVisibility check failed" }, v);
|
|
378
378
|
}
|
|
379
|
-
if (
|
|
379
|
+
if (T(r) && s.visiblePanoIndex !== void 0 && s.visiblePanoIndex !== "all" && t !== void 0) {
|
|
380
380
|
if (n.push("visiblePanoIndex"), Array.isArray(s.visiblePanoIndex) && !s.visiblePanoIndex.includes(t))
|
|
381
381
|
return {
|
|
382
382
|
value: !1,
|
|
@@ -392,7 +392,7 @@ class _e {
|
|
|
392
392
|
}
|
|
393
393
|
if (s.visibleDistance !== void 0 && (n.push("visibleDistance"), s.visibleDistance !== "unLimited")) {
|
|
394
394
|
const h = this.getDistance(e, 1);
|
|
395
|
-
if (
|
|
395
|
+
if (C(h, s.visibleDistance) === !1)
|
|
396
396
|
return {
|
|
397
397
|
value: !1,
|
|
398
398
|
checkedList: n,
|
|
@@ -430,9 +430,9 @@ class _e {
|
|
|
430
430
|
if (n || (n = (o = (l = this.fiveState) == null ? void 0 : l.mode) != null ? o : this.workUtil.observers.length ? "Panorama" : "ModelLike"), Array.isArray(n))
|
|
431
431
|
return n.includes(e);
|
|
432
432
|
if (n === "ModelLike")
|
|
433
|
-
return
|
|
433
|
+
return P(e);
|
|
434
434
|
if (n === "PanoramaLike")
|
|
435
|
-
return !
|
|
435
|
+
return !T(e);
|
|
436
436
|
if (n === "all")
|
|
437
437
|
return !0;
|
|
438
438
|
if (typeof n == "string")
|
|
@@ -442,7 +442,7 @@ class _e {
|
|
|
442
442
|
var l;
|
|
443
443
|
const n = t();
|
|
444
444
|
if (E((l = this.fiveState) == null ? void 0 : l.panoIndex) && i.entryFromModel) {
|
|
445
|
-
if (
|
|
445
|
+
if (P(e) && n ? this.entryFromModel = !1 : this.entryFromModel = !0, P(e))
|
|
446
446
|
return !0;
|
|
447
447
|
} else
|
|
448
448
|
this.entryFromModel = !1;
|
|
@@ -458,7 +458,7 @@ class _e {
|
|
|
458
458
|
/** 通过射线检测标签可用性 */
|
|
459
459
|
computeVisibleByIntersect(i) {
|
|
460
460
|
var s, a, c, g;
|
|
461
|
-
const e = z(z((s = this.getConfig().visibleConfig) != null ? s : {}).intersectRaycaster), t = i != null ? i : this.five.getCurrentState().panoIndex, r =
|
|
461
|
+
const e = z(z((s = this.getConfig().visibleConfig) != null ? s : {}).intersectRaycaster), t = i != null ? i : this.five.getCurrentState().panoIndex, r = T(this.five.getCurrentState().mode) ? this.workUtil.getObserverPosition(t) : this.five.camera.position;
|
|
462
462
|
if (r === void 0)
|
|
463
463
|
return { value: !1, reason: { type: "startPosition is undefined", fivePanoIndex: t } };
|
|
464
464
|
const n = ae(
|
|
@@ -472,19 +472,19 @@ class _e {
|
|
|
472
472
|
for (const d of n) {
|
|
473
473
|
const m = new S.Vector3().subVectors(d, r).normalize();
|
|
474
474
|
let h;
|
|
475
|
-
|
|
476
|
-
const [v] = this.fiveUtil.model.intersectRaycaster(
|
|
475
|
+
k.set(r, m);
|
|
476
|
+
const [v] = this.fiveUtil.model.intersectRaycaster(k);
|
|
477
477
|
h = v == null ? void 0 : v.distance;
|
|
478
|
-
const
|
|
478
|
+
const x = (() => {
|
|
479
479
|
if (!V(this))
|
|
480
480
|
return;
|
|
481
481
|
const q = this.plugin.tags.filter(V).map((X) => {
|
|
482
482
|
var F;
|
|
483
483
|
return (F = X.model) == null ? void 0 : F.object;
|
|
484
|
-
}).filter(E), [Q] =
|
|
484
|
+
}).filter(E), [Q] = k.intersectObjects(q, !0);
|
|
485
485
|
return Q;
|
|
486
486
|
})(), J = r.distanceTo(d), W = (a = e.distanceAccuracy) != null ? a : 0.01;
|
|
487
|
-
h = Math.min(h != null ? h : 1 / 0, (c =
|
|
487
|
+
h = Math.min(h != null ? h : 1 / 0, (c = x == null ? void 0 : x.distance) != null ? c : 1 / 0), h + W >= J ? l++ : o++;
|
|
488
488
|
const H = (g = e.needPassed) != null ? g : 1;
|
|
489
489
|
if (l >= H)
|
|
490
490
|
return { value: !0 };
|
|
@@ -526,12 +526,14 @@ class _e {
|
|
|
526
526
|
return !1;
|
|
527
527
|
if (e.keep === "unfolded")
|
|
528
528
|
return !0;
|
|
529
|
-
if (e.unfoldDistance &&
|
|
529
|
+
if (e.unfoldDistance && C(this.getDistance({ panoIndex: i }), e.unfoldDistance) === !1)
|
|
530
530
|
return !1;
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
533
|
computeUnfoldedByCamera() {
|
|
534
534
|
var e;
|
|
535
|
+
if (this.entryFromModel && P(this.five.state.mode))
|
|
536
|
+
return !1;
|
|
535
537
|
const i = this.getConfig().unfoldedConfig;
|
|
536
538
|
if (i) {
|
|
537
539
|
if (typeof i == "function")
|
|
@@ -544,7 +546,7 @@ class _e {
|
|
|
544
546
|
return;
|
|
545
547
|
if (i.autoUnfold.strategy === "ScreenPostion") {
|
|
546
548
|
const t = this.computeTagProject();
|
|
547
|
-
if (t &&
|
|
549
|
+
if (t && C(t.x, i.autoUnfold.autoUnfoldProjectX) === !1)
|
|
548
550
|
return !1;
|
|
549
551
|
}
|
|
550
552
|
if (i.autoUnfold.strategy === "MinimumDistance") {
|
|
@@ -557,9 +559,9 @@ class _e {
|
|
|
557
559
|
}).map((o) => ({ tag: o, id: o.id, tagConfig: o.getConfig().unfoldedConfig })).filter(({ tagConfig: o }) => {
|
|
558
560
|
var s, a;
|
|
559
561
|
return !(typeof o == "function" || o.keep || o.autoUnfold === !1 || ((s = o.autoUnfold) == null ? void 0 : s.enable) === !1 || ((a = o.autoUnfold) == null ? void 0 : a.strategy) !== "MinimumDistance");
|
|
560
|
-
}).map((o) =>
|
|
562
|
+
}).map((o) => I(p({}, o), { distance: o.tag.getDistance() })).filter(({ distance: o, tagConfig: s }) => {
|
|
561
563
|
const a = s.autoUnfold.distance;
|
|
562
|
-
return !(a &&
|
|
564
|
+
return !(a && C(o, a) === !1);
|
|
563
565
|
}).sort((o, s) => o.distance - s.distance).findIndex((o) => o.id === this.id);
|
|
564
566
|
if (n === -1 || n <= ((e = i.autoUnfold.maxNumber) != null ? e : 1) - 1 === !1)
|
|
565
567
|
return !1;
|
|
@@ -597,7 +599,7 @@ class _e {
|
|
|
597
599
|
return { reason: `plugin.state.visible is ${this.plugin.state.visible}` };
|
|
598
600
|
if (!this.enabled)
|
|
599
601
|
return { reason: `tag ${this.id} enabled is: ${this.enabled}` };
|
|
600
|
-
const i =
|
|
602
|
+
const i = I(p({}, this.computeVisible()), {
|
|
601
603
|
tagInstance: this
|
|
602
604
|
});
|
|
603
605
|
return i.value !== this.state.visible ? { reason: "插件故障,请联系维护人员, err: 0", info: i } : this.state.visible ? { reason: "应该是能看见才对", info: i } : i.value === !0 ? { reason: "插件故障,请联系维护人员, err: 1", info: i } : { reason: (e = i.reason.type) != null ? e : i.reason, info: i };
|
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.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",
|