@realsee/dnalogel 2.0.0-alpha.9 → 2.0.0-beta.36

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 (485) hide show
  1. package/README.md +78 -28
  2. package/components/index.js +1450 -0
  3. package/dist/CSS3DRenderPlugin/Plugin.d.ts +49 -0
  4. package/dist/CSS3DRenderPlugin/index.d.ts +3 -48
  5. package/dist/CSS3DRenderPlugin/index.js +27 -26
  6. package/dist/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
  7. package/dist/CameraMovementPlugin/index.d.ts +4 -6
  8. package/dist/CameraMovementPlugin/index.js +12 -12
  9. package/dist/CameraMovementPlugin/typing.d.ts +1 -1
  10. package/dist/ItemLabelPlugin/Plugin.d.ts +4 -0
  11. package/dist/ItemLabelPlugin/events.type.d.ts +9 -0
  12. package/dist/ItemLabelPlugin/index.d.ts +9 -0
  13. package/dist/ItemLabelPlugin/index.js +941 -0
  14. package/dist/ItemLabelPlugin/typings.d.ts +59 -0
  15. package/dist/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
  16. package/dist/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
  17. package/dist/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
  18. package/dist/ItemLabelPlugin/utils/parseData.d.ts +3 -0
  19. package/dist/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
  20. package/dist/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
  21. package/dist/ModelChassisCompassPlugin/index.d.ts +3 -18
  22. package/dist/ModelChassisCompassPlugin/index.js +8 -5
  23. package/dist/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
  24. package/dist/ModelEntryDoorGuidePlugin/index.d.ts +3 -25
  25. package/dist/ModelEntryDoorGuidePlugin/index.js +20 -20
  26. package/dist/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
  27. package/dist/ModelItemLabelPlugin/events.type.d.ts +9 -0
  28. package/dist/ModelItemLabelPlugin/index.d.ts +9 -0
  29. package/dist/ModelItemLabelPlugin/index.js +674 -0
  30. package/dist/ModelItemLabelPlugin/typings.d.ts +56 -0
  31. package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
  32. package/dist/ModelRoomLabelPlugin/index.js +153 -73
  33. package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  34. package/dist/ModelTVVideoPlugin/Plugin.d.ts +4 -0
  35. package/dist/ModelTVVideoPlugin/index.d.ts +5 -0
  36. package/dist/ModelTVVideoPlugin/index.js +301 -0
  37. package/dist/ModelTVVideoPlugin/typings.d.ts +25 -0
  38. package/dist/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
  39. package/dist/ModelViewPlugin/Plugin.d.ts +17 -0
  40. package/dist/ModelViewPlugin/index.d.ts +3 -16
  41. package/dist/PanoCompassPlugin/Plugin.d.ts +47 -0
  42. package/dist/PanoCompassPlugin/index.d.ts +4 -47
  43. package/dist/PanoCompassPlugin/index.js +242 -129
  44. package/dist/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  45. package/dist/PanoCursorRaycasterPlugin/index.js +5 -3
  46. package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +12 -9
  47. package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  48. package/dist/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
  49. package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  50. package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +2 -1
  51. package/dist/PanoMeasurePlugin/Controller/index.d.ts +18 -9
  52. package/dist/PanoMeasurePlugin/Model/index.d.ts +2 -2
  53. package/dist/PanoMeasurePlugin/Model/line.d.ts +5 -5
  54. package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -2
  55. package/dist/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  56. package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
  57. package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
  58. package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +5 -2
  59. package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  60. package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  61. package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +50 -15
  62. package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  63. package/dist/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
  64. package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  65. package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +5 -1
  66. package/dist/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
  67. package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
  68. package/dist/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
  69. package/dist/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
  70. package/dist/PanoMeasurePlugin/index.d.ts +9 -6
  71. package/dist/PanoMeasurePlugin/index.js +2649 -3442
  72. package/dist/PanoMeasurePlugin/typings/data.d.ts +4 -0
  73. package/dist/PanoMeasurePlugin/typings/event.type.d.ts +14 -5
  74. package/dist/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
  75. package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  76. package/dist/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  77. package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  78. package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  79. package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  80. package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  81. package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  82. package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  83. package/dist/PanoMeasurePlugin/utils/line.d.ts +1 -1
  84. package/dist/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
  85. package/dist/PanoRulerPlugin/Plugin.d.ts +31 -0
  86. package/dist/PanoRulerPlugin/index.d.ts +4 -30
  87. package/dist/PanoRulerPlugin/index.js +12 -12
  88. package/dist/PanoSpatialTagPlugin/Plugin.d.ts +35 -0
  89. package/dist/PanoSpatialTagPlugin/index.d.ts +5 -0
  90. package/dist/PanoSpatialTagPlugin/index.js +1307 -0
  91. package/dist/PanoSpatialTagPlugin/store.d.ts +1 -0
  92. package/dist/PanoSpatialTagPlugin/style.d.ts +1 -0
  93. package/dist/PanoSpatialTagPlugin/typings.d.ts +40 -0
  94. package/dist/base/BasePlugin.d.ts +100 -0
  95. package/dist/base/BasePluginWithData.d.ts +34 -0
  96. package/dist/components/PaintBrush/Controller.d.ts +43 -0
  97. package/dist/components/PaintBrush/Subscribe.d.ts +76 -0
  98. package/dist/components/PaintBrush/index.d.ts +27 -0
  99. package/dist/components/PaintBrush/style.d.ts +2 -0
  100. package/dist/components/PaintBrush/tween.d.ts +62 -0
  101. package/dist/components/PaintBrush/typings.d.ts +58 -0
  102. package/dist/components/PaintBrush/utils.d.ts +26 -0
  103. package/dist/components/index.d.ts +2 -0
  104. package/dist/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  105. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +70 -77
  106. package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
  107. package/dist/floorplan/ModelFloorplanPlugin/index.js +2319 -1620
  108. package/dist/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
  109. package/dist/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +24 -16
  110. package/dist/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
  111. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +601 -266
  112. package/dist/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
  113. package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +53 -47
  114. package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +6 -4
  115. package/dist/floorplan/TopviewFloorplanPlugin/index.js +2198 -1428
  116. package/dist/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
  117. package/dist/floorplan/index.d.ts +6 -0
  118. package/dist/floorplan/utils/constant.d.ts +22 -0
  119. package/dist/floorplan/utils/correctFiveState.d.ts +15 -0
  120. package/dist/floorplan/utils/formatPosition.d.ts +1 -1
  121. package/dist/index.d.ts +15 -24
  122. package/dist/index.es.js +10694 -7145
  123. package/dist/index.js +10432 -6869
  124. package/dist/index.umd.js +10435 -6875
  125. package/dist/shared-utils/five/changeMode.d.ts +4 -1
  126. package/dist/shared-utils/getPxmm.d.ts +8 -0
  127. package/dist/shared-utils/index.d.ts +1 -0
  128. package/dist/shared-utils/math/Interval.d.ts +13 -0
  129. package/dist/shared-utils/math/Rectangle.d.ts +27 -0
  130. package/dist/shared-utils/math/index.d.ts +2 -0
  131. package/dist/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  132. package/dist/shared-utils/three/getNormal.d.ts +1 -1
  133. package/dist/shared-utils/three/getTextureLoader.d.ts +1 -1
  134. package/dist/shared-utils/three/loadFbxObj.d.ts +1 -1
  135. package/dist/shared-utils/tinyEJSrender.d.ts +5 -0
  136. package/dist/shared-utils/uuid.d.ts +1 -0
  137. package/dist/shared-utils/vectorTocoordinates.d.ts +1 -1
  138. package/docs/assets/search.js +1 -1
  139. package/docs/classes/Magnifier.html +9 -0
  140. package/docs/classes/ModelRoomLabelController.html +5 -8
  141. package/docs/enums/CameraMovementEffect.html +3 -0
  142. package/docs/enums/DIRECTION.html +1 -0
  143. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -0
  144. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  145. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -0
  146. package/docs/enums/Rotation.html +3 -0
  147. package/docs/index.html +78 -33
  148. package/docs/interfaces/CSS3DRenderPluginExportType.html +4 -0
  149. package/docs/interfaces/CameraMovementPluginExportType.html +17 -0
  150. package/docs/interfaces/FloorplanBounding.html +10 -0
  151. package/docs/interfaces/FloorplanData.html +3 -0
  152. package/docs/interfaces/FloorplanEntrance.html +15 -0
  153. package/docs/interfaces/FloorplanExtraObject.html +7 -0
  154. package/docs/interfaces/FloorplanExtraObject3D.html +3 -0
  155. package/docs/interfaces/FloorplanFloorData.html +3 -0
  156. package/docs/interfaces/FloorplanImagePosition.html +3 -0
  157. package/docs/interfaces/FloorplanObserver.html +5 -0
  158. package/docs/interfaces/FloorplanOutlineItem.html +3 -0
  159. package/docs/interfaces/FloorplanPosition.html +3 -0
  160. package/docs/interfaces/FloorplanRoomItem.html +17 -0
  161. package/docs/interfaces/FloorplanRoomLabelItem.html +7 -0
  162. package/docs/interfaces/FloorplanServerBounding.html +10 -0
  163. package/docs/interfaces/FloorplanServerComputedData.html +1 -0
  164. package/docs/interfaces/FloorplanServerData.html +3 -0
  165. package/docs/interfaces/FloorplanServerEntrance.html +15 -0
  166. package/docs/interfaces/FloorplanServerFloorData.html +3 -0
  167. package/docs/interfaces/FloorplanServerImagePosition.html +3 -0
  168. package/docs/interfaces/FloorplanServerObserver.html +5 -0
  169. package/docs/interfaces/FloorplanServerOutlineItem.html +3 -0
  170. package/docs/interfaces/FloorplanServerPosition.html +3 -0
  171. package/docs/interfaces/FloorplanServerRoomItem.html +20 -0
  172. package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -0
  173. package/docs/interfaces/ItemLabelPluginData.html +1 -0
  174. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -0
  175. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -0
  176. package/docs/interfaces/LineJson.html +1 -1
  177. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  178. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  179. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  180. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  181. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  182. package/docs/interfaces/ModelItemLabelPluginData.html +1 -0
  183. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -0
  184. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -0
  185. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  186. package/docs/interfaces/ModelTVVideoPluginData.html +1 -0
  187. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -0
  188. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -0
  189. package/docs/interfaces/ModelViewPluginExportType.html +1 -0
  190. package/docs/interfaces/OpenParameter.html +3 -0
  191. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  192. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  193. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  194. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -0
  195. package/docs/interfaces/PanoMeasureParameterType.html +1 -0
  196. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  197. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  198. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  199. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -0
  200. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -0
  201. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -0
  202. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -0
  203. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -0
  204. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -0
  205. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -0
  206. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -0
  207. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -0
  208. package/docs/interfaces/Point.html +1 -0
  209. package/docs/interfaces/PointJson.html +1 -1
  210. package/docs/interfaces/Room.html +1 -0
  211. package/docs/interfaces/RoomInfo.html +1 -0
  212. package/docs/interfaces/RoomLabel.html +7 -7
  213. package/docs/interfaces/RoomRules.html +1 -0
  214. package/docs/interfaces/Rooms.html +1 -0
  215. package/docs/modules.html +26 -18
  216. package/libs/CSS3DRenderPlugin/Plugin.d.ts +49 -0
  217. package/libs/CSS3DRenderPlugin/Plugin.js +182 -0
  218. package/libs/CSS3DRenderPlugin/index.d.ts +3 -48
  219. package/libs/CSS3DRenderPlugin/index.js +2 -180
  220. package/libs/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
  221. package/libs/CameraMovementPlugin/CameraMovementPlugin.js +159 -0
  222. package/libs/CameraMovementPlugin/index.d.ts +4 -6
  223. package/libs/CameraMovementPlugin/index.js +3 -158
  224. package/libs/CameraMovementPlugin/typing.d.ts +1 -1
  225. package/libs/ItemLabelPlugin/ItemLabelComponent.js +577 -0
  226. package/libs/ItemLabelPlugin/ItemLabelItem.js +227 -0
  227. package/libs/ItemLabelPlugin/Plugin.d.ts +4 -0
  228. package/libs/ItemLabelPlugin/Plugin.js +120 -0
  229. package/libs/ItemLabelPlugin/events.type.d.ts +9 -0
  230. package/libs/ItemLabelPlugin/events.type.js +1 -0
  231. package/libs/ItemLabelPlugin/index.d.ts +9 -0
  232. package/libs/ItemLabelPlugin/index.js +8 -0
  233. package/libs/ItemLabelPlugin/typings.d.ts +59 -0
  234. package/libs/ItemLabelPlugin/typings.js +7 -0
  235. package/libs/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
  236. package/libs/ItemLabelPlugin/utils/getLabelTransform.js +3 -0
  237. package/libs/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
  238. package/libs/ItemLabelPlugin/utils/getStrokeLength.js +16 -0
  239. package/libs/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
  240. package/libs/ItemLabelPlugin/utils/isImpacted.js +13 -0
  241. package/libs/ItemLabelPlugin/utils/parseData.d.ts +3 -0
  242. package/libs/ItemLabelPlugin/utils/parseData.js +4 -0
  243. package/libs/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
  244. package/libs/ItemLabelPlugin/utils/transform2RenderData.js +4 -0
  245. package/libs/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
  246. package/libs/ModelChassisCompassPlugin/Plugin.js +77 -0
  247. package/libs/ModelChassisCompassPlugin/index.d.ts +3 -18
  248. package/libs/ModelChassisCompassPlugin/index.js +2 -74
  249. package/libs/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
  250. package/libs/ModelEntryDoorGuidePlugin/Plugin.js +140 -0
  251. package/libs/ModelEntryDoorGuidePlugin/index.d.ts +3 -25
  252. package/libs/ModelEntryDoorGuidePlugin/index.js +2 -136
  253. package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +409 -0
  254. package/libs/ModelItemLabelPlugin/ItemLabelItem.js +133 -0
  255. package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
  256. package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +120 -0
  257. package/libs/ModelItemLabelPlugin/events.type.d.ts +9 -0
  258. package/libs/ModelItemLabelPlugin/events.type.js +1 -0
  259. package/libs/ModelItemLabelPlugin/index.d.ts +9 -0
  260. package/libs/ModelItemLabelPlugin/index.js +8 -0
  261. package/libs/ModelItemLabelPlugin/typings.d.ts +56 -0
  262. package/libs/ModelItemLabelPlugin/typings.js +7 -0
  263. package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
  264. package/libs/ModelItemLabelPlugin/utils/parseData.js +4 -0
  265. package/libs/ModelRoomLabelPlugin/Controller.js +65 -23
  266. package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +83 -45
  267. package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  268. package/libs/ModelSimulationPlugin/index.d.ts +33 -0
  269. package/libs/ModelSimulationPlugin/index.js +166 -0
  270. package/libs/ModelSimulationPlugin/shaders/fragment.d.ts +2 -0
  271. package/libs/ModelSimulationPlugin/shaders/fragment.js +96 -0
  272. package/libs/ModelSimulationPlugin/shaders/vertex.d.ts +2 -0
  273. package/libs/ModelSimulationPlugin/shaders/vertex.js +23 -0
  274. package/libs/ModelTVVideoPlugin/Plugin.d.ts +4 -0
  275. package/libs/ModelTVVideoPlugin/Plugin.js +254 -0
  276. package/libs/ModelTVVideoPlugin/index.d.ts +5 -0
  277. package/libs/ModelTVVideoPlugin/index.js +4 -0
  278. package/libs/ModelTVVideoPlugin/typings.d.ts +25 -0
  279. package/libs/ModelTVVideoPlugin/typings.js +8 -0
  280. package/libs/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
  281. package/libs/ModelTVVideoPlugin/utils/parseData.js +13 -0
  282. package/libs/ModelViewPlugin/Plugin.d.ts +17 -0
  283. package/libs/ModelViewPlugin/Plugin.js +160 -0
  284. package/libs/ModelViewPlugin/index.d.ts +3 -16
  285. package/libs/ModelViewPlugin/index.js +2 -159
  286. package/libs/PanoCompassPlugin/Plugin.d.ts +47 -0
  287. package/libs/PanoCompassPlugin/Plugin.js +249 -0
  288. package/libs/PanoCompassPlugin/index.d.ts +4 -47
  289. package/libs/PanoCompassPlugin/index.js +3 -167
  290. package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  291. package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
  292. package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +12 -9
  293. package/libs/PanoMeasurePlugin/Controller/BaseController.js +77 -14
  294. package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  295. package/libs/PanoMeasurePlugin/Controller/EditController.js +268 -155
  296. package/libs/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
  297. package/libs/PanoMeasurePlugin/Controller/MixedController.js +337 -0
  298. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  299. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +40 -20
  300. package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +2 -1
  301. package/libs/PanoMeasurePlugin/Controller/WatchController.js +246 -153
  302. package/libs/PanoMeasurePlugin/Controller/index.d.ts +18 -9
  303. package/libs/PanoMeasurePlugin/Controller/index.js +182 -54
  304. package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
  305. package/libs/PanoMeasurePlugin/Model/index.js +30 -5
  306. package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
  307. package/libs/PanoMeasurePlugin/Model/line.js +61 -11
  308. package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
  309. package/libs/PanoMeasurePlugin/Model/point.js +24 -4
  310. package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  311. package/libs/PanoMeasurePlugin/Model/polyline.js +20 -3
  312. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
  313. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +11 -14
  314. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
  315. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +1 -1
  316. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +5 -2
  317. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +107 -25
  318. package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  319. package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +23 -8
  320. package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  321. package/libs/PanoMeasurePlugin/Modules/GuideController.js +61 -26
  322. package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +50 -15
  323. package/libs/PanoMeasurePlugin/Modules/Magnifier.js +234 -59
  324. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  325. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +84 -38
  326. package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
  327. package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.js +98 -0
  328. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  329. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +52 -17
  330. package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +5 -1
  331. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +84 -34
  332. package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
  333. package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +80 -0
  334. package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
  335. package/libs/PanoMeasurePlugin/Modules/UIController/style.js +11 -1
  336. package/libs/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
  337. package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +64 -0
  338. package/libs/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
  339. package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +265 -0
  340. package/libs/PanoMeasurePlugin/index.d.ts +9 -6
  341. package/libs/PanoMeasurePlugin/index.js +3 -1
  342. package/libs/PanoMeasurePlugin/typings/data.d.ts +4 -0
  343. package/libs/PanoMeasurePlugin/typings/event.type.d.ts +14 -5
  344. package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
  345. package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.js +15 -0
  346. package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  347. package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  348. package/libs/PanoMeasurePlugin/utils/constants.js +7 -7
  349. package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  350. package/libs/PanoMeasurePlugin/utils/distanceDom.js +22 -16
  351. package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  352. package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  353. package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  354. package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  355. package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  356. package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
  357. package/libs/PanoMeasurePlugin/utils/line.js +8 -7
  358. package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
  359. package/libs/PanoMeasurePlugin/utils/mouseGroup.js +5 -5
  360. package/libs/PanoRulerPlugin/Plugin.d.ts +31 -0
  361. package/libs/PanoRulerPlugin/Plugin.js +403 -0
  362. package/libs/PanoRulerPlugin/index.d.ts +4 -30
  363. package/libs/PanoRulerPlugin/index.js +2 -397
  364. package/libs/PanoSpatialTagPlugin/Components/origins.js +168 -0
  365. package/libs/PanoSpatialTagPlugin/Components/tag.js +302 -0
  366. package/libs/PanoSpatialTagPlugin/Plugin.d.ts +35 -0
  367. package/libs/PanoSpatialTagPlugin/Plugin.js +426 -0
  368. package/libs/PanoSpatialTagPlugin/index.d.ts +5 -0
  369. package/libs/PanoSpatialTagPlugin/index.js +5 -0
  370. package/libs/PanoSpatialTagPlugin/store.d.ts +1 -0
  371. package/libs/PanoSpatialTagPlugin/store.js +2 -0
  372. package/libs/PanoSpatialTagPlugin/style.d.ts +1 -0
  373. package/libs/PanoSpatialTagPlugin/style.js +8 -0
  374. package/libs/PanoSpatialTagPlugin/typings.d.ts +40 -0
  375. package/libs/PanoSpatialTagPlugin/typings.js +1 -0
  376. package/libs/base/BasePlugin.d.ts +100 -0
  377. package/libs/base/BasePlugin.js +31 -0
  378. package/libs/base/BasePluginWithData.d.ts +34 -0
  379. package/libs/base/BasePluginWithData.js +4 -0
  380. package/libs/components/PaintBrush/Controller.d.ts +43 -0
  381. package/libs/components/PaintBrush/Controller.js +575 -0
  382. package/libs/components/PaintBrush/Subscribe.d.ts +76 -0
  383. package/libs/components/PaintBrush/Subscribe.js +121 -0
  384. package/libs/components/PaintBrush/index.d.ts +27 -0
  385. package/libs/components/PaintBrush/index.js +57 -0
  386. package/libs/components/PaintBrush/style.d.ts +2 -0
  387. package/libs/components/PaintBrush/style.js +102 -0
  388. package/libs/components/PaintBrush/tween.d.ts +62 -0
  389. package/libs/components/PaintBrush/tween.js +15 -0
  390. package/libs/components/PaintBrush/typings.d.ts +58 -0
  391. package/libs/components/PaintBrush/typings.js +6 -0
  392. package/libs/components/PaintBrush/utils.d.ts +26 -0
  393. package/libs/components/PaintBrush/utils.js +51 -0
  394. package/libs/components/index.d.ts +2 -0
  395. package/libs/components/index.js +3 -0
  396. package/libs/floorplan/Assets/compass.d.ts +1 -0
  397. package/libs/floorplan/Assets/compass.js +1 -0
  398. package/libs/floorplan/Components/BaseImage.js +10 -5
  399. package/libs/floorplan/Components/Camera.js +120 -0
  400. package/libs/floorplan/Components/Compass.js +120 -0
  401. package/libs/floorplan/Components/CurrentFloor.js +469 -0
  402. package/libs/floorplan/Components/Main.js +470 -0
  403. package/libs/floorplan/Components/RoomHighlight/Room.js +45 -8
  404. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +30 -103
  405. package/libs/floorplan/Components/RoomLabels/RoomLabel.js +322 -0
  406. package/libs/floorplan/Components/RoomLabels/RoomLabels.js +309 -0
  407. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +30 -27
  408. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +1 -0
  409. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +11 -9
  410. package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
  411. package/libs/floorplan/Components/RuleLabels/RuleLabels.js +269 -0
  412. package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.js +1 -1
  413. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +1 -1
  414. package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.js +1 -1
  415. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +1 -1
  416. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +1 -1
  417. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.js +1 -1
  418. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +1 -1
  419. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +70 -77
  420. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +661 -325
  421. package/libs/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
  422. package/libs/floorplan/ModelFloorplanPlugin/index.js +2 -2
  423. package/libs/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
  424. package/libs/floorplan/ModelFloorplanPlugin/typing.js +1 -0
  425. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +49 -33
  426. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +3 -1
  427. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +114 -53
  428. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +24 -16
  429. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +194 -42
  430. package/libs/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
  431. package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +2 -2
  432. package/libs/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
  433. package/libs/floorplan/PanoFloorplanRadarPlugin/typing.js +1 -0
  434. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +53 -47
  435. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +450 -154
  436. package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +6 -4
  437. package/libs/floorplan/TopviewFloorplanPlugin/index.js +2 -2
  438. package/libs/floorplan/TopviewFloorplanPlugin/style.js +1 -1
  439. package/libs/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
  440. package/libs/floorplan/TopviewFloorplanPlugin/typing.js +1 -0
  441. package/libs/floorplan/index.d.ts +6 -0
  442. package/libs/floorplan/index.js +7 -0
  443. package/libs/floorplan/utils/constant.d.ts +22 -0
  444. package/libs/floorplan/utils/constant.js +23 -0
  445. package/libs/floorplan/utils/correctFiveState.d.ts +15 -0
  446. package/libs/floorplan/utils/correctFiveState.js +46 -0
  447. package/libs/floorplan/utils/formatPosition.d.ts +1 -1
  448. package/libs/floorplan/utils/formatPosition.js +3 -3
  449. package/libs/index.d.ts +15 -24
  450. package/libs/index.js +25 -14
  451. package/libs/shared-utils/Subscribe.js +8 -1
  452. package/libs/shared-utils/animationFrame/BetterTween.js +47 -18
  453. package/libs/shared-utils/createCanvasTextTexture.js +6 -5
  454. package/libs/shared-utils/five/changeMode.d.ts +4 -1
  455. package/libs/shared-utils/five/changeMode.js +34 -13
  456. package/libs/shared-utils/getPxmm.d.ts +8 -0
  457. package/libs/shared-utils/getPxmm.js +25 -20
  458. package/libs/shared-utils/index.d.ts +1 -0
  459. package/libs/shared-utils/index.js +1 -0
  460. package/libs/shared-utils/math/Interval.d.ts +13 -0
  461. package/libs/shared-utils/math/Interval.js +40 -0
  462. package/libs/shared-utils/math/Rectangle.d.ts +27 -0
  463. package/libs/shared-utils/math/Rectangle.js +50 -0
  464. package/libs/shared-utils/math/evenNumber.js +1 -1
  465. package/libs/shared-utils/math/index.d.ts +2 -0
  466. package/libs/shared-utils/math/index.js +2 -0
  467. package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  468. package/libs/shared-utils/three/getNormal.d.ts +1 -1
  469. package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
  470. package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
  471. package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +2 -1
  472. package/libs/shared-utils/tinyEJSrender.d.ts +5 -0
  473. package/libs/shared-utils/tinyEJSrender.js +210 -0
  474. package/libs/shared-utils/uuid.d.ts +1 -0
  475. package/libs/shared-utils/uuid.js +1 -0
  476. package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
  477. package/package.json +13 -6
  478. package/CHANGELOG.md +0 -30
  479. package/dist/shared-utils/five/useFivePlugin.d.ts +0 -1
  480. package/dist/shared-utils/useDebounce.d.ts +0 -8
  481. package/dist/shared-utils/useThrottle.d.ts +0 -8
  482. package/docs/enums/ModelFloorplanErrorType.html +0 -1
  483. package/docs/interfaces/ModelFloorplanParameterType.html +0 -1
  484. package/docs/interfaces/ModelFloorplanViewEvent.html +0 -5
  485. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +0 -1
@@ -6,6 +6,9 @@ var THREE = require('three');
6
6
  var internal = require('svelte/internal');
7
7
  var easing = require('svelte/easing');
8
8
  var transition = require('svelte/transition');
9
+ var store = require('svelte/store');
10
+ var svelte = require('svelte');
11
+ var five = require('@realsee/five');
9
12
 
10
13
  function _interopNamespace(e) {
11
14
  if (e && e.__esModule) return e;
@@ -27,184 +30,109 @@ function _interopNamespace(e) {
27
30
 
28
31
  var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
29
32
 
30
- const pluginStyle = {
31
- position: 'absolute',
32
- left: '50%',
33
- top: '50%',
34
- transform: 'translate(-50%, -50%)',
35
- pointerEvents: 'none',
36
- zIndex: '10',
37
- };
38
-
39
- function pathD(points, options = {}) {
40
- let d = '';
41
- const { needZ, needA } = options;
42
- const _points = needZ ? points.slice().concat(points[0]) : points.slice();
43
- _points.forEach((_point, index) => {
44
- const { x, y } = options.format ? options.format(_point) : _point;
45
- const point = x + ',' + y;
46
- if (index === 0) {
47
- d += 'M' + point;
48
- return d;
49
- }
50
- if (needA?.[index]) {
51
- d += 'A' + needA[index] + ',' + point;
52
- return d;
53
- }
54
- d += 'L' + point;
55
- return d;
56
- });
57
- return d + (needZ ? 'Z' : '');
58
- }
59
- /** 把户型图上点点位转换到 SVG 上的点位 */
60
- function formatFloorplanPoint({ x, y }, pxmm, bounding) {
61
- const { max, min } = bounding;
62
- return { x: (x - min.x) * pxmm, y: (max.y - y) * pxmm };
33
+ /**
34
+ * 检查一个值是否是狭义上的对象
35
+ * @param {any} value 要检查的值
36
+ *
37
+ * isTruelyObject({})
38
+ * // => true
39
+ *
40
+ * isObjectLike([1, 2, 3])
41
+ * // => false
42
+ *
43
+ * isObjectLike(Function)
44
+ * // => false
45
+ *
46
+ * isObjectLike(null)
47
+ * // => false
48
+ *
49
+ */
50
+ function isTruelyObject(value) {
51
+ return Object.prototype.toString.call(value) === '[object Object]';
63
52
  }
64
53
 
65
- async function formatOutlines(outlines) {
66
- const headers = new Headers({ 'Content-Type': 'text/plain' });
67
- const getOutlineItem = async function (item) {
68
- const outlineItem = {
69
- index: item.index,
70
- url: item.url,
71
- svgUrl: item.svg_url,
72
- };
73
- if (item.svg_url) {
74
- const svgContent = await fetch(item.svg_url, { headers }).then((res) => res.text());
75
- outlineItem.svgContent = svgContent;
76
- }
77
- return outlineItem;
78
- };
79
- const svgOutlineItems = await Promise.all(outlines.map(getOutlineItem));
80
- return svgOutlineItems;
81
- }
82
- function formatRoom(data) {
83
- const floorplanRoomItem = {
84
- id: data.id,
85
- size: data.size,
86
- name: data.name,
87
- path: data.path,
88
- roomType: data.room_type,
89
- floorType: data.floor_type,
90
- roomLabel: {
91
- position: data.room_label.position,
92
- positionInImage: data.room_label.position_in_image,
93
- },
94
- observerIndexs: data.observer_indexs,
95
- };
96
- return floorplanRoomItem;
54
+ /* eslint-disable @typescript-eslint/no-use-before-define */
55
+ function baseIsEqual(value, other) {
56
+ if (value === other)
57
+ return true;
58
+ if (typeof value !== typeof other)
59
+ return false;
60
+ if (Number.isNaN(value) && Number.isNaN(other))
61
+ return true;
62
+ return false;
97
63
  }
98
- function formatFloorData(_data) {
99
- return {
100
- floorName: _data.floor_name,
101
- floorIndex: _data.floor_index,
102
- rooms: _data.rooms.map(formatRoom),
103
- rules: _data.rules,
104
- };
64
+ function objEqualShallow(value, other) {
65
+ const valueProps = Object.getOwnPropertyNames(value);
66
+ const otherProps = Object.getOwnPropertyNames(other);
67
+ if (valueProps.length !== otherProps.length)
68
+ return false;
69
+ for (let i = 0, len = valueProps.length; i < len; i++) {
70
+ const propName = valueProps[i];
71
+ if (!baseIsEqual(value[propName], other[propName]))
72
+ return false;
73
+ }
74
+ return true;
105
75
  }
106
- function formateFloorplanObserver(data) {
107
- const floorplanObserver = {
108
- index: data.index,
109
- floorIndex: data.floor_index,
110
- position: data.position,
111
- positionInImage: data.position_in_image,
112
- };
113
- return floorplanObserver;
76
+ function arrayEqualShallow(value, other) {
77
+ if (value.length !== other.length)
78
+ return false;
79
+ for (let i = 0, len = value.length; i < len; i++) {
80
+ if (!baseIsEqual(value[i], other[i]))
81
+ return false;
82
+ }
83
+ return true;
114
84
  }
115
- function formatFloorplanEntrance(data) {
116
- const floorplanEntrance = {
117
- rad: data.rad,
118
- position: data.position,
119
- positionInImage: data.position_in_image,
120
- northRad: data.north_rad,
121
- roomId: data.room_id,
122
- floorIndex: data.floor_index,
123
- };
124
- return floorplanEntrance;
85
+ function isShallowEqual(value, other) {
86
+ if (baseIsEqual(value, other))
87
+ return true;
88
+ if (isTruelyObject(value) && isTruelyObject(other))
89
+ return objEqualShallow(value, other);
90
+ if (Array.isArray(value) && Array.isArray(other))
91
+ return arrayEqualShallow(value, other);
92
+ return false;
125
93
  }
126
- async function formatData(data) {
127
- const outlines = await formatOutlines(data.outlines);
128
- const bounding = data.computed_data.bounding;
129
- const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
130
- const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
131
- const floorplanData = {
132
- outlines,
133
- entrance,
134
- bounding,
135
- floorDatas,
136
- observers: data.computed_data.observers.map(formateFloorplanObserver),
137
- };
138
- return floorplanData;
94
+ function isDeepEqual(value, other) {
95
+ if (baseIsEqual(value, other))
96
+ return true;
97
+ if (isTruelyObject(value) && isTruelyObject(other))
98
+ return objEqualDeep(value, other);
99
+ if (Array.isArray(value) && Array.isArray(other))
100
+ return arrayEqualDeep(value, other);
101
+ return false;
139
102
  }
140
-
141
- /**
142
- * 把第一个参数传入第二个参数(函数)中并执行
143
- * 一般用于执行函数后返回变量。
144
- * @param {any} something
145
- * @param {function} callback
146
- * @return {any}
147
- */
148
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
149
- function tap(something, callback) {
150
- callback(something);
151
- return something;
103
+ function arrayEqualDeep(value, other) {
104
+ if (value.length !== other.length)
105
+ return false;
106
+ for (let i = 0, len = value.length; i < len; i++) {
107
+ if (!isDeepEqual(value[i], other[i]))
108
+ return false;
109
+ }
110
+ return true;
152
111
  }
153
-
154
- /**
155
- * 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
156
- * @param object
157
- * @param props 排除的属性
158
- * @return
159
- */
160
- function omit(object, props) {
161
- return tap({}, (result) => {
162
- for (const name in object) {
163
- if (props.indexOf(name) !== -1)
164
- continue;
165
- result[name] = object[name];
166
- }
167
- });
112
+ function objEqualDeep(value, other) {
113
+ const valueProps = Object.getOwnPropertyNames(value);
114
+ const otherProps = Object.getOwnPropertyNames(other);
115
+ if (valueProps.length !== otherProps.length)
116
+ return false;
117
+ for (let i = 0, len = valueProps.length; i < len; i++) {
118
+ const propName = valueProps[i];
119
+ if (!isDeepEqual(value[propName], other[propName]))
120
+ return false;
121
+ }
122
+ return true;
168
123
  }
169
-
170
- var FLOOR_PLAN_ATTACHED_TO;
171
- (function (FLOOR_PLAN_ATTACHED_TO) {
172
- FLOOR_PLAN_ATTACHED_TO[FLOOR_PLAN_ATTACHED_TO["FLOOR"] = 1] = "FLOOR";
173
- FLOOR_PLAN_ATTACHED_TO[FLOOR_PLAN_ATTACHED_TO["CEILING"] = 2] = "CEILING";
174
- FLOOR_PLAN_ATTACHED_TO[FLOOR_PLAN_ATTACHED_TO["BOUNDING_CENTER"] = 3] = "BOUNDING_CENTER";
175
- })(FLOOR_PLAN_ATTACHED_TO || (FLOOR_PLAN_ATTACHED_TO = {}));
176
-
177
124
  /**
178
- * 获取「在俯视图」状态下,模型 mm 与屏幕像素 px 的对应关系,即每 mm 对应多少 px
179
- * @param five five
125
+ * 对象比较
126
+ * @param {*} value 第一个比较的值
127
+ * @param {*} other 第二个比较的值
128
+ * @param {Object} options 可选参数,可选项包括:<br />
129
+ * deep {Boolean} 是否深比较<br />
130
+ * @returns {boolean} 是否相等
180
131
  */
181
- function getPxmm(five, container, floorIndex, options) {
182
- const maxFloorIndex = Math.max(...five.work.observers.map((ob) => ob.floorIndex));
183
- function getFloorY(floorIndex) {
184
- return floorIndex > maxFloorIndex
185
- ? five.model.bounding.max.y
186
- : Math.max(...five.work.observers
187
- .filter((ob) => ob.floorIndex === floorIndex)
188
- .map((ob) => ob.standingPosition.y));
189
- }
190
- function getY() {
191
- const currentFloorY = getFloorY(floorIndex);
192
- const nextFloorY = getFloorY(floorIndex + 1);
193
- const attachedTo = options?.attachedTo || FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER;
194
- if (attachedTo === FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER)
195
- return (five.model.bounding.max.y + five.model.bounding.min.y) / 2;
196
- else if (attachedTo === FLOOR_PLAN_ATTACHED_TO.CEILING)
197
- return nextFloorY;
198
- else
199
- return currentFloorY;
200
- }
201
- const y = getY();
202
- const originPosition = new THREE__namespace.Vector3(0, y, 0);
203
- const originPositionXUnit = new THREE__namespace.Vector3(1, y, 0);
204
- const mouse = originPosition.clone().project(five.camera);
205
- const xUnitMouse = originPositionXUnit.clone().project(five.camera);
206
- const pxmm = Math.abs((xUnitMouse.x - mouse.x) / 1000) * (container.getBoundingClientRect().width / 2);
207
- return pxmm;
132
+ function equal(value, other, opt = { deep: false }) {
133
+ if (!opt.deep)
134
+ return isShallowEqual(value, other);
135
+ return isDeepEqual(value, other);
208
136
  }
209
137
 
210
138
  const CAMERA_IMAGE = 'data:image/png;base64,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';
@@ -213,10 +141,10 @@ function rad2Deg$1(rad) {
213
141
  return (rad * 180) / Math.PI;
214
142
  }
215
143
 
216
- /* src/floorplan/ModelFloorplanPlugin/Components/Camera.svelte generated by Svelte v3.47.0 */
144
+ /* src/floorplan/Components/Camera.svelte generated by Svelte v3.47.0 */
217
145
 
218
- function add_css$c(target) {
219
- internal.append_styles(target, "svelte-e8a2kn", ".floorplan__camera-position.svelte-e8a2kn{position:absolute;width:0;height:0}.floorplan__camera-rotate.svelte-e8a2kn{position:absolute;background-repeat:no-repeat;background-size:100%}");
146
+ function add_css$d(target) {
147
+ internal.append_styles(target, "svelte-17cl35n", ".floorplan__camera-position.svelte-17cl35n{position:absolute;width:0;height:0}.floorplan__camera-rotate.svelte-17cl35n{position:absolute;background-repeat:no-repeat;background-size:100%}");
220
148
  }
221
149
 
222
150
  function create_fragment$g(ctx) {
@@ -227,7 +155,7 @@ function create_fragment$g(ctx) {
227
155
  c() {
228
156
  div1 = internal.element("div");
229
157
  div0 = internal.element("div");
230
- internal.attr(div0, "class", "floorplan__camera-rotate svelte-e8a2kn");
158
+ internal.attr(div0, "class", "floorplan__camera-rotate svelte-17cl35n");
231
159
  internal.set_style(div0, "background-image", `url(${/*cameraImageUrl*/ ctx[0] || CAMERA_IMAGE})`);
232
160
  internal.set_style(div0, "width", /*domSizeStyle*/ ctx[4], false);
233
161
  internal.set_style(div0, "height", /*domSizeStyle*/ ctx[4], false);
@@ -235,7 +163,7 @@ function create_fragment$g(ctx) {
235
163
  internal.set_style(div0, "top", '-' + /*domSizeStyle*/ ctx[4], false);
236
164
  internal.set_style(div0, "transform", `rotate(${/*rotate*/ ctx[3]}deg)`, false);
237
165
  internal.set_style(div0, "transform-origin", `${/*domSizeStyle*/ ctx[4]} ${/*domSizeStyle*/ ctx[4]}`, false);
238
- internal.attr(div1, "class", "floorplan__camera-position svelte-e8a2kn");
166
+ internal.attr(div1, "class", "floorplan__camera-position svelte-17cl35n");
239
167
  internal.set_style(div1, "left", /*positionLeft*/ ctx[1], false);
240
168
  internal.set_style(div1, "top", /*positionTop*/ ctx[2], false);
241
169
  },
@@ -311,25 +239,26 @@ class Camera extends internal.SvelteComponent {
311
239
  lastPanoramaLongitude: 7,
312
240
  cameraImageUrl: 0
313
241
  },
314
- add_css$c
242
+ add_css$d
315
243
  );
316
244
  }
317
245
  }
318
246
 
319
247
  const COMPASS_IMAGE = 'data:image/png;base64,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';
320
248
 
321
- /* src/floorplan/ModelFloorplanPlugin/Components/Compass.svelte generated by Svelte v3.47.0 */
249
+ /* src/floorplan/Components/Compass.svelte generated by Svelte v3.47.0 */
322
250
 
323
- function add_css$b(target) {
324
- internal.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}");
251
+ function add_css$c(target) {
252
+ internal.append_styles(target, "svelte-z9kwkx", ".floorplan-plugin__compass.svelte-z9kwkx{position:absolute;left:50%;top:-2.39583rem;width:12.03125rem;height:2.13542rem;will-change:opacity;transform-origin:center 9.58333rem}.floorplan-plugin__compass-image.svelte-z9kwkx{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-z9kwkx{position:absolute;left:50%;top:0.78125rem;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:0.52083rem;color:#fff}");
325
253
  }
326
254
 
327
- // (11:0) {#if northRad}
255
+ // (14:0) {#if canCompassShow}
328
256
  function create_if_block$6(ctx) {
329
257
  let div1;
330
258
  let div0;
331
259
  let t0;
332
260
  let span;
261
+ let t1;
333
262
 
334
263
  return {
335
264
  c() {
@@ -337,20 +266,23 @@ function create_if_block$6(ctx) {
337
266
  div0 = internal.element("div");
338
267
  t0 = internal.space();
339
268
  span = internal.element("span");
340
- span.textContent = "北";
341
- internal.attr(div0, "class", "floorplan-plugin__compass-image svelte-5l80pv");
269
+ t1 = internal.text(/*northDesc*/ ctx[0]);
270
+ internal.attr(div0, "class", "floorplan-plugin__compass-image svelte-z9kwkx");
342
271
  internal.set_style(div0, "background-image", `url(${COMPASS_IMAGE})`);
343
- internal.attr(span, "class", "floorplan-plugin__compass-text svelte-5l80pv");
344
- internal.attr(div1, "class", "floorplan-plugin__compass svelte-5l80pv");
345
- internal.set_style(div1, "transform", /*compassTransformStyle*/ ctx[1], false);
272
+ internal.attr(span, "class", "floorplan-plugin__compass-text svelte-z9kwkx");
273
+ internal.attr(div1, "class", "floorplan-plugin__compass svelte-z9kwkx");
274
+ internal.set_style(div1, "transform", /*compassTransformStyle*/ ctx[2], false);
346
275
  },
347
276
  m(target, anchor) {
348
277
  internal.insert(target, div1, anchor);
349
278
  internal.append(div1, div0);
350
279
  internal.append(div1, t0);
351
280
  internal.append(div1, span);
281
+ internal.append(span, t1);
282
+ },
283
+ p(ctx, dirty) {
284
+ if (dirty & /*northDesc*/ 1) internal.set_data(t1, /*northDesc*/ ctx[0]);
352
285
  },
353
- p: internal.noop,
354
286
  d(detaching) {
355
287
  if (detaching) internal.detach(div1);
356
288
  }
@@ -359,7 +291,7 @@ function create_if_block$6(ctx) {
359
291
 
360
292
  function create_fragment$f(ctx) {
361
293
  let if_block_anchor;
362
- let if_block = /*northRad*/ ctx[0] && create_if_block$6(ctx);
294
+ let if_block = /*canCompassShow*/ ctx[1] && create_if_block$6(ctx);
363
295
 
364
296
  return {
365
297
  c() {
@@ -371,7 +303,7 @@ function create_fragment$f(ctx) {
371
303
  internal.insert(target, if_block_anchor, anchor);
372
304
  },
373
305
  p(ctx, [dirty]) {
374
- if (/*northRad*/ ctx[0]) if_block.p(ctx, dirty);
306
+ if (/*canCompassShow*/ ctx[1]) if_block.p(ctx, dirty);
375
307
  },
376
308
  i: internal.noop,
377
309
  o: internal.noop,
@@ -387,358 +319,294 @@ function rad2Deg(rad) {
387
319
  }
388
320
 
389
321
  function instance$f($$self, $$props, $$invalidate) {
322
+ var _a;
390
323
  let { floorplanData } = $$props;
391
- const northRad = floorplanData.entrance?.northRad;
324
+ let { northDesc } = $$props;
325
+
326
+ const northRad = (_a = floorplanData.entrance) === null || _a === void 0
327
+ ? void 0
328
+ : _a.northRad;
329
+
330
+ const canCompassShow = typeof northRad === 'number';
392
331
  const rotate = !northRad ? 0 : rad2Deg(northRad);
393
332
  const compassTransformStyle = `translateX(-50%) translateZ(10px) rotate(${-rotate + 90}deg)`;
394
333
 
395
334
  $$self.$$set = $$props => {
396
- if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
335
+ if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
336
+ if ('northDesc' in $$props) $$invalidate(0, northDesc = $$props.northDesc);
397
337
  };
398
338
 
399
- return [northRad, compassTransformStyle, floorplanData];
339
+ return [northDesc, canCompassShow, compassTransformStyle, floorplanData];
400
340
  }
401
341
 
402
342
  class Compass extends internal.SvelteComponent {
403
343
  constructor(options) {
404
344
  super();
405
- internal.init(this, options, instance$f, create_fragment$f, internal.safe_not_equal, { floorplanData: 2 }, add_css$b);
345
+ internal.init(this, options, instance$f, create_fragment$f, internal.safe_not_equal, { floorplanData: 3, northDesc: 0 }, add_css$c);
406
346
  }
407
347
  }
408
348
 
409
- /* src/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte generated by Svelte v3.47.0 */
349
+ /* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
410
350
 
411
- function add_css$a(target) {
412
- internal.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}");
351
+ function add_css$b(target) {
352
+ internal.append_styles(target, "svelte-1gfoniz", "img.svelte-1gfoniz{width:100%;height:100%}");
413
353
  }
414
354
 
415
- // (22:30)
416
- function create_if_block_1$4(ctx) {
417
- let html_tag;
418
- let raw_value = /*userConfigElement*/ ctx[2].outerHTML + "";
419
- let html_anchor;
355
+ function create_fragment$e(ctx) {
356
+ let img;
357
+ let img_src_value;
420
358
 
421
359
  return {
422
360
  c() {
423
- html_tag = new internal.HtmlTag();
424
- html_anchor = internal.empty();
425
- html_tag.a = html_anchor;
361
+ img = internal.element("img");
362
+ if (!internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) internal.attr(img, "src", img_src_value);
363
+ internal.attr(img, "alt", "floorplan iamge");
364
+ internal.attr(img, "class", "svelte-1gfoniz");
426
365
  },
427
366
  m(target, anchor) {
428
- html_tag.m(raw_value, target, anchor);
429
- internal.insert(target, html_anchor, anchor);
367
+ internal.insert(target, img, anchor);
430
368
  },
431
- p(ctx, dirty) {
432
- if (dirty & /*userConfigElement*/ 4 && raw_value !== (raw_value = /*userConfigElement*/ ctx[2].outerHTML + "")) html_tag.p(raw_value);
369
+ p(ctx, [dirty]) {
370
+ if (dirty & /*url*/ 1 && !internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
371
+ internal.attr(img, "src", img_src_value);
372
+ }
433
373
  },
374
+ i: internal.noop,
375
+ o: internal.noop,
434
376
  d(detaching) {
435
- if (detaching) internal.detach(html_anchor);
436
- if (detaching) html_tag.d();
377
+ if (detaching) internal.detach(img);
437
378
  }
438
379
  };
439
380
  }
440
381
 
441
- // (16:2) {#if getLabelElement === undefined}
442
- function create_if_block$5(ctx) {
443
- let span0;
444
- let t0_value = /*room*/ ctx[0].name + "";
445
- let t0;
446
- let t1;
447
- let span1;
382
+ function instance$e($$self, $$props, $$invalidate) {
383
+ let { url } = $$props;
448
384
 
449
- return {
450
- c() {
451
- span0 = internal.element("span");
452
- t0 = internal.text(t0_value);
453
- t1 = internal.space();
454
- span1 = internal.element("span");
455
- span1.textContent = `${/*roomSizeDes*/ ctx[3]}`;
456
- internal.attr(span0, "class", "floorplan-plugin__room-name");
457
- internal.attr(span1, "class", "floorplan-plugin__room-size svelte-1ashbdx");
458
- },
459
- m(target, anchor) {
460
- internal.insert(target, span0, anchor);
461
- internal.append(span0, t0);
462
- internal.insert(target, t1, anchor);
463
- internal.insert(target, span1, anchor);
464
- },
465
- p(ctx, dirty) {
466
- if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) internal.set_data(t0, t0_value);
467
- },
468
- d(detaching) {
469
- if (detaching) internal.detach(span0);
470
- if (detaching) internal.detach(t1);
471
- if (detaching) internal.detach(span1);
472
- }
385
+ $$self.$$set = $$props => {
386
+ if ('url' in $$props) $$invalidate(0, url = $$props.url);
473
387
  };
474
- }
475
388
 
476
- function create_fragment$e(ctx) {
477
- let div;
389
+ return [url];
390
+ }
478
391
 
479
- function select_block_type(ctx, dirty) {
480
- if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block$5;
481
- if (/*userConfigElement*/ ctx[2]) return create_if_block_1$4;
392
+ class Normalmage extends internal.SvelteComponent {
393
+ constructor(options) {
394
+ super();
395
+ internal.init(this, options, instance$e, create_fragment$e, internal.safe_not_equal, { url: 0 }, add_css$b);
482
396
  }
397
+ }
483
398
 
484
- let current_block_type = select_block_type(ctx);
485
- let if_block = current_block_type && current_block_type(ctx);
399
+ /* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
400
+
401
+ function add_css$a(target) {
402
+ internal.append_styles(target, "svelte-ub47ya", ".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}");
403
+ }
404
+
405
+ function create_fragment$d(ctx) {
406
+ let div;
407
+ let html_tag;
408
+ let t;
409
+ let html_tag_1;
486
410
 
487
411
  return {
488
412
  c() {
489
413
  div = internal.element("div");
490
- if (if_block) if_block.c();
491
- internal.attr(div, "class", "floorplan-plugin__room-label-item svelte-1ashbdx");
492
- internal.set_style(div, "left", /*left*/ ctx[4], false);
493
- internal.set_style(div, "top", /*top*/ ctx[5], false);
494
- internal.set_style(div, "font-size", /*fontSize*/ ctx[6], false);
414
+ html_tag = new internal.HtmlTag();
415
+ t = internal.space();
416
+ html_tag_1 = new internal.HtmlTag();
417
+ html_tag.a = t;
418
+ html_tag_1.a = null;
419
+ internal.attr(div, "class", "floorplan-plugin__base-image svelte-ub47ya");
495
420
  },
496
421
  m(target, anchor) {
497
422
  internal.insert(target, div, anchor);
498
- if (if_block) if_block.m(div, null);
499
- },
500
- p(ctx, [dirty]) {
501
- if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
502
- if_block.p(ctx, dirty);
503
- } else {
504
- if (if_block) if_block.d(1);
505
- if_block = current_block_type && current_block_type(ctx);
506
-
507
- if (if_block) {
508
- if_block.c();
509
- if_block.m(div, null);
510
- }
511
- }
423
+ html_tag.m(/*svgStyle*/ ctx[1], div);
424
+ internal.append(div, t);
425
+ html_tag_1.m(/*content*/ ctx[0], div);
426
+ },
427
+ p(ctx, [dirty]) {
428
+ if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
512
429
  },
513
430
  i: internal.noop,
514
431
  o: internal.noop,
515
432
  d(detaching) {
516
433
  if (detaching) internal.detach(div);
517
-
518
- if (if_block) {
519
- if_block.d();
520
- }
521
434
  }
522
435
  };
523
436
  }
524
437
 
525
- function instance$e($$self, $$props, $$invalidate) {
526
- let userConfigElement;
527
- let { room } = $$props;
528
- let { getLabelElement } = $$props;
529
-
530
- // TODO: 统一这里的判断条件,目前写了多处
531
- const bodyWidth = document.body.clientWidth;
438
+ function instance$d($$self, $$props, $$invalidate) {
439
+ let { content } = $$props;
532
440
 
533
- const bodyHeight = document.body.clientHeight;
534
- const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
535
- const roomLabel = room.roomLabel;
536
- const left = roomLabel.positionInImage.x * 100 + '%';
537
- const top = roomLabel.positionInImage.y * 100 + '%';
538
- const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
441
+ const svgStyle = `
442
+ <style>
443
+ svg [type='lineGroup'] path {
444
+ fill: #ffffff;
445
+ stroke: #ffffff;
446
+ }
447
+ svg [type='lineItemGroup'] g g g g {
448
+ stroke: #ffffff;
449
+ }</style>
450
+ `;
539
451
 
540
452
  $$self.$$set = $$props => {
541
- if ('room' in $$props) $$invalidate(0, room = $$props.room);
542
- if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
543
- };
544
-
545
- $$self.$$.update = () => {
546
- if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
547
- $$invalidate(2, userConfigElement = getLabelElement?.(room));
548
- }
453
+ if ('content' in $$props) $$invalidate(0, content = $$props.content);
549
454
  };
550
455
 
551
- return [room, getLabelElement, userConfigElement, roomSizeDes, left, top, fontSize];
456
+ return [content, svgStyle];
552
457
  }
553
458
 
554
- class RoomLabel extends internal.SvelteComponent {
459
+ class SvgImage extends internal.SvelteComponent {
555
460
  constructor(options) {
556
461
  super();
557
- internal.init(this, options, instance$e, create_fragment$e, internal.safe_not_equal, { room: 0, getLabelElement: 1 }, add_css$a);
462
+ internal.init(this, options, instance$d, create_fragment$d, internal.safe_not_equal, { content: 0 }, add_css$a);
558
463
  }
559
464
  }
560
465
 
561
- /* src/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte generated by Svelte v3.47.0 */
466
+ /* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
562
467
 
563
468
  function add_css$9(target) {
564
- internal.append_styles(target, "svelte-sw25w3", ".floorplan-plugin__room-labels.svelte-sw25w3{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20}");
565
- }
566
-
567
- function get_each_context$4(ctx, list, i) {
568
- const child_ctx = ctx.slice();
569
- child_ctx[4] = list[i];
570
- return child_ctx;
469
+ internal.append_styles(target, "svelte-ozpg4a", ".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
571
470
  }
572
471
 
573
- // (8:0) {#if rooms}
574
- function create_if_block$4(ctx) {
575
- let div;
576
- let each_blocks = [];
577
- let each_1_lookup = new Map();
472
+ // (13:22)
473
+ function create_if_block_1$4(ctx) {
474
+ let normalimage;
578
475
  let current;
579
- let each_value = /*rooms*/ ctx[1];
580
- const get_key = ctx => /*room*/ ctx[4].id;
581
-
582
- for (let i = 0; i < each_value.length; i += 1) {
583
- let child_ctx = get_each_context$4(ctx, each_value, i);
584
- let key = get_key(child_ctx);
585
- each_1_lookup.set(key, each_blocks[i] = create_each_block$4(key, child_ctx));
586
- }
476
+ normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
587
477
 
588
478
  return {
589
479
  c() {
590
- div = internal.element("div");
591
-
592
- for (let i = 0; i < each_blocks.length; i += 1) {
593
- each_blocks[i].c();
594
- }
595
-
596
- internal.attr(div, "class", "floorplan-plugin__room-labels svelte-sw25w3");
480
+ internal.create_component(normalimage.$$.fragment);
597
481
  },
598
482
  m(target, anchor) {
599
- internal.insert(target, div, anchor);
600
-
601
- for (let i = 0; i < each_blocks.length; i += 1) {
602
- each_blocks[i].m(div, null);
603
- }
604
-
483
+ internal.mount_component(normalimage, target, anchor);
605
484
  current = true;
606
485
  },
607
486
  p(ctx, dirty) {
608
- if (dirty & /*rooms, getLabelElement*/ 3) {
609
- each_value = /*rooms*/ ctx[1];
610
- internal.group_outros();
611
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$4, null, get_each_context$4);
612
- internal.check_outros();
613
- }
487
+ const normalimage_changes = {};
488
+ if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
489
+ normalimage.$set(normalimage_changes);
614
490
  },
615
491
  i(local) {
616
492
  if (current) return;
617
-
618
- for (let i = 0; i < each_value.length; i += 1) {
619
- internal.transition_in(each_blocks[i]);
620
- }
621
-
493
+ internal.transition_in(normalimage.$$.fragment, local);
622
494
  current = true;
623
495
  },
624
496
  o(local) {
625
- for (let i = 0; i < each_blocks.length; i += 1) {
626
- internal.transition_out(each_blocks[i]);
627
- }
628
-
497
+ internal.transition_out(normalimage.$$.fragment, local);
629
498
  current = false;
630
499
  },
631
500
  d(detaching) {
632
- if (detaching) internal.detach(div);
633
-
634
- for (let i = 0; i < each_blocks.length; i += 1) {
635
- each_blocks[i].d();
636
- }
501
+ internal.destroy_component(normalimage, detaching);
637
502
  }
638
503
  };
639
504
  }
640
505
 
641
- // (10:4) {#each rooms as room (room.id)}
642
- function create_each_block$4(key_1, ctx) {
643
- let first;
644
- let roomlabel;
506
+ // (11:2) {#if svgContent}
507
+ function create_if_block$5(ctx) {
508
+ let svgimage;
645
509
  let current;
646
510
 
647
- const roomlabel_spread_levels = [
648
- {
649
- room: /*room*/ ctx[4],
650
- getLabelElement: /*getLabelElement*/ ctx[0]
651
- }
652
- ];
653
-
654
- let roomlabel_props = {};
655
-
656
- for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
657
- roomlabel_props = internal.assign(roomlabel_props, roomlabel_spread_levels[i]);
658
- }
659
-
660
- roomlabel = new RoomLabel({ props: roomlabel_props });
511
+ svgimage = new SvgImage({
512
+ props: { content: /*svgContent*/ ctx[0] }
513
+ });
661
514
 
662
515
  return {
663
- key: key_1,
664
- first: null,
665
516
  c() {
666
- first = internal.empty();
667
- internal.create_component(roomlabel.$$.fragment);
668
- this.first = first;
517
+ internal.create_component(svgimage.$$.fragment);
669
518
  },
670
519
  m(target, anchor) {
671
- internal.insert(target, first, anchor);
672
- internal.mount_component(roomlabel, target, anchor);
520
+ internal.mount_component(svgimage, target, anchor);
673
521
  current = true;
674
522
  },
675
- p(new_ctx, dirty) {
676
- ctx = new_ctx;
677
-
678
- const roomlabel_changes = (dirty & /*rooms, getLabelElement*/ 3)
679
- ? internal.get_spread_update(roomlabel_spread_levels, [
680
- {
681
- room: /*room*/ ctx[4],
682
- getLabelElement: /*getLabelElement*/ ctx[0]
683
- }
684
- ])
685
- : {};
686
-
687
- roomlabel.$set(roomlabel_changes);
523
+ p(ctx, dirty) {
524
+ const svgimage_changes = {};
525
+ if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
526
+ svgimage.$set(svgimage_changes);
688
527
  },
689
528
  i(local) {
690
529
  if (current) return;
691
- internal.transition_in(roomlabel.$$.fragment, local);
530
+ internal.transition_in(svgimage.$$.fragment, local);
692
531
  current = true;
693
532
  },
694
533
  o(local) {
695
- internal.transition_out(roomlabel.$$.fragment, local);
534
+ internal.transition_out(svgimage.$$.fragment, local);
696
535
  current = false;
697
536
  },
698
537
  d(detaching) {
699
- if (detaching) internal.detach(first);
700
- internal.destroy_component(roomlabel, detaching);
538
+ internal.destroy_component(svgimage, detaching);
701
539
  }
702
540
  };
703
541
  }
704
542
 
705
- function create_fragment$d(ctx) {
706
- let if_block_anchor;
543
+ function create_fragment$c(ctx) {
544
+ let div;
545
+ let current_block_type_index;
546
+ let if_block;
707
547
  let current;
708
- let if_block = /*rooms*/ ctx[1] && create_if_block$4(ctx);
548
+ const if_block_creators = [create_if_block$5, create_if_block_1$4];
549
+ const if_blocks = [];
550
+
551
+ function select_block_type(ctx, dirty) {
552
+ if (/*svgContent*/ ctx[0]) return 0;
553
+ if (/*imageData*/ ctx[1]) return 1;
554
+ return -1;
555
+ }
556
+
557
+ if (~(current_block_type_index = select_block_type(ctx))) {
558
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
559
+ }
709
560
 
710
561
  return {
711
562
  c() {
563
+ div = internal.element("div");
712
564
  if (if_block) if_block.c();
713
- if_block_anchor = internal.empty();
565
+ internal.attr(div, "class", "floorplan-plugin__base-image svelte-ozpg4a");
714
566
  },
715
567
  m(target, anchor) {
716
- if (if_block) if_block.m(target, anchor);
717
- internal.insert(target, if_block_anchor, anchor);
568
+ internal.insert(target, div, anchor);
569
+
570
+ if (~current_block_type_index) {
571
+ if_blocks[current_block_type_index].m(div, null);
572
+ }
573
+
718
574
  current = true;
719
575
  },
720
576
  p(ctx, [dirty]) {
721
- if (/*rooms*/ ctx[1]) {
577
+ let previous_block_index = current_block_type_index;
578
+ current_block_type_index = select_block_type(ctx);
579
+
580
+ if (current_block_type_index === previous_block_index) {
581
+ if (~current_block_type_index) {
582
+ if_blocks[current_block_type_index].p(ctx, dirty);
583
+ }
584
+ } else {
722
585
  if (if_block) {
723
- if_block.p(ctx, dirty);
586
+ internal.group_outros();
724
587
 
725
- if (dirty & /*rooms*/ 2) {
726
- internal.transition_in(if_block, 1);
727
- }
728
- } else {
729
- if_block = create_if_block$4(ctx);
730
- if_block.c();
731
- internal.transition_in(if_block, 1);
732
- if_block.m(if_block_anchor.parentNode, if_block_anchor);
588
+ internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
589
+ if_blocks[previous_block_index] = null;
590
+ });
591
+
592
+ internal.check_outros();
733
593
  }
734
- } else if (if_block) {
735
- internal.group_outros();
736
594
 
737
- internal.transition_out(if_block, 1, 1, () => {
738
- if_block = null;
739
- });
595
+ if (~current_block_type_index) {
596
+ if_block = if_blocks[current_block_type_index];
740
597
 
741
- internal.check_outros();
598
+ if (!if_block) {
599
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
600
+ if_block.c();
601
+ } else {
602
+ if_block.p(ctx, dirty);
603
+ }
604
+
605
+ internal.transition_in(if_block, 1);
606
+ if_block.m(div, null);
607
+ } else {
608
+ if_block = null;
609
+ }
742
610
  }
743
611
  },
744
612
  i(local) {
@@ -751,434 +619,377 @@ function create_fragment$d(ctx) {
751
619
  current = false;
752
620
  },
753
621
  d(detaching) {
754
- if (if_block) if_block.d(detaching);
755
- if (detaching) internal.detach(if_block_anchor);
622
+ if (detaching) internal.detach(div);
623
+
624
+ if (~current_block_type_index) {
625
+ if_blocks[current_block_type_index].d();
626
+ }
756
627
  }
757
628
  };
758
629
  }
759
630
 
760
- function instance$d($$self, $$props, $$invalidate) {
761
- let rooms;
631
+ function instance$c($$self, $$props, $$invalidate) {
632
+ let imageData;
633
+ let svgContent;
634
+ var _a, _b;
762
635
  let { floorIndex } = $$props;
763
636
  let { floorplanData } = $$props;
764
- let { getLabelElement } = $$props;
765
637
 
766
638
  $$self.$$set = $$props => {
767
639
  if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
768
640
  if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
769
- if ('getLabelElement' in $$props) $$invalidate(0, getLabelElement = $$props.getLabelElement);
770
641
  };
771
642
 
772
643
  $$self.$$.update = () => {
773
644
  if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
774
- $$invalidate(1, rooms = floorplanData.floorDatas[floorIndex].rooms);
645
+ $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
646
+ }
647
+
648
+ if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
649
+ $$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
650
+ ? void 0
651
+ : _a[floorIndex]) === null || _b === void 0
652
+ ? void 0
653
+ : _b.svgContent);
775
654
  }
776
655
  };
777
656
 
778
- return [getLabelElement, rooms, floorIndex, floorplanData];
657
+ return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
779
658
  }
780
659
 
781
- class RoomLabels extends internal.SvelteComponent {
660
+ class BaseImage extends internal.SvelteComponent {
782
661
  constructor(options) {
783
662
  super();
784
-
785
- internal.init(
786
- this,
787
- options,
788
- instance$d,
789
- create_fragment$d,
790
- internal.safe_not_equal,
791
- {
792
- floorIndex: 2,
793
- floorplanData: 3,
794
- getLabelElement: 0
795
- },
796
- add_css$9
797
- );
663
+ internal.init(this, options, instance$c, create_fragment$c, internal.safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$9);
798
664
  }
799
665
  }
800
666
 
801
- /**
802
- * 判断对象是否为`null`或`undefined`。
803
- * @param
804
- * @return
805
- */
806
- /**
807
- * 判断对象不为`null`或`undefined`。
808
- */
809
- function notNil(value) {
810
- return value !== null && value !== undefined;
811
- }
812
-
813
- /* src/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte generated by Svelte v3.47.0 */
667
+ /* src/floorplan/Components/RoomLabels/RoomLabel.svelte generated by Svelte v3.47.0 */
814
668
 
815
669
  function add_css$8(target) {
816
- internal.append_styles(target, "svelte-1rr09in", ".floorplan-plugin__rule-labels.svelte-1rr09in{position:absolute;height:5px;display:flex;align-items:center}.floorplan-plugin__rule-labels-top.svelte-1rr09in{left:0;top:0}.floorplan-plugin__rule-labels-bottom.svelte-1rr09in{left:0;bottom:0}.floorplan-plugin__rule-labels-left.svelte-1rr09in{bottom:0;left:0}.floorplan-plugin__rule-labels-right.svelte-1rr09in{bottom:0;right:0}.floorplan-plugin__rule-line.svelte-1rr09in{background:#fff;opacity:0.05;width:100%;height:1px}.floorplan-plugin__rule-scale.svelte-1rr09in{position:absolute;background:#fff;opacity:0.05;transform-origin:center;width:1px;height:5px}.floorplan-plugin__text-wrapper.svelte-1rr09in{width:0;height:0;position:absolute}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper--is-left-or-top.svelte-1rr09in{top:10px}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper-is-right-or-bottom.svelte-1rr09in{bottom:10px}.floorplan-plugin__rule-text.svelte-1rr09in{position:absolute;width:max-content;display:block;transform:translate(-50%, -50%) rotate(180deg);font-size:10px;color:#fff;opacity:0.2}.floorplan-plugin__rule-text.is-row.svelte-1rr09in{transform:translate(-50%, -50%)}");
817
- }
818
-
819
- function get_each_context$3(ctx, list, i) {
820
- const child_ctx = ctx.slice();
821
- child_ctx[24] = list[i];
822
- child_ctx[26] = i;
823
- return child_ctx;
824
- }
825
-
826
- function get_each_context_1(ctx, list, i) {
827
- const child_ctx = ctx.slice();
828
- child_ctx[27] = list[i];
829
- child_ctx[29] = i;
830
- return child_ctx;
670
+ internal.append_styles(target, "svelte-12pzct5", ".floorplan-plugin__room-label-item.svelte-12pzct5{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-12pzct5{opacity:0.45}");
831
671
  }
832
672
 
833
- // (66:2) {#each positionPxArray as position, positionIndex (positionIndex)}
834
- function create_each_block_1(key_1, ctx) {
835
- let div;
836
- let style_left = `${/*position*/ ctx[27]}px`;
673
+ // (95:30)
674
+ function create_if_block_1$3(ctx) {
675
+ let html_tag;
676
+ let raw_value = /*userConfigElement*/ ctx[4].outerHTML + "";
677
+ let html_anchor;
837
678
 
838
679
  return {
839
- key: key_1,
840
- first: null,
841
680
  c() {
842
- div = internal.element("div");
843
- internal.attr(div, "class", "floorplan-plugin__rule-scale svelte-1rr09in");
844
- internal.set_style(div, "left", style_left, false);
845
- this.first = div;
681
+ html_tag = new internal.HtmlTag();
682
+ html_anchor = internal.empty();
683
+ html_tag.a = html_anchor;
846
684
  },
847
685
  m(target, anchor) {
848
- internal.insert(target, div, anchor);
686
+ html_tag.m(raw_value, target, anchor);
687
+ internal.insert(target, html_anchor, anchor);
849
688
  },
850
- p(new_ctx, dirty) {
851
- ctx = new_ctx;
689
+ p(ctx, dirty) {
690
+ if (dirty & /*userConfigElement*/ 16 && raw_value !== (raw_value = /*userConfigElement*/ ctx[4].outerHTML + "")) html_tag.p(raw_value);
852
691
  },
853
692
  d(detaching) {
854
- if (detaching) internal.detach(div);
693
+ if (detaching) internal.detach(html_anchor);
694
+ if (detaching) html_tag.d();
855
695
  }
856
696
  };
857
697
  }
858
698
 
859
- // (69:2) {#each textArray as textItem, textItemIndex (textItemIndex)}
860
- function create_each_block$3(key_1, ctx) {
861
- let div;
862
- let span;
863
- let t0_value = /*textItem*/ ctx[24].distance + "";
699
+ // (89:2) {#if getLabelElement === undefined}
700
+ function create_if_block$4(ctx) {
701
+ let span0;
702
+ let t0_value = /*room*/ ctx[0].name + "";
864
703
  let t0;
865
704
  let t1;
866
- let style_left = `${/*textItem*/ ctx[24].positionPx}px`;
705
+ let span1;
867
706
 
868
707
  return {
869
- key: key_1,
870
- first: null,
871
708
  c() {
872
- div = internal.element("div");
873
- span = internal.element("span");
709
+ span0 = internal.element("span");
874
710
  t0 = internal.text(t0_value);
875
711
  t1 = internal.space();
876
- internal.attr(span, "class", "floorplan-plugin__rule-text svelte-1rr09in");
877
- internal.toggle_class(span, "is-row", /*isRow*/ ctx[5]);
878
- internal.attr(div, "class", "floorplan-plugin__text-wrapper svelte-1rr09in");
879
- internal.toggle_class(div, "floorplan-plugin__text-wrapper--is-left-or-top", /*isLeft*/ ctx[3] || /*isTop*/ ctx[1]);
880
- internal.toggle_class(div, "floorplan-plugin__text-wrapper-is-right-or-bottom", /*isRight*/ ctx[4] || /*isBottom*/ ctx[2]);
881
- internal.set_style(div, "left", style_left, false);
882
- this.first = div;
712
+ span1 = internal.element("span");
713
+ span1.textContent = `${/*roomSizeDes*/ ctx[5]}`;
714
+ internal.attr(span0, "class", "floorplan-plugin__room-name");
715
+ internal.attr(span1, "class", "floorplan-plugin__room-size svelte-12pzct5");
883
716
  },
884
717
  m(target, anchor) {
885
- internal.insert(target, div, anchor);
886
- internal.append(div, span);
887
- internal.append(span, t0);
888
- internal.append(div, t1);
718
+ internal.insert(target, span0, anchor);
719
+ internal.append(span0, t0);
720
+ internal.insert(target, t1, anchor);
721
+ internal.insert(target, span1, anchor);
889
722
  },
890
- p(new_ctx, dirty) {
891
- ctx = new_ctx;
723
+ p(ctx, dirty) {
724
+ if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) internal.set_data(t0, t0_value);
892
725
  },
893
726
  d(detaching) {
894
- if (detaching) internal.detach(div);
727
+ if (detaching) internal.detach(span0);
728
+ if (detaching) internal.detach(t1);
729
+ if (detaching) internal.detach(span1);
895
730
  }
896
731
  };
897
732
  }
898
733
 
899
- function create_fragment$c(ctx) {
900
- let div1;
901
- let div0;
902
- let t0;
903
- let each_blocks_1 = [];
904
- let each0_lookup = new Map();
905
- let t1;
906
- let each_blocks = [];
907
- let each1_lookup = new Map();
908
- let div1_class_value;
909
- let each_value_1 = /*positionPxArray*/ ctx[6];
910
- const get_key = ctx => /*positionIndex*/ ctx[29];
734
+ function create_fragment$b(ctx) {
735
+ let div;
911
736
 
912
- for (let i = 0; i < each_value_1.length; i += 1) {
913
- let child_ctx = get_each_context_1(ctx, each_value_1, i);
914
- let key = get_key(child_ctx);
915
- each0_lookup.set(key, each_blocks_1[i] = create_each_block_1(key, child_ctx));
737
+ function select_block_type(ctx, dirty) {
738
+ if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block$4;
739
+ if (/*userConfigElement*/ ctx[4]) return create_if_block_1$3;
916
740
  }
917
741
 
918
- let each_value = /*textArray*/ ctx[10];
919
- const get_key_1 = ctx => /*textItemIndex*/ ctx[26];
920
-
921
- for (let i = 0; i < each_value.length; i += 1) {
922
- let child_ctx = get_each_context$3(ctx, each_value, i);
923
- let key = get_key_1(child_ctx);
924
- each1_lookup.set(key, each_blocks[i] = create_each_block$3(key, child_ctx));
925
- }
742
+ let current_block_type = select_block_type(ctx);
743
+ let if_block = current_block_type && current_block_type(ctx);
926
744
 
927
745
  return {
928
746
  c() {
929
- div1 = internal.element("div");
930
- div0 = internal.element("div");
931
- t0 = internal.space();
932
-
933
- for (let i = 0; i < each_blocks_1.length; i += 1) {
934
- each_blocks_1[i].c();
935
- }
936
-
937
- t1 = internal.space();
938
-
939
- for (let i = 0; i < each_blocks.length; i += 1) {
940
- each_blocks[i].c();
941
- }
942
-
943
- internal.attr(div0, "class", "floorplan-plugin__rule-line svelte-1rr09in");
944
- internal.attr(div1, "class", div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1rr09in");
945
- internal.set_style(div1, "width", /*width*/ ctx[9], false);
946
- internal.set_style(div1, "transform", /*transform*/ ctx[7], false);
947
- internal.set_style(div1, "transform-origin", /*transformOrigin*/ ctx[8], false);
747
+ div = internal.element("div");
748
+ if (if_block) if_block.c();
749
+ internal.attr(div, "class", "floorplan-plugin__room-label-item svelte-12pzct5");
750
+ internal.set_style(div, "left", /*left*/ ctx[6], false);
751
+ internal.set_style(div, "top", /*top*/ ctx[7], false);
752
+ internal.set_style(div, "font-size", /*fontSize*/ ctx[8], false);
753
+ internal.set_style(div, "opacity", /*labelVisible*/ ctx[3] ? '1' : '0', false);
948
754
  },
949
755
  m(target, anchor) {
950
- internal.insert(target, div1, anchor);
951
- internal.append(div1, div0);
952
- internal.append(div1, t0);
953
-
954
- for (let i = 0; i < each_blocks_1.length; i += 1) {
955
- each_blocks_1[i].m(div1, null);
956
- }
957
-
958
- internal.append(div1, t1);
959
-
960
- for (let i = 0; i < each_blocks.length; i += 1) {
961
- each_blocks[i].m(div1, null);
962
- }
756
+ internal.insert(target, div, anchor);
757
+ if (if_block) if_block.m(div, null);
758
+ /*div_binding*/ ctx[15](div);
963
759
  },
964
760
  p(ctx, [dirty]) {
965
- if (dirty & /*positionPxArray*/ 64) {
966
- each_value_1 = /*positionPxArray*/ ctx[6];
967
- each_blocks_1 = internal.update_keyed_each(each_blocks_1, dirty, get_key, 1, ctx, each_value_1, each0_lookup, div1, internal.destroy_block, create_each_block_1, t1, get_each_context_1);
968
- }
761
+ if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
762
+ if_block.p(ctx, dirty);
763
+ } else {
764
+ if (if_block) if_block.d(1);
765
+ if_block = current_block_type && current_block_type(ctx);
969
766
 
970
- if (dirty & /*isLeft, isTop, isRight, isBottom, textArray, isRow*/ 1086) {
971
- each_value = /*textArray*/ ctx[10];
972
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key_1, 1, ctx, each_value, each1_lookup, div1, internal.destroy_block, create_each_block$3, null, get_each_context$3);
767
+ if (if_block) {
768
+ if_block.c();
769
+ if_block.m(div, null);
770
+ }
973
771
  }
974
772
 
975
- if (dirty & /*type*/ 1 && div1_class_value !== (div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1rr09in")) {
976
- internal.attr(div1, "class", div1_class_value);
773
+ if (dirty & /*labelVisible*/ 8) {
774
+ internal.set_style(div, "opacity", /*labelVisible*/ ctx[3] ? '1' : '0', false);
977
775
  }
978
776
  },
979
777
  i: internal.noop,
980
778
  o: internal.noop,
981
779
  d(detaching) {
982
- if (detaching) internal.detach(div1);
780
+ if (detaching) internal.detach(div);
983
781
 
984
- for (let i = 0; i < each_blocks_1.length; i += 1) {
985
- each_blocks_1[i].d();
782
+ if (if_block) {
783
+ if_block.d();
986
784
  }
987
785
 
988
- for (let i = 0; i < each_blocks.length; i += 1) {
989
- each_blocks[i].d();
990
- }
786
+ /*div_binding*/ ctx[15](null);
991
787
  }
992
788
  };
993
789
  }
994
790
 
995
- const padding = 1000;
791
+ function isPointInPolygon(point, polygon) {
792
+ const x = point[0];
793
+ const y = point[1];
794
+ let inside = false;
795
+
796
+ for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
797
+ const xi = polygon[i][0];
798
+ const yi = polygon[i][1];
799
+ const xj = polygon[j][0];
800
+ const yj = polygon[j][1];
801
+ const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
802
+ if (intersect) inside = !inside;
803
+ }
996
804
 
997
- function instance$c($$self, $$props, $$invalidate) {
805
+ return inside;
806
+ }
807
+
808
+ function instance$b($$self, $$props, $$invalidate) {
809
+ let isLabelInRoom;
810
+ let userConfigElement;
811
+ let labelVisible;
998
812
  let { pxmm } = $$props;
999
- let { type } = $$props;
1000
- let { data } = $$props;
1001
- let { bounding } = $$props;
1002
- const isTop = type === 'top';
1003
- const isBottom = type === 'bottom';
1004
- const isLeft = type === 'left';
1005
- const isRight = type === 'right';
1006
- const isRow = isTop || isBottom;
813
+ let { room } = $$props;
814
+ let { hoveredRoom } = $$props;
815
+ let { getLabelElement } = $$props;
816
+ let { adaptiveRoomLabelVisibleEnable } = $$props;
817
+
818
+ function isLabelInRoomCurry(room, labelElementSize) {
819
+ if (labelElementSize.width === 0 || labelElementSize.height === 0) return () => false;
820
+ const polygon = room.path.map(({ x, y }) => [x, y]);
821
+ const labelPosition = room.roomLabel.position;
822
+ const { x, y } = labelPosition;
823
+ const { width, height } = labelElementSize;
824
+ const halfWidth = width / 2;
825
+ const halfHeight = height / 2;
826
+
827
+ return function isLabelInRoom(pxmm) {
828
+ const clientX = x * pxmm;
829
+ const clientY = y * pxmm;
830
+ const clientPolygon = polygon.map(([x, y]) => [x * pxmm, y * pxmm]);
831
+
832
+ // const
833
+ /** 围成 labelRect 的四个点
834
+ * 1----0
835
+ * | |
836
+ * 2----3
837
+ */
838
+ const labelRectClientPoints = [
839
+ [clientX + halfWidth, clientY - halfHeight],
840
+ [clientX - halfWidth, clientY - halfHeight],
841
+ [clientX - halfWidth, clientY + halfHeight],
842
+ [clientX + halfWidth, clientY + halfHeight]
843
+ ];
844
+
845
+ return labelRectClientPoints.every(point => isPointInPolygon(point, clientPolygon));
846
+ };
847
+ }
1007
848
 
1008
- // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
1009
- const positionArray = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
1010
- if (index === 0) return true;
1011
- return x !== arr[index - 1];
849
+ // ========== 获取设备宽高像素 ==========
850
+ // TODO: 统一这里的判断条件,目前写了多处
851
+ const bodyWidth = document.body.clientWidth;
852
+
853
+ const bodyHeight = document.body.clientHeight;
854
+ const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
855
+
856
+ // ====================================
857
+ const roomLabel = room.roomLabel;
858
+
859
+ const left = roomLabel.positionInImage.x * 100 + '%';
860
+ const top = roomLabel.positionInImage.y * 100 + '%';
861
+
862
+ // 屏幕宽或高小于 500px 时,用 10px 字体,否则用 14px
863
+ const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
864
+
865
+ let isHoverd = false;
866
+ let labelElement;
867
+ let labelElementSize;
868
+
869
+ hoveredRoom.subscribe(function onHoverdRoomUpdate(_room) {
870
+ $$invalidate(12, isHoverd = !!_room && _room.id === room.id);
871
+ });
872
+
873
+ svelte.onMount(() => {
874
+ // Label 能不能展示只跟房间大小有关
875
+ // 计算 LabelElement 宽高
876
+ const labelDomRect = labelElement === null || labelElement === void 0
877
+ ? void 0
878
+ : labelElement.getClientRects()[0];
879
+
880
+ $$invalidate(13, labelElementSize = {
881
+ width: labelDomRect.width,
882
+ height: labelDomRect.height
883
+ });
1012
884
  });
1013
885
 
1014
- const minPosition = positionArray[0];
1015
- const maxPosition = positionArray.slice(-1)[0];
1016
- const length = maxPosition - minPosition;
1017
- const minBounding = isRow ? bounding.min.x : bounding.min.y;
1018
- const lengthPx = length * pxmm;
1019
- const positionPxArray = positionArray.map(x => (x - minPosition) / length * lengthPx);
1020
-
1021
- // 在主要方向上的偏移量,上下的标尺是距离图片左侧的长度,左右的标尺是距离图片底部的距离
1022
- const translateMain = (minPosition - minBounding) * pxmm;
1023
-
1024
- // 在次要方向的偏移量,希望达到的效果是标尺轴距离户型图边界 27px,但是图片自身是带有 1000mm 的边界,所以在计算时需要减去这个边界
1025
- const translateSecond = 27 - padding * pxmm;
1026
-
1027
- const translate = (() => {
1028
- if (isTop) return `translate(${translateMain}px, ${-translateSecond}px)`;
1029
- if (isBottom) return `translate(${translateMain}px, ${translateSecond}px)`;
1030
- if (isLeft) return `translate(${-translateSecond}px, ${-translateMain}px)`;
1031
- if (isRight) return `translate(${translateSecond}px, ${-translateMain - lengthPx}px)`;
1032
- })();
1033
-
1034
- const rotate = isRow ? 'rotate(0)' : 'rotate(-90deg)';
1035
- const transform = `${translate} ${rotate}`;
1036
- const transformOrigin = `${isRight ? 'right' : 'left'} ${isTop ? 'top' : 'bottom'}`;
1037
- const width = lengthPx + 'px';
1038
-
1039
- // 把点位的户型图坐标转成距离起始位置的像素值
1040
- const textArray = positionArray.map((position, index, array) => {
1041
- if (index === 0) return null;
1042
- const distance = position - array[index - 1];
1043
- const positionPx = (array[index - 1] + distance / 2 - minPosition) / length * lengthPx;
1044
- return { distance, positionPx };
1045
- }).filter(notNil).filter(item => item.distance / length > 0.12);
886
+ function div_binding($$value) {
887
+ internal.binding_callbacks[$$value ? 'unshift' : 'push'](() => {
888
+ labelElement = $$value;
889
+ $$invalidate(2, labelElement);
890
+ });
891
+ }
1046
892
 
1047
893
  $$self.$$set = $$props => {
1048
- if ('pxmm' in $$props) $$invalidate(11, pxmm = $$props.pxmm);
1049
- if ('type' in $$props) $$invalidate(0, type = $$props.type);
1050
- if ('data' in $$props) $$invalidate(12, data = $$props.data);
1051
- if ('bounding' in $$props) $$invalidate(13, bounding = $$props.bounding);
894
+ if ('pxmm' in $$props) $$invalidate(9, pxmm = $$props.pxmm);
895
+ if ('room' in $$props) $$invalidate(0, room = $$props.room);
896
+ if ('hoveredRoom' in $$props) $$invalidate(10, hoveredRoom = $$props.hoveredRoom);
897
+ if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
898
+ if ('adaptiveRoomLabelVisibleEnable' in $$props) $$invalidate(11, adaptiveRoomLabelVisibleEnable = $$props.adaptiveRoomLabelVisibleEnable);
899
+ };
900
+
901
+ $$self.$$.update = () => {
902
+ if ($$self.$$.dirty & /*labelElementSize, room*/ 8193) {
903
+ $$invalidate(14, isLabelInRoom = labelElementSize
904
+ ? isLabelInRoomCurry(room, labelElementSize)
905
+ : undefined);
906
+ }
907
+
908
+ if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
909
+ $$invalidate(4, userConfigElement = getLabelElement === null || getLabelElement === void 0
910
+ ? void 0
911
+ : getLabelElement(room));
912
+ }
913
+
914
+ if ($$self.$$.dirty & /*adaptiveRoomLabelVisibleEnable, isHoverd, isLabelInRoom, pxmm*/ 23040) {
915
+ $$invalidate(3, labelVisible = adaptiveRoomLabelVisibleEnable
916
+ ? isHoverd
917
+ ? true
918
+ : !!(isLabelInRoom === null || isLabelInRoom === void 0
919
+ ? void 0
920
+ : isLabelInRoom(pxmm))
921
+ : true);
922
+ }
1052
923
  };
1053
924
 
1054
925
  return [
1055
- type,
1056
- isTop,
1057
- isBottom,
1058
- isLeft,
1059
- isRight,
1060
- isRow,
1061
- positionPxArray,
1062
- transform,
1063
- transformOrigin,
1064
- width,
1065
- textArray,
926
+ room,
927
+ getLabelElement,
928
+ labelElement,
929
+ labelVisible,
930
+ userConfigElement,
931
+ roomSizeDes,
932
+ left,
933
+ top,
934
+ fontSize,
1066
935
  pxmm,
1067
- data,
1068
- bounding
936
+ hoveredRoom,
937
+ adaptiveRoomLabelVisibleEnable,
938
+ isHoverd,
939
+ labelElementSize,
940
+ isLabelInRoom,
941
+ div_binding
1069
942
  ];
1070
943
  }
1071
944
 
1072
- class RuleItem extends internal.SvelteComponent {
945
+ class RoomLabel extends internal.SvelteComponent {
1073
946
  constructor(options) {
1074
947
  super();
1075
948
 
1076
949
  internal.init(
1077
950
  this,
1078
951
  options,
1079
- instance$c,
1080
- create_fragment$c,
952
+ instance$b,
953
+ create_fragment$b,
1081
954
  internal.safe_not_equal,
1082
955
  {
1083
- pxmm: 11,
1084
- type: 0,
1085
- data: 12,
1086
- bounding: 13
956
+ pxmm: 9,
957
+ room: 0,
958
+ hoveredRoom: 10,
959
+ getLabelElement: 1,
960
+ adaptiveRoomLabelVisibleEnable: 11
1087
961
  },
1088
962
  add_css$8
1089
963
  );
1090
964
  }
1091
965
  }
1092
966
 
1093
- /* src/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte generated by Svelte v3.47.0 */
967
+ /* src/floorplan/Components/RoomLabels/RoomLabels.svelte generated by Svelte v3.47.0 */
1094
968
 
1095
- function get_each_context$2(ctx, list, i) {
1096
- const child_ctx = ctx.slice();
1097
- child_ctx[7] = list[i][0];
1098
- child_ctx[8] = list[i][1];
1099
- return child_ctx;
969
+ function add_css$7(target) {
970
+ internal.append_styles(target, "svelte-13xux0b", ".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}");
1100
971
  }
1101
972
 
1102
- // (12:2) {#each ruleLabelArray as [type, data] (type)}
1103
- function create_each_block$2(key_1, ctx) {
1104
- let first;
1105
- let ruleitem;
1106
- let current;
1107
-
1108
- const ruleitem_spread_levels = [
1109
- {
1110
- type: /*type*/ ctx[7],
1111
- data: /*data*/ ctx[8],
1112
- pxmm: /*pxmm*/ ctx[0],
1113
- bounding: /*bounding*/ ctx[2]
1114
- }
1115
- ];
1116
-
1117
- let ruleitem_props = {};
1118
-
1119
- for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
1120
- ruleitem_props = internal.assign(ruleitem_props, ruleitem_spread_levels[i]);
1121
- }
1122
-
1123
- ruleitem = new RuleItem({ props: ruleitem_props });
1124
-
1125
- return {
1126
- key: key_1,
1127
- first: null,
1128
- c() {
1129
- first = internal.empty();
1130
- internal.create_component(ruleitem.$$.fragment);
1131
- this.first = first;
1132
- },
1133
- m(target, anchor) {
1134
- internal.insert(target, first, anchor);
1135
- internal.mount_component(ruleitem, target, anchor);
1136
- current = true;
1137
- },
1138
- p(new_ctx, dirty) {
1139
- ctx = new_ctx;
1140
-
1141
- const ruleitem_changes = (dirty & /*ruleLabelArray, pxmm, bounding*/ 7)
1142
- ? internal.get_spread_update(ruleitem_spread_levels, [
1143
- {
1144
- type: /*type*/ ctx[7],
1145
- data: /*data*/ ctx[8],
1146
- pxmm: /*pxmm*/ ctx[0],
1147
- bounding: /*bounding*/ ctx[2]
1148
- }
1149
- ])
1150
- : {};
1151
-
1152
- ruleitem.$set(ruleitem_changes);
1153
- },
1154
- i(local) {
1155
- if (current) return;
1156
- internal.transition_in(ruleitem.$$.fragment, local);
1157
- current = true;
1158
- },
1159
- o(local) {
1160
- internal.transition_out(ruleitem.$$.fragment, local);
1161
- current = false;
1162
- },
1163
- d(detaching) {
1164
- if (detaching) internal.detach(first);
1165
- internal.destroy_component(ruleitem, detaching);
1166
- }
1167
- };
973
+ function get_each_context$5(ctx, list, i) {
974
+ const child_ctx = ctx.slice();
975
+ child_ctx[9] = list[i];
976
+ return child_ctx;
1168
977
  }
1169
978
 
1170
- function create_fragment$b(ctx) {
979
+ // (17:0) {#if rooms}
980
+ function create_if_block$3(ctx) {
1171
981
  let div;
1172
982
  let each_blocks = [];
1173
983
  let each_1_lookup = new Map();
984
+ let div_resize_listener;
1174
985
  let current;
1175
- let each_value = /*ruleLabelArray*/ ctx[1];
1176
- const get_key = ctx => /*type*/ ctx[7];
986
+ let each_value = /*rooms*/ ctx[5];
987
+ const get_key = ctx => /*room*/ ctx[9].id;
1177
988
 
1178
989
  for (let i = 0; i < each_value.length; i += 1) {
1179
- let child_ctx = get_each_context$2(ctx, each_value, i);
990
+ let child_ctx = get_each_context$5(ctx, each_value, i);
1180
991
  let key = get_key(child_ctx);
1181
- each_1_lookup.set(key, each_blocks[i] = create_each_block$2(key, child_ctx));
992
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$5(key, child_ctx));
1182
993
  }
1183
994
 
1184
995
  return {
@@ -1189,7 +1000,8 @@ function create_fragment$b(ctx) {
1189
1000
  each_blocks[i].c();
1190
1001
  }
1191
1002
 
1192
- internal.attr(div, "class", "floorplan-plugin__rulelabels");
1003
+ internal.attr(div, "class", "floorplan-plugin__room-labels svelte-13xux0b");
1004
+ internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[8].call(div));
1193
1005
  },
1194
1006
  m(target, anchor) {
1195
1007
  internal.insert(target, div, anchor);
@@ -1198,13 +1010,14 @@ function create_fragment$b(ctx) {
1198
1010
  each_blocks[i].m(div, null);
1199
1011
  }
1200
1012
 
1013
+ div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[8].bind(div));
1201
1014
  current = true;
1202
1015
  },
1203
- p(ctx, [dirty]) {
1204
- if (dirty & /*ruleLabelArray, pxmm, bounding*/ 7) {
1205
- each_value = /*ruleLabelArray*/ ctx[1];
1016
+ p(ctx, dirty) {
1017
+ if (dirty & /*pxmm, rooms, getLabelElement, hoveredRoom, adaptiveRoomLabelVisibleEnable*/ 55) {
1018
+ each_value = /*rooms*/ ctx[5];
1206
1019
  internal.group_outros();
1207
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$2, null, get_each_context$2);
1020
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$5, null, get_each_context$5);
1208
1021
  internal.check_outros();
1209
1022
  }
1210
1023
  },
@@ -1230,375 +1043,742 @@ function create_fragment$b(ctx) {
1230
1043
  for (let i = 0; i < each_blocks.length; i += 1) {
1231
1044
  each_blocks[i].d();
1232
1045
  }
1046
+
1047
+ div_resize_listener();
1233
1048
  }
1234
1049
  };
1235
1050
  }
1236
1051
 
1237
- function instance$b($$self, $$props, $$invalidate) {
1238
- let bounding;
1239
- let ruleLabelData;
1240
- let ruleLabelDataKeys;
1241
- let ruleLabelArray;
1242
- let { pxmm } = $$props;
1052
+ // (19:4) {#each rooms as room (room.id)}
1053
+ function create_each_block$5(key_1, ctx) {
1054
+ let first;
1055
+ let roomlabel;
1056
+ let current;
1057
+
1058
+ const roomlabel_spread_levels = [
1059
+ {
1060
+ pxmm: /*pxmm*/ ctx[4],
1061
+ room: /*room*/ ctx[9],
1062
+ getLabelElement: /*getLabelElement*/ ctx[1],
1063
+ hoveredRoom: /*hoveredRoom*/ ctx[0],
1064
+ adaptiveRoomLabelVisibleEnable: /*adaptiveRoomLabelVisibleEnable*/ ctx[2]
1065
+ }
1066
+ ];
1067
+
1068
+ let roomlabel_props = {};
1069
+
1070
+ for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
1071
+ roomlabel_props = internal.assign(roomlabel_props, roomlabel_spread_levels[i]);
1072
+ }
1073
+
1074
+ roomlabel = new RoomLabel({ props: roomlabel_props });
1075
+
1076
+ return {
1077
+ key: key_1,
1078
+ first: null,
1079
+ c() {
1080
+ first = internal.empty();
1081
+ internal.create_component(roomlabel.$$.fragment);
1082
+ this.first = first;
1083
+ },
1084
+ m(target, anchor) {
1085
+ internal.insert(target, first, anchor);
1086
+ internal.mount_component(roomlabel, target, anchor);
1087
+ current = true;
1088
+ },
1089
+ p(new_ctx, dirty) {
1090
+ ctx = new_ctx;
1091
+
1092
+ const roomlabel_changes = (dirty & /*pxmm, rooms, getLabelElement, hoveredRoom, adaptiveRoomLabelVisibleEnable*/ 55)
1093
+ ? internal.get_spread_update(roomlabel_spread_levels, [
1094
+ {
1095
+ pxmm: /*pxmm*/ ctx[4],
1096
+ room: /*room*/ ctx[9],
1097
+ getLabelElement: /*getLabelElement*/ ctx[1],
1098
+ hoveredRoom: /*hoveredRoom*/ ctx[0],
1099
+ adaptiveRoomLabelVisibleEnable: /*adaptiveRoomLabelVisibleEnable*/ ctx[2]
1100
+ }
1101
+ ])
1102
+ : {};
1103
+
1104
+ roomlabel.$set(roomlabel_changes);
1105
+ },
1106
+ i(local) {
1107
+ if (current) return;
1108
+ internal.transition_in(roomlabel.$$.fragment, local);
1109
+ current = true;
1110
+ },
1111
+ o(local) {
1112
+ internal.transition_out(roomlabel.$$.fragment, local);
1113
+ current = false;
1114
+ },
1115
+ d(detaching) {
1116
+ if (detaching) internal.detach(first);
1117
+ internal.destroy_component(roomlabel, detaching);
1118
+ }
1119
+ };
1120
+ }
1121
+
1122
+ function create_fragment$a(ctx) {
1123
+ let if_block_anchor;
1124
+ let current;
1125
+ let if_block = /*rooms*/ ctx[5] && create_if_block$3(ctx);
1126
+
1127
+ return {
1128
+ c() {
1129
+ if (if_block) if_block.c();
1130
+ if_block_anchor = internal.empty();
1131
+ },
1132
+ m(target, anchor) {
1133
+ if (if_block) if_block.m(target, anchor);
1134
+ internal.insert(target, if_block_anchor, anchor);
1135
+ current = true;
1136
+ },
1137
+ p(ctx, [dirty]) {
1138
+ if (/*rooms*/ ctx[5]) {
1139
+ if (if_block) {
1140
+ if_block.p(ctx, dirty);
1141
+
1142
+ if (dirty & /*rooms*/ 32) {
1143
+ internal.transition_in(if_block, 1);
1144
+ }
1145
+ } else {
1146
+ if_block = create_if_block$3(ctx);
1147
+ if_block.c();
1148
+ internal.transition_in(if_block, 1);
1149
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
1150
+ }
1151
+ } else if (if_block) {
1152
+ internal.group_outros();
1153
+
1154
+ internal.transition_out(if_block, 1, 1, () => {
1155
+ if_block = null;
1156
+ });
1157
+
1158
+ internal.check_outros();
1159
+ }
1160
+ },
1161
+ i(local) {
1162
+ if (current) return;
1163
+ internal.transition_in(if_block);
1164
+ current = true;
1165
+ },
1166
+ o(local) {
1167
+ internal.transition_out(if_block);
1168
+ current = false;
1169
+ },
1170
+ d(detaching) {
1171
+ if (if_block) if_block.d(detaching);
1172
+ if (detaching) internal.detach(if_block_anchor);
1173
+ }
1174
+ };
1175
+ }
1176
+
1177
+ function instance$a($$self, $$props, $$invalidate) {
1178
+ let rooms;
1243
1179
  let { floorIndex } = $$props;
1244
1180
  let { floorplanData } = $$props;
1181
+ let { hoveredRoom } = $$props;
1182
+ let { getLabelElement } = $$props;
1183
+ let { adaptiveRoomLabelVisibleEnable } = $$props;
1184
+ let clientWidth = 0;
1185
+ let pxmm = 0;
1186
+
1187
+ function div_elementresize_handler() {
1188
+ clientWidth = this.clientWidth;
1189
+ $$invalidate(3, clientWidth);
1190
+ }
1245
1191
 
1246
1192
  $$self.$$set = $$props => {
1247
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
1248
- if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
1249
- if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
1193
+ if ('floorIndex' in $$props) $$invalidate(6, floorIndex = $$props.floorIndex);
1194
+ if ('floorplanData' in $$props) $$invalidate(7, floorplanData = $$props.floorplanData);
1195
+ if ('hoveredRoom' in $$props) $$invalidate(0, hoveredRoom = $$props.hoveredRoom);
1196
+ if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
1197
+ if ('adaptiveRoomLabelVisibleEnable' in $$props) $$invalidate(2, adaptiveRoomLabelVisibleEnable = $$props.adaptiveRoomLabelVisibleEnable);
1250
1198
  };
1251
1199
 
1252
1200
  $$self.$$.update = () => {
1253
- if ($$self.$$.dirty & /*floorplanData*/ 16) {
1254
- $$invalidate(2, bounding = floorplanData.bounding);
1255
- }
1256
-
1257
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
1258
- $$invalidate(5, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
1201
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 192) {
1202
+ $$invalidate(5, rooms = floorplanData.floorDatas[floorIndex].rooms);
1259
1203
  }
1260
1204
 
1261
- if ($$self.$$.dirty & /*ruleLabelData*/ 32) {
1262
- $$invalidate(6, ruleLabelDataKeys = Object.keys(ruleLabelData));
1263
- }
1264
-
1265
- if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 96) {
1266
- $$invalidate(1, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
1205
+ if ($$self.$$.dirty & /*floorplanData, clientWidth*/ 136) {
1206
+ {
1207
+ const { max, min } = floorplanData.bounding;
1208
+ const boundingWidth = max.x - min.x;
1209
+ $$invalidate(4, pxmm = clientWidth / boundingWidth);
1210
+ }
1267
1211
  }
1268
1212
  };
1269
1213
 
1270
1214
  return [
1215
+ hoveredRoom,
1216
+ getLabelElement,
1217
+ adaptiveRoomLabelVisibleEnable,
1218
+ clientWidth,
1271
1219
  pxmm,
1272
- ruleLabelArray,
1273
- bounding,
1220
+ rooms,
1274
1221
  floorIndex,
1275
1222
  floorplanData,
1276
- ruleLabelData,
1277
- ruleLabelDataKeys
1223
+ div_elementresize_handler
1278
1224
  ];
1279
1225
  }
1280
1226
 
1281
- class RuleLabels extends internal.SvelteComponent {
1227
+ class RoomLabels extends internal.SvelteComponent {
1282
1228
  constructor(options) {
1283
1229
  super();
1284
- internal.init(this, options, instance$b, create_fragment$b, internal.safe_not_equal, { pxmm: 0, floorIndex: 3, floorplanData: 4 });
1230
+
1231
+ internal.init(
1232
+ this,
1233
+ options,
1234
+ instance$a,
1235
+ create_fragment$a,
1236
+ internal.safe_not_equal,
1237
+ {
1238
+ floorIndex: 6,
1239
+ floorplanData: 7,
1240
+ hoveredRoom: 0,
1241
+ getLabelElement: 1,
1242
+ adaptiveRoomLabelVisibleEnable: 2
1243
+ },
1244
+ add_css$7
1245
+ );
1285
1246
  }
1286
1247
  }
1287
1248
 
1288
- /* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
1249
+ /* src/floorplan/Components/RuleLabels/RuleItem.svelte generated by Svelte v3.47.0 */
1289
1250
 
1290
- function add_css$7(target) {
1291
- internal.append_styles(target, "svelte-1cuuebb", "img.svelte-1cuuebb{width:100%;height:100%}");
1251
+ function add_css$6(target) {
1252
+ internal.append_styles(target, "svelte-xt7p1v", ".floorplan-plugin__rule-labels.svelte-xt7p1v.svelte-xt7p1v{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-xt7p1v.svelte-xt7p1v{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-xt7p1v.svelte-xt7p1v{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-xt7p1v.svelte-xt7p1v{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-xt7p1v.svelte-xt7p1v{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-xt7p1v.svelte-xt7p1v{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-xt7p1v.svelte-xt7p1v{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-xt7p1v .floorplan-plugin__rule-scale-wrapper.svelte-xt7p1v{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-xt7p1v.svelte-xt7p1v{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-xt7p1v .floorplan-plugin__rule-scale.svelte-xt7p1v{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-xt7p1v.svelte-xt7p1v{position:absolute}.floorplan-plugin__rule-labels--top.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-xt7p1v.svelte-xt7p1v{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-xt7p1v .floorplan-plugin__rule-text-item.svelte-xt7p1v{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-xt7p1v.svelte-xt7p1v{width:-webkit-max-content;width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}");
1292
1253
  }
1293
1254
 
1294
- function create_fragment$a(ctx) {
1295
- let img;
1296
- let img_src_value;
1255
+ function get_each_context$4(ctx, list, i) {
1256
+ const child_ctx = ctx.slice();
1257
+ child_ctx[10] = list[i];
1258
+ child_ctx[12] = i;
1259
+ return child_ctx;
1260
+ }
1261
+
1262
+ function get_each_context_1(ctx, list, i) {
1263
+ const child_ctx = ctx.slice();
1264
+ child_ctx[13] = list[i];
1265
+ return child_ctx;
1266
+ }
1267
+
1268
+ // (47:4) {#each rulerLabels as rulerLabel}
1269
+ function create_each_block_1(ctx) {
1270
+ let div;
1297
1271
 
1298
1272
  return {
1299
1273
  c() {
1300
- img = internal.element("img");
1301
- if (!internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) internal.attr(img, "src", img_src_value);
1302
- internal.attr(img, "alt", "floorplan iamge");
1303
- internal.attr(img, "class", "svelte-1cuuebb");
1274
+ div = internal.element("div");
1275
+ internal.attr(div, "class", "floorplan-plugin__rule-scale svelte-xt7p1v");
1276
+ internal.set_style(div, "left", /*rulerLabel*/ ctx[13].left * 100 + '%', false);
1277
+ internal.set_style(div, "bottom", /*rulerLabel*/ ctx[13].bottom * 100 + '%', false);
1304
1278
  },
1305
1279
  m(target, anchor) {
1306
- internal.insert(target, img, anchor);
1307
- },
1308
- p(ctx, [dirty]) {
1309
- if (dirty & /*url*/ 1 && !internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
1310
- internal.attr(img, "src", img_src_value);
1311
- }
1280
+ internal.insert(target, div, anchor);
1312
1281
  },
1313
- i: internal.noop,
1314
- o: internal.noop,
1282
+ p: internal.noop,
1315
1283
  d(detaching) {
1316
- if (detaching) internal.detach(img);
1284
+ if (detaching) internal.detach(div);
1317
1285
  }
1318
1286
  };
1319
1287
  }
1320
1288
 
1321
- function instance$a($$self, $$props, $$invalidate) {
1322
- let { url } = $$props;
1289
+ // (56:4) {#each rulerTexts as textItem, textItemIndex (textItemIndex)}
1290
+ function create_each_block$4(key_1, ctx) {
1291
+ let div1;
1292
+ let div0;
1293
+ let t0_value = /*textItem*/ ctx[10].distance + "";
1294
+ let t0;
1295
+ let t1;
1323
1296
 
1324
- $$self.$$set = $$props => {
1325
- if ('url' in $$props) $$invalidate(0, url = $$props.url);
1297
+ return {
1298
+ key: key_1,
1299
+ first: null,
1300
+ c() {
1301
+ div1 = internal.element("div");
1302
+ div0 = internal.element("div");
1303
+ t0 = internal.text(t0_value);
1304
+ t1 = internal.space();
1305
+ internal.attr(div0, "class", "floorplan-plugin__rule-text svelte-xt7p1v");
1306
+ internal.toggle_class(div0, "is-row", /*isRow*/ ctx[1]);
1307
+ internal.attr(div1, "class", "floorplan-plugin__rule-text-item svelte-xt7p1v");
1308
+ internal.set_style(div1, "left", /*textItem*/ ctx[10].left * 100 + '%', false);
1309
+ internal.set_style(div1, "bottom", /*textItem*/ ctx[10].bottom * 100 + '%', false);
1310
+ this.first = div1;
1311
+ },
1312
+ m(target, anchor) {
1313
+ internal.insert(target, div1, anchor);
1314
+ internal.append(div1, div0);
1315
+ internal.append(div0, t0);
1316
+ internal.append(div1, t1);
1317
+ },
1318
+ p(new_ctx, dirty) {
1319
+ ctx = new_ctx;
1320
+ },
1321
+ d(detaching) {
1322
+ if (detaching) internal.detach(div1);
1323
+ }
1326
1324
  };
1327
-
1328
- return [url];
1329
1325
  }
1330
1326
 
1331
- class Normalmage extends internal.SvelteComponent {
1332
- constructor(options) {
1333
- super();
1334
- internal.init(this, options, instance$a, create_fragment$a, internal.safe_not_equal, { url: 0 }, add_css$7);
1335
- }
1336
- }
1327
+ function create_fragment$9(ctx) {
1328
+ let div3;
1329
+ let div0;
1330
+ let t0;
1331
+ let div1;
1332
+ let t1;
1333
+ let div2;
1334
+ let each_blocks = [];
1335
+ let each1_lookup = new Map();
1336
+ let div3_class_value;
1337
+ let each_value_1 = /*rulerLabels*/ ctx[2];
1338
+ let each_blocks_1 = [];
1337
1339
 
1338
- /* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
1340
+ for (let i = 0; i < each_value_1.length; i += 1) {
1341
+ each_blocks_1[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
1342
+ }
1339
1343
 
1340
- function add_css$6(target) {
1341
- internal.append_styles(target, "svelte-1qqy56u", ".floorplan-plugin__base-image.svelte-1qqy56u{width:100%;height:100%}");
1342
- }
1344
+ let each_value = /*rulerTexts*/ ctx[3];
1345
+ const get_key = ctx => /*textItemIndex*/ ctx[12];
1343
1346
 
1344
- function create_fragment$9(ctx) {
1345
- let div;
1346
- let html_tag;
1347
- let t;
1348
- let html_tag_1;
1347
+ for (let i = 0; i < each_value.length; i += 1) {
1348
+ let child_ctx = get_each_context$4(ctx, each_value, i);
1349
+ let key = get_key(child_ctx);
1350
+ each1_lookup.set(key, each_blocks[i] = create_each_block$4(key, child_ctx));
1351
+ }
1349
1352
 
1350
1353
  return {
1351
1354
  c() {
1352
- div = internal.element("div");
1353
- html_tag = new internal.HtmlTag();
1354
- t = internal.space();
1355
- html_tag_1 = new internal.HtmlTag();
1356
- html_tag.a = t;
1357
- html_tag_1.a = null;
1358
- internal.attr(div, "class", "floorplan-plugin__base-image svelte-1qqy56u");
1355
+ div3 = internal.element("div");
1356
+ div0 = internal.element("div");
1357
+ t0 = internal.space();
1358
+ div1 = internal.element("div");
1359
+
1360
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
1361
+ each_blocks_1[i].c();
1362
+ }
1363
+
1364
+ t1 = internal.space();
1365
+ div2 = internal.element("div");
1366
+
1367
+ for (let i = 0; i < each_blocks.length; i += 1) {
1368
+ each_blocks[i].c();
1369
+ }
1370
+
1371
+ internal.attr(div0, "class", "floorplan-plugin__rule-line svelte-xt7p1v");
1372
+ internal.attr(div1, "class", "floorplan-plugin__rule-scale-wrapper svelte-xt7p1v");
1373
+ internal.toggle_class(div1, "is-row", /*isRow*/ ctx[1]);
1374
+ internal.attr(div2, "class", "floorplan-plugin__rule-text-wrapper svelte-xt7p1v");
1375
+ internal.attr(div3, "class", div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-xt7p1v");
1376
+ internal.toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
1377
+ internal.set_style(div3, "width", /*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
1378
+ internal.set_style(div3, "height", !/*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
1359
1379
  },
1360
1380
  m(target, anchor) {
1361
- internal.insert(target, div, anchor);
1362
- html_tag.m(/*svgStyle*/ ctx[1], div);
1363
- internal.append(div, t);
1364
- html_tag_1.m(/*content*/ ctx[0], div);
1381
+ internal.insert(target, div3, anchor);
1382
+ internal.append(div3, div0);
1383
+ internal.append(div3, t0);
1384
+ internal.append(div3, div1);
1385
+
1386
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
1387
+ each_blocks_1[i].m(div1, null);
1388
+ }
1389
+
1390
+ internal.append(div3, t1);
1391
+ internal.append(div3, div2);
1392
+
1393
+ for (let i = 0; i < each_blocks.length; i += 1) {
1394
+ each_blocks[i].m(div2, null);
1395
+ }
1365
1396
  },
1366
1397
  p(ctx, [dirty]) {
1367
- if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
1398
+ if (dirty & /*rulerLabels*/ 4) {
1399
+ each_value_1 = /*rulerLabels*/ ctx[2];
1400
+ let i;
1401
+
1402
+ for (i = 0; i < each_value_1.length; i += 1) {
1403
+ const child_ctx = get_each_context_1(ctx, each_value_1, i);
1404
+
1405
+ if (each_blocks_1[i]) {
1406
+ each_blocks_1[i].p(child_ctx, dirty);
1407
+ } else {
1408
+ each_blocks_1[i] = create_each_block_1(child_ctx);
1409
+ each_blocks_1[i].c();
1410
+ each_blocks_1[i].m(div1, null);
1411
+ }
1412
+ }
1413
+
1414
+ for (; i < each_blocks_1.length; i += 1) {
1415
+ each_blocks_1[i].d(1);
1416
+ }
1417
+
1418
+ each_blocks_1.length = each_value_1.length;
1419
+ }
1420
+
1421
+ if (dirty & /*rulerTexts, isRow*/ 10) {
1422
+ each_value = /*rulerTexts*/ ctx[3];
1423
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each1_lookup, div2, internal.destroy_block, create_each_block$4, null, get_each_context$4);
1424
+ }
1425
+
1426
+ if (dirty & /*type*/ 1 && div3_class_value !== (div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-xt7p1v")) {
1427
+ internal.attr(div3, "class", div3_class_value);
1428
+ }
1429
+
1430
+ if (dirty & /*type, isRow*/ 3) {
1431
+ internal.toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
1432
+ }
1368
1433
  },
1369
1434
  i: internal.noop,
1370
1435
  o: internal.noop,
1371
1436
  d(detaching) {
1372
- if (detaching) internal.detach(div);
1437
+ if (detaching) internal.detach(div3);
1438
+ internal.destroy_each(each_blocks_1, detaching);
1439
+
1440
+ for (let i = 0; i < each_blocks.length; i += 1) {
1441
+ each_blocks[i].d();
1442
+ }
1373
1443
  }
1374
1444
  };
1375
1445
  }
1376
1446
 
1447
+ const padding$1 = 1000;
1448
+ const exteriorWallOffset$1 = 180;
1449
+
1377
1450
  function instance$9($$self, $$props, $$invalidate) {
1378
- let { content } = $$props;
1451
+ let { type } = $$props;
1452
+ let { data } = $$props;
1453
+ let { bounding } = $$props;
1454
+ const isRow = type === 'top' || type === 'bottom';
1455
+ const contentWidth = bounding.max.x - bounding.min.x - (padding$1 - exteriorWallOffset$1) * 2;
1456
+ const contentHeight = bounding.max.y - bounding.min.y - (padding$1 - exteriorWallOffset$1) * 2;
1379
1457
 
1380
- const svgStyle = `
1381
- <style>
1382
- svg [type='lineGroup'] path {
1383
- fill: #ffffff;
1384
- stroke: #ffffff;
1385
- }
1386
- svg [type='lineItemGroup'] g g g g {
1387
- stroke: #ffffff;
1388
- }
1389
- </style>
1390
- `;
1458
+ // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
1459
+ const rulerPoints = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
1460
+ // 筛除重复数据
1461
+ if (index === 0) return true;
1462
+
1463
+ return x !== arr[index - 1];
1464
+ });
1465
+
1466
+ const rulerLabels = rulerPoints.map(num => {
1467
+ const left = isRow
1468
+ ? (num - bounding.min.x - padding$1 + exteriorWallOffset$1) / contentWidth
1469
+ : 0;
1470
+
1471
+ const bottom = !isRow
1472
+ ? (num - bounding.min.y - padding$1 + exteriorWallOffset$1) / contentHeight
1473
+ : 0;
1474
+
1475
+ return { left, bottom };
1476
+ });
1477
+
1478
+ rulerLabels.unshift({ left: 0, bottom: 0 });
1479
+ rulerLabels.push(isRow ? { left: 1, bottom: 0 } : { left: 0, bottom: 1 });
1480
+ const length = rulerPoints[rulerPoints.length - 1] - rulerPoints[0];
1481
+
1482
+ const rulerTexts = rulerPoints.map((num, index, arr) => {
1483
+ const distance = index === 0 ? 0 : num - arr[index - 1];
1484
+ const positionNum = index === 0 ? 0 : (num + arr[index - 1]) / 2;
1485
+
1486
+ const left = isRow
1487
+ ? (positionNum - bounding.min.x - padding$1 + exteriorWallOffset$1) / contentWidth
1488
+ : 0;
1489
+
1490
+ const bottom = !isRow
1491
+ ? (positionNum - bounding.min.y - padding$1 + exteriorWallOffset$1) / contentHeight
1492
+ : 0;
1493
+
1494
+ return { left, bottom, distance };
1495
+ }).filter(({ distance }) => distance / length > 0.1);
1391
1496
 
1392
1497
  $$self.$$set = $$props => {
1393
- if ('content' in $$props) $$invalidate(0, content = $$props.content);
1498
+ if ('type' in $$props) $$invalidate(0, type = $$props.type);
1499
+ if ('data' in $$props) $$invalidate(4, data = $$props.data);
1500
+ if ('bounding' in $$props) $$invalidate(5, bounding = $$props.bounding);
1394
1501
  };
1395
1502
 
1396
- return [content, svgStyle];
1503
+ return [type, isRow, rulerLabels, rulerTexts, data, bounding];
1397
1504
  }
1398
1505
 
1399
- class SvgImage extends internal.SvelteComponent {
1506
+ class RuleItem extends internal.SvelteComponent {
1400
1507
  constructor(options) {
1401
1508
  super();
1402
- internal.init(this, options, instance$9, create_fragment$9, internal.safe_not_equal, { content: 0 }, add_css$6);
1509
+ internal.init(this, options, instance$9, create_fragment$9, internal.safe_not_equal, { type: 0, data: 4, bounding: 5 }, add_css$6);
1403
1510
  }
1404
1511
  }
1405
1512
 
1406
- /* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
1513
+ /* src/floorplan/Components/RuleLabels/RuleLabels.svelte generated by Svelte v3.47.0 */
1407
1514
 
1408
1515
  function add_css$5(target) {
1409
- internal.append_styles(target, "svelte-126ja8e", ".floorplan-plugin__base-image.svelte-126ja8e{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
1516
+ internal.append_styles(target, "svelte-1mzj9p3", ".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}");
1410
1517
  }
1411
1518
 
1412
- // (12:22)
1413
- function create_if_block_1$3(ctx) {
1414
- let normalimage;
1519
+ function get_each_context$3(ctx, list, i) {
1520
+ const child_ctx = ctx.slice();
1521
+ child_ctx[12] = list[i][0];
1522
+ child_ctx[13] = list[i][1];
1523
+ return child_ctx;
1524
+ }
1525
+
1526
+ // (19:2) {#each ruleLabelArray as [type, data] (type)}
1527
+ function create_each_block$3(key_1, ctx) {
1528
+ let first;
1529
+ let ruleitem;
1415
1530
  let current;
1416
- normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
1417
1531
 
1418
- return {
1419
- c() {
1420
- internal.create_component(normalimage.$$.fragment);
1421
- },
1422
- m(target, anchor) {
1423
- internal.mount_component(normalimage, target, anchor);
1424
- current = true;
1425
- },
1426
- p(ctx, dirty) {
1427
- const normalimage_changes = {};
1428
- if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
1429
- normalimage.$set(normalimage_changes);
1430
- },
1431
- i(local) {
1432
- if (current) return;
1433
- internal.transition_in(normalimage.$$.fragment, local);
1434
- current = true;
1435
- },
1436
- o(local) {
1437
- internal.transition_out(normalimage.$$.fragment, local);
1438
- current = false;
1439
- },
1440
- d(detaching) {
1441
- internal.destroy_component(normalimage, detaching);
1532
+ const ruleitem_spread_levels = [
1533
+ {
1534
+ type: /*type*/ ctx[12],
1535
+ data: /*data*/ ctx[13],
1536
+ bounding: /*bounding*/ ctx[0]
1442
1537
  }
1443
- };
1444
- }
1538
+ ];
1445
1539
 
1446
- // (10:2) {#if svgContent}
1447
- function create_if_block$3(ctx) {
1448
- let svgimage;
1449
- let current;
1540
+ let ruleitem_props = {};
1450
1541
 
1451
- svgimage = new SvgImage({
1452
- props: { content: /*svgContent*/ ctx[0] }
1453
- });
1542
+ for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
1543
+ ruleitem_props = internal.assign(ruleitem_props, ruleitem_spread_levels[i]);
1544
+ }
1545
+
1546
+ ruleitem = new RuleItem({ props: ruleitem_props });
1454
1547
 
1455
1548
  return {
1549
+ key: key_1,
1550
+ first: null,
1456
1551
  c() {
1457
- internal.create_component(svgimage.$$.fragment);
1552
+ first = internal.empty();
1553
+ internal.create_component(ruleitem.$$.fragment);
1554
+ this.first = first;
1458
1555
  },
1459
1556
  m(target, anchor) {
1460
- internal.mount_component(svgimage, target, anchor);
1557
+ internal.insert(target, first, anchor);
1558
+ internal.mount_component(ruleitem, target, anchor);
1461
1559
  current = true;
1462
1560
  },
1463
- p(ctx, dirty) {
1464
- const svgimage_changes = {};
1465
- if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
1466
- svgimage.$set(svgimage_changes);
1561
+ p(new_ctx, dirty) {
1562
+ ctx = new_ctx;
1563
+
1564
+ const ruleitem_changes = (dirty & /*ruleLabelArray, bounding*/ 9)
1565
+ ? internal.get_spread_update(ruleitem_spread_levels, [
1566
+ {
1567
+ type: /*type*/ ctx[12],
1568
+ data: /*data*/ ctx[13],
1569
+ bounding: /*bounding*/ ctx[0]
1570
+ }
1571
+ ])
1572
+ : {};
1573
+
1574
+ ruleitem.$set(ruleitem_changes);
1467
1575
  },
1468
1576
  i(local) {
1469
1577
  if (current) return;
1470
- internal.transition_in(svgimage.$$.fragment, local);
1578
+ internal.transition_in(ruleitem.$$.fragment, local);
1471
1579
  current = true;
1472
1580
  },
1473
1581
  o(local) {
1474
- internal.transition_out(svgimage.$$.fragment, local);
1582
+ internal.transition_out(ruleitem.$$.fragment, local);
1475
1583
  current = false;
1476
1584
  },
1477
1585
  d(detaching) {
1478
- internal.destroy_component(svgimage, detaching);
1586
+ if (detaching) internal.detach(first);
1587
+ internal.destroy_component(ruleitem, detaching);
1479
1588
  }
1480
1589
  };
1481
1590
  }
1482
1591
 
1483
1592
  function create_fragment$8(ctx) {
1484
1593
  let div;
1485
- let current_block_type_index;
1486
- let if_block;
1594
+ let each_blocks = [];
1595
+ let each_1_lookup = new Map();
1487
1596
  let current;
1488
- const if_block_creators = [create_if_block$3, create_if_block_1$3];
1489
- const if_blocks = [];
1490
-
1491
- function select_block_type(ctx, dirty) {
1492
- if (/*svgContent*/ ctx[0]) return 0;
1493
- if (/*imageData*/ ctx[1]) return 1;
1494
- return -1;
1495
- }
1597
+ let each_value = /*ruleLabelArray*/ ctx[3];
1598
+ const get_key = ctx => /*type*/ ctx[12];
1496
1599
 
1497
- if (~(current_block_type_index = select_block_type(ctx))) {
1498
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1600
+ for (let i = 0; i < each_value.length; i += 1) {
1601
+ let child_ctx = get_each_context$3(ctx, each_value, i);
1602
+ let key = get_key(child_ctx);
1603
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$3(key, child_ctx));
1499
1604
  }
1500
1605
 
1501
1606
  return {
1502
1607
  c() {
1503
1608
  div = internal.element("div");
1504
- if (if_block) if_block.c();
1505
- internal.attr(div, "class", "floorplan-plugin__base-image svelte-126ja8e");
1609
+
1610
+ for (let i = 0; i < each_blocks.length; i += 1) {
1611
+ each_blocks[i].c();
1612
+ }
1613
+
1614
+ internal.attr(div, "class", "floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3");
1615
+ internal.set_style(div, "width", /*width*/ ctx[2], false);
1616
+ internal.set_style(div, "height", /*height*/ ctx[1], false);
1506
1617
  },
1507
1618
  m(target, anchor) {
1508
1619
  internal.insert(target, div, anchor);
1509
1620
 
1510
- if (~current_block_type_index) {
1511
- if_blocks[current_block_type_index].m(div, null);
1621
+ for (let i = 0; i < each_blocks.length; i += 1) {
1622
+ each_blocks[i].m(div, null);
1512
1623
  }
1513
1624
 
1514
1625
  current = true;
1515
1626
  },
1516
1627
  p(ctx, [dirty]) {
1517
- let previous_block_index = current_block_type_index;
1518
- current_block_type_index = select_block_type(ctx);
1519
-
1520
- if (current_block_type_index === previous_block_index) {
1521
- if (~current_block_type_index) {
1522
- if_blocks[current_block_type_index].p(ctx, dirty);
1523
- }
1524
- } else {
1525
- if (if_block) {
1526
- internal.group_outros();
1527
-
1528
- internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
1529
- if_blocks[previous_block_index] = null;
1530
- });
1531
-
1532
- internal.check_outros();
1533
- }
1534
-
1535
- if (~current_block_type_index) {
1536
- if_block = if_blocks[current_block_type_index];
1628
+ if (dirty & /*ruleLabelArray, bounding*/ 9) {
1629
+ each_value = /*ruleLabelArray*/ ctx[3];
1630
+ internal.group_outros();
1631
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$3, null, get_each_context$3);
1632
+ internal.check_outros();
1633
+ }
1537
1634
 
1538
- if (!if_block) {
1539
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1540
- if_block.c();
1541
- } else {
1542
- if_block.p(ctx, dirty);
1543
- }
1635
+ if (dirty & /*width*/ 4) {
1636
+ internal.set_style(div, "width", /*width*/ ctx[2], false);
1637
+ }
1544
1638
 
1545
- internal.transition_in(if_block, 1);
1546
- if_block.m(div, null);
1547
- } else {
1548
- if_block = null;
1549
- }
1639
+ if (dirty & /*height*/ 2) {
1640
+ internal.set_style(div, "height", /*height*/ ctx[1], false);
1550
1641
  }
1551
1642
  },
1552
1643
  i(local) {
1553
1644
  if (current) return;
1554
- internal.transition_in(if_block);
1645
+
1646
+ for (let i = 0; i < each_value.length; i += 1) {
1647
+ internal.transition_in(each_blocks[i]);
1648
+ }
1649
+
1555
1650
  current = true;
1556
1651
  },
1557
1652
  o(local) {
1558
- internal.transition_out(if_block);
1653
+ for (let i = 0; i < each_blocks.length; i += 1) {
1654
+ internal.transition_out(each_blocks[i]);
1655
+ }
1656
+
1559
1657
  current = false;
1560
1658
  },
1561
1659
  d(detaching) {
1562
1660
  if (detaching) internal.detach(div);
1563
1661
 
1564
- if (~current_block_type_index) {
1565
- if_blocks[current_block_type_index].d();
1662
+ for (let i = 0; i < each_blocks.length; i += 1) {
1663
+ each_blocks[i].d();
1566
1664
  }
1567
1665
  }
1568
1666
  };
1569
1667
  }
1570
1668
 
1669
+ const padding = 1000;
1670
+ const exteriorWallOffset = 180;
1671
+
1571
1672
  function instance$8($$self, $$props, $$invalidate) {
1572
- let imageData;
1573
- let svgContent;
1673
+ let bounding;
1674
+ let ruleLabelData;
1675
+ let ruleLabelDataKeys;
1676
+ let ruleLabelArray;
1677
+ let boundingWidth;
1678
+ let boundingHeight;
1679
+ let contentWidth;
1680
+ let contentHeight;
1681
+ let width;
1682
+ let height;
1574
1683
  let { floorIndex } = $$props;
1575
1684
  let { floorplanData } = $$props;
1576
1685
 
1577
- $$self.$$set = $$props => {
1578
- if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
1579
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
1580
- };
1686
+ $$self.$$set = $$props => {
1687
+ if ('floorIndex' in $$props) $$invalidate(4, floorIndex = $$props.floorIndex);
1688
+ if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
1689
+ };
1690
+
1691
+ $$self.$$.update = () => {
1692
+ if ($$self.$$.dirty & /*floorplanData*/ 32) {
1693
+ $$invalidate(0, bounding = floorplanData.bounding);
1694
+ }
1695
+
1696
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 48) {
1697
+ $$invalidate(10, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
1698
+ }
1699
+
1700
+ if ($$self.$$.dirty & /*ruleLabelData*/ 1024) {
1701
+ $$invalidate(11, ruleLabelDataKeys = Object.keys(ruleLabelData));
1702
+ }
1703
+
1704
+ if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 3072) {
1705
+ $$invalidate(3, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
1706
+ }
1707
+
1708
+ if ($$self.$$.dirty & /*bounding*/ 1) {
1709
+ $$invalidate(8, boundingWidth = bounding.max.x - bounding.min.x);
1710
+ }
1711
+
1712
+ if ($$self.$$.dirty & /*bounding*/ 1) {
1713
+ $$invalidate(6, boundingHeight = bounding.max.y - bounding.min.y);
1714
+ }
1715
+
1716
+ if ($$self.$$.dirty & /*bounding*/ 1) {
1717
+ $$invalidate(9, contentWidth = bounding.max.x - bounding.min.x - (padding - exteriorWallOffset) * 2);
1718
+ }
1719
+
1720
+ if ($$self.$$.dirty & /*bounding*/ 1) {
1721
+ $$invalidate(7, contentHeight = bounding.max.y - bounding.min.y - (padding - exteriorWallOffset) * 2);
1722
+ }
1581
1723
 
1582
- $$self.$$.update = () => {
1583
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
1584
- $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
1724
+ if ($$self.$$.dirty & /*contentWidth, boundingWidth*/ 768) {
1725
+ $$invalidate(2, width = contentWidth / boundingWidth * 100 + '%');
1585
1726
  }
1586
1727
 
1587
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
1588
- $$invalidate(0, svgContent = floorplanData.outlines?.[floorIndex]?.svgContent);
1728
+ if ($$self.$$.dirty & /*contentHeight, boundingHeight*/ 192) {
1729
+ $$invalidate(1, height = contentHeight / boundingHeight * 100 + '%');
1589
1730
  }
1590
1731
  };
1591
1732
 
1592
- return [svgContent, imageData, floorIndex, floorplanData];
1733
+ return [
1734
+ bounding,
1735
+ height,
1736
+ width,
1737
+ ruleLabelArray,
1738
+ floorIndex,
1739
+ floorplanData,
1740
+ boundingHeight,
1741
+ contentHeight,
1742
+ boundingWidth,
1743
+ contentWidth,
1744
+ ruleLabelData,
1745
+ ruleLabelDataKeys
1746
+ ];
1593
1747
  }
1594
1748
 
1595
- class BaseImage extends internal.SvelteComponent {
1749
+ class RuleLabels extends internal.SvelteComponent {
1596
1750
  constructor(options) {
1597
1751
  super();
1598
- internal.init(this, options, instance$8, create_fragment$8, internal.safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$5);
1752
+ internal.init(this, options, instance$8, create_fragment$8, internal.safe_not_equal, { floorIndex: 4, floorplanData: 5 }, add_css$5);
1599
1753
  }
1600
1754
  }
1601
1755
 
1756
+ function pathD(points, options = {}) {
1757
+ let d = '';
1758
+ const { needZ, needA } = options;
1759
+ const _points = needZ ? points.slice().concat(points[0]) : points.slice();
1760
+ _points.forEach((_point, index) => {
1761
+ const { x, y } = options.format ? options.format(_point) : _point;
1762
+ const point = x + ',' + y;
1763
+ if (index === 0) {
1764
+ d += 'M' + point;
1765
+ return d;
1766
+ }
1767
+ if (needA === null || needA === void 0 ? void 0 : needA[index]) {
1768
+ d += 'A' + needA[index] + ',' + point;
1769
+ return d;
1770
+ }
1771
+ d += 'L' + point;
1772
+ return d;
1773
+ });
1774
+ return d + (needZ ? 'Z' : '');
1775
+ }
1776
+ /** 把户型图上点点位转换到 SVG 上的点位 */
1777
+ function formatFloorplanPoint({ x, y }, bounding) {
1778
+ const { max, min } = bounding;
1779
+ return { x: x - min.x, y: max.y - y };
1780
+ }
1781
+
1602
1782
  /* src/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte generated by Svelte v3.47.0 */
1603
1783
 
1604
1784
  function create_fragment$7(ctx) {
@@ -1684,6 +1864,7 @@ function create_fragment$6(ctx) {
1684
1864
  internal.attr(pattern, "width", /*width*/ ctx[1]);
1685
1865
  internal.attr(pattern, "height", /*width*/ ctx[1]);
1686
1866
  internal.attr(pattern, "patternUnits", "userSpaceOnUse");
1867
+ internal.attr(pattern, "patternTransform", "scale(50 50)");
1687
1868
  internal.attr(path1, "d", /*d*/ ctx[0]);
1688
1869
  internal.attr(path1, "fill", "url(#fpm-room-pattern-0)");
1689
1870
  },
@@ -1766,8 +1947,8 @@ function create_fragment$5(ctx) {
1766
1947
  path1 = internal.svg_element("path");
1767
1948
  t2 = internal.space();
1768
1949
  path2 = internal.svg_element("path");
1769
- internal.attr(rect0, "x", "0.5");
1770
- internal.attr(rect0, "y", "0.5");
1950
+ internal.attr(rect0, "x", "0");
1951
+ internal.attr(rect0, "y", "0");
1771
1952
  internal.attr(rect0, "width", "6");
1772
1953
  internal.attr(rect0, "height", "50");
1773
1954
  internal.attr(rect0, "fill", "none");
@@ -1776,22 +1957,24 @@ function create_fragment$5(ctx) {
1776
1957
  internal.attr(pattern0, "id", "room-material-pattern-1");
1777
1958
  internal.attr(pattern0, "x", "0");
1778
1959
  internal.attr(pattern0, "y", "0");
1779
- internal.attr(pattern0, "width", "13");
1780
- internal.attr(pattern0, "height", "51");
1960
+ internal.attr(pattern0, "width", "12");
1961
+ internal.attr(pattern0, "height", "50");
1781
1962
  internal.attr(pattern0, "patternUnits", "userSpaceOnUse");
1782
- internal.attr(rect1, "x", "0.5");
1783
- internal.attr(rect1, "y", "0.5");
1963
+ internal.attr(pattern0, "patternTransform", "scale(50 50)");
1964
+ internal.attr(rect1, "x", "0");
1965
+ internal.attr(rect1, "y", "0");
1784
1966
  internal.attr(rect1, "width", "6");
1785
1967
  internal.attr(rect1, "height", "50");
1786
1968
  internal.attr(rect1, "fill", "none");
1787
1969
  internal.attr(rect1, "stroke", "#4B4B57");
1788
1970
  internal.attr(rect1, "stroke-width", "0.5");
1789
1971
  internal.attr(pattern1, "id", "room-material-pattern-2");
1790
- internal.attr(pattern1, "x", "7");
1972
+ internal.attr(pattern1, "x", "6");
1791
1973
  internal.attr(pattern1, "y", "25");
1792
- internal.attr(pattern1, "width", "13");
1793
- internal.attr(pattern1, "height", "51");
1974
+ internal.attr(pattern1, "width", "12");
1975
+ internal.attr(pattern1, "height", "50");
1794
1976
  internal.attr(pattern1, "patternUnits", "userSpaceOnUse");
1977
+ internal.attr(pattern1, "patternTransform", "scale(50 50)");
1795
1978
  internal.attr(path0, "d", /*d*/ ctx[0]);
1796
1979
  internal.attr(path0, "fill", "#43434D");
1797
1980
  internal.attr(path1, "d", /*d*/ ctx[0]);
@@ -1866,20 +2049,20 @@ class RoomMaterial_2 extends internal.SvelteComponent {
1866
2049
  /* src/floorplan/Components/RoomMaterials/RoomMaterial.svelte generated by Svelte v3.47.0 */
1867
2050
 
1868
2051
  function add_css$4(target) {
1869
- internal.append_styles(target, "svelte-1b0icjc", "svg.svelte-1b0icjc{position:absolute;width:100%;height:100%;overflow:visible}");
2052
+ internal.append_styles(target, "svelte-1dykexu", ".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}");
1870
2053
  }
1871
2054
 
1872
- function get_each_context$1(ctx, list, i) {
2055
+ function get_each_context$2(ctx, list, i) {
1873
2056
  const child_ctx = ctx.slice();
1874
- child_ctx[4] = list[i];
2057
+ child_ctx[5] = list[i];
1875
2058
  return child_ctx;
1876
2059
  }
1877
2060
 
1878
- // (21:6) {:else}
2061
+ // (19:6) {:else}
1879
2062
  function create_else_block(ctx) {
1880
2063
  let roommaterial_1;
1881
2064
  let current;
1882
- roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[4].path } });
2065
+ roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[5].path } });
1883
2066
 
1884
2067
  return {
1885
2068
  c() {
@@ -1891,7 +2074,7 @@ function create_else_block(ctx) {
1891
2074
  },
1892
2075
  p(ctx, dirty) {
1893
2076
  const roommaterial_1_changes = {};
1894
- if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[4].path;
2077
+ if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[5].path;
1895
2078
  roommaterial_1.$set(roommaterial_1_changes);
1896
2079
  },
1897
2080
  i(local) {
@@ -1909,11 +2092,11 @@ function create_else_block(ctx) {
1909
2092
  };
1910
2093
  }
1911
2094
 
1912
- // (19:37)
2095
+ // (17:37)
1913
2096
  function create_if_block_1$2(ctx) {
1914
2097
  let roommaterial_2;
1915
2098
  let current;
1916
- roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[4].path } });
2099
+ roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[5].path } });
1917
2100
 
1918
2101
  return {
1919
2102
  c() {
@@ -1925,7 +2108,7 @@ function create_if_block_1$2(ctx) {
1925
2108
  },
1926
2109
  p(ctx, dirty) {
1927
2110
  const roommaterial_2_changes = {};
1928
- if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[4].path;
2111
+ if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[5].path;
1929
2112
  roommaterial_2.$set(roommaterial_2_changes);
1930
2113
  },
1931
2114
  i(local) {
@@ -1943,11 +2126,11 @@ function create_if_block_1$2(ctx) {
1943
2126
  };
1944
2127
  }
1945
2128
 
1946
- // (17:6) {#if room.floorType === 1}
2129
+ // (15:6) {#if room.floorType === 1}
1947
2130
  function create_if_block$2(ctx) {
1948
2131
  let roommaterial_0;
1949
2132
  let current;
1950
- roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[4].path } });
2133
+ roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[5].path } });
1951
2134
 
1952
2135
  return {
1953
2136
  c() {
@@ -1959,7 +2142,7 @@ function create_if_block$2(ctx) {
1959
2142
  },
1960
2143
  p(ctx, dirty) {
1961
2144
  const roommaterial_0_changes = {};
1962
- if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[4].path;
2145
+ if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[5].path;
1963
2146
  roommaterial_0.$set(roommaterial_0_changes);
1964
2147
  },
1965
2148
  i(local) {
@@ -1977,18 +2160,19 @@ function create_if_block$2(ctx) {
1977
2160
  };
1978
2161
  }
1979
2162
 
1980
- // (15:2) {#each rooms as room}
1981
- function create_each_block$1(ctx) {
2163
+ // (13:2) {#each rooms as room}
2164
+ function create_each_block$2(ctx) {
1982
2165
  let svg;
1983
2166
  let current_block_type_index;
1984
2167
  let if_block;
2168
+ let svg_viewBox_value;
1985
2169
  let current;
1986
2170
  const if_block_creators = [create_if_block$2, create_if_block_1$2, create_else_block];
1987
2171
  const if_blocks = [];
1988
2172
 
1989
2173
  function select_block_type(ctx, dirty) {
1990
- if (/*room*/ ctx[4].floorType === 1) return 0;
1991
- if (/*room*/ ctx[4].floorType === 0) return 1;
2174
+ if (/*room*/ ctx[5].floorType === 1) return 0;
2175
+ if (/*room*/ ctx[5].floorType === 0) return 1;
1992
2176
  return 2;
1993
2177
  }
1994
2178
 
@@ -1999,7 +2183,10 @@ function create_each_block$1(ctx) {
1999
2183
  c() {
2000
2184
  svg = internal.svg_element("svg");
2001
2185
  if_block.c();
2002
- internal.attr(svg, "class", "svelte-1b0icjc");
2186
+ internal.attr(svg, "width", "100%");
2187
+ internal.attr(svg, "height", "100%");
2188
+ internal.attr(svg, "viewBox", svg_viewBox_value = `0 0 ${/*boundingWidth*/ ctx[1]} ${/*boundingHeight*/ ctx[2]}`);
2189
+ internal.attr(svg, "class", "svelte-1dykexu");
2003
2190
  },
2004
2191
  m(target, anchor) {
2005
2192
  internal.insert(target, svg, anchor);
@@ -2056,7 +2243,7 @@ function create_fragment$4(ctx) {
2056
2243
  let each_blocks = [];
2057
2244
 
2058
2245
  for (let i = 0; i < each_value.length; i += 1) {
2059
- each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i));
2246
+ each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i));
2060
2247
  }
2061
2248
 
2062
2249
  const out = i => internal.transition_out(each_blocks[i], 1, 1, () => {
@@ -2071,7 +2258,7 @@ function create_fragment$4(ctx) {
2071
2258
  each_blocks[i].c();
2072
2259
  }
2073
2260
 
2074
- internal.attr(div, "class", "floorplan-plugin__room-material");
2261
+ internal.attr(div, "class", "floorplan-plugin__room-material svelte-1dykexu");
2075
2262
  },
2076
2263
  m(target, anchor) {
2077
2264
  internal.insert(target, div, anchor);
@@ -2083,18 +2270,18 @@ function create_fragment$4(ctx) {
2083
2270
  current = true;
2084
2271
  },
2085
2272
  p(ctx, [dirty]) {
2086
- if (dirty & /*rooms*/ 1) {
2273
+ if (dirty & /*boundingWidth, boundingHeight, rooms*/ 7) {
2087
2274
  each_value = /*rooms*/ ctx[0];
2088
2275
  let i;
2089
2276
 
2090
2277
  for (i = 0; i < each_value.length; i += 1) {
2091
- const child_ctx = get_each_context$1(ctx, each_value, i);
2278
+ const child_ctx = get_each_context$2(ctx, each_value, i);
2092
2279
 
2093
2280
  if (each_blocks[i]) {
2094
2281
  each_blocks[i].p(child_ctx, dirty);
2095
2282
  internal.transition_in(each_blocks[i], 1);
2096
2283
  } else {
2097
- each_blocks[i] = create_each_block$1(child_ctx);
2284
+ each_blocks[i] = create_each_block$2(child_ctx);
2098
2285
  each_blocks[i].c();
2099
2286
  internal.transition_in(each_blocks[i], 1);
2100
2287
  each_blocks[i].m(div, null);
@@ -2138,112 +2325,146 @@ function create_fragment$4(ctx) {
2138
2325
  function instance$4($$self, $$props, $$invalidate) {
2139
2326
  let rooms;
2140
2327
  let { floorIndex } = $$props;
2141
- let { pxmm } = $$props;
2142
2328
  let { floorplanData } = $$props;
2329
+ const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
2330
+ const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
2143
2331
 
2144
2332
  $$self.$$set = $$props => {
2145
- if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
2146
- if ('pxmm' in $$props) $$invalidate(2, pxmm = $$props.pxmm);
2147
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
2333
+ if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
2334
+ if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
2148
2335
  };
2149
2336
 
2150
2337
  $$self.$$.update = () => {
2151
- if ($$self.$$.dirty & /*floorplanData, floorIndex, pxmm*/ 14) {
2152
- $$invalidate(0, rooms = floorplanData.floorDatas[floorIndex].rooms.map(room => ({
2153
- ...room,
2154
- path: room.path.map(p => formatFloorplanPoint(p, pxmm, floorplanData.bounding))
2338
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
2339
+ $$invalidate(0, rooms = floorplanData.floorDatas[floorIndex].rooms.map(room => Object.assign(Object.assign({}, room), {
2340
+ path: room.path.map(p => formatFloorplanPoint(p, floorplanData.bounding))
2155
2341
  })));
2156
2342
  }
2157
2343
  };
2158
2344
 
2159
- return [rooms, floorIndex, pxmm, floorplanData];
2345
+ return [rooms, boundingWidth, boundingHeight, floorIndex, floorplanData];
2160
2346
  }
2161
2347
 
2162
2348
  class RoomMaterial extends internal.SvelteComponent {
2163
2349
  constructor(options) {
2164
2350
  super();
2165
- internal.init(this, options, instance$4, create_fragment$4, internal.safe_not_equal, { floorIndex: 1, pxmm: 2, floorplanData: 3 }, add_css$4);
2351
+ internal.init(this, options, instance$4, create_fragment$4, internal.safe_not_equal, { floorIndex: 3, floorplanData: 4 }, add_css$4);
2166
2352
  }
2167
2353
  }
2168
2354
 
2169
2355
  /* src/floorplan/Components/RoomHighlight/Room.svelte generated by Svelte v3.47.0 */
2170
2356
 
2171
2357
  function add_css$3(target) {
2172
- internal.append_styles(target, "svelte-11takew", "path.svelte-11takew{opacity:0}path.svelte-11takew:hover{opacity:0.1}");
2358
+ internal.append_styles(target, "svelte-19uvvss", "path.svelte-19uvvss{opacity:0}path.svelte-19uvvss:hover{opacity:0.1}");
2173
2359
  }
2174
2360
 
2175
2361
  function create_fragment$3(ctx) {
2176
2362
  let path;
2363
+ let mounted;
2364
+ let dispose;
2177
2365
 
2178
2366
  return {
2179
2367
  c() {
2180
2368
  path = internal.svg_element("path");
2181
- internal.attr(path, "d", /*_pathD*/ ctx[0]);
2369
+ internal.attr(path, "d", /*_pathD*/ ctx[2]);
2182
2370
  internal.attr(path, "fill", `#fff`);
2183
- internal.attr(path, "class", "svelte-11takew");
2371
+ internal.attr(path, "class", "svelte-19uvvss");
2184
2372
  },
2185
2373
  m(target, anchor) {
2186
2374
  internal.insert(target, path, anchor);
2375
+
2376
+ if (!mounted) {
2377
+ dispose = [
2378
+ internal.listen(path, "mouseenter", /*onMouseEnter*/ ctx[0]),
2379
+ internal.listen(path, "mouseleave", /*onMouseLeave*/ ctx[1])
2380
+ ];
2381
+
2382
+ mounted = true;
2383
+ }
2187
2384
  },
2188
2385
  p: internal.noop,
2189
2386
  i: internal.noop,
2190
2387
  o: internal.noop,
2191
2388
  d(detaching) {
2192
2389
  if (detaching) internal.detach(path);
2390
+ mounted = false;
2391
+ internal.run_all(dispose);
2193
2392
  }
2194
2393
  };
2195
2394
  }
2196
2395
 
2197
2396
  function instance$3($$self, $$props, $$invalidate) {
2198
- let { pxmm } = $$props;
2199
2397
  let { room } = $$props;
2200
2398
  let { floorplanData } = $$props;
2399
+ let { hoveredRoom } = $$props;
2400
+
2401
+ function onMouseEnter() {
2402
+ hoveredRoom.set(room);
2403
+ }
2404
+
2405
+ function onMouseLeave() {
2406
+ hoveredRoom.set(undefined);
2407
+ }
2408
+
2201
2409
  const { bounding } = floorplanData;
2202
2410
 
2203
2411
  const _pathD = pathD(room.path, {
2204
2412
  needZ: true,
2205
- format: vector => formatFloorplanPoint(vector, pxmm, bounding)
2413
+ format: vector => formatFloorplanPoint(vector, bounding)
2206
2414
  });
2207
2415
 
2208
2416
  $$self.$$set = $$props => {
2209
- if ('pxmm' in $$props) $$invalidate(1, pxmm = $$props.pxmm);
2210
- if ('room' in $$props) $$invalidate(2, room = $$props.room);
2211
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
2417
+ if ('room' in $$props) $$invalidate(3, room = $$props.room);
2418
+ if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
2419
+ if ('hoveredRoom' in $$props) $$invalidate(5, hoveredRoom = $$props.hoveredRoom);
2212
2420
  };
2213
2421
 
2214
- return [_pathD, pxmm, room, floorplanData];
2422
+ return [onMouseEnter, onMouseLeave, _pathD, room, floorplanData, hoveredRoom];
2215
2423
  }
2216
2424
 
2217
2425
  class Room extends internal.SvelteComponent {
2218
2426
  constructor(options) {
2219
2427
  super();
2220
- internal.init(this, options, instance$3, create_fragment$3, internal.safe_not_equal, { pxmm: 1, room: 2, floorplanData: 3 }, add_css$3);
2428
+
2429
+ internal.init(
2430
+ this,
2431
+ options,
2432
+ instance$3,
2433
+ create_fragment$3,
2434
+ internal.safe_not_equal,
2435
+ {
2436
+ room: 3,
2437
+ floorplanData: 4,
2438
+ hoveredRoom: 5
2439
+ },
2440
+ add_css$3
2441
+ );
2221
2442
  }
2222
2443
  }
2223
2444
 
2224
2445
  /* src/floorplan/Components/RoomHighlight/RoomHighlight.svelte generated by Svelte v3.47.0 */
2225
2446
 
2226
2447
  function add_css$2(target) {
2227
- internal.append_styles(target, "svelte-1aais5l", ".floorplan-plugin__room-highlight.svelte-1aais5l{position:absolute;width:100%;height:100%;pointer-events:all}svg.svelte-1aais5l{width:100%;height:100%;overflow:visible}");
2448
+ internal.append_styles(target, "svelte-1kqo6e4", ".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}");
2228
2449
  }
2229
2450
 
2230
- function get_each_context(ctx, list, i) {
2451
+ function get_each_context$1(ctx, list, i) {
2231
2452
  const child_ctx = ctx.slice();
2232
- child_ctx[12] = list[i];
2453
+ child_ctx[5] = list[i];
2233
2454
  return child_ctx;
2234
2455
  }
2235
2456
 
2236
- // (41:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
2237
- function create_each_block(key_1, ctx) {
2457
+ // (11:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
2458
+ function create_each_block$1(key_1, ctx) {
2238
2459
  let first;
2239
2460
  let room;
2240
2461
  let current;
2241
2462
 
2242
2463
  const room_spread_levels = [
2243
2464
  {
2244
- room: /*room*/ ctx[12],
2245
- floorplanData: /*floorplanData*/ ctx[2],
2246
- pxmm: /*pxmm*/ ctx[0]
2465
+ room: /*room*/ ctx[5],
2466
+ floorplanData: /*floorplanData*/ ctx[1],
2467
+ hoveredRoom: /*hoveredRoom*/ ctx[2]
2247
2468
  }
2248
2469
  ];
2249
2470
 
@@ -2271,12 +2492,12 @@ function create_each_block(key_1, ctx) {
2271
2492
  p(new_ctx, dirty) {
2272
2493
  ctx = new_ctx;
2273
2494
 
2274
- const room_changes = (dirty & /*floorplanData, floorIndex, pxmm*/ 7)
2495
+ const room_changes = (dirty & /*floorplanData, floorIndex, hoveredRoom*/ 7)
2275
2496
  ? internal.get_spread_update(room_spread_levels, [
2276
2497
  {
2277
- room: /*room*/ ctx[12],
2278
- floorplanData: /*floorplanData*/ ctx[2],
2279
- pxmm: /*pxmm*/ ctx[0]
2498
+ room: /*room*/ ctx[5],
2499
+ floorplanData: /*floorplanData*/ ctx[1],
2500
+ hoveredRoom: /*hoveredRoom*/ ctx[2]
2280
2501
  }
2281
2502
  ])
2282
2503
  : {};
@@ -2304,17 +2525,14 @@ function create_fragment$2(ctx) {
2304
2525
  let svg;
2305
2526
  let each_blocks = [];
2306
2527
  let each_1_lookup = new Map();
2307
- let div_resize_listener;
2308
2528
  let current;
2309
- let mounted;
2310
- let dispose;
2311
- let each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
2312
- const get_key = ctx => /*room*/ ctx[12].id;
2529
+ let each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
2530
+ const get_key = ctx => /*room*/ ctx[5].id;
2313
2531
 
2314
2532
  for (let i = 0; i < each_value.length; i += 1) {
2315
- let child_ctx = get_each_context(ctx, each_value, i);
2533
+ let child_ctx = get_each_context$1(ctx, each_value, i);
2316
2534
  let key = get_key(child_ctx);
2317
- each_1_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
2535
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$1(key, child_ctx));
2318
2536
  }
2319
2537
 
2320
2538
  return {
@@ -2326,9 +2544,11 @@ function create_fragment$2(ctx) {
2326
2544
  each_blocks[i].c();
2327
2545
  }
2328
2546
 
2329
- internal.attr(svg, "class", "svelte-1aais5l");
2330
- internal.attr(div, "class", "floorplan-plugin__room-highlight svelte-1aais5l");
2331
- internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[10].call(div));
2547
+ internal.attr(svg, "width", "100%");
2548
+ internal.attr(svg, "height", "100%");
2549
+ internal.attr(svg, "viewBox", `0 0 ${/*boundingWidth*/ ctx[3]} ${/*boundingHeight*/ ctx[4]}`);
2550
+ internal.attr(svg, "class", "svelte-1kqo6e4");
2551
+ internal.attr(div, "class", "floorplan-plugin__room-highlight svelte-1kqo6e4");
2332
2552
  },
2333
2553
  m(target, anchor) {
2334
2554
  internal.insert(target, div, anchor);
@@ -2338,20 +2558,13 @@ function create_fragment$2(ctx) {
2338
2558
  each_blocks[i].m(svg, null);
2339
2559
  }
2340
2560
 
2341
- /*div_binding*/ ctx[9](div);
2342
- div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[10].bind(div));
2343
2561
  current = true;
2344
-
2345
- if (!mounted) {
2346
- dispose = internal.listen(div, "click", /*handleClick*/ ctx[6]);
2347
- mounted = true;
2348
- }
2349
2562
  },
2350
2563
  p(ctx, [dirty]) {
2351
- if (dirty & /*floorplanData, floorIndex, pxmm*/ 7) {
2352
- each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
2564
+ if (dirty & /*floorplanData, floorIndex, hoveredRoom*/ 7) {
2565
+ each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
2353
2566
  internal.group_outros();
2354
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, svg, internal.outro_and_destroy_block, create_each_block, null, get_each_context);
2567
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, svg, internal.outro_and_destroy_block, create_each_block$1, null, get_each_context$1);
2355
2568
  internal.check_outros();
2356
2569
  }
2357
2570
  },
@@ -2377,83 +2590,24 @@ function create_fragment$2(ctx) {
2377
2590
  for (let i = 0; i < each_blocks.length; i += 1) {
2378
2591
  each_blocks[i].d();
2379
2592
  }
2380
-
2381
- /*div_binding*/ ctx[9](null);
2382
- div_resize_listener();
2383
- mounted = false;
2384
- dispose();
2385
2593
  }
2386
2594
  };
2387
2595
  }
2388
2596
 
2389
2597
  function instance$2($$self, $$props, $$invalidate) {
2390
- let { five } = $$props;
2391
- let { pxmm } = $$props;
2392
2598
  let { floorIndex } = $$props;
2393
2599
  let { floorplanData } = $$props;
2394
- let { onRoomHeightClick } = $$props;
2395
- let clientWidth;
2396
- let clientHeight;
2397
- let highlightContainerDom;
2398
- const { observers: floorplan_observers } = floorplanData;
2399
-
2400
- const handleClick = function (e) {
2401
- if (onRoomHeightClick?.(e) === false) return;
2402
-
2403
- // 因为 mouse.offsetX 的兼容性问题,手动计算 mouse offsetX offsetY
2404
- const boundingClientRect = highlightContainerDom.getBoundingClientRect();
2405
-
2406
- const mouseClientVector = new THREE.Vector2(e.clientX, e.clientY);
2407
- const domTopLeftVector = new THREE.Vector2(boundingClientRect.left, boundingClientRect.top);
2408
- const mouseOffsetVector = mouseClientVector.clone().sub(domTopLeftVector);
2409
-
2410
- // px 转换为 百分比
2411
- const mouseOffsetRelativeVector = new THREE.Vector2(mouseOffsetVector.x / clientWidth, mouseOffsetVector.y / clientHeight);
2412
-
2413
- const closestPoint = floorplan_observers.filter(observer => observer.floorIndex === floorIndex).sort((ob1, ob2) => {
2414
- const position1 = new THREE.Vector2(ob1.positionInImage.x, ob1.positionInImage.y);
2415
- const position2 = new THREE.Vector2(ob2.positionInImage.x, ob2.positionInImage.y);
2416
- return position1.distanceTo(mouseOffsetRelativeVector) - position2.distanceTo(mouseOffsetRelativeVector);
2417
- })[0];
2418
-
2419
- five.moveToPano(closestPoint.index);
2420
- };
2421
-
2422
- function div_binding($$value) {
2423
- internal.binding_callbacks[$$value ? 'unshift' : 'push'](() => {
2424
- highlightContainerDom = $$value;
2425
- $$invalidate(5, highlightContainerDom);
2426
- });
2427
- }
2428
-
2429
- function div_elementresize_handler() {
2430
- clientWidth = this.clientWidth;
2431
- clientHeight = this.clientHeight;
2432
- $$invalidate(3, clientWidth);
2433
- $$invalidate(4, clientHeight);
2434
- }
2600
+ let { hoveredRoom } = $$props;
2601
+ const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
2602
+ const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
2435
2603
 
2436
2604
  $$self.$$set = $$props => {
2437
- if ('five' in $$props) $$invalidate(7, five = $$props.five);
2438
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
2439
- if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
2440
- if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
2441
- if ('onRoomHeightClick' in $$props) $$invalidate(8, onRoomHeightClick = $$props.onRoomHeightClick);
2605
+ if ('floorIndex' in $$props) $$invalidate(0, floorIndex = $$props.floorIndex);
2606
+ if ('floorplanData' in $$props) $$invalidate(1, floorplanData = $$props.floorplanData);
2607
+ if ('hoveredRoom' in $$props) $$invalidate(2, hoveredRoom = $$props.hoveredRoom);
2442
2608
  };
2443
2609
 
2444
- return [
2445
- pxmm,
2446
- floorIndex,
2447
- floorplanData,
2448
- clientWidth,
2449
- clientHeight,
2450
- highlightContainerDom,
2451
- handleClick,
2452
- five,
2453
- onRoomHeightClick,
2454
- div_binding,
2455
- div_elementresize_handler
2456
- ];
2610
+ return [floorIndex, floorplanData, hoveredRoom, boundingWidth, boundingHeight];
2457
2611
  }
2458
2612
 
2459
2613
  class RoomHighlight extends internal.SvelteComponent {
@@ -2467,35 +2621,31 @@ class RoomHighlight extends internal.SvelteComponent {
2467
2621
  create_fragment$2,
2468
2622
  internal.safe_not_equal,
2469
2623
  {
2470
- five: 7,
2471
- pxmm: 0,
2472
- floorIndex: 1,
2473
- floorplanData: 2,
2474
- onRoomHeightClick: 8
2624
+ floorIndex: 0,
2625
+ floorplanData: 1,
2626
+ hoveredRoom: 2
2475
2627
  },
2476
2628
  add_css$2
2477
2629
  );
2478
2630
  }
2479
2631
  }
2480
2632
 
2481
- /* src/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte generated by Svelte v3.47.0 */
2633
+ /* src/floorplan/Components/CurrentFloor.svelte generated by Svelte v3.47.0 */
2482
2634
 
2483
2635
  function add_css$1(target) {
2484
- internal.append_styles(target, "svelte-3pdgs4", ".floorplan-current-floor.svelte-3pdgs4{position:relative;width:100%;height:100%}");
2636
+ internal.append_styles(target, "svelte-bl8zrz", ".floorplan-plugin__floor.svelte-bl8zrz{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;pointer-events:none}.floorplan-plugin__floor--is-current.svelte-bl8zrz{opacity:1;pointer-events:auto}");
2485
2637
  }
2486
2638
 
2487
- // (19:2) {#if hoverEnable}
2639
+ // (20:2) {#if hoverEnable}
2488
2640
  function create_if_block_2(ctx) {
2489
2641
  let roomhighlight;
2490
2642
  let current;
2491
2643
 
2492
2644
  const roomhighlight_spread_levels = [
2493
2645
  {
2494
- five: /*five*/ ctx[1],
2495
- pxmm: /*pxmm*/ ctx[0],
2496
- floorIndex: /*floorIndex*/ ctx[2],
2497
- floorplanData: /*floorplanData*/ ctx[6],
2498
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[7]
2646
+ floorIndex: /*floorIndex*/ ctx[1],
2647
+ floorplanData: /*floorplanData*/ ctx[5],
2648
+ hoveredRoom: /*hoveredRoom*/ ctx[8]
2499
2649
  }
2500
2650
  ];
2501
2651
 
@@ -2516,14 +2666,12 @@ function create_if_block_2(ctx) {
2516
2666
  current = true;
2517
2667
  },
2518
2668
  p(ctx, dirty) {
2519
- const roomhighlight_changes = (dirty & /*five, pxmm, floorIndex, floorplanData, onRoomHeightClick*/ 199)
2669
+ const roomhighlight_changes = (dirty & /*floorIndex, floorplanData, hoveredRoom*/ 290)
2520
2670
  ? internal.get_spread_update(roomhighlight_spread_levels, [
2521
2671
  {
2522
- five: /*five*/ ctx[1],
2523
- pxmm: /*pxmm*/ ctx[0],
2524
- floorIndex: /*floorIndex*/ ctx[2],
2525
- floorplanData: /*floorplanData*/ ctx[6],
2526
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[7]
2672
+ floorIndex: /*floorIndex*/ ctx[1],
2673
+ floorplanData: /*floorplanData*/ ctx[5],
2674
+ hoveredRoom: /*hoveredRoom*/ ctx[8]
2527
2675
  }
2528
2676
  ])
2529
2677
  : {};
@@ -2545,16 +2693,18 @@ function create_if_block_2(ctx) {
2545
2693
  };
2546
2694
  }
2547
2695
 
2548
- // (23:2) {#if roomLabelsEnable}
2696
+ // (24:2) {#if roomLabelsEnable}
2549
2697
  function create_if_block_1$1(ctx) {
2550
2698
  let roomlabels;
2551
2699
  let current;
2552
2700
 
2553
2701
  const roomlabels_spread_levels = [
2554
2702
  {
2555
- floorplanData: /*floorplanData*/ ctx[6],
2556
- floorIndex: /*floorIndex*/ ctx[2],
2557
- getLabelElement: /*getLabelElement*/ ctx[8]
2703
+ floorplanData: /*floorplanData*/ ctx[5],
2704
+ floorIndex: /*floorIndex*/ ctx[1],
2705
+ getLabelElement: /*getLabelElement*/ ctx[6],
2706
+ hoveredRoom: /*hoveredRoom*/ ctx[8],
2707
+ adaptiveRoomLabelVisibleEnable: /*adaptiveRoomLabelVisibleEnable*/ ctx[7]
2558
2708
  }
2559
2709
  ];
2560
2710
 
@@ -2575,12 +2725,14 @@ function create_if_block_1$1(ctx) {
2575
2725
  current = true;
2576
2726
  },
2577
2727
  p(ctx, dirty) {
2578
- const roomlabels_changes = (dirty & /*floorplanData, floorIndex, getLabelElement*/ 324)
2728
+ const roomlabels_changes = (dirty & /*floorplanData, floorIndex, getLabelElement, hoveredRoom, adaptiveRoomLabelVisibleEnable*/ 482)
2579
2729
  ? internal.get_spread_update(roomlabels_spread_levels, [
2580
2730
  {
2581
- floorplanData: /*floorplanData*/ ctx[6],
2582
- floorIndex: /*floorIndex*/ ctx[2],
2583
- getLabelElement: /*getLabelElement*/ ctx[8]
2731
+ floorplanData: /*floorplanData*/ ctx[5],
2732
+ floorIndex: /*floorIndex*/ ctx[1],
2733
+ getLabelElement: /*getLabelElement*/ ctx[6],
2734
+ hoveredRoom: /*hoveredRoom*/ ctx[8],
2735
+ adaptiveRoomLabelVisibleEnable: /*adaptiveRoomLabelVisibleEnable*/ ctx[7]
2584
2736
  }
2585
2737
  ])
2586
2738
  : {};
@@ -2602,16 +2754,15 @@ function create_if_block_1$1(ctx) {
2602
2754
  };
2603
2755
  }
2604
2756
 
2605
- // (26:2) {#if ruleLabelsEnable}
2757
+ // (27:2) {#if ruleLabelsEnable}
2606
2758
  function create_if_block$1(ctx) {
2607
2759
  let rulelabels;
2608
2760
  let current;
2609
2761
 
2610
2762
  const rulelabels_spread_levels = [
2611
2763
  {
2612
- floorplanData: /*floorplanData*/ ctx[6],
2613
- floorIndex: /*floorIndex*/ ctx[2],
2614
- pxmm: /*pxmm*/ ctx[0]
2764
+ floorplanData: /*floorplanData*/ ctx[5],
2765
+ floorIndex: /*floorIndex*/ ctx[1]
2615
2766
  }
2616
2767
  ];
2617
2768
 
@@ -2632,12 +2783,11 @@ function create_if_block$1(ctx) {
2632
2783
  current = true;
2633
2784
  },
2634
2785
  p(ctx, dirty) {
2635
- const rulelabels_changes = (dirty & /*floorplanData, floorIndex, pxmm*/ 69)
2786
+ const rulelabels_changes = (dirty & /*floorplanData, floorIndex*/ 34)
2636
2787
  ? internal.get_spread_update(rulelabels_spread_levels, [
2637
2788
  {
2638
- floorplanData: /*floorplanData*/ ctx[6],
2639
- floorIndex: /*floorIndex*/ ctx[2],
2640
- pxmm: /*pxmm*/ ctx[0]
2789
+ floorplanData: /*floorplanData*/ ctx[5],
2790
+ floorIndex: /*floorIndex*/ ctx[1]
2641
2791
  }
2642
2792
  ])
2643
2793
  : {};
@@ -2667,13 +2817,13 @@ function create_fragment$1(ctx) {
2667
2817
  let baseimage;
2668
2818
  let t2;
2669
2819
  let t3;
2820
+ let div_class_value;
2670
2821
  let current;
2671
2822
 
2672
2823
  const roommaterial_spread_levels = [
2673
2824
  {
2674
- floorIndex: /*floorIndex*/ ctx[2],
2675
- floorplanData: /*floorplanData*/ ctx[6],
2676
- pxmm: /*pxmm*/ ctx[0]
2825
+ floorIndex: /*floorIndex*/ ctx[1],
2826
+ floorplanData: /*floorplanData*/ ctx[5]
2677
2827
  }
2678
2828
  ];
2679
2829
 
@@ -2684,12 +2834,12 @@ function create_fragment$1(ctx) {
2684
2834
  }
2685
2835
 
2686
2836
  roommaterial = new RoomMaterial({ props: roommaterial_props });
2687
- let if_block0 = /*hoverEnable*/ ctx[3] && create_if_block_2(ctx);
2837
+ let if_block0 = /*hoverEnable*/ ctx[2] && create_if_block_2(ctx);
2688
2838
 
2689
2839
  const baseimage_spread_levels = [
2690
2840
  {
2691
- floorplanData: /*floorplanData*/ ctx[6],
2692
- floorIndex: /*floorIndex*/ ctx[2]
2841
+ floorplanData: /*floorplanData*/ ctx[5],
2842
+ floorIndex: /*floorIndex*/ ctx[1]
2693
2843
  }
2694
2844
  ];
2695
2845
 
@@ -2700,8 +2850,8 @@ function create_fragment$1(ctx) {
2700
2850
  }
2701
2851
 
2702
2852
  baseimage = new BaseImage({ props: baseimage_props });
2703
- let if_block1 = /*roomLabelsEnable*/ ctx[4] && create_if_block_1$1(ctx);
2704
- let if_block2 = /*ruleLabelsEnable*/ ctx[5] && create_if_block$1(ctx);
2853
+ let if_block1 = /*roomLabelsEnable*/ ctx[3] && create_if_block_1$1(ctx);
2854
+ let if_block2 = /*ruleLabelsEnable*/ ctx[4] && create_if_block$1(ctx);
2705
2855
 
2706
2856
  return {
2707
2857
  c() {
@@ -2715,7 +2865,10 @@ function create_fragment$1(ctx) {
2715
2865
  if (if_block1) if_block1.c();
2716
2866
  t3 = internal.space();
2717
2867
  if (if_block2) if_block2.c();
2718
- internal.attr(div, "class", "floorplan-current-floor svelte-3pdgs4");
2868
+
2869
+ internal.attr(div, "class", div_class_value = "" + (internal.null_to_empty(`floorplan-plugin__floor${/*isCurrent*/ ctx[0]
2870
+ ? ' floorplan-plugin__floor--is-current'
2871
+ : ''}`) + " svelte-bl8zrz"));
2719
2872
  },
2720
2873
  m(target, anchor) {
2721
2874
  internal.insert(target, div, anchor);
@@ -2731,23 +2884,22 @@ function create_fragment$1(ctx) {
2731
2884
  current = true;
2732
2885
  },
2733
2886
  p(ctx, [dirty]) {
2734
- const roommaterial_changes = (dirty & /*floorIndex, floorplanData, pxmm*/ 69)
2887
+ const roommaterial_changes = (dirty & /*floorIndex, floorplanData*/ 34)
2735
2888
  ? internal.get_spread_update(roommaterial_spread_levels, [
2736
2889
  {
2737
- floorIndex: /*floorIndex*/ ctx[2],
2738
- floorplanData: /*floorplanData*/ ctx[6],
2739
- pxmm: /*pxmm*/ ctx[0]
2890
+ floorIndex: /*floorIndex*/ ctx[1],
2891
+ floorplanData: /*floorplanData*/ ctx[5]
2740
2892
  }
2741
2893
  ])
2742
2894
  : {};
2743
2895
 
2744
2896
  roommaterial.$set(roommaterial_changes);
2745
2897
 
2746
- if (/*hoverEnable*/ ctx[3]) {
2898
+ if (/*hoverEnable*/ ctx[2]) {
2747
2899
  if (if_block0) {
2748
2900
  if_block0.p(ctx, dirty);
2749
2901
 
2750
- if (dirty & /*hoverEnable*/ 8) {
2902
+ if (dirty & /*hoverEnable*/ 4) {
2751
2903
  internal.transition_in(if_block0, 1);
2752
2904
  }
2753
2905
  } else {
@@ -2766,22 +2918,22 @@ function create_fragment$1(ctx) {
2766
2918
  internal.check_outros();
2767
2919
  }
2768
2920
 
2769
- const baseimage_changes = (dirty & /*floorplanData, floorIndex*/ 68)
2921
+ const baseimage_changes = (dirty & /*floorplanData, floorIndex*/ 34)
2770
2922
  ? internal.get_spread_update(baseimage_spread_levels, [
2771
2923
  {
2772
- floorplanData: /*floorplanData*/ ctx[6],
2773
- floorIndex: /*floorIndex*/ ctx[2]
2924
+ floorplanData: /*floorplanData*/ ctx[5],
2925
+ floorIndex: /*floorIndex*/ ctx[1]
2774
2926
  }
2775
2927
  ])
2776
2928
  : {};
2777
2929
 
2778
2930
  baseimage.$set(baseimage_changes);
2779
2931
 
2780
- if (/*roomLabelsEnable*/ ctx[4]) {
2932
+ if (/*roomLabelsEnable*/ ctx[3]) {
2781
2933
  if (if_block1) {
2782
2934
  if_block1.p(ctx, dirty);
2783
2935
 
2784
- if (dirty & /*roomLabelsEnable*/ 16) {
2936
+ if (dirty & /*roomLabelsEnable*/ 8) {
2785
2937
  internal.transition_in(if_block1, 1);
2786
2938
  }
2787
2939
  } else {
@@ -2800,11 +2952,11 @@ function create_fragment$1(ctx) {
2800
2952
  internal.check_outros();
2801
2953
  }
2802
2954
 
2803
- if (/*ruleLabelsEnable*/ ctx[5]) {
2955
+ if (/*ruleLabelsEnable*/ ctx[4]) {
2804
2956
  if (if_block2) {
2805
2957
  if_block2.p(ctx, dirty);
2806
2958
 
2807
- if (dirty & /*ruleLabelsEnable*/ 32) {
2959
+ if (dirty & /*ruleLabelsEnable*/ 16) {
2808
2960
  internal.transition_in(if_block2, 1);
2809
2961
  }
2810
2962
  } else {
@@ -2822,6 +2974,12 @@ function create_fragment$1(ctx) {
2822
2974
 
2823
2975
  internal.check_outros();
2824
2976
  }
2977
+
2978
+ if (!current || dirty & /*isCurrent*/ 1 && div_class_value !== (div_class_value = "" + (internal.null_to_empty(`floorplan-plugin__floor${/*isCurrent*/ ctx[0]
2979
+ ? ' floorplan-plugin__floor--is-current'
2980
+ : ''}`) + " svelte-bl8zrz"))) {
2981
+ internal.attr(div, "class", div_class_value);
2982
+ }
2825
2983
  },
2826
2984
  i(local) {
2827
2985
  if (current) return;
@@ -2852,38 +3010,37 @@ function create_fragment$1(ctx) {
2852
3010
  }
2853
3011
 
2854
3012
  function instance$1($$self, $$props, $$invalidate) {
2855
- let { pxmm } = $$props;
2856
- let { five } = $$props;
3013
+ let { isCurrent } = $$props;
2857
3014
  let { floorIndex } = $$props;
2858
3015
  let { hoverEnable } = $$props;
2859
3016
  let { roomLabelsEnable } = $$props;
2860
3017
  let { ruleLabelsEnable } = $$props;
2861
3018
  let { floorplanData } = $$props;
2862
- let { onRoomHeightClick } = $$props;
2863
3019
  let { getLabelElement } = $$props;
3020
+ let { adaptiveRoomLabelVisibleEnable } = $$props;
3021
+ const hoveredRoom = store.writable(undefined);
2864
3022
 
2865
3023
  $$self.$$set = $$props => {
2866
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
2867
- if ('five' in $$props) $$invalidate(1, five = $$props.five);
2868
- if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
2869
- if ('hoverEnable' in $$props) $$invalidate(3, hoverEnable = $$props.hoverEnable);
2870
- if ('roomLabelsEnable' in $$props) $$invalidate(4, roomLabelsEnable = $$props.roomLabelsEnable);
2871
- if ('ruleLabelsEnable' in $$props) $$invalidate(5, ruleLabelsEnable = $$props.ruleLabelsEnable);
2872
- if ('floorplanData' in $$props) $$invalidate(6, floorplanData = $$props.floorplanData);
2873
- if ('onRoomHeightClick' in $$props) $$invalidate(7, onRoomHeightClick = $$props.onRoomHeightClick);
2874
- if ('getLabelElement' in $$props) $$invalidate(8, getLabelElement = $$props.getLabelElement);
3024
+ if ('isCurrent' in $$props) $$invalidate(0, isCurrent = $$props.isCurrent);
3025
+ if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
3026
+ if ('hoverEnable' in $$props) $$invalidate(2, hoverEnable = $$props.hoverEnable);
3027
+ if ('roomLabelsEnable' in $$props) $$invalidate(3, roomLabelsEnable = $$props.roomLabelsEnable);
3028
+ if ('ruleLabelsEnable' in $$props) $$invalidate(4, ruleLabelsEnable = $$props.ruleLabelsEnable);
3029
+ if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
3030
+ if ('getLabelElement' in $$props) $$invalidate(6, getLabelElement = $$props.getLabelElement);
3031
+ if ('adaptiveRoomLabelVisibleEnable' in $$props) $$invalidate(7, adaptiveRoomLabelVisibleEnable = $$props.adaptiveRoomLabelVisibleEnable);
2875
3032
  };
2876
3033
 
2877
3034
  return [
2878
- pxmm,
2879
- five,
3035
+ isCurrent,
2880
3036
  floorIndex,
2881
3037
  hoverEnable,
2882
3038
  roomLabelsEnable,
2883
3039
  ruleLabelsEnable,
2884
3040
  floorplanData,
2885
- onRoomHeightClick,
2886
- getLabelElement
3041
+ getLabelElement,
3042
+ adaptiveRoomLabelVisibleEnable,
3043
+ hoveredRoom
2887
3044
  ];
2888
3045
  }
2889
3046
 
@@ -2898,65 +3055,57 @@ class CurrentFloor extends internal.SvelteComponent {
2898
3055
  create_fragment$1,
2899
3056
  internal.safe_not_equal,
2900
3057
  {
2901
- pxmm: 0,
2902
- five: 1,
2903
- floorIndex: 2,
2904
- hoverEnable: 3,
2905
- roomLabelsEnable: 4,
2906
- ruleLabelsEnable: 5,
2907
- floorplanData: 6,
2908
- onRoomHeightClick: 7,
2909
- getLabelElement: 8
3058
+ isCurrent: 0,
3059
+ floorIndex: 1,
3060
+ hoverEnable: 2,
3061
+ roomLabelsEnable: 3,
3062
+ ruleLabelsEnable: 4,
3063
+ floorplanData: 5,
3064
+ getLabelElement: 6,
3065
+ adaptiveRoomLabelVisibleEnable: 7
2910
3066
  },
2911
3067
  add_css$1
2912
3068
  );
2913
3069
  }
2914
3070
  }
2915
3071
 
2916
- /* src/floorplan/ModelFloorplanPlugin/Components/Main.svelte generated by Svelte v3.47.0 */
3072
+ /* src/floorplan/Components/Main.svelte generated by Svelte v3.47.0 */
2917
3073
 
2918
3074
  function add_css(target) {
2919
- internal.append_styles(target, "svelte-177x2q7", ".floorplan-main.svelte-177x2q7{width:100%;height:100%}");
3075
+ internal.append_styles(target, "svelte-86bqav", ".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}");
3076
+ }
3077
+
3078
+ function get_each_context(ctx, list, i) {
3079
+ const child_ctx = ctx.slice();
3080
+ child_ctx[14] = list[i];
3081
+ return child_ctx;
2920
3082
  }
2921
3083
 
2922
- // (23:0) {#if visible}
3084
+ // (22:0) {#if visible}
2923
3085
  function create_if_block(ctx) {
2924
3086
  let div;
2925
- let currentfloor;
2926
3087
  let t0;
2927
3088
  let camera;
2928
3089
  let t1;
2929
3090
  let div_intro;
2930
3091
  let current;
3092
+ let each_value = /*floorplanData*/ ctx[9].floorDatas;
3093
+ let each_blocks = [];
2931
3094
 
2932
- const currentfloor_spread_levels = [
2933
- {
2934
- five: /*five*/ ctx[1],
2935
- pxmm: /*pxmm*/ ctx[0],
2936
- floorIndex: /*floorIndex*/ ctx[5],
2937
- hoverEnable: /*hoverEnable*/ ctx[6],
2938
- floorplanData: /*floorplanData*/ ctx[10],
2939
- getLabelElement: /*getLabelElement*/ ctx[14],
2940
- roomLabelsEnable: /*roomLabelsEnable*/ ctx[8],
2941
- ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[9],
2942
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[13]
2943
- }
2944
- ];
2945
-
2946
- let currentfloor_props = {};
2947
-
2948
- for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
2949
- currentfloor_props = internal.assign(currentfloor_props, currentfloor_spread_levels[i]);
3095
+ for (let i = 0; i < each_value.length; i += 1) {
3096
+ each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
2950
3097
  }
2951
3098
 
2952
- currentfloor = new CurrentFloor({ props: currentfloor_props });
3099
+ const out = i => internal.transition_out(each_blocks[i], 1, 1, () => {
3100
+ each_blocks[i] = null;
3101
+ });
2953
3102
 
2954
3103
  const camera_spread_levels = [
2955
3104
  {
2956
- panoIndex: /*panoIndex*/ ctx[4],
2957
- floorplanData: /*floorplanData*/ ctx[10],
2958
- lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[11],
2959
- cameraImageUrl: /*cameraImageUrl*/ ctx[12]
3105
+ panoIndex: /*panoIndex*/ ctx[3],
3106
+ floorplanData: /*floorplanData*/ ctx[9],
3107
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[10],
3108
+ cameraImageUrl: /*cameraImageUrl*/ ctx[11]
2960
3109
  }
2961
3110
  ];
2962
3111
 
@@ -2967,21 +3116,29 @@ function create_if_block(ctx) {
2967
3116
  }
2968
3117
 
2969
3118
  camera = new Camera({ props: camera_props });
2970
- let if_block = /*compassEnable*/ ctx[7] && create_if_block_1(ctx);
3119
+ let if_block = /*compassEnable*/ ctx[6] && create_if_block_1(ctx);
2971
3120
 
2972
3121
  return {
2973
3122
  c() {
2974
3123
  div = internal.element("div");
2975
- internal.create_component(currentfloor.$$.fragment);
3124
+
3125
+ for (let i = 0; i < each_blocks.length; i += 1) {
3126
+ each_blocks[i].c();
3127
+ }
3128
+
2976
3129
  t0 = internal.space();
2977
3130
  internal.create_component(camera.$$.fragment);
2978
3131
  t1 = internal.space();
2979
3132
  if (if_block) if_block.c();
2980
- internal.attr(div, "class", "floorplan-main svelte-177x2q7");
3133
+ internal.attr(div, "class", "floorplan-main svelte-86bqav");
2981
3134
  },
2982
3135
  m(target, anchor) {
2983
3136
  internal.insert(target, div, anchor);
2984
- internal.mount_component(currentfloor, div, null);
3137
+
3138
+ for (let i = 0; i < each_blocks.length; i += 1) {
3139
+ each_blocks[i].m(div, null);
3140
+ }
3141
+
2985
3142
  internal.append(div, t0);
2986
3143
  internal.mount_component(camera, div, null);
2987
3144
  internal.append(div, t1);
@@ -2991,42 +3148,51 @@ function create_if_block(ctx) {
2991
3148
  p(new_ctx, dirty) {
2992
3149
  ctx = new_ctx;
2993
3150
 
2994
- const currentfloor_changes = (dirty & /*five, pxmm, floorIndex, hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, onRoomHeightClick*/ 26467)
2995
- ? internal.get_spread_update(currentfloor_spread_levels, [
2996
- {
2997
- five: /*five*/ ctx[1],
2998
- pxmm: /*pxmm*/ ctx[0],
2999
- floorIndex: /*floorIndex*/ ctx[5],
3000
- hoverEnable: /*hoverEnable*/ ctx[6],
3001
- floorplanData: /*floorplanData*/ ctx[10],
3002
- getLabelElement: /*getLabelElement*/ ctx[14],
3003
- roomLabelsEnable: /*roomLabelsEnable*/ ctx[8],
3004
- ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[9],
3005
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[13]
3151
+ if (dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, adaptiveRoomLabelVisibleEnable, floorIndex*/ 13232) {
3152
+ each_value = /*floorplanData*/ ctx[9].floorDatas;
3153
+ let i;
3154
+
3155
+ for (i = 0; i < each_value.length; i += 1) {
3156
+ const child_ctx = get_each_context(ctx, each_value, i);
3157
+
3158
+ if (each_blocks[i]) {
3159
+ each_blocks[i].p(child_ctx, dirty);
3160
+ internal.transition_in(each_blocks[i], 1);
3161
+ } else {
3162
+ each_blocks[i] = create_each_block(child_ctx);
3163
+ each_blocks[i].c();
3164
+ internal.transition_in(each_blocks[i], 1);
3165
+ each_blocks[i].m(div, t0);
3006
3166
  }
3007
- ])
3008
- : {};
3167
+ }
3009
3168
 
3010
- currentfloor.$set(currentfloor_changes);
3169
+ internal.group_outros();
3170
+
3171
+ for (i = each_value.length; i < each_blocks.length; i += 1) {
3172
+ out(i);
3173
+ }
3174
+
3175
+ internal.check_outros();
3176
+ }
3011
3177
 
3012
- const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 7184)
3178
+ const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 3592)
3013
3179
  ? internal.get_spread_update(camera_spread_levels, [
3014
3180
  {
3015
- panoIndex: /*panoIndex*/ ctx[4],
3016
- floorplanData: /*floorplanData*/ ctx[10],
3017
- lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[11],
3018
- cameraImageUrl: /*cameraImageUrl*/ ctx[12]
3181
+ panoIndex: /*panoIndex*/ ctx[3],
3182
+ floorplanData: /*floorplanData*/ ctx[9],
3183
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[10],
3184
+ cameraImageUrl: /*cameraImageUrl*/ ctx[11]
3019
3185
  }
3020
3186
  ])
3021
3187
  : {};
3022
3188
 
3023
3189
  camera.$set(camera_changes);
3024
3190
 
3025
- if (/*compassEnable*/ ctx[7]) {
3191
+ if (/*compassEnable*/ ctx[6]) {
3026
3192
  if (if_block) {
3027
3193
  if_block.p(ctx, dirty);
3028
3194
 
3029
- if (dirty & /*compassEnable*/ 128) {
3195
+ if (dirty & /*compassEnable*/ 64) {
3030
3196
  internal.transition_in(if_block, 1);
3031
3197
  }
3032
3198
  } else {
@@ -3045,36 +3211,120 @@ function create_if_block(ctx) {
3045
3211
  internal.check_outros();
3046
3212
  }
3047
3213
  },
3214
+ i(local) {
3215
+ if (current) return;
3216
+
3217
+ for (let i = 0; i < each_value.length; i += 1) {
3218
+ internal.transition_in(each_blocks[i]);
3219
+ }
3220
+
3221
+ internal.transition_in(camera.$$.fragment, local);
3222
+ internal.transition_in(if_block);
3223
+
3224
+ if (!div_intro) {
3225
+ internal.add_render_callback(() => {
3226
+ div_intro = internal.create_in_transition(div, transition.fade, {
3227
+ duration: /*duration*/ ctx[0],
3228
+ easing: easing.linear
3229
+ });
3230
+
3231
+ div_intro.start();
3232
+ });
3233
+ }
3234
+
3235
+ current = true;
3236
+ },
3237
+ o(local) {
3238
+ each_blocks = each_blocks.filter(Boolean);
3239
+
3240
+ for (let i = 0; i < each_blocks.length; i += 1) {
3241
+ internal.transition_out(each_blocks[i]);
3242
+ }
3243
+
3244
+ internal.transition_out(camera.$$.fragment, local);
3245
+ internal.transition_out(if_block);
3246
+ current = false;
3247
+ },
3248
+ d(detaching) {
3249
+ if (detaching) internal.detach(div);
3250
+ internal.destroy_each(each_blocks, detaching);
3251
+ internal.destroy_component(camera);
3252
+ if (if_block) if_block.d();
3253
+ }
3254
+ };
3255
+ }
3256
+
3257
+ // (24:4) {#each floorplanData.floorDatas as floorData}
3258
+ function create_each_block(ctx) {
3259
+ let currentfloor;
3260
+ let current;
3261
+
3262
+ const currentfloor_spread_levels = [
3263
+ {
3264
+ hoverEnable: /*hoverEnable*/ ctx[5],
3265
+ floorplanData: /*floorplanData*/ ctx[9],
3266
+ getLabelElement: /*getLabelElement*/ ctx[12],
3267
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[7],
3268
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[8],
3269
+ adaptiveRoomLabelVisibleEnable: /*adaptiveRoomLabelVisibleEnable*/ ctx[13]
3270
+ },
3271
+ {
3272
+ floorIndex: /*floorData*/ ctx[14].floorIndex
3273
+ },
3274
+ {
3275
+ isCurrent: /*floorData*/ ctx[14].floorIndex === /*floorIndex*/ ctx[4]
3276
+ }
3277
+ ];
3278
+
3279
+ let currentfloor_props = {};
3280
+
3281
+ for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
3282
+ currentfloor_props = internal.assign(currentfloor_props, currentfloor_spread_levels[i]);
3283
+ }
3284
+
3285
+ currentfloor = new CurrentFloor({ props: currentfloor_props });
3286
+
3287
+ return {
3288
+ c() {
3289
+ internal.create_component(currentfloor.$$.fragment);
3290
+ },
3291
+ m(target, anchor) {
3292
+ internal.mount_component(currentfloor, target, anchor);
3293
+ current = true;
3294
+ },
3295
+ p(ctx, dirty) {
3296
+ const currentfloor_changes = (dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, adaptiveRoomLabelVisibleEnable, floorIndex*/ 13232)
3297
+ ? internal.get_spread_update(currentfloor_spread_levels, [
3298
+ dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, adaptiveRoomLabelVisibleEnable*/ 13216 && {
3299
+ hoverEnable: /*hoverEnable*/ ctx[5],
3300
+ floorplanData: /*floorplanData*/ ctx[9],
3301
+ getLabelElement: /*getLabelElement*/ ctx[12],
3302
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[7],
3303
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[8],
3304
+ adaptiveRoomLabelVisibleEnable: /*adaptiveRoomLabelVisibleEnable*/ ctx[13]
3305
+ },
3306
+ dirty & /*floorplanData*/ 512 && {
3307
+ floorIndex: /*floorData*/ ctx[14].floorIndex
3308
+ },
3309
+ dirty & /*floorplanData, floorIndex*/ 528 && {
3310
+ isCurrent: /*floorData*/ ctx[14].floorIndex === /*floorIndex*/ ctx[4]
3311
+ }
3312
+ ])
3313
+ : {};
3314
+
3315
+ currentfloor.$set(currentfloor_changes);
3316
+ },
3048
3317
  i(local) {
3049
3318
  if (current) return;
3050
3319
  internal.transition_in(currentfloor.$$.fragment, local);
3051
- internal.transition_in(camera.$$.fragment, local);
3052
- internal.transition_in(if_block);
3053
-
3054
- if (!div_intro) {
3055
- internal.add_render_callback(() => {
3056
- div_intro = internal.create_in_transition(div, transition.fade, {
3057
- duration: /*duration*/ ctx[2],
3058
- easing: easing.linear
3059
- });
3060
-
3061
- div_intro.start();
3062
- });
3063
- }
3064
-
3065
3320
  current = true;
3066
3321
  },
3067
3322
  o(local) {
3068
3323
  internal.transition_out(currentfloor.$$.fragment, local);
3069
- internal.transition_out(camera.$$.fragment, local);
3070
- internal.transition_out(if_block);
3071
3324
  current = false;
3072
3325
  },
3073
3326
  d(detaching) {
3074
- if (detaching) internal.detach(div);
3075
- internal.destroy_component(currentfloor);
3076
- internal.destroy_component(camera);
3077
- if (if_block) if_block.d();
3327
+ internal.destroy_component(currentfloor, detaching);
3078
3328
  }
3079
3329
  };
3080
3330
  }
@@ -3085,7 +3335,10 @@ function create_if_block_1(ctx) {
3085
3335
  let current;
3086
3336
 
3087
3337
  compass = new Compass({
3088
- props: { floorplanData: /*floorplanData*/ ctx[10] }
3338
+ props: {
3339
+ floorplanData: /*floorplanData*/ ctx[9],
3340
+ northDesc: /*northDesc*/ ctx[2]
3341
+ }
3089
3342
  });
3090
3343
 
3091
3344
  return {
@@ -3098,7 +3351,8 @@ function create_if_block_1(ctx) {
3098
3351
  },
3099
3352
  p(ctx, dirty) {
3100
3353
  const compass_changes = {};
3101
- if (dirty & /*floorplanData*/ 1024) compass_changes.floorplanData = /*floorplanData*/ ctx[10];
3354
+ if (dirty & /*floorplanData*/ 512) compass_changes.floorplanData = /*floorplanData*/ ctx[9];
3355
+ if (dirty & /*northDesc*/ 4) compass_changes.northDesc = /*northDesc*/ ctx[2];
3102
3356
  compass.$set(compass_changes);
3103
3357
  },
3104
3358
  i(local) {
@@ -3119,7 +3373,7 @@ function create_if_block_1(ctx) {
3119
3373
  function create_fragment(ctx) {
3120
3374
  let if_block_anchor;
3121
3375
  let current;
3122
- let if_block = /*visible*/ ctx[3] && create_if_block(ctx);
3376
+ let if_block = /*visible*/ ctx[1] && create_if_block(ctx);
3123
3377
 
3124
3378
  return {
3125
3379
  c() {
@@ -3132,11 +3386,11 @@ function create_fragment(ctx) {
3132
3386
  current = true;
3133
3387
  },
3134
3388
  p(ctx, [dirty]) {
3135
- if (/*visible*/ ctx[3]) {
3389
+ if (/*visible*/ ctx[1]) {
3136
3390
  if (if_block) {
3137
3391
  if_block.p(ctx, dirty);
3138
3392
 
3139
- if (dirty & /*visible*/ 8) {
3393
+ if (dirty & /*visible*/ 2) {
3140
3394
  internal.transition_in(if_block, 1);
3141
3395
  }
3142
3396
  } else {
@@ -3172,10 +3426,9 @@ function create_fragment(ctx) {
3172
3426
  }
3173
3427
 
3174
3428
  function instance($$self, $$props, $$invalidate) {
3175
- let { pxmm } = $$props;
3176
- let { five } = $$props;
3177
3429
  let { duration = 0 } = $$props;
3178
3430
  let { visible } = $$props;
3431
+ let { northDesc } = $$props;
3179
3432
  let { panoIndex } = $$props;
3180
3433
  let { floorIndex } = $$props;
3181
3434
  let { hoverEnable } = $$props;
@@ -3185,32 +3438,30 @@ function instance($$self, $$props, $$invalidate) {
3185
3438
  let { floorplanData } = $$props;
3186
3439
  let { lastPanoramaLongitude } = $$props;
3187
3440
  let { cameraImageUrl } = $$props;
3188
- let { onRoomHeightClick } = $$props;
3189
3441
  let { getLabelElement } = $$props;
3442
+ let { adaptiveRoomLabelVisibleEnable } = $$props;
3190
3443
 
3191
3444
  $$self.$$set = $$props => {
3192
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
3193
- if ('five' in $$props) $$invalidate(1, five = $$props.five);
3194
- if ('duration' in $$props) $$invalidate(2, duration = $$props.duration);
3195
- if ('visible' in $$props) $$invalidate(3, visible = $$props.visible);
3196
- if ('panoIndex' in $$props) $$invalidate(4, panoIndex = $$props.panoIndex);
3197
- if ('floorIndex' in $$props) $$invalidate(5, floorIndex = $$props.floorIndex);
3198
- if ('hoverEnable' in $$props) $$invalidate(6, hoverEnable = $$props.hoverEnable);
3199
- if ('compassEnable' in $$props) $$invalidate(7, compassEnable = $$props.compassEnable);
3200
- if ('roomLabelsEnable' in $$props) $$invalidate(8, roomLabelsEnable = $$props.roomLabelsEnable);
3201
- if ('ruleLabelsEnable' in $$props) $$invalidate(9, ruleLabelsEnable = $$props.ruleLabelsEnable);
3202
- if ('floorplanData' in $$props) $$invalidate(10, floorplanData = $$props.floorplanData);
3203
- if ('lastPanoramaLongitude' in $$props) $$invalidate(11, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
3204
- if ('cameraImageUrl' in $$props) $$invalidate(12, cameraImageUrl = $$props.cameraImageUrl);
3205
- if ('onRoomHeightClick' in $$props) $$invalidate(13, onRoomHeightClick = $$props.onRoomHeightClick);
3206
- if ('getLabelElement' in $$props) $$invalidate(14, getLabelElement = $$props.getLabelElement);
3445
+ if ('duration' in $$props) $$invalidate(0, duration = $$props.duration);
3446
+ if ('visible' in $$props) $$invalidate(1, visible = $$props.visible);
3447
+ if ('northDesc' in $$props) $$invalidate(2, northDesc = $$props.northDesc);
3448
+ if ('panoIndex' in $$props) $$invalidate(3, panoIndex = $$props.panoIndex);
3449
+ if ('floorIndex' in $$props) $$invalidate(4, floorIndex = $$props.floorIndex);
3450
+ if ('hoverEnable' in $$props) $$invalidate(5, hoverEnable = $$props.hoverEnable);
3451
+ if ('compassEnable' in $$props) $$invalidate(6, compassEnable = $$props.compassEnable);
3452
+ if ('roomLabelsEnable' in $$props) $$invalidate(7, roomLabelsEnable = $$props.roomLabelsEnable);
3453
+ if ('ruleLabelsEnable' in $$props) $$invalidate(8, ruleLabelsEnable = $$props.ruleLabelsEnable);
3454
+ if ('floorplanData' in $$props) $$invalidate(9, floorplanData = $$props.floorplanData);
3455
+ if ('lastPanoramaLongitude' in $$props) $$invalidate(10, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
3456
+ if ('cameraImageUrl' in $$props) $$invalidate(11, cameraImageUrl = $$props.cameraImageUrl);
3457
+ if ('getLabelElement' in $$props) $$invalidate(12, getLabelElement = $$props.getLabelElement);
3458
+ if ('adaptiveRoomLabelVisibleEnable' in $$props) $$invalidate(13, adaptiveRoomLabelVisibleEnable = $$props.adaptiveRoomLabelVisibleEnable);
3207
3459
  };
3208
3460
 
3209
3461
  return [
3210
- pxmm,
3211
- five,
3212
3462
  duration,
3213
3463
  visible,
3464
+ northDesc,
3214
3465
  panoIndex,
3215
3466
  floorIndex,
3216
3467
  hoverEnable,
@@ -3220,8 +3471,8 @@ function instance($$self, $$props, $$invalidate) {
3220
3471
  floorplanData,
3221
3472
  lastPanoramaLongitude,
3222
3473
  cameraImageUrl,
3223
- onRoomHeightClick,
3224
- getLabelElement
3474
+ getLabelElement,
3475
+ adaptiveRoomLabelVisibleEnable
3225
3476
  ];
3226
3477
  }
3227
3478
 
@@ -3236,27 +3487,255 @@ class Main extends internal.SvelteComponent {
3236
3487
  create_fragment,
3237
3488
  internal.safe_not_equal,
3238
3489
  {
3239
- pxmm: 0,
3240
- five: 1,
3241
- duration: 2,
3242
- visible: 3,
3243
- panoIndex: 4,
3244
- floorIndex: 5,
3245
- hoverEnable: 6,
3246
- compassEnable: 7,
3247
- roomLabelsEnable: 8,
3248
- ruleLabelsEnable: 9,
3249
- floorplanData: 10,
3250
- lastPanoramaLongitude: 11,
3251
- cameraImageUrl: 12,
3252
- onRoomHeightClick: 13,
3253
- getLabelElement: 14
3490
+ duration: 0,
3491
+ visible: 1,
3492
+ northDesc: 2,
3493
+ panoIndex: 3,
3494
+ floorIndex: 4,
3495
+ hoverEnable: 5,
3496
+ compassEnable: 6,
3497
+ roomLabelsEnable: 7,
3498
+ ruleLabelsEnable: 8,
3499
+ floorplanData: 9,
3500
+ lastPanoramaLongitude: 10,
3501
+ cameraImageUrl: 11,
3502
+ getLabelElement: 12,
3503
+ adaptiveRoomLabelVisibleEnable: 13
3254
3504
  },
3255
3505
  add_css
3256
3506
  );
3257
3507
  }
3258
3508
  }
3259
3509
 
3510
+ async function formatOutlines(outlines) {
3511
+ const headers = new Headers({ 'Content-Type': 'text/plain' });
3512
+ const getOutlineItem = async function (item) {
3513
+ const outlineItem = {
3514
+ index: item.index,
3515
+ url: item.url,
3516
+ svgUrl: item.svg_url,
3517
+ };
3518
+ if (item.svg_url) {
3519
+ const svgContent = await fetch(item.svg_url, { headers }).then((res) => res.text());
3520
+ outlineItem.svgContent = svgContent;
3521
+ }
3522
+ return outlineItem;
3523
+ };
3524
+ const svgOutlineItems = await Promise.all(outlines.map(getOutlineItem));
3525
+ return svgOutlineItems;
3526
+ }
3527
+ function formatRoom(data) {
3528
+ const floorplanRoomItem = {
3529
+ id: data.id,
3530
+ size: data.size,
3531
+ name: data.name,
3532
+ path: data.path,
3533
+ roomType: data.room_type,
3534
+ floorType: data.floor_type,
3535
+ roomLabel: {
3536
+ position: data.room_label.position,
3537
+ positionInImage: data.room_label.position_in_image,
3538
+ },
3539
+ observerIndexs: data.observer_indexs,
3540
+ };
3541
+ return floorplanRoomItem;
3542
+ }
3543
+ function formatFloorData(_data) {
3544
+ return {
3545
+ floorName: _data.floor_name,
3546
+ floorIndex: _data.floor_index,
3547
+ rooms: _data.rooms.map(formatRoom),
3548
+ rules: _data.rules,
3549
+ };
3550
+ }
3551
+ function formateFloorplanObserver(data) {
3552
+ const floorplanObserver = {
3553
+ index: data.index,
3554
+ floorIndex: data.floor_index,
3555
+ position: data.position,
3556
+ positionInImage: data.position_in_image,
3557
+ };
3558
+ return floorplanObserver;
3559
+ }
3560
+ function formatFloorplanEntrance(data) {
3561
+ const floorplanEntrance = {
3562
+ rad: data.rad,
3563
+ position: data.position,
3564
+ positionInImage: data.position_in_image,
3565
+ northRad: data.north_rad,
3566
+ roomId: data.room_id,
3567
+ floorIndex: data.floor_index,
3568
+ };
3569
+ return floorplanEntrance;
3570
+ }
3571
+ async function formatData(data) {
3572
+ const outlines = await formatOutlines(data.outlines);
3573
+ const bounding = data.computed_data.bounding;
3574
+ const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
3575
+ const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
3576
+ const floorplanData = {
3577
+ outlines,
3578
+ entrance,
3579
+ bounding,
3580
+ floorDatas,
3581
+ observers: data.computed_data.observers.map(formateFloorplanObserver),
3582
+ };
3583
+ return floorplanData;
3584
+ }
3585
+
3586
+ /**
3587
+ * 把第一个参数传入第二个参数(函数)中并执行
3588
+ * 一般用于执行函数后返回变量。
3589
+ * @param {any} something
3590
+ * @param {function} callback
3591
+ * @return {any}
3592
+ */
3593
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3594
+ function tap(something, callback) {
3595
+ callback(something);
3596
+ return something;
3597
+ }
3598
+
3599
+ /**
3600
+ * 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
3601
+ * @param object
3602
+ * @param props 排除的属性
3603
+ * @return
3604
+ */
3605
+ function omit(object, props) {
3606
+ return tap({}, (result) => {
3607
+ for (const name in object) {
3608
+ if (props.indexOf(name) !== -1)
3609
+ continue;
3610
+ result[name] = object[name];
3611
+ }
3612
+ });
3613
+ }
3614
+
3615
+ var FLOOR_PLAN_ATTACHED_TO;
3616
+ (function (FLOOR_PLAN_ATTACHED_TO) {
3617
+ FLOOR_PLAN_ATTACHED_TO[FLOOR_PLAN_ATTACHED_TO["FLOOR"] = 1] = "FLOOR";
3618
+ FLOOR_PLAN_ATTACHED_TO[FLOOR_PLAN_ATTACHED_TO["CEILING"] = 2] = "CEILING";
3619
+ FLOOR_PLAN_ATTACHED_TO[FLOOR_PLAN_ATTACHED_TO["BOUNDING_CENTER"] = 3] = "BOUNDING_CENTER";
3620
+ })(FLOOR_PLAN_ATTACHED_TO || (FLOOR_PLAN_ATTACHED_TO = {}));
3621
+
3622
+ /**
3623
+ * plugin 的基本控制器
3624
+ */
3625
+ class Controller$2 {
3626
+ constructor(five$1) {
3627
+ Object.defineProperty(this, "five", {
3628
+ enumerable: true,
3629
+ configurable: true,
3630
+ writable: true,
3631
+ value: void 0
3632
+ });
3633
+ /**
3634
+ * 插件事件钩子
3635
+ */
3636
+ Object.defineProperty(this, "hooks", {
3637
+ enumerable: true,
3638
+ configurable: true,
3639
+ writable: true,
3640
+ value: new five.Subscribe()
3641
+ });
3642
+ this.five = five$1;
3643
+ }
3644
+ /**
3645
+ * 获取当前的插件状态,如果当初插件内存在需要通过动画变更的 state 值,则通过此方法可以得到中间状态
3646
+ */
3647
+ getCurrentState() {
3648
+ return this.state;
3649
+ }
3650
+ }
3651
+
3652
+ class Controller$1 extends Controller$2 {
3653
+ }
3654
+
3655
+ /**
3656
+ * 比较两个数字近似相等
3657
+ * @param num1 数字1
3658
+ * @param num2 数字2
3659
+ * @param accuracy 精度:精确到小数点后几位,默认精确到 小数点后四位
3660
+ */
3661
+ function nearlyEqual(num1, num2, accuracy = 4) {
3662
+ return Math.floor(num1 * Math.pow(10, accuracy)) === Math.floor(num2 * Math.pow(10, accuracy));
3663
+ }
3664
+
3665
+ /** 等待 five changeMode 结束
3666
+ * @description Promise 的状态只代表 mode 与预期是否一致,不保证参数的一致性
3667
+ */
3668
+ async function changeMode(five, changeModeParams) {
3669
+ await new Promise((resolve, reject) => {
3670
+ // 虽然 changeMode 是异步函数,但不代表异步流程结束代表切换 Mode 动画结束
3671
+ five.changeMode(...changeModeParams).catch((error) => reject(error));
3672
+ five.once('initAnimationEnded', () => {
3673
+ const fiveCurrentState = five.getCurrentState();
3674
+ const correctMode = changeModeParams[0];
3675
+ if (fiveCurrentState.mode !== correctMode)
3676
+ reject(new Error('mode 与预期不符'));
3677
+ /** 检测当前的 current pose 和传入的 pose 是否一致 */
3678
+ const checkPose = () => {
3679
+ const correctPose = changeModeParams[1];
3680
+ if (!correctPose)
3681
+ return true;
3682
+ return Object.keys(correctPose).every((key) => {
3683
+ const fivePoseItem = fiveCurrentState[key];
3684
+ if (fivePoseItem === undefined)
3685
+ return true;
3686
+ const correctPoseItem = correctPose[key];
3687
+ if (typeof fivePoseItem === 'number' && typeof correctPoseItem === 'number') {
3688
+ return nearlyEqual(fivePoseItem, correctPoseItem, 2);
3689
+ }
3690
+ return fivePoseItem === correctPoseItem;
3691
+ });
3692
+ };
3693
+ const checkPoseResult = checkPose();
3694
+ if (!checkPoseResult)
3695
+ reject(new Error('five pose 与预期不符'));
3696
+ resolve();
3697
+ });
3698
+ });
3699
+ }
3700
+
3701
+ /** 获取当前楼层地面的 Y 值 */
3702
+ function getFloorY(five, floorIndex) {
3703
+ const maxFloorIndex = Math.max(...five.work.observers.map((ob) => ob.floorIndex));
3704
+ return floorIndex > maxFloorIndex
3705
+ ? five.model.bounding.max.y
3706
+ : Math.max(...five.work.observers
3707
+ .filter((ob) => ob.floorIndex === floorIndex)
3708
+ .map((ob) => ob.standingPosition.y));
3709
+ }
3710
+ /** 获取当前吸附类型的 Y 值
3711
+ * * FLOOR_PLAN_ATTACHED_TO.FLOOR:当前楼层地板的 Y
3712
+ * * FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER:当前模型中心的 Y
3713
+ * * FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER:当前楼层天花板的 Y
3714
+ */
3715
+ function getAttachedY(five, floorIndex, attachedTo = FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER) {
3716
+ const currentFloorY = getFloorY(five, floorIndex);
3717
+ const nextFloorY = getFloorY(five, floorIndex + 1);
3718
+ if (attachedTo === FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER)
3719
+ return (five.model.bounding.max.y + five.model.bounding.min.y) / 2;
3720
+ else if (attachedTo === FLOOR_PLAN_ATTACHED_TO.CEILING)
3721
+ return nextFloorY;
3722
+ else
3723
+ return currentFloorY;
3724
+ }
3725
+ /**
3726
+ * 获取「在俯视图」状态下,模型 mm 与屏幕像素 px 的对应关系,即每 mm 对应多少 px
3727
+ * @param five five
3728
+ */
3729
+ function getPxmm(five, container, floorIndex, options) {
3730
+ const y = getAttachedY(five, floorIndex, options === null || options === void 0 ? void 0 : options.attachedTo);
3731
+ const originPosition = new THREE__namespace.Vector3(0, y, 0);
3732
+ const originPositionXUnit = new THREE__namespace.Vector3(1, y, 0);
3733
+ const mouse = originPosition.clone().project(five.camera);
3734
+ const xUnitMouse = originPositionXUnit.clone().project(five.camera);
3735
+ const pxmm = Math.abs((xUnitMouse.x - mouse.x) / 1000) * (container.getBoundingClientRect().width / 2);
3736
+ return pxmm;
3737
+ }
3738
+
3260
3739
  function changeModelCanvasOpacity(five, opacity, duration = 300) {
3261
3740
  const fiveEle = five.getElement();
3262
3741
  if (!fiveEle)
@@ -3273,193 +3752,484 @@ function changeModelCanvasOpacity(five, opacity, duration = 300) {
3273
3752
  });
3274
3753
  }
3275
3754
 
3276
- class TopviewFloorplanPluginController {
3277
- size = { width: 0, height: 0 };
3278
- visible = false;
3279
- pxmm = 0;
3280
- app;
3281
- five;
3282
- panoIndex = 0;
3283
- floorIndex = 0;
3284
- configs = {};
3285
- lastPanoramaLongitude = 0;
3286
- selector;
3287
- floorplanData;
3288
- wrapper;
3289
- container = document.createElement('div');
3755
+ class Controller extends Controller$1 {
3290
3756
  constructor(five, params) {
3291
- this.five = five;
3292
- this.selector = params.selector;
3293
- this.configs = omit(params, ['selector']);
3294
- // 设置 container 样式
3295
- this.container.classList.add('floorplan-plugin');
3296
- Object.assign(this.container.style, pluginStyle);
3757
+ super(five);
3758
+ // =============== public properties =================
3759
+ Object.defineProperty(this, "name", {
3760
+ enumerable: true,
3761
+ configurable: true,
3762
+ writable: true,
3763
+ value: 'topviewFloorplanPlugin'
3764
+ });
3765
+ Object.defineProperty(this, "state", {
3766
+ enumerable: true,
3767
+ configurable: true,
3768
+ writable: true,
3769
+ value: void 0
3770
+ });
3771
+ // =============== private properties =================
3772
+ Object.defineProperty(this, "data", {
3773
+ enumerable: true,
3774
+ configurable: true,
3775
+ writable: true,
3776
+ value: void 0
3777
+ });
3778
+ Object.defineProperty(this, "app", {
3779
+ enumerable: true,
3780
+ configurable: true,
3781
+ writable: true,
3782
+ value: undefined
3783
+ });
3784
+ Object.defineProperty(this, "selector", {
3785
+ enumerable: true,
3786
+ configurable: true,
3787
+ writable: true,
3788
+ value: void 0
3789
+ });
3790
+ Object.defineProperty(this, "panoIndex", {
3791
+ enumerable: true,
3792
+ configurable: true,
3793
+ writable: true,
3794
+ value: 0
3795
+ });
3796
+ Object.defineProperty(this, "floorIndex", {
3797
+ enumerable: true,
3798
+ configurable: true,
3799
+ writable: true,
3800
+ value: 0
3801
+ });
3802
+ /** 户型图父容器 */
3803
+ Object.defineProperty(this, "wrapper", {
3804
+ enumerable: true,
3805
+ configurable: true,
3806
+ writable: true,
3807
+ value: void 0
3808
+ });
3809
+ /** 户型图主容器 */
3810
+ Object.defineProperty(this, "container", {
3811
+ enumerable: true,
3812
+ configurable: true,
3813
+ writable: true,
3814
+ value: document.createElement('div')
3815
+ });
3816
+ /** 展示户型图图前,Five 的 Panorama Longitude */
3817
+ Object.defineProperty(this, "lastPanoramaLongitude", {
3818
+ enumerable: true,
3819
+ configurable: true,
3820
+ writable: true,
3821
+ value: 0
3822
+ });
3823
+ /** 户型图大小 */
3824
+ Object.defineProperty(this, "size", {
3825
+ enumerable: true,
3826
+ configurable: true,
3827
+ writable: true,
3828
+ value: { width: 0, height: 0 }
3829
+ });
3830
+ /** 是否已经执行过事件监听 */
3831
+ Object.defineProperty(this, "hasAddedEventListener", {
3832
+ enumerable: true,
3833
+ configurable: true,
3834
+ writable: true,
3835
+ value: false
3836
+ });
3837
+ /** 上一次隐藏是否是用户调用了 hide 导致的 */
3838
+ Object.defineProperty(this, "isHiddenByHideFunc", {
3839
+ enumerable: true,
3840
+ configurable: true,
3841
+ writable: true,
3842
+ value: false
3843
+ });
3844
+ /** 更新户型图大小 */
3845
+ Object.defineProperty(this, "updateSize", {
3846
+ enumerable: true,
3847
+ configurable: true,
3848
+ writable: true,
3849
+ value: () => {
3850
+ if (!this.data)
3851
+ return;
3852
+ if (!this.container || !this.wrapper)
3853
+ return;
3854
+ if (this.five.getCurrentState().mode !== 'Topview')
3855
+ return;
3856
+ // 计算户型图展示大小
3857
+ const { min, max } = this.data.bounding;
3858
+ const width = max.x - min.x;
3859
+ const height = max.y - min.y;
3860
+ // 每毫米对应的 px 值
3861
+ const options = this.state.config.attachedTo ? { attachedTo: this.state.config.attachedTo } : undefined;
3862
+ const pxmm = getPxmm(this.five, this.wrapper, this.floorIndex, options);
3863
+ const _width = Math.ceil(width * pxmm);
3864
+ const _height = Math.ceil(height * pxmm);
3865
+ if (this.size.width === _width && this.size.height === _height)
3866
+ return;
3867
+ this.container.style.width = _width + 'px';
3868
+ this.container.style.height = _height + 'px';
3869
+ this.size = { width: _width, height: _height };
3870
+ }
3871
+ });
3872
+ /** 销毁插件 */
3873
+ Object.defineProperty(this, "dispose", {
3874
+ enumerable: true,
3875
+ configurable: true,
3876
+ writable: true,
3877
+ value: () => {
3878
+ var _a, _b;
3879
+ this.removeEventListener();
3880
+ (_a = this.app) === null || _a === void 0 ? void 0 : _a.$destroy();
3881
+ this.app = undefined;
3882
+ (_b = this.container) === null || _b === void 0 ? void 0 : _b.remove();
3883
+ this.data = undefined;
3884
+ this.wrapper = undefined;
3885
+ this.selector = undefined;
3886
+ this.hooks.emit('dispose');
3887
+ }
3888
+ });
3889
+ Object.defineProperty(this, "_disable", {
3890
+ enumerable: true,
3891
+ configurable: true,
3892
+ writable: true,
3893
+ value: (options) => {
3894
+ var _a, _b;
3895
+ const { userAction } = options;
3896
+ (_a = this.app) === null || _a === void 0 ? void 0 : _a.$destroy();
3897
+ this.app = undefined;
3898
+ (_b = this.container) === null || _b === void 0 ? void 0 : _b.remove();
3899
+ this.removeEventListener();
3900
+ this.hooks.emit('disable', { userAction });
3901
+ }
3902
+ });
3903
+ /** modelLoaded 之后自动执行 append container 操作 */
3904
+ Object.defineProperty(this, "onFiveModelLoaded", {
3905
+ enumerable: true,
3906
+ configurable: true,
3907
+ writable: true,
3908
+ value: () => {
3909
+ if (this.state.enabled === false)
3910
+ return;
3911
+ if (this.wrapper)
3912
+ return;
3913
+ if (!this.selector)
3914
+ return;
3915
+ const wrapper = this.selector instanceof Element ? this.selector : document.querySelector(this.selector);
3916
+ if (!wrapper)
3917
+ throw new Error('不正确的父容器选择器');
3918
+ this.wrapper = wrapper;
3919
+ wrapper.append(this.container);
3920
+ }
3921
+ });
3922
+ /** 非 Topview 态隐藏户型图 */
3923
+ Object.defineProperty(this, "onFiveModeChange", {
3924
+ enumerable: true,
3925
+ configurable: true,
3926
+ writable: true,
3927
+ value: (...[mode, , , , userAction]) => {
3928
+ if (mode !== 'Topview' && this.state.visible) {
3929
+ this.updateState({ visible: false }, userAction);
3930
+ this._hide({ userAction });
3931
+ }
3932
+ }
3933
+ });
3934
+ Object.defineProperty(this, "onFivePanoArrived", {
3935
+ enumerable: true,
3936
+ configurable: true,
3937
+ writable: true,
3938
+ value: (index) => {
3939
+ var _a;
3940
+ if (!((_a = this.five) === null || _a === void 0 ? void 0 : _a.work))
3941
+ return;
3942
+ this.panoIndex = index;
3943
+ this.floorIndex = this.five.work.observers[index].floorIndex;
3944
+ }
3945
+ });
3946
+ Object.defineProperty(this, "onFiveCameraUpdate", {
3947
+ enumerable: true,
3948
+ configurable: true,
3949
+ writable: true,
3950
+ value: (_, userAction) => {
3951
+ if (!this.state.visible)
3952
+ return;
3953
+ this.updatePosition();
3954
+ this.updateSize();
3955
+ }
3956
+ });
3957
+ Object.defineProperty(this, "onFiveWantsGesture", {
3958
+ enumerable: true,
3959
+ configurable: true,
3960
+ writable: true,
3961
+ value: (type) => {
3962
+ if (type !== 'pan' && type !== 'pinch' && type !== 'mouseWheel')
3963
+ return;
3964
+ if (this.state.visible && !this.state.config.gestureEnable)
3965
+ return false;
3966
+ }
3967
+ });
3968
+ Object.defineProperty(this, "onFiveWantsMoveToPano", {
3969
+ enumerable: true,
3970
+ configurable: true,
3971
+ writable: true,
3972
+ value: () => {
3973
+ if (this.state.visible && this.state.config.preventRoomClick)
3974
+ return false;
3975
+ }
3976
+ });
3977
+ /** 动画结束后是 Topview 态就展示户型图 */
3978
+ Object.defineProperty(this, "onFiveInitAnimationEnded", {
3979
+ enumerable: true,
3980
+ configurable: true,
3981
+ writable: true,
3982
+ value: (...[, , userAction]) => {
3983
+ const { mode } = this.five.getCurrentState();
3984
+ if (mode === 'Topview' && !this.isHiddenByHideFunc && !this.state.visible && this.state.config.autoShowEnable) {
3985
+ this.updateState({ visible: true }, userAction);
3986
+ this._show({ userAction });
3987
+ }
3988
+ }
3989
+ });
3990
+ Object.defineProperty(this, "onModelShownFloorChange", {
3991
+ enumerable: true,
3992
+ configurable: true,
3993
+ writable: true,
3994
+ value: (shownFloor) => {
3995
+ if (this.floorIndex === shownFloor)
3996
+ return;
3997
+ if (shownFloor === null) {
3998
+ const panoIndex = this.five.getCurrentState().panoIndex;
3999
+ this.floorIndex = this.five.work.observers[panoIndex].floorIndex;
4000
+ return;
4001
+ }
4002
+ // 模型楼层高亮改变时,自动进行楼层切换
4003
+ this.floorIndex = shownFloor;
4004
+ this.updateSize();
4005
+ this.render();
4006
+ }
4007
+ });
4008
+ if (params === null || params === void 0 ? void 0 : params.selector) {
4009
+ this.selector = params.selector;
4010
+ console.warn('不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法');
4011
+ }
4012
+ // =============== init State ===============
4013
+ const baseConfig = {
4014
+ northDesc: '北',
4015
+ modelOpacity: 1,
4016
+ hoverEnable: true,
4017
+ compassEnable: true,
4018
+ gestureEnable: false,
4019
+ autoShowEnable: true,
4020
+ ruleLabelsEnable: true,
4021
+ roomLabelsEnable: true,
4022
+ cameraImageUrl: CAMERA_IMAGE,
4023
+ attachedTo: FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER,
4024
+ getLabelElement: undefined,
4025
+ adaptiveRoomLabelVisibleEnable: true,
4026
+ };
4027
+ const paramsConfig = params ? omit(params, ['selector', 'scale']) : {};
4028
+ const config = Object.assign(Object.assign({}, baseConfig), paramsConfig);
4029
+ this.state = {
4030
+ enabled: true,
4031
+ visible: false,
4032
+ config,
4033
+ };
4034
+ // =============== init Container ===============
4035
+ this.initContainer();
4036
+ // =============== init Listener ===============
4037
+ // 注意插件声明周期内只监听一次的事件不放在 addEventListener 里面
3297
4038
  // 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
3298
- this.five.model.loaded ? this.handleModelLoaded() : five.once('modelLoaded', this.handleModelLoaded);
3299
- this.five.once('dispose', this.dispose);
3300
- this.five.on('modeChange', this.handleModeChange);
3301
- this.five.on('panoArrived', this.handlePanoArrived);
3302
- this.five.on('initAnimationEnded', this.handleInitAnimationEnded);
3303
- this.five.on('modelShownFloorChange', this.onModelShownFloorChange);
4039
+ five.model.loaded ? this.onFiveModelLoaded() : five.once('modelLoaded', this.onFiveModelLoaded);
4040
+ five.once('dispose', this.dispose);
4041
+ this.addEventListener();
3304
4042
  }
3305
- /** 加载户型图数据 */
3306
- async load(data) {
3307
- const copyData = JSON.parse(JSON.stringify(data));
3308
- this.floorplanData = await formatData(copyData);
4043
+ async load(serverData, state, userAction = true) {
4044
+ function isPluginServerData(serverData) {
4045
+ return Object.prototype.hasOwnProperty.apply(serverData, ['version']);
4046
+ }
4047
+ const _data = serverData;
4048
+ if (_data && !_data.version)
4049
+ console.warn('传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数');
4050
+ const copyData = JSON.parse(JSON.stringify(serverData));
4051
+ const _serverData = isPluginServerData(copyData) ? copyData.data : copyData;
4052
+ const prevData = this.data;
4053
+ this.data = await formatData(_serverData);
4054
+ this.hooks.emit('dataLoaded', this.data);
4055
+ this.hooks.emit('dataChange', this.data, prevData);
4056
+ if (state)
4057
+ this.updateState(state, userAction);
3309
4058
  this.render();
3310
4059
  }
4060
+ /** 更新户型图位置 */
4061
+ updatePosition() {
4062
+ var _a;
4063
+ const y = getAttachedY(this.five, this.floorIndex, this.state.config.attachedTo);
4064
+ const modelPosition = (_a = this.five.model) === null || _a === void 0 ? void 0 : _a.bounding.getCenter(new THREE__namespace.Vector3()).setY(y);
4065
+ if (!modelPosition)
4066
+ return;
4067
+ const ndcPosition = modelPosition.clone().project(this.five.camera);
4068
+ const left = (ndcPosition.x + 1) / 2;
4069
+ const top = -(ndcPosition.y - 1) / 2;
4070
+ this.container.style.left = left * 100 + '%';
4071
+ this.container.style.top = top * 100 + '%';
4072
+ }
3311
4073
  /** 把插件的渲染DOM插入到对应的容器中去 */
3312
4074
  appendTo(wrapper) {
3313
4075
  this.wrapper = wrapper;
4076
+ // 插件 disabled 时,只是不执行副作用,但是 wrapper 还是要赋值的,不然 enable 的时候找不到父容器
4077
+ if (!this.state.enabled)
4078
+ return;
3314
4079
  wrapper.appendChild(this.container);
4080
+ this.render();
3315
4081
  return this;
3316
4082
  }
3317
- dispose = () => {
3318
- this.hide();
3319
- this.container?.remove();
3320
- this.app?.$destroy();
3321
- this.five.off('modeChange', this.handleModeChange);
3322
- this.five.off('panoArrived', this.handlePanoArrived);
3323
- this.five.off('modelLoaded', this.handleModelLoaded);
3324
- this.five.off('wantsMoveToPano', this.handleWantsMoveToPano);
3325
- this.five.off('wantsPanGesture', this.handleWantsPanGesture);
3326
- this.five.off('initAnimationEnded', this.handleInitAnimationEnded);
3327
- this.five.off('modelShownFloorChange', this.onModelShownFloorChange);
3328
- };
3329
- /** 模型楼层高亮改变时,自动进行楼层切换 */
3330
- onModelShownFloorChange = (shownFloor) => {
3331
- if (shownFloor === null)
3332
- return;
3333
- this.floorIndex = shownFloor;
3334
- this.updateSize();
3335
- this.render();
3336
- };
3337
- /** panoIndex 改变时,更新 floorIndex */
3338
- handlePanoArrived = (index) => {
3339
- if (!this.five?.work)
4083
+ async show(options = {}) {
4084
+ // 已经展示完成了,不做任何操作
4085
+ if (this.state.visible)
3340
4086
  return;
3341
- this.panoIndex = index;
3342
- this.floorIndex = this.five.work.observers[index].floorIndex;
3343
- };
3344
- /** 配置了 preventRoomClick 后,在户型图展示时阻止 Five 走点 */
3345
- handleWantsMoveToPano = () => {
3346
- if (!this.visible)
4087
+ const userAction = options.userAction !== undefined ? options.userAction : true;
4088
+ this.updateState({ visible: true }, userAction);
4089
+ this._show({ userAction });
4090
+ }
4091
+ async hide(options = {}) {
4092
+ this.isHiddenByHideFunc = true;
4093
+ if (!this.state.visible)
3347
4094
  return;
3348
- if (this.configs.preventRoomClick)
3349
- return false;
3350
- return;
3351
- };
3352
- /** 在户型图展示时阻止 Five 滑动行为 */
3353
- handleWantsPanGesture = () => {
3354
- if (!this.visible)
4095
+ const userAction = options.userAction !== undefined ? options.userAction : true;
4096
+ this.updateState({ visible: false }, userAction);
4097
+ this._hide({ userAction });
4098
+ }
4099
+ enable(options = {}) {
4100
+ if (this.state.enabled)
3355
4101
  return;
3356
- return false;
3357
- };
3358
- handleModelLoaded = () => {
3359
- if (this.wrapper)
4102
+ const userAction = options.userAction !== undefined ? options.userAction : true;
4103
+ this.updateState({ enabled: true }, options.userAction || userAction);
4104
+ this._enable({ userAction });
4105
+ }
4106
+ disable(options = {}) {
4107
+ if (!this.state.enabled)
3360
4108
  return;
3361
- if (!this.selector)
4109
+ const userAction = options.userAction !== undefined ? options.userAction : true;
4110
+ this.updateState({ enabled: false }, options.userAction || userAction);
4111
+ this._disable({ userAction });
4112
+ }
4113
+ /** 更改插件 State */
4114
+ setState(state, options = {}) {
4115
+ const prevState = this.state;
4116
+ const userAction = options.userAction !== undefined ? options.userAction : true;
4117
+ this.updateState(state, userAction);
4118
+ if (state.enabled !== undefined && prevState.enabled !== state.enabled) {
4119
+ const options = { userAction };
4120
+ state.enabled ? this._enable(options) : this._disable(options);
4121
+ }
4122
+ if (state.visible !== undefined && prevState.visible !== state.visible) {
4123
+ const options = { userAction };
4124
+ state.visible ? this._show(options) : this._hide(options);
4125
+ }
4126
+ }
4127
+ async formatData(serverData) {
4128
+ return await formatData(serverData.data);
4129
+ }
4130
+ async _show(options) {
4131
+ if (!this.state.enabled)
3362
4132
  return;
3363
- const wrapper = this.selector instanceof Element ? this.selector : document.querySelector(this.selector);
3364
- if (!wrapper)
3365
- throw new Error('不正确的父容器选择器');
3366
- this.wrapper = wrapper;
3367
- wrapper.append(this.container);
3368
- };
3369
- /** 非 Topview 态隐藏户型图 */
3370
- handleModeChange = (mode) => {
3371
- if (mode !== 'Topview')
3372
- return this.hide();
3373
- };
3374
- /** 动画结束后是 Topview 态就展示户型图 */
3375
- handleInitAnimationEnded = () => {
3376
- const { mode } = this.five.getCurrentState();
3377
- if (mode === 'Topview')
3378
- this.show();
3379
- };
3380
- show() {
3381
- this.visible = true;
4133
+ this.isHiddenByHideFunc = false;
4134
+ const { userAction } = options;
4135
+ this.hooks.emit('show', { userAction });
4136
+ if (this.five.getCurrentState().mode !== 'Topview') {
4137
+ await changeMode(this.five, ['Topview', undefined, undefined, userAction]);
4138
+ }
3382
4139
  this.five.model.show(this.floorIndex);
4140
+ this.updatePosition();
3383
4141
  this.updateSize();
3384
4142
  const renderDuration = 500;
3385
- const modelOpacity = this.configs.modelOpacity;
3386
- if (typeof modelOpacity === 'number') {
3387
- changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
3388
- }
3389
- this.render(renderDuration);
3390
- this.five.on('wantsMoveToPano', this.handleWantsMoveToPano);
3391
- this.five.on('wantsPanGesture', this.handleWantsPanGesture);
4143
+ const modelOpacity = this.state.config.modelOpacity;
4144
+ changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
4145
+ this.hooks.emit('showAnimationEnded', { userAction });
4146
+ this.render();
3392
4147
  }
3393
- hide() {
4148
+ async _hide(options) {
4149
+ if (!this.state.enabled)
4150
+ return;
4151
+ const { userAction } = options;
4152
+ this.hooks.emit('hide', { userAction });
3394
4153
  const modelOpacity = 1;
3395
4154
  const renderDuration = 0;
3396
- this.visible = false;
3397
4155
  changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
3398
4156
  this.render();
3399
- this.five.on('wantsMoveToPano', this.handleWantsMoveToPano);
3400
- this.five.on('wantsPanGesture', this.handleWantsPanGesture);
3401
4157
  }
3402
- /** 更新户型图大小 */
3403
- updateSize = () => {
3404
- if (!this.floorplanData)
4158
+ _enable(options) {
4159
+ const { userAction } = options;
4160
+ this.addEventListener();
4161
+ if (this.wrapper)
4162
+ this.wrapper.append(this.container);
4163
+ this.hooks.emit('enable', { userAction });
4164
+ if (this.state.visible)
4165
+ this._show({ userAction });
4166
+ }
4167
+ updateState(state, userAction) {
4168
+ const prevState = this.state;
4169
+ this.state = Object.assign(Object.assign({}, this.state), state);
4170
+ if (equal(this.state, prevState, { deep: true }))
3405
4171
  return;
3406
- if (!this.container || !this.wrapper)
4172
+ this.hooks.emit('stateChange', { state: this.state, prevState, userAction });
4173
+ }
4174
+ addEventListener() {
4175
+ if (!this.state.enabled)
3407
4176
  return;
3408
- if (this.five.getCurrentState().mode !== 'Topview')
4177
+ if (this.hasAddedEventListener)
3409
4178
  return;
3410
- // 计算户型图展示大小
3411
- const { min, max } = this.floorplanData.bounding;
3412
- const width = max.x - min.x;
3413
- const height = max.y - min.y;
3414
- // 每毫米对应的 px 值
3415
- const options = this.configs.attachedTo ? { attachedTo: this.configs.attachedTo } : undefined;
3416
- const pxmm = getPxmm(this.five, this.wrapper, this.floorIndex, options);
3417
- const _width = Math.ceil(width * pxmm);
3418
- const _height = Math.ceil(height * pxmm);
3419
- this.pxmm = pxmm;
3420
- this.size = { width: _width, height: _height };
3421
- this.container.style.width = _width + 'px';
3422
- this.container.style.height = _height + 'px';
3423
- };
4179
+ const five = this.five;
4180
+ five.on('modeChange', this.onFiveModeChange);
4181
+ five.on('panoArrived', this.onFivePanoArrived);
4182
+ five.on('cameraUpdate', this.onFiveCameraUpdate);
4183
+ five.on('wantsGesture', this.onFiveWantsGesture);
4184
+ five.on('wantsMoveToPano', this.onFiveWantsMoveToPano);
4185
+ five.on('initAnimationEnded', this.onFiveInitAnimationEnded);
4186
+ five.on('modelShownFloorChange', this.onModelShownFloorChange);
4187
+ }
4188
+ removeEventListener() {
4189
+ const five = this.five;
4190
+ this.hasAddedEventListener = false;
4191
+ // 注意这里并没有消除 dispose 的监听
4192
+ five.off('modeChange', this.onFiveModeChange);
4193
+ five.off('panoArrived', this.onFivePanoArrived);
4194
+ five.off('cameraUpdate', this.onFiveCameraUpdate);
4195
+ five.off('wantsGesture', this.onFiveWantsGesture);
4196
+ five.off('wantsMoveToPano', this.onFiveWantsMoveToPano);
4197
+ five.off('initAnimationEnded', this.onFiveInitAnimationEnded);
4198
+ five.off('modelShownFloorChange', this.onModelShownFloorChange);
4199
+ }
4200
+ /** 如果用户是通过 selector 设置父容器,需要在 modelLoaded 之后把 container 自动放到父容器里
4201
+ *
4202
+ * - TODO: 等 selector 功能下掉之后删除这个逻辑
4203
+ */
4204
+ initContainer() {
4205
+ this.container.classList.add('floorplan-plugin');
4206
+ Object.assign(this.container.style, {
4207
+ position: 'absolute',
4208
+ left: '50%',
4209
+ top: '50%',
4210
+ transform: 'translate3d(-50%, -50%, 10px)',
4211
+ zIndex: 10,
4212
+ pointerEvents: 'none',
4213
+ 'will-change': 'width, height',
4214
+ });
4215
+ this.five.addExtraElement(this.container);
4216
+ }
3424
4217
  render(duration) {
3425
- if (!this.container || !this.floorplanData)
4218
+ if (!this.state.enabled)
4219
+ return;
4220
+ if (!this.container || !this.data)
3426
4221
  return;
3427
4222
  if (this.size.width === 0)
3428
4223
  return;
3429
- const { getLabelElement, cameraImageUrl, preventRoomClick, hoverEnable, compassEnable, roomLabelsEnable, ruleLabelsEnable, } = this.configs;
3430
- const handleClick = preventRoomClick ? () => false : undefined;
3431
- const props = {
3432
- five: this.five,
3433
- pxmm: this.pxmm,
3434
- cameraImageUrl,
3435
- visible: this.visible,
3436
- duration: duration ?? 0,
3437
- panoIndex: this.panoIndex,
3438
- floorIndex: this.floorIndex,
3439
- floorplanData: this.floorplanData,
3440
- hoverEnable: hoverEnable ?? false,
3441
- compassEnable: compassEnable ?? true,
3442
- ruleLabelsEnable: ruleLabelsEnable ?? true,
3443
- roomLabelsEnable: roomLabelsEnable ?? true,
3444
- lastPanoramaLongitude: this.lastPanoramaLongitude,
3445
- getLabelElement,
3446
- onRoomHeightClick: handleClick,
3447
- };
3448
- if (!this.app) {
3449
- this.app = new Main({
3450
- target: this.container,
3451
- intro: true,
3452
- props,
3453
- });
3454
- }
3455
- else {
3456
- this.app.$set(props);
3457
- }
4224
+ const props = Object.assign(Object.assign({}, this.state.config), { visible: this.state.visible, duration: duration !== null && duration !== void 0 ? duration : 0, panoIndex: this.panoIndex, floorIndex: this.floorIndex, floorplanData: this.data, lastPanoramaLongitude: this.lastPanoramaLongitude });
4225
+ if (this.app)
4226
+ return this.app.$set(props);
4227
+ this.app = new Main({ target: this.container, intro: true, props });
3458
4228
  }
3459
4229
  }
3460
4230
 
3461
4231
  const TopviewFloorplanPlugin = (five, params) => {
3462
- return new TopviewFloorplanPluginController(five, params);
4232
+ return new Controller(five, params);
3463
4233
  };
3464
4234
 
3465
4235
  exports.TopviewFloorplanPlugin = TopviewFloorplanPlugin;