@realsee/dnalogel 3.77.2-alpha.0 → 3.77.3-alpha.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.
Files changed (136) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/Sculpt/Meshes/Line.d.ts +4 -0
  3. package/dist/Sculpt/Objects/Base/Editor.d.ts +20 -1
  4. package/dist/Sculpt/Objects/Box/index.d.ts +5 -2
  5. package/dist/Sculpt/Objects/Rectangle/index.d.ts +7 -4
  6. package/dist/floorplan/MapviewFloorplanPlugin/Controller.d.ts +21 -0
  7. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +16 -0
  8. package/dist/floorplan/typings/index.d.ts +3 -0
  9. package/dist/index.cjs.js +79 -79
  10. package/dist/index.js +6181 -6031
  11. package/dist/index.umd.js +71 -71
  12. package/dist/shared-utils/Object3DHelper/typings/Hooks.d.ts +4 -3
  13. package/dist/shared-utils/five/getFiveFromParentChain.d.ts +7 -0
  14. package/dist/shared-utils/three/PointSelector/index.d.ts +1 -1
  15. package/libs/AreaMakerPlugin/Controller.js +3 -2
  16. package/libs/AreaMakerPlugin/index.js +3 -2
  17. package/libs/AreaMakerPlugin/utils/Item.js +3 -2
  18. package/libs/CSS3DRenderPlugin/Controller.js +3 -2
  19. package/libs/CSS3DRenderPlugin/index.js +6 -5
  20. package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +39 -38
  21. package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +10 -9
  22. package/libs/CruisePlugin/BaseController.js +5 -4
  23. package/libs/CruisePlugin/Move.js +3 -2
  24. package/libs/CruisePlugin/Work.js +3 -2
  25. package/libs/CruisePlugin/index.js +7 -6
  26. package/libs/CurrentPanoImagePlugin/Controller.js +15 -14
  27. package/libs/CurrentPanoImagePlugin/index.js +4 -3
  28. package/libs/GuideLinePlugin/Controller.js +5 -4
  29. package/libs/GuideLinePlugin/GuideLineItem.js +3 -2
  30. package/libs/GuideLinePlugin/GuideLineModeItem.js +3 -2
  31. package/libs/GuideLinePlugin/index.js +7 -6
  32. package/libs/MeasurePlugin/Controller.js +11 -10
  33. package/libs/MeasurePlugin/index.js +5 -4
  34. package/libs/MeasurePlugin/utils/MeasureMesh.js +3 -2
  35. package/libs/ModelChassisCompassPlugin/Plugin.js +4 -3
  36. package/libs/ModelChassisCompassPlugin/index.js +1 -0
  37. package/libs/ModelEntryDoorGuidePlugin/Plugin.js +6 -5
  38. package/libs/ModelEntryDoorGuidePlugin/index.js +1 -0
  39. package/libs/ModelMakerPlugin/Controller.js +3 -2
  40. package/libs/ModelMakerPlugin/index.js +3 -2
  41. package/libs/ModelMakerPlugin/item/baseItem.js +3 -2
  42. package/libs/ModelMakerPlugin/item/boxItem.js +3 -2
  43. package/libs/ModelMakerPlugin/item/polygonItem.js +3 -2
  44. package/libs/ModelMakerPlugin/item/prismItem.js +3 -2
  45. package/libs/ModelTVVideoPlugin/Plugin.js +4 -3
  46. package/libs/ModelTVVideoPlugin/index.js +3 -2
  47. package/libs/ModelViewPlugin/Plugin.js +20 -19
  48. package/libs/ModelViewPlugin/index.js +1 -0
  49. package/libs/Object3DHelperPlugin/Controller.js +3 -2
  50. package/libs/Object3DHelperPlugin/index.js +6 -5
  51. package/libs/PanoCompassPlugin/Controller.js +3 -2
  52. package/libs/PanoCompassPlugin/index.js +4 -3
  53. package/libs/PanoDoorLabelPlugin/Controller.js +24 -23
  54. package/libs/PanoDoorLabelPlugin/index.js +4 -3
  55. package/libs/PanoMeasurePlugin/Components/Controller0.js +3 -2
  56. package/libs/PanoMeasurePlugin/Components/Controller1.js +3 -2
  57. package/libs/PanoMeasurePlugin/Controller/EditController.js +3 -2
  58. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +7 -10
  59. package/libs/PanoMeasurePlugin/Controller/WatchController.js +3 -2
  60. package/libs/PanoMeasurePlugin/Controller/index.js +3 -2
  61. package/libs/PanoMeasurePlugin/Model/area.js +3 -2
  62. package/libs/PanoMeasurePlugin/Modules/Magnifier.js +1 -0
  63. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +16 -15
  64. package/libs/PanoMeasurePlugin/index.js +14 -13
  65. package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +3 -2
  66. package/libs/PanoRulerProPlugin/Controller.js +3 -2
  67. package/libs/PanoRulerProPlugin/RulerItems.js +42 -41
  68. package/libs/PanoRulerProPlugin/index.js +4 -3
  69. package/libs/PanoSpatialTagPlugin/Plugin.js +34 -33
  70. package/libs/PanoSpatialTagPlugin/index.js +1 -0
  71. package/libs/PanoTagPlugin/Components/Common/TagPoint.js +3 -2
  72. package/libs/PanoTagPlugin/Components/Common/TagPopover/PopoverContent.js +3 -2
  73. package/libs/PanoTagPlugin/Components/Common/TagPopover/TagPopoverToolBar.js +3 -2
  74. package/libs/PanoTagPlugin/Components/Common/TagPopover/index.js +3 -2
  75. package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +3 -2
  76. package/libs/PanoTagPlugin/Components/Tag/index.js +3 -2
  77. package/libs/PanoTagPlugin/Components/TagContainer.js +3 -2
  78. package/libs/PanoTagPlugin/Components/TagItem.js +3 -2
  79. package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +3 -2
  80. package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +3 -2
  81. package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +3 -2
  82. package/libs/PanoTagPlugin/controller/Tag/PointTag.js +3 -2
  83. package/libs/PanoTagPlugin/controller/TagRender.js +3 -2
  84. package/libs/PanoTagPlugin/controller/TagUtil.js +3 -2
  85. package/libs/PanoTagPlugin/controller/index.js +6 -5
  86. package/libs/PanoTagPlugin/index.js +12 -11
  87. package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +3 -2
  88. package/libs/PanoTagPlugin/utils/tag/format.js +3 -2
  89. package/libs/PanoVideoPlugin/Controller.js +9 -8
  90. package/libs/PanoVideoPlugin/VideoMeshController.js +3 -2
  91. package/libs/PanoVideoPlugin/index.js +6 -5
  92. package/libs/PipelinePlugin/Controller.js +3 -2
  93. package/libs/PipelinePlugin/index.js +4 -3
  94. package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +3 -2
  95. package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +3 -2
  96. package/libs/PipelinePlugin/utils/Objects/Pipe.js +1 -0
  97. package/libs/Sculpt/Meshes/Line.d.ts +4 -0
  98. package/libs/Sculpt/Meshes/Line.js +85 -76
  99. package/libs/Sculpt/Meshes/Point.js +28 -28
  100. package/libs/Sculpt/Meshes/Polygon.js +43 -43
  101. package/libs/Sculpt/Objects/Base/Editor.d.ts +20 -1
  102. package/libs/Sculpt/Objects/Base/Editor.js +91 -35
  103. package/libs/Sculpt/Objects/Box/index.d.ts +5 -2
  104. package/libs/Sculpt/Objects/Box/index.js +61 -55
  105. package/libs/Sculpt/Objects/Prism/index.js +48 -47
  106. package/libs/Sculpt/Objects/Rectangle/index.d.ts +7 -4
  107. package/libs/Sculpt/Objects/Rectangle/index.js +119 -117
  108. package/libs/Sculpt/index.js +1 -1
  109. package/libs/Sculpt/utils/Modules/Cursor.js +7 -7
  110. package/libs/Sculpt/utils/Modules/Global.js +24 -24
  111. package/libs/base/BasePlugin.js +1 -1
  112. package/libs/floorplan/FloorplanGuidePlugin/Controller.js +3 -2
  113. package/libs/floorplan/FloorplanGuidePlugin/index.js +4 -3
  114. package/libs/floorplan/MapviewFloorplanPlugin/Controller.d.ts +21 -0
  115. package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +134 -92
  116. package/libs/floorplan/MapviewFloorplanPlugin/index.js +4 -3
  117. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +16 -0
  118. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +133 -104
  119. package/libs/floorplan/ModelFloorplanPlugin/index.js +5 -4
  120. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +3 -2
  121. package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +4 -3
  122. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +3 -2
  123. package/libs/floorplan/TopviewFloorplanPlugin/index.js +4 -3
  124. package/libs/floorplan/index.js +1 -1
  125. package/libs/floorplan/typings/index.d.ts +3 -0
  126. package/libs/index.js +151 -150
  127. package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +1 -1
  128. package/libs/shared-utils/Object3DHelper/Controller/RectangleScaleController.js +18 -18
  129. package/libs/shared-utils/Object3DHelper/Controller/RotateController.js +1 -1
  130. package/libs/shared-utils/Object3DHelper/typings/Hooks.d.ts +4 -3
  131. package/libs/shared-utils/five/getFiveFromParentChain.d.ts +7 -0
  132. package/libs/shared-utils/five/getFiveFromParentChain.js +15 -0
  133. package/libs/shared-utils/logger.js +1 -1
  134. package/libs/shared-utils/three/PointSelector/index.d.ts +1 -1
  135. package/libs/shared-utils/three/PointSelector/utils/PointHelper2.js +1 -0
  136. package/package.json +1 -1
@@ -1,62 +1,62 @@
1
- var O = Object.defineProperty, D = Object.defineProperties;
2
- var T = Object.getOwnPropertyDescriptors;
3
- var b = Object.getOwnPropertySymbols;
1
+ var D = Object.defineProperty, T = Object.defineProperties;
2
+ var R = Object.getOwnPropertyDescriptors;
3
+ var P = Object.getOwnPropertySymbols;
4
4
  var k = Object.prototype.hasOwnProperty, H = Object.prototype.propertyIsEnumerable;
5
- var v = (l, h, t) => h in l ? O(l, h, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[h] = t, m = (l, h) => {
5
+ var w = (l, h, t) => h in l ? D(l, h, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[h] = t, d = (l, h) => {
6
6
  for (var t in h || (h = {}))
7
- k.call(h, t) && v(l, t, h[t]);
8
- if (b)
9
- for (var t of b(h))
10
- H.call(h, t) && v(l, t, h[t]);
7
+ k.call(h, t) && w(l, t, h[t]);
8
+ if (P)
9
+ for (var t of P(h))
10
+ H.call(h, t) && w(l, t, h[t]);
11
11
  return l;
12
- }, g = (l, h) => D(l, T(h));
13
- var o = (l, h, t) => (v(l, typeof h != "symbol" ? h + "" : h, t), t);
14
- var f = (l, h, t) => new Promise((e, i) => {
12
+ }, u = (l, h) => T(l, R(h));
13
+ var o = (l, h, t) => (w(l, typeof h != "symbol" ? h + "" : h, t), t);
14
+ var c = (l, h, t) => new Promise((e, i) => {
15
15
  var s = (a) => {
16
16
  try {
17
17
  r(t.next(a));
18
- } catch (d) {
19
- i(d);
18
+ } catch (m) {
19
+ i(m);
20
20
  }
21
21
  }, n = (a) => {
22
22
  try {
23
23
  r(t.throw(a));
24
- } catch (d) {
25
- i(d);
24
+ } catch (m) {
25
+ i(m);
26
26
  }
27
27
  }, r = (a) => a.done ? e(a.value) : Promise.resolve(a.value).then(s, n);
28
28
  r((t = t.apply(l, h)).next());
29
29
  });
30
30
  import S from "./items.js";
31
- import * as C from "three";
32
- import { to as R } from "../../shared-utils/to.js";
33
- import { equal as U } from "../../shared-utils/equal.js";
34
- import { Main as N } from "../Components/Main.js";
35
- import { formatData as A } from "../utils/formatData.js";
36
- import { CAMERA_IMAGE as z } from "../Assets/camera.js";
37
- import { omit as F } from "../../shared-utils/filter.js";
38
- import { FLOOR_PLAN_ATTACHED_TO as W } from "../constant.js";
39
- import { Controller as G } from "../../base/BasePluginWithData.js";
40
- import { getPxmm as B, getAttachedY as j } from "../../shared-utils/getPxmm.js";
31
+ import * as v from "three";
32
+ import { to as U } from "../../shared-utils/to.js";
33
+ import { equal as z } from "../../shared-utils/equal.js";
34
+ import { Main as W } from "../Components/Main.js";
35
+ import { formatData as x } from "../utils/formatData.js";
36
+ import { CAMERA_IMAGE as N } from "../Assets/camera.js";
37
+ import { omit as A } from "../../shared-utils/filter.js";
38
+ import { FLOOR_PLAN_ATTACHED_TO as G } from "../constant.js";
39
+ import { Controller as j } from "../../base/BasePluginWithData.js";
40
+ import { getPxmm as B, getAttachedY as C } from "../../shared-utils/getPxmm.js";
41
41
  import { correctFiveState as V } from "../utils/correctFiveState.js";
42
- import { changeModelCanvasOpacity as E } from "../../shared-utils/changeModelCanvasOpacity.js";
43
- import { FloorplanErrorType as c, SHOW_ANIME_DURATION as $ } from "../utils/constant.js";
42
+ import { changeModelCanvasOpacity as I } from "../../shared-utils/changeModelCanvasOpacity.js";
43
+ import { FloorplanErrorType as f, SHOW_ANIME_DURATION as Z } from "../utils/constant.js";
44
44
  import "../../shared-utils/tag.js";
45
45
  import "../../vendor/hammerjs/hammer.js";
46
46
  import "../../shared-utils/three/PointSelector/index.js";
47
47
  import "../../shared-utils/three/CSS3DRenderer/index.js";
48
- import { waitFiveModelLoaded as Y } from "../../shared-utils/five/fiveModelLoad.js";
48
+ import { waitFiveModelLoaded as $ } from "../../shared-utils/five/fiveModelLoad.js";
49
49
  import "../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
50
50
  import "@realsee/five/line";
51
- import { isNil as q } from "../../shared-utils/isNil.js";
51
+ import { isNil as Y } from "../../shared-utils/isNil.js";
52
52
  import "../../shared-utils/three/core/Five_LineMaterial2.js";
53
53
  import "../../shared-utils/three/core/Sphere.js";
54
54
  import "../../shared-utils/three/blink.js";
55
55
  import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
56
56
  import "../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
57
57
  import "../../vendor/earcut/src/earcut.js";
58
- import { FLOORPLAN_DEFAULT_IMAGE as J } from "../../shared-utils/url/defaultUrls.js";
59
- import { replaceStaticPrefix as X } from "../../shared-utils/url/replace-static-prefix.js";
58
+ import { FLOORPLAN_DEFAULT_IMAGE as q } from "../../shared-utils/url/defaultUrls.js";
59
+ import { replaceStaticPrefix as J } from "../../shared-utils/url/replace-static-prefix.js";
60
60
  import "../../shared-utils/five/FivePuppet.js";
61
61
  import "../../shared-utils/isTruelyObject.js";
62
62
  import "../../vendor/svelte/internal/index.js";
@@ -129,6 +129,7 @@ import "../../shared-utils/three/IObject3D.js";
129
129
  import "../../Sculpt/utils/Meshes/getLengthHTML.js";
130
130
  import "../../shared-utils/three/applyObjectMatrixWorld.js";
131
131
  import "../../shared-utils/util.js";
132
+ import "../../shared-utils/five/getFiveFromParentChain.js";
132
133
  import "../../shared-utils/three/core/LineGeometry.js";
133
134
  import "../../shared-utils/three/core/LineMaterial.js";
134
135
  import "../../shared-utils/three/core/Line2.js";
@@ -147,7 +148,7 @@ import "../../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
147
148
  import "../../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
148
149
  import "@realsee/five";
149
150
  import "../../shared-utils/url/absoluteUrl.js";
150
- const Z = "//vr-image-4.realsee-cdn.cn/release/static/image/doctorstrange/0.6.201-beta/";
151
+ const X = "//vr-image-4.realsee-cdn.cn/release/static/image/doctorstrange/0.6.201-beta/";
151
152
  function K(l) {
152
153
  const { latitude: h, longitude: t } = l, e = Math.abs(h - Math.PI / 2) > 5 * Math.PI / 180, i = t > 5 * (Math.PI / 180) && t < 355 * (Math.PI / 180);
153
154
  return e || i;
@@ -156,9 +157,9 @@ function Q(l) {
156
157
  const { latitude: h, longitude: t } = l, e = Math.abs(h - Math.PI / 2) < 10 * Math.PI / 180, i = t < 30 * (Math.PI / 180) || t > 330 * (Math.PI / 180);
157
158
  return e && i;
158
159
  }
159
- class pi extends G {
160
+ class ci extends j {
160
161
  constructor(t, e) {
161
- var a, d;
162
+ var a, m;
162
163
  super(t);
163
164
  // =============== public properties =================
164
165
  o(this, "name", "modelFloorplanPlugin");
@@ -209,22 +210,22 @@ class pi extends G {
209
210
  * @param opts.isAutoShow 是否是自动展示
210
211
  * @param opts.userAction 是否是用户行为
211
212
  */
212
- o(this, "show", (...e) => f(this, [...e], function* (t = {}) {
213
+ o(this, "show", (...e) => c(this, [...e], function* (t = {}) {
213
214
  if (!this.state.enabled || !this.showPromise && this.state.visible)
214
215
  return;
215
216
  const i = t.userAction !== void 0 ? t.userAction : !0;
216
217
  this.updateState({ visible: !0 }, i), this._show(t);
217
218
  }));
218
219
  /** 隐藏户型图 */
219
- o(this, "hide", (...e) => f(this, [...e], function* (t = {}) {
220
+ o(this, "hide", (...e) => c(this, [...e], function* (t = {}) {
220
221
  this.state.enabled && (this.isHiddenByHideFunc = !0, this.state.visible !== !1 && (this.updateState({ visible: !1 }, t.userAction || !0), this._hide(t)));
221
222
  }));
222
223
  /** 更新户型图大小 */
223
224
  o(this, "updateSize", () => {
224
225
  if (!this.data || !this.container || !this.wrapper)
225
226
  return !1;
226
- const { min: t, max: e } = this.data.bounding, i = e.x - t.x, s = e.y - t.y, n = this.state.config.attachedTo ? { attachedTo: this.state.config.attachedTo } : void 0, r = B(this.five, this.wrapper, this.floorIndex, n), a = Math.ceil(i * r), d = Math.ceil(s * r);
227
- return this.size.width === a && this.size.height === d || (this.container.style.width = a + "px", this.container.style.height = d + "px", this.size = { width: a, height: d }), !0;
227
+ const { min: t, max: e } = this.data.bounding, i = e.x - t.x, s = e.y - t.y, n = this.getPxmmWithRotation(), r = Math.ceil(i * n), a = Math.ceil(s * n);
228
+ return this.size.width === r && this.size.height === a || (this.container.style.width = r + "px", this.container.style.height = a + "px", this.size = { width: r, height: a }), !0;
228
229
  });
229
230
  o(this, "highlight", (t) => {
230
231
  this.state.config.highlightEnable && (this.highlightData = t, this.render());
@@ -232,23 +233,33 @@ class pi extends G {
232
233
  o(this, "unhighlight", () => {
233
234
  this.highlightData = {}, this.render();
234
235
  });
236
+ /** 更新展示状态
237
+ * @description 可以更新 longitude、latitude、offset 等参数
238
+ * @param showState 需要更新的状态,会与现有状态合并
239
+ * @example
240
+ * // 更新 longitude
241
+ * plugin.updateShowState({ longitude: Math.PI / 2 })
242
+ */
243
+ o(this, "updateShowState", (t) => {
244
+ this.showState = d(d({}, this.showState), t);
245
+ });
235
246
  o(this, "_disable", (t) => {
236
247
  var i, s, n;
237
248
  const { userAction: e } = t;
238
- this.hooks.emit("disable", { userAction: e }), (i = this.showRejection) == null || i.call(this, c.BreakOffByDisable), this.showPromise = void 0, (s = this.app) == null || s.$destroy(), this.app = void 0, (n = this.container) == null || n.remove(), this.removeEventListener();
249
+ this.hooks.emit("disable", { userAction: e }), (i = this.showRejection) == null || i.call(this, f.BreakOffByDisable), this.showPromise = void 0, (s = this.app) == null || s.$destroy(), this.app = void 0, (n = this.container) == null || n.remove(), this.removeEventListener();
239
250
  });
240
251
  o(this, "_enable", (t) => {
241
252
  const { userAction: e } = t;
242
253
  this.addEventListener(), this.wrapper && (this.wrapper.append(this.container), this.hooks.emit("enable", { userAction: e }), this.state.visible && this._show({ userAction: e }));
243
254
  });
244
- o(this, "_show", (t) => f(this, null, function* () {
255
+ o(this, "_show", (t) => c(this, null, function* () {
245
256
  var n;
246
257
  if (!this.state.enabled)
247
258
  return;
248
259
  if (!((n = this.fiveUtil.model) != null && n.loaded))
249
- throw new Error(c.ModelNotLoaded);
260
+ throw new Error(f.ModelNotLoaded);
250
261
  if (!this.data)
251
- throw new Error(c.DataNotLoaded);
262
+ throw new Error(f.DataNotLoaded);
252
263
  if (this.showPromise)
253
264
  return this.showPromise;
254
265
  const e = {
@@ -257,25 +268,25 @@ class pi extends G {
257
268
  immediately: !1,
258
269
  isAutoShow: !1,
259
270
  userAction: !0
260
- }, i = m(m({}, e), t), s = () => f(this, null, function* () {
271
+ }, i = d(d({}, e), t), s = () => c(this, null, function* () {
261
272
  this.hooks.emit("show", { userAction: i.userAction, auto: i.isAutoShow });
262
273
  let r = !1, a;
263
- this.showRejection = (u) => {
264
- r = !0, a = u;
274
+ this.showRejection = (g) => {
275
+ r = !0, a = g;
265
276
  };
266
- const [d] = yield R(V(this.five, this.showState, i.userAction));
267
- if (d)
268
- throw d;
277
+ const [m] = yield U(V(this.five, this.showState, i.userAction));
278
+ if (m)
279
+ throw m;
269
280
  if (r)
270
- throw a ? new Error(a) : new Error(c.UnknownError);
281
+ throw a ? new Error(a) : new Error(f.UnknownError);
271
282
  if (!this.updateSize())
272
- throw new Error(c.UpdateSizeError);
283
+ throw new Error(f.UpdateSizeError);
273
284
  this.updatePosition(), this.floorIndex = i.floorIndex, this.fiveUtil.model.show(this.floorIndex);
274
285
  });
275
286
  return this.isHiddenByHideFunc = !1, this.showPromise = s().then(() => {
276
287
  this.showPromise = void 0, this.showRejection = void 0;
277
- const r = i.modelOpacity, a = i.immediately ? 0 : $;
278
- E(this.five, r, a), this.render(a), this.hooks.emit("showAnimationEnded", {
288
+ const r = i.modelOpacity, a = i.immediately ? 0 : Z;
289
+ I(this.five, r, a), this.render(a), this.hooks.emit("showAnimationEnded", {
279
290
  auto: i.isAutoShow,
280
291
  userAction: i.userAction
281
292
  });
@@ -286,12 +297,12 @@ class pi extends G {
286
297
  }));
287
298
  o(this, "_hide", (t) => {
288
299
  var s;
289
- (s = this.showRejection) == null || s.call(this, c.BreakOffByHide), this.showPromise = void 0;
290
- const i = m(m({}, {
300
+ (s = this.showRejection) == null || s.call(this, f.BreakOffByHide), this.showPromise = void 0;
301
+ const i = d(d({}, {
291
302
  userAction: !0,
292
303
  isAutoHide: !1
293
304
  }), t);
294
- E(this.five, 1, 0), this.hooks.emit("hide", { auto: i.isAutoHide, userAction: i.userAction }), this.render();
305
+ I(this.five, 1, 0), this.hooks.emit("hide", { auto: i.isAutoHide, userAction: i.userAction }), this.render();
295
306
  });
296
307
  o(this, "handleClick", () => {
297
308
  if (!this.state.visible)
@@ -301,7 +312,7 @@ class pi extends G {
301
312
  });
302
313
  /** modelLoaded 之后自动执行 append container 操作 */
303
314
  o(this, "onFiveModelLoaded", () => {
304
- const i = this.five.models.find((n) => n.name === this.five.state.workCode).bounding.getCenter(new C.Vector3());
315
+ const i = this.five.models.find((n) => n.name === this.five.state.workCode).bounding.getCenter(new v.Vector3());
305
316
  if (this.showState.offset = i, this.state.enabled === !1 || this.wrapper || !this.selector)
306
317
  return;
307
318
  const s = this.selector instanceof Element ? this.selector : document.querySelector(this.selector);
@@ -318,7 +329,10 @@ class pi extends G {
318
329
  if (!e || this.state.visible || this.state.config.autoShowEnable === !1 || this.isHiddenByHideFunc)
319
330
  return;
320
331
  const i = this.five.getCurrentState();
321
- i.mode === this.showState.mode && Q(i) && (this.updateState({ visible: !0 }, !0), this._show({ isAutoShow: !0 }));
332
+ if (i.mode !== this.showState.mode)
333
+ return;
334
+ const s = this.getRelativePose(i);
335
+ Q(s) && (this.updateState({ visible: !0 }, !0), this._show({ isAutoShow: !0 }));
322
336
  });
323
337
  /** panoIndex 改变时,更新 floorIndex */
324
338
  o(this, "onFivePanoArrived", (t) => {
@@ -330,12 +344,14 @@ class pi extends G {
330
344
  if (!this.state.visible || this.showPromise)
331
345
  return;
332
346
  const i = this.five.getCurrentState();
333
- this.updatePosition(), this.updateSize(), K(i) && (this.updateState({ visible: !1 }, e), this._hide({ userAction: e }));
347
+ this.updatePosition(), this.updateSize();
348
+ const s = this.getRelativePose(i);
349
+ K(s) && (this.updateState({ visible: !1 }, e), this._hide({ userAction: e }));
334
350
  });
335
351
  /** 户型图展示中,转动三维模型,结束时应该自动修复模型状态 */
336
352
  o(this, "onFiveWantsPanGesture", (t, e) => {
337
353
  if (this.five.getCurrentState().mode === this.showState.mode && this.state.config.autoShowEnable !== !1 && e && this.state.visible)
338
- return this.five.updateCamera(F(this.showState, ["offset"]), 0), !1;
354
+ return this.five.updateCamera(A(this.showState, ["offset"]), 0), !1;
339
355
  });
340
356
  /** 阻止点击分间走点 */
341
357
  o(this, "onFiveWantsTapGesture", () => this.handleClick());
@@ -354,15 +370,15 @@ class pi extends G {
354
370
  this.floorIndex = t, this.updateSize(), this.render();
355
371
  }
356
372
  });
357
- e != null && e.selector && (this.selector = e.selector, console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")), this.showState = {
373
+ e != null && e.selector && (this.selector = e.selector, console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")), this.showState = d({
358
374
  mode: "Mapview",
359
375
  longitude: 0,
360
376
  latitude: Math.PI / 2
361
- }, this.defaultMissingFloorConfig = {
362
- imageURL: X(e == null ? void 0 : e.staticPrefix, J),
377
+ }, e == null ? void 0 : e.showState), this.defaultMissingFloorConfig = {
378
+ imageURL: J(e == null ? void 0 : e.staticPrefix, q),
363
379
  imageWidth: 200,
364
380
  imageHeight: 120,
365
- text: (d = (a = e.i18n) == null ? void 0 : a.call(e, "暂无平面图")) != null ? d : "暂无平面图",
381
+ text: (m = (a = e.i18n) == null ? void 0 : a.call(e, "暂无平面图")) != null ? m : "暂无平面图",
366
382
  textFontSize: 14
367
383
  };
368
384
  const i = {
@@ -379,44 +395,44 @@ class pi extends G {
379
395
  roomNameEnable: !0,
380
396
  roomNameOtherTypeEnable: !0,
381
397
  roomDimensionEnable: !0,
382
- cameraImageUrl: z,
383
- attachedTo: W.BOUNDING_CENTER,
398
+ cameraImageUrl: N,
399
+ attachedTo: G.BOUNDING_CENTER,
384
400
  getLabelElement: void 0,
385
401
  adaptiveRoomLabelVisibleEnable: !0,
386
- missingFloorConfig: m(m({}, this.defaultMissingFloorConfig), e.missingFloorConfig),
402
+ missingFloorConfig: d(d({}, this.defaultMissingFloorConfig), e.missingFloorConfig),
387
403
  i18n: (p) => p,
388
404
  getRoomAreaText: (p) => (p / 1e6).toFixed(1) + "㎡",
389
- getRoomDimensionText: (p, u) => (p / 1e3).toFixed(1) + "m × " + (u / 1e3).toFixed(1) + "m",
405
+ getRoomDimensionText: (p, g) => (p / 1e3).toFixed(1) + "m × " + (g / 1e3).toFixed(1) + "m",
390
406
  getRuleDistanceText: (p) => p.toString()
391
- }, s = e ? F(e, ["selector", "scale"]) : {}, n = m(m({}, i.missingFloorConfig), s.missingFloorConfig), r = g(m(m({}, i), s), { missingFloorConfig: n });
392
- this.state = { enabled: !0, visible: !1, config: r }, this.panoIndex = t.getCurrentState().panoIndex, this.initContainer(), Y(t).then(this.onFiveModelLoaded), t.once("dispose", this.dispose), this.addEventListener();
407
+ }, s = e ? A(e, ["selector", "scale"]) : {}, n = d(d({}, i.missingFloorConfig), s.missingFloorConfig), r = u(d(d({}, i), s), { missingFloorConfig: n });
408
+ this.state = { enabled: !0, visible: !1, config: r }, this.panoIndex = t.getCurrentState().panoIndex, this.initContainer(), $(t).then(this.onFiveModelLoaded), t.once("dispose", this.dispose), this.addEventListener();
393
409
  }
394
410
  load(t, e, i = !0) {
395
- return f(this, null, function* () {
411
+ return c(this, null, function* () {
396
412
  function s(p) {
397
413
  return Object.prototype.hasOwnProperty.apply(p, ["version"]);
398
414
  }
399
415
  const n = t;
400
- n && q(n.version) && console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");
401
- const r = JSON.parse(JSON.stringify(t)), a = s(r) ? r.data : r, d = this.data;
402
- this.data = yield A(a), this.hooks.emit("dataLoaded", this.data), this.hooks.emit("dataChange", this.data, d), e && this.updateState(e, i), this.render();
416
+ n && Y(n.version) && console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");
417
+ const r = JSON.parse(JSON.stringify(t)), a = s(r) ? r.data : r, m = this.data;
418
+ this.data = yield x(a), this.hooks.emit("dataLoaded", this.data), this.hooks.emit("dataChange", this.data, m), e && this.updateState(e, i), this.render();
403
419
  });
404
420
  }
405
421
  loadItems(t) {
406
422
  const { min: e, max: i } = this.data.bounding, s = i.x - e.x, n = i.y - e.y;
407
423
  this.data.floorDatas.forEach((r, a) => {
408
- r.items = t[a].filter((d) => d.displayName === "Item-SimpleItem").map((d) => {
409
- const { x: p, y: u, width: P, height: x, notes: y, type: w, id: I, rotateX: M, rotateY: L, rotateZ: _ = 0 } = d;
424
+ r.items = t[a].filter((m) => m.displayName === "Item-SimpleItem").map((m) => {
425
+ const { x: p, y: g, width: F, height: M, notes: E, type: b, id: y, rotateX: L, rotateY: _, rotateZ: O = 0 } = m;
410
426
  return {
411
- id: I,
412
- positionInImage: { x: (p - e.x) / s, y: (i.y - u) / n },
413
- width: P / s,
414
- height: x / n,
415
- src: Z + S[w].href.replace(/\{\{\stheme\s\}\}/, "realsee"),
416
- notes: y || S[w].description,
417
- rotateX: M,
418
- rotateY: L,
419
- rotateZ: _
427
+ id: y,
428
+ positionInImage: { x: (p - e.x) / s, y: (i.y - g) / n },
429
+ width: F / s,
430
+ height: M / n,
431
+ src: X + S[b].href.replace(/\{\{\stheme\s\}\}/, "realsee"),
432
+ notes: E || S[b].description,
433
+ rotateX: L,
434
+ rotateY: _,
435
+ rotateZ: O
420
436
  };
421
437
  });
422
438
  });
@@ -451,24 +467,42 @@ class pi extends G {
451
467
  changeConfigs(t, e = !0) {
452
468
  this.updateState({ config: t }, e), this.render();
453
469
  }
470
+ /** 根据旋转角度计算 pxmm
471
+ * @description 当 longitude 大于 45° 或小于 -45°(相对于基准方向)时,使用 Z 轴计算
472
+ */
473
+ getPxmmWithRotation() {
474
+ if (!this.wrapper)
475
+ return 0;
476
+ const t = this.state.config.attachedTo ? { attachedTo: this.state.config.attachedTo } : void 0, e = this.showState.longitude, i = Math.abs((e % (2 * Math.PI) + 2 * Math.PI) % (2 * Math.PI));
477
+ return i > Math.PI / 4 && i < 3 * Math.PI / 4 || i > 5 * Math.PI / 4 && i < 7 * Math.PI / 4 ? this.getPxmmZAxis(t) : B(this.five, this.wrapper, this.floorIndex, t);
478
+ }
479
+ /** 使用 Z 轴计算 pxmm
480
+ * @description 当相机旋转导致 X 轴接近垂直于屏幕时,改用 Z 轴计算
481
+ */
482
+ getPxmmZAxis(t) {
483
+ if (!this.wrapper)
484
+ return 0;
485
+ const e = C(this.five, this.floorIndex, t == null ? void 0 : t.attachedTo), i = new v.Vector3(0, e, 0), s = new v.Vector3(0, e, 1), n = i.clone().project(this.five.camera), r = s.clone().project(this.five.camera);
486
+ return Math.abs((r.x - n.x) / 1e3) * (this.wrapper.getBoundingClientRect().width / 2);
487
+ }
454
488
  /** 更新户型图位置 */
455
489
  updatePosition() {
456
490
  var r;
457
- const t = j(this.five, this.floorIndex, this.state.config.attachedTo), e = (r = this.fiveUtil.model) == null ? void 0 : r.bounding.getCenter(new C.Vector3()).setY(t);
491
+ const t = C(this.five, this.floorIndex, this.state.config.attachedTo), e = (r = this.fiveUtil.model) == null ? void 0 : r.bounding.getCenter(new v.Vector3()).setY(t);
458
492
  if (!e)
459
493
  return;
460
494
  const i = e.clone().project(this.five.camera), s = (i.x + 1) / 2, n = -(i.y - 1) / 2;
461
495
  this.container.style.left = s * 100 + "%", this.container.style.top = n * 100 + "%";
462
496
  }
463
497
  formatData(t) {
464
- return f(this, null, function* () {
465
- return yield A(t.data);
498
+ return c(this, null, function* () {
499
+ return yield x(t.data);
466
500
  });
467
501
  }
468
502
  updateState(t, e) {
469
503
  var r;
470
- const i = this.state, s = (r = t.config) != null && r.missingFloorConfig ? m(m({}, i.config.missingFloorConfig), t.config.missingFloorConfig) : i.config.missingFloorConfig, n = t.config ? g(m(m({}, i.config), t.config), { missingFloorConfig: s }) : i.config;
471
- this.state = g(m(m({}, this.state), t), { config: n }), !U(this.state, i, { deep: !0 }) && this.hooks.emit("stateChange", { state: this.state, prevState: i, userAction: e });
504
+ const i = this.state, s = (r = t.config) != null && r.missingFloorConfig ? d(d({}, i.config.missingFloorConfig), t.config.missingFloorConfig) : i.config.missingFloorConfig, n = t.config ? u(d(d({}, i.config), t.config), { missingFloorConfig: s }) : i.config;
505
+ this.state = u(d(d({}, this.state), t), { config: n }), !z(this.state, i, { deep: !0 }) && this.hooks.emit("stateChange", { state: this.state, prevState: i, userAction: e });
472
506
  }
473
507
  /** 如果用户是通过 selector 设置父容器,需要在 modelLoaded 之后把 container 自动放到父容器里
474
508
  *
@@ -494,10 +528,18 @@ class pi extends G {
494
528
  const t = this.five;
495
529
  this.hasAddedEventListener = !1, t.off("modelLoaded", this.onFiveModelLoaded), t.off("modeChange", this.onFiveModeChange), t.off("panoArrived", this.onFivePanoArrived), t.off("cameraUpdate", this.onFiveCameraUpdate), t.off("wantsPanGesture", this.onFiveWantsPanGesture), t.off("wantsTapGesture", this.onFiveWantsTapGesture), t.off("wantsChangeMode", this.onFiveWantsChangeMode), t.off("modelShownFloorChange", this.onModelShownFloorChange);
496
530
  }
531
+ /** 获取相对于 showState 的 pose 偏差
532
+ * @description 将当前相机状态的 longitude 减去 showState.longitude,归一化后返回
533
+ * 这样自动隐藏逻辑会检查相对偏差,而不是绝对值
534
+ */
535
+ getRelativePose(t) {
536
+ const e = this.showState.longitude || 0, s = ((t.longitude - e) % (2 * Math.PI) + 2 * Math.PI) % (2 * Math.PI);
537
+ return u(d({}, t), { longitude: s });
538
+ }
497
539
  render(t) {
498
540
  if (!this.state.enabled || !this.container || !this.data || this.size.width === 0 || this.showPromise)
499
541
  return;
500
- const e = g(m({}, this.state.config), {
542
+ const e = u(d({}, this.state.config), {
501
543
  visible: this.state.visible,
502
544
  duration: t != null ? t : 0,
503
545
  panoIndex: this.panoIndex,
@@ -510,9 +552,9 @@ class pi extends G {
510
552
  });
511
553
  if (this.app)
512
554
  return this.app.$set(e);
513
- this.app = new N({ target: this.container, intro: !0, props: e });
555
+ this.app = new W({ target: this.container, intro: !0, props: e });
514
556
  }
515
557
  }
516
558
  export {
517
- pi as Controller
559
+ ci as Controller
518
560
  };
@@ -94,6 +94,7 @@ import "../../Sculpt/typings/style.js";
94
94
  import "../../shared-utils/three/IObject3D.js";
95
95
  import "../../Sculpt/utils/Meshes/getLengthHTML.js";
96
96
  import "../../shared-utils/three/applyObjectMatrixWorld.js";
97
+ import "../../shared-utils/five/getFiveFromParentChain.js";
97
98
  import "../../shared-utils/three/core/LineGeometry.js";
98
99
  import "../../shared-utils/three/core/LineMaterial.js";
99
100
  import "../../shared-utils/three/core/Line2.js";
@@ -119,8 +120,8 @@ import "../../shared-utils/translateMode/getDistanceFromModel.js";
119
120
  import "../../shared-utils/changeModelCanvasOpacity.js";
120
121
  import "../../shared-utils/url/replace-static-prefix.js";
121
122
  import "../../shared-utils/url/absoluteUrl.js";
122
- const vr = (o, r) => new t(o, r);
123
+ const xr = (o, r) => new t(o, r);
123
124
  export {
124
- vr as MapviewFloorplanPlugin,
125
- vr as default
125
+ xr as MapviewFloorplanPlugin,
126
+ xr as default
126
127
  };
@@ -65,8 +65,24 @@ export declare class Controller extends BasePlugin.Controller<State, EventMap, P
65
65
  changeConfigs(config: Partial<Config>, userAction?: boolean): void;
66
66
  /** 更新户型图大小 */
67
67
  updateSize: () => boolean;
68
+ /** 根据旋转角度计算 pxmm
69
+ * @description 当 longitude 大于 45° 或小于 -45°(相对于基准方向)时,使用 Z 轴计算
70
+ */
71
+ private getPxmmWithRotation;
72
+ /** 使用 Z 轴计算 pxmm
73
+ * @description 当相机旋转导致 X 轴接近垂直于屏幕时,改用 Z 轴计算
74
+ */
75
+ private getPxmmZAxis;
68
76
  highlight: (highlightData: HighlightData) => void;
69
77
  unhighlight: () => void;
78
+ /** 更新展示状态
79
+ * @description 可以更新 longitude、latitude、fov 等参数
80
+ * @param showState 需要更新的状态,会与现有状态合并
81
+ * @example
82
+ * // 更新 longitude
83
+ * plugin.updateShowState({ longitude: Math.PI / 2 })
84
+ */
85
+ updateShowState: (showState: Partial<ShowState>) => void;
70
86
  protected formatData(serverData: PluginServerData): Promise<PluginData>;
71
87
  private _disable;
72
88
  private _enable;