kitchen-simulator 11.15.0 → 11.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
3
3
  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; }
4
4
  import { convert } from "../../utils/convert-units-lite";
5
5
  export default function (_ref) {
6
+ var _long_name$toLowerCas, _long_name$toLowerCas2;
6
7
  var itemID = _ref.itemID,
7
8
  type = _ref.type,
8
9
  long_name = _ref.long_name,
@@ -37,7 +38,7 @@ export default function (_ref) {
37
38
  // const length = _length;
38
39
 
39
40
  var additional_props = [];
40
- if (type === 'cabinet' && long_name.toLowerCase().includes('filler')) {
41
+ if (type === 'cabinet' && long_name !== null && long_name !== void 0 && (_long_name$toLowerCas = long_name.toLowerCase()) !== null && _long_name$toLowerCas !== void 0 && _long_name$toLowerCas.includes('filler')) {
41
42
  additional_props = {
42
43
  width: {
43
44
  label: 'Width',
@@ -50,7 +51,7 @@ export default function (_ref) {
50
51
  }
51
52
  };
52
53
  }
53
- if (type === 'appliance' || type === 'furnishing' || type === 'cabinet' && long_name.toLowerCase().includes('panel')) {
54
+ if (type === 'appliance' || type === 'furnishing' || type === 'cabinet' && long_name !== null && long_name !== void 0 && (_long_name$toLowerCas2 = long_name.toLowerCase()) !== null && _long_name$toLowerCas2 !== void 0 && _long_name$toLowerCas2.includes('panel')) {
54
55
  additional_props = {
55
56
  width: {
56
57
  label: 'Width',
@@ -94,9 +95,9 @@ export default function (_ref) {
94
95
  tag: ['furnishing', 'electronics'],
95
96
  description: description,
96
97
  image: base,
97
- door: obj_property.door_style,
98
- doorcategory: obj_property.door_category,
99
- has_single_door: obj_property.has_single_door,
98
+ door: obj_property === null || obj_property === void 0 ? void 0 : obj_property.door_style,
99
+ doorcategory: obj_property === null || obj_property === void 0 ? void 0 : obj_property.door_category,
100
+ has_single_door: obj_property === null || obj_property === void 0 ? void 0 : obj_property.has_single_door,
100
101
  sizeinfo: sizeinfo,
101
102
  layoutpos: layoutpos,
102
103
  is_corner: is_corner,
@@ -26,6 +26,7 @@ export function ccdfMapper(ccdf_list, layer) {
26
26
  }
27
27
  var cd = layerJS.items[correctItemId];
28
28
  if (cd && !!(ccdf !== null && ccdf !== void 0 && ccdf.scene_cabinet_id) && (cd === null || cd === void 0 ? void 0 : cd.id) === ccdf.scene_cabinet_id) {
29
+ var _ccdf$cabinet_id, _cd$long_name, _cd$sizeinfo, _cd$shape_svg;
29
30
  if (!isEmpty(ccdf === null || ccdf === void 0 ? void 0 : ccdf.id)) {
30
31
  cdfId = ccdf.id;
31
32
  }
@@ -75,15 +76,16 @@ export function ccdfMapper(ccdf_list, layer) {
75
76
  // make cabinet definition using structure_json and catalog
76
77
  cabinetDefinition = {
77
78
  type: cd.category,
78
- itemID: cd.itemID,
79
+ itemID: (_ccdf$cabinet_id = ccdf === null || ccdf === void 0 ? void 0 : ccdf.cabinet_id) !== null && _ccdf$cabinet_id !== void 0 ? _ccdf$cabinet_id : cd.itemID,
80
+ // cd.itemID may be legacy from legacy project, so ccdf.cabinet_id is preferred if exists
79
81
  name: cd.name,
80
- long_name: cd.long_name,
81
- sizeinfo: cd.sizeinfo,
82
+ long_name: (_cd$long_name = cd.long_name) !== null && _cd$long_name !== void 0 ? _cd$long_name : ccdf === null || ccdf === void 0 ? void 0 : ccdf.long_name,
83
+ sizeinfo: (_cd$sizeinfo = cd.sizeinfo) !== null && _cd$sizeinfo !== void 0 ? _cd$sizeinfo : ccdf === null || ccdf === void 0 ? void 0 : ccdf.sizeinfo,
82
84
  description: cd.description,
83
85
  prototype: cd.prototype,
84
86
  base: cd.base,
85
87
  ccdf: cd.ccdf,
86
- shape_svg: cd.shape_svg,
88
+ shape_svg: (_cd$shape_svg = cd.shape_svg) !== null && _cd$shape_svg !== void 0 ? _cd$shape_svg : ccdf === null || ccdf === void 0 ? void 0 : ccdf.shape_svg,
87
89
  // If host provides cabinet base gltf/bin at CCDF top-level, prefer it.
88
90
  gltf: (ccdf === null || ccdf === void 0 ? void 0 : ccdf.gltf) || cd.gltf,
89
91
  bin: (ccdf === null || ccdf === void 0 ? void 0 : ccdf.bin) || (cd === null || cd === void 0 ? void 0 : cd.bin),
@@ -579,15 +579,15 @@ export function computeSkinPanels(layer) {
579
579
  var _collectLayerItems = collectLayerItems(layer),
580
580
  skinPanelItems = _collectLayerItems.skinPanelItems,
581
581
  otherItems = _collectLayerItems.otherItems;
582
- var filteredSkinPanelItems = skinPanelItems.filter(function (item) {
583
- return !shouldExcludeSkinPanel(item.toJS(), exclusionSet);
584
- });
585
582
 
586
583
  // Get all skin face list of [skinPanelItems] & [otherItems]
587
- var skinFaces = collectFaces(filteredSkinPanelItems, layer);
584
+ var skinFaces = collectFaces(skinPanelItems, layer);
588
585
  var otherFaces = collectFaces(otherItems, layer);
589
586
  skinFaces = filterFacesBlockedByFaces(skinFaces, skinFaces);
590
587
  skinFaces = filterFacesBlockedByFaces(skinFaces, otherFaces);
588
+ skinFaces = skinFaces.filter(function (skinFace) {
589
+ return !shouldExcludeSkinPanel(skinFace.itemInfo, exclusionSet);
590
+ });
591
591
  var _applyGroupingRules = applyGroupingRules(skinFaces),
592
592
  remainingFaces = _applyGroupingRules.remainingFaces,
593
593
  groupedFaces = _applyGroupingRules.groupedFaces;
@@ -10,6 +10,7 @@ var _convertUnitsLite = require("../../utils/convert-units-lite");
10
10
  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; }
11
11
  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; }
12
12
  function _default(_ref) {
13
+ var _long_name$toLowerCas, _long_name$toLowerCas2;
13
14
  var itemID = _ref.itemID,
14
15
  type = _ref.type,
15
16
  long_name = _ref.long_name,
@@ -44,7 +45,7 @@ function _default(_ref) {
44
45
  // const length = _length;
45
46
 
46
47
  var additional_props = [];
47
- if (type === 'cabinet' && long_name.toLowerCase().includes('filler')) {
48
+ if (type === 'cabinet' && long_name !== null && long_name !== void 0 && (_long_name$toLowerCas = long_name.toLowerCase()) !== null && _long_name$toLowerCas !== void 0 && _long_name$toLowerCas.includes('filler')) {
48
49
  additional_props = {
49
50
  width: {
50
51
  label: 'Width',
@@ -57,7 +58,7 @@ function _default(_ref) {
57
58
  }
58
59
  };
59
60
  }
60
- if (type === 'appliance' || type === 'furnishing' || type === 'cabinet' && long_name.toLowerCase().includes('panel')) {
61
+ if (type === 'appliance' || type === 'furnishing' || type === 'cabinet' && long_name !== null && long_name !== void 0 && (_long_name$toLowerCas2 = long_name.toLowerCase()) !== null && _long_name$toLowerCas2 !== void 0 && _long_name$toLowerCas2.includes('panel')) {
61
62
  additional_props = {
62
63
  width: {
63
64
  label: 'Width',
@@ -101,9 +102,9 @@ function _default(_ref) {
101
102
  tag: ['furnishing', 'electronics'],
102
103
  description: description,
103
104
  image: base,
104
- door: obj_property.door_style,
105
- doorcategory: obj_property.door_category,
106
- has_single_door: obj_property.has_single_door,
105
+ door: obj_property === null || obj_property === void 0 ? void 0 : obj_property.door_style,
106
+ doorcategory: obj_property === null || obj_property === void 0 ? void 0 : obj_property.door_category,
107
+ has_single_door: obj_property === null || obj_property === void 0 ? void 0 : obj_property.has_single_door,
107
108
  sizeinfo: sizeinfo,
108
109
  layoutpos: layoutpos,
109
110
  is_corner: is_corner,
@@ -33,6 +33,7 @@ function ccdfMapper(ccdf_list, layer) {
33
33
  }
34
34
  var cd = layerJS.items[correctItemId];
35
35
  if (cd && !!(ccdf !== null && ccdf !== void 0 && ccdf.scene_cabinet_id) && (cd === null || cd === void 0 ? void 0 : cd.id) === ccdf.scene_cabinet_id) {
36
+ var _ccdf$cabinet_id, _cd$long_name, _cd$sizeinfo, _cd$shape_svg;
36
37
  if (!(0, _utils.isEmpty)(ccdf === null || ccdf === void 0 ? void 0 : ccdf.id)) {
37
38
  cdfId = ccdf.id;
38
39
  }
@@ -82,15 +83,16 @@ function ccdfMapper(ccdf_list, layer) {
82
83
  // make cabinet definition using structure_json and catalog
83
84
  cabinetDefinition = {
84
85
  type: cd.category,
85
- itemID: cd.itemID,
86
+ itemID: (_ccdf$cabinet_id = ccdf === null || ccdf === void 0 ? void 0 : ccdf.cabinet_id) !== null && _ccdf$cabinet_id !== void 0 ? _ccdf$cabinet_id : cd.itemID,
87
+ // cd.itemID may be legacy from legacy project, so ccdf.cabinet_id is preferred if exists
86
88
  name: cd.name,
87
- long_name: cd.long_name,
88
- sizeinfo: cd.sizeinfo,
89
+ long_name: (_cd$long_name = cd.long_name) !== null && _cd$long_name !== void 0 ? _cd$long_name : ccdf === null || ccdf === void 0 ? void 0 : ccdf.long_name,
90
+ sizeinfo: (_cd$sizeinfo = cd.sizeinfo) !== null && _cd$sizeinfo !== void 0 ? _cd$sizeinfo : ccdf === null || ccdf === void 0 ? void 0 : ccdf.sizeinfo,
89
91
  description: cd.description,
90
92
  prototype: cd.prototype,
91
93
  base: cd.base,
92
94
  ccdf: cd.ccdf,
93
- shape_svg: cd.shape_svg,
95
+ shape_svg: (_cd$shape_svg = cd.shape_svg) !== null && _cd$shape_svg !== void 0 ? _cd$shape_svg : ccdf === null || ccdf === void 0 ? void 0 : ccdf.shape_svg,
94
96
  // If host provides cabinet base gltf/bin at CCDF top-level, prefer it.
95
97
  gltf: (ccdf === null || ccdf === void 0 ? void 0 : ccdf.gltf) || cd.gltf,
96
98
  bin: (ccdf === null || ccdf === void 0 ? void 0 : ccdf.bin) || (cd === null || cd === void 0 ? void 0 : cd.bin),
@@ -587,15 +587,15 @@ function computeSkinPanels(layer) {
587
587
  var _collectLayerItems = collectLayerItems(layer),
588
588
  skinPanelItems = _collectLayerItems.skinPanelItems,
589
589
  otherItems = _collectLayerItems.otherItems;
590
- var filteredSkinPanelItems = skinPanelItems.filter(function (item) {
591
- return !shouldExcludeSkinPanel(item.toJS(), exclusionSet);
592
- });
593
590
 
594
591
  // Get all skin face list of [skinPanelItems] & [otherItems]
595
- var skinFaces = collectFaces(filteredSkinPanelItems, layer);
592
+ var skinFaces = collectFaces(skinPanelItems, layer);
596
593
  var otherFaces = collectFaces(otherItems, layer);
597
594
  skinFaces = filterFacesBlockedByFaces(skinFaces, skinFaces);
598
595
  skinFaces = filterFacesBlockedByFaces(skinFaces, otherFaces);
596
+ skinFaces = skinFaces.filter(function (skinFace) {
597
+ return !shouldExcludeSkinPanel(skinFace.itemInfo, exclusionSet);
598
+ });
599
599
  var _applyGroupingRules = applyGroupingRules(skinFaces),
600
600
  remainingFaces = _applyGroupingRules.remainingFaces,
601
601
  groupedFaces = _applyGroupingRules.groupedFaces;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitchen-simulator",
3
- "version": "11.15.0",
3
+ "version": "11.17.0",
4
4
  "description": "It is a kitchen simulator (self-contained micro-frontend).",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",