kitchen-simulator 3.0.1 → 3.1.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/actions/lines-actions.js +3 -1
- package/es/catalog/utils/item-loader.js +1 -0
- package/es/class/item.js +4 -0
- package/es/class/line.js +14 -2
- package/es/components/viewer2d/item.js +5 -2
- package/es/components/viewer2d/rulerDist.js +1 -1
- package/es/components/viewer2d/viewer2d.js +5 -3
- package/es/components/viewer3d/viewer3d.js +72 -61
- package/es/constants.js +1 -0
- package/es/reducers/lines-reducer.js +1 -1
- package/es/utils/isolate-event-handler.js +148 -64
- package/lib/actions/lines-actions.js +3 -1
- package/lib/catalog/utils/item-loader.js +1 -0
- package/lib/class/item.js +4 -0
- package/lib/class/line.js +13 -1
- package/lib/components/viewer2d/item.js +4 -1
- package/lib/components/viewer2d/rulerDist.js +1 -1
- package/lib/components/viewer2d/viewer2d.js +5 -3
- package/lib/components/viewer3d/viewer3d.js +72 -61
- package/lib/constants.js +5 -4
- package/lib/reducers/lines-reducer.js +1 -1
- package/lib/utils/isolate-event-handler.js +148 -64
- package/package.json +1 -1
|
@@ -117,10 +117,13 @@ function _parseTempPlaceholdersFromCabinetPayload() {
|
|
|
117
117
|
tempPlaceholders.map(function (element) {
|
|
118
118
|
var sink_match = element.name.match(/\d_(sink_[^LR12]*)(_[LR12])?$/);
|
|
119
119
|
if (sink_match && sink_match.length >= 2) {
|
|
120
|
-
var _cabinetPayload$struc3;
|
|
120
|
+
var _process$env$API_URL, _cabinetPayload$struc3;
|
|
121
121
|
tempData['sink'] = tempData['sink'] || [];
|
|
122
122
|
tempData['sink'].push(element.name);
|
|
123
|
-
var sink_url = process.env.API_URL
|
|
123
|
+
var sink_url = (_process$env$API_URL = process.env.API_URL) !== null && _process$env$API_URL !== void 0 ? _process$env$API_URL :
|
|
124
|
+
// server url from 3DTool env
|
|
125
|
+
import.meta.env.VITE_APP_API_URL + // server url from Host env
|
|
126
|
+
"/uploads/assets/default/".concat(sink_match[1], ".gltf");
|
|
124
127
|
if (cabinetPayload !== null && cabinetPayload !== void 0 && (_cabinetPayload$struc3 = cabinetPayload.structure_json) !== null && _cabinetPayload$struc3 !== void 0 && (_cabinetPayload$struc3 = _cabinetPayload$struc3.tempPlaceholders[0]) !== null && _cabinetPayload$struc3 !== void 0 && _cabinetPayload$struc3.structure) cabinetPayload.structure_json.tempPlaceholders[0].structure.sink = sink_url;
|
|
125
128
|
} else if (temp.some(function (felement) {
|
|
126
129
|
return felement.name.includes('base_drawer');
|
|
@@ -1056,17 +1059,17 @@ function handleExternalEvent(_x10) {
|
|
|
1056
1059
|
return _handleExternalEvent.apply(this, arguments);
|
|
1057
1060
|
}
|
|
1058
1061
|
function _handleExternalEvent() {
|
|
1059
|
-
_handleExternalEvent = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
1062
|
+
_handleExternalEvent = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee9(props) {
|
|
1060
1063
|
var _evt$payload3, _evt$payload4;
|
|
1061
|
-
var evt, state, _evt$payload, cdsItems, itemKeys, _loop3, i, _props$onInternalEven, sLineCnt, element, _state$viewer2D, _evt$payload$initialP, mouseX, mouseY, v2d, vPosX, vPosY, layerID, defaulTitle, _evt$payload5, doorStyle, itemCDS, isAll, _evt$payload6, roomShapeType, width, height, _doorStyle, value, _value, _evt$payload7, moldingInfo, isGlobal, distElement, _distElement, _evt$payload8, option, _value2,
|
|
1062
|
-
return _regenerator["default"].wrap(function (
|
|
1063
|
-
while (1) switch (
|
|
1064
|
+
var evt, state, _evt$payload, cdsItems, itemKeys, _loop3, i, _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, _layerId, layer, _layer$getIn, selectedLines, selectedHoles, selectedItems, _i4, _i5, _i6, _evt$payload9, _evt$payload0, _evt$payload1, _evt$payload10, _layerID, _layer, orginalItemInfo, originalItem, originalItemPos, replaceItem, _props$onInternalEven3, _t5;
|
|
1065
|
+
return _regenerator["default"].wrap(function (_context1) {
|
|
1066
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
1064
1067
|
case 0:
|
|
1065
1068
|
// console.log('***external event****', props);
|
|
1066
1069
|
evt = props.externalEvent;
|
|
1067
1070
|
state = props.state.get('KitchenConfigurator');
|
|
1068
1071
|
_t5 = evt === null || evt === void 0 ? void 0 : evt.type;
|
|
1069
|
-
|
|
1072
|
+
_context1.next = _t5 === _constants.EXTERNAL_EVENT_LOAD_PROJECT ? 1 : _t5 === _constants.EXTERNAL_EVENT_TOGGLE_TO_3D ? 5 : _t5 === _constants.EXTERNAL_EVENT_TOGGLE_TO_2D ? 6 : _t5 === _constants.EXTERNAL_EVENT_TOGGLE_TO_ELEVATION ? 7 : _t5 === _constants.EXTERNAL_EVENT_ADD_WALL ? 8 : _t5 === _constants.EXTERNAL_EVENT_ADD_ITEM ? 9 : _t5 === _constants.EXTERNAL_EVENT_ADD_HOLE ? 12 : _t5 === _constants.EXTERNAL_EVENT_MOVE_PAN ? 13 : _t5 === _constants.EXTERNAL_EVENT_NEW_PROJECT ? 14 : _t5 === _constants.EXTERNAL_EVENT_CHANGE_DOORSTYLE ? 15 : _t5 === _constants.EXTERNAL_EVENT_ADD_ROOM_SHAPE ? 19 : _t5 === _constants.EXTERNAL_EVENT_ZOOM_IN ? 20 : _t5 === _constants.EXTERNAL_EVENT_ZOOM_OUT ? 21 : _t5 === _constants.EXTERNAL_EVENT_CENTERING_2D ? 22 : _t5 === _constants.EXTERNAL_EVENT_UNDO ? 23 : _t5 === _constants.EXTERNAL_EVENT_REDO ? 24 : _t5 === _constants.EXTERNAL_EVENT_SET_MOLDING ? 25 : _t5 === _constants.EXTERNAL_EVENT_DUPLICATE_ELEMENT ? 27 : _t5 === _constants.EXTERNAL_EVENT_DELETE_ELEMENT ? 28 : _t5 === _constants.EXTERNAL_EVENT_PROJECT_SETTING ? 29 : _t5 === _constants.EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? 30 : _t5 === _constants.EXTERNAL_EVENT_UPDATE_PROPERTY ? 30 : _t5 === _constants.EXTERNAL_EVENT_REPLACE_CABINET ? 31 : _t5 === _constants.EXTERNAL_EVENT_SET_FINISHING ? 33 : _t5 === _constants.EXTERNAL_EVENT_SYNC_SCENE ? 34 : 35;
|
|
1070
1073
|
break;
|
|
1071
1074
|
case 1:
|
|
1072
1075
|
// prepare item data request
|
|
@@ -1081,7 +1084,7 @@ function _handleExternalEvent() {
|
|
|
1081
1084
|
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]];
|
|
1082
1085
|
if (!cdsItems.some(function (v) {
|
|
1083
1086
|
var _it$doorStyle;
|
|
1084
|
-
return it.
|
|
1087
|
+
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;
|
|
1085
1088
|
})) cdsItems.push({
|
|
1086
1089
|
itemID: it.itemID,
|
|
1087
1090
|
prototype: it.prototype,
|
|
@@ -1100,13 +1103,13 @@ function _handleExternalEvent() {
|
|
|
1100
1103
|
i = 0;
|
|
1101
1104
|
case 2:
|
|
1102
1105
|
if (!(i < itemKeys.length)) {
|
|
1103
|
-
|
|
1106
|
+
_context1.next = 4;
|
|
1104
1107
|
break;
|
|
1105
1108
|
}
|
|
1106
|
-
return
|
|
1109
|
+
return _context1.delegateYield(_loop3(), "t0", 3);
|
|
1107
1110
|
case 3:
|
|
1108
1111
|
i++;
|
|
1109
|
-
|
|
1112
|
+
_context1.next = 2;
|
|
1110
1113
|
break;
|
|
1111
1114
|
case 4:
|
|
1112
1115
|
// request item catalog data to host app
|
|
@@ -1147,30 +1150,30 @@ function _handleExternalEvent() {
|
|
|
1147
1150
|
};
|
|
1148
1151
|
}());
|
|
1149
1152
|
}
|
|
1150
|
-
return
|
|
1153
|
+
return _context1.abrupt("continue", 35);
|
|
1151
1154
|
case 5:
|
|
1152
1155
|
props.projectActions.setMode(_constants.MODE_IDLE_3D);
|
|
1153
|
-
return
|
|
1156
|
+
return _context1.abrupt("continue", 35);
|
|
1154
1157
|
case 6:
|
|
1155
1158
|
props.projectActions.setMode(_constants.MODE_IDLE);
|
|
1156
|
-
return
|
|
1159
|
+
return _context1.abrupt("continue", 35);
|
|
1157
1160
|
case 7:
|
|
1158
1161
|
sLineCnt = state.getIn(['scene', 'layers', 'layer-1', 'selected', 'lines']).size;
|
|
1159
1162
|
if (sLineCnt > 0) props.projectActions.setMode(_constants.MODE_ELEVATION_VIEW);
|
|
1160
|
-
return
|
|
1163
|
+
return _context1.abrupt("continue", 35);
|
|
1161
1164
|
case 8:
|
|
1162
1165
|
if (state.mode === _constants.MODE_IDLE || state.mode === _constants.MODE_2D_PAN) props.linesActions.selectToolDrawingLine('wall');else {
|
|
1163
1166
|
props.projectActions.setMode(_constants.MODE_IDLE);
|
|
1164
1167
|
props.linesActions.selectToolDrawingLine('wall');
|
|
1165
1168
|
}
|
|
1166
|
-
return
|
|
1169
|
+
return _context1.abrupt("continue", 35);
|
|
1167
1170
|
case 9:
|
|
1168
1171
|
if ((0, _helper.isEmpty)(evt === null || evt === void 0 ? void 0 : evt.payload)) {
|
|
1169
|
-
|
|
1172
|
+
_context1.next = 11;
|
|
1170
1173
|
break;
|
|
1171
1174
|
}
|
|
1172
1175
|
element = evt.payload;
|
|
1173
|
-
|
|
1176
|
+
_context1.next = 10;
|
|
1174
1177
|
return addItemToCatalog(element, state, props.catalog, props.projectActions);
|
|
1175
1178
|
case 10:
|
|
1176
1179
|
// start drawing item
|
|
@@ -1194,67 +1197,148 @@ function _handleExternalEvent() {
|
|
|
1194
1197
|
props.projectActions.pushLastSelectedCatalogElementToHistory(element);
|
|
1195
1198
|
props.projectActions.setIsCabinetDrawing(true);
|
|
1196
1199
|
case 11:
|
|
1197
|
-
return
|
|
1200
|
+
return _context1.abrupt("continue", 35);
|
|
1198
1201
|
case 12:
|
|
1199
1202
|
_constants.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);
|
|
1200
|
-
return
|
|
1203
|
+
return _context1.abrupt("continue", 35);
|
|
1201
1204
|
case 13:
|
|
1202
1205
|
movePan2D3D(props, evt.payload, state);
|
|
1203
|
-
return
|
|
1206
|
+
return _context1.abrupt("continue", 35);
|
|
1204
1207
|
case 14:
|
|
1205
1208
|
defaulTitle = 'Untitle';
|
|
1206
1209
|
props.projectActions.newProject();
|
|
1207
1210
|
props.projectActions.rename(defaulTitle);
|
|
1208
|
-
return
|
|
1211
|
+
return _context1.abrupt("continue", 35);
|
|
1209
1212
|
case 15:
|
|
1210
|
-
_evt$payload5 = evt.payload, doorStyle = _evt$payload5.doorStyle, itemCDS = _evt$payload5.itemCDS, isAll = _evt$payload5.isAll;
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
+
_evt$payload5 = evt.payload, doorStyle = _evt$payload5.doorStyle, itemCDS = _evt$payload5.itemCDS, isAll = _evt$payload5.isAll; // prepare item data request
|
|
1214
|
+
layerId = state.getIn(['scene', 'selectedLayer']);
|
|
1215
|
+
_cdsItems = [];
|
|
1216
|
+
allItems = state.getIn(['scene', 'layers', layerId, 'items']).toJS();
|
|
1217
|
+
selectedItemId = state.getIn(['scene', 'layers', layerId]).selected.items.toJS()[0];
|
|
1218
|
+
_itemKeys = isAll ? (_Object$keys = Object.keys(allItems)) !== null && _Object$keys !== void 0 ? _Object$keys : [] : [selectedItemId];
|
|
1219
|
+
_loop4 = /*#__PURE__*/_regenerator["default"].mark(function _loop4() {
|
|
1220
|
+
var _itemCDS$find;
|
|
1221
|
+
var item, cdsId;
|
|
1222
|
+
return _regenerator["default"].wrap(function (_context0) {
|
|
1223
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
1224
|
+
case 0:
|
|
1225
|
+
item = allItems[_itemKeys[_i2]];
|
|
1226
|
+
cdsId = (_itemCDS$find = itemCDS.find(function (itCDS) {
|
|
1227
|
+
return itCDS.itemID === item.itemID;
|
|
1228
|
+
})) === null || _itemCDS$find === void 0 ? void 0 : _itemCDS$find.cabinet_door_style_id;
|
|
1229
|
+
if (cdsId && !_cdsItems.some(function (v) {
|
|
1230
|
+
return it.itemID === v.itemID && it.name === v.name && cdsId === v.cdsId;
|
|
1231
|
+
})) _cdsItems.push({
|
|
1232
|
+
itemID: item.itemID,
|
|
1233
|
+
prototype: item.prototype,
|
|
1234
|
+
category: item.category,
|
|
1235
|
+
name: item.name,
|
|
1236
|
+
type: item.type,
|
|
1237
|
+
sku_number: item.sku_number,
|
|
1238
|
+
cdsId: cdsId
|
|
1239
|
+
});
|
|
1240
|
+
case 1:
|
|
1241
|
+
case "end":
|
|
1242
|
+
return _context0.stop();
|
|
1243
|
+
}
|
|
1244
|
+
}, _loop4);
|
|
1245
|
+
});
|
|
1246
|
+
_i2 = 0;
|
|
1213
1247
|
case 16:
|
|
1248
|
+
if (!(_i2 < _itemKeys.length)) {
|
|
1249
|
+
_context1.next = 18;
|
|
1250
|
+
break;
|
|
1251
|
+
}
|
|
1252
|
+
return _context1.delegateYield(_loop4(), "t1", 17);
|
|
1253
|
+
case 17:
|
|
1254
|
+
_i2++;
|
|
1255
|
+
_context1.next = 16;
|
|
1256
|
+
break;
|
|
1257
|
+
case 18:
|
|
1258
|
+
// request item catalog data to host app
|
|
1259
|
+
if (_cdsItems.length > 0) {
|
|
1260
|
+
(_props$onInternalEven2 = props.onInternalEvent) === null || _props$onInternalEven2 === void 0 || _props$onInternalEven2.call(props, {
|
|
1261
|
+
type: _constants.INTERNAL_EVENT_ITEMS_CATALOG,
|
|
1262
|
+
value: {
|
|
1263
|
+
cdsItems: _cdsItems
|
|
1264
|
+
}
|
|
1265
|
+
}, /*#__PURE__*/function () {
|
|
1266
|
+
var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee8(result) {
|
|
1267
|
+
var _i3, _result$elements2;
|
|
1268
|
+
return _regenerator["default"].wrap(function (_context9) {
|
|
1269
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
1270
|
+
case 0:
|
|
1271
|
+
_i3 = 0;
|
|
1272
|
+
case 1:
|
|
1273
|
+
if (!(_i3 < (result === null || result === void 0 || (_result$elements2 = result.elements) === null || _result$elements2 === void 0 ? void 0 : _result$elements2.length))) {
|
|
1274
|
+
_context9.next = 3;
|
|
1275
|
+
break;
|
|
1276
|
+
}
|
|
1277
|
+
_context9.next = 2;
|
|
1278
|
+
return addItemToCatalog(result.elements[_i3], state, props.catalog, props.projectActions);
|
|
1279
|
+
case 2:
|
|
1280
|
+
_i3++;
|
|
1281
|
+
_context9.next = 1;
|
|
1282
|
+
break;
|
|
1283
|
+
case 3:
|
|
1284
|
+
props.itemsActions.setDoorStyle(doorStyle, itemCDS, isAll);
|
|
1285
|
+
case 4:
|
|
1286
|
+
case "end":
|
|
1287
|
+
return _context9.stop();
|
|
1288
|
+
}
|
|
1289
|
+
}, _callee8);
|
|
1290
|
+
}));
|
|
1291
|
+
return function (_x12) {
|
|
1292
|
+
return _ref3.apply(this, arguments);
|
|
1293
|
+
};
|
|
1294
|
+
}());
|
|
1295
|
+
} else props.itemsActions.setDoorStyle(doorStyle, itemCDS, isAll);
|
|
1296
|
+
return _context1.abrupt("continue", 35);
|
|
1297
|
+
case 19:
|
|
1214
1298
|
_evt$payload6 = evt.payload, roomShapeType = _evt$payload6.roomShapeType, width = _evt$payload6.width, height = _evt$payload6.height, _doorStyle = _evt$payload6.doorStyle;
|
|
1215
1299
|
props.projectActions.createRoomWithShape(roomShapeType, width, height, _doorStyle);
|
|
1216
|
-
return
|
|
1217
|
-
case
|
|
1300
|
+
return _context1.abrupt("continue", 35);
|
|
1301
|
+
case 20:
|
|
1218
1302
|
value = state.getIn(['viewer2D']).toJS();
|
|
1219
1303
|
value.a += 0.1;
|
|
1220
1304
|
value.d += 0.1;
|
|
1221
1305
|
value.e -= value.SVGWidth * 0.1 / 2;
|
|
1222
1306
|
value.f -= value.SVGHeight * 0.1 / 2;
|
|
1223
1307
|
(0, _helper.updateViwer2D)(value, props.viewer2DActions);
|
|
1224
|
-
return
|
|
1225
|
-
case
|
|
1308
|
+
return _context1.abrupt("continue", 35);
|
|
1309
|
+
case 21:
|
|
1226
1310
|
_value = state.getIn(['viewer2D']).toJS();
|
|
1227
1311
|
_value.a -= 0.1;
|
|
1228
1312
|
_value.d -= 0.1;
|
|
1229
1313
|
_value.e += _value.SVGWidth * 0.1 / 2;
|
|
1230
1314
|
_value.f += _value.SVGHeight * 0.1 / 2;
|
|
1231
1315
|
(0, _helper.updateViwer2D)(_value, props.viewer2DActions);
|
|
1232
|
-
return
|
|
1233
|
-
case
|
|
1316
|
+
return _context1.abrupt("continue", 35);
|
|
1317
|
+
case 22:
|
|
1234
1318
|
(0, _helper.centering2D)(state, props.viewer2DActions);
|
|
1235
|
-
return
|
|
1236
|
-
case
|
|
1319
|
+
return _context1.abrupt("continue", 35);
|
|
1320
|
+
case 23:
|
|
1237
1321
|
props.projectActions.undo();
|
|
1238
|
-
return
|
|
1239
|
-
case
|
|
1322
|
+
return _context1.abrupt("continue", 35);
|
|
1323
|
+
case 24:
|
|
1240
1324
|
props.projectActions.redo();
|
|
1241
|
-
return
|
|
1242
|
-
case
|
|
1325
|
+
return _context1.abrupt("continue", 35);
|
|
1326
|
+
case 25:
|
|
1243
1327
|
_evt$payload7 = evt.payload, moldingInfo = _evt$payload7.moldingInfo, isGlobal = _evt$payload7.isGlobal;
|
|
1244
|
-
|
|
1328
|
+
_context1.next = 26;
|
|
1245
1329
|
return loadMoldingSvg(moldingInfo);
|
|
1246
|
-
case
|
|
1330
|
+
case 26:
|
|
1247
1331
|
props.itemsActions.setMolding(moldingInfo, isGlobal);
|
|
1248
|
-
return
|
|
1249
|
-
case
|
|
1332
|
+
return _context1.abrupt("continue", 35);
|
|
1333
|
+
case 27:
|
|
1250
1334
|
distElement = getElement(evt.payload, state);
|
|
1251
1335
|
if (distElement) props.itemsActions.duplicateSelected(distElement, props.onInternalEvent);
|
|
1252
|
-
return
|
|
1253
|
-
case
|
|
1336
|
+
return _context1.abrupt("continue", 35);
|
|
1337
|
+
case 28:
|
|
1254
1338
|
_distElement = getElement(evt.payload, state);
|
|
1255
1339
|
if (_distElement) props.projectActions.remove(_distElement);
|
|
1256
|
-
return
|
|
1257
|
-
case
|
|
1340
|
+
return _context1.abrupt("continue", 35);
|
|
1341
|
+
case 29:
|
|
1258
1342
|
_evt$payload8 = evt.payload, option = _evt$payload8.option, _value2 = _evt$payload8.value;
|
|
1259
1343
|
if (option === _constants.PROJECT_SETTING_OPTION.UPDATE_CEIL_HEIGHT) {
|
|
1260
1344
|
props.viewer2DActions.updateCeilHeight(_value2);
|
|
@@ -1268,23 +1352,23 @@ function _handleExternalEvent() {
|
|
|
1268
1352
|
} else if (option === _constants.PROJECT_SETTING_OPTION.CHANGE_WINDOW_DOOR_MEASURE) {
|
|
1269
1353
|
props.viewer2DActions.changeWindowDoorMeasure(_value2);
|
|
1270
1354
|
}
|
|
1271
|
-
return
|
|
1272
|
-
case
|
|
1273
|
-
|
|
1274
|
-
layer = state.getIn(['scene', 'layers',
|
|
1355
|
+
return _context1.abrupt("continue", 35);
|
|
1356
|
+
case 30:
|
|
1357
|
+
_layerId = state.getIn(['scene', 'selectedLayer']);
|
|
1358
|
+
layer = state.getIn(['scene', 'layers', _layerId]);
|
|
1275
1359
|
_layer$getIn = layer.getIn(['selected']), selectedLines = _layer$getIn.lines, selectedHoles = _layer$getIn.holes, selectedItems = _layer$getIn.items;
|
|
1276
|
-
for (
|
|
1277
|
-
for (
|
|
1278
|
-
for (
|
|
1279
|
-
return
|
|
1280
|
-
case
|
|
1360
|
+
for (_i4 = 0; _i4 < selectedLines.size; _i4++) (evt === null || evt === void 0 ? void 0 : evt.type) === _constants.EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(layer.getIn(['lines', selectedLines.get(_i4)]), evt.payload, state, layer, props.projectActions, evt.callback) : updatePropertyOfSelectedElement(layer.getIn(['lines', selectedLines.get(_i4)]), evt.payload, props.catalog, props.projectActions, evt.callback);
|
|
1361
|
+
for (_i5 = 0; _i5 < selectedHoles.size; _i5++) (evt === null || evt === void 0 ? void 0 : evt.type) === _constants.EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(layer.getIn(['holes', selectedHoles.get(_i5)]), evt.payload, state, layer, props.projectActions, evt.callback) : updatePropertyOfSelectedElement(layer.getIn(['holes', selectedHoles.get(_i5)]), evt.payload, props.catalog, props.projectActions, evt.callback);
|
|
1362
|
+
for (_i6 = 0; _i6 < selectedItems.size; _i6++) (evt === null || evt === void 0 ? void 0 : evt.type) === _constants.EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(layer.getIn(['items', selectedItems.get(_i6)]), evt.payload, state, layer, props.projectActions, evt.callback) : updatePropertyOfSelectedElement(layer.getIn(['items', selectedItems.get(_i6)]), evt.payload, props.catalog, props.projectActions, evt.callback);
|
|
1363
|
+
return _context1.abrupt("continue", 35);
|
|
1364
|
+
case 31:
|
|
1281
1365
|
_layerID = state.scene.selectedLayer;
|
|
1282
1366
|
_layer = state.scene.getIn(['layers', _layerID]).toJS();
|
|
1283
1367
|
orginalItemInfo = evt === null || evt === void 0 || (_evt$payload9 = evt.payload) === null || _evt$payload9 === void 0 ? void 0 : _evt$payload9.orginalItemInfo;
|
|
1284
1368
|
originalItem = _layer === null || _layer === void 0 ? void 0 : _layer.items[orginalItemInfo.id];
|
|
1285
|
-
|
|
1369
|
+
_context1.next = 32;
|
|
1286
1370
|
return addItemToCatalog(evt.payload.replaceItemInfo, state, props.catalog, props.projectActions);
|
|
1287
|
-
case
|
|
1371
|
+
case 32:
|
|
1288
1372
|
originalItemPos = {
|
|
1289
1373
|
rotation: originalItem.rotation,
|
|
1290
1374
|
selectedItemId: originalItem.id,
|
|
@@ -1299,23 +1383,23 @@ function _handleExternalEvent() {
|
|
|
1299
1383
|
}
|
|
1300
1384
|
};
|
|
1301
1385
|
props.itemsActions.replaceItem(originalItemPos, originalItem, replaceItem);
|
|
1302
|
-
return
|
|
1303
|
-
case
|
|
1386
|
+
return _context1.abrupt("continue", 35);
|
|
1387
|
+
case 33:
|
|
1304
1388
|
setFinishing(props, state, evt.payload);
|
|
1305
|
-
case
|
|
1389
|
+
case 34:
|
|
1306
1390
|
// send scene object from 3DTool to HostApp using internalEvent
|
|
1307
|
-
(_props$
|
|
1391
|
+
(_props$onInternalEven3 = props.onInternalEvent) === null || _props$onInternalEven3 === void 0 || _props$onInternalEven3.call(props, {
|
|
1308
1392
|
type: _constants.INTERNAL_EVENT_SYNC_SCENE,
|
|
1309
1393
|
value: {
|
|
1310
1394
|
scene: state.scene.toJS()
|
|
1311
1395
|
}
|
|
1312
1396
|
});
|
|
1313
|
-
return
|
|
1314
|
-
case
|
|
1397
|
+
return _context1.abrupt("continue", 35);
|
|
1398
|
+
case 35:
|
|
1315
1399
|
case "end":
|
|
1316
|
-
return
|
|
1400
|
+
return _context1.stop();
|
|
1317
1401
|
}
|
|
1318
|
-
},
|
|
1402
|
+
}, _callee9);
|
|
1319
1403
|
}));
|
|
1320
1404
|
return _handleExternalEvent.apply(this, arguments);
|
|
1321
1405
|
}
|