kitchen-simulator 11.0.0-react-18 → 11.0.0
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/LiteKitchenConfigurator.js +42 -11
- package/es/LiteRenderer.js +2 -24
- package/es/actions/export.js +25 -12
- package/es/analytics/ga4.js +188 -0
- package/es/catalog/utils/item-loader.js +4 -4
- package/es/class/item.js +29 -7
- package/es/class/line.js +1 -3
- package/es/components/content.js +20 -5
- package/es/components/export.js +6 -4
- package/es/components/style/form-number-input.js +7 -5
- package/es/components/style/form-submit-button.js +25 -0
- package/es/components/viewer2d/group.js +6 -5
- package/es/components/viewer2d/item.js +9 -9
- package/es/components/viewer2d/line.js +18 -47
- package/es/components/viewer2d/rulerX.js +9 -8
- package/es/components/viewer2d/rulerY.js +9 -8
- package/es/components/viewer2d/scene.js +9 -9
- package/es/components/viewer2d/state.js +1 -1
- package/es/components/viewer2d/utils.js +0 -6
- package/es/components/viewer2d/viewer2d.js +35 -31
- package/es/components/viewer3d/ruler-utils/layer3D.js +2 -2
- package/es/components/viewer3d/scene-creator.js +40 -75
- package/es/components/viewer3d/viewer3d-first-person.js +13 -8
- package/es/components/viewer3d/viewer3d.js +19 -15
- package/es/devLiteRenderer.js +913 -0
- package/es/events/external/handleExternalEvent.js +1 -0
- package/es/events/external/handleExternalEvent.util.js +330 -347
- package/es/events/external/handlers.changeDoorStyle.js +5 -3
- package/es/events/external/handlers.loadProject.js +5 -3
- package/es/events/external/handlers.syncScene.js +1 -1
- package/es/mappings/external-events/mappers/ccdfMapper.js +14 -8
- package/es/shared/domain/cabinet-warning.js +15 -0
- package/es/utils/geometry.js +4 -7
- package/es/utils/helper.js +81 -22
- package/es/utils/skinPanelEngine.js +5 -9
- package/lib/LiteKitchenConfigurator.js +42 -11
- package/lib/LiteRenderer.js +3 -25
- package/lib/actions/export.js +35 -39
- package/lib/analytics/ga4.js +194 -0
- package/lib/catalog/utils/item-loader.js +3 -3
- package/lib/class/item.js +29 -7
- package/lib/class/line.js +1 -3
- package/lib/components/content.js +19 -4
- package/lib/components/export.js +6 -16
- package/lib/components/style/form-number-input.js +7 -5
- package/lib/components/style/form-submit-button.js +35 -0
- package/lib/components/viewer2d/group.js +6 -5
- package/lib/components/viewer2d/item.js +8 -8
- package/lib/components/viewer2d/line.js +18 -47
- package/lib/components/viewer2d/rulerX.js +9 -8
- package/lib/components/viewer2d/rulerY.js +9 -8
- package/lib/components/viewer2d/scene.js +9 -9
- package/lib/components/viewer2d/state.js +1 -1
- package/lib/components/viewer2d/utils.js +0 -7
- package/lib/components/viewer2d/viewer2d.js +33 -29
- package/lib/components/viewer3d/ruler-utils/layer3D.js +2 -2
- package/lib/components/viewer3d/scene-creator.js +39 -75
- package/lib/components/viewer3d/viewer3d-first-person.js +13 -8
- package/lib/components/viewer3d/viewer3d.js +19 -15
- package/lib/devLiteRenderer.js +917 -0
- package/lib/events/external/handleExternalEvent.js +1 -0
- package/lib/events/external/handleExternalEvent.util.js +330 -347
- package/lib/events/external/handlers.changeDoorStyle.js +5 -3
- package/lib/events/external/handlers.loadProject.js +5 -3
- package/lib/events/external/handlers.syncScene.js +1 -1
- package/lib/mappings/external-events/mappers/ccdfMapper.js +14 -8
- package/lib/shared/domain/cabinet-warning.js +20 -0
- package/lib/utils/geometry.js +4 -7
- package/lib/utils/helper.js +82 -24
- package/lib/utils/skinPanelEngine.js +4 -8
- package/package.json +21 -6
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import AppContext from "../../AppContext";
|
|
5
4
|
import RulerDist from "./rulerDist";
|
|
6
5
|
import { convert } from "../../utils/convert-units-lite";
|
|
7
|
-
import { GeometryUtils } from "../../utils/export";
|
|
8
6
|
import { MODE_ROTATING_ITEM, WALL_CABINET_LAYOUTPOS } from "../../constants";
|
|
9
|
-
import {
|
|
7
|
+
import { isWarningCabinet } from "../../shared/domain/cabinet-warning";
|
|
10
8
|
import { calcDistancesFromItemToWalls, findCatalogElement } from "../../utils/geometry";
|
|
11
9
|
var STYLE_LINE = {
|
|
12
10
|
fill: '#0096fd',
|
|
@@ -22,15 +20,14 @@ var STYLE_CIRCLE2 = {
|
|
|
22
20
|
stroke: '#0096fd',
|
|
23
21
|
cursor: 'ew-resize'
|
|
24
22
|
};
|
|
25
|
-
export default function Item(_ref) {
|
|
23
|
+
export default function Item(_ref, _ref2) {
|
|
26
24
|
var _element$render2D;
|
|
27
25
|
var layer = _ref.layer,
|
|
28
26
|
item = _ref.item,
|
|
29
27
|
scene = _ref.scene,
|
|
30
28
|
catalog = _ref.catalog,
|
|
31
29
|
mode = _ref.mode;
|
|
32
|
-
var
|
|
33
|
-
itemsActions = _useContext.itemsActions;
|
|
30
|
+
var itemsActions = _ref2.itemsActions;
|
|
34
31
|
var _useState = useState(false),
|
|
35
32
|
_useState2 = _slicedToArray(_useState, 2),
|
|
36
33
|
clockRotateState = _useState2[0],
|
|
@@ -90,7 +87,7 @@ export default function Item(_ref) {
|
|
|
90
87
|
length: itemDistanceFromLine,
|
|
91
88
|
angle: rotation,
|
|
92
89
|
rotation: element[1],
|
|
93
|
-
transform: "translate(".concat(element[1] === 180 ? -nw : element[1] === 0 ? nw : 0, ", ").concat(element[1] === 90 ? nh : element[1] === -90 ?
|
|
90
|
+
transform: "translate(".concat(element[1] === 180 ? -nw : element[1] === 0 ? nw : 0, ", ").concat(element[1] === 90 ? nh : element[1] === -90 ? (item === null || item === void 0 ? void 0 : item.is_corner) !== 1 ? -(nh + 4) : -nh : 0, ") rotate(").concat(element[1], ", 0, 0)")
|
|
94
91
|
})));
|
|
95
92
|
}
|
|
96
93
|
});
|
|
@@ -172,7 +169,7 @@ export default function Item(_ref) {
|
|
|
172
169
|
y: "-19",
|
|
173
170
|
height: "16",
|
|
174
171
|
width: "16",
|
|
175
|
-
style:
|
|
172
|
+
style: isWarningCabinet(item) ? {
|
|
176
173
|
transform: 'rotateX(180deg)',
|
|
177
174
|
opacity: 0.5
|
|
178
175
|
} : {
|
|
@@ -231,4 +228,7 @@ Item.propTypes = {
|
|
|
231
228
|
layer: PropTypes.object.isRequired,
|
|
232
229
|
scene: PropTypes.object.isRequired,
|
|
233
230
|
catalog: PropTypes.object.isRequired
|
|
231
|
+
};
|
|
232
|
+
Item.contextTypes = {
|
|
233
|
+
itemsActions: PropTypes.object.isRequired
|
|
234
234
|
};
|
|
@@ -247,13 +247,11 @@ export default function Line(_ref) {
|
|
|
247
247
|
if (!showWallCabinetMeasure || wall_posArray.length <= 2) {
|
|
248
248
|
wallSpace = 0;
|
|
249
249
|
}
|
|
250
|
-
wallRuler = wall_posAndwidth.map(function (pAw
|
|
250
|
+
wallRuler = wall_posAndwidth.map(function (pAw) {
|
|
251
251
|
if (pAw.length > 1) {
|
|
252
252
|
if (Math.sin(angle) === 0 || GeometryUtils.almostEqual(y1, y2)) {
|
|
253
253
|
if (x1 - x2 > 0) {
|
|
254
|
-
return /*#__PURE__*/React.createElement("g", {
|
|
255
|
-
key: "wall_".concat(pAwIdx)
|
|
256
|
-
}, /*#__PURE__*/React.createElement("line", {
|
|
254
|
+
return /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("line", {
|
|
257
255
|
x1: pAw.pos.x + pAw.length,
|
|
258
256
|
y1: pAw.pos.y,
|
|
259
257
|
x2: pAw.pos.x + pAw.length,
|
|
@@ -275,9 +273,7 @@ export default function Line(_ref) {
|
|
|
275
273
|
style: STYLE_DASH
|
|
276
274
|
}));
|
|
277
275
|
} else {
|
|
278
|
-
return /*#__PURE__*/React.createElement("g", {
|
|
279
|
-
key: "wall_".concat(pAwIdx)
|
|
280
|
-
}, /*#__PURE__*/React.createElement("line", {
|
|
276
|
+
return /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("line", {
|
|
281
277
|
x1: pAw.pos.x + pAw.length,
|
|
282
278
|
y1: pAw.pos.y,
|
|
283
279
|
x2: pAw.pos.x + pAw.length,
|
|
@@ -302,9 +298,7 @@ export default function Line(_ref) {
|
|
|
302
298
|
} else {
|
|
303
299
|
if (y1 - y2 > 0) {
|
|
304
300
|
if (x1 - x2 < 0 || GeometryUtils.almostEqual(x1, x2)) {
|
|
305
|
-
return /*#__PURE__*/React.createElement("g", {
|
|
306
|
-
key: "wall_".concat(pAwIdx)
|
|
307
|
-
}, /*#__PURE__*/React.createElement("line", {
|
|
301
|
+
return /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("line", {
|
|
308
302
|
x1: pAw.pos.x - pAw.length * Math.cos(angle / 180 * Math.PI),
|
|
309
303
|
y1: pAw.pos.y - pAw.length * Math.sin(angle / 180 * Math.PI),
|
|
310
304
|
x2: pAw.pos.x - pAw.length * Math.cos(angle / 180 * Math.PI) - (thickness / 2 + wallSpace) * Math.sin(angle / 180 * Math.PI),
|
|
@@ -326,9 +320,7 @@ export default function Line(_ref) {
|
|
|
326
320
|
style: STYLE_DASH
|
|
327
321
|
}));
|
|
328
322
|
} else {
|
|
329
|
-
return /*#__PURE__*/React.createElement("g", {
|
|
330
|
-
key: "wall_".concat(pAwIdx)
|
|
331
|
-
}, /*#__PURE__*/React.createElement("line", {
|
|
323
|
+
return /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("line", {
|
|
332
324
|
x1: pAw.pos.x,
|
|
333
325
|
y1: pAw.pos.y,
|
|
334
326
|
x2: pAw.pos.x - (thickness / 2 + wallSpace) * Math.sin(angle / 180 * Math.PI),
|
|
@@ -352,9 +344,7 @@ export default function Line(_ref) {
|
|
|
352
344
|
}
|
|
353
345
|
} else {
|
|
354
346
|
if (x1 - x2 < 0 || GeometryUtils.almostEqual(x1, x2)) {
|
|
355
|
-
return /*#__PURE__*/React.createElement("g", {
|
|
356
|
-
key: "wall_".concat(pAwIdx)
|
|
357
|
-
}, /*#__PURE__*/React.createElement("line", {
|
|
347
|
+
return /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("line", {
|
|
358
348
|
x1: pAw.pos.x,
|
|
359
349
|
y1: pAw.pos.y,
|
|
360
350
|
x2: pAw.pos.x - (thickness / 2 + wallSpace) * Math.sin(angle / 180 * Math.PI),
|
|
@@ -376,9 +366,7 @@ export default function Line(_ref) {
|
|
|
376
366
|
style: STYLE_DASH
|
|
377
367
|
}));
|
|
378
368
|
} else {
|
|
379
|
-
return /*#__PURE__*/React.createElement("g", {
|
|
380
|
-
key: "wall_".concat(pAwIdx)
|
|
381
|
-
}, /*#__PURE__*/React.createElement("line", {
|
|
369
|
+
return /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("line", {
|
|
382
370
|
x1: pAw.pos.x + pAw.length * Math.cos(angle / 180 * Math.PI),
|
|
383
371
|
y1: pAw.pos.y + pAw.length * Math.sin(angle / 180 * Math.PI),
|
|
384
372
|
x2: pAw.pos.x + pAw.length * Math.cos(angle / 180 * Math.PI) - (thickness / 2 + wallSpace) * Math.sin(angle / 180 * Math.PI),
|
|
@@ -471,13 +459,11 @@ export default function Line(_ref) {
|
|
|
471
459
|
if (!showBaseCabinetMeasure || base_posArray.length <= 2) {
|
|
472
460
|
baseSpace -= STEP;
|
|
473
461
|
}
|
|
474
|
-
baseRuler = base_posAndwidth.map(function (pAw
|
|
462
|
+
baseRuler = base_posAndwidth.map(function (pAw) {
|
|
475
463
|
if (pAw.length > 1) {
|
|
476
464
|
if (Math.sin(angle) === 0 || GeometryUtils.almostEqual(y1, y2)) {
|
|
477
465
|
if (x1 - x2 > 0) {
|
|
478
|
-
return /*#__PURE__*/React.createElement("g", {
|
|
479
|
-
key: "base_".concat(pAwIdx)
|
|
480
|
-
}, /*#__PURE__*/React.createElement("line", {
|
|
466
|
+
return /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("line", {
|
|
481
467
|
x1: pAw.pos.x + pAw.length,
|
|
482
468
|
y1: pAw.pos.y,
|
|
483
469
|
x2: pAw.pos.x + pAw.length,
|
|
@@ -499,9 +485,7 @@ export default function Line(_ref) {
|
|
|
499
485
|
style: STYLE_DASH
|
|
500
486
|
}));
|
|
501
487
|
} else {
|
|
502
|
-
return /*#__PURE__*/React.createElement("g", {
|
|
503
|
-
key: "base_".concat(pAwIdx)
|
|
504
|
-
}, /*#__PURE__*/React.createElement("line", {
|
|
488
|
+
return /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("line", {
|
|
505
489
|
x1: pAw.pos.x + pAw.length,
|
|
506
490
|
y1: pAw.pos.y,
|
|
507
491
|
x2: pAw.pos.x + pAw.length,
|
|
@@ -526,9 +510,7 @@ export default function Line(_ref) {
|
|
|
526
510
|
} else {
|
|
527
511
|
if (y1 - y2 > 0) {
|
|
528
512
|
if (x1 - x2 < 0 || GeometryUtils.almostEqual(x1, x2)) {
|
|
529
|
-
return /*#__PURE__*/React.createElement("g", {
|
|
530
|
-
key: "base_".concat(pAwIdx)
|
|
531
|
-
}, /*#__PURE__*/React.createElement("line", {
|
|
513
|
+
return /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("line", {
|
|
532
514
|
x1: pAw.pos.x - pAw.length * Math.cos(angle / 180 * Math.PI),
|
|
533
515
|
y1: pAw.pos.y - pAw.length * Math.sin(angle / 180 * Math.PI),
|
|
534
516
|
x2: pAw.pos.x - pAw.length * Math.cos(angle / 180 * Math.PI) - (thickness / 2 + baseSpace) * Math.sin(angle / 180 * Math.PI),
|
|
@@ -550,9 +532,7 @@ export default function Line(_ref) {
|
|
|
550
532
|
style: STYLE_DASH
|
|
551
533
|
}));
|
|
552
534
|
} else {
|
|
553
|
-
return /*#__PURE__*/React.createElement("g", {
|
|
554
|
-
key: "base_".concat(pAwIdx)
|
|
555
|
-
}, /*#__PURE__*/React.createElement("line", {
|
|
535
|
+
return /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("line", {
|
|
556
536
|
x1: pAw.pos.x,
|
|
557
537
|
y1: pAw.pos.y,
|
|
558
538
|
x2: pAw.pos.x - (thickness / 2 + baseSpace) * Math.sin(angle / 180 * Math.PI),
|
|
@@ -576,9 +556,7 @@ export default function Line(_ref) {
|
|
|
576
556
|
}
|
|
577
557
|
} else {
|
|
578
558
|
if (x1 - x2 < 0 || GeometryUtils.almostEqual(x1, x2)) {
|
|
579
|
-
return /*#__PURE__*/React.createElement("g", {
|
|
580
|
-
key: "base_".concat(pAwIdx)
|
|
581
|
-
}, /*#__PURE__*/React.createElement("line", {
|
|
559
|
+
return /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("line", {
|
|
582
560
|
x1: pAw.pos.x,
|
|
583
561
|
y1: pAw.pos.y,
|
|
584
562
|
x2: pAw.pos.x - (thickness / 2 + baseSpace) * Math.sin(angle / 180 * Math.PI),
|
|
@@ -600,9 +578,7 @@ export default function Line(_ref) {
|
|
|
600
578
|
style: STYLE_DASH
|
|
601
579
|
}));
|
|
602
580
|
} else {
|
|
603
|
-
return /*#__PURE__*/React.createElement("g", {
|
|
604
|
-
key: "base_".concat(pAwIdx)
|
|
605
|
-
}, /*#__PURE__*/React.createElement("line", {
|
|
581
|
+
return /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("line", {
|
|
606
582
|
x1: pAw.pos.x + pAw.length * Math.cos(angle / 180 * Math.PI),
|
|
607
583
|
y1: pAw.pos.y + pAw.length * Math.sin(angle / 180 * Math.PI),
|
|
608
584
|
x2: pAw.pos.x + pAw.length * Math.cos(angle / 180 * Math.PI) - (thickness / 2 + baseSpace) * Math.sin(angle / 180 * Math.PI),
|
|
@@ -676,15 +652,14 @@ export default function Line(_ref) {
|
|
|
676
652
|
//the space from the dimensioning line to the bottom
|
|
677
653
|
var lineSpacedimension2 = 14;
|
|
678
654
|
if (compareVertices(vertex0, vertex1) >= 0 && vertex0.x !== vertex1.x) {
|
|
679
|
-
renderedRuler.push(/*#__PURE__*/React.createElement("g", {
|
|
680
|
-
key: "ruler-a"
|
|
681
|
-
}, /*#__PURE__*/React.createElement("line", {
|
|
655
|
+
renderedRuler.push(/*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("line", {
|
|
682
656
|
x1: length,
|
|
683
657
|
y1: lineSpace + lineSpacedimension1,
|
|
684
658
|
x2: length,
|
|
685
659
|
y2: lineSpace + lineSpacedimension2,
|
|
686
660
|
style: STYLE_ROOM_SHAPE
|
|
687
661
|
}), /*#__PURE__*/React.createElement(Ruler, {
|
|
662
|
+
key: 0,
|
|
688
663
|
layer: layer,
|
|
689
664
|
unit: scene.unit,
|
|
690
665
|
rulerUnit: scene.rulerUnit,
|
|
@@ -699,15 +674,14 @@ export default function Line(_ref) {
|
|
|
699
674
|
style: STYLE_ROOM_SHAPE
|
|
700
675
|
})));
|
|
701
676
|
} else {
|
|
702
|
-
renderedRuler.push(/*#__PURE__*/React.createElement("g", {
|
|
703
|
-
key: "ruler-b"
|
|
704
|
-
}, /*#__PURE__*/React.createElement("line", {
|
|
677
|
+
renderedRuler.push(/*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("line", {
|
|
705
678
|
x1: 0,
|
|
706
679
|
y1: lineSpace + lineSpacedimension1,
|
|
707
680
|
x2: 0,
|
|
708
681
|
y2: lineSpace + lineSpacedimension2,
|
|
709
682
|
style: STYLE_ROOM_SHAPE
|
|
710
683
|
}), /*#__PURE__*/React.createElement(Ruler, {
|
|
684
|
+
key: 0,
|
|
711
685
|
layer: layer,
|
|
712
686
|
unit: scene.unit,
|
|
713
687
|
rulerUnit: scene.rulerUnit,
|
|
@@ -749,7 +723,6 @@ export default function Line(_ref) {
|
|
|
749
723
|
}
|
|
750
724
|
if (compareVertices(vertex0, vertex1) >= 0 && vertex0.x !== vertex1.x) {
|
|
751
725
|
renderedAllRuler.push(/*#__PURE__*/React.createElement("g", {
|
|
752
|
-
key: "allRuler_a_".concat(index),
|
|
753
726
|
transform: "translate(".concat(x1, ", ").concat(y1, ") rotate(").concat(angle, ", 0, 0)")
|
|
754
727
|
}, /*#__PURE__*/React.createElement("line", {
|
|
755
728
|
x1: allRuler[index],
|
|
@@ -774,7 +747,6 @@ export default function Line(_ref) {
|
|
|
774
747
|
})));
|
|
775
748
|
} else {
|
|
776
749
|
renderedAllRuler.push(/*#__PURE__*/React.createElement("g", {
|
|
777
|
-
key: "allRuler_b_".concat(index),
|
|
778
750
|
transform: "translate(".concat(x1, ", ").concat(y1, ") rotate(").concat(angle, ", 0, 0)")
|
|
779
751
|
}, /*#__PURE__*/React.createElement("line", {
|
|
780
752
|
x1: allRuler[index],
|
|
@@ -874,7 +846,6 @@ export default function Line(_ref) {
|
|
|
874
846
|
|
|
875
847
|
// Angle SVG Path
|
|
876
848
|
lines.push(/*#__PURE__*/React.createElement("path", {
|
|
877
|
-
key: "angle-path-".concat(index),
|
|
878
849
|
style: STYLE_ANGLE,
|
|
879
850
|
d: "\n M ".concat(vertex[0].x, ",").concat(vertex[0].y, " L ").concat(pos1.x, ",").concat(pos1.y, " A ").concat(minLineLength, " ").concat(minLineLength, " ").concat(angle, " 0 ").concat(t > 0 ? 1 : 0, " ").concat(pos2.x, ",").concat(pos2.y, " z\n ")
|
|
880
851
|
}));
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
4
5
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
5
6
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
7
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
8
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
9
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
11
|
import React, { Component } from 'react';
|
|
12
12
|
import PropTypes from 'prop-types';
|
|
13
|
-
import AppContext from "../../AppContext";
|
|
14
13
|
import * as SharedStyle from "../../shared-style";
|
|
15
14
|
var RulerX = /*#__PURE__*/function (_Component) {
|
|
16
15
|
function RulerX(props, context) {
|
|
@@ -46,7 +45,7 @@ var RulerX = /*#__PURE__*/function (_Component) {
|
|
|
46
45
|
};
|
|
47
46
|
var markerStyle = {
|
|
48
47
|
position: 'absolute',
|
|
49
|
-
left:
|
|
48
|
+
left: this.props.zeroLeftPosition + this.props.mouseX * this.props.zoom - 6.5,
|
|
50
49
|
top: 8,
|
|
51
50
|
width: 0,
|
|
52
51
|
height: 0,
|
|
@@ -66,12 +65,12 @@ var RulerX = /*#__PURE__*/function (_Component) {
|
|
|
66
65
|
grdAutoColumns: "".concat(elementW, "px")
|
|
67
66
|
};
|
|
68
67
|
var positiveRulerContainer = _objectSpread(_objectSpread({}, rulerContainer), {}, {
|
|
69
|
-
width:
|
|
70
|
-
left: this.props.zeroLeftPosition
|
|
68
|
+
width: this.props.positiveUnitsNumber * elementW,
|
|
69
|
+
left: this.props.zeroLeftPosition
|
|
71
70
|
});
|
|
72
71
|
var negativeRulerContainer = _objectSpread(_objectSpread({}, rulerContainer), {}, {
|
|
73
|
-
width:
|
|
74
|
-
left:
|
|
72
|
+
width: this.props.negativeUnitsNumber * elementW,
|
|
73
|
+
left: this.props.zeroLeftPosition - this.props.negativeUnitsNumber * elementW
|
|
75
74
|
});
|
|
76
75
|
var positiveDomElements = [];
|
|
77
76
|
if (elementW <= 200) {
|
|
@@ -121,7 +120,6 @@ var RulerX = /*#__PURE__*/function (_Component) {
|
|
|
121
120
|
}
|
|
122
121
|
}]);
|
|
123
122
|
}(Component);
|
|
124
|
-
_defineProperty(RulerX, "contextType", AppContext);
|
|
125
123
|
export { RulerX as default };
|
|
126
124
|
RulerX.propTypes = {
|
|
127
125
|
unitPixelSize: PropTypes.number.isRequired,
|
|
@@ -141,4 +139,7 @@ RulerX.defaultProps = {
|
|
|
141
139
|
backgroundColor: SharedStyle.PRIMARY_COLOR.main,
|
|
142
140
|
fontColor: SharedStyle.COLORS.white,
|
|
143
141
|
markerColor: SharedStyle.SECONDARY_COLOR.main
|
|
142
|
+
};
|
|
143
|
+
RulerX.contextTypes = {
|
|
144
|
+
translator: PropTypes.object.isRequired
|
|
144
145
|
};
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
4
5
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
5
6
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
7
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
8
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
9
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
11
|
import React, { Component } from 'react';
|
|
12
12
|
import PropTypes from 'prop-types';
|
|
13
|
-
import AppContext from "../../AppContext";
|
|
14
13
|
import * as SharedStyle from "../../shared-style";
|
|
15
14
|
var RulerY = /*#__PURE__*/function (_Component) {
|
|
16
15
|
function RulerY(props, context) {
|
|
@@ -50,7 +49,7 @@ var RulerY = /*#__PURE__*/function (_Component) {
|
|
|
50
49
|
};
|
|
51
50
|
var markerStyle = {
|
|
52
51
|
position: 'absolute',
|
|
53
|
-
top:
|
|
52
|
+
top: this.props.zeroTopPosition - this.props.mouseY * this.props.zoom - 6.5,
|
|
54
53
|
left: 8,
|
|
55
54
|
width: 0,
|
|
56
55
|
height: 0,
|
|
@@ -70,12 +69,12 @@ var RulerY = /*#__PURE__*/function (_Component) {
|
|
|
70
69
|
paddingLeft: '5px'
|
|
71
70
|
};
|
|
72
71
|
var positiveRulerContainer = _objectSpread(_objectSpread({}, rulerContainer), {}, {
|
|
73
|
-
top:
|
|
74
|
-
height:
|
|
72
|
+
top: this.props.zeroTopPosition - this.props.positiveUnitsNumber * elementH,
|
|
73
|
+
height: this.props.positiveUnitsNumber * elementH
|
|
75
74
|
});
|
|
76
75
|
var negativeRulerContainer = _objectSpread(_objectSpread({}, rulerContainer), {}, {
|
|
77
|
-
top:
|
|
78
|
-
height:
|
|
76
|
+
top: this.props.zeroTopPosition + this.props.negativeUnitsNumber * elementH,
|
|
77
|
+
height: this.props.negativeUnitsNumber * elementH
|
|
79
78
|
});
|
|
80
79
|
var positiveDomElements = [];
|
|
81
80
|
if (elementH <= 200) {
|
|
@@ -125,7 +124,6 @@ var RulerY = /*#__PURE__*/function (_Component) {
|
|
|
125
124
|
}
|
|
126
125
|
}]);
|
|
127
126
|
}(Component);
|
|
128
|
-
_defineProperty(RulerY, "contextType", AppContext);
|
|
129
127
|
export { RulerY as default };
|
|
130
128
|
RulerY.propTypes = {
|
|
131
129
|
unitPixelSize: PropTypes.number.isRequired,
|
|
@@ -143,4 +141,7 @@ RulerY.defaultProps = {
|
|
|
143
141
|
backgroundColor: SharedStyle.PRIMARY_COLOR.main,
|
|
144
142
|
fontColor: SharedStyle.COLORS.white,
|
|
145
143
|
markerColor: SharedStyle.SECONDARY_COLOR.main
|
|
144
|
+
};
|
|
145
|
+
RulerY.contextTypes = {
|
|
146
|
+
translator: PropTypes.object.isRequired
|
|
146
147
|
};
|
|
@@ -5,13 +5,11 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
7
7
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
8
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
8
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
9
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
11
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
12
11
|
import React, { Component } from 'react';
|
|
13
12
|
import PropTypes from 'prop-types';
|
|
14
|
-
import AppContext from "../../AppContext";
|
|
15
13
|
import { Layer, Grids } from "./export";
|
|
16
14
|
import { searchForSkuValue } from "./utils";
|
|
17
15
|
var Scene = /*#__PURE__*/function (_Component) {
|
|
@@ -21,9 +19,9 @@ var Scene = /*#__PURE__*/function (_Component) {
|
|
|
21
19
|
}
|
|
22
20
|
_inherits(Scene, _Component);
|
|
23
21
|
return _createClass(Scene, [{
|
|
24
|
-
key: "
|
|
22
|
+
key: "componentWillReceiveProps",
|
|
25
23
|
value: function () {
|
|
26
|
-
var
|
|
24
|
+
var _componentWillReceiveProps = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(nextProps) {
|
|
27
25
|
var scene, catalog, height, layers, selectedLayer, msg, isNotFoundInElements, itemType;
|
|
28
26
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
29
27
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -62,10 +60,10 @@ var Scene = /*#__PURE__*/function (_Component) {
|
|
|
62
60
|
}
|
|
63
61
|
}, _callee, this);
|
|
64
62
|
}));
|
|
65
|
-
function
|
|
66
|
-
return
|
|
63
|
+
function componentWillReceiveProps(_x) {
|
|
64
|
+
return _componentWillReceiveProps.apply(this, arguments);
|
|
67
65
|
}
|
|
68
|
-
return
|
|
66
|
+
return componentWillReceiveProps;
|
|
69
67
|
}()
|
|
70
68
|
}, {
|
|
71
69
|
key: "shouldComponentUpdate",
|
|
@@ -119,10 +117,12 @@ var Scene = /*#__PURE__*/function (_Component) {
|
|
|
119
117
|
}
|
|
120
118
|
}]);
|
|
121
119
|
}(Component);
|
|
122
|
-
_defineProperty(Scene, "contextType", AppContext);
|
|
123
120
|
export { Scene as default };
|
|
124
121
|
Scene.propTypes = {
|
|
125
122
|
scene: PropTypes.object.isRequired,
|
|
126
123
|
catalog: PropTypes.object.isRequired,
|
|
127
|
-
relatedLines: PropTypes.
|
|
124
|
+
relatedLines: PropTypes.object.isRequired
|
|
125
|
+
};
|
|
126
|
+
Scene.contextTypes = {
|
|
127
|
+
projectActions: PropTypes.object.isRequired
|
|
128
128
|
};
|
|
@@ -184,10 +184,4 @@ export var areaPolygon = function areaPolygon(points) {
|
|
|
184
184
|
}
|
|
185
185
|
var area = det / 2;
|
|
186
186
|
return signed ? area : Math.abs(area);
|
|
187
|
-
};
|
|
188
|
-
export var isWarningItem = function isWarningItem(item) {
|
|
189
|
-
var _item$toJS$doorStyle;
|
|
190
|
-
if (item.category === 'cabinet') return !(item !== null && item !== void 0 && (_item$toJS$doorStyle = item.toJS().doorStyle) !== null && _item$toJS$doorStyle !== void 0 && (_item$toJS$doorStyle = _item$toJS$doorStyle.doorStyles) !== null && _item$toJS$doorStyle !== void 0 && (_item$toJS$doorStyle = _item$toJS$doorStyle.cds) !== null && _item$toJS$doorStyle !== void 0 && _item$toJS$doorStyle.filter(function (cd) {
|
|
191
|
-
return cd.itemID == (item === null || item === void 0 ? void 0 : item.getIn(['itemID']));
|
|
192
|
-
}).length) > 0;else return false;
|
|
193
187
|
};
|
|
@@ -2,10 +2,9 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
import
|
|
8
|
-
import { ReactSVGPanZoom, INITIAL_VALUE, TOOL_AUTO, TOOL_NONE, TOOL_PAN, TOOL_ZOOM_IN, TOOL_ZOOM_OUT } from 'react-svg-pan-zoom';
|
|
7
|
+
import { ReactSVGPanZoom, TOOL_AUTO, TOOL_NONE, TOOL_PAN, TOOL_ZOOM_IN, TOOL_ZOOM_OUT } from 'react-svg-pan-zoom';
|
|
9
8
|
import * as constants from "../../constants";
|
|
10
9
|
import { DECIMAL_PLACES_2, LINE_THICKNESS, MIN_ANGLE_DISALLOW_DRAW_WALL, MODE_ELEVATION_VIEW, MODE_IDLE, UNIT_ANGLE, INTERNAL_EVENT_SELECT_ELEMENT, INTERNAL_EVENT_DRAG_ELEMENT, INTERNAL_EVENT_DRAW_ELEMENT, INTERNAL_EVENT_ROTATE_ELEMENT } from "../../constants";
|
|
11
10
|
import State from "./state";
|
|
@@ -17,7 +16,7 @@ import { convert } from "../../utils/convert-units-lite";
|
|
|
17
16
|
import { Map } from 'immutable';
|
|
18
17
|
import { formatNumber } from "../../utils/math";
|
|
19
18
|
import { isEmpty, updatePayloadOfInternalEvent } from "../../utils/helper"; // variables
|
|
20
|
-
import {
|
|
19
|
+
import { isWarningCabinet } from "../../shared/domain/cabinet-warning";
|
|
21
20
|
// variables
|
|
22
21
|
var pinFlag = false;
|
|
23
22
|
var sFlag = false; //for all object move
|
|
@@ -120,22 +119,21 @@ function extractElementData(node) {
|
|
|
120
119
|
direct: node.attributes.getNamedItem('data-direct') ? node.attributes.getNamedItem('data-direct').value : 0
|
|
121
120
|
};
|
|
122
121
|
}
|
|
123
|
-
export default function Viewer2D(_ref) {
|
|
122
|
+
export default function Viewer2D(_ref, _ref2) {
|
|
124
123
|
var state = _ref.state,
|
|
125
124
|
width = _ref.width,
|
|
126
125
|
height = _ref.height,
|
|
127
126
|
setToolbar = _ref.setToolbar,
|
|
128
127
|
replaceCabinet = _ref.replaceCabinet,
|
|
129
128
|
onInternalEvent = _ref.onInternalEvent;
|
|
130
|
-
var
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
catalog = _useContext.catalog;
|
|
129
|
+
var viewer2DActions = _ref2.viewer2DActions,
|
|
130
|
+
linesActions = _ref2.linesActions,
|
|
131
|
+
holesActions = _ref2.holesActions,
|
|
132
|
+
verticesActions = _ref2.verticesActions,
|
|
133
|
+
itemsActions = _ref2.itemsActions,
|
|
134
|
+
areaActions = _ref2.areaActions,
|
|
135
|
+
projectActions = _ref2.projectActions,
|
|
136
|
+
catalog = _ref2.catalog;
|
|
139
137
|
var _useState = useState(null),
|
|
140
138
|
_useState2 = _slicedToArray(_useState, 2),
|
|
141
139
|
rulerEdit = _useState2[0],
|
|
@@ -182,9 +180,9 @@ export default function Viewer2D(_ref) {
|
|
|
182
180
|
var layerID = scene.selectedLayer;
|
|
183
181
|
var wall_thickness = LINE_THICKNESS / 2;
|
|
184
182
|
var layer = scene.getIn(['layers', layerID]);
|
|
185
|
-
var mapCursorPosition = function mapCursorPosition(
|
|
186
|
-
var x =
|
|
187
|
-
y =
|
|
183
|
+
var mapCursorPosition = function mapCursorPosition(_ref3) {
|
|
184
|
+
var x = _ref3.x,
|
|
185
|
+
y = _ref3.y;
|
|
188
186
|
return {
|
|
189
187
|
x: x,
|
|
190
188
|
y: -y + scene.height
|
|
@@ -955,7 +953,7 @@ export default function Viewer2D(_ref) {
|
|
|
955
953
|
case 'items':
|
|
956
954
|
if (elementData.part === 'duplicate') {
|
|
957
955
|
var currentObject = state.getIn(['scene', 'layers', layerID, 'items', elementData.id]);
|
|
958
|
-
if (!
|
|
956
|
+
if (!isWarningCabinet(currentObject)) itemsActions.duplicateSelected(currentObject, onInternalEvent); // send draw internal event when duplicating
|
|
959
957
|
break;
|
|
960
958
|
} else if (elementData.part === 'remove') {
|
|
961
959
|
projectActions.remove();
|
|
@@ -1258,7 +1256,7 @@ export default function Viewer2D(_ref) {
|
|
|
1258
1256
|
_currentObject = state.getIn(['scene', 'layers', layerID, elementPrototype, elementID]);
|
|
1259
1257
|
}
|
|
1260
1258
|
if (_currentObject) {
|
|
1261
|
-
var payload = updatePayloadOfInternalEvent(_currentObject, layer
|
|
1259
|
+
var payload = updatePayloadOfInternalEvent(_currentObject, layer);
|
|
1262
1260
|
|
|
1263
1261
|
// send selection event befor replace event
|
|
1264
1262
|
if (internalType === constants.INTERNAL_EVENT_REPLACE_CABINET) {
|
|
@@ -1337,11 +1335,11 @@ export default function Viewer2D(_ref) {
|
|
|
1337
1335
|
var rulerBgColor = SharedStyle.PRIMARY_COLOR.main;
|
|
1338
1336
|
var rulerFnColor = SharedStyle.COLORS.white;
|
|
1339
1337
|
var rulerMkColor = SharedStyle.SECONDARY_COLOR.main;
|
|
1340
|
-
var sceneWidth = SVGWidth || state.getIn(['scene', 'width'])
|
|
1341
|
-
var sceneHeight = SVGHeight || state.getIn(['scene', 'height'])
|
|
1338
|
+
var sceneWidth = SVGWidth || state.getIn(['scene', 'width']);
|
|
1339
|
+
var sceneHeight = SVGHeight || state.getIn(['scene', 'height']);
|
|
1342
1340
|
var sceneZoom = state.zoom || 1;
|
|
1343
|
-
var rulerXElements =
|
|
1344
|
-
var rulerYElements =
|
|
1341
|
+
var rulerXElements = Math.ceil(sceneWidth / rulerUnitPixelSize) + 1;
|
|
1342
|
+
var rulerYElements = Math.ceil(sceneHeight / rulerUnitPixelSize) + 1;
|
|
1345
1343
|
return /*#__PURE__*/React.createElement("div", null, rulerEdit, /*#__PURE__*/React.createElement("div", {
|
|
1346
1344
|
style: {
|
|
1347
1345
|
margin: 0,
|
|
@@ -1391,7 +1389,7 @@ export default function Viewer2D(_ref) {
|
|
|
1391
1389
|
zoom: sceneZoom,
|
|
1392
1390
|
mouseY: state.mouse.get('y'),
|
|
1393
1391
|
height: height - rulerSize,
|
|
1394
|
-
zeroTopPosition: sceneHeight * sceneZoom +
|
|
1392
|
+
zeroTopPosition: sceneHeight * sceneZoom + f || 0,
|
|
1395
1393
|
backgroundColor: rulerBgColor,
|
|
1396
1394
|
fontColor: rulerFnColor,
|
|
1397
1395
|
markerColor: rulerMkColor,
|
|
@@ -1404,7 +1402,7 @@ export default function Viewer2D(_ref) {
|
|
|
1404
1402
|
},
|
|
1405
1403
|
width: width - rulerSize,
|
|
1406
1404
|
height: height - rulerSize,
|
|
1407
|
-
value: viewer2D.isEmpty() ?
|
|
1405
|
+
value: viewer2D.isEmpty() ? null : viewer2D.toJS(),
|
|
1408
1406
|
onChangeValue: onChangeValue,
|
|
1409
1407
|
tool: mode2Tool(mode),
|
|
1410
1408
|
onChangeTool: onChangeTool,
|
|
@@ -1412,12 +1410,8 @@ export default function Viewer2D(_ref) {
|
|
|
1412
1410
|
onMouseDown: onMouseDown,
|
|
1413
1411
|
onMouseMove: onMouseMove,
|
|
1414
1412
|
onMouseUp: onMouseUp,
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
},
|
|
1418
|
-
customToolbar: function customToolbar() {
|
|
1419
|
-
return null;
|
|
1420
|
-
},
|
|
1413
|
+
miniaturePosition: "none",
|
|
1414
|
+
toolbarPosition: "none",
|
|
1421
1415
|
detectPinchGesture: false,
|
|
1422
1416
|
disableDoubleClickZoomWithToolAuto: true,
|
|
1423
1417
|
ref: Viewer
|
|
@@ -1455,4 +1449,14 @@ Viewer2D.propTypes = {
|
|
|
1455
1449
|
state: PropTypes.object.isRequired,
|
|
1456
1450
|
width: PropTypes.number.isRequired,
|
|
1457
1451
|
height: PropTypes.number.isRequired
|
|
1452
|
+
};
|
|
1453
|
+
Viewer2D.contextTypes = {
|
|
1454
|
+
viewer2DActions: PropTypes.object.isRequired,
|
|
1455
|
+
linesActions: PropTypes.object.isRequired,
|
|
1456
|
+
holesActions: PropTypes.object.isRequired,
|
|
1457
|
+
verticesActions: PropTypes.object.isRequired,
|
|
1458
|
+
itemsActions: PropTypes.object.isRequired,
|
|
1459
|
+
areaActions: PropTypes.object.isRequired,
|
|
1460
|
+
projectActions: PropTypes.object.isRequired,
|
|
1461
|
+
catalog: PropTypes.object.isRequired
|
|
1458
1462
|
};
|
|
@@ -94,8 +94,8 @@ export default function Layer3D(_ref) {
|
|
|
94
94
|
depth: depth,
|
|
95
95
|
altitude: altitude
|
|
96
96
|
};
|
|
97
|
-
val.layoutpos =
|
|
98
|
-
val.is_corner =
|
|
97
|
+
val.layoutpos = item === null || item === void 0 ? void 0 : item.layoutpos;
|
|
98
|
+
val.is_corner = item.is_corner;
|
|
99
99
|
val.item = item.toJS();
|
|
100
100
|
var calcrect = GeometryUtils.getCalcRectFromItem3D(val);
|
|
101
101
|
if (isSnapped(calcrect.rect[3], calcrect.rect[2]) || isSnapped(calcrect.rect[2], calcrect.rect[1]) || isSnapped(calcrect.rect[0], calcrect.rect[3])) {
|