@realsee/dnalogel 3.42.0-alpha-tag.19 → 3.42.0-alpha-tag.21

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.
Files changed (36) hide show
  1. package/dist/PanoTagPlugin/controller/Tag/ModelTag.d.ts +0 -2
  2. package/dist/PanoTagPlugin/controller/Tag/PlaneTag.d.ts +0 -2
  3. package/dist/index.cjs.js +51 -51
  4. package/dist/index.js +2710 -2695
  5. package/dist/index.umd.js +42 -42
  6. package/libs/CruisePlugin/Move.js +3 -2
  7. package/libs/CruisePlugin/Work.js +3 -2
  8. package/libs/CruisePlugin/index.js +7 -6
  9. package/libs/GuideLinePlugin/Controller.js +5 -4
  10. package/libs/GuideLinePlugin/GuideLineItem.js +3 -2
  11. package/libs/GuideLinePlugin/GuideLineModeItem.js +3 -2
  12. package/libs/GuideLinePlugin/index.js +7 -6
  13. package/libs/ModelMakerPlugin/index.js +1 -1
  14. package/libs/ModelMakerPlugin/item/baseItem.js +7 -6
  15. package/libs/ModelMakerPlugin/item/boxItem.js +3 -2
  16. package/libs/ModelMakerPlugin/item/polygonItem.js +7 -6
  17. package/libs/ModelMakerPlugin/item/prismItem.js +7 -6
  18. package/libs/ModelMakerPlugin/utils/getFiveDomEvent.js +4 -3
  19. package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +93 -95
  20. package/libs/PanoTagPlugin/controller/Tag/ModelTag.d.ts +0 -2
  21. package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +1 -5
  22. package/libs/PanoTagPlugin/controller/Tag/PlaneTag.d.ts +0 -2
  23. package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +1 -5
  24. package/libs/PanoTagPlugin/controller/Tag/PointTag.js +2 -2
  25. package/libs/PanoTagPlugin/controller/TagRender.js +3 -2
  26. package/libs/PanoTagPlugin/controller/TagUtil.js +3 -2
  27. package/libs/PanoTagPlugin/controller/index.js +47 -46
  28. package/libs/PanoTagPlugin/index.js +14 -13
  29. package/libs/PanoTagPlugin/typings/index.js +1 -1
  30. package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +1 -1
  31. package/libs/base/BasePlugin.js +1 -1
  32. package/libs/index.js +1 -1
  33. package/libs/shared-utils/five/FiveDomEvents.js +92 -88
  34. package/libs/shared-utils/logger.js +1 -1
  35. package/libs/shared-utils/three/THREERaycaster.js +30 -8
  36. package/package.json +1 -1
@@ -12,19 +12,19 @@ var u = (d, a, e) => a in d ? D(d, a, { enumerable: !0, configurable: !0, writab
12
12
  }, m = (d, a) => P(d, U(a));
13
13
  var l = (d, a, e) => (u(d, typeof a != "symbol" ? a + "" : a, e), e);
14
14
  var p = (d, a, e) => new Promise((t, i) => {
15
- var o = (r) => {
15
+ var o = (s) => {
16
16
  try {
17
- n(e.next(r));
17
+ n(e.next(s));
18
18
  } catch (h) {
19
19
  i(h);
20
20
  }
21
- }, s = (r) => {
21
+ }, r = (s) => {
22
22
  try {
23
- n(e.throw(r));
23
+ n(e.throw(s));
24
24
  } catch (h) {
25
25
  i(h);
26
26
  }
27
- }, n = (r) => r.done ? t(r.value) : Promise.resolve(r.value).then(o, s);
27
+ }, n = (s) => s.done ? t(s.value) : Promise.resolve(s.value).then(o, r);
28
28
  n((e = e.apply(d, a)).next());
29
29
  });
30
30
  import * as v from "three";
@@ -174,6 +174,7 @@ import "../../shared-utils/url/absoluteUrl.js";
174
174
  import "../../shared-utils/five/getFiveModel.js";
175
175
  import "../../shared-utils/five/FiveDomEvents.js";
176
176
  import "../../shared-utils/five/calculateThreeMouse.js";
177
+ import "../../shared-utils/three/THREERaycaster.js";
177
178
  import "../../base/BasePlugin.js";
178
179
  import "../../shared-utils/Utils/FiveUtil.js";
179
180
  import "../../shared-utils/Utils/BaseUtil.js";
@@ -181,8 +182,8 @@ import "../../shared-utils/Utils/WorkUtil.js";
181
182
  import "../utils/requestIdleCallback.js";
182
183
  import "../Components/TagItem.js";
183
184
  import "../Components/Common/TagPoint.js";
184
- const S = "Dnalogel-PanoTagPlugin", Vi = (d) => `${S}--${d}`;
185
- class zi extends R {
185
+ const S = "Dnalogel-PanoTagPlugin", zi = (d) => `${S}--${d}`;
186
+ class xi extends R {
186
187
  constructor(e, t) {
187
188
  super(e);
188
189
  /** state */
@@ -222,8 +223,8 @@ class zi extends R {
222
223
  if (!t.state)
223
224
  return console.warn("Clickhandler: params.tag.state is undefined");
224
225
  const i = t.can("fold"), o = t.can("unfold");
225
- i && o && (e.tag.state.unfolded = !e.tag.state.unfolded, e.tag.state.unfolded && this.tags.forEach((s) => {
226
- s.id !== e.tag.id && s.state && s.can("fold") && (s.state.unfolded = !1);
226
+ i && o && (e.tag.state.unfolded = !e.tag.state.unfolded, e.tag.state.unfolded && this.tags.forEach((r) => {
227
+ r.id !== e.tag.id && r.state && r.can("fold") && (r.state.unfolded = !1);
227
228
  }), this.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] }));
228
229
  });
229
230
  l(this, "handleFiveCameraUpdate", () => {
@@ -250,10 +251,10 @@ class zi extends R {
250
251
  t.position.copy(i.position), t.quaternion.copy(i.quaternion);
251
252
  const o = this.five.camera.position;
252
253
  t.lookAt(o.clone().setY(t.position.y));
253
- const s = i.quaternion.clone(), n = t.quaternion.clone(), r = q();
254
- r.onUpdate(({ progress: g }) => {
255
- i.quaternion.copy(s.clone().slerp(n, g));
256
- }), r.play();
254
+ const r = i.quaternion.clone(), n = t.quaternion.clone(), s = q();
255
+ s.onUpdate(({ progress: g }) => {
256
+ i.quaternion.copy(r.clone().slerp(n, g));
257
+ }), s.play();
257
258
  });
258
259
  }));
259
260
  /** 楼层切换时,需要更新标签可见性 */
@@ -267,9 +268,9 @@ class zi extends R {
267
268
  this.renderQueue.forEach((e, t) => {
268
269
  const i = t.split("-")[0], o = t.split("-").slice(1);
269
270
  if (i === "TagContainerSvelte") {
270
- const s = this.filterPointTag.filter((r) => r.screenPosition), n = {
271
+ const r = this.filterPointTag.filter((s) => s.screenPosition), n = {
271
272
  hooks: this.hooks,
272
- tags: s,
273
+ tags: r,
273
274
  state: this.state,
274
275
  temporaryState: this.temporaryState,
275
276
  mediaStore: this.mediaStore,
@@ -278,13 +279,13 @@ class zi extends R {
278
279
  zIndex: this.params.containerZIndex
279
280
  };
280
281
  if (this.TagContainerSvelte) {
281
- let r = {};
282
+ let s = {};
282
283
  if (o.length === 0)
283
- r = n;
284
+ s = n;
284
285
  else
285
286
  for (const h of o)
286
- r[h] = n[h];
287
- this.TagContainerSvelte.$set(r);
287
+ s[h] = n[h];
288
+ this.TagContainerSvelte.$set(s);
288
289
  } else {
289
290
  if (!this.container)
290
291
  return console.error("updateRenderPlaneTag: tag2DContainer not found");
@@ -292,8 +293,8 @@ class zi extends R {
292
293
  target: this.container,
293
294
  props: m(f({}, n), { state: m(f({}, this.state), { enabled: !1 }) })
294
295
  }), V(() => {
295
- var r;
296
- (r = this.TagContainerSvelte) == null || r.$set({ state: this.state });
296
+ var s;
297
+ (s = this.TagContainerSvelte) == null || s.$set({ state: this.state });
297
298
  });
298
299
  }
299
300
  }
@@ -310,9 +311,9 @@ class zi extends R {
310
311
  }
311
312
  }
312
313
  appendTo(e) {
313
- var i, o, s, n;
314
+ var i, o, r, n;
314
315
  this.container = e, (i = this.css3DRenderPlugin) == null || i.appendToFrontFiveContainer(this.container);
315
- const t = (s = (o = this.TagContainerSvelte) == null ? void 0 : o.$$) == null ? void 0 : s.root;
316
+ const t = (r = (o = this.TagContainerSvelte) == null ? void 0 : o.$$) == null ? void 0 : r.root;
316
317
  t && t !== this.container && ((n = this.TagContainerSvelte) == null || n.$destroy(), this.TagContainerSvelte = void 0);
317
318
  }
318
319
  /**
@@ -329,8 +330,8 @@ class zi extends R {
329
330
  if (this.debug)
330
331
  try {
331
332
  A(this.five, this.tags);
332
- } catch (s) {
333
- console.error(s);
333
+ } catch (r) {
334
+ console.error(r);
334
335
  }
335
336
  return t;
336
337
  });
@@ -341,17 +342,17 @@ class zi extends R {
341
342
  addTag(e) {
342
343
  return p(this, null, function* () {
343
344
  const i = (Array.isArray(e) ? e : [e]).filter((o) => o.position).map((o) => {
344
- const s = B(o);
345
- if (s === "2DPoint" || s === "3DPoint")
345
+ const r = B(o);
346
+ if (r === "2DPoint" || r === "3DPoint")
346
347
  return new x(this, o);
347
- if (s === "Model")
348
+ if (r === "Model")
348
349
  return new Q(this, o);
349
- if (s === "Plane")
350
+ if (r === "Plane")
350
351
  return new $(this, o);
351
352
  });
352
353
  return i.forEach(I), this.tags.push(...i), this.tagsLengthWillUpdate = !0, N(this.five).then(() => p(this, null, function* () {
353
- var o, s;
354
- this.store.eventListenerDisposer && ((s = (o = this.store).eventListenerDisposer) == null || s.call(o)), this.state.enabled && this.handleEnable(), this.addResizeListener(), this.clearUnusedPanelTag(), this.addMediaModelTag(i), i.forEach((n) => n.updateVisible()), this.setUnfolded(), this.addRenderQueue({ type: "TagContainerSvelte" });
354
+ var o, r;
355
+ this.store.eventListenerDisposer && ((r = (o = this.store).eventListenerDisposer) == null || r.call(o)), this.state.enabled && this.handleEnable(), this.addResizeListener(), this.clearUnusedPanelTag(), this.addMediaModelTag(i), i.forEach((n) => n.updateVisible()), this.setUnfolded(), this.addRenderQueue({ type: "TagContainerSvelte" });
355
356
  }));
356
357
  });
357
358
  }
@@ -417,11 +418,11 @@ class zi extends R {
417
418
  * @description 销毁
418
419
  */
419
420
  dispose() {
420
- var e, t, i, o, s, n;
421
- this.pauseCurrentMedia(), this.disposeAllCSS3DContainer(), (e = this.TagContainerSvelte) == null || e.$destroy(), this.filterCSS3DTag.forEach((r) => {
421
+ var e, t, i, o, r, n;
422
+ this.pauseCurrentMedia(), this.disposeAllCSS3DContainer(), (e = this.TagContainerSvelte) == null || e.$destroy(), this.filterCSS3DTag.forEach((s) => {
422
423
  var h;
423
- return (h = r.tag3DContentSvelte) == null ? void 0 : h.svelteApp.$destroy();
424
- }), this.tags.forEach((r) => r.cache.clear()), this.tags = [], this.tagsLengthWillUpdate = !0, (t = this.store.disposers) == null || t.forEach((r) => r == null ? void 0 : r()), this.store.disposers = [], (o = (i = this.store).eventListenerDisposer) == null || o.call(i), this.store.eventListenerDisposer = void 0, (n = (s = this.store).resizeObserverDisposer) == null || n.call(s), this.store.resizeObserverDisposer = void 0, this.store.resizeObserverDisposerAdding = !1, this.five.scene.remove(this.group), this.group.remove(...this.group.children), this.gltfObjectGroup.remove(...this.gltfObjectGroup.children), this.imagePlaneGroup.remove(...this.imagePlaneGroup.children), this.five.needsRender = !0, this.store.disposed = !0, this.hooks.emit("dispose");
424
+ return (h = s.tag3DContentSvelte) == null ? void 0 : h.svelteApp.$destroy();
425
+ }), this.tags.forEach((s) => s.cache.clear()), this.tags = [], this.tagsLengthWillUpdate = !0, (t = this.store.disposers) == null || t.forEach((s) => s == null ? void 0 : s()), this.store.disposers = [], (o = (i = this.store).eventListenerDisposer) == null || o.call(i), this.store.eventListenerDisposer = void 0, (n = (r = this.store).resizeObserverDisposer) == null || n.call(r), this.store.resizeObserverDisposer = void 0, this.store.resizeObserverDisposerAdding = !1, this.five.scene.remove(this.group), this.group.remove(...this.group.children), this.gltfObjectGroup.remove(...this.gltfObjectGroup.children), this.imagePlaneGroup.remove(...this.imagePlaneGroup.children), this.five.needsRender = !0, this.store.disposed = !0, this.hooks.emit("dispose");
425
426
  }
426
427
  /**
427
428
  * @description 闪烁标签
@@ -494,7 +495,7 @@ class zi extends R {
494
495
  */
495
496
  destroyTagById(e) {
496
497
  (Array.isArray(e) ? e : [e]).forEach((i) => {
497
- const o = this.tags.findIndex((s) => s.id === i);
498
+ const o = this.tags.findIndex((r) => r.id === i);
498
499
  o !== -1 && this.tags.splice(o, 1);
499
500
  }), this.tagsLengthWillUpdate = !0;
500
501
  }
@@ -531,8 +532,8 @@ class zi extends R {
531
532
  handleDisable() {
532
533
  var e, t, i;
533
534
  this.pauseCurrentMedia(), this.state.enabled = !1, (t = (e = this.store).eventListenerDisposer) == null || t.call(e), this.five.scene.remove(this.group), (i = this.TagContainerSvelte) == null || i.$set({ tags: [] }), this.filterCSS3DTag.forEach((o) => {
534
- var s;
535
- (s = o.tag3DContentSvelte) == null || s.dispose(), o.tag3DContentSvelte = void 0;
535
+ var r;
536
+ (r = o.tag3DContentSvelte) == null || r.dispose(), o.tag3DContentSvelte = void 0;
536
537
  }), this.five.needsRender = !0;
537
538
  }
538
539
  /**
@@ -565,17 +566,17 @@ class zi extends R {
565
566
  this.state.enabled && (this.filterPointTag.forEach((h) => h.updateScreenPosition({ force: !0 })), this.show());
566
567
  }, i = () => {
567
568
  this.state.enabled && this.hide();
568
- }, { observe: o, unobserve: s } = C(
569
+ }, { observe: o, unobserve: r } = C(
569
570
  y(() => {
570
571
  this.store.resizeObserverDisposer && i();
571
572
  }, 500),
572
573
  e
573
- ), { observe: n, unobserve: r } = C(
574
+ ), { observe: n, unobserve: s } = C(
574
575
  _(() => t(), 400),
575
576
  e
576
577
  );
577
578
  return o(), n(), () => {
578
- s(), r();
579
+ r(), s();
579
580
  };
580
581
  }
581
582
  setUnfoldedByCamera() {
@@ -595,12 +596,12 @@ class zi extends R {
595
596
  });
596
597
  }
597
598
  changeTagMode(e, t) {
598
- var i, o, s, n, r, h;
599
- ((i = e.config) == null ? void 0 : i.renderType) !== "Mesh" && ((n = (s = (o = e.tag3DContentSvelte) == null ? void 0 : o.css3DInstance) == null ? void 0 : s.css3DObject) == null ? void 0 : n.mode) !== t && ((r = e.config) != null && r.tag3DConfig ? e.config.tag3DConfig.mode = t : e.config ? e.config.tag3DConfig = { mode: t } : e.config = { tag3DConfig: { mode: t } }, (h = this.store.css3DRenderDisposer.get(e.id)) == null || h.forEach((g) => g == null ? void 0 : g()), e.tag3DContentSvelte = void 0);
599
+ var i, o, r, n, s, h;
600
+ ((i = e.config) == null ? void 0 : i.renderType) !== "Mesh" && ((n = (r = (o = e.tag3DContentSvelte) == null ? void 0 : o.css3DInstance) == null ? void 0 : r.css3DObject) == null ? void 0 : n.mode) !== t && ((s = e.config) != null && s.tag3DConfig ? e.config.tag3DConfig.mode = t : e.config ? e.config.tag3DConfig = { mode: t } : e.config = { tag3DConfig: { mode: t } }, (h = this.store.css3DRenderDisposer.get(e.id)) == null || h.forEach((g) => g == null ? void 0 : g()), e.tag3DContentSvelte = void 0);
600
601
  }
601
602
  }
602
603
  export {
603
- zi as PanoTagPluginController,
604
- zi as default,
605
- Vi as pluginFlag
604
+ xi as PanoTagPluginController,
605
+ xi as default,
606
+ zi as pluginFlag
606
607
  };
@@ -1,8 +1,8 @@
1
1
  import t from "./controller/index.js";
2
- import { pluginFlag as _r } from "./controller/index.js";
3
- import { defaultGlobalConfig as ot } from "./typings/tag/TagConfig.js";
4
- import { ContentType as tt, DimensionType as pt, PointType as it } from "./Archive/deprecated.js";
5
- import { BaseTag as et } from "./controller/Tag/BaseTag.js";
2
+ import { pluginFlag as $r } from "./controller/index.js";
3
+ import { defaultGlobalConfig as rt } from "./typings/tag/TagConfig.js";
4
+ import { ContentType as pt, DimensionType as it, PointType as mt } from "./Archive/deprecated.js";
5
+ import { BaseTag as nt } from "./controller/Tag/BaseTag.js";
6
6
  import "three";
7
7
  import "../vendor/object-assign-deep/objectAssignDeep.js";
8
8
  import "./utils/addDebugPoints.js";
@@ -142,6 +142,7 @@ import "../shared-utils/five/fiveModelLoad.js";
142
142
  import "../shared-utils/five/getFiveModel.js";
143
143
  import "../shared-utils/five/FiveDomEvents.js";
144
144
  import "../shared-utils/five/calculateThreeMouse.js";
145
+ import "../shared-utils/three/THREERaycaster.js";
145
146
  import "../base/BasePlugin.js";
146
147
  import "../shared-utils/Utils/FiveUtil.js";
147
148
  import "../shared-utils/Utils/BaseUtil.js";
@@ -155,15 +156,15 @@ import "./Components/TagContainer.js";
155
156
  import "./Components/TagItem.js";
156
157
  import "./Components/Common/TagPoint.js";
157
158
  import "../shared-utils/animationFrame/BetterTween.js";
158
- const Xr = (o, r) => new t(o, r);
159
+ const Yr = (o, r) => new t(o, r);
159
160
  export {
160
- et as BaseTag,
161
- tt as ContentType,
162
- pt as DimensionType,
163
- Xr as PanoTagPlugin,
161
+ nt as BaseTag,
162
+ pt as ContentType,
163
+ it as DimensionType,
164
+ Yr as PanoTagPlugin,
164
165
  t as PanoTagPluginController,
165
- it as PointType,
166
- Xr as default,
167
- ot as defaultGlobalConfig,
168
- _r as pluginFlag
166
+ mt as PointType,
167
+ Yr as default,
168
+ rt as defaultGlobalConfig,
169
+ $r as pluginFlag
169
170
  };
@@ -1,6 +1,7 @@
1
1
  import { defaultGlobalConfig as O } from "./tag/TagConfig.js";
2
2
  import { ContentType as R, DimensionType as S, PointType as U } from "../Archive/deprecated.js";
3
3
  import { BaseTag as W } from "../controller/Tag/BaseTag.js";
4
+ import "../../shared-utils/Subscribe.js";
4
5
  import "../utils/tag/calculateTagConfig.js";
5
6
  import "../../vendor/object-assign-deep/objectAssignDeep.js";
6
7
  import "../../shared-utils/typescript/entries.js";
@@ -18,7 +19,6 @@ import "../../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
18
19
  import "../../shared-utils/util.js";
19
20
  import "../../CSS3DRenderPlugin/utils/createResizeObserver.js";
20
21
  import "../../CSS3DRenderPlugin/utils/even.js";
21
- import "../../shared-utils/Subscribe.js";
22
22
  import "../../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
23
23
  import "../../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
24
24
  import "../../shared-utils/three/centerPoint.js";
@@ -24,6 +24,7 @@ import "../../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
24
24
  import "../../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
25
25
  import "../../../shared-utils/three/THREESphere.js";
26
26
  import "animejs";
27
+ import "../../../shared-utils/Subscribe.js";
27
28
  import "./calculateTagConfig.js";
28
29
  import "./format.js";
29
30
  import "../../../shared-utils/three/blink.js";
@@ -46,7 +47,6 @@ import "three/examples/jsm/renderers/CSS3DRenderer";
46
47
  import "../../../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
47
48
  import "../../../CSS3DRenderPlugin/utils/createResizeObserver.js";
48
49
  import "../../../CSS3DRenderPlugin/utils/even.js";
49
- import "../../../shared-utils/Subscribe.js";
50
50
  import "../../../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
51
51
  import "../../../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
52
52
  import "../../../shared-utils/three/getObjectVisible.js";
@@ -16,7 +16,7 @@ let c = class {
16
16
  /**
17
17
  * @realsee/dnalogel 版本号
18
18
  */
19
- e(this, "VERSION", "3.42.0-alpha-tag.19");
19
+ e(this, "VERSION", "3.42.0-alpha-tag.21");
20
20
  e(this, "NAME");
21
21
  e(this, "five");
22
22
  e(this, "workUtil");
package/libs/index.js CHANGED
@@ -366,6 +366,7 @@ import "./PanoTagPlugin/controller/TagUtil.js";
366
366
  import "./PanoTagPlugin/tag.config.js";
367
367
  import "./PanoTagPlugin/utils/normalPositionToPositions.js";
368
368
  import "./shared-utils/five/FiveDomEvents.js";
369
+ import "./shared-utils/three/THREERaycaster.js";
369
370
  import "./PanoTagPlugin/utils/DebugUtil.js";
370
371
  import "./PanoTagPlugin/controller/Tag/PointTag.js";
371
372
  import "./PanoTagPlugin/utils/requestIdleCallback.js";
@@ -454,7 +455,6 @@ import "./Sculpt/Meshes/Area.js";
454
455
  import "./Sculpt/Meshes/PolygonWithEdge.js";
455
456
  import "./Sculpt/Meshes/Polygon.js";
456
457
  import "./Sculpt/utils/three/ColoredMesh.js";
457
- import "./shared-utils/three/THREERaycaster.js";
458
458
  import "./Sculpt/Objects/Polygon/Editor.js";
459
459
  import "./Sculpt/Objects/Prism/index.js";
460
460
  import "./Sculpt/Meshes/Prism.js";
@@ -1,53 +1,57 @@
1
- var w = Object.defineProperty;
1
+ var M = Object.defineProperty;
2
2
  var L = Object.getOwnPropertySymbols;
3
- var M = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
4
- var p = (f, e, t) => e in f ? w(f, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : f[e] = t, D = (f, e) => {
3
+ var x = Object.prototype.hasOwnProperty, I = Object.prototype.propertyIsEnumerable;
4
+ var b = (c, e, t) => e in c ? M(c, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[e] = t, D = (c, e) => {
5
5
  for (var t in e || (e = {}))
6
- M.call(e, t) && p(f, t, e[t]);
6
+ x.call(e, t) && b(c, t, e[t]);
7
7
  if (L)
8
8
  for (var t of L(e))
9
- x.call(e, t) && p(f, t, e[t]);
10
- return f;
9
+ I.call(e, t) && b(c, t, e[t]);
10
+ return c;
11
11
  };
12
- var d = (f, e, t) => (p(f, typeof e != "symbol" ? e + "" : e, t), t);
13
- import * as I from "three";
12
+ var a = (c, e, t) => (b(c, typeof e != "symbol" ? e + "" : e, t), t);
14
13
  import { getObjectVisible as $ } from "../three/getObjectVisible.js";
15
14
  import { calculateThreeMouse as W } from "./calculateThreeMouse.js";
16
15
  import { getFiveModel as j } from "./getFiveModel.js";
17
- class N {
16
+ import { THREERaycaster as w } from "../three/THREERaycaster.js";
17
+ class B {
18
18
  constructor(e, t) {
19
- d(this, "five");
19
+ a(this, "five");
20
20
  /**
21
21
  * @description: 拖动中
22
22
  */
23
- d(this, "dragging", !1);
24
- d(this, "boundObject", {});
25
- d(this, "config");
26
- d(this, "handleWantsGesture", (e, t) => {
23
+ a(this, "dragging", !1);
24
+ a(this, "boundObject", {});
25
+ a(this, "config");
26
+ a(this, "handleWantsGesture", (e, t) => {
27
27
  if (t.length !== 1)
28
28
  return;
29
29
  const n = t[0];
30
+ if (n.raycaster) {
31
+ const r = new w();
32
+ r.ray = n.raycaster.ray, r.near = n.raycaster.near, r.far = n.raycaster.far, r.camera = n.raycaster.camera, r.layers = n.raycaster.layers, r.params = n.raycaster.params, n.raycaster = r;
33
+ }
30
34
  if (n) {
31
35
  if (e === "mouseMove" && this.onDomEvent("hover", n), e === "tap") {
32
- const i = this.onDomEvent("click", n), s = this.onDomEvent("wantDblclick", n, void 0, this.boundObject.dblclick);
33
- if (i === !1 || s === !1)
36
+ const r = this.onDomEvent("click", n), o = this.onDomEvent("wantDblclick", n, void 0, this.boundObject.dblclick);
37
+ if (r === !1 || o === !1)
34
38
  return !1;
35
39
  }
36
40
  if (this.dragging)
37
41
  return !1;
38
42
  }
39
43
  });
40
- d(this, "handleDomEvent", (e, t, n) => {
41
- const i = { x: t.clientX, y: t.clientY };
42
- this.onDomEvent(e, i, t, n);
44
+ a(this, "handleDomEvent", (e, t, n) => {
45
+ const r = { x: t.clientX, y: t.clientY };
46
+ this.onDomEvent(e, r, t, n);
43
47
  });
44
- d(this, "handleMouseEvent", (e) => {
48
+ a(this, "handleMouseEvent", (e) => {
45
49
  this.handleDomEvent(e.type, e);
46
50
  });
47
- d(this, "handleMousedown", (e) => {
51
+ a(this, "handleMousedown", (e) => {
48
52
  this.handleDomEvent("mousedown", e), this.handleDomEvent("dragstart", e, this.haveDragEventObject);
49
53
  });
50
- d(this, "handleMouseup", (e) => {
54
+ a(this, "handleMouseup", (e) => {
51
55
  var t;
52
56
  this.dragging = !1, (t = this.haveDragEventObject) == null || t.forEach((n) => {
53
57
  n._dragging && (n._dragging = !1, this.notify({
@@ -58,7 +62,7 @@ class N {
58
62
  }));
59
63
  }), this.handleDomEvent("mouseup", e);
60
64
  });
61
- d(this, "handleMousemove", (e) => {
65
+ a(this, "handleMousemove", (e) => {
62
66
  var t;
63
67
  this.dragging && ((t = this.boundObject.drag) == null || t.forEach((n) => {
64
68
  n._dragging && this.notify({
@@ -70,81 +74,81 @@ class N {
70
74
  }));
71
75
  });
72
76
  // eslint-disable-next-line complexity
73
- d(this, "onDomEvent", (e, t, n, i = this.boundObject[e]) => {
74
- var u, c, v;
75
- if (!t || !i || (i == null ? void 0 : i.length) === 0 || !this.model.loaded)
77
+ a(this, "onDomEvent", (e, t, n, r = this.boundObject[e]) => {
78
+ var u, l, m;
79
+ if (!t || !r || (r == null ? void 0 : r.length) === 0 || !this.model.loaded)
76
80
  return;
77
- const s = (u = t.raycaster) != null ? u : this.getRaycaster(t);
78
- s.params.Points.threshold = 0.02;
79
- const o = s.intersectObjects(i, !0);
80
- console.debug(o);
81
- const l = this.model.intersectRaycaster(s), h = 0.01;
82
- if (l.length > 0 && o.length > 0 && l[0].distance + h < o[0].distance)
81
+ const o = (u = t.raycaster) != null ? u : this.getRaycaster(t);
82
+ o.params.Points.threshold = 0.02;
83
+ const i = o.intersectObjects(r, !0);
84
+ console.debug(i);
85
+ const f = this.model.intersectRaycaster(o), h = 0.01;
86
+ if (f.length > 0 && i.length > 0 && f[0].distance + h < i[0].distance)
83
87
  return;
84
- const r = (c = o == null ? void 0 : o[0]) == null ? void 0 : c.object;
88
+ const s = (l = i == null ? void 0 : i[0]) == null ? void 0 : l.object;
85
89
  if (e === "wantDblclick")
86
90
  return !1;
87
- if ((!r || !this.objectIsBound(r)) && e === "hover")
88
- for (const m of (v = this.boundObject.hover) != null ? v : [])
89
- m._hovered && this.notify({ eventName: "unHover", object: m });
90
- if (r && r && this.notify({ eventName: e, object: r, originEvent: n, raycaster: s, intersects: o }))
91
+ if ((!s || !this.objectIsBound(s)) && e === "hover")
92
+ for (const v of (m = this.boundObject.hover) != null ? m : [])
93
+ v._hovered && this.notify({ eventName: "unHover", object: v });
94
+ if (s && s && this.notify({ eventName: e, object: s, originEvent: n, raycaster: o, intersects: i }))
91
95
  return !1;
92
96
  });
93
- d(this, "objectIsBound", (e) => {
97
+ a(this, "objectIsBound", (e) => {
94
98
  let t = e._domEvent, n = e.parent;
95
99
  for (; typeof t == "undefined" && n; )
96
100
  t = n._domEvent, n = n.parent;
97
101
  return !!t;
98
102
  });
99
- d(this, "notify", (e) => {
100
- var v, m, _;
101
- const { eventName: t, object: n, originEvent: i, raycaster: s, intersects: o } = e;
102
- let l = !1, h = [];
103
- const r = [];
103
+ a(this, "notify", (e) => {
104
+ var m, v, y;
105
+ const { eventName: t, object: n, originEvent: r, raycaster: o, intersects: i } = e;
106
+ let f = !1, h = [];
107
+ const s = [];
104
108
  let u = n;
105
- for (r.push(u); u.parent; )
106
- u = u.parent, r.push(u);
107
- const c = r.at(-1);
108
- if (!((v = this.config) != null && v.noEmitWhenNotInScene && c.type !== "Scene")) {
109
- for (const a of r) {
110
- if (l)
109
+ for (s.push(u); u.parent; )
110
+ u = u.parent, s.push(u);
111
+ const l = s.at(-1);
112
+ if (!((m = this.config) != null && m.noEmitWhenNotInScene && l.type !== "Scene")) {
113
+ for (const d of s) {
114
+ if (f)
111
115
  break;
112
- a.draggable && (t === "dragstart" && (a._dragging = !0, this.dragging = !0), t === "dragend" && (a._dragging = !1, this.dragging = !1));
113
- const O = a._domEvent;
114
- if (!O)
116
+ d.draggable && (t === "dragstart" && (d._dragging = !0, this.dragging = !0), t === "dragend" && (d._dragging = !1, this.dragging = !1));
117
+ const _ = d._domEvent;
118
+ if (!_)
115
119
  continue;
116
- const y = O[`${t}Handler`];
117
- if (y)
118
- for (const [H, E] of y) {
119
- if (E != null && E.noEmitWhenNotInScene && c.type !== "Scene" || ((m = this.config) != null && m.noEmitWhenHide || E != null && E.noEmitWhenHide) && !$(a))
120
+ const O = _[`${t}Handler`];
121
+ if (O)
122
+ for (const [H, E] of O) {
123
+ if (E != null && E.noEmitWhenNotInScene && l.type !== "Scene" || ((v = this.config) != null && v.noEmitWhenHide || E != null && E.noEmitWhenHide) && !$(d))
120
124
  continue;
121
125
  if (t === "hover") {
122
- if (a._hovered)
126
+ if (d._hovered)
123
127
  continue;
124
- a._hovered = !0;
125
- for (const g of (_ = this.boundObject.hover) != null ? _ : [])
126
- g !== a && g._hovered && this.notify({ eventName: "unHover", object: g });
128
+ d._hovered = !0;
129
+ for (const g of (y = this.boundObject.hover) != null ? y : [])
130
+ g !== d && g._hovered && this.notify({ eventName: "unHover", object: g });
127
131
  }
128
132
  if (t === "unHover") {
129
- if (!a._hovered)
133
+ if (!d._hovered)
130
134
  continue;
131
- a._hovered = !1;
135
+ d._hovered = !1;
132
136
  }
133
- const b = H({
137
+ const p = H({
134
138
  type: t,
135
- target: a,
136
- origDomEvent: i,
137
- raycaster: s,
138
- intersects: o,
139
+ target: d,
140
+ origDomEvent: r,
141
+ raycaster: o,
142
+ intersects: i,
139
143
  stopPropagation: () => {
140
- l = !0;
144
+ f = !0;
141
145
  }
142
146
  });
143
- h.push(b != null ? b : !0);
147
+ h.push(p != null ? p : !0);
144
148
  }
145
149
  }
146
150
  if (t === "click" || t === "wantDblclick")
147
- return h.some((a) => a === !0);
151
+ return h.some((d) => d === !0);
148
152
  }
149
153
  });
150
154
  this.five = e, this.config = t, e.on("wantsGesture", this.handleWantsGesture), document.addEventListener("mousedown", this.handleMousedown), document.addEventListener("dblclick", this.handleMouseEvent), document.addEventListener("mouseup", this.handleMouseup), document.addEventListener("mousemove", this.handleMousemove);
@@ -160,10 +164,10 @@ class N {
160
164
  * @note: 注意:目前需要触发物体的 added 事件和 removed 事件才会生效
161
165
  * @todo: added 和 removed 还是不太智能
162
166
  */
163
- addAutoBindEventListener(e, t, n, i) {
164
- const s = () => this.addEventListener(e, t, n, i), o = () => this.removeEventListener(e, t, n, i);
165
- return e.addEventListener("added", s), e.addEventListener("removed", o), e.addEventListener("dispose", o), () => {
166
- e.removeEventListener("added", s), e.removeEventListener("removed", o), e.removeEventListener("dispose", o);
167
+ addAutoBindEventListener(e, t, n, r) {
168
+ const o = () => this.addEventListener(e, t, n, r), i = () => this.removeEventListener(e, t, n, r);
169
+ return e.addEventListener("added", o), e.addEventListener("removed", i), e.addEventListener("dispose", i), () => {
170
+ e.removeEventListener("added", o), e.removeEventListener("removed", i), e.removeEventListener("dispose", i);
167
171
  };
168
172
  }
169
173
  /**
@@ -173,25 +177,25 @@ class N {
173
177
  * @param params.callback: 返回 false 可以不阻止 five 的 tap 事件; default: true
174
178
  * @return {void}
175
179
  */
176
- addEventListener(e, t, n, i) {
177
- e._domEvent || (e._domEvent = {}), e._domEvent[`${t}Handler`] || (e._domEvent[`${t}Handler`] = []), this.boundObject[t] || (this.boundObject[t] = []), this.boundObject[t].includes(e) || this.boundObject[t].push(e), e._domEvent[`${t}Handler`].push([n, D({ noEmitWhenHide: !1, noEmitWhenNotInScene: !1 }, i)]);
180
+ addEventListener(e, t, n, r) {
181
+ e._domEvent || (e._domEvent = {}), e._domEvent[`${t}Handler`] || (e._domEvent[`${t}Handler`] = []), this.boundObject[t] || (this.boundObject[t] = []), this.boundObject[t].includes(e) || this.boundObject[t].push(e), e._domEvent[`${t}Handler`].push([n, D({ noEmitWhenHide: !1, noEmitWhenNotInScene: !1 }, r)]);
178
182
  }
179
- removeEventListener(e, t, n, ...i) {
180
- var o, l;
183
+ removeEventListener(e, t, n, ...r) {
184
+ var i, f;
181
185
  if (!e._domEvent || (t === void 0 && (Object.keys(this.boundObject).forEach((h) => {
182
- var u, c;
183
- const r = (u = this.boundObject[h]) == null ? void 0 : u.findIndex((v) => v === e);
184
- r !== -1 && ((c = this.boundObject[h]) == null || c.splice(r, 1));
186
+ var u, l;
187
+ const s = (u = this.boundObject[h]) == null ? void 0 : u.findIndex((m) => m === e);
188
+ s !== -1 && ((l = this.boundObject[h]) == null || l.splice(s, 1));
185
189
  }), e._domEvent = {}), !e._domEvent[`${t}Handler`]))
186
190
  return;
187
191
  if (n === void 0) {
188
192
  delete e._domEvent[`${t}Handler`];
189
193
  return;
190
194
  }
191
- const s = e._domEvent[`${t}Handler`].findIndex((h) => h[0] === n);
192
- if (s !== -1 && (e._domEvent[`${t}Handler`].splice(s, 1), e._domEvent[`${t}Handler`].length === 0 && delete e._domEvent[`${t}Handler`], e._domEvent && Object.keys(e._domEvent).length === 0 && delete e._domEvent, !e._domEvent)) {
193
- const h = (o = this.boundObject[t]) == null ? void 0 : o.findIndex((r) => r === e);
194
- h !== -1 && ((l = this.boundObject[t]) == null || l.splice(h, 1));
195
+ const o = e._domEvent[`${t}Handler`].findIndex((h) => h[0] === n);
196
+ if (o !== -1 && (e._domEvent[`${t}Handler`].splice(o, 1), e._domEvent[`${t}Handler`].length === 0 && delete e._domEvent[`${t}Handler`], e._domEvent && Object.keys(e._domEvent).length === 0 && delete e._domEvent, !e._domEvent)) {
197
+ const h = (i = this.boundObject[t]) == null ? void 0 : i.findIndex((s) => s === e);
198
+ h !== -1 && ((f = this.boundObject[t]) == null || f.splice(h, 1));
195
199
  }
196
200
  }
197
201
  clear() {
@@ -210,10 +214,10 @@ class N {
210
214
  const t = this.five.getElement();
211
215
  if (!t)
212
216
  return;
213
- const n = W(e, t), i = new I.Raycaster();
214
- return i.setFromCamera(n, this.five.camera), i;
217
+ const n = W(e, t), r = new w();
218
+ return r.setFromCamera(n, this.five.camera), r;
215
219
  }
216
220
  }
217
221
  export {
218
- N as FiveDomEvents
222
+ B as FiveDomEvents
219
223
  };
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.42.0-alpha-tag.19",
3
+ "%c %c@realsee/dnalogel %cv3.42.0-alpha-tag.21",
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",