kitchen-simulator 10.11.0 → 10.13.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,9 +105,16 @@ var Item = /*#__PURE__*/function () {
105
105
  }
106
106
  if (item.category === 'cabinet') {
107
107
  if (isDuplication && refItem) {
108
+ var _refItem$ccdf, _refItem$get;
108
109
  item = item.merge({
109
110
  doorStyle: refItem.doorStyle
110
111
  });
112
+ // When duplicating, preserve the instance-selected CCDF from the source cabinet.
113
+ var refCcdf = (_refItem$ccdf = refItem === null || refItem === void 0 ? void 0 : refItem.ccdf) !== null && _refItem$ccdf !== void 0 ? _refItem$ccdf : refItem === null || refItem === void 0 || (_refItem$get = refItem.get) === null || _refItem$get === void 0 ? void 0 : _refItem$get.call(refItem, 'ccdf');
114
+ refCcdf = toJSIfNeeded(refCcdf);
115
+ if (!isEmpty(refCcdf)) item = item.merge({
116
+ ccdf: refCcdf
117
+ });
111
118
  } else {
112
119
  var _layer$doorStyle, _temp, _ref, _temp$doorStyles$cds$, _temp2, _temp3, _state5;
113
120
  var layer = state.getIn(['scene', 'layers', layerID]);
@@ -40,7 +40,7 @@ function _handleChangeDoorStyleEvent() {
40
40
  case 4:
41
41
  ccdf_list = [];
42
42
  _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
43
- var item, _doorStyle$id2, _item$long_name;
43
+ var item, _item$ccdf$catalog_ca, _item$ccdf, _doorStyle$id2, _item$long_name;
44
44
  return _regeneratorRuntime.wrap(function (_context2) {
45
45
  while (1) switch (_context2.prev = _context2.next) {
46
46
  case 0:
@@ -51,9 +51,9 @@ function _handleChangeDoorStyleEvent() {
51
51
  ccdf_list.push({
52
52
  cabinet_sku: item.type,
53
53
  sizeinfo: item.sizeinfo,
54
- catalog_cabinet_sku: item.sku_number,
54
+ catalog_cabinet_sku: (_item$ccdf$catalog_ca = item === null || item === void 0 || (_item$ccdf = item.ccdf) === null || _item$ccdf === void 0 ? void 0 : _item$ccdf.catalog_cabinet_sku) !== null && _item$ccdf$catalog_ca !== void 0 ? _item$ccdf$catalog_ca : item.sku_number,
55
55
  ccdf: item.ccdf,
56
- door_finish_id: (_doorStyle$id2 = doorStyle === null || doorStyle === void 0 ? void 0 : doorStyle.id) !== null && _doorStyle$id2 !== void 0 ? _doorStyle$id2 : null,
56
+ target_door_finish_id: (_doorStyle$id2 = doorStyle === null || doorStyle === void 0 ? void 0 : doorStyle.id) !== null && _doorStyle$id2 !== void 0 ? _doorStyle$id2 : null,
57
57
  long_name: (_item$long_name = item === null || item === void 0 ? void 0 : item.long_name) !== null && _item$long_name !== void 0 ? _item$long_name : null,
58
58
  scene_cabinet_id: item.id
59
59
  });
@@ -80,6 +80,7 @@ function _handleChangeDoorStyleEvent() {
80
80
  (_props$onInternalEven = props.onInternalEvent) === null || _props$onInternalEven === void 0 || _props$onInternalEven.call(props, {
81
81
  type: INTERNAL_EVENT_ITEMS_CATALOG,
82
82
  value: {
83
+ event_type: 'change_door_style',
83
84
  ccdf_list: ccdf_list
84
85
  }
85
86
  },
@@ -31,13 +31,13 @@ function _handleLoadProjectEvent() {
31
31
  if (!ccdf_list.some(function (v) {
32
32
  return v.scene_cabinet_id === it.id;
33
33
  })) {
34
- var _it$long_name;
34
+ var _it$ccdf$catalog_cabi, _it$ccdf, _it$ccdf$door_finish_, _it$ccdf2, _it$long_name;
35
35
  ccdf_list.push({
36
36
  cabinet_sku: it.type,
37
37
  sizeinfo: it.sizeinfo,
38
- catalog_cabinet_sku: it.sku_number,
38
+ catalog_cabinet_sku: (_it$ccdf$catalog_cabi = it === null || it === void 0 || (_it$ccdf = it.ccdf) === null || _it$ccdf === void 0 ? void 0 : _it$ccdf.catalog_cabinet_sku) !== null && _it$ccdf$catalog_cabi !== void 0 ? _it$ccdf$catalog_cabi : it.sku_number,
39
39
  ccdf: it.ccdf,
40
- door_finish_id: it.doorStyle.id,
40
+ target_door_finish_id: (_it$ccdf$door_finish_ = it === null || it === void 0 || (_it$ccdf2 = it.ccdf) === null || _it$ccdf2 === void 0 ? void 0 : _it$ccdf2.door_finish_id) !== null && _it$ccdf$door_finish_ !== void 0 ? _it$ccdf$door_finish_ : it.doorStyle.id,
41
41
  long_name: (_it$long_name = it === null || it === void 0 ? void 0 : it.long_name) !== null && _it$long_name !== void 0 ? _it$long_name : null,
42
42
  scene_cabinet_id: it.id
43
43
  });
@@ -52,6 +52,7 @@ function _handleLoadProjectEvent() {
52
52
  (_props$onInternalEven = props.onInternalEvent) === null || _props$onInternalEven === void 0 || _props$onInternalEven.call(props, {
53
53
  type: INTERNAL_EVENT_ITEMS_CATALOG,
54
54
  value: {
55
+ event_type: 'load_project',
55
56
  ccdf_list: ccdf_list
56
57
  }
57
58
  }, /*#__PURE__*/function () {
package/lib/class/item.js CHANGED
@@ -112,9 +112,16 @@ 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
116
  item = item.merge({
116
117
  doorStyle: refItem.doorStyle
117
118
  });
119
+ // When duplicating, preserve the instance-selected CCDF from the source cabinet.
120
+ var refCcdf = (_refItem$ccdf = refItem === null || refItem === void 0 ? void 0 : refItem.ccdf) !== null && _refItem$ccdf !== void 0 ? _refItem$ccdf : refItem === null || refItem === void 0 || (_refItem$get = refItem.get) === null || _refItem$get === void 0 ? void 0 : _refItem$get.call(refItem, 'ccdf');
121
+ refCcdf = (0, _immutable2.toJSIfNeeded)(refCcdf);
122
+ if (!(0, _utils.isEmpty)(refCcdf)) item = item.merge({
123
+ ccdf: refCcdf
124
+ });
118
125
  } else {
119
126
  var _layer$doorStyle, _temp, _ref, _temp$doorStyles$cds$, _temp2, _temp3, _state5;
120
127
  var layer = state.getIn(['scene', 'layers', layerID]);
@@ -47,7 +47,7 @@ function _handleChangeDoorStyleEvent() {
47
47
  case 4:
48
48
  ccdf_list = [];
49
49
  _loop = /*#__PURE__*/_regenerator["default"].mark(function _loop() {
50
- var item, _doorStyle$id2, _item$long_name;
50
+ var item, _item$ccdf$catalog_ca, _item$ccdf, _doorStyle$id2, _item$long_name;
51
51
  return _regenerator["default"].wrap(function (_context2) {
52
52
  while (1) switch (_context2.prev = _context2.next) {
53
53
  case 0:
@@ -58,9 +58,9 @@ function _handleChangeDoorStyleEvent() {
58
58
  ccdf_list.push({
59
59
  cabinet_sku: item.type,
60
60
  sizeinfo: item.sizeinfo,
61
- catalog_cabinet_sku: item.sku_number,
61
+ catalog_cabinet_sku: (_item$ccdf$catalog_ca = item === null || item === void 0 || (_item$ccdf = item.ccdf) === null || _item$ccdf === void 0 ? void 0 : _item$ccdf.catalog_cabinet_sku) !== null && _item$ccdf$catalog_ca !== void 0 ? _item$ccdf$catalog_ca : item.sku_number,
62
62
  ccdf: item.ccdf,
63
- door_finish_id: (_doorStyle$id2 = doorStyle === null || doorStyle === void 0 ? void 0 : doorStyle.id) !== null && _doorStyle$id2 !== void 0 ? _doorStyle$id2 : null,
63
+ target_door_finish_id: (_doorStyle$id2 = doorStyle === null || doorStyle === void 0 ? void 0 : doorStyle.id) !== null && _doorStyle$id2 !== void 0 ? _doorStyle$id2 : null,
64
64
  long_name: (_item$long_name = item === null || item === void 0 ? void 0 : item.long_name) !== null && _item$long_name !== void 0 ? _item$long_name : null,
65
65
  scene_cabinet_id: item.id
66
66
  });
@@ -87,6 +87,7 @@ function _handleChangeDoorStyleEvent() {
87
87
  (_props$onInternalEven = props.onInternalEvent) === null || _props$onInternalEven === void 0 || _props$onInternalEven.call(props, {
88
88
  type: INTERNAL_EVENT_ITEMS_CATALOG,
89
89
  value: {
90
+ event_type: 'change_door_style',
90
91
  ccdf_list: ccdf_list
91
92
  }
92
93
  },
@@ -38,13 +38,13 @@ function _handleLoadProjectEvent() {
38
38
  if (!ccdf_list.some(function (v) {
39
39
  return v.scene_cabinet_id === it.id;
40
40
  })) {
41
- var _it$long_name;
41
+ var _it$ccdf$catalog_cabi, _it$ccdf, _it$ccdf$door_finish_, _it$ccdf2, _it$long_name;
42
42
  ccdf_list.push({
43
43
  cabinet_sku: it.type,
44
44
  sizeinfo: it.sizeinfo,
45
- catalog_cabinet_sku: it.sku_number,
45
+ catalog_cabinet_sku: (_it$ccdf$catalog_cabi = it === null || it === void 0 || (_it$ccdf = it.ccdf) === null || _it$ccdf === void 0 ? void 0 : _it$ccdf.catalog_cabinet_sku) !== null && _it$ccdf$catalog_cabi !== void 0 ? _it$ccdf$catalog_cabi : it.sku_number,
46
46
  ccdf: it.ccdf,
47
- door_finish_id: it.doorStyle.id,
47
+ target_door_finish_id: (_it$ccdf$door_finish_ = it === null || it === void 0 || (_it$ccdf2 = it.ccdf) === null || _it$ccdf2 === void 0 ? void 0 : _it$ccdf2.door_finish_id) !== null && _it$ccdf$door_finish_ !== void 0 ? _it$ccdf$door_finish_ : it.doorStyle.id,
48
48
  long_name: (_it$long_name = it === null || it === void 0 ? void 0 : it.long_name) !== null && _it$long_name !== void 0 ? _it$long_name : null,
49
49
  scene_cabinet_id: it.id
50
50
  });
@@ -59,6 +59,7 @@ function _handleLoadProjectEvent() {
59
59
  (_props$onInternalEven = props.onInternalEvent) === null || _props$onInternalEven === void 0 || _props$onInternalEven.call(props, {
60
60
  type: _constants.INTERNAL_EVENT_ITEMS_CATALOG,
61
61
  value: {
62
+ event_type: 'load_project',
62
63
  ccdf_list: ccdf_list
63
64
  }
64
65
  }, /*#__PURE__*/function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitchen-simulator",
3
- "version": "10.11.0",
3
+ "version": "10.13.0",
4
4
  "description": "It is a kitchen simulator (self-contained micro-frontend).",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",