@realsee/dnalogel 2.0.0-alpha.34 → 2.0.0-alpha.35

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 (115) hide show
  1. package/dist/PanoSpatialTagPlugin/Plugin.d.ts +2 -0
  2. package/dist/PanoSpatialTagPlugin/index.js +57 -48
  3. package/dist/index.es.js +57 -48
  4. package/dist/index.js +57 -48
  5. package/dist/index.umd.js +57 -48
  6. package/docs/assets/search.js +1 -1
  7. package/docs/classes/Magnifier.html +4 -4
  8. package/docs/classes/ModelRoomLabelController.html +4 -4
  9. package/docs/classes/PanoFloorplanRadarPluginController.html +2 -2
  10. package/docs/enums/CameraMovementEffect.html +2 -2
  11. package/docs/enums/DIRECTION.html +1 -1
  12. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
  13. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  14. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
  15. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  16. package/docs/enums/Rotation.html +2 -2
  17. package/docs/index.html +1 -1
  18. package/docs/interfaces/CSS3DRenderPluginExportType.html +2 -2
  19. package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
  20. package/docs/interfaces/FloorplanBounding.html +4 -4
  21. package/docs/interfaces/FloorplanData.html +2 -2
  22. package/docs/interfaces/FloorplanEntrance.html +7 -7
  23. package/docs/interfaces/FloorplanExtraObject.html +3 -3
  24. package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
  25. package/docs/interfaces/FloorplanFloorData.html +2 -2
  26. package/docs/interfaces/FloorplanImagePosition.html +2 -2
  27. package/docs/interfaces/FloorplanObserver.html +2 -2
  28. package/docs/interfaces/FloorplanOutlineItem.html +2 -2
  29. package/docs/interfaces/FloorplanPosition.html +2 -2
  30. package/docs/interfaces/FloorplanRoomItem.html +6 -6
  31. package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
  32. package/docs/interfaces/FloorplanServerBounding.html +4 -4
  33. package/docs/interfaces/FloorplanServerComputedData.html +1 -1
  34. package/docs/interfaces/FloorplanServerData.html +2 -2
  35. package/docs/interfaces/FloorplanServerEntrance.html +7 -7
  36. package/docs/interfaces/FloorplanServerFloorData.html +2 -2
  37. package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
  38. package/docs/interfaces/FloorplanServerObserver.html +2 -2
  39. package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
  40. package/docs/interfaces/FloorplanServerPosition.html +2 -2
  41. package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
  42. package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
  43. package/docs/interfaces/ItemLabelPluginData.html +1 -1
  44. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
  45. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
  46. package/docs/interfaces/LineJson.html +1 -1
  47. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  48. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  49. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  50. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  51. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  52. package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
  53. package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
  54. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  55. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  56. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  57. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  58. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  59. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  60. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  61. package/docs/interfaces/ModelViewPluginExportType.html +1 -1
  62. package/docs/interfaces/OpenParameter.html +2 -2
  63. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  64. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  65. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  66. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
  67. package/docs/interfaces/PanoFloorplanRadarPluginControllerParameter.html +1 -1
  68. package/docs/interfaces/PanoMeasureParameterType.html +1 -1
  69. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  70. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  71. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  72. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
  73. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
  74. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  75. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
  76. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  77. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
  78. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  79. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
  80. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
  81. package/docs/interfaces/Point.html +1 -1
  82. package/docs/interfaces/PointJson.html +1 -1
  83. package/docs/interfaces/Room.html +1 -1
  84. package/docs/interfaces/RoomInfo.html +1 -1
  85. package/docs/interfaces/RoomLabel.html +7 -7
  86. package/docs/interfaces/RoomRules.html +1 -1
  87. package/docs/interfaces/Rooms.html +1 -1
  88. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +9 -9
  89. package/docs/modules.html +20 -20
  90. package/libs/ModelSimulationPlugin/index.d.ts +33 -0
  91. package/libs/ModelSimulationPlugin/index.js +166 -0
  92. package/libs/ModelSimulationPlugin/shaders/fragment.d.ts +2 -0
  93. package/libs/ModelSimulationPlugin/shaders/fragment.js +96 -0
  94. package/libs/ModelSimulationPlugin/shaders/vertex.d.ts +2 -0
  95. package/libs/ModelSimulationPlugin/shaders/vertex.js +23 -0
  96. package/libs/PanoSpatialTagPlugin/Components/tag.js +2 -2
  97. package/libs/PanoSpatialTagPlugin/Plugin.d.ts +2 -0
  98. package/libs/PanoSpatialTagPlugin/Plugin.js +55 -46
  99. package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.d.ts +1 -0
  100. package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.js +1 -0
  101. package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.js +120 -0
  102. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +106 -0
  103. package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.js +463 -0
  104. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +375 -0
  105. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +171 -0
  106. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.js +265 -0
  107. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +301 -0
  108. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.js +219 -0
  109. package/libs/shared-utils/five/useFivePlugin.d.ts +1 -0
  110. package/libs/shared-utils/five/useFivePlugin.js +8 -0
  111. package/libs/shared-utils/useDebounce.d.ts +8 -0
  112. package/libs/shared-utils/useDebounce.js +22 -0
  113. package/libs/shared-utils/useThrottle.d.ts +8 -0
  114. package/libs/shared-utils/useThrottle.js +25 -0
  115. package/package.json +1 -1
@@ -0,0 +1,375 @@
1
+ /* generated by Svelte v3.47.0 */
2
+ import {
3
+ SvelteComponent,
4
+ add_render_callback,
5
+ append,
6
+ append_styles,
7
+ assign,
8
+ attr,
9
+ check_outros,
10
+ create_component,
11
+ create_in_transition,
12
+ destroy_component,
13
+ detach,
14
+ element,
15
+ empty,
16
+ get_spread_update,
17
+ group_outros,
18
+ init,
19
+ insert,
20
+ mount_component,
21
+ safe_not_equal,
22
+ space,
23
+ transition_in,
24
+ transition_out
25
+ } from "svelte/internal";
26
+
27
+ import Camera from './Camera';
28
+ import Compass from './Compass';
29
+ import CurrentFloor from './CurrentFloor/CurrentFloor';
30
+ import { linear } from 'svelte/easing';
31
+ import { fade } from 'svelte/transition';
32
+
33
+ function add_css(target) {
34
+ append_styles(target, "svelte-177x2q7", ".floorplan-main-177x2q7{width:100%;height:100%}");
35
+ }
36
+
37
+ // (23:0) {#if visible}
38
+ function create_if_block(ctx) {
39
+ let div;
40
+ let currentfloor;
41
+ let t0;
42
+ let camera;
43
+ let t1;
44
+ let div_intro;
45
+ let current;
46
+
47
+ const currentfloor_spread_levels = [
48
+ {
49
+ five: /*five*/ ctx[1],
50
+ pxmm: /*pxmm*/ ctx[0],
51
+ floorIndex: /*floorIndex*/ ctx[5],
52
+ hoverEnable: /*hoverEnable*/ ctx[6],
53
+ floorplanData: /*floorplanData*/ ctx[10],
54
+ getLabelElement: /*getLabelElement*/ ctx[14],
55
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[8],
56
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[9],
57
+ onRoomHeightClick: /*onRoomHeightClick*/ ctx[13]
58
+ }
59
+ ];
60
+
61
+ let currentfloor_props = {};
62
+
63
+ for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
64
+ currentfloor_props = assign(currentfloor_props, currentfloor_spread_levels[i]);
65
+ }
66
+
67
+ currentfloor = new CurrentFloor({ props: currentfloor_props });
68
+
69
+ const camera_spread_levels = [
70
+ {
71
+ panoIndex: /*panoIndex*/ ctx[4],
72
+ floorplanData: /*floorplanData*/ ctx[10],
73
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[11],
74
+ cameraImageUrl: /*cameraImageUrl*/ ctx[12]
75
+ }
76
+ ];
77
+
78
+ let camera_props = {};
79
+
80
+ for (let i = 0; i < camera_spread_levels.length; i += 1) {
81
+ camera_props = assign(camera_props, camera_spread_levels[i]);
82
+ }
83
+
84
+ camera = new Camera({ props: camera_props });
85
+ let if_block = /*compassEnable*/ ctx[7] && create_if_block_1(ctx);
86
+
87
+ return {
88
+ c() {
89
+ div = element("div");
90
+ create_component(currentfloor.$$.fragment);
91
+ t0 = space();
92
+ create_component(camera.$$.fragment);
93
+ t1 = space();
94
+ if (if_block) if_block.c();
95
+ attr(div, "class", "floorplan-main svelte-177x2q7");
96
+ },
97
+ m(target, anchor) {
98
+ insert(target, div, anchor);
99
+ mount_component(currentfloor, div, null);
100
+ append(div, t0);
101
+ mount_component(camera, div, null);
102
+ append(div, t1);
103
+ if (if_block) if_block.m(div, null);
104
+ current = true;
105
+ },
106
+ p(new_ctx, dirty) {
107
+ ctx = new_ctx;
108
+
109
+ const currentfloor_changes = (dirty & /*five, pxmm, floorIndex, hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, onRoomHeightClick*/ 26467)
110
+ ? get_spread_update(currentfloor_spread_levels, [
111
+ {
112
+ five: /*five*/ ctx[1],
113
+ pxmm: /*pxmm*/ ctx[0],
114
+ floorIndex: /*floorIndex*/ ctx[5],
115
+ hoverEnable: /*hoverEnable*/ ctx[6],
116
+ floorplanData: /*floorplanData*/ ctx[10],
117
+ getLabelElement: /*getLabelElement*/ ctx[14],
118
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[8],
119
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[9],
120
+ onRoomHeightClick: /*onRoomHeightClick*/ ctx[13]
121
+ }
122
+ ])
123
+ : {};
124
+
125
+ currentfloor.$set(currentfloor_changes);
126
+
127
+ const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 7184)
128
+ ? get_spread_update(camera_spread_levels, [
129
+ {
130
+ panoIndex: /*panoIndex*/ ctx[4],
131
+ floorplanData: /*floorplanData*/ ctx[10],
132
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[11],
133
+ cameraImageUrl: /*cameraImageUrl*/ ctx[12]
134
+ }
135
+ ])
136
+ : {};
137
+
138
+ camera.$set(camera_changes);
139
+
140
+ if (/*compassEnable*/ ctx[7]) {
141
+ if (if_block) {
142
+ if_block.p(ctx, dirty);
143
+
144
+ if (dirty & /*compassEnable*/ 128) {
145
+ transition_in(if_block, 1);
146
+ }
147
+ } else {
148
+ if_block = create_if_block_1(ctx);
149
+ if_block.c();
150
+ transition_in(if_block, 1);
151
+ if_block.m(div, null);
152
+ }
153
+ } else if (if_block) {
154
+ group_outros();
155
+
156
+ transition_out(if_block, 1, 1, () => {
157
+ if_block = null;
158
+ });
159
+
160
+ check_outros();
161
+ }
162
+ },
163
+ i(local) {
164
+ if (current) return;
165
+ transition_in(currentfloor.$$.fragment, local);
166
+ transition_in(camera.$$.fragment, local);
167
+ transition_in(if_block);
168
+
169
+ if (!div_intro) {
170
+ add_render_callback(() => {
171
+ div_intro = create_in_transition(div, fade, {
172
+ duration: /*duration*/ ctx[2],
173
+ easing: linear
174
+ });
175
+
176
+ div_intro.start();
177
+ });
178
+ }
179
+
180
+ current = true;
181
+ },
182
+ o(local) {
183
+ transition_out(currentfloor.$$.fragment, local);
184
+ transition_out(camera.$$.fragment, local);
185
+ transition_out(if_block);
186
+ current = false;
187
+ },
188
+ d(detaching) {
189
+ if (detaching) detach(div);
190
+ destroy_component(currentfloor);
191
+ destroy_component(camera);
192
+ if (if_block) if_block.d();
193
+ }
194
+ };
195
+ }
196
+
197
+ // (39:4) {#if compassEnable}
198
+ function create_if_block_1(ctx) {
199
+ let compass;
200
+ let current;
201
+
202
+ compass = new Compass({
203
+ props: { floorplanData: /*floorplanData*/ ctx[10] }
204
+ });
205
+
206
+ return {
207
+ c() {
208
+ create_component(compass.$$.fragment);
209
+ },
210
+ m(target, anchor) {
211
+ mount_component(compass, target, anchor);
212
+ current = true;
213
+ },
214
+ p(ctx, dirty) {
215
+ const compass_changes = {};
216
+ if (dirty & /*floorplanData*/ 1024) compass_changes.floorplanData = /*floorplanData*/ ctx[10];
217
+ compass.$set(compass_changes);
218
+ },
219
+ i(local) {
220
+ if (current) return;
221
+ transition_in(compass.$$.fragment, local);
222
+ current = true;
223
+ },
224
+ o(local) {
225
+ transition_out(compass.$$.fragment, local);
226
+ current = false;
227
+ },
228
+ d(detaching) {
229
+ destroy_component(compass, detaching);
230
+ }
231
+ };
232
+ }
233
+
234
+ function create_fragment(ctx) {
235
+ let if_block_anchor;
236
+ let current;
237
+ let if_block = /*visible*/ ctx[3] && create_if_block(ctx);
238
+
239
+ return {
240
+ c() {
241
+ if (if_block) if_block.c();
242
+ if_block_anchor = empty();
243
+ },
244
+ m(target, anchor) {
245
+ if (if_block) if_block.m(target, anchor);
246
+ insert(target, if_block_anchor, anchor);
247
+ current = true;
248
+ },
249
+ p(ctx, [dirty]) {
250
+ if (/*visible*/ ctx[3]) {
251
+ if (if_block) {
252
+ if_block.p(ctx, dirty);
253
+
254
+ if (dirty & /*visible*/ 8) {
255
+ transition_in(if_block, 1);
256
+ }
257
+ } else {
258
+ if_block = create_if_block(ctx);
259
+ if_block.c();
260
+ transition_in(if_block, 1);
261
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
262
+ }
263
+ } else if (if_block) {
264
+ group_outros();
265
+
266
+ transition_out(if_block, 1, 1, () => {
267
+ if_block = null;
268
+ });
269
+
270
+ check_outros();
271
+ }
272
+ },
273
+ i(local) {
274
+ if (current) return;
275
+ transition_in(if_block);
276
+ current = true;
277
+ },
278
+ o(local) {
279
+ transition_out(if_block);
280
+ current = false;
281
+ },
282
+ d(detaching) {
283
+ if (if_block) if_block.d(detaching);
284
+ if (detaching) detach(if_block_anchor);
285
+ }
286
+ };
287
+ }
288
+
289
+ function instance($$self, $$props, $$invalidate) {
290
+ let { pxmm } = $$props;
291
+ let { five } = $$props;
292
+ let { duration = 0 } = $$props;
293
+ let { visible } = $$props;
294
+ let { panoIndex } = $$props;
295
+ let { floorIndex } = $$props;
296
+ let { hoverEnable } = $$props;
297
+ let { compassEnable } = $$props;
298
+ let { roomLabelsEnable } = $$props;
299
+ let { ruleLabelsEnable } = $$props;
300
+ let { floorplanData } = $$props;
301
+ let { lastPanoramaLongitude } = $$props;
302
+ let { cameraImageUrl } = $$props;
303
+ let { onRoomHeightClick } = $$props;
304
+ let { getLabelElement } = $$props;
305
+
306
+ $$self.$$set = $$props => {
307
+ if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
308
+ if ('five' in $$props) $$invalidate(1, five = $$props.five);
309
+ if ('duration' in $$props) $$invalidate(2, duration = $$props.duration);
310
+ if ('visible' in $$props) $$invalidate(3, visible = $$props.visible);
311
+ if ('panoIndex' in $$props) $$invalidate(4, panoIndex = $$props.panoIndex);
312
+ if ('floorIndex' in $$props) $$invalidate(5, floorIndex = $$props.floorIndex);
313
+ if ('hoverEnable' in $$props) $$invalidate(6, hoverEnable = $$props.hoverEnable);
314
+ if ('compassEnable' in $$props) $$invalidate(7, compassEnable = $$props.compassEnable);
315
+ if ('roomLabelsEnable' in $$props) $$invalidate(8, roomLabelsEnable = $$props.roomLabelsEnable);
316
+ if ('ruleLabelsEnable' in $$props) $$invalidate(9, ruleLabelsEnable = $$props.ruleLabelsEnable);
317
+ if ('floorplanData' in $$props) $$invalidate(10, floorplanData = $$props.floorplanData);
318
+ if ('lastPanoramaLongitude' in $$props) $$invalidate(11, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
319
+ if ('cameraImageUrl' in $$props) $$invalidate(12, cameraImageUrl = $$props.cameraImageUrl);
320
+ if ('onRoomHeightClick' in $$props) $$invalidate(13, onRoomHeightClick = $$props.onRoomHeightClick);
321
+ if ('getLabelElement' in $$props) $$invalidate(14, getLabelElement = $$props.getLabelElement);
322
+ };
323
+
324
+ return [
325
+ pxmm,
326
+ five,
327
+ duration,
328
+ visible,
329
+ panoIndex,
330
+ floorIndex,
331
+ hoverEnable,
332
+ compassEnable,
333
+ roomLabelsEnable,
334
+ ruleLabelsEnable,
335
+ floorplanData,
336
+ lastPanoramaLongitude,
337
+ cameraImageUrl,
338
+ onRoomHeightClick,
339
+ getLabelElement
340
+ ];
341
+ }
342
+
343
+ class Component extends SvelteComponent {
344
+ constructor(options) {
345
+ super();
346
+
347
+ init(
348
+ this,
349
+ options,
350
+ instance,
351
+ create_fragment,
352
+ safe_not_equal,
353
+ {
354
+ pxmm: 0,
355
+ five: 1,
356
+ duration: 2,
357
+ visible: 3,
358
+ panoIndex: 4,
359
+ floorIndex: 5,
360
+ hoverEnable: 6,
361
+ compassEnable: 7,
362
+ roomLabelsEnable: 8,
363
+ ruleLabelsEnable: 9,
364
+ floorplanData: 10,
365
+ lastPanoramaLongitude: 11,
366
+ cameraImageUrl: 12,
367
+ onRoomHeightClick: 13,
368
+ getLabelElement: 14
369
+ },
370
+ add_css
371
+ );
372
+ }
373
+ }
374
+
375
+ export default Component;
@@ -0,0 +1,171 @@
1
+ /* generated by Svelte v3.47.0 */
2
+ import {
3
+ HtmlTag,
4
+ SvelteComponent,
5
+ append,
6
+ append_styles,
7
+ attr,
8
+ detach,
9
+ element,
10
+ empty,
11
+ init,
12
+ insert,
13
+ noop,
14
+ safe_not_equal,
15
+ set_data,
16
+ set_style,
17
+ space,
18
+ text
19
+ } from "svelte/internal";
20
+
21
+ function add_css(target) {
22
+ append_styles(target, "svelte-1ashbdx", ".floorplan-plugin__room-label-item-1ashbdx{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:15px;color:#fff;transform:translate(-50%, -50%);white-space:nowrap}.floorplan-plugin__room-size-1ashbdx{opacity:0.45}");
23
+ }
24
+
25
+ // (22:30)
26
+ function create_if_block_1(ctx) {
27
+ let html_tag;
28
+ let raw_value = /*userConfigElement*/ ctx[2].outerHTML + "";
29
+ let html_anchor;
30
+
31
+ return {
32
+ c() {
33
+ html_tag = new HtmlTag();
34
+ html_anchor = empty();
35
+ html_tag.a = html_anchor;
36
+ },
37
+ m(target, anchor) {
38
+ html_tag.m(raw_value, target, anchor);
39
+ insert(target, html_anchor, anchor);
40
+ },
41
+ p(ctx, dirty) {
42
+ if (dirty & /*userConfigElement*/ 4 && raw_value !== (raw_value = /*userConfigElement*/ ctx[2].outerHTML + "")) html_tag.p(raw_value);
43
+ },
44
+ d(detaching) {
45
+ if (detaching) detach(html_anchor);
46
+ if (detaching) html_tag.d();
47
+ }
48
+ };
49
+ }
50
+
51
+ // (16:2) {#if getLabelElement === undefined}
52
+ function create_if_block(ctx) {
53
+ let span0;
54
+ let t0_value = /*room*/ ctx[0].name + "";
55
+ let t0;
56
+ let t1;
57
+ let span1;
58
+
59
+ return {
60
+ c() {
61
+ span0 = element("span");
62
+ t0 = text(t0_value);
63
+ t1 = space();
64
+ span1 = element("span");
65
+ span1.textContent = `${/*roomSizeDes*/ ctx[3]}`;
66
+ attr(span0, "class", "floorplan-plugin__room-name");
67
+ attr(span1, "class", "floorplan-plugin__room-size svelte-1ashbdx");
68
+ },
69
+ m(target, anchor) {
70
+ insert(target, span0, anchor);
71
+ append(span0, t0);
72
+ insert(target, t1, anchor);
73
+ insert(target, span1, anchor);
74
+ },
75
+ p(ctx, dirty) {
76
+ if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) set_data(t0, t0_value);
77
+ },
78
+ d(detaching) {
79
+ if (detaching) detach(span0);
80
+ if (detaching) detach(t1);
81
+ if (detaching) detach(span1);
82
+ }
83
+ };
84
+ }
85
+
86
+ function create_fragment(ctx) {
87
+ let div;
88
+
89
+ function select_block_type(ctx, dirty) {
90
+ if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block;
91
+ if (/*userConfigElement*/ ctx[2]) return create_if_block_1;
92
+ }
93
+
94
+ let current_block_type = select_block_type(ctx, -1);
95
+ let if_block = current_block_type && current_block_type(ctx);
96
+
97
+ return {
98
+ c() {
99
+ div = element("div");
100
+ if (if_block) if_block.c();
101
+ attr(div, "class", "floorplan-plugin__room-label-item svelte-1ashbdx");
102
+ set_style(div, "left", /*left*/ ctx[4], false);
103
+ set_style(div, "top", /*top*/ ctx[5], false);
104
+ set_style(div, "font-size", /*fontSize*/ ctx[6], false);
105
+ },
106
+ m(target, anchor) {
107
+ insert(target, div, anchor);
108
+ if (if_block) if_block.m(div, null);
109
+ },
110
+ p(ctx, [dirty]) {
111
+ if (current_block_type === (current_block_type = select_block_type(ctx, dirty)) && if_block) {
112
+ if_block.p(ctx, dirty);
113
+ } else {
114
+ if (if_block) if_block.d(1);
115
+ if_block = current_block_type && current_block_type(ctx);
116
+
117
+ if (if_block) {
118
+ if_block.c();
119
+ if_block.m(div, null);
120
+ }
121
+ }
122
+ },
123
+ i: noop,
124
+ o: noop,
125
+ d(detaching) {
126
+ if (detaching) detach(div);
127
+
128
+ if (if_block) {
129
+ if_block.d();
130
+ }
131
+ }
132
+ };
133
+ }
134
+
135
+ function instance($$self, $$props, $$invalidate) {
136
+ let userConfigElement;
137
+ let { room } = $$props;
138
+ let { getLabelElement } = $$props;
139
+
140
+ // TODO: 统一这里的判断条件,目前写了多处
141
+ const bodyWidth = document.body.clientWidth;
142
+
143
+ const bodyHeight = document.body.clientHeight;
144
+ const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
145
+ const roomLabel = room.roomLabel;
146
+ const left = roomLabel.positionInImage.x * 100 + '%';
147
+ const top = roomLabel.positionInImage.y * 100 + '%';
148
+ const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
149
+
150
+ $$self.$$set = $$props => {
151
+ if ('room' in $$props) $$invalidate(0, room = $$props.room);
152
+ if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
153
+ };
154
+
155
+ $$self.$$.update = () => {
156
+ if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
157
+ $: $$invalidate(2, userConfigElement = getLabelElement?.(room));
158
+ }
159
+ };
160
+
161
+ return [room, getLabelElement, userConfigElement, roomSizeDes, left, top, fontSize];
162
+ }
163
+
164
+ class Component extends SvelteComponent {
165
+ constructor(options) {
166
+ super();
167
+ init(this, options, instance, create_fragment, safe_not_equal, { room: 0, getLabelElement: 1 }, add_css);
168
+ }
169
+ }
170
+
171
+ export default Component;