kitchen-simulator 1.1.1-test.61 → 1.1.1-test.63

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 (189) hide show
  1. package/es/@history.js +2 -10
  2. package/es/AppContext.js +3 -10
  3. package/es/KitchenConfigurator.js +70 -79
  4. package/es/KitchenConfiguratorApp.js +98 -107
  5. package/es/actions/area-actions.js +5 -12
  6. package/es/actions/export.js +12 -29
  7. package/es/actions/groups-actions.js +27 -45
  8. package/es/actions/holes-actions.js +34 -55
  9. package/es/actions/items-actions.js +94 -145
  10. package/es/actions/lines-actions.js +21 -36
  11. package/es/actions/project-actions.js +94 -145
  12. package/es/actions/scene-actions.js +11 -21
  13. package/es/actions/vertices-actions.js +7 -15
  14. package/es/actions/viewer2d-actions.js +21 -36
  15. package/es/actions/viewer3d-actions.js +9 -18
  16. package/es/catalog/areas/area/planner-element.js +2 -9
  17. package/es/catalog/catalog.js +15 -21
  18. package/es/catalog/factories/area-factory-3d.js +22 -31
  19. package/es/catalog/factories/area-factory.js +11 -20
  20. package/es/catalog/factories/export.js +6 -24
  21. package/es/catalog/factories/wall-factory-3d.js +31 -41
  22. package/es/catalog/factories/wall-factory.js +21 -31
  23. package/es/catalog/holes/door-closet/planner-element.js +15 -24
  24. package/es/catalog/holes/door-double/planner-element.js +15 -24
  25. package/es/catalog/holes/door-exterior/planner-element.js +16 -25
  26. package/es/catalog/holes/door-interior/planner-element.js +16 -25
  27. package/es/catalog/holes/door-panic/planner-element.js +7 -16
  28. package/es/catalog/holes/door-panic-double/planner-element.js +15 -24
  29. package/es/catalog/holes/door-sliding/planner-element.js +16 -25
  30. package/es/catalog/holes/doorway-framed/planner-element.js +11 -20
  31. package/es/catalog/holes/doorway-frameless/planner-element.js +7 -16
  32. package/es/catalog/holes/export.js +13 -97
  33. package/es/catalog/holes/window-clear/planner-element.js +10 -19
  34. package/es/catalog/holes/window-cross/planner-element.js +10 -19
  35. package/es/catalog/holes/window-double-hung/planner-element.js +10 -19
  36. package/es/catalog/holes/window-vertical/planner-element.js +10 -19
  37. package/es/catalog/lines/wall/planner-element.js +2 -9
  38. package/es/catalog/molding/molding-dcm/planner-element.js +5 -14
  39. package/es/catalog/molding/molding-fbm/planner-element.js +5 -14
  40. package/es/catalog/molding/molding-lrm/planner-element.js +5 -14
  41. package/es/catalog/properties/export.js +20 -80
  42. package/es/catalog/properties/property-checkbox.js +24 -31
  43. package/es/catalog/properties/property-color.js +16 -23
  44. package/es/catalog/properties/property-enum.js +24 -31
  45. package/es/catalog/properties/property-hidden.js +9 -16
  46. package/es/catalog/properties/property-lenght-measure.js +38 -45
  47. package/es/catalog/properties/property-length-measure.js +36 -43
  48. package/es/catalog/properties/property-length-measure_hole.js +38 -45
  49. package/es/catalog/properties/property-number.js +17 -24
  50. package/es/catalog/properties/property-read-only.js +16 -23
  51. package/es/catalog/properties/property-string.js +16 -23
  52. package/es/catalog/properties/property-toggle.js +16 -23
  53. package/es/catalog/properties/shared-property-style.js +1 -7
  54. package/es/catalog/utils/FuseUtils.js +8 -15
  55. package/es/catalog/utils/exporter.js +8 -15
  56. package/es/catalog/utils/geom-utils.js +13 -29
  57. package/es/catalog/utils/item-loader.js +84 -97
  58. package/es/catalog/utils/load-obj.js +20 -28
  59. package/es/catalog/utils/mtl-loader.js +3 -8
  60. package/es/catalog/utils/obj-loader.js +3 -8
  61. package/es/class/FuseUtils.js +8 -15
  62. package/es/class/area.js +22 -28
  63. package/es/class/export.js +23 -95
  64. package/es/class/group.js +53 -59
  65. package/es/class/guide.js +15 -21
  66. package/es/class/hole.js +83 -89
  67. package/es/class/item.js +141 -147
  68. package/es/class/layer.js +59 -65
  69. package/es/class/line.js +135 -143
  70. package/es/class/project.js +90 -98
  71. package/es/class/vertex.js +29 -35
  72. package/es/components/content.js +19 -28
  73. package/es/components/disclaimer/disclaimer.js +10 -18
  74. package/es/components/export.js +8 -32
  75. package/es/components/style/button.js +23 -31
  76. package/es/components/style/cancel-button.js +7 -14
  77. package/es/components/style/content-container.js +9 -16
  78. package/es/components/style/content-title.js +11 -20
  79. package/es/components/style/delete-button.js +8 -17
  80. package/es/components/style/export.js +30 -120
  81. package/es/components/style/form-block.js +8 -15
  82. package/es/components/style/form-color-input.js +7 -14
  83. package/es/components/style/form-label.js +8 -15
  84. package/es/components/style/form-number-input.js +41 -49
  85. package/es/components/style/form-number-input_2.js +36 -44
  86. package/es/components/style/form-select.js +17 -24
  87. package/es/components/style/form-slider.js +10 -17
  88. package/es/components/style/form-submit-button.js +8 -17
  89. package/es/components/style/form-text-input.js +26 -34
  90. package/es/components/viewer2d/area.js +17 -24
  91. package/es/components/viewer2d/export.js +30 -120
  92. package/es/components/viewer2d/grids/grid-horizontal-streak.js +10 -17
  93. package/es/components/viewer2d/grids/grid-streak.js +10 -17
  94. package/es/components/viewer2d/grids/grid-vertical-streak.js +10 -17
  95. package/es/components/viewer2d/grids/grids.js +10 -19
  96. package/es/components/viewer2d/group.js +15 -24
  97. package/es/components/viewer2d/item.js +61 -70
  98. package/es/components/viewer2d/layer.js +23 -30
  99. package/es/components/viewer2d/line.js +101 -111
  100. package/es/components/viewer2d/ruler.js +22 -29
  101. package/es/components/viewer2d/rulerDist.js +21 -28
  102. package/es/components/viewer2d/rulerX.js +39 -47
  103. package/es/components/viewer2d/rulerY.js +37 -45
  104. package/es/components/viewer2d/scene.js +30 -38
  105. package/es/components/viewer2d/snap.js +13 -22
  106. package/es/components/viewer2d/state.js +18 -27
  107. package/es/components/viewer2d/utils.js +24 -37
  108. package/es/components/viewer2d/vertex.js +8 -17
  109. package/es/components/viewer2d/viewer2d.js +153 -163
  110. package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +17 -23
  111. package/es/components/viewer3d/dcm.js +1 -7
  112. package/es/components/viewer3d/fbm.js +1 -7
  113. package/es/components/viewer3d/front3D.js +12 -21
  114. package/es/components/viewer3d/grid-creator.js +8 -17
  115. package/es/components/viewer3d/grids/grid-horizontal-streak.js +6 -14
  116. package/es/components/viewer3d/grids/grid-streak.js +5 -13
  117. package/es/components/viewer3d/grids/grid-vertical-streak.js +6 -14
  118. package/es/components/viewer3d/libs/first-person-controls.js +2 -9
  119. package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +1 -7
  120. package/es/components/viewer3d/libs/mtl-loader.js +1 -7
  121. package/es/components/viewer3d/libs/obj-loader.js +1 -7
  122. package/es/components/viewer3d/libs/orbit-controls.js +2 -8
  123. package/es/components/viewer3d/libs/pointer-lock-controls.js +2 -8
  124. package/es/components/viewer3d/lrm.js +1 -7
  125. package/es/components/viewer3d/model.js +1 -7
  126. package/es/components/viewer3d/pointer-lock-navigation.js +3 -10
  127. package/es/components/viewer3d/ruler-utils/itemRect.js +18 -25
  128. package/es/components/viewer3d/ruler-utils/layer3D.js +59 -66
  129. package/es/components/viewer3d/ruler-utils/ruler3D.js +39 -46
  130. package/es/components/viewer3d/ruler-utils/scene3D.js +9 -17
  131. package/es/components/viewer3d/ruler-utils/state3D.js +4 -11
  132. package/es/components/viewer3d/scene-creator.js +191 -226
  133. package/es/components/viewer3d/three-memory-cleaner.js +3 -12
  134. package/es/components/viewer3d/viewer3d-first-person.js +40 -46
  135. package/es/components/viewer3d/viewer3d.js +196 -202
  136. package/es/constants.js +349 -358
  137. package/es/index.js +8 -22
  138. package/es/models.js +177 -184
  139. package/es/plugins/SVGLoader.js +48 -53
  140. package/es/plugins/autosave.js +3 -9
  141. package/es/plugins/console-debugger.js +5 -12
  142. package/es/plugins/export.js +8 -32
  143. package/es/plugins/keyboard.js +29 -35
  144. package/es/reducers/areas-reducer.js +7 -13
  145. package/es/reducers/export.js +24 -96
  146. package/es/reducers/groups-reducer.js +31 -37
  147. package/es/reducers/holes-reducer.js +43 -49
  148. package/es/reducers/items-reducer.js +106 -112
  149. package/es/reducers/lines-reducer.js +28 -34
  150. package/es/reducers/project-reducer.js +105 -111
  151. package/es/reducers/reducer.js +16 -23
  152. package/es/reducers/scene-reducer.js +15 -21
  153. package/es/reducers/user-reducer.js +5 -11
  154. package/es/reducers/vertices-reducer.js +11 -17
  155. package/es/reducers/viewer2d-reducer.js +18 -24
  156. package/es/reducers/viewer3d-reducer.js +16 -22
  157. package/es/shared-style.js +10 -16
  158. package/es/styles/export.js +3 -11
  159. package/es/translator/en.js +1 -7
  160. package/es/translator/it.js +1 -7
  161. package/es/translator/ru.js +1 -7
  162. package/es/translator/translator.js +13 -19
  163. package/es/utils/browser.js +2 -9
  164. package/es/utils/convert-units-lite.js +1 -7
  165. package/es/utils/email-validator.js +1 -7
  166. package/es/utils/export.js +15 -46
  167. package/es/utils/geometry.js +181 -278
  168. package/es/utils/get-edges-of-subgraphs.js +2 -9
  169. package/es/utils/graph-cycles.js +8 -11
  170. package/es/utils/graph-inner-cycles.js +10 -18
  171. package/es/utils/graph.js +9 -17
  172. package/es/utils/helper.js +39 -63
  173. package/es/utils/history.js +8 -15
  174. package/es/utils/id-broker.js +8 -15
  175. package/es/utils/logger.js +1 -7
  176. package/es/utils/math.js +5 -12
  177. package/es/utils/molding.js +119 -144
  178. package/es/utils/name-generator.js +7 -13
  179. package/es/utils/objects-utils.js +7 -19
  180. package/es/utils/phone-validator.js +1 -7
  181. package/es/utils/process-black-list.js +3 -10
  182. package/es/utils/react-if.js +6 -12
  183. package/es/utils/snap-scene.js +27 -34
  184. package/es/utils/snap.js +45 -59
  185. package/es/utils/summarizeCart.js +1 -7
  186. package/es/utils/threeCSG.es6.js +13 -22
  187. package/es/version.js +1 -7
  188. package/lib/index.js +7 -13
  189. package/package.json +1 -1
@@ -1,134 +1,128 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = _default;
7
- var _export = require("../utils/export");
8
- var _constants = require("../constants");
9
- var _export2 = require("../class/export");
10
- function _default(state, action) {
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) {
11
5
  switch (action.type) {
12
- case _constants.NEW_PROJECT:
13
- return _export2.Project.newProject(state).updatedState;
14
- case _constants.LOAD_PROJECT:
15
- return _export2.Project.loadProject(state, action.sceneJSON, action.categoryData).updatedState;
16
- case _constants.OPEN_CATALOG:
17
- return _export2.Project.openCatalog(state).updatedState;
18
- case _constants.CHANGE_CATALOG_PAGE:
19
- return _export2.Project.changeCatalogPage(state, action.oldPage, action.newPage).updatedState;
20
- case _constants.GO_BACK_TO_CATALOG_PAGE:
21
- return _export2.Project.goBackToCatalogPage(state, action.newPage).updatedState;
22
- case _constants.SELECT_TOOL_EDIT:
23
- return _export2.Project.setMode(state, _constants.MODE_IDLE).updatedState;
24
- case _constants.UNSELECT_ALL:
25
- return _export2.Project.unselectAll(state).updatedState;
26
- case _constants.SELECT_ALL:
27
- return _export2.Project.selectAll(state, action.value).updatedState;
28
- case _constants.SET_PROPERTIES:
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:
29
23
  state = state.merge({
30
- sceneHistory: _export.history.historyPush(state.sceneHistory, state.scene)
24
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
31
25
  });
32
- return _export2.Project.setProperties(state, state.getIn(['scene', 'selectedLayer']), action.properties).updatedState;
33
- case _constants.SET_ITEMS_ATTRIBUTES:
26
+ return Project.setProperties(state, state.getIn(['scene', 'selectedLayer']), action.properties).updatedState;
27
+ case SET_ITEMS_ATTRIBUTES:
34
28
  state = state.merge({
35
- sceneHistory: _export.history.historyPush(state.sceneHistory, state.scene)
29
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
36
30
  });
37
- return _export2.Project.setItemsAttributes(state, action.itemsAttributes).updatedState;
38
- case _constants.SET_LINES_ATTRIBUTES:
39
- if (state.mode != _constants.MODE_DRAWING_LINE) state = state.merge({
40
- sceneHistory: _export.history.historyPush(state.sceneHistory, state.scene)
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)
41
35
  });
42
- return _export2.Project.setLinesAttributes(state, action.linesAttributes, action.isDirect, action.directData).updatedState;
43
- case _constants.SET_HOLES_ATTRIBUTES:
36
+ return Project.setLinesAttributes(state, action.linesAttributes, action.isDirect, action.directData).updatedState;
37
+ case SET_HOLES_ATTRIBUTES:
44
38
  state = state.merge({
45
- sceneHistory: _export.history.historyPush(state.sceneHistory, state.scene)
39
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
46
40
  });
47
- return _export2.Project.setHolesAttributes(state, action.holesAttributes).updatedState;
48
- case _constants.REMOVE:
41
+ return Project.setHolesAttributes(state, action.holesAttributes).updatedState;
42
+ case REMOVE:
49
43
  state = state.merge({
50
- sceneHistory: _export.history.historyPush(state.sceneHistory, state.scene)
44
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
51
45
  });
52
- return _export2.Project.remove(state).updatedState;
53
- case _constants.UNDO:
54
- return _export2.Project.undo(state).updatedState;
55
- case _constants.REDO:
56
- return _export2.Project.redo(state).updatedState;
57
- case _constants.UNCREATE:
58
- return _export2.Project.uncreate(state).updatedState;
59
- case _constants.PROJECT_RE_NAME:
60
- return _export2.Project.rename(state, action.name).updatedState;
61
- case _constants.RECREATE:
62
- return _export2.Project.recreate(state).updatedState;
63
- case _constants.SHIFT2DOFF:
64
- return _export2.Project.shift2doff(state).updatedState;
65
- case _constants.SHIFT2DON:
66
- return _export2.Project.shift2don(state).updatedState;
67
- case _constants.ROLLBACK:
68
- return _export2.Project.rollback(state).updatedState;
69
- case _constants.SET_PROJECT_PROPERTIES:
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:
70
64
  state = state.merge({
71
- sceneHistory: _export.history.historyPush(state.sceneHistory, state.scene)
65
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
72
66
  });
73
- return _export2.Project.setProjectProperties(state, action.properties).updatedState;
74
- case _constants.SET_PROJECT_ID:
67
+ return Project.setProjectProperties(state, action.properties).updatedState;
68
+ case SET_PROJECT_ID:
75
69
  state = state.merge({
76
- sceneHistory: _export.history.historyPush(state.sceneHistory, state.scene)
70
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
77
71
  });
78
- return _export2.Project.setProjectId(state, action.id).updatedState;
79
- case _constants.OPEN_PROJECT_CONFIGURATOR:
72
+ return Project.setProjectId(state, action.id).updatedState;
73
+ case OPEN_PROJECT_CONFIGURATOR:
80
74
  state = state.merge({
81
- sceneHistory: _export.history.historyPush(state.sceneHistory, state.scene)
75
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
82
76
  });
83
- return _export2.Project.openProjectConfigurator(state).updatedState;
84
- case _constants.INIT_CATALOG:
85
- return _export2.Project.initCatalog(state, action.catalog).updatedState;
86
- case _constants.UPDATE_MOUSE_COORDS:
87
- return _export2.Project.updateMouseCoord(state, action.coords).updatedState;
88
- case _constants.UPDATE_ZOOM_SCALE:
89
- return _export2.Project.updateZoomScale(state, action.scale).updatedState;
90
- case _constants.TOGGLE_SNAP:
91
- return _export2.Project.toggleSnap(state, action.mask).updatedState;
92
- case _constants.THROW_ERROR:
93
- return _export2.Project.throwError(state, action.error).updatedState;
94
- case _constants.THROW_WARNING:
95
- return _export2.Project.throwWarning(state, action.warning).updatedState;
96
- case _constants.COPY_PROPERTIES:
97
- return _export2.Project.copyProperties(state, action.properties).updatedState;
98
- case _constants.PASTE_PROPERTIES:
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:
99
93
  state = state.merge({
100
- sceneHistory: _export.history.historyPush(state.sceneHistory, state.scene)
94
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
101
95
  });
102
- return _export2.Project.pasteProperties(state).updatedState;
103
- case _constants.PUSH_LAST_SELECTED_CATALOG_ELEMENT_TO_HISTORY:
104
- return _export2.Project.pushLastSelectedCatalogElementToHistory(state, action.element).updatedState;
105
- case _constants.ALTERATE_STATE:
106
- return _export2.Project.setAlterate(state).updatedState;
107
- case _constants.SET_MODE:
108
- return _export2.Project.setMode(state, action.mode).updatedState;
109
- case _constants.ADD_HORIZONTAL_GUIDE:
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:
110
104
  state = state.merge({
111
- sceneHistory: _export.history.historyPush(state.sceneHistory, state.scene)
105
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
112
106
  });
113
- return _export2.Project.addHorizontalGuide(state, action.coordinate).updatedState;
114
- case _constants.ADD_VERTICAL_GUIDE:
115
- return _export2.Project.addVerticalGuide(state, action.coordinate).updatedState;
116
- case _constants.ADD_CIRCULAR_GUIDE:
117
- return _export2.Project.addCircularGuide(state, action.x, action.y, action.radius).updatedState;
118
- case _constants.REMOVE_HORIZONTAL_GUIDE:
119
- return _export2.Project.removeHorizontalGuide(state, action.guideID).updatedState;
120
- case _constants.REMOVE_VERTICAL_GUIDE:
121
- return _export2.Project.removeVerticalGuide(state, action.guideID).updatedState;
122
- case _constants.REMOVE_CIRCULAR_GUIDE:
123
- return _export2.Project.removeCircularGuide(state, action.guideID).updatedState;
124
- case _constants.REMOVE_DRAWING_SUPPORT:
125
- return _export2.Project.removeDrawingSupport(state).updatedState;
126
- case _constants.SET_STATE_PROPERTIES:
127
- return _export2.Project.setStateProperties(state, action.properties).updatedState;
128
- case _constants.SET_IS_HELP:
129
- return _export2.Project.setIsHelp(state, action.isHelp).updatedState;
130
- case _constants.SET_IS_CABINET_DRAWING:
131
- return _export2.Project.setIsCabinetDrawing(state, action.isCabinetDrawing).updatedState;
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;
132
126
  default:
133
127
  return state;
134
128
  }
@@ -1,26 +1,19 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = appReducer;
7
- exports.initialState = void 0;
8
- var _constants = require("../constants");
9
- var _export = require("./export");
10
- var _models = require("../models");
11
- var initialState = exports.initialState = new _models.State();
12
- function appReducer(state, action) {
1
+ import { AREA_ACTIONS, GROUP_ACTIONS, HOLE_ACTIONS, ITEMS_ACTIONS, LINE_ACTIONS, PROJECT_ACTIONS, SCENE_ACTIONS, USER_ACTIONS, VERTEX_ACTIONS, VIEWER2D_ACTIONS, VIEWER3D_ACTIONS } from "../constants";
2
+ import { KitchenConfiguratorAreasReducer, KitchenConfiguratorGroupsReducer, KitchenConfiguratorHolesReducer, KitchenConfiguratorItemsReducer, KitchenConfiguratorLinesReducer, KitchenConfiguratorProjectReducer, KitchenConfiguratorSceneReducer, KitchenConfiguratorUserReducer, KitchenConfiguratorVerticesReducer, KitchenConfiguratorViewer2dReducer, KitchenConfiguratorViewer3dReducer } from "./export";
3
+ import { State } from "../models";
4
+ export var initialState = new State();
5
+ export default function appReducer(state, action) {
13
6
  // /////////
14
- if (_constants.PROJECT_ACTIONS[action.type]) return _export.KitchenConfiguratorProjectReducer.apply(void 0, arguments);
15
- if (_constants.VIEWER2D_ACTIONS[action.type]) return _export.KitchenConfiguratorViewer2dReducer.apply(void 0, arguments);
16
- if (_constants.VIEWER3D_ACTIONS[action.type]) return _export.KitchenConfiguratorViewer3dReducer.apply(void 0, arguments);
17
- if (_constants.ITEMS_ACTIONS[action.type]) return _export.KitchenConfiguratorItemsReducer.apply(void 0, arguments);
18
- if (_constants.HOLE_ACTIONS[action.type]) return _export.KitchenConfiguratorHolesReducer.apply(void 0, arguments);
19
- if (_constants.LINE_ACTIONS[action.type]) return _export.KitchenConfiguratorLinesReducer.apply(void 0, arguments);
20
- if (_constants.AREA_ACTIONS[action.type]) return _export.KitchenConfiguratorAreasReducer.apply(void 0, arguments);
21
- if (_constants.GROUP_ACTIONS[action.type]) return _export.KitchenConfiguratorGroupsReducer.apply(void 0, arguments);
22
- if (_constants.SCENE_ACTIONS[action.type]) return _export.KitchenConfiguratorSceneReducer.apply(void 0, arguments);
23
- if (_constants.VERTEX_ACTIONS[action.type]) return _export.KitchenConfiguratorVerticesReducer.apply(void 0, arguments);
24
- if (_constants.USER_ACTIONS[action.type]) return _export.KitchenConfiguratorUserReducer.apply(void 0, arguments);
7
+ if (PROJECT_ACTIONS[action.type]) return KitchenConfiguratorProjectReducer.apply(void 0, arguments);
8
+ if (VIEWER2D_ACTIONS[action.type]) return KitchenConfiguratorViewer2dReducer.apply(void 0, arguments);
9
+ if (VIEWER3D_ACTIONS[action.type]) return KitchenConfiguratorViewer3dReducer.apply(void 0, arguments);
10
+ if (ITEMS_ACTIONS[action.type]) return KitchenConfiguratorItemsReducer.apply(void 0, arguments);
11
+ if (HOLE_ACTIONS[action.type]) return KitchenConfiguratorHolesReducer.apply(void 0, arguments);
12
+ if (LINE_ACTIONS[action.type]) return KitchenConfiguratorLinesReducer.apply(void 0, arguments);
13
+ if (AREA_ACTIONS[action.type]) return KitchenConfiguratorAreasReducer.apply(void 0, arguments);
14
+ if (GROUP_ACTIONS[action.type]) return KitchenConfiguratorGroupsReducer.apply(void 0, arguments);
15
+ if (SCENE_ACTIONS[action.type]) return KitchenConfiguratorSceneReducer.apply(void 0, arguments);
16
+ if (VERTEX_ACTIONS[action.type]) return KitchenConfiguratorVerticesReducer.apply(void 0, arguments);
17
+ if (USER_ACTIONS[action.type]) return KitchenConfiguratorUserReducer.apply(void 0, arguments);
25
18
  return state || initialState;
26
19
  }
@@ -1,33 +1,27 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = _default;
7
- var _export = require("../class/export");
8
- var _export2 = require("../utils/export");
9
- var _constants = require("../constants");
10
- function _default(state, action) {
1
+ import { Layer } from "../class/export";
2
+ import { history } from "../utils/export";
3
+ import { ADD_LAYER, REMOVE_LAYER, SELECT_LAYER, SET_LAYER_PROPERTIES, UPDATE_MOVING_STATE } from "../constants";
4
+ export default function (state, action) {
11
5
  var saveHistory = function saveHistory() {
12
6
  return state = state.merge({
13
- sceneHistory: _export2.history.historyPush(state.sceneHistory, state.scene)
7
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
14
8
  });
15
9
  };
16
10
  switch (action.type) {
17
- case _constants.ADD_LAYER:
11
+ case ADD_LAYER:
18
12
  saveHistory();
19
- return _export.Layer.create(state, action.name, action.altitude).updatedState;
20
- case _constants.SELECT_LAYER:
13
+ return Layer.create(state, action.name, action.altitude).updatedState;
14
+ case SELECT_LAYER:
21
15
  saveHistory();
22
- return _export.Layer.select(state, action.layerID).updatedState;
23
- case _constants.SET_LAYER_PROPERTIES:
16
+ return Layer.select(state, action.layerID).updatedState;
17
+ case SET_LAYER_PROPERTIES:
24
18
  saveHistory();
25
- return _export.Layer.setProperties(state, action.layerID, action.properties).updatedState;
26
- case _constants.REMOVE_LAYER:
19
+ return Layer.setProperties(state, action.layerID, action.properties).updatedState;
20
+ case REMOVE_LAYER:
27
21
  saveHistory();
28
- return _export.Layer.remove(state, action.layerID).updatedState;
29
- case _constants.UPDATE_MOVING_STATE:
30
- return _export.Layer.updateMovingState(state, action.showflag).updatedState;
22
+ return Layer.remove(state, action.layerID).updatedState;
23
+ case UPDATE_MOVING_STATE:
24
+ return Layer.updateMovingState(state, action.showflag).updatedState;
31
25
  default:
32
26
  return state;
33
27
  }
@@ -1,10 +1,4 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = _default;
7
- var _constants = require("../constants");
1
+ import { LOGIN_ERROR, LOGIN_SUCCESS, LOGOUT } from "../constants";
8
2
  var initialState = {
9
3
  success: false,
10
4
  error: {
@@ -12,23 +6,23 @@ var initialState = {
12
6
  password: null
13
7
  }
14
8
  };
15
- function _default(state, action) {
9
+ export default function (state, action) {
16
10
  switch (action.type) {
17
- case _constants.LOGIN_SUCCESS:
11
+ case LOGIN_SUCCESS:
18
12
  {
19
13
  return state.merge({
20
14
  login: true,
21
15
  userId: action.userid
22
16
  });
23
17
  }
24
- case _constants.LOGIN_ERROR:
18
+ case LOGIN_ERROR:
25
19
  {
26
20
  return state.merge({
27
21
  login: false,
28
22
  userId: 0
29
23
  });
30
24
  }
31
- case _constants.LOGOUT:
25
+ case LOGOUT:
32
26
  {
33
27
  state = state.merge({
34
28
  scene: state.scene.merge({
@@ -1,24 +1,18 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = _default;
7
- var _constants = require("../constants");
8
- var _export = require("../utils/export");
9
- var _export2 = require("../class/export");
10
- function _default(state, action) {
1
+ import { BEGIN_DRAGGING_VERTEX, END_DRAGGING_VERTEX, UPDATE_DRAGGING_VERTEX } from "../constants";
2
+ import { history } from "../utils/export";
3
+ import { Vertex } from "../class/export";
4
+ export default function (state, action) {
11
5
  switch (action.type) {
12
- case _constants.BEGIN_DRAGGING_VERTEX:
13
- return _export2.Vertex.beginDraggingVertex(state, action.layerID, action.vertexID, action.x, action.y).updatedState;
14
- case _constants.UPDATE_DRAGGING_VERTEX:
15
- return _export2.Vertex.updateDraggingVertex(state, action.x, action.y).updatedState;
16
- case _constants.END_DRAGGING_VERTEX:
6
+ case BEGIN_DRAGGING_VERTEX:
7
+ return Vertex.beginDraggingVertex(state, action.layerID, action.vertexID, action.x, action.y).updatedState;
8
+ case UPDATE_DRAGGING_VERTEX:
9
+ return Vertex.updateDraggingVertex(state, action.x, action.y).updatedState;
10
+ case END_DRAGGING_VERTEX:
17
11
  // Code that saving the scene history (26 ~ 28)
18
12
  state = state.merge({
19
- sceneHistory: _export.history.historyPush(state.sceneHistory, state.scene)
13
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
20
14
  });
21
- return _export2.Vertex.endDraggingVertex(state, action.x, action.y).updatedState;
15
+ return Vertex.endDraggingVertex(state, action.x, action.y).updatedState;
22
16
  default:
23
17
  return state;
24
18
  }
@@ -1,16 +1,10 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = _default;
7
- var _constants = require("../constants");
8
- var _convertUnitsLite = require("../utils/convert-units-lite");
9
- function _default(state, action) {
1
+ import { CHANGE_BASE_CABINET_MEASURE, CHANGE_WALL_CABINET_MEASURE, CHANGE_WALL_LENGTH_MEASURE, CHANGE_WINDOW_DOOR_MEASURE, MODE_2D_PAN, MODE_2D_ZOOM_IN, MODE_2D_ZOOM_OUT, SELECT_TOOL_PAN, SELECT_TOOL_ZOOM_IN, SELECT_TOOL_ZOOM_OUT, UPDATE_2D_CAMERA, UPDATE_CEIL_HEIGHT, UPDATE_CEIL_HEIGHT_UNIT } from "../constants";
2
+ import { convert } from "../utils/convert-units-lite";
3
+ export default function (state, action) {
10
4
  var _state = state,
11
5
  scene = _state.scene;
12
6
  switch (action.type) {
13
- case _constants.UPDATE_CEIL_HEIGHT_UNIT:
7
+ case UPDATE_CEIL_HEIGHT_UNIT:
14
8
  {
15
9
  var _state2 = state,
16
10
  _scene = _state2.scene;
@@ -22,7 +16,7 @@ function _default(state, action) {
22
16
  state = state.mergeIn(['scene', 'layers', selectedLayer], newLayer);
23
17
  return state;
24
18
  }
25
- case _constants.UPDATE_CEIL_HEIGHT:
19
+ case UPDATE_CEIL_HEIGHT:
26
20
  {
27
21
  var _selectedLayer = scene.selectedLayer;
28
22
  var _layer = scene.layers.get(_selectedLayer);
@@ -35,47 +29,47 @@ function _default(state, action) {
35
29
  if (item.type.includes('Light')) {
36
30
  var height = item.properties.getIn(['height', '_length']);
37
31
  var heightUnit = item.properties.getIn(['height', '_unit']);
38
- var newAltitude = action.value - (0, _convertUnitsLite.convert)(height).from(heightUnit).to('in');
39
- item = item.setIn(['properties', 'altitude', '_length'], (0, _convertUnitsLite.convert)(newAltitude).from('in').to(_layer.unit));
32
+ var newAltitude = action.value - convert(height).from(heightUnit).to('in');
33
+ item = item.setIn(['properties', 'altitude', '_length'], convert(newAltitude).from('in').to(_layer.unit));
40
34
  }
41
35
  return item;
42
36
  });
43
37
  state = state.mergeIn(['scene', 'layers', _selectedLayer, 'items'], newItems);
44
38
  return state;
45
39
  }
46
- case _constants.UPDATE_2D_CAMERA:
40
+ case UPDATE_2D_CAMERA:
47
41
  return state.merge({
48
42
  viewer2D: action.value
49
43
  });
50
- case _constants.CHANGE_WALL_LENGTH_MEASURE:
44
+ case CHANGE_WALL_LENGTH_MEASURE:
51
45
  return state.merge({
52
46
  scene: scene.merge({
53
47
  showWallLengthMeasure: action.value
54
48
  })
55
49
  });
56
- case _constants.CHANGE_BASE_CABINET_MEASURE:
50
+ case CHANGE_BASE_CABINET_MEASURE:
57
51
  return state.merge({
58
52
  scene: scene.merge({
59
53
  showBaseCabinetMeasure: action.value
60
54
  })
61
55
  });
62
- case _constants.CHANGE_WALL_CABINET_MEASURE:
56
+ case CHANGE_WALL_CABINET_MEASURE:
63
57
  return state.merge({
64
58
  scene: scene.merge({
65
59
  showWallCabinetMeasure: action.value
66
60
  })
67
61
  });
68
- case _constants.CHANGE_WINDOW_DOOR_MEASURE:
62
+ case CHANGE_WINDOW_DOOR_MEASURE:
69
63
  return state.merge({
70
64
  scene: scene.merge({
71
65
  showWindowDoorMeasure: action.value
72
66
  })
73
67
  });
74
- case _constants.SELECT_TOOL_PAN:
75
- return state.set('mode', _constants.MODE_2D_PAN);
76
- case _constants.SELECT_TOOL_ZOOM_IN:
77
- return state.set('mode', _constants.MODE_2D_ZOOM_IN);
78
- case _constants.SELECT_TOOL_ZOOM_OUT:
79
- return state.set('mode', _constants.MODE_2D_ZOOM_OUT);
68
+ case SELECT_TOOL_PAN:
69
+ return state.set('mode', MODE_2D_PAN);
70
+ case SELECT_TOOL_ZOOM_IN:
71
+ return state.set('mode', MODE_2D_ZOOM_IN);
72
+ case SELECT_TOOL_ZOOM_OUT:
73
+ return state.set('mode', MODE_2D_ZOOM_OUT);
80
74
  }
81
75
  }
@@ -1,19 +1,13 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = _default;
7
- var _constants = require("../constants");
8
- var _export = require("../class/export");
9
- var _export2 = require("../utils/export");
10
- var _convertUnitsLite = require("../utils/convert-units-lite");
11
- function _default(state, action) {
1
+ import { MODE_3D_FIRST_PERSON, MODE_3D_VIEW, SELECT_TOOL_3D_FIRST_PERSON, SELECT_TOOL_3D_VIEW, UPDATE_3D_CEIL_HEIGHT, UPDATE_3D_CEIL_HEIGHT_UNIT } from "../constants";
2
+ import { Project } from "../class/export";
3
+ import { history } from "../utils/export";
4
+ import { convert } from "../utils/convert-units-lite";
5
+ export default function (state, action) {
12
6
  state = state.merge({
13
- sceneHistory: _export2.history.historyPush(state.sceneHistory, state.scene)
7
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
14
8
  });
15
9
  switch (action.type) {
16
- case _constants.UPDATE_3D_CEIL_HEIGHT_UNIT:
10
+ case UPDATE_3D_CEIL_HEIGHT_UNIT:
17
11
  {
18
12
  var _state = state,
19
13
  scene = _state.scene;
@@ -25,7 +19,7 @@ function _default(state, action) {
25
19
  state = state.mergeIn(['scene', 'layers', selectedLayer], newLayer);
26
20
  return state;
27
21
  }
28
- case _constants.UPDATE_3D_CEIL_HEIGHT:
22
+ case UPDATE_3D_CEIL_HEIGHT:
29
23
  {
30
24
  var _state2 = state,
31
25
  _scene = _state2.scene;
@@ -40,21 +34,21 @@ function _default(state, action) {
40
34
  if (item.type.includes('Light')) {
41
35
  var height = item.properties.getIn(['height', '_length']);
42
36
  var heightUnit = item.properties.getIn(['height', '_unit']);
43
- var newAltitude = action.value - (0, _convertUnitsLite.convert)(height).from(heightUnit).to('in');
44
- item = item.setIn(['properties', 'altitude', '_length'], (0, _convertUnitsLite.convert)(newAltitude).from('in').to(_layer.unit));
37
+ var newAltitude = action.value - convert(height).from(heightUnit).to('in');
38
+ item = item.setIn(['properties', 'altitude', '_length'], convert(newAltitude).from('in').to(_layer.unit));
45
39
  }
46
40
  return item;
47
41
  });
48
42
  state = state.mergeIn(['scene', 'layers', _selectedLayer, 'items'], newItems);
49
43
  return state;
50
44
  }
51
- case _constants.SELECT_TOOL_3D_VIEW:
52
- state = _export.Project.rollback(state).updatedState;
53
- state = _export.Project.setMode(state, _constants.MODE_3D_VIEW).updatedState;
45
+ case SELECT_TOOL_3D_VIEW:
46
+ state = Project.rollback(state).updatedState;
47
+ state = Project.setMode(state, MODE_3D_VIEW).updatedState;
54
48
  return state;
55
- case _constants.SELECT_TOOL_3D_FIRST_PERSON:
56
- state = _export.Project.rollback(state).updatedState;
57
- state = _export.Project.setMode(state, _constants.MODE_3D_FIRST_PERSON).updatedState;
49
+ case SELECT_TOOL_3D_FIRST_PERSON:
50
+ state = Project.rollback(state).updatedState;
51
+ state = Project.setMode(state, MODE_3D_FIRST_PERSON).updatedState;
58
52
  return state;
59
53
  default:
60
54
  return state;
@@ -1,16 +1,10 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.TOOLBAR_COLOR = exports.SECONDARY_COLOR = exports.PRIMARY_COLOR = exports.MESH_SELECTED = exports.MATERIAL_COLORS = exports.LINE_MESH_COLOR = exports.LINE_MESH = exports.INTERIOR_LINE = exports.COLORS = exports.AREA_MESH_COLOR = void 0;
7
1
  // COLORS
8
- var COLORS = exports.COLORS = {
2
+ export var COLORS = {
9
3
  white: '#FFF',
10
4
  lightgrey: '#d3d3d3',
11
5
  black: '#000'
12
6
  };
13
- var MATERIAL_COLORS = exports.MATERIAL_COLORS = {
7
+ export var MATERIAL_COLORS = {
14
8
  500: {
15
9
  amber: '#FFC107',
16
10
  blue_grey: '#607D8B',
@@ -33,7 +27,7 @@ var MATERIAL_COLORS = exports.MATERIAL_COLORS = {
33
27
  yellow: '#FFEB3B'
34
28
  }
35
29
  };
36
- var PRIMARY_COLOR = exports.PRIMARY_COLOR = {
30
+ export var PRIMARY_COLOR = {
37
31
  main: '#DEDEDE',
38
32
  alt: '#DEDEDE',
39
33
  icon: '#A2A2A2',
@@ -42,31 +36,31 @@ var PRIMARY_COLOR = exports.PRIMARY_COLOR = {
42
36
  text_alt: '#232323',
43
37
  input: '#55595C'
44
38
  };
45
- var SECONDARY_COLOR = exports.SECONDARY_COLOR = {
39
+ export var SECONDARY_COLOR = {
46
40
  main: '#1CA6FC',
47
41
  alt: '#005FAF',
48
42
  icon: '#1CA6FC',
49
43
  border: '1px solid #FFF'
50
44
  };
51
- var TOOLBAR_COLOR = exports.TOOLBAR_COLOR = {
45
+ export var TOOLBAR_COLOR = {
52
46
  normal: 'rgb(211,230,228)',
53
47
  focus: 'rgba(71, 71, 71,0.9)',
54
48
  active: 'rgba(17, 131, 187, 0.8)'
55
49
  // active: 'rgba(34,144,107, 0.8)',
56
50
  };
57
- var MESH_SELECTED = exports.MESH_SELECTED = 'rgba(71, 71, 71,0.9)';
58
- var AREA_MESH_COLOR = exports.AREA_MESH_COLOR = {
51
+ export var MESH_SELECTED = 'rgba(71, 71, 71,0.9)';
52
+ export var AREA_MESH_COLOR = {
59
53
  selected: 'rgb(234,234,255)',
60
54
  unselected: 'rgb(221,221,255)'
61
55
  };
62
- var INTERIOR_LINE = exports.INTERIOR_LINE = {
56
+ export var INTERIOR_LINE = {
63
57
  unselected: ' #0a0a10',
64
58
  selected: '#4C12A1'
65
59
  };
66
- var LINE_MESH_COLOR = exports.LINE_MESH_COLOR = {
60
+ export var LINE_MESH_COLOR = {
67
61
  selected: '#4C12A1',
68
62
  unselected: 'rgb(135,145,171)'
69
63
  };
70
- var LINE_MESH = exports.LINE_MESH = {
64
+ export var LINE_MESH = {
71
65
  selected: '#4C12A1'
72
66
  };