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