@realsee/dnalogel 3.8.3 → 3.8.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/dist/PanoTagPlugin/utils/tag/adaptConfig.d.ts +2 -2
- package/dist/index.cjs.js +24 -24
- package/dist/index.js +932 -925
- package/dist/index.umd.js +26 -26
- package/libs/PanoTagPlugin/controller/TagComputer.js +115 -108
- package/libs/PanoTagPlugin/controller/TagUtil.js +58 -58
- package/libs/PanoTagPlugin/utils/tag/adaptConfig.d.ts +2 -2
- package/libs/PanoTagPlugin/utils/tag/adaptConfig.js +5 -5
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
var $ = Object.defineProperty, w = Object.defineProperties;
|
|
2
2
|
var E = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
3
|
+
var k = Object.getOwnPropertySymbols;
|
|
4
4
|
var L = Object.prototype.hasOwnProperty, _ = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
5
|
+
var M = (b, e, i) => e in b ? $(b, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : b[e] = i, x = (b, e) => {
|
|
6
6
|
for (var i in e || (e = {}))
|
|
7
|
-
L.call(e, i) &&
|
|
8
|
-
if (
|
|
9
|
-
for (var i of
|
|
10
|
-
_.call(e, i) &&
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
import * as
|
|
14
|
-
import { is3DTag as z, isMediaModelTag as
|
|
15
|
-
import { getTagCenterPosition as
|
|
16
|
-
import { checkRange as
|
|
17
|
-
import { isPanoramaLike as
|
|
7
|
+
L.call(e, i) && M(b, i, e[i]);
|
|
8
|
+
if (k)
|
|
9
|
+
for (var i of k(e))
|
|
10
|
+
_.call(e, i) && M(b, i, e[i]);
|
|
11
|
+
return b;
|
|
12
|
+
}, D = (b, e) => w(b, E(e));
|
|
13
|
+
import * as F from "three";
|
|
14
|
+
import { is3DTag as z, isMediaModelTag as R } from "../utils/tag/tagCheck.js";
|
|
15
|
+
import { getTagCenterPosition as I, getTagPosition as O } from "../utils/tagPosition.js";
|
|
16
|
+
import { checkRange as h } from "../utils/checkRange.js";
|
|
17
|
+
import { isPanoramaLike as y, isModelLike as Z } from "../../shared-utils/five/mode.js";
|
|
18
18
|
import "hammerjs";
|
|
19
19
|
import "@realsee/five";
|
|
20
20
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
21
21
|
import "../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
22
22
|
import "../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
23
|
-
import { notNil as
|
|
24
|
-
import { TagUtil as
|
|
25
|
-
import { getFloorIndex as
|
|
26
|
-
import { safeObj as
|
|
23
|
+
import { notNil as q } from "../../shared-utils/isNil.js";
|
|
24
|
+
import { TagUtil as H } from "./TagUtil.js";
|
|
25
|
+
import { getFloorIndex as N } from "../../shared-utils/five/getFloorIndex.js";
|
|
26
|
+
import { safeObj as U } from "../../shared-utils/safeObj.js";
|
|
27
27
|
import { toArray as W } from "../../shared-utils/util.js";
|
|
28
28
|
import "../../shared-utils/three/centerPoint.js";
|
|
29
29
|
import "../../shared-utils/positionToVector3.js";
|
|
@@ -64,8 +64,8 @@ import "../utils/tag/adaptConfig.js";
|
|
|
64
64
|
import "../../shared-utils/typescript/entries.js";
|
|
65
65
|
import "../../shared-utils/url/getUrl.js";
|
|
66
66
|
import "../../shared-utils/five/transformPosition.js";
|
|
67
|
-
const
|
|
68
|
-
class Je extends
|
|
67
|
+
const C = new F.Raycaster();
|
|
68
|
+
class Je extends H {
|
|
69
69
|
constructor(e) {
|
|
70
70
|
super(e);
|
|
71
71
|
}
|
|
@@ -73,80 +73,87 @@ class Je extends N {
|
|
|
73
73
|
* @description: 获取是否可见
|
|
74
74
|
*/
|
|
75
75
|
getVisible(e, i) {
|
|
76
|
-
const f =
|
|
76
|
+
const f = x(x({}, this.five.getCurrentState()), i), { panoIndex: t, mode: o } = f, d = y(o) ? this.getPanoIndexCache({ panoIndex: t, id: e.id }) : void 0;
|
|
77
77
|
if ((d == null ? void 0 : d.visible) !== void 0)
|
|
78
78
|
return d.visible;
|
|
79
79
|
{
|
|
80
|
-
const
|
|
81
|
-
var r,
|
|
80
|
+
const s = [], c = (() => {
|
|
81
|
+
var r, a, u, m, v, g, P;
|
|
82
82
|
const n = (r = this.getTagConfig(e).visibleConfig) != null ? r : {};
|
|
83
83
|
if (typeof n == "function")
|
|
84
|
-
return { value: n(this.five, { tag: e, distance: this.getDistance(e) }), checkedList:
|
|
84
|
+
return { value: n(this.five, { tag: e, distance: this.getDistance(e) }), checkedList: s, reason: "config function result" };
|
|
85
85
|
if (n.keep === "hidden")
|
|
86
|
-
return { value: !1, checkedList:
|
|
86
|
+
return { value: !1, checkedList: s, reason: "config.keep is hidden" };
|
|
87
87
|
if (n.keep === "visible")
|
|
88
|
-
return { value: !0, checkedList:
|
|
88
|
+
return { value: !0, checkedList: s, reason: "config.keep is visible" };
|
|
89
89
|
if (n.visibleFiveMode !== void 0) {
|
|
90
|
-
const
|
|
91
|
-
let
|
|
92
|
-
if (Array.isArray(
|
|
90
|
+
const l = typeof n.visibleFiveMode == "function" ? n.visibleFiveMode(e) : n.visibleFiveMode;
|
|
91
|
+
let p = !1;
|
|
92
|
+
if (Array.isArray(l) ? p = l.includes(o) : l === "ModelLike" ? p = Z(o) : l === "PanoramaLike" ? p = !y(o) : l === "all" ? p = !0 : typeof l == "string" && (p = l === o), p === !1)
|
|
93
93
|
return {
|
|
94
94
|
value: !1,
|
|
95
|
-
checkedList:
|
|
95
|
+
checkedList: s,
|
|
96
96
|
reason: "current mode is not included in visibleFiveMode",
|
|
97
97
|
visibleFiveMode: n.visibleFiveMode,
|
|
98
|
-
mode:
|
|
98
|
+
mode: o
|
|
99
99
|
};
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
} else if (n.visibleFiveMode === void 0 && ((a = this.five.getCurrentState()) == null ? void 0 : a.mode) !== ((m = (u = e.fiveState) == null ? void 0 : u.mode) != null ? m : "Panorama"))
|
|
101
|
+
return {
|
|
102
|
+
value: !1,
|
|
103
|
+
checkedList: s,
|
|
104
|
+
reason: "current mode is not equal to tag.fiveState.mode",
|
|
105
|
+
tagFiveMode: (v = e.fiveState) == null ? void 0 : v.mode,
|
|
106
|
+
mode: o
|
|
107
|
+
};
|
|
108
|
+
if (n.followModelVisibility === !0 && (o === "Floorplan" || o === "Mapview") && this.getVisibleByFloorIndex(e) === !1)
|
|
109
|
+
return { value: !1, checkedList: s, reason: "followModelVisibility check failed" };
|
|
110
|
+
if (y(o) && n.visiblePanoIndex !== void 0 && n.visiblePanoIndex !== "all" && t !== void 0) {
|
|
111
|
+
if (s.push("visiblePanoIndex"), Array.isArray(n.visiblePanoIndex) && !n.visiblePanoIndex.includes(t))
|
|
105
112
|
return {
|
|
106
113
|
value: !1,
|
|
107
|
-
checkedList:
|
|
114
|
+
checkedList: s,
|
|
108
115
|
reason: `current panoIndex is not included in visiblePano. currentPanoIndex: ${t}, visiblePanoIndex: ${n.visiblePanoIndex}`
|
|
109
116
|
};
|
|
110
|
-
if (n.visiblePanoIndex === "current" && t !== ((
|
|
117
|
+
if (n.visiblePanoIndex === "current" && t !== ((g = e.fiveState) == null ? void 0 : g.panoIndex))
|
|
111
118
|
return {
|
|
112
119
|
value: !1,
|
|
113
|
-
checkedList:
|
|
114
|
-
reason: `current panoIndex is not equal to tag.panoIndex. currentPanoIndex: ${t}, tag.panoIndex: ${(
|
|
120
|
+
checkedList: s,
|
|
121
|
+
reason: `current panoIndex is not equal to tag.panoIndex. currentPanoIndex: ${t}, tag.panoIndex: ${(P = e.fiveState) == null ? void 0 : P.panoIndex}`
|
|
115
122
|
};
|
|
116
123
|
}
|
|
117
|
-
if (n.visibleDistance !== void 0 && (
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
124
|
+
if (n.visibleDistance !== void 0 && (s.push("visibleDistance"), n.visibleDistance !== "unLimited")) {
|
|
125
|
+
const l = this.getDistance(e);
|
|
126
|
+
if (h(l, n.visibleDistance) === !1)
|
|
120
127
|
return {
|
|
121
128
|
value: !1,
|
|
122
|
-
checkedList:
|
|
123
|
-
reason: `distance is not in visibleDistance. distance: ${
|
|
129
|
+
checkedList: s,
|
|
130
|
+
reason: `distance is not in visibleDistance. distance: ${l}, visibleDistance: ${n.visibleDistance}`
|
|
124
131
|
};
|
|
125
132
|
}
|
|
126
|
-
if (
|
|
127
|
-
|
|
128
|
-
const
|
|
129
|
-
if (
|
|
130
|
-
return { value: !1, checkedList:
|
|
133
|
+
if (y(o) && n.angleRange && z(e)) {
|
|
134
|
+
s.push("angleRange");
|
|
135
|
+
const l = this.getAngle(e);
|
|
136
|
+
if (h(l, n.angleRange) === !1)
|
|
137
|
+
return { value: !1, checkedList: s, reason: `angle is not in angleRange. angle: ${l}, angleRange: ${n.angleRange}` };
|
|
131
138
|
}
|
|
132
139
|
if (n.intersectRaycaster !== !1 && (typeof n.intersectRaycaster != "object" || n.intersectRaycaster.enabled !== !1)) {
|
|
133
|
-
if (
|
|
140
|
+
if (s.push("intersectRaycaster"), t === void 0)
|
|
134
141
|
return {
|
|
135
142
|
value: !1,
|
|
136
|
-
checkedList:
|
|
143
|
+
checkedList: s,
|
|
137
144
|
reason: `intersectRaycaster check failed: panoIndex is ${t}`
|
|
138
145
|
};
|
|
139
|
-
const
|
|
140
|
-
if (
|
|
141
|
-
return Object.assign(
|
|
146
|
+
const l = this.getTagEnableByIntersect(e, t);
|
|
147
|
+
if (l.value === !1)
|
|
148
|
+
return Object.assign(l, { checkedList: s });
|
|
142
149
|
}
|
|
143
150
|
return {
|
|
144
151
|
value: !0,
|
|
145
|
-
checkedList:
|
|
152
|
+
checkedList: s,
|
|
146
153
|
reason: "all check passed"
|
|
147
154
|
};
|
|
148
155
|
})();
|
|
149
|
-
return d && (d.visible =
|
|
156
|
+
return d && (d.visible = c.value, d.__debug_visible_reason__ = c), c.value;
|
|
150
157
|
}
|
|
151
158
|
}
|
|
152
159
|
/**
|
|
@@ -159,22 +166,22 @@ class Je extends N {
|
|
|
159
166
|
if (t.unfolded !== void 0)
|
|
160
167
|
return t.unfolded;
|
|
161
168
|
{
|
|
162
|
-
const
|
|
163
|
-
if (!
|
|
169
|
+
const o = this.getTagConfig(e).unfoldedConfig;
|
|
170
|
+
if (!o)
|
|
164
171
|
return;
|
|
165
172
|
const d = (() => {
|
|
166
|
-
if (typeof
|
|
167
|
-
return
|
|
168
|
-
if (
|
|
173
|
+
if (typeof o == "function")
|
|
174
|
+
return o(this.five, { tag: e, distance: this.getDistance(e) });
|
|
175
|
+
if (o.keep === "folded")
|
|
169
176
|
return !1;
|
|
170
|
-
if (
|
|
177
|
+
if (o.keep === "unfolded")
|
|
171
178
|
return !0;
|
|
172
|
-
if (
|
|
179
|
+
if (o.unfoldDistance && h(this.getDistance(e), o.unfoldDistance) === !1)
|
|
173
180
|
return !1;
|
|
174
181
|
})();
|
|
175
182
|
t.unfolded = d;
|
|
176
|
-
const
|
|
177
|
-
return
|
|
183
|
+
const s = this.getUnfoldedByCamera(e);
|
|
184
|
+
return s !== void 0 ? s : t.unfolded;
|
|
178
185
|
}
|
|
179
186
|
}
|
|
180
187
|
/**
|
|
@@ -182,7 +189,7 @@ class Je extends N {
|
|
|
182
189
|
*/
|
|
183
190
|
getUnfoldedByCamera(e) {
|
|
184
191
|
return this.getCurrentVisibleState(e) ? (() => {
|
|
185
|
-
var
|
|
192
|
+
var o;
|
|
186
193
|
const t = this.getTagConfig(e).unfoldedConfig;
|
|
187
194
|
if (t) {
|
|
188
195
|
if (typeof t == "function")
|
|
@@ -195,24 +202,24 @@ class Je extends N {
|
|
|
195
202
|
return;
|
|
196
203
|
if (t.autoUnfold.strategy === "ScreenPostion") {
|
|
197
204
|
const d = this.getTagProject(e);
|
|
198
|
-
if (d &&
|
|
205
|
+
if (d && h(d.x, t.autoUnfold.autoUnfoldProjectX) === !1)
|
|
199
206
|
return !1;
|
|
200
207
|
}
|
|
201
208
|
if (t.autoUnfold.strategy === "MinimumDistance") {
|
|
202
|
-
const
|
|
203
|
-
const
|
|
204
|
-
if (!
|
|
209
|
+
const c = this.filterPointTag.filter((r) => this.getCurrentVisibleState(r)).filter((r) => {
|
|
210
|
+
const a = this.getTagProject(r);
|
|
211
|
+
if (!a)
|
|
205
212
|
return !1;
|
|
206
|
-
const { x:
|
|
207
|
-
return !(Math.abs(
|
|
208
|
-
}).map((r) => ({ tag: r, id: r.id, tagConfig: this.getTagConfig(r).unfoldedConfig })).filter(({ tag: r, tagConfig:
|
|
209
|
-
var
|
|
210
|
-
return !(typeof
|
|
211
|
-
}).map((r) =>
|
|
212
|
-
const
|
|
213
|
-
return !(
|
|
214
|
-
}).sort((r,
|
|
215
|
-
if (
|
|
213
|
+
const { x: u, y: m, z: v } = a;
|
|
214
|
+
return !(Math.abs(v) > 1 || Math.abs(u) > 1 || Math.abs(m) > 1);
|
|
215
|
+
}).map((r) => ({ tag: r, id: r.id, tagConfig: this.getTagConfig(r).unfoldedConfig })).filter(({ tag: r, tagConfig: a }) => {
|
|
216
|
+
var u, m;
|
|
217
|
+
return !(typeof a == "function" || a.keep || a.autoUnfold === !1 || ((u = a.autoUnfold) == null ? void 0 : u.enable) === !1 || ((m = a.autoUnfold) == null ? void 0 : m.strategy) !== "MinimumDistance");
|
|
218
|
+
}).map((r) => D(x({}, r), { distance: this.getDistance(r.tag) })).filter(({ distance: r, tagConfig: a }) => {
|
|
219
|
+
const u = a.autoUnfold.distance;
|
|
220
|
+
return !(u && h(r, u) === !1);
|
|
221
|
+
}).sort((r, a) => r.distance - a.distance).findIndex((r) => r.id === e.id);
|
|
222
|
+
if (c === -1 || c <= ((o = t.autoUnfold.maxNumber) != null ? o : 1) - 1 === !1)
|
|
216
223
|
return !1;
|
|
217
224
|
}
|
|
218
225
|
return !0;
|
|
@@ -247,59 +254,59 @@ class Je extends N {
|
|
|
247
254
|
* @description 一个点的标签
|
|
248
255
|
*/
|
|
249
256
|
getTagProject(e) {
|
|
250
|
-
const i =
|
|
257
|
+
const i = I(e);
|
|
251
258
|
if (!i)
|
|
252
259
|
return;
|
|
253
|
-
const { x: f, y: t, z:
|
|
254
|
-
if (!(
|
|
255
|
-
return { x: f, y: t, z:
|
|
260
|
+
const { x: f, y: t, z: o } = i.project(this.five.camera);
|
|
261
|
+
if (!(o > 1))
|
|
262
|
+
return { x: f, y: t, z: o };
|
|
256
263
|
}
|
|
257
264
|
/** 通过射线检测标签可用性 */
|
|
258
265
|
getTagEnableByIntersect(e, i) {
|
|
259
|
-
var n, r,
|
|
260
|
-
const f =
|
|
261
|
-
if (
|
|
266
|
+
var n, r, a, u, m;
|
|
267
|
+
const f = U(U((n = this.getTagConfig(e).visibleConfig) != null ? n : {}).intersectRaycaster), t = i != null ? i : this.five.getCurrentState().panoIndex, o = y(this.five.getCurrentState().mode) ? this.getObserverPosition(t) : this.five.camera.position;
|
|
268
|
+
if (o === void 0)
|
|
262
269
|
return { value: !1, reason: { type: "startPosition is undefined", fivePanoIndex: t } };
|
|
263
270
|
const d = W(
|
|
264
271
|
(() => {
|
|
265
272
|
var g;
|
|
266
|
-
const
|
|
267
|
-
return
|
|
273
|
+
const v = (g = f.checkPoints) != null ? g : "center";
|
|
274
|
+
return v === "center" ? I(e) : v === "corner" ? O(e) : Array.isArray(v) ? v : [];
|
|
268
275
|
})()
|
|
269
276
|
);
|
|
270
|
-
let
|
|
271
|
-
for (const
|
|
272
|
-
const g = new
|
|
273
|
-
|
|
274
|
-
const
|
|
275
|
-
if (!
|
|
277
|
+
let s = 0, c = 0;
|
|
278
|
+
for (const v of d) {
|
|
279
|
+
const g = new F.Vector3().subVectors(v, o).normalize();
|
|
280
|
+
C.set(o, g);
|
|
281
|
+
const P = o.distanceTo(v), [l] = this.five.model.intersectRaycaster(C), p = (() => {
|
|
282
|
+
if (!R(e))
|
|
276
283
|
return;
|
|
277
|
-
const V = this.tags.filter(
|
|
278
|
-
var
|
|
279
|
-
return (
|
|
280
|
-
}).filter(
|
|
284
|
+
const V = this.tags.filter(R).map((A) => {
|
|
285
|
+
var T;
|
|
286
|
+
return (T = A.model) == null ? void 0 : T.object;
|
|
287
|
+
}).filter(q), [B] = C.intersectObjects(V, !0);
|
|
281
288
|
return B;
|
|
282
|
-
})(),
|
|
283
|
-
Math.min((
|
|
284
|
-
const
|
|
285
|
-
if (
|
|
289
|
+
})(), S = (r = f.distanceAccuracy) != null ? r : 0.01;
|
|
290
|
+
Math.min((a = l == null ? void 0 : l.distance) != null ? a : 1 / 0, (u = p == null ? void 0 : p.distance) != null ? u : 1 / 0) + S >= P ? s++ : c++;
|
|
291
|
+
const j = (m = f.needPassed) != null ? m : 1;
|
|
292
|
+
if (s >= j)
|
|
286
293
|
return { value: !0 };
|
|
287
294
|
}
|
|
288
|
-
return
|
|
295
|
+
return c === 0 ? { value: !0 } : {
|
|
289
296
|
value: !1,
|
|
290
297
|
reason: {
|
|
291
298
|
type: "intersectRaycaster check failed",
|
|
292
|
-
passedCount:
|
|
299
|
+
passedCount: s,
|
|
293
300
|
needPassed: f.needPassed
|
|
294
301
|
}
|
|
295
302
|
};
|
|
296
303
|
}
|
|
297
304
|
/** 检测是否匹配当前楼层 */
|
|
298
305
|
getVisibleByFloorIndex(e) {
|
|
299
|
-
var
|
|
306
|
+
var o, d, s, c, n, r, a;
|
|
300
307
|
let i = 0;
|
|
301
|
-
const f = (
|
|
302
|
-
f !== void 0 ? i = (d = this.work.observers[f]) == null ? void 0 : d.floorIndex : i =
|
|
308
|
+
const f = (o = e.fiveState) == null ? void 0 : o.panoIndex;
|
|
309
|
+
f !== void 0 ? i = (d = this.work.observers[f]) == null ? void 0 : d.floorIndex : i = N(this.work, (a = (r = (c = (s = e.model) == null ? void 0 : s.object) == null ? void 0 : c.position) != null ? r : (n = e.mediaPlane) == null ? void 0 : n.position) != null ? a : I(e));
|
|
303
310
|
const t = this.five.model.shownFloor;
|
|
304
311
|
return t === null || t === i;
|
|
305
312
|
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var w = (a, s, e) => s in a ?
|
|
1
|
+
var K = Object.defineProperty, Q = Object.defineProperties;
|
|
2
|
+
var Y = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var B = Object.getOwnPropertySymbols;
|
|
4
|
+
var Z = Object.prototype.hasOwnProperty, ee = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var w = (a, s, e) => s in a ? K(a, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[s] = e, M = (a, s) => {
|
|
6
6
|
for (var e in s || (s = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
|
|
7
|
+
Z.call(s, e) && w(a, e, s[e]);
|
|
8
|
+
if (B)
|
|
9
|
+
for (var e of B(s))
|
|
10
|
+
ee.call(s, e) && w(a, e, s[e]);
|
|
11
11
|
return a;
|
|
12
|
-
},
|
|
12
|
+
}, N = (a, s) => Q(a, Y(s));
|
|
13
13
|
var d = (a, s, e) => (w(a, typeof s != "symbol" ? s + "" : s, e), e);
|
|
14
|
-
import { defaultGlobalConfig as
|
|
14
|
+
import { defaultGlobalConfig as ie } from "../typings/tag/TagConfig.js";
|
|
15
15
|
import { objectAssignDeepExports as y } from "../../vendor/object-assign-deep/objectAssignDeep.js";
|
|
16
|
-
import * as
|
|
17
|
-
import { DefaultConfig as
|
|
16
|
+
import * as te from "three";
|
|
17
|
+
import { DefaultConfig as oe } from "../tag.config.js";
|
|
18
18
|
import { anyPositionToVector3 as C } from "../../shared-utils/positionToVector3.js";
|
|
19
19
|
import { planeNormal as E } from "../utils/planeNormal.js";
|
|
20
|
-
import { getTagCenterPosition as
|
|
21
|
-
import { normalPositionToPositions as
|
|
22
|
-
import { TagCache as
|
|
23
|
-
import { writable as
|
|
24
|
-
import { isIOSWX as
|
|
25
|
-
import { Five as
|
|
26
|
-
import { isMediaPlaneTag as
|
|
27
|
-
import { VideoPlane as
|
|
28
|
-
import { FiveDomEvents as
|
|
29
|
-
import
|
|
30
|
-
import { isPanoramaLike as A, isModelLike as
|
|
20
|
+
import { getTagCenterPosition as $ } from "../utils/tagPosition.js";
|
|
21
|
+
import { normalPositionToPositions as re } from "../utils/normalPositionToPositions.js";
|
|
22
|
+
import { TagCache as ne } from "./TagCache.js";
|
|
23
|
+
import { writable as se } from "../../vendor/svelte/store/index.js";
|
|
24
|
+
import { isIOSWX as fe } from "../../shared-utils/device.js";
|
|
25
|
+
import { Five as ae } from "@realsee/five";
|
|
26
|
+
import { isMediaPlaneTag as ce, isMediaModelTag as z, isPlaneTag as le, isPoint3DTag as de } from "../utils/tag/tagCheck.js";
|
|
27
|
+
import { VideoPlane as ue } from "../utils/model/mediaPlane.js";
|
|
28
|
+
import { FiveDomEvents as pe } from "../../shared-utils/five/FiveDomEvents.js";
|
|
29
|
+
import H from "../utils/tag/adaptConfig.js";
|
|
30
|
+
import { isPanoramaLike as A, isModelLike as J } from "../../shared-utils/five/mode.js";
|
|
31
31
|
import "hammerjs";
|
|
32
32
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
33
33
|
import "../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
34
34
|
import "../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
35
|
-
import { entries as
|
|
36
|
-
import { getUrlExt as
|
|
35
|
+
import { entries as U } from "../../shared-utils/typescript/entries.js";
|
|
36
|
+
import { getUrlExt as G } from "../../shared-utils/url/getUrl.js";
|
|
37
37
|
import { transformPosition as O } from "../../shared-utils/five/transformPosition.js";
|
|
38
38
|
import "../../shared-utils/three/centerPoint.js";
|
|
39
39
|
import "../../base/BasePlugin.js";
|
|
@@ -60,12 +60,12 @@ import "../../shared-utils/three/getPositionsByObjectFit.js";
|
|
|
60
60
|
import "../../shared-utils/three/FragmentTransparencyMaterial.js";
|
|
61
61
|
import "../../shared-utils/three/getNormal.js";
|
|
62
62
|
import "../../shared-utils/five/calculateThreeMouse.js";
|
|
63
|
-
class
|
|
63
|
+
class ci extends ne {
|
|
64
64
|
constructor(e) {
|
|
65
65
|
super(e);
|
|
66
66
|
d(this, "tags", []);
|
|
67
|
-
d(this, "config",
|
|
68
|
-
d(this, "mediaStore",
|
|
67
|
+
d(this, "config", oe);
|
|
68
|
+
d(this, "mediaStore", se({
|
|
69
69
|
currentMediaElement: null
|
|
70
70
|
}));
|
|
71
71
|
/** css3DRenderPlugin */
|
|
@@ -76,7 +76,7 @@ class ai extends re {
|
|
|
76
76
|
resizeObserverDisposerAdding: !1,
|
|
77
77
|
css3DRenderDisposer: /* @__PURE__ */ new Map()
|
|
78
78
|
});
|
|
79
|
-
d(this, "domEvents", new
|
|
79
|
+
d(this, "domEvents", new pe(this.five));
|
|
80
80
|
d(this, "_workCode");
|
|
81
81
|
d(this, "getObserverPosition", (e) => {
|
|
82
82
|
var o, t;
|
|
@@ -85,12 +85,12 @@ class ai extends re {
|
|
|
85
85
|
return O(i.position, (t = this.work) == null ? void 0 : t.options.transform);
|
|
86
86
|
});
|
|
87
87
|
d(this, "loadVideoFirstFrame", () => {
|
|
88
|
-
|
|
88
|
+
fe && this.hooks.emit("loadVideoFirstFrame");
|
|
89
89
|
});
|
|
90
90
|
this.mediaStore.subscribe(({ currentMediaElement: i }) => {
|
|
91
91
|
this.tags.forEach((o) => {
|
|
92
92
|
var t;
|
|
93
|
-
if (o.mediaPlane instanceof
|
|
93
|
+
if (o.mediaPlane instanceof ue && i !== o.mediaPlane.videoInstance) {
|
|
94
94
|
if (!((t = o.mediaPlane.videoInstance) != null && t.src) || i === o.mediaPlane.videoInstance)
|
|
95
95
|
return;
|
|
96
96
|
o.mediaPlane.pause();
|
|
@@ -172,15 +172,15 @@ class ai extends re {
|
|
|
172
172
|
return;
|
|
173
173
|
const t = e.data.mediaData;
|
|
174
174
|
if (!(!t || t.length === 0) && o.renderType === "Mesh") {
|
|
175
|
-
if (
|
|
175
|
+
if (ce(e)) {
|
|
176
176
|
if (t.length === 1) {
|
|
177
177
|
if (t[0].type === "Video")
|
|
178
178
|
return "Mesh";
|
|
179
179
|
if (t[0].type === "Image")
|
|
180
|
-
return
|
|
180
|
+
return G(t[0].url) === "gif" ? "Dom" : "Mesh";
|
|
181
181
|
}
|
|
182
|
-
} else if (
|
|
183
|
-
return t.length === 1 && t[0].type === "Image" ?
|
|
182
|
+
} else if (z(e))
|
|
183
|
+
return t.length === 1 && t[0].type === "Image" ? G(t[0].url) === "gif" ? "Dom" : "Mesh" : "BehindDom";
|
|
184
184
|
}
|
|
185
185
|
})();
|
|
186
186
|
return i != null ? i : "Dom";
|
|
@@ -202,10 +202,10 @@ class ai extends re {
|
|
|
202
202
|
const r = (() => e.stickType === "3DPoint" ? C(e.normal) : E(e.position))();
|
|
203
203
|
if (!r)
|
|
204
204
|
return;
|
|
205
|
-
const f =
|
|
205
|
+
const f = $(e);
|
|
206
206
|
if (!f)
|
|
207
207
|
return;
|
|
208
|
-
const c = new
|
|
208
|
+
const c = new te.Vector3().copy(n).sub(f), g = r.angleTo(c) * 180 / Math.PI;
|
|
209
209
|
return t.angle = g, t.angle;
|
|
210
210
|
}
|
|
211
211
|
}
|
|
@@ -216,7 +216,7 @@ class ai extends re {
|
|
|
216
216
|
const o = M(M({}, this.five.getCurrentState()), i), { panoIndex: t, mode: n } = o, r = A(n) ? this.getPanoIndexCache({ panoIndex: t, id: e.id }) : void 0;
|
|
217
217
|
if ((r == null ? void 0 : r.distance) !== void 0)
|
|
218
218
|
return r.distance;
|
|
219
|
-
const f =
|
|
219
|
+
const f = $(e);
|
|
220
220
|
if (!f)
|
|
221
221
|
return -1;
|
|
222
222
|
if (A(n)) {
|
|
@@ -226,16 +226,16 @@ class ai extends re {
|
|
|
226
226
|
const g = c.distanceTo(f);
|
|
227
227
|
return r && (r.distance = g), g;
|
|
228
228
|
}
|
|
229
|
-
if (
|
|
229
|
+
if (J(n))
|
|
230
230
|
return this.five.camera.position.distanceTo(f);
|
|
231
231
|
}
|
|
232
232
|
getPositions(e) {
|
|
233
|
-
if (
|
|
233
|
+
if (le(e))
|
|
234
234
|
return e.position;
|
|
235
|
-
if (
|
|
235
|
+
if (z(e))
|
|
236
236
|
return e.data.mediaPosition;
|
|
237
|
-
if (
|
|
238
|
-
return
|
|
237
|
+
if (de(e))
|
|
238
|
+
return re(this.five.camera.position, C(e.position), C(e.normal));
|
|
239
239
|
}
|
|
240
240
|
addObjectClickHandler(e, i, o) {
|
|
241
241
|
if (!i || !this.domEvents)
|
|
@@ -300,7 +300,7 @@ class ai extends re {
|
|
|
300
300
|
* @description: 获取merge后的配置
|
|
301
301
|
*/
|
|
302
302
|
calculateTagConfig(e, i) {
|
|
303
|
-
var j, S, I, W, F;
|
|
303
|
+
var j, S, I, W, F, V;
|
|
304
304
|
const o = (j = i == null ? void 0 : i.useCache) != null ? j : !0;
|
|
305
305
|
if (!e)
|
|
306
306
|
return (S = this.config.globalConfig) != null ? S : {};
|
|
@@ -312,8 +312,8 @@ class ai extends re {
|
|
|
312
312
|
}
|
|
313
313
|
const t = {}, n = {}, r = {};
|
|
314
314
|
this.config.contentTypeConfig && Object.entries(this.config.contentTypeConfig).forEach(([u, p]) => {
|
|
315
|
-
var
|
|
316
|
-
const l = u, D = l.split("-"),
|
|
315
|
+
var _, x;
|
|
316
|
+
const l = u, D = l.split("-"), L = u.startsWith("["), T = L ? D[0].slice(1, -1) : void 0, h = L ? D.slice(1) : D, v = T ? ["PanoramaLike", "ModelLike"].includes(T) ? (_ = n[T]) != null ? _ : n[T] = {} : (x = r[T]) != null ? x : r[T] = {} : t;
|
|
317
317
|
if (!v[l]) {
|
|
318
318
|
if (h.length === 0 && (v[l] = p), h.length === 1) {
|
|
319
319
|
const [m] = h;
|
|
@@ -324,26 +324,26 @@ class ai extends re {
|
|
|
324
324
|
m === "Mixin" && e.contentType === P && (v[l] = p), (e.stickType === m || m === "Any") && (e.contentType === P || P === "Any") && (v[l] = p);
|
|
325
325
|
}
|
|
326
326
|
if (h.length === 3) {
|
|
327
|
-
const [m = "Any", P,
|
|
327
|
+
const [m = "Any", P, q] = h;
|
|
328
328
|
if (P === "Audio" && e.contentType === "Audio") {
|
|
329
|
-
const
|
|
330
|
-
(
|
|
329
|
+
const R = e;
|
|
330
|
+
(R.stickType === m || m === "Any") && R.data.appearance === q && (v[l] = p);
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
});
|
|
335
|
-
const f = (F = e.initialConfig) != null ? F : {}, c = y({},
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
(u === "PanoramaLike" && A(l) || u === "ModelLike" &&
|
|
335
|
+
const f = (V = (F = e.initialConfig) != null ? F : e.config) != null ? V : {}, c = y({}, ie, this.config.globalConfig, ...Object.values(t)), g = y({}, c, f), k = {}, X = Object.values(ae.Mode);
|
|
336
|
+
U(n).forEach(([u, p]) => {
|
|
337
|
+
X.forEach((l) => {
|
|
338
|
+
(u === "PanoramaLike" && A(l) || u === "ModelLike" && J(l)) && (k[l] = y({}, c, ...Object.values(p), f, { _isMerged: !0 }));
|
|
339
339
|
});
|
|
340
|
-
}),
|
|
340
|
+
}), U(r).forEach(([u, p]) => {
|
|
341
341
|
k[u] = y({}, c, ...Object.values(p), f, { _isMerged: !0 });
|
|
342
342
|
});
|
|
343
|
-
const b =
|
|
344
|
-
return
|
|
343
|
+
const b = N(M({}, g), { configWithFiveMode: k });
|
|
344
|
+
return H(b), Object.values(k).forEach((u) => H(u)), b._isMerged = !0, b;
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
export {
|
|
348
|
-
|
|
348
|
+
ci as TagUtil
|
|
349
349
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export default function adaptConfig(config: TagConfig
|
|
1
|
+
import type { TagConfig } from '../..';
|
|
2
|
+
export default function adaptConfig(config: TagConfig): TagConfig<"Panorama" | "Model" | "Custom" | "Audio" | "Text" | "ImageText" | "Image" | "Video" | "Link" | "Sticker" | "VRLink" | "PanoLink" | "Marketing" | "MediaPlane" | "MediaModel" | "Unknown">;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function
|
|
2
|
-
var
|
|
3
|
-
typeof e.visibleConfig == "object" &&
|
|
4
|
-
const i = (
|
|
1
|
+
function f(e) {
|
|
2
|
+
var l, d;
|
|
3
|
+
typeof e.visibleConfig == "object" && e.visibleConfig.keep && (e.visibleConfig.keep === "visible" ? e.visibleConfig = { keep: e.visibleConfig.keep, visibleFiveMode: (l = e.visibleConfig) == null ? void 0 : l.visibleFiveMode } : e.visibleConfig.keep === "hidden" && (e.visibleConfig = { keep: e.visibleConfig.keep })), typeof e.unfoldedConfig == "object" && (e.unfoldedConfig.disableFold && (e.unfoldedConfig = { keep: "unfolded" }), e.unfoldedConfig.disableUnfold && (e.unfoldedConfig = { keep: "folded" }), e.unfoldedConfig.keep && (e.unfoldedConfig = { keep: e.unfoldedConfig.keep }));
|
|
4
|
+
const i = (d = e.initialState) != null ? d : {};
|
|
5
5
|
return typeof e.unfoldedConfig == "object" && (e.unfoldedConfig.keep === "unfolded" ? i.unfolded = !0 : e.unfoldedConfig.keep === "folded" && (i.unfolded = !1)), typeof e.visibleConfig == "object" && (e.visibleConfig.keep === "visible" ? i.visible = !0 : e.visibleConfig.keep === "hidden" && (i.visible = !1)), e.initialState = i, e;
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
f as default
|
|
9
9
|
};
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.8.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.8.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",
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"repository": "https://github.com/realsee-developer/dnalogel.git",
|
|
8
8
|
"description": "如视 VR 看房插件合集",
|
|
9
9
|
"private": false,
|
|
10
|
-
"version": "3.8.
|
|
10
|
+
"version": "3.8.4",
|
|
11
11
|
"license": "SEE LICENSE IN TERMS.txt",
|
|
12
12
|
"scripts": {
|
|
13
13
|
"clean": "rm -rf components dist docs libs types ./vite.config.js.timestamp*",
|