kitchen-simulator 1.1.1-test.62 → 1.1.1-test.63
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 +2 -10
- package/es/AppContext.js +3 -10
- package/es/KitchenConfigurator.js +70 -79
- package/es/KitchenConfiguratorApp.js +98 -107
- package/es/actions/area-actions.js +5 -12
- package/es/actions/export.js +12 -29
- package/es/actions/groups-actions.js +27 -45
- package/es/actions/holes-actions.js +34 -55
- package/es/actions/items-actions.js +94 -145
- package/es/actions/lines-actions.js +21 -36
- package/es/actions/project-actions.js +94 -145
- package/es/actions/scene-actions.js +11 -21
- package/es/actions/vertices-actions.js +7 -15
- package/es/actions/viewer2d-actions.js +21 -36
- package/es/actions/viewer3d-actions.js +9 -18
- package/es/catalog/areas/area/planner-element.js +2 -9
- package/es/catalog/catalog.js +15 -21
- package/es/catalog/factories/area-factory-3d.js +22 -31
- package/es/catalog/factories/area-factory.js +11 -20
- package/es/catalog/factories/export.js +6 -24
- package/es/catalog/factories/wall-factory-3d.js +31 -41
- package/es/catalog/factories/wall-factory.js +21 -31
- package/es/catalog/holes/door-closet/planner-element.js +15 -24
- package/es/catalog/holes/door-double/planner-element.js +15 -24
- package/es/catalog/holes/door-exterior/planner-element.js +16 -25
- package/es/catalog/holes/door-interior/planner-element.js +16 -25
- package/es/catalog/holes/door-panic/planner-element.js +7 -16
- package/es/catalog/holes/door-panic-double/planner-element.js +15 -24
- package/es/catalog/holes/door-sliding/planner-element.js +16 -25
- package/es/catalog/holes/doorway-framed/planner-element.js +11 -20
- package/es/catalog/holes/doorway-frameless/planner-element.js +7 -16
- package/es/catalog/holes/export.js +13 -97
- package/es/catalog/holes/window-clear/planner-element.js +10 -19
- package/es/catalog/holes/window-cross/planner-element.js +10 -19
- package/es/catalog/holes/window-double-hung/planner-element.js +10 -19
- package/es/catalog/holes/window-vertical/planner-element.js +10 -19
- package/es/catalog/lines/wall/planner-element.js +2 -9
- package/es/catalog/molding/molding-dcm/planner-element.js +5 -14
- package/es/catalog/molding/molding-fbm/planner-element.js +5 -14
- package/es/catalog/molding/molding-lrm/planner-element.js +5 -14
- package/es/catalog/properties/export.js +20 -80
- package/es/catalog/properties/property-checkbox.js +24 -31
- package/es/catalog/properties/property-color.js +16 -23
- package/es/catalog/properties/property-enum.js +24 -31
- package/es/catalog/properties/property-hidden.js +9 -16
- package/es/catalog/properties/property-lenght-measure.js +38 -45
- package/es/catalog/properties/property-length-measure.js +36 -43
- package/es/catalog/properties/property-length-measure_hole.js +38 -45
- package/es/catalog/properties/property-number.js +17 -24
- package/es/catalog/properties/property-read-only.js +16 -23
- package/es/catalog/properties/property-string.js +16 -23
- package/es/catalog/properties/property-toggle.js +16 -23
- package/es/catalog/properties/shared-property-style.js +1 -7
- package/es/catalog/utils/FuseUtils.js +8 -15
- package/es/catalog/utils/exporter.js +8 -15
- package/es/catalog/utils/geom-utils.js +13 -29
- package/es/catalog/utils/item-loader.js +84 -97
- package/es/catalog/utils/load-obj.js +20 -28
- package/es/catalog/utils/mtl-loader.js +3 -8
- package/es/catalog/utils/obj-loader.js +3 -8
- package/es/class/FuseUtils.js +8 -15
- package/es/class/area.js +22 -28
- package/es/class/export.js +23 -95
- package/es/class/group.js +53 -59
- package/es/class/guide.js +15 -21
- package/es/class/hole.js +83 -89
- package/es/class/item.js +141 -147
- package/es/class/layer.js +59 -65
- package/es/class/line.js +135 -143
- package/es/class/project.js +90 -98
- package/es/class/vertex.js +29 -35
- package/es/components/content.js +19 -28
- package/es/components/disclaimer/disclaimer.js +10 -18
- package/es/components/export.js +8 -32
- package/es/components/style/button.js +23 -31
- package/es/components/style/cancel-button.js +7 -14
- package/es/components/style/content-container.js +9 -16
- package/es/components/style/content-title.js +11 -20
- package/es/components/style/delete-button.js +8 -17
- package/es/components/style/export.js +30 -120
- package/es/components/style/form-block.js +8 -15
- package/es/components/style/form-color-input.js +7 -14
- package/es/components/style/form-label.js +8 -15
- package/es/components/style/form-number-input.js +41 -49
- package/es/components/style/form-number-input_2.js +36 -44
- package/es/components/style/form-select.js +17 -24
- package/es/components/style/form-slider.js +10 -17
- package/es/components/style/form-submit-button.js +8 -17
- package/es/components/style/form-text-input.js +26 -34
- package/es/components/viewer2d/area.js +17 -24
- package/es/components/viewer2d/export.js +30 -120
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +10 -17
- package/es/components/viewer2d/grids/grid-streak.js +10 -17
- package/es/components/viewer2d/grids/grid-vertical-streak.js +10 -17
- package/es/components/viewer2d/grids/grids.js +10 -19
- package/es/components/viewer2d/group.js +15 -24
- package/es/components/viewer2d/item.js +61 -70
- package/es/components/viewer2d/layer.js +23 -30
- package/es/components/viewer2d/line.js +101 -111
- package/es/components/viewer2d/ruler.js +22 -29
- package/es/components/viewer2d/rulerDist.js +21 -28
- package/es/components/viewer2d/rulerX.js +39 -47
- package/es/components/viewer2d/rulerY.js +37 -45
- package/es/components/viewer2d/scene.js +30 -38
- package/es/components/viewer2d/snap.js +13 -22
- package/es/components/viewer2d/state.js +18 -27
- package/es/components/viewer2d/utils.js +24 -37
- package/es/components/viewer2d/vertex.js +8 -17
- package/es/components/viewer2d/viewer2d.js +153 -163
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +17 -23
- package/es/components/viewer3d/dcm.js +1 -7
- package/es/components/viewer3d/fbm.js +1 -7
- package/es/components/viewer3d/front3D.js +12 -21
- package/es/components/viewer3d/grid-creator.js +8 -17
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +6 -14
- package/es/components/viewer3d/grids/grid-streak.js +5 -13
- package/es/components/viewer3d/grids/grid-vertical-streak.js +6 -14
- package/es/components/viewer3d/libs/first-person-controls.js +2 -9
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +1 -7
- package/es/components/viewer3d/libs/mtl-loader.js +1 -7
- package/es/components/viewer3d/libs/obj-loader.js +1 -7
- package/es/components/viewer3d/libs/orbit-controls.js +2 -8
- package/es/components/viewer3d/libs/pointer-lock-controls.js +2 -8
- package/es/components/viewer3d/lrm.js +1 -7
- package/es/components/viewer3d/model.js +1 -7
- package/es/components/viewer3d/pointer-lock-navigation.js +3 -10
- package/es/components/viewer3d/ruler-utils/itemRect.js +18 -25
- package/es/components/viewer3d/ruler-utils/layer3D.js +59 -66
- package/es/components/viewer3d/ruler-utils/ruler3D.js +39 -46
- package/es/components/viewer3d/ruler-utils/scene3D.js +9 -17
- package/es/components/viewer3d/ruler-utils/state3D.js +4 -11
- package/es/components/viewer3d/scene-creator.js +191 -226
- package/es/components/viewer3d/three-memory-cleaner.js +3 -12
- package/es/components/viewer3d/viewer3d-first-person.js +40 -46
- package/es/components/viewer3d/viewer3d.js +196 -202
- package/es/constants.js +349 -358
- package/es/index.js +7 -15
- package/es/models.js +177 -184
- package/es/plugins/SVGLoader.js +48 -53
- package/es/plugins/autosave.js +3 -9
- package/es/plugins/console-debugger.js +5 -12
- package/es/plugins/export.js +8 -32
- package/es/plugins/keyboard.js +29 -35
- package/es/reducers/areas-reducer.js +7 -13
- package/es/reducers/export.js +24 -96
- package/es/reducers/groups-reducer.js +31 -37
- package/es/reducers/holes-reducer.js +43 -49
- package/es/reducers/items-reducer.js +106 -112
- package/es/reducers/lines-reducer.js +28 -34
- package/es/reducers/project-reducer.js +105 -111
- package/es/reducers/reducer.js +16 -23
- package/es/reducers/scene-reducer.js +15 -21
- package/es/reducers/user-reducer.js +5 -11
- package/es/reducers/vertices-reducer.js +11 -17
- package/es/reducers/viewer2d-reducer.js +18 -24
- package/es/reducers/viewer3d-reducer.js +16 -22
- package/es/shared-style.js +10 -16
- package/es/styles/export.js +3 -11
- package/es/translator/en.js +1 -7
- package/es/translator/it.js +1 -7
- package/es/translator/ru.js +1 -7
- package/es/translator/translator.js +13 -19
- package/es/utils/browser.js +2 -9
- package/es/utils/convert-units-lite.js +1 -7
- package/es/utils/email-validator.js +1 -7
- package/es/utils/export.js +15 -46
- package/es/utils/geometry.js +181 -278
- package/es/utils/get-edges-of-subgraphs.js +2 -9
- package/es/utils/graph-cycles.js +8 -11
- package/es/utils/graph-inner-cycles.js +10 -18
- package/es/utils/graph.js +9 -17
- package/es/utils/helper.js +39 -63
- package/es/utils/history.js +8 -15
- package/es/utils/id-broker.js +8 -15
- package/es/utils/logger.js +1 -7
- package/es/utils/math.js +5 -12
- package/es/utils/molding.js +119 -144
- package/es/utils/name-generator.js +7 -13
- package/es/utils/objects-utils.js +7 -19
- package/es/utils/phone-validator.js +1 -7
- package/es/utils/process-black-list.js +3 -10
- package/es/utils/react-if.js +6 -12
- package/es/utils/snap-scene.js +27 -34
- package/es/utils/snap.js +45 -59
- package/es/utils/summarizeCart.js +1 -7
- package/es/utils/threeCSG.es6.js +13 -22
- package/es/version.js +1 -7
- package/package.json +1 -1
package/es/index.js
CHANGED
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = void 0;
|
|
8
|
-
exports.renderKitchenSimulator = renderKitchenSimulator;
|
|
9
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
var _KitchenConfiguratorApp = _interopRequireDefault(require("./KitchenConfiguratorApp"));
|
|
12
|
-
function renderKitchenSimulator(container) {
|
|
1
|
+
import ReactDOM from 'react-dom';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import KitchenConfiguratorApp from "./KitchenConfiguratorApp";
|
|
4
|
+
export function renderKitchenSimulator(container) {
|
|
13
5
|
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
14
|
-
var root =
|
|
6
|
+
var root = ReactDOM.render(/*#__PURE__*/React.createElement(KitchenConfiguratorApp, props), container);
|
|
15
7
|
return {
|
|
16
8
|
root: root,
|
|
17
9
|
unmount: function unmount() {
|
|
18
|
-
|
|
10
|
+
ReactDOM.unmountComponentAtNode(container);
|
|
19
11
|
}
|
|
20
12
|
};
|
|
21
13
|
}
|
|
22
|
-
|
|
14
|
+
export default renderKitchenSimulator;
|
package/es/models.js
CHANGED
|
@@ -1,46 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports["default"] = exports.Vertex = exports.State = exports.Scene = exports.Line = exports.Layer = exports.Item = exports.Hole = exports.HistoryStructure = exports.Group = exports.Grid = exports.ElementsSet = exports.DefaultLayers = exports.DefaultGrids = exports.CatalogElement = exports.Catalog = exports.Area = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
|
-
var _immutable = require("immutable");
|
|
15
|
-
var _constants = require("./constants");
|
|
16
|
-
var _snap = require("./utils/snap");
|
|
17
|
-
var _helper = require("./utils/helper");
|
|
18
|
-
var _convertUnitsLite = require("./utils/convert-units-lite");
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
19
7
|
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; }
|
|
20
|
-
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) { (
|
|
21
|
-
function _callSuper(t, o, e) { return o = (
|
|
8
|
+
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) { _defineProperty(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; }
|
|
9
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
22
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
+
import { fromJS, List, Map, Record } from 'immutable';
|
|
12
|
+
import { MODE_IDLE, UNIT_INCH } from "./constants";
|
|
13
|
+
import { SNAP_MASK } from "./utils/snap";
|
|
14
|
+
import { isEmpty } from "./utils/helper";
|
|
15
|
+
import { convert } from "./utils/convert-units-lite";
|
|
23
16
|
var safeLoadMapList = function safeLoadMapList(mapList, Model, defaultMap) {
|
|
24
|
-
return mapList ? new
|
|
17
|
+
return mapList ? new Map(mapList).map(function (m) {
|
|
25
18
|
return new Model(m);
|
|
26
|
-
}).toMap() : defaultMap || new
|
|
19
|
+
}).toMap() : defaultMap || new Map();
|
|
27
20
|
};
|
|
28
|
-
var Grid =
|
|
21
|
+
export var Grid = /*#__PURE__*/function (_Record) {
|
|
29
22
|
function Grid() {
|
|
30
23
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
31
|
-
(
|
|
24
|
+
_classCallCheck(this, Grid);
|
|
32
25
|
return _callSuper(this, Grid, [_objectSpread(_objectSpread({}, json), {}, {
|
|
33
|
-
properties:
|
|
26
|
+
properties: fromJS(json.properties || {})
|
|
34
27
|
})]);
|
|
35
28
|
}
|
|
36
|
-
(
|
|
37
|
-
return (
|
|
38
|
-
}(
|
|
29
|
+
_inherits(Grid, _Record);
|
|
30
|
+
return _createClass(Grid);
|
|
31
|
+
}(Record({
|
|
39
32
|
id: '',
|
|
40
33
|
type: '',
|
|
41
|
-
properties:
|
|
34
|
+
properties: Map()
|
|
42
35
|
}, 'Grid'));
|
|
43
|
-
var DefaultGrids =
|
|
36
|
+
export var DefaultGrids = new Map({
|
|
44
37
|
h1: new Grid({
|
|
45
38
|
id: 'h1',
|
|
46
39
|
type: 'horizontal-streak',
|
|
@@ -58,94 +51,94 @@ var DefaultGrids = exports.DefaultGrids = new _immutable.Map({
|
|
|
58
51
|
}
|
|
59
52
|
})
|
|
60
53
|
});
|
|
61
|
-
var ElementsSet =
|
|
54
|
+
export var ElementsSet = /*#__PURE__*/function (_Record2) {
|
|
62
55
|
function ElementsSet() {
|
|
63
56
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
64
|
-
(
|
|
57
|
+
_classCallCheck(this, ElementsSet);
|
|
65
58
|
return _callSuper(this, ElementsSet, [{
|
|
66
|
-
vertices: new
|
|
67
|
-
lines: new
|
|
68
|
-
holes: new
|
|
69
|
-
areas: new
|
|
70
|
-
items: new
|
|
59
|
+
vertices: new List(json.vertices || []),
|
|
60
|
+
lines: new List(json.lines || []),
|
|
61
|
+
holes: new List(json.holes || []),
|
|
62
|
+
areas: new List(json.areas || []),
|
|
63
|
+
items: new List(json.items || [])
|
|
71
64
|
}]);
|
|
72
65
|
}
|
|
73
|
-
(
|
|
74
|
-
return (
|
|
75
|
-
}(
|
|
76
|
-
vertices: new
|
|
77
|
-
lines: new
|
|
78
|
-
holes: new
|
|
79
|
-
areas: new
|
|
80
|
-
items: new
|
|
66
|
+
_inherits(ElementsSet, _Record2);
|
|
67
|
+
return _createClass(ElementsSet);
|
|
68
|
+
}(Record({
|
|
69
|
+
vertices: new List(),
|
|
70
|
+
lines: new List(),
|
|
71
|
+
holes: new List(),
|
|
72
|
+
areas: new List(),
|
|
73
|
+
items: new List()
|
|
81
74
|
}, 'ElementsSet'));
|
|
82
75
|
var sharedAttributes = {
|
|
83
76
|
id: '',
|
|
84
77
|
type: '',
|
|
85
78
|
prototype: '',
|
|
86
79
|
name: '',
|
|
87
|
-
misc: new
|
|
80
|
+
misc: new Map(),
|
|
88
81
|
selected: false,
|
|
89
|
-
properties: new
|
|
82
|
+
properties: new Map(),
|
|
90
83
|
style: '',
|
|
91
84
|
category: '',
|
|
92
85
|
visible: true
|
|
93
86
|
};
|
|
94
|
-
var Vertex =
|
|
87
|
+
export var Vertex = /*#__PURE__*/function (_Record3) {
|
|
95
88
|
function Vertex() {
|
|
96
89
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
97
|
-
(
|
|
90
|
+
_classCallCheck(this, Vertex);
|
|
98
91
|
return _callSuper(this, Vertex, [_objectSpread(_objectSpread({}, json), {}, {
|
|
99
|
-
lines: new
|
|
100
|
-
areas: new
|
|
92
|
+
lines: new List(json.lines || []),
|
|
93
|
+
areas: new List(json.areas || [])
|
|
101
94
|
})]);
|
|
102
95
|
}
|
|
103
|
-
(
|
|
104
|
-
return (
|
|
105
|
-
}(
|
|
96
|
+
_inherits(Vertex, _Record3);
|
|
97
|
+
return _createClass(Vertex);
|
|
98
|
+
}(Record(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
106
99
|
x: -1,
|
|
107
100
|
y: -1,
|
|
108
101
|
prototype: 'vertices',
|
|
109
|
-
lines: new
|
|
110
|
-
areas: new
|
|
102
|
+
lines: new List(),
|
|
103
|
+
areas: new List()
|
|
111
104
|
}), 'Vertex'));
|
|
112
|
-
var Line =
|
|
105
|
+
export var Line = /*#__PURE__*/function (_Record4) {
|
|
113
106
|
function Line() {
|
|
114
107
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
115
|
-
(
|
|
108
|
+
_classCallCheck(this, Line);
|
|
116
109
|
return _callSuper(this, Line, [_objectSpread(_objectSpread({}, json), {}, {
|
|
117
110
|
createdDateTime: json.createdDateTime !== undefined ? json.createdDateTime : new Date().getTime(),
|
|
118
|
-
properties:
|
|
119
|
-
vertices: new
|
|
120
|
-
holes: new
|
|
121
|
-
relatedVertices: new
|
|
111
|
+
properties: fromJS(json.properties || {}),
|
|
112
|
+
vertices: new List(json.vertices || []),
|
|
113
|
+
holes: new List(json.holes || []),
|
|
114
|
+
relatedVertices: new List(json.relatedVertices || []),
|
|
122
115
|
userData: {}
|
|
123
116
|
})]);
|
|
124
117
|
}
|
|
125
|
-
(
|
|
126
|
-
return (
|
|
127
|
-
}(
|
|
118
|
+
_inherits(Line, _Record4);
|
|
119
|
+
return _createClass(Line);
|
|
120
|
+
}(Record(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
128
121
|
createdDateTime: new Date().getTime(),
|
|
129
122
|
prototype: 'lines',
|
|
130
|
-
vertices: new
|
|
131
|
-
relatedVertices: new
|
|
132
|
-
holes: new
|
|
123
|
+
vertices: new List(),
|
|
124
|
+
relatedVertices: new List(),
|
|
125
|
+
holes: new List(),
|
|
133
126
|
focus: false,
|
|
134
127
|
wallColor: '#dddddd',
|
|
135
128
|
userData: {}
|
|
136
129
|
}), 'Line'));
|
|
137
|
-
var Hole =
|
|
130
|
+
export var Hole = /*#__PURE__*/function (_Record5) {
|
|
138
131
|
function Hole() {
|
|
139
132
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
140
|
-
(
|
|
133
|
+
_classCallCheck(this, Hole);
|
|
141
134
|
return _callSuper(this, Hole, [_objectSpread(_objectSpread({}, json), {}, {
|
|
142
|
-
properties:
|
|
135
|
+
properties: fromJS(json.properties || {}),
|
|
143
136
|
userData: {}
|
|
144
137
|
})]);
|
|
145
138
|
}
|
|
146
|
-
(
|
|
147
|
-
return (
|
|
148
|
-
}(
|
|
139
|
+
_inherits(Hole, _Record5);
|
|
140
|
+
return _createClass(Hole);
|
|
141
|
+
}(Record(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
149
142
|
prototype: 'holes',
|
|
150
143
|
offset: -1,
|
|
151
144
|
x: 0,
|
|
@@ -155,45 +148,45 @@ var Hole = exports.Hole = /*#__PURE__*/function (_Record5) {
|
|
|
155
148
|
url: '',
|
|
156
149
|
userData: {}
|
|
157
150
|
}), 'Hole'));
|
|
158
|
-
var Area =
|
|
151
|
+
export var Area = /*#__PURE__*/function (_Record6) {
|
|
159
152
|
function Area() {
|
|
160
153
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
161
|
-
(
|
|
154
|
+
_classCallCheck(this, Area);
|
|
162
155
|
return _callSuper(this, Area, [_objectSpread(_objectSpread({}, json), {}, {
|
|
163
|
-
properties:
|
|
164
|
-
vertices: new
|
|
156
|
+
properties: fromJS(json.properties || {}),
|
|
157
|
+
vertices: new List(json.vertices || [])
|
|
165
158
|
})]);
|
|
166
159
|
}
|
|
167
|
-
(
|
|
168
|
-
return (
|
|
169
|
-
}(
|
|
160
|
+
_inherits(Area, _Record6);
|
|
161
|
+
return _createClass(Area);
|
|
162
|
+
}(Record(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
170
163
|
prototype: 'areas',
|
|
171
|
-
vertices: new
|
|
172
|
-
holes: new
|
|
164
|
+
vertices: new List(),
|
|
165
|
+
holes: new List(),
|
|
173
166
|
texture: {
|
|
174
167
|
roughness: 0.9,
|
|
175
168
|
metalness: 0,
|
|
176
169
|
uri: ''
|
|
177
170
|
}
|
|
178
171
|
}), 'Area'));
|
|
179
|
-
var Item =
|
|
172
|
+
export var Item = /*#__PURE__*/function (_Record7) {
|
|
180
173
|
function Item() {
|
|
181
174
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
182
|
-
(
|
|
175
|
+
_classCallCheck(this, Item);
|
|
183
176
|
return _callSuper(this, Item, [_objectSpread(_objectSpread({}, json), {}, {
|
|
184
|
-
properties:
|
|
177
|
+
properties: fromJS(json.properties || {})
|
|
185
178
|
})]);
|
|
186
179
|
}
|
|
187
|
-
(
|
|
188
|
-
return (
|
|
189
|
-
}(
|
|
180
|
+
_inherits(Item, _Record7);
|
|
181
|
+
return _createClass(Item);
|
|
182
|
+
}(Record(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
190
183
|
prototype: 'items',
|
|
191
184
|
x: 0,
|
|
192
185
|
y: 0,
|
|
193
186
|
rotation: 0,
|
|
194
|
-
submodule: new
|
|
195
|
-
normalMap: new
|
|
196
|
-
doorStyle: new
|
|
187
|
+
submodule: new List(),
|
|
188
|
+
normalMap: new List(),
|
|
189
|
+
doorStyle: new Map(),
|
|
197
190
|
animate: 0,
|
|
198
191
|
animValue: 0,
|
|
199
192
|
itemID: -1,
|
|
@@ -213,10 +206,10 @@ var Item = exports.Item = /*#__PURE__*/function (_Record7) {
|
|
|
213
206
|
},
|
|
214
207
|
distArray: [[0, 0], [0, 0], [0, 0], [0, 0]]
|
|
215
208
|
}), 'Item'));
|
|
216
|
-
var Layer =
|
|
209
|
+
export var Layer = /*#__PURE__*/function (_Record8) {
|
|
217
210
|
function Layer() {
|
|
218
211
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
219
|
-
(
|
|
212
|
+
_classCallCheck(this, Layer);
|
|
220
213
|
return _callSuper(this, Layer, [_objectSpread(_objectSpread({}, json), {}, {
|
|
221
214
|
vertices: safeLoadMapList(json.vertices, Vertex),
|
|
222
215
|
lines: safeLoadMapList(json.lines, Line),
|
|
@@ -227,20 +220,20 @@ var Layer = exports.Layer = /*#__PURE__*/function (_Record8) {
|
|
|
227
220
|
selected: new ElementsSet(json.selected)
|
|
228
221
|
})]);
|
|
229
222
|
}
|
|
230
|
-
(
|
|
231
|
-
return (
|
|
232
|
-
}(
|
|
223
|
+
_inherits(Layer, _Record8);
|
|
224
|
+
return _createClass(Layer);
|
|
225
|
+
}(Record({
|
|
233
226
|
id: '',
|
|
234
227
|
altitude: 0,
|
|
235
228
|
order: 0,
|
|
236
229
|
opacity: 1,
|
|
237
230
|
name: '',
|
|
238
231
|
visible: true,
|
|
239
|
-
vertices: new
|
|
240
|
-
lines: new
|
|
241
|
-
holes: new
|
|
242
|
-
areas: new
|
|
243
|
-
items: new
|
|
232
|
+
vertices: new Map(),
|
|
233
|
+
lines: new Map(),
|
|
234
|
+
holes: new Map(),
|
|
235
|
+
areas: new Map(),
|
|
236
|
+
items: new Map(),
|
|
244
237
|
selected: new ElementsSet(),
|
|
245
238
|
counterTop: {},
|
|
246
239
|
wallColor: {},
|
|
@@ -255,36 +248,36 @@ var Layer = exports.Layer = /*#__PURE__*/function (_Record8) {
|
|
|
255
248
|
},
|
|
256
249
|
backsplashApplied: false,
|
|
257
250
|
ceilHeight: 96,
|
|
258
|
-
unit:
|
|
251
|
+
unit: UNIT_INCH
|
|
259
252
|
}, 'Layer'));
|
|
260
|
-
var Group =
|
|
253
|
+
export var Group = /*#__PURE__*/function (_Record9) {
|
|
261
254
|
function Group() {
|
|
262
255
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
263
|
-
(
|
|
256
|
+
_classCallCheck(this, Group);
|
|
264
257
|
return _callSuper(this, Group, [_objectSpread(_objectSpread({}, json), {}, {
|
|
265
|
-
properties:
|
|
266
|
-
elements:
|
|
258
|
+
properties: fromJS(json.properties || {}),
|
|
259
|
+
elements: fromJS(json.elements || {})
|
|
267
260
|
})]);
|
|
268
261
|
}
|
|
269
|
-
(
|
|
270
|
-
return (
|
|
271
|
-
}(
|
|
262
|
+
_inherits(Group, _Record9);
|
|
263
|
+
return _createClass(Group);
|
|
264
|
+
}(Record(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
272
265
|
prototype: 'groups',
|
|
273
266
|
x: 0,
|
|
274
267
|
y: 0,
|
|
275
268
|
rotation: 0,
|
|
276
|
-
elements: new
|
|
269
|
+
elements: new Map()
|
|
277
270
|
}), 'Group'));
|
|
278
|
-
var DefaultLayers =
|
|
271
|
+
export var DefaultLayers = new Map({
|
|
279
272
|
'layer-1': new Layer({
|
|
280
273
|
id: 'layer-1',
|
|
281
274
|
name: 'default'
|
|
282
275
|
})
|
|
283
276
|
});
|
|
284
|
-
var Scene =
|
|
277
|
+
export var Scene = /*#__PURE__*/function (_Record0) {
|
|
285
278
|
function Scene() {
|
|
286
279
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
287
|
-
(
|
|
280
|
+
_classCallCheck(this, Scene);
|
|
288
281
|
var layers = safeLoadMapList(json.layers, Layer, DefaultLayers);
|
|
289
282
|
return _callSuper(this, Scene, [_objectSpread(_objectSpread({}, json), {}, {
|
|
290
283
|
// grids: safeLoadMapList(json.grids, Grid, DefaultGrids),
|
|
@@ -292,28 +285,28 @@ var Scene = exports.Scene = /*#__PURE__*/function (_Record0) {
|
|
|
292
285
|
layers: layers,
|
|
293
286
|
selectedLayer: layers.first().id,
|
|
294
287
|
groups: safeLoadMapList(json.groups || {}, Group),
|
|
295
|
-
meta: json.meta ?
|
|
296
|
-
guides: !
|
|
297
|
-
horizontal: new
|
|
298
|
-
vertical: new
|
|
299
|
-
circular: new
|
|
288
|
+
meta: json.meta ? fromJS(json.meta) : new Map(),
|
|
289
|
+
guides: !isEmpty(json.guides) ? fromJS(json.guides) : new Map({
|
|
290
|
+
horizontal: new Map(),
|
|
291
|
+
vertical: new Map(),
|
|
292
|
+
circular: new Map()
|
|
300
293
|
})
|
|
301
294
|
})]);
|
|
302
295
|
}
|
|
303
|
-
(
|
|
304
|
-
return (
|
|
305
|
-
}(
|
|
296
|
+
_inherits(Scene, _Record0);
|
|
297
|
+
return _createClass(Scene);
|
|
298
|
+
}(Record({
|
|
306
299
|
unit: 'cm',
|
|
307
300
|
rulerUnit: 'in',
|
|
308
|
-
layers: new
|
|
309
|
-
grids: new
|
|
301
|
+
layers: new Map(),
|
|
302
|
+
grids: new Map(),
|
|
310
303
|
selectedLayer: null,
|
|
311
|
-
groups: new
|
|
304
|
+
groups: new Map(),
|
|
312
305
|
width: 3000,
|
|
313
306
|
height: 2000,
|
|
314
|
-
meta: new
|
|
307
|
+
meta: new Map(),
|
|
315
308
|
//additional info
|
|
316
|
-
guides: new
|
|
309
|
+
guides: new Map(),
|
|
317
310
|
title: '',
|
|
318
311
|
currentProjectID: null,
|
|
319
312
|
showfg: true,
|
|
@@ -326,39 +319,39 @@ var Scene = exports.Scene = /*#__PURE__*/function (_Record0) {
|
|
|
326
319
|
isEndDragging: false,
|
|
327
320
|
setLineAttributes: false
|
|
328
321
|
}, 'Scene'));
|
|
329
|
-
var CatalogElement =
|
|
322
|
+
export var CatalogElement = /*#__PURE__*/function (_Record1) {
|
|
330
323
|
function CatalogElement() {
|
|
331
324
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
332
|
-
(
|
|
325
|
+
_classCallCheck(this, CatalogElement);
|
|
333
326
|
return _callSuper(this, CatalogElement, [_objectSpread(_objectSpread({}, json), {}, {
|
|
334
|
-
info:
|
|
335
|
-
properties:
|
|
336
|
-
obj:
|
|
327
|
+
info: fromJS(json.info),
|
|
328
|
+
properties: fromJS(json.properties),
|
|
329
|
+
obj: fromJS(json.obj)
|
|
337
330
|
})]);
|
|
338
331
|
}
|
|
339
|
-
(
|
|
340
|
-
return (
|
|
341
|
-
}(
|
|
332
|
+
_inherits(CatalogElement, _Record1);
|
|
333
|
+
return _createClass(CatalogElement);
|
|
334
|
+
}(Record({
|
|
342
335
|
itemID: -1,
|
|
343
336
|
name: '',
|
|
344
337
|
prototype: '',
|
|
345
|
-
info: new
|
|
346
|
-
properties: new
|
|
347
|
-
obj: new
|
|
338
|
+
info: new Map(),
|
|
339
|
+
properties: new Map(),
|
|
340
|
+
obj: new Map(),
|
|
348
341
|
type: ''
|
|
349
342
|
}, 'CatalogElement'));
|
|
350
|
-
var Catalog =
|
|
343
|
+
export var Catalog = /*#__PURE__*/function (_Record10) {
|
|
351
344
|
function Catalog() {
|
|
352
345
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
353
|
-
(
|
|
346
|
+
_classCallCheck(this, Catalog);
|
|
354
347
|
var elements = safeLoadMapList(json.elements, CatalogElement);
|
|
355
348
|
return _callSuper(this, Catalog, [{
|
|
356
349
|
elements: elements,
|
|
357
350
|
ready: !elements.isEmpty()
|
|
358
351
|
}]);
|
|
359
352
|
}
|
|
360
|
-
(
|
|
361
|
-
return (
|
|
353
|
+
_inherits(Catalog, _Record10);
|
|
354
|
+
return _createClass(Catalog, [{
|
|
362
355
|
key: "factoryElement",
|
|
363
356
|
value: function factoryElement(type, options, initialProperties, state) {
|
|
364
357
|
if (!this.elements.has(type)) {
|
|
@@ -392,20 +385,20 @@ var Catalog = exports.Catalog = /*#__PURE__*/function (_Record10) {
|
|
|
392
385
|
depth: element.getIn(['info', 'sizeinfo', 'depth'])
|
|
393
386
|
};
|
|
394
387
|
var _sizeinfo = {
|
|
395
|
-
width: new
|
|
388
|
+
width: new Map({
|
|
396
389
|
_length: temp.width,
|
|
397
390
|
_unit: 'in',
|
|
398
|
-
length:
|
|
391
|
+
length: convert(temp.width).from('in').to('cm')
|
|
399
392
|
}),
|
|
400
|
-
height: new
|
|
393
|
+
height: new Map({
|
|
401
394
|
_length: temp.height,
|
|
402
395
|
_unit: 'in',
|
|
403
|
-
length:
|
|
396
|
+
length: convert(temp.height).from('in').to('cm')
|
|
404
397
|
}),
|
|
405
|
-
depth: new
|
|
398
|
+
depth: new Map({
|
|
406
399
|
_length: temp.depth,
|
|
407
400
|
_unit: 'in',
|
|
408
|
-
length:
|
|
401
|
+
length: convert(temp.depth).from('in').to('cm')
|
|
409
402
|
})
|
|
410
403
|
};
|
|
411
404
|
properties = properties.set('width', _sizeinfo.width).set('height', _sizeinfo.height).set('depth', _sizeinfo.depth);
|
|
@@ -433,72 +426,72 @@ var Catalog = exports.Catalog = /*#__PURE__*/function (_Record10) {
|
|
|
433
426
|
}
|
|
434
427
|
}
|
|
435
428
|
}]);
|
|
436
|
-
}(
|
|
429
|
+
}(Record({
|
|
437
430
|
ready: false,
|
|
438
431
|
page: 'root',
|
|
439
|
-
path: new
|
|
440
|
-
elements: new
|
|
432
|
+
path: new List(),
|
|
433
|
+
elements: new Map()
|
|
441
434
|
}, 'Catalog'));
|
|
442
|
-
var HistoryStructure =
|
|
435
|
+
export var HistoryStructure = /*#__PURE__*/function (_Record11) {
|
|
443
436
|
function HistoryStructure() {
|
|
444
437
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
445
|
-
(
|
|
438
|
+
_classCallCheck(this, HistoryStructure);
|
|
446
439
|
return _callSuper(this, HistoryStructure, [{
|
|
447
|
-
list:
|
|
440
|
+
list: fromJS(json.list || []),
|
|
448
441
|
first: new Scene(json.scene),
|
|
449
442
|
last: new Scene(json.last || json.scene)
|
|
450
443
|
}]);
|
|
451
444
|
}
|
|
452
|
-
(
|
|
453
|
-
return (
|
|
454
|
-
}(
|
|
455
|
-
list: new
|
|
445
|
+
_inherits(HistoryStructure, _Record11);
|
|
446
|
+
return _createClass(HistoryStructure);
|
|
447
|
+
}(Record({
|
|
448
|
+
list: new List(),
|
|
456
449
|
first: null,
|
|
457
450
|
last: null
|
|
458
451
|
}, 'HistoryStructure'));
|
|
459
|
-
var State =
|
|
452
|
+
export var State = /*#__PURE__*/function (_Record12) {
|
|
460
453
|
function State() {
|
|
461
454
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
462
|
-
(
|
|
455
|
+
_classCallCheck(this, State);
|
|
463
456
|
return _callSuper(this, State, [_objectSpread(_objectSpread({}, json), {}, {
|
|
464
457
|
scene: new Scene(json.scene),
|
|
465
458
|
sceneHistory: new HistoryStructure(json),
|
|
466
459
|
catalog: new Catalog(json.catalog || {}),
|
|
467
|
-
viewer2D: new
|
|
468
|
-
replacingSupport: new
|
|
469
|
-
drawingSupport: new
|
|
470
|
-
draggingSupport: new
|
|
471
|
-
rotatingSupport: new
|
|
472
|
-
misc: json.misc ?
|
|
460
|
+
viewer2D: new Map(json.viewer2D || {}),
|
|
461
|
+
replacingSupport: new Map(json.drawingSupport || {}),
|
|
462
|
+
drawingSupport: new Map(json.drawingSupport || {}),
|
|
463
|
+
draggingSupport: new Map(json.draggingSupport || {}),
|
|
464
|
+
rotatingSupport: new Map(json.rotatingSupport || {}),
|
|
465
|
+
misc: json.misc ? fromJS(json.misc) : new Map()
|
|
473
466
|
})]);
|
|
474
467
|
}
|
|
475
|
-
(
|
|
476
|
-
return (
|
|
477
|
-
}(
|
|
478
|
-
mode:
|
|
468
|
+
_inherits(State, _Record12);
|
|
469
|
+
return _createClass(State);
|
|
470
|
+
}(Record({
|
|
471
|
+
mode: MODE_IDLE,
|
|
479
472
|
scene: new Scene(),
|
|
480
473
|
sceneHistory: new HistoryStructure(),
|
|
481
474
|
catalog: new Catalog(),
|
|
482
|
-
viewer2D: new
|
|
483
|
-
mouse: new
|
|
475
|
+
viewer2D: new Map(),
|
|
476
|
+
mouse: new Map({
|
|
484
477
|
x: 0,
|
|
485
478
|
y: 0
|
|
486
479
|
}),
|
|
487
480
|
zoom: 0,
|
|
488
|
-
snapMask:
|
|
489
|
-
snapElements: new
|
|
481
|
+
snapMask: SNAP_MASK,
|
|
482
|
+
snapElements: new List(),
|
|
490
483
|
activeSnapElement: null,
|
|
491
|
-
replacingSupport: new
|
|
492
|
-
drawingSupport: new
|
|
493
|
-
draggingSupport: new
|
|
494
|
-
rotatingSupport: new
|
|
484
|
+
replacingSupport: new Map(),
|
|
485
|
+
drawingSupport: new Map(),
|
|
486
|
+
draggingSupport: new Map(),
|
|
487
|
+
rotatingSupport: new Map(),
|
|
495
488
|
doorStyle: null,
|
|
496
489
|
oStyle: null,
|
|
497
|
-
errors: new
|
|
498
|
-
warnings: new
|
|
499
|
-
clipboardProperties: new
|
|
500
|
-
selectedElementsHistory: new
|
|
501
|
-
misc: new
|
|
490
|
+
errors: new List(),
|
|
491
|
+
warnings: new List(),
|
|
492
|
+
clipboardProperties: new Map(),
|
|
493
|
+
selectedElementsHistory: new List(),
|
|
494
|
+
misc: new Map(),
|
|
502
495
|
//additional info
|
|
503
496
|
alterate: false,
|
|
504
497
|
isOpen: false,
|
|
@@ -509,4 +502,4 @@ var State = exports.State = /*#__PURE__*/function (_Record12) {
|
|
|
509
502
|
isHelp: false,
|
|
510
503
|
isCabinetDrawing: false
|
|
511
504
|
}, 'State'));
|
|
512
|
-
|
|
505
|
+
export default State;
|