kitchen-simulator 1.0.0-alin.45 → 1.0.0-alin.47
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.
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
5
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
5
6
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
6
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
7
8
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
8
9
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
9
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
10
10
|
var _excluded = ["width", "height", "state", "stateExtractor"];
|
|
11
11
|
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; }
|
|
12
12
|
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; }
|
|
@@ -40,23 +40,6 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
|
|
|
40
40
|
_this = _callSuper(this, LiteKitchenConfigurator, [props]);
|
|
41
41
|
|
|
42
42
|
// utm tracking
|
|
43
|
-
_defineProperty(_this, "handleBeforeUnload", function (e) {
|
|
44
|
-
var areas = _this.props.stateExtractor(_this.props.state).getIn(['scene', 'layers', _this.props.stateExtractor(_this.props.state).scene.selectedLayer, 'areas']);
|
|
45
|
-
if (!_this.state.isSaved && areas.size > 0) {
|
|
46
|
-
setTimeout(function () {
|
|
47
|
-
_this.setState({
|
|
48
|
-
savePromptVisible: true,
|
|
49
|
-
isLeaving: true
|
|
50
|
-
});
|
|
51
|
-
}, 500);
|
|
52
|
-
_this.saveProjectToStorage();
|
|
53
|
-
|
|
54
|
-
// This line is required to trigger the browser confirmation dialog
|
|
55
|
-
e.preventDefault();
|
|
56
|
-
e.returnValue = '';
|
|
57
|
-
return '';
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
43
|
var utmDetailParams = new URLSearchParams(_this.props.location && _this.props.location.search);
|
|
61
44
|
var utmStrEncoded = utmDetailParams.get('details');
|
|
62
45
|
var utmRequestData = null;
|
|
@@ -343,8 +326,6 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
|
|
|
343
326
|
}, {
|
|
344
327
|
key: "componentDidMount",
|
|
345
328
|
value: function componentDidMount() {
|
|
346
|
-
window.addEventListener('beforeunload', this.handleBeforeUnload);
|
|
347
|
-
console.log('context =>', this.context);
|
|
348
329
|
window.forRedo = [];
|
|
349
330
|
var store = this.context.store;
|
|
350
331
|
var _this$props2 = this.props,
|
|
@@ -355,15 +336,6 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
|
|
|
355
336
|
return newplugin(store, stateExtractor);
|
|
356
337
|
});
|
|
357
338
|
}
|
|
358
|
-
}, {
|
|
359
|
-
key: "componentWillUnmount",
|
|
360
|
-
value: function componentWillUnmount() {
|
|
361
|
-
window.addEventListener('beforeunload', this.handleBeforeUnload);
|
|
362
|
-
window.onbeforeunload = null;
|
|
363
|
-
}
|
|
364
|
-
}, {
|
|
365
|
-
key: "componentWillMount",
|
|
366
|
-
value: function componentWillMount() {}
|
|
367
339
|
}, {
|
|
368
340
|
key: "componentWillReceiveProps",
|
|
369
341
|
value: function componentWillReceiveProps(nextProps) {
|
package/es/catalog/catalog.js
CHANGED
|
@@ -247,10 +247,7 @@ var Catalog = /*#__PURE__*/function () {
|
|
|
247
247
|
if (name === '') {
|
|
248
248
|
throw new Error('Category has empty name');
|
|
249
249
|
}
|
|
250
|
-
|
|
251
|
-
throw new Error('Category has already been registered');
|
|
252
|
-
}
|
|
253
|
-
return true;
|
|
250
|
+
return !this.hasCategory(name);
|
|
254
251
|
}
|
|
255
252
|
|
|
256
253
|
/**
|
|
@@ -4,7 +4,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
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
5
|
import React, { useEffect, useRef, useState } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
import {
|
|
7
|
+
import { ReactSVGPanZoom, TOOL_AUTO, TOOL_NONE, TOOL_PAN, TOOL_ZOOM_IN, TOOL_ZOOM_OUT } from 'react-svg-pan-zoom';
|
|
8
8
|
import * as constants from "../../constants";
|
|
9
9
|
import { DECIMAL_PLACES_2, LINE_THICKNESS, MIN_ANGLE_DISALLOW_DRAW_WALL, MODE_ELEVATION_VIEW, MODE_IDLE, UNIT_ANGLE } from "../../constants";
|
|
10
10
|
import State from "./state";
|
|
@@ -1309,7 +1309,7 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
1309
1309
|
},
|
|
1310
1310
|
width: width - rulerSize,
|
|
1311
1311
|
height: height - rulerSize,
|
|
1312
|
-
value: viewer2D.isEmpty() ?
|
|
1312
|
+
value: viewer2D.isEmpty() ? null : viewer2D.toJS(),
|
|
1313
1313
|
onChangeValue: onChangeValue,
|
|
1314
1314
|
tool: mode2Tool(mode),
|
|
1315
1315
|
onChangeTool: onChangeTool,
|
|
@@ -1317,9 +1317,8 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
1317
1317
|
onMouseDown: onMouseDown,
|
|
1318
1318
|
onMouseMove: onMouseMove,
|
|
1319
1319
|
onMouseUp: onMouseUp,
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
},
|
|
1320
|
+
miniaturePosition: "none",
|
|
1321
|
+
toolbarPosition: "none",
|
|
1323
1322
|
detectPinchGesture: false,
|
|
1324
1323
|
disableDoubleClickZoomWithToolAuto: true,
|
|
1325
1324
|
ref: Viewer
|
|
@@ -9,12 +9,12 @@ exports["default"] = void 0;
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
13
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
14
15
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
15
16
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
16
17
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
18
|
var _axios = _interopRequireDefault(require("axios"));
|
|
19
19
|
var _convertUnitsLite = require("./utils/convert-units-lite");
|
|
20
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -49,23 +49,6 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
|
|
|
49
49
|
_this = _callSuper(this, LiteKitchenConfigurator, [props]);
|
|
50
50
|
|
|
51
51
|
// utm tracking
|
|
52
|
-
(0, _defineProperty2["default"])(_this, "handleBeforeUnload", function (e) {
|
|
53
|
-
var areas = _this.props.stateExtractor(_this.props.state).getIn(['scene', 'layers', _this.props.stateExtractor(_this.props.state).scene.selectedLayer, 'areas']);
|
|
54
|
-
if (!_this.state.isSaved && areas.size > 0) {
|
|
55
|
-
setTimeout(function () {
|
|
56
|
-
_this.setState({
|
|
57
|
-
savePromptVisible: true,
|
|
58
|
-
isLeaving: true
|
|
59
|
-
});
|
|
60
|
-
}, 500);
|
|
61
|
-
_this.saveProjectToStorage();
|
|
62
|
-
|
|
63
|
-
// This line is required to trigger the browser confirmation dialog
|
|
64
|
-
e.preventDefault();
|
|
65
|
-
e.returnValue = '';
|
|
66
|
-
return '';
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
52
|
var utmDetailParams = new URLSearchParams(_this.props.location && _this.props.location.search);
|
|
70
53
|
var utmStrEncoded = utmDetailParams.get('details');
|
|
71
54
|
var utmRequestData = null;
|
|
@@ -352,8 +335,6 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
|
|
|
352
335
|
}, {
|
|
353
336
|
key: "componentDidMount",
|
|
354
337
|
value: function componentDidMount() {
|
|
355
|
-
window.addEventListener('beforeunload', this.handleBeforeUnload);
|
|
356
|
-
console.log('context =>', this.context);
|
|
357
338
|
window.forRedo = [];
|
|
358
339
|
var store = this.context.store;
|
|
359
340
|
var _this$props2 = this.props,
|
|
@@ -364,15 +345,6 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
|
|
|
364
345
|
return newplugin(store, stateExtractor);
|
|
365
346
|
});
|
|
366
347
|
}
|
|
367
|
-
}, {
|
|
368
|
-
key: "componentWillUnmount",
|
|
369
|
-
value: function componentWillUnmount() {
|
|
370
|
-
window.addEventListener('beforeunload', this.handleBeforeUnload);
|
|
371
|
-
window.onbeforeunload = null;
|
|
372
|
-
}
|
|
373
|
-
}, {
|
|
374
|
-
key: "componentWillMount",
|
|
375
|
-
value: function componentWillMount() {}
|
|
376
348
|
}, {
|
|
377
349
|
key: "componentWillReceiveProps",
|
|
378
350
|
value: function componentWillReceiveProps(nextProps) {
|
package/lib/catalog/catalog.js
CHANGED
|
@@ -254,10 +254,7 @@ var Catalog = exports["default"] = /*#__PURE__*/function () {
|
|
|
254
254
|
if (name === '') {
|
|
255
255
|
throw new Error('Category has empty name');
|
|
256
256
|
}
|
|
257
|
-
|
|
258
|
-
throw new Error('Category has already been registered');
|
|
259
|
-
}
|
|
260
|
-
return true;
|
|
257
|
+
return !this.hasCategory(name);
|
|
261
258
|
}
|
|
262
259
|
|
|
263
260
|
/**
|
|
@@ -1319,7 +1319,7 @@ function Viewer2D(_ref, _ref2) {
|
|
|
1319
1319
|
},
|
|
1320
1320
|
width: width - rulerSize,
|
|
1321
1321
|
height: height - rulerSize,
|
|
1322
|
-
value: viewer2D.isEmpty() ?
|
|
1322
|
+
value: viewer2D.isEmpty() ? null : viewer2D.toJS(),
|
|
1323
1323
|
onChangeValue: onChangeValue,
|
|
1324
1324
|
tool: mode2Tool(mode),
|
|
1325
1325
|
onChangeTool: onChangeTool,
|
|
@@ -1327,9 +1327,8 @@ function Viewer2D(_ref, _ref2) {
|
|
|
1327
1327
|
onMouseDown: onMouseDown,
|
|
1328
1328
|
onMouseMove: onMouseMove,
|
|
1329
1329
|
onMouseUp: onMouseUp,
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
},
|
|
1330
|
+
miniaturePosition: "none",
|
|
1331
|
+
toolbarPosition: "none",
|
|
1333
1332
|
detectPinchGesture: false,
|
|
1334
1333
|
disableDoubleClickZoomWithToolAuto: true,
|
|
1335
1334
|
ref: Viewer
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kitchen-simulator",
|
|
3
|
-
"version": "1.0.0-alin.
|
|
3
|
+
"version": "1.0.0-alin.47",
|
|
4
4
|
"description": "It is a kitchen simulator (self-contained micro-frontend).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"react-hotjar": "^1.0.11",
|
|
83
83
|
"react-icons": "3.5.0",
|
|
84
84
|
"react-redux": "5.0.7",
|
|
85
|
-
"react-svg-pan-zoom": "
|
|
85
|
+
"react-svg-pan-zoom": "2.18.0",
|
|
86
86
|
"redux": "4.0.1",
|
|
87
87
|
"three": "0.166.0",
|
|
88
88
|
"moment": "^2.30.1",
|