kitchen-simulator 4.4.6 → 5.0.0-new-api.1
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/LiteRenderer.js +15 -53
- package/es/assets/Window.hdr +2100 -0
- package/es/assets/img/default/maple.jpg +0 -0
- package/es/assets/img/default/steel.jpg +0 -0
- package/es/catalog/catalog.js +0 -2
- package/es/catalog/factories/area-factory-3d.js +0 -4
- package/es/catalog/holes/door-double/door_double.png +0 -0
- package/es/catalog/holes/door-panic/panicDoor.png +0 -0
- package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/es/catalog/holes/gate/gate.jpg +0 -0
- package/es/catalog/holes/window-clear/texture.png +0 -0
- package/es/catalog/holes/window-cross/texture.png +0 -0
- package/es/catalog/holes/window-double-hung/texture.png +0 -0
- package/es/catalog/holes/window-vertical/texture.png +0 -0
- package/es/catalog/utils/exporter.js +2 -0
- package/es/catalog/utils/item-loader.js +0 -4
- package/es/class/area.js +0 -1
- package/es/class/export.js +1 -3
- package/es/class/item.js +17 -6
- package/es/components/content.js +1 -3
- package/es/components/style/export.js +2 -28
- package/es/components/viewer2d/line.js +2 -2
- package/es/components/viewer2d/viewer2d.js +0 -1
- package/es/components/viewer3d/front3D.js +1 -2
- package/es/components/viewer3d/pointer-lock-navigation.js +0 -90
- package/es/components/viewer3d/scene-creator.js +0 -1
- package/es/components/viewer3d/three-memory-cleaner.js +0 -14
- package/es/components/viewer3d/viewer3d.js +1 -1
- package/es/constants.js +11 -6
- package/es/devLiteRenderer.js +124 -84
- package/es/mappings/external-events/mapExternalEventPayload.js +28 -0
- package/es/mappings/external-events/mappers/addItemMapper.js +86 -0
- package/es/mappings/external-events/mappers/ccdfMapper.js +86 -0
- package/es/mappings/external-events/mappers/ccdfToCDSMapper.js +31 -0
- package/es/mappings/external-events/mappers/changeDoorStyleMapper.js +37 -0
- package/es/mappings/external-events/mappers/loadProjectMapper.js +62 -0
- package/es/mappings/holesToCatalog.js +139 -0
- package/es/models.js +12 -1
- package/es/plugins/keyboard.js +1 -1
- package/es/reducers/export.js +2 -4
- package/es/reducers/items-reducer.js +1 -1
- package/es/reducers/project-reducer.js +1 -1
- package/es/reducers/reducer.js +2 -3
- package/es/shared/objects/immutable.js +3 -0
- package/es/utils/geometry.js +276 -74
- package/es/utils/history.js +2 -2
- package/es/utils/isolate-event-handler.js +57 -45
- package/es/utils/molding.js +5 -3
- package/lib/LiteRenderer.js +17 -55
- package/lib/assets/Window.hdr +2100 -0
- package/lib/assets/img/default/maple.jpg +0 -0
- package/lib/assets/img/default/steel.jpg +0 -0
- package/lib/catalog/catalog.js +0 -2
- package/lib/catalog/factories/area-factory-3d.js +0 -4
- package/lib/catalog/holes/door-double/door_double.png +0 -0
- package/lib/catalog/holes/door-panic/panicDoor.png +0 -0
- package/lib/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/lib/catalog/holes/gate/gate.jpg +0 -0
- package/lib/catalog/holes/window-clear/texture.png +0 -0
- package/lib/catalog/holes/window-cross/texture.png +0 -0
- package/lib/catalog/holes/window-double-hung/texture.png +0 -0
- package/lib/catalog/holes/window-vertical/texture.png +0 -0
- package/lib/catalog/utils/exporter.js +2 -0
- package/lib/catalog/utils/item-loader.js +0 -4
- package/lib/class/area.js +0 -1
- package/lib/class/export.js +0 -8
- package/lib/class/item.js +17 -6
- package/lib/components/content.js +1 -3
- package/lib/components/style/export.js +1 -105
- package/lib/components/viewer2d/line.js +1 -1
- package/lib/components/viewer2d/viewer2d.js +0 -1
- package/lib/components/viewer3d/front3D.js +1 -2
- package/lib/components/viewer3d/pointer-lock-navigation.js +0 -90
- package/lib/components/viewer3d/scene-creator.js +0 -1
- package/lib/components/viewer3d/three-memory-cleaner.js +0 -14
- package/lib/constants.js +16 -11
- package/lib/devLiteRenderer.js +126 -86
- package/lib/mappings/external-events/mapExternalEventPayload.js +33 -0
- package/lib/mappings/external-events/mappers/addItemMapper.js +92 -0
- package/lib/mappings/external-events/mappers/ccdfMapper.js +93 -0
- package/lib/mappings/external-events/mappers/ccdfToCDSMapper.js +37 -0
- package/lib/mappings/external-events/mappers/changeDoorStyleMapper.js +44 -0
- package/lib/mappings/external-events/mappers/loadProjectMapper.js +70 -0
- package/lib/mappings/holesToCatalog.js +148 -0
- package/lib/models.js +12 -1
- package/lib/reducers/export.js +1 -9
- package/lib/reducers/reducer.js +0 -1
- package/lib/shared/objects/immutable.js +9 -0
- package/lib/utils/geometry.js +276 -74
- package/lib/utils/history.js +1 -1
- package/lib/utils/isolate-event-handler.js +57 -45
- package/lib/utils/molding.js +5 -3
- package/package.json +1 -1
- package/es/assets/gltf/door_closet.bin +0 -0
- package/es/assets/gltf/door_closet.fbx +0 -0
- package/es/assets/gltf/door_exterior.bin +0 -0
- package/es/assets/gltf/door_exterior.fbx +0 -0
- package/es/assets/gltf/door_interior.bin +0 -0
- package/es/assets/gltf/door_interior.fbx +0 -0
- package/es/assets/gltf/door_sliding.bin +0 -0
- package/es/assets/gltf/door_sliding.fbx +0 -0
- package/es/assets/img/png/helper/video_preview_3d.png +0 -0
- package/es/assets/img/png/helper/video_preview_start.png +0 -0
- package/es/assets/img/svg/color/Brown.svg +0 -9
- package/es/assets/img/svg/color/Dark.svg +0 -9
- package/es/assets/img/svg/color/Light.svg +0 -9
- package/es/assets/img/svg/color/Medium.svg +0 -9
- package/es/assets/img/svg/color/Unfinished.svg +0 -9
- package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/es/catalog/properties/export.js +0 -21
- package/es/catalog/properties/property-checkbox.js +0 -68
- package/es/catalog/properties/property-color.js +0 -39
- package/es/catalog/properties/property-enum.js +0 -50
- package/es/catalog/properties/property-hidden.js +0 -19
- package/es/catalog/properties/property-lenght-measure.js +0 -100
- package/es/catalog/properties/property-length-measure.js +0 -84
- package/es/catalog/properties/property-length-measure_hole.js +0 -100
- package/es/catalog/properties/property-number.js +0 -48
- package/es/catalog/properties/property-read-only.js +0 -26
- package/es/catalog/properties/property-string.js +0 -48
- package/es/catalog/properties/property-toggle.js +0 -39
- package/es/catalog/properties/shared-property-style.js +0 -14
- package/es/catalog/utils/FuseUtils.js +0 -79
- package/es/class/FuseUtils.js +0 -79
- package/es/components/style/button.js +0 -106
- package/es/components/style/cancel-button.js +0 -21
- package/es/components/style/content-container.js +0 -30
- package/es/components/style/content-title.js +0 -25
- package/es/components/style/delete-button.js +0 -24
- package/es/components/style/form-block.js +0 -20
- package/es/components/style/form-color-input.js +0 -26
- package/es/components/style/form-label.js +0 -22
- package/es/components/style/form-number-input_2.js +0 -200
- package/es/components/style/form-select.js +0 -19
- package/es/components/style/form-slider.js +0 -60
- package/es/components/style/form-text-input.js +0 -69
- package/es/reducers/user-reducer.js +0 -41
- package/es/styles/export.js +0 -5
- package/es/styles/tabs.css +0 -40
- package/lib/assets/gltf/door_closet.bin +0 -0
- package/lib/assets/gltf/door_closet.fbx +0 -0
- package/lib/assets/gltf/door_exterior.bin +0 -0
- package/lib/assets/gltf/door_exterior.fbx +0 -0
- package/lib/assets/gltf/door_interior.bin +0 -0
- package/lib/assets/gltf/door_interior.fbx +0 -0
- package/lib/assets/gltf/door_sliding.bin +0 -0
- package/lib/assets/gltf/door_sliding.fbx +0 -0
- package/lib/assets/img/png/helper/video_preview_3d.png +0 -0
- package/lib/assets/img/png/helper/video_preview_start.png +0 -0
- package/lib/assets/img/svg/color/Brown.svg +0 -9
- package/lib/assets/img/svg/color/Dark.svg +0 -9
- package/lib/assets/img/svg/color/Light.svg +0 -9
- package/lib/assets/img/svg/color/Medium.svg +0 -9
- package/lib/assets/img/svg/color/Unfinished.svg +0 -9
- package/lib/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/lib/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/lib/catalog/properties/export.js +0 -81
- package/lib/catalog/properties/property-checkbox.js +0 -76
- package/lib/catalog/properties/property-color.js +0 -47
- package/lib/catalog/properties/property-enum.js +0 -58
- package/lib/catalog/properties/property-hidden.js +0 -27
- package/lib/catalog/properties/property-lenght-measure.js +0 -108
- package/lib/catalog/properties/property-length-measure.js +0 -92
- package/lib/catalog/properties/property-length-measure_hole.js +0 -108
- package/lib/catalog/properties/property-number.js +0 -56
- package/lib/catalog/properties/property-read-only.js +0 -34
- package/lib/catalog/properties/property-string.js +0 -56
- package/lib/catalog/properties/property-toggle.js +0 -47
- package/lib/catalog/properties/shared-property-style.js +0 -21
- package/lib/catalog/utils/FuseUtils.js +0 -87
- package/lib/class/FuseUtils.js +0 -87
- package/lib/components/style/button.js +0 -115
- package/lib/components/style/cancel-button.js +0 -29
- package/lib/components/style/content-container.js +0 -38
- package/lib/components/style/content-title.js +0 -35
- package/lib/components/style/delete-button.js +0 -34
- package/lib/components/style/form-block.js +0 -28
- package/lib/components/style/form-color-input.js +0 -34
- package/lib/components/style/form-label.js +0 -30
- package/lib/components/style/form-number-input_2.js +0 -209
- package/lib/components/style/form-select.js +0 -29
- package/lib/components/style/form-slider.js +0 -68
- package/lib/components/style/form-text-input.js +0 -78
- package/lib/reducers/user-reducer.js +0 -48
- package/lib/styles/export.js +0 -13
- package/lib/styles/tabs.css +0 -40
|
@@ -24,6 +24,10 @@ var _molding = require("./molding");
|
|
|
24
24
|
var _models = require("../models");
|
|
25
25
|
var _geometry = require("./geometry");
|
|
26
26
|
var _skinPanelEngine = require("./skinPanelEngine");
|
|
27
|
+
var _mapExternalEventPayload = require("../mappings/external-events/mapExternalEventPayload");
|
|
28
|
+
var _ccdfMapper = require("../mappings/external-events/mappers/ccdfMapper");
|
|
29
|
+
var _ccdfToCDSMapper = require("../mappings/external-events/mappers/ccdfToCDSMapper");
|
|
30
|
+
var _loadProjectMapper = require("../mappings/external-events/mappers/loadProjectMapper");
|
|
27
31
|
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; }
|
|
28
32
|
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; }
|
|
29
33
|
var PRECISION = 2;
|
|
@@ -463,27 +467,28 @@ function updateCabinetPayload(_x3) {
|
|
|
463
467
|
}
|
|
464
468
|
function _updateCabinetPayload() {
|
|
465
469
|
_updateCabinetPayload = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(cabinetPayload) {
|
|
466
|
-
var cabinetPayloadKeys, i
|
|
470
|
+
var tempPlaceholders, cabinetPayloadKeys, i;
|
|
467
471
|
return _regenerator["default"].wrap(function (_context6) {
|
|
468
472
|
while (1) switch (_context6.prev = _context6.next) {
|
|
469
473
|
case 0:
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
+
tempPlaceholders = [];
|
|
475
|
+
_context6.next = 1;
|
|
476
|
+
return parseTempPlaceholdersFromCabinetPayload(cabinetPayload);
|
|
477
|
+
case 1:
|
|
478
|
+
tempPlaceholders = _context6.sent;
|
|
474
479
|
cabinetPayloadKeys = Object.keys(cabinetPayload);
|
|
475
480
|
for (i = 0; i < cabinetPayloadKeys.length; i++) {
|
|
476
481
|
if (cabinetPayloadKeys[i] === 'structure_json') {
|
|
477
|
-
cabinetPayload[cabinetPayloadKeys[i]]['placeholders'] = (_cabinetPayload$cabin = (_cabinetPayload$cabin2 = cabinetPayload[cabinetPayloadKeys[i]]['tempPlaceholders'][0]) === null || _cabinetPayload$cabin2 === void 0 ? void 0 : _cabinetPayload$cabin2.placeholders) !== null && _cabinetPayload$cabin !== void 0 ? _cabinetPayload$cabin : [];
|
|
478
|
-
|
|
479
482
|
// cabinetPayload[cabinetPayloadKeys[i]]['placeholders'] =
|
|
480
|
-
// tempPlaceholders[0]
|
|
481
|
-
//
|
|
482
|
-
|
|
483
|
+
// cabinetPayload[cabinetPayloadKeys[i]]['tempPlaceholders'][0]
|
|
484
|
+
// ?.placeholders ?? [];
|
|
485
|
+
|
|
486
|
+
cabinetPayload[cabinetPayloadKeys[i]]['placeholders'] = tempPlaceholders[0].placeholders;
|
|
487
|
+
cabinetPayload[cabinetPayloadKeys[i]]['tempPlaceholders'] = tempPlaceholders;
|
|
483
488
|
}
|
|
484
489
|
}
|
|
485
490
|
return _context6.abrupt("return", cabinetPayload);
|
|
486
|
-
case
|
|
491
|
+
case 2:
|
|
487
492
|
case "end":
|
|
488
493
|
return _context6.stop();
|
|
489
494
|
}
|
|
@@ -1219,13 +1224,12 @@ function handleExternalEvent(_x0) {
|
|
|
1219
1224
|
}
|
|
1220
1225
|
function _handleExternalEvent() {
|
|
1221
1226
|
_handleExternalEvent = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee0(props) {
|
|
1222
|
-
var _evt$
|
|
1223
|
-
var
|
|
1227
|
+
var _evt$payload4, _evt$payload5;
|
|
1228
|
+
var state, evt, layerId, layer, _evt$payload, _state$catalog, cdsItems, itemKeys, _loop6, i, newScene, tempState, _props$onInternalEven, sLineCnt, element, _state$viewer2D, _evt$payload$initialP, mouseX, mouseY, v2d, vPosX, vPosY, layerID, defaulTitle, _evt$payload6, doorStyle, applyScope, _evt$payload6$itemIds, itemIds, itemCDS, _layerId, allItems, targetItems, idSet, selectedItemIds, ccdf_list, _loop7, _i2, _props$onInternalEven2, _evt$payload7, roomShapeType, width, height, measurementUnit, _doorStyle, value, _value, _evt$payload8, moldingInfo, isGlobal, distElement, _distElement, _evt$payload9, option, _value2, _layerId2, _layer, _layer$getIn, selectedLines, selectedHoles, selectedItems, _i4, _i5, _i6, _evt$payload0, _evt$payload1, _evt$payload10, _evt$payload11, _layerID, _layer2, orginalItemInfo, originalItem, originalItemPos, replaceItem, _layer$doorStyle, _currentTexture, _props$configData$mol, _props$configData, _props$configData$ski, _props$configData2, _props$onInternalEven3, sceneData, currentTexture, moldingPieceLength, skinPanelExclusionSKUs, _t5, _t6, _t7;
|
|
1224
1229
|
return _regenerator["default"].wrap(function (_context11) {
|
|
1225
1230
|
while (1) switch (_context11.prev = _context11.next) {
|
|
1226
1231
|
case 0:
|
|
1227
1232
|
// console.log('***external event****', props.externalEvent);
|
|
1228
|
-
evt = props.externalEvent;
|
|
1229
1233
|
state = getPlannerStateFromProps(props);
|
|
1230
1234
|
if (state) {
|
|
1231
1235
|
_context11.next = 1;
|
|
@@ -1233,6 +1237,7 @@ function _handleExternalEvent() {
|
|
|
1233
1237
|
}
|
|
1234
1238
|
return _context11.abrupt("return");
|
|
1235
1239
|
case 1:
|
|
1240
|
+
evt = (0, _mapExternalEventPayload.mapExternalEventPayload)(props.externalEvent, state);
|
|
1236
1241
|
layerId = state.getIn(['scene', 'selectedLayer']);
|
|
1237
1242
|
layer = state.getIn(['scene', 'layers', layerId]);
|
|
1238
1243
|
_t5 = evt === null || evt === void 0 ? void 0 : evt.type;
|
|
@@ -1247,19 +1252,19 @@ function _handleExternalEvent() {
|
|
|
1247
1252
|
cdsItems = [];
|
|
1248
1253
|
itemKeys = evt !== null && evt !== void 0 && (_evt$payload = evt.payload) !== null && _evt$payload !== void 0 && (_evt$payload = _evt$payload.layers['layer-1']) !== null && _evt$payload !== void 0 && _evt$payload.items ? Object.keys(evt.payload.layers['layer-1'].items) : [];
|
|
1249
1254
|
_loop6 = /*#__PURE__*/_regenerator["default"].mark(function _loop6() {
|
|
1250
|
-
var _evt$
|
|
1255
|
+
var _evt$payload3, _it$properties, _it$properties2, _it$properties3, _it$doorStyle2;
|
|
1251
1256
|
var it;
|
|
1252
1257
|
return _regenerator["default"].wrap(function (_context0) {
|
|
1253
1258
|
while (1) switch (_context0.prev = _context0.next) {
|
|
1254
1259
|
case 0:
|
|
1255
|
-
it = evt === null || evt === void 0 || (_evt$
|
|
1260
|
+
it = evt === null || evt === void 0 || (_evt$payload3 = evt.payload) === null || _evt$payload3 === void 0 || (_evt$payload3 = _evt$payload3.layers['layer-1']) === null || _evt$payload3 === void 0 ? void 0 : _evt$payload3.items[itemKeys[i]]; //////// check altitude of item property and change length from _length (convert length from 'in' fo 'cm')
|
|
1256
1261
|
if (it !== null && it !== void 0 && (_it$properties = it.properties) !== null && _it$properties !== void 0 && (_it$properties = _it$properties.altitude) !== null && _it$properties !== void 0 && _it$properties.length && it !== null && it !== void 0 && (_it$properties2 = it.properties) !== null && _it$properties2 !== void 0 && (_it$properties2 = _it$properties2.altitude) !== null && _it$properties2 !== void 0 && _it$properties2._unit && it !== null && it !== void 0 && (_it$properties3 = it.properties) !== null && _it$properties3 !== void 0 && (_it$properties3 = _it$properties3.altitude) !== null && _it$properties3 !== void 0 && _it$properties3._length && it.properties.altitude.length !== (0, _convertUnitsLite.convert)(it.properties.altitude._length).from(it.properties.altitude._unit).to('cm')) {
|
|
1257
1262
|
it.properties.altitude.length = (0, _convertUnitsLite.convert)(it.properties.altitude._length).from(it.properties.altitude._unit).to('cm');
|
|
1258
1263
|
}
|
|
1259
1264
|
/////////
|
|
1260
1265
|
if (!cdsItems.some(function (v) {
|
|
1261
1266
|
var _it$doorStyle;
|
|
1262
|
-
return it.itemID === v.itemID && it.name === v.name && ((_it$doorStyle = it.doorStyle) === null || _it$doorStyle === void 0
|
|
1267
|
+
return it.itemID === v.itemID && it.name === v.name && ((_it$doorStyle = it.doorStyle) === null || _it$doorStyle === void 0 ? void 0 : _it$doorStyle.id) === v.dfId;
|
|
1263
1268
|
})) cdsItems.push({
|
|
1264
1269
|
itemID: it.itemID,
|
|
1265
1270
|
prototype: it.prototype,
|
|
@@ -1267,7 +1272,7 @@ function _handleExternalEvent() {
|
|
|
1267
1272
|
name: it.name,
|
|
1268
1273
|
type: it.type,
|
|
1269
1274
|
sku_number: it.sku_number,
|
|
1270
|
-
|
|
1275
|
+
dfId: (_it$doorStyle2 = it.doorStyle) === null || _it$doorStyle2 === void 0 ? void 0 : _it$doorStyle2.id
|
|
1271
1276
|
});
|
|
1272
1277
|
case 1:
|
|
1273
1278
|
case "end":
|
|
@@ -1300,11 +1305,15 @@ function _handleExternalEvent() {
|
|
|
1300
1305
|
}
|
|
1301
1306
|
}, /*#__PURE__*/function () {
|
|
1302
1307
|
var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee8(result) {
|
|
1303
|
-
var
|
|
1308
|
+
var _evt$payload2;
|
|
1309
|
+
var cdsList, cabinetDefinitionList, rt, _i;
|
|
1304
1310
|
return _regenerator["default"].wrap(function (_context9) {
|
|
1305
1311
|
while (1) switch (_context9.prev = _context9.next) {
|
|
1306
1312
|
case 0:
|
|
1307
|
-
|
|
1313
|
+
cdsList = (0, _ccdfToCDSMapper.mapFromCCDFToCDS)(result === null || result === void 0 ? void 0 : result.ccdf_list);
|
|
1314
|
+
evt.payload = (0, _loadProjectMapper.updateProjectWithCDSList)(evt.payload, cdsList);
|
|
1315
|
+
cabinetDefinitionList = (0, _ccdfMapper.ccdfMapper)(result === null || result === void 0 ? void 0 : result.ccdf_list, evt === null || evt === void 0 || (_evt$payload2 = evt.payload) === null || _evt$payload2 === void 0 ? void 0 : _evt$payload2.layers['layer-1']);
|
|
1316
|
+
rt = mergeSameElements(cabinetDefinitionList);
|
|
1308
1317
|
_i = 0;
|
|
1309
1318
|
case 1:
|
|
1310
1319
|
if (!(_i < (rt === null || rt === void 0 ? void 0 : rt.length))) {
|
|
@@ -1381,7 +1390,7 @@ function _handleExternalEvent() {
|
|
|
1381
1390
|
case 13:
|
|
1382
1391
|
return _context11.abrupt("continue", 49);
|
|
1383
1392
|
case 14:
|
|
1384
|
-
_constants.ARRAY_3D_MODES.includes(state.mode) ? props.holesActions.selectToolDrawingHole3D(evt === null || evt === void 0 || (_evt$
|
|
1393
|
+
_constants.ARRAY_3D_MODES.includes(state.mode) ? props.holesActions.selectToolDrawingHole3D(evt === null || evt === void 0 || (_evt$payload4 = evt.payload) === null || _evt$payload4 === void 0 ? void 0 : _evt$payload4.holeName) : props.holesActions.selectToolDrawingHole(evt === null || evt === void 0 || (_evt$payload5 = evt.payload) === null || _evt$payload5 === void 0 ? void 0 : _evt$payload5.holeName);
|
|
1385
1394
|
return _context11.abrupt("continue", 49);
|
|
1386
1395
|
case 15:
|
|
1387
1396
|
moveAndRotatePan2D3D(evt.type, props, evt.payload, state);
|
|
@@ -1392,7 +1401,8 @@ function _handleExternalEvent() {
|
|
|
1392
1401
|
props.projectActions.rename(defaulTitle);
|
|
1393
1402
|
return _context11.abrupt("continue", 49);
|
|
1394
1403
|
case 17:
|
|
1395
|
-
_evt$
|
|
1404
|
+
_evt$payload6 = evt.payload, doorStyle = _evt$payload6.doorStyle, applyScope = _evt$payload6.applyScope, _evt$payload6$itemIds = _evt$payload6.itemIds, itemIds = _evt$payload6$itemIds === void 0 ? [] : _evt$payload6$itemIds;
|
|
1405
|
+
itemCDS = [];
|
|
1396
1406
|
_layerId = state.getIn(['scene', 'selectedLayer']);
|
|
1397
1407
|
allItems = state.getIn(['scene', 'layers', _layerId, 'items']).toJS();
|
|
1398
1408
|
targetItems = []; // Prepare idSet for SINGLE or MULTIPLE
|
|
@@ -1420,28 +1430,24 @@ function _handleExternalEvent() {
|
|
|
1420
1430
|
case 20:
|
|
1421
1431
|
return _context11.abrupt("continue", 21);
|
|
1422
1432
|
case 21:
|
|
1423
|
-
|
|
1433
|
+
ccdf_list = [];
|
|
1424
1434
|
_loop7 = /*#__PURE__*/_regenerator["default"].mark(function _loop7() {
|
|
1425
|
-
var
|
|
1426
|
-
var item, cdsId;
|
|
1435
|
+
var item;
|
|
1427
1436
|
return _regenerator["default"].wrap(function (_context10) {
|
|
1428
1437
|
while (1) switch (_context10.prev = _context10.next) {
|
|
1429
1438
|
case 0:
|
|
1430
1439
|
item = targetItems[_i2];
|
|
1431
|
-
|
|
1432
|
-
return
|
|
1433
|
-
})) === null || _itemCDS$find === void 0 ? void 0 : _itemCDS$find.cabinet_door_style_id;
|
|
1434
|
-
if (cdsId && !_cdsItems.some(function (v) {
|
|
1435
|
-
return item.itemID === v.itemID && item.name === v.name && cdsId === v.cdsId;
|
|
1440
|
+
if (!ccdf_list.some(function (v) {
|
|
1441
|
+
return item.itemID === v.itemID && item.name === v.name && doorStyle.id === v.doorFinishId;
|
|
1436
1442
|
})) {
|
|
1437
|
-
|
|
1443
|
+
ccdf_list.push({
|
|
1438
1444
|
itemID: item.itemID,
|
|
1439
1445
|
prototype: item.prototype,
|
|
1440
1446
|
category: item.category,
|
|
1441
1447
|
name: item.name,
|
|
1442
1448
|
type: item.type,
|
|
1443
1449
|
sku_number: item.sku_number,
|
|
1444
|
-
|
|
1450
|
+
doorFinishId: doorStyle.id
|
|
1445
1451
|
});
|
|
1446
1452
|
}
|
|
1447
1453
|
case 1:
|
|
@@ -1462,19 +1468,24 @@ function _handleExternalEvent() {
|
|
|
1462
1468
|
_context11.next = 22;
|
|
1463
1469
|
break;
|
|
1464
1470
|
case 24:
|
|
1465
|
-
if (
|
|
1471
|
+
if (ccdf_list.length > 0) {
|
|
1466
1472
|
(_props$onInternalEven2 = props.onInternalEvent) === null || _props$onInternalEven2 === void 0 || _props$onInternalEven2.call(props, {
|
|
1467
1473
|
type: _constants.INTERNAL_EVENT_ITEMS_CATALOG,
|
|
1468
1474
|
value: {
|
|
1469
|
-
|
|
1475
|
+
ccdf_list: ccdf_list
|
|
1470
1476
|
}
|
|
1471
|
-
},
|
|
1477
|
+
},
|
|
1478
|
+
/*#__PURE__*/
|
|
1479
|
+
// result is ccdf_list
|
|
1480
|
+
function () {
|
|
1472
1481
|
var _ref4 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee9(result) {
|
|
1473
|
-
var rt, _i3;
|
|
1482
|
+
var mappedCabinetDefinitionList, rt, _i3;
|
|
1474
1483
|
return _regenerator["default"].wrap(function (_context1) {
|
|
1475
1484
|
while (1) switch (_context1.prev = _context1.next) {
|
|
1476
1485
|
case 0:
|
|
1477
|
-
|
|
1486
|
+
itemCDS = (0, _ccdfToCDSMapper.mapFromCCDFToCDS)(result === null || result === void 0 ? void 0 : result.ccdf_list);
|
|
1487
|
+
mappedCabinetDefinitionList = (0, _ccdfMapper.ccdfMapper)(result.ccdf_list, layer); // result: ccdf_list
|
|
1488
|
+
rt = mergeSameElements(mappedCabinetDefinitionList);
|
|
1478
1489
|
_i3 = 0;
|
|
1479
1490
|
case 1:
|
|
1480
1491
|
if (!(_i3 < (rt === null || rt === void 0 ? void 0 : rt.length))) {
|
|
@@ -1504,7 +1515,7 @@ function _handleExternalEvent() {
|
|
|
1504
1515
|
}
|
|
1505
1516
|
return _context11.abrupt("continue", 49);
|
|
1506
1517
|
case 25:
|
|
1507
|
-
_evt$
|
|
1518
|
+
_evt$payload7 = evt.payload, roomShapeType = _evt$payload7.roomShapeType, width = _evt$payload7.width, height = _evt$payload7.height, measurementUnit = _evt$payload7.measurementUnit, _doorStyle = _evt$payload7.doorStyle;
|
|
1508
1519
|
props.projectActions.createRoomWithShape(roomShapeType, width, height, measurementUnit, _doorStyle);
|
|
1509
1520
|
return _context11.abrupt("continue", 49);
|
|
1510
1521
|
case 26:
|
|
@@ -1533,7 +1544,7 @@ function _handleExternalEvent() {
|
|
|
1533
1544
|
props.projectActions.redo();
|
|
1534
1545
|
return _context11.abrupt("continue", 49);
|
|
1535
1546
|
case 31:
|
|
1536
|
-
_evt$
|
|
1547
|
+
_evt$payload8 = evt.payload, moldingInfo = _evt$payload8.moldingInfo, isGlobal = _evt$payload8.isGlobal;
|
|
1537
1548
|
_context11.next = 32;
|
|
1538
1549
|
return loadMoldingSvg(moldingInfo);
|
|
1539
1550
|
case 32:
|
|
@@ -1548,7 +1559,7 @@ function _handleExternalEvent() {
|
|
|
1548
1559
|
if (_distElement) props.projectActions.remove(_distElement);
|
|
1549
1560
|
return _context11.abrupt("continue", 49);
|
|
1550
1561
|
case 35:
|
|
1551
|
-
_evt$
|
|
1562
|
+
_evt$payload9 = evt.payload, option = _evt$payload9.option, _value2 = _evt$payload9.value;
|
|
1552
1563
|
_t7 = option;
|
|
1553
1564
|
_context11.next = _t7 === _constants.PROJECT_SETTING_OPTION.CHANGE_MEASUREMENT_UNIT ? 36 : _t7 === _constants.PROJECT_SETTING_OPTION.UPDATE_CEIL_HEIGHT ? 37 : _t7 === _constants.PROJECT_SETTING_OPTION.CHANGE_WALL_LENGTH_MEASURE ? 38 : _t7 === _constants.PROJECT_SETTING_OPTION.CHANGE_BASE_CABINET_MEASURE ? 39 : _t7 === _constants.PROJECT_SETTING_OPTION.CHANGE_WALL_CABINET_MEASURE ? 40 : _t7 === _constants.PROJECT_SETTING_OPTION.CHANGE_WINDOW_DOOR_MEASURE ? 41 : 42;
|
|
1554
1565
|
break;
|
|
@@ -1589,7 +1600,7 @@ function _handleExternalEvent() {
|
|
|
1589
1600
|
case 45:
|
|
1590
1601
|
_layerID = state.scene.selectedLayer;
|
|
1591
1602
|
_layer2 = state.scene.getIn(['layers', _layerID]).toJS();
|
|
1592
|
-
orginalItemInfo = evt === null || evt === void 0 || (_evt$
|
|
1603
|
+
orginalItemInfo = evt === null || evt === void 0 || (_evt$payload0 = evt.payload) === null || _evt$payload0 === void 0 ? void 0 : _evt$payload0.orginalItemInfo;
|
|
1593
1604
|
originalItem = _layer2 === null || _layer2 === void 0 ? void 0 : _layer2.items[orginalItemInfo.id];
|
|
1594
1605
|
_context11.next = 46;
|
|
1595
1606
|
return addItemToCatalog(evt.payload.replaceItemInfo, state, props.catalog, props.projectActions);
|
|
@@ -1601,10 +1612,10 @@ function _handleExternalEvent() {
|
|
|
1601
1612
|
y: originalItem.y
|
|
1602
1613
|
};
|
|
1603
1614
|
replaceItem = {
|
|
1604
|
-
name: evt === null || evt === void 0 || (_evt$
|
|
1615
|
+
name: evt === null || evt === void 0 || (_evt$payload1 = evt.payload) === null || _evt$payload1 === void 0 || (_evt$payload1 = _evt$payload1.replaceItemInfo) === null || _evt$payload1 === void 0 ? void 0 : _evt$payload1.name,
|
|
1605
1616
|
info: {
|
|
1606
|
-
width: evt === null || evt === void 0 || (_evt$
|
|
1607
|
-
height: evt === null || evt === void 0 || (_evt$
|
|
1617
|
+
width: evt === null || evt === void 0 || (_evt$payload10 = evt.payload) === null || _evt$payload10 === void 0 || (_evt$payload10 = _evt$payload10.replaceItemInfo) === null || _evt$payload10 === void 0 || (_evt$payload10 = _evt$payload10.sizeinfo) === null || _evt$payload10 === void 0 ? void 0 : _evt$payload10.width,
|
|
1618
|
+
height: evt === null || evt === void 0 || (_evt$payload11 = evt.payload) === null || _evt$payload11 === void 0 || (_evt$payload11 = _evt$payload11.replaceItemInfo) === null || _evt$payload11 === void 0 || (_evt$payload11 = _evt$payload11.sizeinfo) === null || _evt$payload11 === void 0 ? void 0 : _evt$payload11.height
|
|
1608
1619
|
}
|
|
1609
1620
|
};
|
|
1610
1621
|
props.itemsActions.replaceItem(originalItemPos, originalItem, replaceItem);
|
|
@@ -1614,7 +1625,8 @@ function _handleExternalEvent() {
|
|
|
1614
1625
|
return _context11.abrupt("continue", 49);
|
|
1615
1626
|
case 48:
|
|
1616
1627
|
sceneData = state.scene.toJS(); // get molding data for "ReviewForQuote"
|
|
1617
|
-
currentTexture =
|
|
1628
|
+
currentTexture = (_layer$doorStyle = layer === null || layer === void 0 ? void 0 : layer.doorStyle) !== null && _layer$doorStyle !== void 0 ? _layer$doorStyle : props.state.doorStyle;
|
|
1629
|
+
if (!(0, _helper.isEmpty)(currentTexture) && _immutable.Map.isMap(currentTexture)) currentTexture = (_currentTexture = currentTexture) === null || _currentTexture === void 0 ? void 0 : _currentTexture.toJS();
|
|
1618
1630
|
moldingPieceLength = (_props$configData$mol = props === null || props === void 0 || (_props$configData = props.configData) === null || _props$configData === void 0 ? void 0 : _props$configData.moldingPieceLength) !== null && _props$configData$mol !== void 0 ? _props$configData$mol : _constants.DEFAULT_MOLDING_PIECE_LENGTH;
|
|
1619
1631
|
sceneData.layers[layerId].moldingData = (0, _molding.getMoldingDataOfScene2)(layer, props.catalog, currentTexture, moldingPieceLength);
|
|
1620
1632
|
|
package/lib/utils/molding.js
CHANGED
|
@@ -276,8 +276,9 @@ function getLinesOfItem(item, allLineRects, catalog) {
|
|
|
276
276
|
var hUnit = item.properties.get('depth').get('_unit') || 'cm';
|
|
277
277
|
newDepth = (0, _convertUnitsLite.convert)(newDepth).from(hUnit).to('cm');
|
|
278
278
|
if (item) {
|
|
279
|
+
var _element;
|
|
279
280
|
// Get Outline Data of Selected Item
|
|
280
|
-
outline = element.info.outline;
|
|
281
|
+
outline = (_element = element) === null || _element === void 0 || (_element = _element.info) === null || _element === void 0 ? void 0 : _element.outline;
|
|
281
282
|
if (outline) {
|
|
282
283
|
// Extract Points from `outline`
|
|
283
284
|
var outlinePaths = outline.paths;
|
|
@@ -347,9 +348,9 @@ function getLinesOfItem2(item, allLineRects, catalog) {
|
|
|
347
348
|
var hUnit = item.properties.get('depth').get('_unit') || 'cm';
|
|
348
349
|
newDepth = (0, _convertUnitsLite.convert)(newDepth).from(hUnit).to('cm');
|
|
349
350
|
if (item) {
|
|
350
|
-
var
|
|
351
|
+
var _element2;
|
|
351
352
|
// Get Outline Data of Selected Item
|
|
352
|
-
outline = (
|
|
353
|
+
outline = (_element2 = element) === null || _element2 === void 0 ? void 0 : _element2.info.outline;
|
|
353
354
|
if (outline) {
|
|
354
355
|
// Extract Points from `outline`
|
|
355
356
|
var outlinePaths = outline.paths;
|
|
@@ -457,6 +458,7 @@ function getLinesFromItems2(moldingGroup, layer, catalog) {
|
|
|
457
458
|
var MGlines = [];
|
|
458
459
|
var MGlinesOtherSnapped = [];
|
|
459
460
|
var items = (0, _toConsumableArray2["default"])(moldingGroup.items);
|
|
461
|
+
items = sortItemsByDistance(items, items[0]);
|
|
460
462
|
// The other item's lines (these items are snapped to the moldingGroup items)
|
|
461
463
|
var itemsOtherSnapped = layer.items.toArray().filter(function (item) {
|
|
462
464
|
if (items.some(function (it) {
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|