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

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 (359) hide show
  1. package/lib/KitchenConfiguratorApp.js +3 -0
  2. package/package.json +1 -1
  3. package/es/@history.js +0 -2
  4. package/es/AppContext.js +0 -3
  5. package/es/KitchenConfigurator.js +0 -645
  6. package/es/KitchenConfiguratorApp.js +0 -478
  7. package/es/actions/area-actions.js +0 -14
  8. package/es/actions/export.js +0 -23
  9. package/es/actions/groups-actions.js +0 -89
  10. package/es/actions/holes-actions.js +0 -119
  11. package/es/actions/items-actions.js +0 -313
  12. package/es/actions/lines-actions.js +0 -81
  13. package/es/actions/project-actions.js +0 -281
  14. package/es/actions/scene-actions.js +0 -33
  15. package/es/actions/vertices-actions.js +0 -27
  16. package/es/actions/viewer2d-actions.js +0 -58
  17. package/es/actions/viewer3d-actions.js +0 -23
  18. package/es/catalog/areas/area/planner-element.js +0 -40
  19. package/es/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
  20. package/es/catalog/areas/area/textures/grass.jpg +0 -0
  21. package/es/catalog/areas/area/textures/parquet.jpg +0 -0
  22. package/es/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
  23. package/es/catalog/areas/area/textures/tile1.jpg +0 -0
  24. package/es/catalog/catalog.js +0 -277
  25. package/es/catalog/envMap/nx.hdr +0 -0
  26. package/es/catalog/envMap/ny.hdr +0 -0
  27. package/es/catalog/envMap/nz.hdr +0 -0
  28. package/es/catalog/envMap/px.hdr +0 -0
  29. package/es/catalog/envMap/py.hdr +0 -0
  30. package/es/catalog/envMap/pz.hdr +0 -0
  31. package/es/catalog/factories/area-factory-3d.js +0 -181
  32. package/es/catalog/factories/area-factory.js +0 -81
  33. package/es/catalog/factories/export.js +0 -7
  34. package/es/catalog/factories/wall-factory-3d.js +0 -202
  35. package/es/catalog/factories/wall-factory.js +0 -268
  36. package/es/catalog/holes/door-closet/planner-element.js +0 -222
  37. package/es/catalog/holes/door-double/door_double.png +0 -0
  38. package/es/catalog/holes/door-double/planner-element.js +0 -315
  39. package/es/catalog/holes/door-exterior/planner-element.js +0 -215
  40. package/es/catalog/holes/door-interior/planner-element.js +0 -227
  41. package/es/catalog/holes/door-panic/panicDoor.png +0 -0
  42. package/es/catalog/holes/door-panic/planner-element.js +0 -503
  43. package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
  44. package/es/catalog/holes/door-panic-double/planner-element.js +0 -463
  45. package/es/catalog/holes/door-sliding/planner-element.js +0 -225
  46. package/es/catalog/holes/doorway-framed/planner-element.js +0 -145
  47. package/es/catalog/holes/doorway-frameless/planner-element.js +0 -104
  48. package/es/catalog/holes/export.js +0 -13
  49. package/es/catalog/holes/gate/gate.jpg +0 -0
  50. package/es/catalog/holes/window-clear/planner-element.js +0 -166
  51. package/es/catalog/holes/window-clear/texture.png +0 -0
  52. package/es/catalog/holes/window-cross/planner-element.js +0 -165
  53. package/es/catalog/holes/window-cross/texture.png +0 -0
  54. package/es/catalog/holes/window-double-hung/planner-element.js +0 -303
  55. package/es/catalog/holes/window-double-hung/texture.png +0 -0
  56. package/es/catalog/holes/window-vertical/planner-element.js +0 -276
  57. package/es/catalog/holes/window-vertical/texture.png +0 -0
  58. package/es/catalog/lines/wall/planner-element.js +0 -70
  59. package/es/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
  60. package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
  61. package/es/catalog/lines/wall/textures/bricks.jpg +0 -0
  62. package/es/catalog/lines/wall/textures/bricks2.jpg +0 -0
  63. package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
  64. package/es/catalog/lines/wall/textures/morden-normal.jpg +0 -0
  65. package/es/catalog/lines/wall/textures/morden.jpg +0 -0
  66. package/es/catalog/lines/wall/textures/painted-normal.jpg +0 -0
  67. package/es/catalog/lines/wall/textures/painted.jpg +0 -0
  68. package/es/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
  69. package/es/catalog/lines/wall/textures/plaster.jpg +0 -0
  70. package/es/catalog/lines/wall/wall.png +0 -0
  71. package/es/catalog/molding/molding-dcm/planner-element.js +0 -28
  72. package/es/catalog/molding/molding-dcm/texture.png +0 -0
  73. package/es/catalog/molding/molding-fbm/planner-element.js +0 -28
  74. package/es/catalog/molding/molding-fbm/texture.png +0 -0
  75. package/es/catalog/molding/molding-lrm/planner-element.js +0 -28
  76. package/es/catalog/molding/molding-lrm/texture.png +0 -0
  77. package/es/catalog/properties/export.js +0 -21
  78. package/es/catalog/properties/property-checkbox.js +0 -116
  79. package/es/catalog/properties/property-color.js +0 -39
  80. package/es/catalog/properties/property-enum.js +0 -97
  81. package/es/catalog/properties/property-hidden.js +0 -19
  82. package/es/catalog/properties/property-lenght-measure.js +0 -101
  83. package/es/catalog/properties/property-length-measure.js +0 -134
  84. package/es/catalog/properties/property-length-measure_hole.js +0 -101
  85. package/es/catalog/properties/property-number.js +0 -48
  86. package/es/catalog/properties/property-read-only.js +0 -26
  87. package/es/catalog/properties/property-string.js +0 -48
  88. package/es/catalog/properties/property-toggle.js +0 -39
  89. package/es/catalog/properties/shared-property-style.js +0 -14
  90. package/es/catalog/utils/FuseUtils.js +0 -82
  91. package/es/catalog/utils/exporter.js +0 -148
  92. package/es/catalog/utils/geom-utils.js +0 -189
  93. package/es/catalog/utils/item-loader.js +0 -1521
  94. package/es/catalog/utils/load-obj.js +0 -91
  95. package/es/catalog/utils/mtl-loader.js +0 -358
  96. package/es/catalog/utils/obj-loader.js +0 -477
  97. package/es/class/FuseUtils.js +0 -82
  98. package/es/class/area.js +0 -145
  99. package/es/class/export.js +0 -24
  100. package/es/class/group.js +0 -440
  101. package/es/class/guide.js +0 -62
  102. package/es/class/hole.js +0 -929
  103. package/es/class/item.js +0 -1883
  104. package/es/class/layer.js +0 -667
  105. package/es/class/line.js +0 -1180
  106. package/es/class/project.js +0 -793
  107. package/es/class/vertex.js +0 -202
  108. package/es/components/content.js +0 -107
  109. package/es/components/disclaimer/disclaimer.js +0 -97
  110. package/es/components/export.js +0 -9
  111. package/es/components/style/button.js +0 -113
  112. package/es/components/style/cancel-button.js +0 -22
  113. package/es/components/style/content-container.js +0 -33
  114. package/es/components/style/content-title.js +0 -29
  115. package/es/components/style/delete-button.js +0 -25
  116. package/es/components/style/export.js +0 -31
  117. package/es/components/style/form-block.js +0 -24
  118. package/es/components/style/form-color-input.js +0 -27
  119. package/es/components/style/form-label.js +0 -26
  120. package/es/components/style/form-number-input.js +0 -213
  121. package/es/components/style/form-number-input_2.js +0 -206
  122. package/es/components/style/form-select.js +0 -68
  123. package/es/components/style/form-slider.js +0 -61
  124. package/es/components/style/form-submit-button.js +0 -26
  125. package/es/components/style/form-text-input.js +0 -95
  126. package/es/components/viewer2d/area.js +0 -81
  127. package/es/components/viewer2d/export.js +0 -31
  128. package/es/components/viewer2d/grids/grid-horizontal-streak.js +0 -37
  129. package/es/components/viewer2d/grids/grid-streak.js +0 -37
  130. package/es/components/viewer2d/grids/grid-vertical-streak.js +0 -37
  131. package/es/components/viewer2d/grids/grids.js +0 -35
  132. package/es/components/viewer2d/group.js +0 -53
  133. package/es/components/viewer2d/item.js +0 -513
  134. package/es/components/viewer2d/layer.js +0 -164
  135. package/es/components/viewer2d/line.js +0 -882
  136. package/es/components/viewer2d/ruler.js +0 -100
  137. package/es/components/viewer2d/rulerDist.js +0 -146
  138. package/es/components/viewer2d/rulerX.js +0 -151
  139. package/es/components/viewer2d/rulerY.js +0 -153
  140. package/es/components/viewer2d/scene.js +0 -140
  141. package/es/components/viewer2d/snap.js +0 -74
  142. package/es/components/viewer2d/state.js +0 -78
  143. package/es/components/viewer2d/utils.js +0 -198
  144. package/es/components/viewer2d/vertex.js +0 -65
  145. package/es/components/viewer2d/viewer2d.js +0 -1398
  146. package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2592
  147. package/es/components/viewer3d/dcm.js +0 -401
  148. package/es/components/viewer3d/fbm.js +0 -414
  149. package/es/components/viewer3d/front3D.js +0 -66
  150. package/es/components/viewer3d/grid-creator.js +0 -25
  151. package/es/components/viewer3d/grids/grid-horizontal-streak.js +0 -36
  152. package/es/components/viewer3d/grids/grid-streak.js +0 -27
  153. package/es/components/viewer3d/grids/grid-vertical-streak.js +0 -36
  154. package/es/components/viewer3d/libs/first-person-controls.js +0 -67
  155. package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1281
  156. package/es/components/viewer3d/libs/mtl-loader.js +0 -357
  157. package/es/components/viewer3d/libs/obj-loader.js +0 -462
  158. package/es/components/viewer3d/libs/orbit-controls.js +0 -699
  159. package/es/components/viewer3d/libs/pointer-lock-controls.js +0 -46
  160. package/es/components/viewer3d/lrm.js +0 -305
  161. package/es/components/viewer3d/model.js +0 -708
  162. package/es/components/viewer3d/pointer-lock-navigation.js +0 -115
  163. package/es/components/viewer3d/ruler-utils/itemRect.js +0 -61
  164. package/es/components/viewer3d/ruler-utils/layer3D.js +0 -495
  165. package/es/components/viewer3d/ruler-utils/ruler3D.js +0 -227
  166. package/es/components/viewer3d/ruler-utils/scene3D.js +0 -60
  167. package/es/components/viewer3d/ruler-utils/state3D.js +0 -18
  168. package/es/components/viewer3d/scene-creator.js +0 -3608
  169. package/es/components/viewer3d/three-memory-cleaner.js +0 -51
  170. package/es/components/viewer3d/viewer3d-first-person.js +0 -315
  171. package/es/components/viewer3d/viewer3d.js +0 -2527
  172. package/es/constants.js +0 -636
  173. package/es/index.js +0 -16
  174. package/es/models.js +0 -510
  175. package/es/plugins/SVGLoader.js +0 -1412
  176. package/es/plugins/autosave.js +0 -33
  177. package/es/plugins/console-debugger.js +0 -37
  178. package/es/plugins/export.js +0 -9
  179. package/es/plugins/keyboard.js +0 -101
  180. package/es/reducers/areas-reducer.js +0 -12
  181. package/es/reducers/export.js +0 -25
  182. package/es/reducers/groups-reducer.js +0 -38
  183. package/es/reducers/holes-reducer.js +0 -62
  184. package/es/reducers/items-reducer.js +0 -140
  185. package/es/reducers/lines-reducer.js +0 -45
  186. package/es/reducers/project-reducer.js +0 -129
  187. package/es/reducers/reducer.js +0 -19
  188. package/es/reducers/scene-reducer.js +0 -28
  189. package/es/reducers/user-reducer.js +0 -40
  190. package/es/reducers/vertices-reducer.js +0 -19
  191. package/es/reducers/viewer2d-reducer.js +0 -75
  192. package/es/reducers/viewer3d-reducer.js +0 -56
  193. package/es/shared-style.js +0 -66
  194. package/es/styles/export.js +0 -5
  195. package/es/styles/tabs.css +0 -40
  196. package/es/translator/en.js +0 -104
  197. package/es/translator/it.js +0 -79
  198. package/es/translator/ru.js +0 -79
  199. package/es/translator/translator.js +0 -84
  200. package/es/utils/browser.js +0 -33
  201. package/es/utils/email-validator.js +0 -4
  202. package/es/utils/export.js +0 -25
  203. package/es/utils/geometry.js +0 -2420
  204. package/es/utils/get-edges-of-subgraphs.js +0 -27
  205. package/es/utils/graph-cycles.js +0 -237
  206. package/es/utils/graph-inner-cycles.js +0 -46
  207. package/es/utils/graph.js +0 -150
  208. package/es/utils/helper.js +0 -268
  209. package/es/utils/history.js +0 -29
  210. package/es/utils/id-broker.js +0 -19
  211. package/es/utils/logger.js +0 -8
  212. package/es/utils/math.js +0 -50
  213. package/es/utils/molding.js +0 -871
  214. package/es/utils/name-generator.js +0 -18
  215. package/es/utils/objects-utils.js +0 -50
  216. package/es/utils/phone-validator.js +0 -4
  217. package/es/utils/process-black-list.js +0 -18
  218. package/es/utils/react-if.js +0 -18
  219. package/es/utils/snap-scene.js +0 -99
  220. package/es/utils/snap.js +0 -237
  221. package/es/utils/summarizeCart.js +0 -24
  222. package/es/utils/threeCSG.es6.js +0 -498
  223. package/es/version.js +0 -2
  224. package/lib/catalog/properties/property-string.js +0 -55
  225. package/lib/catalog/properties/property-toggle.js +0 -46
  226. package/lib/catalog/properties/shared-property-style.js +0 -20
  227. package/lib/catalog/utils/FuseUtils.js +0 -88
  228. package/lib/catalog/utils/exporter.js +0 -155
  229. package/lib/catalog/utils/geom-utils.js +0 -205
  230. package/lib/catalog/utils/item-loader.js +0 -1533
  231. package/lib/catalog/utils/load-obj.js +0 -99
  232. package/lib/catalog/utils/mtl-loader.js +0 -363
  233. package/lib/catalog/utils/obj-loader.js +0 -482
  234. package/lib/class/FuseUtils.js +0 -88
  235. package/lib/class/area.js +0 -150
  236. package/lib/class/export.js +0 -96
  237. package/lib/class/group.js +0 -445
  238. package/lib/class/guide.js +0 -67
  239. package/lib/class/hole.js +0 -934
  240. package/lib/class/item.js +0 -1889
  241. package/lib/class/layer.js +0 -672
  242. package/lib/class/line.js +0 -1186
  243. package/lib/class/project.js +0 -799
  244. package/lib/class/vertex.js +0 -207
  245. package/lib/components/content.js +0 -116
  246. package/lib/components/disclaimer/disclaimer.js +0 -105
  247. package/lib/components/export.js +0 -33
  248. package/lib/components/style/button.js +0 -120
  249. package/lib/components/style/cancel-button.js +0 -29
  250. package/lib/components/style/content-container.js +0 -40
  251. package/lib/components/style/content-title.js +0 -37
  252. package/lib/components/style/delete-button.js +0 -34
  253. package/lib/components/style/export.js +0 -121
  254. package/lib/components/style/form-block.js +0 -31
  255. package/lib/components/style/form-color-input.js +0 -34
  256. package/lib/components/style/form-label.js +0 -33
  257. package/lib/components/style/form-number-input.js +0 -220
  258. package/lib/components/style/form-number-input_2.js +0 -213
  259. package/lib/components/style/form-select.js +0 -75
  260. package/lib/components/style/form-slider.js +0 -68
  261. package/lib/components/style/form-submit-button.js +0 -35
  262. package/lib/components/style/form-text-input.js +0 -101
  263. package/lib/components/viewer2d/area.js +0 -88
  264. package/lib/components/viewer2d/export.js +0 -121
  265. package/lib/components/viewer2d/grids/grid-horizontal-streak.js +0 -44
  266. package/lib/components/viewer2d/grids/grid-streak.js +0 -44
  267. package/lib/components/viewer2d/grids/grid-vertical-streak.js +0 -44
  268. package/lib/components/viewer2d/grids/grids.js +0 -44
  269. package/lib/components/viewer2d/group.js +0 -62
  270. package/lib/components/viewer2d/item.js +0 -521
  271. package/lib/components/viewer2d/layer.js +0 -171
  272. package/lib/components/viewer2d/line.js +0 -892
  273. package/lib/components/viewer2d/ruler.js +0 -107
  274. package/lib/components/viewer2d/rulerDist.js +0 -153
  275. package/lib/components/viewer2d/rulerX.js +0 -158
  276. package/lib/components/viewer2d/rulerY.js +0 -160
  277. package/lib/components/viewer2d/scene.js +0 -147
  278. package/lib/components/viewer2d/snap.js +0 -83
  279. package/lib/components/viewer2d/state.js +0 -87
  280. package/lib/components/viewer2d/utils.js +0 -210
  281. package/lib/components/viewer2d/vertex.js +0 -74
  282. package/lib/components/viewer2d/viewer2d.js +0 -1405
  283. package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2597
  284. package/lib/components/viewer3d/dcm.js +0 -407
  285. package/lib/components/viewer3d/fbm.js +0 -420
  286. package/lib/components/viewer3d/front3D.js +0 -75
  287. package/lib/components/viewer3d/grid-creator.js +0 -34
  288. package/lib/components/viewer3d/grids/grid-horizontal-streak.js +0 -44
  289. package/lib/components/viewer3d/grids/grid-streak.js +0 -35
  290. package/lib/components/viewer3d/grids/grid-vertical-streak.js +0 -44
  291. package/lib/components/viewer3d/libs/first-person-controls.js +0 -74
  292. package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1287
  293. package/lib/components/viewer3d/libs/mtl-loader.js +0 -363
  294. package/lib/components/viewer3d/libs/obj-loader.js +0 -468
  295. package/lib/components/viewer3d/libs/orbit-controls.js +0 -705
  296. package/lib/components/viewer3d/libs/pointer-lock-controls.js +0 -52
  297. package/lib/components/viewer3d/lrm.js +0 -311
  298. package/lib/components/viewer3d/model.js +0 -714
  299. package/lib/components/viewer3d/pointer-lock-navigation.js +0 -122
  300. package/lib/components/viewer3d/ruler-utils/itemRect.js +0 -68
  301. package/lib/components/viewer3d/ruler-utils/layer3D.js +0 -502
  302. package/lib/components/viewer3d/ruler-utils/ruler3D.js +0 -234
  303. package/lib/components/viewer3d/ruler-utils/scene3D.js +0 -68
  304. package/lib/components/viewer3d/ruler-utils/state3D.js +0 -25
  305. package/lib/components/viewer3d/scene-creator.js +0 -3642
  306. package/lib/components/viewer3d/three-memory-cleaner.js +0 -60
  307. package/lib/components/viewer3d/viewer3d-first-person.js +0 -320
  308. package/lib/components/viewer3d/viewer3d.js +0 -2532
  309. package/lib/constants.js +0 -645
  310. package/lib/index.js +0 -96
  311. package/lib/models.js +0 -517
  312. package/lib/plugins/SVGLoader.js +0 -1417
  313. package/lib/plugins/autosave.js +0 -39
  314. package/lib/plugins/console-debugger.js +0 -44
  315. package/lib/plugins/export.js +0 -33
  316. package/lib/plugins/keyboard.js +0 -107
  317. package/lib/reducers/areas-reducer.js +0 -18
  318. package/lib/reducers/export.js +0 -97
  319. package/lib/reducers/groups-reducer.js +0 -44
  320. package/lib/reducers/holes-reducer.js +0 -68
  321. package/lib/reducers/items-reducer.js +0 -146
  322. package/lib/reducers/lines-reducer.js +0 -51
  323. package/lib/reducers/project-reducer.js +0 -135
  324. package/lib/reducers/reducer.js +0 -26
  325. package/lib/reducers/scene-reducer.js +0 -34
  326. package/lib/reducers/user-reducer.js +0 -46
  327. package/lib/reducers/vertices-reducer.js +0 -25
  328. package/lib/reducers/viewer2d-reducer.js +0 -82
  329. package/lib/reducers/viewer3d-reducer.js +0 -63
  330. package/lib/shared-style.js +0 -72
  331. package/lib/styles/export.js +0 -13
  332. package/lib/translator/en.js +0 -110
  333. package/lib/translator/it.js +0 -85
  334. package/lib/translator/ru.js +0 -85
  335. package/lib/translator/translator.js +0 -90
  336. package/lib/utils/browser.js +0 -40
  337. package/lib/utils/email-validator.js +0 -10
  338. package/lib/utils/export.js +0 -56
  339. package/lib/utils/geometry.js +0 -2516
  340. package/lib/utils/get-edges-of-subgraphs.js +0 -34
  341. package/lib/utils/graph-cycles.js +0 -240
  342. package/lib/utils/graph-inner-cycles.js +0 -54
  343. package/lib/utils/graph.js +0 -157
  344. package/lib/utils/helper.js +0 -291
  345. package/lib/utils/history.js +0 -36
  346. package/lib/utils/id-broker.js +0 -25
  347. package/lib/utils/logger.js +0 -14
  348. package/lib/utils/math.js +0 -57
  349. package/lib/utils/molding.js +0 -895
  350. package/lib/utils/name-generator.js +0 -23
  351. package/lib/utils/objects-utils.js +0 -60
  352. package/lib/utils/phone-validator.js +0 -10
  353. package/lib/utils/process-black-list.js +0 -24
  354. package/lib/utils/react-if.js +0 -24
  355. package/lib/utils/snap-scene.js +0 -105
  356. package/lib/utils/snap.js +0 -249
  357. package/lib/utils/summarizeCart.js +0 -30
  358. package/lib/utils/threeCSG.es6.js +0 -503
  359. package/lib/version.js +0 -8
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
- 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); }
8
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
9
- function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
10
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
11
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
12
- 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); }
13
- var NameGenerator = exports["default"] = /*#__PURE__*/function () {
14
- function NameGenerator() {
15
- _classCallCheck(this, NameGenerator);
16
- }
17
- return _createClass(NameGenerator, null, [{
18
- key: "generateName",
19
- value: function generateName(prototype, type) {
20
- return type.substr(0, 1).toUpperCase() + type.substr(1);
21
- }
22
- }]);
23
- }();
@@ -1,60 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getAllMeshes = getAllMeshes;
7
- exports.objectsCompare = objectsCompare;
8
- exports.objectsMap = objectsMap;
9
- exports.vectorIntersectWithMesh = vectorIntersectWithMesh;
10
- var Three = _interopRequireWildcard(require("three"));
11
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
12
- 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); }
13
- String.prototype.isLeftPlaceholder = function () {
14
- return this.match(/_L$|_L_\d$/) != null;
15
- };
16
- String.prototype.isRightPlaceholder = function () {
17
- return this.match(/_R$|_R_\d$/) != null;
18
- };
19
- function objectsMap(object, func) {
20
- var mappedObject = {};
21
- for (var key in object) {
22
- mappedObject[key] = func(key, mappedObject[key]);
23
- }
24
- return mappedObject;
25
- }
26
- function objectsCompare(x, y) {
27
- if (x === y) return true;
28
- if (!(x instanceof Object) || !(y instanceof Object)) return false;
29
- if (x.constructor !== y.constructor) return false;
30
- for (var p in x) {
31
- if (!x.hasOwnProperty(p)) continue;
32
- if (!y.hasOwnProperty(p)) return false;
33
- if (x[p] === y[p]) continue;
34
- if (_typeof(x[p]) !== 'object') return false;
35
- if (!objectsCompare(x[p], y[p])) return false;
36
- }
37
- for (var _p in y) {
38
- if (y.hasOwnProperty(_p) && !x.hasOwnProperty(_p)) return false;
39
- }
40
- return true;
41
- }
42
- function getAllMeshes(objects) {
43
- var meshes = [];
44
- objects.forEach(function (object) {
45
- if (!object) return;
46
- object.traverse(function (o) {
47
- if (o.isMesh && o.geometry) {
48
- meshes.push(o);
49
- }
50
- });
51
- });
52
- return meshes;
53
- }
54
- function vectorIntersectWithMesh(origin, target) {
55
- var vectorDir = new Three.Vector3(origin.x, origin.y - 1000, origin.z);
56
- var ray = new Three.Raycaster();
57
- ray.set(origin, vectorDir);
58
- var intersects = ray.intersectObject(target, true);
59
- return intersects.length > 0;
60
- }
@@ -1,10 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.phoneValidation = void 0;
7
- var phoneValidation = exports.phoneValidation = function phoneValidation(phone) {
8
- var result = /^(\+1\s?)?(\(?\d{3}\)?[\s.-]?)?\d{3}[\s.-]?\d{4}$/;
9
- return result.test(String(phone).toLowerCase());
10
- };
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.buildCurrentCabinetObject = void 0;
7
- 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); }
8
- 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; }
9
- 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; }
10
- 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; }
11
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
12
- 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); }
13
- var buildCurrentCabinetObject = exports.buildCurrentCabinetObject = function buildCurrentCabinetObject(cabinet, texture) {
14
- return {
15
- type: cabinet.name,
16
- // e.g. "B09"
17
- name: cabinet.name,
18
- category: cabinet.type,
19
- // "cabinet"
20
- doorStyle: _objectSpread({}, texture),
21
- itemID: cabinet.itemID,
22
- sku_number: cabinet.name
23
- };
24
- };
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = If;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
- /**
11
- * @return {null}
12
- */
13
- function If(_ref) {
14
- var condition = _ref.condition,
15
- style = _ref.style,
16
- children = _ref.children;
17
- return condition ? Array.isArray(children) ? /*#__PURE__*/_react["default"].createElement("div", {
18
- style: style
19
- }, children) : children : null;
20
- }
21
- If.propTypes = {
22
- condition: _propTypes["default"].bool.isRequired,
23
- style: _propTypes["default"].object
24
- };
@@ -1,105 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.sceneSnapElements = sceneSnapElements;
7
- var _snap = require("./snap");
8
- var _export = require("./export");
9
- var _immutable = require("immutable");
10
- function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
11
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
15
- function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
16
- function sceneSnapElements(scene) {
17
- var snapElements = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new _immutable.List();
18
- var snapMask = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new _immutable.Map();
19
- var width = scene.width,
20
- height = scene.height;
21
- var a, b, c;
22
- return snapElements.withMutations(function (snapElements) {
23
- scene.layers.forEach(function (layer) {
24
- var lines = layer.lines,
25
- vertices = layer.vertices;
26
- vertices.forEach(function (_ref) {
27
- var vertexID = _ref.id,
28
- x = _ref.x,
29
- y = _ref.y;
30
- if (snapMask.get(_snap.SNAP_POINT)) {
31
- (0, _snap.addPointSnap)(snapElements, x, y, 10, 10, vertexID);
32
- }
33
- if (snapMask.get(_snap.SNAP_LINE)) {
34
- var _GeometryUtils$horizo = _export.GeometryUtils.horizontalLine(y);
35
- a = _GeometryUtils$horizo.a;
36
- b = _GeometryUtils$horizo.b;
37
- c = _GeometryUtils$horizo.c;
38
- (0, _snap.addLineSnap)(snapElements, a, b, c, 10, 1, vertexID);
39
- var _GeometryUtils$vertic = _export.GeometryUtils.verticalLine(x);
40
- a = _GeometryUtils$vertic.a;
41
- b = _GeometryUtils$vertic.b;
42
- c = _GeometryUtils$vertic.c;
43
- (0, _snap.addLineSnap)(snapElements, a, b, c, 10, 1, vertexID);
44
- var _GeometryUtils$upcros = _export.GeometryUtils.upcrossLine(x, y);
45
- a = _GeometryUtils$upcros.a;
46
- b = _GeometryUtils$upcros.b;
47
- c = _GeometryUtils$upcros.c;
48
- (0, _snap.addLineSnap)(snapElements, a, b, c, 10, 3, null);
49
- var _GeometryUtils$downcr = _export.GeometryUtils.downcrossLine(x, y);
50
- a = _GeometryUtils$downcr.a;
51
- b = _GeometryUtils$downcr.b;
52
- c = _GeometryUtils$downcr.c;
53
- (0, _snap.addLineSnap)(snapElements, a, b, c, 10, 3, null);
54
- }
55
- });
56
- if (snapMask.get(_snap.SNAP_SEGMENT)) {
57
- lines.forEach(function (_ref2) {
58
- var lineID = _ref2.id,
59
- _ref2$vertices = _slicedToArray(_ref2.vertices, 2),
60
- v0 = _ref2$vertices[0],
61
- v1 = _ref2$vertices[1];
62
- var _vertices$get = vertices.get(v0),
63
- x1 = _vertices$get.x,
64
- y1 = _vertices$get.y;
65
- var _vertices$get2 = vertices.get(v1),
66
- x2 = _vertices$get2.x,
67
- y2 = _vertices$get2.y;
68
- (0, _snap.addLineSegmentSnap)(snapElements, x1, y1, x2, y2, 20, 1, lineID);
69
- });
70
- }
71
- });
72
- if (snapMask.get(_snap.SNAP_GRID)) {
73
- var divider = 5;
74
- var gridCellSize = 100 / divider;
75
- var xCycle = width / gridCellSize;
76
- var yCycle = height / gridCellSize;
77
- for (var x = 0; x < xCycle; x++) {
78
- var xMul = x * gridCellSize;
79
- for (var y = 0; y < yCycle; y++) {
80
- var yMul = y * gridCellSize;
81
- var onXCross = !(x % divider) ? true : false;
82
- var onYCross = !(y % divider) ? true : false;
83
- (0, _snap.addGridSnap)(snapElements, xMul, yMul, 10, onXCross && onYCross ? 15 : 10, null);
84
- }
85
- }
86
- }
87
- if (snapMask.get(_snap.SNAP_GUIDE)) {
88
- var horizontal = scene.getIn(['guides', 'horizontal']);
89
- var vertical = scene.getIn(['guides', 'vertical']);
90
- var hValues = horizontal.valueSeq();
91
- var vValues = vertical.valueSeq();
92
- hValues.forEach(function (hVal) {
93
- vValues.forEach(function (vVal) {
94
- (0, _snap.addPointSnap)(snapElements, vVal, hVal, 10, 10);
95
- });
96
- });
97
- hValues.forEach(function (hVal) {
98
- return (0, _snap.addLineSegmentSnap)(snapElements, 0, hVal, width, hVal, 20, 1);
99
- });
100
- vValues.forEach(function (vVal) {
101
- return (0, _snap.addLineSegmentSnap)(snapElements, vVal, 0, vVal, height, 20, 1);
102
- });
103
- }
104
- });
105
- }
package/lib/utils/snap.js DELETED
@@ -1,249 +0,0 @@
1
- "use strict";
2
-
3
- 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); }
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.SNAP_SEGMENT = exports.SNAP_POINT = exports.SNAP_MASK = exports.SNAP_LINE = exports.SNAP_GUIDE = exports.SNAP_GRID = void 0;
8
- exports.addGridSnap = addGridSnap;
9
- exports.addLineSegmentSnap = addLineSegmentSnap;
10
- exports.addLineSnap = addLineSnap;
11
- exports.addPointSnap = addPointSnap;
12
- exports.nearestSnap = nearestSnap;
13
- var _immutable = require("immutable");
14
- var Geometry = _interopRequireWildcard(require("./geometry"));
15
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
16
- 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; }
17
- 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; }
18
- 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; }
19
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
20
- function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
21
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
22
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
23
- 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); }
24
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
25
- function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
26
- function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
27
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
28
- function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
29
- function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
30
- function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
31
- var SNAP_POINT = exports.SNAP_POINT = 'SNAP_POINT';
32
- var SNAP_LINE = exports.SNAP_LINE = 'SNAP_LINE';
33
- var SNAP_SEGMENT = exports.SNAP_SEGMENT = 'SNAP_SEGMENT';
34
- var SNAP_GRID = exports.SNAP_GRID = 'SNAP_GRID';
35
- var SNAP_GUIDE = exports.SNAP_GUIDE = 'SNAP_GUIDE';
36
- var SNAP_MASK = exports.SNAP_MASK = new _immutable.Map({
37
- SNAP_POINT: true,
38
- SNAP_LINE: true,
39
- SNAP_SEGMENT: true,
40
- SNAP_GRID: false,
41
- SNAP_GUIDE: true
42
- });
43
- var PointSnap = /*#__PURE__*/function (_Record) {
44
- function PointSnap() {
45
- _classCallCheck(this, PointSnap);
46
- return _callSuper(this, PointSnap, arguments);
47
- }
48
- _inherits(PointSnap, _Record);
49
- return _createClass(PointSnap, [{
50
- key: "nearestPoint",
51
- value: function nearestPoint(x, y) {
52
- return {
53
- x: this.x,
54
- y: this.y,
55
- distance: Geometry.pointsDistance(this.x, this.y, x, y)
56
- };
57
- }
58
- }, {
59
- key: "isNear",
60
- value: function isNear(x, y, distance) {
61
- return ~(this.x - x) + 1 < distance && ~(this.y - y) + 1 < distance;
62
- }
63
- }]);
64
- }((0, _immutable.Record)({
65
- type: 'point',
66
- x: -1,
67
- y: -1,
68
- radius: 1,
69
- priority: 1,
70
- related: new _immutable.List()
71
- }));
72
- var LineSnap = /*#__PURE__*/function (_Record2) {
73
- function LineSnap() {
74
- _classCallCheck(this, LineSnap);
75
- return _callSuper(this, LineSnap, arguments);
76
- }
77
- _inherits(LineSnap, _Record2);
78
- return _createClass(LineSnap, [{
79
- key: "nearestPoint",
80
- value: function nearestPoint(x, y) {
81
- return _objectSpread(_objectSpread({}, Geometry.closestPointFromLine(this.a, this.b, this.c, x, y)), {}, {
82
- distance: Geometry.distancePointFromLine(this.a, this.b, this.c, x, y)
83
- });
84
- }
85
- }, {
86
- key: "isNear",
87
- value: function isNear(x, y, distance) {
88
- return true;
89
- }
90
- }]);
91
- }((0, _immutable.Record)({
92
- type: 'line',
93
- a: -1,
94
- b: -1,
95
- c: -1,
96
- radius: 1,
97
- priority: 1,
98
- related: new _immutable.List()
99
- }));
100
- var LineSegmentSnap = /*#__PURE__*/function (_Record3) {
101
- function LineSegmentSnap() {
102
- _classCallCheck(this, LineSegmentSnap);
103
- return _callSuper(this, LineSegmentSnap, arguments);
104
- }
105
- _inherits(LineSegmentSnap, _Record3);
106
- return _createClass(LineSegmentSnap, [{
107
- key: "nearestPoint",
108
- value: function nearestPoint(x, y) {
109
- return _objectSpread(_objectSpread({}, Geometry.closestPointFromLineSegment(this.x1, this.y1, this.x2, this.y2, x, y)), {}, {
110
- distance: Geometry.distancePointFromLineSegment({
111
- x: this.x1,
112
- y: this.y1
113
- }, {
114
- x: this.x2,
115
- y: this.y2
116
- }, x, y)
117
- });
118
- }
119
- }, {
120
- key: "isNear",
121
- value: function isNear(x, y, distance) {
122
- return true;
123
- }
124
- }]);
125
- }((0, _immutable.Record)({
126
- type: 'line-segment',
127
- x1: -1,
128
- y1: -1,
129
- x2: -1,
130
- y2: -1,
131
- radius: 1,
132
- priority: 1,
133
- related: new _immutable.List()
134
- }));
135
- var GridSnap = /*#__PURE__*/function (_Record4) {
136
- function GridSnap() {
137
- _classCallCheck(this, GridSnap);
138
- return _callSuper(this, GridSnap, arguments);
139
- }
140
- _inherits(GridSnap, _Record4);
141
- return _createClass(GridSnap, [{
142
- key: "nearestPoint",
143
- value: function nearestPoint(x, y) {
144
- return {
145
- x: this.x,
146
- y: this.y,
147
- distance: Geometry.pointsDistance(this.x, this.y, x, y)
148
- };
149
- }
150
- }, {
151
- key: "isNear",
152
- value: function isNear(x, y, distance) {
153
- return ~(this.x - x) + 1 < distance && ~(this.y - y) + 1 < distance;
154
- }
155
- }]);
156
- }((0, _immutable.Record)({
157
- type: 'grid',
158
- x: -1,
159
- y: -1,
160
- radius: 1,
161
- priority: 1,
162
- related: new _immutable.List()
163
- }));
164
- function nearestSnap(snapElements, x, y, snapMask) {
165
- var filter = {
166
- point: snapMask.get(SNAP_POINT),
167
- line: snapMask.get(SNAP_LINE),
168
- 'line-segment': snapMask.get(SNAP_SEGMENT),
169
- grid: snapMask.get(SNAP_GRID)
170
- };
171
- return snapElements.valueSeq().filter(function (el) {
172
- return filter[el.type] && el.isNear(x, y, el.radius);
173
- }).map(function (snap) {
174
- return {
175
- snap: snap,
176
- point: snap.nearestPoint(x, y)
177
- };
178
- }).filter(function (_ref) {
179
- var radius = _ref.snap.radius,
180
- distance = _ref.point.distance;
181
- return distance < radius;
182
- }).min(function (_ref2, _ref3) {
183
- var p1 = _ref2.snap.priority,
184
- d1 = _ref2.point.distance;
185
- var p2 = _ref3.snap.priority,
186
- d2 = _ref3.point.distance;
187
- return p1 === p2 ? d1 < d2 ? -1 : 1 : p1 > p2 ? -1 : 1;
188
- });
189
- }
190
- function addPointSnap(snapElements, x, y, radius, priority, related) {
191
- related = new _immutable.List([related]);
192
- return snapElements.push(new PointSnap({
193
- x: x,
194
- y: y,
195
- radius: radius,
196
- priority: priority,
197
- related: related
198
- }));
199
- }
200
- function addLineSnap(snapElements, a, b, c, radius, priority, related) {
201
- related = new _immutable.List([related]);
202
- return snapElements.withMutations(function (snapElements) {
203
- var alreadyPresent = snapElements.some(function (lineSnap) {
204
- return lineSnap.type === 'line' && a === lineSnap.a && b === lineSnap.b && c === lineSnap.c;
205
- });
206
- if (alreadyPresent) return snapElements;
207
- var intersections = snapElements.valueSeq().filter(function (snap) {
208
- return snap.type === 'line';
209
- }).map(function (snap) {
210
- return Geometry.twoLinesIntersection(snap.a, snap.b, snap.c, a, b, c);
211
- }).filter(function (intersection) {
212
- return intersection !== undefined;
213
- }).forEach(function (_ref4) {
214
- var x = _ref4.x,
215
- y = _ref4.y;
216
- return addPointSnap(snapElements, x, y, 20, 40);
217
- });
218
- snapElements.push(new LineSnap({
219
- a: a,
220
- b: b,
221
- c: c,
222
- radius: radius,
223
- priority: priority,
224
- related: related
225
- }));
226
- });
227
- }
228
- function addLineSegmentSnap(snapElements, x1, y1, x2, y2, radius, priority, related) {
229
- related = new _immutable.List([related]);
230
- return snapElements.push(new LineSegmentSnap({
231
- x1: x1,
232
- y1: y1,
233
- x2: x2,
234
- y2: y2,
235
- radius: radius,
236
- priority: priority,
237
- related: related
238
- }));
239
- }
240
- function addGridSnap(snapElements, x, y, radius, priority, related) {
241
- related = new _immutable.List([related]);
242
- return snapElements.push(new GridSnap({
243
- x: x,
244
- y: y,
245
- radius: radius,
246
- priority: priority,
247
- related: related
248
- }));
249
- }
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.summarizeItems = summarizeItems;
7
- function summarizeItems(items) {
8
- var totalCount = 0;
9
- var totalPrice = 0;
10
- var totalRegularPrice = 0;
11
- for (var sku in items) {
12
- var item = items[sku];
13
- var _ref = item || {},
14
- _ref$count = _ref.count,
15
- count = _ref$count === void 0 ? 0 : _ref$count,
16
- _ref$regularPrice = _ref.regularPrice,
17
- regularPrice = _ref$regularPrice === void 0 ? 0 : _ref$regularPrice,
18
- disCountPrice = _ref.disCountPrice;
19
- var priceToUse = typeof disCountPrice === 'number' && !isNaN(disCountPrice) ? disCountPrice : regularPrice;
20
- totalCount += count;
21
- totalPrice += count * priceToUse;
22
- totalRegularPrice += count * regularPrice;
23
- }
24
- return {
25
- totalCount: totalCount,
26
- totalRegularPrice: totalRegularPrice,
27
- totalPrice: totalPrice,
28
- totalSavings: totalRegularPrice - totalPrice
29
- };
30
- }