kitchen-simulator 1.1.1-test.61 → 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 +8 -22
- 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/lib/index.js +7 -13
- package/package.json +1 -1
|
@@ -1,11 +1,3 @@
|
|
|
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;
|
|
9
1
|
function getEdgesOfSubgraphs(subgraphs, graph) {
|
|
10
2
|
var edges = [];
|
|
11
3
|
subgraphs.forEach(function (component) {
|
|
@@ -31,4 +23,5 @@ function getVerticesFromBiconnectedComponent(component) {
|
|
|
31
23
|
});
|
|
32
24
|
return vertices;
|
|
33
25
|
}
|
|
34
|
-
|
|
26
|
+
export default getEdgesOfSubgraphs;
|
|
27
|
+
export { getEdgesOfSubgraphs, getVerticesFromBiconnectedComponent };
|
package/es/utils/graph-cycles.js
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
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;
|
|
11
1
|
/**
|
|
12
2
|
* UTILS
|
|
13
3
|
*/
|
|
@@ -210,12 +200,16 @@ function find_inner_cycles(V, EV) {
|
|
|
210
200
|
ev_mapping: cycles.ev_mapping
|
|
211
201
|
};
|
|
212
202
|
}
|
|
213
|
-
|
|
203
|
+
export default find_inner_cycles;
|
|
204
|
+
export { find_inner_cycles, find_cycles, compute_ev_mapping, compute_incidences };
|
|
205
|
+
|
|
214
206
|
/**
|
|
215
207
|
* DATA
|
|
216
208
|
*/
|
|
209
|
+
|
|
217
210
|
// 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]]
|
|
218
211
|
// 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
|
+
|
|
219
213
|
// let V = [[0,0],[10,0],[10,10],[0,10], [100,100],[110,100],[110,110],[100,110], [5,0], [5,10]]
|
|
220
214
|
// 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]]
|
|
221
215
|
// let EV = [[3,9],[9,2],[2,1],[1,8],[8,0],[0,3],[8,9]] // IT WORKS
|
|
@@ -224,11 +218,14 @@ var _default = exports["default"] = find_inner_cycles;
|
|
|
224
218
|
// let EV = [[2,3],[1,2],[0,1],[3,0]] // IT WORKS
|
|
225
219
|
// let EV = [[2,3],[1,2],[0,1],[3,0],[6,7],[5,6],[4,5],[7,4]] // IT WORKS
|
|
226
220
|
// let EV = [[3,2],[2,1],[1,0],[0,3],[7,6],[6,5],[5,4],[4,7]] // IT WORKS
|
|
221
|
+
|
|
227
222
|
// 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]]
|
|
228
223
|
// 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
|
+
|
|
229
225
|
/**
|
|
230
226
|
* MAIN
|
|
231
227
|
*/
|
|
228
|
+
|
|
232
229
|
// let cycles_data = find_inner_cycles(V, EV)
|
|
233
230
|
// console.log('############## OUTPUT')
|
|
234
231
|
// console.log('EDGES:')
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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);
|
|
1
|
+
import Graph from "./graph";
|
|
2
|
+
import getEdgesOfSubgraphs from "./get-edges-of-subgraphs";
|
|
3
|
+
import graphCycles from "./graph-cycles";
|
|
4
|
+
import { List } from 'immutable';
|
|
5
|
+
export function calculateInnerCycles(verticesArray, edgesArray) {
|
|
6
|
+
var innerCycles = new List();
|
|
7
|
+
var graph = new Graph(verticesArray.length);
|
|
16
8
|
edgesArray.forEach(function (line) {
|
|
17
9
|
graph.addEdge(line[0], line[1]);
|
|
18
10
|
graph.addEdge(line[1], line[0]);
|
|
@@ -21,21 +13,21 @@ function calculateInnerCycles(verticesArray, edgesArray) {
|
|
|
21
13
|
var subgraphs = graph.subgraphs.filter(function (subgraph) {
|
|
22
14
|
return subgraph.length >= 3;
|
|
23
15
|
});
|
|
24
|
-
var edgesOfSubgraphsArray = (
|
|
16
|
+
var edgesOfSubgraphsArray = getEdgesOfSubgraphs(subgraphs, graph);
|
|
25
17
|
var edges = [];
|
|
26
18
|
edgesOfSubgraphsArray.forEach(function (es) {
|
|
27
19
|
es.forEach(function (edge) {
|
|
28
20
|
return edges.push(edge);
|
|
29
21
|
});
|
|
30
22
|
});
|
|
31
|
-
var cycles = (
|
|
23
|
+
var cycles = graphCycles(verticesArray, edges);
|
|
32
24
|
cycles.v_cycles.forEach(function (cycle) {
|
|
33
25
|
cycle.shift();
|
|
34
26
|
innerCycles = innerCycles.push(cycle);
|
|
35
27
|
});
|
|
36
28
|
return innerCycles;
|
|
37
29
|
}
|
|
38
|
-
function isClockWiseOrder(innerCycleWithCoords) {
|
|
30
|
+
export function isClockWiseOrder(innerCycleWithCoords) {
|
|
39
31
|
// See: https://stackoverflow.com/a/1165943 and http://blog.element84.com/polygon-winding.html
|
|
40
32
|
|
|
41
33
|
var i = 0;
|
package/es/utils/graph.js
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
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/createClass"));
|
|
11
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
1
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
12
3
|
//JS porting of this code http://www.geeksforgeeks.org/biconnected-components/
|
|
13
4
|
|
|
14
5
|
function create_array(length) {
|
|
@@ -18,14 +9,14 @@ function create_array(length) {
|
|
|
18
9
|
}
|
|
19
10
|
return array;
|
|
20
11
|
}
|
|
21
|
-
var Edge =
|
|
22
|
-
(
|
|
12
|
+
var Edge = /*#__PURE__*/_createClass(function Edge(u, v) {
|
|
13
|
+
_classCallCheck(this, Edge);
|
|
23
14
|
this.u = u;
|
|
24
15
|
this.v = v;
|
|
25
16
|
});
|
|
26
|
-
var Graph =
|
|
17
|
+
var Graph = /*#__PURE__*/function () {
|
|
27
18
|
function Graph(v) {
|
|
28
|
-
(
|
|
19
|
+
_classCallCheck(this, Graph);
|
|
29
20
|
this.count = 0; // count is number of biconnected components
|
|
30
21
|
this.subgraphs = []; //biconnected components
|
|
31
22
|
this.time = 0; // time is used to find discovery times
|
|
@@ -38,7 +29,7 @@ var Graph = exports.Graph = /*#__PURE__*/function () {
|
|
|
38
29
|
}
|
|
39
30
|
|
|
40
31
|
//Function to add an edge into the graph
|
|
41
|
-
return (
|
|
32
|
+
return _createClass(Graph, [{
|
|
42
33
|
key: "addEdge",
|
|
43
34
|
value: function addEdge(v, w) {
|
|
44
35
|
this.adj[v].push(w);
|
|
@@ -151,4 +142,5 @@ var Graph = exports.Graph = /*#__PURE__*/function () {
|
|
|
151
142
|
}
|
|
152
143
|
}]);
|
|
153
144
|
}();
|
|
154
|
-
|
|
145
|
+
export default Graph;
|
|
146
|
+
export { Graph, Edge, create_array };
|
package/es/utils/helper.js
CHANGED
|
@@ -1,42 +1,18 @@
|
|
|
1
|
-
|
|
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/typeof"));
|
|
25
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/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); }
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
33
3
|
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; }
|
|
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) { (
|
|
35
|
-
|
|
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) { _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; }
|
|
5
|
+
import { HDRCubeTextureLoader } from 'three/examples/jsm/loaders/HDRCubeTextureLoader.js';
|
|
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 () {
|
|
36
12
|
textureCube.magFilter = Three.LinearFilter;
|
|
37
13
|
textureCube.needsUpdate = true;
|
|
38
14
|
});
|
|
39
|
-
var base64Decode =
|
|
15
|
+
export var base64Decode = function base64Decode(targetStr) {
|
|
40
16
|
if (!targetStr) return null;
|
|
41
17
|
try {
|
|
42
18
|
// If URL-encoded, decode first
|
|
@@ -51,7 +27,7 @@ var base64Decode = exports.base64Decode = function base64Decode(targetStr) {
|
|
|
51
27
|
return null;
|
|
52
28
|
}
|
|
53
29
|
};
|
|
54
|
-
var refineProductForSummaryPdf =
|
|
30
|
+
export var refineProductForSummaryPdf = function refineProductForSummaryPdf(refinedProductList, catalog, categoryData, itemSKU, suffix, item, product, measurementUnit, count) {
|
|
55
31
|
var _doorColor;
|
|
56
32
|
var review;
|
|
57
33
|
var doorColor = item.doorStyle;
|
|
@@ -77,7 +53,7 @@ var refineProductForSummaryPdf = exports.refineProductForSummaryPdf = function r
|
|
|
77
53
|
}
|
|
78
54
|
review = catalog.elements[item.type];
|
|
79
55
|
if (!review) {
|
|
80
|
-
review = catalog.elements[
|
|
56
|
+
review = catalog.elements[returnReplaceableDeepSearchType(item.type)];
|
|
81
57
|
}
|
|
82
58
|
if (((_doorColor4 = doorColor) === null || _doorColor4 === void 0 || (_doorColor4 = _doorColor4.install) === null || _doorColor4 === void 0 ? void 0 : _doorColor4.toLowerCase()) === 'pre-assembled') {
|
|
83
59
|
itemSKU += '-assembled';
|
|
@@ -88,9 +64,9 @@ var refineProductForSummaryPdf = exports.refineProductForSummaryPdf = function r
|
|
|
88
64
|
thumbnail: review.img,
|
|
89
65
|
sku: itemSKU,
|
|
90
66
|
sizeInfo: {
|
|
91
|
-
width: Math.round(
|
|
92
|
-
depth: Math.round(
|
|
93
|
-
height: Math.round(
|
|
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,
|
|
94
70
|
_unit: measurementUnit._unit
|
|
95
71
|
},
|
|
96
72
|
doorstyle: doorStyleName,
|
|
@@ -107,14 +83,14 @@ var refineProductForSummaryPdf = exports.refineProductForSummaryPdf = function r
|
|
|
107
83
|
}
|
|
108
84
|
}
|
|
109
85
|
};
|
|
110
|
-
var refineMoldingForSummaryPdf =
|
|
86
|
+
export var refineMoldingForSummaryPdf = function refineMoldingForSummaryPdf(refinedProductList, molding, product, newSKU) {
|
|
111
87
|
if (molding) {
|
|
112
88
|
var review = {
|
|
113
89
|
img: molding.thumbnail,
|
|
114
90
|
name: molding.name,
|
|
115
91
|
count: molding.count
|
|
116
92
|
};
|
|
117
|
-
var subTotalPrice = product && product.discounted_price ?
|
|
93
|
+
var subTotalPrice = product && product.discounted_price ? formatNumber(product.discounted_price * review.count, DECIMAL_PLACES_2) : 0;
|
|
118
94
|
var refinedData = {
|
|
119
95
|
id: newSKU,
|
|
120
96
|
thumbnail: review.img,
|
|
@@ -132,7 +108,7 @@ var refineMoldingForSummaryPdf = exports.refineMoldingForSummaryPdf = function r
|
|
|
132
108
|
}
|
|
133
109
|
}
|
|
134
110
|
};
|
|
135
|
-
function applyEdges(object) {
|
|
111
|
+
export function applyEdges(object) {
|
|
136
112
|
if (object && object.isMesh && !(object instanceof Three.LineSegments)) {
|
|
137
113
|
var parent = object.parent;
|
|
138
114
|
if (!isEmpty(parent)) {
|
|
@@ -160,7 +136,7 @@ function applyEdges(object) {
|
|
|
160
136
|
}
|
|
161
137
|
}
|
|
162
138
|
}
|
|
163
|
-
function replaceMeshesWithLineSegments(object) {
|
|
139
|
+
export function replaceMeshesWithLineSegments(object) {
|
|
164
140
|
if (object && object.children.length > 0) {
|
|
165
141
|
for (var i = object.children.length - 1; i >= 0; i--) {
|
|
166
142
|
var child = object.children[i];
|
|
@@ -173,15 +149,15 @@ function replaceMeshesWithLineSegments(object) {
|
|
|
173
149
|
applyEdges(object);
|
|
174
150
|
}
|
|
175
151
|
}
|
|
176
|
-
var isEmpty =
|
|
177
|
-
return value === undefined || value === null || typeof value === 'array' && value.length === 0 || (
|
|
152
|
+
export var isEmpty = function isEmpty(value) {
|
|
153
|
+
return value === undefined || value === null || typeof value === 'array' && value.length === 0 || _typeof(value) === 'object' && Object.keys(value).length === 0 || typeof value === 'string' && value.trim().length === 0;
|
|
178
154
|
};
|
|
179
155
|
|
|
180
156
|
// animate the Opening or Closing Door action
|
|
181
|
-
var animateDoor =
|
|
157
|
+
export var animateDoor = function animateDoor(offsetData, doorObj, open_doors, item, isCorner, mode) {
|
|
182
158
|
var offset = new Three.Vector3(offsetData.x, offsetData.y, offsetData === null || offsetData === void 0 ? void 0 : offsetData.z);
|
|
183
159
|
doorObj.translateOnAxis(offset, 1);
|
|
184
|
-
var rotation = doorObj.name.match(/\d_(door[^LR1-9]*)(_[LR])?(_[1-9])?$/)[2] === '_L' ? -
|
|
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;
|
|
185
161
|
var isflip = item.properties.flip_doorhandle;
|
|
186
162
|
rotation = isflip ? -rotation : rotation;
|
|
187
163
|
if (isCorner == 1) {
|
|
@@ -199,22 +175,22 @@ var animateDoor = exports.animateDoor = function animateDoor(offsetData, doorObj
|
|
|
199
175
|
} else {
|
|
200
176
|
rotation = open_doors ? rotation : -rotation;
|
|
201
177
|
}
|
|
202
|
-
if (mode === 'Opened2D') rotation *=
|
|
178
|
+
if (mode === 'Opened2D') rotation *= ANIMATE_STEP_MAX; // Check whether the object's door is opened in 2D.
|
|
203
179
|
doorObj.rotateY(rotation);
|
|
204
180
|
doorObj.translateOnAxis(offset, -1);
|
|
205
181
|
};
|
|
206
182
|
|
|
207
183
|
// Opening or Closing the drawer action
|
|
208
|
-
var translateDrawer =
|
|
209
|
-
var animate_translate_unit =
|
|
184
|
+
export var translateDrawer = function translateDrawer(item, drawerObj, open_doors, mode) {
|
|
185
|
+
var animate_translate_unit = convert(item.properties.depth._length).from(item.properties.depth._unit).to('cm') * (1 / 2) / ANIMATE_STEP_MAX * 0.01;
|
|
210
186
|
// Check whether the object's drawer is opened in 2D.
|
|
211
|
-
if (mode === 'Opened2D') animate_translate_unit *=
|
|
187
|
+
if (mode === 'Opened2D') animate_translate_unit *= ANIMATE_STEP_MAX;
|
|
212
188
|
drawerObj.translateZ(open_doors ? -animate_translate_unit : animate_translate_unit);
|
|
213
189
|
};
|
|
214
|
-
var getPath =
|
|
190
|
+
export var getPath = function getPath() {
|
|
215
191
|
return window.location.pathname;
|
|
216
192
|
};
|
|
217
|
-
var getPathInfo =
|
|
193
|
+
export var getPathInfo = function getPathInfo(num) {
|
|
218
194
|
var paths = window.location.pathname.split('/');
|
|
219
195
|
if (paths.length >= num + 1) {
|
|
220
196
|
return paths[num];
|
|
@@ -224,8 +200,8 @@ var getPathInfo = exports.getPathInfo = function getPathInfo(num) {
|
|
|
224
200
|
};
|
|
225
201
|
|
|
226
202
|
// determine if elevation mode or not
|
|
227
|
-
function isElevationView(mode) {
|
|
228
|
-
if (mode ===
|
|
203
|
+
export function isElevationView(mode) {
|
|
204
|
+
if (mode === MODE_ELEVATION_VIEW) return true;else return false;
|
|
229
205
|
}
|
|
230
206
|
|
|
231
207
|
// calculate camera rect in elevation mode
|
|
@@ -246,7 +222,7 @@ function isElevationView(mode) {
|
|
|
246
222
|
//// g //// **i i** //// g ////
|
|
247
223
|
//// h //// **l***************lineLength*************l** //// h ////
|
|
248
224
|
//// t /////////////////////// width //////////////////////// t ////
|
|
249
|
-
function handleCamRect(width, height, ceilHeight, lineLength) {
|
|
225
|
+
export function handleCamRect(width, height, ceilHeight, lineLength) {
|
|
250
226
|
var scale = Math.min(width * 0.6 / lineLength, height * 0.6 / ceilHeight); // scale is min value
|
|
251
227
|
var cameraRect = {
|
|
252
228
|
width: width / scale,
|
|
@@ -262,29 +238,29 @@ function handleCamRect(width, height, ceilHeight, lineLength) {
|
|
|
262
238
|
* @param {*} ceilUnit
|
|
263
239
|
* @returns true ceilingHeight is bigger than totalHeight(item's height + altitude), otherwise false
|
|
264
240
|
*/
|
|
265
|
-
function isCeilLimitation(layer, ceilHeight, ceilUnit) {
|
|
241
|
+
export function isCeilLimitation(layer, ceilHeight, ceilUnit) {
|
|
266
242
|
var items = layer.getIn(['layers', layer.selectedLayer, 'items']);
|
|
267
243
|
return items.some(function (item) {
|
|
268
244
|
var height = item.properties.getIn(['height', '_length']);
|
|
269
245
|
var heightUnit = item.properties.getIn(['height', '_unit']);
|
|
270
246
|
var altitude = item.properties.getIn(['altitude', '_length']);
|
|
271
247
|
var altitudeUnit = item.properties.getIn(['altitude', '_unit']);
|
|
272
|
-
var totalHeight =
|
|
248
|
+
var totalHeight = convert(height).from(heightUnit).to(ceilUnit._unit) + convert(altitude).from(altitudeUnit).to(ceilUnit._unit);
|
|
273
249
|
return totalHeight > ceilHeight;
|
|
274
250
|
});
|
|
275
251
|
}
|
|
276
|
-
function isValidNumber(n) {
|
|
252
|
+
export function isValidNumber(n) {
|
|
277
253
|
return !isNaN(n) && isFinite(n);
|
|
278
254
|
}
|
|
279
|
-
function toPlainObject(maybeImmutable) {
|
|
255
|
+
export function toPlainObject(maybeImmutable) {
|
|
280
256
|
if (maybeImmutable && typeof maybeImmutable.toJS === 'function') {
|
|
281
257
|
return maybeImmutable.toJS();
|
|
282
258
|
}
|
|
283
259
|
return maybeImmutable; // already a plain JS object
|
|
284
260
|
}
|
|
285
|
-
function isImmutable(maybeImmutable) {
|
|
261
|
+
export function isImmutable(maybeImmutable) {
|
|
286
262
|
return !!(maybeImmutable && typeof maybeImmutable.toJS === 'function');
|
|
287
263
|
}
|
|
288
|
-
function debugUtil() {
|
|
264
|
+
export function debugUtil() {
|
|
289
265
|
return new Date();
|
|
290
266
|
}
|
package/es/utils/history.js
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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) {
|
|
1
|
+
import { Map } from 'immutable';
|
|
2
|
+
import diff from 'immutablediff';
|
|
3
|
+
import patch from 'immutablepatch';
|
|
4
|
+
export var historyPush = function historyPush(historyStructure, item) {
|
|
12
5
|
if (historyStructure.last) {
|
|
13
6
|
if (historyStructure.last.hashCode() !== item.hashCode()) {
|
|
14
|
-
var toPush = new
|
|
7
|
+
var toPush = new Map({
|
|
15
8
|
time: Date.now(),
|
|
16
|
-
diff: (
|
|
9
|
+
diff: diff(historyStructure.last, item)
|
|
17
10
|
});
|
|
18
11
|
historyStructure = historyStructure.set('last', item).set('list', historyStructure.list.push(toPush));
|
|
19
12
|
}
|
|
@@ -22,12 +15,12 @@ var historyPush = exports.historyPush = function historyPush(historyStructure, i
|
|
|
22
15
|
}
|
|
23
16
|
return historyStructure;
|
|
24
17
|
};
|
|
25
|
-
var historyPop =
|
|
18
|
+
export var historyPop = function historyPop(historyStructure) {
|
|
26
19
|
if (historyStructure.last) {
|
|
27
20
|
if (historyStructure.list.size) {
|
|
28
21
|
var last = historyStructure.first;
|
|
29
22
|
for (var x = 0; x < historyStructure.list.size - 1; x++) {
|
|
30
|
-
last = (
|
|
23
|
+
last = patch(last, historyStructure.list.get(x).get('diff'));
|
|
31
24
|
}
|
|
32
25
|
historyStructure = historyStructure.set('last', last).set('list', historyStructure.list.pop());
|
|
33
26
|
}
|
package/es/utils/id-broker.js
CHANGED
|
@@ -1,22 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = exports.IDBroker = void 0;
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _nanoid = require("nanoid");
|
|
11
|
-
var IDBroker = exports.IDBroker = /*#__PURE__*/function () {
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import { nanoid } from 'nanoid';
|
|
4
|
+
export var IDBroker = /*#__PURE__*/function () {
|
|
12
5
|
function IDBroker() {
|
|
13
|
-
(
|
|
6
|
+
_classCallCheck(this, IDBroker);
|
|
14
7
|
}
|
|
15
|
-
return (
|
|
8
|
+
return _createClass(IDBroker, null, [{
|
|
16
9
|
key: "acquireID",
|
|
17
10
|
value: function acquireID() {
|
|
18
|
-
return
|
|
11
|
+
return nanoid();
|
|
19
12
|
}
|
|
20
13
|
}]);
|
|
21
14
|
}();
|
|
22
|
-
|
|
15
|
+
export default IDBroker;
|
package/es/utils/logger.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.LogLine = LogLine;
|
|
7
|
-
function LogLine(state, layerID, lineID) {
|
|
1
|
+
export function LogLine(state, layerID, lineID) {
|
|
8
2
|
var layer = state.getIn(['scene', 'layers', layerID]);
|
|
9
3
|
var line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
|
|
10
4
|
var vertex0 = layer.vertices.get(line.vertices.get(0));
|
package/es/utils/math.js
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
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;
|
|
8
1
|
/** @description Return float fixed to desired precision
|
|
9
2
|
* @param {number} num Float to fix
|
|
10
3
|
* @param {number} precision Desired precision, or 6 if not specified
|
|
11
4
|
* @return {number}
|
|
12
5
|
*/
|
|
13
|
-
function toFixedFloat(num) {
|
|
6
|
+
export function toFixedFloat(num) {
|
|
14
7
|
var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
|
|
15
8
|
if (num && precision) {
|
|
16
9
|
return parseFloat(parseFloat(num).toFixed(precision));
|
|
@@ -22,7 +15,7 @@ function toFixedFloat(num) {
|
|
|
22
15
|
* @param {number} n Number of wich get value without sign
|
|
23
16
|
* @return {number}
|
|
24
17
|
*/
|
|
25
|
-
var fAbs =
|
|
18
|
+
export var fAbs = function fAbs(n) {
|
|
26
19
|
return Math.abs(n);
|
|
27
20
|
// let x = n;
|
|
28
21
|
// x < 0 && (x = ~x + 1);
|
|
@@ -34,7 +27,7 @@ var fAbs = exports.fAbs = function fAbs(n) {
|
|
|
34
27
|
* @param {Array} m2 Matrix 2
|
|
35
28
|
* @return {Array}
|
|
36
29
|
*/
|
|
37
|
-
var multiplyMatrices =
|
|
30
|
+
export var multiplyMatrices = function multiplyMatrices(m1, m2) {
|
|
38
31
|
var result = [];
|
|
39
32
|
for (var i = 0; i < m1.length; i++) {
|
|
40
33
|
result[i] = [];
|
|
@@ -48,10 +41,10 @@ var multiplyMatrices = exports.multiplyMatrices = function multiplyMatrices(m1,
|
|
|
48
41
|
}
|
|
49
42
|
return result;
|
|
50
43
|
};
|
|
51
|
-
var formatNumber =
|
|
44
|
+
export var formatNumber = function formatNumber(value, digits) {
|
|
52
45
|
if (value == null || isNaN(Number(value))) return value; // guard for null/undefined/non-numeric
|
|
53
46
|
return Number(value).toFixed(digits);
|
|
54
47
|
};
|
|
55
|
-
var isNonZeroText =
|
|
48
|
+
export var isNonZeroText = function isNonZeroText(text) {
|
|
56
49
|
return parseFloat(text) !== 0;
|
|
57
50
|
};
|