kitchen-simulator 3.1.2 → 4.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/README.md +0 -3
- package/es/AppContext.js +1 -1
- package/es/LiteKitchenConfigurator.js +15 -25
- package/es/LiteRenderer.js +2 -5
- package/es/actions/export.js +12 -25
- package/es/catalog/catalog.js +5 -21
- package/es/components/content.js +2 -5
- package/es/components/export.js +6 -4
- package/es/components/style/export.js +2 -28
- package/es/components/style/form-number-input.js +22 -11
- package/es/components/viewer2d/group.js +4 -5
- package/es/components/viewer2d/item.js +4 -5
- package/es/components/viewer2d/layer.js +1 -1
- package/es/components/viewer2d/line.js +47 -17
- package/es/components/viewer2d/rulerX.js +0 -3
- package/es/components/viewer2d/rulerY.js +0 -3
- package/es/components/viewer2d/scene.js +1 -4
- package/es/components/viewer2d/state.js +1 -1
- package/es/components/viewer2d/viewer2d.js +43 -28
- package/es/components/viewer3d/viewer3d-first-person.js +0 -8
- package/es/components/viewer3d/viewer3d.js +0 -9
- package/es/devLiteRenderer.js +148 -317
- package/es/index.js +12 -4
- package/es/mocks/appliancePayload.json +27 -0
- package/es/mocks/cabinetPayload.json +1914 -0
- package/es/mocks/cabinetPayload2.json +76 -0
- package/es/mocks/dataBundle2.json +4 -0
- package/es/mocks/distancePayload.json +6 -0
- package/es/mocks/doorStylePayload2.json +84 -0
- package/es/mocks/furnishingPayload.json +23 -0
- package/es/mocks/itemCDSPayload.json +27 -0
- package/es/mocks/lightingPayload.json +23 -0
- package/es/mocks/mockProps.json +43 -0
- package/es/mocks/mockProps2.json +9 -0
- package/es/mocks/moldingPayload.json +19 -0
- package/es/mocks/projectItemsCatalog.json +133 -0
- package/es/mocks/rectangleShape.json +238 -0
- package/es/mocks/replaceCabinetPayload.json +81 -0
- package/es/mocks/roomShapePayload.json +5 -0
- package/es/useAppContext.js +8 -0
- package/lib/AppContext.js +1 -1
- package/lib/LiteKitchenConfigurator.js +15 -25
- package/lib/LiteRenderer.js +2 -5
- package/lib/actions/export.js +39 -35
- package/lib/catalog/catalog.js +4 -20
- package/lib/components/content.js +2 -5
- package/lib/components/export.js +26 -6
- package/lib/components/style/export.js +1 -105
- package/lib/components/style/form-number-input.js +22 -11
- package/lib/components/viewer2d/group.js +4 -5
- package/lib/components/viewer2d/item.js +4 -5
- package/lib/components/viewer2d/layer.js +1 -1
- package/lib/components/viewer2d/line.js +47 -17
- package/lib/components/viewer2d/rulerX.js +0 -3
- package/lib/components/viewer2d/rulerY.js +0 -3
- package/lib/components/viewer2d/scene.js +1 -4
- package/lib/components/viewer2d/state.js +1 -1
- package/lib/components/viewer2d/viewer2d.js +42 -27
- package/lib/components/viewer3d/viewer3d-first-person.js +0 -8
- package/lib/components/viewer3d/viewer3d.js +0 -9
- package/lib/devLiteRenderer.js +147 -316
- package/lib/index.js +12 -4
- package/lib/mocks/appliancePayload.json +27 -0
- package/lib/mocks/cabinetPayload.json +1914 -0
- package/lib/mocks/cabinetPayload2.json +76 -0
- package/lib/mocks/dataBundle2.json +4 -0
- package/lib/mocks/distancePayload.json +6 -0
- package/lib/mocks/doorStylePayload2.json +84 -0
- package/lib/mocks/furnishingPayload.json +23 -0
- package/lib/mocks/itemCDSPayload.json +27 -0
- package/lib/mocks/lightingPayload.json +23 -0
- package/lib/mocks/mockProps.json +43 -0
- package/lib/mocks/mockProps2.json +9 -0
- package/lib/mocks/moldingPayload.json +19 -0
- package/lib/mocks/projectItemsCatalog.json +133 -0
- package/lib/mocks/rectangleShape.json +238 -0
- package/lib/mocks/replaceCabinetPayload.json +81 -0
- package/lib/mocks/roomShapePayload.json +5 -0
- package/lib/useAppContext.js +16 -0
- package/package.json +16 -21
- package/es/catalog/properties/export.js +0 -21
- package/es/catalog/properties/property-checkbox.js +0 -68
- package/es/catalog/properties/property-color.js +0 -39
- package/es/catalog/properties/property-enum.js +0 -50
- package/es/catalog/properties/property-hidden.js +0 -19
- package/es/catalog/properties/property-lenght-measure.js +0 -100
- package/es/catalog/properties/property-length-measure.js +0 -84
- package/es/catalog/properties/property-length-measure_hole.js +0 -100
- package/es/catalog/properties/property-number.js +0 -48
- package/es/catalog/properties/property-read-only.js +0 -26
- package/es/catalog/properties/property-string.js +0 -48
- package/es/catalog/properties/property-toggle.js +0 -39
- package/es/catalog/properties/shared-property-style.js +0 -14
- package/es/components/style/button.js +0 -106
- package/es/components/style/cancel-button.js +0 -21
- package/es/components/style/content-container.js +0 -30
- package/es/components/style/content-title.js +0 -25
- package/es/components/style/delete-button.js +0 -24
- package/es/components/style/form-block.js +0 -20
- package/es/components/style/form-color-input.js +0 -26
- package/es/components/style/form-label.js +0 -22
- package/es/components/style/form-number-input_2.js +0 -200
- package/es/components/style/form-select.js +0 -19
- package/es/components/style/form-slider.js +0 -60
- package/es/components/style/form-submit-button.js +0 -25
- package/es/components/style/form-text-input.js +0 -69
- package/es/plugins/SVGLoader.js +0 -1414
- package/es/styles/export.js +0 -5
- package/es/styles/tabs.css +0 -40
- package/lib/catalog/properties/export.js +0 -81
- package/lib/catalog/properties/property-checkbox.js +0 -76
- package/lib/catalog/properties/property-color.js +0 -47
- package/lib/catalog/properties/property-enum.js +0 -58
- package/lib/catalog/properties/property-hidden.js +0 -27
- package/lib/catalog/properties/property-lenght-measure.js +0 -108
- package/lib/catalog/properties/property-length-measure.js +0 -92
- package/lib/catalog/properties/property-length-measure_hole.js +0 -108
- package/lib/catalog/properties/property-number.js +0 -56
- package/lib/catalog/properties/property-read-only.js +0 -34
- package/lib/catalog/properties/property-string.js +0 -56
- package/lib/catalog/properties/property-toggle.js +0 -47
- package/lib/catalog/properties/shared-property-style.js +0 -21
- package/lib/components/style/button.js +0 -115
- package/lib/components/style/cancel-button.js +0 -29
- package/lib/components/style/content-container.js +0 -38
- package/lib/components/style/content-title.js +0 -35
- package/lib/components/style/delete-button.js +0 -34
- package/lib/components/style/form-block.js +0 -28
- package/lib/components/style/form-color-input.js +0 -34
- package/lib/components/style/form-label.js +0 -30
- package/lib/components/style/form-number-input_2.js +0 -209
- package/lib/components/style/form-select.js +0 -29
- package/lib/components/style/form-slider.js +0 -68
- package/lib/components/style/form-submit-button.js +0 -35
- package/lib/components/style/form-text-input.js +0 -78
- package/lib/plugins/SVGLoader.js +0 -1419
- package/lib/styles/export.js +0 -13
- package/lib/styles/tabs.css +0 -40
|
@@ -129,9 +129,6 @@ var Scene = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
129
129
|
Scene.propTypes = {
|
|
130
130
|
scene: _propTypes["default"].object.isRequired,
|
|
131
131
|
catalog: _propTypes["default"].object.isRequired,
|
|
132
|
-
relatedLines: _propTypes["default"].
|
|
133
|
-
};
|
|
134
|
-
Scene.contextTypes = {
|
|
135
|
-
projectActions: _propTypes["default"].object.isRequired
|
|
132
|
+
relatedLines: _propTypes["default"].array.isRequired
|
|
136
133
|
};
|
|
137
134
|
module.exports = exports.default;
|
|
@@ -78,6 +78,6 @@ function State(_ref) {
|
|
|
78
78
|
State.propTypes = {
|
|
79
79
|
state: _propTypes["default"].object.isRequired,
|
|
80
80
|
catalog: _propTypes["default"].object.isRequired,
|
|
81
|
-
relatedLines: _propTypes["default"].
|
|
81
|
+
relatedLines: _propTypes["default"].array.isRequired
|
|
82
82
|
};
|
|
83
83
|
module.exports = exports.default;
|
|
@@ -23,6 +23,7 @@ var _immutable = require("immutable");
|
|
|
23
23
|
var _math = require("../../utils/math");
|
|
24
24
|
var _helper = require("../../utils/helper");
|
|
25
25
|
var _utils = require("./utils");
|
|
26
|
+
var _useAppContext2 = require("../../useAppContext");
|
|
26
27
|
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); }
|
|
27
28
|
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; }
|
|
28
29
|
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) { (0, _defineProperty2["default"])(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; } // variables
|
|
@@ -129,21 +130,22 @@ function extractElementData(node) {
|
|
|
129
130
|
direct: node.attributes.getNamedItem('data-direct') ? node.attributes.getNamedItem('data-direct').value : 0
|
|
130
131
|
};
|
|
131
132
|
}
|
|
132
|
-
function Viewer2D(_ref
|
|
133
|
+
function Viewer2D(_ref) {
|
|
133
134
|
var state = _ref.state,
|
|
134
135
|
width = _ref.width,
|
|
135
136
|
height = _ref.height,
|
|
136
137
|
setToolbar = _ref.setToolbar,
|
|
137
138
|
replaceCabinet = _ref.replaceCabinet,
|
|
138
139
|
onInternalEvent = _ref.onInternalEvent;
|
|
139
|
-
var
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
140
|
+
var _useAppContext = (0, _useAppContext2.useAppContext)(),
|
|
141
|
+
viewer2DActions = _useAppContext.viewer2DActions,
|
|
142
|
+
linesActions = _useAppContext.linesActions,
|
|
143
|
+
holesActions = _useAppContext.holesActions,
|
|
144
|
+
verticesActions = _useAppContext.verticesActions,
|
|
145
|
+
itemsActions = _useAppContext.itemsActions,
|
|
146
|
+
areaActions = _useAppContext.areaActions,
|
|
147
|
+
projectActions = _useAppContext.projectActions,
|
|
148
|
+
catalog = _useAppContext.catalog;
|
|
147
149
|
var _useState = (0, _react.useState)(null),
|
|
148
150
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
149
151
|
rulerEdit = _useState2[0],
|
|
@@ -166,6 +168,26 @@ function Viewer2D(_ref, _ref2) {
|
|
|
166
168
|
_useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
|
|
167
169
|
drawStart = _useState8[0],
|
|
168
170
|
setdrawStart = _useState8[1];
|
|
171
|
+
var _useState9 = (0, _react.useState)(function () {
|
|
172
|
+
return viewer2D && !viewer2D.isEmpty() ? viewer2D.toJS() : _reactSvgPanZoom.INITIAL_VALUE;
|
|
173
|
+
}),
|
|
174
|
+
_useState0 = (0, _slicedToArray2["default"])(_useState9, 2),
|
|
175
|
+
svgValue = _useState0[0],
|
|
176
|
+
setSvgValue = _useState0[1];
|
|
177
|
+
var _useState1 = (0, _react.useState)(function () {
|
|
178
|
+
return mode2Tool(mode);
|
|
179
|
+
}),
|
|
180
|
+
_useState10 = (0, _slicedToArray2["default"])(_useState1, 2),
|
|
181
|
+
svgTool = _useState10[0],
|
|
182
|
+
setSvgTool = _useState10[1];
|
|
183
|
+
(0, _react.useEffect)(function () {
|
|
184
|
+
// keep tool controlled from app mode
|
|
185
|
+
setSvgTool(mode2Tool(mode));
|
|
186
|
+
}, [mode]);
|
|
187
|
+
(0, _react.useEffect)(function () {
|
|
188
|
+
// keep value controlled from store, but never null
|
|
189
|
+
if (viewer2D && !viewer2D.isEmpty()) setSvgValue(viewer2D.toJS());
|
|
190
|
+
}, [viewer2D]);
|
|
169
191
|
(0, _react.useEffect)(function () {
|
|
170
192
|
// move viewer point to center
|
|
171
193
|
var selectedLayer = state.scene.layers.get(state.scene.selectedLayer);
|
|
@@ -190,9 +212,9 @@ function Viewer2D(_ref, _ref2) {
|
|
|
190
212
|
var layerID = scene.selectedLayer;
|
|
191
213
|
var wall_thickness = _constants.LINE_THICKNESS / 2;
|
|
192
214
|
var layer = scene.getIn(['layers', layerID]);
|
|
193
|
-
var mapCursorPosition = function mapCursorPosition(
|
|
194
|
-
var x =
|
|
195
|
-
y =
|
|
215
|
+
var mapCursorPosition = function mapCursorPosition(_ref2) {
|
|
216
|
+
var x = _ref2.x,
|
|
217
|
+
y = _ref2.y;
|
|
196
218
|
return {
|
|
197
219
|
x: x,
|
|
198
220
|
y: -y + scene.height
|
|
@@ -1295,6 +1317,7 @@ function Viewer2D(_ref, _ref2) {
|
|
|
1295
1317
|
};
|
|
1296
1318
|
var onChangeValue = function onChangeValue(value) {
|
|
1297
1319
|
if (sFlag) return;
|
|
1320
|
+
setSvgValue(value);
|
|
1298
1321
|
var _zoomValue = parseInt((value.a - 0.5) / constants.ZOOM_VARIABLE);
|
|
1299
1322
|
if (_zoomValue > constants.MAX_ZOOM_IN_SCALE) return;
|
|
1300
1323
|
if (_zoomValue < 0 || Number.isNaN(_zoomValue)) return;
|
|
@@ -1326,6 +1349,7 @@ function Viewer2D(_ref, _ref2) {
|
|
|
1326
1349
|
}
|
|
1327
1350
|
};
|
|
1328
1351
|
var onChangeTool = function onChangeTool(tool) {
|
|
1352
|
+
setSvgTool(tool);
|
|
1329
1353
|
switch (tool) {
|
|
1330
1354
|
case _reactSvgPanZoom.TOOL_NONE:
|
|
1331
1355
|
projectActions.selectToolEdit();
|
|
@@ -1424,19 +1448,20 @@ function Viewer2D(_ref, _ref2) {
|
|
|
1424
1448
|
},
|
|
1425
1449
|
width: width - rulerSize,
|
|
1426
1450
|
height: height - rulerSize,
|
|
1427
|
-
value:
|
|
1451
|
+
value: svgValue,
|
|
1452
|
+
tool: svgTool,
|
|
1428
1453
|
onChangeValue: onChangeValue,
|
|
1429
|
-
tool: mode2Tool(mode),
|
|
1430
1454
|
onChangeTool: onChangeTool,
|
|
1431
1455
|
detectAutoPan: mode2DetectAutopan(mode),
|
|
1432
1456
|
onMouseDown: onMouseDown,
|
|
1433
1457
|
onMouseMove: onMouseMove,
|
|
1434
1458
|
onMouseUp: onMouseUp,
|
|
1435
|
-
miniaturePosition: "none",
|
|
1436
|
-
toolbarPosition: "none",
|
|
1437
1459
|
detectPinchGesture: false,
|
|
1438
1460
|
disableDoubleClickZoomWithToolAuto: true,
|
|
1439
|
-
ref: Viewer
|
|
1461
|
+
ref: Viewer,
|
|
1462
|
+
toolbarProps: {
|
|
1463
|
+
position: _reactSvgPanZoom.POSITION_NONE
|
|
1464
|
+
}
|
|
1440
1465
|
}, /*#__PURE__*/_react["default"].createElement("svg", {
|
|
1441
1466
|
width: scene.width,
|
|
1442
1467
|
height: scene.height
|
|
@@ -1472,14 +1497,4 @@ Viewer2D.propTypes = {
|
|
|
1472
1497
|
width: _propTypes["default"].number.isRequired,
|
|
1473
1498
|
height: _propTypes["default"].number.isRequired
|
|
1474
1499
|
};
|
|
1475
|
-
Viewer2D.contextTypes = {
|
|
1476
|
-
viewer2DActions: _propTypes["default"].object.isRequired,
|
|
1477
|
-
linesActions: _propTypes["default"].object.isRequired,
|
|
1478
|
-
holesActions: _propTypes["default"].object.isRequired,
|
|
1479
|
-
verticesActions: _propTypes["default"].object.isRequired,
|
|
1480
|
-
itemsActions: _propTypes["default"].object.isRequired,
|
|
1481
|
-
areaActions: _propTypes["default"].object.isRequired,
|
|
1482
|
-
projectActions: _propTypes["default"].object.isRequired,
|
|
1483
|
-
catalog: _propTypes["default"].object.isRequired
|
|
1484
|
-
};
|
|
1485
1500
|
module.exports = exports.default;
|
|
@@ -305,12 +305,4 @@ Viewer3DFirstPerson.propTypes = {
|
|
|
305
305
|
width: _propTypes["default"].number.isRequired,
|
|
306
306
|
height: _propTypes["default"].number.isRequired
|
|
307
307
|
};
|
|
308
|
-
Viewer3DFirstPerson.contextTypes = {
|
|
309
|
-
areaActions: _propTypes["default"].object.isRequired,
|
|
310
|
-
holesActions: _propTypes["default"].object.isRequired,
|
|
311
|
-
itemsActions: _propTypes["default"].object.isRequired,
|
|
312
|
-
linesActions: _propTypes["default"].object.isRequired,
|
|
313
|
-
projectActions: _propTypes["default"].object.isRequired,
|
|
314
|
-
catalog: _propTypes["default"].object
|
|
315
|
-
};
|
|
316
308
|
module.exports = exports.default;
|
|
@@ -2671,13 +2671,4 @@ Scene3DViewer.propTypes = {
|
|
|
2671
2671
|
height: _propTypes["default"].number.isRequired,
|
|
2672
2672
|
replaceCabinet: _propTypes["default"].func.isRequired
|
|
2673
2673
|
};
|
|
2674
|
-
Scene3DViewer.contextTypes = {
|
|
2675
|
-
areaActions: _propTypes["default"].object.isRequired,
|
|
2676
|
-
holesActions: _propTypes["default"].object.isRequired,
|
|
2677
|
-
itemsActions: _propTypes["default"].object.isRequired,
|
|
2678
|
-
linesActions: _propTypes["default"].object.isRequired,
|
|
2679
|
-
sceneActions: _propTypes["default"].object.isRequired,
|
|
2680
|
-
projectActions: _propTypes["default"].object.isRequired,
|
|
2681
|
-
catalog: _propTypes["default"].object
|
|
2682
|
-
};
|
|
2683
2674
|
module.exports = exports.default;
|