@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,60 +1,60 @@
1
- var S = Object.defineProperty, C = Object.defineProperties;
2
- var E = Object.getOwnPropertyDescriptors;
1
+ var P = Object.defineProperty, C = Object.defineProperties;
2
+ var x = Object.getOwnPropertyDescriptors;
3
3
  var w = Object.getOwnPropertySymbols;
4
- var P = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
5
- var v = (d, s, t) => s in d ? S(d, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[s] = t, l = (d, s) => {
6
- for (var t in s || (s = {}))
7
- P.call(s, t) && v(d, t, s[t]);
4
+ var E = Object.prototype.hasOwnProperty, M = Object.prototype.propertyIsEnumerable;
5
+ var v = (l, a, t) => a in l ? P(l, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[a] = t, d = (l, a) => {
6
+ for (var t in a || (a = {}))
7
+ E.call(a, t) && v(l, t, a[t]);
8
8
  if (w)
9
- for (var t of w(s))
10
- x.call(s, t) && v(d, t, s[t]);
11
- return d;
12
- }, g = (d, s) => C(d, E(s));
13
- var o = (d, s, t) => (v(d, typeof s != "symbol" ? s + "" : s, t), t);
14
- var f = (d, s, t) => new Promise((e, i) => {
15
- var r = (a) => {
9
+ for (var t of w(a))
10
+ M.call(a, t) && v(l, t, a[t]);
11
+ return l;
12
+ }, g = (l, a) => C(l, x(a));
13
+ var o = (l, a, t) => (v(l, typeof a != "symbol" ? a + "" : a, t), t);
14
+ var u = (l, a, t) => new Promise((e, i) => {
15
+ var s = (n) => {
16
16
  try {
17
- n(t.next(a));
18
- } catch (p) {
19
- i(p);
17
+ r(t.next(n));
18
+ } catch (m) {
19
+ i(m);
20
20
  }
21
- }, h = (a) => {
21
+ }, h = (n) => {
22
22
  try {
23
- n(t.throw(a));
24
- } catch (p) {
25
- i(p);
23
+ r(t.throw(n));
24
+ } catch (m) {
25
+ i(m);
26
26
  }
27
- }, n = (a) => a.done ? e(a.value) : Promise.resolve(a.value).then(r, h);
28
- n((t = t.apply(d, s)).next());
27
+ }, r = (n) => n.done ? e(n.value) : Promise.resolve(n.value).then(s, h);
28
+ r((t = t.apply(l, a)).next());
29
29
  });
30
+ import * as b from "three";
30
31
  import { to as I } from "../../shared-utils/to.js";
31
- import { equal as M } from "../../shared-utils/equal.js";
32
- import { Main as y } from "../Components/Main.js";
33
- import { formatData as b } from "../utils/formatData.js";
34
- import { CAMERA_IMAGE as L } from "../Assets/camera.js";
35
- import { omit as _ } from "../../shared-utils/filter.js";
36
- import { getPxmm as O } from "../../shared-utils/getPxmm.js";
37
- import { FLOOR_PLAN_ATTACHED_TO as D } from "../constant.js";
38
- import { Controller as T } from "../../base/BasePluginWithData.js";
39
- import { correctFiveState as R } from "../utils/correctFiveState.js";
40
- import { changeModelCanvasOpacity as F } from "../../shared-utils/changeModelCanvasOpacity.js";
41
- import { FIVE_CAMERA_DEFAULT_FOV as k, FloorplanErrorType as u, SHOW_ANIME_DURATION as G } from "../utils/constant.js";
32
+ import { equal as y } from "../../shared-utils/equal.js";
33
+ import { Main as L } from "../Components/Main.js";
34
+ import { formatData as F } from "../utils/formatData.js";
35
+ import { CAMERA_IMAGE as _ } from "../Assets/camera.js";
36
+ import { omit as O } from "../../shared-utils/filter.js";
37
+ import { getPxmm as D, getAttachedY as T } from "../../shared-utils/getPxmm.js";
38
+ import { FLOOR_PLAN_ATTACHED_TO as R } from "../constant.js";
39
+ import { Controller as k } from "../../base/BasePluginWithData.js";
40
+ import { correctFiveState as H } from "../utils/correctFiveState.js";
41
+ import { changeModelCanvasOpacity as A } from "../../shared-utils/changeModelCanvasOpacity.js";
42
+ import { FIVE_CAMERA_DEFAULT_FOV as W, FloorplanErrorType as f, SHOW_ANIME_DURATION as G } from "../utils/constant.js";
42
43
  import "../../shared-utils/tag.js";
43
- import "three";
44
44
  import "../../vendor/hammerjs/hammer.js";
45
45
  import "../../shared-utils/three/PointSelector/index.js";
46
46
  import "../../shared-utils/three/CSS3DRenderer/index.js";
47
47
  import "../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
48
48
  import "@realsee/five/line";
49
- import { isNil as H } from "../../shared-utils/isNil.js";
49
+ import { isNil as U } from "../../shared-utils/isNil.js";
50
50
  import "../../shared-utils/three/core/Five_LineMaterial2.js";
51
51
  import "../../shared-utils/three/core/Sphere.js";
52
52
  import "../../shared-utils/three/blink.js";
53
53
  import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
54
54
  import "../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
55
55
  import "../../vendor/earcut/src/earcut.js";
56
- import { FLOORPLAN_DEFAULT_IMAGE as W } from "../../shared-utils/url/defaultUrls.js";
57
- import { replaceStaticPrefix as U } from "../../shared-utils/url/replace-static-prefix.js";
56
+ import { FLOORPLAN_DEFAULT_IMAGE as z } from "../../shared-utils/url/defaultUrls.js";
57
+ import { replaceStaticPrefix as N } from "../../shared-utils/url/replace-static-prefix.js";
58
58
  import "../../shared-utils/five/FivePuppet.js";
59
59
  import "../../shared-utils/isTruelyObject.js";
60
60
  import "../../vendor/svelte/internal/index.js";
@@ -128,6 +128,7 @@ import "../../shared-utils/three/IObject3D.js";
128
128
  import "../../Sculpt/utils/Meshes/getLengthHTML.js";
129
129
  import "../../shared-utils/three/applyObjectMatrixWorld.js";
130
130
  import "../../shared-utils/util.js";
131
+ import "../../shared-utils/five/getFiveFromParentChain.js";
131
132
  import "../../shared-utils/three/core/LineGeometry.js";
132
133
  import "../../shared-utils/three/core/LineMaterial.js";
133
134
  import "../../shared-utils/three/core/Line2.js";
@@ -146,17 +147,17 @@ import "../../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
146
147
  import "../../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
147
148
  import "@realsee/five";
148
149
  import "../../shared-utils/url/absoluteUrl.js";
149
- function N(d) {
150
- const { latitude: s, longitude: t } = d, e = Math.abs(s - Math.PI / 2) > 5 * Math.PI / 180, i = t > 5 * (Math.PI / 180) && t < 355 * (Math.PI / 180);
150
+ function j(l) {
151
+ const { latitude: a, longitude: t } = l, e = Math.abs(a - Math.PI / 2) > 5 * Math.PI / 180, i = t > 5 * (Math.PI / 180) && t < 355 * (Math.PI / 180);
151
152
  return e || i;
152
153
  }
153
- function z(d) {
154
- const { latitude: s, longitude: t } = d, e = Math.abs(s - Math.PI / 2) < 10 * Math.PI / 180, i = t < 30 * (Math.PI / 180) || t > 330 * (Math.PI / 180);
154
+ function B(l) {
155
+ const { latitude: a, longitude: t } = l, e = Math.abs(a - Math.PI / 2) < 10 * Math.PI / 180, i = t < 30 * (Math.PI / 180) || t > 330 * (Math.PI / 180);
155
156
  return e && i;
156
157
  }
157
- class ei extends T {
158
+ class oi extends k {
158
159
  constructor(t, e) {
159
- var a, p, c;
160
+ var n, m, c;
160
161
  super(t);
161
162
  // =============== public properties =================
162
163
  o(this, "name", "modelFloorplanPlugin");
@@ -206,22 +207,22 @@ class ei extends T {
206
207
  * @param opts.isAutoShow 是否是自动展示
207
208
  * @param opts.userAction 是否是用户行为
208
209
  */
209
- o(this, "show", (...e) => f(this, [...e], function* (t = {}) {
210
+ o(this, "show", (...e) => u(this, [...e], function* (t = {}) {
210
211
  if (!this.state.enabled || !this.showPromise && this.state.visible)
211
212
  return;
212
213
  const i = t.userAction !== void 0 ? t.userAction : !0;
213
214
  this.updateState({ visible: !0 }, i), this._show(t);
214
215
  }));
215
216
  /** 隐藏户型图 */
216
- o(this, "hide", (...e) => f(this, [...e], function* (t = {}) {
217
+ o(this, "hide", (...e) => u(this, [...e], function* (t = {}) {
217
218
  this.state.enabled && (this.isHiddenByHideFunc = !0, this.state.visible !== !1 && (this.updateState({ visible: !1 }, t.userAction || !0), this._hide(t)));
218
219
  }));
219
220
  /** 更新户型图大小 */
220
221
  o(this, "updateSize", () => {
221
222
  if (!this.data || !this.container || !this.wrapper)
222
223
  return !1;
223
- const { min: t, max: e } = this.data.bounding, i = e.x - t.x, r = e.y - t.y, h = this.state.config.attachedTo ? { attachedTo: this.state.config.attachedTo } : void 0, n = O(this.five, this.wrapper, this.floorIndex, h), a = Math.ceil(i * n), p = Math.ceil(r * n);
224
- return this.size.width === a && this.size.height === p || (this.container.style.width = a + "px", this.container.style.height = p + "px", this.size = { width: a, height: p }), !0;
224
+ const { min: t, max: e } = this.data.bounding, i = e.x - t.x, s = e.y - t.y, h = this.getPxmmWithRotation(), r = Math.ceil(i * h), n = Math.ceil(s * h);
225
+ return this.size.width === r && this.size.height === n || (this.container.style.width = r + "px", this.container.style.height = n + "px", this.size = { width: r, height: n }), !0;
225
226
  });
226
227
  o(this, "highlight", (t) => {
227
228
  this.state.config.highlightEnable && (this.highlightData = t, this.render());
@@ -229,23 +230,33 @@ class ei extends T {
229
230
  o(this, "unhighlight", () => {
230
231
  this.highlightData = {}, this.render();
231
232
  });
233
+ /** 更新展示状态
234
+ * @description 可以更新 longitude、latitude、fov 等参数
235
+ * @param showState 需要更新的状态,会与现有状态合并
236
+ * @example
237
+ * // 更新 longitude
238
+ * plugin.updateShowState({ longitude: Math.PI / 2 })
239
+ */
240
+ o(this, "updateShowState", (t) => {
241
+ this.showState = d(d({}, this.showState), t);
242
+ });
232
243
  o(this, "_disable", (t) => {
233
- var i, r, h;
244
+ var i, s, h;
234
245
  const { userAction: e } = t;
235
- this.hooks.emit("disable", { userAction: e }), (i = this.showRejection) == null || i.call(this, u.BreakOffByDisable), this.showPromise = void 0, (r = this.app) == null || r.$destroy(), this.app = void 0, (h = this.container) == null || h.remove(), this.removeEventListener();
246
+ 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, (h = this.container) == null || h.remove(), this.removeEventListener();
236
247
  });
237
248
  o(this, "_enable", (t) => {
238
249
  const { userAction: e } = t;
239
250
  this.addEventListener(), this.wrapper && (this.wrapper.append(this.container), this.hooks.emit("enable", { userAction: e }), this.state.visible && this._show({ userAction: e }));
240
251
  });
241
- o(this, "_show", (t) => f(this, null, function* () {
252
+ o(this, "_show", (t) => u(this, null, function* () {
242
253
  var h;
243
254
  if (!this.state.enabled)
244
255
  return;
245
256
  if (!((h = this.five.model) != null && h.loaded))
246
- throw new Error(u.ModelNotLoaded);
257
+ throw new Error(f.ModelNotLoaded);
247
258
  if (!this.data)
248
- throw new Error(u.DataNotLoaded);
259
+ throw new Error(f.DataNotLoaded);
249
260
  if (this.showPromise)
250
261
  return this.showPromise;
251
262
  const e = {
@@ -254,41 +265,41 @@ class ei extends T {
254
265
  immediately: !1,
255
266
  isAutoShow: !1,
256
267
  userAction: !0
257
- }, i = l(l({}, e), t), r = () => f(this, null, function* () {
268
+ }, i = d(d({}, e), t), s = () => u(this, null, function* () {
258
269
  this.hooks.emit("show", { userAction: i.userAction, auto: i.isAutoShow });
259
- let n = !1, a;
260
- this.showRejection = (m) => {
261
- n = !0, a = m;
270
+ let r = !1, n;
271
+ this.showRejection = (p) => {
272
+ r = !0, n = p;
262
273
  };
263
- const [p] = yield I(R(this.five, this.showState, i.userAction));
264
- if (p)
265
- throw p;
266
- if (n)
267
- throw a ? new Error(a) : new Error(u.UnknownError);
274
+ const [m] = yield I(H(this.five, this.showState, i.userAction));
275
+ if (m)
276
+ throw m;
277
+ if (r)
278
+ throw n ? new Error(n) : new Error(f.UnknownError);
268
279
  if (!this.updateSize())
269
- throw new Error(u.UpdateSizeError);
280
+ throw new Error(f.UpdateSizeError);
270
281
  this.floorIndex = i.floorIndex, this.five.model.show(this.floorIndex);
271
282
  });
272
- return this.isHiddenByHideFunc = !1, this.showPromise = r().then(() => {
283
+ return this.isHiddenByHideFunc = !1, this.showPromise = s().then(() => {
273
284
  this.showPromise = void 0, this.showRejection = void 0;
274
- const n = i.modelOpacity, a = i.immediately ? 0 : G;
275
- F(this.five, n, a), this.render(a), this.hooks.emit("showAnimationEnded", {
285
+ const r = i.modelOpacity, n = i.immediately ? 0 : G;
286
+ A(this.five, r, n), this.render(n), this.hooks.emit("showAnimationEnded", {
276
287
  auto: i.isAutoShow,
277
288
  userAction: i.userAction
278
289
  });
279
- }).catch((n) => {
280
- if (this.showPromise = void 0, this.showRejection = void 0, this.updateState({ visible: !1 }, i.userAction), !i.isAutoShow && n instanceof Error)
281
- throw n;
290
+ }).catch((r) => {
291
+ if (this.showPromise = void 0, this.showRejection = void 0, this.updateState({ visible: !1 }, i.userAction), !i.isAutoShow && r instanceof Error)
292
+ throw r;
282
293
  }), this.showPromise;
283
294
  }));
284
295
  o(this, "_hide", (t) => {
285
- var r;
286
- (r = this.showRejection) == null || r.call(this, u.BreakOffByHide), this.showPromise = void 0;
287
- const i = l(l({}, {
296
+ var s;
297
+ (s = this.showRejection) == null || s.call(this, f.BreakOffByHide), this.showPromise = void 0;
298
+ const i = d(d({}, {
288
299
  userAction: !0,
289
300
  isAutoHide: !1
290
301
  }), t);
291
- F(this.five, 1, 0), this.hooks.emit("hide", { auto: i.isAutoHide, userAction: i.userAction }), this.render();
302
+ A(this.five, 1, 0), this.hooks.emit("hide", { auto: i.isAutoHide, userAction: i.userAction }), this.render();
292
303
  });
293
304
  o(this, "handleClick", () => {
294
305
  if (!this.state.visible)
@@ -314,7 +325,7 @@ class ei extends T {
314
325
  if (!e || this.state.config.autoShowEnable === !1 || this.isHiddenByHideFunc)
315
326
  return;
316
327
  const i = this.five.getCurrentState();
317
- i.mode === "Floorplan" && (this.state.visible || z(i) && (this.updateState({ visible: !0 }, !0), this._show({ isAutoShow: !0 })));
328
+ i.mode === "Floorplan" && (this.state.visible || B(i) && (this.updateState({ visible: !0 }, !0), this._show({ isAutoShow: !0 })));
318
329
  });
319
330
  /** panoIndex 改变时,更新 floorIndex */
320
331
  o(this, "onFivePanoArrived", (t) => {
@@ -326,7 +337,7 @@ class ei extends T {
326
337
  if (!this.state.visible || this.showPromise)
327
338
  return;
328
339
  const i = this.five.getCurrentState();
329
- N(i) && (this.updateState({ visible: !1 }, e), this._hide({ userAction: e, isAutoHide: !0 }));
340
+ j(i) && (this.updateState({ visible: !1 }, e), this._hide({ userAction: e, isAutoHide: !0 }));
330
341
  });
331
342
  /** 在户型图展示时阻止多指操作, 阻止鼠标放大 */
332
343
  o(this, "onFiveWantsGesture", (t, e) => {
@@ -355,16 +366,16 @@ class ei extends T {
355
366
  this.floorIndex = t, this.updateSize(), this.render();
356
367
  }
357
368
  });
358
- e != null && e.selector && (this.selector = e.selector, console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")), this.showState = {
369
+ e != null && e.selector && (this.selector = e.selector, console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")), this.showState = d({
359
370
  mode: "Floorplan",
360
371
  longitude: 0,
361
372
  latitude: Math.PI / 2,
362
- fov: k / ((a = e == null ? void 0 : e.scale) != null ? a : 1)
363
- }, this.defaultMissingFloorConfig = {
364
- imageURL: U(e == null ? void 0 : e.staticPrefix, W),
373
+ fov: W / ((n = e == null ? void 0 : e.scale) != null ? n : 1)
374
+ }, e == null ? void 0 : e.showState), this.defaultMissingFloorConfig = {
375
+ imageURL: N(e == null ? void 0 : e.staticPrefix, z),
365
376
  imageWidth: 200,
366
377
  imageHeight: 120,
367
- text: (c = (p = e.i18n) == null ? void 0 : p.call(e, "暂无平面图")) != null ? c : "暂无平面图",
378
+ text: (c = (m = e.i18n) == null ? void 0 : m.call(e, "暂无平面图")) != null ? c : "暂无平面图",
368
379
  textFontSize: 14
369
380
  };
370
381
  const i = {
@@ -382,26 +393,26 @@ class ei extends T {
382
393
  roomNameOtherTypeEnable: !0,
383
394
  roomDimensionEnable: !0,
384
395
  adaptiveRoomLabelVisibleEnable: !0,
385
- cameraImageUrl: L,
386
- attachedTo: D.BOUNDING_CENTER,
396
+ cameraImageUrl: _,
397
+ attachedTo: R.BOUNDING_CENTER,
387
398
  getLabelElement: void 0,
388
- missingFloorConfig: l(l({}, this.defaultMissingFloorConfig), e.missingFloorConfig),
389
- i18n: (m) => m,
390
- getRoomAreaText: (m) => (m / 1e6).toFixed(1) + "㎡",
391
- getRoomDimensionText: (m, A) => (m / 1e3).toFixed(1) + "m × " + (A / 1e3).toFixed(1) + "m",
392
- getRuleDistanceText: (m) => m.toString()
393
- }, r = e ? _(e, ["selector", "scale"]) : {}, h = l(l({}, i.missingFloorConfig), r.missingFloorConfig), n = g(l(l({}, i), r), { missingFloorConfig: h });
394
- this.state = { enabled: !0, visible: !1, config: n }, this.panoIndex = t.getCurrentState().panoIndex, this.initContainer(), t.once("dispose", this.dispose), this.addEventListener();
399
+ missingFloorConfig: d(d({}, this.defaultMissingFloorConfig), e.missingFloorConfig),
400
+ i18n: (p) => p,
401
+ getRoomAreaText: (p) => (p / 1e6).toFixed(1) + "㎡",
402
+ getRoomDimensionText: (p, S) => (p / 1e3).toFixed(1) + "m × " + (S / 1e3).toFixed(1) + "m",
403
+ getRuleDistanceText: (p) => p.toString()
404
+ }, s = e ? O(e, ["selector", "scale"]) : {}, h = d(d({}, i.missingFloorConfig), s.missingFloorConfig), r = g(d(d({}, i), s), { missingFloorConfig: h });
405
+ this.state = { enabled: !0, visible: !1, config: r }, this.panoIndex = t.getCurrentState().panoIndex, this.initContainer(), t.once("dispose", this.dispose), this.addEventListener();
395
406
  }
396
407
  load(t, e, i = !0) {
397
- return f(this, null, function* () {
398
- function r(c) {
408
+ return u(this, null, function* () {
409
+ function s(c) {
399
410
  return Object.prototype.hasOwnProperty.apply(c, ["version"]);
400
411
  }
401
412
  const h = t;
402
- h && H(h.version) && console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");
403
- const n = JSON.parse(JSON.stringify(t)), a = r(n) ? n.data : n, p = this.data;
404
- this.data = yield b(a), this.hooks.emit("dataLoaded", this.data), this.hooks.emit("dataChange", this.data, p), e && this.updateState(e, i), this.render();
413
+ h && U(h.version) && console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");
414
+ const r = JSON.parse(JSON.stringify(t)), n = s(r) ? r.data : r, m = this.data;
415
+ this.data = yield F(n), this.hooks.emit("dataLoaded", this.data), this.hooks.emit("dataChange", this.data, m), e && this.updateState(e, i), this.render();
405
416
  });
406
417
  }
407
418
  /** 把插件的渲染DOM插入到对应的容器中去 */
@@ -425,9 +436,9 @@ class ei extends T {
425
436
  }
426
437
  /** 更改插件 State */
427
438
  setState(t, e = {}) {
428
- const i = this.state, r = e.userAction !== void 0 ? e.userAction : !0;
429
- if (this.updateState(t, r), t.enabled !== void 0 && i.enabled !== t.enabled && (t.enabled ? this._enable({ userAction: r }) : this._disable({ userAction: r })), t.visible !== void 0 && i.visible !== t.visible) {
430
- const h = { userAction: r };
439
+ const i = this.state, s = e.userAction !== void 0 ? e.userAction : !0;
440
+ if (this.updateState(t, s), t.enabled !== void 0 && i.enabled !== t.enabled && (t.enabled ? this._enable({ userAction: s }) : this._disable({ userAction: s })), t.visible !== void 0 && i.visible !== t.visible) {
441
+ const h = { userAction: s };
431
442
  t.visible ? this._show(h) : this._hide(h);
432
443
  }
433
444
  this.render();
@@ -435,15 +446,33 @@ class ei extends T {
435
446
  changeConfigs(t, e = !0) {
436
447
  this.updateState({ config: t }, e), this.render();
437
448
  }
449
+ /** 根据旋转角度计算 pxmm
450
+ * @description 当 longitude 大于 45° 或小于 -45°(相对于基准方向)时,使用 Z 轴计算
451
+ */
452
+ getPxmmWithRotation() {
453
+ if (!this.wrapper)
454
+ return 0;
455
+ 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));
456
+ return i > Math.PI / 4 && i < 3 * Math.PI / 4 || i > 5 * Math.PI / 4 && i < 7 * Math.PI / 4 ? this.getPxmmZAxis(t) : D(this.five, this.wrapper, this.floorIndex, t);
457
+ }
458
+ /** 使用 Z 轴计算 pxmm
459
+ * @description 当相机旋转导致 X 轴接近垂直于屏幕时,改用 Z 轴计算
460
+ */
461
+ getPxmmZAxis(t) {
462
+ if (!this.wrapper)
463
+ return 0;
464
+ const e = T(this.five, this.floorIndex, t == null ? void 0 : t.attachedTo), i = new b.Vector3(0, e, 0), s = new b.Vector3(0, e, 1), h = i.clone().project(this.five.camera), r = s.clone().project(this.five.camera);
465
+ return Math.abs((r.x - h.x) / 1e3) * (this.wrapper.getBoundingClientRect().width / 2);
466
+ }
438
467
  formatData(t) {
439
- return f(this, null, function* () {
440
- return yield b(t.data);
468
+ return u(this, null, function* () {
469
+ return yield F(t.data);
441
470
  });
442
471
  }
443
472
  updateState(t, e) {
444
- var n;
445
- const i = this.state, r = (n = t.config) != null && n.missingFloorConfig ? l(l({}, i.config.missingFloorConfig), t.config.missingFloorConfig) : i.config.missingFloorConfig, h = t.config ? g(l(l({}, i.config), t.config), { missingFloorConfig: r }) : i.config;
446
- this.state = g(l(l({}, this.state), t), { config: h }), !M(this.state, i, { deep: !0 }) && this.hooks.emit("stateChange", { state: this.state, prevState: i, userAction: e });
473
+ var r;
474
+ const i = this.state, s = (r = t.config) != null && r.missingFloorConfig ? d(d({}, i.config.missingFloorConfig), t.config.missingFloorConfig) : i.config.missingFloorConfig, h = t.config ? g(d(d({}, i.config), t.config), { missingFloorConfig: s }) : i.config;
475
+ this.state = g(d(d({}, this.state), t), { config: h }), !y(this.state, i, { deep: !0 }) && this.hooks.emit("stateChange", { state: this.state, prevState: i, userAction: e });
447
476
  }
448
477
  /** 如果用户是通过 selector 设置父容器,需要在 modelLoaded 之后把 container 自动放到父容器里
449
478
  *
@@ -472,7 +501,7 @@ class ei extends T {
472
501
  render(t) {
473
502
  if (!this.state.enabled || !this.container || !this.data || this.size.width === 0 || this.showPromise)
474
503
  return;
475
- const e = g(l({}, this.state.config), {
504
+ const e = g(d({}, this.state.config), {
476
505
  visible: this.state.visible,
477
506
  duration: t != null ? t : 0,
478
507
  panoIndex: this.panoIndex,
@@ -484,9 +513,9 @@ class ei extends T {
484
513
  });
485
514
  if (this.app)
486
515
  return this.app.$set(e);
487
- this.app = new y({ target: this.container, intro: !0, props: e });
516
+ this.app = new L({ target: this.container, intro: !0, props: e });
488
517
  }
489
518
  }
490
519
  export {
491
- ei as Controller
520
+ oi as Controller
492
521
  };
@@ -1,4 +1,5 @@
1
1
  import { Controller as t } from "./Controller.js";
2
+ import "three";
2
3
  import "../../shared-utils/to.js";
3
4
  import "../../shared-utils/equal.js";
4
5
  import "../../shared-utils/isTruelyObject.js";
@@ -41,7 +42,6 @@ import "../../shared-utils/filter.js";
41
42
  import "../../shared-utils/tap.js";
42
43
  import "../../shared-utils/getPxmm.js";
43
44
  import "../constant.js";
44
- import "three";
45
45
  import "../../base/BasePluginWithData.js";
46
46
  import "../../base/BasePlugin.js";
47
47
  import "../../shared-utils/Subscribe.js";
@@ -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";
@@ -118,8 +119,8 @@ import "../../shared-utils/translateMode/getDistanceFromModel.js";
118
119
  import "../../shared-utils/changeModelCanvasOpacity.js";
119
120
  import "../../shared-utils/url/replace-static-prefix.js";
120
121
  import "../../shared-utils/url/absoluteUrl.js";
121
- const wr = (o, r) => new t(o, r);
122
+ const xr = (o, r) => new t(o, r);
122
123
  export {
123
- wr as ModelFloorplanPlugin,
124
- wr as default
124
+ xr as ModelFloorplanPlugin,
125
+ xr as default
125
126
  };
@@ -98,6 +98,7 @@ import "../../shared-utils/three/IObject3D.js";
98
98
  import "../../Sculpt/utils/Meshes/getLengthHTML.js";
99
99
  import "../../shared-utils/three/applyObjectMatrixWorld.js";
100
100
  import "../../shared-utils/util.js";
101
+ import "../../shared-utils/five/getFiveFromParentChain.js";
101
102
  import "../../shared-utils/three/core/LineGeometry.js";
102
103
  import "../../shared-utils/three/core/LineMaterial.js";
103
104
  import "../../shared-utils/three/core/Line2.js";
@@ -116,7 +117,7 @@ import "../../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
116
117
  import "../../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
117
118
  import "@realsee/five";
118
119
  import "../../shared-utils/url/absoluteUrl.js";
119
- class di extends O {
120
+ class li extends O {
120
121
  constructor(t, i) {
121
122
  super(t);
122
123
  // =============== public properties =================
@@ -259,5 +260,5 @@ class di extends O {
259
260
  }
260
261
  }
261
262
  export {
262
- di as Controller
263
+ li as Controller
263
264
  };
@@ -68,6 +68,7 @@ import "../../Sculpt/typings/style.js";
68
68
  import "../../shared-utils/three/IObject3D.js";
69
69
  import "../../Sculpt/utils/Meshes/getLengthHTML.js";
70
70
  import "../../shared-utils/three/applyObjectMatrixWorld.js";
71
+ import "../../shared-utils/five/getFiveFromParentChain.js";
71
72
  import "../../shared-utils/three/core/LineGeometry.js";
72
73
  import "../../shared-utils/three/core/LineMaterial.js";
73
74
  import "../../shared-utils/three/core/Line2.js";
@@ -88,8 +89,8 @@ import "../utils/formatData.js";
88
89
  import "../Assets/floorplanExtraObject.js";
89
90
  import "../../shared-utils/url/replace-static-prefix.js";
90
91
  import "../../shared-utils/url/absoluteUrl.js";
91
- const Mo = (o, r) => new t(o, r);
92
+ const No = (o, r) => new t(o, r);
92
93
  export {
93
- Mo as PanoFloorplanRadarPlugin,
94
- Mo as default
94
+ No as PanoFloorplanRadarPlugin,
95
+ No as default
95
96
  };
@@ -125,6 +125,7 @@ import "../../shared-utils/three/IObject3D.js";
125
125
  import "../../Sculpt/utils/Meshes/getLengthHTML.js";
126
126
  import "../../shared-utils/three/applyObjectMatrixWorld.js";
127
127
  import "../../shared-utils/util.js";
128
+ import "../../shared-utils/five/getFiveFromParentChain.js";
128
129
  import "../../shared-utils/three/core/LineGeometry.js";
129
130
  import "../../shared-utils/three/core/LineMaterial.js";
130
131
  import "../../shared-utils/three/core/Line2.js";
@@ -143,7 +144,7 @@ import "../../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
143
144
  import "../../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
144
145
  import "@realsee/five";
145
146
  import "../../shared-utils/url/absoluteUrl.js";
146
- class qi extends M {
147
+ class Ji extends M {
147
148
  constructor(t, i) {
148
149
  var h, l;
149
150
  super(t);
@@ -417,5 +418,5 @@ class qi extends M {
417
418
  }
418
419
  }
419
420
  export {
420
- qi as Controller
421
+ Ji as Controller
421
422
  };
@@ -92,6 +92,7 @@ import "../../Sculpt/typings/style.js";
92
92
  import "../../shared-utils/three/IObject3D.js";
93
93
  import "../../Sculpt/utils/Meshes/getLengthHTML.js";
94
94
  import "../../shared-utils/three/applyObjectMatrixWorld.js";
95
+ import "../../shared-utils/five/getFiveFromParentChain.js";
95
96
  import "../../shared-utils/three/core/LineGeometry.js";
96
97
  import "../../shared-utils/three/core/LineMaterial.js";
97
98
  import "../../shared-utils/three/core/Line2.js";
@@ -115,8 +116,8 @@ import "../../shared-utils/getPxmm.js";
115
116
  import "../../shared-utils/changeModelCanvasOpacity.js";
116
117
  import "../../shared-utils/url/replace-static-prefix.js";
117
118
  import "../../shared-utils/url/absoluteUrl.js";
118
- const wr = (o, r) => new t(o, r);
119
+ const cr = (o, r) => new t(o, r);
119
120
  export {
120
- wr as TopviewFloorplanPlugin,
121
- wr as default
121
+ cr as TopviewFloorplanPlugin,
122
+ cr as default
122
123
  };
@@ -1,5 +1,5 @@
1
- import "../vendor/resize-observer-polyfill/dist/ResizeObserver.es.js";
2
1
  import "three";
2
+ import "../vendor/resize-observer-polyfill/dist/ResizeObserver.es.js";
3
3
  import "../shared-utils/tag.js";
4
4
  import "../vendor/hammerjs/hammer.js";
5
5
  import "../shared-utils/three/PointSelector/index.js";
@@ -3,6 +3,7 @@ import type { FLOOR_PLAN_ATTACHED_TO } from '../constant';
3
3
  import type { FloorplanData } from '../typings/floorplanData';
4
4
  import type * as BasePlugin from '../../base/BasePluginWithData';
5
5
  import type { FloorplanServerData } from '../typings/floorplanServerData';
6
+ import type { ShowState } from '../utils/correctFiveState';
6
7
  export interface State extends BasePlugin.State {
7
8
  visible: boolean;
8
9
  config: Config;
@@ -87,6 +88,8 @@ export interface Parameters extends Partial<Config> {
87
88
  scale?: number;
88
89
  /** 静态资源前缀,用于替换插件中使用到的固化资源 */
89
90
  staticPrefix?: string;
91
+ /** 展示状态配置,可以自定义 longitude、latitude、fov 等参数 */
92
+ showState?: Partial<ShowState>;
90
93
  }
91
94
  export interface PluginServerData {
92
95
  version: number;