kitchen-simulator 10.3.0 → 11.0.0-react-18
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/LiteKitchenConfigurator.js +11 -42
- package/es/LiteRenderer.js +24 -2
- package/es/actions/export.js +12 -25
- package/es/components/content.js +0 -3
- package/es/components/export.js +4 -6
- package/es/components/style/form-number-input.js +5 -7
- package/es/components/viewer2d/group.js +5 -6
- package/es/components/viewer2d/item.js +5 -6
- package/es/components/viewer2d/line.js +47 -18
- package/es/components/viewer2d/rulerX.js +8 -9
- package/es/components/viewer2d/rulerY.js +8 -9
- package/es/components/viewer2d/scene.js +9 -9
- package/es/components/viewer2d/state.js +1 -1
- package/es/components/viewer2d/viewer2d.js +28 -32
- package/es/components/viewer3d/viewer3d-first-person.js +8 -13
- package/es/components/viewer3d/viewer3d.js +8 -15
- package/es/utils/helper.js +0 -68
- package/lib/LiteKitchenConfigurator.js +11 -42
- package/lib/LiteRenderer.js +25 -3
- package/lib/actions/export.js +39 -35
- package/lib/components/content.js +0 -3
- package/lib/components/export.js +16 -6
- package/lib/components/style/form-number-input.js +5 -7
- package/lib/components/viewer2d/group.js +5 -6
- package/lib/components/viewer2d/item.js +4 -5
- package/lib/components/viewer2d/line.js +47 -18
- package/lib/components/viewer2d/rulerX.js +8 -9
- package/lib/components/viewer2d/rulerY.js +8 -9
- package/lib/components/viewer2d/scene.js +9 -9
- package/lib/components/viewer2d/state.js +1 -1
- package/lib/components/viewer2d/viewer2d.js +26 -30
- package/lib/components/viewer3d/viewer3d-first-person.js +8 -13
- package/lib/components/viewer3d/viewer3d.js +8 -15
- package/lib/utils/helper.js +1 -69
- package/package.json +6 -21
- package/es/analytics/ga4.js +0 -188
- package/es/components/style/form-submit-button.js +0 -25
- package/es/devLiteRenderer.js +0 -926
- package/lib/analytics/ga4.js +0 -194
- package/lib/components/style/form-submit-button.js +0 -35
- package/lib/devLiteRenderer.js +0 -930
|
@@ -5,11 +5,13 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
7
7
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
8
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
9
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
9
10
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
11
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
12
|
import React, { Component } from 'react';
|
|
12
13
|
import PropTypes from 'prop-types';
|
|
14
|
+
import AppContext from "../../AppContext";
|
|
13
15
|
import { Layer, Grids } from "./export";
|
|
14
16
|
import { searchForSkuValue } from "./utils";
|
|
15
17
|
var Scene = /*#__PURE__*/function (_Component) {
|
|
@@ -19,9 +21,9 @@ var Scene = /*#__PURE__*/function (_Component) {
|
|
|
19
21
|
}
|
|
20
22
|
_inherits(Scene, _Component);
|
|
21
23
|
return _createClass(Scene, [{
|
|
22
|
-
key: "
|
|
24
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
23
25
|
value: function () {
|
|
24
|
-
var
|
|
26
|
+
var _UNSAFE_componentWillReceiveProps = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(nextProps) {
|
|
25
27
|
var scene, catalog, height, layers, selectedLayer, msg, isNotFoundInElements, itemType;
|
|
26
28
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
27
29
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -60,10 +62,10 @@ var Scene = /*#__PURE__*/function (_Component) {
|
|
|
60
62
|
}
|
|
61
63
|
}, _callee, this);
|
|
62
64
|
}));
|
|
63
|
-
function
|
|
64
|
-
return
|
|
65
|
+
function UNSAFE_componentWillReceiveProps(_x) {
|
|
66
|
+
return _UNSAFE_componentWillReceiveProps.apply(this, arguments);
|
|
65
67
|
}
|
|
66
|
-
return
|
|
68
|
+
return UNSAFE_componentWillReceiveProps;
|
|
67
69
|
}()
|
|
68
70
|
}, {
|
|
69
71
|
key: "shouldComponentUpdate",
|
|
@@ -117,12 +119,10 @@ var Scene = /*#__PURE__*/function (_Component) {
|
|
|
117
119
|
}
|
|
118
120
|
}]);
|
|
119
121
|
}(Component);
|
|
122
|
+
_defineProperty(Scene, "contextType", AppContext);
|
|
120
123
|
export { Scene as default };
|
|
121
124
|
Scene.propTypes = {
|
|
122
125
|
scene: PropTypes.object.isRequired,
|
|
123
126
|
catalog: PropTypes.object.isRequired,
|
|
124
|
-
relatedLines: PropTypes.
|
|
125
|
-
};
|
|
126
|
-
Scene.contextTypes = {
|
|
127
|
-
projectActions: PropTypes.object.isRequired
|
|
127
|
+
relatedLines: PropTypes.array.isRequired
|
|
128
128
|
};
|
|
@@ -2,9 +2,10 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
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
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 React, { useEffect, useRef, useState } from 'react';
|
|
5
|
+
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
import
|
|
7
|
+
import AppContext from "../../AppContext";
|
|
8
|
+
import { ReactSVGPanZoom, INITIAL_VALUE, TOOL_AUTO, TOOL_NONE, TOOL_PAN, TOOL_ZOOM_IN, TOOL_ZOOM_OUT } from 'react-svg-pan-zoom';
|
|
8
9
|
import * as constants from "../../constants";
|
|
9
10
|
import { DECIMAL_PLACES_2, LINE_THICKNESS, MIN_ANGLE_DISALLOW_DRAW_WALL, MODE_ELEVATION_VIEW, MODE_IDLE, UNIT_ANGLE, INTERNAL_EVENT_SELECT_ELEMENT, INTERNAL_EVENT_DRAG_ELEMENT, INTERNAL_EVENT_DRAW_ELEMENT, INTERNAL_EVENT_ROTATE_ELEMENT } from "../../constants";
|
|
10
11
|
import State from "./state";
|
|
@@ -119,21 +120,22 @@ function extractElementData(node) {
|
|
|
119
120
|
direct: node.attributes.getNamedItem('data-direct') ? node.attributes.getNamedItem('data-direct').value : 0
|
|
120
121
|
};
|
|
121
122
|
}
|
|
122
|
-
export default function Viewer2D(_ref
|
|
123
|
+
export default function Viewer2D(_ref) {
|
|
123
124
|
var state = _ref.state,
|
|
124
125
|
width = _ref.width,
|
|
125
126
|
height = _ref.height,
|
|
126
127
|
setToolbar = _ref.setToolbar,
|
|
127
128
|
replaceCabinet = _ref.replaceCabinet,
|
|
128
129
|
onInternalEvent = _ref.onInternalEvent;
|
|
129
|
-
var
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
130
|
+
var _useContext = useContext(AppContext),
|
|
131
|
+
viewer2DActions = _useContext.viewer2DActions,
|
|
132
|
+
linesActions = _useContext.linesActions,
|
|
133
|
+
holesActions = _useContext.holesActions,
|
|
134
|
+
verticesActions = _useContext.verticesActions,
|
|
135
|
+
itemsActions = _useContext.itemsActions,
|
|
136
|
+
areaActions = _useContext.areaActions,
|
|
137
|
+
projectActions = _useContext.projectActions,
|
|
138
|
+
catalog = _useContext.catalog;
|
|
137
139
|
var _useState = useState(null),
|
|
138
140
|
_useState2 = _slicedToArray(_useState, 2),
|
|
139
141
|
rulerEdit = _useState2[0],
|
|
@@ -180,9 +182,9 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
180
182
|
var layerID = scene.selectedLayer;
|
|
181
183
|
var wall_thickness = LINE_THICKNESS / 2;
|
|
182
184
|
var layer = scene.getIn(['layers', layerID]);
|
|
183
|
-
var mapCursorPosition = function mapCursorPosition(
|
|
184
|
-
var x =
|
|
185
|
-
y =
|
|
185
|
+
var mapCursorPosition = function mapCursorPosition(_ref2) {
|
|
186
|
+
var x = _ref2.x,
|
|
187
|
+
y = _ref2.y;
|
|
186
188
|
return {
|
|
187
189
|
x: x,
|
|
188
190
|
y: -y + scene.height
|
|
@@ -1335,11 +1337,11 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
1335
1337
|
var rulerBgColor = SharedStyle.PRIMARY_COLOR.main;
|
|
1336
1338
|
var rulerFnColor = SharedStyle.COLORS.white;
|
|
1337
1339
|
var rulerMkColor = SharedStyle.SECONDARY_COLOR.main;
|
|
1338
|
-
var sceneWidth = SVGWidth || state.getIn(['scene', 'width']);
|
|
1339
|
-
var sceneHeight = SVGHeight || state.getIn(['scene', 'height']);
|
|
1340
|
+
var sceneWidth = SVGWidth || state.getIn(['scene', 'width']) || 0;
|
|
1341
|
+
var sceneHeight = SVGHeight || state.getIn(['scene', 'height']) || 0;
|
|
1340
1342
|
var sceneZoom = state.zoom || 1;
|
|
1341
|
-
var rulerXElements = Math.ceil(sceneWidth / rulerUnitPixelSize) + 1;
|
|
1342
|
-
var rulerYElements = Math.ceil(sceneHeight / rulerUnitPixelSize) + 1;
|
|
1343
|
+
var rulerXElements = sceneWidth ? Math.ceil(sceneWidth / rulerUnitPixelSize) + 1 : 0;
|
|
1344
|
+
var rulerYElements = sceneHeight ? Math.ceil(sceneHeight / rulerUnitPixelSize) + 1 : 0;
|
|
1343
1345
|
return /*#__PURE__*/React.createElement("div", null, rulerEdit, /*#__PURE__*/React.createElement("div", {
|
|
1344
1346
|
style: {
|
|
1345
1347
|
margin: 0,
|
|
@@ -1389,7 +1391,7 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
1389
1391
|
zoom: sceneZoom,
|
|
1390
1392
|
mouseY: state.mouse.get('y'),
|
|
1391
1393
|
height: height - rulerSize,
|
|
1392
|
-
zeroTopPosition: sceneHeight * sceneZoom + f || 0,
|
|
1394
|
+
zeroTopPosition: sceneHeight * sceneZoom + (f || 0),
|
|
1393
1395
|
backgroundColor: rulerBgColor,
|
|
1394
1396
|
fontColor: rulerFnColor,
|
|
1395
1397
|
markerColor: rulerMkColor,
|
|
@@ -1402,7 +1404,7 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
1402
1404
|
},
|
|
1403
1405
|
width: width - rulerSize,
|
|
1404
1406
|
height: height - rulerSize,
|
|
1405
|
-
value: viewer2D.isEmpty() ?
|
|
1407
|
+
value: viewer2D.isEmpty() ? INITIAL_VALUE : viewer2D.toJS(),
|
|
1406
1408
|
onChangeValue: onChangeValue,
|
|
1407
1409
|
tool: mode2Tool(mode),
|
|
1408
1410
|
onChangeTool: onChangeTool,
|
|
@@ -1410,8 +1412,12 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
1410
1412
|
onMouseDown: onMouseDown,
|
|
1411
1413
|
onMouseMove: onMouseMove,
|
|
1412
1414
|
onMouseUp: onMouseUp,
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
+
customMiniature: function customMiniature() {
|
|
1416
|
+
return null;
|
|
1417
|
+
},
|
|
1418
|
+
customToolbar: function customToolbar() {
|
|
1419
|
+
return null;
|
|
1420
|
+
},
|
|
1415
1421
|
detectPinchGesture: false,
|
|
1416
1422
|
disableDoubleClickZoomWithToolAuto: true,
|
|
1417
1423
|
ref: Viewer
|
|
@@ -1449,14 +1455,4 @@ Viewer2D.propTypes = {
|
|
|
1449
1455
|
state: PropTypes.object.isRequired,
|
|
1450
1456
|
width: PropTypes.number.isRequired,
|
|
1451
1457
|
height: PropTypes.number.isRequired
|
|
1452
|
-
};
|
|
1453
|
-
Viewer2D.contextTypes = {
|
|
1454
|
-
viewer2DActions: PropTypes.object.isRequired,
|
|
1455
|
-
linesActions: PropTypes.object.isRequired,
|
|
1456
|
-
holesActions: PropTypes.object.isRequired,
|
|
1457
|
-
verticesActions: PropTypes.object.isRequired,
|
|
1458
|
-
itemsActions: PropTypes.object.isRequired,
|
|
1459
|
-
areaActions: PropTypes.object.isRequired,
|
|
1460
|
-
projectActions: PropTypes.object.isRequired,
|
|
1461
|
-
catalog: PropTypes.object.isRequired
|
|
1462
1458
|
};
|
|
@@ -5,11 +5,12 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
7
7
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
8
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
9
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
11
|
import React from 'react';
|
|
11
12
|
import PropTypes from 'prop-types';
|
|
12
|
-
import
|
|
13
|
+
import AppContext from "../../AppContext";
|
|
13
14
|
import * as Three from 'three';
|
|
14
15
|
import { parseData, updateScene } from "./scene-creator";
|
|
15
16
|
import { disposeScene } from "./three-memory-cleaner";
|
|
@@ -25,6 +26,7 @@ var Viewer3DFirstPerson = /*#__PURE__*/function (_React$Component) {
|
|
|
25
26
|
_this.width = props.width;
|
|
26
27
|
_this.height = props.height;
|
|
27
28
|
_this.stopRendering = false;
|
|
29
|
+
_this.canvasWrapperRef = /*#__PURE__*/React.createRef();
|
|
28
30
|
_this.renderer = window.__threeRenderer || new Three.WebGLRenderer({
|
|
29
31
|
preserveDrawingBuffer: true
|
|
30
32
|
});
|
|
@@ -55,7 +57,7 @@ var Viewer3DFirstPerson = /*#__PURE__*/function (_React$Component) {
|
|
|
55
57
|
};
|
|
56
58
|
var state = this.props.state;
|
|
57
59
|
var data = state.scene;
|
|
58
|
-
var canvasWrapper =
|
|
60
|
+
var canvasWrapper = this.canvasWrapperRef.current;
|
|
59
61
|
var scene3D = new Three.Scene();
|
|
60
62
|
|
|
61
63
|
// As I need to show the pointer above all scene objects, I use this workaround http://stackoverflow.com/a/13309722
|
|
@@ -254,8 +256,8 @@ var Viewer3DFirstPerson = /*#__PURE__*/function (_React$Component) {
|
|
|
254
256
|
this.renderer.renderLists.dispose();
|
|
255
257
|
}
|
|
256
258
|
}, {
|
|
257
|
-
key: "
|
|
258
|
-
value: function
|
|
259
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
260
|
+
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
259
261
|
var width = nextProps.width,
|
|
260
262
|
height = nextProps.height;
|
|
261
263
|
var camera = this.camera,
|
|
@@ -288,22 +290,15 @@ var Viewer3DFirstPerson = /*#__PURE__*/function (_React$Component) {
|
|
|
288
290
|
key: "render",
|
|
289
291
|
value: function render() {
|
|
290
292
|
return /*#__PURE__*/React.createElement('div', {
|
|
291
|
-
ref:
|
|
293
|
+
ref: this.canvasWrapperRef
|
|
292
294
|
});
|
|
293
295
|
}
|
|
294
296
|
}]);
|
|
295
297
|
}(React.Component);
|
|
298
|
+
_defineProperty(Viewer3DFirstPerson, "contextType", AppContext);
|
|
296
299
|
export { Viewer3DFirstPerson as default };
|
|
297
300
|
Viewer3DFirstPerson.propTypes = {
|
|
298
301
|
state: PropTypes.object.isRequired,
|
|
299
302
|
width: PropTypes.number.isRequired,
|
|
300
303
|
height: PropTypes.number.isRequired
|
|
301
|
-
};
|
|
302
|
-
Viewer3DFirstPerson.contextTypes = {
|
|
303
|
-
areaActions: PropTypes.object.isRequired,
|
|
304
|
-
holesActions: PropTypes.object.isRequired,
|
|
305
|
-
itemsActions: PropTypes.object.isRequired,
|
|
306
|
-
linesActions: PropTypes.object.isRequired,
|
|
307
|
-
projectActions: PropTypes.object.isRequired,
|
|
308
|
-
catalog: PropTypes.object
|
|
309
304
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
import _readOnlyError from "@babel/runtime/helpers/esm/readOnlyError";
|
|
4
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
4
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
6
5
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
7
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
8
7
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
9
8
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
9
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
10
10
|
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; }
|
|
11
11
|
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; }
|
|
12
12
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
13
13
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import PropTypes from 'prop-types';
|
|
16
|
-
import
|
|
16
|
+
import AppContext from "../../AppContext";
|
|
17
17
|
import * as Three from 'three';
|
|
18
18
|
import { checkCabinetOverlap, createBacksplash, deleteSpecifiedMeshObjects, fVLine, getDistances, parseData, updateScene, visibleTransformBox } from "./scene-creator";
|
|
19
19
|
import { disposeObject, disposeScene } from "./three-memory-cleaner";
|
|
@@ -50,6 +50,7 @@ var Scene3DViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
50
50
|
_this.width = props.width;
|
|
51
51
|
_this.height = props.height;
|
|
52
52
|
_this.renderingID = 0;
|
|
53
|
+
_this.canvasWrapperRef = /*#__PURE__*/React.createRef();
|
|
53
54
|
var mode = props.state.mode;
|
|
54
55
|
if (!window.__elevationRendererDownload) {
|
|
55
56
|
window.__elevationRendererDownload = {};
|
|
@@ -2165,7 +2166,7 @@ var Scene3DViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
2165
2166
|
}
|
|
2166
2167
|
|
|
2167
2168
|
// Add the output of the renderer to the html element
|
|
2168
|
-
var canvasWrapper =
|
|
2169
|
+
var canvasWrapper = this.canvasWrapperRef.current;
|
|
2169
2170
|
canvasWrapper && canvasWrapper.appendChild(this.renderer.domElement);
|
|
2170
2171
|
|
|
2171
2172
|
//
|
|
@@ -2434,8 +2435,8 @@ var Scene3DViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
2434
2435
|
this.renderer.renderLists.dispose();
|
|
2435
2436
|
}
|
|
2436
2437
|
}, {
|
|
2437
|
-
key: "
|
|
2438
|
-
value: function
|
|
2438
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
2439
|
+
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
2439
2440
|
var _this4 = this;
|
|
2440
2441
|
if (this.props.downloadFlag && diff(this.props.state, nextProps.state).toJS().length == 0 || isEmpty(nextProps.state.scene)) return;
|
|
2441
2442
|
var width = nextProps.width,
|
|
@@ -2645,25 +2646,17 @@ var Scene3DViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
2645
2646
|
this.renderer.domElement.style.opacity = '1';
|
|
2646
2647
|
!this.props.downloadFlag && document.getElementById('front') && (document.getElementById('front').style.display = 'block');
|
|
2647
2648
|
return /*#__PURE__*/React.createElement('div', {
|
|
2648
|
-
ref:
|
|
2649
|
+
ref: this.canvasWrapperRef
|
|
2649
2650
|
});
|
|
2650
2651
|
}
|
|
2651
2652
|
}
|
|
2652
2653
|
}]);
|
|
2653
2654
|
}(React.Component);
|
|
2655
|
+
_defineProperty(Scene3DViewer, "contextType", AppContext);
|
|
2654
2656
|
export { Scene3DViewer as default };
|
|
2655
2657
|
Scene3DViewer.propTypes = {
|
|
2656
2658
|
state: PropTypes.object.isRequired,
|
|
2657
2659
|
width: PropTypes.number.isRequired,
|
|
2658
2660
|
height: PropTypes.number.isRequired,
|
|
2659
2661
|
replaceCabinet: PropTypes.func.isRequired
|
|
2660
|
-
};
|
|
2661
|
-
Scene3DViewer.contextTypes = {
|
|
2662
|
-
areaActions: PropTypes.object.isRequired,
|
|
2663
|
-
holesActions: PropTypes.object.isRequired,
|
|
2664
|
-
itemsActions: PropTypes.object.isRequired,
|
|
2665
|
-
linesActions: PropTypes.object.isRequired,
|
|
2666
|
-
sceneActions: PropTypes.object.isRequired,
|
|
2667
|
-
projectActions: PropTypes.object.isRequired,
|
|
2668
|
-
catalog: PropTypes.object
|
|
2669
2662
|
};
|
package/es/utils/helper.js
CHANGED
|
@@ -8,80 +8,12 @@ import * as Three from 'three';
|
|
|
8
8
|
import { isWarningItem, returnReplaceableDeepSearchType } from "./../components/viewer2d/utils";
|
|
9
9
|
import { convert } from "./convert-units-lite";
|
|
10
10
|
import { formatNumber } from "./math";
|
|
11
|
-
import AWS from 'aws-sdk';
|
|
12
11
|
import { GeometryUtils, MoldingUtils } from "./export";
|
|
13
12
|
import { calcDistancesFromHoleToNearestOneOrWall } from "./geometry";
|
|
14
|
-
var s3 = new AWS.S3({
|
|
15
|
-
accessKeyId: process.env.REACT_APP_AWS_ID,
|
|
16
|
-
secretAccessKey: process.env.REACT_APP_AWS_SECRET
|
|
17
|
-
});
|
|
18
|
-
var s3ParseUrl = function s3ParseUrl(url) {
|
|
19
|
-
var _decodedUrl = decodeURIComponent(url);
|
|
20
|
-
var _result = null;
|
|
21
|
-
|
|
22
|
-
// http://s3.amazonaws.com/bucket/key1/key2
|
|
23
|
-
var match = decodedUrl.match(/^https?:\/\/s3.amazonaws.com\/([^\/]+)\/?(.*?)$/);
|
|
24
|
-
if (_match) {
|
|
25
|
-
_result = {
|
|
26
|
-
bucket: _match[1],
|
|
27
|
-
key: _match[2],
|
|
28
|
-
region: ''
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// http://s3-aws-region.amazonaws.com/bucket/key1/key2
|
|
33
|
-
match = decodedUrl.match(/^https?:\/\/s3-([^.]+).amazonaws.com\/([^\/]+)\/?(.*?)$/);
|
|
34
|
-
if (_match) {
|
|
35
|
-
_result = {
|
|
36
|
-
bucket: _match[2],
|
|
37
|
-
key: _match[3],
|
|
38
|
-
region: _match[1]
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// http://bucket.s3.amazonaws.com/key1/key2
|
|
43
|
-
match = decodedUrl.match(/^https?:\/\/([^.]+).s3.amazonaws.com\/?(.*?)$/);
|
|
44
|
-
if (_match) {
|
|
45
|
-
_result = {
|
|
46
|
-
bucket: _match[1],
|
|
47
|
-
key: _match[2],
|
|
48
|
-
region: ''
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// http://bucket.s3-aws-region.amazonaws.com/key1/key2 or,
|
|
53
|
-
// http://bucket.s3.aws-region.amazonaws.com/key1/key2
|
|
54
|
-
match = decodedUrl.match(/^https?:\/\/([^.]+).(?:s3-|s3\.)([^.]+).amazonaws.com\/?(.*?)$/);
|
|
55
|
-
if (_match) {
|
|
56
|
-
_result = {
|
|
57
|
-
bucket: _match[1],
|
|
58
|
-
key: _match[3],
|
|
59
|
-
region: _match[2]
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
return _result;
|
|
63
|
-
};
|
|
64
13
|
export var textureCube = new HDRCubeTextureLoader().setPath('/catalog/envMap/').load(HDR_URLS, function () {
|
|
65
14
|
textureCube.magFilter = Three.LinearFilter;
|
|
66
15
|
textureCube.needsUpdate = true;
|
|
67
16
|
});
|
|
68
|
-
export var getSignedUrl = function getSignedUrl(url) {
|
|
69
|
-
if (!url) return url;
|
|
70
|
-
var signedUrl = url;
|
|
71
|
-
try {
|
|
72
|
-
var _s3ParseUrl = s3ParseUrl(url),
|
|
73
|
-
bucket = _s3ParseUrl.bucket,
|
|
74
|
-
key = _s3ParseUrl.key;
|
|
75
|
-
signedUrl = s3.getSignedUrl('getObject', {
|
|
76
|
-
Bucket: bucket,
|
|
77
|
-
Key: key,
|
|
78
|
-
ResponseCacheControl: 'no-cache'
|
|
79
|
-
});
|
|
80
|
-
} catch (e) {
|
|
81
|
-
signedUrl = url;
|
|
82
|
-
}
|
|
83
|
-
return signedUrl;
|
|
84
|
-
};
|
|
85
17
|
export var base64Decode = function base64Decode(targetStr) {
|
|
86
18
|
if (!targetStr) return null;
|
|
87
19
|
try {
|
|
@@ -7,9 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
14
13
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
14
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
@@ -322,41 +321,20 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
|
|
|
322
321
|
var el = document.getElementById('add_appliances_inactive');
|
|
323
322
|
if (el !== null && el !== void 0 && (_el$parentElement0 = el.parentElement) !== null && _el$parentElement0 !== void 0 && _el$parentElement0.parentElement) el.parentElement.parentElement.style.zIndex = 6;
|
|
324
323
|
}
|
|
325
|
-
}, {
|
|
326
|
-
key: "getChildContext",
|
|
327
|
-
value: function getChildContext() {
|
|
328
|
-
var _this2 = this;
|
|
329
|
-
return _objectSpread(_objectSpread({}, (0, _objectsUtils.objectsMap)(_export["default"], function (actionNamespace) {
|
|
330
|
-
return _this2.props[actionNamespace];
|
|
331
|
-
})), {}, {
|
|
332
|
-
translator: this.props.translator,
|
|
333
|
-
catalog: this.props.catalog
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
324
|
}, {
|
|
337
325
|
key: "componentDidMount",
|
|
338
326
|
value: function componentDidMount() {
|
|
339
327
|
window.forRedo = [];
|
|
340
|
-
var store = this.context.store;
|
|
341
|
-
var _this$props = this.props,
|
|
342
|
-
stateExtractor = _this$props.stateExtractor,
|
|
343
|
-
plugins = _this$props.plugins;
|
|
344
|
-
|
|
345
|
-
// keep old behavior: run plugins once on mount
|
|
346
|
-
var newplugins = (0, _toConsumableArray2["default"])(plugins);
|
|
347
|
-
newplugins.forEach(function (newplugin) {
|
|
348
|
-
return newplugin(store, stateExtractor);
|
|
349
|
-
});
|
|
350
328
|
}
|
|
351
329
|
}, {
|
|
352
330
|
key: "componentDidUpdate",
|
|
353
331
|
value: function componentDidUpdate(prevProps) {
|
|
354
332
|
var _extractedState$getIn;
|
|
355
|
-
var _this$
|
|
356
|
-
externalEvent = _this$
|
|
357
|
-
extractedState = _this$
|
|
358
|
-
projectActions = _this$
|
|
359
|
-
catalog = _this$
|
|
333
|
+
var _this$props = this.props,
|
|
334
|
+
externalEvent = _this$props.externalEvent,
|
|
335
|
+
extractedState = _this$props.extractedState,
|
|
336
|
+
projectActions = _this$props.projectActions,
|
|
337
|
+
catalog = _this$props.catalog;
|
|
360
338
|
|
|
361
339
|
// same behavior: handle external event when it changes
|
|
362
340
|
if (prevProps.externalEvent !== externalEvent) {
|
|
@@ -415,11 +393,11 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
|
|
|
415
393
|
}, {
|
|
416
394
|
key: "render",
|
|
417
395
|
value: function render() {
|
|
418
|
-
var _this$
|
|
419
|
-
width = _this$
|
|
420
|
-
height = _this$
|
|
421
|
-
extractedState = _this$
|
|
422
|
-
props = (0, _objectWithoutProperties2["default"])(_this$
|
|
396
|
+
var _this$props2 = this.props,
|
|
397
|
+
width = _this$props2.width,
|
|
398
|
+
height = _this$props2.height,
|
|
399
|
+
extractedState = _this$props2.extractedState,
|
|
400
|
+
props = (0, _objectWithoutProperties2["default"])(_this$props2, _excluded);
|
|
423
401
|
var _this$state = this.state,
|
|
424
402
|
savePopupVisible = _this$state.savePopupVisible,
|
|
425
403
|
quotePopupVisible = _this$state.quotePopupVisible,
|
|
@@ -485,15 +463,6 @@ LiteKitchenConfigurator.propTypes = {
|
|
|
485
463
|
// ✅ injected by connect
|
|
486
464
|
externalEvent: _propTypes["default"].object
|
|
487
465
|
};
|
|
488
|
-
LiteKitchenConfigurator.contextTypes = {
|
|
489
|
-
store: _propTypes["default"].object.isRequired
|
|
490
|
-
};
|
|
491
|
-
LiteKitchenConfigurator.childContextTypes = _objectSpread(_objectSpread({}, (0, _objectsUtils.objectsMap)(_export["default"], function () {
|
|
492
|
-
return _propTypes["default"].object;
|
|
493
|
-
})), {}, {
|
|
494
|
-
translator: _propTypes["default"].object,
|
|
495
|
-
catalog: _propTypes["default"].object
|
|
496
|
-
});
|
|
497
466
|
LiteKitchenConfigurator.defaultProps = {
|
|
498
467
|
translator: new _translator["default"](),
|
|
499
468
|
catalog: new _catalog["default"](),
|
package/lib/LiteRenderer.js
CHANGED
|
@@ -21,11 +21,14 @@ var Models = _models;
|
|
|
21
21
|
var _reducer = _interopRequireDefault(require("./reducers/reducer"));
|
|
22
22
|
var _AppContext = _interopRequireDefault(require("./AppContext"));
|
|
23
23
|
var _catalog = _interopRequireDefault(require("./catalog/catalog"));
|
|
24
|
+
var _export = _interopRequireDefault(require("./actions/export"));
|
|
25
|
+
var _translator = _interopRequireDefault(require("./translator/translator"));
|
|
24
26
|
var Areas = _interopRequireWildcard(require("./catalog/areas/area/planner-element"));
|
|
25
27
|
var Lines = _interopRequireWildcard(require("./catalog/lines/wall/planner-element"));
|
|
26
28
|
var _holesToCatalog = require("./mappings/holesToCatalog");
|
|
27
|
-
var
|
|
29
|
+
var _export2 = require("./plugins/export");
|
|
28
30
|
var _LiteKitchenConfigurator = _interopRequireDefault(require("./LiteKitchenConfigurator"));
|
|
31
|
+
var _objectsUtils = require("./utils/objects-utils");
|
|
29
32
|
var _excluded = ["width", "height", "configData", "externalEvent", "onInternalEvent", "onError", "holes"]; // LiteRenderer.jsx
|
|
30
33
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
31
34
|
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; }
|
|
@@ -120,7 +123,7 @@ function createInstanceStore() {
|
|
|
120
123
|
return (0, _redux.createStore)(reducer, null, enhancer);
|
|
121
124
|
}
|
|
122
125
|
function createPlugins() {
|
|
123
|
-
return [(0,
|
|
126
|
+
return [(0, _export2.Keyboard)(), (0, _export2.ConsoleDebugger)()];
|
|
124
127
|
}
|
|
125
128
|
function LiteRenderer(props) {
|
|
126
129
|
ensureSentryInit();
|
|
@@ -282,7 +285,26 @@ function LiteRenderer(props) {
|
|
|
282
285
|
var _ref = configData || {},
|
|
283
286
|
logoImg = _ref.logoImg,
|
|
284
287
|
companyUrl = _ref.companyUrl;
|
|
285
|
-
|
|
288
|
+
|
|
289
|
+
// Build the context value with bound action creators + translator + catalog
|
|
290
|
+
var translatorRef = (0, _react.useRef)(null);
|
|
291
|
+
if (!translatorRef.current) translatorRef.current = new _translator["default"]();
|
|
292
|
+
var contextValue = (0, _react.useMemo)(function () {
|
|
293
|
+
var store = storeRef.current;
|
|
294
|
+
var boundActions = (0, _objectsUtils.objectsMap)(_export["default"], function (actionNamespace) {
|
|
295
|
+
return (0, _redux.bindActionCreators)(_export["default"][actionNamespace], store.dispatch);
|
|
296
|
+
});
|
|
297
|
+
return _objectSpread(_objectSpread({}, boundActions), {}, {
|
|
298
|
+
translator: translatorRef.current,
|
|
299
|
+
catalog: catalogRef.current
|
|
300
|
+
});
|
|
301
|
+
}, []);
|
|
302
|
+
|
|
303
|
+
// Update catalog in context when it changes
|
|
304
|
+
contextValue.catalog = catalogRef.current;
|
|
305
|
+
return /*#__PURE__*/_react["default"].createElement(_AppContext["default"].Provider, {
|
|
306
|
+
value: contextValue
|
|
307
|
+
}, /*#__PURE__*/_react["default"].createElement(_reactRedux.Provider, {
|
|
286
308
|
store: storeRef.current
|
|
287
309
|
}, /*#__PURE__*/_react["default"].createElement(_LiteKitchenConfigurator["default"], (0, _extends2["default"])({
|
|
288
310
|
catalog: catalogRef.current,
|
package/lib/actions/export.js
CHANGED
|
@@ -1,36 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
import * as viewer2DActions from "./viewer2d-actions";
|
|
3
|
-
import * as viewer3DActions from "./viewer3d-actions";
|
|
4
|
-
import * as linesActions from "./lines-actions";
|
|
5
|
-
import * as holesActions from "./holes-actions";
|
|
6
|
-
import * as sceneActions from "./scene-actions";
|
|
7
|
-
import * as verticesActions from "./vertices-actions";
|
|
8
|
-
import * as itemsActions from "./items-actions";
|
|
9
|
-
import * as areaActions from "./area-actions";
|
|
10
|
-
import * as groupsActions from "./groups-actions";
|
|
1
|
+
"use strict";
|
|
11
2
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.viewer3DActions = exports.viewer2DActions = exports.verticesActions = exports.sceneActions = exports.projectActions = exports.linesActions = exports.itemsActions = exports.holesActions = exports.groupsActions = exports["default"] = exports.areaActions = void 0;
|
|
8
|
+
var projectActions = _interopRequireWildcard(require("./project-actions"));
|
|
9
|
+
exports.projectActions = projectActions;
|
|
10
|
+
var viewer2DActions = _interopRequireWildcard(require("./viewer2d-actions"));
|
|
11
|
+
exports.viewer2DActions = viewer2DActions;
|
|
12
|
+
var viewer3DActions = _interopRequireWildcard(require("./viewer3d-actions"));
|
|
13
|
+
exports.viewer3DActions = viewer3DActions;
|
|
14
|
+
var linesActions = _interopRequireWildcard(require("./lines-actions"));
|
|
15
|
+
exports.linesActions = linesActions;
|
|
16
|
+
var holesActions = _interopRequireWildcard(require("./holes-actions"));
|
|
17
|
+
exports.holesActions = holesActions;
|
|
18
|
+
var sceneActions = _interopRequireWildcard(require("./scene-actions"));
|
|
19
|
+
exports.sceneActions = sceneActions;
|
|
20
|
+
var verticesActions = _interopRequireWildcard(require("./vertices-actions"));
|
|
21
|
+
exports.verticesActions = verticesActions;
|
|
22
|
+
var itemsActions = _interopRequireWildcard(require("./items-actions"));
|
|
23
|
+
exports.itemsActions = itemsActions;
|
|
24
|
+
var areaActions = _interopRequireWildcard(require("./area-actions"));
|
|
25
|
+
exports.areaActions = areaActions;
|
|
26
|
+
var groupsActions = _interopRequireWildcard(require("./groups-actions"));
|
|
27
|
+
exports.groupsActions = groupsActions;
|
|
28
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
29
|
+
var _default = exports["default"] = {
|
|
30
|
+
projectActions: projectActions,
|
|
31
|
+
viewer2DActions: viewer2DActions,
|
|
32
|
+
viewer3DActions: viewer3DActions,
|
|
33
|
+
linesActions: linesActions,
|
|
34
|
+
holesActions: holesActions,
|
|
35
|
+
sceneActions: sceneActions,
|
|
36
|
+
verticesActions: verticesActions,
|
|
37
|
+
itemsActions: itemsActions,
|
|
38
|
+
areaActions: areaActions,
|
|
39
|
+
groupsActions: groupsActions
|
|
40
|
+
};
|
|
@@ -142,7 +142,4 @@ Content.propTypes = {
|
|
|
142
142
|
replaceCabinet: _propTypes["default"].func.isRequired,
|
|
143
143
|
onInternalEvent: _propTypes["default"].func.isRequired
|
|
144
144
|
};
|
|
145
|
-
Content.contextTypes = {
|
|
146
|
-
projectActions: _propTypes["default"].object.isRequired
|
|
147
|
-
};
|
|
148
145
|
module.exports = exports.default;
|