@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.
@@ -1,22 +1,22 @@
1
1
  var Z = Object.defineProperty, q = Object.defineProperties;
2
2
  var K = Object.getOwnPropertyDescriptors;
3
- var _ = Object.getOwnPropertySymbols;
3
+ var L = Object.getOwnPropertySymbols;
4
4
  var Q = Object.prototype.hasOwnProperty, Y = Object.prototype.propertyIsEnumerable;
5
- var E = (l, s, e) => s in l ? Z(l, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[s] = e, b = (l, s) => {
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) && E(l, e, s[e]);
8
- if (_)
9
- for (var e of _(s))
10
- Y.call(s, e) && E(l, e, 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 d = (l, s, e) => (E(l, typeof s != "symbol" ? s + "" : s, e), e);
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 y } from "../../vendor/object-assign-deep/objectAssignDeep.js";
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 C } from "../../shared-utils/positionToVector3.js";
19
- import { planeNormal as w } from "../utils/planeNormal.js";
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 le, isMediaModelTag as B, isPlaneTag as ce, isPoint3DTag as de } from "../utils/tag/tagCheck.js";
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 S, isModelLike as z } from "../../shared-utils/five/mode.js";
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 pe } from "../../shared-utils/Utils/WorkUtil.js";
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 hi extends ne {
69
+ class gi extends ne {
70
70
  constructor(e) {
71
71
  super(e);
72
- d(this, "tags", []);
73
- d(this, "config", te);
74
- d(this, "tagsLengthWillUpdate", !0);
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
- d(this, "params");
78
- d(this, "mediaStore", re({
76
+ f(this, "params");
77
+ f(this, "mediaStore", re({
79
78
  currentMediaElement: null
80
79
  }));
81
- d(this, "store", {
80
+ f(this, "store", {
82
81
  disposers: [],
83
82
  disposed: !1,
84
83
  resizeObserverDisposerAdding: !1,
85
84
  css3DRenderDisposer: /* @__PURE__ */ new Map()
86
85
  });
87
- d(this, "domEvents", new me(this.five));
88
- // private _cache_pointTag?: PointTagInstance[]
89
- // private _cache_2DPointTag?: TagInstance<TagContentType, '2DPoint'>[]
90
- // private _cache_imagePlane?: TagInstance<'MediaPlane', 'Plane'>[]
91
- // private _cache_mediaModel?: TagInstance<'MediaModel', 'Model'>[]
92
- // private _cache_css3DTag?: (
93
- // | TagInstance<TagContentType, 'Plane'>
94
- // | TagInstance<TagContentType, 'Model'>
95
- // | TagInstance<TagContentType, '3DPoint'>
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, f, c;
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 = (f = o.configWithFiveMode) == null ? void 0 : f[t];
153
- return (c = n != null ? n : o) != null ? c : {};
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 ? y(e.data, n, o.initialData) : y(e.data, o.initialData, n);
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 (le(e)) {
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" ? C(e.normal) : w(e.position))();
248
+ const r = (() => e.stickType === "3DPoint" ? y(e.normal) : E(e.position))();
228
249
  if (!r)
229
250
  return;
230
- const f = V(e);
231
- if (!f)
251
+ const a = V(e);
252
+ if (!a)
232
253
  return;
233
- const c = new ie.Vector3().copy(n).sub(f), h = r.angleTo(c) * 180 / Math.PI;
234
- return t.angle = h, 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 = b(b({}, this.five.getCurrentState()), i), { panoIndex: t, mode: n } = o, r = S(n) ? this.getPanoIndexCache({ panoIndex: t, id: e.id }) : void 0;
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 f = V(e);
245
- if (!f)
265
+ const a = V(e);
266
+ if (!a)
246
267
  return -1;
247
- if (S(n)) {
248
- const c = this.workUtil.getObserverPosition(t);
249
- if (c === void 0)
268
+ if (w(n)) {
269
+ const d = this.workUtil.getObserverPosition(t);
270
+ if (d === void 0)
250
271
  return -1;
251
- const h = c.distanceTo(f);
252
- return r && (r.distance = h), h;
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(f);
276
+ return this.five.camera.position.distanceTo(a);
256
277
  }
257
278
  getPositions(e) {
258
- if (ce(e))
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, C(e.position), C(e.normal));
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 C(e.normal);
302
+ return y(e.normal);
282
303
  if (e.stickType === "Plane")
283
- return w(e.position);
304
+ return E(e.position);
284
305
  if (e.stickType === "Model")
285
- return w(this.getPositions(e));
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(C).map((o) => J(o, i)) : J(C(e), i);
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, j;
327
- const o = (A = i == null ? void 0 : i.useCache) != null ? A : !0;
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 (O = this.config.globalConfig) != null ? O : {};
328
+ return (A = this.config.globalConfig) != null ? A : {};
330
329
  if (o) {
331
- if ((I = e == null ? void 0 : e.computedConfig) != null && I._isMerged)
330
+ if ((O = e == null ? void 0 : e.computedConfig) != null && O._isMerged)
332
331
  return e.computedConfig;
333
- if ((W = e == null ? void 0 : e.config) != null && W._isMerged)
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 R, F;
339
- const a = u, D = a.split("-"), x = u.startsWith("["), T = x ? D[0].slice(1, -1) : void 0, g = x ? D.slice(1) : D, v = T ? ["PanoramaLike", "ModelLike"].includes(T) ? (R = n[T]) != null ? R : n[T] = {} : (F = r[T]) != null ? F : r[T] = {} : t;
340
- if (!v[a]) {
341
- if (g.length === 0 && (v[a] = m), g.length === 1) {
342
- const [p] = g;
343
- (e.contentType === p || p === "Any") && (v[a] = m);
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 (g.length === 2) {
346
- const [p = "Any", M = "Any"] = g;
347
- p === "Mixin" && e.contentType === M && (v[a] = m), (e.stickType === p || p === "Any") && (e.contentType === M || M === "Any") && (v[a] = m);
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 (g.length === 3) {
350
- const [p = "Any", M, X] = g;
348
+ if (p.length === 3) {
349
+ const [h = "Any", M, X] = p;
351
350
  if (M === "Audio" && e.contentType === "Audio") {
352
- const L = e;
353
- (L.stickType === p || p === "Any") && L.data.appearance === X && (v[a] = m);
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 f = (j = e.initialConfig) != null ? j : {}, c = y({}, ee, this.config.globalConfig, ...Object.values(t)), h = y({}, c, f), P = {}, G = Object.values(ae.Mode);
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((a) => {
361
- (u === "PanoramaLike" && S(a) || u === "ModelLike" && z(a)) && (P[a] = y({}, c, ...Object.values(m), f, { _isMerged: !0 }));
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 a = P[u];
365
- P[u] = y({}, c, a, ...Object.values(m), f, { _isMerged: !0 });
363
+ const c = C[u];
364
+ C[u] = P({}, d, c, ...Object.values(m), a, { _isMerged: !0 });
366
365
  });
367
- const k = U(b({}, h), { configWithFiveMode: P });
368
- return N(k), Object.values(P).forEach((u) => N(u)), k._isMerged = !0, k;
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
- hi as TagUtil
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 走点/切换模型后显示