@realsee/dnalogel 2.0.0-alpha.12 → 2.0.0-alpha.13

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 (101) hide show
  1. package/dist/CSS3DRenderPlugin/index.js +17 -14
  2. package/dist/CameraMovementPlugin/index.js +40 -15
  3. package/dist/ModelChassisCompassPlugin/index.js +32 -6
  4. package/dist/ModelEntryDoorGuidePlugin/index.js +48 -18
  5. package/dist/ModelItemLabelPlugin/index.js +18 -17
  6. package/dist/ModelRoomLabelPlugin/index.js +67 -26
  7. package/dist/PanoCompassPlugin/index.js +311 -164
  8. package/dist/PanoCursorRaycasterPlugin/index.js +5 -3
  9. package/dist/PanoMeasurePlugin/index.js +1337 -583
  10. package/dist/PanoRulerPlugin/index.js +32 -5
  11. package/dist/PanoSpatialTagPlugin/index.js +64 -29
  12. package/dist/floorplan/ModelFloorplanPlugin/index.js +586 -362
  13. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +164 -72
  14. package/dist/floorplan/TopviewFloorplanPlugin/index.js +311 -153
  15. package/dist/index.es.js +2663 -1341
  16. package/dist/index.js +2667 -1345
  17. package/dist/index.umd.js +2667 -1345
  18. package/docs/assets/main.js +1 -1
  19. package/docs/classes/ModelRoomLabelController.html +6 -6
  20. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  21. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  22. package/docs/interfaces/LineJson.html +1 -1
  23. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  24. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  25. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  26. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  27. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  28. package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
  29. package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
  30. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  31. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  32. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  33. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  34. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  35. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  36. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  37. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  38. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  39. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  40. package/docs/interfaces/PointJson.html +1 -1
  41. package/docs/interfaces/RoomLabel.html +7 -7
  42. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +1 -1
  43. package/docs/modules.html +12 -12
  44. package/libs/CSS3DRenderPlugin/index.js +16 -13
  45. package/libs/CameraMovementPlugin/index.js +24 -15
  46. package/libs/ModelChassisCompassPlugin/index.js +14 -5
  47. package/libs/ModelEntryDoorGuidePlugin/index.js +24 -12
  48. package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +12 -10
  49. package/libs/ModelItemLabelPlugin/index.js +5 -3
  50. package/libs/ModelItemLabelPlugin/utils/parseData.js +1 -4
  51. package/libs/ModelRoomLabelPlugin/Controller.js +64 -23
  52. package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +3 -3
  53. package/libs/PanoCompassPlugin/index.js +225 -128
  54. package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
  55. package/libs/PanoMeasurePlugin/Controller/BaseController.js +68 -13
  56. package/libs/PanoMeasurePlugin/Controller/EditController.js +267 -154
  57. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +40 -20
  58. package/libs/PanoMeasurePlugin/Controller/WatchController.js +234 -152
  59. package/libs/PanoMeasurePlugin/Controller/index.js +131 -47
  60. package/libs/PanoMeasurePlugin/Model/index.js +30 -5
  61. package/libs/PanoMeasurePlugin/Model/line.js +60 -10
  62. package/libs/PanoMeasurePlugin/Model/point.js +24 -4
  63. package/libs/PanoMeasurePlugin/Model/polyline.js +20 -3
  64. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +59 -14
  65. package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +23 -8
  66. package/libs/PanoMeasurePlugin/Modules/GuideController.js +61 -26
  67. package/libs/PanoMeasurePlugin/Modules/Magnifier.js +60 -10
  68. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +83 -37
  69. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +52 -17
  70. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +61 -30
  71. package/libs/PanoMeasurePlugin/utils/distanceDom.js +3 -2
  72. package/libs/PanoMeasurePlugin/utils/line.js +8 -7
  73. package/libs/PanoRulerPlugin/index.js +16 -5
  74. package/libs/PanoSpatialTagPlugin/index.js +11 -9
  75. package/libs/floorplan/Components/BaseImage.js +10 -5
  76. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +3 -1
  77. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +5 -6
  78. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +7 -2
  79. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +3 -1
  80. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +456 -273
  81. package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +33 -22
  82. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +3 -1
  83. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +97 -36
  84. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +231 -108
  85. package/libs/floorplan/utils/formatData.js +43 -28
  86. package/libs/floorplan/utils/formatPosition.js +1 -1
  87. package/libs/shared-utils/Subscribe.js +8 -1
  88. package/libs/shared-utils/animationFrame/BetterTween.js +47 -18
  89. package/libs/shared-utils/createCanvasTextTexture.js +6 -5
  90. package/libs/shared-utils/five/changeMode.js +23 -12
  91. package/libs/shared-utils/getPxmm.js +1 -1
  92. package/libs/shared-utils/math/evenNumber.js +1 -1
  93. package/libs/shared-utils/three/loadFbxObj.js +20 -9
  94. package/libs/shared-utils/three/loadTexture.js +17 -6
  95. package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +2 -1
  96. package/libs/shared-utils/tinyEJSrender.js +36 -6
  97. package/libs/shared-utils/to.js +21 -10
  98. package/libs/shared-utils/useDebounce.js +1 -1
  99. package/libs/shared-utils/useThrottle.js +2 -1
  100. package/package.json +1 -1
  101. package/CHANGELOG.md +0 -41
@@ -3,12 +3,63 @@ import { uiWrapperStyle, operatingSpaceStyle, controllerBackgroundStyle, buttonG
3
3
  import { MainBtnController } from './MainBtnController';
4
4
  import Revoke from './Revoke';
5
5
  export class UIController {
6
- revoke;
7
- container;
8
- mainController;
9
- disposers = [];
10
- measureController;
11
6
  constructor(measureController, params) {
7
+ Object.defineProperty(this, "revoke", {
8
+ enumerable: true,
9
+ configurable: true,
10
+ writable: true,
11
+ value: void 0
12
+ });
13
+ Object.defineProperty(this, "container", {
14
+ enumerable: true,
15
+ configurable: true,
16
+ writable: true,
17
+ value: void 0
18
+ });
19
+ Object.defineProperty(this, "mainController", {
20
+ enumerable: true,
21
+ configurable: true,
22
+ writable: true,
23
+ value: void 0
24
+ });
25
+ Object.defineProperty(this, "disposers", {
26
+ enumerable: true,
27
+ configurable: true,
28
+ writable: true,
29
+ value: []
30
+ });
31
+ Object.defineProperty(this, "measureController", {
32
+ enumerable: true,
33
+ configurable: true,
34
+ writable: true,
35
+ value: void 0
36
+ });
37
+ Object.defineProperty(this, "handleExit", {
38
+ enumerable: true,
39
+ configurable: true,
40
+ writable: true,
41
+ value: () => {
42
+ const exitIcon = this.container.querySelector('.fpm__exit-icon');
43
+ const exitItem = this.container.querySelector('.fpm__exit');
44
+ if (!exitItem || !exitIcon)
45
+ throw new Error('cannot find dom');
46
+ Object.assign(exitItem.style, exitItemStyle);
47
+ Object.assign(exitIcon === null || exitIcon === void 0 ? void 0 : exitIcon.style, exitIconStyle);
48
+ const onMouseEnter = () => (exitItem.style.opacity = '1');
49
+ const onMouseLeave = () => (exitItem.style.opacity = '0.7');
50
+ const handleClick = () => {
51
+ this.measureController.disable();
52
+ };
53
+ exitIcon.addEventListener('click', handleClick);
54
+ exitIcon.addEventListener('mouseenter', onMouseEnter);
55
+ exitIcon.addEventListener('mouseleave', onMouseLeave);
56
+ return () => {
57
+ exitIcon.removeEventListener('click', handleClick);
58
+ exitIcon.removeEventListener('mouseenter', onMouseEnter);
59
+ exitIcon.removeEventListener('mouseleave', onMouseLeave);
60
+ };
61
+ }
62
+ });
12
63
  this.measureController = measureController;
13
64
  this.container = document.createElement('div');
14
65
  this.container.innerHTML = htmlString;
@@ -18,8 +69,8 @@ export class UIController {
18
69
  const UIItems = this.container.querySelectorAll('.fpm__ui-item');
19
70
  const bgDom = this.container.querySelector('.fpm_ui-bg');
20
71
  const operatingSpaceDom = this.container.querySelector('.fpm_operating-space');
21
- Object.assign(bgDom?.style, controllerBackgroundStyle);
22
- Object.assign(operatingSpaceDom?.style, operatingSpaceStyle);
72
+ Object.assign(bgDom === null || bgDom === void 0 ? void 0 : bgDom.style, controllerBackgroundStyle);
73
+ Object.assign(operatingSpaceDom === null || operatingSpaceDom === void 0 ? void 0 : operatingSpaceDom.style, operatingSpaceStyle);
23
74
  Object.assign(this.container.style, uiWrapperStyle);
24
75
  UIItems.forEach((item) => Object.assign(item.style, buttonGroupStyle));
25
76
  textDoms.forEach((item) => Object.assign(item.style, textStyle));
@@ -37,33 +88,13 @@ export class UIController {
37
88
  return this;
38
89
  }
39
90
  hide() {
91
+ var _a, _b;
40
92
  this.container.style.opacity = '0';
41
93
  this.container.style.transform = 'translate(0, 10px)';
42
- this.revoke?.dispose();
43
- this.mainController?.dispose();
94
+ (_a = this.revoke) === null || _a === void 0 ? void 0 : _a.dispose();
95
+ (_b = this.mainController) === null || _b === void 0 ? void 0 : _b.dispose();
44
96
  this.disposers.forEach((disposer) => disposer());
45
97
  this.disposers = [];
46
98
  return this;
47
99
  }
48
- handleExit = () => {
49
- const exitIcon = this.container.querySelector('.fpm__exit-icon');
50
- const exitItem = this.container.querySelector('.fpm__exit');
51
- if (!exitItem || !exitIcon)
52
- throw new Error('cannot find dom');
53
- Object.assign(exitItem.style, exitItemStyle);
54
- Object.assign(exitIcon?.style, exitIconStyle);
55
- const onMouseEnter = () => (exitItem.style.opacity = '1');
56
- const onMouseLeave = () => (exitItem.style.opacity = '0.7');
57
- const handleClick = () => {
58
- this.measureController.disable();
59
- };
60
- exitIcon.addEventListener('click', handleClick);
61
- exitIcon.addEventListener('mouseenter', onMouseEnter);
62
- exitIcon.addEventListener('mouseleave', onMouseLeave);
63
- return () => {
64
- exitIcon.removeEventListener('click', handleClick);
65
- exitIcon.removeEventListener('mouseenter', onMouseEnter);
66
- exitIcon.removeEventListener('mouseleave', onMouseLeave);
67
- };
68
- };
69
100
  }
@@ -28,8 +28,9 @@ function createContainerDom(line) {
28
28
  }
29
29
  export function creatDistanceItem(props) {
30
30
  function handleClick() {
31
+ var _a;
31
32
  highlight();
32
- props.clickCallback?.(distanceItem);
33
+ (_a = props.clickCallback) === null || _a === void 0 ? void 0 : _a.call(props, distanceItem);
33
34
  }
34
35
  function highlight() {
35
36
  if (userDistanceItem)
@@ -109,6 +110,6 @@ export function creatDistanceItem(props) {
109
110
  highlight: highlight,
110
111
  unHighlight: unHighlight,
111
112
  };
112
- userDistanceItem?.element ? containerDom.appendChild(userDistanceItem.element) : containerDom.appendChild(contentDom);
113
+ (userDistanceItem === null || userDistanceItem === void 0 ? void 0 : userDistanceItem.element) ? containerDom.appendChild(userDistanceItem.element) : containerDom.appendChild(contentDom);
113
114
  return distanceItem;
114
115
  }
@@ -2,11 +2,12 @@ import { Line as FiveLine } from '@realsee/five/line';
2
2
  import { lightLineOpts, normalLineOpts } from './constants';
3
3
  import { Color } from 'three';
4
4
  export function creatLine(start, end, opts) {
5
- const lineWidth = opts?.lineWidth ?? 2;
6
- const lineColor = opts?.lineColor ?? new Color(0xffffff);
7
- const pointSize = opts?.pointSize ?? 5;
8
- const lineRenderOrder = opts?.lineRenderOrder ?? 10;
9
- const pointsRenderOrder = opts?.lineRenderOrder ?? 20;
5
+ var _a, _b, _c, _d, _e;
6
+ const lineWidth = (_a = opts === null || opts === void 0 ? void 0 : opts.lineWidth) !== null && _a !== void 0 ? _a : 2;
7
+ const lineColor = (_b = opts === null || opts === void 0 ? void 0 : opts.lineColor) !== null && _b !== void 0 ? _b : new Color(0xffffff);
8
+ const pointSize = (_c = opts === null || opts === void 0 ? void 0 : opts.pointSize) !== null && _c !== void 0 ? _c : 5;
9
+ const lineRenderOrder = (_d = opts === null || opts === void 0 ? void 0 : opts.lineRenderOrder) !== null && _d !== void 0 ? _d : 10;
10
+ const pointsRenderOrder = (_e = opts === null || opts === void 0 ? void 0 : opts.lineRenderOrder) !== null && _e !== void 0 ? _e : 20;
10
11
  const line = new FiveLine(start, end);
11
12
  // set line
12
13
  line.setMaterial({ linewidth: lineWidth, color: lineColor });
@@ -18,8 +19,8 @@ export function creatLine(start, end, opts) {
18
19
  const pointMaterial = line.points.material;
19
20
  pointMaterial.depthTest = false;
20
21
  pointMaterial.size = pointSize;
21
- opts?.pointColor && pointMaterial.color.set(opts.pointColor).convertSRGBToLinear();
22
- if (opts?.pointTexture)
22
+ (opts === null || opts === void 0 ? void 0 : opts.pointColor) && pointMaterial.color.set(opts.pointColor).convertSRGBToLinear();
23
+ if (opts === null || opts === void 0 ? void 0 : opts.pointTexture)
23
24
  pointMaterial.map = opts.pointTexture;
24
25
  return line;
25
26
  }
@@ -1,3 +1,12 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
1
10
  import { Five } from '@realsee/five';
2
11
  import { Raycaster, Vector3 } from 'three';
3
12
  import { intersectionOfLine } from '../shared-utils/math/planimetry';
@@ -161,7 +170,7 @@ export const PanoRulerPlugin = (five, params) => {
161
170
  state.loaded = true;
162
171
  return true;
163
172
  };
164
- const load = async (_roomInfo, _roomRules, options) => {
173
+ const load = (_roomInfo, _roomRules, options) => __awaiter(void 0, void 0, void 0, function* () {
165
174
  const roomInfo = _roomInfo || params.roomInfo;
166
175
  const roomRules = _roomRules || params.roomRules;
167
176
  if (!roomInfo || !roomRules) {
@@ -172,9 +181,9 @@ export const PanoRulerPlugin = (five, params) => {
172
181
  return _load(roomInfo, roomRules);
173
182
  }
174
183
  else {
175
- return await new Promise((resolve) => five.once('modelLoaded', () => resolve(_load(roomInfo, roomRules))));
184
+ return yield new Promise((resolve) => five.once('modelLoaded', () => resolve(_load(roomInfo, roomRules))));
176
185
  }
177
- };
186
+ });
178
187
  if (params.roomInfo && params.roomRules) {
179
188
  load(params.roomInfo, params.roomRules);
180
189
  }
@@ -210,7 +219,8 @@ export const PanoRulerPlugin = (five, params) => {
210
219
  }
211
220
  };
212
221
  const freshRule = () => {
213
- const element = five.getElement()?.parentElement;
222
+ var _a;
223
+ const element = (_a = five.getElement()) === null || _a === void 0 ? void 0 : _a.parentElement;
214
224
  if (!element)
215
225
  return;
216
226
  if (!state.loaded)
@@ -353,12 +363,13 @@ export const PanoRulerPlugin = (five, params) => {
353
363
  const nextFrameFreshRule = () => nextFrame(freshRule);
354
364
  const throttleFreshRule = throttle(freshRule, 80);
355
365
  const enable = () => {
366
+ var _a, _b;
356
367
  if (!state.loaded)
357
368
  return false;
358
369
  if (state.enable)
359
370
  return true;
360
371
  $rule.setAttribute('class', 'PanoRulerPlugin' + (state.options.className ? ' ' + state.options.className : ''));
361
- five.getElement()?.parentElement?.append($rule);
372
+ (_b = (_a = five.getElement()) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.append($rule);
362
373
  freshRule();
363
374
  five.on('panoArrived', freshRule);
364
375
  five.on('modeChange', freshRule);
@@ -15,12 +15,13 @@ const MAX_DISTANCE = 3.5;
15
15
  * 空间游走标签插件
16
16
  */
17
17
  export const PanoSpatialTagPlugin = (five, params) => {
18
- let wrapper = params?.container;
19
- const wait = params?.wait ?? 200;
20
- const maxNumberOnScreen = params?.maxNumberOnScreen ?? 3;
21
- const minRad = params?.minRad ?? Math.PI / 4;
22
- const nearTolerance = params?.nearTolerance ?? 100;
23
- const upsideHeight = params?.upsideHeight ?? 1.6;
18
+ var _a, _b, _c, _d, _e, _f;
19
+ let wrapper = params === null || params === void 0 ? void 0 : params.container;
20
+ const wait = (_a = params === null || params === void 0 ? void 0 : params.wait) !== null && _a !== void 0 ? _a : 200;
21
+ const maxNumberOnScreen = (_b = params === null || params === void 0 ? void 0 : params.maxNumberOnScreen) !== null && _b !== void 0 ? _b : 3;
22
+ const minRad = (_c = params === null || params === void 0 ? void 0 : params.minRad) !== null && _c !== void 0 ? _c : Math.PI / 4;
23
+ const nearTolerance = (_d = params === null || params === void 0 ? void 0 : params.nearTolerance) !== null && _d !== void 0 ? _d : 100;
24
+ const upsideHeight = (_e = params === null || params === void 0 ? void 0 : params.upsideHeight) !== null && _e !== void 0 ? _e : 1.6;
24
25
  // const foldPercent = params?.foldPercent ?? 20
25
26
  const css3DRender = CSS3DRenderPlugin(five);
26
27
  const container = document.createElement('div');
@@ -278,12 +279,13 @@ export const PanoSpatialTagPlugin = (five, params) => {
278
279
  */
279
280
  const load = (data) => {
280
281
  state.points = data.points.map(point => {
282
+ var _a, _b;
281
283
  return {
282
284
  id: point.id,
283
285
  position: new THREE.Vector3().fromArray(point.position),
284
286
  normal: new THREE.Vector3().fromArray(point.normal),
285
- replacement: point.replacement ?? {},
286
- weight: point.weight ?? -1,
287
+ replacement: (_a = point.replacement) !== null && _a !== void 0 ? _a : {},
288
+ weight: (_b = point.weight) !== null && _b !== void 0 ? _b : -1,
287
289
  };
288
290
  });
289
291
  if (data.render)
@@ -371,7 +373,7 @@ export const PanoSpatialTagPlugin = (five, params) => {
371
373
  five.off('modeChange', onModeChange);
372
374
  five.off('cameraUpdate', onCameraUpdate);
373
375
  };
374
- if (five?.model?.loaded) {
376
+ if ((_f = five === null || five === void 0 ? void 0 : five.model) === null || _f === void 0 ? void 0 : _f.loaded) {
375
377
  if (!wrapper)
376
378
  wrapper = five.getElement().parentElement;
377
379
  wrapper.appendChild(container);
@@ -24,7 +24,7 @@ function add_css(target) {
24
24
  append_styles(target, "svelte-126ja8e", ".floorplan-plugin__base-image.svelte-126ja8e{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
25
25
  }
26
26
 
27
- // (12:22)
27
+ // (13:22)
28
28
  function create_if_block_1(ctx) {
29
29
  let normalimage;
30
30
  let current;
@@ -58,7 +58,7 @@ function create_if_block_1(ctx) {
58
58
  };
59
59
  }
60
60
 
61
- // (10:2) {#if svgContent}
61
+ // (11:2) {#if svgContent}
62
62
  function create_if_block(ctx) {
63
63
  let svgimage;
64
64
  let current;
@@ -186,6 +186,7 @@ function create_fragment(ctx) {
186
186
  function instance($$self, $$props, $$invalidate) {
187
187
  let imageData;
188
188
  let svgContent;
189
+ var _a, _b;
189
190
  let { floorIndex } = $$props;
190
191
  let { floorplanData } = $$props;
191
192
 
@@ -199,12 +200,16 @@ function instance($$self, $$props, $$invalidate) {
199
200
  $: $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
200
201
  }
201
202
 
202
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
203
- $: $$invalidate(0, svgContent = floorplanData.outlines?.[floorIndex]?.svgContent);
203
+ if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
204
+ $: $$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
205
+ ? void 0
206
+ : _a[floorIndex]) === null || _b === void 0
207
+ ? void 0
208
+ : _b.svgContent);
204
209
  }
205
210
  };
206
211
 
207
- return [svgContent, imageData, floorIndex, floorplanData];
212
+ return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
208
213
  }
209
214
 
210
215
  class Component extends SvelteComponent {
@@ -206,7 +206,9 @@ function instance($$self, $$props, $$invalidate) {
206
206
  const { observers: floorplan_observers } = floorplanData;
207
207
 
208
208
  const handleClick = function (e) {
209
- if (onRoomHeightClick?.(e) === false) return;
209
+ if ((onRoomHeightClick === null || onRoomHeightClick === void 0
210
+ ? void 0
211
+ : onRoomHeightClick(e)) === false) return;
210
212
 
211
213
  // 因为 mouse.offsetX 的兼容性问题,手动计算 mouse offsetX offsetY
212
214
  const boundingClientRect = highlightContainerDom.getBoundingClientRect();
@@ -34,7 +34,7 @@ function get_each_context(ctx, list, i) {
34
34
  return child_ctx;
35
35
  }
36
36
 
37
- // (21:6) {:else}
37
+ // (18:6) {:else}
38
38
  function create_else_block(ctx) {
39
39
  let roommaterial_1;
40
40
  let current;
@@ -68,7 +68,7 @@ function create_else_block(ctx) {
68
68
  };
69
69
  }
70
70
 
71
- // (19:37)
71
+ // (16:37)
72
72
  function create_if_block_1(ctx) {
73
73
  let roommaterial_2;
74
74
  let current;
@@ -102,7 +102,7 @@ function create_if_block_1(ctx) {
102
102
  };
103
103
  }
104
104
 
105
- // (17:6) {#if room.floorType === 1}
105
+ // (14:6) {#if room.floorType === 1}
106
106
  function create_if_block(ctx) {
107
107
  let roommaterial_0;
108
108
  let current;
@@ -136,7 +136,7 @@ function create_if_block(ctx) {
136
136
  };
137
137
  }
138
138
 
139
- // (15:2) {#each rooms as room}
139
+ // (12:2) {#each rooms as room}
140
140
  function create_each_block(ctx) {
141
141
  let svg;
142
142
  let current_block_type_index;
@@ -308,8 +308,7 @@ function instance($$self, $$props, $$invalidate) {
308
308
 
309
309
  $$self.$$.update = () => {
310
310
  if ($$self.$$.dirty & /*floorplanData, floorIndex, pxmm*/ 14) {
311
- $: $$invalidate(0, rooms = floorplanData.floorDatas[floorIndex].rooms.map(room => ({
312
- ...room,
311
+ $: $$invalidate(0, rooms = floorplanData.floorDatas[floorIndex].rooms.map(room => Object.assign(Object.assign({}, room), {
313
312
  path: room.path.map(p => formatFloorplanPoint(p, pxmm, floorplanData.bounding))
314
313
  })));
315
314
  }
@@ -23,7 +23,7 @@ function add_css(target) {
23
23
  append_styles(target, "svelte-5l80pv", ".floorplan-plugin__compass.svelte-5l80pv{position:absolute;left:50%;top:-46px;width:231px;height:41px;will-change:opacity;transform-origin:center 184px}.floorplan-plugin__compass-image.svelte-5l80pv{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-5l80pv{position:absolute;left:50%;top:15px;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:10px;color:#fff}");
24
24
  }
25
25
 
26
- // (12:0) {#if northRad}
26
+ // (13:0) {#if northRad}
27
27
  function create_if_block(ctx) {
28
28
  let div1;
29
29
  let div0;
@@ -90,9 +90,14 @@ function rad2Deg(rad) {
90
90
  }
91
91
 
92
92
  function instance($$self, $$props, $$invalidate) {
93
+ var _a;
93
94
  let { floorplanData } = $$props;
94
95
  let { northDesc } = $$props;
95
- const northRad = floorplanData.entrance?.northRad;
96
+
97
+ const northRad = (_a = floorplanData.entrance) === null || _a === void 0
98
+ ? void 0
99
+ : _a.northRad;
100
+
96
101
  const rotate = !northRad ? 0 : rad2Deg(northRad);
97
102
  const compassTransformStyle = `translateX(-50%) translateZ(10px) rotate(${-rotate + 90}deg)`;
98
103
 
@@ -154,7 +154,9 @@ function instance($$self, $$props, $$invalidate) {
154
154
 
155
155
  $$self.$$.update = () => {
156
156
  if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
157
- $: $$invalidate(2, userConfigElement = getLabelElement?.(room));
157
+ $: $$invalidate(2, userConfigElement = getLabelElement === null || getLabelElement === void 0
158
+ ? void 0
159
+ : getLabelElement(room));
158
160
  }
159
161
  };
160
162