kitchen-simulator 11.0.0 → 11.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/class/item.js CHANGED
@@ -105,7 +105,7 @@ var Item = /*#__PURE__*/function () {
105
105
  }
106
106
  if (item.category === 'cabinet') {
107
107
  if (isDuplication && refItem) {
108
- var _refItem$ccdf, _refItem$get;
108
+ var _refItem$ccdf, _refItem$get, _refItem$properties, _refItem$properties$g;
109
109
  item = item.merge({
110
110
  doorStyle: refItem.doorStyle
111
111
  });
@@ -115,6 +115,10 @@ var Item = /*#__PURE__*/function () {
115
115
  if (!isEmpty(refCcdf)) item = item.merge({
116
116
  ccdf: refCcdf
117
117
  });
118
+
119
+ // Preserve altitude so wall cabinets don't drop to the floor on duplicate.
120
+ var refAlt = refItem === null || refItem === void 0 || (_refItem$properties = refItem.properties) === null || _refItem$properties === void 0 || (_refItem$properties$g = _refItem$properties.get) === null || _refItem$properties$g === void 0 ? void 0 : _refItem$properties$g.call(_refItem$properties, 'altitude');
121
+ if (refAlt) item = item.setIn(['properties', 'altitude'], refAlt);
118
122
  } else {
119
123
  var _layer$doorStyle, _temp, _ref, _temp$doorStyles$cds$, _temp2, _temp3, _state5;
120
124
  var layer = state.getIn(['scene', 'layers', layerID]);
@@ -273,27 +277,13 @@ var Item = /*#__PURE__*/function () {
273
277
  } else if (applyScope === DOORSTYLE_SCOPE_MULTIPLE) {
274
278
  idSet = new Set(targetItemIDs);
275
279
  }
276
-
277
- // If host returns an empty ccdf_list, remove assets3d of persisted ccdf from affected instances.
278
- // This keeps SYNC payload from sending stale `items[].ccdf`.
279
- if (ccdf_list.length === 0) {
280
- layer.items.forEach(function (it) {
281
- var _idSet;
282
- var should = applyScope === DOORSTYLE_SCOPE_ALL ? true : (_idSet = idSet) === null || _idSet === void 0 ? void 0 : _idSet.has(it.id);
283
- if (!should) return;
284
- state = state.deleteIn(['scene', 'layers', layerID, 'items', it.id, 'ccdf', 'assets3d']);
285
- });
286
- return {
287
- updatedState: state
288
- };
289
- }
290
280
  var desiredDoorFinishId = doorFinishId !== null && doorFinishId !== void 0 ? doorFinishId : this.__getDesiredDoorFinishId(layer);
291
281
  if (!desiredDoorFinishId) return {
292
282
  updatedState: state
293
283
  };
294
284
  layer.items.forEach(function (it) {
295
- var _idSet2, _picked$door_finish_i;
296
- var should = applyScope === DOORSTYLE_SCOPE_ALL ? true : (_idSet2 = idSet) === null || _idSet2 === void 0 ? void 0 : _idSet2.has(it.id);
285
+ var _idSet, _picked$door_finish_i;
286
+ var should = applyScope === DOORSTYLE_SCOPE_ALL ? true : (_idSet = idSet) === null || _idSet === void 0 ? void 0 : _idSet.has(it.id);
297
287
  if (!should) return;
298
288
 
299
289
  // Join key: scene_cabinet_id (instance id).
@@ -9,7 +9,5 @@ export function isWarningCabinet(item) {
9
9
  var _js$ccdf;
10
10
  var js = toJSIfNeeded(item);
11
11
  var isCabinet = (js === null || js === void 0 ? void 0 : js.category) === ITEM_TYPE.CABINET;
12
- var assets3d = js === null || js === void 0 || (_js$ccdf = js.ccdf) === null || _js$ccdf === void 0 ? void 0 : _js$ccdf.assets3d;
13
- var hasAssets3d = !!assets3d && Array.isArray(assets3d) && assets3d.length > 0;
14
- return isCabinet && !hasAssets3d;
12
+ return isCabinet && !(js !== null && js !== void 0 && (_js$ccdf = js.ccdf) !== null && _js$ccdf !== void 0 && _js$ccdf.is_available_in_current_door_finish);
15
13
  }
package/lib/class/item.js CHANGED
@@ -112,7 +112,7 @@ var Item = exports["default"] = /*#__PURE__*/function () {
112
112
  }
113
113
  if (item.category === 'cabinet') {
114
114
  if (isDuplication && refItem) {
115
- var _refItem$ccdf, _refItem$get;
115
+ var _refItem$ccdf, _refItem$get, _refItem$properties, _refItem$properties$g;
116
116
  item = item.merge({
117
117
  doorStyle: refItem.doorStyle
118
118
  });
@@ -122,6 +122,10 @@ var Item = exports["default"] = /*#__PURE__*/function () {
122
122
  if (!(0, _utils.isEmpty)(refCcdf)) item = item.merge({
123
123
  ccdf: refCcdf
124
124
  });
125
+
126
+ // Preserve altitude so wall cabinets don't drop to the floor on duplicate.
127
+ var refAlt = refItem === null || refItem === void 0 || (_refItem$properties = refItem.properties) === null || _refItem$properties === void 0 || (_refItem$properties$g = _refItem$properties.get) === null || _refItem$properties$g === void 0 ? void 0 : _refItem$properties$g.call(_refItem$properties, 'altitude');
128
+ if (refAlt) item = item.setIn(['properties', 'altitude'], refAlt);
125
129
  } else {
126
130
  var _layer$doorStyle, _temp, _ref, _temp$doorStyles$cds$, _temp2, _temp3, _state5;
127
131
  var layer = state.getIn(['scene', 'layers', layerID]);
@@ -280,27 +284,13 @@ var Item = exports["default"] = /*#__PURE__*/function () {
280
284
  } else if (applyScope === _constants.DOORSTYLE_SCOPE_MULTIPLE) {
281
285
  idSet = new Set(targetItemIDs);
282
286
  }
283
-
284
- // If host returns an empty ccdf_list, remove assets3d of persisted ccdf from affected instances.
285
- // This keeps SYNC payload from sending stale `items[].ccdf`.
286
- if (ccdf_list.length === 0) {
287
- layer.items.forEach(function (it) {
288
- var _idSet;
289
- var should = applyScope === _constants.DOORSTYLE_SCOPE_ALL ? true : (_idSet = idSet) === null || _idSet === void 0 ? void 0 : _idSet.has(it.id);
290
- if (!should) return;
291
- state = state.deleteIn(['scene', 'layers', layerID, 'items', it.id, 'ccdf', 'assets3d']);
292
- });
293
- return {
294
- updatedState: state
295
- };
296
- }
297
287
  var desiredDoorFinishId = doorFinishId !== null && doorFinishId !== void 0 ? doorFinishId : this.__getDesiredDoorFinishId(layer);
298
288
  if (!desiredDoorFinishId) return {
299
289
  updatedState: state
300
290
  };
301
291
  layer.items.forEach(function (it) {
302
- var _idSet2, _picked$door_finish_i;
303
- var should = applyScope === _constants.DOORSTYLE_SCOPE_ALL ? true : (_idSet2 = idSet) === null || _idSet2 === void 0 ? void 0 : _idSet2.has(it.id);
292
+ var _idSet, _picked$door_finish_i;
293
+ var should = applyScope === _constants.DOORSTYLE_SCOPE_ALL ? true : (_idSet = idSet) === null || _idSet === void 0 ? void 0 : _idSet.has(it.id);
304
294
  if (!should) return;
305
295
 
306
296
  // Join key: scene_cabinet_id (instance id).
@@ -14,7 +14,5 @@ function isWarningCabinet(item) {
14
14
  var _js$ccdf;
15
15
  var js = (0, _immutable.toJSIfNeeded)(item);
16
16
  var isCabinet = (js === null || js === void 0 ? void 0 : js.category) === _constants.ITEM_TYPE.CABINET;
17
- var assets3d = js === null || js === void 0 || (_js$ccdf = js.ccdf) === null || _js$ccdf === void 0 ? void 0 : _js$ccdf.assets3d;
18
- var hasAssets3d = !!assets3d && Array.isArray(assets3d) && assets3d.length > 0;
19
- return isCabinet && !hasAssets3d;
17
+ return isCabinet && !(js !== null && js !== void 0 && (_js$ccdf = js.ccdf) !== null && _js$ccdf !== void 0 && _js$ccdf.is_available_in_current_door_finish);
20
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitchen-simulator",
3
- "version": "11.0.0",
3
+ "version": "11.2.0",
4
4
  "description": "It is a kitchen simulator (self-contained micro-frontend).",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",