kitchen-simulator 1.1.1-test.64 → 1.1.1-test.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/@history.js +10 -2
- package/es/AppContext.js +10 -3
- package/es/KitchenConfigurator.js +79 -70
- package/es/KitchenConfiguratorApp.js +107 -98
- package/es/actions/area-actions.js +12 -5
- package/es/actions/export.js +29 -12
- package/es/actions/groups-actions.js +45 -27
- package/es/actions/holes-actions.js +55 -34
- package/es/actions/items-actions.js +145 -94
- package/es/actions/lines-actions.js +36 -21
- package/es/actions/project-actions.js +145 -94
- package/es/actions/scene-actions.js +21 -11
- package/es/actions/vertices-actions.js +15 -7
- package/es/actions/viewer2d-actions.js +36 -21
- package/es/actions/viewer3d-actions.js +18 -9
- package/es/catalog/areas/area/planner-element.js +9 -2
- package/es/catalog/catalog.js +21 -15
- package/es/catalog/factories/area-factory-3d.js +31 -22
- package/es/catalog/factories/area-factory.js +20 -11
- package/es/catalog/factories/export.js +24 -6
- package/es/catalog/factories/wall-factory-3d.js +41 -31
- package/es/catalog/factories/wall-factory.js +31 -21
- package/es/catalog/holes/door-closet/planner-element.js +24 -15
- package/es/catalog/holes/door-double/planner-element.js +24 -15
- package/es/catalog/holes/door-exterior/planner-element.js +25 -16
- package/es/catalog/holes/door-interior/planner-element.js +25 -16
- package/es/catalog/holes/door-panic/planner-element.js +16 -7
- package/es/catalog/holes/door-panic-double/planner-element.js +24 -15
- package/es/catalog/holes/door-sliding/planner-element.js +25 -16
- package/es/catalog/holes/doorway-framed/planner-element.js +20 -11
- package/es/catalog/holes/doorway-frameless/planner-element.js +16 -7
- package/es/catalog/holes/export.js +97 -13
- package/es/catalog/holes/window-clear/planner-element.js +19 -10
- package/es/catalog/holes/window-cross/planner-element.js +19 -10
- package/es/catalog/holes/window-double-hung/planner-element.js +19 -10
- package/es/catalog/holes/window-vertical/planner-element.js +19 -10
- package/es/catalog/lines/wall/planner-element.js +9 -2
- package/es/catalog/molding/molding-dcm/planner-element.js +14 -5
- package/es/catalog/molding/molding-fbm/planner-element.js +14 -5
- package/es/catalog/molding/molding-lrm/planner-element.js +14 -5
- package/es/catalog/properties/export.js +80 -20
- package/es/catalog/properties/property-checkbox.js +31 -24
- package/es/catalog/properties/property-color.js +23 -16
- package/es/catalog/properties/property-enum.js +31 -24
- package/es/catalog/properties/property-hidden.js +16 -9
- package/es/catalog/properties/property-lenght-measure.js +45 -38
- package/es/catalog/properties/property-length-measure.js +43 -36
- package/es/catalog/properties/property-length-measure_hole.js +45 -38
- package/es/catalog/properties/property-number.js +24 -17
- package/es/catalog/properties/property-read-only.js +23 -16
- package/es/catalog/properties/property-string.js +23 -16
- package/es/catalog/properties/property-toggle.js +23 -16
- package/es/catalog/properties/shared-property-style.js +7 -1
- package/es/catalog/utils/FuseUtils.js +15 -8
- package/es/catalog/utils/exporter.js +15 -8
- package/es/catalog/utils/geom-utils.js +29 -13
- package/es/catalog/utils/item-loader.js +97 -84
- package/es/catalog/utils/load-obj.js +28 -20
- package/es/catalog/utils/mtl-loader.js +8 -3
- package/es/catalog/utils/obj-loader.js +8 -3
- package/es/class/FuseUtils.js +15 -8
- package/es/class/area.js +28 -22
- package/es/class/export.js +95 -23
- package/es/class/group.js +59 -53
- package/es/class/guide.js +21 -15
- package/es/class/hole.js +89 -83
- package/es/class/item.js +147 -141
- package/es/class/layer.js +65 -59
- package/es/class/line.js +143 -135
- package/es/class/project.js +98 -90
- package/es/class/vertex.js +35 -29
- package/es/components/content.js +28 -19
- package/es/components/disclaimer/disclaimer.js +18 -10
- package/es/components/export.js +32 -8
- package/es/components/style/button.js +31 -23
- package/es/components/style/cancel-button.js +14 -7
- package/es/components/style/content-container.js +16 -9
- package/es/components/style/content-title.js +20 -11
- package/es/components/style/delete-button.js +17 -8
- package/es/components/style/export.js +120 -30
- package/es/components/style/form-block.js +15 -8
- package/es/components/style/form-color-input.js +14 -7
- package/es/components/style/form-label.js +15 -8
- package/es/components/style/form-number-input.js +49 -41
- package/es/components/style/form-number-input_2.js +44 -36
- package/es/components/style/form-select.js +24 -17
- package/es/components/style/form-slider.js +17 -10
- package/es/components/style/form-submit-button.js +17 -8
- package/es/components/style/form-text-input.js +34 -26
- package/es/components/viewer2d/area.js +24 -17
- package/es/components/viewer2d/export.js +120 -30
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +17 -10
- package/es/components/viewer2d/grids/grid-streak.js +17 -10
- package/es/components/viewer2d/grids/grid-vertical-streak.js +17 -10
- package/es/components/viewer2d/grids/grids.js +19 -10
- package/es/components/viewer2d/group.js +24 -15
- package/es/components/viewer2d/item.js +70 -61
- package/es/components/viewer2d/layer.js +30 -23
- package/es/components/viewer2d/line.js +111 -101
- package/es/components/viewer2d/ruler.js +29 -22
- package/es/components/viewer2d/rulerDist.js +28 -21
- package/es/components/viewer2d/rulerX.js +47 -39
- package/es/components/viewer2d/rulerY.js +45 -37
- package/es/components/viewer2d/scene.js +38 -30
- package/es/components/viewer2d/snap.js +22 -13
- package/es/components/viewer2d/state.js +27 -18
- package/es/components/viewer2d/utils.js +37 -24
- package/es/components/viewer2d/vertex.js +17 -8
- package/es/components/viewer2d/viewer2d.js +163 -153
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +23 -17
- package/es/components/viewer3d/dcm.js +7 -1
- package/es/components/viewer3d/fbm.js +7 -1
- package/es/components/viewer3d/front3D.js +21 -12
- package/es/components/viewer3d/grid-creator.js +17 -8
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +14 -6
- package/es/components/viewer3d/grids/grid-streak.js +13 -5
- package/es/components/viewer3d/grids/grid-vertical-streak.js +14 -6
- package/es/components/viewer3d/libs/first-person-controls.js +9 -2
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +7 -1
- package/es/components/viewer3d/libs/mtl-loader.js +7 -1
- package/es/components/viewer3d/libs/obj-loader.js +7 -1
- package/es/components/viewer3d/libs/orbit-controls.js +8 -2
- package/es/components/viewer3d/libs/pointer-lock-controls.js +8 -2
- package/es/components/viewer3d/lrm.js +7 -1
- package/es/components/viewer3d/model.js +7 -1
- package/es/components/viewer3d/pointer-lock-navigation.js +10 -3
- package/es/components/viewer3d/ruler-utils/itemRect.js +25 -18
- package/es/components/viewer3d/ruler-utils/layer3D.js +66 -59
- package/es/components/viewer3d/ruler-utils/ruler3D.js +46 -39
- package/es/components/viewer3d/ruler-utils/scene3D.js +17 -9
- package/es/components/viewer3d/ruler-utils/state3D.js +11 -4
- package/es/components/viewer3d/scene-creator.js +226 -191
- package/es/components/viewer3d/three-memory-cleaner.js +12 -3
- package/es/components/viewer3d/viewer3d-first-person.js +46 -40
- package/es/components/viewer3d/viewer3d.js +202 -196
- package/es/constants.js +358 -349
- package/es/index.js +15 -7
- package/es/models.js +184 -177
- package/es/plugins/SVGLoader.js +53 -48
- package/es/plugins/autosave.js +9 -3
- package/es/plugins/console-debugger.js +12 -5
- package/es/plugins/export.js +32 -8
- package/es/plugins/keyboard.js +35 -29
- package/es/reducers/areas-reducer.js +13 -7
- package/es/reducers/export.js +96 -24
- package/es/reducers/groups-reducer.js +37 -31
- package/es/reducers/holes-reducer.js +49 -43
- package/es/reducers/items-reducer.js +112 -106
- package/es/reducers/lines-reducer.js +34 -28
- package/es/reducers/project-reducer.js +111 -105
- package/es/reducers/reducer.js +23 -16
- package/es/reducers/scene-reducer.js +21 -15
- package/es/reducers/user-reducer.js +11 -5
- package/es/reducers/vertices-reducer.js +17 -11
- package/es/reducers/viewer2d-reducer.js +24 -18
- package/es/reducers/viewer3d-reducer.js +22 -16
- package/es/shared-style.js +16 -10
- package/es/styles/export.js +11 -3
- package/es/translator/en.js +7 -1
- package/es/translator/it.js +7 -1
- package/es/translator/ru.js +7 -1
- package/es/translator/translator.js +19 -13
- package/es/utils/browser.js +9 -2
- package/es/utils/convert-units-lite.js +7 -1
- package/es/utils/email-validator.js +7 -1
- package/es/utils/export.js +46 -15
- package/es/utils/geometry.js +278 -181
- package/es/utils/get-edges-of-subgraphs.js +9 -2
- package/es/utils/graph-cycles.js +11 -8
- package/es/utils/graph-inner-cycles.js +18 -10
- package/es/utils/graph.js +17 -9
- package/es/utils/helper.js +63 -39
- package/es/utils/history.js +15 -8
- package/es/utils/id-broker.js +15 -8
- package/es/utils/logger.js +7 -1
- package/es/utils/math.js +12 -5
- package/es/utils/molding.js +144 -119
- package/es/utils/name-generator.js +13 -7
- package/es/utils/objects-utils.js +19 -7
- package/es/utils/phone-validator.js +7 -1
- package/es/utils/process-black-list.js +10 -3
- package/es/utils/react-if.js +12 -6
- package/es/utils/snap-scene.js +34 -27
- package/es/utils/snap.js +59 -45
- package/es/utils/summarizeCart.js +7 -1
- package/es/utils/threeCSG.es6.js +22 -13
- package/es/version.js +7 -1
- package/package.json +1 -1
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
exports.getEdgesOfSubgraphs = getEdgesOfSubgraphs;
|
|
8
|
+
exports.getVerticesFromBiconnectedComponent = getVerticesFromBiconnectedComponent;
|
|
1
9
|
function getEdgesOfSubgraphs(subgraphs, graph) {
|
|
2
10
|
var edges = [];
|
|
3
11
|
subgraphs.forEach(function (component) {
|
|
@@ -23,5 +31,4 @@ function getVerticesFromBiconnectedComponent(component) {
|
|
|
23
31
|
});
|
|
24
32
|
return vertices;
|
|
25
33
|
}
|
|
26
|
-
|
|
27
|
-
export { getEdgesOfSubgraphs, getVerticesFromBiconnectedComponent };
|
|
34
|
+
var _default = exports["default"] = getEdgesOfSubgraphs;
|
package/es/utils/graph-cycles.js
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.compute_ev_mapping = compute_ev_mapping;
|
|
7
|
+
exports.compute_incidences = compute_incidences;
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
exports.find_cycles = find_cycles;
|
|
10
|
+
exports.find_inner_cycles = find_inner_cycles;
|
|
1
11
|
/**
|
|
2
12
|
* UTILS
|
|
3
13
|
*/
|
|
@@ -200,16 +210,12 @@ function find_inner_cycles(V, EV) {
|
|
|
200
210
|
ev_mapping: cycles.ev_mapping
|
|
201
211
|
};
|
|
202
212
|
}
|
|
203
|
-
|
|
204
|
-
export { find_inner_cycles, find_cycles, compute_ev_mapping, compute_incidences };
|
|
205
|
-
|
|
213
|
+
var _default = exports["default"] = find_inner_cycles;
|
|
206
214
|
/**
|
|
207
215
|
* DATA
|
|
208
216
|
*/
|
|
209
|
-
|
|
210
217
|
// let V = [[0.5774, 1.0], [1.0, 1.0], [1.1547, 0.0], [1.0, 0.0], [0.0, 0.0], [0.0, 0.732], [1.0, 0.1547], [0.732, 0.0], [1.0491, 0.183], [-0.317, 0.549], [1.0, 0.268], [0.183, -0.3169], [0.5491, 1.049], [0.4642, 1.0], [0.0, -0.4226], [0.0, 1.0]]
|
|
211
218
|
// let EV = [[0, 1], [2, 3], [5, 4], [7, 6], [2, 8], [3, 6], [4, 9], [0, 10], [9, 5], [8, 10], [7, 11], [12, 13], [6, 8], [6, 10], [4, 7], [4, 11], [4, 14], [5, 15], [11, 14], [0, 12], [13, 15], [0, 13], [1, 10], [3, 7], [5, 13]]
|
|
212
|
-
|
|
213
219
|
// let V = [[0,0],[10,0],[10,10],[0,10], [100,100],[110,100],[110,110],[100,110], [5,0], [5,10]]
|
|
214
220
|
// let V = [[0,0.5],[12,-0.7],[14,14],[-2,10], [103,106],[117,98],[96,112],[104,109], [5.5,0.8], [4.8,10.5]]
|
|
215
221
|
// let EV = [[3,9],[9,2],[2,1],[1,8],[8,0],[0,3],[8,9]] // IT WORKS
|
|
@@ -218,14 +224,11 @@ export { find_inner_cycles, find_cycles, compute_ev_mapping, compute_incidences
|
|
|
218
224
|
// let EV = [[2,3],[1,2],[0,1],[3,0]] // IT WORKS
|
|
219
225
|
// let EV = [[2,3],[1,2],[0,1],[3,0],[6,7],[5,6],[4,5],[7,4]] // IT WORKS
|
|
220
226
|
// let EV = [[3,2],[2,1],[1,0],[0,3],[7,6],[6,5],[5,4],[4,7]] // IT WORKS
|
|
221
|
-
|
|
222
227
|
// let V = [[2,5],[5,6],[10,6.8],[23,8],[9.6,11.3],[20,15],[25,16],[29,18],[30,22],[4,11],[6,10],[24,25],[18,20],[27,7]]
|
|
223
228
|
// let EV = [[0,1],[10,0],[9,10],[9,1],[1,2],[4,2],[3,13],[2,3],[4,5],[5,6],[6,7],[12,5],[12,11],[11,6],[11,8],[7,8],[9,4]]
|
|
224
|
-
|
|
225
229
|
/**
|
|
226
230
|
* MAIN
|
|
227
231
|
*/
|
|
228
|
-
|
|
229
232
|
// let cycles_data = find_inner_cycles(V, EV)
|
|
230
233
|
// console.log('############## OUTPUT')
|
|
231
234
|
// console.log('EDGES:')
|
|
@@ -1,10 +1,18 @@
|
|
|
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.calculateInnerCycles = calculateInnerCycles;
|
|
8
|
+
exports.isClockWiseOrder = isClockWiseOrder;
|
|
9
|
+
var _graph = _interopRequireDefault(require("./graph"));
|
|
10
|
+
var _getEdgesOfSubgraphs = _interopRequireDefault(require("./get-edges-of-subgraphs"));
|
|
11
|
+
var _graphCycles = _interopRequireDefault(require("./graph-cycles"));
|
|
12
|
+
var _immutable = require("immutable");
|
|
13
|
+
function calculateInnerCycles(verticesArray, edgesArray) {
|
|
14
|
+
var innerCycles = new _immutable.List();
|
|
15
|
+
var graph = new _graph["default"](verticesArray.length);
|
|
8
16
|
edgesArray.forEach(function (line) {
|
|
9
17
|
graph.addEdge(line[0], line[1]);
|
|
10
18
|
graph.addEdge(line[1], line[0]);
|
|
@@ -13,21 +21,21 @@ export function calculateInnerCycles(verticesArray, edgesArray) {
|
|
|
13
21
|
var subgraphs = graph.subgraphs.filter(function (subgraph) {
|
|
14
22
|
return subgraph.length >= 3;
|
|
15
23
|
});
|
|
16
|
-
var edgesOfSubgraphsArray =
|
|
24
|
+
var edgesOfSubgraphsArray = (0, _getEdgesOfSubgraphs["default"])(subgraphs, graph);
|
|
17
25
|
var edges = [];
|
|
18
26
|
edgesOfSubgraphsArray.forEach(function (es) {
|
|
19
27
|
es.forEach(function (edge) {
|
|
20
28
|
return edges.push(edge);
|
|
21
29
|
});
|
|
22
30
|
});
|
|
23
|
-
var cycles =
|
|
31
|
+
var cycles = (0, _graphCycles["default"])(verticesArray, edges);
|
|
24
32
|
cycles.v_cycles.forEach(function (cycle) {
|
|
25
33
|
cycle.shift();
|
|
26
34
|
innerCycles = innerCycles.push(cycle);
|
|
27
35
|
});
|
|
28
36
|
return innerCycles;
|
|
29
37
|
}
|
|
30
|
-
|
|
38
|
+
function isClockWiseOrder(innerCycleWithCoords) {
|
|
31
39
|
// See: https://stackoverflow.com/a/1165943 and http://blog.element84.com/polygon-winding.html
|
|
32
40
|
|
|
33
41
|
var i = 0;
|
package/es/utils/graph.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.Graph = exports.Edge = void 0;
|
|
8
|
+
exports.create_array = create_array;
|
|
9
|
+
exports["default"] = void 0;
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
|
11
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
3
12
|
//JS porting of this code http://www.geeksforgeeks.org/biconnected-components/
|
|
4
13
|
|
|
5
14
|
function create_array(length) {
|
|
@@ -9,14 +18,14 @@ function create_array(length) {
|
|
|
9
18
|
}
|
|
10
19
|
return array;
|
|
11
20
|
}
|
|
12
|
-
var Edge = /*#__PURE__*/
|
|
13
|
-
|
|
21
|
+
var Edge = exports.Edge = /*#__PURE__*/(0, _createClass2["default"])(function Edge(u, v) {
|
|
22
|
+
(0, _classCallCheck2["default"])(this, Edge);
|
|
14
23
|
this.u = u;
|
|
15
24
|
this.v = v;
|
|
16
25
|
});
|
|
17
|
-
var Graph = /*#__PURE__*/function () {
|
|
26
|
+
var Graph = exports.Graph = /*#__PURE__*/function () {
|
|
18
27
|
function Graph(v) {
|
|
19
|
-
|
|
28
|
+
(0, _classCallCheck2["default"])(this, Graph);
|
|
20
29
|
this.count = 0; // count is number of biconnected components
|
|
21
30
|
this.subgraphs = []; //biconnected components
|
|
22
31
|
this.time = 0; // time is used to find discovery times
|
|
@@ -29,7 +38,7 @@ var Graph = /*#__PURE__*/function () {
|
|
|
29
38
|
}
|
|
30
39
|
|
|
31
40
|
//Function to add an edge into the graph
|
|
32
|
-
return
|
|
41
|
+
return (0, _createClass2["default"])(Graph, [{
|
|
33
42
|
key: "addEdge",
|
|
34
43
|
value: function addEdge(v, w) {
|
|
35
44
|
this.adj[v].push(w);
|
|
@@ -142,5 +151,4 @@ var Graph = /*#__PURE__*/function () {
|
|
|
142
151
|
}
|
|
143
152
|
}]);
|
|
144
153
|
}();
|
|
145
|
-
|
|
146
|
-
export { Graph, Edge, create_array };
|
|
154
|
+
var _default = exports["default"] = Graph;
|
package/es/utils/helper.js
CHANGED
|
@@ -1,18 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.animateDoor = void 0;
|
|
9
|
+
exports.applyEdges = applyEdges;
|
|
10
|
+
exports.base64Decode = void 0;
|
|
11
|
+
exports.debugUtil = debugUtil;
|
|
12
|
+
exports.getPathInfo = exports.getPath = void 0;
|
|
13
|
+
exports.handleCamRect = handleCamRect;
|
|
14
|
+
exports.isCeilLimitation = isCeilLimitation;
|
|
15
|
+
exports.isElevationView = isElevationView;
|
|
16
|
+
exports.isEmpty = void 0;
|
|
17
|
+
exports.isImmutable = isImmutable;
|
|
18
|
+
exports.isValidNumber = isValidNumber;
|
|
19
|
+
exports.refineProductForSummaryPdf = exports.refineMoldingForSummaryPdf = void 0;
|
|
20
|
+
exports.replaceMeshesWithLineSegments = replaceMeshesWithLineSegments;
|
|
21
|
+
exports.textureCube = void 0;
|
|
22
|
+
exports.toPlainObject = toPlainObject;
|
|
23
|
+
exports.translateDrawer = void 0;
|
|
24
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/typeof"));
|
|
25
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
26
|
+
var _HDRCubeTextureLoader = require("three/examples/jsm/loaders/HDRCubeTextureLoader.js");
|
|
27
|
+
var _constants = require("../constants");
|
|
28
|
+
var Three = _interopRequireWildcard(require("three"));
|
|
29
|
+
var _utils = require("./../components/viewer2d/utils");
|
|
30
|
+
var _convertUnitsLite = require("./convert-units-lite");
|
|
31
|
+
var _math = require("./math");
|
|
32
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
3
33
|
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; }
|
|
4
|
-
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) {
|
|
5
|
-
|
|
6
|
-
import { ANIMATE_OBJECT_OPEN_DOOR_ROTATION_UNIT, ANIMATE_STEP_MAX, DECIMAL_PLACES_2, HDR_URLS, MODE_ELEVATION_VIEW } from "../constants";
|
|
7
|
-
import * as Three from 'three';
|
|
8
|
-
import { returnReplaceableDeepSearchType } from "./../components/viewer2d/utils";
|
|
9
|
-
import { convert } from "./convert-units-lite";
|
|
10
|
-
import { formatNumber } from "./math";
|
|
11
|
-
export var textureCube = new HDRCubeTextureLoader().setPath('/catalog/envMap/').load(HDR_URLS, function () {
|
|
34
|
+
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; }
|
|
35
|
+
var textureCube = exports.textureCube = new _HDRCubeTextureLoader.HDRCubeTextureLoader().setPath('/catalog/envMap/').load(_constants.HDR_URLS, function () {
|
|
12
36
|
textureCube.magFilter = Three.LinearFilter;
|
|
13
37
|
textureCube.needsUpdate = true;
|
|
14
38
|
});
|
|
15
|
-
|
|
39
|
+
var base64Decode = exports.base64Decode = function base64Decode(targetStr) {
|
|
16
40
|
if (!targetStr) return null;
|
|
17
41
|
try {
|
|
18
42
|
// If URL-encoded, decode first
|
|
@@ -27,7 +51,7 @@ export var base64Decode = function base64Decode(targetStr) {
|
|
|
27
51
|
return null;
|
|
28
52
|
}
|
|
29
53
|
};
|
|
30
|
-
|
|
54
|
+
var refineProductForSummaryPdf = exports.refineProductForSummaryPdf = function refineProductForSummaryPdf(refinedProductList, catalog, categoryData, itemSKU, suffix, item, product, measurementUnit, count) {
|
|
31
55
|
var _doorColor;
|
|
32
56
|
var review;
|
|
33
57
|
var doorColor = item.doorStyle;
|
|
@@ -53,7 +77,7 @@ export var refineProductForSummaryPdf = function refineProductForSummaryPdf(refi
|
|
|
53
77
|
}
|
|
54
78
|
review = catalog.elements[item.type];
|
|
55
79
|
if (!review) {
|
|
56
|
-
review = catalog.elements[returnReplaceableDeepSearchType(item.type)];
|
|
80
|
+
review = catalog.elements[(0, _utils.returnReplaceableDeepSearchType)(item.type)];
|
|
57
81
|
}
|
|
58
82
|
if (((_doorColor4 = doorColor) === null || _doorColor4 === void 0 || (_doorColor4 = _doorColor4.install) === null || _doorColor4 === void 0 ? void 0 : _doorColor4.toLowerCase()) === 'pre-assembled') {
|
|
59
83
|
itemSKU += '-assembled';
|
|
@@ -64,9 +88,9 @@ export var refineProductForSummaryPdf = function refineProductForSummaryPdf(refi
|
|
|
64
88
|
thumbnail: review.img,
|
|
65
89
|
sku: itemSKU,
|
|
66
90
|
sizeInfo: {
|
|
67
|
-
width: Math.round(convert(review.info.sizeinfo.width).from('in').to(measurementUnit._unit) * 100) / 100,
|
|
68
|
-
depth: Math.round(convert(review.info.sizeinfo.depth).from('in').to(measurementUnit._unit) * 100) / 100,
|
|
69
|
-
height: Math.round(convert(review.info.sizeinfo.height).from('in').to(measurementUnit._unit) * 100) / 100,
|
|
91
|
+
width: Math.round((0, _convertUnitsLite.convert)(review.info.sizeinfo.width).from('in').to(measurementUnit._unit) * 100) / 100,
|
|
92
|
+
depth: Math.round((0, _convertUnitsLite.convert)(review.info.sizeinfo.depth).from('in').to(measurementUnit._unit) * 100) / 100,
|
|
93
|
+
height: Math.round((0, _convertUnitsLite.convert)(review.info.sizeinfo.height).from('in').to(measurementUnit._unit) * 100) / 100,
|
|
70
94
|
_unit: measurementUnit._unit
|
|
71
95
|
},
|
|
72
96
|
doorstyle: doorStyleName,
|
|
@@ -83,14 +107,14 @@ export var refineProductForSummaryPdf = function refineProductForSummaryPdf(refi
|
|
|
83
107
|
}
|
|
84
108
|
}
|
|
85
109
|
};
|
|
86
|
-
|
|
110
|
+
var refineMoldingForSummaryPdf = exports.refineMoldingForSummaryPdf = function refineMoldingForSummaryPdf(refinedProductList, molding, product, newSKU) {
|
|
87
111
|
if (molding) {
|
|
88
112
|
var review = {
|
|
89
113
|
img: molding.thumbnail,
|
|
90
114
|
name: molding.name,
|
|
91
115
|
count: molding.count
|
|
92
116
|
};
|
|
93
|
-
var subTotalPrice = product && product.discounted_price ? formatNumber(product.discounted_price * review.count, DECIMAL_PLACES_2) : 0;
|
|
117
|
+
var subTotalPrice = product && product.discounted_price ? (0, _math.formatNumber)(product.discounted_price * review.count, _constants.DECIMAL_PLACES_2) : 0;
|
|
94
118
|
var refinedData = {
|
|
95
119
|
id: newSKU,
|
|
96
120
|
thumbnail: review.img,
|
|
@@ -108,7 +132,7 @@ export var refineMoldingForSummaryPdf = function refineMoldingForSummaryPdf(refi
|
|
|
108
132
|
}
|
|
109
133
|
}
|
|
110
134
|
};
|
|
111
|
-
|
|
135
|
+
function applyEdges(object) {
|
|
112
136
|
if (object && object.isMesh && !(object instanceof Three.LineSegments)) {
|
|
113
137
|
var parent = object.parent;
|
|
114
138
|
if (!isEmpty(parent)) {
|
|
@@ -136,7 +160,7 @@ export function applyEdges(object) {
|
|
|
136
160
|
}
|
|
137
161
|
}
|
|
138
162
|
}
|
|
139
|
-
|
|
163
|
+
function replaceMeshesWithLineSegments(object) {
|
|
140
164
|
if (object && object.children.length > 0) {
|
|
141
165
|
for (var i = object.children.length - 1; i >= 0; i--) {
|
|
142
166
|
var child = object.children[i];
|
|
@@ -149,15 +173,15 @@ export function replaceMeshesWithLineSegments(object) {
|
|
|
149
173
|
applyEdges(object);
|
|
150
174
|
}
|
|
151
175
|
}
|
|
152
|
-
|
|
153
|
-
return value === undefined || value === null || typeof value === 'array' && value.length === 0 ||
|
|
176
|
+
var isEmpty = exports.isEmpty = function isEmpty(value) {
|
|
177
|
+
return value === undefined || value === null || typeof value === 'array' && value.length === 0 || (0, _typeof2["default"])(value) === 'object' && Object.keys(value).length === 0 || typeof value === 'string' && value.trim().length === 0;
|
|
154
178
|
};
|
|
155
179
|
|
|
156
180
|
// animate the Opening or Closing Door action
|
|
157
|
-
|
|
181
|
+
var animateDoor = exports.animateDoor = function animateDoor(offsetData, doorObj, open_doors, item, isCorner, mode) {
|
|
158
182
|
var offset = new Three.Vector3(offsetData.x, offsetData.y, offsetData === null || offsetData === void 0 ? void 0 : offsetData.z);
|
|
159
183
|
doorObj.translateOnAxis(offset, 1);
|
|
160
|
-
var rotation = doorObj.name.match(/\d_(door[^LR1-9]*)(_[LR])?(_[1-9])?$/)[2] === '_L' ? -ANIMATE_OBJECT_OPEN_DOOR_ROTATION_UNIT : ANIMATE_OBJECT_OPEN_DOOR_ROTATION_UNIT;
|
|
184
|
+
var rotation = doorObj.name.match(/\d_(door[^LR1-9]*)(_[LR])?(_[1-9])?$/)[2] === '_L' ? -_constants.ANIMATE_OBJECT_OPEN_DOOR_ROTATION_UNIT : _constants.ANIMATE_OBJECT_OPEN_DOOR_ROTATION_UNIT;
|
|
161
185
|
var isflip = item.properties.flip_doorhandle;
|
|
162
186
|
rotation = isflip ? -rotation : rotation;
|
|
163
187
|
if (isCorner == 1) {
|
|
@@ -175,22 +199,22 @@ export var animateDoor = function animateDoor(offsetData, doorObj, open_doors, i
|
|
|
175
199
|
} else {
|
|
176
200
|
rotation = open_doors ? rotation : -rotation;
|
|
177
201
|
}
|
|
178
|
-
if (mode === 'Opened2D') rotation *= ANIMATE_STEP_MAX; // Check whether the object's door is opened in 2D.
|
|
202
|
+
if (mode === 'Opened2D') rotation *= _constants.ANIMATE_STEP_MAX; // Check whether the object's door is opened in 2D.
|
|
179
203
|
doorObj.rotateY(rotation);
|
|
180
204
|
doorObj.translateOnAxis(offset, -1);
|
|
181
205
|
};
|
|
182
206
|
|
|
183
207
|
// Opening or Closing the drawer action
|
|
184
|
-
|
|
185
|
-
var animate_translate_unit = convert(item.properties.depth._length).from(item.properties.depth._unit).to('cm') * (1 / 2) / ANIMATE_STEP_MAX * 0.01;
|
|
208
|
+
var translateDrawer = exports.translateDrawer = function translateDrawer(item, drawerObj, open_doors, mode) {
|
|
209
|
+
var animate_translate_unit = (0, _convertUnitsLite.convert)(item.properties.depth._length).from(item.properties.depth._unit).to('cm') * (1 / 2) / _constants.ANIMATE_STEP_MAX * 0.01;
|
|
186
210
|
// Check whether the object's drawer is opened in 2D.
|
|
187
|
-
if (mode === 'Opened2D') animate_translate_unit *= ANIMATE_STEP_MAX;
|
|
211
|
+
if (mode === 'Opened2D') animate_translate_unit *= _constants.ANIMATE_STEP_MAX;
|
|
188
212
|
drawerObj.translateZ(open_doors ? -animate_translate_unit : animate_translate_unit);
|
|
189
213
|
};
|
|
190
|
-
|
|
214
|
+
var getPath = exports.getPath = function getPath() {
|
|
191
215
|
return window.location.pathname;
|
|
192
216
|
};
|
|
193
|
-
|
|
217
|
+
var getPathInfo = exports.getPathInfo = function getPathInfo(num) {
|
|
194
218
|
var paths = window.location.pathname.split('/');
|
|
195
219
|
if (paths.length >= num + 1) {
|
|
196
220
|
return paths[num];
|
|
@@ -200,8 +224,8 @@ export var getPathInfo = function getPathInfo(num) {
|
|
|
200
224
|
};
|
|
201
225
|
|
|
202
226
|
// determine if elevation mode or not
|
|
203
|
-
|
|
204
|
-
if (mode === MODE_ELEVATION_VIEW) return true;else return false;
|
|
227
|
+
function isElevationView(mode) {
|
|
228
|
+
if (mode === _constants.MODE_ELEVATION_VIEW) return true;else return false;
|
|
205
229
|
}
|
|
206
230
|
|
|
207
231
|
// calculate camera rect in elevation mode
|
|
@@ -222,7 +246,7 @@ export function isElevationView(mode) {
|
|
|
222
246
|
//// g //// **i i** //// g ////
|
|
223
247
|
//// h //// **l***************lineLength*************l** //// h ////
|
|
224
248
|
//// t /////////////////////// width //////////////////////// t ////
|
|
225
|
-
|
|
249
|
+
function handleCamRect(width, height, ceilHeight, lineLength) {
|
|
226
250
|
var scale = Math.min(width * 0.6 / lineLength, height * 0.6 / ceilHeight); // scale is min value
|
|
227
251
|
var cameraRect = {
|
|
228
252
|
width: width / scale,
|
|
@@ -238,29 +262,29 @@ export function handleCamRect(width, height, ceilHeight, lineLength) {
|
|
|
238
262
|
* @param {*} ceilUnit
|
|
239
263
|
* @returns true ceilingHeight is bigger than totalHeight(item's height + altitude), otherwise false
|
|
240
264
|
*/
|
|
241
|
-
|
|
265
|
+
function isCeilLimitation(layer, ceilHeight, ceilUnit) {
|
|
242
266
|
var items = layer.getIn(['layers', layer.selectedLayer, 'items']);
|
|
243
267
|
return items.some(function (item) {
|
|
244
268
|
var height = item.properties.getIn(['height', '_length']);
|
|
245
269
|
var heightUnit = item.properties.getIn(['height', '_unit']);
|
|
246
270
|
var altitude = item.properties.getIn(['altitude', '_length']);
|
|
247
271
|
var altitudeUnit = item.properties.getIn(['altitude', '_unit']);
|
|
248
|
-
var totalHeight = convert(height).from(heightUnit).to(ceilUnit._unit) + convert(altitude).from(altitudeUnit).to(ceilUnit._unit);
|
|
272
|
+
var totalHeight = (0, _convertUnitsLite.convert)(height).from(heightUnit).to(ceilUnit._unit) + (0, _convertUnitsLite.convert)(altitude).from(altitudeUnit).to(ceilUnit._unit);
|
|
249
273
|
return totalHeight > ceilHeight;
|
|
250
274
|
});
|
|
251
275
|
}
|
|
252
|
-
|
|
276
|
+
function isValidNumber(n) {
|
|
253
277
|
return !isNaN(n) && isFinite(n);
|
|
254
278
|
}
|
|
255
|
-
|
|
279
|
+
function toPlainObject(maybeImmutable) {
|
|
256
280
|
if (maybeImmutable && typeof maybeImmutable.toJS === 'function') {
|
|
257
281
|
return maybeImmutable.toJS();
|
|
258
282
|
}
|
|
259
283
|
return maybeImmutable; // already a plain JS object
|
|
260
284
|
}
|
|
261
|
-
|
|
285
|
+
function isImmutable(maybeImmutable) {
|
|
262
286
|
return !!(maybeImmutable && typeof maybeImmutable.toJS === 'function');
|
|
263
287
|
}
|
|
264
|
-
|
|
288
|
+
function debugUtil() {
|
|
265
289
|
return new Date();
|
|
266
290
|
}
|
package/es/utils/history.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.historyPush = exports.historyPop = void 0;
|
|
8
|
+
var _immutable = require("immutable");
|
|
9
|
+
var _immutablediff = _interopRequireDefault(require("immutablediff"));
|
|
10
|
+
var _immutablepatch = _interopRequireDefault(require("immutablepatch"));
|
|
11
|
+
var historyPush = exports.historyPush = function historyPush(historyStructure, item) {
|
|
5
12
|
if (historyStructure.last) {
|
|
6
13
|
if (historyStructure.last.hashCode() !== item.hashCode()) {
|
|
7
|
-
var toPush = new Map({
|
|
14
|
+
var toPush = new _immutable.Map({
|
|
8
15
|
time: Date.now(),
|
|
9
|
-
diff:
|
|
16
|
+
diff: (0, _immutablediff["default"])(historyStructure.last, item)
|
|
10
17
|
});
|
|
11
18
|
historyStructure = historyStructure.set('last', item).set('list', historyStructure.list.push(toPush));
|
|
12
19
|
}
|
|
@@ -15,12 +22,12 @@ export var historyPush = function historyPush(historyStructure, item) {
|
|
|
15
22
|
}
|
|
16
23
|
return historyStructure;
|
|
17
24
|
};
|
|
18
|
-
|
|
25
|
+
var historyPop = exports.historyPop = function historyPop(historyStructure) {
|
|
19
26
|
if (historyStructure.last) {
|
|
20
27
|
if (historyStructure.list.size) {
|
|
21
28
|
var last = historyStructure.first;
|
|
22
29
|
for (var x = 0; x < historyStructure.list.size - 1; x++) {
|
|
23
|
-
last =
|
|
30
|
+
last = (0, _immutablepatch["default"])(last, historyStructure.list.get(x).get('diff'));
|
|
24
31
|
}
|
|
25
32
|
historyStructure = historyStructure.set('last', last).set('list', historyStructure.list.pop());
|
|
26
33
|
}
|
package/es/utils/id-broker.js
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = exports.IDBroker = void 0;
|
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
|
10
|
+
var _nanoid = require("nanoid");
|
|
11
|
+
var IDBroker = exports.IDBroker = /*#__PURE__*/function () {
|
|
5
12
|
function IDBroker() {
|
|
6
|
-
|
|
13
|
+
(0, _classCallCheck2["default"])(this, IDBroker);
|
|
7
14
|
}
|
|
8
|
-
return
|
|
15
|
+
return (0, _createClass2["default"])(IDBroker, null, [{
|
|
9
16
|
key: "acquireID",
|
|
10
17
|
value: function acquireID() {
|
|
11
|
-
return nanoid();
|
|
18
|
+
return (0, _nanoid.nanoid)();
|
|
12
19
|
}
|
|
13
20
|
}]);
|
|
14
21
|
}();
|
|
15
|
-
|
|
22
|
+
var _default = exports["default"] = IDBroker;
|
package/es/utils/logger.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.LogLine = LogLine;
|
|
7
|
+
function LogLine(state, layerID, lineID) {
|
|
2
8
|
var layer = state.getIn(['scene', 'layers', layerID]);
|
|
3
9
|
var line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
|
|
4
10
|
var vertex0 = layer.vertices.get(line.vertices.get(0));
|
package/es/utils/math.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.multiplyMatrices = exports.isNonZeroText = exports.formatNumber = exports.fAbs = void 0;
|
|
7
|
+
exports.toFixedFloat = toFixedFloat;
|
|
1
8
|
/** @description Return float fixed to desired precision
|
|
2
9
|
* @param {number} num Float to fix
|
|
3
10
|
* @param {number} precision Desired precision, or 6 if not specified
|
|
4
11
|
* @return {number}
|
|
5
12
|
*/
|
|
6
|
-
|
|
13
|
+
function toFixedFloat(num) {
|
|
7
14
|
var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
|
|
8
15
|
if (num && precision) {
|
|
9
16
|
return parseFloat(parseFloat(num).toFixed(precision));
|
|
@@ -15,7 +22,7 @@ export function toFixedFloat(num) {
|
|
|
15
22
|
* @param {number} n Number of wich get value without sign
|
|
16
23
|
* @return {number}
|
|
17
24
|
*/
|
|
18
|
-
|
|
25
|
+
var fAbs = exports.fAbs = function fAbs(n) {
|
|
19
26
|
return Math.abs(n);
|
|
20
27
|
// let x = n;
|
|
21
28
|
// x < 0 && (x = ~x + 1);
|
|
@@ -27,7 +34,7 @@ export var fAbs = function fAbs(n) {
|
|
|
27
34
|
* @param {Array} m2 Matrix 2
|
|
28
35
|
* @return {Array}
|
|
29
36
|
*/
|
|
30
|
-
|
|
37
|
+
var multiplyMatrices = exports.multiplyMatrices = function multiplyMatrices(m1, m2) {
|
|
31
38
|
var result = [];
|
|
32
39
|
for (var i = 0; i < m1.length; i++) {
|
|
33
40
|
result[i] = [];
|
|
@@ -41,10 +48,10 @@ export var multiplyMatrices = function multiplyMatrices(m1, m2) {
|
|
|
41
48
|
}
|
|
42
49
|
return result;
|
|
43
50
|
};
|
|
44
|
-
|
|
51
|
+
var formatNumber = exports.formatNumber = function formatNumber(value, digits) {
|
|
45
52
|
if (value == null || isNaN(Number(value))) return value; // guard for null/undefined/non-numeric
|
|
46
53
|
return Number(value).toFixed(digits);
|
|
47
54
|
};
|
|
48
|
-
|
|
55
|
+
var isNonZeroText = exports.isNonZeroText = function isNonZeroText(text) {
|
|
49
56
|
return parseFloat(text) !== 0;
|
|
50
57
|
};
|