kitchen-simulator 10.13.0 → 10.14.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 +2 -2
- package/es/events/external/handlers.changeDoorStyle.js +2 -1
- package/es/events/external/handlers.loadProject.js +3 -2
- package/es/shared/domain/cabinet-warning.js +4 -3
- package/lib/class/item.js +2 -2
- package/lib/events/external/handlers.changeDoorStyle.js +2 -1
- package/lib/events/external/handlers.loadProject.js +3 -2
- package/lib/shared/domain/cabinet-warning.js +4 -3
- package/package.json +1 -1
package/es/class/item.js
CHANGED
|
@@ -274,14 +274,14 @@ var Item = /*#__PURE__*/function () {
|
|
|
274
274
|
idSet = new Set(targetItemIDs);
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
// If host returns an empty ccdf_list, remove persisted ccdf from affected instances.
|
|
277
|
+
// If host returns an empty ccdf_list, remove assets3d of persisted ccdf from affected instances.
|
|
278
278
|
// This keeps SYNC payload from sending stale `items[].ccdf`.
|
|
279
279
|
if (ccdf_list.length === 0) {
|
|
280
280
|
layer.items.forEach(function (it) {
|
|
281
281
|
var _idSet;
|
|
282
282
|
var should = applyScope === DOORSTYLE_SCOPE_ALL ? true : (_idSet = idSet) === null || _idSet === void 0 ? void 0 : _idSet.has(it.id);
|
|
283
283
|
if (!should) return;
|
|
284
|
-
state = state.deleteIn(['scene', 'layers', layerID, 'items', it.id, 'ccdf']);
|
|
284
|
+
state = state.deleteIn(['scene', 'layers', layerID, 'items', it.id, 'ccdf', 'assets3d']);
|
|
285
285
|
});
|
|
286
286
|
return {
|
|
287
287
|
updatedState: state
|
|
@@ -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, _item$ccdf$catalog_ca, _item$ccdf, _doorStyle$id2, _item$long_name;
|
|
43
|
+
var item, _item$ccdf$catalog_ca, _item$ccdf, _item$ccdf$cabinet_id, _item$ccdf2, _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:
|
|
@@ -52,6 +52,7 @@ function _handleChangeDoorStyleEvent() {
|
|
|
52
52
|
cabinet_sku: item.type,
|
|
53
53
|
sizeinfo: item.sizeinfo,
|
|
54
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
|
+
cabinet_id: (_item$ccdf$cabinet_id = item === null || item === void 0 || (_item$ccdf2 = item.ccdf) === null || _item$ccdf2 === void 0 ? void 0 : _item$ccdf2.cabinet_id) !== null && _item$ccdf$cabinet_id !== void 0 ? _item$ccdf$cabinet_id : null,
|
|
55
56
|
ccdf: item.ccdf,
|
|
56
57
|
target_door_finish_id: (_doorStyle$id2 = doorStyle === null || doorStyle === void 0 ? void 0 : doorStyle.id) !== null && _doorStyle$id2 !== void 0 ? _doorStyle$id2 : null,
|
|
57
58
|
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,
|
|
@@ -31,13 +31,14 @@ function _handleLoadProjectEvent() {
|
|
|
31
31
|
if (!ccdf_list.some(function (v) {
|
|
32
32
|
return v.scene_cabinet_id === it.id;
|
|
33
33
|
})) {
|
|
34
|
-
var _it$ccdf$catalog_cabi, _it$ccdf, _it$ccdf$
|
|
34
|
+
var _it$ccdf$catalog_cabi, _it$ccdf, _it$ccdf$cabinet_id, _it$ccdf2, _it$ccdf$door_finish_, _it$ccdf3, _it$long_name;
|
|
35
35
|
ccdf_list.push({
|
|
36
36
|
cabinet_sku: it.type,
|
|
37
37
|
sizeinfo: it.sizeinfo,
|
|
38
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
|
+
cabinet_id: (_it$ccdf$cabinet_id = it === null || it === void 0 || (_it$ccdf2 = it.ccdf) === null || _it$ccdf2 === void 0 ? void 0 : _it$ccdf2.cabinet_id) !== null && _it$ccdf$cabinet_id !== void 0 ? _it$ccdf$cabinet_id : it === null || it === void 0 ? void 0 : it.itemID,
|
|
39
40
|
ccdf: it.ccdf,
|
|
40
|
-
target_door_finish_id: (_it$ccdf$door_finish_ = it === null || it === void 0 || (_it$
|
|
41
|
+
target_door_finish_id: (_it$ccdf$door_finish_ = it === null || it === void 0 || (_it$ccdf3 = it.ccdf) === null || _it$ccdf3 === void 0 ? void 0 : _it$ccdf3.door_finish_id) !== null && _it$ccdf$door_finish_ !== void 0 ? _it$ccdf$door_finish_ : it.doorStyle.id,
|
|
41
42
|
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
43
|
scene_cabinet_id: it.id
|
|
43
44
|
});
|
|
@@ -6,9 +6,10 @@ import { toJSIfNeeded } from "../objects/immutable";
|
|
|
6
6
|
|
|
7
7
|
// Implementation: return true if item.category === 'cabinet' and (no ccdf or empty ccdf.assets3d)
|
|
8
8
|
export function isWarningCabinet(item) {
|
|
9
|
+
var _js$ccdf;
|
|
9
10
|
var js = toJSIfNeeded(item);
|
|
10
11
|
var isCabinet = (js === null || js === void 0 ? void 0 : js.category) === ITEM_TYPE.CABINET;
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
return isCabinet && !
|
|
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;
|
|
14
15
|
}
|
package/lib/class/item.js
CHANGED
|
@@ -281,14 +281,14 @@ var Item = exports["default"] = /*#__PURE__*/function () {
|
|
|
281
281
|
idSet = new Set(targetItemIDs);
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
-
// If host returns an empty ccdf_list, remove persisted ccdf from affected instances.
|
|
284
|
+
// If host returns an empty ccdf_list, remove assets3d of persisted ccdf from affected instances.
|
|
285
285
|
// This keeps SYNC payload from sending stale `items[].ccdf`.
|
|
286
286
|
if (ccdf_list.length === 0) {
|
|
287
287
|
layer.items.forEach(function (it) {
|
|
288
288
|
var _idSet;
|
|
289
289
|
var should = applyScope === _constants.DOORSTYLE_SCOPE_ALL ? true : (_idSet = idSet) === null || _idSet === void 0 ? void 0 : _idSet.has(it.id);
|
|
290
290
|
if (!should) return;
|
|
291
|
-
state = state.deleteIn(['scene', 'layers', layerID, 'items', it.id, 'ccdf']);
|
|
291
|
+
state = state.deleteIn(['scene', 'layers', layerID, 'items', it.id, 'ccdf', 'assets3d']);
|
|
292
292
|
});
|
|
293
293
|
return {
|
|
294
294
|
updatedState: state
|
|
@@ -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, _item$ccdf$catalog_ca, _item$ccdf, _doorStyle$id2, _item$long_name;
|
|
50
|
+
var item, _item$ccdf$catalog_ca, _item$ccdf, _item$ccdf$cabinet_id, _item$ccdf2, _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:
|
|
@@ -59,6 +59,7 @@ function _handleChangeDoorStyleEvent() {
|
|
|
59
59
|
cabinet_sku: item.type,
|
|
60
60
|
sizeinfo: item.sizeinfo,
|
|
61
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
|
+
cabinet_id: (_item$ccdf$cabinet_id = item === null || item === void 0 || (_item$ccdf2 = item.ccdf) === null || _item$ccdf2 === void 0 ? void 0 : _item$ccdf2.cabinet_id) !== null && _item$ccdf$cabinet_id !== void 0 ? _item$ccdf$cabinet_id : null,
|
|
62
63
|
ccdf: item.ccdf,
|
|
63
64
|
target_door_finish_id: (_doorStyle$id2 = doorStyle === null || doorStyle === void 0 ? void 0 : doorStyle.id) !== null && _doorStyle$id2 !== void 0 ? _doorStyle$id2 : null,
|
|
64
65
|
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,
|
|
@@ -38,13 +38,14 @@ function _handleLoadProjectEvent() {
|
|
|
38
38
|
if (!ccdf_list.some(function (v) {
|
|
39
39
|
return v.scene_cabinet_id === it.id;
|
|
40
40
|
})) {
|
|
41
|
-
var _it$ccdf$catalog_cabi, _it$ccdf, _it$ccdf$
|
|
41
|
+
var _it$ccdf$catalog_cabi, _it$ccdf, _it$ccdf$cabinet_id, _it$ccdf2, _it$ccdf$door_finish_, _it$ccdf3, _it$long_name;
|
|
42
42
|
ccdf_list.push({
|
|
43
43
|
cabinet_sku: it.type,
|
|
44
44
|
sizeinfo: it.sizeinfo,
|
|
45
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
|
+
cabinet_id: (_it$ccdf$cabinet_id = it === null || it === void 0 || (_it$ccdf2 = it.ccdf) === null || _it$ccdf2 === void 0 ? void 0 : _it$ccdf2.cabinet_id) !== null && _it$ccdf$cabinet_id !== void 0 ? _it$ccdf$cabinet_id : it === null || it === void 0 ? void 0 : it.itemID,
|
|
46
47
|
ccdf: it.ccdf,
|
|
47
|
-
target_door_finish_id: (_it$ccdf$door_finish_ = it === null || it === void 0 || (_it$
|
|
48
|
+
target_door_finish_id: (_it$ccdf$door_finish_ = it === null || it === void 0 || (_it$ccdf3 = it.ccdf) === null || _it$ccdf3 === void 0 ? void 0 : _it$ccdf3.door_finish_id) !== null && _it$ccdf$door_finish_ !== void 0 ? _it$ccdf$door_finish_ : it.doorStyle.id,
|
|
48
49
|
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
50
|
scene_cabinet_id: it.id
|
|
50
51
|
});
|
|
@@ -11,9 +11,10 @@ var _immutable = require("../objects/immutable");
|
|
|
11
11
|
|
|
12
12
|
// Implementation: return true if item.category === 'cabinet' and (no ccdf or empty ccdf.assets3d)
|
|
13
13
|
function isWarningCabinet(item) {
|
|
14
|
+
var _js$ccdf;
|
|
14
15
|
var js = (0, _immutable.toJSIfNeeded)(item);
|
|
15
16
|
var isCabinet = (js === null || js === void 0 ? void 0 : js.category) === _constants.ITEM_TYPE.CABINET;
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
return isCabinet && !
|
|
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;
|
|
19
20
|
}
|