@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.
@@ -1,29 +1,29 @@
1
1
  var $ = Object.defineProperty, w = Object.defineProperties;
2
2
  var E = Object.getOwnPropertyDescriptors;
3
- var T = Object.getOwnPropertySymbols;
3
+ var k = Object.getOwnPropertySymbols;
4
4
  var L = Object.prototype.hasOwnProperty, _ = Object.prototype.propertyIsEnumerable;
5
- var k = (p, e, i) => e in p ? $(p, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : p[e] = i, h = (p, e) => {
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) && k(p, i, e[i]);
8
- if (T)
9
- for (var i of T(e))
10
- _.call(e, i) && k(p, i, e[i]);
11
- return p;
12
- }, M = (p, e) => w(p, E(e));
13
- import * as U from "three";
14
- import { is3DTag as z, isMediaModelTag as D } from "../utils/tag/tagCheck.js";
15
- import { getTagCenterPosition as P, getTagPosition as O } from "../utils/tagPosition.js";
16
- import { checkRange as m } from "../utils/checkRange.js";
17
- import { isPanoramaLike as b, isModelLike as Z } from "../../shared-utils/five/mode.js";
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 H } from "../../shared-utils/isNil.js";
24
- import { TagUtil as N } from "./TagUtil.js";
25
- import { getFloorIndex as q } from "../../shared-utils/five/getFloorIndex.js";
26
- import { safeObj as R } from "../../shared-utils/safeObj.js";
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 I = new U.Raycaster();
68
- class Je extends N {
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 = h(h({}, this.five.getCurrentState()), i), { panoIndex: t, mode: s } = f, d = b(s) ? this.getPanoIndexCache({ panoIndex: t, id: e.id }) : void 0;
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 o = [], u = (() => {
81
- var r, l, v;
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: o, reason: "config function result" };
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: o, reason: "config.keep is hidden" };
86
+ return { value: !1, checkedList: s, reason: "config.keep is hidden" };
87
87
  if (n.keep === "visible")
88
- return { value: !0, checkedList: o, reason: "config.keep is visible" };
88
+ return { value: !0, checkedList: s, reason: "config.keep is visible" };
89
89
  if (n.visibleFiveMode !== void 0) {
90
- const a = typeof n.visibleFiveMode == "function" ? n.visibleFiveMode(e) : n.visibleFiveMode;
91
- let c = !1;
92
- if (Array.isArray(a) ? c = a.includes(s) : a === "ModelLike" ? c = Z(s) : a === "PanoramaLike" ? c = !b(s) : a === "all" ? c = !0 : typeof a == "string" && (c = a === s), c === !1)
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: o,
95
+ checkedList: s,
96
96
  reason: "current mode is not included in visibleFiveMode",
97
97
  visibleFiveMode: n.visibleFiveMode,
98
- mode: s
98
+ mode: o
99
99
  };
100
- }
101
- if (n.followModelVisibility === !0 && (s === "Floorplan" || s === "Mapview") && this.getVisibleByFloorIndex(e) === !1)
102
- return { value: !1, checkedList: o, reason: "followModelVisibility check failed" };
103
- if (b(s) && n.visiblePanoIndex !== void 0 && n.visiblePanoIndex !== "all" && t !== void 0) {
104
- if (o.push("visiblePanoIndex"), Array.isArray(n.visiblePanoIndex) && !n.visiblePanoIndex.includes(t))
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: o,
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 !== ((l = e.fiveState) == null ? void 0 : l.panoIndex))
117
+ if (n.visiblePanoIndex === "current" && t !== ((g = e.fiveState) == null ? void 0 : g.panoIndex))
111
118
  return {
112
119
  value: !1,
113
- checkedList: o,
114
- reason: `current panoIndex is not equal to tag.panoIndex. currentPanoIndex: ${t}, tag.panoIndex: ${(v = e.fiveState) == null ? void 0 : v.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 && (o.push("visibleDistance"), n.visibleDistance !== "unLimited")) {
118
- const a = this.getDistance(e);
119
- if (m(a, n.visibleDistance) === !1)
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: o,
123
- reason: `distance is not in visibleDistance. distance: ${a}, visibleDistance: ${n.visibleDistance}`
129
+ checkedList: s,
130
+ reason: `distance is not in visibleDistance. distance: ${l}, visibleDistance: ${n.visibleDistance}`
124
131
  };
125
132
  }
126
- if (b(s) && n.angleRange && z(e)) {
127
- o.push("angleRange");
128
- const a = this.getAngle(e);
129
- if (m(a, n.angleRange) === !1)
130
- return { value: !1, checkedList: o, reason: `angle is not in angleRange. angle: ${a}, angleRange: ${n.angleRange}` };
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 (o.push("intersectRaycaster"), t === void 0)
140
+ if (s.push("intersectRaycaster"), t === void 0)
134
141
  return {
135
142
  value: !1,
136
- checkedList: o,
143
+ checkedList: s,
137
144
  reason: `intersectRaycaster check failed: panoIndex is ${t}`
138
145
  };
139
- const a = this.getTagEnableByIntersect(e, t);
140
- if (a.value === !1)
141
- return Object.assign(a, { checkedList: o });
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: o,
152
+ checkedList: s,
146
153
  reason: "all check passed"
147
154
  };
148
155
  })();
149
- return d && (d.visible = u.value, d.__debug_visible_reason__ = u), u.value;
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 s = this.getTagConfig(e).unfoldedConfig;
163
- if (!s)
169
+ const o = this.getTagConfig(e).unfoldedConfig;
170
+ if (!o)
164
171
  return;
165
172
  const d = (() => {
166
- if (typeof s == "function")
167
- return s(this.five, { tag: e, distance: this.getDistance(e) });
168
- if (s.keep === "folded")
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 (s.keep === "unfolded")
177
+ if (o.keep === "unfolded")
171
178
  return !0;
172
- if (s.unfoldDistance && m(this.getDistance(e), s.unfoldDistance) === !1)
179
+ if (o.unfoldDistance && h(this.getDistance(e), o.unfoldDistance) === !1)
173
180
  return !1;
174
181
  })();
175
182
  t.unfolded = d;
176
- const o = this.getUnfoldedByCamera(e);
177
- return o !== void 0 ? o : t.unfolded;
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 s;
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 && m(d.x, t.autoUnfold.autoUnfoldProjectX) === !1)
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 u = this.filterPointTag.filter((r) => this.getCurrentVisibleState(r)).filter((r) => {
203
- const l = this.getTagProject(r);
204
- if (!l)
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: v, y: a, z: c } = l;
207
- return !(Math.abs(c) > 1 || Math.abs(v) > 1 || Math.abs(a) > 1);
208
- }).map((r) => ({ tag: r, id: r.id, tagConfig: this.getTagConfig(r).unfoldedConfig })).filter(({ tag: r, tagConfig: l }) => {
209
- var v, a;
210
- return !(typeof l == "function" || l.keep || l.autoUnfold === !1 || ((v = l.autoUnfold) == null ? void 0 : v.enable) === !1 || ((a = l.autoUnfold) == null ? void 0 : a.strategy) !== "MinimumDistance");
211
- }).map((r) => M(h({}, r), { distance: this.getDistance(r.tag) })).filter(({ distance: r, tagConfig: l }) => {
212
- const v = l.autoUnfold.distance;
213
- return !(v && m(r, v) === !1);
214
- }).sort((r, l) => r.distance - l.distance).findIndex((r) => r.id === e.id);
215
- if (u === -1 || u <= ((s = t.autoUnfold.maxNumber) != null ? s : 1) - 1 === !1)
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 = P(e);
257
+ const i = I(e);
251
258
  if (!i)
252
259
  return;
253
- const { x: f, y: t, z: s } = i.project(this.five.camera);
254
- if (!(s > 1))
255
- return { x: f, y: t, z: s };
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, l, v, a;
260
- const f = R(R((n = this.getTagConfig(e).visibleConfig) != null ? n : {}).intersectRaycaster), t = i != null ? i : this.five.getCurrentState().panoIndex, s = b(this.five.getCurrentState().mode) ? this.getObserverPosition(t) : this.five.camera.position;
261
- if (s === void 0)
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 c = (g = f.checkPoints) != null ? g : "center";
267
- return c === "center" ? P(e) : c === "corner" ? O(e) : Array.isArray(c) ? c : [];
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 o = 0, u = 0;
271
- for (const c of d) {
272
- const g = new U.Vector3().subVectors(c, s).normalize();
273
- I.set(s, g);
274
- const F = s.distanceTo(c), [y] = this.five.model.intersectRaycaster(I), x = (() => {
275
- if (!D(e))
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(D).map((A) => {
278
- var C;
279
- return (C = A.model) == null ? void 0 : C.object;
280
- }).filter(H), [B] = I.intersectObjects(V, !0);
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
- })(), j = (r = f.distanceAccuracy) != null ? r : 0.01;
283
- Math.min((l = y == null ? void 0 : y.distance) != null ? l : 1 / 0, (v = x == null ? void 0 : x.distance) != null ? v : 1 / 0) + j >= F ? o++ : u++;
284
- const S = (a = f.needPassed) != null ? a : 1;
285
- if (o >= S)
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 u === 0 ? { value: !0 } : {
295
+ return c === 0 ? { value: !0 } : {
289
296
  value: !1,
290
297
  reason: {
291
298
  type: "intersectRaycaster check failed",
292
- passedCount: o,
299
+ passedCount: s,
293
300
  needPassed: f.needPassed
294
301
  }
295
302
  };
296
303
  }
297
304
  /** 检测是否匹配当前楼层 */
298
305
  getVisibleByFloorIndex(e) {
299
- var s, d, o, u, n, r, l;
306
+ var o, d, s, c, n, r, a;
300
307
  let i = 0;
301
- const f = (s = e.fiveState) == null ? void 0 : s.panoIndex;
302
- f !== void 0 ? i = (d = this.work.observers[f]) == null ? void 0 : d.floorIndex : i = q(this.work, (l = (r = (u = (o = e.model) == null ? void 0 : o.object) == null ? void 0 : u.position) != null ? r : (n = e.mediaPlane) == null ? void 0 : n.position) != null ? l : P(e));
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 q = Object.defineProperty, K = Object.defineProperties;
2
- var Q = Object.getOwnPropertyDescriptors;
3
- var R = Object.getOwnPropertySymbols;
4
- var Y = Object.prototype.hasOwnProperty, Z = Object.prototype.propertyIsEnumerable;
5
- var w = (a, s, e) => s in a ? q(a, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[s] = e, M = (a, s) => {
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
- Y.call(s, e) && w(a, e, s[e]);
8
- if (R)
9
- for (var e of R(s))
10
- Z.call(s, e) && w(a, e, s[e]);
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
- }, B = (a, s) => K(a, Q(s));
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 ee } from "../typings/tag/TagConfig.js";
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 ie from "three";
17
- import { DefaultConfig as te } from "../tag.config.js";
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 N } from "../utils/tagPosition.js";
21
- import { normalPositionToPositions as oe } from "../utils/normalPositionToPositions.js";
22
- import { TagCache as re } from "./TagCache.js";
23
- import { writable as ne } from "../../vendor/svelte/store/index.js";
24
- import { isIOSWX as se } from "../../shared-utils/device.js";
25
- import { Five as fe } from "@realsee/five";
26
- import { isMediaPlaneTag as ae, isMediaModelTag as $, isPlaneTag as ce, isPoint3DTag as le } from "../utils/tag/tagCheck.js";
27
- import { VideoPlane as de } from "../utils/model/mediaPlane.js";
28
- import { FiveDomEvents as ue } from "../../shared-utils/five/FiveDomEvents.js";
29
- import z from "../utils/tag/adaptConfig.js";
30
- import { isPanoramaLike as A, isModelLike as H } from "../../shared-utils/five/mode.js";
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 J } from "../../shared-utils/typescript/entries.js";
36
- import { getUrlExt as U } from "../../shared-utils/url/getUrl.js";
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 ai extends re {
63
+ class ci extends ne {
64
64
  constructor(e) {
65
65
  super(e);
66
66
  d(this, "tags", []);
67
- d(this, "config", te);
68
- d(this, "mediaStore", ne({
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 ue(this.five));
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
- se && this.hooks.emit("loadVideoFirstFrame");
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 de && i !== o.mediaPlane.videoInstance) {
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 (ae(e)) {
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 U(t[0].url) === "gif" ? "Dom" : "Mesh";
180
+ return G(t[0].url) === "gif" ? "Dom" : "Mesh";
181
181
  }
182
- } else if ($(e))
183
- return t.length === 1 && t[0].type === "Image" ? U(t[0].url) === "gif" ? "Dom" : "Mesh" : "BehindDom";
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 = N(e);
205
+ const f = $(e);
206
206
  if (!f)
207
207
  return;
208
- const c = new ie.Vector3().copy(n).sub(f), g = r.angleTo(c) * 180 / Math.PI;
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 = N(e);
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 (H(n))
229
+ if (J(n))
230
230
  return this.five.camera.position.distanceTo(f);
231
231
  }
232
232
  getPositions(e) {
233
- if (ce(e))
233
+ if (le(e))
234
234
  return e.position;
235
- if ($(e))
235
+ if (z(e))
236
236
  return e.data.mediaPosition;
237
- if (le(e))
238
- return oe(this.five.camera.position, C(e.position), C(e.normal));
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 L, _;
316
- const l = u, D = l.split("-"), V = u.startsWith("["), T = V ? D[0].slice(1, -1) : void 0, h = V ? D.slice(1) : D, v = T ? ["PanoramaLike", "ModelLike"].includes(T) ? (L = n[T]) != null ? L : n[T] = {} : (_ = r[T]) != null ? _ : r[T] = {} : t;
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, X] = h;
327
+ const [m = "Any", P, q] = h;
328
328
  if (P === "Audio" && e.contentType === "Audio") {
329
- const x = e;
330
- (x.stickType === m || m === "Any") && x.data.appearance === X && (v[l] = p);
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({}, ee, this.config.globalConfig, ...Object.values(t)), g = y({}, c, f), k = {}, G = Object.values(fe.Mode);
336
- J(n).forEach(([u, p]) => {
337
- G.forEach((l) => {
338
- (u === "PanoramaLike" && A(l) || u === "ModelLike" && H(l)) && (k[l] = y({}, c, ...Object.values(p), f, { _isMerged: !0 }));
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
- }), J(r).forEach(([u, p]) => {
340
+ }), U(r).forEach(([u, p]) => {
341
341
  k[u] = y({}, c, ...Object.values(p), f, { _isMerged: !0 });
342
342
  });
343
- const b = B(M({}, g), { configWithFiveMode: k });
344
- return z(b, e), Object.values(k).forEach((u) => z(u, e)), b._isMerged = !0, b;
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
- ai as TagUtil
348
+ ci as TagUtil
349
349
  };
@@ -1,2 +1,2 @@
1
- import type { Tag, TagConfig } from '../..';
2
- export default function adaptConfig(config: TagConfig, tag?: Tag): TagConfig<"Panorama" | "Model" | "Custom" | "Audio" | "Text" | "ImageText" | "Image" | "Video" | "Link" | "Sticker" | "VRLink" | "PanoLink" | "Marketing" | "MediaPlane" | "MediaModel" | "Unknown">;
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 v(e, l) {
2
- var d, f, o, s, b;
3
- typeof e.visibleConfig == "object" && (e.visibleConfig.visibleFiveMode = (o = (f = e.visibleConfig.visibleFiveMode) != null ? f : (d = l == null ? void 0 : l.fiveState) == null ? void 0 : d.mode) != null ? o : "Panorama", e.visibleConfig.keep && (e.visibleConfig.keep === "visible" ? e.visibleConfig = { keep: e.visibleConfig.keep, visibleFiveMode: (s = e.visibleConfig) == null ? void 0 : s.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 = (b = e.initialState) != null ? b : {};
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
- v as default
8
+ f as default
9
9
  };
@@ -14,7 +14,7 @@ let b = class {
14
14
  /**
15
15
  * @realsee/dnalogel 版本号
16
16
  */
17
- i(this, "VERSION", "3.8.3");
17
+ i(this, "VERSION", "3.8.4");
18
18
  i(this, "five");
19
19
  /**
20
20
  * 插件事件钩子
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.8.3",
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.3",
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*",