@realsee/dnalogel 3.3.2 → 3.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- function b(e, l) {
2
- var d, f, o, s;
1
+ function v(e, l) {
2
+ var d, f, o, s, b;
3
3
  typeof e.visibleConfig == "object" && (e.visibleConfig.visibleFiveMode = (o = (f = e.visibleConfig.visibleFiveMode) != null ? f : (d = l == null ? void 0 : l.fiveState) == null ? void 0 : d.mode) != null ? o : "Panorama", e.visibleConfig.keep && (e.visibleConfig.keep === "visible" ? e.visibleConfig = { keep: e.visibleConfig.keep, visibleFiveMode: (s = e.visibleConfig) == null ? void 0 : s.visibleFiveMode } : e.visibleConfig.keep === "hidden" && (e.visibleConfig = { keep: e.visibleConfig.keep }))), typeof e.unfoldedConfig == "object" && (e.unfoldedConfig.disableFold && (e.unfoldedConfig = { keep: "unfolded" }), e.unfoldedConfig.disableUnfold && (e.unfoldedConfig = { keep: "folded" }), e.unfoldedConfig.keep && (e.unfoldedConfig = { keep: e.unfoldedConfig.keep }));
4
- const i = e.initialState;
4
+ const i = (b = e.initialState) != null ? b : {};
5
5
  typeof e.unfoldedConfig == "object" && (e.unfoldedConfig.keep === "unfolded" ? i.unfolded = !0 : e.unfoldedConfig.keep === "folded" && (i.unfolded = !1)), typeof e.visibleConfig == "object" && (e.visibleConfig.keep === "visible" ? i.visible = !0 : e.visibleConfig.keep === "hidden" && (i.visible = !1)), e.initialState = i;
6
6
  }
7
7
  export {
8
- b as default
8
+ v as default
9
9
  };
@@ -14,7 +14,7 @@ let b = class {
14
14
  /**
15
15
  * @realsee/dnalogel 版本号
16
16
  */
17
- i(this, "VERSION", "3.3.2");
17
+ i(this, "VERSION", "3.3.4");
18
18
  i(this, "five");
19
19
  /**
20
20
  * 插件事件钩子
@@ -63,7 +63,7 @@ export declare class Controller extends BasePlugin.Controller<State, EventMap, P
63
63
  setState(state: PartialDeep<State>, options?: BaseOptions): void;
64
64
  changeConfigs(config: Partial<Config>, userAction?: boolean): void;
65
65
  /** 更新户型图大小 */
66
- updateSize: () => void;
66
+ updateSize: () => boolean;
67
67
  /** 更新户型图位置 */
68
68
  updatePosition(): void;
69
69
  highlight: (highlightData: HighlightData) => void;
@@ -1,15 +1,15 @@
1
- var A = Object.defineProperty, F = Object.defineProperties;
2
- var P = Object.getOwnPropertyDescriptors;
1
+ var F = Object.defineProperty, P = Object.defineProperties;
2
+ var E = Object.getOwnPropertyDescriptors;
3
3
  var v = Object.getOwnPropertySymbols;
4
- var E = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
5
- var g = (d, r, t) => r in d ? A(d, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[r] = t, l = (d, r) => {
4
+ var x = Object.prototype.hasOwnProperty, I = Object.prototype.propertyIsEnumerable;
5
+ var g = (d, r, t) => r in d ? F(d, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[r] = t, l = (d, r) => {
6
6
  for (var t in r || (r = {}))
7
- E.call(r, t) && g(d, t, r[t]);
7
+ x.call(r, t) && g(d, t, r[t]);
8
8
  if (v)
9
9
  for (var t of v(r))
10
- x.call(r, t) && g(d, t, r[t]);
10
+ I.call(r, t) && g(d, t, r[t]);
11
11
  return d;
12
- }, p = (d, r) => F(d, P(r));
12
+ }, m = (d, r) => P(d, E(r));
13
13
  var o = (d, r, t) => (g(d, typeof r != "symbol" ? r + "" : r, t), t);
14
14
  var u = (d, r, t) => new Promise((e, i) => {
15
15
  var n = (a) => {
@@ -28,18 +28,18 @@ var u = (d, r, t) => new Promise((e, i) => {
28
28
  s((t = t.apply(d, r)).next());
29
29
  });
30
30
  import * as w from "three";
31
- import { to as I } from "../../shared-utils/to.js";
32
- import { equal as M } from "../../shared-utils/equal.js";
33
- import { Main as y } from "../Components/Main.js";
31
+ import { to as M } from "../../shared-utils/to.js";
32
+ import { equal as y } from "../../shared-utils/equal.js";
33
+ import { Main as L } from "../Components/Main.js";
34
34
  import { formatData as b } from "../utils/formatData.js";
35
- import { CAMERA_IMAGE as L } from "../Assets/camera.js";
36
- import { omit as C } from "../../shared-utils/filter.js";
37
- import { FLOOR_PLAN_ATTACHED_TO as _ } from "../constant.js";
38
- import { Controller as O } from "../../base/BasePluginWithData.js";
39
- import { getPxmm as D, getAttachedY as T } from "../../shared-utils/getPxmm.js";
40
- import { correctFiveState as k } from "../utils/correctFiveState.js";
41
- import { changeModelCanvasOpacity as S } from "../../shared-utils/changeModelCanvasOpacity.js";
42
- import { FloorplanErrorType as m, SHOW_ANIME_DURATION as H } from "../utils/constant.js";
35
+ import { CAMERA_IMAGE as _ } from "../Assets/camera.js";
36
+ import { omit as S } from "../../shared-utils/filter.js";
37
+ import { FLOOR_PLAN_ATTACHED_TO as O } from "../constant.js";
38
+ import { Controller as D } from "../../base/BasePluginWithData.js";
39
+ import { getPxmm as T, getAttachedY as k } from "../../shared-utils/getPxmm.js";
40
+ import { correctFiveState as H } from "../utils/correctFiveState.js";
41
+ import { changeModelCanvasOpacity as C } from "../../shared-utils/changeModelCanvasOpacity.js";
42
+ import { FloorplanErrorType as p, SHOW_ANIME_DURATION as R } from "../utils/constant.js";
43
43
  import "../../shared-utils/isTruelyObject.js";
44
44
  import "../../vendor/svelte/internal/index.js";
45
45
  import "../../vendor/svelte/transition/index.js";
@@ -92,7 +92,7 @@ import "../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
92
92
  import "../../shared-utils/url/absoluteUrl.js";
93
93
  import "../../shared-utils/nearlyEqual.js";
94
94
  import "../../shared-utils/five/changeMode.js";
95
- function R(d) {
95
+ function z(d) {
96
96
  const { latitude: r, longitude: t } = d, e = Math.abs(r - Math.PI / 2) > 5 * Math.PI / 180, i = t > 5 * (Math.PI / 180) && t < 355 * (Math.PI / 180);
97
97
  return e || i;
98
98
  }
@@ -100,7 +100,7 @@ function W(d) {
100
100
  const { latitude: r, longitude: t } = d, e = Math.abs(r - Math.PI / 2) < 10 * Math.PI / 180, i = t < 30 * (Math.PI / 180) || t > 330 * (Math.PI / 180);
101
101
  return e && i;
102
102
  }
103
- class Kt extends O {
103
+ class Qt extends D {
104
104
  constructor(t, e) {
105
105
  var a, f;
106
106
  super(t);
@@ -164,9 +164,9 @@ class Kt extends O {
164
164
  /** 更新户型图大小 */
165
165
  o(this, "updateSize", () => {
166
166
  if (!this.data || !this.container || !this.wrapper)
167
- return;
168
- const { min: t, max: e } = this.data.bounding, i = e.x - t.x, n = e.y - t.y, h = this.state.config.attachedTo ? { attachedTo: this.state.config.attachedTo } : void 0, s = D(this.five, this.wrapper, this.floorIndex, h), a = Math.ceil(i * s), f = Math.ceil(n * s);
169
- this.size.width === a && this.size.height === f || (this.container.style.width = a + "px", this.container.style.height = f + "px", this.size = { width: a, height: f });
167
+ return !1;
168
+ const { min: t, max: e } = this.data.bounding, i = e.x - t.x, n = e.y - t.y, h = this.state.config.attachedTo ? { attachedTo: this.state.config.attachedTo } : void 0, s = T(this.five, this.wrapper, this.floorIndex, h), a = Math.ceil(i * s), f = Math.ceil(n * s);
169
+ return this.size.width === a && this.size.height === f || (this.container.style.width = a + "px", this.container.style.height = f + "px", this.size = { width: a, height: f }), !0;
170
170
  });
171
171
  o(this, "highlight", (t) => {
172
172
  this.state.config.highlightEnable && (this.highlightData = t, this.render());
@@ -177,7 +177,7 @@ class Kt extends O {
177
177
  o(this, "_disable", (t) => {
178
178
  var i, n, h;
179
179
  const { userAction: e } = t;
180
- this.hooks.emit("disable", { userAction: e }), (i = this.showRejection) == null || i.call(this, m.BreakOffByDisable), this.showPromise = void 0, (n = this.app) == null || n.$destroy(), this.app = void 0, (h = this.container) == null || h.remove(), this.removeEventListener();
180
+ this.hooks.emit("disable", { userAction: e }), (i = this.showRejection) == null || i.call(this, p.BreakOffByDisable), this.showPromise = void 0, (n = this.app) == null || n.$destroy(), this.app = void 0, (h = this.container) == null || h.remove(), this.removeEventListener();
181
181
  });
182
182
  o(this, "_enable", (t) => {
183
183
  const { userAction: e } = t;
@@ -188,9 +188,9 @@ class Kt extends O {
188
188
  if (!this.state.enabled)
189
189
  return;
190
190
  if (!((h = this.five.model) != null && h.loaded))
191
- throw new Error(m.ModelNotLoaded);
191
+ throw new Error(p.ModelNotLoaded);
192
192
  if (!this.data)
193
- throw new Error(m.DataNotLoaded);
193
+ throw new Error(p.DataNotLoaded);
194
194
  if (this.showPromise)
195
195
  return this.showPromise;
196
196
  const e = {
@@ -202,20 +202,22 @@ class Kt extends O {
202
202
  }, i = l(l({}, e), t), n = () => u(this, null, function* () {
203
203
  this.hooks.emit("show", { userAction: i.userAction, auto: i.isAutoShow });
204
204
  let s = !1, a;
205
- this.showRejection = (c) => {
206
- s = !0, a = c;
205
+ this.showRejection = (A) => {
206
+ s = !0, a = A;
207
207
  };
208
- const [f] = yield I(k(this.five, this.showState, i.userAction));
208
+ const [f] = yield M(H(this.five, this.showState, i.userAction));
209
209
  if (f)
210
210
  throw f;
211
211
  if (s)
212
- throw a ? new Error(a) : new Error(m.UnknownError);
213
- this.updateSize(), this.updatePosition(), this.floorIndex = i.floorIndex, this.five.model.show(this.floorIndex);
212
+ throw a ? new Error(a) : new Error(p.UnknownError);
213
+ if (!this.updateSize())
214
+ throw new Error(p.UpdateSizeError);
215
+ this.updatePosition(), this.floorIndex = i.floorIndex, this.five.model.show(this.floorIndex);
214
216
  });
215
217
  return this.isHiddenByHideFunc = !1, this.showPromise = n().then(() => {
216
218
  this.showPromise = void 0, this.showRejection = void 0;
217
- const s = i.modelOpacity, a = i.immediately ? 0 : H;
218
- S(this.five, s, a), this.render(a), this.hooks.emit("showAnimationEnded", {
219
+ const s = i.modelOpacity, a = i.immediately ? 0 : R;
220
+ C(this.five, s, a), this.render(a), this.hooks.emit("showAnimationEnded", {
219
221
  auto: i.isAutoShow,
220
222
  userAction: i.userAction
221
223
  });
@@ -226,12 +228,12 @@ class Kt extends O {
226
228
  }));
227
229
  o(this, "_hide", (t) => {
228
230
  var n;
229
- (n = this.showRejection) == null || n.call(this, m.BreakOffByHide), this.showPromise = void 0;
231
+ (n = this.showRejection) == null || n.call(this, p.BreakOffByHide), this.showPromise = void 0;
230
232
  const i = l(l({}, {
231
233
  userAction: !0,
232
234
  isAutoHide: !1
233
235
  }), t);
234
- S(this.five, 1, 0), this.hooks.emit("hide", { auto: i.isAutoHide, userAction: i.userAction }), this.render();
236
+ C(this.five, 1, 0), this.hooks.emit("hide", { auto: i.isAutoHide, userAction: i.userAction }), this.render();
235
237
  });
236
238
  o(this, "handleClick", () => {
237
239
  if (!this.state.visible)
@@ -270,12 +272,12 @@ class Kt extends O {
270
272
  if (!this.state.visible || this.showPromise)
271
273
  return;
272
274
  const i = this.five.getCurrentState();
273
- this.updatePosition(), this.updateSize(), R(i) && (this.updateState({ visible: !1 }, e), this._hide({ userAction: e }));
275
+ this.updatePosition(), this.updateSize(), z(i) && (this.updateState({ visible: !1 }, e), this._hide({ userAction: e }));
274
276
  });
275
277
  /** 户型图展示中,转动三维模型,结束时应该自动修复模型状态 */
276
278
  o(this, "onFiveWantsPanGesture", (t, e) => {
277
279
  if (this.five.getCurrentState().mode === this.showState.mode && this.state.config.autoShowEnable !== !1 && e && this.state.visible)
278
- return this.five.updateCamera(C(this.showState, ["offset"]), 0), !1;
280
+ return this.five.updateCamera(S(this.showState, ["offset"]), 0), !1;
279
281
  });
280
282
  /** 阻止点击分间走点 */
281
283
  o(this, "onFiveWantsTapGesture", () => this.handleClick());
@@ -317,15 +319,15 @@ class Kt extends O {
317
319
  roomLabelsEnable: !0,
318
320
  roomAreaEnable: !0,
319
321
  roomNameEnable: !0,
320
- cameraImageUrl: L,
321
- attachedTo: _.BOUNDING_CENTER,
322
+ cameraImageUrl: _,
323
+ attachedTo: O.BOUNDING_CENTER,
322
324
  getLabelElement: void 0,
323
325
  adaptiveRoomLabelVisibleEnable: !0,
324
326
  missingFloorConfig: l(l({}, this.defaultMissingFloorConfig), e.missingFloorConfig),
325
327
  i18n: (c) => c,
326
328
  getRoomAreaText: (c) => (c / 1e6).toFixed(1) + "㎡",
327
329
  getRuleDistanceText: (c) => c.toString()
328
- }, n = e ? C(e, ["selector", "scale"]) : {}, h = l(l({}, i.missingFloorConfig), n.missingFloorConfig), s = p(l(l({}, i), n), { missingFloorConfig: h });
330
+ }, n = e ? S(e, ["selector", "scale"]) : {}, h = l(l({}, i.missingFloorConfig), n.missingFloorConfig), s = m(l(l({}, i), n), { missingFloorConfig: h });
329
331
  this.state = { enabled: !0, visible: !1, config: s }, this.initContainer(), t.model.loaded ? this.onFiveModelLoaded() : t.once("modelLoaded", this.onFiveModelLoaded), t.once("dispose", this.dispose), this.addEventListener();
330
332
  }
331
333
  load(t, e, i = !0) {
@@ -372,7 +374,7 @@ class Kt extends O {
372
374
  /** 更新户型图位置 */
373
375
  updatePosition() {
374
376
  var s;
375
- const t = T(this.five, this.floorIndex, this.state.config.attachedTo), e = (s = this.five.model) == null ? void 0 : s.bounding.getCenter(new w.Vector3()).setY(t);
377
+ const t = k(this.five, this.floorIndex, this.state.config.attachedTo), e = (s = this.five.model) == null ? void 0 : s.bounding.getCenter(new w.Vector3()).setY(t);
376
378
  if (!e)
377
379
  return;
378
380
  const i = e.clone().project(this.five.camera), n = (i.x + 1) / 2, h = -(i.y - 1) / 2;
@@ -385,8 +387,8 @@ class Kt extends O {
385
387
  }
386
388
  updateState(t, e) {
387
389
  var s;
388
- const i = this.state, n = (s = t.config) != null && s.missingFloorConfig ? l(l({}, i.config.missingFloorConfig), t.config.missingFloorConfig) : i.config.missingFloorConfig, h = t.config ? p(l(l({}, i.config), t.config), { missingFloorConfig: n }) : i.config;
389
- this.state = p(l(l({}, this.state), t), { config: h }), !M(this.state, i, { deep: !0 }) && this.hooks.emit("stateChange", { state: this.state, prevState: i, userAction: e });
390
+ const i = this.state, n = (s = t.config) != null && s.missingFloorConfig ? l(l({}, i.config.missingFloorConfig), t.config.missingFloorConfig) : i.config.missingFloorConfig, h = t.config ? m(l(l({}, i.config), t.config), { missingFloorConfig: n }) : i.config;
391
+ this.state = m(l(l({}, this.state), t), { config: h }), !y(this.state, i, { deep: !0 }) && this.hooks.emit("stateChange", { state: this.state, prevState: i, userAction: e });
390
392
  }
391
393
  /** 如果用户是通过 selector 设置父容器,需要在 modelLoaded 之后把 container 自动放到父容器里
392
394
  *
@@ -415,7 +417,7 @@ class Kt extends O {
415
417
  render(t) {
416
418
  if (!this.state.enabled || !this.container || !this.data || this.size.width === 0 || this.showPromise)
417
419
  return;
418
- const e = p(l({}, this.state.config), {
420
+ const e = m(l({}, this.state.config), {
419
421
  visible: this.state.visible,
420
422
  duration: t != null ? t : 0,
421
423
  panoIndex: this.panoIndex,
@@ -426,9 +428,9 @@ class Kt extends O {
426
428
  });
427
429
  if (this.app)
428
430
  return this.app.$set(e);
429
- this.app = new y({ target: this.container, intro: !0, props: e });
431
+ this.app = new L({ target: this.container, intro: !0, props: e });
430
432
  }
431
433
  }
432
434
  export {
433
- Kt as Controller
435
+ Qt as Controller
434
436
  };
@@ -63,7 +63,7 @@ export declare class Controller extends BasePlugin.Controller<State, EventMap, P
63
63
  setState(state: PartialDeep<State>, options?: BaseOptions): void;
64
64
  changeConfigs(config: Partial<Config>, userAction?: boolean): void;
65
65
  /** 更新户型图大小 */
66
- updateSize: () => void;
66
+ updateSize: () => boolean;
67
67
  highlight: (highlightData: HighlightData) => void;
68
68
  unhighlight: () => void;
69
69
  protected formatData(serverData: PluginServerData): Promise<PluginData>;
@@ -9,9 +9,9 @@ var v = (d, s, t) => s in d ? A(d, s, { enumerable: !0, configurable: !0, writab
9
9
  for (var t of w(s))
10
10
  P.call(s, t) && v(d, t, s[t]);
11
11
  return d;
12
- }, m = (d, s) => C(d, S(s));
12
+ }, g = (d, s) => C(d, S(s));
13
13
  var o = (d, s, t) => (v(d, typeof s != "symbol" ? s + "" : s, t), t);
14
- var u = (d, s, t) => new Promise((e, i) => {
14
+ var c = (d, s, t) => new Promise((e, i) => {
15
15
  var n = (a) => {
16
16
  try {
17
17
  r(t.next(a));
@@ -36,9 +36,9 @@ import { omit as _ } from "../../shared-utils/filter.js";
36
36
  import { getPxmm as L } from "../../shared-utils/getPxmm.js";
37
37
  import { FLOOR_PLAN_ATTACHED_TO as O } from "../constant.js";
38
38
  import { Controller as D } from "../../base/BasePluginWithData.js";
39
- import { checkShowState as k, correctFiveState as T } from "../utils/correctFiveState.js";
39
+ import { correctFiveState as T } from "../utils/correctFiveState.js";
40
40
  import { changeModelCanvasOpacity as F } from "../../shared-utils/changeModelCanvasOpacity.js";
41
- import { FIVE_CAMERA_DEFAULT_FOV as H, FloorplanErrorType as g, SHOW_ANIME_DURATION as G } from "../utils/constant.js";
41
+ import { FIVE_CAMERA_DEFAULT_FOV as k, FloorplanErrorType as p, SHOW_ANIME_DURATION as H } from "../utils/constant.js";
42
42
  import "../../shared-utils/isTruelyObject.js";
43
43
  import "../../vendor/svelte/internal/index.js";
44
44
  import "../../vendor/svelte/transition/index.js";
@@ -92,17 +92,17 @@ import "../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
92
92
  import "../../shared-utils/url/absoluteUrl.js";
93
93
  import "../../shared-utils/nearlyEqual.js";
94
94
  import "../../shared-utils/five/changeMode.js";
95
- function W(d) {
95
+ function R(d) {
96
96
  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);
97
97
  return e || i;
98
98
  }
99
- function R(d) {
99
+ function G(d) {
100
100
  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);
101
101
  return e && i;
102
102
  }
103
- class Yt extends D {
103
+ class Xt extends D {
104
104
  constructor(t, e) {
105
- var a, f, c;
105
+ var a, f, m;
106
106
  super(t);
107
107
  // =============== public properties =================
108
108
  o(this, "name", "modelFloorplanPlugin");
@@ -151,22 +151,22 @@ class Yt extends D {
151
151
  * @param opts.isAutoShow 是否是自动展示
152
152
  * @param opts.userAction 是否是用户行为
153
153
  */
154
- o(this, "show", (...e) => u(this, [...e], function* (t = {}) {
154
+ o(this, "show", (...e) => c(this, [...e], function* (t = {}) {
155
155
  if (!this.state.enabled || !this.showPromise && this.state.visible)
156
156
  return;
157
157
  const i = t.userAction !== void 0 ? t.userAction : !0;
158
158
  this.updateState({ visible: !0 }, i), this._show(t);
159
159
  }));
160
160
  /** 隐藏户型图 */
161
- o(this, "hide", (...e) => u(this, [...e], function* (t = {}) {
161
+ o(this, "hide", (...e) => c(this, [...e], function* (t = {}) {
162
162
  this.state.enabled && (this.isHiddenByHideFunc = !0, this.state.visible !== !1 && (this.updateState({ visible: !1 }, t.userAction || !0), this._hide(t)));
163
163
  }));
164
164
  /** 更新户型图大小 */
165
165
  o(this, "updateSize", () => {
166
- if (!this.data || !k(this.five, this.showState) || !this.container || !this.wrapper)
167
- return;
166
+ if (!this.data || !this.container || !this.wrapper)
167
+ return !1;
168
168
  const { min: t, max: e } = this.data.bounding, i = e.x - t.x, n = e.y - t.y, h = this.state.config.attachedTo ? { attachedTo: this.state.config.attachedTo } : void 0, r = L(this.five, this.wrapper, this.floorIndex, h), a = Math.ceil(i * r), f = Math.ceil(n * r);
169
- this.size.width === a && this.size.height === f || (this.container.style.width = a + "px", this.container.style.height = f + "px", this.size = { width: a, height: f });
169
+ return this.size.width === a && this.size.height === f || (this.container.style.width = a + "px", this.container.style.height = f + "px", this.size = { width: a, height: f }), !0;
170
170
  });
171
171
  o(this, "highlight", (t) => {
172
172
  this.state.config.highlightEnable && (this.highlightData = t, this.render());
@@ -177,20 +177,20 @@ class Yt extends D {
177
177
  o(this, "_disable", (t) => {
178
178
  var i, n, h;
179
179
  const { userAction: e } = t;
180
- this.hooks.emit("disable", { userAction: e }), (i = this.showRejection) == null || i.call(this, g.BreakOffByDisable), this.showPromise = void 0, (n = this.app) == null || n.$destroy(), this.app = void 0, (h = this.container) == null || h.remove(), this.removeEventListener();
180
+ this.hooks.emit("disable", { userAction: e }), (i = this.showRejection) == null || i.call(this, p.BreakOffByDisable), this.showPromise = void 0, (n = this.app) == null || n.$destroy(), this.app = void 0, (h = this.container) == null || h.remove(), this.removeEventListener();
181
181
  });
182
182
  o(this, "_enable", (t) => {
183
183
  const { userAction: e } = t;
184
184
  this.addEventListener(), this.wrapper && (this.wrapper.append(this.container), this.hooks.emit("enable", { userAction: e }), this.state.visible && this._show({ userAction: e }));
185
185
  });
186
- o(this, "_show", (t) => u(this, null, function* () {
186
+ o(this, "_show", (t) => c(this, null, function* () {
187
187
  var h;
188
188
  if (!this.state.enabled)
189
189
  return;
190
190
  if (!((h = this.five.model) != null && h.loaded))
191
- throw new Error(g.ModelNotLoaded);
191
+ throw new Error(p.ModelNotLoaded);
192
192
  if (!this.data)
193
- throw new Error(g.DataNotLoaded);
193
+ throw new Error(p.DataNotLoaded);
194
194
  if (this.showPromise)
195
195
  return this.showPromise;
196
196
  const e = {
@@ -199,22 +199,24 @@ class Yt extends D {
199
199
  immediately: !1,
200
200
  isAutoShow: !1,
201
201
  userAction: !0
202
- }, i = l(l({}, e), t), n = () => u(this, null, function* () {
202
+ }, i = l(l({}, e), t), n = () => c(this, null, function* () {
203
203
  this.hooks.emit("show", { userAction: i.userAction, auto: i.isAutoShow });
204
204
  let r = !1, a;
205
- this.showRejection = (c) => {
206
- r = !0, a = c;
205
+ this.showRejection = (u) => {
206
+ r = !0, a = u;
207
207
  };
208
208
  const [f] = yield I(T(this.five, this.showState, i.userAction));
209
209
  if (f)
210
210
  throw f;
211
211
  if (r)
212
- throw a ? new Error(a) : new Error(g.UnknownError);
213
- this.updateSize(), this.floorIndex = i.floorIndex, this.five.model.show(this.floorIndex);
212
+ throw a ? new Error(a) : new Error(p.UnknownError);
213
+ if (!this.updateSize())
214
+ throw new Error(p.UpdateSizeError);
215
+ this.floorIndex = i.floorIndex, this.five.model.show(this.floorIndex);
214
216
  });
215
217
  return this.isHiddenByHideFunc = !1, this.showPromise = n().then(() => {
216
218
  this.showPromise = void 0, this.showRejection = void 0;
217
- const r = i.modelOpacity, a = i.immediately ? 0 : G;
219
+ const r = i.modelOpacity, a = i.immediately ? 0 : H;
218
220
  F(this.five, r, a), this.render(a), this.hooks.emit("showAnimationEnded", {
219
221
  auto: i.isAutoShow,
220
222
  userAction: i.userAction
@@ -226,7 +228,7 @@ class Yt extends D {
226
228
  }));
227
229
  o(this, "_hide", (t) => {
228
230
  var n;
229
- (n = this.showRejection) == null || n.call(this, g.BreakOffByHide), this.showPromise = void 0;
231
+ (n = this.showRejection) == null || n.call(this, p.BreakOffByHide), this.showPromise = void 0;
230
232
  const i = l(l({}, {
231
233
  userAction: !0,
232
234
  isAutoHide: !1
@@ -257,7 +259,7 @@ class Yt extends D {
257
259
  if (!e || this.state.config.autoShowEnable === !1 || this.isHiddenByHideFunc)
258
260
  return;
259
261
  const i = this.five.getCurrentState();
260
- i.mode === "Floorplan" && (this.state.visible || R(i) && (this.updateState({ visible: !0 }, !0), this._show({ isAutoShow: !0 })));
262
+ i.mode === "Floorplan" && (this.state.visible || G(i) && (this.updateState({ visible: !0 }, !0), this._show({ isAutoShow: !0 })));
261
263
  });
262
264
  /** panoIndex 改变时,更新 floorIndex */
263
265
  o(this, "onFivePanoArrived", (t) => {
@@ -269,7 +271,7 @@ class Yt extends D {
269
271
  if (!this.state.visible || this.showPromise)
270
272
  return;
271
273
  const i = this.five.getCurrentState();
272
- W(i) && (this.updateState({ visible: !1 }, e), this._hide({ userAction: e, isAutoHide: !0 }));
274
+ R(i) && (this.updateState({ visible: !1 }, e), this._hide({ userAction: e, isAutoHide: !0 }));
273
275
  });
274
276
  /** 在户型图展示时阻止多指操作, 阻止鼠标放大 */
275
277
  o(this, "onFiveWantsGesture", (t, e) => {
@@ -302,12 +304,12 @@ class Yt extends D {
302
304
  mode: "Floorplan",
303
305
  longitude: 0,
304
306
  latitude: Math.PI / 2,
305
- fov: H / ((a = e == null ? void 0 : e.scale) != null ? a : 1)
307
+ fov: k / ((a = e == null ? void 0 : e.scale) != null ? a : 1)
306
308
  }, this.defaultMissingFloorConfig = {
307
309
  imageURL: this.staticPrefix + "/release/web/saas/missing-floorplan.e274c596.png",
308
310
  imageWidth: 200,
309
311
  imageHeight: 120,
310
- text: (c = (f = e.i18n) == null ? void 0 : f.call(e, "暂无平面图")) != null ? c : "暂无平面图",
312
+ text: (m = (f = e.i18n) == null ? void 0 : f.call(e, "暂无平面图")) != null ? m : "暂无平面图",
311
313
  textFontSize: 14
312
314
  };
313
315
  const i = {
@@ -327,16 +329,16 @@ class Yt extends D {
327
329
  attachedTo: O.BOUNDING_CENTER,
328
330
  getLabelElement: void 0,
329
331
  missingFloorConfig: l(l({}, this.defaultMissingFloorConfig), e.missingFloorConfig),
330
- i18n: (p) => p,
331
- getRoomAreaText: (p) => (p / 1e6).toFixed(1) + "㎡",
332
- getRuleDistanceText: (p) => p.toString()
333
- }, n = e ? _(e, ["selector", "scale"]) : {}, h = l(l({}, i.missingFloorConfig), n.missingFloorConfig), r = m(l(l({}, i), n), { missingFloorConfig: h });
332
+ i18n: (u) => u,
333
+ getRoomAreaText: (u) => (u / 1e6).toFixed(1) + "㎡",
334
+ getRuleDistanceText: (u) => u.toString()
335
+ }, n = e ? _(e, ["selector", "scale"]) : {}, h = l(l({}, i.missingFloorConfig), n.missingFloorConfig), r = g(l(l({}, i), n), { missingFloorConfig: h });
334
336
  this.state = { enabled: !0, visible: !1, config: r }, this.initContainer(), t.model.loaded ? this.onFiveModelLoaded() : t.once("modelLoaded", this.onFiveModelLoaded), t.once("dispose", this.dispose), this.addEventListener();
335
337
  }
336
338
  load(t, e, i = !0) {
337
- return u(this, null, function* () {
338
- function n(c) {
339
- return Object.prototype.hasOwnProperty.apply(c, ["version"]);
339
+ return c(this, null, function* () {
340
+ function n(m) {
341
+ return Object.prototype.hasOwnProperty.apply(m, ["version"]);
340
342
  }
341
343
  const h = t;
342
344
  h && !h.version && console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");
@@ -376,14 +378,14 @@ class Yt extends D {
376
378
  this.updateState({ config: t }, e), this.render();
377
379
  }
378
380
  formatData(t) {
379
- return u(this, null, function* () {
381
+ return c(this, null, function* () {
380
382
  return yield b(t.data);
381
383
  });
382
384
  }
383
385
  updateState(t, e) {
384
386
  var r;
385
- const i = this.state, n = (r = t.config) != null && r.missingFloorConfig ? l(l({}, i.config.missingFloorConfig), t.config.missingFloorConfig) : i.config.missingFloorConfig, h = t.config ? m(l(l({}, i.config), t.config), { missingFloorConfig: n }) : i.config;
386
- this.state = m(l(l({}, this.state), t), { config: h }), !M(this.state, i, { deep: !0 }) && this.hooks.emit("stateChange", { state: this.state, prevState: i, userAction: e });
387
+ const i = this.state, n = (r = t.config) != null && r.missingFloorConfig ? l(l({}, i.config.missingFloorConfig), t.config.missingFloorConfig) : i.config.missingFloorConfig, h = t.config ? g(l(l({}, i.config), t.config), { missingFloorConfig: n }) : i.config;
388
+ 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 });
387
389
  }
388
390
  /** 如果用户是通过 selector 设置父容器,需要在 modelLoaded 之后把 container 自动放到父容器里
389
391
  *
@@ -412,7 +414,7 @@ class Yt extends D {
412
414
  render(t) {
413
415
  if (!this.state.enabled || !this.container || !this.data || this.size.width === 0 || this.showPromise)
414
416
  return;
415
- const e = m(l({}, this.state.config), {
417
+ const e = g(l({}, this.state.config), {
416
418
  visible: this.state.visible,
417
419
  duration: t != null ? t : 0,
418
420
  panoIndex: this.panoIndex,
@@ -427,5 +429,5 @@ class Yt extends D {
427
429
  }
428
430
  }
429
431
  export {
430
- Yt as Controller
432
+ Xt as Controller
431
433
  };
@@ -30,7 +30,7 @@ export declare class Controller extends BasePlugin.Controller<State, EventMap, P
30
30
  constructor(five: Five, params?: Parameters);
31
31
  load(serverData: PluginServerData | FloorplanServerData, state?: Partial<State>, userAction?: boolean): Promise<void>;
32
32
  /** 更新户型图大小 */
33
- updateSize: () => void;
33
+ updateSize: () => boolean;
34
34
  /** 更新户型图位置 */
35
35
  updatePosition(): void;
36
36
  /** 把插件的渲染DOM插入到对应的容器中去 */
@@ -121,9 +121,9 @@ class Bt extends M {
121
121
  /** 更新户型图大小 */
122
122
  o(this, "updateSize", () => {
123
123
  if (!this.data || !this.container || !this.wrapper || this.five.getCurrentState().mode !== "Topview")
124
- return;
124
+ return !1;
125
125
  const { min: t, max: e } = this.data.bounding, i = e.x - t.x, s = e.y - t.y, r = this.state.config.attachedTo ? { attachedTo: this.state.config.attachedTo } : void 0, a = P(this.five, this.wrapper, this.floorIndex, r), h = Math.ceil(i * a), c = Math.ceil(s * a);
126
- this.size.width === h && this.size.height === c || (this.container.style.width = h + "px", this.container.style.height = c + "px", this.size = { width: h, height: c });
126
+ return this.size.width === h && this.size.height === c || (this.container.style.width = h + "px", this.container.style.height = c + "px", this.size = { width: h, height: c }), !0;
127
127
  });
128
128
  /** 销毁插件 */
129
129
  o(this, "dispose", () => {
@@ -3,6 +3,8 @@ export declare const enum FloorplanErrorType {
3
3
  UnknownError = "UnknownError",
4
4
  /** 数据未加载 */
5
5
  DataNotLoaded = "DataNotLoaded",
6
+ /** 更新户型图大小失败 */
7
+ UpdateSizeError = "UpdateSizeError",
6
8
  /** 展示过程被隐藏打断 */
7
9
  BreakOffByHide = "BreakOffByHide",
8
10
  /** 展示过程中插件被禁用 */
@@ -1,4 +1,4 @@
1
- var a = /* @__PURE__ */ ((e) => (e.UnknownError = "UnknownError", e.DataNotLoaded = "DataNotLoaded", e.BreakOffByHide = "BreakOffByHide", e.BreakOffByDisable = "BreakOffByDisable", e.ModelNotLoaded = "ModelNotLoaded", e.ChangeModeError = "ChangeModeError", e.UpdateCameraError = "UpdateCameraError", e))(a || {});
1
+ var a = /* @__PURE__ */ ((e) => (e.UnknownError = "UnknownError", e.DataNotLoaded = "DataNotLoaded", e.UpdateSizeError = "UpdateSizeError", e.BreakOffByHide = "BreakOffByHide", e.BreakOffByDisable = "BreakOffByDisable", e.ModelNotLoaded = "ModelNotLoaded", e.ChangeModeError = "ChangeModeError", e.UpdateCameraError = "UpdateCameraError", e))(a || {});
2
2
  const d = 500, t = 80;
3
3
  export {
4
4
  t as FIVE_CAMERA_DEFAULT_FOV,
@@ -1,4 +1,4 @@
1
- var c = (e, t, o) => new Promise((m, n) => {
1
+ var l = (e, t, o) => new Promise((m, n) => {
2
2
  var i = (r) => {
3
3
  try {
4
4
  u(o.next(r));
@@ -14,26 +14,26 @@ var c = (e, t, o) => new Promise((m, n) => {
14
14
  }, u = (r) => r.done ? m(r.value) : Promise.resolve(r.value).then(i, a);
15
15
  u((o = o.apply(e, t)).next());
16
16
  });
17
- import { to as l } from "../../shared-utils/to.js";
17
+ import { to as s } from "../../shared-utils/to.js";
18
18
  import { FloorplanErrorType as p } from "./constant.js";
19
- import { nearlyEqual as s } from "../../shared-utils/nearlyEqual.js";
19
+ import { nearlyEqual as d } from "../../shared-utils/nearlyEqual.js";
20
20
  import { changeMode as M } from "../../shared-utils/five/changeMode.js";
21
21
  import { omit as g } from "../../shared-utils/filter.js";
22
22
  function h(e, t) {
23
23
  if (e.currentMode !== t.mode)
24
24
  return !1;
25
25
  const { latitude: o, longitude: m, fov: n, offset: i } = t, { latitude: a, longitude: u, offset: r } = e.getCurrentState(), f = e.camera.fov;
26
- return !(!s(o, a, 2) || !s(m, u, 2) || i !== void 0 && i.distanceTo(r) > 0.01 || n !== f);
26
+ return !(!d(o, a, 2) || !d(m, u, 2) || i !== void 0 && i.distanceTo(r) > 0.01 || !d(n, f, 2));
27
27
  }
28
28
  function b(e, t, o = !0) {
29
- return c(this, null, function* () {
29
+ return l(this, null, function* () {
30
30
  if (h(e, t) === !0)
31
31
  return;
32
32
  const n = e.getCurrentState();
33
33
  if (n.mode !== t.mode) {
34
- const [d] = yield l(M(e, [t.mode, t, void 0, o]));
35
- if (d)
36
- throw d;
34
+ const [c] = yield s(M(e, [t.mode, t, void 0, o]));
35
+ if (c)
36
+ throw c;
37
37
  return;
38
38
  }
39
39
  const { latitude: i, longitude: a, fov: u } = n, r = Math.min(
@@ -44,12 +44,11 @@ function b(e, t, o = !0) {
44
44
  (a > Math.PI ? 2 * Math.PI - a : a) * 500,
45
45
  typeof t.fov == "number" ? Math.abs(u - t.fov) * 10 : 1 / 0
46
46
  )
47
- ), [f] = yield l(e.updateCamera(g(t, ["mode"]), r, o));
47
+ ), [f] = yield s(e.updateCamera(g(t, ["mode"]), r, o));
48
48
  if (f)
49
49
  throw new Error(p.UpdateCameraError);
50
50
  });
51
51
  }
52
52
  export {
53
- h as checkShowState,
54
53
  b as correctFiveState
55
54
  };
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.3.2",
3
+ "%c %c@realsee/dnalogel %cv3.3.4",
4
4
  [
5
5
  "background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')",
6
6
  "background-repeat: no-repeat",
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "repository": "https://github.com/realsee-developer/dnalogel.git",
8
8
  "description": "如视 VR 看房插件合集",
9
9
  "private": false,
10
- "version": "3.3.2",
10
+ "version": "3.3.4",
11
11
  "license": "SEE LICENSE IN TERMS.txt",
12
12
  "scripts": {
13
13
  "clean": "rm -rf components dist docs libs types ./vite.config.js.timestamp*",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "devDependencies": {
38
38
  "@babel/core": "^7.22.9",
39
- "@realsee/five": "6.0.0-alpha.34",
39
+ "@realsee/five": "6.0.0-alpha.37",
40
40
  "@sveltejs/vite-plugin-svelte": "^2.4.2",
41
41
  "@tsconfig/svelte": "^4.0.1",
42
42
  "@tweenjs/tween.js": "^20.0.3",