@realsee/dnalogel 3.35.0-dev.0 → 3.35.0-dev.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/dist/PanoTagPlugin/controller/TagRender.d.ts +2 -1
- package/dist/PanoTagPlugin/controller/TagUtil.d.ts +11 -6
- package/dist/PanoTagPlugin/controller/index.d.ts +1 -0
- package/dist/PanoTagPlugin/utils/debounce.d.ts +1 -0
- package/dist/index.cjs.js +54 -54
- package/dist/index.js +3078 -3063
- package/dist/index.umd.js +44 -44
- package/libs/PanoTagPlugin/controller/TagComputer.js +2 -0
- package/libs/PanoTagPlugin/controller/TagRender.d.ts +2 -1
- package/libs/PanoTagPlugin/controller/TagRender.js +67 -63
- package/libs/PanoTagPlugin/controller/TagUtil.d.ts +11 -6
- package/libs/PanoTagPlugin/controller/TagUtil.js +106 -107
- package/libs/PanoTagPlugin/controller/index.d.ts +1 -0
- package/libs/PanoTagPlugin/controller/index.js +67 -61
- package/libs/PanoTagPlugin/utils/debounce.d.ts +1 -0
- package/libs/PanoTagPlugin/utils/debounce.js +10 -4
- package/libs/PanoTagPlugin/utils/index.js +7 -6
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
var Z = Object.defineProperty, q = Object.defineProperties;
|
|
2
2
|
var K = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
3
|
+
var L = Object.getOwnPropertySymbols;
|
|
4
4
|
var Q = Object.prototype.hasOwnProperty, Y = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
5
|
+
var _ = (l, s, e) => s in l ? Z(l, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[s] = e, D = (l, s) => {
|
|
6
6
|
for (var e in s || (s = {}))
|
|
7
|
-
Q.call(s, e) &&
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
Y.call(s, e) &&
|
|
7
|
+
Q.call(s, e) && _(l, e, s[e]);
|
|
8
|
+
if (L)
|
|
9
|
+
for (var e of L(s))
|
|
10
|
+
Y.call(s, e) && _(l, e, s[e]);
|
|
11
11
|
return l;
|
|
12
12
|
}, U = (l, s) => q(l, K(s));
|
|
13
|
-
var
|
|
13
|
+
var f = (l, s, e) => (_(l, typeof s != "symbol" ? s + "" : s, e), e);
|
|
14
14
|
import { defaultGlobalConfig as ee } from "../typings/tag/TagConfig.js";
|
|
15
|
-
import { objectAssignDeepExports as
|
|
15
|
+
import { objectAssignDeepExports as P } from "../../vendor/object-assign-deep/objectAssignDeep.js";
|
|
16
16
|
import * as ie from "three";
|
|
17
17
|
import { DefaultConfig as te } from "../tag.config.js";
|
|
18
|
-
import { anyPositionToVector3 as
|
|
19
|
-
import { planeNormal as
|
|
18
|
+
import { anyPositionToVector3 as y } from "../../shared-utils/positionToVector3.js";
|
|
19
|
+
import { planeNormal as E } from "../utils/planeNormal.js";
|
|
20
20
|
import { getTagCenterPosition as V } from "../utils/tagPosition.js";
|
|
21
21
|
import { normalPositionToPositions as oe } from "../utils/normalPositionToPositions.js";
|
|
22
22
|
import { TagCache as ne } from "./TagCache.js";
|
|
@@ -24,18 +24,18 @@ import { writable as re } from "../../vendor/svelte/store/index.js";
|
|
|
24
24
|
import { isIOSWX as se } from "../../shared-utils/device.js";
|
|
25
25
|
import { CSS3DRenderPlugin as fe } from "../../CSS3DRenderPlugin/index.js";
|
|
26
26
|
import { Five as ae } from "@realsee/five";
|
|
27
|
-
import { isMediaPlaneTag as
|
|
27
|
+
import { isMediaPlaneTag as ce, isMediaModelTag as B, isPlaneTag as le, isPoint3DTag as de } from "../utils/tag/tagCheck.js";
|
|
28
28
|
import { VideoPlane as ue } from "../utils/model/mediaPlane.js";
|
|
29
29
|
import { FiveDomEvents as me } from "../../shared-utils/five/FiveDomEvents.js";
|
|
30
30
|
import N from "../utils/tag/adaptConfig.js";
|
|
31
|
-
import { isPanoramaLike as
|
|
31
|
+
import { isPanoramaLike as w, isModelLike as z } from "../../shared-utils/five/mode.js";
|
|
32
32
|
import "hammerjs";
|
|
33
33
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
34
34
|
import "animejs";
|
|
35
35
|
import { entries as $ } from "../../shared-utils/typescript/entries.js";
|
|
36
36
|
import { getUrlExt as H } from "../../shared-utils/url/getUrl.js";
|
|
37
37
|
import { transformPosition as J } from "../../shared-utils/five/transformPosition.js";
|
|
38
|
-
import { WorkUtil as
|
|
38
|
+
import { WorkUtil as he } from "../../shared-utils/Utils/WorkUtil.js";
|
|
39
39
|
import "../../shared-utils/three/centerPoint.js";
|
|
40
40
|
import "../../base/BasePlugin.js";
|
|
41
41
|
import "../../shared-utils/Subscribe.js";
|
|
@@ -66,37 +66,32 @@ import "../../shared-utils/three/FragmentTransparencyMaterial.js";
|
|
|
66
66
|
import "../../shared-utils/three/getNormal.js";
|
|
67
67
|
import "../../shared-utils/five/calculateThreeMouse.js";
|
|
68
68
|
import "../../shared-utils/Utils/BaseUtil.js";
|
|
69
|
-
class
|
|
69
|
+
class gi extends ne {
|
|
70
70
|
constructor(e) {
|
|
71
71
|
super(e);
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
d(this, "workUtil", new pe(this.five));
|
|
72
|
+
f(this, "tags", []);
|
|
73
|
+
f(this, "config", te);
|
|
74
|
+
f(this, "workUtil", new he(this.five));
|
|
76
75
|
/** 插件参数 */
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
f(this, "params");
|
|
77
|
+
f(this, "mediaStore", re({
|
|
79
78
|
currentMediaElement: null
|
|
80
79
|
}));
|
|
81
|
-
|
|
80
|
+
f(this, "store", {
|
|
82
81
|
disposers: [],
|
|
83
82
|
disposed: !1,
|
|
84
83
|
resizeObserverDisposerAdding: !1,
|
|
85
84
|
css3DRenderDisposer: /* @__PURE__ */ new Map()
|
|
86
85
|
});
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
// )[]
|
|
97
|
-
d(this, "_container", null);
|
|
98
|
-
d(this, "_css3DRenderPlugin");
|
|
99
|
-
d(this, "loadVideoFirstFrame", () => {
|
|
86
|
+
f(this, "domEvents", new me(this.five));
|
|
87
|
+
f(this, "_cache_pointTag");
|
|
88
|
+
f(this, "_cache_2DPointTag");
|
|
89
|
+
f(this, "_cache_imagePlane");
|
|
90
|
+
f(this, "_cache_mediaModel");
|
|
91
|
+
f(this, "_cache_css3DTag");
|
|
92
|
+
f(this, "_container", null);
|
|
93
|
+
f(this, "_css3DRenderPlugin");
|
|
94
|
+
f(this, "loadVideoFirstFrame", () => {
|
|
100
95
|
se && this.hooks.emit("loadVideoFirstFrame");
|
|
101
96
|
});
|
|
102
97
|
this.mediaStore.subscribe(({ currentMediaElement: i }) => {
|
|
@@ -117,6 +112,17 @@ class hi extends ne {
|
|
|
117
112
|
set container(e) {
|
|
118
113
|
this._container = e;
|
|
119
114
|
}
|
|
115
|
+
// eslint-disable-next-line accessor-pairs
|
|
116
|
+
set tagsLengthWillUpdate(e) {
|
|
117
|
+
e && (this._cache_pointTag = this.tags.filter((i) => i.stickType === "2DPoint" || i.stickType === "3DPoint").filter((i) => i.position), this._cache_2DPointTag = this.tags.filter((i) => i.stickType === "2DPoint").filter((i) => i.position), this._cache_imagePlane = this.tags.filter(
|
|
118
|
+
(i) => i.contentType === "MediaPlane" && i.stickType === "Plane" && this.getRenderType(i) === "Mesh"
|
|
119
|
+
), this._cache_mediaModel = this.tags.filter((i) => i.stickType === "Model" && i.contentType === "MediaModel"), this._cache_css3DTag = this.tags.filter(
|
|
120
|
+
(i) => i.stickType === "3DPoint" || i.stickType === "Plane" || i.stickType === "Model" && i.contentType === "MediaModel"
|
|
121
|
+
).filter((i) => {
|
|
122
|
+
const o = this.getRenderType(i);
|
|
123
|
+
return o === "BehindDom" || o === "Dom";
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
120
126
|
set workCode(e) {
|
|
121
127
|
this.workUtil.workCode = e;
|
|
122
128
|
}
|
|
@@ -132,6 +138,21 @@ class hi extends ne {
|
|
|
132
138
|
}
|
|
133
139
|
return this._css3DRenderPlugin;
|
|
134
140
|
}
|
|
141
|
+
get filterPointTag() {
|
|
142
|
+
return this._cache_pointTag;
|
|
143
|
+
}
|
|
144
|
+
get filter2DPointTag() {
|
|
145
|
+
return this._cache_2DPointTag;
|
|
146
|
+
}
|
|
147
|
+
get filterImagePlane() {
|
|
148
|
+
return this._cache_imagePlane;
|
|
149
|
+
}
|
|
150
|
+
get filterMediaModel() {
|
|
151
|
+
return this._cache_mediaModel;
|
|
152
|
+
}
|
|
153
|
+
get filterCSS3DTag() {
|
|
154
|
+
return this._cache_css3DTag;
|
|
155
|
+
}
|
|
135
156
|
getTagById(e) {
|
|
136
157
|
const i = this.tags.find((o) => o.id === e);
|
|
137
158
|
if (!i) {
|
|
@@ -148,9 +169,9 @@ class hi extends ne {
|
|
|
148
169
|
* @description 获取标签配置
|
|
149
170
|
*/
|
|
150
171
|
getTagConfig(e, i) {
|
|
151
|
-
var r,
|
|
152
|
-
const o = this.calculateTagConfig(e, { useCache: i == null ? void 0 : i.useCache }), t = (r = i == null ? void 0 : i.fiveMode) != null ? r : this.five.getCurrentState().mode, n = (
|
|
153
|
-
return (
|
|
172
|
+
var r, a, d;
|
|
173
|
+
const o = this.calculateTagConfig(e, { useCache: i == null ? void 0 : i.useCache }), t = (r = i == null ? void 0 : i.fiveMode) != null ? r : this.five.getCurrentState().mode, n = (a = o.configWithFiveMode) == null ? void 0 : a[t];
|
|
174
|
+
return (d = n != null ? n : o) != null ? d : {};
|
|
154
175
|
}
|
|
155
176
|
/**
|
|
156
177
|
* @description 获取标签当前状态
|
|
@@ -166,7 +187,7 @@ class hi extends ne {
|
|
|
166
187
|
const o = this.getTagConfig(e);
|
|
167
188
|
if (e.config = o, e.config.initialData) {
|
|
168
189
|
const n = JSON.parse(JSON.stringify(e.data));
|
|
169
|
-
e.data = (t = o.initialData) != null && t.important ?
|
|
190
|
+
e.data = (t = o.initialData) != null && t.important ? P(e.data, n, o.initialData) : P(e.data, o.initialData, n);
|
|
170
191
|
}
|
|
171
192
|
});
|
|
172
193
|
}
|
|
@@ -197,7 +218,7 @@ class hi extends ne {
|
|
|
197
218
|
return;
|
|
198
219
|
const t = e.data.mediaData;
|
|
199
220
|
if (!(!t || t.length === 0) && o.renderType === "Mesh") {
|
|
200
|
-
if (
|
|
221
|
+
if (ce(e)) {
|
|
201
222
|
if (t.length === 1) {
|
|
202
223
|
if (t[0].type === "Video")
|
|
203
224
|
return navigator.userAgent.toLowerCase().indexOf("firefox") > -1 && navigator.userAgent.toLowerCase().indexOf("mobile") > -1 ? "Dom" : "Mesh";
|
|
@@ -224,43 +245,43 @@ class hi extends ne {
|
|
|
224
245
|
const n = this.workUtil.getObserverPosition(o);
|
|
225
246
|
if (n === void 0)
|
|
226
247
|
throw new Error(`getAngle(): observerPosition is ${n}`);
|
|
227
|
-
const r = (() => e.stickType === "3DPoint" ?
|
|
248
|
+
const r = (() => e.stickType === "3DPoint" ? y(e.normal) : E(e.position))();
|
|
228
249
|
if (!r)
|
|
229
250
|
return;
|
|
230
|
-
const
|
|
231
|
-
if (!
|
|
251
|
+
const a = V(e);
|
|
252
|
+
if (!a)
|
|
232
253
|
return;
|
|
233
|
-
const
|
|
234
|
-
return t.angle =
|
|
254
|
+
const d = new ie.Vector3().copy(n).sub(a), g = r.angleTo(d) * 180 / Math.PI;
|
|
255
|
+
return t.angle = g, t.angle;
|
|
235
256
|
}
|
|
236
257
|
}
|
|
237
258
|
/**
|
|
238
259
|
* @description 获取距离
|
|
239
260
|
*/
|
|
240
261
|
getDistance(e, i) {
|
|
241
|
-
const o =
|
|
262
|
+
const o = D(D({}, this.five.getCurrentState()), i), { panoIndex: t, mode: n } = o, r = w(n) ? this.getPanoIndexCache({ panoIndex: t, id: e.id }) : void 0;
|
|
242
263
|
if ((r == null ? void 0 : r.distance) !== void 0)
|
|
243
264
|
return r.distance;
|
|
244
|
-
const
|
|
245
|
-
if (!
|
|
265
|
+
const a = V(e);
|
|
266
|
+
if (!a)
|
|
246
267
|
return -1;
|
|
247
|
-
if (
|
|
248
|
-
const
|
|
249
|
-
if (
|
|
268
|
+
if (w(n)) {
|
|
269
|
+
const d = this.workUtil.getObserverPosition(t);
|
|
270
|
+
if (d === void 0)
|
|
250
271
|
return -1;
|
|
251
|
-
const
|
|
252
|
-
return r && (r.distance =
|
|
272
|
+
const g = d.distanceTo(a);
|
|
273
|
+
return r && (r.distance = g), g;
|
|
253
274
|
}
|
|
254
275
|
if (z(n))
|
|
255
|
-
return this.five.camera.position.distanceTo(
|
|
276
|
+
return this.five.camera.position.distanceTo(a);
|
|
256
277
|
}
|
|
257
278
|
getPositions(e) {
|
|
258
|
-
if (
|
|
279
|
+
if (le(e))
|
|
259
280
|
return e.position;
|
|
260
281
|
if (B(e))
|
|
261
282
|
return e.data.mediaPosition;
|
|
262
283
|
if (de(e))
|
|
263
|
-
return oe(this.five.camera.position,
|
|
284
|
+
return oe(this.five.camera.position, y(e.position), y(e.normal));
|
|
264
285
|
}
|
|
265
286
|
addObjectClickHandler(e, i, o) {
|
|
266
287
|
if (!i || !this.domEvents)
|
|
@@ -278,39 +299,17 @@ class hi extends ne {
|
|
|
278
299
|
}
|
|
279
300
|
getTagNormal(e) {
|
|
280
301
|
if (e.normal)
|
|
281
|
-
return
|
|
302
|
+
return y(e.normal);
|
|
282
303
|
if (e.stickType === "Plane")
|
|
283
|
-
return
|
|
304
|
+
return E(e.position);
|
|
284
305
|
if (e.stickType === "Model")
|
|
285
|
-
return
|
|
286
|
-
}
|
|
287
|
-
get filterPointTag() {
|
|
288
|
-
return this.tags.filter((i) => i.stickType === "2DPoint" || i.stickType === "3DPoint").filter((i) => i.position);
|
|
289
|
-
}
|
|
290
|
-
get filter2DPointTag() {
|
|
291
|
-
return this.tags.filter((i) => i.stickType === "2DPoint").filter((i) => i.position);
|
|
292
|
-
}
|
|
293
|
-
get filterImagePlane() {
|
|
294
|
-
return this.tags.filter(
|
|
295
|
-
(i) => i.contentType === "MediaPlane" && i.stickType === "Plane" && this.getRenderType(i) === "Mesh"
|
|
296
|
-
);
|
|
297
|
-
}
|
|
298
|
-
get filterMediaModel() {
|
|
299
|
-
return this.tags.filter((i) => i.stickType === "Model" && i.contentType === "MediaModel");
|
|
300
|
-
}
|
|
301
|
-
get filterCSS3DTag() {
|
|
302
|
-
return this.tags.filter(
|
|
303
|
-
(i) => i.stickType === "3DPoint" || i.stickType === "Plane" || i.stickType === "Model" && i.contentType === "MediaModel"
|
|
304
|
-
).filter((i) => {
|
|
305
|
-
const o = this.getRenderType(i);
|
|
306
|
-
return o === "BehindDom" || o === "Dom";
|
|
307
|
-
});
|
|
306
|
+
return E(this.getPositions(e));
|
|
308
307
|
}
|
|
309
308
|
getTransformedPostion(e) {
|
|
310
309
|
if (!e)
|
|
311
310
|
return;
|
|
312
311
|
const i = this.workUtil.transform;
|
|
313
|
-
return Array.isArray(e) && e.length === 4 ? e.map(
|
|
312
|
+
return Array.isArray(e) && e.length === 4 ? e.map(y).map((o) => J(o, i)) : J(y(e), i);
|
|
314
313
|
}
|
|
315
314
|
/**
|
|
316
315
|
* @description 检查是否已经销毁
|
|
@@ -323,51 +322,51 @@ class hi extends ne {
|
|
|
323
322
|
* @description 获取merge后的配置
|
|
324
323
|
*/
|
|
325
324
|
calculateTagConfig(e, i) {
|
|
326
|
-
var A, O, I, W
|
|
327
|
-
const o = (
|
|
325
|
+
var S, A, O, I, W;
|
|
326
|
+
const o = (S = i == null ? void 0 : i.useCache) != null ? S : !0;
|
|
328
327
|
if (!e)
|
|
329
|
-
return (
|
|
328
|
+
return (A = this.config.globalConfig) != null ? A : {};
|
|
330
329
|
if (o) {
|
|
331
|
-
if ((
|
|
330
|
+
if ((O = e == null ? void 0 : e.computedConfig) != null && O._isMerged)
|
|
332
331
|
return e.computedConfig;
|
|
333
|
-
if ((
|
|
332
|
+
if ((I = e == null ? void 0 : e.config) != null && I._isMerged)
|
|
334
333
|
return e.config;
|
|
335
334
|
}
|
|
336
335
|
const t = {}, n = {}, r = {};
|
|
337
336
|
this.config.contentTypeConfig && Object.entries(this.config.contentTypeConfig).forEach(([u, m]) => {
|
|
338
|
-
var
|
|
339
|
-
const
|
|
340
|
-
if (!v[
|
|
341
|
-
if (
|
|
342
|
-
const [
|
|
343
|
-
(e.contentType ===
|
|
337
|
+
var x, R;
|
|
338
|
+
const c = u, k = c.split("-"), j = u.startsWith("["), T = j ? k[0].slice(1, -1) : void 0, p = j ? k.slice(1) : k, v = T ? ["PanoramaLike", "ModelLike"].includes(T) ? (x = n[T]) != null ? x : n[T] = {} : (R = r[T]) != null ? R : r[T] = {} : t;
|
|
339
|
+
if (!v[c]) {
|
|
340
|
+
if (p.length === 0 && (v[c] = m), p.length === 1) {
|
|
341
|
+
const [h] = p;
|
|
342
|
+
(e.contentType === h || h === "Any") && (v[c] = m);
|
|
344
343
|
}
|
|
345
|
-
if (
|
|
346
|
-
const [
|
|
347
|
-
|
|
344
|
+
if (p.length === 2) {
|
|
345
|
+
const [h = "Any", M = "Any"] = p;
|
|
346
|
+
h === "Mixin" && e.contentType === M && (v[c] = m), (e.stickType === h || h === "Any") && (e.contentType === M || M === "Any") && (v[c] = m);
|
|
348
347
|
}
|
|
349
|
-
if (
|
|
350
|
-
const [
|
|
348
|
+
if (p.length === 3) {
|
|
349
|
+
const [h = "Any", M, X] = p;
|
|
351
350
|
if (M === "Audio" && e.contentType === "Audio") {
|
|
352
|
-
const
|
|
353
|
-
(
|
|
351
|
+
const F = e;
|
|
352
|
+
(F.stickType === h || h === "Any") && F.data.appearance === X && (v[c] = m);
|
|
354
353
|
}
|
|
355
354
|
}
|
|
356
355
|
}
|
|
357
356
|
});
|
|
358
|
-
const
|
|
357
|
+
const a = (W = e.initialConfig) != null ? W : {}, d = P({}, ee, this.config.globalConfig, ...Object.values(t)), g = P({}, d, a), C = {}, G = Object.values(ae.Mode);
|
|
359
358
|
$(n).forEach(([u, m]) => {
|
|
360
|
-
G.forEach((
|
|
361
|
-
(u === "PanoramaLike" &&
|
|
359
|
+
G.forEach((c) => {
|
|
360
|
+
(u === "PanoramaLike" && w(c) || u === "ModelLike" && z(c)) && (C[c] = P({}, d, ...Object.values(m), a, { _isMerged: !0 }));
|
|
362
361
|
});
|
|
363
362
|
}), $(r).forEach(([u, m]) => {
|
|
364
|
-
const
|
|
365
|
-
|
|
363
|
+
const c = C[u];
|
|
364
|
+
C[u] = P({}, d, c, ...Object.values(m), a, { _isMerged: !0 });
|
|
366
365
|
});
|
|
367
|
-
const
|
|
368
|
-
return N(
|
|
366
|
+
const b = U(D({}, g), { configWithFiveMode: C });
|
|
367
|
+
return N(b), Object.values(C).forEach((u) => N(u)), b._isMerged = !0, b;
|
|
369
368
|
}
|
|
370
369
|
}
|
|
371
370
|
export {
|
|
372
|
-
|
|
371
|
+
gi as TagUtil
|
|
373
372
|
};
|
|
@@ -138,6 +138,7 @@ declare class PanoTagPluginController extends TagRender {
|
|
|
138
138
|
private addResizeListener;
|
|
139
139
|
private addResizeObserver;
|
|
140
140
|
private updateVisible;
|
|
141
|
+
private handleFiveModeChange;
|
|
141
142
|
private handleFiveWantsMoveToPano;
|
|
142
143
|
/**
|
|
143
144
|
* @description 走点/切换模型后显示
|