kitchen-simulator 1.1.1-test.60 → 1.1.1-test.61
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.
- package/es/@history.js +10 -2
- package/es/AppContext.js +10 -3
- package/es/KitchenConfigurator.js +92 -96
- package/es/KitchenConfiguratorApp.js +143 -136
- package/es/actions/area-actions.js +12 -5
- package/es/actions/export.js +29 -12
- package/es/actions/groups-actions.js +45 -27
- package/es/actions/holes-actions.js +55 -34
- package/es/actions/items-actions.js +145 -94
- package/es/actions/lines-actions.js +36 -21
- package/es/actions/project-actions.js +145 -94
- package/es/actions/scene-actions.js +21 -11
- package/es/actions/vertices-actions.js +15 -7
- package/es/actions/viewer2d-actions.js +36 -21
- package/es/actions/viewer3d-actions.js +18 -9
- package/es/catalog/areas/area/planner-element.js +9 -2
- package/es/catalog/catalog.js +21 -24
- package/es/catalog/factories/area-factory-3d.js +31 -22
- package/es/catalog/factories/area-factory.js +20 -14
- package/es/catalog/factories/export.js +24 -6
- package/es/catalog/factories/wall-factory-3d.js +41 -31
- package/es/catalog/factories/wall-factory.js +31 -21
- package/es/catalog/holes/door-closet/planner-element.js +24 -15
- package/es/catalog/holes/door-double/planner-element.js +24 -15
- package/es/catalog/holes/door-exterior/planner-element.js +25 -16
- package/es/catalog/holes/door-interior/planner-element.js +25 -16
- package/es/catalog/holes/door-panic/planner-element.js +16 -7
- package/es/catalog/holes/door-panic-double/planner-element.js +24 -15
- package/es/catalog/holes/door-sliding/planner-element.js +25 -16
- package/es/catalog/holes/doorway-framed/planner-element.js +20 -11
- package/es/catalog/holes/doorway-frameless/planner-element.js +16 -7
- package/es/catalog/holes/export.js +97 -13
- package/es/catalog/holes/window-clear/planner-element.js +19 -10
- package/es/catalog/holes/window-cross/planner-element.js +19 -10
- package/es/catalog/holes/window-double-hung/planner-element.js +19 -10
- package/es/catalog/holes/window-vertical/planner-element.js +19 -10
- package/es/catalog/lines/wall/planner-element.js +9 -2
- package/es/catalog/molding/molding-dcm/planner-element.js +14 -5
- package/es/catalog/molding/molding-fbm/planner-element.js +14 -5
- package/es/catalog/molding/molding-lrm/planner-element.js +14 -5
- package/es/catalog/properties/export.js +80 -20
- package/es/catalog/properties/property-checkbox.js +31 -27
- package/es/catalog/properties/property-color.js +23 -16
- package/es/catalog/properties/property-enum.js +31 -29
- package/es/catalog/properties/property-hidden.js +16 -9
- package/es/catalog/properties/property-lenght-measure.js +45 -39
- package/es/catalog/properties/property-length-measure.js +43 -42
- package/es/catalog/properties/property-length-measure_hole.js +45 -39
- package/es/catalog/properties/property-number.js +24 -17
- package/es/catalog/properties/property-read-only.js +23 -16
- package/es/catalog/properties/property-string.js +23 -16
- package/es/catalog/properties/property-toggle.js +23 -16
- package/es/catalog/properties/shared-property-style.js +7 -1
- package/es/catalog/utils/FuseUtils.js +15 -11
- package/es/catalog/utils/exporter.js +15 -11
- package/es/catalog/utils/geom-utils.js +29 -13
- package/es/catalog/utils/item-loader.js +97 -91
- package/es/catalog/utils/load-obj.js +28 -20
- package/es/catalog/utils/mtl-loader.js +8 -3
- package/es/catalog/utils/obj-loader.js +8 -3
- package/es/class/FuseUtils.js +15 -11
- package/es/class/area.js +28 -26
- package/es/class/export.js +95 -23
- package/es/class/group.js +59 -62
- package/es/class/guide.js +21 -19
- package/es/class/hole.js +89 -87
- package/es/class/item.js +147 -150
- package/es/class/layer.js +65 -63
- package/es/class/line.js +143 -144
- package/es/class/project.js +98 -94
- package/es/class/vertex.js +35 -33
- package/es/components/content.js +28 -19
- package/es/components/disclaimer/disclaimer.js +18 -10
- package/es/components/export.js +32 -8
- package/es/components/style/button.js +31 -30
- package/es/components/style/cancel-button.js +14 -8
- package/es/components/style/content-container.js +16 -12
- package/es/components/style/content-title.js +20 -15
- package/es/components/style/delete-button.js +17 -9
- package/es/components/style/export.js +120 -30
- package/es/components/style/form-block.js +15 -12
- package/es/components/style/form-color-input.js +14 -8
- package/es/components/style/form-label.js +15 -12
- package/es/components/style/form-number-input.js +49 -47
- package/es/components/style/form-number-input_2.js +44 -42
- package/es/components/style/form-select.js +24 -26
- package/es/components/style/form-slider.js +17 -11
- package/es/components/style/form-submit-button.js +17 -9
- package/es/components/style/form-text-input.js +34 -33
- package/es/components/viewer2d/area.js +24 -17
- package/es/components/viewer2d/export.js +120 -30
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +17 -10
- package/es/components/viewer2d/grids/grid-streak.js +17 -10
- package/es/components/viewer2d/grids/grid-vertical-streak.js +17 -10
- package/es/components/viewer2d/grids/grids.js +19 -15
- package/es/components/viewer2d/group.js +24 -15
- package/es/components/viewer2d/item.js +70 -66
- package/es/components/viewer2d/layer.js +30 -23
- package/es/components/viewer2d/line.js +111 -101
- package/es/components/viewer2d/ruler.js +29 -22
- package/es/components/viewer2d/rulerDist.js +28 -21
- package/es/components/viewer2d/rulerX.js +47 -45
- package/es/components/viewer2d/rulerY.js +45 -43
- package/es/components/viewer2d/scene.js +41 -45
- package/es/components/viewer2d/snap.js +22 -13
- package/es/components/viewer2d/state.js +27 -23
- package/es/components/viewer2d/utils.js +37 -29
- package/es/components/viewer2d/vertex.js +17 -8
- package/es/components/viewer2d/viewer2d.js +163 -164
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +23 -24
- package/es/components/viewer3d/dcm.js +7 -1
- package/es/components/viewer3d/fbm.js +7 -1
- package/es/components/viewer3d/front3D.js +21 -17
- package/es/components/viewer3d/grid-creator.js +17 -8
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +14 -6
- package/es/components/viewer3d/grids/grid-streak.js +13 -5
- package/es/components/viewer3d/grids/grid-vertical-streak.js +14 -6
- package/es/components/viewer3d/libs/first-person-controls.js +9 -2
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +7 -1
- package/es/components/viewer3d/libs/mtl-loader.js +7 -1
- package/es/components/viewer3d/libs/obj-loader.js +7 -1
- package/es/components/viewer3d/libs/orbit-controls.js +8 -2
- package/es/components/viewer3d/libs/pointer-lock-controls.js +8 -2
- package/es/components/viewer3d/lrm.js +7 -1
- package/es/components/viewer3d/model.js +7 -1
- package/es/components/viewer3d/pointer-lock-navigation.js +10 -3
- package/es/components/viewer3d/ruler-utils/itemRect.js +25 -18
- package/es/components/viewer3d/ruler-utils/layer3D.js +66 -59
- package/es/components/viewer3d/ruler-utils/ruler3D.js +46 -42
- package/es/components/viewer3d/ruler-utils/scene3D.js +17 -9
- package/es/components/viewer3d/ruler-utils/state3D.js +11 -4
- package/es/components/viewer3d/scene-creator.js +227 -198
- package/es/components/viewer3d/three-memory-cleaner.js +12 -3
- package/es/components/viewer3d/viewer3d-first-person.js +46 -46
- package/es/components/viewer3d/viewer3d.js +202 -202
- package/es/constants.js +358 -349
- package/es/index.js +13 -6
- package/es/models.js +184 -183
- package/es/plugins/SVGLoader.js +53 -48
- package/es/plugins/autosave.js +9 -3
- package/es/plugins/console-debugger.js +12 -8
- package/es/plugins/export.js +32 -8
- package/es/plugins/keyboard.js +35 -29
- package/es/reducers/areas-reducer.js +13 -7
- package/es/reducers/export.js +96 -24
- package/es/reducers/groups-reducer.js +37 -31
- package/es/reducers/holes-reducer.js +49 -43
- package/es/reducers/items-reducer.js +112 -106
- package/es/reducers/lines-reducer.js +34 -28
- package/es/reducers/project-reducer.js +111 -105
- package/es/reducers/reducer.js +23 -16
- package/es/reducers/scene-reducer.js +21 -15
- package/es/reducers/user-reducer.js +11 -5
- package/es/reducers/vertices-reducer.js +17 -11
- package/es/reducers/viewer2d-reducer.js +24 -18
- package/es/reducers/viewer3d-reducer.js +22 -16
- package/es/shared-style.js +16 -10
- package/es/styles/export.js +11 -3
- package/es/translator/en.js +7 -1
- package/es/translator/it.js +7 -1
- package/es/translator/ru.js +7 -1
- package/es/translator/translator.js +19 -17
- package/es/utils/browser.js +9 -2
- package/es/utils/convert-units-lite.js +7 -1
- package/es/utils/email-validator.js +7 -1
- package/es/utils/export.js +46 -15
- package/es/utils/geometry.js +278 -190
- package/es/utils/get-edges-of-subgraphs.js +9 -2
- package/es/utils/graph-cycles.js +11 -8
- package/es/utils/graph-inner-cycles.js +18 -10
- package/es/utils/graph.js +17 -13
- package/es/utils/helper.js +63 -41
- package/es/utils/history.js +15 -8
- package/es/utils/id-broker.js +15 -12
- package/es/utils/logger.js +7 -1
- package/es/utils/math.js +12 -5
- package/es/utils/molding.js +144 -125
- package/es/utils/name-generator.js +13 -11
- package/es/utils/objects-utils.js +19 -7
- package/es/utils/phone-validator.js +7 -1
- package/es/utils/process-black-list.js +10 -6
- package/es/utils/react-if.js +12 -6
- package/es/utils/snap-scene.js +34 -32
- package/es/utils/snap.js +59 -51
- package/es/utils/summarizeCart.js +7 -1
- package/es/utils/threeCSG.es6.js +22 -17
- package/es/version.js +7 -1
- package/lib/@history.js +1 -1
- package/lib/AppContext.js +1 -1
- package/lib/KitchenConfigurator.js +37 -49
- package/lib/KitchenConfiguratorApp.js +60 -61
- package/lib/actions/export.js +1 -1
- package/lib/catalog/areas/area/planner-element.js +1 -1
- package/lib/catalog/catalog.js +7 -15
- package/lib/catalog/factories/area-factory-3d.js +1 -1
- package/lib/catalog/factories/area-factory.js +4 -6
- package/lib/catalog/factories/export.js +1 -1
- package/lib/catalog/factories/wall-factory-3d.js +2 -2
- package/lib/catalog/factories/wall-factory.js +2 -2
- package/lib/catalog/holes/door-closet/planner-element.js +2 -2
- package/lib/catalog/holes/door-double/planner-element.js +2 -2
- package/lib/catalog/holes/door-exterior/planner-element.js +2 -2
- package/lib/catalog/holes/door-interior/planner-element.js +2 -2
- package/lib/catalog/holes/door-panic/planner-element.js +2 -2
- package/lib/catalog/holes/door-panic-double/planner-element.js +2 -2
- package/lib/catalog/holes/door-sliding/planner-element.js +2 -2
- package/lib/catalog/holes/doorway-framed/planner-element.js +2 -2
- package/lib/catalog/holes/doorway-frameless/planner-element.js +2 -2
- package/lib/catalog/holes/export.js +2 -2
- package/lib/catalog/holes/window-clear/planner-element.js +2 -2
- package/lib/catalog/holes/window-cross/planner-element.js +2 -2
- package/lib/catalog/holes/window-double-hung/planner-element.js +2 -2
- package/lib/catalog/holes/window-vertical/planner-element.js +2 -2
- package/lib/catalog/lines/wall/planner-element.js +1 -1
- package/lib/catalog/molding/molding-dcm/planner-element.js +2 -2
- package/lib/catalog/molding/molding-fbm/planner-element.js +2 -2
- package/lib/catalog/molding/molding-lrm/planner-element.js +2 -2
- package/lib/catalog/properties/export.js +1 -1
- package/lib/catalog/properties/property-checkbox.js +3 -6
- package/lib/catalog/properties/property-color.js +1 -1
- package/lib/catalog/properties/property-enum.js +4 -9
- package/lib/catalog/properties/property-hidden.js +1 -1
- package/lib/catalog/properties/property-lenght-measure.js +5 -6
- package/lib/catalog/properties/property-length-measure.js +7 -13
- package/lib/catalog/properties/property-length-measure_hole.js +5 -6
- package/lib/catalog/properties/property-number.js +1 -1
- package/lib/catalog/properties/property-read-only.js +1 -1
- package/lib/catalog/properties/property-string.js +1 -1
- package/lib/catalog/properties/property-toggle.js +1 -1
- package/lib/catalog/utils/FuseUtils.js +8 -10
- package/lib/catalog/utils/exporter.js +3 -5
- package/lib/catalog/utils/geom-utils.js +1 -1
- package/lib/catalog/utils/item-loader.js +9 -14
- package/lib/class/FuseUtils.js +8 -10
- package/lib/class/area.js +7 -10
- package/lib/class/export.js +1 -1
- package/lib/class/group.js +11 -19
- package/lib/class/guide.js +9 -12
- package/lib/class/hole.js +5 -8
- package/lib/class/item.js +10 -18
- package/lib/class/layer.js +5 -8
- package/lib/class/line.js +12 -19
- package/lib/class/project.js +8 -10
- package/lib/class/vertex.js +7 -10
- package/lib/components/content.js +2 -2
- package/lib/components/disclaimer/disclaimer.js +1 -1
- package/lib/components/export.js +1 -1
- package/lib/components/style/button.js +15 -21
- package/lib/components/style/cancel-button.js +5 -6
- package/lib/components/style/content-container.js +3 -6
- package/lib/components/style/content-title.js +8 -11
- package/lib/components/style/delete-button.js +6 -7
- package/lib/components/style/export.js +1 -1
- package/lib/components/style/form-block.js +7 -11
- package/lib/components/style/form-color-input.js +5 -6
- package/lib/components/style/form-label.js +7 -11
- package/lib/components/style/form-number-input.js +13 -18
- package/lib/components/style/form-number-input_2.js +13 -18
- package/lib/components/style/form-select.js +10 -19
- package/lib/components/style/form-slider.js +5 -6
- package/lib/components/style/form-submit-button.js +6 -7
- package/lib/components/style/form-text-input.js +17 -22
- package/lib/components/viewer2d/area.js +1 -1
- package/lib/components/viewer2d/export.js +1 -1
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +1 -1
- package/lib/components/viewer2d/grids/grid-streak.js +1 -1
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +1 -1
- package/lib/components/viewer2d/grids/grids.js +4 -9
- package/lib/components/viewer2d/group.js +2 -2
- package/lib/components/viewer2d/item.js +5 -10
- package/lib/components/viewer2d/layer.js +1 -1
- package/lib/components/viewer2d/line.js +2 -2
- package/lib/components/viewer2d/ruler.js +1 -1
- package/lib/components/viewer2d/rulerDist.js +1 -1
- package/lib/components/viewer2d/rulerX.js +13 -18
- package/lib/components/viewer2d/rulerY.js +13 -18
- package/lib/components/viewer2d/scene.js +21 -32
- package/lib/components/viewer2d/snap.js +2 -2
- package/lib/components/viewer2d/state.js +5 -10
- package/lib/components/viewer2d/utils.js +5 -9
- package/lib/components/viewer2d/vertex.js +2 -2
- package/lib/components/viewer2d/viewer2d.js +13 -23
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +14 -20
- package/lib/components/viewer3d/front3D.js +4 -9
- package/lib/components/viewer3d/grid-creator.js +2 -2
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +1 -1
- package/lib/components/viewer3d/grids/grid-streak.js +1 -1
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +1 -1
- package/lib/components/viewer3d/pointer-lock-navigation.js +1 -1
- package/lib/components/viewer3d/ruler-utils/itemRect.js +1 -1
- package/lib/components/viewer3d/ruler-utils/layer3D.js +1 -1
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +3 -6
- package/lib/components/viewer3d/ruler-utils/scene3D.js +1 -1
- package/lib/components/viewer3d/ruler-utils/state3D.js +1 -1
- package/lib/components/viewer3d/scene-creator.js +16 -21
- package/lib/components/viewer3d/three-memory-cleaner.js +1 -1
- package/lib/components/viewer3d/viewer3d-first-person.js +11 -16
- package/lib/components/viewer3d/viewer3d.js +15 -20
- package/lib/index.js +1 -1
- package/lib/models.js +51 -56
- package/lib/plugins/console-debugger.js +3 -6
- package/lib/plugins/export.js +1 -1
- package/lib/reducers/export.js +1 -1
- package/lib/styles/export.js +1 -1
- package/lib/translator/translator.js +5 -9
- package/lib/utils/export.js +2 -2
- package/lib/utils/geometry.js +11 -18
- package/lib/utils/graph-inner-cycles.js +1 -1
- package/lib/utils/graph.js +7 -10
- package/lib/utils/helper.js +7 -7
- package/lib/utils/history.js +1 -1
- package/lib/utils/id-broker.js +5 -8
- package/lib/utils/molding.js +14 -19
- package/lib/utils/name-generator.js +5 -8
- package/lib/utils/objects-utils.js +5 -3
- package/lib/utils/process-black-list.js +3 -5
- package/lib/utils/react-if.js +1 -1
- package/lib/utils/snap-scene.js +3 -7
- package/lib/utils/snap.js +22 -26
- package/lib/utils/threeCSG.es6.js +14 -14
- package/package.json +24 -18
package/es/class/item.js
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
+
var _convertUnitsLite = require("../utils/convert-units-lite");
|
|
13
|
+
var _export = require("./export");
|
|
14
|
+
var _export2 = require("../utils/export");
|
|
15
|
+
var _immutable = require("immutable");
|
|
16
|
+
var _constants = require("../constants");
|
|
17
|
+
var _helper = require("../utils/helper");
|
|
18
|
+
var _molding = require("../utils/molding");
|
|
19
|
+
var _utils = require("../components/viewer2d/utils");
|
|
8
20
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
10
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
11
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
12
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
13
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
14
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
|
-
import { convert } from "../utils/convert-units-lite";
|
|
17
|
-
import { Group, Hole, Layer } from "./export";
|
|
18
|
-
import { GeometryUtils, IDBroker, MoldingUtils, NameGenerator } from "../utils/export";
|
|
19
|
-
import { fromJS, Map } from 'immutable';
|
|
20
|
-
import { INSTALLATION_SUFFIX_TYPE, MODE_DRAGGING_ITEM, MODE_DRAGGING_ITEM_3D, MODE_DRAWING_ITEM, MODE_DRAWING_ITEM_3D, MODE_IDLE, MODE_IDLE_3D, MODE_ROTATING_ITEM, MODE_ROTATING_ITEM_3D, MOLDING_LOCATIONS } from "../constants";
|
|
21
|
-
import { debugUtil } from "../utils/helper";
|
|
22
|
-
import { hasMoldingLayout } from "../utils/molding";
|
|
23
|
-
import { getInstallationSuffix } from "../components/viewer2d/utils";
|
|
21
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24
22
|
var allItemRect;
|
|
25
23
|
var allItemSnap;
|
|
26
24
|
var allLines;
|
|
@@ -29,19 +27,19 @@ var allLineSnap;
|
|
|
29
27
|
var allRect;
|
|
30
28
|
var time1;
|
|
31
29
|
var time2;
|
|
32
|
-
var Item = /*#__PURE__*/function () {
|
|
30
|
+
var Item = exports["default"] = /*#__PURE__*/function () {
|
|
33
31
|
function Item() {
|
|
34
|
-
|
|
32
|
+
(0, _classCallCheck2["default"])(this, Item);
|
|
35
33
|
}
|
|
36
|
-
return
|
|
34
|
+
return (0, _createClass2["default"])(Item, null, [{
|
|
37
35
|
key: "create",
|
|
38
36
|
value: function create(state, layerID, type, x, y, width, height, rotation, isDuplication) {
|
|
39
37
|
var molding = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : [];
|
|
40
|
-
var itemID = IDBroker.acquireID();
|
|
38
|
+
var itemID = _export2.IDBroker.acquireID();
|
|
41
39
|
var item = state.catalog.factoryElement(type, {
|
|
42
40
|
id: itemID,
|
|
43
41
|
itemID: state.catalog.getIn(['elements', type, 'itemID']),
|
|
44
|
-
name: NameGenerator.generateName('items', state.catalog.getIn(['elements', type, 'info', 'title'])),
|
|
42
|
+
name: _export2.NameGenerator.generateName('items', state.catalog.getIn(['elements', type, 'info', 'title'])),
|
|
45
43
|
sku_number: state.catalog.getIn(['elements', type, 'obj']).toJS().sku_number,
|
|
46
44
|
//style: state.catalog.getIn(['elements', type, 'info', 'door']),
|
|
47
45
|
category: state.catalog.getIn(['elements', type, 'type']),
|
|
@@ -68,7 +66,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
68
66
|
cabinet_door_style_id: cds.cabinet_door_style_id
|
|
69
67
|
});
|
|
70
68
|
item = item.merge({
|
|
71
|
-
doorStyle: fromJS(_objectSpread(_objectSpread({}, temp), {}, {
|
|
69
|
+
doorStyle: (0, _immutable.fromJS)(_objectSpread(_objectSpread({}, temp), {}, {
|
|
72
70
|
doorStyles: updatedDoorStyles
|
|
73
71
|
}))
|
|
74
72
|
});
|
|
@@ -86,7 +84,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
86
84
|
cabinet_door_style_id: cds.cabinet_door_style_id
|
|
87
85
|
});
|
|
88
86
|
item = item.merge({
|
|
89
|
-
doorStyle: fromJS(tmpDS)
|
|
87
|
+
doorStyle: (0, _immutable.fromJS)(tmpDS)
|
|
90
88
|
});
|
|
91
89
|
break;
|
|
92
90
|
}
|
|
@@ -109,7 +107,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
109
107
|
cabinet_door_style_id: _cds.cabinet_door_style_id
|
|
110
108
|
});
|
|
111
109
|
item = item.merge({
|
|
112
|
-
doorStyle: fromJS(_tmpDS)
|
|
110
|
+
doorStyle: (0, _immutable.fromJS)(_tmpDS)
|
|
113
111
|
});
|
|
114
112
|
break;
|
|
115
113
|
}
|
|
@@ -136,74 +134,74 @@ var Item = /*#__PURE__*/function () {
|
|
|
136
134
|
var newProperties = item.get('properties').toJS();
|
|
137
135
|
if (newProperties.hasOwnProperty('depth')) {
|
|
138
136
|
if (!newProperties.hasOwnProperty('oldDepth')) {
|
|
139
|
-
newProperties['oldDepth'] = new Map({
|
|
137
|
+
newProperties['oldDepth'] = new _immutable.Map({
|
|
140
138
|
length: newProperties.depth.length,
|
|
141
139
|
_length: newProperties.depth._length,
|
|
142
140
|
_unit: newProperties.depth._unit
|
|
143
141
|
});
|
|
144
142
|
}
|
|
145
|
-
newProperties['depth'] = new Map({
|
|
146
|
-
length: convert(euro_cds[0].euro_length).from('in').to('cm'),
|
|
143
|
+
newProperties['depth'] = new _immutable.Map({
|
|
144
|
+
length: (0, _convertUnitsLite.convert)(euro_cds[0].euro_length).from('in').to('cm'),
|
|
147
145
|
_length: euro_cds[0].euro_length,
|
|
148
146
|
_unit: 'in'
|
|
149
147
|
});
|
|
150
148
|
}
|
|
151
149
|
if (newProperties.hasOwnProperty('height')) {
|
|
152
150
|
if (!newProperties.hasOwnProperty('oldHeight')) {
|
|
153
|
-
newProperties['oldHeight'] = new Map({
|
|
151
|
+
newProperties['oldHeight'] = new _immutable.Map({
|
|
154
152
|
length: newProperties.height.length,
|
|
155
153
|
_length: newProperties.height._length,
|
|
156
154
|
_unit: newProperties.height._unit
|
|
157
155
|
});
|
|
158
156
|
}
|
|
159
|
-
newProperties['height'] = new Map({
|
|
160
|
-
length: convert(euro_cds[0].euro_height).from('in').to('cm'),
|
|
157
|
+
newProperties['height'] = new _immutable.Map({
|
|
158
|
+
length: (0, _convertUnitsLite.convert)(euro_cds[0].euro_height).from('in').to('cm'),
|
|
161
159
|
_length: euro_cds[0].euro_height,
|
|
162
160
|
_unit: 'in'
|
|
163
161
|
});
|
|
164
162
|
}
|
|
165
163
|
if (newProperties.hasOwnProperty('width')) {
|
|
166
164
|
if (!newProperties.hasOwnProperty('oldWidth')) {
|
|
167
|
-
newProperties['oldWidth'] = new Map({
|
|
165
|
+
newProperties['oldWidth'] = new _immutable.Map({
|
|
168
166
|
length: newProperties.width.length,
|
|
169
167
|
_length: newProperties.width._length,
|
|
170
168
|
_unit: newProperties.width._unit
|
|
171
169
|
});
|
|
172
170
|
}
|
|
173
|
-
newProperties['width'] = new Map({
|
|
174
|
-
length: convert(euro_cds[0].euro_width).from('in').to('cm') - 10,
|
|
171
|
+
newProperties['width'] = new _immutable.Map({
|
|
172
|
+
length: (0, _convertUnitsLite.convert)(euro_cds[0].euro_width).from('in').to('cm') - 10,
|
|
175
173
|
_length: euro_cds[0].euro_width,
|
|
176
174
|
_unit: 'in'
|
|
177
175
|
});
|
|
178
176
|
}
|
|
179
177
|
item = item.merge({
|
|
180
|
-
properties: fromJS(newProperties)
|
|
178
|
+
properties: (0, _immutable.fromJS)(newProperties)
|
|
181
179
|
});
|
|
182
180
|
} else {
|
|
183
181
|
var properties = item.get('properties').toJS();
|
|
184
182
|
if (properties.hasOwnProperty('oldDepth')) {
|
|
185
|
-
properties['depth'] = new Map({
|
|
183
|
+
properties['depth'] = new _immutable.Map({
|
|
186
184
|
length: properties.oldDepth.length,
|
|
187
185
|
_length: properties.oldDepth._length,
|
|
188
186
|
_unit: properties.oldDepth._unit
|
|
189
187
|
});
|
|
190
188
|
}
|
|
191
189
|
if (properties.hasOwnProperty('oldHeight')) {
|
|
192
|
-
properties['height'] = new Map({
|
|
190
|
+
properties['height'] = new _immutable.Map({
|
|
193
191
|
length: properties.oldHeight.length,
|
|
194
192
|
_length: properties.oldHeight._length,
|
|
195
193
|
_unit: properties.oldHeight._unit
|
|
196
194
|
});
|
|
197
195
|
}
|
|
198
196
|
if (properties.hasOwnProperty('oldWidth')) {
|
|
199
|
-
properties['width'] = new Map({
|
|
197
|
+
properties['width'] = new _immutable.Map({
|
|
200
198
|
length: properties.oldWidth.length,
|
|
201
199
|
_length: properties.oldWidth._length,
|
|
202
200
|
_unit: properties.oldWidth._unit
|
|
203
201
|
});
|
|
204
202
|
}
|
|
205
203
|
item = item.merge({
|
|
206
|
-
properties: fromJS(properties)
|
|
204
|
+
properties: (0, _immutable.fromJS)(properties)
|
|
207
205
|
});
|
|
208
206
|
}
|
|
209
207
|
};
|
|
@@ -213,16 +211,16 @@ var Item = /*#__PURE__*/function () {
|
|
|
213
211
|
if (item.type.includes('Light')) {
|
|
214
212
|
var ceilHeight = state.getIn(['scene', 'layers', layerID, 'ceilHeight']);
|
|
215
213
|
var ceilUnit = state.getIn(['scene', 'layers', layerID, 'unit']);
|
|
216
|
-
ceilHeight = convert(ceilHeight).from(ceilUnit).to('cm');
|
|
214
|
+
ceilHeight = (0, _convertUnitsLite.convert)(ceilHeight).from(ceilUnit).to('cm');
|
|
217
215
|
var newAltitude = ceilHeight - item.properties.getIn(['height', 'length']);
|
|
218
|
-
newAltitude = convert(newAltitude).from('cm').to(ceilUnit);
|
|
216
|
+
newAltitude = (0, _convertUnitsLite.convert)(newAltitude).from('cm').to(ceilUnit);
|
|
219
217
|
item = item.setIn(['properties', 'altitude', '_length'], newAltitude);
|
|
220
218
|
state = state.setIn(['scene', 'layers', layerID, 'items', item.id], item);
|
|
221
219
|
}
|
|
222
220
|
if (item.category === 'cabinet') {
|
|
223
221
|
// If create a copied object, copied object has original object's molding property.And if create a object, it has a layer's molding property.
|
|
224
222
|
var layerMolding = state.getIn(['scene', 'layers', layerID, 'molding']).filter(function (md) {
|
|
225
|
-
return hasMoldingLayout(md, item.layoutpos);
|
|
223
|
+
return (0, _molding.hasMoldingLayout)(md, item.layoutpos);
|
|
226
224
|
});
|
|
227
225
|
state = state.setIn(['scene', 'layers', layerID, 'items', itemID, 'molding'], layerMolding.length ? layerMolding : molding);
|
|
228
226
|
}
|
|
@@ -253,16 +251,16 @@ var Item = /*#__PURE__*/function () {
|
|
|
253
251
|
tmpDS['doorStyles']['drawer_door_handle_' + i + '_gltf'] = doorHandle;
|
|
254
252
|
}
|
|
255
253
|
}
|
|
256
|
-
item = item.mergeIn(['doorStyle'], fromJS(tmpDS));
|
|
254
|
+
item = item.mergeIn(['doorStyle'], (0, _immutable.fromJS)(tmpDS));
|
|
257
255
|
return item;
|
|
258
256
|
}
|
|
259
257
|
}, {
|
|
260
258
|
key: "select",
|
|
261
259
|
value: function select(state, layerID, itemID) {
|
|
262
|
-
state = Layer.select(state, layerID).updatedState;
|
|
263
|
-
state = Layer.selectElement(state, layerID, 'items', itemID).updatedState;
|
|
260
|
+
state = _export.Layer.select(state, layerID).updatedState;
|
|
261
|
+
state = _export.Layer.selectElement(state, layerID, 'items', itemID).updatedState;
|
|
264
262
|
state = state.merge({
|
|
265
|
-
replacingSupport: new Map({
|
|
263
|
+
replacingSupport: new _immutable.Map({
|
|
266
264
|
layerID: layerID,
|
|
267
265
|
itemID: itemID
|
|
268
266
|
})
|
|
@@ -274,8 +272,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
274
272
|
}, {
|
|
275
273
|
key: "selectHole",
|
|
276
274
|
value: function selectHole(state, layerID, holeID) {
|
|
277
|
-
state = Layer.select(state, layerID).updatedState;
|
|
278
|
-
state = Layer.selectElement(state, layerID, 'holes', holeID).updatedState;
|
|
275
|
+
state = _export.Layer.select(state, layerID).updatedState;
|
|
276
|
+
state = _export.Layer.selectElement(state, layerID, 'holes', holeID).updatedState;
|
|
279
277
|
return {
|
|
280
278
|
updatedState: state
|
|
281
279
|
};
|
|
@@ -291,10 +289,10 @@ var Item = /*#__PURE__*/function () {
|
|
|
291
289
|
updatedState: state
|
|
292
290
|
};
|
|
293
291
|
}
|
|
294
|
-
var width = new Map({
|
|
292
|
+
var width = new _immutable.Map({
|
|
295
293
|
_length: newWidth,
|
|
296
294
|
_unit: 'in',
|
|
297
|
-
length: convert(newWidth).from('in').to('cm')
|
|
295
|
+
length: (0, _convertUnitsLite.convert)(newWidth).from('in').to('cm')
|
|
298
296
|
});
|
|
299
297
|
properties = properties.set('width', width);
|
|
300
298
|
state = state.mergeIn(['scene', 'layers', layerID, 'items', itemID, 'properties'], properties);
|
|
@@ -308,14 +306,14 @@ var Item = /*#__PURE__*/function () {
|
|
|
308
306
|
var layer = state.getIn(['scene', 'layers', layerID]);
|
|
309
307
|
var scene = state.get('scene');
|
|
310
308
|
var catalog = state.catalog.toJS();
|
|
311
|
-
allLines = GeometryUtils.getAllLines(layer);
|
|
312
|
-
allLineRects = GeometryUtils.buildRectFromLines(layer, allLines);
|
|
313
|
-
allItemRect = GeometryUtils.getAllItems(scene, catalog, allLineRects);
|
|
314
|
-
allItemSnap = GeometryUtils.getAllItemSnap(allItemRect);
|
|
315
|
-
allLineSnap = GeometryUtils.getAllLineSnap(allLineRects, allItemRect.cur);
|
|
309
|
+
allLines = _export2.GeometryUtils.getAllLines(layer);
|
|
310
|
+
allLineRects = _export2.GeometryUtils.buildRectFromLines(layer, allLines);
|
|
311
|
+
allItemRect = _export2.GeometryUtils.getAllItems(scene, catalog, allLineRects);
|
|
312
|
+
allItemSnap = _export2.GeometryUtils.getAllItemSnap(allItemRect);
|
|
313
|
+
allLineSnap = _export2.GeometryUtils.getAllLineSnap(allLineRects, allItemRect.cur);
|
|
316
314
|
allRect = allItemRect.others.concat(allLineRects);
|
|
317
|
-
allItemSnap = GeometryUtils.validateSnaps(allItemSnap, allRect);
|
|
318
|
-
allLineSnap = GeometryUtils.validateSnaps(allLineSnap, allRect);
|
|
315
|
+
allItemSnap = _export2.GeometryUtils.validateSnaps(allItemSnap, allRect);
|
|
316
|
+
allLineSnap = _export2.GeometryUtils.validateSnaps(allLineSnap, allRect);
|
|
319
317
|
}
|
|
320
318
|
}, {
|
|
321
319
|
key: "duplicateSelected",
|
|
@@ -345,7 +343,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
345
343
|
val.size = allItemRect.cur.size;
|
|
346
344
|
val.layoutpos = allItemRect.cur.layoutpos;
|
|
347
345
|
val.is_corner = allItemRect.cur.is_corner;
|
|
348
|
-
var isrectSect = GeometryUtils.validInterSect(allRect, val);
|
|
346
|
+
var isrectSect = _export2.GeometryUtils.validInterSect(allRect, val);
|
|
349
347
|
if (isrectSect) {
|
|
350
348
|
// Duplicated object has a original object's molding property
|
|
351
349
|
var _this$create = this.create(state, layerID, sceneComponentType, x + width * Math.cos(rotRad), y + width * Math.sin(rotRad), 200, 100, rotRad * 180 / Math.PI, true, myObject.molding),
|
|
@@ -354,8 +352,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
354
352
|
if (item === null) {
|
|
355
353
|
alert('There are no Door Colors in this cabinet.');
|
|
356
354
|
state = state.merge({
|
|
357
|
-
mode: MODE_IDLE,
|
|
358
|
-
drawingSupport: new Map()
|
|
355
|
+
mode: _constants.MODE_IDLE,
|
|
356
|
+
drawingSupport: new _immutable.Map()
|
|
359
357
|
});
|
|
360
358
|
} else {
|
|
361
359
|
state = Item.select(stateI, layerID, item.id).updatedState;
|
|
@@ -372,7 +370,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
372
370
|
_val.size = allItemRect.cur.size;
|
|
373
371
|
_val.layoutpos = allItemRect.cur.layoutpos;
|
|
374
372
|
_val.is_corner = allItemRect.cur.is_corner;
|
|
375
|
-
var isRect = GeometryUtils.validInterSect(allRect, _val);
|
|
373
|
+
var isRect = _export2.GeometryUtils.validInterSect(allRect, _val);
|
|
376
374
|
if (isRect) {
|
|
377
375
|
var _this$create2 = this.create(state, layerID, sceneComponentType, x - width * Math.cos(rotRad), y - width * Math.sin(rotRad), 200, 100, rotRad * 180 / Math.PI, true, myObject.molding),
|
|
378
376
|
_stateI = _this$create2.updatedState,
|
|
@@ -380,8 +378,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
380
378
|
if (_item === null) {
|
|
381
379
|
alert('There are no Door Colors in this cabinet.');
|
|
382
380
|
state = state.merge({
|
|
383
|
-
mode: MODE_IDLE,
|
|
384
|
-
drawingSupport: new Map()
|
|
381
|
+
mode: _constants.MODE_IDLE,
|
|
382
|
+
drawingSupport: new _immutable.Map()
|
|
385
383
|
});
|
|
386
384
|
} else {
|
|
387
385
|
state = Item.select(_stateI, layerID, _item.id).updatedState;
|
|
@@ -398,7 +396,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
398
396
|
_val2.size = allItemRect.cur.size;
|
|
399
397
|
_val2.layoutpos = allItemRect.cur.layoutpos;
|
|
400
398
|
_val2.is_corner = allItemRect.cur.is_corner;
|
|
401
|
-
var isRectDown = GeometryUtils.validInterSect(allRect, _val2);
|
|
399
|
+
var isRectDown = _export2.GeometryUtils.validInterSect(allRect, _val2);
|
|
402
400
|
if (isRectDown) {
|
|
403
401
|
var _this$create3 = this.create(state, layerID, sceneComponentType, x - depth * Math.sin(rotRad), y - depth * Math.cos(rotRad), 200, 100, rotRad * 180 / Math.PI, true, myObject.molding),
|
|
404
402
|
_stateI2 = _this$create3.updatedState,
|
|
@@ -406,8 +404,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
406
404
|
if (_item2 === null) {
|
|
407
405
|
alert('There are no Door Colors in this cabinet.');
|
|
408
406
|
state = state.merge({
|
|
409
|
-
mode: MODE_IDLE,
|
|
410
|
-
drawingSupport: new Map()
|
|
407
|
+
mode: _constants.MODE_IDLE,
|
|
408
|
+
drawingSupport: new _immutable.Map()
|
|
411
409
|
});
|
|
412
410
|
} else {
|
|
413
411
|
state = Item.select(_stateI2, layerID, _item2.id).updatedState;
|
|
@@ -424,7 +422,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
424
422
|
_val3.size = allItemRect.cur.size;
|
|
425
423
|
_val3.layoutpos = allItemRect.cur.layoutpos;
|
|
426
424
|
_val3.is_corner = allItemRect.cur.is_corner;
|
|
427
|
-
var isRectUp = GeometryUtils.validInterSect(allRect, _val3);
|
|
425
|
+
var isRectUp = _export2.GeometryUtils.validInterSect(allRect, _val3);
|
|
428
426
|
if (isRectUp) {
|
|
429
427
|
var _this$create4 = this.create(state, layerID, sceneComponentType, x + depth * Math.sin(rotRad), y + depth * Math.cos(rotRad), 200, 100, rotRad * 180 / Math.PI, true, myObject.molding),
|
|
430
428
|
_stateI3 = _this$create4.updatedState,
|
|
@@ -432,8 +430,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
432
430
|
if (_item3 === null) {
|
|
433
431
|
alert('There are no Door Colors in this cabinet.');
|
|
434
432
|
state = state.merge({
|
|
435
|
-
mode: MODE_IDLE,
|
|
436
|
-
drawingSupport: new Map()
|
|
433
|
+
mode: _constants.MODE_IDLE,
|
|
434
|
+
drawingSupport: new _immutable.Map()
|
|
437
435
|
});
|
|
438
436
|
} else {
|
|
439
437
|
state = Item.select(_stateI3, layerID, _item3.id).updatedState;
|
|
@@ -456,7 +454,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
456
454
|
var myOffset = myObject.offset;
|
|
457
455
|
var v0 = layer.getIn(['vertices', line.vertices.get(0)]);
|
|
458
456
|
var v1 = layer.getIn(['vertices', line.vertices.get(1)]);
|
|
459
|
-
var lineLength = GeometryUtils.pointsDistance(v0.x, v0.y, v1.x, v1.y);
|
|
457
|
+
var lineLength = _export2.GeometryUtils.pointsDistance(v0.x, v0.y, v1.x, v1.y);
|
|
460
458
|
var delta = width / 2 / lineLength + 0.00001;
|
|
461
459
|
var allHoles = state.getIn(['scene', 'layers', layerID, 'holes']);
|
|
462
460
|
var rightAble = true;
|
|
@@ -551,9 +549,9 @@ var Item = /*#__PURE__*/function () {
|
|
|
551
549
|
key: "remove",
|
|
552
550
|
value: function remove(state, layerID, itemID) {
|
|
553
551
|
state = this.unselect(state, layerID, itemID).updatedState;
|
|
554
|
-
state = Layer.removeElement(state, layerID, 'items', itemID).updatedState;
|
|
552
|
+
state = _export.Layer.removeElement(state, layerID, 'items', itemID).updatedState;
|
|
555
553
|
state.getIn(['scene', 'groups']).forEach(function (group) {
|
|
556
|
-
return state = Group.removeElement(state, group.id, layerID, 'items', itemID).updatedState;
|
|
554
|
+
return state = _export.Group.removeElement(state, group.id, layerID, 'items', itemID).updatedState;
|
|
557
555
|
});
|
|
558
556
|
return {
|
|
559
557
|
updatedState: state
|
|
@@ -572,7 +570,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
572
570
|
}, {
|
|
573
571
|
key: "unselect",
|
|
574
572
|
value: function unselect(state, layerID, itemID) {
|
|
575
|
-
state = Layer.unselect(state, layerID, 'items', itemID).updatedState;
|
|
573
|
+
state = _export.Layer.unselect(state, layerID, 'items', itemID).updatedState;
|
|
576
574
|
return {
|
|
577
575
|
updatedState: state
|
|
578
576
|
};
|
|
@@ -581,8 +579,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
581
579
|
key: "selectToolDrawingItem",
|
|
582
580
|
value: function selectToolDrawingItem(state, sceneComponentType) {
|
|
583
581
|
state = state.merge({
|
|
584
|
-
mode: MODE_DRAWING_ITEM,
|
|
585
|
-
drawingSupport: new Map({
|
|
582
|
+
mode: _constants.MODE_DRAWING_ITEM,
|
|
583
|
+
drawingSupport: new _immutable.Map({
|
|
586
584
|
type: sceneComponentType
|
|
587
585
|
})
|
|
588
586
|
});
|
|
@@ -594,8 +592,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
594
592
|
key: "selectToolDrawingItem3D",
|
|
595
593
|
value: function selectToolDrawingItem3D(state, sceneComponentType) {
|
|
596
594
|
state = state.merge({
|
|
597
|
-
mode: MODE_DRAWING_ITEM_3D,
|
|
598
|
-
drawingSupport: new Map({
|
|
595
|
+
mode: _constants.MODE_DRAWING_ITEM_3D,
|
|
596
|
+
drawingSupport: new _immutable.Map({
|
|
599
597
|
type: sceneComponentType
|
|
600
598
|
})
|
|
601
599
|
});
|
|
@@ -630,7 +628,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
630
628
|
value: function updateDrawingItem(state, layerID, x, y) {
|
|
631
629
|
if (state.hasIn(['drawingSupport', 'currentID'])) {
|
|
632
630
|
var mode = state.get('mode');
|
|
633
|
-
if ([MODE_DRAWING_ITEM_3D].includes(mode)) {
|
|
631
|
+
if ([_constants.MODE_DRAWING_ITEM_3D].includes(mode)) {
|
|
634
632
|
state = state.updateIn(['scene', 'layers', layerID, 'items', state.getIn(['drawingSupport', 'currentID'])], function (item) {
|
|
635
633
|
return item && item.merge({
|
|
636
634
|
x: x,
|
|
@@ -638,12 +636,12 @@ var Item = /*#__PURE__*/function () {
|
|
|
638
636
|
});
|
|
639
637
|
});
|
|
640
638
|
state = state.merge({
|
|
641
|
-
mode: MODE_IDLE_3D
|
|
639
|
+
mode: _constants.MODE_IDLE_3D
|
|
642
640
|
});
|
|
643
641
|
}
|
|
644
|
-
if ([MODE_DRAWING_ITEM].includes(mode)) {
|
|
642
|
+
if ([_constants.MODE_DRAWING_ITEM].includes(mode)) {
|
|
645
643
|
state = state.merge({
|
|
646
|
-
mode: MODE_IDLE
|
|
644
|
+
mode: _constants.MODE_IDLE
|
|
647
645
|
});
|
|
648
646
|
state = state.updateIn(['scene', 'layers', layerID, 'items', state.getIn(['drawingSupport', 'currentID'])], function (item) {
|
|
649
647
|
return item && item.merge({
|
|
@@ -659,8 +657,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
659
657
|
if (item === null) {
|
|
660
658
|
alert('There are no Door Colors in this cabinet.');
|
|
661
659
|
state = state.merge({
|
|
662
|
-
mode: MODE_IDLE,
|
|
663
|
-
drawingSupport: new Map()
|
|
660
|
+
mode: _constants.MODE_IDLE,
|
|
661
|
+
drawingSupport: new _immutable.Map()
|
|
664
662
|
});
|
|
665
663
|
} else {
|
|
666
664
|
state = Item.select(stateI, layerID, item.id).updatedState;
|
|
@@ -694,7 +692,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
694
692
|
state = state.merge({
|
|
695
693
|
scene: scene.mergeIn(['layers', layerID, 'items', itemID], item)
|
|
696
694
|
});
|
|
697
|
-
time2 = debugUtil();
|
|
695
|
+
time2 = (0, _helper.debugUtil)();
|
|
698
696
|
false && console.log('FPS:', Math.round(1000 / (time2 - time1)), ' Delta Time:', (time2 - time1) / 1000, '(s)');
|
|
699
697
|
return {
|
|
700
698
|
updatedState: state
|
|
@@ -705,15 +703,15 @@ var Item = /*#__PURE__*/function () {
|
|
|
705
703
|
value: function endDrawingItem(state, layerID, x, y) {
|
|
706
704
|
var catalog = state.catalog;
|
|
707
705
|
state = this.updateDrawingItem(state, layerID, x, y, catalog).updatedState;
|
|
708
|
-
state = Layer.unselectAll(state, layerID).updatedState;
|
|
706
|
+
state = _export.Layer.unselectAll(state, layerID).updatedState;
|
|
709
707
|
var popup = state.get('popup');
|
|
710
708
|
state = state.merge({
|
|
711
|
-
drawingSupport: Map({
|
|
709
|
+
drawingSupport: (0, _immutable.Map)({
|
|
712
710
|
type: state.drawingSupport.get('type')
|
|
713
711
|
}),
|
|
714
712
|
isOpen: !popup
|
|
715
713
|
});
|
|
716
|
-
state = Layer.unselectAll(state, layerID).updatedState;
|
|
714
|
+
state = _export.Layer.unselectAll(state, layerID).updatedState;
|
|
717
715
|
this.updateMolding(state);
|
|
718
716
|
return {
|
|
719
717
|
updatedState: state
|
|
@@ -723,11 +721,11 @@ var Item = /*#__PURE__*/function () {
|
|
|
723
721
|
key: "beginDraggingItem",
|
|
724
722
|
value: function beginDraggingItem(state, layerID, itemID, x, y) {
|
|
725
723
|
var item = state.getIn(['scene', 'layers', layerID, 'items', itemID]);
|
|
726
|
-
time1 = debugUtil();
|
|
724
|
+
time1 = (0, _helper.debugUtil)();
|
|
727
725
|
if (!item) return;
|
|
728
726
|
state = state.merge({
|
|
729
|
-
mode: MODE_DRAGGING_ITEM,
|
|
730
|
-
draggingSupport: Map({
|
|
727
|
+
mode: _constants.MODE_DRAGGING_ITEM,
|
|
728
|
+
draggingSupport: (0, _immutable.Map)({
|
|
731
729
|
layerID: layerID,
|
|
732
730
|
itemID: itemID,
|
|
733
731
|
startPointX: x,
|
|
@@ -749,8 +747,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
749
747
|
updatedState: state
|
|
750
748
|
};
|
|
751
749
|
state = state.merge({
|
|
752
|
-
mode: MODE_DRAGGING_ITEM_3D,
|
|
753
|
-
draggingSupport: Map({
|
|
750
|
+
mode: _constants.MODE_DRAGGING_ITEM_3D,
|
|
751
|
+
draggingSupport: (0, _immutable.Map)({
|
|
754
752
|
layerID: layerID,
|
|
755
753
|
itemID: itemID,
|
|
756
754
|
startPointX: x,
|
|
@@ -845,7 +843,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
845
843
|
value: function endDraggingItem(state, x, y) {
|
|
846
844
|
state = this.updateDraggingItem(state, x, y).updatedState;
|
|
847
845
|
state = state.merge({
|
|
848
|
-
mode: MODE_IDLE
|
|
846
|
+
mode: _constants.MODE_IDLE
|
|
849
847
|
});
|
|
850
848
|
return {
|
|
851
849
|
updatedState: state
|
|
@@ -856,7 +854,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
856
854
|
value: function endDraggingItem3D(state) {
|
|
857
855
|
// state = this.updateDraggingItem(state, x, y).updatedState;
|
|
858
856
|
state = state.merge({
|
|
859
|
-
mode: MODE_IDLE_3D
|
|
857
|
+
mode: _constants.MODE_IDLE_3D
|
|
860
858
|
});
|
|
861
859
|
state = state.setIn(['scene', 'isEndDragging'], true);
|
|
862
860
|
return {
|
|
@@ -869,8 +867,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
869
867
|
var item = state.getIn(['scene', 'layers', layerID, 'items', itemID]);
|
|
870
868
|
var originRotation = item.get('rotation');
|
|
871
869
|
state = state.merge({
|
|
872
|
-
mode: MODE_ROTATING_ITEM,
|
|
873
|
-
rotatingSupport: Map({
|
|
870
|
+
mode: _constants.MODE_ROTATING_ITEM,
|
|
871
|
+
rotatingSupport: (0, _immutable.Map)({
|
|
874
872
|
layerID: layerID,
|
|
875
873
|
itemID: itemID,
|
|
876
874
|
x: x,
|
|
@@ -888,8 +886,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
888
886
|
var item = state.getIn(['scene', 'layers', layerID, 'items', itemID]);
|
|
889
887
|
var originRotation = item.get('rotation');
|
|
890
888
|
state = state.merge({
|
|
891
|
-
mode: MODE_ROTATING_ITEM_3D,
|
|
892
|
-
rotatingSupport: Map({
|
|
889
|
+
mode: _constants.MODE_ROTATING_ITEM_3D,
|
|
890
|
+
rotatingSupport: (0, _immutable.Map)({
|
|
893
891
|
layerID: layerID,
|
|
894
892
|
itemID: itemID,
|
|
895
893
|
x: x,
|
|
@@ -969,7 +967,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
969
967
|
value: function endRotatingItem(state, x, y) {
|
|
970
968
|
//state = this.updateRotatingItem(state, x, y).updatedState;
|
|
971
969
|
state = state.merge({
|
|
972
|
-
mode: MODE_IDLE
|
|
970
|
+
mode: _constants.MODE_IDLE
|
|
973
971
|
});
|
|
974
972
|
return {
|
|
975
973
|
updatedState: state
|
|
@@ -980,7 +978,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
980
978
|
value: function endRotatingItem3D(state, x, y) {
|
|
981
979
|
state = this.updateRotatingItem(state, x, y).updatedState;
|
|
982
980
|
state = state.merge({
|
|
983
|
-
mode: MODE_IDLE_3D
|
|
981
|
+
mode: _constants.MODE_IDLE_3D
|
|
984
982
|
});
|
|
985
983
|
return {
|
|
986
984
|
updatedState: state
|
|
@@ -1041,7 +1039,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1041
1039
|
scene: scene.mergeIn(['layers', layerID, 'items', itemID], item)
|
|
1042
1040
|
});
|
|
1043
1041
|
state = state.merge({
|
|
1044
|
-
mode: MODE_IDLE_3D
|
|
1042
|
+
mode: _constants.MODE_IDLE_3D
|
|
1045
1043
|
});
|
|
1046
1044
|
return {
|
|
1047
1045
|
updatedState: state
|
|
@@ -1058,7 +1056,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1058
1056
|
}, {
|
|
1059
1057
|
key: "setJsProperties",
|
|
1060
1058
|
value: function setJsProperties(state, layerID, itemID, properties) {
|
|
1061
|
-
return this.setProperties(state, layerID, itemID, fromJS(properties));
|
|
1059
|
+
return this.setProperties(state, layerID, itemID, (0, _immutable.fromJS)(properties));
|
|
1062
1060
|
}
|
|
1063
1061
|
}, {
|
|
1064
1062
|
key: "updateProperties",
|
|
@@ -1073,7 +1071,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1073
1071
|
}, {
|
|
1074
1072
|
key: "updateJsProperties",
|
|
1075
1073
|
value: function updateJsProperties(state, layerID, itemID, properties) {
|
|
1076
|
-
return this.updateProperties(state, layerID, itemID, fromJS(properties));
|
|
1074
|
+
return this.updateProperties(state, layerID, itemID, (0, _immutable.fromJS)(properties));
|
|
1077
1075
|
}
|
|
1078
1076
|
}, {
|
|
1079
1077
|
key: "setAttributes",
|
|
@@ -1086,7 +1084,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1086
1084
|
}, {
|
|
1087
1085
|
key: "setJsAttributes",
|
|
1088
1086
|
value: function setJsAttributes(state, layerID, itemID, itemAttributes) {
|
|
1089
|
-
itemAttributes = fromJS(itemAttributes);
|
|
1087
|
+
itemAttributes = (0, _immutable.fromJS)(itemAttributes);
|
|
1090
1088
|
return this.setAttributes(state, layerID, itemID, itemAttributes);
|
|
1091
1089
|
}
|
|
1092
1090
|
}, {
|
|
@@ -1108,7 +1106,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1108
1106
|
scene: scene.mergeIn(['layers', layerID, 'items', itemID], item)
|
|
1109
1107
|
});
|
|
1110
1108
|
state = state.merge({
|
|
1111
|
-
mode: MODE_IDLE_3D
|
|
1109
|
+
mode: _constants.MODE_IDLE_3D
|
|
1112
1110
|
});
|
|
1113
1111
|
}
|
|
1114
1112
|
return {
|
|
@@ -1119,7 +1117,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1119
1117
|
key: "removeReplacingSupport",
|
|
1120
1118
|
value: function removeReplacingSupport(state) {
|
|
1121
1119
|
state = state.merge({
|
|
1122
|
-
replacingSupport: new Map()
|
|
1120
|
+
replacingSupport: new _immutable.Map()
|
|
1123
1121
|
});
|
|
1124
1122
|
return {
|
|
1125
1123
|
updatedState: state
|
|
@@ -1130,14 +1128,14 @@ var Item = /*#__PURE__*/function () {
|
|
|
1130
1128
|
value: function setInitialDoorStyle(state, doorStyle, oStyle) {
|
|
1131
1129
|
if (doorStyle === undefined) {
|
|
1132
1130
|
state = state.merge({
|
|
1133
|
-
oStyle: new Map({
|
|
1131
|
+
oStyle: new _immutable.Map({
|
|
1134
1132
|
oStyle: oStyle
|
|
1135
1133
|
})
|
|
1136
1134
|
});
|
|
1137
1135
|
} else {
|
|
1138
1136
|
state = state.merge({
|
|
1139
1137
|
doorStyle: doorStyle,
|
|
1140
|
-
oStyle: new Map({
|
|
1138
|
+
oStyle: new _immutable.Map({
|
|
1141
1139
|
oStyle: oStyle
|
|
1142
1140
|
})
|
|
1143
1141
|
});
|
|
@@ -1154,7 +1152,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1154
1152
|
counttop: doorStyle.doorStyles.counttop
|
|
1155
1153
|
})
|
|
1156
1154
|
});
|
|
1157
|
-
data = data.mergeIn(['doorStyle'], fromJS(tmpDS));
|
|
1155
|
+
data = data.mergeIn(['doorStyle'], (0, _immutable.fromJS)(tmpDS));
|
|
1158
1156
|
layers = layers.mergeIn(['items', itemID], data);
|
|
1159
1157
|
state = state.merge({
|
|
1160
1158
|
scene: scene.mergeIn(['layers', layerID], layers)
|
|
@@ -1197,15 +1195,15 @@ var Item = /*#__PURE__*/function () {
|
|
|
1197
1195
|
var itemID = data.id;
|
|
1198
1196
|
var curItem = state.getIn(['scene', 'layers', layerID, 'items', itemID]);
|
|
1199
1197
|
var layer = state.getIn(['scene', 'layers', layerID]);
|
|
1200
|
-
var tmpMolding =
|
|
1201
|
-
var temp_item_molding =
|
|
1198
|
+
var tmpMolding = (0, _toConsumableArray2["default"])(curItem.molding);
|
|
1199
|
+
var temp_item_molding = (0, _toConsumableArray2["default"])(curItem.molding);
|
|
1202
1200
|
temp_item_molding = temp_item_molding.filter(function (md) {
|
|
1203
1201
|
return doorStyle.doorStyles.cds.some(function (ds) {
|
|
1204
1202
|
return ds.itemID === md.itemID;
|
|
1205
1203
|
});
|
|
1206
1204
|
});
|
|
1207
1205
|
tmpMolding.forEach(function (md) {
|
|
1208
|
-
var itemGroup = MoldingUtils.getItemGroupFromMolding(layer, curItem, md);
|
|
1206
|
+
var itemGroup = _export2.MoldingUtils.getItemGroupFromMolding(layer, curItem, md);
|
|
1209
1207
|
itemGroup.forEach(function (it) {
|
|
1210
1208
|
state = state.setIn(['scene', 'layers', layerID, 'items', it.id, 'molding'], temp_item_molding);
|
|
1211
1209
|
});
|
|
@@ -1224,42 +1222,42 @@ var Item = /*#__PURE__*/function () {
|
|
|
1224
1222
|
var newProperties = state.scene.getIn(['layers', layerID, 'items', itemID, 'properties']).toJS();
|
|
1225
1223
|
if (newProperties.hasOwnProperty('depth')) {
|
|
1226
1224
|
if (!newProperties.hasOwnProperty('oldDepth')) {
|
|
1227
|
-
newProperties['oldDepth'] = new Map({
|
|
1225
|
+
newProperties['oldDepth'] = new _immutable.Map({
|
|
1228
1226
|
length: newProperties.depth.length,
|
|
1229
1227
|
_length: newProperties.depth._length,
|
|
1230
1228
|
_unit: newProperties.depth._unit
|
|
1231
1229
|
});
|
|
1232
1230
|
}
|
|
1233
|
-
newProperties['depth'] = new Map({
|
|
1234
|
-
length: convert(euro_cds[0].euro_length).from('in').to('cm'),
|
|
1231
|
+
newProperties['depth'] = new _immutable.Map({
|
|
1232
|
+
length: (0, _convertUnitsLite.convert)(euro_cds[0].euro_length).from('in').to('cm'),
|
|
1235
1233
|
_length: euro_cds[0].euro_length,
|
|
1236
1234
|
_unit: 'in'
|
|
1237
1235
|
});
|
|
1238
1236
|
}
|
|
1239
1237
|
if (newProperties.hasOwnProperty('height')) {
|
|
1240
1238
|
if (!newProperties.hasOwnProperty('oldHeight')) {
|
|
1241
|
-
newProperties['oldHeight'] = new Map({
|
|
1239
|
+
newProperties['oldHeight'] = new _immutable.Map({
|
|
1242
1240
|
length: newProperties.height.length,
|
|
1243
1241
|
_length: newProperties.height._length,
|
|
1244
1242
|
_unit: newProperties.height._unit
|
|
1245
1243
|
});
|
|
1246
1244
|
}
|
|
1247
|
-
newProperties['height'] = new Map({
|
|
1248
|
-
length: convert(euro_cds[0].euro_height).from('in').to('cm'),
|
|
1245
|
+
newProperties['height'] = new _immutable.Map({
|
|
1246
|
+
length: (0, _convertUnitsLite.convert)(euro_cds[0].euro_height).from('in').to('cm'),
|
|
1249
1247
|
_length: euro_cds[0].euro_height,
|
|
1250
1248
|
_unit: 'in'
|
|
1251
1249
|
});
|
|
1252
1250
|
}
|
|
1253
1251
|
if (newProperties.hasOwnProperty('width')) {
|
|
1254
1252
|
if (!newProperties.hasOwnProperty('oldWidth')) {
|
|
1255
|
-
newProperties['oldWidth'] = new Map({
|
|
1253
|
+
newProperties['oldWidth'] = new _immutable.Map({
|
|
1256
1254
|
length: newProperties.width.length,
|
|
1257
1255
|
_length: newProperties.width._length,
|
|
1258
1256
|
_unit: newProperties.width._unit
|
|
1259
1257
|
});
|
|
1260
1258
|
}
|
|
1261
|
-
newProperties['width'] = new Map({
|
|
1262
|
-
length: convert(euro_cds[0].euro_width).from('in').to('cm') - 10,
|
|
1259
|
+
newProperties['width'] = new _immutable.Map({
|
|
1260
|
+
length: (0, _convertUnitsLite.convert)(euro_cds[0].euro_width).from('in').to('cm') - 10,
|
|
1263
1261
|
_length: euro_cds[0].euro_width,
|
|
1264
1262
|
_unit: 'in'
|
|
1265
1263
|
});
|
|
@@ -1271,21 +1269,21 @@ var Item = /*#__PURE__*/function () {
|
|
|
1271
1269
|
}) : {};
|
|
1272
1270
|
var properties = state.scene.getIn(['layers', layerID, 'items', itemID, 'properties']).toJS();
|
|
1273
1271
|
if (properties.hasOwnProperty('oldDepth')) {
|
|
1274
|
-
properties['depth'] = new Map({
|
|
1272
|
+
properties['depth'] = new _immutable.Map({
|
|
1275
1273
|
length: properties.oldDepth.length,
|
|
1276
1274
|
_length: properties.oldDepth._length,
|
|
1277
1275
|
_unit: properties.oldDepth._unit
|
|
1278
1276
|
});
|
|
1279
1277
|
}
|
|
1280
1278
|
if (properties.hasOwnProperty('oldHeight')) {
|
|
1281
|
-
properties['height'] = new Map({
|
|
1279
|
+
properties['height'] = new _immutable.Map({
|
|
1282
1280
|
length: properties.oldHeight.length,
|
|
1283
1281
|
_length: properties.oldHeight._length,
|
|
1284
1282
|
_unit: properties.oldHeight._unit
|
|
1285
1283
|
});
|
|
1286
1284
|
}
|
|
1287
1285
|
if (properties.hasOwnProperty('oldWidth')) {
|
|
1288
|
-
properties['width'] = new Map({
|
|
1286
|
+
properties['width'] = new _immutable.Map({
|
|
1289
1287
|
length: properties.oldWidth.length,
|
|
1290
1288
|
_length: properties.oldWidth._length,
|
|
1291
1289
|
_unit: properties.oldWidth._unit
|
|
@@ -1306,10 +1304,10 @@ var Item = /*#__PURE__*/function () {
|
|
|
1306
1304
|
sku: doorStyle.sku,
|
|
1307
1305
|
color_sku_alias: doorStyle.color_sku_alias,
|
|
1308
1306
|
// alias name of color_sku for the current dealer
|
|
1309
|
-
install: getInstallationSuffix(INSTALLATION_SUFFIX_TYPE.NAME, doorStyle),
|
|
1307
|
+
install: (0, _utils.getInstallationSuffix)(_constants.INSTALLATION_SUFFIX_TYPE.NAME, doorStyle),
|
|
1310
1308
|
doorStyles: _objectSpread(_objectSpread({}, tmp), cds_data)
|
|
1311
1309
|
};
|
|
1312
|
-
state = state.mergeIn(['scene', 'layers', layerID, 'items', itemID, 'doorStyle'], fromJS(tmpDS));
|
|
1310
|
+
state = state.mergeIn(['scene', 'layers', layerID, 'items', itemID, 'doorStyle'], (0, _immutable.fromJS)(tmpDS));
|
|
1313
1311
|
};
|
|
1314
1312
|
if (isAll) {
|
|
1315
1313
|
var items = state.scene.layers.get(layerID).items;
|
|
@@ -1420,7 +1418,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1420
1418
|
metalness: material.metalness,
|
|
1421
1419
|
roughness: material.roughness
|
|
1422
1420
|
});
|
|
1423
|
-
data = data.mergeIn(['doorStyle'], fromJS(tmpDS));
|
|
1421
|
+
data = data.mergeIn(['doorStyle'], (0, _immutable.fromJS)(tmpDS));
|
|
1424
1422
|
layers = layers.mergeIn(['items', itemID], data);
|
|
1425
1423
|
state = state.merge({
|
|
1426
1424
|
scene: scene.mergeIn(['layers', layerID], layers)
|
|
@@ -1517,7 +1515,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1517
1515
|
scene: scene.mergeIn(['layers', layerID], layer)
|
|
1518
1516
|
});
|
|
1519
1517
|
layer.items.toArray().forEach(function (item) {
|
|
1520
|
-
if (MoldingUtils.isEnableItemForMolding(layer, item, molding)) {
|
|
1518
|
+
if (_export2.MoldingUtils.isEnableItemForMolding(layer, item, molding)) {
|
|
1521
1519
|
var tempItemMolding = item.molding;
|
|
1522
1520
|
if (flag) {
|
|
1523
1521
|
if (tempItemMolding.some(function (mol) {
|
|
@@ -1542,8 +1540,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
1542
1540
|
});
|
|
1543
1541
|
} else {
|
|
1544
1542
|
var selectedItem = layer.getIn(['items', layer.selected.toJS().items[0]]);
|
|
1545
|
-
if (MoldingUtils.isEnableItemForMolding(layer, selectedItem, molding)) {
|
|
1546
|
-
var moldingGroup = MoldingUtils.getItemGroupFromMolding(layer, selectedItem, molding);
|
|
1543
|
+
if (_export2.MoldingUtils.isEnableItemForMolding(layer, selectedItem, molding)) {
|
|
1544
|
+
var moldingGroup = _export2.MoldingUtils.getItemGroupFromMolding(layer, selectedItem, molding);
|
|
1547
1545
|
var tempSelItemMolding = selectedItem.molding;
|
|
1548
1546
|
var _flag = tempSelItemMolding.some(function (mol) {
|
|
1549
1547
|
return mol.name === molding.name;
|
|
@@ -1589,16 +1587,16 @@ var Item = /*#__PURE__*/function () {
|
|
|
1589
1587
|
var itemGroups = [];
|
|
1590
1588
|
layer.items.toArray().forEach(function (curItem) {
|
|
1591
1589
|
if (selectedItem.id !== curItem.id && curItem.category === 'cabinet') {
|
|
1592
|
-
if (MoldingUtils.isItemSnappedItem(selectedItem, curItem)) {
|
|
1590
|
+
if (_export2.MoldingUtils.isItemSnappedItem(selectedItem, curItem)) {
|
|
1593
1591
|
snappedItemGroup.push(curItem); // add the snapped item.
|
|
1594
1592
|
// add the snapped item that has same molding location type, layoutpos and height to itemGroups.
|
|
1595
1593
|
if (curItem.molding.length) {
|
|
1596
1594
|
curItem.molding.forEach(function (md) {
|
|
1597
1595
|
// This code check whether the curItem can be grouped with selected Item in molding.
|
|
1598
|
-
if (MoldingUtils.tryMergeMDItem(layer, selectedItem, curItem, [selectedItem], md)) {
|
|
1596
|
+
if (_export2.MoldingUtils.tryMergeMDItem(layer, selectedItem, curItem, [selectedItem], md)) {
|
|
1599
1597
|
itemGroups.push({
|
|
1600
1598
|
base_item: curItem,
|
|
1601
|
-
group: MoldingUtils.getItemGroupFromMolding(layer, curItem, md),
|
|
1599
|
+
group: _export2.MoldingUtils.getItemGroupFromMolding(layer, curItem, md),
|
|
1602
1600
|
molding: md
|
|
1603
1601
|
});
|
|
1604
1602
|
}
|
|
@@ -1610,11 +1608,11 @@ var Item = /*#__PURE__*/function () {
|
|
|
1610
1608
|
var updateSelectItemMolding = function updateSelectItemMolding() {
|
|
1611
1609
|
var _loop2 = function _loop2() {
|
|
1612
1610
|
// check whether snapped item is same as selected item in layoutpos(Wall, Tall, Base)
|
|
1613
|
-
if (MoldingUtils.isSameMoldingLayoutpos(selectedItem, snappedItemGroup[i])) {
|
|
1611
|
+
if (_export2.MoldingUtils.isSameMoldingLayoutpos(selectedItem, snappedItemGroup[i])) {
|
|
1614
1612
|
// check whether snapped item is same in location(same location type and height).
|
|
1615
1613
|
var delMoldings = [];
|
|
1616
1614
|
for (var k = 0; k < selectedItem.molding.length; k++) {
|
|
1617
|
-
if (MoldingUtils.isItemSameItemByLocation(selectedItem, snappedItemGroup[i], selectedItem.molding[k].location_type)) {
|
|
1615
|
+
if (_export2.MoldingUtils.isItemSameItemByLocation(selectedItem, snappedItemGroup[i], selectedItem.molding[k].location_type)) {
|
|
1618
1616
|
delMoldings.push(selectedItem.molding[k].itemID);
|
|
1619
1617
|
}
|
|
1620
1618
|
}
|
|
@@ -1665,13 +1663,13 @@ var Item = /*#__PURE__*/function () {
|
|
|
1665
1663
|
return it.molding.location_type === location;
|
|
1666
1664
|
}).sort(function (a, b) {
|
|
1667
1665
|
if (a.group.length === b.group.length) {
|
|
1668
|
-
return GeometryUtils.pointsDistance(a.base_item.x, a.base_item.y, selectedItem.x, selectedItem.y) - GeometryUtils.pointsDistance(b.base_item.x, b.base_item.y, selectedItem.x, selectedItem.y);
|
|
1666
|
+
return _export2.GeometryUtils.pointsDistance(a.base_item.x, a.base_item.y, selectedItem.x, selectedItem.y) - _export2.GeometryUtils.pointsDistance(b.base_item.x, b.base_item.y, selectedItem.x, selectedItem.y);
|
|
1669
1667
|
} else {
|
|
1670
1668
|
return a.group.length - b.group.length;
|
|
1671
1669
|
}
|
|
1672
1670
|
});
|
|
1673
1671
|
if (locationMolding.length) {
|
|
1674
|
-
var locationMoldingItems = MoldingUtils.getItemGroupFromMolding(layer, selectedItem, locationMolding[0].molding);
|
|
1672
|
+
var locationMoldingItems = _export2.MoldingUtils.getItemGroupFromMolding(layer, selectedItem, locationMolding[0].molding);
|
|
1675
1673
|
locationMoldingItems.forEach(function (item) {
|
|
1676
1674
|
var tempMoldings = state.getIn(['scene', 'layers', layerID, 'items', item.id, 'molding']);
|
|
1677
1675
|
if (!tempMoldings.some(function (mol) {
|
|
@@ -1682,11 +1680,11 @@ var Item = /*#__PURE__*/function () {
|
|
|
1682
1680
|
}
|
|
1683
1681
|
};
|
|
1684
1682
|
if (itemGroups.length && layer.items.some(function (it) {
|
|
1685
|
-
return MoldingUtils.isItemSnappedItem(selectedItem, it) && it.category === 'cabinet';
|
|
1683
|
+
return _export2.MoldingUtils.isItemSnappedItem(selectedItem, it) && it.category === 'cabinet';
|
|
1686
1684
|
})) {
|
|
1687
1685
|
emptyMoldingArray();
|
|
1688
|
-
for (var i = 0; i < MOLDING_LOCATIONS.length; i++) {
|
|
1689
|
-
setLocationMolding(MOLDING_LOCATIONS[i]);
|
|
1686
|
+
for (var i = 0; i < _constants.MOLDING_LOCATIONS.length; i++) {
|
|
1687
|
+
setLocationMolding(_constants.MOLDING_LOCATIONS[i]);
|
|
1690
1688
|
}
|
|
1691
1689
|
} else if (!itemGroups.length && selectedItem.molding.length) {
|
|
1692
1690
|
// Delete the selected Item's molding property if selItem attached the group that has no molding.
|
|
@@ -1787,7 +1785,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1787
1785
|
length = 0;
|
|
1788
1786
|
_length = 0;
|
|
1789
1787
|
}
|
|
1790
|
-
state = state.mergeIn(['scene', 'layers', layerID, 'items', itemID, 'properties', 'altitude'], new Map({
|
|
1788
|
+
state = state.mergeIn(['scene', 'layers', layerID, 'items', itemID, 'properties', 'altitude'], new _immutable.Map({
|
|
1791
1789
|
length: length,
|
|
1792
1790
|
_length: _length,
|
|
1793
1791
|
_unit: _unit
|
|
@@ -1799,7 +1797,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1799
1797
|
}, {
|
|
1800
1798
|
key: "createHole",
|
|
1801
1799
|
value: function createHole(state, layerID, type, lineID, offset, properties) {
|
|
1802
|
-
var holeID = IDBroker.acquireID();
|
|
1800
|
+
var holeID = _export2.IDBroker.acquireID();
|
|
1803
1801
|
var hole = state.catalog.factoryElement(type, {
|
|
1804
1802
|
id: holeID,
|
|
1805
1803
|
url: state.catalog.getIn(['elements', type, 'info', 'url']),
|
|
@@ -1849,7 +1847,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1849
1847
|
if (properties.hasOwnProperty('flip_horizontal')) {
|
|
1850
1848
|
properties['flip_horizontal'] = true;
|
|
1851
1849
|
}
|
|
1852
|
-
state = Hole.setJsProperties(state, layerID, holeID, properties).updatedState;
|
|
1850
|
+
state = _export.Hole.setJsProperties(state, layerID, holeID, properties).updatedState;
|
|
1853
1851
|
return {
|
|
1854
1852
|
updatedState: state,
|
|
1855
1853
|
hole: hole
|
|
@@ -1879,5 +1877,4 @@ var Item = /*#__PURE__*/function () {
|
|
|
1879
1877
|
};
|
|
1880
1878
|
}
|
|
1881
1879
|
}]);
|
|
1882
|
-
}();
|
|
1883
|
-
export { Item as default };
|
|
1880
|
+
}();
|