kitchen-simulator 1.1.1-test.63 → 1.1.1-test.65
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 +79 -70
- package/es/KitchenConfiguratorApp.js +107 -98
- 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 -15
- package/es/catalog/factories/area-factory-3d.js +31 -22
- package/es/catalog/factories/area-factory.js +20 -11
- 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 -24
- package/es/catalog/properties/property-color.js +23 -16
- package/es/catalog/properties/property-enum.js +31 -24
- package/es/catalog/properties/property-hidden.js +16 -9
- package/es/catalog/properties/property-lenght-measure.js +45 -38
- package/es/catalog/properties/property-length-measure.js +43 -36
- package/es/catalog/properties/property-length-measure_hole.js +45 -38
- 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 -8
- package/es/catalog/utils/exporter.js +15 -8
- package/es/catalog/utils/geom-utils.js +29 -13
- package/es/catalog/utils/item-loader.js +97 -84
- 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 -8
- package/es/class/area.js +28 -22
- package/es/class/export.js +95 -23
- package/es/class/group.js +59 -53
- package/es/class/guide.js +21 -15
- package/es/class/hole.js +89 -83
- package/es/class/item.js +147 -141
- package/es/class/layer.js +65 -59
- package/es/class/line.js +143 -135
- package/es/class/project.js +98 -90
- package/es/class/vertex.js +35 -29
- 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 -23
- package/es/components/style/cancel-button.js +14 -7
- package/es/components/style/content-container.js +16 -9
- package/es/components/style/content-title.js +20 -11
- package/es/components/style/delete-button.js +17 -8
- package/es/components/style/export.js +120 -30
- package/es/components/style/form-block.js +15 -8
- package/es/components/style/form-color-input.js +14 -7
- package/es/components/style/form-label.js +15 -8
- package/es/components/style/form-number-input.js +49 -41
- package/es/components/style/form-number-input_2.js +44 -36
- package/es/components/style/form-select.js +24 -17
- package/es/components/style/form-slider.js +17 -10
- package/es/components/style/form-submit-button.js +17 -8
- package/es/components/style/form-text-input.js +34 -26
- 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 -10
- package/es/components/viewer2d/group.js +24 -15
- package/es/components/viewer2d/item.js +70 -61
- 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 -39
- package/es/components/viewer2d/rulerY.js +45 -37
- package/es/components/viewer2d/scene.js +38 -30
- package/es/components/viewer2d/snap.js +22 -13
- package/es/components/viewer2d/state.js +27 -18
- package/es/components/viewer2d/utils.js +37 -24
- package/es/components/viewer2d/vertex.js +17 -8
- package/es/components/viewer2d/viewer2d.js +163 -153
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +23 -17
- package/es/components/viewer3d/dcm.js +7 -1
- package/es/components/viewer3d/fbm.js +7 -1
- package/es/components/viewer3d/front3D.js +21 -12
- 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 -39
- 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 +226 -191
- package/es/components/viewer3d/three-memory-cleaner.js +12 -3
- package/es/components/viewer3d/viewer3d-first-person.js +46 -40
- package/es/components/viewer3d/viewer3d.js +202 -196
- package/es/constants.js +358 -349
- package/es/index.js +15 -7
- package/es/models.js +184 -177
- package/es/plugins/SVGLoader.js +53 -48
- package/es/plugins/autosave.js +9 -3
- package/es/plugins/console-debugger.js +12 -5
- 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 -13
- 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 -181
- 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 -9
- package/es/utils/helper.js +63 -39
- package/es/utils/history.js +15 -8
- package/es/utils/id-broker.js +15 -8
- package/es/utils/logger.js +7 -1
- package/es/utils/math.js +12 -5
- package/es/utils/molding.js +144 -119
- package/es/utils/name-generator.js +13 -7
- package/es/utils/objects-utils.js +19 -7
- package/es/utils/phone-validator.js +7 -1
- package/es/utils/process-black-list.js +10 -3
- package/es/utils/react-if.js +12 -6
- package/es/utils/snap-scene.js +34 -27
- package/es/utils/snap.js +59 -45
- package/es/utils/summarizeCart.js +7 -1
- package/es/utils/threeCSG.es6.js +22 -13
- package/es/version.js +7 -1
- package/lib/@history.js +2 -1
- package/lib/AppContext.js +2 -1
- package/lib/KitchenConfigurator.js +2 -1
- package/lib/KitchenConfiguratorApp.js +2 -1
- package/lib/catalog/areas/area/planner-element.js +2 -1
- package/lib/catalog/catalog.js +2 -1
- package/lib/catalog/factories/area-factory.js +2 -1
- package/lib/catalog/factories/wall-factory.js +2 -1
- package/lib/catalog/holes/door-closet/planner-element.js +2 -1
- package/lib/catalog/holes/door-double/planner-element.js +2 -1
- package/lib/catalog/holes/door-exterior/planner-element.js +2 -1
- package/lib/catalog/holes/door-interior/planner-element.js +2 -1
- package/lib/catalog/holes/door-panic/planner-element.js +2 -1
- package/lib/catalog/holes/door-panic-double/planner-element.js +2 -1
- package/lib/catalog/holes/door-sliding/planner-element.js +2 -1
- package/lib/catalog/holes/doorway-framed/planner-element.js +2 -1
- package/lib/catalog/holes/doorway-frameless/planner-element.js +2 -1
- package/lib/catalog/holes/window-clear/planner-element.js +2 -1
- package/lib/catalog/holes/window-cross/planner-element.js +2 -1
- package/lib/catalog/holes/window-double-hung/planner-element.js +2 -1
- package/lib/catalog/holes/window-vertical/planner-element.js +2 -1
- package/lib/catalog/lines/wall/planner-element.js +2 -1
- package/lib/catalog/molding/molding-dcm/planner-element.js +2 -1
- package/lib/catalog/molding/molding-fbm/planner-element.js +2 -1
- package/lib/catalog/molding/molding-lrm/planner-element.js +2 -1
- package/lib/catalog/properties/property-checkbox.js +2 -1
- package/lib/catalog/properties/property-color.js +2 -1
- package/lib/catalog/properties/property-enum.js +2 -1
- package/lib/catalog/properties/property-hidden.js +2 -1
- package/lib/catalog/properties/property-lenght-measure.js +2 -1
- package/lib/catalog/properties/property-length-measure.js +2 -1
- package/lib/catalog/properties/property-length-measure_hole.js +2 -1
- package/lib/catalog/properties/property-number.js +2 -1
- package/lib/catalog/properties/property-read-only.js +2 -1
- package/lib/catalog/properties/property-string.js +2 -1
- package/lib/catalog/properties/property-toggle.js +2 -1
- package/lib/catalog/properties/shared-property-style.js +2 -1
- package/lib/catalog/utils/FuseUtils.js +2 -1
- package/lib/catalog/utils/exporter.js +2 -1
- package/lib/class/FuseUtils.js +2 -1
- package/lib/class/area.js +2 -1
- package/lib/class/group.js +2 -1
- package/lib/class/hole.js +2 -1
- package/lib/class/item.js +2 -1
- package/lib/class/layer.js +2 -1
- package/lib/class/line.js +2 -1
- package/lib/class/project.js +2 -1
- package/lib/class/vertex.js +2 -1
- package/lib/components/content.js +2 -1
- package/lib/components/disclaimer/disclaimer.js +2 -1
- package/lib/components/style/button.js +2 -1
- package/lib/components/style/cancel-button.js +2 -1
- package/lib/components/style/content-container.js +2 -1
- package/lib/components/style/content-title.js +2 -1
- package/lib/components/style/delete-button.js +2 -1
- package/lib/components/style/form-block.js +2 -1
- package/lib/components/style/form-color-input.js +2 -1
- package/lib/components/style/form-label.js +2 -1
- package/lib/components/style/form-number-input.js +2 -1
- package/lib/components/style/form-number-input_2.js +2 -1
- package/lib/components/style/form-select.js +2 -1
- package/lib/components/style/form-slider.js +2 -1
- package/lib/components/style/form-submit-button.js +2 -1
- package/lib/components/style/form-text-input.js +2 -1
- package/lib/components/viewer2d/area.js +2 -1
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +2 -1
- package/lib/components/viewer2d/grids/grid-streak.js +2 -1
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +2 -1
- package/lib/components/viewer2d/grids/grids.js +2 -1
- package/lib/components/viewer2d/group.js +2 -1
- package/lib/components/viewer2d/item.js +2 -1
- package/lib/components/viewer2d/layer.js +2 -1
- package/lib/components/viewer2d/ruler.js +2 -1
- package/lib/components/viewer2d/rulerDist.js +2 -1
- package/lib/components/viewer2d/rulerX.js +2 -1
- package/lib/components/viewer2d/rulerY.js +2 -1
- package/lib/components/viewer2d/scene.js +2 -1
- package/lib/components/viewer2d/snap.js +2 -1
- package/lib/components/viewer2d/state.js +2 -1
- package/lib/components/viewer2d/vertex.js +2 -1
- package/lib/components/viewer2d/viewer2d.js +2 -1
- package/lib/components/viewer3d/dcm.js +2 -1
- package/lib/components/viewer3d/fbm.js +2 -1
- package/lib/components/viewer3d/front3D.js +2 -1
- package/lib/components/viewer3d/grid-creator.js +2 -1
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +2 -1
- package/lib/components/viewer3d/grids/grid-streak.js +2 -1
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +2 -1
- package/lib/components/viewer3d/libs/mtl-loader.js +2 -1
- package/lib/components/viewer3d/libs/obj-loader.js +2 -1
- package/lib/components/viewer3d/lrm.js +2 -1
- package/lib/components/viewer3d/ruler-utils/itemRect.js +2 -1
- package/lib/components/viewer3d/ruler-utils/layer3D.js +2 -1
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +2 -1
- package/lib/components/viewer3d/ruler-utils/state3D.js +2 -1
- package/lib/components/viewer3d/viewer3d-first-person.js +2 -1
- package/lib/components/viewer3d/viewer3d.js +2 -1
- package/lib/plugins/autosave.js +2 -1
- package/lib/plugins/console-debugger.js +2 -1
- package/lib/plugins/keyboard.js +2 -1
- package/lib/reducers/areas-reducer.js +2 -1
- package/lib/reducers/groups-reducer.js +2 -1
- package/lib/reducers/holes-reducer.js +2 -1
- package/lib/reducers/items-reducer.js +2 -1
- package/lib/reducers/lines-reducer.js +2 -1
- package/lib/reducers/project-reducer.js +2 -1
- package/lib/reducers/scene-reducer.js +2 -1
- package/lib/reducers/user-reducer.js +2 -1
- package/lib/reducers/vertices-reducer.js +2 -1
- package/lib/reducers/viewer2d-reducer.js +2 -1
- package/lib/reducers/viewer3d-reducer.js +2 -1
- package/lib/translator/en.js +2 -1
- package/lib/translator/it.js +2 -1
- package/lib/translator/ru.js +2 -1
- package/lib/translator/translator.js +2 -1
- package/lib/utils/name-generator.js +2 -1
- package/lib/utils/react-if.js +2 -1
- package/lib/utils/threeCSG.es6.js +2 -1
- package/package.json +2 -1
package/es/class/item.js
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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/esm/toConsumableArray"));
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
11
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/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");
|
|
5
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; }
|
|
6
|
-
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) {
|
|
7
|
-
import { convert } from "../utils/convert-units-lite";
|
|
8
|
-
import { Group, Hole, Layer } from "./export";
|
|
9
|
-
import { GeometryUtils, IDBroker, MoldingUtils, NameGenerator } from "../utils/export";
|
|
10
|
-
import { fromJS, Map } from 'immutable';
|
|
11
|
-
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";
|
|
12
|
-
import { debugUtil } from "../utils/helper";
|
|
13
|
-
import { hasMoldingLayout } from "../utils/molding";
|
|
14
|
-
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; }
|
|
15
22
|
var allItemRect;
|
|
16
23
|
var allItemSnap;
|
|
17
24
|
var allLines;
|
|
@@ -20,19 +27,19 @@ var allLineSnap;
|
|
|
20
27
|
var allRect;
|
|
21
28
|
var time1;
|
|
22
29
|
var time2;
|
|
23
|
-
var Item = /*#__PURE__*/function () {
|
|
30
|
+
var Item = exports["default"] = /*#__PURE__*/function () {
|
|
24
31
|
function Item() {
|
|
25
|
-
|
|
32
|
+
(0, _classCallCheck2["default"])(this, Item);
|
|
26
33
|
}
|
|
27
|
-
return
|
|
34
|
+
return (0, _createClass2["default"])(Item, null, [{
|
|
28
35
|
key: "create",
|
|
29
36
|
value: function create(state, layerID, type, x, y, width, height, rotation, isDuplication) {
|
|
30
37
|
var molding = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : [];
|
|
31
|
-
var itemID = IDBroker.acquireID();
|
|
38
|
+
var itemID = _export2.IDBroker.acquireID();
|
|
32
39
|
var item = state.catalog.factoryElement(type, {
|
|
33
40
|
id: itemID,
|
|
34
41
|
itemID: state.catalog.getIn(['elements', type, 'itemID']),
|
|
35
|
-
name: NameGenerator.generateName('items', state.catalog.getIn(['elements', type, 'info', 'title'])),
|
|
42
|
+
name: _export2.NameGenerator.generateName('items', state.catalog.getIn(['elements', type, 'info', 'title'])),
|
|
36
43
|
sku_number: state.catalog.getIn(['elements', type, 'obj']).toJS().sku_number,
|
|
37
44
|
//style: state.catalog.getIn(['elements', type, 'info', 'door']),
|
|
38
45
|
category: state.catalog.getIn(['elements', type, 'type']),
|
|
@@ -59,7 +66,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
59
66
|
cabinet_door_style_id: cds.cabinet_door_style_id
|
|
60
67
|
});
|
|
61
68
|
item = item.merge({
|
|
62
|
-
doorStyle: fromJS(_objectSpread(_objectSpread({}, temp), {}, {
|
|
69
|
+
doorStyle: (0, _immutable.fromJS)(_objectSpread(_objectSpread({}, temp), {}, {
|
|
63
70
|
doorStyles: updatedDoorStyles
|
|
64
71
|
}))
|
|
65
72
|
});
|
|
@@ -77,7 +84,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
77
84
|
cabinet_door_style_id: cds.cabinet_door_style_id
|
|
78
85
|
});
|
|
79
86
|
item = item.merge({
|
|
80
|
-
doorStyle: fromJS(tmpDS)
|
|
87
|
+
doorStyle: (0, _immutable.fromJS)(tmpDS)
|
|
81
88
|
});
|
|
82
89
|
break;
|
|
83
90
|
}
|
|
@@ -100,7 +107,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
100
107
|
cabinet_door_style_id: _cds.cabinet_door_style_id
|
|
101
108
|
});
|
|
102
109
|
item = item.merge({
|
|
103
|
-
doorStyle: fromJS(_tmpDS)
|
|
110
|
+
doorStyle: (0, _immutable.fromJS)(_tmpDS)
|
|
104
111
|
});
|
|
105
112
|
break;
|
|
106
113
|
}
|
|
@@ -127,74 +134,74 @@ var Item = /*#__PURE__*/function () {
|
|
|
127
134
|
var newProperties = item.get('properties').toJS();
|
|
128
135
|
if (newProperties.hasOwnProperty('depth')) {
|
|
129
136
|
if (!newProperties.hasOwnProperty('oldDepth')) {
|
|
130
|
-
newProperties['oldDepth'] = new Map({
|
|
137
|
+
newProperties['oldDepth'] = new _immutable.Map({
|
|
131
138
|
length: newProperties.depth.length,
|
|
132
139
|
_length: newProperties.depth._length,
|
|
133
140
|
_unit: newProperties.depth._unit
|
|
134
141
|
});
|
|
135
142
|
}
|
|
136
|
-
newProperties['depth'] = new Map({
|
|
137
|
-
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'),
|
|
138
145
|
_length: euro_cds[0].euro_length,
|
|
139
146
|
_unit: 'in'
|
|
140
147
|
});
|
|
141
148
|
}
|
|
142
149
|
if (newProperties.hasOwnProperty('height')) {
|
|
143
150
|
if (!newProperties.hasOwnProperty('oldHeight')) {
|
|
144
|
-
newProperties['oldHeight'] = new Map({
|
|
151
|
+
newProperties['oldHeight'] = new _immutable.Map({
|
|
145
152
|
length: newProperties.height.length,
|
|
146
153
|
_length: newProperties.height._length,
|
|
147
154
|
_unit: newProperties.height._unit
|
|
148
155
|
});
|
|
149
156
|
}
|
|
150
|
-
newProperties['height'] = new Map({
|
|
151
|
-
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'),
|
|
152
159
|
_length: euro_cds[0].euro_height,
|
|
153
160
|
_unit: 'in'
|
|
154
161
|
});
|
|
155
162
|
}
|
|
156
163
|
if (newProperties.hasOwnProperty('width')) {
|
|
157
164
|
if (!newProperties.hasOwnProperty('oldWidth')) {
|
|
158
|
-
newProperties['oldWidth'] = new Map({
|
|
165
|
+
newProperties['oldWidth'] = new _immutable.Map({
|
|
159
166
|
length: newProperties.width.length,
|
|
160
167
|
_length: newProperties.width._length,
|
|
161
168
|
_unit: newProperties.width._unit
|
|
162
169
|
});
|
|
163
170
|
}
|
|
164
|
-
newProperties['width'] = new Map({
|
|
165
|
-
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,
|
|
166
173
|
_length: euro_cds[0].euro_width,
|
|
167
174
|
_unit: 'in'
|
|
168
175
|
});
|
|
169
176
|
}
|
|
170
177
|
item = item.merge({
|
|
171
|
-
properties: fromJS(newProperties)
|
|
178
|
+
properties: (0, _immutable.fromJS)(newProperties)
|
|
172
179
|
});
|
|
173
180
|
} else {
|
|
174
181
|
var properties = item.get('properties').toJS();
|
|
175
182
|
if (properties.hasOwnProperty('oldDepth')) {
|
|
176
|
-
properties['depth'] = new Map({
|
|
183
|
+
properties['depth'] = new _immutable.Map({
|
|
177
184
|
length: properties.oldDepth.length,
|
|
178
185
|
_length: properties.oldDepth._length,
|
|
179
186
|
_unit: properties.oldDepth._unit
|
|
180
187
|
});
|
|
181
188
|
}
|
|
182
189
|
if (properties.hasOwnProperty('oldHeight')) {
|
|
183
|
-
properties['height'] = new Map({
|
|
190
|
+
properties['height'] = new _immutable.Map({
|
|
184
191
|
length: properties.oldHeight.length,
|
|
185
192
|
_length: properties.oldHeight._length,
|
|
186
193
|
_unit: properties.oldHeight._unit
|
|
187
194
|
});
|
|
188
195
|
}
|
|
189
196
|
if (properties.hasOwnProperty('oldWidth')) {
|
|
190
|
-
properties['width'] = new Map({
|
|
197
|
+
properties['width'] = new _immutable.Map({
|
|
191
198
|
length: properties.oldWidth.length,
|
|
192
199
|
_length: properties.oldWidth._length,
|
|
193
200
|
_unit: properties.oldWidth._unit
|
|
194
201
|
});
|
|
195
202
|
}
|
|
196
203
|
item = item.merge({
|
|
197
|
-
properties: fromJS(properties)
|
|
204
|
+
properties: (0, _immutable.fromJS)(properties)
|
|
198
205
|
});
|
|
199
206
|
}
|
|
200
207
|
};
|
|
@@ -204,16 +211,16 @@ var Item = /*#__PURE__*/function () {
|
|
|
204
211
|
if (item.type.includes('Light')) {
|
|
205
212
|
var ceilHeight = state.getIn(['scene', 'layers', layerID, 'ceilHeight']);
|
|
206
213
|
var ceilUnit = state.getIn(['scene', 'layers', layerID, 'unit']);
|
|
207
|
-
ceilHeight = convert(ceilHeight).from(ceilUnit).to('cm');
|
|
214
|
+
ceilHeight = (0, _convertUnitsLite.convert)(ceilHeight).from(ceilUnit).to('cm');
|
|
208
215
|
var newAltitude = ceilHeight - item.properties.getIn(['height', 'length']);
|
|
209
|
-
newAltitude = convert(newAltitude).from('cm').to(ceilUnit);
|
|
216
|
+
newAltitude = (0, _convertUnitsLite.convert)(newAltitude).from('cm').to(ceilUnit);
|
|
210
217
|
item = item.setIn(['properties', 'altitude', '_length'], newAltitude);
|
|
211
218
|
state = state.setIn(['scene', 'layers', layerID, 'items', item.id], item);
|
|
212
219
|
}
|
|
213
220
|
if (item.category === 'cabinet') {
|
|
214
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.
|
|
215
222
|
var layerMolding = state.getIn(['scene', 'layers', layerID, 'molding']).filter(function (md) {
|
|
216
|
-
return hasMoldingLayout(md, item.layoutpos);
|
|
223
|
+
return (0, _molding.hasMoldingLayout)(md, item.layoutpos);
|
|
217
224
|
});
|
|
218
225
|
state = state.setIn(['scene', 'layers', layerID, 'items', itemID, 'molding'], layerMolding.length ? layerMolding : molding);
|
|
219
226
|
}
|
|
@@ -244,16 +251,16 @@ var Item = /*#__PURE__*/function () {
|
|
|
244
251
|
tmpDS['doorStyles']['drawer_door_handle_' + i + '_gltf'] = doorHandle;
|
|
245
252
|
}
|
|
246
253
|
}
|
|
247
|
-
item = item.mergeIn(['doorStyle'], fromJS(tmpDS));
|
|
254
|
+
item = item.mergeIn(['doorStyle'], (0, _immutable.fromJS)(tmpDS));
|
|
248
255
|
return item;
|
|
249
256
|
}
|
|
250
257
|
}, {
|
|
251
258
|
key: "select",
|
|
252
259
|
value: function select(state, layerID, itemID) {
|
|
253
|
-
state = Layer.select(state, layerID).updatedState;
|
|
254
|
-
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;
|
|
255
262
|
state = state.merge({
|
|
256
|
-
replacingSupport: new Map({
|
|
263
|
+
replacingSupport: new _immutable.Map({
|
|
257
264
|
layerID: layerID,
|
|
258
265
|
itemID: itemID
|
|
259
266
|
})
|
|
@@ -265,8 +272,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
265
272
|
}, {
|
|
266
273
|
key: "selectHole",
|
|
267
274
|
value: function selectHole(state, layerID, holeID) {
|
|
268
|
-
state = Layer.select(state, layerID).updatedState;
|
|
269
|
-
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;
|
|
270
277
|
return {
|
|
271
278
|
updatedState: state
|
|
272
279
|
};
|
|
@@ -282,10 +289,10 @@ var Item = /*#__PURE__*/function () {
|
|
|
282
289
|
updatedState: state
|
|
283
290
|
};
|
|
284
291
|
}
|
|
285
|
-
var width = new Map({
|
|
292
|
+
var width = new _immutable.Map({
|
|
286
293
|
_length: newWidth,
|
|
287
294
|
_unit: 'in',
|
|
288
|
-
length: convert(newWidth).from('in').to('cm')
|
|
295
|
+
length: (0, _convertUnitsLite.convert)(newWidth).from('in').to('cm')
|
|
289
296
|
});
|
|
290
297
|
properties = properties.set('width', width);
|
|
291
298
|
state = state.mergeIn(['scene', 'layers', layerID, 'items', itemID, 'properties'], properties);
|
|
@@ -299,14 +306,14 @@ var Item = /*#__PURE__*/function () {
|
|
|
299
306
|
var layer = state.getIn(['scene', 'layers', layerID]);
|
|
300
307
|
var scene = state.get('scene');
|
|
301
308
|
var catalog = state.catalog.toJS();
|
|
302
|
-
allLines = GeometryUtils.getAllLines(layer);
|
|
303
|
-
allLineRects = GeometryUtils.buildRectFromLines(layer, allLines);
|
|
304
|
-
allItemRect = GeometryUtils.getAllItems(scene, catalog, allLineRects);
|
|
305
|
-
allItemSnap = GeometryUtils.getAllItemSnap(allItemRect);
|
|
306
|
-
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);
|
|
307
314
|
allRect = allItemRect.others.concat(allLineRects);
|
|
308
|
-
allItemSnap = GeometryUtils.validateSnaps(allItemSnap, allRect);
|
|
309
|
-
allLineSnap = GeometryUtils.validateSnaps(allLineSnap, allRect);
|
|
315
|
+
allItemSnap = _export2.GeometryUtils.validateSnaps(allItemSnap, allRect);
|
|
316
|
+
allLineSnap = _export2.GeometryUtils.validateSnaps(allLineSnap, allRect);
|
|
310
317
|
}
|
|
311
318
|
}, {
|
|
312
319
|
key: "duplicateSelected",
|
|
@@ -336,7 +343,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
336
343
|
val.size = allItemRect.cur.size;
|
|
337
344
|
val.layoutpos = allItemRect.cur.layoutpos;
|
|
338
345
|
val.is_corner = allItemRect.cur.is_corner;
|
|
339
|
-
var isrectSect = GeometryUtils.validInterSect(allRect, val);
|
|
346
|
+
var isrectSect = _export2.GeometryUtils.validInterSect(allRect, val);
|
|
340
347
|
if (isrectSect) {
|
|
341
348
|
// Duplicated object has a original object's molding property
|
|
342
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),
|
|
@@ -345,8 +352,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
345
352
|
if (item === null) {
|
|
346
353
|
alert('There are no Door Colors in this cabinet.');
|
|
347
354
|
state = state.merge({
|
|
348
|
-
mode: MODE_IDLE,
|
|
349
|
-
drawingSupport: new Map()
|
|
355
|
+
mode: _constants.MODE_IDLE,
|
|
356
|
+
drawingSupport: new _immutable.Map()
|
|
350
357
|
});
|
|
351
358
|
} else {
|
|
352
359
|
state = Item.select(stateI, layerID, item.id).updatedState;
|
|
@@ -363,7 +370,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
363
370
|
_val.size = allItemRect.cur.size;
|
|
364
371
|
_val.layoutpos = allItemRect.cur.layoutpos;
|
|
365
372
|
_val.is_corner = allItemRect.cur.is_corner;
|
|
366
|
-
var isRect = GeometryUtils.validInterSect(allRect, _val);
|
|
373
|
+
var isRect = _export2.GeometryUtils.validInterSect(allRect, _val);
|
|
367
374
|
if (isRect) {
|
|
368
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),
|
|
369
376
|
_stateI = _this$create2.updatedState,
|
|
@@ -371,8 +378,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
371
378
|
if (_item === null) {
|
|
372
379
|
alert('There are no Door Colors in this cabinet.');
|
|
373
380
|
state = state.merge({
|
|
374
|
-
mode: MODE_IDLE,
|
|
375
|
-
drawingSupport: new Map()
|
|
381
|
+
mode: _constants.MODE_IDLE,
|
|
382
|
+
drawingSupport: new _immutable.Map()
|
|
376
383
|
});
|
|
377
384
|
} else {
|
|
378
385
|
state = Item.select(_stateI, layerID, _item.id).updatedState;
|
|
@@ -389,7 +396,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
389
396
|
_val2.size = allItemRect.cur.size;
|
|
390
397
|
_val2.layoutpos = allItemRect.cur.layoutpos;
|
|
391
398
|
_val2.is_corner = allItemRect.cur.is_corner;
|
|
392
|
-
var isRectDown = GeometryUtils.validInterSect(allRect, _val2);
|
|
399
|
+
var isRectDown = _export2.GeometryUtils.validInterSect(allRect, _val2);
|
|
393
400
|
if (isRectDown) {
|
|
394
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),
|
|
395
402
|
_stateI2 = _this$create3.updatedState,
|
|
@@ -397,8 +404,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
397
404
|
if (_item2 === null) {
|
|
398
405
|
alert('There are no Door Colors in this cabinet.');
|
|
399
406
|
state = state.merge({
|
|
400
|
-
mode: MODE_IDLE,
|
|
401
|
-
drawingSupport: new Map()
|
|
407
|
+
mode: _constants.MODE_IDLE,
|
|
408
|
+
drawingSupport: new _immutable.Map()
|
|
402
409
|
});
|
|
403
410
|
} else {
|
|
404
411
|
state = Item.select(_stateI2, layerID, _item2.id).updatedState;
|
|
@@ -415,7 +422,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
415
422
|
_val3.size = allItemRect.cur.size;
|
|
416
423
|
_val3.layoutpos = allItemRect.cur.layoutpos;
|
|
417
424
|
_val3.is_corner = allItemRect.cur.is_corner;
|
|
418
|
-
var isRectUp = GeometryUtils.validInterSect(allRect, _val3);
|
|
425
|
+
var isRectUp = _export2.GeometryUtils.validInterSect(allRect, _val3);
|
|
419
426
|
if (isRectUp) {
|
|
420
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),
|
|
421
428
|
_stateI3 = _this$create4.updatedState,
|
|
@@ -423,8 +430,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
423
430
|
if (_item3 === null) {
|
|
424
431
|
alert('There are no Door Colors in this cabinet.');
|
|
425
432
|
state = state.merge({
|
|
426
|
-
mode: MODE_IDLE,
|
|
427
|
-
drawingSupport: new Map()
|
|
433
|
+
mode: _constants.MODE_IDLE,
|
|
434
|
+
drawingSupport: new _immutable.Map()
|
|
428
435
|
});
|
|
429
436
|
} else {
|
|
430
437
|
state = Item.select(_stateI3, layerID, _item3.id).updatedState;
|
|
@@ -447,7 +454,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
447
454
|
var myOffset = myObject.offset;
|
|
448
455
|
var v0 = layer.getIn(['vertices', line.vertices.get(0)]);
|
|
449
456
|
var v1 = layer.getIn(['vertices', line.vertices.get(1)]);
|
|
450
|
-
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);
|
|
451
458
|
var delta = width / 2 / lineLength + 0.00001;
|
|
452
459
|
var allHoles = state.getIn(['scene', 'layers', layerID, 'holes']);
|
|
453
460
|
var rightAble = true;
|
|
@@ -542,9 +549,9 @@ var Item = /*#__PURE__*/function () {
|
|
|
542
549
|
key: "remove",
|
|
543
550
|
value: function remove(state, layerID, itemID) {
|
|
544
551
|
state = this.unselect(state, layerID, itemID).updatedState;
|
|
545
|
-
state = Layer.removeElement(state, layerID, 'items', itemID).updatedState;
|
|
552
|
+
state = _export.Layer.removeElement(state, layerID, 'items', itemID).updatedState;
|
|
546
553
|
state.getIn(['scene', 'groups']).forEach(function (group) {
|
|
547
|
-
return state = Group.removeElement(state, group.id, layerID, 'items', itemID).updatedState;
|
|
554
|
+
return state = _export.Group.removeElement(state, group.id, layerID, 'items', itemID).updatedState;
|
|
548
555
|
});
|
|
549
556
|
return {
|
|
550
557
|
updatedState: state
|
|
@@ -563,7 +570,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
563
570
|
}, {
|
|
564
571
|
key: "unselect",
|
|
565
572
|
value: function unselect(state, layerID, itemID) {
|
|
566
|
-
state = Layer.unselect(state, layerID, 'items', itemID).updatedState;
|
|
573
|
+
state = _export.Layer.unselect(state, layerID, 'items', itemID).updatedState;
|
|
567
574
|
return {
|
|
568
575
|
updatedState: state
|
|
569
576
|
};
|
|
@@ -572,8 +579,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
572
579
|
key: "selectToolDrawingItem",
|
|
573
580
|
value: function selectToolDrawingItem(state, sceneComponentType) {
|
|
574
581
|
state = state.merge({
|
|
575
|
-
mode: MODE_DRAWING_ITEM,
|
|
576
|
-
drawingSupport: new Map({
|
|
582
|
+
mode: _constants.MODE_DRAWING_ITEM,
|
|
583
|
+
drawingSupport: new _immutable.Map({
|
|
577
584
|
type: sceneComponentType
|
|
578
585
|
})
|
|
579
586
|
});
|
|
@@ -585,8 +592,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
585
592
|
key: "selectToolDrawingItem3D",
|
|
586
593
|
value: function selectToolDrawingItem3D(state, sceneComponentType) {
|
|
587
594
|
state = state.merge({
|
|
588
|
-
mode: MODE_DRAWING_ITEM_3D,
|
|
589
|
-
drawingSupport: new Map({
|
|
595
|
+
mode: _constants.MODE_DRAWING_ITEM_3D,
|
|
596
|
+
drawingSupport: new _immutable.Map({
|
|
590
597
|
type: sceneComponentType
|
|
591
598
|
})
|
|
592
599
|
});
|
|
@@ -621,7 +628,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
621
628
|
value: function updateDrawingItem(state, layerID, x, y) {
|
|
622
629
|
if (state.hasIn(['drawingSupport', 'currentID'])) {
|
|
623
630
|
var mode = state.get('mode');
|
|
624
|
-
if ([MODE_DRAWING_ITEM_3D].includes(mode)) {
|
|
631
|
+
if ([_constants.MODE_DRAWING_ITEM_3D].includes(mode)) {
|
|
625
632
|
state = state.updateIn(['scene', 'layers', layerID, 'items', state.getIn(['drawingSupport', 'currentID'])], function (item) {
|
|
626
633
|
return item && item.merge({
|
|
627
634
|
x: x,
|
|
@@ -629,12 +636,12 @@ var Item = /*#__PURE__*/function () {
|
|
|
629
636
|
});
|
|
630
637
|
});
|
|
631
638
|
state = state.merge({
|
|
632
|
-
mode: MODE_IDLE_3D
|
|
639
|
+
mode: _constants.MODE_IDLE_3D
|
|
633
640
|
});
|
|
634
641
|
}
|
|
635
|
-
if ([MODE_DRAWING_ITEM].includes(mode)) {
|
|
642
|
+
if ([_constants.MODE_DRAWING_ITEM].includes(mode)) {
|
|
636
643
|
state = state.merge({
|
|
637
|
-
mode: MODE_IDLE
|
|
644
|
+
mode: _constants.MODE_IDLE
|
|
638
645
|
});
|
|
639
646
|
state = state.updateIn(['scene', 'layers', layerID, 'items', state.getIn(['drawingSupport', 'currentID'])], function (item) {
|
|
640
647
|
return item && item.merge({
|
|
@@ -650,8 +657,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
650
657
|
if (item === null) {
|
|
651
658
|
alert('There are no Door Colors in this cabinet.');
|
|
652
659
|
state = state.merge({
|
|
653
|
-
mode: MODE_IDLE,
|
|
654
|
-
drawingSupport: new Map()
|
|
660
|
+
mode: _constants.MODE_IDLE,
|
|
661
|
+
drawingSupport: new _immutable.Map()
|
|
655
662
|
});
|
|
656
663
|
} else {
|
|
657
664
|
state = Item.select(stateI, layerID, item.id).updatedState;
|
|
@@ -685,7 +692,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
685
692
|
state = state.merge({
|
|
686
693
|
scene: scene.mergeIn(['layers', layerID, 'items', itemID], item)
|
|
687
694
|
});
|
|
688
|
-
time2 = debugUtil();
|
|
695
|
+
time2 = (0, _helper.debugUtil)();
|
|
689
696
|
false && console.log('FPS:', Math.round(1000 / (time2 - time1)), ' Delta Time:', (time2 - time1) / 1000, '(s)');
|
|
690
697
|
return {
|
|
691
698
|
updatedState: state
|
|
@@ -696,15 +703,15 @@ var Item = /*#__PURE__*/function () {
|
|
|
696
703
|
value: function endDrawingItem(state, layerID, x, y) {
|
|
697
704
|
var catalog = state.catalog;
|
|
698
705
|
state = this.updateDrawingItem(state, layerID, x, y, catalog).updatedState;
|
|
699
|
-
state = Layer.unselectAll(state, layerID).updatedState;
|
|
706
|
+
state = _export.Layer.unselectAll(state, layerID).updatedState;
|
|
700
707
|
var popup = state.get('popup');
|
|
701
708
|
state = state.merge({
|
|
702
|
-
drawingSupport: Map({
|
|
709
|
+
drawingSupport: (0, _immutable.Map)({
|
|
703
710
|
type: state.drawingSupport.get('type')
|
|
704
711
|
}),
|
|
705
712
|
isOpen: !popup
|
|
706
713
|
});
|
|
707
|
-
state = Layer.unselectAll(state, layerID).updatedState;
|
|
714
|
+
state = _export.Layer.unselectAll(state, layerID).updatedState;
|
|
708
715
|
this.updateMolding(state);
|
|
709
716
|
return {
|
|
710
717
|
updatedState: state
|
|
@@ -714,11 +721,11 @@ var Item = /*#__PURE__*/function () {
|
|
|
714
721
|
key: "beginDraggingItem",
|
|
715
722
|
value: function beginDraggingItem(state, layerID, itemID, x, y) {
|
|
716
723
|
var item = state.getIn(['scene', 'layers', layerID, 'items', itemID]);
|
|
717
|
-
time1 = debugUtil();
|
|
724
|
+
time1 = (0, _helper.debugUtil)();
|
|
718
725
|
if (!item) return;
|
|
719
726
|
state = state.merge({
|
|
720
|
-
mode: MODE_DRAGGING_ITEM,
|
|
721
|
-
draggingSupport: Map({
|
|
727
|
+
mode: _constants.MODE_DRAGGING_ITEM,
|
|
728
|
+
draggingSupport: (0, _immutable.Map)({
|
|
722
729
|
layerID: layerID,
|
|
723
730
|
itemID: itemID,
|
|
724
731
|
startPointX: x,
|
|
@@ -740,8 +747,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
740
747
|
updatedState: state
|
|
741
748
|
};
|
|
742
749
|
state = state.merge({
|
|
743
|
-
mode: MODE_DRAGGING_ITEM_3D,
|
|
744
|
-
draggingSupport: Map({
|
|
750
|
+
mode: _constants.MODE_DRAGGING_ITEM_3D,
|
|
751
|
+
draggingSupport: (0, _immutable.Map)({
|
|
745
752
|
layerID: layerID,
|
|
746
753
|
itemID: itemID,
|
|
747
754
|
startPointX: x,
|
|
@@ -836,7 +843,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
836
843
|
value: function endDraggingItem(state, x, y) {
|
|
837
844
|
state = this.updateDraggingItem(state, x, y).updatedState;
|
|
838
845
|
state = state.merge({
|
|
839
|
-
mode: MODE_IDLE
|
|
846
|
+
mode: _constants.MODE_IDLE
|
|
840
847
|
});
|
|
841
848
|
return {
|
|
842
849
|
updatedState: state
|
|
@@ -847,7 +854,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
847
854
|
value: function endDraggingItem3D(state) {
|
|
848
855
|
// state = this.updateDraggingItem(state, x, y).updatedState;
|
|
849
856
|
state = state.merge({
|
|
850
|
-
mode: MODE_IDLE_3D
|
|
857
|
+
mode: _constants.MODE_IDLE_3D
|
|
851
858
|
});
|
|
852
859
|
state = state.setIn(['scene', 'isEndDragging'], true);
|
|
853
860
|
return {
|
|
@@ -860,8 +867,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
860
867
|
var item = state.getIn(['scene', 'layers', layerID, 'items', itemID]);
|
|
861
868
|
var originRotation = item.get('rotation');
|
|
862
869
|
state = state.merge({
|
|
863
|
-
mode: MODE_ROTATING_ITEM,
|
|
864
|
-
rotatingSupport: Map({
|
|
870
|
+
mode: _constants.MODE_ROTATING_ITEM,
|
|
871
|
+
rotatingSupport: (0, _immutable.Map)({
|
|
865
872
|
layerID: layerID,
|
|
866
873
|
itemID: itemID,
|
|
867
874
|
x: x,
|
|
@@ -879,8 +886,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
879
886
|
var item = state.getIn(['scene', 'layers', layerID, 'items', itemID]);
|
|
880
887
|
var originRotation = item.get('rotation');
|
|
881
888
|
state = state.merge({
|
|
882
|
-
mode: MODE_ROTATING_ITEM_3D,
|
|
883
|
-
rotatingSupport: Map({
|
|
889
|
+
mode: _constants.MODE_ROTATING_ITEM_3D,
|
|
890
|
+
rotatingSupport: (0, _immutable.Map)({
|
|
884
891
|
layerID: layerID,
|
|
885
892
|
itemID: itemID,
|
|
886
893
|
x: x,
|
|
@@ -960,7 +967,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
960
967
|
value: function endRotatingItem(state, x, y) {
|
|
961
968
|
//state = this.updateRotatingItem(state, x, y).updatedState;
|
|
962
969
|
state = state.merge({
|
|
963
|
-
mode: MODE_IDLE
|
|
970
|
+
mode: _constants.MODE_IDLE
|
|
964
971
|
});
|
|
965
972
|
return {
|
|
966
973
|
updatedState: state
|
|
@@ -971,7 +978,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
971
978
|
value: function endRotatingItem3D(state, x, y) {
|
|
972
979
|
state = this.updateRotatingItem(state, x, y).updatedState;
|
|
973
980
|
state = state.merge({
|
|
974
|
-
mode: MODE_IDLE_3D
|
|
981
|
+
mode: _constants.MODE_IDLE_3D
|
|
975
982
|
});
|
|
976
983
|
return {
|
|
977
984
|
updatedState: state
|
|
@@ -1032,7 +1039,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1032
1039
|
scene: scene.mergeIn(['layers', layerID, 'items', itemID], item)
|
|
1033
1040
|
});
|
|
1034
1041
|
state = state.merge({
|
|
1035
|
-
mode: MODE_IDLE_3D
|
|
1042
|
+
mode: _constants.MODE_IDLE_3D
|
|
1036
1043
|
});
|
|
1037
1044
|
return {
|
|
1038
1045
|
updatedState: state
|
|
@@ -1049,7 +1056,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1049
1056
|
}, {
|
|
1050
1057
|
key: "setJsProperties",
|
|
1051
1058
|
value: function setJsProperties(state, layerID, itemID, properties) {
|
|
1052
|
-
return this.setProperties(state, layerID, itemID, fromJS(properties));
|
|
1059
|
+
return this.setProperties(state, layerID, itemID, (0, _immutable.fromJS)(properties));
|
|
1053
1060
|
}
|
|
1054
1061
|
}, {
|
|
1055
1062
|
key: "updateProperties",
|
|
@@ -1064,7 +1071,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1064
1071
|
}, {
|
|
1065
1072
|
key: "updateJsProperties",
|
|
1066
1073
|
value: function updateJsProperties(state, layerID, itemID, properties) {
|
|
1067
|
-
return this.updateProperties(state, layerID, itemID, fromJS(properties));
|
|
1074
|
+
return this.updateProperties(state, layerID, itemID, (0, _immutable.fromJS)(properties));
|
|
1068
1075
|
}
|
|
1069
1076
|
}, {
|
|
1070
1077
|
key: "setAttributes",
|
|
@@ -1077,7 +1084,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1077
1084
|
}, {
|
|
1078
1085
|
key: "setJsAttributes",
|
|
1079
1086
|
value: function setJsAttributes(state, layerID, itemID, itemAttributes) {
|
|
1080
|
-
itemAttributes = fromJS(itemAttributes);
|
|
1087
|
+
itemAttributes = (0, _immutable.fromJS)(itemAttributes);
|
|
1081
1088
|
return this.setAttributes(state, layerID, itemID, itemAttributes);
|
|
1082
1089
|
}
|
|
1083
1090
|
}, {
|
|
@@ -1099,7 +1106,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1099
1106
|
scene: scene.mergeIn(['layers', layerID, 'items', itemID], item)
|
|
1100
1107
|
});
|
|
1101
1108
|
state = state.merge({
|
|
1102
|
-
mode: MODE_IDLE_3D
|
|
1109
|
+
mode: _constants.MODE_IDLE_3D
|
|
1103
1110
|
});
|
|
1104
1111
|
}
|
|
1105
1112
|
return {
|
|
@@ -1110,7 +1117,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1110
1117
|
key: "removeReplacingSupport",
|
|
1111
1118
|
value: function removeReplacingSupport(state) {
|
|
1112
1119
|
state = state.merge({
|
|
1113
|
-
replacingSupport: new Map()
|
|
1120
|
+
replacingSupport: new _immutable.Map()
|
|
1114
1121
|
});
|
|
1115
1122
|
return {
|
|
1116
1123
|
updatedState: state
|
|
@@ -1121,14 +1128,14 @@ var Item = /*#__PURE__*/function () {
|
|
|
1121
1128
|
value: function setInitialDoorStyle(state, doorStyle, oStyle) {
|
|
1122
1129
|
if (doorStyle === undefined) {
|
|
1123
1130
|
state = state.merge({
|
|
1124
|
-
oStyle: new Map({
|
|
1131
|
+
oStyle: new _immutable.Map({
|
|
1125
1132
|
oStyle: oStyle
|
|
1126
1133
|
})
|
|
1127
1134
|
});
|
|
1128
1135
|
} else {
|
|
1129
1136
|
state = state.merge({
|
|
1130
1137
|
doorStyle: doorStyle,
|
|
1131
|
-
oStyle: new Map({
|
|
1138
|
+
oStyle: new _immutable.Map({
|
|
1132
1139
|
oStyle: oStyle
|
|
1133
1140
|
})
|
|
1134
1141
|
});
|
|
@@ -1145,7 +1152,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1145
1152
|
counttop: doorStyle.doorStyles.counttop
|
|
1146
1153
|
})
|
|
1147
1154
|
});
|
|
1148
|
-
data = data.mergeIn(['doorStyle'], fromJS(tmpDS));
|
|
1155
|
+
data = data.mergeIn(['doorStyle'], (0, _immutable.fromJS)(tmpDS));
|
|
1149
1156
|
layers = layers.mergeIn(['items', itemID], data);
|
|
1150
1157
|
state = state.merge({
|
|
1151
1158
|
scene: scene.mergeIn(['layers', layerID], layers)
|
|
@@ -1188,15 +1195,15 @@ var Item = /*#__PURE__*/function () {
|
|
|
1188
1195
|
var itemID = data.id;
|
|
1189
1196
|
var curItem = state.getIn(['scene', 'layers', layerID, 'items', itemID]);
|
|
1190
1197
|
var layer = state.getIn(['scene', 'layers', layerID]);
|
|
1191
|
-
var tmpMolding =
|
|
1192
|
-
var temp_item_molding =
|
|
1198
|
+
var tmpMolding = (0, _toConsumableArray2["default"])(curItem.molding);
|
|
1199
|
+
var temp_item_molding = (0, _toConsumableArray2["default"])(curItem.molding);
|
|
1193
1200
|
temp_item_molding = temp_item_molding.filter(function (md) {
|
|
1194
1201
|
return doorStyle.doorStyles.cds.some(function (ds) {
|
|
1195
1202
|
return ds.itemID === md.itemID;
|
|
1196
1203
|
});
|
|
1197
1204
|
});
|
|
1198
1205
|
tmpMolding.forEach(function (md) {
|
|
1199
|
-
var itemGroup = MoldingUtils.getItemGroupFromMolding(layer, curItem, md);
|
|
1206
|
+
var itemGroup = _export2.MoldingUtils.getItemGroupFromMolding(layer, curItem, md);
|
|
1200
1207
|
itemGroup.forEach(function (it) {
|
|
1201
1208
|
state = state.setIn(['scene', 'layers', layerID, 'items', it.id, 'molding'], temp_item_molding);
|
|
1202
1209
|
});
|
|
@@ -1215,42 +1222,42 @@ var Item = /*#__PURE__*/function () {
|
|
|
1215
1222
|
var newProperties = state.scene.getIn(['layers', layerID, 'items', itemID, 'properties']).toJS();
|
|
1216
1223
|
if (newProperties.hasOwnProperty('depth')) {
|
|
1217
1224
|
if (!newProperties.hasOwnProperty('oldDepth')) {
|
|
1218
|
-
newProperties['oldDepth'] = new Map({
|
|
1225
|
+
newProperties['oldDepth'] = new _immutable.Map({
|
|
1219
1226
|
length: newProperties.depth.length,
|
|
1220
1227
|
_length: newProperties.depth._length,
|
|
1221
1228
|
_unit: newProperties.depth._unit
|
|
1222
1229
|
});
|
|
1223
1230
|
}
|
|
1224
|
-
newProperties['depth'] = new Map({
|
|
1225
|
-
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'),
|
|
1226
1233
|
_length: euro_cds[0].euro_length,
|
|
1227
1234
|
_unit: 'in'
|
|
1228
1235
|
});
|
|
1229
1236
|
}
|
|
1230
1237
|
if (newProperties.hasOwnProperty('height')) {
|
|
1231
1238
|
if (!newProperties.hasOwnProperty('oldHeight')) {
|
|
1232
|
-
newProperties['oldHeight'] = new Map({
|
|
1239
|
+
newProperties['oldHeight'] = new _immutable.Map({
|
|
1233
1240
|
length: newProperties.height.length,
|
|
1234
1241
|
_length: newProperties.height._length,
|
|
1235
1242
|
_unit: newProperties.height._unit
|
|
1236
1243
|
});
|
|
1237
1244
|
}
|
|
1238
|
-
newProperties['height'] = new Map({
|
|
1239
|
-
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'),
|
|
1240
1247
|
_length: euro_cds[0].euro_height,
|
|
1241
1248
|
_unit: 'in'
|
|
1242
1249
|
});
|
|
1243
1250
|
}
|
|
1244
1251
|
if (newProperties.hasOwnProperty('width')) {
|
|
1245
1252
|
if (!newProperties.hasOwnProperty('oldWidth')) {
|
|
1246
|
-
newProperties['oldWidth'] = new Map({
|
|
1253
|
+
newProperties['oldWidth'] = new _immutable.Map({
|
|
1247
1254
|
length: newProperties.width.length,
|
|
1248
1255
|
_length: newProperties.width._length,
|
|
1249
1256
|
_unit: newProperties.width._unit
|
|
1250
1257
|
});
|
|
1251
1258
|
}
|
|
1252
|
-
newProperties['width'] = new Map({
|
|
1253
|
-
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,
|
|
1254
1261
|
_length: euro_cds[0].euro_width,
|
|
1255
1262
|
_unit: 'in'
|
|
1256
1263
|
});
|
|
@@ -1262,21 +1269,21 @@ var Item = /*#__PURE__*/function () {
|
|
|
1262
1269
|
}) : {};
|
|
1263
1270
|
var properties = state.scene.getIn(['layers', layerID, 'items', itemID, 'properties']).toJS();
|
|
1264
1271
|
if (properties.hasOwnProperty('oldDepth')) {
|
|
1265
|
-
properties['depth'] = new Map({
|
|
1272
|
+
properties['depth'] = new _immutable.Map({
|
|
1266
1273
|
length: properties.oldDepth.length,
|
|
1267
1274
|
_length: properties.oldDepth._length,
|
|
1268
1275
|
_unit: properties.oldDepth._unit
|
|
1269
1276
|
});
|
|
1270
1277
|
}
|
|
1271
1278
|
if (properties.hasOwnProperty('oldHeight')) {
|
|
1272
|
-
properties['height'] = new Map({
|
|
1279
|
+
properties['height'] = new _immutable.Map({
|
|
1273
1280
|
length: properties.oldHeight.length,
|
|
1274
1281
|
_length: properties.oldHeight._length,
|
|
1275
1282
|
_unit: properties.oldHeight._unit
|
|
1276
1283
|
});
|
|
1277
1284
|
}
|
|
1278
1285
|
if (properties.hasOwnProperty('oldWidth')) {
|
|
1279
|
-
properties['width'] = new Map({
|
|
1286
|
+
properties['width'] = new _immutable.Map({
|
|
1280
1287
|
length: properties.oldWidth.length,
|
|
1281
1288
|
_length: properties.oldWidth._length,
|
|
1282
1289
|
_unit: properties.oldWidth._unit
|
|
@@ -1297,10 +1304,10 @@ var Item = /*#__PURE__*/function () {
|
|
|
1297
1304
|
sku: doorStyle.sku,
|
|
1298
1305
|
color_sku_alias: doorStyle.color_sku_alias,
|
|
1299
1306
|
// alias name of color_sku for the current dealer
|
|
1300
|
-
install: getInstallationSuffix(INSTALLATION_SUFFIX_TYPE.NAME, doorStyle),
|
|
1307
|
+
install: (0, _utils.getInstallationSuffix)(_constants.INSTALLATION_SUFFIX_TYPE.NAME, doorStyle),
|
|
1301
1308
|
doorStyles: _objectSpread(_objectSpread({}, tmp), cds_data)
|
|
1302
1309
|
};
|
|
1303
|
-
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));
|
|
1304
1311
|
};
|
|
1305
1312
|
if (isAll) {
|
|
1306
1313
|
var items = state.scene.layers.get(layerID).items;
|
|
@@ -1411,7 +1418,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1411
1418
|
metalness: material.metalness,
|
|
1412
1419
|
roughness: material.roughness
|
|
1413
1420
|
});
|
|
1414
|
-
data = data.mergeIn(['doorStyle'], fromJS(tmpDS));
|
|
1421
|
+
data = data.mergeIn(['doorStyle'], (0, _immutable.fromJS)(tmpDS));
|
|
1415
1422
|
layers = layers.mergeIn(['items', itemID], data);
|
|
1416
1423
|
state = state.merge({
|
|
1417
1424
|
scene: scene.mergeIn(['layers', layerID], layers)
|
|
@@ -1508,7 +1515,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1508
1515
|
scene: scene.mergeIn(['layers', layerID], layer)
|
|
1509
1516
|
});
|
|
1510
1517
|
layer.items.toArray().forEach(function (item) {
|
|
1511
|
-
if (MoldingUtils.isEnableItemForMolding(layer, item, molding)) {
|
|
1518
|
+
if (_export2.MoldingUtils.isEnableItemForMolding(layer, item, molding)) {
|
|
1512
1519
|
var tempItemMolding = item.molding;
|
|
1513
1520
|
if (flag) {
|
|
1514
1521
|
if (tempItemMolding.some(function (mol) {
|
|
@@ -1533,8 +1540,8 @@ var Item = /*#__PURE__*/function () {
|
|
|
1533
1540
|
});
|
|
1534
1541
|
} else {
|
|
1535
1542
|
var selectedItem = layer.getIn(['items', layer.selected.toJS().items[0]]);
|
|
1536
|
-
if (MoldingUtils.isEnableItemForMolding(layer, selectedItem, molding)) {
|
|
1537
|
-
var moldingGroup = MoldingUtils.getItemGroupFromMolding(layer, selectedItem, molding);
|
|
1543
|
+
if (_export2.MoldingUtils.isEnableItemForMolding(layer, selectedItem, molding)) {
|
|
1544
|
+
var moldingGroup = _export2.MoldingUtils.getItemGroupFromMolding(layer, selectedItem, molding);
|
|
1538
1545
|
var tempSelItemMolding = selectedItem.molding;
|
|
1539
1546
|
var _flag = tempSelItemMolding.some(function (mol) {
|
|
1540
1547
|
return mol.name === molding.name;
|
|
@@ -1580,16 +1587,16 @@ var Item = /*#__PURE__*/function () {
|
|
|
1580
1587
|
var itemGroups = [];
|
|
1581
1588
|
layer.items.toArray().forEach(function (curItem) {
|
|
1582
1589
|
if (selectedItem.id !== curItem.id && curItem.category === 'cabinet') {
|
|
1583
|
-
if (MoldingUtils.isItemSnappedItem(selectedItem, curItem)) {
|
|
1590
|
+
if (_export2.MoldingUtils.isItemSnappedItem(selectedItem, curItem)) {
|
|
1584
1591
|
snappedItemGroup.push(curItem); // add the snapped item.
|
|
1585
1592
|
// add the snapped item that has same molding location type, layoutpos and height to itemGroups.
|
|
1586
1593
|
if (curItem.molding.length) {
|
|
1587
1594
|
curItem.molding.forEach(function (md) {
|
|
1588
1595
|
// This code check whether the curItem can be grouped with selected Item in molding.
|
|
1589
|
-
if (MoldingUtils.tryMergeMDItem(layer, selectedItem, curItem, [selectedItem], md)) {
|
|
1596
|
+
if (_export2.MoldingUtils.tryMergeMDItem(layer, selectedItem, curItem, [selectedItem], md)) {
|
|
1590
1597
|
itemGroups.push({
|
|
1591
1598
|
base_item: curItem,
|
|
1592
|
-
group: MoldingUtils.getItemGroupFromMolding(layer, curItem, md),
|
|
1599
|
+
group: _export2.MoldingUtils.getItemGroupFromMolding(layer, curItem, md),
|
|
1593
1600
|
molding: md
|
|
1594
1601
|
});
|
|
1595
1602
|
}
|
|
@@ -1601,11 +1608,11 @@ var Item = /*#__PURE__*/function () {
|
|
|
1601
1608
|
var updateSelectItemMolding = function updateSelectItemMolding() {
|
|
1602
1609
|
var _loop2 = function _loop2() {
|
|
1603
1610
|
// check whether snapped item is same as selected item in layoutpos(Wall, Tall, Base)
|
|
1604
|
-
if (MoldingUtils.isSameMoldingLayoutpos(selectedItem, snappedItemGroup[i])) {
|
|
1611
|
+
if (_export2.MoldingUtils.isSameMoldingLayoutpos(selectedItem, snappedItemGroup[i])) {
|
|
1605
1612
|
// check whether snapped item is same in location(same location type and height).
|
|
1606
1613
|
var delMoldings = [];
|
|
1607
1614
|
for (var k = 0; k < selectedItem.molding.length; k++) {
|
|
1608
|
-
if (MoldingUtils.isItemSameItemByLocation(selectedItem, snappedItemGroup[i], selectedItem.molding[k].location_type)) {
|
|
1615
|
+
if (_export2.MoldingUtils.isItemSameItemByLocation(selectedItem, snappedItemGroup[i], selectedItem.molding[k].location_type)) {
|
|
1609
1616
|
delMoldings.push(selectedItem.molding[k].itemID);
|
|
1610
1617
|
}
|
|
1611
1618
|
}
|
|
@@ -1656,13 +1663,13 @@ var Item = /*#__PURE__*/function () {
|
|
|
1656
1663
|
return it.molding.location_type === location;
|
|
1657
1664
|
}).sort(function (a, b) {
|
|
1658
1665
|
if (a.group.length === b.group.length) {
|
|
1659
|
-
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);
|
|
1660
1667
|
} else {
|
|
1661
1668
|
return a.group.length - b.group.length;
|
|
1662
1669
|
}
|
|
1663
1670
|
});
|
|
1664
1671
|
if (locationMolding.length) {
|
|
1665
|
-
var locationMoldingItems = MoldingUtils.getItemGroupFromMolding(layer, selectedItem, locationMolding[0].molding);
|
|
1672
|
+
var locationMoldingItems = _export2.MoldingUtils.getItemGroupFromMolding(layer, selectedItem, locationMolding[0].molding);
|
|
1666
1673
|
locationMoldingItems.forEach(function (item) {
|
|
1667
1674
|
var tempMoldings = state.getIn(['scene', 'layers', layerID, 'items', item.id, 'molding']);
|
|
1668
1675
|
if (!tempMoldings.some(function (mol) {
|
|
@@ -1673,11 +1680,11 @@ var Item = /*#__PURE__*/function () {
|
|
|
1673
1680
|
}
|
|
1674
1681
|
};
|
|
1675
1682
|
if (itemGroups.length && layer.items.some(function (it) {
|
|
1676
|
-
return MoldingUtils.isItemSnappedItem(selectedItem, it) && it.category === 'cabinet';
|
|
1683
|
+
return _export2.MoldingUtils.isItemSnappedItem(selectedItem, it) && it.category === 'cabinet';
|
|
1677
1684
|
})) {
|
|
1678
1685
|
emptyMoldingArray();
|
|
1679
|
-
for (var i = 0; i < MOLDING_LOCATIONS.length; i++) {
|
|
1680
|
-
setLocationMolding(MOLDING_LOCATIONS[i]);
|
|
1686
|
+
for (var i = 0; i < _constants.MOLDING_LOCATIONS.length; i++) {
|
|
1687
|
+
setLocationMolding(_constants.MOLDING_LOCATIONS[i]);
|
|
1681
1688
|
}
|
|
1682
1689
|
} else if (!itemGroups.length && selectedItem.molding.length) {
|
|
1683
1690
|
// Delete the selected Item's molding property if selItem attached the group that has no molding.
|
|
@@ -1778,7 +1785,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1778
1785
|
length = 0;
|
|
1779
1786
|
_length = 0;
|
|
1780
1787
|
}
|
|
1781
|
-
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({
|
|
1782
1789
|
length: length,
|
|
1783
1790
|
_length: _length,
|
|
1784
1791
|
_unit: _unit
|
|
@@ -1790,7 +1797,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1790
1797
|
}, {
|
|
1791
1798
|
key: "createHole",
|
|
1792
1799
|
value: function createHole(state, layerID, type, lineID, offset, properties) {
|
|
1793
|
-
var holeID = IDBroker.acquireID();
|
|
1800
|
+
var holeID = _export2.IDBroker.acquireID();
|
|
1794
1801
|
var hole = state.catalog.factoryElement(type, {
|
|
1795
1802
|
id: holeID,
|
|
1796
1803
|
url: state.catalog.getIn(['elements', type, 'info', 'url']),
|
|
@@ -1840,7 +1847,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
1840
1847
|
if (properties.hasOwnProperty('flip_horizontal')) {
|
|
1841
1848
|
properties['flip_horizontal'] = true;
|
|
1842
1849
|
}
|
|
1843
|
-
state = Hole.setJsProperties(state, layerID, holeID, properties).updatedState;
|
|
1850
|
+
state = _export.Hole.setJsProperties(state, layerID, holeID, properties).updatedState;
|
|
1844
1851
|
return {
|
|
1845
1852
|
updatedState: state,
|
|
1846
1853
|
hole: hole
|
|
@@ -1870,5 +1877,4 @@ var Item = /*#__PURE__*/function () {
|
|
|
1870
1877
|
};
|
|
1871
1878
|
}
|
|
1872
1879
|
}]);
|
|
1873
|
-
}();
|
|
1874
|
-
export { Item as default };
|
|
1880
|
+
}();
|