@realsee/dnalogel 2.0.0-alpha.18 → 2.0.0-alpha.20

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 (177) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/CSS3DRenderPlugin/index.d.ts +2 -2
  3. package/dist/CameraMovementPlugin/index.js +15 -40
  4. package/dist/CameraMovementPlugin/typing.d.ts +1 -1
  5. package/dist/ModelChassisCompassPlugin/index.js +3 -28
  6. package/dist/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
  7. package/dist/ModelEntryDoorGuidePlugin/index.js +8 -33
  8. package/dist/ModelItemLabelPlugin/events.type.d.ts +2 -2
  9. package/dist/ModelItemLabelPlugin/typings.d.ts +2 -2
  10. package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
  11. package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  12. package/dist/ModelTVVideoPlugin/index.d.ts +1 -1
  13. package/dist/ModelTVVideoPlugin/index.js +3 -28
  14. package/dist/PanoCompassPlugin/index.js +53 -86
  15. package/dist/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  16. package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
  17. package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  18. package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  19. package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
  20. package/dist/PanoMeasurePlugin/Controller/index.d.ts +3 -3
  21. package/dist/PanoMeasurePlugin/Model/index.d.ts +2 -2
  22. package/dist/PanoMeasurePlugin/Model/line.d.ts +5 -5
  23. package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -2
  24. package/dist/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  25. package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
  26. package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  27. package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  28. package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
  29. package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  30. package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  31. package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
  32. package/dist/PanoMeasurePlugin/index.d.ts +1 -1
  33. package/dist/PanoMeasurePlugin/index.js +2 -0
  34. package/dist/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
  35. package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  36. package/dist/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  37. package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  38. package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  39. package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  40. package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  41. package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  42. package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  43. package/dist/PanoMeasurePlugin/utils/line.d.ts +1 -1
  44. package/dist/PanoRulerPlugin/index.d.ts +1 -1
  45. package/dist/PanoRulerPlugin/index.js +3 -28
  46. package/dist/PanoSpatialTagPlugin/typings.d.ts +1 -1
  47. package/dist/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  48. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
  49. package/dist/floorplan/ModelFloorplanPlugin/index.js +1253 -1284
  50. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +61 -183
  51. package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
  52. package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  53. package/dist/floorplan/TopviewFloorplanPlugin/index.js +1243 -1235
  54. package/dist/floorplan/utils/formatPosition.d.ts +1 -1
  55. package/dist/index.es.js +1431 -1435
  56. package/dist/index.js +1430 -1434
  57. package/dist/index.umd.js +1430 -1434
  58. package/dist/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  59. package/dist/shared-utils/three/getNormal.d.ts +1 -1
  60. package/dist/shared-utils/three/getTextureLoader.d.ts +1 -1
  61. package/dist/shared-utils/three/loadFbxObj.d.ts +1 -1
  62. package/dist/shared-utils/vectorTocoordinates.d.ts +1 -1
  63. package/docs/assets/search.js +1 -1
  64. package/docs/classes/ModelRoomLabelController.html +6 -6
  65. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  66. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  67. package/docs/interfaces/LineJson.html +1 -1
  68. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  69. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  70. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  71. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  72. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  73. package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
  74. package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
  75. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  76. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  77. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  78. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  79. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  80. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  81. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  82. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  83. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  84. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  85. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  86. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  87. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  88. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  89. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  90. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  91. package/docs/interfaces/PointJson.html +1 -1
  92. package/docs/interfaces/RoomLabel.html +7 -7
  93. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +19 -1
  94. package/docs/modules.html +12 -12
  95. package/libs/CSS3DRenderPlugin/index.d.ts +2 -2
  96. package/libs/CameraMovementPlugin/index.js +15 -24
  97. package/libs/CameraMovementPlugin/typing.d.ts +1 -1
  98. package/libs/ModelChassisCompassPlugin/index.js +3 -12
  99. package/libs/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
  100. package/libs/ModelEntryDoorGuidePlugin/index.js +8 -17
  101. package/libs/ModelItemLabelPlugin/events.type.d.ts +2 -2
  102. package/libs/ModelItemLabelPlugin/typings.d.ts +2 -2
  103. package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
  104. package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  105. package/libs/ModelTVVideoPlugin/index.d.ts +1 -1
  106. package/libs/ModelTVVideoPlugin/index.js +3 -12
  107. package/libs/ModelTVVideoPlugin/typings.js +1 -0
  108. package/libs/PanoCompassPlugin/index.js +49 -64
  109. package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  110. package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
  111. package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  112. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  113. package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
  114. package/libs/PanoMeasurePlugin/Controller/index.d.ts +3 -3
  115. package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
  116. package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
  117. package/libs/PanoMeasurePlugin/Model/line.js +1 -1
  118. package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
  119. package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  120. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
  121. package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  122. package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  123. package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
  124. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  125. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  126. package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
  127. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +2 -0
  128. package/libs/PanoMeasurePlugin/index.d.ts +1 -1
  129. package/libs/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
  130. package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  131. package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  132. package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  133. package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  134. package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  135. package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  136. package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  137. package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  138. package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
  139. package/libs/PanoMeasurePlugin/utils/mouseGroup.js +1 -0
  140. package/libs/PanoRulerPlugin/index.d.ts +1 -1
  141. package/libs/PanoRulerPlugin/index.js +3 -12
  142. package/libs/PanoSpatialTagPlugin/typings.d.ts +1 -1
  143. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  144. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.js +0 -0
  145. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Camera.js +2 -2
  146. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Compass.js +0 -0
  147. package/libs/floorplan/{ModelFloorplanPlugin/Components/CurrentFloor → Components}/CurrentFloor.js +73 -80
  148. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Main.js +186 -105
  149. package/libs/floorplan/Components/RoomHighlight/Room.js +5 -7
  150. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +24 -116
  151. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabel.js +0 -0
  152. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabels.js +2 -2
  153. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +26 -22
  154. package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
  155. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RuleLabels/RuleLabels.js +82 -32
  156. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
  157. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +34 -43
  158. package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +22 -33
  159. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +3 -12
  160. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
  161. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +80 -54
  162. package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  163. package/libs/floorplan/TopviewFloorplanPlugin/style.js +0 -1
  164. package/libs/floorplan/utils/formatData.js +28 -43
  165. package/libs/floorplan/utils/formatPosition.d.ts +1 -1
  166. package/libs/floorplan/utils/formatPosition.js +2 -2
  167. package/libs/shared-utils/five/changeMode.js +12 -23
  168. package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  169. package/libs/shared-utils/three/getNormal.d.ts +1 -1
  170. package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
  171. package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
  172. package/libs/shared-utils/three/loadFbxObj.js +9 -20
  173. package/libs/shared-utils/three/loadTexture.js +6 -17
  174. package/libs/shared-utils/to.js +10 -21
  175. package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
  176. package/package.json +2 -2
  177. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +0 -301
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var five = require('@realsee/five');
5
6
  var internal = require('svelte/internal');
6
- var THREE = require('three');
7
7
  var easing = require('svelte/easing');
8
8
  var transition = require('svelte/transition');
9
- var five = require('@realsee/five');
9
+ var THREE = require('three');
10
10
 
11
11
  function _interopNamespace(e) {
12
12
  if (e && e.__esModule) return e;
@@ -28,29 +28,66 @@ function _interopNamespace(e) {
28
28
 
29
29
  var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
30
30
 
31
- /*! *****************************************************************************
32
- Copyright (c) Microsoft Corporation.
33
-
34
- Permission to use, copy, modify, and/or distribute this software for any
35
- purpose with or without fee is hereby granted.
36
-
37
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
38
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
39
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
40
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
41
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
42
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
43
- PERFORMANCE OF THIS SOFTWARE.
44
- ***************************************************************************** */
45
-
46
- function __awaiter(thisArg, _arguments, P, generator) {
47
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
48
- return new (P || (P = Promise))(function (resolve, reject) {
49
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
50
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
51
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
52
- step((generator = generator.apply(thisArg, _arguments || [])).next());
53
- });
31
+ /**
32
+ * 把第一个参数传入第二个参数(函数)中并执行
33
+ * 一般用于执行函数后返回变量。
34
+ * @param {any} something
35
+ * @param {function} callback
36
+ * @return {any}
37
+ */
38
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
39
+ function tap(something, callback) {
40
+ callback(something);
41
+ return something;
42
+ }
43
+
44
+ /**
45
+ * 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
46
+ * @param object
47
+ * @param props 排除的属性
48
+ * @return
49
+ */
50
+ function omit(object, props) {
51
+ return tap({}, (result) => {
52
+ for (const name in object) {
53
+ if (props.indexOf(name) !== -1)
54
+ continue;
55
+ result[name] = object[name];
56
+ }
57
+ });
58
+ }
59
+
60
+ var FloorplanErrorType;
61
+ (function (FloorplanErrorType) {
62
+ FloorplanErrorType["UnknownError"] = "UnknowError";
63
+ FloorplanErrorType["DataNotLoaded"] = "DataNotLoaded";
64
+ FloorplanErrorType["BreakOffByHide"] = "BreakOffByHide";
65
+ FloorplanErrorType["ModelNotLoaded"] = "ModelNotLoaded";
66
+ FloorplanErrorType["ChangeModeError"] = "ChangeModeError";
67
+ FloorplanErrorType["UpdateCameraError"] = "UpdateCameraError";
68
+ FloorplanErrorType["DifferentShowParams"] = "DifferentShowParams";
69
+ })(FloorplanErrorType || (FloorplanErrorType = {}));
70
+ /** 户型图展示 & 模型消失的默认时间 */
71
+ const SHOW_ANIME_DURATION = 500;
72
+ /** Five camera 默认 fov */
73
+ const FIVE_CAMERA_DEFAULT_FOV = 80;
74
+
75
+ /**
76
+ * 传入一个 Promise
77
+ * 无异常,返回 [null, data]
78
+ * 有异常,则返回 [Error, undefined]
79
+ * 用于替代 try&catch 处理 await 异常的方案
80
+ */
81
+ async function to(promise) {
82
+ try {
83
+ const data = await promise;
84
+ return [null, data];
85
+ }
86
+ catch (error) {
87
+ if (error instanceof Error)
88
+ return [error, null];
89
+ return [new Error(''), null];
90
+ }
54
91
  }
55
92
 
56
93
  const CAMERA_IMAGE = 'data:image/png;base64,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';
@@ -59,9 +96,9 @@ function rad2Deg$1(rad) {
59
96
  return (rad * 180) / Math.PI;
60
97
  }
61
98
 
62
- /* src/floorplan/ModelFloorplanPlugin/Components/Camera.svelte generated by Svelte v3.47.0 */
99
+ /* src/floorplan/Components/Camera.svelte generated by Svelte v3.47.0 */
63
100
 
64
- function add_css$c(target) {
101
+ function add_css$d(target) {
65
102
  internal.append_styles(target, "svelte-17cl35n", ".floorplan__camera-position.svelte-17cl35n{position:absolute;width:0;height:0}.floorplan__camera-rotate.svelte-17cl35n{position:absolute;background-repeat:no-repeat;background-size:100%}");
66
103
  }
67
104
 
@@ -157,16 +194,16 @@ class Camera extends internal.SvelteComponent {
157
194
  lastPanoramaLongitude: 7,
158
195
  cameraImageUrl: 0
159
196
  },
160
- add_css$c
197
+ add_css$d
161
198
  );
162
199
  }
163
200
  }
164
201
 
165
202
  const COMPASS_IMAGE = 'data:image/png;base64,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';
166
203
 
167
- /* src/floorplan/ModelFloorplanPlugin/Components/Compass.svelte generated by Svelte v3.47.0 */
204
+ /* src/floorplan/Components/Compass.svelte generated by Svelte v3.47.0 */
168
205
 
169
- function add_css$b(target) {
206
+ function add_css$c(target) {
170
207
  internal.append_styles(target, "svelte-1q44ru9", ".floorplan-plugin__compass.svelte-1q44ru9{position:absolute;left:50%;top:-2.39583rem;width:12.03125rem;height:2.13542rem;will-change:opacity;transform-origin:center 9.58333rem}.floorplan-plugin__compass-image.svelte-1q44ru9{width:100%;height:100%;position:absolute;left:0;top:0;opacity:0.1;background-repeat:no-repeat;background-size:100% 100%}.floorplan-plugin__compass-text.svelte-1q44ru9{position:absolute;left:50%;top:0.78125rem;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:0.52083rem;color:#fff}");
171
208
  }
172
209
 
@@ -259,345 +296,271 @@ function instance$f($$self, $$props, $$invalidate) {
259
296
  class Compass extends internal.SvelteComponent {
260
297
  constructor(options) {
261
298
  super();
262
- internal.init(this, options, instance$f, create_fragment$f, internal.safe_not_equal, { floorplanData: 3, northDesc: 0 }, add_css$b);
299
+ internal.init(this, options, instance$f, create_fragment$f, internal.safe_not_equal, { floorplanData: 3, northDesc: 0 }, add_css$c);
263
300
  }
264
301
  }
265
302
 
266
- /* src/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte generated by Svelte v3.47.0 */
303
+ /* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
267
304
 
268
- function add_css$a(target) {
269
- internal.append_styles(target, "svelte-i2nwuk", ".floorplan-plugin__room-label-item.svelte-i2nwuk{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:0.78125rem;color:#fff;transform:translate(-50%, -50%);white-space:nowrap}.floorplan-plugin__room-size.svelte-i2nwuk{opacity:0.45}");
305
+ function add_css$b(target) {
306
+ internal.append_styles(target, "svelte-1gfoniz", "img.svelte-1gfoniz{width:100%;height:100%}");
270
307
  }
271
308
 
272
- // (22:30)
273
- function create_if_block_1$4(ctx) {
274
- let html_tag;
275
- let raw_value = /*userConfigElement*/ ctx[2].outerHTML + "";
276
- let html_anchor;
309
+ function create_fragment$e(ctx) {
310
+ let img;
311
+ let img_src_value;
277
312
 
278
313
  return {
279
314
  c() {
280
- html_tag = new internal.HtmlTag();
281
- html_anchor = internal.empty();
282
- html_tag.a = html_anchor;
315
+ img = internal.element("img");
316
+ if (!internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) internal.attr(img, "src", img_src_value);
317
+ internal.attr(img, "alt", "floorplan iamge");
318
+ internal.attr(img, "class", "svelte-1gfoniz");
283
319
  },
284
320
  m(target, anchor) {
285
- html_tag.m(raw_value, target, anchor);
286
- internal.insert(target, html_anchor, anchor);
321
+ internal.insert(target, img, anchor);
287
322
  },
288
- p(ctx, dirty) {
289
- if (dirty & /*userConfigElement*/ 4 && raw_value !== (raw_value = /*userConfigElement*/ ctx[2].outerHTML + "")) html_tag.p(raw_value);
323
+ p(ctx, [dirty]) {
324
+ if (dirty & /*url*/ 1 && !internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
325
+ internal.attr(img, "src", img_src_value);
326
+ }
290
327
  },
328
+ i: internal.noop,
329
+ o: internal.noop,
291
330
  d(detaching) {
292
- if (detaching) internal.detach(html_anchor);
293
- if (detaching) html_tag.d();
331
+ if (detaching) internal.detach(img);
294
332
  }
295
333
  };
296
334
  }
297
335
 
298
- // (16:2) {#if getLabelElement === undefined}
299
- function create_if_block$5(ctx) {
300
- let span0;
301
- let t0_value = /*room*/ ctx[0].name + "";
302
- let t0;
303
- let t1;
304
- let span1;
336
+ function instance$e($$self, $$props, $$invalidate) {
337
+ let { url } = $$props;
305
338
 
306
- return {
307
- c() {
308
- span0 = internal.element("span");
309
- t0 = internal.text(t0_value);
310
- t1 = internal.space();
311
- span1 = internal.element("span");
312
- span1.textContent = `${/*roomSizeDes*/ ctx[3]}`;
313
- internal.attr(span0, "class", "floorplan-plugin__room-name");
314
- internal.attr(span1, "class", "floorplan-plugin__room-size svelte-i2nwuk");
315
- },
316
- m(target, anchor) {
317
- internal.insert(target, span0, anchor);
318
- internal.append(span0, t0);
319
- internal.insert(target, t1, anchor);
320
- internal.insert(target, span1, anchor);
321
- },
322
- p(ctx, dirty) {
323
- if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) internal.set_data(t0, t0_value);
324
- },
325
- d(detaching) {
326
- if (detaching) internal.detach(span0);
327
- if (detaching) internal.detach(t1);
328
- if (detaching) internal.detach(span1);
329
- }
339
+ $$self.$$set = $$props => {
340
+ if ('url' in $$props) $$invalidate(0, url = $$props.url);
330
341
  };
331
- }
332
342
 
333
- function create_fragment$e(ctx) {
334
- let div;
343
+ return [url];
344
+ }
335
345
 
336
- function select_block_type(ctx, dirty) {
337
- if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block$5;
338
- if (/*userConfigElement*/ ctx[2]) return create_if_block_1$4;
346
+ class Normalmage extends internal.SvelteComponent {
347
+ constructor(options) {
348
+ super();
349
+ internal.init(this, options, instance$e, create_fragment$e, internal.safe_not_equal, { url: 0 }, add_css$b);
339
350
  }
351
+ }
340
352
 
341
- let current_block_type = select_block_type(ctx);
342
- let if_block = current_block_type && current_block_type(ctx);
353
+ /* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
354
+
355
+ function add_css$a(target) {
356
+ internal.append_styles(target, "svelte-ub47ya", ".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}");
357
+ }
358
+
359
+ function create_fragment$d(ctx) {
360
+ let div;
361
+ let html_tag;
362
+ let t;
363
+ let html_tag_1;
343
364
 
344
365
  return {
345
366
  c() {
346
367
  div = internal.element("div");
347
- if (if_block) if_block.c();
348
- internal.attr(div, "class", "floorplan-plugin__room-label-item svelte-i2nwuk");
349
- internal.set_style(div, "left", /*left*/ ctx[4], false);
350
- internal.set_style(div, "top", /*top*/ ctx[5], false);
351
- internal.set_style(div, "font-size", /*fontSize*/ ctx[6], false);
368
+ html_tag = new internal.HtmlTag();
369
+ t = internal.space();
370
+ html_tag_1 = new internal.HtmlTag();
371
+ html_tag.a = t;
372
+ html_tag_1.a = null;
373
+ internal.attr(div, "class", "floorplan-plugin__base-image svelte-ub47ya");
352
374
  },
353
375
  m(target, anchor) {
354
376
  internal.insert(target, div, anchor);
355
- if (if_block) if_block.m(div, null);
377
+ html_tag.m(/*svgStyle*/ ctx[1], div);
378
+ internal.append(div, t);
379
+ html_tag_1.m(/*content*/ ctx[0], div);
356
380
  },
357
381
  p(ctx, [dirty]) {
358
- if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
359
- if_block.p(ctx, dirty);
360
- } else {
361
- if (if_block) if_block.d(1);
362
- if_block = current_block_type && current_block_type(ctx);
363
-
364
- if (if_block) {
365
- if_block.c();
366
- if_block.m(div, null);
367
- }
368
- }
382
+ if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
369
383
  },
370
384
  i: internal.noop,
371
385
  o: internal.noop,
372
386
  d(detaching) {
373
387
  if (detaching) internal.detach(div);
374
-
375
- if (if_block) {
376
- if_block.d();
377
- }
378
388
  }
379
389
  };
380
390
  }
381
391
 
382
- function instance$e($$self, $$props, $$invalidate) {
383
- let userConfigElement;
384
- let { room } = $$props;
385
- let { getLabelElement } = $$props;
386
-
387
- // TODO: 统一这里的判断条件,目前写了多处
388
- const bodyWidth = document.body.clientWidth;
392
+ function instance$d($$self, $$props, $$invalidate) {
393
+ let { content } = $$props;
389
394
 
390
- const bodyHeight = document.body.clientHeight;
391
- const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
392
- const roomLabel = room.roomLabel;
393
- const left = roomLabel.positionInImage.x * 100 + '%';
394
- const top = roomLabel.positionInImage.y * 100 + '%';
395
- const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
395
+ const svgStyle = `
396
+ <style>
397
+ svg [type='lineGroup'] path {
398
+ fill: #ffffff;
399
+ stroke: #ffffff;
400
+ }
401
+ svg [type='lineItemGroup'] g g g g {
402
+ stroke: #ffffff;
403
+ }</style>
404
+ `;
396
405
 
397
406
  $$self.$$set = $$props => {
398
- if ('room' in $$props) $$invalidate(0, room = $$props.room);
399
- if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
400
- };
401
-
402
- $$self.$$.update = () => {
403
- if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
404
- $$invalidate(2, userConfigElement = getLabelElement === null || getLabelElement === void 0
405
- ? void 0
406
- : getLabelElement(room));
407
- }
407
+ if ('content' in $$props) $$invalidate(0, content = $$props.content);
408
408
  };
409
409
 
410
- return [room, getLabelElement, userConfigElement, roomSizeDes, left, top, fontSize];
410
+ return [content, svgStyle];
411
411
  }
412
412
 
413
- class RoomLabel extends internal.SvelteComponent {
413
+ class SvgImage extends internal.SvelteComponent {
414
414
  constructor(options) {
415
415
  super();
416
- internal.init(this, options, instance$e, create_fragment$e, internal.safe_not_equal, { room: 0, getLabelElement: 1 }, add_css$a);
416
+ internal.init(this, options, instance$d, create_fragment$d, internal.safe_not_equal, { content: 0 }, add_css$a);
417
417
  }
418
418
  }
419
419
 
420
- /* src/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte generated by Svelte v3.47.0 */
420
+ /* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
421
421
 
422
422
  function add_css$9(target) {
423
- internal.append_styles(target, "svelte-vkeyjz", ".floorplan-plugin__room-labels.svelte-vkeyjz{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20}");
424
- }
425
-
426
- function get_each_context$4(ctx, list, i) {
427
- const child_ctx = ctx.slice();
428
- child_ctx[4] = list[i];
429
- return child_ctx;
423
+ internal.append_styles(target, "svelte-ozpg4a", ".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
430
424
  }
431
425
 
432
- // (8:0) {#if rooms}
433
- function create_if_block$4(ctx) {
434
- let div;
435
- let each_blocks = [];
436
- let each_1_lookup = new Map();
426
+ // (13:22)
427
+ function create_if_block_1$4(ctx) {
428
+ let normalimage;
437
429
  let current;
438
- let each_value = /*rooms*/ ctx[1];
439
- const get_key = ctx => /*room*/ ctx[4].id;
440
-
441
- for (let i = 0; i < each_value.length; i += 1) {
442
- let child_ctx = get_each_context$4(ctx, each_value, i);
443
- let key = get_key(child_ctx);
444
- each_1_lookup.set(key, each_blocks[i] = create_each_block$4(key, child_ctx));
445
- }
430
+ normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
446
431
 
447
432
  return {
448
433
  c() {
449
- div = internal.element("div");
450
-
451
- for (let i = 0; i < each_blocks.length; i += 1) {
452
- each_blocks[i].c();
453
- }
454
-
455
- internal.attr(div, "class", "floorplan-plugin__room-labels svelte-vkeyjz");
434
+ internal.create_component(normalimage.$$.fragment);
456
435
  },
457
436
  m(target, anchor) {
458
- internal.insert(target, div, anchor);
459
-
460
- for (let i = 0; i < each_blocks.length; i += 1) {
461
- each_blocks[i].m(div, null);
462
- }
463
-
437
+ internal.mount_component(normalimage, target, anchor);
464
438
  current = true;
465
439
  },
466
440
  p(ctx, dirty) {
467
- if (dirty & /*rooms, getLabelElement*/ 3) {
468
- each_value = /*rooms*/ ctx[1];
469
- internal.group_outros();
470
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$4, null, get_each_context$4);
471
- internal.check_outros();
472
- }
441
+ const normalimage_changes = {};
442
+ if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
443
+ normalimage.$set(normalimage_changes);
473
444
  },
474
445
  i(local) {
475
446
  if (current) return;
476
-
477
- for (let i = 0; i < each_value.length; i += 1) {
478
- internal.transition_in(each_blocks[i]);
479
- }
480
-
447
+ internal.transition_in(normalimage.$$.fragment, local);
481
448
  current = true;
482
449
  },
483
450
  o(local) {
484
- for (let i = 0; i < each_blocks.length; i += 1) {
485
- internal.transition_out(each_blocks[i]);
486
- }
487
-
451
+ internal.transition_out(normalimage.$$.fragment, local);
488
452
  current = false;
489
453
  },
490
454
  d(detaching) {
491
- if (detaching) internal.detach(div);
492
-
493
- for (let i = 0; i < each_blocks.length; i += 1) {
494
- each_blocks[i].d();
495
- }
455
+ internal.destroy_component(normalimage, detaching);
496
456
  }
497
457
  };
498
458
  }
499
459
 
500
- // (10:4) {#each rooms as room (room.id)}
501
- function create_each_block$4(key_1, ctx) {
502
- let first;
503
- let roomlabel;
460
+ // (11:2) {#if svgContent}
461
+ function create_if_block$5(ctx) {
462
+ let svgimage;
504
463
  let current;
505
464
 
506
- const roomlabel_spread_levels = [
507
- {
508
- room: /*room*/ ctx[4],
509
- getLabelElement: /*getLabelElement*/ ctx[0]
510
- }
511
- ];
512
-
513
- let roomlabel_props = {};
514
-
515
- for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
516
- roomlabel_props = internal.assign(roomlabel_props, roomlabel_spread_levels[i]);
517
- }
518
-
519
- roomlabel = new RoomLabel({ props: roomlabel_props });
465
+ svgimage = new SvgImage({
466
+ props: { content: /*svgContent*/ ctx[0] }
467
+ });
520
468
 
521
469
  return {
522
- key: key_1,
523
- first: null,
524
470
  c() {
525
- first = internal.empty();
526
- internal.create_component(roomlabel.$$.fragment);
527
- this.first = first;
471
+ internal.create_component(svgimage.$$.fragment);
528
472
  },
529
473
  m(target, anchor) {
530
- internal.insert(target, first, anchor);
531
- internal.mount_component(roomlabel, target, anchor);
474
+ internal.mount_component(svgimage, target, anchor);
532
475
  current = true;
533
476
  },
534
- p(new_ctx, dirty) {
535
- ctx = new_ctx;
536
-
537
- const roomlabel_changes = (dirty & /*rooms, getLabelElement*/ 3)
538
- ? internal.get_spread_update(roomlabel_spread_levels, [
539
- {
540
- room: /*room*/ ctx[4],
541
- getLabelElement: /*getLabelElement*/ ctx[0]
542
- }
543
- ])
544
- : {};
545
-
546
- roomlabel.$set(roomlabel_changes);
477
+ p(ctx, dirty) {
478
+ const svgimage_changes = {};
479
+ if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
480
+ svgimage.$set(svgimage_changes);
547
481
  },
548
482
  i(local) {
549
483
  if (current) return;
550
- internal.transition_in(roomlabel.$$.fragment, local);
484
+ internal.transition_in(svgimage.$$.fragment, local);
551
485
  current = true;
552
486
  },
553
487
  o(local) {
554
- internal.transition_out(roomlabel.$$.fragment, local);
488
+ internal.transition_out(svgimage.$$.fragment, local);
555
489
  current = false;
556
490
  },
557
491
  d(detaching) {
558
- if (detaching) internal.detach(first);
559
- internal.destroy_component(roomlabel, detaching);
492
+ internal.destroy_component(svgimage, detaching);
560
493
  }
561
494
  };
562
495
  }
563
496
 
564
- function create_fragment$d(ctx) {
565
- let if_block_anchor;
497
+ function create_fragment$c(ctx) {
498
+ let div;
499
+ let current_block_type_index;
500
+ let if_block;
566
501
  let current;
567
- let if_block = /*rooms*/ ctx[1] && create_if_block$4(ctx);
502
+ const if_block_creators = [create_if_block$5, create_if_block_1$4];
503
+ const if_blocks = [];
504
+
505
+ function select_block_type(ctx, dirty) {
506
+ if (/*svgContent*/ ctx[0]) return 0;
507
+ if (/*imageData*/ ctx[1]) return 1;
508
+ return -1;
509
+ }
510
+
511
+ if (~(current_block_type_index = select_block_type(ctx))) {
512
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
513
+ }
568
514
 
569
515
  return {
570
516
  c() {
517
+ div = internal.element("div");
571
518
  if (if_block) if_block.c();
572
- if_block_anchor = internal.empty();
519
+ internal.attr(div, "class", "floorplan-plugin__base-image svelte-ozpg4a");
573
520
  },
574
521
  m(target, anchor) {
575
- if (if_block) if_block.m(target, anchor);
576
- internal.insert(target, if_block_anchor, anchor);
522
+ internal.insert(target, div, anchor);
523
+
524
+ if (~current_block_type_index) {
525
+ if_blocks[current_block_type_index].m(div, null);
526
+ }
527
+
577
528
  current = true;
578
529
  },
579
530
  p(ctx, [dirty]) {
580
- if (/*rooms*/ ctx[1]) {
531
+ let previous_block_index = current_block_type_index;
532
+ current_block_type_index = select_block_type(ctx);
533
+
534
+ if (current_block_type_index === previous_block_index) {
535
+ if (~current_block_type_index) {
536
+ if_blocks[current_block_type_index].p(ctx, dirty);
537
+ }
538
+ } else {
581
539
  if (if_block) {
582
- if_block.p(ctx, dirty);
540
+ internal.group_outros();
583
541
 
584
- if (dirty & /*rooms*/ 2) {
585
- internal.transition_in(if_block, 1);
586
- }
587
- } else {
588
- if_block = create_if_block$4(ctx);
589
- if_block.c();
590
- internal.transition_in(if_block, 1);
591
- if_block.m(if_block_anchor.parentNode, if_block_anchor);
542
+ internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
543
+ if_blocks[previous_block_index] = null;
544
+ });
545
+
546
+ internal.check_outros();
592
547
  }
593
- } else if (if_block) {
594
- internal.group_outros();
595
548
 
596
- internal.transition_out(if_block, 1, 1, () => {
597
- if_block = null;
598
- });
549
+ if (~current_block_type_index) {
550
+ if_block = if_blocks[current_block_type_index];
599
551
 
600
- internal.check_outros();
552
+ if (!if_block) {
553
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
554
+ if_block.c();
555
+ } else {
556
+ if_block.p(ctx, dirty);
557
+ }
558
+
559
+ internal.transition_in(if_block, 1);
560
+ if_block.m(div, null);
561
+ } else {
562
+ if_block = null;
563
+ }
601
564
  }
602
565
  },
603
566
  i(local) {
@@ -610,855 +573,949 @@ function create_fragment$d(ctx) {
610
573
  current = false;
611
574
  },
612
575
  d(detaching) {
613
- if (if_block) if_block.d(detaching);
614
- if (detaching) internal.detach(if_block_anchor);
576
+ if (detaching) internal.detach(div);
577
+
578
+ if (~current_block_type_index) {
579
+ if_blocks[current_block_type_index].d();
580
+ }
615
581
  }
616
582
  };
617
583
  }
618
584
 
619
- function instance$d($$self, $$props, $$invalidate) {
620
- let rooms;
585
+ function instance$c($$self, $$props, $$invalidate) {
586
+ let imageData;
587
+ let svgContent;
588
+ var _a, _b;
621
589
  let { floorIndex } = $$props;
622
590
  let { floorplanData } = $$props;
623
- let { getLabelElement } = $$props;
624
591
 
625
592
  $$self.$$set = $$props => {
626
593
  if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
627
594
  if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
628
- if ('getLabelElement' in $$props) $$invalidate(0, getLabelElement = $$props.getLabelElement);
629
595
  };
630
596
 
631
597
  $$self.$$.update = () => {
632
598
  if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
633
- $$invalidate(1, rooms = floorplanData.floorDatas[floorIndex].rooms);
599
+ $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
600
+ }
601
+
602
+ if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
603
+ $$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
604
+ ? void 0
605
+ : _a[floorIndex]) === null || _b === void 0
606
+ ? void 0
607
+ : _b.svgContent);
634
608
  }
635
609
  };
636
610
 
637
- return [getLabelElement, rooms, floorIndex, floorplanData];
611
+ return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
638
612
  }
639
613
 
640
- class RoomLabels extends internal.SvelteComponent {
614
+ class BaseImage extends internal.SvelteComponent {
641
615
  constructor(options) {
642
616
  super();
643
-
644
- internal.init(
645
- this,
646
- options,
647
- instance$d,
648
- create_fragment$d,
649
- internal.safe_not_equal,
650
- {
651
- floorIndex: 2,
652
- floorplanData: 3,
653
- getLabelElement: 0
654
- },
655
- add_css$9
656
- );
617
+ internal.init(this, options, instance$c, create_fragment$c, internal.safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$9);
657
618
  }
658
619
  }
659
620
 
660
- /**
661
- * 判断对象是否为`null`或`undefined`。
662
- * @param
663
- * @return
664
- */
665
- /**
666
- * 判断对象不为`null`或`undefined`。
667
- */
668
- function notNil(value) {
669
- return value !== null && value !== undefined;
670
- }
671
-
672
- /* src/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte generated by Svelte v3.47.0 */
621
+ /* src/floorplan/Components/RoomLabels/RoomLabel.svelte generated by Svelte v3.47.0 */
673
622
 
674
623
  function add_css$8(target) {
675
- internal.append_styles(target, "svelte-1d5a0k4", ".floorplan-plugin__rule-labels.svelte-1d5a0k4{position:absolute;height:0.26042rem;display:flex;align-items:center}.floorplan-plugin__rule-labels-top.svelte-1d5a0k4{left:0;top:0}.floorplan-plugin__rule-labels-bottom.svelte-1d5a0k4{left:0;bottom:0}.floorplan-plugin__rule-labels-left.svelte-1d5a0k4{bottom:0;left:0}.floorplan-plugin__rule-labels-right.svelte-1d5a0k4{bottom:0;right:0}.floorplan-plugin__rule-line.svelte-1d5a0k4{background:#fff;opacity:0.05;width:100%;height:1px}.floorplan-plugin__rule-scale.svelte-1d5a0k4{position:absolute;background:#fff;opacity:0.05;transform-origin:center;width:1px;height:0.26042rem}.floorplan-plugin__text-wrapper.svelte-1d5a0k4{width:0;height:0;position:absolute}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper--is-left-or-top.svelte-1d5a0k4{top:0.52083rem}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper-is-right-or-bottom.svelte-1d5a0k4{bottom:0.52083rem}.floorplan-plugin__rule-text.svelte-1d5a0k4{position:absolute;width:-webkit-max-content;width:-moz-max-content;width:max-content;display:block;transform:translate(-50%, -50%) rotate(180deg);font-size:0.52083rem;color:#fff;opacity:0.2}.floorplan-plugin__rule-text.is-row.svelte-1d5a0k4{transform:translate(-50%, -50%)}");
676
- }
677
-
678
- function get_each_context$3(ctx, list, i) {
679
- const child_ctx = ctx.slice();
680
- child_ctx[24] = list[i];
681
- child_ctx[26] = i;
682
- return child_ctx;
683
- }
684
-
685
- function get_each_context_1(ctx, list, i) {
686
- const child_ctx = ctx.slice();
687
- child_ctx[27] = list[i];
688
- child_ctx[29] = i;
689
- return child_ctx;
624
+ internal.append_styles(target, "svelte-i2nwuk", ".floorplan-plugin__room-label-item.svelte-i2nwuk{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:0.78125rem;color:#fff;transform:translate(-50%, -50%);white-space:nowrap}.floorplan-plugin__room-size.svelte-i2nwuk{opacity:0.45}");
690
625
  }
691
626
 
692
- // (66:2) {#each positionPxArray as position, positionIndex (positionIndex)}
693
- function create_each_block_1(key_1, ctx) {
694
- let div;
695
- let style_left = `${/*position*/ ctx[27]}px`;
627
+ // (22:30)
628
+ function create_if_block_1$3(ctx) {
629
+ let html_tag;
630
+ let raw_value = /*userConfigElement*/ ctx[2].outerHTML + "";
631
+ let html_anchor;
696
632
 
697
633
  return {
698
- key: key_1,
699
- first: null,
700
634
  c() {
701
- div = internal.element("div");
702
- internal.attr(div, "class", "floorplan-plugin__rule-scale svelte-1d5a0k4");
703
- internal.set_style(div, "left", style_left, false);
704
- this.first = div;
635
+ html_tag = new internal.HtmlTag();
636
+ html_anchor = internal.empty();
637
+ html_tag.a = html_anchor;
705
638
  },
706
639
  m(target, anchor) {
707
- internal.insert(target, div, anchor);
640
+ html_tag.m(raw_value, target, anchor);
641
+ internal.insert(target, html_anchor, anchor);
708
642
  },
709
- p(new_ctx, dirty) {
710
- ctx = new_ctx;
643
+ p(ctx, dirty) {
644
+ if (dirty & /*userConfigElement*/ 4 && raw_value !== (raw_value = /*userConfigElement*/ ctx[2].outerHTML + "")) html_tag.p(raw_value);
711
645
  },
712
646
  d(detaching) {
713
- if (detaching) internal.detach(div);
647
+ if (detaching) internal.detach(html_anchor);
648
+ if (detaching) html_tag.d();
714
649
  }
715
650
  };
716
651
  }
717
652
 
718
- // (69:2) {#each textArray as textItem, textItemIndex (textItemIndex)}
719
- function create_each_block$3(key_1, ctx) {
720
- let div;
721
- let span;
722
- let t0_value = /*textItem*/ ctx[24].distance + "";
653
+ // (16:2) {#if getLabelElement === undefined}
654
+ function create_if_block$4(ctx) {
655
+ let span0;
656
+ let t0_value = /*room*/ ctx[0].name + "";
723
657
  let t0;
724
658
  let t1;
725
- let style_left = `${/*textItem*/ ctx[24].positionPx}px`;
659
+ let span1;
726
660
 
727
661
  return {
728
- key: key_1,
729
- first: null,
730
662
  c() {
731
- div = internal.element("div");
732
- span = internal.element("span");
663
+ span0 = internal.element("span");
733
664
  t0 = internal.text(t0_value);
734
665
  t1 = internal.space();
735
- internal.attr(span, "class", "floorplan-plugin__rule-text svelte-1d5a0k4");
736
- internal.toggle_class(span, "is-row", /*isRow*/ ctx[5]);
737
- internal.attr(div, "class", "floorplan-plugin__text-wrapper svelte-1d5a0k4");
738
- internal.toggle_class(div, "floorplan-plugin__text-wrapper--is-left-or-top", /*isLeft*/ ctx[3] || /*isTop*/ ctx[1]);
739
- internal.toggle_class(div, "floorplan-plugin__text-wrapper-is-right-or-bottom", /*isRight*/ ctx[4] || /*isBottom*/ ctx[2]);
740
- internal.set_style(div, "left", style_left, false);
741
- this.first = div;
666
+ span1 = internal.element("span");
667
+ span1.textContent = `${/*roomSizeDes*/ ctx[3]}`;
668
+ internal.attr(span0, "class", "floorplan-plugin__room-name");
669
+ internal.attr(span1, "class", "floorplan-plugin__room-size svelte-i2nwuk");
742
670
  },
743
671
  m(target, anchor) {
744
- internal.insert(target, div, anchor);
745
- internal.append(div, span);
746
- internal.append(span, t0);
747
- internal.append(div, t1);
672
+ internal.insert(target, span0, anchor);
673
+ internal.append(span0, t0);
674
+ internal.insert(target, t1, anchor);
675
+ internal.insert(target, span1, anchor);
748
676
  },
749
- p(new_ctx, dirty) {
750
- ctx = new_ctx;
677
+ p(ctx, dirty) {
678
+ if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) internal.set_data(t0, t0_value);
751
679
  },
752
680
  d(detaching) {
753
- if (detaching) internal.detach(div);
681
+ if (detaching) internal.detach(span0);
682
+ if (detaching) internal.detach(t1);
683
+ if (detaching) internal.detach(span1);
754
684
  }
755
685
  };
756
686
  }
757
687
 
758
- function create_fragment$c(ctx) {
759
- let div1;
760
- let div0;
761
- let t0;
762
- let each_blocks_1 = [];
763
- let each0_lookup = new Map();
764
- let t1;
765
- let each_blocks = [];
766
- let each1_lookup = new Map();
767
- let div1_class_value;
768
- let each_value_1 = /*positionPxArray*/ ctx[6];
769
- const get_key = ctx => /*positionIndex*/ ctx[29];
688
+ function create_fragment$b(ctx) {
689
+ let div;
770
690
 
771
- for (let i = 0; i < each_value_1.length; i += 1) {
772
- let child_ctx = get_each_context_1(ctx, each_value_1, i);
773
- let key = get_key(child_ctx);
774
- each0_lookup.set(key, each_blocks_1[i] = create_each_block_1(key, child_ctx));
691
+ function select_block_type(ctx, dirty) {
692
+ if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block$4;
693
+ if (/*userConfigElement*/ ctx[2]) return create_if_block_1$3;
775
694
  }
776
695
 
777
- let each_value = /*textArray*/ ctx[10];
778
- const get_key_1 = ctx => /*textItemIndex*/ ctx[26];
779
-
780
- for (let i = 0; i < each_value.length; i += 1) {
781
- let child_ctx = get_each_context$3(ctx, each_value, i);
782
- let key = get_key_1(child_ctx);
783
- each1_lookup.set(key, each_blocks[i] = create_each_block$3(key, child_ctx));
784
- }
696
+ let current_block_type = select_block_type(ctx);
697
+ let if_block = current_block_type && current_block_type(ctx);
785
698
 
786
699
  return {
787
700
  c() {
788
- div1 = internal.element("div");
789
- div0 = internal.element("div");
790
- t0 = internal.space();
791
-
792
- for (let i = 0; i < each_blocks_1.length; i += 1) {
793
- each_blocks_1[i].c();
794
- }
795
-
796
- t1 = internal.space();
797
-
798
- for (let i = 0; i < each_blocks.length; i += 1) {
799
- each_blocks[i].c();
800
- }
801
-
802
- internal.attr(div0, "class", "floorplan-plugin__rule-line svelte-1d5a0k4");
803
- internal.attr(div1, "class", div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1d5a0k4");
804
- internal.set_style(div1, "width", /*width*/ ctx[9], false);
805
- internal.set_style(div1, "transform", /*transform*/ ctx[7], false);
806
- internal.set_style(div1, "transform-origin", /*transformOrigin*/ ctx[8], false);
701
+ div = internal.element("div");
702
+ if (if_block) if_block.c();
703
+ internal.attr(div, "class", "floorplan-plugin__room-label-item svelte-i2nwuk");
704
+ internal.set_style(div, "left", /*left*/ ctx[4], false);
705
+ internal.set_style(div, "top", /*top*/ ctx[5], false);
706
+ internal.set_style(div, "font-size", /*fontSize*/ ctx[6], false);
807
707
  },
808
708
  m(target, anchor) {
809
- internal.insert(target, div1, anchor);
810
- internal.append(div1, div0);
811
- internal.append(div1, t0);
812
-
813
- for (let i = 0; i < each_blocks_1.length; i += 1) {
814
- each_blocks_1[i].m(div1, null);
815
- }
816
-
817
- internal.append(div1, t1);
818
-
819
- for (let i = 0; i < each_blocks.length; i += 1) {
820
- each_blocks[i].m(div1, null);
821
- }
709
+ internal.insert(target, div, anchor);
710
+ if (if_block) if_block.m(div, null);
822
711
  },
823
712
  p(ctx, [dirty]) {
824
- if (dirty & /*positionPxArray*/ 64) {
825
- each_value_1 = /*positionPxArray*/ ctx[6];
826
- each_blocks_1 = internal.update_keyed_each(each_blocks_1, dirty, get_key, 1, ctx, each_value_1, each0_lookup, div1, internal.destroy_block, create_each_block_1, t1, get_each_context_1);
827
- }
828
-
829
- if (dirty & /*isLeft, isTop, isRight, isBottom, textArray, isRow*/ 1086) {
830
- each_value = /*textArray*/ ctx[10];
831
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key_1, 1, ctx, each_value, each1_lookup, div1, internal.destroy_block, create_each_block$3, null, get_each_context$3);
832
- }
713
+ if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
714
+ if_block.p(ctx, dirty);
715
+ } else {
716
+ if (if_block) if_block.d(1);
717
+ if_block = current_block_type && current_block_type(ctx);
833
718
 
834
- if (dirty & /*type*/ 1 && div1_class_value !== (div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1d5a0k4")) {
835
- internal.attr(div1, "class", div1_class_value);
719
+ if (if_block) {
720
+ if_block.c();
721
+ if_block.m(div, null);
722
+ }
836
723
  }
837
724
  },
838
725
  i: internal.noop,
839
726
  o: internal.noop,
840
727
  d(detaching) {
841
- if (detaching) internal.detach(div1);
842
-
843
- for (let i = 0; i < each_blocks_1.length; i += 1) {
844
- each_blocks_1[i].d();
845
- }
728
+ if (detaching) internal.detach(div);
846
729
 
847
- for (let i = 0; i < each_blocks.length; i += 1) {
848
- each_blocks[i].d();
730
+ if (if_block) {
731
+ if_block.d();
849
732
  }
850
733
  }
851
734
  };
852
735
  }
853
736
 
854
- const padding = 1000;
855
-
856
- function instance$c($$self, $$props, $$invalidate) {
857
- let { pxmm } = $$props;
858
- let { type } = $$props;
859
- let { data } = $$props;
860
- let { bounding } = $$props;
861
- const isTop = type === 'top';
862
- const isBottom = type === 'bottom';
863
- const isLeft = type === 'left';
864
- const isRight = type === 'right';
865
- const isRow = isTop || isBottom;
737
+ function instance$b($$self, $$props, $$invalidate) {
738
+ let userConfigElement;
739
+ let { room } = $$props;
740
+ let { getLabelElement } = $$props;
866
741
 
867
- // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
868
- const positionArray = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
869
- if (index === 0) return true;
870
- return x !== arr[index - 1];
871
- });
742
+ // TODO: 统一这里的判断条件,目前写了多处
743
+ const bodyWidth = document.body.clientWidth;
872
744
 
873
- const minPosition = positionArray[0];
874
- const maxPosition = positionArray.slice(-1)[0];
875
- const length = maxPosition - minPosition;
876
- const minBounding = isRow ? bounding.min.x : bounding.min.y;
877
- const lengthPx = length * pxmm;
878
- const positionPxArray = positionArray.map(x => (x - minPosition) / length * lengthPx);
879
-
880
- // 在主要方向上的偏移量,上下的标尺是距离图片左侧的长度,左右的标尺是距离图片底部的距离
881
- const translateMain = (minPosition - minBounding) * pxmm;
882
-
883
- // 在次要方向的偏移量,希望达到的效果是标尺轴距离户型图边界 27px,但是图片自身是带有 1000mm 的边界,所以在计算时需要减去这个边界
884
- const translateSecond = 27 - padding * pxmm;
885
-
886
- const translate = (() => {
887
- if (isTop) return `translate(${translateMain}px, ${-translateSecond}px)`;
888
- if (isBottom) return `translate(${translateMain}px, ${translateSecond}px)`;
889
- if (isLeft) return `translate(${-translateSecond}px, ${-translateMain}px)`;
890
- if (isRight) return `translate(${translateSecond}px, ${-translateMain - lengthPx}px)`;
891
- })();
892
-
893
- const rotate = isRow ? 'rotate(0)' : 'rotate(-90deg)';
894
- const transform = `${translate} ${rotate}`;
895
- const transformOrigin = `${isRight ? 'right' : 'left'} ${isTop ? 'top' : 'bottom'}`;
896
- const width = lengthPx + 'px';
897
-
898
- // 把点位的户型图坐标转成距离起始位置的像素值
899
- const textArray = positionArray.map((position, index, array) => {
900
- if (index === 0) return null;
901
- const distance = position - array[index - 1];
902
- const positionPx = (array[index - 1] + distance / 2 - minPosition) / length * lengthPx;
903
- return { distance, positionPx };
904
- }).filter(notNil).filter(item => item.distance / length > 0.12);
745
+ const bodyHeight = document.body.clientHeight;
746
+ const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
747
+ const roomLabel = room.roomLabel;
748
+ const left = roomLabel.positionInImage.x * 100 + '%';
749
+ const top = roomLabel.positionInImage.y * 100 + '%';
750
+ const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
905
751
 
906
752
  $$self.$$set = $$props => {
907
- if ('pxmm' in $$props) $$invalidate(11, pxmm = $$props.pxmm);
908
- if ('type' in $$props) $$invalidate(0, type = $$props.type);
909
- if ('data' in $$props) $$invalidate(12, data = $$props.data);
910
- if ('bounding' in $$props) $$invalidate(13, bounding = $$props.bounding);
753
+ if ('room' in $$props) $$invalidate(0, room = $$props.room);
754
+ if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
911
755
  };
912
756
 
913
- return [
914
- type,
915
- isTop,
916
- isBottom,
917
- isLeft,
918
- isRight,
919
- isRow,
920
- positionPxArray,
921
- transform,
922
- transformOrigin,
923
- width,
924
- textArray,
925
- pxmm,
926
- data,
927
- bounding
928
- ];
757
+ $$self.$$.update = () => {
758
+ if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
759
+ $$invalidate(2, userConfigElement = getLabelElement === null || getLabelElement === void 0
760
+ ? void 0
761
+ : getLabelElement(room));
762
+ }
763
+ };
764
+
765
+ return [room, getLabelElement, userConfigElement, roomSizeDes, left, top, fontSize];
929
766
  }
930
767
 
931
- class RuleItem extends internal.SvelteComponent {
768
+ class RoomLabel extends internal.SvelteComponent {
932
769
  constructor(options) {
933
770
  super();
934
-
935
- internal.init(
936
- this,
937
- options,
938
- instance$c,
939
- create_fragment$c,
940
- internal.safe_not_equal,
941
- {
942
- pxmm: 11,
943
- type: 0,
944
- data: 12,
945
- bounding: 13
946
- },
947
- add_css$8
948
- );
771
+ internal.init(this, options, instance$b, create_fragment$b, internal.safe_not_equal, { room: 0, getLabelElement: 1 }, add_css$8);
949
772
  }
950
773
  }
951
774
 
952
- /* src/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte generated by Svelte v3.47.0 */
775
+ /* src/floorplan/Components/RoomLabels/RoomLabels.svelte generated by Svelte v3.47.0 */
953
776
 
954
- function get_each_context$2(ctx, list, i) {
777
+ function add_css$7(target) {
778
+ internal.append_styles(target, "svelte-13xux0b", ".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}");
779
+ }
780
+
781
+ function get_each_context$5(ctx, list, i) {
955
782
  const child_ctx = ctx.slice();
956
- child_ctx[7] = list[i][0];
957
- child_ctx[8] = list[i][1];
783
+ child_ctx[4] = list[i];
958
784
  return child_ctx;
959
785
  }
960
786
 
961
- // (12:2) {#each ruleLabelArray as [type, data] (type)}
962
- function create_each_block$2(key_1, ctx) {
787
+ // (8:0) {#if rooms}
788
+ function create_if_block$3(ctx) {
789
+ let div;
790
+ let each_blocks = [];
791
+ let each_1_lookup = new Map();
792
+ let current;
793
+ let each_value = /*rooms*/ ctx[1];
794
+ const get_key = ctx => /*room*/ ctx[4].id;
795
+
796
+ for (let i = 0; i < each_value.length; i += 1) {
797
+ let child_ctx = get_each_context$5(ctx, each_value, i);
798
+ let key = get_key(child_ctx);
799
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$5(key, child_ctx));
800
+ }
801
+
802
+ return {
803
+ c() {
804
+ div = internal.element("div");
805
+
806
+ for (let i = 0; i < each_blocks.length; i += 1) {
807
+ each_blocks[i].c();
808
+ }
809
+
810
+ internal.attr(div, "class", "floorplan-plugin__room-labels svelte-13xux0b");
811
+ },
812
+ m(target, anchor) {
813
+ internal.insert(target, div, anchor);
814
+
815
+ for (let i = 0; i < each_blocks.length; i += 1) {
816
+ each_blocks[i].m(div, null);
817
+ }
818
+
819
+ current = true;
820
+ },
821
+ p(ctx, dirty) {
822
+ if (dirty & /*rooms, getLabelElement*/ 3) {
823
+ each_value = /*rooms*/ ctx[1];
824
+ internal.group_outros();
825
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$5, null, get_each_context$5);
826
+ internal.check_outros();
827
+ }
828
+ },
829
+ i(local) {
830
+ if (current) return;
831
+
832
+ for (let i = 0; i < each_value.length; i += 1) {
833
+ internal.transition_in(each_blocks[i]);
834
+ }
835
+
836
+ current = true;
837
+ },
838
+ o(local) {
839
+ for (let i = 0; i < each_blocks.length; i += 1) {
840
+ internal.transition_out(each_blocks[i]);
841
+ }
842
+
843
+ current = false;
844
+ },
845
+ d(detaching) {
846
+ if (detaching) internal.detach(div);
847
+
848
+ for (let i = 0; i < each_blocks.length; i += 1) {
849
+ each_blocks[i].d();
850
+ }
851
+ }
852
+ };
853
+ }
854
+
855
+ // (10:4) {#each rooms as room (room.id)}
856
+ function create_each_block$5(key_1, ctx) {
963
857
  let first;
964
- let ruleitem;
858
+ let roomlabel;
965
859
  let current;
966
860
 
967
- const ruleitem_spread_levels = [
861
+ const roomlabel_spread_levels = [
968
862
  {
969
- type: /*type*/ ctx[7],
970
- data: /*data*/ ctx[8],
971
- pxmm: /*pxmm*/ ctx[0],
972
- bounding: /*bounding*/ ctx[2]
863
+ room: /*room*/ ctx[4],
864
+ getLabelElement: /*getLabelElement*/ ctx[0]
973
865
  }
974
866
  ];
975
867
 
976
- let ruleitem_props = {};
868
+ let roomlabel_props = {};
977
869
 
978
- for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
979
- ruleitem_props = internal.assign(ruleitem_props, ruleitem_spread_levels[i]);
870
+ for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
871
+ roomlabel_props = internal.assign(roomlabel_props, roomlabel_spread_levels[i]);
980
872
  }
981
873
 
982
- ruleitem = new RuleItem({ props: ruleitem_props });
874
+ roomlabel = new RoomLabel({ props: roomlabel_props });
983
875
 
984
876
  return {
985
877
  key: key_1,
986
878
  first: null,
987
879
  c() {
988
880
  first = internal.empty();
989
- internal.create_component(ruleitem.$$.fragment);
881
+ internal.create_component(roomlabel.$$.fragment);
990
882
  this.first = first;
991
883
  },
992
884
  m(target, anchor) {
993
885
  internal.insert(target, first, anchor);
994
- internal.mount_component(ruleitem, target, anchor);
886
+ internal.mount_component(roomlabel, target, anchor);
995
887
  current = true;
996
888
  },
997
889
  p(new_ctx, dirty) {
998
890
  ctx = new_ctx;
999
891
 
1000
- const ruleitem_changes = (dirty & /*ruleLabelArray, pxmm, bounding*/ 7)
1001
- ? internal.get_spread_update(ruleitem_spread_levels, [
892
+ const roomlabel_changes = (dirty & /*rooms, getLabelElement*/ 3)
893
+ ? internal.get_spread_update(roomlabel_spread_levels, [
1002
894
  {
1003
- type: /*type*/ ctx[7],
1004
- data: /*data*/ ctx[8],
1005
- pxmm: /*pxmm*/ ctx[0],
1006
- bounding: /*bounding*/ ctx[2]
895
+ room: /*room*/ ctx[4],
896
+ getLabelElement: /*getLabelElement*/ ctx[0]
1007
897
  }
1008
898
  ])
1009
899
  : {};
1010
900
 
1011
- ruleitem.$set(ruleitem_changes);
901
+ roomlabel.$set(roomlabel_changes);
1012
902
  },
1013
903
  i(local) {
1014
904
  if (current) return;
1015
- internal.transition_in(ruleitem.$$.fragment, local);
905
+ internal.transition_in(roomlabel.$$.fragment, local);
1016
906
  current = true;
1017
907
  },
1018
908
  o(local) {
1019
- internal.transition_out(ruleitem.$$.fragment, local);
909
+ internal.transition_out(roomlabel.$$.fragment, local);
1020
910
  current = false;
1021
911
  },
1022
912
  d(detaching) {
1023
913
  if (detaching) internal.detach(first);
1024
- internal.destroy_component(ruleitem, detaching);
914
+ internal.destroy_component(roomlabel, detaching);
1025
915
  }
1026
916
  };
1027
917
  }
1028
918
 
1029
- function create_fragment$b(ctx) {
1030
- let div;
1031
- let each_blocks = [];
1032
- let each_1_lookup = new Map();
919
+ function create_fragment$a(ctx) {
920
+ let if_block_anchor;
1033
921
  let current;
1034
- let each_value = /*ruleLabelArray*/ ctx[1];
1035
- const get_key = ctx => /*type*/ ctx[7];
1036
-
1037
- for (let i = 0; i < each_value.length; i += 1) {
1038
- let child_ctx = get_each_context$2(ctx, each_value, i);
1039
- let key = get_key(child_ctx);
1040
- each_1_lookup.set(key, each_blocks[i] = create_each_block$2(key, child_ctx));
1041
- }
922
+ let if_block = /*rooms*/ ctx[1] && create_if_block$3(ctx);
1042
923
 
1043
924
  return {
1044
925
  c() {
1045
- div = internal.element("div");
1046
-
1047
- for (let i = 0; i < each_blocks.length; i += 1) {
1048
- each_blocks[i].c();
1049
- }
1050
-
1051
- internal.attr(div, "class", "floorplan-plugin__rulelabels");
926
+ if (if_block) if_block.c();
927
+ if_block_anchor = internal.empty();
1052
928
  },
1053
929
  m(target, anchor) {
1054
- internal.insert(target, div, anchor);
1055
-
1056
- for (let i = 0; i < each_blocks.length; i += 1) {
1057
- each_blocks[i].m(div, null);
1058
- }
1059
-
930
+ if (if_block) if_block.m(target, anchor);
931
+ internal.insert(target, if_block_anchor, anchor);
1060
932
  current = true;
1061
933
  },
1062
934
  p(ctx, [dirty]) {
1063
- if (dirty & /*ruleLabelArray, pxmm, bounding*/ 7) {
1064
- each_value = /*ruleLabelArray*/ ctx[1];
935
+ if (/*rooms*/ ctx[1]) {
936
+ if (if_block) {
937
+ if_block.p(ctx, dirty);
938
+
939
+ if (dirty & /*rooms*/ 2) {
940
+ internal.transition_in(if_block, 1);
941
+ }
942
+ } else {
943
+ if_block = create_if_block$3(ctx);
944
+ if_block.c();
945
+ internal.transition_in(if_block, 1);
946
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
947
+ }
948
+ } else if (if_block) {
1065
949
  internal.group_outros();
1066
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$2, null, get_each_context$2);
950
+
951
+ internal.transition_out(if_block, 1, 1, () => {
952
+ if_block = null;
953
+ });
954
+
1067
955
  internal.check_outros();
1068
956
  }
1069
957
  },
1070
958
  i(local) {
1071
959
  if (current) return;
1072
-
1073
- for (let i = 0; i < each_value.length; i += 1) {
1074
- internal.transition_in(each_blocks[i]);
1075
- }
1076
-
960
+ internal.transition_in(if_block);
1077
961
  current = true;
1078
962
  },
1079
963
  o(local) {
1080
- for (let i = 0; i < each_blocks.length; i += 1) {
1081
- internal.transition_out(each_blocks[i]);
1082
- }
1083
-
964
+ internal.transition_out(if_block);
1084
965
  current = false;
1085
966
  },
1086
967
  d(detaching) {
1087
- if (detaching) internal.detach(div);
1088
-
1089
- for (let i = 0; i < each_blocks.length; i += 1) {
1090
- each_blocks[i].d();
1091
- }
968
+ if (if_block) if_block.d(detaching);
969
+ if (detaching) internal.detach(if_block_anchor);
1092
970
  }
1093
971
  };
1094
972
  }
1095
973
 
1096
- function instance$b($$self, $$props, $$invalidate) {
1097
- let bounding;
1098
- let ruleLabelData;
1099
- let ruleLabelDataKeys;
1100
- let ruleLabelArray;
1101
- let { pxmm } = $$props;
974
+ function instance$a($$self, $$props, $$invalidate) {
975
+ let rooms;
1102
976
  let { floorIndex } = $$props;
1103
977
  let { floorplanData } = $$props;
978
+ let { getLabelElement } = $$props;
1104
979
 
1105
980
  $$self.$$set = $$props => {
1106
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
1107
- if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
1108
- if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
981
+ if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
982
+ if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
983
+ if ('getLabelElement' in $$props) $$invalidate(0, getLabelElement = $$props.getLabelElement);
1109
984
  };
1110
985
 
1111
986
  $$self.$$.update = () => {
1112
- if ($$self.$$.dirty & /*floorplanData*/ 16) {
1113
- $$invalidate(2, bounding = floorplanData.bounding);
1114
- }
1115
-
1116
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
1117
- $$invalidate(5, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
1118
- }
1119
-
1120
- if ($$self.$$.dirty & /*ruleLabelData*/ 32) {
1121
- $$invalidate(6, ruleLabelDataKeys = Object.keys(ruleLabelData));
1122
- }
1123
-
1124
- if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 96) {
1125
- $$invalidate(1, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
987
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
988
+ $$invalidate(1, rooms = floorplanData.floorDatas[floorIndex].rooms);
1126
989
  }
1127
990
  };
1128
991
 
1129
- return [
1130
- pxmm,
1131
- ruleLabelArray,
1132
- bounding,
1133
- floorIndex,
1134
- floorplanData,
1135
- ruleLabelData,
1136
- ruleLabelDataKeys
1137
- ];
992
+ return [getLabelElement, rooms, floorIndex, floorplanData];
1138
993
  }
1139
994
 
1140
- class RuleLabels extends internal.SvelteComponent {
995
+ class RoomLabels extends internal.SvelteComponent {
1141
996
  constructor(options) {
1142
997
  super();
1143
- internal.init(this, options, instance$b, create_fragment$b, internal.safe_not_equal, { pxmm: 0, floorIndex: 3, floorplanData: 4 });
998
+
999
+ internal.init(
1000
+ this,
1001
+ options,
1002
+ instance$a,
1003
+ create_fragment$a,
1004
+ internal.safe_not_equal,
1005
+ {
1006
+ floorIndex: 2,
1007
+ floorplanData: 3,
1008
+ getLabelElement: 0
1009
+ },
1010
+ add_css$7
1011
+ );
1144
1012
  }
1145
1013
  }
1146
1014
 
1147
- /* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
1015
+ /* src/floorplan/Components/RuleLabels/RuleItem.svelte generated by Svelte v3.47.0 */
1148
1016
 
1149
- function add_css$7(target) {
1150
- internal.append_styles(target, "svelte-1gfoniz", "img.svelte-1gfoniz{width:100%;height:100%}");
1017
+ function add_css$6(target) {
1018
+ internal.append_styles(target, "svelte-xt7p1v", ".floorplan-plugin__rule-labels.svelte-xt7p1v.svelte-xt7p1v{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-xt7p1v.svelte-xt7p1v{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-xt7p1v.svelte-xt7p1v{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-xt7p1v.svelte-xt7p1v{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-xt7p1v.svelte-xt7p1v{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-xt7p1v.svelte-xt7p1v{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-xt7p1v.svelte-xt7p1v{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-xt7p1v .floorplan-plugin__rule-scale-wrapper.svelte-xt7p1v{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-xt7p1v.svelte-xt7p1v{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-xt7p1v .floorplan-plugin__rule-scale.svelte-xt7p1v{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-xt7p1v.svelte-xt7p1v{position:absolute}.floorplan-plugin__rule-labels--top.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-xt7p1v.svelte-xt7p1v{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-xt7p1v .floorplan-plugin__rule-text-item.svelte-xt7p1v{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-xt7p1v.svelte-xt7p1v{width:-webkit-max-content;width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}");
1151
1019
  }
1152
1020
 
1153
- function create_fragment$a(ctx) {
1154
- let img;
1155
- let img_src_value;
1021
+ function get_each_context$4(ctx, list, i) {
1022
+ const child_ctx = ctx.slice();
1023
+ child_ctx[10] = list[i];
1024
+ child_ctx[12] = i;
1025
+ return child_ctx;
1026
+ }
1027
+
1028
+ function get_each_context_1(ctx, list, i) {
1029
+ const child_ctx = ctx.slice();
1030
+ child_ctx[13] = list[i];
1031
+ return child_ctx;
1032
+ }
1033
+
1034
+ // (53:4) {#each rulerLabels as rulerLabel}
1035
+ function create_each_block_1(ctx) {
1036
+ let div;
1156
1037
 
1157
1038
  return {
1158
1039
  c() {
1159
- img = internal.element("img");
1160
- if (!internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) internal.attr(img, "src", img_src_value);
1161
- internal.attr(img, "alt", "floorplan iamge");
1162
- internal.attr(img, "class", "svelte-1gfoniz");
1040
+ div = internal.element("div");
1041
+ internal.attr(div, "class", "floorplan-plugin__rule-scale svelte-xt7p1v");
1042
+ internal.set_style(div, "left", /*rulerLabel*/ ctx[13].left * 100 + '%', false);
1043
+ internal.set_style(div, "bottom", /*rulerLabel*/ ctx[13].bottom * 100 + '%', false);
1163
1044
  },
1164
1045
  m(target, anchor) {
1165
- internal.insert(target, img, anchor);
1166
- },
1167
- p(ctx, [dirty]) {
1168
- if (dirty & /*url*/ 1 && !internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
1169
- internal.attr(img, "src", img_src_value);
1170
- }
1046
+ internal.insert(target, div, anchor);
1171
1047
  },
1172
- i: internal.noop,
1173
- o: internal.noop,
1048
+ p: internal.noop,
1174
1049
  d(detaching) {
1175
- if (detaching) internal.detach(img);
1050
+ if (detaching) internal.detach(div);
1176
1051
  }
1177
1052
  };
1178
1053
  }
1179
1054
 
1180
- function instance$a($$self, $$props, $$invalidate) {
1181
- let { url } = $$props;
1055
+ // (62:4) {#each rulerTexts as textItem, textItemIndex (textItemIndex)}
1056
+ function create_each_block$4(key_1, ctx) {
1057
+ let div1;
1058
+ let div0;
1059
+ let t0_value = /*textItem*/ ctx[10].distance + "";
1060
+ let t0;
1061
+ let t1;
1182
1062
 
1183
- $$self.$$set = $$props => {
1184
- if ('url' in $$props) $$invalidate(0, url = $$props.url);
1063
+ return {
1064
+ key: key_1,
1065
+ first: null,
1066
+ c() {
1067
+ div1 = internal.element("div");
1068
+ div0 = internal.element("div");
1069
+ t0 = internal.text(t0_value);
1070
+ t1 = internal.space();
1071
+ internal.attr(div0, "class", "floorplan-plugin__rule-text svelte-xt7p1v");
1072
+ internal.toggle_class(div0, "is-row", /*isRow*/ ctx[1]);
1073
+ internal.attr(div1, "class", "floorplan-plugin__rule-text-item svelte-xt7p1v");
1074
+ internal.set_style(div1, "left", /*textItem*/ ctx[10].left * 100 + '%', false);
1075
+ internal.set_style(div1, "bottom", /*textItem*/ ctx[10].bottom * 100 + '%', false);
1076
+ this.first = div1;
1077
+ },
1078
+ m(target, anchor) {
1079
+ internal.insert(target, div1, anchor);
1080
+ internal.append(div1, div0);
1081
+ internal.append(div0, t0);
1082
+ internal.append(div1, t1);
1083
+ },
1084
+ p(new_ctx, dirty) {
1085
+ ctx = new_ctx;
1086
+ },
1087
+ d(detaching) {
1088
+ if (detaching) internal.detach(div1);
1089
+ }
1185
1090
  };
1186
-
1187
- return [url];
1188
1091
  }
1189
1092
 
1190
- class Normalmage extends internal.SvelteComponent {
1191
- constructor(options) {
1192
- super();
1193
- internal.init(this, options, instance$a, create_fragment$a, internal.safe_not_equal, { url: 0 }, add_css$7);
1194
- }
1195
- }
1093
+ function create_fragment$9(ctx) {
1094
+ let div3;
1095
+ let div0;
1096
+ let t0;
1097
+ let div1;
1098
+ let t1;
1099
+ let div2;
1100
+ let each_blocks = [];
1101
+ let each1_lookup = new Map();
1102
+ let div3_class_value;
1103
+ let each_value_1 = /*rulerLabels*/ ctx[2];
1104
+ let each_blocks_1 = [];
1196
1105
 
1197
- /* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
1106
+ for (let i = 0; i < each_value_1.length; i += 1) {
1107
+ each_blocks_1[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
1108
+ }
1198
1109
 
1199
- function add_css$6(target) {
1200
- internal.append_styles(target, "svelte-ub47ya", ".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}");
1201
- }
1110
+ let each_value = /*rulerTexts*/ ctx[3];
1111
+ const get_key = ctx => /*textItemIndex*/ ctx[12];
1202
1112
 
1203
- function create_fragment$9(ctx) {
1204
- let div;
1205
- let html_tag;
1206
- let t;
1207
- let html_tag_1;
1113
+ for (let i = 0; i < each_value.length; i += 1) {
1114
+ let child_ctx = get_each_context$4(ctx, each_value, i);
1115
+ let key = get_key(child_ctx);
1116
+ each1_lookup.set(key, each_blocks[i] = create_each_block$4(key, child_ctx));
1117
+ }
1208
1118
 
1209
1119
  return {
1210
1120
  c() {
1211
- div = internal.element("div");
1212
- html_tag = new internal.HtmlTag();
1213
- t = internal.space();
1214
- html_tag_1 = new internal.HtmlTag();
1215
- html_tag.a = t;
1216
- html_tag_1.a = null;
1217
- internal.attr(div, "class", "floorplan-plugin__base-image svelte-ub47ya");
1121
+ div3 = internal.element("div");
1122
+ div0 = internal.element("div");
1123
+ t0 = internal.space();
1124
+ div1 = internal.element("div");
1125
+
1126
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
1127
+ each_blocks_1[i].c();
1128
+ }
1129
+
1130
+ t1 = internal.space();
1131
+ div2 = internal.element("div");
1132
+
1133
+ for (let i = 0; i < each_blocks.length; i += 1) {
1134
+ each_blocks[i].c();
1135
+ }
1136
+
1137
+ internal.attr(div0, "class", "floorplan-plugin__rule-line svelte-xt7p1v");
1138
+ internal.attr(div1, "class", "floorplan-plugin__rule-scale-wrapper svelte-xt7p1v");
1139
+ internal.toggle_class(div1, "is-row", /*isRow*/ ctx[1]);
1140
+ internal.attr(div2, "class", "floorplan-plugin__rule-text-wrapper svelte-xt7p1v");
1141
+ internal.attr(div3, "class", div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-xt7p1v");
1142
+ internal.toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
1143
+ internal.set_style(div3, "width", /*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
1144
+ internal.set_style(div3, "height", !/*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
1218
1145
  },
1219
1146
  m(target, anchor) {
1220
- internal.insert(target, div, anchor);
1221
- html_tag.m(/*svgStyle*/ ctx[1], div);
1222
- internal.append(div, t);
1223
- html_tag_1.m(/*content*/ ctx[0], div);
1147
+ internal.insert(target, div3, anchor);
1148
+ internal.append(div3, div0);
1149
+ internal.append(div3, t0);
1150
+ internal.append(div3, div1);
1151
+
1152
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
1153
+ each_blocks_1[i].m(div1, null);
1154
+ }
1155
+
1156
+ internal.append(div3, t1);
1157
+ internal.append(div3, div2);
1158
+
1159
+ for (let i = 0; i < each_blocks.length; i += 1) {
1160
+ each_blocks[i].m(div2, null);
1161
+ }
1224
1162
  },
1225
1163
  p(ctx, [dirty]) {
1226
- if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
1164
+ if (dirty & /*rulerLabels*/ 4) {
1165
+ each_value_1 = /*rulerLabels*/ ctx[2];
1166
+ let i;
1167
+
1168
+ for (i = 0; i < each_value_1.length; i += 1) {
1169
+ const child_ctx = get_each_context_1(ctx, each_value_1, i);
1170
+
1171
+ if (each_blocks_1[i]) {
1172
+ each_blocks_1[i].p(child_ctx, dirty);
1173
+ } else {
1174
+ each_blocks_1[i] = create_each_block_1(child_ctx);
1175
+ each_blocks_1[i].c();
1176
+ each_blocks_1[i].m(div1, null);
1177
+ }
1178
+ }
1179
+
1180
+ for (; i < each_blocks_1.length; i += 1) {
1181
+ each_blocks_1[i].d(1);
1182
+ }
1183
+
1184
+ each_blocks_1.length = each_value_1.length;
1185
+ }
1186
+
1187
+ if (dirty & /*rulerTexts, isRow*/ 10) {
1188
+ each_value = /*rulerTexts*/ ctx[3];
1189
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each1_lookup, div2, internal.destroy_block, create_each_block$4, null, get_each_context$4);
1190
+ }
1191
+
1192
+ if (dirty & /*type*/ 1 && div3_class_value !== (div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-xt7p1v")) {
1193
+ internal.attr(div3, "class", div3_class_value);
1194
+ }
1195
+
1196
+ if (dirty & /*type, isRow*/ 3) {
1197
+ internal.toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
1198
+ }
1227
1199
  },
1228
1200
  i: internal.noop,
1229
1201
  o: internal.noop,
1230
1202
  d(detaching) {
1231
- if (detaching) internal.detach(div);
1203
+ if (detaching) internal.detach(div3);
1204
+ internal.destroy_each(each_blocks_1, detaching);
1205
+
1206
+ for (let i = 0; i < each_blocks.length; i += 1) {
1207
+ each_blocks[i].d();
1208
+ }
1232
1209
  }
1233
1210
  };
1234
1211
  }
1235
1212
 
1213
+ const padding$1 = 1000;
1214
+ const exteriorWallOffset$1 = 180;
1215
+
1236
1216
  function instance$9($$self, $$props, $$invalidate) {
1237
- let { content } = $$props;
1217
+ let { type } = $$props;
1218
+ let { data } = $$props;
1219
+ let { bounding } = $$props;
1220
+ const isRow = type === 'top' || type === 'bottom';
1221
+ const contentWidth = bounding.max.x - bounding.min.x - (padding$1 - exteriorWallOffset$1) * 2;
1222
+ const contentHeight = bounding.max.y - bounding.min.y - (padding$1 - exteriorWallOffset$1) * 2;
1238
1223
 
1239
- const svgStyle = `
1240
- <style>
1241
- svg [type='lineGroup'] path {
1242
- fill: #ffffff;
1243
- stroke: #ffffff;
1244
- }
1245
- svg [type='lineItemGroup'] g g g g {
1246
- stroke: #ffffff;
1247
- }</style>
1248
- `;
1224
+ // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
1225
+ const rulerPoints = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
1226
+ // 筛除重复数据
1227
+ if (index === 0) return true;
1228
+
1229
+ return x !== arr[index - 1];
1230
+ });
1231
+
1232
+ const rulerLabels = rulerPoints.map(num => {
1233
+ const left = isRow
1234
+ ? (num - bounding.min.x - padding$1 + exteriorWallOffset$1) / contentWidth
1235
+ : 0;
1236
+
1237
+ const bottom = !isRow
1238
+ ? (num - bounding.min.y - padding$1 + exteriorWallOffset$1) / contentHeight
1239
+ : 0;
1240
+
1241
+ return { left, bottom };
1242
+ });
1243
+
1244
+ rulerLabels.unshift({ left: 0, bottom: 0 });
1245
+ rulerLabels.push(isRow ? { left: 1, bottom: 0 } : { left: 0, bottom: 1 });
1246
+ const length = rulerPoints[rulerPoints.length - 1] - rulerPoints[0];
1247
+
1248
+ const rulerTexts = rulerPoints.map((num, index, arr) => {
1249
+ const distance = index === 0 ? 0 : num - arr[index - 1];
1250
+ const positionNum = index === 0 ? 0 : (num + arr[index - 1]) / 2;
1251
+
1252
+ const left = isRow
1253
+ ? (positionNum - bounding.min.x - padding$1 + exteriorWallOffset$1) / contentWidth
1254
+ : 0;
1255
+
1256
+ const bottom = !isRow
1257
+ ? (positionNum - bounding.min.y - padding$1 + exteriorWallOffset$1) / contentHeight
1258
+ : 0;
1259
+
1260
+ return { left, bottom, distance };
1261
+ }).filter(({ distance }) => distance / length > 0.1);
1249
1262
 
1250
1263
  $$self.$$set = $$props => {
1251
- if ('content' in $$props) $$invalidate(0, content = $$props.content);
1264
+ if ('type' in $$props) $$invalidate(0, type = $$props.type);
1265
+ if ('data' in $$props) $$invalidate(4, data = $$props.data);
1266
+ if ('bounding' in $$props) $$invalidate(5, bounding = $$props.bounding);
1252
1267
  };
1253
1268
 
1254
- return [content, svgStyle];
1269
+ return [type, isRow, rulerLabels, rulerTexts, data, bounding];
1255
1270
  }
1256
1271
 
1257
- class SvgImage extends internal.SvelteComponent {
1272
+ class RuleItem extends internal.SvelteComponent {
1258
1273
  constructor(options) {
1259
1274
  super();
1260
- internal.init(this, options, instance$9, create_fragment$9, internal.safe_not_equal, { content: 0 }, add_css$6);
1275
+ internal.init(this, options, instance$9, create_fragment$9, internal.safe_not_equal, { type: 0, data: 4, bounding: 5 }, add_css$6);
1261
1276
  }
1262
1277
  }
1263
1278
 
1264
- /* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
1279
+ /* src/floorplan/Components/RuleLabels/RuleLabels.svelte generated by Svelte v3.47.0 */
1265
1280
 
1266
1281
  function add_css$5(target) {
1267
- internal.append_styles(target, "svelte-ozpg4a", ".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
1282
+ internal.append_styles(target, "svelte-1mzj9p3", ".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}");
1268
1283
  }
1269
1284
 
1270
- // (13:22)
1271
- function create_if_block_1$3(ctx) {
1272
- let normalimage;
1285
+ function get_each_context$3(ctx, list, i) {
1286
+ const child_ctx = ctx.slice();
1287
+ child_ctx[12] = list[i][0];
1288
+ child_ctx[13] = list[i][1];
1289
+ return child_ctx;
1290
+ }
1291
+
1292
+ // (19:2) {#each ruleLabelArray as [type, data] (type)}
1293
+ function create_each_block$3(key_1, ctx) {
1294
+ let first;
1295
+ let ruleitem;
1273
1296
  let current;
1274
- normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
1275
1297
 
1276
- return {
1277
- c() {
1278
- internal.create_component(normalimage.$$.fragment);
1279
- },
1280
- m(target, anchor) {
1281
- internal.mount_component(normalimage, target, anchor);
1282
- current = true;
1283
- },
1284
- p(ctx, dirty) {
1285
- const normalimage_changes = {};
1286
- if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
1287
- normalimage.$set(normalimage_changes);
1288
- },
1289
- i(local) {
1290
- if (current) return;
1291
- internal.transition_in(normalimage.$$.fragment, local);
1292
- current = true;
1293
- },
1294
- o(local) {
1295
- internal.transition_out(normalimage.$$.fragment, local);
1296
- current = false;
1297
- },
1298
- d(detaching) {
1299
- internal.destroy_component(normalimage, detaching);
1298
+ const ruleitem_spread_levels = [
1299
+ {
1300
+ type: /*type*/ ctx[12],
1301
+ data: /*data*/ ctx[13],
1302
+ bounding: /*bounding*/ ctx[0]
1300
1303
  }
1301
- };
1302
- }
1304
+ ];
1303
1305
 
1304
- // (11:2) {#if svgContent}
1305
- function create_if_block$3(ctx) {
1306
- let svgimage;
1307
- let current;
1306
+ let ruleitem_props = {};
1308
1307
 
1309
- svgimage = new SvgImage({
1310
- props: { content: /*svgContent*/ ctx[0] }
1311
- });
1308
+ for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
1309
+ ruleitem_props = internal.assign(ruleitem_props, ruleitem_spread_levels[i]);
1310
+ }
1311
+
1312
+ ruleitem = new RuleItem({ props: ruleitem_props });
1312
1313
 
1313
1314
  return {
1315
+ key: key_1,
1316
+ first: null,
1314
1317
  c() {
1315
- internal.create_component(svgimage.$$.fragment);
1318
+ first = internal.empty();
1319
+ internal.create_component(ruleitem.$$.fragment);
1320
+ this.first = first;
1316
1321
  },
1317
1322
  m(target, anchor) {
1318
- internal.mount_component(svgimage, target, anchor);
1323
+ internal.insert(target, first, anchor);
1324
+ internal.mount_component(ruleitem, target, anchor);
1319
1325
  current = true;
1320
1326
  },
1321
- p(ctx, dirty) {
1322
- const svgimage_changes = {};
1323
- if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
1324
- svgimage.$set(svgimage_changes);
1327
+ p(new_ctx, dirty) {
1328
+ ctx = new_ctx;
1329
+
1330
+ const ruleitem_changes = (dirty & /*ruleLabelArray, bounding*/ 9)
1331
+ ? internal.get_spread_update(ruleitem_spread_levels, [
1332
+ {
1333
+ type: /*type*/ ctx[12],
1334
+ data: /*data*/ ctx[13],
1335
+ bounding: /*bounding*/ ctx[0]
1336
+ }
1337
+ ])
1338
+ : {};
1339
+
1340
+ ruleitem.$set(ruleitem_changes);
1325
1341
  },
1326
1342
  i(local) {
1327
1343
  if (current) return;
1328
- internal.transition_in(svgimage.$$.fragment, local);
1344
+ internal.transition_in(ruleitem.$$.fragment, local);
1329
1345
  current = true;
1330
1346
  },
1331
1347
  o(local) {
1332
- internal.transition_out(svgimage.$$.fragment, local);
1348
+ internal.transition_out(ruleitem.$$.fragment, local);
1333
1349
  current = false;
1334
1350
  },
1335
1351
  d(detaching) {
1336
- internal.destroy_component(svgimage, detaching);
1352
+ if (detaching) internal.detach(first);
1353
+ internal.destroy_component(ruleitem, detaching);
1337
1354
  }
1338
1355
  };
1339
1356
  }
1340
1357
 
1341
1358
  function create_fragment$8(ctx) {
1342
1359
  let div;
1343
- let current_block_type_index;
1344
- let if_block;
1360
+ let each_blocks = [];
1361
+ let each_1_lookup = new Map();
1345
1362
  let current;
1346
- const if_block_creators = [create_if_block$3, create_if_block_1$3];
1347
- const if_blocks = [];
1348
-
1349
- function select_block_type(ctx, dirty) {
1350
- if (/*svgContent*/ ctx[0]) return 0;
1351
- if (/*imageData*/ ctx[1]) return 1;
1352
- return -1;
1353
- }
1363
+ let each_value = /*ruleLabelArray*/ ctx[3];
1364
+ const get_key = ctx => /*type*/ ctx[12];
1354
1365
 
1355
- if (~(current_block_type_index = select_block_type(ctx))) {
1356
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1366
+ for (let i = 0; i < each_value.length; i += 1) {
1367
+ let child_ctx = get_each_context$3(ctx, each_value, i);
1368
+ let key = get_key(child_ctx);
1369
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$3(key, child_ctx));
1357
1370
  }
1358
1371
 
1359
1372
  return {
1360
1373
  c() {
1361
1374
  div = internal.element("div");
1362
- if (if_block) if_block.c();
1363
- internal.attr(div, "class", "floorplan-plugin__base-image svelte-ozpg4a");
1375
+
1376
+ for (let i = 0; i < each_blocks.length; i += 1) {
1377
+ each_blocks[i].c();
1378
+ }
1379
+
1380
+ internal.attr(div, "class", "floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3");
1381
+ internal.set_style(div, "width", /*width*/ ctx[2], false);
1382
+ internal.set_style(div, "height", /*height*/ ctx[1], false);
1364
1383
  },
1365
1384
  m(target, anchor) {
1366
1385
  internal.insert(target, div, anchor);
1367
1386
 
1368
- if (~current_block_type_index) {
1369
- if_blocks[current_block_type_index].m(div, null);
1387
+ for (let i = 0; i < each_blocks.length; i += 1) {
1388
+ each_blocks[i].m(div, null);
1370
1389
  }
1371
1390
 
1372
1391
  current = true;
1373
1392
  },
1374
1393
  p(ctx, [dirty]) {
1375
- let previous_block_index = current_block_type_index;
1376
- current_block_type_index = select_block_type(ctx);
1377
-
1378
- if (current_block_type_index === previous_block_index) {
1379
- if (~current_block_type_index) {
1380
- if_blocks[current_block_type_index].p(ctx, dirty);
1381
- }
1382
- } else {
1383
- if (if_block) {
1384
- internal.group_outros();
1385
-
1386
- internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
1387
- if_blocks[previous_block_index] = null;
1388
- });
1389
-
1390
- internal.check_outros();
1391
- }
1392
-
1393
- if (~current_block_type_index) {
1394
- if_block = if_blocks[current_block_type_index];
1394
+ if (dirty & /*ruleLabelArray, bounding*/ 9) {
1395
+ each_value = /*ruleLabelArray*/ ctx[3];
1396
+ internal.group_outros();
1397
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$3, null, get_each_context$3);
1398
+ internal.check_outros();
1399
+ }
1395
1400
 
1396
- if (!if_block) {
1397
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1398
- if_block.c();
1399
- } else {
1400
- if_block.p(ctx, dirty);
1401
- }
1401
+ if (dirty & /*width*/ 4) {
1402
+ internal.set_style(div, "width", /*width*/ ctx[2], false);
1403
+ }
1402
1404
 
1403
- internal.transition_in(if_block, 1);
1404
- if_block.m(div, null);
1405
- } else {
1406
- if_block = null;
1407
- }
1405
+ if (dirty & /*height*/ 2) {
1406
+ internal.set_style(div, "height", /*height*/ ctx[1], false);
1408
1407
  }
1409
1408
  },
1410
1409
  i(local) {
1411
1410
  if (current) return;
1412
- internal.transition_in(if_block);
1411
+
1412
+ for (let i = 0; i < each_value.length; i += 1) {
1413
+ internal.transition_in(each_blocks[i]);
1414
+ }
1415
+
1413
1416
  current = true;
1414
1417
  },
1415
1418
  o(local) {
1416
- internal.transition_out(if_block);
1419
+ for (let i = 0; i < each_blocks.length; i += 1) {
1420
+ internal.transition_out(each_blocks[i]);
1421
+ }
1422
+
1417
1423
  current = false;
1418
1424
  },
1419
1425
  d(detaching) {
1420
1426
  if (detaching) internal.detach(div);
1421
1427
 
1422
- if (~current_block_type_index) {
1423
- if_blocks[current_block_type_index].d();
1428
+ for (let i = 0; i < each_blocks.length; i += 1) {
1429
+ each_blocks[i].d();
1424
1430
  }
1425
1431
  }
1426
1432
  };
1427
1433
  }
1428
1434
 
1435
+ const padding = 1000;
1436
+ const exteriorWallOffset = 180;
1437
+
1429
1438
  function instance$8($$self, $$props, $$invalidate) {
1430
- let imageData;
1431
- let svgContent;
1432
- var _a, _b;
1439
+ let bounding;
1440
+ let ruleLabelData;
1441
+ let ruleLabelDataKeys;
1442
+ let ruleLabelArray;
1443
+ let boundingWidth;
1444
+ let boundingHeight;
1445
+ let contentWidth;
1446
+ let contentHeight;
1447
+ let width;
1448
+ let height;
1433
1449
  let { floorIndex } = $$props;
1434
1450
  let { floorplanData } = $$props;
1435
1451
 
1436
1452
  $$self.$$set = $$props => {
1437
- if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
1438
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
1453
+ if ('floorIndex' in $$props) $$invalidate(4, floorIndex = $$props.floorIndex);
1454
+ if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
1439
1455
  };
1440
1456
 
1441
1457
  $$self.$$.update = () => {
1442
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
1443
- $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
1458
+ if ($$self.$$.dirty & /*floorplanData*/ 32) {
1459
+ $$invalidate(0, bounding = floorplanData.bounding);
1444
1460
  }
1445
1461
 
1446
- if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
1447
- $$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
1448
- ? void 0
1449
- : _a[floorIndex]) === null || _b === void 0
1450
- ? void 0
1451
- : _b.svgContent);
1462
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 48) {
1463
+ $$invalidate(10, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
1464
+ }
1465
+
1466
+ if ($$self.$$.dirty & /*ruleLabelData*/ 1024) {
1467
+ $$invalidate(11, ruleLabelDataKeys = Object.keys(ruleLabelData));
1468
+ }
1469
+
1470
+ if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 3072) {
1471
+ $$invalidate(3, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
1472
+ }
1473
+
1474
+ if ($$self.$$.dirty & /*bounding*/ 1) {
1475
+ $$invalidate(8, boundingWidth = bounding.max.x - bounding.min.x);
1476
+ }
1477
+
1478
+ if ($$self.$$.dirty & /*bounding*/ 1) {
1479
+ $$invalidate(6, boundingHeight = bounding.max.y - bounding.min.y);
1480
+ }
1481
+
1482
+ if ($$self.$$.dirty & /*bounding*/ 1) {
1483
+ $$invalidate(9, contentWidth = bounding.max.x - bounding.min.x - (padding - exteriorWallOffset) * 2);
1484
+ }
1485
+
1486
+ if ($$self.$$.dirty & /*bounding*/ 1) {
1487
+ $$invalidate(7, contentHeight = bounding.max.y - bounding.min.y - (padding - exteriorWallOffset) * 2);
1488
+ }
1489
+
1490
+ if ($$self.$$.dirty & /*contentWidth, boundingWidth*/ 768) {
1491
+ $$invalidate(2, width = contentWidth / boundingWidth * 100 + '%');
1492
+ }
1493
+
1494
+ if ($$self.$$.dirty & /*contentHeight, boundingHeight*/ 192) {
1495
+ $$invalidate(1, height = contentHeight / boundingHeight * 100 + '%');
1452
1496
  }
1453
1497
  };
1454
1498
 
1455
- return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
1499
+ return [
1500
+ bounding,
1501
+ height,
1502
+ width,
1503
+ ruleLabelArray,
1504
+ floorIndex,
1505
+ floorplanData,
1506
+ boundingHeight,
1507
+ contentHeight,
1508
+ boundingWidth,
1509
+ contentWidth,
1510
+ ruleLabelData,
1511
+ ruleLabelDataKeys
1512
+ ];
1456
1513
  }
1457
1514
 
1458
- class BaseImage extends internal.SvelteComponent {
1515
+ class RuleLabels extends internal.SvelteComponent {
1459
1516
  constructor(options) {
1460
1517
  super();
1461
- internal.init(this, options, instance$8, create_fragment$8, internal.safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$5);
1518
+ internal.init(this, options, instance$8, create_fragment$8, internal.safe_not_equal, { floorIndex: 4, floorplanData: 5 }, add_css$5);
1462
1519
  }
1463
1520
  }
1464
1521
 
@@ -1483,9 +1540,9 @@ function pathD(points, options = {}) {
1483
1540
  return d + (needZ ? 'Z' : '');
1484
1541
  }
1485
1542
  /** 把户型图上点点位转换到 SVG 上的点位 */
1486
- function formatFloorplanPoint({ x, y }, pxmm, bounding) {
1543
+ function formatFloorplanPoint({ x, y }, bounding) {
1487
1544
  const { max, min } = bounding;
1488
- return { x: (x - min.x) * pxmm, y: (max.y - y) * pxmm };
1545
+ return { x: x - min.x, y: max.y - y };
1489
1546
  }
1490
1547
 
1491
1548
  /* src/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte generated by Svelte v3.47.0 */
@@ -1758,17 +1815,17 @@ function add_css$4(target) {
1758
1815
  internal.append_styles(target, "svelte-1d4xj70", "svg.svelte-1d4xj70{position:absolute;width:100%;height:100%;overflow:visible}");
1759
1816
  }
1760
1817
 
1761
- function get_each_context$1(ctx, list, i) {
1818
+ function get_each_context$2(ctx, list, i) {
1762
1819
  const child_ctx = ctx.slice();
1763
- child_ctx[4] = list[i];
1820
+ child_ctx[5] = list[i];
1764
1821
  return child_ctx;
1765
1822
  }
1766
1823
 
1767
- // (18:6) {:else}
1824
+ // (19:6) {:else}
1768
1825
  function create_else_block(ctx) {
1769
1826
  let roommaterial_1;
1770
1827
  let current;
1771
- roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[4].path } });
1828
+ roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[5].path } });
1772
1829
 
1773
1830
  return {
1774
1831
  c() {
@@ -1780,7 +1837,7 @@ function create_else_block(ctx) {
1780
1837
  },
1781
1838
  p(ctx, dirty) {
1782
1839
  const roommaterial_1_changes = {};
1783
- if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[4].path;
1840
+ if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[5].path;
1784
1841
  roommaterial_1.$set(roommaterial_1_changes);
1785
1842
  },
1786
1843
  i(local) {
@@ -1798,11 +1855,11 @@ function create_else_block(ctx) {
1798
1855
  };
1799
1856
  }
1800
1857
 
1801
- // (16:37)
1858
+ // (17:37)
1802
1859
  function create_if_block_1$2(ctx) {
1803
1860
  let roommaterial_2;
1804
1861
  let current;
1805
- roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[4].path } });
1862
+ roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[5].path } });
1806
1863
 
1807
1864
  return {
1808
1865
  c() {
@@ -1814,7 +1871,7 @@ function create_if_block_1$2(ctx) {
1814
1871
  },
1815
1872
  p(ctx, dirty) {
1816
1873
  const roommaterial_2_changes = {};
1817
- if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[4].path;
1874
+ if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[5].path;
1818
1875
  roommaterial_2.$set(roommaterial_2_changes);
1819
1876
  },
1820
1877
  i(local) {
@@ -1832,11 +1889,11 @@ function create_if_block_1$2(ctx) {
1832
1889
  };
1833
1890
  }
1834
1891
 
1835
- // (14:6) {#if room.floorType === 1}
1892
+ // (15:6) {#if room.floorType === 1}
1836
1893
  function create_if_block$2(ctx) {
1837
1894
  let roommaterial_0;
1838
1895
  let current;
1839
- roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[4].path } });
1896
+ roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[5].path } });
1840
1897
 
1841
1898
  return {
1842
1899
  c() {
@@ -1848,7 +1905,7 @@ function create_if_block$2(ctx) {
1848
1905
  },
1849
1906
  p(ctx, dirty) {
1850
1907
  const roommaterial_0_changes = {};
1851
- if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[4].path;
1908
+ if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[5].path;
1852
1909
  roommaterial_0.$set(roommaterial_0_changes);
1853
1910
  },
1854
1911
  i(local) {
@@ -1866,18 +1923,19 @@ function create_if_block$2(ctx) {
1866
1923
  };
1867
1924
  }
1868
1925
 
1869
- // (12:2) {#each rooms as room}
1870
- function create_each_block$1(ctx) {
1926
+ // (13:2) {#each rooms as room}
1927
+ function create_each_block$2(ctx) {
1871
1928
  let svg;
1872
1929
  let current_block_type_index;
1873
1930
  let if_block;
1931
+ let svg_viewBox_value;
1874
1932
  let current;
1875
1933
  const if_block_creators = [create_if_block$2, create_if_block_1$2, create_else_block];
1876
1934
  const if_blocks = [];
1877
1935
 
1878
1936
  function select_block_type(ctx, dirty) {
1879
- if (/*room*/ ctx[4].floorType === 1) return 0;
1880
- if (/*room*/ ctx[4].floorType === 0) return 1;
1937
+ if (/*room*/ ctx[5].floorType === 1) return 0;
1938
+ if (/*room*/ ctx[5].floorType === 0) return 1;
1881
1939
  return 2;
1882
1940
  }
1883
1941
 
@@ -1888,6 +1946,9 @@ function create_each_block$1(ctx) {
1888
1946
  c() {
1889
1947
  svg = internal.svg_element("svg");
1890
1948
  if_block.c();
1949
+ internal.attr(svg, "width", "100%");
1950
+ internal.attr(svg, "height", "100%");
1951
+ internal.attr(svg, "viewBox", svg_viewBox_value = `0 0 ${/*boundingWidth*/ ctx[1]} ${/*boundingHeight*/ ctx[2]}`);
1891
1952
  internal.attr(svg, "class", "svelte-1d4xj70");
1892
1953
  },
1893
1954
  m(target, anchor) {
@@ -1945,7 +2006,7 @@ function create_fragment$4(ctx) {
1945
2006
  let each_blocks = [];
1946
2007
 
1947
2008
  for (let i = 0; i < each_value.length; i += 1) {
1948
- each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i));
2009
+ each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i));
1949
2010
  }
1950
2011
 
1951
2012
  const out = i => internal.transition_out(each_blocks[i], 1, 1, () => {
@@ -1972,18 +2033,18 @@ function create_fragment$4(ctx) {
1972
2033
  current = true;
1973
2034
  },
1974
2035
  p(ctx, [dirty]) {
1975
- if (dirty & /*rooms*/ 1) {
2036
+ if (dirty & /*boundingWidth, boundingHeight, rooms*/ 7) {
1976
2037
  each_value = /*rooms*/ ctx[0];
1977
2038
  let i;
1978
2039
 
1979
2040
  for (i = 0; i < each_value.length; i += 1) {
1980
- const child_ctx = get_each_context$1(ctx, each_value, i);
2041
+ const child_ctx = get_each_context$2(ctx, each_value, i);
1981
2042
 
1982
2043
  if (each_blocks[i]) {
1983
2044
  each_blocks[i].p(child_ctx, dirty);
1984
2045
  internal.transition_in(each_blocks[i], 1);
1985
2046
  } else {
1986
- each_blocks[i] = create_each_block$1(child_ctx);
2047
+ each_blocks[i] = create_each_block$2(child_ctx);
1987
2048
  each_blocks[i].c();
1988
2049
  internal.transition_in(each_blocks[i], 1);
1989
2050
  each_blocks[i].m(div, null);
@@ -2027,30 +2088,30 @@ function create_fragment$4(ctx) {
2027
2088
  function instance$4($$self, $$props, $$invalidate) {
2028
2089
  let rooms;
2029
2090
  let { floorIndex } = $$props;
2030
- let { pxmm } = $$props;
2031
2091
  let { floorplanData } = $$props;
2092
+ const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
2093
+ const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
2032
2094
 
2033
2095
  $$self.$$set = $$props => {
2034
- if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
2035
- if ('pxmm' in $$props) $$invalidate(2, pxmm = $$props.pxmm);
2036
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
2096
+ if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
2097
+ if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
2037
2098
  };
2038
2099
 
2039
2100
  $$self.$$.update = () => {
2040
- if ($$self.$$.dirty & /*floorplanData, floorIndex, pxmm*/ 14) {
2101
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
2041
2102
  $$invalidate(0, rooms = floorplanData.floorDatas[floorIndex].rooms.map(room => Object.assign(Object.assign({}, room), {
2042
- path: room.path.map(p => formatFloorplanPoint(p, pxmm, floorplanData.bounding))
2103
+ path: room.path.map(p => formatFloorplanPoint(p, floorplanData.bounding))
2043
2104
  })));
2044
2105
  }
2045
2106
  };
2046
2107
 
2047
- return [rooms, floorIndex, pxmm, floorplanData];
2108
+ return [rooms, boundingWidth, boundingHeight, floorIndex, floorplanData];
2048
2109
  }
2049
2110
 
2050
2111
  class RoomMaterial extends internal.SvelteComponent {
2051
2112
  constructor(options) {
2052
2113
  super();
2053
- internal.init(this, options, instance$4, create_fragment$4, internal.safe_not_equal, { floorIndex: 1, pxmm: 2, floorplanData: 3 }, add_css$4);
2114
+ internal.init(this, options, instance$4, create_fragment$4, internal.safe_not_equal, { floorIndex: 3, floorplanData: 4 }, add_css$4);
2054
2115
  }
2055
2116
  }
2056
2117
 
@@ -2083,55 +2144,52 @@ function create_fragment$3(ctx) {
2083
2144
  }
2084
2145
 
2085
2146
  function instance$3($$self, $$props, $$invalidate) {
2086
- let { pxmm } = $$props;
2087
2147
  let { room } = $$props;
2088
2148
  let { floorplanData } = $$props;
2089
2149
  const { bounding } = floorplanData;
2090
2150
 
2091
2151
  const _pathD = pathD(room.path, {
2092
2152
  needZ: true,
2093
- format: vector => formatFloorplanPoint(vector, pxmm, bounding)
2153
+ format: vector => formatFloorplanPoint(vector, bounding)
2094
2154
  });
2095
2155
 
2096
2156
  $$self.$$set = $$props => {
2097
- if ('pxmm' in $$props) $$invalidate(1, pxmm = $$props.pxmm);
2098
- if ('room' in $$props) $$invalidate(2, room = $$props.room);
2099
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
2157
+ if ('room' in $$props) $$invalidate(1, room = $$props.room);
2158
+ if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
2100
2159
  };
2101
2160
 
2102
- return [_pathD, pxmm, room, floorplanData];
2161
+ return [_pathD, room, floorplanData];
2103
2162
  }
2104
2163
 
2105
2164
  class Room extends internal.SvelteComponent {
2106
2165
  constructor(options) {
2107
2166
  super();
2108
- internal.init(this, options, instance$3, create_fragment$3, internal.safe_not_equal, { pxmm: 1, room: 2, floorplanData: 3 }, add_css$3);
2167
+ internal.init(this, options, instance$3, create_fragment$3, internal.safe_not_equal, { room: 1, floorplanData: 2 }, add_css$3);
2109
2168
  }
2110
2169
  }
2111
2170
 
2112
2171
  /* src/floorplan/Components/RoomHighlight/RoomHighlight.svelte generated by Svelte v3.47.0 */
2113
2172
 
2114
2173
  function add_css$2(target) {
2115
- internal.append_styles(target, "svelte-klfhwd", ".floorplan-plugin__room-highlight.svelte-klfhwd{position:absolute;width:100%;height:100%;pointer-events:all}svg.svelte-klfhwd{width:100%;height:100%;overflow:visible}");
2174
+ internal.append_styles(target, "svelte-1kqo6e4", ".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}");
2116
2175
  }
2117
2176
 
2118
- function get_each_context(ctx, list, i) {
2177
+ function get_each_context$1(ctx, list, i) {
2119
2178
  const child_ctx = ctx.slice();
2120
- child_ctx[12] = list[i];
2179
+ child_ctx[4] = list[i];
2121
2180
  return child_ctx;
2122
2181
  }
2123
2182
 
2124
- // (41:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
2125
- function create_each_block(key_1, ctx) {
2183
+ // (10:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
2184
+ function create_each_block$1(key_1, ctx) {
2126
2185
  let first;
2127
2186
  let room;
2128
2187
  let current;
2129
2188
 
2130
2189
  const room_spread_levels = [
2131
2190
  {
2132
- room: /*room*/ ctx[12],
2133
- floorplanData: /*floorplanData*/ ctx[2],
2134
- pxmm: /*pxmm*/ ctx[0]
2191
+ room: /*room*/ ctx[4],
2192
+ floorplanData: /*floorplanData*/ ctx[1]
2135
2193
  }
2136
2194
  ];
2137
2195
 
@@ -2159,12 +2217,11 @@ function create_each_block(key_1, ctx) {
2159
2217
  p(new_ctx, dirty) {
2160
2218
  ctx = new_ctx;
2161
2219
 
2162
- const room_changes = (dirty & /*floorplanData, floorIndex, pxmm*/ 7)
2220
+ const room_changes = (dirty & /*floorplanData, floorIndex*/ 3)
2163
2221
  ? internal.get_spread_update(room_spread_levels, [
2164
2222
  {
2165
- room: /*room*/ ctx[12],
2166
- floorplanData: /*floorplanData*/ ctx[2],
2167
- pxmm: /*pxmm*/ ctx[0]
2223
+ room: /*room*/ ctx[4],
2224
+ floorplanData: /*floorplanData*/ ctx[1]
2168
2225
  }
2169
2226
  ])
2170
2227
  : {};
@@ -2192,17 +2249,14 @@ function create_fragment$2(ctx) {
2192
2249
  let svg;
2193
2250
  let each_blocks = [];
2194
2251
  let each_1_lookup = new Map();
2195
- let div_resize_listener;
2196
2252
  let current;
2197
- let mounted;
2198
- let dispose;
2199
- let each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
2200
- const get_key = ctx => /*room*/ ctx[12].id;
2253
+ let each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
2254
+ const get_key = ctx => /*room*/ ctx[4].id;
2201
2255
 
2202
2256
  for (let i = 0; i < each_value.length; i += 1) {
2203
- let child_ctx = get_each_context(ctx, each_value, i);
2257
+ let child_ctx = get_each_context$1(ctx, each_value, i);
2204
2258
  let key = get_key(child_ctx);
2205
- each_1_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
2259
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$1(key, child_ctx));
2206
2260
  }
2207
2261
 
2208
2262
  return {
@@ -2214,9 +2268,11 @@ function create_fragment$2(ctx) {
2214
2268
  each_blocks[i].c();
2215
2269
  }
2216
2270
 
2217
- internal.attr(svg, "class", "svelte-klfhwd");
2218
- internal.attr(div, "class", "floorplan-plugin__room-highlight svelte-klfhwd");
2219
- internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[10].call(div));
2271
+ internal.attr(svg, "width", "100%");
2272
+ internal.attr(svg, "height", "100%");
2273
+ internal.attr(svg, "viewBox", `0 0 ${/*boundingWidth*/ ctx[2]} ${/*boundingHeight*/ ctx[3]}`);
2274
+ internal.attr(svg, "class", "svelte-1kqo6e4");
2275
+ internal.attr(div, "class", "floorplan-plugin__room-highlight svelte-1kqo6e4");
2220
2276
  },
2221
2277
  m(target, anchor) {
2222
2278
  internal.insert(target, div, anchor);
@@ -2226,20 +2282,13 @@ function create_fragment$2(ctx) {
2226
2282
  each_blocks[i].m(svg, null);
2227
2283
  }
2228
2284
 
2229
- /*div_binding*/ ctx[9](div);
2230
- div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[10].bind(div));
2231
2285
  current = true;
2232
-
2233
- if (!mounted) {
2234
- dispose = internal.listen(div, "click", /*handleClick*/ ctx[6]);
2235
- mounted = true;
2236
- }
2237
2286
  },
2238
2287
  p(ctx, [dirty]) {
2239
- if (dirty & /*floorplanData, floorIndex, pxmm*/ 7) {
2240
- each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
2288
+ if (dirty & /*floorplanData, floorIndex*/ 3) {
2289
+ each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
2241
2290
  internal.group_outros();
2242
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, svg, internal.outro_and_destroy_block, create_each_block, null, get_each_context);
2291
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, svg, internal.outro_and_destroy_block, create_each_block$1, null, get_each_context$1);
2243
2292
  internal.check_outros();
2244
2293
  }
2245
2294
  },
@@ -2265,127 +2314,46 @@ function create_fragment$2(ctx) {
2265
2314
  for (let i = 0; i < each_blocks.length; i += 1) {
2266
2315
  each_blocks[i].d();
2267
2316
  }
2268
-
2269
- /*div_binding*/ ctx[9](null);
2270
- div_resize_listener();
2271
- mounted = false;
2272
- dispose();
2273
2317
  }
2274
2318
  };
2275
2319
  }
2276
2320
 
2277
2321
  function instance$2($$self, $$props, $$invalidate) {
2278
- let { five } = $$props;
2279
- let { pxmm } = $$props;
2280
2322
  let { floorIndex } = $$props;
2281
2323
  let { floorplanData } = $$props;
2282
- let { onRoomHeightClick } = $$props;
2283
- let clientWidth;
2284
- let clientHeight;
2285
- let highlightContainerDom;
2286
- const { observers: floorplan_observers } = floorplanData;
2287
-
2288
- const handleClick = function (e) {
2289
- if ((onRoomHeightClick === null || onRoomHeightClick === void 0
2290
- ? void 0
2291
- : onRoomHeightClick(e)) === false) return;
2292
-
2293
- // 因为 mouse.offsetX 的兼容性问题,手动计算 mouse offsetX offsetY
2294
- const boundingClientRect = highlightContainerDom.getBoundingClientRect();
2295
-
2296
- const mouseClientVector = new THREE.Vector2(e.clientX, e.clientY);
2297
- const domTopLeftVector = new THREE.Vector2(boundingClientRect.left, boundingClientRect.top);
2298
- const mouseOffsetVector = mouseClientVector.clone().sub(domTopLeftVector);
2299
-
2300
- // px 转换为 百分比
2301
- const mouseOffsetRelativeVector = new THREE.Vector2(mouseOffsetVector.x / clientWidth, mouseOffsetVector.y / clientHeight);
2302
-
2303
- const closestPoint = floorplan_observers.filter(observer => observer.floorIndex === floorIndex).sort((ob1, ob2) => {
2304
- const position1 = new THREE.Vector2(ob1.positionInImage.x, ob1.positionInImage.y);
2305
- const position2 = new THREE.Vector2(ob2.positionInImage.x, ob2.positionInImage.y);
2306
- return position1.distanceTo(mouseOffsetRelativeVector) - position2.distanceTo(mouseOffsetRelativeVector);
2307
- })[0];
2308
-
2309
- five.moveToPano(closestPoint.index);
2310
- };
2311
-
2312
- function div_binding($$value) {
2313
- internal.binding_callbacks[$$value ? 'unshift' : 'push'](() => {
2314
- highlightContainerDom = $$value;
2315
- $$invalidate(5, highlightContainerDom);
2316
- });
2317
- }
2318
-
2319
- function div_elementresize_handler() {
2320
- clientWidth = this.clientWidth;
2321
- clientHeight = this.clientHeight;
2322
- $$invalidate(3, clientWidth);
2323
- $$invalidate(4, clientHeight);
2324
- }
2324
+ const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
2325
+ const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
2325
2326
 
2326
2327
  $$self.$$set = $$props => {
2327
- if ('five' in $$props) $$invalidate(7, five = $$props.five);
2328
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
2329
- if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
2330
- if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
2331
- if ('onRoomHeightClick' in $$props) $$invalidate(8, onRoomHeightClick = $$props.onRoomHeightClick);
2328
+ if ('floorIndex' in $$props) $$invalidate(0, floorIndex = $$props.floorIndex);
2329
+ if ('floorplanData' in $$props) $$invalidate(1, floorplanData = $$props.floorplanData);
2332
2330
  };
2333
2331
 
2334
- return [
2335
- pxmm,
2336
- floorIndex,
2337
- floorplanData,
2338
- clientWidth,
2339
- clientHeight,
2340
- highlightContainerDom,
2341
- handleClick,
2342
- five,
2343
- onRoomHeightClick,
2344
- div_binding,
2345
- div_elementresize_handler
2346
- ];
2332
+ return [floorIndex, floorplanData, boundingWidth, boundingHeight];
2347
2333
  }
2348
2334
 
2349
2335
  class RoomHighlight extends internal.SvelteComponent {
2350
2336
  constructor(options) {
2351
2337
  super();
2352
-
2353
- internal.init(
2354
- this,
2355
- options,
2356
- instance$2,
2357
- create_fragment$2,
2358
- internal.safe_not_equal,
2359
- {
2360
- five: 7,
2361
- pxmm: 0,
2362
- floorIndex: 1,
2363
- floorplanData: 2,
2364
- onRoomHeightClick: 8
2365
- },
2366
- add_css$2
2367
- );
2338
+ internal.init(this, options, instance$2, create_fragment$2, internal.safe_not_equal, { floorIndex: 0, floorplanData: 1 }, add_css$2);
2368
2339
  }
2369
2340
  }
2370
2341
 
2371
- /* src/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte generated by Svelte v3.47.0 */
2342
+ /* src/floorplan/Components/CurrentFloor.svelte generated by Svelte v3.47.0 */
2372
2343
 
2373
2344
  function add_css$1(target) {
2374
- internal.append_styles(target, "svelte-tlo7rk", ".floorplan-current-floor.svelte-tlo7rk{position:relative;width:100%;height:100%}");
2345
+ internal.append_styles(target, "svelte-bl8zrz", ".floorplan-plugin__floor.svelte-bl8zrz{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;pointer-events:none}.floorplan-plugin__floor--is-current.svelte-bl8zrz{opacity:1;pointer-events:auto}");
2375
2346
  }
2376
2347
 
2377
- // (19:2) {#if hoverEnable}
2348
+ // (17:2) {#if hoverEnable}
2378
2349
  function create_if_block_2(ctx) {
2379
2350
  let roomhighlight;
2380
2351
  let current;
2381
2352
 
2382
2353
  const roomhighlight_spread_levels = [
2383
2354
  {
2384
- five: /*five*/ ctx[1],
2385
- pxmm: /*pxmm*/ ctx[0],
2386
- floorIndex: /*floorIndex*/ ctx[2],
2387
- floorplanData: /*floorplanData*/ ctx[6],
2388
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[7]
2355
+ floorIndex: /*floorIndex*/ ctx[1],
2356
+ floorplanData: /*floorplanData*/ ctx[5]
2389
2357
  }
2390
2358
  ];
2391
2359
 
@@ -2406,14 +2374,11 @@ function create_if_block_2(ctx) {
2406
2374
  current = true;
2407
2375
  },
2408
2376
  p(ctx, dirty) {
2409
- const roomhighlight_changes = (dirty & /*five, pxmm, floorIndex, floorplanData, onRoomHeightClick*/ 199)
2377
+ const roomhighlight_changes = (dirty & /*floorIndex, floorplanData*/ 34)
2410
2378
  ? internal.get_spread_update(roomhighlight_spread_levels, [
2411
2379
  {
2412
- five: /*five*/ ctx[1],
2413
- pxmm: /*pxmm*/ ctx[0],
2414
- floorIndex: /*floorIndex*/ ctx[2],
2415
- floorplanData: /*floorplanData*/ ctx[6],
2416
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[7]
2380
+ floorIndex: /*floorIndex*/ ctx[1],
2381
+ floorplanData: /*floorplanData*/ ctx[5]
2417
2382
  }
2418
2383
  ])
2419
2384
  : {};
@@ -2435,16 +2400,16 @@ function create_if_block_2(ctx) {
2435
2400
  };
2436
2401
  }
2437
2402
 
2438
- // (23:2) {#if roomLabelsEnable}
2403
+ // (21:2) {#if roomLabelsEnable}
2439
2404
  function create_if_block_1$1(ctx) {
2440
2405
  let roomlabels;
2441
2406
  let current;
2442
2407
 
2443
2408
  const roomlabels_spread_levels = [
2444
2409
  {
2445
- floorplanData: /*floorplanData*/ ctx[6],
2446
- floorIndex: /*floorIndex*/ ctx[2],
2447
- getLabelElement: /*getLabelElement*/ ctx[8]
2410
+ floorplanData: /*floorplanData*/ ctx[5],
2411
+ floorIndex: /*floorIndex*/ ctx[1],
2412
+ getLabelElement: /*getLabelElement*/ ctx[6]
2448
2413
  }
2449
2414
  ];
2450
2415
 
@@ -2465,12 +2430,12 @@ function create_if_block_1$1(ctx) {
2465
2430
  current = true;
2466
2431
  },
2467
2432
  p(ctx, dirty) {
2468
- const roomlabels_changes = (dirty & /*floorplanData, floorIndex, getLabelElement*/ 324)
2433
+ const roomlabels_changes = (dirty & /*floorplanData, floorIndex, getLabelElement*/ 98)
2469
2434
  ? internal.get_spread_update(roomlabels_spread_levels, [
2470
2435
  {
2471
- floorplanData: /*floorplanData*/ ctx[6],
2472
- floorIndex: /*floorIndex*/ ctx[2],
2473
- getLabelElement: /*getLabelElement*/ ctx[8]
2436
+ floorplanData: /*floorplanData*/ ctx[5],
2437
+ floorIndex: /*floorIndex*/ ctx[1],
2438
+ getLabelElement: /*getLabelElement*/ ctx[6]
2474
2439
  }
2475
2440
  ])
2476
2441
  : {};
@@ -2492,16 +2457,15 @@ function create_if_block_1$1(ctx) {
2492
2457
  };
2493
2458
  }
2494
2459
 
2495
- // (26:2) {#if ruleLabelsEnable}
2460
+ // (24:2) {#if ruleLabelsEnable}
2496
2461
  function create_if_block$1(ctx) {
2497
2462
  let rulelabels;
2498
2463
  let current;
2499
2464
 
2500
2465
  const rulelabels_spread_levels = [
2501
2466
  {
2502
- floorplanData: /*floorplanData*/ ctx[6],
2503
- floorIndex: /*floorIndex*/ ctx[2],
2504
- pxmm: /*pxmm*/ ctx[0]
2467
+ floorplanData: /*floorplanData*/ ctx[5],
2468
+ floorIndex: /*floorIndex*/ ctx[1]
2505
2469
  }
2506
2470
  ];
2507
2471
 
@@ -2522,12 +2486,11 @@ function create_if_block$1(ctx) {
2522
2486
  current = true;
2523
2487
  },
2524
2488
  p(ctx, dirty) {
2525
- const rulelabels_changes = (dirty & /*floorplanData, floorIndex, pxmm*/ 69)
2489
+ const rulelabels_changes = (dirty & /*floorplanData, floorIndex*/ 34)
2526
2490
  ? internal.get_spread_update(rulelabels_spread_levels, [
2527
2491
  {
2528
- floorplanData: /*floorplanData*/ ctx[6],
2529
- floorIndex: /*floorIndex*/ ctx[2],
2530
- pxmm: /*pxmm*/ ctx[0]
2492
+ floorplanData: /*floorplanData*/ ctx[5],
2493
+ floorIndex: /*floorIndex*/ ctx[1]
2531
2494
  }
2532
2495
  ])
2533
2496
  : {};
@@ -2557,13 +2520,13 @@ function create_fragment$1(ctx) {
2557
2520
  let baseimage;
2558
2521
  let t2;
2559
2522
  let t3;
2523
+ let div_class_value;
2560
2524
  let current;
2561
2525
 
2562
2526
  const roommaterial_spread_levels = [
2563
2527
  {
2564
- floorIndex: /*floorIndex*/ ctx[2],
2565
- floorplanData: /*floorplanData*/ ctx[6],
2566
- pxmm: /*pxmm*/ ctx[0]
2528
+ floorIndex: /*floorIndex*/ ctx[1],
2529
+ floorplanData: /*floorplanData*/ ctx[5]
2567
2530
  }
2568
2531
  ];
2569
2532
 
@@ -2574,12 +2537,12 @@ function create_fragment$1(ctx) {
2574
2537
  }
2575
2538
 
2576
2539
  roommaterial = new RoomMaterial({ props: roommaterial_props });
2577
- let if_block0 = /*hoverEnable*/ ctx[3] && create_if_block_2(ctx);
2540
+ let if_block0 = /*hoverEnable*/ ctx[2] && create_if_block_2(ctx);
2578
2541
 
2579
2542
  const baseimage_spread_levels = [
2580
2543
  {
2581
- floorplanData: /*floorplanData*/ ctx[6],
2582
- floorIndex: /*floorIndex*/ ctx[2]
2544
+ floorplanData: /*floorplanData*/ ctx[5],
2545
+ floorIndex: /*floorIndex*/ ctx[1]
2583
2546
  }
2584
2547
  ];
2585
2548
 
@@ -2590,8 +2553,8 @@ function create_fragment$1(ctx) {
2590
2553
  }
2591
2554
 
2592
2555
  baseimage = new BaseImage({ props: baseimage_props });
2593
- let if_block1 = /*roomLabelsEnable*/ ctx[4] && create_if_block_1$1(ctx);
2594
- let if_block2 = /*ruleLabelsEnable*/ ctx[5] && create_if_block$1(ctx);
2556
+ let if_block1 = /*roomLabelsEnable*/ ctx[3] && create_if_block_1$1(ctx);
2557
+ let if_block2 = /*ruleLabelsEnable*/ ctx[4] && create_if_block$1(ctx);
2595
2558
 
2596
2559
  return {
2597
2560
  c() {
@@ -2605,7 +2568,10 @@ function create_fragment$1(ctx) {
2605
2568
  if (if_block1) if_block1.c();
2606
2569
  t3 = internal.space();
2607
2570
  if (if_block2) if_block2.c();
2608
- internal.attr(div, "class", "floorplan-current-floor svelte-tlo7rk");
2571
+
2572
+ internal.attr(div, "class", div_class_value = "" + (internal.null_to_empty(`floorplan-plugin__floor${/*isCurrent*/ ctx[0]
2573
+ ? ' floorplan-plugin__floor--is-current'
2574
+ : ''}`) + " svelte-bl8zrz"));
2609
2575
  },
2610
2576
  m(target, anchor) {
2611
2577
  internal.insert(target, div, anchor);
@@ -2621,23 +2587,22 @@ function create_fragment$1(ctx) {
2621
2587
  current = true;
2622
2588
  },
2623
2589
  p(ctx, [dirty]) {
2624
- const roommaterial_changes = (dirty & /*floorIndex, floorplanData, pxmm*/ 69)
2590
+ const roommaterial_changes = (dirty & /*floorIndex, floorplanData*/ 34)
2625
2591
  ? internal.get_spread_update(roommaterial_spread_levels, [
2626
2592
  {
2627
- floorIndex: /*floorIndex*/ ctx[2],
2628
- floorplanData: /*floorplanData*/ ctx[6],
2629
- pxmm: /*pxmm*/ ctx[0]
2593
+ floorIndex: /*floorIndex*/ ctx[1],
2594
+ floorplanData: /*floorplanData*/ ctx[5]
2630
2595
  }
2631
2596
  ])
2632
2597
  : {};
2633
2598
 
2634
2599
  roommaterial.$set(roommaterial_changes);
2635
2600
 
2636
- if (/*hoverEnable*/ ctx[3]) {
2601
+ if (/*hoverEnable*/ ctx[2]) {
2637
2602
  if (if_block0) {
2638
2603
  if_block0.p(ctx, dirty);
2639
2604
 
2640
- if (dirty & /*hoverEnable*/ 8) {
2605
+ if (dirty & /*hoverEnable*/ 4) {
2641
2606
  internal.transition_in(if_block0, 1);
2642
2607
  }
2643
2608
  } else {
@@ -2656,22 +2621,22 @@ function create_fragment$1(ctx) {
2656
2621
  internal.check_outros();
2657
2622
  }
2658
2623
 
2659
- const baseimage_changes = (dirty & /*floorplanData, floorIndex*/ 68)
2624
+ const baseimage_changes = (dirty & /*floorplanData, floorIndex*/ 34)
2660
2625
  ? internal.get_spread_update(baseimage_spread_levels, [
2661
2626
  {
2662
- floorplanData: /*floorplanData*/ ctx[6],
2663
- floorIndex: /*floorIndex*/ ctx[2]
2627
+ floorplanData: /*floorplanData*/ ctx[5],
2628
+ floorIndex: /*floorIndex*/ ctx[1]
2664
2629
  }
2665
2630
  ])
2666
2631
  : {};
2667
2632
 
2668
2633
  baseimage.$set(baseimage_changes);
2669
2634
 
2670
- if (/*roomLabelsEnable*/ ctx[4]) {
2635
+ if (/*roomLabelsEnable*/ ctx[3]) {
2671
2636
  if (if_block1) {
2672
2637
  if_block1.p(ctx, dirty);
2673
2638
 
2674
- if (dirty & /*roomLabelsEnable*/ 16) {
2639
+ if (dirty & /*roomLabelsEnable*/ 8) {
2675
2640
  internal.transition_in(if_block1, 1);
2676
2641
  }
2677
2642
  } else {
@@ -2690,11 +2655,11 @@ function create_fragment$1(ctx) {
2690
2655
  internal.check_outros();
2691
2656
  }
2692
2657
 
2693
- if (/*ruleLabelsEnable*/ ctx[5]) {
2658
+ if (/*ruleLabelsEnable*/ ctx[4]) {
2694
2659
  if (if_block2) {
2695
2660
  if_block2.p(ctx, dirty);
2696
2661
 
2697
- if (dirty & /*ruleLabelsEnable*/ 32) {
2662
+ if (dirty & /*ruleLabelsEnable*/ 16) {
2698
2663
  internal.transition_in(if_block2, 1);
2699
2664
  }
2700
2665
  } else {
@@ -2712,6 +2677,12 @@ function create_fragment$1(ctx) {
2712
2677
 
2713
2678
  internal.check_outros();
2714
2679
  }
2680
+
2681
+ if (!current || dirty & /*isCurrent*/ 1 && div_class_value !== (div_class_value = "" + (internal.null_to_empty(`floorplan-plugin__floor${/*isCurrent*/ ctx[0]
2682
+ ? ' floorplan-plugin__floor--is-current'
2683
+ : ''}`) + " svelte-bl8zrz"))) {
2684
+ internal.attr(div, "class", div_class_value);
2685
+ }
2715
2686
  },
2716
2687
  i(local) {
2717
2688
  if (current) return;
@@ -2742,37 +2713,31 @@ function create_fragment$1(ctx) {
2742
2713
  }
2743
2714
 
2744
2715
  function instance$1($$self, $$props, $$invalidate) {
2745
- let { pxmm } = $$props;
2746
- let { five } = $$props;
2716
+ let { isCurrent } = $$props;
2747
2717
  let { floorIndex } = $$props;
2748
2718
  let { hoverEnable } = $$props;
2749
2719
  let { roomLabelsEnable } = $$props;
2750
2720
  let { ruleLabelsEnable } = $$props;
2751
2721
  let { floorplanData } = $$props;
2752
- let { onRoomHeightClick } = $$props;
2753
2722
  let { getLabelElement } = $$props;
2754
2723
 
2755
2724
  $$self.$$set = $$props => {
2756
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
2757
- if ('five' in $$props) $$invalidate(1, five = $$props.five);
2758
- if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
2759
- if ('hoverEnable' in $$props) $$invalidate(3, hoverEnable = $$props.hoverEnable);
2760
- if ('roomLabelsEnable' in $$props) $$invalidate(4, roomLabelsEnable = $$props.roomLabelsEnable);
2761
- if ('ruleLabelsEnable' in $$props) $$invalidate(5, ruleLabelsEnable = $$props.ruleLabelsEnable);
2762
- if ('floorplanData' in $$props) $$invalidate(6, floorplanData = $$props.floorplanData);
2763
- if ('onRoomHeightClick' in $$props) $$invalidate(7, onRoomHeightClick = $$props.onRoomHeightClick);
2764
- if ('getLabelElement' in $$props) $$invalidate(8, getLabelElement = $$props.getLabelElement);
2725
+ if ('isCurrent' in $$props) $$invalidate(0, isCurrent = $$props.isCurrent);
2726
+ if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
2727
+ if ('hoverEnable' in $$props) $$invalidate(2, hoverEnable = $$props.hoverEnable);
2728
+ if ('roomLabelsEnable' in $$props) $$invalidate(3, roomLabelsEnable = $$props.roomLabelsEnable);
2729
+ if ('ruleLabelsEnable' in $$props) $$invalidate(4, ruleLabelsEnable = $$props.ruleLabelsEnable);
2730
+ if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
2731
+ if ('getLabelElement' in $$props) $$invalidate(6, getLabelElement = $$props.getLabelElement);
2765
2732
  };
2766
2733
 
2767
2734
  return [
2768
- pxmm,
2769
- five,
2735
+ isCurrent,
2770
2736
  floorIndex,
2771
2737
  hoverEnable,
2772
2738
  roomLabelsEnable,
2773
2739
  ruleLabelsEnable,
2774
2740
  floorplanData,
2775
- onRoomHeightClick,
2776
2741
  getLabelElement
2777
2742
  ];
2778
2743
  }
@@ -2788,65 +2753,56 @@ class CurrentFloor extends internal.SvelteComponent {
2788
2753
  create_fragment$1,
2789
2754
  internal.safe_not_equal,
2790
2755
  {
2791
- pxmm: 0,
2792
- five: 1,
2793
- floorIndex: 2,
2794
- hoverEnable: 3,
2795
- roomLabelsEnable: 4,
2796
- ruleLabelsEnable: 5,
2797
- floorplanData: 6,
2798
- onRoomHeightClick: 7,
2799
- getLabelElement: 8
2756
+ isCurrent: 0,
2757
+ floorIndex: 1,
2758
+ hoverEnable: 2,
2759
+ roomLabelsEnable: 3,
2760
+ ruleLabelsEnable: 4,
2761
+ floorplanData: 5,
2762
+ getLabelElement: 6
2800
2763
  },
2801
2764
  add_css$1
2802
2765
  );
2803
2766
  }
2804
2767
  }
2805
2768
 
2806
- /* src/floorplan/ModelFloorplanPlugin/Components/Main.svelte generated by Svelte v3.47.0 */
2769
+ /* src/floorplan/Components/Main.svelte generated by Svelte v3.47.0 */
2807
2770
 
2808
2771
  function add_css(target) {
2809
2772
  internal.append_styles(target, "svelte-q5wdnn", ".floorplan-main.svelte-q5wdnn{width:100%;height:100%}");
2810
2773
  }
2811
2774
 
2812
- // (24:0) {#if visible}
2775
+ function get_each_context(ctx, list, i) {
2776
+ const child_ctx = ctx.slice();
2777
+ child_ctx[13] = list[i];
2778
+ return child_ctx;
2779
+ }
2780
+
2781
+ // (21:0) {#if visible}
2813
2782
  function create_if_block(ctx) {
2814
2783
  let div;
2815
- let currentfloor;
2816
2784
  let t0;
2817
2785
  let camera;
2818
2786
  let t1;
2819
2787
  let div_intro;
2820
2788
  let current;
2789
+ let each_value = /*floorplanData*/ ctx[9].floorDatas;
2790
+ let each_blocks = [];
2821
2791
 
2822
- const currentfloor_spread_levels = [
2823
- {
2824
- five: /*five*/ ctx[2],
2825
- pxmm: /*pxmm*/ ctx[1],
2826
- floorIndex: /*floorIndex*/ ctx[6],
2827
- hoverEnable: /*hoverEnable*/ ctx[7],
2828
- floorplanData: /*floorplanData*/ ctx[11],
2829
- getLabelElement: /*getLabelElement*/ ctx[15],
2830
- roomLabelsEnable: /*roomLabelsEnable*/ ctx[9],
2831
- ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[10],
2832
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[14]
2833
- }
2834
- ];
2835
-
2836
- let currentfloor_props = {};
2837
-
2838
- for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
2839
- currentfloor_props = internal.assign(currentfloor_props, currentfloor_spread_levels[i]);
2792
+ for (let i = 0; i < each_value.length; i += 1) {
2793
+ each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
2840
2794
  }
2841
2795
 
2842
- currentfloor = new CurrentFloor({ props: currentfloor_props });
2796
+ const out = i => internal.transition_out(each_blocks[i], 1, 1, () => {
2797
+ each_blocks[i] = null;
2798
+ });
2843
2799
 
2844
2800
  const camera_spread_levels = [
2845
2801
  {
2846
- panoIndex: /*panoIndex*/ ctx[5],
2847
- floorplanData: /*floorplanData*/ ctx[11],
2848
- lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[12],
2849
- cameraImageUrl: /*cameraImageUrl*/ ctx[13]
2802
+ panoIndex: /*panoIndex*/ ctx[3],
2803
+ floorplanData: /*floorplanData*/ ctx[9],
2804
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[10],
2805
+ cameraImageUrl: /*cameraImageUrl*/ ctx[11]
2850
2806
  }
2851
2807
  ];
2852
2808
 
@@ -2857,12 +2813,16 @@ function create_if_block(ctx) {
2857
2813
  }
2858
2814
 
2859
2815
  camera = new Camera({ props: camera_props });
2860
- let if_block = /*compassEnable*/ ctx[8] && create_if_block_1(ctx);
2816
+ let if_block = /*compassEnable*/ ctx[6] && create_if_block_1(ctx);
2861
2817
 
2862
2818
  return {
2863
2819
  c() {
2864
2820
  div = internal.element("div");
2865
- internal.create_component(currentfloor.$$.fragment);
2821
+
2822
+ for (let i = 0; i < each_blocks.length; i += 1) {
2823
+ each_blocks[i].c();
2824
+ }
2825
+
2866
2826
  t0 = internal.space();
2867
2827
  internal.create_component(camera.$$.fragment);
2868
2828
  t1 = internal.space();
@@ -2871,7 +2831,11 @@ function create_if_block(ctx) {
2871
2831
  },
2872
2832
  m(target, anchor) {
2873
2833
  internal.insert(target, div, anchor);
2874
- internal.mount_component(currentfloor, div, null);
2834
+
2835
+ for (let i = 0; i < each_blocks.length; i += 1) {
2836
+ each_blocks[i].m(div, null);
2837
+ }
2838
+
2875
2839
  internal.append(div, t0);
2876
2840
  internal.mount_component(camera, div, null);
2877
2841
  internal.append(div, t1);
@@ -2881,42 +2845,51 @@ function create_if_block(ctx) {
2881
2845
  p(new_ctx, dirty) {
2882
2846
  ctx = new_ctx;
2883
2847
 
2884
- const currentfloor_changes = (dirty & /*five, pxmm, floorIndex, hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, onRoomHeightClick*/ 52934)
2885
- ? internal.get_spread_update(currentfloor_spread_levels, [
2886
- {
2887
- five: /*five*/ ctx[2],
2888
- pxmm: /*pxmm*/ ctx[1],
2889
- floorIndex: /*floorIndex*/ ctx[6],
2890
- hoverEnable: /*hoverEnable*/ ctx[7],
2891
- floorplanData: /*floorplanData*/ ctx[11],
2892
- getLabelElement: /*getLabelElement*/ ctx[15],
2893
- roomLabelsEnable: /*roomLabelsEnable*/ ctx[9],
2894
- ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[10],
2895
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[14]
2848
+ if (dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, floorIndex*/ 5040) {
2849
+ each_value = /*floorplanData*/ ctx[9].floorDatas;
2850
+ let i;
2851
+
2852
+ for (i = 0; i < each_value.length; i += 1) {
2853
+ const child_ctx = get_each_context(ctx, each_value, i);
2854
+
2855
+ if (each_blocks[i]) {
2856
+ each_blocks[i].p(child_ctx, dirty);
2857
+ internal.transition_in(each_blocks[i], 1);
2858
+ } else {
2859
+ each_blocks[i] = create_each_block(child_ctx);
2860
+ each_blocks[i].c();
2861
+ internal.transition_in(each_blocks[i], 1);
2862
+ each_blocks[i].m(div, t0);
2896
2863
  }
2897
- ])
2898
- : {};
2864
+ }
2899
2865
 
2900
- currentfloor.$set(currentfloor_changes);
2866
+ internal.group_outros();
2867
+
2868
+ for (i = each_value.length; i < each_blocks.length; i += 1) {
2869
+ out(i);
2870
+ }
2871
+
2872
+ internal.check_outros();
2873
+ }
2901
2874
 
2902
- const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 14368)
2875
+ const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 3592)
2903
2876
  ? internal.get_spread_update(camera_spread_levels, [
2904
2877
  {
2905
- panoIndex: /*panoIndex*/ ctx[5],
2906
- floorplanData: /*floorplanData*/ ctx[11],
2907
- lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[12],
2908
- cameraImageUrl: /*cameraImageUrl*/ ctx[13]
2878
+ panoIndex: /*panoIndex*/ ctx[3],
2879
+ floorplanData: /*floorplanData*/ ctx[9],
2880
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[10],
2881
+ cameraImageUrl: /*cameraImageUrl*/ ctx[11]
2909
2882
  }
2910
2883
  ])
2911
2884
  : {};
2912
2885
 
2913
2886
  camera.$set(camera_changes);
2914
2887
 
2915
- if (/*compassEnable*/ ctx[8]) {
2888
+ if (/*compassEnable*/ ctx[6]) {
2916
2889
  if (if_block) {
2917
2890
  if_block.p(ctx, dirty);
2918
2891
 
2919
- if (dirty & /*compassEnable*/ 256) {
2892
+ if (dirty & /*compassEnable*/ 64) {
2920
2893
  internal.transition_in(if_block, 1);
2921
2894
  }
2922
2895
  } else {
@@ -2937,14 +2910,18 @@ function create_if_block(ctx) {
2937
2910
  },
2938
2911
  i(local) {
2939
2912
  if (current) return;
2940
- internal.transition_in(currentfloor.$$.fragment, local);
2913
+
2914
+ for (let i = 0; i < each_value.length; i += 1) {
2915
+ internal.transition_in(each_blocks[i]);
2916
+ }
2917
+
2941
2918
  internal.transition_in(camera.$$.fragment, local);
2942
2919
  internal.transition_in(if_block);
2943
2920
 
2944
2921
  if (!div_intro) {
2945
2922
  internal.add_render_callback(() => {
2946
2923
  div_intro = internal.create_in_transition(div, transition.fade, {
2947
- duration: /*duration*/ ctx[3],
2924
+ duration: /*duration*/ ctx[0],
2948
2925
  easing: easing.linear
2949
2926
  });
2950
2927
 
@@ -2955,29 +2932,107 @@ function create_if_block(ctx) {
2955
2932
  current = true;
2956
2933
  },
2957
2934
  o(local) {
2958
- internal.transition_out(currentfloor.$$.fragment, local);
2935
+ each_blocks = each_blocks.filter(Boolean);
2936
+
2937
+ for (let i = 0; i < each_blocks.length; i += 1) {
2938
+ internal.transition_out(each_blocks[i]);
2939
+ }
2940
+
2959
2941
  internal.transition_out(camera.$$.fragment, local);
2960
2942
  internal.transition_out(if_block);
2961
2943
  current = false;
2962
2944
  },
2963
2945
  d(detaching) {
2964
2946
  if (detaching) internal.detach(div);
2965
- internal.destroy_component(currentfloor);
2947
+ internal.destroy_each(each_blocks, detaching);
2966
2948
  internal.destroy_component(camera);
2967
2949
  if (if_block) if_block.d();
2968
2950
  }
2969
2951
  };
2970
2952
  }
2971
2953
 
2972
- // (40:4) {#if compassEnable}
2954
+ // (23:4) {#each floorplanData.floorDatas as floorData}
2955
+ function create_each_block(ctx) {
2956
+ let currentfloor;
2957
+ let current;
2958
+
2959
+ const currentfloor_spread_levels = [
2960
+ {
2961
+ hoverEnable: /*hoverEnable*/ ctx[5],
2962
+ floorplanData: /*floorplanData*/ ctx[9],
2963
+ getLabelElement: /*getLabelElement*/ ctx[12],
2964
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[7],
2965
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[8]
2966
+ },
2967
+ {
2968
+ floorIndex: /*floorData*/ ctx[13].floorIndex
2969
+ },
2970
+ {
2971
+ isCurrent: /*floorData*/ ctx[13].floorIndex === /*floorIndex*/ ctx[4]
2972
+ }
2973
+ ];
2974
+
2975
+ let currentfloor_props = {};
2976
+
2977
+ for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
2978
+ currentfloor_props = internal.assign(currentfloor_props, currentfloor_spread_levels[i]);
2979
+ }
2980
+
2981
+ currentfloor = new CurrentFloor({ props: currentfloor_props });
2982
+
2983
+ return {
2984
+ c() {
2985
+ internal.create_component(currentfloor.$$.fragment);
2986
+ },
2987
+ m(target, anchor) {
2988
+ internal.mount_component(currentfloor, target, anchor);
2989
+ current = true;
2990
+ },
2991
+ p(ctx, dirty) {
2992
+ const currentfloor_changes = (dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, floorIndex*/ 5040)
2993
+ ? internal.get_spread_update(currentfloor_spread_levels, [
2994
+ dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable*/ 5024 && {
2995
+ hoverEnable: /*hoverEnable*/ ctx[5],
2996
+ floorplanData: /*floorplanData*/ ctx[9],
2997
+ getLabelElement: /*getLabelElement*/ ctx[12],
2998
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[7],
2999
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[8]
3000
+ },
3001
+ dirty & /*floorplanData*/ 512 && {
3002
+ floorIndex: /*floorData*/ ctx[13].floorIndex
3003
+ },
3004
+ dirty & /*floorplanData, floorIndex*/ 528 && {
3005
+ isCurrent: /*floorData*/ ctx[13].floorIndex === /*floorIndex*/ ctx[4]
3006
+ }
3007
+ ])
3008
+ : {};
3009
+
3010
+ currentfloor.$set(currentfloor_changes);
3011
+ },
3012
+ i(local) {
3013
+ if (current) return;
3014
+ internal.transition_in(currentfloor.$$.fragment, local);
3015
+ current = true;
3016
+ },
3017
+ o(local) {
3018
+ internal.transition_out(currentfloor.$$.fragment, local);
3019
+ current = false;
3020
+ },
3021
+ d(detaching) {
3022
+ internal.destroy_component(currentfloor, detaching);
3023
+ }
3024
+ };
3025
+ }
3026
+
3027
+ // (37:4) {#if compassEnable}
2973
3028
  function create_if_block_1(ctx) {
2974
3029
  let compass;
2975
3030
  let current;
2976
3031
 
2977
3032
  compass = new Compass({
2978
3033
  props: {
2979
- floorplanData: /*floorplanData*/ ctx[11],
2980
- northDesc: /*northDesc*/ ctx[0]
3034
+ floorplanData: /*floorplanData*/ ctx[9],
3035
+ northDesc: /*northDesc*/ ctx[2]
2981
3036
  }
2982
3037
  });
2983
3038
 
@@ -2991,8 +3046,8 @@ function create_if_block_1(ctx) {
2991
3046
  },
2992
3047
  p(ctx, dirty) {
2993
3048
  const compass_changes = {};
2994
- if (dirty & /*floorplanData*/ 2048) compass_changes.floorplanData = /*floorplanData*/ ctx[11];
2995
- if (dirty & /*northDesc*/ 1) compass_changes.northDesc = /*northDesc*/ ctx[0];
3049
+ if (dirty & /*floorplanData*/ 512) compass_changes.floorplanData = /*floorplanData*/ ctx[9];
3050
+ if (dirty & /*northDesc*/ 4) compass_changes.northDesc = /*northDesc*/ ctx[2];
2996
3051
  compass.$set(compass_changes);
2997
3052
  },
2998
3053
  i(local) {
@@ -3013,7 +3068,7 @@ function create_if_block_1(ctx) {
3013
3068
  function create_fragment(ctx) {
3014
3069
  let if_block_anchor;
3015
3070
  let current;
3016
- let if_block = /*visible*/ ctx[4] && create_if_block(ctx);
3071
+ let if_block = /*visible*/ ctx[1] && create_if_block(ctx);
3017
3072
 
3018
3073
  return {
3019
3074
  c() {
@@ -3026,11 +3081,11 @@ function create_fragment(ctx) {
3026
3081
  current = true;
3027
3082
  },
3028
3083
  p(ctx, [dirty]) {
3029
- if (/*visible*/ ctx[4]) {
3084
+ if (/*visible*/ ctx[1]) {
3030
3085
  if (if_block) {
3031
3086
  if_block.p(ctx, dirty);
3032
3087
 
3033
- if (dirty & /*visible*/ 16) {
3088
+ if (dirty & /*visible*/ 2) {
3034
3089
  internal.transition_in(if_block, 1);
3035
3090
  }
3036
3091
  } else {
@@ -3066,11 +3121,9 @@ function create_fragment(ctx) {
3066
3121
  }
3067
3122
 
3068
3123
  function instance($$self, $$props, $$invalidate) {
3069
- let { northDesc } = $$props;
3070
- let { pxmm } = $$props;
3071
- let { five } = $$props;
3072
3124
  let { duration = 0 } = $$props;
3073
3125
  let { visible } = $$props;
3126
+ let { northDesc } = $$props;
3074
3127
  let { panoIndex } = $$props;
3075
3128
  let { floorIndex } = $$props;
3076
3129
  let { hoverEnable } = $$props;
@@ -3080,34 +3133,28 @@ function instance($$self, $$props, $$invalidate) {
3080
3133
  let { floorplanData } = $$props;
3081
3134
  let { lastPanoramaLongitude } = $$props;
3082
3135
  let { cameraImageUrl } = $$props;
3083
- let { onRoomHeightClick } = $$props;
3084
3136
  let { getLabelElement } = $$props;
3085
3137
 
3086
3138
  $$self.$$set = $$props => {
3087
- if ('northDesc' in $$props) $$invalidate(0, northDesc = $$props.northDesc);
3088
- if ('pxmm' in $$props) $$invalidate(1, pxmm = $$props.pxmm);
3089
- if ('five' in $$props) $$invalidate(2, five = $$props.five);
3090
- if ('duration' in $$props) $$invalidate(3, duration = $$props.duration);
3091
- if ('visible' in $$props) $$invalidate(4, visible = $$props.visible);
3092
- if ('panoIndex' in $$props) $$invalidate(5, panoIndex = $$props.panoIndex);
3093
- if ('floorIndex' in $$props) $$invalidate(6, floorIndex = $$props.floorIndex);
3094
- if ('hoverEnable' in $$props) $$invalidate(7, hoverEnable = $$props.hoverEnable);
3095
- if ('compassEnable' in $$props) $$invalidate(8, compassEnable = $$props.compassEnable);
3096
- if ('roomLabelsEnable' in $$props) $$invalidate(9, roomLabelsEnable = $$props.roomLabelsEnable);
3097
- if ('ruleLabelsEnable' in $$props) $$invalidate(10, ruleLabelsEnable = $$props.ruleLabelsEnable);
3098
- if ('floorplanData' in $$props) $$invalidate(11, floorplanData = $$props.floorplanData);
3099
- if ('lastPanoramaLongitude' in $$props) $$invalidate(12, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
3100
- if ('cameraImageUrl' in $$props) $$invalidate(13, cameraImageUrl = $$props.cameraImageUrl);
3101
- if ('onRoomHeightClick' in $$props) $$invalidate(14, onRoomHeightClick = $$props.onRoomHeightClick);
3102
- if ('getLabelElement' in $$props) $$invalidate(15, getLabelElement = $$props.getLabelElement);
3139
+ if ('duration' in $$props) $$invalidate(0, duration = $$props.duration);
3140
+ if ('visible' in $$props) $$invalidate(1, visible = $$props.visible);
3141
+ if ('northDesc' in $$props) $$invalidate(2, northDesc = $$props.northDesc);
3142
+ if ('panoIndex' in $$props) $$invalidate(3, panoIndex = $$props.panoIndex);
3143
+ if ('floorIndex' in $$props) $$invalidate(4, floorIndex = $$props.floorIndex);
3144
+ if ('hoverEnable' in $$props) $$invalidate(5, hoverEnable = $$props.hoverEnable);
3145
+ if ('compassEnable' in $$props) $$invalidate(6, compassEnable = $$props.compassEnable);
3146
+ if ('roomLabelsEnable' in $$props) $$invalidate(7, roomLabelsEnable = $$props.roomLabelsEnable);
3147
+ if ('ruleLabelsEnable' in $$props) $$invalidate(8, ruleLabelsEnable = $$props.ruleLabelsEnable);
3148
+ if ('floorplanData' in $$props) $$invalidate(9, floorplanData = $$props.floorplanData);
3149
+ if ('lastPanoramaLongitude' in $$props) $$invalidate(10, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
3150
+ if ('cameraImageUrl' in $$props) $$invalidate(11, cameraImageUrl = $$props.cameraImageUrl);
3151
+ if ('getLabelElement' in $$props) $$invalidate(12, getLabelElement = $$props.getLabelElement);
3103
3152
  };
3104
3153
 
3105
3154
  return [
3106
- northDesc,
3107
- pxmm,
3108
- five,
3109
3155
  duration,
3110
3156
  visible,
3157
+ northDesc,
3111
3158
  panoIndex,
3112
3159
  floorIndex,
3113
3160
  hoverEnable,
@@ -3117,7 +3164,6 @@ function instance($$self, $$props, $$invalidate) {
3117
3164
  floorplanData,
3118
3165
  lastPanoramaLongitude,
3119
3166
  cameraImageUrl,
3120
- onRoomHeightClick,
3121
3167
  getLabelElement
3122
3168
  ];
3123
3169
  }
@@ -3133,68 +3179,41 @@ class Main extends internal.SvelteComponent {
3133
3179
  create_fragment,
3134
3180
  internal.safe_not_equal,
3135
3181
  {
3136
- northDesc: 0,
3137
- pxmm: 1,
3138
- five: 2,
3139
- duration: 3,
3140
- visible: 4,
3141
- panoIndex: 5,
3142
- floorIndex: 6,
3143
- hoverEnable: 7,
3144
- compassEnable: 8,
3145
- roomLabelsEnable: 9,
3146
- ruleLabelsEnable: 10,
3147
- floorplanData: 11,
3148
- lastPanoramaLongitude: 12,
3149
- cameraImageUrl: 13,
3150
- onRoomHeightClick: 14,
3151
- getLabelElement: 15
3182
+ duration: 0,
3183
+ visible: 1,
3184
+ northDesc: 2,
3185
+ panoIndex: 3,
3186
+ floorIndex: 4,
3187
+ hoverEnable: 5,
3188
+ compassEnable: 6,
3189
+ roomLabelsEnable: 7,
3190
+ ruleLabelsEnable: 8,
3191
+ floorplanData: 9,
3192
+ lastPanoramaLongitude: 10,
3193
+ cameraImageUrl: 11,
3194
+ getLabelElement: 12
3152
3195
  },
3153
3196
  add_css
3154
3197
  );
3155
3198
  }
3156
3199
  }
3157
3200
 
3158
- /**
3159
- * 传入一个 Promise
3160
- * 无异常,返回 [null, data]
3161
- * 有异常,则返回 [Error, undefined]
3162
- * 用于替代 try&catch 处理 await 异常的方案
3163
- */
3164
- function to(promise) {
3165
- return __awaiter(this, void 0, void 0, function* () {
3166
- try {
3167
- const data = yield promise;
3168
- return [null, data];
3169
- }
3170
- catch (error) {
3171
- if (error instanceof Error)
3172
- return [error, null];
3173
- return [new Error(''), null];
3174
- }
3175
- });
3176
- }
3177
-
3178
- function formatOutlines(outlines) {
3179
- return __awaiter(this, void 0, void 0, function* () {
3180
- const headers = new Headers({ 'Content-Type': 'text/plain' });
3181
- const getOutlineItem = function (item) {
3182
- return __awaiter(this, void 0, void 0, function* () {
3183
- const outlineItem = {
3184
- index: item.index,
3185
- url: item.url,
3186
- svgUrl: item.svg_url,
3187
- };
3188
- if (item.svg_url) {
3189
- const svgContent = yield fetch(item.svg_url, { headers }).then((res) => res.text());
3190
- outlineItem.svgContent = svgContent;
3191
- }
3192
- return outlineItem;
3193
- });
3201
+ async function formatOutlines(outlines) {
3202
+ const headers = new Headers({ 'Content-Type': 'text/plain' });
3203
+ const getOutlineItem = async function (item) {
3204
+ const outlineItem = {
3205
+ index: item.index,
3206
+ url: item.url,
3207
+ svgUrl: item.svg_url,
3194
3208
  };
3195
- const svgOutlineItems = yield Promise.all(outlines.map(getOutlineItem));
3196
- return svgOutlineItems;
3197
- });
3209
+ if (item.svg_url) {
3210
+ const svgContent = await fetch(item.svg_url, { headers }).then((res) => res.text());
3211
+ outlineItem.svgContent = svgContent;
3212
+ }
3213
+ return outlineItem;
3214
+ };
3215
+ const svgOutlineItems = await Promise.all(outlines.map(getOutlineItem));
3216
+ return svgOutlineItems;
3198
3217
  }
3199
3218
  function formatRoom(data) {
3200
3219
  const floorplanRoomItem = {
@@ -3240,21 +3259,19 @@ function formatFloorplanEntrance(data) {
3240
3259
  };
3241
3260
  return floorplanEntrance;
3242
3261
  }
3243
- function formatData(data) {
3244
- return __awaiter(this, void 0, void 0, function* () {
3245
- const outlines = yield formatOutlines(data.outlines);
3246
- const bounding = data.computed_data.bounding;
3247
- const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
3248
- const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
3249
- const floorplanData = {
3250
- outlines,
3251
- entrance,
3252
- bounding,
3253
- floorDatas,
3254
- observers: data.computed_data.observers.map(formateFloorplanObserver),
3255
- };
3256
- return floorplanData;
3257
- });
3262
+ async function formatData(data) {
3263
+ const outlines = await formatOutlines(data.outlines);
3264
+ const bounding = data.computed_data.bounding;
3265
+ const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
3266
+ const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
3267
+ const floorplanData = {
3268
+ outlines,
3269
+ entrance,
3270
+ bounding,
3271
+ floorDatas,
3272
+ observers: data.computed_data.observers.map(formateFloorplanObserver),
3273
+ };
3274
+ return floorplanData;
3258
3275
  }
3259
3276
 
3260
3277
  /**
@@ -3402,38 +3419,21 @@ function getPxmm(five, container, floorIndex, options) {
3402
3419
  return pxmm;
3403
3420
  }
3404
3421
 
3405
- function changeMode(five, ...changeModeParams) {
3406
- return __awaiter(this, void 0, void 0, function* () {
3407
- const [changeModeError] = yield to(five.changeMode(...changeModeParams));
3408
- if (changeModeError)
3409
- throw changeModeError;
3410
- yield new Promise((reslove, reject) => {
3411
- five.once('initAnimationEnded', reslove);
3412
- const handleModeChange = (mode) => {
3413
- if (mode !== changeModeParams[0])
3414
- reject('changeMode 被中断');
3415
- five.off('modeChange', handleModeChange);
3416
- };
3417
- five.on('modeChange', handleModeChange);
3418
- });
3422
+ async function changeMode(five, ...changeModeParams) {
3423
+ const [changeModeError] = await to(five.changeMode(...changeModeParams));
3424
+ if (changeModeError)
3425
+ throw changeModeError;
3426
+ await new Promise((reslove, reject) => {
3427
+ five.once('initAnimationEnded', reslove);
3428
+ const handleModeChange = (mode) => {
3429
+ if (mode !== changeModeParams[0])
3430
+ reject('changeMode 被中断');
3431
+ five.off('modeChange', handleModeChange);
3432
+ };
3433
+ five.on('modeChange', handleModeChange);
3419
3434
  });
3420
3435
  }
3421
3436
 
3422
- var FloorplanErrorType;
3423
- (function (FloorplanErrorType) {
3424
- FloorplanErrorType["UnknownError"] = "UnknowError";
3425
- FloorplanErrorType["DataNotLoaded"] = "DataNotLoaded";
3426
- FloorplanErrorType["BreakOffByHide"] = "BreakOffByHide";
3427
- FloorplanErrorType["ModelNotLoaded"] = "ModelNotLoaded";
3428
- FloorplanErrorType["ChangeModeError"] = "ChangeModeError";
3429
- FloorplanErrorType["UpdateCameraError"] = "UpdateCameraError";
3430
- FloorplanErrorType["DifferentShowParams"] = "DifferentShowParams";
3431
- })(FloorplanErrorType || (FloorplanErrorType = {}));
3432
- /** 户型图展示 & 模型消失的默认时间 */
3433
- const SHOW_ANIME_DURATION = 500;
3434
- /** Five camera 默认 fov */
3435
- const FIVE_CAMERA_DEFAULT_FOV = 80;
3436
-
3437
3437
  /**
3438
3438
  * 比较两个数字近似相等
3439
3439
  * @param num1 数字1
@@ -3460,32 +3460,30 @@ function checkShowState(five$1, showState) {
3460
3460
  * 2. 内置了相应的动画时间计算
3461
3461
  * 3. 纠正成功会返回 true,失败「可能会被用户行为中断」会返回 false
3462
3462
  */
3463
- function correctFiveState(five$1, showState, userAction = true) {
3464
- return __awaiter(this, void 0, void 0, function* () {
3465
- // 当前已满足状态,不需要变更
3463
+ async function correctFiveState(five$1, showState, userAction = true) {
3464
+ // 当前已满足状态,不需要变更
3465
+ const result = checkShowState(five$1, showState);
3466
+ if (result === true)
3467
+ return;
3468
+ // 纠正 mode
3469
+ if (five$1.currentMode !== five.Five.Mode.Floorplan) {
3470
+ const [changeModeError] = await to(changeMode(five$1, five.Five.Mode.Floorplan, showState, undefined, userAction));
3471
+ if (changeModeError)
3472
+ throw changeModeError;
3473
+ // changeMode 是异步行为,可能会被打断,需要在结束后加一次判断
3466
3474
  const result = checkShowState(five$1, showState);
3467
- if (result === true)
3468
- return;
3469
- // 纠正 mode
3470
- if (five$1.currentMode !== five.Five.Mode.Floorplan) {
3471
- const [changeModeError] = yield to(changeMode(five$1, five.Five.Mode.Floorplan, showState, undefined, userAction));
3472
- if (changeModeError)
3473
- throw changeModeError;
3474
- // changeMode 是异步行为,可能会被打断,需要在结束后加一次判断
3475
- const result = checkShowState(five$1, showState);
3476
- if (result === false)
3477
- throw new Error(FloorplanErrorType.ChangeModeError);
3478
- return;
3479
- }
3480
- // 纠正相机状态
3481
- // 根据 latitude、longitude、fov 计算动画时间,最多 1s
3482
- const { latitude, longitude, fov } = five$1.getCurrentState();
3483
- const time = Math.min(1000, Math.max(200, Math.abs(latitude - Math.PI / 2) * 1000, (longitude > Math.PI ? 2 * Math.PI - longitude : longitude) * 500, Math.abs(fov - showState.fov) * 10));
3484
- const [updateCameraError] = yield to(five$1.updateCamera(showState, time, userAction));
3485
- if (updateCameraError)
3486
- throw new Error(FloorplanErrorType.UpdateCameraError);
3475
+ if (result === false)
3476
+ throw new Error(FloorplanErrorType.ChangeModeError);
3487
3477
  return;
3488
- });
3478
+ }
3479
+ // 纠正相机状态
3480
+ // 根据 latitude、longitude、fov 计算动画时间,最多 1s
3481
+ const { latitude, longitude, fov } = five$1.getCurrentState();
3482
+ const time = Math.min(1000, Math.max(200, Math.abs(latitude - Math.PI / 2) * 1000, (longitude > Math.PI ? 2 * Math.PI - longitude : longitude) * 500, Math.abs(fov - showState.fov) * 10));
3483
+ const [updateCameraError] = await to(five$1.updateCamera(showState, time, userAction));
3484
+ if (updateCameraError)
3485
+ throw new Error(FloorplanErrorType.UpdateCameraError);
3486
+ return;
3489
3487
  }
3490
3488
 
3491
3489
  function changeModelCanvasOpacity(five, opacity, duration = 300) {
@@ -3504,35 +3502,6 @@ function changeModelCanvasOpacity(five, opacity, duration = 300) {
3504
3502
  });
3505
3503
  }
3506
3504
 
3507
- /**
3508
- * 把第一个参数传入第二个参数(函数)中并执行
3509
- * 一般用于执行函数后返回变量。
3510
- * @param {any} something
3511
- * @param {function} callback
3512
- * @return {any}
3513
- */
3514
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3515
- function tap(something, callback) {
3516
- callback(something);
3517
- return something;
3518
- }
3519
-
3520
- /**
3521
- * 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
3522
- * @param object
3523
- * @param props 排除的属性
3524
- * @return
3525
- */
3526
- function omit(object, props) {
3527
- return tap({}, (result) => {
3528
- for (const name in object) {
3529
- if (props.indexOf(name) !== -1)
3530
- continue;
3531
- result[name] = object[name];
3532
- }
3533
- });
3534
- }
3535
-
3536
3505
  const MODEL_FLOORPLAN_PLUGIN_NAME = 'modelFloorplanPlugin';
3537
3506
  class ModelFloorplanPluginController {
3538
3507
  constructor(five$1, params) {
@@ -3719,12 +3688,12 @@ class ModelFloorplanPluginController {
3719
3688
  enumerable: true,
3720
3689
  configurable: true,
3721
3690
  writable: true,
3722
- value: (opts) => __awaiter(this, void 0, void 0, function* () {
3723
- var _b, _c;
3691
+ value: async (opts) => {
3692
+ var _a, _b;
3724
3693
  // 已经在展示中了
3725
3694
  if (!this.showPromise && this.visible)
3726
3695
  return true;
3727
- if (!((_b = this.five.model) === null || _b === void 0 ? void 0 : _b.loaded))
3696
+ if (!((_a = this.five.model) === null || _a === void 0 ? void 0 : _a.loaded))
3728
3697
  throw new Error(FloorplanErrorType.ModelNotLoaded);
3729
3698
  if (!this.floorplanData)
3730
3699
  throw new Error(FloorplanErrorType.DataNotLoaded);
@@ -3734,18 +3703,18 @@ class ModelFloorplanPluginController {
3734
3703
  if (!!this.showPromise && sameWithLastOpts)
3735
3704
  return this.showPromise;
3736
3705
  if (!!this.showPromise && !sameWithLastOpts)
3737
- (_c = this.showRejection) === null || _c === void 0 ? void 0 : _c.call(this, FloorplanErrorType.DifferentShowParams);
3706
+ (_b = this.showRejection) === null || _b === void 0 ? void 0 : _b.call(this, FloorplanErrorType.DifferentShowParams);
3738
3707
  }
3739
3708
  this.ModelFloorplanPluginsShowOpts = opts;
3740
- const getShowPromise = () => __awaiter(this, void 0, void 0, function* () {
3741
- var _d, _e;
3709
+ const getShowPromise = async () => {
3710
+ var _a, _b;
3742
3711
  let hasRejected = false;
3743
3712
  let externalErrorMsg;
3744
3713
  this.showRejection = (errorMsg) => {
3745
3714
  hasRejected = true;
3746
3715
  externalErrorMsg = errorMsg;
3747
3716
  };
3748
- const [correctError] = yield to(correctFiveState(this.five, this.showState, opts === null || opts === void 0 ? void 0 : opts.userAction));
3717
+ const [correctError] = await to(correctFiveState(this.five, this.showState, opts === null || opts === void 0 ? void 0 : opts.userAction));
3749
3718
  if (correctError)
3750
3719
  throw correctError;
3751
3720
  // 异步结束要判断当前是不是被中断了,是不是调用了隐藏
@@ -3764,7 +3733,7 @@ class ModelFloorplanPluginController {
3764
3733
  this.floorIndex = opts.floorIndex;
3765
3734
  this.five.model.show(this.floorIndex);
3766
3735
  // 模型消失, 渲染户型图
3767
- const modelOpacity = (_e = (_d = opts === null || opts === void 0 ? void 0 : opts.modelOpacity) !== null && _d !== void 0 ? _d : this.configs.modelOpacity) !== null && _e !== void 0 ? _e : 1;
3736
+ const modelOpacity = (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.modelOpacity) !== null && _a !== void 0 ? _a : this.configs.modelOpacity) !== null && _b !== void 0 ? _b : 1;
3768
3737
  const renderDuration = (opts === null || opts === void 0 ? void 0 : opts.immediately) ? 0 : SHOW_ANIME_DURATION;
3769
3738
  changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
3770
3739
  this.render(renderDuration);
@@ -3772,7 +3741,7 @@ class ModelFloorplanPluginController {
3772
3741
  this.five.on('wantsGesture', this.handleWantsGesture);
3773
3742
  this.five.on('wantsTapGesture', this.handleWantsTapGesture);
3774
3743
  return true;
3775
- });
3744
+ };
3776
3745
  const showPromise = getShowPromise()
3777
3746
  .then(() => {
3778
3747
  var _a;
@@ -3794,7 +3763,7 @@ class ModelFloorplanPluginController {
3794
3763
  });
3795
3764
  this.showPromise = showPromise;
3796
3765
  return showPromise;
3797
- })
3766
+ }
3798
3767
  });
3799
3768
  /** 隐藏户型图 */
3800
3769
  Object.defineProperty(this, "hide", {
@@ -3824,8 +3793,13 @@ class ModelFloorplanPluginController {
3824
3793
  configurable: true,
3825
3794
  writable: true,
3826
3795
  value: (shownFloor) => {
3827
- if (shownFloor === null)
3796
+ if (this.floorIndex === shownFloor)
3828
3797
  return;
3798
+ if (shownFloor === null) {
3799
+ const panoIndex = this.five.getCurrentState().panoIndex;
3800
+ this.floorIndex = this.five.work.observers[panoIndex].floorIndex;
3801
+ return;
3802
+ }
3829
3803
  this.floorIndex = shownFloor;
3830
3804
  this.updateSize();
3831
3805
  this.render();
@@ -3938,7 +3912,9 @@ class ModelFloorplanPluginController {
3938
3912
  enumerable: true,
3939
3913
  configurable: true,
3940
3914
  writable: true,
3941
- value: ({ latitude, longitude }, isFinal) => __awaiter(this, void 0, void 0, function* () {
3915
+ value: async ({ latitude, longitude }, isFinal) => {
3916
+ if (this.five.getCurrentState().mode !== 'Floorplan')
3917
+ return;
3942
3918
  if (this.configs.autoShowEnable === false)
3943
3919
  return;
3944
3920
  // 如果操作结束后,户型图还在展示中,初始化模型状态
@@ -3959,16 +3935,16 @@ class ModelFloorplanPluginController {
3959
3935
  const longitudeVisible = longitude < 30 * (Math.PI / 180) || longitude > 330 * (Math.PI / 180);
3960
3936
  if (isFinal && !this.visible && latitudeVisible && longitudeVisible) {
3961
3937
  // 当手指离开时需要等惯性结束之后在进行判断
3962
- const handleInteriaPan = (any, isFinal) => __awaiter(this, void 0, void 0, function* () {
3938
+ const handleInteriaPan = async (any, isFinal) => {
3963
3939
  if (!isFinal)
3964
3940
  return;
3965
3941
  this.five.off('interiaPan', handleInteriaPan);
3966
- yield this.show({ isAutoShow: true });
3967
- });
3942
+ await this.show({ isAutoShow: true });
3943
+ };
3968
3944
  this.five.on('interiaPan', handleInteriaPan);
3969
3945
  return;
3970
3946
  }
3971
- })
3947
+ }
3972
3948
  });
3973
3949
  this.five = five$1;
3974
3950
  this.hooks = new five.Subscribe();
@@ -3982,9 +3958,9 @@ class ModelFloorplanPluginController {
3982
3958
  left: '50%',
3983
3959
  top: '50%',
3984
3960
  transform: 'translate(-50%, -50%)',
3985
- pointerEvents: 'none',
3986
3961
  zIndex: 10,
3987
3962
  });
3963
+ this.five.addExtraElement(this.container);
3988
3964
  // 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
3989
3965
  this.five.model.loaded ? this.handleModelLoaded() : five$1.once('modelLoaded', this.handleModelLoaded);
3990
3966
  five$1.once('dispose', this.dispose);
@@ -3995,12 +3971,10 @@ class ModelFloorplanPluginController {
3995
3971
  five$1.on('modelShownFloorChange', this.onModelShownFloorChange);
3996
3972
  }
3997
3973
  /** 加载户型图数据 */
3998
- load(data) {
3999
- return __awaiter(this, void 0, void 0, function* () {
4000
- const copyData = JSON.parse(JSON.stringify(data));
4001
- this.floorplanData = yield formatData(copyData);
4002
- this.render();
4003
- });
3974
+ async load(data) {
3975
+ const copyData = JSON.parse(JSON.stringify(data));
3976
+ this.floorplanData = await formatData(copyData);
3977
+ this.render();
4004
3978
  }
4005
3979
  /** 把插件的渲染DOM插入到对应的容器中去 */
4006
3980
  appendTo(wrapper) {
@@ -4011,8 +3985,6 @@ class ModelFloorplanPluginController {
4011
3985
  /** 更改户型图楼层 */
4012
3986
  changeFloor(floorIndex) {
4013
3987
  this.five.model.show(floorIndex);
4014
- this.floorIndex = floorIndex;
4015
- this.render();
4016
3988
  }
4017
3989
  changeConfigs(params) {
4018
3990
  Object.assign(this.configs, params);
@@ -4027,10 +3999,9 @@ class ModelFloorplanPluginController {
4027
3999
  return;
4028
4000
  const { northDesc, hoverEnable, cameraImageUrl, getLabelElement, roomLabelsEnable, compassEnable, ruleLabelsEnable } = this.configs;
4029
4001
  const props = {
4030
- northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
4031
- five: this.five,
4032
- pxmm: this.pxmm,
4033
4002
  cameraImageUrl,
4003
+ getLabelElement,
4004
+ northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
4034
4005
  visible: this.visible,
4035
4006
  duration: duration !== null && duration !== void 0 ? duration : 0,
4036
4007
  panoIndex: this.panoIndex,
@@ -4041,8 +4012,6 @@ class ModelFloorplanPluginController {
4041
4012
  ruleLabelsEnable: ruleLabelsEnable !== null && ruleLabelsEnable !== void 0 ? ruleLabelsEnable : true,
4042
4013
  roomLabelsEnable: roomLabelsEnable !== null && roomLabelsEnable !== void 0 ? roomLabelsEnable : true,
4043
4014
  lastPanoramaLongitude: this.lastPanoramaLongitude,
4044
- getLabelElement,
4045
- onRoomHeightClick: this.handleClick,
4046
4015
  };
4047
4016
  if (!this.app) {
4048
4017
  this.app = new Main({