kitchen-simulator 1.1.1-test.49 → 1.1.1-test.50

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 (358) hide show
  1. package/es/@history.js +2 -0
  2. package/es/AppContext.js +3 -0
  3. package/es/KitchenConfigurator.js +645 -0
  4. package/es/KitchenConfiguratorApp.js +480 -0
  5. package/es/actions/area-actions.js +14 -0
  6. package/es/actions/export.js +23 -0
  7. package/es/actions/groups-actions.js +89 -0
  8. package/es/actions/holes-actions.js +119 -0
  9. package/es/actions/items-actions.js +313 -0
  10. package/es/actions/lines-actions.js +81 -0
  11. package/es/actions/project-actions.js +281 -0
  12. package/es/actions/scene-actions.js +33 -0
  13. package/es/actions/vertices-actions.js +27 -0
  14. package/es/actions/viewer2d-actions.js +58 -0
  15. package/es/actions/viewer3d-actions.js +23 -0
  16. package/es/catalog/areas/area/planner-element.js +40 -0
  17. package/es/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
  18. package/es/catalog/areas/area/textures/grass.jpg +0 -0
  19. package/es/catalog/areas/area/textures/parquet.jpg +0 -0
  20. package/es/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
  21. package/es/catalog/areas/area/textures/tile1.jpg +0 -0
  22. package/es/catalog/catalog.js +277 -0
  23. package/es/catalog/envMap/nx.hdr +0 -0
  24. package/es/catalog/envMap/ny.hdr +0 -0
  25. package/es/catalog/envMap/nz.hdr +0 -0
  26. package/es/catalog/envMap/px.hdr +0 -0
  27. package/es/catalog/envMap/py.hdr +0 -0
  28. package/es/catalog/envMap/pz.hdr +0 -0
  29. package/es/catalog/factories/area-factory-3d.js +181 -0
  30. package/es/catalog/factories/area-factory.js +81 -0
  31. package/es/catalog/factories/export.js +7 -0
  32. package/es/catalog/factories/wall-factory-3d.js +202 -0
  33. package/es/catalog/factories/wall-factory.js +268 -0
  34. package/es/catalog/holes/door-closet/planner-element.js +222 -0
  35. package/es/catalog/holes/door-double/door_double.png +0 -0
  36. package/es/catalog/holes/door-double/planner-element.js +315 -0
  37. package/es/catalog/holes/door-exterior/planner-element.js +215 -0
  38. package/es/catalog/holes/door-interior/planner-element.js +227 -0
  39. package/es/catalog/holes/door-panic/panicDoor.png +0 -0
  40. package/es/catalog/holes/door-panic/planner-element.js +503 -0
  41. package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
  42. package/es/catalog/holes/door-panic-double/planner-element.js +463 -0
  43. package/es/catalog/holes/door-sliding/planner-element.js +225 -0
  44. package/es/catalog/holes/doorway-framed/planner-element.js +145 -0
  45. package/es/catalog/holes/doorway-frameless/planner-element.js +104 -0
  46. package/es/catalog/holes/export.js +13 -0
  47. package/es/catalog/holes/gate/gate.jpg +0 -0
  48. package/es/catalog/holes/window-clear/planner-element.js +166 -0
  49. package/es/catalog/holes/window-clear/texture.png +0 -0
  50. package/es/catalog/holes/window-cross/planner-element.js +165 -0
  51. package/es/catalog/holes/window-cross/texture.png +0 -0
  52. package/es/catalog/holes/window-double-hung/planner-element.js +303 -0
  53. package/es/catalog/holes/window-double-hung/texture.png +0 -0
  54. package/es/catalog/holes/window-vertical/planner-element.js +276 -0
  55. package/es/catalog/holes/window-vertical/texture.png +0 -0
  56. package/es/catalog/lines/wall/planner-element.js +70 -0
  57. package/es/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
  58. package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
  59. package/es/catalog/lines/wall/textures/bricks.jpg +0 -0
  60. package/es/catalog/lines/wall/textures/bricks2.jpg +0 -0
  61. package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
  62. package/es/catalog/lines/wall/textures/morden-normal.jpg +0 -0
  63. package/es/catalog/lines/wall/textures/morden.jpg +0 -0
  64. package/es/catalog/lines/wall/textures/painted-normal.jpg +0 -0
  65. package/es/catalog/lines/wall/textures/painted.jpg +0 -0
  66. package/es/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
  67. package/es/catalog/lines/wall/textures/plaster.jpg +0 -0
  68. package/es/catalog/lines/wall/wall.png +0 -0
  69. package/es/catalog/molding/molding-dcm/planner-element.js +28 -0
  70. package/es/catalog/molding/molding-dcm/texture.png +0 -0
  71. package/es/catalog/molding/molding-fbm/planner-element.js +28 -0
  72. package/es/catalog/molding/molding-fbm/texture.png +0 -0
  73. package/es/catalog/molding/molding-lrm/planner-element.js +28 -0
  74. package/es/catalog/molding/molding-lrm/texture.png +0 -0
  75. package/es/catalog/properties/export.js +21 -0
  76. package/es/catalog/properties/property-checkbox.js +116 -0
  77. package/es/catalog/properties/property-color.js +39 -0
  78. package/es/catalog/properties/property-enum.js +97 -0
  79. package/es/catalog/properties/property-hidden.js +19 -0
  80. package/es/catalog/properties/property-lenght-measure.js +101 -0
  81. package/es/catalog/properties/property-length-measure.js +134 -0
  82. package/es/catalog/properties/property-length-measure_hole.js +101 -0
  83. package/es/catalog/properties/property-number.js +48 -0
  84. package/es/catalog/properties/property-read-only.js +26 -0
  85. package/es/catalog/properties/property-string.js +48 -0
  86. package/es/catalog/properties/property-toggle.js +39 -0
  87. package/es/catalog/properties/shared-property-style.js +14 -0
  88. package/es/catalog/utils/FuseUtils.js +82 -0
  89. package/es/catalog/utils/exporter.js +148 -0
  90. package/es/catalog/utils/geom-utils.js +189 -0
  91. package/es/catalog/utils/item-loader.js +1521 -0
  92. package/es/catalog/utils/load-obj.js +91 -0
  93. package/es/catalog/utils/mtl-loader.js +358 -0
  94. package/es/catalog/utils/obj-loader.js +477 -0
  95. package/es/class/FuseUtils.js +82 -0
  96. package/es/class/area.js +145 -0
  97. package/es/class/export.js +24 -0
  98. package/es/class/group.js +440 -0
  99. package/es/class/guide.js +62 -0
  100. package/es/class/hole.js +929 -0
  101. package/es/class/item.js +1883 -0
  102. package/es/class/layer.js +667 -0
  103. package/es/class/line.js +1180 -0
  104. package/es/class/project.js +793 -0
  105. package/es/class/vertex.js +202 -0
  106. package/es/components/content.js +107 -0
  107. package/es/components/disclaimer/disclaimer.js +97 -0
  108. package/es/components/export.js +9 -0
  109. package/es/components/style/button.js +113 -0
  110. package/es/components/style/cancel-button.js +22 -0
  111. package/es/components/style/content-container.js +33 -0
  112. package/es/components/style/content-title.js +29 -0
  113. package/es/components/style/delete-button.js +25 -0
  114. package/es/components/style/export.js +31 -0
  115. package/es/components/style/form-block.js +24 -0
  116. package/es/components/style/form-color-input.js +27 -0
  117. package/es/components/style/form-label.js +26 -0
  118. package/es/components/style/form-number-input.js +213 -0
  119. package/es/components/style/form-number-input_2.js +206 -0
  120. package/es/components/style/form-select.js +68 -0
  121. package/es/components/style/form-slider.js +61 -0
  122. package/es/components/style/form-submit-button.js +26 -0
  123. package/es/components/style/form-text-input.js +95 -0
  124. package/es/components/viewer2d/area.js +81 -0
  125. package/es/components/viewer2d/export.js +31 -0
  126. package/es/components/viewer2d/grids/grid-horizontal-streak.js +37 -0
  127. package/es/components/viewer2d/grids/grid-streak.js +37 -0
  128. package/es/components/viewer2d/grids/grid-vertical-streak.js +37 -0
  129. package/es/components/viewer2d/grids/grids.js +35 -0
  130. package/es/components/viewer2d/group.js +53 -0
  131. package/es/components/viewer2d/item.js +513 -0
  132. package/es/components/viewer2d/layer.js +164 -0
  133. package/es/components/viewer2d/line.js +882 -0
  134. package/es/components/viewer2d/ruler.js +100 -0
  135. package/es/components/viewer2d/rulerDist.js +146 -0
  136. package/es/components/viewer2d/rulerX.js +151 -0
  137. package/es/components/viewer2d/rulerY.js +153 -0
  138. package/es/components/viewer2d/scene.js +140 -0
  139. package/es/components/viewer2d/snap.js +74 -0
  140. package/es/components/viewer2d/state.js +78 -0
  141. package/es/components/viewer2d/utils.js +198 -0
  142. package/es/components/viewer2d/vertex.js +65 -0
  143. package/es/components/viewer2d/viewer2d.js +1398 -0
  144. package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +2592 -0
  145. package/es/components/viewer3d/dcm.js +401 -0
  146. package/es/components/viewer3d/fbm.js +414 -0
  147. package/es/components/viewer3d/front3D.js +66 -0
  148. package/es/components/viewer3d/grid-creator.js +25 -0
  149. package/es/components/viewer3d/grids/grid-horizontal-streak.js +36 -0
  150. package/es/components/viewer3d/grids/grid-streak.js +27 -0
  151. package/es/components/viewer3d/grids/grid-vertical-streak.js +36 -0
  152. package/es/components/viewer3d/libs/first-person-controls.js +67 -0
  153. package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +1281 -0
  154. package/es/components/viewer3d/libs/mtl-loader.js +357 -0
  155. package/es/components/viewer3d/libs/obj-loader.js +462 -0
  156. package/es/components/viewer3d/libs/orbit-controls.js +699 -0
  157. package/es/components/viewer3d/libs/pointer-lock-controls.js +46 -0
  158. package/es/components/viewer3d/lrm.js +305 -0
  159. package/es/components/viewer3d/model.js +708 -0
  160. package/es/components/viewer3d/pointer-lock-navigation.js +115 -0
  161. package/es/components/viewer3d/ruler-utils/itemRect.js +61 -0
  162. package/es/components/viewer3d/ruler-utils/layer3D.js +495 -0
  163. package/es/components/viewer3d/ruler-utils/ruler3D.js +227 -0
  164. package/es/components/viewer3d/ruler-utils/scene3D.js +60 -0
  165. package/es/components/viewer3d/ruler-utils/state3D.js +18 -0
  166. package/es/components/viewer3d/scene-creator.js +3608 -0
  167. package/es/components/viewer3d/three-memory-cleaner.js +51 -0
  168. package/es/components/viewer3d/viewer3d-first-person.js +315 -0
  169. package/es/components/viewer3d/viewer3d.js +2527 -0
  170. package/es/constants.js +636 -0
  171. package/es/index.js +16 -0
  172. package/es/models.js +510 -0
  173. package/es/plugins/SVGLoader.js +1412 -0
  174. package/es/plugins/autosave.js +33 -0
  175. package/es/plugins/console-debugger.js +37 -0
  176. package/es/plugins/export.js +9 -0
  177. package/es/plugins/keyboard.js +101 -0
  178. package/es/reducers/areas-reducer.js +12 -0
  179. package/es/reducers/export.js +25 -0
  180. package/es/reducers/groups-reducer.js +38 -0
  181. package/es/reducers/holes-reducer.js +62 -0
  182. package/es/reducers/items-reducer.js +140 -0
  183. package/es/reducers/lines-reducer.js +45 -0
  184. package/es/reducers/project-reducer.js +129 -0
  185. package/es/reducers/reducer.js +19 -0
  186. package/es/reducers/scene-reducer.js +28 -0
  187. package/es/reducers/user-reducer.js +40 -0
  188. package/es/reducers/vertices-reducer.js +19 -0
  189. package/es/reducers/viewer2d-reducer.js +75 -0
  190. package/es/reducers/viewer3d-reducer.js +56 -0
  191. package/es/shared-style.js +66 -0
  192. package/es/styles/export.js +5 -0
  193. package/es/styles/tabs.css +40 -0
  194. package/es/translator/en.js +104 -0
  195. package/es/translator/it.js +79 -0
  196. package/es/translator/ru.js +79 -0
  197. package/es/translator/translator.js +84 -0
  198. package/es/utils/browser.js +33 -0
  199. package/es/utils/email-validator.js +4 -0
  200. package/es/utils/export.js +25 -0
  201. package/es/utils/geometry.js +2420 -0
  202. package/es/utils/get-edges-of-subgraphs.js +27 -0
  203. package/es/utils/graph-cycles.js +237 -0
  204. package/es/utils/graph-inner-cycles.js +46 -0
  205. package/es/utils/graph.js +150 -0
  206. package/es/utils/helper.js +268 -0
  207. package/es/utils/history.js +29 -0
  208. package/es/utils/id-broker.js +19 -0
  209. package/es/utils/logger.js +8 -0
  210. package/es/utils/math.js +50 -0
  211. package/es/utils/molding.js +871 -0
  212. package/es/utils/name-generator.js +18 -0
  213. package/es/utils/objects-utils.js +50 -0
  214. package/es/utils/phone-validator.js +4 -0
  215. package/es/utils/process-black-list.js +18 -0
  216. package/es/utils/react-if.js +18 -0
  217. package/es/utils/snap-scene.js +99 -0
  218. package/es/utils/snap.js +237 -0
  219. package/es/utils/summarizeCart.js +24 -0
  220. package/es/utils/threeCSG.es6.js +498 -0
  221. package/es/version.js +2 -0
  222. package/lib/catalog/properties/property-string.js +55 -0
  223. package/lib/catalog/properties/property-toggle.js +46 -0
  224. package/lib/catalog/properties/shared-property-style.js +20 -0
  225. package/lib/catalog/utils/FuseUtils.js +88 -0
  226. package/lib/catalog/utils/exporter.js +155 -0
  227. package/lib/catalog/utils/geom-utils.js +205 -0
  228. package/lib/catalog/utils/item-loader.js +1533 -0
  229. package/lib/catalog/utils/load-obj.js +99 -0
  230. package/lib/catalog/utils/mtl-loader.js +363 -0
  231. package/lib/catalog/utils/obj-loader.js +482 -0
  232. package/lib/class/FuseUtils.js +88 -0
  233. package/lib/class/area.js +150 -0
  234. package/lib/class/export.js +96 -0
  235. package/lib/class/group.js +445 -0
  236. package/lib/class/guide.js +67 -0
  237. package/lib/class/hole.js +934 -0
  238. package/lib/class/item.js +1889 -0
  239. package/lib/class/layer.js +672 -0
  240. package/lib/class/line.js +1186 -0
  241. package/lib/class/project.js +799 -0
  242. package/lib/class/vertex.js +207 -0
  243. package/lib/components/content.js +116 -0
  244. package/lib/components/disclaimer/disclaimer.js +105 -0
  245. package/lib/components/export.js +33 -0
  246. package/lib/components/style/button.js +120 -0
  247. package/lib/components/style/cancel-button.js +29 -0
  248. package/lib/components/style/content-container.js +40 -0
  249. package/lib/components/style/content-title.js +37 -0
  250. package/lib/components/style/delete-button.js +34 -0
  251. package/lib/components/style/export.js +121 -0
  252. package/lib/components/style/form-block.js +31 -0
  253. package/lib/components/style/form-color-input.js +34 -0
  254. package/lib/components/style/form-label.js +33 -0
  255. package/lib/components/style/form-number-input.js +220 -0
  256. package/lib/components/style/form-number-input_2.js +213 -0
  257. package/lib/components/style/form-select.js +75 -0
  258. package/lib/components/style/form-slider.js +68 -0
  259. package/lib/components/style/form-submit-button.js +35 -0
  260. package/lib/components/style/form-text-input.js +101 -0
  261. package/lib/components/viewer2d/area.js +88 -0
  262. package/lib/components/viewer2d/export.js +121 -0
  263. package/lib/components/viewer2d/grids/grid-horizontal-streak.js +44 -0
  264. package/lib/components/viewer2d/grids/grid-streak.js +44 -0
  265. package/lib/components/viewer2d/grids/grid-vertical-streak.js +44 -0
  266. package/lib/components/viewer2d/grids/grids.js +44 -0
  267. package/lib/components/viewer2d/group.js +62 -0
  268. package/lib/components/viewer2d/item.js +521 -0
  269. package/lib/components/viewer2d/layer.js +171 -0
  270. package/lib/components/viewer2d/line.js +892 -0
  271. package/lib/components/viewer2d/ruler.js +107 -0
  272. package/lib/components/viewer2d/rulerDist.js +153 -0
  273. package/lib/components/viewer2d/rulerX.js +158 -0
  274. package/lib/components/viewer2d/rulerY.js +160 -0
  275. package/lib/components/viewer2d/scene.js +147 -0
  276. package/lib/components/viewer2d/snap.js +83 -0
  277. package/lib/components/viewer2d/state.js +87 -0
  278. package/lib/components/viewer2d/utils.js +210 -0
  279. package/lib/components/viewer2d/vertex.js +74 -0
  280. package/lib/components/viewer2d/viewer2d.js +1405 -0
  281. package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +2597 -0
  282. package/lib/components/viewer3d/dcm.js +407 -0
  283. package/lib/components/viewer3d/fbm.js +420 -0
  284. package/lib/components/viewer3d/front3D.js +75 -0
  285. package/lib/components/viewer3d/grid-creator.js +34 -0
  286. package/lib/components/viewer3d/grids/grid-horizontal-streak.js +44 -0
  287. package/lib/components/viewer3d/grids/grid-streak.js +35 -0
  288. package/lib/components/viewer3d/grids/grid-vertical-streak.js +44 -0
  289. package/lib/components/viewer3d/libs/first-person-controls.js +74 -0
  290. package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +1287 -0
  291. package/lib/components/viewer3d/libs/mtl-loader.js +363 -0
  292. package/lib/components/viewer3d/libs/obj-loader.js +468 -0
  293. package/lib/components/viewer3d/libs/orbit-controls.js +705 -0
  294. package/lib/components/viewer3d/libs/pointer-lock-controls.js +52 -0
  295. package/lib/components/viewer3d/lrm.js +311 -0
  296. package/lib/components/viewer3d/model.js +714 -0
  297. package/lib/components/viewer3d/pointer-lock-navigation.js +122 -0
  298. package/lib/components/viewer3d/ruler-utils/itemRect.js +68 -0
  299. package/lib/components/viewer3d/ruler-utils/layer3D.js +502 -0
  300. package/lib/components/viewer3d/ruler-utils/ruler3D.js +234 -0
  301. package/lib/components/viewer3d/ruler-utils/scene3D.js +68 -0
  302. package/lib/components/viewer3d/ruler-utils/state3D.js +25 -0
  303. package/lib/components/viewer3d/scene-creator.js +3642 -0
  304. package/lib/components/viewer3d/three-memory-cleaner.js +60 -0
  305. package/lib/components/viewer3d/viewer3d-first-person.js +320 -0
  306. package/lib/components/viewer3d/viewer3d.js +2532 -0
  307. package/lib/constants.js +645 -0
  308. package/lib/index.js +96 -0
  309. package/lib/models.js +517 -0
  310. package/lib/plugins/SVGLoader.js +1417 -0
  311. package/lib/plugins/autosave.js +39 -0
  312. package/lib/plugins/console-debugger.js +44 -0
  313. package/lib/plugins/export.js +33 -0
  314. package/lib/plugins/keyboard.js +107 -0
  315. package/lib/reducers/areas-reducer.js +18 -0
  316. package/lib/reducers/export.js +97 -0
  317. package/lib/reducers/groups-reducer.js +44 -0
  318. package/lib/reducers/holes-reducer.js +68 -0
  319. package/lib/reducers/items-reducer.js +146 -0
  320. package/lib/reducers/lines-reducer.js +51 -0
  321. package/lib/reducers/project-reducer.js +135 -0
  322. package/lib/reducers/reducer.js +26 -0
  323. package/lib/reducers/scene-reducer.js +34 -0
  324. package/lib/reducers/user-reducer.js +46 -0
  325. package/lib/reducers/vertices-reducer.js +25 -0
  326. package/lib/reducers/viewer2d-reducer.js +82 -0
  327. package/lib/reducers/viewer3d-reducer.js +63 -0
  328. package/lib/shared-style.js +72 -0
  329. package/lib/styles/export.js +13 -0
  330. package/lib/translator/en.js +110 -0
  331. package/lib/translator/it.js +85 -0
  332. package/lib/translator/ru.js +85 -0
  333. package/lib/translator/translator.js +90 -0
  334. package/lib/utils/browser.js +40 -0
  335. package/lib/utils/email-validator.js +10 -0
  336. package/lib/utils/export.js +56 -0
  337. package/lib/utils/geometry.js +2516 -0
  338. package/lib/utils/get-edges-of-subgraphs.js +34 -0
  339. package/lib/utils/graph-cycles.js +240 -0
  340. package/lib/utils/graph-inner-cycles.js +54 -0
  341. package/lib/utils/graph.js +157 -0
  342. package/lib/utils/helper.js +291 -0
  343. package/lib/utils/history.js +36 -0
  344. package/lib/utils/id-broker.js +25 -0
  345. package/lib/utils/logger.js +14 -0
  346. package/lib/utils/math.js +57 -0
  347. package/lib/utils/molding.js +895 -0
  348. package/lib/utils/name-generator.js +23 -0
  349. package/lib/utils/objects-utils.js +60 -0
  350. package/lib/utils/phone-validator.js +10 -0
  351. package/lib/utils/process-black-list.js +24 -0
  352. package/lib/utils/react-if.js +24 -0
  353. package/lib/utils/snap-scene.js +105 -0
  354. package/lib/utils/snap.js +249 -0
  355. package/lib/utils/summarizeCart.js +30 -0
  356. package/lib/utils/threeCSG.es6.js +503 -0
  357. package/lib/version.js +8 -0
  358. package/package.json +3 -3
@@ -0,0 +1,33 @@
1
+ var sessionStorage = window.hasOwnProperty('sessionStorage') ? window.sessionStorage : false;
2
+ import { loadProject } from "../actions/project-actions";
3
+ var TIMEOUT_DELAY = 500;
4
+ var timeout = null;
5
+ export default function autosave(autosaveKey, revert, delay) {
6
+ return function (store, stateExtractor) {
7
+ delay = delay || TIMEOUT_DELAY;
8
+ if (revert === undefined) return;
9
+ if (!autosaveKey) return;
10
+ if (!sessionStorage) return;
11
+
12
+ //revert
13
+ if (revert && sessionStorage.getItem(autosaveKey) !== null) {
14
+ var data = sessionStorage.getItem(autosaveKey);
15
+ var json = JSON.parse(data);
16
+ store.dispatch(loadProject(json));
17
+ }
18
+
19
+ //update
20
+ store.subscribe(function () {
21
+ if (timeout) clearTimeout(timeout);
22
+ timeout = setTimeout(function () {
23
+ var state = stateExtractor(store.getState());
24
+ // sessionStorage.setItem(autosaveKey, JSON.stringify(state.scene.toJS()));
25
+ /*let scene = state.sceneHistory.last;
26
+ if (scene) {
27
+ let json = JSON.stringify(scene.toJS());
28
+ sessionStorage.setItem(autosaveKey, json);
29
+ }*/
30
+ }, delay);
31
+ });
32
+ };
33
+ }
@@ -0,0 +1,37 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import actions from "../actions/export";
8
+ export default function consoleDebugger() {
9
+ return function (store, stateExtractor) {
10
+ window.KitchenConfigurator = _objectSpread(_objectSpread({}, actions), {}, {
11
+ getStore: function getStore() {
12
+ return store;
13
+ },
14
+ getState: function getState() {
15
+ return stateExtractor(store.getState());
16
+ },
17
+ "do": function _do(actions) {
18
+ var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
19
+ actions = actions.reverse();
20
+ var dispatch = store.dispatch;
21
+ var _dispatchAction = function dispatchAction() {
22
+ console.info("There are other ".concat(actions.length, " actions on stack"));
23
+ if (actions.length === 0) return;
24
+ dispatch(actions.pop());
25
+ if (actions.length === 0) return;
26
+ setTimeout(_dispatchAction, delay);
27
+ };
28
+ setTimeout(_dispatchAction, 0);
29
+ }
30
+ });
31
+ console.groupCollapsed('KitchenConfigurator');
32
+ console.info('KitchenConfigurator is ready');
33
+ console.info('console.log(KitchenConfigurator)');
34
+ console.log(window.KitchenConfigurator);
35
+ console.groupEnd();
36
+ };
37
+ }
@@ -0,0 +1,9 @@
1
+ import Autosave from "./autosave";
2
+ import Keyboard from "./keyboard";
3
+ import ConsoleDebugger from "./console-debugger";
4
+ export { Autosave, Keyboard, ConsoleDebugger };
5
+ export default {
6
+ Autosave: Autosave,
7
+ Keyboard: Keyboard,
8
+ ConsoleDebugger: ConsoleDebugger
9
+ };
@@ -0,0 +1,101 @@
1
+ import { KEYBOARD_BUTTON_CODE, MODE_3D_FIRST_PERSON, MODE_3D_VIEW, MODE_DRAGGING_ITEM_3D, MODE_DRAWING_ITEM, MODE_DRAWING_ITEM_3D, MODE_IDLE, MODE_IDLE_3D, MODE_ROTATING_ITEM_3D, MODE_SNAPPING } from "../constants";
2
+ import { copyProperties, pasteProperties, recreate, redo, remove, rollback, shift2doff, shift2don, toggleSnap, uncreate, undo } from "../actions/project-actions";
3
+ export default function keyboard() {
4
+ return function (store, stateExtractor) {
5
+ window.addEventListener('keydown', function (event) {
6
+ var state = stateExtractor(store.getState());
7
+ var mode = state.get('mode');
8
+ switch (event.keyCode) {
9
+ case KEYBOARD_BUTTON_CODE.BACKSPACE:
10
+ case KEYBOARD_BUTTON_CODE.DELETE:
11
+ {
12
+ if ([MODE_IDLE, MODE_3D_FIRST_PERSON, MODE_3D_VIEW, MODE_IDLE_3D, MODE_ROTATING_ITEM_3D, MODE_DRAGGING_ITEM_3D].includes(mode)) store.dispatch(remove());
13
+ break;
14
+ }
15
+ case KEYBOARD_BUTTON_CODE.ESC:
16
+ {
17
+ store.dispatch(rollback());
18
+ break;
19
+ }
20
+ case KEYBOARD_BUTTON_CODE.Z:
21
+ {
22
+ if (event.getModifierState('Control') || event.getModifierState('Meta')) store.dispatch(undo());
23
+ break;
24
+ }
25
+ case KEYBOARD_BUTTON_CODE.Q:
26
+ {
27
+ if (event.getModifierState('Control') || event.getModifierState('Meta')) store.dispatch(redo());
28
+ break;
29
+ }
30
+ case KEYBOARD_BUTTON_CODE.ALT:
31
+ {
32
+ if (MODE_SNAPPING.includes(mode)) store.dispatch(toggleSnap(state.snapMask.merge({
33
+ SNAP_POINT: false,
34
+ SNAP_LINE: false,
35
+ SNAP_SEGMENT: false,
36
+ SNAP_GRID: false,
37
+ SNAP_GUIDE: false,
38
+ tempSnapConfiguartion: state.snapMask.toJS()
39
+ })));
40
+ break;
41
+ }
42
+ case KEYBOARD_BUTTON_CODE.C:
43
+ {
44
+ var selectedLayer = state.getIn(['scene', 'selectedLayer']);
45
+ var selected = state.getIn(['scene', 'layers', selectedLayer, 'selected']);
46
+ if ((mode === MODE_IDLE || mode === MODE_3D_VIEW) && (selected.holes.size || selected.areas.size || selected.items.size || selected.lines.size)) {
47
+ if (selected.holes.size) {
48
+ var hole = state.getIn(['scene', 'layers', selectedLayer, 'holes', selected.holes.get(0)]);
49
+ store.dispatch(copyProperties(hole.get('properties')));
50
+ } else if (selected.areas.size) {
51
+ var area = state.getIn(['scene', 'layers', selectedLayer, 'areas', selected.areas.get(0)]);
52
+ store.dispatch(copyProperties(area.properties));
53
+ } else if (selected.items.size) {
54
+ var item = state.getIn(['scene', 'layers', selectedLayer, 'items', selected.items.get(0)]);
55
+ store.dispatch(copyProperties(item.properties));
56
+ } else if (selected.lines.size) {
57
+ var line = state.getIn(['scene', 'layers', selectedLayer, 'lines', selected.lines.get(0)]);
58
+ store.dispatch(copyProperties(line.properties));
59
+ }
60
+ }
61
+ break;
62
+ }
63
+ case KEYBOARD_BUTTON_CODE.V:
64
+ {
65
+ store.dispatch(pasteProperties());
66
+ break;
67
+ }
68
+ case KEYBOARD_BUTTON_CODE.SHIFT:
69
+ {
70
+ if (['TEXTAREA', 'INPUT'].includes(document.activeElement.tagName) === false) {
71
+ if ([MODE_DRAWING_ITEM_3D, MODE_IDLE_3D].includes(mode)) store.dispatch(recreate());else if ([MODE_DRAWING_ITEM, MODE_IDLE].includes(mode)) store.dispatch(shift2doff());
72
+ }
73
+ break;
74
+ }
75
+ }
76
+ });
77
+ window.addEventListener('keyup', function (event) {
78
+ var state = stateExtractor(store.getState());
79
+ var mode = state.get('mode');
80
+ switch (event.keyCode) {
81
+ case KEYBOARD_BUTTON_CODE.ALT:
82
+ {
83
+ if (MODE_SNAPPING.includes(mode)) store.dispatch(toggleSnap(state.snapMask.merge(state.snapMask.get('tempSnapConfiguartion'))));
84
+ break;
85
+ }
86
+ case KEYBOARD_BUTTON_CODE.CTRL:
87
+ {
88
+ // store.dispatch(setAlterateState());
89
+ break;
90
+ }
91
+ case KEYBOARD_BUTTON_CODE.SHIFT:
92
+ {
93
+ if (['TEXTAREA', 'INPUT'].includes(document.activeElement.tagName) === false) {
94
+ if ([MODE_DRAWING_ITEM_3D, MODE_IDLE_3D].includes(mode)) store.dispatch(uncreate());else if ([MODE_DRAWING_ITEM, MODE_IDLE].includes(mode)) store.dispatch(shift2don());
95
+ }
96
+ break;
97
+ }
98
+ }
99
+ });
100
+ };
101
+ }
@@ -0,0 +1,12 @@
1
+ import { Area } from "../class/export";
2
+ import { SELECT_AREA, SET_FLOOR_STYLES } from "../constants";
3
+ export default function (state, action) {
4
+ switch (action.type) {
5
+ case SELECT_AREA:
6
+ return Area.select(state, action.layerID, action.areaID).updatedState;
7
+ case SET_FLOOR_STYLES:
8
+ return Area.setFloorStyles(state, action.texture).updatedState;
9
+ default:
10
+ return state;
11
+ }
12
+ }
@@ -0,0 +1,25 @@
1
+ import KitchenConfiguratorAreasReducer from "./areas-reducer";
2
+ import KitchenConfiguratorHolesReducer from "./holes-reducer";
3
+ import KitchenConfiguratorItemsReducer from "./items-reducer";
4
+ import KitchenConfiguratorLinesReducer from "./lines-reducer";
5
+ import KitchenConfiguratorGroupsReducer from "./groups-reducer";
6
+ import KitchenConfiguratorProjectReducer from "./project-reducer";
7
+ import KitchenConfiguratorSceneReducer from "./scene-reducer";
8
+ import KitchenConfiguratorVerticesReducer from "./vertices-reducer";
9
+ import KitchenConfiguratorViewer2dReducer from "./viewer2d-reducer";
10
+ import KitchenConfiguratorViewer3dReducer from "./viewer3d-reducer";
11
+ import KitchenConfiguratorUserReducer from "./user-reducer";
12
+ export { KitchenConfiguratorAreasReducer, KitchenConfiguratorHolesReducer, KitchenConfiguratorItemsReducer, KitchenConfiguratorLinesReducer, KitchenConfiguratorGroupsReducer, KitchenConfiguratorProjectReducer, KitchenConfiguratorSceneReducer, KitchenConfiguratorVerticesReducer, KitchenConfiguratorViewer2dReducer, KitchenConfiguratorViewer3dReducer, KitchenConfiguratorUserReducer };
13
+ export default {
14
+ KitchenConfiguratorAreasReducer: KitchenConfiguratorAreasReducer,
15
+ KitchenConfiguratorHolesReducer: KitchenConfiguratorHolesReducer,
16
+ KitchenConfiguratorItemsReducer: KitchenConfiguratorItemsReducer,
17
+ KitchenConfiguratorLinesReducer: KitchenConfiguratorLinesReducer,
18
+ KitchenConfiguratorGroupsReducer: KitchenConfiguratorGroupsReducer,
19
+ KitchenConfiguratorProjectReducer: KitchenConfiguratorProjectReducer,
20
+ KitchenConfiguratorSceneReducer: KitchenConfiguratorSceneReducer,
21
+ KitchenConfiguratorVerticesReducer: KitchenConfiguratorVerticesReducer,
22
+ KitchenConfiguratorViewer2dReducer: KitchenConfiguratorViewer2dReducer,
23
+ KitchenConfiguratorViewer3dReducer: KitchenConfiguratorViewer3dReducer,
24
+ KitchenConfiguratorUserReducer: KitchenConfiguratorUserReducer
25
+ };
@@ -0,0 +1,38 @@
1
+ import { GROUP_ACTIONS } from "../constants";
2
+ import { Group } from "../class/export";
3
+ import { history } from "../utils/export";
4
+ export default function (state, action) {
5
+ state = state.merge({
6
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
7
+ });
8
+ switch (action.type) {
9
+ case GROUP_ACTIONS.ADD_GROUP:
10
+ return Group.create(state).updatedState;
11
+ case GROUP_ACTIONS.ADD_GROUP_FROM_SELECTED:
12
+ return Group.createFromSelectedElements(state).updatedState;
13
+ case GROUP_ACTIONS.SELECT_GROUP:
14
+ return Group.select(state, action.groupID).updatedState;
15
+ case GROUP_ACTIONS.UNSELECT_GROUP:
16
+ return Group.unselect(state, action.groupID).updatedState;
17
+ case GROUP_ACTIONS.ADD_TO_GROUP:
18
+ return Group.addElement(state, action.groupID, action.layerID, action.elementPrototype, action.elementID).updatedState;
19
+ case GROUP_ACTIONS.REMOVE_FROM_GROUP:
20
+ return Group.removeElement(state, action.groupID, action.layerID, action.elementPrototype, action.elementID).updatedState;
21
+ case GROUP_ACTIONS.SET_GROUP_ATTRIBUTES:
22
+ return Group.setAttributes(state, action.groupID, action.attributes).updatedState;
23
+ case GROUP_ACTIONS.SET_GROUP_PROPERTIES:
24
+ return Group.setProperties(state, action.groupID, action.properties).updatedState;
25
+ case GROUP_ACTIONS.SET_GROUP_BARYCENTER:
26
+ return Group.setBarycenter(state, action.groupID, action.barycenter.get('x'), action.barycenter.get('y')).updatedState;
27
+ case GROUP_ACTIONS.REMOVE_GROUP:
28
+ return Group.remove(state, action.groupID).updatedState;
29
+ case GROUP_ACTIONS.REMOVE_GROUP_AND_DELETE_ELEMENTS:
30
+ return Group.removeAndDeleteElements(state, action.groupID).updatedState;
31
+ case GROUP_ACTIONS.GROUP_TRANSLATE:
32
+ return Group.translate(state, action.groupID, action.x, action.y).updatedState;
33
+ case GROUP_ACTIONS.GROUP_ROTATE:
34
+ return Group.rotate(state, action.groupID, action.rotation).updatedState;
35
+ default:
36
+ return state;
37
+ }
38
+ }
@@ -0,0 +1,62 @@
1
+ import { Hole } from "../class/export";
2
+ import { history } from "../utils/export";
3
+ import { BEGIN_DRAGGING_HOLE, BEGIN_DRAGGING_HOLE_3D, END_CREATING_HOLE, END_DRAGGING_HOLE, END_DRAGGING_HOLE_3D, END_DRAWING_HOLE, END_DRAWING_HOLE_3D, SELECT_HOLE, SELECT_TOOL_DRAWING_HOLE, SELECT_TOOL_DRAWING_HOLE_3D, UPDATE_DRAGGING_HOLE, UPDATE_DRAGGING_HOLE_CHANGED, UPDATE_DRAGGING_HOLE_RULER_CHANGED, UPDATE_DRAWING_HOLE, UPDATE_DRAWING_HOLE_3D, UPDATE_POPUP_OPEN } from "../constants";
4
+ export default function (state, action) {
5
+ switch (action.type) {
6
+ case UPDATE_DRAGGING_HOLE_RULER_CHANGED:
7
+ return Hole.updateDraggingHoleRulerChanged(state, action.width, action.layerID, action.holeID).updatedState;
8
+ case UPDATE_DRAGGING_HOLE_CHANGED:
9
+ return Hole.updateDraggingHoleChanged(state, action.x, action.y, action.layerID, action.holeID).updatedState;
10
+ case END_CREATING_HOLE:
11
+ return Hole.endCreatingHole(state).updatedState;
12
+ case UPDATE_POPUP_OPEN:
13
+ return Hole.updatePopupOpen(state, action.value).updatedState;
14
+ case SELECT_TOOL_DRAWING_HOLE:
15
+ state = state.merge({
16
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
17
+ });
18
+ return Hole.selectToolDrawingHole(state, action.sceneComponentType).updatedState;
19
+ case SELECT_TOOL_DRAWING_HOLE_3D:
20
+ return Hole.selectToolDrawingHole3D(state, action.sceneComponentType).updatedState;
21
+ case UPDATE_DRAWING_HOLE:
22
+ return Hole.updateDrawingHole(state, action.layerID, action.x, action.y).updatedState;
23
+ case UPDATE_DRAWING_HOLE_3D:
24
+ return Hole.updateDrawingHole3D(state, action.layerID, action.x, action.y).updatedState;
25
+ case END_DRAWING_HOLE:
26
+ state = state.merge({
27
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
28
+ });
29
+ return Hole.endDrawingHole(state, action.layerID, action.x, action.y).updatedState;
30
+ case END_DRAWING_HOLE_3D:
31
+ state = state.merge({
32
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
33
+ });
34
+ return Hole.endDrawingHole3D(state, action.layerID, action.x, action.y).updatedState;
35
+ case BEGIN_DRAGGING_HOLE:
36
+ state = state.merge({
37
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
38
+ });
39
+ return Hole.beginDraggingHole(state, action.layerID, action.holeID, action.x, action.y).updatedState;
40
+ case BEGIN_DRAGGING_HOLE_3D:
41
+ state = state.merge({
42
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
43
+ });
44
+ return Hole.beginDraggingHole3D(state, action.layerID, action.holeID, action.x, action.y).updatedState;
45
+ case UPDATE_DRAGGING_HOLE:
46
+ return Hole.updateDraggingHole(state, action.x, action.y).updatedState;
47
+ case END_DRAGGING_HOLE:
48
+ state = state.merge({
49
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
50
+ });
51
+ return Hole.endDraggingHole(state, action.x, action.y).updatedState;
52
+ case END_DRAGGING_HOLE_3D:
53
+ state = state.merge({
54
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
55
+ });
56
+ return Hole.endDraggingHole3D(state, action.x, action.y).updatedState;
57
+ case SELECT_HOLE:
58
+ return Hole.select(state, action.layerID, action.holeID).updatedState;
59
+ default:
60
+ return state;
61
+ }
62
+ }
@@ -0,0 +1,140 @@
1
+ import { Item } from "../class/export";
2
+ import { history } from "../utils/export";
3
+ import { ANIMATE_OBJECT, BEGIN_DRAGGING_ITEM, BEGIN_DRAGGING_ITEM_3D, BEGIN_ROTATING_ITEM, BEGIN_ROTATING_ITEM_3D, DUPLICATE_SELECTED, EDIT_WIDTH, END_CREATING_CABINET, END_DRAGGING_ITEM, END_DRAGGING_ITEM_3D, END_DRAWING_ITEM, END_LOADING, END_ROTATING_ITEM, END_ROTATING_ITEM_3D, ITEM_MOVE_UP, REMOVE_REPLACE_SUBMODULE, REPLACE_ITEM, REPLACE_SUBMODULE, SELECT_ITEM, SELECT_TOOL_DRAWING_ITEM, SELECT_TOOL_DRAWING_ITEM_3D, SET_APPLIANCE_MATERIAL, SET_BACKSPLASH, SET_BACKSPLASH_VISIBLE, SET_COUNTER_TOP, SET_DOOR_HANDLE, SET_DOOR_STYLE, SET_HANDLE_MATERIAL, SET_INITIAL_DOOR_STYLE, SET_MODELLING, SET_MOLDING, SET_WALL_COLOR, STORE_DIST_ARRAY, TOGGLE_LOADING_CABINET, UPDATE_DRAGGING_ITEM, UPDATE_DRAGGING_ITEM_3DX, UPDATE_DRAGGING_ITEM_3DY, UPDATE_DRAGGING_ITEM_CHANGED, UPDATE_DRAWING_ITEM, UPDATE_ITEM_POSITION, UPDATE_MOLDING, UPDATE_POPUP_OPEN, UPDATE_ROTATING_ITEM, UPDATE_ROTATING_ITEM_CHANGED, VALIDATE_ITEM_POSTIONS } from "../constants";
4
+ export default function (state, action) {
5
+ switch (action.type) {
6
+ case STORE_DIST_ARRAY:
7
+ return Item.storeDistArray(state, action.layerID, action.itemID, action.distArray).updatedState;
8
+ case VALIDATE_ITEM_POSTIONS:
9
+ return Item.validateItemPositions(state, action.layerID).updatedState;
10
+ case END_LOADING:
11
+ return Item.endLoading(state).updatedState;
12
+ case TOGGLE_LOADING_CABINET:
13
+ return Item.toggleLoadingCabinet(state).updatedState;
14
+ case EDIT_WIDTH:
15
+ return Item.editWidth(state, action.newWidth, action.layerID, action.itemID).updatedState;
16
+ case DUPLICATE_SELECTED:
17
+ return Item.duplicateSelected(state, action.currentObject).updatedState;
18
+ case END_CREATING_CABINET:
19
+ return Item.endCreatingCabinet(state).updatedState;
20
+ case UPDATE_POPUP_OPEN:
21
+ return Item.updatePopupOpen(state, action.value).updatedState;
22
+ case SELECT_ITEM:
23
+ return Item.select(state, action.layerID, action.itemID).updatedState;
24
+ case SELECT_TOOL_DRAWING_ITEM:
25
+ state = state.merge({
26
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
27
+ });
28
+ return Item.selectToolDrawingItem(state, action.sceneComponentType, action.oStyle).updatedState;
29
+ case REPLACE_ITEM:
30
+ return Item.replaceItem(state, action.selectedPos, action.currentObject, action.selectedObject).updatedState;
31
+ case UPDATE_DRAWING_ITEM:
32
+ return Item.updateDrawingItem(state, action.layerID, action.x, action.y).updatedState;
33
+ case END_DRAWING_ITEM:
34
+ state = state.merge({
35
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
36
+ });
37
+ return Item.endDrawingItem(state, action.layerID, action.x, action.y).updatedState;
38
+ case BEGIN_DRAGGING_ITEM:
39
+ state = state.merge({
40
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
41
+ });
42
+ return Item.beginDraggingItem(state, action.layerID, action.itemID, action.x, action.y).updatedState;
43
+ case BEGIN_DRAGGING_ITEM_3D:
44
+ state = state.merge({
45
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
46
+ });
47
+ return Item.beginDraggingItem3D(state, action.layerID, action.itemID, action.x, action.y).updatedState;
48
+ case UPDATE_DRAGGING_ITEM:
49
+ return Item.updateDraggingItem(state, action.x, action.y).updatedState;
50
+ case UPDATE_DRAGGING_ITEM_CHANGED:
51
+ return Item.updateDraggingItemChanged(state, action.x, action.y, action.layerID, action.itemID).updatedState;
52
+ case UPDATE_DRAGGING_ITEM_3DX:
53
+ return Item.updateDraggingItem3DX(state, action.x).updatedState;
54
+ case UPDATE_DRAGGING_ITEM_3DY:
55
+ return Item.updateDraggingItem3DY(state, action.y).updatedState;
56
+ case END_DRAGGING_ITEM:
57
+ state = state.merge({
58
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
59
+ });
60
+ return Item.endDraggingItem(state, action.x, action.y).updatedState;
61
+ case END_DRAGGING_ITEM_3D:
62
+ state = state.merge({
63
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
64
+ });
65
+ return Item.endDraggingItem3D(state).updatedState;
66
+ case BEGIN_ROTATING_ITEM:
67
+ state = state.merge({
68
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
69
+ });
70
+ return Item.beginRotatingItem(state, action.layerID, action.itemID, action.x, action.y).updatedState;
71
+ case BEGIN_ROTATING_ITEM_3D:
72
+ state = state.merge({
73
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
74
+ });
75
+ return Item.beginRotatingItem3D(state, action.layerID, action.itemID, action.x, action.y, action.centerX, action.centerY).updatedState;
76
+ case UPDATE_ROTATING_ITEM:
77
+ return Item.updateRotatingItem(state, action.x, action.y).updatedState;
78
+ case UPDATE_ROTATING_ITEM_CHANGED:
79
+ return Item.updateRotatingItemChanged(state, action.rotation, action.layerID, action.itemID).updatedState;
80
+ case END_ROTATING_ITEM:
81
+ state = state.merge({
82
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
83
+ });
84
+ return Item.endRotatingItem(state, action.x, action.y).updatedState;
85
+ case END_ROTATING_ITEM_3D:
86
+ state = state.merge({
87
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
88
+ });
89
+ return Item.endRotatingItem3D(state, action.x, action.y).updatedState;
90
+ case REPLACE_SUBMODULE:
91
+ state = state.merge({
92
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
93
+ });
94
+ return Item.replaceSubmodule(state, action.url).updatedState;
95
+ case ANIMATE_OBJECT:
96
+ // state = state.merge({ sceneHistory: history.historyPush(state.sceneHistory, state.scene) });
97
+ return Item.animateObject(state, action.value).updatedState;
98
+ case REMOVE_REPLACE_SUBMODULE:
99
+ return Item.removeReplacingSupport(state).updatedState;
100
+ case ITEM_MOVE_UP:
101
+ return Item.updateItemsAltitude(state, action.layerID, action.itemID, action.value).updatedState;
102
+ case SELECT_TOOL_DRAWING_ITEM_3D:
103
+ return Item.selectToolDrawingItem3D(state, action.sceneComponentType).updatedState;
104
+ case SET_DOOR_STYLE:
105
+ return Item.setDoorStyle(state, action.doorStyle, action.pathes, action.isAll).updatedState;
106
+ case SET_HANDLE_MATERIAL:
107
+ return Item.setHandleMaterial(state, action.material).updatedState;
108
+ case SET_DOOR_HANDLE:
109
+ return Item.setDoorHandle(state, action.doorHandle).updatedState;
110
+ case SET_COUNTER_TOP:
111
+ return Item.setCounterTop(state, action.counterTop).updatedState;
112
+ case SET_MOLDING:
113
+ return Item.setMolding(state, action.molding, action.isAll).updatedState;
114
+ case UPDATE_MOLDING:
115
+ return Item.updateMolding(state).updatedState;
116
+ case SET_WALL_COLOR:
117
+ state = state.merge({
118
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
119
+ }); // save history when this actino performed,so undo enable
120
+ return Item.setWallColor(state, action.wallColor).updatedState;
121
+ case SET_MODELLING:
122
+ return Item.setModelling(state, action.model).updatedState;
123
+ case SET_BACKSPLASH:
124
+ return Item.setBacksplash(state, action.backsplash).updatedState;
125
+ case SET_BACKSPLASH_VISIBLE:
126
+ return Item.setBacksplashVisible(state, action.itemID, action.backsplashVisible).updatedState;
127
+ case SET_APPLIANCE_MATERIAL:
128
+ return Item.setApplianceMaterial(state, action.material).updatedState;
129
+ case SET_INITIAL_DOOR_STYLE:
130
+ return Item.setInitialDoorStyle(state, action.doorStyle, action.oStyle).updatedState;
131
+ case UPDATE_ITEM_POSITION:
132
+ return Item.updateItemPosition(state, action.layerID, action.itemID, action.pos).updatedState;
133
+ // case SET_MOVE_STATUS:
134
+ // return state.merge({ moveStatus: action.status });
135
+ // case SET_ROTATE_STATUS:
136
+ // return state.merge({ rotateStatus: action.status });
137
+ default:
138
+ return state;
139
+ }
140
+ }
@@ -0,0 +1,45 @@
1
+ import { Line } from "../class/export";
2
+ import { history } from "../utils/export";
3
+ import { BEGIN_DRAGGING_LINE, BEGIN_DRAWING_LINE, END_DRAGGING_LINE, END_DRAWING_LINE, SELECT_LINE, SELECT_TOOL_DRAWING_LINE, SET_RELATED_LINE, STOP_DRAWING_LINE, UPDATE_DRAGGING_LINE, UPDATE_DRAWING_LINE } from "../constants";
4
+ export default function (state, action) {
5
+ switch (action.type) {
6
+ case SELECT_TOOL_DRAWING_LINE:
7
+ sessionStorage.setItem('hintTextShow', true);
8
+ setTimeout(function () {
9
+ sessionStorage.setItem('hintTextShow', false);
10
+ }, 500);
11
+ return Line.selectToolDrawingLine(state, action.sceneComponentType).updatedState;
12
+ case BEGIN_DRAWING_LINE:
13
+ state = state.merge({
14
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
15
+ });
16
+ return Line.beginDrawingLine(state, action.layerID, action.x, action.y).updatedState;
17
+ case UPDATE_DRAWING_LINE:
18
+ return Line.updateDrawingLine(state, action.x, action.y, action.relatedLines).updatedState;
19
+ case STOP_DRAWING_LINE:
20
+ return Line.stopDrawingLine(state).updatedState;
21
+ case END_DRAWING_LINE:
22
+ state = state.merge({
23
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
24
+ });
25
+ return Line.endDrawingLine(state, action.x, action.y).updatedState;
26
+ case BEGIN_DRAGGING_LINE:
27
+ state = state.merge({
28
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
29
+ });
30
+ return Line.beginDraggingLine(state, action.layerID, action.lineID, action.x, action.y).updatedState;
31
+ case UPDATE_DRAGGING_LINE:
32
+ return Line.updateDraggingLine(state, action.x, action.y, action.relatedLines).updatedState;
33
+ case END_DRAGGING_LINE:
34
+ state = state.merge({
35
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
36
+ });
37
+ return Line.endDraggingLine(state, action.x, action.y, action.relatedLines).updatedState;
38
+ case SELECT_LINE:
39
+ return Line.select(state, action.layerID, action.lineID).updatedState;
40
+ case SET_RELATED_LINE:
41
+ return Line.setRelatedLine(state, action.layerID, action.lineID, action.intersection).updatedState;
42
+ default:
43
+ return state;
44
+ }
45
+ }
@@ -0,0 +1,129 @@
1
+ import { history } from "../utils/export";
2
+ import { ADD_CIRCULAR_GUIDE, ADD_HORIZONTAL_GUIDE, ADD_VERTICAL_GUIDE, ALTERATE_STATE, CHANGE_CATALOG_PAGE, COPY_PROPERTIES, GO_BACK_TO_CATALOG_PAGE, INIT_CATALOG, LOAD_PROJECT, MODE_DRAWING_LINE, MODE_IDLE, NEW_PROJECT, OPEN_CATALOG, OPEN_PROJECT_CONFIGURATOR, PASTE_PROPERTIES, PROJECT_RE_NAME, PUSH_LAST_SELECTED_CATALOG_ELEMENT_TO_HISTORY, RECREATE, REDO, REMOVE, REMOVE_CIRCULAR_GUIDE, REMOVE_DRAWING_SUPPORT, REMOVE_HORIZONTAL_GUIDE, REMOVE_VERTICAL_GUIDE, ROLLBACK, SELECT_ALL, SELECT_TOOL_EDIT, SET_HOLES_ATTRIBUTES, SET_IS_CABINET_DRAWING, SET_IS_HELP, SET_ITEMS_ATTRIBUTES, SET_LINES_ATTRIBUTES, SET_MODE, SET_PROJECT_ID, SET_PROJECT_PROPERTIES, SET_PROPERTIES, SET_STATE_PROPERTIES, SHIFT2DOFF, SHIFT2DON, THROW_ERROR, THROW_WARNING, TOGGLE_SNAP, UNCREATE, UNDO, UNSELECT_ALL, UPDATE_MOUSE_COORDS, UPDATE_ZOOM_SCALE } from "../constants";
3
+ import { Project } from "../class/export";
4
+ export default function (state, action) {
5
+ switch (action.type) {
6
+ case NEW_PROJECT:
7
+ return Project.newProject(state).updatedState;
8
+ case LOAD_PROJECT:
9
+ return Project.loadProject(state, action.sceneJSON, action.categoryData).updatedState;
10
+ case OPEN_CATALOG:
11
+ return Project.openCatalog(state).updatedState;
12
+ case CHANGE_CATALOG_PAGE:
13
+ return Project.changeCatalogPage(state, action.oldPage, action.newPage).updatedState;
14
+ case GO_BACK_TO_CATALOG_PAGE:
15
+ return Project.goBackToCatalogPage(state, action.newPage).updatedState;
16
+ case SELECT_TOOL_EDIT:
17
+ return Project.setMode(state, MODE_IDLE).updatedState;
18
+ case UNSELECT_ALL:
19
+ return Project.unselectAll(state).updatedState;
20
+ case SELECT_ALL:
21
+ return Project.selectAll(state, action.value).updatedState;
22
+ case SET_PROPERTIES:
23
+ state = state.merge({
24
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
25
+ });
26
+ return Project.setProperties(state, state.getIn(['scene', 'selectedLayer']), action.properties).updatedState;
27
+ case SET_ITEMS_ATTRIBUTES:
28
+ state = state.merge({
29
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
30
+ });
31
+ return Project.setItemsAttributes(state, action.itemsAttributes).updatedState;
32
+ case SET_LINES_ATTRIBUTES:
33
+ if (state.mode != MODE_DRAWING_LINE) state = state.merge({
34
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
35
+ });
36
+ return Project.setLinesAttributes(state, action.linesAttributes, action.isDirect, action.directData).updatedState;
37
+ case SET_HOLES_ATTRIBUTES:
38
+ state = state.merge({
39
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
40
+ });
41
+ return Project.setHolesAttributes(state, action.holesAttributes).updatedState;
42
+ case REMOVE:
43
+ state = state.merge({
44
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
45
+ });
46
+ return Project.remove(state).updatedState;
47
+ case UNDO:
48
+ return Project.undo(state).updatedState;
49
+ case REDO:
50
+ return Project.redo(state).updatedState;
51
+ case UNCREATE:
52
+ return Project.uncreate(state).updatedState;
53
+ case PROJECT_RE_NAME:
54
+ return Project.rename(state, action.name).updatedState;
55
+ case RECREATE:
56
+ return Project.recreate(state).updatedState;
57
+ case SHIFT2DOFF:
58
+ return Project.shift2doff(state).updatedState;
59
+ case SHIFT2DON:
60
+ return Project.shift2don(state).updatedState;
61
+ case ROLLBACK:
62
+ return Project.rollback(state).updatedState;
63
+ case SET_PROJECT_PROPERTIES:
64
+ state = state.merge({
65
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
66
+ });
67
+ return Project.setProjectProperties(state, action.properties).updatedState;
68
+ case SET_PROJECT_ID:
69
+ state = state.merge({
70
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
71
+ });
72
+ return Project.setProjectId(state, action.id).updatedState;
73
+ case OPEN_PROJECT_CONFIGURATOR:
74
+ state = state.merge({
75
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
76
+ });
77
+ return Project.openProjectConfigurator(state).updatedState;
78
+ case INIT_CATALOG:
79
+ return Project.initCatalog(state, action.catalog).updatedState;
80
+ case UPDATE_MOUSE_COORDS:
81
+ return Project.updateMouseCoord(state, action.coords).updatedState;
82
+ case UPDATE_ZOOM_SCALE:
83
+ return Project.updateZoomScale(state, action.scale).updatedState;
84
+ case TOGGLE_SNAP:
85
+ return Project.toggleSnap(state, action.mask).updatedState;
86
+ case THROW_ERROR:
87
+ return Project.throwError(state, action.error).updatedState;
88
+ case THROW_WARNING:
89
+ return Project.throwWarning(state, action.warning).updatedState;
90
+ case COPY_PROPERTIES:
91
+ return Project.copyProperties(state, action.properties).updatedState;
92
+ case PASTE_PROPERTIES:
93
+ state = state.merge({
94
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
95
+ });
96
+ return Project.pasteProperties(state).updatedState;
97
+ case PUSH_LAST_SELECTED_CATALOG_ELEMENT_TO_HISTORY:
98
+ return Project.pushLastSelectedCatalogElementToHistory(state, action.element).updatedState;
99
+ case ALTERATE_STATE:
100
+ return Project.setAlterate(state).updatedState;
101
+ case SET_MODE:
102
+ return Project.setMode(state, action.mode).updatedState;
103
+ case ADD_HORIZONTAL_GUIDE:
104
+ state = state.merge({
105
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
106
+ });
107
+ return Project.addHorizontalGuide(state, action.coordinate).updatedState;
108
+ case ADD_VERTICAL_GUIDE:
109
+ return Project.addVerticalGuide(state, action.coordinate).updatedState;
110
+ case ADD_CIRCULAR_GUIDE:
111
+ return Project.addCircularGuide(state, action.x, action.y, action.radius).updatedState;
112
+ case REMOVE_HORIZONTAL_GUIDE:
113
+ return Project.removeHorizontalGuide(state, action.guideID).updatedState;
114
+ case REMOVE_VERTICAL_GUIDE:
115
+ return Project.removeVerticalGuide(state, action.guideID).updatedState;
116
+ case REMOVE_CIRCULAR_GUIDE:
117
+ return Project.removeCircularGuide(state, action.guideID).updatedState;
118
+ case REMOVE_DRAWING_SUPPORT:
119
+ return Project.removeDrawingSupport(state).updatedState;
120
+ case SET_STATE_PROPERTIES:
121
+ return Project.setStateProperties(state, action.properties).updatedState;
122
+ case SET_IS_HELP:
123
+ return Project.setIsHelp(state, action.isHelp).updatedState;
124
+ case SET_IS_CABINET_DRAWING:
125
+ return Project.setIsCabinetDrawing(state, action.isCabinetDrawing).updatedState;
126
+ default:
127
+ return state;
128
+ }
129
+ }