@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
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { SvelteComponent as h, init as v, safe_not_equal as x, append_styles as F, element as r, space as C, attr as f, src_url_equal as p, set_style as m, insert as d, append as g, noop as c, detach as _, text as z, set_data as b } from "../../vendor/svelte/internal/index.js";
|
|
2
|
+
function S(s) {
|
|
3
|
+
F(s, "svelte-1lm20n5", ".missing-floor.svelte-1lm20n5{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);display:flex;flex-direction:column;align-items:center}.text.svelte-1lm20n5{margin-top:0.75rem;color:#fff;opacity:0.3}");
|
|
4
|
+
}
|
|
5
|
+
function u(s) {
|
|
6
|
+
let e, t = (
|
|
7
|
+
/*missingFloorConfig*/
|
|
8
|
+
s[0].text + ""
|
|
9
|
+
), n;
|
|
10
|
+
return {
|
|
11
|
+
c() {
|
|
12
|
+
e = r("span"), n = z(t), f(e, "class", "text svelte-1lm20n5"), m(
|
|
13
|
+
e,
|
|
14
|
+
"font-size",
|
|
15
|
+
/*missingFloorConfig*/
|
|
16
|
+
s[0].textFontSize + "px"
|
|
17
|
+
);
|
|
18
|
+
},
|
|
19
|
+
m(l, i) {
|
|
20
|
+
d(l, e, i), g(e, n);
|
|
21
|
+
},
|
|
22
|
+
p(l, i) {
|
|
23
|
+
i & /*missingFloorConfig*/
|
|
24
|
+
1 && t !== (t = /*missingFloorConfig*/
|
|
25
|
+
l[0].text + "") && b(n, t), i & /*missingFloorConfig*/
|
|
26
|
+
1 && m(
|
|
27
|
+
e,
|
|
28
|
+
"font-size",
|
|
29
|
+
/*missingFloorConfig*/
|
|
30
|
+
l[0].textFontSize + "px"
|
|
31
|
+
);
|
|
32
|
+
},
|
|
33
|
+
d(l) {
|
|
34
|
+
l && _(e);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function k(s) {
|
|
39
|
+
let e, t, n, l, i = (
|
|
40
|
+
/*missingFloorConfig*/
|
|
41
|
+
s[0].text && u(s)
|
|
42
|
+
);
|
|
43
|
+
return {
|
|
44
|
+
c() {
|
|
45
|
+
e = r("div"), t = r("img"), l = C(), i && i.c(), f(t, "class", "image"), f(t, "alt", "缺省楼层展位图"), p(t.src, n = /*missingFloorConfig*/
|
|
46
|
+
s[0].imageURL) || f(t, "src", n), m(
|
|
47
|
+
t,
|
|
48
|
+
"width",
|
|
49
|
+
/*missingFloorConfig*/
|
|
50
|
+
s[0].imageWidth + "px"
|
|
51
|
+
), m(
|
|
52
|
+
t,
|
|
53
|
+
"height",
|
|
54
|
+
/*missingFloorConfig*/
|
|
55
|
+
s[0].imageHeight + "px"
|
|
56
|
+
), f(e, "class", "missing-floor svelte-1lm20n5");
|
|
57
|
+
},
|
|
58
|
+
m(o, a) {
|
|
59
|
+
d(o, e, a), g(e, t), g(e, l), i && i.m(e, null);
|
|
60
|
+
},
|
|
61
|
+
p(o, [a]) {
|
|
62
|
+
a & /*missingFloorConfig*/
|
|
63
|
+
1 && !p(t.src, n = /*missingFloorConfig*/
|
|
64
|
+
o[0].imageURL) && f(t, "src", n), a & /*missingFloorConfig*/
|
|
65
|
+
1 && m(
|
|
66
|
+
t,
|
|
67
|
+
"width",
|
|
68
|
+
/*missingFloorConfig*/
|
|
69
|
+
o[0].imageWidth + "px"
|
|
70
|
+
), a & /*missingFloorConfig*/
|
|
71
|
+
1 && m(
|
|
72
|
+
t,
|
|
73
|
+
"height",
|
|
74
|
+
/*missingFloorConfig*/
|
|
75
|
+
o[0].imageHeight + "px"
|
|
76
|
+
), /*missingFloorConfig*/
|
|
77
|
+
o[0].text ? i ? i.p(o, a) : (i = u(o), i.c(), i.m(e, null)) : i && (i.d(1), i = null);
|
|
78
|
+
},
|
|
79
|
+
i: c,
|
|
80
|
+
o: c,
|
|
81
|
+
d(o) {
|
|
82
|
+
o && _(e), i && i.d();
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function q(s, e, t) {
|
|
87
|
+
let { missingFloorConfig: n } = e;
|
|
88
|
+
return s.$$set = (l) => {
|
|
89
|
+
"missingFloorConfig" in l && t(0, n = l.missingFloorConfig);
|
|
90
|
+
}, [n];
|
|
91
|
+
}
|
|
92
|
+
class H extends h {
|
|
93
|
+
constructor(e) {
|
|
94
|
+
super(), v(this, e, q, k, x, { missingFloorConfig: 0 }, S);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
H as MissingFloor
|
|
99
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SvelteComponentTyped as default } from 'svelte/internal';
|
|
@@ -27,6 +27,7 @@ export declare class Controller extends BasePlugin.Controller<State, EventMap, P
|
|
|
27
27
|
private lastPanoramaLongitude;
|
|
28
28
|
/** 户型图大小 */
|
|
29
29
|
private size;
|
|
30
|
+
private defaultMissingFloorConfig;
|
|
30
31
|
/** 是否已经执行过事件监听 */
|
|
31
32
|
private hasAddedEventListener;
|
|
32
33
|
/** 上一次隐藏是否是用户调用了 hide 导致的 */
|
|
@@ -1,53 +1,49 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var A = Object.defineProperty, F = Object.defineProperties;
|
|
2
|
+
var P = Object.getOwnPropertyDescriptors;
|
|
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) => {
|
|
6
6
|
for (var t in r || (r = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
|
|
7
|
+
E.call(r, t) && g(d, t, r[t]);
|
|
8
|
+
if (v)
|
|
9
|
+
for (var t of v(r))
|
|
10
|
+
x.call(r, t) && g(d, t, r[t]);
|
|
11
11
|
return d;
|
|
12
|
-
},
|
|
13
|
-
var o = (d, r, t) => (
|
|
12
|
+
}, p = (d, r) => F(d, P(r));
|
|
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) => {
|
|
16
16
|
try {
|
|
17
17
|
s(t.next(a));
|
|
18
|
-
} catch (
|
|
19
|
-
i(
|
|
18
|
+
} catch (f) {
|
|
19
|
+
i(f);
|
|
20
20
|
}
|
|
21
21
|
}, h = (a) => {
|
|
22
22
|
try {
|
|
23
23
|
s(t.throw(a));
|
|
24
|
-
} catch (
|
|
25
|
-
i(
|
|
24
|
+
} catch (f) {
|
|
25
|
+
i(f);
|
|
26
26
|
}
|
|
27
27
|
}, s = (a) => a.done ? e(a.value) : Promise.resolve(a.value).then(n, h);
|
|
28
28
|
s((t = t.apply(d, r)).next());
|
|
29
29
|
});
|
|
30
30
|
import * as w from "three";
|
|
31
|
-
import { to as
|
|
32
|
-
import { equal as
|
|
33
|
-
import { Main as
|
|
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";
|
|
34
34
|
import { formatData as b } from "../utils/formatData.js";
|
|
35
|
-
import { CAMERA_IMAGE as
|
|
36
|
-
import { omit as
|
|
37
|
-
import { FLOOR_PLAN_ATTACHED_TO as
|
|
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
38
|
import { Controller as O } from "../../base/BasePluginWithData.js";
|
|
39
39
|
import { getPxmm as D, getAttachedY as T } from "../../shared-utils/getPxmm.js";
|
|
40
40
|
import { correctFiveState as k } from "../utils/correctFiveState.js";
|
|
41
|
-
import { changeModelCanvasOpacity as
|
|
42
|
-
import { FloorplanErrorType as
|
|
41
|
+
import { changeModelCanvasOpacity as S } from "../../shared-utils/changeModelCanvasOpacity.js";
|
|
42
|
+
import { FloorplanErrorType as m, SHOW_ANIME_DURATION as H } 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";
|
|
46
46
|
import "../../vendor/svelte/easing/index.js";
|
|
47
|
-
import "../Components/Camera.js";
|
|
48
|
-
import "../../shared-utils/math/rad2Deg.js";
|
|
49
|
-
import "../Components/Compass.js";
|
|
50
|
-
import "../Assets/compass.js";
|
|
51
47
|
import "../Components/CurrentFloor.js";
|
|
52
48
|
import "../../vendor/svelte/store/index.js";
|
|
53
49
|
import "../Components/BaseImage.js";
|
|
@@ -66,6 +62,11 @@ import "../Components/RoomMaterials/RoomMaterial_1.js";
|
|
|
66
62
|
import "../Components/RoomMaterials/RoomMaterial_2.js";
|
|
67
63
|
import "../Components/RoomHighlight/RoomHighlight.js";
|
|
68
64
|
import "../Components/RoomHighlight/Room.js";
|
|
65
|
+
import "../Components/MissingFloor.js";
|
|
66
|
+
import "../Components/Camera.js";
|
|
67
|
+
import "../../shared-utils/math/rad2Deg.js";
|
|
68
|
+
import "../Components/Compass.js";
|
|
69
|
+
import "../Assets/compass.js";
|
|
69
70
|
import "../Assets/floorplanExtraObject.js";
|
|
70
71
|
import "../../shared-utils/tap.js";
|
|
71
72
|
import "../../base/BasePlugin.js";
|
|
@@ -95,12 +96,13 @@ function R(d) {
|
|
|
95
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);
|
|
96
97
|
return e || i;
|
|
97
98
|
}
|
|
98
|
-
function
|
|
99
|
+
function W(d) {
|
|
99
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);
|
|
100
101
|
return e && i;
|
|
101
102
|
}
|
|
102
|
-
class
|
|
103
|
+
class Kt extends O {
|
|
103
104
|
constructor(t, e) {
|
|
105
|
+
var a, f;
|
|
104
106
|
super(t);
|
|
105
107
|
// =============== public properties =================
|
|
106
108
|
o(this, "name", "modelFloorplanPlugin");
|
|
@@ -125,6 +127,7 @@ class Yt extends O {
|
|
|
125
127
|
o(this, "lastPanoramaLongitude", 0);
|
|
126
128
|
/** 户型图大小 */
|
|
127
129
|
o(this, "size", { width: 0, height: 0 });
|
|
130
|
+
o(this, "defaultMissingFloorConfig");
|
|
128
131
|
/** 是否已经执行过事件监听 */
|
|
129
132
|
o(this, "hasAddedEventListener", !1);
|
|
130
133
|
/** 上一次隐藏是否是用户调用了 hide 导致的 */
|
|
@@ -162,8 +165,8 @@ class Yt extends O {
|
|
|
162
165
|
o(this, "updateSize", () => {
|
|
163
166
|
if (!this.data || !this.container || !this.wrapper)
|
|
164
167
|
return;
|
|
165
|
-
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),
|
|
166
|
-
this.size.width === a && this.size.height ===
|
|
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
170
|
});
|
|
168
171
|
o(this, "highlight", (t) => {
|
|
169
172
|
this.state.config.highlightEnable && (this.highlightData = t, this.render());
|
|
@@ -174,7 +177,7 @@ class Yt extends O {
|
|
|
174
177
|
o(this, "_disable", (t) => {
|
|
175
178
|
var i, n, h;
|
|
176
179
|
const { userAction: e } = t;
|
|
177
|
-
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, m.BreakOffByDisable), this.showPromise = void 0, (n = this.app) == null || n.$destroy(), this.app = void 0, (h = this.container) == null || h.remove(), this.removeEventListener();
|
|
178
181
|
});
|
|
179
182
|
o(this, "_enable", (t) => {
|
|
180
183
|
const { userAction: e } = t;
|
|
@@ -185,9 +188,9 @@ class Yt extends O {
|
|
|
185
188
|
if (!this.state.enabled)
|
|
186
189
|
return;
|
|
187
190
|
if (!((h = this.five.model) != null && h.loaded))
|
|
188
|
-
throw new Error(
|
|
191
|
+
throw new Error(m.ModelNotLoaded);
|
|
189
192
|
if (!this.data)
|
|
190
|
-
throw new Error(
|
|
193
|
+
throw new Error(m.DataNotLoaded);
|
|
191
194
|
if (this.showPromise)
|
|
192
195
|
return this.showPromise;
|
|
193
196
|
const e = {
|
|
@@ -196,23 +199,23 @@ class Yt extends O {
|
|
|
196
199
|
immediately: !1,
|
|
197
200
|
isAutoShow: !1,
|
|
198
201
|
userAction: !0
|
|
199
|
-
}, i =
|
|
202
|
+
}, i = l(l({}, e), t), n = () => u(this, null, function* () {
|
|
200
203
|
this.hooks.emit("show", { userAction: i.userAction, auto: i.isAutoShow });
|
|
201
204
|
let s = !1, a;
|
|
202
|
-
this.showRejection = (
|
|
203
|
-
s = !0, a =
|
|
205
|
+
this.showRejection = (c) => {
|
|
206
|
+
s = !0, a = c;
|
|
204
207
|
};
|
|
205
|
-
const [
|
|
206
|
-
if (
|
|
207
|
-
throw
|
|
208
|
+
const [f] = yield I(k(this.five, this.showState, i.userAction));
|
|
209
|
+
if (f)
|
|
210
|
+
throw f;
|
|
208
211
|
if (s)
|
|
209
|
-
throw a ? new Error(a) : new Error(
|
|
212
|
+
throw a ? new Error(a) : new Error(m.UnknownError);
|
|
210
213
|
this.updateSize(), this.updatePosition(), this.floorIndex = i.floorIndex, this.five.model.show(this.floorIndex);
|
|
211
214
|
});
|
|
212
215
|
return this.isHiddenByHideFunc = !1, this.showPromise = n().then(() => {
|
|
213
216
|
this.showPromise = void 0, this.showRejection = void 0;
|
|
214
217
|
const s = i.modelOpacity, a = i.immediately ? 0 : H;
|
|
215
|
-
|
|
218
|
+
S(this.five, s, a), this.render(a), this.hooks.emit("showAnimationEnded", {
|
|
216
219
|
auto: i.isAutoShow,
|
|
217
220
|
userAction: i.userAction
|
|
218
221
|
});
|
|
@@ -223,12 +226,12 @@ class Yt extends O {
|
|
|
223
226
|
}));
|
|
224
227
|
o(this, "_hide", (t) => {
|
|
225
228
|
var n;
|
|
226
|
-
(n = this.showRejection) == null || n.call(this,
|
|
227
|
-
const i =
|
|
229
|
+
(n = this.showRejection) == null || n.call(this, m.BreakOffByHide), this.showPromise = void 0;
|
|
230
|
+
const i = l(l({}, {
|
|
228
231
|
userAction: !0,
|
|
229
232
|
isAutoHide: !1
|
|
230
233
|
}), t);
|
|
231
|
-
|
|
234
|
+
S(this.five, 1, 0), this.hooks.emit("hide", { auto: i.isAutoHide, userAction: i.userAction }), this.render();
|
|
232
235
|
});
|
|
233
236
|
o(this, "handleClick", () => {
|
|
234
237
|
if (!this.state.visible)
|
|
@@ -255,7 +258,7 @@ class Yt extends O {
|
|
|
255
258
|
if (!e || this.state.visible || this.state.config.autoShowEnable === !1 || this.isHiddenByHideFunc)
|
|
256
259
|
return;
|
|
257
260
|
const i = this.five.getCurrentState();
|
|
258
|
-
i.mode === this.showState.mode &&
|
|
261
|
+
i.mode === this.showState.mode && W(i) && (this.updateState({ visible: !0 }, !0), this._show({ isAutoShow: !0 }));
|
|
259
262
|
});
|
|
260
263
|
/** panoIndex 改变时,更新 floorIndex */
|
|
261
264
|
o(this, "onFivePanoArrived", (t) => {
|
|
@@ -272,7 +275,7 @@ class Yt extends O {
|
|
|
272
275
|
/** 户型图展示中,转动三维模型,结束时应该自动修复模型状态 */
|
|
273
276
|
o(this, "onFiveWantsPanGesture", (t, e) => {
|
|
274
277
|
if (this.five.getCurrentState().mode === this.showState.mode && this.state.config.autoShowEnable !== !1 && e && this.state.visible)
|
|
275
|
-
return this.five.updateCamera(
|
|
278
|
+
return this.five.updateCamera(C(this.showState, ["offset"]), 0), !1;
|
|
276
279
|
});
|
|
277
280
|
/** 阻止点击分间走点 */
|
|
278
281
|
o(this, "onFiveWantsTapGesture", () => this.handleClick());
|
|
@@ -295,6 +298,12 @@ class Yt extends O {
|
|
|
295
298
|
mode: "Mapview",
|
|
296
299
|
longitude: 0,
|
|
297
300
|
latitude: Math.PI / 2
|
|
301
|
+
}, this.defaultMissingFloorConfig = {
|
|
302
|
+
imageURL: this.staticPrefix + "/release/web/saas/missing-floorplan.e274c596.png",
|
|
303
|
+
imageWidth: 200,
|
|
304
|
+
imageHeight: 120,
|
|
305
|
+
text: (f = (a = e.i18n) == null ? void 0 : a.call(e, "暂无平面图")) != null ? f : "暂无平面图",
|
|
306
|
+
textFontSize: 14
|
|
298
307
|
};
|
|
299
308
|
const i = {
|
|
300
309
|
northDesc: "北",
|
|
@@ -308,28 +317,26 @@ class Yt extends O {
|
|
|
308
317
|
roomLabelsEnable: !0,
|
|
309
318
|
roomAreaEnable: !0,
|
|
310
319
|
roomNameEnable: !0,
|
|
311
|
-
cameraImageUrl:
|
|
312
|
-
attachedTo:
|
|
320
|
+
cameraImageUrl: L,
|
|
321
|
+
attachedTo: _.BOUNDING_CENTER,
|
|
313
322
|
getLabelElement: void 0,
|
|
314
323
|
adaptiveRoomLabelVisibleEnable: !0,
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
config: h
|
|
322
|
-
}, this.initContainer(), t.model.loaded ? this.onFiveModelLoaded() : t.once("modelLoaded", this.onFiveModelLoaded), t.once("dispose", this.dispose), this.addEventListener();
|
|
324
|
+
missingFloorConfig: l(l({}, this.defaultMissingFloorConfig), e.missingFloorConfig),
|
|
325
|
+
i18n: (c) => c,
|
|
326
|
+
getRoomAreaText: (c) => (c / 1e6).toFixed(1) + "㎡",
|
|
327
|
+
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 });
|
|
329
|
+
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();
|
|
323
330
|
}
|
|
324
331
|
load(t, e, i = !0) {
|
|
325
332
|
return u(this, null, function* () {
|
|
326
|
-
function n(
|
|
327
|
-
return Object.prototype.hasOwnProperty.apply(
|
|
333
|
+
function n(c) {
|
|
334
|
+
return Object.prototype.hasOwnProperty.apply(c, ["version"]);
|
|
328
335
|
}
|
|
329
336
|
const h = t;
|
|
330
337
|
h && !h.version && console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");
|
|
331
|
-
const s = JSON.parse(JSON.stringify(t)), a = n(s) ? s.data : s,
|
|
332
|
-
this.data = yield b(a), this.hooks.emit("dataLoaded", this.data), this.hooks.emit("dataChange", this.data,
|
|
338
|
+
const s = JSON.parse(JSON.stringify(t)), a = n(s) ? s.data : s, f = this.data;
|
|
339
|
+
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();
|
|
333
340
|
});
|
|
334
341
|
}
|
|
335
342
|
/** 把插件的渲染DOM插入到对应的容器中去 */
|
|
@@ -377,8 +384,9 @@ class Yt extends O {
|
|
|
377
384
|
});
|
|
378
385
|
}
|
|
379
386
|
updateState(t, e) {
|
|
380
|
-
|
|
381
|
-
this.state =
|
|
387
|
+
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 });
|
|
382
390
|
}
|
|
383
391
|
/** 如果用户是通过 selector 设置父容器,需要在 modelLoaded 之后把 container 自动放到父容器里
|
|
384
392
|
*
|
|
@@ -407,7 +415,7 @@ class Yt extends O {
|
|
|
407
415
|
render(t) {
|
|
408
416
|
if (!this.state.enabled || !this.container || !this.data || this.size.width === 0 || this.showPromise)
|
|
409
417
|
return;
|
|
410
|
-
const e =
|
|
418
|
+
const e = p(l({}, this.state.config), {
|
|
411
419
|
visible: this.state.visible,
|
|
412
420
|
duration: t != null ? t : 0,
|
|
413
421
|
panoIndex: this.panoIndex,
|
|
@@ -418,9 +426,9 @@ class Yt extends O {
|
|
|
418
426
|
});
|
|
419
427
|
if (this.app)
|
|
420
428
|
return this.app.$set(e);
|
|
421
|
-
this.app = new
|
|
429
|
+
this.app = new y({ target: this.container, intro: !0, props: e });
|
|
422
430
|
}
|
|
423
431
|
}
|
|
424
432
|
export {
|
|
425
|
-
|
|
433
|
+
Kt as Controller
|
|
426
434
|
};
|
|
@@ -7,11 +7,6 @@ import "../Components/Main.js";
|
|
|
7
7
|
import "../../vendor/svelte/internal/index.js";
|
|
8
8
|
import "../../vendor/svelte/transition/index.js";
|
|
9
9
|
import "../../vendor/svelte/easing/index.js";
|
|
10
|
-
import "../Components/Camera.js";
|
|
11
|
-
import "../Assets/camera.js";
|
|
12
|
-
import "../../shared-utils/math/rad2Deg.js";
|
|
13
|
-
import "../Components/Compass.js";
|
|
14
|
-
import "../Assets/compass.js";
|
|
15
10
|
import "../Components/CurrentFloor.js";
|
|
16
11
|
import "../../vendor/svelte/store/index.js";
|
|
17
12
|
import "../Components/BaseImage.js";
|
|
@@ -30,6 +25,12 @@ import "../Components/RoomMaterials/RoomMaterial_1.js";
|
|
|
30
25
|
import "../Components/RoomMaterials/RoomMaterial_2.js";
|
|
31
26
|
import "../Components/RoomHighlight/RoomHighlight.js";
|
|
32
27
|
import "../Components/RoomHighlight/Room.js";
|
|
28
|
+
import "../Components/MissingFloor.js";
|
|
29
|
+
import "../Components/Camera.js";
|
|
30
|
+
import "../Assets/camera.js";
|
|
31
|
+
import "../../shared-utils/math/rad2Deg.js";
|
|
32
|
+
import "../Components/Compass.js";
|
|
33
|
+
import "../Assets/compass.js";
|
|
33
34
|
import "../utils/formatData.js";
|
|
34
35
|
import "../Assets/floorplanExtraObject.js";
|
|
35
36
|
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 go = (o, r) => new t(o, r);
|
|
67
68
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
go as MapviewFloorplanPlugin,
|
|
70
|
+
go as default
|
|
70
71
|
};
|
|
@@ -27,6 +27,7 @@ export declare class Controller extends BasePlugin.Controller<State, EventMap, P
|
|
|
27
27
|
private lastPanoramaLongitude;
|
|
28
28
|
/** 户型图大小 */
|
|
29
29
|
private size;
|
|
30
|
+
private defaultMissingFloorConfig;
|
|
30
31
|
/** 是否已经执行过事件监听 */
|
|
31
32
|
private hasAddedEventListener;
|
|
32
33
|
/** 上一次隐藏是否是用户调用了 hide 导致的 */
|