kitchen-simulator 4.0.4-react-18 → 4.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/es/AppContext.js +1 -1
- package/es/LiteKitchenConfigurator.js +161 -104
- package/es/LiteRenderer.js +161 -129
- package/es/actions/export.js +25 -12
- package/es/assets/gltf/door_sliding.bin +0 -0
- package/es/assets/img/png/helper/video_preview_start.png +0 -0
- package/es/assets/img/svg/bottombar/elevation.svg +12 -5
- package/es/catalog/catalog.js +21 -5
- package/es/catalog/holes/window-clear/planner-element.js +2 -2
- package/es/catalog/properties/export.js +21 -0
- package/es/catalog/properties/property-checkbox.js +68 -0
- package/es/catalog/properties/property-color.js +39 -0
- package/es/catalog/properties/property-enum.js +50 -0
- package/es/catalog/properties/property-hidden.js +19 -0
- package/es/catalog/properties/property-lenght-measure.js +100 -0
- package/es/catalog/properties/property-length-measure.js +84 -0
- package/es/catalog/properties/property-length-measure_hole.js +100 -0
- package/es/catalog/properties/property-number.js +48 -0
- package/es/catalog/properties/property-read-only.js +26 -0
- package/es/catalog/properties/property-string.js +48 -0
- package/es/catalog/properties/property-toggle.js +39 -0
- package/es/catalog/properties/shared-property-style.js +14 -0
- package/es/catalog/utils/exporter.js +1 -0
- package/es/catalog/utils/item-loader.js +35 -26
- package/es/class/hole.js +0 -2
- package/es/class/item.js +95 -69
- package/es/class/line.js +4 -8
- package/es/class/project.js +93 -80
- package/es/components/content.js +5 -93
- package/es/components/export.js +4 -6
- package/es/components/style/button.js +106 -0
- package/es/components/style/cancel-button.js +21 -0
- package/es/components/style/content-container.js +30 -0
- package/es/components/style/content-title.js +25 -0
- package/es/components/style/delete-button.js +24 -0
- package/es/components/style/export.js +28 -2
- package/es/components/style/form-block.js +20 -0
- package/es/components/style/form-color-input.js +26 -0
- package/es/components/style/form-label.js +22 -0
- package/es/components/style/form-number-input.js +29 -27
- package/es/components/style/form-number-input_2.js +200 -0
- package/es/components/style/form-select.js +19 -0
- package/es/components/style/form-slider.js +60 -0
- package/es/components/style/form-submit-button.js +25 -0
- package/es/components/style/form-text-input.js +69 -0
- package/es/components/viewer2d/grids/grid-streak.js +1 -1
- package/es/components/viewer2d/group.js +5 -4
- package/es/components/viewer2d/item.js +155 -359
- package/es/components/viewer2d/layer.js +1 -1
- package/es/components/viewer2d/line.js +17 -47
- package/es/components/viewer2d/ruler.js +5 -3
- package/es/components/viewer2d/rulerDist.js +8 -7
- package/es/components/viewer2d/rulerX.js +4 -2
- package/es/components/viewer2d/rulerY.js +3 -0
- package/es/components/viewer2d/scene.js +17 -12
- package/es/components/viewer2d/state.js +1 -1
- package/es/components/viewer2d/utils.js +2 -2
- package/es/components/viewer2d/vertex.js +3 -2
- package/es/components/viewer2d/viewer2d.js +51 -87
- package/es/components/viewer3d/ruler-utils/scene3D.js +1 -1
- package/es/components/viewer3d/scene-creator.js +59 -18
- package/es/components/viewer3d/viewer3d-first-person.js +24 -26
- package/es/components/viewer3d/viewer3d.js +100 -112
- package/es/constants.js +6 -2
- package/es/devLiteRenderer.js +491 -150
- package/es/index.js +566 -25
- package/es/models.js +3 -2
- package/es/plugins/SVGLoader.js +1414 -0
- package/es/plugins/console-debugger.js +34 -0
- package/es/plugins/export.js +7 -0
- package/es/plugins/keyboard.js +110 -0
- package/es/reducers/project-reducer.js +3 -0
- package/es/styles/export.js +5 -0
- package/es/styles/tabs.css +40 -0
- package/es/utils/geometry.js +72 -114
- package/es/utils/helper.js +38 -1
- package/es/utils/isolate-event-handler.js +826 -606
- package/es/utils/molding.js +457 -11
- package/lib/AppContext.js +1 -1
- package/lib/LiteKitchenConfigurator.js +160 -104
- package/lib/LiteRenderer.js +160 -129
- package/lib/actions/export.js +35 -39
- package/lib/assets/gltf/door_sliding.bin +0 -0
- package/lib/assets/img/png/helper/video_preview_start.png +0 -0
- package/lib/assets/img/svg/bottombar/elevation.svg +12 -5
- package/lib/catalog/catalog.js +20 -4
- package/lib/catalog/holes/window-clear/planner-element.js +2 -2
- package/lib/catalog/properties/export.js +81 -0
- package/lib/catalog/properties/property-checkbox.js +76 -0
- package/lib/catalog/properties/property-color.js +47 -0
- package/lib/catalog/properties/property-enum.js +58 -0
- package/lib/catalog/properties/property-hidden.js +27 -0
- package/lib/catalog/properties/property-lenght-measure.js +108 -0
- package/lib/catalog/properties/property-length-measure.js +92 -0
- package/lib/catalog/properties/property-length-measure_hole.js +108 -0
- package/lib/catalog/properties/property-number.js +56 -0
- package/lib/catalog/properties/property-read-only.js +34 -0
- package/lib/catalog/properties/property-string.js +56 -0
- package/lib/catalog/properties/property-toggle.js +47 -0
- package/lib/catalog/properties/shared-property-style.js +21 -0
- package/lib/catalog/utils/exporter.js +1 -0
- package/lib/catalog/utils/item-loader.js +35 -26
- package/lib/class/hole.js +0 -2
- package/lib/class/item.js +93 -67
- package/lib/class/line.js +3 -7
- package/lib/class/project.js +93 -80
- package/lib/components/content.js +5 -93
- package/lib/components/export.js +6 -26
- package/lib/components/style/button.js +115 -0
- package/lib/components/style/cancel-button.js +29 -0
- package/lib/components/style/content-container.js +38 -0
- package/lib/components/style/content-title.js +35 -0
- package/lib/components/style/delete-button.js +34 -0
- package/lib/components/style/export.js +105 -1
- package/lib/components/style/form-block.js +28 -0
- package/lib/components/style/form-color-input.js +34 -0
- package/lib/components/style/form-label.js +30 -0
- package/lib/components/style/form-number-input.js +29 -27
- package/lib/components/style/form-number-input_2.js +209 -0
- package/lib/components/style/form-select.js +29 -0
- package/lib/components/style/form-slider.js +68 -0
- package/lib/components/style/form-submit-button.js +35 -0
- package/lib/components/style/form-text-input.js +78 -0
- package/lib/components/viewer2d/grids/grid-streak.js +1 -1
- package/lib/components/viewer2d/group.js +5 -4
- package/lib/components/viewer2d/item.js +152 -356
- package/lib/components/viewer2d/layer.js +1 -1
- package/lib/components/viewer2d/line.js +17 -47
- package/lib/components/viewer2d/ruler.js +4 -2
- package/lib/components/viewer2d/rulerDist.js +8 -7
- package/lib/components/viewer2d/rulerX.js +4 -2
- package/lib/components/viewer2d/rulerY.js +3 -0
- package/lib/components/viewer2d/scene.js +17 -12
- package/lib/components/viewer2d/state.js +1 -1
- package/lib/components/viewer2d/utils.js +2 -2
- package/lib/components/viewer2d/vertex.js +3 -2
- package/lib/components/viewer2d/viewer2d.js +49 -84
- package/lib/components/viewer3d/ruler-utils/scene3D.js +1 -1
- package/lib/components/viewer3d/scene-creator.js +57 -16
- package/lib/components/viewer3d/viewer3d-first-person.js +24 -26
- package/lib/components/viewer3d/viewer3d.js +97 -108
- package/lib/constants.js +11 -7
- package/lib/devLiteRenderer.js +489 -148
- package/lib/index.js +566 -25
- package/lib/models.js +3 -2
- package/lib/plugins/SVGLoader.js +1419 -0
- package/lib/plugins/console-debugger.js +42 -0
- package/lib/plugins/export.js +25 -0
- package/lib/plugins/keyboard.js +117 -0
- package/lib/reducers/project-reducer.js +3 -0
- package/lib/styles/export.js +13 -0
- package/lib/styles/tabs.css +40 -0
- package/lib/utils/geometry.js +72 -114
- package/lib/utils/helper.js +40 -1
- package/lib/utils/isolate-event-handler.js +826 -605
- package/lib/utils/molding.js +458 -9
- package/package.json +21 -16
- package/es/mocks/appliancePayload.json +0 -27
- package/es/mocks/cabinetPayload.json +0 -1914
- package/es/mocks/cabinetPayload2.json +0 -76
- package/es/mocks/dataBundle2.json +0 -4
- package/es/mocks/distancePayload.json +0 -6
- package/es/mocks/doorStylePayload2.json +0 -84
- package/es/mocks/furnishingPayload.json +0 -23
- package/es/mocks/itemCDSPayload.json +0 -27
- package/es/mocks/lightingPayload.json +0 -23
- package/es/mocks/mockProps.json +0 -43
- package/es/mocks/mockProps2.json +0 -9
- package/es/mocks/moldingPayload.json +0 -19
- package/es/mocks/projectItemsCatalog.json +0 -133
- package/es/mocks/rectangleShape.json +0 -238
- package/es/mocks/replaceCabinetPayload.json +0 -81
- package/es/mocks/roomShapePayload.json +0 -5
- package/es/useAppContext.js +0 -8
- package/lib/mocks/appliancePayload.json +0 -27
- package/lib/mocks/cabinetPayload.json +0 -1914
- package/lib/mocks/cabinetPayload2.json +0 -76
- package/lib/mocks/dataBundle2.json +0 -4
- package/lib/mocks/distancePayload.json +0 -6
- package/lib/mocks/doorStylePayload2.json +0 -84
- package/lib/mocks/furnishingPayload.json +0 -23
- package/lib/mocks/itemCDSPayload.json +0 -27
- package/lib/mocks/lightingPayload.json +0 -23
- package/lib/mocks/mockProps.json +0 -43
- package/lib/mocks/mockProps2.json +0 -9
- package/lib/mocks/moldingPayload.json +0 -19
- package/lib/mocks/projectItemsCatalog.json +0 -133
- package/lib/mocks/rectangleShape.json +0 -238
- package/lib/mocks/replaceCabinetPayload.json +0 -81
- package/lib/mocks/roomShapePayload.json +0 -5
- package/lib/useAppContext.js +0 -16
|
@@ -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: "wallRuler-".concat(idx)
|
|
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: "wallRuler-".concat(idx)
|
|
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: "wallRuler-".concat(idx)
|
|
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: "wallRuler-".concat(idx)
|
|
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: "wallRuler-".concat(idx)
|
|
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: "wallRuler-".concat(idx)
|
|
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: "baseRuler-".concat(idx)
|
|
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: "baseRuler-".concat(idx)
|
|
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: "baseRuler-".concat(idx)
|
|
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: "baseRuler-".concat(idx)
|
|
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: "baseRuler-".concat(idx)
|
|
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: "baseRuler-".concat(idx)
|
|
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,9 +652,7 @@ 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_' + line.id
|
|
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,
|
|
@@ -700,9 +674,7 @@ export default function Line(_ref) {
|
|
|
700
674
|
style: STYLE_ROOM_SHAPE
|
|
701
675
|
})));
|
|
702
676
|
} else {
|
|
703
|
-
renderedRuler.push(/*#__PURE__*/React.createElement("g", {
|
|
704
|
-
key: 'ruler_' + line.id
|
|
705
|
-
}, /*#__PURE__*/React.createElement("line", {
|
|
677
|
+
renderedRuler.push(/*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("line", {
|
|
706
678
|
x1: 0,
|
|
707
679
|
y1: lineSpace + lineSpacedimension1,
|
|
708
680
|
x2: 0,
|
|
@@ -801,9 +773,7 @@ export default function Line(_ref) {
|
|
|
801
773
|
}
|
|
802
774
|
});
|
|
803
775
|
}
|
|
804
|
-
return /*#__PURE__*/React.createElement("g", {
|
|
805
|
-
key: line.id
|
|
806
|
-
}, /*#__PURE__*/React.createElement("g", {
|
|
776
|
+
return /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("g", {
|
|
807
777
|
transform: "translate(".concat(x1, ", ").concat(y1, ") rotate(").concat(angle, ", 0, 0)"),
|
|
808
778
|
"data-element-root": true,
|
|
809
779
|
"data-prototype": 'ruler',
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { convert } from "../../utils/convert-units-lite";
|
|
4
4
|
import IDBroker from "../../utils/id-broker";
|
|
5
|
-
import { LINE_THICKNESS, TEXT_COLOR_NEUTRAL_7 } from "../../constants";
|
|
5
|
+
import { LINE_THICKNESS, TEXT_COLOR_NEUTRAL_7, UNIT_FOOT, UNIT_METER } from "../../constants";
|
|
6
6
|
import { STYLE_ROOM_SHAPE } from "./line";
|
|
7
7
|
var STYLE = {
|
|
8
8
|
stroke: TEXT_COLOR_NEUTRAL_7,
|
|
@@ -31,7 +31,9 @@ export default function Ruler(_ref) {
|
|
|
31
31
|
rulerUnit = _ref.rulerUnit,
|
|
32
32
|
transform = _ref.transform,
|
|
33
33
|
style = _ref.style;
|
|
34
|
-
var
|
|
34
|
+
var ruLength = convert(length).from(unit).to(rulerUnit);
|
|
35
|
+
var fixedLength = layer.unit === UNIT_METER || layer.unit === UNIT_FOOT ? 2 : 0;
|
|
36
|
+
var distanceText = (Math.round(convert(ruLength).from(rulerUnit).to(layer.unit) * 100) / 100).toFixed(fixedLength);
|
|
35
37
|
var textLength = (distanceText.length + layer.unit.length) * 9;
|
|
36
38
|
return /*#__PURE__*/React.createElement("g", {
|
|
37
39
|
transform: transform
|
|
@@ -52,7 +54,7 @@ export default function Ruler(_ref) {
|
|
|
52
54
|
transform: "scale(1, -1)",
|
|
53
55
|
style: STYLE_TEXT,
|
|
54
56
|
fill: TEXT_COLOR_NEUTRAL_7
|
|
55
|
-
},
|
|
57
|
+
}, distanceText, layer.unit === 'in' ? '"' : layer.unit)), /*#__PURE__*/React.createElement("line", {
|
|
56
58
|
x1: style === STYLE_ROOM_SHAPE ? 0 : 4,
|
|
57
59
|
y1: "0",
|
|
58
60
|
x2: (length - textLength) / 2 < 0 ? 0 : (length - textLength) / 2,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { convert } from "../../utils/convert-units-lite";
|
|
4
|
+
import { UNIT_FOOT, UNIT_METER } from "../../constants";
|
|
4
5
|
var ARROW_STYLE = {
|
|
5
6
|
stroke: '#1183B7',
|
|
6
7
|
strokeWidth: '2px',
|
|
@@ -31,9 +32,9 @@ export default function RulerDist(_ref) {
|
|
|
31
32
|
transform = _ref.transform,
|
|
32
33
|
angle = _ref.angle,
|
|
33
34
|
rotation = _ref.rotation;
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
var distanceText =
|
|
35
|
+
var ruLength = convert(length).from(unit).to(rulerUnit);
|
|
36
|
+
var fixedLength = layer.unit === UNIT_METER || layer.unit === UNIT_FOOT ? 2 : 0;
|
|
37
|
+
var distanceText = (Math.round(convert(ruLength).from(rulerUnit).to(layer.unit) * 100) / 100).toFixed(fixedLength);
|
|
37
38
|
var textLength = (distanceText.length + layer.unit.length) * 8;
|
|
38
39
|
var textangle = angle + 90;
|
|
39
40
|
var textRotation = 1;
|
|
@@ -66,8 +67,8 @@ export default function RulerDist(_ref) {
|
|
|
66
67
|
textRotation = 180;
|
|
67
68
|
ay = 5;
|
|
68
69
|
}
|
|
69
|
-
if (
|
|
70
|
-
if (
|
|
70
|
+
if (ruLength > 0) {
|
|
71
|
+
if (ruLength < 28) {
|
|
71
72
|
return /*#__PURE__*/React.createElement("g", {
|
|
72
73
|
transform: transform
|
|
73
74
|
}, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("text", {
|
|
@@ -75,7 +76,7 @@ export default function RulerDist(_ref) {
|
|
|
75
76
|
y: "0",
|
|
76
77
|
transform: "translate(".concat(length / 2, ",").concat(ay, ") scale(1, -1) rotate(").concat(textRotation, ")"),
|
|
77
78
|
style: STYLE_TEXT
|
|
78
|
-
},
|
|
79
|
+
}, distanceText, layer.unit === 'in' ? '"' : layer.unit)));
|
|
79
80
|
} else {
|
|
80
81
|
return /*#__PURE__*/React.createElement("g", {
|
|
81
82
|
transform: transform
|
|
@@ -84,7 +85,7 @@ export default function RulerDist(_ref) {
|
|
|
84
85
|
y: "0",
|
|
85
86
|
transform: "translate(".concat(length / 2, ",").concat(ay, ") scale(1, -1) rotate(").concat(textRotation, ")"),
|
|
86
87
|
style: STYLE_TEXT
|
|
87
|
-
},
|
|
88
|
+
}, distanceText, layer.unit === 'in' ? '"' : layer.unit)), /*#__PURE__*/React.createElement("line", {
|
|
88
89
|
x1: "2",
|
|
89
90
|
y1: "0",
|
|
90
91
|
x2: (length - textLength) / 2 < 0 ? 0 : (length - textLength) / 2,
|
|
@@ -43,10 +43,9 @@ var RulerX = /*#__PURE__*/function (_Component) {
|
|
|
43
43
|
height: '100%',
|
|
44
44
|
color: this.props.fontColor
|
|
45
45
|
};
|
|
46
|
-
var left = Number.isFinite(this.props.zeroLeftPosition) && Number.isFinite(this.props.mouseX) && Number.isFinite(this.props.zoom) ? this.props.zeroLeftPosition + this.props.mouseX * this.props.zoom - 6.5 : 0;
|
|
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,
|
|
@@ -140,4 +139,7 @@ RulerX.defaultProps = {
|
|
|
140
139
|
backgroundColor: SharedStyle.PRIMARY_COLOR.main,
|
|
141
140
|
fontColor: SharedStyle.COLORS.white,
|
|
142
141
|
markerColor: SharedStyle.SECONDARY_COLOR.main
|
|
142
|
+
};
|
|
143
|
+
RulerX.contextTypes = {
|
|
144
|
+
translator: PropTypes.object.isRequired
|
|
143
145
|
};
|
|
@@ -19,15 +19,16 @@ var Scene = /*#__PURE__*/function (_Component) {
|
|
|
19
19
|
}
|
|
20
20
|
_inherits(Scene, _Component);
|
|
21
21
|
return _createClass(Scene, [{
|
|
22
|
-
key: "
|
|
22
|
+
key: "componentWillReceiveProps",
|
|
23
23
|
value: function () {
|
|
24
|
-
var
|
|
25
|
-
var
|
|
24
|
+
var _componentWillReceiveProps = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(nextProps) {
|
|
25
|
+
var scene, catalog, height, layers, selectedLayer, msg, isNotFoundInElements, itemType;
|
|
26
26
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
27
27
|
while (1) switch (_context.prev = _context.next) {
|
|
28
28
|
case 0:
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
// console.log("componentDidMount", this.props.scene.hashCode(), nextProps.scene.hashCode());
|
|
30
|
+
if (this.props.scene.hashCode() !== nextProps.scene.hashCode()) {
|
|
31
|
+
scene = nextProps.scene, catalog = nextProps.catalog;
|
|
31
32
|
height = scene.height, layers = scene.layers;
|
|
32
33
|
selectedLayer = layers.get(scene.selectedLayer);
|
|
33
34
|
msg = '';
|
|
@@ -59,10 +60,10 @@ var Scene = /*#__PURE__*/function (_Component) {
|
|
|
59
60
|
}
|
|
60
61
|
}, _callee, this);
|
|
61
62
|
}));
|
|
62
|
-
function
|
|
63
|
-
return
|
|
63
|
+
function componentWillReceiveProps(_x) {
|
|
64
|
+
return _componentWillReceiveProps.apply(this, arguments);
|
|
64
65
|
}
|
|
65
|
-
return
|
|
66
|
+
return componentWillReceiveProps;
|
|
66
67
|
}()
|
|
67
68
|
}, {
|
|
68
69
|
key: "shouldComponentUpdate",
|
|
@@ -73,9 +74,10 @@ var Scene = /*#__PURE__*/function (_Component) {
|
|
|
73
74
|
key: "render",
|
|
74
75
|
value: function render() {
|
|
75
76
|
var _this = this;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
// console.log("scene", this);
|
|
78
|
+
var _this$props = this.props,
|
|
79
|
+
scene = _this$props.scene,
|
|
80
|
+
catalog = _this$props.catalog;
|
|
79
81
|
var height = scene.height,
|
|
80
82
|
layers = scene.layers;
|
|
81
83
|
var selectedLayer = layers.get(scene.selectedLayer);
|
|
@@ -119,5 +121,8 @@ export { Scene as default };
|
|
|
119
121
|
Scene.propTypes = {
|
|
120
122
|
scene: PropTypes.object.isRequired,
|
|
121
123
|
catalog: PropTypes.object.isRequired,
|
|
122
|
-
relatedLines: PropTypes.
|
|
124
|
+
relatedLines: PropTypes.object.isRequired
|
|
125
|
+
};
|
|
126
|
+
Scene.contextTypes = {
|
|
127
|
+
projectActions: PropTypes.object.isRequired
|
|
123
128
|
};
|
|
@@ -187,7 +187,7 @@ export var areaPolygon = function areaPolygon(points) {
|
|
|
187
187
|
};
|
|
188
188
|
export var isWarningItem = function isWarningItem(item) {
|
|
189
189
|
var _item$toJS$doorStyle;
|
|
190
|
-
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) {
|
|
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
191
|
return cd.itemID == (item === null || item === void 0 ? void 0 : item.getIn(['itemID']));
|
|
192
|
-
}).length) > 0;
|
|
192
|
+
}).length) > 0;else return false;
|
|
193
193
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import * as SharedStyle from "../../shared-style";
|
|
4
|
+
import { isEmpty } from "./utils";
|
|
4
5
|
//Space from the center of the point(Use cases:x - vertexthickness,y + vertexthickness )
|
|
5
6
|
var vertexthickness = 4;
|
|
6
7
|
var STYLE = {
|
|
@@ -31,9 +32,9 @@ export default function Vertex(_ref) {
|
|
|
31
32
|
});
|
|
32
33
|
if (index > -1) {
|
|
33
34
|
var vertice = line.relatedVertices.filter(function (a) {
|
|
34
|
-
if (a['index']
|
|
35
|
+
if (isEmpty(a['index'])) {
|
|
35
36
|
return a.get('index') === index;
|
|
36
|
-
} else
|
|
37
|
+
} else {
|
|
37
38
|
return a.index === index;
|
|
38
39
|
}
|
|
39
40
|
}).get(0);
|