kitchen-simulator 1.1.1-test.70 → 1.1.1-test.71

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 (188) hide show
  1. package/es/@history.js +2 -8
  2. package/es/AppContext.js +3 -8
  3. package/es/KitchenConfigurator.js +70 -77
  4. package/es/KitchenConfiguratorApp.js +98 -105
  5. package/es/actions/area-actions.js +5 -10
  6. package/es/actions/export.js +12 -27
  7. package/es/actions/groups-actions.js +27 -43
  8. package/es/actions/holes-actions.js +34 -53
  9. package/es/actions/items-actions.js +94 -143
  10. package/es/actions/lines-actions.js +21 -34
  11. package/es/actions/project-actions.js +94 -143
  12. package/es/actions/scene-actions.js +11 -19
  13. package/es/actions/vertices-actions.js +7 -13
  14. package/es/actions/viewer2d-actions.js +21 -34
  15. package/es/actions/viewer3d-actions.js +9 -16
  16. package/es/catalog/areas/area/planner-element.js +2 -7
  17. package/es/catalog/catalog.js +15 -19
  18. package/es/catalog/factories/area-factory-3d.js +22 -29
  19. package/es/catalog/factories/area-factory.js +11 -18
  20. package/es/catalog/factories/export.js +6 -12
  21. package/es/catalog/factories/wall-factory-3d.js +31 -39
  22. package/es/catalog/factories/wall-factory.js +21 -29
  23. package/es/catalog/holes/door-closet/planner-element.js +15 -22
  24. package/es/catalog/holes/door-double/planner-element.js +15 -22
  25. package/es/catalog/holes/door-exterior/planner-element.js +16 -23
  26. package/es/catalog/holes/door-interior/planner-element.js +16 -23
  27. package/es/catalog/holes/door-panic/planner-element.js +7 -14
  28. package/es/catalog/holes/door-panic-double/planner-element.js +15 -22
  29. package/es/catalog/holes/door-sliding/planner-element.js +16 -23
  30. package/es/catalog/holes/doorway-framed/planner-element.js +11 -18
  31. package/es/catalog/holes/doorway-frameless/planner-element.js +7 -14
  32. package/es/catalog/holes/export.js +13 -31
  33. package/es/catalog/holes/window-clear/planner-element.js +10 -17
  34. package/es/catalog/holes/window-cross/planner-element.js +10 -17
  35. package/es/catalog/holes/window-double-hung/planner-element.js +10 -17
  36. package/es/catalog/holes/window-vertical/planner-element.js +10 -17
  37. package/es/catalog/lines/wall/planner-element.js +2 -7
  38. package/es/catalog/molding/molding-dcm/planner-element.js +5 -12
  39. package/es/catalog/molding/molding-fbm/planner-element.js +5 -12
  40. package/es/catalog/molding/molding-lrm/planner-element.js +5 -12
  41. package/es/catalog/properties/export.js +20 -33
  42. package/es/catalog/properties/property-checkbox.js +24 -29
  43. package/es/catalog/properties/property-color.js +16 -21
  44. package/es/catalog/properties/property-enum.js +24 -29
  45. package/es/catalog/properties/property-hidden.js +9 -14
  46. package/es/catalog/properties/property-lenght-measure.js +38 -43
  47. package/es/catalog/properties/property-length-measure.js +36 -41
  48. package/es/catalog/properties/property-length-measure_hole.js +38 -43
  49. package/es/catalog/properties/property-number.js +17 -22
  50. package/es/catalog/properties/property-read-only.js +16 -21
  51. package/es/catalog/properties/property-string.js +16 -21
  52. package/es/catalog/properties/property-toggle.js +16 -21
  53. package/es/catalog/properties/shared-property-style.js +1 -5
  54. package/es/catalog/utils/FuseUtils.js +8 -13
  55. package/es/catalog/utils/exporter.js +8 -13
  56. package/es/catalog/utils/geom-utils.js +13 -27
  57. package/es/catalog/utils/item-loader.js +84 -95
  58. package/es/catalog/utils/load-obj.js +20 -26
  59. package/es/catalog/utils/mtl-loader.js +3 -6
  60. package/es/catalog/utils/obj-loader.js +3 -6
  61. package/es/class/FuseUtils.js +8 -13
  62. package/es/class/area.js +22 -26
  63. package/es/class/export.js +23 -38
  64. package/es/class/group.js +53 -57
  65. package/es/class/guide.js +15 -19
  66. package/es/class/hole.js +83 -87
  67. package/es/class/item.js +141 -145
  68. package/es/class/layer.js +59 -63
  69. package/es/class/line.js +135 -141
  70. package/es/class/project.js +90 -96
  71. package/es/class/vertex.js +29 -33
  72. package/es/components/content.js +19 -26
  73. package/es/components/disclaimer/disclaimer.js +10 -16
  74. package/es/components/export.js +8 -15
  75. package/es/components/style/button.js +23 -29
  76. package/es/components/style/cancel-button.js +7 -12
  77. package/es/components/style/content-container.js +9 -14
  78. package/es/components/style/content-title.js +11 -18
  79. package/es/components/style/delete-button.js +8 -15
  80. package/es/components/style/export.js +30 -48
  81. package/es/components/style/form-block.js +8 -13
  82. package/es/components/style/form-color-input.js +7 -12
  83. package/es/components/style/form-label.js +8 -13
  84. package/es/components/style/form-number-input.js +41 -47
  85. package/es/components/style/form-number-input_2.js +36 -42
  86. package/es/components/style/form-select.js +17 -22
  87. package/es/components/style/form-slider.js +10 -15
  88. package/es/components/style/form-submit-button.js +8 -15
  89. package/es/components/style/form-text-input.js +26 -32
  90. package/es/components/viewer2d/area.js +17 -22
  91. package/es/components/viewer2d/export.js +30 -48
  92. package/es/components/viewer2d/grids/grid-horizontal-streak.js +10 -15
  93. package/es/components/viewer2d/grids/grid-streak.js +10 -15
  94. package/es/components/viewer2d/grids/grid-vertical-streak.js +10 -15
  95. package/es/components/viewer2d/grids/grids.js +10 -17
  96. package/es/components/viewer2d/group.js +15 -22
  97. package/es/components/viewer2d/item.js +61 -68
  98. package/es/components/viewer2d/layer.js +23 -28
  99. package/es/components/viewer2d/line.js +101 -109
  100. package/es/components/viewer2d/ruler.js +22 -27
  101. package/es/components/viewer2d/rulerDist.js +21 -26
  102. package/es/components/viewer2d/rulerX.js +39 -45
  103. package/es/components/viewer2d/rulerY.js +37 -43
  104. package/es/components/viewer2d/scene.js +30 -36
  105. package/es/components/viewer2d/snap.js +13 -20
  106. package/es/components/viewer2d/state.js +18 -25
  107. package/es/components/viewer2d/utils.js +24 -35
  108. package/es/components/viewer2d/vertex.js +8 -15
  109. package/es/components/viewer2d/viewer2d.js +153 -161
  110. package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +17 -21
  111. package/es/components/viewer3d/dcm.js +1 -5
  112. package/es/components/viewer3d/fbm.js +1 -5
  113. package/es/components/viewer3d/front3D.js +12 -19
  114. package/es/components/viewer3d/grid-creator.js +8 -15
  115. package/es/components/viewer3d/grids/grid-horizontal-streak.js +6 -12
  116. package/es/components/viewer3d/grids/grid-streak.js +5 -11
  117. package/es/components/viewer3d/grids/grid-vertical-streak.js +6 -12
  118. package/es/components/viewer3d/libs/first-person-controls.js +2 -7
  119. package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +1 -5
  120. package/es/components/viewer3d/libs/mtl-loader.js +1 -5
  121. package/es/components/viewer3d/libs/obj-loader.js +1 -5
  122. package/es/components/viewer3d/libs/orbit-controls.js +2 -6
  123. package/es/components/viewer3d/libs/pointer-lock-controls.js +2 -6
  124. package/es/components/viewer3d/lrm.js +1 -5
  125. package/es/components/viewer3d/model.js +1 -5
  126. package/es/components/viewer3d/pointer-lock-navigation.js +3 -8
  127. package/es/components/viewer3d/ruler-utils/itemRect.js +18 -23
  128. package/es/components/viewer3d/ruler-utils/layer3D.js +59 -64
  129. package/es/components/viewer3d/ruler-utils/ruler3D.js +39 -44
  130. package/es/components/viewer3d/ruler-utils/scene3D.js +9 -15
  131. package/es/components/viewer3d/ruler-utils/state3D.js +4 -9
  132. package/es/components/viewer3d/scene-creator.js +191 -224
  133. package/es/components/viewer3d/three-memory-cleaner.js +3 -10
  134. package/es/components/viewer3d/viewer3d-first-person.js +40 -44
  135. package/es/components/viewer3d/viewer3d.js +196 -200
  136. package/es/constants.js +349 -356
  137. package/es/index.js +7 -13
  138. package/es/models.js +177 -182
  139. package/es/plugins/SVGLoader.js +48 -51
  140. package/es/plugins/autosave.js +3 -7
  141. package/es/plugins/console-debugger.js +5 -10
  142. package/es/plugins/export.js +8 -15
  143. package/es/plugins/keyboard.js +29 -33
  144. package/es/reducers/areas-reducer.js +7 -11
  145. package/es/reducers/export.js +24 -39
  146. package/es/reducers/groups-reducer.js +31 -35
  147. package/es/reducers/holes-reducer.js +43 -47
  148. package/es/reducers/items-reducer.js +106 -110
  149. package/es/reducers/lines-reducer.js +28 -32
  150. package/es/reducers/project-reducer.js +105 -109
  151. package/es/reducers/reducer.js +16 -21
  152. package/es/reducers/scene-reducer.js +15 -19
  153. package/es/reducers/user-reducer.js +5 -9
  154. package/es/reducers/vertices-reducer.js +11 -15
  155. package/es/reducers/viewer2d-reducer.js +18 -22
  156. package/es/reducers/viewer3d-reducer.js +16 -20
  157. package/es/shared-style.js +10 -14
  158. package/es/styles/export.js +3 -9
  159. package/es/translator/en.js +1 -5
  160. package/es/translator/it.js +1 -5
  161. package/es/translator/ru.js +1 -5
  162. package/es/translator/translator.js +13 -17
  163. package/es/utils/browser.js +2 -7
  164. package/es/utils/convert-units-lite.js +1 -5
  165. package/es/utils/email-validator.js +1 -5
  166. package/es/utils/export.js +15 -32
  167. package/es/utils/geometry.js +181 -276
  168. package/es/utils/get-edges-of-subgraphs.js +2 -7
  169. package/es/utils/graph-cycles.js +8 -9
  170. package/es/utils/graph-inner-cycles.js +10 -16
  171. package/es/utils/graph.js +9 -15
  172. package/es/utils/helper.js +39 -61
  173. package/es/utils/history.js +8 -13
  174. package/es/utils/id-broker.js +8 -13
  175. package/es/utils/logger.js +1 -5
  176. package/es/utils/math.js +5 -10
  177. package/es/utils/molding.js +119 -142
  178. package/es/utils/name-generator.js +7 -11
  179. package/es/utils/objects-utils.js +7 -17
  180. package/es/utils/phone-validator.js +1 -5
  181. package/es/utils/process-black-list.js +3 -8
  182. package/es/utils/react-if.js +6 -10
  183. package/es/utils/snap-scene.js +27 -32
  184. package/es/utils/snap.js +45 -57
  185. package/es/utils/summarizeCart.js +1 -5
  186. package/es/utils/threeCSG.es6.js +13 -20
  187. package/es/version.js +1 -5
  188. package/package.json +1 -1
package/es/class/line.js CHANGED
@@ -1,29 +1,22 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
- exports.__esModule = true;
6
- exports["default"] = void 0;
7
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
8
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
9
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
10
- var _immutable = require("immutable");
11
- var _export = require("./export");
12
- var _export2 = require("../utils/export");
13
- var Three = _interopRequireWildcard(require("three"));
14
- var _constants = require("../constants");
15
- var _helper = require("../utils/helper");
16
- 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); }
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import { fromJS, List, Map } from 'immutable';
5
+ import { Group, Hole, Layer, Vertex } from "./export";
6
+ import { GeometryUtils, history, IDBroker, NameGenerator, SnapSceneUtils, SnapUtils } from "../utils/export";
7
+ import * as Three from 'three';
8
+ import { END_DRAGGING_LINE, END_DRAGGING_VERTEX, END_DRAWING_LINE, EPSILON, MIN_ANGLE_DISALLOW_DRAW_WALL, MODE_DRAGGING_LINE, MODE_DRAWING_LINE, MODE_IDLE, MODE_WAITING_DRAWING_LINE, UNIT_ANGLE } from "../constants";
9
+ import { isEmpty } from "../utils/helper";
17
10
  var timeGlobal = 0;
18
11
  var TimeRecorder = /*#__PURE__*/function () {
19
12
  function TimeRecorder(name) {
20
- (0, _classCallCheck2["default"])(this, TimeRecorder);
13
+ _classCallCheck(this, TimeRecorder);
21
14
  this.name = name;
22
15
  if (name === 'beginDrawingLine') {
23
16
  console.log('time__ Start Drawing');
24
17
  }
25
18
  }
26
- return (0, _createClass2["default"])(TimeRecorder, [{
19
+ return _createClass(TimeRecorder, [{
27
20
  key: "start",
28
21
  value: function start() {
29
22
  this.first = Date.now();
@@ -42,11 +35,11 @@ var TimeRecorder = /*#__PURE__*/function () {
42
35
  }
43
36
  }]);
44
37
  }();
45
- var Line = exports["default"] = /*#__PURE__*/function () {
38
+ var Line = /*#__PURE__*/function () {
46
39
  function Line() {
47
- (0, _classCallCheck2["default"])(this, Line);
40
+ _classCallCheck(this, Line);
48
41
  }
49
- return (0, _createClass2["default"])(Line, null, [{
42
+ return _createClass(Line, null, [{
50
43
  key: "create",
51
44
  value: function create(state, layerID, type, x0, y0, x1, y1, properties) {
52
45
  var lineCreatedDateTime = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : new Date().getTime();
@@ -55,18 +48,18 @@ var Line = exports["default"] = /*#__PURE__*/function () {
55
48
  // return { updatedState: state };
56
49
  // }
57
50
  // ///////////////
58
- var lineID = _export2.IDBroker.acquireID();
59
- var _Vertex$add = _export.Vertex.add(state, layerID, x0, y0, 'lines', lineID),
51
+ var lineID = IDBroker.acquireID();
52
+ var _Vertex$add = Vertex.add(state, layerID, x0, y0, 'lines', lineID),
60
53
  stateV0 = _Vertex$add.updatedState,
61
54
  v0 = _Vertex$add.vertex;
62
- var _Vertex$add2 = _export.Vertex.add(stateV0, layerID, x1, y1, 'lines', lineID),
55
+ var _Vertex$add2 = Vertex.add(stateV0, layerID, x1, y1, 'lines', lineID),
63
56
  stateV1 = _Vertex$add2.updatedState,
64
57
  v1 = _Vertex$add2.vertex;
65
58
  state = stateV1;
66
59
  var line = state.catalog.factoryElement(type, {
67
60
  id: lineID,
68
- name: _export2.NameGenerator.generateName('lines', state.catalog.getIn(['elements', type, 'info', 'title'])),
69
- vertices: new _immutable.List([v0.id, v1.id]),
61
+ name: NameGenerator.generateName('lines', state.catalog.getIn(['elements', type, 'info', 'title'])),
62
+ vertices: new List([v0.id, v1.id]),
70
63
  type: type
71
64
  }, properties);
72
65
  line = line.set('createdDateTime', lineCreatedDateTime !== undefined ? lineCreatedDateTime : new Date().getTime());
@@ -88,7 +81,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
88
81
  value: function select(state, layerID, lineID) {
89
82
  var _line$vertices, _line$vertices$get, _line$vertices2, _line$vertices2$get;
90
83
  // Try selecting the layer first
91
- var layerResult = _export.Layer.select(state, layerID);
84
+ var layerResult = Layer.select(state, layerID);
92
85
  if (!layerResult || !layerResult.updatedState) {
93
86
  return {
94
87
  updatedState: state
@@ -105,7 +98,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
105
98
  }
106
99
 
107
100
  // Select the line element
108
- var lineSelectResult = _export.Layer.selectElement(state, layerID, 'lines', lineID);
101
+ var lineSelectResult = Layer.selectElement(state, layerID, 'lines', lineID);
109
102
  if (lineSelectResult !== null && lineSelectResult !== void 0 && lineSelectResult.updatedState) {
110
103
  state = lineSelectResult.updatedState;
111
104
  }
@@ -113,7 +106,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
113
106
  // Select the first vertex (if available)
114
107
  var firstVertex = (_line$vertices = line.vertices) === null || _line$vertices === void 0 || (_line$vertices$get = _line$vertices.get) === null || _line$vertices$get === void 0 ? void 0 : _line$vertices$get.call(_line$vertices, 0);
115
108
  if (firstVertex !== undefined) {
116
- var v1Result = _export.Layer.selectElement(state, layerID, 'vertices', firstVertex);
109
+ var v1Result = Layer.selectElement(state, layerID, 'vertices', firstVertex);
117
110
  if (v1Result !== null && v1Result !== void 0 && v1Result.updatedState) {
118
111
  state = v1Result.updatedState;
119
112
  }
@@ -122,7 +115,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
122
115
  // Select the second vertex (if available)
123
116
  var secondVertex = (_line$vertices2 = line.vertices) === null || _line$vertices2 === void 0 || (_line$vertices2$get = _line$vertices2.get) === null || _line$vertices2$get === void 0 ? void 0 : _line$vertices2$get.call(_line$vertices2, 1);
124
117
  if (secondVertex !== undefined) {
125
- var v2Result = _export.Layer.selectElement(state, layerID, 'vertices', secondVertex);
118
+ var v2Result = Layer.selectElement(state, layerID, 'vertices', secondVertex);
126
119
  if (v2Result !== null && v2Result !== void 0 && v2Result.updatedState) {
127
120
  state = v2Result.updatedState;
128
121
  }
@@ -138,14 +131,14 @@ var Line = exports["default"] = /*#__PURE__*/function () {
138
131
  if (line) {
139
132
  state = this.unselect(state, layerID, lineID).updatedState;
140
133
  line.holes.forEach(function (holeID) {
141
- return state = _export.Hole.remove(state, layerID, holeID).updatedState;
134
+ return state = Hole.remove(state, layerID, holeID).updatedState;
142
135
  });
143
- state = _export.Layer.removeElement(state, layerID, 'lines', lineID).updatedState;
136
+ state = Layer.removeElement(state, layerID, 'lines', lineID).updatedState;
144
137
  line.vertices.forEach(function (vertexID) {
145
- return state = _export.Vertex.remove(state, layerID, vertexID, 'lines', lineID).updatedState;
138
+ return state = Vertex.remove(state, layerID, vertexID, 'lines', lineID).updatedState;
146
139
  });
147
140
  state.getIn(['scene', 'groups']).forEach(function (group) {
148
- return state = _export.Group.removeElement(state, group.id, layerID, 'lines', lineID).updatedState;
141
+ return state = Group.removeElement(state, group.id, layerID, 'lines', lineID).updatedState;
149
142
  });
150
143
  }
151
144
  return {
@@ -175,9 +168,9 @@ var Line = exports["default"] = /*#__PURE__*/function () {
175
168
  value: function unselect(state, layerID, lineID) {
176
169
  var line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
177
170
  if (line) {
178
- state = _export.Layer.unselect(state, layerID, 'vertices', line.vertices.get(0)).updatedState;
179
- state = _export.Layer.unselect(state, layerID, 'vertices', line.vertices.get(1)).updatedState;
180
- state = _export.Layer.unselect(state, layerID, 'lines', lineID).updatedState;
171
+ state = Layer.unselect(state, layerID, 'vertices', line.vertices.get(0)).updatedState;
172
+ state = Layer.unselect(state, layerID, 'vertices', line.vertices.get(1)).updatedState;
173
+ state = Layer.unselect(state, layerID, 'lines', lineID).updatedState;
181
174
  }
182
175
  return {
183
176
  updatedState: state
@@ -200,8 +193,8 @@ var Line = exports["default"] = /*#__PURE__*/function () {
200
193
  stateL2 = _Line$create2.updatedState,
201
194
  line1 = _Line$create2.line;
202
195
  state = stateL2;
203
- var splitPointOffset = _export2.GeometryUtils.pointPositionOnLineSegment(x0, y0, x1, y1, x, y);
204
- var minVertex = _export2.GeometryUtils.minVertex(v0, v1);
196
+ var splitPointOffset = GeometryUtils.pointPositionOnLineSegment(x0, y0, x1, y1, x, y);
197
+ var minVertex = GeometryUtils.minVertex(v0, v1);
205
198
  line.holes.forEach(function (holeID) {
206
199
  var hole = state.getIn(['scene', 'layers', layerID, 'holes', holeID]);
207
200
  var holeOffset = hole.offset;
@@ -216,7 +209,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
216
209
  offset = 1 - offset;
217
210
  }
218
211
  */
219
- state = _export.Hole.create(state, layerID, hole.type, line0.id, offset, hole.properties).updatedState;
212
+ state = Hole.create(state, layerID, hole.type, line0.id, offset, hole.properties).updatedState;
220
213
  } else {
221
214
  var _offset = (holeOffset - splitPointOffset) / (1 - splitPointOffset);
222
215
  /*
@@ -224,7 +217,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
224
217
  offset = 1 - offset;
225
218
  }
226
219
  */
227
- state = _export.Hole.create(state, layerID, hole.type, line1.id, _offset, hole.properties).updatedState;
220
+ state = Hole.create(state, layerID, hole.type, line1.id, _offset, hole.properties).updatedState;
228
221
  }
229
222
  });
230
223
 
@@ -234,13 +227,13 @@ var Line = exports["default"] = /*#__PURE__*/function () {
234
227
  return lines && lines.contains(lineID);
235
228
  });
236
229
  lineGroups.forEach(function (group) {
237
- state = _export.Group.addElement(state, group.id, layerID, 'lines', line0.id).updatedState;
238
- state = _export.Group.addElement(state, group.id, layerID, 'lines', line1.id).updatedState;
230
+ state = Group.addElement(state, group.id, layerID, 'lines', line0.id).updatedState;
231
+ state = Group.addElement(state, group.id, layerID, 'lines', line1.id).updatedState;
239
232
  });
240
233
  state = Line.remove(state, layerID, lineID).updatedState;
241
234
  return {
242
235
  updatedState: state,
243
- lines: new _immutable.List([line0, line1])
236
+ lines: new List([line0, line1])
244
237
  };
245
238
  }
246
239
  }, {
@@ -248,7 +241,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
248
241
  value: function addFromPoints(state, layerID, type, points, properties, holes) {
249
242
  var _this = this;
250
243
  var lineCreatedDateTime = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : new Date().getTime();
251
- points = new _immutable.List(points).sort(function (_ref, _ref2) {
244
+ points = new List(points).sort(function (_ref, _ref2) {
252
245
  var x1 = _ref.x,
253
246
  y1 = _ref.y;
254
247
  var x2 = _ref2.x,
@@ -256,7 +249,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
256
249
  return x1 === x2 ? y1 - y2 : x1 - x2;
257
250
  });
258
251
  var pointsPair = points.zip(points.skip(1)).filterNot(function (_ref3) {
259
- var _ref4 = (0, _slicedToArray2["default"])(_ref3, 2),
252
+ var _ref4 = _slicedToArray(_ref3, 2),
260
253
  _ref4$ = _ref4[0],
261
254
  x1 = _ref4$.x,
262
255
  y1 = _ref4$.y,
@@ -267,7 +260,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
267
260
  });
268
261
  var lines = [];
269
262
  pointsPair.forEach(function (_ref5) {
270
- var _ref6 = (0, _slicedToArray2["default"])(_ref5, 2),
263
+ var _ref6 = _slicedToArray(_ref5, 2),
271
264
  _ref6$ = _ref6[0],
272
265
  x1 = _ref6$.x,
273
266
  y1 = _ref6$.y,
@@ -278,10 +271,10 @@ var Line = exports["default"] = /*#__PURE__*/function () {
278
271
  stateL = _this$create.updatedState,
279
272
  line = _this$create.line;
280
273
  state = stateL;
281
- var lineLength = _export2.GeometryUtils.pointsDistance(x1, y1, x2, y2);
282
- var alpha = _export2.GeometryUtils.absAngleBetweenTwoPoints(x1, y1, x2, y2);
283
- var cosAlpha = _export2.GeometryUtils.cosWithThreshold(Math.abs(alpha), 0.0000001);
284
- var sinAlpha = _export2.GeometryUtils.sinWithThreshold(Math.abs(alpha), 0.0000001);
274
+ var lineLength = GeometryUtils.pointsDistance(x1, y1, x2, y2);
275
+ var alpha = GeometryUtils.absAngleBetweenTwoPoints(x1, y1, x2, y2);
276
+ var cosAlpha = GeometryUtils.cosWithThreshold(Math.abs(alpha), 0.0000001);
277
+ var sinAlpha = GeometryUtils.sinWithThreshold(Math.abs(alpha), 0.0000001);
285
278
  if (holes) {
286
279
  holes.forEach(function (holeWithOffsetPoint) {
287
280
  var offset = holeWithOffsetPoint.hole.toJS().offset;
@@ -289,16 +282,16 @@ var Line = exports["default"] = /*#__PURE__*/function () {
289
282
  var _holeWithOffsetPoint$ = holeWithOffsetPoint.offsetPosition,
290
283
  xp = _holeWithOffsetPoint$.x,
291
284
  yp = _holeWithOffsetPoint$.y;
292
- if (_export2.GeometryUtils.isPointOnLineSegment(x1, y1, x2, y2, xp, yp)) {
293
- var newOffset = _export2.GeometryUtils.pointPositionOnLineSegment(x1, y1, x2, y2, xp, yp);
285
+ if (GeometryUtils.isPointOnLineSegment(x1, y1, x2, y2, xp, yp)) {
286
+ var newOffset = GeometryUtils.pointPositionOnLineSegment(x1, y1, x2, y2, xp, yp);
294
287
  if (newOffset >= 0 && newOffset <= 1) {
295
288
  //add the position of hole
296
- var temp = _export.Hole.create(state, layerID, holeWithOffsetPoint.hole.type, line.id, newOffset, holeWithOffsetPoint.hole.properties, xp, yp);
289
+ var temp = Hole.create(state, layerID, holeWithOffsetPoint.hole.type, line.id, newOffset, holeWithOffsetPoint.hole.properties, xp, yp);
297
290
  state = temp.updatedState;
298
291
  var holeX = 0,
299
292
  holeY = 0,
300
293
  holeID = temp.hole.id;
301
- if (_export2.GeometryUtils.almostEqual(y1, y2)) {
294
+ if (GeometryUtils.almostEqual(y1, y2)) {
302
295
  if (x1 > x2) {
303
296
  holeX = x1 - lineLength * newOffset;
304
297
  holeY = y1;
@@ -306,7 +299,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
306
299
  holeX = x1 + lineLength * newOffset;
307
300
  holeY = y1;
308
301
  }
309
- } else if (_export2.GeometryUtils.almostEqual(x1, x2)) {
302
+ } else if (GeometryUtils.almostEqual(x1, x2)) {
310
303
  if (y1 > y2) {
311
304
  holeX = x1;
312
305
  holeY = y1 - lineLength * newOffset;
@@ -341,7 +334,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
341
334
  });
342
335
  return {
343
336
  updatedState: state,
344
- lines: new _immutable.List(lines),
337
+ lines: new List(lines),
345
338
  newline: lines[0]
346
339
  };
347
340
  }
@@ -361,21 +354,21 @@ var Line = exports["default"] = /*#__PURE__*/function () {
361
354
  var _line$vertices$map$to = line.vertices.map(function (vertexID) {
362
355
  return reducedState.getIn(['scene', 'layers', layerID, 'vertices']).get(vertexID);
363
356
  }).toArray(),
364
- _line$vertices$map$to2 = (0, _slicedToArray2["default"])(_line$vertices$map$to, 2),
357
+ _line$vertices$map$to2 = _slicedToArray(_line$vertices$map$to, 2),
365
358
  v0 = _line$vertices$map$to2[0],
366
359
  v1 = _line$vertices$map$to2[1];
367
- var hasCommonEndpoint = _export2.GeometryUtils.samePoints(v0, points[0]) || _export2.GeometryUtils.samePoints(v0, points[1]) || _export2.GeometryUtils.samePoints(v1, points[0]) || _export2.GeometryUtils.samePoints(v1, points[1]);
368
- var intersection = _export2.GeometryUtils.twoLineSegmentsIntersection(points[0], points[1], v0, v1);
360
+ var hasCommonEndpoint = GeometryUtils.samePoints(v0, points[0]) || GeometryUtils.samePoints(v0, points[1]) || GeometryUtils.samePoints(v1, points[0]) || GeometryUtils.samePoints(v1, points[1]);
361
+ var intersection = GeometryUtils.twoLineSegmentsIntersection(points[0], points[1], v0, v1);
369
362
  if (intersection.type === 'colinear') {
370
363
  if (!oldHoles) {
371
364
  oldHoles = [];
372
365
  }
373
- var orderedVertices = _export2.GeometryUtils.orderVertices(points);
366
+ var orderedVertices = GeometryUtils.orderVertices(points);
374
367
  reducedState.getIn(['scene', 'layers', layerID, 'lines', line.id, 'holes']).forEach(function (holeID) {
375
368
  var hole = reducedState.getIn(['scene', 'layers', layerID, 'holes', holeID]);
376
- var oldLineLength = _export2.GeometryUtils.pointsDistance(v0.x, v0.y, v1.x, v1.y);
377
- var offset = _export2.GeometryUtils.samePoints(orderedVertices[1], line.vertices.get(1)) ? 1 - hole.offset : hole.offset;
378
- var offsetPosition = _export2.GeometryUtils.extendLine(v0.x, v0.y, v1.x, v1.y, oldLineLength * offset);
369
+ var oldLineLength = GeometryUtils.pointsDistance(v0.x, v0.y, v1.x, v1.y);
370
+ var offset = GeometryUtils.samePoints(orderedVertices[1], line.vertices.get(1)) ? 1 - hole.offset : hole.offset;
371
+ var offsetPosition = GeometryUtils.extendLine(v0.x, v0.y, v1.x, v1.y, oldLineLength * offset);
379
372
  oldHoles.push({
380
373
  hole: hole,
381
374
  offsetPosition: offsetPosition
@@ -404,8 +397,8 @@ var Line = exports["default"] = /*#__PURE__*/function () {
404
397
  key: "replaceVertex",
405
398
  value: function replaceVertex(state, layerID, lineID, vertexIndex, x, y) {
406
399
  var vertexID = state.getIn(['scene', 'layers', layerID, 'lines', lineID, 'vertices', vertexIndex]);
407
- state = _export.Vertex.remove(state, layerID, vertexID, 'lines', lineID).updatedState;
408
- var _Vertex$add3 = _export.Vertex.add(state, layerID, x, y, 'lines', lineID),
400
+ state = Vertex.remove(state, layerID, vertexID, 'lines', lineID).updatedState;
401
+ var _Vertex$add3 = Vertex.add(state, layerID, x, y, 'lines', lineID),
409
402
  stateV = _Vertex$add3.updatedState,
410
403
  vertex = _Vertex$add3.vertex;
411
404
  state = stateV;
@@ -421,8 +414,8 @@ var Line = exports["default"] = /*#__PURE__*/function () {
421
414
  key: "selectToolDrawingLine",
422
415
  value: function selectToolDrawingLine(state, sceneComponentType) {
423
416
  state = state.merge({
424
- mode: _constants.MODE_WAITING_DRAWING_LINE,
425
- drawingSupport: new _immutable.Map({
417
+ mode: MODE_WAITING_DRAWING_LINE,
418
+ drawingSupport: new Map({
426
419
  type: sceneComponentType
427
420
  })
428
421
  });
@@ -434,16 +427,16 @@ var Line = exports["default"] = /*#__PURE__*/function () {
434
427
  key: "beginDrawingLine",
435
428
  value: function beginDrawingLine(state, layerID, x, y) {
436
429
  // if end drawing by created area
437
- if (state.mode == _constants.MODE_IDLE) {
430
+ if (state.mode == MODE_IDLE) {
438
431
  return {
439
432
  updatedState: state
440
433
  };
441
434
  }
442
435
  // ///////////////
443
- var snapElements = _export2.SnapSceneUtils.sceneSnapElements(state.scene, new _immutable.List(), state.snapMask);
436
+ var snapElements = SnapSceneUtils.sceneSnapElements(state.scene, new List(), state.snapMask);
444
437
  var snap = null;
445
438
  if (state.snapMask && !state.snapMask.isEmpty()) {
446
- snap = _export2.SnapUtils.nearestSnap(snapElements, x, y, state.snapMask);
439
+ snap = SnapUtils.nearestSnap(snapElements, x, y, state.snapMask);
447
440
  if (snap) {
448
441
  var _snap$point = snap.point;
449
442
  x = _snap$point.x;
@@ -451,36 +444,36 @@ var Line = exports["default"] = /*#__PURE__*/function () {
451
444
  }
452
445
  snapElements = snapElements.withMutations(function (snapElements) {
453
446
  var a, b, c;
454
- var _GeometryUtils$horizo = _export2.GeometryUtils.horizontalLine(y);
447
+ var _GeometryUtils$horizo = GeometryUtils.horizontalLine(y);
455
448
  a = _GeometryUtils$horizo.a;
456
449
  b = _GeometryUtils$horizo.b;
457
450
  c = _GeometryUtils$horizo.c;
458
- _export2.SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
459
- var _GeometryUtils$vertic = _export2.GeometryUtils.verticalLine(x);
451
+ SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
452
+ var _GeometryUtils$vertic = GeometryUtils.verticalLine(x);
460
453
  a = _GeometryUtils$vertic.a;
461
454
  b = _GeometryUtils$vertic.b;
462
455
  c = _GeometryUtils$vertic.c;
463
- _export2.SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
464
- var _GeometryUtils$upcros = _export2.GeometryUtils.upcrossLine(x, y);
456
+ SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
457
+ var _GeometryUtils$upcros = GeometryUtils.upcrossLine(x, y);
465
458
  a = _GeometryUtils$upcros.a;
466
459
  b = _GeometryUtils$upcros.b;
467
460
  c = _GeometryUtils$upcros.c;
468
- _export2.SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
469
- var _GeometryUtils$downcr = _export2.GeometryUtils.downcrossLine(x, y);
461
+ SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
462
+ var _GeometryUtils$downcr = GeometryUtils.downcrossLine(x, y);
470
463
  a = _GeometryUtils$downcr.a;
471
464
  b = _GeometryUtils$downcr.b;
472
465
  c = _GeometryUtils$downcr.c;
473
- _export2.SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
466
+ SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
474
467
  });
475
468
  }
476
469
  var drawingSupport = state.get('drawingSupport').set('layerID', layerID);
477
- state = _export.Layer.unselectAll(state, layerID).updatedState;
470
+ state = Layer.unselectAll(state, layerID).updatedState;
478
471
  var _Line$create3 = Line.create(state, layerID, drawingSupport.get('type'), x, y, x, y),
479
472
  stateL = _Line$create3.updatedState,
480
473
  line = _Line$create3.line;
481
474
  state = Line.select(stateL, layerID, line.id).updatedState;
482
475
  state = state.merge({
483
- mode: _constants.MODE_DRAWING_LINE,
476
+ mode: MODE_DRAWING_LINE,
484
477
  snapElements: snapElements,
485
478
  activeSnapElement: snap ? snap.snap : null,
486
479
  drawingSupport: drawingSupport
@@ -494,7 +487,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
494
487
  value: function updateDrawingLine(state, x, y, relatedLines) {
495
488
  var snap = null;
496
489
  if (state.snapMask && !state.snapMask.isEmpty()) {
497
- snap = _export2.SnapUtils.nearestSnap(state.snapElements, x, y, state.snapMask);
490
+ snap = SnapUtils.nearestSnap(state.snapElements, x, y, state.snapMask);
498
491
  if (snap) {
499
492
  var _snap$point2 = snap.point;
500
493
  x = _snap$point2.x;
@@ -510,7 +503,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
510
503
  var moveFlag = true;
511
504
  var tx = vertices[drawingLine.vertices[1]].x;
512
505
  var ty = vertices[drawingLine.vertices[1]].y;
513
- if (!(0, _helper.isEmpty)(relatedLines)) {
506
+ if (!isEmpty(relatedLines)) {
514
507
  vertices[drawingLine.vertices[1]].x = x;
515
508
  vertices[drawingLine.vertices[1]].y = y;
516
509
  }
@@ -520,12 +513,12 @@ var Line = exports["default"] = /*#__PURE__*/function () {
520
513
  if (drawingLine.vertices[0] !== drawingLine.vertices[1]) {
521
514
  relatedLines.forEach(function (line) {
522
515
  // get the points of two lines(drawing line and related line)
523
- if (!(0, _helper.isEmpty)(line)) {
516
+ if (!isEmpty(line)) {
524
517
  // the angle between two lines(line, drawingLine)
525
- lineAngle = _export2.GeometryUtils.angleBetweenTwoLines(line, drawingLine, vertices);
518
+ lineAngle = GeometryUtils.angleBetweenTwoLines(line, drawingLine, vertices);
526
519
  // check whether the angle is less than or bigger than specific value.
527
520
  absAngle = Math.abs(lineAngle);
528
- if (absAngle < _constants.MIN_ANGLE_DISALLOW_DRAW_WALL || absAngle > 360 - _constants.MIN_ANGLE_DISALLOW_DRAW_WALL) {
521
+ if (absAngle < MIN_ANGLE_DISALLOW_DRAW_WALL || absAngle > 360 - MIN_ANGLE_DISALLOW_DRAW_WALL) {
529
522
  moveFlag = false;
530
523
  } else moveFlag = true;
531
524
  }
@@ -537,20 +530,20 @@ var Line = exports["default"] = /*#__PURE__*/function () {
537
530
  tx = x;
538
531
  ty = y;
539
532
  } else {
540
- var rest = _constants.MIN_ANGLE_DISALLOW_DRAW_WALL - absAngle;
533
+ var rest = MIN_ANGLE_DISALLOW_DRAW_WALL - absAngle;
541
534
  // the origin point of rotation(snapping)
542
535
  var ox = vertices[drawingLine.vertices[0]].x;
543
536
  var oy = vertices[drawingLine.vertices[0]].y;
544
537
  // determine the direction of rotation.
545
538
  rest = lineAngle > 0 ? -rest : rest;
546
539
  // rotate the current point to last point around the first point of drawing line.
547
- var res = _export2.GeometryUtils.rotatePointAroundPoint(x, y, ox, oy, rest);
540
+ var res = GeometryUtils.rotatePointAroundPoint(x, y, ox, oy, rest);
548
541
  tx = res.x;
549
542
  ty = res.y;
550
543
  }
551
544
  // angle snapping as a value of UNIT_ANGLE
552
- if (moveFlag && !(0, _helper.isEmpty)(absAngle) && absAngle % _constants.UNIT_ANGLE !== 0) {
553
- var result = _export2.GeometryUtils.snapAngleByUnit(lineAngle, vertices, drawingLine, tx, ty, drawingLine.vertices[1]);
545
+ if (moveFlag && !isEmpty(absAngle) && absAngle % UNIT_ANGLE !== 0) {
546
+ var result = GeometryUtils.snapAngleByUnit(lineAngle, vertices, drawingLine, tx, ty, drawingLine.vertices[1]);
554
547
  tx = result.x;
555
548
  ty = result.y;
556
549
  }
@@ -580,9 +573,9 @@ var Line = exports["default"] = /*#__PURE__*/function () {
580
573
  var _layer$lines$get;
581
574
  var holeOffset = [];
582
575
  (_layer$lines$get = layer.lines.get(lineID)) === null || _layer$lines$get === void 0 || _layer$lines$get.holes.forEach(function (holeID) {
583
- var lineLength = _export2.GeometryUtils.pointsDistance(nv0.x, nv0.y, nv1.x, nv1.y);
584
- var minV = _export2.GeometryUtils.minVertex(nv0, nv1);
585
- var maxV = _export2.GeometryUtils.maxVertex(nv0, nv1);
576
+ var lineLength = GeometryUtils.pointsDistance(nv0.x, nv0.y, nv1.x, nv1.y);
577
+ var minV = GeometryUtils.minVertex(nv0, nv1);
578
+ var maxV = GeometryUtils.maxVertex(nv0, nv1);
586
579
  var alpha = Math.atan2(maxV.y - minV.y, maxV.x - minV.x);
587
580
  var hole = layer.holes.get(holeID);
588
581
  var pointOnLine = lineLength * hole.offset;
@@ -623,7 +616,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
623
616
  return mgline.id === lineID;
624
617
  });
625
618
  });
626
- if (!(0, _helper.isEmpty)(relatedLineID)) {
619
+ if (!isEmpty(relatedLineID)) {
627
620
  var relatedLine = layer.lines.get(relatedLineID[0]);
628
621
  var intersectionPoint = vertex;
629
622
  var startPoint, endPoint;
@@ -640,8 +633,8 @@ var Line = exports["default"] = /*#__PURE__*/function () {
640
633
  var tline2 = {
641
634
  vertices: [intersectionPoint.id, endPoint.id]
642
635
  };
643
- var angle = Math.abs(_export2.GeometryUtils.angleBetweenTwoLines(tline1, tline2, allVertices.toJS()));
644
- if (Math.abs(angle - 180) <= _constants.EPSILON) {
636
+ var angle = Math.abs(GeometryUtils.angleBetweenTwoLines(tline1, tline2, allVertices.toJS()));
637
+ if (Math.abs(angle - 180) <= EPSILON) {
645
638
  selectedLineInfo.mergelines.push(relatedLine);
646
639
  selectedLineInfo.points[0] = startPoint;
647
640
  selectedLineInfo.points[1] = endPoint;
@@ -659,7 +652,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
659
652
  var allVertices = state.getIn(['scene', 'layers', layerID, 'vertices']);
660
653
  var lineID = state.getIn(['scene', 'layers', layerID, 'selected', 'lines']).first();
661
654
  var line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
662
- if ((0, _helper.isEmpty)(line)) {
655
+ if (isEmpty(line)) {
663
656
  return {
664
657
  updatedState: state
665
658
  };
@@ -691,13 +684,13 @@ var Line = exports["default"] = /*#__PURE__*/function () {
691
684
  var holesWithOffsetPosition = [];
692
685
  var lineID = layer.getIn(['selected', 'lines']).first(); // lines : [id]
693
686
  var line = layer.getIn(['lines', lineID]);
694
- if ((0, _helper.isEmpty)(line)) {
687
+ if (isEmpty(line)) {
695
688
  return {
696
689
  updatedState: state
697
690
  };
698
691
  }
699
692
  mergeInfo.mergelines.forEach(function (line) {
700
- if ([_constants.END_DRAGGING_LINE, _constants.END_DRAGGING_VERTEX].includes(actionType)) {
693
+ if ([END_DRAGGING_LINE, END_DRAGGING_VERTEX].includes(actionType)) {
701
694
  var tmpGroups = state //get groups membership if present
702
695
  .getIn(['scene', 'groups']).filter(function (group) {
703
696
  var lines = group.getIn(['elements', layerID, 'lines']);
@@ -716,20 +709,20 @@ var Line = exports["default"] = /*#__PURE__*/function () {
716
709
  state = Line.remove(state, layerID, line.id).updatedState;
717
710
  });
718
711
  var ret;
719
- if (!_export2.GeometryUtils.samePoints(mergeInfo.points[0], mergeInfo.points[1])) {
712
+ if (!GeometryUtils.samePoints(mergeInfo.points[0], mergeInfo.points[1])) {
720
713
  ret = Line.createAvoidingIntersections(state, layerID, line.type, mergeInfo.points[0].x, mergeInfo.points[0].y, mergeInfo.points[1].x, mergeInfo.points[1].y, line.properties, holesWithOffsetPosition, line.createdDateTime);
721
714
  state = ret.updatedState;
722
715
  }
723
- if ([_constants.END_DRAGGING_LINE, _constants.END_DRAGGING_VERTEX].includes(actionType)) {
716
+ if ([END_DRAGGING_LINE, END_DRAGGING_VERTEX].includes(actionType)) {
724
717
  //re-add to old line's groups if present
725
718
  ret.lines.forEach(function (addedLine) {
726
719
  lineGroups.forEach(function (oldLineGroup) {
727
- state = _export.Group.addElement(state, oldLineGroup.id, layerID, 'lines', addedLine.id).updatedState;
720
+ state = Group.addElement(state, oldLineGroup.id, layerID, 'lines', addedLine.id).updatedState;
728
721
  });
729
722
  });
730
723
  }
731
- state = _export.Layer.removeZeroLengthLines(state, layerID).updatedState;
732
- if (!(0, _helper.isEmpty)((_ret = ret) === null || _ret === void 0 ? void 0 : _ret.newline)) {
724
+ state = Layer.removeZeroLengthLines(state, layerID).updatedState;
725
+ if (!isEmpty((_ret = ret) === null || _ret === void 0 ? void 0 : _ret.newline)) {
733
726
  state = this.select(state, layerID, ret.newline.get('id')).updatedState;
734
727
  }
735
728
  return {
@@ -744,10 +737,10 @@ var Line = exports["default"] = /*#__PURE__*/function () {
744
737
  var lineID = layer.getIn(['selected', 'lines']).first(); // lines : [id]
745
738
  var line = layer.getIn(['lines', lineID]);
746
739
  var drawingInfo = {};
747
- if (!(0, _helper.isEmpty)(line)) {
740
+ if (!isEmpty(line)) {
748
741
  drawingInfo.drawingLine = line;
749
742
  }
750
- state = _export.Layer.detectAndUpdateAreas(state, layerID, drawingInfo).updatedState;
743
+ state = Layer.detectAndUpdateAreas(state, layerID, drawingInfo).updatedState;
751
744
  return {
752
745
  updatedState: state
753
746
  };
@@ -769,16 +762,16 @@ var Line = exports["default"] = /*#__PURE__*/function () {
769
762
  var layerID = state.getIn(['scene', 'selectedLayer']);
770
763
  var lineID = state.getIn(['scene', 'layers', layerID, 'selected', 'lines']).first();
771
764
  var line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
772
- if ((0, _helper.isEmpty)(line)) {
765
+ if (isEmpty(line)) {
773
766
  return {
774
767
  updatedState: state
775
768
  };
776
769
  }
777
- if (!(0, _helper.isEmpty)(v0)) {
770
+ if (!isEmpty(v0)) {
778
771
  state = state.setIn(['scene', 'layers', layerID, 'vertices', line.vertices.get(0), 'x'], v0.x);
779
772
  state = state.setIn(['scene', 'layers', layerID, 'vertices', line.vertices.get(0), 'y'], v0.y);
780
773
  }
781
- if (!(0, _helper.isEmpty)(v1)) {
774
+ if (!isEmpty(v1)) {
782
775
  state = state.setIn(['scene', 'layers', layerID, 'vertices', line.vertices.get(1), 'x'], v1.x);
783
776
  state = state.setIn(['scene', 'layers', layerID, 'vertices', line.vertices.get(1), 'y'], v1.y);
784
777
  }
@@ -792,7 +785,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
792
785
  key: "endDrawingLine",
793
786
  value: function endDrawingLine(state, x, y) {
794
787
  if (state.snapMask && !state.snapMask.isEmpty()) {
795
- var snap = _export2.SnapUtils.nearestSnap(state.snapElements, x, y, state.snapMask);
788
+ var snap = SnapUtils.nearestSnap(state.snapElements, x, y, state.snapMask);
796
789
  if (snap) {
797
790
  var _snap$point3 = snap.point;
798
791
  x = _snap$point3.x;
@@ -805,8 +798,8 @@ var Line = exports["default"] = /*#__PURE__*/function () {
805
798
  if (drawingLine.vertices[0] === drawingLine.vertices[1]) {
806
799
  state = Line.remove(state, layerID, lineID).updatedState;
807
800
  state = state.merge({
808
- mode: _constants.MODE_IDLE,
809
- snapElements: new _immutable.List(),
801
+ mode: MODE_IDLE,
802
+ snapElements: new List(),
810
803
  activeSnapElement: null
811
804
  });
812
805
  return {
@@ -817,10 +810,10 @@ var Line = exports["default"] = /*#__PURE__*/function () {
817
810
  x: x,
818
811
  y: y
819
812
  }, state).updatedState;
820
- state = this.applyWallChanges(state, _constants.END_DRAWING_LINE).updatedState;
813
+ state = this.applyWallChanges(state, END_DRAWING_LINE).updatedState;
821
814
  state = state.merge({
822
- mode: _constants.MODE_WAITING_DRAWING_LINE,
823
- snapElements: new _immutable.List(),
815
+ mode: MODE_WAITING_DRAWING_LINE,
816
+ snapElements: new List(),
824
817
  activeSnapElement: null
825
818
  });
826
819
  return {
@@ -830,15 +823,15 @@ var Line = exports["default"] = /*#__PURE__*/function () {
830
823
  }, {
831
824
  key: "beginDraggingLine",
832
825
  value: function beginDraggingLine(state, layerID, lineID, x, y) {
833
- var snapElements = _export2.SnapSceneUtils.sceneSnapElements(state.scene, new _immutable.List(), state.snapMask);
826
+ var snapElements = SnapSceneUtils.sceneSnapElements(state.scene, new List(), state.snapMask);
834
827
  var layer = state.scene.layers.get(layerID);
835
828
  var line = layer.lines.get(lineID);
836
829
  var vertex0 = layer.vertices.get(line.vertices.get(0));
837
830
  var vertex1 = layer.vertices.get(line.vertices.get(1));
838
831
  state = state.merge({
839
- mode: _constants.MODE_DRAGGING_LINE,
832
+ mode: MODE_DRAGGING_LINE,
840
833
  snapElements: snapElements,
841
- draggingSupport: (0, _immutable.Map)({
834
+ draggingSupport: Map({
842
835
  layerID: layerID,
843
836
  lineID: lineID,
844
837
  startPointX: x,
@@ -876,7 +869,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
876
869
  var vec1 = pos1.clone().sub(cen).normalize();
877
870
  var vec2 = pos2.clone().sub(cen).normalize();
878
871
  var angle = Math.floor(vec1.angle() * 180 / Math.PI - vec2.angle() * 180 / Math.PI + 0.5);
879
- if (Math.abs(angle) < _constants.MIN_ANGLE_DISALLOW_DRAW_WALL || Math.abs(angle) > 360 - _constants.MIN_ANGLE_DISALLOW_DRAW_WALL) {
872
+ if (Math.abs(angle) < MIN_ANGLE_DISALLOW_DRAW_WALL || Math.abs(angle) > 360 - MIN_ANGLE_DISALLOW_DRAW_WALL) {
880
873
  mvFlag.push(false);
881
874
  } else {
882
875
  mvFlag.push(true);
@@ -916,8 +909,8 @@ var Line = exports["default"] = /*#__PURE__*/function () {
916
909
  var curSnap0 = null,
917
910
  curSnap1 = null;
918
911
  if (state.snapMask && !state.snapMask.isEmpty()) {
919
- curSnap0 = _export2.SnapUtils.nearestSnap(snapElements, newVertex0X, newVertex0Y, state.snapMask);
920
- curSnap1 = _export2.SnapUtils.nearestSnap(snapElements, newVertex1X, newVertex1Y, state.snapMask);
912
+ curSnap0 = SnapUtils.nearestSnap(snapElements, newVertex0X, newVertex0Y, state.snapMask);
913
+ curSnap1 = SnapUtils.nearestSnap(snapElements, newVertex1X, newVertex1Y, state.snapMask);
921
914
  }
922
915
  var deltaX = 0,
923
916
  deltaY = 0;
@@ -1001,8 +994,8 @@ var Line = exports["default"] = /*#__PURE__*/function () {
1001
994
  var newVertex1X = draggingSupport.get('startVertex1X') + diffX;
1002
995
  var newVertex1Y = draggingSupport.get('startVertex1Y') + diffY;
1003
996
  if (state.snapMask && !state.snapMask.isEmpty()) {
1004
- var curSnap0 = _export2.SnapUtils.nearestSnap(state.snapElements, newVertex0X, newVertex0Y, state.snapMask);
1005
- var curSnap1 = _export2.SnapUtils.nearestSnap(state.snapElements, newVertex1X, newVertex1Y, state.snapMask);
997
+ var curSnap0 = SnapUtils.nearestSnap(state.snapElements, newVertex0X, newVertex0Y, state.snapMask);
998
+ var curSnap1 = SnapUtils.nearestSnap(state.snapElements, newVertex1X, newVertex1Y, state.snapMask);
1006
999
  var deltaX = 0,
1007
1000
  deltaY = 0;
1008
1001
  if (curSnap0 && curSnap1) {
@@ -1039,9 +1032,9 @@ var Line = exports["default"] = /*#__PURE__*/function () {
1039
1032
  newVertex0Y = newResult.newVertex0Y;
1040
1033
  newVertex1X = newResult.newVertex1X;
1041
1034
  newVertex1Y = newResult.newVertex1Y;
1042
- state = _export.Layer.mergeEqualsVertices(state, layerID, line.vertices.get(0)).updatedState;
1043
- state = _export.Layer.mergeEqualsVertices(state, layerID, line.vertices.get(1)).updatedState;
1044
- if (_export2.GeometryUtils.samePoints({
1035
+ state = Layer.mergeEqualsVertices(state, layerID, line.vertices.get(0)).updatedState;
1036
+ state = Layer.mergeEqualsVertices(state, layerID, line.vertices.get(1)).updatedState;
1037
+ if (GeometryUtils.samePoints({
1045
1038
  newVertex0X: newVertex0X,
1046
1039
  newVertex0Y: newVertex0Y
1047
1040
  }, {
@@ -1057,13 +1050,13 @@ var Line = exports["default"] = /*#__PURE__*/function () {
1057
1050
  x: newVertex1X,
1058
1051
  y: newVertex1Y
1059
1052
  }, state).updatedState;
1060
- state = this.applyWallChanges(state, _constants.END_DRAGGING_LINE).updatedState;
1053
+ state = this.applyWallChanges(state, END_DRAGGING_LINE).updatedState;
1061
1054
  }
1062
1055
  state = state.merge({
1063
- mode: _constants.MODE_IDLE,
1056
+ mode: MODE_IDLE,
1064
1057
  draggingSupport: null,
1065
1058
  activeSnapElement: null,
1066
- snapElements: new _immutable.List()
1059
+ snapElements: new List()
1067
1060
  });
1068
1061
  return {
1069
1062
  updatedState: state
@@ -1080,7 +1073,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
1080
1073
  }, {
1081
1074
  key: "setJsProperties",
1082
1075
  value: function setJsProperties(state, layerID, lineID, properties) {
1083
- return this.setProperties(state, layerID, lineID, (0, _immutable.fromJS)(properties));
1076
+ return this.setProperties(state, layerID, lineID, fromJS(properties));
1084
1077
  }
1085
1078
  }, {
1086
1079
  key: "updateProperties",
@@ -1095,7 +1088,7 @@ var Line = exports["default"] = /*#__PURE__*/function () {
1095
1088
  }, {
1096
1089
  key: "updateJsProperties",
1097
1090
  value: function updateJsProperties(state, layerID, lineID, properties) {
1098
- return this.updateProperties(state, layerID, lineID, (0, _immutable.fromJS)(properties));
1091
+ return this.updateProperties(state, layerID, lineID, fromJS(properties));
1099
1092
  }
1100
1093
  }, {
1101
1094
  key: "setAttributes",
@@ -1114,17 +1107,17 @@ var Line = exports["default"] = /*#__PURE__*/function () {
1114
1107
  delete lAttr['lineToExtend'];
1115
1108
  delete lAttr['lineLength'];
1116
1109
  var line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
1117
- state = state.mergeIn(['scene', 'layers', layerID, 'lines', lineID], (0, _immutable.fromJS)(lAttr)).mergeIn(['scene', 'layers', layerID, 'vertices', vertexOne.id], {
1110
+ state = state.mergeIn(['scene', 'layers', layerID, 'lines', lineID], fromJS(lAttr)).mergeIn(['scene', 'layers', layerID, 'vertices', vertexOne.id], {
1118
1111
  x: vertexOne.x,
1119
1112
  y: vertexOne.y
1120
1113
  }).mergeIn(['scene', 'layers', layerID, 'vertices', vertexTwo.id], {
1121
1114
  x: vertexTwo.x,
1122
1115
  y: vertexTwo.y
1123
- }).mergeIn(['scene', 'layers', layerID, 'lines', lineID, 'misc'], new _immutable.Map({
1116
+ }).mergeIn(['scene', 'layers', layerID, 'lines', lineID, 'misc'], new Map({
1124
1117
  _unitLength: lineLength._unit
1125
1118
  })).mergeIn(['scene', 'layers', layerID, 'lines', lineID, 'focus'], true);
1126
1119
  if (lineToExtend) {
1127
- state = state.mergeIn(['scene', 'layers', layerID, 'lines', lineToExtend.id], (0, _immutable.fromJS)(lAttr)).mergeIn(['scene', 'layers', layerID, 'lines', lineToExtend.id, 'misc'], new _immutable.Map({
1120
+ state = state.mergeIn(['scene', 'layers', layerID, 'lines', lineToExtend.id], fromJS(lAttr)).mergeIn(['scene', 'layers', layerID, 'lines', lineToExtend.id, 'misc'], new Map({
1128
1121
  _unitLength: lineLength._unit
1129
1122
  }));
1130
1123
  }
@@ -1140,14 +1133,14 @@ var Line = exports["default"] = /*#__PURE__*/function () {
1140
1133
  y: vertexFour.y
1141
1134
  });
1142
1135
  }
1143
- state = _export.Layer.mergeEqualsVertices(state, layerID, vertexOne.id).updatedState;
1136
+ state = Layer.mergeEqualsVertices(state, layerID, vertexOne.id).updatedState;
1144
1137
  if (vertexOne.x != vertexTwo.x && vertexOne.y != vertexTwo.y) {
1145
- state = _export.Layer.mergeEqualsVertices(state, layerID, vertexTwo.id).updatedState;
1138
+ state = Layer.mergeEqualsVertices(state, layerID, vertexTwo.id).updatedState;
1146
1139
  }
1147
1140
  state = this.select(state, layerID, lineID).updatedState;
1148
- state = this.applyWallChanges(state, _constants.END_DRAWING_LINE).updatedState;
1141
+ state = this.applyWallChanges(state, END_DRAWING_LINE).updatedState;
1149
1142
  state = state.merge({
1150
- sceneHistory: _export2.history.historyPush(state.sceneHistory, state.scene)
1143
+ sceneHistory: history.historyPush(state.sceneHistory, state.scene)
1151
1144
  });
1152
1145
  if (state.mode.endsWith('_LINE')) {
1153
1146
  state = state.setIn(['scene', 'setLineAttributes'], true);
@@ -1161,11 +1154,11 @@ var Line = exports["default"] = /*#__PURE__*/function () {
1161
1154
  key: "setVerticesCoords",
1162
1155
  value: function setVerticesCoords(state, layerID, lineID, x1, y1, x2, y2) {
1163
1156
  var line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
1164
- state = _export.Vertex.setAttributes(state, layerID, line.vertices.get(0), new _immutable.Map({
1157
+ state = Vertex.setAttributes(state, layerID, line.vertices.get(0), new Map({
1165
1158
  x: x1,
1166
1159
  y: y1
1167
1160
  })).updatedState;
1168
- state = _export.Vertex.setAttributes(state, layerID, line.vertices.get(1), new _immutable.Map({
1161
+ state = Vertex.setAttributes(state, layerID, line.vertices.get(1), new Map({
1169
1162
  x: x2,
1170
1163
  y: y2
1171
1164
  })).updatedState;
@@ -1174,4 +1167,5 @@ var Line = exports["default"] = /*#__PURE__*/function () {
1174
1167
  };
1175
1168
  }
1176
1169
  }]);
1177
- }();
1170
+ }();
1171
+ export { Line as default };