kitchen-simulator 1.1.1-test.62 → 1.1.1-test.64

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