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