kitchen-simulator 7.0.9-react-18 → 10.0.0

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 (700) hide show
  1. package/es/AppContext.js +1 -4
  2. package/es/LiteKitchenConfigurator.js +67 -23
  3. package/es/LiteRenderer.js +15 -100
  4. package/es/actions/export.js +25 -12
  5. package/es/actions/items-actions.js +18 -2
  6. package/es/analytics/ga4.js +188 -0
  7. package/es/analytics/posthog.js +60 -0
  8. package/es/assets/Window.hdr +2100 -0
  9. package/es/assets/img/default/maple.jpg +0 -0
  10. package/es/assets/img/default/steel.jpg +0 -0
  11. package/es/assets/img/loading/loading.gif +0 -0
  12. package/es/catalog/catalog.js +0 -2
  13. package/es/catalog/factories/area-factory-3d.js +1 -5
  14. package/es/catalog/factories/wall-factory.js +1 -1
  15. package/es/catalog/holes/door-double/door_double.png +0 -0
  16. package/es/catalog/holes/door-panic/panicDoor.png +0 -0
  17. package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
  18. package/es/catalog/holes/gate/gate.jpg +0 -0
  19. package/es/catalog/holes/window-clear/texture.png +0 -0
  20. package/es/catalog/holes/window-cross/texture.png +0 -0
  21. package/es/catalog/holes/window-double-hung/texture.png +0 -0
  22. package/es/catalog/holes/window-vertical/texture.png +0 -0
  23. package/es/catalog/utils/exporter.js +4 -0
  24. package/es/catalog/utils/item-loader.js +3 -22
  25. package/es/class/area.js +0 -1
  26. package/es/class/export.js +1 -3
  27. package/es/class/item.js +180 -86
  28. package/es/class/project.js +17 -21
  29. package/es/components/content.js +3 -1
  30. package/es/components/export.js +3 -5
  31. package/es/components/style/export.js +2 -28
  32. package/es/components/style/form-number-input.js +34 -43
  33. package/es/components/viewer2d/group.js +12 -7
  34. package/es/components/viewer2d/item.js +160 -168
  35. package/es/components/viewer2d/line.js +18 -51
  36. package/es/components/viewer2d/rulerX.js +3 -0
  37. package/es/components/viewer2d/rulerY.js +3 -0
  38. package/es/components/viewer2d/scene.js +67 -47
  39. package/es/components/viewer2d/state.js +1 -1
  40. package/es/components/viewer2d/viewer2d.js +564 -506
  41. package/es/components/viewer3d/front3D.js +1 -2
  42. package/es/components/viewer3d/pointer-lock-navigation.js +0 -90
  43. package/es/components/viewer3d/scene-creator.js +80 -47
  44. package/es/components/viewer3d/three-memory-cleaner.js +0 -14
  45. package/es/components/viewer3d/viewer3d-first-person.js +132 -134
  46. package/es/components/viewer3d/viewer3d.js +37 -22
  47. package/es/constants/catalog/skinPanel.js +9 -0
  48. package/es/constants.js +18 -7
  49. package/es/{WorkSpaceOriginal.js → devLiteRenderer.js} +228 -174
  50. package/es/events/external/handleExternalEvent.js +140 -0
  51. package/es/{utils/isolate-event-handler.js → events/external/handleExternalEvent.util.js} +87 -593
  52. package/es/events/external/handlers.addItem.js +47 -0
  53. package/es/events/external/handlers.changeDoorStyle.js +139 -0
  54. package/es/events/external/handlers.elementOps.js +8 -0
  55. package/es/events/external/handlers.finishing.js +26 -0
  56. package/es/events/external/handlers.hole.js +4 -0
  57. package/es/events/external/handlers.loadProject.js +128 -0
  58. package/es/events/external/handlers.molding.js +24 -0
  59. package/es/events/external/handlers.projectLifecycle.js +11 -0
  60. package/es/events/external/handlers.projectSettings.js +32 -0
  61. package/es/events/external/handlers.replaceCabinet.js +41 -0
  62. package/es/events/external/handlers.roomShape.js +8 -0
  63. package/es/events/external/handlers.syncScene.js +21 -0
  64. package/es/events/external/handlers.updateSelectedElements.js +11 -0
  65. package/es/events/external/handlers.viewMode.js +11 -0
  66. package/es/events/external/handlers.viewerNavigation.js +108 -0
  67. package/es/events/external/handlers.wall.js +7 -0
  68. package/es/index.js +37 -84
  69. package/es/mappings/external-events/mapExternalEventPayload.js +28 -0
  70. package/es/mappings/external-events/mappers/addItemMapper.js +95 -0
  71. package/es/mappings/external-events/mappers/ccdfMapper.js +86 -0
  72. package/es/mappings/external-events/mappers/ccdfToCDSMapper.js +31 -0
  73. package/es/mappings/external-events/mappers/changeDoorStyleMapper.js +37 -0
  74. package/es/mappings/external-events/mappers/loadProjectMapper.js +62 -0
  75. package/es/mappings/holesToCatalog.js +139 -0
  76. package/es/models.js +16 -1
  77. package/es/plugins/keyboard.js +1 -1
  78. package/es/reducers/export.js +2 -4
  79. package/es/reducers/items-reducer.js +4 -2
  80. package/es/reducers/project-reducer.js +1 -1
  81. package/es/reducers/reducer.js +2 -3
  82. package/es/reducers/viewer2d-reducer.js +0 -2
  83. package/es/shared/objects/immutable.js +3 -0
  84. package/es/utils/convert-units-lite.js +9 -0
  85. package/es/utils/geometry.js +598 -78
  86. package/es/utils/helper.js +45 -30
  87. package/es/utils/history.js +13 -1
  88. package/es/utils/molding.js +12 -241
  89. package/es/utils/name-generator.js +0 -3
  90. package/es/utils/skinPanelEngine.js +526 -0
  91. package/lib/@history.js +11 -0
  92. package/lib/AppContext.js +11 -0
  93. package/lib/LiteKitchenConfigurator.js +527 -0
  94. package/lib/LiteRenderer.js +323 -0
  95. package/lib/actions/area-actions.js +21 -0
  96. package/lib/actions/export.js +36 -0
  97. package/lib/actions/groups-actions.js +107 -0
  98. package/lib/actions/holes-actions.js +140 -0
  99. package/lib/actions/items-actions.js +383 -0
  100. package/lib/actions/lines-actions.js +98 -0
  101. package/lib/actions/project-actions.js +351 -0
  102. package/lib/actions/scene-actions.js +43 -0
  103. package/lib/actions/vertices-actions.js +35 -0
  104. package/lib/actions/viewer2d-actions.js +73 -0
  105. package/lib/actions/viewer3d-actions.js +32 -0
  106. package/lib/analytics/ga4.js +194 -0
  107. package/lib/analytics/posthog.js +68 -0
  108. package/lib/assets/Window.hdr +2100 -0
  109. package/lib/assets/brown_photostudio_02_1k.hdr +0 -0
  110. package/lib/assets/fonts/Rene Bieder Milliard Black Italic.woff +0 -0
  111. package/lib/assets/fonts/Rene Bieder Milliard Black.woff +0 -0
  112. package/lib/assets/fonts/Rene Bieder Milliard Bold Italic.woff +0 -0
  113. package/lib/assets/fonts/Rene Bieder Milliard Bold.woff +0 -0
  114. package/lib/assets/fonts/Rene Bieder Milliard Book Italic.woff +0 -0
  115. package/lib/assets/fonts/Rene Bieder Milliard Book.woff +0 -0
  116. package/lib/assets/fonts/Rene Bieder Milliard ExtraBold Italic.woff +0 -0
  117. package/lib/assets/fonts/Rene Bieder Milliard ExtraBold.woff +0 -0
  118. package/lib/assets/fonts/Rene Bieder Milliard ExtraLight Italic.woff +0 -0
  119. package/lib/assets/fonts/Rene Bieder Milliard ExtraLight.woff +0 -0
  120. package/lib/assets/fonts/Rene Bieder Milliard Hairline Italic.woff +0 -0
  121. package/lib/assets/fonts/Rene Bieder Milliard Hairline.woff +0 -0
  122. package/lib/assets/fonts/Rene Bieder Milliard Heavy Italic.woff +0 -0
  123. package/lib/assets/fonts/Rene Bieder Milliard Heavy.woff +0 -0
  124. package/lib/assets/fonts/Rene Bieder Milliard Light Italic.woff +0 -0
  125. package/lib/assets/fonts/Rene Bieder Milliard Light.woff +0 -0
  126. package/lib/assets/fonts/Rene Bieder Milliard Medium Italic.woff +0 -0
  127. package/lib/assets/fonts/Rene Bieder Milliard Medium.woff +0 -0
  128. package/lib/assets/fonts/Rene Bieder Milliard SemiBold Italic.woff +0 -0
  129. package/lib/assets/fonts/Rene Bieder Milliard SemiBold.woff +0 -0
  130. package/lib/assets/fonts/Rene Bieder Milliard Thin Italic.woff +0 -0
  131. package/lib/assets/fonts/Rene Bieder Milliard Thin.woff +0 -0
  132. package/lib/assets/fonts/style.css +177 -0
  133. package/lib/assets/gltf/door_closet.gltf +1 -0
  134. package/lib/assets/gltf/door_exterior.gltf +1 -0
  135. package/lib/assets/gltf/door_interior.gltf +1 -0
  136. package/lib/assets/gltf/door_sliding.gltf +1 -0
  137. package/lib/assets/gltf/doorway_framed.bin +0 -0
  138. package/lib/assets/gltf/doorway_framed.fbx +0 -0
  139. package/lib/assets/gltf/doorway_framed.gltf +1 -0
  140. package/lib/assets/gltf/window_clear.bin +0 -0
  141. package/lib/assets/gltf/window_clear.fbx +0 -0
  142. package/lib/assets/gltf/window_clear.gltf +1 -0
  143. package/lib/assets/gltf/window_cross.bin +0 -0
  144. package/lib/assets/gltf/window_cross.fbx +0 -0
  145. package/lib/assets/gltf/window_cross.gltf +1 -0
  146. package/lib/assets/gltf/window_double_hung.bin +0 -0
  147. package/lib/assets/gltf/window_double_hung.fbx +0 -0
  148. package/lib/assets/gltf/window_double_hung.gltf +1 -0
  149. package/lib/assets/gltf/window_vertical.bin +0 -0
  150. package/lib/assets/gltf/window_vertical.fbx +0 -0
  151. package/lib/assets/gltf/window_vertical.gltf +1 -0
  152. package/lib/assets/img/TKC_thumbnail.png +0 -0
  153. package/lib/assets/img/Toggle.png +0 -0
  154. package/lib/assets/img/default/maple.jpg +0 -0
  155. package/lib/assets/img/default/steel.jpg +0 -0
  156. package/lib/assets/img/loading/loading.gif +0 -0
  157. package/lib/assets/img/loading/loading_1.svg +11 -0
  158. package/lib/assets/img/loading_large.gif +0 -0
  159. package/lib/assets/img/png/door/closet.png +0 -0
  160. package/lib/assets/img/png/door/doorwaysframed.png +0 -0
  161. package/lib/assets/img/png/door/doorwaysframeles.png +0 -0
  162. package/lib/assets/img/png/door/doorwaysframeless.png +0 -0
  163. package/lib/assets/img/png/door/exterior.png +0 -0
  164. package/lib/assets/img/png/door/interior.png +0 -0
  165. package/lib/assets/img/png/door/sliding.png +0 -0
  166. package/lib/assets/img/png/helper/outcome.png +0 -0
  167. package/lib/assets/img/project_img.png +0 -0
  168. package/lib/assets/img/rta/rta_logo_box_blue.jpg +0 -0
  169. package/lib/assets/img/rta/rta_logo_box_blue_ico.jpg +0 -0
  170. package/lib/assets/img/rta/rta_logo_box_blue_ico.svg +55 -0
  171. package/lib/assets/img/rta/rta_logo_box_darkGray.jpg +0 -0
  172. package/lib/assets/img/rta/rta_logo_box_lightblue.png +0 -0
  173. package/lib/assets/img/rta/rta_logo_box_lightmaroon.png +0 -0
  174. package/lib/assets/img/rta/rta_logo_box_maroon.png +0 -0
  175. package/lib/assets/img/rta/rta_logo_box_white.png +0 -0
  176. package/lib/assets/img/rta_menu.png +0 -0
  177. package/lib/assets/img/step2.jpg +0 -0
  178. package/lib/assets/img/step3.jpg +0 -0
  179. package/lib/assets/img/step4.jpg +0 -0
  180. package/lib/assets/img/step5.jpg +0 -0
  181. package/lib/assets/img/step6.jpg +0 -0
  182. package/lib/assets/img/step7.jpg +0 -0
  183. package/lib/assets/img/step8.jpg +0 -0
  184. package/lib/assets/img/svg/2d_delete_object.svg +33 -0
  185. package/lib/assets/img/svg/2d_delete_object1.svg +33 -0
  186. package/lib/assets/img/svg/2d_lock_object.svg +33 -0
  187. package/lib/assets/img/svg/3d_item_move.svg +106 -0
  188. package/lib/assets/img/svg/3d_item_rotation.svg +76 -0
  189. package/lib/assets/img/svg/3d_item_warning_edit.svg +77 -0
  190. package/lib/assets/img/svg/3d_item_warning_info.svg +81 -0
  191. package/lib/assets/img/svg/accessories.svg +4 -0
  192. package/lib/assets/img/svg/angle_icon.svg +39 -0
  193. package/lib/assets/img/svg/blank_div.svg +14 -0
  194. package/lib/assets/img/svg/bottombar/2d3d_button.svg +3 -0
  195. package/lib/assets/img/svg/bottombar/2d3d_button_active.svg +3 -0
  196. package/lib/assets/img/svg/bottombar/2d3d_toggle.svg +4 -0
  197. package/lib/assets/img/svg/bottombar/2d3d_toggle_active.svg +4 -0
  198. package/lib/assets/img/svg/bottombar/arrow-down.svg +3 -0
  199. package/lib/assets/img/svg/bottombar/arrow-left.svg +3 -0
  200. package/lib/assets/img/svg/bottombar/arrow-minus.svg +3 -0
  201. package/lib/assets/img/svg/bottombar/arrow-plus.svg +11 -0
  202. package/lib/assets/img/svg/bottombar/arrow-right.svg +3 -0
  203. package/lib/assets/img/svg/bottombar/arrow-up.svg +3 -0
  204. package/lib/assets/img/svg/bottombar/collapse.svg +3 -0
  205. package/lib/assets/img/svg/bottombar/elevation-back.svg +6 -0
  206. package/lib/assets/img/svg/bottombar/elevation-front.svg +6 -0
  207. package/lib/assets/img/svg/bottombar/elevation-left.svg +6 -0
  208. package/lib/assets/img/svg/bottombar/elevation-right.svg +7 -0
  209. package/lib/assets/img/svg/bottombar/elevation.svg +13 -0
  210. package/lib/assets/img/svg/bottombar/expand.svg +3 -0
  211. package/lib/assets/img/svg/bottombar/help.svg +72 -0
  212. package/lib/assets/img/svg/bottombar/incm_toggle.svg +39 -0
  213. package/lib/assets/img/svg/bottombar/pan_1.svg +57 -0
  214. package/lib/assets/img/svg/bottombar/pan_2.svg +27 -0
  215. package/lib/assets/img/svg/bottombar/pan_3.svg +27 -0
  216. package/lib/assets/img/svg/bottombar/pan_4.svg +27 -0
  217. package/lib/assets/img/svg/bottombar/pan_5.svg +27 -0
  218. package/lib/assets/img/svg/bottombar/settings.svg +23 -0
  219. package/lib/assets/img/svg/bottombar/spin-down.svg +76 -0
  220. package/lib/assets/img/svg/bottombar/spin-left.svg +75 -0
  221. package/lib/assets/img/svg/bottombar/spin-right.svg +75 -0
  222. package/lib/assets/img/svg/bottombar/spin-up.svg +76 -0
  223. package/lib/assets/img/svg/bottombar/spin_1.svg +48 -0
  224. package/lib/assets/img/svg/bottombar/spin_2.svg +31 -0
  225. package/lib/assets/img/svg/bottombar/spin_3.svg +31 -0
  226. package/lib/assets/img/svg/bottombar/spin_4.svg +31 -0
  227. package/lib/assets/img/svg/bottombar/spin_5.svg +31 -0
  228. package/lib/assets/img/svg/bottombar/zoomin.svg +29 -0
  229. package/lib/assets/img/svg/bottombar/zoomout.svg +26 -0
  230. package/lib/assets/img/svg/check.svg +10 -0
  231. package/lib/assets/img/svg/close.svg +11 -0
  232. package/lib/assets/img/svg/color/Black.svg +3 -0
  233. package/lib/assets/img/svg/color/Blue.svg +3 -0
  234. package/lib/assets/img/svg/color/Cream.svg +3 -0
  235. package/lib/assets/img/svg/color/Gray.svg +3 -0
  236. package/lib/assets/img/svg/color/Green.svg +3 -0
  237. package/lib/assets/img/svg/color/White.svg +3 -0
  238. package/lib/assets/img/svg/color/White.svg.bak +3 -0
  239. package/lib/assets/img/svg/color/stone2.jpg +0 -0
  240. package/lib/assets/img/svg/color/wood2.jpg +0 -0
  241. package/lib/assets/img/svg/copy.svg +11 -0
  242. package/lib/assets/img/svg/delete.svg +3 -0
  243. package/lib/assets/img/svg/detail.svg +77 -0
  244. package/lib/assets/img/svg/disclaimer/background.svg +758 -0
  245. package/lib/assets/img/svg/disclaimer/logo-dots.svg +11 -0
  246. package/lib/assets/img/svg/door/Closet.svg +11 -0
  247. package/lib/assets/img/svg/door/Exterior.svg +5 -0
  248. package/lib/assets/img/svg/door/Framed_dorway.svg +5 -0
  249. package/lib/assets/img/svg/door/Frameless_dorway.svg +5 -0
  250. package/lib/assets/img/svg/door/Interior.svg +7 -0
  251. package/lib/assets/img/svg/door/Sliding.svg +5 -0
  252. package/lib/assets/img/svg/doors_closet.svg +47 -0
  253. package/lib/assets/img/svg/doors_exterior.svg +25 -0
  254. package/lib/assets/img/svg/doors_interior.svg +29 -0
  255. package/lib/assets/img/svg/doors_patio.svg +26 -0
  256. package/lib/assets/img/svg/duplicate.svg +11 -0
  257. package/lib/assets/img/svg/duplicate_object_left.svg +32 -0
  258. package/lib/assets/img/svg/duplicate_object_right.svg +32 -0
  259. package/lib/assets/img/svg/filtersActive.svg +19 -0
  260. package/lib/assets/img/svg/firstsetting/L.svg +3 -0
  261. package/lib/assets/img/svg/firstsetting/L2.svg +3 -0
  262. package/lib/assets/img/svg/firstsetting/Open.svg +3 -0
  263. package/lib/assets/img/svg/firstsetting/Square.svg +3 -0
  264. package/lib/assets/img/svg/firstsetting/bar-active.svg +9 -0
  265. package/lib/assets/img/svg/firstsetting/bar-normal.svg +3 -0
  266. package/lib/assets/img/svg/firstsetting/bullet-current.svg +3 -0
  267. package/lib/assets/img/svg/firstsetting/bullet-done.svg +3 -0
  268. package/lib/assets/img/svg/firstsetting/bullet-not-done.svg +3 -0
  269. package/lib/assets/img/svg/firstsetting/check-active.svg +3 -0
  270. package/lib/assets/img/svg/firstsetting/check-normal.svg +3 -0
  271. package/lib/assets/img/svg/firstsetting/pencil.svg +11 -0
  272. package/lib/assets/img/svg/green_checkmark.svg +27 -0
  273. package/lib/assets/img/svg/headerbar/assist.svg +3 -0
  274. package/lib/assets/img/svg/headerbar/cart.svg +3 -0
  275. package/lib/assets/img/svg/headerbar/check.svg +10 -0
  276. package/lib/assets/img/svg/headerbar/consult_designer.svg +45 -0
  277. package/lib/assets/img/svg/headerbar/edit_name.svg +26 -0
  278. package/lib/assets/img/svg/headerbar/file-dollar.svg +13 -0
  279. package/lib/assets/img/svg/headerbar/hamburger_menu.svg +32 -0
  280. package/lib/assets/img/svg/headerbar/plus.svg +11 -0
  281. package/lib/assets/img/svg/headerbar/review_quote.svg +44 -0
  282. package/lib/assets/img/svg/headerbar/ruler-measure.svg +11 -0
  283. package/lib/assets/img/svg/headerbar/save.svg +3 -0
  284. package/lib/assets/img/svg/headerbar/setting.svg +75 -0
  285. package/lib/assets/img/svg/help/check.svg +10 -0
  286. package/lib/assets/img/svg/help/search.svg +76 -0
  287. package/lib/assets/img/svg/intro/1-start-with-floorplan-whole.svg +27 -0
  288. package/lib/assets/img/svg/intro/1-start-with-floorplan.svg +26 -0
  289. package/lib/assets/img/svg/intro/2-start-from-scratch-whole.svg +28 -0
  290. package/lib/assets/img/svg/intro/2-start-from-scratch.svg +27 -0
  291. package/lib/assets/img/svg/intro/3-retrieve-project-whole.svg +19 -0
  292. package/lib/assets/img/svg/intro/3-retrieve-project.svg +18 -0
  293. package/lib/assets/img/svg/invert.svg +127 -0
  294. package/lib/assets/img/svg/lefttoolbar/appliance-active.svg +13 -0
  295. package/lib/assets/img/svg/lefttoolbar/appliance.svg +13 -0
  296. package/lib/assets/img/svg/lefttoolbar/cabinet-active.svg +10 -0
  297. package/lib/assets/img/svg/lefttoolbar/cabinet-category.svg +3 -0
  298. package/lib/assets/img/svg/lefttoolbar/cabinet-one.svg +3 -0
  299. package/lib/assets/img/svg/lefttoolbar/cabinet.svg +10 -0
  300. package/lib/assets/img/svg/lefttoolbar/disigner_assistance.svg +89 -0
  301. package/lib/assets/img/svg/lefttoolbar/door-style-active.svg +20 -0
  302. package/lib/assets/img/svg/lefttoolbar/door-style.svg +20 -0
  303. package/lib/assets/img/svg/lefttoolbar/door.svg +12 -0
  304. package/lib/assets/img/svg/lefttoolbar/error_icon.svg +81 -0
  305. package/lib/assets/img/svg/lefttoolbar/finishing-active.svg +13 -0
  306. package/lib/assets/img/svg/lefttoolbar/finishing.svg +13 -0
  307. package/lib/assets/img/svg/lefttoolbar/reviewforquote-active.svg +86 -0
  308. package/lib/assets/img/svg/lefttoolbar/reviewforquote.svg +12 -0
  309. package/lib/assets/img/svg/lefttoolbar/room-shape-L.svg +3 -0
  310. package/lib/assets/img/svg/lefttoolbar/room-shape-active.svg +18 -0
  311. package/lib/assets/img/svg/lefttoolbar/room-shape-custom.svg +12 -0
  312. package/lib/assets/img/svg/lefttoolbar/room-shape-irregular.svg +3 -0
  313. package/lib/assets/img/svg/lefttoolbar/room-shape-open.svg +3 -0
  314. package/lib/assets/img/svg/lefttoolbar/room-shape-square.svg +3 -0
  315. package/lib/assets/img/svg/lefttoolbar/room-shape.svg +18 -0
  316. package/lib/assets/img/svg/lefttoolbar/search.svg +76 -0
  317. package/lib/assets/img/svg/lefttoolbar/view_more.svg +86 -0
  318. package/lib/assets/img/svg/lefttoolbar/warning_icon.svg +81 -0
  319. package/lib/assets/img/svg/lefttoolbar/window.svg +12 -0
  320. package/lib/assets/img/svg/logo.svg +11 -0
  321. package/lib/assets/img/svg/logo_with_text.svg +25 -0
  322. package/lib/assets/img/svg/menubar/login.svg +84 -0
  323. package/lib/assets/img/svg/menubar/my_projects.svg +85 -0
  324. package/lib/assets/img/svg/menubar/new_project.svg +110 -0
  325. package/lib/assets/img/svg/menubar/save_project.svg +84 -0
  326. package/lib/assets/img/svg/options.svg +3 -0
  327. package/lib/assets/img/svg/positioning.svg +3 -0
  328. package/lib/assets/img/svg/rotate.png +0 -0
  329. package/lib/assets/img/svg/rotate.svg +17 -0
  330. package/lib/assets/img/svg/rotate_object_clockwise.svg +26 -0
  331. package/lib/assets/img/svg/rotate_object_counterclockwise.svg +26 -0
  332. package/lib/assets/img/svg/toggleFilters.svg +19 -0
  333. package/lib/assets/img/svg/toolbar/add_appliances_active.svg +64 -0
  334. package/lib/assets/img/svg/toolbar/add_appliances_inactive.svg +52 -0
  335. package/lib/assets/img/svg/toolbar/add_button.svg +36 -0
  336. package/lib/assets/img/svg/toolbar/add_cabinets_active.svg +59 -0
  337. package/lib/assets/img/svg/toolbar/add_cabinets_inactive.svg +49 -0
  338. package/lib/assets/img/svg/toolbar/add_items_doors.svg +25 -0
  339. package/lib/assets/img/svg/toolbar/add_items_doorways.svg +24 -0
  340. package/lib/assets/img/svg/toolbar/add_items_refrigerator.svg +32 -0
  341. package/lib/assets/img/svg/toolbar/add_items_windows.svg +28 -0
  342. package/lib/assets/img/svg/toolbar/apply_button.svg +38 -0
  343. package/lib/assets/img/svg/toolbar/arrow-plus.svg +11 -0
  344. package/lib/assets/img/svg/toolbar/backsplash.svg +8 -0
  345. package/lib/assets/img/svg/toolbar/cancel_button.svg +37 -0
  346. package/lib/assets/img/svg/toolbar/consult_a_designer_button.svg +47 -0
  347. package/lib/assets/img/svg/toolbar/countertop.svg +7 -0
  348. package/lib/assets/img/svg/toolbar/dcm.png +0 -0
  349. package/lib/assets/img/svg/toolbar/dcm_off.svg +12 -0
  350. package/lib/assets/img/svg/toolbar/dcm_on.svg +474 -0
  351. package/lib/assets/img/svg/toolbar/delete_button.svg +37 -0
  352. package/lib/assets/img/svg/toolbar/download.svg +77 -0
  353. package/lib/assets/img/svg/toolbar/draw_custom_floor.svg +31 -0
  354. package/lib/assets/img/svg/toolbar/edit_button.svg +75 -0
  355. package/lib/assets/img/svg/toolbar/email_quote_button.svg +44 -0
  356. package/lib/assets/img/svg/toolbar/fbm.png +0 -0
  357. package/lib/assets/img/svg/toolbar/finishing_touches_active.svg +54 -0
  358. package/lib/assets/img/svg/toolbar/finishing_touches_inactive.svg +42 -0
  359. package/lib/assets/img/svg/toolbar/floorstyle.svg +9 -0
  360. package/lib/assets/img/svg/toolbar/fmb.png +0 -0
  361. package/lib/assets/img/svg/toolbar/fmb_off.svg +12 -0
  362. package/lib/assets/img/svg/toolbar/fmb_on.svg +489 -0
  363. package/lib/assets/img/svg/toolbar/furnishings_icon.svg +6 -0
  364. package/lib/assets/img/svg/toolbar/get_started_button.svg +41 -0
  365. package/lib/assets/img/svg/toolbar/handles.svg +5 -0
  366. package/lib/assets/img/svg/toolbar/lighting.svg +7 -0
  367. package/lib/assets/img/svg/toolbar/lrm.png +0 -0
  368. package/lib/assets/img/svg/toolbar/lrm_off.svg +12 -0
  369. package/lib/assets/img/svg/toolbar/lrm_on.svg +470 -0
  370. package/lib/assets/img/svg/toolbar/make_floorplan_active.svg +66 -0
  371. package/lib/assets/img/svg/toolbar/make_floorplan_inactive.svg +52 -0
  372. package/lib/assets/img/svg/toolbar/predefined_room_l_shaped.svg +20 -0
  373. package/lib/assets/img/svg/toolbar/predefined_room_layout.svg +20 -0
  374. package/lib/assets/img/svg/toolbar/predefined_room_long_narrow.svg +20 -0
  375. package/lib/assets/img/svg/toolbar/predefined_room_open_l_shape.svg +20 -0
  376. package/lib/assets/img/svg/toolbar/predefined_room_open_pentagon.svg +20 -0
  377. package/lib/assets/img/svg/toolbar/predefined_room_open_rectangle.svg +20 -0
  378. package/lib/assets/img/svg/toolbar/predefined_room_open_rectangle_2.svg +20 -0
  379. package/lib/assets/img/svg/toolbar/predefined_room_pentagon.svg +20 -0
  380. package/lib/assets/img/svg/toolbar/predefined_room_rectangle.svg +20 -0
  381. package/lib/assets/img/svg/toolbar/predefined_room_rectangle_with_alcove.svg +20 -0
  382. package/lib/assets/img/svg/toolbar/redo_button.svg +75 -0
  383. package/lib/assets/img/svg/toolbar/redo_button1.svg +75 -0
  384. package/lib/assets/img/svg/toolbar/review_quote_active.svg +14 -0
  385. package/lib/assets/img/svg/toolbar/review_quote_inactive.svg +44 -0
  386. package/lib/assets/img/svg/toolbar/save_project_button.svg +44 -0
  387. package/lib/assets/img/svg/toolbar/select_doorstyle_active.svg +67 -0
  388. package/lib/assets/img/svg/toolbar/select_doorstyle_inactive.svg +57 -0
  389. package/lib/assets/img/svg/toolbar/shopping-cart.svg +13 -0
  390. package/lib/assets/img/svg/toolbar/style_change_button.svg +47 -0
  391. package/lib/assets/img/svg/toolbar/take_picture.svg +75 -0
  392. package/lib/assets/img/svg/toolbar/undo_button.svg +76 -0
  393. package/lib/assets/img/svg/toolbar/undo_button1.svg +76 -0
  394. package/lib/assets/img/svg/toolbar/use_button.svg +37 -0
  395. package/lib/assets/img/svg/toolbar/wall_color_icon.svg +6 -0
  396. package/lib/assets/img/svg/topbar/edit_active.svg +10 -0
  397. package/lib/assets/img/svg/topbar/edit_inactive.svg +10 -0
  398. package/lib/assets/img/svg/topbar/redo_active.svg +42 -0
  399. package/lib/assets/img/svg/topbar/redo_inactive.svg +23 -0
  400. package/lib/assets/img/svg/topbar/select_all_active.svg +50 -0
  401. package/lib/assets/img/svg/topbar/select_all_inactive.svg +32 -0
  402. package/lib/assets/img/svg/topbar/take_picture_active.svg +51 -0
  403. package/lib/assets/img/svg/topbar/take_picture_inactive.svg +26 -0
  404. package/lib/assets/img/svg/topbar/undo_active.svg +42 -0
  405. package/lib/assets/img/svg/topbar/undo_inactive.svg +23 -0
  406. package/lib/assets/img/svg/warning_info_2d.svg +81 -0
  407. package/lib/assets/img/svg/window/Clear.svg +3 -0
  408. package/lib/assets/img/svg/window/Cross.svg +5 -0
  409. package/lib/assets/img/svg/window/Double_hung.svg +4 -0
  410. package/lib/assets/img/svg/window/Vertical.svg +4 -0
  411. package/lib/assets/img/svg/windows_clear.svg +23 -0
  412. package/lib/assets/img/svg/windows_cross.svg +28 -0
  413. package/lib/assets/img/svg/windows_double_hung.svg +24 -0
  414. package/lib/assets/img/svg/windows_vertical.svg +24 -0
  415. package/lib/assets/img/svg/wizardstep/Custom.svg +3 -0
  416. package/lib/assets/img/svg/wizardstep/Dashed_line.svg +3 -0
  417. package/lib/assets/img/svg/wizardstep/L.svg +3 -0
  418. package/lib/assets/img/svg/wizardstep/L2.svg +3 -0
  419. package/lib/assets/img/svg/wizardstep/Open.svg +3 -0
  420. package/lib/assets/img/svg/wizardstep/Square.svg +3 -0
  421. package/lib/assets/img/svg/wizardstep/bar-active.svg +9 -0
  422. package/lib/assets/img/svg/wizardstep/bar-normal.svg +3 -0
  423. package/lib/assets/img/svg/wizardstep/bullet-current.svg +3 -0
  424. package/lib/assets/img/svg/wizardstep/bullet-done.svg +3 -0
  425. package/lib/assets/img/svg/wizardstep/bullet-not-done.svg +3 -0
  426. package/lib/assets/img/svg/wizardstep/check-active.svg +3 -0
  427. package/lib/assets/img/svg/wizardstep/check-normal.svg +3 -0
  428. package/lib/assets/img/svg/wizardstep/detail_view.svg +87 -0
  429. package/lib/assets/img/svg/wizardstep/pencil.svg +11 -0
  430. package/lib/assets/img/svg/wizardstep/tile_view.svg +95 -0
  431. package/lib/assets/img/texture/glass.jpg +0 -0
  432. package/lib/assets/img/texture/steel.jpg +0 -0
  433. package/lib/assets/img/texture/white1px.jpg +0 -0
  434. package/lib/assets/img/texture/wood.jpg +0 -0
  435. package/lib/assets/model/DCM.bin +0 -0
  436. package/lib/assets/model/DCM.fbx +0 -0
  437. package/lib/assets/model/DCM.gltf +1 -0
  438. package/lib/assets/model/FBM.bin +0 -0
  439. package/lib/assets/model/FBM.fbx +0 -0
  440. package/lib/assets/model/FBM.gltf +1 -0
  441. package/lib/assets/model/LRM.bin +0 -0
  442. package/lib/assets/model/LRM.fbx +0 -0
  443. package/lib/assets/model/LRM.gltf +1 -0
  444. package/lib/assets/rtastore_logo.png +0 -0
  445. package/lib/catalog/areas/area/planner-element.js +53 -0
  446. package/lib/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
  447. package/lib/catalog/areas/area/textures/grass.jpg +0 -0
  448. package/lib/catalog/areas/area/textures/parquet.jpg +0 -0
  449. package/lib/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
  450. package/lib/catalog/areas/area/textures/tile1.jpg +0 -0
  451. package/lib/catalog/back.png +0 -0
  452. package/lib/catalog/catalog.js +270 -0
  453. package/lib/catalog/doors.png +0 -0
  454. package/lib/catalog/doorways.png +0 -0
  455. package/lib/catalog/envMap/nx.hdr +0 -0
  456. package/lib/catalog/envMap/ny.hdr +0 -0
  457. package/lib/catalog/envMap/nz.hdr +0 -0
  458. package/lib/catalog/envMap/px.hdr +0 -0
  459. package/lib/catalog/envMap/py.hdr +0 -0
  460. package/lib/catalog/envMap/pz.hdr +0 -0
  461. package/lib/catalog/export.js +1 -0
  462. package/lib/catalog/factories/area-factory-3d.js +187 -0
  463. package/lib/catalog/factories/area-factory.js +88 -0
  464. package/lib/catalog/factories/export.js +25 -0
  465. package/lib/catalog/factories/wall-factory-3d.js +212 -0
  466. package/lib/catalog/factories/wall-factory.js +279 -0
  467. package/lib/catalog/holes/door-closet/planner-element.js +232 -0
  468. package/lib/catalog/holes/door-double/door_double.png +0 -0
  469. package/lib/catalog/holes/door-double/planner-element.js +325 -0
  470. package/lib/catalog/holes/door-exterior/planner-element.js +225 -0
  471. package/lib/catalog/holes/door-interior/planner-element.js +237 -0
  472. package/lib/catalog/holes/door-panic/panicDoor.png +0 -0
  473. package/lib/catalog/holes/door-panic/planner-element.js +513 -0
  474. package/lib/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
  475. package/lib/catalog/holes/door-panic-double/planner-element.js +473 -0
  476. package/lib/catalog/holes/door-sliding/planner-element.js +235 -0
  477. package/lib/catalog/holes/doorway-framed/planner-element.js +155 -0
  478. package/lib/catalog/holes/doorway-frameless/planner-element.js +114 -0
  479. package/lib/catalog/holes/export.js +97 -0
  480. package/lib/catalog/holes/gate/gate.jpg +0 -0
  481. package/lib/catalog/holes/window-clear/planner-element.js +176 -0
  482. package/lib/catalog/holes/window-clear/texture.png +0 -0
  483. package/lib/catalog/holes/window-cross/planner-element.js +175 -0
  484. package/lib/catalog/holes/window-cross/texture.png +0 -0
  485. package/lib/catalog/holes/window-double-hung/planner-element.js +313 -0
  486. package/lib/catalog/holes/window-double-hung/texture.png +0 -0
  487. package/lib/catalog/holes/window-vertical/planner-element.js +286 -0
  488. package/lib/catalog/holes/window-vertical/texture.png +0 -0
  489. package/lib/catalog/lines/wall/planner-element.js +87 -0
  490. package/lib/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
  491. package/lib/catalog/lines/wall/textures/bricks.jpg +0 -0
  492. package/lib/catalog/lines/wall/textures/bricks2.jpg +0 -0
  493. package/lib/catalog/lines/wall/textures/morden-normal.jpg +0 -0
  494. package/lib/catalog/lines/wall/textures/morden.jpg +0 -0
  495. package/lib/catalog/lines/wall/textures/painted.jpg +0 -0
  496. package/lib/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
  497. package/lib/catalog/lines/wall/textures/plaster.jpg +0 -0
  498. package/lib/catalog/lines/wall/wall.png +0 -0
  499. package/lib/catalog/molding/molding-dcm/planner-element.js +33 -0
  500. package/lib/catalog/molding/molding-dcm/texture.png +0 -0
  501. package/lib/catalog/molding/molding-fbm/planner-element.js +33 -0
  502. package/lib/catalog/molding/molding-fbm/texture.png +0 -0
  503. package/lib/catalog/molding/molding-lrm/planner-element.js +33 -0
  504. package/lib/catalog/molding/molding-lrm/texture.png +0 -0
  505. package/lib/catalog/utils/exporter.js +173 -0
  506. package/lib/catalog/utils/geom-utils.js +205 -0
  507. package/lib/catalog/utils/item-loader.js +1597 -0
  508. package/lib/catalog/utils/load-obj.js +99 -0
  509. package/lib/catalog/utils/mtl-loader.js +366 -0
  510. package/lib/catalog/utils/obj-loader.js +486 -0
  511. package/lib/catalog/windows.png +0 -0
  512. package/lib/class/area.js +147 -0
  513. package/lib/class/export.js +88 -0
  514. package/lib/class/group.js +438 -0
  515. package/lib/class/guide.js +64 -0
  516. package/lib/class/hole.js +930 -0
  517. package/lib/class/item.js +1985 -0
  518. package/lib/class/layer.js +670 -0
  519. package/lib/class/line.js +1238 -0
  520. package/lib/class/project.js +949 -0
  521. package/lib/class/vertex.js +205 -0
  522. package/lib/components/content.js +148 -0
  523. package/lib/components/export.js +7 -0
  524. package/lib/components/style/export.js +17 -0
  525. package/lib/components/style/form-number-input.js +192 -0
  526. package/lib/components/style/form-submit-button.js +35 -0
  527. package/lib/components/viewer2d/area.js +89 -0
  528. package/lib/components/viewer2d/export.js +121 -0
  529. package/lib/components/viewer2d/grids/grid-horizontal-streak.js +44 -0
  530. package/lib/components/viewer2d/grids/grid-streak.js +44 -0
  531. package/lib/components/viewer2d/grids/grid-vertical-streak.js +44 -0
  532. package/lib/components/viewer2d/grids/grids.js +40 -0
  533. package/lib/components/viewer2d/group.js +63 -0
  534. package/lib/components/viewer2d/item.js +245 -0
  535. package/lib/components/viewer2d/layer.js +172 -0
  536. package/lib/components/viewer2d/line.js +975 -0
  537. package/lib/components/viewer2d/ruler.js +92 -0
  538. package/lib/components/viewer2d/rulerDist.js +110 -0
  539. package/lib/components/viewer2d/rulerX.js +154 -0
  540. package/lib/components/viewer2d/rulerY.js +156 -0
  541. package/lib/components/viewer2d/scene.js +137 -0
  542. package/lib/components/viewer2d/snap.js +84 -0
  543. package/lib/components/viewer2d/state.js +83 -0
  544. package/lib/components/viewer2d/utils.js +207 -0
  545. package/lib/components/viewer2d/vertex.js +76 -0
  546. package/lib/components/viewer2d/viewer2d.js +1472 -0
  547. package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +2591 -0
  548. package/lib/components/viewer3d/dcm.js +408 -0
  549. package/lib/components/viewer3d/fbm.js +421 -0
  550. package/lib/components/viewer3d/front3D.js +71 -0
  551. package/lib/components/viewer3d/grid-creator.js +35 -0
  552. package/lib/components/viewer3d/grids/grid-horizontal-streak.js +45 -0
  553. package/lib/components/viewer3d/grids/grid-streak.js +36 -0
  554. package/lib/components/viewer3d/grids/grid-vertical-streak.js +45 -0
  555. package/lib/components/viewer3d/libs/first-person-controls.js +74 -0
  556. package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +1287 -0
  557. package/lib/components/viewer3d/libs/mtl-loader.js +366 -0
  558. package/lib/components/viewer3d/libs/obj-loader.js +471 -0
  559. package/lib/components/viewer3d/libs/orbit-controls.js +706 -0
  560. package/lib/components/viewer3d/libs/pointer-lock-controls.js +53 -0
  561. package/lib/components/viewer3d/lrm.js +312 -0
  562. package/lib/components/viewer3d/model.js +714 -0
  563. package/lib/components/viewer3d/pointer-lock-navigation.js +32 -0
  564. package/lib/components/viewer3d/ruler-utils/itemRect.js +69 -0
  565. package/lib/components/viewer3d/ruler-utils/layer3D.js +503 -0
  566. package/lib/components/viewer3d/ruler-utils/ruler3D.js +232 -0
  567. package/lib/components/viewer3d/ruler-utils/scene3D.js +67 -0
  568. package/lib/components/viewer3d/ruler-utils/state3D.js +26 -0
  569. package/lib/components/viewer3d/scene-creator.js +3886 -0
  570. package/lib/components/viewer3d/three-memory-cleaner.js +46 -0
  571. package/lib/components/viewer3d/viewer3d-first-person.js +316 -0
  572. package/lib/components/viewer3d/viewer3d.js +2676 -0
  573. package/lib/constants/catalog/skinPanel.js +15 -0
  574. package/lib/constants.js +790 -0
  575. package/lib/devLiteRenderer.js +903 -0
  576. package/lib/events/external/handleExternalEvent.js +147 -0
  577. package/lib/events/external/handleExternalEvent.util.js +1127 -0
  578. package/lib/events/external/handlers.addItem.js +54 -0
  579. package/lib/events/external/handlers.changeDoorStyle.js +146 -0
  580. package/lib/events/external/handlers.elementOps.js +15 -0
  581. package/lib/events/external/handlers.finishing.js +32 -0
  582. package/lib/events/external/handlers.hole.js +10 -0
  583. package/lib/events/external/handlers.loadProject.js +135 -0
  584. package/lib/events/external/handlers.molding.js +31 -0
  585. package/lib/events/external/handlers.projectLifecycle.js +19 -0
  586. package/lib/events/external/handlers.projectSettings.js +38 -0
  587. package/lib/events/external/handlers.replaceCabinet.js +48 -0
  588. package/lib/events/external/handlers.roomShape.js +14 -0
  589. package/lib/events/external/handlers.syncScene.js +27 -0
  590. package/lib/events/external/handlers.updateSelectedElements.js +17 -0
  591. package/lib/events/external/handlers.viewMode.js +19 -0
  592. package/lib/events/external/handlers.viewerNavigation.js +117 -0
  593. package/lib/events/external/handlers.wall.js +13 -0
  594. package/lib/index.js +637 -0
  595. package/lib/mappings/external-events/mapExternalEventPayload.js +33 -0
  596. package/lib/mappings/external-events/mappers/addItemMapper.js +101 -0
  597. package/lib/mappings/external-events/mappers/ccdfMapper.js +93 -0
  598. package/lib/mappings/external-events/mappers/ccdfToCDSMapper.js +37 -0
  599. package/lib/mappings/external-events/mappers/changeDoorStyleMapper.js +44 -0
  600. package/lib/mappings/external-events/mappers/loadProjectMapper.js +70 -0
  601. package/lib/mappings/holesToCatalog.js +148 -0
  602. package/lib/models.js +534 -0
  603. package/lib/plugins/SVGLoader.js +1419 -0
  604. package/lib/plugins/console-debugger.js +42 -0
  605. package/lib/plugins/export.js +25 -0
  606. package/lib/plugins/keyboard.js +117 -0
  607. package/lib/reducers/areas-reducer.js +19 -0
  608. package/lib/reducers/export.js +89 -0
  609. package/lib/reducers/groups-reducer.js +45 -0
  610. package/lib/reducers/holes-reducer.js +69 -0
  611. package/lib/reducers/items-reducer.js +152 -0
  612. package/lib/reducers/lines-reducer.js +52 -0
  613. package/lib/reducers/project-reducer.js +143 -0
  614. package/lib/reducers/reducer.js +25 -0
  615. package/lib/reducers/scene-reducer.js +35 -0
  616. package/lib/reducers/vertices-reducer.js +26 -0
  617. package/lib/reducers/viewer2d-reducer.js +84 -0
  618. package/lib/reducers/viewer3d-reducer.js +65 -0
  619. package/lib/shared/objects/immutable.js +9 -0
  620. package/lib/shared-style.js +72 -0
  621. package/lib/translator/en.js +111 -0
  622. package/lib/translator/it.js +86 -0
  623. package/lib/translator/ru.js +86 -0
  624. package/lib/translator/translator.js +87 -0
  625. package/lib/utils/browser.js +40 -0
  626. package/lib/utils/convert-units-lite.js +44 -0
  627. package/lib/utils/email-validator.js +10 -0
  628. package/lib/utils/export.js +56 -0
  629. package/lib/utils/geometry.js +3233 -0
  630. package/lib/utils/get-edges-of-subgraphs.js +33 -0
  631. package/lib/utils/graph-cycles.js +239 -0
  632. package/lib/utils/graph-inner-cycles.js +54 -0
  633. package/lib/utils/graph.js +153 -0
  634. package/lib/utils/helper.js +490 -0
  635. package/lib/utils/history.js +48 -0
  636. package/lib/utils/id-broker.js +22 -0
  637. package/lib/utils/logger.js +14 -0
  638. package/lib/utils/math.js +57 -0
  639. package/lib/utils/molding.js +1146 -0
  640. package/lib/utils/name-generator.js +21 -0
  641. package/lib/utils/objects-utils.js +62 -0
  642. package/lib/utils/phone-validator.js +10 -0
  643. package/lib/utils/process-black-list.js +22 -0
  644. package/lib/utils/react-if.js +25 -0
  645. package/lib/utils/ruler.js +63 -0
  646. package/lib/utils/skinPanelEngine.js +534 -0
  647. package/lib/utils/snap-scene.js +101 -0
  648. package/lib/utils/snap.js +245 -0
  649. package/lib/utils/summarizeCart.js +30 -0
  650. package/lib/utils/threeCSG.es6.js +504 -0
  651. package/lib/version.js +7 -0
  652. package/package.json +29 -24
  653. package/es/WorkSpace.js +0 -30
  654. package/es/WorkSpaceHostMimic.js +0 -132
  655. package/es/assets/gltf/door_closet.bin +0 -0
  656. package/es/assets/gltf/door_closet.fbx +0 -0
  657. package/es/assets/gltf/door_exterior.bin +0 -0
  658. package/es/assets/gltf/door_exterior.fbx +0 -0
  659. package/es/assets/gltf/door_interior.bin +0 -0
  660. package/es/assets/gltf/door_interior.fbx +0 -0
  661. package/es/assets/gltf/door_sliding.bin +0 -0
  662. package/es/assets/gltf/door_sliding.fbx +0 -0
  663. package/es/assets/img/png/helper/video_preview_3d.png +0 -0
  664. package/es/assets/img/png/helper/video_preview_start.png +0 -0
  665. package/es/assets/img/svg/color/Brown.svg +0 -9
  666. package/es/assets/img/svg/color/Dark.svg +0 -9
  667. package/es/assets/img/svg/color/Light.svg +0 -9
  668. package/es/assets/img/svg/color/Medium.svg +0 -9
  669. package/es/assets/img/svg/color/Unfinished.svg +0 -9
  670. package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
  671. package/es/catalog/properties/export.js +0 -21
  672. package/es/catalog/properties/property-checkbox.js +0 -68
  673. package/es/catalog/properties/property-color.js +0 -39
  674. package/es/catalog/properties/property-enum.js +0 -50
  675. package/es/catalog/properties/property-hidden.js +0 -19
  676. package/es/catalog/properties/property-lenght-measure.js +0 -96
  677. package/es/catalog/properties/property-length-measure.js +0 -80
  678. package/es/catalog/properties/property-length-measure_hole.js +0 -96
  679. package/es/catalog/properties/property-number.js +0 -48
  680. package/es/catalog/properties/property-read-only.js +0 -26
  681. package/es/catalog/properties/property-string.js +0 -48
  682. package/es/catalog/properties/property-toggle.js +0 -39
  683. package/es/catalog/properties/shared-property-style.js +0 -14
  684. package/es/catalog/utils/FuseUtils.js +0 -79
  685. package/es/class/FuseUtils.js +0 -79
  686. package/es/components/style/button.js +0 -106
  687. package/es/components/style/cancel-button.js +0 -21
  688. package/es/components/style/content-container.js +0 -30
  689. package/es/components/style/content-title.js +0 -25
  690. package/es/components/style/delete-button.js +0 -24
  691. package/es/components/style/form-block.js +0 -20
  692. package/es/components/style/form-color-input.js +0 -26
  693. package/es/components/style/form-label.js +0 -22
  694. package/es/components/style/form-number-input_2.js +0 -238
  695. package/es/components/style/form-select.js +0 -19
  696. package/es/components/style/form-slider.js +0 -60
  697. package/es/components/style/form-text-input.js +0 -69
  698. package/es/index.html.ejs +0 -264
  699. package/es/reducers/user-reducer.js +0 -41
  700. /package/{es/catalog/lines/wall/textures/bricks-normal2.jpg → lib/catalog/lines/wall/textures/painted-normal.jpg} +0 -0
@@ -719,6 +719,7 @@ export function getAllItems(scene, catalog, allLineRects) {
719
719
  }
720
720
  export function getAllItemSpecified(scene, catalog, filter) {
721
721
  var _scene$layers, _scene$layers$get;
722
+ var snappedLineRect = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
722
723
  var layerID = scene === null || scene === void 0 ? void 0 : scene.selectedLayer;
723
724
  var layer = scene === null || scene === void 0 || (_scene$layers = scene.layers) === null || _scene$layers === void 0 || (_scene$layers$get = _scene$layers.get) === null || _scene$layers$get === void 0 ? void 0 : _scene$layers$get.call(_scene$layers, layerID);
724
725
  if (!layer || !layer.items) return {
@@ -759,12 +760,45 @@ export function getAllItemSpecified(scene, catalog, filter) {
759
760
  // Filter check
760
761
  if (Array.isArray(filter)) {
761
762
  if (info && !filter.includes(info.layoutpos)) return;
762
- } else if (info && (info.layoutpos !== filter || (cat === null || cat === void 0 ? void 0 : cat.type) === 'appliance' && ['Cook Top', 'Microwave'].includes(cat === null || cat === void 0 || (_cat$obj = cat.obj) === null || _cat$obj === void 0 ? void 0 : _cat$obj.category))) {
763
+ } else if ((info === null || info === void 0 ? void 0 : info.layoutpos) !== filter || isEmpty(cat) || (cat === null || cat === void 0 ? void 0 : cat.type) === 'appliance' && ['Cook Top', 'Microwave'].includes(cat === null || cat === void 0 || (_cat$obj = cat.obj) === null || _cat$obj === void 0 ? void 0 : _cat$obj.category)) {
763
764
  return;
764
765
  }
765
766
 
766
767
  // Current vs others
767
768
  var rect = getCalcRectFromItem3D(val);
769
+
770
+ // check current item is snapped to the [snappedLineRect]
771
+ if (!isEmpty(snappedLineRect)) {
772
+ var isSnapped = false;
773
+ var overlapList = [OVERLAP_INCLUDED, OVERLAP_SAME, OVERLAP_SOME];
774
+ for (var i = 0; i < (rect === null || rect === void 0 || (_rect$rect = rect.rect) === null || _rect$rect === void 0 ? void 0 : _rect$rect.length); i++) {
775
+ var _rect$rect;
776
+ if (isSnapped) break;
777
+ var curItemPt = rect.rect[i];
778
+ var nextItemPt = i === rect.rect.length - 1 ? rect.rect[0] : rect.rect[i + 1];
779
+ var srcLine = {
780
+ x1: curItemPt.x,
781
+ y1: curItemPt.y,
782
+ x2: nextItemPt.x,
783
+ y2: nextItemPt.y
784
+ };
785
+ for (var j = 0; j < (snappedLineRect === null || snappedLineRect === void 0 ? void 0 : snappedLineRect.length); j++) {
786
+ var curLineRectPt = snappedLineRect[j];
787
+ var nextLineRectPt = j === snappedLineRect.length - 1 ? snappedLineRect[0] : snappedLineRect[j + 1];
788
+ var destLine = {
789
+ x1: curLineRectPt.x,
790
+ y1: curLineRectPt.y,
791
+ x2: nextLineRectPt.x,
792
+ y2: nextLineRectPt.y
793
+ };
794
+ if (overlapList.includes(relationshipOfTwoOverlappedLines(srcLine, destLine).result)) {
795
+ isSnapped = true;
796
+ break;
797
+ }
798
+ }
799
+ }
800
+ if (!isSnapped) return;
801
+ }
768
802
  if (item.selected) {
769
803
  curiteminfo = rect;
770
804
  } else {
@@ -995,9 +1029,9 @@ export function getAllLines(layer) {
995
1029
  }
996
1030
  }
997
1031
  });
998
- allLines.splice(addIdx, 0, [vertices, thick]);
1032
+ allLines.splice(addIdx, 0, [vertices, thick, line.id]);
999
1033
  } else {
1000
- allLines.push([allAreaLines[i], thick]);
1034
+ allLines.push([allAreaLines[i], thick, line.id]);
1001
1035
  }
1002
1036
  });
1003
1037
  return allLines;
@@ -1039,7 +1073,9 @@ export function buildRectFromLines(layer, lines) {
1039
1073
  var y0 = vxys[1];
1040
1074
  var x1 = vxys[2];
1041
1075
  var y1 = vxys[3];
1042
- rect.push(getCalcRectFromLine(x0, y0, x1, y1, thick, layer));
1076
+ var rectLine = getCalcRectFromLine(x0, y0, x1, y1, thick, layer);
1077
+ rectLine.lineId = line.length > 2 ? line[2] : null;
1078
+ rect.push(rectLine);
1043
1079
  });
1044
1080
  return rect;
1045
1081
  }
@@ -2096,8 +2132,6 @@ export function relationshipOfTwoOverlappedLines2(srcLine, destLine) {
2096
2132
  };
2097
2133
  var line0 = [p1, p2].sort(comparator);
2098
2134
  var line1 = [p3, p4].sort(comparator);
2099
- var isReversedSrcLineDirection = false;
2100
- if (line0[0].x === srcLine.x2 && line0[0].y === srcLine.y2) isReversedSrcLineDirection = true;
2101
2135
  var _sort3 = [line0, line1].sort(function (lineA, lineB) {
2102
2136
  return comparator(lineA[0], lineB[0]);
2103
2137
  }),
@@ -2105,101 +2139,305 @@ export function relationshipOfTwoOverlappedLines2(srcLine, destLine) {
2105
2139
  lineSX = _sort4[0],
2106
2140
  lineDX = _sort4[1];
2107
2141
  var isReversedSrcLineIdx = false;
2108
- if (lineSX[0].x === line0[0].x && lineSX[0].y === line0[0].y) isReversedSrcLineIdx = false;else if (lineSX[0].x === line1[0].x && lineSX[0].y === line1[0].y) isReversedSrcLineIdx = true;
2109
- var compare0 = comparator(lineSX[0], lineDX[0]);
2142
+ if (lineSX[0].x === line0[0].x && lineSX[0].y === line0[0].y) isReversedSrcLineIdx = false; // SX=srcLine, DX=destLine
2143
+ else if (lineSX[0].x === line1[0].x && lineSX[0].y === line1[0].y) isReversedSrcLineIdx = true; // DX=srcLine, SX=destLine
2144
+
2145
+ var compare0 = comparator(lineSX[0], lineDX[0]); // always <= 0
2110
2146
  var compare1 = comparator(lineSX[1], lineDX[0]);
2111
2147
  var compare2 = comparator(lineSX[1], lineDX[1]);
2112
- if (MathUtils.fAbs(compare0) < EPSILON && MathUtils.fAbs(compare2) < EPSILON) {
2113
- return {
2114
- result: OVERLAP_SAME
2115
- };
2116
- } else if (MathUtils.fAbs(compare0) < EPSILON && compare2 < 0) {
2117
- // lineDX includes lineSX
2118
- if (!isReversedSrcLineIdx) {
2119
- // dest === lineDX : dest includes src
2120
- // return OVERLAP_INCLUDED; // lineSX[1] - lineDX[1]
2121
- return {
2122
- result: OVERLAP_INCLUDED
2148
+ var sp = null,
2149
+ ep = null;
2150
+ if (MathUtils.fAbs(compare1) < EPSILON) {
2151
+ // SX
2152
+ // |----------|
2153
+ // DX
2154
+ // |------------|
2155
+ // link : lineSX[0] - lineDX[1]
2156
+ if (lineSX[0].x === p1.x && lineSX[0].y === p1.y || lineDX[1].x === p2.x && lineDX[1].y === p2.y) {
2157
+ sp = {
2158
+ x: lineSX[0].x,
2159
+ y: lineSX[0].y
2160
+ };
2161
+ ep = {
2162
+ x: lineDX[1].x,
2163
+ y: lineDX[1].y
2164
+ };
2165
+ } else {
2166
+ // srcLine Direction is reversed
2167
+ sp = {
2168
+ x: lineDX[1].x,
2169
+ y: lineDX[1].y
2170
+ };
2171
+ ep = {
2172
+ x: lineSX[0].x,
2173
+ y: lineSX[0].y
2123
2174
  };
2124
2175
  }
2125
- // else {
2126
- // // src includes dest
2127
- // // return OVERLAP_SOME; // lineSX[1] - lineDX[1]
2128
- // return {
2129
- // result: OVERLAP_SOME,
2130
- // trimmedSegs: {
2131
- // x1: lineSX[1].x,
2132
- // y1: lineSX[1].y,
2133
- // x2: lineDX[1].x,
2134
- // y2: lineDX[1].y
2135
- // }
2136
- // };
2137
- // }
2138
- }
2139
- if (MathUtils.fAbs(compare1) < EPSILON) {
2140
- // return OVERLAP_LINK; // lineSX[1]
2141
2176
  return {
2142
2177
  result: OVERLAP_LINK,
2143
2178
  linkedLine: {
2144
- x1: isReversedSrcLineDirection ? lineDX[1].x : lineSX[0].x,
2145
- y1: isReversedSrcLineDirection ? lineDX[1].y : lineSX[0].y,
2146
- x2: isReversedSrcLineDirection ? lineSX[0].x : lineDX[1].x,
2147
- y2: isReversedSrcLineDirection ? lineSX[0].y : lineDX[1].y
2179
+ x1: sp.x,
2180
+ y1: sp.y,
2181
+ x2: ep.x,
2182
+ y2: ep.y
2148
2183
  }
2149
2184
  };
2150
2185
  } else if (compare1 < 0) {
2186
+ // SX
2187
+ // |----------|
2188
+ // DX
2189
+ // |----------|
2190
+ // none
2151
2191
  return {
2152
2192
  result: OVERLAP_NONE
2153
2193
  };
2154
- } else {
2155
- if (MathUtils.fAbs(compare2) < EPSILON || compare2 > 0) {
2156
- // lineSX includes lineDX
2157
- if (isReversedSrcLineIdx) {
2158
- // dest === lineSX : dest includes src
2159
- // return OVERLAP_INCLUDED; // lineDX[0] - lineDX[1]
2194
+ } else if (MathUtils.fAbs(compare0) < EPSILON && MathUtils.fAbs(compare2) < EPSILON) {
2195
+ // SX
2196
+ // |----------|
2197
+ // DX
2198
+ // |----------|
2199
+ return {
2200
+ result: OVERLAP_SAME
2201
+ };
2202
+ } else if (MathUtils.fAbs(compare0) < EPSILON) {
2203
+ if (compare2 < 0 && isReversedSrcLineIdx) {
2204
+ // SX
2205
+ // |---------------|
2206
+ // DX
2207
+ // |-----------------------|
2208
+ // DX includes SX, DX=srcLine, SX=destLine : sx1 - dx1
2209
+ if (lineDX[1].x === p2.x && lineDX[1].y === p2.y) {
2210
+ sp = {
2211
+ x: lineSX[1].x,
2212
+ y: lineSX[1].y
2213
+ };
2214
+ ep = {
2215
+ x: lineDX[1].x,
2216
+ y: lineDX[1].y
2217
+ };
2218
+ } else {
2219
+ // srcLine Direction is reversed
2220
+ sp = {
2221
+ x: lineDX[1].x,
2222
+ y: lineDX[1].y
2223
+ };
2224
+ ep = {
2225
+ x: lineSX[1].x,
2226
+ y: lineSX[1].y
2227
+ };
2228
+ }
2229
+ return {
2230
+ result: OVERLAP_SOME,
2231
+ trimmedSegs: [{
2232
+ x1: sp.x,
2233
+ y1: sp.y,
2234
+ x2: ep.x,
2235
+ y2: ep.y
2236
+ }]
2237
+ };
2238
+ } else if (compare2 > 0 && !isReversedSrcLineIdx) {
2239
+ // SX
2240
+ // |-----------------------|
2241
+ // DX
2242
+ // |---------------|
2243
+ // SX includes DX, SX=srcLine, DX=destLine : dx1 - sx1
2244
+ if (lineSX[1].x === p2.x && lineSX[1].y === p2.y) {
2245
+ sp = {
2246
+ x: lineDX[1].x,
2247
+ y: lineDX[1].y
2248
+ };
2249
+ ep = {
2250
+ x: lineSX[1].x,
2251
+ y: lineSX[1].y
2252
+ };
2253
+ } else {
2254
+ // srcLine Direction is reversed
2255
+ sp = {
2256
+ x: lineSX[1].x,
2257
+ y: lineSX[1].y
2258
+ };
2259
+ ep = {
2260
+ x: lineDX[1].x,
2261
+ y: lineDX[1].y
2262
+ };
2263
+ }
2264
+ return {
2265
+ result: OVERLAP_SOME,
2266
+ trimmedSegs: [{
2267
+ x1: sp.x,
2268
+ y1: sp.y,
2269
+ x2: ep.x,
2270
+ y2: ep.y
2271
+ }]
2272
+ };
2273
+ } else {
2274
+ // srcLine
2275
+ // |---------------|
2276
+ // destLine
2277
+ // |-----------------------|
2278
+ // destLine includes srcLine
2279
+ return {
2280
+ result: OVERLAP_INCLUDED
2281
+ };
2282
+ }
2283
+ } else if (MathUtils.fAbs(compare2) < EPSILON) {
2284
+ // SX
2285
+ // |-----------------------|
2286
+ // DX
2287
+ // |------------------|
2288
+ if (isReversedSrcLineIdx) {
2289
+ // SX includes DX, DX=srcLine, SX=destLine
2290
+ // destLine includes srcLine
2291
+ return {
2292
+ result: OVERLAP_INCLUDED
2293
+ };
2294
+ } else {
2295
+ // SX includes DX, SX=srcLine, DX=destLine
2296
+ // srcLine incluedes destLine : sx0 - dx0
2297
+ if (lineSX[1].x === p2.x && lineSX[1].y === p2.y) {
2298
+ sp = {
2299
+ x: lineSX[0].x,
2300
+ y: lineSX[0].y
2301
+ };
2302
+ ep = {
2303
+ x: lineDX[0].x,
2304
+ y: lineDX[0].y
2305
+ };
2306
+ } else {
2307
+ // srcLine direction is reversed
2308
+ sp = {
2309
+ x: lineDX[0].x,
2310
+ y: lineDX[0].y
2311
+ };
2312
+ ep = {
2313
+ x: lineSX[0].x,
2314
+ y: lineSX[0].y
2315
+ };
2316
+ }
2317
+ return {
2318
+ result: OVERLAP_SOME,
2319
+ trimmedSegs: [{
2320
+ x1: sp.x,
2321
+ y1: sp.y,
2322
+ x2: ep.x,
2323
+ y2: ep.y
2324
+ }]
2325
+ };
2326
+ }
2327
+ } else if (compare0 < 0 && compare2 > 0) {
2328
+ // SX
2329
+ // |-----------------------|
2330
+ // DX
2331
+ // |----------------|
2332
+ if (isReversedSrcLineIdx) {
2333
+ // SX includes DX, DX=srcLine, SX=destLine
2334
+ // destLine includes srcLine
2335
+ return {
2336
+ result: OVERLAP_INCLUDED
2337
+ };
2338
+ } else {
2339
+ // SX includes DX, SX=srcLine, DX=destLine
2340
+ // srcLine incluedes destLine : sx0 - dx0, dx1 - sx1
2341
+ if (lineSX[1].x === p2.x && lineSX[1].y === p2.y) {
2160
2342
  return {
2161
- result: OVERLAP_INCLUDED
2343
+ result: OVERLAP_SOME,
2344
+ trimmedSegs: [{
2345
+ x1: lineSX[0].x,
2346
+ y1: lineSX[0].y,
2347
+ x2: lineDX[0].x,
2348
+ y2: lineDX[0].y
2349
+ }, {
2350
+ x1: lineDX[1].x,
2351
+ y1: lineDX[1].y,
2352
+ x2: lineSX[1].x,
2353
+ y2: lineSX[1].y
2354
+ }]
2162
2355
  };
2163
2356
  } else {
2164
- // dest === lineDX : src includes dest
2165
- var trimmedSegs = [];
2166
- // return OVERLAP_SOME; // lineSX[0] - lineDX[0], lineDX[1] - lineSX[1]
2167
- if (compare0 < 0) trimmedSegs.push({
2168
- x1: isReversedSrcLineDirection ? lineDX[0].x : lineSX[0].x,
2169
- y1: isReversedSrcLineDirection ? lineDX[0].y : lineSX[0].y,
2170
- x2: isReversedSrcLineDirection ? lineSX[0].x : lineDX[0].x,
2171
- y2: isReversedSrcLineDirection ? lineSX[0].y : lineDX[0].y
2172
- });
2173
- if (compare2 > 0) trimmedSegs.push({
2174
- x1: isReversedSrcLineDirection ? lineSX[1].x : lineDX[1].x,
2175
- y1: isReversedSrcLineDirection ? lineSX[1].y : lineDX[1].y,
2176
- x2: isReversedSrcLineDirection ? lineDX[1].x : lineSX[1].x,
2177
- y2: isReversedSrcLineDirection ? lineDX[1].y : lineSX[1].y
2178
- });
2357
+ // srcLine direction is reversed
2179
2358
  return {
2180
2359
  result: OVERLAP_SOME,
2181
- trimmedSegs: trimmedSegs
2360
+ trimmedSegs: [{
2361
+ x1: lineDX[0].x,
2362
+ y1: lineDX[0].y,
2363
+ x2: lineSX[0].x,
2364
+ y2: lineSX[0].y
2365
+ }, {
2366
+ x1: lineSX[1].x,
2367
+ y1: lineSX[1].y,
2368
+ x2: lineDX[1].x,
2369
+ y2: lineDX[1].y
2370
+ }]
2182
2371
  };
2183
2372
  }
2184
2373
  }
2185
- if (compare2 < 0) {
2186
- // return OVERLAP_SOME; // lineSX[0] - lineDX[0], lineSX[1] - lineDX[1]
2187
- var _trimmedSegs = [];
2188
- if (compare0 < 0 && !isReversedSrcLineIdx) _trimmedSegs.push({
2189
- x1: isReversedSrcLineDirection ? lineDX[0].x : lineSX[0].x,
2190
- y1: isReversedSrcLineDirection ? lineDX[0].y : lineSX[0].y,
2191
- x2: isReversedSrcLineDirection ? lineSX[0].x : lineDX[0].x,
2192
- y2: isReversedSrcLineDirection ? lineSX[0].y : lineDX[0].y
2193
- });
2194
- if (compare2 < 0 && isReversedSrcLineIdx) _trimmedSegs.push({
2195
- x1: isReversedSrcLineDirection ? lineDX[1].x : lineSX[1].x,
2196
- y1: isReversedSrcLineDirection ? lineDX[1].y : lineSX[1].y,
2197
- x2: isReversedSrcLineDirection ? lineSX[1].x : lineDX[1].x,
2198
- y2: isReversedSrcLineDirection ? lineSX[1].y : lineDX[1].y
2199
- });
2374
+ } else if (compare2 < 0) {
2375
+ // SX
2376
+ // |-----------------------|
2377
+ // DX
2378
+ // |----------------------------|
2379
+ // overlap some
2380
+ if (isReversedSrcLineIdx) {
2381
+ // DX=srcLine, SX=destLine
2382
+ if (lineDX[1].x === p2.x && lineDX[1].y === p2.y) {
2383
+ sp = {
2384
+ x: lineSX[1].x,
2385
+ y: lineSX[1].y
2386
+ };
2387
+ ep = {
2388
+ x: lineDX[1].x,
2389
+ y: lineDX[1].y
2390
+ };
2391
+ } else {
2392
+ // srcLine direction is reversed
2393
+ sp = {
2394
+ x: lineDX[1].x,
2395
+ y: lineDX[1].y
2396
+ };
2397
+ ep = {
2398
+ x: lineSX[1].x,
2399
+ y: lineSX[1].y
2400
+ };
2401
+ }
2402
+ return {
2403
+ result: OVERLAP_SOME,
2404
+ trimmedSegs: [{
2405
+ x1: sp.x,
2406
+ y1: sp.y,
2407
+ x2: ep.x,
2408
+ y2: ep.y
2409
+ }]
2410
+ };
2411
+ } else {
2412
+ // SX=srcLine, DX=destLine
2413
+ if (lineSX[1].x === p2.x && lineSX[1].y === p2.y) {
2414
+ sp = {
2415
+ x: lineSX[0].x,
2416
+ y: lineSX[0].y
2417
+ };
2418
+ ep = {
2419
+ x: lineDX[0].x,
2420
+ y: lineDX[0].y
2421
+ };
2422
+ } else {
2423
+ // srcLine direction is reversed
2424
+ sp = {
2425
+ x: lineDX[0].x,
2426
+ y: lineDX[0].y
2427
+ };
2428
+ ep = {
2429
+ x: lineSX[0].x,
2430
+ y: lineSX[0].y
2431
+ };
2432
+ }
2200
2433
  return {
2201
2434
  result: OVERLAP_SOME,
2202
- trimmedSegs: _trimmedSegs
2435
+ trimmedSegs: [{
2436
+ x1: sp.x,
2437
+ y1: sp.y,
2438
+ x2: ep.x,
2439
+ y2: ep.y
2440
+ }]
2203
2441
  };
2204
2442
  }
2205
2443
  }
@@ -2606,4 +2844,286 @@ export function calcDistancesFromItemToWalls(curItem, layer) {
2606
2844
  return {
2607
2845
  PointArray: PointArray
2608
2846
  };
2847
+ }
2848
+ export function calcDistancesFromHoleToNearestOneOrWall(curHole, layer) {
2849
+ var _layer$lines, _layer$vertices2, _line$vertices, _layer$vertices3, _line$vertices2, _curHole$properties$g, _curHole$properties, _line$get;
2850
+ var distArray = {
2851
+ distLeft: 0,
2852
+ distRight: 0
2853
+ };
2854
+ if (isEmpty(curHole)) return distArray;
2855
+ /***** calculate Left & Right distance from nearest hole ******/
2856
+ // parent line of curHole
2857
+ var line = (_layer$lines = layer.lines) === null || _layer$lines === void 0 ? void 0 : _layer$lines.get(curHole.line);
2858
+ var v0 = (_layer$vertices2 = layer.vertices) === null || _layer$vertices2 === void 0 ? void 0 : _layer$vertices2.get(line === null || line === void 0 || (_line$vertices = line.vertices) === null || _line$vertices === void 0 ? void 0 : _line$vertices.get(0));
2859
+ var v1 = (_layer$vertices3 = layer.vertices) === null || _layer$vertices3 === void 0 ? void 0 : _layer$vertices3.get(line === null || line === void 0 || (_line$vertices2 = line.vertices) === null || _line$vertices2 === void 0 ? void 0 : _line$vertices2.get(1));
2860
+ var lineLength = pointsDistance(v0.x, v0.y, v1.x, v1.y);
2861
+ if (isEmpty(line) || isEmpty(v0) || isEmpty(v1)) return distArray;
2862
+ var angle = angleBetweenTwoPoints(v0.x, v0.y, v1.x, v1.y);
2863
+
2864
+ // start point and end point of current hole
2865
+ var chw = (_curHole$properties$g = (_curHole$properties = curHole.properties) === null || _curHole$properties === void 0 || (_curHole$properties = _curHole$properties.get('width')) === null || _curHole$properties === void 0 ? void 0 : _curHole$properties.get('length')) !== null && _curHole$properties$g !== void 0 ? _curHole$properties$g : 0;
2866
+ var chPt = {
2867
+ x: v0.x + lineLength * curHole.offset * Math.cos(angle),
2868
+ y: v0.y + lineLength * curHole.offset * Math.sin(angle)
2869
+ };
2870
+ var chsp = {
2871
+ x: chPt.x - chw / 2 * Math.cos(angle),
2872
+ y: chPt.y - chw / 2 * Math.sin(angle)
2873
+ };
2874
+ var chep = {
2875
+ x: chPt.x + chw / 2 * Math.cos(angle),
2876
+ y: chPt.y + chw / 2 * Math.sin(angle)
2877
+ };
2878
+ distArray.distLeft = pointsDistance(v0.x, v0.y, chsp.x, chsp.y);
2879
+ distArray.distRight = pointsDistance(v1.x, v1.y, chep.x, chep.y);
2880
+ (_line$get = line.get('holes')) === null || _line$get === void 0 || _line$get.forEach(function (hId) {
2881
+ if (hId !== curHole.id) {
2882
+ var _layer$holes, _hole$properties$get$, _hole$properties;
2883
+ var hole = (_layer$holes = layer.holes) === null || _layer$holes === void 0 ? void 0 : _layer$holes.get(hId);
2884
+ // start point and end point of other hole
2885
+ var hw = (_hole$properties$get$ = (_hole$properties = hole.properties) === null || _hole$properties === void 0 || (_hole$properties = _hole$properties.get('width')) === null || _hole$properties === void 0 ? void 0 : _hole$properties.get('length')) !== null && _hole$properties$get$ !== void 0 ? _hole$properties$get$ : 0;
2886
+ var hPt = {
2887
+ x: v0.x + lineLength * hole.offset * Math.cos(angle),
2888
+ y: v0.y + lineLength * hole.offset * Math.sin(angle)
2889
+ };
2890
+ var hsp = {
2891
+ x: hPt.x - hw / 2 * Math.cos(angle),
2892
+ y: hPt.y - hw / 2 * Math.sin(angle)
2893
+ };
2894
+ var hep = {
2895
+ x: hPt.x + hw / 2 * Math.cos(angle),
2896
+ y: hPt.y + hw / 2 * Math.sin(angle)
2897
+ };
2898
+ var relation = relationshipOfTwoOverlappedLines({
2899
+ x1: chsp.x,
2900
+ y1: chsp.y,
2901
+ x2: chep.x,
2902
+ y2: chep.y
2903
+ }, {
2904
+ x1: hsp.x,
2905
+ y1: hsp.y,
2906
+ x2: hep.x,
2907
+ y2: hep.y
2908
+ });
2909
+ // two holes(current hole and other hole) are not overlaped, then get distance
2910
+ if (relation.result === OVERLAP_NONE || relation.result === OVERLAP_LINK) {
2911
+ if (hole.offset < curHole.offset)
2912
+ // other hole is on the left side
2913
+ distArray.distLeft = Math.min(distArray.distLeft, pointsDistance(chsp.x, chsp.y, hep.x, hep.y));
2914
+ // other hole is on the right side
2915
+ else distArray.distRight = Math.min(distArray.distRight, pointsDistance(chep.x, chep.y, hsp.x, hsp.y));
2916
+ }
2917
+ }
2918
+ });
2919
+ return distArray;
2920
+ }
2921
+ export function getSnappedWallLines(item, layer, catalog) {
2922
+ var _element;
2923
+ var snappedWallLines = [];
2924
+ if (isEmpty(item)) return snappedWallLines;
2925
+ var vertexLines = getAllLines(layer);
2926
+ var rectLines = buildRectFromLines(layer, vertexLines);
2927
+ var outline = null;
2928
+ var element = catalog.elements[item.get('type')];
2929
+ if (!element) element = catalog.elements[returnReplaceableDeepSearchType(item.get('type'))];
2930
+ var newWidth = item.properties.get('width').get('_length');
2931
+ var wUnit = item.properties.get('width').get('_unit') || 'cm';
2932
+ newWidth = convert(newWidth).from(wUnit).to('cm');
2933
+ var newDepth = item.properties.get('depth').get('_length');
2934
+ var hUnit = item.properties.get('depth').get('_unit') || 'cm';
2935
+ newDepth = convert(newDepth).from(hUnit).to('cm');
2936
+ var overlapList = [OVERLAP_INCLUDED, OVERLAP_SAME, OVERLAP_SOME];
2937
+
2938
+ // Get Outline Data of Selected Item
2939
+ outline = (_element = element) === null || _element === void 0 || (_element = _element.info) === null || _element === void 0 ? void 0 : _element.outline;
2940
+ if (outline) {
2941
+ // Extract Points from `outline`
2942
+ var outlinePaths = outline.paths;
2943
+ var outlineWidth = outline.svgWidth;
2944
+ var outlineHeight = outline.svgHeight;
2945
+ var outlinePoints = []; // Hold Points Of SVG
2946
+ var _iterator7 = _createForOfIteratorHelper(outlinePaths),
2947
+ _step7;
2948
+ try {
2949
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
2950
+ var path = _step7.value;
2951
+ var _iterator8 = _createForOfIteratorHelper(path.subPaths),
2952
+ _step8;
2953
+ try {
2954
+ for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
2955
+ var subPath = _step8.value;
2956
+ outlinePoints = outlinePoints.concat(subPath.getPoints());
2957
+ }
2958
+ } catch (err) {
2959
+ _iterator8.e(err);
2960
+ } finally {
2961
+ _iterator8.f();
2962
+ }
2963
+ }
2964
+ } catch (err) {
2965
+ _iterator7.e(err);
2966
+ } finally {
2967
+ _iterator7.f();
2968
+ }
2969
+ outline.reverse && outlinePoints.reverse();
2970
+ for (var i = 0; i < outlinePoints.length - 1; i++) {
2971
+ var v0 = rotatePointAroundPoint((outlinePoints[i].x / outlineWidth - 0.5) * newWidth + item.x, (outlinePoints[i].y / outlineHeight - 0.5) * newDepth + item.y, item.x, item.y, item.rotation + 90);
2972
+ var v1 = rotatePointAroundPoint((outlinePoints[i + 1].x / outlineWidth - 0.5) * newWidth + item.x, (outlinePoints[i + 1].y / outlineHeight - 0.5) * newDepth + item.y, item.x, item.y, item.rotation + 90);
2973
+ var srcLine = {
2974
+ x1: v0.x,
2975
+ y1: v0.y,
2976
+ x2: v1.x,
2977
+ y2: v1.y
2978
+ };
2979
+ var _loop2 = function _loop2(j) {
2980
+ var destLine1 = {
2981
+ x1: rectLines[j].rect[2].x,
2982
+ y1: rectLines[j].rect[2].y,
2983
+ x2: rectLines[j].rect[3].x,
2984
+ y2: rectLines[j].rect[3].y
2985
+ };
2986
+ var destLine2 = {
2987
+ x1: rectLines[j].rect[0].x,
2988
+ y1: rectLines[j].rect[0].y,
2989
+ x2: rectLines[j].rect[1].x,
2990
+ y2: rectLines[j].rect[1].y
2991
+ };
2992
+ if (overlapList.includes(relationshipOfTwoOverlappedLines(srcLine, destLine1).result) || overlapList.includes(relationshipOfTwoOverlappedLines(srcLine, destLine2).result)) {
2993
+ var idx = snappedWallLines.findIndex(function (v) {
2994
+ return v.id === rectLines[j].lineId;
2995
+ });
2996
+ var snapSide = 'unknown';
2997
+ if (idx < 0) snappedWallLines.push({
2998
+ id: rectLines[j].lineId,
2999
+ lineRect: rectLines[j].rect,
3000
+ snapSide: snapSide
3001
+ });else snappedWallLines[idx].snapSide = snapSide;
3002
+ }
3003
+ };
3004
+ for (var j = 0; j < (rectLines === null || rectLines === void 0 ? void 0 : rectLines.length); j++) {
3005
+ _loop2(j);
3006
+ }
3007
+ }
3008
+ } else {
3009
+ var pos = [[-1, -1], [1, -1], [1, 1], [-1, 1]];
3010
+ for (var _i = 0; _i < 4; _i++) {
3011
+ var _v = rotatePointAroundPoint(pos[_i][0] * newWidth / 2 + item.x, pos[_i][1] * newDepth / 2 + item.y, item.x, item.y, item.rotation);
3012
+ var _v2 = rotatePointAroundPoint(pos[(_i + 1) % 4][0] * newWidth / 2 + item.x, pos[(_i + 1) % 4][1] * newDepth / 2 + item.y, item.x, item.y, item.rotation);
3013
+ var _srcLine = {
3014
+ x1: _v.x,
3015
+ y1: _v.y,
3016
+ x2: _v2.x,
3017
+ y2: _v2.y
3018
+ };
3019
+ var _loop3 = function _loop3(_j) {
3020
+ var destLine1 = {
3021
+ x1: rectLines[_j].rect[2].x,
3022
+ y1: rectLines[_j].rect[2].y,
3023
+ x2: rectLines[_j].rect[3].x,
3024
+ y2: rectLines[_j].rect[3].y
3025
+ };
3026
+ var destLine2 = {
3027
+ x1: rectLines[_j].rect[0].x,
3028
+ y1: rectLines[_j].rect[0].y,
3029
+ x2: rectLines[_j].rect[1].x,
3030
+ y2: rectLines[_j].rect[1].y
3031
+ };
3032
+ if (overlapList.includes(relationshipOfTwoOverlappedLines(_srcLine, destLine1).result) || overlapList.includes(relationshipOfTwoOverlappedLines(_srcLine, destLine2).result)) {
3033
+ var idx = snappedWallLines.findIndex(function (v) {
3034
+ return v.id === rectLines[_j].lineId;
3035
+ });
3036
+ var snapSide = _i === 0 || _i === 2 ? 'front' : 'side';
3037
+ if (idx < 0) snappedWallLines.push({
3038
+ id: rectLines[_j].lineId,
3039
+ lineRect: rectLines[_j].rect,
3040
+ snapSide: snapSide
3041
+ });else snappedWallLines[idx].snapSide = snapSide;
3042
+ }
3043
+ };
3044
+ for (var _j = 0; _j < (rectLines === null || rectLines === void 0 ? void 0 : rectLines.length); _j++) {
3045
+ _loop3(_j);
3046
+ }
3047
+ }
3048
+ }
3049
+ return snappedWallLines;
3050
+ }
3051
+ export function getLineSnapPointsOfItem(layer, curLine, item) {
3052
+ var _layer$lines2, _layer$vertices4, _line$vertices3, _layer$vertices5, _line$vertices4;
3053
+ // V0
3054
+ // /|
3055
+ // D0 /|-----------|
3056
+ // /| |
3057
+ // /| Item | ====> get D0, D1
3058
+ // /| |
3059
+ // D1 /|-----------|
3060
+ // /|
3061
+ // get v0, v1 of line
3062
+ var line = (_layer$lines2 = layer.lines) === null || _layer$lines2 === void 0 ? void 0 : _layer$lines2.get(curLine === null || curLine === void 0 ? void 0 : curLine.id);
3063
+ var v0 = (_layer$vertices4 = layer.vertices) === null || _layer$vertices4 === void 0 ? void 0 : _layer$vertices4.get(line === null || line === void 0 || (_line$vertices3 = line.vertices) === null || _line$vertices3 === void 0 ? void 0 : _line$vertices3.get(0));
3064
+ var v1 = (_layer$vertices5 = layer.vertices) === null || _layer$vertices5 === void 0 ? void 0 : _layer$vertices5.get(line === null || line === void 0 || (_line$vertices4 = line.vertices) === null || _line$vertices4 === void 0 ? void 0 : _line$vertices4.get(1));
3065
+ var pointGroup = [];
3066
+ if (isEmpty(v0) || isEmpty(v1)) return pointGroup;
3067
+ var itemRect = item === null || item === void 0 ? void 0 : item.rect;
3068
+ if (!isEmpty(itemRect)) {
3069
+ for (var i = 0; i < itemRect.length; i++) {
3070
+ if (distancePointFromLineSegment(v0, v1, itemRect[i].x, itemRect[i].y) < EPSILON) {
3071
+ pointGroup.push(itemRect[i]);
3072
+ }
3073
+ }
3074
+ }
3075
+ return pointGroup;
3076
+ }
3077
+ export function isOverlappedTwoItemsOnOneLine(layer, curLine, srcItem, desItem) {
3078
+ var _layer$lines3, _layer$vertices6, _line$vertices5, _layer$vertices7, _line$vertices6, _S, _S2, _S3, _S4;
3079
+ if (isEmpty(layer) || isEmpty(curLine) || isEmpty(srcItem) || isEmpty(desItem) || isEmpty(desItem.D0) || isEmpty(desItem.D1)) return false;
3080
+ // get v0, v1 of line
3081
+ var line = (_layer$lines3 = layer.lines) === null || _layer$lines3 === void 0 ? void 0 : _layer$lines3.get(curLine === null || curLine === void 0 ? void 0 : curLine.id);
3082
+ var v0 = (_layer$vertices6 = layer.vertices) === null || _layer$vertices6 === void 0 ? void 0 : _layer$vertices6.get(line === null || line === void 0 || (_line$vertices5 = line.vertices) === null || _line$vertices5 === void 0 ? void 0 : _line$vertices5.get(0));
3083
+ var v1 = (_layer$vertices7 = layer.vertices) === null || _layer$vertices7 === void 0 ? void 0 : _layer$vertices7.get(line === null || line === void 0 || (_line$vertices6 = line.vertices) === null || _line$vertices6 === void 0 ? void 0 : _line$vertices6.get(1));
3084
+ var S0,
3085
+ S1,
3086
+ D0 = desItem === null || desItem === void 0 ? void 0 : desItem.D0,
3087
+ D1 = desItem === null || desItem === void 0 ? void 0 : desItem.D1;
3088
+ if (isEmpty(v0) || isEmpty(v1)) return false;
3089
+ // get distance from v0 to srcItem's S0, S1 and desItem(item or hole)'s D0, D1 are placed on line
3090
+ var srcPoints = getLineSnapPointsOfItem(layer, curLine, srcItem);
3091
+ if (srcPoints.length > 1) {
3092
+ S0 = srcPoints[0];
3093
+ S1 = srcPoints[1];
3094
+ }
3095
+ var disV0S0 = pointsDistance(v0.x, v0.y, (_S = S0) === null || _S === void 0 ? void 0 : _S.x, (_S2 = S0) === null || _S2 === void 0 ? void 0 : _S2.y);
3096
+ var disV0S1 = pointsDistance(v0.x, v0.y, (_S3 = S1) === null || _S3 === void 0 ? void 0 : _S3.x, (_S4 = S1) === null || _S4 === void 0 ? void 0 : _S4.y);
3097
+ var disV0D0 = pointsDistance(v0.x, v0.y, D0.x, D0.y);
3098
+ var disV0D1 = pointsDistance(v0.x, v0.y, D1.x, D1.y);
3099
+ // detect two items are overlapped
3100
+ var maxDisV0S = Math.max(disV0S0, disV0S1);
3101
+ var minDisV0S = Math.min(disV0S0, disV0S1);
3102
+ var maxDisV0D = Math.max(disV0D0, disV0D1);
3103
+ var minDisV0D = Math.min(disV0D0, disV0D1);
3104
+ if (maxDisV0S > maxDisV0D && maxDisV0D - minDisV0S > EPSILON) {
3105
+ // d0 s0 d1 s1 ===> maxDisV0S: v0s1, minDisV0S: v0s0, maxDisV0D: v0d1, minDisV0D: v0d0
3106
+ // v0 __________________________ v1
3107
+ // | | | |
3108
+ // | | | |
3109
+ // |__DI__|__| |
3110
+ // |__SI__|
3111
+ /////////////////////////////////////////
3112
+ // s0 d0 d1 s1 ===> maxDisV0S: v0s1, minDisV0S: v0s0, maxDisV0D: v0d1, minDisV0D: v0d0
3113
+ // v0 __________________________ v1
3114
+ // | | | |
3115
+ // | |__DI__| |
3116
+ // |_________SI_______|
3117
+ return true;
3118
+ } else if (minDisV0S < minDisV0D && maxDisV0S - minDisV0D > EPSILON) {
3119
+ // s0 d0 s1 d1 ===> maxDisV0S: v0s1, minDisV0S: v0s0, maxDisV0D: v0d1, minDisV0D: v0d0
3120
+ // v0 __________________________ v1
3121
+ // | | | |
3122
+ // | |__DI__|
3123
+ // |__SI_____|
3124
+ //
3125
+ return true;
3126
+ } else {
3127
+ return false;
3128
+ }
2609
3129
  }