@realsee/dnalogel 2.0.0-alpha.10 → 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 (123) 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/events.type.d.ts +9 -0
  6. package/dist/ModelItemLabelPlugin/index.d.ts +4 -0
  7. package/dist/ModelItemLabelPlugin/index.js +679 -0
  8. package/dist/ModelItemLabelPlugin/typings.d.ts +55 -0
  9. package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
  10. package/dist/ModelRoomLabelPlugin/index.js +71 -28
  11. package/dist/PanoCompassPlugin/index.js +311 -164
  12. package/dist/PanoCursorRaycasterPlugin/index.js +5 -3
  13. package/dist/PanoMeasurePlugin/index.js +1337 -583
  14. package/dist/PanoRulerPlugin/index.js +32 -5
  15. package/dist/PanoSpatialTagPlugin/index.js +73 -38
  16. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +1 -0
  17. package/dist/floorplan/ModelFloorplanPlugin/index.js +678 -439
  18. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +164 -72
  19. package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +1 -0
  20. package/dist/floorplan/TopviewFloorplanPlugin/index.js +403 -230
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.es.js +3596 -1612
  23. package/dist/index.js +3602 -1616
  24. package/dist/index.umd.js +3605 -1620
  25. package/docs/assets/main.js +1 -1
  26. package/docs/assets/search.js +1 -1
  27. package/docs/classes/ModelRoomLabelController.html +6 -6
  28. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  29. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  30. package/docs/index.html +1 -1
  31. package/docs/interfaces/LineJson.html +1 -1
  32. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  33. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  34. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  35. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  36. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  37. package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
  38. package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
  39. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  40. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  41. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  42. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  43. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  44. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  45. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  46. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  47. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  48. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  49. package/docs/interfaces/PointJson.html +1 -1
  50. package/docs/interfaces/RoomLabel.html +7 -7
  51. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +1 -1
  52. package/docs/modules.html +12 -12
  53. package/libs/CSS3DRenderPlugin/index.js +16 -13
  54. package/libs/CameraMovementPlugin/index.js +24 -15
  55. package/libs/ModelChassisCompassPlugin/index.js +14 -5
  56. package/libs/ModelEntryDoorGuidePlugin/index.js +24 -12
  57. package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +422 -0
  58. package/libs/ModelItemLabelPlugin/ItemLabelItem.js +133 -0
  59. package/libs/ModelItemLabelPlugin/events.type.d.ts +9 -0
  60. package/libs/ModelItemLabelPlugin/events.type.js +1 -0
  61. package/libs/ModelItemLabelPlugin/index.d.ts +4 -0
  62. package/libs/ModelItemLabelPlugin/index.js +172 -0
  63. package/libs/ModelItemLabelPlugin/typings.d.ts +55 -0
  64. package/libs/ModelItemLabelPlugin/typings.js +6 -0
  65. package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
  66. package/libs/ModelItemLabelPlugin/utils/parseData.js +4 -0
  67. package/libs/ModelRoomLabelPlugin/Controller.js +64 -23
  68. package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +7 -5
  69. package/libs/PanoCompassPlugin/index.js +225 -128
  70. package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
  71. package/libs/PanoMeasurePlugin/Controller/BaseController.js +68 -13
  72. package/libs/PanoMeasurePlugin/Controller/EditController.js +267 -154
  73. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +40 -20
  74. package/libs/PanoMeasurePlugin/Controller/WatchController.js +234 -152
  75. package/libs/PanoMeasurePlugin/Controller/index.js +131 -47
  76. package/libs/PanoMeasurePlugin/Model/index.js +30 -5
  77. package/libs/PanoMeasurePlugin/Model/line.js +60 -10
  78. package/libs/PanoMeasurePlugin/Model/point.js +24 -4
  79. package/libs/PanoMeasurePlugin/Model/polyline.js +20 -3
  80. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +59 -14
  81. package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +23 -8
  82. package/libs/PanoMeasurePlugin/Modules/GuideController.js +61 -26
  83. package/libs/PanoMeasurePlugin/Modules/Magnifier.js +60 -10
  84. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +83 -37
  85. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +52 -17
  86. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +61 -30
  87. package/libs/PanoMeasurePlugin/utils/distanceDom.js +3 -2
  88. package/libs/PanoMeasurePlugin/utils/line.js +8 -7
  89. package/libs/PanoRulerPlugin/index.js +16 -5
  90. package/libs/PanoSpatialTagPlugin/Components/tag.js +9 -9
  91. package/libs/PanoSpatialTagPlugin/index.js +11 -9
  92. package/libs/floorplan/Components/BaseImage.js +10 -5
  93. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +3 -1
  94. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +5 -6
  95. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +24 -11
  96. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +77 -69
  97. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +3 -1
  98. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +1 -0
  99. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +457 -273
  100. package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +33 -22
  101. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +3 -1
  102. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +97 -36
  103. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +1 -0
  104. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +232 -108
  105. package/libs/floorplan/utils/formatData.js +43 -28
  106. package/libs/floorplan/utils/formatPosition.js +1 -1
  107. package/libs/index.d.ts +1 -0
  108. package/libs/index.js +2 -0
  109. package/libs/shared-utils/Subscribe.js +8 -1
  110. package/libs/shared-utils/animationFrame/BetterTween.js +47 -18
  111. package/libs/shared-utils/createCanvasTextTexture.js +6 -5
  112. package/libs/shared-utils/five/changeMode.js +23 -12
  113. package/libs/shared-utils/getPxmm.js +1 -1
  114. package/libs/shared-utils/math/evenNumber.js +1 -1
  115. package/libs/shared-utils/three/loadFbxObj.js +20 -9
  116. package/libs/shared-utils/three/loadTexture.js +17 -6
  117. package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +2 -1
  118. package/libs/shared-utils/tinyEJSrender.js +36 -6
  119. package/libs/shared-utils/to.js +21 -10
  120. package/libs/shared-utils/useDebounce.js +1 -1
  121. package/libs/shared-utils/useThrottle.js +2 -1
  122. package/package.json +2 -2
  123. package/CHANGELOG.md +0 -34
@@ -0,0 +1,172 @@
1
+ import { Five, Subscribe } from "@realsee/five";
2
+ import ItemLabelComponent from './ItemLabelComponent';
3
+ import { DISPLAY_STRATEGY_TYPE } from "./typings";
4
+ import { parseModelItemLabelPluginData } from "./utils/parseData";
5
+ export const ModelItemLabelPlugin = (five, params) => {
6
+ var _a, _b;
7
+ const pluginState = {
8
+ container: document.createElement('div'),
9
+ data: null,
10
+ enabled: true,
11
+ fiveModeEnabled: undefined,
12
+ itemLabels: [],
13
+ wrapper: null,
14
+ app: undefined,
15
+ hooks: new Subscribe(),
16
+ modelOcclusionEnable: (_a = params === null || params === void 0 ? void 0 : params.modelOcclusionEnable) !== null && _a !== void 0 ? _a : true,
17
+ displayStrategyType: (_b = params === null || params === void 0 ? void 0 : params.displayStrategyType) !== null && _b !== void 0 ? _b : DISPLAY_STRATEGY_TYPE.SMALL
18
+ };
19
+ pluginState.container.setAttribute('class', 'model-item-label-plugin-container');
20
+ pluginState.container.style.cssText = `
21
+ position: absolute;
22
+ left: 0;
23
+ top: 0;
24
+ width: 100%;
25
+ height: 100%;
26
+ pointerEvents: none;
27
+ `;
28
+ const appendTo = (wrapper) => {
29
+ pluginState.wrapper = wrapper;
30
+ wrapper.appendChild(pluginState.container);
31
+ render();
32
+ return true;
33
+ };
34
+ const load = (data) => {
35
+ console.log('🐶--当前标签总条数: ', data.model_item_labels.length);
36
+ pluginState.itemLabels = parseModelItemLabelPluginData(data);
37
+ render();
38
+ };
39
+ const enable = () => {
40
+ if (pluginState.enabled)
41
+ return true;
42
+ pluginState.enabled = true;
43
+ render();
44
+ return true;
45
+ };
46
+ const disable = () => {
47
+ if (!pluginState.enabled)
48
+ return true;
49
+ pluginState.enabled = false;
50
+ render();
51
+ return true;
52
+ };
53
+ const dispose = () => {
54
+ removeListener4Five();
55
+ pluginState.container.remove();
56
+ };
57
+ const handleRerender = () => {
58
+ if (!pluginState.enabled || !pluginState.fiveModeEnabled)
59
+ return;
60
+ disable();
61
+ };
62
+ const rerender = (a, b, c) => {
63
+ if (!pluginState.fiveModeEnabled)
64
+ return;
65
+ if (!c)
66
+ return;
67
+ enable();
68
+ render();
69
+ };
70
+ const handleInteriaPanRerender = (a, b) => {
71
+ if (!pluginState.fiveModeEnabled)
72
+ return;
73
+ if (!b)
74
+ return;
75
+ enable();
76
+ render();
77
+ };
78
+ const handleWantsPanGesture = (pose, final) => {
79
+ if (pose) {
80
+ handleRerender();
81
+ }
82
+ };
83
+ const handlePanGesture = (pose, final) => {
84
+ if (!pluginState.fiveModeEnabled)
85
+ return;
86
+ if (!final)
87
+ return;
88
+ enable();
89
+ render();
90
+ };
91
+ const render = () => {
92
+ var _a;
93
+ if (!pluginState.wrapper)
94
+ return;
95
+ // 只要不可展示,销毁容器
96
+ if (!pluginState.enabled || !pluginState.fiveModeEnabled) {
97
+ (_a = pluginState.app) === null || _a === void 0 ? void 0 : _a.$destroy();
98
+ pluginState.app = undefined;
99
+ return;
100
+ }
101
+ // 正常显示时,分为 app 存在和不存在两种情况,如果存在,传值,不存在则初始化并传值
102
+ if (!pluginState.app) {
103
+ pluginState.app = new ItemLabelComponent({
104
+ target: pluginState.container,
105
+ props: {
106
+ five: five,
107
+ modelOcclusionEnable: pluginState.modelOcclusionEnable,
108
+ itemLabels: pluginState.itemLabels,
109
+ wrapper: pluginState.wrapper,
110
+ hooks: pluginState.hooks,
111
+ displayStrategyType: pluginState.displayStrategyType
112
+ }
113
+ });
114
+ }
115
+ else {
116
+ pluginState.app.$set({
117
+ five: five,
118
+ itemLabels: pluginState.itemLabels
119
+ });
120
+ }
121
+ };
122
+ // 添加 five 监听
123
+ const addListener4Five = () => {
124
+ five.on('modeChange', onFiveModeChange);
125
+ five.once('dispose', dispose);
126
+ // five.on('wantsGesture', handleRerender)
127
+ // five.on('gesture', rerender)
128
+ five.on('wantsMouseWheel', handleRerender);
129
+ five.on('mouseWheel', rerender);
130
+ five.on('wantsInteriaPan', handleRerender);
131
+ five.on('interiaPan', handleInteriaPanRerender);
132
+ five.on('wantsPanGesture', handleWantsPanGesture);
133
+ five.on('panGesture', handlePanGesture);
134
+ five.on('wantsPinchGesture', handleRerender);
135
+ five.on('pinchGesture', rerender);
136
+ };
137
+ // 取消 five 监听
138
+ const removeListener4Five = () => {
139
+ five.off('modeChange', onFiveModeChange);
140
+ // five.off('wantsGesture', handleRerender)
141
+ // five.off('gesture', rerender)
142
+ five.off('wantsMouseWheel', handleRerender);
143
+ five.off('mouseWheel', rerender);
144
+ five.off('wantsInteriaPan', handleRerender);
145
+ five.off('interiaPan', handleInteriaPanRerender);
146
+ five.off('wantsPanGesture', handleWantsPanGesture);
147
+ five.off('panGesture', handlePanGesture);
148
+ five.off('wantsPinchGesture', handleRerender);
149
+ five.off('pinchGesture', rerender);
150
+ };
151
+ const onFiveModeChange = (mode) => {
152
+ if (mode !== Five.Mode.Floorplan) {
153
+ pluginState.fiveModeEnabled = false;
154
+ render();
155
+ return;
156
+ }
157
+ five.once('initAnimationEnded', () => {
158
+ pluginState.fiveModeEnabled = five.currentMode === Five.Mode.Floorplan;
159
+ render();
160
+ });
161
+ };
162
+ addListener4Five();
163
+ return {
164
+ appendTo,
165
+ load,
166
+ enable,
167
+ disable,
168
+ dispose,
169
+ hooks: pluginState.hooks
170
+ };
171
+ };
172
+ export default ModelItemLabelPlugin;
@@ -0,0 +1,55 @@
1
+ import ItemLabelComponent from './ItemLabelComponent';
2
+ import type { Subscribe } from "@realsee/five";
3
+ import { PluginEvent } from "./events.type";
4
+ export declare enum DISPLAY_STRATEGY_TYPE {
5
+ SMALL = "small",
6
+ MIDLLE = "middle",
7
+ LARGE = "large"
8
+ }
9
+ export interface ModelItemLabelPluginParametersType {
10
+ modelOcclusionEnable?: boolean;
11
+ displayStrategyType?: Partial<DISPLAY_STRATEGY_TYPE>;
12
+ }
13
+ export interface ModelItemLabelPluginData {
14
+ model_item_labels: Readonly<{
15
+ id: string;
16
+ library: string;
17
+ name: string;
18
+ size: [number, number, number];
19
+ center: [number, number, number];
20
+ position: [number, number, number];
21
+ type: string[];
22
+ [key: string]: any;
23
+ }>[];
24
+ }
25
+ export interface ItemLabel {
26
+ id: string;
27
+ library: string;
28
+ name: string;
29
+ size: [number, number, number];
30
+ center: [number, number, number];
31
+ position: [number, number, number];
32
+ type: string[];
33
+ modelPosition: [number, number, number];
34
+ [key: string]: any;
35
+ }
36
+ export interface ModelItemLabelPluginExportReturnsType {
37
+ appendTo: (wrapper: Element) => void;
38
+ load: (data: ModelItemLabelPluginData) => void;
39
+ disable: () => void;
40
+ enable: () => void;
41
+ dispose: () => void;
42
+ hooks: Subscribe<PluginEvent>;
43
+ }
44
+ export interface ModelItemLabelPluginState {
45
+ container: HTMLDivElement;
46
+ data: ModelItemLabelPluginData | null;
47
+ enabled: boolean;
48
+ itemLabels: ItemLabel[];
49
+ wrapper: HTMLElement | null;
50
+ fiveModeEnabled: boolean;
51
+ app?: ItemLabelComponent | undefined;
52
+ hooks: Subscribe<PluginEvent>;
53
+ modelOcclusionEnable: boolean;
54
+ displayStrategyType: Partial<DISPLAY_STRATEGY_TYPE>;
55
+ }
@@ -0,0 +1,6 @@
1
+ export var DISPLAY_STRATEGY_TYPE;
2
+ (function (DISPLAY_STRATEGY_TYPE) {
3
+ DISPLAY_STRATEGY_TYPE["SMALL"] = "small";
4
+ DISPLAY_STRATEGY_TYPE["MIDLLE"] = "middle";
5
+ DISPLAY_STRATEGY_TYPE["LARGE"] = "large";
6
+ })(DISPLAY_STRATEGY_TYPE || (DISPLAY_STRATEGY_TYPE = {}));
@@ -0,0 +1,3 @@
1
+ import { ModelItemLabelPluginData, ItemLabel } from '../typings';
2
+ /** @description 转成内部所需数据 */
3
+ export declare function parseModelItemLabelPluginData(data: ModelItemLabelPluginData): ItemLabel[];
@@ -0,0 +1,4 @@
1
+ /** @description 转成内部所需数据 */
2
+ export function parseModelItemLabelPluginData(data) {
3
+ return data.model_item_labels.map(label => (Object.assign({ modelPosition: [label.position[0], label.position[1] + label.size[1], label.position[2]] }, label)));
4
+ }
@@ -1,14 +1,69 @@
1
1
  import RoomLabelItems from './RoomLabelItems';
2
2
  import { parseModelRoomLabelPluginData } from './utils/parseData';
3
3
  export class ModelRoomLabelController {
4
- five;
5
- enabled = true;
6
- fiveModeEnabled;
7
- app = undefined;
8
- wrapper;
9
- roomLabels = [];
10
- container = document.createElement('div');
11
4
  constructor(five) {
5
+ Object.defineProperty(this, "five", {
6
+ enumerable: true,
7
+ configurable: true,
8
+ writable: true,
9
+ value: void 0
10
+ });
11
+ Object.defineProperty(this, "enabled", {
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true,
15
+ value: true
16
+ });
17
+ Object.defineProperty(this, "fiveModeEnabled", {
18
+ enumerable: true,
19
+ configurable: true,
20
+ writable: true,
21
+ value: void 0
22
+ });
23
+ Object.defineProperty(this, "app", {
24
+ enumerable: true,
25
+ configurable: true,
26
+ writable: true,
27
+ value: undefined
28
+ });
29
+ Object.defineProperty(this, "wrapper", {
30
+ enumerable: true,
31
+ configurable: true,
32
+ writable: true,
33
+ value: void 0
34
+ });
35
+ Object.defineProperty(this, "roomLabels", {
36
+ enumerable: true,
37
+ configurable: true,
38
+ writable: true,
39
+ value: []
40
+ });
41
+ Object.defineProperty(this, "container", {
42
+ enumerable: true,
43
+ configurable: true,
44
+ writable: true,
45
+ value: document.createElement('div')
46
+ });
47
+ /** 监听 Five Mode 变化
48
+ * @description
49
+ * Mode 不符合要求时,立刻消失,满足要求时,需要等待动画结束再展示
50
+ */
51
+ Object.defineProperty(this, "onFiveModeChange", {
52
+ enumerable: true,
53
+ configurable: true,
54
+ writable: true,
55
+ value: (mode) => {
56
+ if (mode !== 'Floorplan') {
57
+ this.fiveModeEnabled = false;
58
+ this.render();
59
+ return;
60
+ }
61
+ this.five.once('initAnimationEnded', () => {
62
+ this.fiveModeEnabled = this.five.currentMode === 'Floorplan';
63
+ this.render();
64
+ });
65
+ }
66
+ });
12
67
  this.five = five;
13
68
  this.fiveModeEnabled = this.five.currentMode === 'Floorplan';
14
69
  // init container style
@@ -61,26 +116,12 @@ export class ModelRoomLabelController {
61
116
  this.render();
62
117
  return this;
63
118
  }
64
- /** 监听 Five Mode 变化
65
- * @description
66
- * Mode 不符合要求时,立刻消失,满足要求时,需要等待动画结束再展示
67
- */
68
- onFiveModeChange = (mode) => {
69
- if (mode !== 'Floorplan') {
70
- this.fiveModeEnabled = false;
71
- this.render();
72
- return;
73
- }
74
- this.five.once('initAnimationEnded', () => {
75
- this.fiveModeEnabled = this.five.currentMode === 'Floorplan';
76
- this.render();
77
- });
78
- };
79
119
  render() {
120
+ var _a;
80
121
  if (!this.wrapper)
81
122
  return;
82
123
  if (!this.enabled || !this.fiveModeEnabled) {
83
- this.app?.$destroy();
124
+ (_a = this.app) === null || _a === void 0 ? void 0 : _a.$destroy();
84
125
  this.app = undefined;
85
126
  return;
86
127
  }
@@ -36,7 +36,7 @@ function get_each_context(ctx, list, i) {
36
36
  return child_ctx;
37
37
  }
38
38
 
39
- // (68:2) {#each roomLabels as roomLableItem (roomLableItem.id)}
39
+ // (70:2) {#each roomLabels as roomLableItem (roomLableItem.id)}
40
40
  function create_each_block(key_1, ctx) {
41
41
  let first;
42
42
  let roomlabelitem;
@@ -191,15 +191,15 @@ function instance($$self, $$props, $$invalidate) {
191
191
 
192
192
  function getFormatedRoomLabels(five, labels) {
193
193
  const newLabels = labels.map(roomLabelItem => {
194
- // 计算是否可见,入股不可见,不会更新位置
194
+ // 计算是否可见,如果不可见,不会更新位置
195
195
  const visible = getLabelVisible(five, roomLabelItem);
196
196
 
197
- if (!visible) return { ...roomLabelItem, visible };
197
+ if (!visible) return Object.assign(Object.assign({}, roomLabelItem), { visible });
198
198
 
199
199
  // 更新位置
200
200
  const transform = getLabelTransform(five, roomLabelItem);
201
201
 
202
- return { ...roomLabelItem, visible, transform };
202
+ return Object.assign(Object.assign({}, roomLabelItem), { visible, transform });
203
203
  });
204
204
 
205
205
  const sortedRoomLabelItems = newLabels.filter(({ visible }) => visible).map(roomLabelItem => ({
@@ -209,7 +209,7 @@ function instance($$self, $$props, $$invalidate) {
209
209
 
210
210
  return newLabels.map(roomLabelItem => {
211
211
  const sortIndex = sortedRoomLabelItems.findIndex(item => item.roomLabelItem.id === roomLabelItem.id);
212
- if (sortIndex !== undefined) return { ...roomLabelItem, zIndex: sortIndex * 10 };
212
+ if (sortIndex !== undefined) return Object.assign(Object.assign({}, roomLabelItem), { zIndex: sortIndex * 10 });
213
213
  return roomLabelItem;
214
214
  });
215
215
  }
@@ -219,9 +219,11 @@ function instance($$self, $$props, $$invalidate) {
219
219
  }
220
220
 
221
221
  five.on('cameraUpdate', onFiveCameraUpdate);
222
+ five.on('modelShownFloorChange', onFiveCameraUpdate);
222
223
 
223
224
  onDestroy(() => {
224
225
  five.off('cameraUpdate', onFiveCameraUpdate);
226
+ five.off('modelShownFloorChange', onFiveCameraUpdate);
225
227
  });
226
228
 
227
229
  onMount(() => {