@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.
- package/dist/floorplan/Components/MissingFloor.svelte.d.ts +1 -0
- package/dist/floorplan/MapviewFloorplanPlugin/Controller.d.ts +1 -0
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +1 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +2 -0
- package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +1 -0
- package/dist/floorplan/typings/index.d.ts +15 -0
- package/dist/index.cjs.js +62 -62
- package/dist/index.js +6654 -6294
- package/dist/index.umd.js +48 -48
- package/dist/shared-utils/filter.d.ts +1 -1
- package/libs/base/BasePlugin.js +1 -1
- package/libs/floorplan/Components/CurrentFloor.js +423 -214
- package/libs/floorplan/Components/Main.js +205 -271
- package/libs/floorplan/Components/MissingFloor.js +99 -0
- package/libs/floorplan/Components/MissingFloor.svelte.d.ts +1 -0
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.d.ts +1 -0
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +74 -66
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +9 -8
- package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +108 -101
- package/libs/floorplan/ModelFloorplanPlugin/index.js +9 -8
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +88 -68
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +199 -127
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +110 -100
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +15 -14
- package/libs/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +2 -0
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +1 -0
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +118 -110
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +9 -8
- package/libs/floorplan/typings/index.d.ts +15 -0
- package/libs/index.js +122 -121
- package/libs/shared-utils/filter.d.ts +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -1,52 +1,48 @@
|
|
|
1
|
-
var A = Object.defineProperty,
|
|
2
|
-
var
|
|
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
|
|
6
|
-
for (var t in
|
|
7
|
-
E.call(
|
|
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(
|
|
10
|
-
P.call(
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var o = (
|
|
14
|
-
var
|
|
15
|
-
var n = (
|
|
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
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
i(
|
|
17
|
+
r(t.next(a));
|
|
18
|
+
} catch (f) {
|
|
19
|
+
i(f);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, h = (a) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
i(
|
|
23
|
+
r(t.throw(a));
|
|
24
|
+
} catch (f) {
|
|
25
|
+
i(f);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
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
|
|
31
|
-
import { equal as
|
|
32
|
-
import { Main as
|
|
33
|
-
import { formatData as
|
|
34
|
-
import { CAMERA_IMAGE as
|
|
35
|
-
import { omit as
|
|
36
|
-
import { getPxmm as
|
|
37
|
-
import { FLOOR_PLAN_ATTACHED_TO as
|
|
38
|
-
import { Controller as
|
|
39
|
-
import { checkShowState as
|
|
40
|
-
import { changeModelCanvasOpacity as
|
|
41
|
-
import { FIVE_CAMERA_DEFAULT_FOV as
|
|
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
|
|
95
|
-
const { latitude:
|
|
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
|
|
99
|
-
const { latitude:
|
|
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
|
|
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) =>
|
|
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) =>
|
|
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 || !
|
|
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,
|
|
167
|
-
this.size.width ===
|
|
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,
|
|
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,
|
|
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) =>
|
|
185
|
-
var
|
|
186
|
+
o(this, "_show", (t) => u(this, null, function* () {
|
|
187
|
+
var h;
|
|
186
188
|
if (!this.state.enabled)
|
|
187
189
|
return;
|
|
188
|
-
if (!((
|
|
189
|
-
throw new Error(
|
|
190
|
+
if (!((h = this.five.model) != null && h.loaded))
|
|
191
|
+
throw new Error(g.ModelNotLoaded);
|
|
190
192
|
if (!this.data)
|
|
191
|
-
throw new Error(
|
|
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 =
|
|
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
|
|
203
|
-
this.showRejection = (
|
|
204
|
-
|
|
204
|
+
let r = !1, a;
|
|
205
|
+
this.showRejection = (c) => {
|
|
206
|
+
r = !0, a = c;
|
|
205
207
|
};
|
|
206
|
-
const [
|
|
207
|
-
if (
|
|
208
|
-
throw
|
|
209
|
-
if (
|
|
210
|
-
throw
|
|
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
|
|
216
|
-
|
|
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((
|
|
221
|
-
if (this.showPromise = void 0, this.showRejection = void 0, this.updateState({ visible: !1 }, i.userAction), !i.isAutoShow &&
|
|
222
|
-
throw
|
|
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,
|
|
228
|
-
const i =
|
|
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
|
-
|
|
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 ||
|
|
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
|
-
|
|
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:
|
|
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:
|
|
319
|
-
attachedTo:
|
|
326
|
+
cameraImageUrl: y,
|
|
327
|
+
attachedTo: O.BOUNDING_CENTER,
|
|
320
328
|
getLabelElement: void 0,
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
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
|
|
332
|
-
function n(
|
|
333
|
-
return Object.prototype.hasOwnProperty.apply(
|
|
337
|
+
return u(this, null, function* () {
|
|
338
|
+
function n(c) {
|
|
339
|
+
return Object.prototype.hasOwnProperty.apply(c, ["version"]);
|
|
334
340
|
}
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
const
|
|
338
|
-
this.data = yield
|
|
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
|
|
365
|
-
t.visible ? this._show(
|
|
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
|
|
374
|
-
return yield
|
|
379
|
+
return u(this, null, function* () {
|
|
380
|
+
return yield b(t.data);
|
|
375
381
|
});
|
|
376
382
|
}
|
|
377
383
|
updateState(t, e) {
|
|
378
|
-
|
|
379
|
-
this.state =
|
|
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 =
|
|
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
|
|
426
|
+
this.app = new x({ target: this.container, intro: !0, props: e });
|
|
420
427
|
}
|
|
421
428
|
}
|
|
422
429
|
export {
|
|
423
|
-
|
|
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
|
|
67
|
+
const wo = (o, r) => new t(o, r);
|
|
67
68
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
wo as ModelFloorplanPlugin,
|
|
70
|
+
wo as default
|
|
70
71
|
};
|
|
@@ -1,112 +1,132 @@
|
|
|
1
|
-
import { SvelteComponent as
|
|
2
|
-
import { CAMERA_IMAGE as
|
|
3
|
-
import { throttle as
|
|
4
|
-
function
|
|
5
|
-
|
|
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
|
|
8
|
-
let
|
|
7
|
+
function B(r) {
|
|
8
|
+
let n, e, a;
|
|
9
9
|
return {
|
|
10
10
|
c() {
|
|
11
|
-
|
|
12
|
-
(
|
|
13
|
-
|
|
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
|
-
|
|
17
|
-
),
|
|
18
|
-
|
|
16
|
+
r[1]
|
|
17
|
+
), _(e, "class", "plugin-radar__camera-position svelte-1nqrlxd"), s(
|
|
18
|
+
e,
|
|
19
19
|
"transform",
|
|
20
20
|
/*positionTransform*/
|
|
21
|
-
|
|
22
|
-
),
|
|
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,
|
|
25
|
-
|
|
29
|
+
m(i, l) {
|
|
30
|
+
z(i, n, l), D(n, e), D(e, a);
|
|
26
31
|
},
|
|
27
|
-
p(i, [
|
|
28
|
-
|
|
29
|
-
1 &&
|
|
30
|
-
(i[0] ||
|
|
31
|
-
1 ||
|
|
32
|
-
3) &&
|
|
33
|
-
|
|
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
|
-
),
|
|
38
|
-
4 &&
|
|
39
|
-
|
|
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:
|
|
46
|
-
o:
|
|
56
|
+
i: q,
|
|
57
|
+
o: q,
|
|
47
58
|
d(i) {
|
|
48
|
-
i &&
|
|
59
|
+
i && G(n);
|
|
49
60
|
}
|
|
50
61
|
};
|
|
51
62
|
}
|
|
52
|
-
function
|
|
53
|
-
return `rotate(${Math.floor(
|
|
63
|
+
function J(r) {
|
|
64
|
+
return `rotate(${Math.floor(r / Math.PI * 180) * -1 + 45}deg)`;
|
|
54
65
|
}
|
|
55
|
-
function
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
|
62
|
-
return `translate(${
|
|
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
|
|
65
|
-
|
|
79
|
+
function b(t) {
|
|
80
|
+
e(9, g = o.work.observers[t].floorIndex);
|
|
66
81
|
}
|
|
67
|
-
const
|
|
68
|
-
(
|
|
69
|
-
|
|
82
|
+
const C = O(
|
|
83
|
+
(t) => {
|
|
84
|
+
e(8, p = t.longitude);
|
|
70
85
|
},
|
|
71
86
|
1e3 / 60
|
|
72
87
|
);
|
|
73
|
-
return
|
|
74
|
-
|
|
75
|
-
})),
|
|
76
|
-
"five" in
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
|
|
89
|
-
|
|
106
|
+
u,
|
|
107
|
+
p,
|
|
108
|
+
g,
|
|
109
|
+
a
|
|
90
110
|
];
|
|
91
111
|
}
|
|
92
|
-
class
|
|
93
|
-
constructor(
|
|
94
|
-
super(),
|
|
112
|
+
class V extends T {
|
|
113
|
+
constructor(n) {
|
|
114
|
+
super(), W(
|
|
95
115
|
this,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
116
|
+
n,
|
|
117
|
+
K,
|
|
118
|
+
B,
|
|
119
|
+
E,
|
|
100
120
|
{
|
|
101
|
-
five:
|
|
102
|
-
pxmm:
|
|
103
|
-
floorplanData:
|
|
121
|
+
five: 4,
|
|
122
|
+
pxmm: 5,
|
|
123
|
+
floorplanData: 6,
|
|
104
124
|
cameraImageUrl: 0
|
|
105
125
|
},
|
|
106
|
-
|
|
126
|
+
j
|
|
107
127
|
);
|
|
108
128
|
}
|
|
109
129
|
}
|
|
110
130
|
export {
|
|
111
|
-
|
|
131
|
+
V as default
|
|
112
132
|
};
|