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