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,30 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
var _export = require("./export");
|
|
15
|
-
var Scene = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
7
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
8
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
|
+
import React, { Component } from 'react';
|
|
11
|
+
import PropTypes from 'prop-types';
|
|
12
|
+
import { Grids, Layer } from "./export";
|
|
13
|
+
var Scene = /*#__PURE__*/function (_Component) {
|
|
16
14
|
function Scene() {
|
|
17
|
-
(
|
|
18
|
-
return (
|
|
15
|
+
_classCallCheck(this, Scene);
|
|
16
|
+
return _callSuper(this, Scene, arguments);
|
|
19
17
|
}
|
|
20
|
-
(
|
|
21
|
-
return (
|
|
18
|
+
_inherits(Scene, _Component);
|
|
19
|
+
return _createClass(Scene, [{
|
|
22
20
|
key: "componentWillReceiveProps",
|
|
23
21
|
value: function () {
|
|
24
|
-
var _componentWillReceiveProps = (
|
|
22
|
+
var _componentWillReceiveProps = _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(nextProps) {
|
|
25
23
|
var scene, catalog, height, layers, selectedLayer, msg, isNotFoundInElements, itemType;
|
|
26
|
-
return
|
|
27
|
-
while (1) switch (_context.
|
|
24
|
+
return regeneratorRuntime.wrap(function (_context) {
|
|
25
|
+
while (1) switch (_context.prev = _context.next) {
|
|
28
26
|
case 0:
|
|
29
27
|
// console.log("componentDidMount", this.props.scene.hashCode(), nextProps.scene.hashCode());
|
|
30
28
|
if (this.props.scene.hashCode() !== nextProps.scene.hashCode()) {
|
|
@@ -56,7 +54,8 @@ var Scene = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
56
54
|
// }
|
|
57
55
|
}
|
|
58
56
|
case 1:
|
|
59
|
-
|
|
57
|
+
case "end":
|
|
58
|
+
return _context.stop();
|
|
60
59
|
}
|
|
61
60
|
}, _callee, this);
|
|
62
61
|
}));
|
|
@@ -81,22 +80,22 @@ var Scene = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
81
80
|
var height = scene.height,
|
|
82
81
|
layers = scene.layers;
|
|
83
82
|
var selectedLayer = layers.get(scene.selectedLayer);
|
|
84
|
-
return /*#__PURE__*/
|
|
83
|
+
return /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement(Grids, {
|
|
85
84
|
scene: scene
|
|
86
|
-
}), /*#__PURE__*/
|
|
85
|
+
}), /*#__PURE__*/React.createElement("g", {
|
|
87
86
|
style: {
|
|
88
87
|
pointerEvents: 'none'
|
|
89
88
|
}
|
|
90
89
|
}, layers.entrySeq().filter(function (_ref) {
|
|
91
|
-
var _ref2 = (
|
|
90
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
92
91
|
layerID = _ref2[0],
|
|
93
92
|
layer = _ref2[1];
|
|
94
93
|
return layerID !== scene.selectedLayer && layer.visible;
|
|
95
94
|
}).map(function (_ref3) {
|
|
96
|
-
var _ref4 = (
|
|
95
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
97
96
|
layerID = _ref4[0],
|
|
98
97
|
layer = _ref4[1];
|
|
99
|
-
return /*#__PURE__*/
|
|
98
|
+
return /*#__PURE__*/React.createElement(Layer, {
|
|
100
99
|
key: layerID,
|
|
101
100
|
layer: layer,
|
|
102
101
|
scene: scene,
|
|
@@ -105,7 +104,7 @@ var Scene = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
105
104
|
state: _this.props.state,
|
|
106
105
|
relatedLines: _this.props.relatedLines
|
|
107
106
|
});
|
|
108
|
-
})), /*#__PURE__*/
|
|
107
|
+
})), /*#__PURE__*/React.createElement(Layer, {
|
|
109
108
|
key: selectedLayer.id,
|
|
110
109
|
layer: selectedLayer,
|
|
111
110
|
scene: scene,
|
|
@@ -116,12 +115,13 @@ var Scene = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
116
115
|
}));
|
|
117
116
|
}
|
|
118
117
|
}]);
|
|
119
|
-
}(
|
|
118
|
+
}(Component);
|
|
119
|
+
export { Scene as default };
|
|
120
120
|
Scene.propTypes = {
|
|
121
|
-
scene:
|
|
122
|
-
catalog:
|
|
123
|
-
relatedLines:
|
|
121
|
+
scene: PropTypes.object.isRequired,
|
|
122
|
+
catalog: PropTypes.object.isRequired,
|
|
123
|
+
relatedLines: PropTypes.object.isRequired
|
|
124
124
|
};
|
|
125
125
|
Scene.contextTypes = {
|
|
126
|
-
projectActions:
|
|
126
|
+
projectActions: PropTypes.object.isRequired
|
|
127
127
|
};
|
|
@@ -1,30 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports["default"] = ActiveDrawingHelper;
|
|
5
|
-
var _react = _interopRequireDefault(require("react"));
|
|
6
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
7
|
-
var Geometry = _interopRequireWildcard(require("../../utils/geometry"));
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import * as Geometry from "../../utils/geometry";
|
|
8
4
|
var STYLE = {
|
|
9
5
|
stroke: '#D32F2F',
|
|
10
6
|
strokeWidth: '1px'
|
|
11
7
|
};
|
|
12
|
-
function ActiveDrawingHelper(_ref) {
|
|
8
|
+
export default function ActiveDrawingHelper(_ref) {
|
|
13
9
|
var snap = _ref.snap,
|
|
14
10
|
width = _ref.width,
|
|
15
11
|
height = _ref.height;
|
|
16
12
|
switch (snap.type) {
|
|
17
13
|
case 'point':
|
|
18
|
-
return /*#__PURE__*/
|
|
14
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
19
15
|
transform: "translate(".concat(snap.x, " ").concat(snap.y, ")")
|
|
20
|
-
}, /*#__PURE__*/
|
|
16
|
+
}, /*#__PURE__*/React.createElement("line", {
|
|
21
17
|
name: "line_type_ActiveDrawingHelper",
|
|
22
18
|
x1: "0",
|
|
23
19
|
y1: "-70",
|
|
24
20
|
x2: "0",
|
|
25
21
|
y2: "70",
|
|
26
22
|
style: STYLE
|
|
27
|
-
}), /*#__PURE__*/
|
|
23
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
28
24
|
name: "line_type_ActiveDrawingHelper",
|
|
29
25
|
x1: "-70",
|
|
30
26
|
y1: "0",
|
|
@@ -41,7 +37,7 @@ function ActiveDrawingHelper(_ref) {
|
|
|
41
37
|
var v1 = Geometry.verticalLine(width);
|
|
42
38
|
var pointV0 = Geometry.twoLinesIntersection(snap.a, snap.b, snap.c, v0.a, v0.b, v0.c);
|
|
43
39
|
var pointV1 = Geometry.twoLinesIntersection(snap.a, snap.b, snap.c, v1.a, v1.b, v1.c);
|
|
44
|
-
if (pointH0 && pointH1) return /*#__PURE__*/
|
|
40
|
+
if (pointH0 && pointH1) return /*#__PURE__*/React.createElement("line", {
|
|
45
41
|
name: "line_type_ActiveDrawingHelper",
|
|
46
42
|
x1: pointH0.x,
|
|
47
43
|
y1: pointH0.y,
|
|
@@ -49,7 +45,7 @@ function ActiveDrawingHelper(_ref) {
|
|
|
49
45
|
y2: pointH1.y,
|
|
50
46
|
style: STYLE
|
|
51
47
|
});
|
|
52
|
-
if (pointV0 && pointV1) return /*#__PURE__*/
|
|
48
|
+
if (pointV0 && pointV1) return /*#__PURE__*/React.createElement("line", {
|
|
53
49
|
name: "line_type_ActiveDrawingHelper",
|
|
54
50
|
x1: pointV0.x,
|
|
55
51
|
y1: pointV0.y,
|
|
@@ -59,7 +55,7 @@ function ActiveDrawingHelper(_ref) {
|
|
|
59
55
|
});
|
|
60
56
|
return null;
|
|
61
57
|
case 'line-segment':
|
|
62
|
-
return /*#__PURE__*/
|
|
58
|
+
return /*#__PURE__*/React.createElement("line", {
|
|
63
59
|
name: "line_type_ActiveDrawingHelper",
|
|
64
60
|
x1: snap.x1,
|
|
65
61
|
y1: snap.y1,
|
|
@@ -72,7 +68,7 @@ function ActiveDrawingHelper(_ref) {
|
|
|
72
68
|
}
|
|
73
69
|
}
|
|
74
70
|
ActiveDrawingHelper.propTypes = {
|
|
75
|
-
snap:
|
|
76
|
-
width:
|
|
77
|
-
height:
|
|
71
|
+
snap: PropTypes.object.isRequired,
|
|
72
|
+
width: PropTypes.number.isRequired,
|
|
73
|
+
height: PropTypes.number.isRequired
|
|
78
74
|
};
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
-
var _scene = _interopRequireDefault(require("./scene"));
|
|
9
|
-
var _snap = _interopRequireDefault(require("./snap"));
|
|
10
|
-
var SharedStyle = _interopRequireWildcard(require("../../shared-style"));
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import Scene from "./scene";
|
|
5
|
+
import Snap from "./snap";
|
|
6
|
+
import * as SharedStyle from "../../shared-style";
|
|
11
7
|
var guideStyle = {
|
|
12
8
|
stroke: SharedStyle.SECONDARY_COLOR.main,
|
|
13
9
|
strokewidth: '2.5px'
|
|
14
10
|
};
|
|
15
|
-
function State(_ref) {
|
|
11
|
+
export default function State(_ref) {
|
|
16
12
|
var state = _ref.state,
|
|
17
13
|
catalog = _ref.catalog,
|
|
18
14
|
relatedLines = _ref.relatedLines;
|
|
@@ -21,7 +17,7 @@ function State(_ref) {
|
|
|
21
17
|
scene = state.scene;
|
|
22
18
|
var width = scene.width,
|
|
23
19
|
height = scene.height;
|
|
24
|
-
activeSnapElement = activeSnapElement ? /*#__PURE__*/
|
|
20
|
+
activeSnapElement = activeSnapElement ? /*#__PURE__*/React.createElement(Snap, {
|
|
25
21
|
snap: activeSnapElement,
|
|
26
22
|
width: scene.width,
|
|
27
23
|
height: scene.height
|
|
@@ -29,25 +25,25 @@ function State(_ref) {
|
|
|
29
25
|
// snapElements = snapElements.map((snap,id) => <Snap key={id} snap={snap} width={scene.width} height={scene.height}/>);
|
|
30
26
|
snapElements = null; //only for debug purpose
|
|
31
27
|
|
|
32
|
-
return /*#__PURE__*/
|
|
28
|
+
return /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("rect", {
|
|
33
29
|
x: "0",
|
|
34
30
|
y: "0",
|
|
35
31
|
width: width,
|
|
36
32
|
height: height,
|
|
37
33
|
fill: SharedStyle.COLORS.white
|
|
38
|
-
}), /*#__PURE__*/
|
|
34
|
+
}), /*#__PURE__*/React.createElement("g", {
|
|
39
35
|
transform: "translate(0, ".concat(scene.height, ") scale(1, -1)"),
|
|
40
36
|
id: "svg-drawing-paper"
|
|
41
|
-
}, /*#__PURE__*/
|
|
37
|
+
}, /*#__PURE__*/React.createElement(Scene, {
|
|
42
38
|
scene: scene,
|
|
43
39
|
state: state,
|
|
44
40
|
catalog: catalog,
|
|
45
41
|
relatedLines: relatedLines
|
|
46
42
|
}), scene.getIn(['guides', 'horizontal']).entrySeq().map(function (_ref2) {
|
|
47
|
-
var _ref3 = (
|
|
43
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
48
44
|
hgKey = _ref3[0],
|
|
49
45
|
hgVal = _ref3[1];
|
|
50
|
-
return /*#__PURE__*/
|
|
46
|
+
return /*#__PURE__*/React.createElement("line", {
|
|
51
47
|
id: 'hGuide' + hgKey,
|
|
52
48
|
key: hgKey,
|
|
53
49
|
x1: 0,
|
|
@@ -57,10 +53,10 @@ function State(_ref) {
|
|
|
57
53
|
style: guideStyle
|
|
58
54
|
});
|
|
59
55
|
}), scene.getIn(['guides', 'vertical']).entrySeq().map(function (_ref4) {
|
|
60
|
-
var _ref5 = (
|
|
56
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
|
61
57
|
vgKey = _ref5[0],
|
|
62
58
|
vgVal = _ref5[1];
|
|
63
|
-
return /*#__PURE__*/
|
|
59
|
+
return /*#__PURE__*/React.createElement("line", {
|
|
64
60
|
key: vgKey,
|
|
65
61
|
x1: vgVal,
|
|
66
62
|
y1: 0,
|
|
@@ -71,7 +67,7 @@ function State(_ref) {
|
|
|
71
67
|
}), activeSnapElement, snapElements));
|
|
72
68
|
}
|
|
73
69
|
State.propTypes = {
|
|
74
|
-
state:
|
|
75
|
-
catalog:
|
|
76
|
-
relatedLines:
|
|
70
|
+
state: PropTypes.object.isRequired,
|
|
71
|
+
catalog: PropTypes.object.isRequired,
|
|
72
|
+
relatedLines: PropTypes.object.isRequired
|
|
77
73
|
};
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.isEmpty = isEmpty;
|
|
7
|
-
exports.isEqualInstallationType = isEqualInstallationType;
|
|
8
|
-
exports.makeSKUForMagento = makeSKUForMagento;
|
|
9
|
-
exports.searchForSkuValue = exports.returnReplaceableDeepSearchType = void 0;
|
|
10
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
11
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/typeof"));
|
|
12
|
-
var _helper = require("../../utils/helper");
|
|
13
|
-
var _constants = require("../../constants");
|
|
14
|
-
var searchForSkuValue = exports.searchForSkuValue = function searchForSkuValue(catalog, selectedLayer, elementType) {
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
3
|
+
import { toPlainObject } from "../../utils/helper";
|
|
4
|
+
import { INSTALLATION_SUFFIX_TYPE, INSTALLATION_TYPE_NAME, INSTALLATION_TYPE_SKU_SUFFIX, TOE_KICK_MOLDING } from "../../constants";
|
|
5
|
+
export var searchForSkuValue = function searchForSkuValue(catalog, selectedLayer, elementType) {
|
|
15
6
|
return new Promise(function (resolve) {
|
|
16
7
|
if (elementType) {
|
|
17
8
|
Object.values(catalog.elements).forEach(function (value) {
|
|
@@ -48,39 +39,39 @@ var searchForSkuValue = exports.searchForSkuValue = function searchForSkuValue(c
|
|
|
48
39
|
});
|
|
49
40
|
});
|
|
50
41
|
};
|
|
51
|
-
var returnReplaceableDeepSearchType =
|
|
42
|
+
export var returnReplaceableDeepSearchType = function returnReplaceableDeepSearchType(type) {
|
|
52
43
|
var DeepSearchTypes = JSON.parse(sessionStorage.getItem('deepSearchTypes')) || [];
|
|
53
44
|
var replaceableType = DeepSearchTypes.find(function (item) {
|
|
54
45
|
return item.type === type;
|
|
55
46
|
});
|
|
56
47
|
return replaceableType && replaceableType.foundType || '';
|
|
57
48
|
};
|
|
58
|
-
function getInstallationSuffix(type) {
|
|
49
|
+
export function getInstallationSuffix(type) {
|
|
59
50
|
var _doorColor$isAssemble, _doorColor$install;
|
|
60
51
|
var doorColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
61
52
|
if (!doorColor) {
|
|
62
53
|
console.error('getInstallationSuffix received false argument : ', doorColor);
|
|
63
54
|
return doorColor;
|
|
64
55
|
}
|
|
65
|
-
doorColor =
|
|
56
|
+
doorColor = toPlainObject(doorColor);
|
|
66
57
|
|
|
67
58
|
// If doorColor.isAssembled is explicitly set → trust it.
|
|
68
59
|
// Else → fall back to checking install.
|
|
69
|
-
var isAssembled = (_doorColor$isAssemble = doorColor.isAssembled) !== null && _doorColor$isAssemble !== void 0 ? _doorColor$isAssemble : ((_doorColor$install = doorColor.install) === null || _doorColor$install === void 0 ? void 0 : _doorColor$install.toLowerCase()) ===
|
|
70
|
-
if (type ===
|
|
71
|
-
return isAssembled ?
|
|
60
|
+
var isAssembled = (_doorColor$isAssemble = doorColor.isAssembled) !== null && _doorColor$isAssemble !== void 0 ? _doorColor$isAssemble : ((_doorColor$install = doorColor.install) === null || _doorColor$install === void 0 ? void 0 : _doorColor$install.toLowerCase()) === INSTALLATION_TYPE_NAME.ASSEMBLED.toLowerCase();
|
|
61
|
+
if (type === INSTALLATION_SUFFIX_TYPE.SKU) {
|
|
62
|
+
return isAssembled ? INSTALLATION_TYPE_SKU_SUFFIX.ASSEMBLED : INSTALLATION_TYPE_SKU_SUFFIX.RTA;
|
|
72
63
|
} else {
|
|
73
|
-
return isAssembled ?
|
|
64
|
+
return isAssembled ? INSTALLATION_TYPE_NAME.ASSEMBLED : INSTALLATION_TYPE_NAME.RTA;
|
|
74
65
|
}
|
|
75
66
|
}
|
|
76
|
-
function isEqualInstallationType(doorColor1, doorColor2) {
|
|
67
|
+
export function isEqualInstallationType(doorColor1, doorColor2) {
|
|
77
68
|
var _getInstallationSuffi, _getInstallationSuffi2;
|
|
78
|
-
return ((_getInstallationSuffi = getInstallationSuffix(
|
|
69
|
+
return ((_getInstallationSuffi = getInstallationSuffix(INSTALLATION_SUFFIX_TYPE.NAME, doorColor1)) === null || _getInstallationSuffi === void 0 ? void 0 : _getInstallationSuffi.toLowerCase()) === ((_getInstallationSuffi2 = getInstallationSuffix(INSTALLATION_SUFFIX_TYPE.NAME, doorColor2)) === null || _getInstallationSuffi2 === void 0 ? void 0 : _getInstallationSuffi2.toLowerCase());
|
|
79
70
|
}
|
|
80
71
|
function buildSKU(baseSKU) {
|
|
81
72
|
var doorColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
82
73
|
var colorSuffix = doorColor.color_sku_alias || doorColor.sku || '';
|
|
83
|
-
var installationSuffix = getInstallationSuffix(
|
|
74
|
+
var installationSuffix = getInstallationSuffix(INSTALLATION_SUFFIX_TYPE.SKU, doorColor);
|
|
84
75
|
return [baseSKU, colorSuffix, installationSuffix].filter(Boolean).join('-');
|
|
85
76
|
}
|
|
86
77
|
function buildToeKickSKU() {
|
|
@@ -118,17 +109,17 @@ function buildRegularSKU(element, catalog) {
|
|
|
118
109
|
|
|
119
110
|
// element : cabinet
|
|
120
111
|
// catalog : all cabinet info
|
|
121
|
-
function makeSKUForMagento(element, catalog, categoryData) {
|
|
112
|
+
export function makeSKUForMagento(element, catalog, categoryData) {
|
|
122
113
|
var _element$category;
|
|
123
114
|
if ((_element$category = element.category) !== null && _element$category !== void 0 && _element$category.toLowerCase().includes('molding')) {
|
|
124
115
|
element.type = element.name;
|
|
125
116
|
}
|
|
126
|
-
var doorColor =
|
|
117
|
+
var doorColor = toPlainObject(element.doorStyle);
|
|
127
118
|
if (!doorColor) return false;
|
|
128
|
-
return element.name ===
|
|
119
|
+
return element.name === TOE_KICK_MOLDING ? buildToeKickSKU(doorColor, catalog) : buildRegularSKU(element, catalog, doorColor);
|
|
129
120
|
}
|
|
130
|
-
function isEmpty(value) {
|
|
131
|
-
if (value === undefined || value === null || (
|
|
121
|
+
export function isEmpty(value) {
|
|
122
|
+
if (value === undefined || value === null || _typeof(value) === 'object' && Object.keys(value).length === 0 || typeof value === 'string' && value.trim().length === 0) return true;else return false;
|
|
132
123
|
}
|
|
133
124
|
var saveDeepSearchType = function saveDeepSearchType(type, foundType) {
|
|
134
125
|
var DeepSearchTypes = JSON.parse(sessionStorage.getItem('deepSearchTypes')) || [];
|
|
@@ -148,7 +139,7 @@ var saveDeepSearchType = function saveDeepSearchType(type, foundType) {
|
|
|
148
139
|
* @param {Boolean} flag true: for thumbnail, false: default value
|
|
149
140
|
* @returns
|
|
150
141
|
*/
|
|
151
|
-
var getToeKickSKU =
|
|
142
|
+
export var getToeKickSKU = function getToeKickSKU() {
|
|
152
143
|
var doorColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
153
144
|
var catalog = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
154
145
|
var flag = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
@@ -157,7 +148,7 @@ var getToeKickSKU = exports.getToeKickSKU = function getToeKickSKU() {
|
|
|
157
148
|
var skuData = '';
|
|
158
149
|
Object.keys(catalogData).forEach(function (data) {
|
|
159
150
|
var obj = catalogData[data].obj;
|
|
160
|
-
if ((obj === null || obj === void 0 ? void 0 : obj.cabinet_category) ===
|
|
151
|
+
if ((obj === null || obj === void 0 ? void 0 : obj.cabinet_category) === TOE_KICK_MOLDING) {
|
|
161
152
|
var _obj$skuArray;
|
|
162
153
|
var found = (_obj$skuArray = obj.skuArray) === null || _obj$skuArray === void 0 ? void 0 : _obj$skuArray.find(function (cData) {
|
|
163
154
|
return cData.door_color_id === itemDoorColorID;
|
|
@@ -185,13 +176,13 @@ function normalize(point) {
|
|
|
185
176
|
}
|
|
186
177
|
return point;
|
|
187
178
|
}
|
|
188
|
-
var areaPolygon =
|
|
179
|
+
export var areaPolygon = function areaPolygon(points) {
|
|
189
180
|
var signed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
190
181
|
if (!Array.isArray(points) || points.length < 3) return 0;
|
|
191
182
|
|
|
192
183
|
// normalize and ensure closed ring (without mutating input)
|
|
193
184
|
var pts = points.map(normalize);
|
|
194
|
-
var closed = pts.length > 0 && (pts[0].x !== pts[pts.length - 1].x || pts[0].y !== pts[pts.length - 1].y) ? [].concat((
|
|
185
|
+
var closed = pts.length > 0 && (pts[0].x !== pts[pts.length - 1].x || pts[0].y !== pts[pts.length - 1].y) ? [].concat(_toConsumableArray(pts), [pts[0]]) : pts;
|
|
195
186
|
var det = 0;
|
|
196
187
|
var l = closed.length - 1; // last index before the duplicated first point
|
|
197
188
|
for (var i = 0; i < l; i++) {
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports["default"] = Vertex;
|
|
5
|
-
var _react = _interopRequireDefault(require("react"));
|
|
6
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
7
|
-
var SharedStyle = _interopRequireWildcard(require("../../shared-style"));
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import * as SharedStyle from "../../shared-style";
|
|
8
4
|
//Space from the center of the point(Use cases:x - vertexthickness,y + vertexthickness )
|
|
9
5
|
var vertexthickness = 4;
|
|
10
6
|
var STYLE = {
|
|
@@ -15,7 +11,7 @@ var STYLE = {
|
|
|
15
11
|
fill: SharedStyle.LINE_MESH_COLOR.selected,
|
|
16
12
|
cursor: 'move'
|
|
17
13
|
};
|
|
18
|
-
function Vertex(_ref) {
|
|
14
|
+
export default function Vertex(_ref) {
|
|
19
15
|
var vertex = _ref.vertex,
|
|
20
16
|
layer = _ref.layer;
|
|
21
17
|
var x = vertex.x,
|
|
@@ -52,18 +48,18 @@ function Vertex(_ref) {
|
|
|
52
48
|
}
|
|
53
49
|
}
|
|
54
50
|
}
|
|
55
|
-
return /*#__PURE__*/
|
|
51
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
56
52
|
"data-element-root": true,
|
|
57
53
|
"data-prototype": vertex.prototype,
|
|
58
54
|
"data-id": vertex.id,
|
|
59
55
|
"data-selected": vertex.selected,
|
|
60
56
|
"data-layer": layer.id
|
|
61
|
-
}, /*#__PURE__*/
|
|
57
|
+
}, /*#__PURE__*/React.createElement("polygon", {
|
|
62
58
|
points: "".concat(x - vertexthickness, ",").concat(y + vertexthickness, " ").concat(x - vertexthickness, ",").concat(y - vertexthickness, " ").concat(x + vertexthickness, ",").concat(y - vertexthickness, " ").concat(x + vertexthickness, ",").concat(y + vertexthickness),
|
|
63
59
|
style: STYLE
|
|
64
60
|
}));
|
|
65
61
|
}
|
|
66
62
|
Vertex.propTypes = {
|
|
67
|
-
vertex:
|
|
68
|
-
layer:
|
|
63
|
+
vertex: PropTypes.object.isRequired,
|
|
64
|
+
layer: PropTypes.object.isRequired
|
|
69
65
|
};
|