@realsee/dnalogel 3.8.9 → 3.8.11

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.
@@ -79,10 +79,10 @@ class ci extends ne {
79
79
  d(this, "domEvents", new pe(this.five));
80
80
  d(this, "_workCode");
81
81
  d(this, "getObserverPosition", (e) => {
82
- var o, t;
82
+ var o, t, r;
83
83
  const i = (o = this.work) == null ? void 0 : o.observers[e];
84
84
  if (i)
85
- return O(i.position, (t = this.work) == null ? void 0 : t.options.transform);
85
+ return O(i.position, (r = (t = this.work) == null ? void 0 : t.options) == null ? void 0 : r.transform);
86
86
  });
87
87
  d(this, "loadVideoFirstFrame", () => {
88
88
  fe && this.hooks.emit("loadVideoFirstFrame");
@@ -125,9 +125,9 @@ class ci extends ne {
125
125
  * @description: 获取标签配置
126
126
  */
127
127
  getTagConfig(e, i) {
128
- var r, f, c;
129
- const o = this.calculateTagConfig(e, i), t = (r = i == null ? void 0 : i.fiveMode) != null ? r : this.five.getCurrentState().mode, n = (f = o.configWithFiveMode) == null ? void 0 : f[t];
130
- return (c = n != null ? n : o) != null ? c : {};
128
+ var n, f, c;
129
+ const o = this.calculateTagConfig(e, i), t = (n = i == null ? void 0 : i.fiveMode) != null ? n : this.five.getCurrentState().mode, r = (f = o.configWithFiveMode) == null ? void 0 : f[t];
130
+ return (c = r != null ? r : o) != null ? c : {};
131
131
  }
132
132
  /**
133
133
  * @description 获取标签当前状态
@@ -196,16 +196,16 @@ class ci extends ne {
196
196
  if (t.angle !== void 0)
197
197
  return t.angle;
198
198
  {
199
- const n = this.getObserverPosition(o);
200
- if (n === void 0)
201
- throw new Error(`getAngle(): observerPosition is ${n}`);
202
- const r = (() => e.stickType === "3DPoint" ? C(e.normal) : E(e.position))();
203
- if (!r)
199
+ const r = this.getObserverPosition(o);
200
+ if (r === void 0)
201
+ throw new Error(`getAngle(): observerPosition is ${r}`);
202
+ const n = (() => e.stickType === "3DPoint" ? C(e.normal) : E(e.position))();
203
+ if (!n)
204
204
  return;
205
205
  const f = $(e);
206
206
  if (!f)
207
207
  return;
208
- const c = new te.Vector3().copy(n).sub(f), g = r.angleTo(c) * 180 / Math.PI;
208
+ const c = new te.Vector3().copy(r).sub(f), g = n.angleTo(c) * 180 / Math.PI;
209
209
  return t.angle = g, t.angle;
210
210
  }
211
211
  }
@@ -213,20 +213,20 @@ class ci extends ne {
213
213
  * @description: 获取距离
214
214
  */
215
215
  getDistance(e, i) {
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
- if ((r == null ? void 0 : r.distance) !== void 0)
218
- return r.distance;
216
+ const o = M(M({}, this.five.getCurrentState()), i), { panoIndex: t, mode: r } = o, n = A(r) ? this.getPanoIndexCache({ panoIndex: t, id: e.id }) : void 0;
217
+ if ((n == null ? void 0 : n.distance) !== void 0)
218
+ return n.distance;
219
219
  const f = $(e);
220
220
  if (!f)
221
221
  return -1;
222
- if (A(n)) {
222
+ if (A(r)) {
223
223
  const c = this.getObserverPosition(t);
224
224
  if (c === void 0)
225
225
  return -1;
226
226
  const g = c.distanceTo(f);
227
- return r && (r.distance = g), g;
227
+ return n && (n.distance = g), g;
228
228
  }
229
- if (J(n))
229
+ if (J(r))
230
230
  return this.five.camera.position.distanceTo(f);
231
231
  }
232
232
  getPositions(e) {
@@ -241,14 +241,14 @@ class ci extends ne {
241
241
  if (!i || !this.domEvents)
242
242
  return () => {
243
243
  };
244
- const t = () => !(!this.getCurrentVisibleState(e) || e.loading), n = (r) => {
244
+ const t = () => !(!this.getCurrentVisibleState(e) || e.loading), r = (n) => {
245
245
  if (!t())
246
246
  return !1;
247
- o(r.origDomEvent);
247
+ o(n.origDomEvent);
248
248
  };
249
- return this.domEvents.addEventListener(i, "click", n), () => {
250
- var r;
251
- (r = this.domEvents) == null || r.removeEventListener(i, "click", n);
249
+ return this.domEvents.addEventListener(i, "click", r), () => {
250
+ var n;
251
+ (n = this.domEvents) == null || n.removeEventListener(i, "click", r);
252
252
  };
253
253
  }
254
254
  getTagNormal(e) {
@@ -283,11 +283,11 @@ class ci extends ne {
283
283
  });
284
284
  }
285
285
  getTransformedPostion(e) {
286
- var o;
286
+ var o, t;
287
287
  if (!e)
288
288
  return;
289
- const i = (o = this.work) == null ? void 0 : o.options.transform;
290
- return Array.isArray(e) && e.length === 4 ? e.map(C).map((t) => O(t, i)) : O(C(e), i);
289
+ const i = (t = (o = this.work) == null ? void 0 : o.options) == null ? void 0 : t.transform;
290
+ return Array.isArray(e) && e.length === 4 ? e.map(C).map((r) => O(r, i)) : O(C(e), i);
291
291
  }
292
292
  /**
293
293
  * @description 检查是否已经销毁
@@ -310,10 +310,10 @@ class ci extends ne {
310
310
  if ((W = e == null ? void 0 : e.config) != null && W._isMerged)
311
311
  return e.config;
312
312
  }
313
- const t = {}, n = {}, r = {};
313
+ const t = {}, r = {}, n = {};
314
314
  this.config.contentTypeConfig && Object.entries(this.config.contentTypeConfig).forEach(([u, p]) => {
315
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;
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) ? (_ = r[T]) != null ? _ : r[T] = {} : (x = n[T]) != null ? x : n[T] = {} : t;
317
317
  if (!v[l]) {
318
318
  if (h.length === 0 && (v[l] = p), h.length === 1) {
319
319
  const [m] = h;
@@ -333,11 +333,11 @@ class ci extends ne {
333
333
  }
334
334
  });
335
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]) => {
336
+ U(r).forEach(([u, p]) => {
337
337
  X.forEach((l) => {
338
338
  (u === "PanoramaLike" && A(l) || u === "ModelLike" && J(l)) && (k[l] = y({}, c, ...Object.values(p), f, { _isMerged: !0 }));
339
339
  });
340
- }), U(r).forEach(([u, p]) => {
340
+ }), U(n).forEach(([u, p]) => {
341
341
  k[u] = y({}, c, ...Object.values(p), f, { _isMerged: !0 });
342
342
  });
343
343
  const b = N(M({}, g), { configWithFiveMode: k });
@@ -1,15 +1,15 @@
1
- var E = Object.defineProperty, U = Object.defineProperties;
2
- var I = Object.getOwnPropertyDescriptors;
1
+ var U = Object.defineProperty, I = Object.defineProperties;
2
+ var R = Object.getOwnPropertyDescriptors;
3
3
  var A = Object.getOwnPropertySymbols;
4
- var R = Object.prototype.hasOwnProperty, B = Object.prototype.propertyIsEnumerable;
5
- var u = (d, a, e) => a in d ? E(d, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : d[a] = e, g = (d, a) => {
4
+ var B = Object.prototype.hasOwnProperty, F = Object.prototype.propertyIsEnumerable;
5
+ var u = (d, a, e) => a in d ? U(d, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : d[a] = e, g = (d, a) => {
6
6
  for (var e in a || (a = {}))
7
- R.call(a, e) && u(d, e, a[e]);
7
+ B.call(a, e) && u(d, e, a[e]);
8
8
  if (A)
9
9
  for (var e of A(a))
10
- B.call(a, e) && u(d, e, a[e]);
10
+ F.call(a, e) && u(d, e, a[e]);
11
11
  return d;
12
- }, v = (d, a) => U(d, I(a));
12
+ }, v = (d, a) => I(d, R(a));
13
13
  var l = (d, a, e) => (u(d, typeof a != "symbol" ? a + "" : a, e), e);
14
14
  var c = (d, a, e) => new Promise((t, i) => {
15
15
  var s = (r) => {
@@ -28,14 +28,14 @@ var c = (d, a, e) => new Promise((t, i) => {
28
28
  n((e = e.apply(d, a)).next());
29
29
  });
30
30
  import * as b from "three";
31
- import { Subscribe as F } from "@realsee/five";
31
+ import { Subscribe as M } from "@realsee/five";
32
32
  import { objectAssignDeepExports as f } from "../../vendor/object-assign-deep/objectAssignDeep.js";
33
- import { addDebugPoints as M } from "../utils/addDebugPoints.js";
33
+ import { addDebugPoints as O } from "../utils/addDebugPoints.js";
34
34
  import { arrayPositionToVector3 as P } from "../../shared-utils/positionToVector3.js";
35
- import { isMediaModelTag as O, isModelTag as _ } from "../utils/tag/tagCheck.js";
36
- import { debounce as k } from "../utils/debounce.js";
37
- import { throttle as V } from "../utils/throttle.js";
38
- import { resizeObserver as D } from "../utils/resizeObserver.js";
35
+ import { isMediaModelTag as _, isModelTag as k } from "../utils/tag/tagCheck.js";
36
+ import { debounce as V } from "../utils/debounce.js";
37
+ import { throttle as D } from "../utils/throttle.js";
38
+ import { resizeObserver as S } from "../utils/resizeObserver.js";
39
39
  import L from "../utils/tag/format.js";
40
40
  import { generateBlankAudio as N, AudioNamespace as G } from "../../shared-utils/audio.js";
41
41
  import { TagRender as z } from "./TagRender.js";
@@ -169,7 +169,7 @@ import "../../CSS3DRenderPlugin/utils/waitFiveModelLoaded.js";
169
169
  import "../../shared-utils/three/GLTFLoader.js";
170
170
  import "@realsee/five/gltf-loader";
171
171
  import "../../shared-utils/animationFrame/index.js";
172
- const S = "Dnalogel-PanoTagPlugin", Ui = (d) => `${S}--${d}`;
172
+ const w = "Dnalogel-PanoTagPlugin", Ui = (d) => `${w}--${d}`;
173
173
  class Ii extends z {
174
174
  constructor(e, t) {
175
175
  super(e);
@@ -205,7 +205,7 @@ class Ii extends z {
205
205
  l(this, "updateVisible", () => {
206
206
  const e = this.five.getCurrentState().mode;
207
207
  this.tags.forEach((t) => {
208
- O(t) && e !== "Panorama" && this.changeTagMode(t, "behind");
208
+ _(t) && e !== "Panorama" && this.changeTagMode(t, "behind");
209
209
  }), this.setVisible(), this.updateRenderAllTags();
210
210
  });
211
211
  l(this, "handleFiveWantsMoveToPano", (e) => {
@@ -247,7 +247,7 @@ class Ii extends z {
247
247
  l(this, "handleFivePanoArrived", () => c(this, null, function* () {
248
248
  this.setVisible(), this.updatePointTagPosition(), yield this.setVisibleAndUnfolded(), this.tags.forEach((e) => {
249
249
  e.temporaryState = v(g({}, e.temporaryState), { visible: !0 });
250
- }), this.tags.filter(_).filter((e) => {
250
+ }), this.tags.filter(k).filter((e) => {
251
251
  var t;
252
252
  return (t = this.getTagConfig(e).modelConfig) == null ? void 0 : t.autoLookAtEnabled;
253
253
  }).forEach((e) => {
@@ -284,14 +284,14 @@ class Ii extends z {
284
284
  load(e, t) {
285
285
  return c(this, null, function* () {
286
286
  var s, o;
287
- this.clearTags(), console.debug(S, " load:", { data: JSON.parse(JSON.stringify(e)) }), this.config = f({}, this.config, {
287
+ this.clearTags(), console.debug(w, " load:", { data: JSON.parse(JSON.stringify(e)) }), this.config = f({}, this.config, {
288
288
  globalConfig: (s = e.globalConfig) != null ? s : {},
289
289
  contentTypeConfig: (o = e.contentTypeConfig) != null ? o : {}
290
290
  });
291
291
  const i = yield this.addTag(e.tagList, t);
292
292
  if (this.debug)
293
293
  try {
294
- M(this.five, this.tags);
294
+ O(this.five, this.tags);
295
295
  } catch (n) {
296
296
  console.error(n);
297
297
  }
@@ -314,11 +314,11 @@ class Ii extends z {
314
314
  visible: void 0,
315
315
  unfolded: !this.can("fold", o)
316
316
  }, p.initialState),
317
- hooks: new F(),
317
+ hooks: new M(),
318
318
  originPosition: o.position,
319
319
  position: (() => {
320
320
  const m = this.getTransformedPostion(o.position);
321
- return Array.isArray(m) ? m.map((w) => w.toArray()) : m.toArray();
321
+ return Array.isArray(m) ? m.map((E) => E.toArray()) : m.toArray();
322
322
  })(),
323
323
  initialConfig: r,
324
324
  computedConfig: h,
@@ -491,11 +491,11 @@ class Ii extends z {
491
491
  addEventListener() {
492
492
  const { five: e, hooks: t } = this;
493
493
  let i = !1;
494
- const s = () => {
494
+ const s = D(() => {
495
495
  i || (i = !0, e.ready().then(() => {
496
496
  this.onFiveEveryReady(), i = !1;
497
497
  }));
498
- };
498
+ }, 150);
499
499
  return e.on("cameraUpdate", s), this.updateVisible(), this.handleFivePanoArrived(), e.on("wantsMoveToPano", this.handleFiveWantsMoveToPano), e.on("modeChange", this.updateVisible), e.on("initAnimationEnded", this.updateVisible), e.on("modelShownFloorChange", this.handleFiveModelShownFloorChange), e.on("cameraUpdate", this.handleFiveCameraUpdate), e.on("panoArrived", this.handleFivePanoArrived), e.on("panoArrived", this.loadVideoFirstFrame), t.on("click", this.clickhandler), () => {
500
500
  e.off("wantsMoveToPano", this.handleFiveWantsMoveToPano), e.off("modeChange", this.updateVisible), e.off("initAnimationEnded", this.updateVisible), e.off("modelShownFloorChange", this.handleFiveModelShownFloorChange), e.off("cameraUpdate", this.handleFiveCameraUpdate), e.off("cameraUpdate", s), e.off("panoArrived", this.handleFivePanoArrived), e.off("panoArrived", this.loadVideoFirstFrame), t.off("click", this.clickhandler), this.store.eventListenerDisposer = void 0;
501
501
  };
@@ -515,13 +515,13 @@ class Ii extends z {
515
515
  this.state.enabled && (this.show(), this.updateRenderAllTags());
516
516
  }, i = () => {
517
517
  this.state.enabled && this.hide();
518
- }, { observe: s, unobserve: o } = D(
519
- V(() => {
518
+ }, { observe: s, unobserve: o } = S(
519
+ D(() => {
520
520
  this.store.resizeObserverDisposer && i();
521
521
  }, 500),
522
522
  e
523
- ), { observe: n, unobserve: r } = D(
524
- k(() => t(), 400),
523
+ ), { observe: n, unobserve: r } = S(
524
+ V(() => t(), 400),
525
525
  e
526
526
  );
527
527
  return s(), n(), () => {
@@ -14,7 +14,7 @@ let b = class {
14
14
  /**
15
15
  * @realsee/dnalogel 版本号
16
16
  */
17
- i(this, "VERSION", "3.8.9");
17
+ i(this, "VERSION", "3.8.11");
18
18
  i(this, "five");
19
19
  /**
20
20
  * 插件事件钩子
@@ -1,5 +1,5 @@
1
- import { transformPosition as c } from "./transformPosition.js";
2
- function a(t, f) {
1
+ import { transformPosition as u } from "./transformPosition.js";
2
+ function d(t, f) {
3
3
  if (!t)
4
4
  return 0;
5
5
  const s = t.observers;
@@ -7,9 +7,9 @@ function a(t, f) {
7
7
  return console.error("getFloorIndex: invalid arguments: ", { point: f, observer: s }), 0;
8
8
  const e = [];
9
9
  s.forEach((r) => {
10
- var n, l;
10
+ var n, l, c;
11
11
  const o = (l = (n = r.floorIndex) != null ? n : r.floor_index) != null ? l : 0;
12
- e[o] || (e[o] = []), e[o].push(c(r.position, t.options.transform).y);
12
+ e[o] || (e[o] = []), e[o].push(u(r.position, (c = t.options) == null ? void 0 : c.transform).y);
13
13
  });
14
14
  const i = e.map((r) => r.reduce((o, n) => o + n, 0) / r.length);
15
15
  for (let r = i.length - 1; r > 0; r--)
@@ -18,5 +18,5 @@ function a(t, f) {
18
18
  return 0;
19
19
  }
20
20
  export {
21
- a as getFloorIndex
21
+ d as getFloorIndex
22
22
  };
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.8.9",
3
+ "%c %c@realsee/dnalogel %cv3.8.11",
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.9",
10
+ "version": "3.8.11",
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*",