kitchen-simulator 2.0.17 → 2.0.21
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/catalog/holes/door-closet/planner-element.js +1 -1
- package/es/catalog/holes/door-exterior/planner-element.js +1 -1
- package/es/catalog/holes/door-interior/planner-element.js +1 -1
- package/es/catalog/holes/door-sliding/planner-element.js +1 -1
- package/es/catalog/holes/window-vertical/planner-element.js +1 -1
- package/es/components/viewer2d/viewer2d.js +0 -8
- package/es/utils/isolate-event-handler.js +24 -12
- package/lib/catalog/holes/door-closet/planner-element.js +1 -1
- package/lib/catalog/holes/door-exterior/planner-element.js +1 -1
- package/lib/catalog/holes/door-interior/planner-element.js +1 -1
- package/lib/catalog/holes/door-sliding/planner-element.js +1 -1
- package/lib/catalog/holes/window-vertical/planner-element.js +1 -1
- package/lib/components/viewer2d/viewer2d.js +0 -8
- package/lib/utils/isolate-event-handler.js +24 -12
- package/package.json +1 -1
|
@@ -797,14 +797,6 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
797
797
|
break;
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
|
-
if (!isEmpty(elementPrototype)) {
|
|
801
|
-
var elementID = state.getIn(['scene', 'layers', layerID, 'selected', elementPrototype]).first();
|
|
802
|
-
var currentObject = state.getIn(['scene', 'layers', layerID, elementPrototype, elementID]);
|
|
803
|
-
onInternalEvent === null || onInternalEvent === void 0 || onInternalEvent({
|
|
804
|
-
type: internalType,
|
|
805
|
-
value: currentObject === null || currentObject === void 0 ? void 0 : currentObject.toJS()
|
|
806
|
-
});
|
|
807
|
-
}
|
|
808
800
|
viewerEvent.originalEvent.stopPropagation();
|
|
809
801
|
};
|
|
810
802
|
var onMouseDown = function onMouseDown(viewerEvent) {
|
|
@@ -133,10 +133,11 @@ function _parseTempPlaceholdersFromCabinetPayload() {
|
|
|
133
133
|
tempPlaceholders.map(function (element) {
|
|
134
134
|
var sink_match = element.name.match(/\d_(sink_[^LR12]*)(_[LR12])?$/);
|
|
135
135
|
if (sink_match && sink_match.length >= 2) {
|
|
136
|
+
var _cabinetPayload$struc2;
|
|
136
137
|
tempData['sink'] = tempData['sink'] || [];
|
|
137
138
|
tempData['sink'].push(element.name);
|
|
138
|
-
var sink_url = process.env.
|
|
139
|
-
|
|
139
|
+
var sink_url = process.env.API_URL + "/uploads/assets/default/".concat(sink_match[1], ".gltf");
|
|
140
|
+
if (cabinetPayload !== null && cabinetPayload !== void 0 && (_cabinetPayload$struc2 = cabinetPayload.structure_json) !== null && _cabinetPayload$struc2 !== void 0 && (_cabinetPayload$struc2 = _cabinetPayload$struc2.tempPlaceholders[0]) !== null && _cabinetPayload$struc2 !== void 0 && _cabinetPayload$struc2.structure) cabinetPayload.structure_json.tempPlaceholders[0].structure.sink = sink_url;
|
|
140
141
|
} else if (temp.some(function (felement) {
|
|
141
142
|
return felement.name.includes('base_drawer');
|
|
142
143
|
}) && element.name.includes('interior_drawer')) {
|
|
@@ -499,19 +500,26 @@ function addItemToCatalog(_x5, _x6, _x7, _x8) {
|
|
|
499
500
|
} // Get attributs of current selected element
|
|
500
501
|
function _addItemToCatalog() {
|
|
501
502
|
_addItemToCatalog = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(element, state, catalogInstance, projectActions) {
|
|
503
|
+
var _element, _element2;
|
|
502
504
|
var elementJs, catalog, outlineSVGData, updatedStructureJson;
|
|
503
505
|
return _regeneratorRuntime.wrap(function (_context5) {
|
|
504
506
|
while (1) switch (_context5.prev = _context5.next) {
|
|
505
507
|
case 0:
|
|
508
|
+
if (!isEmpty((_element = element) === null || _element === void 0 ? void 0 : _element.name)) {
|
|
509
|
+
_context5.next = 1;
|
|
510
|
+
break;
|
|
511
|
+
}
|
|
512
|
+
return _context5.abrupt("return");
|
|
513
|
+
case 1:
|
|
506
514
|
elementJs = element;
|
|
507
515
|
catalog = state.getIn(['catalog']).toJS(); // add item to catalog of state
|
|
508
516
|
// if (isEmpty(catalog?.elements[element.name])) {
|
|
509
|
-
_context5.next =
|
|
517
|
+
_context5.next = 2;
|
|
510
518
|
return loadSVGsByItem(element);
|
|
511
|
-
case
|
|
519
|
+
case 2:
|
|
512
520
|
outlineSVGData = _context5.sent;
|
|
513
|
-
if (!(element.type === 'cabinet')) {
|
|
514
|
-
_context5.next =
|
|
521
|
+
if (!(((_element2 = element) === null || _element2 === void 0 ? void 0 : _element2.type) === 'cabinet')) {
|
|
522
|
+
_context5.next = 4;
|
|
515
523
|
break;
|
|
516
524
|
}
|
|
517
525
|
// make placeholders of element and tempPlaceholder
|
|
@@ -523,11 +531,11 @@ function _addItemToCatalog() {
|
|
|
523
531
|
itemID: element.itemID
|
|
524
532
|
}
|
|
525
533
|
});
|
|
526
|
-
_context5.next =
|
|
534
|
+
_context5.next = 3;
|
|
527
535
|
return updateCabinetPayload(element);
|
|
528
|
-
case 2:
|
|
529
|
-
elementJs = _context5.sent;
|
|
530
536
|
case 3:
|
|
537
|
+
elementJs = _context5.sent;
|
|
538
|
+
case 4:
|
|
531
539
|
elementJs = _objectSpread(_objectSpread({}, elementJs), {}, {
|
|
532
540
|
outlineSVGData: outlineSVGData,
|
|
533
541
|
type: element.type,
|
|
@@ -540,7 +548,7 @@ function _addItemToCatalog() {
|
|
|
540
548
|
projectActions.addElementToCatalog(elementJs);
|
|
541
549
|
}
|
|
542
550
|
// }
|
|
543
|
-
case
|
|
551
|
+
case 5:
|
|
544
552
|
case "end":
|
|
545
553
|
return _context5.stop();
|
|
546
554
|
}
|
|
@@ -1007,9 +1015,13 @@ function _handleExternalEvent() {
|
|
|
1007
1015
|
it = evt === null || evt === void 0 || (_evt$payload2 = evt.payload) === null || _evt$payload2 === void 0 || (_evt$payload2 = _evt$payload2.layers['layer-1']) === null || _evt$payload2 === void 0 ? void 0 : _evt$payload2.items[itemKeys[i]];
|
|
1008
1016
|
if (!cdsItems.some(function (v) {
|
|
1009
1017
|
var _it$doorStyle;
|
|
1010
|
-
return it.
|
|
1018
|
+
return it.itemId === v.itemId && it.name === v.name && ((_it$doorStyle = it.doorStyle) === null || _it$doorStyle === void 0 || (_it$doorStyle = _it$doorStyle.doorStyles) === null || _it$doorStyle === void 0 ? void 0 : _it$doorStyle.cabinet_door_style_id) === v.cdsId;
|
|
1011
1019
|
})) cdsItems.push({
|
|
1012
|
-
|
|
1020
|
+
itemId: it.itemId,
|
|
1021
|
+
name: it.name,
|
|
1022
|
+
sku_number: it.sku_number,
|
|
1023
|
+
category: it.category,
|
|
1024
|
+
prototype: it.prototype,
|
|
1013
1025
|
cdsId: (_it$doorStyle2 = it.doorStyle) === null || _it$doorStyle2 === void 0 || (_it$doorStyle2 = _it$doorStyle2.doorStyles) === null || _it$doorStyle2 === void 0 ? void 0 : _it$doorStyle2.cabinet_door_style_id
|
|
1014
1026
|
});
|
|
1015
1027
|
case 1:
|
|
@@ -807,14 +807,6 @@ function Viewer2D(_ref, _ref2) {
|
|
|
807
807
|
break;
|
|
808
808
|
}
|
|
809
809
|
}
|
|
810
|
-
if (!(0, _helper.isEmpty)(elementPrototype)) {
|
|
811
|
-
var elementID = state.getIn(['scene', 'layers', layerID, 'selected', elementPrototype]).first();
|
|
812
|
-
var currentObject = state.getIn(['scene', 'layers', layerID, elementPrototype, elementID]);
|
|
813
|
-
onInternalEvent === null || onInternalEvent === void 0 || onInternalEvent({
|
|
814
|
-
type: internalType,
|
|
815
|
-
value: currentObject === null || currentObject === void 0 ? void 0 : currentObject.toJS()
|
|
816
|
-
});
|
|
817
|
-
}
|
|
818
810
|
viewerEvent.originalEvent.stopPropagation();
|
|
819
811
|
};
|
|
820
812
|
var onMouseDown = function onMouseDown(viewerEvent) {
|
|
@@ -140,10 +140,11 @@ function _parseTempPlaceholdersFromCabinetPayload() {
|
|
|
140
140
|
tempPlaceholders.map(function (element) {
|
|
141
141
|
var sink_match = element.name.match(/\d_(sink_[^LR12]*)(_[LR12])?$/);
|
|
142
142
|
if (sink_match && sink_match.length >= 2) {
|
|
143
|
+
var _cabinetPayload$struc2;
|
|
143
144
|
tempData['sink'] = tempData['sink'] || [];
|
|
144
145
|
tempData['sink'].push(element.name);
|
|
145
|
-
var sink_url = process.env.
|
|
146
|
-
|
|
146
|
+
var sink_url = process.env.API_URL + "/uploads/assets/default/".concat(sink_match[1], ".gltf");
|
|
147
|
+
if (cabinetPayload !== null && cabinetPayload !== void 0 && (_cabinetPayload$struc2 = cabinetPayload.structure_json) !== null && _cabinetPayload$struc2 !== void 0 && (_cabinetPayload$struc2 = _cabinetPayload$struc2.tempPlaceholders[0]) !== null && _cabinetPayload$struc2 !== void 0 && _cabinetPayload$struc2.structure) cabinetPayload.structure_json.tempPlaceholders[0].structure.sink = sink_url;
|
|
147
148
|
} else if (temp.some(function (felement) {
|
|
148
149
|
return felement.name.includes('base_drawer');
|
|
149
150
|
}) && element.name.includes('interior_drawer')) {
|
|
@@ -506,19 +507,26 @@ function addItemToCatalog(_x5, _x6, _x7, _x8) {
|
|
|
506
507
|
} // Get attributs of current selected element
|
|
507
508
|
function _addItemToCatalog() {
|
|
508
509
|
_addItemToCatalog = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(element, state, catalogInstance, projectActions) {
|
|
510
|
+
var _element, _element2;
|
|
509
511
|
var elementJs, catalog, outlineSVGData, updatedStructureJson;
|
|
510
512
|
return _regenerator["default"].wrap(function (_context5) {
|
|
511
513
|
while (1) switch (_context5.prev = _context5.next) {
|
|
512
514
|
case 0:
|
|
515
|
+
if (!(0, _helper.isEmpty)((_element = element) === null || _element === void 0 ? void 0 : _element.name)) {
|
|
516
|
+
_context5.next = 1;
|
|
517
|
+
break;
|
|
518
|
+
}
|
|
519
|
+
return _context5.abrupt("return");
|
|
520
|
+
case 1:
|
|
513
521
|
elementJs = element;
|
|
514
522
|
catalog = state.getIn(['catalog']).toJS(); // add item to catalog of state
|
|
515
523
|
// if (isEmpty(catalog?.elements[element.name])) {
|
|
516
|
-
_context5.next =
|
|
524
|
+
_context5.next = 2;
|
|
517
525
|
return loadSVGsByItem(element);
|
|
518
|
-
case
|
|
526
|
+
case 2:
|
|
519
527
|
outlineSVGData = _context5.sent;
|
|
520
|
-
if (!(element.type === 'cabinet')) {
|
|
521
|
-
_context5.next =
|
|
528
|
+
if (!(((_element2 = element) === null || _element2 === void 0 ? void 0 : _element2.type) === 'cabinet')) {
|
|
529
|
+
_context5.next = 4;
|
|
522
530
|
break;
|
|
523
531
|
}
|
|
524
532
|
// make placeholders of element and tempPlaceholder
|
|
@@ -530,11 +538,11 @@ function _addItemToCatalog() {
|
|
|
530
538
|
itemID: element.itemID
|
|
531
539
|
}
|
|
532
540
|
});
|
|
533
|
-
_context5.next =
|
|
541
|
+
_context5.next = 3;
|
|
534
542
|
return updateCabinetPayload(element);
|
|
535
|
-
case 2:
|
|
536
|
-
elementJs = _context5.sent;
|
|
537
543
|
case 3:
|
|
544
|
+
elementJs = _context5.sent;
|
|
545
|
+
case 4:
|
|
538
546
|
elementJs = _objectSpread(_objectSpread({}, elementJs), {}, {
|
|
539
547
|
outlineSVGData: outlineSVGData,
|
|
540
548
|
type: element.type,
|
|
@@ -547,7 +555,7 @@ function _addItemToCatalog() {
|
|
|
547
555
|
projectActions.addElementToCatalog(elementJs);
|
|
548
556
|
}
|
|
549
557
|
// }
|
|
550
|
-
case
|
|
558
|
+
case 5:
|
|
551
559
|
case "end":
|
|
552
560
|
return _context5.stop();
|
|
553
561
|
}
|
|
@@ -1014,9 +1022,13 @@ function _handleExternalEvent() {
|
|
|
1014
1022
|
it = evt === null || evt === void 0 || (_evt$payload2 = evt.payload) === null || _evt$payload2 === void 0 || (_evt$payload2 = _evt$payload2.layers['layer-1']) === null || _evt$payload2 === void 0 ? void 0 : _evt$payload2.items[itemKeys[i]];
|
|
1015
1023
|
if (!cdsItems.some(function (v) {
|
|
1016
1024
|
var _it$doorStyle;
|
|
1017
|
-
return it.
|
|
1025
|
+
return it.itemId === v.itemId && it.name === v.name && ((_it$doorStyle = it.doorStyle) === null || _it$doorStyle === void 0 || (_it$doorStyle = _it$doorStyle.doorStyles) === null || _it$doorStyle === void 0 ? void 0 : _it$doorStyle.cabinet_door_style_id) === v.cdsId;
|
|
1018
1026
|
})) cdsItems.push({
|
|
1019
|
-
|
|
1027
|
+
itemId: it.itemId,
|
|
1028
|
+
name: it.name,
|
|
1029
|
+
sku_number: it.sku_number,
|
|
1030
|
+
category: it.category,
|
|
1031
|
+
prototype: it.prototype,
|
|
1020
1032
|
cdsId: (_it$doorStyle2 = it.doorStyle) === null || _it$doorStyle2 === void 0 || (_it$doorStyle2 = _it$doorStyle2.doorStyles) === null || _it$doorStyle2 === void 0 ? void 0 : _it$doorStyle2.cabinet_door_style_id
|
|
1021
1033
|
});
|
|
1022
1034
|
case 1:
|