kitchen-simulator 3.16.0-test-renderer-fix → 3.16.1-test-renderer-fix
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/LiteKitchenConfigurator.js +23 -37
- package/es/LiteRenderer.js +12 -18
- package/es/utils/isolate-event-handler.js +265 -210
- package/lib/LiteKitchenConfigurator.js +23 -37
- package/lib/LiteRenderer.js +12 -18
- package/lib/utils/isolate-event-handler.js +266 -210
- package/package.json +1 -1
|
@@ -17,34 +17,63 @@ import { SVGLoader } from 'three/addons/loaders/SVGLoader';
|
|
|
17
17
|
import { getMoldingDataOfScene2 } from "./molding";
|
|
18
18
|
import { Scene, State } from "../models";
|
|
19
19
|
var PRECISION = 2;
|
|
20
|
+
|
|
21
|
+
// ---- compatibility: supports old + optimized props shapes ----
|
|
22
|
+
export function getPlannerStateFromProps(props) {
|
|
23
|
+
var _props$state;
|
|
24
|
+
// New optimized path
|
|
25
|
+
if (props !== null && props !== void 0 && props.extractedState) return props.extractedState;
|
|
26
|
+
|
|
27
|
+
// Old path
|
|
28
|
+
if (props !== null && props !== void 0 && (_props$state = props.state) !== null && _props$state !== void 0 && _props$state.get) {
|
|
29
|
+
var kc = props.state.get('KitchenConfigurator');
|
|
30
|
+
if (kc) return kc;
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// ---- caches: avoid re-fetch/re-parse costs (no behavior change) ----
|
|
36
|
+
var __jsonCache = new Map(); // url -> Promise<any>
|
|
37
|
+
var __svgCache = new Map(); // url -> Promise<svgData|null>
|
|
20
38
|
function loadJSON(_x) {
|
|
21
39
|
return _loadJSON.apply(this, arguments);
|
|
22
40
|
}
|
|
23
41
|
/********Parse TempPlaceholder from cabinetPayloadData **************/
|
|
24
42
|
function _loadJSON() {
|
|
25
|
-
_loadJSON = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
26
|
-
|
|
27
|
-
|
|
43
|
+
_loadJSON = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(path) {
|
|
44
|
+
var p;
|
|
45
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
46
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
28
47
|
case 0:
|
|
29
|
-
|
|
48
|
+
if (path) {
|
|
49
|
+
_context3.next = 1;
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
return _context3.abrupt("return", null);
|
|
53
|
+
case 1:
|
|
54
|
+
if (!__jsonCache.has(path)) {
|
|
55
|
+
_context3.next = 2;
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
return _context3.abrupt("return", __jsonCache.get(path));
|
|
59
|
+
case 2:
|
|
60
|
+
p = new Promise(function (resolve, reject) {
|
|
30
61
|
var xhr = new XMLHttpRequest();
|
|
31
62
|
xhr.onreadystatechange = function () {
|
|
32
63
|
if (xhr.readyState === XMLHttpRequest.DONE) {
|
|
33
|
-
if (xhr.status === 200)
|
|
34
|
-
resolve(JSON.parse(xhr.responseText));
|
|
35
|
-
} else {
|
|
36
|
-
reject(xhr);
|
|
37
|
-
}
|
|
64
|
+
if (xhr.status === 200) resolve(JSON.parse(xhr.responseText));else reject(xhr);
|
|
38
65
|
}
|
|
39
66
|
};
|
|
40
67
|
xhr.open('GET', path, true);
|
|
41
68
|
xhr.send();
|
|
42
|
-
})
|
|
43
|
-
|
|
69
|
+
});
|
|
70
|
+
__jsonCache.set(path, p);
|
|
71
|
+
return _context3.abrupt("return", p);
|
|
72
|
+
case 3:
|
|
44
73
|
case "end":
|
|
45
|
-
return
|
|
74
|
+
return _context3.stop();
|
|
46
75
|
}
|
|
47
|
-
},
|
|
76
|
+
}, _callee3);
|
|
48
77
|
}));
|
|
49
78
|
return _loadJSON.apply(this, arguments);
|
|
50
79
|
}
|
|
@@ -53,10 +82,10 @@ function parseTempPlaceholdersFromCabinetPayload(_x2) {
|
|
|
53
82
|
}
|
|
54
83
|
/***** Update cabinetPayloadData with updatedTempPlaceholders *****/
|
|
55
84
|
function _parseTempPlaceholdersFromCabinetPayload() {
|
|
56
|
-
_parseTempPlaceholdersFromCabinetPayload = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
85
|
+
_parseTempPlaceholdersFromCabinetPayload = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(cabinetPayload) {
|
|
57
86
|
var link, keys, temp, i, _cabinetPayload$struc, _cabinetPayload$struc2, el, tempPlaceholdersData, tempData, doorKey, drawerKey, fixedKey, doorPHs, drawerPHs, has_single_door, fixedPHs, _t2, _t3, _t4;
|
|
58
|
-
return _regeneratorRuntime.wrap(function (
|
|
59
|
-
while (1) switch (
|
|
87
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
88
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
60
89
|
case 0:
|
|
61
90
|
link = '';
|
|
62
91
|
keys = Object.keys(cabinetPayload.structure_json);
|
|
@@ -64,27 +93,27 @@ function _parseTempPlaceholdersFromCabinetPayload() {
|
|
|
64
93
|
i = 0;
|
|
65
94
|
case 1:
|
|
66
95
|
if (!(i < keys.length)) {
|
|
67
|
-
|
|
96
|
+
_context4.next = 4;
|
|
68
97
|
break;
|
|
69
98
|
}
|
|
70
99
|
if (!((_cabinetPayload$struc = cabinetPayload.structure_json[keys[i]]) !== null && _cabinetPayload$struc !== void 0 && (_cabinetPayload$struc = _cabinetPayload$struc.toString()) !== null && _cabinetPayload$struc !== void 0 && _cabinetPayload$struc.includes('.gltf') && (_cabinetPayload$struc2 = cabinetPayload.structure_json[keys[i]]) !== null && _cabinetPayload$struc2 !== void 0 && (_cabinetPayload$struc2 = _cabinetPayload$struc2.toString()) !== null && _cabinetPayload$struc2 !== void 0 && _cabinetPayload$struc2.startsWith('http'))) {
|
|
71
|
-
|
|
100
|
+
_context4.next = 3;
|
|
72
101
|
break;
|
|
73
102
|
}
|
|
74
103
|
link = cabinetPayload.structure_json[keys[i]];
|
|
75
104
|
_t2 = temp;
|
|
76
105
|
_t3 = keys[i];
|
|
77
|
-
|
|
106
|
+
_context4.next = 2;
|
|
78
107
|
return loadJSON(link);
|
|
79
108
|
case 2:
|
|
80
|
-
_t4 =
|
|
109
|
+
_t4 = _context4.sent;
|
|
81
110
|
_t2.push.call(_t2, {
|
|
82
111
|
name: _t3,
|
|
83
112
|
data: _t4
|
|
84
113
|
});
|
|
85
114
|
case 3:
|
|
86
115
|
i++;
|
|
87
|
-
|
|
116
|
+
_context4.next = 1;
|
|
88
117
|
break;
|
|
89
118
|
case 4:
|
|
90
119
|
el = cabinetPayload.structure_json.tempPlaceholders[0].id;
|
|
@@ -387,12 +416,12 @@ function _parseTempPlaceholdersFromCabinetPayload() {
|
|
|
387
416
|
placeholders: tempData,
|
|
388
417
|
structure: cabinetPayload.structure_json.tempPlaceholders[0].structure
|
|
389
418
|
});
|
|
390
|
-
return
|
|
419
|
+
return _context4.abrupt("return", tempPlaceholdersData);
|
|
391
420
|
case 5:
|
|
392
421
|
case "end":
|
|
393
|
-
return
|
|
422
|
+
return _context4.stop();
|
|
394
423
|
}
|
|
395
|
-
},
|
|
424
|
+
}, _callee4);
|
|
396
425
|
}));
|
|
397
426
|
return _parseTempPlaceholdersFromCabinetPayload.apply(this, arguments);
|
|
398
427
|
}
|
|
@@ -400,16 +429,16 @@ function updateCabinetPayload(_x3) {
|
|
|
400
429
|
return _updateCabinetPayload.apply(this, arguments);
|
|
401
430
|
}
|
|
402
431
|
function _updateCabinetPayload() {
|
|
403
|
-
_updateCabinetPayload = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
432
|
+
_updateCabinetPayload = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(cabinetPayload) {
|
|
404
433
|
var tempPlaceholders, cabinetPayloadKeys, i;
|
|
405
|
-
return _regeneratorRuntime.wrap(function (
|
|
406
|
-
while (1) switch (
|
|
434
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
435
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
407
436
|
case 0:
|
|
408
437
|
tempPlaceholders = [];
|
|
409
|
-
|
|
438
|
+
_context5.next = 1;
|
|
410
439
|
return parseTempPlaceholdersFromCabinetPayload(cabinetPayload);
|
|
411
440
|
case 1:
|
|
412
|
-
tempPlaceholders =
|
|
441
|
+
tempPlaceholders = _context5.sent;
|
|
413
442
|
cabinetPayloadKeys = Object.keys(cabinetPayload);
|
|
414
443
|
for (i = 0; i < cabinetPayloadKeys.length; i++) {
|
|
415
444
|
if (cabinetPayloadKeys[i] === 'structure_json') {
|
|
@@ -417,62 +446,82 @@ function _updateCabinetPayload() {
|
|
|
417
446
|
cabinetPayload[cabinetPayloadKeys[i]]['tempPlaceholders'] = tempPlaceholders;
|
|
418
447
|
}
|
|
419
448
|
}
|
|
420
|
-
return
|
|
449
|
+
return _context5.abrupt("return", cabinetPayload);
|
|
421
450
|
case 2:
|
|
422
451
|
case "end":
|
|
423
|
-
return
|
|
452
|
+
return _context5.stop();
|
|
424
453
|
}
|
|
425
|
-
},
|
|
454
|
+
}, _callee5);
|
|
426
455
|
}));
|
|
427
456
|
return _updateCabinetPayload.apply(this, arguments);
|
|
428
457
|
}
|
|
429
458
|
var loadSVGsByItem = /*#__PURE__*/function () {
|
|
430
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
431
|
-
var
|
|
432
|
-
return _regeneratorRuntime.wrap(function (
|
|
433
|
-
while (1) switch (
|
|
459
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(item) {
|
|
460
|
+
var url, p;
|
|
461
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
462
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
434
463
|
case 0:
|
|
435
|
-
if (item.outline) {
|
|
436
|
-
|
|
464
|
+
if (item !== null && item !== void 0 && item.outline) {
|
|
465
|
+
_context2.next = 1;
|
|
437
466
|
break;
|
|
438
467
|
}
|
|
439
|
-
return
|
|
468
|
+
return _context2.abrupt("return", null);
|
|
440
469
|
case 1:
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
cache: 'no-store'
|
|
445
|
-
});
|
|
446
|
-
case 2:
|
|
447
|
-
response = _context.sent;
|
|
448
|
-
_context.next = 3;
|
|
449
|
-
return response.text();
|
|
450
|
-
case 3:
|
|
451
|
-
svgText = _context.sent;
|
|
452
|
-
loader = new SVGLoader();
|
|
453
|
-
parsed = loader.parse(svgText);
|
|
454
|
-
if (!isEmpty(parsed.paths)) {
|
|
455
|
-
_context.next = 4;
|
|
470
|
+
url = item.outline;
|
|
471
|
+
if (!__svgCache.has(url)) {
|
|
472
|
+
_context2.next = 2;
|
|
456
473
|
break;
|
|
457
474
|
}
|
|
458
|
-
return
|
|
459
|
-
case
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
475
|
+
return _context2.abrupt("return", __svgCache.get(url));
|
|
476
|
+
case 2:
|
|
477
|
+
p = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
478
|
+
var _parsed$xml$viewBox, _parsed$xml$viewBox2, response, svgText, loader, parsed, _t;
|
|
479
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
480
|
+
while (1) switch (_context.prev = _context.next) {
|
|
481
|
+
case 0:
|
|
482
|
+
_context.prev = 0;
|
|
483
|
+
_context.next = 1;
|
|
484
|
+
return fetch(url, {
|
|
485
|
+
cache: 'no-store'
|
|
486
|
+
});
|
|
487
|
+
case 1:
|
|
488
|
+
response = _context.sent;
|
|
489
|
+
_context.next = 2;
|
|
490
|
+
return response.text();
|
|
491
|
+
case 2:
|
|
492
|
+
svgText = _context.sent;
|
|
493
|
+
loader = new SVGLoader();
|
|
494
|
+
parsed = loader.parse(svgText);
|
|
495
|
+
if (!isEmpty(parsed.paths)) {
|
|
496
|
+
_context.next = 3;
|
|
497
|
+
break;
|
|
498
|
+
}
|
|
499
|
+
return _context.abrupt("return", null);
|
|
500
|
+
case 3:
|
|
501
|
+
return _context.abrupt("return", {
|
|
502
|
+
paths: parsed.paths,
|
|
503
|
+
svgWidth: parseFloat(parsed.xml.getAttribute('width')) || ((_parsed$xml$viewBox = parsed.xml.viewBox) === null || _parsed$xml$viewBox === void 0 || (_parsed$xml$viewBox = _parsed$xml$viewBox.animVal) === null || _parsed$xml$viewBox === void 0 ? void 0 : _parsed$xml$viewBox.width) || 0,
|
|
504
|
+
svgHeight: parseFloat(parsed.xml.getAttribute('height')) || ((_parsed$xml$viewBox2 = parsed.xml.viewBox) === null || _parsed$xml$viewBox2 === void 0 || (_parsed$xml$viewBox2 = _parsed$xml$viewBox2.animVal) === null || _parsed$xml$viewBox2 === void 0 ? void 0 : _parsed$xml$viewBox2.height) || 0,
|
|
505
|
+
reverse: !parseFloat(parsed.xml.getAttribute('height'))
|
|
506
|
+
});
|
|
507
|
+
case 4:
|
|
508
|
+
_context.prev = 4;
|
|
509
|
+
_t = _context["catch"](0);
|
|
510
|
+
console.error('Failed to load SVG:', url, _t);
|
|
511
|
+
return _context.abrupt("return", null);
|
|
512
|
+
case 5:
|
|
513
|
+
case "end":
|
|
514
|
+
return _context.stop();
|
|
515
|
+
}
|
|
516
|
+
}, _callee, null, [[0, 4]]);
|
|
517
|
+
}))();
|
|
518
|
+
__svgCache.set(url, p);
|
|
519
|
+
return _context2.abrupt("return", p);
|
|
520
|
+
case 3:
|
|
472
521
|
case "end":
|
|
473
|
-
return
|
|
522
|
+
return _context2.stop();
|
|
474
523
|
}
|
|
475
|
-
},
|
|
524
|
+
}, _callee2);
|
|
476
525
|
}));
|
|
477
526
|
return function loadSVGsByItem(_x4) {
|
|
478
527
|
return _ref.apply(this, arguments);
|
|
@@ -482,26 +531,26 @@ function addItemToCatalog(_x5, _x6, _x7, _x8) {
|
|
|
482
531
|
return _addItemToCatalog.apply(this, arguments);
|
|
483
532
|
} // Get attributs of current selected element
|
|
484
533
|
function _addItemToCatalog() {
|
|
485
|
-
_addItemToCatalog = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
534
|
+
_addItemToCatalog = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(element, state, catalogInstance, projectActions) {
|
|
486
535
|
var _elementJs, _elementJs3;
|
|
487
536
|
var elementJs, outlineSVGData, _state$getIn, _elementJs$structure_, _elementJs$structure_2, _elementJs$structure_3, cds, _cds$find, _elementJs2, currentCdsId, cdsIdx, ttph, updatedStructureJson, catalogElements, catalogElementKeys, catalogItem, k, _catalogElements$cata, tempPlaceholderArray, _catalogItem$structur, newTempPlaceholderArray, mergedTempPlaceholder;
|
|
488
|
-
return _regeneratorRuntime.wrap(function (
|
|
489
|
-
while (1) switch (
|
|
537
|
+
return _regeneratorRuntime.wrap(function (_context6) {
|
|
538
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
490
539
|
case 0:
|
|
491
540
|
if (!isEmpty(element === null || element === void 0 ? void 0 : element.name)) {
|
|
492
|
-
|
|
541
|
+
_context6.next = 1;
|
|
493
542
|
break;
|
|
494
543
|
}
|
|
495
|
-
return
|
|
544
|
+
return _context6.abrupt("return");
|
|
496
545
|
case 1:
|
|
497
546
|
// clone element
|
|
498
547
|
elementJs = Object.assign({}, element); // if (isEmpty(catalog?.elements[element.name])) {
|
|
499
|
-
|
|
548
|
+
_context6.next = 2;
|
|
500
549
|
return loadSVGsByItem(elementJs);
|
|
501
550
|
case 2:
|
|
502
|
-
outlineSVGData =
|
|
551
|
+
outlineSVGData = _context6.sent;
|
|
503
552
|
if (!(((_elementJs = elementJs) === null || _elementJs === void 0 ? void 0 : _elementJs.type) === 'cabinet')) {
|
|
504
|
-
|
|
553
|
+
_context6.next = 4;
|
|
505
554
|
break;
|
|
506
555
|
}
|
|
507
556
|
// move the tempPlaceholder of current door style to first of tempPlaceholders array
|
|
@@ -529,13 +578,13 @@ function _addItemToCatalog() {
|
|
|
529
578
|
}
|
|
530
579
|
});
|
|
531
580
|
if (isEmpty((_elementJs$structure_3 = elementJs.structure_json) === null || _elementJs$structure_3 === void 0 ? void 0 : _elementJs$structure_3.tempPlaceholders)) {
|
|
532
|
-
|
|
581
|
+
_context6.next = 4;
|
|
533
582
|
break;
|
|
534
583
|
}
|
|
535
|
-
|
|
584
|
+
_context6.next = 3;
|
|
536
585
|
return updateCabinetPayload(elementJs);
|
|
537
586
|
case 3:
|
|
538
|
-
elementJs =
|
|
587
|
+
elementJs = _context6.sent;
|
|
539
588
|
case 4:
|
|
540
589
|
elementJs = _objectSpread(_objectSpread({}, elementJs), {}, {
|
|
541
590
|
outlineSVGData: outlineSVGData,
|
|
@@ -552,18 +601,18 @@ function _addItemToCatalog() {
|
|
|
552
601
|
k = 0;
|
|
553
602
|
case 5:
|
|
554
603
|
if (!(k < catalogElementKeys.length)) {
|
|
555
|
-
|
|
604
|
+
_context6.next = 7;
|
|
556
605
|
break;
|
|
557
606
|
}
|
|
558
607
|
if (!(((_catalogElements$cata = catalogElements[catalogElementKeys[k]]) === null || _catalogElements$cata === void 0 ? void 0 : _catalogElements$cata.itemID) === elementJs.itemID)) {
|
|
559
|
-
|
|
608
|
+
_context6.next = 6;
|
|
560
609
|
break;
|
|
561
610
|
}
|
|
562
611
|
catalogItem = catalogElements[catalogElementKeys[k]];
|
|
563
|
-
return
|
|
612
|
+
return _context6.abrupt("continue", 7);
|
|
564
613
|
case 6:
|
|
565
614
|
k++;
|
|
566
|
-
|
|
615
|
+
_context6.next = 5;
|
|
567
616
|
break;
|
|
568
617
|
case 7:
|
|
569
618
|
// get old tempPlaceholder array from catalog item
|
|
@@ -594,9 +643,9 @@ function _addItemToCatalog() {
|
|
|
594
643
|
}
|
|
595
644
|
case 8:
|
|
596
645
|
case "end":
|
|
597
|
-
return
|
|
646
|
+
return _context6.stop();
|
|
598
647
|
}
|
|
599
|
-
},
|
|
648
|
+
}, _callee6);
|
|
600
649
|
}));
|
|
601
650
|
return _addItemToCatalog.apply(this, arguments);
|
|
602
651
|
}
|
|
@@ -826,8 +875,8 @@ function updateAttributeOfSelectedElement(element, attrPayload, state, layer, ca
|
|
|
826
875
|
var xp = (lengthValue + halfWidthLength) * Math.cos(alpha) + x0;
|
|
827
876
|
var yp = (lengthValue + halfWidthLength) * Math.sin(alpha) + y0;
|
|
828
877
|
var offset = GeometryUtils.pointPositionOnLineSegment(x0, y0, x1, y1, xp, yp);
|
|
829
|
-
/*
|
|
830
|
-
if (x0 > x1) offset = 1 - offset;
|
|
878
|
+
/*
|
|
879
|
+
if (x0 > x1) offset = 1 - offset;
|
|
831
880
|
*/
|
|
832
881
|
var endAt = MathUtils.toFixedFloat(lineLength - lineLength * offset - halfWidthLength, PRECISION);
|
|
833
882
|
var offsetUnit = attributesFormData.getIn(['offsetB', '_unit']);
|
|
@@ -864,8 +913,8 @@ function updateAttributeOfSelectedElement(element, attrPayload, state, layer, ca
|
|
|
864
913
|
var _xp = _x0 - (_lengthValue + _halfWidthLength) * Math.cos(_alpha);
|
|
865
914
|
var _yp = _y2 - (_lengthValue + _halfWidthLength) * Math.sin(_alpha);
|
|
866
915
|
var _offset = GeometryUtils.pointPositionOnLineSegment(_x9, _y, _x0, _y2, _xp, _yp);
|
|
867
|
-
/*
|
|
868
|
-
if (x0 > x1) offset = 1 - offset;
|
|
916
|
+
/*
|
|
917
|
+
if (x0 > x1) offset = 1 - offset;
|
|
869
918
|
*/
|
|
870
919
|
var startAt = MathUtils.toFixedFloat(_lineLength * _offset - _halfWidthLength, PRECISION);
|
|
871
920
|
var _offsetUnit = attributesFormData.getIn(['offsetA', '_unit']);
|
|
@@ -983,11 +1032,11 @@ function loadMoldingSvg(_x1) {
|
|
|
983
1032
|
return _loadMoldingSvg.apply(this, arguments);
|
|
984
1033
|
}
|
|
985
1034
|
function _loadMoldingSvg() {
|
|
986
|
-
_loadMoldingSvg = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
987
|
-
return _regeneratorRuntime.wrap(function (
|
|
988
|
-
while (1) switch (
|
|
1035
|
+
_loadMoldingSvg = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(molding) {
|
|
1036
|
+
return _regeneratorRuntime.wrap(function (_context7) {
|
|
1037
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
989
1038
|
case 0:
|
|
990
|
-
return
|
|
1039
|
+
return _context7.abrupt("return", new Promise(function (resolve, reject) {
|
|
991
1040
|
var url = molding === null || molding === void 0 ? void 0 : molding.shape_svg;
|
|
992
1041
|
if (!url) {
|
|
993
1042
|
// Skip if no SVG URL available
|
|
@@ -1009,9 +1058,9 @@ function _loadMoldingSvg() {
|
|
|
1009
1058
|
}));
|
|
1010
1059
|
case 1:
|
|
1011
1060
|
case "end":
|
|
1012
|
-
return
|
|
1061
|
+
return _context7.stop();
|
|
1013
1062
|
}
|
|
1014
|
-
},
|
|
1063
|
+
}, _callee7);
|
|
1015
1064
|
}));
|
|
1016
1065
|
return _loadMoldingSvg.apply(this, arguments);
|
|
1017
1066
|
}
|
|
@@ -1131,23 +1180,29 @@ export function handleExternalEvent(_x10) {
|
|
|
1131
1180
|
return _handleExternalEvent.apply(this, arguments);
|
|
1132
1181
|
}
|
|
1133
1182
|
function _handleExternalEvent() {
|
|
1134
|
-
_handleExternalEvent = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1183
|
+
_handleExternalEvent = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0(props) {
|
|
1135
1184
|
var _evt$payload3, _evt$payload4;
|
|
1136
1185
|
var evt, state, layerId, layer, _evt$payload, cdsItems, itemKeys, _loop3, i, newScene, _props$onInternalEven, sLineCnt, element, _state$viewer2D, _evt$payload$initialP, mouseX, mouseY, v2d, vPosX, vPosY, layerID, defaulTitle, _Object$keys, _evt$payload5, doorStyle, itemCDS, isAll, _layerId, _cdsItems, allItems, selectedItemId, _itemKeys, _loop4, _i2, _props$onInternalEven2, _evt$payload6, roomShapeType, width, height, _doorStyle, value, _value, _evt$payload7, moldingInfo, isGlobal, distElement, _distElement, _evt$payload8, option, _value2, _layerId2, _layer, _layer$getIn, selectedLines, selectedHoles, selectedItems, _i4, _i5, _i6, _evt$payload9, _evt$payload0, _evt$payload1, _evt$payload10, _layerID, _layer2, orginalItemInfo, originalItem, originalItemPos, replaceItem, _props$onInternalEven3, sceneData, currentTexture, _t5, _t6;
|
|
1137
|
-
return _regeneratorRuntime.wrap(function (
|
|
1138
|
-
while (1) switch (
|
|
1186
|
+
return _regeneratorRuntime.wrap(function (_context10) {
|
|
1187
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
1139
1188
|
case 0:
|
|
1140
1189
|
// console.log('***external event****', props);
|
|
1141
1190
|
evt = props.externalEvent;
|
|
1142
|
-
state = props
|
|
1191
|
+
state = getPlannerStateFromProps(props);
|
|
1192
|
+
if (state) {
|
|
1193
|
+
_context10.next = 1;
|
|
1194
|
+
break;
|
|
1195
|
+
}
|
|
1196
|
+
return _context10.abrupt("return");
|
|
1197
|
+
case 1:
|
|
1143
1198
|
layerId = state.getIn(['scene', 'selectedLayer']);
|
|
1144
1199
|
layer = state.getIn(['scene', 'layers', layerId]);
|
|
1145
1200
|
_t5 = evt === null || evt === void 0 ? void 0 : evt.type;
|
|
1146
|
-
|
|
1201
|
+
_context10.next = _t5 === EXTERNAL_EVENT_LOAD_PROJECT ? 2 : _t5 === EXTERNAL_EVENT_TOGGLE_TO_3D ? 7 : _t5 === EXTERNAL_EVENT_TOGGLE_TO_2D ? 8 : _t5 === EXTERNAL_EVENT_TOGGLE_TO_ELEVATION ? 9 : _t5 === EXTERNAL_EVENT_ADD_WALL ? 10 : _t5 === EXTERNAL_EVENT_ADD_ITEM ? 11 : _t5 === EXTERNAL_EVENT_ADD_HOLE ? 14 : _t5 === EXTERNAL_EVENT_ROTATE_PAN ? 15 : _t5 === EXTERNAL_EVENT_MOVE_PAN ? 15 : _t5 === EXTERNAL_EVENT_NEW_PROJECT ? 16 : _t5 === EXTERNAL_EVENT_CHANGE_DOORSTYLE ? 17 : _t5 === EXTERNAL_EVENT_ADD_ROOM_SHAPE ? 21 : _t5 === EXTERNAL_EVENT_ZOOM_IN ? 22 : _t5 === EXTERNAL_EVENT_ZOOM_OUT ? 23 : _t5 === EXTERNAL_EVENT_CENTERING_2D ? 24 : _t5 === EXTERNAL_EVENT_UNDO ? 25 : _t5 === EXTERNAL_EVENT_REDO ? 26 : _t5 === EXTERNAL_EVENT_SET_MOLDING ? 27 : _t5 === EXTERNAL_EVENT_DUPLICATE_ELEMENT ? 29 : _t5 === EXTERNAL_EVENT_DELETE_ELEMENT ? 30 : _t5 === EXTERNAL_EVENT_PROJECT_SETTING ? 31 : _t5 === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? 40 : _t5 === EXTERNAL_EVENT_UPDATE_PROPERTY ? 40 : _t5 === EXTERNAL_EVENT_REPLACE_CABINET ? 41 : _t5 === EXTERNAL_EVENT_SET_FINISHING ? 43 : _t5 === EXTERNAL_EVENT_SYNC_SCENE ? 44 : 45;
|
|
1147
1202
|
break;
|
|
1148
|
-
case
|
|
1203
|
+
case 2:
|
|
1149
1204
|
if (!(evt !== null && evt !== void 0 && evt.payload)) {
|
|
1150
|
-
|
|
1205
|
+
_context10.next = 6;
|
|
1151
1206
|
break;
|
|
1152
1207
|
}
|
|
1153
1208
|
// prepare item data request
|
|
@@ -1156,8 +1211,8 @@ function _handleExternalEvent() {
|
|
|
1156
1211
|
_loop3 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop3() {
|
|
1157
1212
|
var _evt$payload2, _it$doorStyle2;
|
|
1158
1213
|
var it;
|
|
1159
|
-
return _regeneratorRuntime.wrap(function (
|
|
1160
|
-
while (1) switch (
|
|
1214
|
+
return _regeneratorRuntime.wrap(function (_context9) {
|
|
1215
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
1161
1216
|
case 0:
|
|
1162
1217
|
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]]; //////// check altitude of item property and change length from _length (convert length from 'in' fo 'cm')
|
|
1163
1218
|
// if (
|
|
@@ -1185,22 +1240,22 @@ function _handleExternalEvent() {
|
|
|
1185
1240
|
});
|
|
1186
1241
|
case 1:
|
|
1187
1242
|
case "end":
|
|
1188
|
-
return
|
|
1243
|
+
return _context9.stop();
|
|
1189
1244
|
}
|
|
1190
1245
|
}, _loop3);
|
|
1191
1246
|
});
|
|
1192
1247
|
i = 0;
|
|
1193
|
-
case
|
|
1248
|
+
case 3:
|
|
1194
1249
|
if (!(i < itemKeys.length)) {
|
|
1195
|
-
|
|
1250
|
+
_context10.next = 5;
|
|
1196
1251
|
break;
|
|
1197
1252
|
}
|
|
1198
|
-
return
|
|
1199
|
-
case
|
|
1253
|
+
return _context10.delegateYield(_loop3(), "t0", 4);
|
|
1254
|
+
case 4:
|
|
1200
1255
|
i++;
|
|
1201
|
-
|
|
1256
|
+
_context10.next = 3;
|
|
1202
1257
|
break;
|
|
1203
|
-
case
|
|
1258
|
+
case 5:
|
|
1204
1259
|
newScene = new Scene(evt === null || evt === void 0 ? void 0 : evt.payload);
|
|
1205
1260
|
state = new State({
|
|
1206
1261
|
scene: newScene.toJS()
|
|
@@ -1213,63 +1268,63 @@ function _handleExternalEvent() {
|
|
|
1213
1268
|
cdsItems: cdsItems
|
|
1214
1269
|
}
|
|
1215
1270
|
}, /*#__PURE__*/function () {
|
|
1216
|
-
var
|
|
1271
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(result) {
|
|
1217
1272
|
var _i, _result$elements;
|
|
1218
|
-
return _regeneratorRuntime.wrap(function (
|
|
1219
|
-
while (1) switch (
|
|
1273
|
+
return _regeneratorRuntime.wrap(function (_context8) {
|
|
1274
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
1220
1275
|
case 0:
|
|
1221
1276
|
_i = 0;
|
|
1222
1277
|
case 1:
|
|
1223
1278
|
if (!(_i < (result === null || result === void 0 || (_result$elements = result.elements) === null || _result$elements === void 0 ? void 0 : _result$elements.length))) {
|
|
1224
|
-
|
|
1279
|
+
_context8.next = 3;
|
|
1225
1280
|
break;
|
|
1226
1281
|
}
|
|
1227
|
-
|
|
1282
|
+
_context8.next = 2;
|
|
1228
1283
|
return addItemToCatalog(result.elements[_i], state, props.catalog, props.projectActions);
|
|
1229
1284
|
case 2:
|
|
1230
1285
|
_i++;
|
|
1231
|
-
|
|
1286
|
+
_context8.next = 1;
|
|
1232
1287
|
break;
|
|
1233
1288
|
case 3:
|
|
1234
1289
|
props.projectActions.loadProject(evt.payload);
|
|
1235
1290
|
case 4:
|
|
1236
1291
|
case "end":
|
|
1237
|
-
return
|
|
1292
|
+
return _context8.stop();
|
|
1238
1293
|
}
|
|
1239
|
-
},
|
|
1294
|
+
}, _callee8);
|
|
1240
1295
|
}));
|
|
1241
1296
|
return function (_x11) {
|
|
1242
|
-
return
|
|
1297
|
+
return _ref3.apply(this, arguments);
|
|
1243
1298
|
};
|
|
1244
1299
|
}());
|
|
1245
1300
|
} else props.projectActions.loadProject(evt.payload);
|
|
1246
|
-
case 5:
|
|
1247
|
-
return _context1.abrupt("continue", 44);
|
|
1248
1301
|
case 6:
|
|
1249
|
-
|
|
1250
|
-
return _context1.abrupt("continue", 44);
|
|
1302
|
+
return _context10.abrupt("continue", 45);
|
|
1251
1303
|
case 7:
|
|
1252
|
-
props.projectActions.setMode(
|
|
1253
|
-
return
|
|
1304
|
+
props.projectActions.setMode(MODE_IDLE_3D);
|
|
1305
|
+
return _context10.abrupt("continue", 45);
|
|
1254
1306
|
case 8:
|
|
1307
|
+
props.projectActions.setMode(MODE_IDLE);
|
|
1308
|
+
return _context10.abrupt("continue", 45);
|
|
1309
|
+
case 9:
|
|
1255
1310
|
sLineCnt = layer.selected.lines.size;
|
|
1256
1311
|
if (sLineCnt > 0) props.projectActions.setMode(MODE_ELEVATION_VIEW);
|
|
1257
|
-
return
|
|
1258
|
-
case
|
|
1312
|
+
return _context10.abrupt("continue", 45);
|
|
1313
|
+
case 10:
|
|
1259
1314
|
if (state.mode === MODE_IDLE || state.mode === MODE_2D_PAN) props.linesActions.selectToolDrawingLine('wall');else {
|
|
1260
1315
|
props.projectActions.setMode(MODE_IDLE);
|
|
1261
1316
|
props.linesActions.selectToolDrawingLine('wall');
|
|
1262
1317
|
}
|
|
1263
|
-
return
|
|
1264
|
-
case
|
|
1318
|
+
return _context10.abrupt("continue", 45);
|
|
1319
|
+
case 11:
|
|
1265
1320
|
if (isEmpty(evt === null || evt === void 0 ? void 0 : evt.payload)) {
|
|
1266
|
-
|
|
1321
|
+
_context10.next = 13;
|
|
1267
1322
|
break;
|
|
1268
1323
|
}
|
|
1269
1324
|
element = evt.payload;
|
|
1270
|
-
|
|
1325
|
+
_context10.next = 12;
|
|
1271
1326
|
return addItemToCatalog(element, state, props.catalog, props.projectActions);
|
|
1272
|
-
case
|
|
1327
|
+
case 12:
|
|
1273
1328
|
// start drawing item
|
|
1274
1329
|
if (ARRAY_3D_MODES.includes(state.mode)) {
|
|
1275
1330
|
// in 3d view
|
|
@@ -1290,20 +1345,20 @@ function _handleExternalEvent() {
|
|
|
1290
1345
|
}
|
|
1291
1346
|
props.projectActions.pushLastSelectedCatalogElementToHistory(element);
|
|
1292
1347
|
props.projectActions.setIsCabinetDrawing(true);
|
|
1293
|
-
case 12:
|
|
1294
|
-
return _context1.abrupt("continue", 44);
|
|
1295
1348
|
case 13:
|
|
1296
|
-
|
|
1297
|
-
return _context1.abrupt("continue", 44);
|
|
1349
|
+
return _context10.abrupt("continue", 45);
|
|
1298
1350
|
case 14:
|
|
1299
|
-
|
|
1300
|
-
return
|
|
1351
|
+
ARRAY_3D_MODES.includes(state.mode) ? props.holesActions.selectToolDrawingHole3D(evt === null || evt === void 0 || (_evt$payload3 = evt.payload) === null || _evt$payload3 === void 0 ? void 0 : _evt$payload3.holeName) : props.holesActions.selectToolDrawingHole(evt === null || evt === void 0 || (_evt$payload4 = evt.payload) === null || _evt$payload4 === void 0 ? void 0 : _evt$payload4.holeName);
|
|
1352
|
+
return _context10.abrupt("continue", 45);
|
|
1301
1353
|
case 15:
|
|
1354
|
+
moveAndRotatePan2D3D(evt.type, props, evt.payload, state);
|
|
1355
|
+
return _context10.abrupt("continue", 45);
|
|
1356
|
+
case 16:
|
|
1302
1357
|
defaulTitle = 'Untitle';
|
|
1303
1358
|
props.projectActions.newProject();
|
|
1304
1359
|
props.projectActions.rename(defaulTitle);
|
|
1305
|
-
return
|
|
1306
|
-
case
|
|
1360
|
+
return _context10.abrupt("continue", 45);
|
|
1361
|
+
case 17:
|
|
1307
1362
|
_evt$payload5 = evt.payload, doorStyle = _evt$payload5.doorStyle, itemCDS = _evt$payload5.itemCDS, isAll = _evt$payload5.isAll; // prepare item data request
|
|
1308
1363
|
_layerId = state.getIn(['scene', 'selectedLayer']);
|
|
1309
1364
|
_cdsItems = [];
|
|
@@ -1313,8 +1368,8 @@ function _handleExternalEvent() {
|
|
|
1313
1368
|
_loop4 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop4() {
|
|
1314
1369
|
var _itemCDS$find;
|
|
1315
1370
|
var item, cdsId;
|
|
1316
|
-
return _regeneratorRuntime.wrap(function (
|
|
1317
|
-
while (1) switch (
|
|
1371
|
+
return _regeneratorRuntime.wrap(function (_context1) {
|
|
1372
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
1318
1373
|
case 0:
|
|
1319
1374
|
item = allItems[_itemKeys[_i2]];
|
|
1320
1375
|
cdsId = (_itemCDS$find = itemCDS.find(function (itCDS) {
|
|
@@ -1333,22 +1388,22 @@ function _handleExternalEvent() {
|
|
|
1333
1388
|
});
|
|
1334
1389
|
case 1:
|
|
1335
1390
|
case "end":
|
|
1336
|
-
return
|
|
1391
|
+
return _context1.stop();
|
|
1337
1392
|
}
|
|
1338
1393
|
}, _loop4);
|
|
1339
1394
|
});
|
|
1340
1395
|
_i2 = 0;
|
|
1341
|
-
case
|
|
1396
|
+
case 18:
|
|
1342
1397
|
if (!(_i2 < _itemKeys.length)) {
|
|
1343
|
-
|
|
1398
|
+
_context10.next = 20;
|
|
1344
1399
|
break;
|
|
1345
1400
|
}
|
|
1346
|
-
return
|
|
1347
|
-
case
|
|
1401
|
+
return _context10.delegateYield(_loop4(), "t1", 19);
|
|
1402
|
+
case 19:
|
|
1348
1403
|
_i2++;
|
|
1349
|
-
|
|
1404
|
+
_context10.next = 18;
|
|
1350
1405
|
break;
|
|
1351
|
-
case
|
|
1406
|
+
case 20:
|
|
1352
1407
|
// request item catalog data to host app
|
|
1353
1408
|
if (_cdsItems.length > 0) {
|
|
1354
1409
|
(_props$onInternalEven2 = props.onInternalEvent) === null || _props$onInternalEven2 === void 0 || _props$onInternalEven2.call(props, {
|
|
@@ -1357,127 +1412,127 @@ function _handleExternalEvent() {
|
|
|
1357
1412
|
cdsItems: _cdsItems
|
|
1358
1413
|
}
|
|
1359
1414
|
}, /*#__PURE__*/function () {
|
|
1360
|
-
var
|
|
1415
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(result) {
|
|
1361
1416
|
var _i3, _result$elements2;
|
|
1362
|
-
return _regeneratorRuntime.wrap(function (
|
|
1363
|
-
while (1) switch (
|
|
1417
|
+
return _regeneratorRuntime.wrap(function (_context0) {
|
|
1418
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
1364
1419
|
case 0:
|
|
1365
1420
|
_i3 = 0;
|
|
1366
1421
|
case 1:
|
|
1367
1422
|
if (!(_i3 < (result === null || result === void 0 || (_result$elements2 = result.elements) === null || _result$elements2 === void 0 ? void 0 : _result$elements2.length))) {
|
|
1368
|
-
|
|
1423
|
+
_context0.next = 3;
|
|
1369
1424
|
break;
|
|
1370
1425
|
}
|
|
1371
|
-
|
|
1426
|
+
_context0.next = 2;
|
|
1372
1427
|
return addItemToCatalog(result.elements[_i3], state, props.catalog, props.projectActions);
|
|
1373
1428
|
case 2:
|
|
1374
1429
|
_i3++;
|
|
1375
|
-
|
|
1430
|
+
_context0.next = 1;
|
|
1376
1431
|
break;
|
|
1377
1432
|
case 3:
|
|
1378
1433
|
props.itemsActions.setDoorStyle(doorStyle, itemCDS, isAll);
|
|
1379
1434
|
case 4:
|
|
1380
1435
|
case "end":
|
|
1381
|
-
return
|
|
1436
|
+
return _context0.stop();
|
|
1382
1437
|
}
|
|
1383
|
-
},
|
|
1438
|
+
}, _callee9);
|
|
1384
1439
|
}));
|
|
1385
1440
|
return function (_x12) {
|
|
1386
|
-
return
|
|
1441
|
+
return _ref4.apply(this, arguments);
|
|
1387
1442
|
};
|
|
1388
1443
|
}());
|
|
1389
1444
|
} else props.itemsActions.setDoorStyle(doorStyle, itemCDS, isAll);
|
|
1390
|
-
return
|
|
1391
|
-
case
|
|
1445
|
+
return _context10.abrupt("continue", 45);
|
|
1446
|
+
case 21:
|
|
1392
1447
|
_evt$payload6 = evt.payload, roomShapeType = _evt$payload6.roomShapeType, width = _evt$payload6.width, height = _evt$payload6.height, _doorStyle = _evt$payload6.doorStyle;
|
|
1393
1448
|
props.projectActions.createRoomWithShape(roomShapeType, width, height, _doorStyle);
|
|
1394
|
-
return
|
|
1395
|
-
case
|
|
1449
|
+
return _context10.abrupt("continue", 45);
|
|
1450
|
+
case 22:
|
|
1396
1451
|
value = state.getIn(['viewer2D']).toJS();
|
|
1397
1452
|
value.a += 0.1;
|
|
1398
1453
|
value.d += 0.1;
|
|
1399
1454
|
value.e -= value.SVGWidth * 0.1 / 2;
|
|
1400
1455
|
value.f -= value.SVGHeight * 0.1 / 2;
|
|
1401
1456
|
updateViwer2D(value, props.viewer2DActions);
|
|
1402
|
-
return
|
|
1403
|
-
case
|
|
1457
|
+
return _context10.abrupt("continue", 45);
|
|
1458
|
+
case 23:
|
|
1404
1459
|
_value = state.getIn(['viewer2D']).toJS();
|
|
1405
1460
|
_value.a -= 0.1;
|
|
1406
1461
|
_value.d -= 0.1;
|
|
1407
1462
|
_value.e += _value.SVGWidth * 0.1 / 2;
|
|
1408
1463
|
_value.f += _value.SVGHeight * 0.1 / 2;
|
|
1409
1464
|
updateViwer2D(_value, props.viewer2DActions);
|
|
1410
|
-
return
|
|
1411
|
-
case 23:
|
|
1412
|
-
centering2D(state, props.viewer2DActions);
|
|
1413
|
-
return _context1.abrupt("continue", 44);
|
|
1465
|
+
return _context10.abrupt("continue", 45);
|
|
1414
1466
|
case 24:
|
|
1415
|
-
props.
|
|
1416
|
-
return
|
|
1467
|
+
centering2D(state, props.viewer2DActions);
|
|
1468
|
+
return _context10.abrupt("continue", 45);
|
|
1417
1469
|
case 25:
|
|
1418
|
-
props.projectActions.
|
|
1419
|
-
return
|
|
1470
|
+
props.projectActions.undo();
|
|
1471
|
+
return _context10.abrupt("continue", 45);
|
|
1420
1472
|
case 26:
|
|
1473
|
+
props.projectActions.redo();
|
|
1474
|
+
return _context10.abrupt("continue", 45);
|
|
1475
|
+
case 27:
|
|
1421
1476
|
_evt$payload7 = evt.payload, moldingInfo = _evt$payload7.moldingInfo, isGlobal = _evt$payload7.isGlobal;
|
|
1422
|
-
|
|
1477
|
+
_context10.next = 28;
|
|
1423
1478
|
return loadMoldingSvg(moldingInfo);
|
|
1424
|
-
case 27:
|
|
1425
|
-
props.itemsActions.setMolding(moldingInfo, isGlobal);
|
|
1426
|
-
return _context1.abrupt("continue", 44);
|
|
1427
1479
|
case 28:
|
|
1480
|
+
props.itemsActions.setMolding(moldingInfo, isGlobal);
|
|
1481
|
+
return _context10.abrupt("continue", 45);
|
|
1482
|
+
case 29:
|
|
1428
1483
|
distElement = getElement(evt.payload, state);
|
|
1429
1484
|
if (distElement) props.itemsActions.duplicateSelected(distElement, props.onInternalEvent);
|
|
1430
|
-
return
|
|
1431
|
-
case
|
|
1485
|
+
return _context10.abrupt("continue", 45);
|
|
1486
|
+
case 30:
|
|
1432
1487
|
_distElement = getElement(evt.payload, state);
|
|
1433
1488
|
if (_distElement) props.projectActions.remove(_distElement);
|
|
1434
|
-
return
|
|
1435
|
-
case
|
|
1489
|
+
return _context10.abrupt("continue", 45);
|
|
1490
|
+
case 31:
|
|
1436
1491
|
_evt$payload8 = evt.payload, option = _evt$payload8.option, _value2 = _evt$payload8.value;
|
|
1437
1492
|
_t6 = option;
|
|
1438
|
-
|
|
1493
|
+
_context10.next = _t6 === PROJECT_SETTING_OPTION.CHANGE_MEASUREMENT_UNIT ? 32 : _t6 === PROJECT_SETTING_OPTION.UPDATE_CEIL_HEIGHT ? 33 : _t6 === PROJECT_SETTING_OPTION.CHANGE_WALL_LENGTH_MEASURE ? 34 : _t6 === PROJECT_SETTING_OPTION.CHANGE_BASE_CABINET_MEASURE ? 35 : _t6 === PROJECT_SETTING_OPTION.CHANGE_WALL_CABINET_MEASURE ? 36 : _t6 === PROJECT_SETTING_OPTION.CHANGE_WINDOW_DOOR_MEASURE ? 37 : 38;
|
|
1439
1494
|
break;
|
|
1440
|
-
case
|
|
1495
|
+
case 32:
|
|
1441
1496
|
props.viewer2DActions.updateCeilHeight(convert(layer.ceilHeight).from(layer.unit).to(_value2));
|
|
1442
1497
|
props.viewer2DActions.updateCeilHeightUnit(_value2);
|
|
1443
1498
|
props.viewer3DActions.update3DCeilHeightUnit(_value2);
|
|
1444
1499
|
props.viewer3DActions.update3DCeilHeight(convert(layer.ceilHeight).from(layer.unit).to(_value2));
|
|
1445
|
-
case
|
|
1500
|
+
case 33:
|
|
1446
1501
|
props.viewer2DActions.updateCeilHeight(_value2);
|
|
1447
1502
|
props.viewer3DActions.update3DCeilHeight(_value2);
|
|
1448
|
-
return
|
|
1449
|
-
case 33:
|
|
1450
|
-
props.viewer2DActions.changeWallLengthMeasure(_value2);
|
|
1451
|
-
return _context1.abrupt("continue", 38);
|
|
1503
|
+
return _context10.abrupt("continue", 39);
|
|
1452
1504
|
case 34:
|
|
1453
|
-
props.viewer2DActions.
|
|
1454
|
-
return
|
|
1505
|
+
props.viewer2DActions.changeWallLengthMeasure(_value2);
|
|
1506
|
+
return _context10.abrupt("continue", 39);
|
|
1455
1507
|
case 35:
|
|
1456
|
-
props.viewer2DActions.
|
|
1457
|
-
return
|
|
1508
|
+
props.viewer2DActions.changeBaseCabinetMeasure(_value2);
|
|
1509
|
+
return _context10.abrupt("continue", 39);
|
|
1458
1510
|
case 36:
|
|
1459
|
-
props.viewer2DActions.
|
|
1460
|
-
return
|
|
1511
|
+
props.viewer2DActions.changeWallCabinetMeasure(_value2);
|
|
1512
|
+
return _context10.abrupt("continue", 39);
|
|
1461
1513
|
case 37:
|
|
1462
|
-
|
|
1514
|
+
props.viewer2DActions.changeWindowDoorMeasure(_value2);
|
|
1515
|
+
return _context10.abrupt("continue", 39);
|
|
1463
1516
|
case 38:
|
|
1464
|
-
return
|
|
1517
|
+
return _context10.abrupt("continue", 39);
|
|
1465
1518
|
case 39:
|
|
1519
|
+
return _context10.abrupt("continue", 45);
|
|
1520
|
+
case 40:
|
|
1466
1521
|
_layerId2 = state.getIn(['scene', 'selectedLayer']);
|
|
1467
1522
|
_layer = state.getIn(['scene', 'layers', _layerId2]);
|
|
1468
1523
|
_layer$getIn = _layer.getIn(['selected']), selectedLines = _layer$getIn.lines, selectedHoles = _layer$getIn.holes, selectedItems = _layer$getIn.items;
|
|
1469
1524
|
for (_i4 = 0; _i4 < selectedLines.size; _i4++) (evt === null || evt === void 0 ? void 0 : evt.type) === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(_layer.getIn(['lines', selectedLines.get(_i4)]), evt.payload, state, _layer, props.catalog, props.projectActions, evt.callback) : updatePropertyOfSelectedElement(_layer.getIn(['lines', selectedLines.get(_i4)]), evt.payload, props.catalog, props.projectActions, evt.callback);
|
|
1470
1525
|
for (_i5 = 0; _i5 < selectedHoles.size; _i5++) (evt === null || evt === void 0 ? void 0 : evt.type) === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(_layer.getIn(['holes', selectedHoles.get(_i5)]), evt.payload, state, _layer, props.catalog, props.projectActions, evt.callback) : updatePropertyOfSelectedElement(_layer.getIn(['holes', selectedHoles.get(_i5)]), evt.payload, props.catalog, props.projectActions, evt.callback);
|
|
1471
1526
|
for (_i6 = 0; _i6 < selectedItems.size; _i6++) (evt === null || evt === void 0 ? void 0 : evt.type) === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(_layer.getIn(['items', selectedItems.get(_i6)]), evt.payload, state, _layer, props.catalog, props.projectActions, evt.callback) : updatePropertyOfSelectedElement(_layer.getIn(['items', selectedItems.get(_i6)]), evt.payload, props.catalog, props.projectActions, evt.callback);
|
|
1472
|
-
return
|
|
1473
|
-
case
|
|
1527
|
+
return _context10.abrupt("continue", 45);
|
|
1528
|
+
case 41:
|
|
1474
1529
|
_layerID = state.scene.selectedLayer;
|
|
1475
1530
|
_layer2 = state.scene.getIn(['layers', _layerID]).toJS();
|
|
1476
1531
|
orginalItemInfo = evt === null || evt === void 0 || (_evt$payload9 = evt.payload) === null || _evt$payload9 === void 0 ? void 0 : _evt$payload9.orginalItemInfo;
|
|
1477
1532
|
originalItem = _layer2 === null || _layer2 === void 0 ? void 0 : _layer2.items[orginalItemInfo.id];
|
|
1478
|
-
|
|
1533
|
+
_context10.next = 42;
|
|
1479
1534
|
return addItemToCatalog(evt.payload.replaceItemInfo, state, props.catalog, props.projectActions);
|
|
1480
|
-
case
|
|
1535
|
+
case 42:
|
|
1481
1536
|
originalItemPos = {
|
|
1482
1537
|
rotation: originalItem.rotation,
|
|
1483
1538
|
selectedItemId: originalItem.id,
|
|
@@ -1492,11 +1547,11 @@ function _handleExternalEvent() {
|
|
|
1492
1547
|
}
|
|
1493
1548
|
};
|
|
1494
1549
|
props.itemsActions.replaceItem(originalItemPos, originalItem, replaceItem);
|
|
1495
|
-
return
|
|
1496
|
-
case 42:
|
|
1497
|
-
setFinishing(props, state, evt.payload);
|
|
1498
|
-
return _context1.abrupt("continue", 44);
|
|
1550
|
+
return _context10.abrupt("continue", 45);
|
|
1499
1551
|
case 43:
|
|
1552
|
+
setFinishing(props, state, evt.payload);
|
|
1553
|
+
return _context10.abrupt("continue", 45);
|
|
1554
|
+
case 44:
|
|
1500
1555
|
sceneData = state.scene.toJS(); // get molding data for "ReviewForQuote"
|
|
1501
1556
|
currentTexture = layer.doorStyle !== null || layer.doorStyle !== undefined ? layer.doorStyle : props.state.doorStyle.toJS();
|
|
1502
1557
|
sceneData.layers[layerId].moldingData = getMoldingDataOfScene2(layer, props.catalog, currentTexture);
|
|
@@ -1507,12 +1562,12 @@ function _handleExternalEvent() {
|
|
|
1507
1562
|
scene: sceneData
|
|
1508
1563
|
}
|
|
1509
1564
|
});
|
|
1510
|
-
return
|
|
1511
|
-
case
|
|
1565
|
+
return _context10.abrupt("continue", 45);
|
|
1566
|
+
case 45:
|
|
1512
1567
|
case "end":
|
|
1513
|
-
return
|
|
1568
|
+
return _context10.stop();
|
|
1514
1569
|
}
|
|
1515
|
-
},
|
|
1570
|
+
}, _callee0);
|
|
1516
1571
|
}));
|
|
1517
1572
|
return _handleExternalEvent.apply(this, arguments);
|
|
1518
1573
|
}
|