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