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