kitchen-simulator 11.25.0 → 11.26.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/events/external/handleExternalEvent.util.js +0 -2
- package/es/events/external/handlers.loadProject.js +3 -6
- package/es/mappings/external-events/mappers/loadProjectMapper.js +14 -24
- package/es/mappings/holesToCatalog.js +0 -1
- package/lib/events/external/handleExternalEvent.util.js +0 -2
- package/lib/events/external/handlers.loadProject.js +3 -6
- package/lib/mappings/external-events/mappers/loadProjectMapper.js +14 -24
- package/lib/mappings/holesToCatalog.js +0 -1
- package/package.json +1 -1
|
@@ -536,7 +536,6 @@ function _addItemToCatalog() {
|
|
|
536
536
|
}
|
|
537
537
|
return _context5.abrupt("return");
|
|
538
538
|
case 1:
|
|
539
|
-
element.name = element.name.toLowerCase();
|
|
540
539
|
elementJs = populateCCDFList(element); // if (isEmpty(catalog?.elements[element.name])) {
|
|
541
540
|
_context5.next = 2;
|
|
542
541
|
return loadSVGsByItem(elementJs);
|
|
@@ -625,7 +624,6 @@ function _addItemToCatalog() {
|
|
|
625
624
|
|
|
626
625
|
// rplace new array to the elementJS
|
|
627
626
|
if (!isEmpty(mergedTempPlaceholder)) elementJs.structure_json.tempPlaceholders = mergedTempPlaceholder;
|
|
628
|
-
// elementJs.name = elementJs.name.toLowerCase
|
|
629
627
|
/***** join new tempPlaceholder to the old element - end *****/
|
|
630
628
|
|
|
631
629
|
elementJs = exporter(elementJs);
|
|
@@ -31,18 +31,15 @@ function _handleLoadProjectEvent() {
|
|
|
31
31
|
if (!ccdf_list.some(function (v) {
|
|
32
32
|
return v.scene_cabinet_id === it.id;
|
|
33
33
|
})) {
|
|
34
|
-
var _it$
|
|
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
|
-
sizeinfo:
|
|
38
|
-
width: it === null || it === void 0 || (_it$properties4 = it.properties) === null || _it$properties4 === void 0 || (_it$properties4 = _it$properties4.width) === null || _it$properties4 === void 0 ? void 0 : _it$properties4._length,
|
|
39
|
-
height: it === null || it === void 0 || (_it$properties5 = it.properties) === null || _it$properties5 === void 0 || (_it$properties5 = _it$properties5.height) === null || _it$properties5 === void 0 ? void 0 : _it$properties5._length,
|
|
40
|
-
depth: it === null || it === void 0 || (_it$properties6 = it.properties) === null || _it$properties6 === void 0 || (_it$properties6 = _it$properties6.depth) === null || _it$properties6 === void 0 ? void 0 : _it$properties6._length
|
|
41
|
-
},
|
|
37
|
+
sizeinfo: it.sizeinfo,
|
|
42
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,
|
|
43
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,
|
|
44
40
|
ccdf: it.ccdf,
|
|
45
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,
|
|
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,
|
|
46
43
|
scene_cabinet_id: it.id
|
|
47
44
|
});
|
|
48
45
|
}
|
|
@@ -4,48 +4,38 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import { getDefaultInteriorTexture } from "../../../catalog/cabinet/cabinet-texture-resolver";
|
|
5
5
|
import { isEmpty } from "../../../utils/helper";
|
|
6
6
|
export function mapLoadProjectEvent(evt, state, defaultTextures) {
|
|
7
|
-
var _layer$layerId, _layer$layerId2;
|
|
8
7
|
// preprocessing for loading project
|
|
9
8
|
// this function make doorStyles using item's doorStyle
|
|
10
9
|
if (isEmpty(evt)) return null;
|
|
11
10
|
var layerId = evt.payload.layers['layer-1'].id;
|
|
12
11
|
var layer = evt.payload.layers;
|
|
13
|
-
var itemKeys
|
|
14
|
-
holeKeys = [];
|
|
15
|
-
if ((_layer$layerId = layer[layerId]) !== null && _layer$layerId !== void 0 && _layer$layerId.holes) holeKeys = Object.keys(layer[layerId].holes);
|
|
16
|
-
if ((_layer$layerId2 = layer[layerId]) !== null && _layer$layerId2 !== void 0 && _layer$layerId2.items) itemKeys = Object.keys(layer[layerId].items);
|
|
12
|
+
var itemKeys = Object.keys(layer[layerId].items);
|
|
17
13
|
if (isEmpty(layer)) return evt;
|
|
18
14
|
var handleTexture = layer[layerId].doorHandle;
|
|
19
15
|
var counterToptexture = layer[layerId].counterTop;
|
|
20
16
|
// make doorStyles and update the doorStyle payload
|
|
21
17
|
var Max_PH = 9;
|
|
22
|
-
for (var i = 0; i <
|
|
23
|
-
var
|
|
24
|
-
hole.type = hole.type.toLowerCase();
|
|
25
|
-
layer[layerId].holes[itemKeys[i]] = hole;
|
|
26
|
-
}
|
|
27
|
-
for (var _i = 0; _i < itemKeys.length; _i++) {
|
|
28
|
-
var item = layer[layerId].items[itemKeys[_i]];
|
|
29
|
-
item.type = item.type.toLowerCase();
|
|
18
|
+
for (var i = 0; i < itemKeys.length; i++) {
|
|
19
|
+
var item = layer[layerId].items[itemKeys[i]];
|
|
30
20
|
var doorStyle = item.doorStyle;
|
|
31
21
|
var doorStyles = {
|
|
32
22
|
base: doorStyle.texture,
|
|
33
23
|
counttop: counterToptexture,
|
|
34
24
|
interior: getDefaultInteriorTexture(defaultTextures)
|
|
35
25
|
};
|
|
36
|
-
for (var
|
|
37
|
-
doorStyles['base_door_' +
|
|
38
|
-
doorStyles['base_fixed_drawer_door_' +
|
|
39
|
-
doorStyles['base_drawer_' +
|
|
40
|
-
doorStyles['base_drawer_door_' +
|
|
41
|
-
doorStyles['door_handle_' +
|
|
42
|
-
doorStyles['fixed_drawer_door_handle_' +
|
|
43
|
-
doorStyles['drawer_door_handle_' +
|
|
26
|
+
for (var _i = 1; _i <= Max_PH; _i++) {
|
|
27
|
+
doorStyles['base_door_' + _i] = doorStyle.texture;
|
|
28
|
+
doorStyles['base_fixed_drawer_door_' + _i] = doorStyle.texture;
|
|
29
|
+
doorStyles['base_drawer_' + _i] = doorStyle.texture;
|
|
30
|
+
doorStyles['base_drawer_door_' + _i] = doorStyle.texture;
|
|
31
|
+
doorStyles['door_handle_' + _i] = handleTexture;
|
|
32
|
+
doorStyles['fixed_drawer_door_handle_' + _i] = handleTexture;
|
|
33
|
+
doorStyles['drawer_door_handle_' + _i] = handleTexture;
|
|
44
34
|
}
|
|
45
35
|
item.doorStyle = _objectSpread(_objectSpread({}, doorStyle), {}, {
|
|
46
36
|
doorStyles: doorStyles
|
|
47
37
|
});
|
|
48
|
-
layer[layerId].items[itemKeys[
|
|
38
|
+
layer[layerId].items[itemKeys[i]] = item;
|
|
49
39
|
}
|
|
50
40
|
return evt;
|
|
51
41
|
}
|
|
@@ -58,8 +48,8 @@ export function updateProjectWithCDSList(project, cdsList) {
|
|
|
58
48
|
if (isEmpty(itemKeys)) return project;
|
|
59
49
|
var _loop = function _loop(i) {
|
|
60
50
|
cdsList.forEach(function (cds) {
|
|
61
|
-
var _layer$
|
|
62
|
-
if (((_layer$
|
|
51
|
+
var _layer$layerId;
|
|
52
|
+
if (((_layer$layerId = layer[layerId]) === null || _layer$layerId === void 0 || (_layer$layerId = _layer$layerId.items[itemKeys[i]]) === null || _layer$layerId === void 0 ? void 0 : _layer$layerId.itemID) === (cds === null || cds === void 0 ? void 0 : cds.itemID)) {
|
|
63
53
|
layer[layerId].items[itemKeys[i]].doorStyle.cds = cds;
|
|
64
54
|
}
|
|
65
55
|
});
|
|
@@ -90,7 +90,6 @@ export var buildHoleElements = function buildHoleElements(holes) {
|
|
|
90
90
|
holes.forEach(function (hole) {
|
|
91
91
|
var _base$info6;
|
|
92
92
|
if (!hole || hole.is_deleted) return;
|
|
93
|
-
hole.name = hole.name.toLowerCase();
|
|
94
93
|
var base = findBaseHoleTemplate(hole, templates);
|
|
95
94
|
if (!base) return;
|
|
96
95
|
var element = buildHoleElementFromTemplate(hole, base);
|
|
@@ -547,7 +547,6 @@ function _addItemToCatalog() {
|
|
|
547
547
|
}
|
|
548
548
|
return _context5.abrupt("return");
|
|
549
549
|
case 1:
|
|
550
|
-
element.name = element.name.toLowerCase();
|
|
551
550
|
elementJs = populateCCDFList(element); // if (isEmpty(catalog?.elements[element.name])) {
|
|
552
551
|
_context5.next = 2;
|
|
553
552
|
return loadSVGsByItem(elementJs);
|
|
@@ -636,7 +635,6 @@ function _addItemToCatalog() {
|
|
|
636
635
|
|
|
637
636
|
// rplace new array to the elementJS
|
|
638
637
|
if (!(0, _helper.isEmpty)(mergedTempPlaceholder)) elementJs.structure_json.tempPlaceholders = mergedTempPlaceholder;
|
|
639
|
-
// elementJs.name = elementJs.name.toLowerCase
|
|
640
638
|
/***** join new tempPlaceholder to the old element - end *****/
|
|
641
639
|
|
|
642
640
|
elementJs = (0, _exporter["default"])(elementJs);
|
|
@@ -38,18 +38,15 @@ function _handleLoadProjectEvent() {
|
|
|
38
38
|
if (!ccdf_list.some(function (v) {
|
|
39
39
|
return v.scene_cabinet_id === it.id;
|
|
40
40
|
})) {
|
|
41
|
-
var _it$
|
|
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
|
-
sizeinfo:
|
|
45
|
-
width: it === null || it === void 0 || (_it$properties4 = it.properties) === null || _it$properties4 === void 0 || (_it$properties4 = _it$properties4.width) === null || _it$properties4 === void 0 ? void 0 : _it$properties4._length,
|
|
46
|
-
height: it === null || it === void 0 || (_it$properties5 = it.properties) === null || _it$properties5 === void 0 || (_it$properties5 = _it$properties5.height) === null || _it$properties5 === void 0 ? void 0 : _it$properties5._length,
|
|
47
|
-
depth: it === null || it === void 0 || (_it$properties6 = it.properties) === null || _it$properties6 === void 0 || (_it$properties6 = _it$properties6.depth) === null || _it$properties6 === void 0 ? void 0 : _it$properties6._length
|
|
48
|
-
},
|
|
44
|
+
sizeinfo: it.sizeinfo,
|
|
49
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,
|
|
50
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,
|
|
51
47
|
ccdf: it.ccdf,
|
|
52
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,
|
|
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,
|
|
53
50
|
scene_cabinet_id: it.id
|
|
54
51
|
});
|
|
55
52
|
}
|
|
@@ -12,48 +12,38 @@ var _helper = require("../../../utils/helper");
|
|
|
12
12
|
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; }
|
|
13
13
|
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; }
|
|
14
14
|
function mapLoadProjectEvent(evt, state, defaultTextures) {
|
|
15
|
-
var _layer$layerId, _layer$layerId2;
|
|
16
15
|
// preprocessing for loading project
|
|
17
16
|
// this function make doorStyles using item's doorStyle
|
|
18
17
|
if ((0, _helper.isEmpty)(evt)) return null;
|
|
19
18
|
var layerId = evt.payload.layers['layer-1'].id;
|
|
20
19
|
var layer = evt.payload.layers;
|
|
21
|
-
var itemKeys
|
|
22
|
-
holeKeys = [];
|
|
23
|
-
if ((_layer$layerId = layer[layerId]) !== null && _layer$layerId !== void 0 && _layer$layerId.holes) holeKeys = Object.keys(layer[layerId].holes);
|
|
24
|
-
if ((_layer$layerId2 = layer[layerId]) !== null && _layer$layerId2 !== void 0 && _layer$layerId2.items) itemKeys = Object.keys(layer[layerId].items);
|
|
20
|
+
var itemKeys = Object.keys(layer[layerId].items);
|
|
25
21
|
if ((0, _helper.isEmpty)(layer)) return evt;
|
|
26
22
|
var handleTexture = layer[layerId].doorHandle;
|
|
27
23
|
var counterToptexture = layer[layerId].counterTop;
|
|
28
24
|
// make doorStyles and update the doorStyle payload
|
|
29
25
|
var Max_PH = 9;
|
|
30
|
-
for (var i = 0; i <
|
|
31
|
-
var
|
|
32
|
-
hole.type = hole.type.toLowerCase();
|
|
33
|
-
layer[layerId].holes[itemKeys[i]] = hole;
|
|
34
|
-
}
|
|
35
|
-
for (var _i = 0; _i < itemKeys.length; _i++) {
|
|
36
|
-
var item = layer[layerId].items[itemKeys[_i]];
|
|
37
|
-
item.type = item.type.toLowerCase();
|
|
26
|
+
for (var i = 0; i < itemKeys.length; i++) {
|
|
27
|
+
var item = layer[layerId].items[itemKeys[i]];
|
|
38
28
|
var doorStyle = item.doorStyle;
|
|
39
29
|
var doorStyles = {
|
|
40
30
|
base: doorStyle.texture,
|
|
41
31
|
counttop: counterToptexture,
|
|
42
32
|
interior: (0, _cabinetTextureResolver.getDefaultInteriorTexture)(defaultTextures)
|
|
43
33
|
};
|
|
44
|
-
for (var
|
|
45
|
-
doorStyles['base_door_' +
|
|
46
|
-
doorStyles['base_fixed_drawer_door_' +
|
|
47
|
-
doorStyles['base_drawer_' +
|
|
48
|
-
doorStyles['base_drawer_door_' +
|
|
49
|
-
doorStyles['door_handle_' +
|
|
50
|
-
doorStyles['fixed_drawer_door_handle_' +
|
|
51
|
-
doorStyles['drawer_door_handle_' +
|
|
34
|
+
for (var _i = 1; _i <= Max_PH; _i++) {
|
|
35
|
+
doorStyles['base_door_' + _i] = doorStyle.texture;
|
|
36
|
+
doorStyles['base_fixed_drawer_door_' + _i] = doorStyle.texture;
|
|
37
|
+
doorStyles['base_drawer_' + _i] = doorStyle.texture;
|
|
38
|
+
doorStyles['base_drawer_door_' + _i] = doorStyle.texture;
|
|
39
|
+
doorStyles['door_handle_' + _i] = handleTexture;
|
|
40
|
+
doorStyles['fixed_drawer_door_handle_' + _i] = handleTexture;
|
|
41
|
+
doorStyles['drawer_door_handle_' + _i] = handleTexture;
|
|
52
42
|
}
|
|
53
43
|
item.doorStyle = _objectSpread(_objectSpread({}, doorStyle), {}, {
|
|
54
44
|
doorStyles: doorStyles
|
|
55
45
|
});
|
|
56
|
-
layer[layerId].items[itemKeys[
|
|
46
|
+
layer[layerId].items[itemKeys[i]] = item;
|
|
57
47
|
}
|
|
58
48
|
return evt;
|
|
59
49
|
}
|
|
@@ -66,8 +56,8 @@ function updateProjectWithCDSList(project, cdsList) {
|
|
|
66
56
|
if ((0, _helper.isEmpty)(itemKeys)) return project;
|
|
67
57
|
var _loop = function _loop(i) {
|
|
68
58
|
cdsList.forEach(function (cds) {
|
|
69
|
-
var _layer$
|
|
70
|
-
if (((_layer$
|
|
59
|
+
var _layer$layerId;
|
|
60
|
+
if (((_layer$layerId = layer[layerId]) === null || _layer$layerId === void 0 || (_layer$layerId = _layer$layerId.items[itemKeys[i]]) === null || _layer$layerId === void 0 ? void 0 : _layer$layerId.itemID) === (cds === null || cds === void 0 ? void 0 : cds.itemID)) {
|
|
71
61
|
layer[layerId].items[itemKeys[i]].doorStyle.cds = cds;
|
|
72
62
|
}
|
|
73
63
|
});
|
|
@@ -99,7 +99,6 @@ var buildHoleElements = exports.buildHoleElements = function buildHoleElements(h
|
|
|
99
99
|
holes.forEach(function (hole) {
|
|
100
100
|
var _base$info6;
|
|
101
101
|
if (!hole || hole.is_deleted) return;
|
|
102
|
-
hole.name = hole.name.toLowerCase();
|
|
103
102
|
var base = findBaseHoleTemplate(hole, templates);
|
|
104
103
|
if (!base) return;
|
|
105
104
|
var element = buildHoleElementFromTemplate(hole, base);
|