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