kitchen-simulator 1.1.1-test.6 → 1.1.1-test.60
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/KitchenConfigurator.js +8 -15
- package/es/KitchenConfiguratorApp.js +11 -27
- package/es/actions/holes-actions.js +1 -1
- package/es/actions/items-actions.js +1 -1
- package/es/actions/lines-actions.js +1 -1
- package/es/actions/project-actions.js +1 -1
- package/es/actions/scene-actions.js +1 -1
- package/es/actions/vertices-actions.js +1 -1
- package/es/actions/viewer2d-actions.js +1 -1
- package/es/actions/viewer3d-actions.js +1 -1
- package/es/catalog/areas/area/planner-element.js +10 -7
- package/es/catalog/factories/wall-factory-3d.js +1 -1
- package/es/catalog/holes/export.js +13 -13
- package/es/catalog/lines/wall/planner-element.js +13 -10
- package/es/catalog/properties/property-checkbox.js +63 -18
- package/es/catalog/properties/property-enum.js +51 -9
- package/es/catalog/properties/property-lenght-measure.js +2 -2
- package/es/catalog/properties/property-length-measure.js +58 -9
- package/es/catalog/properties/property-length-measure_hole.js +2 -2
- package/es/catalog/utils/exporter.js +1 -1
- package/es/catalog/utils/item-loader.js +1 -1
- package/es/catalog/utils/mtl-loader.js +3 -2
- package/es/catalog/utils/obj-loader.js +3 -2
- package/es/class/area.js +1 -1
- package/es/class/group.js +3 -3
- package/es/class/hole.js +5 -6
- package/es/class/item.js +8 -10
- package/es/class/layer.js +2 -2
- package/es/class/project.js +4 -4
- package/es/components/content.js +1 -0
- package/es/components/disclaimer/disclaimer.js +66 -86
- package/es/components/style/form-number-input.js +31 -7
- package/es/components/style/form-select.js +56 -8
- package/es/components/style/form-slider.js +22 -6
- package/es/components/style/form-text-input.js +31 -12
- package/es/components/viewer2d/area.js +4 -4
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +0 -1
- package/es/components/viewer2d/grids/grid-streak.js +0 -1
- package/es/components/viewer2d/grids/grid-vertical-streak.js +0 -1
- package/es/components/viewer2d/item.js +3 -5
- package/es/components/viewer2d/line.js +2 -5
- package/es/components/viewer2d/ruler.js +2 -3
- package/es/components/viewer2d/rulerDist.js +1 -1
- package/es/components/viewer2d/scene.js +2 -2
- package/es/components/viewer2d/utils.js +37 -1
- package/es/components/viewer2d/viewer2d.js +10 -4
- package/es/components/viewer3d/libs/mtl-loader.js +2 -2
- package/es/components/viewer3d/libs/obj-loader.js +2 -2
- package/es/components/viewer3d/libs/orbit-controls.js +6 -5
- package/es/components/viewer3d/libs/pointer-lock-controls.js +5 -4
- package/es/components/viewer3d/ruler-utils/itemRect.js +1 -1
- package/es/components/viewer3d/ruler-utils/layer3D.js +2 -2
- package/es/components/viewer3d/ruler-utils/scene3D.js +2 -3
- package/es/components/viewer3d/scene-creator.js +1 -1
- package/es/components/viewer3d/viewer3d.js +12 -13
- package/es/index.js +20 -14
- package/es/models.js +4 -3
- package/es/plugins/keyboard.js +2 -2
- package/es/reducers/holes-reducer.js +1 -1
- package/es/reducers/items-reducer.js +2 -5
- package/es/reducers/lines-reducer.js +1 -1
- package/es/reducers/project-reducer.js +1 -1
- package/es/reducers/reducer.js +2 -2
- package/es/reducers/scene-reducer.js +1 -1
- package/es/reducers/user-reducer.js +1 -2
- package/es/reducers/vertices-reducer.js +1 -1
- package/es/reducers/viewer2d-reducer.js +2 -2
- package/es/reducers/viewer3d-reducer.js +2 -2
- package/es/utils/convert-units-lite.js +29 -0
- package/es/utils/geometry.js +4 -4
- package/es/utils/get-edges-of-subgraphs.js +2 -1
- package/es/utils/graph-cycles.js +2 -3
- package/es/utils/graph.js +2 -1
- package/es/utils/helper.js +1 -69
- package/es/utils/id-broker.js +2 -2
- package/es/utils/molding.js +34 -34
- package/lib/KitchenConfigurator.js +33 -40
- package/lib/KitchenConfiguratorApp.js +34 -49
- package/lib/catalog/areas/area/planner-element.js +12 -8
- package/lib/catalog/factories/wall-factory-3d.js +2 -2
- package/lib/catalog/holes/export.js +13 -13
- package/lib/catalog/lines/wall/planner-element.js +15 -11
- package/lib/catalog/properties/property-checkbox.js +64 -19
- package/lib/catalog/properties/property-enum.js +49 -7
- package/lib/catalog/properties/property-lenght-measure.js +3 -3
- package/lib/catalog/properties/property-length-measure.js +60 -11
- package/lib/catalog/properties/property-length-measure_hole.js +3 -3
- package/lib/catalog/utils/exporter.js +5 -6
- package/lib/catalog/utils/item-loader.js +20 -21
- package/lib/catalog/utils/mtl-loader.js +7 -3
- package/lib/catalog/utils/obj-loader.js +7 -3
- package/lib/class/item.js +13 -16
- package/lib/components/content.js +1 -0
- package/lib/components/disclaimer/disclaimer.js +66 -86
- package/lib/components/style/form-number-input.js +30 -6
- package/lib/components/style/form-select.js +54 -8
- package/lib/components/style/form-slider.js +22 -6
- package/lib/components/style/form-text-input.js +30 -12
- package/lib/components/viewer2d/area.js +5 -5
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +0 -1
- package/lib/components/viewer2d/grids/grid-streak.js +0 -1
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +0 -1
- package/lib/components/viewer2d/item.js +7 -8
- package/lib/components/viewer2d/line.js +2 -5
- package/lib/components/viewer2d/ruler.js +6 -7
- package/lib/components/viewer2d/rulerDist.js +4 -4
- package/lib/components/viewer2d/scene.js +1 -1
- package/lib/components/viewer2d/utils.js +37 -0
- package/lib/components/viewer2d/viewer2d.js +25 -17
- package/lib/components/viewer3d/libs/mtl-loader.js +6 -2
- package/lib/components/viewer3d/libs/obj-loader.js +6 -2
- package/lib/components/viewer3d/libs/orbit-controls.js +10 -5
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +9 -4
- package/lib/components/viewer3d/ruler-utils/itemRect.js +7 -7
- package/lib/components/viewer3d/ruler-utils/layer3D.js +32 -32
- package/lib/components/viewer3d/ruler-utils/scene3D.js +3 -4
- package/lib/components/viewer3d/scene-creator.js +24 -24
- package/lib/components/viewer3d/viewer3d.js +17 -17
- package/lib/index.js +22 -88
- package/lib/models.js +7 -7
- package/lib/reducers/user-reducer.js +0 -1
- package/lib/reducers/viewer2d-reducer.js +3 -4
- package/lib/reducers/viewer3d-reducer.js +3 -4
- package/lib/utils/convert-units-lite.js +35 -0
- package/lib/utils/geometry.js +9 -10
- package/lib/utils/get-edges-of-subgraphs.js +7 -1
- package/lib/utils/graph-cycles.js +9 -9
- package/lib/utils/graph.js +9 -3
- package/lib/utils/helper.js +7 -76
- package/lib/utils/id-broker.js +2 -2
- package/lib/utils/molding.js +52 -52
- package/package.json +34 -70
- package/es/analytics/ga4.js +0 -191
- package/es/analytics/posthog.js +0 -60
- package/lib/analytics/ga4.js +0 -197
- package/lib/analytics/posthog.js +0 -68
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
var _excluded = ["value", "onChange"];
|
|
1
|
+
var _excluded = ["value", "onChange", "min", "max", "step"];
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import ReactRange from '@mapbox/react-range';
|
|
7
6
|
import FormTextInput from "./form-text-input";
|
|
8
7
|
var sliderContainerStyle = {
|
|
9
8
|
display: 'inline-block',
|
|
@@ -27,19 +26,36 @@ var textStyle = {
|
|
|
27
26
|
export default function FormNumberInput(_ref) {
|
|
28
27
|
var value = _ref.value,
|
|
29
28
|
onChange = _ref.onChange,
|
|
29
|
+
_ref$min = _ref.min,
|
|
30
|
+
min = _ref$min === void 0 ? 0 : _ref$min,
|
|
31
|
+
_ref$max = _ref.max,
|
|
32
|
+
max = _ref$max === void 0 ? 100 : _ref$max,
|
|
33
|
+
_ref$step = _ref.step,
|
|
34
|
+
step = _ref$step === void 0 ? 1 : _ref$step,
|
|
30
35
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
36
|
+
// Handle both slider and text input changes
|
|
37
|
+
var handleSliderChange = function handleSliderChange(e) {
|
|
38
|
+
onChange(Number(e.target.value));
|
|
39
|
+
};
|
|
40
|
+
var handleTextChange = function handleTextChange(e) {
|
|
41
|
+
var val = e.target.value === '' ? '' : Number(e.target.value);
|
|
42
|
+
onChange(val);
|
|
43
|
+
};
|
|
31
44
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
32
45
|
style: sliderContainerStyle
|
|
33
|
-
}, /*#__PURE__*/React.createElement(
|
|
46
|
+
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
34
47
|
type: "range",
|
|
35
48
|
style: sliderStyle,
|
|
36
|
-
|
|
37
|
-
|
|
49
|
+
min: min,
|
|
50
|
+
max: max,
|
|
51
|
+
step: step,
|
|
52
|
+
value: value,
|
|
53
|
+
onChange: handleSliderChange
|
|
38
54
|
}, rest))), /*#__PURE__*/React.createElement("div", {
|
|
39
55
|
style: textContainerStyle
|
|
40
56
|
}, /*#__PURE__*/React.createElement(FormTextInput, {
|
|
41
57
|
value: value,
|
|
42
|
-
onChange:
|
|
58
|
+
onChange: handleTextChange,
|
|
43
59
|
style: textStyle
|
|
44
60
|
})));
|
|
45
61
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
var _excluded = ["style"];
|
|
3
|
-
var _templateObject;
|
|
4
3
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
7
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
6
8
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
7
9
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
@@ -16,12 +18,27 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
16
18
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
17
19
|
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
18
20
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
19
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
20
21
|
import React, { Component } from 'react';
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
import { BG_COLOR_0, DEFAULT_FONT_FAMILY, PROJECT_NAME_LENGTH_LIMIT, SECONDARY_PURPLE_COLOR, TEXT_COLOR_NEUTRAL_3 } from "../../constants";
|
|
23
|
+
var styles = {
|
|
24
|
+
input: {
|
|
25
|
+
display: 'block',
|
|
26
|
+
padding: '15px 10px 12px 0px',
|
|
27
|
+
width: 120,
|
|
28
|
+
fontFamily: DEFAULT_FONT_FAMILY,
|
|
29
|
+
fontSize: 12,
|
|
30
|
+
fontWeight: 600,
|
|
31
|
+
lineHeight: '17px',
|
|
32
|
+
color: TEXT_COLOR_NEUTRAL_3,
|
|
33
|
+
backgroundColor: BG_COLOR_0,
|
|
34
|
+
border: '2px solid',
|
|
35
|
+
textAlign: 'right',
|
|
36
|
+
"float": 'right',
|
|
37
|
+
borderRadius: 5,
|
|
38
|
+
outline: 0,
|
|
39
|
+
transition: 'border-color 0.2s'
|
|
40
|
+
}
|
|
41
|
+
};
|
|
25
42
|
var FormTextInput = /*#__PURE__*/function (_Component) {
|
|
26
43
|
function FormTextInput(props) {
|
|
27
44
|
var _this;
|
|
@@ -48,21 +65,23 @@ var FormTextInput = /*#__PURE__*/function (_Component) {
|
|
|
48
65
|
var _this$props = this.props,
|
|
49
66
|
style = _this$props.style,
|
|
50
67
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
51
|
-
|
|
68
|
+
var focus = this.state.focus;
|
|
69
|
+
var inputStyle = _objectSpread(_objectSpread({}, styles.input), {}, {
|
|
70
|
+
borderColor: focus ? SECONDARY_PURPLE_COLOR : undefined
|
|
71
|
+
}, style);
|
|
72
|
+
return /*#__PURE__*/React.createElement("input", _extends({
|
|
52
73
|
ref: this.input,
|
|
53
|
-
onFocus: function onFocus(
|
|
74
|
+
onFocus: function onFocus() {
|
|
54
75
|
return _this2.setState({
|
|
55
76
|
focus: true
|
|
56
77
|
});
|
|
57
78
|
},
|
|
58
|
-
onBlur: function onBlur(
|
|
79
|
+
onBlur: function onBlur() {
|
|
59
80
|
return _this2.setState({
|
|
60
81
|
focus: false
|
|
61
82
|
});
|
|
62
83
|
},
|
|
63
|
-
style:
|
|
64
|
-
// autoFocus
|
|
65
|
-
,
|
|
84
|
+
style: inputStyle,
|
|
66
85
|
type: "text"
|
|
67
86
|
}, rest, {
|
|
68
87
|
maxLength: PROJECT_NAME_LENGTH_LIMIT
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import polylabel from 'polylabel';
|
|
4
|
-
import
|
|
5
|
-
import convert from 'convert-units';
|
|
4
|
+
import { convert } from "../../utils/convert-units-lite";
|
|
6
5
|
import { formatNumber } from "../../utils/math";
|
|
7
6
|
import { DECIMAL_PLACES_2 } from "../../constants";
|
|
7
|
+
import { areaPolygon } from "./utils";
|
|
8
8
|
var STYLE_TEXT = {
|
|
9
9
|
textAnchor: 'middle',
|
|
10
10
|
fontSize: '12px',
|
|
@@ -44,7 +44,7 @@ export default function Area(_ref) {
|
|
|
44
44
|
polygonWithHoles = polygonWithHoles.concat(polygonHole.reverse());
|
|
45
45
|
});
|
|
46
46
|
var center = polylabel([polygonWithHoles], 1.0);
|
|
47
|
-
var areaSize =
|
|
47
|
+
var areaSize = areaPolygon(polygon, false);
|
|
48
48
|
//subtract holes area
|
|
49
49
|
area.holes.forEach(function (areaID) {
|
|
50
50
|
var hole = layer.areas.get(areaID);
|
|
@@ -54,7 +54,7 @@ export default function Area(_ref) {
|
|
|
54
54
|
y = _layer$vertices$get3.y;
|
|
55
55
|
return [x, y];
|
|
56
56
|
});
|
|
57
|
-
areaSize -=
|
|
57
|
+
areaSize -= areaPolygon(holePolygon, false);
|
|
58
58
|
});
|
|
59
59
|
renderedAreaSize = /*#__PURE__*/React.createElement("text", {
|
|
60
60
|
x: "0",
|
|
@@ -4,14 +4,12 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
4
4
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import { useState } from 'react';
|
|
7
|
+
import React, { useState } from 'react';
|
|
9
8
|
import PropTypes from 'prop-types';
|
|
10
|
-
import If from "../../utils/react-if";
|
|
11
9
|
import RulerDist from "./rulerDist";
|
|
12
|
-
import convert from
|
|
10
|
+
import { convert } from "../../utils/convert-units-lite";
|
|
13
11
|
import { GeometryUtils } from "../../utils/export";
|
|
14
|
-
import { MODE_ROTATING_ITEM,
|
|
12
|
+
import { MODE_ROTATING_ITEM, WALL_CABINET_LAYOUTPOS } from "../../constants";
|
|
15
13
|
import { returnReplaceableDeepSearchType } from "./utils";
|
|
16
14
|
var STYLE_LINE = {
|
|
17
15
|
fill: '#0096fd',
|
|
@@ -5,7 +5,6 @@ import Ruler from "./ruler";
|
|
|
5
5
|
import { BASE_CABINET_LAYOUTPOS, LINE_THICKNESS, WALL_CABINET_LAYOUTPOS } from "../../constants";
|
|
6
6
|
import * as Three from 'three';
|
|
7
7
|
import { isEmpty } from "./utils";
|
|
8
|
-
import Tooltip from '@material-ui/core/Tooltip';
|
|
9
8
|
var STYLE = {
|
|
10
9
|
stroke: 'rgb(77, 77, 77)',
|
|
11
10
|
strokeWidth: '1px'
|
|
@@ -795,9 +794,7 @@ export default function Line(_ref) {
|
|
|
795
794
|
} : {}
|
|
796
795
|
}, renderedLine, /*#__PURE__*/React.createElement("g", {
|
|
797
796
|
transform: "translate(".concat(x1, ", ").concat(y1, ") rotate(").concat(angle, ", 0, 0)")
|
|
798
|
-
}, renderedHoles)), line.selected && /*#__PURE__*/React.createElement(
|
|
799
|
-
title: "Elevation View"
|
|
800
|
-
}, /*#__PURE__*/React.createElement("g", {
|
|
797
|
+
}, renderedHoles)), line.selected && /*#__PURE__*/React.createElement("g", {
|
|
801
798
|
id: 'elevation-button',
|
|
802
799
|
key: 1,
|
|
803
800
|
transform: "translate(".concat(x1 + 35, ", ").concat(y1 - 15, ")"),
|
|
@@ -827,7 +824,7 @@ export default function Line(_ref) {
|
|
|
827
824
|
style: {
|
|
828
825
|
transform: 'rotateX(180deg)'
|
|
829
826
|
}
|
|
830
|
-
}))
|
|
827
|
+
})), line.selected && /*#__PURE__*/React.createElement("g", {
|
|
831
828
|
id: 'remove-button',
|
|
832
829
|
key: 2,
|
|
833
830
|
transform: "translate(".concat(x1 + 10, ", ").concat(y1, ")"),
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import convert from
|
|
3
|
+
import { convert } from "../../utils/convert-units-lite";
|
|
4
4
|
import IDBroker from "../../utils/id-broker";
|
|
5
|
-
import {
|
|
6
|
-
import { LINE_THICKNESS, SHADE_LIGHT_BLUE_COLOR, TEXT_COLOR_NEUTRAL_7 } from "../../constants";
|
|
5
|
+
import { LINE_THICKNESS, TEXT_COLOR_NEUTRAL_7 } from "../../constants";
|
|
7
6
|
var STYLE = {
|
|
8
7
|
stroke: TEXT_COLOR_NEUTRAL_7,
|
|
9
8
|
strokeWidth: '1px'
|
|
@@ -23,8 +23,7 @@ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new T
|
|
|
23
23
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
24
24
|
import React, { Component } from 'react';
|
|
25
25
|
import PropTypes from 'prop-types';
|
|
26
|
-
import {
|
|
27
|
-
import { searchForSkuValue } from "./utils";
|
|
26
|
+
import { Grids, Layer } from "./export";
|
|
28
27
|
var Scene = /*#__PURE__*/function (_Component) {
|
|
29
28
|
function Scene() {
|
|
30
29
|
_classCallCheck(this, Scene);
|
|
@@ -43,6 +42,7 @@ var Scene = /*#__PURE__*/function (_Component) {
|
|
|
43
42
|
if (this.props.scene.hashCode() !== nextProps.scene.hashCode()) {
|
|
44
43
|
scene = nextProps.scene, catalog = nextProps.catalog;
|
|
45
44
|
height = scene.height, layers = scene.layers;
|
|
45
|
+
console.log(layers.toJS());
|
|
46
46
|
selectedLayer = layers.get(scene.selectedLayer);
|
|
47
47
|
msg = '';
|
|
48
48
|
isNotFoundInElements = false;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
5
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
6
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
1
7
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
import {
|
|
8
|
+
import { toPlainObject } from "../../utils/helper";
|
|
3
9
|
import { INSTALLATION_SUFFIX_TYPE, INSTALLATION_TYPE_NAME, INSTALLATION_TYPE_SKU_SUFFIX, TOE_KICK_MOLDING } from "../../constants";
|
|
4
10
|
export var searchForSkuValue = function searchForSkuValue(catalog, selectedLayer, elementType) {
|
|
5
11
|
return new Promise(function (resolve) {
|
|
@@ -159,4 +165,34 @@ export var getToeKickSKU = function getToeKickSKU() {
|
|
|
159
165
|
});
|
|
160
166
|
if (!skuData) return false;
|
|
161
167
|
return skuData;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
// ESM version of "area-polygon" with default + named export.
|
|
171
|
+
// Same behavior: takes an array of [x,y] tuples or {x,y} objects.
|
|
172
|
+
// If `signed` is truthy, returns signed area; otherwise absolute area.
|
|
173
|
+
// Does not mutate the input array.
|
|
174
|
+
|
|
175
|
+
function normalize(point) {
|
|
176
|
+
if (Array.isArray(point)) {
|
|
177
|
+
return {
|
|
178
|
+
x: point[0],
|
|
179
|
+
y: point[1]
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
return point;
|
|
183
|
+
}
|
|
184
|
+
export var areaPolygon = function areaPolygon(points) {
|
|
185
|
+
var signed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
186
|
+
if (!Array.isArray(points) || points.length < 3) return 0;
|
|
187
|
+
|
|
188
|
+
// normalize and ensure closed ring (without mutating input)
|
|
189
|
+
var pts = points.map(normalize);
|
|
190
|
+
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;
|
|
191
|
+
var det = 0;
|
|
192
|
+
var l = closed.length - 1; // last index before the duplicated first point
|
|
193
|
+
for (var i = 0; i < l; i++) {
|
|
194
|
+
det += closed[i].x * closed[i + 1].y - closed[i].y * closed[i + 1].x;
|
|
195
|
+
}
|
|
196
|
+
var area = det / 2;
|
|
197
|
+
return signed ? area : Math.abs(area);
|
|
162
198
|
};
|
|
@@ -24,10 +24,10 @@ import { RulerX, RulerY } from "./export";
|
|
|
24
24
|
import { DECIMAL_PLACES_2, LINE_THICKNESS, MIN_ANGLE_DISALLOW_DRAW_WALL, MODE_ELEVATION_VIEW, MODE_IDLE, UNIT_ANGLE } from "../../constants";
|
|
25
25
|
import { GeometryUtils } from "../../utils/export";
|
|
26
26
|
import FormNumberInput from "../style/form-number-input";
|
|
27
|
-
import convert from
|
|
27
|
+
import { convert } from "../../utils/convert-units-lite";
|
|
28
28
|
import { Map } from 'immutable';
|
|
29
29
|
import { formatNumber } from "../../utils/math";
|
|
30
|
-
import { isEmpty } from "../../utils/helper";
|
|
30
|
+
import { isEmpty } from "../../utils/helper"; // variables
|
|
31
31
|
|
|
32
32
|
// variables
|
|
33
33
|
var pinFlag = false;
|
|
@@ -1276,6 +1276,8 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
1276
1276
|
var sceneZoom = state.zoom || 1;
|
|
1277
1277
|
var rulerXElements = Math.ceil(sceneWidth / rulerUnitPixelSize) + 1;
|
|
1278
1278
|
var rulerYElements = Math.ceil(sceneHeight / rulerUnitPixelSize) + 1;
|
|
1279
|
+
console.log('---render viewer2d');
|
|
1280
|
+
console.log(viewer2D.isEmpty());
|
|
1279
1281
|
return /*#__PURE__*/React.createElement("div", null, rulerEdit, /*#__PURE__*/React.createElement("div", {
|
|
1280
1282
|
style: {
|
|
1281
1283
|
margin: 0,
|
|
@@ -1346,8 +1348,12 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
1346
1348
|
onMouseDown: onMouseDown,
|
|
1347
1349
|
onMouseMove: onMouseMove,
|
|
1348
1350
|
onMouseUp: onMouseUp,
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
+
miniatureProps: {
|
|
1352
|
+
position: 'none'
|
|
1353
|
+
},
|
|
1354
|
+
toolbarProps: {
|
|
1355
|
+
position: 'right'
|
|
1356
|
+
},
|
|
1351
1357
|
detectPinchGesture: false,
|
|
1352
1358
|
disableDoubleClickZoomWithToolAuto: true,
|
|
1353
1359
|
ref: Viewer
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @author angelxuanchang
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
var THREE = window.THREE
|
|
7
|
+
var THREE = window.THREE;
|
|
8
8
|
var MTLLoader;
|
|
9
9
|
MTLLoader = function MTLLoader(manager) {
|
|
10
10
|
this.manager = manager !== undefined ? manager : THREE.DefaultLoadingManager;
|
|
@@ -354,4 +354,4 @@ MTLLoader.MaterialCreator.prototype = {
|
|
|
354
354
|
return texture;
|
|
355
355
|
}
|
|
356
356
|
};
|
|
357
|
-
|
|
357
|
+
export default MTLLoader;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @author mrdoob / http://mrdoob.com/
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
var THREE = window.THREE
|
|
5
|
+
var THREE = window.THREE;
|
|
6
6
|
var OBJLoader;
|
|
7
7
|
OBJLoader = function OBJLoader(manager) {
|
|
8
8
|
this.manager = manager !== undefined ? manager : THREE.DefaultLoadingManager;
|
|
@@ -459,4 +459,4 @@ OBJLoader.prototype = {
|
|
|
459
459
|
return container;
|
|
460
460
|
}
|
|
461
461
|
};
|
|
462
|
-
|
|
462
|
+
export default OBJLoader;
|
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
// Zoom - middle mouse, or mousewheel / touch: two finger spread or squish
|
|
14
14
|
// Pan - right mouse, or arrow keys / touch: three finter swipe
|
|
15
15
|
|
|
16
|
-
var THREE = window.THREE
|
|
17
|
-
|
|
18
|
-
module.exports = OrbitControls = function OrbitControls(object, domElement) {
|
|
16
|
+
var THREE = window.THREE;
|
|
17
|
+
function OrbitControls(object, domElement) {
|
|
19
18
|
this.object = object;
|
|
20
19
|
this.domElement = domElement !== undefined ? domElement : document;
|
|
21
20
|
|
|
@@ -623,7 +622,7 @@ module.exports = OrbitControls = function OrbitControls(object, domElement) {
|
|
|
623
622
|
// force an update at start
|
|
624
623
|
|
|
625
624
|
this.update();
|
|
626
|
-
}
|
|
625
|
+
}
|
|
627
626
|
OrbitControls.prototype = Object.create(THREE.EventDispatcher.prototype);
|
|
628
627
|
OrbitControls.prototype.constructor = OrbitControls;
|
|
629
628
|
Object.defineProperties(OrbitControls.prototype, {
|
|
@@ -695,4 +694,6 @@ Object.defineProperties(OrbitControls.prototype, {
|
|
|
695
694
|
this.dampingFactor = value;
|
|
696
695
|
}
|
|
697
696
|
}
|
|
698
|
-
});
|
|
697
|
+
});
|
|
698
|
+
export default OrbitControls;
|
|
699
|
+
export { OrbitControls };
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
* @author mrdoob / http://mrdoob.com/
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
var THREE = window.THREE
|
|
6
|
-
|
|
7
|
-
module.exports = PointerLockControls = function PointerLockControls(camera) {
|
|
5
|
+
var THREE = window.THREE;
|
|
6
|
+
function PointerLockControls(camera) {
|
|
8
7
|
var scope = this;
|
|
9
8
|
camera.rotation.set(0, 0, 0);
|
|
10
9
|
var pitchObject = new THREE.Object3D();
|
|
@@ -42,4 +41,6 @@ module.exports = PointerLockControls = function PointerLockControls(camera) {
|
|
|
42
41
|
return v;
|
|
43
42
|
};
|
|
44
43
|
}();
|
|
45
|
-
}
|
|
44
|
+
}
|
|
45
|
+
export default PointerLockControls;
|
|
46
|
+
export { PointerLockControls };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MODE_BACK_ELEVATION_VIEW, MODE_FRONT_ELEVATION_VIEW, MODE_LEFT_ELEVATION_VIEW, MODE_RIGHT_ELEVATION_VIEW } from "../../../constants";
|
|
3
|
-
import convert from
|
|
3
|
+
import { convert } from "../../../utils/convert-units-lite";
|
|
4
4
|
export default function ItemRect(_ref) {
|
|
5
5
|
var scene = _ref.scene,
|
|
6
6
|
layer = _ref.layer,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Ruler3D from "./ruler3D";
|
|
3
|
-
import convert from
|
|
3
|
+
import { convert } from "../../../utils/convert-units-lite";
|
|
4
4
|
import { GeometryUtils } from "../../../utils/export";
|
|
5
5
|
import { returnReplaceableDeepSearchType } from "../../../components/viewer2d/utils";
|
|
6
|
-
import { DELTA, DISTANCE_EPSILON
|
|
6
|
+
import { DECIMAL_PLACES_2, DELTA, DISTANCE_EPSILON } from "../../../constants";
|
|
7
7
|
import { formatNumber, isNonZeroText } from "../../../utils/math";
|
|
8
8
|
export default function Layer3D(_ref) {
|
|
9
9
|
var layer = _ref.layer,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { GeometryUtils } from "../../../utils/export";
|
|
3
|
-
import { isElevationView } from "../../..//utils/helper";
|
|
4
2
|
import { verticesDistance } from "../../../utils/geometry";
|
|
5
|
-
import convert from
|
|
3
|
+
import { convert } from "../../../utils/convert-units-lite";
|
|
6
4
|
import Layer3D from "./layer3D";
|
|
7
5
|
export function compareVertices(v0, v1) {
|
|
8
6
|
return v0.x === v1.x ? v0.y - v1.y : v0.x - v1.x;
|
|
@@ -15,6 +13,7 @@ export default function Scene3D(_ref) {
|
|
|
15
13
|
mode = _ref.mode,
|
|
16
14
|
downloadFlag = _ref.downloadFlag;
|
|
17
15
|
var layers = scene.layers;
|
|
16
|
+
console.log(layers.toJS());
|
|
18
17
|
var selectedLayer = layers.get(scene.selectedLayer);
|
|
19
18
|
var ceilHeight = selectedLayer.ceilHeight;
|
|
20
19
|
var selectedLine = selectedLayer.lines.get(selectedLayer.selected.lines.toJS()[0]);
|
|
@@ -17,7 +17,7 @@ import createGrid from "./grid-creator";
|
|
|
17
17
|
import { disposeObject } from "./three-memory-cleaner";
|
|
18
18
|
import { ANIMATE_STEP_MAX, ANIMATE_STEP_MIN, ARRAY_3D_MODES, ARROW_TEXT_BACKCOLOR, ARROW_TEXT_FONTFACE, ARROW_TEXT_FORECOLOR, BASE_CABINET_LAYOUTPOS, BOTTOM_MOLDING_LOCATION, DECIMAL_PLACES_2, DIFFERENT_VALUES_PATH_LENGTH, DISTANCE_EPSILON, EPSILON, MIDDLE_MOLDING_LOCATION, MODE_DRAGGING_ITEM_3D, MODE_DRAWING_ITEM_3D, MODE_IDLE, MODE_IDLE_3D, MODE_ROTATING_ITEM_3D, OBJTYPE_MESH, SHADE_DARK_PURPLE_COLOR, TOP_MOLDING_LOCATION, UNIT_CENTIMETER, WALL_CABINET_LAYOUTPOS } from "../../constants";
|
|
19
19
|
import { GeometryUtils, IDBroker, MoldingUtils } from "../../utils/export";
|
|
20
|
-
import convert from
|
|
20
|
+
import { convert } from "../../utils/convert-units-lite";
|
|
21
21
|
import { verticesDistance } from "../../utils/geometry";
|
|
22
22
|
import * as GeomUtils from "../../catalog/utils/geom-utils";
|
|
23
23
|
import { loadTexture } from "../../catalog/utils/item-loader";
|
|
@@ -21,24 +21,22 @@ import React from 'react';
|
|
|
21
21
|
import PropTypes from 'prop-types';
|
|
22
22
|
import ReactDOM from 'react-dom';
|
|
23
23
|
import * as Three from 'three';
|
|
24
|
-
import {
|
|
25
|
-
import { disposeScene } from "./three-memory-cleaner";
|
|
26
|
-
import { disposeObject } from "./three-memory-cleaner";
|
|
24
|
+
import { checkCabinetOverlap, createBacksplash, deleteSpecifiedMeshObjects, fVLine, getDistances, parseData, updateScene, visibleTransformBox } from "./scene-creator";
|
|
25
|
+
import { disposeObject, disposeScene } from "./three-memory-cleaner";
|
|
27
26
|
import diff from 'immutablediff';
|
|
28
27
|
import * as SharedStyle from "../../shared-style";
|
|
29
|
-
import {
|
|
30
|
-
import { isUndefined } from 'util';
|
|
28
|
+
import { BASE_CABINET_LAYOUTPOS, MODE_3D_VIEW, MODE_DRAGGING_ITEM_3D, MODE_DRAWING_HOLE_3D, MODE_DRAWING_ITEM_3D, MODE_ELEVATION_VIEW, MODE_IDLE_3D, MODE_ROTATING_ITEM_3D, SECONDARY_PURPLE_COLOR, TALL_CABINET_LAYOUTPOS, UNIT_CENTIMETER, WALL_CABINET_LAYOUTPOS } from "../../constants";
|
|
31
29
|
import { verticesDistance } from "../../utils/geometry";
|
|
32
|
-
import convert from
|
|
30
|
+
import { convert } from "../../utils/convert-units-lite";
|
|
33
31
|
import { GeometryUtils } from "../../utils/export";
|
|
34
32
|
import { handleCamRect, isElevationView, isEmpty } from "../../utils/helper";
|
|
35
33
|
import { RGBELoader } from 'three/examples/jsm/loaders/RGBELoader';
|
|
36
34
|
import CameraControls from 'camera-controls';
|
|
35
|
+
import { returnReplaceableDeepSearchType } from "../viewer2d/utils";
|
|
36
|
+
import { getAllMeshes, vectorIntersectWithMesh } from "../../utils/objects-utils";
|
|
37
37
|
CameraControls.install({
|
|
38
38
|
THREE: Three
|
|
39
39
|
});
|
|
40
|
-
import { returnReplaceableDeepSearchType } from "../viewer2d/utils";
|
|
41
|
-
import { getAllMeshes, vectorIntersectWithMesh } from "../../utils/objects-utils";
|
|
42
40
|
var Scene3DViewer = /*#__PURE__*/function (_React$Component) {
|
|
43
41
|
function Scene3DViewer(props) {
|
|
44
42
|
var _this;
|
|
@@ -657,6 +655,7 @@ var Scene3DViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
657
655
|
item: _item2,
|
|
658
656
|
cat: ocat
|
|
659
657
|
};
|
|
658
|
+
console.log('currentItem =>', currentItem);
|
|
660
659
|
if (GeometryUtils.needSnap(currentItem, otherItem) && otherItem.cat.type != 'cabinet') {
|
|
661
660
|
var tRot = _item2.rotation;
|
|
662
661
|
var tPos = new Three.Vector2(_item2.x, _item2.y);
|
|
@@ -1293,7 +1292,7 @@ var Scene3DViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
1293
1292
|
offsetX: event.offsetX - 50,
|
|
1294
1293
|
offsetY: event.offsetY
|
|
1295
1294
|
}, alti);
|
|
1296
|
-
if (
|
|
1295
|
+
if (!selectedItem) return;
|
|
1297
1296
|
var selItem = _this2.props.state.scene.layers.get(selectedObject.layerID).items.get(selectedObject.itemID);
|
|
1298
1297
|
lastAngle = 0;
|
|
1299
1298
|
angleObj.position.set(planData.plan.position.x + Point.x, selItem.category === 'lighting' ? -planData.plan.position.y - selItem.properties.get('height').get('length') : selItem.properties.get('altitude').get('length') + planData.plan.position.y, planData.plan.position.z - Point.y);
|
|
@@ -1464,7 +1463,7 @@ var Scene3DViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
1464
1463
|
setTimeout(function () {
|
|
1465
1464
|
getDistances(layer);
|
|
1466
1465
|
var selectedItem = planData.sceneGraph.layers[selectedObject.layerID].items[selectedObject.itemID];
|
|
1467
|
-
if (
|
|
1466
|
+
if (!selectedItem) return;
|
|
1468
1467
|
var selItem = _this2.props.state.scene.layers.get(selectedObject.layerID).items.get(selectedObject.itemID);
|
|
1469
1468
|
var itemPos = selectedItem.position.clone();
|
|
1470
1469
|
if (intersects[_i10].object.parent && intersects[_i10].object.parent.parent.userData.itemId === selectedItem.userData.itemId) {
|
|
@@ -1546,7 +1545,7 @@ var Scene3DViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
1546
1545
|
if (bRotate) {
|
|
1547
1546
|
var _intersects$_i;
|
|
1548
1547
|
var selectedItem = planData.sceneGraph.layers[selectedObject.layerID].items[selectedObject.itemID];
|
|
1549
|
-
if (
|
|
1548
|
+
if (!selectedItem) return;
|
|
1550
1549
|
var selItem = _this2.props.state.scene.layers.get(selectedObject.layerID).items.get(selectedObject.itemID);
|
|
1551
1550
|
var itemPos = selectedItem.position.clone();
|
|
1552
1551
|
if (((_intersects$_i = intersects[_i10]) === null || _intersects$_i === void 0 || (_intersects$_i = _intersects$_i.object) === null || _intersects$_i === void 0 || (_intersects$_i = _intersects$_i.parent) === null || _intersects$_i === void 0 || (_intersects$_i = _intersects$_i.parent) === null || _intersects$_i === void 0 || (_intersects$_i = _intersects$_i.userData) === null || _intersects$_i === void 0 ? void 0 : _intersects$_i.itemId) === selectedItem.userData.itemId) {
|
|
@@ -1564,7 +1563,7 @@ var Scene3DViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
1564
1563
|
if (bMove) {
|
|
1565
1564
|
bMove = false;
|
|
1566
1565
|
var _selectedItem = planData.sceneGraph.layers[selectedObject.layerID].items[selectedObject.itemID];
|
|
1567
|
-
if (
|
|
1566
|
+
if (!_selectedItem) return;
|
|
1568
1567
|
var _selItem = _this2.props.state.scene.layers.get(selectedObject.layerID).items.get(selectedObject.itemID);
|
|
1569
1568
|
var _itemPos = _selectedItem.position.clone();
|
|
1570
1569
|
if (intersects[_i10].object.parent.parent.userData.itemId === _selectedItem.userData.itemId) {
|
|
@@ -2044,7 +2043,7 @@ var Scene3DViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
2044
2043
|
setTimeout(function () {
|
|
2045
2044
|
try {
|
|
2046
2045
|
currentObject = planData.sceneGraph.layers[selectedObject.layerID].items[selectedObject.itemID];
|
|
2047
|
-
if (
|
|
2046
|
+
if (!currentObject) return;
|
|
2048
2047
|
var selItem = _this2.props.state.scene.layers.get(selectedObject.layerID).items.get(selectedObject.itemID);
|
|
2049
2048
|
var itemPos = currentObject.position.clone();
|
|
2050
2049
|
toolObj.position.set(planData.plan.position.x + itemPos.x, selItem.category === 'lighting' ? -planData.plan.position.y - selItem.properties.get('height').get('length') : planData.plan.position.y + currentObject.children[0].position.y, planData.plan.position.z + itemPos.z);
|
package/es/index.js
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import reducer from "./reducers/reducer";
|
|
1
|
+
// src/index.js
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import ReactDOM from 'react-dom/client';
|
|
5
4
|
import KitchenConfiguratorApp from "./KitchenConfiguratorApp";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Mounts the Kitchen Configurator micro-frontend into a DOM container.
|
|
8
|
+
* Returns an unmount() function for cleanup.
|
|
9
|
+
*/
|
|
10
|
+
export default function renderKitchenSimulator(container) {
|
|
11
|
+
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12
|
+
if (!container) throw new Error('Container element is required');
|
|
13
|
+
var root = ReactDOM.createRoot(container);
|
|
14
|
+
root.render(/*#__PURE__*/React.createElement(KitchenConfiguratorApp, props));
|
|
15
|
+
return {
|
|
16
|
+
root: root,
|
|
17
|
+
unmount: function unmount() {
|
|
18
|
+
root.unmount();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|