kitchen-simulator 4.0.2 → 4.0.3

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.
@@ -80,7 +80,7 @@ export function render2DItem(element, layer, scene, sizeinfo, layoutpos, is_corn
80
80
  el_is_euro_cds = _element.doorStyle.doorStyles.is_euro_cds;
81
81
  el_euro_shape_svg = _element.doorStyle.doorStyles.euro_shape_svg;
82
82
  }
83
- if (el_euro_length === undefined && el_euro_width === undefined) {
83
+ if (isEmpty(el_euro_length) && isEmpty(el_euro_width)) {
84
84
  el_DSN = 'el_DSN';
85
85
  }
86
86
  if (el_DSN === 'Euro & Frameless') {
@@ -437,20 +437,22 @@ export function render3DItem(element, layer, scene, sizeinfo, structure_json, is
437
437
  counterTop.uri = layer.toJS().counterTop.uri;
438
438
  }
439
439
  if ('name' in element.doorStyle) {
440
+ var _element2, _element3, _element4, _element5;
440
441
  doorStyles = new Map(element.doorStyle.doorStyles);
441
- color = element.doorStyle.color;
442
- glossness = element.doorStyle.glossness;
443
- handleMaterial.metalness = element.doorStyle.metalness;
444
- handleMaterial.roughness = element.doorStyle.roughness;
442
+ color = (_element2 = element) === null || _element2 === void 0 || (_element2 = _element2.doorStyle) === null || _element2 === void 0 ? void 0 : _element2.color;
443
+ glossness = (_element3 = element) === null || _element3 === void 0 || (_element3 = _element3.doorStyle) === null || _element3 === void 0 ? void 0 : _element3.glossness;
444
+ handleMaterial.metalness = (_element4 = element) === null || _element4 === void 0 || (_element4 = _element4.doorStyle) === null || _element4 === void 0 ? void 0 : _element4.metalness;
445
+ handleMaterial.roughness = (_element5 = element) === null || _element5 === void 0 || (_element5 = _element5.doorStyle) === null || _element5 === void 0 ? void 0 : _element5.roughness;
445
446
  } else if (element.doorStyle != null && element.doorStyle) {
446
- doorStyles = element.doorStyle.get('doorStyles');
447
- color = element.doorStyle.get('color');
448
- glossness = element.doorStyle.get('glossness');
449
- handleMaterial.metalness = element.doorStyle.get('metalness');
450
- handleMaterial.roughness = element.doorStyle.get('roughness');
447
+ var _element6, _element7, _element8, _element9, _element0;
448
+ doorStyles = (_element6 = element) === null || _element6 === void 0 || (_element6 = _element6.doorStyle) === null || _element6 === void 0 ? void 0 : _element6.get('doorStyles');
449
+ color = (_element7 = element) === null || _element7 === void 0 || (_element7 = _element7.doorStyle) === null || _element7 === void 0 ? void 0 : _element7.get('color');
450
+ glossness = (_element8 = element) === null || _element8 === void 0 || (_element8 = _element8.doorStyle) === null || _element8 === void 0 ? void 0 : _element8.get('glossness');
451
+ handleMaterial.metalness = (_element9 = element) === null || _element9 === void 0 || (_element9 = _element9.doorStyle) === null || _element9 === void 0 ? void 0 : _element9.get('metalness');
452
+ handleMaterial.roughness = (_element0 = element) === null || _element0 === void 0 || (_element0 = _element0.doorStyle) === null || _element0 === void 0 ? void 0 : _element0.get('roughness');
451
453
  }
452
- if (color === undefined) color = '#ffffff';
453
- if (glossness === undefined) glossness = 1;
454
+ if (isEmpty(color)) color = '#ffffff';
455
+ if (isEmpty(glossness)) glossness = 1;
454
456
  var tempDoorStyles = doorStyles.toJS();
455
457
  var tempPlaceholders = structure.tempPlaceholders;
456
458
  var tPlaceholders = tempPlaceholders.find(function (el) {
@@ -997,8 +999,9 @@ export function render3DItem(element, layer, scene, sizeinfo, structure_json, is
997
999
  object.receiveShadow = true;
998
1000
  objGroup = object;
999
1001
  if (!isEmpty(doorStyles)) {
1002
+ var _layer$toJS;
1000
1003
  var normalMap = doorStyles.get('base') || INITIAL_NORMAL_MAP;
1001
- if (counterTop.uri === undefined) {
1004
+ if (isEmpty(counterTop.uri)) {
1002
1005
  try {
1003
1006
  counterTop = counterTop.toJS();
1004
1007
  } catch (error) {
@@ -1007,7 +1010,7 @@ export function render3DItem(element, layer, scene, sizeinfo, structure_json, is
1007
1010
  console.log(error);
1008
1011
  }
1009
1012
  }
1010
- if (counterTop.uri === undefined && layer.toJS().counterTop.uri !== undefined) {
1013
+ if (isEmpty(counterTop.uri) && !isEmpty(layer === null || layer === void 0 || (_layer$toJS = layer.toJS()) === null || _layer$toJS === void 0 ? void 0 : _layer$toJS.counterTop.uri)) {
1011
1014
  counterTop.uri = layer.toJS().counterTop.uri;
1012
1015
  }
1013
1016
  var countTopMap = counterTop.uri;
package/es/class/item.js CHANGED
@@ -169,7 +169,7 @@ var Item = /*#__PURE__*/function () {
169
169
  }
170
170
  };
171
171
  item.category === 'cabinet' && setSizeOfItemByDoorStyle();
172
- if (counterTopURI || (_item = item) !== null && _item !== void 0 && _item.counterTop) {
172
+ if (!isEmpty(counterTopURI) && !isEmpty((_item = item) === null || _item === void 0 ? void 0 : _item.counterTop)) {
173
173
  item.counterTop.uri = counterTopURI;
174
174
  }
175
175
  item = this.updateDoorHandle(item, state.getIn(['scene', 'layers', layerID]));
@@ -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'] === undefined) {
35
+ if (isEmpty(a['index'])) {
35
36
  return a.get('index') === index;
36
- } else if (a['index'] !== undefined) {
37
+ } else {
37
38
  return a.index === index;
38
39
  }
39
40
  }).get(0);
@@ -3451,16 +3451,21 @@ export function updateMoldingGroupArray(MGArray, selItem, planData, layer) {
3451
3451
  if (changeMoldings.length === 0 && isEnableMolding) {
3452
3452
  // refresh mesh of the updating molding groups
3453
3453
  new_MGArray.forEach(function (mg, index) {
3454
- if (mg.items[0].molding.some(function (mol) {
3455
- return isImmutable(mol) ? mol.toJS().location_type === mg.location_type : mol.location_type === mg.location_type;
3454
+ var _mg$items$;
3455
+ if ((_mg$items$ = mg.items[0]) !== null && _mg$items$ !== void 0 && (_mg$items$ = _mg$items$.molding) !== null && _mg$items$ !== void 0 && _mg$items$.some(function (mol) {
3456
+ var _mol$toJS;
3457
+ return isImmutable(mol) ? (mol === null || mol === void 0 || (_mol$toJS = mol.toJS()) === null || _mol$toJS === void 0 ? void 0 : _mol$toJS.location_type) === mg.location_type : (mol === null || mol === void 0 ? void 0 : mol.location_type) === mg.location_type;
3456
3458
  })) {
3457
- var molding = isImmutable(mg.items[0].molding) ? mg.items[0].molding.filter(function (mol) {
3458
- return mol.toJS().location_type === mg.location_type;
3459
- }).toJS()[0] : mg.items[0].molding.filter(function (mol) {
3460
- return mol.location_type === mg.location_type;
3459
+ var _mg$items$2, _mg$items$3, _mg$items$4;
3460
+ var molding = isImmutable((_mg$items$2 = mg.items[0]) === null || _mg$items$2 === void 0 ? void 0 : _mg$items$2.molding) ? (_mg$items$3 = mg.items[0]) === null || _mg$items$3 === void 0 || (_mg$items$3 = _mg$items$3.molding) === null || _mg$items$3 === void 0 ? void 0 : _mg$items$3.filter(function (mol) {
3461
+ var _mol$toJS2;
3462
+ return (mol === null || mol === void 0 || (_mol$toJS2 = mol.toJS()) === null || _mol$toJS2 === void 0 ? void 0 : _mol$toJS2.location_type) === mg.location_type;
3463
+ }).toJS()[0] : (_mg$items$4 = mg.items[0]) === null || _mg$items$4 === void 0 || (_mg$items$4 = _mg$items$4.molding) === null || _mg$items$4 === void 0 ? void 0 : _mg$items$4.filter(function (mol) {
3464
+ return (mol === null || mol === void 0 ? void 0 : mol.location_type) === mg.location_type;
3461
3465
  })[0];
3462
3466
  if (mg.molding === null || mg.molding.itemID !== mol.itemID || mg.lines === null || mg.points === null) {
3463
- if (mg.molding !== null && mg.molding.itemID !== molding.itemID) {
3467
+ var _mg$molding;
3468
+ if (mg.molding !== null && ((_mg$molding = mg.molding) === null || _mg$molding === void 0 ? void 0 : _mg$molding.itemID) !== molding.itemID) {
3464
3469
  deleteMGMesh(mg, planData, mode);
3465
3470
  }
3466
3471
  mg = MoldingUtils.createMonldingGroup(mg, layer, molding, planData.catalog);
@@ -846,12 +846,12 @@ function WorkSpace(props) {
846
846
  type: EXTERNAL_EVENT_PROJECT_SETTING,
847
847
  payload: {
848
848
  option: PROJECT_SETTING_OPTION.CHANGE_MEASUREMENT_UNIT,
849
- value: 'cm'
849
+ value: 'mm'
850
850
  }
851
851
  };
852
852
  setExternalEvent(evt);
853
853
  }
854
- }, "Setting-MeasurementUnit-'cm'")), /*#__PURE__*/React.createElement(LiteRenderer, {
854
+ }, "Setting-MeasurementUnit-'mm'")), /*#__PURE__*/React.createElement(LiteRenderer, {
855
855
  width: props.width,
856
856
  height: props.height,
857
857
  configData: mockProps.configData,
@@ -2063,20 +2063,20 @@ export function relationshipOfTwoOverlappedLines(srcLine, destLine) {
2063
2063
  }
2064
2064
  export function relationshipOfTwoOverlappedLines2(srcLine, destLine) {
2065
2065
  var p1 = {
2066
- x: srcLine.x1,
2067
- y: srcLine.y1
2066
+ x: Math.round(srcLine.x1 * 100) / 100,
2067
+ y: Math.round(srcLine.y1 * 100) / 100
2068
2068
  };
2069
2069
  var p2 = {
2070
- x: srcLine.x2,
2071
- y: srcLine.y2
2070
+ x: Math.round(srcLine.x2 * 100) / 100,
2071
+ y: Math.round(srcLine.y2 * 100) / 100
2072
2072
  };
2073
2073
  var p3 = {
2074
- x: destLine.x1,
2075
- y: destLine.y1
2074
+ x: Math.round(destLine.x1 * 100) / 100,
2075
+ y: Math.round(destLine.y1 * 100) / 100
2076
2076
  };
2077
2077
  var p4 = {
2078
- x: destLine.x2,
2079
- y: destLine.y2
2078
+ x: Math.round(destLine.x2 * 100) / 100,
2079
+ y: Math.round(destLine.y2 * 100) / 100
2080
2080
  };
2081
2081
  var x1 = p1.x,
2082
2082
  y1 = p1.y;
@@ -1261,13 +1261,13 @@ function _handleExternalEvent() {
1261
1261
  cdsItems = [];
1262
1262
  itemKeys = Object.keys(evt === null || evt === void 0 || (_evt$payload = evt.payload) === null || _evt$payload === void 0 || (_evt$payload = _evt$payload.layers['layer-1']) === null || _evt$payload === void 0 ? void 0 : _evt$payload.items) || [];
1263
1263
  _loop6 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop6() {
1264
- var _evt$payload2, _it$doorStyle2;
1264
+ var _evt$payload2, _it$properties, _it$properties2, _it$properties3, _it$doorStyle2;
1265
1265
  var it;
1266
1266
  return _regeneratorRuntime.wrap(function (_context0) {
1267
1267
  while (1) switch (_context0.prev = _context0.next) {
1268
1268
  case 0:
1269
1269
  it = evt === null || evt === void 0 || (_evt$payload2 = evt.payload) === null || _evt$payload2 === void 0 || (_evt$payload2 = _evt$payload2.layers['layer-1']) === null || _evt$payload2 === void 0 ? void 0 : _evt$payload2.items[itemKeys[i]]; //////// check altitude of item property and change length from _length (convert length from 'in' fo 'cm')
1270
- if (it.properties.altitude.length !== convert(it.properties.altitude._length).from(it.properties.altitude._unit).to('cm')) {
1270
+ if (it !== null && it !== void 0 && (_it$properties = it.properties) !== null && _it$properties !== void 0 && (_it$properties = _it$properties.altitude) !== null && _it$properties !== void 0 && _it$properties.length && it !== null && it !== void 0 && (_it$properties2 = it.properties) !== null && _it$properties2 !== void 0 && (_it$properties2 = _it$properties2.altitude) !== null && _it$properties2 !== void 0 && _it$properties2._unit && it !== null && it !== void 0 && (_it$properties3 = it.properties) !== null && _it$properties3 !== void 0 && (_it$properties3 = _it$properties3.altitude) !== null && _it$properties3 !== void 0 && _it$properties3._length && it.properties.altitude.length !== convert(it.properties.altitude._length).from(it.properties.altitude._unit).to('cm')) {
1271
1271
  it.properties.altitude.length = convert(it.properties.altitude._length).from(it.properties.altitude._unit).to('cm');
1272
1272
  }
1273
1273
  /////////
@@ -1545,6 +1545,7 @@ function _handleExternalEvent() {
1545
1545
  props.viewer2DActions.updateCeilHeightUnit(_value2);
1546
1546
  props.viewer3DActions.update3DCeilHeightUnit(_value2);
1547
1547
  props.viewer3DActions.update3DCeilHeight(convert(layer.ceilHeight).from(layer.unit).to(_value2));
1548
+ return _context11.abrupt("continue", 39);
1548
1549
  case 33:
1549
1550
  props.viewer2DActions.updateCeilHeight(_value2);
1550
1551
  props.viewer3DActions.update3DCeilHeight(_value2);
@@ -94,7 +94,7 @@ function render2DItem(element, layer, scene, sizeinfo, layoutpos, is_corner, sha
94
94
  el_is_euro_cds = _element.doorStyle.doorStyles.is_euro_cds;
95
95
  el_euro_shape_svg = _element.doorStyle.doorStyles.euro_shape_svg;
96
96
  }
97
- if (el_euro_length === undefined && el_euro_width === undefined) {
97
+ if ((0, _helper.isEmpty)(el_euro_length) && (0, _helper.isEmpty)(el_euro_width)) {
98
98
  el_DSN = 'el_DSN';
99
99
  }
100
100
  if (el_DSN === 'Euro & Frameless') {
@@ -451,20 +451,22 @@ function render3DItem(element, layer, scene, sizeinfo, structure_json, is_corner
451
451
  counterTop.uri = layer.toJS().counterTop.uri;
452
452
  }
453
453
  if ('name' in element.doorStyle) {
454
+ var _element2, _element3, _element4, _element5;
454
455
  doorStyles = new _immutable.Map(element.doorStyle.doorStyles);
455
- color = element.doorStyle.color;
456
- glossness = element.doorStyle.glossness;
457
- handleMaterial.metalness = element.doorStyle.metalness;
458
- handleMaterial.roughness = element.doorStyle.roughness;
456
+ color = (_element2 = element) === null || _element2 === void 0 || (_element2 = _element2.doorStyle) === null || _element2 === void 0 ? void 0 : _element2.color;
457
+ glossness = (_element3 = element) === null || _element3 === void 0 || (_element3 = _element3.doorStyle) === null || _element3 === void 0 ? void 0 : _element3.glossness;
458
+ handleMaterial.metalness = (_element4 = element) === null || _element4 === void 0 || (_element4 = _element4.doorStyle) === null || _element4 === void 0 ? void 0 : _element4.metalness;
459
+ handleMaterial.roughness = (_element5 = element) === null || _element5 === void 0 || (_element5 = _element5.doorStyle) === null || _element5 === void 0 ? void 0 : _element5.roughness;
459
460
  } else if (element.doorStyle != null && element.doorStyle) {
460
- doorStyles = element.doorStyle.get('doorStyles');
461
- color = element.doorStyle.get('color');
462
- glossness = element.doorStyle.get('glossness');
463
- handleMaterial.metalness = element.doorStyle.get('metalness');
464
- handleMaterial.roughness = element.doorStyle.get('roughness');
461
+ var _element6, _element7, _element8, _element9, _element0;
462
+ doorStyles = (_element6 = element) === null || _element6 === void 0 || (_element6 = _element6.doorStyle) === null || _element6 === void 0 ? void 0 : _element6.get('doorStyles');
463
+ color = (_element7 = element) === null || _element7 === void 0 || (_element7 = _element7.doorStyle) === null || _element7 === void 0 ? void 0 : _element7.get('color');
464
+ glossness = (_element8 = element) === null || _element8 === void 0 || (_element8 = _element8.doorStyle) === null || _element8 === void 0 ? void 0 : _element8.get('glossness');
465
+ handleMaterial.metalness = (_element9 = element) === null || _element9 === void 0 || (_element9 = _element9.doorStyle) === null || _element9 === void 0 ? void 0 : _element9.get('metalness');
466
+ handleMaterial.roughness = (_element0 = element) === null || _element0 === void 0 || (_element0 = _element0.doorStyle) === null || _element0 === void 0 ? void 0 : _element0.get('roughness');
465
467
  }
466
- if (color === undefined) color = '#ffffff';
467
- if (glossness === undefined) glossness = 1;
468
+ if ((0, _helper.isEmpty)(color)) color = '#ffffff';
469
+ if ((0, _helper.isEmpty)(glossness)) glossness = 1;
468
470
  var tempDoorStyles = doorStyles.toJS();
469
471
  var tempPlaceholders = structure.tempPlaceholders;
470
472
  var tPlaceholders = tempPlaceholders.find(function (el) {
@@ -1011,8 +1013,9 @@ function render3DItem(element, layer, scene, sizeinfo, structure_json, is_corner
1011
1013
  object.receiveShadow = true;
1012
1014
  objGroup = object;
1013
1015
  if (!(0, _helper.isEmpty)(doorStyles)) {
1016
+ var _layer$toJS;
1014
1017
  var normalMap = doorStyles.get('base') || INITIAL_NORMAL_MAP;
1015
- if (counterTop.uri === undefined) {
1018
+ if ((0, _helper.isEmpty)(counterTop.uri)) {
1016
1019
  try {
1017
1020
  counterTop = counterTop.toJS();
1018
1021
  } catch (error) {
@@ -1021,7 +1024,7 @@ function render3DItem(element, layer, scene, sizeinfo, structure_json, is_corner
1021
1024
  console.log(error);
1022
1025
  }
1023
1026
  }
1024
- if (counterTop.uri === undefined && layer.toJS().counterTop.uri !== undefined) {
1027
+ if ((0, _helper.isEmpty)(counterTop.uri) && !(0, _helper.isEmpty)(layer === null || layer === void 0 || (_layer$toJS = layer.toJS()) === null || _layer$toJS === void 0 ? void 0 : _layer$toJS.counterTop.uri)) {
1025
1028
  counterTop.uri = layer.toJS().counterTop.uri;
1026
1029
  }
1027
1030
  var countTopMap = counterTop.uri;
package/lib/class/item.js CHANGED
@@ -176,7 +176,7 @@ var Item = exports["default"] = /*#__PURE__*/function () {
176
176
  }
177
177
  };
178
178
  item.category === 'cabinet' && setSizeOfItemByDoorStyle();
179
- if (counterTopURI || (_item = item) !== null && _item !== void 0 && _item.counterTop) {
179
+ if (!(0, _utils.isEmpty)(counterTopURI) && !(0, _utils.isEmpty)((_item = item) === null || _item === void 0 ? void 0 : _item.counterTop)) {
180
180
  item.counterTop.uri = counterTopURI;
181
181
  }
182
182
  item = this.updateDoorHandle(item, state.getIn(['scene', 'layers', layerID]));
@@ -9,6 +9,7 @@ exports["default"] = Vertex;
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
  var SharedStyle = _interopRequireWildcard(require("../../shared-style"));
12
+ var _utils = require("./utils");
12
13
  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); }
13
14
  //Space from the center of the point(Use cases:x - vertexthickness,y + vertexthickness )
14
15
  var vertexthickness = 4;
@@ -40,9 +41,9 @@ function Vertex(_ref) {
40
41
  });
41
42
  if (index > -1) {
42
43
  var vertice = line.relatedVertices.filter(function (a) {
43
- if (a['index'] === undefined) {
44
+ if ((0, _utils.isEmpty)(a['index'])) {
44
45
  return a.get('index') === index;
45
- } else if (a['index'] !== undefined) {
46
+ } else {
46
47
  return a.index === index;
47
48
  }
48
49
  }).get(0);
@@ -3486,16 +3486,21 @@ function updateMoldingGroupArray(MGArray, selItem, planData, layer) {
3486
3486
  if (changeMoldings.length === 0 && isEnableMolding) {
3487
3487
  // refresh mesh of the updating molding groups
3488
3488
  new_MGArray.forEach(function (mg, index) {
3489
- if (mg.items[0].molding.some(function (mol) {
3490
- return (0, _helper.isImmutable)(mol) ? mol.toJS().location_type === mg.location_type : mol.location_type === mg.location_type;
3489
+ var _mg$items$;
3490
+ if ((_mg$items$ = mg.items[0]) !== null && _mg$items$ !== void 0 && (_mg$items$ = _mg$items$.molding) !== null && _mg$items$ !== void 0 && _mg$items$.some(function (mol) {
3491
+ var _mol$toJS;
3492
+ return (0, _helper.isImmutable)(mol) ? (mol === null || mol === void 0 || (_mol$toJS = mol.toJS()) === null || _mol$toJS === void 0 ? void 0 : _mol$toJS.location_type) === mg.location_type : (mol === null || mol === void 0 ? void 0 : mol.location_type) === mg.location_type;
3491
3493
  })) {
3492
- var molding = (0, _helper.isImmutable)(mg.items[0].molding) ? mg.items[0].molding.filter(function (mol) {
3493
- return mol.toJS().location_type === mg.location_type;
3494
- }).toJS()[0] : mg.items[0].molding.filter(function (mol) {
3495
- return mol.location_type === mg.location_type;
3494
+ var _mg$items$2, _mg$items$3, _mg$items$4;
3495
+ var molding = (0, _helper.isImmutable)((_mg$items$2 = mg.items[0]) === null || _mg$items$2 === void 0 ? void 0 : _mg$items$2.molding) ? (_mg$items$3 = mg.items[0]) === null || _mg$items$3 === void 0 || (_mg$items$3 = _mg$items$3.molding) === null || _mg$items$3 === void 0 ? void 0 : _mg$items$3.filter(function (mol) {
3496
+ var _mol$toJS2;
3497
+ return (mol === null || mol === void 0 || (_mol$toJS2 = mol.toJS()) === null || _mol$toJS2 === void 0 ? void 0 : _mol$toJS2.location_type) === mg.location_type;
3498
+ }).toJS()[0] : (_mg$items$4 = mg.items[0]) === null || _mg$items$4 === void 0 || (_mg$items$4 = _mg$items$4.molding) === null || _mg$items$4 === void 0 ? void 0 : _mg$items$4.filter(function (mol) {
3499
+ return (mol === null || mol === void 0 ? void 0 : mol.location_type) === mg.location_type;
3496
3500
  })[0];
3497
3501
  if (mg.molding === null || mg.molding.itemID !== mol.itemID || mg.lines === null || mg.points === null) {
3498
- if (mg.molding !== null && mg.molding.itemID !== molding.itemID) {
3502
+ var _mg$molding;
3503
+ if (mg.molding !== null && ((_mg$molding = mg.molding) === null || _mg$molding === void 0 ? void 0 : _mg$molding.itemID) !== molding.itemID) {
3499
3504
  deleteMGMesh(mg, planData, mode);
3500
3505
  }
3501
3506
  mg = _export.MoldingUtils.createMonldingGroup(mg, layer, molding, planData.catalog);
@@ -850,12 +850,12 @@ function WorkSpace(props) {
850
850
  type: _constants.EXTERNAL_EVENT_PROJECT_SETTING,
851
851
  payload: {
852
852
  option: _constants.PROJECT_SETTING_OPTION.CHANGE_MEASUREMENT_UNIT,
853
- value: 'cm'
853
+ value: 'mm'
854
854
  }
855
855
  };
856
856
  setExternalEvent(evt);
857
857
  }
858
- }, "Setting-MeasurementUnit-'cm'")), /*#__PURE__*/_react["default"].createElement(_LiteRenderer["default"], {
858
+ }, "Setting-MeasurementUnit-'mm'")), /*#__PURE__*/_react["default"].createElement(_LiteRenderer["default"], {
859
859
  width: props.width,
860
860
  height: props.height,
861
861
  configData: _mockProps["default"].configData,
@@ -2163,20 +2163,20 @@ function relationshipOfTwoOverlappedLines(srcLine, destLine) {
2163
2163
  }
2164
2164
  function relationshipOfTwoOverlappedLines2(srcLine, destLine) {
2165
2165
  var p1 = {
2166
- x: srcLine.x1,
2167
- y: srcLine.y1
2166
+ x: Math.round(srcLine.x1 * 100) / 100,
2167
+ y: Math.round(srcLine.y1 * 100) / 100
2168
2168
  };
2169
2169
  var p2 = {
2170
- x: srcLine.x2,
2171
- y: srcLine.y2
2170
+ x: Math.round(srcLine.x2 * 100) / 100,
2171
+ y: Math.round(srcLine.y2 * 100) / 100
2172
2172
  };
2173
2173
  var p3 = {
2174
- x: destLine.x1,
2175
- y: destLine.y1
2174
+ x: Math.round(destLine.x1 * 100) / 100,
2175
+ y: Math.round(destLine.y1 * 100) / 100
2176
2176
  };
2177
2177
  var p4 = {
2178
- x: destLine.x2,
2179
- y: destLine.y2
2178
+ x: Math.round(destLine.x2 * 100) / 100,
2179
+ y: Math.round(destLine.y2 * 100) / 100
2180
2180
  };
2181
2181
  var x1 = p1.x,
2182
2182
  y1 = p1.y;
@@ -1269,13 +1269,13 @@ function _handleExternalEvent() {
1269
1269
  cdsItems = [];
1270
1270
  itemKeys = Object.keys(evt === null || evt === void 0 || (_evt$payload = evt.payload) === null || _evt$payload === void 0 || (_evt$payload = _evt$payload.layers['layer-1']) === null || _evt$payload === void 0 ? void 0 : _evt$payload.items) || [];
1271
1271
  _loop6 = /*#__PURE__*/_regenerator["default"].mark(function _loop6() {
1272
- var _evt$payload2, _it$doorStyle2;
1272
+ var _evt$payload2, _it$properties, _it$properties2, _it$properties3, _it$doorStyle2;
1273
1273
  var it;
1274
1274
  return _regenerator["default"].wrap(function (_context0) {
1275
1275
  while (1) switch (_context0.prev = _context0.next) {
1276
1276
  case 0:
1277
1277
  it = evt === null || evt === void 0 || (_evt$payload2 = evt.payload) === null || _evt$payload2 === void 0 || (_evt$payload2 = _evt$payload2.layers['layer-1']) === null || _evt$payload2 === void 0 ? void 0 : _evt$payload2.items[itemKeys[i]]; //////// check altitude of item property and change length from _length (convert length from 'in' fo 'cm')
1278
- if (it.properties.altitude.length !== (0, _convertUnitsLite.convert)(it.properties.altitude._length).from(it.properties.altitude._unit).to('cm')) {
1278
+ if (it !== null && it !== void 0 && (_it$properties = it.properties) !== null && _it$properties !== void 0 && (_it$properties = _it$properties.altitude) !== null && _it$properties !== void 0 && _it$properties.length && it !== null && it !== void 0 && (_it$properties2 = it.properties) !== null && _it$properties2 !== void 0 && (_it$properties2 = _it$properties2.altitude) !== null && _it$properties2 !== void 0 && _it$properties2._unit && it !== null && it !== void 0 && (_it$properties3 = it.properties) !== null && _it$properties3 !== void 0 && (_it$properties3 = _it$properties3.altitude) !== null && _it$properties3 !== void 0 && _it$properties3._length && it.properties.altitude.length !== (0, _convertUnitsLite.convert)(it.properties.altitude._length).from(it.properties.altitude._unit).to('cm')) {
1279
1279
  it.properties.altitude.length = (0, _convertUnitsLite.convert)(it.properties.altitude._length).from(it.properties.altitude._unit).to('cm');
1280
1280
  }
1281
1281
  /////////
@@ -1553,6 +1553,7 @@ function _handleExternalEvent() {
1553
1553
  props.viewer2DActions.updateCeilHeightUnit(_value2);
1554
1554
  props.viewer3DActions.update3DCeilHeightUnit(_value2);
1555
1555
  props.viewer3DActions.update3DCeilHeight((0, _convertUnitsLite.convert)(layer.ceilHeight).from(layer.unit).to(_value2));
1556
+ return _context11.abrupt("continue", 39);
1556
1557
  case 33:
1557
1558
  props.viewer2DActions.updateCeilHeight(_value2);
1558
1559
  props.viewer3DActions.update3DCeilHeight(_value2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitchen-simulator",
3
- "version": "4.0.2",
3
+ "version": "4.0.3",
4
4
  "description": "It is a kitchen simulator (self-contained micro-frontend).",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",