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