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

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 (237) hide show
  1. package/dist/ItemLabelPlugin/index.js +21 -41
  2. package/dist/ModelItemLabelPlugin/index.js +16 -36
  3. package/dist/ModelViewPlugin/Plugin.d.ts +4 -4
  4. package/dist/ModelViewPlugin/index.js +2 -3
  5. package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +1 -1
  6. package/dist/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +0 -4
  7. package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +0 -3
  8. package/dist/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
  9. package/dist/PanoMeasurePlugin/Modules/UIController/{NewMainBtnController.d.ts → mobileMainBtnController.d.ts} +1 -1
  10. package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +0 -3
  11. package/dist/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +1 -1
  12. package/dist/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +2 -0
  13. package/dist/PanoMeasurePlugin/index.js +298 -331
  14. package/dist/PanoMeasurePlugin/typings/data.d.ts +5 -0
  15. package/dist/PanoMeasurePlugin/utils/mouseGroup.d.ts +6 -1
  16. package/dist/PanoRulerProPlugin/Controller.d.ts +15 -0
  17. package/dist/PanoRulerProPlugin/index.d.ts +8 -0
  18. package/dist/PanoRulerProPlugin/index.js +1006 -0
  19. package/dist/PanoRulerProPlugin/typings.d.ts +46 -0
  20. package/dist/base/BasePlugin.d.ts +100 -0
  21. package/dist/base/BasePluginWithData.d.ts +34 -0
  22. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +71 -78
  23. package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
  24. package/dist/floorplan/ModelFloorplanPlugin/index.js +1064 -567
  25. package/dist/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
  26. package/dist/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +23 -14
  27. package/dist/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
  28. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +489 -129
  29. package/dist/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
  30. package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +50 -58
  31. package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +5 -3
  32. package/dist/floorplan/TopviewFloorplanPlugin/index.js +1031 -443
  33. package/dist/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
  34. package/{libs/floorplan/ModelFloorplanPlugin → dist/floorplan}/utils/constant.d.ts +10 -3
  35. package/{libs/floorplan/ModelFloorplanPlugin → dist/floorplan}/utils/correctFiveState.d.ts +2 -1
  36. package/dist/index.d.ts +1 -0
  37. package/dist/index.es.js +3173 -1633
  38. package/dist/index.js +3194 -1653
  39. package/dist/index.umd.js +3090 -1549
  40. package/dist/shared-utils/five/changeMode.d.ts +4 -1
  41. package/dist/shared-utils/getPxmm.d.ts +8 -0
  42. package/dist/shared-utils/logger.d.ts +16 -0
  43. package/docs/assets/search.js +1 -1
  44. package/docs/classes/Magnifier.html +4 -4
  45. package/docs/classes/ModelRoomLabelController.html +4 -4
  46. package/docs/enums/CameraMovementEffect.html +2 -2
  47. package/docs/enums/DIRECTION.html +1 -1
  48. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
  49. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  50. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
  51. package/docs/enums/Rotation.html +2 -2
  52. package/docs/index.html +2 -2
  53. package/docs/interfaces/CSS3DRenderPluginExportType.html +2 -2
  54. package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
  55. package/docs/interfaces/FloorplanBounding.html +4 -4
  56. package/docs/interfaces/FloorplanData.html +2 -2
  57. package/docs/interfaces/FloorplanEntrance.html +7 -7
  58. package/docs/interfaces/FloorplanExtraObject.html +3 -3
  59. package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
  60. package/docs/interfaces/FloorplanFloorData.html +2 -2
  61. package/docs/interfaces/FloorplanImagePosition.html +2 -2
  62. package/docs/interfaces/FloorplanObserver.html +2 -2
  63. package/docs/interfaces/FloorplanOutlineItem.html +2 -2
  64. package/docs/interfaces/FloorplanPosition.html +2 -2
  65. package/docs/interfaces/FloorplanRoomItem.html +6 -6
  66. package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
  67. package/docs/interfaces/FloorplanServerBounding.html +4 -4
  68. package/docs/interfaces/FloorplanServerComputedData.html +1 -1
  69. package/docs/interfaces/FloorplanServerData.html +2 -2
  70. package/docs/interfaces/FloorplanServerEntrance.html +7 -7
  71. package/docs/interfaces/FloorplanServerFloorData.html +2 -2
  72. package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
  73. package/docs/interfaces/FloorplanServerObserver.html +2 -2
  74. package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
  75. package/docs/interfaces/FloorplanServerPosition.html +2 -2
  76. package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
  77. package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
  78. package/docs/interfaces/ItemLabelPluginData.html +1 -1
  79. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
  80. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
  81. package/docs/interfaces/LineJson.html +1 -1
  82. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  83. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  84. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  85. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  86. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  87. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  88. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  89. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  90. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  91. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  92. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  93. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  94. package/docs/interfaces/ModelViewPluginExportType.html +1 -1
  95. package/docs/interfaces/OpenParameter.html +2 -2
  96. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  97. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  98. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  99. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
  100. package/docs/interfaces/PanoMeasureParameterType.html +1 -1
  101. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  102. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  103. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  104. package/docs/interfaces/PanoRulerProPluginExportType.html +1 -0
  105. package/docs/interfaces/PanoRulerProPluginOptions.html +1 -0
  106. package/docs/interfaces/PanoRulerProPluginParameterType.html +1 -0
  107. package/docs/interfaces/PanoRulerProPluginState.html +1 -0
  108. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
  109. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
  110. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  111. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
  112. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  113. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
  114. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  115. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
  116. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
  117. package/docs/interfaces/Point.html +1 -1
  118. package/docs/interfaces/PointJson.html +1 -1
  119. package/docs/interfaces/Room.html +1 -1
  120. package/docs/interfaces/RoomInfo.html +1 -1
  121. package/docs/interfaces/RoomLabel.html +7 -7
  122. package/docs/interfaces/RoomRules.html +1 -1
  123. package/docs/interfaces/Rooms.html +1 -1
  124. package/docs/modules.html +19 -27
  125. package/libs/ItemLabelPlugin/ItemLabelComponent.js +21 -41
  126. package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +16 -36
  127. package/libs/ModelViewPlugin/Plugin.d.ts +4 -4
  128. package/libs/ModelViewPlugin/Plugin.js +2 -3
  129. package/libs/PanoMeasurePlugin/Controller/index.js +4 -2
  130. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +1 -1
  131. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.js +1 -1
  132. package/libs/PanoMeasurePlugin/Modules/GuideController.js +2 -2
  133. package/libs/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +0 -4
  134. package/libs/PanoMeasurePlugin/Modules/UIController/HTML.js +66 -55
  135. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +0 -3
  136. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +51 -73
  137. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +7 -4
  138. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +10 -12
  139. package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
  140. package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +2 -2
  141. package/libs/PanoMeasurePlugin/Modules/UIController/{NewMainBtnController.d.ts → mobileMainBtnController.d.ts} +1 -1
  142. package/libs/PanoMeasurePlugin/Modules/UIController/{NewMainBtnController.js → mobileMainBtnController.js} +4 -4
  143. package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +0 -3
  144. package/libs/PanoMeasurePlugin/Modules/UIController/style.js +7 -24
  145. package/libs/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +1 -1
  146. package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +1 -1
  147. package/libs/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +2 -0
  148. package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +1 -2
  149. package/libs/PanoMeasurePlugin/typings/data.d.ts +5 -0
  150. package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +6 -1
  151. package/libs/PanoMeasurePlugin/utils/mouseGroup.js +55 -7
  152. package/libs/PanoRulerProPlugin/Controller.d.ts +15 -0
  153. package/libs/PanoRulerProPlugin/Controller.js +110 -0
  154. package/libs/PanoRulerProPlugin/RulerItem.js +314 -0
  155. package/libs/PanoRulerProPlugin/RulerItems.js +377 -0
  156. package/libs/PanoRulerProPlugin/index.d.ts +8 -0
  157. package/libs/PanoRulerProPlugin/index.js +8 -0
  158. package/libs/PanoRulerProPlugin/typings.d.ts +46 -0
  159. package/libs/{floorplan/ModelFloorplanPlugin/typings/events.type.js → PanoRulerProPlugin/typings.js} +0 -0
  160. package/libs/base/BasePlugin.d.ts +100 -0
  161. package/libs/base/BasePlugin.js +31 -0
  162. package/libs/base/BasePluginWithData.d.ts +34 -0
  163. package/libs/base/BasePluginWithData.js +4 -0
  164. package/libs/floorplan/Components/Compass.js +11 -11
  165. package/libs/floorplan/Components/CurrentFloor.js +24 -11
  166. package/libs/floorplan/Components/Main.js +21 -15
  167. package/libs/floorplan/Components/RoomHighlight/Room.js +44 -5
  168. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +29 -12
  169. package/libs/floorplan/Components/RoomLabels/RoomLabel.js +164 -15
  170. package/libs/floorplan/Components/RoomLabels/RoomLabels.js +68 -24
  171. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +1 -0
  172. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +11 -9
  173. package/libs/floorplan/Components/RuleLabels/RuleItem.js +2 -2
  174. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +71 -78
  175. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +439 -272
  176. package/libs/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
  177. package/libs/floorplan/ModelFloorplanPlugin/index.js +2 -2
  178. package/libs/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
  179. package/libs/floorplan/ModelFloorplanPlugin/typing.js +1 -0
  180. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +5 -5
  181. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +114 -53
  182. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +23 -14
  183. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +162 -52
  184. package/libs/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
  185. package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +2 -2
  186. package/libs/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
  187. package/libs/floorplan/PanoFloorplanRadarPlugin/typing.js +1 -0
  188. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +50 -58
  189. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +320 -174
  190. package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +5 -3
  191. package/libs/floorplan/TopviewFloorplanPlugin/index.js +2 -2
  192. package/libs/floorplan/TopviewFloorplanPlugin/style.js +1 -1
  193. package/libs/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
  194. package/libs/floorplan/TopviewFloorplanPlugin/typing.js +1 -0
  195. package/{dist/floorplan/ModelFloorplanPlugin → libs/floorplan}/utils/constant.d.ts +10 -3
  196. package/libs/floorplan/{ModelFloorplanPlugin/utils → utils}/constant.js +9 -2
  197. package/{dist/floorplan/ModelFloorplanPlugin → libs/floorplan}/utils/correctFiveState.d.ts +2 -1
  198. package/libs/floorplan/{ModelFloorplanPlugin/utils → utils}/correctFiveState.js +16 -16
  199. package/libs/index.d.ts +1 -0
  200. package/libs/index.js +2 -0
  201. package/libs/shared-utils/five/changeMode.d.ts +4 -1
  202. package/libs/shared-utils/five/changeMode.js +34 -13
  203. package/libs/shared-utils/getPxmm.d.ts +8 -0
  204. package/libs/shared-utils/getPxmm.js +25 -20
  205. package/libs/shared-utils/logger.d.ts +16 -0
  206. package/libs/shared-utils/logger.js +47 -0
  207. package/package.json +2 -2
  208. package/dist/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +0 -23
  209. package/docs/classes/PanoFloorplanRadarPluginController.html +0 -3
  210. package/docs/enums/ModelFloorplanErrorType.html +0 -1
  211. package/docs/interfaces/ModelFloorplanParameterType.html +0 -1
  212. package/docs/interfaces/ModelFloorplanViewEvent.html +0 -5
  213. package/docs/interfaces/PanoFloorplanRadarPluginControllerParameter.html +0 -1
  214. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +0 -19
  215. package/libs/ModelSimulationPlugin/index.d.ts +0 -33
  216. package/libs/ModelSimulationPlugin/index.js +0 -166
  217. package/libs/ModelSimulationPlugin/shaders/fragment.d.ts +0 -2
  218. package/libs/ModelSimulationPlugin/shaders/fragment.js +0 -96
  219. package/libs/ModelSimulationPlugin/shaders/vertex.d.ts +0 -2
  220. package/libs/ModelSimulationPlugin/shaders/vertex.js +0 -23
  221. package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.d.ts +0 -1
  222. package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.js +0 -1
  223. package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.js +0 -120
  224. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +0 -106
  225. package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.js +0 -463
  226. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +0 -375
  227. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +0 -171
  228. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.js +0 -265
  229. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +0 -301
  230. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.js +0 -219
  231. package/libs/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +0 -23
  232. package/libs/shared-utils/five/useFivePlugin.d.ts +0 -1
  233. package/libs/shared-utils/five/useFivePlugin.js +0 -8
  234. package/libs/shared-utils/useDebounce.d.ts +0 -8
  235. package/libs/shared-utils/useDebounce.js +0 -22
  236. package/libs/shared-utils/useThrottle.d.ts +0 -8
  237. package/libs/shared-utils/useThrottle.js +0 -25
@@ -5,6 +5,7 @@ import {
5
5
  append,
6
6
  append_styles,
7
7
  attr,
8
+ binding_callbacks,
8
9
  detach,
9
10
  element,
10
11
  empty,
@@ -18,14 +19,16 @@ import {
18
19
  text
19
20
  } from "svelte/internal";
20
21
 
22
+ import { onMount } from 'svelte';
23
+
21
24
  function add_css(target) {
22
- append_styles(target, "svelte-1ashbdx", ".floorplan-plugin__room-label-item.svelte-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.svelte-1ashbdx{opacity:0.45}");
25
+ append_styles(target, "svelte-1b5j2lp", ".floorplan-plugin__room-label-item.svelte-1b5j2lp{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:1;color:#fff;transform:translate(-50%, -50%);white-space:nowrap;will-change:opacity;transition:opacity 300ms}.floorplan-plugin__room-size.svelte-1b5j2lp{opacity:0.45}");
23
26
  }
24
27
 
25
- // (22:30)
28
+ // (95:30)
26
29
  function create_if_block_1(ctx) {
27
30
  let html_tag;
28
- let raw_value = /*userConfigElement*/ ctx[2].outerHTML + "";
31
+ let raw_value = /*userConfigElement*/ ctx[4].outerHTML + "";
29
32
  let html_anchor;
30
33
 
31
34
  return {
@@ -39,7 +42,7 @@ function create_if_block_1(ctx) {
39
42
  insert(target, html_anchor, anchor);
40
43
  },
41
44
  p(ctx, dirty) {
42
- if (dirty & /*userConfigElement*/ 4 && raw_value !== (raw_value = /*userConfigElement*/ ctx[2].outerHTML + "")) html_tag.p(raw_value);
45
+ if (dirty & /*userConfigElement*/ 16 && raw_value !== (raw_value = /*userConfigElement*/ ctx[4].outerHTML + "")) html_tag.p(raw_value);
43
46
  },
44
47
  d(detaching) {
45
48
  if (detaching) detach(html_anchor);
@@ -48,7 +51,7 @@ function create_if_block_1(ctx) {
48
51
  };
49
52
  }
50
53
 
51
- // (16:2) {#if getLabelElement === undefined}
54
+ // (89:2) {#if getLabelElement === undefined}
52
55
  function create_if_block(ctx) {
53
56
  let span0;
54
57
  let t0_value = /*room*/ ctx[0].name + "";
@@ -62,9 +65,9 @@ function create_if_block(ctx) {
62
65
  t0 = text(t0_value);
63
66
  t1 = space();
64
67
  span1 = element("span");
65
- span1.textContent = `${/*roomSizeDes*/ ctx[3]}`;
68
+ span1.textContent = `${/*roomSizeDes*/ ctx[5]}`;
66
69
  attr(span0, "class", "floorplan-plugin__room-name");
67
- attr(span1, "class", "floorplan-plugin__room-size svelte-1ashbdx");
70
+ attr(span1, "class", "floorplan-plugin__room-size svelte-1b5j2lp");
68
71
  },
69
72
  m(target, anchor) {
70
73
  insert(target, span0, anchor);
@@ -88,7 +91,7 @@ function create_fragment(ctx) {
88
91
 
89
92
  function select_block_type(ctx, dirty) {
90
93
  if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block;
91
- if (/*userConfigElement*/ ctx[2]) return create_if_block_1;
94
+ if (/*userConfigElement*/ ctx[4]) return create_if_block_1;
92
95
  }
93
96
 
94
97
  let current_block_type = select_block_type(ctx, -1);
@@ -98,14 +101,16 @@ function create_fragment(ctx) {
98
101
  c() {
99
102
  div = element("div");
100
103
  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);
104
+ attr(div, "class", "floorplan-plugin__room-label-item svelte-1b5j2lp");
105
+ set_style(div, "left", /*left*/ ctx[6], false);
106
+ set_style(div, "top", /*top*/ ctx[7], false);
107
+ set_style(div, "font-size", /*fontSize*/ ctx[8], false);
108
+ set_style(div, "opacity", /*labelVisible*/ ctx[3] ? '1' : '0', false);
105
109
  },
106
110
  m(target, anchor) {
107
111
  insert(target, div, anchor);
108
112
  if (if_block) if_block.m(div, null);
113
+ /*div_binding*/ ctx[15](div);
109
114
  },
110
115
  p(ctx, [dirty]) {
111
116
  if (current_block_type === (current_block_type = select_block_type(ctx, dirty)) && if_block) {
@@ -119,6 +124,10 @@ function create_fragment(ctx) {
119
124
  if_block.m(div, null);
120
125
  }
121
126
  }
127
+
128
+ if (dirty & /*labelVisible*/ 8) {
129
+ set_style(div, "opacity", /*labelVisible*/ ctx[3] ? '1' : '0', false);
130
+ }
122
131
  },
123
132
  i: noop,
124
133
  o: noop,
@@ -128,45 +137,185 @@ function create_fragment(ctx) {
128
137
  if (if_block) {
129
138
  if_block.d();
130
139
  }
140
+
141
+ /*div_binding*/ ctx[15](null);
131
142
  }
132
143
  };
133
144
  }
134
145
 
146
+ function isPointInPolygon(point, polygon) {
147
+ const x = point[0];
148
+ const y = point[1];
149
+ let inside = false;
150
+
151
+ for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
152
+ const xi = polygon[i][0];
153
+ const yi = polygon[i][1];
154
+ const xj = polygon[j][0];
155
+ const yj = polygon[j][1];
156
+ const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
157
+ if (intersect) inside = !inside;
158
+ }
159
+
160
+ return inside;
161
+ }
162
+
135
163
  function instance($$self, $$props, $$invalidate) {
164
+ let isLabelInRoom;
136
165
  let userConfigElement;
166
+ let labelVisible;
167
+ let { pxmm } = $$props;
137
168
  let { room } = $$props;
169
+ let { hoveredRoom } = $$props;
138
170
  let { getLabelElement } = $$props;
171
+ let { adaptiveRoomLabelVisibleEnable } = $$props;
172
+
173
+ function isLabelInRoomCurry(room, labelElementSize) {
174
+ if (labelElementSize.width === 0 || labelElementSize.height === 0) return () => false;
175
+ const polygon = room.path.map(({ x, y }) => [x, y]);
176
+ const labelPosition = room.roomLabel.position;
177
+ const { x, y } = labelPosition;
178
+ const { width, height } = labelElementSize;
179
+ const halfWidth = width / 2;
180
+ const halfHeight = height / 2;
181
+
182
+ return function isLabelInRoom(pxmm) {
183
+ const clientX = x * pxmm;
184
+ const clientY = y * pxmm;
185
+ const clientPolygon = polygon.map(([x, y]) => [x * pxmm, y * pxmm]);
186
+
187
+ // const
188
+ /** 围成 labelRect 的四个点
189
+ * 1----0
190
+ * | |
191
+ * 2----3
192
+ */
193
+ const labelRectClientPoints = [
194
+ [clientX + halfWidth, clientY - halfHeight],
195
+ [clientX - halfWidth, clientY - halfHeight],
196
+ [clientX - halfWidth, clientY + halfHeight],
197
+ [clientX + halfWidth, clientY + halfHeight]
198
+ ];
199
+
200
+ return labelRectClientPoints.every(point => isPointInPolygon(point, clientPolygon));
201
+ };
202
+ }
139
203
 
204
+ // ========== 获取设备宽高像素 ==========
140
205
  // TODO: 统一这里的判断条件,目前写了多处
141
206
  const bodyWidth = document.body.clientWidth;
142
207
 
143
208
  const bodyHeight = document.body.clientHeight;
144
209
  const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
210
+
211
+ // ====================================
145
212
  const roomLabel = room.roomLabel;
213
+
146
214
  const left = roomLabel.positionInImage.x * 100 + '%';
147
215
  const top = roomLabel.positionInImage.y * 100 + '%';
216
+
217
+ // 屏幕宽或高小于 500px 时,用 10px 字体,否则用 14px
148
218
  const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
149
219
 
220
+ let isHoverd = false;
221
+ let labelElement;
222
+ let labelElementSize;
223
+
224
+ hoveredRoom.subscribe(function onHoverdRoomUpdate(_room) {
225
+ $$invalidate(12, isHoverd = !!_room && _room.id === room.id);
226
+ });
227
+
228
+ onMount(() => {
229
+ // Label 能不能展示只跟房间大小有关
230
+ // 计算 LabelElement 宽高
231
+ const labelDomRect = labelElement === null || labelElement === void 0
232
+ ? void 0
233
+ : labelElement.getClientRects()[0];
234
+
235
+ $$invalidate(13, labelElementSize = {
236
+ width: labelDomRect.width,
237
+ height: labelDomRect.height
238
+ });
239
+ });
240
+
241
+ function div_binding($$value) {
242
+ binding_callbacks[$$value ? 'unshift' : 'push'](() => {
243
+ labelElement = $$value;
244
+ $$invalidate(2, labelElement);
245
+ });
246
+ }
247
+
150
248
  $$self.$$set = $$props => {
249
+ if ('pxmm' in $$props) $$invalidate(9, pxmm = $$props.pxmm);
151
250
  if ('room' in $$props) $$invalidate(0, room = $$props.room);
251
+ if ('hoveredRoom' in $$props) $$invalidate(10, hoveredRoom = $$props.hoveredRoom);
152
252
  if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
253
+ if ('adaptiveRoomLabelVisibleEnable' in $$props) $$invalidate(11, adaptiveRoomLabelVisibleEnable = $$props.adaptiveRoomLabelVisibleEnable);
153
254
  };
154
255
 
155
256
  $$self.$$.update = () => {
257
+ if ($$self.$$.dirty & /*labelElementSize, room*/ 8193) {
258
+ $: $$invalidate(14, isLabelInRoom = labelElementSize
259
+ ? isLabelInRoomCurry(room, labelElementSize)
260
+ : undefined);
261
+ }
262
+
156
263
  if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
157
- $: $$invalidate(2, userConfigElement = getLabelElement === null || getLabelElement === void 0
264
+ $: $$invalidate(4, userConfigElement = getLabelElement === null || getLabelElement === void 0
158
265
  ? void 0
159
266
  : getLabelElement(room));
160
267
  }
268
+
269
+ if ($$self.$$.dirty & /*adaptiveRoomLabelVisibleEnable, isHoverd, isLabelInRoom, pxmm*/ 23040) {
270
+ $: $$invalidate(3, labelVisible = adaptiveRoomLabelVisibleEnable
271
+ ? isHoverd
272
+ ? true
273
+ : !!(isLabelInRoom === null || isLabelInRoom === void 0
274
+ ? void 0
275
+ : isLabelInRoom(pxmm))
276
+ : true);
277
+ }
161
278
  };
162
279
 
163
- return [room, getLabelElement, userConfigElement, roomSizeDes, left, top, fontSize];
280
+ return [
281
+ room,
282
+ getLabelElement,
283
+ labelElement,
284
+ labelVisible,
285
+ userConfigElement,
286
+ roomSizeDes,
287
+ left,
288
+ top,
289
+ fontSize,
290
+ pxmm,
291
+ hoveredRoom,
292
+ adaptiveRoomLabelVisibleEnable,
293
+ isHoverd,
294
+ labelElementSize,
295
+ isLabelInRoom,
296
+ div_binding
297
+ ];
164
298
  }
165
299
 
166
300
  class Component extends SvelteComponent {
167
301
  constructor(options) {
168
302
  super();
169
- init(this, options, instance, create_fragment, safe_not_equal, { room: 0, getLabelElement: 1 }, add_css);
303
+
304
+ init(
305
+ this,
306
+ options,
307
+ instance,
308
+ create_fragment,
309
+ safe_not_equal,
310
+ {
311
+ pxmm: 9,
312
+ room: 0,
313
+ hoveredRoom: 10,
314
+ getLabelElement: 1,
315
+ adaptiveRoomLabelVisibleEnable: 11
316
+ },
317
+ add_css
318
+ );
170
319
  }
171
320
  }
172
321
 
@@ -1,6 +1,8 @@
1
1
  /* generated by Svelte v3.47.0 */
2
2
  import {
3
3
  SvelteComponent,
4
+ add_render_callback,
5
+ add_resize_listener,
4
6
  append_styles,
5
7
  assign,
6
8
  attr,
@@ -30,18 +32,19 @@ function add_css(target) {
30
32
 
31
33
  function get_each_context(ctx, list, i) {
32
34
  const child_ctx = ctx.slice();
33
- child_ctx[4] = list[i];
35
+ child_ctx[9] = list[i];
34
36
  return child_ctx;
35
37
  }
36
38
 
37
- // (8:0) {#if rooms}
39
+ // (17:0) {#if rooms}
38
40
  function create_if_block(ctx) {
39
41
  let div;
40
42
  let each_blocks = [];
41
43
  let each_1_lookup = new Map();
44
+ let div_resize_listener;
42
45
  let current;
43
- let each_value = /*rooms*/ ctx[1];
44
- const get_key = ctx => /*room*/ ctx[4].id;
46
+ let each_value = /*rooms*/ ctx[5];
47
+ const get_key = ctx => /*room*/ ctx[9].id;
45
48
 
46
49
  for (let i = 0; i < each_value.length; i += 1) {
47
50
  let child_ctx = get_each_context(ctx, each_value, i);
@@ -58,6 +61,7 @@ function create_if_block(ctx) {
58
61
  }
59
62
 
60
63
  attr(div, "class", "floorplan-plugin__room-labels svelte-447cof");
64
+ add_render_callback(() => /*div_elementresize_handler*/ ctx[8].call(div));
61
65
  },
62
66
  m(target, anchor) {
63
67
  insert(target, div, anchor);
@@ -66,11 +70,12 @@ function create_if_block(ctx) {
66
70
  each_blocks[i].m(div, null);
67
71
  }
68
72
 
73
+ div_resize_listener = add_resize_listener(div, /*div_elementresize_handler*/ ctx[8].bind(div));
69
74
  current = true;
70
75
  },
71
76
  p(ctx, dirty) {
72
- if (dirty & /*rooms, getLabelElement*/ 3) {
73
- each_value = /*rooms*/ ctx[1];
77
+ if (dirty & /*pxmm, rooms, getLabelElement, hoveredRoom, adaptiveRoomLabelVisibleEnable*/ 55) {
78
+ each_value = /*rooms*/ ctx[5];
74
79
  group_outros();
75
80
  each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, outro_and_destroy_block, create_each_block, null, get_each_context);
76
81
  check_outros();
@@ -98,11 +103,13 @@ function create_if_block(ctx) {
98
103
  for (let i = 0; i < each_blocks.length; i += 1) {
99
104
  each_blocks[i].d();
100
105
  }
106
+
107
+ div_resize_listener();
101
108
  }
102
109
  };
103
110
  }
104
111
 
105
- // (10:4) {#each rooms as room (room.id)}
112
+ // (19:4) {#each rooms as room (room.id)}
106
113
  function create_each_block(key_1, ctx) {
107
114
  let first;
108
115
  let roomlabel;
@@ -110,8 +117,11 @@ function create_each_block(key_1, ctx) {
110
117
 
111
118
  const roomlabel_spread_levels = [
112
119
  {
113
- room: /*room*/ ctx[4],
114
- getLabelElement: /*getLabelElement*/ ctx[0]
120
+ pxmm: /*pxmm*/ ctx[4],
121
+ room: /*room*/ ctx[9],
122
+ getLabelElement: /*getLabelElement*/ ctx[1],
123
+ hoveredRoom: /*hoveredRoom*/ ctx[0],
124
+ adaptiveRoomLabelVisibleEnable: /*adaptiveRoomLabelVisibleEnable*/ ctx[2]
115
125
  }
116
126
  ];
117
127
 
@@ -139,11 +149,14 @@ function create_each_block(key_1, ctx) {
139
149
  p(new_ctx, dirty) {
140
150
  ctx = new_ctx;
141
151
 
142
- const roomlabel_changes = (dirty & /*rooms, getLabelElement*/ 3)
152
+ const roomlabel_changes = (dirty & /*pxmm, rooms, getLabelElement, hoveredRoom, adaptiveRoomLabelVisibleEnable*/ 55)
143
153
  ? get_spread_update(roomlabel_spread_levels, [
144
154
  {
145
- room: /*room*/ ctx[4],
146
- getLabelElement: /*getLabelElement*/ ctx[0]
155
+ pxmm: /*pxmm*/ ctx[4],
156
+ room: /*room*/ ctx[9],
157
+ getLabelElement: /*getLabelElement*/ ctx[1],
158
+ hoveredRoom: /*hoveredRoom*/ ctx[0],
159
+ adaptiveRoomLabelVisibleEnable: /*adaptiveRoomLabelVisibleEnable*/ ctx[2]
147
160
  }
148
161
  ])
149
162
  : {};
@@ -169,7 +182,7 @@ function create_each_block(key_1, ctx) {
169
182
  function create_fragment(ctx) {
170
183
  let if_block_anchor;
171
184
  let current;
172
- let if_block = /*rooms*/ ctx[1] && create_if_block(ctx);
185
+ let if_block = /*rooms*/ ctx[5] && create_if_block(ctx);
173
186
 
174
187
  return {
175
188
  c() {
@@ -182,11 +195,11 @@ function create_fragment(ctx) {
182
195
  current = true;
183
196
  },
184
197
  p(ctx, [dirty]) {
185
- if (/*rooms*/ ctx[1]) {
198
+ if (/*rooms*/ ctx[5]) {
186
199
  if (if_block) {
187
200
  if_block.p(ctx, dirty);
188
201
 
189
- if (dirty & /*rooms*/ 2) {
202
+ if (dirty & /*rooms*/ 32) {
190
203
  transition_in(if_block, 1);
191
204
  }
192
205
  } else {
@@ -225,21 +238,50 @@ function instance($$self, $$props, $$invalidate) {
225
238
  let rooms;
226
239
  let { floorIndex } = $$props;
227
240
  let { floorplanData } = $$props;
241
+ let { hoveredRoom } = $$props;
228
242
  let { getLabelElement } = $$props;
243
+ let { adaptiveRoomLabelVisibleEnable } = $$props;
244
+ let clientWidth = 0;
245
+ let pxmm = 0;
246
+
247
+ function div_elementresize_handler() {
248
+ clientWidth = this.clientWidth;
249
+ $$invalidate(3, clientWidth);
250
+ }
229
251
 
230
252
  $$self.$$set = $$props => {
231
- if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
232
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
233
- if ('getLabelElement' in $$props) $$invalidate(0, getLabelElement = $$props.getLabelElement);
253
+ if ('floorIndex' in $$props) $$invalidate(6, floorIndex = $$props.floorIndex);
254
+ if ('floorplanData' in $$props) $$invalidate(7, floorplanData = $$props.floorplanData);
255
+ if ('hoveredRoom' in $$props) $$invalidate(0, hoveredRoom = $$props.hoveredRoom);
256
+ if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
257
+ if ('adaptiveRoomLabelVisibleEnable' in $$props) $$invalidate(2, adaptiveRoomLabelVisibleEnable = $$props.adaptiveRoomLabelVisibleEnable);
234
258
  };
235
259
 
236
260
  $$self.$$.update = () => {
237
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
238
- $: $$invalidate(1, rooms = floorplanData.floorDatas[floorIndex].rooms);
261
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 192) {
262
+ $: $$invalidate(5, rooms = floorplanData.floorDatas[floorIndex].rooms);
263
+ }
264
+
265
+ if ($$self.$$.dirty & /*floorplanData, clientWidth*/ 136) {
266
+ $: {
267
+ const { max, min } = floorplanData.bounding;
268
+ const boundingWidth = max.x - min.x;
269
+ $$invalidate(4, pxmm = clientWidth / boundingWidth);
270
+ }
239
271
  }
240
272
  };
241
273
 
242
- return [getLabelElement, rooms, floorIndex, floorplanData];
274
+ return [
275
+ hoveredRoom,
276
+ getLabelElement,
277
+ adaptiveRoomLabelVisibleEnable,
278
+ clientWidth,
279
+ pxmm,
280
+ rooms,
281
+ floorIndex,
282
+ floorplanData,
283
+ div_elementresize_handler
284
+ ];
243
285
  }
244
286
 
245
287
  class Component extends SvelteComponent {
@@ -253,9 +295,11 @@ class Component extends SvelteComponent {
253
295
  create_fragment,
254
296
  safe_not_equal,
255
297
  {
256
- floorIndex: 2,
257
- floorplanData: 3,
258
- getLabelElement: 0
298
+ floorIndex: 6,
299
+ floorplanData: 7,
300
+ hoveredRoom: 0,
301
+ getLabelElement: 1,
302
+ adaptiveRoomLabelVisibleEnable: 2
259
303
  },
260
304
  add_css
261
305
  );
@@ -46,6 +46,7 @@ function create_fragment(ctx) {
46
46
  attr(pattern, "width", /*width*/ ctx[1]);
47
47
  attr(pattern, "height", /*width*/ ctx[1]);
48
48
  attr(pattern, "patternUnits", "userSpaceOnUse");
49
+ attr(pattern, "patternTransform", "scale(50 50)");
49
50
  attr(path1, "d", /*d*/ ctx[0]);
50
51
  attr(path1, "fill", "url(#fpm-room-pattern-0)");
51
52
  },
@@ -40,8 +40,8 @@ function create_fragment(ctx) {
40
40
  path1 = svg_element("path");
41
41
  t2 = space();
42
42
  path2 = svg_element("path");
43
- attr(rect0, "x", "0.5");
44
- attr(rect0, "y", "0.5");
43
+ attr(rect0, "x", "0");
44
+ attr(rect0, "y", "0");
45
45
  attr(rect0, "width", "6");
46
46
  attr(rect0, "height", "50");
47
47
  attr(rect0, "fill", "none");
@@ -50,22 +50,24 @@ function create_fragment(ctx) {
50
50
  attr(pattern0, "id", "room-material-pattern-1");
51
51
  attr(pattern0, "x", "0");
52
52
  attr(pattern0, "y", "0");
53
- attr(pattern0, "width", "13");
54
- attr(pattern0, "height", "51");
53
+ attr(pattern0, "width", "12");
54
+ attr(pattern0, "height", "50");
55
55
  attr(pattern0, "patternUnits", "userSpaceOnUse");
56
- attr(rect1, "x", "0.5");
57
- attr(rect1, "y", "0.5");
56
+ attr(pattern0, "patternTransform", "scale(50 50)");
57
+ attr(rect1, "x", "0");
58
+ attr(rect1, "y", "0");
58
59
  attr(rect1, "width", "6");
59
60
  attr(rect1, "height", "50");
60
61
  attr(rect1, "fill", "none");
61
62
  attr(rect1, "stroke", "#4B4B57");
62
63
  attr(rect1, "stroke-width", "0.5");
63
64
  attr(pattern1, "id", "room-material-pattern-2");
64
- attr(pattern1, "x", "7");
65
+ attr(pattern1, "x", "6");
65
66
  attr(pattern1, "y", "25");
66
- attr(pattern1, "width", "13");
67
- attr(pattern1, "height", "51");
67
+ attr(pattern1, "width", "12");
68
+ attr(pattern1, "height", "50");
68
69
  attr(pattern1, "patternUnits", "userSpaceOnUse");
70
+ attr(pattern1, "patternTransform", "scale(50 50)");
69
71
  attr(path0, "d", /*d*/ ctx[0]);
70
72
  attr(path0, "fill", "#43434D");
71
73
  attr(path1, "d", /*d*/ ctx[0]);
@@ -36,7 +36,7 @@ function get_each_context_1(ctx, list, i) {
36
36
  return child_ctx;
37
37
  }
38
38
 
39
- // (53:4) {#each rulerLabels as rulerLabel}
39
+ // (47:4) {#each rulerLabels as rulerLabel}
40
40
  function create_each_block_1(ctx) {
41
41
  let div;
42
42
 
@@ -57,7 +57,7 @@ function create_each_block_1(ctx) {
57
57
  };
58
58
  }
59
59
 
60
- // (62:4) {#each rulerTexts as textItem, textItemIndex (textItemIndex)}
60
+ // (56:4) {#each rulerTexts as textItem, textItemIndex (textItemIndex)}
61
61
  function create_each_block(key_1, ctx) {
62
62
  let div1;
63
63
  let div0;