kitchen-simulator 2.0.7-unselected-drag.1 → 2.0.11

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.
Files changed (38) hide show
  1. package/es/LiteRenderer.js +1 -3
  2. package/es/actions/items-actions.js +1 -1
  3. package/es/actions/project-actions.js +3 -1
  4. package/es/catalog/utils/exporter.js +0 -2
  5. package/es/class/item.js +3 -1
  6. package/es/class/project.js +40 -17
  7. package/es/components/viewer2d/viewer2d.js +2 -2
  8. package/es/components/viewer3d/viewer3d.js +2 -2
  9. package/es/constants.js +11 -4
  10. package/es/devLiteRenderer.js +57 -6
  11. package/es/models.js +1 -2
  12. package/es/reducers/items-reducer.js +1 -5
  13. package/es/reducers/project-reducer.js +1 -1
  14. package/es/utils/isolate-event-handler.js +247 -193
  15. package/lib/LiteRenderer.js +1 -3
  16. package/lib/actions/project-actions.js +3 -1
  17. package/lib/catalog/utils/exporter.js +0 -2
  18. package/lib/class/item.js +3 -1
  19. package/lib/class/project.js +40 -17
  20. package/lib/components/viewer2d/viewer2d.js +2 -2
  21. package/lib/components/viewer3d/viewer3d.js +2 -2
  22. package/lib/constants.js +16 -9
  23. package/lib/devLiteRenderer.js +56 -5
  24. package/lib/models.js +1 -2
  25. package/lib/reducers/items-reducer.js +0 -4
  26. package/lib/reducers/project-reducer.js +1 -1
  27. package/lib/utils/isolate-event-handler.js +246 -192
  28. package/package.json +1 -1
  29. package/es/assets/Window.hdr +0 -2100
  30. package/es/assets/brown_photostudio_02_1k.hdr +0 -0
  31. package/es/assets/gltf/door_sliding.bin +0 -0
  32. package/es/assets/img/1.jpg +0 -0
  33. package/es/assets/img/png/helper/video_preview_start.png +0 -0
  34. package/lib/assets/Window.hdr +0 -2100
  35. package/lib/assets/brown_photostudio_02_1k.hdr +0 -0
  36. package/lib/assets/gltf/door_sliding.bin +0 -0
  37. package/lib/assets/img/1.jpg +0 -0
  38. package/lib/assets/img/png/helper/video_preview_start.png +0 -0
@@ -5,7 +5,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
5
5
  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; }
6
6
  import _regeneratorRuntime from "@babel/runtime/regenerator";
7
7
  import { Map } from 'immutable';
8
- import { EXTERNAL_EVENT_ADD_WALL, EXTERNAL_EVENT_TOGGLE_TO_3D, EXTERNAL_EVENT_TOGGLE_TO_2D, EXTERNAL_EVENT_TOGGLE_TO_ELEVATION, EXTERNAL_EVENT_MOVE_PAN, MODE_IDLE, MODE_2D_PAN, EXTERNAL_EVENT_ADD_ITEM, ARRAY_3D_MODES, MODE_IDLE_3D, MODE_ELEVATION_VIEW, MODE_DRAWING_LINE, TOP, BOTTOM, LEFT, RIGHT, EXTERNAL_EVENT_NEW_PROJECT, EXTERNAL_EVENT_CHANGE_DOORSTYLE, EXTERNAL_EVENT_SET_INITIAL_DATA, EXTERNAL_EVENT_ADD_ROOM_SHAPE, EXTERNAL_EVENT_ZOOM_IN, EXTERNAL_EVENT_ZOOM_OUT, ZOOM_VARIABLE, EXTERNAL_EVENT_UNDO, EXTERNAL_EVENT_REDO, EXTERNAL_EVENT_SET_MOLDING, EXTERNAL_EVENT_PROJECT_SETTING, PROJECT_SETTING_OPTION, EXTERNAL_EVENT_SYNC_SCENE, INTERNAL_EVENT_SYNC_SCENE, EXTERNAL_EVENT_UPDATE_ATTRIBUTE, ATT_ITEM_POS, ATT_LINE_LENGTH, ATT_VERTEXT_ONE, ATT_VERTEXT_TWO, ATT_HOLE_OFFSET_A, ATT_HOLE_OFFSET_B, UNIT_CENTIMETER, UNIT_INCH, EXTERNAL_EVENT_UPDATE_PROPERTY, PROP_FLIP_DOOR_HANDLE, PROP_OPEN_DOORS, EXTERNAL_EVENT_LOAD_PROJECT, INTERNAL_EVENT_ITEMS_CATALOG, EXTERNAL_EVENT_ADD_HOLE } from "../constants";
8
+ import { EXTERNAL_EVENT_ADD_WALL, EXTERNAL_EVENT_TOGGLE_TO_3D, EXTERNAL_EVENT_TOGGLE_TO_2D, EXTERNAL_EVENT_TOGGLE_TO_ELEVATION, EXTERNAL_EVENT_MOVE_PAN, MODE_IDLE, MODE_2D_PAN, EXTERNAL_EVENT_ADD_ITEM, ARRAY_3D_MODES, MODE_IDLE_3D, MODE_ELEVATION_VIEW, MODE_DRAWING_LINE, TOP, BOTTOM, LEFT, RIGHT, EXTERNAL_EVENT_NEW_PROJECT, EXTERNAL_EVENT_CHANGE_DOORSTYLE, EXTERNAL_EVENT_SET_INITIAL_DATA, EXTERNAL_EVENT_ADD_ROOM_SHAPE, EXTERNAL_EVENT_ZOOM_IN, EXTERNAL_EVENT_ZOOM_OUT, ZOOM_VARIABLE, EXTERNAL_EVENT_UNDO, EXTERNAL_EVENT_REDO, EXTERNAL_EVENT_SET_MOLDING, EXTERNAL_EVENT_PROJECT_SETTING, PROJECT_SETTING_OPTION, EXTERNAL_EVENT_SYNC_SCENE, INTERNAL_EVENT_SYNC_SCENE, EXTERNAL_EVENT_UPDATE_ATTRIBUTE, ATT_ITEM_POS, ATT_LINE_LENGTH, ATT_VERTEXT_ONE, ATT_VERTEXT_TWO, ATT_HOLE_OFFSET_A, ATT_HOLE_OFFSET_B, UNIT_CENTIMETER, UNIT_INCH, EXTERNAL_EVENT_UPDATE_PROPERTY, PROP_FLIP_DOOR_HANDLE, PROP_OPEN_DOORS, EXTERNAL_EVENT_LOAD_PROJECT, INTERNAL_EVENT_ITEMS_CATALOG, EXTERNAL_EVENT_ADD_HOLE, EXTERNAL_EVENT_CENTERING_2D, EXTERNAL_EVENT_DUPLICATE_ELEMENT, EXTERNAL_EVENT_DELETE_ELEMENT, ELEMENT_HOLE, ELEMENT_ITEM, ELEMENT_LINE } from "../constants";
9
9
  import { isEmpty } from "./helper";
10
10
  import exporter from "../catalog/utils/exporter";
11
11
  import { render2DItem, render3DItem, render3DApplianceItem, render3DLightingItem } from "../catalog/utils/item-loader";
@@ -14,62 +14,30 @@ import { GeometryUtils } from "./export";
14
14
  import { returnReplaceableDeepSearchType } from "../components/viewer2d/utils";
15
15
  import { SVGLoader } from 'three/addons/loaders/SVGLoader';
16
16
  var PRECISION = 2;
17
- var loadSVGsByItem = /*#__PURE__*/function () {
18
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(item) {
19
- var _parsed$xml$viewBox, _parsed$xml$viewBox2, response, svgText, loader, parsed, _t;
20
- return _regeneratorRuntime.wrap(function (_context) {
21
- while (1) switch (_context.prev = _context.next) {
22
- case 0:
23
- if (item.outline) {
24
- _context.next = 1;
25
- break;
26
- }
27
- return _context.abrupt("return", null);
28
- case 1:
29
- _context.prev = 1;
30
- _context.next = 2;
31
- return fetch(item.outline, {
32
- cache: 'no-store'
33
- });
34
- case 2:
35
- response = _context.sent;
36
- _context.next = 3;
37
- return response.text();
38
- case 3:
39
- svgText = _context.sent;
40
- loader = new SVGLoader();
41
- parsed = loader.parse(svgText);
42
- if (!isEmpty(parsed.paths)) {
43
- _context.next = 4;
44
- break;
45
- }
46
- return _context.abrupt("return", null);
47
- case 4:
48
- return _context.abrupt("return", {
49
- paths: parsed.paths,
50
- svgWidth: parseFloat(parsed.xml.getAttribute('width')) || ((_parsed$xml$viewBox = parsed.xml.viewBox) === null || _parsed$xml$viewBox === void 0 || (_parsed$xml$viewBox = _parsed$xml$viewBox.animVal) === null || _parsed$xml$viewBox === void 0 ? void 0 : _parsed$xml$viewBox.width) || 0,
51
- svgHeight: parseFloat(parsed.xml.getAttribute('height')) || ((_parsed$xml$viewBox2 = parsed.xml.viewBox) === null || _parsed$xml$viewBox2 === void 0 || (_parsed$xml$viewBox2 = _parsed$xml$viewBox2.animVal) === null || _parsed$xml$viewBox2 === void 0 ? void 0 : _parsed$xml$viewBox2.height) || 0,
52
- reverse: !parseFloat(parsed.xml.getAttribute('height'))
53
- });
54
- case 5:
55
- _context.prev = 5;
56
- _t = _context["catch"](1);
57
- console.error('Failed to load SVG:', item.outline, _t);
58
- return _context.abrupt("return", null);
59
- case 6:
60
- case "end":
61
- return _context.stop();
62
- }
63
- }, _callee, null, [[1, 5]]);
64
- }));
65
- return function loadSVGsByItem(_x) {
66
- return _ref.apply(this, arguments);
67
- };
68
- }();
69
17
  var compareSVGRect = function compareSVGRect(value) {
70
18
  return value.e <= 10 && value.e + value.a * value.SVGWidth + 10 >= value.viewerWidth && value.f <= 80 && value.f + value.d * value.SVGHeight + 10 >= value.viewerHeight ? true : false;
71
19
  };
72
- function loadJSON(_x2) {
20
+ var updateViwer2D = function updateViwer2D(value, viewer2DActions) {
21
+ var _zoomValue = parseInt((value.a - 0.5) / ZOOM_VARIABLE);
22
+ if (_zoomValue > 404) return;
23
+ if (_zoomValue < 35 || Number.isNaN(_zoomValue)) return;
24
+
25
+ // modify e, f to fit to SVG
26
+ while (!(value.e <= 10)) {
27
+ value.e -= 0.1;
28
+ }
29
+ while (!(value.e + value.a * value.SVGWidth + 10 >= value.viewerWidth)) {
30
+ value.e += 0.1;
31
+ }
32
+ while (!(value.f <= 80)) {
33
+ value.f -= 0.1;
34
+ }
35
+ while (!(value.f + value.a * value.SVGHeight + 10 >= value.viewerHeight)) {
36
+ value.f += 0.1;
37
+ }
38
+ if (compareSVGRect(value)) viewer2DActions.updateCameraView(value);
39
+ };
40
+ function loadJSON(_x) {
73
41
  return _loadJSON.apply(this, arguments);
74
42
  }
75
43
  /********Parse TempPlaceholder from cabinetPayloadData **************/
@@ -100,7 +68,7 @@ function _loadJSON() {
100
68
  }));
101
69
  return _loadJSON.apply(this, arguments);
102
70
  }
103
- function parseTempPlaceholdersFromCabinetPayload(_x3) {
71
+ function parseTempPlaceholdersFromCabinetPayload(_x2) {
104
72
  return _parseTempPlaceholdersFromCabinetPayload.apply(this, arguments);
105
73
  }
106
74
  /***** Update cabinetPayloadData with updatedTempPlaceholders *****/
@@ -444,9 +412,9 @@ function _parseTempPlaceholdersFromCabinetPayload() {
444
412
  }));
445
413
  return _parseTempPlaceholdersFromCabinetPayload.apply(this, arguments);
446
414
  }
447
- function updateCabinetPayload(_x4) {
415
+ function updateCabinetPayload(_x3) {
448
416
  return _updateCabinetPayload.apply(this, arguments);
449
- } // Get attributs of current selected element
417
+ }
450
418
  function _updateCabinetPayload() {
451
419
  _updateCabinetPayload = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(cabinetPayload) {
452
420
  var tempPlaceholders, cabinetPayloadKeys, i;
@@ -474,6 +442,112 @@ function _updateCabinetPayload() {
474
442
  }));
475
443
  return _updateCabinetPayload.apply(this, arguments);
476
444
  }
445
+ var loadSVGsByItem = /*#__PURE__*/function () {
446
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(item) {
447
+ var _parsed$xml$viewBox, _parsed$xml$viewBox2, response, svgText, loader, parsed, _t;
448
+ return _regeneratorRuntime.wrap(function (_context) {
449
+ while (1) switch (_context.prev = _context.next) {
450
+ case 0:
451
+ if (item.outline) {
452
+ _context.next = 1;
453
+ break;
454
+ }
455
+ return _context.abrupt("return", null);
456
+ case 1:
457
+ _context.prev = 1;
458
+ _context.next = 2;
459
+ return fetch(item.outline, {
460
+ cache: 'no-store'
461
+ });
462
+ case 2:
463
+ response = _context.sent;
464
+ _context.next = 3;
465
+ return response.text();
466
+ case 3:
467
+ svgText = _context.sent;
468
+ loader = new SVGLoader();
469
+ parsed = loader.parse(svgText);
470
+ if (!isEmpty(parsed.paths)) {
471
+ _context.next = 4;
472
+ break;
473
+ }
474
+ return _context.abrupt("return", null);
475
+ case 4:
476
+ return _context.abrupt("return", {
477
+ paths: parsed.paths,
478
+ svgWidth: parseFloat(parsed.xml.getAttribute('width')) || ((_parsed$xml$viewBox = parsed.xml.viewBox) === null || _parsed$xml$viewBox === void 0 || (_parsed$xml$viewBox = _parsed$xml$viewBox.animVal) === null || _parsed$xml$viewBox === void 0 ? void 0 : _parsed$xml$viewBox.width) || 0,
479
+ svgHeight: parseFloat(parsed.xml.getAttribute('height')) || ((_parsed$xml$viewBox2 = parsed.xml.viewBox) === null || _parsed$xml$viewBox2 === void 0 || (_parsed$xml$viewBox2 = _parsed$xml$viewBox2.animVal) === null || _parsed$xml$viewBox2 === void 0 ? void 0 : _parsed$xml$viewBox2.height) || 0,
480
+ reverse: !parseFloat(parsed.xml.getAttribute('height'))
481
+ });
482
+ case 5:
483
+ _context.prev = 5;
484
+ _t = _context["catch"](1);
485
+ console.error('Failed to load SVG:', item.outline, _t);
486
+ return _context.abrupt("return", null);
487
+ case 6:
488
+ case "end":
489
+ return _context.stop();
490
+ }
491
+ }, _callee, null, [[1, 5]]);
492
+ }));
493
+ return function loadSVGsByItem(_x4) {
494
+ return _ref.apply(this, arguments);
495
+ };
496
+ }();
497
+ function addItemToCatalog(_x5, _x6, _x7, _x8) {
498
+ return _addItemToCatalog.apply(this, arguments);
499
+ } // Get attributs of current selected element
500
+ function _addItemToCatalog() {
501
+ _addItemToCatalog = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(element, state, catalogInstance, projectActions) {
502
+ var elementJs, catalog, outlineSVGData, updatedStructureJson;
503
+ return _regeneratorRuntime.wrap(function (_context5) {
504
+ while (1) switch (_context5.prev = _context5.next) {
505
+ case 0:
506
+ elementJs = element;
507
+ catalog = state.getIn(['catalog']).toJS(); // add item to catalog of state
508
+ // if (isEmpty(catalog?.elements[element.name])) {
509
+ _context5.next = 1;
510
+ return loadSVGsByItem(element);
511
+ case 1:
512
+ outlineSVGData = _context5.sent;
513
+ if (!(element.type === 'cabinet')) {
514
+ _context5.next = 3;
515
+ break;
516
+ }
517
+ // make placeholders of element and tempPlaceholder
518
+ updatedStructureJson = _objectSpread(_objectSpread({}, element.structure_json), element.structure_json.tempPlaceholders[0].structure);
519
+ element.structure_json = updatedStructureJson;
520
+ element = _objectSpread(_objectSpread({}, element), {}, {
521
+ cds: {
522
+ data: [_objectSpread({}, element.customer_property)],
523
+ itemID: element.itemID
524
+ }
525
+ });
526
+ _context5.next = 2;
527
+ return updateCabinetPayload(element);
528
+ case 2:
529
+ elementJs = _context5.sent;
530
+ case 3:
531
+ elementJs = _objectSpread(_objectSpread({}, elementJs), {}, {
532
+ outlineSVGData: outlineSVGData,
533
+ type: element.type,
534
+ render2DItem: render2DItem
535
+ });
536
+ if (element.type === 'appliance' || element.type === 'furnishing') elementJs.render3DItem = render3DApplianceItem;else if (element.type === 'lighting') elementJs.render3DItem = render3DLightingItem;else elementJs.render3DItem = render3DItem;
537
+ elementJs = exporter(elementJs);
538
+ if (catalogInstance !== null && catalogInstance !== void 0 && catalogInstance.validateElement(elementJs)) {
539
+ catalogInstance.registerElement(elementJs);
540
+ projectActions.addElementToCatalog(elementJs);
541
+ }
542
+ // }
543
+ case 4:
544
+ case "end":
545
+ return _context5.stop();
546
+ }
547
+ }, _callee5);
548
+ }));
549
+ return _addItemToCatalog.apply(this, arguments);
550
+ }
477
551
  function initAttrData(element, layer, state) {
478
552
  element = _typeof(element.misc) === 'object' ? element.set('misc', new Map(element.misc)) : element;
479
553
  switch (element.prototype) {
@@ -736,21 +810,21 @@ function updateAttributeOfSelectedElement(element, attrPayload, state, layer, pr
736
810
  {
737
811
  var _line = layer.lines.get(element.line);
738
812
  var _layer$vertices$get5 = layer.vertices.get(_line.vertices.get(0)),
739
- _x5 = _layer$vertices$get5.x,
813
+ _x9 = _layer$vertices$get5.x,
740
814
  _y = _layer$vertices$get5.y;
741
815
  var _layer$vertices$get6 = layer.vertices.get(_line.vertices.get(1)),
742
- _x6 = _layer$vertices$get6.x,
816
+ _x0 = _layer$vertices$get6.x,
743
817
  _y2 = _layer$vertices$get6.y;
744
- var _alpha = GeometryUtils.angleBetweenTwoPoints(_x5, _y, _x6, _y2);
745
- var _lineLength = GeometryUtils.pointsDistance(_x5, _y, _x6, _y2);
818
+ var _alpha = GeometryUtils.angleBetweenTwoPoints(_x9, _y, _x0, _y2);
819
+ var _lineLength = GeometryUtils.pointsDistance(_x9, _y, _x0, _y2);
746
820
  var _widthLength = element.properties.get('width').get('length');
747
821
  var _halfWidthLength = _widthLength / 2;
748
822
  var _lengthValue = value.get('length');
749
823
  _lengthValue = Math.max(_lengthValue, 0);
750
824
  _lengthValue = Math.min(_lengthValue, _lineLength - _widthLength);
751
- var _xp = _x6 - (_lengthValue + _halfWidthLength) * Math.cos(_alpha);
825
+ var _xp = _x0 - (_lengthValue + _halfWidthLength) * Math.cos(_alpha);
752
826
  var _yp = _y2 - (_lengthValue + _halfWidthLength) * Math.sin(_alpha);
753
- var _offset = GeometryUtils.pointPositionOnLineSegment(_x5, _y, _x6, _y2, _xp, _yp);
827
+ var _offset = GeometryUtils.pointPositionOnLineSegment(_x9, _y, _x0, _y2, _xp, _yp);
754
828
  /*
755
829
  if (x0 > x1) offset = 1 - offset;
756
830
  */
@@ -822,59 +896,41 @@ projectActions) {
822
896
  projectActions.setProperties(properties);
823
897
  }
824
898
  }
825
- function addItemToCatalog(_x7, _x8, _x9, _x0) {
826
- return _addItemToCatalog.apply(this, arguments);
827
- }
828
- function _addItemToCatalog() {
829
- _addItemToCatalog = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(element, state, catalogInstance, projectActions) {
830
- var elementJs, catalog, outlineSVGData, updatedStructureJson;
831
- return _regeneratorRuntime.wrap(function (_context5) {
832
- while (1) switch (_context5.prev = _context5.next) {
833
- case 0:
834
- elementJs = element;
835
- catalog = state.getIn(['catalog']).toJS(); // add item to catalog of state
836
- // if (isEmpty(catalog?.elements[element.name])) {
837
- _context5.next = 1;
838
- return loadSVGsByItem(element);
839
- case 1:
840
- outlineSVGData = _context5.sent;
841
- if (!(element.type === 'cabinet')) {
842
- _context5.next = 3;
843
- break;
844
- }
845
- // make placeholders of element and tempPlaceholder
846
- updatedStructureJson = _objectSpread(_objectSpread({}, element.structure_json), element.structure_json.tempPlaceholders[0].structure);
847
- element.structure_json = updatedStructureJson;
848
- element = _objectSpread(_objectSpread({}, element), {}, {
849
- cds: {
850
- data: [_objectSpread({}, element.customer_property)],
851
- itemID: element.itemID
852
- }
853
- });
854
- _context5.next = 2;
855
- return updateCabinetPayload(element);
856
- case 2:
857
- elementJs = _context5.sent;
858
- case 3:
859
- elementJs = _objectSpread(_objectSpread({}, elementJs), {}, {
860
- outlineSVGData: outlineSVGData,
861
- type: element.type,
862
- render2DItem: render2DItem
899
+ function getElement(objProps, state) {
900
+ var layerID = state.scene.selectedLayer;
901
+ var curObject = null;
902
+ if (!isEmpty(objProps === null || objProps === void 0 ? void 0 : objProps.elementPrototype) && !isEmpty(objProps === null || objProps === void 0 ? void 0 : objProps.elementId)) curObject = state.getIn(['scene', 'layers', layerID, objProps.elementPrototype, objProps.elementId]);else {
903
+ // if no specified object property then get the first selected element
904
+ var layer = state.scene.layers.get(state.scene.selectedLayer);
905
+ var selected = [];
906
+ layer.selected.forEach(function (data, prototype) {
907
+ if (prototype == 'vertices') return;
908
+ if (data.size > 0) {
909
+ var values = data.toJS();
910
+ for (var i = 0; i < values.length; i++) {
911
+ selected.push({
912
+ type: prototype,
913
+ id: values[i]
863
914
  });
864
- if (element.type === 'appliance' || element.type === 'furnishing') elementJs.render3DItem = render3DApplianceItem;else if (element.type === 'lighting') elementJs.render3DItem = render3DLightingItem;else elementJs.render3DItem = render3DItem;
865
- elementJs = exporter(elementJs);
866
- if (catalogInstance !== null && catalogInstance !== void 0 && catalogInstance.validateElement(elementJs)) {
867
- catalogInstance.registerElement(elementJs);
868
- projectActions.addElementToCatalog(elementJs);
869
- }
870
- // }
871
- case 4:
872
- case "end":
873
- return _context5.stop();
915
+ }
874
916
  }
875
- }, _callee5);
876
- }));
877
- return _addItemToCatalog.apply(this, arguments);
917
+ });
918
+ if (selected.length === 1) {
919
+ var selData = selected[0];
920
+ switch (selData.type) {
921
+ case ELEMENT_HOLE:
922
+ curObject = layer.holes.get(selData.id);
923
+ break;
924
+ case ELEMENT_ITEM:
925
+ curObject = layer.items.get(selData.id);
926
+ break;
927
+ case ELEMENT_LINE:
928
+ curObject = layer.lines.get(selData.id);
929
+ break;
930
+ }
931
+ }
932
+ }
933
+ return curObject;
878
934
  }
879
935
  export function handleExternalEvent(_x1) {
880
936
  return _handleExternalEvent.apply(this, arguments);
@@ -882,7 +938,7 @@ export function handleExternalEvent(_x1) {
882
938
  function _handleExternalEvent() {
883
939
  _handleExternalEvent = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(props) {
884
940
  var _evt$payload3, _evt$payload4;
885
- var evt, state, _evt$payload, cdsItems, itemKeys, _loop3, i, _props$onInternalEven, sLineCnt, element, _state$viewer2D, _evt$payload$initialP, mouseX, mouseY, v2d, vPosX, vPosY, layerID, _evt$payload5, moveType, moveValue, value, defaulTitle, _evt$payload6, doorStyle, itemCDS, isAll, _doorStyle, _value, _zoomValue, _value2, _zoomValue2, _evt$payload7, moldingInfo, isGlobal, _evt$payload8, option, _value3, layerId, layer, _layer$getIn, selectedLines, selectedHoles, selectedItems, _i2, _i3, _i4, _props$onInternalEven2, _t5, _t6;
941
+ var evt, state, _evt$payload, cdsItems, itemKeys, _loop3, i, _props$onInternalEven, sLineCnt, element, _state$viewer2D, _evt$payload$initialP, mouseX, mouseY, v2d, vPosX, vPosY, layerID, _evt$payload5, moveType, moveValue, value, defaulTitle, _evt$payload6, doorStyle, itemCDS, isAll, _doorStyle, _value, _value2, layer, bb, w, h, viewer, _evt$payload7, moldingInfo, isGlobal, distElement, _distElement, _evt$payload8, option, _value3, layerId, _layer, _layer$getIn, selectedLines, selectedHoles, selectedItems, _i2, _i3, _i4, _props$onInternalEven2, _t5, _t6;
886
942
  return _regeneratorRuntime.wrap(function (_context8) {
887
943
  while (1) switch (_context8.prev = _context8.next) {
888
944
  case 0:
@@ -890,7 +946,7 @@ function _handleExternalEvent() {
890
946
  evt = props.externalEvent;
891
947
  state = props.state.get('KitchenConfigurator');
892
948
  _t5 = evt === null || evt === void 0 ? void 0 : evt.type;
893
- _context8.next = _t5 === EXTERNAL_EVENT_LOAD_PROJECT ? 1 : _t5 === EXTERNAL_EVENT_TOGGLE_TO_3D ? 5 : _t5 === EXTERNAL_EVENT_TOGGLE_TO_2D ? 6 : _t5 === EXTERNAL_EVENT_TOGGLE_TO_ELEVATION ? 7 : _t5 === EXTERNAL_EVENT_ADD_WALL ? 8 : _t5 === EXTERNAL_EVENT_ADD_ITEM ? 9 : _t5 === EXTERNAL_EVENT_ADD_HOLE ? 12 : _t5 === EXTERNAL_EVENT_MOVE_PAN ? 13 : _t5 === EXTERNAL_EVENT_NEW_PROJECT ? 19 : _t5 === EXTERNAL_EVENT_CHANGE_DOORSTYLE ? 20 : _t5 === EXTERNAL_EVENT_SET_INITIAL_DATA ? 21 : _t5 === EXTERNAL_EVENT_ADD_ROOM_SHAPE ? 22 : _t5 === EXTERNAL_EVENT_ZOOM_IN ? 23 : _t5 === EXTERNAL_EVENT_ZOOM_OUT ? 26 : _t5 === EXTERNAL_EVENT_UNDO ? 29 : _t5 === EXTERNAL_EVENT_REDO ? 30 : _t5 === EXTERNAL_EVENT_SET_MOLDING ? 31 : _t5 === EXTERNAL_EVENT_PROJECT_SETTING ? 32 : _t5 === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? 33 : _t5 === EXTERNAL_EVENT_UPDATE_PROPERTY ? 33 : _t5 === EXTERNAL_EVENT_SYNC_SCENE ? 34 : 35;
949
+ _context8.next = _t5 === EXTERNAL_EVENT_LOAD_PROJECT ? 1 : _t5 === EXTERNAL_EVENT_TOGGLE_TO_3D ? 5 : _t5 === EXTERNAL_EVENT_TOGGLE_TO_2D ? 6 : _t5 === EXTERNAL_EVENT_TOGGLE_TO_ELEVATION ? 7 : _t5 === EXTERNAL_EVENT_ADD_WALL ? 8 : _t5 === EXTERNAL_EVENT_ADD_ITEM ? 9 : _t5 === EXTERNAL_EVENT_ADD_HOLE ? 12 : _t5 === EXTERNAL_EVENT_MOVE_PAN ? 13 : _t5 === EXTERNAL_EVENT_NEW_PROJECT ? 19 : _t5 === EXTERNAL_EVENT_CHANGE_DOORSTYLE ? 20 : _t5 === EXTERNAL_EVENT_SET_INITIAL_DATA ? 21 : _t5 === EXTERNAL_EVENT_ADD_ROOM_SHAPE ? 22 : _t5 === EXTERNAL_EVENT_ZOOM_IN ? 23 : _t5 === EXTERNAL_EVENT_ZOOM_OUT ? 24 : _t5 === EXTERNAL_EVENT_CENTERING_2D ? 25 : _t5 === EXTERNAL_EVENT_UNDO ? 26 : _t5 === EXTERNAL_EVENT_REDO ? 27 : _t5 === EXTERNAL_EVENT_SET_MOLDING ? 28 : _t5 === EXTERNAL_EVENT_DUPLICATE_ELEMENT ? 29 : _t5 === EXTERNAL_EVENT_DELETE_ELEMENT ? 30 : _t5 === EXTERNAL_EVENT_PROJECT_SETTING ? 31 : _t5 === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? 32 : _t5 === EXTERNAL_EVENT_UPDATE_PROPERTY ? 32 : _t5 === EXTERNAL_EVENT_SYNC_SCENE ? 33 : 34;
894
950
  break;
895
951
  case 1:
896
952
  // prepare item data request
@@ -966,23 +1022,23 @@ function _handleExternalEvent() {
966
1022
  };
967
1023
  }());
968
1024
  }
969
- return _context8.abrupt("continue", 35);
1025
+ return _context8.abrupt("continue", 34);
970
1026
  case 5:
971
1027
  props.projectActions.setMode(MODE_IDLE_3D);
972
- return _context8.abrupt("continue", 35);
1028
+ return _context8.abrupt("continue", 34);
973
1029
  case 6:
974
1030
  props.projectActions.setMode(MODE_IDLE);
975
- return _context8.abrupt("continue", 35);
1031
+ return _context8.abrupt("continue", 34);
976
1032
  case 7:
977
1033
  sLineCnt = state.getIn(['scene', 'layers', 'layer-1', 'selected', 'lines']).size;
978
1034
  if (sLineCnt > 0) props.projectActions.setMode(MODE_ELEVATION_VIEW);
979
- return _context8.abrupt("continue", 35);
1035
+ return _context8.abrupt("continue", 34);
980
1036
  case 8:
981
1037
  if (state.mode === MODE_IDLE || state.mode === MODE_2D_PAN) props.linesActions.selectToolDrawingLine('wall');else {
982
1038
  props.projectActions.setMode(MODE_IDLE);
983
1039
  props.linesActions.selectToolDrawingLine('wall');
984
1040
  }
985
- return _context8.abrupt("continue", 35);
1041
+ return _context8.abrupt("continue", 34);
986
1042
  case 9:
987
1043
  if (isEmpty(evt === null || evt === void 0 ? void 0 : evt.payload)) {
988
1044
  _context8.next = 11;
@@ -1013,10 +1069,10 @@ function _handleExternalEvent() {
1013
1069
  props.projectActions.pushLastSelectedCatalogElementToHistory(element);
1014
1070
  props.projectActions.setIsCabinetDrawing(true);
1015
1071
  case 11:
1016
- return _context8.abrupt("continue", 35);
1072
+ return _context8.abrupt("continue", 34);
1017
1073
  case 12:
1018
1074
  ARRAY_3D_MODES.includes(state.mode) ? props.holesActions.selectToolDrawingHole3D(evt === null || evt === void 0 || (_evt$payload3 = evt.payload) === null || _evt$payload3 === void 0 ? void 0 : _evt$payload3.holeName) : props.holesActions.selectToolDrawingHole(evt === null || evt === void 0 || (_evt$payload4 = evt.payload) === null || _evt$payload4 === void 0 ? void 0 : _evt$payload4.holeName);
1019
- return _context8.abrupt("continue", 35);
1075
+ return _context8.abrupt("continue", 34);
1020
1076
  case 13:
1021
1077
  _evt$payload5 = evt.payload, moveType = _evt$payload5.moveType, moveValue = _evt$payload5.moveValue;
1022
1078
  value = state.getIn(['viewer2D']).toJS();
@@ -1036,89 +1092,86 @@ function _handleExternalEvent() {
1036
1092
  value.e -= moveValue;
1037
1093
  return _context8.abrupt("continue", 18);
1038
1094
  case 18:
1039
- if (compareSVGRect(value)) props.viewer2DActions.updateCameraView(value);
1040
- return _context8.abrupt("continue", 35);
1095
+ updateViwer2D(value, props.viewer2DActions);
1096
+ return _context8.abrupt("continue", 34);
1041
1097
  case 19:
1042
1098
  defaulTitle = 'Untitle';
1043
1099
  props.projectActions.newProject();
1044
1100
  props.projectActions.rename(defaulTitle);
1045
- return _context8.abrupt("continue", 35);
1101
+ return _context8.abrupt("continue", 34);
1046
1102
  case 20:
1047
1103
  _evt$payload6 = evt.payload, doorStyle = _evt$payload6.doorStyle, itemCDS = _evt$payload6.itemCDS, isAll = _evt$payload6.isAll;
1048
1104
  props.itemsActions.setDoorStyle(doorStyle, itemCDS, isAll);
1049
- return _context8.abrupt("continue", 35);
1105
+ return _context8.abrupt("continue", 34);
1050
1106
  case 21:
1051
1107
  _doorStyle = evt.payload.doorStyle;
1052
1108
  props.itemsActions.setInitialDoorStyle(_doorStyle.doorStyle);
1053
- return _context8.abrupt("continue", 35);
1109
+ return _context8.abrupt("continue", 34);
1054
1110
  case 22:
1055
1111
  props.projectActions.loadProject(evt.payload);
1056
- return _context8.abrupt("continue", 35);
1112
+ return _context8.abrupt("continue", 34);
1057
1113
  case 23:
1058
1114
  _value = state.getIn(['viewer2D']).toJS();
1059
- _value.a -= 0.1;
1060
- _value.d -= 0.1;
1061
- _value.e += _value.SVGWidth * 0.1 / 2;
1062
- _value.f += _value.SVGHeight * 0.1 / 2;
1063
- _zoomValue = parseInt((_value.a - 0.5) / ZOOM_VARIABLE);
1064
- if (!(_zoomValue > 404)) {
1065
- _context8.next = 24;
1066
- break;
1067
- }
1068
- return _context8.abrupt("return");
1115
+ _value.a += 0.1;
1116
+ _value.d += 0.1;
1117
+ _value.e -= _value.SVGWidth * 0.1 / 2;
1118
+ _value.f -= _value.SVGHeight * 0.1 / 2;
1119
+ updateViwer2D(_value, props.viewer2DActions);
1120
+ return _context8.abrupt("continue", 34);
1069
1121
  case 24:
1070
- if (!(_zoomValue < 35 || Number.isNaN(_zoomValue))) {
1071
- _context8.next = 25;
1072
- break;
1073
- }
1074
- return _context8.abrupt("return");
1122
+ _value2 = state.getIn(['viewer2D']).toJS();
1123
+ _value2.a -= 0.1;
1124
+ _value2.d -= 0.1;
1125
+ _value2.e += _value2.SVGWidth * 0.1 / 2;
1126
+ _value2.f += _value2.SVGHeight * 0.1 / 2;
1127
+ updateViwer2D(_value2, props.viewer2DActions);
1128
+ return _context8.abrupt("continue", 34);
1075
1129
  case 25:
1076
- while (!(_value.e <= 10)) {
1077
- _value.e -= 0.1;
1130
+ // calculate the bounding box of all elements in plan
1131
+ layer = state.scene.getIn(['layers', state.scene.selectedLayer]);
1132
+ bb = {
1133
+ minX: Infinity,
1134
+ maxX: -Infinity,
1135
+ minY: Infinity,
1136
+ maxY: -Infinity
1137
+ };
1138
+ bb = layer.vertices.reduce(function (pre, cur) {
1139
+ pre.minX = Math.min(pre.minX, cur.x);
1140
+ pre.maxX = Math.max(pre.maxX, cur.x);
1141
+ pre.minY = Math.min(pre.minY, cur.y);
1142
+ pre.maxY = Math.max(pre.maxY, cur.y);
1143
+ return pre;
1144
+ }, bb);
1145
+ w = bb.maxX - bb.minX;
1146
+ h = bb.maxY - bb.minY; // calc scale and offset to fit view
1147
+ viewer = state.getIn(['viewer2D']).toJS();
1148
+ if (w != 0 && Math.abs(w) != Infinity && h != 0 && Math.abs(h) != Infinity) {
1149
+ viewer.a = viewer.viewerHeight < h ? viewer.viewerHeight / h : viewer.viewerHeight / h * 3 / 5 / ZOOM_VARIABLE > 400 ? viewer.viewerHeight / h * 400 / (viewer.viewerHeight / h / ZOOM_VARIABLE) : viewer.viewerHeight / h * 3 / 5;
1150
+ viewer.d = viewer.a;
1151
+ viewer.e = (viewer.viewerWidth - (bb.maxX + bb.minX) * viewer.a) / 2;
1152
+ viewer.f = (viewer.viewerHeight - (bb.maxY + bb.minY) * viewer.a) / 2;
1153
+ updateViwer2D(viewer, props.viewer2DActions);
1078
1154
  }
1079
- while (!(_value.e + _value.a * _value.SVGWidth + 10 >= _value.viewerWidth)) {
1080
- _value.e += 0.1;
1081
- }
1082
- while (!(_value.f <= 80)) {
1083
- _value.f -= 0.1;
1084
- }
1085
- while (!(_value.f + _value.a * _value.SVGHeight + 10 >= _value.viewerHeight)) {
1086
- _value.f += 0.1;
1087
- }
1088
- if (compareSVGRect(_value)) props.viewer2DActions.updateCameraView(_value);
1089
- return _context8.abrupt("continue", 35);
1155
+ return _context8.abrupt("continue", 34);
1090
1156
  case 26:
1091
- _value2 = state.getIn(['viewer2D']).toJS();
1092
- _value2.a += 0.1;
1093
- _value2.d += 0.1;
1094
- _value2.e -= _value2.SVGWidth * 0.1 / 2;
1095
- _value2.f -= _value2.SVGHeight * 0.1 / 2;
1096
- _zoomValue2 = parseInt((_value2.a - 0.5) / ZOOM_VARIABLE);
1097
- if (!(_zoomValue2 > 404)) {
1098
- _context8.next = 27;
1099
- break;
1100
- }
1101
- return _context8.abrupt("return");
1157
+ props.projectActions.undo();
1158
+ return _context8.abrupt("continue", 34);
1102
1159
  case 27:
1103
- if (!(_zoomValue2 < 35 || Number.isNaN(_zoomValue2))) {
1104
- _context8.next = 28;
1105
- break;
1106
- }
1107
- return _context8.abrupt("return");
1160
+ props.projectActions.redo();
1161
+ return _context8.abrupt("continue", 34);
1108
1162
  case 28:
1109
- if (compareSVGRect(_value2)) props.viewer2DActions.updateCameraView(_value2);
1110
- return _context8.abrupt("continue", 35);
1163
+ _evt$payload7 = evt.payload, moldingInfo = _evt$payload7.moldingInfo, isGlobal = _evt$payload7.isGlobal;
1164
+ props.itemsActions.setMolding(moldingInfo, isGlobal);
1165
+ return _context8.abrupt("continue", 34);
1111
1166
  case 29:
1112
- props.projectActions.undo();
1113
- return _context8.abrupt("continue", 35);
1167
+ distElement = getElement(evt.payload, state);
1168
+ if (distElement) props.itemsActions.duplicateSelected(distElement);
1169
+ return _context8.abrupt("continue", 34);
1114
1170
  case 30:
1115
- props.projectActions.redo();
1116
- return _context8.abrupt("continue", 35);
1171
+ _distElement = getElement(evt.payload, state);
1172
+ if (_distElement) props.projectActions.remove(_distElement);
1173
+ return _context8.abrupt("continue", 34);
1117
1174
  case 31:
1118
- _evt$payload7 = evt.payload, moldingInfo = _evt$payload7.moldingInfo, isGlobal = _evt$payload7.isGlobal;
1119
- props.itemsActions.setMolding(moldingInfo, isGlobal);
1120
- return _context8.abrupt("continue", 35);
1121
- case 32:
1122
1175
  _evt$payload8 = evt.payload, option = _evt$payload8.option, _value3 = _evt$payload8.value;
1123
1176
  if (option === PROJECT_SETTING_OPTION.UPDATE_CEIL_HEIGHT) {
1124
1177
  props.viewer2DActions.updateCeilHeight(_value3);
@@ -1132,16 +1185,16 @@ function _handleExternalEvent() {
1132
1185
  } else if (option === PROJECT_SETTING_OPTION.CHANGE_WINDOW_DOOR_MEASURE) {
1133
1186
  props.viewer2DActions.changeWindowDoorMeasure(_value3);
1134
1187
  }
1135
- return _context8.abrupt("continue", 35);
1136
- case 33:
1188
+ return _context8.abrupt("continue", 34);
1189
+ case 32:
1137
1190
  layerId = state.getIn(['scene', 'selectedLayer']);
1138
- layer = state.getIn(['scene', 'layers', layerId]);
1139
- _layer$getIn = layer.getIn(['selected']), selectedLines = _layer$getIn.lines, selectedHoles = _layer$getIn.holes, selectedItems = _layer$getIn.items;
1140
- for (_i2 = 0; _i2 < selectedLines.size; _i2++) (evt === null || evt === void 0 ? void 0 : evt.type) === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(layer.getIn(['lines', selectedLines.get(_i2)]), evt.payload, state, layer, props.projectActions) : updatePropertyOfSelectedElement(layer.getIn(['lines', selectedLines.get(_i2)]), evt.payload, props.catalog, props.projectActions);
1141
- for (_i3 = 0; _i3 < selectedHoles.size; _i3++) (evt === null || evt === void 0 ? void 0 : evt.type) === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(layer.getIn(['holes', selectedHoles.get(_i3)]), evt.payload, state, layer, props.projectActions) : updatePropertyOfSelectedElement(layer.getIn(['holes', selectedHoles.get(_i3)]), evt.payload, props.catalog, props.projectActions);
1142
- for (_i4 = 0; _i4 < selectedItems.size; _i4++) (evt === null || evt === void 0 ? void 0 : evt.type) === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(layer.getIn(['items', selectedItems.get(_i4)]), evt.payload, state, layer, props.projectActions) : updatePropertyOfSelectedElement(layer.getIn(['items', selectedItems.get(_i4)]), evt.payload, props.catalog, props.projectActions);
1143
- return _context8.abrupt("continue", 35);
1144
- case 34:
1191
+ _layer = state.getIn(['scene', 'layers', layerId]);
1192
+ _layer$getIn = _layer.getIn(['selected']), selectedLines = _layer$getIn.lines, selectedHoles = _layer$getIn.holes, selectedItems = _layer$getIn.items;
1193
+ for (_i2 = 0; _i2 < selectedLines.size; _i2++) (evt === null || evt === void 0 ? void 0 : evt.type) === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(_layer.getIn(['lines', selectedLines.get(_i2)]), evt.payload, state, _layer, props.projectActions) : updatePropertyOfSelectedElement(_layer.getIn(['lines', selectedLines.get(_i2)]), evt.payload, props.catalog, props.projectActions);
1194
+ for (_i3 = 0; _i3 < selectedHoles.size; _i3++) (evt === null || evt === void 0 ? void 0 : evt.type) === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(_layer.getIn(['holes', selectedHoles.get(_i3)]), evt.payload, state, _layer, props.projectActions) : updatePropertyOfSelectedElement(_layer.getIn(['holes', selectedHoles.get(_i3)]), evt.payload, props.catalog, props.projectActions);
1195
+ for (_i4 = 0; _i4 < selectedItems.size; _i4++) (evt === null || evt === void 0 ? void 0 : evt.type) === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(_layer.getIn(['items', selectedItems.get(_i4)]), evt.payload, state, _layer, props.projectActions) : updatePropertyOfSelectedElement(_layer.getIn(['items', selectedItems.get(_i4)]), evt.payload, props.catalog, props.projectActions);
1196
+ return _context8.abrupt("continue", 34);
1197
+ case 33:
1145
1198
  // send scene object from 3DTool to HostApp using internalEvent
1146
1199
  (_props$onInternalEven2 = props.onInternalEvent) === null || _props$onInternalEven2 === void 0 || _props$onInternalEven2.call(props, {
1147
1200
  type: INTERNAL_EVENT_SYNC_SCENE,
@@ -1149,7 +1202,8 @@ function _handleExternalEvent() {
1149
1202
  scene: state.scene.toJS()
1150
1203
  }
1151
1204
  });
1152
- case 35:
1205
+ return _context8.abrupt("continue", 34);
1206
+ case 34:
1153
1207
  case "end":
1154
1208
  return _context8.stop();
1155
1209
  }
@@ -35,7 +35,7 @@ var _immutable = require("immutable");
35
35
  var Sentry = _interopRequireWildcard(require("@sentry/react"));
36
36
  var THREE = _interopRequireWildcard(require("three"));
37
37
  var _LiteKitchenConfigurator = _interopRequireDefault(require("./LiteKitchenConfigurator"));
38
- var _excluded = ["width", "height", "projectElement", "configData", "options", "user", "auth", "featureFlags", "sentry", "analytics", "externalEvent", "onInternalEvent", "onError"];
38
+ var _excluded = ["width", "height", "configData", "options", "user", "auth", "featureFlags", "sentry", "analytics", "externalEvent", "onInternalEvent", "onError"];
39
39
  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); }
40
40
  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; }
41
41
  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) { (0, _defineProperty2["default"])(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; }
@@ -148,7 +148,6 @@ var ToolErrorBoundary = /*#__PURE__*/function (_React$Component) {
148
148
  function LiteRenderer(props) {
149
149
  var width = props.width,
150
150
  height = props.height,
151
- projectElement = props.projectElement,
152
151
  configData = props.configData,
153
152
  options = props.options,
154
153
  user = props.user,
@@ -360,7 +359,6 @@ function LiteRenderer(props) {
360
359
  LiteRenderer.propTypes = {
361
360
  width: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]),
362
361
  height: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]),
363
- projectElement: _propTypes["default"].arrayOf(_propTypes["default"].object),
364
362
  configData: _propTypes["default"].any,
365
363
  catalog: _propTypes["default"].oneOfType([_propTypes["default"].object, _propTypes["default"].instanceOf(Models.Catalog)]),
366
364
  logoImg: _propTypes["default"].any,
@@ -150,8 +150,10 @@ function setHolesAttributes(holesAttributes) {
150
150
  };
151
151
  }
152
152
  function remove() {
153
+ var delObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
153
154
  return {
154
- type: _constants.REMOVE
155
+ type: _constants.REMOVE,
156
+ delObject: delObject
155
157
  };
156
158
  }
157
159
  function undo() {
@@ -27,7 +27,6 @@ function _default(_ref) {
27
27
  alti = _ref.alti,
28
28
  obj_property = _ref.obj_property,
29
29
  outlineSVGData = _ref.outlineSVGData,
30
- customer_property = _ref.customer_property,
31
30
  cds = _ref.cds;
32
31
  var _length = alti || 0;
33
32
  // const length = convert(_length).from("in").to("cm");
@@ -144,7 +143,6 @@ function _default(_ref) {
144
143
  img: base,
145
144
  obj: obj_property,
146
145
  cds: cds,
147
- customer_property: customer_property,
148
146
  render2D: function render2D(element, layer, scene) {
149
147
  return render2DItem.call(this, element, layer, scene, sizeinfo, layoutpos, is_corner, shape_svg);
150
148
  },