kitchen-simulator 1.1.1-test.72 → 1.1.1-test.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/@history.js +2 -5
- package/es/AppContext.js +3 -6
- package/es/KitchenConfigurator.js +86 -86
- package/es/KitchenConfiguratorApp.js +134 -128
- package/es/actions/area-actions.js +5 -8
- package/es/actions/export.js +12 -24
- package/es/actions/groups-actions.js +27 -41
- package/es/actions/holes-actions.js +34 -51
- package/es/actions/items-actions.js +94 -141
- package/es/actions/lines-actions.js +21 -32
- package/es/actions/project-actions.js +94 -141
- package/es/actions/scene-actions.js +11 -17
- package/es/actions/vertices-actions.js +7 -11
- package/es/actions/viewer2d-actions.js +21 -32
- package/es/actions/viewer3d-actions.js +9 -14
- package/es/catalog/areas/area/planner-element.js +2 -5
- package/es/catalog/catalog.js +15 -17
- package/es/catalog/factories/area-factory-3d.js +22 -26
- package/es/catalog/factories/area-factory.js +13 -15
- package/es/catalog/factories/export.js +6 -10
- package/es/catalog/factories/wall-factory-3d.js +31 -36
- package/es/catalog/factories/wall-factory.js +21 -26
- package/es/catalog/holes/door-closet/planner-element.js +15 -19
- package/es/catalog/holes/door-double/planner-element.js +15 -19
- package/es/catalog/holes/door-exterior/planner-element.js +16 -20
- package/es/catalog/holes/door-interior/planner-element.js +16 -20
- package/es/catalog/holes/door-panic/planner-element.js +7 -11
- package/es/catalog/holes/door-panic-double/planner-element.js +15 -19
- package/es/catalog/holes/door-sliding/planner-element.js +17 -21
- package/es/catalog/holes/doorway-framed/planner-element.js +11 -15
- package/es/catalog/holes/doorway-frameless/planner-element.js +7 -11
- package/es/catalog/holes/export.js +13 -29
- package/es/catalog/holes/window-clear/planner-element.js +10 -14
- package/es/catalog/holes/window-cross/planner-element.js +10 -14
- package/es/catalog/holes/window-double-hung/planner-element.js +10 -14
- package/es/catalog/holes/window-vertical/planner-element.js +10 -14
- package/es/catalog/lines/wall/planner-element.js +2 -5
- package/es/catalog/molding/molding-dcm/planner-element.js +5 -9
- package/es/catalog/molding/molding-fbm/planner-element.js +5 -9
- package/es/catalog/molding/molding-lrm/planner-element.js +5 -9
- package/es/catalog/properties/export.js +20 -31
- package/es/catalog/properties/property-checkbox.js +28 -29
- package/es/catalog/properties/property-color.js +16 -19
- package/es/catalog/properties/property-enum.js +24 -27
- package/es/catalog/properties/property-hidden.js +9 -12
- package/es/catalog/properties/property-lenght-measure.js +38 -41
- package/es/catalog/properties/property-length-measure.js +36 -39
- package/es/catalog/properties/property-length-measure_hole.js +38 -41
- package/es/catalog/properties/property-number.js +17 -20
- package/es/catalog/properties/property-read-only.js +16 -19
- package/es/catalog/properties/property-string.js +16 -19
- package/es/catalog/properties/property-toggle.js +16 -19
- package/es/catalog/properties/shared-property-style.js +1 -3
- package/es/catalog/utils/FuseUtils.js +12 -13
- package/es/catalog/utils/exporter.js +10 -11
- package/es/catalog/utils/geom-utils.js +13 -24
- package/es/catalog/utils/item-loader.js +86 -92
- package/es/catalog/utils/load-obj.js +20 -24
- package/es/catalog/utils/mtl-loader.js +3 -4
- package/es/catalog/utils/obj-loader.js +3 -4
- package/es/class/FuseUtils.js +12 -13
- package/es/class/area.js +24 -24
- package/es/class/export.js +23 -36
- package/es/class/group.js +53 -55
- package/es/class/guide.js +15 -17
- package/es/class/hole.js +83 -85
- package/es/class/item.js +155 -155
- package/es/class/layer.js +59 -61
- package/es/class/line.js +135 -138
- package/es/class/project.js +93 -94
- package/es/class/vertex.js +29 -31
- package/es/components/content.js +19 -23
- package/es/components/disclaimer/disclaimer.js +10 -13
- package/es/components/export.js +8 -13
- package/es/components/style/button.js +25 -25
- package/es/components/style/cancel-button.js +7 -10
- package/es/components/style/content-container.js +11 -12
- package/es/components/style/content-title.js +13 -15
- package/es/components/style/delete-button.js +8 -12
- package/es/components/style/export.js +30 -46
- package/es/components/style/form-block.js +10 -11
- package/es/components/style/form-color-input.js +7 -10
- package/es/components/style/form-label.js +10 -11
- package/es/components/style/form-number-input.js +45 -43
- package/es/components/style/form-number-input_2.js +41 -39
- package/es/components/style/form-select.js +19 -20
- package/es/components/style/form-slider.js +10 -13
- package/es/components/style/form-submit-button.js +8 -12
- package/es/components/style/form-text-input.js +30 -28
- package/es/components/viewer2d/area.js +17 -20
- package/es/components/viewer2d/export.js +30 -46
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +10 -13
- package/es/components/viewer2d/grids/grid-streak.js +10 -13
- package/es/components/viewer2d/grids/grid-vertical-streak.js +10 -13
- package/es/components/viewer2d/grids/grids.js +10 -14
- package/es/components/viewer2d/group.js +15 -19
- package/es/components/viewer2d/item.js +61 -65
- package/es/components/viewer2d/layer.js +23 -26
- package/es/components/viewer2d/line.js +101 -106
- package/es/components/viewer2d/ruler.js +22 -25
- package/es/components/viewer2d/rulerDist.js +21 -24
- package/es/components/viewer2d/rulerX.js +46 -44
- package/es/components/viewer2d/rulerY.js +44 -42
- package/es/components/viewer2d/scene.js +34 -34
- package/es/components/viewer2d/snap.js +13 -17
- package/es/components/viewer2d/state.js +18 -22
- package/es/components/viewer2d/utils.js +24 -33
- package/es/components/viewer2d/vertex.js +8 -12
- package/es/components/viewer2d/viewer2d.js +156 -159
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +21 -19
- package/es/components/viewer3d/dcm.js +1 -3
- package/es/components/viewer3d/fbm.js +1 -3
- package/es/components/viewer3d/front3D.js +12 -16
- package/es/components/viewer3d/grid-creator.js +8 -12
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +6 -9
- package/es/components/viewer3d/grids/grid-streak.js +5 -8
- package/es/components/viewer3d/grids/grid-vertical-streak.js +6 -9
- package/es/components/viewer3d/libs/first-person-controls.js +2 -5
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +1 -3
- package/es/components/viewer3d/libs/mtl-loader.js +1 -3
- package/es/components/viewer3d/libs/obj-loader.js +1 -3
- package/es/components/viewer3d/libs/orbit-controls.js +2 -4
- package/es/components/viewer3d/libs/pointer-lock-controls.js +2 -4
- package/es/components/viewer3d/lrm.js +1 -3
- package/es/components/viewer3d/model.js +1 -3
- package/es/components/viewer3d/pointer-lock-navigation.js +3 -6
- package/es/components/viewer3d/ruler-utils/itemRect.js +18 -21
- package/es/components/viewer3d/ruler-utils/layer3D.js +59 -62
- package/es/components/viewer3d/ruler-utils/ruler3D.js +42 -43
- package/es/components/viewer3d/ruler-utils/scene3D.js +9 -13
- package/es/components/viewer3d/ruler-utils/state3D.js +4 -7
- package/es/components/viewer3d/scene-creator.js +197 -223
- package/es/components/viewer3d/three-memory-cleaner.js +3 -7
- package/es/components/viewer3d/viewer3d-first-person.js +42 -42
- package/es/components/viewer3d/viewer3d.js +200 -198
- package/es/constants.js +349 -354
- package/es/index.js +7 -11
- package/es/models.js +193 -191
- package/es/plugins/SVGLoader.js +48 -49
- package/es/plugins/autosave.js +3 -5
- package/es/plugins/console-debugger.js +6 -7
- package/es/plugins/export.js +8 -13
- package/es/plugins/keyboard.js +29 -31
- package/es/reducers/areas-reducer.js +7 -9
- package/es/reducers/export.js +24 -37
- package/es/reducers/groups-reducer.js +31 -33
- package/es/reducers/holes-reducer.js +43 -45
- package/es/reducers/items-reducer.js +106 -108
- package/es/reducers/lines-reducer.js +28 -30
- package/es/reducers/project-reducer.js +105 -107
- package/es/reducers/reducer.js +16 -19
- package/es/reducers/scene-reducer.js +15 -17
- package/es/reducers/user-reducer.js +5 -7
- package/es/reducers/vertices-reducer.js +11 -13
- package/es/reducers/viewer2d-reducer.js +18 -20
- package/es/reducers/viewer3d-reducer.js +16 -18
- package/es/shared-style.js +10 -12
- package/es/styles/export.js +3 -6
- package/es/translator/en.js +1 -3
- package/es/translator/it.js +1 -3
- package/es/translator/ru.js +1 -3
- package/es/translator/translator.js +13 -15
- package/es/utils/browser.js +2 -5
- package/es/utils/convert-units-lite.js +1 -3
- package/es/utils/email-validator.js +1 -3
- package/es/utils/export.js +15 -29
- package/es/utils/geometry.js +190 -280
- package/es/utils/get-edges-of-subgraphs.js +2 -5
- package/es/utils/graph-cycles.js +8 -7
- package/es/utils/graph-inner-cycles.js +10 -14
- package/es/utils/graph.js +9 -13
- package/es/utils/helper.js +41 -58
- package/es/utils/history.js +8 -11
- package/es/utils/id-broker.js +8 -11
- package/es/utils/logger.js +1 -3
- package/es/utils/math.js +5 -8
- package/es/utils/molding.js +130 -146
- package/es/utils/name-generator.js +7 -9
- package/es/utils/objects-utils.js +7 -14
- package/es/utils/phone-validator.js +1 -3
- package/es/utils/process-black-list.js +5 -6
- package/es/utils/react-if.js +7 -9
- package/es/utils/snap-scene.js +27 -30
- package/es/utils/snap.js +53 -57
- package/es/utils/summarizeCart.js +1 -3
- package/es/utils/threeCSG.es6.js +13 -17
- package/es/version.js +1 -3
- package/package.json +1 -1
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _convertUnitsLite = require("../../utils/convert-units-lite");
|
|
10
|
-
var _export = require("../../utils/export");
|
|
11
|
-
var _constants = require("../../constants");
|
|
12
|
-
var _utils = require("./utils");
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import RulerDist from "./rulerDist";
|
|
5
|
+
import { convert } from "../../utils/convert-units-lite";
|
|
6
|
+
import { GeometryUtils } from "../../utils/export";
|
|
7
|
+
import { MODE_ROTATING_ITEM, WALL_CABINET_LAYOUTPOS } from "../../constants";
|
|
8
|
+
import { returnReplaceableDeepSearchType } from "./utils";
|
|
13
9
|
var STYLE_LINE = {
|
|
14
10
|
fill: '#0096fd',
|
|
15
11
|
stroke: '#0096fd'
|
|
@@ -24,7 +20,7 @@ var STYLE_CIRCLE2 = {
|
|
|
24
20
|
stroke: '#0096fd',
|
|
25
21
|
cursor: 'ew-resize'
|
|
26
22
|
};
|
|
27
|
-
function Item(_ref, _ref2) {
|
|
23
|
+
export default function Item(_ref, _ref2) {
|
|
28
24
|
var layer = _ref.layer,
|
|
29
25
|
item = _ref.item,
|
|
30
26
|
scene = _ref.scene,
|
|
@@ -44,12 +40,12 @@ function Item(_ref, _ref2) {
|
|
|
44
40
|
var allLineRects;
|
|
45
41
|
var allItemRect;
|
|
46
42
|
var width, height;
|
|
47
|
-
var _useState =
|
|
48
|
-
_useState2 = (
|
|
43
|
+
var _useState = useState(false),
|
|
44
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
49
45
|
clockRotateState = _useState2[0],
|
|
50
46
|
setClockRotateState = _useState2[1];
|
|
51
|
-
var _useState3 =
|
|
52
|
-
_useState4 = (
|
|
47
|
+
var _useState3 = useState(false),
|
|
48
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
53
49
|
antiClockRotateState = _useState4[0],
|
|
54
50
|
setAntiClockRotateState = _useState4[1];
|
|
55
51
|
var val = {
|
|
@@ -62,11 +58,11 @@ function Item(_ref, _ref2) {
|
|
|
62
58
|
var tempWidth = item.properties.get('width');
|
|
63
59
|
var tempHeight = item.properties.get('depth');
|
|
64
60
|
if (tempWidth || tempHeight) {
|
|
65
|
-
width =
|
|
66
|
-
height =
|
|
61
|
+
width = convert(tempWidth.get('_length')).from(tempWidth.get('_unit')).to('cm');
|
|
62
|
+
height = convert(tempHeight.get('_length')).from(tempHeight.get('_unit')).to('cm');
|
|
67
63
|
} else {
|
|
68
|
-
width =
|
|
69
|
-
height =
|
|
64
|
+
width = convert(element.info.sizeinfo.width).from('in').to('cm');
|
|
65
|
+
height = convert(element.info.sizeinfo.depth).from('in').to('cm');
|
|
70
66
|
}
|
|
71
67
|
var angle = rotation + 90;
|
|
72
68
|
val.size = {
|
|
@@ -121,10 +117,10 @@ function Item(_ref, _ref2) {
|
|
|
121
117
|
selectedItem = layer.getIn(['items', layer.selected.items.get(0)]);
|
|
122
118
|
var catid = selectedItem.type;
|
|
123
119
|
var cat = catalog.elements[catid];
|
|
124
|
-
if (!cat) cat = catalog.elements[
|
|
120
|
+
if (!cat) cat = catalog.elements[returnReplaceableDeepSearchType(catid)];
|
|
125
121
|
if (cat === undefined || cat === null) {
|
|
126
122
|
cat = catalog.getIn(['elements', catid]);
|
|
127
|
-
if (!cat) cat = catalog.getIn(['elements',
|
|
123
|
+
if (!cat) cat = catalog.getIn(['elements', returnReplaceableDeepSearchType(catid)]);
|
|
128
124
|
}
|
|
129
125
|
currentItem = {
|
|
130
126
|
selectedItem: selectedItem,
|
|
@@ -141,9 +137,9 @@ function Item(_ref, _ref2) {
|
|
|
141
137
|
};
|
|
142
138
|
var catid = item.type;
|
|
143
139
|
var cat = catalog.elements[catid];
|
|
144
|
-
if (!cat) cat = catalog.elements[
|
|
145
|
-
var width =
|
|
146
|
-
var height =
|
|
140
|
+
if (!cat) cat = catalog.elements[returnReplaceableDeepSearchType(catid)];
|
|
141
|
+
var width = convert(item.properties.getIn(['width', '_length'])).from('in').to('cm');
|
|
142
|
+
var height = convert(item.properties.getIn(['depth', '_length'])).from('in').to('cm');
|
|
147
143
|
// let width = cat.info.sizeinfo.width;
|
|
148
144
|
// let height = cat.info.sizeinfo.depth;
|
|
149
145
|
val.size = {
|
|
@@ -234,8 +230,8 @@ function Item(_ref, _ref2) {
|
|
|
234
230
|
};
|
|
235
231
|
}
|
|
236
232
|
allItemRect = getAllItems();
|
|
237
|
-
allLines =
|
|
238
|
-
allLineRects =
|
|
233
|
+
allLines = GeometryUtils.getAllLines(layer);
|
|
234
|
+
allLineRects = GeometryUtils.buildRectFromLines(layer, allLines);
|
|
239
235
|
var allRect = allLineRects.concat(allItemRect.others);
|
|
240
236
|
curiteminfo = getCalcRectFromItem(val);
|
|
241
237
|
|
|
@@ -256,17 +252,17 @@ function Item(_ref, _ref2) {
|
|
|
256
252
|
var comparelength = [];
|
|
257
253
|
var a;
|
|
258
254
|
var RectLineFuction;
|
|
259
|
-
if (centerpoint[1] === 180 || centerpoint[1] === 0) RectLineFuction =
|
|
255
|
+
if (centerpoint[1] === 180 || centerpoint[1] === 0) RectLineFuction = GeometryUtils.linePassingThroughTwoPoints(centerpoint[0].x, centerpoint[0].y, center_x1, center_y1);else RectLineFuction = GeometryUtils.linePassingThroughTwoPoints(centerpoint[0].x, centerpoint[0].y, center_x, center_y);
|
|
260
256
|
allRect.forEach(function (linerect) {
|
|
261
|
-
var p0 =
|
|
262
|
-
var p1 =
|
|
257
|
+
var p0 = GeometryUtils.clone_point(linerect.rect[2]);
|
|
258
|
+
var p1 = GeometryUtils.clone_point(linerect.rect[3]);
|
|
263
259
|
var lineFunction = {};
|
|
264
|
-
if (p0.x !== p1.x || p0.y !== p1.y) lineFunction =
|
|
265
|
-
var coordinatePoint =
|
|
260
|
+
if (p0.x !== p1.x || p0.y !== p1.y) lineFunction = GeometryUtils.linePassingThroughTwoPoints(p0.x, p0.y, p1.x, p1.y);
|
|
261
|
+
var coordinatePoint = GeometryUtils.twoLinesIntersection(lineFunction.a, lineFunction.b, lineFunction.c, RectLineFuction.a, RectLineFuction.b, RectLineFuction.c);
|
|
266
262
|
if (coordinatePoint !== undefined) {
|
|
267
|
-
if (
|
|
268
|
-
if (
|
|
269
|
-
comparelength.push(
|
|
263
|
+
if (GeometryUtils.pointsDistance(p0.x, p0.y, p1.x, p1.y) > GeometryUtils.pointsDistance(p0.x, p0.y, coordinatePoint.x, coordinatePoint.y) && GeometryUtils.pointsDistance(p0.x, p0.y, p1.x, p1.y) > GeometryUtils.pointsDistance(p1.x, p1.y, coordinatePoint.x, coordinatePoint.y)) {
|
|
264
|
+
if (GeometryUtils.pointsDistance(coordinatePoint.x, coordinatePoint.y, center_x, center_y) > GeometryUtils.pointsDistance(centerpoint[0].x, centerpoint[0].y, coordinatePoint.x, coordinatePoint.y)) {
|
|
265
|
+
comparelength.push(GeometryUtils.pointsDistance(centerpoint[0].x, centerpoint[0].y, coordinatePoint.x, coordinatePoint.y));
|
|
270
266
|
a = Math.min.apply(null, comparelength);
|
|
271
267
|
}
|
|
272
268
|
}
|
|
@@ -292,7 +288,7 @@ function Item(_ref, _ref2) {
|
|
|
292
288
|
var itemDistanceFromLine = element[0];
|
|
293
289
|
var length = itemDistanceFromLine;
|
|
294
290
|
if (itemDistanceFromLine > ep || itemDistanceFromLine < -ep) {
|
|
295
|
-
renderedRuler.push(/*#__PURE__*/
|
|
291
|
+
renderedRuler.push(/*#__PURE__*/React.createElement("g", {
|
|
296
292
|
"data-element-root": true,
|
|
297
293
|
"data-prototype": "rulerDist",
|
|
298
294
|
"data-id": item.id,
|
|
@@ -301,7 +297,7 @@ function Item(_ref, _ref2) {
|
|
|
301
297
|
key: key,
|
|
302
298
|
"data-length": length,
|
|
303
299
|
"data-direct": element[1]
|
|
304
|
-
}, /*#__PURE__*/
|
|
300
|
+
}, /*#__PURE__*/React.createElement(RulerDist, {
|
|
305
301
|
key: key,
|
|
306
302
|
layer: layer,
|
|
307
303
|
unit: scene.unit,
|
|
@@ -322,7 +318,7 @@ function Item(_ref, _ref2) {
|
|
|
322
318
|
var newWidth = item.toJS().properties.width.length;
|
|
323
319
|
if (item.toJS().doorStyle.doorStyles && item.toJS().doorStyle.doorStyles.cds && item.toJS().doorStyle.doorStyles.cds.filter(function (cd) {
|
|
324
320
|
return cd.itemID == item.getIn(['itemID']);
|
|
325
|
-
}).length === 0 && item.category === 'cabinet') warning_buttons = /*#__PURE__*/
|
|
321
|
+
}).length === 0 && item.category === 'cabinet') warning_buttons = /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("g", {
|
|
326
322
|
id: "warning_info_2d",
|
|
327
323
|
style: {
|
|
328
324
|
transform: "translate(0px,20px)",
|
|
@@ -337,12 +333,12 @@ function Item(_ref, _ref2) {
|
|
|
337
333
|
onMouseLeave: function onMouseLeave() {
|
|
338
334
|
document.getElementById('warning_box_2d').style.display = 'none';
|
|
339
335
|
}
|
|
340
|
-
}, /*#__PURE__*/
|
|
336
|
+
}, /*#__PURE__*/React.createElement("circle", {
|
|
341
337
|
cx: 0,
|
|
342
338
|
cy: 0,
|
|
343
339
|
r: 8,
|
|
344
340
|
fill: "white"
|
|
345
|
-
}), /*#__PURE__*/
|
|
341
|
+
}), /*#__PURE__*/React.createElement("image", {
|
|
346
342
|
width: 15,
|
|
347
343
|
height: 15,
|
|
348
344
|
x: -7.5,
|
|
@@ -351,7 +347,7 @@ function Item(_ref, _ref2) {
|
|
|
351
347
|
transform: "rotate(".concat(180 - item.rotation, "deg)")
|
|
352
348
|
},
|
|
353
349
|
href: buttons[1].thumbnail
|
|
354
|
-
})), /*#__PURE__*/
|
|
350
|
+
})), /*#__PURE__*/React.createElement("g", {
|
|
355
351
|
style: {
|
|
356
352
|
cursor: 'pointer'
|
|
357
353
|
},
|
|
@@ -361,12 +357,12 @@ function Item(_ref, _ref2) {
|
|
|
361
357
|
"data-selected": item.selected,
|
|
362
358
|
"data-layer": layer.id,
|
|
363
359
|
"data-part": "warning_edit"
|
|
364
|
-
}, /*#__PURE__*/
|
|
360
|
+
}, /*#__PURE__*/React.createElement("circle", {
|
|
365
361
|
cx: 0,
|
|
366
362
|
cy: 0,
|
|
367
363
|
r: 8,
|
|
368
364
|
fill: "white"
|
|
369
|
-
}), /*#__PURE__*/
|
|
365
|
+
}), /*#__PURE__*/React.createElement("image", {
|
|
370
366
|
width: 15,
|
|
371
367
|
height: 15,
|
|
372
368
|
x: -7.5,
|
|
@@ -376,7 +372,7 @@ function Item(_ref, _ref2) {
|
|
|
376
372
|
},
|
|
377
373
|
href: buttons[0].thumbnail
|
|
378
374
|
})));
|
|
379
|
-
if (item.selected) parts = [/*#__PURE__*/
|
|
375
|
+
if (item.selected) parts = [/*#__PURE__*/React.createElement("g", {
|
|
380
376
|
key: 0,
|
|
381
377
|
"data-element-root": true,
|
|
382
378
|
"data-prototype": item.prototype,
|
|
@@ -387,7 +383,7 @@ function Item(_ref, _ref2) {
|
|
|
387
383
|
style: {
|
|
388
384
|
cursor: 'w-resize'
|
|
389
385
|
}
|
|
390
|
-
}, /*#__PURE__*/
|
|
386
|
+
}, /*#__PURE__*/React.createElement("image", {
|
|
391
387
|
href: clockRotateState ? '/assets/img/svg/rotate.png' : '/assets/img/svg/blank_div.svg',
|
|
392
388
|
style: {
|
|
393
389
|
transform: "scale(-1, -1) translate(".concat(width / 2, "px, ").concat(height / 2, "px) rotate(25deg)")
|
|
@@ -399,9 +395,9 @@ function Item(_ref, _ref2) {
|
|
|
399
395
|
setAntiClockRotateState(false);
|
|
400
396
|
},
|
|
401
397
|
onMouseLeave: function onMouseLeave() {
|
|
402
|
-
return setClockRotateState(mode ===
|
|
398
|
+
return setClockRotateState(mode === MODE_ROTATING_ITEM ? true : false);
|
|
403
399
|
}
|
|
404
|
-
}), /*#__PURE__*/
|
|
400
|
+
}), /*#__PURE__*/React.createElement("image", {
|
|
405
401
|
href: antiClockRotateState ? '/assets/img/svg/rotate.png' : '/assets/img/svg/blank_div.svg',
|
|
406
402
|
style: {
|
|
407
403
|
transform: "scale(1, -1) translate(".concat(width / 2, "px, ").concat(height / 2, "px) rotate(25deg)")
|
|
@@ -413,9 +409,9 @@ function Item(_ref, _ref2) {
|
|
|
413
409
|
setClockRotateState(false);
|
|
414
410
|
},
|
|
415
411
|
onMouseLeave: function onMouseLeave() {
|
|
416
|
-
return setAntiClockRotateState(mode ===
|
|
412
|
+
return setAntiClockRotateState(mode === MODE_ROTATING_ITEM ? true : false);
|
|
417
413
|
}
|
|
418
|
-
})), /*#__PURE__*/
|
|
414
|
+
})), /*#__PURE__*/React.createElement("g", {
|
|
419
415
|
key: 1
|
|
420
416
|
// transform={`translate(${-width / 2 - (!isSmall ? 40 : 0)},${height / 2 + 40})`}
|
|
421
417
|
,
|
|
@@ -429,20 +425,20 @@ function Item(_ref, _ref2) {
|
|
|
429
425
|
"data-selected": item.selected,
|
|
430
426
|
"data-layer": layer.id,
|
|
431
427
|
"data-part": "duplicate"
|
|
432
|
-
}, /*#__PURE__*/
|
|
428
|
+
}, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("filter", {
|
|
433
429
|
id: "shadow"
|
|
434
|
-
}, /*#__PURE__*/
|
|
430
|
+
}, /*#__PURE__*/React.createElement("feDropShadow", {
|
|
435
431
|
dx: "0",
|
|
436
432
|
dy: "0",
|
|
437
433
|
stdDeviation: "0.6"
|
|
438
|
-
}))), /*#__PURE__*/
|
|
434
|
+
}))), /*#__PURE__*/React.createElement("rect", {
|
|
439
435
|
rx: "4",
|
|
440
436
|
ry: "4",
|
|
441
437
|
height: "22",
|
|
442
438
|
width: "22",
|
|
443
439
|
fill: "white",
|
|
444
440
|
filter: "url(#shadow)"
|
|
445
|
-
}), /*#__PURE__*/
|
|
441
|
+
}), /*#__PURE__*/React.createElement("image", {
|
|
446
442
|
href: "/assets/img/svg/duplicate.svg",
|
|
447
443
|
x: "3",
|
|
448
444
|
y: "-19",
|
|
@@ -451,7 +447,7 @@ function Item(_ref, _ref2) {
|
|
|
451
447
|
style: {
|
|
452
448
|
transform: 'rotateX(180deg)'
|
|
453
449
|
}
|
|
454
|
-
})), /*#__PURE__*/
|
|
450
|
+
})), /*#__PURE__*/React.createElement("g", {
|
|
455
451
|
key: 2
|
|
456
452
|
// transform={`translate(${-width / 2 - (!isSmall ? 40 : 0)},${height / 2})`}
|
|
457
453
|
,
|
|
@@ -465,14 +461,14 @@ function Item(_ref, _ref2) {
|
|
|
465
461
|
"data-selected": item.selected,
|
|
466
462
|
"data-layer": layer.id,
|
|
467
463
|
"data-part": "remove"
|
|
468
|
-
}, /*#__PURE__*/
|
|
464
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
469
465
|
rx: "4",
|
|
470
466
|
ry: "4",
|
|
471
467
|
height: "22",
|
|
472
468
|
width: "22",
|
|
473
469
|
fill: "white",
|
|
474
470
|
filter: "url(#shadow)"
|
|
475
|
-
}), /*#__PURE__*/
|
|
471
|
+
}), /*#__PURE__*/React.createElement("image", {
|
|
476
472
|
href: "/assets/img/svg/delete.svg",
|
|
477
473
|
x: "3",
|
|
478
474
|
y: "-19",
|
|
@@ -482,8 +478,8 @@ function Item(_ref, _ref2) {
|
|
|
482
478
|
transform: 'rotateX(180deg)'
|
|
483
479
|
}
|
|
484
480
|
}))];
|
|
485
|
-
var measure = item.layoutpos ===
|
|
486
|
-
return /*#__PURE__*/
|
|
481
|
+
var measure = item.layoutpos === WALL_CABINET_LAYOUTPOS ? showWallCabinetMeasure : showBaseCabinetMeasure;
|
|
482
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
487
483
|
"data-element-root": true,
|
|
488
484
|
"data-prototype": item.prototype,
|
|
489
485
|
"data-id": item.id,
|
|
@@ -492,7 +488,7 @@ function Item(_ref, _ref2) {
|
|
|
492
488
|
style: item.selected ? {
|
|
493
489
|
cursor: 'move'
|
|
494
490
|
} : {}
|
|
495
|
-
}, renderedItem, /*#__PURE__*/
|
|
491
|
+
}, renderedItem, /*#__PURE__*/React.createElement("g", {
|
|
496
492
|
transform: "translate(".concat(x, ",").concat(y, ") rotate(").concat(rotation, ")"),
|
|
497
493
|
style: {
|
|
498
494
|
cursor: 'initial'
|
|
@@ -500,11 +496,11 @@ function Item(_ref, _ref2) {
|
|
|
500
496
|
}, measure ? renderedRuler : null, parts, warning_buttons));
|
|
501
497
|
}
|
|
502
498
|
Item.propTypes = {
|
|
503
|
-
item:
|
|
504
|
-
layer:
|
|
505
|
-
scene:
|
|
506
|
-
catalog:
|
|
499
|
+
item: PropTypes.object.isRequired,
|
|
500
|
+
layer: PropTypes.object.isRequired,
|
|
501
|
+
scene: PropTypes.object.isRequired,
|
|
502
|
+
catalog: PropTypes.object.isRequired
|
|
507
503
|
};
|
|
508
504
|
Item.contextTypes = {
|
|
509
|
-
itemsActions:
|
|
505
|
+
itemsActions: PropTypes.object.isRequired
|
|
510
506
|
};
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _export2 = require("../../utils/export");
|
|
8
|
-
var _constants = require("../../constants");
|
|
9
|
-
var _utils = require("./utils");
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { Line, Area, Vertex, Item, Group } from "./export";
|
|
4
|
+
import { GeometryUtils } from "../../utils/export";
|
|
5
|
+
import { MODE_DRAWING_LINE, WALL_CABINET_LAYOUTPOS } from "../../constants";
|
|
6
|
+
import { returnReplaceableDeepSearchType } from "./utils";
|
|
10
7
|
var STYLE = {
|
|
11
8
|
stroke: '#494949',
|
|
12
9
|
strokeWidth: 1,
|
|
@@ -29,7 +26,7 @@ var HINT_STYLE_TEXT = {
|
|
|
29
26
|
fontWeight: 'bold',
|
|
30
27
|
fill: '1a75ff'
|
|
31
28
|
};
|
|
32
|
-
function Layer(_ref) {
|
|
29
|
+
export default function Layer(_ref) {
|
|
33
30
|
var layer = _ref.layer,
|
|
34
31
|
scene = _ref.scene,
|
|
35
32
|
catalog = _ref.catalog,
|
|
@@ -47,8 +44,8 @@ function Layer(_ref) {
|
|
|
47
44
|
opacity = layer.opacity;
|
|
48
45
|
var allLines;
|
|
49
46
|
var allLineRects;
|
|
50
|
-
allLines =
|
|
51
|
-
allLineRects =
|
|
47
|
+
allLines = GeometryUtils.getAllLines(layer);
|
|
48
|
+
allLineRects = GeometryUtils.buildRectFromLines(layer, allLines);
|
|
52
49
|
var hintVertex = {
|
|
53
50
|
x: 0,
|
|
54
51
|
y: 0
|
|
@@ -79,7 +76,7 @@ function Layer(_ref) {
|
|
|
79
76
|
items.valueSeq().filter(function (a) {
|
|
80
77
|
return a.selected === true;
|
|
81
78
|
}).forEach(function (item) {
|
|
82
|
-
itemSelected.push(/*#__PURE__*/
|
|
79
|
+
itemSelected.push(/*#__PURE__*/React.createElement(Item, {
|
|
83
80
|
key: item.id,
|
|
84
81
|
layer: layer,
|
|
85
82
|
item: item,
|
|
@@ -89,8 +86,8 @@ function Layer(_ref) {
|
|
|
89
86
|
}));
|
|
90
87
|
});
|
|
91
88
|
items.valueSeq().forEach(function (item) {
|
|
92
|
-
if (item.layoutpos !==
|
|
93
|
-
if (catalog.elements.hasOwnProperty(item.type) || !catalog.elements[item.type] && !!catalog.elements[
|
|
89
|
+
if (item.layoutpos !== WALL_CABINET_LAYOUTPOS) {
|
|
90
|
+
if (catalog.elements.hasOwnProperty(item.type) || !catalog.elements[item.type] && !!catalog.elements[returnReplaceableDeepSearchType(item.type)]) itemData.push(/*#__PURE__*/React.createElement(Item, {
|
|
94
91
|
key: item.id,
|
|
95
92
|
layer: layer,
|
|
96
93
|
item: item,
|
|
@@ -104,8 +101,8 @@ function Layer(_ref) {
|
|
|
104
101
|
items.valueSeq().filter(function (a) {
|
|
105
102
|
return a.selected === false;
|
|
106
103
|
}).forEach(function (item) {
|
|
107
|
-
if (item.layoutpos ===
|
|
108
|
-
if (catalog.elements.hasOwnProperty(item.type) || !catalog.elements[item.type] && !!catalog.elements[
|
|
104
|
+
if (item.layoutpos === WALL_CABINET_LAYOUTPOS) {
|
|
105
|
+
if (catalog.elements.hasOwnProperty(item.type) || !catalog.elements[item.type] && !!catalog.elements[returnReplaceableDeepSearchType(item.type)]) itemWall.push(/*#__PURE__*/React.createElement(Item, {
|
|
109
106
|
key: item.id,
|
|
110
107
|
layer: layer,
|
|
111
108
|
item: item,
|
|
@@ -120,7 +117,7 @@ function Layer(_ref) {
|
|
|
120
117
|
lines.sort(function compare(a, b) {
|
|
121
118
|
return a.createdDateTime - b.createdDateTime;
|
|
122
119
|
}).valueSeq().forEach(function (line) {
|
|
123
|
-
lineData.push(/*#__PURE__*/
|
|
120
|
+
lineData.push(/*#__PURE__*/React.createElement(Line, {
|
|
124
121
|
key: line.id,
|
|
125
122
|
layer: layer,
|
|
126
123
|
line: line,
|
|
@@ -130,20 +127,20 @@ function Layer(_ref) {
|
|
|
130
127
|
relatedLines: relatedLines
|
|
131
128
|
}));
|
|
132
129
|
});
|
|
133
|
-
return /*#__PURE__*/
|
|
130
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
134
131
|
opacity: opacity
|
|
135
132
|
}, areas.valueSeq().map(function (area) {
|
|
136
|
-
return /*#__PURE__*/
|
|
133
|
+
return /*#__PURE__*/React.createElement(Area, {
|
|
137
134
|
key: area.id,
|
|
138
135
|
layer: layer,
|
|
139
136
|
area: area,
|
|
140
137
|
unit: unit,
|
|
141
138
|
catalog: catalog
|
|
142
139
|
});
|
|
143
|
-
}), lineData, itemData, itemWall, itemSelected, mode !==
|
|
140
|
+
}), lineData, itemData, itemWall, itemSelected, mode !== MODE_DRAWING_LINE && vertices.valueSeq().filter(function (v) {
|
|
144
141
|
return v.selected;
|
|
145
142
|
}).map(function (vertex) {
|
|
146
|
-
return /*#__PURE__*/
|
|
143
|
+
return /*#__PURE__*/React.createElement(Vertex, {
|
|
147
144
|
key: vertex.id,
|
|
148
145
|
layer: layer,
|
|
149
146
|
vertex: vertex
|
|
@@ -151,7 +148,7 @@ function Layer(_ref) {
|
|
|
151
148
|
}), groups.valueSeq().filter(function (g) {
|
|
152
149
|
return g.hasIn(['elements', layerID]) && g.get('selected');
|
|
153
150
|
}).map(function (group) {
|
|
154
|
-
return /*#__PURE__*/
|
|
151
|
+
return /*#__PURE__*/React.createElement(Group, {
|
|
155
152
|
key: group.get('id'),
|
|
156
153
|
layer: layer,
|
|
157
154
|
group: group,
|
|
@@ -161,7 +158,7 @@ function Layer(_ref) {
|
|
|
161
158
|
}));
|
|
162
159
|
}
|
|
163
160
|
Layer.propTypes = {
|
|
164
|
-
layer:
|
|
165
|
-
scene:
|
|
166
|
-
catalog:
|
|
161
|
+
layer: PropTypes.object.isRequired,
|
|
162
|
+
scene: PropTypes.object.isRequired,
|
|
163
|
+
catalog: PropTypes.object.isRequired
|
|
167
164
|
};
|