@realsee/dnalogel 3.0.1 → 3.1.0

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 (34) hide show
  1. package/dist/floorplan/Components/MissingFloor.svelte.d.ts +1 -0
  2. package/dist/floorplan/MapviewFloorplanPlugin/Controller.d.ts +1 -0
  3. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +1 -0
  4. package/dist/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +2 -0
  5. package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +1 -0
  6. package/dist/floorplan/typings/index.d.ts +15 -0
  7. package/dist/index.cjs.js +62 -62
  8. package/dist/index.js +6654 -6294
  9. package/dist/index.umd.js +48 -48
  10. package/dist/shared-utils/filter.d.ts +1 -1
  11. package/libs/base/BasePlugin.js +1 -1
  12. package/libs/floorplan/Components/CurrentFloor.js +423 -214
  13. package/libs/floorplan/Components/Main.js +205 -271
  14. package/libs/floorplan/Components/MissingFloor.js +99 -0
  15. package/libs/floorplan/Components/MissingFloor.svelte.d.ts +1 -0
  16. package/libs/floorplan/MapviewFloorplanPlugin/Controller.d.ts +1 -0
  17. package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +74 -66
  18. package/libs/floorplan/MapviewFloorplanPlugin/index.js +9 -8
  19. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +1 -0
  20. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +108 -101
  21. package/libs/floorplan/ModelFloorplanPlugin/index.js +9 -8
  22. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +88 -68
  23. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +199 -127
  24. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +110 -100
  25. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +15 -14
  26. package/libs/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +2 -0
  27. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +1 -0
  28. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +118 -110
  29. package/libs/floorplan/TopviewFloorplanPlugin/index.js +9 -8
  30. package/libs/floorplan/typings/index.d.ts +15 -0
  31. package/libs/index.js +122 -121
  32. package/libs/shared-utils/filter.d.ts +1 -1
  33. package/libs/shared-utils/logger.js +1 -1
  34. package/package.json +1 -1
@@ -1,52 +1,48 @@
1
- var A = Object.defineProperty, S = Object.defineProperties;
2
- var F = Object.getOwnPropertyDescriptors;
1
+ var A = Object.defineProperty, C = Object.defineProperties;
2
+ var S = Object.getOwnPropertyDescriptors;
3
3
  var w = Object.getOwnPropertySymbols;
4
4
  var E = Object.prototype.hasOwnProperty, P = Object.prototype.propertyIsEnumerable;
5
- var m = (h, r, t) => r in h ? A(h, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[r] = t, u = (h, r) => {
6
- for (var t in r || (r = {}))
7
- E.call(r, t) && m(h, t, r[t]);
5
+ var v = (d, s, t) => s in d ? A(d, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[s] = t, l = (d, s) => {
6
+ for (var t in s || (s = {}))
7
+ E.call(s, t) && v(d, t, s[t]);
8
8
  if (w)
9
- for (var t of w(r))
10
- P.call(r, t) && m(h, t, r[t]);
11
- return h;
12
- }, v = (h, r) => S(h, F(r));
13
- var o = (h, r, t) => (m(h, typeof r != "symbol" ? r + "" : r, t), t);
14
- var f = (h, r, t) => new Promise((e, i) => {
15
- var n = (s) => {
9
+ for (var t of w(s))
10
+ P.call(s, t) && v(d, t, s[t]);
11
+ return d;
12
+ }, m = (d, s) => C(d, S(s));
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) => {
15
+ var n = (a) => {
16
16
  try {
17
- a(t.next(s));
18
- } catch (l) {
19
- i(l);
17
+ r(t.next(a));
18
+ } catch (f) {
19
+ i(f);
20
20
  }
21
- }, d = (s) => {
21
+ }, h = (a) => {
22
22
  try {
23
- a(t.throw(s));
24
- } catch (l) {
25
- i(l);
23
+ r(t.throw(a));
24
+ } catch (f) {
25
+ i(f);
26
26
  }
27
- }, a = (s) => s.done ? e(s.value) : Promise.resolve(s.value).then(n, d);
28
- a((t = t.apply(h, r)).next());
27
+ }, r = (a) => a.done ? e(a.value) : Promise.resolve(a.value).then(n, h);
28
+ r((t = t.apply(d, s)).next());
29
29
  });
30
- import { to as C } from "../../shared-utils/to.js";
31
- import { equal as I } from "../../shared-utils/equal.js";
32
- import { Main as M } from "../Components/Main.js";
33
- import { formatData as g } from "../utils/formatData.js";
34
- import { CAMERA_IMAGE as x } from "../Assets/camera.js";
35
- import { omit as y } from "../../shared-utils/filter.js";
36
- import { getPxmm as _ } from "../../shared-utils/getPxmm.js";
37
- import { FLOOR_PLAN_ATTACHED_TO as L } from "../constant.js";
38
- import { Controller as O } from "../../base/BasePluginWithData.js";
39
- import { checkShowState as D, correctFiveState as k } from "../utils/correctFiveState.js";
40
- import { changeModelCanvasOpacity as b } from "../../shared-utils/changeModelCanvasOpacity.js";
41
- import { FIVE_CAMERA_DEFAULT_FOV as T, FloorplanErrorType as c, SHOW_ANIME_DURATION as G } from "../utils/constant.js";
30
+ import { to as I } from "../../shared-utils/to.js";
31
+ import { equal as M } from "../../shared-utils/equal.js";
32
+ import { Main as x } from "../Components/Main.js";
33
+ import { formatData as b } from "../utils/formatData.js";
34
+ import { CAMERA_IMAGE as y } from "../Assets/camera.js";
35
+ import { omit as _ } from "../../shared-utils/filter.js";
36
+ import { getPxmm as L } from "../../shared-utils/getPxmm.js";
37
+ import { FLOOR_PLAN_ATTACHED_TO as O } from "../constant.js";
38
+ import { Controller as D } from "../../base/BasePluginWithData.js";
39
+ import { checkShowState as k, correctFiveState as T } from "../utils/correctFiveState.js";
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";
42
42
  import "../../shared-utils/isTruelyObject.js";
43
43
  import "../../vendor/svelte/internal/index.js";
44
44
  import "../../vendor/svelte/transition/index.js";
45
45
  import "../../vendor/svelte/easing/index.js";
46
- import "../Components/Camera.js";
47
- import "../../shared-utils/math/rad2Deg.js";
48
- import "../Components/Compass.js";
49
- import "../Assets/compass.js";
50
46
  import "../Components/CurrentFloor.js";
51
47
  import "../../vendor/svelte/store/index.js";
52
48
  import "../Components/BaseImage.js";
@@ -65,6 +61,11 @@ import "../Components/RoomMaterials/RoomMaterial_1.js";
65
61
  import "../Components/RoomMaterials/RoomMaterial_2.js";
66
62
  import "../Components/RoomHighlight/RoomHighlight.js";
67
63
  import "../Components/RoomHighlight/Room.js";
64
+ import "../Components/MissingFloor.js";
65
+ import "../Components/Camera.js";
66
+ import "../../shared-utils/math/rad2Deg.js";
67
+ import "../Components/Compass.js";
68
+ import "../Assets/compass.js";
68
69
  import "../Assets/floorplanExtraObject.js";
69
70
  import "../../shared-utils/tap.js";
70
71
  import "three";
@@ -91,17 +92,17 @@ import "../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
91
92
  import "../../shared-utils/url/absoluteUrl.js";
92
93
  import "../../shared-utils/nearlyEqual.js";
93
94
  import "../../shared-utils/five/changeMode.js";
94
- function H(h) {
95
- const { latitude: r, longitude: t } = h, e = Math.abs(r - Math.PI / 2) > 5 * Math.PI / 180, i = t > 5 * (Math.PI / 180) && t < 355 * (Math.PI / 180);
95
+ function W(d) {
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);
96
97
  return e || i;
97
98
  }
98
- function W(h) {
99
- const { latitude: r, longitude: t } = h, e = Math.abs(r - Math.PI / 2) < 10 * Math.PI / 180, i = t < 30 * (Math.PI / 180) || t > 330 * (Math.PI / 180);
99
+ function R(d) {
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);
100
101
  return e && i;
101
102
  }
102
- class Qt extends O {
103
+ class Yt extends D {
103
104
  constructor(t, e) {
104
- var a;
105
+ var a, f, c;
105
106
  super(t);
106
107
  // =============== public properties =================
107
108
  o(this, "name", "modelFloorplanPlugin");
@@ -126,6 +127,7 @@ class Qt extends O {
126
127
  o(this, "lastPanoramaLongitude", 0);
127
128
  /** 户型图大小 */
128
129
  o(this, "size", { width: 0, height: 0 });
130
+ o(this, "defaultMissingFloorConfig");
129
131
  /** 是否已经执行过事件监听 */
130
132
  o(this, "hasAddedEventListener", !1);
131
133
  /** 上一次隐藏是否是用户调用了 hide 导致的 */
@@ -149,22 +151,22 @@ class Qt extends O {
149
151
  * @param opts.isAutoShow 是否是自动展示
150
152
  * @param opts.userAction 是否是用户行为
151
153
  */
152
- o(this, "show", (...e) => f(this, [...e], function* (t = {}) {
154
+ o(this, "show", (...e) => u(this, [...e], function* (t = {}) {
153
155
  if (!this.state.enabled || !this.showPromise && this.state.visible)
154
156
  return;
155
157
  const i = t.userAction !== void 0 ? t.userAction : !0;
156
158
  this.updateState({ visible: !0 }, i), this._show(t);
157
159
  }));
158
160
  /** 隐藏户型图 */
159
- o(this, "hide", (...e) => f(this, [...e], function* (t = {}) {
161
+ o(this, "hide", (...e) => u(this, [...e], function* (t = {}) {
160
162
  this.state.enabled && (this.isHiddenByHideFunc = !0, this.state.visible !== !1 && (this.updateState({ visible: !1 }, t.userAction || !0), this._hide(t)));
161
163
  }));
162
164
  /** 更新户型图大小 */
163
165
  o(this, "updateSize", () => {
164
- if (!this.data || !D(this.five, this.showState) || !this.container || !this.wrapper)
166
+ if (!this.data || !k(this.five, this.showState) || !this.container || !this.wrapper)
165
167
  return;
166
- const { min: t, max: e } = this.data.bounding, i = e.x - t.x, n = e.y - t.y, d = this.state.config.attachedTo ? { attachedTo: this.state.config.attachedTo } : void 0, a = _(this.five, this.wrapper, this.floorIndex, d), s = Math.ceil(i * a), l = Math.ceil(n * a);
167
- this.size.width === s && this.size.height === l || (this.container.style.width = s + "px", this.container.style.height = l + "px", this.size = { width: s, height: l });
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 });
168
170
  });
169
171
  o(this, "highlight", (t) => {
170
172
  this.state.config.highlightEnable && (this.highlightData = t, this.render());
@@ -173,22 +175,22 @@ class Qt extends O {
173
175
  this.highlightData = {}, this.render();
174
176
  });
175
177
  o(this, "_disable", (t) => {
176
- var i, n, d;
178
+ var i, n, h;
177
179
  const { userAction: e } = t;
178
- this.hooks.emit("disable", { userAction: e }), (i = this.showRejection) == null || i.call(this, c.BreakOffByDisable), this.showPromise = void 0, (n = this.app) == null || n.$destroy(), this.app = void 0, (d = this.container) == null || d.remove(), this.removeEventListener();
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();
179
181
  });
180
182
  o(this, "_enable", (t) => {
181
183
  const { userAction: e } = t;
182
184
  this.addEventListener(), this.wrapper && (this.wrapper.append(this.container), this.hooks.emit("enable", { userAction: e }), this.state.visible && this._show({ userAction: e }));
183
185
  });
184
- o(this, "_show", (t) => f(this, null, function* () {
185
- var d;
186
+ o(this, "_show", (t) => u(this, null, function* () {
187
+ var h;
186
188
  if (!this.state.enabled)
187
189
  return;
188
- if (!((d = this.five.model) != null && d.loaded))
189
- throw new Error(c.ModelNotLoaded);
190
+ if (!((h = this.five.model) != null && h.loaded))
191
+ throw new Error(g.ModelNotLoaded);
190
192
  if (!this.data)
191
- throw new Error(c.DataNotLoaded);
193
+ throw new Error(g.DataNotLoaded);
192
194
  if (this.showPromise)
193
195
  return this.showPromise;
194
196
  const e = {
@@ -197,39 +199,39 @@ class Qt extends O {
197
199
  immediately: !1,
198
200
  isAutoShow: !1,
199
201
  userAction: !0
200
- }, i = u(u({}, e), t), n = () => f(this, null, function* () {
202
+ }, i = l(l({}, e), t), n = () => u(this, null, function* () {
201
203
  this.hooks.emit("show", { userAction: i.userAction, auto: i.isAutoShow });
202
- let a = !1, s;
203
- this.showRejection = (p) => {
204
- a = !0, s = p;
204
+ let r = !1, a;
205
+ this.showRejection = (c) => {
206
+ r = !0, a = c;
205
207
  };
206
- const [l] = yield C(k(this.five, this.showState, i.userAction));
207
- if (l)
208
- throw l;
209
- if (a)
210
- throw s ? new Error(s) : new Error(c.UnknownError);
208
+ const [f] = yield I(T(this.five, this.showState, i.userAction));
209
+ if (f)
210
+ throw f;
211
+ if (r)
212
+ throw a ? new Error(a) : new Error(g.UnknownError);
211
213
  this.updateSize(), this.floorIndex = i.floorIndex, this.five.model.show(this.floorIndex);
212
214
  });
213
215
  return this.isHiddenByHideFunc = !1, this.showPromise = n().then(() => {
214
216
  this.showPromise = void 0, this.showRejection = void 0;
215
- const a = i.modelOpacity, s = i.immediately ? 0 : G;
216
- b(this.five, a, s), this.render(s), this.hooks.emit("showAnimationEnded", {
217
+ const r = i.modelOpacity, a = i.immediately ? 0 : G;
218
+ F(this.five, r, a), this.render(a), this.hooks.emit("showAnimationEnded", {
217
219
  auto: i.isAutoShow,
218
220
  userAction: i.userAction
219
221
  });
220
- }).catch((a) => {
221
- if (this.showPromise = void 0, this.showRejection = void 0, this.updateState({ visible: !1 }, i.userAction), !i.isAutoShow && a instanceof Error)
222
- throw a;
222
+ }).catch((r) => {
223
+ if (this.showPromise = void 0, this.showRejection = void 0, this.updateState({ visible: !1 }, i.userAction), !i.isAutoShow && r instanceof Error)
224
+ throw r;
223
225
  }), this.showPromise;
224
226
  }));
225
227
  o(this, "_hide", (t) => {
226
228
  var n;
227
- (n = this.showRejection) == null || n.call(this, c.BreakOffByHide), this.showPromise = void 0;
228
- const i = u(u({}, {
229
+ (n = this.showRejection) == null || n.call(this, g.BreakOffByHide), this.showPromise = void 0;
230
+ const i = l(l({}, {
229
231
  userAction: !0,
230
232
  isAutoHide: !1
231
233
  }), t);
232
- b(this.five, 1, 0), this.hooks.emit("hide", { auto: i.isAutoHide, userAction: i.userAction }), this.render();
234
+ F(this.five, 1, 0), this.hooks.emit("hide", { auto: i.isAutoHide, userAction: i.userAction }), this.render();
233
235
  });
234
236
  o(this, "handleClick", () => {
235
237
  if (!this.state.visible)
@@ -255,7 +257,7 @@ class Qt extends O {
255
257
  if (!e || this.state.config.autoShowEnable === !1 || this.isHiddenByHideFunc)
256
258
  return;
257
259
  const i = this.five.getCurrentState();
258
- i.mode === "Floorplan" && (this.state.visible || W(i) && (this.updateState({ visible: !0 }, !0), this._show({ isAutoShow: !0 })));
260
+ i.mode === "Floorplan" && (this.state.visible || R(i) && (this.updateState({ visible: !0 }, !0), this._show({ isAutoShow: !0 })));
259
261
  });
260
262
  /** panoIndex 改变时,更新 floorIndex */
261
263
  o(this, "onFivePanoArrived", (t) => {
@@ -267,7 +269,7 @@ class Qt extends O {
267
269
  if (!this.state.visible || this.showPromise)
268
270
  return;
269
271
  const i = this.five.getCurrentState();
270
- H(i) && (this.updateState({ visible: !1 }, e), this._hide({ userAction: e, isAutoHide: !0 }));
272
+ W(i) && (this.updateState({ visible: !1 }, e), this._hide({ userAction: e, isAutoHide: !0 }));
271
273
  });
272
274
  /** 在户型图展示时阻止多指操作, 阻止鼠标放大 */
273
275
  o(this, "onFiveWantsGesture", (t, e) => {
@@ -300,7 +302,13 @@ class Qt extends O {
300
302
  mode: "Floorplan",
301
303
  longitude: 0,
302
304
  latitude: Math.PI / 2,
303
- fov: T / ((a = e == null ? void 0 : e.scale) != null ? a : 1)
305
+ fov: H / ((a = e == null ? void 0 : e.scale) != null ? a : 1)
306
+ }, this.defaultMissingFloorConfig = {
307
+ imageURL: this.staticPrefix + "/release/web/saas/missing-floorplan.e274c596.png",
308
+ imageWidth: 200,
309
+ imageHeight: 120,
310
+ text: (c = (f = e.i18n) == null ? void 0 : f.call(e, "暂无平面图")) != null ? c : "暂无平面图",
311
+ textFontSize: 14
304
312
  };
305
313
  const i = {
306
314
  northDesc: "北",
@@ -315,27 +323,25 @@ class Qt extends O {
315
323
  roomAreaEnable: !0,
316
324
  roomNameEnable: !0,
317
325
  adaptiveRoomLabelVisibleEnable: !0,
318
- cameraImageUrl: x,
319
- attachedTo: L.BOUNDING_CENTER,
326
+ cameraImageUrl: y,
327
+ attachedTo: O.BOUNDING_CENTER,
320
328
  getLabelElement: void 0,
321
- getRoomAreaText: (s) => (s / 1e6).toFixed(1) + "㎡",
322
- getRuleDistanceText: (s) => s.toString()
323
- }, n = e ? y(e, ["selector", "scale"]) : {}, d = u(u({}, i), n);
324
- this.state = {
325
- enabled: !0,
326
- visible: !1,
327
- config: d
328
- }, this.initContainer(), t.model.loaded ? this.onFiveModelLoaded() : t.once("modelLoaded", this.onFiveModelLoaded), t.once("dispose", this.dispose), this.addEventListener();
329
+ 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 });
334
+ 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();
329
335
  }
330
336
  load(t, e, i = !0) {
331
- return f(this, null, function* () {
332
- function n(p) {
333
- return Object.prototype.hasOwnProperty.apply(p, ["version"]);
337
+ return u(this, null, function* () {
338
+ function n(c) {
339
+ return Object.prototype.hasOwnProperty.apply(c, ["version"]);
334
340
  }
335
- const d = t;
336
- d && !d.version && console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");
337
- const a = JSON.parse(JSON.stringify(t)), s = n(a) ? a.data : a, l = this.data;
338
- this.data = yield g(s), this.hooks.emit("dataLoaded", this.data), this.hooks.emit("dataChange", this.data, l), e && this.updateState(e, i), this.render();
341
+ const h = t;
342
+ h && !h.version && console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");
343
+ const r = JSON.parse(JSON.stringify(t)), a = n(r) ? r.data : r, f = this.data;
344
+ this.data = yield b(a), this.hooks.emit("dataLoaded", this.data), this.hooks.emit("dataChange", this.data, f), e && this.updateState(e, i), this.render();
339
345
  });
340
346
  }
341
347
  /** 把插件的渲染DOM插入到对应的容器中去 */
@@ -361,8 +367,8 @@ class Qt extends O {
361
367
  setState(t, e = {}) {
362
368
  const i = this.state, n = e.userAction !== void 0 ? e.userAction : !0;
363
369
  if (this.updateState(t, n), t.enabled !== void 0 && i.enabled !== t.enabled && (t.enabled ? this._enable({ userAction: n }) : this._disable({ userAction: n })), t.visible !== void 0 && i.visible !== t.visible) {
364
- const d = { userAction: n };
365
- t.visible ? this._show(d) : this._hide(d);
370
+ const h = { userAction: n };
371
+ t.visible ? this._show(h) : this._hide(h);
366
372
  }
367
373
  this.render();
368
374
  }
@@ -370,13 +376,14 @@ class Qt extends O {
370
376
  this.updateState({ config: t }, e), this.render();
371
377
  }
372
378
  formatData(t) {
373
- return f(this, null, function* () {
374
- return yield g(t.data);
379
+ return u(this, null, function* () {
380
+ return yield b(t.data);
375
381
  });
376
382
  }
377
383
  updateState(t, e) {
378
- const i = this.state, n = t.config ? u(u({}, i.config), t.config) : i.config;
379
- this.state = v(u(u({}, this.state), t), { config: n }), !I(this.state, i, { deep: !0 }) && this.hooks.emit("stateChange", { state: this.state, prevState: i, userAction: e });
384
+ 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 });
380
387
  }
381
388
  /** 如果用户是通过 selector 设置父容器,需要在 modelLoaded 之后把 container 自动放到父容器里
382
389
  *
@@ -405,7 +412,7 @@ class Qt extends O {
405
412
  render(t) {
406
413
  if (!this.state.enabled || !this.container || !this.data || this.size.width === 0 || this.showPromise)
407
414
  return;
408
- const e = v(u({}, this.state.config), {
415
+ const e = m(l({}, this.state.config), {
409
416
  visible: this.state.visible,
410
417
  duration: t != null ? t : 0,
411
418
  panoIndex: this.panoIndex,
@@ -416,9 +423,9 @@ class Qt extends O {
416
423
  });
417
424
  if (this.app)
418
425
  return this.app.$set(e);
419
- this.app = new M({ target: this.container, intro: !0, props: e });
426
+ this.app = new x({ target: this.container, intro: !0, props: e });
420
427
  }
421
428
  }
422
429
  export {
423
- Qt as Controller
430
+ Yt as Controller
424
431
  };
@@ -6,11 +6,6 @@ import "../Components/Main.js";
6
6
  import "../../vendor/svelte/internal/index.js";
7
7
  import "../../vendor/svelte/transition/index.js";
8
8
  import "../../vendor/svelte/easing/index.js";
9
- import "../Components/Camera.js";
10
- import "../Assets/camera.js";
11
- import "../../shared-utils/math/rad2Deg.js";
12
- import "../Components/Compass.js";
13
- import "../Assets/compass.js";
14
9
  import "../Components/CurrentFloor.js";
15
10
  import "../../vendor/svelte/store/index.js";
16
11
  import "../Components/BaseImage.js";
@@ -29,6 +24,12 @@ import "../Components/RoomMaterials/RoomMaterial_1.js";
29
24
  import "../Components/RoomMaterials/RoomMaterial_2.js";
30
25
  import "../Components/RoomHighlight/RoomHighlight.js";
31
26
  import "../Components/RoomHighlight/Room.js";
27
+ import "../Components/MissingFloor.js";
28
+ import "../Components/Camera.js";
29
+ import "../Assets/camera.js";
30
+ import "../../shared-utils/math/rad2Deg.js";
31
+ import "../Components/Compass.js";
32
+ import "../Assets/compass.js";
32
33
  import "../utils/formatData.js";
33
34
  import "../Assets/floorplanExtraObject.js";
34
35
  import "../../shared-utils/filter.js";
@@ -63,8 +64,8 @@ import "../utils/constant.js";
63
64
  import "../../shared-utils/nearlyEqual.js";
64
65
  import "../../shared-utils/five/changeMode.js";
65
66
  import "../../shared-utils/changeModelCanvasOpacity.js";
66
- const go = (o, r) => new t(o, r);
67
+ const wo = (o, r) => new t(o, r);
67
68
  export {
68
- go as ModelFloorplanPlugin,
69
- go as default
69
+ wo as ModelFloorplanPlugin,
70
+ wo as default
70
71
  };
@@ -1,112 +1,132 @@
1
- import { SvelteComponent as D, init as w, safe_not_equal as k, append_styles as T, element as g, attr as p, set_style as l, insert as W, append as x, noop as I, detach as P, onMount as S } from "../../../vendor/svelte/internal/index.js";
2
- import { CAMERA_IMAGE as b } from "../../Assets/camera.js";
3
- import { throttle as E } from "../../../shared-utils/throttle.js";
4
- function F(n) {
5
- T(n, "svelte-1nqrlxd", ".plugin-radar__camera-wrapper.svelte-1nqrlxd{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1nqrlxd{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1nqrlxd{position:absolute;left:-0.9375rem;top:-0.9375rem;width:1.0625rem;height:1.0625rem;transform-origin:0.9375rem 0.9375rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}");
1
+ import { SvelteComponent as T, init as W, safe_not_equal as E, append_styles as R, element as h, attr as _, set_style as s, insert as z, append as D, noop as q, detach as G, onMount as H } from "../../../vendor/svelte/internal/index.js";
2
+ import { CAMERA_IMAGE as w } from "../../Assets/camera.js";
3
+ import { throttle as O } from "../../../shared-utils/throttle.js";
4
+ function j(r) {
5
+ R(r, "svelte-1nqrlxd", ".plugin-radar__camera-wrapper.svelte-1nqrlxd{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1nqrlxd{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1nqrlxd{position:absolute;left:-0.9375rem;top:-0.9375rem;width:1.0625rem;height:1.0625rem;transform-origin:0.9375rem 0.9375rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}");
6
6
  }
7
- function R(n) {
8
- let a, t, o;
7
+ function B(r) {
8
+ let n, e, a;
9
9
  return {
10
10
  c() {
11
- a = g("div"), t = g("div"), o = g("div"), p(o, "class", "plugin-radar__camera-rotate svelte-1nqrlxd"), l(o, "background-image", "url(" + /*cameraImageUrl*/
12
- (n[0] || b) + ")"), l(
13
- o,
11
+ n = h("div"), e = h("div"), a = h("div"), _(a, "class", "plugin-radar__camera-rotate svelte-1nqrlxd"), s(a, "background-image", "url(" + /*cameraImageUrl*/
12
+ (r[0] || w) + ")"), s(
13
+ a,
14
14
  "transform",
15
15
  /*rotateTransform*/
16
- n[1]
17
- ), p(t, "class", "plugin-radar__camera-position svelte-1nqrlxd"), l(
18
- t,
16
+ r[1]
17
+ ), _(e, "class", "plugin-radar__camera-position svelte-1nqrlxd"), s(
18
+ e,
19
19
  "transform",
20
20
  /*positionTransform*/
21
- n[2]
22
- ), p(a, "class", "plugin-radar__camera-wrapper svelte-1nqrlxd");
21
+ r[2]
22
+ ), _(n, "class", "plugin-radar__camera-wrapper svelte-1nqrlxd"), s(
23
+ n,
24
+ "opacity",
25
+ /*hasCurrentFloorData*/
26
+ r[3] ? 1 : 0
27
+ );
23
28
  },
24
- m(i, r) {
25
- W(i, a, r), x(a, t), x(t, o);
29
+ m(i, l) {
30
+ z(i, n, l), D(n, e), D(e, a);
26
31
  },
27
- p(i, [r]) {
28
- r & /*cameraImageUrl*/
29
- 1 && l(o, "background-image", "url(" + /*cameraImageUrl*/
30
- (i[0] || b) + ")"), (r & /*cameraImageUrl*/
31
- 1 || r & /*rotateTransform, cameraImageUrl*/
32
- 3) && l(
33
- o,
32
+ p(i, [l]) {
33
+ l & /*cameraImageUrl*/
34
+ 1 && s(a, "background-image", "url(" + /*cameraImageUrl*/
35
+ (i[0] || w) + ")"), (l & /*cameraImageUrl*/
36
+ 1 || l & /*rotateTransform, cameraImageUrl*/
37
+ 3) && s(
38
+ a,
34
39
  "transform",
35
40
  /*rotateTransform*/
36
41
  i[1]
37
- ), r & /*positionTransform*/
38
- 4 && l(
39
- t,
42
+ ), l & /*positionTransform*/
43
+ 4 && s(
44
+ e,
40
45
  "transform",
41
46
  /*positionTransform*/
42
47
  i[2]
48
+ ), l & /*hasCurrentFloorData*/
49
+ 8 && s(
50
+ n,
51
+ "opacity",
52
+ /*hasCurrentFloorData*/
53
+ i[3] ? 1 : 0
43
54
  );
44
55
  },
45
- i: I,
46
- o: I,
56
+ i: q,
57
+ o: q,
47
58
  d(i) {
48
- i && P(a);
59
+ i && G(n);
49
60
  }
50
61
  };
51
62
  }
52
- function z(n) {
53
- return `rotate(${Math.floor(n / Math.PI * 180) * -1 + 45}deg)`;
63
+ function J(r) {
64
+ return `rotate(${Math.floor(r / Math.PI * 180) * -1 + 45}deg)`;
54
65
  }
55
- function G(n, a, t) {
56
- let o, i, { five: r } = a, { pxmm: m } = a, { floorplanData: f } = a, { cameraImageUrl: _ } = a, c = r.getCurrentState().panoIndex, d = r.getCurrentState().longitude;
57
- function q(e, C) {
58
- const s = e.bounding, u = e.observers[C];
59
- if (!u)
66
+ function K(r, n, e) {
67
+ var y, A;
68
+ let a, i, l, c, { five: o } = n, { pxmm: m } = n, { floorplanData: f } = n, { cameraImageUrl: x } = n, u = o.getCurrentState().panoIndex, p = o.getCurrentState().longitude, g = (A = (y = o.work.observers[o.getCurrentState().panoIndex]) == null ? void 0 : y.floorIndex) != null ? A : 0;
69
+ function M(t, U) {
70
+ const d = t.bounding, v = t.observers[U];
71
+ if (!v)
60
72
  return "";
61
- const M = (s.max.x - s.min.x) * m, U = (s.max.y - s.min.y) * m, y = Math.floor(u.positionInImage.x * M), A = Math.floor(u.positionInImage.y * U);
62
- return `translate(${y}px, ${A}px)`;
73
+ const k = (d.max.x - d.min.x) * m, F = (d.max.y - d.min.y) * m, P = Math.floor(v.positionInImage.x * k), S = Math.floor(v.positionInImage.y * F);
74
+ return `translate(${P}px, ${S}px)`;
75
+ }
76
+ function I(t) {
77
+ e(7, u = t);
63
78
  }
64
- function h(e) {
65
- t(6, c = e);
79
+ function b(t) {
80
+ e(9, g = o.work.observers[t].floorIndex);
66
81
  }
67
- const v = E(
68
- (e) => {
69
- t(7, d = e.longitude);
82
+ const C = O(
83
+ (t) => {
84
+ e(8, p = t.longitude);
70
85
  },
71
86
  1e3 / 60
72
87
  );
73
- return S(() => (r.on("panoWillArrive", h), r.on("cameraDirectionUpdate", v), function() {
74
- r.off("panoWillArrive", h), r.off("cameraDirectionUpdate", v);
75
- })), n.$$set = (e) => {
76
- "five" in e && t(3, r = e.five), "pxmm" in e && t(4, m = e.pxmm), "floorplanData" in e && t(5, f = e.floorplanData), "cameraImageUrl" in e && t(0, _ = e.cameraImageUrl);
77
- }, n.$$.update = () => {
78
- n.$$.dirty & /*floorplanData, panoIndex*/
79
- 96 && t(2, o = q(f, c)), n.$$.dirty & /*longitude*/
80
- 128 && t(1, i = z(d));
88
+ return H(() => (o.on("panoWillArrive", I), o.on("panoArrived", b), o.on("cameraDirectionUpdate", C), function() {
89
+ o.off("panoWillArrive", I), o.off("panoArrived", b), o.off("cameraDirectionUpdate", C);
90
+ })), r.$$set = (t) => {
91
+ "five" in t && e(4, o = t.five), "pxmm" in t && e(5, m = t.pxmm), "floorplanData" in t && e(6, f = t.floorplanData), "cameraImageUrl" in t && e(0, x = t.cameraImageUrl);
92
+ }, r.$$.update = () => {
93
+ r.$$.dirty & /*floorplanData, floorIndex*/
94
+ 576 && e(10, a = f.floorDatas[g]), r.$$.dirty & /*floorData*/
95
+ 1024 && e(3, i = a.rooms.length > 0), r.$$.dirty & /*floorplanData, panoIndex*/
96
+ 192 && e(2, l = M(f, u)), r.$$.dirty & /*longitude*/
97
+ 256 && e(1, c = J(p));
81
98
  }, [
82
- _,
99
+ x,
100
+ c,
101
+ l,
83
102
  i,
84
103
  o,
85
- r,
86
104
  m,
87
105
  f,
88
- c,
89
- d
106
+ u,
107
+ p,
108
+ g,
109
+ a
90
110
  ];
91
111
  }
92
- class B extends D {
93
- constructor(a) {
94
- super(), w(
112
+ class V extends T {
113
+ constructor(n) {
114
+ super(), W(
95
115
  this,
96
- a,
97
- G,
98
- R,
99
- k,
116
+ n,
117
+ K,
118
+ B,
119
+ E,
100
120
  {
101
- five: 3,
102
- pxmm: 4,
103
- floorplanData: 5,
121
+ five: 4,
122
+ pxmm: 5,
123
+ floorplanData: 6,
104
124
  cameraImageUrl: 0
105
125
  },
106
- F
126
+ j
107
127
  );
108
128
  }
109
129
  }
110
130
  export {
111
- B as default
131
+ V as default
112
132
  };